interface StorageProvider {
    getBigMapKey<T>(contract: string, key: string, schema?: unknown): Promise<T>;
    getBigMapKeyByID<T>(id: string, keyToEncode: BigMapKeyType, schema: Schema, block?: number): Promise<T>;
    getBigMapKeysByID<T>(id: string, keysToEncode: BigMapKeyType[], schema: Schema, block?: number, batchSize?: number): Promise<MichelsonMap<MichelsonMapKey, undefined | T>>;
    getSaplingDiffByID(id: string, block?: number): Promise<SaplingDiffResponse>;
    getStorage<T>(contract: string, schema?: unknown): Promise<T>;
}

Hierarchy (view full)

Methods

  • Type Parameters

    • T

    Parameters

    • id: string

      Big Map ID

    • keysToEncode: BigMapKeyType[]

      Array of keys to query (will be encoded properly according to the schema)

    • schema: Schema

      Big Map schema (can be determined using your contract type)

    • Optionalblock: number

      optional block level to fetch the values from

    • OptionalbatchSize: number

      optional batch size representing the number of requests to execute in parallel

    Returns Promise<MichelsonMap<MichelsonMapKey, undefined | T>>

    An object containing the keys queried in the big map and their value in a well-formatted JSON object format

    Fetch multiple values in a big map

  • Parameters

    • id: string

      Sapling state ID

    • Optionalblock: number

      optional block level to fetch the value from

    Returns Promise<SaplingDiffResponse>

    Return a well formatted json object of a sapling state