curl --request POST \
--url https://api.privy.io/v1/wallets/{wallet_id}/rpc \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'privy-app-id: <privy-app-id>' \
--data '{
"method": "transferTokens",
"network": "MAINNET",
"params": {
"token_identifier": "btknrt1x9helfvakyz8y53lzwt2wjen7d30ft6skpu69eydvndqt5uxsr4q0zvugn",
"token_amount": 10,
"receiver_spark_address": "spark1pgss8z35rpycv4duqdk5u3sclhjnztjunv5yajlwk69tyv5fsvwwe9mgwmxfkx"
}
}'
{
"method": "transferTokens",
"data": {
"id": "22c469d0a956b188f7dc058e43515a2c4e675d75edc302b75805d9c5dccaeb6b",
}
}
Spark BTC
transferTokens
Transfer a specified amount of Spark tokens to another Spark address.
POST
/
v1
/
wallets
/
{wallet_id}
/
rpc
curl --request POST \
--url https://api.privy.io/v1/wallets/{wallet_id}/rpc \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'privy-app-id: <privy-app-id>' \
--data '{
"method": "transferTokens",
"network": "MAINNET",
"params": {
"token_identifier": "btknrt1x9helfvakyz8y53lzwt2wjen7d30ft6skpu69eydvndqt5uxsr4q0zvugn",
"token_amount": 10,
"receiver_spark_address": "spark1pgss8z35rpycv4duqdk5u3sclhjnztjunv5yajlwk69tyv5fsvwwe9mgwmxfkx"
}
}'
{
"method": "transferTokens",
"data": {
"id": "22c469d0a956b188f7dc058e43515a2c4e675d75edc302b75805d9c5dccaeb6b",
}
}
Idempotency on errors: On 4xx or 5xx, Privy caches the response and replays it for the same
key. Generate a new key to retry after a server error. Policy violations are an exception and
allow same-key retries.
curl --request POST \
--url https://api.privy.io/v1/wallets/{wallet_id}/rpc \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'privy-app-id: <privy-app-id>' \
--data '{
"method": "transferTokens",
"network": "MAINNET",
"params": {
"token_identifier": "btknrt1x9helfvakyz8y53lzwt2wjen7d30ft6skpu69eydvndqt5uxsr4q0zvugn",
"token_amount": 10,
"receiver_spark_address": "spark1pgss8z35rpycv4duqdk5u3sclhjnztjunv5yajlwk69tyv5fsvwwe9mgwmxfkx"
}
}'
{
"method": "transferTokens",
"data": {
"id": "22c469d0a956b188f7dc058e43515a2c4e675d75edc302b75805d9c5dccaeb6b",
}
}
Headers
string
required
ID of your Privy app.
string
Request authorization signature. If multiple signatures are required, they should be comma
separated.
string
Request expiry. Value is a Unix timestamp in milliseconds representing the deadline by which the
request must be processed.
Path Parameters
string
required
ID of the wallet to get.
These wallet methods are modeled after the Spark Wallet
SDK. For more
information about this wallet method, check out the Spark Wallet
documentation.
Body
string
required
Available options:
transferTokensstring
required
Available options:
MAINNET, REGTESTobject
required
Returns
enum<string>
required
Always
"transferTokens"object
required
The result of the token transfer.
Hide child attributes
Hide child attributes
string
required
Transaction hash of the token transfer.
Was this page helpful?

