@bitgo/wasm-utxo 4.0.2 → 4.2.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 (44) hide show
  1. package/dist/cjs/js/descriptorWallet/Psbt.d.ts +3 -15
  2. package/dist/cjs/js/descriptorWallet/Psbt.js +3 -41
  3. package/dist/cjs/js/fixedScriptWallet/BitGoKeySubtype.d.ts +37 -0
  4. package/dist/cjs/js/fixedScriptWallet/BitGoKeySubtype.js +5 -0
  5. package/dist/cjs/js/fixedScriptWallet/BitGoPsbt.d.ts +7 -52
  6. package/dist/cjs/js/fixedScriptWallet/BitGoPsbt.js +4 -75
  7. package/dist/cjs/js/fixedScriptWallet/index.d.ts +1 -1
  8. package/dist/cjs/js/fixedScriptWallet/index.js +3 -1
  9. package/dist/cjs/js/index.d.ts +5 -0
  10. package/dist/cjs/js/index.js +8 -3
  11. package/dist/cjs/js/psbt.d.ts +7 -0
  12. package/dist/cjs/js/psbtBase.d.ts +44 -0
  13. package/dist/cjs/js/psbtBase.js +62 -0
  14. package/dist/cjs/js/transaction.d.ts +6 -58
  15. package/dist/cjs/js/transaction.js +10 -117
  16. package/dist/cjs/js/transactionBase.d.ts +28 -0
  17. package/dist/cjs/js/transactionBase.js +37 -0
  18. package/dist/cjs/js/wasm/wasm_utxo.d.ts +31 -4
  19. package/dist/cjs/js/wasm/wasm_utxo.js +333 -13
  20. package/dist/cjs/js/wasm/wasm_utxo_bg.wasm +0 -0
  21. package/dist/cjs/js/wasm/wasm_utxo_bg.wasm.d.ts +148 -133
  22. package/dist/esm/js/descriptorWallet/Psbt.d.ts +3 -15
  23. package/dist/esm/js/descriptorWallet/Psbt.js +3 -41
  24. package/dist/esm/js/fixedScriptWallet/BitGoKeySubtype.d.ts +37 -0
  25. package/dist/esm/js/fixedScriptWallet/BitGoKeySubtype.js +2 -0
  26. package/dist/esm/js/fixedScriptWallet/BitGoPsbt.d.ts +7 -52
  27. package/dist/esm/js/fixedScriptWallet/BitGoPsbt.js +4 -75
  28. package/dist/esm/js/fixedScriptWallet/index.d.ts +1 -1
  29. package/dist/esm/js/fixedScriptWallet/index.js +1 -0
  30. package/dist/esm/js/index.d.ts +5 -0
  31. package/dist/esm/js/index.js +4 -0
  32. package/dist/esm/js/psbt.d.ts +7 -0
  33. package/dist/esm/js/psbtBase.d.ts +44 -0
  34. package/dist/esm/js/psbtBase.js +58 -0
  35. package/dist/esm/js/transaction.d.ts +6 -58
  36. package/dist/esm/js/transaction.js +11 -118
  37. package/dist/esm/js/transactionBase.d.ts +28 -0
  38. package/dist/esm/js/transactionBase.js +33 -0
  39. package/dist/esm/js/wasm/wasm_utxo.d.ts +31 -4
  40. package/dist/esm/js/wasm/wasm_utxo.js +1 -1
  41. package/dist/esm/js/wasm/wasm_utxo_bg.js +332 -13
  42. package/dist/esm/js/wasm/wasm_utxo_bg.wasm +0 -0
  43. package/dist/esm/js/wasm/wasm_utxo_bg.wasm.d.ts +148 -133
  44. package/package.json +1 -1
@@ -1,6 +1,141 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
+ export const __wbg_addressnamespace_free: (a: number, b: number) => void;
5
+ export const __wbg_inscriptionsnamespace_free: (a: number, b: number) => void;
6
+ export const __wbg_wasmbip32_free: (a: number, b: number) => void;
7
+ export const __wbg_wasmdashtransaction_free: (a: number, b: number) => void;
8
+ export const __wbg_wasmecpair_free: (a: number, b: number) => void;
9
+ export const __wbg_wasmtransaction_free: (a: number, b: number) => void;
10
+ export const __wbg_wasmzcashtransaction_free: (a: number, b: number) => void;
11
+ export const __wbg_wrappsbt_free: (a: number, b: number) => void;
12
+ export const addressnamespace_from_output_script_with_coin: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
13
+ export const addressnamespace_to_output_script_with_coin: (a: number, b: number, c: number, d: number, e: number) => void;
14
+ export const inscriptionsnamespace_create_inscription_reveal_data: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
15
+ export const inscriptionsnamespace_sign_reveal_transaction: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: bigint) => void;
16
+ export const isInspectEnabled: () => number;
17
+ export const parsePsbtRawToJson: (a: number, b: number, c: number, d: number, e: number) => void;
18
+ export const wasmbip32_chain_code: (a: number) => number;
19
+ export const wasmbip32_depth: (a: number) => number;
20
+ export const wasmbip32_derive: (a: number, b: number, c: number) => void;
21
+ export const wasmbip32_derive_hardened: (a: number, b: number, c: number) => void;
22
+ export const wasmbip32_derive_path: (a: number, b: number, c: number, d: number) => void;
23
+ export const wasmbip32_equals: (a: number, b: number) => number;
24
+ export const wasmbip32_fingerprint: (a: number) => number;
25
+ export const wasmbip32_from_base58: (a: number, b: number, c: number) => void;
26
+ export const wasmbip32_from_bip32_interface: (a: number, b: number) => void;
27
+ export const wasmbip32_from_seed: (a: number, b: number, c: number, d: number, e: number) => void;
28
+ export const wasmbip32_from_seed_sha256: (a: number, b: number, c: number, d: number, e: number) => void;
29
+ export const wasmbip32_from_xprv: (a: number, b: number, c: number) => void;
30
+ export const wasmbip32_from_xpub: (a: number, b: number, c: number) => void;
31
+ export const wasmbip32_identifier: (a: number) => number;
32
+ export const wasmbip32_index: (a: number) => number;
33
+ export const wasmbip32_is_neutered: (a: number) => number;
34
+ export const wasmbip32_neutered: (a: number) => number;
35
+ export const wasmbip32_parent_fingerprint: (a: number) => number;
36
+ export const wasmbip32_private_key: (a: number) => number;
37
+ export const wasmbip32_public_key: (a: number) => number;
38
+ export const wasmbip32_to_base58: (a: number, b: number) => void;
39
+ export const wasmbip32_to_wif: (a: number, b: number) => void;
40
+ export const wasmdashtransaction_from_bytes: (a: number, b: number, c: number) => void;
41
+ export const wasmdashtransaction_get_inputs: (a: number, b: number) => void;
42
+ export const wasmdashtransaction_get_outputs: (a: number, b: number) => void;
43
+ export const wasmdashtransaction_get_outputs_with_address: (a: number, b: number, c: number, d: number) => void;
44
+ export const wasmdashtransaction_get_txid: (a: number, b: number) => void;
45
+ export const wasmdashtransaction_input_count: (a: number) => number;
46
+ export const wasmdashtransaction_lock_time: (a: number) => number;
47
+ export const wasmdashtransaction_output_count: (a: number) => number;
48
+ export const wasmdashtransaction_to_bytes: (a: number, b: number) => void;
49
+ export const wasmdashtransaction_version: (a: number) => number;
50
+ export const wasmecpair_from_private_key: (a: number, b: number, c: number) => void;
51
+ export const wasmecpair_from_public_key: (a: number, b: number, c: number) => void;
52
+ export const wasmecpair_from_wif: (a: number, b: number, c: number) => void;
53
+ export const wasmecpair_from_wif_mainnet: (a: number, b: number, c: number) => void;
54
+ export const wasmecpair_from_wif_testnet: (a: number, b: number, c: number) => void;
55
+ export const wasmecpair_private_key: (a: number) => number;
56
+ export const wasmecpair_public_key: (a: number) => number;
57
+ export const wasmecpair_to_wif: (a: number, b: number) => void;
58
+ export const wasmecpair_to_wif_mainnet: (a: number, b: number) => void;
59
+ export const wasmecpair_to_wif_testnet: (a: number, b: number) => void;
60
+ export const wasmtransaction_add_input: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
61
+ export const wasmtransaction_add_input_at_index: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
62
+ export const wasmtransaction_add_output: (a: number, b: number, c: number, d: bigint) => number;
63
+ export const wasmtransaction_add_output_at_index: (a: number, b: number, c: number, d: number, e: number, f: bigint) => void;
64
+ export const wasmtransaction_create: () => number;
65
+ export const wasmtransaction_from_bytes: (a: number, b: number, c: number) => void;
66
+ export const wasmtransaction_get_inputs: (a: number, b: number) => void;
67
+ export const wasmtransaction_get_outputs: (a: number, b: number) => void;
68
+ export const wasmtransaction_get_outputs_with_address: (a: number, b: number, c: number, d: number) => void;
69
+ export const wasmtransaction_get_txid: (a: number, b: number) => void;
70
+ export const wasmtransaction_get_vsize: (a: number) => number;
71
+ export const wasmtransaction_to_bytes: (a: number, b: number) => void;
72
+ export const wasmzcashtransaction_from_bytes: (a: number, b: number, c: number) => void;
73
+ export const wasmzcashtransaction_get_inputs: (a: number, b: number) => void;
74
+ export const wasmzcashtransaction_get_outputs: (a: number, b: number) => void;
75
+ export const wasmzcashtransaction_get_outputs_with_address: (a: number, b: number, c: number, d: number) => void;
76
+ export const wasmzcashtransaction_get_txid: (a: number, b: number) => void;
77
+ export const wasmzcashtransaction_to_bytes: (a: number, b: number) => void;
78
+ export const wrappsbt_add_input: (a: number, b: number, c: number, d: number, e: number, f: bigint, g: number, h: number, i: number) => void;
79
+ export const wrappsbt_add_input_at_index: (a: number, b: number, c: number, d: number, e: number, f: number, g: bigint, h: number, i: number, j: number) => void;
80
+ export const wrappsbt_add_output: (a: number, b: number, c: number, d: bigint) => number;
81
+ export const wrappsbt_add_output_at_index: (a: number, b: number, c: number, d: number, e: number, f: bigint) => void;
82
+ export const wrappsbt_clone: (a: number) => number;
83
+ export const wrappsbt_deserialize: (a: number, b: number, c: number) => void;
84
+ export const wrappsbt_extract_transaction: (a: number, b: number) => void;
85
+ export const wrappsbt_finalize_mut: (a: number, b: number) => void;
86
+ export const wrappsbt_get_global_xpubs: (a: number) => number;
87
+ export const wrappsbt_get_input_kv: (a: number, b: number, c: number, d: number) => void;
88
+ export const wrappsbt_get_inputs: (a: number, b: number) => void;
89
+ export const wrappsbt_get_kv: (a: number, b: number, c: number) => void;
90
+ export const wrappsbt_get_output_kv: (a: number, b: number, c: number, d: number) => void;
91
+ export const wrappsbt_get_outputs: (a: number, b: number) => void;
92
+ export const wrappsbt_get_outputs_with_address: (a: number, b: number, c: number, d: number) => void;
93
+ export const wrappsbt_get_partial_signatures: (a: number, b: number, c: number) => void;
94
+ export const wrappsbt_get_unsigned_tx: (a: number, b: number) => void;
95
+ export const wrappsbt_has_partial_signatures: (a: number, b: number, c: number) => void;
96
+ export const wrappsbt_input_count: (a: number) => number;
97
+ export const wrappsbt_new: (a: number, b: number) => number;
98
+ export const wrappsbt_output_count: (a: number) => number;
99
+ export const wrappsbt_remove_input: (a: number, b: number, c: number) => void;
100
+ export const wrappsbt_remove_output: (a: number, b: number, c: number) => void;
101
+ export const wrappsbt_serialize: (a: number, b: number) => void;
102
+ export const wrappsbt_set_input_kv: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
103
+ export const wrappsbt_set_kv: (a: number, b: number, c: number, d: number, e: number) => void;
104
+ export const wrappsbt_set_output_kv: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
105
+ export const wrappsbt_sign_all: (a: number, b: number, c: number) => void;
106
+ export const wrappsbt_sign_all_with_ecpair: (a: number, b: number, c: number) => void;
107
+ export const wrappsbt_sign_with_prv: (a: number, b: number, c: number, d: number) => void;
108
+ export const wrappsbt_sign_with_xprv: (a: number, b: number, c: number, d: number) => void;
109
+ export const wrappsbt_unsigned_tx_id: (a: number, b: number) => void;
110
+ export const wrappsbt_update_input_with_descriptor: (a: number, b: number, c: number, d: number) => void;
111
+ export const wrappsbt_update_output_with_descriptor: (a: number, b: number, c: number, d: number) => void;
112
+ export const wrappsbt_validate_signature_at_input: (a: number, b: number, c: number, d: number, e: number) => void;
113
+ export const wrappsbt_verify_signature_with_key: (a: number, b: number, c: number, d: number) => void;
114
+ export const wasmbip32_from_bip32_properties: (a: number, b: number) => void;
115
+ export const wasmtransaction_input_count: (a: number) => number;
116
+ export const wasmtransaction_output_count: (a: number) => number;
117
+ export const wasmzcashtransaction_input_count: (a: number) => number;
118
+ export const wasmzcashtransaction_output_count: (a: number) => number;
119
+ export const parsePsbtToJson: (a: number, b: number, c: number, d: number, e: number) => void;
120
+ export const parseTxToJson: (a: number, b: number, c: number, d: number, e: number) => void;
121
+ export const wasmtransaction_lock_time: (a: number) => number;
122
+ export const wasmtransaction_version: (a: number) => number;
123
+ export const wasmzcashtransaction_lock_time: (a: number) => number;
124
+ export const wasmzcashtransaction_version: (a: number) => number;
125
+ export const wrappsbt_lock_time: (a: number) => number;
126
+ export const wrappsbt_version: (a: number) => number;
127
+ export const __wbg_wasmreplayprotection_free: (a: number, b: number) => void;
128
+ export const __wbg_wasmrootwalletkeys_free: (a: number, b: number) => void;
129
+ export const __wbg_wasmutxonamespace_free: (a: number, b: number) => void;
130
+ export const wasmreplayprotection_from_addresses: (a: number, b: number, c: number, d: number, e: number) => void;
131
+ export const wasmreplayprotection_from_output_scripts: (a: number, b: number) => number;
132
+ export const wasmreplayprotection_from_public_keys: (a: number, b: number, c: number) => void;
133
+ export const wasmrootwalletkeys_backup_key: (a: number) => number;
134
+ export const wasmrootwalletkeys_bitgo_key: (a: number) => number;
135
+ export const wasmrootwalletkeys_new: (a: number, b: number, c: number, d: number) => void;
136
+ export const wasmrootwalletkeys_user_key: (a: number) => number;
137
+ export const wasmrootwalletkeys_with_derivation_prefixes: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
138
+ export const wasmutxonamespace_get_wasm_utxo_version: (a: number) => void;
4
139
  export const __wbg_wrapdescriptor_free: (a: number, b: number) => void;
5
140
  export const __wbg_wrapminiscript_free: (a: number, b: number) => void;
6
141
  export const wrapdescriptor_atDerivationIndex: (a: number, b: number, c: number) => void;
@@ -24,8 +159,8 @@ export const __wbg_bip322namespace_free: (a: number, b: number) => void;
24
159
  export const __wbg_bitgopsbt_free: (a: number, b: number) => void;
25
160
  export const __wbg_fixedscriptwalletnamespace_free: (a: number, b: number) => void;
26
161
  export const __wbg_messagenamespace_free: (a: number, b: number) => void;
27
- export const __wbg_wasmbip32_free: (a: number, b: number) => void;
28
- export const __wbg_wasmdashtransaction_free: (a: number, b: number) => void;
162
+ export const __wbg_utxolibcompatnamespace_free: (a: number, b: number) => void;
163
+ export const __wbg_wasmdimensions_free: (a: number, b: number) => void;
29
164
  export const bip322namespace_add_bip322_input: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number) => void;
30
165
  export const bip322namespace_get_bip322_message: (a: number, b: number, c: number) => void;
31
166
  export const bip322namespace_verify_bip322_psbt_input: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
@@ -60,8 +195,11 @@ export const bitgopsbt_from_bytes: (a: number, b: number, c: number, d: number,
60
195
  export const bitgopsbt_from_half_signed_legacy_transaction: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
61
196
  export const bitgopsbt_generate_musig2_nonces: (a: number, b: number, c: number, d: number, e: number) => void;
62
197
  export const bitgopsbt_get_global_xpubs: (a: number) => number;
198
+ export const bitgopsbt_get_input_kv: (a: number, b: number, c: number, d: number) => void;
63
199
  export const bitgopsbt_get_inputs: (a: number, b: number) => void;
200
+ export const bitgopsbt_get_kv: (a: number, b: number, c: number) => void;
64
201
  export const bitgopsbt_get_network_type: (a: number, b: number) => void;
202
+ export const bitgopsbt_get_output_kv: (a: number, b: number, c: number, d: number) => void;
65
203
  export const bitgopsbt_get_outputs: (a: number, b: number) => void;
66
204
  export const bitgopsbt_get_outputs_with_address: (a: number, b: number) => void;
67
205
  export const bitgopsbt_input_count: (a: number) => number;
@@ -74,6 +212,9 @@ export const bitgopsbt_parse_transaction_with_wallet_keys: (a: number, b: number
74
212
  export const bitgopsbt_remove_input: (a: number, b: number, c: number) => void;
75
213
  export const bitgopsbt_remove_output: (a: number, b: number, c: number) => void;
76
214
  export const bitgopsbt_serialize: (a: number, b: number) => void;
215
+ export const bitgopsbt_set_input_kv: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
216
+ export const bitgopsbt_set_kv: (a: number, b: number, c: number, d: number, e: number) => void;
217
+ export const bitgopsbt_set_output_kv: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
77
218
  export const bitgopsbt_sign_all_musig2_inputs: (a: number, b: number, c: number) => void;
78
219
  export const bitgopsbt_sign_all_replay_protection_inputs: (a: number, b: number, c: number) => void;
79
220
  export const bitgopsbt_sign_all_wallet_inputs: (a: number, b: number, c: number) => void;
@@ -82,7 +223,7 @@ export const bitgopsbt_sign_single_input_with_privkey: (a: number, b: number, c:
82
223
  export const bitgopsbt_sign_single_input_with_xpriv: (a: number, b: number, c: number, d: number) => void;
83
224
  export const bitgopsbt_sign_with_privkey: (a: number, b: number, c: number, d: number) => void;
84
225
  export const bitgopsbt_sign_with_xpriv: (a: number, b: number, c: number, d: number) => void;
85
- export const bitgopsbt_unsigned_txid: (a: number, b: number) => void;
226
+ export const bitgopsbt_unsigned_tx_id: (a: number, b: number) => void;
86
227
  export const bitgopsbt_verify_replay_protection_signature: (a: number, b: number, c: number, d: number) => void;
87
228
  export const bitgopsbt_verify_signature_with_pub: (a: number, b: number, c: number, d: number) => void;
88
229
  export const bitgopsbt_verify_signature_with_xpub: (a: number, b: number, c: number, d: number) => void;
@@ -92,112 +233,16 @@ export const fixedscriptwalletnamespace_address: (a: number, b: number, c: numbe
92
233
  export const fixedscriptwalletnamespace_address_with_network_str: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
93
234
  export const fixedscriptwalletnamespace_chain_code_table: () => number;
94
235
  export const fixedscriptwalletnamespace_create_op_return_script: (a: number, b: number, c: number) => void;
236
+ export const fixedscriptwalletnamespace_get_bitgo_key_subtypes: () => number;
95
237
  export const fixedscriptwalletnamespace_output_script: (a: number, b: number, c: number, d: number, e: number) => void;
96
238
  export const fixedscriptwalletnamespace_output_script_with_network_str: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
97
239
  export const fixedscriptwalletnamespace_p2sh_p2pk_output_script: (a: number, b: number, c: number) => void;
98
240
  export const fixedscriptwalletnamespace_supports_script_type: (a: number, b: number, c: number, d: number, e: number) => void;
99
241
  export const fixedscriptwalletnamespace_to_wallet_keys: (a: number, b: number, c: number, d: number, e: number) => void;
100
- export const isInspectEnabled: () => number;
101
242
  export const messagenamespace_sign_message: (a: number, b: number, c: number, d: number) => void;
102
243
  export const messagenamespace_verify_message: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
103
- export const parsePsbtRawToJson: (a: number, b: number, c: number, d: number, e: number) => void;
104
- export const wasmbip32_chain_code: (a: number) => number;
105
- export const wasmbip32_depth: (a: number) => number;
106
- export const wasmbip32_derive: (a: number, b: number, c: number) => void;
107
- export const wasmbip32_derive_hardened: (a: number, b: number, c: number) => void;
108
- export const wasmbip32_derive_path: (a: number, b: number, c: number, d: number) => void;
109
- export const wasmbip32_equals: (a: number, b: number) => number;
110
- export const wasmbip32_fingerprint: (a: number) => number;
111
- export const wasmbip32_from_base58: (a: number, b: number, c: number) => void;
112
- export const wasmbip32_from_bip32_interface: (a: number, b: number) => void;
113
- export const wasmbip32_from_seed: (a: number, b: number, c: number, d: number, e: number) => void;
114
- export const wasmbip32_from_seed_sha256: (a: number, b: number, c: number, d: number, e: number) => void;
115
- export const wasmbip32_from_xprv: (a: number, b: number, c: number) => void;
116
- export const wasmbip32_from_xpub: (a: number, b: number, c: number) => void;
117
- export const wasmbip32_identifier: (a: number) => number;
118
- export const wasmbip32_index: (a: number) => number;
119
- export const wasmbip32_is_neutered: (a: number) => number;
120
- export const wasmbip32_neutered: (a: number) => number;
121
- export const wasmbip32_parent_fingerprint: (a: number) => number;
122
- export const wasmbip32_private_key: (a: number) => number;
123
- export const wasmbip32_public_key: (a: number) => number;
124
- export const wasmbip32_to_base58: (a: number, b: number) => void;
125
- export const wasmbip32_to_wif: (a: number, b: number) => void;
126
- export const wasmdashtransaction_from_bytes: (a: number, b: number, c: number) => void;
127
- export const wasmdashtransaction_get_inputs: (a: number, b: number) => void;
128
- export const wasmdashtransaction_get_outputs: (a: number, b: number) => void;
129
- export const wasmdashtransaction_get_outputs_with_address: (a: number, b: number, c: number, d: number) => void;
130
- export const wasmdashtransaction_get_txid: (a: number, b: number) => void;
131
- export const wasmdashtransaction_input_count: (a: number) => number;
132
- export const wasmdashtransaction_lock_time: (a: number) => number;
133
- export const wasmdashtransaction_output_count: (a: number) => number;
134
- export const wasmdashtransaction_to_bytes: (a: number, b: number) => void;
135
- export const wasmdashtransaction_version: (a: number) => number;
136
- export const wasmbip32_from_bip32_properties: (a: number, b: number) => void;
137
- export const bitgopsbt_sign_wallet_input: (a: number, b: number, c: number, d: number) => void;
138
- export const parsePsbtToJson: (a: number, b: number, c: number, d: number, e: number) => void;
139
- export const parseTxToJson: (a: number, b: number, c: number, d: number, e: number) => void;
140
- export const bitgopsbt_sign_all_with_xpriv: (a: number, b: number, c: number) => void;
141
- export const bitgopsbt_sign_replay_protection_inputs: (a: number, b: number, c: number) => void;
142
- export const __wbg_addressnamespace_free: (a: number, b: number) => void;
143
- export const __wbg_inscriptionsnamespace_free: (a: number, b: number) => void;
144
- export const __wbg_utxolibcompatnamespace_free: (a: number, b: number) => void;
145
- export const __wbg_wasmecpair_free: (a: number, b: number) => void;
146
- export const __wbg_wasmreplayprotection_free: (a: number, b: number) => void;
147
- export const __wbg_wrappsbt_free: (a: number, b: number) => void;
148
- export const addressnamespace_from_output_script_with_coin: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
149
- export const addressnamespace_to_output_script_with_coin: (a: number, b: number, c: number, d: number, e: number) => void;
150
- export const inscriptionsnamespace_create_inscription_reveal_data: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
151
- export const inscriptionsnamespace_sign_reveal_transaction: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: bigint) => void;
152
244
  export const utxolibcompatnamespace_from_output_script: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
153
245
  export const utxolibcompatnamespace_to_output_script: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
154
- export const wasmecpair_from_private_key: (a: number, b: number, c: number) => void;
155
- export const wasmecpair_from_public_key: (a: number, b: number, c: number) => void;
156
- export const wasmecpair_from_wif: (a: number, b: number, c: number) => void;
157
- export const wasmecpair_from_wif_mainnet: (a: number, b: number, c: number) => void;
158
- export const wasmecpair_from_wif_testnet: (a: number, b: number, c: number) => void;
159
- export const wasmecpair_private_key: (a: number) => number;
160
- export const wasmecpair_public_key: (a: number) => number;
161
- export const wasmecpair_to_wif: (a: number, b: number) => void;
162
- export const wasmecpair_to_wif_mainnet: (a: number, b: number) => void;
163
- export const wasmecpair_to_wif_testnet: (a: number, b: number) => void;
164
- export const wasmreplayprotection_from_addresses: (a: number, b: number, c: number, d: number, e: number) => void;
165
- export const wasmreplayprotection_from_output_scripts: (a: number, b: number) => number;
166
- export const wasmreplayprotection_from_public_keys: (a: number, b: number, c: number) => void;
167
- export const wrappsbt_add_input: (a: number, b: number, c: number, d: number, e: number, f: bigint, g: number, h: number, i: number) => void;
168
- export const wrappsbt_add_input_at_index: (a: number, b: number, c: number, d: number, e: number, f: number, g: bigint, h: number, i: number, j: number) => void;
169
- export const wrappsbt_add_output: (a: number, b: number, c: number, d: bigint) => number;
170
- export const wrappsbt_add_output_at_index: (a: number, b: number, c: number, d: number, e: number, f: bigint) => void;
171
- export const wrappsbt_clone: (a: number) => number;
172
- export const wrappsbt_deserialize: (a: number, b: number, c: number) => void;
173
- export const wrappsbt_extract_transaction: (a: number, b: number) => void;
174
- export const wrappsbt_finalize_mut: (a: number, b: number) => void;
175
- export const wrappsbt_get_global_xpubs: (a: number) => number;
176
- export const wrappsbt_get_inputs: (a: number, b: number) => void;
177
- export const wrappsbt_get_outputs: (a: number, b: number) => void;
178
- export const wrappsbt_get_outputs_with_address: (a: number, b: number, c: number, d: number) => void;
179
- export const wrappsbt_get_partial_signatures: (a: number, b: number, c: number) => void;
180
- export const wrappsbt_get_unsigned_tx: (a: number, b: number) => void;
181
- export const wrappsbt_has_partial_signatures: (a: number, b: number, c: number) => void;
182
- export const wrappsbt_input_count: (a: number) => number;
183
- export const wrappsbt_lock_time: (a: number) => number;
184
- export const wrappsbt_new: (a: number, b: number) => number;
185
- export const wrappsbt_output_count: (a: number) => number;
186
- export const wrappsbt_remove_input: (a: number, b: number, c: number) => void;
187
- export const wrappsbt_remove_output: (a: number, b: number, c: number) => void;
188
- export const wrappsbt_serialize: (a: number, b: number) => void;
189
- export const wrappsbt_sign_all: (a: number, b: number, c: number) => void;
190
- export const wrappsbt_sign_all_with_ecpair: (a: number, b: number, c: number) => void;
191
- export const wrappsbt_sign_with_prv: (a: number, b: number, c: number, d: number) => void;
192
- export const wrappsbt_sign_with_xprv: (a: number, b: number, c: number, d: number) => void;
193
- export const wrappsbt_unsigned_tx_id: (a: number, b: number) => void;
194
- export const wrappsbt_update_input_with_descriptor: (a: number, b: number, c: number, d: number) => void;
195
- export const wrappsbt_update_output_with_descriptor: (a: number, b: number, c: number, d: number) => void;
196
- export const wrappsbt_validate_signature_at_input: (a: number, b: number, c: number, d: number, e: number) => void;
197
- export const wrappsbt_verify_signature_with_key: (a: number, b: number, c: number, d: number) => void;
198
- export const wrappsbt_version: (a: number) => number;
199
- export const __wbg_wasmdimensions_free: (a: number, b: number) => void;
200
- export const __wbg_wasmrootwalletkeys_free: (a: number, b: number) => void;
201
246
  export const wasmdimensions_empty: () => number;
202
247
  export const wasmdimensions_from_input: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
203
248
  export const wasmdimensions_from_input_script_type: (a: number, b: number, c: number, d: number) => void;
@@ -213,39 +258,9 @@ export const wasmdimensions_get_weight: (a: number, b: number, c: number) => num
213
258
  export const wasmdimensions_has_segwit: (a: number) => number;
214
259
  export const wasmdimensions_plus: (a: number, b: number) => number;
215
260
  export const wasmdimensions_times: (a: number, b: number) => number;
216
- export const wasmrootwalletkeys_backup_key: (a: number) => number;
217
- export const wasmrootwalletkeys_bitgo_key: (a: number) => number;
218
- export const wasmrootwalletkeys_new: (a: number, b: number, c: number, d: number) => void;
219
- export const wasmrootwalletkeys_user_key: (a: number) => number;
220
- export const wasmrootwalletkeys_with_derivation_prefixes: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
221
- export const __wbg_wasmtransaction_free: (a: number, b: number) => void;
222
- export const __wbg_wasmzcashtransaction_free: (a: number, b: number) => void;
223
- export const wasmtransaction_add_input: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
224
- export const wasmtransaction_add_input_at_index: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
225
- export const wasmtransaction_add_output: (a: number, b: number, c: number, d: bigint) => number;
226
- export const wasmtransaction_add_output_at_index: (a: number, b: number, c: number, d: number, e: number, f: bigint) => void;
227
- export const wasmtransaction_create: () => number;
228
- export const wasmtransaction_from_bytes: (a: number, b: number, c: number) => void;
229
- export const wasmtransaction_get_inputs: (a: number, b: number) => void;
230
- export const wasmtransaction_get_outputs: (a: number, b: number) => void;
231
- export const wasmtransaction_get_outputs_with_address: (a: number, b: number, c: number, d: number) => void;
232
- export const wasmtransaction_get_txid: (a: number, b: number) => void;
233
- export const wasmtransaction_get_vsize: (a: number) => number;
234
- export const wasmtransaction_input_count: (a: number) => number;
235
- export const wasmtransaction_lock_time: (a: number) => number;
236
- export const wasmtransaction_output_count: (a: number) => number;
237
- export const wasmtransaction_to_bytes: (a: number, b: number) => void;
238
- export const wasmtransaction_version: (a: number) => number;
239
- export const wasmzcashtransaction_from_bytes: (a: number, b: number, c: number) => void;
240
- export const wasmzcashtransaction_get_inputs: (a: number, b: number) => void;
241
- export const wasmzcashtransaction_get_outputs: (a: number, b: number) => void;
242
- export const wasmzcashtransaction_get_outputs_with_address: (a: number, b: number, c: number, d: number) => void;
243
- export const wasmzcashtransaction_get_txid: (a: number, b: number) => void;
244
- export const wasmzcashtransaction_to_bytes: (a: number, b: number) => void;
245
- export const wasmzcashtransaction_input_count: (a: number) => number;
246
- export const wasmzcashtransaction_output_count: (a: number) => number;
247
- export const wasmzcashtransaction_lock_time: (a: number) => number;
248
- export const wasmzcashtransaction_version: (a: number) => number;
261
+ export const bitgopsbt_sign_wallet_input: (a: number, b: number, c: number, d: number) => void;
262
+ export const bitgopsbt_sign_replay_protection_inputs: (a: number, b: number, c: number) => void;
263
+ export const bitgopsbt_sign_all_with_xpriv: (a: number, b: number, c: number) => void;
249
264
  export const rustsecp256k1_v0_10_0_context_create: (a: number) => number;
250
265
  export const rustsecp256k1_v0_10_0_context_destroy: (a: number) => void;
251
266
  export const rustsecp256k1_v0_10_0_default_error_callback_fn: (a: number, b: number) => void;
@@ -1,35 +1,23 @@
1
- import { WrapPsbt as WasmPsbt, type WasmBIP32, type WasmECPair, type WrapDescriptor, type PsbtInputData, type PsbtOutputData, type PsbtOutputDataWithAddress } from "../wasm/wasm_utxo.js";
1
+ import { WrapPsbt as WasmPsbt, type WasmBIP32, type WasmECPair, type WrapDescriptor, type PsbtOutputDataWithAddress } from "../wasm/wasm_utxo.js";
2
2
  import type { IPsbt } from "../psbt.js";
3
3
  import type { CoinName } from "../coinName.js";
4
- import type { BIP32 } from "../bip32.js";
5
4
  import { Transaction } from "../transaction.js";
5
+ import { PsbtBase } from "../psbtBase.js";
6
6
  export type SignPsbtResult = {
7
7
  [inputIndex: number]: [pubkey: string][];
8
8
  };
9
- export declare class Psbt implements IPsbt {
10
- private _wasm;
9
+ export declare class Psbt extends PsbtBase<WasmPsbt> implements IPsbt {
11
10
  constructor(versionOrWasm?: number | WasmPsbt, lockTime?: number);
12
11
  /** @internal Access the underlying WASM instance */
13
12
  get wasm(): WasmPsbt;
14
13
  static create(version?: number, lockTime?: number): Psbt;
15
14
  static deserialize(bytes: Uint8Array): Psbt;
16
- serialize(): Uint8Array;
17
15
  clone(): Psbt;
18
- inputCount(): number;
19
- outputCount(): number;
20
- version(): number;
21
- lockTime(): number;
22
- unsignedTxId(): string;
23
- getInputs(): PsbtInputData[];
24
- getOutputs(): PsbtOutputData[];
25
- getGlobalXpubs(): BIP32[];
26
16
  getOutputsWithAddress(coin: CoinName): PsbtOutputDataWithAddress[];
27
17
  addInputAtIndex(index: number, txid: string, vout: number, value: bigint, script: Uint8Array, sequence?: number): number;
28
18
  addInput(txid: string, vout: number, value: bigint, script: Uint8Array, sequence?: number): number;
29
19
  addOutputAtIndex(index: number, script: Uint8Array, value: bigint): number;
30
20
  addOutput(script: Uint8Array, value: bigint): number;
31
- removeInput(index: number): void;
32
- removeOutput(index: number): void;
33
21
  updateInputWithDescriptor(inputIndex: number, descriptor: WrapDescriptor): void;
34
22
  updateOutputWithDescriptor(outputIndex: number, descriptor: WrapDescriptor): void;
35
23
  signWithXprv(xprv: string): SignPsbtResult;
@@ -1,14 +1,9 @@
1
1
  import { WrapPsbt as WasmPsbt, } from "../wasm/wasm_utxo.js";
2
2
  import { Transaction } from "../transaction.js";
3
- export class Psbt {
4
- _wasm;
3
+ import { PsbtBase } from "../psbtBase.js";
4
+ export class Psbt extends PsbtBase {
5
5
  constructor(versionOrWasm, lockTime) {
6
- if (versionOrWasm instanceof WasmPsbt) {
7
- this._wasm = versionOrWasm;
8
- }
9
- else {
10
- this._wasm = new WasmPsbt(versionOrWasm, lockTime);
11
- }
6
+ super(versionOrWasm instanceof WasmPsbt ? versionOrWasm : new WasmPsbt(versionOrWasm, lockTime));
12
7
  }
13
8
  /** @internal Access the underlying WASM instance */
14
9
  get wasm() {
@@ -22,37 +17,10 @@ export class Psbt {
22
17
  return new Psbt(WasmPsbt.deserialize(bytes));
23
18
  }
24
19
  // -- Serialization --
25
- serialize() {
26
- return this._wasm.serialize();
27
- }
28
20
  clone() {
29
21
  return new Psbt(this._wasm.clone());
30
22
  }
31
23
  // -- IPsbt: introspection --
32
- inputCount() {
33
- return this._wasm.input_count();
34
- }
35
- outputCount() {
36
- return this._wasm.output_count();
37
- }
38
- version() {
39
- return this._wasm.version();
40
- }
41
- lockTime() {
42
- return this._wasm.lock_time();
43
- }
44
- unsignedTxId() {
45
- return this._wasm.unsigned_tx_id();
46
- }
47
- getInputs() {
48
- return this._wasm.get_inputs();
49
- }
50
- getOutputs() {
51
- return this._wasm.get_outputs();
52
- }
53
- getGlobalXpubs() {
54
- return this._wasm.get_global_xpubs();
55
- }
56
24
  getOutputsWithAddress(coin) {
57
25
  return this._wasm.get_outputs_with_address(coin);
58
26
  }
@@ -69,12 +37,6 @@ export class Psbt {
69
37
  addOutput(script, value) {
70
38
  return this._wasm.add_output(script, value);
71
39
  }
72
- removeInput(index) {
73
- this._wasm.remove_input(index);
74
- }
75
- removeOutput(index) {
76
- this._wasm.remove_output(index);
77
- }
78
40
  // -- Descriptor updates --
79
41
  updateInputWithDescriptor(inputIndex, descriptor) {
80
42
  this._wasm.update_input_with_descriptor(inputIndex, descriptor);
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Subtype constants for BitGo proprietary PSBT key-values.
3
+ * Values are loaded from the Rust enum at module init time — no duplication.
4
+ * The type shape is declared here for IDE support.
5
+ */
6
+ export type BitGoKeySubtypeMap = {
7
+ readonly ZecConsensusBranchId: number;
8
+ readonly Musig2ParticipantPubKeys: number;
9
+ readonly Musig2PubNonce: number;
10
+ readonly Musig2PartialSig: number;
11
+ readonly PayGoAddressAttestationProof: number;
12
+ readonly Bip322Message: number;
13
+ readonly WasmUtxoSignedWith: number;
14
+ };
15
+ export declare const BitGoKeySubtype: BitGoKeySubtypeMap;
16
+ export type BitGoKeySubtype = BitGoKeySubtypeMap[keyof BitGoKeySubtypeMap];
17
+ /**
18
+ * A composable PSBT key for use with `setKV` / `getKV` / `setInputKV` / `getInputKV` etc.
19
+ *
20
+ * - `"unknown"`: stored in the PSBT `unknown` map (raw BIP-174 key-value pair)
21
+ * - `"proprietary"`: stored in the PSBT `proprietary` map with an arbitrary prefix
22
+ * - `"bitgo"`: stored in the PSBT `proprietary` map with the `BITGO` prefix
23
+ */
24
+ export type PsbtKvKey = {
25
+ type: "unknown";
26
+ keyType: number;
27
+ data?: Uint8Array;
28
+ } | {
29
+ type: "proprietary";
30
+ prefix: Uint8Array;
31
+ subtype: number;
32
+ key?: Uint8Array;
33
+ } | {
34
+ type: "bitgo";
35
+ subtype: number;
36
+ key?: Uint8Array;
37
+ };
@@ -0,0 +1,2 @@
1
+ import { FixedScriptWalletNamespace } from "../wasm/wasm_utxo.js";
2
+ export const BitGoKeySubtype = FixedScriptWalletNamespace.get_bitgo_key_subtypes();
@@ -1,5 +1,6 @@
1
- import { BitGoPsbt as WasmBitGoPsbt, type PsbtInputData, type PsbtOutputData, type PsbtOutputDataWithAddress } from "../wasm/wasm_utxo.js";
1
+ import { BitGoPsbt as WasmBitGoPsbt, type PsbtOutputDataWithAddress } from "../wasm/wasm_utxo.js";
2
2
  import type { IPsbtWithAddress } from "../psbt.js";
3
+ import { PsbtBase } from "../psbtBase.js";
3
4
  import { type WalletKeysArg, RootWalletKeys } from "./RootWalletKeys.js";
4
5
  import { type ReplayProtectionArg } from "./ReplayProtection.js";
5
6
  import { type BIP32Arg, BIP32 } from "../bip32.js";
@@ -102,10 +103,12 @@ export type HydrationUnspent = {
102
103
  chain: number;
103
104
  index: number;
104
105
  value: bigint;
106
+ } | {
107
+ pubkey: Uint8Array;
108
+ value: bigint;
105
109
  };
106
- export declare class BitGoPsbt implements IPsbtWithAddress {
107
- protected _wasm: WasmBitGoPsbt;
108
- protected constructor(_wasm: WasmBitGoPsbt);
110
+ export declare class BitGoPsbt extends PsbtBase<WasmBitGoPsbt> implements IPsbtWithAddress {
111
+ protected constructor(wasm: WasmBitGoPsbt);
109
112
  /**
110
113
  * Get the underlying WASM instance
111
114
  * @internal - for use by other wasm-utxo modules
@@ -288,19 +291,6 @@ export declare class BitGoPsbt implements IPsbtWithAddress {
288
291
  */
289
292
  addReplayProtectionInputAtIndex(index: number, inputOptions: AddInputOptions, key: ECPairArg): number;
290
293
  addReplayProtectionInput(inputOptions: AddInputOptions, key: ECPairArg): number;
291
- removeInput(index: number): void;
292
- removeOutput(index: number): void;
293
- /**
294
- * Get the unsigned transaction ID
295
- * @returns The unsigned transaction ID
296
- */
297
- unsignedTxId(): string;
298
- /**
299
- * Get the transaction version
300
- * @returns The transaction version number
301
- */
302
- version(): number;
303
- lockTime(): number;
304
294
  /**
305
295
  * Parse transaction with wallet keys to identify wallet inputs/outputs
306
296
  * @param walletKeys - The wallet keys to use for identification
@@ -467,12 +457,6 @@ export declare class BitGoPsbt implements IPsbtWithAddress {
467
457
  * @throws Error if the input is not a replay protection input, index is out of bounds, or scripts are invalid
468
458
  */
469
459
  verifyReplayProtectionSignature(inputIndex: number, replayProtection: ReplayProtectionArg): boolean;
470
- /**
471
- * Serialize the PSBT to bytes
472
- *
473
- * @returns The serialized PSBT as a byte array
474
- */
475
- serialize(): Uint8Array;
476
460
  /**
477
461
  * Generate and store MuSig2 nonces for all MuSig2 inputs
478
462
  *
@@ -571,31 +555,6 @@ export declare class BitGoPsbt implements IPsbtWithAddress {
571
555
  * ```
572
556
  */
573
557
  getHalfSignedLegacyFormat(): Uint8Array;
574
- /**
575
- * Get the number of inputs in the PSBT
576
- * @returns The number of inputs
577
- */
578
- inputCount(): number;
579
- outputCount(): number;
580
- /**
581
- * Get all PSBT inputs as an array
582
- *
583
- * Returns raw PSBT input data including witness_utxo and derivation info.
584
- * For parsed transaction data with address identification, use
585
- * parseTransactionWithWalletKeys() instead.
586
- *
587
- * @returns Array of PsbtInputData objects
588
- */
589
- getInputs(): PsbtInputData[];
590
- /**
591
- * Get all PSBT outputs as an array
592
- *
593
- * Returns raw PSBT output data without address resolution.
594
- * For output data with addresses, use getOutputsWithAddress().
595
- *
596
- * @returns Array of PsbtOutputData objects
597
- */
598
- getOutputs(): PsbtOutputData[];
599
558
  /**
600
559
  * Get all PSBT outputs with resolved address strings
601
560
  *
@@ -613,10 +572,6 @@ export declare class BitGoPsbt implements IPsbtWithAddress {
613
572
  * ```
614
573
  */
615
574
  getOutputsWithAddress(): PsbtOutputDataWithAddress[];
616
- /**
617
- * Returns the unordered global xpubs from this PSBT as BIP32 instances.
618
- */
619
- getGlobalXpubs(): BIP32[];
620
575
  }
621
576
  /**
622
577
  * Extract sorted wallet keys from a PSBT's global xpub fields.