Call the service to get the parsing record
import { Services } from '@jazdid/jaz-did-sdk';
// Request parameter combination 1, keyType is DomainName
const data1 = {
keyType: 'DomainName',
registrar: registrarAddress,
domainName: `${domainName}.bab`,
chain: 'bnb',
};
// Request parameter combination 2, keyType is Address
const data2 = {
keyType: 'Address',
registrar: registrarAddress,
address: privateAaccount,
chain: 'bnb',
};
await Services.domainService.resolveList(data1);
Supports the key of parsing records
| 'avatar'
| 'url'
| 'description'
| 'keywords'
| 'email'
| 'com.twitter'
| 'com.discord'
| 'org.telegram'
| 'com.medium'
| 'com.instagram'
| 'com.github';
Call the contract to get parsing records (batch)
import { evm } from '@jazdid/jaz-did-sdk';
const result = await evm.resolver.getRecords({
resolverAddress,
registrarAddress,
domainName,
record: ['email', 'avatar'],
}, {chainId});
console.log(JSON.stringify(result));
// {"email":"123456@gmail.com","avatar":""}
Call the contract to get the parsing record (single)
import { evm } from '@jazdid/jaz-did-sdk';
const result = await evm.resolver.getRecord({
resolverAddress,
registrarAddress,
domainName,
record: 'email',
}, {chainId});
console.log(result);
// 123456@gmail.com