@tempoxyz/id 0.0.0-stage → 0.0.1
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 +121 -2
- package/dist/App.d.ts +121 -0
- package/dist/App.d.ts.map +1 -0
- package/dist/App.js +132 -0
- package/dist/App.js.map +1 -0
- package/dist/app/client/.assetsignore +2 -0
- package/dist/app/client/_headers +4 -0
- package/dist/app/client/assets/Account-BYLpNFf3.css +1 -0
- package/dist/app/client/assets/Account-BllJah07.js +1 -0
- package/dist/app/client/assets/Amount-E_7snI0-.js +1 -0
- package/dist/app/client/assets/Amount-ZdtluGf-.css +1 -0
- package/dist/app/client/assets/Approval-CgV5JHlb.css +1 -0
- package/dist/app/client/assets/Approval-yKflypU2.js +1 -0
- package/dist/app/client/assets/ArrowUp-CRvqfMNU.js +1 -0
- package/dist/app/client/assets/Authentication-BAXhOh_4.js +2 -0
- package/dist/app/client/assets/BRLA-CZvVDNYr.png +0 -0
- package/dist/app/client/assets/BRZ-Cn3jEi9t.svg +1 -0
- package/dist/app/client/assets/CHFAU-DCedc4aH.png +0 -0
- package/dist/app/client/assets/Callout-B736759d.js +1 -0
- package/dist/app/client/assets/Callout-DBfEmP7q.css +1 -0
- package/dist/app/client/assets/Check-DVgD8tDG.js +1 -0
- package/dist/app/client/assets/ChevronRight-CsXtIZCB.js +1 -0
- package/dist/app/client/assets/ChooseAccount-BjxfQjPK.js +1 -0
- package/dist/app/client/assets/ChooseAccount-DL3wgJhE.css +1 -0
- package/dist/app/client/assets/Client-JrABNovb.js +1 -0
- package/dist/app/client/assets/Close-CRvWlhqc.js +1 -0
- package/dist/app/client/assets/Cloud-DgJsrqpQ.js +1 -0
- package/dist/app/client/assets/CodeInput-79Ctx8ZA.js +1 -0
- package/dist/app/client/assets/CodeInput-BqRteSwD.css +1 -0
- package/dist/app/client/assets/DLUSD-BnRXm3EI.png +0 -0
- package/dist/app/client/assets/Deposit-CclrAoXL.css +1 -0
- package/dist/app/client/assets/Deposit-c7uYn2Eb.js +1 -0
- package/dist/app/client/assets/DevTools-BYkmtuV5.css +1 -0
- package/dist/app/client/assets/DevTools-BgnzDGo2.js +1 -0
- package/dist/app/client/assets/DeviceApproval-BBUVv58e.js +1 -0
- package/dist/app/client/assets/DeviceApproval-BffFLD8F.css +1 -0
- package/dist/app/client/assets/EURAU-sjieTTB9.svg +1 -0
- package/dist/app/client/assets/EURC.e-CxYiiwkz.svg +1 -0
- package/dist/app/client/assets/Fingerprint-BNCA6qOJ.js +1 -0
- package/dist/app/client/assets/GBPA-DI_25xSG.svg +4 -0
- package/dist/app/client/assets/GUSD-BDEP2Qb-.svg +1 -0
- package/dist/app/client/assets/GeistMono-Variable-BRXCGrxA.woff2 +0 -0
- package/dist/app/client/assets/Globe-f0eWzcEI.js +1 -0
- package/dist/app/client/assets/Grant-5a-n1gJH.css +1 -0
- package/dist/app/client/assets/Grant-Dp7mpcEi.js +1 -0
- package/dist/app/client/assets/Hex-C9KeV7_9.css +1 -0
- package/dist/app/client/assets/Hex-CSp2U46W.js +10 -0
- package/dist/app/client/assets/IconChip-DpZHa1JW.js +1 -0
- package/dist/app/client/assets/IconChip-yqaQ2y_d.css +1 -0
- package/dist/app/client/assets/InputGroup-BlZvt9In.css +1 -0
- package/dist/app/client/assets/InputGroup-CsOeBnpB.js +1 -0
- package/dist/app/client/assets/Inter-cyrillic-e3OmmzmJ.woff2 +0 -0
- package/dist/app/client/assets/Inter-cyrillic-ext-DOWZeO4Q.woff2 +0 -0
- package/dist/app/client/assets/Inter-greek-BD3ujQlX.woff2 +0 -0
- package/dist/app/client/assets/Inter-greek-ext-CXEwbus4.woff2 +0 -0
- package/dist/app/client/assets/Inter-latin-BDFm4vTb.woff2 +0 -0
- package/dist/app/client/assets/Inter-latin-ext-E7a9JEPe.woff2 +0 -0
- package/dist/app/client/assets/Inter-symbols-DEch7Rxr.woff2 +0 -0
- package/dist/app/client/assets/Inter-vietnamese-Bg9723vR.woff2 +0 -0
- package/dist/app/client/assets/Loader-Cm9YJNNJ.js +1 -0
- package/dist/app/client/assets/MACH-sK0r79kQ.svg +4 -0
- package/dist/app/client/assets/OUSD-BFXgVo-Z.svg +5 -0
- package/dist/app/client/assets/OUSD.dark-BbbjMvA1.svg +17 -0
- package/dist/app/client/assets/OUSD.light-B_zpSz_c.svg +17 -0
- package/dist/app/client/assets/PRIME-CiFp2-3e.svg +14 -0
- package/dist/app/client/assets/PopoverPopup-DprRXRQe.js +1 -0
- package/dist/app/client/assets/Rows-DPGTUdA8.css +1 -0
- package/dist/app/client/assets/Rows-Qqo3evtk.js +1 -0
- package/dist/app/client/assets/SBC-BTYkbkiD.svg +1 -0
- package/dist/app/client/assets/SEKAU-CB5Fc6o8.svg +5 -0
- package/dist/app/client/assets/Separator-CZUjVQOL.js +1 -0
- package/dist/app/client/assets/SignIn-HdaDzFmq.js +1 -0
- package/dist/app/client/assets/SignIn-mlBTwUq4.css +1 -0
- package/dist/app/client/assets/Stack-CkkvkOzj.js +1 -0
- package/dist/app/client/assets/Stack-D7Yt22Ed.css +1 -0
- package/dist/app/client/assets/Tag-BMh6ajrW.css +1 -0
- package/dist/app/client/assets/Tag-CLOVANTX.js +1 -0
- package/dist/app/client/assets/ToolbarRootContext-Zty_Dh3J.js +1 -0
- package/dist/app/client/assets/Tooltip-CLATV6YU.js +1 -0
- package/dist/app/client/assets/Tooltip-d3y9ESUJ.css +1 -0
- package/dist/app/client/assets/USD1-COVcO_PB.svg +30 -0
- package/dist/app/client/assets/USDB-Ckwb6UQw.svg +11 -0
- package/dist/app/client/assets/USDC.e-3nMsKAMC.svg +1 -0
- package/dist/app/client/assets/USDT0-ia60Dw0e.svg +1 -0
- package/dist/app/client/assets/USDY-CB4iet2q.svg +16 -0
- package/dist/app/client/assets/USDe-BXHQCd92.svg +1 -0
- package/dist/app/client/assets/Upgrade-D0_aO5AP.js +1 -0
- package/dist/app/client/assets/WalletUpgrade-BPsPNQsd.js +1 -0
- package/dist/app/client/assets/WalletUpgrade-C04kW0Jl.css +1 -0
- package/dist/app/client/assets/YLDS-CRh8Zw0g.svg +3 -0
- package/dist/app/client/assets/___-I98bns4o.css +1 -0
- package/dist/app/client/assets/___.flows-XOlLwMIy.js +5 -0
- package/dist/app/client/assets/alphaUSD-CpCFoVuh.svg +1 -0
- package/dist/app/client/assets/authorize-C-MlCyaM.js +1 -0
- package/dist/app/client/assets/betaUSD-9A8AjgYg.svg +1 -0
- package/dist/app/client/assets/cUSD-WsQfa-iC.svg +1 -0
- package/dist/app/client/assets/cbBTC-DvUDqrDi.svg +1 -0
- package/dist/app/client/assets/choose-account-nXR-SKa2.js +1 -0
- package/dist/app/client/assets/deposit-G8tiLPN4.js +1 -0
- package/dist/app/client/assets/device-BojBF7hZ.js +1 -0
- package/dist/app/client/assets/error-KiOpX7GD.js +1 -0
- package/dist/app/client/assets/frxUSD-n9pTpinR.svg +1 -0
- package/dist/app/client/assets/getPseudoElementBounds-BsLy4zf_.js +1 -0
- package/dist/app/client/assets/goUSD-D9kUvHsF.svg +5 -0
- package/dist/app/client/assets/iUSD-CWCJAq9X.svg +1 -0
- package/dist/app/client/assets/index-BZH0M7Nf.js +13 -0
- package/dist/app/client/assets/index-CIYxHmYA.css +1 -0
- package/dist/app/client/assets/login-DUjpk60p.js +1 -0
- package/dist/app/client/assets/pathUSD-BvaO6ooS.svg +25 -0
- package/dist/app/client/assets/preload-helper-Bs9KvdYl.js +1 -0
- package/dist/app/client/assets/rUSD-B-xuFS7T.svg +1 -0
- package/dist/app/client/assets/reUSD-CkIUs0Lx.svg +1 -0
- package/dist/app/client/assets/removable-DMiA3t_o.js +1 -0
- package/dist/app/client/assets/reset-co-CHrff.css +1 -0
- package/dist/app/client/assets/rolldown-runtime-WkwZ5CU-.js +1 -0
- package/dist/app/client/assets/routes-CK8cthzA.js +1 -0
- package/dist/app/client/assets/sUSDe-j9GOnH7I.svg +1 -0
- package/dist/app/client/assets/siUSD-C10QUNYS.svg +1 -0
- package/dist/app/client/assets/stcUSD-DIntDJeh.svg +1 -0
- package/dist/app/client/assets/syrupUSDC-DhYwZqdM.svg +5 -0
- package/dist/app/client/assets/thetaUSD-Dgmksf6G.svg +1 -0
- package/dist/app/client/assets/useNavigate-CB6S2u4J.js +1 -0
- package/dist/app/client/assets/useQuery-BpHfPhTT.js +1 -0
- package/dist/app/client/assets/useRegisterFieldControl-DsslqY-V.js +1 -0
- package/dist/app/client/assets/wYLDS-CaCKDrO-.svg +10 -0
- package/dist/app/client/assets/wsrUSD-B2Ey0bDQ.svg +1 -0
- package/dist/app/client/assets/zyzz-DYC-X0_B.css +1 -0
- package/dist/app/client/assets/zyzz.config-DX_D_7j3.js +2 -0
- package/dist/app/db/auth.d.ts +3412 -0
- package/dist/app/db/auth.d.ts.map +1 -0
- package/dist/app/db/auth.js +349 -0
- package/dist/app/db/auth.js.map +1 -0
- package/dist/app/db/schema.d.ts +1091 -0
- package/dist/app/db/schema.d.ts.map +1 -0
- package/dist/app/db/schema.js +183 -0
- package/dist/app/db/schema.js.map +1 -0
- package/dist/app/db/table.d.ts +8 -0
- package/dist/app/db/table.d.ts.map +1 -0
- package/dist/app/db/table.js +28 -0
- package/dist/app/db/table.js.map +1 -0
- package/dist/app/server/.vite/manifest.json +2093 -0
- package/dist/app/server/assets/Account-BYLpNFf3.css +1 -0
- package/dist/app/server/assets/Account-G_SUeRU3.js +2 -0
- package/dist/app/server/assets/Account-G_SUeRU3.js.map +1 -0
- package/dist/app/server/assets/Amount-Cgwdr3Xt.js +2 -0
- package/dist/app/server/assets/Amount-Cgwdr3Xt.js.map +1 -0
- package/dist/app/server/assets/Amount-ZdtluGf-.css +1 -0
- package/dist/app/server/assets/Approval-CgV5JHlb.css +1 -0
- package/dist/app/server/assets/Approval-DvkB9tWA.js +2 -0
- package/dist/app/server/assets/Approval-DvkB9tWA.js.map +1 -0
- package/dist/app/server/assets/ArrowUp-DpK_zNgZ.js +2 -0
- package/dist/app/server/assets/ArrowUp-DpK_zNgZ.js.map +1 -0
- package/dist/app/server/assets/Authentication-BOkhlNQu.js +2 -0
- package/dist/app/server/assets/Authentication-BOkhlNQu.js.map +1 -0
- package/dist/app/server/assets/Authentication-C3oNZAVX.js +2 -0
- package/dist/app/server/assets/Authentication-C3oNZAVX.js.map +1 -0
- package/dist/app/server/assets/BRLA-CZvVDNYr.png +0 -0
- package/dist/app/server/assets/BRZ-Cn3jEi9t.svg +1 -0
- package/dist/app/server/assets/Bytes-C7CRVS3J.js +4 -0
- package/dist/app/server/assets/Bytes-C7CRVS3J.js.map +1 -0
- package/dist/app/server/assets/CHFAU-DCedc4aH.png +0 -0
- package/dist/app/server/assets/Callout-DBfEmP7q.css +1 -0
- package/dist/app/server/assets/Callout-tQoAitWq.js +2 -0
- package/dist/app/server/assets/Callout-tQoAitWq.js.map +1 -0
- package/dist/app/server/assets/ChainList-C4A_7e-9.js +6 -0
- package/dist/app/server/assets/ChainList-C4A_7e-9.js.map +1 -0
- package/dist/app/server/assets/ChainName-BMnJyJrd.js +2 -0
- package/dist/app/server/assets/ChainName-BMnJyJrd.js.map +1 -0
- package/dist/app/server/assets/Check-DU_oR3Ev.js +2 -0
- package/dist/app/server/assets/Check-DU_oR3Ev.js.map +1 -0
- package/dist/app/server/assets/ChevronRight-DTBnw-W6.js +2 -0
- package/dist/app/server/assets/ChevronRight-DTBnw-W6.js.map +1 -0
- package/dist/app/server/assets/ChooseAccount-BizJvMrY.js +2 -0
- package/dist/app/server/assets/ChooseAccount-BizJvMrY.js.map +1 -0
- package/dist/app/server/assets/ChooseAccount-DL3wgJhE.css +1 -0
- package/dist/app/server/assets/Client-Dx3KrpJZ.js +2 -0
- package/dist/app/server/assets/Client-Dx3KrpJZ.js.map +1 -0
- package/dist/app/server/assets/ClientOnly-CKLiu67O.js +2 -0
- package/dist/app/server/assets/ClientOnly-CKLiu67O.js.map +1 -0
- package/dist/app/server/assets/Close-DUeE37ev.js +2 -0
- package/dist/app/server/assets/Close-DUeE37ev.js.map +1 -0
- package/dist/app/server/assets/Cloud-CLB3rTTy.js +2 -0
- package/dist/app/server/assets/Cloud-CLB3rTTy.js.map +1 -0
- package/dist/app/server/assets/CodeInput-BqRteSwD.css +1 -0
- package/dist/app/server/assets/CodeInput-FsPzVuLU.js +2 -0
- package/dist/app/server/assets/CodeInput-FsPzVuLU.js.map +1 -0
- package/dist/app/server/assets/Credential-DFjcrdyI.js +2 -0
- package/dist/app/server/assets/Credential-DFjcrdyI.js.map +1 -0
- package/dist/app/server/assets/DLUSD-BnRXm3EI.png +0 -0
- package/dist/app/server/assets/Deposit-CclrAoXL.css +1 -0
- package/dist/app/server/assets/Deposit-ChYGRfW2.js +2 -0
- package/dist/app/server/assets/Deposit-ChYGRfW2.js.map +1 -0
- package/dist/app/server/assets/DevTools-BYkmtuV5.css +1 -0
- package/dist/app/server/assets/DevTools-ZJVXqrIK.js +2 -0
- package/dist/app/server/assets/DevTools-ZJVXqrIK.js.map +1 -0
- package/dist/app/server/assets/DeviceApproval-BffFLD8F.css +1 -0
- package/dist/app/server/assets/DeviceApproval-Bqe3Mi78.js +2 -0
- package/dist/app/server/assets/DeviceApproval-Bqe3Mi78.js.map +1 -0
- package/dist/app/server/assets/EURAU-sjieTTB9.svg +1 -0
- package/dist/app/server/assets/EURC.e-CxYiiwkz.svg +1 -0
- package/dist/app/server/assets/ExecutionError-CDszGSF1.js +9 -0
- package/dist/app/server/assets/ExecutionError-CDszGSF1.js.map +1 -0
- package/dist/app/server/assets/Fingerprint-DhOPOdRr.js +2 -0
- package/dist/app/server/assets/Fingerprint-DhOPOdRr.js.map +1 -0
- package/dist/app/server/assets/GBPA-DI_25xSG.svg +4 -0
- package/dist/app/server/assets/GUSD-BDEP2Qb-.svg +1 -0
- package/dist/app/server/assets/GeistMono-Variable-BRXCGrxA.woff2 +0 -0
- package/dist/app/server/assets/Globe-2CxqxU-7.js +2 -0
- package/dist/app/server/assets/Globe-2CxqxU-7.js.map +1 -0
- package/dist/app/server/assets/Grant-5a-n1gJH.css +1 -0
- package/dist/app/server/assets/Grant-D_tun0mF.js +2 -0
- package/dist/app/server/assets/Grant-D_tun0mF.js.map +1 -0
- package/dist/app/server/assets/Hex-C9KeV7_9.css +1 -0
- package/dist/app/server/assets/Hex-Z6m_0Y0m.js +11 -0
- package/dist/app/server/assets/Hex-Z6m_0Y0m.js.map +1 -0
- package/dist/app/server/assets/IconChip-C9ZrmGB5.js +2 -0
- package/dist/app/server/assets/IconChip-C9ZrmGB5.js.map +1 -0
- package/dist/app/server/assets/IconChip-yqaQ2y_d.css +1 -0
- package/dist/app/server/assets/InputGroup-BlZvt9In.css +1 -0
- package/dist/app/server/assets/InputGroup-hpjuLuR7.js +2 -0
- package/dist/app/server/assets/InputGroup-hpjuLuR7.js.map +1 -0
- package/dist/app/server/assets/Inter-cyrillic-e3OmmzmJ.woff2 +0 -0
- package/dist/app/server/assets/Inter-cyrillic-ext-DOWZeO4Q.woff2 +0 -0
- package/dist/app/server/assets/Inter-greek-BD3ujQlX.woff2 +0 -0
- package/dist/app/server/assets/Inter-greek-ext-CXEwbus4.woff2 +0 -0
- package/dist/app/server/assets/Inter-latin-BDFm4vTb.woff2 +0 -0
- package/dist/app/server/assets/Inter-latin-ext-E7a9JEPe.woff2 +0 -0
- package/dist/app/server/assets/Inter-symbols-DEch7Rxr.woff2 +0 -0
- package/dist/app/server/assets/Inter-vietnamese-Bg9723vR.woff2 +0 -0
- package/dist/app/server/assets/Loader-DnKC9P5p.js +2 -0
- package/dist/app/server/assets/Loader-DnKC9P5p.js.map +1 -0
- package/dist/app/server/assets/MACH-sK0r79kQ.svg +4 -0
- package/dist/app/server/assets/Match-CyVdYcSf.js +2 -0
- package/dist/app/server/assets/Match-CyVdYcSf.js.map +1 -0
- package/dist/app/server/assets/OUSD-BFXgVo-Z.svg +5 -0
- package/dist/app/server/assets/OUSD.dark-BbbjMvA1.svg +17 -0
- package/dist/app/server/assets/OUSD.light-B_zpSz_c.svg +17 -0
- package/dist/app/server/assets/PRIME-CiFp2-3e.svg +14 -0
- package/dist/app/server/assets/PopoverPopup-CwqeQelI.js +2 -0
- package/dist/app/server/assets/PopoverPopup-CwqeQelI.js.map +1 -0
- package/dist/app/server/assets/Rows-CQKQwTI1.js +2 -0
- package/dist/app/server/assets/Rows-CQKQwTI1.js.map +1 -0
- package/dist/app/server/assets/Rows-DPGTUdA8.css +1 -0
- package/dist/app/server/assets/SBC-BTYkbkiD.svg +1 -0
- package/dist/app/server/assets/SEKAU-CB5Fc6o8.svg +5 -0
- package/dist/app/server/assets/Separator-DrI7KRAs.js +2 -0
- package/dist/app/server/assets/Separator-DrI7KRAs.js.map +1 -0
- package/dist/app/server/assets/SignIn-DfeeLEmN.js +2 -0
- package/dist/app/server/assets/SignIn-DfeeLEmN.js.map +1 -0
- package/dist/app/server/assets/SignIn-mlBTwUq4.css +1 -0
- package/dist/app/server/assets/Stack-D7Yt22Ed.css +1 -0
- package/dist/app/server/assets/Stack-DGktaLZc.js +2 -0
- package/dist/app/server/assets/Stack-DGktaLZc.js.map +1 -0
- package/dist/app/server/assets/Tag-9vSRBpph.js +2 -0
- package/dist/app/server/assets/Tag-9vSRBpph.js.map +1 -0
- package/dist/app/server/assets/Tag-BMh6ajrW.css +1 -0
- package/dist/app/server/assets/ToolbarRootContext-BH_CFSWd.js +2 -0
- package/dist/app/server/assets/ToolbarRootContext-BH_CFSWd.js.map +1 -0
- package/dist/app/server/assets/Tooltip-DLX41peb.js +2 -0
- package/dist/app/server/assets/Tooltip-DLX41peb.js.map +1 -0
- package/dist/app/server/assets/Tooltip-d3y9ESUJ.css +1 -0
- package/dist/app/server/assets/USD1-COVcO_PB.svg +30 -0
- package/dist/app/server/assets/USDB-Ckwb6UQw.svg +11 -0
- package/dist/app/server/assets/USDC.e-3nMsKAMC.svg +1 -0
- package/dist/app/server/assets/USDT0-ia60Dw0e.svg +1 -0
- package/dist/app/server/assets/USDY-CB4iet2q.svg +16 -0
- package/dist/app/server/assets/USDe-BXHQCd92.svg +1 -0
- package/dist/app/server/assets/Upgrade-Dbfm2nm0.js +2 -0
- package/dist/app/server/assets/Upgrade-Dbfm2nm0.js.map +1 -0
- package/dist/app/server/assets/WalletUpgrade-C04kW0Jl.css +1 -0
- package/dist/app/server/assets/WalletUpgrade-CWKc5fYt.js +2 -0
- package/dist/app/server/assets/WalletUpgrade-CWKc5fYt.js.map +1 -0
- package/dist/app/server/assets/YLDS-CRh8Zw0g.svg +3 -0
- package/dist/app/server/assets/___-I98bns4o.css +1 -0
- package/dist/app/server/assets/___.flows-Cc-awUoC.js +6 -0
- package/dist/app/server/assets/___.flows-Cc-awUoC.js.map +1 -0
- package/dist/app/server/assets/_tanstack-start-manifest_v-U7TrtUSA.js +1 -0
- package/dist/app/server/assets/_zyzz__2Fhome_2Frunner_2Fwork_2Fid_2Fid_2Fsrc_2Fapp_2Froutes_2F_5B__5D.flows-B1pPOqsM.css +1 -0
- package/dist/app/server/assets/_zyzz__2Fhome_2Frunner_2Fwork_2Fid_2Fid_2Fsrc_2Fapp_2Froutes_2F_5B__5D.flows.tsx-CKALi9oD.js +2 -0
- package/dist/app/server/assets/_zyzz__2Fhome_2Frunner_2Fwork_2Fid_2Fid_2Fsrc_2Fapp_2Froutes_2F_5B__5D.flows.tsx-CKALi9oD.js.map +1 -0
- package/dist/app/server/assets/_zyzz_shared-BbDIEd_j.css +1 -0
- package/dist/app/server/assets/alphaUSD-CpCFoVuh.svg +1 -0
- package/dist/app/server/assets/arktype-aI7TBD0R-D1R3Byo5.js +2 -0
- package/dist/app/server/assets/arktype-aI7TBD0R-D1R3Byo5.js.map +1 -0
- package/dist/app/server/assets/async-local-storage-DlOvwxXd.js +2 -0
- package/dist/app/server/assets/async-local-storage-DlOvwxXd.js.map +1 -0
- package/dist/app/server/assets/authorize-BXzTo2Pb.js +2 -0
- package/dist/app/server/assets/authorize-BXzTo2Pb.js.map +1 -0
- package/dist/app/server/assets/authorize-BzoUqOdA.js +2 -0
- package/dist/app/server/assets/authorize-BzoUqOdA.js.map +1 -0
- package/dist/app/server/assets/authorize-DXYo-K2n-rmQQ42x1.js +56 -0
- package/dist/app/server/assets/authorize-DXYo-K2n-rmQQ42x1.js.map +1 -0
- package/dist/app/server/assets/authorize-DfjPYJqS.css +1 -0
- package/dist/app/server/assets/betaUSD-9A8AjgYg.svg +1 -0
- package/dist/app/server/assets/bun-sqlite-dialect-DoOVo4ja-CtyBkVMb.js +2 -0
- package/dist/app/server/assets/bun-sqlite-dialect-DoOVo4ja-CtyBkVMb.js.map +1 -0
- package/dist/app/server/assets/cUSD-WsQfa-iC.svg +1 -0
- package/dist/app/server/assets/call-dzi0xjZd.js +31 -0
- package/dist/app/server/assets/call-dzi0xjZd.js.map +1 -0
- package/dist/app/server/assets/cbBTC-DvUDqrDi.svg +1 -0
- package/dist/app/server/assets/ccip-DjD8z_3B.js +2 -0
- package/dist/app/server/assets/ccip-DjD8z_3B.js.map +1 -0
- package/dist/app/server/assets/choose-account-_X7xq5am.js +2 -0
- package/dist/app/server/assets/choose-account-_X7xq5am.js.map +1 -0
- package/dist/app/server/assets/choose-account-lqA5SLx9.css +1 -0
- package/dist/app/server/assets/choose-account-zm-5Qs3e.js +2 -0
- package/dist/app/server/assets/choose-account-zm-5Qs3e.js.map +1 -0
- package/dist/app/server/assets/compiled-query-Ds2NVcFT.js +2 -0
- package/dist/app/server/assets/compiled-query-Ds2NVcFT.js.map +1 -0
- package/dist/app/server/assets/convert-BIC8n32x.js +2 -0
- package/dist/app/server/assets/convert-BIC8n32x.js.map +1 -0
- package/dist/app/server/assets/cookie-DxViaO10.js +2 -0
- package/dist/app/server/assets/cookie-DxViaO10.js.map +1 -0
- package/dist/app/server/assets/core-BBrZXfrB.js +56 -0
- package/dist/app/server/assets/core-BBrZXfrB.js.map +1 -0
- package/dist/app/server/assets/d1-sqlite-dialect-m0f01-4z-Cv-csE1u.js +2 -0
- package/dist/app/server/assets/d1-sqlite-dialect-m0f01-4z-Cv-csE1u.js.map +1 -0
- package/dist/app/server/assets/decodeFunctionData-bP6V2ai4.js +2 -0
- package/dist/app/server/assets/decodeFunctionData-bP6V2ai4.js.map +1 -0
- package/dist/app/server/assets/default-u_dwuiYb-DOrMMcg9.js +2 -0
- package/dist/app/server/assets/default-u_dwuiYb-DOrMMcg9.js.map +1 -0
- package/dist/app/server/assets/deposit-BBaNI01u.js +2 -0
- package/dist/app/server/assets/deposit-BBaNI01u.js.map +1 -0
- package/dist/app/server/assets/deposit-LWS6ZTuf.js +2 -0
- package/dist/app/server/assets/deposit-LWS6ZTuf.js.map +1 -0
- package/dist/app/server/assets/deposit-oFx15XCA.css +1 -0
- package/dist/app/server/assets/device-CrXlusjr.js +2 -0
- package/dist/app/server/assets/device-CrXlusjr.js.map +1 -0
- package/dist/app/server/assets/device-DdFMgYe2.js +2 -0
- package/dist/app/server/assets/device-DdFMgYe2.js.map +1 -0
- package/dist/app/server/assets/device-tMCpu5zk.css +1 -0
- package/dist/app/server/assets/dist-CR6FW-yS.js +1 -0
- package/dist/app/server/assets/dist-CoH0hD1s.js +15 -0
- package/dist/app/server/assets/dist-CoH0hD1s.js.map +1 -0
- package/dist/app/server/assets/dist-DcICI3fd.js +2 -0
- package/dist/app/server/assets/dist-DcICI3fd.js.map +1 -0
- package/dist/app/server/assets/effect-QlVUlMFu-mXPkuQTb.js +2 -0
- package/dist/app/server/assets/effect-QlVUlMFu-mXPkuQTb.js.map +1 -0
- package/dist/app/server/assets/empty-plugin-adapters-BaGcmrjC.js +2 -0
- package/dist/app/server/assets/empty-plugin-adapters-BaGcmrjC.js.map +1 -0
- package/dist/app/server/assets/error-CXy8gqdE.css +1 -0
- package/dist/app/server/assets/error-DXDT2AHy.js +2 -0
- package/dist/app/server/assets/error-DXDT2AHy.js.map +1 -0
- package/dist/app/server/assets/error-bnVzy9tx.js +2 -0
- package/dist/app/server/assets/error-bnVzy9tx.js.map +1 -0
- package/dist/app/server/assets/esm-C6SW--yt.js +4 -0
- package/dist/app/server/assets/esm-C6SW--yt.js.map +1 -0
- package/dist/app/server/assets/factory-dvoOlKer.js +5 -0
- package/dist/app/server/assets/factory-dvoOlKer.js.map +1 -0
- package/dist/app/server/assets/frxUSD-n9pTpinR.svg +1 -0
- package/dist/app/server/assets/get-id-field-OwLpfjj2.js +6 -0
- package/dist/app/server/assets/get-id-field-OwLpfjj2.js.map +1 -0
- package/dist/app/server/assets/getPseudoElementBounds-PkWU72kn.js +2 -0
- package/dist/app/server/assets/getPseudoElementBounds-PkWU72kn.js.map +1 -0
- package/dist/app/server/assets/goUSD-D9kUvHsF.svg +5 -0
- package/dist/app/server/assets/iUSD-CWCJAq9X.svg +1 -0
- package/dist/app/server/assets/index-CLddUTqr-CC33CMvS.js +2 -0
- package/dist/app/server/assets/index-CLddUTqr-CC33CMvS.js.map +1 -0
- package/dist/app/server/assets/index-DZEfthgZ-Ec2MMQ_e.js +2 -0
- package/dist/app/server/assets/index-DZEfthgZ-Ec2MMQ_e.js.map +1 -0
- package/dist/app/server/assets/kysely-adapter-B8tQwTcu.js +1 -0
- package/dist/app/server/assets/lazyRouteComponent-DPOOPZw_.js +2 -0
- package/dist/app/server/assets/lazyRouteComponent-DPOOPZw_.js.map +1 -0
- package/dist/app/server/assets/load-server-Dr0IlySo.js +3 -0
- package/dist/app/server/assets/load-server-Dr0IlySo.js.map +1 -0
- package/dist/app/server/assets/login-BLq3tEEr.js +2 -0
- package/dist/app/server/assets/login-BLq3tEEr.js.map +1 -0
- package/dist/app/server/assets/login-DCIrAbED.js +2 -0
- package/dist/app/server/assets/login-DCIrAbED.js.map +1 -0
- package/dist/app/server/assets/login-msDnt3yT.css +1 -0
- package/dist/app/server/assets/matchContext-ByrIUj4L.js +2 -0
- package/dist/app/server/assets/matchContext-ByrIUj4L.js.map +1 -0
- package/dist/app/server/assets/node-sqlite-dialect-BowWLXvK.js +2 -0
- package/dist/app/server/assets/node-sqlite-dialect-BowWLXvK.js.map +1 -0
- package/dist/app/server/assets/pathUSD-BvaO6ooS.svg +25 -0
- package/dist/app/server/assets/rUSD-B-xuFS7T.svg +1 -0
- package/dist/app/server/assets/reUSD-CkIUs0Lx.svg +1 -0
- package/dist/app/server/assets/react-dom-DYzj0HXX.js +2 -0
- package/dist/app/server/assets/react-dom-DYzj0HXX.js.map +1 -0
- package/dist/app/server/assets/removable-BCLTvPOx.js +2 -0
- package/dist/app/server/assets/removable-BCLTvPOx.js.map +1 -0
- package/dist/app/server/assets/reset-DZWeTZeQ.js +2 -0
- package/dist/app/server/assets/reset-DZWeTZeQ.js.map +1 -0
- package/dist/app/server/assets/reset-co-CHrff.css +1 -0
- package/dist/app/server/assets/resolveError-CZXXvCJR.js +2 -0
- package/dist/app/server/assets/resolveError-CZXXvCJR.js.map +1 -0
- package/dist/app/server/assets/rolldown-runtime-BWaJ3C7D.js +1 -0
- package/dist/app/server/assets/router-Bqz5X4Qw.js +2 -0
- package/dist/app/server/assets/router-Bqz5X4Qw.js.map +1 -0
- package/dist/app/server/assets/router-CclzitkY.css +1 -0
- package/dist/app/server/assets/routes-BLQdKqcZ.js +2 -0
- package/dist/app/server/assets/routes-BLQdKqcZ.js.map +1 -0
- package/dist/app/server/assets/routes-BgiIzrOt.css +1 -0
- package/dist/app/server/assets/routes-Bv6WzsSR.js +2 -0
- package/dist/app/server/assets/routes-Bv6WzsSR.js.map +1 -0
- package/dist/app/server/assets/sUSDe-j9GOnH7I.svg +1 -0
- package/dist/app/server/assets/schema-check-oLqvHR8y.js +9 -0
- package/dist/app/server/assets/schema-check-oLqvHR8y.js.map +1 -0
- package/dist/app/server/assets/secp256k1-yg8eeIYU.js +2 -0
- package/dist/app/server/assets/secp256k1-yg8eeIYU.js.map +1 -0
- package/dist/app/server/assets/server-RRUiOef2.js +76 -0
- package/dist/app/server/assets/server-RRUiOef2.js.map +1 -0
- package/dist/app/server/assets/siUSD-C10QUNYS.svg +1 -0
- package/dist/app/server/assets/sqlite-adapter-C_LAV4e3.js +2 -0
- package/dist/app/server/assets/sqlite-adapter-C_LAV4e3.js.map +1 -0
- package/dist/app/server/assets/sqlite-introspector-DSCAP82F-Crx7Ny14.js +6 -0
- package/dist/app/server/assets/sqlite-introspector-DSCAP82F-Crx7Ny14.js.map +1 -0
- package/dist/app/server/assets/standard-json-DY77efq0.js +2 -0
- package/dist/app/server/assets/standard-json-DY77efq0.js.map +1 -0
- package/dist/app/server/assets/standard-json-ig2t0wRt.js +2 -0
- package/dist/app/server/assets/standard-json-ig2t0wRt.js.map +1 -0
- package/dist/app/server/assets/standard-json-t-LNckA6.js +2 -0
- package/dist/app/server/assets/standard-json-t-LNckA6.js.map +1 -0
- package/dist/app/server/assets/standard-openapi-CONmVRl8.js +2 -0
- package/dist/app/server/assets/standard-openapi-CONmVRl8.js.map +1 -0
- package/dist/app/server/assets/start-C63VetBp.js +2 -0
- package/dist/app/server/assets/start-C63VetBp.js.map +1 -0
- package/dist/app/server/assets/stcUSD-DIntDJeh.svg +1 -0
- package/dist/app/server/assets/sury-CWZTCd75-CDaOS2oM.js +2 -0
- package/dist/app/server/assets/sury-CWZTCd75-CDaOS2oM.js.map +1 -0
- package/dist/app/server/assets/syrupUSDC-DhYwZqdM.svg +5 -0
- package/dist/app/server/assets/thetaUSD-Dgmksf6G.svg +1 -0
- package/dist/app/server/assets/typebox-Dei93FPO-D_lCVdAz.js +2 -0
- package/dist/app/server/assets/typebox-Dei93FPO-D_lCVdAz.js.map +1 -0
- package/dist/app/server/assets/useNavigate-D6d1w7KE.js +2 -0
- package/dist/app/server/assets/useNavigate-D6d1w7KE.js.map +1 -0
- package/dist/app/server/assets/useQuery-BRpCr5vj.js +2 -0
- package/dist/app/server/assets/useQuery-BRpCr5vj.js.map +1 -0
- package/dist/app/server/assets/useRegisterFieldControl-cJesrOWK.js +2 -0
- package/dist/app/server/assets/useRegisterFieldControl-cJesrOWK.js.map +1 -0
- package/dist/app/server/assets/utils-C4ZXZIZW.js +2 -0
- package/dist/app/server/assets/utils-C4ZXZIZW.js.map +1 -0
- package/dist/app/server/assets/utils-D57zfcg-.js +2 -0
- package/dist/app/server/assets/utils-D57zfcg-.js.map +1 -0
- package/dist/app/server/assets/valibot--1zFm7rT-CIKoH3MS.js +2 -0
- package/dist/app/server/assets/valibot--1zFm7rT-CIKoH3MS.js.map +1 -0
- package/dist/app/server/assets/valibot-D_HTw1Gn-BdPyLkXt.js +2 -0
- package/dist/app/server/assets/valibot-D_HTw1Gn-BdPyLkXt.js.map +1 -0
- package/dist/app/server/assets/wYLDS-CaCKDrO-.svg +10 -0
- package/dist/app/server/assets/wsrUSD-B2Ey0bDQ.svg +1 -0
- package/dist/app/server/assets/zod-Bwrt9trS-BezI5Gi1.js +2 -0
- package/dist/app/server/assets/zod-Bwrt9trS-BezI5Gi1.js.map +1 -0
- package/dist/app/server/assets/zod-DSgpEGAE-DZ7M_Q33.js +2 -0
- package/dist/app/server/assets/zod-DSgpEGAE-DZ7M_Q33.js.map +1 -0
- package/dist/app/server/assets/zyzz-6R2K52xP.css +1 -0
- package/dist/app/server/assets/zyzz.config-CJRpjn0E.js +3 -0
- package/dist/app/server/assets/zyzz.config-CJRpjn0E.js.map +1 -0
- package/dist/app/server/index.js +532 -0
- package/dist/app/server/index.js.map +1 -0
- package/dist/app/server/wrangler.json +1 -0
- package/dist/cli/Admin.d.ts +34 -0
- package/dist/cli/Admin.d.ts.map +1 -0
- package/dist/cli/Admin.js +61 -0
- package/dist/cli/Admin.js.map +1 -0
- package/dist/cli/Apps.d.ts +9 -0
- package/dist/cli/Apps.d.ts.map +1 -0
- package/dist/cli/Apps.js +34 -0
- package/dist/cli/Apps.js.map +1 -0
- package/dist/cli/Cli.d.ts +13 -0
- package/dist/cli/Cli.d.ts.map +1 -0
- package/dist/cli/Cli.js +26 -0
- package/dist/cli/Cli.js.map +1 -0
- package/dist/cli/Project.d.ts +17 -0
- package/dist/cli/Project.d.ts.map +1 -0
- package/dist/cli/Project.js +90 -0
- package/dist/cli/Project.js.map +1 -0
- package/dist/cli/Realms.d.ts +24 -0
- package/dist/cli/Realms.d.ts.map +1 -0
- package/dist/cli/Realms.js +48 -0
- package/dist/cli/Realms.js.map +1 -0
- package/dist/cli/Session.d.ts +79 -0
- package/dist/cli/Session.d.ts.map +1 -0
- package/dist/cli/Session.js +229 -0
- package/dist/cli/Session.js.map +1 -0
- package/dist/cli/User.d.ts +24 -0
- package/dist/cli/User.d.ts.map +1 -0
- package/dist/cli/User.js +34 -0
- package/dist/cli/User.js.map +1 -0
- package/dist/cli/V1.d.ts +32 -0
- package/dist/cli/V1.d.ts.map +1 -0
- package/dist/cli/V1.js +38 -0
- package/dist/cli/V1.js.map +1 -0
- package/dist/cli/bin.d.ts +3 -0
- package/dist/cli/bin.d.ts.map +1 -0
- package/dist/cli/bin.js +46 -0
- package/dist/cli/bin.js.map +1 -0
- package/dist/cli/commands/admin/apps/create.d.ts +23 -0
- package/dist/cli/commands/admin/apps/create.d.ts.map +1 -0
- package/dist/cli/commands/admin/apps/create.js +84 -0
- package/dist/cli/commands/admin/apps/create.js.map +1 -0
- package/dist/cli/commands/admin/apps/delete.d.ts +15 -0
- package/dist/cli/commands/admin/apps/delete.d.ts.map +1 -0
- package/dist/cli/commands/admin/apps/delete.js +41 -0
- package/dist/cli/commands/admin/apps/delete.js.map +1 -0
- package/dist/cli/commands/admin/apps/index.d.ts +5 -0
- package/dist/cli/commands/admin/apps/index.d.ts.map +1 -0
- package/dist/cli/commands/admin/apps/index.js +14 -0
- package/dist/cli/commands/admin/apps/index.js.map +1 -0
- package/dist/cli/commands/admin/apps/list.d.ts +10 -0
- package/dist/cli/commands/admin/apps/list.d.ts.map +1 -0
- package/dist/cli/commands/admin/apps/list.js +26 -0
- package/dist/cli/commands/admin/apps/list.js.map +1 -0
- package/dist/cli/commands/admin/apps/rotate-secret.d.ts +17 -0
- package/dist/cli/commands/admin/apps/rotate-secret.d.ts.map +1 -0
- package/dist/cli/commands/admin/apps/rotate-secret.js +47 -0
- package/dist/cli/commands/admin/apps/rotate-secret.js.map +1 -0
- package/dist/cli/commands/admin/apps/update.d.ts +20 -0
- package/dist/cli/commands/admin/apps/update.d.ts.map +1 -0
- package/dist/cli/commands/admin/apps/update.js +71 -0
- package/dist/cli/commands/admin/apps/update.js.map +1 -0
- package/dist/cli/commands/admin/index.d.ts +5 -0
- package/dist/cli/commands/admin/index.d.ts.map +1 -0
- package/dist/cli/commands/admin/index.js +13 -0
- package/dist/cli/commands/admin/index.js.map +1 -0
- package/dist/cli/commands/admin/migrate.d.ts +10 -0
- package/dist/cli/commands/admin/migrate.d.ts.map +1 -0
- package/dist/cli/commands/admin/migrate.js +20 -0
- package/dist/cli/commands/admin/migrate.js.map +1 -0
- package/dist/cli/commands/admin/realms/add.d.ts +13 -0
- package/dist/cli/commands/admin/realms/add.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/add.js +42 -0
- package/dist/cli/commands/admin/realms/add.js.map +1 -0
- package/dist/cli/commands/admin/realms/index.d.ts +5 -0
- package/dist/cli/commands/admin/realms/index.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/index.js +13 -0
- package/dist/cli/commands/admin/realms/index.js.map +1 -0
- package/dist/cli/commands/admin/realms/list.d.ts +14 -0
- package/dist/cli/commands/admin/realms/list.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/list.js +36 -0
- package/dist/cli/commands/admin/realms/list.js.map +1 -0
- package/dist/cli/commands/admin/realms/passkeys/index.d.ts +5 -0
- package/dist/cli/commands/admin/realms/passkeys/index.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/passkeys/index.js +13 -0
- package/dist/cli/commands/admin/realms/passkeys/index.js.map +1 -0
- package/dist/cli/commands/admin/realms/passkeys/set.d.ts +17 -0
- package/dist/cli/commands/admin/realms/passkeys/set.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/passkeys/set.js +46 -0
- package/dist/cli/commands/admin/realms/passkeys/set.js.map +1 -0
- package/dist/cli/commands/admin/realms/privy/index.d.ts +5 -0
- package/dist/cli/commands/admin/realms/privy/index.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/privy/index.js +13 -0
- package/dist/cli/commands/admin/realms/privy/index.js.map +1 -0
- package/dist/cli/commands/admin/realms/privy/set.d.ts +19 -0
- package/dist/cli/commands/admin/realms/privy/set.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/privy/set.js +66 -0
- package/dist/cli/commands/admin/realms/privy/set.js.map +1 -0
- package/dist/cli/commands/admin/realms/remove.d.ts +12 -0
- package/dist/cli/commands/admin/realms/remove.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/remove.js +35 -0
- package/dist/cli/commands/admin/realms/remove.js.map +1 -0
- package/dist/cli/commands/admin/realms/secp256k1/disable.d.ts +16 -0
- package/dist/cli/commands/admin/realms/secp256k1/disable.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/secp256k1/disable.js +42 -0
- package/dist/cli/commands/admin/realms/secp256k1/disable.js.map +1 -0
- package/dist/cli/commands/admin/realms/secp256k1/enable.d.ts +16 -0
- package/dist/cli/commands/admin/realms/secp256k1/enable.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/secp256k1/enable.js +42 -0
- package/dist/cli/commands/admin/realms/secp256k1/enable.js.map +1 -0
- package/dist/cli/commands/admin/realms/secp256k1/index.d.ts +9 -0
- package/dist/cli/commands/admin/realms/secp256k1/index.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/secp256k1/index.js +17 -0
- package/dist/cli/commands/admin/realms/secp256k1/index.js.map +1 -0
- package/dist/cli/commands/admin/realms/set.d.ts +17 -0
- package/dist/cli/commands/admin/realms/set.d.ts.map +1 -0
- package/dist/cli/commands/admin/realms/set.js +46 -0
- package/dist/cli/commands/admin/realms/set.js.map +1 -0
- package/dist/cli/commands/admin/rotate-key.d.ts +16 -0
- package/dist/cli/commands/admin/rotate-key.d.ts.map +1 -0
- package/dist/cli/commands/admin/rotate-key.js +46 -0
- package/dist/cli/commands/admin/rotate-key.js.map +1 -0
- package/dist/cli/commands/init.d.ts +11 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +34 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/login.d.ts +12 -0
- package/dist/cli/commands/login.d.ts.map +1 -0
- package/dist/cli/commands/login.js +29 -0
- package/dist/cli/commands/login.js.map +1 -0
- package/dist/cli/commands/logout.d.ts +8 -0
- package/dist/cli/commands/logout.d.ts.map +1 -0
- package/dist/cli/commands/logout.js +19 -0
- package/dist/cli/commands/logout.js.map +1 -0
- package/dist/cli/commands/whoami.d.ts +12 -0
- package/dist/cli/commands/whoami.d.ts.map +1 -0
- package/dist/cli/commands/whoami.js +24 -0
- package/dist/cli/commands/whoami.js.map +1 -0
- package/dist/client/Actions.d.ts +108 -0
- package/dist/client/Actions.d.ts.map +1 -0
- package/dist/client/Actions.js +94 -0
- package/dist/client/Actions.js.map +1 -0
- package/dist/client/Auth.d.ts +143 -0
- package/dist/client/Auth.d.ts.map +1 -0
- package/dist/client/Auth.js +106 -0
- package/dist/client/Auth.js.map +1 -0
- package/dist/client/Authorization.d.ts +29 -0
- package/dist/client/Authorization.d.ts.map +1 -0
- package/dist/client/Authorization.js +12 -0
- package/dist/client/Authorization.js.map +1 -0
- package/dist/client/Decorator.d.ts +172 -0
- package/dist/client/Decorator.d.ts.map +1 -0
- package/dist/client/Decorator.js +241 -0
- package/dist/client/Decorator.js.map +1 -0
- package/dist/client/Key.d.ts +82 -0
- package/dist/client/Key.d.ts.map +1 -0
- package/dist/client/Key.js +81 -0
- package/dist/client/Key.js.map +1 -0
- package/dist/client/Pending.d.ts +38 -0
- package/dist/client/Pending.d.ts.map +1 -0
- package/dist/client/Pending.js +12 -0
- package/dist/client/Pending.js.map +1 -0
- package/dist/client/Permissions.d.ts +36 -0
- package/dist/client/Permissions.d.ts.map +1 -0
- package/dist/client/Permissions.js +16 -0
- package/dist/client/Permissions.js.map +1 -0
- package/dist/client/Storage.d.ts +27 -0
- package/dist/client/Storage.d.ts.map +1 -0
- package/dist/client/Storage.js +16 -0
- package/dist/client/Storage.js.map +1 -0
- package/dist/client/TempoAccount.d.ts +52 -0
- package/dist/client/TempoAccount.d.ts.map +1 -0
- package/dist/client/TempoAccount.js +17 -0
- package/dist/client/TempoAccount.js.map +1 -0
- package/dist/client/Tokens.d.ts +25 -0
- package/dist/client/Tokens.d.ts.map +1 -0
- package/dist/client/Tokens.js +12 -0
- package/dist/client/Tokens.js.map +1 -0
- package/dist/client/User.d.ts +21 -0
- package/dist/client/User.d.ts.map +1 -0
- package/dist/client/User.js +12 -0
- package/dist/client/User.js.map +1 -0
- package/dist/client/actions/account.d.ts +75 -0
- package/dist/client/actions/account.d.ts.map +1 -0
- package/dist/client/actions/account.js +102 -0
- package/dist/client/actions/account.js.map +1 -0
- package/dist/client/actions/device.d.ts +52 -0
- package/dist/client/actions/device.d.ts.map +1 -0
- package/dist/client/actions/device.js +103 -0
- package/dist/client/actions/device.js.map +1 -0
- package/dist/client/actions/email.d.ts +89 -0
- package/dist/client/actions/email.d.ts.map +1 -0
- package/dist/client/actions/email.js +86 -0
- package/dist/client/actions/email.js.map +1 -0
- package/dist/client/actions/oauth.d.ts +112 -0
- package/dist/client/actions/oauth.d.ts.map +1 -0
- package/dist/client/actions/oauth.js +103 -0
- package/dist/client/actions/oauth.js.map +1 -0
- package/dist/client/actions/passkey.d.ts +140 -0
- package/dist/client/actions/passkey.d.ts.map +1 -0
- package/dist/client/actions/passkey.js +170 -0
- package/dist/client/actions/passkey.js.map +1 -0
- package/dist/client/actions/realm.d.ts +25 -0
- package/dist/client/actions/realm.d.ts.map +1 -0
- package/dist/client/actions/realm.js +16 -0
- package/dist/client/actions/realm.js.map +1 -0
- package/dist/client/actions/redirect.d.ts +152 -0
- package/dist/client/actions/redirect.d.ts.map +1 -0
- package/dist/client/actions/redirect.js +311 -0
- package/dist/client/actions/redirect.js.map +1 -0
- package/dist/client/internal/accessKey.d.ts +21 -0
- package/dist/client/internal/accessKey.d.ts.map +1 -0
- package/dist/client/internal/accessKey.js +38 -0
- package/dist/client/internal/accessKey.js.map +1 -0
- package/dist/client/internal/account.d.ts +17 -0
- package/dist/client/internal/account.d.ts.map +1 -0
- package/dist/client/internal/account.js +3 -0
- package/dist/client/internal/account.js.map +1 -0
- package/dist/client/internal/api.d.ts +110 -0
- package/dist/client/internal/api.d.ts.map +1 -0
- package/dist/client/internal/api.js +136 -0
- package/dist/client/internal/api.js.map +1 -0
- package/dist/client/internal/headless.d.ts +159 -0
- package/dist/client/internal/headless.d.ts.map +1 -0
- package/dist/client/internal/headless.js +196 -0
- package/dist/client/internal/headless.js.map +1 -0
- package/dist/client/internal/indexedDb.d.ts +8 -0
- package/dist/client/internal/indexedDb.d.ts.map +1 -0
- package/dist/client/internal/indexedDb.js +32 -0
- package/dist/client/internal/indexedDb.js.map +1 -0
- package/dist/client/internal/request.d.ts +56 -0
- package/dist/client/internal/request.d.ts.map +1 -0
- package/dist/client/internal/request.js +44 -0
- package/dist/client/internal/request.js.map +1 -0
- package/dist/client/internal/store.d.ts +12 -0
- package/dist/client/internal/store.d.ts.map +1 -0
- package/dist/client/internal/store.js +15 -0
- package/dist/client/internal/store.js.map +1 -0
- package/dist/client/internal/verifier.d.ts +25 -0
- package/dist/client/internal/verifier.d.ts.map +1 -0
- package/dist/client/internal/verifier.js +52 -0
- package/dist/client/internal/verifier.js.map +1 -0
- package/dist/client.d.ts +18 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +18 -0
- package/dist/client.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/Apps.d.ts +3169 -0
- package/dist/internal/Apps.d.ts.map +1 -0
- package/dist/internal/Apps.js +948 -0
- package/dist/internal/Apps.js.map +1 -0
- package/dist/internal/Auth.d.ts +4287 -0
- package/dist/internal/Auth.d.ts.map +1 -0
- package/dist/internal/Auth.js +185 -0
- package/dist/internal/Auth.js.map +1 -0
- package/dist/internal/Authorize.d.ts +526 -0
- package/dist/internal/Authorize.d.ts.map +1 -0
- package/dist/internal/Authorize.js +330 -0
- package/dist/internal/Authorize.js.map +1 -0
- package/dist/internal/Cache.d.ts +56 -0
- package/dist/internal/Cache.d.ts.map +1 -0
- package/dist/internal/Cache.js +65 -0
- package/dist/internal/Cache.js.map +1 -0
- package/dist/internal/Chain.d.ts +738 -0
- package/dist/internal/Chain.d.ts.map +1 -0
- package/dist/internal/Chain.js +65 -0
- package/dist/internal/Chain.js.map +1 -0
- package/dist/internal/ChainList.d.ts +117 -0
- package/dist/internal/ChainList.d.ts.map +1 -0
- package/dist/internal/ChainList.js +148 -0
- package/dist/internal/ChainList.js.map +1 -0
- package/dist/internal/ChainName.d.ts +11 -0
- package/dist/internal/ChainName.d.ts.map +1 -0
- package/dist/internal/ChainName.js +13 -0
- package/dist/internal/ChainName.js.map +1 -0
- package/dist/internal/CodeEmail.d.ts +38 -0
- package/dist/internal/CodeEmail.d.ts.map +1 -0
- package/dist/internal/CodeEmail.js +85 -0
- package/dist/internal/CodeEmail.js.map +1 -0
- package/dist/internal/ConfigurableAccount.d.ts +600 -0
- package/dist/internal/ConfigurableAccount.d.ts.map +1 -0
- package/dist/internal/ConfigurableAccount.js +795 -0
- package/dist/internal/ConfigurableAccount.js.map +1 -0
- package/dist/internal/Device.d.ts +246 -0
- package/dist/internal/Device.d.ts.map +1 -0
- package/dist/internal/Device.js +257 -0
- package/dist/internal/Device.js.map +1 -0
- package/dist/internal/Env.d.ts +97 -0
- package/dist/internal/Env.d.ts.map +1 -0
- package/dist/internal/Env.js +2 -0
- package/dist/internal/Env.js.map +1 -0
- package/dist/internal/ErrorResponse.d.ts +608 -0
- package/dist/internal/ErrorResponse.d.ts.map +1 -0
- package/dist/internal/ErrorResponse.js +701 -0
- package/dist/internal/ErrorResponse.js.map +1 -0
- package/dist/internal/Id.d.ts +10 -0
- package/dist/internal/Id.d.ts.map +1 -0
- package/dist/internal/Id.js +34 -0
- package/dist/internal/Id.js.map +1 -0
- package/dist/internal/KeyAuthorization.d.ts +1650 -0
- package/dist/internal/KeyAuthorization.d.ts.map +1 -0
- package/dist/internal/KeyAuthorization.js +1187 -0
- package/dist/internal/KeyAuthorization.js.map +1 -0
- package/dist/internal/Limits.d.ts +70 -0
- package/dist/internal/Limits.d.ts.map +1 -0
- package/dist/internal/Limits.js +36 -0
- package/dist/internal/Limits.js.map +1 -0
- package/dist/internal/Log.d.ts +34 -0
- package/dist/internal/Log.d.ts.map +1 -0
- package/dist/internal/Log.js +99 -0
- package/dist/internal/Log.js.map +1 -0
- package/dist/internal/LogLine.d.ts +29 -0
- package/dist/internal/LogLine.d.ts.map +1 -0
- package/dist/internal/LogLine.js +50 -0
- package/dist/internal/LogLine.js.map +1 -0
- package/dist/internal/Migrations.d.ts +28 -0
- package/dist/internal/Migrations.d.ts.map +1 -0
- package/dist/internal/Migrations.js +82 -0
- package/dist/internal/Migrations.js.map +1 -0
- package/dist/internal/Owner.d.ts +230 -0
- package/dist/internal/Owner.d.ts.map +1 -0
- package/dist/internal/Owner.js +101 -0
- package/dist/internal/Owner.js.map +1 -0
- package/dist/internal/Passkey.d.ts +901 -0
- package/dist/internal/Passkey.d.ts.map +1 -0
- package/dist/internal/Passkey.js +1185 -0
- package/dist/internal/Passkey.js.map +1 -0
- package/dist/internal/PendingKey.d.ts +49 -0
- package/dist/internal/PendingKey.d.ts.map +1 -0
- package/dist/internal/PendingKey.js +58 -0
- package/dist/internal/PendingKey.js.map +1 -0
- package/dist/internal/Privy.d.ts +138 -0
- package/dist/internal/Privy.d.ts.map +1 -0
- package/dist/internal/Privy.js +285 -0
- package/dist/internal/Privy.js.map +1 -0
- package/dist/internal/RateLimit.d.ts +218 -0
- package/dist/internal/RateLimit.d.ts.map +1 -0
- package/dist/internal/RateLimit.js +209 -0
- package/dist/internal/RateLimit.js.map +1 -0
- package/dist/internal/Realm.d.ts +290 -0
- package/dist/internal/Realm.d.ts.map +1 -0
- package/dist/internal/Realm.js +502 -0
- package/dist/internal/Realm.js.map +1 -0
- package/dist/internal/RequestId.d.ts +16 -0
- package/dist/internal/RequestId.d.ts.map +1 -0
- package/dist/internal/RequestId.js +78 -0
- package/dist/internal/RequestId.js.map +1 -0
- package/dist/internal/SigningKey.d.ts +126 -0
- package/dist/internal/SigningKey.d.ts.map +1 -0
- package/dist/internal/SigningKey.js +221 -0
- package/dist/internal/SigningKey.js.map +1 -0
- package/dist/internal/TempoAccount.d.ts +181 -0
- package/dist/internal/TempoAccount.d.ts.map +1 -0
- package/dist/internal/TempoAccount.js +369 -0
- package/dist/internal/TempoAccount.js.map +1 -0
- package/dist/internal/TestInbox.d.ts +42 -0
- package/dist/internal/TestInbox.d.ts.map +1 -0
- package/dist/internal/TestInbox.js +20 -0
- package/dist/internal/TestInbox.js.map +1 -0
- package/dist/internal/Timing.d.ts +52 -0
- package/dist/internal/Timing.d.ts.map +1 -0
- package/dist/internal/Timing.js +116 -0
- package/dist/internal/Timing.js.map +1 -0
- package/dist/internal/Validation.d.ts +52 -0
- package/dist/internal/Validation.d.ts.map +1 -0
- package/dist/internal/Validation.js +22 -0
- package/dist/internal/Validation.js.map +1 -0
- package/dist/internal/Verification.d.ts +24 -0
- package/dist/internal/Verification.d.ts.map +1 -0
- package/dist/internal/Verification.js +37 -0
- package/dist/internal/Verification.js.map +1 -0
- package/dist/internal/Wallet.d.ts +66 -0
- package/dist/internal/Wallet.d.ts.map +1 -0
- package/dist/internal/Wallet.js +59 -0
- package/dist/internal/Wallet.js.map +1 -0
- package/dist/internal/owners/Passkey.d.ts +9 -0
- package/dist/internal/owners/Passkey.d.ts.map +1 -0
- package/dist/internal/owners/Passkey.js +58 -0
- package/dist/internal/owners/Passkey.js.map +1 -0
- package/dist/internal/owners/Privy.d.ts +13 -0
- package/dist/internal/owners/Privy.d.ts.map +1 -0
- package/dist/internal/owners/Privy.js +59 -0
- package/dist/internal/owners/Privy.js.map +1 -0
- package/dist/internal/owners/Secp256k1.d.ts +12 -0
- package/dist/internal/owners/Secp256k1.d.ts.map +1 -0
- package/dist/internal/owners/Secp256k1.js +99 -0
- package/dist/internal/owners/Secp256k1.js.map +1 -0
- package/dist/worker.d.ts +18 -0
- package/dist/worker.d.ts.map +1 -0
- package/dist/worker.js +18 -0
- package/dist/worker.js.map +1 -0
- package/package.json +83 -3
- package/src/Api.ts +157 -0
- package/src/App.ts +316 -0
- package/src/api/account.ts +2266 -0
- package/src/api/authenticate.ts +1662 -0
- package/src/api/authorize.ts +1086 -0
- package/src/api/device.ts +516 -0
- package/src/api/health.ts +72 -0
- package/src/api/lib/AccountStep.ts +485 -0
- package/src/api/lib/Auth.ts +164 -0
- package/src/api/lib/Configure.ts +921 -0
- package/src/api/lib/Consent.ts +388 -0
- package/src/api/lib/Cors.ts +160 -0
- package/src/api/lib/Database.ts +10 -0
- package/src/api/lib/DeviceRequest.ts +244 -0
- package/src/api/lib/FirstAccount.ts +136 -0
- package/src/api/lib/Headless.ts +616 -0
- package/src/api/lib/IsolateCache.ts +28 -0
- package/src/api/lib/KeySigner.ts +690 -0
- package/src/api/lib/PasskeyLink.ts +162 -0
- package/src/api/lib/Session.ts +64 -0
- package/src/api/lib/SignInConsent.ts +393 -0
- package/src/api/oauth.ts +1796 -0
- package/src/app/components/CodeInput.tsx +153 -0
- package/src/app/components/DevTools.tsx +1071 -0
- package/src/app/components/Grant.tsx +476 -0
- package/src/app/components/icons/BRLA.png +0 -0
- package/src/app/components/icons/BRZ.svg +1 -0
- package/src/app/components/icons/CHFAU.png +0 -0
- package/src/app/components/icons/DLUSD.png +0 -0
- package/src/app/components/icons/EURAU.svg +1 -0
- package/src/app/components/icons/EURC.e.svg +1 -0
- package/src/app/components/icons/GBPA.svg +4 -0
- package/src/app/components/icons/GUSD.svg +1 -0
- package/src/app/components/icons/MACH.svg +4 -0
- package/src/app/components/icons/OUSD.svg +5 -0
- package/src/app/components/icons/PRIME.svg +14 -0
- package/src/app/components/icons/SBC.svg +1 -0
- package/src/app/components/icons/SEKAU.svg +5 -0
- package/src/app/components/icons/USD1.svg +30 -0
- package/src/app/components/icons/USDB.svg +11 -0
- package/src/app/components/icons/USDC.e.svg +1 -0
- package/src/app/components/icons/USDT0.svg +1 -0
- package/src/app/components/icons/USDY.svg +16 -0
- package/src/app/components/icons/USDe.svg +1 -0
- package/src/app/components/icons/YLDS.svg +3 -0
- package/src/app/components/icons/alphaUSD.svg +1 -0
- package/src/app/components/icons/betaUSD.svg +1 -0
- package/src/app/components/icons/cUSD.svg +1 -0
- package/src/app/components/icons/cbBTC.svg +1 -0
- package/src/app/components/icons/frxUSD.svg +1 -0
- package/src/app/components/icons/goUSD.svg +5 -0
- package/src/app/components/icons/iUSD.svg +1 -0
- package/src/app/components/icons/pathUSD.svg +25 -0
- package/src/app/components/icons/rUSD.svg +1 -0
- package/src/app/components/icons/reUSD.svg +1 -0
- package/src/app/components/icons/sUSDe.svg +1 -0
- package/src/app/components/icons/siUSD.svg +1 -0
- package/src/app/components/icons/stcUSD.svg +1 -0
- package/src/app/components/icons/syrupUSDC.svg +5 -0
- package/src/app/components/icons/thetaUSD.svg +1 -0
- package/src/app/components/icons/wYLDS.svg +10 -0
- package/src/app/components/icons/wsrUSD.svg +1 -0
- package/src/app/components/logos/OUSD.dark.svg +17 -0
- package/src/app/components/logos/OUSD.light.svg +17 -0
- package/src/app/coverage.server.ts +73 -0
- package/src/app/coverage.ts +69 -0
- package/src/app/crons/cleanup.ts +104 -0
- package/src/app/db/auth.ts +440 -0
- package/src/app/db/migrations/0000_better_auth.sql +53 -0
- package/src/app/db/migrations/0001_oauth_provider.sql +162 -0
- package/src/app/db/migrations/0002_device_code.sql +17 -0
- package/src/app/db/migrations/0003_realms.sql +27 -0
- package/src/app/db/migrations/0004_default_realm.sql +2 -0
- package/src/app/db/migrations/0005_passkeys.sql +30 -0
- package/src/app/db/migrations/0006_first_accounts.sql +9 -0
- package/src/app/db/migrations/0007_pending_keys.sql +13 -0
- package/src/app/db/migrations/0008_secp256k1_owners.sql +18 -0
- package/src/app/db/migrations/0009_device_requests.sql +8 -0
- package/src/app/db/migrations/0010_device_keys.sql +4 -0
- package/src/app/db/migrations/0011_registered_passkeys.sql +2 -0
- package/src/app/db/migrations/0012_passkey_accounts.sql +7 -0
- package/src/app/db/migrations/0013_first_party_apps.sql +4 -0
- package/src/app/db/migrations/0014_logout_revokes_tokens.sql +17 -0
- package/src/app/db/migrations/0015_expiry_indexes.sql +9 -0
- package/src/app/db/migrations/0016_configurable_accounts.sql +15 -0
- package/src/app/db/migrations/0017_account_config_keys.sql +3 -0
- package/src/app/db/migrations/0018_better_auth_1_8.sql +9 -0
- package/src/app/db/migrations/0019_drop_provider_account_index.sql +1 -0
- package/src/app/db/migrations/meta/0000_snapshot.json +362 -0
- package/src/app/db/migrations/meta/0001_snapshot.json +1487 -0
- package/src/app/db/migrations/meta/0002_snapshot.json +1603 -0
- package/src/app/db/migrations/meta/0003_snapshot.json +1760 -0
- package/src/app/db/migrations/meta/0004_snapshot.json +1760 -0
- package/src/app/db/migrations/meta/0005_snapshot.json +1911 -0
- package/src/app/db/migrations/meta/0006_snapshot.json +1967 -0
- package/src/app/db/migrations/meta/0007_snapshot.json +2047 -0
- package/src/app/db/migrations/meta/0008_snapshot.json +2157 -0
- package/src/app/db/migrations/meta/0009_snapshot.json +2207 -0
- package/src/app/db/migrations/meta/0010_snapshot.json +2231 -0
- package/src/app/db/migrations/meta/0011_snapshot.json +2231 -0
- package/src/app/db/migrations/meta/0012_snapshot.json +2231 -0
- package/src/app/db/migrations/meta/0013_snapshot.json +2231 -0
- package/src/app/db/migrations/meta/0014_snapshot.json +2231 -0
- package/src/app/db/migrations/meta/0015_snapshot.json +2375 -0
- package/src/app/db/migrations/meta/0016_snapshot.json +2475 -0
- package/src/app/db/migrations/meta/0017_snapshot.json +2481 -0
- package/src/app/db/migrations/meta/0018_snapshot.json +2535 -0
- package/src/app/db/migrations/meta/0019_snapshot.json +2514 -0
- package/src/app/db/migrations/meta/_journal.json +146 -0
- package/src/app/db/schema.ts +241 -0
- package/src/app/db/table.ts +31 -0
- package/src/app/env.ts +57 -0
- package/src/app/inbox.ts +190 -0
- package/src/app/lib/Client.ts +82 -0
- package/src/app/lib/Inbox.ts +11 -0
- package/src/app/lib/Loader.ts +21 -0
- package/src/app/lib/Upgrade.ts +221 -0
- package/src/app/package.json +8 -0
- package/src/app/public/_headers +4 -0
- package/src/app/routeTree.gen.ts +219 -0
- package/src/app/router.tsx +47 -0
- package/src/app/routes/[_].flows.tsx +4254 -0
- package/src/app/routes/__root.tsx +172 -0
- package/src/app/routes/authorize.tsx +379 -0
- package/src/app/routes/choose-account.tsx +144 -0
- package/src/app/routes/deposit.tsx +107 -0
- package/src/app/routes/device.tsx +273 -0
- package/src/app/routes/error.tsx +62 -0
- package/src/app/routes/index.tsx +511 -0
- package/src/app/routes/login.tsx +577 -0
- package/src/app/screens/Account.tsx +559 -0
- package/src/app/screens/Approval.tsx +444 -0
- package/src/app/screens/ChooseAccount.tsx +206 -0
- package/src/app/screens/Deposit.tsx +523 -0
- package/src/app/screens/DeviceApproval.tsx +500 -0
- package/src/app/screens/NotFound.tsx +62 -0
- package/src/app/screens/SignIn.tsx +372 -0
- package/src/app/screens/WalletUpgrade.tsx +121 -0
- package/src/app/screens/chains/base.svg +3 -0
- package/src/app/screens/chains/ethereum.svg +11 -0
- package/src/app/screens/chains/solana.svg +4 -0
- package/src/app/screens/chains/tempo.svg +4 -0
- package/src/app/server.ts +342 -0
- package/src/app/vite.config.ts +128 -0
- package/src/app/void.config.ts +36 -0
- package/src/app/wallet.ts +69 -0
- package/src/app/zyzz.config.ts +52 -0
- package/src/cli/Admin.ts +74 -0
- package/src/cli/Apps.ts +27 -0
- package/src/cli/Cli.ts +41 -0
- package/src/cli/Project.ts +119 -0
- package/src/cli/Realms.ts +49 -0
- package/src/cli/Session.ts +290 -0
- package/src/cli/User.ts +40 -0
- package/src/cli/V1.ts +54 -0
- package/src/cli/bin.ts +44 -0
- package/src/cli/commands/admin/apps/create.ts +96 -0
- package/src/cli/commands/admin/apps/delete.ts +38 -0
- package/src/cli/commands/admin/apps/index.ts +15 -0
- package/src/cli/commands/admin/apps/list.ts +25 -0
- package/src/cli/commands/admin/apps/rotate-secret.ts +47 -0
- package/src/cli/commands/admin/apps/update.ts +79 -0
- package/src/cli/commands/admin/index.ts +14 -0
- package/src/cli/commands/admin/migrate.ts +19 -0
- package/src/cli/commands/admin/realms/add.ts +40 -0
- package/src/cli/commands/admin/realms/index.ts +14 -0
- package/src/cli/commands/admin/realms/list.ts +38 -0
- package/src/cli/commands/admin/realms/passkeys/index.ts +15 -0
- package/src/cli/commands/admin/realms/passkeys/set.ts +44 -0
- package/src/cli/commands/admin/realms/privy/index.ts +14 -0
- package/src/cli/commands/admin/realms/privy/set.ts +69 -0
- package/src/cli/commands/admin/realms/remove.ts +33 -0
- package/src/cli/commands/admin/realms/secp256k1/disable.ts +40 -0
- package/src/cli/commands/admin/realms/secp256k1/enable.ts +40 -0
- package/src/cli/commands/admin/realms/secp256k1/index.ts +19 -0
- package/src/cli/commands/admin/realms/set.ts +46 -0
- package/src/cli/commands/admin/rotate-key.ts +47 -0
- package/src/cli/commands/init.ts +42 -0
- package/src/cli/commands/login.ts +32 -0
- package/src/cli/commands/logout.ts +19 -0
- package/src/cli/commands/whoami.ts +23 -0
- package/src/client/Actions.ts +180 -0
- package/src/client/Auth.ts +267 -0
- package/src/client/Authorization.ts +34 -0
- package/src/client/Decorator.ts +444 -0
- package/src/client/Key.ts +137 -0
- package/src/client/Pending.ts +45 -0
- package/src/client/Permissions.ts +41 -0
- package/src/client/Storage.ts +29 -0
- package/src/client/TempoAccount.ts +55 -0
- package/src/client/Tokens.ts +27 -0
- package/src/client/User.ts +23 -0
- package/src/client/actions/account.ts +171 -0
- package/src/client/actions/device.ts +166 -0
- package/src/client/actions/email.ts +164 -0
- package/src/client/actions/oauth.ts +179 -0
- package/src/client/actions/passkey.ts +333 -0
- package/src/client/actions/realm.ts +37 -0
- package/src/client/actions/redirect.ts +502 -0
- package/src/client/internal/accessKey.ts +54 -0
- package/src/client/internal/account.ts +18 -0
- package/src/client/internal/api.ts +242 -0
- package/src/client/internal/headless.ts +308 -0
- package/src/client/internal/indexedDb.ts +44 -0
- package/src/client/internal/request.ts +70 -0
- package/src/client/internal/store.ts +20 -0
- package/src/client/internal/verifier.ts +75 -0
- package/src/client.ts +17 -0
- package/src/index.ts +5 -0
- package/src/internal/Apps.ts +1283 -0
- package/src/internal/Auth.ts +273 -0
- package/src/internal/Authorize.ts +433 -0
- package/src/internal/Balance.ts +144 -0
- package/src/internal/BodyLimit.ts +31 -0
- package/src/internal/Cache.ts +119 -0
- package/src/internal/Chain.ts +99 -0
- package/src/internal/ChainList.ts +270 -0
- package/src/internal/ChainName.ts +14 -0
- package/src/internal/ChainStatus.ts +65 -0
- package/src/internal/CodeEmail.ts +138 -0
- package/src/internal/ConfigurableAccount.ts +1315 -0
- package/src/internal/Device.ts +471 -0
- package/src/internal/Env.ts +92 -0
- package/src/internal/ErrorResponse.ts +896 -0
- package/src/internal/Faucet.ts +43 -0
- package/src/internal/Id.ts +41 -0
- package/src/internal/KeyAuthorization.ts +1536 -0
- package/src/internal/Limits.ts +40 -0
- package/src/internal/Log.ts +166 -0
- package/src/internal/LogLine.ts +81 -0
- package/src/internal/Logout.ts +356 -0
- package/src/internal/Migrations.ts +120 -0
- package/src/internal/OpenApi.ts +300 -0
- package/src/internal/Owner.ts +310 -0
- package/src/internal/Passkey.ts +1904 -0
- package/src/internal/PendingKey.ts +104 -0
- package/src/internal/Privy.ts +536 -0
- package/src/internal/RateLimit.ts +346 -0
- package/src/internal/Realm.ts +814 -0
- package/src/internal/RequestId.ts +118 -0
- package/src/internal/SignInGrant.ts +175 -0
- package/src/internal/SigningKey.ts +319 -0
- package/src/internal/TempoAccount.ts +545 -0
- package/src/internal/TestInbox.ts +51 -0
- package/src/internal/Timing.ts +172 -0
- package/src/internal/Validation.ts +52 -0
- package/src/internal/Verification.ts +58 -0
- package/src/internal/Wallet.ts +101 -0
- package/src/internal/owners/Passkey.ts +76 -0
- package/src/internal/owners/Privy.ts +82 -0
- package/src/internal/owners/Secp256k1.ts +139 -0
- package/src/types/app.d.ts +39 -0
- package/src/worker.ts +17 -0
|
@@ -0,0 +1,1536 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Access keys (TIP-1011) that apps hold on a user's Tempo Account, in the shape of the Accounts
|
|
3
|
+
* SDK's `wallet_connect` capability. The user approves a key on a page, or it fits the headless
|
|
4
|
+
* ceiling. A challenge becomes the key's witness (TIP-1053).
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
import { AbiFunction, Address, Hex, PublicKey, Value } from 'ox'
|
|
8
|
+
import { AccountConfig, KeyAuthorization, SignatureEnvelope } from 'ox/tempo'
|
|
9
|
+
import { Authentication } from 'ox/webauthn'
|
|
10
|
+
import { hashMessage, zeroAddress } from 'viem'
|
|
11
|
+
import { Account, Addresses, Selectors } from 'viem/tempo'
|
|
12
|
+
import {
|
|
13
|
+
tempo,
|
|
14
|
+
tempoDevnet,
|
|
15
|
+
tempoLocalnet,
|
|
16
|
+
tempoTestnet,
|
|
17
|
+
} from 'viem/tempo/chains'
|
|
18
|
+
import { defineToken, ousd as openUsd, tokens } from 'viem/tokens'
|
|
19
|
+
import { z } from 'zod'
|
|
20
|
+
import * as Apps from './Apps.js'
|
|
21
|
+
import * as Chain from './Chain.js'
|
|
22
|
+
import * as ErrorResponse from './ErrorResponse.js'
|
|
23
|
+
import type * as Passkey from './Passkey.js'
|
|
24
|
+
|
|
25
|
+
/** The request carries a challenge, which its app may not bind. */
|
|
26
|
+
export class ChallengeNotPermittedError extends ErrorResponse.define(
|
|
27
|
+
'challenge_not_permitted',
|
|
28
|
+
) {
|
|
29
|
+
override readonly name = 'KeyAuthorization.ChallengeNotPermittedError'
|
|
30
|
+
|
|
31
|
+
constructor(options: ChallengeNotPermittedError.Options) {
|
|
32
|
+
const { clientId } = options
|
|
33
|
+
super({
|
|
34
|
+
error_description: `Challenge not permitted: the app lacks the \`${Apps.signScope}\` scope. Remove \`challenge\`, or grant the app the scope.`,
|
|
35
|
+
field: 'challenge',
|
|
36
|
+
meta: { client_id: clientId, scope: Apps.signScope },
|
|
37
|
+
})
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export declare namespace ChallengeNotPermittedError {
|
|
42
|
+
type Options = {
|
|
43
|
+
/** The app's client ID. */
|
|
44
|
+
clientId: string
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** Two limits name the same token. */
|
|
49
|
+
export class DuplicateLimitError extends ErrorResponse.define(
|
|
50
|
+
'duplicate_limit',
|
|
51
|
+
) {
|
|
52
|
+
override readonly name = 'KeyAuthorization.DuplicateLimitError'
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** Two scopes name one call on a target, or one target mixes any function with named ones. */
|
|
56
|
+
export class DuplicateScopeError extends ErrorResponse.define(
|
|
57
|
+
'duplicate_scope',
|
|
58
|
+
) {
|
|
59
|
+
override readonly name = 'KeyAuthorization.DuplicateScopeError'
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** `limits` is an empty list. */
|
|
63
|
+
export class EmptyLimitsError extends ErrorResponse.define('empty_limits') {
|
|
64
|
+
override readonly name = 'KeyAuthorization.EmptyLimitsError'
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** `scopes` is an empty list. */
|
|
68
|
+
export class EmptyScopesError extends ErrorResponse.define('empty_scopes') {
|
|
69
|
+
override readonly name = 'KeyAuthorization.EmptyScopesError'
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** A headless key lasts longer than a year. */
|
|
73
|
+
export class ExpiryExceedsMaximumError extends ErrorResponse.define(
|
|
74
|
+
'expiry_exceeds_maximum',
|
|
75
|
+
) {
|
|
76
|
+
override readonly name = 'KeyAuthorization.ExpiryExceedsMaximumError'
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** The key expiry is in the past. */
|
|
80
|
+
export class ExpiryPassedError extends ErrorResponse.define('expiry_passed') {
|
|
81
|
+
override readonly name = 'KeyAuthorization.ExpiryPassedError'
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** The key chain ID is 0. */
|
|
85
|
+
export class InvalidChainError extends ErrorResponse.define('invalid_chain') {
|
|
86
|
+
override readonly name = 'KeyAuthorization.InvalidChainError'
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/** The key expiry is 0, which never expires. */
|
|
90
|
+
export class InvalidExpiryError extends ErrorResponse.define('invalid_expiry') {
|
|
91
|
+
override readonly name = 'KeyAuthorization.InvalidExpiryError'
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/** A limit's `period` is not a whole number of seconds. */
|
|
95
|
+
export class InvalidPeriodError extends ErrorResponse.define('invalid_period') {
|
|
96
|
+
override readonly name = 'KeyAuthorization.InvalidPeriodError'
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/** The key public key is not a valid point. */
|
|
100
|
+
export class InvalidPublicKeyError extends ErrorResponse.define(
|
|
101
|
+
'invalid_public_key',
|
|
102
|
+
) {
|
|
103
|
+
override readonly name = 'KeyAuthorization.InvalidPublicKeyError'
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** A scope's `recipients` repeats an address, names the zero address, or is on the wrong call. */
|
|
107
|
+
export class InvalidRecipientsError extends ErrorResponse.define(
|
|
108
|
+
'invalid_recipients',
|
|
109
|
+
) {
|
|
110
|
+
override readonly name = 'KeyAuthorization.InvalidRecipientsError'
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/** A headless key limit exceeds the token’s ceiling. */
|
|
114
|
+
export class LimitExceedsMaximumError extends ErrorResponse.define(
|
|
115
|
+
'limit_exceeds_maximum',
|
|
116
|
+
) {
|
|
117
|
+
override readonly name = 'KeyAuthorization.LimitExceedsMaximumError'
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/** The key authorization names no key. */
|
|
121
|
+
export class MissingKeyError extends ErrorResponse.define('missing_key') {
|
|
122
|
+
override readonly name = 'KeyAuthorization.MissingKeyError'
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/** A third-party app's key request leaves out `expiry`, `limits`, or `scopes`. */
|
|
126
|
+
export class MissingPermissionsError extends ErrorResponse.define(
|
|
127
|
+
'missing_permissions',
|
|
128
|
+
) {
|
|
129
|
+
override readonly name = 'KeyAuthorization.MissingPermissionsError'
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/** An `approve` scope names no spenders. */
|
|
133
|
+
export class MissingRecipientsError extends ErrorResponse.define(
|
|
134
|
+
'missing_recipients',
|
|
135
|
+
) {
|
|
136
|
+
override readonly name = 'KeyAuthorization.MissingRecipientsError'
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/** A scope calls a listed token that no limit names. */
|
|
140
|
+
export class ScopeWithoutLimitError extends ErrorResponse.define(
|
|
141
|
+
'scope_without_limit',
|
|
142
|
+
) {
|
|
143
|
+
override readonly name = 'KeyAuthorization.ScopeWithoutLimitError'
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/** A selector does not parse, a TIP-20 scope allows any function, or a headless call is unknown. */
|
|
147
|
+
export class UnsupportedCallError extends ErrorResponse.define(
|
|
148
|
+
'unsupported_call',
|
|
149
|
+
) {
|
|
150
|
+
override readonly name = 'KeyAuthorization.UnsupportedCallError'
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/** A limit names a token that is not supported on the chain. */
|
|
154
|
+
export class UnsupportedTokenError extends ErrorResponse.define(
|
|
155
|
+
'unsupported_token',
|
|
156
|
+
) {
|
|
157
|
+
override readonly name = 'KeyAuthorization.UnsupportedTokenError'
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/** The key names a passkey-owned Tempo Account, whose passkey signs only on a Tempo ID page. */
|
|
161
|
+
export class WebAuthnRequiredError extends ErrorResponse.define(
|
|
162
|
+
'webauthn_required',
|
|
163
|
+
) {
|
|
164
|
+
override readonly name = 'KeyAuthorization.WebAuthnRequiredError'
|
|
165
|
+
|
|
166
|
+
constructor(options: WebAuthnRequiredError.Options) {
|
|
167
|
+
super({
|
|
168
|
+
error_description:
|
|
169
|
+
options.description ??
|
|
170
|
+
`Passkey required: Tempo Account ${options.account} signs key authorizations only with its passkey, on a Tempo ID page. Authorize through a redirect, popup, or device grant, or name another account.`,
|
|
171
|
+
field: 'key_authorization.account',
|
|
172
|
+
meta: { account: options.account },
|
|
173
|
+
})
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export declare namespace WebAuthnRequiredError {
|
|
178
|
+
type Options = {
|
|
179
|
+
/** The passkey-owned account. */
|
|
180
|
+
account: `0x${string}`
|
|
181
|
+
/** Replaces the default `error_description`. */
|
|
182
|
+
description?: string | undefined
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/** A `0x`-prefixed hex string, with its digits checked for `Hex.toBigInt`. */
|
|
187
|
+
const hex = z
|
|
188
|
+
.templateLiteral(['0x', z.string().regex(/^[0-9a-fA-F]*$/)])
|
|
189
|
+
.meta({ pattern: '^0x[0-9a-fA-F]*$' })
|
|
190
|
+
|
|
191
|
+
/** A 20-byte address. */
|
|
192
|
+
const address = z
|
|
193
|
+
.templateLiteral(['0x', z.string().regex(/^[0-9a-fA-F]{40}$/)])
|
|
194
|
+
.meta({ pattern: '^0x[0-9a-fA-F]{40}$' })
|
|
195
|
+
|
|
196
|
+
/** A hex quantity of at most 256 bits, which bounds work before authentication. */
|
|
197
|
+
const quantity = z
|
|
198
|
+
.templateLiteral(['0x', z.string().regex(/^[0-9a-fA-F]{0,64}$/)])
|
|
199
|
+
.meta({ pattern: '^0x[0-9a-fA-F]{0,64}$' })
|
|
200
|
+
|
|
201
|
+
/** A 32-byte value as hex. */
|
|
202
|
+
const bytes32 = z
|
|
203
|
+
.templateLiteral(['0x', z.string().regex(/^[0-9a-fA-F]{64}$/)])
|
|
204
|
+
.meta({ pattern: '^0x[0-9a-fA-F]{64}$' })
|
|
205
|
+
|
|
206
|
+
/** A bigint, sent as a hex quantity, which carries `examples` since Zod drops a codec's. */
|
|
207
|
+
function bigint(options: bigint.Options) {
|
|
208
|
+
return z.codec(
|
|
209
|
+
z.union([quantity.meta({ examples: options.examples }), z.bigint()]),
|
|
210
|
+
z.bigint(),
|
|
211
|
+
{
|
|
212
|
+
decode: (value) =>
|
|
213
|
+
typeof value === 'bigint'
|
|
214
|
+
? value
|
|
215
|
+
: value === '0x'
|
|
216
|
+
? 0n
|
|
217
|
+
: Hex.toBigInt(value),
|
|
218
|
+
encode: (value) => Hex.fromNumber(value),
|
|
219
|
+
},
|
|
220
|
+
)
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
declare namespace bigint {
|
|
224
|
+
type Options = {
|
|
225
|
+
/** Hex examples for the OpenAPI document. */
|
|
226
|
+
examples: readonly `0x${string}`[]
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/** An app's key authorization request as sent, with the Tempo Account it acts for. */
|
|
231
|
+
const sent = z.object({
|
|
232
|
+
/** The Tempo Account. Defaults to the account selected at sign-in, or the oldest. */
|
|
233
|
+
account: z.optional(address).meta({
|
|
234
|
+
description:
|
|
235
|
+
'The Tempo Account the key acts for. Defaults to the account selected at sign-in, or else the oldest account.',
|
|
236
|
+
examples: ['0x9a073914db0d149375ac2b7fbb72c68c0780fb5f'],
|
|
237
|
+
}),
|
|
238
|
+
/** The access key's address. `publicKey` may stand in for it. */
|
|
239
|
+
address: z.optional(address).meta({
|
|
240
|
+
description:
|
|
241
|
+
"The access key's address. Required unless `publicKey` is present.",
|
|
242
|
+
examples: ['0x81c0f22bd173c115d18eeea0f6a38e935ecf52fb'],
|
|
243
|
+
}),
|
|
244
|
+
/** Defaults to Tempo mainnet. */
|
|
245
|
+
chainId: z.optional(bigint({ examples: ['0x1079'] })).meta({
|
|
246
|
+
description:
|
|
247
|
+
'The chain ID the key acts on, as a hex quantity. Defaults to Tempo mainnet.',
|
|
248
|
+
}),
|
|
249
|
+
/** Unix seconds. Defaults to a year from now, for a first-party app. */
|
|
250
|
+
expiry: z.optional(z.number()).meta({
|
|
251
|
+
description:
|
|
252
|
+
'When the key expires, in Unix seconds. Defaults to one year after the request for a first-party app, and a third-party app must name it.',
|
|
253
|
+
examples: [1893456000],
|
|
254
|
+
}),
|
|
255
|
+
/** Defaults to `secp256k1`. */
|
|
256
|
+
keyType: z.optional(z.enum(['p256', 'secp256k1', 'webAuthn'])).meta({
|
|
257
|
+
description:
|
|
258
|
+
'The signature scheme of the access key. Defaults to `secp256k1`.',
|
|
259
|
+
examples: ['secp256k1'],
|
|
260
|
+
}),
|
|
261
|
+
/** Defaults to the cap of each token it calls, or of OUSD, for a first-party app. */
|
|
262
|
+
limits: z
|
|
263
|
+
.optional(
|
|
264
|
+
z
|
|
265
|
+
.array(
|
|
266
|
+
z.object({
|
|
267
|
+
limit: bigint({ examples: ['0x989680'] }).meta({
|
|
268
|
+
description:
|
|
269
|
+
'The most of the token the key may spend, in base units, as a hex quantity. Applies per period when `period` is set.',
|
|
270
|
+
}),
|
|
271
|
+
period: z.optional(z.number()).meta({
|
|
272
|
+
description:
|
|
273
|
+
'Seconds after which the limit resets. Omitted or 0 for a one-time limit.',
|
|
274
|
+
examples: [86400],
|
|
275
|
+
}),
|
|
276
|
+
token: address.meta({
|
|
277
|
+
description: 'The TIP-20 token the limit applies to.',
|
|
278
|
+
examples: ['0x20c0000000000000000000006a37DA5C996874BE'],
|
|
279
|
+
}),
|
|
280
|
+
}),
|
|
281
|
+
)
|
|
282
|
+
.readonly(),
|
|
283
|
+
)
|
|
284
|
+
.meta({
|
|
285
|
+
description:
|
|
286
|
+
'The spending limit on each token. Defaults to the cap of each token that the scopes call, else of OUSD, for a first-party app, and a third-party app must name them.',
|
|
287
|
+
}),
|
|
288
|
+
/** The access key's public key. */
|
|
289
|
+
publicKey: z.optional(hex).meta({
|
|
290
|
+
description:
|
|
291
|
+
"The access key's uncompressed public key, as hex. Tempo ID derives `address` from it when `address` is absent.",
|
|
292
|
+
examples: [
|
|
293
|
+
'0x0438ef39ed22456a6956f380ebc18c50bd18c0402658bc52903817cc8a1e8b2f7ed1da68afc7f343c1debc44c04ac60e62e96bbb261d2226e7a7b96e64fd0f0765',
|
|
294
|
+
],
|
|
295
|
+
}),
|
|
296
|
+
/** Defaults to transfers of each token it limits, for a first-party app. */
|
|
297
|
+
scopes: z
|
|
298
|
+
.optional(
|
|
299
|
+
z
|
|
300
|
+
.array(
|
|
301
|
+
z.object({
|
|
302
|
+
address: address.meta({
|
|
303
|
+
description:
|
|
304
|
+
'The contract the key may call, such as a TIP-20 token or the TIP-1034 channel reserve at `0x4d50500000000000000000000000000000000000`.',
|
|
305
|
+
examples: ['0x20c0000000000000000000006a37DA5C996874BE'],
|
|
306
|
+
}),
|
|
307
|
+
recipients: z.optional(z.array(address).readonly()).meta({
|
|
308
|
+
description:
|
|
309
|
+
'The only addresses the call may name as recipient or spender. Required for `approve`, and refused on any call but `transfer`, `transferWithMemo`, and `approve` on a TIP-20 token.',
|
|
310
|
+
examples: [['0xff5deded16eb46018387144ff8bf41f26afb41af']],
|
|
311
|
+
}),
|
|
312
|
+
selector: z.optional(z.union([hex, z.string().max(256)])).meta({
|
|
313
|
+
description:
|
|
314
|
+
'The function the key may call, as a 4-byte selector or a function signature. Absent, the key may call any function on the contract, which a TIP-20 token refuses, and the target takes no other scope. A headless flow accepts only `transfer`, `transferWithMemo`, and `approve` on a listed token, and `open` and `topUp` on the channel reserve, unless the app holds `tempo-id:sign`.',
|
|
315
|
+
examples: ['0xa9059cbb', 'transfer(address,uint256)'],
|
|
316
|
+
}),
|
|
317
|
+
}),
|
|
318
|
+
)
|
|
319
|
+
.readonly(),
|
|
320
|
+
)
|
|
321
|
+
.meta({
|
|
322
|
+
description:
|
|
323
|
+
'The calls the key may make. Defaults to `transfer` and `transferWithMemo` on each token that the key limits for a first-party app, and a third-party app must name them.',
|
|
324
|
+
}),
|
|
325
|
+
})
|
|
326
|
+
|
|
327
|
+
/** Zod schemas for key authorization requests and responses. */
|
|
328
|
+
export namespace schema {
|
|
329
|
+
/** The Tempo Account a signed key acts for. */
|
|
330
|
+
export const account = address.meta({
|
|
331
|
+
description: 'The Tempo Account the key acts for.',
|
|
332
|
+
examples: ['0x9a073914db0d149375ac2b7fbb72c68c0780fb5f'],
|
|
333
|
+
})
|
|
334
|
+
|
|
335
|
+
/** An app's key authorization request, with the headless ceiling as its defaults. */
|
|
336
|
+
export const request = z.optional(sent.transform(defaults)).meta({
|
|
337
|
+
description:
|
|
338
|
+
"A key authorization for the app's own key: the shape of the Accounts SDK's `wallet_connect` `authorizeAccessKey` capability. Omitted fields default to the headless ceiling.",
|
|
339
|
+
id: 'KeyAuthorizationRequest',
|
|
340
|
+
})
|
|
341
|
+
|
|
342
|
+
/** What a key grants, as `describe` returns it. */
|
|
343
|
+
export const description = z
|
|
344
|
+
.object({
|
|
345
|
+
account: address.optional().meta({
|
|
346
|
+
description:
|
|
347
|
+
'The Tempo Account the request names. Absent when the request names none.',
|
|
348
|
+
examples: ['0x9a073914db0d149375ac2b7fbb72c68c0780fb5f'],
|
|
349
|
+
}),
|
|
350
|
+
calls: z
|
|
351
|
+
.array(
|
|
352
|
+
z.object({
|
|
353
|
+
call: z.enum(['open', 'topUp']).meta({
|
|
354
|
+
description:
|
|
355
|
+
'The call on the channel reserve, which MPP sessions pay through: `open` starts a payment channel, and `topUp` adds to its deposit.',
|
|
356
|
+
examples: ['open', 'topUp'],
|
|
357
|
+
}),
|
|
358
|
+
}),
|
|
359
|
+
)
|
|
360
|
+
.readonly()
|
|
361
|
+
.meta({
|
|
362
|
+
description:
|
|
363
|
+
'The calls on the channel reserve, in the order of the scopes, which the screens list beside the limits. Transfers and approvals spend within the limits, so none is listed.',
|
|
364
|
+
}),
|
|
365
|
+
expiry: z.number().meta({
|
|
366
|
+
description: 'Unix seconds.',
|
|
367
|
+
examples: [1893456000],
|
|
368
|
+
}),
|
|
369
|
+
limits: z
|
|
370
|
+
.array(
|
|
371
|
+
z.object({
|
|
372
|
+
amount: z.string().meta({
|
|
373
|
+
description: 'In whole units.',
|
|
374
|
+
examples: ['1000'],
|
|
375
|
+
}),
|
|
376
|
+
currency: z.string().meta({
|
|
377
|
+
description:
|
|
378
|
+
"The tokens' currency, such as `USD`. A yield-bearing token names its own.",
|
|
379
|
+
examples: ['USD'],
|
|
380
|
+
}),
|
|
381
|
+
period: z
|
|
382
|
+
.number()
|
|
383
|
+
.optional()
|
|
384
|
+
.meta({
|
|
385
|
+
description:
|
|
386
|
+
'Seconds after which the amount resets. Omitted for a one-time limit.',
|
|
387
|
+
examples: [86400],
|
|
388
|
+
}),
|
|
389
|
+
tokens: z
|
|
390
|
+
.array(
|
|
391
|
+
z.object({
|
|
392
|
+
amount: z.string().meta({
|
|
393
|
+
description: "The token's own limit, in whole units.",
|
|
394
|
+
examples: ['1000'],
|
|
395
|
+
}),
|
|
396
|
+
symbol: z.string().meta({
|
|
397
|
+
description:
|
|
398
|
+
"The token's symbol, or its address when the token has no symbol.",
|
|
399
|
+
examples: ['OUSD'],
|
|
400
|
+
}),
|
|
401
|
+
}),
|
|
402
|
+
)
|
|
403
|
+
.readonly()
|
|
404
|
+
.meta({ description: 'The tokens the amount spans.' }),
|
|
405
|
+
}),
|
|
406
|
+
)
|
|
407
|
+
.readonly()
|
|
408
|
+
.meta({
|
|
409
|
+
description:
|
|
410
|
+
'The spending limits, totaled for each currency and period.',
|
|
411
|
+
}),
|
|
412
|
+
unrecognized: z
|
|
413
|
+
.array(
|
|
414
|
+
z.object({
|
|
415
|
+
address: address.meta({
|
|
416
|
+
description: 'The contract that the call targets.',
|
|
417
|
+
examples: ['0x9a073914db0d149375ac2b7fbb72c68c0780fb5f'],
|
|
418
|
+
}),
|
|
419
|
+
selector: hex.optional().meta({
|
|
420
|
+
description:
|
|
421
|
+
'The 4-byte selector of the function. Absent when the scope allows any function on the contract.',
|
|
422
|
+
examples: ['0x12345678'],
|
|
423
|
+
}),
|
|
424
|
+
}),
|
|
425
|
+
)
|
|
426
|
+
.readonly()
|
|
427
|
+
.meta({
|
|
428
|
+
description:
|
|
429
|
+
'The calls that Tempo ID does not recognize, which the screens warn about. Empty when it recognizes every call.',
|
|
430
|
+
}),
|
|
431
|
+
})
|
|
432
|
+
.meta({
|
|
433
|
+
description: 'What a key authorization grants, for approval screens.',
|
|
434
|
+
id: 'KeyAuthorizationDescription',
|
|
435
|
+
})
|
|
436
|
+
|
|
437
|
+
/** A primitive signature envelope, in the node's RPC format. */
|
|
438
|
+
const primitive = z
|
|
439
|
+
.discriminatedUnion('type', [
|
|
440
|
+
z
|
|
441
|
+
.object({
|
|
442
|
+
r: hex.meta({
|
|
443
|
+
description: "The signature's 32-byte `r` value.",
|
|
444
|
+
examples: [
|
|
445
|
+
'0x12fe6a88b99377b94d6a628a86b9df544202c7b03827f44b16ee1a266ab98e17',
|
|
446
|
+
],
|
|
447
|
+
}),
|
|
448
|
+
s: hex.meta({
|
|
449
|
+
description: "The signature's 32-byte `s` value.",
|
|
450
|
+
examples: [
|
|
451
|
+
'0x4b6aa3723402498e07fb1f071673bd969d9f49a286af15ac60581d07ade24b77',
|
|
452
|
+
],
|
|
453
|
+
}),
|
|
454
|
+
type: z.literal('secp256k1').meta({
|
|
455
|
+
description: 'A secp256k1 ECDSA signature.',
|
|
456
|
+
}),
|
|
457
|
+
v: hex.optional().meta({
|
|
458
|
+
description:
|
|
459
|
+
'The legacy recovery value, which `yParity` replaces. Absent in most envelopes.',
|
|
460
|
+
examples: ['0x1c'],
|
|
461
|
+
}),
|
|
462
|
+
yParity: hex.meta({
|
|
463
|
+
description:
|
|
464
|
+
'The parity of the y-coordinate of the curve point, `0x0` or `0x1`.',
|
|
465
|
+
examples: ['0x1'],
|
|
466
|
+
}),
|
|
467
|
+
})
|
|
468
|
+
.meta({ description: 'A secp256k1 signature.' }),
|
|
469
|
+
z
|
|
470
|
+
.object({
|
|
471
|
+
preHash: z.boolean().meta({
|
|
472
|
+
description:
|
|
473
|
+
'Whether the signer hashed the digest with SHA-256 before signing it, as WebCrypto keys do.',
|
|
474
|
+
examples: [true],
|
|
475
|
+
}),
|
|
476
|
+
pubKeyX: hex.meta({
|
|
477
|
+
description:
|
|
478
|
+
"The 32-byte x-coordinate of the signer's P256 public key.",
|
|
479
|
+
examples: [
|
|
480
|
+
'0xdae3e3e5faba0a2aca73d4d2a4b84ad46460f3f23af8a60b17b8a13537cfd440',
|
|
481
|
+
],
|
|
482
|
+
}),
|
|
483
|
+
pubKeyY: hex.meta({
|
|
484
|
+
description:
|
|
485
|
+
"The 32-byte y-coordinate of the signer's P256 public key.",
|
|
486
|
+
examples: [
|
|
487
|
+
'0x816438c87ffd782cd0e37355eb83fbe1d4e5e905eaafa22fa27c32cc4abf7802',
|
|
488
|
+
],
|
|
489
|
+
}),
|
|
490
|
+
r: hex.meta({
|
|
491
|
+
description: "The signature's 32-byte `r` value.",
|
|
492
|
+
examples: [
|
|
493
|
+
'0x9da52cc71c005844434ce6996f7ea3b3262f84ec3a5d54f1d22d0bba9f2e5ea9',
|
|
494
|
+
],
|
|
495
|
+
}),
|
|
496
|
+
s: hex.meta({
|
|
497
|
+
description: "The signature's 32-byte `s` value.",
|
|
498
|
+
examples: [
|
|
499
|
+
'0x4b6aa3723402498e07fb1f071673bd969d9f49a286af15ac60581d07ade24b77',
|
|
500
|
+
],
|
|
501
|
+
}),
|
|
502
|
+
type: z.literal('p256').meta({
|
|
503
|
+
description: 'A P256 (secp256r1) signature.',
|
|
504
|
+
}),
|
|
505
|
+
})
|
|
506
|
+
.meta({ description: 'A P256 signature, with its public key.' }),
|
|
507
|
+
z
|
|
508
|
+
.object({
|
|
509
|
+
pubKeyX: hex.meta({
|
|
510
|
+
description:
|
|
511
|
+
"The 32-byte x-coordinate of the passkey's P256 public key.",
|
|
512
|
+
examples: [
|
|
513
|
+
'0xdae3e3e5faba0a2aca73d4d2a4b84ad46460f3f23af8a60b17b8a13537cfd440',
|
|
514
|
+
],
|
|
515
|
+
}),
|
|
516
|
+
pubKeyY: hex.meta({
|
|
517
|
+
description:
|
|
518
|
+
"The 32-byte y-coordinate of the passkey's P256 public key.",
|
|
519
|
+
examples: [
|
|
520
|
+
'0x816438c87ffd782cd0e37355eb83fbe1d4e5e905eaafa22fa27c32cc4abf7802',
|
|
521
|
+
],
|
|
522
|
+
}),
|
|
523
|
+
r: hex.meta({
|
|
524
|
+
description: "The signature's 32-byte `r` value.",
|
|
525
|
+
examples: [
|
|
526
|
+
'0x9da52cc71c005844434ce6996f7ea3b3262f84ec3a5d54f1d22d0bba9f2e5ea9',
|
|
527
|
+
],
|
|
528
|
+
}),
|
|
529
|
+
s: hex.meta({
|
|
530
|
+
description: "The signature's 32-byte `s` value.",
|
|
531
|
+
examples: [
|
|
532
|
+
'0x4b6aa3723402498e07fb1f071673bd969d9f49a286af15ac60581d07ade24b77',
|
|
533
|
+
],
|
|
534
|
+
}),
|
|
535
|
+
type: z.literal('webAuthn').meta({
|
|
536
|
+
description: 'A WebAuthn passkey signature.',
|
|
537
|
+
}),
|
|
538
|
+
webauthnData: hex.meta({
|
|
539
|
+
description:
|
|
540
|
+
"The assertion's authenticator data followed by its `clientDataJSON`, as hex.",
|
|
541
|
+
examples: [
|
|
542
|
+
'0xa7cb28053c8ee4e5394fc67a0018dc1c622dad5ce3591b8ca13094ae86d11ba605000000007b2274797065223a22776562617574686e2e676574222c226368616c6c656e6765223a2271334a306257467a6157356e6247567a6157647559585231636d566b6157646c633352765a6d746c65574631644767222c226f726967696e223a2268747470733a2f2f617574682e74656d706f2e78797a222c2263726f73734f726967696e223a66616c73657d',
|
|
543
|
+
],
|
|
544
|
+
}),
|
|
545
|
+
})
|
|
546
|
+
.meta({ description: 'A WebAuthn signature, with its public key.' }),
|
|
547
|
+
])
|
|
548
|
+
.meta({
|
|
549
|
+
description: 'A signature by one key, as secp256k1, P256, or WebAuthn.',
|
|
550
|
+
})
|
|
551
|
+
|
|
552
|
+
/** A signed key authorization in the node's RPC format, as `sign` returns it. */
|
|
553
|
+
export const rpc = z
|
|
554
|
+
.object({
|
|
555
|
+
account: address
|
|
556
|
+
.nullable()
|
|
557
|
+
.optional()
|
|
558
|
+
.meta({
|
|
559
|
+
description:
|
|
560
|
+
'The Tempo Account the key is bound to (TIP-1049). Absent or null when the key has no account binding.',
|
|
561
|
+
examples: ['0x9a073914db0d149375ac2b7fbb72c68c0780fb5f'],
|
|
562
|
+
}),
|
|
563
|
+
allowedCalls: z
|
|
564
|
+
.array(
|
|
565
|
+
z.object({
|
|
566
|
+
selectorRules: z
|
|
567
|
+
.array(
|
|
568
|
+
z.object({
|
|
569
|
+
recipients: z
|
|
570
|
+
.array(address)
|
|
571
|
+
.readonly()
|
|
572
|
+
.optional()
|
|
573
|
+
.meta({
|
|
574
|
+
description:
|
|
575
|
+
'The only addresses the call may name as recipient or spender. Absent when any address may receive.',
|
|
576
|
+
examples: [
|
|
577
|
+
['0xff5deded16eb46018387144ff8bf41f26afb41af'],
|
|
578
|
+
],
|
|
579
|
+
}),
|
|
580
|
+
selector: hex.meta({
|
|
581
|
+
description:
|
|
582
|
+
'The 4-byte selector of the function the key may call.',
|
|
583
|
+
examples: ['0xa9059cbb'],
|
|
584
|
+
}),
|
|
585
|
+
}),
|
|
586
|
+
)
|
|
587
|
+
.readonly()
|
|
588
|
+
.optional()
|
|
589
|
+
.meta({
|
|
590
|
+
description:
|
|
591
|
+
'The functions the key may call on the target. Absent when the key may call any function on it.',
|
|
592
|
+
}),
|
|
593
|
+
target: address.meta({
|
|
594
|
+
description: 'The contract the key may call.',
|
|
595
|
+
examples: ['0x20c0000000000000000000006a37DA5C996874BE'],
|
|
596
|
+
}),
|
|
597
|
+
}),
|
|
598
|
+
)
|
|
599
|
+
.readonly()
|
|
600
|
+
.optional()
|
|
601
|
+
.meta({
|
|
602
|
+
description:
|
|
603
|
+
'The calls the key may make. Absent when the key may make any call.',
|
|
604
|
+
}),
|
|
605
|
+
chainId: hex.meta({
|
|
606
|
+
description: 'The chain ID the key acts on, as a hex quantity.',
|
|
607
|
+
examples: ['0xa5bf'],
|
|
608
|
+
}),
|
|
609
|
+
expiry: hex
|
|
610
|
+
.nullable()
|
|
611
|
+
.optional()
|
|
612
|
+
.meta({
|
|
613
|
+
description:
|
|
614
|
+
'When the key expires, in Unix seconds, as a hex quantity. Absent or null when the key never expires.',
|
|
615
|
+
examples: ['0x6acdc1b4'],
|
|
616
|
+
}),
|
|
617
|
+
keyId: address.meta({
|
|
618
|
+
description: "The access key's address.",
|
|
619
|
+
examples: ['0x81c0f22bd173c115d18eeea0f6a38e935ecf52fb'],
|
|
620
|
+
}),
|
|
621
|
+
keyType: z.string().meta({
|
|
622
|
+
description:
|
|
623
|
+
'The signature scheme of the access key: `secp256k1`, `p256`, or `webAuthn`. The node names a configurable account key `multisig`.',
|
|
624
|
+
examples: ['secp256k1'],
|
|
625
|
+
}),
|
|
626
|
+
limits: z
|
|
627
|
+
.array(
|
|
628
|
+
z.object({
|
|
629
|
+
limit: hex.meta({
|
|
630
|
+
description:
|
|
631
|
+
'The most of the token the key may spend, in base units, as a hex quantity. Applies per period when `period` is set.',
|
|
632
|
+
examples: ['0x989680'],
|
|
633
|
+
}),
|
|
634
|
+
period: hex.optional().meta({
|
|
635
|
+
description:
|
|
636
|
+
'Seconds after which the limit resets, as a hex quantity. Absent or `0x0` for a one-time limit.',
|
|
637
|
+
examples: ['0x15180'],
|
|
638
|
+
}),
|
|
639
|
+
token: address.meta({
|
|
640
|
+
description: 'The TIP-20 token the limit applies to.',
|
|
641
|
+
examples: ['0x20c0000000000000000000006a37DA5C996874BE'],
|
|
642
|
+
}),
|
|
643
|
+
}),
|
|
644
|
+
)
|
|
645
|
+
.readonly()
|
|
646
|
+
.optional()
|
|
647
|
+
.meta({
|
|
648
|
+
description:
|
|
649
|
+
'The spending limit on each token, or absent when spending is unlimited. An empty list allows no spending.',
|
|
650
|
+
}),
|
|
651
|
+
signature: z
|
|
652
|
+
.union([
|
|
653
|
+
hex.meta({
|
|
654
|
+
description:
|
|
655
|
+
"A configurable account's RLP-encoded signature, which carries its owner approvals.",
|
|
656
|
+
examples: [
|
|
657
|
+
'0xf8a094ff5deded16eb46018387144ff8bf41f26afb41afc0f87cf87a80a012fe6a88b99377b94d6a628a86b9df544202c7b03827f44b16ee1a266ab98e17a04b6aa3723402498e07fb1f071673bd969d9f49a286af15ac60581d07ade24b77',
|
|
658
|
+
],
|
|
659
|
+
}),
|
|
660
|
+
primitive,
|
|
661
|
+
z
|
|
662
|
+
.object({
|
|
663
|
+
keyId: address.optional().meta({
|
|
664
|
+
description:
|
|
665
|
+
'The address of the access key that signed. Recovered from `signature` when absent.',
|
|
666
|
+
examples: ['0x624f27c462b885a83c698cac444a106a8c519e25'],
|
|
667
|
+
}),
|
|
668
|
+
signature: primitive.meta({
|
|
669
|
+
description: "The access key's own signature.",
|
|
670
|
+
}),
|
|
671
|
+
type: z.literal('keychain').meta({
|
|
672
|
+
description: 'A signature by an access key for an account.',
|
|
673
|
+
}),
|
|
674
|
+
userAddress: address.meta({
|
|
675
|
+
description: 'The Tempo Account the access key signs for.',
|
|
676
|
+
examples: ['0x9a073914db0d149375ac2b7fbb72c68c0780fb5f'],
|
|
677
|
+
}),
|
|
678
|
+
version: z
|
|
679
|
+
.enum(['v1', 'v2'])
|
|
680
|
+
.optional()
|
|
681
|
+
.meta({
|
|
682
|
+
description:
|
|
683
|
+
'The keychain signature version, `v1` by default. `v2` binds the signature to `userAddress`.',
|
|
684
|
+
examples: ['v2'],
|
|
685
|
+
}),
|
|
686
|
+
})
|
|
687
|
+
.meta({
|
|
688
|
+
description:
|
|
689
|
+
'An access key signature that wraps a primitive signature.',
|
|
690
|
+
}),
|
|
691
|
+
])
|
|
692
|
+
.meta({
|
|
693
|
+
description: "The owner's signature envelope, in the node's format.",
|
|
694
|
+
}),
|
|
695
|
+
witness: bytes32.optional().meta({
|
|
696
|
+
description:
|
|
697
|
+
'The witness the signature binds, when the request sent one.',
|
|
698
|
+
examples: [
|
|
699
|
+
'0xf1e22f902be2546fe35d49388503ef7ea5c6c0e95a0f4b89d474e58793b64dec',
|
|
700
|
+
],
|
|
701
|
+
}),
|
|
702
|
+
})
|
|
703
|
+
.meta({
|
|
704
|
+
description:
|
|
705
|
+
"A signed key authorization (TIP-1011), in the node's RPC format.",
|
|
706
|
+
id: 'KeyAuthorization',
|
|
707
|
+
})
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
/** An app's key authorization request. */
|
|
711
|
+
export type Key = NonNullable<z.output<typeof schema.request>>
|
|
712
|
+
|
|
713
|
+
/** A key authorization request as sent. */
|
|
714
|
+
type Request = z.output<typeof sent>
|
|
715
|
+
|
|
716
|
+
/** A key authorization request with every default filled. */
|
|
717
|
+
type Defaulted = Request & {
|
|
718
|
+
chainId: bigint
|
|
719
|
+
expiry: number
|
|
720
|
+
limits: NonNullable<Request['limits']>
|
|
721
|
+
scopes: NonNullable<Request['scopes']>
|
|
722
|
+
/** The witness that the owner's signature binds, from the request's challenge. */
|
|
723
|
+
witness?: Hex.Hex | undefined
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
/** A key's default lifetime, and a headless key's longest, in seconds. */
|
|
727
|
+
export const lifetime = 365 * 24 * 60 * 60
|
|
728
|
+
|
|
729
|
+
/** OUSD's address, the same on every Tempo chain, and the default token. */
|
|
730
|
+
const ousd = openUsd(tempo.id).address
|
|
731
|
+
|
|
732
|
+
/** Tempo chains, whose token addresses Viem's token list holds. */
|
|
733
|
+
export const chains = Chain.known
|
|
734
|
+
|
|
735
|
+
/** The default chain of a key: Tempo mainnet. */
|
|
736
|
+
export const defaultChainId = tempo.id
|
|
737
|
+
|
|
738
|
+
/** About $1,000 in each currency, in whole units. Unlisted currencies are yield-bearing dollars. */
|
|
739
|
+
// ponytail: the rates are fixed. If caps must track markets closely, price them live.
|
|
740
|
+
const caps: Record<string, string> = {
|
|
741
|
+
BRL: '5000',
|
|
742
|
+
BTC: '0.01',
|
|
743
|
+
CHF: '800',
|
|
744
|
+
EUR: '850',
|
|
745
|
+
GBP: '750',
|
|
746
|
+
USD: '1000',
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
/**
|
|
750
|
+
* MACH, the machine token that MPP sessions pay in, at the same address on mainnet and Moderato.
|
|
751
|
+
* Viem's token list does not name it.
|
|
752
|
+
*/
|
|
753
|
+
// ponytail: drop MACH once Viem's token list names it.
|
|
754
|
+
const mach = defineToken({
|
|
755
|
+
addresses: {
|
|
756
|
+
[tempo.id]: '0x20c000000000000000000000f37de3740adec032',
|
|
757
|
+
[tempoTestnet.id]: '0x20c000000000000000000000f37de3740adec032',
|
|
758
|
+
},
|
|
759
|
+
currency: 'USD',
|
|
760
|
+
decimals: 6,
|
|
761
|
+
name: 'MACH',
|
|
762
|
+
symbol: 'MACH',
|
|
763
|
+
})
|
|
764
|
+
|
|
765
|
+
/** Viem's Tempo tokens and MACH, by chain ID and lowercase address, with each cap in base units. */
|
|
766
|
+
const listed = new Map<
|
|
767
|
+
string,
|
|
768
|
+
{
|
|
769
|
+
address: Address.Address
|
|
770
|
+
cap: bigint
|
|
771
|
+
currency: string
|
|
772
|
+
decimals: number
|
|
773
|
+
symbol: string
|
|
774
|
+
}
|
|
775
|
+
>(
|
|
776
|
+
[...tokens.tempo, mach].flatMap((token) =>
|
|
777
|
+
chains.flatMap((chain) => {
|
|
778
|
+
const addresses = token.addresses as Record<number, string>
|
|
779
|
+
// Devnets and a local Tempo node predeploy the testnet's tokens, at the same addresses, and
|
|
780
|
+
// Viem's list names none for them. OUSD has its mainnet address on every Tempo chain, which
|
|
781
|
+
// Viem's list names only for mainnet.
|
|
782
|
+
// ponytail: drop the OUSD fallback once Viem lists OUSD on testnet.
|
|
783
|
+
const address =
|
|
784
|
+
addresses[chain.id] ??
|
|
785
|
+
(chain.id === tempoDevnet.id || chain.id === tempoLocalnet.id
|
|
786
|
+
? addresses[tempoTestnet.id]
|
|
787
|
+
: undefined) ??
|
|
788
|
+
(token.symbol === 'OUSD' ? addresses[tempo.id] : undefined)
|
|
789
|
+
if (!address) return []
|
|
790
|
+
const cap = caps[token.currency ?? ''] ?? caps.USD!
|
|
791
|
+
return [
|
|
792
|
+
[
|
|
793
|
+
`${chain.id}:${address.toLowerCase()}`,
|
|
794
|
+
{
|
|
795
|
+
address: Address.checksum(address),
|
|
796
|
+
cap: Value.from(cap, token.decimals),
|
|
797
|
+
currency: token.currency,
|
|
798
|
+
decimals: token.decimals,
|
|
799
|
+
symbol: token.symbol ?? address,
|
|
800
|
+
},
|
|
801
|
+
] as const,
|
|
802
|
+
]
|
|
803
|
+
}),
|
|
804
|
+
),
|
|
805
|
+
)
|
|
806
|
+
|
|
807
|
+
/**
|
|
808
|
+
* TIP-20 calls that the key's limits bound. `approve` needs a spender allowlist, since an approved
|
|
809
|
+
* spender moves tokens without the key.
|
|
810
|
+
*/
|
|
811
|
+
const calls = {
|
|
812
|
+
approve: AbiFunction.getSelector('approve(address,uint256)'),
|
|
813
|
+
transfer: AbiFunction.getSelector('transfer(address,uint256)'),
|
|
814
|
+
transferWithMemo: AbiFunction.getSelector(
|
|
815
|
+
'transferWithMemo(address,uint256,bytes32)',
|
|
816
|
+
),
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
/** The TIP-1034 channel reserve, whose `open` and `topUp` deposits spend within key limits. */
|
|
820
|
+
const reserve = {
|
|
821
|
+
address: Addresses.tip20ChannelReserve,
|
|
822
|
+
open: Selectors.tip20ChannelReserve.open,
|
|
823
|
+
topUp: Selectors.tip20ChannelReserve.topUp,
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
/**
|
|
827
|
+
* Whether `scope` calls `transfer`, `transferWithMemo`, or `approve` on a listed token, or `open` or
|
|
828
|
+
* `topUp` on the channel reserve. The approval screens warn about any other call.
|
|
829
|
+
*/
|
|
830
|
+
function recognized(key: Key, scope: Key['scopes'][number]) {
|
|
831
|
+
const selector =
|
|
832
|
+
scope.selector === undefined ? undefined : normalize(scope.selector)
|
|
833
|
+
if (scope.address.toLowerCase() === reserve.address)
|
|
834
|
+
return selector === reserve.open || selector === reserve.topUp
|
|
835
|
+
return (
|
|
836
|
+
Boolean(token(key, scope.address)) &&
|
|
837
|
+
(selector === calls.approve ||
|
|
838
|
+
selector === calls.transfer ||
|
|
839
|
+
selector === calls.transferWithMemo)
|
|
840
|
+
)
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
/** Returns `key` with the EIP-191 hash of `challenge` as its witness, or unchanged without one. */
|
|
844
|
+
export function bind(key: Key, options: bind.Options): Key {
|
|
845
|
+
if (options.challenge === undefined) return key
|
|
846
|
+
return { ...key, witness: hashMessage(options.challenge) }
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
export declare namespace bind {
|
|
850
|
+
type Options = {
|
|
851
|
+
/** The app's challenge, such as a sign-in message from its backend. */
|
|
852
|
+
challenge: string | undefined
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
/**
|
|
857
|
+
* Returns the refusal for a `key` that breaks the rules of every flow, or `undefined`. Its `field`
|
|
858
|
+
* is a path under `key_authorization`.
|
|
859
|
+
*/
|
|
860
|
+
export function check(
|
|
861
|
+
key: Key,
|
|
862
|
+
): ErrorResponse.Instance<typeof check.errors> | undefined {
|
|
863
|
+
const now = Math.floor(Date.now() / 1000)
|
|
864
|
+
|
|
865
|
+
// Nodes reject chain ID zero, so a key names its chain.
|
|
866
|
+
if (!key.chainId)
|
|
867
|
+
return new InvalidChainError({
|
|
868
|
+
error_description:
|
|
869
|
+
'Invalid `chainId`: 0. Use a Tempo chain ID, such as 4217.',
|
|
870
|
+
field: 'key_authorization.chainId',
|
|
871
|
+
meta: { chain_id: 0 },
|
|
872
|
+
})
|
|
873
|
+
const chainId = Number(key.chainId)
|
|
874
|
+
if (!key.address && !key.publicKey)
|
|
875
|
+
return new MissingKeyError({
|
|
876
|
+
error_description:
|
|
877
|
+
'Missing `address` or `publicKey`. Provide the access key.',
|
|
878
|
+
field: 'key_authorization.address',
|
|
879
|
+
})
|
|
880
|
+
// The chain rejects the zero address, which no key holds, also beside a public key.
|
|
881
|
+
if (key.address === zeroAddress)
|
|
882
|
+
return new MissingKeyError({
|
|
883
|
+
error_description:
|
|
884
|
+
'Invalid `address`: the zero address holds no key. Provide the address of the access key.',
|
|
885
|
+
field: 'key_authorization.address',
|
|
886
|
+
})
|
|
887
|
+
if (key.publicKey && !parse(key.publicKey))
|
|
888
|
+
return new InvalidPublicKeyError({
|
|
889
|
+
error_description:
|
|
890
|
+
'Invalid `publicKey`. Provide an uncompressed public key, or `address`.',
|
|
891
|
+
field: 'key_authorization.publicKey',
|
|
892
|
+
})
|
|
893
|
+
if (!Number.isSafeInteger(key.expiry))
|
|
894
|
+
return new InvalidExpiryError({
|
|
895
|
+
error_description: `Invalid \`expiry\`: ${key.expiry} is not a whole number of seconds. Use a future Unix time in seconds.`,
|
|
896
|
+
field: 'key_authorization.expiry',
|
|
897
|
+
meta: { expiry: key.expiry },
|
|
898
|
+
})
|
|
899
|
+
// Zero means the key never expires.
|
|
900
|
+
if (key.expiry === 0)
|
|
901
|
+
return new InvalidExpiryError({
|
|
902
|
+
error_description:
|
|
903
|
+
'Invalid `expiry`: 0 never expires. Use a future Unix time.',
|
|
904
|
+
field: 'key_authorization.expiry',
|
|
905
|
+
meta: { expiry: 0 },
|
|
906
|
+
})
|
|
907
|
+
if (key.expiry <= now)
|
|
908
|
+
return new ExpiryPassedError({
|
|
909
|
+
error_description: `Invalid \`expiry\`: ${date(key.expiry)} has passed. Use a future Unix time.`,
|
|
910
|
+
field: 'key_authorization.expiry',
|
|
911
|
+
meta: { expiry: key.expiry, now },
|
|
912
|
+
})
|
|
913
|
+
if (!key.limits.length)
|
|
914
|
+
return new EmptyLimitsError({
|
|
915
|
+
error_description:
|
|
916
|
+
'Empty `limits`. Name at least one token, or omit `limits`.',
|
|
917
|
+
field: 'key_authorization.limits',
|
|
918
|
+
})
|
|
919
|
+
if (!key.scopes.length)
|
|
920
|
+
return new EmptyScopesError({
|
|
921
|
+
error_description:
|
|
922
|
+
'Empty `scopes`. Name at least one call, or omit `scopes`.',
|
|
923
|
+
field: 'key_authorization.scopes',
|
|
924
|
+
})
|
|
925
|
+
|
|
926
|
+
const seen = new Set<string>()
|
|
927
|
+
for (const [index, limit] of key.limits.entries()) {
|
|
928
|
+
// TIP-1011 rejects a key that limits one token twice.
|
|
929
|
+
if (seen.has(limit.token.toLowerCase()))
|
|
930
|
+
return new DuplicateLimitError({
|
|
931
|
+
error_description: `Duplicate limit for ${limit.token}. Limit each token once.`,
|
|
932
|
+
field: `key_authorization.limits.${index}.token`,
|
|
933
|
+
meta: { token: limit.token },
|
|
934
|
+
})
|
|
935
|
+
seen.add(limit.token.toLowerCase())
|
|
936
|
+
|
|
937
|
+
const listing = token(key, limit.token)
|
|
938
|
+
if (!listing)
|
|
939
|
+
return new UnsupportedTokenError({
|
|
940
|
+
error_description: `Unsupported token on chain ${chainId}: ${limit.token}. Use a supported token, such as OUSD.`,
|
|
941
|
+
field: `key_authorization.limits.${index}.token`,
|
|
942
|
+
meta: { chain_id: chainId, token: limit.token },
|
|
943
|
+
})
|
|
944
|
+
if (
|
|
945
|
+
limit.period !== undefined &&
|
|
946
|
+
(!Number.isSafeInteger(limit.period) || limit.period < 0)
|
|
947
|
+
)
|
|
948
|
+
return new InvalidPeriodError({
|
|
949
|
+
error_description: `Invalid \`period\` on the ${listing.symbol} limit: ${limit.period}. Use a whole number of seconds, or 0 for a one-time limit.`,
|
|
950
|
+
field: `key_authorization.limits.${index}.period`,
|
|
951
|
+
meta: {
|
|
952
|
+
period: limit.period,
|
|
953
|
+
symbol: listing.symbol,
|
|
954
|
+
token: listing.address,
|
|
955
|
+
},
|
|
956
|
+
})
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
const rules = new Set<string>()
|
|
960
|
+
// Whether each target's scopes allow any function or name functions. TIP-1011 groups the scopes
|
|
961
|
+
// of a target into one rule, which cannot hold both, so the signed key would drop one.
|
|
962
|
+
const targets = new Map<string, 'any' | 'named'>()
|
|
963
|
+
for (const [index, scope] of key.scopes.entries()) {
|
|
964
|
+
const listing = token(key, scope.address)
|
|
965
|
+
// A call on a listed token moves it, so the key limits that token.
|
|
966
|
+
if (
|
|
967
|
+
listing &&
|
|
968
|
+
!key.limits.some((limit) => Address.isEqual(limit.token, scope.address))
|
|
969
|
+
)
|
|
970
|
+
return new ScopeWithoutLimitError({
|
|
971
|
+
error_description: `Scope on ${listing.symbol} has no limit. Add a limit for it, or remove the scope.`,
|
|
972
|
+
field: `key_authorization.scopes.${index}.address`,
|
|
973
|
+
meta: { token: scope.address },
|
|
974
|
+
})
|
|
975
|
+
|
|
976
|
+
const target = listing?.symbol ?? scope.address
|
|
977
|
+
const named = {
|
|
978
|
+
...(listing ? { symbol: listing.symbol } : {}),
|
|
979
|
+
token: scope.address,
|
|
980
|
+
}
|
|
981
|
+
// An empty selector names no function, so it is refused, not read as any function.
|
|
982
|
+
const selector =
|
|
983
|
+
scope.selector === undefined ? undefined : normalize(scope.selector)
|
|
984
|
+
if (scope.selector !== undefined && !selector)
|
|
985
|
+
return new UnsupportedCallError({
|
|
986
|
+
error_description: `Unsupported call on ${target}: the selector does not parse. Use a 4-byte selector or a function signature.`,
|
|
987
|
+
field: `key_authorization.scopes.${index}.selector`,
|
|
988
|
+
meta: named,
|
|
989
|
+
})
|
|
990
|
+
// Any function includes `approve`, whose spenders TIP-1011 attaches only to an `approve` scope.
|
|
991
|
+
if (!selector && tip20(scope.address))
|
|
992
|
+
return new UnsupportedCallError({
|
|
993
|
+
error_description: `Unsupported call on ${target}: any function, which includes \`approve\` without spenders. Name each function in \`selector\`, such as \`transfer\`.`,
|
|
994
|
+
field: `key_authorization.scopes.${index}.selector`,
|
|
995
|
+
meta: named,
|
|
996
|
+
})
|
|
997
|
+
// An approved spender moves tokens without the key ([TIP-1011](https://tips.sh/1011)).
|
|
998
|
+
if (selector === calls.approve && !scope.recipients?.length)
|
|
999
|
+
return new MissingRecipientsError({
|
|
1000
|
+
error_description: `Missing \`recipients\` for \`approve\` on ${target}. Name the allowed spenders.`,
|
|
1001
|
+
field: `key_authorization.scopes.${index}.recipients`,
|
|
1002
|
+
meta: named,
|
|
1003
|
+
})
|
|
1004
|
+
// TIP-1011 accepts recipients only on these calls on a TIP-20 token.
|
|
1005
|
+
if (
|
|
1006
|
+
scope.recipients?.length &&
|
|
1007
|
+
(!tip20(scope.address) ||
|
|
1008
|
+
(selector !== calls.approve &&
|
|
1009
|
+
selector !== calls.transfer &&
|
|
1010
|
+
selector !== calls.transferWithMemo))
|
|
1011
|
+
)
|
|
1012
|
+
return new InvalidRecipientsError({
|
|
1013
|
+
error_description: `Invalid \`recipients\` for ${selector ?? 'any function'} on ${target}. Remove \`recipients\`, since only \`transfer\`, \`transferWithMemo\`, and \`approve\` on a TIP-20 token take them.`,
|
|
1014
|
+
field: `key_authorization.scopes.${index}.recipients`,
|
|
1015
|
+
meta: named,
|
|
1016
|
+
})
|
|
1017
|
+
|
|
1018
|
+
// TIP-1011 rejects a key that names one call on a target twice.
|
|
1019
|
+
const rule = `${scope.address.toLowerCase()}:${selector ?? 'any'}`
|
|
1020
|
+
if (rules.has(rule))
|
|
1021
|
+
return new DuplicateScopeError({
|
|
1022
|
+
error_description: `Duplicate scope for ${selector ?? 'any function'} on ${target}. Name each call on a target once.`,
|
|
1023
|
+
field: `key_authorization.scopes.${index}.selector`,
|
|
1024
|
+
meta: { ...(selector ? { selector } : {}), ...named },
|
|
1025
|
+
})
|
|
1026
|
+
rules.add(rule)
|
|
1027
|
+
|
|
1028
|
+
const kind = selector ? 'named' : 'any'
|
|
1029
|
+
const other = targets.get(scope.address.toLowerCase())
|
|
1030
|
+
if (other && other !== kind)
|
|
1031
|
+
return new DuplicateScopeError({
|
|
1032
|
+
error_description: `Conflicting scopes on ${target}: one allows any function, and another names ${selector ?? 'a function'}. Keep the scope for any function, or name each function.`,
|
|
1033
|
+
field: `key_authorization.scopes.${index}.selector`,
|
|
1034
|
+
meta: { ...(selector ? { selector } : {}), ...named },
|
|
1035
|
+
})
|
|
1036
|
+
targets.set(scope.address.toLowerCase(), kind)
|
|
1037
|
+
|
|
1038
|
+
// TIP-1011 rejects recipients that hold the zero address or repeat an address.
|
|
1039
|
+
const unique = new Set<string>()
|
|
1040
|
+
const position = (scope.recipients ?? []).findIndex((entry) => {
|
|
1041
|
+
const recipient = entry.toLowerCase()
|
|
1042
|
+
if (recipient === zeroAddress || unique.has(recipient)) return true
|
|
1043
|
+
unique.add(recipient)
|
|
1044
|
+
return false
|
|
1045
|
+
})
|
|
1046
|
+
const recipient = scope.recipients?.[position]
|
|
1047
|
+
if (recipient)
|
|
1048
|
+
return new InvalidRecipientsError({
|
|
1049
|
+
error_description: `Invalid recipient ${recipient} for ${selector} on ${target}. Name each recipient once, and never the zero address.`,
|
|
1050
|
+
field: `key_authorization.scopes.${index}.recipients.${position}`,
|
|
1051
|
+
meta: { recipient, ...named },
|
|
1052
|
+
})
|
|
1053
|
+
}
|
|
1054
|
+
return undefined
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1057
|
+
export namespace check {
|
|
1058
|
+
/** The refusals `check` returns. Its return type admits no other. */
|
|
1059
|
+
export const errors = [
|
|
1060
|
+
DuplicateLimitError,
|
|
1061
|
+
DuplicateScopeError,
|
|
1062
|
+
EmptyLimitsError,
|
|
1063
|
+
EmptyScopesError,
|
|
1064
|
+
ExpiryPassedError,
|
|
1065
|
+
InvalidChainError,
|
|
1066
|
+
InvalidExpiryError,
|
|
1067
|
+
InvalidPeriodError,
|
|
1068
|
+
InvalidPublicKeyError,
|
|
1069
|
+
InvalidRecipientsError,
|
|
1070
|
+
MissingKeyError,
|
|
1071
|
+
MissingRecipientsError,
|
|
1072
|
+
ScopeWithoutLimitError,
|
|
1073
|
+
UnsupportedCallError,
|
|
1074
|
+
UnsupportedTokenError,
|
|
1075
|
+
] as const
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
/** Returns `ChallengeNotPermittedError` if `key` has a witness that the app may not bind. */
|
|
1079
|
+
export function checkChallenge(
|
|
1080
|
+
options: checkChallenge.Options,
|
|
1081
|
+
): ErrorResponse.Instance<typeof checkChallenge.errors> | undefined {
|
|
1082
|
+
const { app, clientId, key } = options
|
|
1083
|
+
if (!key?.witness) return undefined
|
|
1084
|
+
if (!app?.sign) return new ChallengeNotPermittedError({ clientId })
|
|
1085
|
+
return undefined
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
export namespace checkChallenge {
|
|
1089
|
+
export type Options = {
|
|
1090
|
+
/** The app, or `undefined` when no app has `clientId`. */
|
|
1091
|
+
app: Pick<Apps.App, 'sign'> | undefined
|
|
1092
|
+
/** The requesting app's client ID. */
|
|
1093
|
+
clientId: string
|
|
1094
|
+
/** A key without a `witness`, or no key, passes. */
|
|
1095
|
+
key: Key | undefined
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1098
|
+
/** The refusals `checkChallenge` returns. */
|
|
1099
|
+
export const errors = [ChallengeNotPermittedError] as const
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1102
|
+
/**
|
|
1103
|
+
* Returns `MissingPermissionsError` when a third-party app's raw request `sent` leaves out
|
|
1104
|
+
* `expiry`, `limits`, or `scopes`, else `undefined`. A third-party app receives no defaults.
|
|
1105
|
+
*/
|
|
1106
|
+
export function checkExplicit(
|
|
1107
|
+
sent: unknown,
|
|
1108
|
+
): ErrorResponse.Instance<typeof checkExplicit.errors> | undefined {
|
|
1109
|
+
// A value that is no object names no field, and the schema refuses it after this check.
|
|
1110
|
+
const fields: Record<string, unknown> =
|
|
1111
|
+
typeof sent === 'object' && sent !== null ? { ...sent } : {}
|
|
1112
|
+
const missing = (['expiry', 'limits', 'scopes'] as const).filter(
|
|
1113
|
+
(field) => fields[field] === undefined,
|
|
1114
|
+
)
|
|
1115
|
+
const [first] = missing
|
|
1116
|
+
if (!first) return undefined
|
|
1117
|
+
const names = missing.map((field) => `\`${field}\``)
|
|
1118
|
+
const list = (() => {
|
|
1119
|
+
if (names.length === 1) return names[0]
|
|
1120
|
+
if (names.length === 2) return `${names[0]} and ${names[1]}`
|
|
1121
|
+
return `${names.slice(0, -1).join(', ')}, and ${names.at(-1)}`
|
|
1122
|
+
})()
|
|
1123
|
+
return new MissingPermissionsError({
|
|
1124
|
+
error_description: `Missing ${list}. Name the expiry, limits, and scopes of the key, since a third-party app receives no defaults.`,
|
|
1125
|
+
field: `key_authorization.${first}`,
|
|
1126
|
+
meta: { missing: missing.join(' ') },
|
|
1127
|
+
})
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1130
|
+
export namespace checkExplicit {
|
|
1131
|
+
/** The refusals `checkExplicit` returns. Its return type admits no other. */
|
|
1132
|
+
export const errors = [MissingPermissionsError] as const
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1135
|
+
/** Returns the refusal for `key` in a flow without a page, from `check` or the headless ceiling. */
|
|
1136
|
+
export function checkHeadless(
|
|
1137
|
+
key: Key,
|
|
1138
|
+
options: checkHeadless.Options,
|
|
1139
|
+
): ErrorResponse.Instance<typeof checkHeadless.errors> | undefined {
|
|
1140
|
+
const error = check(key)
|
|
1141
|
+
if (error) return error
|
|
1142
|
+
|
|
1143
|
+
// No page shows the user an unrecognized call, so only an app that holds `tempo-id:sign` sends one.
|
|
1144
|
+
const index = key.scopes.findIndex((scope) => !recognized(key, scope))
|
|
1145
|
+
const scope = key.scopes[index]
|
|
1146
|
+
if (scope && !options.sign) {
|
|
1147
|
+
const listing = token(key, scope.address)
|
|
1148
|
+
const selector =
|
|
1149
|
+
scope.selector === undefined ? undefined : normalize(scope.selector)
|
|
1150
|
+
return new UnsupportedCallError({
|
|
1151
|
+
error_description: `Unrecognized call on ${listing?.symbol ?? scope.address}: ${selector ?? 'any function'}. Authorize through a redirect or device grant, where the user approves it, or grant the app the \`${Apps.signScope}\` scope.`,
|
|
1152
|
+
field: `key_authorization.scopes.${index}.selector`,
|
|
1153
|
+
meta: {
|
|
1154
|
+
...(selector ? { selector } : {}),
|
|
1155
|
+
...(listing ? { symbol: listing.symbol } : {}),
|
|
1156
|
+
token: scope.address,
|
|
1157
|
+
},
|
|
1158
|
+
})
|
|
1159
|
+
}
|
|
1160
|
+
|
|
1161
|
+
const now = Math.floor(Date.now() / 1000)
|
|
1162
|
+
const chainId = Number(key.chainId)
|
|
1163
|
+
if (key.expiry > now + lifetime)
|
|
1164
|
+
return new ExpiryExceedsMaximumError({
|
|
1165
|
+
error_description: `Invalid \`expiry\`: ${date(key.expiry)} exceeds the one-year maximum. Use an earlier expiry, or authorize through a redirect or device grant.`,
|
|
1166
|
+
field: 'key_authorization.expiry',
|
|
1167
|
+
meta: { expiry: key.expiry, maximum: now + lifetime },
|
|
1168
|
+
})
|
|
1169
|
+
for (const [index, limit] of key.limits.entries()) {
|
|
1170
|
+
const listing = token(key, limit.token)!
|
|
1171
|
+
// A periodic limit resets each period, so the ceiling bounds what it allows before the key expires.
|
|
1172
|
+
const periods = limit.period
|
|
1173
|
+
? BigInt(Math.ceil((key.expiry - now) / limit.period))
|
|
1174
|
+
: 1n
|
|
1175
|
+
const total = limit.limit * periods
|
|
1176
|
+
if (total > listing.cap)
|
|
1177
|
+
return new LimitExceedsMaximumError({
|
|
1178
|
+
error_description: `Invalid ${listing.symbol} limit: ${Value.format(total, listing.decimals)}${periods > 1n ? ` over ${periods} periods before the key expires` : ''} exceeds the ${Value.format(listing.cap, listing.decimals)} maximum. ${periods > 1n ? 'Lower the limit or shorten the expiry' : 'Lower the limit'}, or authorize through a redirect or device grant.`,
|
|
1179
|
+
field: `key_authorization.limits.${index}.limit`,
|
|
1180
|
+
meta: {
|
|
1181
|
+
chain_id: chainId,
|
|
1182
|
+
// The compared total: the limit, times its periods before the key expires.
|
|
1183
|
+
limit: total.toString(),
|
|
1184
|
+
maximum: listing.cap.toString(),
|
|
1185
|
+
periods: Number(periods),
|
|
1186
|
+
symbol: listing.symbol,
|
|
1187
|
+
token: listing.address,
|
|
1188
|
+
},
|
|
1189
|
+
})
|
|
1190
|
+
}
|
|
1191
|
+
return undefined
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
export namespace checkHeadless {
|
|
1195
|
+
export type Options = {
|
|
1196
|
+
/** Whether the app holds `tempo-id:sign`, which permits unrecognized calls. */
|
|
1197
|
+
sign: boolean
|
|
1198
|
+
}
|
|
1199
|
+
|
|
1200
|
+
/** The refusals `checkHeadless` returns: `check`'s, then the headless ceiling's. */
|
|
1201
|
+
export const errors = [
|
|
1202
|
+
...check.errors,
|
|
1203
|
+
ExpiryExceedsMaximumError,
|
|
1204
|
+
LimitExceedsMaximumError,
|
|
1205
|
+
] as const
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
/** Returns what a `key` that passes `check` grants, with limits totaled per currency and period. */
|
|
1209
|
+
export function describe(key: Key): Description {
|
|
1210
|
+
// The screens state spending per currency, so limits on tokens of one currency and period add up.
|
|
1211
|
+
const totals = new Map<
|
|
1212
|
+
string,
|
|
1213
|
+
{
|
|
1214
|
+
amount: bigint
|
|
1215
|
+
currency: string
|
|
1216
|
+
decimals: number
|
|
1217
|
+
period: number
|
|
1218
|
+
tokens: { amount: string; symbol: string }[]
|
|
1219
|
+
}
|
|
1220
|
+
>()
|
|
1221
|
+
for (const limit of key.limits) {
|
|
1222
|
+
const listing = token(key, limit.token)!
|
|
1223
|
+
const period = limit.period ?? 0
|
|
1224
|
+
const group = `${listing.currency}\0${period}`
|
|
1225
|
+
const total = totals.get(group)
|
|
1226
|
+
if (!total) {
|
|
1227
|
+
totals.set(group, {
|
|
1228
|
+
amount: limit.limit,
|
|
1229
|
+
currency: listing.currency,
|
|
1230
|
+
decimals: listing.decimals,
|
|
1231
|
+
period,
|
|
1232
|
+
tokens: [
|
|
1233
|
+
{
|
|
1234
|
+
amount: Value.format(limit.limit, listing.decimals),
|
|
1235
|
+
symbol: listing.symbol,
|
|
1236
|
+
},
|
|
1237
|
+
],
|
|
1238
|
+
})
|
|
1239
|
+
continue
|
|
1240
|
+
}
|
|
1241
|
+
|
|
1242
|
+
total.tokens.push({
|
|
1243
|
+
amount: Value.format(limit.limit, listing.decimals),
|
|
1244
|
+
symbol: listing.symbol,
|
|
1245
|
+
})
|
|
1246
|
+
|
|
1247
|
+
const decimals = Math.max(total.decimals, listing.decimals)
|
|
1248
|
+
total.amount =
|
|
1249
|
+
total.amount * 10n ** BigInt(decimals - total.decimals) +
|
|
1250
|
+
limit.limit * 10n ** BigInt(decimals - listing.decimals)
|
|
1251
|
+
total.decimals = decimals
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
return {
|
|
1255
|
+
account: key.account,
|
|
1256
|
+
// Transfers and approvals spend within the limits, which the screens state already.
|
|
1257
|
+
calls: key.scopes.flatMap((scope): Description['calls'] => {
|
|
1258
|
+
if (scope.address.toLowerCase() !== reserve.address) return []
|
|
1259
|
+
const selector =
|
|
1260
|
+
scope.selector === undefined ? undefined : normalize(scope.selector)
|
|
1261
|
+
if (selector === reserve.open) return [{ call: 'open' }]
|
|
1262
|
+
if (selector === reserve.topUp) return [{ call: 'topUp' }]
|
|
1263
|
+
return []
|
|
1264
|
+
}),
|
|
1265
|
+
expiry: key.expiry,
|
|
1266
|
+
limits: [...totals.values()].map((total) => ({
|
|
1267
|
+
amount: Value.format(total.amount, total.decimals),
|
|
1268
|
+
currency: total.currency,
|
|
1269
|
+
...(total.period ? { period: total.period } : {}),
|
|
1270
|
+
tokens: total.tokens,
|
|
1271
|
+
})),
|
|
1272
|
+
unrecognized: key.scopes
|
|
1273
|
+
.filter((scope) => !recognized(key, scope))
|
|
1274
|
+
.map((scope) => {
|
|
1275
|
+
const selector =
|
|
1276
|
+
scope.selector === undefined ? undefined : normalize(scope.selector)
|
|
1277
|
+
return {
|
|
1278
|
+
address: Address.checksum(scope.address),
|
|
1279
|
+
...(selector ? { selector } : {}),
|
|
1280
|
+
}
|
|
1281
|
+
}),
|
|
1282
|
+
}
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1285
|
+
/** What a key grants, as the approval screens show it. */
|
|
1286
|
+
export type Description = z.output<typeof schema.description>
|
|
1287
|
+
|
|
1288
|
+
/**
|
|
1289
|
+
* Returns the digest that the account's owner signs for `key`, which is a passkey's WebAuthn
|
|
1290
|
+
* challenge. An owner's digest binds no account, so it is known before the passkey is. `witness`
|
|
1291
|
+
* replaces the key's own. For a configurable account, each owner signs its configuration's digest.
|
|
1292
|
+
*/
|
|
1293
|
+
export function digest(options: digest.Options) {
|
|
1294
|
+
const { account } = options
|
|
1295
|
+
const { key: accessKey, ...rest } = parameters(options.key)
|
|
1296
|
+
const payload = KeyAuthorization.getSignPayload({
|
|
1297
|
+
...rest,
|
|
1298
|
+
address: accessKey.address,
|
|
1299
|
+
type: accessKey.type,
|
|
1300
|
+
...(options.witness ? { witness: options.witness } : {}),
|
|
1301
|
+
...(account ? { account: account.address } : {}),
|
|
1302
|
+
} as never)
|
|
1303
|
+
if (!account) return payload
|
|
1304
|
+
return AccountConfig.getSignPayload({
|
|
1305
|
+
account: account.address,
|
|
1306
|
+
config: account.config,
|
|
1307
|
+
payload,
|
|
1308
|
+
})
|
|
1309
|
+
}
|
|
1310
|
+
|
|
1311
|
+
export declare namespace digest {
|
|
1312
|
+
type Options = {
|
|
1313
|
+
/** The configurable account that the key acts for. Absent, the owner key is the account. */
|
|
1314
|
+
account?: Account.ConfigurableAccount<AccountConfig.Config> | undefined
|
|
1315
|
+
/** The key authorization to commit to. */
|
|
1316
|
+
key: Key
|
|
1317
|
+
/** Replaces the key's own witness, as a sign-in with key signature binds it. */
|
|
1318
|
+
witness?: Hex.Hex | undefined
|
|
1319
|
+
}
|
|
1320
|
+
}
|
|
1321
|
+
|
|
1322
|
+
/** Returns the access key's address, or the address of its `publicKey`. */
|
|
1323
|
+
export function keyId(key: Key) {
|
|
1324
|
+
return parameters(key).key.address
|
|
1325
|
+
}
|
|
1326
|
+
|
|
1327
|
+
/** Returns the listed tokens on the chain with `chainId`. */
|
|
1328
|
+
export function listings(options: listings.Options) {
|
|
1329
|
+
const prefix = `${options.chainId}:`
|
|
1330
|
+
return [...listed].flatMap((entry) =>
|
|
1331
|
+
entry[0].startsWith(prefix) ? [entry[1]] : [],
|
|
1332
|
+
)
|
|
1333
|
+
}
|
|
1334
|
+
|
|
1335
|
+
export declare namespace listings {
|
|
1336
|
+
type Options = {
|
|
1337
|
+
/** The chain's ID. */
|
|
1338
|
+
chainId: number
|
|
1339
|
+
}
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
/**
|
|
1343
|
+
* Signs `key` with `owner`, the account's owner key, and returns it in the node's RPC format. A
|
|
1344
|
+
* configurable account signs through one of its owners, and its authorization binds the account.
|
|
1345
|
+
*/
|
|
1346
|
+
export async function sign(
|
|
1347
|
+
owner: Parameters<typeof Account.signKeyAuthorization>[0],
|
|
1348
|
+
options: sign.Options,
|
|
1349
|
+
) {
|
|
1350
|
+
const configurable =
|
|
1351
|
+
owner.source === 'configurable' && 'config' in owner && owner.config
|
|
1352
|
+
? { config: owner.config as AccountConfig.Config }
|
|
1353
|
+
: undefined
|
|
1354
|
+
return KeyAuthorization.toRpc(
|
|
1355
|
+
await Account.signKeyAuthorization(owner, {
|
|
1356
|
+
...parameters(options.key),
|
|
1357
|
+
...(configurable ? { configurable } : {}),
|
|
1358
|
+
}),
|
|
1359
|
+
)
|
|
1360
|
+
}
|
|
1361
|
+
|
|
1362
|
+
export declare namespace sign {
|
|
1363
|
+
type Options = {
|
|
1364
|
+
/** A key authorization that `check` accepts. */
|
|
1365
|
+
key: Key
|
|
1366
|
+
}
|
|
1367
|
+
}
|
|
1368
|
+
|
|
1369
|
+
/**
|
|
1370
|
+
* Signs `key` with a verified passkey `assertion` over its {@link digest}, in the RPC format. For a
|
|
1371
|
+
* configurable account, the assertion is the passkey owner's approval in the account's envelope.
|
|
1372
|
+
*/
|
|
1373
|
+
export async function signWithAssertion(
|
|
1374
|
+
assertion: Passkey.Assertion,
|
|
1375
|
+
options: signWithAssertion.Options,
|
|
1376
|
+
) {
|
|
1377
|
+
const { account } = options
|
|
1378
|
+
const { metadata, signature } = Authentication.deserializeResponse(assertion)
|
|
1379
|
+
const challenge = digest({ account, key: options.key })
|
|
1380
|
+
const publicKey = PublicKey.fromHex(options.publicKey)
|
|
1381
|
+
// The passkey already signed the digest, so this owner returns the assertion as its envelope.
|
|
1382
|
+
const owner = Account.from({
|
|
1383
|
+
keyType: 'webAuthn',
|
|
1384
|
+
publicKey,
|
|
1385
|
+
sign(request) {
|
|
1386
|
+
if (request.hash !== challenge)
|
|
1387
|
+
return Promise.reject(
|
|
1388
|
+
new Error('The assertion signs another key authorization.'),
|
|
1389
|
+
)
|
|
1390
|
+
return Promise.resolve(
|
|
1391
|
+
SignatureEnvelope.serialize({
|
|
1392
|
+
metadata: {
|
|
1393
|
+
authenticatorData: metadata.authenticatorData,
|
|
1394
|
+
clientDataJSON: metadata.clientDataJSON,
|
|
1395
|
+
},
|
|
1396
|
+
publicKey,
|
|
1397
|
+
signature,
|
|
1398
|
+
type: 'webAuthn',
|
|
1399
|
+
}),
|
|
1400
|
+
)
|
|
1401
|
+
},
|
|
1402
|
+
})
|
|
1403
|
+
if (!account) return await sign(owner, { key: options.key })
|
|
1404
|
+
|
|
1405
|
+
// A configurable account signs through the passkey, one of its owners. Viem derives the address
|
|
1406
|
+
// of an initial configuration, and takes it for any later version.
|
|
1407
|
+
const owners = account.config.owners.map((entry) => ({
|
|
1408
|
+
owner: Address.isEqual(entry.owner, owner.address) ? owner : entry.owner,
|
|
1409
|
+
weight: Number(entry.weight),
|
|
1410
|
+
}))
|
|
1411
|
+
const { salt, threshold, version } = account.config
|
|
1412
|
+
const configurable =
|
|
1413
|
+
BigInt(version) === 0n
|
|
1414
|
+
? Account.fromConfig({ owners, salt, threshold: Number(threshold) })
|
|
1415
|
+
: Account.fromConfig({
|
|
1416
|
+
address: account.address,
|
|
1417
|
+
owners,
|
|
1418
|
+
salt,
|
|
1419
|
+
threshold: Number(threshold),
|
|
1420
|
+
version,
|
|
1421
|
+
})
|
|
1422
|
+
return await sign(configurable, { key: options.key })
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1425
|
+
export declare namespace signWithAssertion {
|
|
1426
|
+
type Options = {
|
|
1427
|
+
/**
|
|
1428
|
+
* The configurable account that the key acts for, on the chain where it is configurable. Absent,
|
|
1429
|
+
* the passkey itself acts as the account.
|
|
1430
|
+
*/
|
|
1431
|
+
account?: Account.ConfigurableAccount<AccountConfig.Config> | undefined
|
|
1432
|
+
/** The key authorization that the assertion signs. */
|
|
1433
|
+
key: Key
|
|
1434
|
+
/** The passkey's uncompressed P256 public key. */
|
|
1435
|
+
publicKey: Hex.Hex
|
|
1436
|
+
}
|
|
1437
|
+
}
|
|
1438
|
+
|
|
1439
|
+
/**
|
|
1440
|
+
* Fills what a request leaves out with the headless ceiling: Tempo mainnet, a year, the cap of each
|
|
1441
|
+
* token it calls or of OUSD, and transfers of each token it limits.
|
|
1442
|
+
*/
|
|
1443
|
+
function defaults(key: Request): Defaulted {
|
|
1444
|
+
const chainId = key.chainId ?? BigInt(defaultChainId)
|
|
1445
|
+
// Each listed token the scopes call takes its cap. Scopes that call no listed token, or empty
|
|
1446
|
+
// scopes that `check` refuses, take the cap of OUSD.
|
|
1447
|
+
const called = [
|
|
1448
|
+
...new Map(
|
|
1449
|
+
(key.scopes ?? []).flatMap((scope) => {
|
|
1450
|
+
const listing = listed.get(`${chainId}:${scope.address.toLowerCase()}`)
|
|
1451
|
+
return listing ? [[listing.address, listing] as const] : []
|
|
1452
|
+
}),
|
|
1453
|
+
).values(),
|
|
1454
|
+
]
|
|
1455
|
+
// On a chain without OUSD, a zero limit remains, which `check` refuses as an unsupported token.
|
|
1456
|
+
const limits =
|
|
1457
|
+
key.limits ??
|
|
1458
|
+
(called.length
|
|
1459
|
+
? called.map((listing) => ({
|
|
1460
|
+
limit: listing.cap,
|
|
1461
|
+
token: listing.address,
|
|
1462
|
+
}))
|
|
1463
|
+
: [
|
|
1464
|
+
{
|
|
1465
|
+
limit: listed.get(`${chainId}:${ousd.toLowerCase()}`)?.cap ?? 0n,
|
|
1466
|
+
token: ousd,
|
|
1467
|
+
},
|
|
1468
|
+
])
|
|
1469
|
+
const scopes =
|
|
1470
|
+
key.scopes ??
|
|
1471
|
+
limits.flatMap((limit) =>
|
|
1472
|
+
[calls.transfer, calls.transferWithMemo].map((selector) => ({
|
|
1473
|
+
address: limit.token,
|
|
1474
|
+
selector,
|
|
1475
|
+
})),
|
|
1476
|
+
)
|
|
1477
|
+
return {
|
|
1478
|
+
...key,
|
|
1479
|
+
chainId,
|
|
1480
|
+
expiry: key.expiry ?? Math.floor(Date.now() / 1000) + lifetime,
|
|
1481
|
+
limits,
|
|
1482
|
+
scopes,
|
|
1483
|
+
}
|
|
1484
|
+
}
|
|
1485
|
+
|
|
1486
|
+
/** Whether `address` has the full 12-byte TIP-20 prefix, which no other contract shares. */
|
|
1487
|
+
export function tip20(address: string) {
|
|
1488
|
+
return address.toLowerCase().startsWith('0x20c000000000000000000000')
|
|
1489
|
+
}
|
|
1490
|
+
|
|
1491
|
+
/** The listed token at `address` on the key's chain, if any. */
|
|
1492
|
+
function token(key: Key, address: string) {
|
|
1493
|
+
return listed.get(`${Number(key.chainId)}:${address.toLowerCase()}`)
|
|
1494
|
+
}
|
|
1495
|
+
|
|
1496
|
+
/** Returns a selector or signature as lowercase hex, or `undefined` if it does not parse. */
|
|
1497
|
+
function normalize(selector: string) {
|
|
1498
|
+
if (/^0x[0-9a-fA-F]{8}$/.test(selector))
|
|
1499
|
+
return selector.toLowerCase() as `0x${string}`
|
|
1500
|
+
// The parser throws on a malformed signature, which the caller refuses as an unsupported call.
|
|
1501
|
+
try {
|
|
1502
|
+
return AbiFunction.getSelector(selector)
|
|
1503
|
+
} catch {
|
|
1504
|
+
return undefined
|
|
1505
|
+
}
|
|
1506
|
+
}
|
|
1507
|
+
|
|
1508
|
+
/** The fields of `key` that its owner signs, as `Account.signKeyAuthorization` takes them. */
|
|
1509
|
+
function parameters(key: Key) {
|
|
1510
|
+
return {
|
|
1511
|
+
chainId: key.chainId!,
|
|
1512
|
+
expiry: key.expiry,
|
|
1513
|
+
key: {
|
|
1514
|
+
address: key.address ?? parse(key.publicKey!)!,
|
|
1515
|
+
// The Accounts SDK's default for a key the app holds.
|
|
1516
|
+
type: key.keyType ?? ('secp256k1' as const),
|
|
1517
|
+
},
|
|
1518
|
+
limits: key.limits,
|
|
1519
|
+
scopes: key.scopes,
|
|
1520
|
+
...(key.witness ? { witness: key.witness } : {}),
|
|
1521
|
+
}
|
|
1522
|
+
}
|
|
1523
|
+
|
|
1524
|
+
/** A Unix time as a UTC date and time, for messages. */
|
|
1525
|
+
function date(seconds: number) {
|
|
1526
|
+
return new Date(seconds * 1000).toUTCString()
|
|
1527
|
+
}
|
|
1528
|
+
|
|
1529
|
+
/** The address of a public key, or `undefined` when it is not a valid point. */
|
|
1530
|
+
function parse(publicKey: `0x${string}`) {
|
|
1531
|
+
try {
|
|
1532
|
+
return Address.fromPublicKey(PublicKey.from(publicKey))
|
|
1533
|
+
} catch {
|
|
1534
|
+
return undefined
|
|
1535
|
+
}
|
|
1536
|
+
}
|