Skip to main content
POST
/
v1
/
spl
/
transfer
Transfer SPL Tokens
curl --request POST \
  --url https://payments.magicblock.app/v1/spl/transfer \
  --header 'Content-Type: application/json' \
  --data '
{
  "from": "3rXKwQ1kpjBd5tdcco32qsvqUh1BnZjcYnS5kYrP7AYE",
  "to": "Bt9oNR5cCtnfuMmXgWELd6q5i974PdEMQDUE55nBC57L",
  "mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
  "amount": 1000000,
  "visibility": "private",
  "fromBalance": "base",
  "toBalance": "base",
  "initIfMissing": true,
  "initAtasIfMissing": true,
  "initVaultIfMissing": false,
  "memo": "Order #1042",
  "minDelayMs": "0",
  "maxDelayMs": "0",
  "clientRefId": "42",
  "split": 1,
  "gasless": true
}
'
{
  "kind": "transfer",
  "version": "legacy",
  "transactionBase64": "<string>",
  "sendTo": "base",
  "recentBlockhash": "<string>",
  "lastValidBlockHeight": 123,
  "instructionCount": 1,
  "requiredSigners": [
    "<string>"
  ],
  "validator": "<string>"
}

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.

Headers

authorization
string

Optional. Authentication token for requests that need to connect to the Private Ephemeral Rollup. Format: Bearer <token>.

Example:

"Bearer 1234567890"

Body

application/json
from
string
required

Sender wallet pubkey.

Example:

"3rXKwQ1kpjBd5tdcco32qsvqUh1BnZjcYnS5kYrP7AYE"

to
string
required

Recipient wallet pubkey.

Example:

"Bt9oNR5cCtnfuMmXgWELd6q5i974PdEMQDUE55nBC57L"

mint
string
required

SPL mint pubkey.

Example:

"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"

amount
integer
required

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

Required range: x >= 1
Example:

1000000

visibility
enum<string>
required

Use public for a transparent SPL transfer or private to route through the Private Ephemeral Rollup.

Available options:
public,
private
fromBalance
enum<string>
required

Where the sender's balance is held. Drives which RPC the API uses for blockhash and where the client should submit.

Available options:
base,
ephemeral
toBalance
enum<string>
required

Where the recipient should receive the funds.

Available options:
base,
ephemeral
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"

validator
string

Optional. When this transfer route needs a validator and none is provided, the API resolves it from the selected ephemeral RPC via getIdentity.

Example:

"MAS1Dt9qreoRMQ14YQuhg8UTZMMzDdKhmkZMECCzk57"

initIfMissing
boolean

Optional. Initialize the transfer queue if missing.

initAtasIfMissing
boolean

Optional. Initialize associated token accounts if missing.

initVaultIfMissing
boolean

Optional. Initialize the vault if missing. Defaults to false.

memo
string

Optional. Appends a final Memo Program instruction with this UTF-8 message.

Example:

"Order #1042"

minDelayMs
string

Optional. Private transfer only. Defaults to 0. Earliest (ms) the queued transfer may settle.

Pattern: ^\d+$
Example:

"0"

maxDelayMs
string

Optional. Private transfer only. Defaults to 0 when omitted, or to minDelayMs when only minDelayMs is set. Must be >= minDelayMs.

Pattern: ^\d+$
Example:

"0"

clientRefId
string

Optional. Private transfer only. Encrypted client reference ID that can be used to confirm a payment.

Pattern: ^\d+$
Example:

"42"

split
integer

Optional. Private transfer only. Defaults to 1. Number of queue entries to split the transfer across. Must be between 1 and 15 and cannot exceed amount.

Required range: x <= 15
Example:

1

gasless
boolean

Optional. When true, the API uses the configured sponsor as transaction fee payer and prepends a relay-fee token transfer to the sponsor ATA.

Example:

true

legacy
boolean

Optional. Defaults to false. When true, skips lookup-table compilation and returns a legacy transaction. Private base -> base transfers may otherwise return a v0 transaction when a useful lookup table is configured.

Response

Unsigned serialized transaction

kind
enum<string>
required
Available options:
transfer
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