Helper function to convert an address to a locking script hex string prefixed with the PUSH opcode required to push the lock script
Calculate the total required satoshis to pay for a contract funding, including potential settlement service fees and miner fees. For miner fee calculation it is assumed that the transaction contains 2 P2PKH inputs.
Calculate the final funding satoshis required by a taker in a maker-taker scenario where taker is assumed to be paying all contract related fees.
Calculate the size of the passed transaction in bytes
Constructs the required outputs for a funding transaction, including fee output if fee information is provided.
Create a Libauth Output object from an address and amount.
Convert a "UTXO" object to a Libauth "Input" object (with value preserved).
Decode a P2PKH unlocking bytecode into the corresponding signature and public key.
Encode a public key and signature into unlocking bytecode for a P2PKH locking bytecode.
Estimate the transaction size of a dummy transaction in bytes, disregarding inputs
Generate a signing serialization based on the provided transaction / input related parameters.
Deterministically generate a partial transaction from a funding proposal.
Merge the inputs of transaction 2 into transaction 1.
Sign an unsigned transaction using the provided private key WIF, skipping inputs that are already signed.
Validates analytical constraints on the high liquidation price in the context of a full contract lifecycle.
Validates minimum integer division precision, which is used in various contract calculations. Precision is defined in the context of integer division when the remainder portion (mod) is discarded. Precision is fine when the relative distance between numbers is large, e.g. (1_000_000 / 7 = 142857 vs. 142857.142). However, calculations become imprecise when the relative distance is small, e.g. (10 / 7 = 1 vs. 1.429, almost 50% error).
Validates analytical constraints on the low liquidation price in the context of a full contract lifecycle.
Validates analytical constraints on the compound nominal value x satoshis per bch in the context of a full contract lifecycle.
Validates analytical constraints of payout satoshis in the context of a full contract lifecycle.
||authentication token used to authenticate network requests to the settlement service|
||string denoting which AnyHedge contract version to use.|
||fully qualified domain name for the settlement service provider.|
||network port number for the settlement service provider.|
||'http' | 'https'||
||network scheme for the settlement service provider, either 'http' or 'https'.|
||electrum cluster to use in BCH network operations.|
||network provider to use for BCH network operations.|
Constructor parameters for setting up an anyhedge manager.
||string||name or identifier for the fee in form presentable to an end-user.|
||string||description explaining the fee in form presentable to an end-user.|
||string||bitcoin cash address where service fees are to be paid.|
||number||how many satoshis are required to be paid as service fee.|
Information about service fees.