Skip to main content

Module tx_interfaces

Module tx_interfaces 

Source
Expand description

Port of @midnight-ntwrk/midnight-js-contracts/src/tx-interfaces.ts.

Factories that bind a specific deployed contract to the providers bundle and expose ergonomic call / maintenance entry points.

§Shape differences from TS

The TS ContractCallsInterface<C> is a mapped type keyed by circuit id, where each value is a typed variadic closure. Rust’s generic system can’t express “function type that depends on a key in a struct-level map”, so the Rust port uses an explicit call(circuit_id, args) method on ContractCalls. Semantically equivalent — slightly more explicit at the call site.

Maintenance interfaces are a 1:1 port.

Structs§

CallOptions
Per-call options for ContractCalls::call. Bundles the chain-derived time + network id + optional dust-fee balancing + optional private-state plumbing into a single struct so the method signature stays readable.
CircuitMaintenanceTx
Port of TS CircuitMaintenanceTxInterface.
CircuitMaintenanceTxInterfaces
A set of CircuitMaintenanceTx instances keyed by circuit id. Port of TS CircuitMaintenanceTxInterfaces<C>.
ContractCalls
A contract-specific wrapper around the call-tx pipeline.
ContractMaintenanceTx
Port of TS ContractMaintenanceTxInterface. One operation: replaceAuthority(newAuthority).
MaintenanceOptions
Per-call options for maintenance methods on CircuitMaintenanceTx and ContractMaintenanceTx. Bundles the chain-derived time + network id + optional dust-fee balancing. Keeps the method signatures readable.