Creates a new Solana account.
Parameters for creating the Solana account.
Options for creating a Solana account.
A promise that resolves to the newly created account.
Gets a Solana account by its address.
Parameters for getting the Solana account.
Either address
or name
must be provided.
If both are provided, lookup will be done by address
and name
will be ignored.
Options for getting a Solana account.
A promise that resolves to the account.
Lists all Solana accounts.
Parameters for listing the Solana accounts.
Options for listing Solana accounts.
A promise that resolves to an array of Solana account instances.
Requests funds from a Solana faucet.
Parameters for requesting funds from the Solana faucet.
Options for requesting funds from a Solana faucet.
A promise that resolves to the transaction signature.
Signs a message.
Parameters for signing the message.
Options for signing a Solana message.
A promise that resolves to the signature.
Signs a transaction.
Parameters for signing the transaction.
Options for signing a Solana transaction.
A promise that resolves to the signature.
// 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 signature = await cdp.solana.signTransaction({
address: account.address,
transaction,
});
The namespace containing all Solana methods.