Warn

Our current smart contract abstraction feature is currently in preview. Its API is not final, and it may not cover every use case (yet). We will greatly appreciate any feedback on this feature.

Constructors

Properties

[schemaTypeSymbol]: boolean = true
val: MichelsonV1Expression

Methods

  • Parameters

    Returns {
        key: {
            [key: string]: string | object[];
        };
        type: {
            args?: object[];
            prim: string;
        };
    }

    • key: {
          [key: string]: string | object[];
      }
      • [key: string]: string | object[]
    • type: {
          args?: object[];
          prim: string;
      }
      • Optional args?: object[]
      • prim: string
  • Type Parameters

    • T extends MichelsonV1Expression

    Parameters

    • storage: any

      storage to parse to find the value

    • valueType: any

      type of value to look for

    Returns undefined | T

    The first value found that match the type or undefined if no value is found

    Description

    Look up in top-level pairs of the storage to find a value matching the specified type

  • Parameters

    • tokenToFind: string

      string representing the prim property of the token to find

    Returns Token[]

    an array of tokens of the specified kind or an empty array if no token was found

    Description

    Look up the schema to find any occurrence of a particular token.

    Example

    Useful to find all global constants in a script, an array of GlobalConstantToken is returned:

    const schema = new Schema(script);
    const allGlobalConstantTokens = schema.findToken('constant');

Generated using TypeDoc