Name Service Lookups
Resolve Names
import { ThorClient, vnsUtils } from '@vechain/sdk-network';
const thor = ThorClient.at('https://mainnet.vechain.org');
console.log('resolveName', await vnsUtils.resolveName(thor, 'test.vet'));
console.log('resolveNames', await vnsUtils.resolveNames(thor, ['test.vet']));
console.log(
'resolveName',
await vnsUtils.resolveName(thor, '_invalid_test.vet')
);Lookup Addresses
import { ThorClient, vnsUtils } from '@vechain/sdk-network';
const thor = ThorClient.at('https://mainnet.vechain.org');
console.log(
'lookupAddress',
await vnsUtils.lookupAddress(
thor,
'0x105199a26b10e55300CB71B46c5B5e867b7dF427'
)
);
console.log(
'lookupAddresses',
await vnsUtils.lookupAddresses(thor, [
'0x105199a26b10e55300CB71B46c5B5e867b7dF427',
])
);
console.log(
'lookupAddress',
await vnsUtils.lookupAddress(
thor,
'0x0000000000000000000000000000000000000000'
)
);
Last updated
Was this helpful?