Class BitBadgesAddressList<T>

Type Parameters

Hierarchy (View Summary, Expand)

Implements

Constructors

Properties

_docId: string

A unique stringified document ID

_id?: string

A unique document ID (Mongo DB ObjectID)

addresses: string[]

The addresses of the address list. If this is a tracker list, the addresses are the tracker IDs.

aliasAddress?: string

The alias BitBadges address of the address list. Handled internally.

claims: ClaimDetails<T>[]

The linked claims of the address list.

createdBlock: T

The block number when this list was created

createdBy: string

The BitBadges address of the user who created this list

customData: string

Arbitrary custom data that can be stored. Leave blank for no custom data.

lastUpdated: T

The timestamp of when this list was last updated (milliseconds since epoch)

listActivity: ListActivityDoc<T>[]

The activity of the address list.

listId: string

The ID of the address list.

listings?: UtilityListingDoc<T>[]

The listings of the address list.

managedBy: string

The BitBadges address of the user who is currently managing this

metadata?: Metadata<T>

The metadata of the address list.

nsfw?: { reason: string }

The NSFW reason if this list is NSFW

reported?: { reason: string }

The reported reason if this list is reported

updateHistory: iUpdateHistory<T>[]

The update history of this list

uri: string

The URI where to fetch the address list metadata from.

views: {
    [viewId: string]: {
        ids: string[];
        pagination: PaginationInfo;
        type: string;
    };
}

The views of the address list.

whitelist: boolean

Whether or not to include ONLY the addresses or include all EXCEPT the addresses.

Methods

  • Checks if a specific account is in the given address list. This means added to a whitelist or NOT included in a blacklist.

    Parameters

    • address: string

    Returns boolean

    The double negative may get confusing.

  • Compares 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").

    Type Parameters

    Parameters

    • other: undefined | null | CustomType<U>
    • OptionalnormalizeNumberTypes: boolean

    Returns boolean

  • Gets the bookmark for a specific view. This is to be passed into the fetchNextForView method.

    Parameters

    • viewId: string

    Returns string

  • Returns true if the address list is stored off-chain. Off-chain lists are stored in the database and are not part of the blockchain. They are updatable, deletable, and can be used for surveys. On-chain lists are immutable and are created through blockchain transactions.

    Returns boolean

  • Removes addresses from the list in-place.

    If this is a whitelist, the address will be removed (if it is currently added). If this is a blacklist, the address will be added (if it is not currently added). Otherwise, it is a no-op since it is already removed.

    Parameters

    Returns this

  • Returns if the view has more pages to be fetched. If we have reached the end of the view, this will return false.

    Parameters

    • viewId: string

    Returns boolean

  • Fetches and initializes a BitBadgesAddressList from the API. Must pass in a valid BitBadgesApi instance.

    Type Parameters

    Parameters

    • api: BaseBitBadgesApi<T>
    • options: {
          listId: string;
          viewsToFetch?: {
              bookmark: string;
              viewId: string;
              viewType: "listActivity";
          }[];
      }

    Returns Promise<BitBadgesAddressList<T>>

  • Fetches and initializes a batch of BitBadgesAddressList from the API. Must pass in a valid BitBadgesApi instance.

    Type Parameters

    Parameters

    • api: BaseBitBadgesApi<T>
    • options: {
          listId: string;
          viewsToFetch?: {
              bookmark: string;
              viewId: string;
              viewType: "listActivity";
          }[];
      }[]

    Returns Promise<(undefined | BitBadgesAddressList<T>)[]>

MMNEPVFCICPMFPCPTTAAATR