Skip to main content

Before you begin

  • Use your Solana Gun endpoint (see below). Replace the placeholders with your connection details.
  • Have a funded Solana wallet and its local keypair JSON file. The examples send 0.0021 SOL (2,100,000 lamports) to an existing wallet, plus the network fee.
  • Use a regular Solana RPC to fetch a recent blockhash. The examples use https://solana-rpc.publicnode.com.

Endpoints

Choose a host close to your application and copy the endpoint.

Send a transaction

Choose your language below. Each example signs locally and submits directly through the SDK.
skipPreflight must be enabled because Solana Gun does not simulate individual transactions. The examples set it for you.
1

Install the SDK

Use Node.js 22.12 or later with @solana/web3.js:
2

Write the code

Save the code as send.mjs and replace the endpoint, keypair path, and recipient address:
send.mjs
3

Run

Submission response

A successful call returns the transaction signature and means Solana Gun accepted it for forwarding.
It does not guarantee confirmation on Solana.