tenjin-cli 0.1.0-alpha.3 → 0.1.0-alpha.30
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/NOTICE.md +54 -7
- package/README.md +149 -264
- package/dist/{_esm-FEASBWRP.js → _esm-CE7KNONL.js} +9 -10
- package/dist/alive-3J3CHOQP.js +21 -0
- package/dist/{ccip-NQXCEK2U.js → ccip-7RMRLAGV.js} +4 -4
- package/dist/{ccip-XR5NE5QK.js → ccip-NLCSCHKI.js} +5 -5
- package/dist/chunk-2SNUOHAT.js +75 -0
- package/dist/chunk-2SNUOHAT.js.map +1 -0
- package/dist/chunk-3O2BQIF6.js +2227 -0
- package/dist/chunk-3O2BQIF6.js.map +1 -0
- package/dist/{chunk-ZMHYXMO6.js → chunk-5IEP5EGE.js} +3 -3
- package/dist/chunk-5LJCEMFD.js +12700 -0
- package/dist/chunk-5LJCEMFD.js.map +1 -0
- package/dist/chunk-6W5GYG3W.js +128 -0
- package/dist/chunk-6W5GYG3W.js.map +1 -0
- package/dist/chunk-7EKYXMUO.js +7536 -0
- package/dist/chunk-7EKYXMUO.js.map +1 -0
- package/dist/chunk-7QKHZQKW.js +1680 -0
- package/dist/chunk-7QKHZQKW.js.map +1 -0
- package/dist/chunk-A36LQPHV.js +29 -0
- package/dist/chunk-A36LQPHV.js.map +1 -0
- package/dist/chunk-AEG2PXBP.js +192 -0
- package/dist/chunk-AEG2PXBP.js.map +1 -0
- package/dist/chunk-AKWGE6JQ.js +49 -0
- package/dist/chunk-AKWGE6JQ.js.map +1 -0
- package/dist/chunk-AWFUPKTM.js +238 -0
- package/dist/chunk-AWFUPKTM.js.map +1 -0
- package/dist/{chunk-UGX7YPX2.js → chunk-AWQPGIR6.js} +7 -9
- package/dist/{chunk-UGX7YPX2.js.map → chunk-AWQPGIR6.js.map} +1 -1
- package/dist/{chunk-5CLSD5YN.js → chunk-BPMWXTFX.js} +2 -2
- package/dist/chunk-EBVIKMCH.js +108 -0
- package/dist/chunk-EBVIKMCH.js.map +1 -0
- package/dist/{chunk-YALGASEU.js → chunk-EGELTSPU.js} +2 -2
- package/dist/{chunk-S3IGX57D.js → chunk-EL56RW2J.js} +166 -7237
- package/dist/chunk-EL56RW2J.js.map +1 -0
- package/dist/chunk-HE2MS4QO.js +256 -0
- package/dist/chunk-HE2MS4QO.js.map +1 -0
- package/dist/{chunk-CYOF7ROH.js → chunk-HPWO4O6S.js} +3 -3
- package/dist/chunk-IOODYAXL.js +324 -0
- package/dist/chunk-IOODYAXL.js.map +1 -0
- package/dist/chunk-JMM6YE7J.js +2174 -0
- package/dist/chunk-JMM6YE7J.js.map +1 -0
- package/dist/{chunk-QVX5MWJZ.js → chunk-JRGFKVAZ.js} +2 -2
- package/dist/{chunk-HIVZG55D.js → chunk-KG3D7FIF.js} +2 -2
- package/dist/chunk-KHE6L6TD.js +416 -0
- package/dist/chunk-KHE6L6TD.js.map +1 -0
- package/dist/chunk-KOGZDMHO.js +21 -0
- package/dist/chunk-KOGZDMHO.js.map +1 -0
- package/dist/chunk-KYFZTGMC.js +237 -0
- package/dist/chunk-KYFZTGMC.js.map +1 -0
- package/dist/chunk-LFZJM56J.js +159 -0
- package/dist/chunk-LFZJM56J.js.map +1 -0
- package/dist/chunk-LHHMV4GU.js +27 -0
- package/dist/chunk-LHHMV4GU.js.map +1 -0
- package/dist/{chunk-YBMMV4Y4.js → chunk-MEFB5KHA.js} +13 -5
- package/dist/chunk-MEFB5KHA.js.map +1 -0
- package/dist/{chunk-NCE5NSN6.js → chunk-N35E6CM2.js} +140 -10
- package/dist/chunk-N35E6CM2.js.map +1 -0
- package/dist/chunk-NZIP4PA2.js +114 -0
- package/dist/chunk-NZIP4PA2.js.map +1 -0
- package/dist/chunk-O2FRQ2L2.js +168 -0
- package/dist/chunk-O2FRQ2L2.js.map +1 -0
- package/dist/chunk-OK2TDZQU.js +404 -0
- package/dist/chunk-OK2TDZQU.js.map +1 -0
- package/dist/chunk-ORWL5BSN.js +269 -0
- package/dist/chunk-ORWL5BSN.js.map +1 -0
- package/dist/{chunk-Z6MFJV5Z.js → chunk-OSYTBCUC.js} +850 -499
- package/dist/chunk-OSYTBCUC.js.map +1 -0
- package/dist/chunk-P7LABKCW.js +90 -0
- package/dist/chunk-P7LABKCW.js.map +1 -0
- package/dist/chunk-PAYV4XUA.js +151 -0
- package/dist/chunk-PAYV4XUA.js.map +1 -0
- package/dist/{chunk-ZABPQJ3M.js → chunk-POUWHWID.js} +2 -2
- package/dist/chunk-QUVVWYJW.js +112 -0
- package/dist/chunk-QUVVWYJW.js.map +1 -0
- package/dist/chunk-RAULEAZ6.js +228 -0
- package/dist/chunk-RAULEAZ6.js.map +1 -0
- package/dist/chunk-S4SAZ7OD.js +30 -0
- package/dist/chunk-S4SAZ7OD.js.map +1 -0
- package/dist/chunk-SJLTEINJ.js +117 -0
- package/dist/chunk-SJLTEINJ.js.map +1 -0
- package/dist/chunk-SPAVAYSW.js +125 -0
- package/dist/chunk-SPAVAYSW.js.map +1 -0
- package/dist/chunk-TTBKWWTV.js +1605 -0
- package/dist/chunk-TTBKWWTV.js.map +1 -0
- package/dist/{chunk-RRN3YTK7.js → chunk-TTNESUPQ.js} +3 -3
- package/dist/chunk-U6YQ6FRI.js +378 -0
- package/dist/chunk-U6YQ6FRI.js.map +1 -0
- package/dist/chunk-VFMQTSXG.js +29 -0
- package/dist/chunk-VFMQTSXG.js.map +1 -0
- package/dist/chunk-VUFAK2LW.js +115 -0
- package/dist/chunk-VUFAK2LW.js.map +1 -0
- package/dist/chunk-VZGAONSJ.js +194 -0
- package/dist/chunk-VZGAONSJ.js.map +1 -0
- package/dist/{chunk-OYMYCW7J.js → chunk-WO5BJNIB.js} +682 -53
- package/dist/chunk-WO5BJNIB.js.map +1 -0
- package/dist/chunk-WVUSXNIE.js +39 -0
- package/dist/chunk-WVUSXNIE.js.map +1 -0
- package/dist/chunk-XKESD27X.js +10 -0
- package/dist/chunk-XKESD27X.js.map +1 -0
- package/dist/{chunk-HSDCI7OV.js → chunk-XZKD7DIF.js} +3 -3
- package/dist/{chunk-XJIW7USF.js → chunk-YFQOA5AU.js} +118 -9
- package/dist/chunk-YFQOA5AU.js.map +1 -0
- package/dist/chunk-YHKXNYTB.js +105 -0
- package/dist/chunk-YHKXNYTB.js.map +1 -0
- package/dist/{cli-SBXI5AMS.js → cli-O5SN7ZJ4.js} +382 -214
- package/dist/cli-O5SN7ZJ4.js.map +1 -0
- package/dist/config-OJQI27LT.js +45 -0
- package/dist/dist-3LOO6M4U.js +2842 -0
- package/dist/dist-3LOO6M4U.js.map +1 -0
- package/dist/doctor-IQQJHGGM.js +590 -0
- package/dist/doctor-IQQJHGGM.js.map +1 -0
- package/dist/env-proxy-XL4P73MZ.js +15 -0
- package/dist/{ethersCompat-Df4a6QIZ-3YZIAXDK.js → ethersCompat-Df4a6QIZ-THAVUGIJ.js} +5 -5
- package/dist/fund-WEV6DMTD.js +365 -0
- package/dist/fund-WEV6DMTD.js.map +1 -0
- package/dist/hook-command-D2P3ILRV.js +32 -0
- package/dist/hosts/claude/.claude-plugin/marketplace.json +19 -0
- package/dist/hosts/claude/tenjin/.claude-plugin/plugin.json +14 -0
- package/dist/hosts/claude/tenjin/.mcp.json +12 -0
- package/dist/hosts/claude/tenjin/hooks/hooks.json +221 -0
- package/dist/index.js +21 -2
- package/dist/index.js.map +1 -1
- package/dist/install-TUCRF32I.js +60 -0
- package/dist/install-identity-WHPNMNMQ.js +26 -0
- package/dist/install-wallet-MA27FTQ5.js +113 -0
- package/dist/install-wallet-MA27FTQ5.js.map +1 -0
- package/dist/mcp-QML7ZMPH.js +13427 -0
- package/dist/mcp-QML7ZMPH.js.map +1 -0
- package/dist/package-LGKYOEPV.js +37 -0
- package/dist/package-LGKYOEPV.js.map +1 -0
- package/dist/paths-POPTXJO6.js +61 -0
- package/dist/paths-POPTXJO6.js.map +1 -0
- package/dist/pay-2C2UBBXJ.js +51 -0
- package/dist/pay-2C2UBBXJ.js.map +1 -0
- package/dist/payments-C44QUFXU.js +106 -0
- package/dist/payments-C44QUFXU.js.map +1 -0
- package/dist/redact-6W23GGJC.js +15 -0
- package/dist/redact-6W23GGJC.js.map +1 -0
- package/dist/{secp256k1-N3ZHU7LB.js → secp256k1-ZZZT2CAX.js} +3 -3
- package/dist/secp256k1-ZZZT2CAX.js.map +1 -0
- package/dist/send-KVJX4XIR.js +222 -0
- package/dist/send-KVJX4XIR.js.map +1 -0
- package/dist/status-S7C3WMSH.js +115 -0
- package/dist/status-S7C3WMSH.js.map +1 -0
- package/dist/status-line-YR2T5HC4.js +86 -0
- package/dist/status-line-YR2T5HC4.js.map +1 -0
- package/dist/uninstall-HY6LKIIT.js +149 -0
- package/dist/uninstall-HY6LKIIT.js.map +1 -0
- package/dist/update-OJV22LR3.js +36 -0
- package/dist/update-OJV22LR3.js.map +1 -0
- package/dist/usdc-JK4RRFFQ.js +39 -0
- package/dist/usdc-JK4RRFFQ.js.map +1 -0
- package/dist/{viemAdapter-By13KInL-ZZE6UV4Y.js → viemAdapter-By13KInL-X2VY6CY3.js} +5 -5
- package/dist/viemAdapter-By13KInL-X2VY6CY3.js.map +1 -0
- package/dist/wallet-PD2IMZDU.js +39 -0
- package/dist/wallet-PD2IMZDU.js.map +1 -0
- package/dist/wallet-kdf-worker.mjs +980 -0
- package/docs/agent-permissions.md +180 -0
- package/docs/safety-model.md +59 -0
- package/docs/troubleshooting.md +13 -0
- package/package.json +28 -19
- package/LICENSE +0 -21
- package/dist/buy-EE6SEXP6.js +0 -1598
- package/dist/buy-EE6SEXP6.js.map +0 -1
- package/dist/candidate-ERMSYYQZ.js +0 -127
- package/dist/candidate-ERMSYYQZ.js.map +0 -1
- package/dist/chunk-3OV7E5G5.js +0 -18
- package/dist/chunk-3OV7E5G5.js.map +0 -1
- package/dist/chunk-4ONXEEQL.js +0 -152
- package/dist/chunk-4ONXEEQL.js.map +0 -1
- package/dist/chunk-662MSGZB.js +0 -286
- package/dist/chunk-662MSGZB.js.map +0 -1
- package/dist/chunk-7KUW4MJD.js +0 -59
- package/dist/chunk-7KUW4MJD.js.map +0 -1
- package/dist/chunk-AWPAWHNX.js +0 -333
- package/dist/chunk-AWPAWHNX.js.map +0 -1
- package/dist/chunk-DXTQ3CSI.js +0 -171
- package/dist/chunk-DXTQ3CSI.js.map +0 -1
- package/dist/chunk-ESPNTPQ2.js +0 -207
- package/dist/chunk-ESPNTPQ2.js.map +0 -1
- package/dist/chunk-FJPLRISB.js +0 -79
- package/dist/chunk-FJPLRISB.js.map +0 -1
- package/dist/chunk-GO75V3NZ.js +0 -160
- package/dist/chunk-GO75V3NZ.js.map +0 -1
- package/dist/chunk-JPHG2JW3.js +0 -96
- package/dist/chunk-JPHG2JW3.js.map +0 -1
- package/dist/chunk-MUBUQVC3.js +0 -67
- package/dist/chunk-MUBUQVC3.js.map +0 -1
- package/dist/chunk-NCE5NSN6.js.map +0 -1
- package/dist/chunk-OYMYCW7J.js.map +0 -1
- package/dist/chunk-RY4XKNV3.js +0 -140
- package/dist/chunk-RY4XKNV3.js.map +0 -1
- package/dist/chunk-S3IGX57D.js.map +0 -1
- package/dist/chunk-TLCMMYLY.js +0 -126
- package/dist/chunk-TLCMMYLY.js.map +0 -1
- package/dist/chunk-UO22YNY4.js +0 -69
- package/dist/chunk-UO22YNY4.js.map +0 -1
- package/dist/chunk-XHC6FCGZ.js +0 -261
- package/dist/chunk-XHC6FCGZ.js.map +0 -1
- package/dist/chunk-XJIW7USF.js.map +0 -1
- package/dist/chunk-YBMMV4Y4.js.map +0 -1
- package/dist/chunk-YN5SHIXQ.js +0 -126
- package/dist/chunk-YN5SHIXQ.js.map +0 -1
- package/dist/chunk-Z52RA3NC.js +0 -137
- package/dist/chunk-Z52RA3NC.js.map +0 -1
- package/dist/chunk-Z6MFJV5Z.js.map +0 -1
- package/dist/cli-SBXI5AMS.js.map +0 -1
- package/dist/config-VELDKLHY.js +0 -21
- package/dist/doctor-T3KWNNP2.js +0 -20
- package/dist/inspect-LMKOXE4Y.js +0 -96
- package/dist/inspect-LMKOXE4Y.js.map +0 -1
- package/dist/install-LEX3ENQ6.js +0 -387
- package/dist/install-LEX3ENQ6.js.map +0 -1
- package/dist/lookup-ZPN2Q67N.js +0 -129
- package/dist/lookup-ZPN2Q67N.js.map +0 -1
- package/dist/outcome-N7TAK6WR.js +0 -66
- package/dist/outcome-N7TAK6WR.js.map +0 -1
- package/dist/publish-BKBQQAW4.js +0 -1478
- package/dist/publish-BKBQQAW4.js.map +0 -1
- package/dist/usdc-JIAJW4SV.js +0 -22
- package/dist/wallet-CWEMYVIH.js +0 -179
- package/dist/wallet-CWEMYVIH.js.map +0 -1
- package/dist/wallet-PA54CRBL.js +0 -30
- package/skills/tenjin/SKILL.md +0 -199
- package/skills/tenjin-publish/SKILL.md +0 -111
- package/skills/tenjin-search/SKILL.md +0 -133
- /package/dist/{_esm-FEASBWRP.js.map → _esm-CE7KNONL.js.map} +0 -0
- /package/dist/{ccip-NQXCEK2U.js.map → alive-3J3CHOQP.js.map} +0 -0
- /package/dist/{ccip-XR5NE5QK.js.map → ccip-7RMRLAGV.js.map} +0 -0
- /package/dist/{config-VELDKLHY.js.map → ccip-NLCSCHKI.js.map} +0 -0
- /package/dist/{chunk-ZMHYXMO6.js.map → chunk-5IEP5EGE.js.map} +0 -0
- /package/dist/{chunk-5CLSD5YN.js.map → chunk-BPMWXTFX.js.map} +0 -0
- /package/dist/{chunk-YALGASEU.js.map → chunk-EGELTSPU.js.map} +0 -0
- /package/dist/{chunk-CYOF7ROH.js.map → chunk-HPWO4O6S.js.map} +0 -0
- /package/dist/{chunk-QVX5MWJZ.js.map → chunk-JRGFKVAZ.js.map} +0 -0
- /package/dist/{chunk-HIVZG55D.js.map → chunk-KG3D7FIF.js.map} +0 -0
- /package/dist/{chunk-ZABPQJ3M.js.map → chunk-POUWHWID.js.map} +0 -0
- /package/dist/{chunk-RRN3YTK7.js.map → chunk-TTNESUPQ.js.map} +0 -0
- /package/dist/{chunk-HSDCI7OV.js.map → chunk-XZKD7DIF.js.map} +0 -0
- /package/dist/{doctor-T3KWNNP2.js.map → config-OJQI27LT.js.map} +0 -0
- /package/dist/{ethersCompat-Df4a6QIZ-3YZIAXDK.js.map → env-proxy-XL4P73MZ.js.map} +0 -0
- /package/dist/{secp256k1-N3ZHU7LB.js.map → ethersCompat-Df4a6QIZ-THAVUGIJ.js.map} +0 -0
- /package/dist/{usdc-JIAJW4SV.js.map → hook-command-D2P3ILRV.js.map} +0 -0
- /package/dist/{viemAdapter-By13KInL-ZZE6UV4Y.js.map → install-TUCRF32I.js.map} +0 -0
- /package/dist/{wallet-PA54CRBL.js.map → install-identity-WHPNMNMQ.js.map} +0 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
bin,
|
|
4
|
+
bugs,
|
|
5
|
+
description,
|
|
6
|
+
devDependencies,
|
|
7
|
+
engines,
|
|
8
|
+
files,
|
|
9
|
+
homepage,
|
|
10
|
+
keywords,
|
|
11
|
+
name,
|
|
12
|
+
packageManager,
|
|
13
|
+
package_default,
|
|
14
|
+
repository,
|
|
15
|
+
scripts,
|
|
16
|
+
type,
|
|
17
|
+
version
|
|
18
|
+
} from "./chunk-VUFAK2LW.js";
|
|
19
|
+
import "./chunk-ZXTAQYNA.js";
|
|
20
|
+
export {
|
|
21
|
+
bin,
|
|
22
|
+
bugs,
|
|
23
|
+
package_default as default,
|
|
24
|
+
description,
|
|
25
|
+
devDependencies,
|
|
26
|
+
engines,
|
|
27
|
+
files,
|
|
28
|
+
homepage,
|
|
29
|
+
keywords,
|
|
30
|
+
name,
|
|
31
|
+
packageManager,
|
|
32
|
+
repository,
|
|
33
|
+
scripts,
|
|
34
|
+
type,
|
|
35
|
+
version
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=package-LGKYOEPV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
VITEST_REPORTER_FILE,
|
|
4
|
+
archivedWalletPath,
|
|
5
|
+
balanceCachePath,
|
|
6
|
+
configPath,
|
|
7
|
+
daemonBundlePath,
|
|
8
|
+
daemonLogPath,
|
|
9
|
+
daemonPidPath,
|
|
10
|
+
daemonSpawnPath,
|
|
11
|
+
daemonTokenPath,
|
|
12
|
+
dataDir,
|
|
13
|
+
defaultDataDir,
|
|
14
|
+
downloadsDir,
|
|
15
|
+
hookHealthPath,
|
|
16
|
+
hooksDir,
|
|
17
|
+
installIdPath,
|
|
18
|
+
jobsDir,
|
|
19
|
+
loopDbPath,
|
|
20
|
+
paidLedgerPath,
|
|
21
|
+
passphraseBlobPath,
|
|
22
|
+
passphraseBlobPathFor,
|
|
23
|
+
quotesDir,
|
|
24
|
+
sessionPath,
|
|
25
|
+
shimBundlePath,
|
|
26
|
+
spendLedgerPath,
|
|
27
|
+
updateCheckPath,
|
|
28
|
+
vitestReporterPath,
|
|
29
|
+
walletPath
|
|
30
|
+
} from "./chunk-SJLTEINJ.js";
|
|
31
|
+
import "./chunk-ZXTAQYNA.js";
|
|
32
|
+
export {
|
|
33
|
+
VITEST_REPORTER_FILE,
|
|
34
|
+
archivedWalletPath,
|
|
35
|
+
balanceCachePath,
|
|
36
|
+
configPath,
|
|
37
|
+
daemonBundlePath,
|
|
38
|
+
daemonLogPath,
|
|
39
|
+
daemonPidPath,
|
|
40
|
+
daemonSpawnPath,
|
|
41
|
+
daemonTokenPath,
|
|
42
|
+
dataDir,
|
|
43
|
+
defaultDataDir,
|
|
44
|
+
downloadsDir,
|
|
45
|
+
hookHealthPath,
|
|
46
|
+
hooksDir,
|
|
47
|
+
installIdPath,
|
|
48
|
+
jobsDir,
|
|
49
|
+
loopDbPath,
|
|
50
|
+
paidLedgerPath,
|
|
51
|
+
passphraseBlobPath,
|
|
52
|
+
passphraseBlobPathFor,
|
|
53
|
+
quotesDir,
|
|
54
|
+
sessionPath,
|
|
55
|
+
shimBundlePath,
|
|
56
|
+
spendLedgerPath,
|
|
57
|
+
updateCheckPath,
|
|
58
|
+
vitestReporterPath,
|
|
59
|
+
walletPath
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=paths-POPTXJO6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
MAX_PAID_LEG_TIMEOUT_MS,
|
|
4
|
+
paidLegTimeoutMs,
|
|
5
|
+
quoteRouterCall,
|
|
6
|
+
runPay,
|
|
7
|
+
sellerLine,
|
|
8
|
+
settlementTx
|
|
9
|
+
} from "./chunk-5LJCEMFD.js";
|
|
10
|
+
import "./chunk-7EKYXMUO.js";
|
|
11
|
+
import "./chunk-POUWHWID.js";
|
|
12
|
+
import "./chunk-LHHMV4GU.js";
|
|
13
|
+
import "./chunk-EBVIKMCH.js";
|
|
14
|
+
import "./chunk-YFQOA5AU.js";
|
|
15
|
+
import "./chunk-LFZJM56J.js";
|
|
16
|
+
import "./chunk-EL56RW2J.js";
|
|
17
|
+
import "./chunk-OSYTBCUC.js";
|
|
18
|
+
import "./chunk-AEG2PXBP.js";
|
|
19
|
+
import "./chunk-NZIP4PA2.js";
|
|
20
|
+
import "./chunk-TTNESUPQ.js";
|
|
21
|
+
import "./chunk-HPWO4O6S.js";
|
|
22
|
+
import "./chunk-XZKD7DIF.js";
|
|
23
|
+
import "./chunk-MEFB5KHA.js";
|
|
24
|
+
import "./chunk-KYFZTGMC.js";
|
|
25
|
+
import "./chunk-2SNUOHAT.js";
|
|
26
|
+
import "./chunk-AWQPGIR6.js";
|
|
27
|
+
import "./chunk-N35E6CM2.js";
|
|
28
|
+
import "./chunk-JRGFKVAZ.js";
|
|
29
|
+
import "./chunk-5IEP5EGE.js";
|
|
30
|
+
import "./chunk-EGELTSPU.js";
|
|
31
|
+
import "./chunk-KG3D7FIF.js";
|
|
32
|
+
import "./chunk-RBJPAZFI.js";
|
|
33
|
+
import "./chunk-BPMWXTFX.js";
|
|
34
|
+
import "./chunk-7QKHZQKW.js";
|
|
35
|
+
import "./chunk-IOODYAXL.js";
|
|
36
|
+
import "./chunk-2I4QTOLB.js";
|
|
37
|
+
import "./chunk-AWFUPKTM.js";
|
|
38
|
+
import "./chunk-WO5BJNIB.js";
|
|
39
|
+
import "./chunk-O2FRQ2L2.js";
|
|
40
|
+
import "./chunk-SJLTEINJ.js";
|
|
41
|
+
import "./chunk-VUFAK2LW.js";
|
|
42
|
+
import "./chunk-ZXTAQYNA.js";
|
|
43
|
+
export {
|
|
44
|
+
MAX_PAID_LEG_TIMEOUT_MS,
|
|
45
|
+
paidLegTimeoutMs,
|
|
46
|
+
quoteRouterCall,
|
|
47
|
+
runPay,
|
|
48
|
+
sellerLine,
|
|
49
|
+
settlementTx
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=pay-2C2UBBXJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
readPaidRecords,
|
|
4
|
+
reconcilePayments
|
|
5
|
+
} from "./chunk-OK2TDZQU.js";
|
|
6
|
+
import "./chunk-EBVIKMCH.js";
|
|
7
|
+
import "./chunk-AEG2PXBP.js";
|
|
8
|
+
import "./chunk-NZIP4PA2.js";
|
|
9
|
+
import "./chunk-MEFB5KHA.js";
|
|
10
|
+
import {
|
|
11
|
+
sanitizeForTerminal
|
|
12
|
+
} from "./chunk-KYFZTGMC.js";
|
|
13
|
+
import "./chunk-2SNUOHAT.js";
|
|
14
|
+
import "./chunk-7QKHZQKW.js";
|
|
15
|
+
import "./chunk-2I4QTOLB.js";
|
|
16
|
+
import {
|
|
17
|
+
resolveContextSettings
|
|
18
|
+
} from "./chunk-AWFUPKTM.js";
|
|
19
|
+
import {
|
|
20
|
+
ATOMIC_RE,
|
|
21
|
+
formatUsdDisplay,
|
|
22
|
+
toMoney
|
|
23
|
+
} from "./chunk-WO5BJNIB.js";
|
|
24
|
+
import "./chunk-O2FRQ2L2.js";
|
|
25
|
+
import {
|
|
26
|
+
paidLedgerPath
|
|
27
|
+
} from "./chunk-SJLTEINJ.js";
|
|
28
|
+
import "./chunk-ZXTAQYNA.js";
|
|
29
|
+
|
|
30
|
+
// src/router/payments.ts
|
|
31
|
+
var LIST_LIMIT = 20;
|
|
32
|
+
var SETTLEMENT_WORDS = {
|
|
33
|
+
settled: "settled",
|
|
34
|
+
unknown: "unknown",
|
|
35
|
+
not_charged: "not charged"
|
|
36
|
+
};
|
|
37
|
+
async function runPaymentsList(ctx) {
|
|
38
|
+
const ledger = paidLedgerPath(ctx.dataDir);
|
|
39
|
+
const records = (await readPaidRecords(ctx.dataDir)).filter(
|
|
40
|
+
(record) => ATOMIC_RE.test(record.amountAtomic)
|
|
41
|
+
);
|
|
42
|
+
const payments = records.slice(-LIST_LIMIT).reverse().map((record) => ({
|
|
43
|
+
at: record.ts,
|
|
44
|
+
provider: record.provider,
|
|
45
|
+
service: record.capabilityId,
|
|
46
|
+
amount: toMoney(record.amountAtomic),
|
|
47
|
+
settlement: record.settlement,
|
|
48
|
+
...record.txHash !== void 0 ? { txHash: record.txHash } : {}
|
|
49
|
+
}));
|
|
50
|
+
const unknown = records.filter((record) => record.settlement === "unknown").length;
|
|
51
|
+
if (payments.length === 0) {
|
|
52
|
+
return {
|
|
53
|
+
data: { ledger, total: 0, payments },
|
|
54
|
+
humanLines: ["No paid lookups on this machine yet."]
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
const header = ["TIME (UTC)", "PROVIDER", "SERVICE", "AMOUNT", "STATUS", "TX"];
|
|
58
|
+
const cells = [
|
|
59
|
+
header,
|
|
60
|
+
...payments.map((p) => [
|
|
61
|
+
p.at.slice(0, 16).replace("T", " "),
|
|
62
|
+
sanitizeForTerminal(p.provider),
|
|
63
|
+
sanitizeForTerminal(p.service),
|
|
64
|
+
`$${formatUsdDisplay(p.amount.atomic)}`,
|
|
65
|
+
SETTLEMENT_WORDS[p.settlement] ?? p.settlement,
|
|
66
|
+
p.txHash ?? ""
|
|
67
|
+
])
|
|
68
|
+
];
|
|
69
|
+
const width = header.map((_, i) => Math.max(...cells.map((row) => (row[i] ?? "").length)));
|
|
70
|
+
return {
|
|
71
|
+
data: { ledger, total: records.length, payments },
|
|
72
|
+
humanLines: [
|
|
73
|
+
...cells.map(
|
|
74
|
+
(row) => row.map((cell, i) => cell.padEnd(width[i] ?? 0)).join(" ").trimEnd()
|
|
75
|
+
),
|
|
76
|
+
records.length > payments.length ? `The newest ${payments.length} of ${records.length}; every one is in ${ledger}.` : `From ${ledger}.`,
|
|
77
|
+
...unknown > 0 ? [
|
|
78
|
+
`${unknown} with settlement unknown: \`tenjin payments reconcile\` asks the chain once they expire.`
|
|
79
|
+
] : []
|
|
80
|
+
]
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
var MAX_COMMAND_CHECKS = 50;
|
|
84
|
+
async function runPaymentsReconcile(ctx, deps = {}) {
|
|
85
|
+
const settings = await resolveContextSettings(ctx);
|
|
86
|
+
const outcome = await reconcilePayments(ctx.dataDir, {
|
|
87
|
+
rpcUrl: settings.rpcUrl,
|
|
88
|
+
max: MAX_COMMAND_CHECKS,
|
|
89
|
+
// Asked for by hand: every due record, however recently it was asked about.
|
|
90
|
+
recheckMs: 0,
|
|
91
|
+
...deps.fetchImpl !== void 0 ? { fetchImpl: deps.fetchImpl } : {},
|
|
92
|
+
...deps.now !== void 0 ? { now: deps.now } : {}
|
|
93
|
+
});
|
|
94
|
+
return {
|
|
95
|
+
data: { ledger: paidLedgerPath(ctx.dataDir), ...outcome },
|
|
96
|
+
humanLines: [
|
|
97
|
+
outcome.checked === 0 ? "No paid lookup is waiting on its settlement." : `Checked ${outcome.checked}: ${outcome.settled} charged, ${outcome.notCharged} not charged.` + (outcome.releasedAtomic !== "0" ? ` ${toMoney(outcome.releasedAtomic).usd} USD went back to today's limit.` : ""),
|
|
98
|
+
...outcome.unknown > 0 ? [`${outcome.unknown} still unknown: not expired yet, or the chain could not say.`] : []
|
|
99
|
+
]
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
export {
|
|
103
|
+
runPaymentsList,
|
|
104
|
+
runPaymentsReconcile
|
|
105
|
+
};
|
|
106
|
+
//# sourceMappingURL=payments-C44QUFXU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/router/payments.ts"],"sourcesContent":["import { ATOMIC_RE } from '../lib/ids';\nimport { formatUsdDisplay, toMoney } from '../lib/money';\nimport { sanitizeForTerminal } from '../lib/output';\nimport { paidLedgerPath } from '../lib/paths';\nimport { resolveContextSettings } from '../lib/settings';\nimport type { CommandContext, CommandResult } from '../context';\nimport { readPaidRecords, reconcilePayments, type Settlement } from './paid';\n\n/** How many of the newest records a bare `tenjin payments` prints. */\nconst LIST_LIMIT = 20;\n\nconst SETTLEMENT_WORDS: Record<Settlement, string> = {\n settled: 'settled',\n unknown: 'unknown',\n not_charged: 'not charged',\n};\n\n/**\n * `tenjin payments`: the newest paid lookups in the ledger, newest first, at\n * most {@link LIST_LIMIT}. It reads the local file and nothing else; a record\n * whose settlement is unknown stays unknown here until `reconcile` asks.\n */\nexport async function runPaymentsList(ctx: CommandContext): Promise<CommandResult> {\n const ledger = paidLedgerPath(ctx.dataDir);\n const records = (await readPaidRecords(ctx.dataDir)).filter((record) =>\n ATOMIC_RE.test(record.amountAtomic),\n );\n const payments = records\n .slice(-LIST_LIMIT)\n .reverse()\n .map((record) => ({\n at: record.ts,\n provider: record.provider,\n service: record.capabilityId,\n amount: toMoney(record.amountAtomic),\n settlement: record.settlement,\n ...(record.txHash !== undefined ? { txHash: record.txHash } : {}),\n }));\n const unknown = records.filter((record) => record.settlement === 'unknown').length;\n if (payments.length === 0) {\n return {\n data: { ledger, total: 0, payments },\n humanLines: ['No paid lookups on this machine yet.'],\n };\n }\n const header = ['TIME (UTC)', 'PROVIDER', 'SERVICE', 'AMOUNT', 'STATUS', 'TX'];\n const cells = [\n header,\n ...payments.map((p) => [\n p.at.slice(0, 16).replace('T', ' '),\n sanitizeForTerminal(p.provider),\n sanitizeForTerminal(p.service),\n `$${formatUsdDisplay(p.amount.atomic)}`,\n SETTLEMENT_WORDS[p.settlement] ?? p.settlement,\n p.txHash ?? '',\n ]),\n ];\n const width = header.map((_, i) => Math.max(...cells.map((row) => (row[i] ?? '').length)));\n return {\n data: { ledger, total: records.length, payments },\n humanLines: [\n ...cells.map((row) =>\n row\n .map((cell, i) => cell.padEnd(width[i] ?? 0))\n .join(' ')\n .trimEnd(),\n ),\n records.length > payments.length\n ? `The newest ${payments.length} of ${records.length}; every one is in ${ledger}.`\n : `From ${ledger}.`,\n ...(unknown > 0\n ? [\n `${unknown} with settlement unknown: \\`tenjin payments reconcile\\` asks the chain once they expire.`,\n ]\n : []),\n ],\n };\n}\n\n/**\n * `tenjin payments reconcile`: settle every \"settlement unknown\" record in the\n * paid ledger that the chain can now answer for. The `request` tool runs the\n * same pass, three records at a time, before each lookup; this one asks about\n * up to {@link MAX_COMMAND_CHECKS}.\n *\n * A record found not charged also gives its amount back to the daily budget,\n * when the spend ledger still holds that payment's exposure in this window.\n */\n\nconst MAX_COMMAND_CHECKS = 50;\n\nexport interface PaymentsDeps {\n fetchImpl?: typeof fetch;\n now?: () => number;\n}\n\nexport async function runPaymentsReconcile(\n ctx: CommandContext,\n deps: PaymentsDeps = {},\n): Promise<CommandResult> {\n const settings = await resolveContextSettings(ctx);\n const outcome = await reconcilePayments(ctx.dataDir, {\n rpcUrl: settings.rpcUrl,\n max: MAX_COMMAND_CHECKS,\n // Asked for by hand: every due record, however recently it was asked about.\n recheckMs: 0,\n ...(deps.fetchImpl !== undefined ? { fetchImpl: deps.fetchImpl } : {}),\n ...(deps.now !== undefined ? { now: deps.now } : {}),\n });\n return {\n data: { ledger: paidLedgerPath(ctx.dataDir), ...outcome },\n humanLines: [\n outcome.checked === 0\n ? 'No paid lookup is waiting on its settlement.'\n : `Checked ${outcome.checked}: ${outcome.settled} charged, ${outcome.notCharged} not charged.` +\n (outcome.releasedAtomic !== '0'\n ? ` ${toMoney(outcome.releasedAtomic).usd} USD went back to today's limit.`\n : ''),\n ...(outcome.unknown > 0\n ? [`${outcome.unknown} still unknown: not expired yet, or the chain could not say.`]\n : []),\n ],\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,IAAM,aAAa;AAEnB,IAAM,mBAA+C;AAAA,EACnD,SAAS;AAAA,EACT,SAAS;AAAA,EACT,aAAa;AACf;AAOA,eAAsB,gBAAgB,KAA6C;AACjF,QAAM,SAAS,eAAe,IAAI,OAAO;AACzC,QAAM,WAAW,MAAM,gBAAgB,IAAI,OAAO,GAAG;AAAA,IAAO,CAAC,WAC3D,UAAU,KAAK,OAAO,YAAY;AAAA,EACpC;AACA,QAAM,WAAW,QACd,MAAM,CAAC,UAAU,EACjB,QAAQ,EACR,IAAI,CAAC,YAAY;AAAA,IAChB,IAAI,OAAO;AAAA,IACX,UAAU,OAAO;AAAA,IACjB,SAAS,OAAO;AAAA,IAChB,QAAQ,QAAQ,OAAO,YAAY;AAAA,IACnC,YAAY,OAAO;AAAA,IACnB,GAAI,OAAO,WAAW,SAAY,EAAE,QAAQ,OAAO,OAAO,IAAI,CAAC;AAAA,EACjE,EAAE;AACJ,QAAM,UAAU,QAAQ,OAAO,CAAC,WAAW,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C,GACE;AACxB,QAAM,WAAW,MAAM,uBAAuB,GAAG;AACjD,QAAM,UAAU,MAAM,kBAAkB,IAAI,SAAS;AAAA,IACnD,QAAQ,SAAS;AAAA,IACjB,KAAK;AAAA;AAAA,IAEL,WAAW;AAAA,IACX,GAAI,KAAK,cAAc,SAAY,EAAE,WAAW,KAAK,UAAU,IAAI,CAAC;AAAA,IACpE,GAAI,KAAK,QAAQ,SAAY,EAAE,KAAK,KAAK,IAAI,IAAI,CAAC;AAAA,EACpD,CAAC;AACD,SAAO;AAAA,IACL,MAAM,EAAE,QAAQ,eAAe,IAAI,OAAO,GAAG,GAAG,QAAQ;AAAA,IACxD,YAAY;AAAA,MACV,QAAQ,YAAY,IAChB,iDACA,WAAW,QAAQ,OAAO,KAAK,QAAQ,OAAO,aAAa,QAAQ,UAAU,mBAC5E,QAAQ,mBAAmB,MACxB,IAAI,QAAQ,QAAQ,cAAc,EAAE,GAAG,qCACvC;AAAA,MACR,GAAI,QAAQ,UAAU,IAClB,CAAC,GAAG,QAAQ,OAAO,8DAA8D,IACjF,CAAC;AAAA,IACP;AAAA,EACF;AACF;","names":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
EMITTED_CHECKS,
|
|
4
|
+
checksFor,
|
|
5
|
+
findings,
|
|
6
|
+
mask
|
|
7
|
+
} from "./chunk-7QKHZQKW.js";
|
|
8
|
+
import "./chunk-ZXTAQYNA.js";
|
|
9
|
+
export {
|
|
10
|
+
EMITTED_CHECKS,
|
|
11
|
+
checksFor,
|
|
12
|
+
findings,
|
|
13
|
+
mask
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=redact-6W23GGJC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -5,9 +5,9 @@ import {
|
|
|
5
5
|
schnorr,
|
|
6
6
|
secp256k1,
|
|
7
7
|
secp256k1_hasher
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-JRGFKVAZ.js";
|
|
9
9
|
import "./chunk-RBJPAZFI.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-BPMWXTFX.js";
|
|
11
11
|
import "./chunk-ZXTAQYNA.js";
|
|
12
12
|
export {
|
|
13
13
|
encodeToCurve,
|
|
@@ -16,4 +16,4 @@ export {
|
|
|
16
16
|
secp256k1,
|
|
17
17
|
secp256k1_hasher
|
|
18
18
|
};
|
|
19
|
-
//# sourceMappingURL=secp256k1-
|
|
19
|
+
//# sourceMappingURL=secp256k1-ZZZT2CAX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,222 @@
|
|
|
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
|
+
FeeCapExceededError,
|
|
7
|
+
SendPendingError,
|
|
8
|
+
SendRevertedError,
|
|
9
|
+
USDC_ADDRESS,
|
|
10
|
+
broadcastUsdcSend,
|
|
11
|
+
getUsdcBalance,
|
|
12
|
+
prepareUsdcSend
|
|
13
|
+
} from "./chunk-YFQOA5AU.js";
|
|
14
|
+
import {
|
|
15
|
+
describeWallet,
|
|
16
|
+
resolveWalletProvider
|
|
17
|
+
} from "./chunk-OSYTBCUC.js";
|
|
18
|
+
import "./chunk-AEG2PXBP.js";
|
|
19
|
+
import "./chunk-NZIP4PA2.js";
|
|
20
|
+
import "./chunk-MEFB5KHA.js";
|
|
21
|
+
import "./chunk-KYFZTGMC.js";
|
|
22
|
+
import "./chunk-2SNUOHAT.js";
|
|
23
|
+
import "./chunk-AWQPGIR6.js";
|
|
24
|
+
import "./chunk-N35E6CM2.js";
|
|
25
|
+
import "./chunk-JRGFKVAZ.js";
|
|
26
|
+
import "./chunk-5IEP5EGE.js";
|
|
27
|
+
import {
|
|
28
|
+
formatEther,
|
|
29
|
+
getAddress,
|
|
30
|
+
isAddress
|
|
31
|
+
} from "./chunk-EGELTSPU.js";
|
|
32
|
+
import "./chunk-KG3D7FIF.js";
|
|
33
|
+
import "./chunk-RBJPAZFI.js";
|
|
34
|
+
import "./chunk-BPMWXTFX.js";
|
|
35
|
+
import "./chunk-2I4QTOLB.js";
|
|
36
|
+
import {
|
|
37
|
+
resolveContextSettings
|
|
38
|
+
} from "./chunk-AWFUPKTM.js";
|
|
39
|
+
import {
|
|
40
|
+
CliError,
|
|
41
|
+
SEND_MAX_UNSET,
|
|
42
|
+
parseUsdToAtomic,
|
|
43
|
+
toMoney
|
|
44
|
+
} from "./chunk-WO5BJNIB.js";
|
|
45
|
+
import "./chunk-O2FRQ2L2.js";
|
|
46
|
+
import "./chunk-SJLTEINJ.js";
|
|
47
|
+
import "./chunk-ZXTAQYNA.js";
|
|
48
|
+
|
|
49
|
+
// src/commands/send.ts
|
|
50
|
+
var ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
51
|
+
var DEAD_ADDRESS = "0x000000000000000000000000000000000000dEaD";
|
|
52
|
+
async function runSend(args, ctx, deps = {}) {
|
|
53
|
+
requireUsdc(args.token);
|
|
54
|
+
const amountAtomic = BigInt(parseUsdToAtomic(args.amount));
|
|
55
|
+
if (amountAtomic === 0n) {
|
|
56
|
+
throw new CliError("USAGE", "The send amount must be greater than zero.", {
|
|
57
|
+
fix: "Pass a positive decimal USDC amount, e.g. `tenjin wallet send 5 usdc <to>`."
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
const to = parseRecipient(args.to);
|
|
61
|
+
const provider = resolveWalletProvider(
|
|
62
|
+
ctx,
|
|
63
|
+
deps.provider !== void 0 ? { provider: deps.provider } : {}
|
|
64
|
+
);
|
|
65
|
+
const desc = await describeWallet(provider);
|
|
66
|
+
if (to.toLowerCase() === desc.address.toLowerCase()) {
|
|
67
|
+
throw new CliError("USAGE", "The recipient is this wallet itself.", {
|
|
68
|
+
fix: "Pass the destination wallet address, not the sending one."
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
const { rpcUrl, sendMaxAmountAtomic } = await resolveContextSettings(ctx);
|
|
72
|
+
enforceSendCap(amountAtomic, sendMaxAmountAtomic);
|
|
73
|
+
let balance;
|
|
74
|
+
try {
|
|
75
|
+
balance = await getUsdcBalance(desc.address, rpcUrl);
|
|
76
|
+
} catch (err) {
|
|
77
|
+
throw new CliError("RPC_ERROR", `Could not read the USDC balance from ${rpcUrl}.`, {
|
|
78
|
+
fix: "Check your network, or set a working RPC with `tenjin config set rpcUrl <url>`.",
|
|
79
|
+
cause: err
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
if (amountAtomic > balance) {
|
|
83
|
+
throw new CliError("REFUSED", "The amount exceeds the wallet USDC balance.", {
|
|
84
|
+
fix: "Check `tenjin wallet balance` and send at most that amount.",
|
|
85
|
+
details: {
|
|
86
|
+
requested: toMoney(amountAtomic.toString()),
|
|
87
|
+
balance: toMoney(balance.toString())
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
let prepared;
|
|
92
|
+
try {
|
|
93
|
+
prepared = await prepareUsdcSend({ from: desc.address, to, amountAtomic, rpcUrl });
|
|
94
|
+
} catch (err) {
|
|
95
|
+
if (err instanceof FeeCapExceededError) {
|
|
96
|
+
throw new CliError("REFUSED", "The RPC gas/fee estimate is abnormal for Base; refusing.", {
|
|
97
|
+
fix: "Check `tenjin config get rpcUrl` points at a trusted Base RPC; if the RPC is fine, Base fees are spiking \u2014 wait and retry.",
|
|
98
|
+
cause: err
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
throw new CliError("RPC_ERROR", "Could not prepare the transfer on Base.", {
|
|
102
|
+
fix: "Check your network, or set a working RPC with `tenjin config set rpcUrl <url>`.",
|
|
103
|
+
cause: err
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
if (prepared.ethBalanceWei < prepared.feeWei) {
|
|
107
|
+
throw new CliError("REFUSED", "The wallet has no ETH on Base to pay the network fee.", {
|
|
108
|
+
fix: `Send a little ETH on Base to ${desc.address} (about ${formatEther(prepared.feeWei)} ETH needed), then retry.`,
|
|
109
|
+
details: {
|
|
110
|
+
ethBalanceWei: prepared.ethBalanceWei.toString(),
|
|
111
|
+
feeWei: prepared.feeWei.toString()
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
const approved = await confirmSend(ctx, deps, args.yes === true, {
|
|
116
|
+
amountAtomic,
|
|
117
|
+
to,
|
|
118
|
+
from: desc.address,
|
|
119
|
+
feeWei: prepared.feeWei
|
|
120
|
+
});
|
|
121
|
+
if (!approved) {
|
|
122
|
+
throw new CliError("REFUSED", "Send not confirmed.", {
|
|
123
|
+
fix: "Verify the recipient and amount, then re-run with --yes to approve this transfer.",
|
|
124
|
+
details: { to, amount: toMoney(amountAtomic.toString()) }
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
const signer = await provider.getSigner();
|
|
128
|
+
if (signer.address.toLowerCase() !== desc.address.toLowerCase()) {
|
|
129
|
+
throw new CliError(
|
|
130
|
+
"PROVIDER_ERROR",
|
|
131
|
+
`The signer address ${signer.address} does not match the confirmed wallet ${desc.address}.`,
|
|
132
|
+
{ fix: "The wallet changed between preview and signing; re-run `tenjin wallet send`." }
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
let txHash;
|
|
136
|
+
try {
|
|
137
|
+
txHash = await broadcastUsdcSend({ signer, prepared, rpcUrl });
|
|
138
|
+
} catch (err) {
|
|
139
|
+
if (err instanceof SendRevertedError) {
|
|
140
|
+
throw new CliError("SEND_FAILED", "The transfer was mined but reverted; no USDC moved.", {
|
|
141
|
+
fix: "Check the transaction on a Base explorer, then retry if the cause is transient.",
|
|
142
|
+
details: { txHash: err.txHash },
|
|
143
|
+
cause: err
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
if (err instanceof SendPendingError) {
|
|
147
|
+
throw new CliError("SEND_FAILED", "The transfer was broadcast but not confirmed in time.", {
|
|
148
|
+
fix: "Check the transaction on a Base explorer before retrying: it may still mine, and an immediate retry could double-send.",
|
|
149
|
+
details: { txHash: err.txHash, pending: true },
|
|
150
|
+
cause: err
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
throw new CliError("RPC_ERROR", "The transfer could not be sent on Base.", {
|
|
154
|
+
fix: "Check the network and RPC, then retry.",
|
|
155
|
+
cause: err
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
const amount = toMoney(amountAtomic.toString());
|
|
159
|
+
return {
|
|
160
|
+
data: { txHash, from: signer.address, to, token: "USDC", network: "base", amount },
|
|
161
|
+
humanLines: [`Sent ${amount.usd} USDC on Base to ${to}`, `Tx: ${txHash}`]
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
function enforceSendCap(amountAtomic, capAtomic) {
|
|
165
|
+
if (capAtomic === SEND_MAX_UNSET) {
|
|
166
|
+
throw new CliError(
|
|
167
|
+
"POLICY_REFUSED",
|
|
168
|
+
"No sendMaxAmount is configured; a per-send cap must be set before the first send.",
|
|
169
|
+
{
|
|
170
|
+
fix: "Run `tenjin config set sendMaxAmount <usd>` (or `0` to disable send, or `none` to opt in to uncapped), then retry. --yes does not bypass this."
|
|
171
|
+
}
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
if (capAtomic === null) return;
|
|
175
|
+
if (capAtomic === 0n) {
|
|
176
|
+
throw new CliError("POLICY_REFUSED", "Sending is disabled by sendMaxAmount = 0.", {
|
|
177
|
+
fix: "Run `tenjin config set sendMaxAmount <usd|none>` to allow sends."
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
if (amountAtomic > capAtomic) {
|
|
181
|
+
throw new CliError("POLICY_REFUSED", "The amount exceeds the sendMaxAmount cap.", {
|
|
182
|
+
fix: "Send a smaller amount, or raise the cap with `tenjin config set sendMaxAmount <usd>`.",
|
|
183
|
+
details: { requested: toMoney(amountAtomic.toString()), cap: toMoney(capAtomic.toString()) }
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
function requireUsdc(token) {
|
|
188
|
+
if (token.trim().toLowerCase() === "usdc") return;
|
|
189
|
+
throw new CliError("USAGE", `Unsupported token: ${JSON.stringify(token)}`, {
|
|
190
|
+
fix: "Only USDC on Base is supported: `tenjin wallet send <amount> usdc <to>`."
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
function parseRecipient(raw) {
|
|
194
|
+
const trimmed = raw.trim();
|
|
195
|
+
if (!isAddress(trimmed)) {
|
|
196
|
+
throw new CliError("USAGE", `Invalid recipient address: ${JSON.stringify(raw)}`, {
|
|
197
|
+
fix: "Pass a 0x-prefixed 20-byte address, checksummed or all-lowercase (lowercase skips the checksum typo check)."
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
const to = getAddress(trimmed);
|
|
201
|
+
if (to === USDC_ADDRESS || to === ZERO_ADDRESS || to === DEAD_ADDRESS) {
|
|
202
|
+
throw new CliError("USAGE", "The recipient is a known fund-destroying address.", {
|
|
203
|
+
fix: "Tokens sent to the token contract, the zero address, or the burn address are unrecoverable. Pass the destination wallet address."
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
return to;
|
|
207
|
+
}
|
|
208
|
+
async function confirmSend(ctx, deps, yes, d) {
|
|
209
|
+
if (yes) return true;
|
|
210
|
+
const prompt = `Send ${toMoney(d.amountAtomic.toString()).usd} USDC on Base
|
|
211
|
+
from ${d.from}
|
|
212
|
+
to ${d.to}
|
|
213
|
+
network fee up to ~${formatEther(d.feeWei)} ETH
|
|
214
|
+
This moves funds out of the agent wallet and cannot be undone. [y/N] `;
|
|
215
|
+
if (deps.confirm !== void 0) return deps.confirm(prompt);
|
|
216
|
+
if (!ctx.io.isTTY || !process.stdin.isTTY) return false;
|
|
217
|
+
return promptYesNo(prompt);
|
|
218
|
+
}
|
|
219
|
+
export {
|
|
220
|
+
runSend
|
|
221
|
+
};
|
|
222
|
+
//# sourceMappingURL=send-KVJX4XIR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/send.ts"],"sourcesContent":["import { formatEther, getAddress, isAddress, type Address } from 'viem';\nimport { SEND_MAX_UNSET } from '../lib/config';\nimport { CliError } from '../lib/errors';\nimport { parseUsdToAtomic, toMoney } from '../lib/money';\nimport { promptYesNo } from '../lib/prompt';\nimport { resolveContextSettings } from '../lib/settings';\nimport {\n broadcastUsdcSend,\n FeeCapExceededError,\n getUsdcBalance,\n prepareUsdcSend,\n SendPendingError,\n SendRevertedError,\n USDC_ADDRESS,\n} from '../lib/usdc';\nimport { describeWallet, resolveWalletProvider, type WalletProvider } from '../lib/wallet';\nimport type { CommandContext, CommandResult } from '../context';\n\n/**\n * `tenjin wallet send <amount> <token> <to>`: the escape hatch that moves funds OUT of\n * the agent wallet, complementary to delegation (which redirects future revenue\n * off the hot key; this is for a balance already on it). Invariants a reader\n * cannot derive from the code order alone:\n * - the confirm (buy's posture: interactive y/N, `--yes` bypasses the prompt\n * only, headless without it refuses) runs BEFORE the signer is resolved, so\n * no refusal branch ever touches key material;\n * - `sendMaxAmount` is a spend-policy gate, NOT satisfiable by --yes, and it\n * has NO default: unset refuses until `config set sendMaxAmount` is run\n * (require-set-before-first-send; \"none\" is an explicit uncapped opt-in);\n * - the verb is deliberately absent from the MCP toolset (spec 10's narrow\n * toolset) and the skill adapters — human-invoked only, both pinned by tests.\n */\n\nexport interface SendArgs {\n /** Decimal USD at the edge (O1 convention); converted to atomic exactly once. */\n amount: string;\n token: string;\n /** Recipient address, 0x-prefixed; checksummed or all-lowercase. */\n to: string;\n /** Skip the interactive confirm. REQUIRED to send when not at a TTY. */\n yes?: boolean;\n}\n\nexport interface SendDeps {\n /** Test seam: bypass the local wallet provider. */\n provider?: WalletProvider;\n /** Interactive-confirm seam; defaults to a TTY y/n prompt (same shape as buy). */\n confirm?: (prompt: string) => Promise<boolean>;\n}\n\nconst ZERO_ADDRESS: Address = '0x0000000000000000000000000000000000000000';\nconst DEAD_ADDRESS: Address = '0x000000000000000000000000000000000000dEaD';\n\nexport async function runSend(\n args: SendArgs,\n ctx: CommandContext,\n deps: SendDeps = {},\n): Promise<CommandResult> {\n requireUsdc(args.token);\n const amountAtomic = BigInt(parseUsdToAtomic(args.amount));\n if (amountAtomic === 0n) {\n throw new CliError('USAGE', 'The send amount must be greater than zero.', {\n fix: 'Pass a positive decimal USDC amount, e.g. `tenjin wallet send 5 usdc <to>`.',\n });\n }\n const to = parseRecipient(args.to);\n\n const provider = resolveWalletProvider(\n ctx,\n deps.provider !== undefined ? { provider: deps.provider } : {},\n );\n // Address + posture only; surfaces WALLET_MISSING. No key material yet.\n const desc = await describeWallet(provider);\n if (to.toLowerCase() === desc.address.toLowerCase()) {\n throw new CliError('USAGE', 'The recipient is this wallet itself.', {\n fix: 'Pass the destination wallet address, not the sending one.',\n });\n }\n\n const { rpcUrl, sendMaxAmountAtomic } = await resolveContextSettings(ctx);\n enforceSendCap(amountAtomic, sendMaxAmountAtomic);\n\n let balance: bigint;\n try {\n balance = 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 if (amountAtomic > balance) {\n throw new CliError('REFUSED', 'The amount exceeds the wallet USDC balance.', {\n fix: 'Check `tenjin wallet balance` and send at most that amount.',\n details: {\n requested: toMoney(amountAtomic.toString()),\n balance: toMoney(balance.toString()),\n },\n });\n }\n\n // Read-only chain prep before the confirm, so the prompt can show the fee and\n // a wallet without gas refuses before asking anyone to approve anything.\n let prepared;\n try {\n prepared = await prepareUsdcSend({ from: desc.address, to, amountAtomic, rpcUrl });\n } catch (err) {\n if (err instanceof FeeCapExceededError) {\n throw new CliError('REFUSED', 'The RPC gas/fee estimate is abnormal for Base; refusing.', {\n fix: 'Check `tenjin config get rpcUrl` points at a trusted Base RPC; if the RPC is fine, Base fees are spiking — wait and retry.',\n cause: err,\n });\n }\n throw new CliError('RPC_ERROR', 'Could not prepare the transfer on Base.', {\n fix: 'Check your network, or set a working RPC with `tenjin config set rpcUrl <url>`.',\n cause: err,\n });\n }\n if (prepared.ethBalanceWei < prepared.feeWei) {\n throw new CliError('REFUSED', 'The wallet has no ETH on Base to pay the network fee.', {\n fix: `Send a little ETH on Base to ${desc.address} (about ${formatEther(prepared.feeWei)} ETH needed), then retry.`,\n details: {\n ethBalanceWei: prepared.ethBalanceWei.toString(),\n feeWei: prepared.feeWei.toString(),\n },\n });\n }\n\n const approved = await confirmSend(ctx, deps, args.yes === true, {\n amountAtomic,\n to,\n from: desc.address,\n feeWei: prepared.feeWei,\n });\n if (!approved) {\n throw new CliError('REFUSED', 'Send not confirmed.', {\n fix: 'Verify the recipient and amount, then re-run with --yes to approve this transfer.',\n details: { to, amount: toMoney(amountAtomic.toString()) },\n });\n }\n\n // The only door to the key; a missing passphrase entry refuses here with the\n // provider's coded error. The signer must be the wallet the human just saw:\n // the local provider guarantees it, a hosted one is only trusted after this.\n const signer = await provider.getSigner();\n if (signer.address.toLowerCase() !== desc.address.toLowerCase()) {\n throw new CliError(\n 'PROVIDER_ERROR',\n `The signer address ${signer.address} does not match the confirmed wallet ${desc.address}.`,\n { fix: 'The wallet changed between preview and signing; re-run `tenjin wallet send`.' },\n );\n }\n\n let txHash: string;\n try {\n txHash = await broadcastUsdcSend({ signer, prepared, rpcUrl });\n } catch (err) {\n if (err instanceof SendRevertedError) {\n throw new CliError('SEND_FAILED', 'The transfer was mined but reverted; no USDC moved.', {\n fix: 'Check the transaction on a Base explorer, then retry if the cause is transient.',\n details: { txHash: err.txHash },\n cause: err,\n });\n }\n if (err instanceof SendPendingError) {\n throw new CliError('SEND_FAILED', 'The transfer was broadcast but not confirmed in time.', {\n fix: 'Check the transaction on a Base explorer before retrying: it may still mine, and an immediate retry could double-send.',\n details: { txHash: err.txHash, pending: true },\n cause: err,\n });\n }\n throw new CliError('RPC_ERROR', 'The transfer could not be sent on Base.', {\n fix: 'Check the network and RPC, then retry.',\n cause: err,\n });\n }\n\n const amount = toMoney(amountAtomic.toString());\n return {\n data: { txHash, from: signer.address, to, token: 'USDC', network: 'base', amount },\n humanLines: [`Sent ${amount.usd} USDC on Base to ${to}`, `Tx: ${txHash}`],\n };\n}\n\n/**\n * The hard per-send cap (`config set sendMaxAmount`): a policy gate, not a\n * confirm — no branch here is satisfiable by --yes. There is no default cap:\n * an unset key refuses (require-set-before-first-send), exactly as strict as\n * the set-cap refusals below.\n */\nfunction enforceSendCap(\n amountAtomic: bigint,\n capAtomic: bigint | null | typeof SEND_MAX_UNSET,\n): void {\n if (capAtomic === SEND_MAX_UNSET) {\n throw new CliError(\n 'POLICY_REFUSED',\n 'No sendMaxAmount is configured; a per-send cap must be set before the first send.',\n {\n fix: 'Run `tenjin config set sendMaxAmount <usd>` (or `0` to disable send, or `none` to opt in to uncapped), then retry. --yes does not bypass this.',\n },\n );\n }\n if (capAtomic === null) return;\n if (capAtomic === 0n) {\n throw new CliError('POLICY_REFUSED', 'Sending is disabled by sendMaxAmount = 0.', {\n fix: 'Run `tenjin config set sendMaxAmount <usd|none>` to allow sends.',\n });\n }\n if (amountAtomic > capAtomic) {\n throw new CliError('POLICY_REFUSED', 'The amount exceeds the sendMaxAmount cap.', {\n fix: 'Send a smaller amount, or raise the cap with `tenjin config set sendMaxAmount <usd>`.',\n details: { requested: toMoney(amountAtomic.toString()), cap: toMoney(capAtomic.toString()) },\n });\n }\n}\n\n/** USDC on Base only; anything else is a usage error, not a guess. */\nfunction requireUsdc(token: string): void {\n if (token.trim().toLowerCase() === 'usdc') return;\n throw new CliError('USAGE', `Unsupported token: ${JSON.stringify(token)}`, {\n fix: 'Only USDC on Base is supported: `tenjin wallet send <amount> usdc <to>`.',\n });\n}\n\n/**\n * Validate and resolve the recipient. Strict `isAddress` refuses malformed input\n * and a bad EIP-55 checksum on MIXED-CASE input (all-lowercase input carries no\n * checksum to verify — that limit is inherent to the format); `getAddress` then\n * yields the checksummed form the preview shows and the transfer targets. Known\n * fund-destroying destinations (the USDC contract, the zero address, the burn\n * address) refuse outright.\n */\nfunction parseRecipient(raw: string): Address {\n const trimmed = raw.trim();\n if (!isAddress(trimmed)) {\n throw new CliError('USAGE', `Invalid recipient address: ${JSON.stringify(raw)}`, {\n fix: 'Pass a 0x-prefixed 20-byte address, checksummed or all-lowercase (lowercase skips the checksum typo check).',\n });\n }\n const to = getAddress(trimmed);\n if (to === USDC_ADDRESS || to === ZERO_ADDRESS || to === DEAD_ADDRESS) {\n throw new CliError('USAGE', 'The recipient is a known fund-destroying address.', {\n fix: 'Tokens sent to the token contract, the zero address, or the burn address are unrecoverable. Pass the destination wallet address.',\n });\n }\n return to;\n}\n\ninterface ConfirmDetails {\n amountAtomic: bigint;\n to: Address;\n from: Address;\n feeWei: bigint;\n}\n\n/** Buy's confirm posture; the preview names the resolved recipient, amount, and fee. */\nasync function confirmSend(\n ctx: CommandContext,\n deps: SendDeps,\n yes: boolean,\n d: ConfirmDetails,\n): Promise<boolean> {\n if (yes) return true;\n const prompt =\n `Send ${toMoney(d.amountAtomic.toString()).usd} USDC on Base\\n` +\n ` from ${d.from}\\n` +\n ` to ${d.to}\\n` +\n ` network fee up to ~${formatEther(d.feeWei)} ETH\\n` +\n `This moves funds out of the agent wallet and cannot be undone. [y/N] `;\n if (deps.confirm !== undefined) return deps.confirm(prompt);\n // Both streams must be real TTYs; piped stdin/stdout without --yes refuses.\n if (!ctx.io.isTTY || !process.stdin.isTTY) return false;\n return promptYesNo(prompt);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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