Docs of Communities ID
WebsiteTwitterDiscord
  • What is Communities ID
  • DID as a Service
    • Omni DID
    • Bridge DID
    • Soulbound DID
  • Why "DID as a Service"?
  • How to start?
    • For project owners
    • For regular users
  • Terminology
  • Pricing & Business Model
    • Business Model
    • Pricing Policy
  • Frequently Asked Questions
  • -BRAND GUIDE-
    • Community Settings
    • Mint Settings
      • Mint Mode
      • Pricing
      • Base URL (PFP)
    • Renewal & Expiration
  • -USER GUIDE-
    • Mint
    • Burn
    • Renewal & Expiration
    • Set as Primary
    • Soulbound
  • -Developers-
    • SDK
      • Overview
        • Install & Initialize
        • Search Brand/User
        • Resolving Name
        • Modify User DID
      • API reference
        • Collector
        • Resolver
        • Operator
  • - Legal -
    • Privacy Policy
    • Terms of Service
Powered by GitBook
On this page
  1. -Developers-
  2. SDK
  3. API reference

Collector

PreviousAPI referenceNextResolver

Last updated 1 year ago

Get the brand DID info by name

Input:

Name
Type
Description
required

name

string

The name of the brand DID

true

Output: Promise<BrandDID | null>

Example:

const res = await collector.searchBrandDID('did')

Get the brand DID info by name

Input:

Name
Type
Description
required

tokenId

number

The token ID of this brand DID

true

chainId

SupportedChainIds

The chain ID that that this brand DID is on

true

Output: Promise<BrandDID | null>

Example:

const res = await collector.searchBrandDIDByTokenId(1, 80001)

Get the user DID info by name

Input:

Name
Type
Description
required

name

string

The name of the user DID, the format should be ${userDID}.${brandDID}

true

Output: Promise<UserDID | null>

Example:

const res = await collector.searchUserDID('a.did')

Get the brand DID info by name

Input:

Name
Type
Description
required

registry

string

The registry address of this user DID

true

tokenId

number

The token ID of this brand DID

true

chainId

SupportedChainIds

The chain ID that that this brand DID is on

true

Output: Promise<UserDID | null>

Example:

const res = await collector.searchUserDIDByTokenId('0x123...', 1, 80001)

Get all brand DID in specific chain, if you call this on mainnet, opensea Key is required

Input:

Name
Type
Description
required

chainId

SupportedChainIds

The chain ID that you want to get brand DIDs

true

Output: Promise<object[]>

Example:

const res = await collector.getAllBrandDIDs(5)

Get all brand DIDs owned by an address in specific chain, if you call this on mainnet, opensea Key is required

Input:

Name
Type
Description
required

address

string

The address you want to get brand DIDs

true

chainId

SupportedChainIds

The chain ID that you want to get brand DIDs

true

Output: Promise<object[]>

Example:

const res = await collector.getAllBrandDIDsOwnedByAddress('0x0000000000000000000000000000000000000000', 5)

Get all user DIDs owned by an address in specific chain, if you call this on mainnet, opensea Key is required

Input:

Name
Type
Description
required

address

string

The address you want to get user DIDs

true

chainId

SupportedChainIds

The chain ID that you want to get brand DIDs

true

Output: Promise<object[]>

Example:

const res = await collector.getAllUserDIDsOwnedByAddress('0x0000000000000000000000000000000000000000', 5)

Get all brand DIDs joined by an address in specific chain, if you call this on mainnet, opensea Key is required

Input:

Name
Type
Description
required

address

string

The address you want to get brand DIDs

true

chainId

SupportedChainIds

The chain ID that you want to get brand DIDs

true

Output: Promise<object[]>

Example:

const res = await collector.getAllBrandDIDsJoinedByAddress('0x0000000000000000000000000000000000000000', 5)

Get all user DIDs under specific brand DID, if you call this on mainnet, opensea Key is required

Input:

Name
Type
Description
required

name

string

The name of the brand DID, if registry and chain is provided, the name will be ignored, and the query efficiency will improve

true

registry

string

The registry of this brand DID

false

chainId

SupportedChainIds

The chain ID that you want to get brand DIDs

false

Output: Promise<object[]>

Example:

const res = await collector.getAllUserDIDsOwnedByBrand('did')
const res = await collector.getAllUserDIDsOwnedByBrand('', '0x123', 5)

Get all user DIDs owned by specific address under specific brand DID

Input:

Name
Type
Description
required

address

string

he address you want to get user DIDs

true

name

string

The name of the brand DID, if registry and chain is provided, the name will be ignored, and the query efficiency will improve

true

registry

string

The registry of this brand DID

false

chainId

SupportedChainIds

The chain ID that you want to get brand DIDs

false

Output: Promise<object[]>

Example:

const res = await collector.getAllUserDIDsOfOneWalletInOneBrand('0x123', 'did')
const res = await collector.getAllUserDIDsOfOneWalletInOneBrand('0x123', '', '0x123', 5)

collector.searchBrandDID
collector.searchBrandDIDByTokenId
collector.searchUserDID
collector.searchUserDIDByTokenId
collector.getAllBrandDIDs
collector.getAllBrandDIDsOwnedByAddress
collector.getAllUserDIDsOwnedByAddress
collector.getAllBrandDIDsJoinedByAddress
collector.getAllUserDIDsOwnedByBrand
collector.getAllUserDIDsOfOneWalletInOneBrand