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
47 lines (46 loc) • 2.18 kB
TypeScript
import type { MarketsResponse } from '../../Client';
import type { TTLCache } from '../../utils/TTLCache';
import { NetworkDescriptor } from './NetworkDescriptor';
import type { NetworkInfoInternal, UtxoNetworkParams, BchAddressType } from './types';
/** A {@link NetworkDescriptor} for Bitcoin Cash specifically. */
export declare class BchNetworkDescriptor extends NetworkDescriptor<BchAddressType> {
readonly id: 'bitcoincash';
readonly networkParams: UtxoNetworkParams;
/** @internal */
constructor(info: NetworkInfoInternal, marketsCache: TTLCache<MarketsResponse>, apiKey?: string);
/**
* Derives a Bitcoin Cash address from a compressed public key.
*
* @param publicKey - Compressed (33-byte) secp256k1 public key.
* @param addressType - `'cashaddr'` or `'legacy'`. Defaults to the network's
* {@link defaultAddressType} (`'cashaddr'`).
*/
publicKeyToAddress(publicKey: Uint8Array, addressType?: BchAddressType): string;
/**
* Checks whether a string is a valid Bitcoin Cash address.
*
* Accepts both CashAddr (e.g. `bitcoincash:qq...`) and legacy Base58Check formats.
*
* @param address - The address string to validate.
* @returns `true` if the address is valid.
*/
isValidAddress(address: string): boolean;
/**
* Signs a message using the Bitcoin Cash message signing standard.
*
* @param message - The message to sign (string or raw bytes).
* @param privateKey - The 32-byte secp256k1 private key.
* @returns The signature as a base64 string (65 bytes).
*/
signMessage(message: string | Uint8Array, privateKey: Uint8Array): string;
/**
* Verifies a Bitcoin Cash signed message by recovering the public key and
* comparing the derived address against the expected address.
*
* @param message - The original message.
* @param signature - The base64-encoded signature (65 bytes).
* @param address - The expected signer address (CashAddr or legacy format).
* @returns `true` if the signature is valid.
*/
verifyMessage(message: string, signature: string, address: string): boolean;
}