UNPKG

@xchainjs/xchain-bitcoincash

Version:

Custom bitcoincash client and utilities used by XChainJS clients

38 lines (37 loc) 970 B
/// <reference types="node" /> export type KeyPair = { getAddress(index: number): string; }; export type In = { hash: Buffer; index: number; }; export type Out = { script: Buffer; value: number; }; export type Transaction = { toHex(): string; fromHex(hex: string): Transaction; fromBuffer(buffer: Buffer): Transaction; ins: In[]; outs: Out[]; }; export type TransactionBuilder = { inputs: any[]; addInput(buffer: Buffer, index: number): void; addOutput(script: Buffer, value: number): void; sign(vin: number, keyPair: KeyPair, redeemScript?: Buffer, hashType?: number, witnessValue?: number, witnessScript?: Buffer, signatureAlgorithm?: string): void; build(): Transaction; buildIncomplete(): Transaction; }; export type Network = { messagePrefix: Buffer | string; bip32: { public: Buffer; private: Buffer; }; pubKeyHash: Buffer; scriptHash: Buffer; wif: Buffer; };