saito-wasm 0.1.6 → 0.1.8
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/Cargo.toml +1 -1
- package/package.json +1 -1
- package/pkg/node/index.d.ts +73 -0
- package/pkg/node/index.js +201 -57
- package/pkg/node/index_bg.wasm +0 -0
- package/pkg/node/index_bg.wasm.d.ts +53 -35
- package/pkg/node/package.json +3 -3
- package/pkg/web/index.d.ts +126 -35
- package/pkg/web/index.js +198 -54
- package/pkg/web/index_bg.wasm +0 -0
- package/pkg/web/index_bg.wasm.d.ts +53 -35
- package/pkg/web/package.json +1 -1
- package/wasm-pack +0 -0
- /package/pkg/node/snippets/{saito-wasm-f15fbfe7ac8d707c → saito-wasm-a75e30037217955a}/js/msg_handler.js +0 -0
- /package/pkg/web/snippets/{saito-wasm-f15fbfe7ac8d707c → saito-wasm-a75e30037217955a}/js/msg_handler.js +0 -0
package/Cargo.toml
CHANGED
package/package.json
CHANGED
package/pkg/node/index.d.ts
CHANGED
|
@@ -494,4 +494,77 @@ export class WasmWallet {
|
|
|
494
494
|
* @returns {Promise<Array<any>>}
|
|
495
495
|
*/
|
|
496
496
|
get_pending_txs(): Promise<Array<any>>;
|
|
497
|
+
/**
|
|
498
|
+
* @returns {Promise<Array<any>>}
|
|
499
|
+
*/
|
|
500
|
+
get_slips(): Promise<Array<any>>;
|
|
501
|
+
/**
|
|
502
|
+
* @param {WasmWalletSlip} slip
|
|
503
|
+
* @returns {Promise<void>}
|
|
504
|
+
*/
|
|
505
|
+
add_slip(slip: WasmWalletSlip): Promise<void>;
|
|
506
|
+
}
|
|
507
|
+
/**
|
|
508
|
+
*/
|
|
509
|
+
export class WasmWalletSlip {
|
|
510
|
+
free(): void;
|
|
511
|
+
/**
|
|
512
|
+
* @returns {string}
|
|
513
|
+
*/
|
|
514
|
+
get_utxokey(): string;
|
|
515
|
+
/**
|
|
516
|
+
* @param {string} key
|
|
517
|
+
*/
|
|
518
|
+
set_utxokey(key: string): void;
|
|
519
|
+
/**
|
|
520
|
+
* @returns {bigint}
|
|
521
|
+
*/
|
|
522
|
+
get_amount(): bigint;
|
|
523
|
+
/**
|
|
524
|
+
* @param {bigint} amount
|
|
525
|
+
*/
|
|
526
|
+
set_amount(amount: bigint): void;
|
|
527
|
+
/**
|
|
528
|
+
* @returns {bigint}
|
|
529
|
+
*/
|
|
530
|
+
get_block_id(): bigint;
|
|
531
|
+
/**
|
|
532
|
+
* @param {bigint} block_id
|
|
533
|
+
*/
|
|
534
|
+
set_block_id(block_id: bigint): void;
|
|
535
|
+
/**
|
|
536
|
+
* @returns {bigint}
|
|
537
|
+
*/
|
|
538
|
+
get_tx_ordinal(): bigint;
|
|
539
|
+
/**
|
|
540
|
+
* @param {bigint} ordinal
|
|
541
|
+
*/
|
|
542
|
+
set_tx_ordinal(ordinal: bigint): void;
|
|
543
|
+
/**
|
|
544
|
+
* @returns {number}
|
|
545
|
+
*/
|
|
546
|
+
get_slip_index(): number;
|
|
547
|
+
/**
|
|
548
|
+
* @param {number} index
|
|
549
|
+
*/
|
|
550
|
+
set_slip_index(index: number): void;
|
|
551
|
+
/**
|
|
552
|
+
* @returns {boolean}
|
|
553
|
+
*/
|
|
554
|
+
is_spent(): boolean;
|
|
555
|
+
/**
|
|
556
|
+
* @param {boolean} spent
|
|
557
|
+
*/
|
|
558
|
+
set_spent(spent: boolean): void;
|
|
559
|
+
/**
|
|
560
|
+
* @returns {boolean}
|
|
561
|
+
*/
|
|
562
|
+
is_lc(): boolean;
|
|
563
|
+
/**
|
|
564
|
+
* @param {boolean} lc
|
|
565
|
+
*/
|
|
566
|
+
set_lc(lc: boolean): void;
|
|
567
|
+
/**
|
|
568
|
+
*/
|
|
569
|
+
constructor();
|
|
497
570
|
}
|
package/pkg/node/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
let imports = {};
|
|
2
2
|
imports['__wbindgen_placeholder__'] = module.exports;
|
|
3
3
|
let wasm;
|
|
4
|
-
const { MsgHandler } = require(String.raw`./snippets/saito-wasm-
|
|
4
|
+
const { MsgHandler } = require(String.raw`./snippets/saito-wasm-a75e30037217955a/js/msg_handler.js`);
|
|
5
5
|
const { TextDecoder, TextEncoder } = require(`util`);
|
|
6
6
|
|
|
7
7
|
const heap = new Array(128).fill(undefined);
|
|
@@ -24,6 +24,15 @@ function takeObject(idx) {
|
|
|
24
24
|
return ret;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
function addHeapObject(obj) {
|
|
28
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
29
|
+
const idx = heap_next;
|
|
30
|
+
heap_next = heap[idx];
|
|
31
|
+
|
|
32
|
+
heap[idx] = obj;
|
|
33
|
+
return idx;
|
|
34
|
+
}
|
|
35
|
+
|
|
27
36
|
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
28
37
|
|
|
29
38
|
cachedTextDecoder.decode();
|
|
@@ -42,15 +51,6 @@ function getStringFromWasm0(ptr, len) {
|
|
|
42
51
|
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
43
52
|
}
|
|
44
53
|
|
|
45
|
-
function addHeapObject(obj) {
|
|
46
|
-
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
47
|
-
const idx = heap_next;
|
|
48
|
-
heap_next = heap[idx];
|
|
49
|
-
|
|
50
|
-
heap[idx] = obj;
|
|
51
|
-
return idx;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
54
|
let WASM_VECTOR_LEN = 0;
|
|
55
55
|
|
|
56
56
|
let cachedTextEncoder = new TextEncoder('utf-8');
|
|
@@ -488,7 +488,7 @@ function getArrayU8FromWasm0(ptr, len) {
|
|
|
488
488
|
ptr = ptr >>> 0;
|
|
489
489
|
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
|
|
490
490
|
}
|
|
491
|
-
function
|
|
491
|
+
function __wbg_adapter_302(arg0, arg1, arg2, arg3) {
|
|
492
492
|
wasm.wasm_bindgen__convert__closures__invoke2_mut__h4a288e6ecccb986f(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
493
493
|
}
|
|
494
494
|
|
|
@@ -1493,20 +1493,164 @@ class WasmWallet {
|
|
|
1493
1493
|
const ret = wasm.wasmwallet_get_pending_txs(this.__wbg_ptr);
|
|
1494
1494
|
return takeObject(ret);
|
|
1495
1495
|
}
|
|
1496
|
+
/**
|
|
1497
|
+
* @returns {Promise<Array<any>>}
|
|
1498
|
+
*/
|
|
1499
|
+
get_slips() {
|
|
1500
|
+
const ret = wasm.wasmwallet_get_slips(this.__wbg_ptr);
|
|
1501
|
+
return takeObject(ret);
|
|
1502
|
+
}
|
|
1503
|
+
/**
|
|
1504
|
+
* @param {WasmWalletSlip} slip
|
|
1505
|
+
* @returns {Promise<void>}
|
|
1506
|
+
*/
|
|
1507
|
+
add_slip(slip) {
|
|
1508
|
+
_assertClass(slip, WasmWalletSlip);
|
|
1509
|
+
var ptr0 = slip.__destroy_into_raw();
|
|
1510
|
+
const ret = wasm.wasmwallet_add_slip(this.__wbg_ptr, ptr0);
|
|
1511
|
+
return takeObject(ret);
|
|
1512
|
+
}
|
|
1496
1513
|
}
|
|
1497
1514
|
module.exports.WasmWallet = WasmWallet;
|
|
1515
|
+
/**
|
|
1516
|
+
*/
|
|
1517
|
+
class WasmWalletSlip {
|
|
1518
|
+
|
|
1519
|
+
static __wrap(ptr) {
|
|
1520
|
+
ptr = ptr >>> 0;
|
|
1521
|
+
const obj = Object.create(WasmWalletSlip.prototype);
|
|
1522
|
+
obj.__wbg_ptr = ptr;
|
|
1523
|
+
|
|
1524
|
+
return obj;
|
|
1525
|
+
}
|
|
1526
|
+
|
|
1527
|
+
__destroy_into_raw() {
|
|
1528
|
+
const ptr = this.__wbg_ptr;
|
|
1529
|
+
this.__wbg_ptr = 0;
|
|
1530
|
+
|
|
1531
|
+
return ptr;
|
|
1532
|
+
}
|
|
1533
|
+
|
|
1534
|
+
free() {
|
|
1535
|
+
const ptr = this.__destroy_into_raw();
|
|
1536
|
+
wasm.__wbg_wasmwalletslip_free(ptr);
|
|
1537
|
+
}
|
|
1538
|
+
/**
|
|
1539
|
+
* @returns {string}
|
|
1540
|
+
*/
|
|
1541
|
+
get_utxokey() {
|
|
1542
|
+
const ret = wasm.wasmwalletslip_get_utxokey(this.__wbg_ptr);
|
|
1543
|
+
return takeObject(ret);
|
|
1544
|
+
}
|
|
1545
|
+
/**
|
|
1546
|
+
* @param {string} key
|
|
1547
|
+
*/
|
|
1548
|
+
set_utxokey(key) {
|
|
1549
|
+
wasm.wasmwalletslip_set_utxokey(this.__wbg_ptr, addHeapObject(key));
|
|
1550
|
+
}
|
|
1551
|
+
/**
|
|
1552
|
+
* @returns {bigint}
|
|
1553
|
+
*/
|
|
1554
|
+
get_amount() {
|
|
1555
|
+
const ret = wasm.wasmwalletslip_get_amount(this.__wbg_ptr);
|
|
1556
|
+
return BigInt.asUintN(64, ret);
|
|
1557
|
+
}
|
|
1558
|
+
/**
|
|
1559
|
+
* @param {bigint} amount
|
|
1560
|
+
*/
|
|
1561
|
+
set_amount(amount) {
|
|
1562
|
+
wasm.wasmwalletslip_set_amount(this.__wbg_ptr, amount);
|
|
1563
|
+
}
|
|
1564
|
+
/**
|
|
1565
|
+
* @returns {bigint}
|
|
1566
|
+
*/
|
|
1567
|
+
get_block_id() {
|
|
1568
|
+
const ret = wasm.wasmwalletslip_get_block_id(this.__wbg_ptr);
|
|
1569
|
+
return BigInt.asUintN(64, ret);
|
|
1570
|
+
}
|
|
1571
|
+
/**
|
|
1572
|
+
* @param {bigint} block_id
|
|
1573
|
+
*/
|
|
1574
|
+
set_block_id(block_id) {
|
|
1575
|
+
wasm.wasmwalletslip_set_block_id(this.__wbg_ptr, block_id);
|
|
1576
|
+
}
|
|
1577
|
+
/**
|
|
1578
|
+
* @returns {bigint}
|
|
1579
|
+
*/
|
|
1580
|
+
get_tx_ordinal() {
|
|
1581
|
+
const ret = wasm.wasmwalletslip_get_tx_ordinal(this.__wbg_ptr);
|
|
1582
|
+
return BigInt.asUintN(64, ret);
|
|
1583
|
+
}
|
|
1584
|
+
/**
|
|
1585
|
+
* @param {bigint} ordinal
|
|
1586
|
+
*/
|
|
1587
|
+
set_tx_ordinal(ordinal) {
|
|
1588
|
+
wasm.wasmwalletslip_set_tx_ordinal(this.__wbg_ptr, ordinal);
|
|
1589
|
+
}
|
|
1590
|
+
/**
|
|
1591
|
+
* @returns {number}
|
|
1592
|
+
*/
|
|
1593
|
+
get_slip_index() {
|
|
1594
|
+
const ret = wasm.wasmwalletslip_get_slip_index(this.__wbg_ptr);
|
|
1595
|
+
return ret;
|
|
1596
|
+
}
|
|
1597
|
+
/**
|
|
1598
|
+
* @param {number} index
|
|
1599
|
+
*/
|
|
1600
|
+
set_slip_index(index) {
|
|
1601
|
+
wasm.wasmwalletslip_set_slip_index(this.__wbg_ptr, index);
|
|
1602
|
+
}
|
|
1603
|
+
/**
|
|
1604
|
+
* @returns {boolean}
|
|
1605
|
+
*/
|
|
1606
|
+
is_spent() {
|
|
1607
|
+
const ret = wasm.wasmwalletslip_is_spent(this.__wbg_ptr);
|
|
1608
|
+
return ret !== 0;
|
|
1609
|
+
}
|
|
1610
|
+
/**
|
|
1611
|
+
* @param {boolean} spent
|
|
1612
|
+
*/
|
|
1613
|
+
set_spent(spent) {
|
|
1614
|
+
wasm.wasmwalletslip_set_spent(this.__wbg_ptr, spent);
|
|
1615
|
+
}
|
|
1616
|
+
/**
|
|
1617
|
+
* @returns {boolean}
|
|
1618
|
+
*/
|
|
1619
|
+
is_lc() {
|
|
1620
|
+
const ret = wasm.wasmwalletslip_is_lc(this.__wbg_ptr);
|
|
1621
|
+
return ret !== 0;
|
|
1622
|
+
}
|
|
1623
|
+
/**
|
|
1624
|
+
* @param {boolean} lc
|
|
1625
|
+
*/
|
|
1626
|
+
set_lc(lc) {
|
|
1627
|
+
wasm.wasmwalletslip_set_lc(this.__wbg_ptr, lc);
|
|
1628
|
+
}
|
|
1629
|
+
/**
|
|
1630
|
+
*/
|
|
1631
|
+
constructor() {
|
|
1632
|
+
const ret = wasm.wasmwalletslip_new_();
|
|
1633
|
+
return WasmWalletSlip.__wrap(ret);
|
|
1634
|
+
}
|
|
1635
|
+
}
|
|
1636
|
+
module.exports.WasmWalletSlip = WasmWalletSlip;
|
|
1498
1637
|
|
|
1499
1638
|
module.exports.__wbindgen_object_drop_ref = function(arg0) {
|
|
1500
1639
|
takeObject(arg0);
|
|
1501
1640
|
};
|
|
1502
1641
|
|
|
1503
|
-
module.exports.
|
|
1504
|
-
const ret =
|
|
1642
|
+
module.exports.__wbg_wasmtransaction_new = function(arg0) {
|
|
1643
|
+
const ret = WasmTransaction.__wrap(arg0);
|
|
1505
1644
|
return addHeapObject(ret);
|
|
1506
1645
|
};
|
|
1507
1646
|
|
|
1508
|
-
module.exports.
|
|
1509
|
-
const ret =
|
|
1647
|
+
module.exports.__wbg_wasmwalletslip_new = function(arg0) {
|
|
1648
|
+
const ret = WasmWalletSlip.__wrap(arg0);
|
|
1649
|
+
return addHeapObject(ret);
|
|
1650
|
+
};
|
|
1651
|
+
|
|
1652
|
+
module.exports.__wbindgen_bigint_from_u64 = function(arg0) {
|
|
1653
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
1510
1654
|
return addHeapObject(ret);
|
|
1511
1655
|
};
|
|
1512
1656
|
|
|
@@ -1520,28 +1664,18 @@ module.exports.__wbg_wasmblock_new = function(arg0) {
|
|
|
1520
1664
|
return addHeapObject(ret);
|
|
1521
1665
|
};
|
|
1522
1666
|
|
|
1523
|
-
module.exports.
|
|
1524
|
-
const ret =
|
|
1525
|
-
return addHeapObject(ret);
|
|
1526
|
-
};
|
|
1527
|
-
|
|
1528
|
-
module.exports.__wbg_wasmwallet_new = function(arg0) {
|
|
1529
|
-
const ret = WasmWallet.__wrap(arg0);
|
|
1530
|
-
return addHeapObject(ret);
|
|
1531
|
-
};
|
|
1532
|
-
|
|
1533
|
-
module.exports.__wbg_wasmtransaction_new = function(arg0) {
|
|
1534
|
-
const ret = WasmTransaction.__wrap(arg0);
|
|
1667
|
+
module.exports.__wbg_wasmslip_new = function(arg0) {
|
|
1668
|
+
const ret = WasmSlip.__wrap(arg0);
|
|
1535
1669
|
return addHeapObject(ret);
|
|
1536
1670
|
};
|
|
1537
1671
|
|
|
1538
|
-
module.exports.
|
|
1539
|
-
const ret =
|
|
1672
|
+
module.exports.__wbg_wasmbalancesnapshot_new = function(arg0) {
|
|
1673
|
+
const ret = WasmBalanceSnapshot.__wrap(arg0);
|
|
1540
1674
|
return addHeapObject(ret);
|
|
1541
1675
|
};
|
|
1542
1676
|
|
|
1543
|
-
module.exports.
|
|
1544
|
-
const ret =
|
|
1677
|
+
module.exports.__wbg_wasmpeer_new = function(arg0) {
|
|
1678
|
+
const ret = WasmPeer.__wrap(arg0);
|
|
1545
1679
|
return addHeapObject(ret);
|
|
1546
1680
|
};
|
|
1547
1681
|
|
|
@@ -1559,6 +1693,21 @@ module.exports.__wbindgen_string_get = function(arg0, arg1) {
|
|
|
1559
1693
|
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
1560
1694
|
};
|
|
1561
1695
|
|
|
1696
|
+
module.exports.__wbg_wasmwallet_new = function(arg0) {
|
|
1697
|
+
const ret = WasmWallet.__wrap(arg0);
|
|
1698
|
+
return addHeapObject(ret);
|
|
1699
|
+
};
|
|
1700
|
+
|
|
1701
|
+
module.exports.__wbg_wasmblockchain_new = function(arg0) {
|
|
1702
|
+
const ret = WasmBlockchain.__wrap(arg0);
|
|
1703
|
+
return addHeapObject(ret);
|
|
1704
|
+
};
|
|
1705
|
+
|
|
1706
|
+
module.exports.__wbg_wasmpeerservice_new = function(arg0) {
|
|
1707
|
+
const ret = WasmPeerService.__wrap(arg0);
|
|
1708
|
+
return addHeapObject(ret);
|
|
1709
|
+
};
|
|
1710
|
+
|
|
1562
1711
|
module.exports.__wbindgen_is_object = function(arg0) {
|
|
1563
1712
|
const val = getObject(arg0);
|
|
1564
1713
|
const ret = typeof(val) === 'object' && val !== null;
|
|
@@ -1575,35 +1724,30 @@ module.exports.__wbindgen_in = function(arg0, arg1) {
|
|
|
1575
1724
|
return ret;
|
|
1576
1725
|
};
|
|
1577
1726
|
|
|
1578
|
-
module.exports.__wbg_wasmpeerservice_new = function(arg0) {
|
|
1579
|
-
const ret = WasmPeerService.__wrap(arg0);
|
|
1580
|
-
return addHeapObject(ret);
|
|
1581
|
-
};
|
|
1582
|
-
|
|
1583
1727
|
module.exports.__wbindgen_error_new = function(arg0, arg1) {
|
|
1584
1728
|
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
1585
1729
|
return addHeapObject(ret);
|
|
1586
1730
|
};
|
|
1587
1731
|
|
|
1588
|
-
module.exports.
|
|
1732
|
+
module.exports.__wbg_sendmessage_c672e7c9741c5223 = function(arg0, arg1) {
|
|
1589
1733
|
MsgHandler.send_message(takeObject(arg0), getObject(arg1));
|
|
1590
1734
|
};
|
|
1591
1735
|
|
|
1592
|
-
module.exports.
|
|
1736
|
+
module.exports.__wbg_sendmessagetoall_f1a373dbf0ddc22b = function(arg0, arg1) {
|
|
1593
1737
|
MsgHandler.send_message_to_all(getObject(arg0), getObject(arg1));
|
|
1594
1738
|
};
|
|
1595
1739
|
|
|
1596
|
-
module.exports.
|
|
1740
|
+
module.exports.__wbg_connecttopeer_5294050ce8c4394a = function() { return handleError(function (arg0) {
|
|
1597
1741
|
const ret = MsgHandler.connect_to_peer(takeObject(arg0));
|
|
1598
1742
|
return addHeapObject(ret);
|
|
1599
1743
|
}, arguments) };
|
|
1600
1744
|
|
|
1601
|
-
module.exports.
|
|
1745
|
+
module.exports.__wbg_disconnectfrompeer_8d4834b40f0be836 = function() { return handleError(function (arg0) {
|
|
1602
1746
|
const ret = MsgHandler.disconnect_from_peer(takeObject(arg0));
|
|
1603
1747
|
return addHeapObject(ret);
|
|
1604
1748
|
}, arguments) };
|
|
1605
1749
|
|
|
1606
|
-
module.exports.
|
|
1750
|
+
module.exports.__wbg_fetchblockfrompeer_12ff531c1b29ede5 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
1607
1751
|
let deferred0_0;
|
|
1608
1752
|
let deferred0_1;
|
|
1609
1753
|
try {
|
|
@@ -1616,7 +1760,7 @@ module.exports.__wbg_fetchblockfrompeer_9dc19686012e0221 = function() { return h
|
|
|
1616
1760
|
}
|
|
1617
1761
|
}, arguments) };
|
|
1618
1762
|
|
|
1619
|
-
module.exports.
|
|
1763
|
+
module.exports.__wbg_writevalue_cd72d643a8bf35a9 = function(arg0, arg1, arg2) {
|
|
1620
1764
|
let deferred0_0;
|
|
1621
1765
|
let deferred0_1;
|
|
1622
1766
|
try {
|
|
@@ -1628,7 +1772,7 @@ module.exports.__wbg_writevalue_f9e4c277f7c3d7ee = function(arg0, arg1, arg2) {
|
|
|
1628
1772
|
}
|
|
1629
1773
|
};
|
|
1630
1774
|
|
|
1631
|
-
module.exports.
|
|
1775
|
+
module.exports.__wbg_readvalue_8b947c29e8838490 = function() { return handleError(function (arg0, arg1) {
|
|
1632
1776
|
let deferred0_0;
|
|
1633
1777
|
let deferred0_1;
|
|
1634
1778
|
try {
|
|
@@ -1641,12 +1785,12 @@ module.exports.__wbg_readvalue_d1a0a28e242a5863 = function() { return handleErro
|
|
|
1641
1785
|
}
|
|
1642
1786
|
}, arguments) };
|
|
1643
1787
|
|
|
1644
|
-
module.exports.
|
|
1788
|
+
module.exports.__wbg_loadblockfilelist_eea4ee87f7eed741 = function() { return handleError(function () {
|
|
1645
1789
|
const ret = MsgHandler.load_block_file_list();
|
|
1646
1790
|
return addHeapObject(ret);
|
|
1647
1791
|
}, arguments) };
|
|
1648
1792
|
|
|
1649
|
-
module.exports.
|
|
1793
|
+
module.exports.__wbg_isexistingfile_b8f92bb7e94f75be = function() { return handleError(function (arg0, arg1) {
|
|
1650
1794
|
let deferred0_0;
|
|
1651
1795
|
let deferred0_1;
|
|
1652
1796
|
try {
|
|
@@ -1659,7 +1803,7 @@ module.exports.__wbg_isexistingfile_718fd10cbc0c6210 = function() { return handl
|
|
|
1659
1803
|
}
|
|
1660
1804
|
}, arguments) };
|
|
1661
1805
|
|
|
1662
|
-
module.exports.
|
|
1806
|
+
module.exports.__wbg_removevalue_3733f8ebd341e93d = function() { return handleError(function (arg0, arg1) {
|
|
1663
1807
|
let deferred0_0;
|
|
1664
1808
|
let deferred0_1;
|
|
1665
1809
|
try {
|
|
@@ -1672,19 +1816,19 @@ module.exports.__wbg_removevalue_1b2227f688d08d38 = function() { return handleEr
|
|
|
1672
1816
|
}
|
|
1673
1817
|
}, arguments) };
|
|
1674
1818
|
|
|
1675
|
-
module.exports.
|
|
1819
|
+
module.exports.__wbg_processapicall_5860a5c26128a332 = function(arg0, arg1, arg2) {
|
|
1676
1820
|
MsgHandler.process_api_call(takeObject(arg0), arg1 >>> 0, BigInt.asUintN(64, arg2));
|
|
1677
1821
|
};
|
|
1678
1822
|
|
|
1679
|
-
module.exports.
|
|
1823
|
+
module.exports.__wbg_processapisuccess_fae9b8cbbbd526fe = function(arg0, arg1, arg2) {
|
|
1680
1824
|
MsgHandler.process_api_success(takeObject(arg0), arg1 >>> 0, BigInt.asUintN(64, arg2));
|
|
1681
1825
|
};
|
|
1682
1826
|
|
|
1683
|
-
module.exports.
|
|
1827
|
+
module.exports.__wbg_processapierror_1e224137a1a221c6 = function(arg0, arg1, arg2) {
|
|
1684
1828
|
MsgHandler.process_api_error(takeObject(arg0), arg1 >>> 0, BigInt.asUintN(64, arg2));
|
|
1685
1829
|
};
|
|
1686
1830
|
|
|
1687
|
-
module.exports.
|
|
1831
|
+
module.exports.__wbg_sendinterfaceevent_10b8415cc087e87c = function(arg0, arg1, arg2) {
|
|
1688
1832
|
let deferred0_0;
|
|
1689
1833
|
let deferred0_1;
|
|
1690
1834
|
try {
|
|
@@ -1696,7 +1840,7 @@ module.exports.__wbg_sendinterfaceevent_5277f8a797a8f402 = function(arg0, arg1,
|
|
|
1696
1840
|
}
|
|
1697
1841
|
};
|
|
1698
1842
|
|
|
1699
|
-
module.exports.
|
|
1843
|
+
module.exports.__wbg_sendblocksuccess_fac8865c525186cd = function(arg0, arg1, arg2) {
|
|
1700
1844
|
let deferred0_0;
|
|
1701
1845
|
let deferred0_1;
|
|
1702
1846
|
try {
|
|
@@ -1708,15 +1852,15 @@ module.exports.__wbg_sendblocksuccess_ad759dbf2cac050a = function(arg0, arg1, ar
|
|
|
1708
1852
|
}
|
|
1709
1853
|
};
|
|
1710
1854
|
|
|
1711
|
-
module.exports.
|
|
1855
|
+
module.exports.__wbg_savewallet_3fe97943714d7d0f = function() {
|
|
1712
1856
|
MsgHandler.save_wallet();
|
|
1713
1857
|
};
|
|
1714
1858
|
|
|
1715
|
-
module.exports.
|
|
1859
|
+
module.exports.__wbg_loadwallet_4cb9da9a68771d25 = function() {
|
|
1716
1860
|
MsgHandler.load_wallet();
|
|
1717
1861
|
};
|
|
1718
1862
|
|
|
1719
|
-
module.exports.
|
|
1863
|
+
module.exports.__wbg_getmyservices_9cddcf3673b82276 = function() {
|
|
1720
1864
|
const ret = MsgHandler.get_my_services();
|
|
1721
1865
|
_assertClass(ret, WasmPeerServiceList);
|
|
1722
1866
|
var ptr1 = ret.__destroy_into_raw();
|
|
@@ -1951,7 +2095,7 @@ module.exports.__wbg_new_2b55e405e4af4986 = function(arg0, arg1) {
|
|
|
1951
2095
|
const a = state0.a;
|
|
1952
2096
|
state0.a = 0;
|
|
1953
2097
|
try {
|
|
1954
|
-
return
|
|
2098
|
+
return __wbg_adapter_302(a, state0.b, arg0, arg1);
|
|
1955
2099
|
} finally {
|
|
1956
2100
|
state0.a = a;
|
|
1957
2101
|
}
|
|
@@ -2045,8 +2189,8 @@ module.exports.__wbindgen_memory = function() {
|
|
|
2045
2189
|
return addHeapObject(ret);
|
|
2046
2190
|
};
|
|
2047
2191
|
|
|
2048
|
-
module.exports.
|
|
2049
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2192
|
+
module.exports.__wbindgen_closure_wrapper1007 = function(arg0, arg1, arg2) {
|
|
2193
|
+
const ret = makeMutClosure(arg0, arg1, 337, __wbg_adapter_40);
|
|
2050
2194
|
return addHeapObject(ret);
|
|
2051
2195
|
};
|
|
2052
2196
|
|
package/pkg/node/index_bg.wasm
CHANGED
|
Binary file
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
-
export function __wbg_wasmwallet_free(a: number): void;
|
|
5
|
-
export function wasmwallet_save(a: number): number;
|
|
6
|
-
export function wasmwallet_reset(a: number): number;
|
|
7
|
-
export function wasmwallet_load(a: number): number;
|
|
8
|
-
export function wasmwallet_get_public_key(a: number): number;
|
|
9
|
-
export function wasmwallet_set_public_key(a: number, b: number): number;
|
|
10
|
-
export function wasmwallet_get_private_key(a: number): number;
|
|
11
|
-
export function wasmwallet_set_private_key(a: number, b: number): number;
|
|
12
|
-
export function wasmwallet_get_balance(a: number): number;
|
|
13
|
-
export function wasmwallet_get_pending_txs(a: number): number;
|
|
14
4
|
export function __wbg_wasmbalancesnapshot_free(a: number): void;
|
|
15
5
|
export function wasmbalancesnapshot_get_file_name(a: number): number;
|
|
16
6
|
export function wasmbalancesnapshot_get_entries(a: number): number;
|
|
17
7
|
export function wasmbalancesnapshot_from_string(a: number, b: number): void;
|
|
18
8
|
export function wasmbalancesnapshot_to_string(a: number): number;
|
|
9
|
+
export function __wbg_wasmpeer_free(a: number): void;
|
|
10
|
+
export function wasmpeer_get_public_key(a: number): number;
|
|
11
|
+
export function wasmpeer_get_key_list(a: number): number;
|
|
12
|
+
export function wasmpeer_get_peer_index(a: number): number;
|
|
13
|
+
export function wasmpeer_new(a: number): number;
|
|
14
|
+
export function wasmpeer_get_sync_type(a: number): number;
|
|
15
|
+
export function wasmpeer_get_services(a: number): number;
|
|
16
|
+
export function wasmpeer_set_services(a: number, b: number): void;
|
|
17
|
+
export function wasmpeer_has_service(a: number, b: number): number;
|
|
18
|
+
export function wasmpeer_is_main_peer(a: number): number;
|
|
19
19
|
export function __wbg_wasmpeerservicelist_free(a: number): void;
|
|
20
20
|
export function __wbg_wasmpeerservice_free(a: number): void;
|
|
21
21
|
export function wasmpeerservice_new(): number;
|
|
@@ -88,21 +88,6 @@ export function wasmtransaction_set_type(a: number, b: number): void;
|
|
|
88
88
|
export function wasmtransaction_total_fees(a: number): number;
|
|
89
89
|
export function wasmtransaction_serialize(a: number): number;
|
|
90
90
|
export function wasmtransaction_deserialize(a: number, b: number): void;
|
|
91
|
-
export function __wbg_wasmblockchain_free(a: number): void;
|
|
92
|
-
export function wasmblockchain_reset(a: number): number;
|
|
93
|
-
export function wasmblockchain_get_last_block_id(a: number): number;
|
|
94
|
-
export function wasmblockchain_get_last_timestamp(a: number): number;
|
|
95
|
-
export function wasmblockchain_get_longest_chain_hash_at(a: number, b: number): number;
|
|
96
|
-
export function wasmblockchain_get_last_block_hash(a: number): number;
|
|
97
|
-
export function wasmblockchain_get_last_burnfee(a: number): number;
|
|
98
|
-
export function wasmblockchain_get_genesis_block_id(a: number): number;
|
|
99
|
-
export function wasmblockchain_get_genesis_timestamp(a: number): number;
|
|
100
|
-
export function wasmblockchain_get_lowest_acceptable_timestamp(a: number): number;
|
|
101
|
-
export function wasmblockchain_get_lowest_acceptable_block_hash(a: number): number;
|
|
102
|
-
export function wasmblockchain_get_lowest_acceptable_block_id(a: number): number;
|
|
103
|
-
export function wasmblockchain_get_latest_block_id(a: number): number;
|
|
104
|
-
export function wasmblockchain_get_longest_chain_hash_at_id(a: number, b: number): number;
|
|
105
|
-
export function wasmblockchain_get_hashes_at_id(a: number, b: number): number;
|
|
106
91
|
export function __wbg_saitowasm_free(a: number): void;
|
|
107
92
|
export function initialize(a: number, b: number, c: number): number;
|
|
108
93
|
export function create_transaction(a: number, b: number, c: number, d: number): number;
|
|
@@ -130,16 +115,49 @@ export function send_api_error(a: number, b: number, c: number): number;
|
|
|
130
115
|
export function get_wallet(): number;
|
|
131
116
|
export function get_blockchain(): number;
|
|
132
117
|
export function get_mempool_txs(): number;
|
|
133
|
-
export function
|
|
134
|
-
export function
|
|
135
|
-
export function
|
|
136
|
-
export function
|
|
137
|
-
export function
|
|
138
|
-
export function
|
|
139
|
-
export function
|
|
140
|
-
export function
|
|
141
|
-
export function
|
|
142
|
-
export function
|
|
118
|
+
export function __wbg_wasmblockchain_free(a: number): void;
|
|
119
|
+
export function wasmblockchain_reset(a: number): number;
|
|
120
|
+
export function wasmblockchain_get_last_block_id(a: number): number;
|
|
121
|
+
export function wasmblockchain_get_last_timestamp(a: number): number;
|
|
122
|
+
export function wasmblockchain_get_longest_chain_hash_at(a: number, b: number): number;
|
|
123
|
+
export function wasmblockchain_get_last_block_hash(a: number): number;
|
|
124
|
+
export function wasmblockchain_get_last_burnfee(a: number): number;
|
|
125
|
+
export function wasmblockchain_get_genesis_block_id(a: number): number;
|
|
126
|
+
export function wasmblockchain_get_genesis_timestamp(a: number): number;
|
|
127
|
+
export function wasmblockchain_get_lowest_acceptable_timestamp(a: number): number;
|
|
128
|
+
export function wasmblockchain_get_lowest_acceptable_block_hash(a: number): number;
|
|
129
|
+
export function wasmblockchain_get_lowest_acceptable_block_id(a: number): number;
|
|
130
|
+
export function wasmblockchain_get_latest_block_id(a: number): number;
|
|
131
|
+
export function wasmblockchain_get_longest_chain_hash_at_id(a: number, b: number): number;
|
|
132
|
+
export function wasmblockchain_get_hashes_at_id(a: number, b: number): number;
|
|
133
|
+
export function __wbg_wasmwallet_free(a: number): void;
|
|
134
|
+
export function __wbg_wasmwalletslip_free(a: number): void;
|
|
135
|
+
export function wasmwallet_save(a: number): number;
|
|
136
|
+
export function wasmwallet_reset(a: number): number;
|
|
137
|
+
export function wasmwallet_load(a: number): number;
|
|
138
|
+
export function wasmwallet_get_public_key(a: number): number;
|
|
139
|
+
export function wasmwallet_set_public_key(a: number, b: number): number;
|
|
140
|
+
export function wasmwallet_get_private_key(a: number): number;
|
|
141
|
+
export function wasmwallet_set_private_key(a: number, b: number): number;
|
|
142
|
+
export function wasmwallet_get_balance(a: number): number;
|
|
143
|
+
export function wasmwallet_get_pending_txs(a: number): number;
|
|
144
|
+
export function wasmwallet_get_slips(a: number): number;
|
|
145
|
+
export function wasmwallet_add_slip(a: number, b: number): number;
|
|
146
|
+
export function wasmwalletslip_get_utxokey(a: number): number;
|
|
147
|
+
export function wasmwalletslip_set_utxokey(a: number, b: number): void;
|
|
148
|
+
export function wasmwalletslip_get_amount(a: number): number;
|
|
149
|
+
export function wasmwalletslip_set_amount(a: number, b: number): void;
|
|
150
|
+
export function wasmwalletslip_get_block_id(a: number): number;
|
|
151
|
+
export function wasmwalletslip_set_block_id(a: number, b: number): void;
|
|
152
|
+
export function wasmwalletslip_get_tx_ordinal(a: number): number;
|
|
153
|
+
export function wasmwalletslip_set_tx_ordinal(a: number, b: number): void;
|
|
154
|
+
export function wasmwalletslip_get_slip_index(a: number): number;
|
|
155
|
+
export function wasmwalletslip_set_slip_index(a: number, b: number): void;
|
|
156
|
+
export function wasmwalletslip_is_spent(a: number): number;
|
|
157
|
+
export function wasmwalletslip_set_spent(a: number, b: number): void;
|
|
158
|
+
export function wasmwalletslip_is_lc(a: number): number;
|
|
159
|
+
export function wasmwalletslip_set_lc(a: number, b: number): void;
|
|
160
|
+
export function wasmwalletslip_new_(): number;
|
|
143
161
|
export function rustsecp256k1_v0_8_1_context_create(a: number): number;
|
|
144
162
|
export function rustsecp256k1_v0_8_1_context_destroy(a: number): void;
|
|
145
163
|
export function rustsecp256k1_v0_8_1_default_illegal_callback_fn(a: number, b: number): void;
|
package/pkg/node/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "saito-wasm",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"files": [
|
|
5
5
|
"index_bg.wasm",
|
|
6
6
|
"index.js",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"main": "index.js",
|
|
10
10
|
"types": "index.d.ts",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"
|
|
13
|
-
"
|
|
12
|
+
"node-fetch": "^3.3.0",
|
|
13
|
+
"cross-env": "^7.0.3"
|
|
14
14
|
}
|
|
15
15
|
}
|