Skip to main content
POST
/
v1
/
spl
/
deposit
Deposit SPL Tokens
curl --request POST \
  --url https://payments.magicblock.app/v1/spl/deposit \
  --header 'Content-Type: application/json' \
  --data '
{
  "owner": "3rXKwQ1kpjBd5tdcco32qsvqUh1BnZjcYnS5kYrP7AYE",
  "amount": 1,
  "initIfMissing": true,
  "initVaultIfMissing": true,
  "initAtasIfMissing": true,
  "idempotent": true
}
'
{
  "kind": "deposit",
  "version": "legacy",
  "transactionBase64": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAIDKmcfsS5XfSOLaLlaBHJry50iH2Ufk2TMz4STC2fHzIcFKkerg3q2DD3Yn8TISmGeKoxSLz+BiP7iQ4pYqXYXsgu8D8C7R8ovdMQRLpSrE8+jxjTl3BfqywPNGiPNfnh8eS+smowIxqKDcCjw5liNXQkkCbBSDCBDFwtrgCKqoQ0DAgEBBAECAwQCAQEEAgIDBAIBAQQDAgME",
  "sendTo": "base",
  "recentBlockhash": "9A4VhP8M8fQZxP4h7rB6mP6eM8w2pJkYh7QdZk7V4r2x",
  "lastValidBlockHeight": 284512337,
  "instructionCount": 3,
  "requiredSigners": [
    "3rXKwQ1kpjBd5tdcco32qsvqUh1BnZjcYnS5kYrP7AYE"
  ],
  "validator": "MAS1Dt9qreoRMQ14YQuhg8UTZMMzDdKhmkZMECCzk57"
}

Documentation Index

Fetch the complete documentation index at: https://docs.magicblock.gg/llms.txt

Use this file to discover all available pages before exploring further.

Body

application/json
owner
string
required
Example:

"3rXKwQ1kpjBd5tdcco32qsvqUh1BnZjcYnS5kYrP7AYE"

amount
integer
required

Base-unit amount as an integer JSON value with minimum 1.

Required range: x >= 1
Example:

1

cluster

Optional. Use mainnet for BASE_RPC_URL and EPHEMERAL_RPC_URL, devnet for BASE_DEVNET_RPC_URL and EPHEMERAL_DEVNET_RPC_URL, or provide a custom http(s) RPC URL to override the base RPC while keeping the configured ephemeral RPC.

Available options:
mainnet,
devnet
Example:

"mainnet"

mint
string

Optional. Defaults to Solana USDC on mainnet: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v. On devnet it defaults to devnet USDC: 4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU.

Example:

"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"

validator
string

Optional. Defaults to the selected ephemeral RPC identity resolved via getIdentity.

Example:

"MAS1Dt9qreoRMQ14YQuhg8UTZMMzDdKhmkZMECCzk57"

initIfMissing
boolean

Optional. Initialize the transfer queue if missing.

initVaultIfMissing
boolean

Optional. Initialize the vault if missing.

initAtasIfMissing
boolean

Optional. Initialize associated token accounts if missing.

idempotent
boolean

Optional. When true, the API uses idempotent variants for any preparatory init instructions.

Response

Unsigned serialized transaction

kind
enum<string>
required
Available options:
deposit
version
enum<string>
required
Available options:
legacy,
v0
transactionBase64
string
required
sendTo
enum<string>
required
Available options:
base,
ephemeral
recentBlockhash
string
required
lastValidBlockHeight
integer
required
instructionCount
integer
required
Required range: x >= 0
requiredSigners
string[]
required
validator
string