@moonpay/cli 0.6.12 → 0.6.14
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/{chunk-2XX5YJ2D.js → chunk-CTYZ36RZ.js} +147 -14
- package/dist/chunk-CTYZ36RZ.js.map +1 -0
- package/dist/index.js +2 -2
- package/dist/{mcp-4U5K4DCI.js → mcp-UXGB2XH2.js} +2 -2
- package/package.json +1 -1
- package/skills/moonpay-feedback/SKILL.md +49 -0
- package/dist/chunk-2XX5YJ2D.js.map +0 -1
- /package/dist/{mcp-4U5K4DCI.js.map → mcp-UXGB2XH2.js.map} +0 -0
|
@@ -235,9 +235,21 @@ async function callTool(baseUrl, toolName, params) {
|
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
|
-
|
|
238
|
+
if (res.status === 429) {
|
|
239
|
+
throw new Error("Rate limit exceeded. Please wait a moment and try again.");
|
|
240
|
+
}
|
|
239
241
|
if (res.status === 401) {
|
|
240
|
-
throw new Error("This command requires a MoonPay
|
|
242
|
+
throw new Error("This command requires a MoonPay CLI account. Run `moonpay login` first.");
|
|
243
|
+
}
|
|
244
|
+
const text = await res.text();
|
|
245
|
+
if (!text) {
|
|
246
|
+
throw new Error(`Empty response from server (${res.status})`);
|
|
247
|
+
}
|
|
248
|
+
let data;
|
|
249
|
+
try {
|
|
250
|
+
data = JSON.parse(text);
|
|
251
|
+
} catch {
|
|
252
|
+
throw new Error(`Unexpected response from server (${res.status})`);
|
|
241
253
|
}
|
|
242
254
|
if (res.status < 200 || res.status >= 300) {
|
|
243
255
|
const err = data;
|
|
@@ -599,9 +611,68 @@ var schemas_default = [
|
|
|
599
611
|
$schema: "http://json-schema.org/draft-07/schema#"
|
|
600
612
|
}
|
|
601
613
|
},
|
|
614
|
+
{
|
|
615
|
+
name: "feedback_create",
|
|
616
|
+
description: "Submit feedback, a bug report, or a feature request. Requires authentication.",
|
|
617
|
+
inputSchema: {
|
|
618
|
+
$ref: "#/definitions/feedback_create_input",
|
|
619
|
+
definitions: {
|
|
620
|
+
feedback_create_input: {
|
|
621
|
+
type: "object",
|
|
622
|
+
properties: {
|
|
623
|
+
type: {
|
|
624
|
+
type: "string",
|
|
625
|
+
enum: [
|
|
626
|
+
"bug",
|
|
627
|
+
"feature",
|
|
628
|
+
"general"
|
|
629
|
+
],
|
|
630
|
+
description: "Type of feedback: bug report, feature request, or general"
|
|
631
|
+
},
|
|
632
|
+
message: {
|
|
633
|
+
type: "string",
|
|
634
|
+
minLength: 1,
|
|
635
|
+
maxLength: 280,
|
|
636
|
+
description: "Your feedback message"
|
|
637
|
+
}
|
|
638
|
+
},
|
|
639
|
+
required: [
|
|
640
|
+
"type",
|
|
641
|
+
"message"
|
|
642
|
+
],
|
|
643
|
+
additionalProperties: false
|
|
644
|
+
}
|
|
645
|
+
},
|
|
646
|
+
$schema: "http://json-schema.org/draft-07/schema#"
|
|
647
|
+
},
|
|
648
|
+
outputSchema: {
|
|
649
|
+
$ref: "#/definitions/feedback_create_output",
|
|
650
|
+
definitions: {
|
|
651
|
+
feedback_create_output: {
|
|
652
|
+
type: "object",
|
|
653
|
+
properties: {
|
|
654
|
+
id: {
|
|
655
|
+
type: "string",
|
|
656
|
+
description: "Feedback ID"
|
|
657
|
+
},
|
|
658
|
+
message: {
|
|
659
|
+
type: "string",
|
|
660
|
+
description: "Confirmation message"
|
|
661
|
+
}
|
|
662
|
+
},
|
|
663
|
+
required: [
|
|
664
|
+
"id",
|
|
665
|
+
"message"
|
|
666
|
+
],
|
|
667
|
+
additionalProperties: false
|
|
668
|
+
}
|
|
669
|
+
},
|
|
670
|
+
$schema: "http://json-schema.org/draft-07/schema#"
|
|
671
|
+
}
|
|
672
|
+
},
|
|
602
673
|
{
|
|
603
674
|
name: "login",
|
|
604
|
-
description: "Send a verification code to the provided email to sign in or create an account.",
|
|
675
|
+
description: "Send a verification code to the provided email to sign in or create an account. Requires an hCaptcha token.",
|
|
605
676
|
inputSchema: {
|
|
606
677
|
$ref: "#/definitions/login_input",
|
|
607
678
|
definitions: {
|
|
@@ -612,10 +683,15 @@ var schemas_default = [
|
|
|
612
683
|
type: "string",
|
|
613
684
|
format: "email",
|
|
614
685
|
description: "The email of the user to login"
|
|
686
|
+
},
|
|
687
|
+
captchaToken: {
|
|
688
|
+
type: "string",
|
|
689
|
+
description: "hCaptcha response token"
|
|
615
690
|
}
|
|
616
691
|
},
|
|
617
692
|
required: [
|
|
618
|
-
"email"
|
|
693
|
+
"email",
|
|
694
|
+
"captchaToken"
|
|
619
695
|
],
|
|
620
696
|
additionalProperties: false
|
|
621
697
|
}
|
|
@@ -6535,6 +6611,7 @@ var walletCreate = createTool(walletCreateSchema, async (params) => {
|
|
|
6535
6611
|
});
|
|
6536
6612
|
|
|
6537
6613
|
// src/tools/wallet/import/tool.ts
|
|
6614
|
+
import { createInterface } from "readline";
|
|
6538
6615
|
import { validateMnemonic } from "@scure/bip39";
|
|
6539
6616
|
import { wordlist as english2 } from "@scure/bip39/wordlists/english";
|
|
6540
6617
|
import { Keypair } from "@solana/web3.js";
|
|
@@ -6560,12 +6637,64 @@ var walletImportSchema = defineToolSchema({
|
|
|
6560
6637
|
});
|
|
6561
6638
|
|
|
6562
6639
|
// src/tools/wallet/import/tool.ts
|
|
6640
|
+
function readSecret(prompt) {
|
|
6641
|
+
return new Promise((resolve, reject) => {
|
|
6642
|
+
if (!process.stdin.isTTY) {
|
|
6643
|
+
reject(new Error("Interactive import requires a terminal. Pass --mnemonic or --key instead."));
|
|
6644
|
+
return;
|
|
6645
|
+
}
|
|
6646
|
+
const rl = createInterface({ input: process.stdin, output: process.stderr });
|
|
6647
|
+
process.stderr.write(prompt);
|
|
6648
|
+
process.stdin.setRawMode(true);
|
|
6649
|
+
let input = "";
|
|
6650
|
+
const onData = (ch) => {
|
|
6651
|
+
const c = ch.toString();
|
|
6652
|
+
if (c === "\n" || c === "\r") {
|
|
6653
|
+
process.stdin.setRawMode(false);
|
|
6654
|
+
process.stdin.removeListener("data", onData);
|
|
6655
|
+
process.stderr.write("\n");
|
|
6656
|
+
rl.close();
|
|
6657
|
+
resolve(input.trim());
|
|
6658
|
+
} else if (c === "") {
|
|
6659
|
+
process.stdin.setRawMode(false);
|
|
6660
|
+
rl.close();
|
|
6661
|
+
process.exit(0);
|
|
6662
|
+
} else if (c === "\x7F" || c === "\b") {
|
|
6663
|
+
input = input.slice(0, -1);
|
|
6664
|
+
} else {
|
|
6665
|
+
input += c;
|
|
6666
|
+
}
|
|
6667
|
+
};
|
|
6668
|
+
process.stdin.on("data", onData);
|
|
6669
|
+
});
|
|
6670
|
+
}
|
|
6671
|
+
function detectSecretType(secret) {
|
|
6672
|
+
const words = secret.split(/\s+/);
|
|
6673
|
+
if (words.length >= 12 && words.length <= 24 && validateMnemonic(secret, english2)) {
|
|
6674
|
+
return "mnemonic";
|
|
6675
|
+
}
|
|
6676
|
+
return "key";
|
|
6677
|
+
}
|
|
6563
6678
|
var walletImport = createTool(walletImportSchema, async (params) => {
|
|
6564
6679
|
if (params.mnemonic && params.key) {
|
|
6565
6680
|
throw new Error("Provide either --mnemonic or --key, not both.");
|
|
6566
6681
|
}
|
|
6567
|
-
|
|
6568
|
-
|
|
6682
|
+
let mnemonic = params.mnemonic;
|
|
6683
|
+
let key = params.key;
|
|
6684
|
+
if (!mnemonic && !key) {
|
|
6685
|
+
const secret = await readSecret("Paste your mnemonic or private key (hidden): ");
|
|
6686
|
+
if (!secret) {
|
|
6687
|
+
throw new Error("No input provided.");
|
|
6688
|
+
}
|
|
6689
|
+
const type = detectSecretType(secret);
|
|
6690
|
+
if (type === "mnemonic") {
|
|
6691
|
+
mnemonic = secret;
|
|
6692
|
+
} else {
|
|
6693
|
+
key = secret;
|
|
6694
|
+
}
|
|
6695
|
+
}
|
|
6696
|
+
if (mnemonic) {
|
|
6697
|
+
const trimmed = mnemonic.trim().toLowerCase();
|
|
6569
6698
|
if (!validateMnemonic(trimmed, english2)) {
|
|
6570
6699
|
throw new Error("Invalid BIP39 mnemonic.");
|
|
6571
6700
|
}
|
|
@@ -6580,20 +6709,20 @@ var walletImport = createTool(walletImportSchema, async (params) => {
|
|
|
6580
6709
|
return { name: params.name, type: "hd", addresses };
|
|
6581
6710
|
}
|
|
6582
6711
|
const chain = params.chain ? KEY_CHAIN_MAP[params.chain] : "solana";
|
|
6583
|
-
const
|
|
6712
|
+
const keyValue = key ?? "";
|
|
6584
6713
|
let address;
|
|
6585
6714
|
let cleanKey;
|
|
6586
6715
|
if (chain === "solana") {
|
|
6587
6716
|
try {
|
|
6588
|
-
const secretKeyBytes = bs58.decode(
|
|
6717
|
+
const secretKeyBytes = bs58.decode(keyValue);
|
|
6589
6718
|
const keypair = Keypair.fromSecretKey(secretKeyBytes);
|
|
6590
6719
|
address = keypair.publicKey.toBase58();
|
|
6591
|
-
cleanKey =
|
|
6720
|
+
cleanKey = keyValue;
|
|
6592
6721
|
} catch {
|
|
6593
6722
|
throw new Error("Invalid Solana private key. Expected base58-encoded secret key.");
|
|
6594
6723
|
}
|
|
6595
6724
|
} else if (chain === "ethereum") {
|
|
6596
|
-
cleanKey =
|
|
6725
|
+
cleanKey = keyValue.startsWith("0x") ? keyValue.slice(2) : keyValue;
|
|
6597
6726
|
if (!/^[0-9a-fA-F]{64}$/.test(cleanKey)) {
|
|
6598
6727
|
throw new Error("Invalid EVM private key. Expected 64-character hex string.");
|
|
6599
6728
|
}
|
|
@@ -6673,7 +6802,7 @@ var walletDeleteSchema = defineToolSchema({
|
|
|
6673
6802
|
var walletDelete = createTool(walletDeleteSchema, async (params) => {
|
|
6674
6803
|
if (!params.confirm) {
|
|
6675
6804
|
throw new Error(
|
|
6676
|
-
"
|
|
6805
|
+
"Back up your wallet before deleting! Run `mp wallet export " + params.wallet + "` to save your recovery phrase, then re-run with --confirm to permanently delete."
|
|
6677
6806
|
);
|
|
6678
6807
|
}
|
|
6679
6808
|
const wallet = findWalletOrThrow(params.wallet);
|
|
@@ -7591,10 +7720,14 @@ var loginSchema = defineToolSchema({
|
|
|
7591
7720
|
// src/tools/login/tool.ts
|
|
7592
7721
|
var login = createTool(loginSchema, async (params) => {
|
|
7593
7722
|
const { baseUrl } = getConfigOrDefault();
|
|
7594
|
-
|
|
7723
|
+
const url = `${baseUrl}/login?email=${encodeURIComponent(params.email)}`;
|
|
7595
7724
|
return {
|
|
7596
7725
|
email: params.email,
|
|
7597
|
-
message: `
|
|
7726
|
+
message: `Open this link to verify:
|
|
7727
|
+
|
|
7728
|
+
${url}
|
|
7729
|
+
|
|
7730
|
+
Then run: mp verify --email ${params.email} --code <code>`
|
|
7598
7731
|
};
|
|
7599
7732
|
});
|
|
7600
7733
|
|
|
@@ -7711,4 +7844,4 @@ export {
|
|
|
7711
7844
|
consentCheck,
|
|
7712
7845
|
LOCAL_TOOLS
|
|
7713
7846
|
};
|
|
7714
|
-
//# sourceMappingURL=chunk-
|
|
7847
|
+
//# sourceMappingURL=chunk-CTYZ36RZ.js.map
|