Skip to main content

Whitelist

Hierarchy

  • { root: Field; storage: Storage }
    • Whitelist

Index

Constructors

externalconstructor

  • Parameters

    • externalvalue: { root: Field; storage: Storage }
      • externalroot: Field = Field

        The root hash of the Merkle tree representing the whitelist.

      • externalstorage: Storage = Storage

        Off-chain storage information, typically an IPFS hash pointing to the whitelist data.

    Returns Whitelist

Properties

root

root: Field = Field

The root hash of the Merkle tree representing the whitelist.

storage

storage: Storage = Storage

Off-chain storage information, typically an IPFS hash pointing to the whitelist data.

Methods

getWhitelistedAmount

  • getWhitelistedAmount(address: PublicKey): Promise<UInt64Option>
  • 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 type PublicKey, which represents a public key used in cryptography for various purposes such as encryption, digital signatures, and authentication. In the context of the fetchWhitelistedAmount function, the address parameter is used to retrieve a whitelisted amount

    Returns Promise<UInt64Option>

    The fetchWhitelistedAmount function returns a Promise that resolves to a UInt64Option object. This object contains a value property representing the amount retrieved from a map based on the provided address. The isSome 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

  • isNone(): Bool
  • Returns Bool

isSome

  • isSome(): Bool
  • Returns Bool

load

staticcreate

  • create(params: { attempts?: number; auth?: string; keyvalues?: { key: string; value: string }[]; list: WhitelistedAddress[] | { address: string; amount?: number }[]; name?: string; timeout?: number }): Promise<Whitelist>
  • 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