Intents

Raw Transaction Estimate

Estimate gas for raw transaction intent. For more details on Raw Transaction intents, see Understanding Intents. Refer to the RawTransaction 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": "RAW_TRANSACTION",
    "jobId": "e4fb7f8b-d19d-4785-94af-4b911469a3b0",
    "gasDetails": {
      "maxFeePerGas": "0x2255100",
      "maxPriorityFeePerGas": "0x2255100"
    },
    "paymasterData": "0x000000000000000000000000e8201e368557508bf183d4e2dce1b1a1e0bd20fa00000000000000000000000000000000000000000000000000000000682c9763000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000041d0a1c5ff763012644af339e4b7d8c82478a8791f8e666f28153af520a82e390e2e39e853412beab41039d32cbd67102d10be45f4947e69c008e5e6661b8121c31c00000000000000000000000000000000000000000000000000000000000000",
    "details": {
      "caip2Id": "eip155:84532",
      "transactions": [
        {
          "data": "0x",
          "from": "0xA1B9eBBf597F3B8a18C543d3bE3253C73524D564",
          "to": "0x88beE8eb691FFAFB192BAC4D1E7042e1b44c3eF2",
          "value": "0x0"
        }
      ]
    }
  }'

Fetched

{
  "status": "success",
  "data": {
    "callData": {
      "clientSWA": "0xe8201E368557508bF183D4e2DcE1b1A1E0bd20FA",
      "feePayerAddress": "",
      "gsn": {
        "isPossible": false,
        "isRequired": false,
        "requiredNetworks": [],
        "tokens": []
      },
      "intentType": "RAW_TRANSACTION",
      "jobId": "e4fb7f8b-d19d-4785-94af-4b911469a3b0",
      "payload": {
        "caip2Id": "eip155:84532",
        "transactions": [
          {
            "data": "0x",
            "from": "0xA1B9eBBf597F3B8a18C543d3bE3253C73524D564",
            "to": "0x88beE8eb691FFAFB192BAC4D1E7042e1b44c3eF2",
            "value": "0x0"
          }
        ]
      },
      "policies": {
        "gsnEnabled": false,
        "sponsorshipEnabled": false
      },
      "userSWA": "0xd917DFbdA2Bd9EF9628DA4E55150f6559aF5b6ac"
    },
    "details": {
      "estimation": {
        "amount": "",
        "crossChainFee": "",
        "crossChainFeeCollector": "",
        "gasFeesInInputToken": "",
        "integratorFeesInInputToken": "",
        "outputAmount": "",
        "platformBaseFeesInInputToken": "",
        "recommendedSlippage": "",
        "routeId": "",
        "routeValidUntil": "",
        "sameChainFee": "",
        "sameChainFeeCollector": "",
        "slippageUsed": "",
        "totalFeesInInputToken": ""
      },
      "fees": {
        "approxTransactionFeesInUSDT": "",
        "transactionFees": {
          "eip155:84532": "177258950000"
        }
      },
      "swapFees": {
        "gasFeesInInputToken": "",
        "integratorFeesInInputToken": "",
        "platformBaseFeesInInputToken": "",
        "totalFeesInInputToken": ""
      }
    },
    "userOps": {
      "callData": "0x8dd7712f000000000000000000000000000000000000000000000000000000000000000000000000000000000543ad80b41c5f5956d34503668cdb965decb6170000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000240000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000c6569703135353a383435333200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000817b2264617461223a223078222c2266726f6d223a22307841314239654242663539374633423861313843353433643362453332353343373335323444353634222c22746f223a22307838386265453865623639314646414642313932424143344431453730343265316234346333654632222c2276616c7565223a22307830227d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f5241575f5452414e53414354494f4e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
      "callGasLimit": "0x556a0",
      "maxFeePerGas": "0x2255100",
      "maxPriorityFeePerGas": "0x2255100",
      "nonce": "0x00000000000000000000000000000000e4fb7f8bd19d478594af4b911469a3b0",
      "paymaster": "0x74324fa6fa67b833dfdea4c1b3a9898574d076e3",
      "paymasterData": "0x000000000000000000000000e8201e368557508bf183d4e2dce1b1a1e0bd20fa00000000000000000000000000000000000000000000000000000000682c9763000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000041d0a1c5ff763012644af339e4b7d8c82478a8791f8e666f28153af520a82e390e2e39e853412beab41039d32cbd67102d10be45f4947e69c008e5e6661b8121c31c00000000000000000000000000000000000000000000000000000000000000",
      "paymasterPostOpGasLimit": "0x1",
      "paymasterVerificationGasLimit": "0x139bb",
      "preVerificationGas": "0x15867",
      "sender": "0xd917dfbda2bd9ef9628da4e55150f6559af5b6ac",
      "verificationGasLimit": "0x28488"
    }
  }
}