@moonpay/cli 0.2.2 → 0.2.4

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/index.js CHANGED
@@ -3036,7 +3036,7 @@ var schemas_default = [
3036
3036
  },
3037
3037
  {
3038
3038
  name: "user_retrieve",
3039
- description: "Retrieve the currently authenticated user from the session context.",
3039
+ description: "Get the currently authenticated user",
3040
3040
  inputSchema: {
3041
3041
  $ref: "#/definitions/user_retrieve_input",
3042
3042
  definitions: {
@@ -4055,16 +4055,17 @@ function saveWallet(wallet) {
4055
4055
  writeFileSync3(tmpPath, JSON.stringify(wallet, null, 2), { mode: 384 });
4056
4056
  renameSync2(tmpPath, filePath);
4057
4057
  }
4058
- function loadWallet(address) {
4058
+ function loadWallet(nameOrAddress) {
4059
4059
  ensureWalletsDir();
4060
4060
  const files = readdirSync(WALLETS_DIR).filter((f) => f.endsWith(".json"));
4061
4061
  for (const file of files) {
4062
4062
  const wallet = JSON.parse(
4063
4063
  readFileSync3(join3(WALLETS_DIR, file), "utf-8")
4064
4064
  );
4065
- if (wallet.address === address) return wallet;
4065
+ if (wallet.name === nameOrAddress || wallet.address === nameOrAddress)
4066
+ return wallet;
4066
4067
  }
4067
- throw new Error(`Wallet "${address}" not found`);
4068
+ throw new Error(`Wallet "${nameOrAddress}" not found`);
4068
4069
  }
4069
4070
 
4070
4071
  // src/tools/wallet/create/schema.ts
@@ -4197,7 +4198,7 @@ var walletRetrieveSchema = defineToolSchema({
4197
4198
  name: "wallet_retrieve",
4198
4199
  description: "Get details of a specific wallet",
4199
4200
  input: z5.object({
4200
- name: z5.string().describe("Wallet name")
4201
+ wallet: z5.string().describe("Wallet name or address")
4201
4202
  }),
4202
4203
  output: walletInfoSchema
4203
4204
  });
@@ -4206,7 +4207,7 @@ var walletRetrieveSchema = defineToolSchema({
4206
4207
  var walletRetrieve = createTool(
4207
4208
  walletRetrieveSchema,
4208
4209
  async (params) => {
4209
- const wallet = loadWallet(params.name);
4210
+ const wallet = loadWallet(params.wallet);
4210
4211
  return {
4211
4212
  name: wallet.name,
4212
4213
  address: wallet.address,
@@ -4225,7 +4226,7 @@ var walletDeleteSchema = defineToolSchema({
4225
4226
  name: "wallet_delete",
4226
4227
  description: "Permanently delete a local wallet. This removes the private key file and cannot be undone.",
4227
4228
  input: z6.object({
4228
- name: z6.string().describe("Name of the wallet to delete"),
4229
+ wallet: z6.string().describe("Name or address of the wallet to delete"),
4229
4230
  confirm: z6.boolean().describe("Must be true to confirm deletion")
4230
4231
  }),
4231
4232
  output: z6.object({
@@ -4241,9 +4242,9 @@ var walletDelete = createTool(walletDeleteSchema, async (params) => {
4241
4242
  "Deletion not confirmed. Pass --confirm to permanently delete this wallet."
4242
4243
  );
4243
4244
  }
4244
- await walletRetrieve.handler({ name: params.name });
4245
- unlinkSync2(getWalletPath(params.name));
4246
- return { name: params.name, deleted: true };
4245
+ const wallet = await walletRetrieve.handler({ wallet: params.wallet });
4246
+ unlinkSync2(getWalletPath(wallet.name));
4247
+ return { name: wallet.name, deleted: true };
4247
4248
  });
4248
4249
 
4249
4250
  // src/tools/transaction/sign/tool.ts