@xuxinlai2002/pns-js
Version:
A NPM package in Typescript for .Play Name Service
17 lines (11 loc) • 443 B
text/typescript
import { getNames ,getAddress} from "../src";
const testAddress = "0x36cb680f411a6471947a491271fcc0741176b561";
test("get names from address",async () => {
const names = await getNames(testAddress);
expect(names[0]).toBe("carv-id.play");
expect(names[1]).toBe("qxdz888888888.play");
});
test("get address from name",async () => {
const address = await getAddress("carv-id");
expect(address.toLowerCase()).toBe(testAddress);
});