@bitgo/wasm-utxo 4.34.0 → 4.36.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/address.d.ts +9 -1
- package/dist/cjs/js/address.js +10 -2
- package/dist/cjs/js/fixedScriptWallet/BitGoPsbt.d.ts +10 -0
- package/dist/cjs/js/fixedScriptWallet/ZcashIronwoodBitGoPsbt.d.ts +14 -0
- package/dist/cjs/js/fixedScriptWallet/ZcashIronwoodBitGoPsbt.js +16 -0
- package/dist/cjs/js/fixedScriptWallet/ZcashUnifiedAddress.d.ts +13 -0
- package/dist/cjs/js/fixedScriptWallet/ZcashUnifiedAddress.js +15 -0
- package/dist/cjs/js/fixedScriptWallet/ZcashV6Transaction.d.ts +9 -0
- package/dist/cjs/js/fixedScriptWallet/ZcashV6Transaction.js +11 -0
- package/dist/cjs/js/wasm/wasm_utxo.d.ts +44 -1
- package/dist/cjs/js/wasm/wasm_utxo.js +130 -2
- package/dist/cjs/js/wasm/wasm_utxo_bg.wasm +0 -0
- package/dist/cjs/js/wasm/wasm_utxo_bg.wasm.d.ts +166 -163
- package/dist/esm/js/address.d.ts +9 -1
- package/dist/esm/js/address.js +10 -2
- package/dist/esm/js/fixedScriptWallet/BitGoPsbt.d.ts +10 -0
- package/dist/esm/js/fixedScriptWallet/ZcashIronwoodBitGoPsbt.d.ts +14 -0
- package/dist/esm/js/fixedScriptWallet/ZcashIronwoodBitGoPsbt.js +16 -0
- package/dist/esm/js/fixedScriptWallet/ZcashUnifiedAddress.d.ts +13 -0
- package/dist/esm/js/fixedScriptWallet/ZcashUnifiedAddress.js +15 -0
- package/dist/esm/js/fixedScriptWallet/ZcashV6Transaction.d.ts +9 -0
- package/dist/esm/js/fixedScriptWallet/ZcashV6Transaction.js +11 -0
- package/dist/esm/js/wasm/wasm_utxo.d.ts +44 -1
- package/dist/esm/js/wasm/wasm_utxo_bg.js +130 -2
- package/dist/esm/js/wasm/wasm_utxo_bg.wasm +0 -0
- package/dist/esm/js/wasm/wasm_utxo_bg.wasm.d.ts +166 -163
- package/package.json +1 -1
|
@@ -1,33 +1,147 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
-
export const
|
|
5
|
-
export const
|
|
6
|
-
export const
|
|
7
|
-
export const
|
|
8
|
-
export const
|
|
9
|
-
export const
|
|
10
|
-
export const
|
|
11
|
-
export const
|
|
12
|
-
export const
|
|
13
|
-
export const
|
|
14
|
-
export const
|
|
15
|
-
export const
|
|
16
|
-
export const
|
|
17
|
-
export const
|
|
18
|
-
export const
|
|
19
|
-
export const
|
|
20
|
-
export const
|
|
21
|
-
export const
|
|
22
|
-
export const
|
|
23
|
-
export const
|
|
24
|
-
export const
|
|
25
|
-
export const
|
|
4
|
+
export const __wbg_addressnamespace_free: (a: number, b: number) => void;
|
|
5
|
+
export const __wbg_bip322namespace_free: (a: number, b: number) => void;
|
|
6
|
+
export const __wbg_messagenamespace_free: (a: number, b: number) => void;
|
|
7
|
+
export const __wbg_utxolibcompatnamespace_free: (a: number, b: number) => void;
|
|
8
|
+
export const __wbg_wasmdashtransaction_free: (a: number, b: number) => void;
|
|
9
|
+
export const __wbg_wasmecpair_free: (a: number, b: number) => void;
|
|
10
|
+
export const __wbg_wasmtransaction_free: (a: number, b: number) => void;
|
|
11
|
+
export const __wbg_wasmutxonamespace_free: (a: number, b: number) => void;
|
|
12
|
+
export const __wbg_wasmzcashtransaction_free: (a: number, b: number) => void;
|
|
13
|
+
export const __wbg_wrappsbt_free: (a: number, b: number) => void;
|
|
14
|
+
export const __wbg_zcashunifiedaddress_free: (a: number, b: number) => void;
|
|
15
|
+
export const __wbg_zcashv6transaction_free: (a: number, b: number) => void;
|
|
16
|
+
export const addressnamespace_from_output_script_with_coin: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
17
|
+
export const addressnamespace_to_output_script_with_coin: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
18
|
+
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;
|
|
19
|
+
export const bip322namespace_get_bip322_message: (a: number, b: number, c: number) => void;
|
|
20
|
+
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;
|
|
21
|
+
export const bip322namespace_verify_bip322_psbt_input_with_pubkeys: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => void;
|
|
22
|
+
export const bip322namespace_verify_bip322_tx_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) => void;
|
|
23
|
+
export const bip322namespace_verify_bip322_tx_input_with_pubkeys: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => void;
|
|
24
|
+
export const messagenamespace_sign_message: (a: number, b: number, c: number, d: number) => void;
|
|
25
|
+
export const messagenamespace_verify_message: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
26
|
+
export const utxolibcompatnamespace_from_output_script: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
27
|
+
export const utxolibcompatnamespace_to_output_script: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
28
|
+
export const wasmdashtransaction_from_bytes: (a: number, b: number, c: number) => void;
|
|
29
|
+
export const wasmdashtransaction_get_inputs: (a: number, b: number) => void;
|
|
30
|
+
export const wasmdashtransaction_get_outputs: (a: number, b: number) => void;
|
|
31
|
+
export const wasmdashtransaction_get_outputs_with_address: (a: number, b: number, c: number, d: number) => void;
|
|
32
|
+
export const wasmdashtransaction_get_txid: (a: number, b: number) => void;
|
|
33
|
+
export const wasmdashtransaction_input_count: (a: number) => number;
|
|
34
|
+
export const wasmdashtransaction_lock_time: (a: number) => number;
|
|
35
|
+
export const wasmdashtransaction_output_count: (a: number) => number;
|
|
36
|
+
export const wasmdashtransaction_to_bytes: (a: number, b: number) => void;
|
|
37
|
+
export const wasmdashtransaction_version: (a: number) => number;
|
|
38
|
+
export const wasmecpair_from_private_key: (a: number, b: number, c: number) => void;
|
|
39
|
+
export const wasmecpair_from_public_key: (a: number, b: number, c: number) => void;
|
|
40
|
+
export const wasmecpair_from_wif: (a: number, b: number, c: number) => void;
|
|
41
|
+
export const wasmecpair_from_wif_mainnet: (a: number, b: number, c: number) => void;
|
|
42
|
+
export const wasmecpair_from_wif_testnet: (a: number, b: number, c: number) => void;
|
|
43
|
+
export const wasmecpair_private_key: (a: number) => number;
|
|
44
|
+
export const wasmecpair_public_key: (a: number) => number;
|
|
45
|
+
export const wasmecpair_to_wif: (a: number, b: number) => void;
|
|
46
|
+
export const wasmecpair_to_wif_mainnet: (a: number, b: number) => void;
|
|
47
|
+
export const wasmecpair_to_wif_testnet: (a: number, b: number) => void;
|
|
48
|
+
export const wasmtransaction_add_input: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
49
|
+
export const wasmtransaction_add_input_at_index: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
50
|
+
export const wasmtransaction_add_output: (a: number, b: number, c: number, d: bigint) => number;
|
|
51
|
+
export const wasmtransaction_add_output_at_index: (a: number, b: number, c: number, d: number, e: number, f: bigint) => void;
|
|
52
|
+
export const wasmtransaction_create: () => number;
|
|
53
|
+
export const wasmtransaction_from_bytes: (a: number, b: number, c: number) => void;
|
|
54
|
+
export const wasmtransaction_get_inputs: (a: number, b: number) => void;
|
|
55
|
+
export const wasmtransaction_get_outputs: (a: number, b: number) => void;
|
|
56
|
+
export const wasmtransaction_get_outputs_with_address: (a: number, b: number, c: number, d: number) => void;
|
|
57
|
+
export const wasmtransaction_get_txid: (a: number, b: number) => void;
|
|
58
|
+
export const wasmtransaction_get_vsize: (a: number) => number;
|
|
59
|
+
export const wasmtransaction_to_bytes: (a: number, b: number) => void;
|
|
60
|
+
export const wasmutxonamespace_get_wasm_utxo_version: (a: number) => void;
|
|
61
|
+
export const wasmzcashtransaction_from_bytes: (a: number, b: number, c: number) => void;
|
|
62
|
+
export const wasmzcashtransaction_get_inputs: (a: number, b: number) => void;
|
|
63
|
+
export const wasmzcashtransaction_get_outputs: (a: number, b: number) => void;
|
|
64
|
+
export const wasmzcashtransaction_get_outputs_with_address: (a: number, b: number, c: number, d: number) => void;
|
|
65
|
+
export const wasmzcashtransaction_get_txid: (a: number, b: number) => void;
|
|
66
|
+
export const wasmzcashtransaction_to_bytes: (a: number, b: number) => void;
|
|
67
|
+
export const wrappsbt_add_input: (a: number, b: number, c: number, d: number, e: number, f: bigint, g: number, h: number, i: number) => void;
|
|
68
|
+
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;
|
|
69
|
+
export const wrappsbt_add_output: (a: number, b: number, c: number, d: bigint) => number;
|
|
70
|
+
export const wrappsbt_add_output_at_index: (a: number, b: number, c: number, d: number, e: number, f: bigint) => void;
|
|
71
|
+
export const wrappsbt_clone: (a: number) => number;
|
|
72
|
+
export const wrappsbt_delete_input_kv: (a: number, b: number, c: number, d: number) => void;
|
|
73
|
+
export const wrappsbt_delete_kv: (a: number, b: number, c: number) => void;
|
|
74
|
+
export const wrappsbt_delete_output_kv: (a: number, b: number, c: number, d: number) => void;
|
|
75
|
+
export const wrappsbt_deserialize: (a: number, b: number, c: number) => void;
|
|
76
|
+
export const wrappsbt_extract_transaction: (a: number, b: number) => void;
|
|
77
|
+
export const wrappsbt_extract_zcash_transaction: (a: number, b: number, c: number, d: number) => void;
|
|
78
|
+
export const wrappsbt_finalize_mut: (a: number, b: number) => void;
|
|
79
|
+
export const wrappsbt_finalize_mut_zcash: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
80
|
+
export const wrappsbt_get_global_xpubs: (a: number) => number;
|
|
81
|
+
export const wrappsbt_get_input_kv: (a: number, b: number, c: number, d: number) => void;
|
|
82
|
+
export const wrappsbt_get_inputs: (a: number, b: number) => void;
|
|
83
|
+
export const wrappsbt_get_kv: (a: number, b: number, c: number) => void;
|
|
84
|
+
export const wrappsbt_get_output_kv: (a: number, b: number, c: number, d: number) => void;
|
|
85
|
+
export const wrappsbt_get_outputs: (a: number, b: number) => void;
|
|
86
|
+
export const wrappsbt_get_outputs_with_address: (a: number, b: number, c: number, d: number) => void;
|
|
87
|
+
export const wrappsbt_get_partial_signatures: (a: number, b: number, c: number) => void;
|
|
88
|
+
export const wrappsbt_get_unsigned_tx: (a: number, b: number) => void;
|
|
89
|
+
export const wrappsbt_has_partial_signatures: (a: number, b: number, c: number) => void;
|
|
90
|
+
export const wrappsbt_input_count: (a: number) => number;
|
|
91
|
+
export const wrappsbt_new: (a: number, b: number) => number;
|
|
92
|
+
export const wrappsbt_output_count: (a: number) => number;
|
|
93
|
+
export const wrappsbt_remove_input: (a: number, b: number, c: number) => void;
|
|
94
|
+
export const wrappsbt_remove_output: (a: number, b: number, c: number) => void;
|
|
95
|
+
export const wrappsbt_serialize: (a: number, b: number) => void;
|
|
96
|
+
export const wrappsbt_set_input_kv: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
97
|
+
export const wrappsbt_set_kv: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
98
|
+
export const wrappsbt_set_output_kv: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
99
|
+
export const wrappsbt_sign_all: (a: number, b: number, c: number) => void;
|
|
100
|
+
export const wrappsbt_sign_all_with_ecpair: (a: number, b: number, c: number) => void;
|
|
101
|
+
export const wrappsbt_sign_with_prv: (a: number, b: number, c: number, d: number) => void;
|
|
102
|
+
export const wrappsbt_sign_with_xprv: (a: number, b: number, c: number, d: number) => void;
|
|
103
|
+
export const wrappsbt_sign_zcash_all_with_ecpair: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
104
|
+
export const wrappsbt_sign_zcash_with_prv: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
105
|
+
export const wrappsbt_unsigned_tx_id: (a: number, b: number) => void;
|
|
106
|
+
export const wrappsbt_update_input_with_descriptor: (a: number, b: number, c: number, d: number) => void;
|
|
107
|
+
export const wrappsbt_update_output_with_descriptor: (a: number, b: number, c: number, d: number) => void;
|
|
108
|
+
export const wrappsbt_validate_signature_at_input: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
109
|
+
export const wrappsbt_verify_signature_with_key: (a: number, b: number, c: number, d: number) => void;
|
|
110
|
+
export const zcash_branch_id_for_height: (a: number, b: number, c: number, d: number) => void;
|
|
111
|
+
export const zcash_ironwood_version_group_id: () => number;
|
|
112
|
+
export const zcashunifiedaddress_contains: (a: number, b: number, c: number, d: number) => void;
|
|
113
|
+
export const zcashunifiedaddress_encodeOrchardReceiver: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
114
|
+
export const zcashunifiedaddress_orchardReceiver: (a: number, b: number) => void;
|
|
115
|
+
export const zcashunifiedaddress_parse: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
116
|
+
export const zcashunifiedaddress_saplingReceiver: (a: number, b: number) => void;
|
|
117
|
+
export const zcashunifiedaddress_transparentScript: (a: number, b: number) => void;
|
|
118
|
+
export const zcashv6transaction_consensusBranchId: (a: number) => number;
|
|
119
|
+
export const zcashv6transaction_expiryHeight: (a: number) => number;
|
|
120
|
+
export const zcashv6transaction_fromBytes: (a: number, b: number, c: number) => void;
|
|
121
|
+
export const zcashv6transaction_getId: (a: number, b: number) => void;
|
|
122
|
+
export const zcashv6transaction_ironwoodActionCount: (a: number) => number;
|
|
123
|
+
export const zcashv6transaction_ironwoodAnchor: (a: number, b: number) => void;
|
|
124
|
+
export const zcashv6transaction_ironwoodFlags: (a: number) => number;
|
|
125
|
+
export const zcashv6transaction_ironwoodValueBalance: (a: number) => bigint;
|
|
126
|
+
export const zcashv6transaction_toBytes: (a: number, b: number) => void;
|
|
127
|
+
export const zcashv6transaction_transparentSighash: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
128
|
+
export const zcashv6transaction_txidBytes: (a: number, b: number) => void;
|
|
129
|
+
export const wasmtransaction_input_count: (a: number) => number;
|
|
130
|
+
export const wasmtransaction_output_count: (a: number) => number;
|
|
131
|
+
export const wasmzcashtransaction_input_count: (a: number) => number;
|
|
132
|
+
export const wasmzcashtransaction_output_count: (a: number) => number;
|
|
133
|
+
export const wasmtransaction_lock_time: (a: number) => number;
|
|
134
|
+
export const wasmtransaction_version: (a: number) => number;
|
|
135
|
+
export const wasmzcashtransaction_lock_time: (a: number) => number;
|
|
136
|
+
export const wasmzcashtransaction_version: (a: number) => number;
|
|
137
|
+
export const wrappsbt_lock_time: (a: number) => number;
|
|
138
|
+
export const wrappsbt_version: (a: number) => number;
|
|
26
139
|
export const __wbg_bitgopsbt_free: (a: number, b: number) => void;
|
|
27
140
|
export const __wbg_fixedscriptwalletnamespace_free: (a: number, b: number) => void;
|
|
28
141
|
export const __wbg_inscriptionsnamespace_free: (a: number, b: number) => void;
|
|
29
142
|
export const __wbg_wasmbip32_free: (a: number, b: number) => void;
|
|
30
143
|
export const __wbg_wasmdimensions_free: (a: number, b: number) => void;
|
|
144
|
+
export const __wbg_wasmreplayprotection_free: (a: number, b: number) => void;
|
|
31
145
|
export const __wbg_wasmrootwalletkeys_free: (a: number, b: number) => void;
|
|
32
146
|
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;
|
|
33
147
|
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;
|
|
@@ -81,6 +195,7 @@ export const bitgopsbt_get_outputs: (a: number, b: number) => void;
|
|
|
81
195
|
export const bitgopsbt_get_outputs_with_address: (a: number, b: number) => void;
|
|
82
196
|
export const bitgopsbt_get_unsigned_tx: (a: number, b: number) => void;
|
|
83
197
|
export const bitgopsbt_input_count: (a: number) => number;
|
|
198
|
+
export const bitgopsbt_ironwood_pczt_bytes: (a: number, b: number) => void;
|
|
84
199
|
export const bitgopsbt_ironwood_v6_transparent_sighash: (a: number, b: number, c: number) => void;
|
|
85
200
|
export const bitgopsbt_ironwood_v6_txid: (a: number, b: number) => void;
|
|
86
201
|
export const bitgopsbt_is_musig2_input: (a: number, b: number) => number;
|
|
@@ -123,6 +238,7 @@ export const fixedscriptwalletnamespace_supports_script_type: (a: number, b: num
|
|
|
123
238
|
export const fixedscriptwalletnamespace_to_wallet_keys: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
124
239
|
export const inscriptionsnamespace_create_inscription_reveal_data: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
125
240
|
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;
|
|
241
|
+
export const parsePsbtRawToJson: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
126
242
|
export const wasmbip32_chain_code: (a: number) => number;
|
|
127
243
|
export const wasmbip32_depth: (a: number) => number;
|
|
128
244
|
export const wasmbip32_derive: (a: number, b: number, c: number) => void;
|
|
@@ -160,156 +276,43 @@ export const wasmdimensions_get_weight: (a: number, b: number, c: number) => num
|
|
|
160
276
|
export const wasmdimensions_has_segwit: (a: number) => number;
|
|
161
277
|
export const wasmdimensions_plus: (a: number, b: number) => number;
|
|
162
278
|
export const wasmdimensions_times: (a: number, b: number) => number;
|
|
279
|
+
export const wasmreplayprotection_from_addresses: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
280
|
+
export const wasmreplayprotection_from_output_scripts: (a: number, b: number) => number;
|
|
281
|
+
export const wasmreplayprotection_from_public_keys: (a: number, b: number, c: number) => void;
|
|
163
282
|
export const wasmrootwalletkeys_backup_key: (a: number) => number;
|
|
164
283
|
export const wasmrootwalletkeys_bitgo_key: (a: number) => number;
|
|
165
284
|
export const wasmrootwalletkeys_new: (a: number, b: number, c: number, d: number) => void;
|
|
166
285
|
export const wasmrootwalletkeys_user_key: (a: number) => number;
|
|
167
286
|
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;
|
|
168
287
|
export const wasmbip32_from_bip32_properties: (a: number, b: number) => void;
|
|
169
|
-
export const bitgopsbt_sign_replay_protection_inputs: (a: number, b: number, c: number) => void;
|
|
170
|
-
export const bitgopsbt_sign_wallet_input: (a: number, b: number, c: number, d: number) => void;
|
|
171
|
-
export const bitgopsbt_sign_all_with_xpriv: (a: number, b: number, c: number) => void;
|
|
172
|
-
export const __wbg_addressnamespace_free: (a: number, b: number) => void;
|
|
173
|
-
export const __wbg_bip322namespace_free: (a: number, b: number) => void;
|
|
174
|
-
export const __wbg_messagenamespace_free: (a: number, b: number) => void;
|
|
175
|
-
export const __wbg_utxolibcompatnamespace_free: (a: number, b: number) => void;
|
|
176
|
-
export const __wbg_wasmdashtransaction_free: (a: number, b: number) => void;
|
|
177
|
-
export const __wbg_wasmecpair_free: (a: number, b: number) => void;
|
|
178
|
-
export const __wbg_wasmreplayprotection_free: (a: number, b: number) => void;
|
|
179
|
-
export const __wbg_wasmtransaction_free: (a: number, b: number) => void;
|
|
180
|
-
export const __wbg_wasmutxonamespace_free: (a: number, b: number) => void;
|
|
181
|
-
export const __wbg_wasmzcashtransaction_free: (a: number, b: number) => void;
|
|
182
|
-
export const __wbg_wrappsbt_free: (a: number, b: number) => void;
|
|
183
|
-
export const __wbg_zcashunifiedaddress_free: (a: number, b: number) => void;
|
|
184
|
-
export const __wbg_zcashv6transaction_free: (a: number, b: number) => void;
|
|
185
|
-
export const addressnamespace_from_output_script_with_coin: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
186
|
-
export const addressnamespace_to_output_script_with_coin: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
187
|
-
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;
|
|
188
|
-
export const bip322namespace_get_bip322_message: (a: number, b: number, c: number) => void;
|
|
189
|
-
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;
|
|
190
|
-
export const bip322namespace_verify_bip322_psbt_input_with_pubkeys: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => void;
|
|
191
|
-
export const bip322namespace_verify_bip322_tx_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) => void;
|
|
192
|
-
export const bip322namespace_verify_bip322_tx_input_with_pubkeys: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => void;
|
|
193
288
|
export const isInspectEnabled: () => number;
|
|
194
|
-
export const messagenamespace_sign_message: (a: number, b: number, c: number, d: number) => void;
|
|
195
|
-
export const messagenamespace_verify_message: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
196
|
-
export const parsePsbtRawToJson: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
197
|
-
export const utxolibcompatnamespace_from_output_script: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
198
|
-
export const utxolibcompatnamespace_to_output_script: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
199
|
-
export const wasmdashtransaction_from_bytes: (a: number, b: number, c: number) => void;
|
|
200
|
-
export const wasmdashtransaction_get_inputs: (a: number, b: number) => void;
|
|
201
|
-
export const wasmdashtransaction_get_outputs: (a: number, b: number) => void;
|
|
202
|
-
export const wasmdashtransaction_get_outputs_with_address: (a: number, b: number, c: number, d: number) => void;
|
|
203
|
-
export const wasmdashtransaction_get_txid: (a: number, b: number) => void;
|
|
204
|
-
export const wasmdashtransaction_input_count: (a: number) => number;
|
|
205
|
-
export const wasmdashtransaction_lock_time: (a: number) => number;
|
|
206
|
-
export const wasmdashtransaction_output_count: (a: number) => number;
|
|
207
|
-
export const wasmdashtransaction_to_bytes: (a: number, b: number) => void;
|
|
208
|
-
export const wasmdashtransaction_version: (a: number) => number;
|
|
209
|
-
export const wasmecpair_from_private_key: (a: number, b: number, c: number) => void;
|
|
210
|
-
export const wasmecpair_from_public_key: (a: number, b: number, c: number) => void;
|
|
211
|
-
export const wasmecpair_from_wif: (a: number, b: number, c: number) => void;
|
|
212
|
-
export const wasmecpair_from_wif_mainnet: (a: number, b: number, c: number) => void;
|
|
213
|
-
export const wasmecpair_from_wif_testnet: (a: number, b: number, c: number) => void;
|
|
214
|
-
export const wasmecpair_private_key: (a: number) => number;
|
|
215
|
-
export const wasmecpair_public_key: (a: number) => number;
|
|
216
|
-
export const wasmecpair_to_wif: (a: number, b: number) => void;
|
|
217
|
-
export const wasmecpair_to_wif_mainnet: (a: number, b: number) => void;
|
|
218
|
-
export const wasmecpair_to_wif_testnet: (a: number, b: number) => void;
|
|
219
|
-
export const wasmreplayprotection_from_addresses: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
220
|
-
export const wasmreplayprotection_from_output_scripts: (a: number, b: number) => number;
|
|
221
|
-
export const wasmreplayprotection_from_public_keys: (a: number, b: number, c: number) => void;
|
|
222
|
-
export const wasmtransaction_add_input: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
223
|
-
export const wasmtransaction_add_input_at_index: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
224
|
-
export const wasmtransaction_add_output: (a: number, b: number, c: number, d: bigint) => number;
|
|
225
|
-
export const wasmtransaction_add_output_at_index: (a: number, b: number, c: number, d: number, e: number, f: bigint) => void;
|
|
226
|
-
export const wasmtransaction_create: () => number;
|
|
227
|
-
export const wasmtransaction_from_bytes: (a: number, b: number, c: number) => void;
|
|
228
|
-
export const wasmtransaction_get_inputs: (a: number, b: number) => void;
|
|
229
|
-
export const wasmtransaction_get_outputs: (a: number, b: number) => void;
|
|
230
|
-
export const wasmtransaction_get_outputs_with_address: (a: number, b: number, c: number, d: number) => void;
|
|
231
|
-
export const wasmtransaction_get_txid: (a: number, b: number) => void;
|
|
232
|
-
export const wasmtransaction_get_vsize: (a: number) => number;
|
|
233
|
-
export const wasmtransaction_to_bytes: (a: number, b: number) => void;
|
|
234
|
-
export const wasmutxonamespace_get_wasm_utxo_version: (a: number) => void;
|
|
235
|
-
export const wasmzcashtransaction_from_bytes: (a: number, b: number, c: number) => void;
|
|
236
|
-
export const wasmzcashtransaction_get_inputs: (a: number, b: number) => void;
|
|
237
|
-
export const wasmzcashtransaction_get_outputs: (a: number, b: number) => void;
|
|
238
|
-
export const wasmzcashtransaction_get_outputs_with_address: (a: number, b: number, c: number, d: number) => void;
|
|
239
|
-
export const wasmzcashtransaction_get_txid: (a: number, b: number) => void;
|
|
240
|
-
export const wasmzcashtransaction_to_bytes: (a: number, b: number) => void;
|
|
241
|
-
export const wrappsbt_add_input: (a: number, b: number, c: number, d: number, e: number, f: bigint, g: number, h: number, i: number) => void;
|
|
242
|
-
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;
|
|
243
|
-
export const wrappsbt_add_output: (a: number, b: number, c: number, d: bigint) => number;
|
|
244
|
-
export const wrappsbt_add_output_at_index: (a: number, b: number, c: number, d: number, e: number, f: bigint) => void;
|
|
245
|
-
export const wrappsbt_clone: (a: number) => number;
|
|
246
|
-
export const wrappsbt_delete_input_kv: (a: number, b: number, c: number, d: number) => void;
|
|
247
|
-
export const wrappsbt_delete_kv: (a: number, b: number, c: number) => void;
|
|
248
|
-
export const wrappsbt_delete_output_kv: (a: number, b: number, c: number, d: number) => void;
|
|
249
|
-
export const wrappsbt_deserialize: (a: number, b: number, c: number) => void;
|
|
250
|
-
export const wrappsbt_extract_transaction: (a: number, b: number) => void;
|
|
251
|
-
export const wrappsbt_extract_zcash_transaction: (a: number, b: number, c: number, d: number) => void;
|
|
252
|
-
export const wrappsbt_finalize_mut: (a: number, b: number) => void;
|
|
253
|
-
export const wrappsbt_finalize_mut_zcash: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
254
|
-
export const wrappsbt_get_global_xpubs: (a: number) => number;
|
|
255
|
-
export const wrappsbt_get_input_kv: (a: number, b: number, c: number, d: number) => void;
|
|
256
|
-
export const wrappsbt_get_inputs: (a: number, b: number) => void;
|
|
257
|
-
export const wrappsbt_get_kv: (a: number, b: number, c: number) => void;
|
|
258
|
-
export const wrappsbt_get_output_kv: (a: number, b: number, c: number, d: number) => void;
|
|
259
|
-
export const wrappsbt_get_outputs: (a: number, b: number) => void;
|
|
260
|
-
export const wrappsbt_get_outputs_with_address: (a: number, b: number, c: number, d: number) => void;
|
|
261
|
-
export const wrappsbt_get_partial_signatures: (a: number, b: number, c: number) => void;
|
|
262
|
-
export const wrappsbt_get_unsigned_tx: (a: number, b: number) => void;
|
|
263
|
-
export const wrappsbt_has_partial_signatures: (a: number, b: number, c: number) => void;
|
|
264
|
-
export const wrappsbt_input_count: (a: number) => number;
|
|
265
|
-
export const wrappsbt_new: (a: number, b: number) => number;
|
|
266
|
-
export const wrappsbt_output_count: (a: number) => number;
|
|
267
|
-
export const wrappsbt_remove_input: (a: number, b: number, c: number) => void;
|
|
268
|
-
export const wrappsbt_remove_output: (a: number, b: number, c: number) => void;
|
|
269
|
-
export const wrappsbt_serialize: (a: number, b: number) => void;
|
|
270
|
-
export const wrappsbt_set_input_kv: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
271
|
-
export const wrappsbt_set_kv: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
272
|
-
export const wrappsbt_set_output_kv: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
273
|
-
export const wrappsbt_sign_all: (a: number, b: number, c: number) => void;
|
|
274
|
-
export const wrappsbt_sign_all_with_ecpair: (a: number, b: number, c: number) => void;
|
|
275
|
-
export const wrappsbt_sign_with_prv: (a: number, b: number, c: number, d: number) => void;
|
|
276
|
-
export const wrappsbt_sign_with_xprv: (a: number, b: number, c: number, d: number) => void;
|
|
277
|
-
export const wrappsbt_sign_zcash_all_with_ecpair: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
278
|
-
export const wrappsbt_sign_zcash_with_prv: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
279
|
-
export const wrappsbt_unsigned_tx_id: (a: number, b: number) => void;
|
|
280
|
-
export const wrappsbt_update_input_with_descriptor: (a: number, b: number, c: number, d: number) => void;
|
|
281
|
-
export const wrappsbt_update_output_with_descriptor: (a: number, b: number, c: number, d: number) => void;
|
|
282
|
-
export const wrappsbt_validate_signature_at_input: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
283
|
-
export const wrappsbt_verify_signature_with_key: (a: number, b: number, c: number, d: number) => void;
|
|
284
|
-
export const zcash_branch_id_for_height: (a: number, b: number, c: number, d: number) => void;
|
|
285
|
-
export const zcash_ironwood_version_group_id: () => number;
|
|
286
|
-
export const zcashunifiedaddress_contains: (a: number, b: number, c: number, d: number) => void;
|
|
287
|
-
export const zcashunifiedaddress_orchardReceiver: (a: number, b: number) => void;
|
|
288
|
-
export const zcashunifiedaddress_parse: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
289
|
-
export const zcashunifiedaddress_saplingReceiver: (a: number, b: number) => void;
|
|
290
|
-
export const zcashunifiedaddress_transparentScript: (a: number, b: number) => void;
|
|
291
|
-
export const zcashv6transaction_consensusBranchId: (a: number) => number;
|
|
292
|
-
export const zcashv6transaction_expiryHeight: (a: number) => number;
|
|
293
|
-
export const zcashv6transaction_fromBytes: (a: number, b: number, c: number) => void;
|
|
294
|
-
export const zcashv6transaction_getId: (a: number, b: number) => void;
|
|
295
|
-
export const zcashv6transaction_ironwoodActionCount: (a: number) => number;
|
|
296
|
-
export const zcashv6transaction_ironwoodAnchor: (a: number, b: number) => void;
|
|
297
|
-
export const zcashv6transaction_ironwoodFlags: (a: number) => number;
|
|
298
|
-
export const zcashv6transaction_ironwoodValueBalance: (a: number) => bigint;
|
|
299
|
-
export const zcashv6transaction_toBytes: (a: number, b: number) => void;
|
|
300
|
-
export const zcashv6transaction_txidBytes: (a: number, b: number) => void;
|
|
301
|
-
export const wasmtransaction_input_count: (a: number) => number;
|
|
302
|
-
export const wasmtransaction_output_count: (a: number) => number;
|
|
303
|
-
export const wasmzcashtransaction_input_count: (a: number) => number;
|
|
304
|
-
export const wasmzcashtransaction_output_count: (a: number) => number;
|
|
305
289
|
export const parsePsbtToJson: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
306
290
|
export const parseTxToJson: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
307
|
-
export const
|
|
308
|
-
export const
|
|
309
|
-
export const
|
|
310
|
-
export const
|
|
311
|
-
export const
|
|
312
|
-
export const
|
|
291
|
+
export const bitgopsbt_sign_replay_protection_inputs: (a: number, b: number, c: number) => void;
|
|
292
|
+
export const bitgopsbt_sign_wallet_input: (a: number, b: number, c: number, d: number) => void;
|
|
293
|
+
export const bitgopsbt_sign_all_with_xpriv: (a: number, b: number, c: number) => void;
|
|
294
|
+
export const __wbg_wrapdescriptor_free: (a: number, b: number) => void;
|
|
295
|
+
export const __wbg_wrapminiscript_free: (a: number, b: number) => void;
|
|
296
|
+
export const wrapdescriptor_atDerivationIndex: (a: number, b: number, c: number) => void;
|
|
297
|
+
export const wrapdescriptor_descType: (a: number, b: number) => void;
|
|
298
|
+
export const wrapdescriptor_encode: (a: number, b: number) => void;
|
|
299
|
+
export const wrapdescriptor_fromString: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
300
|
+
export const wrapdescriptor_fromStringDetectType: (a: number, b: number, c: number) => void;
|
|
301
|
+
export const wrapdescriptor_fromStringExt: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
302
|
+
export const wrapdescriptor_hasWildcard: (a: number) => number;
|
|
303
|
+
export const wrapdescriptor_maxWeightToSatisfy: (a: number, b: number) => void;
|
|
304
|
+
export const wrapdescriptor_node: (a: number, b: number) => void;
|
|
305
|
+
export const wrapdescriptor_scriptPubkey: (a: number, b: number) => void;
|
|
306
|
+
export const wrapdescriptor_toAsmString: (a: number, b: number) => void;
|
|
307
|
+
export const wrapdescriptor_toString: (a: number, b: number) => void;
|
|
308
|
+
export const wrapminiscript_encode: (a: number, b: number) => void;
|
|
309
|
+
export const wrapminiscript_fromBitcoinScript: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
310
|
+
export const wrapminiscript_fromBitcoinScriptExt: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
311
|
+
export const wrapminiscript_fromString: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
312
|
+
export const wrapminiscript_fromStringExt: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
313
|
+
export const wrapminiscript_node: (a: number, b: number) => void;
|
|
314
|
+
export const wrapminiscript_toAsmString: (a: number, b: number) => void;
|
|
315
|
+
export const wrapminiscript_toString: (a: number, b: number) => void;
|
|
313
316
|
export const rustsecp256k1_v0_10_0_context_create: (a: number) => number;
|
|
314
317
|
export const rustsecp256k1_v0_10_0_context_destroy: (a: number) => void;
|
|
315
318
|
export const rustsecp256k1_v0_10_0_default_error_callback_fn: (a: number, b: number) => void;
|
package/dist/esm/js/address.d.ts
CHANGED
|
@@ -4,5 +4,13 @@ import type { CoinName } from "./coinName.js";
|
|
|
4
4
|
* For Bitcoin Cash and eCash, we can select between base58check and cashaddr.
|
|
5
5
|
*/
|
|
6
6
|
export type AddressFormat = "default" | "cashaddr";
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* @param canBeShieldedOutput - When set and `address` is a ZIP-316 unified address carrying an
|
|
9
|
+
* Orchard/Ironwood receiver, returns that raw 43-byte receiver instead of a transparent
|
|
10
|
+
* scriptPubKey (there is no scriptPubKey for a shielded output). `address` is only even
|
|
11
|
+
* attempted as a unified address when this is set. If `address` looks like a unified address for
|
|
12
|
+
* this coin's network but is malformed, or has no Orchard/Ironwood receiver (e.g. Sapling-only),
|
|
13
|
+
* this throws rather than falling back to the transparent path.
|
|
14
|
+
*/
|
|
15
|
+
export declare function toOutputScriptWithCoin(address: string, coin: CoinName, canBeShieldedOutput?: boolean): Uint8Array;
|
|
8
16
|
export declare function fromOutputScriptWithCoin(script: Uint8Array, coin: CoinName, format?: AddressFormat): string;
|
package/dist/esm/js/address.js
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { AddressNamespace } from "./wasm/wasm_utxo.js";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
/**
|
|
3
|
+
* @param canBeShieldedOutput - When set and `address` is a ZIP-316 unified address carrying an
|
|
4
|
+
* Orchard/Ironwood receiver, returns that raw 43-byte receiver instead of a transparent
|
|
5
|
+
* scriptPubKey (there is no scriptPubKey for a shielded output). `address` is only even
|
|
6
|
+
* attempted as a unified address when this is set. If `address` looks like a unified address for
|
|
7
|
+
* this coin's network but is malformed, or has no Orchard/Ironwood receiver (e.g. Sapling-only),
|
|
8
|
+
* this throws rather than falling back to the transparent path.
|
|
9
|
+
*/
|
|
10
|
+
export function toOutputScriptWithCoin(address, coin, canBeShieldedOutput) {
|
|
11
|
+
return AddressNamespace.to_output_script_with_coin(address, coin, canBeShieldedOutput);
|
|
4
12
|
}
|
|
5
13
|
export function fromOutputScriptWithCoin(script, coin, format) {
|
|
6
14
|
return AddressNamespace.from_output_script_with_coin(script, coin, format);
|
|
@@ -40,6 +40,16 @@ export type ParsedOutput = {
|
|
|
40
40
|
paygo: boolean;
|
|
41
41
|
/** Full BIP32 derivation path from the wallet xpub (e.g. "0/1"). Null for external outputs. */
|
|
42
42
|
derivationPath: string | null;
|
|
43
|
+
/**
|
|
44
|
+
* True for a shielded (Orchard/Ironwood) output. Such an output has no `unsigned_tx` entry of
|
|
45
|
+
* its own — it lives in the PSBT's proprietary-map PCZT, read from its plaintext (not
|
|
46
|
+
* encrypted/decrypted) recipient field. `address` is a single-receiver ZIP-316 unified address
|
|
47
|
+
* (`u1...`/`utest1...`) encoding that receiver — a real, usable Zcash address, though not
|
|
48
|
+
* necessarily byte-identical to whatever multi-receiver UA the sender originally pasted in (a
|
|
49
|
+
* UA with a transparent/Sapling receiver too would round-trip to a different string carrying
|
|
50
|
+
* only the Orchard one). `script` holds the same receiver as raw 43 bytes.
|
|
51
|
+
*/
|
|
52
|
+
isShielded: boolean;
|
|
43
53
|
};
|
|
44
54
|
export type ParsedTransaction = {
|
|
45
55
|
inputs: ParsedInput[];
|
|
@@ -230,4 +230,18 @@ export declare class ZcashIronwoodBitGoPsbt extends ZcashBitGoPsbt {
|
|
|
230
230
|
* errors (bad proof, unsigned input) leaves the PSBT retryable.
|
|
231
231
|
*/
|
|
232
232
|
combineProof(proof: Uint8Array): Uint8Array;
|
|
233
|
+
/**
|
|
234
|
+
* The raw serialized orchard PCZT (Partially Created Zcash Transaction) bundle stored in this
|
|
235
|
+
* PSBT, or `undefined` if none is present.
|
|
236
|
+
*
|
|
237
|
+
* A PCZT is the shielded-bundle counterpart to a PSBT: it accumulates the orchard action
|
|
238
|
+
* (spend + output), the ZIP-244-committed `out_ciphertext`, and — once {@link combineProof} has
|
|
239
|
+
* run — the Halo2 `zkproof` and binding signature, bridging this PSBT to the external proof
|
|
240
|
+
* service and back.
|
|
241
|
+
*
|
|
242
|
+
* Present only after {@link addShieldedOutput} has been called; `undefined` beforehand, and
|
|
243
|
+
* `undefined` again after {@link combineProof} succeeds, since that call drops the stored PCZT
|
|
244
|
+
* to make extraction terminal (see its doc comment).
|
|
245
|
+
*/
|
|
246
|
+
getPczt(): Uint8Array | undefined;
|
|
233
247
|
}
|
|
@@ -219,4 +219,20 @@ export class ZcashIronwoodBitGoPsbt extends ZcashBitGoPsbt {
|
|
|
219
219
|
combineProof(proof) {
|
|
220
220
|
return this.wasm.combine_ironwood_proof(proof);
|
|
221
221
|
}
|
|
222
|
+
/**
|
|
223
|
+
* The raw serialized orchard PCZT (Partially Created Zcash Transaction) bundle stored in this
|
|
224
|
+
* PSBT, or `undefined` if none is present.
|
|
225
|
+
*
|
|
226
|
+
* A PCZT is the shielded-bundle counterpart to a PSBT: it accumulates the orchard action
|
|
227
|
+
* (spend + output), the ZIP-244-committed `out_ciphertext`, and — once {@link combineProof} has
|
|
228
|
+
* run — the Halo2 `zkproof` and binding signature, bridging this PSBT to the external proof
|
|
229
|
+
* service and back.
|
|
230
|
+
*
|
|
231
|
+
* Present only after {@link addShieldedOutput} has been called; `undefined` beforehand, and
|
|
232
|
+
* `undefined` again after {@link combineProof} succeeds, since that call drops the stored PCZT
|
|
233
|
+
* to make extraction terminal (see its doc comment).
|
|
234
|
+
*/
|
|
235
|
+
getPczt() {
|
|
236
|
+
return this.wasm.ironwood_pczt_bytes();
|
|
237
|
+
}
|
|
222
238
|
}
|
|
@@ -52,6 +52,19 @@ export declare class ZcashUnifiedAddress {
|
|
|
52
52
|
* @throws If `candidate` is malformed or on the wrong network
|
|
53
53
|
*/
|
|
54
54
|
contains(candidate: string): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Encode a raw 43-byte Orchard/Ironwood receiver as a single-receiver Unified Address.
|
|
57
|
+
*
|
|
58
|
+
* Deliberately narrower than a general UA encoder: this always produces exactly one receiver,
|
|
59
|
+
* so it can't reproduce a multi-receiver UA (transparent + Sapling + Orchard) a sender might
|
|
60
|
+
* have originally pasted in — it only gives back *a* valid, usable address for the
|
|
61
|
+
* Orchard/Ironwood receiver itself.
|
|
62
|
+
*
|
|
63
|
+
* @param receiver - 43-byte raw Orchard/Ironwood receiver
|
|
64
|
+
* @param network - Zcash network name ("zcash", "zcashTest", "zec", "tzec")
|
|
65
|
+
* @throws If `receiver` is not 43 bytes, or `network` is unrecognized
|
|
66
|
+
*/
|
|
67
|
+
static encodeOrchardReceiver(receiver: Uint8Array, network: ZcashNetworkName): string;
|
|
55
68
|
/** @internal */
|
|
56
69
|
get wasm(): WasmZcashUnifiedAddress;
|
|
57
70
|
}
|
|
@@ -63,6 +63,21 @@ export class ZcashUnifiedAddress {
|
|
|
63
63
|
contains(candidate) {
|
|
64
64
|
return this._wasm.contains(candidate);
|
|
65
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* Encode a raw 43-byte Orchard/Ironwood receiver as a single-receiver Unified Address.
|
|
68
|
+
*
|
|
69
|
+
* Deliberately narrower than a general UA encoder: this always produces exactly one receiver,
|
|
70
|
+
* so it can't reproduce a multi-receiver UA (transparent + Sapling + Orchard) a sender might
|
|
71
|
+
* have originally pasted in — it only gives back *a* valid, usable address for the
|
|
72
|
+
* Orchard/Ironwood receiver itself.
|
|
73
|
+
*
|
|
74
|
+
* @param receiver - 43-byte raw Orchard/Ironwood receiver
|
|
75
|
+
* @param network - Zcash network name ("zcash", "zcashTest", "zec", "tzec")
|
|
76
|
+
* @throws If `receiver` is not 43 bytes, or `network` is unrecognized
|
|
77
|
+
*/
|
|
78
|
+
static encodeOrchardReceiver(receiver, network) {
|
|
79
|
+
return WasmZcashUnifiedAddress.encodeOrchardReceiver(receiver, network);
|
|
80
|
+
}
|
|
66
81
|
/** @internal */
|
|
67
82
|
get wasm() {
|
|
68
83
|
return this._wasm;
|
|
@@ -40,6 +40,15 @@ export declare class ZcashV6Transaction {
|
|
|
40
40
|
get ironwoodFlags(): number | undefined;
|
|
41
41
|
/** The Ironwood note-commitment tree anchor (32 bytes), or `undefined`. */
|
|
42
42
|
get ironwoodAnchor(): Uint8Array | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* The ZIP-244 per-input transparent sighash (32 bytes) for transparent input `index` —
|
|
45
|
+
* for a transaction inspected directly from its raw bytes rather than one built via a
|
|
46
|
+
* PSBT (e.g. independently verifying an already-broadcast transaction's signatures).
|
|
47
|
+
*
|
|
48
|
+
* `inputAmounts`/`inputScriptPubkeys` are the spent outputs' values (zatoshi) and
|
|
49
|
+
* scriptPubKeys for *every* transparent input of this transaction, in input order.
|
|
50
|
+
*/
|
|
51
|
+
transparentSighash(index: number, inputAmounts: bigint[], inputScriptPubkeys: Uint8Array[]): Uint8Array;
|
|
43
52
|
/** @internal */
|
|
44
53
|
get wasm(): WasmZcashV6Transaction;
|
|
45
54
|
}
|
|
@@ -62,6 +62,17 @@ export class ZcashV6Transaction {
|
|
|
62
62
|
get ironwoodAnchor() {
|
|
63
63
|
return this._wasm.ironwoodAnchor;
|
|
64
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* The ZIP-244 per-input transparent sighash (32 bytes) for transparent input `index` —
|
|
67
|
+
* for a transaction inspected directly from its raw bytes rather than one built via a
|
|
68
|
+
* PSBT (e.g. independently verifying an already-broadcast transaction's signatures).
|
|
69
|
+
*
|
|
70
|
+
* `inputAmounts`/`inputScriptPubkeys` are the spent outputs' values (zatoshi) and
|
|
71
|
+
* scriptPubKeys for *every* transparent input of this transaction, in input order.
|
|
72
|
+
*/
|
|
73
|
+
transparentSighash(index, inputAmounts, inputScriptPubkeys) {
|
|
74
|
+
return this._wasm.transparentSighash(index, BigInt64Array.from(inputAmounts), inputScriptPubkeys);
|
|
75
|
+
}
|
|
65
76
|
/** @internal */
|
|
66
77
|
get wasm() {
|
|
67
78
|
return this._wasm;
|
|
@@ -6,7 +6,13 @@ export class AddressNamespace {
|
|
|
6
6
|
free(): void;
|
|
7
7
|
[Symbol.dispose](): void;
|
|
8
8
|
static from_output_script_with_coin(script: Uint8Array, coin: string, format?: string | null): string;
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* `can_be_shielded_output`: when set and `address` is a ZIP-316 unified address carrying an
|
|
11
|
+
* Orchard/Ironwood receiver, returns that raw 43-byte receiver instead of a transparent
|
|
12
|
+
* scriptPubKey. See [`to_output_script_or_shielded_receiver_with_coin`] for the exact
|
|
13
|
+
* fallback/error rules.
|
|
14
|
+
*/
|
|
15
|
+
static to_output_script_with_coin(address: string, coin: string, can_be_shielded_output?: boolean | null): Uint8Array;
|
|
10
16
|
}
|
|
11
17
|
|
|
12
18
|
/**
|
|
@@ -474,6 +480,21 @@ export class BitGoPsbt {
|
|
|
474
480
|
*/
|
|
475
481
|
get_unsigned_tx(): Uint8Array;
|
|
476
482
|
input_count(): number;
|
|
483
|
+
/**
|
|
484
|
+
* The raw serialized orchard PCZT (Partially Created Zcash Transaction) bundle stored in
|
|
485
|
+
* this v6 (Ironwood) PSBT's proprietary key-value map, or `undefined` if none is present.
|
|
486
|
+
*
|
|
487
|
+
* A PCZT is the shielded-bundle counterpart to a PSBT: it accumulates the orchard action
|
|
488
|
+
* (spend + output), the ZIP-244-committed `out_ciphertext`, and — once
|
|
489
|
+
* [`Self::combine_ironwood_proof`] has run — the Halo2 `zkproof` and binding signature,
|
|
490
|
+
* bridging this PSBT to the external proof service and back (see
|
|
491
|
+
* [`crate::zcash::ironwood_pczt`] / [`crate::zcash::ironwood_build`]).
|
|
492
|
+
*
|
|
493
|
+
* Present only after [`Self::add_ironwood_output`] has been called on a v6 PSBT; `undefined`
|
|
494
|
+
* beforehand, and `undefined` again after [`Self::combine_ironwood_proof`] succeeds, since
|
|
495
|
+
* that call drops the stored PCZT to make extraction terminal (see its doc comment).
|
|
496
|
+
*/
|
|
497
|
+
ironwood_pczt_bytes(): Uint8Array | undefined;
|
|
477
498
|
/**
|
|
478
499
|
* The ZIP-244 per-input transparent sighash (32 bytes) that the key controlling transparent
|
|
479
500
|
* input `index` must sign.
|
|
@@ -1689,6 +1710,16 @@ export class ZcashUnifiedAddress {
|
|
|
1689
1710
|
* on the same network) is a receiver of this Unified Address.
|
|
1690
1711
|
*/
|
|
1691
1712
|
contains(candidate: string): boolean;
|
|
1713
|
+
/**
|
|
1714
|
+
* Encode a raw 43-byte Orchard/Ironwood receiver as a single-receiver Unified Address for
|
|
1715
|
+
* `network` ("zcash"/"zec" or "zcashTest"/"tzec").
|
|
1716
|
+
*
|
|
1717
|
+
* Deliberately narrower than a general UA encoder: this always produces exactly one
|
|
1718
|
+
* receiver, so it can't reproduce a multi-receiver UA (transparent + Sapling + Orchard) a
|
|
1719
|
+
* sender might have originally pasted in — only give back *a* valid, usable address for the
|
|
1720
|
+
* Orchard/Ironwood receiver itself.
|
|
1721
|
+
*/
|
|
1722
|
+
static encodeOrchardReceiver(receiver: Uint8Array, network: string): string;
|
|
1692
1723
|
/**
|
|
1693
1724
|
* Parse a Unified Address for `network` ("zcash"/"zec" or "zcashTest"/"tzec").
|
|
1694
1725
|
*
|
|
@@ -1738,6 +1769,18 @@ export class ZcashV6Transaction {
|
|
|
1738
1769
|
* Serialize back to raw v6 wire bytes.
|
|
1739
1770
|
*/
|
|
1740
1771
|
toBytes(): Uint8Array;
|
|
1772
|
+
/**
|
|
1773
|
+
* The ZIP-244 per-input transparent sighash (32 bytes) for transparent input `index` of
|
|
1774
|
+
* this transaction — the free-standing counterpart to
|
|
1775
|
+
* `ZcashIronwoodBitGoPsbt.transparentSighash`, for a transaction inspected directly from
|
|
1776
|
+
* its raw bytes rather than one built via this codebase's PSBT flow (e.g. independently
|
|
1777
|
+
* verifying an already-broadcast transaction's signatures).
|
|
1778
|
+
*
|
|
1779
|
+
* `input_amounts`/`input_script_pubkeys` are the spent outputs' values (zatoshi) and
|
|
1780
|
+
* scriptPubKeys for *every* transparent input of this transaction, in input order — the
|
|
1781
|
+
* same data `add-input`/`addWalletInput` would have carried in a PSBT's `witness_utxo`.
|
|
1782
|
+
*/
|
|
1783
|
+
transparentSighash(index: number, input_amounts: BigInt64Array, input_script_pubkeys: Uint8Array[]): Uint8Array;
|
|
1741
1784
|
/**
|
|
1742
1785
|
* The ZIP-244 txid in internal (non-reversed) byte order.
|
|
1743
1786
|
*/
|