tenjin-cli 0.1.0-alpha.30 → 0.1.0-alpha.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +65 -116
- package/dist/{_esm-CE7KNONL.js → _esm-RLLC72MS.js} +127 -131
- package/dist/alive-MROUMFH3.js +38 -0
- package/dist/auto-update-OPWMRZLS.js +22 -0
- package/dist/{ccip-7RMRLAGV.js → ccip-DHDFKTQV.js} +2 -2
- package/dist/chunk-2GNOFONN.js +560 -0
- package/dist/chunk-2GNOFONN.js.map +1 -0
- package/dist/{chunk-TTNESUPQ.js → chunk-2GP3HRYK.js} +2120 -193
- package/dist/chunk-2GP3HRYK.js.map +1 -0
- package/dist/chunk-3623BLPV.js +184 -0
- package/dist/chunk-3623BLPV.js.map +1 -0
- package/dist/chunk-3AIHRXKO.js +72 -0
- package/dist/chunk-3AIHRXKO.js.map +1 -0
- package/dist/chunk-3DIL66VX.js +120 -0
- package/dist/chunk-3DIL66VX.js.map +1 -0
- package/dist/{chunk-S4SAZ7OD.js → chunk-3FMZGI7I.js} +12 -2
- package/dist/{chunk-S4SAZ7OD.js.map → chunk-3FMZGI7I.js.map} +1 -1
- package/dist/chunk-3UCIG4TG.js +65 -0
- package/dist/chunk-3UCIG4TG.js.map +1 -0
- package/dist/{chunk-LFZJM56J.js → chunk-445VQTVM.js} +3 -3
- package/dist/{chunk-A36LQPHV.js → chunk-4LMUQMBH.js} +1 -1
- package/dist/{chunk-A36LQPHV.js.map → chunk-4LMUQMBH.js.map} +1 -1
- package/dist/{chunk-RAULEAZ6.js → chunk-4USCZ2NI.js} +3 -3
- package/dist/chunk-62KNUYWD.js +111 -0
- package/dist/chunk-62KNUYWD.js.map +1 -0
- package/dist/{chunk-POUWHWID.js → chunk-6CMM6YCB.js} +3 -3
- package/dist/{chunk-POUWHWID.js.map → chunk-6CMM6YCB.js.map} +1 -1
- package/dist/chunk-7WEQQJLG.js +68 -0
- package/dist/chunk-7WEQQJLG.js.map +1 -0
- package/dist/{chunk-3O2BQIF6.js → chunk-AD226HDR.js} +344 -534
- package/dist/chunk-AD226HDR.js.map +1 -0
- package/dist/chunk-ADV4LDTB.js +106 -0
- package/dist/chunk-ADV4LDTB.js.map +1 -0
- package/dist/{chunk-AWFUPKTM.js → chunk-AV5NZMYO.js} +15 -7
- package/dist/{chunk-AWFUPKTM.js.map → chunk-AV5NZMYO.js.map} +1 -1
- package/dist/chunk-B7EM4GGF.js +198 -0
- package/dist/chunk-B7EM4GGF.js.map +1 -0
- package/dist/chunk-BFDQ4WNW.js +119 -0
- package/dist/chunk-BFDQ4WNW.js.map +1 -0
- package/dist/{chunk-OSYTBCUC.js → chunk-BI673VEJ.js} +531 -503
- package/dist/chunk-BI673VEJ.js.map +1 -0
- package/dist/chunk-CEXSOI5R.js +808 -0
- package/dist/chunk-CEXSOI5R.js.map +1 -0
- package/dist/{chunk-OK2TDZQU.js → chunk-CISYM4EO.js} +9 -7
- package/dist/chunk-CISYM4EO.js.map +1 -0
- package/dist/{chunk-VFMQTSXG.js → chunk-D3ZURCG7.js} +3 -3
- package/dist/chunk-D5TOQSO4.js +474 -0
- package/dist/chunk-D5TOQSO4.js.map +1 -0
- package/dist/{chunk-P7LABKCW.js → chunk-DOQGNFHM.js} +33 -2
- package/dist/{chunk-P7LABKCW.js.map → chunk-DOQGNFHM.js.map} +1 -1
- package/dist/{chunk-QUVVWYJW.js → chunk-DRDUIZIA.js} +11 -9
- package/dist/{chunk-QUVVWYJW.js.map → chunk-DRDUIZIA.js.map} +1 -1
- package/dist/{chunk-O2FRQ2L2.js → chunk-DW4YTVR3.js} +5 -65
- package/dist/chunk-DW4YTVR3.js.map +1 -0
- package/dist/chunk-E7LGOMH6.js +449 -0
- package/dist/chunk-E7LGOMH6.js.map +1 -0
- package/dist/chunk-E7SW44LM.js +138 -0
- package/dist/chunk-E7SW44LM.js.map +1 -0
- package/dist/chunk-EDJWHDDL.js +33 -0
- package/dist/chunk-EDJWHDDL.js.map +1 -0
- package/dist/chunk-F3ED5WTR.js +13 -0
- package/dist/chunk-F3ED5WTR.js.map +1 -0
- package/dist/chunk-G75OPGAK.js +111 -0
- package/dist/chunk-G75OPGAK.js.map +1 -0
- package/dist/{chunk-YFQOA5AU.js → chunk-GAKUQHKA.js} +13 -17
- package/dist/{chunk-YFQOA5AU.js.map → chunk-GAKUQHKA.js.map} +1 -1
- package/dist/{chunk-PAYV4XUA.js → chunk-HDPUXS3Z.js} +20 -49
- package/dist/chunk-HDPUXS3Z.js.map +1 -0
- package/dist/{chunk-ORWL5BSN.js → chunk-HGZEPQUT.js} +2 -2
- package/dist/{chunk-HPWO4O6S.js → chunk-HREHWL32.js} +4 -4
- package/dist/{chunk-HPWO4O6S.js.map → chunk-HREHWL32.js.map} +1 -1
- package/dist/{chunk-VZGAONSJ.js → chunk-I5TDIUKM.js} +16 -35
- package/dist/chunk-I5TDIUKM.js.map +1 -0
- package/dist/{chunk-7QKHZQKW.js → chunk-IADZOXKN.js} +39 -6
- package/dist/chunk-IADZOXKN.js.map +1 -0
- package/dist/{chunk-U6YQ6FRI.js → chunk-IDTRSAHE.js} +32 -12
- package/dist/chunk-IDTRSAHE.js.map +1 -0
- package/dist/{chunk-SPAVAYSW.js → chunk-JEVQ5LKO.js} +7 -5
- package/dist/{chunk-SPAVAYSW.js.map → chunk-JEVQ5LKO.js.map} +1 -1
- package/dist/{chunk-EBVIKMCH.js → chunk-JKKAIPTU.js} +2 -2
- package/dist/chunk-JNJWBTU2.js +3497 -0
- package/dist/chunk-JNJWBTU2.js.map +1 -0
- package/dist/{chunk-TTBKWWTV.js → chunk-JRZBBPO6.js} +390 -146
- package/dist/chunk-JRZBBPO6.js.map +1 -0
- package/dist/{chunk-WVUSXNIE.js → chunk-MPZUYCAP.js} +9 -2
- package/dist/{chunk-WVUSXNIE.js.map → chunk-MPZUYCAP.js.map} +1 -1
- package/dist/{chunk-SJLTEINJ.js → chunk-OJNTCYQQ.js} +17 -1
- package/dist/chunk-OJNTCYQQ.js.map +1 -0
- package/dist/{chunk-IOODYAXL.js → chunk-OTWLERSW.js} +25 -6
- package/dist/chunk-OTWLERSW.js.map +1 -0
- package/dist/{chunk-AWQPGIR6.js → chunk-PJNENX2A.js} +1535 -422
- package/dist/chunk-PJNENX2A.js.map +1 -0
- package/dist/{chunk-KHE6L6TD.js → chunk-PKHI276N.js} +97 -11
- package/dist/chunk-PKHI276N.js.map +1 -0
- package/dist/{chunk-YHKXNYTB.js → chunk-QF3LSMGS.js} +2 -2
- package/dist/chunk-QXP3Z3JN.js +131 -0
- package/dist/chunk-QXP3Z3JN.js.map +1 -0
- package/dist/{chunk-XZKD7DIF.js → chunk-RL5UUDT4.js} +3 -3
- package/dist/{chunk-XZKD7DIF.js.map → chunk-RL5UUDT4.js.map} +1 -1
- package/dist/chunk-SFASB5FL.js +69 -0
- package/dist/chunk-SFASB5FL.js.map +1 -0
- package/dist/{chunk-WO5BJNIB.js → chunk-SNNSAGMT.js} +7273 -2741
- package/dist/chunk-SNNSAGMT.js.map +1 -0
- package/dist/{chunk-NZIP4PA2.js → chunk-SO3XRZPX.js} +3 -3
- package/dist/chunk-SYOS5CAC.js +176 -0
- package/dist/chunk-SYOS5CAC.js.map +1 -0
- package/dist/chunk-TAW4UFFF.js +293 -0
- package/dist/chunk-TAW4UFFF.js.map +1 -0
- package/dist/chunk-TF5HCP33.js +271 -0
- package/dist/chunk-TF5HCP33.js.map +1 -0
- package/dist/{chunk-AKWGE6JQ.js → chunk-UUGOUOVT.js} +37 -2
- package/dist/chunk-UUGOUOVT.js.map +1 -0
- package/dist/{chunk-AEG2PXBP.js → chunk-V2LQLN5H.js} +7 -7
- package/dist/{chunk-KYFZTGMC.js → chunk-VJUVFZ2D.js} +5 -3
- package/dist/{chunk-KYFZTGMC.js.map → chunk-VJUVFZ2D.js.map} +1 -1
- package/dist/{chunk-JMM6YE7J.js → chunk-VOZA6O7K.js} +708 -709
- package/dist/chunk-VOZA6O7K.js.map +1 -0
- package/dist/{chunk-5LJCEMFD.js → chunk-VUGQTZ2L.js} +209 -77
- package/dist/chunk-VUGQTZ2L.js.map +1 -0
- package/dist/chunk-WOM257PW.js +393 -0
- package/dist/chunk-WOM257PW.js.map +1 -0
- package/dist/chunk-WYXUQGOL.js +191 -0
- package/dist/chunk-WYXUQGOL.js.map +1 -0
- package/dist/chunk-X5ZBP3IY.js +97 -0
- package/dist/chunk-X5ZBP3IY.js.map +1 -0
- package/dist/chunk-XQJXNMSB.js +23 -0
- package/dist/chunk-XQJXNMSB.js.map +1 -0
- package/dist/chunk-Y527D4TV.js +56 -0
- package/dist/chunk-Y527D4TV.js.map +1 -0
- package/dist/{chunk-VUFAK2LW.js → chunk-YUY4SAGM.js} +17 -2
- package/dist/chunk-YUY4SAGM.js.map +1 -0
- package/dist/clack-EZ7TDWQU.js +19 -0
- package/dist/claude-cli-2YKABJJZ.js +31 -0
- package/dist/{cli-O5SN7ZJ4.js → cli-FB4LOA5A.js} +221 -68
- package/dist/{cli-O5SN7ZJ4.js.map → cli-FB4LOA5A.js.map} +1 -1
- package/dist/codex-event-TYVES3UX.js +16 -0
- package/dist/codex-host-WW4H2SKT.js +29 -0
- package/dist/codex-install-2C623HPW.js +393 -0
- package/dist/codex-install-2C623HPW.js.map +1 -0
- package/dist/{config-OJQI27LT.js → config-HOVJFEKD.js} +25 -15
- package/dist/doctor-NKU4V5OV.js +1312 -0
- package/dist/doctor-NKU4V5OV.js.map +1 -0
- package/dist/{env-proxy-XL4P73MZ.js → env-proxy-R6ZMLQTT.js} +6 -2
- package/dist/{ethersCompat-Df4a6QIZ-THAVUGIJ.js → ethersCompat-Df4a6QIZ-X6YZWAML.js} +3 -3
- package/dist/{fund-WEV6DMTD.js → fund-WEBHTZGN.js} +38 -30
- package/dist/{fund-WEV6DMTD.js.map → fund-WEBHTZGN.js.map} +1 -1
- package/dist/hook-command-ZA2PNKS6.js +44 -0
- package/dist/hosts/claude/.claude-plugin/marketplace.json +2 -2
- package/dist/hosts/claude/tenjin/.claude-plugin/plugin.json +3 -2
- package/dist/hosts/claude/tenjin/hooks/hooks.json +4 -1
- package/dist/hosts/claude/tenjin/hooks/register.tsx +589 -0
- package/dist/hosts/claude/tenjin/skills/tenjin-pay/SKILL.md +82 -0
- package/dist/hosts/claude/tenjin/types/index.d.ts +41 -0
- package/dist/hosts/codex/.agents/plugins/marketplace.json +20 -0
- package/dist/hosts/codex/tenjin/.codex-plugin/plugin.json +16 -0
- package/dist/hosts/codex/tenjin/.mcp.json +15 -0
- package/dist/hosts/codex/tenjin/hooks/hooks.json +98 -0
- package/dist/hosts-AV5MHBAU.js +38 -0
- package/dist/index.js +28 -8
- package/dist/index.js.map +1 -1
- package/dist/install-PT4EZS4R.js +100 -0
- package/dist/{install-identity-WHPNMNMQ.js → install-identity-5A4OE6YC.js} +13 -8
- package/dist/install-wallet-SAAPKB73.js +281 -0
- package/dist/install-wallet-SAAPKB73.js.map +1 -0
- package/dist/{mcp-QML7ZMPH.js → mcp-HAWKCTPQ.js} +909 -208
- package/dist/mcp-HAWKCTPQ.js.map +1 -0
- package/dist/{mine.wasm-6PIT3DK6.js → mine.wasm-QFAHIFPY.js} +2 -2
- package/dist/{mine.wasm-6PIT3DK6.js.map → mine.wasm-QFAHIFPY.js.map} +1 -1
- package/dist/{package-LGKYOEPV.js → package-SR2WB6MK.js} +4 -2
- package/dist/passphrase-IFTDS3CU.js +44 -0
- package/dist/{paths-POPTXJO6.js → paths-XCSAKISU.js} +10 -2
- package/dist/pay-OXC3WKYV.js +55 -0
- package/dist/pay-OXC3WKYV.js.map +1 -0
- package/dist/{payments-C44QUFXU.js → payments-3KHMP2MG.js} +18 -13
- package/dist/{payments-C44QUFXU.js.map → payments-3KHMP2MG.js.map} +1 -1
- package/dist/plugin-registration-N3GRIZVM.js +67 -0
- package/dist/plugin-registration-N3GRIZVM.js.map +1 -0
- package/dist/{redact-6W23GGJC.js → redact-D7ASVWKL.js} +2 -2
- package/dist/redact-D7ASVWKL.js.map +1 -0
- package/dist/runtime-UVNUA3AS.js +1203 -0
- package/dist/runtime-UVNUA3AS.js.map +1 -0
- package/dist/runtime-fetch-EKFRNR6Z.js +20 -0
- package/dist/runtime-fetch-EKFRNR6Z.js.map +1 -0
- package/dist/runtime-layout-BDWZG2TQ.js +25 -0
- package/dist/runtime-layout-BDWZG2TQ.js.map +1 -0
- package/dist/{send-KVJX4XIR.js → send-HMKJLT34.js} +26 -18
- package/dist/{send-KVJX4XIR.js.map → send-HMKJLT34.js.map} +1 -1
- package/dist/{status-S7C3WMSH.js → status-RWXIIWYS.js} +57 -22
- package/dist/status-RWXIIWYS.js.map +1 -0
- package/dist/{status-line-YR2T5HC4.js → status-line-77XYZP7E.js} +13 -8
- package/dist/{status-line-YR2T5HC4.js.map → status-line-77XYZP7E.js.map} +1 -1
- package/dist/uninstall-D5G67UJH.js +480 -0
- package/dist/uninstall-D5G67UJH.js.map +1 -0
- package/dist/update-LRNOEGSB.js +53 -0
- package/dist/update-LRNOEGSB.js.map +1 -0
- package/dist/{usdc-JK4RRFFQ.js → usdc-D6X7EIQ2.js} +7 -8
- package/dist/usdc-D6X7EIQ2.js.map +1 -0
- package/dist/{viemAdapter-By13KInL-X2VY6CY3.js → viemAdapter-By13KInL-RL742ETX.js} +3 -3
- package/dist/viemAdapter-By13KInL-RL742ETX.js.map +1 -0
- package/dist/wallet-XFYC27BR.js +55 -0
- package/dist/wallet-XFYC27BR.js.map +1 -0
- package/dist/wallet-kdf-worker.mjs +8 -8
- package/docs/agent-permissions.md +56 -22
- package/docs/safety-model.md +1 -1
- package/docs/troubleshooting.md +72 -1
- package/package.json +14 -1
- package/dist/alive-3J3CHOQP.js +0 -21
- package/dist/ccip-NLCSCHKI.js +0 -19
- package/dist/chunk-3O2BQIF6.js.map +0 -1
- package/dist/chunk-5IEP5EGE.js +0 -5332
- package/dist/chunk-5IEP5EGE.js.map +0 -1
- package/dist/chunk-5LJCEMFD.js.map +0 -1
- package/dist/chunk-6W5GYG3W.js +0 -128
- package/dist/chunk-6W5GYG3W.js.map +0 -1
- package/dist/chunk-7EKYXMUO.js +0 -7536
- package/dist/chunk-7EKYXMUO.js.map +0 -1
- package/dist/chunk-7QKHZQKW.js.map +0 -1
- package/dist/chunk-AKWGE6JQ.js.map +0 -1
- package/dist/chunk-AWQPGIR6.js.map +0 -1
- package/dist/chunk-EGELTSPU.js +0 -2865
- package/dist/chunk-EGELTSPU.js.map +0 -1
- package/dist/chunk-EL56RW2J.js +0 -7611
- package/dist/chunk-EL56RW2J.js.map +0 -1
- package/dist/chunk-HE2MS4QO.js +0 -256
- package/dist/chunk-HE2MS4QO.js.map +0 -1
- package/dist/chunk-IOODYAXL.js.map +0 -1
- package/dist/chunk-JMM6YE7J.js.map +0 -1
- package/dist/chunk-KHE6L6TD.js.map +0 -1
- package/dist/chunk-N35E6CM2.js +0 -1185
- package/dist/chunk-N35E6CM2.js.map +0 -1
- package/dist/chunk-O2FRQ2L2.js.map +0 -1
- package/dist/chunk-OK2TDZQU.js.map +0 -1
- package/dist/chunk-OSYTBCUC.js.map +0 -1
- package/dist/chunk-PAYV4XUA.js.map +0 -1
- package/dist/chunk-SJLTEINJ.js.map +0 -1
- package/dist/chunk-TTBKWWTV.js.map +0 -1
- package/dist/chunk-TTNESUPQ.js.map +0 -1
- package/dist/chunk-U6YQ6FRI.js.map +0 -1
- package/dist/chunk-VUFAK2LW.js.map +0 -1
- package/dist/chunk-VZGAONSJ.js.map +0 -1
- package/dist/chunk-WO5BJNIB.js.map +0 -1
- package/dist/doctor-IQQJHGGM.js +0 -590
- package/dist/doctor-IQQJHGGM.js.map +0 -1
- package/dist/hook-command-D2P3ILRV.js +0 -32
- package/dist/install-TUCRF32I.js +0 -60
- package/dist/install-wallet-MA27FTQ5.js +0 -113
- package/dist/install-wallet-MA27FTQ5.js.map +0 -1
- package/dist/mcp-QML7ZMPH.js.map +0 -1
- package/dist/pay-2C2UBBXJ.js +0 -51
- package/dist/status-S7C3WMSH.js.map +0 -1
- package/dist/uninstall-HY6LKIIT.js +0 -149
- package/dist/uninstall-HY6LKIIT.js.map +0 -1
- package/dist/update-OJV22LR3.js +0 -36
- package/dist/wallet-PD2IMZDU.js +0 -39
- /package/dist/{_esm-CE7KNONL.js.map → _esm-RLLC72MS.js.map} +0 -0
- /package/dist/{alive-3J3CHOQP.js.map → alive-MROUMFH3.js.map} +0 -0
- /package/dist/{ccip-7RMRLAGV.js.map → auto-update-OPWMRZLS.js.map} +0 -0
- /package/dist/{ccip-NLCSCHKI.js.map → ccip-DHDFKTQV.js.map} +0 -0
- /package/dist/{chunk-LFZJM56J.js.map → chunk-445VQTVM.js.map} +0 -0
- /package/dist/{chunk-RAULEAZ6.js.map → chunk-4USCZ2NI.js.map} +0 -0
- /package/dist/{chunk-VFMQTSXG.js.map → chunk-D3ZURCG7.js.map} +0 -0
- /package/dist/{chunk-ORWL5BSN.js.map → chunk-HGZEPQUT.js.map} +0 -0
- /package/dist/{chunk-EBVIKMCH.js.map → chunk-JKKAIPTU.js.map} +0 -0
- /package/dist/{chunk-YHKXNYTB.js.map → chunk-QF3LSMGS.js.map} +0 -0
- /package/dist/{chunk-NZIP4PA2.js.map → chunk-SO3XRZPX.js.map} +0 -0
- /package/dist/{chunk-AEG2PXBP.js.map → chunk-V2LQLN5H.js.map} +0 -0
- /package/dist/{config-OJQI27LT.js.map → clack-EZ7TDWQU.js.map} +0 -0
- /package/dist/{env-proxy-XL4P73MZ.js.map → claude-cli-2YKABJJZ.js.map} +0 -0
- /package/dist/{ethersCompat-Df4a6QIZ-THAVUGIJ.js.map → codex-event-TYVES3UX.js.map} +0 -0
- /package/dist/{hook-command-D2P3ILRV.js.map → codex-host-WW4H2SKT.js.map} +0 -0
- /package/dist/{install-TUCRF32I.js.map → config-HOVJFEKD.js.map} +0 -0
- /package/dist/{install-identity-WHPNMNMQ.js.map → env-proxy-R6ZMLQTT.js.map} +0 -0
- /package/dist/{package-LGKYOEPV.js.map → ethersCompat-Df4a6QIZ-X6YZWAML.js.map} +0 -0
- /package/dist/{paths-POPTXJO6.js.map → hook-command-ZA2PNKS6.js.map} +0 -0
- /package/dist/{pay-2C2UBBXJ.js.map → hosts-AV5MHBAU.js.map} +0 -0
- /package/dist/{redact-6W23GGJC.js.map → install-PT4EZS4R.js.map} +0 -0
- /package/dist/{update-OJV22LR3.js.map → install-identity-5A4OE6YC.js.map} +0 -0
- /package/dist/{usdc-JK4RRFFQ.js.map → package-SR2WB6MK.js.map} +0 -0
- /package/dist/{viemAdapter-By13KInL-X2VY6CY3.js.map → passphrase-IFTDS3CU.js.map} +0 -0
- /package/dist/{wallet-PD2IMZDU.js.map → paths-XCSAKISU.js.map} +0 -0
package/dist/chunk-EGELTSPU.js
DELETED
|
@@ -1,2865 +0,0 @@
|
|
|
1
|
-
import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
keccak_256
|
|
4
|
-
} from "./chunk-KG3D7FIF.js";
|
|
5
|
-
import {
|
|
6
|
-
equalBytes
|
|
7
|
-
} from "./chunk-RBJPAZFI.js";
|
|
8
|
-
|
|
9
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/errors/version.js
|
|
10
|
-
var version = "2.55.2";
|
|
11
|
-
|
|
12
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/errors/base.js
|
|
13
|
-
var errorConfig = {
|
|
14
|
-
getDocsUrl: ({ docsBaseUrl, docsPath = "", docsSlug }) => docsPath ? `${docsBaseUrl ?? "https://viem.sh"}${docsPath}${docsSlug ? `#${docsSlug}` : ""}` : void 0,
|
|
15
|
-
version: `viem@${version}`
|
|
16
|
-
};
|
|
17
|
-
function setErrorConfig(config) {
|
|
18
|
-
errorConfig = config;
|
|
19
|
-
}
|
|
20
|
-
var BaseError = class _BaseError extends Error {
|
|
21
|
-
constructor(shortMessage, args = {}) {
|
|
22
|
-
const details = (() => {
|
|
23
|
-
if (args.cause instanceof _BaseError)
|
|
24
|
-
return args.cause.details;
|
|
25
|
-
if (args.cause?.message)
|
|
26
|
-
return args.cause.message;
|
|
27
|
-
return args.details;
|
|
28
|
-
})();
|
|
29
|
-
const docsPath = (() => {
|
|
30
|
-
if (args.cause instanceof _BaseError)
|
|
31
|
-
return args.cause.docsPath || args.docsPath;
|
|
32
|
-
return args.docsPath;
|
|
33
|
-
})();
|
|
34
|
-
const docsUrl = errorConfig.getDocsUrl?.({ ...args, docsPath });
|
|
35
|
-
const message = [
|
|
36
|
-
shortMessage || "An error occurred.",
|
|
37
|
-
"",
|
|
38
|
-
...args.metaMessages ? [...args.metaMessages, ""] : [],
|
|
39
|
-
...docsUrl ? [`Docs: ${docsUrl}`] : [],
|
|
40
|
-
...details ? [`Details: ${details}`] : [],
|
|
41
|
-
...errorConfig.version ? [`Version: ${errorConfig.version}`] : []
|
|
42
|
-
].join("\n");
|
|
43
|
-
super(message, args.cause ? { cause: args.cause } : void 0);
|
|
44
|
-
Object.defineProperty(this, "details", {
|
|
45
|
-
enumerable: true,
|
|
46
|
-
configurable: true,
|
|
47
|
-
writable: true,
|
|
48
|
-
value: void 0
|
|
49
|
-
});
|
|
50
|
-
Object.defineProperty(this, "docsPath", {
|
|
51
|
-
enumerable: true,
|
|
52
|
-
configurable: true,
|
|
53
|
-
writable: true,
|
|
54
|
-
value: void 0
|
|
55
|
-
});
|
|
56
|
-
Object.defineProperty(this, "metaMessages", {
|
|
57
|
-
enumerable: true,
|
|
58
|
-
configurable: true,
|
|
59
|
-
writable: true,
|
|
60
|
-
value: void 0
|
|
61
|
-
});
|
|
62
|
-
Object.defineProperty(this, "shortMessage", {
|
|
63
|
-
enumerable: true,
|
|
64
|
-
configurable: true,
|
|
65
|
-
writable: true,
|
|
66
|
-
value: void 0
|
|
67
|
-
});
|
|
68
|
-
Object.defineProperty(this, "version", {
|
|
69
|
-
enumerable: true,
|
|
70
|
-
configurable: true,
|
|
71
|
-
writable: true,
|
|
72
|
-
value: void 0
|
|
73
|
-
});
|
|
74
|
-
Object.defineProperty(this, "name", {
|
|
75
|
-
enumerable: true,
|
|
76
|
-
configurable: true,
|
|
77
|
-
writable: true,
|
|
78
|
-
value: "BaseError"
|
|
79
|
-
});
|
|
80
|
-
this.details = details;
|
|
81
|
-
this.docsPath = docsPath;
|
|
82
|
-
this.metaMessages = args.metaMessages;
|
|
83
|
-
this.name = args.name ?? this.name;
|
|
84
|
-
this.shortMessage = shortMessage;
|
|
85
|
-
this.version = version;
|
|
86
|
-
}
|
|
87
|
-
walk(fn) {
|
|
88
|
-
return walk(this, fn);
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
function walk(err, fn) {
|
|
92
|
-
if (fn?.(err))
|
|
93
|
-
return err;
|
|
94
|
-
if (err && typeof err === "object" && "cause" in err && err.cause !== void 0)
|
|
95
|
-
return walk(err.cause, fn);
|
|
96
|
-
return fn ? null : err;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/errors/encoding.js
|
|
100
|
-
var IntegerOutOfRangeError = class extends BaseError {
|
|
101
|
-
constructor({ max, min, signed, size: size4, value }) {
|
|
102
|
-
super(`Number "${value}" is not in safe ${size4 ? `${size4 * 8}-bit ${signed ? "signed" : "unsigned"} ` : ""}integer range ${max ? `(${min} to ${max})` : `(above ${min})`}`, { name: "IntegerOutOfRangeError" });
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
var InvalidBytesBooleanError = class extends BaseError {
|
|
106
|
-
constructor(bytes) {
|
|
107
|
-
super(`Bytes value "${bytes}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`, {
|
|
108
|
-
name: "InvalidBytesBooleanError"
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
var InvalidHexBooleanError = class extends BaseError {
|
|
113
|
-
constructor(hex) {
|
|
114
|
-
super(`Hex value "${hex}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`, { name: "InvalidHexBooleanError" });
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
|
-
var InvalidHexValueError = class extends BaseError {
|
|
118
|
-
constructor(value) {
|
|
119
|
-
super(`Hex value "${value}" is an odd length (${value.length}). It must be an even length.`, { name: "InvalidHexValueError" });
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
var RlpDepthLimitExceededError = class extends BaseError {
|
|
123
|
-
constructor({ limit }) {
|
|
124
|
-
super(`RLP depth limit of \`${limit}\` exceeded.`, {
|
|
125
|
-
name: "RlpDepthLimitExceededError"
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
var RlpListBoundaryExceededError = class extends BaseError {
|
|
130
|
-
constructor({ consumed, declared }) {
|
|
131
|
-
super(`RLP list items consumed \`${consumed}\` bytes but the list declared a length of \`${declared}\`.`, { name: "RlpListBoundaryExceededError" });
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
|
-
var RlpTrailingBytesError = class extends BaseError {
|
|
135
|
-
constructor({ count }) {
|
|
136
|
-
super(`RLP payload encodes a single item, but \`${count}\` trailing ${count === 1 ? "byte remains" : "bytes remain"}.`, { name: "RlpTrailingBytesError" });
|
|
137
|
-
}
|
|
138
|
-
};
|
|
139
|
-
var SizeOverflowError = class extends BaseError {
|
|
140
|
-
constructor({ givenSize, maxSize }) {
|
|
141
|
-
super(`Size cannot exceed ${maxSize} bytes. Given size: ${givenSize} bytes.`, { name: "SizeOverflowError" });
|
|
142
|
-
}
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/errors/data.js
|
|
146
|
-
var SliceOffsetOutOfBoundsError = class extends BaseError {
|
|
147
|
-
constructor({ offset, position, size: size4 }) {
|
|
148
|
-
super(`Slice ${position === "start" ? "starting" : "ending"} at offset "${offset}" is out-of-bounds (size: ${size4}).`, { name: "SliceOffsetOutOfBoundsError" });
|
|
149
|
-
}
|
|
150
|
-
};
|
|
151
|
-
var SizeExceedsPaddingSizeError = class extends BaseError {
|
|
152
|
-
constructor({ size: size4, targetSize, type }) {
|
|
153
|
-
super(`${type.charAt(0).toUpperCase()}${type.slice(1).toLowerCase()} size (${size4}) exceeds padding size (${targetSize}).`, { name: "SizeExceedsPaddingSizeError" });
|
|
154
|
-
}
|
|
155
|
-
};
|
|
156
|
-
var InvalidBytesLengthError = class extends BaseError {
|
|
157
|
-
constructor({ size: size4, targetSize, type }) {
|
|
158
|
-
super(`${type.charAt(0).toUpperCase()}${type.slice(1).toLowerCase()} is expected to be ${targetSize} ${type} long, but is ${size4} ${type} long.`, { name: "InvalidBytesLengthError" });
|
|
159
|
-
}
|
|
160
|
-
};
|
|
161
|
-
|
|
162
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/data/pad.js
|
|
163
|
-
function pad(hexOrBytes, { dir, size: size4 = 32 } = {}) {
|
|
164
|
-
if (typeof hexOrBytes === "string")
|
|
165
|
-
return padHex(hexOrBytes, { dir, size: size4 });
|
|
166
|
-
return padBytes(hexOrBytes, { dir, size: size4 });
|
|
167
|
-
}
|
|
168
|
-
function padHex(hex_, { dir, size: size4 = 32 } = {}) {
|
|
169
|
-
if (size4 === null)
|
|
170
|
-
return hex_;
|
|
171
|
-
const hex = hex_.replace("0x", "");
|
|
172
|
-
if (hex.length > size4 * 2)
|
|
173
|
-
throw new SizeExceedsPaddingSizeError({
|
|
174
|
-
size: Math.ceil(hex.length / 2),
|
|
175
|
-
targetSize: size4,
|
|
176
|
-
type: "hex"
|
|
177
|
-
});
|
|
178
|
-
return `0x${hex[dir === "right" ? "padEnd" : "padStart"](size4 * 2, "0")}`;
|
|
179
|
-
}
|
|
180
|
-
function padBytes(bytes, { dir, size: size4 = 32 } = {}) {
|
|
181
|
-
if (size4 === null)
|
|
182
|
-
return bytes;
|
|
183
|
-
if (bytes.length > size4)
|
|
184
|
-
throw new SizeExceedsPaddingSizeError({
|
|
185
|
-
size: bytes.length,
|
|
186
|
-
targetSize: size4,
|
|
187
|
-
type: "bytes"
|
|
188
|
-
});
|
|
189
|
-
const paddedBytes = new Uint8Array(size4);
|
|
190
|
-
for (let i = 0; i < size4; i++) {
|
|
191
|
-
const padEnd = dir === "right";
|
|
192
|
-
paddedBytes[padEnd ? i : size4 - i - 1] = bytes[padEnd ? i : bytes.length - i - 1];
|
|
193
|
-
}
|
|
194
|
-
return paddedBytes;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/data/isHex.js
|
|
198
|
-
function isHex(value, { strict = true } = {}) {
|
|
199
|
-
if (!value)
|
|
200
|
-
return false;
|
|
201
|
-
if (typeof value !== "string")
|
|
202
|
-
return false;
|
|
203
|
-
return strict ? /^0x[0-9a-fA-F]*$/.test(value) : value.startsWith("0x");
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/data/size.js
|
|
207
|
-
function size(value) {
|
|
208
|
-
if (isHex(value, { strict: false }))
|
|
209
|
-
return Math.ceil((value.length - 2) / 2);
|
|
210
|
-
return value.length;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/data/trim.js
|
|
214
|
-
function trim(hexOrBytes, { dir = "left" } = {}) {
|
|
215
|
-
let data = typeof hexOrBytes === "string" ? hexOrBytes.replace("0x", "") : hexOrBytes;
|
|
216
|
-
let sliceLength = 0;
|
|
217
|
-
for (let i = 0; i < data.length - 1; i++) {
|
|
218
|
-
if (data[dir === "left" ? i : data.length - i - 1].toString() === "0")
|
|
219
|
-
sliceLength++;
|
|
220
|
-
else
|
|
221
|
-
break;
|
|
222
|
-
}
|
|
223
|
-
data = dir === "left" ? data.slice(sliceLength) : data.slice(0, data.length - sliceLength);
|
|
224
|
-
if (typeof hexOrBytes === "string") {
|
|
225
|
-
if (data.length === 1 && dir === "right")
|
|
226
|
-
data = `${data}0`;
|
|
227
|
-
return `0x${data.length % 2 === 1 ? `0${data}` : data}`;
|
|
228
|
-
}
|
|
229
|
-
return data;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/encoding/fromHex.js
|
|
233
|
-
function assertSize(hexOrBytes, { size: size4 }) {
|
|
234
|
-
if (size(hexOrBytes) > size4)
|
|
235
|
-
throw new SizeOverflowError({
|
|
236
|
-
givenSize: size(hexOrBytes),
|
|
237
|
-
maxSize: size4
|
|
238
|
-
});
|
|
239
|
-
}
|
|
240
|
-
function fromHex(hex, toOrOpts) {
|
|
241
|
-
const opts = typeof toOrOpts === "string" ? { to: toOrOpts } : toOrOpts;
|
|
242
|
-
const to = opts.to;
|
|
243
|
-
if (to === "number")
|
|
244
|
-
return hexToNumber(hex, opts);
|
|
245
|
-
if (to === "bigint")
|
|
246
|
-
return hexToBigInt(hex, opts);
|
|
247
|
-
if (to === "string")
|
|
248
|
-
return hexToString(hex, opts);
|
|
249
|
-
if (to === "boolean")
|
|
250
|
-
return hexToBool(hex, opts);
|
|
251
|
-
return hexToBytes(hex, opts);
|
|
252
|
-
}
|
|
253
|
-
function hexToBigInt(hex, opts = {}) {
|
|
254
|
-
const { signed } = opts;
|
|
255
|
-
if (opts.size)
|
|
256
|
-
assertSize(hex, { size: opts.size });
|
|
257
|
-
const value = BigInt(hex);
|
|
258
|
-
if (!signed)
|
|
259
|
-
return value;
|
|
260
|
-
const size4 = (hex.length - 2) / 2;
|
|
261
|
-
const max = (1n << BigInt(size4) * 8n - 1n) - 1n;
|
|
262
|
-
if (value <= max)
|
|
263
|
-
return value;
|
|
264
|
-
return value - BigInt(`0x${"f".padStart(size4 * 2, "f")}`) - 1n;
|
|
265
|
-
}
|
|
266
|
-
function hexToBool(hex_, opts = {}) {
|
|
267
|
-
let hex = hex_;
|
|
268
|
-
if (opts.size) {
|
|
269
|
-
assertSize(hex, { size: opts.size });
|
|
270
|
-
hex = trim(hex);
|
|
271
|
-
}
|
|
272
|
-
if (trim(hex) === "0x00")
|
|
273
|
-
return false;
|
|
274
|
-
if (trim(hex) === "0x01")
|
|
275
|
-
return true;
|
|
276
|
-
throw new InvalidHexBooleanError(hex);
|
|
277
|
-
}
|
|
278
|
-
function hexToNumber(hex, opts = {}) {
|
|
279
|
-
const value = hexToBigInt(hex, opts);
|
|
280
|
-
const number = Number(value);
|
|
281
|
-
if (!Number.isSafeInteger(number))
|
|
282
|
-
throw new IntegerOutOfRangeError({
|
|
283
|
-
max: `${Number.MAX_SAFE_INTEGER}`,
|
|
284
|
-
min: `${Number.MIN_SAFE_INTEGER}`,
|
|
285
|
-
signed: opts.signed,
|
|
286
|
-
size: opts.size,
|
|
287
|
-
value: `${value}n`
|
|
288
|
-
});
|
|
289
|
-
return number;
|
|
290
|
-
}
|
|
291
|
-
function hexToString(hex, opts = {}) {
|
|
292
|
-
let bytes = hexToBytes(hex);
|
|
293
|
-
if (opts.size) {
|
|
294
|
-
assertSize(bytes, { size: opts.size });
|
|
295
|
-
bytes = trim(bytes, { dir: "right" });
|
|
296
|
-
}
|
|
297
|
-
return new TextDecoder().decode(bytes);
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/encoding/toHex.js
|
|
301
|
-
var hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_v, i) => i.toString(16).padStart(2, "0"));
|
|
302
|
-
function toHex(value, opts = {}) {
|
|
303
|
-
if (typeof value === "number" || typeof value === "bigint")
|
|
304
|
-
return numberToHex(value, opts);
|
|
305
|
-
if (typeof value === "string") {
|
|
306
|
-
return stringToHex(value, opts);
|
|
307
|
-
}
|
|
308
|
-
if (typeof value === "boolean")
|
|
309
|
-
return boolToHex(value, opts);
|
|
310
|
-
return bytesToHex(value, opts);
|
|
311
|
-
}
|
|
312
|
-
function boolToHex(value, opts = {}) {
|
|
313
|
-
const hex = `0x${Number(value)}`;
|
|
314
|
-
if (typeof opts.size === "number") {
|
|
315
|
-
assertSize(hex, { size: opts.size });
|
|
316
|
-
return pad(hex, { size: opts.size });
|
|
317
|
-
}
|
|
318
|
-
return hex;
|
|
319
|
-
}
|
|
320
|
-
function bytesToHex(value, opts = {}) {
|
|
321
|
-
let string = "";
|
|
322
|
-
for (let i = 0; i < value.length; i++) {
|
|
323
|
-
string += hexes[value[i]];
|
|
324
|
-
}
|
|
325
|
-
const hex = `0x${string}`;
|
|
326
|
-
if (typeof opts.size === "number") {
|
|
327
|
-
assertSize(hex, { size: opts.size });
|
|
328
|
-
return pad(hex, { dir: "right", size: opts.size });
|
|
329
|
-
}
|
|
330
|
-
return hex;
|
|
331
|
-
}
|
|
332
|
-
function numberToHex(value_, opts = {}) {
|
|
333
|
-
const { signed, size: size4 } = opts;
|
|
334
|
-
const value = BigInt(value_);
|
|
335
|
-
let maxValue;
|
|
336
|
-
if (size4) {
|
|
337
|
-
if (signed)
|
|
338
|
-
maxValue = (1n << BigInt(size4) * 8n - 1n) - 1n;
|
|
339
|
-
else
|
|
340
|
-
maxValue = 2n ** (BigInt(size4) * 8n) - 1n;
|
|
341
|
-
} else if (typeof value_ === "number") {
|
|
342
|
-
maxValue = BigInt(Number.MAX_SAFE_INTEGER);
|
|
343
|
-
}
|
|
344
|
-
const minValue = typeof maxValue === "bigint" && signed ? -maxValue - 1n : 0;
|
|
345
|
-
if (maxValue && value > maxValue || value < minValue) {
|
|
346
|
-
const suffix = typeof value_ === "bigint" ? "n" : "";
|
|
347
|
-
throw new IntegerOutOfRangeError({
|
|
348
|
-
max: maxValue ? `${maxValue}${suffix}` : void 0,
|
|
349
|
-
min: `${minValue}${suffix}`,
|
|
350
|
-
signed,
|
|
351
|
-
size: size4,
|
|
352
|
-
value: `${value_}${suffix}`
|
|
353
|
-
});
|
|
354
|
-
}
|
|
355
|
-
const hex = `0x${(signed && value < 0 ? (1n << BigInt(size4 * 8)) + BigInt(value) : value).toString(16)}`;
|
|
356
|
-
if (size4)
|
|
357
|
-
return pad(hex, { size: size4 });
|
|
358
|
-
return hex;
|
|
359
|
-
}
|
|
360
|
-
var encoder = /* @__PURE__ */ new TextEncoder();
|
|
361
|
-
function stringToHex(value_, opts = {}) {
|
|
362
|
-
const value = encoder.encode(value_);
|
|
363
|
-
return bytesToHex(value, opts);
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/encoding/toBytes.js
|
|
367
|
-
var encoder2 = /* @__PURE__ */ new TextEncoder();
|
|
368
|
-
function toBytes(value, opts = {}) {
|
|
369
|
-
if (typeof value === "number" || typeof value === "bigint")
|
|
370
|
-
return numberToBytes(value, opts);
|
|
371
|
-
if (typeof value === "boolean")
|
|
372
|
-
return boolToBytes(value, opts);
|
|
373
|
-
if (isHex(value))
|
|
374
|
-
return hexToBytes(value, opts);
|
|
375
|
-
return stringToBytes(value, opts);
|
|
376
|
-
}
|
|
377
|
-
function boolToBytes(value, opts = {}) {
|
|
378
|
-
const bytes = new Uint8Array(1);
|
|
379
|
-
bytes[0] = Number(value);
|
|
380
|
-
if (typeof opts.size === "number") {
|
|
381
|
-
assertSize(bytes, { size: opts.size });
|
|
382
|
-
return pad(bytes, { size: opts.size });
|
|
383
|
-
}
|
|
384
|
-
return bytes;
|
|
385
|
-
}
|
|
386
|
-
var charCodeMap = {
|
|
387
|
-
zero: 48,
|
|
388
|
-
nine: 57,
|
|
389
|
-
A: 65,
|
|
390
|
-
F: 70,
|
|
391
|
-
a: 97,
|
|
392
|
-
f: 102
|
|
393
|
-
};
|
|
394
|
-
function charCodeToBase16(char) {
|
|
395
|
-
if (char >= charCodeMap.zero && char <= charCodeMap.nine)
|
|
396
|
-
return char - charCodeMap.zero;
|
|
397
|
-
if (char >= charCodeMap.A && char <= charCodeMap.F)
|
|
398
|
-
return char - (charCodeMap.A - 10);
|
|
399
|
-
if (char >= charCodeMap.a && char <= charCodeMap.f)
|
|
400
|
-
return char - (charCodeMap.a - 10);
|
|
401
|
-
return void 0;
|
|
402
|
-
}
|
|
403
|
-
function hexToBytes(hex_, opts = {}) {
|
|
404
|
-
let hex = hex_;
|
|
405
|
-
if (opts.size) {
|
|
406
|
-
assertSize(hex, { size: opts.size });
|
|
407
|
-
hex = pad(hex, { dir: "right", size: opts.size });
|
|
408
|
-
}
|
|
409
|
-
let hexString = hex.slice(2);
|
|
410
|
-
if (hexString.length % 2)
|
|
411
|
-
hexString = `0${hexString}`;
|
|
412
|
-
const length = hexString.length / 2;
|
|
413
|
-
const bytes = new Uint8Array(length);
|
|
414
|
-
for (let index = 0, j = 0; index < length; index++) {
|
|
415
|
-
const nibbleLeft = charCodeToBase16(hexString.charCodeAt(j++));
|
|
416
|
-
const nibbleRight = charCodeToBase16(hexString.charCodeAt(j++));
|
|
417
|
-
if (nibbleLeft === void 0 || nibbleRight === void 0) {
|
|
418
|
-
throw new BaseError(`Invalid byte sequence ("${hexString[j - 2]}${hexString[j - 1]}" in "${hexString}").`);
|
|
419
|
-
}
|
|
420
|
-
bytes[index] = nibbleLeft * 16 + nibbleRight;
|
|
421
|
-
}
|
|
422
|
-
return bytes;
|
|
423
|
-
}
|
|
424
|
-
function numberToBytes(value, opts) {
|
|
425
|
-
const hex = numberToHex(value, opts);
|
|
426
|
-
return hexToBytes(hex);
|
|
427
|
-
}
|
|
428
|
-
function stringToBytes(value, opts = {}) {
|
|
429
|
-
const bytes = encoder2.encode(value);
|
|
430
|
-
if (typeof opts.size === "number") {
|
|
431
|
-
assertSize(bytes, { size: opts.size });
|
|
432
|
-
return pad(bytes, { dir: "right", size: opts.size });
|
|
433
|
-
}
|
|
434
|
-
return bytes;
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/errors/address.js
|
|
438
|
-
var InvalidAddressError = class extends BaseError {
|
|
439
|
-
constructor({ address }) {
|
|
440
|
-
super(`Address "${address}" is invalid.`, {
|
|
441
|
-
metaMessages: [
|
|
442
|
-
"- Address must be a hex value of 20 bytes (40 hex characters).",
|
|
443
|
-
"- Address must match its checksum counterpart."
|
|
444
|
-
],
|
|
445
|
-
name: "InvalidAddressError"
|
|
446
|
-
});
|
|
447
|
-
}
|
|
448
|
-
};
|
|
449
|
-
|
|
450
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/hash/keccak256.js
|
|
451
|
-
function keccak256(value, to_) {
|
|
452
|
-
const to = to_ || "hex";
|
|
453
|
-
const bytes = keccak_256(isHex(value, { strict: false }) ? toBytes(value) : value);
|
|
454
|
-
if (to === "bytes")
|
|
455
|
-
return bytes;
|
|
456
|
-
return toHex(bytes);
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/lru.js
|
|
460
|
-
var LruMap = class extends Map {
|
|
461
|
-
constructor(size4) {
|
|
462
|
-
super();
|
|
463
|
-
Object.defineProperty(this, "maxSize", {
|
|
464
|
-
enumerable: true,
|
|
465
|
-
configurable: true,
|
|
466
|
-
writable: true,
|
|
467
|
-
value: void 0
|
|
468
|
-
});
|
|
469
|
-
this.maxSize = size4;
|
|
470
|
-
}
|
|
471
|
-
get(key) {
|
|
472
|
-
const value = super.get(key);
|
|
473
|
-
if (super.has(key)) {
|
|
474
|
-
super.delete(key);
|
|
475
|
-
super.set(key, value);
|
|
476
|
-
}
|
|
477
|
-
return value;
|
|
478
|
-
}
|
|
479
|
-
set(key, value) {
|
|
480
|
-
if (super.has(key))
|
|
481
|
-
super.delete(key);
|
|
482
|
-
super.set(key, value);
|
|
483
|
-
if (this.maxSize && this.size > this.maxSize) {
|
|
484
|
-
const firstKey = super.keys().next().value;
|
|
485
|
-
if (firstKey !== void 0)
|
|
486
|
-
super.delete(firstKey);
|
|
487
|
-
}
|
|
488
|
-
return this;
|
|
489
|
-
}
|
|
490
|
-
};
|
|
491
|
-
|
|
492
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/address/isAddress.js
|
|
493
|
-
var addressRegex = /^0x[a-fA-F0-9]{40}$/;
|
|
494
|
-
var isAddressCache = /* @__PURE__ */ new LruMap(8192);
|
|
495
|
-
function isAddress(address, options) {
|
|
496
|
-
const { strict = true } = options ?? {};
|
|
497
|
-
const cacheKey = `${address}.${strict}`;
|
|
498
|
-
if (isAddressCache.has(cacheKey))
|
|
499
|
-
return isAddressCache.get(cacheKey);
|
|
500
|
-
const result = (() => {
|
|
501
|
-
if (!addressRegex.test(address))
|
|
502
|
-
return false;
|
|
503
|
-
if (address.toLowerCase() === address)
|
|
504
|
-
return true;
|
|
505
|
-
if (strict)
|
|
506
|
-
return checksumAddress(address) === address;
|
|
507
|
-
return true;
|
|
508
|
-
})();
|
|
509
|
-
isAddressCache.set(cacheKey, result);
|
|
510
|
-
return result;
|
|
511
|
-
}
|
|
512
|
-
|
|
513
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/address/getAddress.js
|
|
514
|
-
var checksumAddressCache = /* @__PURE__ */ new LruMap(8192);
|
|
515
|
-
function checksumAddress(address_, chainId) {
|
|
516
|
-
if (checksumAddressCache.has(`${address_}.${chainId}`))
|
|
517
|
-
return checksumAddressCache.get(`${address_}.${chainId}`);
|
|
518
|
-
const hexAddress = chainId ? `${chainId}${address_.toLowerCase()}` : address_.substring(2).toLowerCase();
|
|
519
|
-
const hash = keccak256(stringToBytes(hexAddress), "bytes");
|
|
520
|
-
const address = (chainId ? hexAddress.substring(`${chainId}0x`.length) : hexAddress).split("");
|
|
521
|
-
for (let i = 0; i < 40; i += 2) {
|
|
522
|
-
if (hash[i >> 1] >> 4 >= 8 && address[i]) {
|
|
523
|
-
address[i] = address[i].toUpperCase();
|
|
524
|
-
}
|
|
525
|
-
if ((hash[i >> 1] & 15) >= 8 && address[i + 1]) {
|
|
526
|
-
address[i + 1] = address[i + 1].toUpperCase();
|
|
527
|
-
}
|
|
528
|
-
}
|
|
529
|
-
const result = `0x${address.join("")}`;
|
|
530
|
-
checksumAddressCache.set(`${address_}.${chainId}`, result);
|
|
531
|
-
return result;
|
|
532
|
-
}
|
|
533
|
-
function getAddress(address, chainId) {
|
|
534
|
-
if (!isAddress(address, { strict: false }))
|
|
535
|
-
throw new InvalidAddressError({ address });
|
|
536
|
-
return checksumAddress(address, chainId);
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/data/concat.js
|
|
540
|
-
function concat(values) {
|
|
541
|
-
if (typeof values[0] === "string")
|
|
542
|
-
return concatHex(values);
|
|
543
|
-
return concatBytes(values);
|
|
544
|
-
}
|
|
545
|
-
function concatBytes(values) {
|
|
546
|
-
let length = 0;
|
|
547
|
-
for (const arr of values) {
|
|
548
|
-
length += arr.length;
|
|
549
|
-
}
|
|
550
|
-
const result = new Uint8Array(length);
|
|
551
|
-
let offset = 0;
|
|
552
|
-
for (const arr of values) {
|
|
553
|
-
result.set(arr, offset);
|
|
554
|
-
offset += arr.length;
|
|
555
|
-
}
|
|
556
|
-
return result;
|
|
557
|
-
}
|
|
558
|
-
function concatHex(values) {
|
|
559
|
-
return `0x${values.reduce((acc, x) => acc + x.replace("0x", ""), "")}`;
|
|
560
|
-
}
|
|
561
|
-
|
|
562
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/constants/unit.js
|
|
563
|
-
var etherUnits = {
|
|
564
|
-
gwei: 9,
|
|
565
|
-
wei: 18
|
|
566
|
-
};
|
|
567
|
-
var gweiUnits = {
|
|
568
|
-
ether: -9,
|
|
569
|
-
wei: 9
|
|
570
|
-
};
|
|
571
|
-
var weiUnits = {
|
|
572
|
-
ether: -18,
|
|
573
|
-
gwei: -9
|
|
574
|
-
};
|
|
575
|
-
|
|
576
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/unit/formatUnits.js
|
|
577
|
-
function formatUnits(value, decimals) {
|
|
578
|
-
let display = value.toString();
|
|
579
|
-
const negative = display.startsWith("-");
|
|
580
|
-
if (negative)
|
|
581
|
-
display = display.slice(1);
|
|
582
|
-
display = display.padStart(decimals, "0");
|
|
583
|
-
let [integer, fraction] = [
|
|
584
|
-
display.slice(0, display.length - decimals),
|
|
585
|
-
display.slice(display.length - decimals)
|
|
586
|
-
];
|
|
587
|
-
fraction = fraction.replace(/(0+)$/, "");
|
|
588
|
-
return `${negative ? "-" : ""}${integer || "0"}${fraction ? `.${fraction}` : ""}`;
|
|
589
|
-
}
|
|
590
|
-
|
|
591
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/unit/formatEther.js
|
|
592
|
-
function formatEther(wei, unit = "wei") {
|
|
593
|
-
return formatUnits(wei, etherUnits[unit]);
|
|
594
|
-
}
|
|
595
|
-
|
|
596
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/unit/formatGwei.js
|
|
597
|
-
function formatGwei(wei, unit = "wei") {
|
|
598
|
-
return formatUnits(wei, gweiUnits[unit]);
|
|
599
|
-
}
|
|
600
|
-
|
|
601
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/errors/transaction.js
|
|
602
|
-
function prettyPrint(args) {
|
|
603
|
-
const entries = Object.entries(args).map(([key, value]) => {
|
|
604
|
-
if (value === void 0 || value === false)
|
|
605
|
-
return null;
|
|
606
|
-
return [key, value];
|
|
607
|
-
}).filter(Boolean);
|
|
608
|
-
const maxLength = entries.reduce((acc, [key]) => Math.max(acc, key.length), 0);
|
|
609
|
-
return entries.map(([key, value]) => ` ${`${key}:`.padEnd(maxLength + 1)} ${value}`).join("\n");
|
|
610
|
-
}
|
|
611
|
-
var FeeConflictError = class extends BaseError {
|
|
612
|
-
constructor() {
|
|
613
|
-
super([
|
|
614
|
-
"Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.",
|
|
615
|
-
"Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."
|
|
616
|
-
].join("\n"), { name: "FeeConflictError" });
|
|
617
|
-
}
|
|
618
|
-
};
|
|
619
|
-
var InvalidLegacyVError = class extends BaseError {
|
|
620
|
-
constructor({ v }) {
|
|
621
|
-
super(`Invalid \`v\` value "${v}". Expected 27 or 28.`, {
|
|
622
|
-
name: "InvalidLegacyVError"
|
|
623
|
-
});
|
|
624
|
-
}
|
|
625
|
-
};
|
|
626
|
-
var InvalidYParityError = class extends BaseError {
|
|
627
|
-
constructor({ yParity }) {
|
|
628
|
-
super(`Invalid \`yParity\` value "${yParity}". Expected 0 or 1.`, {
|
|
629
|
-
name: "InvalidYParityError"
|
|
630
|
-
});
|
|
631
|
-
}
|
|
632
|
-
};
|
|
633
|
-
var InvalidSerializableTransactionError = class extends BaseError {
|
|
634
|
-
constructor({ transaction }) {
|
|
635
|
-
super("Cannot infer a transaction type from provided transaction.", {
|
|
636
|
-
metaMessages: [
|
|
637
|
-
"Provided Transaction:",
|
|
638
|
-
"{",
|
|
639
|
-
prettyPrint(transaction),
|
|
640
|
-
"}",
|
|
641
|
-
"",
|
|
642
|
-
"To infer the type, either provide:",
|
|
643
|
-
"- a `type` to the Transaction, or",
|
|
644
|
-
"- an EIP-1559 Transaction with `maxFeePerGas`, or",
|
|
645
|
-
"- an EIP-2930 Transaction with `gasPrice` & `accessList`, or",
|
|
646
|
-
"- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or",
|
|
647
|
-
"- an EIP-7702 Transaction with `authorizationList`, or",
|
|
648
|
-
"- a Legacy Transaction with `gasPrice`"
|
|
649
|
-
],
|
|
650
|
-
name: "InvalidSerializableTransactionError"
|
|
651
|
-
});
|
|
652
|
-
}
|
|
653
|
-
};
|
|
654
|
-
var InvalidSerializedTransactionTypeError = class extends BaseError {
|
|
655
|
-
constructor({ serializedType }) {
|
|
656
|
-
super(`Serialized transaction type "${serializedType}" is invalid.`, {
|
|
657
|
-
name: "InvalidSerializedTransactionType"
|
|
658
|
-
});
|
|
659
|
-
Object.defineProperty(this, "serializedType", {
|
|
660
|
-
enumerable: true,
|
|
661
|
-
configurable: true,
|
|
662
|
-
writable: true,
|
|
663
|
-
value: void 0
|
|
664
|
-
});
|
|
665
|
-
this.serializedType = serializedType;
|
|
666
|
-
}
|
|
667
|
-
};
|
|
668
|
-
var InvalidSerializedTransactionError = class extends BaseError {
|
|
669
|
-
constructor({ attributes, serializedTransaction, type }) {
|
|
670
|
-
const missing = Object.entries(attributes).map(([key, value]) => typeof value === "undefined" ? key : void 0).filter(Boolean);
|
|
671
|
-
super(`Invalid serialized transaction of type "${type}" was provided.`, {
|
|
672
|
-
metaMessages: [
|
|
673
|
-
`Serialized Transaction: "${serializedTransaction}"`,
|
|
674
|
-
missing.length > 0 ? `Missing Attributes: ${missing.join(", ")}` : ""
|
|
675
|
-
].filter(Boolean),
|
|
676
|
-
name: "InvalidSerializedTransactionError"
|
|
677
|
-
});
|
|
678
|
-
Object.defineProperty(this, "serializedTransaction", {
|
|
679
|
-
enumerable: true,
|
|
680
|
-
configurable: true,
|
|
681
|
-
writable: true,
|
|
682
|
-
value: void 0
|
|
683
|
-
});
|
|
684
|
-
Object.defineProperty(this, "type", {
|
|
685
|
-
enumerable: true,
|
|
686
|
-
configurable: true,
|
|
687
|
-
writable: true,
|
|
688
|
-
value: void 0
|
|
689
|
-
});
|
|
690
|
-
this.serializedTransaction = serializedTransaction;
|
|
691
|
-
this.type = type;
|
|
692
|
-
}
|
|
693
|
-
};
|
|
694
|
-
var InvalidStorageKeySizeError = class extends BaseError {
|
|
695
|
-
constructor({ storageKey }) {
|
|
696
|
-
super(`Size for storage key "${storageKey}" is invalid. Expected 32 bytes. Got ${Math.floor((storageKey.length - 2) / 2)} bytes.`, { name: "InvalidStorageKeySizeError" });
|
|
697
|
-
}
|
|
698
|
-
};
|
|
699
|
-
var TransactionExecutionError = class extends BaseError {
|
|
700
|
-
constructor(cause, { account, docsPath, chain, data, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value }) {
|
|
701
|
-
const prettyArgs = prettyPrint({
|
|
702
|
-
chain: chain && `${chain?.name} (id: ${chain?.id})`,
|
|
703
|
-
from: account?.address,
|
|
704
|
-
to,
|
|
705
|
-
value: typeof value !== "undefined" && `${formatEther(value)} ${chain?.nativeCurrency?.symbol || "ETH"}`,
|
|
706
|
-
data,
|
|
707
|
-
gas,
|
|
708
|
-
gasPrice: typeof gasPrice !== "undefined" && `${formatGwei(gasPrice)} gwei`,
|
|
709
|
-
maxFeePerGas: typeof maxFeePerGas !== "undefined" && `${formatGwei(maxFeePerGas)} gwei`,
|
|
710
|
-
maxPriorityFeePerGas: typeof maxPriorityFeePerGas !== "undefined" && `${formatGwei(maxPriorityFeePerGas)} gwei`,
|
|
711
|
-
nonce
|
|
712
|
-
});
|
|
713
|
-
super(cause.shortMessage, {
|
|
714
|
-
cause,
|
|
715
|
-
docsPath,
|
|
716
|
-
metaMessages: [
|
|
717
|
-
...cause.metaMessages ? [...cause.metaMessages, " "] : [],
|
|
718
|
-
"Request Arguments:",
|
|
719
|
-
prettyArgs
|
|
720
|
-
].filter(Boolean),
|
|
721
|
-
name: "TransactionExecutionError"
|
|
722
|
-
});
|
|
723
|
-
Object.defineProperty(this, "cause", {
|
|
724
|
-
enumerable: true,
|
|
725
|
-
configurable: true,
|
|
726
|
-
writable: true,
|
|
727
|
-
value: void 0
|
|
728
|
-
});
|
|
729
|
-
this.cause = cause;
|
|
730
|
-
}
|
|
731
|
-
};
|
|
732
|
-
var TransactionNotFoundError = class extends BaseError {
|
|
733
|
-
constructor({ blockHash, blockNumber, blockTag, hash, index }) {
|
|
734
|
-
let identifier = "Transaction";
|
|
735
|
-
if (blockTag && index !== void 0)
|
|
736
|
-
identifier = `Transaction at block time "${blockTag}" at index "${index}"`;
|
|
737
|
-
if (blockHash && index !== void 0)
|
|
738
|
-
identifier = `Transaction at block hash "${blockHash}" at index "${index}"`;
|
|
739
|
-
if (blockNumber && index !== void 0)
|
|
740
|
-
identifier = `Transaction at block number "${blockNumber}" at index "${index}"`;
|
|
741
|
-
if (hash)
|
|
742
|
-
identifier = `Transaction with hash "${hash}"`;
|
|
743
|
-
super(`${identifier} could not be found.`, {
|
|
744
|
-
name: "TransactionNotFoundError"
|
|
745
|
-
});
|
|
746
|
-
}
|
|
747
|
-
};
|
|
748
|
-
var TransactionReceiptNotFoundError = class extends BaseError {
|
|
749
|
-
constructor({ hash }) {
|
|
750
|
-
super(`Transaction receipt with hash "${hash}" could not be found. The Transaction may not be processed on a block yet.`, {
|
|
751
|
-
name: "TransactionReceiptNotFoundError"
|
|
752
|
-
});
|
|
753
|
-
}
|
|
754
|
-
};
|
|
755
|
-
var TransactionReceiptRevertedError = class extends BaseError {
|
|
756
|
-
constructor({ receipt }) {
|
|
757
|
-
super(`Transaction with hash "${receipt.transactionHash}" reverted.`, {
|
|
758
|
-
metaMessages: [
|
|
759
|
-
'The receipt marked the transaction as "reverted". This could mean that the function on the contract you are trying to call threw an error.',
|
|
760
|
-
" ",
|
|
761
|
-
"You can attempt to extract the revert reason by:",
|
|
762
|
-
"- calling the `simulateContract` or `simulateCalls` Action with the `abi` and `functionName` of the contract",
|
|
763
|
-
"- using the `call` Action with raw `data`"
|
|
764
|
-
],
|
|
765
|
-
name: "TransactionReceiptRevertedError"
|
|
766
|
-
});
|
|
767
|
-
Object.defineProperty(this, "receipt", {
|
|
768
|
-
enumerable: true,
|
|
769
|
-
configurable: true,
|
|
770
|
-
writable: true,
|
|
771
|
-
value: void 0
|
|
772
|
-
});
|
|
773
|
-
this.receipt = receipt;
|
|
774
|
-
}
|
|
775
|
-
};
|
|
776
|
-
var WaitForTransactionReceiptTimeoutError = class extends BaseError {
|
|
777
|
-
constructor({ hash }) {
|
|
778
|
-
super(`Timed out while waiting for transaction with hash "${hash}" to be confirmed.`, { name: "WaitForTransactionReceiptTimeoutError" });
|
|
779
|
-
}
|
|
780
|
-
};
|
|
781
|
-
|
|
782
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/constants/number.js
|
|
783
|
-
var maxInt8 = 2n ** (8n - 1n) - 1n;
|
|
784
|
-
var maxInt16 = 2n ** (16n - 1n) - 1n;
|
|
785
|
-
var maxInt24 = 2n ** (24n - 1n) - 1n;
|
|
786
|
-
var maxInt32 = 2n ** (32n - 1n) - 1n;
|
|
787
|
-
var maxInt40 = 2n ** (40n - 1n) - 1n;
|
|
788
|
-
var maxInt48 = 2n ** (48n - 1n) - 1n;
|
|
789
|
-
var maxInt56 = 2n ** (56n - 1n) - 1n;
|
|
790
|
-
var maxInt64 = 2n ** (64n - 1n) - 1n;
|
|
791
|
-
var maxInt72 = 2n ** (72n - 1n) - 1n;
|
|
792
|
-
var maxInt80 = 2n ** (80n - 1n) - 1n;
|
|
793
|
-
var maxInt88 = 2n ** (88n - 1n) - 1n;
|
|
794
|
-
var maxInt96 = 2n ** (96n - 1n) - 1n;
|
|
795
|
-
var maxInt104 = 2n ** (104n - 1n) - 1n;
|
|
796
|
-
var maxInt112 = 2n ** (112n - 1n) - 1n;
|
|
797
|
-
var maxInt120 = 2n ** (120n - 1n) - 1n;
|
|
798
|
-
var maxInt128 = 2n ** (128n - 1n) - 1n;
|
|
799
|
-
var maxInt136 = 2n ** (136n - 1n) - 1n;
|
|
800
|
-
var maxInt144 = 2n ** (144n - 1n) - 1n;
|
|
801
|
-
var maxInt152 = 2n ** (152n - 1n) - 1n;
|
|
802
|
-
var maxInt160 = 2n ** (160n - 1n) - 1n;
|
|
803
|
-
var maxInt168 = 2n ** (168n - 1n) - 1n;
|
|
804
|
-
var maxInt176 = 2n ** (176n - 1n) - 1n;
|
|
805
|
-
var maxInt184 = 2n ** (184n - 1n) - 1n;
|
|
806
|
-
var maxInt192 = 2n ** (192n - 1n) - 1n;
|
|
807
|
-
var maxInt200 = 2n ** (200n - 1n) - 1n;
|
|
808
|
-
var maxInt208 = 2n ** (208n - 1n) - 1n;
|
|
809
|
-
var maxInt216 = 2n ** (216n - 1n) - 1n;
|
|
810
|
-
var maxInt224 = 2n ** (224n - 1n) - 1n;
|
|
811
|
-
var maxInt232 = 2n ** (232n - 1n) - 1n;
|
|
812
|
-
var maxInt240 = 2n ** (240n - 1n) - 1n;
|
|
813
|
-
var maxInt248 = 2n ** (248n - 1n) - 1n;
|
|
814
|
-
var maxInt256 = 2n ** (256n - 1n) - 1n;
|
|
815
|
-
var minInt8 = -(2n ** (8n - 1n));
|
|
816
|
-
var minInt16 = -(2n ** (16n - 1n));
|
|
817
|
-
var minInt24 = -(2n ** (24n - 1n));
|
|
818
|
-
var minInt32 = -(2n ** (32n - 1n));
|
|
819
|
-
var minInt40 = -(2n ** (40n - 1n));
|
|
820
|
-
var minInt48 = -(2n ** (48n - 1n));
|
|
821
|
-
var minInt56 = -(2n ** (56n - 1n));
|
|
822
|
-
var minInt64 = -(2n ** (64n - 1n));
|
|
823
|
-
var minInt72 = -(2n ** (72n - 1n));
|
|
824
|
-
var minInt80 = -(2n ** (80n - 1n));
|
|
825
|
-
var minInt88 = -(2n ** (88n - 1n));
|
|
826
|
-
var minInt96 = -(2n ** (96n - 1n));
|
|
827
|
-
var minInt104 = -(2n ** (104n - 1n));
|
|
828
|
-
var minInt112 = -(2n ** (112n - 1n));
|
|
829
|
-
var minInt120 = -(2n ** (120n - 1n));
|
|
830
|
-
var minInt128 = -(2n ** (128n - 1n));
|
|
831
|
-
var minInt136 = -(2n ** (136n - 1n));
|
|
832
|
-
var minInt144 = -(2n ** (144n - 1n));
|
|
833
|
-
var minInt152 = -(2n ** (152n - 1n));
|
|
834
|
-
var minInt160 = -(2n ** (160n - 1n));
|
|
835
|
-
var minInt168 = -(2n ** (168n - 1n));
|
|
836
|
-
var minInt176 = -(2n ** (176n - 1n));
|
|
837
|
-
var minInt184 = -(2n ** (184n - 1n));
|
|
838
|
-
var minInt192 = -(2n ** (192n - 1n));
|
|
839
|
-
var minInt200 = -(2n ** (200n - 1n));
|
|
840
|
-
var minInt208 = -(2n ** (208n - 1n));
|
|
841
|
-
var minInt216 = -(2n ** (216n - 1n));
|
|
842
|
-
var minInt224 = -(2n ** (224n - 1n));
|
|
843
|
-
var minInt232 = -(2n ** (232n - 1n));
|
|
844
|
-
var minInt240 = -(2n ** (240n - 1n));
|
|
845
|
-
var minInt248 = -(2n ** (248n - 1n));
|
|
846
|
-
var minInt256 = -(2n ** (256n - 1n));
|
|
847
|
-
var maxUint8 = 2n ** 8n - 1n;
|
|
848
|
-
var maxUint16 = 2n ** 16n - 1n;
|
|
849
|
-
var maxUint24 = 2n ** 24n - 1n;
|
|
850
|
-
var maxUint32 = 2n ** 32n - 1n;
|
|
851
|
-
var maxUint40 = 2n ** 40n - 1n;
|
|
852
|
-
var maxUint48 = 2n ** 48n - 1n;
|
|
853
|
-
var maxUint56 = 2n ** 56n - 1n;
|
|
854
|
-
var maxUint64 = 2n ** 64n - 1n;
|
|
855
|
-
var maxUint72 = 2n ** 72n - 1n;
|
|
856
|
-
var maxUint80 = 2n ** 80n - 1n;
|
|
857
|
-
var maxUint88 = 2n ** 88n - 1n;
|
|
858
|
-
var maxUint96 = 2n ** 96n - 1n;
|
|
859
|
-
var maxUint104 = 2n ** 104n - 1n;
|
|
860
|
-
var maxUint112 = 2n ** 112n - 1n;
|
|
861
|
-
var maxUint120 = 2n ** 120n - 1n;
|
|
862
|
-
var maxUint128 = 2n ** 128n - 1n;
|
|
863
|
-
var maxUint136 = 2n ** 136n - 1n;
|
|
864
|
-
var maxUint144 = 2n ** 144n - 1n;
|
|
865
|
-
var maxUint152 = 2n ** 152n - 1n;
|
|
866
|
-
var maxUint160 = 2n ** 160n - 1n;
|
|
867
|
-
var maxUint168 = 2n ** 168n - 1n;
|
|
868
|
-
var maxUint176 = 2n ** 176n - 1n;
|
|
869
|
-
var maxUint184 = 2n ** 184n - 1n;
|
|
870
|
-
var maxUint192 = 2n ** 192n - 1n;
|
|
871
|
-
var maxUint200 = 2n ** 200n - 1n;
|
|
872
|
-
var maxUint208 = 2n ** 208n - 1n;
|
|
873
|
-
var maxUint216 = 2n ** 216n - 1n;
|
|
874
|
-
var maxUint224 = 2n ** 224n - 1n;
|
|
875
|
-
var maxUint232 = 2n ** 232n - 1n;
|
|
876
|
-
var maxUint240 = 2n ** 240n - 1n;
|
|
877
|
-
var maxUint248 = 2n ** 248n - 1n;
|
|
878
|
-
var maxUint256 = 2n ** 256n - 1n;
|
|
879
|
-
|
|
880
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/errors/chain.js
|
|
881
|
-
var ChainDoesNotSupportContract = class extends BaseError {
|
|
882
|
-
constructor({ blockNumber, chain, contract }) {
|
|
883
|
-
super(`Chain "${chain.name}" does not support contract "${contract.name}".`, {
|
|
884
|
-
metaMessages: [
|
|
885
|
-
"This could be due to any of the following:",
|
|
886
|
-
...blockNumber && contract.blockCreated && contract.blockCreated > blockNumber ? [
|
|
887
|
-
`- The contract "${contract.name}" was not deployed until block ${contract.blockCreated} (current block ${blockNumber}).`
|
|
888
|
-
] : [
|
|
889
|
-
`- The chain does not have the contract "${contract.name}" configured.`
|
|
890
|
-
]
|
|
891
|
-
],
|
|
892
|
-
name: "ChainDoesNotSupportContract"
|
|
893
|
-
});
|
|
894
|
-
}
|
|
895
|
-
};
|
|
896
|
-
var ChainMismatchError = class extends BaseError {
|
|
897
|
-
constructor({ chain, currentChainId }) {
|
|
898
|
-
super(`The current chain of the wallet (id: ${currentChainId}) does not match the target chain for the transaction (id: ${chain.id} \u2013 ${chain.name}).`, {
|
|
899
|
-
metaMessages: [
|
|
900
|
-
`Current Chain ID: ${currentChainId}`,
|
|
901
|
-
`Expected Chain ID: ${chain.id} \u2013 ${chain.name}`
|
|
902
|
-
],
|
|
903
|
-
name: "ChainMismatchError"
|
|
904
|
-
});
|
|
905
|
-
}
|
|
906
|
-
};
|
|
907
|
-
var ChainNotFoundError = class extends BaseError {
|
|
908
|
-
constructor() {
|
|
909
|
-
super([
|
|
910
|
-
"No chain was provided to the request.",
|
|
911
|
-
"Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."
|
|
912
|
-
].join("\n"), {
|
|
913
|
-
name: "ChainNotFoundError"
|
|
914
|
-
});
|
|
915
|
-
}
|
|
916
|
-
};
|
|
917
|
-
var ClientChainNotConfiguredError = class extends BaseError {
|
|
918
|
-
constructor() {
|
|
919
|
-
super("No chain was provided to the Client.", {
|
|
920
|
-
name: "ClientChainNotConfiguredError"
|
|
921
|
-
});
|
|
922
|
-
}
|
|
923
|
-
};
|
|
924
|
-
var InvalidChainIdError = class extends BaseError {
|
|
925
|
-
constructor({ chainId }) {
|
|
926
|
-
super(typeof chainId === "number" ? `Chain ID "${chainId}" is invalid.` : "Chain ID is invalid.", { name: "InvalidChainIdError" });
|
|
927
|
-
}
|
|
928
|
-
};
|
|
929
|
-
|
|
930
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/errors/node.js
|
|
931
|
-
var ExecutionRevertedError = class extends BaseError {
|
|
932
|
-
constructor({ cause, message } = {}) {
|
|
933
|
-
const reason = message?.replace("execution reverted: ", "")?.replace("execution reverted", "");
|
|
934
|
-
super(`Execution reverted ${reason ? `with reason: ${reason}` : "for an unknown reason"}.`, {
|
|
935
|
-
cause,
|
|
936
|
-
name: "ExecutionRevertedError"
|
|
937
|
-
});
|
|
938
|
-
}
|
|
939
|
-
};
|
|
940
|
-
Object.defineProperty(ExecutionRevertedError, "code", {
|
|
941
|
-
enumerable: true,
|
|
942
|
-
configurable: true,
|
|
943
|
-
writable: true,
|
|
944
|
-
value: 3
|
|
945
|
-
});
|
|
946
|
-
Object.defineProperty(ExecutionRevertedError, "nodeMessage", {
|
|
947
|
-
enumerable: true,
|
|
948
|
-
configurable: true,
|
|
949
|
-
writable: true,
|
|
950
|
-
value: /execution reverted|gas required exceeds allowance/
|
|
951
|
-
});
|
|
952
|
-
var FeeCapTooHighError = class extends BaseError {
|
|
953
|
-
constructor({ cause, maxFeePerGas } = {}) {
|
|
954
|
-
super(`The fee cap (\`maxFeePerGas\`${maxFeePerGas ? ` = ${formatGwei(maxFeePerGas)} gwei` : ""}) cannot be higher than the maximum allowed value (2^256-1).`, {
|
|
955
|
-
cause,
|
|
956
|
-
name: "FeeCapTooHighError"
|
|
957
|
-
});
|
|
958
|
-
}
|
|
959
|
-
};
|
|
960
|
-
Object.defineProperty(FeeCapTooHighError, "nodeMessage", {
|
|
961
|
-
enumerable: true,
|
|
962
|
-
configurable: true,
|
|
963
|
-
writable: true,
|
|
964
|
-
value: /max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/
|
|
965
|
-
});
|
|
966
|
-
var FeeCapTooLowError = class extends BaseError {
|
|
967
|
-
constructor({ cause, maxFeePerGas } = {}) {
|
|
968
|
-
super(`The fee cap (\`maxFeePerGas\`${maxFeePerGas ? ` = ${formatGwei(maxFeePerGas)}` : ""} gwei) cannot be lower than the block base fee.`, {
|
|
969
|
-
cause,
|
|
970
|
-
name: "FeeCapTooLowError"
|
|
971
|
-
});
|
|
972
|
-
}
|
|
973
|
-
};
|
|
974
|
-
Object.defineProperty(FeeCapTooLowError, "nodeMessage", {
|
|
975
|
-
enumerable: true,
|
|
976
|
-
configurable: true,
|
|
977
|
-
writable: true,
|
|
978
|
-
value: /max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/
|
|
979
|
-
});
|
|
980
|
-
var NonceTooHighError = class extends BaseError {
|
|
981
|
-
constructor({ cause, nonce } = {}) {
|
|
982
|
-
super(`Nonce provided for the transaction ${nonce ? `(${nonce}) ` : ""}is higher than the next one expected.`, { cause, name: "NonceTooHighError" });
|
|
983
|
-
}
|
|
984
|
-
};
|
|
985
|
-
Object.defineProperty(NonceTooHighError, "nodeMessage", {
|
|
986
|
-
enumerable: true,
|
|
987
|
-
configurable: true,
|
|
988
|
-
writable: true,
|
|
989
|
-
value: /nonce too high/
|
|
990
|
-
});
|
|
991
|
-
var NonceTooLowError = class extends BaseError {
|
|
992
|
-
constructor({ cause, nonce } = {}) {
|
|
993
|
-
super([
|
|
994
|
-
`Nonce provided for the transaction ${nonce ? `(${nonce}) ` : ""}is lower than the current nonce of the account.`,
|
|
995
|
-
"Try increasing the nonce or find the latest nonce with `getTransactionCount`."
|
|
996
|
-
].join("\n"), { cause, name: "NonceTooLowError" });
|
|
997
|
-
}
|
|
998
|
-
};
|
|
999
|
-
Object.defineProperty(NonceTooLowError, "nodeMessage", {
|
|
1000
|
-
enumerable: true,
|
|
1001
|
-
configurable: true,
|
|
1002
|
-
writable: true,
|
|
1003
|
-
value: /nonce too low|transaction already imported|already known/
|
|
1004
|
-
});
|
|
1005
|
-
var NonceMaxValueError = class extends BaseError {
|
|
1006
|
-
constructor({ cause, nonce } = {}) {
|
|
1007
|
-
super(`Nonce provided for the transaction ${nonce ? `(${nonce}) ` : ""}exceeds the maximum allowed nonce.`, { cause, name: "NonceMaxValueError" });
|
|
1008
|
-
}
|
|
1009
|
-
};
|
|
1010
|
-
Object.defineProperty(NonceMaxValueError, "nodeMessage", {
|
|
1011
|
-
enumerable: true,
|
|
1012
|
-
configurable: true,
|
|
1013
|
-
writable: true,
|
|
1014
|
-
value: /nonce has max value/
|
|
1015
|
-
});
|
|
1016
|
-
var InsufficientFundsError = class extends BaseError {
|
|
1017
|
-
constructor({ cause } = {}) {
|
|
1018
|
-
super([
|
|
1019
|
-
"The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."
|
|
1020
|
-
].join("\n"), {
|
|
1021
|
-
cause,
|
|
1022
|
-
metaMessages: [
|
|
1023
|
-
"This error could arise when the account does not have enough funds to:",
|
|
1024
|
-
" - pay for the total gas fee,",
|
|
1025
|
-
" - pay for the value to send.",
|
|
1026
|
-
" ",
|
|
1027
|
-
"The cost of the transaction is calculated as `gas * gas fee + value`, where:",
|
|
1028
|
-
" - `gas` is the amount of gas needed for transaction to execute,",
|
|
1029
|
-
" - `gas fee` is the gas fee,",
|
|
1030
|
-
" - `value` is the amount of ether to send to the recipient."
|
|
1031
|
-
],
|
|
1032
|
-
name: "InsufficientFundsError"
|
|
1033
|
-
});
|
|
1034
|
-
}
|
|
1035
|
-
};
|
|
1036
|
-
Object.defineProperty(InsufficientFundsError, "nodeMessage", {
|
|
1037
|
-
enumerable: true,
|
|
1038
|
-
configurable: true,
|
|
1039
|
-
writable: true,
|
|
1040
|
-
value: /insufficient funds|exceeds transaction sender account balance/
|
|
1041
|
-
});
|
|
1042
|
-
var IntrinsicGasTooHighError = class extends BaseError {
|
|
1043
|
-
constructor({ cause, gas } = {}) {
|
|
1044
|
-
super(`The amount of gas ${gas ? `(${gas}) ` : ""}provided for the transaction exceeds the limit allowed for the block.`, {
|
|
1045
|
-
cause,
|
|
1046
|
-
name: "IntrinsicGasTooHighError"
|
|
1047
|
-
});
|
|
1048
|
-
}
|
|
1049
|
-
};
|
|
1050
|
-
Object.defineProperty(IntrinsicGasTooHighError, "nodeMessage", {
|
|
1051
|
-
enumerable: true,
|
|
1052
|
-
configurable: true,
|
|
1053
|
-
writable: true,
|
|
1054
|
-
value: /intrinsic gas too high|gas limit reached/
|
|
1055
|
-
});
|
|
1056
|
-
var IntrinsicGasTooLowError = class extends BaseError {
|
|
1057
|
-
constructor({ cause, gas } = {}) {
|
|
1058
|
-
super(`The amount of gas ${gas ? `(${gas}) ` : ""}provided for the transaction is too low.`, {
|
|
1059
|
-
cause,
|
|
1060
|
-
name: "IntrinsicGasTooLowError"
|
|
1061
|
-
});
|
|
1062
|
-
}
|
|
1063
|
-
};
|
|
1064
|
-
Object.defineProperty(IntrinsicGasTooLowError, "nodeMessage", {
|
|
1065
|
-
enumerable: true,
|
|
1066
|
-
configurable: true,
|
|
1067
|
-
writable: true,
|
|
1068
|
-
value: /intrinsic gas too low/
|
|
1069
|
-
});
|
|
1070
|
-
var TransactionTypeNotSupportedError = class extends BaseError {
|
|
1071
|
-
constructor({ cause }) {
|
|
1072
|
-
super("The transaction type is not supported for this chain.", {
|
|
1073
|
-
cause,
|
|
1074
|
-
name: "TransactionTypeNotSupportedError"
|
|
1075
|
-
});
|
|
1076
|
-
}
|
|
1077
|
-
};
|
|
1078
|
-
Object.defineProperty(TransactionTypeNotSupportedError, "nodeMessage", {
|
|
1079
|
-
enumerable: true,
|
|
1080
|
-
configurable: true,
|
|
1081
|
-
writable: true,
|
|
1082
|
-
value: /transaction type not valid/
|
|
1083
|
-
});
|
|
1084
|
-
var TipAboveFeeCapError = class extends BaseError {
|
|
1085
|
-
constructor({ cause, maxPriorityFeePerGas, maxFeePerGas } = {}) {
|
|
1086
|
-
super([
|
|
1087
|
-
`The provided tip (\`maxPriorityFeePerGas\`${maxPriorityFeePerGas ? ` = ${formatGwei(maxPriorityFeePerGas)} gwei` : ""}) cannot be higher than the fee cap (\`maxFeePerGas\`${maxFeePerGas ? ` = ${formatGwei(maxFeePerGas)} gwei` : ""}).`
|
|
1088
|
-
].join("\n"), {
|
|
1089
|
-
cause,
|
|
1090
|
-
name: "TipAboveFeeCapError"
|
|
1091
|
-
});
|
|
1092
|
-
}
|
|
1093
|
-
};
|
|
1094
|
-
Object.defineProperty(TipAboveFeeCapError, "nodeMessage", {
|
|
1095
|
-
enumerable: true,
|
|
1096
|
-
configurable: true,
|
|
1097
|
-
writable: true,
|
|
1098
|
-
value: /max priority fee per gas higher than max fee per gas|tip higher than fee cap/
|
|
1099
|
-
});
|
|
1100
|
-
var UnknownNodeError = class extends BaseError {
|
|
1101
|
-
constructor({ cause }) {
|
|
1102
|
-
super(`An error occurred while executing: ${cause?.shortMessage}`, {
|
|
1103
|
-
cause,
|
|
1104
|
-
name: "UnknownNodeError"
|
|
1105
|
-
});
|
|
1106
|
-
}
|
|
1107
|
-
};
|
|
1108
|
-
|
|
1109
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/data/slice.js
|
|
1110
|
-
function slice(value, start, end, { strict } = {}) {
|
|
1111
|
-
if (isHex(value, { strict: false }))
|
|
1112
|
-
return sliceHex(value, start, end, {
|
|
1113
|
-
strict
|
|
1114
|
-
});
|
|
1115
|
-
return sliceBytes(value, start, end, {
|
|
1116
|
-
strict
|
|
1117
|
-
});
|
|
1118
|
-
}
|
|
1119
|
-
function assertStartOffset(value, start) {
|
|
1120
|
-
if (typeof start === "number" && start > 0 && start > size(value) - 1)
|
|
1121
|
-
throw new SliceOffsetOutOfBoundsError({
|
|
1122
|
-
offset: start,
|
|
1123
|
-
position: "start",
|
|
1124
|
-
size: size(value)
|
|
1125
|
-
});
|
|
1126
|
-
}
|
|
1127
|
-
function assertEndOffset(value, start, end) {
|
|
1128
|
-
if (typeof start === "number" && typeof end === "number" && size(value) !== end - start) {
|
|
1129
|
-
throw new SliceOffsetOutOfBoundsError({
|
|
1130
|
-
offset: end,
|
|
1131
|
-
position: "end",
|
|
1132
|
-
size: size(value)
|
|
1133
|
-
});
|
|
1134
|
-
}
|
|
1135
|
-
}
|
|
1136
|
-
function sliceBytes(value_, start, end, { strict } = {}) {
|
|
1137
|
-
assertStartOffset(value_, start);
|
|
1138
|
-
const value = value_.slice(start, end);
|
|
1139
|
-
if (strict)
|
|
1140
|
-
assertEndOffset(value, start, end);
|
|
1141
|
-
return value;
|
|
1142
|
-
}
|
|
1143
|
-
function sliceHex(value_, start, end, { strict } = {}) {
|
|
1144
|
-
assertStartOffset(value_, start);
|
|
1145
|
-
const value = `0x${value_.replace("0x", "").slice((start ?? 0) * 2, (end ?? value_.length) * 2)}`;
|
|
1146
|
-
if (strict)
|
|
1147
|
-
assertEndOffset(value, start, end);
|
|
1148
|
-
return value;
|
|
1149
|
-
}
|
|
1150
|
-
|
|
1151
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/abi/formatAbiItem.js
|
|
1152
|
-
function formatAbiItem(abiItem, { includeName = false } = {}) {
|
|
1153
|
-
if (abiItem.type !== "function" && abiItem.type !== "event" && abiItem.type !== "error")
|
|
1154
|
-
throw new InvalidDefinitionTypeError(abiItem.type);
|
|
1155
|
-
return `${abiItem.name}(${formatAbiParams(abiItem.inputs, { includeName })})`;
|
|
1156
|
-
}
|
|
1157
|
-
function formatAbiParams(params, { includeName = false } = {}) {
|
|
1158
|
-
if (!params)
|
|
1159
|
-
return "";
|
|
1160
|
-
return params.map((param) => formatAbiParam(param, { includeName })).join(includeName ? ", " : ",");
|
|
1161
|
-
}
|
|
1162
|
-
function formatAbiParam(param, { includeName }) {
|
|
1163
|
-
if (param.type.startsWith("tuple")) {
|
|
1164
|
-
return `(${formatAbiParams(param.components, { includeName })})${param.type.slice("tuple".length)}`;
|
|
1165
|
-
}
|
|
1166
|
-
return param.type + (includeName && param.name ? ` ${param.name}` : "");
|
|
1167
|
-
}
|
|
1168
|
-
|
|
1169
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/errors/abi.js
|
|
1170
|
-
var AbiConstructorNotFoundError = class extends BaseError {
|
|
1171
|
-
constructor({ docsPath }) {
|
|
1172
|
-
super([
|
|
1173
|
-
"A constructor was not found on the ABI.",
|
|
1174
|
-
"Make sure you are using the correct ABI and that the constructor exists on it."
|
|
1175
|
-
].join("\n"), {
|
|
1176
|
-
docsPath,
|
|
1177
|
-
name: "AbiConstructorNotFoundError"
|
|
1178
|
-
});
|
|
1179
|
-
}
|
|
1180
|
-
};
|
|
1181
|
-
var AbiConstructorParamsNotFoundError = class extends BaseError {
|
|
1182
|
-
constructor({ docsPath }) {
|
|
1183
|
-
super([
|
|
1184
|
-
"Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.",
|
|
1185
|
-
"Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."
|
|
1186
|
-
].join("\n"), {
|
|
1187
|
-
docsPath,
|
|
1188
|
-
name: "AbiConstructorParamsNotFoundError"
|
|
1189
|
-
});
|
|
1190
|
-
}
|
|
1191
|
-
};
|
|
1192
|
-
var AbiDecodingDataSizeInvalidError = class extends BaseError {
|
|
1193
|
-
constructor({ data, size: size4 }) {
|
|
1194
|
-
super([
|
|
1195
|
-
`Data size of ${size4} bytes is invalid.`,
|
|
1196
|
-
"Size must be in increments of 32 bytes (size % 32 === 0)."
|
|
1197
|
-
].join("\n"), {
|
|
1198
|
-
metaMessages: [`Data: ${data} (${size4} bytes)`],
|
|
1199
|
-
name: "AbiDecodingDataSizeInvalidError"
|
|
1200
|
-
});
|
|
1201
|
-
}
|
|
1202
|
-
};
|
|
1203
|
-
var AbiDecodingDataSizeTooSmallError = class extends BaseError {
|
|
1204
|
-
constructor({ data, params, size: size4 }) {
|
|
1205
|
-
super([`Data size of ${size4} bytes is too small for given parameters.`].join("\n"), {
|
|
1206
|
-
metaMessages: [
|
|
1207
|
-
`Params: (${formatAbiParams(params, { includeName: true })})`,
|
|
1208
|
-
`Data: ${data} (${size4} bytes)`
|
|
1209
|
-
],
|
|
1210
|
-
name: "AbiDecodingDataSizeTooSmallError"
|
|
1211
|
-
});
|
|
1212
|
-
Object.defineProperty(this, "data", {
|
|
1213
|
-
enumerable: true,
|
|
1214
|
-
configurable: true,
|
|
1215
|
-
writable: true,
|
|
1216
|
-
value: void 0
|
|
1217
|
-
});
|
|
1218
|
-
Object.defineProperty(this, "params", {
|
|
1219
|
-
enumerable: true,
|
|
1220
|
-
configurable: true,
|
|
1221
|
-
writable: true,
|
|
1222
|
-
value: void 0
|
|
1223
|
-
});
|
|
1224
|
-
Object.defineProperty(this, "size", {
|
|
1225
|
-
enumerable: true,
|
|
1226
|
-
configurable: true,
|
|
1227
|
-
writable: true,
|
|
1228
|
-
value: void 0
|
|
1229
|
-
});
|
|
1230
|
-
this.data = data;
|
|
1231
|
-
this.params = params;
|
|
1232
|
-
this.size = size4;
|
|
1233
|
-
}
|
|
1234
|
-
};
|
|
1235
|
-
var AbiDecodingZeroDataError = class extends BaseError {
|
|
1236
|
-
constructor({ cause } = {}) {
|
|
1237
|
-
super('Cannot decode zero data ("0x") with ABI parameters.', {
|
|
1238
|
-
name: "AbiDecodingZeroDataError",
|
|
1239
|
-
cause
|
|
1240
|
-
});
|
|
1241
|
-
}
|
|
1242
|
-
};
|
|
1243
|
-
var AbiEncodingArrayLengthMismatchError = class extends BaseError {
|
|
1244
|
-
constructor({ expectedLength, givenLength, type }) {
|
|
1245
|
-
super([
|
|
1246
|
-
`ABI encoding array length mismatch for type ${type}.`,
|
|
1247
|
-
`Expected length: ${expectedLength}`,
|
|
1248
|
-
`Given length: ${givenLength}`
|
|
1249
|
-
].join("\n"), { name: "AbiEncodingArrayLengthMismatchError" });
|
|
1250
|
-
}
|
|
1251
|
-
};
|
|
1252
|
-
var AbiEncodingBytesSizeMismatchError = class extends BaseError {
|
|
1253
|
-
constructor({ expectedSize, value }) {
|
|
1254
|
-
super(`Size of bytes "${value}" (bytes${size(value)}) does not match expected size (bytes${expectedSize}).`, { name: "AbiEncodingBytesSizeMismatchError" });
|
|
1255
|
-
}
|
|
1256
|
-
};
|
|
1257
|
-
var AbiEncodingLengthMismatchError = class extends BaseError {
|
|
1258
|
-
constructor({ expectedLength, givenLength }) {
|
|
1259
|
-
super([
|
|
1260
|
-
"ABI encoding params/values length mismatch.",
|
|
1261
|
-
`Expected length (params): ${expectedLength}`,
|
|
1262
|
-
`Given length (values): ${givenLength}`
|
|
1263
|
-
].join("\n"), { name: "AbiEncodingLengthMismatchError" });
|
|
1264
|
-
}
|
|
1265
|
-
};
|
|
1266
|
-
var AbiErrorInputsNotFoundError = class extends BaseError {
|
|
1267
|
-
constructor(errorName, { docsPath }) {
|
|
1268
|
-
super([
|
|
1269
|
-
`Arguments (\`args\`) were provided to "${errorName}", but "${errorName}" on the ABI does not contain any parameters (\`inputs\`).`,
|
|
1270
|
-
"Cannot encode error result without knowing what the parameter types are.",
|
|
1271
|
-
"Make sure you are using the correct ABI and that the inputs exist on it."
|
|
1272
|
-
].join("\n"), {
|
|
1273
|
-
docsPath,
|
|
1274
|
-
name: "AbiErrorInputsNotFoundError"
|
|
1275
|
-
});
|
|
1276
|
-
}
|
|
1277
|
-
};
|
|
1278
|
-
var AbiErrorNotFoundError = class extends BaseError {
|
|
1279
|
-
constructor(errorName, { docsPath } = {}) {
|
|
1280
|
-
super([
|
|
1281
|
-
`Error ${errorName ? `"${errorName}" ` : ""}not found on ABI.`,
|
|
1282
|
-
"Make sure you are using the correct ABI and that the error exists on it."
|
|
1283
|
-
].join("\n"), {
|
|
1284
|
-
docsPath,
|
|
1285
|
-
name: "AbiErrorNotFoundError"
|
|
1286
|
-
});
|
|
1287
|
-
}
|
|
1288
|
-
};
|
|
1289
|
-
var AbiErrorSignatureNotFoundError = class extends BaseError {
|
|
1290
|
-
constructor(signature, { docsPath, cause }) {
|
|
1291
|
-
super([
|
|
1292
|
-
`Encoded error signature "${signature}" not found on ABI.`,
|
|
1293
|
-
"Make sure you are using the correct ABI and that the error exists on it.",
|
|
1294
|
-
`You can look up the decoded signature here: https://4byte.sourcify.dev/?q=${signature}.`
|
|
1295
|
-
].join("\n"), {
|
|
1296
|
-
docsPath,
|
|
1297
|
-
name: "AbiErrorSignatureNotFoundError",
|
|
1298
|
-
cause
|
|
1299
|
-
});
|
|
1300
|
-
Object.defineProperty(this, "signature", {
|
|
1301
|
-
enumerable: true,
|
|
1302
|
-
configurable: true,
|
|
1303
|
-
writable: true,
|
|
1304
|
-
value: void 0
|
|
1305
|
-
});
|
|
1306
|
-
this.signature = signature;
|
|
1307
|
-
}
|
|
1308
|
-
};
|
|
1309
|
-
var AbiEventSignatureEmptyTopicsError = class extends BaseError {
|
|
1310
|
-
constructor({ docsPath }) {
|
|
1311
|
-
super("Cannot extract event signature from empty topics.", {
|
|
1312
|
-
docsPath,
|
|
1313
|
-
name: "AbiEventSignatureEmptyTopicsError"
|
|
1314
|
-
});
|
|
1315
|
-
}
|
|
1316
|
-
};
|
|
1317
|
-
var AbiEventSignatureNotFoundError = class extends BaseError {
|
|
1318
|
-
constructor(signature, { docsPath }) {
|
|
1319
|
-
super([
|
|
1320
|
-
`Encoded event signature "${signature}" not found on ABI.`,
|
|
1321
|
-
"Make sure you are using the correct ABI and that the event exists on it.",
|
|
1322
|
-
`You can look up the signature here: https://4byte.sourcify.dev/?q=${signature}.`
|
|
1323
|
-
].join("\n"), {
|
|
1324
|
-
docsPath,
|
|
1325
|
-
name: "AbiEventSignatureNotFoundError"
|
|
1326
|
-
});
|
|
1327
|
-
}
|
|
1328
|
-
};
|
|
1329
|
-
var AbiEventNotFoundError = class extends BaseError {
|
|
1330
|
-
constructor(eventName, { docsPath } = {}) {
|
|
1331
|
-
super([
|
|
1332
|
-
`Event ${eventName ? `"${eventName}" ` : ""}not found on ABI.`,
|
|
1333
|
-
"Make sure you are using the correct ABI and that the event exists on it."
|
|
1334
|
-
].join("\n"), {
|
|
1335
|
-
docsPath,
|
|
1336
|
-
name: "AbiEventNotFoundError"
|
|
1337
|
-
});
|
|
1338
|
-
}
|
|
1339
|
-
};
|
|
1340
|
-
var AbiFunctionNotFoundError = class extends BaseError {
|
|
1341
|
-
constructor(functionName, { docsPath } = {}) {
|
|
1342
|
-
super([
|
|
1343
|
-
`Function ${functionName ? `"${functionName}" ` : ""}not found on ABI.`,
|
|
1344
|
-
"Make sure you are using the correct ABI and that the function exists on it."
|
|
1345
|
-
].join("\n"), {
|
|
1346
|
-
docsPath,
|
|
1347
|
-
name: "AbiFunctionNotFoundError"
|
|
1348
|
-
});
|
|
1349
|
-
}
|
|
1350
|
-
};
|
|
1351
|
-
var AbiFunctionOutputsNotFoundError = class extends BaseError {
|
|
1352
|
-
constructor(functionName, { docsPath }) {
|
|
1353
|
-
super([
|
|
1354
|
-
`Function "${functionName}" does not contain any \`outputs\` on ABI.`,
|
|
1355
|
-
"Cannot decode function result without knowing what the parameter types are.",
|
|
1356
|
-
"Make sure you are using the correct ABI and that the function exists on it."
|
|
1357
|
-
].join("\n"), {
|
|
1358
|
-
docsPath,
|
|
1359
|
-
name: "AbiFunctionOutputsNotFoundError"
|
|
1360
|
-
});
|
|
1361
|
-
}
|
|
1362
|
-
};
|
|
1363
|
-
var AbiFunctionSignatureNotFoundError = class extends BaseError {
|
|
1364
|
-
constructor(signature, { docsPath }) {
|
|
1365
|
-
super([
|
|
1366
|
-
`Encoded function signature "${signature}" not found on ABI.`,
|
|
1367
|
-
"Make sure you are using the correct ABI and that the function exists on it.",
|
|
1368
|
-
`You can look up the signature here: https://4byte.sourcify.dev/?q=${signature}.`
|
|
1369
|
-
].join("\n"), {
|
|
1370
|
-
docsPath,
|
|
1371
|
-
name: "AbiFunctionSignatureNotFoundError"
|
|
1372
|
-
});
|
|
1373
|
-
}
|
|
1374
|
-
};
|
|
1375
|
-
var AbiItemAmbiguityError = class extends BaseError {
|
|
1376
|
-
constructor(x, y) {
|
|
1377
|
-
super("Found ambiguous types in overloaded ABI items.", {
|
|
1378
|
-
metaMessages: [
|
|
1379
|
-
`\`${x.type}\` in \`${formatAbiItem(x.abiItem)}\`, and`,
|
|
1380
|
-
`\`${y.type}\` in \`${formatAbiItem(y.abiItem)}\``,
|
|
1381
|
-
"",
|
|
1382
|
-
"These types encode differently and cannot be distinguished at runtime.",
|
|
1383
|
-
"Remove one of the ambiguous items in the ABI."
|
|
1384
|
-
],
|
|
1385
|
-
name: "AbiItemAmbiguityError"
|
|
1386
|
-
});
|
|
1387
|
-
}
|
|
1388
|
-
};
|
|
1389
|
-
var BytesSizeMismatchError = class extends BaseError {
|
|
1390
|
-
constructor({ expectedSize, givenSize }) {
|
|
1391
|
-
super(`Expected bytes${expectedSize}, got bytes${givenSize}.`, {
|
|
1392
|
-
name: "BytesSizeMismatchError"
|
|
1393
|
-
});
|
|
1394
|
-
}
|
|
1395
|
-
};
|
|
1396
|
-
var DecodeLogDataMismatch = class extends BaseError {
|
|
1397
|
-
constructor({ abiItem, data, params, size: size4 }) {
|
|
1398
|
-
super([
|
|
1399
|
-
`Data size of ${size4} bytes is too small for non-indexed event parameters.`
|
|
1400
|
-
].join("\n"), {
|
|
1401
|
-
metaMessages: [
|
|
1402
|
-
`Params: (${formatAbiParams(params, { includeName: true })})`,
|
|
1403
|
-
`Data: ${data} (${size4} bytes)`
|
|
1404
|
-
],
|
|
1405
|
-
name: "DecodeLogDataMismatch"
|
|
1406
|
-
});
|
|
1407
|
-
Object.defineProperty(this, "abiItem", {
|
|
1408
|
-
enumerable: true,
|
|
1409
|
-
configurable: true,
|
|
1410
|
-
writable: true,
|
|
1411
|
-
value: void 0
|
|
1412
|
-
});
|
|
1413
|
-
Object.defineProperty(this, "data", {
|
|
1414
|
-
enumerable: true,
|
|
1415
|
-
configurable: true,
|
|
1416
|
-
writable: true,
|
|
1417
|
-
value: void 0
|
|
1418
|
-
});
|
|
1419
|
-
Object.defineProperty(this, "params", {
|
|
1420
|
-
enumerable: true,
|
|
1421
|
-
configurable: true,
|
|
1422
|
-
writable: true,
|
|
1423
|
-
value: void 0
|
|
1424
|
-
});
|
|
1425
|
-
Object.defineProperty(this, "size", {
|
|
1426
|
-
enumerable: true,
|
|
1427
|
-
configurable: true,
|
|
1428
|
-
writable: true,
|
|
1429
|
-
value: void 0
|
|
1430
|
-
});
|
|
1431
|
-
this.abiItem = abiItem;
|
|
1432
|
-
this.data = data;
|
|
1433
|
-
this.params = params;
|
|
1434
|
-
this.size = size4;
|
|
1435
|
-
}
|
|
1436
|
-
};
|
|
1437
|
-
var DecodeLogTopicsMismatch = class extends BaseError {
|
|
1438
|
-
constructor({ abiItem, param }) {
|
|
1439
|
-
super([
|
|
1440
|
-
`Expected a topic for indexed event parameter${param.name ? ` "${param.name}"` : ""} on event "${formatAbiItem(abiItem, { includeName: true })}".`
|
|
1441
|
-
].join("\n"), { name: "DecodeLogTopicsMismatch" });
|
|
1442
|
-
Object.defineProperty(this, "abiItem", {
|
|
1443
|
-
enumerable: true,
|
|
1444
|
-
configurable: true,
|
|
1445
|
-
writable: true,
|
|
1446
|
-
value: void 0
|
|
1447
|
-
});
|
|
1448
|
-
this.abiItem = abiItem;
|
|
1449
|
-
}
|
|
1450
|
-
};
|
|
1451
|
-
var InvalidAbiEncodingTypeError = class extends BaseError {
|
|
1452
|
-
constructor(type, { docsPath }) {
|
|
1453
|
-
super([
|
|
1454
|
-
`Type "${type}" is not a valid encoding type.`,
|
|
1455
|
-
"Please provide a valid ABI type."
|
|
1456
|
-
].join("\n"), { docsPath, name: "InvalidAbiEncodingType" });
|
|
1457
|
-
}
|
|
1458
|
-
};
|
|
1459
|
-
var InvalidAbiDecodingTypeError = class extends BaseError {
|
|
1460
|
-
constructor(type, { docsPath }) {
|
|
1461
|
-
super([
|
|
1462
|
-
`Type "${type}" is not a valid decoding type.`,
|
|
1463
|
-
"Please provide a valid ABI type."
|
|
1464
|
-
].join("\n"), { docsPath, name: "InvalidAbiDecodingType" });
|
|
1465
|
-
}
|
|
1466
|
-
};
|
|
1467
|
-
var InvalidArrayError = class extends BaseError {
|
|
1468
|
-
constructor(value) {
|
|
1469
|
-
super([`Value "${value}" is not a valid array.`].join("\n"), {
|
|
1470
|
-
name: "InvalidArrayError"
|
|
1471
|
-
});
|
|
1472
|
-
}
|
|
1473
|
-
};
|
|
1474
|
-
var InvalidDefinitionTypeError = class extends BaseError {
|
|
1475
|
-
constructor(type) {
|
|
1476
|
-
super([
|
|
1477
|
-
`"${type}" is not a valid definition type.`,
|
|
1478
|
-
'Valid types: "function", "event", "error"'
|
|
1479
|
-
].join("\n"), { name: "InvalidDefinitionTypeError" });
|
|
1480
|
-
}
|
|
1481
|
-
};
|
|
1482
|
-
var UnsupportedPackedAbiType = class extends BaseError {
|
|
1483
|
-
constructor(type) {
|
|
1484
|
-
super(`Type "${type}" is not supported for packed encoding.`, {
|
|
1485
|
-
name: "UnsupportedPackedAbiType"
|
|
1486
|
-
});
|
|
1487
|
-
}
|
|
1488
|
-
};
|
|
1489
|
-
|
|
1490
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/regex.js
|
|
1491
|
-
var arrayRegex = /^(.*)\[([0-9]*)\]$/;
|
|
1492
|
-
var bytesRegex = /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/;
|
|
1493
|
-
var integerRegex = /^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;
|
|
1494
|
-
|
|
1495
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/abi/encodeAbiParameters.js
|
|
1496
|
-
function encodeAbiParameters(params, values) {
|
|
1497
|
-
if (params.length !== values.length)
|
|
1498
|
-
throw new AbiEncodingLengthMismatchError({
|
|
1499
|
-
expectedLength: params.length,
|
|
1500
|
-
givenLength: values.length
|
|
1501
|
-
});
|
|
1502
|
-
const preparedParams = prepareParams({
|
|
1503
|
-
params,
|
|
1504
|
-
values
|
|
1505
|
-
});
|
|
1506
|
-
return encodeParams(preparedParams);
|
|
1507
|
-
}
|
|
1508
|
-
function prepareParams({ params, values }) {
|
|
1509
|
-
const preparedParams = [];
|
|
1510
|
-
for (let i = 0; i < params.length; i++) {
|
|
1511
|
-
preparedParams.push(prepareParam({ param: params[i], value: values[i] }));
|
|
1512
|
-
}
|
|
1513
|
-
return preparedParams;
|
|
1514
|
-
}
|
|
1515
|
-
function prepareParam({ param, value }) {
|
|
1516
|
-
const arrayComponents = getArrayComponents(param.type);
|
|
1517
|
-
if (arrayComponents) {
|
|
1518
|
-
const [length, type] = arrayComponents;
|
|
1519
|
-
return encodeArray(value, { length, param: { ...param, type } });
|
|
1520
|
-
}
|
|
1521
|
-
if (param.type === "tuple") {
|
|
1522
|
-
return encodeTuple(value, {
|
|
1523
|
-
param
|
|
1524
|
-
});
|
|
1525
|
-
}
|
|
1526
|
-
if (param.type === "address") {
|
|
1527
|
-
return encodeAddress(value);
|
|
1528
|
-
}
|
|
1529
|
-
if (param.type === "bool") {
|
|
1530
|
-
return encodeBool(value);
|
|
1531
|
-
}
|
|
1532
|
-
if (param.type.startsWith("uint") || param.type.startsWith("int")) {
|
|
1533
|
-
const signed = param.type.startsWith("int");
|
|
1534
|
-
const [, , size4 = "256"] = integerRegex.exec(param.type) ?? [];
|
|
1535
|
-
return encodeNumber(value, {
|
|
1536
|
-
signed,
|
|
1537
|
-
size: Number(size4)
|
|
1538
|
-
});
|
|
1539
|
-
}
|
|
1540
|
-
if (param.type.startsWith("bytes")) {
|
|
1541
|
-
return encodeBytes(value, { param });
|
|
1542
|
-
}
|
|
1543
|
-
if (param.type === "string") {
|
|
1544
|
-
return encodeString(value);
|
|
1545
|
-
}
|
|
1546
|
-
throw new InvalidAbiEncodingTypeError(param.type, {
|
|
1547
|
-
docsPath: "/docs/contract/encodeAbiParameters"
|
|
1548
|
-
});
|
|
1549
|
-
}
|
|
1550
|
-
function encodeParams(preparedParams) {
|
|
1551
|
-
let staticSize = 0;
|
|
1552
|
-
for (let i = 0; i < preparedParams.length; i++) {
|
|
1553
|
-
const { dynamic, encoded } = preparedParams[i];
|
|
1554
|
-
if (dynamic)
|
|
1555
|
-
staticSize += 32;
|
|
1556
|
-
else
|
|
1557
|
-
staticSize += size(encoded);
|
|
1558
|
-
}
|
|
1559
|
-
const staticParams = [];
|
|
1560
|
-
const dynamicParams = [];
|
|
1561
|
-
let dynamicSize = 0;
|
|
1562
|
-
for (let i = 0; i < preparedParams.length; i++) {
|
|
1563
|
-
const { dynamic, encoded } = preparedParams[i];
|
|
1564
|
-
if (dynamic) {
|
|
1565
|
-
staticParams.push(numberToHex(staticSize + dynamicSize, { size: 32 }));
|
|
1566
|
-
dynamicParams.push(encoded);
|
|
1567
|
-
dynamicSize += size(encoded);
|
|
1568
|
-
} else {
|
|
1569
|
-
staticParams.push(encoded);
|
|
1570
|
-
}
|
|
1571
|
-
}
|
|
1572
|
-
return concatHex([...staticParams, ...dynamicParams]);
|
|
1573
|
-
}
|
|
1574
|
-
function encodeAddress(value) {
|
|
1575
|
-
if (!isAddress(value))
|
|
1576
|
-
throw new InvalidAddressError({ address: value });
|
|
1577
|
-
return { dynamic: false, encoded: padHex(value.toLowerCase()) };
|
|
1578
|
-
}
|
|
1579
|
-
function encodeArray(value, { length, param }) {
|
|
1580
|
-
const dynamic = length === null;
|
|
1581
|
-
if (!Array.isArray(value))
|
|
1582
|
-
throw new InvalidArrayError(value);
|
|
1583
|
-
if (!dynamic && value.length !== length)
|
|
1584
|
-
throw new AbiEncodingArrayLengthMismatchError({
|
|
1585
|
-
expectedLength: length,
|
|
1586
|
-
givenLength: value.length,
|
|
1587
|
-
type: `${param.type}[${length}]`
|
|
1588
|
-
});
|
|
1589
|
-
let dynamicChild = value.length === 0 && isDynamicType(param);
|
|
1590
|
-
const preparedParams = [];
|
|
1591
|
-
for (let i = 0; i < value.length; i++) {
|
|
1592
|
-
const preparedParam = prepareParam({ param, value: value[i] });
|
|
1593
|
-
if (preparedParam.dynamic)
|
|
1594
|
-
dynamicChild = true;
|
|
1595
|
-
preparedParams.push(preparedParam);
|
|
1596
|
-
}
|
|
1597
|
-
if (dynamic || dynamicChild) {
|
|
1598
|
-
const data = encodeParams(preparedParams);
|
|
1599
|
-
if (dynamic) {
|
|
1600
|
-
const length2 = numberToHex(preparedParams.length, { size: 32 });
|
|
1601
|
-
return {
|
|
1602
|
-
dynamic: true,
|
|
1603
|
-
encoded: concatHex([length2, data])
|
|
1604
|
-
};
|
|
1605
|
-
}
|
|
1606
|
-
if (dynamicChild)
|
|
1607
|
-
return { dynamic: true, encoded: data };
|
|
1608
|
-
}
|
|
1609
|
-
return {
|
|
1610
|
-
dynamic: false,
|
|
1611
|
-
encoded: concatHex(preparedParams.map(({ encoded }) => encoded))
|
|
1612
|
-
};
|
|
1613
|
-
}
|
|
1614
|
-
function encodeBytes(value, { param }) {
|
|
1615
|
-
const [, paramSize] = param.type.split("bytes");
|
|
1616
|
-
const bytesSize = size(value);
|
|
1617
|
-
if (!paramSize) {
|
|
1618
|
-
let value_ = value;
|
|
1619
|
-
if (bytesSize % 32 !== 0)
|
|
1620
|
-
value_ = padHex(value_, {
|
|
1621
|
-
dir: "right",
|
|
1622
|
-
size: Math.ceil((value.length - 2) / 2 / 32) * 32
|
|
1623
|
-
});
|
|
1624
|
-
return {
|
|
1625
|
-
dynamic: true,
|
|
1626
|
-
encoded: concatHex([
|
|
1627
|
-
padHex(numberToHex(bytesSize, { size: 32 })),
|
|
1628
|
-
value_
|
|
1629
|
-
])
|
|
1630
|
-
};
|
|
1631
|
-
}
|
|
1632
|
-
if (bytesSize !== Number.parseInt(paramSize, 10))
|
|
1633
|
-
throw new AbiEncodingBytesSizeMismatchError({
|
|
1634
|
-
expectedSize: Number.parseInt(paramSize, 10),
|
|
1635
|
-
value
|
|
1636
|
-
});
|
|
1637
|
-
return { dynamic: false, encoded: padHex(value, { dir: "right" }) };
|
|
1638
|
-
}
|
|
1639
|
-
function encodeBool(value) {
|
|
1640
|
-
if (typeof value !== "boolean")
|
|
1641
|
-
throw new BaseError(`Invalid boolean value: "${value}" (type: ${typeof value}). Expected: \`true\` or \`false\`.`);
|
|
1642
|
-
return { dynamic: false, encoded: padHex(boolToHex(value)) };
|
|
1643
|
-
}
|
|
1644
|
-
function encodeNumber(value, { signed, size: size4 = 256 }) {
|
|
1645
|
-
if (typeof size4 === "number") {
|
|
1646
|
-
const max = 2n ** (BigInt(size4) - (signed ? 1n : 0n)) - 1n;
|
|
1647
|
-
const min = signed ? -max - 1n : 0n;
|
|
1648
|
-
if (value > max || value < min)
|
|
1649
|
-
throw new IntegerOutOfRangeError({
|
|
1650
|
-
max: max.toString(),
|
|
1651
|
-
min: min.toString(),
|
|
1652
|
-
signed,
|
|
1653
|
-
size: size4 / 8,
|
|
1654
|
-
value: value.toString()
|
|
1655
|
-
});
|
|
1656
|
-
}
|
|
1657
|
-
return {
|
|
1658
|
-
dynamic: false,
|
|
1659
|
-
encoded: numberToHex(value, {
|
|
1660
|
-
size: 32,
|
|
1661
|
-
signed
|
|
1662
|
-
})
|
|
1663
|
-
};
|
|
1664
|
-
}
|
|
1665
|
-
function encodeString(value) {
|
|
1666
|
-
const hexValue = stringToHex(value);
|
|
1667
|
-
const partsLength = Math.ceil(size(hexValue) / 32);
|
|
1668
|
-
const parts = [];
|
|
1669
|
-
for (let i = 0; i < partsLength; i++) {
|
|
1670
|
-
parts.push(padHex(slice(hexValue, i * 32, (i + 1) * 32), {
|
|
1671
|
-
dir: "right"
|
|
1672
|
-
}));
|
|
1673
|
-
}
|
|
1674
|
-
return {
|
|
1675
|
-
dynamic: true,
|
|
1676
|
-
encoded: concatHex([
|
|
1677
|
-
padHex(numberToHex(size(hexValue), { size: 32 })),
|
|
1678
|
-
...parts
|
|
1679
|
-
])
|
|
1680
|
-
};
|
|
1681
|
-
}
|
|
1682
|
-
function encodeTuple(value, { param }) {
|
|
1683
|
-
let dynamic = false;
|
|
1684
|
-
const preparedParams = [];
|
|
1685
|
-
for (let i = 0; i < param.components.length; i++) {
|
|
1686
|
-
const param_ = param.components[i];
|
|
1687
|
-
const index = Array.isArray(value) ? i : param_.name;
|
|
1688
|
-
const preparedParam = prepareParam({
|
|
1689
|
-
param: param_,
|
|
1690
|
-
value: value[index]
|
|
1691
|
-
});
|
|
1692
|
-
preparedParams.push(preparedParam);
|
|
1693
|
-
if (preparedParam.dynamic)
|
|
1694
|
-
dynamic = true;
|
|
1695
|
-
}
|
|
1696
|
-
return {
|
|
1697
|
-
dynamic,
|
|
1698
|
-
encoded: dynamic ? encodeParams(preparedParams) : concatHex(preparedParams.map(({ encoded }) => encoded))
|
|
1699
|
-
};
|
|
1700
|
-
}
|
|
1701
|
-
function getArrayComponents(type) {
|
|
1702
|
-
const matches = type.match(/^(.*)\[(\d+)?\]$/);
|
|
1703
|
-
return matches ? (
|
|
1704
|
-
// Return `null` if the array is dynamic.
|
|
1705
|
-
[matches[2] ? Number(matches[2]) : null, matches[1]]
|
|
1706
|
-
) : void 0;
|
|
1707
|
-
}
|
|
1708
|
-
function isDynamicType(param) {
|
|
1709
|
-
const { type } = param;
|
|
1710
|
-
if (type === "string")
|
|
1711
|
-
return true;
|
|
1712
|
-
if (type === "bytes")
|
|
1713
|
-
return true;
|
|
1714
|
-
if (type.endsWith("[]"))
|
|
1715
|
-
return true;
|
|
1716
|
-
if (type === "tuple")
|
|
1717
|
-
return param.components.some(isDynamicType);
|
|
1718
|
-
const arrayComponents = getArrayComponents(type);
|
|
1719
|
-
if (arrayComponents)
|
|
1720
|
-
return isDynamicType({ ...param, type: arrayComponents[1] });
|
|
1721
|
-
return false;
|
|
1722
|
-
}
|
|
1723
|
-
|
|
1724
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/stringify.js
|
|
1725
|
-
var stringify = (value, replacer, space) => JSON.stringify(value, (key, value_) => {
|
|
1726
|
-
const value2 = typeof value_ === "bigint" ? value_.toString() : value_;
|
|
1727
|
-
return typeof replacer === "function" ? replacer(key, value2) : value2;
|
|
1728
|
-
}, space);
|
|
1729
|
-
|
|
1730
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/block/formatBlockParameter.js
|
|
1731
|
-
function formatBlockParameter(parameters) {
|
|
1732
|
-
const { blockHash, blockNumber, blockTag, requireCanonical } = parameters;
|
|
1733
|
-
if (requireCanonical !== void 0 && !blockHash)
|
|
1734
|
-
throw new BaseError("`requireCanonical` can only be provided when `blockHash` is set.");
|
|
1735
|
-
if (blockHash)
|
|
1736
|
-
return requireCanonical ? { blockHash, requireCanonical } : { blockHash };
|
|
1737
|
-
if (typeof blockNumber === "bigint")
|
|
1738
|
-
return numberToHex(blockNumber);
|
|
1739
|
-
return blockTag ?? "latest";
|
|
1740
|
-
}
|
|
1741
|
-
|
|
1742
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/errors/cursor.js
|
|
1743
|
-
var NegativeOffsetError = class extends BaseError {
|
|
1744
|
-
constructor({ offset }) {
|
|
1745
|
-
super(`Offset \`${offset}\` cannot be negative.`, {
|
|
1746
|
-
name: "NegativeOffsetError"
|
|
1747
|
-
});
|
|
1748
|
-
}
|
|
1749
|
-
};
|
|
1750
|
-
var PositionOutOfBoundsError = class extends BaseError {
|
|
1751
|
-
constructor({ length, position }) {
|
|
1752
|
-
super(`Position \`${position}\` is out of bounds (\`0 < position < ${length}\`).`, { name: "PositionOutOfBoundsError" });
|
|
1753
|
-
}
|
|
1754
|
-
};
|
|
1755
|
-
var RecursiveReadLimitExceededError = class extends BaseError {
|
|
1756
|
-
constructor({ count, limit }) {
|
|
1757
|
-
super(`Recursive read limit of \`${limit}\` exceeded (recursive read count: \`${count}\`).`, { name: "RecursiveReadLimitExceededError" });
|
|
1758
|
-
}
|
|
1759
|
-
};
|
|
1760
|
-
|
|
1761
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/cursor.js
|
|
1762
|
-
var staticCursor = {
|
|
1763
|
-
bytes: new Uint8Array(),
|
|
1764
|
-
dataView: new DataView(new ArrayBuffer(0)),
|
|
1765
|
-
position: 0,
|
|
1766
|
-
positionReadCount: /* @__PURE__ */ new Map(),
|
|
1767
|
-
recursiveReadCount: 0,
|
|
1768
|
-
recursiveReadLimit: Number.POSITIVE_INFINITY,
|
|
1769
|
-
assertReadLimit() {
|
|
1770
|
-
if (this.recursiveReadCount >= this.recursiveReadLimit)
|
|
1771
|
-
throw new RecursiveReadLimitExceededError({
|
|
1772
|
-
count: this.recursiveReadCount + 1,
|
|
1773
|
-
limit: this.recursiveReadLimit
|
|
1774
|
-
});
|
|
1775
|
-
},
|
|
1776
|
-
assertPosition(position) {
|
|
1777
|
-
if (position < 0 || position > this.bytes.length - 1)
|
|
1778
|
-
throw new PositionOutOfBoundsError({
|
|
1779
|
-
length: this.bytes.length,
|
|
1780
|
-
position
|
|
1781
|
-
});
|
|
1782
|
-
},
|
|
1783
|
-
decrementPosition(offset) {
|
|
1784
|
-
if (offset < 0)
|
|
1785
|
-
throw new NegativeOffsetError({ offset });
|
|
1786
|
-
const position = this.position - offset;
|
|
1787
|
-
this.assertPosition(position);
|
|
1788
|
-
this.position = position;
|
|
1789
|
-
},
|
|
1790
|
-
getReadCount(position) {
|
|
1791
|
-
return this.positionReadCount.get(position || this.position) || 0;
|
|
1792
|
-
},
|
|
1793
|
-
incrementPosition(offset) {
|
|
1794
|
-
if (offset < 0)
|
|
1795
|
-
throw new NegativeOffsetError({ offset });
|
|
1796
|
-
const position = this.position + offset;
|
|
1797
|
-
this.assertPosition(position);
|
|
1798
|
-
this.position = position;
|
|
1799
|
-
},
|
|
1800
|
-
inspectByte(position_) {
|
|
1801
|
-
const position = position_ ?? this.position;
|
|
1802
|
-
this.assertPosition(position);
|
|
1803
|
-
return this.bytes[position];
|
|
1804
|
-
},
|
|
1805
|
-
inspectBytes(length, position_) {
|
|
1806
|
-
const position = position_ ?? this.position;
|
|
1807
|
-
this.assertPosition(position + length - 1);
|
|
1808
|
-
return this.bytes.subarray(position, position + length);
|
|
1809
|
-
},
|
|
1810
|
-
inspectUint8(position_) {
|
|
1811
|
-
const position = position_ ?? this.position;
|
|
1812
|
-
this.assertPosition(position);
|
|
1813
|
-
return this.bytes[position];
|
|
1814
|
-
},
|
|
1815
|
-
inspectUint16(position_) {
|
|
1816
|
-
const position = position_ ?? this.position;
|
|
1817
|
-
this.assertPosition(position + 1);
|
|
1818
|
-
return this.dataView.getUint16(position);
|
|
1819
|
-
},
|
|
1820
|
-
inspectUint24(position_) {
|
|
1821
|
-
const position = position_ ?? this.position;
|
|
1822
|
-
this.assertPosition(position + 2);
|
|
1823
|
-
return (this.dataView.getUint16(position) << 8) + this.dataView.getUint8(position + 2);
|
|
1824
|
-
},
|
|
1825
|
-
inspectUint32(position_) {
|
|
1826
|
-
const position = position_ ?? this.position;
|
|
1827
|
-
this.assertPosition(position + 3);
|
|
1828
|
-
return this.dataView.getUint32(position);
|
|
1829
|
-
},
|
|
1830
|
-
pushByte(byte) {
|
|
1831
|
-
this.assertPosition(this.position);
|
|
1832
|
-
this.bytes[this.position] = byte;
|
|
1833
|
-
this.position++;
|
|
1834
|
-
},
|
|
1835
|
-
pushBytes(bytes) {
|
|
1836
|
-
this.assertPosition(this.position + bytes.length - 1);
|
|
1837
|
-
this.bytes.set(bytes, this.position);
|
|
1838
|
-
this.position += bytes.length;
|
|
1839
|
-
},
|
|
1840
|
-
pushUint8(value) {
|
|
1841
|
-
this.assertPosition(this.position);
|
|
1842
|
-
this.bytes[this.position] = value;
|
|
1843
|
-
this.position++;
|
|
1844
|
-
},
|
|
1845
|
-
pushUint16(value) {
|
|
1846
|
-
this.assertPosition(this.position + 1);
|
|
1847
|
-
this.dataView.setUint16(this.position, value);
|
|
1848
|
-
this.position += 2;
|
|
1849
|
-
},
|
|
1850
|
-
pushUint24(value) {
|
|
1851
|
-
this.assertPosition(this.position + 2);
|
|
1852
|
-
this.dataView.setUint16(this.position, value >> 8);
|
|
1853
|
-
this.dataView.setUint8(this.position + 2, value & ~4294967040);
|
|
1854
|
-
this.position += 3;
|
|
1855
|
-
},
|
|
1856
|
-
pushUint32(value) {
|
|
1857
|
-
this.assertPosition(this.position + 3);
|
|
1858
|
-
this.dataView.setUint32(this.position, value);
|
|
1859
|
-
this.position += 4;
|
|
1860
|
-
},
|
|
1861
|
-
readByte() {
|
|
1862
|
-
this.assertReadLimit();
|
|
1863
|
-
this._touch();
|
|
1864
|
-
const value = this.inspectByte();
|
|
1865
|
-
this.position++;
|
|
1866
|
-
return value;
|
|
1867
|
-
},
|
|
1868
|
-
readBytes(length, size4) {
|
|
1869
|
-
this.assertReadLimit();
|
|
1870
|
-
this._touch();
|
|
1871
|
-
const value = this.inspectBytes(length);
|
|
1872
|
-
this.position += size4 ?? length;
|
|
1873
|
-
return value;
|
|
1874
|
-
},
|
|
1875
|
-
readUint8() {
|
|
1876
|
-
this.assertReadLimit();
|
|
1877
|
-
this._touch();
|
|
1878
|
-
const value = this.inspectUint8();
|
|
1879
|
-
this.position += 1;
|
|
1880
|
-
return value;
|
|
1881
|
-
},
|
|
1882
|
-
readUint16() {
|
|
1883
|
-
this.assertReadLimit();
|
|
1884
|
-
this._touch();
|
|
1885
|
-
const value = this.inspectUint16();
|
|
1886
|
-
this.position += 2;
|
|
1887
|
-
return value;
|
|
1888
|
-
},
|
|
1889
|
-
readUint24() {
|
|
1890
|
-
this.assertReadLimit();
|
|
1891
|
-
this._touch();
|
|
1892
|
-
const value = this.inspectUint24();
|
|
1893
|
-
this.position += 3;
|
|
1894
|
-
return value;
|
|
1895
|
-
},
|
|
1896
|
-
readUint32() {
|
|
1897
|
-
this.assertReadLimit();
|
|
1898
|
-
this._touch();
|
|
1899
|
-
const value = this.inspectUint32();
|
|
1900
|
-
this.position += 4;
|
|
1901
|
-
return value;
|
|
1902
|
-
},
|
|
1903
|
-
get remaining() {
|
|
1904
|
-
return this.bytes.length - this.position;
|
|
1905
|
-
},
|
|
1906
|
-
setPosition(position) {
|
|
1907
|
-
const oldPosition = this.position;
|
|
1908
|
-
this.assertPosition(position);
|
|
1909
|
-
this.position = position;
|
|
1910
|
-
return () => this.position = oldPosition;
|
|
1911
|
-
},
|
|
1912
|
-
_touch() {
|
|
1913
|
-
if (this.recursiveReadLimit === Number.POSITIVE_INFINITY)
|
|
1914
|
-
return;
|
|
1915
|
-
const count = this.getReadCount();
|
|
1916
|
-
this.positionReadCount.set(this.position, count + 1);
|
|
1917
|
-
if (count > 0)
|
|
1918
|
-
this.recursiveReadCount++;
|
|
1919
|
-
}
|
|
1920
|
-
};
|
|
1921
|
-
function createCursor(bytes, { recursiveReadLimit = 8192 } = {}) {
|
|
1922
|
-
const cursor = Object.create(staticCursor);
|
|
1923
|
-
cursor.bytes = bytes;
|
|
1924
|
-
cursor.dataView = new DataView(bytes.buffer ?? bytes, bytes.byteOffset, bytes.byteLength);
|
|
1925
|
-
cursor.positionReadCount = /* @__PURE__ */ new Map();
|
|
1926
|
-
cursor.recursiveReadLimit = recursiveReadLimit;
|
|
1927
|
-
return cursor;
|
|
1928
|
-
}
|
|
1929
|
-
|
|
1930
|
-
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/accounts/utils/parseAccount.js
|
|
1931
|
-
function parseAccount(account) {
|
|
1932
|
-
if (typeof account === "string")
|
|
1933
|
-
return { address: account, type: "json-rpc" };
|
|
1934
|
-
return account;
|
|
1935
|
-
}
|
|
1936
|
-
|
|
1937
|
-
// node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.4.3/node_modules/ox/_esm/core/version.js
|
|
1938
|
-
var version2 = "0.1.1";
|
|
1939
|
-
|
|
1940
|
-
// node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.4.3/node_modules/ox/_esm/core/internal/errors.js
|
|
1941
|
-
function getVersion() {
|
|
1942
|
-
return version2;
|
|
1943
|
-
}
|
|
1944
|
-
|
|
1945
|
-
// node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.4.3/node_modules/ox/_esm/core/Errors.js
|
|
1946
|
-
var BaseError2 = class _BaseError extends Error {
|
|
1947
|
-
static setStaticOptions(options) {
|
|
1948
|
-
_BaseError.prototype.docsOrigin = options.docsOrigin;
|
|
1949
|
-
_BaseError.prototype.showVersion = options.showVersion;
|
|
1950
|
-
_BaseError.prototype.version = options.version;
|
|
1951
|
-
}
|
|
1952
|
-
constructor(shortMessage, options = {}) {
|
|
1953
|
-
const details = (() => {
|
|
1954
|
-
if (options.cause instanceof _BaseError) {
|
|
1955
|
-
if (options.cause.details)
|
|
1956
|
-
return options.cause.details;
|
|
1957
|
-
if (options.cause.shortMessage)
|
|
1958
|
-
return options.cause.shortMessage;
|
|
1959
|
-
}
|
|
1960
|
-
if (options.cause && "details" in options.cause && typeof options.cause.details === "string")
|
|
1961
|
-
return options.cause.details;
|
|
1962
|
-
if (options.cause?.message)
|
|
1963
|
-
return options.cause.message;
|
|
1964
|
-
return options.details;
|
|
1965
|
-
})();
|
|
1966
|
-
const docsPath = (() => {
|
|
1967
|
-
if (options.cause instanceof _BaseError)
|
|
1968
|
-
return options.cause.docsPath || options.docsPath;
|
|
1969
|
-
return options.docsPath;
|
|
1970
|
-
})();
|
|
1971
|
-
const docsBaseUrl = options.docsOrigin ?? _BaseError.prototype.docsOrigin;
|
|
1972
|
-
const docs = `${docsBaseUrl}${docsPath ?? ""}`;
|
|
1973
|
-
const showVersion = Boolean(options.version ?? _BaseError.prototype.showVersion);
|
|
1974
|
-
const version3 = options.version ?? _BaseError.prototype.version;
|
|
1975
|
-
const message = [
|
|
1976
|
-
shortMessage || "An error occurred.",
|
|
1977
|
-
...options.metaMessages ? ["", ...options.metaMessages] : [],
|
|
1978
|
-
...details || docsPath || showVersion ? [
|
|
1979
|
-
"",
|
|
1980
|
-
details ? `Details: ${details}` : void 0,
|
|
1981
|
-
docsPath ? `See: ${docs}` : void 0,
|
|
1982
|
-
showVersion ? `Version: ${version3}` : void 0
|
|
1983
|
-
] : []
|
|
1984
|
-
].filter((x) => typeof x === "string").join("\n");
|
|
1985
|
-
super(message, options.cause ? { cause: options.cause } : void 0);
|
|
1986
|
-
Object.defineProperty(this, "details", {
|
|
1987
|
-
enumerable: true,
|
|
1988
|
-
configurable: true,
|
|
1989
|
-
writable: true,
|
|
1990
|
-
value: void 0
|
|
1991
|
-
});
|
|
1992
|
-
Object.defineProperty(this, "docs", {
|
|
1993
|
-
enumerable: true,
|
|
1994
|
-
configurable: true,
|
|
1995
|
-
writable: true,
|
|
1996
|
-
value: void 0
|
|
1997
|
-
});
|
|
1998
|
-
Object.defineProperty(this, "docsOrigin", {
|
|
1999
|
-
enumerable: true,
|
|
2000
|
-
configurable: true,
|
|
2001
|
-
writable: true,
|
|
2002
|
-
value: void 0
|
|
2003
|
-
});
|
|
2004
|
-
Object.defineProperty(this, "docsPath", {
|
|
2005
|
-
enumerable: true,
|
|
2006
|
-
configurable: true,
|
|
2007
|
-
writable: true,
|
|
2008
|
-
value: void 0
|
|
2009
|
-
});
|
|
2010
|
-
Object.defineProperty(this, "shortMessage", {
|
|
2011
|
-
enumerable: true,
|
|
2012
|
-
configurable: true,
|
|
2013
|
-
writable: true,
|
|
2014
|
-
value: void 0
|
|
2015
|
-
});
|
|
2016
|
-
Object.defineProperty(this, "showVersion", {
|
|
2017
|
-
enumerable: true,
|
|
2018
|
-
configurable: true,
|
|
2019
|
-
writable: true,
|
|
2020
|
-
value: void 0
|
|
2021
|
-
});
|
|
2022
|
-
Object.defineProperty(this, "version", {
|
|
2023
|
-
enumerable: true,
|
|
2024
|
-
configurable: true,
|
|
2025
|
-
writable: true,
|
|
2026
|
-
value: void 0
|
|
2027
|
-
});
|
|
2028
|
-
Object.defineProperty(this, "cause", {
|
|
2029
|
-
enumerable: true,
|
|
2030
|
-
configurable: true,
|
|
2031
|
-
writable: true,
|
|
2032
|
-
value: void 0
|
|
2033
|
-
});
|
|
2034
|
-
Object.defineProperty(this, "name", {
|
|
2035
|
-
enumerable: true,
|
|
2036
|
-
configurable: true,
|
|
2037
|
-
writable: true,
|
|
2038
|
-
value: "BaseError"
|
|
2039
|
-
});
|
|
2040
|
-
this.cause = options.cause;
|
|
2041
|
-
this.details = details;
|
|
2042
|
-
this.docs = docs;
|
|
2043
|
-
this.docsOrigin = docsBaseUrl;
|
|
2044
|
-
this.docsPath = docsPath;
|
|
2045
|
-
this.shortMessage = shortMessage;
|
|
2046
|
-
this.showVersion = showVersion;
|
|
2047
|
-
this.version = version3;
|
|
2048
|
-
}
|
|
2049
|
-
walk(fn) {
|
|
2050
|
-
return walk2(this, fn);
|
|
2051
|
-
}
|
|
2052
|
-
};
|
|
2053
|
-
Object.defineProperty(BaseError2, "defaultStaticOptions", {
|
|
2054
|
-
enumerable: true,
|
|
2055
|
-
configurable: true,
|
|
2056
|
-
writable: true,
|
|
2057
|
-
value: {
|
|
2058
|
-
docsOrigin: "https://oxlib.sh",
|
|
2059
|
-
showVersion: false,
|
|
2060
|
-
version: `ox@${getVersion()}`
|
|
2061
|
-
}
|
|
2062
|
-
});
|
|
2063
|
-
(() => {
|
|
2064
|
-
BaseError2.setStaticOptions(BaseError2.defaultStaticOptions);
|
|
2065
|
-
})();
|
|
2066
|
-
function walk2(err, fn) {
|
|
2067
|
-
if (fn?.(err))
|
|
2068
|
-
return err;
|
|
2069
|
-
if (err && typeof err === "object" && "cause" in err && err.cause)
|
|
2070
|
-
return walk2(err.cause, fn);
|
|
2071
|
-
return fn ? null : err;
|
|
2072
|
-
}
|
|
2073
|
-
|
|
2074
|
-
// node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.4.3/node_modules/ox/_esm/core/internal/bytes.js
|
|
2075
|
-
function assertSize2(bytes, size_) {
|
|
2076
|
-
if (size2(bytes) > size_)
|
|
2077
|
-
throw new SizeOverflowError2({
|
|
2078
|
-
givenSize: size2(bytes),
|
|
2079
|
-
maxSize: size_
|
|
2080
|
-
});
|
|
2081
|
-
}
|
|
2082
|
-
function assertStartOffset2(value, start) {
|
|
2083
|
-
if (typeof start === "number" && start > 0 && start > size2(value) - 1)
|
|
2084
|
-
throw new SliceOffsetOutOfBoundsError2({
|
|
2085
|
-
offset: start,
|
|
2086
|
-
position: "start",
|
|
2087
|
-
size: size2(value)
|
|
2088
|
-
});
|
|
2089
|
-
}
|
|
2090
|
-
function assertEndOffset2(value, start, end) {
|
|
2091
|
-
if (typeof start === "number" && typeof end === "number" && size2(value) !== end - start) {
|
|
2092
|
-
throw new SliceOffsetOutOfBoundsError2({
|
|
2093
|
-
offset: end,
|
|
2094
|
-
position: "end",
|
|
2095
|
-
size: size2(value)
|
|
2096
|
-
});
|
|
2097
|
-
}
|
|
2098
|
-
}
|
|
2099
|
-
var charCodeMap2 = {
|
|
2100
|
-
zero: 48,
|
|
2101
|
-
nine: 57,
|
|
2102
|
-
A: 65,
|
|
2103
|
-
F: 70,
|
|
2104
|
-
a: 97,
|
|
2105
|
-
f: 102
|
|
2106
|
-
};
|
|
2107
|
-
function charCodeToBase162(char) {
|
|
2108
|
-
if (char >= charCodeMap2.zero && char <= charCodeMap2.nine)
|
|
2109
|
-
return char - charCodeMap2.zero;
|
|
2110
|
-
if (char >= charCodeMap2.A && char <= charCodeMap2.F)
|
|
2111
|
-
return char - (charCodeMap2.A - 10);
|
|
2112
|
-
if (char >= charCodeMap2.a && char <= charCodeMap2.f)
|
|
2113
|
-
return char - (charCodeMap2.a - 10);
|
|
2114
|
-
return void 0;
|
|
2115
|
-
}
|
|
2116
|
-
function pad2(bytes, options = {}) {
|
|
2117
|
-
const { dir, size: size4 = 32 } = options;
|
|
2118
|
-
if (size4 === 0)
|
|
2119
|
-
return bytes;
|
|
2120
|
-
if (bytes.length > size4)
|
|
2121
|
-
throw new SizeExceedsPaddingSizeError2({
|
|
2122
|
-
size: bytes.length,
|
|
2123
|
-
targetSize: size4,
|
|
2124
|
-
type: "Bytes"
|
|
2125
|
-
});
|
|
2126
|
-
const paddedBytes = new Uint8Array(size4);
|
|
2127
|
-
for (let i = 0; i < size4; i++) {
|
|
2128
|
-
const padEnd = dir === "right";
|
|
2129
|
-
paddedBytes[padEnd ? i : size4 - i - 1] = bytes[padEnd ? i : bytes.length - i - 1];
|
|
2130
|
-
}
|
|
2131
|
-
return paddedBytes;
|
|
2132
|
-
}
|
|
2133
|
-
function trim2(value, options = {}) {
|
|
2134
|
-
const { dir = "left" } = options;
|
|
2135
|
-
let data = value;
|
|
2136
|
-
let sliceLength = 0;
|
|
2137
|
-
for (let i = 0; i < data.length - 1; i++) {
|
|
2138
|
-
if (data[dir === "left" ? i : data.length - i - 1].toString() === "0")
|
|
2139
|
-
sliceLength++;
|
|
2140
|
-
else
|
|
2141
|
-
break;
|
|
2142
|
-
}
|
|
2143
|
-
data = dir === "left" ? data.slice(sliceLength) : data.slice(0, data.length - sliceLength);
|
|
2144
|
-
return data;
|
|
2145
|
-
}
|
|
2146
|
-
|
|
2147
|
-
// node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.4.3/node_modules/ox/_esm/core/internal/hex.js
|
|
2148
|
-
function assertSize3(hex, size_) {
|
|
2149
|
-
if (size3(hex) > size_)
|
|
2150
|
-
throw new SizeOverflowError3({
|
|
2151
|
-
givenSize: size3(hex),
|
|
2152
|
-
maxSize: size_
|
|
2153
|
-
});
|
|
2154
|
-
}
|
|
2155
|
-
function assertStartOffset3(value, start) {
|
|
2156
|
-
if (typeof start === "number" && start > 0 && start > size3(value) - 1)
|
|
2157
|
-
throw new SliceOffsetOutOfBoundsError3({
|
|
2158
|
-
offset: start,
|
|
2159
|
-
position: "start",
|
|
2160
|
-
size: size3(value)
|
|
2161
|
-
});
|
|
2162
|
-
}
|
|
2163
|
-
function assertEndOffset3(value, start, end) {
|
|
2164
|
-
if (typeof start === "number" && typeof end === "number" && size3(value) !== end - start) {
|
|
2165
|
-
throw new SliceOffsetOutOfBoundsError3({
|
|
2166
|
-
offset: end,
|
|
2167
|
-
position: "end",
|
|
2168
|
-
size: size3(value)
|
|
2169
|
-
});
|
|
2170
|
-
}
|
|
2171
|
-
}
|
|
2172
|
-
function pad3(hex_, options = {}) {
|
|
2173
|
-
const { dir, size: size4 = 32 } = options;
|
|
2174
|
-
if (size4 === 0)
|
|
2175
|
-
return hex_;
|
|
2176
|
-
const hex = hex_.replace("0x", "");
|
|
2177
|
-
if (hex.length > size4 * 2)
|
|
2178
|
-
throw new SizeExceedsPaddingSizeError3({
|
|
2179
|
-
size: Math.ceil(hex.length / 2),
|
|
2180
|
-
targetSize: size4,
|
|
2181
|
-
type: "Hex"
|
|
2182
|
-
});
|
|
2183
|
-
return `0x${hex[dir === "right" ? "padEnd" : "padStart"](size4 * 2, "0")}`;
|
|
2184
|
-
}
|
|
2185
|
-
function trim3(value, options = {}) {
|
|
2186
|
-
const { dir = "left" } = options;
|
|
2187
|
-
let data = value.replace("0x", "");
|
|
2188
|
-
let sliceLength = 0;
|
|
2189
|
-
for (let i = 0; i < data.length - 1; i++) {
|
|
2190
|
-
if (data[dir === "left" ? i : data.length - i - 1].toString() === "0")
|
|
2191
|
-
sliceLength++;
|
|
2192
|
-
else
|
|
2193
|
-
break;
|
|
2194
|
-
}
|
|
2195
|
-
data = dir === "left" ? data.slice(sliceLength) : data.slice(0, data.length - sliceLength);
|
|
2196
|
-
if (data === "0")
|
|
2197
|
-
return "0x";
|
|
2198
|
-
if (dir === "right" && data.length % 2 === 1)
|
|
2199
|
-
return `0x${data}0`;
|
|
2200
|
-
return `0x${data}`;
|
|
2201
|
-
}
|
|
2202
|
-
|
|
2203
|
-
// node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.4.3/node_modules/ox/_esm/core/Json.js
|
|
2204
|
-
var bigIntSuffix = "#__bigint";
|
|
2205
|
-
function stringify2(value, replacer, space) {
|
|
2206
|
-
return JSON.stringify(value, (key, value2) => {
|
|
2207
|
-
if (typeof replacer === "function")
|
|
2208
|
-
return replacer(key, value2);
|
|
2209
|
-
if (typeof value2 === "bigint")
|
|
2210
|
-
return value2.toString() + bigIntSuffix;
|
|
2211
|
-
return value2;
|
|
2212
|
-
}, space);
|
|
2213
|
-
}
|
|
2214
|
-
|
|
2215
|
-
// node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.4.3/node_modules/ox/_esm/core/Bytes.js
|
|
2216
|
-
var decoder = /* @__PURE__ */ new TextDecoder();
|
|
2217
|
-
var encoder3 = /* @__PURE__ */ new TextEncoder();
|
|
2218
|
-
function assert(value) {
|
|
2219
|
-
if (value instanceof Uint8Array)
|
|
2220
|
-
return;
|
|
2221
|
-
if (!value)
|
|
2222
|
-
throw new InvalidBytesTypeError(value);
|
|
2223
|
-
if (typeof value !== "object")
|
|
2224
|
-
throw new InvalidBytesTypeError(value);
|
|
2225
|
-
if (!("BYTES_PER_ELEMENT" in value))
|
|
2226
|
-
throw new InvalidBytesTypeError(value);
|
|
2227
|
-
if (value.BYTES_PER_ELEMENT !== 1 || value.constructor.name !== "Uint8Array")
|
|
2228
|
-
throw new InvalidBytesTypeError(value);
|
|
2229
|
-
}
|
|
2230
|
-
function concat2(...values) {
|
|
2231
|
-
let length = 0;
|
|
2232
|
-
for (const arr of values) {
|
|
2233
|
-
length += arr.length;
|
|
2234
|
-
}
|
|
2235
|
-
const result = new Uint8Array(length);
|
|
2236
|
-
for (let i = 0, index = 0; i < values.length; i++) {
|
|
2237
|
-
const arr = values[i];
|
|
2238
|
-
result.set(arr, index);
|
|
2239
|
-
index += arr.length;
|
|
2240
|
-
}
|
|
2241
|
-
return result;
|
|
2242
|
-
}
|
|
2243
|
-
function from(value) {
|
|
2244
|
-
if (value instanceof Uint8Array)
|
|
2245
|
-
return value;
|
|
2246
|
-
if (typeof value === "string")
|
|
2247
|
-
return fromHex2(value);
|
|
2248
|
-
return fromArray(value);
|
|
2249
|
-
}
|
|
2250
|
-
function fromArray(value) {
|
|
2251
|
-
return value instanceof Uint8Array ? value : new Uint8Array(value);
|
|
2252
|
-
}
|
|
2253
|
-
function fromHex2(value, options = {}) {
|
|
2254
|
-
const { size: size4 } = options;
|
|
2255
|
-
let hex = value;
|
|
2256
|
-
if (size4) {
|
|
2257
|
-
assertSize3(value, size4);
|
|
2258
|
-
hex = padRight(value, size4);
|
|
2259
|
-
}
|
|
2260
|
-
let hexString = hex.slice(2);
|
|
2261
|
-
if (hexString.length % 2)
|
|
2262
|
-
hexString = `0${hexString}`;
|
|
2263
|
-
const length = hexString.length / 2;
|
|
2264
|
-
const bytes = new Uint8Array(length);
|
|
2265
|
-
for (let index = 0, j = 0; index < length; index++) {
|
|
2266
|
-
const nibbleLeft = charCodeToBase162(hexString.charCodeAt(j++));
|
|
2267
|
-
const nibbleRight = charCodeToBase162(hexString.charCodeAt(j++));
|
|
2268
|
-
if (nibbleLeft === void 0 || nibbleRight === void 0) {
|
|
2269
|
-
throw new BaseError2(`Invalid byte sequence ("${hexString[j - 2]}${hexString[j - 1]}" in "${hexString}").`);
|
|
2270
|
-
}
|
|
2271
|
-
bytes[index] = nibbleLeft << 4 | nibbleRight;
|
|
2272
|
-
}
|
|
2273
|
-
return bytes;
|
|
2274
|
-
}
|
|
2275
|
-
function fromString(value, options = {}) {
|
|
2276
|
-
const { size: size4 } = options;
|
|
2277
|
-
const bytes = encoder3.encode(value);
|
|
2278
|
-
if (typeof size4 === "number") {
|
|
2279
|
-
assertSize2(bytes, size4);
|
|
2280
|
-
return padRight2(bytes, size4);
|
|
2281
|
-
}
|
|
2282
|
-
return bytes;
|
|
2283
|
-
}
|
|
2284
|
-
function isEqual(bytesA, bytesB) {
|
|
2285
|
-
return equalBytes(bytesA, bytesB);
|
|
2286
|
-
}
|
|
2287
|
-
function padRight2(value, size4) {
|
|
2288
|
-
return pad2(value, { dir: "right", size: size4 });
|
|
2289
|
-
}
|
|
2290
|
-
function random(length) {
|
|
2291
|
-
return crypto.getRandomValues(new Uint8Array(length));
|
|
2292
|
-
}
|
|
2293
|
-
function size2(value) {
|
|
2294
|
-
return value.length;
|
|
2295
|
-
}
|
|
2296
|
-
function slice2(value, start, end, options = {}) {
|
|
2297
|
-
const { strict } = options;
|
|
2298
|
-
assertStartOffset2(value, start);
|
|
2299
|
-
const value_ = value.slice(start, end);
|
|
2300
|
-
if (strict)
|
|
2301
|
-
assertEndOffset2(value_, start, end);
|
|
2302
|
-
return value_;
|
|
2303
|
-
}
|
|
2304
|
-
function toBigInt2(bytes, options = {}) {
|
|
2305
|
-
const { size: size4 } = options;
|
|
2306
|
-
if (typeof size4 !== "undefined")
|
|
2307
|
-
assertSize2(bytes, size4);
|
|
2308
|
-
const hex = fromBytes(bytes, options);
|
|
2309
|
-
return toBigInt(hex, options);
|
|
2310
|
-
}
|
|
2311
|
-
function toBoolean(bytes, options = {}) {
|
|
2312
|
-
const { size: size4 } = options;
|
|
2313
|
-
let bytes_ = bytes;
|
|
2314
|
-
if (typeof size4 !== "undefined") {
|
|
2315
|
-
assertSize2(bytes_, size4);
|
|
2316
|
-
bytes_ = trimLeft(bytes_);
|
|
2317
|
-
}
|
|
2318
|
-
if (bytes_.length > 1 || bytes_[0] > 1)
|
|
2319
|
-
throw new InvalidBytesBooleanError2(bytes_);
|
|
2320
|
-
return Boolean(bytes_[0]);
|
|
2321
|
-
}
|
|
2322
|
-
function toHex2(value, options = {}) {
|
|
2323
|
-
return fromBytes(value, options);
|
|
2324
|
-
}
|
|
2325
|
-
function toNumber2(bytes, options = {}) {
|
|
2326
|
-
const { size: size4 } = options;
|
|
2327
|
-
if (typeof size4 !== "undefined")
|
|
2328
|
-
assertSize2(bytes, size4);
|
|
2329
|
-
const hex = fromBytes(bytes, options);
|
|
2330
|
-
return toNumber(hex, options);
|
|
2331
|
-
}
|
|
2332
|
-
function toString(bytes, options = {}) {
|
|
2333
|
-
const { size: size4 } = options;
|
|
2334
|
-
let bytes_ = bytes;
|
|
2335
|
-
if (typeof size4 !== "undefined") {
|
|
2336
|
-
assertSize2(bytes_, size4);
|
|
2337
|
-
bytes_ = trimRight(bytes_);
|
|
2338
|
-
}
|
|
2339
|
-
return decoder.decode(bytes_);
|
|
2340
|
-
}
|
|
2341
|
-
function trimLeft(value) {
|
|
2342
|
-
return trim2(value, { dir: "left" });
|
|
2343
|
-
}
|
|
2344
|
-
function trimRight(value) {
|
|
2345
|
-
return trim2(value, { dir: "right" });
|
|
2346
|
-
}
|
|
2347
|
-
function validate(value) {
|
|
2348
|
-
try {
|
|
2349
|
-
assert(value);
|
|
2350
|
-
return true;
|
|
2351
|
-
} catch {
|
|
2352
|
-
return false;
|
|
2353
|
-
}
|
|
2354
|
-
}
|
|
2355
|
-
var InvalidBytesBooleanError2 = class extends BaseError2 {
|
|
2356
|
-
constructor(bytes) {
|
|
2357
|
-
super(`Bytes value \`${bytes}\` is not a valid boolean.`, {
|
|
2358
|
-
metaMessages: [
|
|
2359
|
-
"The bytes array must contain a single byte of either a `0` or `1` value."
|
|
2360
|
-
]
|
|
2361
|
-
});
|
|
2362
|
-
Object.defineProperty(this, "name", {
|
|
2363
|
-
enumerable: true,
|
|
2364
|
-
configurable: true,
|
|
2365
|
-
writable: true,
|
|
2366
|
-
value: "Bytes.InvalidBytesBooleanError"
|
|
2367
|
-
});
|
|
2368
|
-
}
|
|
2369
|
-
};
|
|
2370
|
-
var InvalidBytesTypeError = class extends BaseError2 {
|
|
2371
|
-
constructor(value) {
|
|
2372
|
-
super(`Value \`${typeof value === "object" ? stringify2(value) : value}\` of type \`${typeof value}\` is an invalid Bytes value.`, {
|
|
2373
|
-
metaMessages: ["Bytes values must be of type `Bytes`."]
|
|
2374
|
-
});
|
|
2375
|
-
Object.defineProperty(this, "name", {
|
|
2376
|
-
enumerable: true,
|
|
2377
|
-
configurable: true,
|
|
2378
|
-
writable: true,
|
|
2379
|
-
value: "Bytes.InvalidBytesTypeError"
|
|
2380
|
-
});
|
|
2381
|
-
}
|
|
2382
|
-
};
|
|
2383
|
-
var SizeOverflowError2 = class extends BaseError2 {
|
|
2384
|
-
constructor({ givenSize, maxSize }) {
|
|
2385
|
-
super(`Size cannot exceed \`${maxSize}\` bytes. Given size: \`${givenSize}\` bytes.`);
|
|
2386
|
-
Object.defineProperty(this, "name", {
|
|
2387
|
-
enumerable: true,
|
|
2388
|
-
configurable: true,
|
|
2389
|
-
writable: true,
|
|
2390
|
-
value: "Bytes.SizeOverflowError"
|
|
2391
|
-
});
|
|
2392
|
-
}
|
|
2393
|
-
};
|
|
2394
|
-
var SliceOffsetOutOfBoundsError2 = class extends BaseError2 {
|
|
2395
|
-
constructor({ offset, position, size: size4 }) {
|
|
2396
|
-
super(`Slice ${position === "start" ? "starting" : "ending"} at offset \`${offset}\` is out-of-bounds (size: \`${size4}\`).`);
|
|
2397
|
-
Object.defineProperty(this, "name", {
|
|
2398
|
-
enumerable: true,
|
|
2399
|
-
configurable: true,
|
|
2400
|
-
writable: true,
|
|
2401
|
-
value: "Bytes.SliceOffsetOutOfBoundsError"
|
|
2402
|
-
});
|
|
2403
|
-
}
|
|
2404
|
-
};
|
|
2405
|
-
var SizeExceedsPaddingSizeError2 = class extends BaseError2 {
|
|
2406
|
-
constructor({ size: size4, targetSize, type }) {
|
|
2407
|
-
super(`${type.charAt(0).toUpperCase()}${type.slice(1).toLowerCase()} size (\`${size4}\`) exceeds padding size (\`${targetSize}\`).`);
|
|
2408
|
-
Object.defineProperty(this, "name", {
|
|
2409
|
-
enumerable: true,
|
|
2410
|
-
configurable: true,
|
|
2411
|
-
writable: true,
|
|
2412
|
-
value: "Bytes.SizeExceedsPaddingSizeError"
|
|
2413
|
-
});
|
|
2414
|
-
}
|
|
2415
|
-
};
|
|
2416
|
-
|
|
2417
|
-
// node_modules/.pnpm/ox@0.14.30_typescript@6.0.3_zod@4.4.3/node_modules/ox/_esm/core/Hex.js
|
|
2418
|
-
var encoder4 = /* @__PURE__ */ new TextEncoder();
|
|
2419
|
-
var hexes2 = /* @__PURE__ */ Array.from({ length: 256 }, (_v, i) => i.toString(16).padStart(2, "0"));
|
|
2420
|
-
function assert2(value, options = {}) {
|
|
2421
|
-
const { strict = false } = options;
|
|
2422
|
-
if (!value)
|
|
2423
|
-
throw new InvalidHexTypeError(value);
|
|
2424
|
-
if (typeof value !== "string")
|
|
2425
|
-
throw new InvalidHexTypeError(value);
|
|
2426
|
-
if (strict) {
|
|
2427
|
-
if (!/^0x[0-9a-fA-F]*$/.test(value))
|
|
2428
|
-
throw new InvalidHexValueError2(value);
|
|
2429
|
-
}
|
|
2430
|
-
if (!value.startsWith("0x"))
|
|
2431
|
-
throw new InvalidHexValueError2(value);
|
|
2432
|
-
}
|
|
2433
|
-
function concat3(...values) {
|
|
2434
|
-
return `0x${values.reduce((acc, x) => acc + x.replace("0x", ""), "")}`;
|
|
2435
|
-
}
|
|
2436
|
-
function from2(value) {
|
|
2437
|
-
if (value instanceof Uint8Array)
|
|
2438
|
-
return fromBytes(value);
|
|
2439
|
-
if (Array.isArray(value))
|
|
2440
|
-
return fromBytes(new Uint8Array(value));
|
|
2441
|
-
return value;
|
|
2442
|
-
}
|
|
2443
|
-
function fromBoolean(value, options = {}) {
|
|
2444
|
-
const hex = `0x${Number(value)}`;
|
|
2445
|
-
if (typeof options.size === "number") {
|
|
2446
|
-
assertSize3(hex, options.size);
|
|
2447
|
-
return padLeft(hex, options.size);
|
|
2448
|
-
}
|
|
2449
|
-
return hex;
|
|
2450
|
-
}
|
|
2451
|
-
function fromBytes(value, options = {}) {
|
|
2452
|
-
let string = "";
|
|
2453
|
-
for (let i = 0; i < value.length; i++)
|
|
2454
|
-
string += hexes2[value[i]];
|
|
2455
|
-
const hex = `0x${string}`;
|
|
2456
|
-
if (typeof options.size === "number") {
|
|
2457
|
-
assertSize3(hex, options.size);
|
|
2458
|
-
return padRight(hex, options.size);
|
|
2459
|
-
}
|
|
2460
|
-
return hex;
|
|
2461
|
-
}
|
|
2462
|
-
function fromNumber(value, options = {}) {
|
|
2463
|
-
const { signed, size: size4 } = options;
|
|
2464
|
-
const value_ = BigInt(value);
|
|
2465
|
-
let maxValue;
|
|
2466
|
-
if (size4) {
|
|
2467
|
-
if (signed)
|
|
2468
|
-
maxValue = (1n << BigInt(size4) * 8n - 1n) - 1n;
|
|
2469
|
-
else
|
|
2470
|
-
maxValue = 2n ** (BigInt(size4) * 8n) - 1n;
|
|
2471
|
-
} else if (typeof value === "number") {
|
|
2472
|
-
maxValue = BigInt(Number.MAX_SAFE_INTEGER);
|
|
2473
|
-
}
|
|
2474
|
-
const minValue = typeof maxValue === "bigint" && signed ? -maxValue - 1n : 0;
|
|
2475
|
-
if (maxValue && value_ > maxValue || value_ < minValue) {
|
|
2476
|
-
const suffix = typeof value === "bigint" ? "n" : "";
|
|
2477
|
-
throw new IntegerOutOfRangeError2({
|
|
2478
|
-
max: maxValue ? `${maxValue}${suffix}` : void 0,
|
|
2479
|
-
min: `${minValue}${suffix}`,
|
|
2480
|
-
signed,
|
|
2481
|
-
size: size4,
|
|
2482
|
-
value: `${value}${suffix}`
|
|
2483
|
-
});
|
|
2484
|
-
}
|
|
2485
|
-
const stringValue = (signed && value_ < 0 ? BigInt.asUintN(size4 * 8, BigInt(value_)) : value_).toString(16);
|
|
2486
|
-
const hex = `0x${stringValue}`;
|
|
2487
|
-
if (size4)
|
|
2488
|
-
return padLeft(hex, size4);
|
|
2489
|
-
return hex;
|
|
2490
|
-
}
|
|
2491
|
-
function fromString2(value, options = {}) {
|
|
2492
|
-
return fromBytes(encoder4.encode(value), options);
|
|
2493
|
-
}
|
|
2494
|
-
function padLeft(value, size4) {
|
|
2495
|
-
return pad3(value, { dir: "left", size: size4 });
|
|
2496
|
-
}
|
|
2497
|
-
function padRight(value, size4) {
|
|
2498
|
-
return pad3(value, { dir: "right", size: size4 });
|
|
2499
|
-
}
|
|
2500
|
-
function slice3(value, start, end, options = {}) {
|
|
2501
|
-
const { strict } = options;
|
|
2502
|
-
assertStartOffset3(value, start);
|
|
2503
|
-
const value_ = `0x${value.replace("0x", "").slice((start ?? 0) * 2, (end ?? value.length) * 2)}`;
|
|
2504
|
-
if (strict)
|
|
2505
|
-
assertEndOffset3(value_, start, end);
|
|
2506
|
-
return value_;
|
|
2507
|
-
}
|
|
2508
|
-
function size3(value) {
|
|
2509
|
-
return Math.ceil((value.length - 2) / 2);
|
|
2510
|
-
}
|
|
2511
|
-
function trimLeft2(value) {
|
|
2512
|
-
return trim3(value, { dir: "left" });
|
|
2513
|
-
}
|
|
2514
|
-
function toBigInt(hex, options = {}) {
|
|
2515
|
-
const { signed } = options;
|
|
2516
|
-
if (options.size)
|
|
2517
|
-
assertSize3(hex, options.size);
|
|
2518
|
-
const value = BigInt(hex);
|
|
2519
|
-
if (!signed)
|
|
2520
|
-
return value;
|
|
2521
|
-
const size4 = (hex.length - 2) / 2;
|
|
2522
|
-
const max_unsigned = (1n << BigInt(size4) * 8n) - 1n;
|
|
2523
|
-
const max_signed = max_unsigned >> 1n;
|
|
2524
|
-
if (value <= max_signed)
|
|
2525
|
-
return value;
|
|
2526
|
-
return value - max_unsigned - 1n;
|
|
2527
|
-
}
|
|
2528
|
-
function toNumber(hex, options = {}) {
|
|
2529
|
-
const { signed, size: size4 } = options;
|
|
2530
|
-
if (!signed && !size4)
|
|
2531
|
-
return Number(hex);
|
|
2532
|
-
return Number(toBigInt(hex, options));
|
|
2533
|
-
}
|
|
2534
|
-
function validate2(value, options = {}) {
|
|
2535
|
-
const { strict = false } = options;
|
|
2536
|
-
try {
|
|
2537
|
-
assert2(value, { strict });
|
|
2538
|
-
return true;
|
|
2539
|
-
} catch {
|
|
2540
|
-
return false;
|
|
2541
|
-
}
|
|
2542
|
-
}
|
|
2543
|
-
var IntegerOutOfRangeError2 = class extends BaseError2 {
|
|
2544
|
-
constructor({ max, min, signed, size: size4, value }) {
|
|
2545
|
-
super(`Number \`${value}\` is not in safe${size4 ? ` ${size4 * 8}-bit` : ""}${signed ? " signed" : " unsigned"} integer range ${max ? `(\`${min}\` to \`${max}\`)` : `(above \`${min}\`)`}`);
|
|
2546
|
-
Object.defineProperty(this, "name", {
|
|
2547
|
-
enumerable: true,
|
|
2548
|
-
configurable: true,
|
|
2549
|
-
writable: true,
|
|
2550
|
-
value: "Hex.IntegerOutOfRangeError"
|
|
2551
|
-
});
|
|
2552
|
-
}
|
|
2553
|
-
};
|
|
2554
|
-
var InvalidHexTypeError = class extends BaseError2 {
|
|
2555
|
-
constructor(value) {
|
|
2556
|
-
super(`Value \`${typeof value === "object" ? stringify2(value) : value}\` of type \`${typeof value}\` is an invalid hex type.`, {
|
|
2557
|
-
metaMessages: ['Hex types must be represented as `"0x${string}"`.']
|
|
2558
|
-
});
|
|
2559
|
-
Object.defineProperty(this, "name", {
|
|
2560
|
-
enumerable: true,
|
|
2561
|
-
configurable: true,
|
|
2562
|
-
writable: true,
|
|
2563
|
-
value: "Hex.InvalidHexTypeError"
|
|
2564
|
-
});
|
|
2565
|
-
}
|
|
2566
|
-
};
|
|
2567
|
-
var InvalidHexValueError2 = class extends BaseError2 {
|
|
2568
|
-
constructor(value) {
|
|
2569
|
-
super(`Value \`${value}\` is an invalid hex value.`, {
|
|
2570
|
-
metaMessages: [
|
|
2571
|
-
'Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).'
|
|
2572
|
-
]
|
|
2573
|
-
});
|
|
2574
|
-
Object.defineProperty(this, "name", {
|
|
2575
|
-
enumerable: true,
|
|
2576
|
-
configurable: true,
|
|
2577
|
-
writable: true,
|
|
2578
|
-
value: "Hex.InvalidHexValueError"
|
|
2579
|
-
});
|
|
2580
|
-
}
|
|
2581
|
-
};
|
|
2582
|
-
var SizeOverflowError3 = class extends BaseError2 {
|
|
2583
|
-
constructor({ givenSize, maxSize }) {
|
|
2584
|
-
super(`Size cannot exceed \`${maxSize}\` bytes. Given size: \`${givenSize}\` bytes.`);
|
|
2585
|
-
Object.defineProperty(this, "name", {
|
|
2586
|
-
enumerable: true,
|
|
2587
|
-
configurable: true,
|
|
2588
|
-
writable: true,
|
|
2589
|
-
value: "Hex.SizeOverflowError"
|
|
2590
|
-
});
|
|
2591
|
-
}
|
|
2592
|
-
};
|
|
2593
|
-
var SliceOffsetOutOfBoundsError3 = class extends BaseError2 {
|
|
2594
|
-
constructor({ offset, position, size: size4 }) {
|
|
2595
|
-
super(`Slice ${position === "start" ? "starting" : "ending"} at offset \`${offset}\` is out-of-bounds (size: \`${size4}\`).`);
|
|
2596
|
-
Object.defineProperty(this, "name", {
|
|
2597
|
-
enumerable: true,
|
|
2598
|
-
configurable: true,
|
|
2599
|
-
writable: true,
|
|
2600
|
-
value: "Hex.SliceOffsetOutOfBoundsError"
|
|
2601
|
-
});
|
|
2602
|
-
}
|
|
2603
|
-
};
|
|
2604
|
-
var SizeExceedsPaddingSizeError3 = class extends BaseError2 {
|
|
2605
|
-
constructor({ size: size4, targetSize, type }) {
|
|
2606
|
-
super(`${type.charAt(0).toUpperCase()}${type.slice(1).toLowerCase()} size (\`${size4}\`) exceeds padding size (\`${targetSize}\`).`);
|
|
2607
|
-
Object.defineProperty(this, "name", {
|
|
2608
|
-
enumerable: true,
|
|
2609
|
-
configurable: true,
|
|
2610
|
-
writable: true,
|
|
2611
|
-
value: "Hex.SizeExceedsPaddingSizeError"
|
|
2612
|
-
});
|
|
2613
|
-
}
|
|
2614
|
-
};
|
|
2615
|
-
|
|
2616
|
-
export {
|
|
2617
|
-
setErrorConfig,
|
|
2618
|
-
BaseError,
|
|
2619
|
-
IntegerOutOfRangeError,
|
|
2620
|
-
InvalidBytesBooleanError,
|
|
2621
|
-
InvalidHexBooleanError,
|
|
2622
|
-
InvalidHexValueError,
|
|
2623
|
-
RlpDepthLimitExceededError,
|
|
2624
|
-
RlpListBoundaryExceededError,
|
|
2625
|
-
RlpTrailingBytesError,
|
|
2626
|
-
SizeOverflowError,
|
|
2627
|
-
SliceOffsetOutOfBoundsError,
|
|
2628
|
-
SizeExceedsPaddingSizeError,
|
|
2629
|
-
InvalidBytesLengthError,
|
|
2630
|
-
pad,
|
|
2631
|
-
padHex,
|
|
2632
|
-
padBytes,
|
|
2633
|
-
isHex,
|
|
2634
|
-
size,
|
|
2635
|
-
trim,
|
|
2636
|
-
toBytes,
|
|
2637
|
-
boolToBytes,
|
|
2638
|
-
hexToBytes,
|
|
2639
|
-
numberToBytes,
|
|
2640
|
-
stringToBytes,
|
|
2641
|
-
assertSize,
|
|
2642
|
-
fromHex,
|
|
2643
|
-
hexToBigInt,
|
|
2644
|
-
hexToBool,
|
|
2645
|
-
hexToNumber,
|
|
2646
|
-
hexToString,
|
|
2647
|
-
toHex,
|
|
2648
|
-
boolToHex,
|
|
2649
|
-
bytesToHex,
|
|
2650
|
-
numberToHex,
|
|
2651
|
-
stringToHex,
|
|
2652
|
-
formatBlockParameter,
|
|
2653
|
-
LruMap,
|
|
2654
|
-
InvalidAddressError,
|
|
2655
|
-
keccak256,
|
|
2656
|
-
checksumAddress,
|
|
2657
|
-
getAddress,
|
|
2658
|
-
isAddress,
|
|
2659
|
-
concat,
|
|
2660
|
-
concatBytes,
|
|
2661
|
-
concatHex,
|
|
2662
|
-
PositionOutOfBoundsError,
|
|
2663
|
-
createCursor,
|
|
2664
|
-
etherUnits,
|
|
2665
|
-
gweiUnits,
|
|
2666
|
-
weiUnits,
|
|
2667
|
-
formatUnits,
|
|
2668
|
-
formatEther,
|
|
2669
|
-
formatGwei,
|
|
2670
|
-
prettyPrint,
|
|
2671
|
-
FeeConflictError,
|
|
2672
|
-
InvalidLegacyVError,
|
|
2673
|
-
InvalidYParityError,
|
|
2674
|
-
InvalidSerializableTransactionError,
|
|
2675
|
-
InvalidSerializedTransactionTypeError,
|
|
2676
|
-
InvalidSerializedTransactionError,
|
|
2677
|
-
InvalidStorageKeySizeError,
|
|
2678
|
-
TransactionExecutionError,
|
|
2679
|
-
TransactionNotFoundError,
|
|
2680
|
-
TransactionReceiptNotFoundError,
|
|
2681
|
-
TransactionReceiptRevertedError,
|
|
2682
|
-
WaitForTransactionReceiptTimeoutError,
|
|
2683
|
-
maxInt8,
|
|
2684
|
-
maxInt16,
|
|
2685
|
-
maxInt24,
|
|
2686
|
-
maxInt32,
|
|
2687
|
-
maxInt40,
|
|
2688
|
-
maxInt48,
|
|
2689
|
-
maxInt56,
|
|
2690
|
-
maxInt64,
|
|
2691
|
-
maxInt72,
|
|
2692
|
-
maxInt80,
|
|
2693
|
-
maxInt88,
|
|
2694
|
-
maxInt96,
|
|
2695
|
-
maxInt104,
|
|
2696
|
-
maxInt112,
|
|
2697
|
-
maxInt120,
|
|
2698
|
-
maxInt128,
|
|
2699
|
-
maxInt136,
|
|
2700
|
-
maxInt144,
|
|
2701
|
-
maxInt152,
|
|
2702
|
-
maxInt160,
|
|
2703
|
-
maxInt168,
|
|
2704
|
-
maxInt176,
|
|
2705
|
-
maxInt184,
|
|
2706
|
-
maxInt192,
|
|
2707
|
-
maxInt200,
|
|
2708
|
-
maxInt208,
|
|
2709
|
-
maxInt216,
|
|
2710
|
-
maxInt224,
|
|
2711
|
-
maxInt232,
|
|
2712
|
-
maxInt240,
|
|
2713
|
-
maxInt248,
|
|
2714
|
-
maxInt256,
|
|
2715
|
-
minInt8,
|
|
2716
|
-
minInt16,
|
|
2717
|
-
minInt24,
|
|
2718
|
-
minInt32,
|
|
2719
|
-
minInt40,
|
|
2720
|
-
minInt48,
|
|
2721
|
-
minInt56,
|
|
2722
|
-
minInt64,
|
|
2723
|
-
minInt72,
|
|
2724
|
-
minInt80,
|
|
2725
|
-
minInt88,
|
|
2726
|
-
minInt96,
|
|
2727
|
-
minInt104,
|
|
2728
|
-
minInt112,
|
|
2729
|
-
minInt120,
|
|
2730
|
-
minInt128,
|
|
2731
|
-
minInt136,
|
|
2732
|
-
minInt144,
|
|
2733
|
-
minInt152,
|
|
2734
|
-
minInt160,
|
|
2735
|
-
minInt168,
|
|
2736
|
-
minInt176,
|
|
2737
|
-
minInt184,
|
|
2738
|
-
minInt192,
|
|
2739
|
-
minInt200,
|
|
2740
|
-
minInt208,
|
|
2741
|
-
minInt216,
|
|
2742
|
-
minInt224,
|
|
2743
|
-
minInt232,
|
|
2744
|
-
minInt240,
|
|
2745
|
-
minInt248,
|
|
2746
|
-
minInt256,
|
|
2747
|
-
maxUint8,
|
|
2748
|
-
maxUint16,
|
|
2749
|
-
maxUint24,
|
|
2750
|
-
maxUint32,
|
|
2751
|
-
maxUint40,
|
|
2752
|
-
maxUint48,
|
|
2753
|
-
maxUint56,
|
|
2754
|
-
maxUint64,
|
|
2755
|
-
maxUint72,
|
|
2756
|
-
maxUint80,
|
|
2757
|
-
maxUint88,
|
|
2758
|
-
maxUint96,
|
|
2759
|
-
maxUint104,
|
|
2760
|
-
maxUint112,
|
|
2761
|
-
maxUint120,
|
|
2762
|
-
maxUint128,
|
|
2763
|
-
maxUint136,
|
|
2764
|
-
maxUint144,
|
|
2765
|
-
maxUint152,
|
|
2766
|
-
maxUint160,
|
|
2767
|
-
maxUint168,
|
|
2768
|
-
maxUint176,
|
|
2769
|
-
maxUint184,
|
|
2770
|
-
maxUint192,
|
|
2771
|
-
maxUint200,
|
|
2772
|
-
maxUint208,
|
|
2773
|
-
maxUint216,
|
|
2774
|
-
maxUint224,
|
|
2775
|
-
maxUint232,
|
|
2776
|
-
maxUint240,
|
|
2777
|
-
maxUint248,
|
|
2778
|
-
maxUint256,
|
|
2779
|
-
ChainDoesNotSupportContract,
|
|
2780
|
-
ChainMismatchError,
|
|
2781
|
-
ChainNotFoundError,
|
|
2782
|
-
ClientChainNotConfiguredError,
|
|
2783
|
-
InvalidChainIdError,
|
|
2784
|
-
ExecutionRevertedError,
|
|
2785
|
-
FeeCapTooHighError,
|
|
2786
|
-
FeeCapTooLowError,
|
|
2787
|
-
NonceTooHighError,
|
|
2788
|
-
NonceTooLowError,
|
|
2789
|
-
NonceMaxValueError,
|
|
2790
|
-
InsufficientFundsError,
|
|
2791
|
-
IntrinsicGasTooHighError,
|
|
2792
|
-
IntrinsicGasTooLowError,
|
|
2793
|
-
TransactionTypeNotSupportedError,
|
|
2794
|
-
TipAboveFeeCapError,
|
|
2795
|
-
UnknownNodeError,
|
|
2796
|
-
slice,
|
|
2797
|
-
sliceBytes,
|
|
2798
|
-
sliceHex,
|
|
2799
|
-
formatAbiItem,
|
|
2800
|
-
AbiConstructorNotFoundError,
|
|
2801
|
-
AbiConstructorParamsNotFoundError,
|
|
2802
|
-
AbiDecodingDataSizeInvalidError,
|
|
2803
|
-
AbiDecodingDataSizeTooSmallError,
|
|
2804
|
-
AbiDecodingZeroDataError,
|
|
2805
|
-
AbiEncodingArrayLengthMismatchError,
|
|
2806
|
-
AbiEncodingBytesSizeMismatchError,
|
|
2807
|
-
AbiEncodingLengthMismatchError,
|
|
2808
|
-
AbiErrorInputsNotFoundError,
|
|
2809
|
-
AbiErrorNotFoundError,
|
|
2810
|
-
AbiErrorSignatureNotFoundError,
|
|
2811
|
-
AbiEventSignatureEmptyTopicsError,
|
|
2812
|
-
AbiEventSignatureNotFoundError,
|
|
2813
|
-
AbiEventNotFoundError,
|
|
2814
|
-
AbiFunctionNotFoundError,
|
|
2815
|
-
AbiFunctionOutputsNotFoundError,
|
|
2816
|
-
AbiFunctionSignatureNotFoundError,
|
|
2817
|
-
AbiItemAmbiguityError,
|
|
2818
|
-
BytesSizeMismatchError,
|
|
2819
|
-
DecodeLogDataMismatch,
|
|
2820
|
-
DecodeLogTopicsMismatch,
|
|
2821
|
-
InvalidAbiEncodingTypeError,
|
|
2822
|
-
InvalidAbiDecodingTypeError,
|
|
2823
|
-
InvalidArrayError,
|
|
2824
|
-
InvalidDefinitionTypeError,
|
|
2825
|
-
UnsupportedPackedAbiType,
|
|
2826
|
-
arrayRegex,
|
|
2827
|
-
bytesRegex,
|
|
2828
|
-
integerRegex,
|
|
2829
|
-
encodeAbiParameters,
|
|
2830
|
-
getArrayComponents,
|
|
2831
|
-
stringify,
|
|
2832
|
-
parseAccount,
|
|
2833
|
-
BaseError2,
|
|
2834
|
-
stringify2,
|
|
2835
|
-
concat3 as concat2,
|
|
2836
|
-
from2 as from,
|
|
2837
|
-
fromBoolean,
|
|
2838
|
-
fromBytes,
|
|
2839
|
-
fromNumber,
|
|
2840
|
-
fromString2 as fromString,
|
|
2841
|
-
padLeft,
|
|
2842
|
-
padRight,
|
|
2843
|
-
slice3 as slice2,
|
|
2844
|
-
size3 as size2,
|
|
2845
|
-
trimLeft2 as trimLeft,
|
|
2846
|
-
toNumber,
|
|
2847
|
-
validate2 as validate,
|
|
2848
|
-
IntegerOutOfRangeError2,
|
|
2849
|
-
concat2 as concat3,
|
|
2850
|
-
from as from2,
|
|
2851
|
-
fromHex2,
|
|
2852
|
-
fromString as fromString2,
|
|
2853
|
-
isEqual,
|
|
2854
|
-
random,
|
|
2855
|
-
size2 as size3,
|
|
2856
|
-
slice2 as slice3,
|
|
2857
|
-
toBigInt2 as toBigInt,
|
|
2858
|
-
toBoolean,
|
|
2859
|
-
toHex2,
|
|
2860
|
-
toNumber2,
|
|
2861
|
-
toString,
|
|
2862
|
-
trimLeft as trimLeft2,
|
|
2863
|
-
validate as validate2
|
|
2864
|
-
};
|
|
2865
|
-
//# sourceMappingURL=chunk-EGELTSPU.js.map
|