@arkade-os/sdk
Version:
Bitcoin wallet SDK with Taproot and Ark integration
40 lines (39 loc) • 1.28 kB
TypeScript
import { Identity } from ".";
import { Transaction } from "../utils/transaction";
import { SignerSession } from "../tree/signingSession";
/**
* In-memory single key implementation for Bitcoin transaction signing.
*
* @example
* ```typescript
* // Create from hex string
* const key = SingleKey.fromHex('your_private_key_hex');
*
* // Create from raw bytes
* const key = SingleKey.fromPrivateKey(privateKeyBytes);
*
* // Create random key
* const randomKey = SingleKey.fromRandomBytes();
*
* // Sign a transaction
* const signedTx = await key.sign(transaction);
* ```
*/
export declare class SingleKey implements Identity {
private key;
private constructor();
static fromPrivateKey(privateKey: Uint8Array): SingleKey;
static fromHex(privateKeyHex: string): SingleKey;
static fromRandomBytes(): SingleKey;
/**
* Export the private key as a hex string.
*
* @returns The private key as a hex string
*/
toHex(): string;
sign(tx: Transaction, inputIndexes?: number[]): Promise<Transaction>;
compressedPublicKey(): Promise<Uint8Array>;
xOnlyPublicKey(): Promise<Uint8Array>;
signerSession(): SignerSession;
signMessage(message: Uint8Array, signatureType?: "schnorr" | "ecdsa"): Promise<Uint8Array>;
}