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 abe92d0
Showing 1 changed file with 8 additions and 0 deletions.
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

0 comments on commit abe92d0

Please sign in to comment.