@moonpay/cli 0.6.0 → 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.
@@ -122,6 +122,18 @@ var addressesSchema = z2.object({
122
122
  bitcoin: z2.string().optional(),
123
123
  tron: z2.string().optional()
124
124
  });
125
+ var EVM_CHAINS = ["base", "arbitrum", "polygon", "optimism", "bnb", "avalanche"];
126
+ function expandAddresses(addresses) {
127
+ const result = {};
128
+ if (addresses.solana) result.solana = addresses.solana;
129
+ if (addresses.ethereum) {
130
+ result.ethereum = addresses.ethereum;
131
+ for (const chain of EVM_CHAINS) result[chain] = addresses.ethereum;
132
+ }
133
+ if (addresses.bitcoin) result.bitcoin = addresses.bitcoin;
134
+ if (addresses.tron) result.tron = addresses.tron;
135
+ return result;
136
+ }
125
137
  var hdWalletSchema = z2.object({
126
138
  name: z2.string(),
127
139
  type: z2.literal("hd"),
@@ -144,7 +156,7 @@ var walletSchema = z2.discriminatedUnion("type", [
144
156
  var walletInfoSchema = z2.object({
145
157
  name: z2.string(),
146
158
  type: z2.enum(["hd", "imported"]),
147
- addresses: addressesSchema,
159
+ addresses: z2.record(z2.string(), z2.string()),
148
160
  createdAt: z2.string()
149
161
  });
150
162
 
@@ -454,6 +466,7 @@ export {
454
466
  keyChainSchema,
455
467
  KEY_CHAIN_MAP,
456
468
  addressesSchema,
469
+ expandAddresses,
457
470
  walletInfoSchema,
458
471
  loadWallets,
459
472
  saveWallets,
@@ -464,4 +477,4 @@ export {
464
477
  removeWallet,
465
478
  resolveSigningKey
466
479
  };
467
- //# sourceMappingURL=chunk-GSAFAKB7.js.map
480
+ //# sourceMappingURL=chunk-AL5WDHLT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/tools/wallet/store.ts","../src/tools/wallet/models.ts","../src/crypto.ts","../src/tools/wallet/session.ts","../src/tools/wallet/chains.ts"],"sourcesContent":["import {\n existsSync,\n readFileSync,\n writeFileSync,\n mkdirSync,\n renameSync,\n} from \"node:fs\";\nimport { join } from \"node:path\";\nimport { homedir } from \"node:os\";\nimport { randomBytes } from \"node:crypto\";\nimport {\n walletsFileSchema,\n walletSchema,\n type Wallet,\n type Chain,\n type KeyChain,\n KEY_CHAIN_MAP,\n} from \"./models\";\nimport { encrypt, decrypt } from \"../../crypto\";\nimport { getEncryptionKey, ensureEncryptionKey } from \"./session\";\nimport { deriveKeyForChain } from \"./chains\";\nimport bs58 from \"bs58\";\n\n// ── Paths ───────────────────────────────────────────────────\n\nconst CONFIG_DIR = join(homedir(), \".config\", \"moonpay\");\nconst WALLETS_PATH = join(CONFIG_DIR, \"wallets.json\");\n\nfunction ensureConfigDir(): void {\n mkdirSync(CONFIG_DIR, { recursive: true, mode: 0o700 });\n}\n\n// ── Load / Save ─────────────────────────────────────────────\n\nexport function loadWallets(): Wallet[] {\n if (!existsSync(WALLETS_PATH)) return [];\n\n const encryptionKey = getEncryptionKey();\n if (!encryptionKey) {\n throw new Error(\n \"Encryption key not found. Set MOONPAY_ENCRYPTION_KEY or ensure OS keychain is accessible.\",\n );\n }\n\n const raw = JSON.parse(readFileSync(WALLETS_PATH, \"utf-8\"));\n const file = walletsFileSchema.parse(raw);\n const decrypted = decrypt(file, encryptionKey);\n const parsed = JSON.parse(decrypted);\n\n return (parsed.wallets ?? []).map((w: unknown) => walletSchema.parse(w));\n}\n\nexport function saveWallets(wallets: Wallet[]): void {\n const encryptionKey = ensureEncryptionKey();\n const data = JSON.stringify({ wallets });\n const file = encrypt(data, encryptionKey);\n\n ensureConfigDir();\n const tmpPath = join(CONFIG_DIR, `.wallets.${randomBytes(4).toString(\"hex\")}.tmp`);\n writeFileSync(tmpPath, JSON.stringify(file, null, 2), { mode: 0o600 });\n renameSync(tmpPath, WALLETS_PATH);\n}\n\nexport function mutateWallets(fn: (wallets: Wallet[]) => void): void {\n const wallets = loadWallets();\n fn(wallets);\n saveWallets(wallets);\n}\n\n// ── Wallet operations ───────────────────────────────────────\n\nexport function findWallet(nameOrAddress: string): Wallet | null {\n const wallets = loadWallets();\n\n for (const wallet of wallets) {\n if (wallet.name === nameOrAddress) return wallet;\n for (const address of Object.values(wallet.addresses)) {\n if (address === nameOrAddress) return wallet;\n }\n }\n\n return null;\n}\n\nexport function findWalletOrThrow(nameOrAddress: string): Wallet {\n const wallet = findWallet(nameOrAddress);\n if (!wallet) throw new Error(`Wallet \"${nameOrAddress}\" not found`);\n return wallet;\n}\n\nexport function addWallet(wallet: Wallet): void {\n mutateWallets((wallets) => {\n if (wallets.some((w) => w.name === wallet.name)) {\n throw new Error(`Wallet \"${wallet.name}\" already exists`);\n }\n wallets.push(wallet);\n });\n}\n\nexport function removeWallet(name: string): void {\n mutateWallets((wallets) => {\n const idx = wallets.findIndex((w) => w.name === name);\n if (idx === -1) throw new Error(`Wallet \"${name}\" not found`);\n wallets.splice(idx, 1);\n });\n}\n\n// ── Key resolution ──────────────────────────────────────────\n\nexport function resolveSigningKey(\n wallet: Wallet,\n chain: Chain,\n): { privateKey: Uint8Array; address: string } {\n const keyChain = KEY_CHAIN_MAP[chain];\n\n if (wallet.type === \"imported\") {\n if (wallet.chain !== keyChain) {\n throw new Error(\n `Wallet \"${wallet.name}\" was imported for ${wallet.chain}, cannot sign for ${chain}.`,\n );\n }\n return {\n privateKey: decodePrivateKey(wallet.privateKey, keyChain),\n address: wallet.addresses[keyChain]!,\n };\n }\n\n const derived = deriveKeyForChain(wallet.mnemonic, keyChain);\n return { privateKey: derived.privateKey, address: derived.address };\n}\n\nfunction decodePrivateKey(key: string, chain: KeyChain): Uint8Array {\n if (chain === \"solana\") {\n return bs58.decode(key);\n }\n const hex = key.startsWith(\"0x\") ? key.slice(2) : key;\n return Uint8Array.from(Buffer.from(hex, \"hex\"));\n}\n","import { z } from \"zod\";\nimport { encryptedFileSchema, type EncryptedFile } from \"../../crypto\";\n\nexport { encryptedFileSchema as walletsFileSchema };\nexport type WalletsFile = EncryptedFile;\n\n// ── Chain types ─────────────────────────────────────────────\n\nexport const chainSchema = z.enum([\n \"solana\",\n \"ethereum\",\n \"base\",\n \"arbitrum\",\n \"polygon\",\n \"optimism\",\n \"bnb\",\n \"avalanche\",\n \"bitcoin\",\n \"tron\",\n]);\nexport type Chain = z.infer<typeof chainSchema>;\n\nexport const keyChainSchema = z.enum([\"solana\", \"ethereum\", \"bitcoin\", \"tron\"]);\nexport type KeyChain = z.infer<typeof keyChainSchema>;\n\nexport const KEY_CHAIN_MAP: Record<Chain, KeyChain> = {\n solana: \"solana\",\n ethereum: \"ethereum\",\n base: \"ethereum\",\n arbitrum: \"ethereum\",\n polygon: \"ethereum\",\n optimism: \"ethereum\",\n bnb: \"ethereum\",\n avalanche: \"ethereum\",\n bitcoin: \"bitcoin\",\n tron: \"tron\",\n};\n\n// ── Addresses ───────────────────────────────────────────────\n\nexport const addressesSchema = z.object({\n solana: z.string().optional(),\n ethereum: z.string().optional(),\n bitcoin: z.string().optional(),\n tron: z.string().optional(),\n});\nexport type Addresses = z.infer<typeof addressesSchema>;\n\nconst EVM_CHAINS = [\"base\", \"arbitrum\", \"polygon\", \"optimism\", \"bnb\", \"avalanche\"] as const;\n\nexport function expandAddresses(addresses: Addresses): Record<string, string> {\n const result: Record<string, string> = {};\n if (addresses.solana) result.solana = addresses.solana;\n if (addresses.ethereum) {\n result.ethereum = addresses.ethereum;\n for (const chain of EVM_CHAINS) result[chain] = addresses.ethereum;\n }\n if (addresses.bitcoin) result.bitcoin = addresses.bitcoin;\n if (addresses.tron) result.tron = addresses.tron;\n return result;\n}\n\n// ── Wallet types (internal, includes secrets) ───────────────\n\nexport const hdWalletSchema = z.object({\n name: z.string(),\n type: z.literal(\"hd\"),\n mnemonic: z.string(),\n addresses: addressesSchema,\n createdAt: z.string(),\n});\nexport type HdWallet = z.infer<typeof hdWalletSchema>;\n\nexport const importedWalletSchema = z.object({\n name: z.string(),\n type: z.literal(\"imported\"),\n chain: keyChainSchema,\n privateKey: z.string(),\n addresses: addressesSchema,\n createdAt: z.string(),\n});\nexport type ImportedWallet = z.infer<typeof importedWalletSchema>;\n\nexport const walletSchema = z.discriminatedUnion(\"type\", [\n hdWalletSchema,\n importedWalletSchema,\n]);\nexport type Wallet = z.infer<typeof walletSchema>;\n\n// ── Encrypted file format (re-exported from shared crypto) ──\n\n// ── Public wallet info (no secrets) ─────────────────────────\n\nexport const walletInfoSchema = z.object({\n name: z.string(),\n type: z.enum([\"hd\", \"imported\"]),\n addresses: z.record(z.string(), z.string()),\n createdAt: z.string(),\n});\nexport type WalletInfo = z.infer<typeof walletInfoSchema>;\n","import {\n randomBytes,\n scryptSync,\n createCipheriv,\n createDecipheriv,\n} from \"node:crypto\";\nimport { z } from \"zod\";\n\nconst SCRYPT_N = 2 ** 18;\nconst SCRYPT_R = 8;\nconst SCRYPT_P = 1;\nconst KEY_LENGTH = 32;\nconst SCRYPT_MAXMEM = 512 * 1024 * 1024;\n\nexport const encryptedFileSchema = z.object({\n encryption: z.object({\n cipher: z.literal(\"aes-256-gcm\"),\n kdf: z.literal(\"scrypt\"),\n kdfparams: z.object({\n n: z.number(),\n r: z.number(),\n p: z.number(),\n }),\n salt: z.string(),\n iv: z.string(),\n tag: z.string(),\n }),\n data: z.string(),\n});\nexport type EncryptedFile = z.infer<typeof encryptedFileSchema>;\n\nexport function encrypt(data: string, encryptionKey: string): EncryptedFile {\n const salt = randomBytes(32);\n const aesKey = scryptSync(encryptionKey, salt, KEY_LENGTH, {\n N: SCRYPT_N, r: SCRYPT_R, p: SCRYPT_P, maxmem: SCRYPT_MAXMEM,\n });\n const iv = randomBytes(12);\n const cipher = createCipheriv(\"aes-256-gcm\", aesKey, iv);\n\n const encrypted = Buffer.concat([\n cipher.update(data, \"utf8\"),\n cipher.final(),\n ]);\n\n return {\n encryption: {\n cipher: \"aes-256-gcm\",\n kdf: \"scrypt\",\n kdfparams: { n: SCRYPT_N, r: SCRYPT_R, p: SCRYPT_P },\n salt: salt.toString(\"base64\"),\n iv: iv.toString(\"base64\"),\n tag: cipher.getAuthTag().toString(\"base64\"),\n },\n data: encrypted.toString(\"base64\"),\n };\n}\n\nexport function decrypt(file: EncryptedFile, encryptionKey: string): string {\n const { salt, iv, tag, kdfparams } = file.encryption;\n\n const aesKey = scryptSync(\n encryptionKey,\n Buffer.from(salt, \"base64\"),\n KEY_LENGTH,\n { N: kdfparams.n, r: kdfparams.r, p: kdfparams.p, maxmem: SCRYPT_MAXMEM },\n );\n\n const decipher = createDecipheriv(\n \"aes-256-gcm\",\n aesKey,\n Buffer.from(iv, \"base64\"),\n { authTagLength: 16 },\n );\n decipher.setAuthTag(Buffer.from(tag, \"base64\"));\n\n return Buffer.concat([\n decipher.update(Buffer.from(file.data, \"base64\")),\n decipher.final(),\n ]).toString(\"utf8\");\n}\n","import { execFileSync, execSync } from \"node:child_process\";\nimport { randomBytes } from \"node:crypto\";\nimport { platform } from \"node:os\";\n\nconst SERVICE = \"moonpay-cli\";\nconst ACCOUNT = \"encryption-key\";\n\n// ── macOS Keychain ──────────────────────────────────────────\n\nfunction storeMacOS(value: string): void {\n try {\n execFileSync(\"security\", [\n \"delete-generic-password\", \"-s\", SERVICE, \"-a\", ACCOUNT,\n ], { stdio: \"ignore\" });\n } catch {}\n execFileSync(\"security\", [\n \"add-generic-password\", \"-s\", SERVICE, \"-a\", ACCOUNT, \"-w\", value,\n ], { stdio: \"ignore\" });\n}\n\nfunction getMacOS(): string | null {\n try {\n return execFileSync(\"security\", [\n \"find-generic-password\", \"-s\", SERVICE, \"-a\", ACCOUNT, \"-w\",\n ], { encoding: \"utf-8\", stdio: [\"ignore\", \"pipe\", \"ignore\"] }).trim();\n } catch {\n return null;\n }\n}\n\n// ── Linux libsecret ─────────────────────────────────────────\n\nfunction storeLinux(value: string): void {\n execSync(\n `printf '%s' | secret-tool store --label=\"${SERVICE}\" service \"${SERVICE}\" account \"${ACCOUNT}\"`,\n { input: value, stdio: [\"pipe\", \"ignore\", \"ignore\"] },\n );\n}\n\nfunction getLinux(): string | null {\n try {\n return execFileSync(\"secret-tool\", [\n \"lookup\", \"service\", SERVICE, \"account\", ACCOUNT,\n ], { encoding: \"utf-8\", stdio: [\"ignore\", \"pipe\", \"ignore\"] }).trim();\n } catch {\n return null;\n }\n}\n\n// ── Platform dispatch ───────────────────────────────────────\n\nfunction storeInKeychain(value: string): void {\n const os = platform();\n if (os === \"darwin\") return storeMacOS(value);\n if (os === \"linux\") return storeLinux(value);\n throw new Error(\"OS keychain not supported on this platform\");\n}\n\nfunction getFromKeychain(): string | null {\n const os = platform();\n if (os === \"darwin\") return getMacOS();\n if (os === \"linux\") return getLinux();\n return null;\n}\n\n// ── Public API ──────────────────────────────────────────────\n\nexport function getEncryptionKey(): string | null {\n const envKey = process.env.MOONPAY_ENCRYPTION_KEY;\n if (envKey) return envKey;\n return getFromKeychain();\n}\n\nexport function ensureEncryptionKey(): string {\n const existing = getEncryptionKey();\n if (existing) return existing;\n\n const key = randomBytes(32).toString(\"hex\");\n storeInKeychain(key);\n return key;\n}\n","import { createHash } from \"node:crypto\";\nimport { HDKey } from \"@scure/bip32\";\nimport { mnemonicToSeedSync } from \"@scure/bip39\";\nimport { keccak_256 } from \"@noble/hashes/sha3\";\nimport { derivePath } from \"ed25519-hd-key\";\nimport * as bitcoin from \"bitcoinjs-lib\";\nimport ECPairFactory from \"ecpair\";\nimport * as ecc from \"tiny-secp256k1\";\nimport { Keypair } from \"@solana/web3.js\";\nimport bs58 from \"bs58\";\nimport type { KeyChain } from \"./models\";\n\nconst ECPair = ECPairFactory(ecc);\n\n// ── BIP44 derivation paths ──────────────────────────────────\n\nexport function derivationPath(chain: KeyChain, account = 0): string {\n switch (chain) {\n case \"solana\":\n return `m/44'/501'/${account}'/0'`;\n case \"ethereum\":\n return `m/44'/60'/${account}'/0/0`;\n case \"bitcoin\":\n return `m/84'/0'/${account}'/0/0`;\n case \"tron\":\n return `m/44'/195'/${account}'/0/0`;\n }\n}\n\n// ── Key derivation ──────────────────────────────────────────\n\nexport interface DerivedKey {\n privateKey: Uint8Array;\n address: string;\n}\n\nexport function deriveKeyForChain(\n mnemonic: string,\n chain: KeyChain,\n account = 0,\n): DerivedKey {\n switch (chain) {\n case \"solana\":\n return deriveSolana(mnemonic, account);\n case \"ethereum\":\n return deriveEthereum(mnemonic, account);\n case \"bitcoin\":\n return deriveBitcoin(mnemonic, account);\n case \"tron\":\n return deriveTron(mnemonic, account);\n }\n}\n\nexport function deriveAllAddresses(\n mnemonic: string,\n account = 0,\n): Record<KeyChain, string> {\n return {\n solana: deriveKeyForChain(mnemonic, \"solana\", account).address,\n ethereum: deriveKeyForChain(mnemonic, \"ethereum\", account).address,\n bitcoin: deriveKeyForChain(mnemonic, \"bitcoin\", account).address,\n tron: deriveKeyForChain(mnemonic, \"tron\", account).address,\n };\n}\n\n// ── Solana (ed25519 via SLIP-0010) ──────────────────────────\n\nfunction deriveSolana(mnemonic: string, account: number): DerivedKey {\n const seed = mnemonicToSeedSync(mnemonic);\n const path = derivationPath(\"solana\", account);\n const { key } = derivePath(path, Buffer.from(seed).toString(\"hex\"));\n const keypair = Keypair.fromSeed(Uint8Array.from(key));\n return {\n privateKey: keypair.secretKey,\n address: keypair.publicKey.toBase58(),\n };\n}\n\n// ── Ethereum / EVM (secp256k1 via BIP32) ────────────────────\n\nfunction deriveEthereum(mnemonic: string, account: number): DerivedKey {\n const seed = mnemonicToSeedSync(mnemonic);\n const hdkey = HDKey.fromMasterSeed(seed);\n const path = derivationPath(\"ethereum\", account);\n const child = hdkey.derive(path);\n if (!child.privateKey) throw new Error(\"Failed to derive EVM private key\");\n\n const address = publicKeyToEthAddress(child.publicKey!);\n return {\n privateKey: child.privateKey,\n address,\n };\n}\n\nfunction publicKeyToEthAddress(compressedPubKey: Uint8Array): string {\n const uncompressed = ecc.pointCompress(compressedPubKey, false);\n const hash = keccak256(uncompressed.slice(1));\n const addressBytes = hash.slice(-20);\n const address = \"0x\" + Buffer.from(addressBytes).toString(\"hex\");\n return toChecksumAddress(address);\n}\n\nfunction keccak256(data: Uint8Array): Uint8Array {\n return keccak_256(data);\n}\n\nfunction toChecksumAddress(address: string): string {\n const addr = address.toLowerCase().replace(\"0x\", \"\");\n const hash = Buffer.from(keccak_256(Buffer.from(addr, \"utf8\"))).toString(\"hex\");\n let checksummed = \"0x\";\n for (let i = 0; i < addr.length; i++) {\n checksummed += parseInt(hash[i], 16) >= 8 ? addr[i].toUpperCase() : addr[i];\n }\n return checksummed;\n}\n\n// ── Bitcoin (secp256k1 via BIP32, native segwit) ────────────\n\nfunction deriveBitcoin(mnemonic: string, account: number): DerivedKey {\n const seed = mnemonicToSeedSync(mnemonic);\n const hdkey = HDKey.fromMasterSeed(seed);\n const path = derivationPath(\"bitcoin\", account);\n const child = hdkey.derive(path);\n if (!child.privateKey) throw new Error(\"Failed to derive Bitcoin private key\");\n\n const keyPair = ECPair.fromPrivateKey(Buffer.from(child.privateKey));\n const { address } = bitcoin.payments.p2wpkh({\n pubkey: Buffer.from(keyPair.publicKey),\n });\n if (!address) throw new Error(\"Failed to derive Bitcoin address\");\n\n return {\n privateKey: child.privateKey,\n address,\n };\n}\n\n// ── Tron (secp256k1 via BIP32, Base58Check) ─────────────────\n\nfunction deriveTron(mnemonic: string, account: number): DerivedKey {\n const seed = mnemonicToSeedSync(mnemonic);\n const hdkey = HDKey.fromMasterSeed(seed);\n const path = derivationPath(\"tron\", account);\n const child = hdkey.derive(path);\n if (!child.privateKey) throw new Error(\"Failed to derive Tron private key\");\n\n const address = publicKeyToTronAddress(child.publicKey!);\n return { privateKey: child.privateKey, address };\n}\n\nfunction publicKeyToTronAddress(compressedPubKey: Uint8Array): string {\n const uncompressed = ecc.pointCompress(compressedPubKey, false);\n const hash = keccak256(uncompressed.slice(1));\n const addressBytes = hash.slice(-20);\n\n // Tron: 0x41 prefix + 20 address bytes + 4-byte double-SHA256 checksum\n const prefixed = Buffer.concat([Buffer.from([0x41]), Buffer.from(addressBytes)]);\n const hash1 = createHash(\"sha256\").update(prefixed).digest();\n const hash2 = createHash(\"sha256\").update(hash1).digest();\n const ra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AI,MAAM,WAAW,IAAI,aAAa;AAC5D,YAAQ,OAAO,KAAK,CAAC;AAAA,EACvB,CAAC;AACH;AAIO,SAAS,kBACd,QACA,OAC6C;AAC7C,QAAM,WAAW,cAAc,KAAK;AAEpC,MAAI,OAAO,SAAS,YAAY;AAC9B,QAAI,OAAO,UAAU,UAAU;AAC7B,YAAM,IAAI;AAAA,QACR,WAAW,OAAO,IAAI,sBAAsB,OAAO,KAAK,qBAAqB,KAAK;AAAA,MACpF;AAAA,IACF;AACA,WAAO;AAAA,MACL,YAAY,iBAAiB,OAAO,YAAY,QAAQ;AAAA,MACxD,SAAS,OAAO,UAAU,QAAQ;AAAA,IACpC;AAAA,EACF;AAEA,QAAM,UAAU,kBAAkB,OAAO,UAAU,QAAQ;AAC3D,SAAO,EAAE,YAAY,QAAQ,YAAY,SAAS,QAAQ,QAAQ;AACpE;AAEA,SAAS,iBAAiB,KAAa,OAA6B;AAClE,MAAI,UAAU,UAAU;AACtB,WAAOD,MAAK,OAAO,GAAG;AAAA,EACxB;AACA,QAAM,MAAM,IAAI,WAAW,IAAI,IAAI,IAAI,MAAM,CAAC,IAAI;AAClD,SAAO,WAAW,KAAK,OAAO,KAAK,KAAK,KAAK,CAAC;AAChD;","names":["randomBytes","z","z","randomBytes","bs58","randomBytes"]}
@@ -9,6 +9,7 @@ import {
9
9
  encrypt,
10
10
  encryptedFileSchema,
11
11
  ensureEncryptionKey,
12
+ expandAddresses,
12
13
  findWalletOrThrow,
13
14
  getEncryptionKey,
14
15
  keyChainSchema,
@@ -16,7 +17,7 @@ import {
16
17
  removeWallet,
17
18
  resolveSigningKey,
18
19
  walletInfoSchema
19
- } from "./chunk-GSAFAKB7.js";
20
+ } from "./chunk-AL5WDHLT.js";
20
21
 
21
22
  // src/auth.ts
22
23
  import * as fs from "fs";
@@ -339,6 +340,7 @@ var schemas_default = [
339
340
  properties: {
340
341
  email: {
341
342
  type: "string",
343
+ format: "email",
342
344
  description: "The email of the user to login"
343
345
  }
344
346
  },
@@ -3206,12 +3208,14 @@ var schemas_default = [
3206
3208
  description: "Blockchain to get trending tokens from (e.g. 'solana', 'ethereum', 'base')"
3207
3209
  },
3208
3210
  limit: {
3209
- type: "number",
3211
+ type: "integer",
3212
+ minimum: 1,
3210
3213
  description: "Number of results per page"
3211
3214
  },
3212
3215
  page: {
3213
- type: "number",
3214
- description: "The page number of results"
3216
+ type: "integer",
3217
+ minimum: 1,
3218
+ description: "Page number (starts at 1)"
3215
3219
  }
3216
3220
  },
3217
3221
  required: [
@@ -4743,10 +4747,12 @@ var schemas_default = [
4743
4747
  properties: {
4744
4748
  code: {
4745
4749
  type: "string",
4750
+ pattern: "^\\d{6}$",
4746
4751
  description: "The code to verify"
4747
4752
  },
4748
4753
  email: {
4749
4754
  type: "string",
4755
+ format: "email",
4750
4756
  description: "The email the OTP was sent to"
4751
4757
  }
4752
4758
  },
@@ -5889,7 +5895,7 @@ var walletCreate = createTool(walletCreateSchema, async (params) => {
5889
5895
  );
5890
5896
  }
5891
5897
  }
5892
- return { name: params.name, addresses };
5898
+ return { name: params.name, addresses: expandAddresses(addresses) };
5893
5899
  });
5894
5900
 
5895
5901
  // src/tools/wallet/import/tool.ts
@@ -5985,7 +5991,7 @@ var walletList = createTool(walletListSchema, async () => {
5985
5991
  return wallets.map((w) => ({
5986
5992
  name: w.name,
5987
5993
  type: w.type,
5988
- addresses: w.addresses,
5994
+ addresses: expandAddresses(w.addresses),
5989
5995
  createdAt: w.createdAt
5990
5996
  }));
5991
5997
  });
@@ -6007,7 +6013,7 @@ var walletRetrieve = createTool(walletRetrieveSchema, async (params) => {
6007
6013
  return {
6008
6014
  name: wallet.name,
6009
6015
  type: wallet.type,
6010
- addresses: wallet.addresses,
6016
+ addresses: expandAddresses(wallet.addresses),
6011
6017
  createdAt: wallet.createdAt
6012
6018
  };
6013
6019
  });
@@ -6302,7 +6308,7 @@ var bitcoinBalanceRetrieve = createTool(
6302
6308
  async (params) => {
6303
6309
  let address = params.wallet;
6304
6310
  if (!address.startsWith("bc1") && !address.startsWith("1") && !address.startsWith("3")) {
6305
- const { findWalletOrThrow: findWalletOrThrow2 } = await import("./store-UAGR3DWU.js");
6311
+ const { findWalletOrThrow: findWalletOrThrow2 } = await import("./store-QVVENVIP.js");
6306
6312
  const wallet = findWalletOrThrow2(address);
6307
6313
  const btcAddress = wallet.addresses.bitcoin;
6308
6314
  if (!btcAddress) {
@@ -6534,9 +6540,7 @@ function createLocalX402Client(walletAddress, secretKey) {
6534
6540
  `Wallet ${walletAddress} is not a signer for this transaction`
6535
6541
  );
6536
6542
  }
6537
- return {
6538
- [walletAddress]: tx.signatures[signerIndex]
6539
- };
6543
+ return { [walletAddress]: tx.signatures[signerIndex] };
6540
6544
  });
6541
6545
  }
6542
6546
  };
@@ -6652,4 +6656,4 @@ export {
6652
6656
  x402Request,
6653
6657
  virtualAccountWalletRegister
6654
6658
  };
6655
- //# sourceMappingURL=chunk-DCHEUKV7.js.map
6659
+ //# sourceMappingURL=chunk-P764SORF.js.map