Querying

Querying

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

Querying a NameRecord

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: '0x1309c4b6fefb38127333eba70ac9ed63e211ac44e92695d423e51baf655e42e2',
//   targetAddress: '0xfe09cf0b3d77678b99250572624bf74fe3b12af915c5db95f0ed5d755612eb68',
//   expirationTimestampMs: '1746018571863',
//   data: {},
// }

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);
 
// Example output (Prices are in MIST; 1 SUI = 1_000_000_000 MIST)
// {
//   threeLetters: 500000000000,
//   fourLetters: 100000000000,
//   fivePlusLetters: 20000000000
// }

Query active renewals pricing

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

const renewalPriceList = await suinsClient.getRenewalPricelist();
console.log(renewalPriceList);
 
// Example output (Prices are in MIST; 1 SUI = 1_000_000_000 MIST)
// {
//   threeLetters: 50000000000,
//   fourLetters: 10000000000,
//   fivePlusLetters: 2000000000
// }