Property | Type | Description | Defined in |
---|---|---|---|
fund | (options : Omit <SolanaFundOptions , "address" >) => Promise <FundOperationResult > | Funds a Solana account with the specified token amount. Example const fundOperation = await account.fund({ token: "usdc", amount: 1000000n, }); | actions/solana/types.ts:210 |
quoteFund | (options : Omit <SolanaQuoteFundOptions , "address" >) => Promise <SolanaQuote > | Gets a quote to fund a Solana account. Example const quote = await account.quoteFund({ token: "usdc", amount: 1000000n, }); | actions/solana/types.ts:189 |
requestFaucet | (options : Omit <RequestFaucetOptions , "address" >) => Promise <SignatureResult > | Requests funds from a Solana faucet. Example // Create a Solana account const account = await cdp.solana.createAccount(); // Request funds from the Solana faucet const result = await account.requestFaucet({ token: "sol", }); | actions/solana/types.ts:46 |
sendTransaction | (options : Omit <SendTransactionOptions , "address" >) => Promise <SendTransactionResult > | Sends a transaction. Example // Create a Solana account const account = await cdp.solana.createAccount(); // Add your transaction instructions here const transaction = new Transaction() // Make sure to set requireAllSignatures to false, since signing will be done through the API const serializedTransaction = transaction.serialize({ requireAllSignatures: false, }); // Base64 encode the serialized transaction const transaction = Buffer.from(serializedTransaction).toString("base64"); // When you want to sign a transaction, you can do so by address and base64 encoded transaction const { transactionSignature } = await account.sendTransaction({ transaction, }); | actions/solana/types.ts:139 |
signMessage | (options : Omit <SignMessageOptions , "address" >) => Promise <SignatureResult > | Signs a message. Example // Create a Solana account const account = await cdp.solana.createAccount(); // Sign a message const { signature } = await account.signMessage({ message: "Hello, world!", }); | actions/solana/types.ts:69 |
signTransaction | (options : Omit <SignTransactionOptions , "address" >) => Promise <SignTransactionResult > | Signs a transaction. Example // Create a Solana account const account = await cdp.solana.createAccount(); // Add your transaction instructions here const transaction = new Transaction() // Make sure to set requireAllSignatures to false, since signing will be done through the API const serializedTransaction = transaction.serialize({ requireAllSignatures: false, }); // Base64 encode the serialized transaction const transaction = Buffer.from(serializedTransaction).toString("base64"); // When you want to sign a transaction, you can do so by address and base64 encoded transaction const { signedTransaction } = await account.signTransaction({ transaction, }); | actions/solana/types.ts:103 |
transfer | (options : Omit <TransferOptions , "from" >) => Promise <SignatureResult > | Transfers SOL or SPL tokens between accounts Example import { LAMPORTS_PER_SOL } from "@solana/web3.js"; const account = await cdp.solana.getAccount({ name: "Account" }); const { signature } = await account.transfer({ token: "sol", amount: 5 * LAMPORTS_PER_SOL, to: "3KzDtddx4i53FBkvCzuDmRbaMozTZoJBb1TToWhz3JfE", network: "devnet", }); | actions/solana/types.ts:168 |
WaitForFundOperationOptions
The options for the wait for fund operation.
Promise
<WaitForFundOperationResult
>
A promise that resolves to the completed transfer receipt containing details about the funding operation.