Skip to Content

🚧 These packages are still in development and may change rapidly as they are developed.

TypeScriptfetchResourceType

fetchResourceType

This function is used to fetch the resource type for a resource.

Usage

import { AptosJSProClient } from "@aptos-labs/js-pro"; const client = new AptosJSProClient({ /* ... */ }); const resourceType = await client.fetchResourceType({ accountAddress: "0x926ff619e85bdb5b02680f27bea5ea3302c71f86be4b16fa0d63df213add927a", resourceType: "0x1::account::Account", });

Parameters

NameTypeDefault
accountAddressAccountAddressInput
optionsLedgerVersionArg
resourceTypeT extends object ? string : T

The resource type to fetch. If the resource is a common type, the result may automatically be typed.

For example, if you pass in 0x1::account::Account, the result will be typed as:

{ type: "0x1::account::Account", data: { authentication_key: string; coin_register_events: ResourceEventHandle; guid_creation_num: string; withdraw_events: ResourceEventHandle; sequence_number: string; // ...more fields }; }
networkNetworkInfo

The network to use for the request. If not set, the network of the AptosJSProClient instance will be used.

Return Type

NameTypeDefault
type`${string}::${string}::${string}` & RT
dataT
Last updated on