Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dchan/dt 902 add ens resolution js #254

Merged
merged 29 commits into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
243d3be
[DT-912] Revert: "Removes ENS support"
DChan0319 Oct 19, 2022
a84c013
[DT-902] test: fixing tests to use alchemy's goerli as provider for ENS
DChan0319 Oct 25, 2022
f3d86f8
[DT-902] docs: updating changelog to include minor version for ENS su…
DChan0319 Oct 25, 2022
5d9c219
[DT-902] refactor: ENS constructor and fix ENS.test.ts
DChan0319 Sep 5, 2023
7d5018c
[DT-902] test: Fixed Resolution.test.ts unit tests
DChan0319 Sep 5, 2023
54f0cec
[DT-902] refactor: Added UdApi for ensConfig
DChan0319 Sep 5, 2023
7df48c0
[DT-902] refactor: added ens.getAddress()
DChan0319 Sep 6, 2023
068b415
[DT-902] fix: CI node version
DChan0319 Sep 6, 2023
fd0ef8c
[DT-902] fix: test setup and timeout
DChan0319 Sep 6, 2023
f458fa5
[DT-902] feature: Adding support for ENS tokenURI()
DChan0319 Sep 12, 2023
5a4b8d1
[DT-902] feature: adding ENS support for unhash()
DChan0319 Sep 13, 2023
7e5eae4
[DT-902] feature: adding ENS support for locations()
DChan0319 Sep 13, 2023
0059ff6
[DT-902] chore: removing unnecessary README.md info
DChan0319 Sep 13, 2023
01efdf0
[DT-902] fix: fixing unit tests
DChan0319 Sep 13, 2023
13470f8
[DT-902] fix: Ens.fetchAddress() to support ud Api as the provider wi…
DChan0319 Sep 20, 2023
001ad5e
[DT-902] Updating @unstoppabledomains/sizecheck dev dependency to lat…
DChan0319 Sep 21, 2023
96a7fe2
[DT-902] fix: Fixed @unstoppabledomains/sizecheck version to 4.0.4
DChan0319 Sep 21, 2023
23ef0fc
[DT-902] Fix: owner() & reverse()
DChan0319 Sep 25, 2023
38fc045
[DT-902] Fix: Resolution.addr()
DChan0319 Sep 26, 2023
faa6b80
[DT-902] feature: adding ENS support for Resolution.email(), Resoluti…
DChan0319 Sep 26, 2023
2dcdb11
[DT-902] fix: Added final validation for Ens.reverseOf()
DChan0319 Sep 26, 2023
0755d5a
[DT-902] fix: locations() & added better error handling
DChan0319 Sep 28, 2023
6c4c53a
[DT-902] refactor: reverseTokenId() to support ENS
DChan0319 Sep 28, 2023
6a258b0
[DT-902] chore: added Ens.dns() todo
DChan0319 Sep 28, 2023
2b5d780
[DT-902] fix: Unit testing and small updates
DChan0319 Sep 28, 2023
1df7ff2
[DT-902] chore: resolve PR comments & revise unit tests
DChan0319 Sep 29, 2023
994f5bb
[DT-902] chore: Making sure to throw unsupported method for Ens multi…
DChan0319 Sep 29, 2023
5348006
[DT-902] chore: updating README.md to include ENS examples
DChan0319 Oct 3, 2023
c637a4d
v9.2.0
DChan0319 Oct 3, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
L1_TEST_NET_RPC_URL=https://goerli.infura.io/v3/<your_key>
L1_TEST_NET_RPC_WSS_URL=wss://goerli.infura.io/ws/v3/<your_key>
L2_TEST_NET_RPC_URL=https://polygon-mumbai.infura.io/v3/<your_key>
L2_TEST_NET_RPC_WSS_URL=wss://polygon-mumbai.g.alchemy.com/v2/<your_key>
L2_TEST_NET_RPC_WSS_URL=wss://polygon-mumbai.g.alchemy.com/v2/<your_key>
4 changes: 2 additions & 2 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
node: [12, 14, 16]
node: [16]

name: ${{ matrix.os }} - Node ${{ matrix.node }}

Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: 12
node-version: ${{ matrix.node }}

- name: Install Dependencies
run: yarn install
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 9.2.0

- Add ENS support

## 9.1.0

- Add new getAddress API
Expand Down
25 changes: 4 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ const resolution = new Resolution({
url: 'https://api.zilliqa.com',
network: 'mainnet',
},
ens: {
url: 'https://mainnet.infura.io/v3/<infura_api_key>',
network: 'mainnet',
},
},
});
```
Expand Down Expand Up @@ -333,26 +337,6 @@ token.EVM.ETH.USDC.address
crypto.USDC.address
token.EVM.ETH.address
```

`getAddress(domain, 'ETH', 'USDC')` will lookup records in the following order:
DChan0319 marked this conversation as resolved.
Show resolved Hide resolved

```
1. token.EVM.ETH.USDC.address
2. crypto.USDC.address
3. crypto.USDC.version.ERC20.address
4. token.EVM.ETH.address
5. token.EVM.address
```

> **Warning** please use the API with caution as it's still in beta. Please
> submit an issue if you find a bug.

### Command Line Interface

CLI support was removed from the Resolution library starting from version 6.0.
Please use the
[standalone CLI tool](https://github.com/unstoppabledomains/resolution-cli).

## Error Handling

When resolution encounters an error it returns the error code instead of
Expand Down Expand Up @@ -389,7 +373,6 @@ or **Linux shell**).
### Internal config

#### To update:

- Network config: `$ yarn network-config:pull`
- Resolver keys: `$ yarn resolver-keys:pull`
- Both configs: `$ yarn config:pull`
Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = {
diagnostics: false,
},
},
testTimeout: 40000,
testTimeout: 50000,
coveragePathIgnorePatterns: ['/node_modules/', '/src/tests/'],
setupFilesAfterEnv: ['<rootDir>/src/tests/jestSetup.ts'],
};
9 changes: 8 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"keywords": [
".crypto",
"zns",
"ens",
"ethereum",
"zilliqa",
"blockchain",
Expand All @@ -59,6 +60,7 @@
},
"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",
Expand All @@ -71,6 +73,8 @@
"@unstoppabledomains/sizecheck": "^4.0.0",
"@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",
Expand Down Expand Up @@ -99,7 +103,10 @@
"bn.js": "^4.4.0",
"cross-fetch": "^3.1.4",
"crypto-js": "^4.1.1",
"elliptic": "^6.5.4"
"elliptic": "^6.5.4",
"ethereum-ens-network-map": "^1.0.2",
"js-sha256": "^0.9.0",
"js-sha3": "^0.8.0"
},
"lint-staged": {
"src/**/*.ts": "eslint --fix",
Expand Down
Loading