charms-wallet-js
Version:
Professional Bitcoin wallet library for Charms ecosystem using @scure stack
64 lines • 2.55 kB
TypeScript
import { WalletData, TaprootKeys, Mnemonic, Address, ValidationResult, AddressValidation, WalletConfig } from '../types';
import { AddressWallet } from './address-wallet';
/**
* Core wallet class providing secure HD wallet functionality
* Built on the @scure cryptographic stack for maximum security
*/
export declare class CharmsWallet {
private readonly config;
constructor(config?: Partial<WalletConfig>);
/**
* Generates a cryptographically secure BIP39 mnemonic phrase
* Uses 128 bits of entropy for 12-word mnemonic by default
*/
generateMnemonic(wordCount?: number): Mnemonic;
/**
* Validates a BIP39 mnemonic phrase
*/
validateMnemonic(mnemonic: Mnemonic): ValidationResult;
/**
* Static method to generate address with specific network
* Params: mnemonic, network, index
*/
static generateAddress(mnemonic: Mnemonic, network: 'mainnet' | 'testnet' | 'testnet4', index?: number): Promise<Address>;
/**
* Static method to get private key for specific address index
* Returns only the private key without exposing other data
*/
static getPrivateKey(mnemonic: Mnemonic, network: 'mainnet' | 'testnet' | 'testnet4', index?: number): Promise<Uint8Array>;
/**
* Static method to get complete address data including keys
* Returns address, private key, public key, and x-only public key
*/
static getAddressData(mnemonic: Mnemonic, network: 'mainnet' | 'testnet' | 'testnet4', index?: number): Promise<TaprootKeys>;
static fromPrivateKey(privateKey: Uint8Array, network: 'mainnet' | 'testnet' | 'testnet4'): AddressWallet;
/**
* Derives Taproot keys from mnemonic using BIP86 derivation
*/
deriveTaprootKeys(mnemonic: Mnemonic, index?: number): Promise<TaprootKeys>;
/**
* Validates a Bitcoin address
*/
validateAddress(address: Address): AddressValidation;
/**
* Creates wallet data object
*/
createWalletData(mnemonic: Mnemonic, address: Address): WalletData;
/**
* Gets the current network configuration
*/
getNetworkConfig(): import("@scure/btc-signer/utils").BTC_NETWORK;
/**
* Gets the current wallet configuration
*/
getConfig(): WalletConfig;
/**
* Updates wallet configuration
*/
updateConfig(updates: Partial<WalletConfig>): void;
/**
* Utility method to copy text to clipboard (browser environment)
*/
copyToClipboard(text: string): Promise<boolean>;
}
//# sourceMappingURL=wallet.d.ts.map