Create and register a new contract.
Contract parameters
The created contract
Delete a contract.
Contract script
Dispose of the ContractManager and release all resources.
Stops the watcher, clears callbacks, and marks the manager as uninitialized.
Implements the disposable pattern for cleanup.
Get all possible spending paths for a contract.
Returns an empty array if the contract or its handler cannot be found.
Get contracts with optional filters.
Optionalfilter: ContractFilterOptional filter criteria
Filtered contracts TODO: filter spent/unspent
List contracts and include their current VTXOs.
If no filter is provided, returns all contracts with their VTXOs.
Optionalfilter: ContractFilterGet currently spendable paths for a contract.
Options for getting spendable paths
Check if currently watching.
Register a callback for contract events.
The manager automatically watches after initialize(). This method
allows registering callbacks to receive events.
Event callback
Unsubscribe function to remove this callback
Update a contract's params. This method preserves existing params by merging the provided values.
Contract script
The new values to merge with existing params
StaticcreateStatic factory method for creating a new ContractManager. Initialize the manager by loading persisted contracts and starting to watch.
After initialization, the manager automatically watches all active contracts
and contracts with VTXOs. Use onContractEvent() to register event callbacks.
ContractManagerConfig
Central manager for contract lifecycle and operations.
The ContractManager orchestrates:
Example