0.0.3 • Published 4 months ago

@bonfida/sns-warp-evm v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago
  1. Installation
  2. Introduction
  3. Supported chains
  4. Examples

With Yarn:

yarn add @bonfida/sns-warp-evm

With NPM:

npm i @bonfida/sns-warp-evm

This package can be used to resolve .sol domains on EVM chains. Currently the package only supports BNB testnet.

The JS client currently support the following chains:

  • BNB Testnet (deployed at 0x4d50e149bb3d8c889f4ccdfffba0ef8016168d92)
  • BNB Mainnet (deployed at 0xd1Ae42Ce34E6b7ab5B41dcc851424F3cF410BF16)

The supported chains can be accessed through the enum SupportedChains:

export enum SupportedChains {
  BNBTestNet = "BNBTestNet",
  BNBMainnet = "BNBMainnet",
  // ...
}

The list of all supported chains is also exported through ALL_SUPPORTED_CHAINS

Resolving a .sol domain

The following code can be used to resolve .sol domains

// The domain name to resolve
const domain = "mock3.sol";
// The chain on which to resolve the domain
const targetChain = SupportedChains.BNBMainnet;

const sns = new SNS(SupportedChains.BNBMainnet);
const resolved = await sns.resolveName(domain);

console.log(resolved); // <- 0x1D719d2dB763f905b1924F46a5185e001Dd93786

Reverse look up

The following code can be used to resolve a name address

// The chain on which to perform the reverse lookup
const targetChain = SupportedChains.BNBMainnet;

const sns = new SNS(targetChain);
const nameHash = namehash("mock3.sol");

const resolved = await sns.resolveReverse(nameHash);
console.log(resolved); // <- mock3
0.0.3

4 months ago

0.0.2

7 months ago

0.0.1-alpha.5

1 year ago

0.0.1-alpha.4

1 year ago

0.0.1-alpha.3

1 year ago

0.0.1-alpha.2

1 year ago

0.0.1-alpha.1

1 year ago

0.0.1-alpha

1 year ago