Skip to content

​Overview

The Deposit instruction moves SPL tokens from a user’s associated token account into the escrow’s associated token account. Once deposited, tokens are available for offchain transfers through the gateway. The optional recipient parameter lets a depositor credit a different user’s channel balance.

​Prerequisites

  • Completed installation and client generation
  • A devnet wallet with SOL (for transaction fees) and the SPL token you want to deposit
  • An active Private Channels instance with your mint on the allowlist

​Code

payerSigner must be a TransactionSendingSigner, such as a wallet signer from @solana/kit-plugin-wallet. With an ordinary KeyPairSigner, assertIsTransactionMessageWithSingleSendingSigner throws No TransactionSendingSigner was identified and nothing is sent. For keypair scripts, replace the last two calls with signTransactionMessageWithSigners plus sendAndConfirmTransactionFactory, or use client.sendTransaction([...]).

​Verify

After your devnet transaction confirms, the indexer detects the deposit event via Yellowstone gRPC and the operator mints the equivalent balance on the channel. A finality safety delay is applied before crediting, so expect ~15 seconds before the channel balance is available. Query your balance through the gateway (not the devnet RPC) to confirm:
A non-zero balance confirms the deposit was indexed and credited. If the balance is zero after 30 seconds, check that indexer-solana and operator-solana are running (make docker-devnet-logs).

​Next Steps

Send a Transfer - send your first offchain transfer