Skip to content

Commit

Permalink
[DT-902] chore: updating README.md to include ENS examples
Browse files Browse the repository at this point in the history
  • Loading branch information
DChan0319 committed Oct 3, 2023
1 parent 994f5bb commit 5348006
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ function resolve(domain, currency) {

resolve('brad.crypto', 'ETH');
resolve('brad.zil', 'ZIL');
resolve('vitalik.eth', 'ETH');
```

### Find the IPFS hash for a decentralized website
Expand All @@ -186,13 +187,16 @@ function resolveIpfsHash(domain) {
}

resolveIpfsHash('homecakes.crypto');
resolveIpfsHash('vitalik.eth');
```

### Find a custom record

Create a new file in your project, `custom-resolution.js`.

```javascript
// Does not support ENS

function resolveCustomRecord(domain, record) {
resolution
.records(domain, [record])
Expand Down Expand Up @@ -222,6 +226,8 @@ function getWalletAddr(domain, ticker) {
}
getWalletAddr('homecakes.crypto', 'ETH');
// Domain homecakes.crypto has address for ETH: 0xe7474D07fD2FA286e7e0aa23cd107F8379085037
getWalletAddr('vitalik.eth', 'ETH');
// Domain homecakes.crypto has address for ETH: 0xe7474D07fD2FA286e7e0aa23cd107F8379085037
```

### Resolve multi-chain address format using `multiChainAddr`
Expand All @@ -233,6 +239,8 @@ This API is used to retrieve wallet address for multi-chain address records.
With `aaron.x` has `crypto.AAVE.version.ERC20.address` on-chain:

```javascript
// Does not support ENS

function getMultiChainWalletAddr(domain, ticker, network) {
resolution
.multiChainAddr(domain, ticker, network)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
"dependencies": {
"@ethersproject/abi": "^5.0.1",
"bn.js": "^4.4.0",
"cross-fetch": "^3.1.4",
"cross-fetch": "4.0.0",
"crypto-js": "^4.1.1",
"elliptic": "^6.5.4",
"ethereum-ens-network-map": "^1.0.2",
Expand Down

0 comments on commit 5348006

Please sign in to comment.