saito-wasm 0.2.232 → 0.2.234

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