@wharfkit/contract - v4.0.2
    Preparing search index...

    Class Table<RowType>

    Represents a table in a smart contract. Provides methods for querying rows in the table.

    TableRow The type of rows in the table.

    Type Parameters

    • RowType = any
    Index
    abi: ABI
    account: Name
    client: APIClient
    debug: boolean = false
    defaultRowLimit: number = 1000
    defaultScope?: TableScopeType
    name: Name
    rowType?: RowType
    tableABI: Table
    • Retrieves all the rows from the table.

      Parameters

      • maxRows: number

        The maximum number of rows to return.

      • params: QueryParams = {}

      Returns TableCursor<RowType>

      Promise resolving to a TableCursor of the table rows.

    • Retrieves the row from the table that matches the given parameters.

      Parameters

      • Optionalvalue: string | TableIndexType

        The value to match against the index.

      • params: QueryParams = {}

      Returns Promise<RowType | undefined>

      Promise resolving to a single table row.

    • Creates a new Table instance from the given parameters.

      Type Parameters

      • RowType = any

      Parameters

      • tableParams: TableParams

        Parameters for the table. The parameters should include:

        • contract: Name of the contract that this table is associated with.
        • name: Name of the table.
        • client: Client object to interact with the network.
        • rowType: (optional) Custom row type.
        • fieldToIndex: (optional) Mapping of fields to their indices.

      Returns Table<RowType>

      A new Table instance.