tenjin-cli 0.1.0-alpha.31 → 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 +5 -5
- package/dist/{_esm-MEXZI5DL.js → _esm-RLLC72MS.js} +128 -132
- package/dist/{alive-J64H46HI.js → alive-MROUMFH3.js} +13 -6
- 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-3AIHRXKO.js +72 -0
- package/dist/chunk-3AIHRXKO.js.map +1 -0
- package/dist/{chunk-LEFIX6RS.js → chunk-3DIL66VX.js} +31 -11
- 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-7Q5FDF65.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-KXQ4UIP7.js → chunk-4USCZ2NI.js} +2 -2
- 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-5MARFNSB.js → chunk-AD226HDR.js} +49 -30
- 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-7WU4OPLP.js → chunk-AV5NZMYO.js} +5 -3
- package/dist/{chunk-7WU4OPLP.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-2XLC3AEX.js → chunk-BI673VEJ.js} +536 -510
- 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-FW75G2W4.js → chunk-CISYM4EO.js} +5 -5
- package/dist/{chunk-B7HUUJOK.js → chunk-D3ZURCG7.js} +3 -3
- package/dist/chunk-D5TOQSO4.js +474 -0
- package/dist/chunk-D5TOQSO4.js.map +1 -0
- package/dist/{chunk-UQUOVWBG.js → chunk-DRDUIZIA.js} +7 -7
- package/dist/{chunk-27EPWVOY.js → chunk-DW4YTVR3.js} +2 -2
- package/dist/chunk-E7LGOMH6.js +449 -0
- package/dist/chunk-E7LGOMH6.js.map +1 -0
- package/dist/{chunk-QSCPK4F5.js → chunk-E7SW44LM.js} +4 -11
- 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-R5LCN54M.js → chunk-GAKUQHKA.js} +13 -17
- package/dist/{chunk-R5LCN54M.js.map → chunk-GAKUQHKA.js.map} +1 -1
- package/dist/{chunk-4ZZO6ULA.js → chunk-HDPUXS3Z.js} +19 -48
- package/dist/chunk-HDPUXS3Z.js.map +1 -0
- package/dist/{chunk-ORWL5BSN.js → chunk-HGZEPQUT.js} +2 -2
- package/dist/{chunk-6E5R45ZO.js → chunk-HREHWL32.js} +4 -4
- package/dist/{chunk-6E5R45ZO.js.map → chunk-HREHWL32.js.map} +1 -1
- package/dist/{chunk-KXVP2VKA.js → chunk-I5TDIUKM.js} +15 -34
- 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-P4NH7OUK.js → chunk-IDTRSAHE.js} +2 -2
- package/dist/{chunk-YFPY4ONH.js → chunk-JEVQ5LKO.js} +4 -4
- package/dist/chunk-JNJWBTU2.js +3497 -0
- package/dist/chunk-JNJWBTU2.js.map +1 -0
- package/dist/{chunk-MNXS2U45.js → chunk-JRZBBPO6.js} +167 -86
- package/dist/chunk-JRZBBPO6.js.map +1 -0
- package/dist/{chunk-WJXLQXJY.js → chunk-MPZUYCAP.js} +4 -1
- package/dist/{chunk-WJXLQXJY.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-AGZ7PJKY.js → chunk-OTWLERSW.js} +22 -5
- package/dist/chunk-OTWLERSW.js.map +1 -0
- package/dist/{chunk-NEFNKLBE.js → chunk-PJNENX2A.js} +1535 -422
- package/dist/chunk-PJNENX2A.js.map +1 -0
- package/dist/{chunk-UKY4CHNC.js → chunk-PKHI276N.js} +8 -4
- package/dist/chunk-PKHI276N.js.map +1 -0
- package/dist/{chunk-5K5W4S66.js → chunk-QF3LSMGS.js} +2 -2
- 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-OHRR5OYM.js → chunk-SFASB5FL.js} +10 -4
- package/dist/chunk-SFASB5FL.js.map +1 -0
- package/dist/{chunk-YVFXE7RR.js → chunk-SNNSAGMT.js} +7279 -2627
- package/dist/chunk-SNNSAGMT.js.map +1 -0
- package/dist/{chunk-WK7F3B2E.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/{hosts-FWZOV26H.js → chunk-TF5HCP33.js} +79 -24
- 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-7ZRL2LBQ.js → chunk-V2LQLN5H.js} +6 -6
- package/dist/{chunk-K72RURN3.js → chunk-VJUVFZ2D.js} +2 -2
- package/dist/{chunk-77TCKDEC.js → chunk-VOZA6O7K.js} +663 -477
- package/dist/chunk-VOZA6O7K.js.map +1 -0
- package/dist/{chunk-D65GNPS3.js → chunk-VUGQTZ2L.js} +208 -84
- 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-5C32RLTA.js → chunk-YUY4SAGM.js} +17 -2
- package/dist/chunk-YUY4SAGM.js.map +1 -0
- package/dist/{cli-D5OE3URZ.js → cli-FB4LOA5A.js} +144 -63
- package/dist/{cli-D5OE3URZ.js.map → cli-FB4LOA5A.js.map} +1 -1
- package/dist/{codex-event-PPNVRRDH.js → codex-event-TYVES3UX.js} +2 -2
- package/dist/{codex-host-2RJOJW2B.js → codex-host-WW4H2SKT.js} +7 -6
- package/dist/codex-install-2C623HPW.js +393 -0
- package/dist/codex-install-2C623HPW.js.map +1 -0
- package/dist/{config-ZD4OB2DO.js → config-HOVJFEKD.js} +21 -17
- 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-5ITKQGYF.js → fund-WEBHTZGN.js} +37 -36
- package/dist/{fund-5ITKQGYF.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 +2 -2
- package/dist/hosts/claude/tenjin/skills/tenjin-pay/SKILL.md +82 -0
- package/dist/hosts/codex/tenjin/.mcp.json +3 -0
- package/dist/hosts/codex/tenjin/hooks/hooks.json +51 -5
- package/dist/hosts-AV5MHBAU.js +38 -0
- package/dist/index.js +28 -8
- package/dist/index.js.map +1 -1
- package/dist/{install-XWGE4Q7L.js → install-PT4EZS4R.js} +53 -30
- package/dist/{install-identity-K7EJIQFP.js → install-identity-5A4OE6YC.js} +11 -10
- package/dist/install-wallet-SAAPKB73.js +281 -0
- package/dist/install-wallet-SAAPKB73.js.map +1 -0
- package/dist/{mcp-3LIJSSJB.js → mcp-HAWKCTPQ.js} +785 -210
- 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-ZKQFDWLE.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-WHBERZ3W.js → pay-OXC3WKYV.js} +29 -29
- package/dist/{payments-KVICEKD2.js → payments-3KHMP2MG.js} +15 -14
- package/dist/{payments-KVICEKD2.js.map → payments-3KHMP2MG.js.map} +1 -1
- package/dist/plugin-registration-N3GRIZVM.js +67 -0
- package/dist/{redact-6W23GGJC.js → redact-D7ASVWKL.js} +2 -2
- 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-layout-BDWZG2TQ.js +25 -0
- package/dist/{send-7G7Y7DLN.js → send-HMKJLT34.js} +24 -22
- package/dist/{send-7G7Y7DLN.js.map → send-HMKJLT34.js.map} +1 -1
- package/dist/{status-OF7RH5HM.js → status-RWXIIWYS.js} +55 -25
- package/dist/status-RWXIIWYS.js.map +1 -0
- package/dist/{status-line-XOUE6MPL.js → status-line-77XYZP7E.js} +10 -9
- package/dist/{status-line-XOUE6MPL.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-OGOGEHV2.js → usdc-D6X7EIQ2.js} +6 -8
- package/dist/usdc-D6X7EIQ2.js.map +1 -0
- package/dist/{viemAdapter-By13KInL-S3DA7DFW.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 +40 -22
- package/docs/safety-model.md +1 -1
- package/docs/troubleshooting.md +72 -1
- package/package.json +14 -1
- package/dist/ccip-NLCSCHKI.js +0 -19
- package/dist/chunk-2XLC3AEX.js.map +0 -1
- package/dist/chunk-4ZZO6ULA.js.map +0 -1
- package/dist/chunk-5C32RLTA.js.map +0 -1
- package/dist/chunk-5IEP5EGE.js +0 -5332
- package/dist/chunk-5IEP5EGE.js.map +0 -1
- package/dist/chunk-5MARFNSB.js.map +0 -1
- package/dist/chunk-77TCKDEC.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-AGZ7PJKY.js.map +0 -1
- package/dist/chunk-AKWGE6JQ.js.map +0 -1
- package/dist/chunk-BL3332HQ.js +0 -7611
- package/dist/chunk-BL3332HQ.js.map +0 -1
- package/dist/chunk-D65GNPS3.js.map +0 -1
- package/dist/chunk-EGELTSPU.js +0 -2865
- package/dist/chunk-EGELTSPU.js.map +0 -1
- package/dist/chunk-GA7JETVM.js +0 -150
- package/dist/chunk-GA7JETVM.js.map +0 -1
- package/dist/chunk-I3EQFHCD.js +0 -175
- package/dist/chunk-I3EQFHCD.js.map +0 -1
- package/dist/chunk-K3I7C2MO.js +0 -1185
- package/dist/chunk-K3I7C2MO.js.map +0 -1
- package/dist/chunk-KXVP2VKA.js.map +0 -1
- package/dist/chunk-LEFIX6RS.js.map +0 -1
- package/dist/chunk-MNXS2U45.js.map +0 -1
- package/dist/chunk-NEFNKLBE.js.map +0 -1
- package/dist/chunk-OHRR5OYM.js.map +0 -1
- package/dist/chunk-QSCPK4F5.js.map +0 -1
- package/dist/chunk-SJLTEINJ.js.map +0 -1
- package/dist/chunk-TTNESUPQ.js.map +0 -1
- package/dist/chunk-UKY4CHNC.js.map +0 -1
- package/dist/chunk-V6BSF6OC.js +0 -260
- package/dist/chunk-V6BSF6OC.js.map +0 -1
- package/dist/chunk-YVFXE7RR.js.map +0 -1
- package/dist/codex-install-UUZ6QMBQ.js +0 -221
- package/dist/codex-install-UUZ6QMBQ.js.map +0 -1
- package/dist/doctor-KBR34Q4B.js +0 -601
- package/dist/doctor-KBR34Q4B.js.map +0 -1
- package/dist/hook-command-4TYCHHRL.js +0 -39
- package/dist/hosts-FWZOV26H.js.map +0 -1
- package/dist/install-wallet-XQ6XFZV4.js +0 -117
- package/dist/install-wallet-XQ6XFZV4.js.map +0 -1
- package/dist/mcp-3LIJSSJB.js.map +0 -1
- package/dist/plugin-registration-5TIA564H.js +0 -54
- package/dist/status-OF7RH5HM.js.map +0 -1
- package/dist/uninstall-JXUAFNDB.js +0 -158
- package/dist/uninstall-JXUAFNDB.js.map +0 -1
- package/dist/update-ZKUERSO2.js +0 -44
- package/dist/wallet-2HA6W4R4.js +0 -43
- /package/dist/{_esm-MEXZI5DL.js.map → _esm-RLLC72MS.js.map} +0 -0
- /package/dist/{alive-J64H46HI.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-7Q5FDF65.js.map → chunk-445VQTVM.js.map} +0 -0
- /package/dist/{chunk-KXQ4UIP7.js.map → chunk-4USCZ2NI.js.map} +0 -0
- /package/dist/{chunk-FW75G2W4.js.map → chunk-CISYM4EO.js.map} +0 -0
- /package/dist/{chunk-B7HUUJOK.js.map → chunk-D3ZURCG7.js.map} +0 -0
- /package/dist/{chunk-UQUOVWBG.js.map → chunk-DRDUIZIA.js.map} +0 -0
- /package/dist/{chunk-27EPWVOY.js.map → chunk-DW4YTVR3.js.map} +0 -0
- /package/dist/{chunk-ORWL5BSN.js.map → chunk-HGZEPQUT.js.map} +0 -0
- /package/dist/{chunk-P4NH7OUK.js.map → chunk-IDTRSAHE.js.map} +0 -0
- /package/dist/{chunk-YFPY4ONH.js.map → chunk-JEVQ5LKO.js.map} +0 -0
- /package/dist/{chunk-5K5W4S66.js.map → chunk-QF3LSMGS.js.map} +0 -0
- /package/dist/{chunk-WK7F3B2E.js.map → chunk-SO3XRZPX.js.map} +0 -0
- /package/dist/{chunk-7ZRL2LBQ.js.map → chunk-V2LQLN5H.js.map} +0 -0
- /package/dist/{chunk-K72RURN3.js.map → chunk-VJUVFZ2D.js.map} +0 -0
- /package/dist/{codex-event-PPNVRRDH.js.map → codex-event-TYVES3UX.js.map} +0 -0
- /package/dist/{codex-host-2RJOJW2B.js.map → codex-host-WW4H2SKT.js.map} +0 -0
- /package/dist/{config-ZD4OB2DO.js.map → config-HOVJFEKD.js.map} +0 -0
- /package/dist/{env-proxy-XL4P73MZ.js.map → env-proxy-R6ZMLQTT.js.map} +0 -0
- /package/dist/{ethersCompat-Df4a6QIZ-THAVUGIJ.js.map → ethersCompat-Df4a6QIZ-X6YZWAML.js.map} +0 -0
- /package/dist/{hook-command-4TYCHHRL.js.map → hook-command-ZA2PNKS6.js.map} +0 -0
- /package/dist/{install-XWGE4Q7L.js.map → hosts-AV5MHBAU.js.map} +0 -0
- /package/dist/{install-identity-K7EJIQFP.js.map → install-PT4EZS4R.js.map} +0 -0
- /package/dist/{package-ZKQFDWLE.js.map → install-identity-5A4OE6YC.js.map} +0 -0
- /package/dist/{paths-POPTXJO6.js.map → package-SR2WB6MK.js.map} +0 -0
- /package/dist/{pay-WHBERZ3W.js.map → passphrase-IFTDS3CU.js.map} +0 -0
- /package/dist/{plugin-registration-5TIA564H.js.map → paths-XCSAKISU.js.map} +0 -0
- /package/dist/{redact-6W23GGJC.js.map → pay-OXC3WKYV.js.map} +0 -0
- /package/dist/{update-ZKUERSO2.js.map → plugin-registration-N3GRIZVM.js.map} +0 -0
- /package/dist/{usdc-OGOGEHV2.js.map → redact-D7ASVWKL.js.map} +0 -0
- /package/dist/{viemAdapter-By13KInL-S3DA7DFW.js.map → runtime-fetch-EKFRNR6Z.js.map} +0 -0
- /package/dist/{wallet-2HA6W4R4.js.map → runtime-layout-BDWZG2TQ.js.map} +0 -0
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
promptYesNo
|
|
4
|
-
} from "./chunk-LHHMV4GU.js";
|
|
5
|
-
import {
|
|
6
|
-
assertPublicDestination
|
|
7
|
-
} from "./chunk-JKKAIPTU.js";
|
|
8
2
|
import {
|
|
9
3
|
ADDITIVE_ARRAY_INFO_FIELDS,
|
|
10
4
|
HTTPFacilitatorClient,
|
|
@@ -23,7 +17,16 @@ import {
|
|
|
23
17
|
toComparableArray,
|
|
24
18
|
x402HTTPClient,
|
|
25
19
|
x402Version
|
|
26
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-JNJWBTU2.js";
|
|
21
|
+
import {
|
|
22
|
+
promptYesNo
|
|
23
|
+
} from "./chunk-LHHMV4GU.js";
|
|
24
|
+
import {
|
|
25
|
+
assertPublicDestination
|
|
26
|
+
} from "./chunk-JKKAIPTU.js";
|
|
27
|
+
import {
|
|
28
|
+
USDC_ADDRESS
|
|
29
|
+
} from "./chunk-GAKUQHKA.js";
|
|
27
30
|
import {
|
|
28
31
|
BATCH_SETTLEMENT_ADDRESS,
|
|
29
32
|
BATCH_SETTLEMENT_SCHEME,
|
|
@@ -43,76 +46,71 @@ import {
|
|
|
43
46
|
normalizeChannelId,
|
|
44
47
|
receiveAuthorizationTypes,
|
|
45
48
|
voucherTypes
|
|
46
|
-
} from "./chunk-
|
|
47
|
-
import {
|
|
48
|
-
createPublicClient,
|
|
49
|
-
http,
|
|
50
|
-
recoverTypedDataAddress
|
|
51
|
-
} from "./chunk-BL3332HQ.js";
|
|
49
|
+
} from "./chunk-445VQTVM.js";
|
|
52
50
|
import {
|
|
53
51
|
describeWallet,
|
|
54
52
|
resolveSpendAuthorizer,
|
|
55
53
|
resolveWalletProvider
|
|
56
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-BI673VEJ.js";
|
|
57
55
|
import {
|
|
58
56
|
readSpendSummary,
|
|
59
57
|
spentOf
|
|
60
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-SO3XRZPX.js";
|
|
61
59
|
import {
|
|
62
|
-
|
|
63
|
-
} from "./chunk-
|
|
60
|
+
sanitizeForTerminal
|
|
61
|
+
} from "./chunk-VJUVFZ2D.js";
|
|
64
62
|
import {
|
|
65
|
-
|
|
66
|
-
} from "./chunk-
|
|
63
|
+
evaluatePlan
|
|
64
|
+
} from "./chunk-2SNUOHAT.js";
|
|
65
|
+
import {
|
|
66
|
+
withFileLock
|
|
67
|
+
} from "./chunk-MEFB5KHA.js";
|
|
68
|
+
import {
|
|
69
|
+
fetchFailureToCliError,
|
|
70
|
+
httpRequest,
|
|
71
|
+
requestHeaderProblem
|
|
72
|
+
} from "./chunk-OTWLERSW.js";
|
|
73
|
+
import {
|
|
74
|
+
createPublicClient,
|
|
75
|
+
http,
|
|
76
|
+
recoverTypedDataAddress
|
|
77
|
+
} from "./chunk-PJNENX2A.js";
|
|
67
78
|
import {
|
|
68
79
|
encodeAbiParameters,
|
|
69
80
|
encodeFunctionData,
|
|
70
|
-
getAddress
|
|
81
|
+
getAddress,
|
|
71
82
|
keccak256,
|
|
72
83
|
maxUint256,
|
|
73
84
|
toBytes
|
|
74
|
-
} from "./chunk-
|
|
75
|
-
import {
|
|
76
|
-
withFileLock
|
|
77
|
-
} from "./chunk-MEFB5KHA.js";
|
|
78
|
-
import {
|
|
79
|
-
evaluatePlan
|
|
80
|
-
} from "./chunk-2SNUOHAT.js";
|
|
81
|
-
import {
|
|
82
|
-
sanitizeForTerminal
|
|
83
|
-
} from "./chunk-K72RURN3.js";
|
|
85
|
+
} from "./chunk-2GP3HRYK.js";
|
|
84
86
|
import {
|
|
85
87
|
mask
|
|
86
|
-
} from "./chunk-
|
|
87
|
-
import {
|
|
88
|
-
fetchFailureToCliError,
|
|
89
|
-
httpRequest
|
|
90
|
-
} from "./chunk-AGZ7PJKY.js";
|
|
88
|
+
} from "./chunk-IADZOXKN.js";
|
|
91
89
|
import {
|
|
92
90
|
resolveContextSettings
|
|
93
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-AV5NZMYO.js";
|
|
94
92
|
import {
|
|
95
93
|
parseUsdToAtomic,
|
|
96
94
|
toMoney
|
|
97
95
|
} from "./chunk-Y527D4TV.js";
|
|
98
96
|
import {
|
|
99
|
-
|
|
100
|
-
} from "./chunk-
|
|
97
|
+
readUsdcBalanceWithFallback
|
|
98
|
+
} from "./chunk-DW4YTVR3.js";
|
|
101
99
|
import {
|
|
102
100
|
isSameDeployment
|
|
103
101
|
} from "./chunk-XQJXNMSB.js";
|
|
104
102
|
import {
|
|
105
|
-
|
|
106
|
-
} from "./chunk-
|
|
107
|
-
import {
|
|
108
|
-
readUsdcBalanceWithFallback
|
|
109
|
-
} from "./chunk-27EPWVOY.js";
|
|
103
|
+
external_exports
|
|
104
|
+
} from "./chunk-SNNSAGMT.js";
|
|
110
105
|
import {
|
|
111
106
|
writeFileAtomic
|
|
112
107
|
} from "./chunk-7WEQQJLG.js";
|
|
108
|
+
import {
|
|
109
|
+
CliError
|
|
110
|
+
} from "./chunk-3UCIG4TG.js";
|
|
113
111
|
import {
|
|
114
112
|
quotesDir
|
|
115
|
-
} from "./chunk-
|
|
113
|
+
} from "./chunk-OJNTCYQQ.js";
|
|
116
114
|
import {
|
|
117
115
|
__commonJS,
|
|
118
116
|
__toESM
|
|
@@ -8443,6 +8441,8 @@ async function ultravioletListings(registry, timeoutMs, query) {
|
|
|
8443
8441
|
function client(registry) {
|
|
8444
8442
|
return withBazaar(new HTTPFacilitatorClient({ url: registry }));
|
|
8445
8443
|
}
|
|
8444
|
+
var DeadlineError = class extends Error {
|
|
8445
|
+
};
|
|
8446
8446
|
async function withTimeout(work, timeoutMs, what) {
|
|
8447
8447
|
let timer;
|
|
8448
8448
|
try {
|
|
@@ -8450,7 +8450,7 @@ async function withTimeout(work, timeoutMs, what) {
|
|
|
8450
8450
|
work,
|
|
8451
8451
|
new Promise((_, reject) => {
|
|
8452
8452
|
timer = setTimeout(
|
|
8453
|
-
() => reject(new
|
|
8453
|
+
() => reject(new DeadlineError(`${what} timed out after ${timeoutMs}ms`)),
|
|
8454
8454
|
timeoutMs
|
|
8455
8455
|
);
|
|
8456
8456
|
})
|
|
@@ -8577,6 +8577,9 @@ async function verifyAgainstRegistries(registries, url, live, timeoutMs, opts =
|
|
|
8577
8577
|
}
|
|
8578
8578
|
} catch (err) {
|
|
8579
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
|
+
}
|
|
8580
8583
|
}
|
|
8581
8584
|
}
|
|
8582
8585
|
if (mismatch !== void 0) return { outcome: "mismatch", ...mismatch };
|
|
@@ -10445,7 +10448,7 @@ var ERC20_APPROVAL_GAS_SPONSORING_KEY = "erc20ApprovalGasSponsoring";
|
|
|
10445
10448
|
var ERC20_APPROVAL_GAS_SPONSORING_VERSION = "1";
|
|
10446
10449
|
async function signEip2612Permit(signer, tokenAddress, tokenName, tokenVersion, chainId, deadline, permittedAmount) {
|
|
10447
10450
|
const owner = signer.address;
|
|
10448
|
-
const spender =
|
|
10451
|
+
const spender = getAddress(PERMIT2_ADDRESS);
|
|
10449
10452
|
const nonce = await signer.readContract({
|
|
10450
10453
|
address: tokenAddress,
|
|
10451
10454
|
abi: eip2612NoncesAbi,
|
|
@@ -10485,7 +10488,7 @@ async function signEip2612Permit(signer, tokenAddress, tokenName, tokenVersion,
|
|
|
10485
10488
|
}
|
|
10486
10489
|
async function signErc20ApprovalTransaction(signer, tokenAddress, chainId) {
|
|
10487
10490
|
const from = signer.address;
|
|
10488
|
-
const spender =
|
|
10491
|
+
const spender = getAddress(PERMIT2_ADDRESS);
|
|
10489
10492
|
const data = encodeFunctionData({
|
|
10490
10493
|
abi: erc20ApproveAbi,
|
|
10491
10494
|
functionName: "approve",
|
|
@@ -10591,7 +10594,7 @@ async function trySignEip2612PermitExtension(signer, options, requirements, resu
|
|
|
10591
10594
|
return void 0;
|
|
10592
10595
|
}
|
|
10593
10596
|
const chainId = getEvmChainId(requirements.network);
|
|
10594
|
-
const tokenAddress =
|
|
10597
|
+
const tokenAddress = getAddress(requirements.asset);
|
|
10595
10598
|
const requiredAllowance = approvalAmount ?? requirements.amount;
|
|
10596
10599
|
try {
|
|
10597
10600
|
const allowance = await capabilities.readContract({
|
|
@@ -10636,7 +10639,7 @@ async function trySignErc20ApprovalExtension(signer, options, requirements, cont
|
|
|
10636
10639
|
return void 0;
|
|
10637
10640
|
}
|
|
10638
10641
|
const chainId = getEvmChainId(requirements.network);
|
|
10639
|
-
const tokenAddress =
|
|
10642
|
+
const tokenAddress = getAddress(requirements.asset);
|
|
10640
10643
|
const requiredAllowance = approvalAmount ?? requirements.amount;
|
|
10641
10644
|
try {
|
|
10642
10645
|
const allowance = await capabilities.readContract({
|
|
@@ -10700,13 +10703,13 @@ async function createBatchSettlementEIP3009DepositPayload(signer, x402Version2,
|
|
|
10700
10703
|
name,
|
|
10701
10704
|
version,
|
|
10702
10705
|
chainId,
|
|
10703
|
-
verifyingContract:
|
|
10706
|
+
verifyingContract: getAddress(paymentRequirements.asset)
|
|
10704
10707
|
},
|
|
10705
10708
|
types: receiveAuthorizationTypes,
|
|
10706
10709
|
primaryType: "ReceiveWithAuthorization",
|
|
10707
10710
|
message: {
|
|
10708
|
-
from:
|
|
10709
|
-
to:
|
|
10711
|
+
from: getAddress(signer.address),
|
|
10712
|
+
to: getAddress(ERC3009_DEPOSIT_COLLECTOR_ADDRESS),
|
|
10710
10713
|
value: BigInt(depositAmount),
|
|
10711
10714
|
validAfter: BigInt(0),
|
|
10712
10715
|
validBefore: BigInt(now + paymentRequirements.maxTimeoutSeconds),
|
|
@@ -10843,16 +10846,16 @@ function depositAmountForRequest(policy, requestAmount, needed, extra, maxDeposi
|
|
|
10843
10846
|
function buildChannelConfig(deps, paymentRequirements) {
|
|
10844
10847
|
const extra = paymentRequirements.extra;
|
|
10845
10848
|
const receiverAuthorizer = extra?.receiverAuthorizer;
|
|
10846
|
-
if (!receiverAuthorizer ||
|
|
10849
|
+
if (!receiverAuthorizer || getAddress(receiverAuthorizer) === "0x0000000000000000000000000000000000000000") {
|
|
10847
10850
|
throw new Error("Payment requirements must include a non-zero extra.receiverAuthorizer");
|
|
10848
10851
|
}
|
|
10849
10852
|
return {
|
|
10850
10853
|
payer: deps.signer.address,
|
|
10851
|
-
payerAuthorizer:
|
|
10854
|
+
payerAuthorizer: getAddress(
|
|
10852
10855
|
deps.payerAuthorizer ?? deps.voucherSigner?.address ?? deps.signer.address
|
|
10853
10856
|
),
|
|
10854
10857
|
receiver: paymentRequirements.payTo,
|
|
10855
|
-
receiverAuthorizer:
|
|
10858
|
+
receiverAuthorizer: getAddress(receiverAuthorizer),
|
|
10856
10859
|
token: paymentRequirements.asset,
|
|
10857
10860
|
withdrawDelay: typeof extra?.withdrawDelay === "number" ? extra.withdrawDelay : MIN_WITHDRAW_DELAY,
|
|
10858
10861
|
salt: deps.salt
|
|
@@ -10985,7 +10988,7 @@ async function recoverFromSignature(deps, accept, channelState, voucherState) {
|
|
|
10985
10988
|
},
|
|
10986
10989
|
signature: sig
|
|
10987
10990
|
});
|
|
10988
|
-
const expectedSigner =
|
|
10991
|
+
const expectedSigner = getAddress(
|
|
10989
10992
|
deps.payerAuthorizer ?? deps.voucherSigner?.address ?? deps.signer.address
|
|
10990
10993
|
);
|
|
10991
10994
|
if (recovered.toLowerCase() !== expectedSigner.toLowerCase()) {
|
|
@@ -11223,10 +11226,10 @@ async function createBatchSettlementPermit2DepositPayload(signer, x402Version2,
|
|
|
11223
11226
|
const permit2Authorization = {
|
|
11224
11227
|
from: signer.address,
|
|
11225
11228
|
permitted: {
|
|
11226
|
-
token:
|
|
11229
|
+
token: getAddress(paymentRequirements.asset),
|
|
11227
11230
|
amount: depositAmount
|
|
11228
11231
|
},
|
|
11229
|
-
spender:
|
|
11232
|
+
spender: getAddress(PERMIT2_DEPOSIT_COLLECTOR_ADDRESS),
|
|
11230
11233
|
nonce,
|
|
11231
11234
|
deadline,
|
|
11232
11235
|
witness: {
|
|
@@ -11299,7 +11302,7 @@ var BatchSettlementEvmScheme = class {
|
|
|
11299
11302
|
this.payerAuthorizer = payerAuthorizer;
|
|
11300
11303
|
this.voucherSigner = voucherSigner;
|
|
11301
11304
|
this.extensionRpcOptions = extensionRpcOptions;
|
|
11302
|
-
if (payerAuthorizer !== void 0 && voucherSigner !== void 0 &&
|
|
11305
|
+
if (payerAuthorizer !== void 0 && voucherSigner !== void 0 && getAddress(payerAuthorizer) !== getAddress(voucherSigner.address)) {
|
|
11303
11306
|
throw new Error("payerAuthorizer address must match voucherSigner.address");
|
|
11304
11307
|
}
|
|
11305
11308
|
validateDepositPolicy(depositPolicy);
|
|
@@ -11540,14 +11543,14 @@ async function createPermit2PayloadForProxy(proxyAddress, signer, x402Version2,
|
|
|
11540
11543
|
const permit2Authorization = {
|
|
11541
11544
|
from: signer.address,
|
|
11542
11545
|
permitted: {
|
|
11543
|
-
token:
|
|
11546
|
+
token: getAddress(paymentRequirements.asset),
|
|
11544
11547
|
amount: paymentRequirements.amount
|
|
11545
11548
|
},
|
|
11546
11549
|
spender: proxyAddress,
|
|
11547
11550
|
nonce,
|
|
11548
11551
|
deadline,
|
|
11549
11552
|
witness: {
|
|
11550
|
-
to:
|
|
11553
|
+
to: getAddress(paymentRequirements.payTo),
|
|
11551
11554
|
validAfter
|
|
11552
11555
|
}
|
|
11553
11556
|
};
|
|
@@ -11569,14 +11572,14 @@ async function signPermit2Authorization(signer, permit2Authorization, requiremen
|
|
|
11569
11572
|
primaryType: "PermitWitnessTransferFrom",
|
|
11570
11573
|
message: {
|
|
11571
11574
|
permitted: {
|
|
11572
|
-
token:
|
|
11575
|
+
token: getAddress(permit2Authorization.permitted.token),
|
|
11573
11576
|
amount: BigInt(permit2Authorization.permitted.amount)
|
|
11574
11577
|
},
|
|
11575
|
-
spender:
|
|
11578
|
+
spender: getAddress(permit2Authorization.spender),
|
|
11576
11579
|
nonce: BigInt(permit2Authorization.nonce),
|
|
11577
11580
|
deadline: BigInt(permit2Authorization.deadline),
|
|
11578
11581
|
witness: {
|
|
11579
|
-
to:
|
|
11582
|
+
to: getAddress(permit2Authorization.witness.to),
|
|
11580
11583
|
validAfter: BigInt(permit2Authorization.witness.validAfter)
|
|
11581
11584
|
}
|
|
11582
11585
|
}
|
|
@@ -11600,7 +11603,7 @@ async function createEIP3009Payload(signer, x402Version2, paymentRequirements) {
|
|
|
11600
11603
|
const now = Math.floor(Date.now() / 1e3);
|
|
11601
11604
|
const authorization = {
|
|
11602
11605
|
from: signer.address,
|
|
11603
|
-
to:
|
|
11606
|
+
to: getAddress(paymentRequirements.payTo),
|
|
11604
11607
|
value: paymentRequirements.amount,
|
|
11605
11608
|
validAfter: "0",
|
|
11606
11609
|
validBefore: (now + paymentRequirements.maxTimeoutSeconds).toString(),
|
|
@@ -11628,11 +11631,11 @@ async function signEIP3009Authorization(signer, authorization, requirements) {
|
|
|
11628
11631
|
name,
|
|
11629
11632
|
version,
|
|
11630
11633
|
chainId,
|
|
11631
|
-
verifyingContract:
|
|
11634
|
+
verifyingContract: getAddress(requirements.asset)
|
|
11632
11635
|
};
|
|
11633
11636
|
const message = {
|
|
11634
|
-
from:
|
|
11635
|
-
to:
|
|
11637
|
+
from: getAddress(authorization.from),
|
|
11638
|
+
to: getAddress(authorization.to),
|
|
11636
11639
|
value: BigInt(authorization.value),
|
|
11637
11640
|
validAfter: BigInt(authorization.validAfter),
|
|
11638
11641
|
validBefore: BigInt(authorization.validBefore),
|
|
@@ -11833,15 +11836,16 @@ function createPayerClient(getSigner) {
|
|
|
11833
11836
|
core.registerExtension(builderCode);
|
|
11834
11837
|
return { core, http: new x402HTTPClient(core), builderCodeKey: builderCode.key };
|
|
11835
11838
|
}
|
|
11836
|
-
var canonicalUsdcOnly = (_version, requirements) => requirements.filter(
|
|
11837
|
-
|
|
11839
|
+
var canonicalUsdcOnly = (_version, requirements) => requirements.filter(isCanonicalUsdc);
|
|
11840
|
+
function isCanonicalUsdc(entry) {
|
|
11841
|
+
const allowed = ALLOWED_USDC_BY_NETWORK[entry.network];
|
|
11838
11842
|
if (allowed === void 0) return false;
|
|
11839
11843
|
try {
|
|
11840
|
-
return getAddress(
|
|
11844
|
+
return getAddress(entry.asset) === getAddress(allowed);
|
|
11841
11845
|
} catch {
|
|
11842
11846
|
return false;
|
|
11843
11847
|
}
|
|
11844
|
-
}
|
|
11848
|
+
}
|
|
11845
11849
|
function selectPayableRequirement(core, paymentRequired, want) {
|
|
11846
11850
|
const approved = supportedEntries(paymentRequired);
|
|
11847
11851
|
if (want === void 0) return sdkSelect(core, paymentRequired) ?? approved[0];
|
|
@@ -11970,8 +11974,13 @@ async function executePay(args, ctx, deps, warnings) {
|
|
|
11970
11974
|
const lane = resolveLane(url, settings);
|
|
11971
11975
|
if (lane === "bazaar") await assertPublicDestination(url, deps.destination ?? {});
|
|
11972
11976
|
const method = resolveMethod(args);
|
|
11973
|
-
const
|
|
11974
|
-
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
|
+
};
|
|
11975
11984
|
const fetchOpts = {
|
|
11976
11985
|
timeoutMs: ctx.flags.timeout,
|
|
11977
11986
|
// Both legs: the probe's 402 is money-path input, and the paid retry
|
|
@@ -11979,8 +11988,7 @@ async function executePay(args, ctx, deps, warnings) {
|
|
|
11979
11988
|
// probe too, so the challenge always comes from the URL that was gated).
|
|
11980
11989
|
blockRedirects: true,
|
|
11981
11990
|
...deps.fetchImpl !== void 0 ? { fetchImpl: deps.fetchImpl } : {},
|
|
11982
|
-
...
|
|
11983
|
-
...jsonBody === void 0 && args.rawBody !== void 0 ? { rawBody: args.rawBody } : {},
|
|
11991
|
+
...body,
|
|
11984
11992
|
...Object.keys(headers).length > 0 ? { headers } : {},
|
|
11985
11993
|
// A router lookup can buy a file (a sound, an image): its bytes are kept
|
|
11986
11994
|
// whole for the tool to save, never decoded as text.
|
|
@@ -12016,6 +12024,9 @@ async function executePay(args, ctx, deps, warnings) {
|
|
|
12016
12024
|
const paymentRequired = decodeChallenge(probe, url);
|
|
12017
12025
|
const payer = createPayerClient(() => signerOrThrow(openedSigner));
|
|
12018
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
|
+
}
|
|
12019
12030
|
if (requirement === void 0) {
|
|
12020
12031
|
throw noMatchingEntry(paymentRequired, args.terms);
|
|
12021
12032
|
}
|
|
@@ -12299,7 +12310,7 @@ async function quoteRouterCall(args, ctx, deps = {}) {
|
|
|
12299
12310
|
if (resolveLane(url, settings) === "bazaar") {
|
|
12300
12311
|
await assertPublicDestination(url, deps.destination ?? {});
|
|
12301
12312
|
}
|
|
12302
|
-
const headers = callerHeaders(args.headers);
|
|
12313
|
+
const headers = { ...specHeaders(args.specHeaders), ...callerHeaders(args.headers) };
|
|
12303
12314
|
const probe = await httpRequest(url, {
|
|
12304
12315
|
timeoutMs: ctx.flags.timeout,
|
|
12305
12316
|
blockRedirects: true,
|
|
@@ -12390,20 +12401,80 @@ function resolveLane(url, settings) {
|
|
|
12390
12401
|
}
|
|
12391
12402
|
return "bazaar";
|
|
12392
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
|
+
}
|
|
12393
12409
|
function resolveMethod(args) {
|
|
12394
|
-
const method = args.method?.toUpperCase() ?? (args
|
|
12395
|
-
if (method
|
|
12410
|
+
const method = args.method?.toUpperCase() ?? (hasBody(args) ? "POST" : "GET");
|
|
12411
|
+
if (!METHODS.has(method)) {
|
|
12396
12412
|
throw new CliError("USAGE", `Unsupported method ${JSON.stringify(args.method)}`, {
|
|
12397
|
-
fix: "Use -X GET or
|
|
12413
|
+
fix: "Use -X GET, POST, PUT, PATCH or DELETE."
|
|
12398
12414
|
});
|
|
12399
12415
|
}
|
|
12400
|
-
if (
|
|
12401
|
-
throw new CliError("USAGE", "A request body needs -X POST.", {
|
|
12402
|
-
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."
|
|
12403
12419
|
});
|
|
12404
12420
|
}
|
|
12405
12421
|
return method;
|
|
12406
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
|
+
}
|
|
12407
12478
|
function callerHeaders(headers) {
|
|
12408
12479
|
if (headers === void 0) return {};
|
|
12409
12480
|
const allowed = /* @__PURE__ */ new Set(["accept", "content-type"]);
|
|
@@ -12423,6 +12494,23 @@ function callerHeaders(headers) {
|
|
|
12423
12494
|
}
|
|
12424
12495
|
return out;
|
|
12425
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
|
+
}
|
|
12426
12514
|
function parseBody(data) {
|
|
12427
12515
|
if (data === void 0) return void 0;
|
|
12428
12516
|
try {
|
|
@@ -12589,6 +12677,42 @@ function warningMessage(warning) {
|
|
|
12589
12677
|
return `Registry warning: the live terms differ from ${warning.registry} (${warning.detail}).`;
|
|
12590
12678
|
}
|
|
12591
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
|
+
}
|
|
12592
12716
|
function deliver(url, lane, res, opts) {
|
|
12593
12717
|
const settlementTxHash = opts.paid ? settlementTx(res) : void 0;
|
|
12594
12718
|
const data = {
|
|
@@ -12705,4 +12829,4 @@ export {
|
|
|
12705
12829
|
sellerLine,
|
|
12706
12830
|
settlementTx
|
|
12707
12831
|
};
|
|
12708
|
-
//# sourceMappingURL=chunk-
|
|
12832
|
+
//# sourceMappingURL=chunk-VUGQTZ2L.js.map
|