Skip to main content

Send Transaction

Associated methods for interacting with the Solana blockchain to send a transaction.


For more information about the nature of transactions on Solana, it is recommended to review the `@solana/web3.js` docs as well as the official Solana docs.

sendTransaction

Method to send Transaction on behalf of user.

Example

    const blockhash = (await conn.getRecentBlockhash("finalized")).blockhash;
const TransactionInstruction = SystemProgram.transfer({
fromPubkey: new PublicKey(publicKeys[0]),
toPubkey: new PublicKey(publicKeys[1]),
lamports: 0.1 * LAMPORTS_PER_SOL
});
const transaction = new Transaction({
recentBlockhash: blockhash,
feePayer: new PublicKey(publicKeys[0])
}).add(TransactionInstruction);

const res = await torus.sendTransaction(transaction)

Reference

    sendTransaction(transaction: Transaction): Promise<string>;