curl -X POST "https://starknet.paymaster.avnu.fi" \
-H "Content-Type: application/json" \
-H "x-paymaster-api-key: $PAYMASTER_API_KEY" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "paymaster_executeTransaction",
"params": {
"transaction": {
"type": "apply_action",
"apply_action": {
"apply_actions_call": { "to": "0x04c9...pool", "selector": "0x02ac...", "calldata": ["0x1", "0x2"] },
"proof": "base64-encoded-proof",
"proof_facts": ["0x0123...", "0x0456..."]
}
},
"parameters": {
"version": "0x1",
"fee_mode": {
"mode": "sponsored_private",
"pool_fee_token": "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d",
"tip": "normal"
}
}
}
}'
import { submitPrivateSwap } from '@avnu/avnu-sdk';
const { transactionHash } = await submitPrivateSwap({
callAndProof, // { call, proof } from the proving backend
feeMode: { poolFeeToken: STRK, tip: 'normal' },
paymasterApiKey: PAYMASTER_API_KEY,
});
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"transaction_hash": "0x06f8...hash",
"tracking_id": "0x0"
}
}
Paymaster
Execute Private Transaction
Relay a proven apply_action transaction on-chain
POST
/
curl -X POST "https://starknet.paymaster.avnu.fi" \
-H "Content-Type: application/json" \
-H "x-paymaster-api-key: $PAYMASTER_API_KEY" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "paymaster_executeTransaction",
"params": {
"transaction": {
"type": "apply_action",
"apply_action": {
"apply_actions_call": { "to": "0x04c9...pool", "selector": "0x02ac...", "calldata": ["0x1", "0x2"] },
"proof": "base64-encoded-proof",
"proof_facts": ["0x0123...", "0x0456..."]
}
},
"parameters": {
"version": "0x1",
"fee_mode": {
"mode": "sponsored_private",
"pool_fee_token": "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d",
"tip": "normal"
}
}
}
}'
import { submitPrivateSwap } from '@avnu/avnu-sdk';
const { transactionHash } = await submitPrivateSwap({
callAndProof, // { call, proof } from the proving backend
feeMode: { poolFeeToken: STRK, tip: 'normal' },
paymasterApiKey: PAYMASTER_API_KEY,
});
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"transaction_hash": "0x06f8...hash",
"tracking_id": "0x0"
}
}
Overview
JSON-RPC methodpaymaster_executeTransaction with the apply_action type. The relayer submits the proven call on-chain and pays the gas; the pool fee (from the build step) reimburses it. No user signature is needed: the transaction settles straight from the proof. Use invoke_and_apply_action to also wrap a signed user call (with the typed_data returned by the build step).
The endpoint is the base URL itself (no path): https://starknet.paymaster.avnu.fi (mainnet) or https://sepolia.paymaster.avnu.fi (testnet).
Headers
Body (JSON-RPC 2.0)
string
required
paymaster_executeTransactionstring
required
apply_action, or invoke_and_apply_action when a signed user call is wrappedobject
required
The proven call, as
{ to, selector, calldata }string
required
The zero-knowledge proof produced by the proving backend
array
required
The proof facts (array of felt hex strings)
object
Only for
invoke_and_apply_action: { user_address, typed_data, signature }object
required
Same shape as the build step:
{ version: '0x1', fee_mode, time_bounds? }Response
string
required
The hash of the submitted transaction
string
Relayer tracking id
Errors
| Code | Name | When |
|---|---|---|
| 156 | TRANSACTION_EXECUTION_ERROR | On-chain execution failure |
| 159 | PRIVACY_REQUIRES_SPONSORING | Private transaction sent without a sponsored fee mode |
| 163 | UNKNOWN_ERROR | Invalid API key, service unavailable, or blacklisted call |
| 165 | MISSING_FEE_TRANSFER_TO | The private transaction calldata does not withdraw the pool fee to the paymaster |
| 166 | CALLDATA_PARSING | The private transaction calldata could not be parsed |
| 167 | POOL_FEE_TOO_LOW | The withdrawn pool fee is below the required amount |
| 168 | PRIVACY_PROOF_MISSING | The proof is missing on a private transaction |
| 169 | MAX_L2_GAS_AMOUNT_EXCEEDED | The transaction exceeds the maximum L2 gas |
curl -X POST "https://starknet.paymaster.avnu.fi" \
-H "Content-Type: application/json" \
-H "x-paymaster-api-key: $PAYMASTER_API_KEY" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "paymaster_executeTransaction",
"params": {
"transaction": {
"type": "apply_action",
"apply_action": {
"apply_actions_call": { "to": "0x04c9...pool", "selector": "0x02ac...", "calldata": ["0x1", "0x2"] },
"proof": "base64-encoded-proof",
"proof_facts": ["0x0123...", "0x0456..."]
}
},
"parameters": {
"version": "0x1",
"fee_mode": {
"mode": "sponsored_private",
"pool_fee_token": "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d",
"tip": "normal"
}
}
}
}'
import { submitPrivateSwap } from '@avnu/avnu-sdk';
const { transactionHash } = await submitPrivateSwap({
callAndProof, // { call, proof } from the proving backend
feeMode: { poolFeeToken: STRK, tip: 'normal' },
paymasterApiKey: PAYMASTER_API_KEY,
});
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"transaction_hash": "0x06f8...hash",
"tracking_id": "0x0"
}
}
Was this page helpful?