This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const solanaWeb3 = require("@solana/web3.js"); | |
| async function getComputeUnits(txId, clusterName) { | |
| // Use a public RPC endpoint | |
| const connection = new solanaWeb3.Connection( | |
| solanaWeb3.clusterApiUrl(clusterName), | |
| "confirmed", | |
| ); | |
| try { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 1. Add this import line at the top of your file | |
| import { CrossmintPayButton } from "@crossmint/client-sdk-react-ui"; | |
| // 2. Add this component wherever you want the Buy with card button to show | |
| // Ensure the button shows even for your users who don't have connected their wallet! | |
| <CrossmintPayButton | |
| clientId="_YOUR_CLIENT_ID_" | |
| environment="staging" | |
| mintConfig={{ | |
| type: "candy-machine" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 1. Add this import line at the top of your file | |
| import { CrossmintPayButton } from "@crossmint/client-sdk-react-ui"; | |
| // 2. Add this component wherever you want the Buy with card button to show | |
| // Ensure the button shows even for your users who don't have connected their wallet! | |
| <CrossmintPayButton | |
| clientId="_YOUR_CLIENT_ID_" | |
| environment="staging" | |
| mintConfig={{ | |
| type: "erc-721", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ////// CLIENT SIDE | |
| import classnames from 'classnames'; | |
| import * as anchor from '@project-serum/anchor'; | |
| import { Token, TOKEN_PROGRAM_ID } from '@solana/spl-token'; | |
| import { useState, useEffect } from 'react'; | |
| import { WalletMultiButton } from '@solana/wallet-adapter-react-ui'; | |
| import { useWallet, useConnection } from '@solana/wallet-adapter-react'; | |
| import { Container, Snackbar, Paper, CircularProgress } from '@material-ui/core'; | |
| import CTAButton from '../components/CTAButton'; |