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
|
@@ -0,0 +1,474 @@
|
|
|
1
|
+
import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
addressQrLines
|
|
4
|
+
} from "./chunk-HGZEPQUT.js";
|
|
5
|
+
import {
|
|
6
|
+
getUsdcBalance
|
|
7
|
+
} from "./chunk-GAKUQHKA.js";
|
|
8
|
+
import {
|
|
9
|
+
markUnlockPending
|
|
10
|
+
} from "./chunk-WYXUQGOL.js";
|
|
11
|
+
import {
|
|
12
|
+
channelCredit
|
|
13
|
+
} from "./chunk-D3ZURCG7.js";
|
|
14
|
+
import {
|
|
15
|
+
commitLocalWallet,
|
|
16
|
+
createLocalWallet,
|
|
17
|
+
describeWallet,
|
|
18
|
+
openKeystore,
|
|
19
|
+
parkOutgoingWallet,
|
|
20
|
+
prepareLocalWallet,
|
|
21
|
+
readWalletRecord,
|
|
22
|
+
repairLocalWalletPassphrase,
|
|
23
|
+
resolveWalletProvider,
|
|
24
|
+
restoreParkedWallet,
|
|
25
|
+
verifyAndPreserveOutgoingWallet,
|
|
26
|
+
walletExistsError,
|
|
27
|
+
walletFileExists
|
|
28
|
+
} from "./chunk-BI673VEJ.js";
|
|
29
|
+
import {
|
|
30
|
+
emitNotice
|
|
31
|
+
} from "./chunk-VJUVFZ2D.js";
|
|
32
|
+
import {
|
|
33
|
+
FUNDING_LINE,
|
|
34
|
+
FUND_COMMAND_LINE
|
|
35
|
+
} from "./chunk-HDPUXS3Z.js";
|
|
36
|
+
import {
|
|
37
|
+
LockTimeoutError,
|
|
38
|
+
withFileLock
|
|
39
|
+
} from "./chunk-MEFB5KHA.js";
|
|
40
|
+
import {
|
|
41
|
+
STORE_TIMEOUTS,
|
|
42
|
+
describeStoreLocation,
|
|
43
|
+
promptPassphrase,
|
|
44
|
+
resolvePassphrase,
|
|
45
|
+
resolvePassphraseForCreate,
|
|
46
|
+
storeNoun,
|
|
47
|
+
unstorableWhy
|
|
48
|
+
} from "./chunk-CEXSOI5R.js";
|
|
49
|
+
import {
|
|
50
|
+
toMoney
|
|
51
|
+
} from "./chunk-Y527D4TV.js";
|
|
52
|
+
import {
|
|
53
|
+
writePassphraseRecord
|
|
54
|
+
} from "./chunk-3AIHRXKO.js";
|
|
55
|
+
import {
|
|
56
|
+
NO_KEYRING_LINE,
|
|
57
|
+
REPAIR_CLAUSE,
|
|
58
|
+
REPAIR_IN_TERMINAL
|
|
59
|
+
} from "./chunk-X5ZBP3IY.js";
|
|
60
|
+
import {
|
|
61
|
+
loadRawConfig,
|
|
62
|
+
resolveSettings
|
|
63
|
+
} from "./chunk-2GNOFONN.js";
|
|
64
|
+
import {
|
|
65
|
+
CliError
|
|
66
|
+
} from "./chunk-3UCIG4TG.js";
|
|
67
|
+
import {
|
|
68
|
+
walletPath
|
|
69
|
+
} from "./chunk-OJNTCYQQ.js";
|
|
70
|
+
|
|
71
|
+
// src/commands/wallet.ts
|
|
72
|
+
import { mkdir, readFile } from "node:fs/promises";
|
|
73
|
+
import { homedir } from "node:os";
|
|
74
|
+
import { dirname, join } from "node:path";
|
|
75
|
+
var KEY_STORAGE = "encrypted (keystore v3, scrypt)";
|
|
76
|
+
var isWindows = process.platform === "win32";
|
|
77
|
+
var REPAIR_DONE_LINE = "Passphrase saved; start a new Claude Code session to verify.";
|
|
78
|
+
async function runWalletCreate(ctx, opts = {}) {
|
|
79
|
+
const { address, walletPath: path, passphrase, replaced } = await createWalletLocked(ctx, opts);
|
|
80
|
+
const note = passphraseNote(passphrase, address, ctx.dataDir);
|
|
81
|
+
const warnings = custodyWarnings();
|
|
82
|
+
return {
|
|
83
|
+
data: {
|
|
84
|
+
address,
|
|
85
|
+
walletPath: path,
|
|
86
|
+
provider: "local",
|
|
87
|
+
policyEnforcement: "client-only",
|
|
88
|
+
keyStorage: KEY_STORAGE,
|
|
89
|
+
passphraseSource: passphrase.source,
|
|
90
|
+
passphraseLocation: passphrase.location,
|
|
91
|
+
passphraseOrigin: passphrase.origin,
|
|
92
|
+
passphraseDurable: passphrase.durable,
|
|
93
|
+
passphraseNote: note,
|
|
94
|
+
...replaced !== void 0 ? {
|
|
95
|
+
replaced: {
|
|
96
|
+
address: replaced.address,
|
|
97
|
+
archivedWalletPath: replaced.archivedPath,
|
|
98
|
+
passphrasePreserved: replaced.passphraseLocation,
|
|
99
|
+
...replaced.unarchivedReason !== void 0 ? { unarchivedReason: replaced.unarchivedReason } : {}
|
|
100
|
+
}
|
|
101
|
+
} : {},
|
|
102
|
+
warnings
|
|
103
|
+
},
|
|
104
|
+
humanLines: [
|
|
105
|
+
`Wallet created: ${address}`,
|
|
106
|
+
`Key stored ${KEY_STORAGE}.`,
|
|
107
|
+
note,
|
|
108
|
+
...replaced !== void 0 ? replacedNote(replaced, path) : [],
|
|
109
|
+
FUNDING_LINE,
|
|
110
|
+
...warnings
|
|
111
|
+
]
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
function replacedNote(replaced, activeWalletPath) {
|
|
115
|
+
const passphraseLine = replaced.passphraseLocation === "store" ? `its passphrase is preserved in ${replaced.location ?? `the OS credential store (service tenjin-cli, account ${replaced.account})`}.` : replaced.passphraseLocation === "env" ? "its passphrase is TENJIN_WALLET_PASSPHRASE \u2014 keep that value." : replaced.unarchivedReason === "rejected-characters" ? "its passphrase was NOT archived: the macOS keychain writer only stores printable ASCII passphrases, and this typed one contains other characters. Keep it yourself, or set TENJIN_WALLET_PASSPHRASE to it." : "its passphrase was NOT archived: this platform has no OS credential store. It exists only where you keep it.";
|
|
116
|
+
return [
|
|
117
|
+
`Previous wallet archived: ${replaced.address} still holds any funds sent to it.`,
|
|
118
|
+
`Its keystore was moved to ${replaced.archivedPath}; ${passphraseLine}`,
|
|
119
|
+
`To make it the active wallet again later: move the current ${activeWalletPath} aside first, then \`mv ${replaced.archivedPath} ${activeWalletPath}\`.`
|
|
120
|
+
];
|
|
121
|
+
}
|
|
122
|
+
async function withWalletLock(dir, fn) {
|
|
123
|
+
await mkdir(dir, { recursive: true, mode: 448 });
|
|
124
|
+
const lockPath = join(dir, "wallet.create.lock");
|
|
125
|
+
try {
|
|
126
|
+
return await withFileLock(lockPath, fn);
|
|
127
|
+
} catch (err) {
|
|
128
|
+
if (err instanceof LockTimeoutError) {
|
|
129
|
+
throw new CliError("INTERNAL", err.message, {
|
|
130
|
+
fix: `If no other tenjin process is running, remove ${lockPath} and retry.`,
|
|
131
|
+
cause: err
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
throw err;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
async function createWalletLocked(ctx, opts) {
|
|
138
|
+
const dir = ctx.dataDir;
|
|
139
|
+
return withWalletLock(dir, async () => {
|
|
140
|
+
const env = opts.env ?? process.env;
|
|
141
|
+
let chosen;
|
|
142
|
+
const passphraseFor = async (forAddress) => {
|
|
143
|
+
const resolved = await resolvePassphraseForCreate(
|
|
144
|
+
{
|
|
145
|
+
env,
|
|
146
|
+
dir,
|
|
147
|
+
...opts.passphrase,
|
|
148
|
+
// Create never prompts; this only picks the 10 s or 60 s write bound.
|
|
149
|
+
isTTY: opts.passphrase?.isTTY ?? ctx.io.isTTY,
|
|
150
|
+
onWait: (line) => emitNotice(ctx.io, line, { json: ctx.flags.json })
|
|
151
|
+
},
|
|
152
|
+
forAddress,
|
|
153
|
+
{ insecureStorage: opts.insecureStorage === true }
|
|
154
|
+
);
|
|
155
|
+
if (resolved.durable && resolved.source !== "env") {
|
|
156
|
+
await writePassphraseRecord(dir, forAddress, { store: resolved.source, by: "create" });
|
|
157
|
+
}
|
|
158
|
+
chosen = resolved;
|
|
159
|
+
return resolved.passphrase;
|
|
160
|
+
};
|
|
161
|
+
const result = (path) => {
|
|
162
|
+
if (chosen === void 0) throw new CliError("INTERNAL", "No wallet passphrase was chosen.");
|
|
163
|
+
return { ...path, passphrase: chosen };
|
|
164
|
+
};
|
|
165
|
+
if (!await walletFileExists(dir)) {
|
|
166
|
+
return result(await createLocalWallet(dir, passphraseFor));
|
|
167
|
+
}
|
|
168
|
+
if (opts.replace !== true) throw walletExistsError(dir);
|
|
169
|
+
const preserved = await verifyAndPreserveOutgoingWallet({
|
|
170
|
+
dir,
|
|
171
|
+
env,
|
|
172
|
+
...opts.passphrase !== void 0 ? { passphrase: opts.passphrase } : {}
|
|
173
|
+
});
|
|
174
|
+
const prepared = await prepareLocalWallet(passphraseFor);
|
|
175
|
+
const archivedPath = await parkOutgoingWallet(dir, preserved.account);
|
|
176
|
+
try {
|
|
177
|
+
const committed = await commitLocalWallet(dir, prepared);
|
|
178
|
+
return { ...result(committed), replaced: { ...preserved, archivedPath } };
|
|
179
|
+
} catch (err) {
|
|
180
|
+
try {
|
|
181
|
+
await restoreParkedWallet(dir, archivedPath);
|
|
182
|
+
} catch (restoreErr) {
|
|
183
|
+
throw new CliError(
|
|
184
|
+
"INTERNAL",
|
|
185
|
+
"Creating the replacement wallet failed after the old wallet was parked, and restoring it also failed.",
|
|
186
|
+
{
|
|
187
|
+
fix: `Your old wallet ${preserved.address} is intact at ${archivedPath} with its passphrase preserved. If a ${walletPath(dir)} now exists, another process wrote it \u2014 move it aside first. Then restore with \`mv ${archivedPath} ${walletPath(dir)}\`.`,
|
|
188
|
+
cause: restoreErr
|
|
189
|
+
}
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
throw new CliError(
|
|
193
|
+
"INTERNAL",
|
|
194
|
+
"Creating the replacement wallet failed; the previous wallet was restored and is the active wallet again.",
|
|
195
|
+
{
|
|
196
|
+
fix: "Nothing was lost. Fix the underlying error, then retry `tenjin wallet create --replace`.",
|
|
197
|
+
cause: err
|
|
198
|
+
}
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
function passphraseNote(p, address, dir) {
|
|
204
|
+
const account = address.toLowerCase();
|
|
205
|
+
if (!p.durable) {
|
|
206
|
+
const attempted = p.attempted ?? "keychain";
|
|
207
|
+
const only = "so Claude Code can unlock this wallet only where that variable is set.";
|
|
208
|
+
switch (p.notSaved) {
|
|
209
|
+
case "rejected-characters":
|
|
210
|
+
return `Encrypted with TENJIN_WALLET_PASSPHRASE only: ${unstorableWhy(attempted)}, ${only} Keep it set in the environment Claude Code starts from.`;
|
|
211
|
+
case "conflict":
|
|
212
|
+
case "kept-existing":
|
|
213
|
+
return `Encrypted with TENJIN_WALLET_PASSPHRASE only: ${describeStoreLocation(attempted, account, dir)} already holds a different passphrase for this wallet, ${only} Run \`tenjin wallet repair\` yourself ${REPAIR_CLAUSE} to replace it.`;
|
|
214
|
+
default:
|
|
215
|
+
break;
|
|
216
|
+
}
|
|
217
|
+
if (attempted === "file") {
|
|
218
|
+
const path = describeStoreLocation("file", account, dir);
|
|
219
|
+
return `Encrypted with TENJIN_WALLET_PASSPHRASE only: Tenjin could not save the passphrase to ${path}, ${only} Check that ${dirname(path)} is writable, then run \`tenjin wallet repair\` yourself ${REPAIR_CLAUSE}.`;
|
|
220
|
+
}
|
|
221
|
+
if (p.notSaved === "store-failed") {
|
|
222
|
+
return `Encrypted with TENJIN_WALLET_PASSPHRASE only: Tenjin could not save the passphrase to the ${storeNoun(attempted)}, ${only} Run \`tenjin wallet repair\` yourself ${REPAIR_CLAUSE}.`;
|
|
223
|
+
}
|
|
224
|
+
return `Encrypted with TENJIN_WALLET_PASSPHRASE only: the ${storeNoun(attempted)} did not answer, ${only} Once it answers, run \`tenjin wallet repair\` yourself ${REPAIR_CLAUSE}.`;
|
|
225
|
+
}
|
|
226
|
+
if (p.source === "file" || p.source === "env") {
|
|
227
|
+
if (p.fileReason === "insecure-storage") {
|
|
228
|
+
return `Passphrase saved to ${p.location} (readable only by you). Anyone who can read that file and wallet.json can spend this wallet.`;
|
|
229
|
+
}
|
|
230
|
+
return NO_KEYRING_LINE(p.location);
|
|
231
|
+
}
|
|
232
|
+
if (p.origin === "env") {
|
|
233
|
+
return `Passphrase from TENJIN_WALLET_PASSPHRASE saved to ${p.location}; Claude Code can unlock this wallet without the variable.`;
|
|
234
|
+
}
|
|
235
|
+
switch (p.source) {
|
|
236
|
+
case "keychain":
|
|
237
|
+
return `Passphrase saved to your macOS keychain (service tenjin-cli, account ${account}); signing will be transparent on this machine.`;
|
|
238
|
+
case "dpapi":
|
|
239
|
+
return `Passphrase saved to a DPAPI-encrypted per-wallet file (passphrase.${account}.dpapi), readable only by you on this Windows machine; signing will be transparent here.`;
|
|
240
|
+
case "secret-service":
|
|
241
|
+
return `Passphrase saved to your Linux keyring (Secret Service, service tenjin-cli, account ${account}); signing will be transparent on this machine.`;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
var SHELL_STARTUP_FILES = [
|
|
245
|
+
".zshrc",
|
|
246
|
+
".zprofile",
|
|
247
|
+
".zshenv",
|
|
248
|
+
".bashrc",
|
|
249
|
+
".bash_profile",
|
|
250
|
+
".profile",
|
|
251
|
+
".config/fish/config.fish"
|
|
252
|
+
];
|
|
253
|
+
async function runWalletRepair(ctx, opts = {}) {
|
|
254
|
+
const env = opts.env ?? process.env;
|
|
255
|
+
const dir = ctx.dataDir;
|
|
256
|
+
const record = await readWalletRecord(dir);
|
|
257
|
+
if (record === null) {
|
|
258
|
+
throw new CliError("WALLET_MISSING", "No wallet found to repair.", {
|
|
259
|
+
fix: "Run `tenjin wallet create` to create one."
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
const address = record.address;
|
|
263
|
+
const humanPre = [];
|
|
264
|
+
const envKey = env.TENJIN_WALLET_KEY;
|
|
265
|
+
if (envKey !== void 0 && envKey.trim().length > 0) {
|
|
266
|
+
humanPre.push(
|
|
267
|
+
"TENJIN_WALLET_KEY is set and shadows the wallet file; repair fixes only the file wallet."
|
|
268
|
+
);
|
|
269
|
+
}
|
|
270
|
+
const fromEnv = env.TENJIN_WALLET_PASSPHRASE;
|
|
271
|
+
let envState = "unset";
|
|
272
|
+
let candidate;
|
|
273
|
+
if (fromEnv !== void 0 && fromEnv.length > 0) {
|
|
274
|
+
const opened = await openKeystore(record.keystore, address, fromEnv);
|
|
275
|
+
envState = opened === "wrong" ? "wrong" : "matches";
|
|
276
|
+
if (opened !== "wrong") candidate = fromEnv;
|
|
277
|
+
}
|
|
278
|
+
const interactive = ctx.io.isTTY && (opts.passphrase?.isTTY ?? Boolean(process.stdin.isTTY));
|
|
279
|
+
if (candidate === void 0 && !interactive && envState === "wrong") {
|
|
280
|
+
candidate = await savedPassphraseThatOpens(dir, env, record, opts.passphrase);
|
|
281
|
+
}
|
|
282
|
+
if (candidate === void 0) {
|
|
283
|
+
if (!interactive) {
|
|
284
|
+
throw new CliError(
|
|
285
|
+
"USAGE",
|
|
286
|
+
envState === "wrong" ? "No passphrase to check: TENJIN_WALLET_PASSPHRASE is set but does not open this wallet, and no saved passphrase does." : "No passphrase to check.",
|
|
287
|
+
{ fix: REPAIR_IN_TERMINAL }
|
|
288
|
+
);
|
|
289
|
+
}
|
|
290
|
+
const entered = await promptPassphrase(
|
|
291
|
+
{ env, ...opts.passphrase },
|
|
292
|
+
`Passphrase for wallet ${address}: `
|
|
293
|
+
);
|
|
294
|
+
if (entered.length === 0) {
|
|
295
|
+
throw new CliError("USAGE", "No passphrase entered; nothing was saved.", {
|
|
296
|
+
fix: REPAIR_IN_TERMINAL
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
candidate = entered;
|
|
300
|
+
}
|
|
301
|
+
const passphrase = candidate;
|
|
302
|
+
const outcome = await withWalletLock(
|
|
303
|
+
dir,
|
|
304
|
+
() => repairLocalWalletPassphrase(
|
|
305
|
+
{
|
|
306
|
+
dir,
|
|
307
|
+
env,
|
|
308
|
+
passphrase: {
|
|
309
|
+
...opts.passphrase,
|
|
310
|
+
isTTY: ctx.io.isTTY,
|
|
311
|
+
onWait: (line) => emitNotice(ctx.io, line, { json: ctx.flags.json })
|
|
312
|
+
}
|
|
313
|
+
},
|
|
314
|
+
passphrase,
|
|
315
|
+
opts.insecureStorage === true ? { insecureStorage: true } : {}
|
|
316
|
+
)
|
|
317
|
+
);
|
|
318
|
+
await markUnlockPending(dir, outcome.address).catch(() => void 0);
|
|
319
|
+
const exports = envState === "unset" ? [] : await scanShellExports(opts.home ?? homedir(), opts.readText);
|
|
320
|
+
const savedLine = outcome.alreadySaved ? `Already saved in ${outcome.location}.` : outcome.fileReason === "no-keyring" ? NO_KEYRING_LINE(outcome.location) : `Saved to ${outcome.location}.`;
|
|
321
|
+
const envLine = envState === "wrong" ? `! TENJIN_WALLET_PASSPHRASE is set in this shell but does not open this wallet. Tenjin now uses the saved passphrase, but remove the variable: \`unset TENJIN_WALLET_PASSPHRASE\`${exports.length > 0 ? `, and delete the export at ${exports.map((e) => `${e.file}:${e.line}`).join(", ")}` : ""}.` : envState === "matches" ? "TENJIN_WALLET_PASSPHRASE in this shell matches; the saved copy is enough, so you can remove it." : null;
|
|
322
|
+
const data = {
|
|
323
|
+
address: outcome.address,
|
|
324
|
+
passphraseStore: outcome.store,
|
|
325
|
+
location: outcome.location,
|
|
326
|
+
alreadySaved: outcome.alreadySaved,
|
|
327
|
+
replacedUnusableEntry: outcome.replacedUnusableEntry,
|
|
328
|
+
envOverride: { state: envState, exports },
|
|
329
|
+
restartRequired: true,
|
|
330
|
+
next: REPAIR_DONE_LINE
|
|
331
|
+
};
|
|
332
|
+
return {
|
|
333
|
+
data,
|
|
334
|
+
humanLines: [
|
|
335
|
+
...humanPre,
|
|
336
|
+
`Wallet: ${outcome.address}`,
|
|
337
|
+
"Passphrase verified: it opens this wallet.",
|
|
338
|
+
savedLine,
|
|
339
|
+
...envLine !== null ? [envLine] : [],
|
|
340
|
+
REPAIR_DONE_LINE
|
|
341
|
+
]
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
async function savedPassphraseThatOpens(dir, env, record, overrides) {
|
|
345
|
+
try {
|
|
346
|
+
const saved = await resolvePassphrase(
|
|
347
|
+
{
|
|
348
|
+
env,
|
|
349
|
+
dir,
|
|
350
|
+
...overrides,
|
|
351
|
+
isTTY: false,
|
|
352
|
+
readDeadlineMs: overrides?.timeouts?.verifyReadMs ?? STORE_TIMEOUTS.verifyReadMs
|
|
353
|
+
},
|
|
354
|
+
record.address,
|
|
355
|
+
{ skipEnv: true }
|
|
356
|
+
);
|
|
357
|
+
const opened = await openKeystore(record.keystore, record.address, saved.passphrase);
|
|
358
|
+
return opened === "ok" ? saved.passphrase : void 0;
|
|
359
|
+
} catch {
|
|
360
|
+
return void 0;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
async function scanShellExports(home, readText = (path) => readFile(path, "utf8").catch(() => null)) {
|
|
364
|
+
const files = [];
|
|
365
|
+
for (const rel of SHELL_STARTUP_FILES) {
|
|
366
|
+
const text = await readText(join(home, rel));
|
|
367
|
+
if (text !== null) files.push({ path: `~/${rel}`, text });
|
|
368
|
+
}
|
|
369
|
+
return findPassphraseExports(files);
|
|
370
|
+
}
|
|
371
|
+
function findPassphraseExports(files) {
|
|
372
|
+
const found = [];
|
|
373
|
+
for (const { path, text } of files) {
|
|
374
|
+
text.split(/\r?\n/).forEach((line, i) => {
|
|
375
|
+
if (line.trimStart().startsWith("#")) return;
|
|
376
|
+
if (/\bTENJIN_WALLET_PASSPHRASE\b/.test(line)) found.push({ file: path, line: i + 1 });
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
return found;
|
|
380
|
+
}
|
|
381
|
+
async function runWalletShow(ctx, opts = {}) {
|
|
382
|
+
const provider = resolveWalletProvider(ctx, opts);
|
|
383
|
+
const desc = await describeWallet(provider);
|
|
384
|
+
const {
|
|
385
|
+
walletPath: path,
|
|
386
|
+
keyStorage,
|
|
387
|
+
passphraseSource,
|
|
388
|
+
archivedWallets,
|
|
389
|
+
warnings
|
|
390
|
+
} = await provider.diagnostics();
|
|
391
|
+
const humanLines = [
|
|
392
|
+
`Address: ${desc.address}`,
|
|
393
|
+
...opts.qr !== false && ctx.io.isTTY && !ctx.flags.json ? addressQrLines(desc.address, ctx.io.stdout) : [],
|
|
394
|
+
`Key source: ${desc.credentialSource}`
|
|
395
|
+
];
|
|
396
|
+
if (keyStorage !== void 0) humanLines.push(`Key storage: ${keyStorage}`);
|
|
397
|
+
if (passphraseSource !== void 0) humanLines.push(`Passphrase: ${passphraseSource}`);
|
|
398
|
+
if (archivedWallets !== void 0 && archivedWallets.length > 0) {
|
|
399
|
+
humanLines.push(
|
|
400
|
+
`Archived (replaced) wallets, funds recoverable via their preserved passphrases: ${archivedWallets.join(", ")}`
|
|
401
|
+
);
|
|
402
|
+
}
|
|
403
|
+
humanLines.push(...warnings);
|
|
404
|
+
return {
|
|
405
|
+
data: {
|
|
406
|
+
address: desc.address,
|
|
407
|
+
provider: desc.provider,
|
|
408
|
+
credentialSource: desc.credentialSource,
|
|
409
|
+
policyEnforcement: desc.policyEnforcement,
|
|
410
|
+
...path !== void 0 ? { walletPath: path } : {},
|
|
411
|
+
...keyStorage !== void 0 ? { keyStorage } : {},
|
|
412
|
+
...passphraseSource !== void 0 ? { passphraseSource } : {},
|
|
413
|
+
...archivedWallets !== void 0 && archivedWallets.length > 0 ? { archivedWallets } : {},
|
|
414
|
+
warnings
|
|
415
|
+
},
|
|
416
|
+
humanLines
|
|
417
|
+
};
|
|
418
|
+
}
|
|
419
|
+
async function runWalletBalance(ctx, opts = {}) {
|
|
420
|
+
const provider = resolveWalletProvider(ctx, opts);
|
|
421
|
+
const desc = await describeWallet(provider);
|
|
422
|
+
const config = await loadRawConfig(ctx.dataDir);
|
|
423
|
+
const rpcUrl = resolveSettings({
|
|
424
|
+
config,
|
|
425
|
+
flags: { baseUrl: ctx.flags.baseUrl },
|
|
426
|
+
env: process.env
|
|
427
|
+
}).rpcUrl.value;
|
|
428
|
+
let atomic;
|
|
429
|
+
try {
|
|
430
|
+
atomic = await getUsdcBalance(desc.address, rpcUrl);
|
|
431
|
+
} catch (err) {
|
|
432
|
+
throw new CliError("RPC_ERROR", `Could not read the USDC balance from ${rpcUrl}.`, {
|
|
433
|
+
fix: "Check your network, or set a working RPC with `tenjin config set rpcUrl <url>`.",
|
|
434
|
+
cause: err
|
|
435
|
+
});
|
|
436
|
+
}
|
|
437
|
+
const balance = toMoney(atomic.toString());
|
|
438
|
+
const credit = toMoney(
|
|
439
|
+
(await channelCredit(ctx.dataDir, desc.address).catch(() => 0n)).toString()
|
|
440
|
+
);
|
|
441
|
+
return {
|
|
442
|
+
data: { address: desc.address, balance, routingCredit: credit },
|
|
443
|
+
humanLines: [
|
|
444
|
+
`Balance: ${balance.usd} USDC on Base` + (credit.atomic !== "0" ? ` (+${credit.usd} routing credit)` : ""),
|
|
445
|
+
...atomic === 0n ? [FUND_COMMAND_LINE] : []
|
|
446
|
+
]
|
|
447
|
+
};
|
|
448
|
+
}
|
|
449
|
+
function custodyWarnings() {
|
|
450
|
+
const warnings = [];
|
|
451
|
+
if (hasEnvKey()) {
|
|
452
|
+
warnings.push("TENJIN_WALLET_KEY is set and shadows this file at runtime.");
|
|
453
|
+
}
|
|
454
|
+
if (isWindows) {
|
|
455
|
+
warnings.push("File permissions are not enforced on Windows; the key file is not restricted.");
|
|
456
|
+
}
|
|
457
|
+
return warnings;
|
|
458
|
+
}
|
|
459
|
+
function hasEnvKey() {
|
|
460
|
+
const envKey = process.env.TENJIN_WALLET_KEY;
|
|
461
|
+
return envKey !== void 0 && envKey.length > 0;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
export {
|
|
465
|
+
REPAIR_DONE_LINE,
|
|
466
|
+
runWalletCreate,
|
|
467
|
+
withWalletLock,
|
|
468
|
+
passphraseNote,
|
|
469
|
+
runWalletRepair,
|
|
470
|
+
findPassphraseExports,
|
|
471
|
+
runWalletShow,
|
|
472
|
+
runWalletBalance
|
|
473
|
+
};
|
|
474
|
+
//# sourceMappingURL=chunk-D5TOQSO4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/wallet.ts"],"sourcesContent":["import { mkdir, readFile } from 'node:fs/promises';\nimport { homedir } from 'node:os';\nimport { dirname, join } from 'node:path';\nimport { CliError } from '../lib/errors';\nimport { emitNotice } from '../lib/output';\nimport { walletPath } from '../lib/paths';\nimport { withFileLock, LockTimeoutError } from '../lib/lock';\nimport { loadRawConfig, resolveSettings } from '../lib/config';\nimport { toMoney } from '../lib/money';\nimport { getUsdcBalance } from '../lib/usdc';\nimport { addressQrLines } from '../lib/qr';\nimport { writePassphraseRecord } from '../lib/passphrase-record';\nimport { NO_KEYRING_LINE, REPAIR_CLAUSE, REPAIR_IN_TERMINAL } from '../lib/wallet-unlock';\nimport { channelCredit } from '../router/channel-credit';\nimport { FUND_COMMAND_LINE, FUNDING_LINE } from '../router/fee';\nimport { markUnlockPending } from '../router/router-observation';\nimport {\n commitLocalWallet,\n createLocalWallet,\n describeWallet,\n openKeystore,\n parkOutgoingWallet,\n prepareLocalWallet,\n repairLocalWalletPassphrase,\n resolveWalletProvider,\n restoreParkedWallet,\n verifyAndPreserveOutgoingWallet,\n type ArchivedWalletInfo,\n type ResolveWalletProviderOptions,\n} from '../lib/wallet';\nimport {\n readWalletRecord,\n walletExistsError,\n walletFileExists,\n type WalletRecord,\n} from '../lib/wallet/store';\nimport {\n describeStoreLocation,\n promptPassphrase,\n resolvePassphrase,\n resolvePassphraseForCreate,\n STORE_TIMEOUTS,\n storeNoun,\n unstorableWhy,\n type CreatePassphraseResult,\n type DurableStore,\n} from '../lib/wallet/passphrase';\nimport type { PassphraseOverrides } from '../lib/wallet/local';\nimport type { CommandContext, CommandResult } from '../context';\n\nconst KEY_STORAGE = 'encrypted (keystore v3, scrypt)';\nconst isWindows = process.platform === 'win32';\n\n/** The last line `tenjin wallet repair` prints: the save is proven, the unlock is not yet. */\nexport const REPAIR_DONE_LINE = 'Passphrase saved; start a new Claude Code session to verify.';\n\nexport interface WalletCreateOptions {\n /**\n * Explicitly replace the existing active wallet (mirrors the `--yes`-style\n * explicit-flag precedent): the outgoing wallet is ARCHIVED — passphrase\n * verified against its keystore and preserved under its own address, keystore\n * parked beside the new one — never destroyed. Without it, create refuses\n * when a wallet exists. There is always exactly ONE active wallet.\n */\n replace?: boolean;\n /** Test seam for passphrase resolution (keychain exec, TTY prompt, platform). */\n passphrase?: PassphraseOverrides;\n /**\n * The environment TENJIN_WALLET_PASSPHRASE is read from; defaults to\n * process.env. A seam rather than a global read so a caller (and above all a\n * test) can settle the passphrase source WITHOUT mutating the real process\n * environment, which under a parallel runner leaks across whole test files.\n */\n env?: NodeJS.ProcessEnv;\n /**\n * `--insecure-storage`: save the passphrase to the 0600 file even where an OS\n * keychain exists. For a person who chose it; never suggested by an error.\n */\n insecureStorage?: boolean;\n}\n\nexport async function runWalletCreate(\n ctx: CommandContext,\n opts: WalletCreateOptions = {},\n): Promise<CommandResult> {\n const { address, walletPath: path, passphrase, replaced } = await createWalletLocked(ctx, opts);\n\n const note = passphraseNote(passphrase, address, ctx.dataDir);\n const warnings = custodyWarnings();\n return {\n data: {\n address,\n walletPath: path,\n provider: 'local',\n policyEnforcement: 'client-only',\n keyStorage: KEY_STORAGE,\n passphraseSource: passphrase.source,\n passphraseLocation: passphrase.location,\n passphraseOrigin: passphrase.origin,\n passphraseDurable: passphrase.durable,\n passphraseNote: note,\n ...(replaced !== undefined\n ? {\n replaced: {\n address: replaced.address,\n archivedWalletPath: replaced.archivedPath,\n passphrasePreserved: replaced.passphraseLocation,\n ...(replaced.unarchivedReason !== undefined\n ? { unarchivedReason: replaced.unarchivedReason }\n : {}),\n },\n }\n : {}),\n warnings,\n },\n humanLines: [\n `Wallet created: ${address}`,\n `Key stored ${KEY_STORAGE}.`,\n note,\n ...(replaced !== undefined ? replacedNote(replaced, path) : []),\n FUNDING_LINE,\n ...warnings,\n ],\n };\n}\n\n/** Where the outgoing wallet's funds live, why they remain reachable, and how to restore it. */\nfunction replacedNote(replaced: ArchivedWalletInfo, activeWalletPath: string): string[] {\n const passphraseLine =\n replaced.passphraseLocation === 'store'\n ? `its passphrase is preserved in ${replaced.location ?? `the OS credential store (service tenjin-cli, account ${replaced.account})`}.`\n : replaced.passphraseLocation === 'env'\n ? 'its passphrase is TENJIN_WALLET_PASSPHRASE — keep that value.'\n : replaced.unarchivedReason === 'rejected-characters'\n ? 'its passphrase was NOT archived: the macOS keychain writer only stores printable ASCII passphrases, and this typed one contains other characters. Keep it yourself, or set TENJIN_WALLET_PASSPHRASE to it.'\n : 'its passphrase was NOT archived: this platform has no OS credential store. It exists only where you keep it.';\n return [\n `Previous wallet archived: ${replaced.address} still holds any funds sent to it.`,\n `Its keystore was moved to ${replaced.archivedPath}; ${passphraseLine}`,\n `To make it the active wallet again later: move the current ${activeWalletPath} aside first, then \\`mv ${replaced.archivedPath} ${activeWalletPath}\\`.`,\n ];\n}\n\n/**\n * Run `fn` under the cross-process wallet lock (`<dir>/wallet.create.lock`):\n * create, `--replace` and repair all change where a wallet's passphrase lives,\n * and the sidecar's read-modify-write assumes one writer at a time.\n *\n * A lock timeout is not the user's error; it surfaces as INTERNAL with the one\n * manual step (there is no auto-steal), keeping the JSON error contract. Every\n * other error — notably a create loser's WALLET_EXISTS — propagates unchanged.\n */\nexport async function withWalletLock<T>(dir: string, fn: () => Promise<T>): Promise<T> {\n // Ensure the data dir exists so the lock's own mkdir has a parent on a fresh\n // install; the exclusive wallet write re-ensures it at 0700 regardless.\n await mkdir(dir, { recursive: true, mode: 0o700 });\n const lockPath = join(dir, 'wallet.create.lock');\n try {\n return await withFileLock(lockPath, fn);\n } catch (err) {\n if (err instanceof LockTimeoutError) {\n throw new CliError('INTERNAL', err.message, {\n fix: `If no other tenjin process is running, remove ${lockPath} and retry.`,\n cause: err,\n });\n }\n throw err;\n }\n}\n\n/**\n * Run the whole create critical section under the wallet lock: the existence\n * pre-check, the passphrase choose-and-store, and the no-clobber write. Without\n * the lock these interleave across two concurrent creates — each generates a\n * distinct passphrase and persists it BEFORE the exclusive file write, so a\n * different process could win the file while this one's per-address entry\n * names a wallet that never landed. Serializing means the loser blocks until\n * the winner commits, then trips the exists check and exits WALLET_EXISTS\n * having never generated or stored a passphrase. The store-before-write\n * ordering stays (it still guards the single-process crash window), and the\n * exclusive write stays the final authority.\n *\n * The passphrase is resolved inside the prepare step's address callback so the\n * store entry is keyed to the new wallet's own address (issue #32), and the\n * sidecar records where it went BEFORE the key is encrypted: a sidecar that\n * cannot be written aborts the create, so no wallet exists whose passphrase\n * location nobody recorded.\n *\n * `--replace` ordering closes the no-active-wallet window: verify-and-preserve\n * the outgoing wallet (no file moves), fully PREPARE the replacement (key,\n * stored passphrase, encrypted keystore — every fallible step) while the old\n * wallet is still active, and only then park the old keystore and commit the\n * new one. A commit failure rolls the park back, so at every exit either the\n * old or the new wallet is the active one.\n */\nasync function createWalletLocked(\n ctx: CommandContext,\n opts: WalletCreateOptions,\n): Promise<{\n address: string;\n walletPath: string;\n passphrase: CreatePassphraseResult;\n replaced?: ArchivedWalletInfo;\n}> {\n const dir = ctx.dataDir;\n return withWalletLock(dir, async () => {\n const env = opts.env ?? process.env;\n let chosen: CreatePassphraseResult | undefined;\n const passphraseFor = async (forAddress: string): Promise<string> => {\n const resolved = await resolvePassphraseForCreate(\n {\n env,\n dir,\n ...opts.passphrase,\n // Create never prompts; this only picks the 10 s or 60 s write bound.\n isTTY: opts.passphrase?.isTTY ?? ctx.io.isTTY,\n onWait: (line) => emitNotice(ctx.io, line, { json: ctx.flags.json }),\n },\n forAddress,\n { insecureStorage: opts.insecureStorage === true },\n );\n if (resolved.durable && resolved.source !== 'env') {\n await writePassphraseRecord(dir, forAddress, { store: resolved.source, by: 'create' });\n }\n chosen = resolved;\n return resolved.passphrase;\n };\n const result = (path: { address: string; walletPath: string }) => {\n if (chosen === undefined) throw new CliError('INTERNAL', 'No wallet passphrase was chosen.');\n return { ...path, passphrase: chosen };\n };\n\n if (!(await walletFileExists(dir))) {\n return result(await createLocalWallet(dir, passphraseFor));\n }\n\n if (opts.replace !== true) throw walletExistsError(dir);\n const preserved = await verifyAndPreserveOutgoingWallet({\n dir,\n env,\n ...(opts.passphrase !== undefined ? { passphrase: opts.passphrase } : {}),\n });\n const prepared = await prepareLocalWallet(passphraseFor);\n const archivedPath = await parkOutgoingWallet(dir, preserved.account);\n try {\n const committed = await commitLocalWallet(dir, prepared);\n return { ...result(committed), replaced: { ...preserved, archivedPath } };\n } catch (err) {\n try {\n await restoreParkedWallet(dir, archivedPath);\n } catch (restoreErr) {\n // The no-clobber restore also refuses when a wallet.json appeared out\n // of band (commit EEXIST) — never overwrite it; name both files.\n throw new CliError(\n 'INTERNAL',\n 'Creating the replacement wallet failed after the old wallet was parked, and restoring it also failed.',\n {\n fix: `Your old wallet ${preserved.address} is intact at ${archivedPath} with its passphrase preserved. If a ${walletPath(dir)} now exists, another process wrote it — move it aside first. Then restore with \\`mv ${archivedPath} ${walletPath(dir)}\\`.`,\n cause: restoreErr,\n },\n );\n }\n // Old wallet restored as the active one; say so rather than surfacing a\n // raw fs error (or a WALLET_EXISTS whose fix suggests re-running --replace).\n throw new CliError(\n 'INTERNAL',\n 'Creating the replacement wallet failed; the previous wallet was restored and is the active wallet again.',\n {\n fix: 'Nothing was lost. Fix the underlying error, then retry `tenjin wallet create --replace`.',\n cause: err,\n },\n );\n }\n });\n}\n\n/**\n * THE ONE LINE THAT SAYS WHERE THE PASSPHRASE WENT (Q2, S4). A generated secret\n * in an OS store keeps today's three notes byte for byte; an env secret saved\n * there says the variable is no longer needed; the 0600 file says why it was\n * used; and an env secret nothing durable holds says so, and how to fix it\n * once the store answers. Every line that names `tenjin wallet repair` carries\n * REPAIR_CLAUSE, and a file failure never names a keychain (decision 6).\n */\nexport function passphraseNote(p: CreatePassphraseResult, address: string, dir: string): string {\n const account = address.toLowerCase();\n if (!p.durable) {\n const attempted = p.attempted ?? 'keychain';\n const only = 'so Claude Code can unlock this wallet only where that variable is set.';\n switch (p.notSaved) {\n case 'rejected-characters':\n // Repair would refuse the same value: the variable is the fix.\n return `Encrypted with TENJIN_WALLET_PASSPHRASE only: ${unstorableWhy(attempted)}, ${only} Keep it set in the environment Claude Code starts from.`;\n case 'conflict':\n case 'kept-existing':\n return `Encrypted with TENJIN_WALLET_PASSPHRASE only: ${describeStoreLocation(attempted, account, dir)} already holds a different passphrase for this wallet, ${only} Run \\`tenjin wallet repair\\` yourself ${REPAIR_CLAUSE} to replace it.`;\n default:\n break;\n }\n if (attempted === 'file') {\n const path = describeStoreLocation('file', account, dir);\n return `Encrypted with TENJIN_WALLET_PASSPHRASE only: Tenjin could not save the passphrase to ${path}, ${only} Check that ${dirname(path)} is writable, then run \\`tenjin wallet repair\\` yourself ${REPAIR_CLAUSE}.`;\n }\n if (p.notSaved === 'store-failed') {\n return `Encrypted with TENJIN_WALLET_PASSPHRASE only: Tenjin could not save the passphrase to the ${storeNoun(attempted)}, ${only} Run \\`tenjin wallet repair\\` yourself ${REPAIR_CLAUSE}.`;\n }\n return `Encrypted with TENJIN_WALLET_PASSPHRASE only: the ${storeNoun(attempted)} did not answer, ${only} Once it answers, run \\`tenjin wallet repair\\` yourself ${REPAIR_CLAUSE}.`;\n }\n if (p.source === 'file' || p.source === 'env') {\n if (p.fileReason === 'insecure-storage') {\n return `Passphrase saved to ${p.location} (readable only by you). Anyone who can read that file and wallet.json can spend this wallet.`;\n }\n return NO_KEYRING_LINE(p.location);\n }\n if (p.origin === 'env') {\n return `Passphrase from TENJIN_WALLET_PASSPHRASE saved to ${p.location}; Claude Code can unlock this wallet without the variable.`;\n }\n switch (p.source) {\n case 'keychain':\n return `Passphrase saved to your macOS keychain (service tenjin-cli, account ${account}); signing will be transparent on this machine.`;\n case 'dpapi':\n return `Passphrase saved to a DPAPI-encrypted per-wallet file (passphrase.${account}.dpapi), readable only by you on this Windows machine; signing will be transparent here.`;\n case 'secret-service':\n return `Passphrase saved to your Linux keyring (Secret Service, service tenjin-cli, account ${account}); signing will be transparent on this machine.`;\n }\n}\n\nexport interface WalletRepairOptions {\n /** `--insecure-storage`: save to the 0600 file even where an OS keychain exists. */\n insecureStorage?: boolean;\n /** Test seam for passphrase storage (keychain exec, TTY prompt, platform). */\n passphrase?: PassphraseOverrides;\n /** The environment TENJIN_WALLET_PASSPHRASE is read from; defaults to process.env. */\n env?: NodeJS.ProcessEnv;\n /** The home directory whose shell startup files are scanned for an export; defaults to os.homedir(). */\n home?: string;\n /** Reads one startup file, null when it cannot be read; a seam for tests. */\n readText?: (path: string) => Promise<string | null>;\n}\n\n/** What `tenjin wallet repair --json` prints. */\nexport interface WalletRepairData {\n address: string;\n passphraseStore: DurableStore;\n location: string;\n alreadySaved: boolean;\n replacedUnusableEntry: boolean;\n envOverride: {\n state: 'unset' | 'matches' | 'wrong';\n exports: Array<{ file: string; line: number }>;\n };\n restartRequired: true;\n next: typeof REPAIR_DONE_LINE;\n}\n\n/** The shell startup files a TENJIN_WALLET_PASSPHRASE export usually lives in, relative to home. */\nconst SHELL_STARTUP_FILES = [\n '.zshrc',\n '.zprofile',\n '.zshenv',\n '.bashrc',\n '.bash_profile',\n '.profile',\n '.config/fish/config.fish',\n];\n\n/**\n * `tenjin wallet repair`: for a wallet Claude Code cannot unlock. A PERSON runs\n * it, in their own terminal: it asks for the passphrase at a hidden prompt (or\n * uses TENJIN_WALLET_PASSPHRASE when that opens the wallet), proves it opens\n * this wallet, saves it where Claude Code's router can read it without a\n * prompt, and marks the unlock as awaiting confirmation, which the next\n * session's router confirms (\"Tenjin wallet unlocked.\").\n *\n * With no terminal and a wrong variable, the saved passphrase is checked in\n * its place, so a headless run still names the variable when the saved one\n * already opens the wallet. With no terminal and nothing usable it refuses with\n * REPAIR_IN_TERMINAL and never suggests passing the passphrase inline (B1): a passphrase never\n * goes on a command line or into chat. It reports success only when the store\n * reads this passphrase back (S1). A TENJIN_WALLET_PASSPHRASE in this shell\n * that does not open the wallet is named, with the startup-file line that\n * exports it, because it shadows the saved passphrase until removed.\n */\nexport async function runWalletRepair(\n ctx: CommandContext,\n opts: WalletRepairOptions = {},\n): Promise<CommandResult> {\n const env = opts.env ?? process.env;\n const dir = ctx.dataDir;\n const record = await readWalletRecord(dir);\n if (record === null) {\n throw new CliError('WALLET_MISSING', 'No wallet found to repair.', {\n fix: 'Run `tenjin wallet create` to create one.',\n });\n }\n const address = record.address;\n const humanPre: string[] = [];\n const envKey = env.TENJIN_WALLET_KEY;\n if (envKey !== undefined && envKey.trim().length > 0) {\n humanPre.push(\n 'TENJIN_WALLET_KEY is set and shadows the wallet file; repair fixes only the file wallet.',\n );\n }\n\n const fromEnv = env.TENJIN_WALLET_PASSPHRASE;\n let envState: WalletRepairData['envOverride']['state'] = 'unset';\n let candidate: string | undefined;\n if (fromEnv !== undefined && fromEnv.length > 0) {\n const opened = await openKeystore(record.keystore, address, fromEnv);\n envState = opened === 'wrong' ? 'wrong' : 'matches';\n // A mismatch is a tampered file; repair refuses it below with the tamper error.\n if (opened !== 'wrong') candidate = fromEnv;\n }\n const interactive = ctx.io.isTTY && (opts.passphrase?.isTTY ?? Boolean(process.stdin.isTTY));\n if (candidate === undefined && !interactive && envState === 'wrong') {\n // Headless with a wrong variable: a SAVED passphrase that opens the wallet\n // is the candidate, so an agent's run reaches the same conflict line (unset\n // the variable) a person's prompt would, instead of a bare USAGE.\n candidate = await savedPassphraseThatOpens(dir, env, record, opts.passphrase);\n }\n if (candidate === undefined) {\n if (!interactive) {\n throw new CliError(\n 'USAGE',\n envState === 'wrong'\n ? 'No passphrase to check: TENJIN_WALLET_PASSPHRASE is set but does not open this wallet, and no saved passphrase does.'\n : 'No passphrase to check.',\n { fix: REPAIR_IN_TERMINAL },\n );\n }\n const entered = await promptPassphrase(\n { env, ...opts.passphrase },\n `Passphrase for wallet ${address}: `,\n );\n if (entered.length === 0) {\n throw new CliError('USAGE', 'No passphrase entered; nothing was saved.', {\n fix: REPAIR_IN_TERMINAL,\n });\n }\n candidate = entered;\n }\n\n const passphrase = candidate;\n const outcome = await withWalletLock(dir, () =>\n repairLocalWalletPassphrase(\n {\n dir,\n env,\n passphrase: {\n ...opts.passphrase,\n isTTY: ctx.io.isTTY,\n onWait: (line) => emitNotice(ctx.io, line, { json: ctx.flags.json }),\n },\n },\n passphrase,\n opts.insecureStorage === true ? { insecureStorage: true } : {},\n ),\n );\n // The next session's router confirms the unlock and says so once. A failure\n // to record that only costs the confirmation line, never the saved passphrase,\n // so it does not fail a repair that is already proven.\n await markUnlockPending(dir, outcome.address).catch(() => undefined);\n\n const exports =\n envState === 'unset' ? [] : await scanShellExports(opts.home ?? homedir(), opts.readText);\n const savedLine = outcome.alreadySaved\n ? `Already saved in ${outcome.location}.`\n : outcome.fileReason === 'no-keyring'\n ? NO_KEYRING_LINE(outcome.location)\n : `Saved to ${outcome.location}.`;\n const envLine =\n envState === 'wrong'\n ? `! TENJIN_WALLET_PASSPHRASE is set in this shell but does not open this wallet. Tenjin now uses the saved passphrase, but remove the variable: \\`unset TENJIN_WALLET_PASSPHRASE\\`${\n exports.length > 0\n ? `, and delete the export at ${exports.map((e) => `${e.file}:${e.line}`).join(', ')}`\n : ''\n }.`\n : envState === 'matches'\n ? 'TENJIN_WALLET_PASSPHRASE in this shell matches; the saved copy is enough, so you can remove it.'\n : null;\n\n const data: WalletRepairData = {\n address: outcome.address,\n passphraseStore: outcome.store,\n location: outcome.location,\n alreadySaved: outcome.alreadySaved,\n replacedUnusableEntry: outcome.replacedUnusableEntry,\n envOverride: { state: envState, exports },\n restartRequired: true,\n next: REPAIR_DONE_LINE,\n };\n return {\n data,\n humanLines: [\n ...humanPre,\n `Wallet: ${outcome.address}`,\n 'Passphrase verified: it opens this wallet.',\n savedLine,\n ...(envLine !== null ? [envLine] : []),\n REPAIR_DONE_LINE,\n ],\n };\n}\n\n/**\n * The saved passphrase (keychain, 0600 file or legacy slot; never the variable\n * and never a prompt) when it opens this wallet, else undefined. Reads are\n * bounded like doctor's verify, so a locked keychain cannot hang a headless\n * run; any failure to read reads as \"none\".\n */\nasync function savedPassphraseThatOpens(\n dir: string,\n env: NodeJS.ProcessEnv,\n record: WalletRecord,\n overrides: PassphraseOverrides | undefined,\n): Promise<string | undefined> {\n try {\n const saved = await resolvePassphrase(\n {\n env,\n dir,\n ...overrides,\n isTTY: false,\n readDeadlineMs: overrides?.timeouts?.verifyReadMs ?? STORE_TIMEOUTS.verifyReadMs,\n },\n record.address,\n { skipEnv: true },\n );\n const opened = await openKeystore(record.keystore, record.address, saved.passphrase);\n return opened === 'ok' ? saved.passphrase : undefined;\n } catch {\n return undefined;\n }\n}\n\n/** Every TENJIN_WALLET_PASSPHRASE line in the usual shell startup files, as `~/<file>:<line>`. */\nasync function scanShellExports(\n home: string,\n readText: (path: string) => Promise<string | null> = (path) =>\n readFile(path, 'utf8').catch(() => null),\n): Promise<Array<{ file: string; line: number }>> {\n const files: Array<{ path: string; text: string }> = [];\n for (const rel of SHELL_STARTUP_FILES) {\n const text = await readText(join(home, rel));\n if (text !== null) files.push({ path: `~/${rel}`, text });\n }\n return findPassphraseExports(files);\n}\n\n/**\n * The lines that set TENJIN_WALLET_PASSPHRASE (any `export`, `set -gx` or plain\n * assignment naming it), skipping `#` comments. Line numbers are 1-based, as an\n * editor shows them. Only the location is returned, never the line's text: the\n * line may hold the passphrase itself.\n */\nexport function findPassphraseExports(\n files: Array<{ path: string; text: string }>,\n): Array<{ file: string; line: number }> {\n const found: Array<{ file: string; line: number }> = [];\n for (const { path, text } of files) {\n text.split(/\\r?\\n/).forEach((line, i) => {\n if (line.trimStart().startsWith('#')) return;\n if (/\\bTENJIN_WALLET_PASSPHRASE\\b/.test(line)) found.push({ file: path, line: i + 1 });\n });\n }\n return found;\n}\n\nexport interface WalletShowOptions extends ResolveWalletProviderOptions {\n /** `--no-qr`: print the address without the QR block at a TTY. */\n qr?: boolean;\n}\n\nexport async function runWalletShow(\n ctx: CommandContext,\n opts: WalletShowOptions = {},\n): Promise<CommandResult> {\n const provider = resolveWalletProvider(ctx, opts);\n const desc = await describeWallet(provider);\n // Diagnostics are the provider's own: a remote provider reports no local file\n // path or perms warning, so `show` never contaminates a remote wallet's output\n // with a stale local wallet.json's state. keyStorage/passphraseSource are the\n // custody posture reported without decrypting or requiring a passphrase.\n const {\n walletPath: path,\n keyStorage,\n passphraseSource,\n archivedWallets,\n warnings,\n } = await provider.diagnostics();\n\n const humanLines = [\n `Address: ${desc.address}`,\n ...(opts.qr !== false && ctx.io.isTTY && !ctx.flags.json\n ? addressQrLines(desc.address, ctx.io.stdout)\n : []),\n `Key source: ${desc.credentialSource}`,\n ];\n if (keyStorage !== undefined) humanLines.push(`Key storage: ${keyStorage}`);\n if (passphraseSource !== undefined) humanLines.push(`Passphrase: ${passphraseSource}`);\n if (archivedWallets !== undefined && archivedWallets.length > 0) {\n // A recovery hint, not a wallet switcher: exactly one wallet is ever active.\n humanLines.push(\n `Archived (replaced) wallets, funds recoverable via their preserved passphrases: ${archivedWallets.join(', ')}`,\n );\n }\n humanLines.push(...warnings);\n\n return {\n data: {\n address: desc.address,\n provider: desc.provider,\n credentialSource: desc.credentialSource,\n policyEnforcement: desc.policyEnforcement,\n ...(path !== undefined ? { walletPath: path } : {}),\n ...(keyStorage !== undefined ? { keyStorage } : {}),\n ...(passphraseSource !== undefined ? { passphraseSource } : {}),\n ...(archivedWallets !== undefined && archivedWallets.length > 0 ? { archivedWallets } : {}),\n warnings,\n },\n humanLines,\n };\n}\n\nexport async function runWalletBalance(\n ctx: CommandContext,\n opts: ResolveWalletProviderOptions = {},\n): Promise<CommandResult> {\n const provider = resolveWalletProvider(ctx, opts);\n const desc = await describeWallet(provider);\n\n const config = await loadRawConfig(ctx.dataDir);\n const rpcUrl = resolveSettings({\n config,\n flags: { baseUrl: ctx.flags.baseUrl },\n env: process.env,\n }).rpcUrl.value;\n\n let atomic: bigint;\n try {\n atomic = await getUsdcBalance(desc.address, rpcUrl);\n } catch (err) {\n throw new CliError('RPC_ERROR', `Could not read the USDC balance from ${rpcUrl}.`, {\n fix: 'Check your network, or set a working RPC with `tenjin config set rpcUrl <url>`.',\n cause: err,\n });\n }\n\n const balance = toMoney(atomic.toString());\n // THE ROUTING CREDIT IS STILL THE USER'S: a deposit moved it off the wallet\n // into the routing channel, where the next routing fees draw from it.\n const credit = toMoney(\n (await channelCredit(ctx.dataDir, desc.address).catch(() => 0n)).toString(),\n );\n return {\n data: { address: desc.address, balance, routingCredit: credit },\n humanLines: [\n `Balance: ${balance.usd} USDC on Base` +\n (credit.atomic !== '0' ? ` (+${credit.usd} routing credit)` : ''),\n ...(atomic === 0n ? [FUND_COMMAND_LINE] : []),\n ],\n };\n}\n\nfunction custodyWarnings(): string[] {\n const warnings: string[] = [];\n if (hasEnvKey()) {\n warnings.push('TENJIN_WALLET_KEY is set and shadows this file at runtime.');\n }\n if (isWindows) {\n warnings.push('File permissions are not enforced on Windows; the key file is not restricted.');\n }\n return warnings;\n}\n\nfunction hasEnvKey(): boolean {\n const envKey = process.env.TENJIN_WALLET_KEY;\n return envKey !== undefined && envKey.length > 0;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,OAAO,gBAAgB;AAChC,SAAS,eAAe;AACxB,SAAS,SAAS,YAAY;AAgD9B,IAAM,cAAc;AACpB,IAAM,YAAY,QAAQ,aAAa;AAGhC,IAAM,mBAAmB;AA2BhC,eAAsB,gBACpB,KACA,OAA4B,CAAC,GACL;AACxB,QAAM,EAAE,SAAS,YAAY,MAAM,YAAY,SAAS,IAAI,MAAM,mBAAmB,KAAK,IAAI;AAE9F,QAAM,OAAO,eAAe,YAAY,SAAS,IAAI,OAAO;AAC5D,QAAM,WAAW,gBAAgB;AACjC,SAAO;AAAA,IACL,MAAM;AAAA,MACJ;AAAA,MACA,YAAY;AAAA,MACZ,UAAU;AAAA,MACV,mBAAmB;AAAA,MACnB,YAAY;AAAA,MACZ,kBAAkB,WAAW;AAAA,MAC7B,oBAAoB,WAAW;AAAA,MAC/B,kBAAkB,WAAW;AAAA,MAC7B,mBAAmB,WAAW;AAAA,MAC9B,gBAAgB;AAAA,MAChB,GAAI,aAAa,SACb;AAAA,QACE,UAAU;AAAA,UACR,SAAS,SAAS;AAAA,UAClB,oBAAoB,SAAS;AAAA,UAC7B,qBAAqB,SAAS;AAAA,UAC9B,GAAI,SAAS,qBAAqB,SAC9B,EAAE,kBAAkB,SAAS,iBAAiB,IAC9C,CA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EAA+E;AAAA,EAC/F;AACA,SAAO;AACT;AAEA,SAAS,YAAqB;AAC5B,QAAM,SAAS,QAAQ,IAAI;AAC3B,SAAO,WAAW,UAAa,OAAO,SAAS;AACjD;","names":[]}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
setTenjinIdentity
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-OTWLERSW.js";
|
|
5
|
+
import {
|
|
6
|
+
isTeamModeConfig
|
|
7
|
+
} from "./chunk-AV5NZMYO.js";
|
|
5
8
|
import {
|
|
6
9
|
hasCode
|
|
7
10
|
} from "./chunk-2I4QTOLB.js";
|
|
8
|
-
import {
|
|
9
|
-
isTeamModeConfig
|
|
10
|
-
} from "./chunk-7WU4OPLP.js";
|
|
11
11
|
import {
|
|
12
12
|
loadRawConfig,
|
|
13
13
|
resolveSettings
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-2GNOFONN.js";
|
|
15
15
|
import {
|
|
16
16
|
knownDeploymentOrigins
|
|
17
17
|
} from "./chunk-XQJXNMSB.js";
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
} from "./chunk-7WEQQJLG.js";
|
|
21
21
|
import {
|
|
22
22
|
installIdPath
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-OJNTCYQQ.js";
|
|
24
24
|
|
|
25
25
|
// src/lib/install-identity.ts
|
|
26
26
|
import { randomUUID } from "node:crypto";
|
|
@@ -111,4 +111,4 @@ export {
|
|
|
111
111
|
enableCliIdentity,
|
|
112
112
|
enableDaemonIdentity
|
|
113
113
|
};
|
|
114
|
-
//# sourceMappingURL=chunk-
|
|
114
|
+
//# sourceMappingURL=chunk-DRDUIZIA.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-7WEQQJLG.js";
|
|
5
5
|
import {
|
|
6
6
|
balanceCachePath
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-OJNTCYQQ.js";
|
|
8
8
|
|
|
9
9
|
// src/lib/usdc-balance.ts
|
|
10
10
|
import { readFile } from "node:fs/promises";
|
|
@@ -105,4 +105,4 @@ export {
|
|
|
105
105
|
readUsdcBalanceWithFallback,
|
|
106
106
|
rememberingBalanceReader
|
|
107
107
|
};
|
|
108
|
-
//# sourceMappingURL=chunk-
|
|
108
|
+
//# sourceMappingURL=chunk-DW4YTVR3.js.map
|