@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,1315 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configurable accounts (TIP-1107) on the chains that `CONFIGURABLE_ACCOUNTS` names: the
|
|
3
|
+
* configurations that Tempo ID stores for those chains, the owners' view of each configurable
|
|
4
|
+
* account, and the transactions that change the owners. On such a chain, a key that Tempo ID created
|
|
5
|
+
* owns the account that its initial configuration derives, and a linked wallet.tempo passkey owns its
|
|
6
|
+
* own address until an upgrade in place (TIP-1113) makes it configurable. A configuration update adds
|
|
7
|
+
* an owner to an account that is already configurable. Every configuration has threshold 1, so each
|
|
8
|
+
* owner signs alone.
|
|
9
|
+
* @module
|
|
10
|
+
*/
|
|
11
|
+
import { and, eq, gt, sql } from 'drizzle-orm'
|
|
12
|
+
import { Address, Hex, PublicKey, Secp256k1 } from 'ox'
|
|
13
|
+
import {
|
|
14
|
+
AccountConfig,
|
|
15
|
+
type KeyAuthorization,
|
|
16
|
+
SignatureEnvelope,
|
|
17
|
+
} from 'ox/tempo'
|
|
18
|
+
import {
|
|
19
|
+
type Client as Client_,
|
|
20
|
+
createClient,
|
|
21
|
+
http,
|
|
22
|
+
type HttpTransport,
|
|
23
|
+
type LocalAccount,
|
|
24
|
+
} from 'viem'
|
|
25
|
+
import {
|
|
26
|
+
prepareTransactionRequest,
|
|
27
|
+
sendRawTransactionSync,
|
|
28
|
+
signTransaction,
|
|
29
|
+
} from 'viem/actions'
|
|
30
|
+
import { Authentication } from 'ox/webauthn'
|
|
31
|
+
import {
|
|
32
|
+
Account,
|
|
33
|
+
Actions,
|
|
34
|
+
Transaction,
|
|
35
|
+
type Transport,
|
|
36
|
+
withRelay,
|
|
37
|
+
} from 'viem/tempo'
|
|
38
|
+
import { z } from 'zod'
|
|
39
|
+
import * as Schema from '../app/db/schema.js'
|
|
40
|
+
import * as Chain from './Chain.js'
|
|
41
|
+
import * as ChainList from './ChainList.js'
|
|
42
|
+
import * as ErrorResponse from './ErrorResponse.js'
|
|
43
|
+
import { tip20 } from './KeyAuthorization.js'
|
|
44
|
+
import * as Owner from './Owner.js'
|
|
45
|
+
import type * as Passkey from './Passkey.js'
|
|
46
|
+
import type * as Realm from './Realm.js'
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* The chain's configuration of the account differs from the stored one, such as after a change that
|
|
50
|
+
* Tempo ID did not send, or an upgrade on the chain that Tempo ID did not record.
|
|
51
|
+
*/
|
|
52
|
+
export class ConflictError extends ErrorResponse.define('config_conflict') {
|
|
53
|
+
override readonly name = 'ConfigurableAccount.ConflictError'
|
|
54
|
+
|
|
55
|
+
constructor(options: ConflictError.Options) {
|
|
56
|
+
super({
|
|
57
|
+
error_description: `Configuration conflict: the chain's configuration of ${options.account} differs from the stored one. Reload the account, and try again.`,
|
|
58
|
+
field: 'account',
|
|
59
|
+
meta: { account: options.account },
|
|
60
|
+
})
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export declare namespace ConflictError {
|
|
65
|
+
type Options = {
|
|
66
|
+
/** The account's address. */
|
|
67
|
+
account: string
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** The deployment has no configurable accounts, or the request names a chain whose accounts are not. */
|
|
72
|
+
export class DisabledError extends ErrorResponse.define(
|
|
73
|
+
'configurable_accounts_disabled',
|
|
74
|
+
) {
|
|
75
|
+
override readonly name = 'ConfigurableAccount.DisabledError'
|
|
76
|
+
|
|
77
|
+
constructor(options: DisabledError.Options = {}) {
|
|
78
|
+
const { chain, configured = [] } = options
|
|
79
|
+
super(
|
|
80
|
+
chain && configured.length > 0
|
|
81
|
+
? {
|
|
82
|
+
error_description: `Configurable accounts are not available on the chain \`${chain}\`. Select ${configured.map((name) => `\`${name}\``).join(' or ')}.`,
|
|
83
|
+
field: 'chain',
|
|
84
|
+
meta: { chain, configured: configured.join(',') },
|
|
85
|
+
}
|
|
86
|
+
: {
|
|
87
|
+
error_description:
|
|
88
|
+
'Configurable accounts are not available on this deployment. Use the account as it is.',
|
|
89
|
+
field: 'chain',
|
|
90
|
+
},
|
|
91
|
+
)
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export declare namespace DisabledError {
|
|
96
|
+
type Options = {
|
|
97
|
+
/** The chain that the request names. */
|
|
98
|
+
chain?: string | undefined
|
|
99
|
+
/** The chains whose accounts are configurable, by name. */
|
|
100
|
+
configured?: readonly string[] | undefined
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* The account is not configurable on the chain: an owner joins only a configurable account, and only
|
|
106
|
+
* an account that a passkey owns upgrades in place.
|
|
107
|
+
*/
|
|
108
|
+
export class NotConfigurableError extends ErrorResponse.define(
|
|
109
|
+
'not_configurable',
|
|
110
|
+
) {
|
|
111
|
+
override readonly name = 'ConfigurableAccount.NotConfigurableError'
|
|
112
|
+
|
|
113
|
+
constructor(options: NotConfigurableError.Options) {
|
|
114
|
+
const { account } = options
|
|
115
|
+
super({
|
|
116
|
+
error_description:
|
|
117
|
+
options.reason === 'cloud'
|
|
118
|
+
? `Not configurable: a cloud wallet owns ${account}, and only an account that a passkey owns upgrades in place. Use an account that is configurable from its creation.`
|
|
119
|
+
: `Not configurable: ${account} is not a configurable account yet. Upgrade it with its passkey, then add the owner.`,
|
|
120
|
+
field: 'account',
|
|
121
|
+
meta: { account, reason: options.reason },
|
|
122
|
+
})
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export declare namespace NotConfigurableError {
|
|
127
|
+
type Options = {
|
|
128
|
+
/** The account's address. */
|
|
129
|
+
account: string
|
|
130
|
+
/**
|
|
131
|
+
* Why: a cloud wallet's account, which no upgrade covers (`cloud`), or an account that must
|
|
132
|
+
* upgrade before an owner joins (`upgrade`).
|
|
133
|
+
*/
|
|
134
|
+
reason: 'cloud' | 'upgrade'
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/** The account already holds the owner that the request adds, or is already configurable. */
|
|
139
|
+
export class OwnerExistsError extends ErrorResponse.define('owner_exists') {
|
|
140
|
+
override readonly name = 'ConfigurableAccount.OwnerExistsError'
|
|
141
|
+
|
|
142
|
+
constructor(options: OwnerExistsError.Options) {
|
|
143
|
+
super({
|
|
144
|
+
error_description: {
|
|
145
|
+
configurable: `Owner exists: ${options.account} is already a configurable account. Add an owner to it instead.`,
|
|
146
|
+
passkey: `Owner exists: a passkey already owns ${options.account}. Use the account as it is.`,
|
|
147
|
+
}[options.owner],
|
|
148
|
+
field: options.owner === 'passkey' ? 'account' : 'wallet',
|
|
149
|
+
meta: { account: options.account, owner: options.owner },
|
|
150
|
+
})
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export declare namespace OwnerExistsError {
|
|
155
|
+
type Options = {
|
|
156
|
+
/** The account's address. */
|
|
157
|
+
account: string
|
|
158
|
+
/** What the account already holds: a passkey, or a configuration. */
|
|
159
|
+
owner: 'configurable' | 'passkey'
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* A wallet.tempo passkey's account is a root account on a chain whose accounts are configurable, so
|
|
165
|
+
* no key signs for it there until its upgrade.
|
|
166
|
+
*/
|
|
167
|
+
export class UpgradeRequiredError extends ErrorResponse.define(
|
|
168
|
+
'upgrade_required',
|
|
169
|
+
) {
|
|
170
|
+
override readonly name = 'ConfigurableAccount.UpgradeRequiredError'
|
|
171
|
+
|
|
172
|
+
constructor(options: UpgradeRequiredError.Options) {
|
|
173
|
+
super({
|
|
174
|
+
error_description: `Upgrade required: Tempo Account ${options.account} is not a configurable account on this chain yet. Upgrade it on the account page, then authorize again.`,
|
|
175
|
+
field: 'key_authorization.account',
|
|
176
|
+
meta: { account: options.account },
|
|
177
|
+
})
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export declare namespace UpgradeRequiredError {
|
|
182
|
+
type Options = {
|
|
183
|
+
/** The account's address. */
|
|
184
|
+
account: string
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* The client ID that a passkey's signature challenge of a configuration change names, in place of an
|
|
190
|
+
* app's. No app's client ID has this form.
|
|
191
|
+
*/
|
|
192
|
+
export const clientId = 'tempo-id:account-config'
|
|
193
|
+
|
|
194
|
+
/** How long a prepared transaction stays valid, in seconds, as long as a passkey challenge. */
|
|
195
|
+
export const lifetime = 5 * 60
|
|
196
|
+
|
|
197
|
+
/** The threshold of every configuration that Tempo ID installs, so each owner signs alone. */
|
|
198
|
+
export const threshold = 1
|
|
199
|
+
|
|
200
|
+
/** pathUSD, the TIP-20 token of every Tempo chain's genesis. */
|
|
201
|
+
const pathUsd = '0x20c0000000000000000000000000000000000000'
|
|
202
|
+
|
|
203
|
+
/** A private key whose public key fills a signer that never signs with it. */
|
|
204
|
+
const placeholder = `0x${'0'.repeat(63)}1` as const
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* The selectors of the TIP-20 calls of 0 that register a key. An approval of 0 would replace an
|
|
208
|
+
* allowance that the account gave, so none registers a key.
|
|
209
|
+
*/
|
|
210
|
+
const selectors = {
|
|
211
|
+
transfer: '0xa9059cbb',
|
|
212
|
+
transferWithMemo: '0x95777d59',
|
|
213
|
+
} as const
|
|
214
|
+
|
|
215
|
+
/** The prefix of the `verification` identifier of a change that waits for a passkey's signature. */
|
|
216
|
+
const pendingPrefix = 'account-config:'
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* A client that {@link client} returns: a plain HTTP transport, or a sponsor relay in front of one.
|
|
220
|
+
* The type names the transports explicitly, since declaration emit cannot name the relay transport
|
|
221
|
+
* that `withRelay` infers.
|
|
222
|
+
*/
|
|
223
|
+
export type Client = Client_<
|
|
224
|
+
HttpTransport | Transport.Relay,
|
|
225
|
+
Entry['definition']
|
|
226
|
+
>
|
|
227
|
+
|
|
228
|
+
/** A configurable account's configuration on one chain, as Tempo ID stores it. */
|
|
229
|
+
export type Config = {
|
|
230
|
+
/**
|
|
231
|
+
* The account's address: the key's own, which an upgrade kept, or the one that the initial
|
|
232
|
+
* configuration derives for an account that is configurable from its creation.
|
|
233
|
+
*/
|
|
234
|
+
address: Address.Address
|
|
235
|
+
/** The ID of the chain where the configuration is live. */
|
|
236
|
+
chainId: number
|
|
237
|
+
/**
|
|
238
|
+
* The address of the key whose account this is: `address` for an upgrade, or the key that created
|
|
239
|
+
* the account, which is its first owner.
|
|
240
|
+
*/
|
|
241
|
+
key: Address.Address
|
|
242
|
+
/** The owners, in the configuration's canonical order. */
|
|
243
|
+
owners: readonly Owner.Configurable.Owner[]
|
|
244
|
+
/** The 32-byte salt, hex. */
|
|
245
|
+
salt: Hex.Hex
|
|
246
|
+
/** The total owner weight that a signature needs. */
|
|
247
|
+
threshold: number
|
|
248
|
+
/** The configuration version. A creation installs version 0, and an upgrade version 1. */
|
|
249
|
+
version: bigint
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/** Zod schemas for stored configurations and pending changes. */
|
|
253
|
+
namespace schema {
|
|
254
|
+
const address = z.templateLiteral([
|
|
255
|
+
'0x',
|
|
256
|
+
z.string().regex(/^[0-9a-fA-F]{40}$/),
|
|
257
|
+
])
|
|
258
|
+
const hex = z.templateLiteral(['0x', z.string().regex(/^[0-9a-fA-F]*$/)])
|
|
259
|
+
|
|
260
|
+
/** The `owners` column. */
|
|
261
|
+
export const owners = z.array(
|
|
262
|
+
z.object({
|
|
263
|
+
address,
|
|
264
|
+
type: z.string(),
|
|
265
|
+
weight: z.number().int().positive(),
|
|
266
|
+
}),
|
|
267
|
+
)
|
|
268
|
+
|
|
269
|
+
/** A configuration as a pending change stores it, with the version as a decimal string. */
|
|
270
|
+
const config = z.object({
|
|
271
|
+
address,
|
|
272
|
+
chainId: z.number().int(),
|
|
273
|
+
key: address,
|
|
274
|
+
owners,
|
|
275
|
+
salt: hex,
|
|
276
|
+
threshold: z.number().int(),
|
|
277
|
+
version: z.string().regex(/^[0-9]+$/),
|
|
278
|
+
})
|
|
279
|
+
|
|
280
|
+
/** A change that waits for a passkey's signature, as the `verification` table stores it. */
|
|
281
|
+
export const pending = z.object({
|
|
282
|
+
current: config.optional(),
|
|
283
|
+
registration: z.object({ digest: hex, transaction: hex }).optional(),
|
|
284
|
+
target: config,
|
|
285
|
+
transaction: hex,
|
|
286
|
+
})
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Returns `owners` as they act on the chain `chainId`, which `CONFIGURABLE_ACCOUNTS` names. Each
|
|
291
|
+
* stored configuration applies, and a key that Tempo ID created without one carries the initial
|
|
292
|
+
* configuration that it owns alone, from {@link created}. A linked key without one, such as a
|
|
293
|
+
* wallet.tempo passkey, stays a root key until its upgrade. A key that co-owns another account is no
|
|
294
|
+
* account of its own. The view's passkey and server signer come from the user's keys among the
|
|
295
|
+
* configuration's owners.
|
|
296
|
+
*/
|
|
297
|
+
export function apply<const type extends string>(
|
|
298
|
+
owners: readonly Owner.Owner<type>[],
|
|
299
|
+
options: apply.Options,
|
|
300
|
+
): readonly Owner.Owner<type>[] {
|
|
301
|
+
const { chainId } = options
|
|
302
|
+
// Each key is read by its own address, since a configuration already applied names another.
|
|
303
|
+
const find = (address: Address.Address) =>
|
|
304
|
+
owners.find((entry) => Address.isEqual(Owner.key(entry), address))
|
|
305
|
+
const configs = [
|
|
306
|
+
...options.configs,
|
|
307
|
+
...owners.flatMap((entry) =>
|
|
308
|
+
entry.linked ||
|
|
309
|
+
options.configs.some((config) =>
|
|
310
|
+
Address.isEqual(config.key, Owner.key(entry)),
|
|
311
|
+
)
|
|
312
|
+
? []
|
|
313
|
+
: [created({ chainId, key: Owner.key(entry), type: entry.type })],
|
|
314
|
+
),
|
|
315
|
+
]
|
|
316
|
+
|
|
317
|
+
// A key that the configuration of another account lists co-owns that account, so it acts as no
|
|
318
|
+
// account of its own.
|
|
319
|
+
const cosigners = new Set(
|
|
320
|
+
configs.flatMap((config) =>
|
|
321
|
+
config.owners
|
|
322
|
+
.filter((entry) => !Address.isEqual(entry.address, config.key))
|
|
323
|
+
.map((entry) => entry.address.toLowerCase()),
|
|
324
|
+
),
|
|
325
|
+
)
|
|
326
|
+
|
|
327
|
+
return owners
|
|
328
|
+
.filter((entry) => !cosigners.has(Owner.key(entry).toLowerCase()))
|
|
329
|
+
.map((entry) => {
|
|
330
|
+
const config = configs.find((candidate) =>
|
|
331
|
+
Address.isEqual(candidate.key, Owner.key(entry)),
|
|
332
|
+
)
|
|
333
|
+
if (!config) return entry
|
|
334
|
+
|
|
335
|
+
const members = config.owners.flatMap((member) => {
|
|
336
|
+
const found = find(member.address)
|
|
337
|
+
return found ? [found] : []
|
|
338
|
+
})
|
|
339
|
+
const passkey = members.find((member) => member.credential)
|
|
340
|
+
const server = members.find((member) => member.signer)
|
|
341
|
+
const owner = Owner.from({
|
|
342
|
+
account: toAccount(config),
|
|
343
|
+
createdAt: entry.createdAt,
|
|
344
|
+
credential: passkey?.credential,
|
|
345
|
+
linked: entry.linked,
|
|
346
|
+
realm: entry.realm,
|
|
347
|
+
signer: server?.signer
|
|
348
|
+
? async (c, options) =>
|
|
349
|
+
toAccount(config, {
|
|
350
|
+
signers: [await server.signer!(c, options)],
|
|
351
|
+
})
|
|
352
|
+
: undefined,
|
|
353
|
+
type: entry.type,
|
|
354
|
+
})
|
|
355
|
+
const configurable = {
|
|
356
|
+
chainId: config.chainId,
|
|
357
|
+
owner,
|
|
358
|
+
owners: config.owners,
|
|
359
|
+
}
|
|
360
|
+
// The view names itself, so `Owner.on` returns it again, and `Owner.configured` tells it apart.
|
|
361
|
+
owner.configurable = configurable
|
|
362
|
+
return { ...entry, configurable }
|
|
363
|
+
})
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
export declare namespace apply {
|
|
367
|
+
type Options = {
|
|
368
|
+
/** The ID of the chain, which `CONFIGURABLE_ACCOUNTS` names. */
|
|
369
|
+
chainId: number
|
|
370
|
+
/** The user's stored configurations on that chain. */
|
|
371
|
+
configs: readonly Config[]
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* Returns the chains whose accounts are configurable: those that `CONFIGURABLE_ACCOUNTS` names, in
|
|
377
|
+
* its order, each with its ID, its RPC URL, and Viem's definition of it. A name that is neither built
|
|
378
|
+
* in nor listed, or a chain that is no Tempo chain, is left out, since `App.create` refuses both when
|
|
379
|
+
* the Worker starts.
|
|
380
|
+
*/
|
|
381
|
+
export function chains(options: chains.Options): readonly Entry[] {
|
|
382
|
+
// Every chain that the list resolves is one of `Chain.known`, whose IDs `ChainList.known` holds.
|
|
383
|
+
return ChainList.configurable(options).flatMap((entry) => {
|
|
384
|
+
const definition = Chain.known.find((chain) => chain.id === entry.chainId)
|
|
385
|
+
return definition ? [{ ...entry, definition }] : []
|
|
386
|
+
})
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
export declare namespace chains {
|
|
390
|
+
type Options = ChainList.configurable.Options
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
/** A chain whose accounts are configurable, as {@link chains} returns it. */
|
|
394
|
+
export type Entry = {
|
|
395
|
+
/** The chain's ID. */
|
|
396
|
+
chainId: number
|
|
397
|
+
/** Viem's definition of the chain. */
|
|
398
|
+
definition: (typeof Chain.known)[number]
|
|
399
|
+
/** The chain's name, which the `chain` parameter carries. */
|
|
400
|
+
name: string
|
|
401
|
+
/** The RPC URL that serves the chain, or `undefined` for the chain's own. */
|
|
402
|
+
rpcUrl: string | undefined
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
/**
|
|
406
|
+
* Returns the chain `chainId` when `CONFIGURABLE_ACCOUNTS` names it, or `undefined` without a chain
|
|
407
|
+
* or for another chain.
|
|
408
|
+
*/
|
|
409
|
+
export function on(options: on.Options): Entry | undefined {
|
|
410
|
+
const { chainId, env } = options
|
|
411
|
+
if (chainId === undefined) return undefined
|
|
412
|
+
return chains({
|
|
413
|
+
rpcUrl: env.TEMPO_RPC_URL,
|
|
414
|
+
rpcUrls: env.RPC_URLS,
|
|
415
|
+
value: env.CONFIGURABLE_ACCOUNTS,
|
|
416
|
+
}).find((entry) => entry.chainId === chainId)
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
export declare namespace on {
|
|
420
|
+
type Options = {
|
|
421
|
+
/** The chain's ID, if any. */
|
|
422
|
+
chainId?: number | undefined
|
|
423
|
+
/** The deployment variables that name the chains. */
|
|
424
|
+
env: Owner.Env
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
/**
|
|
429
|
+
* Creates a client of `chain` that sends configurable-account transactions. When `apiUrl`, the
|
|
430
|
+
* chain's Tempo API, holds a key, its sponsor relay at `/rpc/sponsor/<chainId>` fills and co-signs
|
|
431
|
+
* each transaction, so the account pays no fee. Without a key, each account pays its own fees.
|
|
432
|
+
*/
|
|
433
|
+
export function client(options: client.Options): Client {
|
|
434
|
+
const { apiUrl, chain } = options
|
|
435
|
+
const sponsor = (() => {
|
|
436
|
+
if (!apiUrl) return undefined
|
|
437
|
+
// The URL holds the key in its user name and password, such as `tempo:sk:…`, which the URL
|
|
438
|
+
// splits at the first colon. The API reads the key from a header.
|
|
439
|
+
const url = new URL(apiUrl)
|
|
440
|
+
const key = [url.username, url.password]
|
|
441
|
+
.filter(Boolean)
|
|
442
|
+
.map(decodeURIComponent)
|
|
443
|
+
.join(':')
|
|
444
|
+
if (!key) return undefined
|
|
445
|
+
url.username = ''
|
|
446
|
+
url.password = ''
|
|
447
|
+
// The API can sit under a path, such as behind a gateway, which a root-relative URL would drop.
|
|
448
|
+
url.pathname = `${url.pathname.replace(/\/$/, '')}/rpc/sponsor/${chain.chainId}`
|
|
449
|
+
return { key, url: url.href }
|
|
450
|
+
})()
|
|
451
|
+
const transport = http(chain.rpcUrl, { retryCount: 0 })
|
|
452
|
+
return createClient({
|
|
453
|
+
chain: chain.definition,
|
|
454
|
+
transport: sponsor
|
|
455
|
+
? withRelay(
|
|
456
|
+
transport,
|
|
457
|
+
http(sponsor.url, {
|
|
458
|
+
fetchOptions: { headers: { 'tempo-api-key': sponsor.key } },
|
|
459
|
+
retryCount: 0,
|
|
460
|
+
}),
|
|
461
|
+
)
|
|
462
|
+
: transport,
|
|
463
|
+
})
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
export declare namespace client {
|
|
467
|
+
type Options = {
|
|
468
|
+
/** The chain's Tempo API URL, as `Chain.apiUrl` returns it, with its key as user information. */
|
|
469
|
+
apiUrl: string | undefined
|
|
470
|
+
/** The chain, as {@link chains} returns it. */
|
|
471
|
+
chain: Entry
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
/**
|
|
476
|
+
* Returns the initial configuration of the account that `key`, a key that Tempo ID created, owns
|
|
477
|
+
* alone: version 0 at threshold 1, with the zero salt. The configuration derives the account's
|
|
478
|
+
* address from the key alone, so no row stores it and no transaction installs it. The account's first
|
|
479
|
+
* transaction carries it.
|
|
480
|
+
*/
|
|
481
|
+
export function created(options: created.Options): Config {
|
|
482
|
+
const { chainId, key, type } = options
|
|
483
|
+
const initial = from({
|
|
484
|
+
// `toAccount` derives the address of a version 0 configuration, which replaces this one.
|
|
485
|
+
address: key,
|
|
486
|
+
chainId,
|
|
487
|
+
key,
|
|
488
|
+
owners: [{ address: key, type, weight: 1 }],
|
|
489
|
+
salt: `0x${'0'.repeat(64)}`,
|
|
490
|
+
threshold,
|
|
491
|
+
version: 0n,
|
|
492
|
+
})
|
|
493
|
+
return from({ ...initial, address: toAccount(initial).address })
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
export declare namespace created {
|
|
497
|
+
type Options = {
|
|
498
|
+
/** The ID of the chain, which `CONFIGURABLE_ACCOUNTS` names. */
|
|
499
|
+
chainId: number
|
|
500
|
+
/** The address of the key, such as a Privy wallet or a registered passkey. */
|
|
501
|
+
key: Address.Address
|
|
502
|
+
/** The kind of the key, such as `privy` or `webAuthn`. */
|
|
503
|
+
type: string
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
/**
|
|
508
|
+
* Instantiates a {@link Config}.
|
|
509
|
+
*
|
|
510
|
+
* @example
|
|
511
|
+
* ```ts
|
|
512
|
+
* const config = ConfigurableAccount.from({
|
|
513
|
+
* address: '0x8C3b5d0e2A4f6B1c9D7e3F5a0B2c4D6e8F1a3B5c',
|
|
514
|
+
* chainId: 31318,
|
|
515
|
+
* owners: [{ address: '0x8c3b…', type: 'privy', weight: 1 }],
|
|
516
|
+
* salt: '0x…',
|
|
517
|
+
* threshold: 1,
|
|
518
|
+
* version: 1n,
|
|
519
|
+
* })
|
|
520
|
+
* ```
|
|
521
|
+
*/
|
|
522
|
+
export function from(value: Config): Config {
|
|
523
|
+
return value
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
/** Returns the stored configurations of the user's accounts on the chain `chainId`. */
|
|
527
|
+
export async function list(
|
|
528
|
+
db: Realm.Database,
|
|
529
|
+
options: list.Options,
|
|
530
|
+
): Promise<readonly Config[]> {
|
|
531
|
+
const rows = await db
|
|
532
|
+
.select()
|
|
533
|
+
.from(Schema.accountConfigs)
|
|
534
|
+
.where(
|
|
535
|
+
and(
|
|
536
|
+
eq(Schema.accountConfigs.chainId, options.chainId),
|
|
537
|
+
eq(Schema.accountConfigs.userId, options.userId),
|
|
538
|
+
),
|
|
539
|
+
)
|
|
540
|
+
return rows.map((row) =>
|
|
541
|
+
from({
|
|
542
|
+
address: Address.checksum(row.address as Address.Address),
|
|
543
|
+
chainId: row.chainId,
|
|
544
|
+
key: Address.checksum(row.key as Address.Address),
|
|
545
|
+
owners: schema.owners.parse(row.owners).map((owner) => ({
|
|
546
|
+
...owner,
|
|
547
|
+
address: Address.checksum(owner.address),
|
|
548
|
+
})),
|
|
549
|
+
salt: row.salt as Hex.Hex,
|
|
550
|
+
threshold: row.threshold,
|
|
551
|
+
version: BigInt(row.version),
|
|
552
|
+
}),
|
|
553
|
+
)
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
export declare namespace list {
|
|
557
|
+
type Options = {
|
|
558
|
+
/** The chain's ID. */
|
|
559
|
+
chainId: number
|
|
560
|
+
/** The user's ID. */
|
|
561
|
+
userId: string
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
/**
|
|
566
|
+
* Returns the configuration that adds `add` to the account at `address`, in one change: an upgrade
|
|
567
|
+
* that keeps the account's key as an owner when `current` is absent, or an update of `current`
|
|
568
|
+
* otherwise.
|
|
569
|
+
*/
|
|
570
|
+
export function next(options: next.Options): Config {
|
|
571
|
+
const { add = [], address, chainId, current } = options
|
|
572
|
+
const owners = [
|
|
573
|
+
...(current?.owners ?? [{ address, type: options.type, weight: 1 }]),
|
|
574
|
+
...add,
|
|
575
|
+
]
|
|
576
|
+
const input = owners.map((entry) => ({
|
|
577
|
+
owner: entry.address,
|
|
578
|
+
weight: entry.weight,
|
|
579
|
+
}))
|
|
580
|
+
const config = current
|
|
581
|
+
? AccountConfig.update(toOx(current), { owners: input, threshold })
|
|
582
|
+
: AccountConfig.fromUpgrade(address, { owners: input, threshold })
|
|
583
|
+
return from({
|
|
584
|
+
address,
|
|
585
|
+
chainId,
|
|
586
|
+
key: current?.key ?? address,
|
|
587
|
+
// The configuration sorts its owners, so each keeps its kind by address.
|
|
588
|
+
owners: config.owners.map((entry) => ({
|
|
589
|
+
address: Address.checksum(entry.owner),
|
|
590
|
+
type: owners.find((candidate) =>
|
|
591
|
+
Address.isEqual(candidate.address, entry.owner),
|
|
592
|
+
)!.type,
|
|
593
|
+
weight: Number(entry.weight),
|
|
594
|
+
})),
|
|
595
|
+
salt: config.salt,
|
|
596
|
+
threshold: Number(config.threshold),
|
|
597
|
+
version: BigInt(config.version),
|
|
598
|
+
})
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
export declare namespace next {
|
|
602
|
+
type Options = {
|
|
603
|
+
/** The owners that the configuration adds. Absent for an upgrade that adds none. */
|
|
604
|
+
add?: readonly Owner.Configurable.Owner[] | undefined
|
|
605
|
+
/** The account's address. */
|
|
606
|
+
address: Address.Address
|
|
607
|
+
/** The ID of the chain where the configuration is live. */
|
|
608
|
+
chainId: number
|
|
609
|
+
/** The account's configuration. Absent for an account that is not yet configurable. */
|
|
610
|
+
current: Config | undefined
|
|
611
|
+
/** The kind of the account's key, which an upgrade keeps as an owner. */
|
|
612
|
+
type: string
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
/** Returns the configuration of the account that `owner` owns, or `undefined` when it is not configurable. */
|
|
617
|
+
export function of(owner: Owner.Owner): Config | undefined {
|
|
618
|
+
const { configurable } = owner
|
|
619
|
+
if (!configurable) return undefined
|
|
620
|
+
const { config } = configurable.owner.account
|
|
621
|
+
return from({
|
|
622
|
+
address: configurable.owner.account.address,
|
|
623
|
+
chainId: configurable.chainId,
|
|
624
|
+
key: Owner.key(owner),
|
|
625
|
+
owners: configurable.owners,
|
|
626
|
+
salt: config.salt,
|
|
627
|
+
threshold: Number(config.threshold),
|
|
628
|
+
version: BigInt(config.version),
|
|
629
|
+
})
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
/**
|
|
633
|
+
* Prepares the transaction that installs `target`, for a passkey to sign in the browser. Returns the
|
|
634
|
+
* digest that the passkey signs as its challenge, and the unsigned transaction that {@link sendSigned}
|
|
635
|
+
* signs with the assertion. Without `current`, the passkey is the account's key, which signs the
|
|
636
|
+
* upgrade. With it, the passkey is one of `current`'s owners.
|
|
637
|
+
*
|
|
638
|
+
* @throws {ConflictError} When the chain's configuration differs from `current`.
|
|
639
|
+
*/
|
|
640
|
+
export async function request(
|
|
641
|
+
options: request.Options,
|
|
642
|
+
): Promise<request.ReturnType> {
|
|
643
|
+
const { client, current, publicKey, target } = options
|
|
644
|
+
await check({ client, current, target })
|
|
645
|
+
|
|
646
|
+
const captured: { digest?: Hex.Hex | undefined } = {}
|
|
647
|
+
const passkey = Account.from({
|
|
648
|
+
keyType: 'webAuthn',
|
|
649
|
+
publicKey: PublicKey.fromHex(publicKey),
|
|
650
|
+
sign(parameters) {
|
|
651
|
+
captured.digest = parameters.hash
|
|
652
|
+
return Promise.reject(new Error('The digest is captured.'))
|
|
653
|
+
},
|
|
654
|
+
})
|
|
655
|
+
const account = current ? toAccount(current, { signers: [passkey] }) : passkey
|
|
656
|
+
const prepared = await prepare({ account, client, current, target })
|
|
657
|
+
const transaction = await Transaction.serialize(prepared as never)
|
|
658
|
+
// The passkey signs nothing here: its `sign` records the digest of the transaction, then refuses.
|
|
659
|
+
await signTransaction(client, { ...prepared, account } as never).catch(
|
|
660
|
+
() => undefined,
|
|
661
|
+
)
|
|
662
|
+
if (!captured.digest)
|
|
663
|
+
throw new Error('The transaction asked the passkey to sign no digest.')
|
|
664
|
+
return { digest: captured.digest, transaction }
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
export declare namespace request {
|
|
668
|
+
type Options = {
|
|
669
|
+
/** The client, from {@link client}. */
|
|
670
|
+
client: Client
|
|
671
|
+
/** The account's stored configuration. Absent for an account that is not yet configurable. */
|
|
672
|
+
current: Config | undefined
|
|
673
|
+
/** The passkey's uncompressed P256 public key, hex. */
|
|
674
|
+
publicKey: Hex.Hex
|
|
675
|
+
/** The configuration to install, from {@link next}. */
|
|
676
|
+
target: Config
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
type ReturnType = {
|
|
680
|
+
/** The digest that the passkey signs, as hex. */
|
|
681
|
+
digest: Hex.Hex
|
|
682
|
+
/** The unsigned transaction, serialized. */
|
|
683
|
+
transaction: Hex.Hex
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
type ErrorType = ConflictError
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
/**
|
|
690
|
+
* Stores `config` for the user with `userId`. A stored configuration of a later version stays, so
|
|
691
|
+
* two concurrent changes keep the newer one.
|
|
692
|
+
*/
|
|
693
|
+
export async function save(db: Realm.Database, options: save.Options) {
|
|
694
|
+
const { config, userId } = options
|
|
695
|
+
const values = {
|
|
696
|
+
address: config.address.toLowerCase(),
|
|
697
|
+
chainId: config.chainId,
|
|
698
|
+
key: config.key.toLowerCase(),
|
|
699
|
+
owners: config.owners.map((owner) => ({
|
|
700
|
+
address: owner.address.toLowerCase(),
|
|
701
|
+
type: owner.type,
|
|
702
|
+
weight: owner.weight,
|
|
703
|
+
})),
|
|
704
|
+
salt: config.salt,
|
|
705
|
+
threshold: config.threshold,
|
|
706
|
+
userId,
|
|
707
|
+
version: config.version.toString(),
|
|
708
|
+
}
|
|
709
|
+
await db
|
|
710
|
+
.insert(Schema.accountConfigs)
|
|
711
|
+
.values(values)
|
|
712
|
+
.onConflictDoUpdate({
|
|
713
|
+
set: {
|
|
714
|
+
owners: values.owners,
|
|
715
|
+
salt: values.salt,
|
|
716
|
+
threshold: values.threshold,
|
|
717
|
+
updatedAt: sql`now()`,
|
|
718
|
+
version: values.version,
|
|
719
|
+
},
|
|
720
|
+
// A row of a later version, or of another user, stays as it is.
|
|
721
|
+
setWhere: sql`${Schema.accountConfigs.version}::numeric < excluded.version::numeric and ${Schema.accountConfigs.userId} = excluded.user_id`,
|
|
722
|
+
target: [Schema.accountConfigs.chainId, Schema.accountConfigs.address],
|
|
723
|
+
})
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
export declare namespace save {
|
|
727
|
+
type Options = {
|
|
728
|
+
/** The configuration that the chain installed. */
|
|
729
|
+
config: Config
|
|
730
|
+
/** The user who holds the account. */
|
|
731
|
+
userId: string
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
/**
|
|
736
|
+
* Sends the transaction that installs `target` from `account`, and returns the installed
|
|
737
|
+
* configuration. Without `current`, `account` is the account's key, which signs the upgrade. With
|
|
738
|
+
* it, `account` is the configurable account with an owner that signs, from {@link toAccount}. The
|
|
739
|
+
* chain's configuration must match `current`.
|
|
740
|
+
*
|
|
741
|
+
* @throws {ConflictError} When the chain's configuration differs from `current`.
|
|
742
|
+
*/
|
|
743
|
+
export async function send(options: send.Options): Promise<Config> {
|
|
744
|
+
const { account, client, current, target } = options
|
|
745
|
+
await check({ client, current, target })
|
|
746
|
+
|
|
747
|
+
const request = await prepare({ account, client, current, target })
|
|
748
|
+
const signed = await signTransaction(client, { ...request, account } as never)
|
|
749
|
+
await submit({ client, serialized: signed })
|
|
750
|
+
return target
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
export declare namespace send {
|
|
754
|
+
type Options = {
|
|
755
|
+
/** The account that sends: its key for an upgrade, or the configurable account of `current`. */
|
|
756
|
+
account: LocalAccount
|
|
757
|
+
/** The client, from {@link client}. */
|
|
758
|
+
client: Client
|
|
759
|
+
/** The account's stored configuration. Absent for an account that is not yet configurable. */
|
|
760
|
+
current: Config | undefined
|
|
761
|
+
/** The configuration to install, from {@link next}. */
|
|
762
|
+
target: Config
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
type ErrorType = ConflictError
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
/**
|
|
769
|
+
* Signs the transaction that {@link request} prepared with `assertion`, the passkey's signature over
|
|
770
|
+
* its digest, sends it, and returns the installed configuration. The chain must still hold `current`.
|
|
771
|
+
*
|
|
772
|
+
* @throws {ConflictError} When the chain's configuration differs from `current`.
|
|
773
|
+
*/
|
|
774
|
+
export async function sendSigned(options: sendSigned.Options): Promise<Config> {
|
|
775
|
+
const { assertion, client, current, digest, publicKey, target } = options
|
|
776
|
+
await check({ client, current, target })
|
|
777
|
+
|
|
778
|
+
const { metadata, signature } = Authentication.deserializeResponse(assertion)
|
|
779
|
+
const envelope = SignatureEnvelope.serialize({
|
|
780
|
+
metadata: {
|
|
781
|
+
authenticatorData: metadata.authenticatorData,
|
|
782
|
+
clientDataJSON: metadata.clientDataJSON,
|
|
783
|
+
},
|
|
784
|
+
publicKey: PublicKey.fromHex(publicKey),
|
|
785
|
+
signature,
|
|
786
|
+
type: 'webAuthn',
|
|
787
|
+
})
|
|
788
|
+
|
|
789
|
+
// The passkey already signed the digest, so this owner returns its envelope, and nothing else.
|
|
790
|
+
const passkey = Account.from({
|
|
791
|
+
keyType: 'webAuthn',
|
|
792
|
+
publicKey: PublicKey.fromHex(publicKey),
|
|
793
|
+
sign(parameters) {
|
|
794
|
+
if (parameters.hash !== digest)
|
|
795
|
+
return Promise.reject(
|
|
796
|
+
new Error('The assertion signs another transaction.'),
|
|
797
|
+
)
|
|
798
|
+
return Promise.resolve(envelope)
|
|
799
|
+
},
|
|
800
|
+
})
|
|
801
|
+
const account = current ? toAccount(current, { signers: [passkey] }) : passkey
|
|
802
|
+
const fields: object = Transaction.deserialize(options.transaction as never)
|
|
803
|
+
const signed = await signTransaction(client, { ...fields, account } as never)
|
|
804
|
+
await submit({ client, serialized: signed })
|
|
805
|
+
return target
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
export declare namespace sendSigned {
|
|
809
|
+
type Options = request.Options & {
|
|
810
|
+
/** The passkey's assertion over `digest`, which `Passkey.verify` accepted. */
|
|
811
|
+
assertion: Passkey.Assertion
|
|
812
|
+
/** The digest that {@link request} returned, which the passkey signed. */
|
|
813
|
+
digest: Hex.Hex
|
|
814
|
+
/** The unsigned transaction that {@link request} returned. */
|
|
815
|
+
transaction: Hex.Hex
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
type ErrorType = ConflictError
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
/**
|
|
822
|
+
* Prepares the transaction that registers `key`, an access key that the account's own key signed,
|
|
823
|
+
* so the key keeps working after the upgrade retires that signature (TIP-1112). The access key signs
|
|
824
|
+
* the transaction in the app, so its one call is a TIP-20 transfer of 0 that the key's scopes allow.
|
|
825
|
+
* Returns the digest that the access key signs raw, and the unsigned transaction, or `undefined` when
|
|
826
|
+
* no scope allows such a call.
|
|
827
|
+
*/
|
|
828
|
+
export async function requestRegistration(
|
|
829
|
+
options: requestRegistration.Options,
|
|
830
|
+
): Promise<requestRegistration.ReturnType | undefined> {
|
|
831
|
+
const { account, client, key } = options
|
|
832
|
+
const call = registration(key, { account })
|
|
833
|
+
if (!call) return undefined
|
|
834
|
+
|
|
835
|
+
const captured: { digest?: Hex.Hex | undefined } = {}
|
|
836
|
+
const signer = accessKey({
|
|
837
|
+
account,
|
|
838
|
+
key,
|
|
839
|
+
sign(hash) {
|
|
840
|
+
captured.digest = hash
|
|
841
|
+
return Promise.reject(new Error('The digest is captured.'))
|
|
842
|
+
},
|
|
843
|
+
})
|
|
844
|
+
const prepared = await prepareTransactionRequest(client, {
|
|
845
|
+
account: signer,
|
|
846
|
+
calls: [call],
|
|
847
|
+
feePayer: client.transport.key === 'relay' ? true : undefined,
|
|
848
|
+
keyAuthorization: key,
|
|
849
|
+
nonceKey: Hex.toBigInt(Hex.random(24)),
|
|
850
|
+
type: 'tempo',
|
|
851
|
+
validBefore: Math.floor(Date.now() / 1000) + lifetime,
|
|
852
|
+
} as never)
|
|
853
|
+
const transaction = await Transaction.serialize(prepared as never)
|
|
854
|
+
await signTransaction(client, {
|
|
855
|
+
...prepared,
|
|
856
|
+
account: signer,
|
|
857
|
+
} as never).catch(() => undefined)
|
|
858
|
+
if (!captured.digest)
|
|
859
|
+
throw new Error('The transaction asked the access key to sign no digest.')
|
|
860
|
+
return { digest: captured.digest, transaction }
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
export declare namespace requestRegistration {
|
|
864
|
+
type Options = {
|
|
865
|
+
/** The account that the key acts for. */
|
|
866
|
+
account: Address.Address
|
|
867
|
+
/** The client, from {@link client}. */
|
|
868
|
+
client: Client
|
|
869
|
+
/** The signed key authorization, whose access key signs the registration. */
|
|
870
|
+
key: KeyAuthorization.Signed
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
type ReturnType = {
|
|
874
|
+
/** The digest that the access key signs raw, as hex. */
|
|
875
|
+
digest: Hex.Hex
|
|
876
|
+
/** The unsigned transaction, serialized. */
|
|
877
|
+
transaction: Hex.Hex
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
/**
|
|
882
|
+
* Returns whether the chain holds `key`, an access key, for `account`: `active`, `revoked`, or
|
|
883
|
+
* `missing`. A revoked key stays on the chain, so no registration replaces it.
|
|
884
|
+
*/
|
|
885
|
+
export async function keyStatus(
|
|
886
|
+
options: keyStatus.Options,
|
|
887
|
+
): Promise<'active' | 'missing' | 'revoked'> {
|
|
888
|
+
const { account, client, key } = options
|
|
889
|
+
const metadata = await Actions.accessKey.getMetadata(client, {
|
|
890
|
+
account,
|
|
891
|
+
accessKey: key,
|
|
892
|
+
})
|
|
893
|
+
// The chain reads a revoked key with the zero address, so the flag decides first.
|
|
894
|
+
if (metadata.isRevoked) return 'revoked'
|
|
895
|
+
return Address.isEqual(metadata.address, key) ? 'active' : 'missing'
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
export declare namespace keyStatus {
|
|
899
|
+
type Options = {
|
|
900
|
+
/** The account that the key acts for. */
|
|
901
|
+
account: Address.Address
|
|
902
|
+
/** The client, from {@link client}. */
|
|
903
|
+
client: Client
|
|
904
|
+
/** The access key's address. */
|
|
905
|
+
key: Address.Address
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
/**
|
|
910
|
+
* Signs the transaction that {@link requestRegistration} prepared with `signature`, the access key's
|
|
911
|
+
* raw signature over `digest`, and sends it. Resolves once the chain registered the key.
|
|
912
|
+
*/
|
|
913
|
+
export async function sendRegistration(options: sendRegistration.Options) {
|
|
914
|
+
const { account, client, digest, signature } = options
|
|
915
|
+
const fields = Transaction.deserialize(options.transaction as never) as {
|
|
916
|
+
keyAuthorization: KeyAuthorization.Signed
|
|
917
|
+
}
|
|
918
|
+
const signer = accessKey({
|
|
919
|
+
account,
|
|
920
|
+
key: fields.keyAuthorization,
|
|
921
|
+
sign(hash) {
|
|
922
|
+
if (hash !== digest)
|
|
923
|
+
return Promise.reject(
|
|
924
|
+
new Error('The signature signs another transaction.'),
|
|
925
|
+
)
|
|
926
|
+
return Promise.resolve(signature)
|
|
927
|
+
},
|
|
928
|
+
})
|
|
929
|
+
const signed = await signTransaction(client, {
|
|
930
|
+
...fields,
|
|
931
|
+
account: signer,
|
|
932
|
+
} as never)
|
|
933
|
+
await submit({ client, serialized: signed })
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
export declare namespace sendRegistration {
|
|
937
|
+
type Options = {
|
|
938
|
+
/** The account that the key acts for. */
|
|
939
|
+
account: Address.Address
|
|
940
|
+
/** The client, from {@link client}. */
|
|
941
|
+
client: Client
|
|
942
|
+
/** The digest that {@link requestRegistration} returned. */
|
|
943
|
+
digest: Hex.Hex
|
|
944
|
+
/** The access key's raw signature over `digest`, as a serialized signature envelope. */
|
|
945
|
+
signature: Hex.Hex
|
|
946
|
+
/** The unsigned transaction that {@link requestRegistration} returned. */
|
|
947
|
+
transaction: Hex.Hex
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
/**
|
|
952
|
+
* Stores a change that waits for the passkey's signature over `digest`, for the user with `userId`,
|
|
953
|
+
* for {@link lifetime}. {@link takePending} reads it once.
|
|
954
|
+
*/
|
|
955
|
+
export async function storePending(
|
|
956
|
+
db: Realm.Database,
|
|
957
|
+
options: storePending.Options,
|
|
958
|
+
) {
|
|
959
|
+
const { current, digest, registration, target, transaction, userId } = options
|
|
960
|
+
const encode = (config: Config) => ({
|
|
961
|
+
...config,
|
|
962
|
+
version: config.version.toString(),
|
|
963
|
+
})
|
|
964
|
+
await db.insert(Schema.verification).values({
|
|
965
|
+
expiresAt: new Date(Date.now() + lifetime * 1000),
|
|
966
|
+
id: crypto.randomUUID(),
|
|
967
|
+
identifier: pendingIdentifier({ digest, userId }),
|
|
968
|
+
value: JSON.stringify(
|
|
969
|
+
schema.pending.parse({
|
|
970
|
+
...(current ? { current: encode(current) } : {}),
|
|
971
|
+
...(registration ? { registration } : {}),
|
|
972
|
+
target: encode(target),
|
|
973
|
+
transaction,
|
|
974
|
+
}),
|
|
975
|
+
),
|
|
976
|
+
})
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
export declare namespace storePending {
|
|
980
|
+
type Options = {
|
|
981
|
+
/** The account's stored configuration. Absent for an account that is not yet configurable. */
|
|
982
|
+
current: Config | undefined
|
|
983
|
+
/** The digest that the passkey signs. */
|
|
984
|
+
digest: Hex.Hex
|
|
985
|
+
/** The key's registration, which the chain receives before the change. Absent without one. */
|
|
986
|
+
registration?: requestRegistration.ReturnType | undefined
|
|
987
|
+
/** The configuration to install. */
|
|
988
|
+
target: Config
|
|
989
|
+
/** The unsigned transaction. */
|
|
990
|
+
transaction: Hex.Hex
|
|
991
|
+
/** The signed-in user's ID. */
|
|
992
|
+
userId: string
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
/**
|
|
997
|
+
* Deletes and returns the change that waits for the passkey's signature over `digest`, for the user
|
|
998
|
+
* with `userId`, or `undefined` when none is stored or it expired.
|
|
999
|
+
*/
|
|
1000
|
+
export async function takePending(
|
|
1001
|
+
db: Realm.Database,
|
|
1002
|
+
options: takePending.Options,
|
|
1003
|
+
): Promise<takePending.ReturnType> {
|
|
1004
|
+
const [row] = await db
|
|
1005
|
+
.delete(Schema.verification)
|
|
1006
|
+
.where(
|
|
1007
|
+
and(
|
|
1008
|
+
eq(Schema.verification.identifier, pendingIdentifier(options)),
|
|
1009
|
+
gt(Schema.verification.expiresAt, new Date()),
|
|
1010
|
+
),
|
|
1011
|
+
)
|
|
1012
|
+
.returning({ value: Schema.verification.value })
|
|
1013
|
+
if (!row) return undefined
|
|
1014
|
+
|
|
1015
|
+
const value = schema.pending.parse(JSON.parse(row.value))
|
|
1016
|
+
const decode = (config: z.output<typeof schema.pending>['target']) =>
|
|
1017
|
+
from({
|
|
1018
|
+
...config,
|
|
1019
|
+
address: Address.checksum(config.address),
|
|
1020
|
+
key: Address.checksum(config.key),
|
|
1021
|
+
owners: config.owners.map((owner) => ({
|
|
1022
|
+
...owner,
|
|
1023
|
+
address: Address.checksum(owner.address),
|
|
1024
|
+
})),
|
|
1025
|
+
version: BigInt(config.version),
|
|
1026
|
+
})
|
|
1027
|
+
return {
|
|
1028
|
+
current: value.current ? decode(value.current) : undefined,
|
|
1029
|
+
registration: value.registration,
|
|
1030
|
+
target: decode(value.target),
|
|
1031
|
+
transaction: value.transaction,
|
|
1032
|
+
}
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
export declare namespace takePending {
|
|
1036
|
+
type Options = {
|
|
1037
|
+
/** The digest that the passkey signed. */
|
|
1038
|
+
digest: Hex.Hex
|
|
1039
|
+
/** The signed-in user's ID. */
|
|
1040
|
+
userId: string
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1043
|
+
type ReturnType =
|
|
1044
|
+
| {
|
|
1045
|
+
/** The account's configuration when the change was prepared, if any. */
|
|
1046
|
+
current: Config | undefined
|
|
1047
|
+
/** The key's registration, which the chain receives before the change, if any. */
|
|
1048
|
+
registration: requestRegistration.ReturnType | undefined
|
|
1049
|
+
/** The configuration to install. */
|
|
1050
|
+
target: Config
|
|
1051
|
+
/** The unsigned transaction. */
|
|
1052
|
+
transaction: Hex.Hex
|
|
1053
|
+
}
|
|
1054
|
+
| undefined
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1057
|
+
/**
|
|
1058
|
+
* Returns the configurable account of `config` as Viem signs for it. Each of `signers` signs as the
|
|
1059
|
+
* owner at its address, and every other owner is an address alone.
|
|
1060
|
+
*/
|
|
1061
|
+
export function toAccount(config: Config, options: toAccount.Options = {}) {
|
|
1062
|
+
const { signers = [] } = options
|
|
1063
|
+
const owners = config.owners.map((entry) => ({
|
|
1064
|
+
owner:
|
|
1065
|
+
signers.find((signer) =>
|
|
1066
|
+
Address.isEqual(signer.address, entry.address),
|
|
1067
|
+
) ?? entry.address,
|
|
1068
|
+
weight: entry.weight,
|
|
1069
|
+
}))
|
|
1070
|
+
// Viem derives the address of an initial configuration, and takes it for any later version.
|
|
1071
|
+
if (config.version === 0n)
|
|
1072
|
+
return Account.fromConfig({
|
|
1073
|
+
owners,
|
|
1074
|
+
salt: config.salt,
|
|
1075
|
+
threshold: config.threshold,
|
|
1076
|
+
})
|
|
1077
|
+
return Account.fromConfig({
|
|
1078
|
+
address: config.address,
|
|
1079
|
+
owners,
|
|
1080
|
+
salt: config.salt,
|
|
1081
|
+
threshold: config.threshold,
|
|
1082
|
+
version: config.version,
|
|
1083
|
+
})
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1086
|
+
export declare namespace toAccount {
|
|
1087
|
+
type Options = {
|
|
1088
|
+
/** The owners that sign on the server, as Viem accounts. */
|
|
1089
|
+
signers?: readonly LocalAccount[] | undefined
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
/**
|
|
1094
|
+
* Returns `key`'s access key as the signer of `account`, which Viem signs for through a keychain
|
|
1095
|
+
* envelope. `sign` receives the digest that the access key signs raw. Tempo ID holds no public key
|
|
1096
|
+
* of the access key, so the address comes from the key authorization.
|
|
1097
|
+
*/
|
|
1098
|
+
function accessKey(options: accessKey.Options) {
|
|
1099
|
+
const { account, key } = options
|
|
1100
|
+
const signer = Account.from({
|
|
1101
|
+
access: account,
|
|
1102
|
+
keyType: key.type as 'secp256k1',
|
|
1103
|
+
// The keychain envelope names the parent account, and the key authorization names the access
|
|
1104
|
+
// key, so the public key signs nothing. Any valid point fills it.
|
|
1105
|
+
publicKey: Secp256k1.getPublicKey({ privateKey: placeholder }),
|
|
1106
|
+
sign: (parameters) => options.sign(parameters.hash),
|
|
1107
|
+
})
|
|
1108
|
+
return { ...signer, accessKeyAddress: Address.checksum(key.address) }
|
|
1109
|
+
}
|
|
1110
|
+
|
|
1111
|
+
declare namespace accessKey {
|
|
1112
|
+
type Options = {
|
|
1113
|
+
/** The account that the key acts for. */
|
|
1114
|
+
account: Address.Address
|
|
1115
|
+
/** The signed key authorization. */
|
|
1116
|
+
key: KeyAuthorization.Signed
|
|
1117
|
+
/** Returns the access key's raw signature over `hash`. */
|
|
1118
|
+
sign: (hash: Hex.Hex) => Promise<Hex.Hex>
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
1121
|
+
|
|
1122
|
+
/**
|
|
1123
|
+
* Checks that the chain still holds `current`, or no configuration for an account that is not yet
|
|
1124
|
+
* configurable.
|
|
1125
|
+
*
|
|
1126
|
+
* @throws {ConflictError} When it does not.
|
|
1127
|
+
*/
|
|
1128
|
+
async function check(options: check.Options) {
|
|
1129
|
+
const { client, current, target } = options
|
|
1130
|
+
const commitment = await Actions.accounts.getConfigCommitment(client, {
|
|
1131
|
+
account: target.address,
|
|
1132
|
+
})
|
|
1133
|
+
const expected = current
|
|
1134
|
+
? AccountConfig.getCommitment(toOx(current))
|
|
1135
|
+
: undefined
|
|
1136
|
+
const empty = /^0x0*$/.test(commitment)
|
|
1137
|
+
// An account that is configurable from its creation holds no commitment until it first sends.
|
|
1138
|
+
const matches = expected
|
|
1139
|
+
? Hex.isEqual(commitment, expected) || (current!.version === 0n && empty)
|
|
1140
|
+
: empty
|
|
1141
|
+
if (!matches) throw new ConflictError({ account: target.address })
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1144
|
+
declare namespace check {
|
|
1145
|
+
type Options = {
|
|
1146
|
+
/** The client, from {@link client}. */
|
|
1147
|
+
client: Client
|
|
1148
|
+
/** The account's stored configuration, if any. */
|
|
1149
|
+
current: Config | undefined
|
|
1150
|
+
/** The configuration to install. */
|
|
1151
|
+
target: Config
|
|
1152
|
+
}
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1155
|
+
/**
|
|
1156
|
+
* Returns whether the chain already holds `target`'s commitment for its account, such as after an
|
|
1157
|
+
* upgrade that the chain accepted and whose save failed.
|
|
1158
|
+
*/
|
|
1159
|
+
export async function installed(options: installed.Options) {
|
|
1160
|
+
const { client, target } = options
|
|
1161
|
+
const commitment = await Actions.accounts.getConfigCommitment(client, {
|
|
1162
|
+
account: target.address,
|
|
1163
|
+
})
|
|
1164
|
+
return Hex.isEqual(commitment, AccountConfig.getCommitment(toOx(target)))
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
export declare namespace installed {
|
|
1168
|
+
type Options = {
|
|
1169
|
+
/** The client, from {@link client}. */
|
|
1170
|
+
client: Client
|
|
1171
|
+
/** The configuration that a change installs. */
|
|
1172
|
+
target: Config
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
/** Returns the `verification` identifier of a pending change. JSON keeps each value apart. */
|
|
1177
|
+
function pendingIdentifier(options: takePending.Options) {
|
|
1178
|
+
return (
|
|
1179
|
+
pendingPrefix +
|
|
1180
|
+
JSON.stringify([options.userId, options.digest.toLowerCase()])
|
|
1181
|
+
)
|
|
1182
|
+
}
|
|
1183
|
+
|
|
1184
|
+
/**
|
|
1185
|
+
* Prepares the transaction that installs `target` for `account`: the upgrade's only call, or the
|
|
1186
|
+
* configuration update. A random nonce key gives the transaction a nonce lane of its own, which no
|
|
1187
|
+
* other transaction of the account spends while the passkey signs. It is valid for {@link lifetime}.
|
|
1188
|
+
*/
|
|
1189
|
+
async function prepare(options: prepare.Options) {
|
|
1190
|
+
const { account, client, current, target } = options
|
|
1191
|
+
const owners = target.owners.map((entry) => ({
|
|
1192
|
+
owner: entry.address,
|
|
1193
|
+
weight: entry.weight,
|
|
1194
|
+
}))
|
|
1195
|
+
const calls = current
|
|
1196
|
+
? [
|
|
1197
|
+
Actions.accounts.updateConfig.call({
|
|
1198
|
+
currentConfig: toOx(current),
|
|
1199
|
+
nextConfig: { owners, threshold: target.threshold },
|
|
1200
|
+
}),
|
|
1201
|
+
]
|
|
1202
|
+
: [
|
|
1203
|
+
Actions.accounts.upgrade.call({
|
|
1204
|
+
owners,
|
|
1205
|
+
threshold: target.threshold,
|
|
1206
|
+
}),
|
|
1207
|
+
]
|
|
1208
|
+
return await prepareTransactionRequest(client, {
|
|
1209
|
+
account,
|
|
1210
|
+
calls,
|
|
1211
|
+
// Only the Tempo API's sponsor relay fills and co-signs a sponsored transaction.
|
|
1212
|
+
feePayer: client.transport.key === 'relay' ? true : undefined,
|
|
1213
|
+
nonceKey: Hex.toBigInt(Hex.random(24)),
|
|
1214
|
+
type: 'tempo',
|
|
1215
|
+
validBefore: Math.floor(Date.now() / 1000) + lifetime,
|
|
1216
|
+
} as never)
|
|
1217
|
+
}
|
|
1218
|
+
|
|
1219
|
+
declare namespace prepare {
|
|
1220
|
+
type Options = {
|
|
1221
|
+
/** The account that sends: the key itself for an upgrade, or the configurable account. */
|
|
1222
|
+
account: LocalAccount
|
|
1223
|
+
/** The client, from {@link client}. */
|
|
1224
|
+
client: Client
|
|
1225
|
+
/** The account's stored configuration, if any. */
|
|
1226
|
+
current: Config | undefined
|
|
1227
|
+
/** The configuration to install. */
|
|
1228
|
+
target: Config
|
|
1229
|
+
}
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1232
|
+
/**
|
|
1233
|
+
* Returns the call that registers `key` for `account`: a TIP-20 `transfer` or `transferWithMemo` of 0
|
|
1234
|
+
* that a scope allows, to the account or the first recipient that the scope names. A key without
|
|
1235
|
+
* scopes transfers 0 pathUSD. Returns `undefined` when no scope allows such a call.
|
|
1236
|
+
*/
|
|
1237
|
+
function registration(
|
|
1238
|
+
key: KeyAuthorization.Signed,
|
|
1239
|
+
options: registration.Options,
|
|
1240
|
+
) {
|
|
1241
|
+
const { account } = options
|
|
1242
|
+
if (!key.scopes) return transfer({ to: account, token: pathUsd })
|
|
1243
|
+
|
|
1244
|
+
for (const scope of key.scopes) {
|
|
1245
|
+
if (!tip20(scope.address)) continue
|
|
1246
|
+
const to = scope.recipients?.[0] ?? account
|
|
1247
|
+
const selector = scope.selector?.toLowerCase()
|
|
1248
|
+
if (selector === selectors.transfer)
|
|
1249
|
+
return transfer({ to, token: scope.address })
|
|
1250
|
+
if (selector === selectors.transferWithMemo)
|
|
1251
|
+
return Actions.token.transfer.call({
|
|
1252
|
+
amount: 0n,
|
|
1253
|
+
memo: Hex.padLeft('0x', 32),
|
|
1254
|
+
to,
|
|
1255
|
+
token: scope.address,
|
|
1256
|
+
})
|
|
1257
|
+
}
|
|
1258
|
+
return undefined
|
|
1259
|
+
}
|
|
1260
|
+
|
|
1261
|
+
declare namespace registration {
|
|
1262
|
+
type Options = {
|
|
1263
|
+
/** The account that the key acts for, which receives a transfer of 0 without a named recipient. */
|
|
1264
|
+
account: Address.Address
|
|
1265
|
+
}
|
|
1266
|
+
}
|
|
1267
|
+
|
|
1268
|
+
/**
|
|
1269
|
+
* Sends a signed transaction and waits for its receipt.
|
|
1270
|
+
*
|
|
1271
|
+
* @throws When the node refuses it or the transaction reverts.
|
|
1272
|
+
*/
|
|
1273
|
+
async function submit(options: submit.Options) {
|
|
1274
|
+
const receipt = await sendRawTransactionSync(options.client, {
|
|
1275
|
+
serializedTransaction: options.serialized as never,
|
|
1276
|
+
})
|
|
1277
|
+
if (receipt.status !== 'success')
|
|
1278
|
+
throw new Error(`The transaction ${receipt.transactionHash} reverted.`)
|
|
1279
|
+
}
|
|
1280
|
+
|
|
1281
|
+
declare namespace submit {
|
|
1282
|
+
type Options = {
|
|
1283
|
+
/** The client, from {@link client}. */
|
|
1284
|
+
client: Client
|
|
1285
|
+
/** The signed transaction, serialized. */
|
|
1286
|
+
serialized: Hex.Hex
|
|
1287
|
+
}
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
/** Returns `config` as ox reads a configuration. */
|
|
1291
|
+
function toOx(config: Config) {
|
|
1292
|
+
return AccountConfig.from({
|
|
1293
|
+
owners: config.owners.map((entry) => ({
|
|
1294
|
+
owner: entry.address,
|
|
1295
|
+
weight: entry.weight,
|
|
1296
|
+
})),
|
|
1297
|
+
salt: config.salt,
|
|
1298
|
+
threshold: config.threshold,
|
|
1299
|
+
version: config.version,
|
|
1300
|
+
})
|
|
1301
|
+
}
|
|
1302
|
+
|
|
1303
|
+
/** Returns a TIP-20 transfer of 0 of `token` to `to`. */
|
|
1304
|
+
function transfer(options: transfer.Options) {
|
|
1305
|
+
return Actions.token.transfer.call({ amount: 0n, ...options })
|
|
1306
|
+
}
|
|
1307
|
+
|
|
1308
|
+
declare namespace transfer {
|
|
1309
|
+
type Options = {
|
|
1310
|
+
/** The recipient of the transfer of 0. */
|
|
1311
|
+
to: Address.Address
|
|
1312
|
+
/** The TIP-20 token that transfers. */
|
|
1313
|
+
token: Address.Address
|
|
1314
|
+
}
|
|
1315
|
+
}
|