Class: AddressListDoc<T>
T extends NumberType
Defined in: packages/bitbadgesjs-sdk/src/api-indexer/docs-types/docs.ts:911
Extends
Type Parameters
T
T extends NumberType
Implements
iAddressListDoc<T>CustomType<AddressListDoc<T>>
Constructors
Constructor
new AddressListDoc<
T>(data):AddressListDoc<T>
Defined in: packages/bitbadgesjs-sdk/src/api-indexer/docs-types/docs.ts:927
Parameters
data
Returns
AddressListDoc<T>
Overrides
Properties
_docId
_docId:
string
Defined in: packages/bitbadgesjs-sdk/src/api-indexer/docs-types/docs.ts:912
A unique stringified document ID
Implementation of
_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
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
Overrides
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
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
Overrides
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
Overrides
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
listId
listId:
string
Defined in: packages/bitbadgesjs-sdk/src/api-indexer/docs-types/docs.ts:921
The ID of the address list.
Implementation of
Overrides
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
nsfw?
optionalnsfw?: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
reported?
optionalreported?: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
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
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
Overrides
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
Overrides
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
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
Overrides
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?
Returns
AddressListDoc<U>
Deprecated
This function is unnecessary as this field has no numeric types.
Please use the .clone() method instead.
Implementation of
Overrides
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
Inherited from
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
Returns
[AddressList, AddressList, AddressList]
Inherited from
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
Returns
Inherited from
hasNumberFields()
hasNumberFields():
boolean
Defined in: packages/bitbadgesjs-sdk/src/common/base.ts:115
Checks if the object has number fields.
Returns
boolean
Implementation of
Inherited from
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
isEmpty()
isEmpty():
boolean
Defined in: packages/bitbadgesjs-sdk/src/core/addressLists.ts:54
Returns
boolean
Inherited from
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
toInverted()
toInverted():
AddressList
Defined in: packages/bitbadgesjs-sdk/src/core/addressLists.ts:69
Returns a new list with the addresses inverted.
Returns
Inherited from
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
Inherited from
toJsonString()
toJsonString():
string
Defined in: packages/bitbadgesjs-sdk/src/common/base.ts:97
Converts the object to a JSON string.
Returns
string
Implementation of
Inherited from
toProto()
toProto():
AddressList
Defined in: packages/bitbadgesjs-sdk/src/core/addressLists.ts:429
Returns
AddressList
Inherited from
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
Inherited from
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
Returns
Inherited from
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
Returns
this
Inherited from
AllAddresses()
staticAllAddresses():AddressList
Defined in: packages/bitbadgesjs-sdk/src/core/addressLists.ts:196
Returns the reserved 'All' address list.
Returns
Inherited from
computeUnion()
staticcomputeUnion(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
second
Returns
Inherited from
fromJson()
staticfromJson(jsonValue,options?):AddressList
Defined in: packages/bitbadgesjs-sdk/src/core/addressLists.ts:433
Parameters
jsonValue
JsonValue
options?
Partial<JsonReadOptions>
Returns
Inherited from
fromJsonString()
staticfromJsonString(jsonString,options?):AddressList
Defined in: packages/bitbadgesjs-sdk/src/core/addressLists.ts:437
Parameters
jsonString
string
options?
Partial<JsonReadOptions>
Returns
Inherited from
fromProto()
staticfromProto(item):AddressList
Defined in: packages/bitbadgesjs-sdk/src/core/addressLists.ts:441
Parameters
item
AddressList
Returns
Inherited from
generateReservedListId()
staticgenerateReservedListId(addressList):string
Defined in: packages/bitbadgesjs-sdk/src/core/addressLists.ts:406
Generates a list ID for a given address list.
Parameters
addressList
The address list to generate the ID for
Returns
string
Inherited from
AddressList.generateReservedListId
getOverlapDetails()
staticgetOverlapDetails(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
secondList
Returns
[AddressList, AddressList, AddressList]
Inherited from
getReservedAddressList()
staticgetReservedAddressList(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
Inherited from
AddressList.getReservedAddressList
getReservedTrackerList()
staticgetReservedTrackerList(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
Inherited from
AddressList.getReservedTrackerList
Reserved()
staticReserved(addressListId):AddressList
Defined in: packages/bitbadgesjs-sdk/src/core/addressLists.ts:203
Returns a reserved address list by ID.
Parameters
addressListId
string