The constructor function takes a NetworkConfig object as a parameter and assigns it to the networkInformation property.
A NetworkConfig object that contains information about the network on which the Supra client is running.
Query a table item on Supra.
The type of the response data to be returned.
The table handle.
The key type, the value type and the key of the item; see TableItemRequest.
A Promise that resolves to the table item's value as the node returns it, without type conversion.
import { SupraClient,Network } from "supra-ts-sdk";
const supra = new SupraClient({ network: Network.TESTNET });
async function runExample() {
const handle = "0x1";
const key = "0x1";
const keyType = "address";
const valueType = "u64";
const tableItem = await supra.table.getTableItem({ handle: handle, data: { key_type: keyType, value_type: valueType, key: key }});
console.log(tableItem);
}
runExample().catch(console.error);
The Table class provides methods for querying table items on the Supra network.