Class AddressListDoc<T>

Type Parameters

Hierarchy (view full)

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.

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 on-chain.

lastUpdated: T

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

listId: string

The ID of the address list.

nsfw?: {
    reason: string;
}

The NSFW reason if this list is NSFW

private?: boolean

True if this list is private and will not show up in search results

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.

viewableWithLink?: boolean

True if this list is viewable if queried by the list ID directly

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

  • 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