Jump to
Ctrl
+
/

Estimate Token Transfer Compute Units Solana

POST
/blockchain-fees/solana/{network}/estimate-token-transfer-compute-units

This endpoint estimates the number of compute units an SPL token transfer would consume on Solana. The transfer transaction is built and simulated against the node (without being broadcast) and the simulated compute units consumed are returned. If the recipient does not yet have an associated token account for the given token, the estimate includes the cost of creating it. Supports both the classic Token program and Token-2022 via the tokenStandard field. NFTs on Solana are SPL tokens under the regular Token program, so use "TOKEN" for NFT transfers.

Path Parameters

network string Required

Represents the name of the blockchain network used; blockchain networks are usually identical as technology and software, but they differ in data, e.g. - "mainnet" is the live network with actual data while a network like "devnet" is a test network.

Query Parameters

context string Optional

In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. context is specified by the user.

Request Body Schema application/json

context string Optional

In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. context is specified by the user.

data object Required
item object Required
amount string Required

The quantity of the SPL token to transfer, expressed in the token's raw base units (the on-chain integer value, before the mint's decimals are applied) — not a SOL/lamport amount. String-encoded non-negative integer. Example: for a token with 6 decimals, 1.5 tokens = "1500000".

contractAddress string Required

Base58 string representation of the SPL token mint address (the token's on-chain identifier, equivalent to a token contract address on other chains).

recipient string Required

Base58 string representation of the recipient owner pubkey (the wallet receiving the tokens; its associated token account is derived automatically).

sender string Required

Base58 string representation of the sender owner pubkey (the fee payer and source wallet of the tokens).

tokenStandard string Required

The SPL token standard the mint belongs to. Allowed values: "TOKEN" (classic Token program) or "TOKEN-2022". NFTs on Solana are regular Token-program SPL tokens, so use "TOKEN" for NFT transfers.

Response Schema

apiVersion string Required

Specifies the version of the API that incorporates this endpoint.

2024-12-12
requestId string Required

Defines the ID of the request. The requestId is generated by Crypto APIs and it's unique for every request.

601c1710034ed6d407996b30
context string Optional

In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. context is specified by the user.

yourExampleString
data object Required
item object Required
computeUnits integer Required

Amount of the simulated compute units the SPL token transfer would consume. Includes associated-token-account creation cost when the recipient account does not yet exist.

4645

Credits Cost

Blockchain protocol Credits for 1 Results
Default Cost 120
Solana 120
Was this page helpful?
Yes
No
Powered by
Language
URL

{
    "apiVersion": "2024-12-12",
    "requestId": "601c1710034ed6d407996b30",
    "context": "yourExampleString",
    "data": {
        "item": {
            "computeUnits": 4645
        }
    }
}