Skip to content
This page covers connecting to Solana and the RPC methods payments use, with @solana/kit and the Solana CLI, plus using an explorer to verify payments and debug issues.

​Connecting to Solana

Your code talks to the network through an RPC endpoint.
Do not use public RPC for productionThe public endpoints (api.mainnet.solana.com, api.devnet.solana.com) are rate-limited and have no SLA. Use an RPC provider in production.
Create an RPC client:
For development, use devnet (https://api.devnet.solana.com) or a local validator like Surfpool.

​Common RPC Methods

These are the RPC methods payment flows use most.

​Getting Account Info

getAccountInfo returns any account’s SOL balance, owner, data, and other metadata. Its data field is a [base64String, "base64"] tuple: convert the string to bytes with getBase64Codec, then decode them with the account’s codec, such as getTokenCodec for token accounts.

​Getting Token Balances

getTokenAccountBalance returns a token account’s balance:

​Building Transactions

Every transaction needs a recent blockhash. Fetch one with getLatestBlockhash:
A blockhash expires after 150 blocks, about 30 seconds at 200ms slots. Fetch a fresh one immediately before signing and sending.

​Checking Transaction Status

Check that a transaction settled with getSignatureStatuses:

​Getting Transaction Details

Fetch a confirmed transaction’s details with getTransaction:

​Transaction History

List an address’s recent transactions with getSignaturesForAddress:
For webhooks and real-time payment detection, see Accept payments.

​Exploring Public Data

Every transaction, token account, and mint is public. A block explorer, such as Solana Explorer, SolanaFM, Solscan, or Orb, lets you verify a payment, inspect balances, debug failed transactions, and look up a mint’s supply, decimals, and authority without writing code. For example: