Intents

Token Transfer Estimate

Estimate gas for token transfer intent. For more details on Token Transfer intents, see Understanding Intents. Refer to the TokenTransfer Estimate API template script for implementation guidance.

POST
/api/oc/v1/estimate

Authorization

AuthorizationRequiredBearer <token>

In: header

Request Body

application/jsonRequired
typeRequiredstring
jobIdRequiredstring
gasDetailsRequiredobject
paymasterDataRequiredstring
detailsRequiredobject
curl -X POST "https://sandbox-api.okto.tech/api/oc/v1/estimate" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "TOKEN_TRANSFER",
    "jobId": "e4fb7f8b-d19d-4785-94af-4b911469a3b0",
    "gasDetails": {
      "maxFeePerGas": "0x2255100",
      "maxPriorityFeePerGas": "0x2255100"
    },
    "paymasterData": "0x000000000000000000000000e8201e368557508bf183d4e2dce1b1a1e0bd20fa00000000000000000000000000000000000000000000000000000000682c9763000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000041d0a1c5ff763012644af339e4b7d8c82478a8791f8e666f28153af520a82e390e2e39e853412beab41039d32cbd67102d10be45f4947e69c008e5e6661b8121c31c00000000000000000000000000000000000000000000000000000000000000",
    "details": {
      "recipientWalletAddress": "0x88beE8eb691FFAFB192BAC4D1E7042e1b44c3eF2",
      "caip2Id": "eip155:84532",
      "tokenAddress": "",
      "amount": "10000000000000"
    }
  }'

Fetched

{
  "status": "success",
  "data": {
    "callData": {
      "clientSWA": "0xe8201E368557508bF183D4e2DcE1b1A1E0bd20FA",
      "feePayerAddress": "",
      "gsn": {
        "isPossible": false,
        "isRequired": false,
        "requiredNetworks": [],
        "tokens": []
      },
      "intentType": "TOKEN_TRANSFER",
      "jobId": "e4fb7f8b-d19d-4785-94af-4b911469a3b0",
      "payload": {
        "amount": "10000000000000",
        "caip2Id": "eip155:84532",
        "recipientWalletAddress": "0x88beE8eb691FFAFB192BAC4D1E7042e1b44c3eF2",
        "tokenAddress": ""
      },
      "policies": {
        "gsnEnabled": false,
        "sponsorshipEnabled": false
      },
      "userSWA": "0x8B20023FC47D8F8BDB7418722dBB0e3e9964a906"
    },
    "details": {
      "estimation": {
        "amount": "10000000000000",
        "crossChainFee": "",
        "crossChainFeeCollector": "",
        "gasFeesInInputToken": "",
        "integratorFeesInInputToken": "",
        "outputAmount": "",
        "platformBaseFeesInInputToken": "",
        "recommendedSlippage": "",
        "routeId": "",
        "routeValidUntil": "",
        "sameChainFee": "",
        "sameChainFeeCollector": "",
        "slippageUsed": "",
        "totalFeesInInputToken": ""
      },
      "fees": {
        "approxTransactionFeesInUSDT": "",
        "transactionFees": {
          "eip155:84532": "121830572068"
        }
      },
      "swapFees": {
        "gasFeesInInputToken": "",
        "integratorFeesInInputToken": "",
        "platformBaseFeesInInputToken": "",
        "totalFeesInInputToken": ""
      }
    },
    "userOps": {
      "callData": "0x8dd7712f000000000000000000000000000000000000000000000000000000000000000000000000000000000543ad80b41c5f5956d34503668cdb965decb617000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000404bf7b90d700000000000000000000000000000000e4fb7f8bd19d478594af4b911469a3b0000000000000000000000000e8201e368557508bf183d4e2dce1b1a1e0bd20fa0000000000000000000000008b20023fc47d8f8bdb7418722dbb0e3e9964a906000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000003c000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000009184e72a000000000000000000000000000000000000000000000000000000000000000000c6569703135353a38343533320000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002a307838386265453865623639314646414642313932424143344431453730343265316234346333654632000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e544f4b454e5f5452414e5346455200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
      "callGasLimit": "0x552e4",
      "maxFeePerGas": "0x2255100",
      "maxPriorityFeePerGas": "0x2255100",
      "nonce": "0x00000000000000000000000000000000e4fb7f8bd19d478594af4b911469a3b0",
      "paymaster": "0x74324fa6fa67b833dfdea4c1b3a9898574d076e3",
      "paymasterData": "0x000000000000000000000000e8201e368557508bf183d4e2dce1b1a1e0bd20fa00000000000000000000000000000000000000000000000000000000682c9763000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000041d0a1c5ff763012644af339e4b7d8c82478a8791f8e666f28153af520a82e390e2e39e853412beab41039d32cbd67102d10be45f4947e69c008e5e6661b8121c31c00000000000000000000000000000000000000000000000000000000000000",
      "paymasterPostOpGasLimit": "0x1",
      "paymasterVerificationGasLimit": "0x139a2",
      "preVerificationGas": "0x15324",
      "sender": "0x8b20023fc47d8f8bdb7418722dbb0e3e9964a906",
      "verificationGasLimit": "0x28428"
    }
  }
}