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
22 lines (21 loc) • 935 B
TypeScript
import { Wallet } from './Wallet/Wallet';
import { SigningWallet } from './Wallet/SigningWallet/SigningWallet';
import { HDWallet } from './Wallet/SigningWallet/HDWallet/HDWallet';
import { ViewOnlyWallet } from './Wallet/ViewOnlyWallet/ViewOnlyWallet';
import type { Secret } from './Wallet/Secret';
/**
* Checks if a wallet supports a feature and narrows the type accordingly.
*
* @param wallet - The wallet to check.
* @param feature - `'hdwallet'`, `'signingwallet'`, or `'viewonly'`.
*
* @example
* ```ts
* if (supports(wallet, 'hdwallet')) {
* const key = await wallet.derive("m/44'/60'/0'/0/0");
* }
* ```
*/
export declare function supports(wallet: Wallet, feature: 'hdwallet'): wallet is HDWallet<Secret>;
export declare function supports(wallet: Wallet, feature: 'signingwallet'): wallet is SigningWallet<Secret>;
export declare function supports(wallet: Wallet, feature: 'viewonly'): wallet is ViewOnlyWallet;