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