saito-wasm 0.2.239 → 0.2.240
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 +86 -86
- package/pkg/node/index.js +196 -196
- package/pkg/node/index_bg.wasm +0 -0
- package/pkg/node/package.json +1 -1
- package/pkg/web/index.d.ts +86 -86
- package/pkg/web/index.js +196 -196
- package/pkg/web/index_bg.wasm +0 -0
- package/pkg/web/package.json +3 -3
- /package/pkg/node/snippets/{saito-wasm-785d0781d8caf60c → saito-wasm-9fecb2991d64dbbe}/js/msg_handler.js +0 -0
- /package/pkg/web/snippets/{saito-wasm-785d0781d8caf60c → saito-wasm-9fecb2991d64dbbe}/js/msg_handler.js +0 -0
package/Cargo.toml
CHANGED
package/package.json
CHANGED
package/pkg/node/index.d.ts
CHANGED
|
@@ -1,135 +1,101 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
|
-
* @param {Uint8Array} buffer
|
|
5
|
-
* @param {string} private_key
|
|
6
4
|
* @returns {string}
|
|
7
5
|
*/
|
|
8
|
-
export function
|
|
9
|
-
/**
|
|
10
|
-
* @param {bigint} threshold
|
|
11
|
-
* @returns {Promise<void>}
|
|
12
|
-
*/
|
|
13
|
-
export function write_issuance_file(threshold: bigint): Promise<void>;
|
|
14
|
-
/**
|
|
15
|
-
* @param {bigint} peer_id
|
|
16
|
-
* @param {string} public_key
|
|
17
|
-
* @returns {Promise<void>}
|
|
18
|
-
*/
|
|
19
|
-
export function process_stun_peer(peer_id: bigint, public_key: string): Promise<void>;
|
|
6
|
+
export function generate_private_key(): string;
|
|
20
7
|
/**
|
|
21
8
|
* @returns {Promise<boolean>}
|
|
22
9
|
*/
|
|
23
10
|
export function produce_block_without_gt(): Promise<boolean>;
|
|
24
11
|
/**
|
|
25
|
-
* @param {
|
|
26
|
-
* @
|
|
27
|
-
*/
|
|
28
|
-
export function update_from_balance_snapshot(snapshot: WasmBalanceSnapshot): Promise<void>;
|
|
29
|
-
/**
|
|
12
|
+
* @param {bigint} peer_id
|
|
13
|
+
* @param {string} public_key
|
|
30
14
|
* @returns {Promise<void>}
|
|
31
15
|
*/
|
|
32
|
-
export function
|
|
16
|
+
export function remove_stun_peer(peer_id: bigint, public_key: string): Promise<void>;
|
|
33
17
|
/**
|
|
34
|
-
* @param {
|
|
35
|
-
* @
|
|
36
|
-
* @param {bigint} peer_id
|
|
37
|
-
* @returns {Promise<void>}
|
|
18
|
+
* @param {string | undefined} [url]
|
|
19
|
+
* @returns {Promise<WasmNetworkPeer>}
|
|
38
20
|
*/
|
|
39
|
-
export function
|
|
21
|
+
export function create_network_peer(url?: string): Promise<WasmNetworkPeer>;
|
|
40
22
|
/**
|
|
41
|
-
* @
|
|
42
|
-
* @returns {Promise<WasmBlock>}
|
|
23
|
+
* @returns {Promise<boolean>}
|
|
43
24
|
*/
|
|
44
|
-
export function
|
|
25
|
+
export function produce_block_with_gt(): Promise<boolean>;
|
|
45
26
|
/**
|
|
46
|
-
* @
|
|
47
|
-
* @returns {boolean}
|
|
27
|
+
* @returns {Promise<string>}
|
|
48
28
|
*/
|
|
49
|
-
export function
|
|
29
|
+
export function get_latest_block_hash(): Promise<string>;
|
|
50
30
|
/**
|
|
51
31
|
* @param {Uint8Array} buffer
|
|
32
|
+
* @param {string} private_key
|
|
52
33
|
* @returns {string}
|
|
53
34
|
*/
|
|
54
|
-
export function
|
|
35
|
+
export function sign_buffer(buffer: Uint8Array, private_key: string): string;
|
|
55
36
|
/**
|
|
56
|
-
* @
|
|
57
|
-
* @returns {Promise<WasmBalanceSnapshot>}
|
|
37
|
+
* @returns {WasmNetwork}
|
|
58
38
|
*/
|
|
59
|
-
export function
|
|
39
|
+
export function get_network(): WasmNetwork;
|
|
60
40
|
/**
|
|
61
41
|
* @param {Uint8Array} buffer
|
|
62
|
-
* @
|
|
63
|
-
* @param {string} public_key
|
|
64
|
-
* @returns {boolean}
|
|
42
|
+
* @returns {string}
|
|
65
43
|
*/
|
|
66
|
-
export function
|
|
44
|
+
export function hash(buffer: Uint8Array): string;
|
|
67
45
|
/**
|
|
68
|
-
* @returns {Promise<
|
|
46
|
+
* @returns {Promise<WasmBlockchain>}
|
|
69
47
|
*/
|
|
70
|
-
export function
|
|
48
|
+
export function get_blockchain(): Promise<WasmBlockchain>;
|
|
71
49
|
/**
|
|
72
|
-
* @
|
|
50
|
+
* @param {bigint} duration_in_ms
|
|
51
|
+
* @returns {Promise<void>}
|
|
73
52
|
*/
|
|
74
|
-
export function
|
|
53
|
+
export function process_timer_event(duration_in_ms: bigint): Promise<void>;
|
|
75
54
|
/**
|
|
55
|
+
* @param {Uint8Array} buffer
|
|
56
|
+
* @param {Uint8Array} hash
|
|
57
|
+
* @param {bigint} block_id
|
|
76
58
|
* @param {bigint} peer_id
|
|
77
59
|
* @returns {Promise<void>}
|
|
78
60
|
*/
|
|
79
|
-
export function
|
|
80
|
-
/**
|
|
81
|
-
* @returns {Promise<WasmBlockchain>}
|
|
82
|
-
*/
|
|
83
|
-
export function get_blockchain(): Promise<WasmBlockchain>;
|
|
61
|
+
export function process_fetched_block(buffer: Uint8Array, hash: Uint8Array, block_id: bigint, peer_id: bigint): Promise<void>;
|
|
84
62
|
/**
|
|
85
|
-
* @param {
|
|
86
|
-
* @
|
|
87
|
-
* @returns {Promise<void>}
|
|
63
|
+
* @param {string} json
|
|
64
|
+
* @returns {Promise<number>}
|
|
88
65
|
*/
|
|
89
|
-
export function
|
|
66
|
+
export function evaluate_script(json: string): Promise<number>;
|
|
90
67
|
/**
|
|
91
|
-
* @param {bigint} peer_id
|
|
92
|
-
* @param {boolean} initiate_handshake
|
|
93
68
|
* @returns {Promise<void>}
|
|
94
69
|
*/
|
|
95
|
-
export function
|
|
70
|
+
export function disable_producing_blocks_by_timer(): Promise<void>;
|
|
96
71
|
/**
|
|
97
|
-
* @
|
|
98
|
-
* @returns {string}
|
|
72
|
+
* @returns {Promise<WasmWallet>}
|
|
99
73
|
*/
|
|
100
|
-
export function
|
|
74
|
+
export function get_wallet(): Promise<WasmWallet>;
|
|
101
75
|
/**
|
|
102
|
-
* @param {string
|
|
103
|
-
* @returns {Promise<
|
|
76
|
+
* @param {string} block_hash
|
|
77
|
+
* @returns {Promise<WasmBlock>}
|
|
104
78
|
*/
|
|
105
|
-
export function
|
|
79
|
+
export function get_block(block_hash: string): Promise<WasmBlock>;
|
|
106
80
|
/**
|
|
107
|
-
* @returns {
|
|
81
|
+
* @returns {Promise<Array<any>>}
|
|
108
82
|
*/
|
|
109
|
-
export function
|
|
83
|
+
export function get_mempool_txs(): Promise<Array<any>>;
|
|
110
84
|
/**
|
|
111
|
-
* @param {
|
|
112
|
-
* @param {Uint8Array} hash
|
|
113
|
-
* @param {bigint} block_id
|
|
114
|
-
* @param {bigint} peer_id
|
|
85
|
+
* @param {WasmBalanceSnapshot} snapshot
|
|
115
86
|
* @returns {Promise<void>}
|
|
116
87
|
*/
|
|
117
|
-
export function
|
|
88
|
+
export function update_from_balance_snapshot(snapshot: WasmBalanceSnapshot): Promise<void>;
|
|
118
89
|
/**
|
|
119
|
-
* @param {string}
|
|
120
|
-
* @returns {
|
|
90
|
+
* @param {string} key
|
|
91
|
+
* @returns {boolean}
|
|
121
92
|
*/
|
|
122
|
-
export function
|
|
93
|
+
export function isPublicKey(key: string): boolean;
|
|
123
94
|
/**
|
|
124
|
-
* @param {bigint}
|
|
95
|
+
* @param {bigint} peer_id
|
|
125
96
|
* @returns {Promise<void>}
|
|
126
97
|
*/
|
|
127
|
-
export function
|
|
128
|
-
/**
|
|
129
|
-
* @param {string} public_key
|
|
130
|
-
* @returns {Promise<Array<any>>}
|
|
131
|
-
*/
|
|
132
|
-
export function get_account_slips(public_key: string): Promise<Array<any>>;
|
|
98
|
+
export function process_peer_disconnection(peer_id: bigint): Promise<void>;
|
|
133
99
|
/**
|
|
134
100
|
* @param {string} config_json
|
|
135
101
|
* @param {string} private_key
|
|
@@ -140,18 +106,33 @@ export function get_account_slips(public_key: string): Promise<Array<any>>;
|
|
|
140
106
|
*/
|
|
141
107
|
export function initialize(config_json: string, private_key: string, log_level_num: number, hasten_multiplier: bigint, delete_old_blocks: boolean): Promise<any>;
|
|
142
108
|
/**
|
|
143
|
-
* @
|
|
109
|
+
* @param {bigint} current_time
|
|
110
|
+
* @returns {Promise<void>}
|
|
144
111
|
*/
|
|
145
|
-
export function
|
|
112
|
+
export function process_stat_interval(current_time: bigint): Promise<void>;
|
|
146
113
|
/**
|
|
147
|
-
* @param {bigint}
|
|
114
|
+
* @param {bigint} threshold
|
|
148
115
|
* @returns {Promise<void>}
|
|
149
116
|
*/
|
|
150
|
-
export function
|
|
117
|
+
export function write_issuance_file(threshold: bigint): Promise<void>;
|
|
151
118
|
/**
|
|
152
|
-
* @
|
|
119
|
+
* @param {Array<any>} keys
|
|
120
|
+
* @returns {Promise<WasmBalanceSnapshot>}
|
|
153
121
|
*/
|
|
154
|
-
export function
|
|
122
|
+
export function get_balance_snapshot(keys: Array<any>): Promise<WasmBalanceSnapshot>;
|
|
123
|
+
/**
|
|
124
|
+
* @param {bigint} peer_id
|
|
125
|
+
* @param {boolean} initiate_handshake
|
|
126
|
+
* @returns {Promise<void>}
|
|
127
|
+
*/
|
|
128
|
+
export function process_new_peer(peer_id: bigint, initiate_handshake: boolean): Promise<void>;
|
|
129
|
+
/**
|
|
130
|
+
* @param {Uint8Array} buffer
|
|
131
|
+
* @param {string} signature
|
|
132
|
+
* @param {string} public_key
|
|
133
|
+
* @returns {boolean}
|
|
134
|
+
*/
|
|
135
|
+
export function verify_signature(buffer: Uint8Array, signature: string, public_key: string): boolean;
|
|
155
136
|
/**
|
|
156
137
|
* @param {Uint8Array} buffer
|
|
157
138
|
* @param {WasmNetworkPeer} peer
|
|
@@ -159,14 +140,33 @@ export function generate_private_key(): string;
|
|
|
159
140
|
*/
|
|
160
141
|
export function process_msg_buffer_from_peer(buffer: Uint8Array, peer: WasmNetworkPeer): Promise<Uint8Array>;
|
|
161
142
|
/**
|
|
162
|
-
* @
|
|
143
|
+
* @param {string} private_key
|
|
144
|
+
* @returns {string}
|
|
163
145
|
*/
|
|
164
|
-
export function
|
|
146
|
+
export function generate_public_key(private_key: string): string;
|
|
165
147
|
/**
|
|
166
148
|
* @returns {Promise<Array<any>>}
|
|
167
149
|
*/
|
|
168
150
|
export function get_nft_list(): Promise<Array<any>>;
|
|
169
151
|
/**
|
|
152
|
+
* @param {string} public_key
|
|
153
|
+
* @returns {Promise<Array<any>>}
|
|
154
|
+
*/
|
|
155
|
+
export function get_account_slips(public_key: string): Promise<Array<any>>;
|
|
156
|
+
/**
|
|
157
|
+
* @param {bigint} peer_id
|
|
158
|
+
* @param {string} public_key
|
|
159
|
+
* @returns {Promise<void>}
|
|
160
|
+
*/
|
|
161
|
+
export function process_stun_peer(peer_id: bigint, public_key: string): Promise<void>;
|
|
162
|
+
/**
|
|
163
|
+
* @param {Uint8Array} hash
|
|
164
|
+
* @param {bigint} block_id
|
|
165
|
+
* @param {bigint} peer_id
|
|
166
|
+
* @returns {Promise<void>}
|
|
167
|
+
*/
|
|
168
|
+
export function process_failed_block_fetch(hash: Uint8Array, block_id: bigint, peer_id: bigint): Promise<void>;
|
|
169
|
+
/**
|
|
170
170
|
*/
|
|
171
171
|
export class SaitoWasm {
|
|
172
172
|
free(): void;
|