1.0.2 • Published 4 months ago

@wehmoen/rnsts v1.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
4 months ago

Ronin Name Serive - Typescript Wrapper

This is a typescript wrapper for the Ronin Name Service.

Installation

npm install @wehmoen/rnsts

Usage

import RNS  from '@wehmoen/rnsts';

const rns = new RNS();

(async () => {

    console.log("========= Forward Resolution =========")
    const name = "jihoz.ron";
    let result = await rns.getAddress(name)
    console.log(`${name} address: ${result}`);

    console.log("========= Reverse Resolution =========")
    const address = "0xa09a9b6F90AB23fCDcd6c3D087C1dfb65dDdfb05";
    result = await rns.getName(address)
    console.log(`${address} name: ${result}`);

    console.log("========= Batch Forward Resolution =========")
    const names = ["jihoz.ron", "dwi.ron", "wehmoen.ron"];
    let batchAddressResult = await rns.getAddressBatch(names)
    for (const name in batchAddressResult) {
        console.log(`${name} address: ${batchAddressResult[name]}`);
    }

    console.log("========= Batch Reverse Resolution =========")
    const addresses = ["0xa09a9b6F90AB23fCDcd6c3D087C1dfb65dDdfb05", "0x445ba6F9f553872Fa9cDC14F5c0639365b39C140", "0x3759468f9fd589665c8AfFBE52414Ef77F863f72"];
    let batchNameResult = await rns.getNameBatch(addresses)
    for (const address in batchNameResult) {
        console.log(`${address} name: ${batchNameResult[address]}`);
    }
})();
1.0.2

4 months ago

1.0.1

6 months ago

1.0.0

6 months ago