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
40 lines (39 loc) • 1.53 kB
TypeScript
import type { UtxoExplorer } from '../../../Explorer/UtxoExplorer';
import type { UtxoNetworkParams } from '../../../ChainGate/networks/types';
import { BaseUtxoTransaction } from '../BaseUtxoTransaction';
import type { Txo, UtxoFee, UtxoFeeTier, UtxoRecommendedFee, UtxoRecommendedFees } from '../BaseUtxoTransaction';
export type BchFee = UtxoFee;
export type BchFeeTier = UtxoFeeTier;
export type BchRecommendedFee = UtxoRecommendedFee;
export type BchRecommendedFees = UtxoRecommendedFees;
/**
* An unsigned Bitcoin Cash transaction prepared by {@link BchConnector.transfer}.
*
* @example
* ```ts
* const amount = cg.networks.bitcoincash.amount('0.01');
* const tx = await bch.transfer(amount, 'bitcoincash:qq...');
* const fees = tx.recommendedFees();
* tx.setFee(fees.high);
* const broadcasted = await tx.signAndBroadcast();
* ```
*/
export declare class BchTransaction extends BaseUtxoTransaction {
/**
* Creates a BCH transaction, converting addresses to legacy for UTXO selection.
* @internal
*/
static create(params: {
explorer: UtxoExplorer;
fromAddress: string;
toAddress: string;
valueSat: bigint;
networkParams: UtxoNetworkParams;
getPrivateKey: () => Promise<Uint8Array>;
}): Promise<BchTransaction>;
/** Signs the transaction and returns the serialized raw bytes. */
protected signTransaction(inputs: Txo[], outputs: Array<{
address: string;
amount: bigint;
}>, privateKey: Uint8Array): Uint8Array;
}