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
| import { Transaction, Connection, clusterApiUrl } from "@solana/web3.js"; | |
| const connection = new Connection(clusterApiUrl("devnet")); | |
| // Get the wallet object from your wallet provider | |
| const wallet = useWallet() | |
| export async function signTransaction(transaction) { | |
| // 1. Get transaction form back end and construct buffer form it. | |
| const serializedTransaction = Buffer.from(transaction, "base64"); |
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
| import { DOMElements } from "@chakra-ui/vue-system" | |
| import { computed, defineComponent } from "vue" | |
| function cx(...args: any[]) { | |
| return args.filter(Boolean).join(" ") | |
| } | |
| function splitProps(props: any) { | |
| const styleProps = {} | |
| const elementProps = {} |
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
| async function executeAirdropTransaction() { | |
| const connectionManager = await createConnection("mainnet-beta"); | |
| // Generate Transactions | |
| // const instructions: TransactionInstruction[] = []; | |
| // const transactions: Transaction[] = []; | |
| const airdropTransactionEntries = Object.values(airdropTransactionsLogs); | |
| const lastSuccessfulIndex = airdropTransactionEntries.findLastIndex( | |
| (value) => !value.signature |
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
| // Creates Instruction layout for syncing state | |
| function createInstructionData(index: number) { | |
| const dataLayout = BufferLayout.struct([BufferLayout.u32('instruction')]); | |
| const data = Buffer.alloc(dataLayout.span); | |
| dataLayout.encode({ instruction: index }, data); | |
| return data; | |
| } | |
| // Creates synchronize state instruction | |
| function createSynchronizeProgramInstruction(source: PublicKey, target: PublicKey) { |
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
| import { Transaction } from '@solana/web3.js'; | |
| const transactionBuffer = Buffer.from(<BASE_64_TRANSACTION_PAYLOAD>, 'base64'); | |
| const transaction = Transaction.from(transactionBuffer); | |
| // proceed with transaction signing and sending |
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
| bun run verify-access-token.ts | |
| // ============================ | |
| Token is valid: { | |
| aid: "cmberb48q023yjo0leuwu63tw", | |
| att: "pat", | |
| sid: "cmd4ibkcy000ljz0my8vpmm2d", | |
| iss: "privy.io", | |
| iat: 1753864509, |
OlderNewer