A unique stringified document ID
Optional_A unique document ID (Mongo DB ObjectID)
The account number of the account. This is the account number registered on the BitBadges blockchain.
A list of transfer activity items for the account. Paginated and fetched as needed. To be used in conjunction with views.
The native address of the account
OptionalaffiliateAffiliate code
OptionalairdroppedIndicates whether the account has claimed their airdrop.
OptionalaliasFor advanced cases where you want a custom address or account for a collection or list. We map it to an account.
Experimental - For example, if you want to send a badge to a collection, you can transfer it to the alias account.
A list of approvals tracker activity items for the account. Paginated and fetched as needed. To be used in conjunction with views.
OptionalavatarThe avatar of the account.
OptionalbalancesThe BADGE balance of the account and other sdk.coin balances
OptionalbannerThe banner image URL of the account
The BitBadges address of the account
OptionalblueskyThe Bluesky username of the account
The Bitcoin address of the account
The chain of the account.
A list of merkle challenge activity items for the account. Paginated and fetched as needed. To be used in conjunction with views.
OptionalclaimA list of claim activity items for the account. Paginated and fetched as needed. To be used in conjunction with views.
A list of tokens that the account has collected. Paginated and fetched as needed. To be used in conjunction with views.
OptionalcreatedThe timestamp of when this account was created (milliseconds since epoch)
OptionalcreatorThe credits for the account.
OptionalcustomThe custom links of the account
OptionaldiscordThe Discord username of the account
The Eth address of the account
OptionalfetchedWhether we have already fetched the profile or not
OptionalgithubThe GitHub username of the account
OptionalhiddenThe hidden badges of the account
OptionallatestThe latest chain the user signed in with
OptionalnotificationsThe notifications of the account
OptionalnsfwIndicates whether the account is NSFW.
OptionalpointsA list of points activity items for the account. Paginated and fetched as needed. To be used in conjunction with views.
OptionalprofileThe profile picture URL of the account
The public key type of the account
The public key of the account
OptionalpublicPublic social connections stored for the account
OptionalreadmeThe readme of the account
OptionalreportedIndicates whether the account has been reported.
OptionalresolvedThe resolved name of the account (e.g. ENS name).
OptionalseenThe timestamp of the last activity seen for this account (milliseconds since epoch)
OptionalsequenceThe sequence of the account. This is the nonce for the blockchain for this account
A list of SIWBB requests for the account. Paginated and fetched as needed. To be used in conjunction with views.
OptionalsocialSocial connections stored for the account
The Solana address of the account. Note: This may be empty if we do not have it yet. Solana -> BitBadges address conversions are one-way, and we cannot convert a BitBadges address to a Solana address without prior knowledge.
OptionaltelegramThe Telegram username of the account
The Thorchain address of the account
OptionaltwitterThe Twitter username of the account
OptionalusernameThe username of the account
The views for this collection and their pagination Doc. Views will only include the doc _ids. Use the pagination to fetch more. For example, if you want to fetch the activity for a view, you would use the view's pagination to fetch the doc _ids, then use the corresponding activity array to find the matching docs.
Deep copies the object and returns a new instance.
Converts the object to a different NumberType equivalent.
Optionaloptions: ConvertOptionsCompares this object's fields to another object's fields for equality. Equality is determined by comparing the JSON representations of the objects.
If normalizeNumberTypes is true, then all number types will be compared as strings (i.e. "1n" === "1" === 1). Else, they will be compared as their native types (i.e. 1n !== 1 !== "1").
OptionalnormalizeNumberTypes: booleanFetches until the view has no more items. 1 second delay between each fetch for rate limiting.
Fetch the user's information via an API request and updates the current BitBadgesUserInfo object. This will handle all paginations, etc. behind the scenes.
Optionalforceful: booleanFetch balances for a collection and updates the user's collected array. Must pass in a valid API instance. If forceful is true, it will fetch regardless of if it is already fetched. Else, it will only fetch if it is not already cached.
Optionalforceful: booleanFetches the next page of a view for a user. If view has no more items, it will do nothing.
OptionalspecificCollections: BatchTokenDetails<NumberType>[]OptionaloldestFirst: booleanOptionalstandard: stringGets the balance doc for a user by address.
This returns the cached data if it exists. If you want to fetch, use fetchBalances.
Fetch balances for a collection and updates the user's collected array. Must pass in a valid API instance.
Internal helper method to convert the number fields of the object to a different NumberType equivalent.
Type agnostic get view function. Uses the viewType to determine the type of view to fetch and docs to return.
Checks if the object has number fields.
Returns if a get account request body is redundant for this user (meaning we have everything already).
Wrapper for getBalanceInfo that throws if not fetched yet.
Gets the balances for a user by address. Throws if not fetched yet. To fetch, use fetchBalances.
Wrapper for getBalances that throws if not fetched yet.
Prunes the request body to remove any redundant fetches.
Converts the object to a JSON object with all primitive types.
Converts the object to a JSON string.
Logic for updating the current BitBadgesUserInfo object with a new API response. If forceful is true, it will overwrite everything.
Optionalforceful: booleanStaticBlankReturns a BitBadgesUserInfo object with all fields set to blank.
StaticFetchFetches the user's information from the API and initializes a new BitBadgesUserInfo object.
StaticFetchFetches users' information from the API and initializes a new BitBadgesUserInfo object for each.
StaticGetGets an account by address or username from the API.
StaticGetGets accounts by address or username from the API.
StaticMintReturns a BitBadgesUserInfo object with all fields set for the Mint address.
BitBadgesUserInfo is the type for accounts returned by the BitBadges API. It includes all Docrmation about an account.
Remarks
Note that returned user Docs will only fetch what is requested. It is your responsibility to join the data together (paginations, etc). See documentation for helper functions, examples, and tutorials on handling this data and paginations.