@arkade-os/sdk 0.3.0-alpha.7 → 0.3.1-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/README.md +115 -14
  2. package/dist/cjs/adapters/expo.js +8 -0
  3. package/dist/cjs/arknote/index.js +3 -3
  4. package/dist/cjs/forfeit.js +5 -2
  5. package/dist/cjs/identity/singleKey.js +5 -4
  6. package/dist/cjs/index.js +7 -3
  7. package/dist/cjs/{bip322 → intent}/index.js +37 -55
  8. package/dist/cjs/providers/ark.js +62 -23
  9. package/dist/cjs/providers/expoArk.js +82 -0
  10. package/dist/cjs/providers/expoIndexer.js +105 -0
  11. package/dist/cjs/providers/indexer.js +3 -1
  12. package/dist/cjs/providers/utils.js +122 -0
  13. package/dist/cjs/script/base.js +1 -2
  14. package/dist/cjs/script/tapscript.js +20 -21
  15. package/dist/cjs/script/vhtlc.js +2 -2
  16. package/dist/cjs/tree/signingSession.js +7 -8
  17. package/dist/cjs/tree/txTree.js +3 -4
  18. package/dist/cjs/tree/validation.js +2 -3
  19. package/dist/cjs/utils/arkTransaction.js +117 -12
  20. package/dist/cjs/utils/unknownFields.js +5 -5
  21. package/dist/cjs/wallet/index.js +1 -1
  22. package/dist/cjs/wallet/onchain.js +4 -5
  23. package/dist/cjs/wallet/serviceWorker/utils.js +2 -9
  24. package/dist/cjs/wallet/serviceWorker/wallet.js +4 -8
  25. package/dist/cjs/wallet/serviceWorker/worker.js +25 -23
  26. package/dist/cjs/wallet/unroll.js +6 -7
  27. package/dist/cjs/wallet/utils.js +11 -0
  28. package/dist/cjs/wallet/vtxo-manager.js +381 -0
  29. package/dist/cjs/wallet/wallet.js +130 -143
  30. package/dist/esm/adapters/expo.js +3 -0
  31. package/dist/esm/arknote/index.js +2 -2
  32. package/dist/esm/forfeit.js +4 -1
  33. package/dist/esm/identity/singleKey.js +7 -6
  34. package/dist/esm/index.js +7 -6
  35. package/dist/esm/{bip322 → intent}/index.js +31 -48
  36. package/dist/esm/providers/ark.js +62 -23
  37. package/dist/esm/providers/expoArk.js +78 -0
  38. package/dist/esm/providers/expoIndexer.js +101 -0
  39. package/dist/esm/providers/indexer.js +3 -1
  40. package/dist/esm/providers/utils.js +87 -0
  41. package/dist/esm/script/base.js +1 -2
  42. package/dist/esm/script/tapscript.js +1 -2
  43. package/dist/esm/script/vhtlc.js +1 -1
  44. package/dist/esm/tree/signingSession.js +8 -9
  45. package/dist/esm/tree/txTree.js +3 -4
  46. package/dist/esm/tree/validation.js +2 -3
  47. package/dist/esm/utils/arkTransaction.js +108 -5
  48. package/dist/esm/utils/unknownFields.js +1 -1
  49. package/dist/esm/wallet/index.js +1 -1
  50. package/dist/esm/wallet/onchain.js +1 -2
  51. package/dist/esm/wallet/serviceWorker/utils.js +1 -8
  52. package/dist/esm/wallet/serviceWorker/wallet.js +5 -9
  53. package/dist/esm/wallet/serviceWorker/worker.js +26 -24
  54. package/dist/esm/wallet/unroll.js +2 -3
  55. package/dist/esm/wallet/utils.js +8 -0
  56. package/dist/esm/wallet/vtxo-manager.js +372 -0
  57. package/dist/esm/wallet/wallet.js +124 -137
  58. package/dist/types/adapters/expo.d.ts +4 -0
  59. package/dist/types/arknote/index.d.ts +1 -1
  60. package/dist/types/forfeit.d.ts +2 -2
  61. package/dist/types/identity/index.d.ts +1 -1
  62. package/dist/types/identity/singleKey.d.ts +1 -1
  63. package/dist/types/index.d.ts +8 -7
  64. package/dist/types/intent/index.d.ts +41 -0
  65. package/dist/types/providers/ark.d.ts +190 -22
  66. package/dist/types/providers/expoArk.d.ts +22 -0
  67. package/dist/types/providers/expoIndexer.d.ts +18 -0
  68. package/dist/types/providers/indexer.d.ts +8 -8
  69. package/dist/types/providers/utils.d.ts +18 -0
  70. package/dist/types/script/base.d.ts +3 -2
  71. package/dist/types/tree/signingSession.d.ts +10 -10
  72. package/dist/types/utils/anchor.d.ts +2 -2
  73. package/dist/types/utils/arkTransaction.d.ts +16 -4
  74. package/dist/types/utils/unknownFields.d.ts +2 -2
  75. package/dist/types/wallet/index.d.ts +47 -7
  76. package/dist/types/wallet/onchain.d.ts +1 -1
  77. package/dist/types/wallet/serviceWorker/utils.d.ts +1 -2
  78. package/dist/types/wallet/serviceWorker/wallet.d.ts +2 -2
  79. package/dist/types/wallet/serviceWorker/worker.d.ts +3 -1
  80. package/dist/types/wallet/unroll.d.ts +1 -1
  81. package/dist/types/wallet/utils.d.ts +2 -0
  82. package/dist/types/wallet/vtxo-manager.d.ts +207 -0
  83. package/dist/types/wallet/wallet.d.ts +16 -4
  84. package/package.json +11 -3
  85. package/dist/cjs/bip322/errors.js +0 -13
  86. package/dist/esm/bip322/errors.js +0 -9
  87. package/dist/types/bip322/errors.d.ts +0 -6
  88. package/dist/types/bip322/index.d.ts +0 -57
@@ -0,0 +1,207 @@
1
+ import { ExtendedVirtualCoin, IWallet } from ".";
2
+ import { SettlementEvent } from "../providers/ark";
3
+ /**
4
+ * Configuration options for automatic VTXO renewal
5
+ */
6
+ export interface RenewalConfig {
7
+ /**
8
+ * Enable automatic renewal monitoring
9
+ * @default false
10
+ */
11
+ enabled: boolean;
12
+ /**
13
+ * Percentage of expiry time to use as threshold (0-100)
14
+ * E.g., 10 means renew when 10% of time until expiry remains
15
+ * @default 10
16
+ */
17
+ thresholdPercentage?: number;
18
+ }
19
+ /**
20
+ * Default renewal configuration values
21
+ */
22
+ export declare const DEFAULT_RENEWAL_CONFIG: Required<Omit<RenewalConfig, "enabled">>;
23
+ /**
24
+ * Check if a VTXO is expiring soon based on threshold
25
+ *
26
+ * @param vtxo - The virtual coin to check
27
+ * @param thresholdMs - Threshold in milliseconds from now
28
+ * @returns true if VTXO expires within threshold, false otherwise
29
+ */
30
+ export declare function isVtxoExpiringSoon(vtxo: ExtendedVirtualCoin, thresholdMs: number): boolean;
31
+ /**
32
+ * Filter VTXOs that are expiring soon
33
+ *
34
+ * @param vtxos - Array of virtual coins to check
35
+ * @param thresholdMs - Threshold in milliseconds from now
36
+ * @returns Array of VTXOs expiring within threshold
37
+ */
38
+ export declare function getExpiringVtxos(vtxos: ExtendedVirtualCoin[], thresholdMs: number): ExtendedVirtualCoin[];
39
+ /**
40
+ * Calculate expiry threshold in milliseconds based on batch expiry and percentage
41
+ *
42
+ * @param batchExpiry - Batch expiry timestamp in milliseconds
43
+ * @param percentage - Percentage of total time (0-100)
44
+ * @returns Threshold timestamp in milliseconds from now
45
+ *
46
+ * @example
47
+ * // VTXO expires in 10 days, threshold is 10%
48
+ * const expiry = Date.now() + 10 * 24 * 60 * 60 * 1000;
49
+ * const threshold = calculateExpiryThreshold(expiry, 10);
50
+ * // Returns 1 day in milliseconds (10% of 10 days)
51
+ */
52
+ export declare function calculateExpiryThreshold(batchExpiry: number, percentage: number): number;
53
+ /**
54
+ * Get the minimum expiry time from a list of VTXOs
55
+ *
56
+ * @param vtxos - Array of virtual coins
57
+ * @returns Minimum batch expiry timestamp, or undefined if no VTXOs have expiry
58
+ */
59
+ export declare function getMinimumExpiry(vtxos: ExtendedVirtualCoin[]): number | undefined;
60
+ /**
61
+ * Calculate dynamic threshold based on the earliest expiring VTXO
62
+ *
63
+ * @param vtxos - Array of virtual coins
64
+ * @param percentage - Percentage of time until expiry (0-100)
65
+ * @returns Threshold in milliseconds, or undefined if no VTXOs have expiry
66
+ */
67
+ export declare function calculateDynamicThreshold(vtxos: ExtendedVirtualCoin[], percentage: number): number | undefined;
68
+ /**
69
+ * VtxoManager is a unified class for managing VTXO lifecycle operations including
70
+ * recovery of swept/expired VTXOs and renewal to prevent expiration.
71
+ *
72
+ * Key Features:
73
+ * - **Recovery**: Reclaim swept or expired VTXOs back to the wallet
74
+ * - **Renewal**: Refresh VTXO expiration time before they expire
75
+ * - **Smart subdust handling**: Automatically includes subdust VTXOs when economically viable
76
+ * - **Expiry monitoring**: Check for VTXOs that are expiring soon
77
+ *
78
+ * VTXOs become recoverable when:
79
+ * - The Ark server sweeps them (virtualStatus.state === "swept") and they remain spendable
80
+ * - They are preconfirmed subdust (to consolidate small amounts without locking liquidity on settled VTXOs)
81
+ *
82
+ * @example
83
+ * ```typescript
84
+ * // Initialize with renewal config
85
+ * const manager = new VtxoManager(wallet, {
86
+ * enabled: true,
87
+ * thresholdPercentage: 10
88
+ * });
89
+ *
90
+ * // Check recoverable balance
91
+ * const balance = await manager.getRecoverableBalance();
92
+ * if (balance.recoverable > 0n) {
93
+ * console.log(`Can recover ${balance.recoverable} sats`);
94
+ * const txid = await manager.recoverVtxos();
95
+ * }
96
+ *
97
+ * // Check for expiring VTXOs
98
+ * const expiring = await manager.getExpiringVtxos();
99
+ * if (expiring.length > 0) {
100
+ * console.log(`${expiring.length} VTXOs expiring soon`);
101
+ * const txid = await manager.renewVtxos();
102
+ * }
103
+ * ```
104
+ */
105
+ export declare class VtxoManager {
106
+ readonly wallet: IWallet;
107
+ readonly renewalConfig?: RenewalConfig | undefined;
108
+ constructor(wallet: IWallet, renewalConfig?: RenewalConfig | undefined);
109
+ /**
110
+ * Recover swept/expired VTXOs by settling them back to the wallet's Ark address.
111
+ *
112
+ * This method:
113
+ * 1. Fetches all VTXOs (including recoverable ones)
114
+ * 2. Filters for swept but still spendable VTXOs and preconfirmed subdust
115
+ * 3. Includes subdust VTXOs if the total value >= dust threshold
116
+ * 4. Settles everything back to the wallet's Ark address
117
+ *
118
+ * Note: Settled VTXOs with long expiry are NOT recovered to avoid locking liquidity unnecessarily.
119
+ * Only preconfirmed subdust is recovered to consolidate small amounts.
120
+ *
121
+ * @param eventCallback - Optional callback to receive settlement events
122
+ * @returns Settlement transaction ID
123
+ * @throws Error if no recoverable VTXOs found
124
+ *
125
+ * @example
126
+ * ```typescript
127
+ * const manager = new VtxoManager(wallet);
128
+ *
129
+ * // Simple recovery
130
+ * const txid = await manager.recoverVtxos();
131
+ *
132
+ * // With event callback
133
+ * const txid = await manager.recoverVtxos((event) => {
134
+ * console.log('Settlement event:', event.type);
135
+ * });
136
+ * ```
137
+ */
138
+ recoverVtxos(eventCallback?: (event: SettlementEvent) => void): Promise<string>;
139
+ /**
140
+ * Get information about recoverable balance without executing recovery.
141
+ *
142
+ * Useful for displaying to users before they decide to recover funds.
143
+ *
144
+ * @returns Object containing recoverable amounts and subdust information
145
+ *
146
+ * @example
147
+ * ```typescript
148
+ * const manager = new VtxoManager(wallet);
149
+ * const balance = await manager.getRecoverableBalance();
150
+ *
151
+ * if (balance.recoverable > 0n) {
152
+ * console.log(`You can recover ${balance.recoverable} sats`);
153
+ * if (balance.includesSubdust) {
154
+ * console.log(`This includes ${balance.subdust} sats from subdust VTXOs`);
155
+ * }
156
+ * }
157
+ * ```
158
+ */
159
+ getRecoverableBalance(): Promise<{
160
+ recoverable: bigint;
161
+ subdust: bigint;
162
+ includesSubdust: boolean;
163
+ vtxoCount: number;
164
+ }>;
165
+ /**
166
+ * Get VTXOs that are expiring soon based on renewal configuration
167
+ *
168
+ * @param thresholdPercentage - Optional override for threshold percentage (0-100)
169
+ * @returns Array of expiring VTXOs, empty array if renewal is disabled or no VTXOs expiring
170
+ *
171
+ * @example
172
+ * ```typescript
173
+ * const manager = new VtxoManager(wallet, { enabled: true, thresholdPercentage: 10 });
174
+ * const expiringVtxos = await manager.getExpiringVtxos();
175
+ * if (expiringVtxos.length > 0) {
176
+ * console.log(`${expiringVtxos.length} VTXOs expiring soon`);
177
+ * }
178
+ * ```
179
+ */
180
+ getExpiringVtxos(thresholdPercentage?: number): Promise<ExtendedVirtualCoin[]>;
181
+ /**
182
+ * Renew VTXOs by settling them back to the wallet's address
183
+ *
184
+ * This method collects all spendable VTXOs (including recoverable ones) and settles
185
+ * them back to the wallet, effectively refreshing their expiration time. This is the
186
+ * primary way to prevent VTXOs from expiring.
187
+ *
188
+ * @param eventCallback - Optional callback for settlement events
189
+ * @returns Settlement transaction ID
190
+ * @throws Error if no VTXOs available to renew
191
+ * @throws Error if total amount is below dust threshold
192
+ *
193
+ * @example
194
+ * ```typescript
195
+ * const manager = new VtxoManager(wallet);
196
+ *
197
+ * // Simple renewal
198
+ * const txid = await manager.renewVtxos();
199
+ *
200
+ * // With event callback
201
+ * const txid = await manager.renewVtxos((event) => {
202
+ * console.log('Settlement event:', event.type);
203
+ * });
204
+ * ```
205
+ */
206
+ renewVtxos(eventCallback?: (event: SettlementEvent) => void): Promise<string>;
207
+ }
@@ -1,3 +1,4 @@
1
+ import { Bytes } from "@scure/btc-signer/utils.js";
1
2
  import { ArkAddress } from "../script/address";
2
3
  import { DefaultVtxo } from "../script/default";
3
4
  import { Network, NetworkName } from "../networks";
@@ -5,7 +6,6 @@ import { OnchainProvider } from "../providers/onchain";
5
6
  import { SettlementEvent, ArkProvider } from "../providers/ark";
6
7
  import { Identity } from "../identity";
7
8
  import { ArkTransaction, Coin, ExtendedCoin, ExtendedVirtualCoin, GetVtxosFilter, IWallet, SendBitcoinParams, SettleParams, WalletBalance, WalletConfig } from ".";
8
- import { Bytes } from "@scure/btc-signer/utils.js";
9
9
  import { CSVMultisigTapscript } from "../script/tapscript";
10
10
  import { IndexerProvider } from "../providers/indexer";
11
11
  import { WalletRepository } from "../repositories/walletRepository";
@@ -25,13 +25,21 @@ export type IncomingFunds = {
25
25
  *
26
26
  * @example
27
27
  * ```typescript
28
- * // Create a wallet
28
+ * // Create a wallet with URL configuration
29
29
  * const wallet = await Wallet.create({
30
30
  * identity: SingleKey.fromHex('your_private_key'),
31
31
  * arkServerUrl: 'https://ark.example.com',
32
32
  * esploraUrl: 'https://mempool.space/api'
33
33
  * });
34
34
  *
35
+ * // Or with custom provider instances (e.g., for Expo/React Native)
36
+ * const wallet = await Wallet.create({
37
+ * identity: SingleKey.fromHex('your_private_key'),
38
+ * arkProvider: new ExpoArkProvider('https://ark.example.com'),
39
+ * indexerProvider: new ExpoIndexerProvider('https://ark.example.com'),
40
+ * esploraUrl: 'https://mempool.space/api'
41
+ * });
42
+ *
35
43
  * // Get addresses
36
44
  * const arkAddress = await wallet.getAddress();
37
45
  * const boardingAddress = await wallet.getBoardingAddress();
@@ -55,10 +63,15 @@ export declare class Wallet implements IWallet {
55
63
  readonly boardingTapscript: DefaultVtxo.Script;
56
64
  readonly serverUnrollScript: CSVMultisigTapscript.Type;
57
65
  readonly forfeitOutputScript: Bytes;
66
+ readonly forfeitPubkey: Bytes;
58
67
  readonly dustAmount: bigint;
59
68
  static MIN_FEE_RATE: number;
60
69
  readonly walletRepository: WalletRepository;
61
70
  readonly contractRepository: ContractRepository;
71
+ readonly renewalConfig: Required<Omit<WalletConfig["renewalConfig"], "enabled">> & {
72
+ enabled: boolean;
73
+ thresholdPercentage: number;
74
+ };
62
75
  private constructor();
63
76
  static create(config: WalletConfig): Promise<Wallet>;
64
77
  get arkAddress(): ArkAddress;
@@ -82,8 +95,7 @@ export declare class Wallet implements IWallet {
82
95
  private handleSettlementFinalizationEvent;
83
96
  private makeRegisterIntentSignature;
84
97
  private makeDeleteIntentSignature;
85
- private prepareBIP322Inputs;
86
- private makeBIP322Signature;
98
+ private prepareIntentProofInputs;
87
99
  }
88
100
  /**
89
101
  * Wait for incoming funds to the wallet
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkade-os/sdk",
3
- "version": "0.3.0-alpha.7",
3
+ "version": "0.3.1-alpha.0",
4
4
  "description": "Bitcoin wallet SDK with Taproot and Ark integration",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/index.js",
@@ -14,6 +14,12 @@
14
14
  "require": "./dist/cjs/index.js",
15
15
  "default": "./dist/esm/index.js"
16
16
  },
17
+ "./adapters/expo": {
18
+ "types": "./dist/types/adapters/expo.d.ts",
19
+ "import": "./dist/esm/adapters/expo.js",
20
+ "require": "./dist/cjs/adapters/expo.js",
21
+ "default": "./dist/esm/adapters/expo.js"
22
+ },
17
23
  "./adapters/localStorage": {
18
24
  "types": "./dist/types/adapters/localStorage.d.ts",
19
25
  "import": "./dist/esm/adapters/localStorage.js",
@@ -48,7 +54,6 @@
48
54
  },
49
55
  "dependencies": {
50
56
  "@noble/curves": "2.0.0",
51
- "@noble/hashes": "2.0.0",
52
57
  "@noble/secp256k1": "3.0.0",
53
58
  "@scure/base": "2.0.0",
54
59
  "@scure/btc-signer": "2.0.1",
@@ -58,6 +63,7 @@
58
63
  "@types/node": "24.3.1",
59
64
  "@vitest/coverage-v8": "3.2.4",
60
65
  "esbuild": "^0.25.9",
66
+ "expo": "~52.0.47",
61
67
  "eventsource": "4.0.0",
62
68
  "glob": "11.0.3",
63
69
  "husky": "9.1.7",
@@ -78,7 +84,7 @@
78
84
  "author": "Ark Labs",
79
85
  "license": "MIT",
80
86
  "engines": {
81
- "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
87
+ "node": ">=20.0.0"
82
88
  },
83
89
  "scripts": {
84
90
  "build": "rimraf dist && pnpm run build:esm && node scripts/add-extensions.js && pnpm run build:cjs && pnpm run build:types && node scripts/generate-package-files.js",
@@ -101,6 +107,8 @@
101
107
  "test:watch": "vitest",
102
108
  "test:coverage": "vitest run --coverage",
103
109
  "test:sw": "pnpm run build:browser && node test/serviceWorker/serve.js",
110
+ "expo:web:install": "cd examples/expo-demo && pnpm install",
111
+ "expo:web": "cd examples/expo-demo && pnpm start",
104
112
  "format": "prettier --write src test examples",
105
113
  "lint": "prettier --check src test examples",
106
114
  "audit": "pnpm audit",
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ErrMissingWitnessUtxo = exports.ErrMissingData = exports.ErrMissingInputs = exports.BIP322Error = void 0;
4
- class BIP322Error extends Error {
5
- constructor(message) {
6
- super(message);
7
- this.name = "BIP322Error";
8
- }
9
- }
10
- exports.BIP322Error = BIP322Error;
11
- exports.ErrMissingInputs = new BIP322Error("missing inputs");
12
- exports.ErrMissingData = new BIP322Error("missing data");
13
- exports.ErrMissingWitnessUtxo = new BIP322Error("missing witness utxo");
@@ -1,9 +0,0 @@
1
- export class BIP322Error extends Error {
2
- constructor(message) {
3
- super(message);
4
- this.name = "BIP322Error";
5
- }
6
- }
7
- export const ErrMissingInputs = new BIP322Error("missing inputs");
8
- export const ErrMissingData = new BIP322Error("missing data");
9
- export const ErrMissingWitnessUtxo = new BIP322Error("missing witness utxo");
@@ -1,6 +0,0 @@
1
- export declare class BIP322Error extends Error {
2
- constructor(message: string);
3
- }
4
- export declare const ErrMissingInputs: BIP322Error;
5
- export declare const ErrMissingData: BIP322Error;
6
- export declare const ErrMissingWitnessUtxo: BIP322Error;
@@ -1,57 +0,0 @@
1
- import { Transaction } from "@scure/btc-signer/transaction.js";
2
- import { TransactionInput, TransactionOutput } from "@scure/btc-signer/psbt.js";
3
- /**
4
- * BIP-322 signature implementation for Bitcoin message signing.
5
- *
6
- * BIP-322 defines a standard for signing Bitcoin messages as well as proving
7
- * ownership of coins. This namespace provides utilities for creating and
8
- * validating BIP-322.
9
- *
10
- * @see https://github.com/bitcoin/bips/blob/master/bip-0322.mediawiki
11
- *
12
- * @example
13
- * ```typescript
14
- * // Create a BIP-322 proof
15
- * const proof = BIP322.create(
16
- * "Hello Bitcoin!",
17
- * [input],
18
- * [output]
19
- * );
20
- *
21
- * // Sign the proof
22
- * const signedProof = await identity.sign(proof);
23
- *
24
- * // Extract the signature
25
- * const signature = BIP322.signature(signedProof);
26
- * ```
27
- */
28
- export declare namespace BIP322 {
29
- type FullProof = Transaction;
30
- type Signature = string;
31
- /**
32
- * Creates a new BIP-322 "full" proof of funds unsigned transaction.
33
- *
34
- * This function constructs a special transaction that can be signed to prove
35
- * ownership of VTXOs and UTXOs. The proof includes the message to be
36
- * signed and the inputs/outputs that demonstrate ownership.
37
- *
38
- * @param message - The BIP-322 message to be signed
39
- * @param inputs - Array of transaction inputs to prove ownership of
40
- * @param outputs - Optional array of transaction outputs
41
- * @returns An unsigned BIP-322 proof transaction
42
- */
43
- function create(message: string, inputs: TransactionInput[], outputs?: TransactionOutput[]): FullProof;
44
- /**
45
- * Finalizes and extracts the FullProof transaction into a BIP-322 signature.
46
- *
47
- * This function takes a signed proof transaction and converts it into a
48
- * base64-encoded signature string. If the proof's inputs have special
49
- * spending conditions, a custom finalizer can be provided.
50
- *
51
- * @param signedProof - The signed BIP-322 proof transaction
52
- * @param finalizer - Optional custom finalizer function
53
- * @returns Base64-encoded BIP-322 signature
54
- */
55
- function signature(signedProof: FullProof, finalizer?: (tx: FullProof) => void): Signature;
56
- }
57
- export declare function craftToSpendTx(message: string, pkScript: Uint8Array): Transaction;