Tables
Tables Api
Get the value at the key specified in the request body from the Move table identified by the {table_handle} path parameter. The key must be represented as an instance of key_type in the Move state, and the value must be represented as an instance of value_type. If either the key or the value cannot be parsed into the corresponding type then the API will return status code 400.
Example of body
{
"key_type": "u64",
"value_type": "0x1::multisig_voting::Proposal<0x1::governance_proposal::GovernanceProposal>",
"key": "12"
}{
"key_type": "u64",
"value_type": "0x1::string::String",
"key": "42"
}Table handle to lookup. Should be a valid Move address retrieved from the account resources API.
Describes body of the Table item request by item key.
String representation of an on-chain Move type tag that is exposed in transaction payload. Values:
- bool
- u8
- u16
- u32
- u64
- u128
- u256
- address
- signer
- vector:
vector<{non-reference MoveTypeId}> - struct:
{address}::{module_name}::{struct_name}::<{generic types}>
Vector type value examples:
vector<u8>vector<vector<u64>>vector<0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>>
Struct type value examples:
0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>0x1::account::Account
Note:
- Empty chars should be ignored when comparing 2 struct tag ids.
- When used in a URL path, should be encoded by url-encoding (AKA percent-encoding).
String representation of an on-chain Move type tag that is exposed in transaction payload. Values:
- bool
- u8
- u16
- u32
- u64
- u128
- u256
- address
- signer
- vector:
vector<{non-reference MoveTypeId}> - struct:
{address}::{module_name}::{struct_name}::<{generic types}>
Vector type value examples:
vector<u8>vector<vector<u64>>vector<0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>>
Struct type value examples:
0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>0x1::account::Account
Note:
- Empty chars should be ignored when comparing 2 struct tag ids.
- When used in a URL path, should be encoded by url-encoding (AKA percent-encoding).
The value of the table item's key.
Item of the table
An enum of the possible Move value types.
Provided values cannot be parsed into the corresponding types.
POST /rpc/v2/tables/{table_handle}/item HTTP/1.1
Host: rpc-testnet.supra.com
Content-Type: application/json
Accept: */*
Content-Length: 50
{
"key_type": "text",
"value_type": "text",
"key": null
}{
"U8": 1
}Last updated
