@chest-gate/cli 0.6.1 → 0.6.2
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/dist/commands/split.d.ts.map +1 -1
- package/dist/commands/split.js +140 -49
- package/dist/commands/split.js.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"split.d.ts","sourceRoot":"","sources":["../../src/commands/split.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"split.d.ts","sourceRoot":"","sources":["../../src/commands/split.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA4PpC,eAAO,MAAM,YAAY,SAGQ,CAAC"}
|
package/dist/commands/split.js
CHANGED
|
@@ -4,14 +4,48 @@ import pkg from "@coral-xyz/anchor";
|
|
|
4
4
|
const { AnchorProvider, Program, Wallet, setProvider } = pkg;
|
|
5
5
|
import { Connection, Keypair, PublicKey } from "@solana/web3.js";
|
|
6
6
|
import { ensureKeypair } from "../keypair.js";
|
|
7
|
-
import {
|
|
7
|
+
import { RPC_URLS } from "../splitter-init.js";
|
|
8
|
+
import { api, ApiError, NotLoggedInError } from "../api.js";
|
|
8
9
|
import idl from "../chest_splitter_idl.json" with { type: "json" };
|
|
9
10
|
const PROGRAM_ID = new PublicKey("9a6zrqau5xVEdxNqBUfL2G18WuryQbWeJScPAUHZvmmX");
|
|
10
11
|
const MAX_REFERRER_BPS = 9850;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Resolve the canonical splitConfigPda + network for a slug by asking the
|
|
14
|
+
* server. The PDA can't reliably be re-derived locally because the seed
|
|
15
|
+
* authority is whatever wallet was used at `chest-gate deploy` time, which
|
|
16
|
+
* isn't necessarily the local `~/.chest/wallet.json`.
|
|
17
|
+
*
|
|
18
|
+
* `--pda` shortcuts this lookup for users who already know the address
|
|
19
|
+
* (and lets `split info` work without `chest-gate login`).
|
|
20
|
+
*/
|
|
21
|
+
async function resolveGateMeta(opts) {
|
|
22
|
+
if (opts.pda) {
|
|
23
|
+
return {
|
|
24
|
+
pda: new PublicKey(opts.pda),
|
|
25
|
+
network: normalizeNetwork(opts.network ?? "solana-devnet"),
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
if (!opts.slug) {
|
|
29
|
+
throw new Error("Pass --slug <slug> (or --pda <address> if you already know it).");
|
|
30
|
+
}
|
|
31
|
+
const gate = await api(`/api/my-gates/${encodeURIComponent(opts.slug.toLowerCase())}`, {
|
|
32
|
+
server: opts.server,
|
|
33
|
+
});
|
|
34
|
+
if (!gate.splitConfigPda) {
|
|
35
|
+
throw new Error(`Gate "${opts.slug}" has no on-chain split config. Re-deploy with a \`split:\` block in chest.config.yaml.`);
|
|
36
|
+
}
|
|
37
|
+
return {
|
|
38
|
+
pda: new PublicKey(gate.splitConfigPda),
|
|
39
|
+
network: normalizeNetwork(opts.network ?? gate.network),
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function normalizeNetwork(net) {
|
|
43
|
+
const n = net.toLowerCase().trim();
|
|
44
|
+
if (n === "devnet" || n === "dev")
|
|
45
|
+
return "solana-devnet";
|
|
46
|
+
if (n === "mainnet" || n === "main" || n === "mainnet-beta")
|
|
47
|
+
return "solana-mainnet";
|
|
48
|
+
return n;
|
|
15
49
|
}
|
|
16
50
|
function rpcUrlFor(network) {
|
|
17
51
|
return (RPC_URLS[network] ??
|
|
@@ -26,39 +60,61 @@ async function loadProgram(network, keypair) {
|
|
|
26
60
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
27
61
|
return { program: new Program(idl, provider), connection, wallet };
|
|
28
62
|
}
|
|
29
|
-
async function resolveSlug(cliSlug) {
|
|
30
|
-
if (cliSlug)
|
|
31
|
-
return cliSlug;
|
|
32
|
-
throw new Error("Pass --slug <slug> (the deployed slug, e.g. 'my-api')");
|
|
33
|
-
}
|
|
34
63
|
const splitInfoCommand = new Command("info")
|
|
35
64
|
.description("Read the on-chain SplitConfig PDA for this deploy")
|
|
36
|
-
.option("--slug <slug>", "deployment slug (
|
|
37
|
-
.option("--
|
|
65
|
+
.option("--slug <slug>", "deployment slug (server resolves the PDA)")
|
|
66
|
+
.option("--pda <address>", "skip server lookup, read this PDA directly")
|
|
67
|
+
.option("--network <net>", "solana network (devnet|mainnet); defaults to the gate's network")
|
|
68
|
+
.option("--server <url>", "chest.sh API origin")
|
|
69
|
+
.option("--json", "Emit machine-readable JSON")
|
|
38
70
|
.action(async (opts) => {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
71
|
+
try {
|
|
72
|
+
const { pda, network } = await resolveGateMeta(opts);
|
|
73
|
+
const feePayer = await ensureKeypair();
|
|
74
|
+
const { program } = await loadProgram(network, feePayer.keypair);
|
|
75
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
76
|
+
const cfg = (await program.account.splitConfig.fetchNullable(pda));
|
|
77
|
+
if (!cfg) {
|
|
78
|
+
console.error(chalk.red(` Error: no split config account at ${pda.toBase58()} on ${network}.`));
|
|
79
|
+
console.error(chalk.gray(" Either the slug was deployed without a split, or it lives on a different network."));
|
|
80
|
+
process.exit(1);
|
|
81
|
+
}
|
|
82
|
+
if (opts.json) {
|
|
83
|
+
process.stdout.write(JSON.stringify({
|
|
84
|
+
pda: pda.toBase58(),
|
|
85
|
+
network,
|
|
86
|
+
authority: cfg.authority.toBase58(),
|
|
87
|
+
merchantWallet: cfg.merchantWallet.toBase58(),
|
|
88
|
+
protocolWallet: cfg.protocolWallet.toBase58(),
|
|
89
|
+
referrerBps: cfg.referrerBps,
|
|
90
|
+
protocolBps: cfg.protocolBps,
|
|
91
|
+
}) + "\n");
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
console.log(chalk.bold("\n ⚡ Split Config\n"));
|
|
95
|
+
console.log(chalk.gray(" PDA: ") + chalk.cyan(pda.toBase58()));
|
|
96
|
+
console.log(chalk.gray(" Network: ") + chalk.white(network));
|
|
97
|
+
console.log(chalk.gray(" Authority: ") + chalk.white(cfg.authority.toBase58()));
|
|
98
|
+
console.log(chalk.gray(" Merchant wallet: ") + chalk.white(cfg.merchantWallet.toBase58()));
|
|
99
|
+
console.log(chalk.gray(" Protocol wallet: ") + chalk.white(cfg.protocolWallet.toBase58()));
|
|
100
|
+
console.log(chalk.gray(" Referrer bps: ") +
|
|
101
|
+
chalk.green(`${cfg.referrerBps} (${(cfg.referrerBps / 100).toFixed(2)}%)`));
|
|
102
|
+
console.log(chalk.gray(" Protocol bps: ") +
|
|
103
|
+
chalk.white(`${cfg.protocolBps} (${(cfg.protocolBps / 100).toFixed(2)}%)`));
|
|
104
|
+
console.log();
|
|
105
|
+
}
|
|
106
|
+
catch (err) {
|
|
107
|
+
handleError(err, opts.slug);
|
|
108
|
+
process.exit(1);
|
|
109
|
+
}
|
|
56
110
|
});
|
|
57
111
|
const splitUpdateCommand = new Command("update")
|
|
58
112
|
.description("Update the referrer commission % for this deploy")
|
|
59
113
|
.requiredOption("--referrer <pct>", "new referrer commission in % (0–98.5)")
|
|
60
|
-
.option("--slug <slug>", "deployment slug (
|
|
61
|
-
.option("--
|
|
114
|
+
.option("--slug <slug>", "deployment slug (server resolves the PDA)")
|
|
115
|
+
.option("--pda <address>", "skip server lookup, update this PDA directly")
|
|
116
|
+
.option("--network <net>", "solana network (devnet|mainnet); defaults to the gate's network")
|
|
117
|
+
.option("--server <url>", "chest.sh API origin")
|
|
62
118
|
.action(async (opts) => {
|
|
63
119
|
const pct = parseFloat(opts.referrer);
|
|
64
120
|
if (!Number.isFinite(pct) || pct < 0 || pct > 98.5) {
|
|
@@ -70,27 +126,62 @@ const splitUpdateCommand = new Command("update")
|
|
|
70
126
|
console.error(chalk.red(`Referrer bps out of range: ${newBps} (max ${MAX_REFERRER_BPS})`));
|
|
71
127
|
process.exit(1);
|
|
72
128
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
129
|
+
try {
|
|
130
|
+
const { pda, network } = await resolveGateMeta(opts);
|
|
131
|
+
const feePayer = await ensureKeypair();
|
|
132
|
+
const { program, connection } = await loadProgram(network, feePayer.keypair);
|
|
133
|
+
const authority = Keypair.fromSecretKey(feePayer.keypair);
|
|
134
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
135
|
+
const existing = (await program.account.splitConfig.fetchNullable(pda));
|
|
136
|
+
if (!existing) {
|
|
137
|
+
console.error(chalk.red(` Error: no split config account at ${pda.toBase58()} on ${network}.`));
|
|
138
|
+
process.exit(1);
|
|
139
|
+
}
|
|
140
|
+
if (!existing.authority.equals(authority.publicKey)) {
|
|
141
|
+
console.error(chalk.red(` Error: this split is owned by ${existing.authority.toBase58()}, not your local wallet (${authority.publicKey.toBase58()}).`));
|
|
142
|
+
console.error(chalk.gray(" `split update` requires the keypair that initialised the split. Re-run with the right --wallet-key, or import the right wallet to ~/.chest/wallet.json."));
|
|
143
|
+
process.exit(1);
|
|
144
|
+
}
|
|
145
|
+
// Probe RPC reachability before signing so users get a clean error
|
|
146
|
+
// instead of a stack trace when devnet is offline.
|
|
147
|
+
await connection.getSlot();
|
|
148
|
+
console.log(chalk.gray(` Updating referrer bps → ${newBps} (${pct.toFixed(2)}%) on ${network}...`));
|
|
149
|
+
const sig = await program.methods
|
|
150
|
+
.updateReferrerBps(newBps)
|
|
151
|
+
.accounts({
|
|
152
|
+
authority: authority.publicKey,
|
|
153
|
+
splitConfig: pda,
|
|
154
|
+
})
|
|
155
|
+
.rpc();
|
|
156
|
+
console.log(chalk.green(`\n ✓ Updated. Tx: ${sig}`));
|
|
157
|
+
console.log(chalk.gray(` PDA: ${pda.toBase58()}\n`));
|
|
158
|
+
}
|
|
159
|
+
catch (err) {
|
|
160
|
+
handleError(err, opts.slug);
|
|
81
161
|
process.exit(1);
|
|
82
162
|
}
|
|
83
|
-
console.log(chalk.gray(` Updating referrer bps → ${newBps} (${pct.toFixed(2)}%) for slug '${slug}'...`));
|
|
84
|
-
const sig = await program.methods
|
|
85
|
-
.updateReferrerBps(newBps)
|
|
86
|
-
.accounts({
|
|
87
|
-
authority: authority.publicKey,
|
|
88
|
-
splitConfig: pda,
|
|
89
|
-
})
|
|
90
|
-
.rpc();
|
|
91
|
-
console.log(chalk.green(`\n ✓ Updated. Tx: ${sig}`));
|
|
92
|
-
console.log(chalk.gray(` PDA: ${pda.toBase58()}\n`));
|
|
93
163
|
});
|
|
164
|
+
function handleError(err, slug) {
|
|
165
|
+
if (err instanceof NotLoggedInError) {
|
|
166
|
+
console.error(chalk.red(` Error: ${err.message}`));
|
|
167
|
+
console.error(chalk.gray(" Or pass --pda <address> to skip the server lookup."));
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
if (err instanceof ApiError) {
|
|
171
|
+
console.error(chalk.red(` Error ${err.status}: ${err.message}`));
|
|
172
|
+
if (err.status === 401) {
|
|
173
|
+
console.error(chalk.gray(" Re-run `chest-gate login`, or pass --pda <address>."));
|
|
174
|
+
}
|
|
175
|
+
else if (err.status === 403 && slug) {
|
|
176
|
+
console.error(chalk.gray(` Your wallet doesn't own slug "${slug}". Use --pda <address> to bypass the slug → PDA lookup.`));
|
|
177
|
+
}
|
|
178
|
+
else if (err.status === 404 && slug) {
|
|
179
|
+
console.error(chalk.gray(` Slug "${slug}" not found.`));
|
|
180
|
+
}
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
console.error(chalk.red(` Error: ${err.message}`));
|
|
184
|
+
}
|
|
94
185
|
export const splitCommand = new Command("split")
|
|
95
186
|
.description("Manage the on-chain revenue split for a deploy")
|
|
96
187
|
.addCommand(splitInfoCommand)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"split.js","sourceRoot":"","sources":["../../src/commands/split.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,mBAAmB,CAAC;AACpC,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,GAAG,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"split.js","sourceRoot":"","sources":["../../src/commands/split.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,mBAAmB,CAAC;AACpC,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,GAAG,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,GAAG,MAAM,4BAA4B,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAEnE,MAAM,UAAU,GAAG,IAAI,SAAS,CAAC,8CAA8C,CAAC,CAAC;AACjF,M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KAAK,GAAG,IAAI,IAAI,EAAE,CAAC;YACtC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,IAAI,cAAc,CAAC,CAAC,CAAC;QAC3D,CAAC;QACD,OAAO;IACT,CAAC;IACD,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,YAAa,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;AACjE,CAAC;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC;KAC7C,WAAW,CAAC,gDAAgD,CAAC;KAC7D,UAAU,CAAC,gBAAgB,CAAC;KAC5B,UAAU,CAAC,kBAAkB,CAAC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -15,7 +15,7 @@ const program = new Command();
|
|
|
15
15
|
program
|
|
16
16
|
.name("chest-gate")
|
|
17
17
|
.description("One command to monetise any API with x402 on Solana")
|
|
18
|
-
.version("0.6.
|
|
18
|
+
.version("0.6.2");
|
|
19
19
|
program.addCommand(gateCommand);
|
|
20
20
|
program.addCommand(deployCommand);
|
|
21
21
|
program.addCommand(initCommand);
|