lwk_node 0.17.2 → 0.18.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/lwk_wasm.d.ts +66 -18
- package/lwk_wasm.js +235 -118
- package/lwk_wasm_bg.wasm +0 -0
- package/package.json +1 -1
package/lwk_wasm.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
-
export function searchLedgerDevice(): Promise<HIDDevice>;
|
|
4
3
|
/**
|
|
5
4
|
* Convert the given string to a QR code image uri
|
|
6
5
|
*
|
|
@@ -10,6 +9,7 @@ export function searchLedgerDevice(): Promise<HIDDevice>;
|
|
|
10
9
|
* for example in html: `style="image-rendering: pixelated; border: 20px solid white;"`
|
|
11
10
|
*/
|
|
12
11
|
export function stringToQr(str: string, pixel_per_module?: number | null): string;
|
|
12
|
+
export function searchLedgerDevice(): Promise<HIDDevice>;
|
|
13
13
|
/**
|
|
14
14
|
* Wallet chain
|
|
15
15
|
*/
|
|
@@ -286,6 +286,14 @@ export class Amp2Descriptor {
|
|
|
286
286
|
* Return the string representation of the descriptor.
|
|
287
287
|
*/
|
|
288
288
|
toString(): string;
|
|
289
|
+
/**
|
|
290
|
+
* Create an `Amp2Descriptor` using any `WolletDescriptor`
|
|
291
|
+
*
|
|
292
|
+
* Warning: AMP2 server only supports a limited subset of descriptors.
|
|
293
|
+
* To make sure this AMP2 descriptor can be used safely,
|
|
294
|
+
* register this with AMP2 as soon as possible.
|
|
295
|
+
*/
|
|
296
|
+
static newWithCustomDescriptor(desc: WolletDescriptor): Amp2Descriptor;
|
|
289
297
|
}
|
|
290
298
|
/**
|
|
291
299
|
* An asset identifier and an amount in satoshi units
|
|
@@ -411,7 +419,7 @@ export class Balance {
|
|
|
411
419
|
*/
|
|
412
420
|
toJSON(): any;
|
|
413
421
|
/**
|
|
414
|
-
* Returns the balance as
|
|
422
|
+
* Returns the balance as a JavaScript `Map` of asset id to amount.
|
|
415
423
|
*/
|
|
416
424
|
entries(): any;
|
|
417
425
|
/**
|
|
@@ -700,6 +708,27 @@ export class ExternalUtxo {
|
|
|
700
708
|
*/
|
|
701
709
|
constructor(vout: number, tx: Transaction, unblinded: TxOutSecrets, max_weight_to_satisfy: number, is_segwit: boolean);
|
|
702
710
|
}
|
|
711
|
+
/**
|
|
712
|
+
* The total fee paid by the transaction for each asset type.
|
|
713
|
+
*/
|
|
714
|
+
export class Fees {
|
|
715
|
+
private constructor();
|
|
716
|
+
free(): void;
|
|
717
|
+
[Symbol.dispose](): void;
|
|
718
|
+
/**
|
|
719
|
+
* Returns the fees as a JavaScript `Map` of asset id to amount.
|
|
720
|
+
*/
|
|
721
|
+
entries(): any;
|
|
722
|
+
/**
|
|
723
|
+
* Note: the amounts are strings since `JSON.stringify` cannot handle `BigInt`s.
|
|
724
|
+
* Use `entries()` to get the raw data.
|
|
725
|
+
*/
|
|
726
|
+
toJSON(): any;
|
|
727
|
+
/**
|
|
728
|
+
* Return the string representation of the fee.
|
|
729
|
+
*/
|
|
730
|
+
toString(): string;
|
|
731
|
+
}
|
|
703
732
|
/**
|
|
704
733
|
* Wrapper over [`lwk_boltz::Invoice`]
|
|
705
734
|
*/
|
|
@@ -1287,7 +1316,22 @@ export class PsetBalance {
|
|
|
1287
1316
|
private constructor();
|
|
1288
1317
|
free(): void;
|
|
1289
1318
|
[Symbol.dispose](): void;
|
|
1319
|
+
/**
|
|
1320
|
+
* Fee paid by this transaction.
|
|
1321
|
+
*
|
|
1322
|
+
* Warning: if there are multiple assets paying fees this function can return an incorrect value.
|
|
1323
|
+
*
|
|
1324
|
+
* Deprecated: use `feesIn(assetId)` or `fees()` instead.
|
|
1325
|
+
*/
|
|
1290
1326
|
fee(): bigint;
|
|
1327
|
+
/**
|
|
1328
|
+
* Fees paid by this transaction.
|
|
1329
|
+
*/
|
|
1330
|
+
fees(): Fees;
|
|
1331
|
+
/**
|
|
1332
|
+
* The amount of fee with given asset id
|
|
1333
|
+
*/
|
|
1334
|
+
feesIn(asset: AssetId): bigint;
|
|
1291
1335
|
/**
|
|
1292
1336
|
* The net balance for every asset with respect of the wallet asking the pset details
|
|
1293
1337
|
*/
|
|
@@ -1820,6 +1864,10 @@ export class TxDetails {
|
|
|
1820
1864
|
* Net balance from the `Wollet` perspective
|
|
1821
1865
|
*/
|
|
1822
1866
|
balance(): Balance;
|
|
1867
|
+
/**
|
|
1868
|
+
* Fees paid by this transaction.
|
|
1869
|
+
*/
|
|
1870
|
+
fees(): Fees;
|
|
1823
1871
|
/**
|
|
1824
1872
|
* Asset fees
|
|
1825
1873
|
*/
|
|
@@ -2160,22 +2208,6 @@ export class WalletTxOut {
|
|
|
2160
2208
|
export class Wollet {
|
|
2161
2209
|
free(): void;
|
|
2162
2210
|
[Symbol.dispose](): void;
|
|
2163
|
-
/**
|
|
2164
|
-
* Get the transaction list
|
|
2165
|
-
*
|
|
2166
|
-
* **Experimental**: This API may change without notice.
|
|
2167
|
-
*/
|
|
2168
|
-
txs(opt: TxsOpt): TxDetails[];
|
|
2169
|
-
/**
|
|
2170
|
-
* Number of transactions
|
|
2171
|
-
*/
|
|
2172
|
-
numTxs(): number;
|
|
2173
|
-
/**
|
|
2174
|
-
* Get the details of a transaction
|
|
2175
|
-
*
|
|
2176
|
-
* **Experimental**: This API may change without notice.
|
|
2177
|
-
*/
|
|
2178
|
-
txDetails(txid: Txid, opt: TxOpt): TxDetails | undefined;
|
|
2179
2211
|
/**
|
|
2180
2212
|
* Create a `Wollet`
|
|
2181
2213
|
*/
|
|
@@ -2290,6 +2322,22 @@ export class Wollet {
|
|
|
2290
2322
|
* Whether the wallet is AMP0
|
|
2291
2323
|
*/
|
|
2292
2324
|
isAmp0(): boolean;
|
|
2325
|
+
/**
|
|
2326
|
+
* Get the transaction list
|
|
2327
|
+
*
|
|
2328
|
+
* **Experimental**: This API may change without notice.
|
|
2329
|
+
*/
|
|
2330
|
+
txs(opt: TxsOpt): TxDetails[];
|
|
2331
|
+
/**
|
|
2332
|
+
* Number of transactions
|
|
2333
|
+
*/
|
|
2334
|
+
numTxs(): number;
|
|
2335
|
+
/**
|
|
2336
|
+
* Get the details of a transaction
|
|
2337
|
+
*
|
|
2338
|
+
* **Experimental**: This API may change without notice.
|
|
2339
|
+
*/
|
|
2340
|
+
txDetails(txid: Txid, opt: TxOpt): TxDetails | undefined;
|
|
2293
2341
|
}
|
|
2294
2342
|
/**
|
|
2295
2343
|
* A builder for constructing [`Wollet`] instances.
|
package/lwk_wasm.js
CHANGED
|
@@ -217,18 +217,18 @@ function makeMutClosure(arg0, arg1, dtor, f) {
|
|
|
217
217
|
return real;
|
|
218
218
|
}
|
|
219
219
|
|
|
220
|
-
function takeFromExternrefTable0(idx) {
|
|
221
|
-
const value = wasm.__wbindgen_export_4.get(idx);
|
|
222
|
-
wasm.__externref_table_dealloc(idx);
|
|
223
|
-
return value;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
220
|
function _assertClass(instance, klass) {
|
|
227
221
|
if (!(instance instanceof klass)) {
|
|
228
222
|
throw new Error(`expected instance of ${klass.name}`);
|
|
229
223
|
}
|
|
230
224
|
}
|
|
231
225
|
|
|
226
|
+
function takeFromExternrefTable0(idx) {
|
|
227
|
+
const value = wasm.__wbindgen_export_4.get(idx);
|
|
228
|
+
wasm.__externref_table_dealloc(idx);
|
|
229
|
+
return value;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
232
|
function passArrayJsValueToWasm0(array, malloc) {
|
|
233
233
|
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
234
234
|
for (let i = 0; i < array.length; i++) {
|
|
@@ -263,20 +263,6 @@ function getArrayU32FromWasm0(ptr, len) {
|
|
|
263
263
|
ptr = ptr >>> 0;
|
|
264
264
|
return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
|
|
265
265
|
}
|
|
266
|
-
/**
|
|
267
|
-
* @returns {Promise<HIDDevice>}
|
|
268
|
-
*/
|
|
269
|
-
exports.searchLedgerDevice = function() {
|
|
270
|
-
const ret = wasm.searchLedgerDevice();
|
|
271
|
-
return ret;
|
|
272
|
-
};
|
|
273
|
-
|
|
274
|
-
function passArray32ToWasm0(arg, malloc) {
|
|
275
|
-
const ptr = malloc(arg.length * 4, 4) >>> 0;
|
|
276
|
-
getUint32ArrayMemory0().set(arg, ptr / 4);
|
|
277
|
-
WASM_VECTOR_LEN = arg.length;
|
|
278
|
-
return ptr;
|
|
279
|
-
}
|
|
280
266
|
/**
|
|
281
267
|
* Convert the given string to a QR code image uri
|
|
282
268
|
*
|
|
@@ -309,28 +295,42 @@ exports.stringToQr = function(str, pixel_per_module) {
|
|
|
309
295
|
}
|
|
310
296
|
};
|
|
311
297
|
|
|
298
|
+
function passArray32ToWasm0(arg, malloc) {
|
|
299
|
+
const ptr = malloc(arg.length * 4, 4) >>> 0;
|
|
300
|
+
getUint32ArrayMemory0().set(arg, ptr / 4);
|
|
301
|
+
WASM_VECTOR_LEN = arg.length;
|
|
302
|
+
return ptr;
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* @returns {Promise<HIDDevice>}
|
|
306
|
+
*/
|
|
307
|
+
exports.searchLedgerDevice = function() {
|
|
308
|
+
const ret = wasm.searchLedgerDevice();
|
|
309
|
+
return ret;
|
|
310
|
+
};
|
|
311
|
+
|
|
312
312
|
function __wbg_adapter_6(arg0, arg1, arg2) {
|
|
313
|
-
wasm.
|
|
313
|
+
wasm.closure749_externref_shim(arg0, arg1, arg2);
|
|
314
314
|
}
|
|
315
315
|
|
|
316
|
-
function
|
|
317
|
-
wasm.
|
|
316
|
+
function __wbg_adapter_11(arg0, arg1, arg2) {
|
|
317
|
+
wasm.closure1290_externref_shim(arg0, arg1, arg2);
|
|
318
318
|
}
|
|
319
319
|
|
|
320
|
-
function
|
|
321
|
-
wasm.
|
|
320
|
+
function __wbg_adapter_18(arg0, arg1) {
|
|
321
|
+
wasm.wasm_bindgen__convert__closures_____invoke__hd7369d44ef864bc9(arg0, arg1);
|
|
322
322
|
}
|
|
323
323
|
|
|
324
|
-
function
|
|
325
|
-
wasm.
|
|
324
|
+
function __wbg_adapter_27(arg0, arg1, arg2) {
|
|
325
|
+
wasm.closure2146_externref_shim(arg0, arg1, arg2);
|
|
326
326
|
}
|
|
327
327
|
|
|
328
|
-
function
|
|
329
|
-
wasm.
|
|
328
|
+
function __wbg_adapter_32(arg0, arg1) {
|
|
329
|
+
wasm.wasm_bindgen__convert__closures_____invoke__ha062033b5f676b2f(arg0, arg1);
|
|
330
330
|
}
|
|
331
331
|
|
|
332
|
-
function
|
|
333
|
-
wasm.
|
|
332
|
+
function __wbg_adapter_753(arg0, arg1, arg2, arg3) {
|
|
333
|
+
wasm.closure2942_externref_shim(arg0, arg1, arg2, arg3);
|
|
334
334
|
}
|
|
335
335
|
|
|
336
336
|
/**
|
|
@@ -1158,6 +1158,20 @@ class Amp2Descriptor {
|
|
|
1158
1158
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1159
1159
|
}
|
|
1160
1160
|
}
|
|
1161
|
+
/**
|
|
1162
|
+
* Create an `Amp2Descriptor` using any `WolletDescriptor`
|
|
1163
|
+
*
|
|
1164
|
+
* Warning: AMP2 server only supports a limited subset of descriptors.
|
|
1165
|
+
* To make sure this AMP2 descriptor can be used safely,
|
|
1166
|
+
* register this with AMP2 as soon as possible.
|
|
1167
|
+
* @param {WolletDescriptor} desc
|
|
1168
|
+
* @returns {Amp2Descriptor}
|
|
1169
|
+
*/
|
|
1170
|
+
static newWithCustomDescriptor(desc) {
|
|
1171
|
+
_assertClass(desc, WolletDescriptor);
|
|
1172
|
+
const ret = wasm.amp2descriptor_newWithCustomDescriptor(desc.__wbg_ptr);
|
|
1173
|
+
return Amp2Descriptor.__wrap(ret);
|
|
1174
|
+
}
|
|
1161
1175
|
}
|
|
1162
1176
|
if (Symbol.dispose) Amp2Descriptor.prototype[Symbol.dispose] = Amp2Descriptor.prototype.free;
|
|
1163
1177
|
|
|
@@ -1565,7 +1579,7 @@ class Balance {
|
|
|
1565
1579
|
return takeFromExternrefTable0(ret[0]);
|
|
1566
1580
|
}
|
|
1567
1581
|
/**
|
|
1568
|
-
* Returns the balance as
|
|
1582
|
+
* Returns the balance as a JavaScript `Map` of asset id to amount.
|
|
1569
1583
|
* @returns {any}
|
|
1570
1584
|
*/
|
|
1571
1585
|
entries() {
|
|
@@ -2427,6 +2441,77 @@ if (Symbol.dispose) ExternalUtxo.prototype[Symbol.dispose] = ExternalUtxo.protot
|
|
|
2427
2441
|
|
|
2428
2442
|
exports.ExternalUtxo = ExternalUtxo;
|
|
2429
2443
|
|
|
2444
|
+
const FeesFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2445
|
+
? { register: () => {}, unregister: () => {} }
|
|
2446
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_fees_free(ptr >>> 0, 1));
|
|
2447
|
+
/**
|
|
2448
|
+
* The total fee paid by the transaction for each asset type.
|
|
2449
|
+
*/
|
|
2450
|
+
class Fees {
|
|
2451
|
+
|
|
2452
|
+
static __wrap(ptr) {
|
|
2453
|
+
ptr = ptr >>> 0;
|
|
2454
|
+
const obj = Object.create(Fees.prototype);
|
|
2455
|
+
obj.__wbg_ptr = ptr;
|
|
2456
|
+
FeesFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2457
|
+
return obj;
|
|
2458
|
+
}
|
|
2459
|
+
|
|
2460
|
+
__destroy_into_raw() {
|
|
2461
|
+
const ptr = this.__wbg_ptr;
|
|
2462
|
+
this.__wbg_ptr = 0;
|
|
2463
|
+
FeesFinalization.unregister(this);
|
|
2464
|
+
return ptr;
|
|
2465
|
+
}
|
|
2466
|
+
|
|
2467
|
+
free() {
|
|
2468
|
+
const ptr = this.__destroy_into_raw();
|
|
2469
|
+
wasm.__wbg_fees_free(ptr, 0);
|
|
2470
|
+
}
|
|
2471
|
+
/**
|
|
2472
|
+
* Returns the fees as a JavaScript `Map` of asset id to amount.
|
|
2473
|
+
* @returns {any}
|
|
2474
|
+
*/
|
|
2475
|
+
entries() {
|
|
2476
|
+
const ret = wasm.fees_entries(this.__wbg_ptr);
|
|
2477
|
+
if (ret[2]) {
|
|
2478
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2479
|
+
}
|
|
2480
|
+
return takeFromExternrefTable0(ret[0]);
|
|
2481
|
+
}
|
|
2482
|
+
/**
|
|
2483
|
+
* Note: the amounts are strings since `JSON.stringify` cannot handle `BigInt`s.
|
|
2484
|
+
* Use `entries()` to get the raw data.
|
|
2485
|
+
* @returns {any}
|
|
2486
|
+
*/
|
|
2487
|
+
toJSON() {
|
|
2488
|
+
const ret = wasm.fees_toJSON(this.__wbg_ptr);
|
|
2489
|
+
if (ret[2]) {
|
|
2490
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2491
|
+
}
|
|
2492
|
+
return takeFromExternrefTable0(ret[0]);
|
|
2493
|
+
}
|
|
2494
|
+
/**
|
|
2495
|
+
* Return the string representation of the fee.
|
|
2496
|
+
* @returns {string}
|
|
2497
|
+
*/
|
|
2498
|
+
toString() {
|
|
2499
|
+
let deferred1_0;
|
|
2500
|
+
let deferred1_1;
|
|
2501
|
+
try {
|
|
2502
|
+
const ret = wasm.fees_toString(this.__wbg_ptr);
|
|
2503
|
+
deferred1_0 = ret[0];
|
|
2504
|
+
deferred1_1 = ret[1];
|
|
2505
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
2506
|
+
} finally {
|
|
2507
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2508
|
+
}
|
|
2509
|
+
}
|
|
2510
|
+
}
|
|
2511
|
+
if (Symbol.dispose) Fees.prototype[Symbol.dispose] = Fees.prototype.free;
|
|
2512
|
+
|
|
2513
|
+
exports.Fees = Fees;
|
|
2514
|
+
|
|
2430
2515
|
const InvoiceFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2431
2516
|
? { register: () => {}, unregister: () => {} }
|
|
2432
2517
|
: new FinalizationRegistry(ptr => wasm.__wbg_invoice_free(ptr >>> 0, 1));
|
|
@@ -4439,12 +4524,36 @@ class PsetBalance {
|
|
|
4439
4524
|
wasm.__wbg_psetbalance_free(ptr, 0);
|
|
4440
4525
|
}
|
|
4441
4526
|
/**
|
|
4527
|
+
* Fee paid by this transaction.
|
|
4528
|
+
*
|
|
4529
|
+
* Warning: if there are multiple assets paying fees this function can return an incorrect value.
|
|
4530
|
+
*
|
|
4531
|
+
* Deprecated: use `feesIn(assetId)` or `fees()` instead.
|
|
4442
4532
|
* @returns {bigint}
|
|
4443
4533
|
*/
|
|
4444
4534
|
fee() {
|
|
4445
4535
|
const ret = wasm.psetbalance_fee(this.__wbg_ptr);
|
|
4446
4536
|
return BigInt.asUintN(64, ret);
|
|
4447
4537
|
}
|
|
4538
|
+
/**
|
|
4539
|
+
* Fees paid by this transaction.
|
|
4540
|
+
* @returns {Fees}
|
|
4541
|
+
*/
|
|
4542
|
+
fees() {
|
|
4543
|
+
const ret = wasm.psetbalance_fees(this.__wbg_ptr);
|
|
4544
|
+
return Fees.__wrap(ret);
|
|
4545
|
+
}
|
|
4546
|
+
/**
|
|
4547
|
+
* The amount of fee with given asset id
|
|
4548
|
+
* @param {AssetId} asset
|
|
4549
|
+
* @returns {bigint}
|
|
4550
|
+
*/
|
|
4551
|
+
feesIn(asset) {
|
|
4552
|
+
_assertClass(asset, AssetId);
|
|
4553
|
+
var ptr0 = asset.__destroy_into_raw();
|
|
4554
|
+
const ret = wasm.psetbalance_feesIn(this.__wbg_ptr, ptr0);
|
|
4555
|
+
return BigInt.asUintN(64, ret);
|
|
4556
|
+
}
|
|
4448
4557
|
/**
|
|
4449
4558
|
* The net balance for every asset with respect of the wallet asking the pset details
|
|
4450
4559
|
* @returns {Balance}
|
|
@@ -6154,6 +6263,14 @@ class TxDetails {
|
|
|
6154
6263
|
const ret = wasm.txdetails_balance(this.__wbg_ptr);
|
|
6155
6264
|
return Balance.__wrap(ret);
|
|
6156
6265
|
}
|
|
6266
|
+
/**
|
|
6267
|
+
* Fees paid by this transaction.
|
|
6268
|
+
* @returns {Fees}
|
|
6269
|
+
*/
|
|
6270
|
+
fees() {
|
|
6271
|
+
const ret = wasm.txdetails_fees(this.__wbg_ptr);
|
|
6272
|
+
return Fees.__wrap(ret);
|
|
6273
|
+
}
|
|
6157
6274
|
/**
|
|
6158
6275
|
* Asset fees
|
|
6159
6276
|
* @param {AssetId} asset
|
|
@@ -7227,51 +7344,6 @@ class Wollet {
|
|
|
7227
7344
|
const ptr = this.__destroy_into_raw();
|
|
7228
7345
|
wasm.__wbg_wollet_free(ptr, 0);
|
|
7229
7346
|
}
|
|
7230
|
-
/**
|
|
7231
|
-
* Get the transaction list
|
|
7232
|
-
*
|
|
7233
|
-
* **Experimental**: This API may change without notice.
|
|
7234
|
-
* @param {TxsOpt} opt
|
|
7235
|
-
* @returns {TxDetails[]}
|
|
7236
|
-
*/
|
|
7237
|
-
txs(opt) {
|
|
7238
|
-
_assertClass(opt, TxsOpt);
|
|
7239
|
-
const ret = wasm.wollet_txs(this.__wbg_ptr, opt.__wbg_ptr);
|
|
7240
|
-
if (ret[3]) {
|
|
7241
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
7242
|
-
}
|
|
7243
|
-
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
7244
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
7245
|
-
return v1;
|
|
7246
|
-
}
|
|
7247
|
-
/**
|
|
7248
|
-
* Number of transactions
|
|
7249
|
-
* @returns {number}
|
|
7250
|
-
*/
|
|
7251
|
-
numTxs() {
|
|
7252
|
-
const ret = wasm.wollet_numTxs(this.__wbg_ptr);
|
|
7253
|
-
if (ret[2]) {
|
|
7254
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
7255
|
-
}
|
|
7256
|
-
return ret[0] >>> 0;
|
|
7257
|
-
}
|
|
7258
|
-
/**
|
|
7259
|
-
* Get the details of a transaction
|
|
7260
|
-
*
|
|
7261
|
-
* **Experimental**: This API may change without notice.
|
|
7262
|
-
* @param {Txid} txid
|
|
7263
|
-
* @param {TxOpt} opt
|
|
7264
|
-
* @returns {TxDetails | undefined}
|
|
7265
|
-
*/
|
|
7266
|
-
txDetails(txid, opt) {
|
|
7267
|
-
_assertClass(txid, Txid);
|
|
7268
|
-
_assertClass(opt, TxOpt);
|
|
7269
|
-
const ret = wasm.wollet_txDetails(this.__wbg_ptr, txid.__wbg_ptr, opt.__wbg_ptr);
|
|
7270
|
-
if (ret[2]) {
|
|
7271
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
7272
|
-
}
|
|
7273
|
-
return ret[0] === 0 ? undefined : TxDetails.__wrap(ret[0]);
|
|
7274
|
-
}
|
|
7275
7347
|
/**
|
|
7276
7348
|
* Create a `Wollet`
|
|
7277
7349
|
* @param {Network} network
|
|
@@ -7544,6 +7616,51 @@ class Wollet {
|
|
|
7544
7616
|
const ret = wasm.wollet_isAmp0(this.__wbg_ptr);
|
|
7545
7617
|
return ret !== 0;
|
|
7546
7618
|
}
|
|
7619
|
+
/**
|
|
7620
|
+
* Get the transaction list
|
|
7621
|
+
*
|
|
7622
|
+
* **Experimental**: This API may change without notice.
|
|
7623
|
+
* @param {TxsOpt} opt
|
|
7624
|
+
* @returns {TxDetails[]}
|
|
7625
|
+
*/
|
|
7626
|
+
txs(opt) {
|
|
7627
|
+
_assertClass(opt, TxsOpt);
|
|
7628
|
+
const ret = wasm.wollet_txs(this.__wbg_ptr, opt.__wbg_ptr);
|
|
7629
|
+
if (ret[3]) {
|
|
7630
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
7631
|
+
}
|
|
7632
|
+
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
7633
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
7634
|
+
return v1;
|
|
7635
|
+
}
|
|
7636
|
+
/**
|
|
7637
|
+
* Number of transactions
|
|
7638
|
+
* @returns {number}
|
|
7639
|
+
*/
|
|
7640
|
+
numTxs() {
|
|
7641
|
+
const ret = wasm.wollet_numTxs(this.__wbg_ptr);
|
|
7642
|
+
if (ret[2]) {
|
|
7643
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
7644
|
+
}
|
|
7645
|
+
return ret[0] >>> 0;
|
|
7646
|
+
}
|
|
7647
|
+
/**
|
|
7648
|
+
* Get the details of a transaction
|
|
7649
|
+
*
|
|
7650
|
+
* **Experimental**: This API may change without notice.
|
|
7651
|
+
* @param {Txid} txid
|
|
7652
|
+
* @param {TxOpt} opt
|
|
7653
|
+
* @returns {TxDetails | undefined}
|
|
7654
|
+
*/
|
|
7655
|
+
txDetails(txid, opt) {
|
|
7656
|
+
_assertClass(txid, Txid);
|
|
7657
|
+
_assertClass(opt, TxOpt);
|
|
7658
|
+
const ret = wasm.wollet_txDetails(this.__wbg_ptr, txid.__wbg_ptr, opt.__wbg_ptr);
|
|
7659
|
+
if (ret[2]) {
|
|
7660
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
7661
|
+
}
|
|
7662
|
+
return ret[0] === 0 ? undefined : TxDetails.__wrap(ret[0]);
|
|
7663
|
+
}
|
|
7547
7664
|
}
|
|
7548
7665
|
if (Symbol.dispose) Wollet.prototype[Symbol.dispose] = Wollet.prototype.free;
|
|
7549
7666
|
|
|
@@ -8066,12 +8183,7 @@ exports.__wbg_get_0da715ceaecea5c8 = function(arg0, arg1) {
|
|
|
8066
8183
|
return ret;
|
|
8067
8184
|
};
|
|
8068
8185
|
|
|
8069
|
-
exports.
|
|
8070
|
-
const ret = Reflect.get(arg0, arg1);
|
|
8071
|
-
return ret;
|
|
8072
|
-
}, arguments) };
|
|
8073
|
-
|
|
8074
|
-
exports.__wbg_get_f10dbbe45a9b34a2 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
8186
|
+
exports.__wbg_get_2bb361e6f1bdde50 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
8075
8187
|
const ret = arg1.get(getStringFromWasm0(arg2, arg3));
|
|
8076
8188
|
var ptr1 = isLikeNone(ret) ? 0 : passArray8ToWasm0(ret, wasm.__wbindgen_malloc);
|
|
8077
8189
|
var len1 = WASM_VECTOR_LEN;
|
|
@@ -8079,6 +8191,11 @@ exports.__wbg_get_f10dbbe45a9b34a2 = function() { return handleError(function (a
|
|
|
8079
8191
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
8080
8192
|
}, arguments) };
|
|
8081
8193
|
|
|
8194
|
+
exports.__wbg_get_458e874b43b18b25 = function() { return handleError(function (arg0, arg1) {
|
|
8195
|
+
const ret = Reflect.get(arg0, arg1);
|
|
8196
|
+
return ret;
|
|
8197
|
+
}, arguments) };
|
|
8198
|
+
|
|
8082
8199
|
exports.__wbg_has_b89e451f638123e3 = function() { return handleError(function (arg0, arg1) {
|
|
8083
8200
|
const ret = Reflect.has(arg0, arg1);
|
|
8084
8201
|
return ret;
|
|
@@ -8175,7 +8292,7 @@ exports.__wbg_isArray_030cce220591fb41 = function(arg0) {
|
|
|
8175
8292
|
return ret;
|
|
8176
8293
|
};
|
|
8177
8294
|
|
|
8178
|
-
exports.
|
|
8295
|
+
exports.__wbg_isPersisted_354c6f4a4e0f19cb = function() { return handleError(function (arg0) {
|
|
8179
8296
|
const ret = arg0.isPersisted();
|
|
8180
8297
|
return ret;
|
|
8181
8298
|
}, arguments) };
|
|
@@ -8215,7 +8332,7 @@ exports.__wbg_length_6bb7e81f9d7713e4 = function(arg0) {
|
|
|
8215
8332
|
return ret;
|
|
8216
8333
|
};
|
|
8217
8334
|
|
|
8218
|
-
exports.
|
|
8335
|
+
exports.__wbg_log_0bf9a59e21c21d51 = function(arg0, arg1) {
|
|
8219
8336
|
console.log(getStringFromWasm0(arg0, arg1));
|
|
8220
8337
|
};
|
|
8221
8338
|
|
|
@@ -8251,7 +8368,7 @@ exports.__wbg_new_2e3c58a15f39f5f9 = function(arg0, arg1) {
|
|
|
8251
8368
|
const a = state0.a;
|
|
8252
8369
|
state0.a = 0;
|
|
8253
8370
|
try {
|
|
8254
|
-
return
|
|
8371
|
+
return __wbg_adapter_753(a, state0.b, arg0, arg1);
|
|
8255
8372
|
} finally {
|
|
8256
8373
|
state0.a = a;
|
|
8257
8374
|
}
|
|
@@ -8422,7 +8539,7 @@ exports.__wbg_push_330b2eb93e4e1212 = function(arg0, arg1) {
|
|
|
8422
8539
|
return ret;
|
|
8423
8540
|
};
|
|
8424
8541
|
|
|
8425
|
-
exports.
|
|
8542
|
+
exports.__wbg_put_9fbd837e976dd910 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
8426
8543
|
arg0.put(getStringFromWasm0(arg1, arg2), getArrayU8FromWasm0(arg3, arg4));
|
|
8427
8544
|
}, arguments) };
|
|
8428
8545
|
|
|
@@ -8472,7 +8589,7 @@ exports.__wbg_registry_new = function(arg0) {
|
|
|
8472
8589
|
return ret;
|
|
8473
8590
|
};
|
|
8474
8591
|
|
|
8475
|
-
exports.
|
|
8592
|
+
exports.__wbg_remove_a94bdea90b3fa4b7 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
8476
8593
|
arg0.remove(getStringFromWasm0(arg1, arg2));
|
|
8477
8594
|
}, arguments) };
|
|
8478
8595
|
|
|
@@ -8813,9 +8930,9 @@ exports.__wbg_xpub_new = function(arg0) {
|
|
|
8813
8930
|
return ret;
|
|
8814
8931
|
};
|
|
8815
8932
|
|
|
8816
|
-
exports.
|
|
8817
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
8818
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
8933
|
+
exports.__wbindgen_cast_10433792c4de85b6 = function(arg0, arg1) {
|
|
8934
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 2097, function: Function { arguments: [], shim_idx: 2098, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
8935
|
+
const ret = makeMutClosure(arg0, arg1, 2097, __wbg_adapter_18);
|
|
8819
8936
|
return ret;
|
|
8820
8937
|
};
|
|
8821
8938
|
|
|
@@ -8825,33 +8942,33 @@ exports.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
|
|
|
8825
8942
|
return ret;
|
|
8826
8943
|
};
|
|
8827
8944
|
|
|
8828
|
-
exports.
|
|
8829
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
8830
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
8945
|
+
exports.__wbindgen_cast_2406b334705670ec = function(arg0, arg1) {
|
|
8946
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 1289, function: Function { arguments: [NamedExternref("Event")], shim_idx: 1290, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
8947
|
+
const ret = makeMutClosure(arg0, arg1, 1289, __wbg_adapter_11);
|
|
8831
8948
|
return ret;
|
|
8832
8949
|
};
|
|
8833
8950
|
|
|
8834
|
-
exports.
|
|
8835
|
-
// Cast intrinsic for `
|
|
8836
|
-
const ret =
|
|
8951
|
+
exports.__wbindgen_cast_430e53ba7781a4ba = function(arg0, arg1) {
|
|
8952
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 1289, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 1290, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
8953
|
+
const ret = makeMutClosure(arg0, arg1, 1289, __wbg_adapter_11);
|
|
8837
8954
|
return ret;
|
|
8838
8955
|
};
|
|
8839
8956
|
|
|
8840
|
-
exports.
|
|
8841
|
-
// Cast intrinsic for `
|
|
8842
|
-
const ret =
|
|
8957
|
+
exports.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
|
|
8958
|
+
// Cast intrinsic for `U64 -> Externref`.
|
|
8959
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
8843
8960
|
return ret;
|
|
8844
8961
|
};
|
|
8845
8962
|
|
|
8846
|
-
exports.
|
|
8847
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
8848
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
8963
|
+
exports.__wbindgen_cast_7bdf3d0e751324a8 = function(arg0, arg1) {
|
|
8964
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 2135, function: Function { arguments: [Externref], shim_idx: 2146, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
8965
|
+
const ret = makeMutClosure(arg0, arg1, 2135, __wbg_adapter_27);
|
|
8849
8966
|
return ret;
|
|
8850
8967
|
};
|
|
8851
8968
|
|
|
8852
|
-
exports.
|
|
8853
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
8854
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
8969
|
+
exports.__wbindgen_cast_7d42252357483c45 = function(arg0, arg1) {
|
|
8970
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 1289, function: Function { arguments: [NamedExternref("ErrorEvent")], shim_idx: 1290, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
8971
|
+
const ret = makeMutClosure(arg0, arg1, 1289, __wbg_adapter_11);
|
|
8855
8972
|
return ret;
|
|
8856
8973
|
};
|
|
8857
8974
|
|
|
@@ -8861,15 +8978,21 @@ exports.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
|
|
|
8861
8978
|
return ret;
|
|
8862
8979
|
};
|
|
8863
8980
|
|
|
8864
|
-
exports.
|
|
8865
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
8866
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
8981
|
+
exports.__wbindgen_cast_ae6191adf0494af7 = function(arg0, arg1) {
|
|
8982
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 1289, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 1290, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
8983
|
+
const ret = makeMutClosure(arg0, arg1, 1289, __wbg_adapter_11);
|
|
8984
|
+
return ret;
|
|
8985
|
+
};
|
|
8986
|
+
|
|
8987
|
+
exports.__wbindgen_cast_ba8a1026d15ff35e = function(arg0, arg1) {
|
|
8988
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 1551, function: Function { arguments: [], shim_idx: 1552, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
8989
|
+
const ret = makeMutClosure(arg0, arg1, 1551, __wbg_adapter_32);
|
|
8867
8990
|
return ret;
|
|
8868
8991
|
};
|
|
8869
8992
|
|
|
8870
|
-
exports.
|
|
8871
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
8872
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
8993
|
+
exports.__wbindgen_cast_be4323188b2517d9 = function(arg0, arg1) {
|
|
8994
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 748, function: Function { arguments: [NamedExternref("HIDInputReportEvent")], shim_idx: 749, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
8995
|
+
const ret = makeMutClosure(arg0, arg1, 748, __wbg_adapter_6);
|
|
8873
8996
|
return ret;
|
|
8874
8997
|
};
|
|
8875
8998
|
|
|
@@ -8885,12 +9008,6 @@ exports.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
|
|
|
8885
9008
|
return ret;
|
|
8886
9009
|
};
|
|
8887
9010
|
|
|
8888
|
-
exports.__wbindgen_cast_d813f72ac7693c59 = function(arg0, arg1) {
|
|
8889
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx: 692, function: Function { arguments: [NamedExternref("HIDInputReportEvent")], shim_idx: 475, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
8890
|
-
const ret = makeMutClosure(arg0, arg1, 692, __wbg_adapter_6);
|
|
8891
|
-
return ret;
|
|
8892
|
-
};
|
|
8893
|
-
|
|
8894
9011
|
exports.__wbindgen_init_externref_table = function() {
|
|
8895
9012
|
const table = wasm.__wbindgen_export_4;
|
|
8896
9013
|
const offset = table.grow(4);
|
package/lwk_wasm_bg.wasm
CHANGED
|
Binary file
|