Whitelist
Hierarchy
- { root: Field; storage: Storage }
- Whitelist
Index
Constructors
externalconstructor
Properties
root
The root hash of the Merkle tree representing the whitelist.
storage
Off-chain storage information, typically an IPFS hash pointing to the whitelist data.
Methods
getWhitelistedAmount
The function fetches a whitelisted amount associated with a given address using a map and returns it as a UInt64Option.
Parameters
address: PublicKey
The
address
parameter is of typePublicKey
, which represents a public key used in cryptography for various purposes such as encryption, digital signatures, and authentication. In the context of thefetchWhitelistedAmount
function, theaddress
parameter is used to retrieve a whitelisted amount
Returns Promise<UInt64Option>
The
fetchWhitelistedAmount
function returns aPromise
that resolves to aUInt64Option
object. This object contains avalue
property representing the amount retrieved from a map based on the provided address. TheisSome
property indicates whether the value is present or not. The value is not present if the whitelist is NOT empty and the address is NOT whitelisted. The value is present if the whitelist is NOT empty or the address IS whitelisted. The value is present and equals to UInt64.MAXINT() if the whitelist IS empty.
isNone
Returns Bool
isSome
Returns Bool
load
Returns Promise<WhitelistMapOption>
staticcreate
Creates a new whitelist and pins it to IPFS.
Parameters
params: { attempts?: number; auth?: string; keyvalues?: { key: string; value: string }[]; list: WhitelistedAddress[] | { address: string; amount?: number }[]; name?: string; timeout?: number }
The parameters for creating the whitelist.
optionalattempts: number
optionalauth: string
optionalkeyvalues: { key: string; value: string }[]
list: WhitelistedAddress[] | { address: string; amount?: number }[]
optionalname: string
optionaltimeout: number
Returns Promise<Whitelist>
A new
Whitelist
instance.
staticempty
Returns Whitelist
The root hash of the Merkle tree representing the whitelist.