Skip to main content
Signs a Bitcoin transaction with wallet keys.

Method Signature

async signTransaction(
  txHex: string,
  keyType?: string
): Promise<string>

Parameters

txHex
string
required
The transaction hex to sign
keyType
string
Key type to use: "identity", "deposit", or "auto-detect" (default: "auto-detect")

Returns

signedTxHex
string
required
The signed transaction hex

Example

// Auto-detect key type
const signedTx = await wallet.signTransaction("02000000...");

// Use specific key type
const signedWithIdentity = await wallet.signTransaction(
  "02000000...",
  "identity"
);
console.log("Signed transaction:", signedWithIdentity);