Compact runtime API
@midnight-ntwrk/compact-runtime v0.7.0 • Readme | API
Compact runtime library
This API provides runtime primitives used by Compact's TypeScript output, both
for use by the compiler output directly, and to utilise it or reproduce its
behaviour. This API re-exports a number of items from
@midnight-ntwrk/onchain-runtime
, and wraps others in a more TypeScript-friendly
API. Key parts of the API are:
- setNetworkId, required to ensure the right network is being targeted
- CircuitContext, and CircuitResults part of the input and output definition of all circuits
- WitnessContext, part of the input definition of all circuits
- Built-in functions:
- Hashing/commitment
- Elliptic curve
- ContractState, encapsulating the entirety of a smart contract's on-chain state
- StateValue, encoding data a contract maintains on-chain
- QueryContext, providing an annotated view into the contract state, against which on-chain VM programs can be run
- CompactType, providing a runtime representation of basic Compact datatypes
- Various TypeScript types matching same-named Compact types