UNPKG

chaingate

Version:

Multi-chain cryptocurrency SDK for TypeScript — unified API for Bitcoin, Ethereum, Litecoin, Dogecoin, Bitcoin Cash, Polygon, Arbitrum, and any EVM-compatible chain. Create wallets, query balances, send transactions, and manage tokens and NFTs across UTXO

34 lines (33 loc) 1.1 kB
/** * Bitcoin Cash transaction signing and address derivation. * @internal */ import type { UtxoNetworkParams } from '../../../ChainGate/networks/types'; /** * Derives the 20-byte public key hash from a compressed public key. * * @param publicKey - Compressed (33-byte) public key. */ export declare function publicKeyToHash160(publicKey: Uint8Array): Uint8Array; /** A single UTXO input for BCH transaction signing. */ export interface BchInput { txid: string; n: number; script: Uint8Array; amount: bigint; } /** A single output for BCH transaction signing. */ export interface BchOutput { address: string; amount: bigint; } /** * Signs a Bitcoin Cash transaction. * * @param inputs - UTXOs to spend. * @param outputs - Destinations and amounts. * @param privateKey - 32-byte private key. * @param networkParams - Network parameters for address decoding. * @returns Serialized raw transaction bytes. */ export declare function signBchTransaction(inputs: BchInput[], outputs: BchOutput[], privateKey: Uint8Array, networkParams: UtxoNetworkParams): Uint8Array;