Whitelist
Hierarchy
- any
- Whitelist
Index
Constructors
Methods
Constructors
constructor
Returns Whitelist
Methods
getWhitelistedAmount
Parameters
address: PublicKey
The
address
parameter is of typePublicKey
, used to retrieve a whitelisted amount for the given address.name: string = "whitelist"
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<OffchainMapOption>
toString
Returns string
staticcreate
Creates a new whitelist and pins it to IPFS.
Parameters
params: { attempts?: number; auth?: string; filename?: string; json?: OffchainMapSerialized; keyvalues?: object; list: WhitelistedAddress[]; name?: string; pin?: boolean; timeout?: number }
The parameters for creating the whitelist.
optionalattempts: number
optionalauth: string
optionalfilename: string
optionaljson: OffchainMapSerialized
optionalkeyvalues: object
list: WhitelistedAddress[]
optionalname: string
optionalpin: boolean
optionaltimeout: number
Returns Promise<{ json: OffchainMapSerialized; whitelist: Whitelist }>
A new
Whitelist
instance.
staticempty
Returns Whitelist
staticfromString
Parameters
str: string
Returns Whitelist
The function fetches a whitelisted amount associated with a given address using a map and returns it as a UInt64Option.