Skip to main content

Querying

Use the SuinsClient that you previously created to query on-chain data.

Query a name record

You can query a name record's latest state by calling the getNameRecord method on the SuinsClient instance.

const nameRecord = await suinsClient.getNameRecord('demo.sui');
console.log(nameRecord);

// Example output
// {
// name: 'demo.sui',
// nftId: '0xMyNftId',
// targetAddress: '0xTargetAddress',
// expirationTimestampMs: '1746018571863',
// data: {
// avatar: '0xAvatarObjectId',
// contentHash: 'content',
// walrusSiteId: '0xWalrusSiteId',
// },
// avatar: '0xAvatarObjectId',
// contentHash: 'content',
// walrusSiteId: '0xWalrusSiteId',
// }

Query active pricing

Call the getPriceList method on the SuinsClient instance to query the active names price list.

const priceList = await suinsClient.getPriceList();
console.log(priceList);

// ([domain_length_from, domain_length_to]: price. Prices are in USDC MIST; 1 USDC = 1_000_000 MIST)
// Example output:
// {
// [ 3, 3 ] => 500000000,
// [ 4, 4 ] => 100000000,
// [ 5, 63 ] => 20000000
// }

Query active renewal pricing

Call the getRenewalPricelist method on the SuinsClient instance to query the active renewal price list.

const renewalPriceList = await suinsClient.getRenewalPricelist();
console.log(renewalPriceList);

// ([domain_length_from, domain_length_to]: price. Prices are in USDC MIST; 1 USDC = 1_000_000 MIST)
// Example output:
// {
// [ 3, 3 ] => 500000000,
// [ 4, 4 ] => 100000000,
// [ 5, 63 ] => 20000000
// }