x402-proxy 0.10.11 → 0.11.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.
Files changed (79) hide show
  1. package/README.md +3 -3
  2. package/dist/{Credential-0iRzpJkF.js → Mcp-CKylLH8N.js} +209 -211
  3. package/dist/accounts-D5u2KBgr.js +4 -0
  4. package/dist/{hashTypedData-CtEdfx4y.js → accounts-D9KsVVpJ.js} +228 -3
  5. package/dist/{auth-J9VuNMoG.js → auth-CaCZiNCk.js} +3 -3
  6. package/dist/bin/cli.js +46 -51
  7. package/dist/{decodeFunctionData-JPOUdvil.js → call-CNxk2xpg.js} +2084 -144
  8. package/dist/{decodeFunctionData-DuFcwhC_.js → call-DdUUzMfg.js} +11 -16
  9. package/dist/{ccip-C6CQOJYv.js → ccip-Cc1Fdazz.js} +1 -1
  10. package/dist/{ccip-Bx-zoUCJ.js → ccip-IumNC20V.js} +13 -3
  11. package/dist/{ccip-C2k1DD1T.js → ccip-JDVib6lf.js} +1 -1
  12. package/dist/{ccip-RZzsZ5Mv.js → ccip-RzF9aX_O.js} +3 -4
  13. package/dist/{chain-CafcHffR.js → chain-C_3Km9Dx.js} +1 -1
  14. package/dist/{client-Bcl2uC6u.js → client-C2DwSbYN.js} +1 -2
  15. package/dist/{Sse-DGR-tH7K.js → client-DqtxTnu6.js} +10249 -6224
  16. package/dist/client-DuqEc8Iw.js +3 -0
  17. package/dist/{client-DZV1cVsW.js → client-uAaF6lv2.js} +2 -2
  18. package/dist/{derive-DNUl8LU9.js → config-cyNyKO4-.js} +1024 -919
  19. package/dist/{dist-DM5_F3r5.js → dist-CFt2UZ4W.js} +1 -1
  20. package/dist/{dist-DxJCYyL5.js → dist-Cwt2qrTK.js} +2 -2
  21. package/dist/{helpers-ChcFbdC0.js → helpers-DebIs_21.js} +2 -2
  22. package/dist/{sendRawTransactionSync-DvSkhZtW.js → http-J0KYM-2Y.js} +2186 -169
  23. package/dist/index.d.ts +0 -1
  24. package/dist/index.js +30107 -771
  25. package/dist/{index.node-CxkL0OFh.js → index.node-DCvOPMK7.js} +5 -57
  26. package/dist/{index.node-DvmeuZBj.js → index.node-xc-jRJ78.js} +1 -1
  27. package/dist/{localBatchGatewayRequest-DOdQ9bR7.js → localBatchGatewayRequest-0gr8vzH3.js} +14 -2
  28. package/dist/{localBatchGatewayRequest-DQkbZaSy.js → localBatchGatewayRequest-CBsFXIAU.js} +2 -2
  29. package/dist/{localBatchGatewayRequest-C-RPJyDO.js → localBatchGatewayRequest-CPqqSJcB.js} +2 -2
  30. package/dist/{schemas-BxMFYNbH.js → schemas-DzZjufD1.js} +1 -1
  31. package/dist/{secp256k1-BZpiyffY.js → secp256k1-Bp7LcNvI.js} +2 -7
  32. package/dist/secp256k1-BsaSkXlH.js +2 -0
  33. package/dist/{secp256k1-BjenrLl5.js → secp256k1-BwSAYyif.js} +2 -2
  34. package/dist/secp256k1-CHAXu2gP.js +3 -0
  35. package/dist/{server-D2apWWY9.js → server-Dbsk9dql.js} +2 -2
  36. package/dist/setup-BdSfEdx4.js +3 -0
  37. package/dist/{setup-BY4J49Lv.js → setup-C10O8N36.js} +16 -33
  38. package/dist/{hmac-59IlS_by.js → sha2-XLg3s2a9.js} +81 -81
  39. package/dist/{sha256-FAs0qeni.js → sha256-DCLdwsRU.js} +1 -1
  40. package/dist/{sha3-DbMJRJ3C.js → sha3-03id956K.js} +1 -1
  41. package/dist/{sha3-CYkWM8Xa.js → sha3-VSia5eGE.js} +1 -1
  42. package/dist/{sse-qIEKrJEZ.js → sse-kba68iqF.js} +2 -2
  43. package/dist/status-B2xUewrq.js +3 -0
  44. package/dist/{status-X21VnGUO.js → status-DjZdIeES.js} +2 -3
  45. package/dist/{stdio-BfDjLLnd.js → stdio-CdmkLt8r.js} +3 -3
  46. package/dist/{streamableHttp-BkayeoEQ.js → streamableHttp-DRntYTFN.js} +2 -2
  47. package/dist/{types-BmyZIQ8G.js → types-BQ17ZF7g.js} +1 -1
  48. package/dist/{types-DlqDf-zE.js → types-DH9rDVeP.js} +1 -1
  49. package/dist/{utils-SeGHMW9O.js → utils-psFtUKLa.js} +53 -53
  50. package/dist/wallet-BsCgqUun.js +3 -0
  51. package/dist/{wallet-DSyht15_.js → wallet-CUCoLEqs.js} +192 -148
  52. package/package.json +1 -1
  53. package/dist/Mcp-CSyD7Hxz.js +0 -10
  54. package/dist/Sse-C-KDPYh0.js +0 -16482
  55. package/dist/accounts-DsuvWwph.js +0 -232
  56. package/dist/accounts-DzvAlQRn.js +0 -5
  57. package/dist/accounts-IG-Cmrwy.js +0 -229
  58. package/dist/chain-DwfP5RGZ.js +0 -1968
  59. package/dist/chunk-DBEY4PJZ.js +0 -16
  60. package/dist/client-1XQsO-Eh.js +0 -5152
  61. package/dist/client-Co7Fg1lv.js +0 -6388
  62. package/dist/config-BUQsit4s.js +0 -3
  63. package/dist/config-DR1Fs_wL.js +0 -6600
  64. package/dist/config-rvKA3SYT.js +0 -96
  65. package/dist/hashTypedData-BHmP9dBd.js +0 -859
  66. package/dist/http-BAtucMbS.js +0 -2060
  67. package/dist/isAddressEqual-BLrd1Hg1.js +0 -9
  68. package/dist/isAddressEqual-DsAqfQOD.js +0 -10
  69. package/dist/parseUnits-CApwcKSD.js +0 -49
  70. package/dist/parseUnits-cMO2udMe.js +0 -48
  71. package/dist/secp256k1-CLPUX17u.js +0 -3
  72. package/dist/setup-wMOAgrsN.js +0 -3
  73. package/dist/status-Bu23RjW6.js +0 -3
  74. package/dist/tempo-BcTkftHK.js +0 -17
  75. package/dist/tempo-Bs_aydgm.js +0 -18
  76. package/dist/wallet-DKVlrR1S.js +0 -3
  77. /package/dist/{api-CUzmQvTQ.js → api-B5mo8tpE.js} +0 -0
  78. /package/dist/{dist-C2YO6HSQ.js → dist-CvV4mGO6.js} +0 -0
  79. /package/dist/{utils-BYjkXZDF.js → utils-B1qOlJzL.js} +0 -0
@@ -1,96 +0,0 @@
1
- #!/usr/bin/env node
2
- import { i as __toESM } from "./chunk-DjEMn6fM.js";
3
- import { t as require_dist } from "./dist-C2YO6HSQ.js";
4
- import path from "node:path";
5
- import fs from "node:fs";
6
- import os from "node:os";
7
- //#region packages/x402-proxy/src/lib/config.ts
8
- var import_dist = /* @__PURE__ */ __toESM(require_dist(), 1);
9
- const APP_NAME = "x402-proxy";
10
- function getConfigDir() {
11
- const xdg = process.env.XDG_CONFIG_HOME || path.join(os.homedir(), ".config");
12
- return path.join(xdg, APP_NAME);
13
- }
14
- /** Config dir with $HOME replaced by ~ for display */
15
- function getConfigDirShort() {
16
- const dir = getConfigDir();
17
- const home = os.homedir();
18
- return dir.startsWith(home) ? `~${dir.slice(home.length)}` : dir;
19
- }
20
- function getWalletPath() {
21
- return path.join(getConfigDir(), "wallet.json");
22
- }
23
- function getHistoryPath() {
24
- return path.join(getConfigDir(), "history.jsonl");
25
- }
26
- function getDebugLogPath() {
27
- return path.join(getConfigDir(), "debug.log");
28
- }
29
- function ensureConfigDir() {
30
- fs.mkdirSync(getConfigDir(), { recursive: true });
31
- }
32
- function loadWalletFile() {
33
- const p = getWalletPath();
34
- if (!fs.existsSync(p)) return null;
35
- try {
36
- const data = JSON.parse(fs.readFileSync(p, "utf-8"));
37
- if (data.version === 1 && typeof data.mnemonic === "string") return data;
38
- return null;
39
- } catch {
40
- return null;
41
- }
42
- }
43
- function saveWalletFile(wallet) {
44
- ensureConfigDir();
45
- fs.writeFileSync(getWalletPath(), JSON.stringify(wallet, null, 2), {
46
- mode: 384,
47
- encoding: "utf-8"
48
- });
49
- }
50
- function loadConfig() {
51
- const dir = getConfigDir();
52
- for (const name of [
53
- "config.yaml",
54
- "config.yml",
55
- "config.jsonc",
56
- "config.json"
57
- ]) {
58
- const p = path.join(dir, name);
59
- if (!fs.existsSync(p)) continue;
60
- try {
61
- const raw = fs.readFileSync(p, "utf-8");
62
- if (name.endsWith(".yaml") || name.endsWith(".yml")) return (0, import_dist.parse)(raw);
63
- if (name.endsWith(".jsonc")) {
64
- const stripped = raw.replace(/\/\/.*$/gm, "").replace(/\/\*[\s\S]*?\*\//g, "");
65
- return JSON.parse(stripped);
66
- }
67
- return JSON.parse(raw);
68
- } catch {}
69
- }
70
- return null;
71
- }
72
- function saveConfig(config) {
73
- ensureConfigDir();
74
- const p = path.join(getConfigDir(), "config.yaml");
75
- fs.writeFileSync(p, (0, import_dist.stringify)(config), "utf-8");
76
- }
77
- function getSessionPath() {
78
- return path.join(getConfigDir(), "session.json");
79
- }
80
- function saveSession(session) {
81
- ensureConfigDir();
82
- fs.writeFileSync(getSessionPath(), JSON.stringify(session, null, 2), "utf-8");
83
- }
84
- function clearSession() {
85
- try {
86
- fs.unlinkSync(getSessionPath());
87
- } catch {}
88
- }
89
- function isConfigured() {
90
- if (process.env.X402_PROXY_WALLET_MNEMONIC) return true;
91
- if (process.env.X402_PROXY_WALLET_EVM_KEY) return true;
92
- if (process.env.X402_PROXY_WALLET_SOLANA_KEY) return true;
93
- return loadWalletFile() !== null;
94
- }
95
- //#endregion
96
- export { getDebugLogPath as a, getWalletPath as c, loadWalletFile as d, saveConfig as f, getConfigDirShort as i, isConfigured as l, saveWalletFile as m, ensureConfigDir as n, getHistoryPath as o, saveSession as p, getConfigDir as r, getSessionPath as s, clearSession as t, loadConfig as u };