x402-proxy 0.10.12 → 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-l8K03uWn.js → index.node-xc-jRJ78.js} +1 -1
  26. package/dist/{localBatchGatewayRequest-DOdQ9bR7.js → localBatchGatewayRequest-0gr8vzH3.js} +14 -2
  27. package/dist/{localBatchGatewayRequest-DQkbZaSy.js → localBatchGatewayRequest-CBsFXIAU.js} +2 -2
  28. package/dist/{localBatchGatewayRequest-C-RPJyDO.js → localBatchGatewayRequest-CPqqSJcB.js} +2 -2
  29. package/dist/{schemas-BxMFYNbH.js → schemas-DzZjufD1.js} +1 -1
  30. package/dist/{secp256k1-BZpiyffY.js → secp256k1-Bp7LcNvI.js} +2 -7
  31. package/dist/secp256k1-BsaSkXlH.js +2 -0
  32. package/dist/{secp256k1-BjenrLl5.js → secp256k1-BwSAYyif.js} +2 -2
  33. package/dist/secp256k1-CHAXu2gP.js +3 -0
  34. package/dist/{server-D2apWWY9.js → server-Dbsk9dql.js} +2 -2
  35. package/dist/setup-BdSfEdx4.js +3 -0
  36. package/dist/{setup-BY4J49Lv.js → setup-C10O8N36.js} +16 -33
  37. package/dist/{hmac-59IlS_by.js → sha2-XLg3s2a9.js} +81 -81
  38. package/dist/{sha256-FAs0qeni.js → sha256-DCLdwsRU.js} +1 -1
  39. package/dist/{sha3-DbMJRJ3C.js → sha3-03id956K.js} +1 -1
  40. package/dist/{sha3-CYkWM8Xa.js → sha3-VSia5eGE.js} +1 -1
  41. package/dist/{sse-qIEKrJEZ.js → sse-kba68iqF.js} +2 -2
  42. package/dist/status-B2xUewrq.js +3 -0
  43. package/dist/{status-CD_fCzGf.js → status-DjZdIeES.js} +2 -3
  44. package/dist/{stdio-BfDjLLnd.js → stdio-CdmkLt8r.js} +3 -3
  45. package/dist/{streamableHttp-BkayeoEQ.js → streamableHttp-DRntYTFN.js} +2 -2
  46. package/dist/{types-BmyZIQ8G.js → types-BQ17ZF7g.js} +1 -1
  47. package/dist/{types-DlqDf-zE.js → types-DH9rDVeP.js} +1 -1
  48. package/dist/{utils-SeGHMW9O.js → utils-psFtUKLa.js} +53 -53
  49. package/dist/wallet-BsCgqUun.js +3 -0
  50. package/dist/{wallet-C4RiduwM.js → wallet-CUCoLEqs.js} +179 -147
  51. package/package.json +1 -1
  52. package/dist/Mcp-CSyD7Hxz.js +0 -10
  53. package/dist/Sse-C-KDPYh0.js +0 -16482
  54. package/dist/accounts-DsuvWwph.js +0 -232
  55. package/dist/accounts-DzvAlQRn.js +0 -5
  56. package/dist/accounts-IG-Cmrwy.js +0 -229
  57. package/dist/chain-DwfP5RGZ.js +0 -1968
  58. package/dist/chunk-DBEY4PJZ.js +0 -16
  59. package/dist/client-1XQsO-Eh.js +0 -5152
  60. package/dist/client-Co7Fg1lv.js +0 -6388
  61. package/dist/config-BUQsit4s.js +0 -3
  62. package/dist/config-DR1Fs_wL.js +0 -6600
  63. package/dist/config-rvKA3SYT.js +0 -96
  64. package/dist/hashTypedData-BHmP9dBd.js +0 -859
  65. package/dist/http-BAtucMbS.js +0 -2060
  66. package/dist/isAddressEqual-BLrd1Hg1.js +0 -9
  67. package/dist/isAddressEqual-DsAqfQOD.js +0 -10
  68. package/dist/parseUnits-CApwcKSD.js +0 -49
  69. package/dist/parseUnits-cMO2udMe.js +0 -48
  70. package/dist/secp256k1-CLPUX17u.js +0 -3
  71. package/dist/setup-wMOAgrsN.js +0 -3
  72. package/dist/status-_TcPMyzr.js +0 -3
  73. package/dist/tempo-BcTkftHK.js +0 -17
  74. package/dist/tempo-Bs_aydgm.js +0 -18
  75. package/dist/wallet-BymEHYms.js +0 -3
  76. /package/dist/{api-CUzmQvTQ.js → api-B5mo8tpE.js} +0 -0
  77. /package/dist/{dist-C2YO6HSQ.js → dist-CvV4mGO6.js} +0 -0
  78. /package/dist/{index.node-DPDV8w2j.js → index.node-DCvOPMK7.js} +0 -0
  79. /package/dist/{utils-BYjkXZDF.js → utils-B1qOlJzL.js} +0 -0
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env node
2
- import { $ as toBytes, B as slice, C as InvalidStorageKeySizeError, Dt as BytesSizeMismatchError, G as isAddress, I as encodeAbiParameters, K as checksumAddress, M as stringify, Mt as BaseError, N as createCursor, Nt as size, Pt as isHex, R as bytesRegex, U as concat, W as concatHex, X as keccak256, Y as InvalidAddressError, Z as hexToBytes, a as InvalidChainIdError, b as InvalidSerializableTransactionError, c as FeeCapTooHighError, ct as trim, et as bytesToHex, g as TipAboveFeeCapError, o as maxUint256, rt as toHex, st as hexToNumber, tt as numberToHex, y as InvalidLegacyVError, z as integerRegex } from "./chain-CafcHffR.js";
3
- import { t as sha256$1 } from "./sha256-FAs0qeni.js";
2
+ import { t as sha256$1 } from "./sha256-DCLdwsRU.js";
3
+ import { t as secp256k1 } from "./secp256k1-BwSAYyif.js";
4
+ import { $ as toBytes, B as slice, C as InvalidStorageKeySizeError, Dt as BytesSizeMismatchError, G as isAddress, I as encodeAbiParameters, K as checksumAddress, M as stringify, Mt as BaseError, N as createCursor, Nt as size, Pt as isHex, R as bytesRegex, U as concat, W as concatHex, X as keccak256, Y as InvalidAddressError, Z as hexToBytes, a as InvalidChainIdError, at as hexToBigInt, b as InvalidSerializableTransactionError, c as FeeCapTooHighError, ct as trim, et as bytesToHex, g as TipAboveFeeCapError, nt as stringToHex, o as maxUint256, rt as toHex, st as hexToNumber, tt as numberToHex, y as InvalidLegacyVError, z as integerRegex } from "./chain-C_3Km9Dx.js";
4
5
  //#region node_modules/.pnpm/viem@2.47.6_typescript@5.9.3_zod@4.3.6/node_modules/viem/_esm/accounts/utils/publicKeyToAddress.js
5
6
  /**
6
7
  * @description Converts an ECDSA public key to an address.
@@ -621,6 +622,24 @@ function serializeAuthorizationList(authorizationList) {
621
622
  return serializedAuthorizationList;
622
623
  }
623
624
  //#endregion
625
+ //#region node_modules/.pnpm/viem@2.47.6_typescript@5.9.3_zod@4.3.6/node_modules/viem/_esm/constants/strings.js
626
+ const presignMessagePrefix = "Ethereum Signed Message:\n";
627
+ //#endregion
628
+ //#region node_modules/.pnpm/viem@2.47.6_typescript@5.9.3_zod@4.3.6/node_modules/viem/_esm/utils/signature/toPrefixedMessage.js
629
+ function toPrefixedMessage(message_) {
630
+ const message = (() => {
631
+ if (typeof message_ === "string") return stringToHex(message_);
632
+ if (typeof message_.raw === "string") return message_.raw;
633
+ return bytesToHex(message_.raw);
634
+ })();
635
+ return concat([stringToHex(`${presignMessagePrefix}${size(message)}`), message]);
636
+ }
637
+ //#endregion
638
+ //#region node_modules/.pnpm/viem@2.47.6_typescript@5.9.3_zod@4.3.6/node_modules/viem/_esm/utils/signature/hashMessage.js
639
+ function hashMessage(message, to_) {
640
+ return keccak256(toPrefixedMessage(message), to_);
641
+ }
642
+ //#endregion
624
643
  //#region node_modules/.pnpm/viem@2.47.6_typescript@5.9.3_zod@4.3.6/node_modules/viem/_esm/errors/typedData.js
625
644
  var InvalidDomainError = class extends BaseError {
626
645
  constructor({ domain }) {
@@ -843,4 +862,210 @@ function encodeField({ types, name, type, value }) {
843
862
  return [{ type }, value];
844
863
  }
845
864
  //#endregion
846
- export { toRlp as _, serializeTransaction as a, assertTransactionEIP4844 as c, getTransactionType as d, toBlobSidecars as f, hashAuthorization as g, blobsToCommitments as h, validateTypedData as i, assertTransactionEIP7702 as l, blobsToProofs as m, getTypesForEIP712Domain as n, assertTransactionEIP1559 as o, commitmentsToVersionedHashes as p, serializeTypedData as r, assertTransactionEIP2930 as s, hashTypedData as t, assertTransactionLegacy as u, publicKeyToAddress as v };
865
+ //#region node_modules/.pnpm/viem@2.47.6_typescript@5.9.3_zod@4.3.6/node_modules/viem/_esm/utils/signature/serializeSignature.js
866
+ /**
867
+ * @description Converts a signature into hex format.
868
+ *
869
+ * @param signature The signature to convert.
870
+ * @returns The signature in hex format.
871
+ *
872
+ * @example
873
+ * serializeSignature({
874
+ * r: '0x6e100a352ec6ad1b70802290e18aeed190704973570f3b8ed42cb9808e2ea6bf',
875
+ * s: '0x4a90a229a244495b41890987806fcbd2d5d23fc0dbe5f5256c2613c039d76db8',
876
+ * yParity: 1
877
+ * })
878
+ * // "0x6e100a352ec6ad1b70802290e18aeed190704973570f3b8ed42cb9808e2ea6bf4a90a229a244495b41890987806fcbd2d5d23fc0dbe5f5256c2613c039d76db81c"
879
+ */
880
+ function serializeSignature({ r, s, to = "hex", v, yParity }) {
881
+ const yParity_ = (() => {
882
+ if (yParity === 0 || yParity === 1) return yParity;
883
+ if (v && (v === 27n || v === 28n || v >= 35n)) return v % 2n === 0n ? 1 : 0;
884
+ throw new Error("Invalid `v` or `yParity` value");
885
+ })();
886
+ const signature = `0x${new secp256k1.Signature(hexToBigInt(r), hexToBigInt(s)).toCompactHex()}${yParity_ === 0 ? "1b" : "1c"}`;
887
+ if (to === "hex") return signature;
888
+ return hexToBytes(signature);
889
+ }
890
+ //#endregion
891
+ //#region node_modules/.pnpm/viem@2.47.6_typescript@5.9.3_zod@4.3.6/node_modules/viem/_esm/accounts/toAccount.js
892
+ /**
893
+ * @description Creates an Account from a custom signing implementation.
894
+ *
895
+ * @returns A Local Account.
896
+ */
897
+ function toAccount(source) {
898
+ if (typeof source === "string") {
899
+ if (!isAddress(source, { strict: false })) throw new InvalidAddressError({ address: source });
900
+ return {
901
+ address: source,
902
+ type: "json-rpc"
903
+ };
904
+ }
905
+ if (!isAddress(source.address, { strict: false })) throw new InvalidAddressError({ address: source.address });
906
+ return {
907
+ address: source.address,
908
+ nonceManager: source.nonceManager,
909
+ sign: source.sign,
910
+ signAuthorization: source.signAuthorization,
911
+ signMessage: source.signMessage,
912
+ signTransaction: source.signTransaction,
913
+ signTypedData: source.signTypedData,
914
+ source: "custom",
915
+ type: "local"
916
+ };
917
+ }
918
+ //#endregion
919
+ //#region node_modules/.pnpm/viem@2.47.6_typescript@5.9.3_zod@4.3.6/node_modules/viem/_esm/accounts/utils/sign.js
920
+ let extraEntropy = false;
921
+ /**
922
+ * @description Signs a hash with a given private key.
923
+ *
924
+ * @param hash The hash to sign.
925
+ * @param privateKey The private key to sign with.
926
+ *
927
+ * @returns The signature.
928
+ */
929
+ async function sign({ hash, privateKey, to = "object" }) {
930
+ const { r, s, recovery } = secp256k1.sign(hash.slice(2), privateKey.slice(2), {
931
+ lowS: true,
932
+ extraEntropy: isHex(extraEntropy, { strict: false }) ? hexToBytes(extraEntropy) : extraEntropy
933
+ });
934
+ const signature = {
935
+ r: numberToHex(r, { size: 32 }),
936
+ s: numberToHex(s, { size: 32 }),
937
+ v: recovery ? 28n : 27n,
938
+ yParity: recovery
939
+ };
940
+ return (() => {
941
+ if (to === "bytes" || to === "hex") return serializeSignature({
942
+ ...signature,
943
+ to
944
+ });
945
+ return signature;
946
+ })();
947
+ }
948
+ //#endregion
949
+ //#region node_modules/.pnpm/viem@2.47.6_typescript@5.9.3_zod@4.3.6/node_modules/viem/_esm/accounts/utils/signAuthorization.js
950
+ /**
951
+ * Signs an Authorization hash in [EIP-7702 format](https://eips.ethereum.org/EIPS/eip-7702): `keccak256('0x05' || rlp([chain_id, address, nonce]))`.
952
+ */
953
+ async function signAuthorization(parameters) {
954
+ const { chainId, nonce, privateKey, to = "object" } = parameters;
955
+ const address = parameters.contractAddress ?? parameters.address;
956
+ const signature = await sign({
957
+ hash: hashAuthorization({
958
+ address,
959
+ chainId,
960
+ nonce
961
+ }),
962
+ privateKey,
963
+ to
964
+ });
965
+ if (to === "object") return {
966
+ address,
967
+ chainId,
968
+ nonce,
969
+ ...signature
970
+ };
971
+ return signature;
972
+ }
973
+ //#endregion
974
+ //#region node_modules/.pnpm/viem@2.47.6_typescript@5.9.3_zod@4.3.6/node_modules/viem/_esm/accounts/utils/signMessage.js
975
+ /**
976
+ * @description Calculates an Ethereum-specific signature in [EIP-191 format](https://eips.ethereum.org/EIPS/eip-191):
977
+ * `keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))`.
978
+ *
979
+ * @returns The signature.
980
+ */
981
+ async function signMessage({ message, privateKey }) {
982
+ return await sign({
983
+ hash: hashMessage(message),
984
+ privateKey,
985
+ to: "hex"
986
+ });
987
+ }
988
+ //#endregion
989
+ //#region node_modules/.pnpm/viem@2.47.6_typescript@5.9.3_zod@4.3.6/node_modules/viem/_esm/accounts/utils/signTransaction.js
990
+ async function signTransaction(parameters) {
991
+ const { privateKey, transaction, serializer = serializeTransaction } = parameters;
992
+ return await serializer(transaction, await sign({
993
+ hash: keccak256(await serializer((() => {
994
+ if (transaction.type === "eip4844") return {
995
+ ...transaction,
996
+ sidecars: false
997
+ };
998
+ return transaction;
999
+ })())),
1000
+ privateKey
1001
+ }));
1002
+ }
1003
+ //#endregion
1004
+ //#region node_modules/.pnpm/viem@2.47.6_typescript@5.9.3_zod@4.3.6/node_modules/viem/_esm/accounts/utils/signTypedData.js
1005
+ /**
1006
+ * @description Signs typed data and calculates an Ethereum-specific signature in [https://eips.ethereum.org/EIPS/eip-712](https://eips.ethereum.org/EIPS/eip-712):
1007
+ * `sign(keccak256("\x19\x01" ‖ domainSeparator ‖ hashStruct(message)))`.
1008
+ *
1009
+ * @returns The signature.
1010
+ */
1011
+ async function signTypedData(parameters) {
1012
+ const { privateKey, ...typedData } = parameters;
1013
+ return await sign({
1014
+ hash: hashTypedData(typedData),
1015
+ privateKey,
1016
+ to: "hex"
1017
+ });
1018
+ }
1019
+ //#endregion
1020
+ //#region node_modules/.pnpm/viem@2.47.6_typescript@5.9.3_zod@4.3.6/node_modules/viem/_esm/accounts/privateKeyToAccount.js
1021
+ /**
1022
+ * @description Creates an Account from a private key.
1023
+ *
1024
+ * @returns A Private Key Account.
1025
+ */
1026
+ function privateKeyToAccount(privateKey, options = {}) {
1027
+ const { nonceManager } = options;
1028
+ const publicKey = toHex(secp256k1.getPublicKey(privateKey.slice(2), false));
1029
+ return {
1030
+ ...toAccount({
1031
+ address: publicKeyToAddress(publicKey),
1032
+ nonceManager,
1033
+ async sign({ hash }) {
1034
+ return sign({
1035
+ hash,
1036
+ privateKey,
1037
+ to: "hex"
1038
+ });
1039
+ },
1040
+ async signAuthorization(authorization) {
1041
+ return signAuthorization({
1042
+ ...authorization,
1043
+ privateKey
1044
+ });
1045
+ },
1046
+ async signMessage({ message }) {
1047
+ return signMessage({
1048
+ message,
1049
+ privateKey
1050
+ });
1051
+ },
1052
+ async signTransaction(transaction, { serializer } = {}) {
1053
+ return signTransaction({
1054
+ privateKey,
1055
+ transaction,
1056
+ serializer
1057
+ });
1058
+ },
1059
+ async signTypedData(typedData) {
1060
+ return signTypedData({
1061
+ ...typedData,
1062
+ privateKey
1063
+ });
1064
+ }
1065
+ }),
1066
+ publicKey,
1067
+ source: "privateKey"
1068
+ };
1069
+ }
1070
+ //#endregion
1071
+ export { blobsToProofs as C, publicKeyToAddress as D, toRlp as E, commitmentsToVersionedHashes as S, hashAuthorization as T, assertTransactionEIP4844 as _, signAuthorization as a, getTransactionType as b, serializeSignature as c, serializeTypedData as d, validateTypedData as f, assertTransactionEIP2930 as g, assertTransactionEIP1559 as h, signMessage as i, hashTypedData as l, serializeTransaction as m, signTypedData as n, sign as o, hashMessage as p, signTransaction as r, toAccount as s, privateKeyToAccount as t, getTypesForEIP712Domain as u, assertTransactionEIP7702 as v, blobsToCommitments as w, toBlobSidecars as x, assertTransactionLegacy as y };
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
- import { Wn as NEVER, c as _coercedNumber } from "./api-CUzmQvTQ.js";
3
- import { _ as string, a as array, b as url, d as looseObject, f as number$1, i as any, o as boolean, p as object, t as ZodNumber, u as literal } from "./schemas-BxMFYNbH.js";
4
- import { tt as LATEST_PROTOCOL_VERSION } from "./types-BmyZIQ8G.js";
2
+ import { Wn as NEVER, c as _coercedNumber } from "./api-B5mo8tpE.js";
3
+ import { _ as string, a as array, b as url, d as looseObject, f as number$1, i as any, o as boolean, p as object, t as ZodNumber, u as literal } from "./schemas-DzZjufD1.js";
4
+ import { tt as LATEST_PROTOCOL_VERSION } from "./types-BQ17ZF7g.js";
5
5
  //#region node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/compat.js
6
6
  /** @deprecated Use the raw string literal codes instead, e.g. "invalid_type". */
7
7
  const ZodIssueCode = {
package/dist/bin/cli.js CHANGED
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import { i as __toESM } from "../chunk-DjEMn6fM.js";
3
- import { c as buildCommand, i as base58, l as buildRouteMap, o as require_picocolors, s as buildApplication, u as run } from "../derive-DNUl8LU9.js";
4
- import { C as warn, S as success, _ as decodePaymentResponseHeader, b as info, c as resolveWallet, d as displayNetwork, f as formatAmount, g as wrapFetchWithPayment, h as readHistory, l as appendHistory, m as formatUsdcValue, n as fetchAllBalances, o as walletInfoCommand, p as formatTxLine, s as buildX402Client, u as calcSpend, v as dim, x as isTTY, y as error } from "../wallet-C4RiduwM.js";
5
- import { t as parseUnits } from "../parseUnits-CApwcKSD.js";
6
- import { a as getDebugLogPath, d as loadWalletFile, f as saveConfig, i as getConfigDirShort, l as isConfigured, n as ensureConfigDir, o as getHistoryPath, u as loadConfig } from "../config-rvKA3SYT.js";
7
- import { a as Nt, c as Wt, i as Jt, l as Ct, n as setupCommand, o as R, r as Gt, s as Rt, t as runSetup } from "../setup-BY4J49Lv.js";
8
- import { n as statusCommand } from "../status-CD_fCzGf.js";
3
+ import { C as run, S as buildRouteMap, _ as base58, a as getDebugLogPath, b as buildApplication, c as isConfigured, d as saveConfig, f as saveSession, i as getConfigDirShort, l as loadConfig, o as getHistoryPath, r as ensureConfigDir, t as clearSession, u as loadWalletFile, x as buildCommand, y as require_picocolors } from "../config-cyNyKO4-.js";
4
+ import { C as warn, S as success, _ as decodePaymentResponseHeader, b as info, c as resolveWallet, d as displayNetwork, f as formatAmount, g as wrapFetchWithPayment, h as readHistory, l as appendHistory, m as formatUsdcValue, n as fetchAllBalances, o as walletInfoCommand, p as formatTxLine, s as buildX402Client, u as calcSpend, v as dim, x as isTTY, y as error } from "../wallet-CUCoLEqs.js";
5
+ import { i as deserializeSessionReceipt, n as tempo, o as parseUnits, r as parseEvent, t as create } from "../client-DqtxTnu6.js";
6
+ import { t as privateKeyToAccount } from "../accounts-D9KsVVpJ.js";
7
+ import { a as Nt, c as Wt, i as Jt, l as Ct, n as setupCommand, o as R, r as Gt, s as Rt, t as runSetup } from "../setup-C10O8N36.js";
8
+ import { n as statusCommand } from "../status-DjZdIeES.js";
9
9
  import { dirname, join, normalize, resolve } from "node:path";
10
10
  import { spawn } from "node:child_process";
11
11
  import { once } from "node:events";
@@ -215,20 +215,15 @@ function parseVoucherHeadroom(value) {
215
215
  }
216
216
  /**
217
217
  * Create an MPP proxy handler using mppx client.
218
- * Dynamically imports mppx/client to keep startup fast.
219
218
  */
220
219
  async function createMppProxyHandler(opts) {
221
- const { Mppx, tempo } = await import("../client-1XQsO-Eh.js");
222
- const { Session } = await import("../tempo-Bs_aydgm.js");
223
- const { privateKeyToAccount } = await import("../accounts-DzvAlQRn.js");
224
- const { saveSession, clearSession } = await import("../config-BUQsit4s.js");
225
220
  const account = privateKeyToAccount(opts.evmKey);
226
221
  const maxDeposit = opts.maxDeposit ?? "1";
227
222
  const voucherHeadroomRaw = parseVoucherHeadroom(getMppVoucherHeadroomUsdc());
228
223
  const paymentQueue = [];
229
224
  let lastChallengeAmount;
230
225
  const debug = isDebugEnabled();
231
- const mppx = Mppx.create({
226
+ const mppx = create({
232
227
  methods: [tempo({
233
228
  account,
234
229
  maxDeposit
@@ -332,7 +327,7 @@ async function createMppProxyHandler(opts) {
332
327
  })).headers.get("Payment-Receipt");
333
328
  if (!receiptHeader) return void 0;
334
329
  try {
335
- const receipt = Session.Receipt.deserializeSessionReceipt(receiptHeader);
330
+ const receipt = deserializeSessionReceipt(receiptHeader);
336
331
  spent = spent > BigInt(receipt.spent) ? spent : BigInt(receipt.spent);
337
332
  return receipt;
338
333
  } catch {
@@ -340,7 +335,7 @@ async function createMppProxyHandler(opts) {
340
335
  }
341
336
  }
342
337
  };
343
- const sessionMppx = Mppx.create({
338
+ const sessionMppx = create({
344
339
  methods: [tempo({
345
340
  account,
346
341
  maxDeposit,
@@ -394,7 +389,7 @@ async function createMppProxyHandler(opts) {
394
389
  buffer = parts.pop() ?? "";
395
390
  for (const part of parts) {
396
391
  if (!part.trim()) continue;
397
- const event = Session.Sse.parseEvent(part);
392
+ const event = parseEvent(part);
398
393
  if (!event) continue;
399
394
  switch (event.type) {
400
395
  case "message":
@@ -429,7 +424,7 @@ async function createMppProxyHandler(opts) {
429
424
  }
430
425
  const receiptHeader = voucherResponse.headers.get("Payment-Receipt");
431
426
  if (receiptHeader) try {
432
- const receipt = Session.Receipt.deserializeSessionReceipt(receiptHeader);
427
+ const receipt = deserializeSessionReceipt(receiptHeader);
433
428
  spent = spent > BigInt(receipt.spent) ? spent : BigInt(receipt.spent);
434
429
  } catch {}
435
430
  break;
@@ -1189,7 +1184,7 @@ async function resolveWalletForServe(flags) {
1189
1184
  solanaKey: flags.solanaKey
1190
1185
  });
1191
1186
  if (wallet.source !== "none") return wallet;
1192
- const { runSetup } = await import("../setup-wMOAgrsN.js");
1187
+ const { runSetup } = await import("../setup-BdSfEdx4.js");
1193
1188
  if (isTTY()) {
1194
1189
  dim(" No wallet found. Let's set one up first.\n");
1195
1190
  await runSetup();
@@ -1328,9 +1323,9 @@ const serveCommand = buildCommand({
1328
1323
  fullDescription: `Start a local HTTP proxy that forwards inference requests upstream and auto-pays x402 or MPP 402 challenges.
1329
1324
 
1330
1325
  Examples:
1331
- $ x402-proxy serve
1332
- $ x402-proxy serve --port 8402
1333
- $ x402-proxy serve https://surf.cascade.fyi/api/v1/inference --protocol mpp`
1326
+ $ npx x402-proxy serve
1327
+ $ npx x402-proxy serve --port 8402
1328
+ $ npx x402-proxy serve https://surf.cascade.fyi/api/v1/inference --protocol mpp`
1334
1329
  },
1335
1330
  parameters: {
1336
1331
  flags: {
@@ -1411,10 +1406,10 @@ ANTHROPIC_BASE_URL pointed at it. All inference requests go through
1411
1406
  the proxy, which handles payments automatically via MPP.
1412
1407
 
1413
1408
  Usage:
1414
- $ x402-proxy claude Start with default model
1415
- $ x402-proxy claude --model z-ai/glm-5 Use a specific model
1416
- $ x402-proxy claude -- --print "explain this" Pass args to Claude Code
1417
- $ x402-proxy claude -- -p "summarize *.ts" Print mode (non-interactive)
1409
+ $ npx x402-proxy claude Start with default model
1410
+ $ npx x402-proxy claude --model z-ai/glm-5 Use a specific model
1411
+ $ npx x402-proxy claude -- --print "explain this" Pass args to Claude Code
1412
+ $ npx x402-proxy claude -- -p "summarize *.ts" Print mode (non-interactive)
1418
1413
 
1419
1414
  Available models (via surf.cascade.fyi):
1420
1415
  ${modelList}
@@ -1687,9 +1682,9 @@ const fetchCommand = buildCommand({
1687
1682
  fullDescription: `Make a paid HTTP request. Payment is automatic when the server returns 402.
1688
1683
 
1689
1684
  Examples:
1690
- $ x402-proxy -X POST -d '{"ref":"CoinbaseDev"}' https://surf.cascade.fyi/api/v1/twitter/user
1691
- $ x402-proxy -X POST -d '{"url":"https://x402.org"}' https://surf.cascade.fyi/api/v1/web/crawl
1692
- $ x402-proxy https://api.example.com/data | jq '.results'`
1685
+ $ npx x402-proxy https://surf.cascade.fyi/api/v1/twitter/user/openclaw
1686
+ $ npx x402-proxy -X POST -d '{"url":"https://x402.org"}' https://surf.cascade.fyi/api/v1/web/crawl
1687
+ $ npx x402-proxy https://api.example.com/data | jq '.results'`
1693
1688
  },
1694
1689
  parameters: {
1695
1690
  flags: {
@@ -1775,7 +1770,7 @@ Examples:
1775
1770
  };
1776
1771
  if (!url) {
1777
1772
  if (isConfigured()) {
1778
- const { displayStatus } = await import("../status-_TcPMyzr.js");
1773
+ const { displayStatus } = await import("../status-B2xUewrq.js");
1779
1774
  await displayStatus();
1780
1775
  console.log();
1781
1776
  console.log(import_picocolors.default.dim(" Commands:"));
@@ -1787,7 +1782,7 @@ Examples:
1787
1782
  console.log(` ${import_picocolors.default.cyan("$ npx x402-proxy wallet")} Addresses and balances`);
1788
1783
  console.log(` ${import_picocolors.default.cyan("$ npx x402-proxy wallet history")} Full payment history`);
1789
1784
  console.log();
1790
- console.log(import_picocolors.default.dim(" try: ") + import_picocolors.default.cyan(`$ npx x402-proxy -X POST -d '{"ref":"CoinbaseDev"}' https://surf.cascade.fyi/api/v1/twitter/user`));
1785
+ console.log(import_picocolors.default.dim(" try: ") + import_picocolors.default.cyan(`$ npx x402-proxy https://surf.cascade.fyi/api/v1/twitter/user/openclaw`));
1791
1786
  console.log();
1792
1787
  console.log(import_picocolors.default.dim(" https://github.com/cascade-protocol/x402-proxy"));
1793
1788
  console.log();
@@ -1830,7 +1825,7 @@ Examples:
1830
1825
  process.exit(1);
1831
1826
  }
1832
1827
  dim(" No wallet found. Let's set one up first.\n");
1833
- const { runSetup } = await import("../setup-wMOAgrsN.js");
1828
+ const { runSetup } = await import("../setup-BdSfEdx4.js");
1834
1829
  await runSetup();
1835
1830
  console.log();
1836
1831
  wallet = resolveWallet();
@@ -1843,7 +1838,7 @@ Examples:
1843
1838
  verbose(`protocol: ${resolvedProtocol ?? "auto-detect"}, maxDeposit: ${maxDeposit}`);
1844
1839
  let preferredNetwork = config?.defaultNetwork;
1845
1840
  if (!preferredNetwork && wallet.evmAddress && wallet.solanaAddress) {
1846
- const { fetchAllBalances } = await import("../wallet-BymEHYms.js");
1841
+ const { fetchAllBalances } = await import("../wallet-BsCgqUun.js");
1847
1842
  const balances = await fetchAllBalances(wallet.evmAddress, wallet.solanaAddress);
1848
1843
  const evmUsdc = balances.evm ? Number(balances.evm.usdc) : 0;
1849
1844
  const solUsdc = balances.sol ? Number(balances.sol.usdc) : 0;
@@ -2010,7 +2005,7 @@ Examples:
2010
2005
  const hasSolana = accepts.some((a) => a.network.startsWith("solana:"));
2011
2006
  const hasMpp = detected.mpp;
2012
2007
  const hasOther = accepts.some((a) => !a.network.startsWith("eip155:") && !a.network.startsWith("solana:"));
2013
- const { fetchAllBalances } = await import("../wallet-BymEHYms.js");
2008
+ const { fetchAllBalances } = await import("../wallet-BsCgqUun.js");
2014
2009
  const balances = await fetchAllBalances(wallet.evmAddress, wallet.solanaAddress);
2015
2010
  const evmUsdc = hasEvm && balances.evm ? Number(balances.evm.usdc) : 0;
2016
2011
  const solUsdc = hasSolana && balances.sol ? Number(balances.sol.usdc) : 0;
@@ -2263,7 +2258,7 @@ Wallet is auto-generated on first run. No env vars needed.`
2263
2258
  });
2264
2259
  if (wallet.source === "none") {
2265
2260
  dim("No wallet found. Auto-generating...");
2266
- const { runSetup } = await import("../setup-wMOAgrsN.js");
2261
+ const { runSetup } = await import("../setup-BdSfEdx4.js");
2267
2262
  await runSetup({ nonInteractive: true });
2268
2263
  const fresh = resolveWallet({
2269
2264
  evmKey: flags.evmKey,
@@ -2280,12 +2275,12 @@ Wallet is auto-generated on first run. No env vars needed.`
2280
2275
  if (wallet.solanaAddress) dim(` Solana: ${wallet.solanaAddress}`);
2281
2276
  const config = loadConfig();
2282
2277
  const resolvedProtocol = flags.protocol ?? config?.preferredProtocol ?? "x402";
2283
- const { Client } = await import("../client-DZV1cVsW.js");
2284
- const { SSEClientTransport } = await import("../sse-qIEKrJEZ.js");
2285
- const { StreamableHTTPClientTransport } = await import("../streamableHttp-BkayeoEQ.js");
2286
- const { Server } = await import("../server-D2apWWY9.js");
2287
- const { StdioServerTransport } = await import("../stdio-BfDjLLnd.js");
2288
- const { ListToolsRequestSchema, CallToolRequestSchema, ListResourcesRequestSchema, ReadResourceRequestSchema, ToolListChangedNotificationSchema, ResourceListChangedNotificationSchema } = await import("../types-DlqDf-zE.js");
2278
+ const { Client } = await import("../client-uAaF6lv2.js");
2279
+ const { SSEClientTransport } = await import("../sse-kba68iqF.js");
2280
+ const { StreamableHTTPClientTransport } = await import("../streamableHttp-DRntYTFN.js");
2281
+ const { Server } = await import("../server-Dbsk9dql.js");
2282
+ const { StdioServerTransport } = await import("../stdio-CdmkLt8r.js");
2283
+ const { ListToolsRequestSchema, CallToolRequestSchema, ListResourcesRequestSchema, ReadResourceRequestSchema, ToolListChangedNotificationSchema, ResourceListChangedNotificationSchema } = await import("../types-DH9rDVeP.js");
2289
2284
  async function connectTransport(target) {
2290
2285
  try {
2291
2286
  const transport = new StreamableHTTPClientTransport(new URL(remoteUrl));
@@ -2307,7 +2302,7 @@ Wallet is auto-generated on first run. No env vars needed.`
2307
2302
  async function startX402Proxy() {
2308
2303
  let preferredNetwork = config?.defaultNetwork;
2309
2304
  if (!preferredNetwork && wallet.evmAddress && wallet.solanaAddress) {
2310
- const { fetchAllBalances } = await import("../wallet-BymEHYms.js");
2305
+ const { fetchAllBalances } = await import("../wallet-BsCgqUun.js");
2311
2306
  const balances = await fetchAllBalances(wallet.evmAddress, wallet.solanaAddress);
2312
2307
  const evmUsdc = balances.evm ? Number(balances.evm.usdc) : 0;
2313
2308
  const solUsdc = balances.sol ? Number(balances.sol.usdc) : 0;
@@ -2326,7 +2321,7 @@ Wallet is auto-generated on first run. No env vars needed.`
2326
2321
  }
2327
2322
  const remoteClient = new Client({
2328
2323
  name: "x402-proxy",
2329
- version: "0.10.12"
2324
+ version: "0.11.0"
2330
2325
  });
2331
2326
  await connectTransport(remoteClient);
2332
2327
  function recordX402Payment(ctx) {
@@ -2357,7 +2352,7 @@ Wallet is auto-generated on first run. No env vars needed.`
2357
2352
  }
2358
2353
  const localServer = new Server({
2359
2354
  name: "x402-proxy",
2360
- version: "0.10.12"
2355
+ version: "0.11.0"
2361
2356
  }, { capabilities: {
2362
2357
  tools: tools.length > 0 ? {} : void 0,
2363
2358
  resources: remoteResources.length > 0 ? {} : void 0
@@ -2411,9 +2406,9 @@ Wallet is auto-generated on first run. No env vars needed.`
2411
2406
  error("MPP requires an EVM wallet. Configure one with: npx x402-proxy setup");
2412
2407
  process.exit(1);
2413
2408
  }
2414
- const { tempo } = await import("../client-1XQsO-Eh.js");
2415
- const { McpClient } = await import("../client-Bcl2uC6u.js");
2416
- const { privateKeyToAccount } = await import("../accounts-DzvAlQRn.js");
2409
+ const { tempo } = await import("../client-DuqEc8Iw.js");
2410
+ const { McpClient } = await import("../client-C2DwSbYN.js");
2411
+ const { privateKeyToAccount } = await import("../accounts-D5u2KBgr.js");
2417
2412
  const account = privateKeyToAccount(wallet.evmKey);
2418
2413
  const maxDeposit = config?.mppSessionBudget ?? "1";
2419
2414
  let lastChallengeAmount;
@@ -2430,7 +2425,7 @@ Wallet is auto-generated on first run. No env vars needed.`
2430
2425
  }));
2431
2426
  const remoteClient = new Client({
2432
2427
  name: "x402-proxy",
2433
- version: "0.10.12"
2428
+ version: "0.11.0"
2434
2429
  });
2435
2430
  await connectTransport(remoteClient);
2436
2431
  const mppClient = McpClient.wrap(remoteClient, { methods: wrappedMethods });
@@ -2445,7 +2440,7 @@ Wallet is auto-generated on first run. No env vars needed.`
2445
2440
  }
2446
2441
  const localServer = new Server({
2447
2442
  name: "x402-proxy",
2448
- version: "0.10.12"
2443
+ version: "0.11.0"
2449
2444
  }, { capabilities: {
2450
2445
  tools: tools.length > 0 ? {} : void 0,
2451
2446
  resources: remoteResources.length > 0 ? {} : void 0
@@ -2574,7 +2569,7 @@ const mcpAddCommand = buildCommand({
2574
2569
  console.log();
2575
2570
  R.step(import_picocolors.default.cyan("Continuing MCP setup..."));
2576
2571
  }
2577
- const { generators, getAppIds, generateConfig, deepMerge } = await import("../dist-DxJCYyL5.js");
2572
+ const { generators, getAppIds, generateConfig, deepMerge } = await import("../dist-Cwt2qrTK.js");
2578
2573
  let clientId;
2579
2574
  if (flags.client) {
2580
2575
  const appIds = getAppIds();
@@ -2627,7 +2622,7 @@ const mcpAddCommand = buildCommand({
2627
2622
  });
2628
2623
  let existing;
2629
2624
  if (configFormat === "yaml") {
2630
- const { default: YAML } = await import("../dist-DM5_F3r5.js").then((m) => /* @__PURE__ */ __toESM(m.default, 1));
2625
+ const { default: YAML } = await import("../dist-CFt2UZ4W.js").then((m) => /* @__PURE__ */ __toESM(m.default, 1));
2631
2626
  if (existsSync(configPath)) {
2632
2627
  const raw = readFileSync(configPath, "utf-8").trim();
2633
2628
  existing = raw ? YAML.parse(raw) ?? {} : {};
@@ -2686,7 +2681,7 @@ const mcpAddCommand = buildCommand({
2686
2681
  }
2687
2682
  }
2688
2683
  R.step("Try your first request:");
2689
- R.message(` ${import_picocolors.default.cyan(`$ npx x402-proxy -X POST -d '{"ref":"CoinbaseDev"}' https://surf.cascade.fyi/api/v1/twitter/user`)}`);
2684
+ R.message(` ${import_picocolors.default.cyan(`$ npx x402-proxy https://surf.cascade.fyi/api/v1/twitter/user/openclaw`)}`);
2690
2685
  R.message(` ${import_picocolors.default.dim("Run")} ${import_picocolors.default.cyan("npx x402-proxy")} ${import_picocolors.default.dim("to see your wallet and balance")}`);
2691
2686
  Gt(import_picocolors.default.green(`MCP server ${import_picocolors.default.bold(serverName)} is ready to use!`));
2692
2687
  }
@@ -2831,7 +2826,7 @@ const app = buildApplication(buildRouteMap({
2831
2826
  docs: { brief: "curl for x402 paid APIs" }
2832
2827
  }), {
2833
2828
  name: "x402-proxy",
2834
- versionInfo: { currentVersion: "0.10.12" },
2829
+ versionInfo: { currentVersion: "0.11.0" },
2835
2830
  scanner: { caseStyle: "allow-kebab-for-camel" }
2836
2831
  });
2837
2832
  //#endregion