0.0.1 • Published 11 months ago

@communitiesid/indexer v0.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
11 months ago

Communities ID Indexer

Install

npm i @communitiesid/indexer

Usage

Initialze

import CommunitiesIDIndexer from '@communitiesid/indexer';

const indexer = new CommunitiesIDIndexer({ RPCUrls: RPC_URLS, ensChainId: 1 });

CommunitiesIDIndexer

community

Return the community with specific name

Input:

NameTypeDescriptionrequired
namestringThe name of communitytrue

Output:

  • Community - the community object

Example:

await indexer.community('did')

getName

Reverse resolution of an address to an identity name

Input:

NameTypeDescriptionrequireddefault
addressstringThe address of the identitytrue
chainIdnumberThe chain id that the identity is onfalse80001

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:

NameTypeDescriptionrequired
namestringThe name of identitytrue

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

11 months ago