@antseed/ants 0.1.4 → 0.1.6
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/dist/ants-web/assets/Arc-VDBY7LNS-BChRXCXW.js +1 -0
- package/dist/ants-web/assets/Brave-BRAKJXDS-mq-Xo37j.js +1 -0
- package/dist/ants-web/assets/Browser-76IHF3Y2-BMhRaC5Z.js +1 -0
- package/dist/ants-web/assets/Chrome-65Q5P54Y-DR9MQEVr.js +1 -0
- package/dist/ants-web/assets/Edge-XSPUTORV-DEoZslQE.js +1 -0
- package/dist/ants-web/assets/Firefox-AAHGJQIP-Bp_Hm04m.js +1 -0
- package/dist/ants-web/assets/Linux-OO4TNCLJ-B0aw93n9.js +1 -0
- package/dist/ants-web/assets/Macos-MW4AE7LN-Vvm8Drw3.js +1 -0
- package/dist/ants-web/assets/Opera-KQZLSACL-Cwv5MDFy.js +1 -0
- package/dist/ants-web/assets/Safari-ZPL37GXR-C4Ggg6rz.js +1 -0
- package/dist/ants-web/assets/Windows-PPTHQER6-BlyV2p7Y.js +1 -0
- package/dist/ants-web/assets/add-1qQ_SVL6.js +15 -0
- package/dist/ants-web/assets/all-wallets-D0QF065k.js +6 -0
- package/dist/ants-web/assets/apechain-SX5YFU6N-q5qBv-mp.js +1 -0
- package/dist/ants-web/assets/app-store-j-2thKGl.js +17 -0
- package/dist/ants-web/assets/apple-CCcInWVX.js +18 -0
- package/dist/ants-web/assets/ar_AR-44JUQ6EW-BMX-am0v.js +1487 -0
- package/dist/ants-web/assets/arbitrum-WURIBY6W-CqVkHBr5.js +1 -0
- package/dist/ants-web/assets/arrow-bottom-DVZa97G2.js +8 -0
- package/dist/ants-web/assets/arrow-bottom-circle-tt2k5BWG.js +11 -0
- package/dist/ants-web/assets/arrow-left-DnjqXMe0.js +8 -0
- package/dist/ants-web/assets/arrow-right-De8QMymS.js +8 -0
- package/dist/ants-web/assets/arrow-top-BS2oLt_x.js +8 -0
- package/dist/ants-web/assets/assets-Q6ZU7ZJ5-P8HioiAD.js +1 -0
- package/dist/ants-web/assets/avalanche-KOMJD3XY-Dsn_JPR4.js +1 -0
- package/dist/ants-web/assets/bank-DIxCskFM.js +14 -0
- package/dist/ants-web/assets/base-OAXLRA4F-CoYTVIiL.js +1 -0
- package/dist/ants-web/assets/baseAccount-44UITRK7-CsjdbWCf.js +1 -0
- package/dist/ants-web/assets/basic-D0Dg7j2v.js +2128 -0
- package/dist/ants-web/assets/berachain-NJECWIVC-DumxnFvf.js +1 -0
- package/dist/ants-web/assets/blast-V555OVXZ-BbhJh1tj.js +1 -0
- package/dist/ants-web/assets/browser-n9VVPree.js +14 -0
- package/dist/ants-web/assets/bsc-N647EYR2-B2nLKXWV.js +1 -0
- package/dist/ants-web/assets/card-Bl7AHEuE.js +14 -0
- package/dist/ants-web/assets/ccip-C_ifxkiT.js +1 -0
- package/dist/ants-web/assets/celo-GEP4TUHG-CenIBYLU.js +1 -0
- package/dist/ants-web/assets/checkmark-DXB1SsFx.js +11 -0
- package/dist/ants-web/assets/checkmark-bold-CIMnw7st.js +8 -0
- package/dist/ants-web/assets/chevron-bottom-DGkVb8CY.js +8 -0
- package/dist/ants-web/assets/chevron-left-D8vC6sW_.js +8 -0
- package/dist/ants-web/assets/chevron-right-CP8tyhU4.js +8 -0
- package/dist/ants-web/assets/chevron-top-DUqp6O8b.js +8 -0
- package/dist/ants-web/assets/chrome-store-CDk6Jfiv.js +61 -0
- package/dist/ants-web/assets/clock-t0Dwo5ck.js +8 -0
- package/dist/ants-web/assets/close-BiTlv6FX.js +8 -0
- package/dist/ants-web/assets/coinPlaceholder-PJZCh_De.js +8 -0
- package/dist/ants-web/assets/compass-CctP2ZVM.js +8 -0
- package/dist/ants-web/assets/connect-UA7M4XW6-IY3X6Bmr.js +1 -0
- package/dist/ants-web/assets/copy-b1i5dSZT.js +15 -0
- package/dist/ants-web/assets/core-4w9H32as.js +908 -0
- package/dist/ants-web/assets/create-FASO7PVG-D_rvSpre.js +1 -0
- package/dist/ants-web/assets/cronos-HJPAQTAE-BEOvlOC4.js +1 -0
- package/dist/ants-web/assets/cursor-kLCZuRWK.js +3 -0
- package/dist/ants-web/assets/cursor-transparent-C1IxvCBs.js +12 -0
- package/dist/ants-web/assets/de_DE-PYAO5YD6-BWlqPWgO.js +1487 -0
- package/dist/ants-web/assets/degen-FQQ4XGHB-CeHTs88l.js +1 -0
- package/dist/ants-web/assets/desktop-Qa_41eha.js +9 -0
- package/dist/ants-web/assets/disconnect-7QBZVVG8.js +8 -0
- package/dist/ants-web/assets/discord-DuRr0OMy.js +17 -0
- package/dist/ants-web/assets/es_419-HRGOJ6VT-D-qzxUM-.js +1487 -0
- package/dist/ants-web/assets/ethereum-RGGVA4PY-SWGOlkuk.js +1 -0
- package/dist/ants-web/assets/etherscan-BOImzSgC.js +6 -0
- package/dist/ants-web/assets/events-DQ172AOg.js +1 -0
- package/dist/ants-web/assets/exclamation-triangle-evZ54TSt.js +4 -0
- package/dist/ants-web/assets/extension-YSvzNEgu.js +8 -0
- package/dist/ants-web/assets/external-link-BukU3aK3.js +8 -0
- package/dist/ants-web/assets/facebook-WJZQGI9M.js +26 -0
- package/dist/ants-web/assets/farcaster-Dt0XRvlP.js +12 -0
- package/dist/ants-web/assets/filters-CFC5g--u.js +8 -0
- package/dist/ants-web/assets/flow-5FQJFCTK-CUie2reO.js +1 -0
- package/dist/ants-web/assets/fr_FR-IGGVC6RM-D8LpUM75.js +1487 -0
- package/dist/ants-web/assets/github-Bhz0AnGj.js +18 -0
- package/dist/ants-web/assets/gnosis-37ZC4RBL-B137OtHZ.js +1 -0
- package/dist/ants-web/assets/google-CGzSUXjP.js +18 -0
- package/dist/ants-web/assets/gravity-J5YQHTYH-Bj6B0uod.js +1 -0
- package/dist/ants-web/assets/hardhat-TX56IT5N-CV1FY-wE.js +1 -0
- package/dist/ants-web/assets/help-circle-BoGPtVJY.js +12 -0
- package/dist/ants-web/assets/hi_IN-XSKAA3MF-C3QUpWyP.js +1487 -0
- package/dist/ants-web/assets/hyperevm-VKPAA4SA-CHwraEsx.js +1 -0
- package/dist/ants-web/assets/id-ir8rS0J_.js +12 -0
- package/dist/ants-web/assets/id_ID-KUOB4UAL-K9y-nRWm.js +1487 -0
- package/dist/ants-web/assets/image-DXBUHwz_.js +4 -0
- package/dist/ants-web/assets/index-9ALlRD6p.css +1 -0
- package/dist/ants-web/assets/index-B7p3jPAJ.js +1 -0
- package/dist/ants-web/assets/index-BqWNkBzB.js +395 -0
- package/dist/ants-web/assets/index-C-I4ROfT.js +16 -0
- package/dist/ants-web/assets/index-Chq8yV_g.js +47 -0
- package/dist/ants-web/assets/index-Ci5bF__2.js +1729 -0
- package/dist/ants-web/assets/index-kzlEvkEN.js +1 -0
- package/dist/ants-web/assets/index.es-D1GdDJUC.js +39 -0
- package/dist/ants-web/assets/info-DzGq_QPQ.js +3 -0
- package/dist/ants-web/assets/info-circle-z91TqQxH.js +12 -0
- package/dist/ants-web/assets/ink-FZMYZWHG-62p-5IK5.js +1 -0
- package/dist/ants-web/assets/ja_JP-4WRQ63RX-Ct5pF4ug.js +1487 -0
- package/dist/ants-web/assets/kaia-65D2U3PU-JmuLQ4gC.js +1 -0
- package/dist/ants-web/assets/ko_KR-I2K7AIEP-B5gw8Mwb.js +1487 -0
- package/dist/ants-web/assets/lightbulb-CgYwiQYs.js +3 -0
- package/dist/ants-web/assets/linea-QRMVQ5DY-DuI3vv0d.js +1 -0
- package/dist/ants-web/assets/login-UP3DZBGS-Db_wM5oQ.js +1 -0
- package/dist/ants-web/assets/mail-FLPFIbqi.js +8 -0
- package/dist/ants-web/assets/manta-SI27YFEJ-CpVOKa06.js +1 -0
- package/dist/ants-web/assets/mantle-CKIUT334-DR2WgqzU.js +1 -0
- package/dist/ants-web/assets/metaMaskWallet-SITXT2FV-BlemcphV.js +1 -0
- package/dist/ants-web/assets/metamask-sdk-QG4PtQco.js +542 -0
- package/dist/ants-web/assets/mobile--kHpa5NK.js +9 -0
- package/dist/ants-web/assets/monad-4KWC6TSS-DVXSkpiz.js +1 -0
- package/dist/ants-web/assets/more-CJbReLy0.js +11 -0
- package/dist/ants-web/assets/ms_MY-6VZW6Q3Z-BtFD07hR.js +1487 -0
- package/dist/ants-web/assets/network-placeholder-BfSizFBN.js +14 -0
- package/dist/ants-web/assets/nftPlaceholder-BTfly2G8.js +8 -0
- package/dist/ants-web/assets/off-DCMXa6Y2.js +8 -0
- package/dist/ants-web/assets/optimism-HAF2GUT7-ec6Nqxs9.js +1 -0
- package/dist/ants-web/assets/play-store-CbbevixE.js +32 -0
- package/dist/ants-web/assets/plus-BxINT2r_.js +13 -0
- package/dist/ants-web/assets/polygon-WW6ZI7PM-DXlmm4L1.js +1 -0
- package/dist/ants-web/assets/pt_BR-N3XOZ4SV-CvVpfsHb.js +1487 -0
- package/dist/ants-web/assets/qr-code-CMEsvGrE.js +6 -0
- package/dist/ants-web/assets/rainbowWallet-O26YNBMX-DUhYus-9.js +1 -0
- package/dist/ants-web/assets/recycle-horizontal-BldRTXPT.js +9 -0
- package/dist/ants-web/assets/refresh-82vLCcdB.js +8 -0
- package/dist/ants-web/assets/refresh-S4T5V5GX-CwqIaaxK.js +1 -0
- package/dist/ants-web/assets/reown-logo-BPGalyzg.js +12 -0
- package/dist/ants-web/assets/ronin-EMCPYXZT-N-QBHZdV.js +1 -0
- package/dist/ants-web/assets/ru_RU-IITAPRET-DOj6Jzj7.js +1487 -0
- package/dist/ants-web/assets/safeWallet-5MNKTR5Z-D-5imDLD.js +1 -0
- package/dist/ants-web/assets/sanko-RHQYXGM5-OX010CbN.js +1 -0
- package/dist/ants-web/assets/scan-4UYSQ56Q-CjMz6-XC.js +1 -0
- package/dist/ants-web/assets/scroll-5OBGQVOV-DJFECiai.js +1 -0
- package/dist/ants-web/assets/search-CADsyV1c.js +8 -0
- package/dist/ants-web/assets/secp256k1-B5byVYSZ.js +1 -0
- package/dist/ants-web/assets/secp256k1-Cb4vPU9D.js +1 -0
- package/dist/ants-web/assets/send-DyAisqGO.js +15 -0
- package/dist/ants-web/assets/sign-A7IJEUT5-CGsRnPrd.js +1 -0
- package/dist/ants-web/assets/superposition-HG6MMR2Y-bRkgatRO.js +1 -0
- package/dist/ants-web/assets/swapHorizontal-BfHwXZPT.js +8 -0
- package/dist/ants-web/assets/swapHorizontalBold-FIoCjqnp.js +8 -0
- package/dist/ants-web/assets/swapHorizontalMedium-CzDDCY_G.js +16 -0
- package/dist/ants-web/assets/swapHorizontalRoundedBold-CvMRJeWj.js +8 -0
- package/dist/ants-web/assets/swapVertical-BgSezaow.js +8 -0
- package/dist/ants-web/assets/telegram-CsMNhXCs.js +16 -0
- package/dist/ants-web/assets/th_TH-3ZQCKCQE-BcHUN2Q4.js +1487 -0
- package/dist/ants-web/assets/three-dots-DYf4gmVW.js +5 -0
- package/dist/ants-web/assets/tr_TR-QUPUGMUF-CwpF6ZFn.js +1487 -0
- package/dist/ants-web/assets/twitch-BtBr-NTg.js +18 -0
- package/dist/ants-web/assets/twitterIcon-BmRf6M77.js +6 -0
- package/dist/ants-web/assets/uk_UA-SSN6SV5E-IlYYyRC6.js +1487 -0
- package/dist/ants-web/assets/unichain-C5BWO2ZY-BfguYsnu.js +1 -0
- package/dist/ants-web/assets/verify-cxA8gdP6.js +8 -0
- package/dist/ants-web/assets/verify-filled-DHnnW8EE.js +8 -0
- package/dist/ants-web/assets/vi_VN-7BUVRNYY-CZ9S75qZ.js +1487 -0
- package/dist/ants-web/assets/w3m-modal-D1ucMOAa.js +642 -0
- package/dist/ants-web/assets/wallet-BT4Fue1R.js +8 -0
- package/dist/ants-web/assets/wallet-placeholder-C2J5s6Yp.js +14 -0
- package/dist/ants-web/assets/walletConnectWallet-YHWKVTDY-D3lyiczV.js +1 -0
- package/dist/ants-web/assets/walletconnect-B5k8iJl-.js +30 -0
- package/dist/ants-web/assets/warning-circle-9rNSUSsX.js +12 -0
- package/dist/ants-web/assets/x-CpRc85jR.js +12 -0
- package/dist/ants-web/assets/xdc-KJ3TDBYO-DNV6zchh.js +1 -0
- package/dist/ants-web/assets/zetachain-TLDS5IPW-Udhyw16T.js +1 -0
- package/dist/ants-web/assets/zh_CN-HJBN674C-Baf0GEeT.js +1487 -0
- package/dist/ants-web/assets/zh_HK-JW3WLRKE-VztJKXL5.js +1487 -0
- package/dist/ants-web/assets/zh_TW-VNNRNXY7-aWfg7Qp4.js +1487 -0
- package/dist/ants-web/assets/zksync-DH7HK5U4-Dt4usFw6.js +1 -0
- package/dist/ants-web/assets/zora-FYL5H3IO-iB4wygST.js +1 -0
- package/dist/ants-web/index.html +2 -2
- package/dist/api-types.d.ts +168 -6
- package/dist/browser-signer.d.ts +30 -0
- package/dist/browser-signer.js +189 -0
- package/dist/browser-signer.js.map +1 -0
- package/dist/jobs.d.ts +10 -3
- package/dist/jobs.js +97 -20
- package/dist/jobs.js.map +1 -1
- package/dist/position-actions.d.ts +13 -0
- package/dist/position-actions.js +25 -0
- package/dist/position-actions.js.map +1 -0
- package/dist/routes.d.ts +7 -0
- package/dist/routes.js +63 -5
- package/dist/routes.js.map +1 -1
- package/dist/server.d.ts +8 -0
- package/dist/server.js +157 -12
- package/dist/server.js.map +1 -1
- package/dist/service/context.d.ts +13 -2
- package/dist/service/context.js +35 -4
- package/dist/service/context.js.map +1 -1
- package/dist/service/display-snapshot.d.ts +28 -0
- package/dist/service/display-snapshot.js +144 -0
- package/dist/service/display-snapshot.js.map +1 -0
- package/dist/service/emissions.js +11 -19
- package/dist/service/emissions.js.map +1 -1
- package/dist/service/explorer.js +2 -1
- package/dist/service/explorer.js.map +1 -1
- package/dist/service/format.d.ts +1 -1
- package/dist/service/format.js +2 -0
- package/dist/service/format.js.map +1 -1
- package/dist/service/indexed-wallet.d.ts +7 -0
- package/dist/service/indexed-wallet.js +58 -0
- package/dist/service/indexed-wallet.js.map +1 -0
- package/dist/service/indexer.d.ts +32 -3
- package/dist/service/indexer.js +64 -8
- package/dist/service/indexer.js.map +1 -1
- package/dist/service/legacy-payout.d.ts +3 -0
- package/dist/service/legacy-payout.js +32 -0
- package/dist/service/legacy-payout.js.map +1 -0
- package/dist/service/network.d.ts +5 -0
- package/dist/service/network.js +185 -0
- package/dist/service/network.js.map +1 -0
- package/dist/service/overview-reads.d.ts +30 -0
- package/dist/service/overview-reads.js +69 -0
- package/dist/service/overview-reads.js.map +1 -0
- package/dist/service/overview.js +14 -36
- package/dist/service/overview.js.map +1 -1
- package/dist/service/pool-merge.d.ts +2 -1
- package/dist/service/pool-merge.js +11 -4
- package/dist/service/pool-merge.js.map +1 -1
- package/dist/service/pools.d.ts +22 -1
- package/dist/service/pools.js +257 -98
- package/dist/service/pools.js.map +1 -1
- package/dist/service/position-feed.d.ts +73 -0
- package/dist/service/position-feed.js +173 -0
- package/dist/service/position-feed.js.map +1 -0
- package/dist/service/positions.d.ts +3 -5
- package/dist/service/positions.js +155 -93
- package/dist/service/positions.js.map +1 -1
- package/dist/service/rewards.d.ts +1 -0
- package/dist/service/rewards.js +117 -56
- package/dist/service/rewards.js.map +1 -1
- package/dist/service/rpc-provider.d.ts +3 -0
- package/dist/service/rpc-provider.js +32 -3
- package/dist/service/rpc-provider.js.map +1 -1
- package/dist/service/seller-models.d.ts +2 -0
- package/dist/service/seller-models.js +94 -0
- package/dist/service/seller-models.js.map +1 -0
- package/dist/service/seller.js +33 -30
- package/dist/service/seller.js.map +1 -1
- package/dist/service/stake-eligibility.d.ts +6 -0
- package/dist/service/stake-eligibility.js +50 -0
- package/dist/service/stake-eligibility.js.map +1 -0
- package/dist/service/usage.js +5 -13
- package/dist/service/usage.js.map +1 -1
- package/dist/service/yield.d.ts +3 -0
- package/dist/service/yield.js +12 -0
- package/dist/service/yield.js.map +1 -0
- package/dist/view-cache.d.ts +5 -10
- package/dist/view-cache.js +12 -14
- package/dist/view-cache.js.map +1 -1
- package/dist/wallet-errors.d.ts +9 -0
- package/dist/wallet-errors.js +32 -0
- package/dist/wallet-errors.js.map +1 -0
- package/package.json +8 -3
- package/dist/ants-web/assets/index-BunPfgXh.css +0 -1
- package/dist/ants-web/assets/index-zCPoF694.js +0 -40
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var l="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill%3D%22none%22%20viewBox%3D%220%200%2028%2028%22%3E%3Cg%20transform%3D%22translate(0%2C0)%20scale(0.7)%22%3E%3Cg%20clip-path%3D%22url(%23a)%22%3E%3Cpath%20fill%3D%22%23000%22%20d%3D%22M0%200h40v40H0z%22%2F%3E%3Cpath%20fill%3D%22url(%23b)%22%20fill-opacity%3D%22.1%22%20d%3D%22M0%200h40v40H0z%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20fill-rule%3D%22evenodd%22%20d%3D%22m32.25%2020.005-6.954-6.922v5.066l-6.901%205.078h6.901v3.7l6.954-6.922ZM7.75%2020.005l6.954%206.923v-5.036l6.901-5.119h-6.901v-3.7L7.75%2020.004Z%22%20clip-rule%3D%22evenodd%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22b%22%20x1%3D%220%22%20x2%3D%2220%22%20y1%3D%220%22%20y2%3D%2240%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%23fff%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23fff%22%20stop-opacity%3D%220%22%2F%3E%3C%2FlinearGradient%3E%3CclipPath%20id%3D%22a%22%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M0%200h40v40H0z%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fg%3E%3C%2Fsvg%3E";export{l as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var o="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2228%22%20height%3D%2228%22%20fill%3D%22none%22%3E%3Cg%20clip-path%3D%22url(%23a)%22%3E%3Cpath%20fill%3D%22url(%23b)%22%20d%3D%22M.943%2013.754c0%207.586%205.944%2013.755%2013.252%2013.755%207.308%200%2013.252-6.17%2013.252-13.755C27.44%206.17%2021.497%200%2014.195%200%206.887%200%20.943%206.17.943%2013.754Z%22%2F%3E%3Cpath%20fill%3D%22url(%23c)%22%20d%3D%22M.943%2013.754c0%207.586%205.944%2013.755%2013.252%2013.755%207.308%200%2013.252-6.17%2013.252-13.755C27.44%206.17%2021.497%200%2014.195%200%206.887%200%20.943%206.17.943%2013.754Z%22%2F%3E%3Cpath%20fill%3D%22url(%23d)%22%20d%3D%22M.943%2013.754c0%207.586%205.944%2013.755%2013.252%2013.755%207.308%200%2013.252-6.17%2013.252-13.755C27.44%206.17%2021.497%200%2014.195%200%206.887%200%20.943%206.17.943%2013.754Z%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CradialGradient%20id%3D%22b%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientTransform%3D%22matrix(19.9547%200%200%2020.7113%2018.16%206.7)%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20offset%3D%22.005%22%20stop-color%3D%22%23fff%22%2F%3E%3Cstop%20offset%3D%22.458%22%20stop-color%3D%22%23B7D8C8%22%2F%3E%3Cstop%20offset%3D%22.656%22%20stop-color%3D%22%236D9487%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%234B4C3C%22%2F%3E%3C%2FradialGradient%3E%3CradialGradient%20id%3D%22c%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientTransform%3D%22matrix(19.9547%200%200%2020.7113%2018.16%206.7)%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20offset%3D%22.005%22%20stop-color%3D%22%23fff%22%2F%3E%3Cstop%20offset%3D%22.458%22%20stop-color%3D%22%23B5B4C6%22%2F%3E%3Cstop%20offset%3D%22.656%22%20stop-color%3D%22%239B8F8F%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%234B4C3C%22%2F%3E%3C%2FradialGradient%3E%3CradialGradient%20id%3D%22d%22%20cx%3D%220%22%20cy%3D%220%22%20r%3D%221%22%20gradientTransform%3D%22matrix(19.9547%200%200%2020.7113%2018.16%206.7)%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20offset%3D%22.156%22%20stop-color%3D%22%23DCC8D0%22%2F%3E%3Cstop%20offset%3D%22.302%22%20stop-color%3D%22%2378C8CF%22%2F%3E%3Cstop%20offset%3D%22.427%22%20stop-color%3D%22%234D959E%22%2F%3E%3Cstop%20offset%3D%22.557%22%20stop-color%3D%22%23305EB9%22%2F%3E%3Cstop%20offset%3D%22.797%22%20stop-color%3D%22%23311F12%22%2F%3E%3Cstop%20offset%3D%22.906%22%20stop-color%3D%22%23684232%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%232D1C13%22%2F%3E%3C%2FradialGradient%3E%3CclipPath%20id%3D%22a%22%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M0%200h28v28H0z%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E";export{o as default};
|
package/dist/ants-web/index.html
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>ANTS · AntSeed staking</title>
|
|
7
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
7
|
+
<script type="module" crossorigin src="/assets/index-Ci5bF__2.js"></script>
|
|
8
|
+
<link rel="stylesheet" crossorigin href="/assets/index-9ALlRD6p.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
|
11
11
|
<div id="root"></div>
|
package/dist/api-types.d.ts
CHANGED
|
@@ -5,6 +5,12 @@
|
|
|
5
5
|
* are printed by the CLI's `--json` flags.
|
|
6
6
|
*/
|
|
7
7
|
export type ProtocolPhase = 'legacy' | 'deployed' | 'active';
|
|
8
|
+
export interface DisplaySource {
|
|
9
|
+
source: 'indexer' | 'chain';
|
|
10
|
+
indexedBlock?: number;
|
|
11
|
+
indexedAt?: number;
|
|
12
|
+
error?: string;
|
|
13
|
+
}
|
|
8
14
|
export interface EpochInfo {
|
|
9
15
|
current: number;
|
|
10
16
|
/** First recognized-usage epoch (gate `effectiveEpoch`), null before the stack is deployed. */
|
|
@@ -18,6 +24,7 @@ export interface WalletSummary {
|
|
|
18
24
|
address: string;
|
|
19
25
|
ants: string;
|
|
20
26
|
eth: string;
|
|
27
|
+
signingWalletEth?: string;
|
|
21
28
|
transfersEnabled: boolean;
|
|
22
29
|
whitelisted: boolean;
|
|
23
30
|
canTransfer: boolean;
|
|
@@ -37,6 +44,7 @@ export interface NetworkSummary {
|
|
|
37
44
|
antsMaxSupply: string;
|
|
38
45
|
}
|
|
39
46
|
export interface OverviewView {
|
|
47
|
+
networkSource?: DisplaySource;
|
|
40
48
|
phase: ProtocolPhase;
|
|
41
49
|
chainId: string;
|
|
42
50
|
evmChainId: number;
|
|
@@ -65,12 +73,16 @@ export interface PositionView {
|
|
|
65
73
|
withdrawableEpoch: number;
|
|
66
74
|
changePending: boolean;
|
|
67
75
|
maxLocked: boolean;
|
|
76
|
+
/** Max-lock state from the next epoch; differs from `maxLocked` while an enable/disable is pending. */
|
|
77
|
+
maxLockedNext: boolean;
|
|
68
78
|
/** On-chain early-exit slash for a withdrawal now; null while a change is pending (projected value is in `projectedSlashBps`). */
|
|
69
79
|
slashBps: number | null;
|
|
70
80
|
projectedSlashBps: number;
|
|
71
81
|
slashedAmount: string;
|
|
72
82
|
returnedAmount: string;
|
|
73
|
-
pendingReward: string;
|
|
83
|
+
pendingReward: string | null;
|
|
84
|
+
power?: string | null;
|
|
85
|
+
nextPower?: string | null;
|
|
74
86
|
epochsRemaining: number;
|
|
75
87
|
}
|
|
76
88
|
export interface PoolConfigView {
|
|
@@ -82,15 +94,21 @@ export interface PoolConfigView {
|
|
|
82
94
|
restakedRewardWeightBonusBps: number;
|
|
83
95
|
moveWeightPenaltyBps: number;
|
|
84
96
|
}
|
|
85
|
-
export type DataSource = 'indexer' | 'chain';
|
|
97
|
+
export type DataSource = 'indexer' | 'chain' | 'local';
|
|
86
98
|
export interface PositionsView {
|
|
99
|
+
rewardSource?: {
|
|
100
|
+
indexedBlock?: number;
|
|
101
|
+
indexedAt?: number;
|
|
102
|
+
error?: string;
|
|
103
|
+
};
|
|
104
|
+
displaySource?: DisplaySource;
|
|
87
105
|
currentEpoch: number;
|
|
88
106
|
config: PoolConfigView;
|
|
89
|
-
/** Open positions from the chain; closed ones (split, merge, move sources) from the indexer when available. */
|
|
90
107
|
positions: PositionView[];
|
|
91
108
|
totals: {
|
|
92
109
|
activeStake: string;
|
|
93
|
-
|
|
110
|
+
pendingStake: string;
|
|
111
|
+
pendingRewards: string | null;
|
|
94
112
|
open: number;
|
|
95
113
|
};
|
|
96
114
|
/** Where closed positions came from; 'chain' means only open positions are listed. */
|
|
@@ -101,17 +119,29 @@ export interface EpochAmount {
|
|
|
101
119
|
amount: string;
|
|
102
120
|
claimed?: boolean;
|
|
103
121
|
}
|
|
122
|
+
export interface LegacySellerPayout {
|
|
123
|
+
destination: 'wallet' | 'locked' | 'unknown';
|
|
124
|
+
recipient: string | null;
|
|
125
|
+
}
|
|
104
126
|
export interface RewardsView {
|
|
127
|
+
/** Before browser wallet connection, only the originating buyer account is read. */
|
|
128
|
+
scope?: 'buyer' | 'all';
|
|
129
|
+
historySource?: DataSource;
|
|
105
130
|
currentEpoch: number;
|
|
106
131
|
firstRewardedEpoch: number | null;
|
|
107
132
|
staker: {
|
|
108
|
-
total: string;
|
|
133
|
+
total: string | null;
|
|
109
134
|
positions: Array<{
|
|
110
135
|
id: number;
|
|
111
136
|
agentId: number;
|
|
112
137
|
amount: string;
|
|
113
138
|
closed: boolean;
|
|
114
139
|
}>;
|
|
140
|
+
source?: {
|
|
141
|
+
indexedBlock?: number;
|
|
142
|
+
indexedAt?: number;
|
|
143
|
+
error?: string;
|
|
144
|
+
};
|
|
115
145
|
};
|
|
116
146
|
sellerUsage: {
|
|
117
147
|
total: string;
|
|
@@ -131,6 +161,7 @@ export interface RewardsView {
|
|
|
131
161
|
buyer: string;
|
|
132
162
|
contract: string | null;
|
|
133
163
|
buyerClaimable: boolean;
|
|
164
|
+
sellerPayout?: LegacySellerPayout;
|
|
134
165
|
};
|
|
135
166
|
locked: {
|
|
136
167
|
locked: string;
|
|
@@ -138,7 +169,7 @@ export interface RewardsView {
|
|
|
138
169
|
policy: string | null;
|
|
139
170
|
pool: string | null;
|
|
140
171
|
};
|
|
141
|
-
total: string;
|
|
172
|
+
total: string | null;
|
|
142
173
|
}
|
|
143
174
|
/** One epoch's settled USDC volume for a seller (6 decimals). */
|
|
144
175
|
export interface EpochVolume {
|
|
@@ -147,6 +178,8 @@ export interface EpochVolume {
|
|
|
147
178
|
}
|
|
148
179
|
/** Explorer-sourced seller profile (Antscan); null fields when the explorer has no record. */
|
|
149
180
|
export interface SellerProfile {
|
|
181
|
+
fetchedAt?: number;
|
|
182
|
+
stale?: boolean;
|
|
150
183
|
name: string | null;
|
|
151
184
|
providers: string[];
|
|
152
185
|
modelsServed: number | null;
|
|
@@ -156,7 +189,73 @@ export interface SellerProfile {
|
|
|
156
189
|
ghostRate: number | null;
|
|
157
190
|
lastSettledAt: number | null;
|
|
158
191
|
}
|
|
192
|
+
export interface SellerModelsView {
|
|
193
|
+
fetchedAt: number;
|
|
194
|
+
catalogStatus: 'live' | 'stale' | 'unavailable';
|
|
195
|
+
catalogUpdatedAt: number | null;
|
|
196
|
+
offerings: Array<{
|
|
197
|
+
id: string;
|
|
198
|
+
name: string;
|
|
199
|
+
provider: string;
|
|
200
|
+
categories: string[];
|
|
201
|
+
inputUsdPerMillion: number | null;
|
|
202
|
+
outputUsdPerMillion: number | null;
|
|
203
|
+
}>;
|
|
204
|
+
usageStatus: 'available' | 'unavailable';
|
|
205
|
+
usageError: string | null;
|
|
206
|
+
period: {
|
|
207
|
+
epoch: number;
|
|
208
|
+
from: number;
|
|
209
|
+
to: number;
|
|
210
|
+
} | null;
|
|
211
|
+
totals: {
|
|
212
|
+
settledVolumeUsdc: string;
|
|
213
|
+
attributedVolumeUsdc: string;
|
|
214
|
+
unattributedVolumeUsdc: string | null;
|
|
215
|
+
excessAttributedVolumeUsdc: string;
|
|
216
|
+
} | null;
|
|
217
|
+
usage: Array<{
|
|
218
|
+
serviceId: string;
|
|
219
|
+
name: string;
|
|
220
|
+
requests: string;
|
|
221
|
+
inputTokens: string;
|
|
222
|
+
outputTokens: string;
|
|
223
|
+
volumeUsdc: string;
|
|
224
|
+
}>;
|
|
225
|
+
}
|
|
226
|
+
export interface PoolYield {
|
|
227
|
+
reward?: string | null;
|
|
228
|
+
power?: string | null;
|
|
229
|
+
minLockEpochs?: number | null;
|
|
230
|
+
maxLockEpochs?: number | null;
|
|
231
|
+
epoch: number;
|
|
232
|
+
startsAt: number;
|
|
233
|
+
endsAt: number;
|
|
234
|
+
apr: number | null;
|
|
235
|
+
apy: number | null;
|
|
236
|
+
status: 'settled' | 'estimated' | 'unavailable';
|
|
237
|
+
}
|
|
238
|
+
/** One indexed epoch of a seller pool: stake, power, settled volume and the staker emission it earned. */
|
|
239
|
+
export interface PoolEpochPoint {
|
|
240
|
+
epoch: number;
|
|
241
|
+
activeStake: string;
|
|
242
|
+
weight: string;
|
|
243
|
+
volumeUsdc: string;
|
|
244
|
+
requests: string;
|
|
245
|
+
/** Staker emission for the epoch; settled once a claim finalises it, otherwise the indexer's running figure. */
|
|
246
|
+
emission: string;
|
|
247
|
+
settled: boolean;
|
|
248
|
+
}
|
|
159
249
|
export interface PoolView {
|
|
250
|
+
displaySource?: DisplaySource;
|
|
251
|
+
/** Per-epoch history (oldest first) for charts; present on the single-pool endpoint when the indexer is reachable. */
|
|
252
|
+
history?: PoolEpochPoint[];
|
|
253
|
+
openPositions?: number;
|
|
254
|
+
totalPositions?: number;
|
|
255
|
+
stakers?: number | null;
|
|
256
|
+
yield?: PoolYield;
|
|
257
|
+
statsUpdatedAt?: number;
|
|
258
|
+
volumeStatus?: 'available' | 'unavailable' | 'stale';
|
|
160
259
|
agentId: number;
|
|
161
260
|
seller: string | null;
|
|
162
261
|
profile: SellerProfile | null;
|
|
@@ -181,7 +280,11 @@ export interface PoolView {
|
|
|
181
280
|
lastEpochRewardPer1kPower: string | null;
|
|
182
281
|
/** Projected staker ANTS per 1,000 units of pool power this epoch from current usage. */
|
|
183
282
|
projectedRewardPer1kPower: string | null;
|
|
283
|
+
/** Stake in open positions that activates at a later epoch (indexer-sourced; absent from chain-only rows). */
|
|
284
|
+
pendingStake?: string;
|
|
184
285
|
yourStake: string;
|
|
286
|
+
/** Your stake in this pool whose activation epoch is still ahead. */
|
|
287
|
+
yourPendingStake: string;
|
|
185
288
|
/** Your power in this pool this epoch (sum of your positions' weight). */
|
|
186
289
|
yourPower: string;
|
|
187
290
|
/** Your power as a share of the pool's power. */
|
|
@@ -189,6 +292,7 @@ export interface PoolView {
|
|
|
189
292
|
yourPositionIds: number[];
|
|
190
293
|
}
|
|
191
294
|
export interface PoolsView {
|
|
295
|
+
displaySource?: DisplaySource;
|
|
192
296
|
currentEpoch: number;
|
|
193
297
|
firstRewardedEpoch: number | null;
|
|
194
298
|
totalActiveStake: string;
|
|
@@ -199,6 +303,8 @@ export interface PoolsView {
|
|
|
199
303
|
yourTotalPower: string;
|
|
200
304
|
/** Your power as a share of all pools' power. */
|
|
201
305
|
yourNetworkShareBps: number;
|
|
306
|
+
/** Your stake across pools that activates at a later epoch. */
|
|
307
|
+
yourPendingStake: string;
|
|
202
308
|
explorer: string | null;
|
|
203
309
|
/** 'indexer' = full pool statistics from the explorer; 'chain' = only the pools this wallet stakes in, read live. */
|
|
204
310
|
source: DataSource;
|
|
@@ -242,6 +348,57 @@ export interface MinterView {
|
|
|
242
348
|
editable: boolean;
|
|
243
349
|
epochBudget: string;
|
|
244
350
|
}
|
|
351
|
+
export interface NetworkStakerConfig {
|
|
352
|
+
minShareBps: number;
|
|
353
|
+
maxShareBps: number;
|
|
354
|
+
stakeShareTarget: string;
|
|
355
|
+
}
|
|
356
|
+
export interface NetworkUsageConfig {
|
|
357
|
+
buyerMinShareBps: number;
|
|
358
|
+
buyerMaxShareBps: number;
|
|
359
|
+
sellerMinShareBps: number;
|
|
360
|
+
sellerMaxShareBps: number;
|
|
361
|
+
volumeShareTarget: string;
|
|
362
|
+
}
|
|
363
|
+
export interface NetworkSnapshot {
|
|
364
|
+
chainId: string;
|
|
365
|
+
evmChainId: number;
|
|
366
|
+
blockNumber: number;
|
|
367
|
+
blockTimestamp: number;
|
|
368
|
+
fetchedAt: number;
|
|
369
|
+
activation: 'active' | 'not-active' | 'unverified';
|
|
370
|
+
epoch: EpochInfo;
|
|
371
|
+
shareDenominator: number;
|
|
372
|
+
initialEmission: string;
|
|
373
|
+
halvingInterval: number;
|
|
374
|
+
emission: string | null;
|
|
375
|
+
nextEmission: string | null;
|
|
376
|
+
cumulativeScheduled: string | null;
|
|
377
|
+
totalSupply: string | null;
|
|
378
|
+
maxSupply: string | null;
|
|
379
|
+
totalActiveStake: string | null;
|
|
380
|
+
totalPowerWeight: string | null;
|
|
381
|
+
usageVolume: string | null;
|
|
382
|
+
buckets: Array<{
|
|
383
|
+
name: string;
|
|
384
|
+
id: string;
|
|
385
|
+
controller: string | null;
|
|
386
|
+
budget: string | null;
|
|
387
|
+
nextBudget: string | null;
|
|
388
|
+
}>;
|
|
389
|
+
budgets: {
|
|
390
|
+
staker: string | null;
|
|
391
|
+
buyer: string | null;
|
|
392
|
+
seller: string | null;
|
|
393
|
+
};
|
|
394
|
+
stakerConfig: NetworkStakerConfig | null;
|
|
395
|
+
nextStakerConfig: NetworkStakerConfig | null;
|
|
396
|
+
scaledStakeTarget: string | null;
|
|
397
|
+
usageConfig: NetworkUsageConfig | null;
|
|
398
|
+
nextUsageConfig: NetworkUsageConfig | null;
|
|
399
|
+
contracts: Record<string, string>;
|
|
400
|
+
errors: string[];
|
|
401
|
+
}
|
|
245
402
|
export interface EmissionsView {
|
|
246
403
|
currentEpoch: number;
|
|
247
404
|
effectiveEpoch: number | null;
|
|
@@ -339,6 +496,8 @@ export interface JobStep {
|
|
|
339
496
|
export interface JobView {
|
|
340
497
|
id: string;
|
|
341
498
|
kind: string;
|
|
499
|
+
/** Signing wallet that started the job (browser sessions; absent for local-signer runs). */
|
|
500
|
+
owner?: string;
|
|
342
501
|
status: 'running' | 'done' | 'failed';
|
|
343
502
|
steps: JobStep[];
|
|
344
503
|
result?: unknown;
|
|
@@ -379,6 +538,8 @@ export type RewardBucket = 'staker' | 'seller' | 'buyer' | 'legacy' | 'locked';
|
|
|
379
538
|
export interface ClaimRequest {
|
|
380
539
|
buckets: RewardBucket[];
|
|
381
540
|
recipient?: string;
|
|
541
|
+
scope?: 'buyer' | 'wallet';
|
|
542
|
+
expectedLegacySellerRecipient?: string;
|
|
382
543
|
}
|
|
383
544
|
export interface RestakeRequest {
|
|
384
545
|
positionIds?: number[];
|
|
@@ -391,6 +552,7 @@ export interface StakeUsageRequest {
|
|
|
391
552
|
}
|
|
392
553
|
/** Restake staker + seller usage (+ buyer usage when operator) rewards in one job; `targetAgentId` moves the new positions into that pool. */
|
|
393
554
|
export interface CompoundRequest {
|
|
555
|
+
includeBuyer?: boolean;
|
|
394
556
|
epochs: number;
|
|
395
557
|
targetAgentId?: number;
|
|
396
558
|
stakeAgentId?: number;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { AbstractSigner, type Provider, type TransactionRequest, type TransactionResponse } from 'ethers';
|
|
2
|
+
export interface BrowserTransaction {
|
|
3
|
+
id: string;
|
|
4
|
+
jobId?: string;
|
|
5
|
+
from: string;
|
|
6
|
+
to: string;
|
|
7
|
+
data: string;
|
|
8
|
+
value: string;
|
|
9
|
+
chainId: number;
|
|
10
|
+
submittedHash?: string;
|
|
11
|
+
approvalStarted?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/** One wallet approval at a time. No private key or local transaction signer is held here. */
|
|
14
|
+
export declare class BrowserSigning {
|
|
15
|
+
private readonly chainId;
|
|
16
|
+
private pending;
|
|
17
|
+
private generation;
|
|
18
|
+
constructor(chainId: number);
|
|
19
|
+
get request(): BrowserTransaction | null;
|
|
20
|
+
signer(address: string, provider: Provider): AbstractSigner;
|
|
21
|
+
cancel(reason?: string): void;
|
|
22
|
+
send(address: string, provider: Provider, generation: number, tx: TransactionRequest): Promise<TransactionResponse>;
|
|
23
|
+
private expiry;
|
|
24
|
+
begin(id: string): void;
|
|
25
|
+
complete(id: string, hash?: string, error?: string): Promise<void>;
|
|
26
|
+
/** ethers 6 rejects with TIMEOUT rather than resolving null; keep polling in slices while the transaction may still land. */
|
|
27
|
+
private awaitReceipt;
|
|
28
|
+
/** A fallback endpoint can lag the one that served the receipt; a missing transaction is retried, not treated as forged. */
|
|
29
|
+
private lookupTransaction;
|
|
30
|
+
}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import { safeWalletFailure } from './wallet-errors.js';
|
|
3
|
+
import { AbstractSigner, getAddress, isError, resolveProperties } from 'ethers';
|
|
4
|
+
function isTimeout(err) {
|
|
5
|
+
return isError(err, 'TIMEOUT') || (err instanceof Error && /timeout/i.test(err.message));
|
|
6
|
+
}
|
|
7
|
+
/** How long an unopened request waits for someone to click Approve. */
|
|
8
|
+
const APPROVAL_IDLE_MS = 10 * 60_000;
|
|
9
|
+
/** How long an opened wallet prompt may sit before the request expires. */
|
|
10
|
+
const APPROVAL_WINDOW_MS = 30 * 60_000;
|
|
11
|
+
/** One receipt poll slice; slices repeat until CONFIRMATION_MAX_MS. */
|
|
12
|
+
const CONFIRMATION_SLICE_MS = 180_000;
|
|
13
|
+
const CONFIRMATION_MAX_MS = 30 * 60_000;
|
|
14
|
+
const TRANSACTION_LOOKUP_ATTEMPTS = 5;
|
|
15
|
+
const TRANSACTION_LOOKUP_DELAY_MS = 2_000;
|
|
16
|
+
/** EIP-7702 delegation designator: the account's code points at a delegate contract. */
|
|
17
|
+
async function isDelegatedAccount(provider, address) {
|
|
18
|
+
return (await provider.getCode(address)).toLowerCase().startsWith('0xef0100');
|
|
19
|
+
}
|
|
20
|
+
const sleep = (ms) => new Promise((resolve) => { const t = setTimeout(resolve, ms); t.unref?.(); });
|
|
21
|
+
/** One wallet approval at a time. No private key or local transaction signer is held here. */
|
|
22
|
+
export class BrowserSigning {
|
|
23
|
+
chainId;
|
|
24
|
+
pending = null;
|
|
25
|
+
generation = 0;
|
|
26
|
+
constructor(chainId) {
|
|
27
|
+
this.chainId = chainId;
|
|
28
|
+
}
|
|
29
|
+
get request() { return this.pending?.request ?? null; }
|
|
30
|
+
signer(address, provider) {
|
|
31
|
+
return new BrowserSigner(getAddress(address), provider, this, this.generation);
|
|
32
|
+
}
|
|
33
|
+
cancel(reason = 'Wallet or network changed. Review completed transactions before starting again.') {
|
|
34
|
+
this.generation++;
|
|
35
|
+
const pending = this.pending;
|
|
36
|
+
// A broadcast transaction must still be reconciled. The old signer cannot start another step.
|
|
37
|
+
if (pending && !pending.request.submittedHash && !pending.request.approvalStarted) {
|
|
38
|
+
clearTimeout(pending.timer);
|
|
39
|
+
this.pending = null;
|
|
40
|
+
pending.reject(new Error(reason));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
async send(address, provider, generation, tx) {
|
|
44
|
+
if (generation !== this.generation)
|
|
45
|
+
throw new Error('The signing wallet changed. Reopen the action.');
|
|
46
|
+
if (this.pending)
|
|
47
|
+
throw new Error('Another wallet approval is pending.');
|
|
48
|
+
const resolved = await resolveProperties(tx);
|
|
49
|
+
if (!resolved.to || typeof resolved.to !== 'string')
|
|
50
|
+
throw new Error('Contract creation is not supported.');
|
|
51
|
+
if (resolved.from && getAddress(String(resolved.from)) !== address)
|
|
52
|
+
throw new Error('Transaction sender does not match the connected wallet.');
|
|
53
|
+
if (resolved.chainId != null && BigInt(resolved.chainId) !== BigInt(this.chainId))
|
|
54
|
+
throw new Error('Transaction network mismatch.');
|
|
55
|
+
if ((await provider.getNetwork()).chainId !== BigInt(this.chainId))
|
|
56
|
+
throw new Error('RPC network mismatch.');
|
|
57
|
+
const request = { id: randomUUID(), from: address, to: getAddress(resolved.to), data: resolved.data ?? '0x', value: BigInt(resolved.value ?? 0).toString(), chainId: this.chainId };
|
|
58
|
+
const nonceFloor = await provider.getTransactionCount(address, 'latest');
|
|
59
|
+
// Simulate using the actual external sender before asking for approval.
|
|
60
|
+
await provider.call({ from: address, to: request.to, data: request.data, value: BigInt(request.value) });
|
|
61
|
+
if (generation !== this.generation)
|
|
62
|
+
throw new Error('The signing wallet changed.');
|
|
63
|
+
return new Promise((resolve, reject) => {
|
|
64
|
+
this.pending = { request, provider, nonceFloor, resolve, reject, timer: this.expiry(request.id, APPROVAL_IDLE_MS) };
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
expiry(id, ms) {
|
|
68
|
+
const timer = setTimeout(() => {
|
|
69
|
+
const pending = this.pending;
|
|
70
|
+
if (!pending || pending.request.id !== id || pending.request.submittedHash)
|
|
71
|
+
return;
|
|
72
|
+
this.pending = null;
|
|
73
|
+
pending.reject(new Error(pending.request.approvalStarted
|
|
74
|
+
? 'Wallet approval expired. If you confirmed this transaction in your wallet, check it there before retrying; nothing was automatically resubmitted.'
|
|
75
|
+
: 'Wallet approval expired. No transaction was automatically retried.'));
|
|
76
|
+
}, ms);
|
|
77
|
+
timer.unref();
|
|
78
|
+
return timer;
|
|
79
|
+
}
|
|
80
|
+
begin(id) {
|
|
81
|
+
const pending = this.pending;
|
|
82
|
+
const request = pending?.request;
|
|
83
|
+
if (!pending || !request || request.id !== id)
|
|
84
|
+
throw new Error('This wallet request is no longer active.');
|
|
85
|
+
if (request.approvalStarted || request.submittedHash)
|
|
86
|
+
throw new Error('This request is already being approved. Check the original wallet window.');
|
|
87
|
+
request.approvalStarted = true;
|
|
88
|
+
// The wallet prompt is open now; give the user the full window to act on it.
|
|
89
|
+
clearTimeout(pending.timer);
|
|
90
|
+
pending.timer = this.expiry(id, APPROVAL_WINDOW_MS);
|
|
91
|
+
}
|
|
92
|
+
async complete(id, hash, error) {
|
|
93
|
+
const pending = this.pending;
|
|
94
|
+
if (!pending || pending.request.id !== id)
|
|
95
|
+
throw new Error('This wallet request is no longer active.');
|
|
96
|
+
if (pending.request.submittedHash) {
|
|
97
|
+
if (pending.request.submittedHash === hash)
|
|
98
|
+
return;
|
|
99
|
+
throw new Error('A transaction has already been submitted for this request.');
|
|
100
|
+
}
|
|
101
|
+
if (error) {
|
|
102
|
+
clearTimeout(pending.timer);
|
|
103
|
+
this.pending = null;
|
|
104
|
+
pending.reject(new Error(safeWalletFailure(error)));
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
if (!hash || !/^0x[0-9a-fA-F]{64}$/.test(hash))
|
|
108
|
+
throw new Error('Invalid transaction hash.');
|
|
109
|
+
pending.request.submittedHash = hash;
|
|
110
|
+
clearTimeout(pending.timer);
|
|
111
|
+
// Keep HTTP acknowledgment short; the job continues only after chain verification.
|
|
112
|
+
void (async () => {
|
|
113
|
+
try {
|
|
114
|
+
const receipt = await this.awaitReceipt(pending.provider, hash);
|
|
115
|
+
if (!receipt)
|
|
116
|
+
throw new Error(`Transaction ${hash} was not confirmed within 30 minutes. It may still be pending in your wallet; check it there before retrying. Nothing was automatically resubmitted.`);
|
|
117
|
+
const tx = await this.lookupTransaction(pending.provider, hash);
|
|
118
|
+
const expected = pending.request;
|
|
119
|
+
if (!tx)
|
|
120
|
+
throw new Error(`Transaction ${hash} confirmed but could not be read back from the RPC endpoints. Check it in the explorer before retrying.`);
|
|
121
|
+
const sameSender = tx.nonce >= pending.nonceFloor && tx.chainId === BigInt(expected.chainId) && getAddress(tx.from) === expected.from;
|
|
122
|
+
const verbatim = sameSender && !!tx.to && getAddress(tx.to) === expected.to && tx.data.toLowerCase() === expected.data.toLowerCase() && tx.value === BigInt(expected.value);
|
|
123
|
+
// An EIP-7702 smart account (MetaMask's delegator) routes the call through its delegation
|
|
124
|
+
// framework, so the outer transaction targets that framework instead of our contract.
|
|
125
|
+
// Accept it when the same account sent it and the reviewed contract emitted an event in the receipt.
|
|
126
|
+
if (!verbatim && !(sameSender && await isDelegatedAccount(pending.provider, expected.from) && receipt.logs.some(log => getAddress(log.address) === expected.to))) {
|
|
127
|
+
throw new Error('Submitted transaction does not match the reviewed wallet request.');
|
|
128
|
+
}
|
|
129
|
+
if (receipt.status !== 1)
|
|
130
|
+
throw new Error('Transaction failed on-chain. Check the transaction before retrying.');
|
|
131
|
+
pending.resolve(tx);
|
|
132
|
+
}
|
|
133
|
+
catch (err) {
|
|
134
|
+
pending.reject(err instanceof Error ? err : new Error(String(err)));
|
|
135
|
+
}
|
|
136
|
+
finally {
|
|
137
|
+
if (this.pending === pending)
|
|
138
|
+
this.pending = null;
|
|
139
|
+
}
|
|
140
|
+
})();
|
|
141
|
+
}
|
|
142
|
+
/** ethers 6 rejects with TIMEOUT rather than resolving null; keep polling in slices while the transaction may still land. */
|
|
143
|
+
async awaitReceipt(provider, hash) {
|
|
144
|
+
const deadline = Date.now() + CONFIRMATION_MAX_MS;
|
|
145
|
+
while (Date.now() < deadline) {
|
|
146
|
+
try {
|
|
147
|
+
const receipt = await provider.waitForTransaction(hash, 1, Math.min(CONFIRMATION_SLICE_MS, deadline - Date.now()));
|
|
148
|
+
if (receipt)
|
|
149
|
+
return receipt;
|
|
150
|
+
}
|
|
151
|
+
catch (err) {
|
|
152
|
+
if (!isTimeout(err))
|
|
153
|
+
throw err;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return null;
|
|
157
|
+
}
|
|
158
|
+
/** A fallback endpoint can lag the one that served the receipt; a missing transaction is retried, not treated as forged. */
|
|
159
|
+
async lookupTransaction(provider, hash) {
|
|
160
|
+
for (let attempt = 1;; attempt++) {
|
|
161
|
+
const tx = await provider.getTransaction(hash);
|
|
162
|
+
if (tx || attempt >= TRANSACTION_LOOKUP_ATTEMPTS)
|
|
163
|
+
return tx;
|
|
164
|
+
await sleep(TRANSACTION_LOOKUP_DELAY_MS);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
class BrowserSigner extends AbstractSigner {
|
|
169
|
+
address;
|
|
170
|
+
bridge;
|
|
171
|
+
generation;
|
|
172
|
+
constructor(address, provider, bridge, generation) {
|
|
173
|
+
super(provider);
|
|
174
|
+
this.address = address;
|
|
175
|
+
this.bridge = bridge;
|
|
176
|
+
this.generation = generation;
|
|
177
|
+
}
|
|
178
|
+
getAddress() { return Promise.resolve(this.address); }
|
|
179
|
+
connect(provider) {
|
|
180
|
+
if (!provider)
|
|
181
|
+
throw new Error('Browser signing requires a provider.');
|
|
182
|
+
return new BrowserSigner(this.address, provider, this.bridge, this.generation);
|
|
183
|
+
}
|
|
184
|
+
signTransaction(_tx) { return Promise.reject(new Error('Use wallet transaction approval.')); }
|
|
185
|
+
signMessage(_message) { return Promise.reject(new Error('Arbitrary message signing is not supported.')); }
|
|
186
|
+
signTypedData(_domain, _types, _value) { return Promise.reject(new Error('Use the existing wallet authorization flow.')); }
|
|
187
|
+
sendTransaction(tx) { return this.bridge.send(this.address, this.provider, this.generation, tx); }
|
|
188
|
+
}
|
|
189
|
+
//# sourceMappingURL=browser-signer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-signer.js","sourceRoot":"","sources":["../src/browser-signer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,OAAO,EAAE,iBAAiB,EAAwI,MAAM,QAAQ,CAAC;AAEtN,SAAS,SAAS,CAAC,GAAY;IAC7B,OAAO,OAAO,CAAC,GAAG,EAAE,SAAS,CAAC,IAAI,CAAC,GAAG,YAAY,KAAK,IAAI,UAAU,C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,YAAO,GAAP,OAAO,CAAQ;QAAuC,WAAM,GAAN,MAAM,CAAgB;QAAmB,eAAU,GAAV,UAAU,CAAQ;IAAqB,CAAC;IACpK,UAAU,KAAsB,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACvE,OAAO,CAAC,QAAyB;QAC/B,IAAI,CAAC,QAAQ;YAAE,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;QACvE,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IACjF,CAAC;IACD,eAAe,CAAC,GAAuB,IAAqB,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC,CAAC,CAAC,CAAC;IACnI,WAAW,CAAC,QAA6B,IAAqB,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC,CAAC,CAAC,CAAC;IAChJ,aAAa,CAAC,OAAwB,EAAE,MAAwC,EAAE,MAA+B,IAAqB,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/M,eAAe,CAAC,EAAsB,IAAkC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,QAAS,EAAE,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;CAC/J"}
|
package/dist/jobs.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { JobView } from './api-types.js';
|
|
2
2
|
import type { StepReporter } from './service/steps.js';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Job runner with optional activity persistence for multi-transaction actions. The dashboard starts a
|
|
5
5
|
* job, then polls it for step-by-step progress (transaction hashes included)
|
|
6
6
|
* instead of holding one HTTP request open across several confirmations.
|
|
7
7
|
*/
|
|
@@ -9,14 +9,21 @@ export declare class JobRunner {
|
|
|
9
9
|
private readonly options;
|
|
10
10
|
private readonly jobs;
|
|
11
11
|
private active;
|
|
12
|
+
private acceptingWrites;
|
|
12
13
|
/** `onFinish` runs after every job, successful or not, before its final status is visible. */
|
|
13
14
|
constructor(options?: {
|
|
14
15
|
onFinish?: () => void;
|
|
16
|
+
journalPath?: string;
|
|
15
17
|
});
|
|
16
|
-
|
|
18
|
+
private persist;
|
|
19
|
+
/** All jobs, or only those started for `owner` (case-insensitive address match). */
|
|
20
|
+
list(owner?: string): JobView[];
|
|
17
21
|
get(id: string): JobView | undefined;
|
|
22
|
+
get busy(): boolean;
|
|
23
|
+
/** Atomically stop new jobs before replacing a wallet or network. */
|
|
24
|
+
pauseWrites(): void;
|
|
18
25
|
/** Run `work` as a job. Only one signing job runs at a time so nonces stay ordered. */
|
|
19
|
-
start(kind: string, work: (report: StepReporter) => Promise<unknown
|
|
26
|
+
start(kind: string, work: (report: StepReporter) => Promise<unknown>, owner?: string): JobView;
|
|
20
27
|
private prune;
|
|
21
28
|
}
|
|
22
29
|
/** Turn ethers/RPC errors into one readable line. */
|