tenjin-cli 0.1.0-alpha.30 → 0.1.0-alpha.32
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/README.md +65 -116
- package/dist/{_esm-CE7KNONL.js → _esm-RLLC72MS.js} +127 -131
- package/dist/alive-MROUMFH3.js +38 -0
- package/dist/auto-update-OPWMRZLS.js +22 -0
- package/dist/{ccip-7RMRLAGV.js → ccip-DHDFKTQV.js} +2 -2
- package/dist/chunk-2GNOFONN.js +560 -0
- package/dist/chunk-2GNOFONN.js.map +1 -0
- package/dist/{chunk-TTNESUPQ.js → chunk-2GP3HRYK.js} +2120 -193
- package/dist/chunk-2GP3HRYK.js.map +1 -0
- package/dist/chunk-3623BLPV.js +184 -0
- package/dist/chunk-3623BLPV.js.map +1 -0
- package/dist/chunk-3AIHRXKO.js +72 -0
- package/dist/chunk-3AIHRXKO.js.map +1 -0
- package/dist/chunk-3DIL66VX.js +120 -0
- package/dist/chunk-3DIL66VX.js.map +1 -0
- package/dist/{chunk-S4SAZ7OD.js → chunk-3FMZGI7I.js} +12 -2
- package/dist/{chunk-S4SAZ7OD.js.map → chunk-3FMZGI7I.js.map} +1 -1
- package/dist/chunk-3UCIG4TG.js +65 -0
- package/dist/chunk-3UCIG4TG.js.map +1 -0
- package/dist/{chunk-LFZJM56J.js → chunk-445VQTVM.js} +3 -3
- package/dist/{chunk-A36LQPHV.js → chunk-4LMUQMBH.js} +1 -1
- package/dist/{chunk-A36LQPHV.js.map → chunk-4LMUQMBH.js.map} +1 -1
- package/dist/{chunk-RAULEAZ6.js → chunk-4USCZ2NI.js} +3 -3
- package/dist/chunk-62KNUYWD.js +111 -0
- package/dist/chunk-62KNUYWD.js.map +1 -0
- package/dist/{chunk-POUWHWID.js → chunk-6CMM6YCB.js} +3 -3
- package/dist/{chunk-POUWHWID.js.map → chunk-6CMM6YCB.js.map} +1 -1
- package/dist/chunk-7WEQQJLG.js +68 -0
- package/dist/chunk-7WEQQJLG.js.map +1 -0
- package/dist/{chunk-3O2BQIF6.js → chunk-AD226HDR.js} +344 -534
- package/dist/chunk-AD226HDR.js.map +1 -0
- package/dist/chunk-ADV4LDTB.js +106 -0
- package/dist/chunk-ADV4LDTB.js.map +1 -0
- package/dist/{chunk-AWFUPKTM.js → chunk-AV5NZMYO.js} +15 -7
- package/dist/{chunk-AWFUPKTM.js.map → chunk-AV5NZMYO.js.map} +1 -1
- package/dist/chunk-B7EM4GGF.js +198 -0
- package/dist/chunk-B7EM4GGF.js.map +1 -0
- package/dist/chunk-BFDQ4WNW.js +119 -0
- package/dist/chunk-BFDQ4WNW.js.map +1 -0
- package/dist/{chunk-OSYTBCUC.js → chunk-BI673VEJ.js} +531 -503
- package/dist/chunk-BI673VEJ.js.map +1 -0
- package/dist/chunk-CEXSOI5R.js +808 -0
- package/dist/chunk-CEXSOI5R.js.map +1 -0
- package/dist/{chunk-OK2TDZQU.js → chunk-CISYM4EO.js} +9 -7
- package/dist/chunk-CISYM4EO.js.map +1 -0
- package/dist/{chunk-VFMQTSXG.js → chunk-D3ZURCG7.js} +3 -3
- package/dist/chunk-D5TOQSO4.js +474 -0
- package/dist/chunk-D5TOQSO4.js.map +1 -0
- package/dist/{chunk-P7LABKCW.js → chunk-DOQGNFHM.js} +33 -2
- package/dist/{chunk-P7LABKCW.js.map → chunk-DOQGNFHM.js.map} +1 -1
- package/dist/{chunk-QUVVWYJW.js → chunk-DRDUIZIA.js} +11 -9
- package/dist/{chunk-QUVVWYJW.js.map → chunk-DRDUIZIA.js.map} +1 -1
- package/dist/{chunk-O2FRQ2L2.js → chunk-DW4YTVR3.js} +5 -65
- package/dist/chunk-DW4YTVR3.js.map +1 -0
- package/dist/chunk-E7LGOMH6.js +449 -0
- package/dist/chunk-E7LGOMH6.js.map +1 -0
- package/dist/chunk-E7SW44LM.js +138 -0
- package/dist/chunk-E7SW44LM.js.map +1 -0
- package/dist/chunk-EDJWHDDL.js +33 -0
- package/dist/chunk-EDJWHDDL.js.map +1 -0
- package/dist/chunk-F3ED5WTR.js +13 -0
- package/dist/chunk-F3ED5WTR.js.map +1 -0
- package/dist/chunk-G75OPGAK.js +111 -0
- package/dist/chunk-G75OPGAK.js.map +1 -0
- package/dist/{chunk-YFQOA5AU.js → chunk-GAKUQHKA.js} +13 -17
- package/dist/{chunk-YFQOA5AU.js.map → chunk-GAKUQHKA.js.map} +1 -1
- package/dist/{chunk-PAYV4XUA.js → chunk-HDPUXS3Z.js} +20 -49
- package/dist/chunk-HDPUXS3Z.js.map +1 -0
- package/dist/{chunk-ORWL5BSN.js → chunk-HGZEPQUT.js} +2 -2
- package/dist/{chunk-HPWO4O6S.js → chunk-HREHWL32.js} +4 -4
- package/dist/{chunk-HPWO4O6S.js.map → chunk-HREHWL32.js.map} +1 -1
- package/dist/{chunk-VZGAONSJ.js → chunk-I5TDIUKM.js} +16 -35
- package/dist/chunk-I5TDIUKM.js.map +1 -0
- package/dist/{chunk-7QKHZQKW.js → chunk-IADZOXKN.js} +39 -6
- package/dist/chunk-IADZOXKN.js.map +1 -0
- package/dist/{chunk-U6YQ6FRI.js → chunk-IDTRSAHE.js} +32 -12
- package/dist/chunk-IDTRSAHE.js.map +1 -0
- package/dist/{chunk-SPAVAYSW.js → chunk-JEVQ5LKO.js} +7 -5
- package/dist/{chunk-SPAVAYSW.js.map → chunk-JEVQ5LKO.js.map} +1 -1
- package/dist/{chunk-EBVIKMCH.js → chunk-JKKAIPTU.js} +2 -2
- package/dist/chunk-JNJWBTU2.js +3497 -0
- package/dist/chunk-JNJWBTU2.js.map +1 -0
- package/dist/{chunk-TTBKWWTV.js → chunk-JRZBBPO6.js} +390 -146
- package/dist/chunk-JRZBBPO6.js.map +1 -0
- package/dist/{chunk-WVUSXNIE.js → chunk-MPZUYCAP.js} +9 -2
- package/dist/{chunk-WVUSXNIE.js.map → chunk-MPZUYCAP.js.map} +1 -1
- package/dist/{chunk-SJLTEINJ.js → chunk-OJNTCYQQ.js} +17 -1
- package/dist/chunk-OJNTCYQQ.js.map +1 -0
- package/dist/{chunk-IOODYAXL.js → chunk-OTWLERSW.js} +25 -6
- package/dist/chunk-OTWLERSW.js.map +1 -0
- package/dist/{chunk-AWQPGIR6.js → chunk-PJNENX2A.js} +1535 -422
- package/dist/chunk-PJNENX2A.js.map +1 -0
- package/dist/{chunk-KHE6L6TD.js → chunk-PKHI276N.js} +97 -11
- package/dist/chunk-PKHI276N.js.map +1 -0
- package/dist/{chunk-YHKXNYTB.js → chunk-QF3LSMGS.js} +2 -2
- package/dist/chunk-QXP3Z3JN.js +131 -0
- package/dist/chunk-QXP3Z3JN.js.map +1 -0
- package/dist/{chunk-XZKD7DIF.js → chunk-RL5UUDT4.js} +3 -3
- package/dist/{chunk-XZKD7DIF.js.map → chunk-RL5UUDT4.js.map} +1 -1
- package/dist/chunk-SFASB5FL.js +69 -0
- package/dist/chunk-SFASB5FL.js.map +1 -0
- package/dist/{chunk-WO5BJNIB.js → chunk-SNNSAGMT.js} +7273 -2741
- package/dist/chunk-SNNSAGMT.js.map +1 -0
- package/dist/{chunk-NZIP4PA2.js → chunk-SO3XRZPX.js} +3 -3
- package/dist/chunk-SYOS5CAC.js +176 -0
- package/dist/chunk-SYOS5CAC.js.map +1 -0
- package/dist/chunk-TAW4UFFF.js +293 -0
- package/dist/chunk-TAW4UFFF.js.map +1 -0
- package/dist/chunk-TF5HCP33.js +271 -0
- package/dist/chunk-TF5HCP33.js.map +1 -0
- package/dist/{chunk-AKWGE6JQ.js → chunk-UUGOUOVT.js} +37 -2
- package/dist/chunk-UUGOUOVT.js.map +1 -0
- package/dist/{chunk-AEG2PXBP.js → chunk-V2LQLN5H.js} +7 -7
- package/dist/{chunk-KYFZTGMC.js → chunk-VJUVFZ2D.js} +5 -3
- package/dist/{chunk-KYFZTGMC.js.map → chunk-VJUVFZ2D.js.map} +1 -1
- package/dist/{chunk-JMM6YE7J.js → chunk-VOZA6O7K.js} +708 -709
- package/dist/chunk-VOZA6O7K.js.map +1 -0
- package/dist/{chunk-5LJCEMFD.js → chunk-VUGQTZ2L.js} +209 -77
- package/dist/chunk-VUGQTZ2L.js.map +1 -0
- package/dist/chunk-WOM257PW.js +393 -0
- package/dist/chunk-WOM257PW.js.map +1 -0
- package/dist/chunk-WYXUQGOL.js +191 -0
- package/dist/chunk-WYXUQGOL.js.map +1 -0
- package/dist/chunk-X5ZBP3IY.js +97 -0
- package/dist/chunk-X5ZBP3IY.js.map +1 -0
- package/dist/chunk-XQJXNMSB.js +23 -0
- package/dist/chunk-XQJXNMSB.js.map +1 -0
- package/dist/chunk-Y527D4TV.js +56 -0
- package/dist/chunk-Y527D4TV.js.map +1 -0
- package/dist/{chunk-VUFAK2LW.js → chunk-YUY4SAGM.js} +17 -2
- package/dist/chunk-YUY4SAGM.js.map +1 -0
- package/dist/clack-EZ7TDWQU.js +19 -0
- package/dist/claude-cli-2YKABJJZ.js +31 -0
- package/dist/{cli-O5SN7ZJ4.js → cli-FB4LOA5A.js} +221 -68
- package/dist/{cli-O5SN7ZJ4.js.map → cli-FB4LOA5A.js.map} +1 -1
- package/dist/codex-event-TYVES3UX.js +16 -0
- package/dist/codex-host-WW4H2SKT.js +29 -0
- package/dist/codex-install-2C623HPW.js +393 -0
- package/dist/codex-install-2C623HPW.js.map +1 -0
- package/dist/{config-OJQI27LT.js → config-HOVJFEKD.js} +25 -15
- package/dist/doctor-NKU4V5OV.js +1312 -0
- package/dist/doctor-NKU4V5OV.js.map +1 -0
- package/dist/{env-proxy-XL4P73MZ.js → env-proxy-R6ZMLQTT.js} +6 -2
- package/dist/{ethersCompat-Df4a6QIZ-THAVUGIJ.js → ethersCompat-Df4a6QIZ-X6YZWAML.js} +3 -3
- package/dist/{fund-WEV6DMTD.js → fund-WEBHTZGN.js} +38 -30
- package/dist/{fund-WEV6DMTD.js.map → fund-WEBHTZGN.js.map} +1 -1
- package/dist/hook-command-ZA2PNKS6.js +44 -0
- package/dist/hosts/claude/.claude-plugin/marketplace.json +2 -2
- package/dist/hosts/claude/tenjin/.claude-plugin/plugin.json +3 -2
- package/dist/hosts/claude/tenjin/hooks/hooks.json +4 -1
- package/dist/hosts/claude/tenjin/hooks/register.tsx +589 -0
- package/dist/hosts/claude/tenjin/skills/tenjin-pay/SKILL.md +82 -0
- package/dist/hosts/claude/tenjin/types/index.d.ts +41 -0
- package/dist/hosts/codex/.agents/plugins/marketplace.json +20 -0
- package/dist/hosts/codex/tenjin/.codex-plugin/plugin.json +16 -0
- package/dist/hosts/codex/tenjin/.mcp.json +15 -0
- package/dist/hosts/codex/tenjin/hooks/hooks.json +98 -0
- package/dist/hosts-AV5MHBAU.js +38 -0
- package/dist/index.js +28 -8
- package/dist/index.js.map +1 -1
- package/dist/install-PT4EZS4R.js +100 -0
- package/dist/{install-identity-WHPNMNMQ.js → install-identity-5A4OE6YC.js} +13 -8
- package/dist/install-wallet-SAAPKB73.js +281 -0
- package/dist/install-wallet-SAAPKB73.js.map +1 -0
- package/dist/{mcp-QML7ZMPH.js → mcp-HAWKCTPQ.js} +909 -208
- package/dist/mcp-HAWKCTPQ.js.map +1 -0
- package/dist/{mine.wasm-6PIT3DK6.js → mine.wasm-QFAHIFPY.js} +2 -2
- package/dist/{mine.wasm-6PIT3DK6.js.map → mine.wasm-QFAHIFPY.js.map} +1 -1
- package/dist/{package-LGKYOEPV.js → package-SR2WB6MK.js} +4 -2
- package/dist/passphrase-IFTDS3CU.js +44 -0
- package/dist/{paths-POPTXJO6.js → paths-XCSAKISU.js} +10 -2
- package/dist/pay-OXC3WKYV.js +55 -0
- package/dist/pay-OXC3WKYV.js.map +1 -0
- package/dist/{payments-C44QUFXU.js → payments-3KHMP2MG.js} +18 -13
- package/dist/{payments-C44QUFXU.js.map → payments-3KHMP2MG.js.map} +1 -1
- package/dist/plugin-registration-N3GRIZVM.js +67 -0
- package/dist/plugin-registration-N3GRIZVM.js.map +1 -0
- package/dist/{redact-6W23GGJC.js → redact-D7ASVWKL.js} +2 -2
- package/dist/redact-D7ASVWKL.js.map +1 -0
- package/dist/runtime-UVNUA3AS.js +1203 -0
- package/dist/runtime-UVNUA3AS.js.map +1 -0
- package/dist/runtime-fetch-EKFRNR6Z.js +20 -0
- package/dist/runtime-fetch-EKFRNR6Z.js.map +1 -0
- package/dist/runtime-layout-BDWZG2TQ.js +25 -0
- package/dist/runtime-layout-BDWZG2TQ.js.map +1 -0
- package/dist/{send-KVJX4XIR.js → send-HMKJLT34.js} +26 -18
- package/dist/{send-KVJX4XIR.js.map → send-HMKJLT34.js.map} +1 -1
- package/dist/{status-S7C3WMSH.js → status-RWXIIWYS.js} +57 -22
- package/dist/status-RWXIIWYS.js.map +1 -0
- package/dist/{status-line-YR2T5HC4.js → status-line-77XYZP7E.js} +13 -8
- package/dist/{status-line-YR2T5HC4.js.map → status-line-77XYZP7E.js.map} +1 -1
- package/dist/uninstall-D5G67UJH.js +480 -0
- package/dist/uninstall-D5G67UJH.js.map +1 -0
- package/dist/update-LRNOEGSB.js +53 -0
- package/dist/update-LRNOEGSB.js.map +1 -0
- package/dist/{usdc-JK4RRFFQ.js → usdc-D6X7EIQ2.js} +7 -8
- package/dist/usdc-D6X7EIQ2.js.map +1 -0
- package/dist/{viemAdapter-By13KInL-X2VY6CY3.js → viemAdapter-By13KInL-RL742ETX.js} +3 -3
- package/dist/viemAdapter-By13KInL-RL742ETX.js.map +1 -0
- package/dist/wallet-XFYC27BR.js +55 -0
- package/dist/wallet-XFYC27BR.js.map +1 -0
- package/dist/wallet-kdf-worker.mjs +8 -8
- package/docs/agent-permissions.md +56 -22
- package/docs/safety-model.md +1 -1
- package/docs/troubleshooting.md +72 -1
- package/package.json +14 -1
- package/dist/alive-3J3CHOQP.js +0 -21
- package/dist/ccip-NLCSCHKI.js +0 -19
- package/dist/chunk-3O2BQIF6.js.map +0 -1
- package/dist/chunk-5IEP5EGE.js +0 -5332
- package/dist/chunk-5IEP5EGE.js.map +0 -1
- package/dist/chunk-5LJCEMFD.js.map +0 -1
- package/dist/chunk-6W5GYG3W.js +0 -128
- package/dist/chunk-6W5GYG3W.js.map +0 -1
- package/dist/chunk-7EKYXMUO.js +0 -7536
- package/dist/chunk-7EKYXMUO.js.map +0 -1
- package/dist/chunk-7QKHZQKW.js.map +0 -1
- package/dist/chunk-AKWGE6JQ.js.map +0 -1
- package/dist/chunk-AWQPGIR6.js.map +0 -1
- package/dist/chunk-EGELTSPU.js +0 -2865
- package/dist/chunk-EGELTSPU.js.map +0 -1
- package/dist/chunk-EL56RW2J.js +0 -7611
- package/dist/chunk-EL56RW2J.js.map +0 -1
- package/dist/chunk-HE2MS4QO.js +0 -256
- package/dist/chunk-HE2MS4QO.js.map +0 -1
- package/dist/chunk-IOODYAXL.js.map +0 -1
- package/dist/chunk-JMM6YE7J.js.map +0 -1
- package/dist/chunk-KHE6L6TD.js.map +0 -1
- package/dist/chunk-N35E6CM2.js +0 -1185
- package/dist/chunk-N35E6CM2.js.map +0 -1
- package/dist/chunk-O2FRQ2L2.js.map +0 -1
- package/dist/chunk-OK2TDZQU.js.map +0 -1
- package/dist/chunk-OSYTBCUC.js.map +0 -1
- package/dist/chunk-PAYV4XUA.js.map +0 -1
- package/dist/chunk-SJLTEINJ.js.map +0 -1
- package/dist/chunk-TTBKWWTV.js.map +0 -1
- package/dist/chunk-TTNESUPQ.js.map +0 -1
- package/dist/chunk-U6YQ6FRI.js.map +0 -1
- package/dist/chunk-VUFAK2LW.js.map +0 -1
- package/dist/chunk-VZGAONSJ.js.map +0 -1
- package/dist/chunk-WO5BJNIB.js.map +0 -1
- package/dist/doctor-IQQJHGGM.js +0 -590
- package/dist/doctor-IQQJHGGM.js.map +0 -1
- package/dist/hook-command-D2P3ILRV.js +0 -32
- package/dist/install-TUCRF32I.js +0 -60
- package/dist/install-wallet-MA27FTQ5.js +0 -113
- package/dist/install-wallet-MA27FTQ5.js.map +0 -1
- package/dist/mcp-QML7ZMPH.js.map +0 -1
- package/dist/pay-2C2UBBXJ.js +0 -51
- package/dist/status-S7C3WMSH.js.map +0 -1
- package/dist/uninstall-HY6LKIIT.js +0 -149
- package/dist/uninstall-HY6LKIIT.js.map +0 -1
- package/dist/update-OJV22LR3.js +0 -36
- package/dist/wallet-PD2IMZDU.js +0 -39
- /package/dist/{_esm-CE7KNONL.js.map → _esm-RLLC72MS.js.map} +0 -0
- /package/dist/{alive-3J3CHOQP.js.map → alive-MROUMFH3.js.map} +0 -0
- /package/dist/{ccip-7RMRLAGV.js.map → auto-update-OPWMRZLS.js.map} +0 -0
- /package/dist/{ccip-NLCSCHKI.js.map → ccip-DHDFKTQV.js.map} +0 -0
- /package/dist/{chunk-LFZJM56J.js.map → chunk-445VQTVM.js.map} +0 -0
- /package/dist/{chunk-RAULEAZ6.js.map → chunk-4USCZ2NI.js.map} +0 -0
- /package/dist/{chunk-VFMQTSXG.js.map → chunk-D3ZURCG7.js.map} +0 -0
- /package/dist/{chunk-ORWL5BSN.js.map → chunk-HGZEPQUT.js.map} +0 -0
- /package/dist/{chunk-EBVIKMCH.js.map → chunk-JKKAIPTU.js.map} +0 -0
- /package/dist/{chunk-YHKXNYTB.js.map → chunk-QF3LSMGS.js.map} +0 -0
- /package/dist/{chunk-NZIP4PA2.js.map → chunk-SO3XRZPX.js.map} +0 -0
- /package/dist/{chunk-AEG2PXBP.js.map → chunk-V2LQLN5H.js.map} +0 -0
- /package/dist/{config-OJQI27LT.js.map → clack-EZ7TDWQU.js.map} +0 -0
- /package/dist/{env-proxy-XL4P73MZ.js.map → claude-cli-2YKABJJZ.js.map} +0 -0
- /package/dist/{ethersCompat-Df4a6QIZ-THAVUGIJ.js.map → codex-event-TYVES3UX.js.map} +0 -0
- /package/dist/{hook-command-D2P3ILRV.js.map → codex-host-WW4H2SKT.js.map} +0 -0
- /package/dist/{install-TUCRF32I.js.map → config-HOVJFEKD.js.map} +0 -0
- /package/dist/{install-identity-WHPNMNMQ.js.map → env-proxy-R6ZMLQTT.js.map} +0 -0
- /package/dist/{package-LGKYOEPV.js.map → ethersCompat-Df4a6QIZ-X6YZWAML.js.map} +0 -0
- /package/dist/{paths-POPTXJO6.js.map → hook-command-ZA2PNKS6.js.map} +0 -0
- /package/dist/{pay-2C2UBBXJ.js.map → hosts-AV5MHBAU.js.map} +0 -0
- /package/dist/{redact-6W23GGJC.js.map → install-PT4EZS4R.js.map} +0 -0
- /package/dist/{update-OJV22LR3.js.map → install-identity-5A4OE6YC.js.map} +0 -0
- /package/dist/{usdc-JK4RRFFQ.js.map → package-SR2WB6MK.js.map} +0 -0
- /package/dist/{viemAdapter-By13KInL-X2VY6CY3.js.map → passphrase-IFTDS3CU.js.map} +0 -0
- /package/dist/{wallet-PD2IMZDU.js.map → paths-XCSAKISU.js.map} +0 -0
|
@@ -17,16 +17,16 @@ import {
|
|
|
17
17
|
toComparableArray,
|
|
18
18
|
x402HTTPClient,
|
|
19
19
|
x402Version
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-JNJWBTU2.js";
|
|
21
21
|
import {
|
|
22
22
|
promptYesNo
|
|
23
23
|
} from "./chunk-LHHMV4GU.js";
|
|
24
24
|
import {
|
|
25
25
|
assertPublicDestination
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-JKKAIPTU.js";
|
|
27
27
|
import {
|
|
28
28
|
USDC_ADDRESS
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-GAKUQHKA.js";
|
|
30
30
|
import {
|
|
31
31
|
BATCH_SETTLEMENT_ADDRESS,
|
|
32
32
|
BATCH_SETTLEMENT_SCHEME,
|
|
@@ -46,65 +46,71 @@ import {
|
|
|
46
46
|
normalizeChannelId,
|
|
47
47
|
receiveAuthorizationTypes,
|
|
48
48
|
voucherTypes
|
|
49
|
-
} from "./chunk-
|
|
50
|
-
import {
|
|
51
|
-
createPublicClient,
|
|
52
|
-
http,
|
|
53
|
-
recoverTypedDataAddress
|
|
54
|
-
} from "./chunk-EL56RW2J.js";
|
|
49
|
+
} from "./chunk-445VQTVM.js";
|
|
55
50
|
import {
|
|
56
51
|
describeWallet,
|
|
57
52
|
resolveSpendAuthorizer,
|
|
58
53
|
resolveWalletProvider
|
|
59
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-BI673VEJ.js";
|
|
60
55
|
import {
|
|
61
56
|
readSpendSummary,
|
|
62
57
|
spentOf
|
|
63
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-SO3XRZPX.js";
|
|
64
59
|
import {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
toBytes
|
|
71
|
-
} from "./chunk-TTNESUPQ.js";
|
|
60
|
+
sanitizeForTerminal
|
|
61
|
+
} from "./chunk-VJUVFZ2D.js";
|
|
62
|
+
import {
|
|
63
|
+
evaluatePlan
|
|
64
|
+
} from "./chunk-2SNUOHAT.js";
|
|
72
65
|
import {
|
|
73
66
|
withFileLock
|
|
74
67
|
} from "./chunk-MEFB5KHA.js";
|
|
75
68
|
import {
|
|
76
|
-
|
|
77
|
-
|
|
69
|
+
fetchFailureToCliError,
|
|
70
|
+
httpRequest,
|
|
71
|
+
requestHeaderProblem
|
|
72
|
+
} from "./chunk-OTWLERSW.js";
|
|
78
73
|
import {
|
|
79
|
-
|
|
80
|
-
|
|
74
|
+
createPublicClient,
|
|
75
|
+
http,
|
|
76
|
+
recoverTypedDataAddress
|
|
77
|
+
} from "./chunk-PJNENX2A.js";
|
|
81
78
|
import {
|
|
82
|
-
|
|
83
|
-
|
|
79
|
+
encodeAbiParameters,
|
|
80
|
+
encodeFunctionData,
|
|
81
|
+
getAddress,
|
|
82
|
+
keccak256,
|
|
83
|
+
maxUint256,
|
|
84
|
+
toBytes
|
|
85
|
+
} from "./chunk-2GP3HRYK.js";
|
|
84
86
|
import {
|
|
85
87
|
mask
|
|
86
|
-
} from "./chunk-
|
|
87
|
-
import {
|
|
88
|
-
fetchFailureToCliError,
|
|
89
|
-
httpRequest
|
|
90
|
-
} from "./chunk-IOODYAXL.js";
|
|
88
|
+
} from "./chunk-IADZOXKN.js";
|
|
91
89
|
import {
|
|
92
90
|
resolveContextSettings
|
|
93
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-AV5NZMYO.js";
|
|
94
92
|
import {
|
|
95
|
-
CliError,
|
|
96
|
-
external_exports,
|
|
97
|
-
isSameDeployment,
|
|
98
93
|
parseUsdToAtomic,
|
|
99
94
|
toMoney
|
|
100
|
-
} from "./chunk-
|
|
95
|
+
} from "./chunk-Y527D4TV.js";
|
|
96
|
+
import {
|
|
97
|
+
readUsdcBalanceWithFallback
|
|
98
|
+
} from "./chunk-DW4YTVR3.js";
|
|
99
|
+
import {
|
|
100
|
+
isSameDeployment
|
|
101
|
+
} from "./chunk-XQJXNMSB.js";
|
|
102
|
+
import {
|
|
103
|
+
external_exports
|
|
104
|
+
} from "./chunk-SNNSAGMT.js";
|
|
101
105
|
import {
|
|
102
|
-
readUsdcBalanceWithFallback,
|
|
103
106
|
writeFileAtomic
|
|
104
|
-
} from "./chunk-
|
|
107
|
+
} from "./chunk-7WEQQJLG.js";
|
|
108
|
+
import {
|
|
109
|
+
CliError
|
|
110
|
+
} from "./chunk-3UCIG4TG.js";
|
|
105
111
|
import {
|
|
106
112
|
quotesDir
|
|
107
|
-
} from "./chunk-
|
|
113
|
+
} from "./chunk-OJNTCYQQ.js";
|
|
108
114
|
import {
|
|
109
115
|
__commonJS,
|
|
110
116
|
__toESM
|
|
@@ -8435,6 +8441,8 @@ async function ultravioletListings(registry, timeoutMs, query) {
|
|
|
8435
8441
|
function client(registry) {
|
|
8436
8442
|
return withBazaar(new HTTPFacilitatorClient({ url: registry }));
|
|
8437
8443
|
}
|
|
8444
|
+
var DeadlineError = class extends Error {
|
|
8445
|
+
};
|
|
8438
8446
|
async function withTimeout(work, timeoutMs, what) {
|
|
8439
8447
|
let timer;
|
|
8440
8448
|
try {
|
|
@@ -8442,7 +8450,7 @@ async function withTimeout(work, timeoutMs, what) {
|
|
|
8442
8450
|
work,
|
|
8443
8451
|
new Promise((_, reject) => {
|
|
8444
8452
|
timer = setTimeout(
|
|
8445
|
-
() => reject(new
|
|
8453
|
+
() => reject(new DeadlineError(`${what} timed out after ${timeoutMs}ms`)),
|
|
8446
8454
|
timeoutMs
|
|
8447
8455
|
);
|
|
8448
8456
|
})
|
|
@@ -8569,6 +8577,9 @@ async function verifyAgainstRegistries(registries, url, live, timeoutMs, opts =
|
|
|
8569
8577
|
}
|
|
8570
8578
|
} catch (err) {
|
|
8571
8579
|
errors.push({ registry, message: err instanceof Error ? err.message : String(err) });
|
|
8580
|
+
if (err instanceof DeadlineError || err instanceof Error && err.name === "TimeoutError") {
|
|
8581
|
+
break;
|
|
8582
|
+
}
|
|
8572
8583
|
}
|
|
8573
8584
|
}
|
|
8574
8585
|
if (mismatch !== void 0) return { outcome: "mismatch", ...mismatch };
|
|
@@ -10437,7 +10448,7 @@ var ERC20_APPROVAL_GAS_SPONSORING_KEY = "erc20ApprovalGasSponsoring";
|
|
|
10437
10448
|
var ERC20_APPROVAL_GAS_SPONSORING_VERSION = "1";
|
|
10438
10449
|
async function signEip2612Permit(signer, tokenAddress, tokenName, tokenVersion, chainId, deadline, permittedAmount) {
|
|
10439
10450
|
const owner = signer.address;
|
|
10440
|
-
const spender =
|
|
10451
|
+
const spender = getAddress(PERMIT2_ADDRESS);
|
|
10441
10452
|
const nonce = await signer.readContract({
|
|
10442
10453
|
address: tokenAddress,
|
|
10443
10454
|
abi: eip2612NoncesAbi,
|
|
@@ -10477,7 +10488,7 @@ async function signEip2612Permit(signer, tokenAddress, tokenName, tokenVersion,
|
|
|
10477
10488
|
}
|
|
10478
10489
|
async function signErc20ApprovalTransaction(signer, tokenAddress, chainId) {
|
|
10479
10490
|
const from = signer.address;
|
|
10480
|
-
const spender =
|
|
10491
|
+
const spender = getAddress(PERMIT2_ADDRESS);
|
|
10481
10492
|
const data = encodeFunctionData({
|
|
10482
10493
|
abi: erc20ApproveAbi,
|
|
10483
10494
|
functionName: "approve",
|
|
@@ -10583,7 +10594,7 @@ async function trySignEip2612PermitExtension(signer, options, requirements, resu
|
|
|
10583
10594
|
return void 0;
|
|
10584
10595
|
}
|
|
10585
10596
|
const chainId = getEvmChainId(requirements.network);
|
|
10586
|
-
const tokenAddress =
|
|
10597
|
+
const tokenAddress = getAddress(requirements.asset);
|
|
10587
10598
|
const requiredAllowance = approvalAmount ?? requirements.amount;
|
|
10588
10599
|
try {
|
|
10589
10600
|
const allowance = await capabilities.readContract({
|
|
@@ -10628,7 +10639,7 @@ async function trySignErc20ApprovalExtension(signer, options, requirements, cont
|
|
|
10628
10639
|
return void 0;
|
|
10629
10640
|
}
|
|
10630
10641
|
const chainId = getEvmChainId(requirements.network);
|
|
10631
|
-
const tokenAddress =
|
|
10642
|
+
const tokenAddress = getAddress(requirements.asset);
|
|
10632
10643
|
const requiredAllowance = approvalAmount ?? requirements.amount;
|
|
10633
10644
|
try {
|
|
10634
10645
|
const allowance = await capabilities.readContract({
|
|
@@ -10692,13 +10703,13 @@ async function createBatchSettlementEIP3009DepositPayload(signer, x402Version2,
|
|
|
10692
10703
|
name,
|
|
10693
10704
|
version,
|
|
10694
10705
|
chainId,
|
|
10695
|
-
verifyingContract:
|
|
10706
|
+
verifyingContract: getAddress(paymentRequirements.asset)
|
|
10696
10707
|
},
|
|
10697
10708
|
types: receiveAuthorizationTypes,
|
|
10698
10709
|
primaryType: "ReceiveWithAuthorization",
|
|
10699
10710
|
message: {
|
|
10700
|
-
from:
|
|
10701
|
-
to:
|
|
10711
|
+
from: getAddress(signer.address),
|
|
10712
|
+
to: getAddress(ERC3009_DEPOSIT_COLLECTOR_ADDRESS),
|
|
10702
10713
|
value: BigInt(depositAmount),
|
|
10703
10714
|
validAfter: BigInt(0),
|
|
10704
10715
|
validBefore: BigInt(now + paymentRequirements.maxTimeoutSeconds),
|
|
@@ -10835,16 +10846,16 @@ function depositAmountForRequest(policy, requestAmount, needed, extra, maxDeposi
|
|
|
10835
10846
|
function buildChannelConfig(deps, paymentRequirements) {
|
|
10836
10847
|
const extra = paymentRequirements.extra;
|
|
10837
10848
|
const receiverAuthorizer = extra?.receiverAuthorizer;
|
|
10838
|
-
if (!receiverAuthorizer ||
|
|
10849
|
+
if (!receiverAuthorizer || getAddress(receiverAuthorizer) === "0x0000000000000000000000000000000000000000") {
|
|
10839
10850
|
throw new Error("Payment requirements must include a non-zero extra.receiverAuthorizer");
|
|
10840
10851
|
}
|
|
10841
10852
|
return {
|
|
10842
10853
|
payer: deps.signer.address,
|
|
10843
|
-
payerAuthorizer:
|
|
10854
|
+
payerAuthorizer: getAddress(
|
|
10844
10855
|
deps.payerAuthorizer ?? deps.voucherSigner?.address ?? deps.signer.address
|
|
10845
10856
|
),
|
|
10846
10857
|
receiver: paymentRequirements.payTo,
|
|
10847
|
-
receiverAuthorizer:
|
|
10858
|
+
receiverAuthorizer: getAddress(receiverAuthorizer),
|
|
10848
10859
|
token: paymentRequirements.asset,
|
|
10849
10860
|
withdrawDelay: typeof extra?.withdrawDelay === "number" ? extra.withdrawDelay : MIN_WITHDRAW_DELAY,
|
|
10850
10861
|
salt: deps.salt
|
|
@@ -10977,7 +10988,7 @@ async function recoverFromSignature(deps, accept, channelState, voucherState) {
|
|
|
10977
10988
|
},
|
|
10978
10989
|
signature: sig
|
|
10979
10990
|
});
|
|
10980
|
-
const expectedSigner =
|
|
10991
|
+
const expectedSigner = getAddress(
|
|
10981
10992
|
deps.payerAuthorizer ?? deps.voucherSigner?.address ?? deps.signer.address
|
|
10982
10993
|
);
|
|
10983
10994
|
if (recovered.toLowerCase() !== expectedSigner.toLowerCase()) {
|
|
@@ -11215,10 +11226,10 @@ async function createBatchSettlementPermit2DepositPayload(signer, x402Version2,
|
|
|
11215
11226
|
const permit2Authorization = {
|
|
11216
11227
|
from: signer.address,
|
|
11217
11228
|
permitted: {
|
|
11218
|
-
token:
|
|
11229
|
+
token: getAddress(paymentRequirements.asset),
|
|
11219
11230
|
amount: depositAmount
|
|
11220
11231
|
},
|
|
11221
|
-
spender:
|
|
11232
|
+
spender: getAddress(PERMIT2_DEPOSIT_COLLECTOR_ADDRESS),
|
|
11222
11233
|
nonce,
|
|
11223
11234
|
deadline,
|
|
11224
11235
|
witness: {
|
|
@@ -11291,7 +11302,7 @@ var BatchSettlementEvmScheme = class {
|
|
|
11291
11302
|
this.payerAuthorizer = payerAuthorizer;
|
|
11292
11303
|
this.voucherSigner = voucherSigner;
|
|
11293
11304
|
this.extensionRpcOptions = extensionRpcOptions;
|
|
11294
|
-
if (payerAuthorizer !== void 0 && voucherSigner !== void 0 &&
|
|
11305
|
+
if (payerAuthorizer !== void 0 && voucherSigner !== void 0 && getAddress(payerAuthorizer) !== getAddress(voucherSigner.address)) {
|
|
11295
11306
|
throw new Error("payerAuthorizer address must match voucherSigner.address");
|
|
11296
11307
|
}
|
|
11297
11308
|
validateDepositPolicy(depositPolicy);
|
|
@@ -11532,14 +11543,14 @@ async function createPermit2PayloadForProxy(proxyAddress, signer, x402Version2,
|
|
|
11532
11543
|
const permit2Authorization = {
|
|
11533
11544
|
from: signer.address,
|
|
11534
11545
|
permitted: {
|
|
11535
|
-
token:
|
|
11546
|
+
token: getAddress(paymentRequirements.asset),
|
|
11536
11547
|
amount: paymentRequirements.amount
|
|
11537
11548
|
},
|
|
11538
11549
|
spender: proxyAddress,
|
|
11539
11550
|
nonce,
|
|
11540
11551
|
deadline,
|
|
11541
11552
|
witness: {
|
|
11542
|
-
to:
|
|
11553
|
+
to: getAddress(paymentRequirements.payTo),
|
|
11543
11554
|
validAfter
|
|
11544
11555
|
}
|
|
11545
11556
|
};
|
|
@@ -11561,14 +11572,14 @@ async function signPermit2Authorization(signer, permit2Authorization, requiremen
|
|
|
11561
11572
|
primaryType: "PermitWitnessTransferFrom",
|
|
11562
11573
|
message: {
|
|
11563
11574
|
permitted: {
|
|
11564
|
-
token:
|
|
11575
|
+
token: getAddress(permit2Authorization.permitted.token),
|
|
11565
11576
|
amount: BigInt(permit2Authorization.permitted.amount)
|
|
11566
11577
|
},
|
|
11567
|
-
spender:
|
|
11578
|
+
spender: getAddress(permit2Authorization.spender),
|
|
11568
11579
|
nonce: BigInt(permit2Authorization.nonce),
|
|
11569
11580
|
deadline: BigInt(permit2Authorization.deadline),
|
|
11570
11581
|
witness: {
|
|
11571
|
-
to:
|
|
11582
|
+
to: getAddress(permit2Authorization.witness.to),
|
|
11572
11583
|
validAfter: BigInt(permit2Authorization.witness.validAfter)
|
|
11573
11584
|
}
|
|
11574
11585
|
}
|
|
@@ -11592,7 +11603,7 @@ async function createEIP3009Payload(signer, x402Version2, paymentRequirements) {
|
|
|
11592
11603
|
const now = Math.floor(Date.now() / 1e3);
|
|
11593
11604
|
const authorization = {
|
|
11594
11605
|
from: signer.address,
|
|
11595
|
-
to:
|
|
11606
|
+
to: getAddress(paymentRequirements.payTo),
|
|
11596
11607
|
value: paymentRequirements.amount,
|
|
11597
11608
|
validAfter: "0",
|
|
11598
11609
|
validBefore: (now + paymentRequirements.maxTimeoutSeconds).toString(),
|
|
@@ -11620,11 +11631,11 @@ async function signEIP3009Authorization(signer, authorization, requirements) {
|
|
|
11620
11631
|
name,
|
|
11621
11632
|
version,
|
|
11622
11633
|
chainId,
|
|
11623
|
-
verifyingContract:
|
|
11634
|
+
verifyingContract: getAddress(requirements.asset)
|
|
11624
11635
|
};
|
|
11625
11636
|
const message = {
|
|
11626
|
-
from:
|
|
11627
|
-
to:
|
|
11637
|
+
from: getAddress(authorization.from),
|
|
11638
|
+
to: getAddress(authorization.to),
|
|
11628
11639
|
value: BigInt(authorization.value),
|
|
11629
11640
|
validAfter: BigInt(authorization.validAfter),
|
|
11630
11641
|
validBefore: BigInt(authorization.validBefore),
|
|
@@ -11825,15 +11836,16 @@ function createPayerClient(getSigner) {
|
|
|
11825
11836
|
core.registerExtension(builderCode);
|
|
11826
11837
|
return { core, http: new x402HTTPClient(core), builderCodeKey: builderCode.key };
|
|
11827
11838
|
}
|
|
11828
|
-
var canonicalUsdcOnly = (_version, requirements) => requirements.filter(
|
|
11829
|
-
|
|
11839
|
+
var canonicalUsdcOnly = (_version, requirements) => requirements.filter(isCanonicalUsdc);
|
|
11840
|
+
function isCanonicalUsdc(entry) {
|
|
11841
|
+
const allowed = ALLOWED_USDC_BY_NETWORK[entry.network];
|
|
11830
11842
|
if (allowed === void 0) return false;
|
|
11831
11843
|
try {
|
|
11832
|
-
return getAddress(
|
|
11844
|
+
return getAddress(entry.asset) === getAddress(allowed);
|
|
11833
11845
|
} catch {
|
|
11834
11846
|
return false;
|
|
11835
11847
|
}
|
|
11836
|
-
}
|
|
11848
|
+
}
|
|
11837
11849
|
function selectPayableRequirement(core, paymentRequired, want) {
|
|
11838
11850
|
const approved = supportedEntries(paymentRequired);
|
|
11839
11851
|
if (want === void 0) return sdkSelect(core, paymentRequired) ?? approved[0];
|
|
@@ -11962,8 +11974,13 @@ async function executePay(args, ctx, deps, warnings) {
|
|
|
11962
11974
|
const lane = resolveLane(url, settings);
|
|
11963
11975
|
if (lane === "bazaar") await assertPublicDestination(url, deps.destination ?? {});
|
|
11964
11976
|
const method = resolveMethod(args);
|
|
11965
|
-
const
|
|
11966
|
-
const
|
|
11977
|
+
const operator = operatorHeaders(args.header, args.dataRaw !== void 0);
|
|
11978
|
+
const body = resolveBody(args, operator);
|
|
11979
|
+
const headers = {
|
|
11980
|
+
...operator,
|
|
11981
|
+
...specHeaders(args.specHeaders),
|
|
11982
|
+
...callerHeaders(args.headers)
|
|
11983
|
+
};
|
|
11967
11984
|
const fetchOpts = {
|
|
11968
11985
|
timeoutMs: ctx.flags.timeout,
|
|
11969
11986
|
// Both legs: the probe's 402 is money-path input, and the paid retry
|
|
@@ -11971,8 +11988,7 @@ async function executePay(args, ctx, deps, warnings) {
|
|
|
11971
11988
|
// probe too, so the challenge always comes from the URL that was gated).
|
|
11972
11989
|
blockRedirects: true,
|
|
11973
11990
|
...deps.fetchImpl !== void 0 ? { fetchImpl: deps.fetchImpl } : {},
|
|
11974
|
-
...
|
|
11975
|
-
...jsonBody === void 0 && args.rawBody !== void 0 ? { rawBody: args.rawBody } : {},
|
|
11991
|
+
...body,
|
|
11976
11992
|
...Object.keys(headers).length > 0 ? { headers } : {},
|
|
11977
11993
|
// A router lookup can buy a file (a sound, an image): its bytes are kept
|
|
11978
11994
|
// whole for the tool to save, never decoded as text.
|
|
@@ -12008,6 +12024,9 @@ async function executePay(args, ctx, deps, warnings) {
|
|
|
12008
12024
|
const paymentRequired = decodeChallenge(probe, url);
|
|
12009
12025
|
const payer = createPayerClient(() => signerOrThrow(openedSigner));
|
|
12010
12026
|
const requirement = selectRequirement(payer.core, paymentRequired, args.terms);
|
|
12027
|
+
if (args.quote === true) {
|
|
12028
|
+
return deliverQuote(url, lane, probe, paymentRequired, requirement, args.printBody === true);
|
|
12029
|
+
}
|
|
12011
12030
|
if (requirement === void 0) {
|
|
12012
12031
|
throw noMatchingEntry(paymentRequired, args.terms);
|
|
12013
12032
|
}
|
|
@@ -12291,7 +12310,7 @@ async function quoteRouterCall(args, ctx, deps = {}) {
|
|
|
12291
12310
|
if (resolveLane(url, settings) === "bazaar") {
|
|
12292
12311
|
await assertPublicDestination(url, deps.destination ?? {});
|
|
12293
12312
|
}
|
|
12294
|
-
const headers = callerHeaders(args.headers);
|
|
12313
|
+
const headers = { ...specHeaders(args.specHeaders), ...callerHeaders(args.headers) };
|
|
12295
12314
|
const probe = await httpRequest(url, {
|
|
12296
12315
|
timeoutMs: ctx.flags.timeout,
|
|
12297
12316
|
blockRedirects: true,
|
|
@@ -12382,20 +12401,80 @@ function resolveLane(url, settings) {
|
|
|
12382
12401
|
}
|
|
12383
12402
|
return "bazaar";
|
|
12384
12403
|
}
|
|
12404
|
+
var METHODS = /* @__PURE__ */ new Set(["GET", "POST", "PUT", "PATCH", "DELETE"]);
|
|
12405
|
+
var BODY_METHODS = /* @__PURE__ */ new Set(["POST", "PUT", "PATCH"]);
|
|
12406
|
+
function hasBody(args) {
|
|
12407
|
+
return args.data !== void 0 || args.dataRaw !== void 0 || args.rawBody !== void 0;
|
|
12408
|
+
}
|
|
12385
12409
|
function resolveMethod(args) {
|
|
12386
|
-
const method = args.method?.toUpperCase() ?? (args
|
|
12387
|
-
if (method
|
|
12410
|
+
const method = args.method?.toUpperCase() ?? (hasBody(args) ? "POST" : "GET");
|
|
12411
|
+
if (!METHODS.has(method)) {
|
|
12388
12412
|
throw new CliError("USAGE", `Unsupported method ${JSON.stringify(args.method)}`, {
|
|
12389
|
-
fix: "Use -X GET or
|
|
12413
|
+
fix: "Use -X GET, POST, PUT, PATCH or DELETE."
|
|
12390
12414
|
});
|
|
12391
12415
|
}
|
|
12392
|
-
if (
|
|
12393
|
-
throw new CliError("USAGE", "A request body needs -X POST.", {
|
|
12394
|
-
fix: "Drop
|
|
12416
|
+
if (hasBody(args) && !BODY_METHODS.has(method)) {
|
|
12417
|
+
throw new CliError("USAGE", "A request body needs -X POST, PUT or PATCH.", {
|
|
12418
|
+
fix: "Drop the body, or pass -X POST, PUT or PATCH."
|
|
12395
12419
|
});
|
|
12396
12420
|
}
|
|
12397
12421
|
return method;
|
|
12398
12422
|
}
|
|
12423
|
+
function resolveBody(args, operator) {
|
|
12424
|
+
const given = [args.data, args.dataRaw, args.rawBody].filter((b) => b !== void 0);
|
|
12425
|
+
if (given.length > 1) {
|
|
12426
|
+
throw new CliError("USAGE", "Pass one request body: --data or --data-raw, not both.", {
|
|
12427
|
+
fix: "Use --data for a JSON body, or --data-raw with its own Content-Type."
|
|
12428
|
+
});
|
|
12429
|
+
}
|
|
12430
|
+
if (args.data !== void 0) return { jsonBody: parseBody(args.data) };
|
|
12431
|
+
if (args.dataRaw !== void 0) {
|
|
12432
|
+
if (operator["content-type"] === void 0) {
|
|
12433
|
+
throw new CliError("USAGE", "A --data-raw body needs its content type.", {
|
|
12434
|
+
fix: "Pass -H 'Content-Type: <type>' with --data-raw."
|
|
12435
|
+
});
|
|
12436
|
+
}
|
|
12437
|
+
return { rawBody: args.dataRaw };
|
|
12438
|
+
}
|
|
12439
|
+
return args.rawBody !== void 0 ? { rawBody: args.rawBody } : {};
|
|
12440
|
+
}
|
|
12441
|
+
function operatorHeaders(lines, rawBody) {
|
|
12442
|
+
if (lines === void 0) return {};
|
|
12443
|
+
const out = {};
|
|
12444
|
+
for (const line of lines) {
|
|
12445
|
+
const at = line.indexOf(":");
|
|
12446
|
+
const name = at > 0 ? line.slice(0, at).trim() : "";
|
|
12447
|
+
const value = at > 0 ? line.slice(at + 1).trim() : "";
|
|
12448
|
+
const problem = requestHeaderProblem(name, value, rawBody);
|
|
12449
|
+
if (problem === "name") {
|
|
12450
|
+
throw new CliError("USAGE", `Not a request header: ${JSON.stringify(line)}`, {
|
|
12451
|
+
fix: "Pass -H 'Name: value'."
|
|
12452
|
+
});
|
|
12453
|
+
}
|
|
12454
|
+
if (problem === "reserved") {
|
|
12455
|
+
throw new CliError("USAGE", `This command sets the header ${JSON.stringify(name)} itself.`, {
|
|
12456
|
+
fix: "Payment, sign-in, bypass and transport headers are never taken from -H. --data is always application/json; only --data-raw takes a Content-Type from -H."
|
|
12457
|
+
});
|
|
12458
|
+
}
|
|
12459
|
+
if (problem === "value") {
|
|
12460
|
+
throw new CliError(
|
|
12461
|
+
"USAGE",
|
|
12462
|
+
`The value of ${JSON.stringify(name)} is too long or spans lines.`,
|
|
12463
|
+
{
|
|
12464
|
+
fix: "Keep each -H value on one line, under 1,024 characters."
|
|
12465
|
+
}
|
|
12466
|
+
);
|
|
12467
|
+
}
|
|
12468
|
+
const lowered = name.toLowerCase();
|
|
12469
|
+
if (lowered in out) {
|
|
12470
|
+
throw new CliError("USAGE", `The header ${JSON.stringify(name)} was given twice.`, {
|
|
12471
|
+
fix: "Pass each header name once."
|
|
12472
|
+
});
|
|
12473
|
+
}
|
|
12474
|
+
out[lowered] = value;
|
|
12475
|
+
}
|
|
12476
|
+
return out;
|
|
12477
|
+
}
|
|
12399
12478
|
function callerHeaders(headers) {
|
|
12400
12479
|
if (headers === void 0) return {};
|
|
12401
12480
|
const allowed = /* @__PURE__ */ new Set(["accept", "content-type"]);
|
|
@@ -12415,6 +12494,23 @@ function callerHeaders(headers) {
|
|
|
12415
12494
|
}
|
|
12416
12495
|
return out;
|
|
12417
12496
|
}
|
|
12497
|
+
function specHeaders(headers) {
|
|
12498
|
+
if (headers === void 0) return {};
|
|
12499
|
+
const out = {};
|
|
12500
|
+
for (const [name, value] of Object.entries(headers)) {
|
|
12501
|
+
if (requestHeaderProblem(name, value) !== null) {
|
|
12502
|
+
throw new CliError(
|
|
12503
|
+
"USAGE",
|
|
12504
|
+
`This command will not send the header ${JSON.stringify(name)}.`,
|
|
12505
|
+
{
|
|
12506
|
+
fix: "A spec header is a bounded, single-line value, and never a payment, sign-in, bypass or transport header."
|
|
12507
|
+
}
|
|
12508
|
+
);
|
|
12509
|
+
}
|
|
12510
|
+
out[name.toLowerCase()] = value;
|
|
12511
|
+
}
|
|
12512
|
+
return out;
|
|
12513
|
+
}
|
|
12418
12514
|
function parseBody(data) {
|
|
12419
12515
|
if (data === void 0) return void 0;
|
|
12420
12516
|
try {
|
|
@@ -12581,6 +12677,42 @@ function warningMessage(warning) {
|
|
|
12581
12677
|
return `Registry warning: the live terms differ from ${warning.registry} (${warning.detail}).`;
|
|
12582
12678
|
}
|
|
12583
12679
|
}
|
|
12680
|
+
function deliverQuote(url, lane, res, challenge, chosen, printBody) {
|
|
12681
|
+
const chosenAt = chosen === void 0 ? -1 : challenge.accepts.findIndex((a) => sameDeal(a, chosen));
|
|
12682
|
+
const accepts = challenge.accepts.map((a, i) => ({
|
|
12683
|
+
scheme: a.scheme,
|
|
12684
|
+
network: a.network,
|
|
12685
|
+
asset: a.asset,
|
|
12686
|
+
amount: a.amount,
|
|
12687
|
+
...isCanonicalUsdc(a) ? { usd: toMoney(a.amount).usd } : {},
|
|
12688
|
+
...i === chosenAt ? { payable: true } : {},
|
|
12689
|
+
payTo: a.payTo,
|
|
12690
|
+
maxTimeoutSeconds: a.maxTimeoutSeconds,
|
|
12691
|
+
...a.extra !== void 0 ? { extra: a.extra } : {}
|
|
12692
|
+
}));
|
|
12693
|
+
const data = {
|
|
12694
|
+
url,
|
|
12695
|
+
lane,
|
|
12696
|
+
status: res.status,
|
|
12697
|
+
paid: false,
|
|
12698
|
+
quote: true,
|
|
12699
|
+
resource: challenge.resource,
|
|
12700
|
+
accepts,
|
|
12701
|
+
...challenge.extensions !== void 0 ? { extensions: challenge.extensions } : {},
|
|
12702
|
+
...res.json !== void 0 ? { body: res.json } : {},
|
|
12703
|
+
bodyText: res.text
|
|
12704
|
+
};
|
|
12705
|
+
const host = sanitizeForTerminal(new URL(url).host);
|
|
12706
|
+
const payable = accepts[chosenAt];
|
|
12707
|
+
const headline = payable?.usd !== void 0 ? `quote: ${payable.usd} USD to ${host} on ${sanitizeForTerminal(payable.network)} (nothing paid)` : accepts.length === 0 ? `quote: ${host} answered 402 with no payment option (nothing paid)` : `quote: ${host} lists no option this wallet can pay, only USDC on Base is supported (nothing paid)`;
|
|
12708
|
+
const body = sanitizeForTerminal(res.text);
|
|
12709
|
+
const preview2 = printBody || body.length <= BODY_PREVIEW_CHARS ? body : `${body.slice(0, BODY_PREVIEW_CHARS)}
|
|
12710
|
+
\u2026 truncated; run with --print-body or --json for the full body`;
|
|
12711
|
+
return { data, humanLines: [headline, ...preview2.length > 0 ? [preview2] : []] };
|
|
12712
|
+
}
|
|
12713
|
+
function sameDeal(a, b) {
|
|
12714
|
+
return a === b || a.scheme === b.scheme && a.network === b.network && a.asset.toLowerCase() === b.asset.toLowerCase() && a.amount === b.amount && a.payTo.toLowerCase() === b.payTo.toLowerCase();
|
|
12715
|
+
}
|
|
12584
12716
|
function deliver(url, lane, res, opts) {
|
|
12585
12717
|
const settlementTxHash = opts.paid ? settlementTx(res) : void 0;
|
|
12586
12718
|
const data = {
|
|
@@ -12697,4 +12829,4 @@ export {
|
|
|
12697
12829
|
sellerLine,
|
|
12698
12830
|
settlementTx
|
|
12699
12831
|
};
|
|
12700
|
-
//# sourceMappingURL=chunk-
|
|
12832
|
+
//# sourceMappingURL=chunk-VUGQTZ2L.js.map
|