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