Skip to content

Batch.ts

This module provides a high-level API for UCS03 Batch instruction construction.

Added in v2.0.0

Signature

export interface Batch extends Inspectable.Inspectable, Pipeable, Iterable<ZkgmInstruction.ZkgmInstruction> {
readonly [TypeId]: TypeId
readonly _tag: "Batch"
readonly instructions: NonEmptyReadonlyArray<ZkgmInstruction.ZkgmInstruction>
readonly opcode: 2
readonly version: 0
}

Source: src/Batch.ts:31

Added in v2.0.0

Signature

export declare const TypeId: typeof TypeId

Source: src/Batch.ts:19

Added in v2.0.0

Signature

export type TypeId = typeof TypeId

Source: src/Batch.ts:25

Added in v2.0.0

Signature

export declare const make: <A extends ZkgmInstruction.ZkgmInstruction>(iterable: Iterable<A>) => Batch

Source: src/Batch.ts:63

Added in v2.0.0

Optimizes a given Batch into a ZkgmInstruction such that the following rules are applied:

  • TokenOrders with zero base amount are removed.
  • TODO: A Batch with a singular TokenOrder is reduced to the given TokenOrder.

Signature

export declare const optimize: (self: Batch) => Batch

Source: src/Batch.ts:84

Added in v2.0.0