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 example sends 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 example uses a public Solana RPC endpoint.
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 over WebSocket.skipPreflight must be enabled because Solana Gun does not simulate individual transactions. The examples set it for you.- Python
1
Install dependencies
Install the Python SDK and the WebSocket library:
2
Write the code
Save the code as
send_ws.py and replace the endpoint, keypair path, and recipient address:send_ws.py
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.