saito-wasm 0.2.229 → 0.2.231

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