Type Aliases

AccountActions

type AccountActions = {
  fund: (options: Omit<SolanaFundOptions, "address">) => Promise<FundOperationResult>;
  quoteFund: (options: Omit<SolanaQuoteFundOptions, "address">) => Promise<SolanaQuote>;
  requestFaucet: (options: Omit<RequestFaucetOptions, "address">) => Promise<SignatureResult>;
  sendTransaction: (options: Omit<SendTransactionOptions, "address">) => Promise<SendTransactionResult>;
  signMessage: (options: Omit<SignMessageOptions, "address">) => Promise<SignatureResult>;
  signTransaction: (options: Omit<SignTransactionOptions, "address">) => Promise<SignTransactionResult>;
  transfer: (options: Omit<TransferOptions, "from">) => Promise<SignatureResult>;
  waitForFundOperationReceipt: Promise<WaitForFundOperationResult>;
};
Defined in: actions/solana/types.ts:25

Properties

PropertyTypeDescriptionDefined 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

Methods

waitForFundOperationReceipt()
waitForFundOperationReceipt(options: WaitForFundOperationOptions): Promise<WaitForFundOperationResult>;
Defined in: actions/solana/types.ts:227 Waits for a fund operation to complete and returns the transfer receipt.
Parameters
options
WaitForFundOperationOptions The options for the wait for fund operation.
Returns
Promise<WaitForFundOperationResult> A promise that resolves to the completed transfer receipt containing details about the funding operation.
Example
const completedTransfer = await account.waitForFundOperationReceipt({
  transferId: "transfer_123",
});