saito-wasm 0.2.228 → 0.2.231
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 +10 -1
- package/pkg/node/index.d.ts +99 -89
- package/pkg/node/index.js +197 -234
- package/pkg/node/index_bg.wasm +0 -0
- package/pkg/node/index_bg.wasm.d.ts +1 -0
- package/pkg/node/package.json +1 -1
- package/pkg/node/snippets/saito-wasm-4f0037bd65597633/js/msg_handler.js +110 -0
- package/pkg/web/index.d.ts +100 -89
- package/pkg/web/index.js +196 -229
- package/pkg/web/index_bg.wasm +0 -0
- package/pkg/web/index_bg.wasm.d.ts +1 -0
- package/pkg/web/package.json +1 -1
- package/pkg/web/snippets/saito-wasm-4f0037bd65597633/js/msg_handler.js +103 -0
- package/pkg/node/snippets/saito-wasm-d92cd3d1070014c5/js/msg_handler.js +0 -142
- package/pkg/web/snippets/saito-wasm-d92cd3d1070014c5/js/msg_handler.js +0 -135
- package/scripts/fix-wasm-pack-output.js +0 -65
package/Cargo.toml
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "saito-wasm",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.231",
|
|
4
|
+
"files": [
|
|
5
|
+
"pkg/web/**/*",
|
|
6
|
+
"pkg/node/**/*",
|
|
7
|
+
"package.json",
|
|
8
|
+
"Cargo.toml",
|
|
9
|
+
"tsconfig.json",
|
|
10
|
+
"webpack.config.js",
|
|
11
|
+
"webpack.prod.config.js"
|
|
12
|
+
],
|
|
4
13
|
"description": "js wrappings around saito-core using wasm",
|
|
5
14
|
"repository": {
|
|
6
15
|
"type": "git",
|
package/pkg/node/index.d.ts
CHANGED
|
@@ -1,166 +1,166 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
|
-
* @
|
|
5
|
-
* @param {Uint8Array} hash
|
|
6
|
-
* @param {bigint} block_id
|
|
7
|
-
* @param {bigint} peer_id
|
|
8
|
-
* @returns {Promise<void>}
|
|
4
|
+
* @returns {Promise<WasmBlockchain>}
|
|
9
5
|
*/
|
|
10
|
-
export function
|
|
6
|
+
export function get_blockchain(): Promise<WasmBlockchain>;
|
|
11
7
|
/**
|
|
12
|
-
* @param {
|
|
13
|
-
* @returns {Promise<
|
|
8
|
+
* @param {Array<any>} keys
|
|
9
|
+
* @returns {Promise<WasmBalanceSnapshot>}
|
|
14
10
|
*/
|
|
15
|
-
export function
|
|
11
|
+
export function get_balance_snapshot(keys: Array<any>): Promise<WasmBalanceSnapshot>;
|
|
16
12
|
/**
|
|
17
|
-
* @param {
|
|
13
|
+
* @param {bigint} peer_id
|
|
18
14
|
* @returns {Promise<void>}
|
|
19
15
|
*/
|
|
20
|
-
export function
|
|
16
|
+
export function process_peer_disconnection(peer_id: bigint): Promise<void>;
|
|
21
17
|
/**
|
|
22
|
-
* @
|
|
23
|
-
* @param {string} private_key
|
|
24
|
-
* @param {number} log_level_num
|
|
25
|
-
* @param {bigint} hasten_multiplier
|
|
26
|
-
* @param {boolean} delete_old_blocks
|
|
27
|
-
* @returns {Promise<any>}
|
|
18
|
+
* @returns {Promise<boolean>}
|
|
28
19
|
*/
|
|
29
|
-
export function
|
|
20
|
+
export function produce_block_with_gt(): Promise<boolean>;
|
|
30
21
|
/**
|
|
31
|
-
* @
|
|
22
|
+
* @param {Uint8Array} buffer
|
|
23
|
+
* @param {string} signature
|
|
24
|
+
* @param {string} public_key
|
|
25
|
+
* @returns {boolean}
|
|
32
26
|
*/
|
|
33
|
-
export function
|
|
27
|
+
export function verify_signature(buffer: Uint8Array, signature: string, public_key: string): boolean;
|
|
34
28
|
/**
|
|
35
29
|
* @param {Uint8Array} buffer
|
|
36
|
-
* @
|
|
37
|
-
* @returns {Promise<Uint8Array>}
|
|
30
|
+
* @returns {string}
|
|
38
31
|
*/
|
|
39
|
-
export function
|
|
32
|
+
export function hash(buffer: Uint8Array): string;
|
|
40
33
|
/**
|
|
41
|
-
* @param {
|
|
42
|
-
* @
|
|
43
|
-
* @returns {Promise<void>}
|
|
34
|
+
* @param {string | undefined} [url]
|
|
35
|
+
* @returns {Promise<WasmNetworkPeer>}
|
|
44
36
|
*/
|
|
45
|
-
export function
|
|
37
|
+
export function create_network_peer(url?: string): Promise<WasmNetworkPeer>;
|
|
38
|
+
/**
|
|
39
|
+
* @returns {Promise<Array<any>>}
|
|
40
|
+
*/
|
|
41
|
+
export function get_nft_list(): Promise<Array<any>>;
|
|
42
|
+
/**
|
|
43
|
+
* @returns {WasmNetwork}
|
|
44
|
+
*/
|
|
45
|
+
export function get_network(): WasmNetwork;
|
|
46
46
|
/**
|
|
47
47
|
* @param {bigint} current_time
|
|
48
48
|
* @returns {Promise<void>}
|
|
49
49
|
*/
|
|
50
50
|
export function process_stat_interval(current_time: bigint): Promise<void>;
|
|
51
51
|
/**
|
|
52
|
-
* @param {string}
|
|
53
|
-
* @returns {Promise<
|
|
52
|
+
* @param {string} public_key
|
|
53
|
+
* @returns {Promise<Array<any>>}
|
|
54
54
|
*/
|
|
55
|
-
export function
|
|
55
|
+
export function get_account_slips(public_key: string): Promise<Array<any>>;
|
|
56
|
+
/**
|
|
57
|
+
* @param {Uint8Array} hash
|
|
58
|
+
* @param {bigint} block_id
|
|
59
|
+
* @param {bigint} peer_id
|
|
60
|
+
* @returns {Promise<void>}
|
|
61
|
+
*/
|
|
62
|
+
export function process_failed_block_fetch(hash: Uint8Array, block_id: bigint, peer_id: bigint): Promise<void>;
|
|
56
63
|
/**
|
|
57
64
|
* @param {Uint8Array} buffer
|
|
65
|
+
* @param {string} private_key
|
|
58
66
|
* @returns {string}
|
|
59
67
|
*/
|
|
60
|
-
export function
|
|
68
|
+
export function sign_buffer(buffer: Uint8Array, private_key: string): string;
|
|
61
69
|
/**
|
|
62
|
-
* @returns {Promise<
|
|
70
|
+
* @returns {Promise<void>}
|
|
63
71
|
*/
|
|
64
|
-
export function
|
|
72
|
+
export function disable_producing_blocks_by_timer(): Promise<void>;
|
|
65
73
|
/**
|
|
66
|
-
* @
|
|
74
|
+
* @param {bigint} peer_id
|
|
75
|
+
* @param {boolean} initiate_handshake
|
|
76
|
+
* @returns {Promise<void>}
|
|
67
77
|
*/
|
|
68
|
-
export function
|
|
78
|
+
export function process_new_peer(peer_id: bigint, initiate_handshake: boolean): Promise<void>;
|
|
69
79
|
/**
|
|
70
|
-
* @param {
|
|
71
|
-
* @param {string} signature
|
|
72
|
-
* @param {string} public_key
|
|
80
|
+
* @param {string} key
|
|
73
81
|
* @returns {boolean}
|
|
74
82
|
*/
|
|
75
|
-
export function
|
|
76
|
-
/**
|
|
77
|
-
* @returns {Promise<Array<any>>}
|
|
78
|
-
*/
|
|
79
|
-
export function get_mempool_txs(): Promise<Array<any>>;
|
|
83
|
+
export function isPublicKey(key: string): boolean;
|
|
80
84
|
/**
|
|
81
85
|
* @param {bigint} threshold
|
|
82
86
|
* @returns {Promise<void>}
|
|
83
87
|
*/
|
|
84
88
|
export function write_issuance_file(threshold: bigint): Promise<void>;
|
|
85
89
|
/**
|
|
86
|
-
* @
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* @returns {Promise<WasmWallet>}
|
|
90
|
+
* @param {bigint} peer_id
|
|
91
|
+
* @param {string} public_key
|
|
92
|
+
* @returns {Promise<void>}
|
|
91
93
|
*/
|
|
92
|
-
export function
|
|
94
|
+
export function process_stun_peer(peer_id: bigint, public_key: string): Promise<void>;
|
|
93
95
|
/**
|
|
94
|
-
* @
|
|
96
|
+
* @param {bigint} duration_in_ms
|
|
97
|
+
* @returns {Promise<void>}
|
|
95
98
|
*/
|
|
96
|
-
export function
|
|
99
|
+
export function process_timer_event(duration_in_ms: bigint): Promise<void>;
|
|
97
100
|
/**
|
|
98
|
-
* @returns {Promise<
|
|
101
|
+
* @returns {Promise<WasmWallet>}
|
|
99
102
|
*/
|
|
100
|
-
export function
|
|
103
|
+
export function get_wallet(): Promise<WasmWallet>;
|
|
101
104
|
/**
|
|
102
|
-
* @param {Uint8Array} buffer
|
|
103
105
|
* @param {string} private_key
|
|
104
106
|
* @returns {string}
|
|
105
107
|
*/
|
|
106
|
-
export function
|
|
108
|
+
export function generate_public_key(private_key: string): string;
|
|
107
109
|
/**
|
|
108
|
-
* @
|
|
109
|
-
* @returns {Promise<WasmNetworkPeer>}
|
|
110
|
+
* @returns {Promise<Array<any>>}
|
|
110
111
|
*/
|
|
111
|
-
export function
|
|
112
|
+
export function get_mempool_txs(): Promise<Array<any>>;
|
|
112
113
|
/**
|
|
113
|
-
* @param {
|
|
114
|
-
* @
|
|
114
|
+
* @param {Uint8Array} buffer
|
|
115
|
+
* @param {WasmNetworkPeer} peer
|
|
116
|
+
* @returns {Promise<Uint8Array>}
|
|
115
117
|
*/
|
|
116
|
-
export function
|
|
118
|
+
export function process_msg_buffer_from_peer(buffer: Uint8Array, peer: WasmNetworkPeer): Promise<Uint8Array>;
|
|
117
119
|
/**
|
|
118
|
-
* @param {
|
|
120
|
+
* @param {WasmBalanceSnapshot} snapshot
|
|
119
121
|
* @returns {Promise<void>}
|
|
120
122
|
*/
|
|
121
|
-
export function
|
|
123
|
+
export function update_from_balance_snapshot(snapshot: WasmBalanceSnapshot): Promise<void>;
|
|
122
124
|
/**
|
|
123
|
-
* @
|
|
124
|
-
* @param {boolean} initiate_handshake
|
|
125
|
-
* @returns {Promise<void>}
|
|
125
|
+
* @returns {Promise<boolean>}
|
|
126
126
|
*/
|
|
127
|
-
export function
|
|
127
|
+
export function produce_block_without_gt(): Promise<boolean>;
|
|
128
128
|
/**
|
|
129
|
-
* @param {Uint8Array} hash
|
|
130
|
-
* @param {bigint} block_id
|
|
131
129
|
* @param {bigint} peer_id
|
|
130
|
+
* @param {string} public_key
|
|
132
131
|
* @returns {Promise<void>}
|
|
133
132
|
*/
|
|
134
|
-
export function
|
|
135
|
-
/**
|
|
136
|
-
* @returns {string}
|
|
137
|
-
*/
|
|
138
|
-
export function generate_private_key(): string;
|
|
133
|
+
export function remove_stun_peer(peer_id: bigint, public_key: string): Promise<void>;
|
|
139
134
|
/**
|
|
140
|
-
* @
|
|
141
|
-
* @returns {Promise<void>}
|
|
135
|
+
* @returns {Promise<string>}
|
|
142
136
|
*/
|
|
143
|
-
export function
|
|
137
|
+
export function get_latest_block_hash(): Promise<string>;
|
|
144
138
|
/**
|
|
145
|
-
* @
|
|
139
|
+
* @param {string} config_json
|
|
140
|
+
* @param {string} private_key
|
|
141
|
+
* @param {number} log_level_num
|
|
142
|
+
* @param {bigint} hasten_multiplier
|
|
143
|
+
* @param {boolean} delete_old_blocks
|
|
144
|
+
* @returns {Promise<any>}
|
|
146
145
|
*/
|
|
147
|
-
export function
|
|
146
|
+
export function initialize(config_json: string, private_key: string, log_level_num: number, hasten_multiplier: bigint, delete_old_blocks: boolean): Promise<any>;
|
|
148
147
|
/**
|
|
149
|
-
* @param {string}
|
|
150
|
-
* @returns {
|
|
148
|
+
* @param {string} block_hash
|
|
149
|
+
* @returns {Promise<WasmBlock>}
|
|
151
150
|
*/
|
|
152
|
-
export function
|
|
151
|
+
export function get_block(block_hash: string): Promise<WasmBlock>;
|
|
153
152
|
/**
|
|
153
|
+
* @param {Uint8Array} buffer
|
|
154
|
+
* @param {Uint8Array} hash
|
|
155
|
+
* @param {bigint} block_id
|
|
154
156
|
* @param {bigint} peer_id
|
|
155
|
-
* @param {string} public_key
|
|
156
157
|
* @returns {Promise<void>}
|
|
157
158
|
*/
|
|
158
|
-
export function
|
|
159
|
+
export function process_fetched_block(buffer: Uint8Array, hash: Uint8Array, block_id: bigint, peer_id: bigint): Promise<void>;
|
|
159
160
|
/**
|
|
160
|
-
* @
|
|
161
|
-
* @returns {boolean}
|
|
161
|
+
* @returns {string}
|
|
162
162
|
*/
|
|
163
|
-
export function
|
|
163
|
+
export function generate_private_key(): string;
|
|
164
164
|
/**
|
|
165
165
|
*/
|
|
166
166
|
export class SaitoWasm {
|
|
@@ -856,10 +856,10 @@ export class WasmWallet {
|
|
|
856
856
|
* @param {string} public_key
|
|
857
857
|
* @param {bigint} amount
|
|
858
858
|
* @param {bigint} fee
|
|
859
|
-
* @param {boolean}
|
|
859
|
+
* @param {boolean} _force_merge
|
|
860
860
|
* @returns {Promise<WasmTransaction>}
|
|
861
861
|
*/
|
|
862
|
-
createTransaction(public_key: string, amount: bigint, fee: bigint,
|
|
862
|
+
createTransaction(public_key: string, amount: bigint, fee: bigint, _force_merge: boolean): Promise<WasmTransaction>;
|
|
863
863
|
/**
|
|
864
864
|
* @returns {Promise<object>}
|
|
865
865
|
*/
|
|
@@ -872,6 +872,16 @@ export class WasmWallet {
|
|
|
872
872
|
*/
|
|
873
873
|
setWalletVersion(major: number, minor: number, patch: number): Promise<void>;
|
|
874
874
|
/**
|
|
875
|
+
* @param {string} recipient_public_key
|
|
876
|
+
* @param {bigint} nft_amount
|
|
877
|
+
* @param {string} nft_uuid
|
|
878
|
+
* @param {bigint} fee
|
|
879
|
+
* @param {bigint} saito_deposit
|
|
880
|
+
* @param {Uint8Array} tx_msg
|
|
881
|
+
* @returns {Promise<WasmTransaction>}
|
|
882
|
+
*/
|
|
883
|
+
createNFTTransaction(recipient_public_key: string, nft_amount: bigint, nft_uuid: string, fee: bigint, saito_deposit: bigint, tx_msg: Uint8Array): Promise<WasmTransaction>;
|
|
884
|
+
/**
|
|
875
885
|
* @param {bigint} num
|
|
876
886
|
* @param {bigint} deposit
|
|
877
887
|
* @param {Uint8Array} tx_msg
|