@lightprotocol/zk-compression-cli 0.18.1 → 0.19.0

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.
Binary file
Binary file
package/bin/forester ADDED
Binary file
@@ -0,0 +1,15 @@
1
+ CU_LIMIT=1_000_000
2
+ RPC_POOL_SIZE=20
3
+ MAX_RETRIES=5
4
+ RETRY_DELAY=1000
5
+ RETRY_TIMEOUT=120_000
6
+ INDEXER_BATCH_SIZE=50
7
+ INDEXER_MAX_CONCURRENT_BATCHES=50
8
+ TRANSACTION_BATCH_SIZE=1
9
+ TRANSACTION_MAX_CONCURRENT_BATCHES=50
10
+ SLOT_UPDATE_INTERVAL_SECONDS=30
11
+ TREE_DISCOVERY_INTERVAL_SECONDS=5
12
+ STATE_QUEUE_START_INDEX=0
13
+ STATE_QUEUE_LENGTH=28807
14
+ ADDRESS_QUEUE_START_INDEX=0
15
+ ADDRESS_QUEUE_LENGTH=28807
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -20,8 +20,8 @@ export declare const ANCHOR_VERSION = "0.29.0";
20
20
  export declare const BORSH_VERSION = "0.9.2";
21
21
  export declare const LIGHT_HASHER_VERSION = "1.1.0";
22
22
  export declare const LIGHT_MACROS_VERSION = "1.1.0";
23
- export declare const LIGHT_SDK_VERSION = "0.10.0";
24
- export declare const LIGHT_SDK_MACROS_VERSION = "0.3.0";
23
+ export declare const LIGHT_SDK_VERSION = "0.11.0";
24
+ export declare const LIGHT_SDK_MACROS_VERSION = "0.4.0";
25
25
  export declare const LIGHT_UTILS_VERSION = "1.1.0";
26
26
  export declare const LIGHT_VERIFIER_VERSION = "1.1.0";
27
27
  export declare const SOLANA_SDK_VERSION = "1.18.22";
@@ -25,8 +25,8 @@ exports.ANCHOR_VERSION = "0.29.0";
25
25
  exports.BORSH_VERSION = "0.9.2";
26
26
  exports.LIGHT_HASHER_VERSION = "1.1.0";
27
27
  exports.LIGHT_MACROS_VERSION = "1.1.0";
28
- exports.LIGHT_SDK_VERSION = "0.10.0";
29
- exports.LIGHT_SDK_MACROS_VERSION = "0.3.0";
28
+ exports.LIGHT_SDK_VERSION = "0.11.0";
29
+ exports.LIGHT_SDK_MACROS_VERSION = "0.4.0";
30
30
  exports.LIGHT_UTILS_VERSION = "1.1.0";
31
31
  exports.LIGHT_VERIFIER_VERSION = "1.1.0";
32
32
  exports.SOLANA_SDK_VERSION = "1.18.22";
@@ -15,6 +15,7 @@ const find_process_1 = tslib_1.__importDefault(require("find-process"));
15
15
  const node_child_process_1 = require("node:child_process");
16
16
  const util_1 = require("util");
17
17
  const axios_1 = tslib_1.__importDefault(require("axios"));
18
+ const shellQuote = tslib_1.__importStar(require("shell-quote"));
18
19
  const waitOn = require("wait-on");
19
20
  async function killProcess(processName) {
20
21
  const processList = await (0, find_process_1.default)("name", processName);
@@ -24,7 +25,8 @@ async function killProcess(processName) {
24
25
  });
25
26
  }
26
27
  async function killProcessByPort(port) {
27
- await execute(`lsof -t -i:${port} | while read line; do kill -9 $line; done`);
28
+ const portArg = shellQuote.quote([`-i:${port}`]);
29
+ await execute(`lsof -t ${portArg} | while read line; do kill -9 $line; done`);
28
30
  }
29
31
  /**
30
32
  * Executes a command and logs the output to the console.
@@ -1,12 +1,20 @@
1
1
  {
2
2
  "commands": {
3
- "compress-spl": {
3
+ "approve-and-mint-to": {
4
4
  "aliases": [],
5
5
  "args": {},
6
6
  "examples": [
7
- "$ light compress-spl --mint PublicKey --to PublicKey --amount 10"
7
+ "$ light approve-and-mint-to --mint PublicKey --to PublicKey --amount 1000"
8
8
  ],
9
9
  "flags": {
10
+ "mint-authority": {
11
+ "description": "Specify the filepath of the mint authority keypair. Defaults to your local solana wallet.",
12
+ "name": "mint-authority",
13
+ "required": false,
14
+ "hasDynamicHelp": false,
15
+ "multiple": false,
16
+ "type": "option"
17
+ },
10
18
  "mint": {
11
19
  "description": "Specify the mint address.",
12
20
  "name": "mint",
@@ -16,7 +24,7 @@
16
24
  "type": "option"
17
25
  },
18
26
  "to": {
19
- "description": "Specify the recipient address (owner of destination compressed token account).",
27
+ "description": "Specify the recipient address.",
20
28
  "name": "to",
21
29
  "required": true,
22
30
  "hasDynamicHelp": false,
@@ -24,7 +32,7 @@
24
32
  "type": "option"
25
33
  },
26
34
  "amount": {
27
- "description": "Amount to compress, in tokens.",
35
+ "description": "Amount to mint, in tokens.",
28
36
  "name": "amount",
29
37
  "required": true,
30
38
  "hasDynamicHelp": false,
@@ -34,155 +42,130 @@
34
42
  },
35
43
  "hasDynamicHelp": false,
36
44
  "hiddenAliases": [],
37
- "id": "compress-spl",
45
+ "id": "approve-and-mint-to",
38
46
  "pluginAlias": "@lightprotocol/zk-compression-cli",
39
47
  "pluginName": "@lightprotocol/zk-compression-cli",
40
48
  "pluginType": "core",
41
49
  "strict": true,
42
- "summary": "Compress SPL tokens.",
50
+ "summary": "Mint tokens to a compressed account via external mint authority",
43
51
  "enableJsonFlag": false,
44
52
  "isESM": false,
45
53
  "relativePath": [
46
54
  "dist",
47
55
  "commands",
48
- "compress-spl",
56
+ "approve-and-mint-to",
49
57
  "index.js"
50
58
  ]
51
59
  },
52
- "config:config": {
60
+ "compress-sol": {
53
61
  "aliases": [],
54
62
  "args": {},
55
- "description": "Initialize or update the configuration values. The default config path is ~/.config/light/config.json you can set up a custom path with an environment variable export LIGHT_PROTOCOL_CONFIG=path/to/config.json",
56
63
  "examples": [
57
- "$ light config --solanaRpcUrl https://solana-api.example.com"
64
+ "$ light compress-sol --to PublicKey --amount 10"
58
65
  ],
59
66
  "flags": {
60
- "solanaRpcUrl": {
61
- "description": "Solana RPC url",
62
- "name": "solanaRpcUrl",
63
- "hasDynamicHelp": false,
64
- "multiple": false,
65
- "type": "option"
66
- },
67
- "indexerUrl": {
68
- "description": "Indexer url",
69
- "name": "indexerUrl",
67
+ "to": {
68
+ "description": "Specify the recipient address.",
69
+ "name": "to",
70
+ "required": true,
70
71
  "hasDynamicHelp": false,
71
72
  "multiple": false,
72
73
  "type": "option"
73
74
  },
74
- "proverUrl": {
75
- "description": "Prover url",
76
- "name": "proverUrl",
75
+ "amount": {
76
+ "description": "Amount to compress, in lamports.",
77
+ "name": "amount",
78
+ "required": true,
77
79
  "hasDynamicHelp": false,
78
80
  "multiple": false,
79
81
  "type": "option"
80
- },
81
- "get": {
82
- "description": "Gets the current config values",
83
- "name": "get",
84
- "required": false,
85
- "allowNo": false,
86
- "type": "boolean"
87
82
  }
88
83
  },
89
84
  "hasDynamicHelp": false,
90
85
  "hiddenAliases": [],
91
- "id": "config:config",
86
+ "id": "compress-sol",
92
87
  "pluginAlias": "@lightprotocol/zk-compression-cli",
93
88
  "pluginName": "@lightprotocol/zk-compression-cli",
94
89
  "pluginType": "core",
95
90
  "strict": true,
91
+ "summary": "Compress SOL.",
96
92
  "enableJsonFlag": false,
97
93
  "isESM": false,
98
94
  "relativePath": [
99
95
  "dist",
100
96
  "commands",
101
- "config",
97
+ "compress-sol",
102
98
  "index.js"
103
99
  ]
104
100
  },
105
- "config": {
101
+ "balance": {
106
102
  "aliases": [],
107
103
  "args": {},
108
- "description": "Initialize or update the configuration values. The default config path is ~/.config/light/config.json you can set up a custom path with an environment variable export LIGHT_PROTOCOL_CONFIG=path/to/config.json",
109
104
  "examples": [
110
- "$ light config --solanaRpcUrl https://solana-api.example.com"
105
+ "$ light balance --mint=<ADDRESS> --owner=<ADDRESS>"
111
106
  ],
112
107
  "flags": {
113
- "solanaRpcUrl": {
114
- "description": "Solana RPC url",
115
- "name": "solanaRpcUrl",
116
- "hasDynamicHelp": false,
117
- "multiple": false,
118
- "type": "option"
119
- },
120
- "indexerUrl": {
121
- "description": "Indexer url",
122
- "name": "indexerUrl",
108
+ "owner": {
109
+ "description": "Address of the compressed token owner.",
110
+ "name": "owner",
111
+ "required": true,
123
112
  "hasDynamicHelp": false,
124
113
  "multiple": false,
125
114
  "type": "option"
126
115
  },
127
- "proverUrl": {
128
- "description": "Prover url",
129
- "name": "proverUrl",
116
+ "mint": {
117
+ "description": "Mint address of the compressed token account.",
118
+ "name": "mint",
119
+ "required": true,
130
120
  "hasDynamicHelp": false,
131
121
  "multiple": false,
132
122
  "type": "option"
133
- },
134
- "get": {
135
- "description": "Gets the current config values",
136
- "name": "get",
137
- "required": false,
138
- "allowNo": false,
139
- "type": "boolean"
140
123
  }
141
124
  },
142
125
  "hasDynamicHelp": false,
143
126
  "hiddenAliases": [],
144
- "id": "config",
127
+ "id": "balance",
145
128
  "pluginAlias": "@lightprotocol/zk-compression-cli",
146
129
  "pluginName": "@lightprotocol/zk-compression-cli",
147
130
  "pluginType": "core",
148
131
  "strict": true,
132
+ "summary": "Get balance",
149
133
  "enableJsonFlag": false,
150
134
  "isESM": false,
151
135
  "relativePath": [
152
136
  "dist",
153
137
  "commands",
154
- "config",
138
+ "balance",
155
139
  "index.js"
156
140
  ]
157
141
  },
158
- "create-mint": {
142
+ "compress-spl": {
159
143
  "aliases": [],
160
144
  "args": {},
161
145
  "examples": [
162
- "$ light create-mint --mint-decimals 5"
146
+ "$ light compress-spl --mint PublicKey --to PublicKey --amount 10"
163
147
  ],
164
148
  "flags": {
165
- "mint-keypair": {
166
- "description": "Provide a path to a mint keypair file. Defaults to a random keypair",
167
- "name": "mint-keypair",
168
- "required": false,
149
+ "mint": {
150
+ "description": "Specify the mint address.",
151
+ "name": "mint",
152
+ "required": true,
169
153
  "hasDynamicHelp": false,
170
154
  "multiple": false,
171
155
  "type": "option"
172
156
  },
173
- "mint-authority": {
174
- "description": "Address of the mint authority. Defaults to the fee payer",
175
- "name": "mint-authority",
176
- "required": false,
157
+ "to": {
158
+ "description": "Specify the recipient address (owner of destination compressed token account).",
159
+ "name": "to",
160
+ "required": true,
177
161
  "hasDynamicHelp": false,
178
162
  "multiple": false,
179
163
  "type": "option"
180
164
  },
181
- "mint-decimals": {
182
- "description": "Number of base 10 digits to the right of the decimal place [default: 9]",
183
- "name": "mint-decimals",
184
- "required": false,
185
- "default": 9,
165
+ "amount": {
166
+ "description": "Amount to compress, in tokens.",
167
+ "name": "amount",
168
+ "required": true,
186
169
  "hasDynamicHelp": false,
187
170
  "multiple": false,
188
171
  "type": "option"
@@ -190,40 +173,49 @@
190
173
  },
191
174
  "hasDynamicHelp": false,
192
175
  "hiddenAliases": [],
193
- "id": "create-mint",
176
+ "id": "compress-spl",
194
177
  "pluginAlias": "@lightprotocol/zk-compression-cli",
195
178
  "pluginName": "@lightprotocol/zk-compression-cli",
196
179
  "pluginType": "core",
197
180
  "strict": true,
198
- "summary": "Create a new compressed token mint",
181
+ "summary": "Compress SPL tokens.",
199
182
  "enableJsonFlag": false,
200
183
  "isESM": false,
201
184
  "relativePath": [
202
185
  "dist",
203
186
  "commands",
204
- "create-mint",
187
+ "compress-spl",
205
188
  "index.js"
206
189
  ]
207
190
  },
208
- "balance": {
191
+ "create-mint": {
209
192
  "aliases": [],
210
193
  "args": {},
211
194
  "examples": [
212
- "$ light balance --mint=<ADDRESS> --owner=<ADDRESS>"
195
+ "$ light create-mint --mint-decimals 5"
213
196
  ],
214
197
  "flags": {
215
- "owner": {
216
- "description": "Address of the compressed token owner.",
217
- "name": "owner",
218
- "required": true,
198
+ "mint-keypair": {
199
+ "description": "Provide a path to a mint keypair file. Defaults to a random keypair",
200
+ "name": "mint-keypair",
201
+ "required": false,
219
202
  "hasDynamicHelp": false,
220
203
  "multiple": false,
221
204
  "type": "option"
222
205
  },
223
- "mint": {
224
- "description": "Mint address of the compressed token account.",
225
- "name": "mint",
226
- "required": true,
206
+ "mint-authority": {
207
+ "description": "Address of the mint authority. Defaults to the fee payer",
208
+ "name": "mint-authority",
209
+ "required": false,
210
+ "hasDynamicHelp": false,
211
+ "multiple": false,
212
+ "type": "option"
213
+ },
214
+ "mint-decimals": {
215
+ "description": "Number of base 10 digits to the right of the decimal place [default: 9]",
216
+ "name": "mint-decimals",
217
+ "required": false,
218
+ "default": 9,
227
219
  "hasDynamicHelp": false,
228
220
  "multiple": false,
229
221
  "type": "option"
@@ -231,18 +223,18 @@
231
223
  },
232
224
  "hasDynamicHelp": false,
233
225
  "hiddenAliases": [],
234
- "id": "balance",
226
+ "id": "create-mint",
235
227
  "pluginAlias": "@lightprotocol/zk-compression-cli",
236
228
  "pluginName": "@lightprotocol/zk-compression-cli",
237
229
  "pluginType": "core",
238
230
  "strict": true,
239
- "summary": "Get balance",
231
+ "summary": "Create a new compressed token mint",
240
232
  "enableJsonFlag": false,
241
233
  "isESM": false,
242
234
  "relativePath": [
243
235
  "dist",
244
236
  "commands",
245
- "balance",
237
+ "create-mint",
246
238
  "index.js"
247
239
  ]
248
240
  },
@@ -279,109 +271,117 @@
279
271
  "index.js"
280
272
  ]
281
273
  },
282
- "approve-and-mint-to": {
274
+ "config:config": {
283
275
  "aliases": [],
284
276
  "args": {},
277
+ "description": "Initialize or update the configuration values. The default config path is ~/.config/light/config.json you can set up a custom path with an environment variable export LIGHT_PROTOCOL_CONFIG=path/to/config.json",
285
278
  "examples": [
286
- "$ light approve-and-mint-to --mint PublicKey --to PublicKey --amount 1000"
279
+ "$ light config --solanaRpcUrl https://solana-api.example.com"
287
280
  ],
288
281
  "flags": {
289
- "mint-authority": {
290
- "description": "Specify the filepath of the mint authority keypair. Defaults to your local solana wallet.",
291
- "name": "mint-authority",
292
- "required": false,
282
+ "solanaRpcUrl": {
283
+ "description": "Solana RPC url",
284
+ "name": "solanaRpcUrl",
293
285
  "hasDynamicHelp": false,
294
286
  "multiple": false,
295
287
  "type": "option"
296
288
  },
297
- "mint": {
298
- "description": "Specify the mint address.",
299
- "name": "mint",
300
- "required": true,
289
+ "indexerUrl": {
290
+ "description": "Indexer url",
291
+ "name": "indexerUrl",
301
292
  "hasDynamicHelp": false,
302
293
  "multiple": false,
303
294
  "type": "option"
304
295
  },
305
- "to": {
306
- "description": "Specify the recipient address.",
307
- "name": "to",
308
- "required": true,
296
+ "proverUrl": {
297
+ "description": "Prover url",
298
+ "name": "proverUrl",
309
299
  "hasDynamicHelp": false,
310
300
  "multiple": false,
311
301
  "type": "option"
312
302
  },
313
- "amount": {
314
- "description": "Amount to mint, in tokens.",
315
- "name": "amount",
316
- "required": true,
317
- "hasDynamicHelp": false,
318
- "multiple": false,
319
- "type": "option"
303
+ "get": {
304
+ "description": "Gets the current config values",
305
+ "name": "get",
306
+ "required": false,
307
+ "allowNo": false,
308
+ "type": "boolean"
320
309
  }
321
310
  },
322
311
  "hasDynamicHelp": false,
323
312
  "hiddenAliases": [],
324
- "id": "approve-and-mint-to",
313
+ "id": "config:config",
325
314
  "pluginAlias": "@lightprotocol/zk-compression-cli",
326
315
  "pluginName": "@lightprotocol/zk-compression-cli",
327
316
  "pluginType": "core",
328
317
  "strict": true,
329
- "summary": "Mint tokens to a compressed account via external mint authority",
330
318
  "enableJsonFlag": false,
331
319
  "isESM": false,
332
320
  "relativePath": [
333
321
  "dist",
334
322
  "commands",
335
- "approve-and-mint-to",
323
+ "config",
336
324
  "index.js"
337
325
  ]
338
326
  },
339
- "decompress-sol": {
327
+ "config": {
340
328
  "aliases": [],
341
329
  "args": {},
330
+ "description": "Initialize or update the configuration values. The default config path is ~/.config/light/config.json you can set up a custom path with an environment variable export LIGHT_PROTOCOL_CONFIG=path/to/config.json",
342
331
  "examples": [
343
- "$ light decompress-sol --to PublicKey --amount 10"
332
+ "$ light config --solanaRpcUrl https://solana-api.example.com"
344
333
  ],
345
334
  "flags": {
346
- "to": {
347
- "description": "Specify the recipient address.",
348
- "name": "to",
349
- "required": true,
335
+ "solanaRpcUrl": {
336
+ "description": "Solana RPC url",
337
+ "name": "solanaRpcUrl",
350
338
  "hasDynamicHelp": false,
351
339
  "multiple": false,
352
340
  "type": "option"
353
341
  },
354
- "amount": {
355
- "description": "Amount to decompress, in lamports.",
356
- "name": "amount",
357
- "required": true,
342
+ "indexerUrl": {
343
+ "description": "Indexer url",
344
+ "name": "indexerUrl",
345
+ "hasDynamicHelp": false,
346
+ "multiple": false,
347
+ "type": "option"
348
+ },
349
+ "proverUrl": {
350
+ "description": "Prover url",
351
+ "name": "proverUrl",
358
352
  "hasDynamicHelp": false,
359
353
  "multiple": false,
360
354
  "type": "option"
355
+ },
356
+ "get": {
357
+ "description": "Gets the current config values",
358
+ "name": "get",
359
+ "required": false,
360
+ "allowNo": false,
361
+ "type": "boolean"
361
362
  }
362
363
  },
363
364
  "hasDynamicHelp": false,
364
365
  "hiddenAliases": [],
365
- "id": "decompress-sol",
366
+ "id": "config",
366
367
  "pluginAlias": "@lightprotocol/zk-compression-cli",
367
368
  "pluginName": "@lightprotocol/zk-compression-cli",
368
369
  "pluginType": "core",
369
370
  "strict": true,
370
- "summary": "Decompress SOL.",
371
371
  "enableJsonFlag": false,
372
372
  "isESM": false,
373
373
  "relativePath": [
374
374
  "dist",
375
375
  "commands",
376
- "decompress-sol",
376
+ "config",
377
377
  "index.js"
378
378
  ]
379
379
  },
380
- "compress-sol": {
380
+ "decompress-sol": {
381
381
  "aliases": [],
382
382
  "args": {},
383
383
  "examples": [
384
- "$ light compress-sol --to PublicKey --amount 10"
384
+ "$ light decompress-sol --to PublicKey --amount 10"
385
385
  ],
386
386
  "flags": {
387
387
  "to": {
@@ -393,7 +393,7 @@
393
393
  "type": "option"
394
394
  },
395
395
  "amount": {
396
- "description": "Amount to compress, in lamports.",
396
+ "description": "Amount to decompress, in lamports.",
397
397
  "name": "amount",
398
398
  "required": true,
399
399
  "hasDynamicHelp": false,
@@ -403,18 +403,18 @@
403
403
  },
404
404
  "hasDynamicHelp": false,
405
405
  "hiddenAliases": [],
406
- "id": "compress-sol",
406
+ "id": "decompress-sol",
407
407
  "pluginAlias": "@lightprotocol/zk-compression-cli",
408
408
  "pluginName": "@lightprotocol/zk-compression-cli",
409
409
  "pluginType": "core",
410
410
  "strict": true,
411
- "summary": "Compress SOL.",
411
+ "summary": "Decompress SOL.",
412
412
  "enableJsonFlag": false,
413
413
  "isESM": false,
414
414
  "relativePath": [
415
415
  "dist",
416
416
  "commands",
417
- "compress-sol",
417
+ "decompress-sol",
418
418
  "index.js"
419
419
  ]
420
420
  },
@@ -831,5 +831,5 @@
831
831
  ]
832
832
  }
833
833
  },
834
- "version": "0.18.1"
834
+ "version": "0.19.0"
835
835
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightprotocol/zk-compression-cli",
3
- "version": "0.18.1",
3
+ "version": "0.19.0",
4
4
  "description": "ZK Compression: Secure Scaling on Solana",
5
5
  "maintainers": [
6
6
  {
@@ -31,6 +31,7 @@
31
31
  "@oclif/plugin-plugins": "^5.0.7",
32
32
  "@solana-developers/helpers": "^1.5.1",
33
33
  "@solana/web3.js": "^1.95.3",
34
+ "@types/shell-quote": "^1.7.5",
34
35
  "axios": "^1.6.8",
35
36
  "case-anything": "^2.1.13",
36
37
  "cli-progress": "^3.12.0",
@@ -44,9 +45,9 @@
44
45
  "tweetnacl": "^1.0.3",
45
46
  "wait-on": "^7.2.0",
46
47
  "which": "^4.0.0",
47
- "@lightprotocol/compressed-token": "0.13.0",
48
- "@lightprotocol/stateless.js": "0.13.0",
49
- "@lightprotocol/hasher.rs": "0.2.0"
48
+ "@lightprotocol/compressed-token": "0.14.0",
49
+ "@lightprotocol/hasher.rs": "0.2.0",
50
+ "@lightprotocol/stateless.js": "0.14.1"
50
51
  },
51
52
  "devDependencies": {
52
53
  "@oclif/test": "2.3.9",