@lightprotocol/zk-compression-cli 0.10.0 → 0.15.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.
- package/README.md +6 -6
- package/bin/account_compression.so +0 -0
- package/bin/{forester → cargo-generate} +0 -0
- package/bin/light_compressed_token.so +0 -0
- package/bin/light_registry.so +0 -0
- package/bin/light_system_program.so +0 -0
- package/bin/prover-darwin-arm64 +0 -0
- package/bin/prover-darwin-x64 +0 -0
- package/bin/prover-linux-arm64 +0 -0
- package/bin/prover-linux-x64 +0 -0
- package/bin/prover-windows-arm64.exe +0 -0
- package/bin/prover-windows-x64.exe +0 -0
- package/bin/proving-keys/combined_26_1_1.key +0 -0
- package/bin/proving-keys/combined_26_1_1.vkey +1 -1
- package/bin/proving-keys/combined_26_1_2.key +0 -0
- package/bin/proving-keys/combined_26_1_2.vkey +1 -1
- package/bin/proving-keys/combined_26_2_1.key +0 -0
- package/bin/proving-keys/combined_26_2_1.vkey +1 -1
- package/bin/proving-keys/combined_26_2_2.key +0 -0
- package/bin/proving-keys/combined_26_2_2.vkey +1 -1
- package/bin/proving-keys/combined_26_3_1.key +0 -0
- package/bin/proving-keys/combined_26_3_1.vkey +1 -1
- package/bin/proving-keys/combined_26_3_2.key +0 -0
- package/bin/proving-keys/combined_26_3_2.vkey +1 -1
- package/bin/proving-keys/combined_26_4_1.key +0 -0
- package/bin/proving-keys/combined_26_4_1.vkey +1 -1
- package/bin/proving-keys/combined_26_4_2.key +0 -0
- package/bin/proving-keys/combined_26_4_2.vkey +1 -1
- package/bin/proving-keys/inclusion_26_1.key +0 -0
- package/bin/proving-keys/inclusion_26_1.vkey +1 -1
- package/bin/proving-keys/inclusion_26_2.key +0 -0
- package/bin/proving-keys/inclusion_26_2.vkey +1 -1
- package/bin/proving-keys/inclusion_26_3.key +0 -0
- package/bin/proving-keys/inclusion_26_3.vkey +1 -1
- package/bin/proving-keys/inclusion_26_4.key +0 -0
- package/bin/proving-keys/inclusion_26_4.vkey +1 -1
- package/bin/proving-keys/inclusion_26_8.key +0 -0
- package/bin/proving-keys/inclusion_26_8.vkey +1 -1
- package/bin/proving-keys/non-inclusion_26_1.key +0 -0
- package/bin/proving-keys/non-inclusion_26_1.vkey +1 -1
- package/bin/proving-keys/non-inclusion_26_2.key +0 -0
- package/bin/proving-keys/non-inclusion_26_2.vkey +1 -1
- package/dist/commands/{register-mint → create-token-pool}/index.js +4 -4
- package/dist/commands/init/index.d.ts +26 -0
- package/dist/commands/init/index.js +180 -0
- package/dist/commands/merge-token-accounts/index.d.ts +11 -0
- package/dist/commands/merge-token-accounts/index.js +41 -0
- package/dist/commands/test-validator/index.d.ts +1 -1
- package/dist/commands/test-validator/index.js +29 -20
- package/dist/utils/constants.d.ts +20 -7
- package/dist/utils/constants.js +21 -8
- package/dist/utils/initTestEnv.d.ts +8 -4
- package/dist/utils/initTestEnv.js +31 -8
- package/dist/utils/process.d.ts +1 -1
- package/dist/utils/process.js +26 -13
- package/dist/utils/processPhotonIndexer.d.ts +1 -0
- package/dist/utils/processPhotonIndexer.js +1 -0
- package/dist/utils/processProverServer.d.ts +1 -0
- package/dist/utils/processProverServer.js +6 -1
- package/oclif.manifest.json +242 -173
- package/package.json +9 -9
- package/bin/forester.toml +0 -8
- package/dist/utils/processForester.d.ts +0 -3
- package/dist/utils/processForester.js +0 -24
- /package/dist/commands/{register-mint → create-token-pool}/index.d.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
[
|
|
1
|
+
[42 175 167 170 106 79 89 23 163 201 208 224 240 31 127 123 79 158 6 131 203 166 103 145 185 161 249 178 83 236 241 103 45 250 73 207 221 22 43 76 144 204 230 63 48 21 253 77 127 158 118 4 183 114 135 197 20 203 25 127 183 207 208 204 31 157 198 178 141 80 188 117 251 57 192 171 164 31 230 128 136 251 19 181 42 76 192 126 254 90 0 225 77 112 214 196 22 191 255 116 67 115 165 98 116 172 111 205 9 13 189 64 159 43 46 14 76 35 212 157 38 92 177 152 227 79 202 11 23 213 194 106 33 93 252 10 30 225 191 247 194 79 66 237 0 112 60 94 47 10 161 127 213 112 51 209 201 9 171 160 23 180 144 2 245 73 165 131 199 13 184 186 180 24 41 238 219 118 169 25 89 225 131 252 207 243 75 241 72 179 45 179 34 129 180 149 50 69 215 203 231 18 225 122 209 53 202 218 22 167 254 24 182 63 173 47 231 163 61 26 202 191 19 188 11 226 146 163 107 104 217 138 196 160 202 61 220 206 14 38 38 48 212 91 85 29 7 35 136 186 187 242 72 202 89 69 18 105 145 176 242 190 135 140 233 52 41 82 170 191 45 199 70 133 208 62 141 232 152 10 28 95 194 106 242 150 142 161 36 71 159 45 31 96 113 247 227 79 254 47 125 210 150 50 190 91 23 173 37 38 15 90 127 127 129 105 22 64 62 155 26 156 156 40 227 156 208 218 193 220 42 1 28 110 96 220 43 48 36 199 72 224 24 112 64 117 89 247 13 38 247 166 28 246 147 251 70 18 238 205 208 147 180 112 12 59 5 88 140 235 119 178 143 249 113 173 81 48 143 110 96 97 222 236 14 208 132 57 75 222 108 1 65 94 36 136 63 107 92 159 100 129 129 162 112 160 220 166 64 43 254 200 229 5 202 199 22 151 224 217 231 231 96 189 150 210 8 181 229 178 88 145 76 108 142 37 44 116 7 149 82 196 65 27 54 189 137 37 6 70 227 177 17 43 23 229 252 150 226 56 82 98 130 113 169 244 193 145 78 251 200 106 139 13 85 50 204 214 188 30 33 133 58 61 219 6 207 197 229 124 225 138 144 224 135 2 174 139 214 56 96 183 228 154 137 17 163 216 212 199 29 49 32 73 235 151 143 154 127 71 163 214 69 53 72 235 88 166 12 196 147 22 17 236 144 187 72 45 29 24 114 144 147 252 5 168 220 68 215 193 32 118 114 142 217 3 151 216 119 135 90 69 177 215 176 55 245 38 241 97 18 193 11 55 138 96 0 0 0 3 26 115 63 54 36 4 8 60 3 27 136 163 230 185 88 89 172 246 226 154 234 17 132 22 56 52 141 35 69 174 145 76 11 127 202 130 163 97 227 180 16 149 218 2 156 24 83 225 252 246 161 244 129 95 143 152 144 228 131 29 155 55 113 74 24 178 143 230 40 24 59 47 201 127 37 249 50 12 121 61 236 60 30 3 195 178 158 73 88 178 157 214 31 59 172 213 18 143 11 105 102 115 186 128 181 230 152 32 133 27 195 65 106 138 22 128 236 9 141 80 22 175 146 166 20 148 152 157 38 182 177 20 136 171 239 159 8 164 145 140 254 181 125 190 229 204 47 47 109 43 43 121 156 122 160 254 129 8 21 116 4 82 72 155 94 126 41 153 147 14 145 129 87 75 89 202 13 68 98 219 184 192 58 183 252 212 92 33 152 135 96 153]
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[
|
|
1
|
+
[38 43 35 139 97 142 190 63 118 176 225 37 108 0 250 22 8 40 128 135 173 38 30 119 246 72 34 157 236 73 94 247 12 213 215 60 5 41 13 100 75 190 11 47 26 158 218 85 141 125 215 49 70 222 204 182 121 70 146 24 75 139 76 148 5 34 7 42 43 121 51 189 116 90 155 252 187 161 74 197 104 5 157 27 33 0 42 64 32 247 235 17 100 201 168 104 4 72 28 200 210 241 162 222 171 177 240 37 35 47 189 236 163 176 183 161 228 180 218 6 129 19 37 173 29 221 235 249 30 176 77 141 252 63 43 80 249 211 249 67 99 82 164 200 84 253 121 162 6 56 128 96 58 81 70 112 242 135 225 88 30 154 192 249 73 127 64 173 97 13 49 27 223 134 6 171 50 110 12 232 184 163 147 28 114 24 116 158 251 137 41 160 42 249 151 234 43 32 21 34 149 182 202 69 37 62 129 73 3 46 255 69 56 153 213 158 88 90 246 199 165 4 143 52 46 109 43 159 188 158 96 241 223 61 251 213 69 197 156 238 231 163 246 201 240 43 144 109 157 146 111 139 147 95 143 94 36 82 226 179 4 218 208 92 83 231 239 236 71 105 80 157 205 68 120 163 8 34 212 253 245 130 157 170 156 183 156 66 33 67 253 17 67 162 141 173 163 57 3 14 221 10 115 193 201 252 90 142 182 239 49 220 70 129 150 183 225 171 153 111 16 49 13 197 144 37 46 162 22 82 26 115 3 208 57 153 238 170 241 71 204 189 56 179 214 15 159 116 206 235 212 217 21 129 55 25 16 165 244 121 4 7 7 47 185 203 190 7 4 224 153 206 195 76 114 9 13 128 112 13 101 105 215 38 28 94 247 163 203 33 112 160 215 4 124 21 114 255 91 57 44 45 88 40 67 71 81 124 25 227 22 91 128 154 86 76 42 196 5 241 181 205 202 103 125 240 246 160 181 229 57 9 77 160 11 203 95 69 31 81 29 189 178 53 171 112 0 150 35 182 210 162 219 244 68 167 255 77 84 59 145 243 53 226 10 212 173 81 81 101 44 235 233 225 76 187 251 51 98 32 10 74 150 140 136 47 23 47 158 80 193 233 162 251 112 212 218 229 198 43 20 129 28 42 117 32 248 222 162 243 19 49 42 125 165 133 244 7 2 78 250 224 244 103 255 15 249 71 148 152 105 204 178 202 18 93 191 236 170 157 28 153 245 193 2 32 41 75 92 188 202 31 115 34 99 170 16 149 57 231 95 132 158 240 233 3 34 103 125 55 137 243 232 48 216 27 0 0 0 5 28 253 97 199 58 192 26 119 149 72 250 49 130 196 83 230 6 91 129 196 246 19 214 59 152 132 177 92 181 202 195 197 31 41 99 150 59 185 78 191 174 42 127 179 36 206 40 86 123 38 202 224 95 218 85 254 114 62 249 14 3 8 194 210 23 231 148 82 211 227 176 105 103 176 66 13 252 9 194 146 132 157 8 55 238 44 66 16 184 188 49 145 244 249 106 76 7 243 214 20 144 132 39 93 110 110 176 9 140 185 178 249 149 170 114 104 153 136 165 41 137 137 166 146 158 80 63 2 11 53 153 214 13 80 148 135 177 249 109 27 118 116 125 175 144 242 67 195 73 73 31 237 196 34 137 102 209 201 68 25 15 215 219 3 129 86 51 109 131 197 217 126 126 11 4 23 161 166 198 160 18 21 74 114 211 190 149 102 212 100 48 196 33 126 116 163 124 233 161 76 129 14 59 136 50 165 72 43 141 114 81 234 83 129 66 208 96 31 201 9 57 224 8 186 2 85 129 99 138 204 24 80 106 70 161 134 30 16 21 119 247 97 113 32 253 88 206 21 7 240 44 253 227 100 71 31 17 5 221 187 19 32 149 84 89 196 144 229 240 218 40 152 230 54 161 79 143 153 240 103 8 155 221 101 204 216 98 140 43 203 108 186 239 170 165 185 68 17 145 127 176 232 29 140 95 176 243 241 75 130 63 175 145 150 236 80 243 33 74 150]
|
|
@@ -7,7 +7,7 @@ const compressed_token_1 = require("@lightprotocol/compressed-token");
|
|
|
7
7
|
class RegisterMintCommand extends core_1.Command {
|
|
8
8
|
async run() {
|
|
9
9
|
const { flags } = await this.parse(RegisterMintCommand);
|
|
10
|
-
const loader = new utils_1.CustomLoader(`Performing
|
|
10
|
+
const loader = new utils_1.CustomLoader(`Performing create-token-pool...\n`);
|
|
11
11
|
loader.start();
|
|
12
12
|
try {
|
|
13
13
|
const payer = (0, utils_1.defaultSolanaWalletKeypair)();
|
|
@@ -16,15 +16,15 @@ class RegisterMintCommand extends core_1.Command {
|
|
|
16
16
|
loader.stop(false);
|
|
17
17
|
console.log("\x1b[1mMint public key:\x1b[0m ", mintAddress.toBase58());
|
|
18
18
|
console.log("\x1b[1mMint tx:\x1b[0m ", (0, utils_1.generateSolanaTransactionURL)("tx", txId, "custom"));
|
|
19
|
-
console.log("
|
|
19
|
+
console.log("create-token-pool successful");
|
|
20
20
|
}
|
|
21
21
|
catch (error) {
|
|
22
|
-
this.error(`Failed to
|
|
22
|
+
this.error(`Failed to create-token-pool!\n${error}`);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
RegisterMintCommand.summary = "Register an existing mint with the CompressedToken program";
|
|
27
|
-
RegisterMintCommand.examples = ["$ light
|
|
27
|
+
RegisterMintCommand.examples = ["$ light create-token-pool --mint-decimals 5"];
|
|
28
28
|
RegisterMintCommand.flags = {
|
|
29
29
|
mint: core_1.Flags.string({
|
|
30
30
|
description: "Provide a base58 encoded mint address to register",
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Command } from "@oclif/core";
|
|
2
|
+
export default class InitCommand extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static args: {
|
|
5
|
+
name: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
6
|
+
};
|
|
7
|
+
run(): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
export declare const initRepo: (name: string, flags: any) => Promise<void>;
|
|
10
|
+
export declare const initFlags: {
|
|
11
|
+
path: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
git: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
|
+
tag: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
14
|
+
branch: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
15
|
+
};
|
|
16
|
+
export declare function downloadCargoGenerateIfNotExists({ localFilePath, dirPath, }: {
|
|
17
|
+
localFilePath: string;
|
|
18
|
+
dirPath: string;
|
|
19
|
+
}): Promise<void>;
|
|
20
|
+
export declare enum System {
|
|
21
|
+
MacOsAmd64 = 0,
|
|
22
|
+
MacOsArm64 = 1,
|
|
23
|
+
LinuxAmd64 = 2,
|
|
24
|
+
LinuxArm64 = 3
|
|
25
|
+
}
|
|
26
|
+
export declare function getSystem(): System;
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.System = exports.initFlags = exports.initRepo = void 0;
|
|
4
|
+
exports.downloadCargoGenerateIfNotExists = downloadCargoGenerateIfNotExists;
|
|
5
|
+
exports.getSystem = getSystem;
|
|
6
|
+
const tslib_1 = require("tslib");
|
|
7
|
+
const stateless_js_1 = require("@lightprotocol/stateless.js");
|
|
8
|
+
const core_1 = require("@oclif/core");
|
|
9
|
+
const process_1 = require("../../utils/process");
|
|
10
|
+
const psp_utils_1 = require("../../psp-utils");
|
|
11
|
+
const constants_1 = require("../../utils/constants");
|
|
12
|
+
const utils_1 = require("../../utils");
|
|
13
|
+
const case_anything_1 = require("case-anything");
|
|
14
|
+
class InitCommand extends core_1.Command {
|
|
15
|
+
async run() {
|
|
16
|
+
const { args, flags } = await this.parse(InitCommand);
|
|
17
|
+
const { name } = args;
|
|
18
|
+
this.log("Initializing project...");
|
|
19
|
+
await (0, exports.initRepo)(name, flags);
|
|
20
|
+
this.log("✅ Project initialized successfully");
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
InitCommand.description = "Initialize a compressed account project.";
|
|
24
|
+
InitCommand.args = {
|
|
25
|
+
name: core_1.Args.string({
|
|
26
|
+
name: "NAME",
|
|
27
|
+
description: "The name of the project",
|
|
28
|
+
required: true,
|
|
29
|
+
}),
|
|
30
|
+
};
|
|
31
|
+
exports.default = InitCommand;
|
|
32
|
+
const initRepo = async (name, flags) => {
|
|
33
|
+
const localFilePath = (0, utils_1.programFilePath)("cargo-generate");
|
|
34
|
+
const dirPath = (0, utils_1.programsDirPath)();
|
|
35
|
+
await downloadCargoGenerateIfNotExists({
|
|
36
|
+
localFilePath,
|
|
37
|
+
dirPath,
|
|
38
|
+
});
|
|
39
|
+
const kebabCaseName = (0, case_anything_1.kebabCase)(name);
|
|
40
|
+
const snakeCaseName = (0, case_anything_1.snakeCase)(name);
|
|
41
|
+
const camelCaseName = (0, case_anything_1.pascalCase)(name);
|
|
42
|
+
await (0, process_1.executeCommand)({
|
|
43
|
+
command: localFilePath,
|
|
44
|
+
args: [
|
|
45
|
+
"generate",
|
|
46
|
+
"--name",
|
|
47
|
+
kebabCaseName,
|
|
48
|
+
"--git",
|
|
49
|
+
"https://github.com/Lightprotocol/compressed-program-template",
|
|
50
|
+
"--tag",
|
|
51
|
+
constants_1.COMPRESSED_PROGRAM_TEMPLATE_TAG,
|
|
52
|
+
"--define",
|
|
53
|
+
`rust-name=${kebabCaseName}`,
|
|
54
|
+
"--define",
|
|
55
|
+
`rust-name-snake-case=${snakeCaseName}`,
|
|
56
|
+
"--define",
|
|
57
|
+
`rust-name-camel-case=${camelCaseName}`,
|
|
58
|
+
"--define",
|
|
59
|
+
`program-id=${constants_1.PROGRAM_ID}`,
|
|
60
|
+
"--define",
|
|
61
|
+
`anchor-version=${constants_1.ANCHOR_VERSION}`,
|
|
62
|
+
"--define",
|
|
63
|
+
`borsh-version=${constants_1.BORSH_VERSION}`,
|
|
64
|
+
"--define",
|
|
65
|
+
`light-hasher-version=${constants_1.LIGHT_HASHER_VERSION}`,
|
|
66
|
+
"--define",
|
|
67
|
+
`light-macros-version=${constants_1.LIGHT_MACROS_VERSION}`,
|
|
68
|
+
"--define",
|
|
69
|
+
`light-sdk-version=${constants_1.LIGHT_SDK_VERSION}`,
|
|
70
|
+
"--define",
|
|
71
|
+
`light-sdk-macros-version=${constants_1.LIGHT_SDK_MACROS_VERSION}`,
|
|
72
|
+
"--define",
|
|
73
|
+
`light-utils-version=${constants_1.LIGHT_UTILS_VERSION}`,
|
|
74
|
+
"--define",
|
|
75
|
+
`light-verifier-version=${constants_1.LIGHT_VERIFIER_VERSION}`,
|
|
76
|
+
"--define",
|
|
77
|
+
`solana-sdk-version=${constants_1.SOLANA_SDK_VERSION}`,
|
|
78
|
+
"--define",
|
|
79
|
+
`light-client-version=${constants_1.LIGHT_CLIENT_VERSION}`,
|
|
80
|
+
"--define",
|
|
81
|
+
`light-test-utils-version=${constants_1.LIGHT_TEST_UTILS_VERSION}`,
|
|
82
|
+
"--define",
|
|
83
|
+
`solana-program-test-version=${constants_1.SOLANA_PROGRAM_TEST_VERSION}`,
|
|
84
|
+
"--define",
|
|
85
|
+
`tokio-version=${constants_1.TOKIO_VERSION}`,
|
|
86
|
+
],
|
|
87
|
+
logFile: true,
|
|
88
|
+
});
|
|
89
|
+
await (0, stateless_js_1.sleep)(1000);
|
|
90
|
+
};
|
|
91
|
+
exports.initRepo = initRepo;
|
|
92
|
+
exports.initFlags = {
|
|
93
|
+
path: core_1.Flags.string({
|
|
94
|
+
aliases: ["p"],
|
|
95
|
+
description: "Path of the template repo.",
|
|
96
|
+
required: false,
|
|
97
|
+
}),
|
|
98
|
+
git: core_1.Flags.string({
|
|
99
|
+
aliases: ["g"],
|
|
100
|
+
description: "Github url of the template repo",
|
|
101
|
+
default: "https://github.com/Lightprotocol/psp-template",
|
|
102
|
+
required: false,
|
|
103
|
+
}),
|
|
104
|
+
tag: core_1.Flags.string({
|
|
105
|
+
aliases: ["t"],
|
|
106
|
+
description: "Tag must be used in conjuction with --git",
|
|
107
|
+
required: false,
|
|
108
|
+
}),
|
|
109
|
+
branch: core_1.Flags.string({
|
|
110
|
+
aliases: ["b"],
|
|
111
|
+
description: "Branch must be used in conjuction with --git",
|
|
112
|
+
default: "main",
|
|
113
|
+
required: false,
|
|
114
|
+
}),
|
|
115
|
+
};
|
|
116
|
+
async function downloadCargoGenerateIfNotExists({ localFilePath, dirPath, }) {
|
|
117
|
+
let remoteFileName;
|
|
118
|
+
const tag = utils_1.CARGO_GENERATE_TAG;
|
|
119
|
+
switch (getSystem()) {
|
|
120
|
+
case System.LinuxAmd64:
|
|
121
|
+
remoteFileName = `cargo-generate-${tag}-x86_64-unknown-linux-musl.tar.gz`;
|
|
122
|
+
break;
|
|
123
|
+
case System.LinuxArm64:
|
|
124
|
+
remoteFileName = `cargo-generate-${tag}-aarch64-unknown-linux-musl.tar.gz`;
|
|
125
|
+
break;
|
|
126
|
+
case System.MacOsAmd64:
|
|
127
|
+
remoteFileName = `cargo-generate-${tag}-x86_64-apple-darwin.tar.gz`;
|
|
128
|
+
break;
|
|
129
|
+
case System.MacOsArm64:
|
|
130
|
+
remoteFileName = `cargo-generate-${tag}-aarch64-apple-darwin.tar.gz`;
|
|
131
|
+
break;
|
|
132
|
+
default:
|
|
133
|
+
throw new Error(`Unsupported system: ${getSystem()}`);
|
|
134
|
+
}
|
|
135
|
+
await (0, psp_utils_1.downloadBinIfNotExists)({
|
|
136
|
+
localFilePath,
|
|
137
|
+
dirPath,
|
|
138
|
+
owner: "cargo-generate",
|
|
139
|
+
repoName: "cargo-generate",
|
|
140
|
+
remoteFileName,
|
|
141
|
+
tag,
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
var System;
|
|
145
|
+
(function (System) {
|
|
146
|
+
System[System["MacOsAmd64"] = 0] = "MacOsAmd64";
|
|
147
|
+
System[System["MacOsArm64"] = 1] = "MacOsArm64";
|
|
148
|
+
System[System["LinuxAmd64"] = 2] = "LinuxAmd64";
|
|
149
|
+
System[System["LinuxArm64"] = 3] = "LinuxArm64";
|
|
150
|
+
})(System || (exports.System = System = {}));
|
|
151
|
+
const os = tslib_1.__importStar(require("os"));
|
|
152
|
+
function getSystem() {
|
|
153
|
+
const arch = os.arch();
|
|
154
|
+
const platform = os.platform();
|
|
155
|
+
switch (platform) {
|
|
156
|
+
case "darwin":
|
|
157
|
+
switch (arch) {
|
|
158
|
+
case "x64":
|
|
159
|
+
return System.MacOsAmd64;
|
|
160
|
+
case "arm":
|
|
161
|
+
// fallthrough
|
|
162
|
+
case "arm64":
|
|
163
|
+
return System.MacOsArm64;
|
|
164
|
+
default:
|
|
165
|
+
throw new stateless_js_1.UtilsError(stateless_js_1.UtilsErrorCode.UNSUPPORTED_ARCHITECTURE, "getSystem", `Architecture ${arch} is not supported.`);
|
|
166
|
+
}
|
|
167
|
+
case "linux":
|
|
168
|
+
switch (arch) {
|
|
169
|
+
case "x64":
|
|
170
|
+
return System.LinuxAmd64;
|
|
171
|
+
case "arm":
|
|
172
|
+
// fallthrough
|
|
173
|
+
case "arm64":
|
|
174
|
+
return System.LinuxArm64;
|
|
175
|
+
default:
|
|
176
|
+
throw new stateless_js_1.UtilsError(stateless_js_1.UtilsErrorCode.UNSUPPORTED_ARCHITECTURE, "getSystem", `Architecture ${arch} is not supported.`);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
throw new stateless_js_1.UtilsError(stateless_js_1.UtilsErrorCode.UNSUPPORTED_PLATFORM, "getSystem", `Platform ${platform} is not supported.`);
|
|
180
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Command } from "@oclif/core";
|
|
2
|
+
declare class MergeTokenAccountsCommand extends Command {
|
|
3
|
+
static summary: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
mint: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
7
|
+
"fee-payer": import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
|
+
};
|
|
9
|
+
run(): Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
export default MergeTokenAccountsCommand;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const utils_1 = require("../../utils/utils");
|
|
5
|
+
const compressed_token_1 = require("@lightprotocol/compressed-token");
|
|
6
|
+
const web3_js_1 = require("@solana/web3.js");
|
|
7
|
+
const helpers_1 = require("@solana-developers/helpers");
|
|
8
|
+
class MergeTokenAccountsCommand extends core_1.Command {
|
|
9
|
+
async run() {
|
|
10
|
+
const { flags } = await this.parse(MergeTokenAccountsCommand);
|
|
11
|
+
const loader = new utils_1.CustomLoader(`Merging token accounts...\n`);
|
|
12
|
+
loader.start();
|
|
13
|
+
try {
|
|
14
|
+
const mint = new web3_js_1.PublicKey(flags.mint);
|
|
15
|
+
let payer = (0, utils_1.defaultSolanaWalletKeypair)();
|
|
16
|
+
if (flags["fee-payer"]) {
|
|
17
|
+
payer = await (0, helpers_1.getKeypairFromFile)(flags["fee-payer"]);
|
|
18
|
+
}
|
|
19
|
+
const txId = await (0, compressed_token_1.mergeTokenAccounts)((0, utils_1.rpc)(), payer, mint, payer);
|
|
20
|
+
loader.stop(false);
|
|
21
|
+
console.log(`\x1b[1mMerge tx:\x1b[0m `, (0, utils_1.generateSolanaTransactionURL)("tx", txId, "custom"));
|
|
22
|
+
console.log("Token accounts merged successfully");
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
this.error(`Failed to merge token accounts!\n${error}`);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
MergeTokenAccountsCommand.summary = "Merge all token accounts for a specific mint.";
|
|
30
|
+
MergeTokenAccountsCommand.examples = ["$ light merge-token-accounts --mint PublicKey"];
|
|
31
|
+
MergeTokenAccountsCommand.flags = {
|
|
32
|
+
mint: core_1.Flags.string({
|
|
33
|
+
description: "Mint to merge accounts for",
|
|
34
|
+
required: true,
|
|
35
|
+
}),
|
|
36
|
+
"fee-payer": core_1.Flags.string({
|
|
37
|
+
description: "Specify the fee-payer account. Defaults to the client keypair.",
|
|
38
|
+
required: false,
|
|
39
|
+
}),
|
|
40
|
+
};
|
|
41
|
+
exports.default = MergeTokenAccountsCommand;
|
|
@@ -5,7 +5,6 @@ declare class SetupCommand extends Command {
|
|
|
5
5
|
static flags: {
|
|
6
6
|
"skip-indexer": import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
7
7
|
"skip-prover": import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
8
|
-
"skip-forester": import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
9
8
|
"skip-system-accounts": import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
9
|
"prove-compressed-accounts": import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
10
|
"prove-new-addresses": import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
@@ -16,6 +15,7 @@ declare class SetupCommand extends Command {
|
|
|
16
15
|
"prover-port": import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
17
16
|
"limit-ledger-size": import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
18
17
|
"gossip-host": import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
18
|
+
stop: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
19
19
|
};
|
|
20
20
|
run(): Promise<void>;
|
|
21
21
|
}
|
|
@@ -11,22 +11,30 @@ class SetupCommand extends core_1.Command {
|
|
|
11
11
|
const { flags } = await this.parse(SetupCommand);
|
|
12
12
|
const loader = new index_1.CustomLoader("Performing setup tasks...\n");
|
|
13
13
|
loader.start();
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
14
|
+
if (flags["stop"] === true) {
|
|
15
|
+
await (0, initTestEnv_1.stopTestEnv)({
|
|
16
|
+
indexer: !flags["skip-indexer"],
|
|
17
|
+
prover: !flags["skip-prover"],
|
|
18
|
+
});
|
|
19
|
+
this.log("\nTest validator stopped successfully \x1b[32m✔\x1b[0m");
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
await (0, initTestEnv_1.initTestEnv)({
|
|
23
|
+
checkPhotonVersion: !flags["relax-indexer-version-constraint"],
|
|
24
|
+
indexer: !flags["skip-indexer"],
|
|
25
|
+
limitLedgerSize: flags["limit-ledger-size"],
|
|
26
|
+
photonDatabaseUrl: flags["indexer-db-url"],
|
|
27
|
+
rpcPort: flags["rpc-port"],
|
|
28
|
+
gossipHost: flags["gossip-host"],
|
|
29
|
+
indexerPort: flags["indexer-port"],
|
|
30
|
+
proverPort: flags["prover-port"],
|
|
31
|
+
proveCompressedAccounts: flags["prove-compressed-accounts"],
|
|
32
|
+
proveNewAddresses: flags["prove-new-addresses"],
|
|
33
|
+
prover: !flags["skip-prover"],
|
|
34
|
+
skipSystemAccounts: flags["skip-system-accounts"],
|
|
35
|
+
});
|
|
36
|
+
this.log("\nSetup tasks completed successfully \x1b[32m✔\x1b[0m");
|
|
37
|
+
}
|
|
30
38
|
}
|
|
31
39
|
}
|
|
32
40
|
SetupCommand.description = "Perform setup tasks";
|
|
@@ -39,10 +47,6 @@ SetupCommand.flags = {
|
|
|
39
47
|
description: "Runs a test validator without starting a new prover service.",
|
|
40
48
|
default: false,
|
|
41
49
|
}),
|
|
42
|
-
"skip-forester": core_1.Flags.boolean({
|
|
43
|
-
description: "Runs a test validator without starting a new forester service.",
|
|
44
|
-
default: false,
|
|
45
|
-
}),
|
|
46
50
|
"skip-system-accounts": core_1.Flags.boolean({
|
|
47
51
|
description: "Runs a test validator without initialized light system accounts.",
|
|
48
52
|
default: false,
|
|
@@ -94,5 +98,10 @@ SetupCommand.flags = {
|
|
|
94
98
|
required: false,
|
|
95
99
|
default: "127.0.0.1",
|
|
96
100
|
}),
|
|
101
|
+
stop: core_1.Flags.boolean({
|
|
102
|
+
description: "Stops the test validator and dependent processes. Use with --skip-indexer, --skip-prover to keep specific services running.",
|
|
103
|
+
required: false,
|
|
104
|
+
default: false,
|
|
105
|
+
}),
|
|
97
106
|
};
|
|
98
107
|
exports.default = SetupCommand;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
export declare const SPL_NOOP_PROGRAM_TAG = "spl-noop-v0.2.0";
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const LIGHT_COMPRESSED_TOKEN_TAG = "light-compressed-token-v0.3.4";
|
|
2
|
+
export declare const LIGHT_ACCOUNT_COMPRESSION_TAG = "account-compression-v1.0.0";
|
|
3
|
+
export declare const LIGHT_SYSTEM_PROGRAM_TAG = "light-system-program-v1.0.0";
|
|
4
|
+
export declare const LIGHT_REGISTRY_TAG = "light-registry-v1.0.0";
|
|
5
|
+
export declare const LIGHT_COMPRESSED_TOKEN_TAG = "light-compressed-token-v1.0.0";
|
|
7
6
|
export declare const CONFIG_PATH = "/.config/light/";
|
|
8
7
|
export declare const CONFIG_FILE_NAME = "config.json";
|
|
9
8
|
export declare const DEFAULT_CONFIG: {
|
|
@@ -13,7 +12,21 @@ export declare const CARGO_GENERATE_TAG = "v0.18.4";
|
|
|
13
12
|
export declare const SOLANA_VALIDATOR_PROCESS_NAME = "solana-test-validator";
|
|
14
13
|
export declare const LIGHT_PROVER_PROCESS_NAME = "light-prover";
|
|
15
14
|
export declare const INDEXER_PROCESS_NAME = "photon";
|
|
16
|
-
export declare const
|
|
17
|
-
export declare const PHOTON_VERSION = "0.44.0";
|
|
15
|
+
export declare const PHOTON_VERSION = "0.45.0";
|
|
18
16
|
export declare const LIGHT_PROTOCOL_PROGRAMS_DIR_ENV = "LIGHT_PROTOCOL_PROGRAMS_DIR";
|
|
19
17
|
export declare const BASE_PATH = "../../bin/";
|
|
18
|
+
export declare const PROGRAM_ID = "Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS";
|
|
19
|
+
export declare const ANCHOR_VERSION = "0.29.0";
|
|
20
|
+
export declare const BORSH_VERSION = "0.9.2";
|
|
21
|
+
export declare const LIGHT_HASHER_VERSION = "1.1.0";
|
|
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";
|
|
25
|
+
export declare const LIGHT_UTILS_VERSION = "1.1.0";
|
|
26
|
+
export declare const LIGHT_VERIFIER_VERSION = "1.1.0";
|
|
27
|
+
export declare const SOLANA_SDK_VERSION = "1.18.22";
|
|
28
|
+
export declare const LIGHT_CLIENT_VERSION = "0.9.1";
|
|
29
|
+
export declare const LIGHT_TEST_UTILS_VERSION = "1.2.1";
|
|
30
|
+
export declare const SOLANA_PROGRAM_TEST_VERSION = "1.18.22";
|
|
31
|
+
export declare const TOKIO_VERSION = "1.36.0";
|
|
32
|
+
export declare const COMPRESSED_PROGRAM_TEMPLATE_TAG = "v0.1.1";
|
package/dist/utils/constants.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.COMPRESSED_PROGRAM_TEMPLATE_TAG = exports.TOKIO_VERSION = exports.SOLANA_PROGRAM_TEST_VERSION = exports.LIGHT_TEST_UTILS_VERSION = exports.LIGHT_CLIENT_VERSION = exports.SOLANA_SDK_VERSION = exports.LIGHT_VERIFIER_VERSION = exports.LIGHT_UTILS_VERSION = exports.LIGHT_SDK_MACROS_VERSION = exports.LIGHT_SDK_VERSION = exports.LIGHT_MACROS_VERSION = exports.LIGHT_HASHER_VERSION = exports.BORSH_VERSION = exports.ANCHOR_VERSION = exports.PROGRAM_ID = exports.BASE_PATH = exports.LIGHT_PROTOCOL_PROGRAMS_DIR_ENV = exports.PHOTON_VERSION = exports.INDEXER_PROCESS_NAME = exports.LIGHT_PROVER_PROCESS_NAME = exports.SOLANA_VALIDATOR_PROCESS_NAME = exports.CARGO_GENERATE_TAG = exports.DEFAULT_CONFIG = exports.CONFIG_FILE_NAME = exports.CONFIG_PATH = exports.LIGHT_COMPRESSED_TOKEN_TAG = exports.LIGHT_REGISTRY_TAG = exports.LIGHT_SYSTEM_PROGRAM_TAG = exports.LIGHT_ACCOUNT_COMPRESSION_TAG = exports.SPL_NOOP_PROGRAM_TAG = void 0;
|
|
4
4
|
exports.SPL_NOOP_PROGRAM_TAG = "spl-noop-v0.2.0";
|
|
5
|
-
exports.
|
|
6
|
-
exports.
|
|
7
|
-
exports.
|
|
8
|
-
exports.
|
|
9
|
-
exports.LIGHT_COMPRESSED_TOKEN_TAG = "light-compressed-token-v0.3.4";
|
|
5
|
+
exports.LIGHT_ACCOUNT_COMPRESSION_TAG = "account-compression-v1.0.0";
|
|
6
|
+
exports.LIGHT_SYSTEM_PROGRAM_TAG = "light-system-program-v1.0.0";
|
|
7
|
+
exports.LIGHT_REGISTRY_TAG = "light-registry-v1.0.0";
|
|
8
|
+
exports.LIGHT_COMPRESSED_TOKEN_TAG = "light-compressed-token-v1.0.0";
|
|
10
9
|
exports.CONFIG_PATH = "/.config/light/";
|
|
11
10
|
exports.CONFIG_FILE_NAME = "config.json";
|
|
12
11
|
exports.DEFAULT_CONFIG = {
|
|
@@ -18,7 +17,21 @@ exports.CARGO_GENERATE_TAG = "v0.18.4";
|
|
|
18
17
|
exports.SOLANA_VALIDATOR_PROCESS_NAME = "solana-test-validator";
|
|
19
18
|
exports.LIGHT_PROVER_PROCESS_NAME = "light-prover";
|
|
20
19
|
exports.INDEXER_PROCESS_NAME = "photon";
|
|
21
|
-
exports.
|
|
22
|
-
exports.PHOTON_VERSION = "0.44.0";
|
|
20
|
+
exports.PHOTON_VERSION = "0.45.0";
|
|
23
21
|
exports.LIGHT_PROTOCOL_PROGRAMS_DIR_ENV = "LIGHT_PROTOCOL_PROGRAMS_DIR";
|
|
24
22
|
exports.BASE_PATH = "../../bin/";
|
|
23
|
+
exports.PROGRAM_ID = "Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS";
|
|
24
|
+
exports.ANCHOR_VERSION = "0.29.0";
|
|
25
|
+
exports.BORSH_VERSION = "0.9.2";
|
|
26
|
+
exports.LIGHT_HASHER_VERSION = "1.1.0";
|
|
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";
|
|
30
|
+
exports.LIGHT_UTILS_VERSION = "1.1.0";
|
|
31
|
+
exports.LIGHT_VERIFIER_VERSION = "1.1.0";
|
|
32
|
+
exports.SOLANA_SDK_VERSION = "1.18.22";
|
|
33
|
+
exports.LIGHT_CLIENT_VERSION = "0.9.1";
|
|
34
|
+
exports.LIGHT_TEST_UTILS_VERSION = "1.2.1";
|
|
35
|
+
exports.SOLANA_PROGRAM_TEST_VERSION = "1.18.22";
|
|
36
|
+
exports.TOKIO_VERSION = "1.36.0";
|
|
37
|
+
exports.COMPRESSED_PROGRAM_TEMPLATE_TAG = "v0.1.1";
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
export declare function
|
|
1
|
+
export declare function stopTestEnv(options: {
|
|
2
|
+
indexer: boolean;
|
|
3
|
+
prover: boolean;
|
|
4
|
+
}): Promise<void>;
|
|
5
|
+
export declare function initTestEnv({ additionalPrograms, skipSystemAccounts, indexer, prover, rpcPort, indexerPort, proverPort, gossipHost, proveCompressedAccounts, proveNewAddresses, checkPhotonVersion, photonDatabaseUrl, limitLedgerSize, }: {
|
|
2
6
|
additionalPrograms?: {
|
|
3
7
|
address: string;
|
|
4
8
|
path: string;
|
|
@@ -6,7 +10,6 @@ export declare function initTestEnv({ additionalPrograms, skipSystemAccounts, in
|
|
|
6
10
|
skipSystemAccounts?: boolean;
|
|
7
11
|
indexer: boolean;
|
|
8
12
|
prover: boolean;
|
|
9
|
-
forester: boolean;
|
|
10
13
|
rpcPort?: number;
|
|
11
14
|
indexerPort?: number;
|
|
12
15
|
proverPort?: number;
|
|
@@ -17,7 +20,7 @@ export declare function initTestEnv({ additionalPrograms, skipSystemAccounts, in
|
|
|
17
20
|
photonDatabaseUrl?: string;
|
|
18
21
|
limitLedgerSize?: number;
|
|
19
22
|
}): Promise<void>;
|
|
20
|
-
export declare function initTestEnvIfNeeded({ additionalPrograms, skipSystemAccounts, indexer, prover,
|
|
23
|
+
export declare function initTestEnvIfNeeded({ additionalPrograms, skipSystemAccounts, indexer, prover, }?: {
|
|
21
24
|
additionalPrograms?: {
|
|
22
25
|
address: string;
|
|
23
26
|
path: string;
|
|
@@ -25,8 +28,9 @@ export declare function initTestEnvIfNeeded({ additionalPrograms, skipSystemAcco
|
|
|
25
28
|
skipSystemAccounts?: boolean;
|
|
26
29
|
indexer?: boolean;
|
|
27
30
|
prover?: boolean;
|
|
28
|
-
forester?: boolean;
|
|
29
31
|
}): Promise<void>;
|
|
32
|
+
export declare function programsDirPath(): string;
|
|
33
|
+
export declare function programFilePath(programName: string): string;
|
|
30
34
|
export declare function getSolanaArgs({ additionalPrograms, skipSystemAccounts, limitLedgerSize, rpcPort, gossipHost, downloadBinaries, }: {
|
|
31
35
|
additionalPrograms?: {
|
|
32
36
|
address: string;
|