@bitgo/wasm-utxo 3.0.0 → 4.0.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.
@@ -1,4 +1,4 @@
1
- import { WasmDashTransaction, WasmTransaction, WasmZcashTransaction } from "./wasm/wasm_utxo.js";
1
+ import { WasmDashTransaction, WasmTransaction, WasmZcashTransaction, } from "./wasm/wasm_utxo.js";
2
2
  /**
3
3
  * Transaction wrapper (Bitcoin-like networks)
4
4
  *
@@ -18,9 +18,7 @@ export class Transaction {
18
18
  static fromBytes(bytes) {
19
19
  return new Transaction(WasmTransaction.from_bytes(bytes));
20
20
  }
21
- /**
22
- * @internal Create from WASM instance directly (avoids re-parsing bytes)
23
- */
21
+ /** @internal Create from WASM instance directly (avoids re-parsing bytes) */
24
22
  static fromWasm(wasm) {
25
23
  return new Transaction(wasm);
26
24
  }
@@ -67,9 +65,28 @@ export class Transaction {
67
65
  getVSize() {
68
66
  return this._wasm.get_vsize();
69
67
  }
70
- /**
71
- * @internal
72
- */
68
+ inputCount() {
69
+ return this._wasm.input_count();
70
+ }
71
+ outputCount() {
72
+ return this._wasm.output_count();
73
+ }
74
+ version() {
75
+ return this._wasm.version();
76
+ }
77
+ lockTime() {
78
+ return this._wasm.lock_time();
79
+ }
80
+ getInputs() {
81
+ return this._wasm.get_inputs();
82
+ }
83
+ getOutputs() {
84
+ return this._wasm.get_outputs();
85
+ }
86
+ getOutputsWithAddress(coin) {
87
+ return this._wasm.get_outputs_with_address(coin);
88
+ }
89
+ /** @internal */
73
90
  get wasm() {
74
91
  return this._wasm;
75
92
  }
@@ -87,9 +104,7 @@ export class ZcashTransaction {
87
104
  static fromBytes(bytes) {
88
105
  return new ZcashTransaction(WasmZcashTransaction.from_bytes(bytes));
89
106
  }
90
- /**
91
- * @internal Create from WASM instance directly (avoids re-parsing bytes)
92
- */
107
+ /** @internal Create from WASM instance directly (avoids re-parsing bytes) */
93
108
  static fromWasm(wasm) {
94
109
  return new ZcashTransaction(wasm);
95
110
  }
@@ -107,9 +122,28 @@ export class ZcashTransaction {
107
122
  getId() {
108
123
  return this._wasm.get_txid();
109
124
  }
110
- /**
111
- * @internal
112
- */
125
+ inputCount() {
126
+ return this._wasm.input_count();
127
+ }
128
+ outputCount() {
129
+ return this._wasm.output_count();
130
+ }
131
+ version() {
132
+ return this._wasm.version();
133
+ }
134
+ lockTime() {
135
+ return this._wasm.lock_time();
136
+ }
137
+ getInputs() {
138
+ return this._wasm.get_inputs();
139
+ }
140
+ getOutputs() {
141
+ return this._wasm.get_outputs();
142
+ }
143
+ getOutputsWithAddress(coin) {
144
+ return this._wasm.get_outputs_with_address(coin);
145
+ }
146
+ /** @internal */
113
147
  get wasm() {
114
148
  return this._wasm;
115
149
  }
@@ -127,9 +161,7 @@ export class DashTransaction {
127
161
  static fromBytes(bytes) {
128
162
  return new DashTransaction(WasmDashTransaction.from_bytes(bytes));
129
163
  }
130
- /**
131
- * @internal Create from WASM instance directly (avoids re-parsing bytes)
132
- */
164
+ /** @internal Create from WASM instance directly (avoids re-parsing bytes) */
133
165
  static fromWasm(wasm) {
134
166
  return new DashTransaction(wasm);
135
167
  }
@@ -147,9 +179,28 @@ export class DashTransaction {
147
179
  getId() {
148
180
  return this._wasm.get_txid();
149
181
  }
150
- /**
151
- * @internal
152
- */
182
+ inputCount() {
183
+ return this._wasm.input_count();
184
+ }
185
+ outputCount() {
186
+ return this._wasm.output_count();
187
+ }
188
+ version() {
189
+ return this._wasm.version();
190
+ }
191
+ lockTime() {
192
+ return this._wasm.lock_time();
193
+ }
194
+ getInputs() {
195
+ return this._wasm.get_inputs();
196
+ }
197
+ getOutputs() {
198
+ return this._wasm.get_outputs();
199
+ }
200
+ getOutputsWithAddress(coin) {
201
+ return this._wasm.get_outputs_with_address(coin);
202
+ }
203
+ /** @internal */
153
204
  get wasm() {
154
205
  return this._wasm;
155
206
  }
@@ -36,6 +36,11 @@ export class Bip322Namespace {
36
36
  * The index of the added input
37
37
  */
38
38
  static add_bip322_input(psbt: BitGoPsbt, message: string, chain: number, index: number, wallet_keys: WasmRootWalletKeys, signer?: string | null, cosigner?: string | null, tag?: string | null): number;
39
+ /**
40
+ * Get the BIP322 message stored at a PSBT input index.
41
+ * Returns null if no message is stored.
42
+ */
43
+ static get_bip322_message(psbt: BitGoPsbt, input_index: number): string | undefined;
39
44
  /**
40
45
  * Verify a single input of a BIP-0322 PSBT proof
41
46
  *
@@ -289,6 +294,16 @@ export class BitGoPsbt {
289
294
  * Deserialize a PSBT from bytes with network-specific logic
290
295
  */
291
296
  static from_bytes(bytes: Uint8Array, network: string): BitGoPsbt;
297
+ /**
298
+ * Convert a half-signed legacy transaction to a psbt-lite.
299
+ *
300
+ * # Arguments
301
+ * * `tx_bytes` - The serialized half-signed legacy transaction
302
+ * * `network` - Network name (utxolib or coin name)
303
+ * * `wallet_keys` - The wallet's root keys
304
+ * * `unspents` - Array of `{ chain: number, index: number, value: bigint }` for each input
305
+ */
306
+ static from_half_signed_legacy_transaction(tx_bytes: Uint8Array, network: string, wallet_keys: WasmRootWalletKeys, unspents: any): BitGoPsbt;
292
307
  /**
293
308
  * Generate and store MuSig2 nonces for all MuSig2 inputs
294
309
  *
@@ -899,6 +914,9 @@ export class WasmDashTransaction {
899
914
  * Deserialize a Dash transaction from bytes (supports EVO special tx extra payload).
900
915
  */
901
916
  static from_bytes(bytes: Uint8Array): WasmDashTransaction;
917
+ get_inputs(): any;
918
+ get_outputs(): any;
919
+ get_outputs_with_address(coin: string): any;
902
920
  /**
903
921
  * Get the transaction ID (txid)
904
922
  *
@@ -912,10 +930,14 @@ export class WasmDashTransaction {
912
930
  * Returns an error if the transaction cannot be serialized
913
931
  */
914
932
  get_txid(): string;
933
+ input_count(): number;
934
+ lock_time(): number;
935
+ output_count(): number;
915
936
  /**
916
937
  * Serialize the Dash transaction to bytes (preserving tx_type and extra payload).
917
938
  */
918
939
  to_bytes(): Uint8Array;
940
+ version(): number;
919
941
  }
920
942
 
921
943
  /**
@@ -1175,6 +1197,9 @@ export class WasmTransaction {
1175
1197
  * Returns an error if the bytes cannot be parsed as a valid transaction
1176
1198
  */
1177
1199
  static from_bytes(bytes: Uint8Array): WasmTransaction;
1200
+ get_inputs(): any;
1201
+ get_outputs(): any;
1202
+ get_outputs_with_address(coin: string): any;
1178
1203
  /**
1179
1204
  * Get the transaction ID (txid)
1180
1205
  *
@@ -1196,6 +1221,9 @@ export class WasmTransaction {
1196
1221
  * The virtual size in virtual bytes (vbytes)
1197
1222
  */
1198
1223
  get_vsize(): number;
1224
+ input_count(): number;
1225
+ lock_time(): number;
1226
+ output_count(): number;
1199
1227
  /**
1200
1228
  * Serialize the transaction to bytes
1201
1229
  *
@@ -1203,6 +1231,7 @@ export class WasmTransaction {
1203
1231
  * The serialized transaction bytes
1204
1232
  */
1205
1233
  to_bytes(): Uint8Array;
1234
+ version(): number;
1206
1235
  }
1207
1236
 
1208
1237
  /**
@@ -1228,6 +1257,9 @@ export class WasmZcashTransaction {
1228
1257
  * Returns an error if the bytes cannot be parsed as a valid Zcash transaction
1229
1258
  */
1230
1259
  static from_bytes(bytes: Uint8Array): WasmZcashTransaction;
1260
+ get_inputs(): any;
1261
+ get_outputs(): any;
1262
+ get_outputs_with_address(coin: string): any;
1231
1263
  /**
1232
1264
  * Get the transaction ID (txid)
1233
1265
  *
@@ -1241,6 +1273,9 @@ export class WasmZcashTransaction {
1241
1273
  * Returns an error if the transaction cannot be serialized
1242
1274
  */
1243
1275
  get_txid(): string;
1276
+ input_count(): number;
1277
+ lock_time(): number;
1278
+ output_count(): number;
1244
1279
  /**
1245
1280
  * Serialize the transaction to bytes
1246
1281
  *
@@ -1248,6 +1283,7 @@ export class WasmZcashTransaction {
1248
1283
  * The serialized transaction bytes
1249
1284
  */
1250
1285
  to_bytes(): Uint8Array;
1286
+ version(): number;
1251
1287
  }
1252
1288
 
1253
1289
  export class WrapDescriptor {
@@ -142,6 +142,35 @@ export class Bip322Namespace {
142
142
  wasm.__wbindgen_add_to_stack_pointer(16);
143
143
  }
144
144
  }
145
+ /**
146
+ * Get the BIP322 message stored at a PSBT input index.
147
+ * Returns null if no message is stored.
148
+ * @param {BitGoPsbt} psbt
149
+ * @param {number} input_index
150
+ * @returns {string | undefined}
151
+ */
152
+ static get_bip322_message(psbt, input_index) {
153
+ try {
154
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
155
+ _assertClass(psbt, BitGoPsbt);
156
+ wasm.bip322namespace_get_bip322_message(retptr, psbt.__wbg_ptr, input_index);
157
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
158
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
159
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
160
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
161
+ if (r3) {
162
+ throw takeObject(r2);
163
+ }
164
+ let v1;
165
+ if (r0 !== 0) {
166
+ v1 = getStringFromWasm0(r0, r1).slice();
167
+ wasm.__wbindgen_export4(r0, r1 * 1, 1);
168
+ }
169
+ return v1;
170
+ } finally {
171
+ wasm.__wbindgen_add_to_stack_pointer(16);
172
+ }
173
+ }
145
174
  /**
146
175
  * Verify a single input of a BIP-0322 PSBT proof
147
176
  *
@@ -1075,6 +1104,40 @@ export class BitGoPsbt {
1075
1104
  wasm.__wbindgen_add_to_stack_pointer(16);
1076
1105
  }
1077
1106
  }
1107
+ /**
1108
+ * Convert a half-signed legacy transaction to a psbt-lite.
1109
+ *
1110
+ * # Arguments
1111
+ * * `tx_bytes` - The serialized half-signed legacy transaction
1112
+ * * `network` - Network name (utxolib or coin name)
1113
+ * * `wallet_keys` - The wallet's root keys
1114
+ * * `unspents` - Array of `{ chain: number, index: number, value: bigint }` for each input
1115
+ * @param {Uint8Array} tx_bytes
1116
+ * @param {string} network
1117
+ * @param {WasmRootWalletKeys} wallet_keys
1118
+ * @param {any} unspents
1119
+ * @returns {BitGoPsbt}
1120
+ */
1121
+ static from_half_signed_legacy_transaction(tx_bytes, network, wallet_keys, unspents) {
1122
+ try {
1123
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1124
+ const ptr0 = passArray8ToWasm0(tx_bytes, wasm.__wbindgen_export);
1125
+ const len0 = WASM_VECTOR_LEN;
1126
+ const ptr1 = passStringToWasm0(network, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1127
+ const len1 = WASM_VECTOR_LEN;
1128
+ _assertClass(wallet_keys, WasmRootWalletKeys);
1129
+ wasm.bitgopsbt_from_half_signed_legacy_transaction(retptr, ptr0, len0, ptr1, len1, wallet_keys.__wbg_ptr, addHeapObject(unspents));
1130
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1131
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1132
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1133
+ if (r2) {
1134
+ throw takeObject(r1);
1135
+ }
1136
+ return BitGoPsbt.__wrap(r0);
1137
+ } finally {
1138
+ wasm.__wbindgen_add_to_stack_pointer(16);
1139
+ }
1140
+ }
1078
1141
  /**
1079
1142
  * Generate and store MuSig2 nonces for all MuSig2 inputs
1080
1143
  *
@@ -2871,6 +2934,63 @@ export class WasmDashTransaction {
2871
2934
  wasm.__wbindgen_add_to_stack_pointer(16);
2872
2935
  }
2873
2936
  }
2937
+ /**
2938
+ * @returns {any}
2939
+ */
2940
+ get_inputs() {
2941
+ try {
2942
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2943
+ wasm.wasmdashtransaction_get_inputs(retptr, this.__wbg_ptr);
2944
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2945
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2946
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2947
+ if (r2) {
2948
+ throw takeObject(r1);
2949
+ }
2950
+ return takeObject(r0);
2951
+ } finally {
2952
+ wasm.__wbindgen_add_to_stack_pointer(16);
2953
+ }
2954
+ }
2955
+ /**
2956
+ * @returns {any}
2957
+ */
2958
+ get_outputs() {
2959
+ try {
2960
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2961
+ wasm.wasmdashtransaction_get_outputs(retptr, this.__wbg_ptr);
2962
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2963
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2964
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2965
+ if (r2) {
2966
+ throw takeObject(r1);
2967
+ }
2968
+ return takeObject(r0);
2969
+ } finally {
2970
+ wasm.__wbindgen_add_to_stack_pointer(16);
2971
+ }
2972
+ }
2973
+ /**
2974
+ * @param {string} coin
2975
+ * @returns {any}
2976
+ */
2977
+ get_outputs_with_address(coin) {
2978
+ try {
2979
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2980
+ const ptr0 = passStringToWasm0(coin, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2981
+ const len0 = WASM_VECTOR_LEN;
2982
+ wasm.wasmdashtransaction_get_outputs_with_address(retptr, this.__wbg_ptr, ptr0, len0);
2983
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2984
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2985
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
2986
+ if (r2) {
2987
+ throw takeObject(r1);
2988
+ }
2989
+ return takeObject(r0);
2990
+ } finally {
2991
+ wasm.__wbindgen_add_to_stack_pointer(16);
2992
+ }
2993
+ }
2874
2994
  /**
2875
2995
  * Get the transaction ID (txid)
2876
2996
  *
@@ -2908,6 +3028,27 @@ export class WasmDashTransaction {
2908
3028
  wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
2909
3029
  }
2910
3030
  }
3031
+ /**
3032
+ * @returns {number}
3033
+ */
3034
+ input_count() {
3035
+ const ret = wasm.wasmdashtransaction_input_count(this.__wbg_ptr);
3036
+ return ret >>> 0;
3037
+ }
3038
+ /**
3039
+ * @returns {number}
3040
+ */
3041
+ lock_time() {
3042
+ const ret = wasm.wasmdashtransaction_lock_time(this.__wbg_ptr);
3043
+ return ret >>> 0;
3044
+ }
3045
+ /**
3046
+ * @returns {number}
3047
+ */
3048
+ output_count() {
3049
+ const ret = wasm.wasmdashtransaction_output_count(this.__wbg_ptr);
3050
+ return ret >>> 0;
3051
+ }
2911
3052
  /**
2912
3053
  * Serialize the Dash transaction to bytes (preserving tx_type and extra payload).
2913
3054
  * @returns {Uint8Array}
@@ -2930,6 +3071,13 @@ export class WasmDashTransaction {
2930
3071
  wasm.__wbindgen_add_to_stack_pointer(16);
2931
3072
  }
2932
3073
  }
3074
+ /**
3075
+ * @returns {number}
3076
+ */
3077
+ version() {
3078
+ const ret = wasm.wasmdashtransaction_version(this.__wbg_ptr);
3079
+ return ret;
3080
+ }
2933
3081
  }
2934
3082
  if (Symbol.dispose) WasmDashTransaction.prototype[Symbol.dispose] = WasmDashTransaction.prototype.free;
2935
3083
 
@@ -3785,6 +3933,63 @@ export class WasmTransaction {
3785
3933
  wasm.__wbindgen_add_to_stack_pointer(16);
3786
3934
  }
3787
3935
  }
3936
+ /**
3937
+ * @returns {any}
3938
+ */
3939
+ get_inputs() {
3940
+ try {
3941
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3942
+ wasm.wasmtransaction_get_inputs(retptr, this.__wbg_ptr);
3943
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3944
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3945
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
3946
+ if (r2) {
3947
+ throw takeObject(r1);
3948
+ }
3949
+ return takeObject(r0);
3950
+ } finally {
3951
+ wasm.__wbindgen_add_to_stack_pointer(16);
3952
+ }
3953
+ }
3954
+ /**
3955
+ * @returns {any}
3956
+ */
3957
+ get_outputs() {
3958
+ try {
3959
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3960
+ wasm.wasmtransaction_get_outputs(retptr, this.__wbg_ptr);
3961
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3962
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3963
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
3964
+ if (r2) {
3965
+ throw takeObject(r1);
3966
+ }
3967
+ return takeObject(r0);
3968
+ } finally {
3969
+ wasm.__wbindgen_add_to_stack_pointer(16);
3970
+ }
3971
+ }
3972
+ /**
3973
+ * @param {string} coin
3974
+ * @returns {any}
3975
+ */
3976
+ get_outputs_with_address(coin) {
3977
+ try {
3978
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
3979
+ const ptr0 = passStringToWasm0(coin, wasm.__wbindgen_export, wasm.__wbindgen_export2);
3980
+ const len0 = WASM_VECTOR_LEN;
3981
+ wasm.wasmtransaction_get_outputs_with_address(retptr, this.__wbg_ptr, ptr0, len0);
3982
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
3983
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
3984
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
3985
+ if (r2) {
3986
+ throw takeObject(r1);
3987
+ }
3988
+ return takeObject(r0);
3989
+ } finally {
3990
+ wasm.__wbindgen_add_to_stack_pointer(16);
3991
+ }
3992
+ }
3788
3993
  /**
3789
3994
  * Get the transaction ID (txid)
3790
3995
  *
@@ -3826,6 +4031,27 @@ export class WasmTransaction {
3826
4031
  const ret = wasm.wasmtransaction_get_vsize(this.__wbg_ptr);
3827
4032
  return ret >>> 0;
3828
4033
  }
4034
+ /**
4035
+ * @returns {number}
4036
+ */
4037
+ input_count() {
4038
+ const ret = wasm.wasmtransaction_input_count(this.__wbg_ptr);
4039
+ return ret >>> 0;
4040
+ }
4041
+ /**
4042
+ * @returns {number}
4043
+ */
4044
+ lock_time() {
4045
+ const ret = wasm.wasmtransaction_lock_time(this.__wbg_ptr);
4046
+ return ret >>> 0;
4047
+ }
4048
+ /**
4049
+ * @returns {number}
4050
+ */
4051
+ output_count() {
4052
+ const ret = wasm.wasmtransaction_output_count(this.__wbg_ptr);
4053
+ return ret >>> 0;
4054
+ }
3829
4055
  /**
3830
4056
  * Serialize the transaction to bytes
3831
4057
  *
@@ -3846,6 +4072,13 @@ export class WasmTransaction {
3846
4072
  wasm.__wbindgen_add_to_stack_pointer(16);
3847
4073
  }
3848
4074
  }
4075
+ /**
4076
+ * @returns {number}
4077
+ */
4078
+ version() {
4079
+ const ret = wasm.wasmtransaction_version(this.__wbg_ptr);
4080
+ return ret;
4081
+ }
3849
4082
  }
3850
4083
  if (Symbol.dispose) WasmTransaction.prototype[Symbol.dispose] = WasmTransaction.prototype.free;
3851
4084
 
@@ -3904,6 +4137,63 @@ export class WasmZcashTransaction {
3904
4137
  wasm.__wbindgen_add_to_stack_pointer(16);
3905
4138
  }
3906
4139
  }
4140
+ /**
4141
+ * @returns {any}
4142
+ */
4143
+ get_inputs() {
4144
+ try {
4145
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
4146
+ wasm.wasmzcashtransaction_get_inputs(retptr, this.__wbg_ptr);
4147
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
4148
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
4149
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
4150
+ if (r2) {
4151
+ throw takeObject(r1);
4152
+ }
4153
+ return takeObject(r0);
4154
+ } finally {
4155
+ wasm.__wbindgen_add_to_stack_pointer(16);
4156
+ }
4157
+ }
4158
+ /**
4159
+ * @returns {any}
4160
+ */
4161
+ get_outputs() {
4162
+ try {
4163
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
4164
+ wasm.wasmzcashtransaction_get_outputs(retptr, this.__wbg_ptr);
4165
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
4166
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
4167
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
4168
+ if (r2) {
4169
+ throw takeObject(r1);
4170
+ }
4171
+ return takeObject(r0);
4172
+ } finally {
4173
+ wasm.__wbindgen_add_to_stack_pointer(16);
4174
+ }
4175
+ }
4176
+ /**
4177
+ * @param {string} coin
4178
+ * @returns {any}
4179
+ */
4180
+ get_outputs_with_address(coin) {
4181
+ try {
4182
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
4183
+ const ptr0 = passStringToWasm0(coin, wasm.__wbindgen_export, wasm.__wbindgen_export2);
4184
+ const len0 = WASM_VECTOR_LEN;
4185
+ wasm.wasmzcashtransaction_get_outputs_with_address(retptr, this.__wbg_ptr, ptr0, len0);
4186
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
4187
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
4188
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
4189
+ if (r2) {
4190
+ throw takeObject(r1);
4191
+ }
4192
+ return takeObject(r0);
4193
+ } finally {
4194
+ wasm.__wbindgen_add_to_stack_pointer(16);
4195
+ }
4196
+ }
3907
4197
  /**
3908
4198
  * Get the transaction ID (txid)
3909
4199
  *
@@ -3941,6 +4231,27 @@ export class WasmZcashTransaction {
3941
4231
  wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
3942
4232
  }
3943
4233
  }
4234
+ /**
4235
+ * @returns {number}
4236
+ */
4237
+ input_count() {
4238
+ const ret = wasm.wasmtransaction_input_count(this.__wbg_ptr);
4239
+ return ret >>> 0;
4240
+ }
4241
+ /**
4242
+ * @returns {number}
4243
+ */
4244
+ lock_time() {
4245
+ const ret = wasm.wasmtransaction_lock_time(this.__wbg_ptr);
4246
+ return ret >>> 0;
4247
+ }
4248
+ /**
4249
+ * @returns {number}
4250
+ */
4251
+ output_count() {
4252
+ const ret = wasm.wasmtransaction_output_count(this.__wbg_ptr);
4253
+ return ret >>> 0;
4254
+ }
3944
4255
  /**
3945
4256
  * Serialize the transaction to bytes
3946
4257
  *
@@ -3966,6 +4277,13 @@ export class WasmZcashTransaction {
3966
4277
  wasm.__wbindgen_add_to_stack_pointer(16);
3967
4278
  }
3968
4279
  }
4280
+ /**
4281
+ * @returns {number}
4282
+ */
4283
+ version() {
4284
+ const ret = wasm.wasmtransaction_version(this.__wbg_ptr);
4285
+ return ret;
4286
+ }
3969
4287
  }
3970
4288
  if (Symbol.dispose) WasmZcashTransaction.prototype[Symbol.dispose] = WasmZcashTransaction.prototype.free;
3971
4289
 
@@ -5246,9 +5564,17 @@ export function __wbg_crypto_574e78ad8b13b65f(arg0) {
5246
5564
  const ret = getObject(arg0).crypto;
5247
5565
  return addHeapObject(ret);
5248
5566
  }
5567
+ export function __wbg_from_bddd64e7d5ff6941(arg0) {
5568
+ const ret = Array.from(getObject(arg0));
5569
+ return addHeapObject(ret);
5570
+ }
5249
5571
  export function __wbg_getRandomValues_b8f5dbd5f3995a9e() { return handleError(function (arg0, arg1) {
5250
5572
  getObject(arg0).getRandomValues(getObject(arg1));
5251
5573
  }, arguments); }
5574
+ export function __wbg_get_9b94d73e6221f75c(arg0, arg1) {
5575
+ const ret = getObject(arg0)[arg1 >>> 0];
5576
+ return addHeapObject(ret);
5577
+ }
5252
5578
  export function __wbg_get_b3ed3ad4be2bc8ac() { return handleError(function (arg0, arg1) {
5253
5579
  const ret = Reflect.get(getObject(arg0), getObject(arg1));
5254
5580
  return addHeapObject(ret);
@@ -5257,6 +5583,10 @@ export function __wbg_length_32ed9a279acd054c(arg0) {
5257
5583
  const ret = getObject(arg0).length;
5258
5584
  return ret;
5259
5585
  }
5586
+ export function __wbg_length_35a7bace40f36eac(arg0) {
5587
+ const ret = getObject(arg0).length;
5588
+ return ret;
5589
+ }
5260
5590
  export function __wbg_msCrypto_a61aeb35a24c1329(arg0) {
5261
5591
  const ret = getObject(arg0).msCrypto;
5262
5592
  return addHeapObject(ret);
Binary file