Use DC contract to search *.country domains. Use contract 0x3C84F4690De96a0428Bc6777f5aA5f5a92150Ef2.
parent
e2f5516435
commit
4c60a2afe4
@ -1,12 +1,12 @@ |
||||
import { OneCountry } from 'one-country-sdk' |
||||
import { DC } from 'one-country-sdk' |
||||
import Web3 from "web3"; |
||||
import { config } from '../config' |
||||
|
||||
const { oneCountryContractAddress, shardUrls } = config |
||||
const provider = new Web3.providers.HttpProvider(shardUrls[0] || '') |
||||
const oneCountry = new OneCountry({ provider, contractAddress: oneCountryContractAddress }) |
||||
const oneCountry = new DC({ provider, contractAddress: oneCountryContractAddress }) |
||||
|
||||
export const getAddressByName = async (name: string) => { |
||||
const record = await oneCountry.getRecordByName(name) |
||||
const record = await oneCountry.getRecord(name) |
||||
return record ? record.renter : '' |
||||
} |
||||
|
Loading…
Reference in new issue