0.0.1 • Published 3 years ago
@communitiesid/indexer v0.0.1
Communities ID Indexer
Install
npm i @communitiesid/indexerUsage
Initialze
import CommunitiesIDIndexer from '@communitiesid/indexer';
const indexer = new CommunitiesIDIndexer({ RPCUrls: RPC_URLS, ensChainId: 1 });CommunitiesIDIndexer
community
Return the community with specific name
Input:
| Name | Type | Description | required |
|---|---|---|---|
| name | string | The name of community | true |
Output:
Community- the community object
Example:
await indexer.community('did')getName
Reverse resolution of an address to an identity name
Input:
| Name | Type | Description | required | default |
|---|---|---|---|---|
| address | string | The address of the identity | true | |
| chainId | number | The chain id that the identity is on | false | 80001 |
Output:
{name: string}- the primary identity of given address
Example:
await indexer.getName('0xb389b8cAaEDCD0231780a30E5b6AEc6b6CEb970F')name
Get the identity by name, if the name is xxx.eth, it will return the ENS identity
Input:
| Name | Type | Description | required |
|---|---|---|---|
| name | string | The name of identity | true |
Output:
IdentityInfo- the info of identity
Example:
await indexer.name('rain.did')Methods in Community
const community = await indexer.community('did')
await community.getAddress()
await community.getOwner()
await community.getMetaData()
await community.getTokenUri()
await community.getPriceModel()
await community.getConfig()Methods in Identity
const community = await indexer.name('rain.did')
await community.getAddress()
await community.getOwner()
await community.getMetaData()
await community.getTokenUri()0.0.1
3 years ago