SpaceID&Dotbit
2831a9a6cf814bee8fd043f3488e0d2f
SpaceID
安装
yarn add @siddomains/sidjs
使用方法
import SIDfunctions from '@siddomains/sidjs';
const SID = SIDfunctions.default;
const provider = new ethers.providers.JsonRpcProvider(rpcUrls);
try {
const sid = new SID({ provider, sidAddress: SIDfunctions.getSidAddress('56') });
const sname = await sid.getName(Address).catch(err => console.log(err));
this.spaceName = sname?.name ? `${sname?.name}` : Address;
} catch (error) {
// console.log('sid...', error);
}
PS:
- Address : 用户的地址
- provider: JsonRpcProvider
- rpcUrls: https://bsc-dataseed1.ninicoin.io
- 56: BNB正式网 97: BNB测试网
dotbit
安装
yarn add dotbit
使用方法
import { createInstance } from 'dotbit';
const dotbit = createInstance();
try {
const account = await dotbit.reverse({
key: Address
});
this.spaceName = account?.account ? account?.account : Address;
} catch (error) {
// console.log('dot...', error);
}
- SpaceID
- 安装
- 使用方法
- dotbit
- 安装
- 使用方法