@bitgo/wasm-utxo 4.0.1 → 4.1.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 (32) hide show
  1. package/dist/cjs/js/descriptorWallet/Psbt.d.ts +7 -0
  2. package/dist/cjs/js/descriptorWallet/Psbt.js +18 -0
  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 +13 -0
  6. package/dist/cjs/js/fixedScriptWallet/BitGoPsbt.js +24 -0
  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/wasm/wasm_utxo.d.ts +51 -0
  13. package/dist/cjs/js/wasm/wasm_utxo.js +340 -10
  14. package/dist/cjs/js/wasm/wasm_utxo_bg.wasm +0 -0
  15. package/dist/cjs/js/wasm/wasm_utxo_bg.wasm.d.ts +156 -141
  16. package/dist/esm/js/descriptorWallet/Psbt.d.ts +7 -0
  17. package/dist/esm/js/descriptorWallet/Psbt.js +18 -0
  18. package/dist/esm/js/fixedScriptWallet/BitGoKeySubtype.d.ts +37 -0
  19. package/dist/esm/js/fixedScriptWallet/BitGoKeySubtype.js +2 -0
  20. package/dist/esm/js/fixedScriptWallet/BitGoPsbt.d.ts +13 -0
  21. package/dist/esm/js/fixedScriptWallet/BitGoPsbt.js +24 -0
  22. package/dist/esm/js/fixedScriptWallet/index.d.ts +1 -1
  23. package/dist/esm/js/fixedScriptWallet/index.js +1 -0
  24. package/dist/esm/js/index.d.ts +5 -0
  25. package/dist/esm/js/index.js +4 -0
  26. package/dist/esm/js/psbt.d.ts +7 -0
  27. package/dist/esm/js/wasm/wasm_utxo.d.ts +51 -0
  28. package/dist/esm/js/wasm/wasm_utxo.js +1 -1
  29. package/dist/esm/js/wasm/wasm_utxo_bg.js +339 -10
  30. package/dist/esm/js/wasm/wasm_utxo_bg.wasm +0 -0
  31. package/dist/esm/js/wasm/wasm_utxo_bg.wasm.d.ts +156 -141
  32. package/package.json +1 -1
@@ -1,31 +1,137 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
- export const __wbg_wrapdescriptor_free: (a: number, b: number) => void;
5
- export const __wbg_wrapminiscript_free: (a: number, b: number) => void;
6
- export const wrapdescriptor_atDerivationIndex: (a: number, b: number, c: number) => void;
7
- export const wrapdescriptor_descType: (a: number, b: number) => void;
8
- export const wrapdescriptor_encode: (a: number, b: number) => void;
9
- export const wrapdescriptor_fromString: (a: number, b: number, c: number, d: number, e: number) => void;
10
- export const wrapdescriptor_fromStringDetectType: (a: number, b: number, c: number) => void;
11
- export const wrapdescriptor_hasWildcard: (a: number) => number;
12
- export const wrapdescriptor_maxWeightToSatisfy: (a: number, b: number) => void;
13
- export const wrapdescriptor_node: (a: number, b: number) => void;
14
- export const wrapdescriptor_scriptPubkey: (a: number, b: number) => void;
15
- export const wrapdescriptor_toAsmString: (a: number, b: number) => void;
16
- export const wrapdescriptor_toString: (a: number, b: number) => void;
17
- export const wrapminiscript_encode: (a: number, b: number) => void;
18
- export const wrapminiscript_fromBitcoinScript: (a: number, b: number, c: number, d: number, e: number) => void;
19
- export const wrapminiscript_fromString: (a: number, b: number, c: number, d: number, e: number) => void;
20
- export const wrapminiscript_node: (a: number, b: number) => void;
21
- export const wrapminiscript_toAsmString: (a: number, b: number) => void;
22
- export const wrapminiscript_toString: (a: number, b: number) => void;
4
+ export const __wbg_addressnamespace_free: (a: number, b: number) => void;
5
+ export const __wbg_utxolibcompatnamespace_free: (a: number, b: number) => void;
6
+ export const __wbg_wasmdashtransaction_free: (a: number, b: number) => void;
7
+ export const __wbg_wasmdimensions_free: (a: number, b: number) => void;
8
+ export const __wbg_wasmtransaction_free: (a: number, b: number) => void;
9
+ export const __wbg_wasmzcashtransaction_free: (a: number, b: number) => void;
10
+ export const __wbg_wrappsbt_free: (a: number, b: number) => void;
11
+ export const addressnamespace_from_output_script_with_coin: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
12
+ export const addressnamespace_to_output_script_with_coin: (a: number, b: number, c: number, d: number, e: number) => void;
13
+ export const utxolibcompatnamespace_from_output_script: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
14
+ export const utxolibcompatnamespace_to_output_script: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
15
+ export const wasmdashtransaction_from_bytes: (a: number, b: number, c: number) => void;
16
+ export const wasmdashtransaction_get_inputs: (a: number, b: number) => void;
17
+ export const wasmdashtransaction_get_outputs: (a: number, b: number) => void;
18
+ export const wasmdashtransaction_get_outputs_with_address: (a: number, b: number, c: number, d: number) => void;
19
+ export const wasmdashtransaction_get_txid: (a: number, b: number) => void;
20
+ export const wasmdashtransaction_input_count: (a: number) => number;
21
+ export const wasmdashtransaction_lock_time: (a: number) => number;
22
+ export const wasmdashtransaction_output_count: (a: number) => number;
23
+ export const wasmdashtransaction_to_bytes: (a: number, b: number) => void;
24
+ export const wasmdashtransaction_version: (a: number) => number;
25
+ export const wasmdimensions_empty: () => number;
26
+ export const wasmdimensions_from_input: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
27
+ export const wasmdimensions_from_input_script_type: (a: number, b: number, c: number, d: number) => void;
28
+ export const wasmdimensions_from_output_script_length: (a: number) => number;
29
+ export const wasmdimensions_from_output_script_type: (a: number, b: number, c: number) => void;
30
+ export const wasmdimensions_from_psbt: (a: number, b: number) => void;
31
+ export const wasmdimensions_get_input_vsize: (a: number, b: number, c: number) => number;
32
+ export const wasmdimensions_get_input_weight: (a: number, b: number, c: number) => number;
33
+ export const wasmdimensions_get_output_vsize: (a: number) => number;
34
+ export const wasmdimensions_get_output_weight: (a: number) => number;
35
+ export const wasmdimensions_get_vsize: (a: number, b: number, c: number) => number;
36
+ export const wasmdimensions_get_weight: (a: number, b: number, c: number) => number;
37
+ export const wasmdimensions_has_segwit: (a: number) => number;
38
+ export const wasmdimensions_plus: (a: number, b: number) => number;
39
+ export const wasmdimensions_times: (a: number, b: number) => number;
40
+ export const wasmtransaction_add_input: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
41
+ export const wasmtransaction_add_input_at_index: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
42
+ export const wasmtransaction_add_output: (a: number, b: number, c: number, d: bigint) => number;
43
+ export const wasmtransaction_add_output_at_index: (a: number, b: number, c: number, d: number, e: number, f: bigint) => void;
44
+ export const wasmtransaction_create: () => number;
45
+ export const wasmtransaction_from_bytes: (a: number, b: number, c: number) => void;
46
+ export const wasmtransaction_get_inputs: (a: number, b: number) => void;
47
+ export const wasmtransaction_get_outputs: (a: number, b: number) => void;
48
+ export const wasmtransaction_get_outputs_with_address: (a: number, b: number, c: number, d: number) => void;
49
+ export const wasmtransaction_get_txid: (a: number, b: number) => void;
50
+ export const wasmtransaction_get_vsize: (a: number) => number;
51
+ export const wasmtransaction_to_bytes: (a: number, b: number) => void;
52
+ export const wasmzcashtransaction_from_bytes: (a: number, b: number, c: number) => void;
53
+ export const wasmzcashtransaction_get_inputs: (a: number, b: number) => void;
54
+ export const wasmzcashtransaction_get_outputs: (a: number, b: number) => void;
55
+ export const wasmzcashtransaction_get_outputs_with_address: (a: number, b: number, c: number, d: number) => void;
56
+ export const wasmzcashtransaction_get_txid: (a: number, b: number) => void;
57
+ export const wasmzcashtransaction_to_bytes: (a: number, b: number) => void;
58
+ export const wrappsbt_add_input: (a: number, b: number, c: number, d: number, e: number, f: bigint, g: number, h: number, i: number) => void;
59
+ 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;
60
+ export const wrappsbt_add_output: (a: number, b: number, c: number, d: bigint) => number;
61
+ export const wrappsbt_add_output_at_index: (a: number, b: number, c: number, d: number, e: number, f: bigint) => void;
62
+ export const wrappsbt_clone: (a: number) => number;
63
+ export const wrappsbt_deserialize: (a: number, b: number, c: number) => void;
64
+ export const wrappsbt_extract_transaction: (a: number, b: number) => void;
65
+ export const wrappsbt_finalize_mut: (a: number, b: number) => void;
66
+ export const wrappsbt_get_global_xpubs: (a: number) => number;
67
+ export const wrappsbt_get_input_kv: (a: number, b: number, c: number, d: number) => void;
68
+ export const wrappsbt_get_inputs: (a: number, b: number) => void;
69
+ export const wrappsbt_get_kv: (a: number, b: number, c: number) => void;
70
+ export const wrappsbt_get_output_kv: (a: number, b: number, c: number, d: number) => void;
71
+ export const wrappsbt_get_outputs: (a: number, b: number) => void;
72
+ export const wrappsbt_get_outputs_with_address: (a: number, b: number, c: number, d: number) => void;
73
+ export const wrappsbt_get_partial_signatures: (a: number, b: number, c: number) => void;
74
+ export const wrappsbt_get_unsigned_tx: (a: number, b: number) => void;
75
+ export const wrappsbt_has_partial_signatures: (a: number, b: number, c: number) => void;
76
+ export const wrappsbt_input_count: (a: number) => number;
77
+ export const wrappsbt_new: (a: number, b: number) => number;
78
+ export const wrappsbt_output_count: (a: number) => number;
79
+ export const wrappsbt_remove_input: (a: number, b: number, c: number) => void;
80
+ export const wrappsbt_remove_output: (a: number, b: number, c: number) => void;
81
+ export const wrappsbt_serialize: (a: number, b: number) => void;
82
+ export const wrappsbt_set_input_kv: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
83
+ export const wrappsbt_set_kv: (a: number, b: number, c: number, d: number, e: number) => void;
84
+ export const wrappsbt_set_output_kv: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
85
+ export const wrappsbt_sign_all: (a: number, b: number, c: number) => void;
86
+ export const wrappsbt_sign_all_with_ecpair: (a: number, b: number, c: number) => void;
87
+ export const wrappsbt_sign_with_prv: (a: number, b: number, c: number, d: number) => void;
88
+ export const wrappsbt_sign_with_xprv: (a: number, b: number, c: number, d: number) => void;
89
+ export const wrappsbt_unsigned_tx_id: (a: number, b: number) => void;
90
+ export const wrappsbt_update_input_with_descriptor: (a: number, b: number, c: number, d: number) => void;
91
+ export const wrappsbt_update_output_with_descriptor: (a: number, b: number, c: number, d: number) => void;
92
+ export const wrappsbt_validate_signature_at_input: (a: number, b: number, c: number, d: number, e: number) => void;
93
+ export const wrappsbt_verify_signature_with_key: (a: number, b: number, c: number, d: number) => void;
94
+ export const wasmtransaction_input_count: (a: number) => number;
95
+ export const wasmtransaction_output_count: (a: number) => number;
96
+ export const wasmzcashtransaction_input_count: (a: number) => number;
97
+ export const wasmzcashtransaction_output_count: (a: number) => number;
98
+ export const wasmtransaction_lock_time: (a: number) => number;
99
+ export const wasmtransaction_version: (a: number) => number;
100
+ export const wasmzcashtransaction_lock_time: (a: number) => number;
101
+ export const wasmzcashtransaction_version: (a: number) => number;
102
+ export const wrappsbt_lock_time: (a: number) => number;
103
+ export const wrappsbt_version: (a: number) => number;
104
+ export const __wbg_messagenamespace_free: (a: number, b: number) => void;
105
+ export const __wbg_wasmecpair_free: (a: number, b: number) => void;
106
+ export const __wbg_wasmrootwalletkeys_free: (a: number, b: number) => void;
107
+ export const __wbg_wasmutxonamespace_free: (a: number, b: number) => void;
108
+ export const isInspectEnabled: () => number;
109
+ export const messagenamespace_sign_message: (a: number, b: number, c: number, d: number) => void;
110
+ export const messagenamespace_verify_message: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
111
+ export const parsePsbtRawToJson: (a: number, b: number, c: number, d: number, e: number) => void;
112
+ export const wasmecpair_from_private_key: (a: number, b: number, c: number) => void;
113
+ export const wasmecpair_from_public_key: (a: number, b: number, c: number) => void;
114
+ export const wasmecpair_from_wif: (a: number, b: number, c: number) => void;
115
+ export const wasmecpair_from_wif_mainnet: (a: number, b: number, c: number) => void;
116
+ export const wasmecpair_from_wif_testnet: (a: number, b: number, c: number) => void;
117
+ export const wasmecpair_private_key: (a: number) => number;
118
+ export const wasmecpair_public_key: (a: number) => number;
119
+ export const wasmecpair_to_wif: (a: number, b: number) => void;
120
+ export const wasmecpair_to_wif_mainnet: (a: number, b: number) => void;
121
+ export const wasmecpair_to_wif_testnet: (a: number, b: number) => void;
122
+ export const wasmrootwalletkeys_backup_key: (a: number) => number;
123
+ export const wasmrootwalletkeys_bitgo_key: (a: number) => number;
124
+ export const wasmrootwalletkeys_new: (a: number, b: number, c: number, d: number) => void;
125
+ export const wasmrootwalletkeys_user_key: (a: number) => number;
126
+ 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;
127
+ export const wasmutxonamespace_get_wasm_utxo_version: (a: number) => void;
128
+ export const parsePsbtToJson: (a: number, b: number, c: number, d: number, e: number) => void;
129
+ export const parseTxToJson: (a: number, b: number, c: number, d: number, e: number) => void;
23
130
  export const __wbg_bip322namespace_free: (a: number, b: number) => void;
24
131
  export const __wbg_bitgopsbt_free: (a: number, b: number) => void;
25
132
  export const __wbg_fixedscriptwalletnamespace_free: (a: number, b: number) => void;
26
- export const __wbg_messagenamespace_free: (a: number, b: number) => void;
27
133
  export const __wbg_wasmbip32_free: (a: number, b: number) => void;
28
- export const __wbg_wasmdashtransaction_free: (a: number, b: number) => void;
134
+ export const __wbg_wasmreplayprotection_free: (a: number, b: number) => void;
29
135
  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
136
  export const bip322namespace_get_bip322_message: (a: number, b: number, c: number) => void;
31
137
  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 +166,11 @@ export const bitgopsbt_from_bytes: (a: number, b: number, c: number, d: number,
60
166
  export const bitgopsbt_from_half_signed_legacy_transaction: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
61
167
  export const bitgopsbt_generate_musig2_nonces: (a: number, b: number, c: number, d: number, e: number) => void;
62
168
  export const bitgopsbt_get_global_xpubs: (a: number) => number;
169
+ export const bitgopsbt_get_input_kv: (a: number, b: number, c: number, d: number) => void;
63
170
  export const bitgopsbt_get_inputs: (a: number, b: number) => void;
171
+ export const bitgopsbt_get_kv: (a: number, b: number, c: number) => void;
64
172
  export const bitgopsbt_get_network_type: (a: number, b: number) => void;
173
+ export const bitgopsbt_get_output_kv: (a: number, b: number, c: number, d: number) => void;
65
174
  export const bitgopsbt_get_outputs: (a: number, b: number) => void;
66
175
  export const bitgopsbt_get_outputs_with_address: (a: number, b: number) => void;
67
176
  export const bitgopsbt_input_count: (a: number) => number;
@@ -74,6 +183,9 @@ export const bitgopsbt_parse_transaction_with_wallet_keys: (a: number, b: number
74
183
  export const bitgopsbt_remove_input: (a: number, b: number, c: number) => void;
75
184
  export const bitgopsbt_remove_output: (a: number, b: number, c: number) => void;
76
185
  export const bitgopsbt_serialize: (a: number, b: number) => void;
186
+ export const bitgopsbt_set_input_kv: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
187
+ export const bitgopsbt_set_kv: (a: number, b: number, c: number, d: number, e: number) => void;
188
+ export const bitgopsbt_set_output_kv: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
77
189
  export const bitgopsbt_sign_all_musig2_inputs: (a: number, b: number, c: number) => void;
78
190
  export const bitgopsbt_sign_all_replay_protection_inputs: (a: number, b: number, c: number) => void;
79
191
  export const bitgopsbt_sign_all_wallet_inputs: (a: number, b: number, c: number) => void;
@@ -92,15 +204,12 @@ export const fixedscriptwalletnamespace_address: (a: number, b: number, c: numbe
92
204
  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
205
  export const fixedscriptwalletnamespace_chain_code_table: () => number;
94
206
  export const fixedscriptwalletnamespace_create_op_return_script: (a: number, b: number, c: number) => void;
207
+ export const fixedscriptwalletnamespace_get_bitgo_key_subtypes: () => number;
95
208
  export const fixedscriptwalletnamespace_output_script: (a: number, b: number, c: number, d: number, e: number) => void;
96
209
  export const fixedscriptwalletnamespace_output_script_with_network_str: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
97
210
  export const fixedscriptwalletnamespace_p2sh_p2pk_output_script: (a: number, b: number, c: number) => void;
98
211
  export const fixedscriptwalletnamespace_supports_script_type: (a: number, b: number, c: number, d: number, e: number) => void;
99
212
  export const fixedscriptwalletnamespace_to_wallet_keys: (a: number, b: number, c: number, d: number, e: number) => void;
100
- export const isInspectEnabled: () => number;
101
- export const messagenamespace_sign_message: (a: number, b: number, c: number, d: number) => void;
102
- 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
213
  export const wasmbip32_chain_code: (a: number) => number;
105
214
  export const wasmbip32_depth: (a: number) => number;
106
215
  export const wasmbip32_derive: (a: number, b: number, c: number) => void;
@@ -123,129 +232,35 @@ export const wasmbip32_private_key: (a: number) => number;
123
232
  export const wasmbip32_public_key: (a: number) => number;
124
233
  export const wasmbip32_to_base58: (a: number, b: number) => void;
125
234
  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;
235
+ export const wasmreplayprotection_from_addresses: (a: number, b: number, c: number, d: number, e: number) => void;
236
+ export const wasmreplayprotection_from_output_scripts: (a: number, b: number) => number;
237
+ export const wasmreplayprotection_from_public_keys: (a: number, b: number, c: number) => void;
136
238
  export const wasmbip32_from_bip32_properties: (a: number, b: number) => void;
137
239
  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
240
  export const bitgopsbt_sign_all_with_xpriv: (a: number, b: number, c: number) => void;
141
241
  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
242
  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;
243
+ export const __wbg_wrapdescriptor_free: (a: number, b: number) => void;
244
+ export const __wbg_wrapminiscript_free: (a: number, b: number) => void;
150
245
  export const inscriptionsnamespace_create_inscription_reveal_data: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
151
246
  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
- export const utxolibcompatnamespace_from_output_script: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
153
- 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
- export const wasmdimensions_empty: () => number;
202
- export const wasmdimensions_from_input: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
203
- export const wasmdimensions_from_input_script_type: (a: number, b: number, c: number, d: number) => void;
204
- export const wasmdimensions_from_output_script_length: (a: number) => number;
205
- export const wasmdimensions_from_output_script_type: (a: number, b: number, c: number) => void;
206
- export const wasmdimensions_from_psbt: (a: number, b: number) => void;
207
- export const wasmdimensions_get_input_vsize: (a: number, b: number, c: number) => number;
208
- export const wasmdimensions_get_input_weight: (a: number, b: number, c: number) => number;
209
- export const wasmdimensions_get_output_vsize: (a: number) => number;
210
- export const wasmdimensions_get_output_weight: (a: number) => number;
211
- export const wasmdimensions_get_vsize: (a: number, b: number, c: number) => number;
212
- export const wasmdimensions_get_weight: (a: number, b: number, c: number) => number;
213
- export const wasmdimensions_has_segwit: (a: number) => number;
214
- export const wasmdimensions_plus: (a: number, b: number) => number;
215
- 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;
247
+ export const wrapdescriptor_atDerivationIndex: (a: number, b: number, c: number) => void;
248
+ export const wrapdescriptor_descType: (a: number, b: number) => void;
249
+ export const wrapdescriptor_encode: (a: number, b: number) => void;
250
+ export const wrapdescriptor_fromString: (a: number, b: number, c: number, d: number, e: number) => void;
251
+ export const wrapdescriptor_fromStringDetectType: (a: number, b: number, c: number) => void;
252
+ export const wrapdescriptor_hasWildcard: (a: number) => number;
253
+ export const wrapdescriptor_maxWeightToSatisfy: (a: number, b: number) => void;
254
+ export const wrapdescriptor_node: (a: number, b: number) => void;
255
+ export const wrapdescriptor_scriptPubkey: (a: number, b: number) => void;
256
+ export const wrapdescriptor_toAsmString: (a: number, b: number) => void;
257
+ export const wrapdescriptor_toString: (a: number, b: number) => void;
258
+ export const wrapminiscript_encode: (a: number, b: number) => void;
259
+ export const wrapminiscript_fromBitcoinScript: (a: number, b: number, c: number, d: number, e: number) => void;
260
+ export const wrapminiscript_fromString: (a: number, b: number, c: number, d: number, e: number) => void;
261
+ export const wrapminiscript_node: (a: number, b: number) => void;
262
+ export const wrapminiscript_toAsmString: (a: number, b: number) => void;
263
+ export const wrapminiscript_toString: (a: number, b: 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,5 +1,6 @@
1
1
  import { WrapPsbt as WasmPsbt, type WasmBIP32, type WasmECPair, type WrapDescriptor, type PsbtInputData, type PsbtOutputData, type PsbtOutputDataWithAddress } from "../wasm/wasm_utxo.js";
2
2
  import type { IPsbt } from "../psbt.js";
3
+ import type { PsbtKvKey } from "../fixedScriptWallet/BitGoKeySubtype.js";
3
4
  import type { CoinName } from "../coinName.js";
4
5
  import type { BIP32 } from "../bip32.js";
5
6
  import { Transaction } from "../transaction.js";
@@ -30,6 +31,12 @@ export declare class Psbt implements IPsbt {
30
31
  addOutput(script: Uint8Array, value: bigint): number;
31
32
  removeInput(index: number): void;
32
33
  removeOutput(index: number): void;
34
+ setKV(key: PsbtKvKey, value: Uint8Array): void;
35
+ getKV(key: PsbtKvKey): Uint8Array | undefined;
36
+ setInputKV(index: number, key: PsbtKvKey, value: Uint8Array): void;
37
+ getInputKV(index: number, key: PsbtKvKey): Uint8Array | undefined;
38
+ setOutputKV(index: number, key: PsbtKvKey, value: Uint8Array): void;
39
+ getOutputKV(index: number, key: PsbtKvKey): Uint8Array | undefined;
33
40
  updateInputWithDescriptor(inputIndex: number, descriptor: WrapDescriptor): void;
34
41
  updateOutputWithDescriptor(outputIndex: number, descriptor: WrapDescriptor): void;
35
42
  signWithXprv(xprv: string): SignPsbtResult;
@@ -75,6 +75,24 @@ export class Psbt {
75
75
  removeOutput(index) {
76
76
  this._wasm.remove_output(index);
77
77
  }
78
+ setKV(key, value) {
79
+ this._wasm.set_kv(key, value);
80
+ }
81
+ getKV(key) {
82
+ return this._wasm.get_kv(key) ?? undefined;
83
+ }
84
+ setInputKV(index, key, value) {
85
+ this._wasm.set_input_kv(index, key, value);
86
+ }
87
+ getInputKV(index, key) {
88
+ return this._wasm.get_input_kv(index, key) ?? undefined;
89
+ }
90
+ setOutputKV(index, key, value) {
91
+ this._wasm.set_output_kv(index, key, value);
92
+ }
93
+ getOutputKV(index, key) {
94
+ return this._wasm.get_output_kv(index, key) ?? undefined;
95
+ }
78
96
  // -- Descriptor updates --
79
97
  updateInputWithDescriptor(inputIndex, descriptor) {
80
98
  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();
@@ -7,6 +7,7 @@ import { type ECPairArg } from "../ecpair.js";
7
7
  import type { UtxolibName } from "../utxolibCompat.js";
8
8
  import type { CoinName } from "../coinName.js";
9
9
  import type { InputScriptType } from "./scriptType.js";
10
+ import type { PsbtKvKey } from "./BitGoKeySubtype.js";
10
11
  import { type ITransaction } from "../transaction.js";
11
12
  export type { InputScriptType };
12
13
  export type NetworkName = UtxolibName | CoinName;
@@ -301,6 +302,18 @@ export declare class BitGoPsbt implements IPsbtWithAddress {
301
302
  */
302
303
  version(): number;
303
304
  lockTime(): number;
305
+ /** Set an arbitrary KV pair on the PSBT global map. */
306
+ setKV(key: PsbtKvKey, value: Uint8Array): void;
307
+ /** Get a KV value from the PSBT global map. Returns `undefined` if not present. */
308
+ getKV(key: PsbtKvKey): Uint8Array | undefined;
309
+ /** Set an arbitrary KV pair on a specific PSBT input. */
310
+ setInputKV(index: number, key: PsbtKvKey, value: Uint8Array): void;
311
+ /** Get a KV value from a specific PSBT input. Returns `undefined` if not present. */
312
+ getInputKV(index: number, key: PsbtKvKey): Uint8Array | undefined;
313
+ /** Set an arbitrary KV pair on a specific PSBT output. */
314
+ setOutputKV(index: number, key: PsbtKvKey, value: Uint8Array): void;
315
+ /** Get a KV value from a specific PSBT output. Returns `undefined` if not present. */
316
+ getOutputKV(index: number, key: PsbtKvKey): Uint8Array | undefined;
304
317
  /**
305
318
  * Parse transaction with wallet keys to identify wallet inputs/outputs
306
319
  * @param walletKeys - The wallet keys to use for identification
@@ -253,6 +253,30 @@ export class BitGoPsbt {
253
253
  lockTime() {
254
254
  return this._wasm.lock_time();
255
255
  }
256
+ /** Set an arbitrary KV pair on the PSBT global map. */
257
+ setKV(key, value) {
258
+ this._wasm.set_kv(key, value);
259
+ }
260
+ /** Get a KV value from the PSBT global map. Returns `undefined` if not present. */
261
+ getKV(key) {
262
+ return this._wasm.get_kv(key) ?? undefined;
263
+ }
264
+ /** Set an arbitrary KV pair on a specific PSBT input. */
265
+ setInputKV(index, key, value) {
266
+ this._wasm.set_input_kv(index, key, value);
267
+ }
268
+ /** Get a KV value from a specific PSBT input. Returns `undefined` if not present. */
269
+ getInputKV(index, key) {
270
+ return this._wasm.get_input_kv(index, key) ?? undefined;
271
+ }
272
+ /** Set an arbitrary KV pair on a specific PSBT output. */
273
+ setOutputKV(index, key, value) {
274
+ this._wasm.set_output_kv(index, key, value);
275
+ }
276
+ /** Get a KV value from a specific PSBT output. Returns `undefined` if not present. */
277
+ getOutputKV(index, key) {
278
+ return this._wasm.get_output_kv(index, key) ?? undefined;
279
+ }
256
280
  /**
257
281
  * Parse transaction with wallet keys to identify wallet inputs/outputs
258
282
  * @param walletKeys - The wallet keys to use for identification
@@ -6,8 +6,8 @@ export { Dimensions } from "./Dimensions.js";
6
6
  export { outputScriptTypes, inputScriptTypes, type OutputScriptType, type InputScriptType, type ScriptType, } from "./scriptType.js";
7
7
  export { ChainCode, chainCodes, assertChainCode, type Scope } from "./chains.js";
8
8
  export { BitGoPsbt, getWalletKeysFromPsbt, type NetworkName, type ScriptId, type ParsedInput, type ParsedOutput, type ParsedTransaction, type SignPath, type CreateEmptyOptions, type AddInputOptions, type AddOutputOptions, type AddWalletInputOptions, type AddWalletOutputOptions, type ParseTransactionOptions, type ParseOutputsOptions, type HydrationUnspent, } from "./BitGoPsbt.js";
9
+ export { BitGoKeySubtype, type PsbtKvKey } from "./BitGoKeySubtype.js";
9
10
  export { ZcashBitGoPsbt, type ZcashNetworkName, type CreateEmptyZcashOptions, } from "./ZcashBitGoPsbt.js";
10
- export type { PsbtBip32Derivation, PsbtInputData, PsbtOutputData, PsbtOutputDataWithAddress, PsbtWitnessUtxo, } from "../wasm/wasm_utxo.js";
11
11
  import type { ScriptType } from "./scriptType.js";
12
12
  /**
13
13
  * Check if a network supports a given fixed-script wallet script type
@@ -7,6 +7,7 @@ export { outputScriptTypes, inputScriptTypes, } from "./scriptType.js";
7
7
  export { ChainCode, chainCodes, assertChainCode } from "./chains.js";
8
8
  // Bitcoin-like PSBT (for all non-Zcash networks)
9
9
  export { BitGoPsbt, getWalletKeysFromPsbt, } from "./BitGoPsbt.js";
10
+ export { BitGoKeySubtype } from "./BitGoKeySubtype.js";
10
11
  // Zcash-specific PSBT subclass
11
12
  export { ZcashBitGoPsbt, } from "./ZcashBitGoPsbt.js";
12
13
  /**
@@ -11,6 +11,11 @@ export * as ecpair from "./ecpair.js";
11
11
  export { ECPair } from "./ecpair.js";
12
12
  export { BIP32 } from "./bip32.js";
13
13
  export { Dimensions } from "./fixedScriptWallet/Dimensions.js";
14
+ export type WasmUtxoVersionInfo = {
15
+ version: string;
16
+ gitHash: string;
17
+ };
18
+ export declare function getWasmUtxoVersion(): WasmUtxoVersionInfo;
14
19
  export { type CoinName, getMainnet, isMainnet, isTestnet, isCoinName } from "./coinName.js";
15
20
  export type { Triple } from "./triple.js";
16
21
  export type { AddressFormat } from "./address.js";
@@ -1,4 +1,5 @@
1
1
  import * as wasm from "./wasm/wasm_utxo.js";
2
+ import { WasmUtxoNamespace } from "./wasm/wasm_utxo.js";
2
3
  // we need to access the wasm module here, otherwise webpack gets all weird
3
4
  // and forgets to include it in the bundle
4
5
  void wasm;
@@ -18,6 +19,9 @@ export * as ecpair from "./ecpair.js";
18
19
  export { ECPair } from "./ecpair.js";
19
20
  export { BIP32 } from "./bip32.js";
20
21
  export { Dimensions } from "./fixedScriptWallet/Dimensions.js";
22
+ export function getWasmUtxoVersion() {
23
+ return WasmUtxoNamespace.get_wasm_utxo_version();
24
+ }
21
25
  export { getMainnet, isMainnet, isTestnet, isCoinName } from "./coinName.js";
22
26
  export { WrapDescriptor as Descriptor } from "./wasm/wasm_utxo.js";
23
27
  export { WrapMiniscript as Miniscript } from "./wasm/wasm_utxo.js";
@@ -1,6 +1,7 @@
1
1
  import type { PsbtInputData, PsbtOutputData, PsbtOutputDataWithAddress } from "./wasm/wasm_utxo.js";
2
2
  import type { BIP32 } from "./bip32.js";
3
3
  import type { ITransactionCommon } from "./transaction.js";
4
+ import type { PsbtKvKey } from "./fixedScriptWallet/BitGoKeySubtype.js";
4
5
  /** Common interface for PSBT types */
5
6
  export interface IPsbt extends ITransactionCommon<PsbtInputData, PsbtOutputData> {
6
7
  getGlobalXpubs(): BIP32[];
@@ -9,6 +10,12 @@ export interface IPsbt extends ITransactionCommon<PsbtInputData, PsbtOutputData>
9
10
  addOutputAtIndex(index: number, script: Uint8Array, value: bigint): number;
10
11
  removeInput(index: number): void;
11
12
  removeOutput(index: number): void;
13
+ setKV(key: PsbtKvKey, value: Uint8Array): void;
14
+ getKV(key: PsbtKvKey): Uint8Array | undefined;
15
+ setInputKV(index: number, key: PsbtKvKey, value: Uint8Array): void;
16
+ getInputKV(index: number, key: PsbtKvKey): Uint8Array | undefined;
17
+ setOutputKV(index: number, key: PsbtKvKey, value: Uint8Array): void;
18
+ getOutputKV(index: number, key: PsbtKvKey): Uint8Array | undefined;
12
19
  }
13
20
  /** Extended PSBT with address resolution (no coin parameter needed) */
14
21
  export interface IPsbtWithAddress extends IPsbt {