saito-wasm 0.2.227 → 0.2.228

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