thebigguy-contract
Version:
A library to generate P2SH scripts and create spend transactions for permissionless share-based distribution of UTXOs
25 lines • 1.04 kB
TypeScript
import { Ecc, Tx } from "ecash-lib";
import { type Party } from "./script";
/**
* An unspent coin identifying the transaction, the output position, and its value.
*/
export interface Utxo {
txid: string;
outIdx: number;
value: number;
}
/**
* Generates a valid transaction for any UTXO locked by the expected script.
* The `fee´ and `parties` used to lock the UTXO must be known and provided
* so tha the correct outputs for the transaction can be determined.
*
* @param ecc An instance of `ecash-lib`'s ECC implementation for reusability
* @param prvKey The private key that will be used to sign transactions
* @param utxo The outpoint and value being spent
* @param fee The fee used for the script locking the `utxo´
* @param parties The list of parties used for the script locking the `utxo`
*
* @returns A signed transaction that can be serialized and broadcasted.
*/
export declare function createTx(ecc: Ecc, prvKey: Uint8Array, utxo: Utxo, fee: number, parties: Party[]): Tx;
//# sourceMappingURL=tx.d.ts.map