@bitgo/wasm-utxo 5.0.0 → 5.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.
- package/dist/cjs/js/descriptorWallet/psbt/findDescriptors.js +16 -12
- package/dist/cjs/js/fixedScriptWallet/ZcashBitGoPsbt.d.ts +12 -0
- package/dist/cjs/js/fixedScriptWallet/ZcashBitGoPsbt.js +13 -0
- package/dist/cjs/js/fixedScriptWallet/ZcashIronwoodBitGoPsbt.d.ts +3 -0
- package/dist/cjs/js/fixedScriptWallet/ZcashIronwoodBitGoPsbt.js +4 -0
- package/dist/cjs/js/fixedScriptWallet/ZcashPsbt.d.ts +15 -0
- package/dist/cjs/js/fixedScriptWallet/ZcashPsbt.js +24 -0
- package/dist/cjs/js/fixedScriptWallet/index.d.ts +2 -1
- package/dist/cjs/js/fixedScriptWallet/index.js +3 -1
- package/dist/cjs/js/index.d.ts +17 -0
- package/dist/cjs/js/index.js +8 -1
- package/dist/cjs/js/psbt.d.ts +2 -1
- package/dist/cjs/js/psbtBase.d.ts +3 -1
- package/dist/cjs/js/psbtBase.js +3 -0
- package/dist/cjs/js/wasm/wasm_utxo.d.ts +2 -0
- package/dist/cjs/js/wasm/wasm_utxo.js +38 -0
- package/dist/cjs/js/wasm/wasm_utxo_bg.wasm +0 -0
- package/dist/cjs/js/wasm/wasm_utxo_bg.wasm.d.ts +157 -155
- package/dist/esm/js/descriptorWallet/psbt/findDescriptors.js +16 -12
- package/dist/esm/js/fixedScriptWallet/ZcashBitGoPsbt.d.ts +12 -0
- package/dist/esm/js/fixedScriptWallet/ZcashBitGoPsbt.js +13 -0
- package/dist/esm/js/fixedScriptWallet/ZcashIronwoodBitGoPsbt.d.ts +3 -0
- package/dist/esm/js/fixedScriptWallet/ZcashIronwoodBitGoPsbt.js +4 -0
- package/dist/esm/js/fixedScriptWallet/ZcashPsbt.d.ts +15 -0
- package/dist/esm/js/fixedScriptWallet/ZcashPsbt.js +20 -0
- package/dist/esm/js/fixedScriptWallet/index.d.ts +2 -1
- package/dist/esm/js/fixedScriptWallet/index.js +1 -0
- package/dist/esm/js/index.d.ts +17 -0
- package/dist/esm/js/index.js +1 -0
- package/dist/esm/js/psbt.d.ts +2 -1
- package/dist/esm/js/psbtBase.d.ts +3 -1
- package/dist/esm/js/psbtBase.js +3 -0
- package/dist/esm/js/wasm/wasm_utxo.d.ts +2 -0
- package/dist/esm/js/wasm/wasm_utxo_bg.js +38 -0
- package/dist/esm/js/wasm/wasm_utxo_bg.wasm +0 -0
- package/dist/esm/js/wasm/wasm_utxo_bg.wasm.d.ts +157 -155
- package/package.json +1 -1
|
@@ -20,6 +20,162 @@ export const wasmdimensions_get_weight: (a: number, b: number, c: number) => num
|
|
|
20
20
|
export const wasmdimensions_has_segwit: (a: number) => number;
|
|
21
21
|
export const wasmdimensions_plus: (a: number, b: number) => number;
|
|
22
22
|
export const wasmdimensions_times: (a: number, b: number) => number;
|
|
23
|
+
export const __wbg_bitgopsbt_free: (a: number, b: number) => void;
|
|
24
|
+
export const __wbg_fixedscriptwalletnamespace_free: (a: number, b: number) => void;
|
|
25
|
+
export const __wbg_inscriptionsnamespace_free: (a: number, b: number) => void;
|
|
26
|
+
export const __wbg_wasmbip32_free: (a: number, b: number) => void;
|
|
27
|
+
export const bitgopsbt_add_input: (a: number, b: number, c: number, d: number, e: number, f: bigint, g: number, h: number, i: number, j: number, k: number) => void;
|
|
28
|
+
export const bitgopsbt_add_input_at_index: (a: number, b: number, c: number, d: number, e: number, f: number, g: bigint, h: number, i: number, j: number, k: number, l: number) => void;
|
|
29
|
+
export const bitgopsbt_add_ironwood_output: (a: number, b: number, c: number, d: number, e: bigint, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number) => void;
|
|
30
|
+
export const bitgopsbt_add_ironwood_outputs: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
31
|
+
export const bitgopsbt_add_ironwood_v6_signature: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
32
|
+
export const bitgopsbt_add_output: (a: number, b: number, c: number, d: number, e: bigint) => void;
|
|
33
|
+
export const bitgopsbt_add_output_at_index: (a: number, b: number, c: number, d: number, e: number, f: bigint) => void;
|
|
34
|
+
export const bitgopsbt_add_output_with_address: (a: number, b: number, c: number, d: number, e: bigint) => void;
|
|
35
|
+
export const bitgopsbt_add_output_with_address_at_index: (a: number, b: number, c: number, d: number, e: number, f: bigint) => void;
|
|
36
|
+
export const bitgopsbt_add_paygo_attestation: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
37
|
+
export const bitgopsbt_add_replay_protection_input: (a: number, b: number, c: number, d: number, e: number, f: number, g: bigint, h: number, i: number, j: number) => void;
|
|
38
|
+
export const bitgopsbt_add_replay_protection_input_at_index: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: bigint, i: number, j: number, k: number) => void;
|
|
39
|
+
export const bitgopsbt_add_transparent_output: (a: number, b: number, c: number, d: number, e: bigint, f: number, g: number) => void;
|
|
40
|
+
export const bitgopsbt_add_wallet_input: (a: number, b: number, c: number, d: number, e: number, f: bigint, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number) => void;
|
|
41
|
+
export const bitgopsbt_add_wallet_input_at_index: (a: number, b: number, c: number, d: number, e: number, f: number, g: bigint, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number) => void;
|
|
42
|
+
export const bitgopsbt_add_wallet_output: (a: number, b: number, c: number, d: number, e: bigint, f: number) => void;
|
|
43
|
+
export const bitgopsbt_add_wallet_output_at_index: (a: number, b: number, c: number, d: number, e: number, f: bigint, g: number) => void;
|
|
44
|
+
export const bitgopsbt_combine_inputs: (a: number, b: number, c: number, d: number) => void;
|
|
45
|
+
export const bitgopsbt_combine_ironwood_proof: (a: number, b: number, c: number, d: number) => void;
|
|
46
|
+
export const bitgopsbt_combine_musig2_nonces: (a: number, b: number, c: number) => void;
|
|
47
|
+
export const bitgopsbt_consensus_branch_id: (a: number) => number;
|
|
48
|
+
export const bitgopsbt_create_empty: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
49
|
+
export const bitgopsbt_create_empty_zcash: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
50
|
+
export const bitgopsbt_create_empty_zcash_at_height: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
51
|
+
export const bitgopsbt_create_empty_zcash_v6: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
52
|
+
export const bitgopsbt_create_empty_zcash_v6_at_height: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
53
|
+
export const bitgopsbt_delete_input_kv: (a: number, b: number, c: number, d: number) => void;
|
|
54
|
+
export const bitgopsbt_delete_kv: (a: number, b: number, c: number) => void;
|
|
55
|
+
export const bitgopsbt_delete_output_kv: (a: number, b: number, c: number, d: number) => void;
|
|
56
|
+
export const bitgopsbt_expiry_height: (a: number) => number;
|
|
57
|
+
export const bitgopsbt_extract_bitcoin_transaction: (a: number, b: number, c: number, d: number) => void;
|
|
58
|
+
export const bitgopsbt_extract_dash_transaction: (a: number, b: number, c: number, d: number) => void;
|
|
59
|
+
export const bitgopsbt_extract_half_signed_legacy_tx: (a: number, b: number) => void;
|
|
60
|
+
export const bitgopsbt_extract_transaction: (a: number, b: number, c: number, d: number) => void;
|
|
61
|
+
export const bitgopsbt_extract_zcash_transaction: (a: number, b: number, c: number, d: number) => void;
|
|
62
|
+
export const bitgopsbt_finalize_all_inputs: (a: number, b: number) => void;
|
|
63
|
+
export const bitgopsbt_from_bytes: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
64
|
+
export const bitgopsbt_from_half_signed_legacy_transaction: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
65
|
+
export const bitgopsbt_from_half_signed_legacy_transaction_dash: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
66
|
+
export const bitgopsbt_from_network_format: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
67
|
+
export const bitgopsbt_from_network_format_dash: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
68
|
+
export const bitgopsbt_from_network_format_zcash_with_block_height: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
69
|
+
export const bitgopsbt_from_network_format_zcash_with_branch_id: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
70
|
+
export const bitgopsbt_generate_musig2_nonces: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
71
|
+
export const bitgopsbt_get_global_xpubs: (a: number) => number;
|
|
72
|
+
export const bitgopsbt_get_input_key_values: (a: number, b: number, c: number) => void;
|
|
73
|
+
export const bitgopsbt_get_input_kv: (a: number, b: number, c: number, d: number) => void;
|
|
74
|
+
export const bitgopsbt_get_inputs: (a: number, b: number) => void;
|
|
75
|
+
export const bitgopsbt_get_kv: (a: number, b: number, c: number) => void;
|
|
76
|
+
export const bitgopsbt_get_network_type: (a: number, b: number) => void;
|
|
77
|
+
export const bitgopsbt_get_output_kv: (a: number, b: number, c: number, d: number) => void;
|
|
78
|
+
export const bitgopsbt_get_outputs: (a: number, b: number) => void;
|
|
79
|
+
export const bitgopsbt_get_outputs_with_address: (a: number, b: number) => void;
|
|
80
|
+
export const bitgopsbt_get_unsigned_tx: (a: number, b: number) => void;
|
|
81
|
+
export const bitgopsbt_input_count: (a: number) => number;
|
|
82
|
+
export const bitgopsbt_ironwood_pczt_bytes: (a: number, b: number) => void;
|
|
83
|
+
export const bitgopsbt_ironwood_v6_transparent_sighash: (a: number, b: number, c: number) => void;
|
|
84
|
+
export const bitgopsbt_ironwood_v6_txid: (a: number, b: number) => void;
|
|
85
|
+
export const bitgopsbt_is_musig2_input: (a: number, b: number) => number;
|
|
86
|
+
export const bitgopsbt_lock_time: (a: number) => number;
|
|
87
|
+
export const bitgopsbt_network: (a: number, b: number) => void;
|
|
88
|
+
export const bitgopsbt_output_count: (a: number) => number;
|
|
89
|
+
export const bitgopsbt_parse_outputs_with_wallet_keys: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
90
|
+
export const bitgopsbt_parse_transaction_with_wallet_keys: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
91
|
+
export const bitgopsbt_remove_input: (a: number, b: number, c: number) => void;
|
|
92
|
+
export const bitgopsbt_remove_output: (a: number, b: number, c: number) => void;
|
|
93
|
+
export const bitgopsbt_serialize: (a: number, b: number) => void;
|
|
94
|
+
export const bitgopsbt_set_input_kv: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
95
|
+
export const bitgopsbt_set_ironwood_out_ciphertext: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
96
|
+
export const bitgopsbt_set_kv: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
97
|
+
export const bitgopsbt_set_output_kv: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
98
|
+
export const bitgopsbt_sign_all_musig2_inputs: (a: number, b: number, c: number) => void;
|
|
99
|
+
export const bitgopsbt_sign_all_replay_protection_inputs: (a: number, b: number, c: number) => void;
|
|
100
|
+
export const bitgopsbt_sign_all_wallet_inputs: (a: number, b: number, c: number) => void;
|
|
101
|
+
export const bitgopsbt_sign_ironwood_v6: (a: number, b: number, c: number, d: number) => void;
|
|
102
|
+
export const bitgopsbt_sign_musig2_input: (a: number, b: number, c: number, d: number) => void;
|
|
103
|
+
export const bitgopsbt_sign_single_input_with_privkey: (a: number, b: number, c: number, d: number) => void;
|
|
104
|
+
export const bitgopsbt_sign_single_input_with_xpriv: (a: number, b: number, c: number, d: number) => void;
|
|
105
|
+
export const bitgopsbt_sign_with_privkey: (a: number, b: number, c: number, d: number) => void;
|
|
106
|
+
export const bitgopsbt_sign_with_xpriv: (a: number, b: number, c: number, d: number) => void;
|
|
107
|
+
export const bitgopsbt_transparent_output_unified_address: (a: number, b: number, c: number) => void;
|
|
108
|
+
export const bitgopsbt_unsigned_tx_id: (a: number, b: number) => void;
|
|
109
|
+
export const bitgopsbt_verify_replay_protection_signature: (a: number, b: number, c: number, d: number) => void;
|
|
110
|
+
export const bitgopsbt_verify_signature_with_pub: (a: number, b: number, c: number, d: number) => void;
|
|
111
|
+
export const bitgopsbt_verify_signature_with_xpub: (a: number, b: number, c: number, d: number) => void;
|
|
112
|
+
export const bitgopsbt_version: (a: number) => number;
|
|
113
|
+
export const bitgopsbt_version_group_id: (a: number) => number;
|
|
114
|
+
export const fixedscriptwalletnamespace_address: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
115
|
+
export const fixedscriptwalletnamespace_address_with_network_str: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
116
|
+
export const fixedscriptwalletnamespace_chain_code_table: () => number;
|
|
117
|
+
export const fixedscriptwalletnamespace_create_op_return_script: (a: number, b: number, c: number) => void;
|
|
118
|
+
export const fixedscriptwalletnamespace_get_bitgo_key_subtypes: () => number;
|
|
119
|
+
export const fixedscriptwalletnamespace_output_script: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
120
|
+
export const fixedscriptwalletnamespace_output_script_with_network_str: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
121
|
+
export const fixedscriptwalletnamespace_p2sh_p2pk_output_script: (a: number, b: number, c: number) => void;
|
|
122
|
+
export const fixedscriptwalletnamespace_supports_script_type: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
123
|
+
export const fixedscriptwalletnamespace_to_wallet_keys: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
124
|
+
export const inscriptionsnamespace_create_inscription_reveal_data: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
125
|
+
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;
|
|
126
|
+
export const wasmbip32_chain_code: (a: number) => number;
|
|
127
|
+
export const wasmbip32_depth: (a: number) => number;
|
|
128
|
+
export const wasmbip32_derive: (a: number, b: number, c: number) => void;
|
|
129
|
+
export const wasmbip32_derive_hardened: (a: number, b: number, c: number) => void;
|
|
130
|
+
export const wasmbip32_derive_path: (a: number, b: number, c: number, d: number) => void;
|
|
131
|
+
export const wasmbip32_equals: (a: number, b: number) => number;
|
|
132
|
+
export const wasmbip32_fingerprint: (a: number) => number;
|
|
133
|
+
export const wasmbip32_from_base58: (a: number, b: number, c: number) => void;
|
|
134
|
+
export const wasmbip32_from_bip32_interface: (a: number, b: number) => void;
|
|
135
|
+
export const wasmbip32_from_seed: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
136
|
+
export const wasmbip32_from_seed_sha256: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
137
|
+
export const wasmbip32_from_xprv: (a: number, b: number, c: number) => void;
|
|
138
|
+
export const wasmbip32_from_xpub: (a: number, b: number, c: number) => void;
|
|
139
|
+
export const wasmbip32_identifier: (a: number) => number;
|
|
140
|
+
export const wasmbip32_index: (a: number) => number;
|
|
141
|
+
export const wasmbip32_is_neutered: (a: number) => number;
|
|
142
|
+
export const wasmbip32_neutered: (a: number) => number;
|
|
143
|
+
export const wasmbip32_parent_fingerprint: (a: number) => number;
|
|
144
|
+
export const wasmbip32_private_key: (a: number) => number;
|
|
145
|
+
export const wasmbip32_public_key: (a: number) => number;
|
|
146
|
+
export const wasmbip32_to_base58: (a: number, b: number) => void;
|
|
147
|
+
export const wasmbip32_to_wif: (a: number, b: number) => void;
|
|
148
|
+
export const wasmbip32_from_bip32_properties: (a: number, b: number) => void;
|
|
149
|
+
export const bitgopsbt_sign_replay_protection_inputs: (a: number, b: number, c: number) => void;
|
|
150
|
+
export const bitgopsbt_sign_wallet_input: (a: number, b: number, c: number, d: number) => void;
|
|
151
|
+
export const bitgopsbt_sign_all_with_xpriv: (a: number, b: number, c: number) => void;
|
|
152
|
+
export const __wbg_addressnamespace_free: (a: number, b: number) => void;
|
|
153
|
+
export const __wbg_messagenamespace_free: (a: number, b: number) => void;
|
|
154
|
+
export const __wbg_wasmecpair_free: (a: number, b: number) => void;
|
|
155
|
+
export const __wbg_wasmreplayprotection_free: (a: number, b: number) => void;
|
|
156
|
+
export const __wbg_wasmutxonamespace_free: (a: number, b: number) => void;
|
|
157
|
+
export const addressnamespace_from_output_script_with_coin: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
158
|
+
export const addressnamespace_to_output_script_with_coin: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
159
|
+
export const isInspectEnabled: () => number;
|
|
160
|
+
export const messagenamespace_sign_message: (a: number, b: number, c: number, d: number) => void;
|
|
161
|
+
export const messagenamespace_verify_message: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
162
|
+
export const parsePsbtRawToJson: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
163
|
+
export const wasmecpair_from_private_key: (a: number, b: number, c: number) => void;
|
|
164
|
+
export const wasmecpair_from_public_key: (a: number, b: number, c: number) => void;
|
|
165
|
+
export const wasmecpair_from_wif: (a: number, b: number, c: number) => void;
|
|
166
|
+
export const wasmecpair_from_wif_mainnet: (a: number, b: number, c: number) => void;
|
|
167
|
+
export const wasmecpair_from_wif_testnet: (a: number, b: number, c: number) => void;
|
|
168
|
+
export const wasmecpair_private_key: (a: number) => number;
|
|
169
|
+
export const wasmecpair_public_key: (a: number) => number;
|
|
170
|
+
export const wasmecpair_to_wif: (a: number, b: number) => void;
|
|
171
|
+
export const wasmecpair_to_wif_mainnet: (a: number, b: number) => void;
|
|
172
|
+
export const wasmecpair_to_wif_testnet: (a: number, b: number) => void;
|
|
173
|
+
export const wasmreplayprotection_from_addresses: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
174
|
+
export const wasmreplayprotection_from_output_scripts: (a: number, b: number) => number;
|
|
175
|
+
export const wasmreplayprotection_from_public_keys: (a: number, b: number, c: number) => void;
|
|
176
|
+
export const wasmutxonamespace_get_wasm_utxo_version: (a: number) => void;
|
|
177
|
+
export const parsePsbtToJson: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
178
|
+
export const parseTxToJson: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
23
179
|
export const __wbg_bip322namespace_free: (a: number, b: number) => void;
|
|
24
180
|
export const __wbg_wasmrootwalletkeys_free: (a: number, b: number) => void;
|
|
25
181
|
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;
|
|
@@ -35,7 +191,6 @@ export const wasmrootwalletkeys_user_key: (a: number) => number;
|
|
|
35
191
|
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;
|
|
36
192
|
export const __wbg_ironwoodwitness_free: (a: number, b: number) => void;
|
|
37
193
|
export const __wbg_wasmdashtransaction_free: (a: number, b: number) => void;
|
|
38
|
-
export const __wbg_wasmreplayprotection_free: (a: number, b: number) => void;
|
|
39
194
|
export const __wbg_wasmtransaction_free: (a: number, b: number) => void;
|
|
40
195
|
export const __wbg_wasmzcashtransaction_free: (a: number, b: number) => void;
|
|
41
196
|
export const __wbg_wrappsbt_free: (a: number, b: number) => void;
|
|
@@ -54,9 +209,6 @@ export const wasmdashtransaction_lock_time: (a: number) => number;
|
|
|
54
209
|
export const wasmdashtransaction_output_count: (a: number) => number;
|
|
55
210
|
export const wasmdashtransaction_to_bytes: (a: number, b: number) => void;
|
|
56
211
|
export const wasmdashtransaction_version: (a: number) => number;
|
|
57
|
-
export const wasmreplayprotection_from_addresses: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
58
|
-
export const wasmreplayprotection_from_output_scripts: (a: number, b: number) => number;
|
|
59
|
-
export const wasmreplayprotection_from_public_keys: (a: number, b: number, c: number) => void;
|
|
60
212
|
export const wasmtransaction_add_input: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
61
213
|
export const wasmtransaction_add_input_at_index: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
62
214
|
export const wasmtransaction_add_output: (a: number, b: number, c: number, d: bigint) => number;
|
|
@@ -91,6 +243,7 @@ export const wrappsbt_finalize_input: (a: number, b: number, c: number) => void;
|
|
|
91
243
|
export const wrappsbt_finalize_mut: (a: number, b: number) => void;
|
|
92
244
|
export const wrappsbt_finalize_mut_zcash: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
93
245
|
export const wrappsbt_get_global_xpubs: (a: number) => number;
|
|
246
|
+
export const wrappsbt_get_input_key_values: (a: number, b: number, c: number) => void;
|
|
94
247
|
export const wrappsbt_get_input_kv: (a: number, b: number, c: number, d: number) => void;
|
|
95
248
|
export const wrappsbt_get_inputs: (a: number, b: number) => void;
|
|
96
249
|
export const wrappsbt_get_kv: (a: number, b: number, c: number) => void;
|
|
@@ -155,157 +308,6 @@ export const wasmzcashtransaction_lock_time: (a: number) => number;
|
|
|
155
308
|
export const wasmzcashtransaction_version: (a: number) => number;
|
|
156
309
|
export const wrappsbt_lock_time: (a: number) => number;
|
|
157
310
|
export const wrappsbt_version: (a: number) => number;
|
|
158
|
-
export const __wbg_addressnamespace_free: (a: number, b: number) => void;
|
|
159
|
-
export const __wbg_messagenamespace_free: (a: number, b: number) => void;
|
|
160
|
-
export const __wbg_wasmecpair_free: (a: number, b: number) => void;
|
|
161
|
-
export const __wbg_wasmutxonamespace_free: (a: number, b: number) => void;
|
|
162
|
-
export const addressnamespace_from_output_script_with_coin: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
163
|
-
export const addressnamespace_to_output_script_with_coin: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
164
|
-
export const messagenamespace_sign_message: (a: number, b: number, c: number, d: number) => void;
|
|
165
|
-
export const messagenamespace_verify_message: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
166
|
-
export const parsePsbtRawToJson: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
167
|
-
export const wasmecpair_from_private_key: (a: number, b: number, c: number) => void;
|
|
168
|
-
export const wasmecpair_from_public_key: (a: number, b: number, c: number) => void;
|
|
169
|
-
export const wasmecpair_from_wif: (a: number, b: number, c: number) => void;
|
|
170
|
-
export const wasmecpair_from_wif_mainnet: (a: number, b: number, c: number) => void;
|
|
171
|
-
export const wasmecpair_from_wif_testnet: (a: number, b: number, c: number) => void;
|
|
172
|
-
export const wasmecpair_private_key: (a: number) => number;
|
|
173
|
-
export const wasmecpair_public_key: (a: number) => number;
|
|
174
|
-
export const wasmecpair_to_wif: (a: number, b: number) => void;
|
|
175
|
-
export const wasmecpair_to_wif_mainnet: (a: number, b: number) => void;
|
|
176
|
-
export const wasmecpair_to_wif_testnet: (a: number, b: number) => void;
|
|
177
|
-
export const wasmutxonamespace_get_wasm_utxo_version: (a: number) => void;
|
|
178
|
-
export const isInspectEnabled: () => number;
|
|
179
|
-
export const parsePsbtToJson: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
180
|
-
export const parseTxToJson: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
181
|
-
export const __wbg_bitgopsbt_free: (a: number, b: number) => void;
|
|
182
|
-
export const __wbg_fixedscriptwalletnamespace_free: (a: number, b: number) => void;
|
|
183
|
-
export const __wbg_inscriptionsnamespace_free: (a: number, b: number) => void;
|
|
184
|
-
export const __wbg_wasmbip32_free: (a: number, b: number) => void;
|
|
185
|
-
export const bitgopsbt_add_input: (a: number, b: number, c: number, d: number, e: number, f: bigint, g: number, h: number, i: number, j: number, k: number) => void;
|
|
186
|
-
export const bitgopsbt_add_input_at_index: (a: number, b: number, c: number, d: number, e: number, f: number, g: bigint, h: number, i: number, j: number, k: number, l: number) => void;
|
|
187
|
-
export const bitgopsbt_add_ironwood_output: (a: number, b: number, c: number, d: number, e: bigint, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number) => void;
|
|
188
|
-
export const bitgopsbt_add_ironwood_outputs: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
189
|
-
export const bitgopsbt_add_ironwood_v6_signature: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
190
|
-
export const bitgopsbt_add_output: (a: number, b: number, c: number, d: number, e: bigint) => void;
|
|
191
|
-
export const bitgopsbt_add_output_at_index: (a: number, b: number, c: number, d: number, e: number, f: bigint) => void;
|
|
192
|
-
export const bitgopsbt_add_output_with_address: (a: number, b: number, c: number, d: number, e: bigint) => void;
|
|
193
|
-
export const bitgopsbt_add_output_with_address_at_index: (a: number, b: number, c: number, d: number, e: number, f: bigint) => void;
|
|
194
|
-
export const bitgopsbt_add_paygo_attestation: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
195
|
-
export const bitgopsbt_add_replay_protection_input: (a: number, b: number, c: number, d: number, e: number, f: number, g: bigint, h: number, i: number, j: number) => void;
|
|
196
|
-
export const bitgopsbt_add_replay_protection_input_at_index: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: bigint, i: number, j: number, k: number) => void;
|
|
197
|
-
export const bitgopsbt_add_transparent_output: (a: number, b: number, c: number, d: number, e: bigint, f: number, g: number) => void;
|
|
198
|
-
export const bitgopsbt_add_wallet_input: (a: number, b: number, c: number, d: number, e: number, f: bigint, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number) => void;
|
|
199
|
-
export const bitgopsbt_add_wallet_input_at_index: (a: number, b: number, c: number, d: number, e: number, f: number, g: bigint, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number) => void;
|
|
200
|
-
export const bitgopsbt_add_wallet_output: (a: number, b: number, c: number, d: number, e: bigint, f: number) => void;
|
|
201
|
-
export const bitgopsbt_add_wallet_output_at_index: (a: number, b: number, c: number, d: number, e: number, f: bigint, g: number) => void;
|
|
202
|
-
export const bitgopsbt_combine_inputs: (a: number, b: number, c: number, d: number) => void;
|
|
203
|
-
export const bitgopsbt_combine_ironwood_proof: (a: number, b: number, c: number, d: number) => void;
|
|
204
|
-
export const bitgopsbt_combine_musig2_nonces: (a: number, b: number, c: number) => void;
|
|
205
|
-
export const bitgopsbt_consensus_branch_id: (a: number) => number;
|
|
206
|
-
export const bitgopsbt_create_empty: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
207
|
-
export const bitgopsbt_create_empty_zcash: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
208
|
-
export const bitgopsbt_create_empty_zcash_at_height: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
209
|
-
export const bitgopsbt_create_empty_zcash_v6: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
210
|
-
export const bitgopsbt_create_empty_zcash_v6_at_height: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
211
|
-
export const bitgopsbt_delete_input_kv: (a: number, b: number, c: number, d: number) => void;
|
|
212
|
-
export const bitgopsbt_delete_kv: (a: number, b: number, c: number) => void;
|
|
213
|
-
export const bitgopsbt_delete_output_kv: (a: number, b: number, c: number, d: number) => void;
|
|
214
|
-
export const bitgopsbt_expiry_height: (a: number) => number;
|
|
215
|
-
export const bitgopsbt_extract_bitcoin_transaction: (a: number, b: number, c: number, d: number) => void;
|
|
216
|
-
export const bitgopsbt_extract_dash_transaction: (a: number, b: number, c: number, d: number) => void;
|
|
217
|
-
export const bitgopsbt_extract_half_signed_legacy_tx: (a: number, b: number) => void;
|
|
218
|
-
export const bitgopsbt_extract_transaction: (a: number, b: number, c: number, d: number) => void;
|
|
219
|
-
export const bitgopsbt_extract_zcash_transaction: (a: number, b: number, c: number, d: number) => void;
|
|
220
|
-
export const bitgopsbt_finalize_all_inputs: (a: number, b: number) => void;
|
|
221
|
-
export const bitgopsbt_from_bytes: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
222
|
-
export const bitgopsbt_from_half_signed_legacy_transaction: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
223
|
-
export const bitgopsbt_from_half_signed_legacy_transaction_dash: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
224
|
-
export const bitgopsbt_from_network_format: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
225
|
-
export const bitgopsbt_from_network_format_dash: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
226
|
-
export const bitgopsbt_from_network_format_zcash_with_block_height: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
227
|
-
export const bitgopsbt_from_network_format_zcash_with_branch_id: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
228
|
-
export const bitgopsbt_generate_musig2_nonces: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
229
|
-
export const bitgopsbt_get_global_xpubs: (a: number) => number;
|
|
230
|
-
export const bitgopsbt_get_input_kv: (a: number, b: number, c: number, d: number) => void;
|
|
231
|
-
export const bitgopsbt_get_inputs: (a: number, b: number) => void;
|
|
232
|
-
export const bitgopsbt_get_kv: (a: number, b: number, c: number) => void;
|
|
233
|
-
export const bitgopsbt_get_network_type: (a: number, b: number) => void;
|
|
234
|
-
export const bitgopsbt_get_output_kv: (a: number, b: number, c: number, d: number) => void;
|
|
235
|
-
export const bitgopsbt_get_outputs: (a: number, b: number) => void;
|
|
236
|
-
export const bitgopsbt_get_outputs_with_address: (a: number, b: number) => void;
|
|
237
|
-
export const bitgopsbt_get_unsigned_tx: (a: number, b: number) => void;
|
|
238
|
-
export const bitgopsbt_input_count: (a: number) => number;
|
|
239
|
-
export const bitgopsbt_ironwood_pczt_bytes: (a: number, b: number) => void;
|
|
240
|
-
export const bitgopsbt_ironwood_v6_transparent_sighash: (a: number, b: number, c: number) => void;
|
|
241
|
-
export const bitgopsbt_ironwood_v6_txid: (a: number, b: number) => void;
|
|
242
|
-
export const bitgopsbt_is_musig2_input: (a: number, b: number) => number;
|
|
243
|
-
export const bitgopsbt_lock_time: (a: number) => number;
|
|
244
|
-
export const bitgopsbt_network: (a: number, b: number) => void;
|
|
245
|
-
export const bitgopsbt_output_count: (a: number) => number;
|
|
246
|
-
export const bitgopsbt_parse_outputs_with_wallet_keys: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
247
|
-
export const bitgopsbt_parse_transaction_with_wallet_keys: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
248
|
-
export const bitgopsbt_remove_input: (a: number, b: number, c: number) => void;
|
|
249
|
-
export const bitgopsbt_remove_output: (a: number, b: number, c: number) => void;
|
|
250
|
-
export const bitgopsbt_serialize: (a: number, b: number) => void;
|
|
251
|
-
export const bitgopsbt_set_input_kv: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
252
|
-
export const bitgopsbt_set_ironwood_out_ciphertext: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
253
|
-
export const bitgopsbt_set_kv: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
254
|
-
export const bitgopsbt_set_output_kv: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
255
|
-
export const bitgopsbt_sign_all_musig2_inputs: (a: number, b: number, c: number) => void;
|
|
256
|
-
export const bitgopsbt_sign_all_replay_protection_inputs: (a: number, b: number, c: number) => void;
|
|
257
|
-
export const bitgopsbt_sign_all_wallet_inputs: (a: number, b: number, c: number) => void;
|
|
258
|
-
export const bitgopsbt_sign_ironwood_v6: (a: number, b: number, c: number, d: number) => void;
|
|
259
|
-
export const bitgopsbt_sign_musig2_input: (a: number, b: number, c: number, d: number) => void;
|
|
260
|
-
export const bitgopsbt_sign_single_input_with_privkey: (a: number, b: number, c: number, d: number) => void;
|
|
261
|
-
export const bitgopsbt_sign_single_input_with_xpriv: (a: number, b: number, c: number, d: number) => void;
|
|
262
|
-
export const bitgopsbt_sign_with_privkey: (a: number, b: number, c: number, d: number) => void;
|
|
263
|
-
export const bitgopsbt_sign_with_xpriv: (a: number, b: number, c: number, d: number) => void;
|
|
264
|
-
export const bitgopsbt_transparent_output_unified_address: (a: number, b: number, c: number) => void;
|
|
265
|
-
export const bitgopsbt_unsigned_tx_id: (a: number, b: number) => void;
|
|
266
|
-
export const bitgopsbt_verify_replay_protection_signature: (a: number, b: number, c: number, d: number) => void;
|
|
267
|
-
export const bitgopsbt_verify_signature_with_pub: (a: number, b: number, c: number, d: number) => void;
|
|
268
|
-
export const bitgopsbt_verify_signature_with_xpub: (a: number, b: number, c: number, d: number) => void;
|
|
269
|
-
export const bitgopsbt_version: (a: number) => number;
|
|
270
|
-
export const bitgopsbt_version_group_id: (a: number) => number;
|
|
271
|
-
export const fixedscriptwalletnamespace_address: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
272
|
-
export const fixedscriptwalletnamespace_address_with_network_str: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
273
|
-
export const fixedscriptwalletnamespace_chain_code_table: () => number;
|
|
274
|
-
export const fixedscriptwalletnamespace_create_op_return_script: (a: number, b: number, c: number) => void;
|
|
275
|
-
export const fixedscriptwalletnamespace_get_bitgo_key_subtypes: () => number;
|
|
276
|
-
export const fixedscriptwalletnamespace_output_script: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
277
|
-
export const fixedscriptwalletnamespace_output_script_with_network_str: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
278
|
-
export const fixedscriptwalletnamespace_p2sh_p2pk_output_script: (a: number, b: number, c: number) => void;
|
|
279
|
-
export const fixedscriptwalletnamespace_supports_script_type: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
280
|
-
export const fixedscriptwalletnamespace_to_wallet_keys: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
281
|
-
export const inscriptionsnamespace_create_inscription_reveal_data: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
282
|
-
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;
|
|
283
|
-
export const wasmbip32_chain_code: (a: number) => number;
|
|
284
|
-
export const wasmbip32_depth: (a: number) => number;
|
|
285
|
-
export const wasmbip32_derive: (a: number, b: number, c: number) => void;
|
|
286
|
-
export const wasmbip32_derive_hardened: (a: number, b: number, c: number) => void;
|
|
287
|
-
export const wasmbip32_derive_path: (a: number, b: number, c: number, d: number) => void;
|
|
288
|
-
export const wasmbip32_equals: (a: number, b: number) => number;
|
|
289
|
-
export const wasmbip32_fingerprint: (a: number) => number;
|
|
290
|
-
export const wasmbip32_from_base58: (a: number, b: number, c: number) => void;
|
|
291
|
-
export const wasmbip32_from_bip32_interface: (a: number, b: number) => void;
|
|
292
|
-
export const wasmbip32_from_seed: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
293
|
-
export const wasmbip32_from_seed_sha256: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
294
|
-
export const wasmbip32_from_xprv: (a: number, b: number, c: number) => void;
|
|
295
|
-
export const wasmbip32_from_xpub: (a: number, b: number, c: number) => void;
|
|
296
|
-
export const wasmbip32_identifier: (a: number) => number;
|
|
297
|
-
export const wasmbip32_index: (a: number) => number;
|
|
298
|
-
export const wasmbip32_is_neutered: (a: number) => number;
|
|
299
|
-
export const wasmbip32_neutered: (a: number) => number;
|
|
300
|
-
export const wasmbip32_parent_fingerprint: (a: number) => number;
|
|
301
|
-
export const wasmbip32_private_key: (a: number) => number;
|
|
302
|
-
export const wasmbip32_public_key: (a: number) => number;
|
|
303
|
-
export const wasmbip32_to_base58: (a: number, b: number) => void;
|
|
304
|
-
export const wasmbip32_to_wif: (a: number, b: number) => void;
|
|
305
|
-
export const wasmbip32_from_bip32_properties: (a: number, b: number) => void;
|
|
306
|
-
export const bitgopsbt_sign_replay_protection_inputs: (a: number, b: number, c: number) => void;
|
|
307
|
-
export const bitgopsbt_sign_wallet_input: (a: number, b: number, c: number, d: number) => void;
|
|
308
|
-
export const bitgopsbt_sign_all_with_xpriv: (a: number, b: number, c: number) => void;
|
|
309
311
|
export const __wbg_wrapdescriptor_free: (a: number, b: number) => void;
|
|
310
312
|
export const __wbg_wrapminiscript_free: (a: number, b: number) => void;
|
|
311
313
|
export const wrapdescriptor_atDerivationIndex: (a: number, b: number, c: number) => void;
|
|
@@ -44,11 +44,11 @@ function findDescriptorForDerivationIndex(script, index, descriptorMap) {
|
|
|
44
44
|
function getDerivationIndexFromPath(path) {
|
|
45
45
|
const indexStr = path.split("/").pop();
|
|
46
46
|
if (!indexStr) {
|
|
47
|
-
|
|
47
|
+
return undefined;
|
|
48
48
|
}
|
|
49
|
-
const index =
|
|
50
|
-
if (index.toString() !== indexStr) {
|
|
51
|
-
|
|
49
|
+
const index = Number(indexStr);
|
|
50
|
+
if (!Number.isSafeInteger(index) || index < 0 || index.toString() !== indexStr) {
|
|
51
|
+
return undefined;
|
|
52
52
|
}
|
|
53
53
|
return index;
|
|
54
54
|
}
|
|
@@ -59,7 +59,13 @@ function getDerivationIndexFromPath(path) {
|
|
|
59
59
|
* @param descriptorMap
|
|
60
60
|
*/
|
|
61
61
|
function findDescriptorForAnyDerivationPath(script, derivationPaths, descriptorMap) {
|
|
62
|
-
const derivationIndexSet = new Set(
|
|
62
|
+
const derivationIndexSet = new Set();
|
|
63
|
+
for (const path of derivationPaths) {
|
|
64
|
+
const index = getDerivationIndexFromPath(path);
|
|
65
|
+
if (index !== undefined) {
|
|
66
|
+
derivationIndexSet.add(index);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
63
69
|
for (const index of [...derivationIndexSet]) {
|
|
64
70
|
const desc = findDescriptorForDerivationIndex(script, index, descriptorMap);
|
|
65
71
|
if (desc) {
|
|
@@ -69,13 +75,11 @@ function findDescriptorForAnyDerivationPath(script, derivationPaths, descriptorM
|
|
|
69
75
|
return undefined;
|
|
70
76
|
}
|
|
71
77
|
function getDerivationPaths(v) {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
return undefined;
|
|
78
|
+
const paths = [
|
|
79
|
+
...(v.bip32Derivation ?? []).map((derivation) => derivation.path),
|
|
80
|
+
...(v.tapBip32Derivation ?? []).map((derivation) => derivation.path),
|
|
81
|
+
].filter((path) => path !== "" && path !== "m");
|
|
82
|
+
return paths.length > 0 ? paths : undefined;
|
|
79
83
|
}
|
|
80
84
|
/**
|
|
81
85
|
* @param input
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BitGoPsbt as WasmBitGoPsbt } from "../wasm/wasm_utxo.js";
|
|
1
2
|
import { type WalletKeysArg } from "./RootWalletKeys.js";
|
|
2
3
|
import { BitGoPsbt, type CreateEmptyOptions, type HydrationUnspent, type ParsedOutput } from "./BitGoPsbt.js";
|
|
3
4
|
import { ZcashTransaction, type ITransaction } from "../transaction.js";
|
|
@@ -15,6 +16,8 @@ export type ZcashParsedOutput = ParsedOutput & {
|
|
|
15
16
|
*/
|
|
16
17
|
isShielded: boolean;
|
|
17
18
|
};
|
|
19
|
+
/** Zcash transaction versions supported by the fixed-script PSBT API. */
|
|
20
|
+
export type ZcashTransactionVersion = 4 | 6;
|
|
18
21
|
/**
|
|
19
22
|
* Zcash v6 (Ironwood) version group id (0xd884b698). Its presence marks a PSBT as v6 — see
|
|
20
23
|
* `ZcashIronwoodBitGoPsbt`.
|
|
@@ -124,6 +127,8 @@ export declare class ZcashBitGoPsbt extends BitGoPsbt<ZcashParsedOutput> {
|
|
|
124
127
|
* @returns A ZcashBitGoPsbt instance
|
|
125
128
|
*/
|
|
126
129
|
static fromBytes(bytes: Uint8Array, network: ZcashNetworkName): ZcashBitGoPsbt;
|
|
130
|
+
/** @internal Create from a parsed WASM instance without reparsing the bytes. */
|
|
131
|
+
static fromWasm(wasm: WasmBitGoPsbt): ZcashBitGoPsbt;
|
|
127
132
|
/**
|
|
128
133
|
* Reconstruct a Zcash PSBT from a network-format transaction (unsigned, half-signed, or fully-signed).
|
|
129
134
|
*
|
|
@@ -173,6 +178,13 @@ export declare class ZcashBitGoPsbt extends BitGoPsbt<ZcashParsedOutput> {
|
|
|
173
178
|
* @returns The version group ID (e.g., 0x892F2085 for Sapling)
|
|
174
179
|
*/
|
|
175
180
|
get versionGroupId(): number;
|
|
181
|
+
/**
|
|
182
|
+
* Get the Zcash transaction version represented by this PSBT.
|
|
183
|
+
*
|
|
184
|
+
* The version group ID is the discriminator because the v4 and v6 PSBT encodings do not expose
|
|
185
|
+
* the same unsigned transaction bytes to a standard PSBT parser.
|
|
186
|
+
*/
|
|
187
|
+
getVersion(): ZcashTransactionVersion;
|
|
176
188
|
/**
|
|
177
189
|
* Get the Zcash expiry height
|
|
178
190
|
* @returns The expiry height (0 if not set)
|
|
@@ -108,6 +108,10 @@ export class ZcashBitGoPsbt extends BitGoPsbt {
|
|
|
108
108
|
}
|
|
109
109
|
return psbt;
|
|
110
110
|
}
|
|
111
|
+
/** @internal Create from a parsed WASM instance without reparsing the bytes. */
|
|
112
|
+
static fromWasm(wasm) {
|
|
113
|
+
return new ZcashBitGoPsbt(wasm);
|
|
114
|
+
}
|
|
111
115
|
/**
|
|
112
116
|
* Reconstruct a Zcash PSBT from a network-format transaction (unsigned, half-signed, or fully-signed).
|
|
113
117
|
*
|
|
@@ -178,6 +182,15 @@ export class ZcashBitGoPsbt extends BitGoPsbt {
|
|
|
178
182
|
get versionGroupId() {
|
|
179
183
|
return this.wasm.version_group_id();
|
|
180
184
|
}
|
|
185
|
+
/**
|
|
186
|
+
* Get the Zcash transaction version represented by this PSBT.
|
|
187
|
+
*
|
|
188
|
+
* The version group ID is the discriminator because the v4 and v6 PSBT encodings do not expose
|
|
189
|
+
* the same unsigned transaction bytes to a standard PSBT parser.
|
|
190
|
+
*/
|
|
191
|
+
getVersion() {
|
|
192
|
+
return this.versionGroupId === IRONWOOD_VERSION_GROUP_ID ? 6 : 4;
|
|
193
|
+
}
|
|
181
194
|
/**
|
|
182
195
|
* Get the Zcash expiry height
|
|
183
196
|
* @returns The expiry height (0 if not set)
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BitGoPsbt as WasmBitGoPsbt } from "../wasm/wasm_utxo.js";
|
|
1
2
|
import { type BIP32Arg } from "../bip32.js";
|
|
2
3
|
import { type ECPairArg } from "../ecpair.js";
|
|
3
4
|
import { type WalletKeysArg } from "./RootWalletKeys.js";
|
|
@@ -122,6 +123,8 @@ export declare class ZcashIronwoodBitGoPsbt extends ZcashBitGoPsbt {
|
|
|
122
123
|
* @returns A ZcashIronwoodBitGoPsbt instance
|
|
123
124
|
*/
|
|
124
125
|
static fromBytes(bytes: Uint8Array, network: ZcashNetworkName): ZcashIronwoodBitGoPsbt;
|
|
126
|
+
/** @internal Create from a parsed WASM instance without reparsing the bytes. */
|
|
127
|
+
static fromWasm(wasm: WasmBitGoPsbt): ZcashIronwoodBitGoPsbt;
|
|
125
128
|
/**
|
|
126
129
|
* Add the shielded output (Constructor role). Stores the orchard PCZT in the PSBT.
|
|
127
130
|
*
|
|
@@ -117,6 +117,10 @@ export class ZcashIronwoodBitGoPsbt extends ZcashBitGoPsbt {
|
|
|
117
117
|
}
|
|
118
118
|
return psbt;
|
|
119
119
|
}
|
|
120
|
+
/** @internal Create from a parsed WASM instance without reparsing the bytes. */
|
|
121
|
+
static fromWasm(wasm) {
|
|
122
|
+
return new ZcashIronwoodBitGoPsbt(wasm);
|
|
123
|
+
}
|
|
120
124
|
/**
|
|
121
125
|
* Add the shielded output (Constructor role). Stores the orchard PCZT in the PSBT.
|
|
122
126
|
*
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ZcashBitGoPsbt, type ZcashNetworkName } from "./ZcashBitGoPsbt.js";
|
|
2
|
+
import { ZcashIronwoodBitGoPsbt } from "./ZcashIronwoodBitGoPsbt.js";
|
|
3
|
+
export type ZcashPsbtInstance = ZcashBitGoPsbt | ZcashIronwoodBitGoPsbt;
|
|
4
|
+
/** Factory for deserializing either supported Zcash PSBT format. */
|
|
5
|
+
export declare class ZcashPsbt {
|
|
6
|
+
private constructor();
|
|
7
|
+
/**
|
|
8
|
+
* Deserialize a Zcash PSBT and return the format-specific implementation.
|
|
9
|
+
*
|
|
10
|
+
* The version is read from the parsed Zcash metadata, so callers do not need to run a separate
|
|
11
|
+
* byte-level detector or choose a concrete parser before deserializing.
|
|
12
|
+
*/
|
|
13
|
+
static from(bytes: Uint8Array, network: ZcashNetworkName): ZcashPsbtInstance;
|
|
14
|
+
static fromBytes(bytes: Uint8Array, network: ZcashNetworkName): ZcashPsbtInstance;
|
|
15
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BitGoPsbt as WasmBitGoPsbt } from "../wasm/wasm_utxo.js";
|
|
2
|
+
import { ZcashBitGoPsbt } from "./ZcashBitGoPsbt.js";
|
|
3
|
+
import { ZcashIronwoodBitGoPsbt } from "./ZcashIronwoodBitGoPsbt.js";
|
|
4
|
+
/** Factory for deserializing either supported Zcash PSBT format. */
|
|
5
|
+
export class ZcashPsbt {
|
|
6
|
+
constructor() { }
|
|
7
|
+
/**
|
|
8
|
+
* Deserialize a Zcash PSBT and return the format-specific implementation.
|
|
9
|
+
*
|
|
10
|
+
* The version is read from the parsed Zcash metadata, so callers do not need to run a separate
|
|
11
|
+
* byte-level detector or choose a concrete parser before deserializing.
|
|
12
|
+
*/
|
|
13
|
+
static from(bytes, network) {
|
|
14
|
+
const parsed = ZcashBitGoPsbt.fromWasm(WasmBitGoPsbt.from_bytes(bytes, network));
|
|
15
|
+
return parsed.getVersion() === 6 ? ZcashIronwoodBitGoPsbt.fromWasm(parsed.wasm) : parsed;
|
|
16
|
+
}
|
|
17
|
+
static fromBytes(bytes, network) {
|
|
18
|
+
return ZcashPsbt.from(bytes, network);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -8,7 +8,8 @@ export { ChainCode, chainCodes, assertChainCode, type Scope } from "./chains.js"
|
|
|
8
8
|
export { requiresPrevTxForP2sh } from "./prevTx.js";
|
|
9
9
|
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";
|
|
10
10
|
export { BitGoKeySubtype, type PsbtKvKey } from "./BitGoKeySubtype.js";
|
|
11
|
-
export { ZcashBitGoPsbt, type ZcashNetworkName, type ZcashParsedOutput, type CreateEmptyZcashOptions, IRONWOOD_VERSION_GROUP_ID, } from "./ZcashBitGoPsbt.js";
|
|
11
|
+
export { ZcashBitGoPsbt, type ZcashNetworkName, type ZcashParsedOutput, type ZcashTransactionVersion, type CreateEmptyZcashOptions, IRONWOOD_VERSION_GROUP_ID, } from "./ZcashBitGoPsbt.js";
|
|
12
|
+
export { ZcashPsbt, type ZcashPsbtInstance } from "./ZcashPsbt.js";
|
|
12
13
|
export { ZcashIronwoodBitGoPsbt, zip302NoMemo, type CreateEmptyIronwoodOptions, type CreateEmptyIronwoodWithConsensusBranchIdOptions, } from "./ZcashIronwoodBitGoPsbt.js";
|
|
13
14
|
export { ZcashUnifiedAddress } from "./ZcashUnifiedAddress.js";
|
|
14
15
|
export { ZcashV6Transaction } from "./ZcashV6Transaction.js";
|
|
@@ -12,6 +12,7 @@ export { BitGoPsbt, getWalletKeysFromPsbt, } from "./BitGoPsbt.js";
|
|
|
12
12
|
export { BitGoKeySubtype } from "./BitGoKeySubtype.js";
|
|
13
13
|
// Zcash-specific PSBT subclass
|
|
14
14
|
export { ZcashBitGoPsbt, IRONWOOD_VERSION_GROUP_ID, } from "./ZcashBitGoPsbt.js";
|
|
15
|
+
export { ZcashPsbt } from "./ZcashPsbt.js";
|
|
15
16
|
// Zcash v6 (Ironwood / NU6.3) shielding PSBT
|
|
16
17
|
export { ZcashIronwoodBitGoPsbt, zip302NoMemo, } from "./ZcashIronwoodBitGoPsbt.js";
|
|
17
18
|
// Zcash ZIP-316 Unified Address
|
package/dist/esm/js/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export { ECPair } from "./ecpair.js";
|
|
|
13
13
|
export { BIP32 } from "./bip32.js";
|
|
14
14
|
export { Dimensions } from "./fixedScriptWallet/Dimensions.js";
|
|
15
15
|
export { ZcashDimensions } from "./fixedScriptWallet/ZcashDimensions.js";
|
|
16
|
+
export { ZcashBitGoPsbt, ZcashPsbt, ZcashIronwoodBitGoPsbt, type ZcashPsbtInstance, type ZcashTransactionVersion, ZcashUnifiedAddress, ZcashV6Transaction, ZcashIronwoodWitness, } from "./fixedScriptWallet/index.js";
|
|
16
17
|
export type WasmUtxoVersionInfo = {
|
|
17
18
|
version: string;
|
|
18
19
|
gitHash: string;
|
|
@@ -70,6 +71,21 @@ declare module "./wasm/wasm_utxo.js" {
|
|
|
70
71
|
bip32Derivation: PsbtBip32Derivation[];
|
|
71
72
|
tapBip32Derivation: PsbtBip32Derivation[];
|
|
72
73
|
}
|
|
74
|
+
/** A serialized input-map record with a standard PSBT key type. */
|
|
75
|
+
interface PsbtKnownInputKeyValue {
|
|
76
|
+
type: "known";
|
|
77
|
+
key: string;
|
|
78
|
+
keyData: Uint8Array;
|
|
79
|
+
value: Uint8Array;
|
|
80
|
+
}
|
|
81
|
+
/** A serialized input-map record whose key type is unrecognized. */
|
|
82
|
+
interface PsbtUnknownInputKeyValue {
|
|
83
|
+
type: "unknown";
|
|
84
|
+
keyType: bigint;
|
|
85
|
+
keyData: Uint8Array;
|
|
86
|
+
value: Uint8Array;
|
|
87
|
+
}
|
|
88
|
+
type PsbtInputKeyValue = PsbtKnownInputKeyValue | PsbtUnknownInputKeyValue;
|
|
73
89
|
/** Raw PSBT output data returned by getOutputs() */
|
|
74
90
|
interface PsbtOutputData {
|
|
75
91
|
script: Uint8Array;
|
|
@@ -112,3 +128,4 @@ export { WrapMiniscript as Miniscript } from "./wasm/wasm_utxo.js";
|
|
|
112
128
|
export { Psbt } from "./descriptorWallet/Psbt.js";
|
|
113
129
|
export { DashTransaction, Transaction, ZcashTransaction, type ITransaction, type ITransactionCommon, } from "./transaction.js";
|
|
114
130
|
export { hasPsbtMagic, type IPsbt, type IPsbtWithAddress } from "./psbt.js";
|
|
131
|
+
export type { PsbtInputKeyValue } from "./wasm/wasm_utxo.js";
|
package/dist/esm/js/index.js
CHANGED
|
@@ -21,6 +21,7 @@ export { ECPair } from "./ecpair.js";
|
|
|
21
21
|
export { BIP32 } from "./bip32.js";
|
|
22
22
|
export { Dimensions } from "./fixedScriptWallet/Dimensions.js";
|
|
23
23
|
export { ZcashDimensions } from "./fixedScriptWallet/ZcashDimensions.js";
|
|
24
|
+
export { ZcashBitGoPsbt, ZcashPsbt, ZcashIronwoodBitGoPsbt, ZcashUnifiedAddress, ZcashV6Transaction, ZcashIronwoodWitness, } from "./fixedScriptWallet/index.js";
|
|
24
25
|
export function getWasmUtxoVersion() {
|
|
25
26
|
return WasmUtxoNamespace.get_wasm_utxo_version();
|
|
26
27
|
}
|
package/dist/esm/js/psbt.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type { PsbtInputData, PsbtOutputData, PsbtOutputDataWithAddress } from "./wasm/wasm_utxo.js";
|
|
1
|
+
import type { PsbtInputData, PsbtInputKeyValue, PsbtOutputData, PsbtOutputDataWithAddress } from "./wasm/wasm_utxo.js";
|
|
2
2
|
import type { BIP32 } from "./bip32.js";
|
|
3
3
|
import type { ITransactionCommon } from "./transaction.js";
|
|
4
4
|
import type { PsbtKvKey } from "./fixedScriptWallet/BitGoKeySubtype.js";
|
|
5
5
|
/** Common interface for PSBT types */
|
|
6
6
|
export interface IPsbt extends ITransactionCommon<PsbtInputData, PsbtOutputData> {
|
|
7
7
|
getGlobalXpubs(): BIP32[];
|
|
8
|
+
getInputKeyValues(index: number): PsbtInputKeyValue[];
|
|
8
9
|
unsignedTxId(): string;
|
|
9
10
|
addInputAtIndex(index: number, txid: string, vout: number, value: bigint, script: Uint8Array, sequence?: number): number;
|
|
10
11
|
addOutputAtIndex(index: number, script: Uint8Array, value: bigint): number;
|