Skip to content

Latest commit

 

History

History
42 lines (29 loc) · 970 Bytes

README.md

File metadata and controls

42 lines (29 loc) · 970 Bytes

Ethers: ENS Multicoin Provider Plug-in

The MulticoinProviderPlugin extends a Provider's ENS Resolver with access to the necessary coding libraries required to decode all supported ENSIP-9 coinTypes returned by the getAddr(bytes32, uint) resolver method.

Installing

/home/ricmoo/my_project> npm install @ethers-ext/provider-plugin-multicoin

Usage

import { plugin } from "@ethers-ext/provider-plugin-multicoin";

// However you get your provider
const provider = ethers.getDefaultProvider();

// Attach a plugin instance
provider.attchPlugin(plugin);

// Test it out!
(async function() {
    const resolver = await provider.getResolver("ricmoo.eth");

    // Get the Bitcoin address (coinType 0)
    console.log(await resolver.getAddress(0));
})();

License

MIT License.