Creates an instance of the Aptos client with the provided configuration. This allows interaction with the Aptos blockchain using the specified settings.
The configuration settings for the Aptos client.
import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
async function runExample() {
// Create a configuration for the Aptos client
const config = new AptosConfig({
network: Network.TESTNET, // Specify the desired network
nodeUrl: "https://testnet.aptos.dev", // Replace with your node URL
});
// Create an instance of the Aptos client
const aptos = new Aptos(config);
console.log("Aptos client created successfully", aptos);
}
runExample().catch(console.error);
Fetches the object data based on the specified object address.
Optional
minimumOptional minimum ledger version to wait for.
The object address to retrieve data for.
Optional
options?: PaginationArgs & OrderByArg<{ Optional configuration options for pagination and ordering.
The object data corresponding to the provided address.
import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";
const config = new AptosConfig({ network: Network.TESTNET });
const aptos = new Aptos(config);
async function runExample() {
// Fetching object data by object address
const objectData = await aptos.getObjectDataByObjectAddress({
objectAddress: "0x1", // replace with a real object address
});
console.log(objectData);
}
runExample().catch(console.error);
A class to query all
Object
related queries on Aptos.