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 CHANGED
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "saito-wasm"
3
- version = "0.2.239"
3
+ version = "0.2.240"
4
4
  edition = "2021"
5
5
 
6
6
  # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "saito-wasm",
3
- "version": "0.2.239",
3
+ "version": "0.2.240",
4
4
  "files": [
5
5
  "pkg/web/**/*",
6
6
  "pkg/node/**/*",
@@ -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 sign_buffer(buffer: Uint8Array, private_key: string): string;
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 {WasmBalanceSnapshot} snapshot
26
- * @returns {Promise<void>}
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 disable_producing_blocks_by_timer(): Promise<void>;
16
+ export function remove_stun_peer(peer_id: bigint, public_key: string): Promise<void>;
33
17
  /**
34
- * @param {Uint8Array} hash
35
- * @param {bigint} block_id
36
- * @param {bigint} peer_id
37
- * @returns {Promise<void>}
18
+ * @param {string | undefined} [url]
19
+ * @returns {Promise<WasmNetworkPeer>}
38
20
  */
39
- export function process_failed_block_fetch(hash: Uint8Array, block_id: bigint, peer_id: bigint): Promise<void>;
21
+ export function create_network_peer(url?: string): Promise<WasmNetworkPeer>;
40
22
  /**
41
- * @param {string} block_hash
42
- * @returns {Promise<WasmBlock>}
23
+ * @returns {Promise<boolean>}
43
24
  */
44
- export function get_block(block_hash: string): Promise<WasmBlock>;
25
+ export function produce_block_with_gt(): Promise<boolean>;
45
26
  /**
46
- * @param {string} key
47
- * @returns {boolean}
27
+ * @returns {Promise<string>}
48
28
  */
49
- export function isPublicKey(key: string): boolean;
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 hash(buffer: Uint8Array): string;
35
+ export function sign_buffer(buffer: Uint8Array, private_key: string): string;
55
36
  /**
56
- * @param {Array<any>} keys
57
- * @returns {Promise<WasmBalanceSnapshot>}
37
+ * @returns {WasmNetwork}
58
38
  */
59
- export function get_balance_snapshot(keys: Array<any>): Promise<WasmBalanceSnapshot>;
39
+ export function get_network(): WasmNetwork;
60
40
  /**
61
41
  * @param {Uint8Array} buffer
62
- * @param {string} signature
63
- * @param {string} public_key
64
- * @returns {boolean}
42
+ * @returns {string}
65
43
  */
66
- export function verify_signature(buffer: Uint8Array, signature: string, public_key: string): boolean;
44
+ export function hash(buffer: Uint8Array): string;
67
45
  /**
68
- * @returns {Promise<string>}
46
+ * @returns {Promise<WasmBlockchain>}
69
47
  */
70
- export function get_latest_block_hash(): Promise<string>;
48
+ export function get_blockchain(): Promise<WasmBlockchain>;
71
49
  /**
72
- * @returns {Promise<boolean>}
50
+ * @param {bigint} duration_in_ms
51
+ * @returns {Promise<void>}
73
52
  */
74
- export function produce_block_with_gt(): Promise<boolean>;
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 process_peer_disconnection(peer_id: bigint): Promise<void>;
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 {bigint} peer_id
86
- * @param {string} public_key
87
- * @returns {Promise<void>}
63
+ * @param {string} json
64
+ * @returns {Promise<number>}
88
65
  */
89
- export function remove_stun_peer(peer_id: bigint, public_key: string): Promise<void>;
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 process_new_peer(peer_id: bigint, initiate_handshake: boolean): Promise<void>;
70
+ export function disable_producing_blocks_by_timer(): Promise<void>;
96
71
  /**
97
- * @param {string} private_key
98
- * @returns {string}
72
+ * @returns {Promise<WasmWallet>}
99
73
  */
100
- export function generate_public_key(private_key: string): string;
74
+ export function get_wallet(): Promise<WasmWallet>;
101
75
  /**
102
- * @param {string | undefined} [url]
103
- * @returns {Promise<WasmNetworkPeer>}
76
+ * @param {string} block_hash
77
+ * @returns {Promise<WasmBlock>}
104
78
  */
105
- export function create_network_peer(url?: string): Promise<WasmNetworkPeer>;
79
+ export function get_block(block_hash: string): Promise<WasmBlock>;
106
80
  /**
107
- * @returns {WasmNetwork}
81
+ * @returns {Promise<Array<any>>}
108
82
  */
109
- export function get_network(): WasmNetwork;
83
+ export function get_mempool_txs(): Promise<Array<any>>;
110
84
  /**
111
- * @param {Uint8Array} buffer
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 process_fetched_block(buffer: Uint8Array, hash: Uint8Array, block_id: bigint, peer_id: bigint): Promise<void>;
88
+ export function update_from_balance_snapshot(snapshot: WasmBalanceSnapshot): Promise<void>;
118
89
  /**
119
- * @param {string} json
120
- * @returns {Promise<number>}
90
+ * @param {string} key
91
+ * @returns {boolean}
121
92
  */
122
- export function evaluate_script(json: string): Promise<number>;
93
+ export function isPublicKey(key: string): boolean;
123
94
  /**
124
- * @param {bigint} current_time
95
+ * @param {bigint} peer_id
125
96
  * @returns {Promise<void>}
126
97
  */
127
- export function process_stat_interval(current_time: bigint): Promise<void>;
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
- * @returns {Promise<Array<any>>}
109
+ * @param {bigint} current_time
110
+ * @returns {Promise<void>}
144
111
  */
145
- export function get_mempool_txs(): Promise<Array<any>>;
112
+ export function process_stat_interval(current_time: bigint): Promise<void>;
146
113
  /**
147
- * @param {bigint} duration_in_ms
114
+ * @param {bigint} threshold
148
115
  * @returns {Promise<void>}
149
116
  */
150
- export function process_timer_event(duration_in_ms: bigint): Promise<void>;
117
+ export function write_issuance_file(threshold: bigint): Promise<void>;
151
118
  /**
152
- * @returns {string}
119
+ * @param {Array<any>} keys
120
+ * @returns {Promise<WasmBalanceSnapshot>}
153
121
  */
154
- export function generate_private_key(): string;
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
- * @returns {Promise<WasmWallet>}
143
+ * @param {string} private_key
144
+ * @returns {string}
163
145
  */
164
- export function get_wallet(): Promise<WasmWallet>;
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;