For the complete documentation index, see llms.txt. This page is also available as Markdown.

Get Fee

Get the fee amount for an operation

get

Returns the relay fee amount for the given operation. Withdraw, transfer, and swap all compute this fee automatically, so calling this endpoint first is optional — use it to show the fee to a user before they confirm, or to lock in an exact feeAmount by passing it into the transaction request.

Read-only — requires an active session. Pass sessionId and nonce as query parameters and include x-hinkal-request-signature: secp256k1_sign(SHA256("GET /get-fee\n" + queryString)) in the headers.

Solana-specific parameters:

  • amounts[] — provide the transaction amounts so the server can calculate the exact nullifier count (used to estimate ATA creation costs).

  • mintFrom — for Solana swap fee estimation, pass the input token address so the server can estimate the OKX Associated Token Account cost.

Query parameters
sessionIdstring · uuidRequired

Session identifier UUID from POST /create-session

Example: ffd74231-0672-48c7-bd82-9f72a803578b
noncestring · uuidRequired

Per-request UUID. Echoed back in the response.

Example: 3e0c5b91-e133-4aaa-bad1-ade100b3de2a
chainIdstringRequired

Chain ID (e.g. 10 for Optimism, 501 for Solana mainnet)

Example: 10
feeTokenstringRequired

Token address used to pay the fee

Example: 0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85
tokenAddressesstring[]Required

Token addresses involved in the operation

Example: ["0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85"]
externalActionIdstringRequired

External action id string (e.g. "Transact", "Okx", "Lifi")

Example: Transact
amountsstring[]Optional

(Solana only) Transaction amounts used to calculate nullifier count for accurate fee estimation. Provide the amounts that will be used in the subsequent transaction.

Example: ["1000000"]
mintFromstringOptional

(Solana swap only) Input token mint address for OKX ATA cost estimation.

Example: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
Header parameters
x-hinkal-request-signaturestringRequired

Hex-encoded compact secp256k1 signature: secp256k1_sign(SHA256(binding + "\n" + payload)), where binding is "<METHOD> <routePath>" (this route's own method and path, e.g. "POST /refresh-cache" or "GET /balance") and payload is JSON.stringify(body) for POST requests or the raw query string for GET requests. Binding the route into the signed digest stops a signature captured for one endpoint from being replayed against another. See Authentication for the full signing scheme.

Responses
200

Fee amount

application/json
get/get-fee
GET /get-fee?sessionId=ffd74231-0672-48c7-bd82-9f72a803578b&nonce=3e0c5b91-e133-4aaa-bad1-ade100b3de2a&chainId=10&feeToken=0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85&tokenAddresses=0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85&externalActionId=Transact HTTP/1.1
Host: api.hinkal.io
x-hinkal-request-signature: text
Accept: */*
{
  "success": true,
  "feeAmount": "1000",
  "nonce": "3e0c5b91-e133-4aaa-bad1-ade100b3de2a"
}

Last updated