For AI agents: an LLM-friendly Markdown version of every page is available by appending .md to its URL or by sending an Accept: text/markdown request header. The full documentation index is at https://www.ankr.com/docs/llms.txt
Skip to main content

IOTA — iota, unsafe (2/3)

API reference for IOTA. All methods ->

Part 2 of 3: 1 · 2 · 3

iota_multiGetObjects

Retrieves multiple on-chain objects by ID.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    • object_ids< [ObjectID] > (required): the list of object IDs to query.
    • options< ObjectDataOptions > (optional): optional settings for specifying which parts of the object data to include in the response.

Returns

Vec<IotaObjectResponse><[ IotaObjectResponse ]>

Request example

curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "iota_multiGetObjects",
"params": [
[
"0x9f5bc1dbdc77a1603835318928fcb4bfb8b80b59638ea86579aecdadb00e6a58",
"0x0000000000000000000000000000000000000000000000000000000000000005",
"0x3aba764588cac339ef5b2676cad430a6d7a0fbc97d2d8e3eece9c42ee0379593",
"0xee2fe355d70cd714eaa82d2d10644b44a3e2f65146dc95a7b759cab4b1d1ab72"
],
{
"showType": true,
"showOwner": true,
"showPreviousTransaction": true,
"showDisplay": false,
"showContent": true,
"showBcs": false,
"showStorageRebate": true
}
],
"id": 1
}'

Response example

{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"data": {
"objectId": "0x9f5bc1dbdc77a1603835318928fcb4bfb8b80b59638ea86579aecdadb00e6a58",
"version": "13624397",
"digest": "7igEiTswauamJfm8vKQq4htKzyEwTJKBUTP9RvfXaj2g",
"type": "0x3::timelocked_staking::TimelockedStakedIota",
"owner": {
"AddressOwner": "0x1ee12dca0e798966a82f74c010c109e1bd0674f4f47517db6843f223bad5eb7c"
},
"previousTransaction": "1yWvHoudroTZA8TpNwLCEjmGLaEZCLoXZETjt4GRq7G",
"storageRebate": "3009600",
"content": {
"dataType": "moveObject",
"type": "0x3::timelocked_staking::TimelockedStakedIota",
"fields": {
"expiration_timestamp_ms": "1787097600000",
"id": {
"id": "0x9f5bc1dbdc77a1603835318928fcb4bfb8b80b59638ea86579aecdadb00e6a58"
},
"label": "000000000000000000000000000000000000000000000000000000000000107a::stardust_upgrade_label::STARDUST_UPGRADE_LABEL",
"staked_iota": {
"type": "0x3::staking_pool::StakedIota",
"fields": {
"id": {
"id": "0xc9b07d5e6148cf2f70bc2f4d013bbe2697764a4e6181f0610803aac940bb04cc"
},
"pool_id": "0x829fcfaca1ce8ca42161469447c23a600b2df7215a5b784a51e930e323bdd3bb",
"principal": "2816564858653000",
"stake_activation_epoch": "10"
}
}
}
}
}
},
{
"error": {
"code": "deleted",
"object_id": "0xee2fe355d70cd714eaa82d2d10644b44a3e2f65146dc95a7b759cab4b1d1ab72",
"version": 13624397,
"digest": "7gyGAp71YXQRoxmFBaHxofQXAipvgHyBKPyxmdSJxyvz"
}
}
]
}

iota_multiGetTransactionBlocks

Retrieves multiple transaction blocks by digest.

Retrieves an ordered list of transaction responses The method will throw an error if the input contains any duplicate or the input size exceeds QUERY_MAX_RESULT_LIMIT.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    • digests< [TransactionDigest] > (required): a list of transaction digests to query.
    • options< TransactionBlockResponseOptions > (optional): configuration options to control which fields are included in the response.

Returns

Vec<IotaTransactionBlockResponse><[ TransactionBlockResponse ]>

Request example

curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "iota_multiGetTransactionBlocks",
"params": [
[
"1yWvHoudroTZA8TpNwLCEjmGLaEZCLoXZETjt4GRq7G",
"ESwp5E4rEeGSpfi86vpzogszMLo3mnkedUcvjEdLqqLi"
],
{
"showInput": true,
"showRawInput": false,
"showEffects": true,
"showEvents": true,
"showObjectChanges": false,
"showBalanceChanges": false,
"showRawEffects": false
}
],
"id": 1
}'

Response example

{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"digest": "1yWvHoudroTZA8TpNwLCEjmGLaEZCLoXZETjt4GRq7G",
"transaction": {
"data": {
"transaction": {
"kind": "ProgrammableTransaction",
"inputs": ["object", "sharedObject", "pure<address>"],
"transactions": [
{
"MoveCall": {
"package": "0x3",
"module": "timelocked_staking",
"function": "request_add_stake"
}
}
]
},
"sender": "0x1ee1...eb7c"
}
},
"effects": {
"status": { "status": "success" },
"executedEpoch": "9",
"gasUsed": {
"computationCost": "1000000",
"storageCost": "299037200",
"storageRebate": "296027600"
},
"created": ["0x9f5b...6a58"],
"mutated": ["0x0000...0005", "0x3aba...9593", "0x5b89...48d1"],
"deleted": ["0xee2f...ab72"]
},
"events": [
{
"type": "0x3::validator::StakingRequestEvent",
"parsedJson": {
"amount": "2816564858653000",
"epoch": "9"
}
}
],
"timestampMs": "1747226554971",
"checkpoint": "3513008"
},
{
"digest": "ESwp5E4rEeGSpfi86vpzogszMLo3mnkedUcvjEdLqqLi",
"transaction": {
"data": {
"transaction": {
"kind": "ProgrammableTransaction",
"inputs": ["object", "pure<u64>", "pure<vector<u8>>"],
"transactions": [
{ "MoveCall": { "function": "borrow_assets" } },
{ "MakeMoveVec": ["Receipt", []] },
{ "MoveCall": { "function": "take_coin_balance" } },
{ "MoveCall": { "function": "from_balance" } },
{ "MergeCoins": ["GasCoin"] },
{ "MoveCall": { "function": "return_assets_from_borrow" } },
{ "MoveCall": { "function": "transition" } }
]
},
"sender": "0x7b4a...dd67"
}
},
"effects": {
"status": { "status": "success" },
"executedEpoch": "9",
"gasUsed": {
"computationCost": "1000000",
"storageCost": "6619600",
"storageRebate": "6619600"
},
"mutated": ["0x0dc4...409d", "0x3215...3cb8", "0xb693...270d"]
},
"events": [],
"timestampMs": "1747232429004",
"checkpoint": "3538984"
}
]
}

iota_tryGetPastObject

Retrieves a past version of an object if available.

Note: there is no software-level guarantee/SLA that objects with past versions can be retrieved by this API, even if the object and version exists/existed. The result may vary across nodes depending on their pruning policies. Return the object information for a specified version.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    • object_id< ObjectID > (required): the ID of the queried object.
    • version< SequenceNumber > (required): the version of the queried object. If null, defaults to the latest known version.
    • options< ObjectDataOptions > (optional): settings for specifying which parts of the object data to include in the response.

Returns

IotaPastObjectResponse< ObjectRead >

Request example

curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "iota_tryGetPastObject",
"params": [
"0x0000000000000000000000000000000000000000000000000000000000000005",
13624397,
{
"showType": true,
"showOwner": true,
"showPreviousTransaction": true,
"showDisplay": false,
"showContent": true,
"showBcs": false,
"showStorageRebate": true
}
],
"id": 1
}'

Response example

{
"id": 1,
"jsonrpc": "2.0",
"result": {
"status": "VersionFound",
"details": {
"objectId": "0x0000000000000000000000000000000000000000000000000000000000000005",
"version": "13624397",
"digest": "5HqUbjLYUvLayiSS4RwqHC55BMwnGp5dmiZCf375gHfh",
"type": "0x3::iota_system::IotaSystemState",
"owner": {
"Shared": {
"initial_shared_version": 1
}
},
"previousTransaction": "1yWvHoudroTZA8TpNwLCEjmGLaEZCLoXZETjt4GRq7G",
"storageRebate": "1444000",
"content": {
"dataType": "moveObject",
"type": "0x3::iota_system::IotaSystemState",
"fields": {
"id": {
"id": "0x0000000000000000000000000000000000000000000000000000000000000005"
},
"version": "2"
}
}
}
}
}

iota_tryMultiGetPastObjects

Retrieves past versions of multiple objects if available.

Note: there is no software-level guarantee/SLA that objects with past versions can be retrieved by this API, even if the object and version exists/existed. The result may vary across nodes depending on their pruning policies. Return the object information for a specified version.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    • past_objects< [GetPastObjectRequest] > (required): a list of objects and their corresponding versions to be queried.
    • options< ObjectDataOptions > (optional): settings for specifying which parts of the object data to include in the response.

Returns

Vec<IotaPastObjectResponse><[ ObjectRead ]>

Request example

curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "iota_tryMultiGetPastObjects",
"params": [
[
{
"objectId": "0x5b890eaf2abcfa2ab90b77b8e6f3d5d8609586c3e583baf3dccd5af17edf48d1",
"version": "13624397"
},
{
"objectId": "0x0000000000000000000000000000000000000000000000000000000000000005",
"version": "13624397"
}
],
{
"showType": true,
"showOwner": true,
"showPreviousTransaction": true,
"showDisplay": false,
"showContent": true,
"showBcs": false,
"showStorageRebate": true
}
],
"id": 1
}'

Response example

{
"jsonrpc": "2.0",
"result": [
{
"status": "VersionFound",
"details": {
"objectId": "0x5b890eaf2abcfa2ab90b77b8e6f3d5d8609586c3e583baf3dccd5af17edf48d1",
"version": "13624397",
"digest": "HRYS5tXW9HwcxV9NufDDHJvFUvwQ3GzAU5h1Tr9wWLZC",
"type": "0x2::dynamic_field::Field<u64, 0x3::iota_system_state_inner::IotaSystemStateV2>",
"owner": {
"ObjectOwner": "0x0000000000000000000000000000000000000000000000000000000000000005"
},
"previousTransaction": "1yWvHoudroTZA8TpNwLCEjmGLaEZCLoXZETjt4GRq7G",
"storageRebate": "293603200",
"content": {
"dataType": "moveObject",
"type": "0x2::dynamic_field::Field<u64, 0x3::iota_system_state_inner::IotaSystemStateV2>",
"fields": {
"balance": "10000",
"id": {
"id": "0x5b890eaf2abcfa2ab90b77b8e6f3d5d8609586c3e583baf3dccd5af17edf48d1"
}
}
}
}
},
{
"status": "VersionFound",
"details": {
"objectId": "0x0000000000000000000000000000000000000000000000000000000000000005",
"version": "13624397",
"digest": "5HqUbjLYUvLayiSS4RwqHC55BMwnGp5dmiZCf375gHfh",
"type": "0x3::iota_system::IotaSystemState",
"owner": {
"Shared": {
"initial_shared_version": 1
}
},
"previousTransaction": "1yWvHoudroTZA8TpNwLCEjmGLaEZCLoXZETjt4GRq7G",
"storageRebate": "1444000",
"content": {
"dataType": "moveObject",
"type": "0x3::iota_system::IotaSystemState",
"fields": {
"id": {
"id": "0x0000000000000000000000000000000000000000000000000000000000000005"
},
"version": "2"
}
}
}
}
],
"id": 1
}

unsafe_batchTransaction

Create an unsigned batched transaction.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    • signer< IotaAddress > (required): the IOTA address of the transaction signer.
    • single_transaction_params< [RPCTransactionRequestParams] > (required): list of transaction request parameters to be included in the transaction.
    • gas< ObjectID > (optional): the gas object to use for this transaction. If not provided, the node selects one from the signer's owned objects.
    • gas_budget< BigInt_for_uint64 > (required): the maximum gas allowed for the transaction. The transaction will fail if this budget is exceeded.
    • txn_builder_mode< IotaTransactionBlockBuilderMode > (optional): specifies the transaction builder mode, indicating whether this is a regular transaction or a dev inspect transaction.

Returns

TransactionBlockBytes< TransactionBlockBytes >
  • gas< [ObjectRef] > (required): the list of gas objects to be used in the transaction.
  • inputObjects< [InputObjectKind] > (required): the objects involved in this transaction.
  • txBytes< Base64 > (required): the BCS-encoded transaction data (without its type tag), provided as a base64-encoded string.

Request example

curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "unsafe_batchTransaction",
"params": [
{
"signer": "0xYourIotaAddress",
"single_transaction_params": [
{
"moveCallRequestParams": {
"package_object_id": "0xPackageID",
"module": "moduleName",
"function": "functionName",
"type_arguments": [],
"arguments": []
}
},
{
"transferObjectRequestParams": {
"object_id": "0xObjectID",
"recipient": "0xRecipientAddress"
}
}
],
"gas_budget": "1000000"
}
],
"id": 1
}'

Response parameters

{
"jsonrpc": "2.0",
"id": 1,
"method": "unsafe_batchTransaction",
"params": {
"signer": "string (IotaAddress)",
"single_transaction_params": [
{
"moveCallRequestParams": {
"package_object_id": "string (ObjectID)",
"module": "string",
"function": "string",
"type_arguments": ["string"],
"arguments": ["any"]
}
// or
// "transferObjectRequestParams": {
// "object_id": "string (ObjectID)",
// "recipient": "string (IotaAddress)"
// }
}
],
"gas": "string (ObjectID, optional)",
"gas_budget": "string (BigInt_for_uint64)",
"txn_builder_mode": "string (IotaTransactionBlockBuilderMode, optional)"
}
}


unsafe_mergeCoins

Creates an unsigned transaction to merge multiple coins.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    • signer< IotaAddress > (required): the IOTA address of the transaction signer.
    • primary_coin< ObjectID > (required): the coin object into which the other will be merged; this coin will remain after the transaction.
    • coin_to_merge< ObjectID > (required): the coin object to be merged and destroyed; its balance will be added to the primary_coin.
    • gas< ObjectID > (optional): the gas object to use for this transaction. If not provided, the node will select one from the signer's assets.
    • gas_budget< BigInt_for_uint64 > (required): the gas limit for this transaction; it will fail if the gas usage exceeds this budget.

Returns

TransactionBlockBytes< TransactionBlockBytes >

Request example

curl -X POST https://rpc.ankr.com/iota_mainnet/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "unsafe_mergeCoins",
"params": [
"0xYOUR_SIGNER_ADDRESS", // placeholder: signer address (IotaAddress)
"0xPRIMARY_COIN_OBJECT_ID", // placeholder: coin object that will remain
"0xCOIN_TO_MERGE_OBJECT_ID", // placeholder: coin object that will be merged and destroyed
"0xOPTIONAL_GAS_OBJECT_ID", // placeholder: gas object (can be same as primary coin or omitted)
"1000000" // gas budget as string (BigInt)
],
"id": 1
}'

Response example

{
"jsonrpc": "2.0",
"id": 1,
"result": {
"digest": "0xTRANSACTION_DIGEST", // placeholder: transaction hash
"effects": {
"status": { "status": "success" }, // status of transaction execution
"gasUsed": {
"computationCost": "1000000", // example gas values
"storageCost": "50000",
"storageRebate": "45000",
"nonRefundableStorageFee": "0"
},
"mutated": [
{
"owner": { "AddressOwner": "0xSIGNER_ADDRESS" },
"reference": {
"objectId": "0xPRIMARY_COIN_OBJECT_ID", // placeholder: updated coin object
"version": 12345678,
"digest": "0xUPDATED_OBJECT_DIGEST"
}
}
],
"deleted": [
{
"objectId": "0xCOIN_TO_MERGE_OBJECT_ID", // placeholder: deleted coin
"version": 12345678,
"digest": "0xDELETED_OBJECT_DIGEST"
}
]
},
"timestampMs": "1690000000000", // placeholder timestamp
"checkpoint": "1234567" // checkpoint in which transaction was finalized
}
}