saito-wasm 0.2.229 → 0.2.232

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