Skip to main content

Whitelist

Hierarchy

  • any
    • Whitelist

Index

Constructors

constructor

  • Returns Whitelist

Methods

getWhitelistedAmount

  • getWhitelistedAmount(address: PublicKey, name?: string): 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, used to retrieve a whitelisted amount for the given address.

    • name: string = "whitelist"

    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

toString

  • toString(): string
  • 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

staticfromString