charms-wallet-js
Version:
Professional Bitcoin wallet library for Charms ecosystem using @scure stack
70 lines • 2.09 kB
TypeScript
import { UTXO, PSBTHex, SignedTransaction, TransactionResult, Network, Address } from '../types';
/**
* AddressWallet class for working with individual Bitcoin addresses
* Allows signing transactions without exposing the full mnemonic
*
* Note: For advanced transaction building, use @scure/btc-signer directly
*/
export declare class AddressWallet {
private readonly privateKey;
private readonly network;
private readonly address;
private readonly publicKey;
private readonly xOnlyPubkey;
constructor(privateKey: Uint8Array, network: Network, address?: Address);
/**
* Gets the Bitcoin address for this wallet
*/
getAddress(): Address;
/**
* Gets the public key (33 bytes with prefix)
*/
getPublicKey(): Uint8Array;
/**
* Gets the x-only public key (32 bytes, for Taproot)
*/
getXOnlyPublicKey(): Uint8Array;
/**
* Signs a PSBT using this address's private key
*
* Note: For complex transaction building, use TransactionBuilder + @scure/btc-signer
*/
signPSBT(psbtHex: PSBTHex, utxo: UTXO): Promise<TransactionResult>;
/**
* Signs a transaction and returns a SignedTransaction object
*/
signTransaction(psbtHex: PSBTHex, utxo: UTXO): Promise<SignedTransaction>;
/**
* Derives public key from private key using secp256k1
*/
private derivePublicKey;
/**
* Generates Bitcoin address from public key
*/
private generateAddressFromPublicKey;
/**
* Updates PSBT input with witness UTXO data
*/
private updateWitnessUtxo;
/**
* Calculates transaction ID from raw transaction bytes
*/
private calculateTxId;
/**
* Calculates virtual size of transaction
*/
private calculateVirtualSize;
/**
* Calculates transaction fee
*/
private calculateFee;
/**
* Gets network configuration for @scure
*/
private getNetworkConfig;
/**
* Validates signing inputs
*/
private validateSigningInputs;
}
//# sourceMappingURL=address-wallet.d.ts.map