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": "signAndSendTransaction",
"caip2": "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1",
"sponsor": true,
"params": {
"transaction": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEDRpb0mdmKftapwzzqUtlcDnuWbw8vwlyiyuWyyieQFKESezu52HWNss0SAcb60ftz7DSpgTwUmfUSl1CYHJ91GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAScgJ7J0AXFr1azCEvB1Y5zpiF4eXR+yTW0UB7am+E/MBAgIAAQwCAAAAQEIPAAAAAAA=",
"encoding": "base64"
}
}
'
{
"method": "signAndSendTransaction",
"data": {
"hash": "22VS6wqrbeaN21ku3pjEjfnrWgk1deiFBSB1kZzS8ivr2G8wYmpdnV3W7oxpjFPGkt5bhvZvK1QBzuCfUPUYYFQq",
"signed_transaction": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEDRpb0mdmKftapwzzqUtlcDnuWbw8vwlyiyuWyyieQFKESezu52HWNss0SAcb60ftz7DSpgTwUmfUSl1CYHJ91GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAScgJ7J0AXFr1azCEvB1Y5zpiF4eXR+yTW0UB7am+E/MBAgIAAQwCAAAAQEIPAAAAAAA=",
"caip2": "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1",
"transaction_id": "nyorsf87s9d08jimesv3n8yq"
}
}
Solana
signAndSendTransaction
Sign and send transaction with a Solana wallet using the signAndSendTransaction method.
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": "signAndSendTransaction",
"caip2": "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1",
"sponsor": true,
"params": {
"transaction": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEDRpb0mdmKftapwzzqUtlcDnuWbw8vwlyiyuWyyieQFKESezu52HWNss0SAcb60ftz7DSpgTwUmfUSl1CYHJ91GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAScgJ7J0AXFr1azCEvB1Y5zpiF4eXR+yTW0UB7am+E/MBAgIAAQwCAAAAQEIPAAAAAAA=",
"encoding": "base64"
}
}
'
{
"method": "signAndSendTransaction",
"data": {
"hash": "22VS6wqrbeaN21ku3pjEjfnrWgk1deiFBSB1kZzS8ivr2G8wYmpdnV3W7oxpjFPGkt5bhvZvK1QBzuCfUPUYYFQq",
"signed_transaction": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEDRpb0mdmKftapwzzqUtlcDnuWbw8vwlyiyuWyyieQFKESezu52HWNss0SAcb60ftz7DSpgTwUmfUSl1CYHJ91GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAScgJ7J0AXFr1azCEvB1Y5zpiF4eXR+yTW0UB7am+E/MBAgIAAQwCAAAAQEIPAAAAAAA=",
"caip2": "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1",
"transaction_id": "nyorsf87s9d08jimesv3n8yq"
}
}
SDK methods
Learn more about sending transactions using our SDKs here.The wallet RPC endpoint is a synchronous endpoint, and a successful response indicates that the
transaction has been broadcasted to the network. Transactions may get broadcasted but still fail
to be confirmed by the network. The endpoint does not wait for confirmation or retry if the
transaction fails to be confirmed. To handle these scenarios, see our guide on speeding up
transactions.
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": "signAndSendTransaction",
"caip2": "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1",
"sponsor": true,
"params": {
"transaction": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEDRpb0mdmKftapwzzqUtlcDnuWbw8vwlyiyuWyyieQFKESezu52HWNss0SAcb60ftz7DSpgTwUmfUSl1CYHJ91GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAScgJ7J0AXFr1azCEvB1Y5zpiF4eXR+yTW0UB7am+E/MBAgIAAQwCAAAAQEIPAAAAAAA=",
"encoding": "base64"
}
}
'
{
"method": "signAndSendTransaction",
"data": {
"hash": "22VS6wqrbeaN21ku3pjEjfnrWgk1deiFBSB1kZzS8ivr2G8wYmpdnV3W7oxpjFPGkt5bhvZvK1QBzuCfUPUYYFQq",
"signed_transaction": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEDRpb0mdmKftapwzzqUtlcDnuWbw8vwlyiyuWyyieQFKESezu52HWNss0SAcb60ftz7DSpgTwUmfUSl1CYHJ91GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAScgJ7J0AXFr1azCEvB1Y5zpiF4eXR+yTW0UB7am+E/MBAgIAAQwCAAAAQEIPAAAAAAA=",
"caip2": "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1",
"transaction_id": "nyorsf87s9d08jimesv3n8yq"
}
}
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.
Body
string
required
Available options:
signAndSendTransactionstring
required
Available options:
solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp (Solana Mainnet),
solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1 (Solana Devnet),
solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z (Solana Testnet)object
required
boolean
Optional parameter to enable gas sponsorship for this transaction. Learn
more.
string
Optional developer-provided reference ID for transaction reconciliation. Must be unique per
transaction and up to 64 characters. Use this to correlate transactions with your own internal
records. The
reference_id is included in transaction
webhook payloads and can be used to look up
transactions.boolean
Optional. If set to true, the signed transaction will be immediately returned after the enclave
signs, and submission to the network will happen asynchronously. Useful if you want to minimize
E2E latency, or if you want to submit to multiple endpoints to get the best transaction landing
time possible. Note that enabling this option also disables network preflight checks to minimize
latency, which means an invalid transaction will not return an error in the API response and will
not fire webhooks. You are responsible for rebroadcasting and validating the transaction, which
can be done against a Solana RPC endpoint using the
signed_transaction from the response.Lowest latency configuration: For minimum E2E latency, combine
optimistic_broadcast with
the x-privy-skip-simulation: true request header. This skips both simulation and broadcast
confirmation, returning the signed transaction as fast as possible. Your application is then
responsible for simulating (if desired) and broadcasting the transaction independently.Returns
enum<string>
required
Available options:
signAndSendTransactionobject
required
Hide child attributes
Hide child attributes
string
required
Transaction hash of the signed and sent transaction.
string
required
CAIP-2 chain ID of the network where the transaction was sent.
string
Optional Privy-assigned transaction ID.
string | null
The developer-provided reference ID, if one was provided in the request.
string
The signed transaction payload, base64-encoded. This can be used to verify the signature or to
rebroadcast the transaction via your own RPC endpoint.
Was this page helpful?

