diff --git a/CHANGELOG.md b/CHANGELOG.md index 99167c23..665d5d22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 9.2.2 + +- Changed devDependencies to dependencies + ## 9.2.1 - Fix ens-config.json path error diff --git a/package.json b/package.json index 28081938..74e16067 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@unstoppabledomains/resolution", - "version": "9.2.1", + "version": "9.2.2", "description": "Domain Resolution for blockchain domains", "main": "./build/index.js", "directories": { @@ -60,7 +60,6 @@ }, "homepage": "https://github.com/unstoppabledomains/resolution.git#readme", "devDependencies": { - "@ensdomains/address-encoder": "0.2.18", "@ethersproject/providers": "^5.4.5", "@types/bn.js": "^4.11.6", "@types/crypto-js": "^4.1.1", @@ -73,8 +72,6 @@ "@unstoppabledomains/sizecheck": "^4.0.4", "@zilliqa-js/core": "^3.3.4", "audit-ci": "^3.1.1", - "bip44-constants": "^8.0.103", - "content-hash": "^2.5.2", "dotenv": "^8.2.0", "eslint": "^7.7.0", "eslint-config-prettier": "^8.3.0", @@ -99,8 +96,11 @@ "access": "public" }, "dependencies": { + "@ensdomains/address-encoder": "^0.2.22", "@ethersproject/abi": "^5.0.1", + "bip44-constants": "^8.0.103", "bn.js": "^4.4.0", + "content-hash": "^2.5.2", "cross-fetch": "4.0.0", "crypto-js": "^4.1.1", "elliptic": "^6.5.4", diff --git a/src/Ens.ts b/src/Ens.ts index b4788d5c..d1e67ee9 100644 --- a/src/Ens.ts +++ b/src/Ens.ts @@ -1,3 +1,7 @@ +import * as contentHash from 'content-hash'; +import bip44Constants from 'bip44-constants'; +import {formatsByCoinType} from '@ensdomains/address-encoder'; +import EnsNetworkMap from 'ethereum-ens-network-map'; import {default as ensInterface} from './contracts/ens/ens'; import {default as resolverInterface} from './contracts/ens/resolver'; import {default as nameWrapperInterface} from './contracts/ens/nameWrapper'; @@ -6,7 +10,6 @@ import {default as reverseRegistrarInterface} from './contracts/ens/reverseRegis import {EnsSupportedNetwork, EthCoinIndex, hasProvider} from './types'; import {ResolutionError, ResolutionErrorCode} from './errors/resolutionError'; import EthereumContract from './contracts/EthereumContract'; -import EnsNetworkMap from 'ethereum-ens-network-map'; import { EnsSource, Locations, @@ -25,7 +28,6 @@ import ConfigurationError, { ConfigurationErrorCode, } from './errors/configurationError'; import {EthereumNetworks} from './utils'; -import {requireOrFail} from './utils/requireOrFail'; import ensConfig from './config/ens-config.json'; import Networking from './utils/Networking'; @@ -390,17 +392,7 @@ export default class Ens extends NamingService { } protected getCoinType(currencyTicker: string): string { - const bip44constants = requireOrFail( - 'bip44-constants', - 'bip44-constants', - '^8.0.5', - ); - const formatsByCoinType = requireOrFail( - '@ensdomains/address-encoder', - '@ensdomains/address-encoder', - '>= 0.1.x <= 0.2.x', - ).formatsByCoinType; - const coin = bip44constants.findIndex( + const coin = bip44Constants.findIndex( (item) => item[1] === currencyTicker.toUpperCase() || item[2] === currencyTicker.toUpperCase(), @@ -447,12 +439,6 @@ export default class Ens extends NamingService { domain: string, coinType: string, ): Promise { - const formatsByCoinType = requireOrFail( - '@ensdomains/address-encoder', - '@ensdomains/address-encoder', - '>= 0.1.x <= 0.2.x', - ).formatsByCoinType; - const resolverContract = new EthereumContract( resolverInterface(resolver, coinType), resolver, @@ -490,7 +476,6 @@ export default class Ens extends NamingService { // @see https://docs.ens.domains/ens-improvement-proposals/ensip-7-contenthash-field private async getContentHash(domain: string): Promise { - const contentHash = requireOrFail('content-hash', 'content-hash', '^2.5.2'); const nodeHash = this.namehash(domain); const resolverContract = await this.getResolverContract(domain); const contentHashEncoded = await this.callMethod(