Use DC contract to search *.country domains. Use contract 0x3C84F4690De96a0428Bc6777f5aA5f5a92150Ef2.

pull/251/head
artemkolodko 2 years ago
parent e2f5516435
commit 4c60a2afe4
  1. 2
      .env
  2. 4
      package.json
  3. 6
      src/utils/oneCountry.ts

@ -7,4 +7,4 @@ REACT_APP_EXPLORER_V1_API_URL=https://ctrver.t.hmny.io/
REACT_APP_INDEXER_IPFS_GATEWAY=https://ipfs.io/ipfs/
REACT_APP_PROD_ADDRESS=https://ws.explorer-v2-api.hmny.io
REACT_APP_CONTRACT_SHARD=0
REACT_APP_ONE_COUNTRY_CONTRACT_ADDRESS=0x08b3f83557c4ab8c42fc3c87b04a79f1e4665912
REACT_APP_ONE_COUNTRY_CONTRACT_ADDRESS=0x3C84F4690De96a0428Bc6777f5aA5f5a92150Ef2

@ -11,7 +11,7 @@
"grommet": "2.17.2",
"grommet-icons": "^4.5.0",
"json-bigint": "^1.0.0",
"one-country-sdk": "^0.2.0",
"one-country-sdk": "3.1.2",
"react": "^17.0.2",
"react-chartjs-2": "^4.0.1",
"react-dom": "^17.0.2",
@ -25,7 +25,7 @@
"web3": "^1.3.6"
},
"scripts": {
"start": "env-cmd -f .env react-scripts --openssl-legacy-provider start",
"start": "env-cmd -f .env react-scripts start",
"start:testnet": "env-cmd -f .env.testnet react-scripts start",
"start:devnet": "env-cmd -f .env.devnet react-scripts start",
"build": "env-cmd -f .env react-scripts build",

@ -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…
Cancel
Save