Skip to main content

Transaction

Signs an unsigned transaction and broadcasts it to chain.
Solana web3.js expects the serialized transaction to include 0-padded placeholder signatures, otherwise deserialization will failed. If you are using a different library to construct the serialized transaction, such as the Go SDK, please make sure to include the placeholder signatures.

Typescript Example with Solana web3.js

First install the Solana web3.js SDK. You can find the full documentation here. Here a code sample to broadcast a transaction via the DFNS TypeScript SDK:

Durable nonce transactions

A signed Solana transaction normally expires when its recent blockhash does (about 90 seconds). To keep a signed transaction valid indefinitely — for offline signing, or when a policy approval sits between signing and broadcast — build it against a durable nonce instead of a recent blockhash. For plain SOL and SPL transfers, the simplest path is the DFNS-managed nonce pool: bootstrap it once with the CreateSolanaNonceAccounts transaction kind, then set useDurableNonce: true on the transfer and DFNS picks and advances a nonce for you. To use a durable nonce on an arbitrary transaction you build yourself, manage the nonce account through Sign and Broadcast:
  1. Create a nonce account owned by your wallet with SystemProgram.createAccountWithSeed + SystemProgram.nonceInitialize, then sign and broadcast it. Deriving the address from the wallet (createWithSeed) keeps the wallet as the only required signer.
  2. Use it: set the transaction’s recentBlockhash to the nonce account’s current nonce value, and make SystemProgram.nonceAdvance the first instruction. Sign and broadcast, wait for confirmation, then re-read the nonce value before the next transaction — each executed transaction advances it.
  3. Destroy it when done with SystemProgram.nonceWithdraw, which closes the account and reclaims the rent. There is no dedicated close transaction kind; the withdraw instruction does it.
Use a seed you control (for example my-app/nonce/0), distinct from the pool’s nonce/<index> seeds, so a self-managed account and a pool account can never pick the same nonce. See the full runnable example: durable-nonce-tx. For the dashboard and pool-based flow, see Use Solana durable nonces.

Complete examples

For complete working examples, see the SDK examples on GitHub:
Last modified on September 4, 2026