saito-wasm 0.2.232 → 0.2.233

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