POST
/
accounts
/
{userAddress}
/
bundles
/
cost
Get Bundle Cost
curl --request POST \
  --url https://orchestrator.rhinestone.dev/accounts/{userAddress}/bundles/cost \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <x-api-key>' \
  --data '{
  "targetChainId": 123,
  "tokenTransfers": [
    {
      "tokenAddress": "<string>",
      "amount": "<string>"
    }
  ],
  "targetGasUnits": "<string>",
  "userOp": {
    "callGasLimit": "<string>",
    "verificationGasLimit": "<string>",
    "preVerificationGas": "<string>"
  },
  "accountAccessList": [
    {
      "chainId": 123,
      "tokenAddress": "<string>"
    }
  ]
}'
{
  "hasFulfilledAll": true,
  "tokensSpent": {
    "1": {
      "0x6B175474E89094C44Da98b954EedeAC495271d0F": "501000"
    },
    "137": {
      "0x0000000000000000000000000000000000001010": "500000"
    }
  },
  "tokensReceived": [
    {
      "tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "amountSpent": "1001000",
      "targetAmount": "1000000",
      "fee": "1000",
      "hasFulfilled": true
    }
  ],
  "tokenShortfall": [
    {
      "tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "targetAmount": "1000000",
      "amountSpent": "800000",
      "fee": "1000",
      "tokenSymbol": "USDC",
      "tokenDecimals": 6
    }
  ],
  "totalTokenShortfallInUSD": "200.50"
}

Headers

x-api-key
string
required

Rhinestone API key

Path Parameters

userAddress
string
required

Ethereum address of the user account

Example:

"0x579d5631f76126991c00fb8fe5467fa9d49e5f6a"

Body

application/json

Body

targetChainId
number
required
tokenTransfers
object[]
required
targetGasUnits
string
userOp
object
accountAccessList

Response

200

Successfully calculated bundle cost and token requirements

hasFulfilledAll
boolean
required

Whether all output tokens have been fulfilled

Example:

true

tokensSpent
object

Tokens spent per chain and token address (amounts as strings). Only present when hasFulfilledAll is true

Example:
{
"1": {
"0x6B175474E89094C44Da98b954EedeAC495271d0F": "501000"
},
"137": {
"0x0000000000000000000000000000000000001010": "500000"
}
}
tokensReceived
object[]

Array of tokens received in the transaction. Only present when hasFulfilledAll is true

tokenShortfall
object[]

Array of tokens with insufficient balance. Only present when hasFulfilledAll is false

totalTokenShortfallInUSD
string

Total value of token shortfall in USD (as string to handle BigInt). Only present when hasFulfilledAll is false

Example:

"200.50"