Skip to content

T extends NumberType

Defined in: packages/bitbadgesjs-sdk/src/api-indexer/docs-types/docs.ts:911

Extends

Type Parameters

T

T extends NumberType

Implements

Constructors

Constructor

new AddressListDoc<T>(data): AddressListDoc<T>

Defined in: packages/bitbadgesjs-sdk/src/api-indexer/docs-types/docs.ts:927

Parameters

data

iAddressListDoc<T>

Returns

AddressListDoc<T>

Overrides

AddressList.constructor

Properties

_docId

_docId: string

Defined in: packages/bitbadgesjs-sdk/src/api-indexer/docs-types/docs.ts:912

A unique stringified document ID

Implementation of

iAddressListDoc._docId


_id?

optional _id?: string

Defined in: packages/bitbadgesjs-sdk/src/api-indexer/docs-types/docs.ts:913

A unique document ID (Mongo DB ObjectID)

Implementation of

iAddressListDoc._id


addresses

addresses: string[]

Defined in: packages/bitbadgesjs-sdk/src/api-indexer/docs-types/docs.ts:922

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

Implementation of

iAddressListDoc.addresses

Overrides

AddressList.addresses


createdBlock

createdBlock: T

Defined in: packages/bitbadgesjs-sdk/src/api-indexer/docs-types/docs.ts:917

The block number when this list was created

Implementation of

iAddressListDoc.createdBlock


createdBy

createdBy: string

Defined in: packages/bitbadgesjs-sdk/src/api-indexer/docs-types/docs.ts:914

The BitBadges address of the user who created this list

Implementation of

iAddressListDoc.createdBy

Overrides

AddressList.createdBy


customData

customData: string

Defined in: packages/bitbadgesjs-sdk/src/api-indexer/docs-types/docs.ts:925

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

Implementation of

iAddressListDoc.customData

Overrides

AddressList.customData


lastUpdated

lastUpdated: T

Defined in: packages/bitbadgesjs-sdk/src/api-indexer/docs-types/docs.ts:918

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

Implementation of

iAddressListDoc.lastUpdated


listId

listId: string

Defined in: packages/bitbadgesjs-sdk/src/api-indexer/docs-types/docs.ts:921

The ID of the address list.

Implementation of

iAddressListDoc.listId

Overrides

AddressList.listId


managedBy

managedBy: string

Defined in: packages/bitbadgesjs-sdk/src/api-indexer/docs-types/docs.ts:915

The BitBadges address of the user who is currently managing this

Implementation of

iAddressListDoc.managedBy


nsfw?

optional nsfw?: object

Defined in: packages/bitbadgesjs-sdk/src/api-indexer/docs-types/docs.ts:919

The NSFW reason if this list is NSFW

reason

reason: string

Implementation of

iAddressListDoc.nsfw


reported?

optional reported?: object

Defined in: packages/bitbadgesjs-sdk/src/api-indexer/docs-types/docs.ts:920

The reported reason if this list is reported

reason

reason: string

Implementation of

iAddressListDoc.reported


updateHistory

updateHistory: iUpdateHistory<T>[]

Defined in: packages/bitbadgesjs-sdk/src/api-indexer/docs-types/docs.ts:916

The update history of this list

Implementation of

iAddressListDoc.updateHistory


uri

uri: string

Defined in: packages/bitbadgesjs-sdk/src/api-indexer/docs-types/docs.ts:924

The URI where to fetch the address list metadata from.

Implementation of

iAddressListDoc.uri

Overrides

AddressList.uri


whitelist

whitelist: boolean

Defined in: packages/bitbadgesjs-sdk/src/api-indexer/docs-types/docs.ts:923

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

Implementation of

iAddressListDoc.whitelist

Overrides

AddressList.whitelist

Methods

checkAddress()

checkAddress(address): boolean

Defined in: packages/bitbadgesjs-sdk/src/core/addressLists.ts:44

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

Remarks

The double negative may get confusing.

Inherited from

AddressList.checkAddress


clone()

clone(): AddressListDoc<T>

Defined in: packages/bitbadgesjs-sdk/src/api-indexer/docs-types/docs.ts:953

Deep copies the object and returns a new instance.

Returns

AddressListDoc<T>

Implementation of

CustomType.clone

Overrides

AddressList.clone


convert()

convert<U>(convertFunction, options?): AddressListDoc<U>

Defined in: packages/bitbadgesjs-sdk/src/api-indexer/docs-types/docs.ts:949

Type Parameters

U

U extends NumberType

Parameters

convertFunction

(item) => U

options?

ConvertOptions

Returns

AddressListDoc<U>

Deprecated

This function is unnecessary as this field has no numeric types. Please use the .clone() method instead.

Implementation of

CustomType.convert

Overrides

AddressList.convert


equals()

equals<U>(other, normalizeNumberTypes?): boolean

Defined in: packages/bitbadgesjs-sdk/src/common/base.ts:101

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

U

U extends CustomType<U>

Parameters

other

CustomType<U> | null | undefined

normalizeNumberTypes?

boolean

Returns

boolean

Implementation of

CustomType.equals

Inherited from

AddressList.equals


getNumberFieldNames()

getNumberFieldNames(): string[]

Defined in: packages/bitbadgesjs-sdk/src/api-indexer/docs-types/docs.ts:945

Internal helper method to convert the number fields of the object to a different NumberType equivalent.

Returns

string[]

Implementation of

CustomType.getNumberFieldNames

Overrides

AddressList.getNumberFieldNames


getOverlapDetails()

getOverlapDetails(addressList): [AddressList, AddressList, AddressList]

Defined in: packages/bitbadgesjs-sdk/src/core/addressLists.ts:187

Gets the overlap details for two address lists. Returns [inFirstListButNotSecond, inBothLists, inSecondListButNotFirst].

Parameters

addressList

iAddressList

Returns

[AddressList, AddressList, AddressList]

Inherited from

AddressList.getOverlapDetails


getOverlaps()

getOverlaps(addressList): AddressList

Defined in: packages/bitbadgesjs-sdk/src/core/addressLists.ts:179

Gets the addresses that are in both lists.

Note the returned value can be a whitelist or a blacklist, depending on the input lists. For example, all addresses except Bob (blacklist) overlap or just Bob (whitelist) overlap.

Parameters

addressList

iAddressList

Returns

AddressList

Inherited from

AddressList.getOverlaps


hasNumberFields()

hasNumberFields(): boolean

Defined in: packages/bitbadgesjs-sdk/src/common/base.ts:115

Checks if the object has number fields.

Returns

boolean

Implementation of

CustomType.hasNumberFields

Inherited from

AddressList.hasNumberFields


invert()

invert(): this

Defined in: packages/bitbadgesjs-sdk/src/core/addressLists.ts:61

Inverts the list in-place. Simply done by invert the whitelist property.

Returns

this

Inherited from

AddressList.invert


isEmpty()

isEmpty(): boolean

Defined in: packages/bitbadgesjs-sdk/src/core/addressLists.ts:54

Returns

boolean

Inherited from

AddressList.isEmpty


remove()

remove(addresses): this

Defined in: packages/bitbadgesjs-sdk/src/core/addressLists.ts:80

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

addresses

string | iAddressList

Returns

this

Inherited from

AddressList.remove


toInverted()

toInverted(): AddressList

Defined in: packages/bitbadgesjs-sdk/src/core/addressLists.ts:69

Returns a new list with the addresses inverted.

Returns

AddressList

Inherited from

AddressList.toInverted


toJson()

toJson(): JsonObject

Defined in: packages/bitbadgesjs-sdk/src/common/base.ts:93

Converts the object to a JSON object with all primitive types.

Returns

JsonObject

Implementation of

CustomType.toJson

Inherited from

AddressList.toJson


toJsonString()

toJsonString(): string

Defined in: packages/bitbadgesjs-sdk/src/common/base.ts:97

Converts the object to a JSON string.

Returns

string

Implementation of

CustomType.toJsonString

Inherited from

AddressList.toJsonString


toProto()

toProto(): AddressList

Defined in: packages/bitbadgesjs-sdk/src/core/addressLists.ts:429

Returns

AddressList

Inherited from

AddressList.toProto


toRemoved()

toRemoved(addresses): AddressList

Defined in: packages/bitbadgesjs-sdk/src/core/addressLists.ts:103

Wrapper for remove that returns a new list instead of modifying the current one.

Parameters

addresses

string | iAddressList

Returns

AddressList

Inherited from

AddressList.toRemoved


toUnion()

toUnion(other): AddressList

Defined in: packages/bitbadgesjs-sdk/src/core/addressLists.ts:127

Wrapper for union that returns a new list instead of modifying the current one.

Parameters

other

iAddressList

Returns

AddressList

Inherited from

AddressList.toUnion


union()

union(other): this

Defined in: packages/bitbadgesjs-sdk/src/core/addressLists.ts:117

Computes the union of two address lists in-place. The result contains all addresses that are in either list.

Cases:

  • Whitelist ∪ Whitelist = Whitelist with combined addresses
  • Whitelist ∪ Blacklist = Blacklist with addresses in blacklist that are NOT in whitelist
  • Blacklist ∪ Whitelist = Blacklist with addresses in blacklist that are NOT in whitelist
  • Blacklist ∪ Blacklist = Blacklist with intersection of excluded addresses

Parameters

other

iAddressList

Returns

this

Inherited from

AddressList.union


AllAddresses()

static AllAddresses(): AddressList

Defined in: packages/bitbadgesjs-sdk/src/core/addressLists.ts:196

Returns the reserved 'All' address list.

Returns

AddressList

Inherited from

AddressList.AllAddresses


computeUnion()

static computeUnion(first, second): AddressList

Defined in: packages/bitbadgesjs-sdk/src/core/addressLists.ts:135

Computes the union of two address lists. The result contains all addresses that are in either list.

Parameters

first

iAddressList

second

iAddressList

Returns

AddressList

Inherited from

AddressList.computeUnion


fromJson()

static fromJson(jsonValue, options?): AddressList

Defined in: packages/bitbadgesjs-sdk/src/core/addressLists.ts:433

Parameters

jsonValue

JsonValue

options?

Partial<JsonReadOptions>

Returns

AddressList

Inherited from

AddressList.fromJson


fromJsonString()

static fromJsonString(jsonString, options?): AddressList

Defined in: packages/bitbadgesjs-sdk/src/core/addressLists.ts:437

Parameters

jsonString

string

options?

Partial<JsonReadOptions>

Returns

AddressList

Inherited from

AddressList.fromJsonString


fromProto()

static fromProto(item): AddressList

Defined in: packages/bitbadgesjs-sdk/src/core/addressLists.ts:441

Parameters

item

AddressList

Returns

AddressList

Inherited from

AddressList.fromProto


generateReservedListId()

static generateReservedListId(addressList): string

Defined in: packages/bitbadgesjs-sdk/src/core/addressLists.ts:406

Generates a list ID for a given address list.

Parameters

addressList

iAddressList

The address list to generate the ID for

Returns

string

Inherited from

AddressList.generateReservedListId


getOverlapDetails()

static getOverlapDetails(firstList, secondList): [AddressList, AddressList, AddressList]

Defined in: packages/bitbadgesjs-sdk/src/core/addressLists.ts:286

Gets the overlap details between two address lists. Returns [inFirstButNotSecond, overlaps, inSecondButNotFirst].

Parameters

firstList

iAddressList

secondList

iAddressList

Returns

[AddressList, AddressList, AddressList]

Inherited from

AddressList.getOverlapDetails


getReservedAddressList()

static getReservedAddressList(addressListId): AddressList

Defined in: packages/bitbadgesjs-sdk/src/core/addressLists.ts:303

Returns the address list for a list ID, if it is a reserved ID (i.e. Mint, Manager, All, None, validly formatted address, ...)

Parameters

addressListId

string

Returns

AddressList

Inherited from

AddressList.getReservedAddressList


getReservedTrackerList()

static getReservedTrackerList(trackerListId): AddressList

Defined in: packages/bitbadgesjs-sdk/src/core/addressLists.ts:296

Returns the tracker list for a tracker ID list. Little different logic because tracker ID lists can only be reserved IDs (no storage) and can be nonvalid addresses

Parameters

trackerListId

string

Returns

AddressList

Inherited from

AddressList.getReservedTrackerList


Reserved()

static Reserved(addressListId): AddressList

Defined in: packages/bitbadgesjs-sdk/src/core/addressLists.ts:203

Returns a reserved address list by ID.

Parameters

addressListId

string

Returns

AddressList

Inherited from

AddressList.Reserved

Edit this page on GitHub