saito-wasm 0.2.236 → 0.2.238

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