JAZ DID
  • Introduction
  • Terminology
  • Guides
    • Registering Names
    • Resolving Names
  • Developers
    • Getting Started
    • Architecture
    • Resolving Names
    • Register Names
    • Managing Names
    • Name Records
    • Renew Names
    • Deployments
      • BNB Chain
Powered by GitBook
On this page
  • Call the service to get the parsing record
  • Supports the key of parsing records
  • Call the contract to get parsing records (batch)
  • Call the contract to get the parsing record (single)
  1. Developers

Name Records

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

PreviousManaging NamesNextRenew Names

Last updated 2 years ago