AptosAptos Network's breakthrough technology and seamless user experience are now available on QuickNode.
Start building today!The API credit value for this method is 1 . To learn more about API credits and each method's value, visit the API Credits page.
Parameters:
skipPreflight - boolean - (optional) (default: false) If true, skip the preflight transaction checks
preflightCommitment - string - (optional) (default: finalized) The commitment level to use for preflight
encoding - string - (optional) The encoding format for account data. It can be one of base58 (slow), base64, base64+zstd or jsonParsed
maxRetries - usize - (optional) The maximum number of times for the RPC node to retry sending the transaction to the leader. If this parameter is not provided, the RPC node will retry the transaction until it is finalized or until the blockhash expires
minContextSlot - integer - (optional) The minimum slot at which the request can be evaluated
Returns:
Code Examples:
require "uri" require "json" require "net/http" url = URI("http://sample-endpoint-name.network.quiknode.pro/token-goes-here/") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "method": "sendTransaction", "params": [ "ENTER_ENCODED_TRANSACTION_ID" ], "id": 1, "jsonrpc": "2.0" }) response = https.request(request) puts response.read_body
from solana.rpc.api import Client from solana.account import Account from solana.system_program import TransferParams, transfer from solana.transaction import Transaction #Make sure to paste sender, reciever addresses and public key. solana_client = Client("http://sample-endpoint-name.network.quiknode.pro/token-goes-here/") sender, reciever = Account(1), Account(2) json_request = solana_client.get_recent_blockhash() recent_blockhash = json_request["result"]["value"]["blockhash"] txn = Transaction(fee_payer=sender.public_key(), recent_blockhash=recent_blockhash) txn.add( transfer( TransferParams( from_pubkey=sender.public_key(), to_pubkey=reciever.public_key(), lamports=1000 ) ) ) txn.sign(sender) print(solana_client.send_transaction(txn, sender))
curl http://sample-endpoint-name.network.quiknode.pro/token-goes-here/ \ -X POST \ -H "Content-Type: application/json" \ --data '{"method":"sendTransaction","params":["ENTER_ENCODED_TRANSACTION_ID"],"id":1,"jsonrpc":"2.0"}'
const web3 = require("@solana/web3.js"); (async () => { const solana = new web3.Connection("http://sample-endpoint-name.network.quiknode.pro/token-goes-here/"); // Replace fromWallet with your public/secret keypair, wallet must have funds to pay transaction fees. const fromWallet = web3.Keypair.generate(); const toWallet = web3.Keypair.generate(); const transaction = new web3.Transaction().add( web3.SystemProgram.transfer({ fromPubkey: fromWallet.publicKey, toPubkey: toWallet.publicKey, lamports: web3.LAMPORTS_PER_SOL / 100, }) ); console.log(await solana.sendTransaction(transaction, [fromWallet])); })();