@reown/appkit-cdn 1.8.15-viem-upgrade.0 → 1.8.15-wc-linking-reset-headless.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ConstantsUtil-CbwdoWl-.js +24 -0
- package/dist/ConstantsUtil-CbwdoWl-.js.map +1 -0
- package/dist/ExchangeController-Dqyc5bBG.js +265 -0
- package/dist/ExchangeController-Dqyc5bBG.js.map +1 -0
- package/dist/HelpersUtil-DU2h_IDh.js +141 -0
- package/dist/HelpersUtil-DU2h_IDh.js.map +1 -0
- package/dist/NavigationUtil-Ci15WS4K.js +9 -0
- package/dist/NavigationUtil-Ci15WS4K.js.map +1 -0
- package/dist/PhArrowCircleDown-B41iUlWV.js +74 -0
- package/dist/PhArrowCircleDown-B41iUlWV.js.map +1 -0
- package/dist/PhArrowClockwise-BY8u5n41.js +74 -0
- package/dist/PhArrowClockwise-BY8u5n41.js.map +1 -0
- package/dist/PhArrowDown-ClD8GZ65.js +74 -0
- package/dist/PhArrowDown-ClD8GZ65.js.map +1 -0
- package/dist/PhArrowLeft-B8MXUz60.js +74 -0
- package/dist/PhArrowLeft-B8MXUz60.js.map +1 -0
- package/dist/PhArrowRight-Cewa_Slb.js +74 -0
- package/dist/PhArrowRight-Cewa_Slb.js.map +1 -0
- package/dist/PhArrowSquareOut-whgWh-lD.js +74 -0
- package/dist/PhArrowSquareOut-whgWh-lD.js.map +1 -0
- package/dist/PhArrowUp-B1HXBxie.js +74 -0
- package/dist/PhArrowUp-B1HXBxie.js.map +1 -0
- package/dist/PhArrowUpRight-CfFYe4FP.js +74 -0
- package/dist/PhArrowUpRight-CfFYe4FP.js.map +1 -0
- package/dist/PhArrowsClockwise-gL1Gkrtx.js +74 -0
- package/dist/PhArrowsClockwise-gL1Gkrtx.js.map +1 -0
- package/dist/PhArrowsDownUp-BqUEdUQr.js +74 -0
- package/dist/PhArrowsDownUp-BqUEdUQr.js.map +1 -0
- package/dist/PhArrowsLeftRight-BlZU63eY.js +74 -0
- package/dist/PhArrowsLeftRight-BlZU63eY.js.map +1 -0
- package/dist/PhBank-gbg_jlI7.js +74 -0
- package/dist/PhBank-gbg_jlI7.js.map +1 -0
- package/dist/PhBrowser-CMlD-YJw.js +74 -0
- package/dist/PhBrowser-CMlD-YJw.js.map +1 -0
- package/dist/PhCaretDown-3agTO8Jp.js +74 -0
- package/dist/PhCaretDown-3agTO8Jp.js.map +1 -0
- package/dist/PhCaretLeft-_MTni7Z5.js +74 -0
- package/dist/PhCaretLeft-_MTni7Z5.js.map +1 -0
- package/dist/PhCaretRight-Ci9fAHPG.js +74 -0
- package/dist/PhCaretRight-Ci9fAHPG.js.map +1 -0
- package/dist/PhCaretUp-vFG4Fame.js +74 -0
- package/dist/PhCaretUp-vFG4Fame.js.map +1 -0
- package/dist/PhCheck-mChGK6K_.js +74 -0
- package/dist/PhCheck-mChGK6K_.js.map +1 -0
- package/dist/PhCircleHalf-DZ7-vfxf.js +74 -0
- package/dist/PhCircleHalf-DZ7-vfxf.js.map +1 -0
- package/dist/PhClock-Bc5XWXb6.js +74 -0
- package/dist/PhClock-Bc5XWXb6.js.map +1 -0
- package/dist/PhCompass-Cu2MB-55.js +74 -0
- package/dist/PhCompass-Cu2MB-55.js.map +1 -0
- package/dist/PhCopy-BGUjyTts.js +74 -0
- package/dist/PhCopy-BGUjyTts.js.map +1 -0
- package/dist/PhCreditCard-vxFWID4B.js +74 -0
- package/dist/PhCreditCard-vxFWID4B.js.map +1 -0
- package/dist/PhCurrencyDollar-BfOoDhJr.js +74 -0
- package/dist/PhCurrencyDollar-BfOoDhJr.js.map +1 -0
- package/dist/PhDesktop-Cq6jwzbS.js +74 -0
- package/dist/PhDesktop-Cq6jwzbS.js.map +1 -0
- package/dist/PhDeviceMobile-BCtTp6jj.js +74 -0
- package/dist/PhDeviceMobile-BCtTp6jj.js.map +1 -0
- package/dist/PhDotsThree-BGgD-WIO.js +74 -0
- package/dist/PhDotsThree-BGgD-WIO.js.map +1 -0
- package/dist/PhEnvelope-CQiV0-zG.js +74 -0
- package/dist/PhEnvelope-CQiV0-zG.js.map +1 -0
- package/dist/PhFunnelSimple-BHGtxTNf.js +74 -0
- package/dist/PhFunnelSimple-BHGtxTNf.js.map +1 -0
- package/dist/PhGlobe-Q8oVkf6X.js +74 -0
- package/dist/PhGlobe-Q8oVkf6X.js.map +1 -0
- package/dist/PhIdentificationCard-Cz9LzvVR.js +74 -0
- package/dist/PhIdentificationCard-Cz9LzvVR.js.map +1 -0
- package/dist/PhImage-CP5_qKk-.js +74 -0
- package/dist/PhImage-CP5_qKk-.js.map +1 -0
- package/dist/PhInfo-CTlE1X9Z.js +74 -0
- package/dist/PhInfo-CTlE1X9Z.js.map +1 -0
- package/dist/PhLightbulb-CcLpnAAb.js +74 -0
- package/dist/PhLightbulb-CcLpnAAb.js.map +1 -0
- package/dist/PhMagnifyingGlass-n58GUAck.js +74 -0
- package/dist/PhMagnifyingGlass-n58GUAck.js.map +1 -0
- package/dist/PhPaperPlaneRight-C0sf2XV8.js +74 -0
- package/dist/PhPaperPlaneRight-C0sf2XV8.js.map +1 -0
- package/dist/PhPlus-BJxvt7Uc.js +74 -0
- package/dist/PhPlus-BJxvt7Uc.js.map +1 -0
- package/dist/PhPower-BvktxO2-.js +74 -0
- package/dist/PhPower-BvktxO2-.js.map +1 -0
- package/dist/PhPuzzlePiece-CDDyUPYo.js +74 -0
- package/dist/PhPuzzlePiece-CDDyUPYo.js.map +1 -0
- package/dist/PhQrCode-BlGI8529.js +74 -0
- package/dist/PhQrCode-BlGI8529.js.map +1 -0
- package/dist/PhQuestion-DGZj6iDZ.js +74 -0
- package/dist/PhQuestion-DGZj6iDZ.js.map +1 -0
- package/dist/PhQuestionMark-CTmeI7MQ.js +74 -0
- package/dist/PhQuestionMark-CTmeI7MQ.js.map +1 -0
- package/dist/PhSealCheck-BSlqkxnH.js +74 -0
- package/dist/PhSealCheck-BSlqkxnH.js.map +1 -0
- package/dist/PhSignOut-CEXxlRk3.js +74 -0
- package/dist/PhSignOut-CEXxlRk3.js.map +1 -0
- package/dist/PhSpinner-Do1pY8fG.js +74 -0
- package/dist/PhSpinner-Do1pY8fG.js.map +1 -0
- package/dist/PhTrash-JNKavmpg.js +74 -0
- package/dist/PhTrash-JNKavmpg.js.map +1 -0
- package/dist/PhUser-BW7E-xYg.js +74 -0
- package/dist/PhUser-BW7E-xYg.js.map +1 -0
- package/dist/PhVault-mzxUgBYN.js +74 -0
- package/dist/PhVault-mzxUgBYN.js.map +1 -0
- package/dist/PhWallet-BR9JThKU.js +74 -0
- package/dist/PhWallet-BR9JThKU.js.map +1 -0
- package/dist/PhWarning-DxuQ70WM.js +74 -0
- package/dist/PhWarning-DxuQ70WM.js.map +1 -0
- package/dist/PhWarningCircle-DCI0JC1F.js +74 -0
- package/dist/PhWarningCircle-DCI0JC1F.js.map +1 -0
- package/dist/PhX-CWNXqpGn.js +74 -0
- package/dist/PhX-CWNXqpGn.js.map +1 -0
- package/dist/SwapController-jMZttK6h.js +684 -0
- package/dist/SwapController-jMZttK6h.js.map +1 -0
- package/dist/WebCryptoP256-BBztc0iu.js +3299 -0
- package/dist/WebCryptoP256-BBztc0iu.js.map +1 -0
- package/dist/add--c4dzQ5a.js +20 -0
- package/dist/add--c4dzQ5a.js.map +1 -0
- package/dist/all-wallets-qDP3dIqp.js +11 -0
- package/dist/all-wallets-qDP3dIqp.js.map +1 -0
- package/dist/app-store-D9l7eF2W.js +22 -0
- package/dist/app-store-D9l7eF2W.js.map +1 -0
- package/dist/appkit-BelUXm_6.js +117838 -0
- package/dist/appkit-BelUXm_6.js.map +1 -0
- package/dist/appkit.js +11 -0
- package/dist/appkit.js.map +1 -0
- package/dist/apple-CpoWHbAl.js +23 -0
- package/dist/apple-CpoWHbAl.js.map +1 -0
- package/dist/arrow-bottom-Duw4wyrB.js +13 -0
- package/dist/arrow-bottom-Duw4wyrB.js.map +1 -0
- package/dist/arrow-bottom-circle-jzrzTJTi.js +16 -0
- package/dist/arrow-bottom-circle-jzrzTJTi.js.map +1 -0
- package/dist/arrow-left-DZ8261mb.js +13 -0
- package/dist/arrow-left-DZ8261mb.js.map +1 -0
- package/dist/arrow-right-BkSWH-o2.js +13 -0
- package/dist/arrow-right-BkSWH-o2.js.map +1 -0
- package/dist/arrow-top-CZ-VhKD6.js +13 -0
- package/dist/arrow-top-CZ-VhKD6.js.map +1 -0
- package/dist/async-directive-DxJWJE9R.js +73 -0
- package/dist/async-directive-DxJWJE9R.js.map +1 -0
- package/dist/bank-Dqp8PTLk.js +19 -0
- package/dist/bank-Dqp8PTLk.js.map +1 -0
- package/dist/basic-DFEi41zA.js +4914 -0
- package/dist/basic-DFEi41zA.js.map +1 -0
- package/dist/browser-5XoTmr4n.js +1991 -0
- package/dist/browser-5XoTmr4n.js.map +1 -0
- package/dist/browser-BPO6XEtY.js +19 -0
- package/dist/browser-BPO6XEtY.js.map +1 -0
- package/dist/card-V3yaUpoc.js +19 -0
- package/dist/card-V3yaUpoc.js.map +1 -0
- package/dist/ccip-BoFoMwtu.js +164 -0
- package/dist/ccip-BoFoMwtu.js.map +1 -0
- package/dist/checkmark-DSiyB22o.js +16 -0
- package/dist/checkmark-DSiyB22o.js.map +1 -0
- package/dist/checkmark-bold-Bv7-ZO8v.js +13 -0
- package/dist/checkmark-bold-Bv7-ZO8v.js.map +1 -0
- package/dist/chevron-bottom-B2TGsNMu.js +13 -0
- package/dist/chevron-bottom-B2TGsNMu.js.map +1 -0
- package/dist/chevron-left-Cwx-XOsq.js +13 -0
- package/dist/chevron-left-Cwx-XOsq.js.map +1 -0
- package/dist/chevron-right-BGnzEWju.js +13 -0
- package/dist/chevron-right-BGnzEWju.js.map +1 -0
- package/dist/chevron-top-C-e2sCE8.js +13 -0
- package/dist/chevron-top-C-e2sCE8.js.map +1 -0
- package/dist/chrome-store-Dk-JjvFO.js +66 -0
- package/dist/chrome-store-Dk-JjvFO.js.map +1 -0
- package/dist/class-map-ZEs4CrSH.js +101 -0
- package/dist/class-map-ZEs4CrSH.js.map +1 -0
- package/dist/clock-DqVZkTjt.js +13 -0
- package/dist/clock-DqVZkTjt.js.map +1 -0
- package/dist/close-iWBWiaHR.js +13 -0
- package/dist/close-iWBWiaHR.js.map +1 -0
- package/dist/clsx.m-D57qXwfE.js +21 -0
- package/dist/clsx.m-D57qXwfE.js.map +1 -0
- package/dist/coinPlaceholder-DamDZh25.js +13 -0
- package/dist/coinPlaceholder-DamDZh25.js.map +1 -0
- package/dist/compass-DK4o4OBL.js +13 -0
- package/dist/compass-DK4o4OBL.js.map +1 -0
- package/dist/copy-eQpimOO_.js +20 -0
- package/dist/copy-eQpimOO_.js.map +1 -0
- package/dist/core-Blm5BnNJ.js +16288 -0
- package/dist/core-Blm5BnNJ.js.map +1 -0
- package/dist/cursor-k5vr3_IY.js +8 -0
- package/dist/cursor-k5vr3_IY.js.map +1 -0
- package/dist/cursor-transparent-C72dSWkl.js +17 -0
- package/dist/cursor-transparent-C72dSWkl.js.map +1 -0
- package/dist/data-capture-BYDXaTJ7.js +549 -0
- package/dist/data-capture-BYDXaTJ7.js.map +1 -0
- package/dist/desktop-BKt6U1LK.js +14 -0
- package/dist/desktop-BKt6U1LK.js.map +1 -0
- package/dist/disconnect-BN2JhgmS.js +13 -0
- package/dist/disconnect-BN2JhgmS.js.map +1 -0
- package/dist/discord-BPXpxniL.js +22 -0
- package/dist/discord-BPXpxniL.js.map +1 -0
- package/dist/email-CNuZeI4u.js +421 -0
- package/dist/email-CNuZeI4u.js.map +1 -0
- package/dist/embedded-wallet-LWvrPF_o.js +952 -0
- package/dist/embedded-wallet-LWvrPF_o.js.map +1 -0
- package/dist/etherscan-DDKRPzA-.js +11 -0
- package/dist/etherscan-DDKRPzA-.js.map +1 -0
- package/dist/exclamation-triangle-D-8fgdY1.js +9 -0
- package/dist/exclamation-triangle-D-8fgdY1.js.map +1 -0
- package/dist/extension-Dxcr6kcX.js +13 -0
- package/dist/extension-Dxcr6kcX.js.map +1 -0
- package/dist/external-link-CAGwU0J9.js +13 -0
- package/dist/external-link-CAGwU0J9.js.map +1 -0
- package/dist/facebook-CLDxOaIb.js +31 -0
- package/dist/facebook-CLDxOaIb.js.map +1 -0
- package/dist/farcaster-Cw3u-UPo.js +17 -0
- package/dist/farcaster-Cw3u-UPo.js.map +1 -0
- package/dist/features-vg2POspn.js +319 -0
- package/dist/features-vg2POspn.js.map +1 -0
- package/dist/filters-COA9syz-.js +13 -0
- package/dist/filters-COA9syz-.js.map +1 -0
- package/dist/github-D7S2v9I4.js +23 -0
- package/dist/github-D7S2v9I4.js.map +1 -0
- package/dist/google-D0CqK5v9.js +23 -0
- package/dist/google-D0CqK5v9.js.map +1 -0
- package/dist/hashTypedData-CSpZpAVZ.js +262 -0
- package/dist/hashTypedData-CSpZpAVZ.js.map +1 -0
- package/dist/help-circle-DUNo_nkC.js +17 -0
- package/dist/help-circle-DUNo_nkC.js.map +1 -0
- package/dist/id-I68XskJD.js +17 -0
- package/dist/id-I68XskJD.js.map +1 -0
- package/dist/if-defined-CZFxJBnA.js +11 -0
- package/dist/if-defined-CZFxJBnA.js.map +1 -0
- package/dist/image-B5cNqRyN.js +9 -0
- package/dist/image-B5cNqRyN.js.map +1 -0
- package/dist/index-104DdYHO.js +985 -0
- package/dist/index-104DdYHO.js.map +1 -0
- package/dist/index-B3zs1e7u.js +181 -0
- package/dist/index-B3zs1e7u.js.map +1 -0
- package/dist/index-B5NSdMiU.js +218 -0
- package/dist/index-B5NSdMiU.js.map +1 -0
- package/dist/index-B6iHFF4h.js +136 -0
- package/dist/index-B6iHFF4h.js.map +1 -0
- package/dist/index-B8jsF--g.js +1582 -0
- package/dist/index-B8jsF--g.js.map +1 -0
- package/dist/index-BB3tQw2Z.js +9350 -0
- package/dist/index-BB3tQw2Z.js.map +1 -0
- package/dist/index-BKk3ruzQ.js +456 -0
- package/dist/index-BKk3ruzQ.js.map +1 -0
- package/dist/index-BLjdKVPF.js +18322 -0
- package/dist/index-BLjdKVPF.js.map +1 -0
- package/dist/index-BOoc_x7l.js +180 -0
- package/dist/index-BOoc_x7l.js.map +1 -0
- package/dist/index-BeheLXdB.js +441 -0
- package/dist/index-BeheLXdB.js.map +1 -0
- package/dist/index-BgqBk_dY.js +147 -0
- package/dist/index-BgqBk_dY.js.map +1 -0
- package/dist/index-Bnorl9_z.js +1372 -0
- package/dist/index-Bnorl9_z.js.map +1 -0
- package/dist/index-C26sVife.js +967 -0
- package/dist/index-C26sVife.js.map +1 -0
- package/dist/index-C32JOlST.js +198 -0
- package/dist/index-C32JOlST.js.map +1 -0
- package/dist/index-C78ZsEMq.js +211 -0
- package/dist/index-C78ZsEMq.js.map +1 -0
- package/dist/index-C8oew4P6.js +153 -0
- package/dist/index-C8oew4P6.js.map +1 -0
- package/dist/index-CNlrW5cy.js +126 -0
- package/dist/index-CNlrW5cy.js.map +1 -0
- package/dist/index-CWtAW9yD.js +70 -0
- package/dist/index-CWtAW9yD.js.map +1 -0
- package/dist/index-CZYTg7wq.js +7258 -0
- package/dist/index-CZYTg7wq.js.map +1 -0
- package/dist/index-CcLQYms1.js +109 -0
- package/dist/index-CcLQYms1.js.map +1 -0
- package/dist/index-Cmdv-EKc.js +3987 -0
- package/dist/index-Cmdv-EKc.js.map +1 -0
- package/dist/index-D0jIxjP5.js +611 -0
- package/dist/index-D0jIxjP5.js.map +1 -0
- package/dist/index-D1RMkx4Z.js +73 -0
- package/dist/index-D1RMkx4Z.js.map +1 -0
- package/dist/index-D80ztMVu.js +7481 -0
- package/dist/index-D80ztMVu.js.map +1 -0
- package/dist/index-D9I51xNN.js +124 -0
- package/dist/index-D9I51xNN.js.map +1 -0
- package/dist/index-DC3uHGx5.js +281 -0
- package/dist/index-DC3uHGx5.js.map +1 -0
- package/dist/index-DKaSbFmS.js +62 -0
- package/dist/index-DKaSbFmS.js.map +1 -0
- package/dist/index-DMfKX7xa.js +52 -0
- package/dist/index-DMfKX7xa.js.map +1 -0
- package/dist/index-DRONCFaf.js +521 -0
- package/dist/index-DRONCFaf.js.map +1 -0
- package/dist/index-DWU2cJP9.js +984 -0
- package/dist/index-DWU2cJP9.js.map +1 -0
- package/dist/index-Dk1HiwFn.js +110 -0
- package/dist/index-Dk1HiwFn.js.map +1 -0
- package/dist/index-DoDZtBzt.js +257 -0
- package/dist/index-DoDZtBzt.js.map +1 -0
- package/dist/index-DrMicDEk.js +8825 -0
- package/dist/index-DrMicDEk.js.map +1 -0
- package/dist/index-DwCIGVjJ.js +2277 -0
- package/dist/index-DwCIGVjJ.js.map +1 -0
- package/dist/index-G39WAG_u.js +249 -0
- package/dist/index-G39WAG_u.js.map +1 -0
- package/dist/index-LKmHdTip.js +120 -0
- package/dist/index-LKmHdTip.js.map +1 -0
- package/dist/index-Q4ByiA8h.js +92 -0
- package/dist/index-Q4ByiA8h.js.map +1 -0
- package/dist/index-WWBlLBf0.js +286 -0
- package/dist/index-WWBlLBf0.js.map +1 -0
- package/dist/index-YriocA8k.js +542 -0
- package/dist/index-YriocA8k.js.map +1 -0
- package/dist/index-iZY344lJ.js +131 -0
- package/dist/index-iZY344lJ.js.map +1 -0
- package/dist/index-jvpHgQNC.js +1178 -0
- package/dist/index-jvpHgQNC.js.map +1 -0
- package/dist/index-l79JdXA-.js +198 -0
- package/dist/index-l79JdXA-.js.map +1 -0
- package/dist/index-ln8WeuTF.js +520 -0
- package/dist/index-ln8WeuTF.js.map +1 -0
- package/dist/index-qKPbj0fN.js +147 -0
- package/dist/index-qKPbj0fN.js.map +1 -0
- package/dist/index-vbfIJzga.js +182 -0
- package/dist/index-vbfIJzga.js.map +1 -0
- package/dist/index-ydt0zLSU.js +716 -0
- package/dist/index-ydt0zLSU.js.map +1 -0
- package/dist/index.es-DRqDW831.js +8503 -0
- package/dist/index.es-DRqDW831.js.map +1 -0
- package/dist/info-2WDwQZjB.js +8 -0
- package/dist/info-2WDwQZjB.js.map +1 -0
- package/dist/info-circle-CtSQ1Thr.js +17 -0
- package/dist/info-circle-CtSQ1Thr.js.map +1 -0
- package/dist/jsxRuntime.module-xbg0Y-2w.js +14 -0
- package/dist/jsxRuntime.module-xbg0Y-2w.js.map +1 -0
- package/dist/lightbulb-BSt44yHY.js +8 -0
- package/dist/lightbulb-BSt44yHY.js.map +1 -0
- package/dist/localBatchGatewayRequest-BfhYO3yz.js +103 -0
- package/dist/localBatchGatewayRequest-BfhYO3yz.js.map +1 -0
- package/dist/mail-BrPzu8JI.js +13 -0
- package/dist/mail-BrPzu8JI.js.map +1 -0
- package/dist/metamask-sdk-BH2upH2a.js +16699 -0
- package/dist/metamask-sdk-BH2upH2a.js.map +1 -0
- package/dist/mobile-qOQzY1mQ.js +14 -0
- package/dist/mobile-qOQzY1mQ.js.map +1 -0
- package/dist/more-Q55BhoHR.js +16 -0
- package/dist/more-Q55BhoHR.js.map +1 -0
- package/dist/native-NhO1oTAz.js +17 -0
- package/dist/native-NhO1oTAz.js.map +1 -0
- package/dist/network-placeholder-CNNFAqAN.js +19 -0
- package/dist/network-placeholder-CNNFAqAN.js.map +1 -0
- package/dist/nftPlaceholder-XepUac1F.js +13 -0
- package/dist/nftPlaceholder-XepUac1F.js.map +1 -0
- package/dist/off-B5pFs_h0.js +13 -0
- package/dist/off-B5pFs_h0.js.map +1 -0
- package/dist/onramp-Cmf4-Qlj.js +979 -0
- package/dist/onramp-Cmf4-Qlj.js.map +1 -0
- package/dist/parseAbiParameters-DfJcIE_w.js +757 -0
- package/dist/parseAbiParameters-DfJcIE_w.js.map +1 -0
- package/dist/parseSignature-DLIuU8h-.js +4690 -0
- package/dist/parseSignature-DLIuU8h-.js.map +1 -0
- package/dist/pay-with-exchange-BiRfWQtt.js +603 -0
- package/dist/pay-with-exchange-BiRfWQtt.js.map +1 -0
- package/dist/play-store-CHMgTh6o.js +37 -0
- package/dist/play-store-CHMgTh6o.js.map +1 -0
- package/dist/plus-DAYpNXcX.js +18 -0
- package/dist/plus-DAYpNXcX.js.map +1 -0
- package/dist/property-8UcTqffH.js +623 -0
- package/dist/property-8UcTqffH.js.map +1 -0
- package/dist/qr-code-5EvgAs5C.js +11 -0
- package/dist/qr-code-5EvgAs5C.js.map +1 -0
- package/dist/receive-oh6JkMzT.js +262 -0
- package/dist/receive-oh6JkMzT.js.map +1 -0
- package/dist/recycle-horizontal-C0EVYvdu.js +14 -0
- package/dist/recycle-horizontal-C0EVYvdu.js.map +1 -0
- package/dist/ref-DYqCwuKj.js +43 -0
- package/dist/ref-DYqCwuKj.js.map +1 -0
- package/dist/refresh-Tz7Hx6xG.js +13 -0
- package/dist/refresh-Tz7Hx6xG.js.map +1 -0
- package/dist/reown-logo-DKFEGfm5.js +17 -0
- package/dist/reown-logo-DKFEGfm5.js.map +1 -0
- package/dist/search-DJmD5Dmk.js +13 -0
- package/dist/search-DJmD5Dmk.js.map +1 -0
- package/dist/secp256k1-ZaBTFi_B.js +2031 -0
- package/dist/secp256k1-ZaBTFi_B.js.map +1 -0
- package/dist/send-CkjE5TE2.js +1365 -0
- package/dist/send-CkjE5TE2.js.map +1 -0
- package/dist/send-DcwwYxtP.js +20 -0
- package/dist/send-DcwwYxtP.js.map +1 -0
- package/dist/socials-TnAlgPAE.js +796 -0
- package/dist/socials-TnAlgPAE.js.map +1 -0
- package/dist/swapHorizontal-Zswl5rJe.js +13 -0
- package/dist/swapHorizontal-Zswl5rJe.js.map +1 -0
- package/dist/swapHorizontalBold-NXydKsqQ.js +13 -0
- package/dist/swapHorizontalBold-NXydKsqQ.js.map +1 -0
- package/dist/swapHorizontalMedium-HEMBHJa5.js +21 -0
- package/dist/swapHorizontalMedium-HEMBHJa5.js.map +1 -0
- package/dist/swapHorizontalRoundedBold-fNHd25RU.js +13 -0
- package/dist/swapHorizontalRoundedBold-fNHd25RU.js.map +1 -0
- package/dist/swapVertical-BcCPonRa.js +13 -0
- package/dist/swapVertical-BcCPonRa.js.map +1 -0
- package/dist/swaps-Cz2XSX5K.js +2121 -0
- package/dist/swaps-Cz2XSX5K.js.map +1 -0
- package/dist/telegram-CRGTc0Vs.js +21 -0
- package/dist/telegram-CRGTc0Vs.js.map +1 -0
- package/dist/three-dots-CprpVKTn.js +10 -0
- package/dist/three-dots-CprpVKTn.js.map +1 -0
- package/dist/transactions-ItRrEBwI.js +38 -0
- package/dist/transactions-ItRrEBwI.js.map +1 -0
- package/dist/twitch-vWuHTtgh.js +23 -0
- package/dist/twitch-vWuHTtgh.js.map +1 -0
- package/dist/twitterIcon-Bo4HL4oD.js +11 -0
- package/dist/twitterIcon-Bo4HL4oD.js.map +1 -0
- package/dist/vanilla-CgG5xMJO.js +448 -0
- package/dist/vanilla-CgG5xMJO.js.map +1 -0
- package/dist/verify-PpZz6LN4.js +13 -0
- package/dist/verify-PpZz6LN4.js.map +1 -0
- package/dist/verify-filled-CUpk2g5N.js +13 -0
- package/dist/verify-filled-CUpk2g5N.js.map +1 -0
- package/dist/w3m-modal-BZQIOBsI.js +1725 -0
- package/dist/w3m-modal-BZQIOBsI.js.map +1 -0
- package/dist/w3m-modal-D5sYObzl.js +2008 -0
- package/dist/w3m-modal-D5sYObzl.js.map +1 -0
- package/dist/wallet-Blc0Swur.js +13 -0
- package/dist/wallet-Blc0Swur.js.map +1 -0
- package/dist/wallet-placeholder-DkGnPkjp.js +19 -0
- package/dist/wallet-placeholder-DkGnPkjp.js.map +1 -0
- package/dist/wallet-standard-CDzUhZ2i.js +523 -0
- package/dist/wallet-standard-CDzUhZ2i.js.map +1 -0
- package/dist/walletconnect-CfJMuRWG.js +39 -0
- package/dist/walletconnect-CfJMuRWG.js.map +1 -0
- package/dist/warning-circle-BW2kbw7R.js +17 -0
- package/dist/warning-circle-BW2kbw7R.js.map +1 -0
- package/dist/x-CT_VClTi.js +17 -0
- package/dist/x-CT_VClTi.js.map +1 -0
- package/package.json +10 -10
|
@@ -0,0 +1,3987 @@
|
|
|
1
|
+
import { c as createStore, p as persist, a as createJSONStorage } from "./vanilla-CgG5xMJO.js";
|
|
2
|
+
import { B, _, h, y, T, c as createStore$1, s as set, d as del, g as get$1 } from "./index-BeheLXdB.js";
|
|
3
|
+
import { u } from "./jsxRuntime.module-xbg0Y-2w.js";
|
|
4
|
+
import { c as clsx } from "./clsx.m-D57qXwfE.js";
|
|
5
|
+
import { ch as EventEmitter, ci as defineChain, cj as createPublicClient, ck as http, cl as isAddress, cm as isHex, b3 as hashTypedData, b2 as hashMessage, bN as numberToHex, cn as slice$1, bP as keccak256, co as toHex$2, c1 as hexToBigInt, cp as waitForCallsStatus, cq as stringToBytes, cr as hexToBytes, cs as trim, b1 as encodeFunctionData, ct as decodeFunctionData, bW as BaseError, cu as size, cv as parseSignature, cw as encodePacked, bO as encodeAbiParameters, cx as stringToHex, cy as hexToString, bT as getCode, bU as readContract, bM as pad, cz as decodeAbiParameters, cA as erc20Abi, cB as hexToNumber, cC as isAddressEqual } from "./appkit-BelUXm_6.js";
|
|
6
|
+
import { c as createBundlerClient, s as slice, t as toHex, g as getSignPayload, a as sign$1, b as toHex$1, d as createKeyPair, f as fromHex, e as toSmartAccount, h as entryPoint06Address, i as entryPoint06Abi, j as getUserOperationHash } from "./WebCryptoP256-BBztc0iu.js";
|
|
7
|
+
const name = "@base-org/account";
|
|
8
|
+
const version = "1.1.1";
|
|
9
|
+
const pkg = {
|
|
10
|
+
name,
|
|
11
|
+
version
|
|
12
|
+
};
|
|
13
|
+
const CB_KEYS_URL = "https://keys.coinbase.com/connect";
|
|
14
|
+
const CB_WALLET_RPC_URL = "https://rpc.wallet.coinbase.com";
|
|
15
|
+
const PACKAGE_NAME = pkg.name;
|
|
16
|
+
const PACKAGE_VERSION = pkg.version;
|
|
17
|
+
const createChainSlice = () => {
|
|
18
|
+
return {
|
|
19
|
+
chains: []
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
const createKeysSlice = () => {
|
|
23
|
+
return {
|
|
24
|
+
keys: {}
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
const createAccountSlice = () => {
|
|
28
|
+
return {
|
|
29
|
+
account: {}
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
const createSubAccountSlice = () => {
|
|
33
|
+
return {
|
|
34
|
+
subAccount: void 0
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
const createSubAccountConfigSlice = () => {
|
|
38
|
+
return {
|
|
39
|
+
subAccountConfig: {}
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
const createSpendPermissionsSlice = () => {
|
|
43
|
+
return {
|
|
44
|
+
spendPermissions: []
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
const createConfigSlice = () => {
|
|
48
|
+
return {
|
|
49
|
+
config: {
|
|
50
|
+
version: PACKAGE_VERSION
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
const sdkstore = createStore(persist((...args) => Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, createChainSlice(...args)), createKeysSlice(...args)), createAccountSlice(...args)), createSubAccountSlice(...args)), createSpendPermissionsSlice(...args)), createConfigSlice(...args)), createSubAccountConfigSlice(...args)), {
|
|
55
|
+
name: "base-acc-sdk.store",
|
|
56
|
+
storage: createJSONStorage(() => localStorage),
|
|
57
|
+
partialize: (state) => {
|
|
58
|
+
return {
|
|
59
|
+
chains: state.chains,
|
|
60
|
+
keys: state.keys,
|
|
61
|
+
account: state.account,
|
|
62
|
+
subAccount: state.subAccount,
|
|
63
|
+
spendPermissions: state.spendPermissions,
|
|
64
|
+
config: state.config
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
}));
|
|
68
|
+
const subAccountsConfig = {
|
|
69
|
+
get: () => sdkstore.getState().subAccountConfig,
|
|
70
|
+
set: (subAccountConfig) => {
|
|
71
|
+
sdkstore.setState((state) => ({
|
|
72
|
+
subAccountConfig: Object.assign(Object.assign({}, state.subAccountConfig), subAccountConfig)
|
|
73
|
+
}));
|
|
74
|
+
},
|
|
75
|
+
clear: () => {
|
|
76
|
+
sdkstore.setState({
|
|
77
|
+
subAccountConfig: {}
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
const subAccounts = {
|
|
82
|
+
get: () => sdkstore.getState().subAccount,
|
|
83
|
+
set: (subAccount) => {
|
|
84
|
+
sdkstore.setState((state) => ({
|
|
85
|
+
subAccount: state.subAccount ? Object.assign(Object.assign({}, state.subAccount), subAccount) : Object.assign({ address: subAccount.address }, subAccount)
|
|
86
|
+
}));
|
|
87
|
+
},
|
|
88
|
+
clear: () => {
|
|
89
|
+
sdkstore.setState({
|
|
90
|
+
subAccount: void 0
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
const spendPermissions = {
|
|
95
|
+
get: () => sdkstore.getState().spendPermissions,
|
|
96
|
+
set: (spendPermissions2) => {
|
|
97
|
+
sdkstore.setState({ spendPermissions: spendPermissions2 });
|
|
98
|
+
},
|
|
99
|
+
clear: () => {
|
|
100
|
+
sdkstore.setState({
|
|
101
|
+
spendPermissions: []
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
const account = {
|
|
106
|
+
get: () => sdkstore.getState().account,
|
|
107
|
+
set: (account2) => {
|
|
108
|
+
sdkstore.setState((state) => ({
|
|
109
|
+
account: Object.assign(Object.assign({}, state.account), account2)
|
|
110
|
+
}));
|
|
111
|
+
},
|
|
112
|
+
clear: () => {
|
|
113
|
+
sdkstore.setState({
|
|
114
|
+
account: {}
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
const chains = {
|
|
119
|
+
get: () => sdkstore.getState().chains,
|
|
120
|
+
set: (chains2) => {
|
|
121
|
+
sdkstore.setState({ chains: chains2 });
|
|
122
|
+
},
|
|
123
|
+
clear: () => {
|
|
124
|
+
sdkstore.setState({
|
|
125
|
+
chains: []
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
const keys = {
|
|
130
|
+
get: (key) => sdkstore.getState().keys[key],
|
|
131
|
+
set: (key, value) => {
|
|
132
|
+
sdkstore.setState((state) => ({ keys: Object.assign(Object.assign({}, state.keys), { [key]: value }) }));
|
|
133
|
+
},
|
|
134
|
+
clear: () => {
|
|
135
|
+
sdkstore.setState({
|
|
136
|
+
keys: {}
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
const config = {
|
|
141
|
+
get: () => sdkstore.getState().config,
|
|
142
|
+
set: (config2) => {
|
|
143
|
+
sdkstore.setState((state) => ({ config: Object.assign(Object.assign({}, state.config), config2) }));
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
const actions = {
|
|
147
|
+
subAccounts,
|
|
148
|
+
subAccountsConfig,
|
|
149
|
+
spendPermissions,
|
|
150
|
+
account,
|
|
151
|
+
chains,
|
|
152
|
+
keys,
|
|
153
|
+
config
|
|
154
|
+
};
|
|
155
|
+
const store = Object.assign(Object.assign({}, sdkstore), actions);
|
|
156
|
+
const TELEMETRY_SCRIPT_CONTENT = `!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ClientAnalytics=t():e.ClientAnalytics=t()}(this,(function(){return(()=>{var e={792:e=>{var t={utf8:{stringToBytes:function(e){return t.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(t.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));return t},bytesToString:function(e){for(var t=[],n=0;n<e.length;n++)t.push(String.fromCharCode(e[n]));return t.join("")}}};e.exports=t},562:e=>{var t,n;t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(e,t){return e<<t|e>>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&n.rotl(e,8)|4278255360&n.rotl(e,24);for(var t=0;t<e.length;t++)e[t]=n.endian(e[t]);return e},randomBytes:function(e){for(var t=[];e>0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],n=0,r=0;n<e.length;n++,r+=8)t[r>>>5]|=e[n]<<24-r%32;return t},wordsToBytes:function(e){for(var t=[],n=0;n<32*e.length;n+=8)t.push(e[n>>>5]>>>24-n%32&255);return t},bytesToHex:function(e){for(var t=[],n=0;n<e.length;n++)t.push((e[n]>>>4).toString(16)),t.push((15&e[n]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],n=0;n<e.length;n+=2)t.push(parseInt(e.substr(n,2),16));return t},bytesToBase64:function(e){for(var n=[],r=0;r<e.length;r+=3)for(var i=e[r]<<16|e[r+1]<<8|e[r+2],a=0;a<4;a++)8*r+6*a<=8*e.length?n.push(t.charAt(i>>>6*(3-a)&63)):n.push("=");return n.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\\/]/gi,"");for(var n=[],r=0,i=0;r<e.length;i=++r%4)0!=i&&n.push((t.indexOf(e.charAt(r-1))&Math.pow(2,-2*i+8)-1)<<2*i|t.indexOf(e.charAt(r))>>>6-2*i);return n}},e.exports=n},335:e=>{function t(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}e.exports=function(e){return null!=e&&(t(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&t(e.slice(0,0))}(e)||!!e._isBuffer)}},762:(e,t,n)=>{var r,i,a,o,s;r=n(562),i=n(792).utf8,a=n(335),o=n(792).bin,(s=function(e,t){e.constructor==String?e=t&&"binary"===t.encoding?o.stringToBytes(e):i.stringToBytes(e):a(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||e.constructor===Uint8Array||(e=e.toString());for(var n=r.bytesToWords(e),c=8*e.length,u=1732584193,l=-271733879,d=-1732584194,p=271733878,m=0;m<n.length;m++)n[m]=16711935&(n[m]<<8|n[m]>>>24)|4278255360&(n[m]<<24|n[m]>>>8);n[c>>>5]|=128<<c%32,n[14+(c+64>>>9<<4)]=c;var f=s._ff,v=s._gg,g=s._hh,b=s._ii;for(m=0;m<n.length;m+=16){var h=u,w=l,y=d,T=p;u=f(u,l,d,p,n[m+0],7,-680876936),p=f(p,u,l,d,n[m+1],12,-389564586),d=f(d,p,u,l,n[m+2],17,606105819),l=f(l,d,p,u,n[m+3],22,-1044525330),u=f(u,l,d,p,n[m+4],7,-176418897),p=f(p,u,l,d,n[m+5],12,1200080426),d=f(d,p,u,l,n[m+6],17,-1473231341),l=f(l,d,p,u,n[m+7],22,-45705983),u=f(u,l,d,p,n[m+8],7,1770035416),p=f(p,u,l,d,n[m+9],12,-1958414417),d=f(d,p,u,l,n[m+10],17,-42063),l=f(l,d,p,u,n[m+11],22,-1990404162),u=f(u,l,d,p,n[m+12],7,1804603682),p=f(p,u,l,d,n[m+13],12,-40341101),d=f(d,p,u,l,n[m+14],17,-1502002290),u=v(u,l=f(l,d,p,u,n[m+15],22,1236535329),d,p,n[m+1],5,-165796510),p=v(p,u,l,d,n[m+6],9,-1069501632),d=v(d,p,u,l,n[m+11],14,643717713),l=v(l,d,p,u,n[m+0],20,-373897302),u=v(u,l,d,p,n[m+5],5,-701558691),p=v(p,u,l,d,n[m+10],9,38016083),d=v(d,p,u,l,n[m+15],14,-660478335),l=v(l,d,p,u,n[m+4],20,-405537848),u=v(u,l,d,p,n[m+9],5,568446438),p=v(p,u,l,d,n[m+14],9,-1019803690),d=v(d,p,u,l,n[m+3],14,-187363961),l=v(l,d,p,u,n[m+8],20,1163531501),u=v(u,l,d,p,n[m+13],5,-1444681467),p=v(p,u,l,d,n[m+2],9,-51403784),d=v(d,p,u,l,n[m+7],14,1735328473),u=g(u,l=v(l,d,p,u,n[m+12],20,-1926607734),d,p,n[m+5],4,-378558),p=g(p,u,l,d,n[m+8],11,-2022574463),d=g(d,p,u,l,n[m+11],16,1839030562),l=g(l,d,p,u,n[m+14],23,-35309556),u=g(u,l,d,p,n[m+1],4,-1530992060),p=g(p,u,l,d,n[m+4],11,1272893353),d=g(d,p,u,l,n[m+7],16,-155497632),l=g(l,d,p,u,n[m+10],23,-1094730640),u=g(u,l,d,p,n[m+13],4,681279174),p=g(p,u,l,d,n[m+0],11,-358537222),d=g(d,p,u,l,n[m+3],16,-722521979),l=g(l,d,p,u,n[m+6],23,76029189),u=g(u,l,d,p,n[m+9],4,-640364487),p=g(p,u,l,d,n[m+12],11,-421815835),d=g(d,p,u,l,n[m+15],16,530742520),u=b(u,l=g(l,d,p,u,n[m+2],23,-995338651),d,p,n[m+0],6,-198630844),p=b(p,u,l,d,n[m+7],10,1126891415),d=b(d,p,u,l,n[m+14],15,-1416354905),l=b(l,d,p,u,n[m+5],21,-57434055),u=b(u,l,d,p,n[m+12],6,1700485571),p=b(p,u,l,d,n[m+3],10,-1894986606),d=b(d,p,u,l,n[m+10],15,-1051523),l=b(l,d,p,u,n[m+1],21,-2054922799),u=b(u,l,d,p,n[m+8],6,1873313359),p=b(p,u,l,d,n[m+15],10,-30611744),d=b(d,p,u,l,n[m+6],15,-1560198380),l=b(l,d,p,u,n[m+13],21,1309151649),u=b(u,l,d,p,n[m+4],6,-145523070),p=b(p,u,l,d,n[m+11],10,-1120210379),d=b(d,p,u,l,n[m+2],15,718787259),l=b(l,d,p,u,n[m+9],21,-343485551),u=u+h>>>0,l=l+w>>>0,d=d+y>>>0,p=p+T>>>0}return r.endian([u,l,d,p])})._ff=function(e,t,n,r,i,a,o){var s=e+(t&n|~t&r)+(i>>>0)+o;return(s<<a|s>>>32-a)+t},s._gg=function(e,t,n,r,i,a,o){var s=e+(t&r|n&~r)+(i>>>0)+o;return(s<<a|s>>>32-a)+t},s._hh=function(e,t,n,r,i,a,o){var s=e+(t^n^r)+(i>>>0)+o;return(s<<a|s>>>32-a)+t},s._ii=function(e,t,n,r,i,a,o){var s=e+(n^(t|~r))+(i>>>0)+o;return(s<<a|s>>>32-a)+t},s._blocksize=16,s._digestsize=16,e.exports=function(e,t){if(null==e)throw new Error("Illegal argument "+e);var n=r.wordsToBytes(s(e,t));return t&&t.asBytes?n:t&&t.asString?o.bytesToString(n):r.bytesToHex(n)}},2:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Perfume:()=>ze,incrementUjNavigation:()=>Le,markStep:()=>Re,markStepOnce:()=>qe});var r,i,a={isResourceTiming:!1,isElementTiming:!1,maxTime:3e4,reportOptions:{},enableNavigationTracking:!0},o=window,s=o.console,c=o.navigator,u=o.performance,l=function(){return c.deviceMemory},d=function(){return c.hardwareConcurrency},p="mark.",m=function(){return u&&!!u.getEntriesByType&&!!u.now&&!!u.mark},f="4g",v=!1,g={},b={value:0},h={value:{beacon:0,css:0,fetch:0,img:0,other:0,script:0,total:0,xmlhttprequest:0}},w={value:0},y={value:0},T={},k={isHidden:!1,didChange:!1},_=function(){k.isHidden=!1,document.hidden&&(k.isHidden=document.hidden,k.didChange=!0)},S=function(e,t){try{var n=new PerformanceObserver((function(e){t(e.getEntries())}));return n.observe({type:e,buffered:!0}),n}catch(e){s.warn("Perfume.js:",e)}return null},E=function(){return!!(d()&&d()<=4)||!!(l()&&l()<=4)},x=function(e,t){switch(e){case"slow-2g":case"2g":case"3g":return!0;default:return E()||t}},O=function(e){return parseFloat(e.toFixed(4))},j=function(e){return"number"!=typeof e?null:O(e/Math.pow(1024,2))},N=function(e,t,n,r,i){var s,u=function(){a.analyticsTracker&&(k.isHidden&&!["CLS","INP"].includes(e)||a.analyticsTracker({attribution:r,metricName:e,data:t,navigatorInformation:c?{deviceMemory:l()||0,hardwareConcurrency:d()||0,serviceWorkerStatus:"serviceWorker"in c?c.serviceWorker.controller?"controlled":"supported":"unsupported",isLowEndDevice:E(),isLowEndExperience:x(f,v)}:{},rating:n,navigationType:i}))};["CLS","INP"].includes(e)?u():(s=u,"requestIdleCallback"in o?o.requestIdleCallback(s,{timeout:3e3}):s())},I=function(e){e.forEach((function(e){if(!("self"!==e.name||e.startTime<b.value)){var t=e.duration-50;t>0&&(w.value+=t,y.value+=t)}}))};!function(e){e.instant="instant",e.quick="quick",e.moderate="moderate",e.slow="slow",e.unavoidable="unavoidable"}(r||(r={}));var P,M,B,C,D,A=((i={})[r.instant]={vitalsThresholds:[100,200],maxOutlierThreshold:1e4},i[r.quick]={vitalsThresholds:[200,500],maxOutlierThreshold:1e4},i[r.moderate]={vitalsThresholds:[500,1e3],maxOutlierThreshold:1e4},i[r.slow]={vitalsThresholds:[1e3,2e3],maxOutlierThreshold:1e4},i[r.unavoidable]={vitalsThresholds:[2e3,5e3],maxOutlierThreshold:2e4},i),L={RT:[100,200],TBT:[200,600],NTBT:[200,600]},U=function(e,t){return L[e]?t<=L[e][0]?"good":t<=L[e][1]?"needsImprovement":"poor":null},R=function(e,t,n){Object.keys(t).forEach((function(e){"number"==typeof t[e]&&(t[e]=O(t[e]))})),N(e,t,null,n||{})},q=function(e){var t=e.attribution,n=e.name,r=e.rating,i=e.value,o=e.navigationType;"FCP"===n&&(b.value=i),["FCP","LCP"].includes(n)&&!T[0]&&(T[0]=S("longtask",I)),"FID"===n&&setTimeout((function(){k.didChange||(q({attribution:t,name:"TBT",rating:U("TBT",w.value),value:w.value,navigationType:o}),R("dataConsumption",h.value))}),1e4);var s=O(i);s<=a.maxTime&&s>=0&&N(n,s,r,t,o)},F=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},z=function(e){if("loading"===document.readyState)return"loading";var t=F();if(t){if(e<t.domInteractive)return"loading";if(0===t.domContentLoadedEventStart||e<t.domContentLoadedEventStart)return"dom-interactive";if(0===t.domComplete||e<t.domComplete)return"dom-content-loaded"}return"complete"},K=function(e){var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},$=function(e,t){var n="";try{for(;e&&9!==e.nodeType;){var r=e,i=r.id?"#"+r.id:K(r)+(r.className&&r.className.length?"."+r.className.replace(/\\s+/g,"."):"");if(n.length+i.length>(t||100)-1)return n||i;if(n=n?i+">"+n:i,r.id)break;e=r.parentNode}}catch(e){}return n},Q=-1,W=function(){return Q},H=function(e){addEventListener("pageshow",(function(t){t.persisted&&(Q=t.timeStamp,e(t))}),!0)},V=function(){var e=F();return e&&e.activationStart||0},J=function(e,t){var n=F(),r="navigate";return W()>=0?r="back-forward-cache":n&&(r=document.prerendering||V()>0?"prerender":document.wasDiscarded?"restore":n.type.replace(/_/g,"-")),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v3-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},X=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(e){}},G=function(e,t){var n=function n(r){"pagehide"!==r.type&&"hidden"!==document.visibilityState||(e(r),t&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))};addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0)},Z=function(e,t,n,r){var i,a;return function(o){t.value>=0&&(o||r)&&((a=t.value-(i||0))||void 0===i)&&(i=t.value,t.delta=a,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},Y=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},ee=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},te=-1,ne=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},re=function(e){"hidden"===document.visibilityState&&te>-1&&(te="visibilitychange"===e.type?e.timeStamp:0,ae())},ie=function(){addEventListener("visibilitychange",re,!0),addEventListener("prerenderingchange",re,!0)},ae=function(){removeEventListener("visibilitychange",re,!0),removeEventListener("prerenderingchange",re,!0)},oe=function(){return te<0&&(te=ne(),ie(),H((function(){setTimeout((function(){te=ne(),ie()}),0)}))),{get firstHiddenTime(){return te}}},se=function(e,t){t=t||{},ee((function(){var n,r=[1800,3e3],i=oe(),a=J("FCP"),o=X("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<i.firstHiddenTime&&(a.value=Math.max(e.startTime-V(),0),a.entries.push(e),n(!0)))}))}));o&&(n=Z(e,a,r,t.reportAllChanges),H((function(i){a=J("FCP"),n=Z(e,a,r,t.reportAllChanges),Y((function(){a.value=performance.now()-i.timeStamp,n(!0)}))})))}))},ce={passive:!0,capture:!0},ue=new Date,le=function(e,t){P||(P=t,M=e,B=new Date,me(removeEventListener),de())},de=function(){if(M>=0&&M<B-ue){var e={entryType:"first-input",name:P.type,target:P.target,cancelable:P.cancelable,startTime:P.timeStamp,processingStart:P.timeStamp+M};C.forEach((function(t){t(e)})),C=[]}},pe=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){le(e,t),i()},r=function(){i()},i=function(){removeEventListener("pointerup",n,ce),removeEventListener("pointercancel",r,ce)};addEventListener("pointerup",n,ce),addEventListener("pointercancel",r,ce)}(t,e):le(t,e)}},me=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,pe,ce)}))},fe=0,ve=1/0,ge=0,be=function(e){e.forEach((function(e){e.interactionId&&(ve=Math.min(ve,e.interactionId),ge=Math.max(ge,e.interactionId),fe=ge?(ge-ve)/7+1:0)}))},he=function(){return D?fe:performance.interactionCount||0},we=0,ye=function(){return he()-we},Te=[],ke={},_e=function(e){var t=Te[Te.length-1],n=ke[e.interactionId];if(n||Te.length<10||e.duration>t.latency){if(n)n.entries.push(e),n.latency=Math.max(n.latency,e.duration);else{var r={id:e.interactionId,latency:e.duration,entries:[e]};ke[r.id]=r,Te.push(r)}Te.sort((function(e,t){return t.latency-e.latency})),Te.splice(10).forEach((function(e){delete ke[e.id]}))}},Se={},Ee=function e(t){document.prerendering?ee((function(){return e(t)})):"complete"!==document.readyState?addEventListener("load",(function(){return e(t)}),!0):setTimeout(t,0)},xe=function(e,t){t=t||{};var n=[800,1800],r=J("TTFB"),i=Z(e,r,n,t.reportAllChanges);Ee((function(){var a=F();if(a){var o=a.responseStart;if(o<=0||o>performance.now())return;r.value=Math.max(o-V(),0),r.entries=[a],i(!0),H((function(){r=J("TTFB",0),(i=Z(e,r,n,t.reportAllChanges))(!0)}))}}))},Oe=function(e){e.forEach((function(e){e.identifier&&q({attribution:{identifier:e.identifier},name:"ET",rating:null,value:e.startTime})}))},je=function(e){e.forEach((function(e){if(a.isResourceTiming&&R("resourceTiming",e),e.decodedBodySize&&e.initiatorType){var t=e.decodedBodySize/1e3;h.value[e.initiatorType]+=t,h.value.total+=t}}))},Ne=function(){!function(e,t){xe((function(e){!function(e){if(e.entries.length){var t=e.entries[0],n=t.activationStart||0,r=Math.max(t.domainLookupStart-n,0),i=Math.max(t.connectStart-n,0),a=Math.max(t.requestStart-n,0);e.attribution={waitingTime:r,dnsTime:i-r,connectionTime:a-i,requestTime:e.value-a,navigationEntry:t}}else e.attribution={waitingTime:0,dnsTime:0,connectionTime:0,requestTime:0}}(e),function(e){e.value>0&&q(e)}(e)}),t)}(0,a.reportOptions.ttfb),function(e,t){!function(e,t){t=t||{},ee((function(){var e,n=[.1,.25],r=J("CLS"),i=-1,a=0,o=[],s=function(e){i>-1&&function(e){!function(e){if(e.entries.length){var t=e.entries.reduce((function(e,t){return e&&e.value>t.value?e:t}));if(t&&t.sources&&t.sources.length){var n=(r=t.sources).find((function(e){return e.node&&1===e.node.nodeType}))||r[0];if(n)return void(e.attribution={largestShiftTarget:$(n.node),largestShiftTime:t.startTime,largestShiftValue:t.value,largestShiftSource:n,largestShiftEntry:t,loadState:z(t.startTime)})}}var r;e.attribution={}}(e),function(e){q(e)}(e)}(e)},c=function(t){t.forEach((function(t){if(!t.hadRecentInput){var n=o[0],i=o[o.length-1];a&&t.startTime-i.startTime<1e3&&t.startTime-n.startTime<5e3?(a+=t.value,o.push(t)):(a=t.value,o=[t]),a>r.value&&(r.value=a,r.entries=o,e())}}))},u=X("layout-shift",c);u&&(e=Z(s,r,n,t.reportAllChanges),se((function(t){i=t.value,r.value<0&&(r.value=0,e())})),G((function(){c(u.takeRecords()),e(!0)})),H((function(){a=0,i=-1,r=J("CLS",0),e=Z(s,r,n,t.reportAllChanges),Y((function(){return e()}))})))}))}(0,t)}(0,a.reportOptions.cls),function(e,t){se((function(e){!function(e){if(e.entries.length){var t=F(),n=e.entries[e.entries.length-1];if(t){var r=t.activationStart||0,i=Math.max(0,t.responseStart-r);return void(e.attribution={timeToFirstByte:i,firstByteToFCP:e.value-i,loadState:z(e.entries[0].startTime),navigationEntry:t,fcpEntry:n})}}e.attribution={timeToFirstByte:0,firstByteToFCP:e.value,loadState:z(W())}}(e),function(e){q(e)}(e)}),t)}(0,a.reportOptions.fcp),function(e,t){!function(e,t){t=t||{},ee((function(){var n,r=[100,300],i=oe(),a=J("FID"),o=function(e){e.startTime<i.firstHiddenTime&&(a.value=e.processingStart-e.startTime,a.entries.push(e),n(!0))},s=function(e){e.forEach(o)},c=X("first-input",s);n=Z(e,a,r,t.reportAllChanges),c&&G((function(){s(c.takeRecords()),c.disconnect()}),!0),c&&H((function(){var i;a=J("FID"),n=Z(e,a,r,t.reportAllChanges),C=[],M=-1,P=null,me(addEventListener),i=o,C.push(i),de()}))}))}((function(e){!function(e){var t=e.entries[0];e.attribution={eventTarget:$(t.target),eventType:t.name,eventTime:t.startTime,eventEntry:t,loadState:z(t.startTime)}}(e),function(e){q(e)}(e)}),t)}(0,a.reportOptions.fid),function(e,t){!function(e,t){t=t||{},ee((function(){var n,r=[2500,4e3],i=oe(),a=J("LCP"),o=function(e){var t=e[e.length-1];if(t){var r=Math.max(t.startTime-V(),0);r<i.firstHiddenTime&&(a.value=r,a.entries=[t],n())}},s=X("largest-contentful-paint",o);if(s){n=Z(e,a,r,t.reportAllChanges);var c=function(){Se[a.id]||(o(s.takeRecords()),s.disconnect(),Se[a.id]=!0,n(!0))};["keydown","click"].forEach((function(e){addEventListener(e,c,{once:!0,capture:!0})})),G(c,!0),H((function(i){a=J("LCP"),n=Z(e,a,r,t.reportAllChanges),Y((function(){a.value=performance.now()-i.timeStamp,Se[a.id]=!0,n(!0)}))}))}}))}((function(e){!function(e){if(e.entries.length){var t=F();if(t){var n=t.activationStart||0,r=e.entries[e.entries.length-1],i=r.url&&performance.getEntriesByType("resource").filter((function(e){return e.name===r.url}))[0],a=Math.max(0,t.responseStart-n),o=Math.max(a,i?(i.requestStart||i.startTime)-n:0),s=Math.max(o,i?i.responseEnd-n:0),c=Math.max(s,r?r.startTime-n:0),u={element:$(r.element),timeToFirstByte:a,resourceLoadDelay:o-a,resourceLoadTime:s-o,elementRenderDelay:c-s,navigationEntry:t,lcpEntry:r};return r.url&&(u.url=r.url),i&&(u.lcpResourceEntry=i),void(e.attribution=u)}}e.attribution={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadTime:0,elementRenderDelay:e.value}}(e),function(e){q(e)}(e)}),t)}(0,a.reportOptions.lcp),function(e,t){!function(e,t){t=t||{},ee((function(){var n=[200,500];"interactionCount"in performance||D||(D=X("event",be,{type:"event",buffered:!0,durationThreshold:0}));var r,i=J("INP"),a=function(e){e.forEach((function(e){e.interactionId&&_e(e),"first-input"===e.entryType&&!Te.some((function(t){return t.entries.some((function(t){return e.duration===t.duration&&e.startTime===t.startTime}))}))&&_e(e)}));var t,n=(t=Math.min(Te.length-1,Math.floor(ye()/50)),Te[t]);n&&n.latency!==i.value&&(i.value=n.latency,i.entries=n.entries,r())},o=X("event",a,{durationThreshold:t.durationThreshold||40});r=Z(e,i,n,t.reportAllChanges),o&&(o.observe({type:"first-input",buffered:!0}),G((function(){a(o.takeRecords()),i.value<0&&ye()>0&&(i.value=0,i.entries=[]),r(!0)})),H((function(){Te=[],we=he(),i=J("INP"),r=Z(e,i,n,t.reportAllChanges)})))}))}((function(t){!function(e){if(e.entries.length){var t=e.entries.sort((function(e,t){return t.duration-e.duration||t.processingEnd-t.processingStart-(e.processingEnd-e.processingStart)}))[0];e.attribution={eventTarget:$(t.target),eventType:t.name,eventTime:t.startTime,eventEntry:t,loadState:z(t.startTime)}}else e.attribution={}}(t),e(t)}),t)}((function(e){return q(e)}),a.reportOptions.inp),a.isResourceTiming&&S("resource",je),a.isElementTiming&&S("element",Oe)},Ie=function(e){var t="usageDetails"in e?e.usageDetails:{};R("storageEstimate",{quota:j(e.quota),usage:j(e.usage),caches:j(t.caches),indexedDB:j(t.indexedDB),serviceWorker:j(t.serviceWorkerRegistrations)})},Pe={finalMarkToStepsMap:{},startMarkToStepsMap:{},active:{},navigationSteps:{}},Me=function(e){delete Pe.active[e]},Be=function(){return Pe.navigationSteps},Ce=function(e){var t;return null!==(t=Be()[e])&&void 0!==t?t:{}},De=function(e,t,n){var r="step."+e,i=u.getEntriesByName(p+t).length>0;if(u.getEntriesByName(p+n).length>0&&a.steps){var o=A[a.steps[e].threshold],s=o.maxOutlierThreshold,c=o.vitalsThresholds;if(i){var l=u.measure(r,p+t,p+n),d=l.duration;if(d<=s){var m=function(e,t){return e<=t[0]?"good":e<=t[1]?"needsImprovement":"poor"}(d,c);d>=0&&(N("userJourneyStep",d,m,{stepName:e},void 0),u.measure("step.".concat(e,"_vitals_").concat(m),{start:l.startTime+l.duration,end:l.startTime+l.duration,detail:{type:"stepVital",duration:d}}))}}}},Ae=function(){var e=Be(),t=Pe.startMarkToStepsMap,n=Object.keys(e).length;if(0===n)return{};var r={},i=n-1,a=Ce(i);if(Object.keys(a).forEach((function(e){var n,i=null!==(n=t[e])&&void 0!==n?n:[];Object.keys(i).forEach((function(e){r[e]=!0}))})),n>1){var o=Ce(i-1);Object.keys(o).forEach((function(e){var n,i=null!==(n=t[e])&&void 0!==n?n:[];Object.keys(i).forEach((function(e){r[e]=!0}))}))}return r},Le=function(){var e,t=Object.keys(Pe.navigationSteps).length;Pe.navigationSteps[t]={};var n=Ae();null===(e=a.onMarkStep)||void 0===e||e.call(a,"",Object.keys(n))},Ue=function(e){var t,n,r,i,o,s,c;if(Pe.finalMarkToStepsMap[e]){!function(e){var t=Pe.navigationSteps,n=Pe.finalMarkToStepsMap,r=Object.keys(t).length;if(0!==r){var i=r-1,a=Ce(i);if(a&&n[e]){var o=n[e];o&&Object.keys(o).forEach((function(e){if(a[e]){var n=Ce(i)||{};n[e]=!1,t[i]=n}if(r>1){var o=i-1,s=Ce(o);s[e]&&(s[e]=!1,t[o]=s)}}))}}}(e);var u=Pe.finalMarkToStepsMap[e];Object.keys(u).forEach((function(t){var n=u[t];n.forEach(Me),Promise.all(n.map((function(n){return function(e,t,n,r){return new(n||(n=Promise))((function(e,t){function i(e){try{o(r.next(e))}catch(e){t(e)}}function a(e){try{o(r.throw(e))}catch(e){t(e)}}function o(t){var r;t.done?e(t.value):(r=t.value,r instanceof n?r:new n((function(e){e(r)}))).then(i,a)}o((r=r.apply(undefined,[])).next())}))}(0,0,void 0,(function(){return function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}(this,(function(r){switch(r.label){case 0:return[4,De(n,t,e)];case 1:return r.sent(),[2]}}))}))}))).catch((function(){}))}))}else r=e,i=Pe.navigationSteps,o=Object.keys(i).length,(c=Ce(s=(o>0?o:1)-1)||[])[r]=!0,i[s]=c,function(e){var t,n=null!==(t=Pe.startMarkToStepsMap[e])&&void 0!==t?t:[];Object.keys(n).forEach((function(e){Pe.active[e]||(Pe.active[e]=!0)}))}(e);if(a.enableNavigationTracking){var l=Ae();null===(t=a.onMarkStep)||void 0===t||t.call(a,e,Object.keys(l))}else null===(n=a.onMarkStep)||void 0===n||n.call(a,e,Object.keys(Pe.active))},Re=function(e){u.mark(p+e),Ue(e)},qe=function(e){0===u.getEntriesByName(p+e).length&&(u.mark(p+e),Ue(e))},Fe=0,ze=function(){function e(e){if(void 0===e&&(e={}),this.v="9.0.0-rc.3",a.analyticsTracker=e.analyticsTracker,a.isResourceTiming=!!e.resourceTiming,a.isElementTiming=!!e.elementTiming,a.maxTime=e.maxMeasureTime||a.maxTime,a.reportOptions=e.reportOptions||a.reportOptions,a.steps=e.steps,a.onMarkStep=e.onMarkStep,a.enableNavigationTracking=e.enableNavigationTracking,m()){"PerformanceObserver"in o&&Ne(),void 0!==document.hidden&&document.addEventListener("visibilitychange",_);var t=function(){if(!m())return{};var e=u.getEntriesByType("navigation")[0];if(!e)return{};var t=e.responseStart,n=e.responseEnd;return{fetchTime:n-e.fetchStart,workerTime:e.workerStart>0?n-e.workerStart:0,totalTime:n-e.requestStart,downloadTime:n-t,timeToFirstByte:t-e.requestStart,headerSize:e.transferSize-e.encodedBodySize||0,dnsLookupTime:e.domainLookupEnd-e.domainLookupStart,redirectTime:e.redirectEnd-e.redirectStart}}();R("navigationTiming",t),t.redirectTime&&q({attribution:{},name:"RT",rating:U("RT",t.redirectTime),value:t.redirectTime}),R("networkInformation",function(){if("connection"in c){var e=c.connection;return"object"!=typeof e?{}:(f=e.effectiveType,v=!!e.saveData,{downlink:e.downlink,effectiveType:e.effectiveType,rtt:e.rtt,saveData:!!e.saveData})}return{}}()),c&&c.storage&&"function"==typeof c.storage.estimate&&c.storage.estimate().then(Ie),a.steps&&a.steps&&(Pe.startMarkToStepsMap={},Pe.finalMarkToStepsMap={},Pe.active={},Pe.navigationSteps={},Object.entries(a.steps).forEach((function(e){var t,n,r=e[0],i=e[1].marks,a=i[0],o=i[1],s=null!==(n=Pe.startMarkToStepsMap[a])&&void 0!==n?n:{};if(s[r]=!0,Pe.startMarkToStepsMap[a]=s,Pe.finalMarkToStepsMap[o]){var c=Pe.finalMarkToStepsMap[o][a]||[];c.push(r),Pe.finalMarkToStepsMap[o][a]=c}else Pe.finalMarkToStepsMap[o]=((t={})[a]=[r],t)})))}}return e.prototype.start=function(e){m()&&!g[e]&&(g[e]=!0,u.mark("mark_".concat(e,"_start")))},e.prototype.end=function(e,t,n){if(void 0===t&&(t={}),void 0===n&&(n=!0),m()&&g[e]){u.mark("mark_".concat(e,"_end")),delete g[e];var r=function(e){u.measure(e,"mark_".concat(e,"_start"),"mark_".concat(e,"_end"));var t=u.getEntriesByName(e).pop();return t&&"measure"===t.entryType?t.duration:-1}(e);n&&R(e,O(r),t)}},e.prototype.endPaint=function(e,t){var n=this;setTimeout((function(){n.end(e,t)}))},e.prototype.clear=function(e){delete g[e],u.clearMarks&&(u.clearMarks("mark_".concat(e,"_start")),u.clearMarks("mark_".concat(e,"_end")))},e.prototype.markNTBT=function(){var e=this;this.start("ntbt"),y.value=0,clearTimeout(Fe),Fe=setTimeout((function(){e.end("ntbt",{},!1),q({attribution:{},name:"NTBT",rating:U("NTBT",y.value),value:y.value}),y.value=0}),2e3)},e}()},426:(e,t)=>{"use strict";Symbol.for("react.element"),Symbol.for("react.portal"),Symbol.for("react.fragment"),Symbol.for("react.strict_mode"),Symbol.for("react.profiler"),Symbol.for("react.provider"),Symbol.for("react.context"),Symbol.for("react.forward_ref"),Symbol.for("react.suspense"),Symbol.for("react.memo"),Symbol.for("react.lazy"),Symbol.iterator;var n={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},r=Object.assign,i={};function a(e,t,r){this.props=e,this.context=t,this.refs=i,this.updater=r||n}function o(){}function s(e,t,r){this.props=e,this.context=t,this.refs=i,this.updater=r||n}a.prototype.isReactComponent={},a.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},a.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},o.prototype=a.prototype;var c=s.prototype=new o;c.constructor=s,r(c,a.prototype),c.isPureReactComponent=!0;Array.isArray,Object.prototype.hasOwnProperty;var u={current:null};t.useCallback=function(e,t){return u.current.useCallback(e,t)},t.useEffect=function(e,t){return u.current.useEffect(e,t)},t.useRef=function(e){return u.current.useRef(e)}},784:(e,t,n)=>{"use strict";e.exports=n(426)},353:function(e,t,n){var r;!function(i,a){"use strict";var o="function",s="undefined",c="object",u="string",l="major",d="model",p="name",m="type",f="vendor",v="version",g="architecture",b="console",h="mobile",w="tablet",y="smarttv",T="wearable",k="embedded",_="Amazon",S="Apple",E="ASUS",x="BlackBerry",O="Browser",j="Chrome",N="Firefox",I="Google",P="Huawei",M="LG",B="Microsoft",C="Motorola",D="Opera",A="Samsung",L="Sharp",U="Sony",R="Xiaomi",q="Zebra",F="Facebook",z="Chromium OS",K="Mac OS",$=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},Q=function(e,t){return typeof e===u&&-1!==W(t).indexOf(W(e))},W=function(e){return e.toLowerCase()},H=function(e,t){if(typeof e===u)return e=e.replace(/^\\s\\s*/,""),typeof t===s?e:e.substring(0,350)},V=function(e,t){for(var n,r,i,s,u,l,d=0;d<t.length&&!u;){var p=t[d],m=t[d+1];for(n=r=0;n<p.length&&!u&&p[n];)if(u=p[n++].exec(e))for(i=0;i<m.length;i++)l=u[++r],typeof(s=m[i])===c&&s.length>0?2===s.length?typeof s[1]==o?this[s[0]]=s[1].call(this,l):this[s[0]]=s[1]:3===s.length?typeof s[1]!==o||s[1].exec&&s[1].test?this[s[0]]=l?l.replace(s[1],s[2]):a:this[s[0]]=l?s[1].call(this,l,s[2]):a:4===s.length&&(this[s[0]]=l?s[3].call(this,l.replace(s[1],s[2])):a):this[s]=l||a;d+=2}},J=function(e,t){for(var n in t)if(typeof t[n]===c&&t[n].length>0){for(var r=0;r<t[n].length;r++)if(Q(t[n][r],e))return"?"===n?a:n}else if(Q(t[n],e))return"?"===n?a:n;return e},X={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},G={browser:[[/\\b(?:crmo|crios)\\/([\\w\\.]+)/i],[v,[p,"Chrome"]],[/edg(?:e|ios|a)?\\/([\\w\\.]+)/i],[v,[p,"Edge"]],[/(opera mini)\\/([-\\w\\.]+)/i,/(opera [mobiletab]{3,6})\\b.+version\\/([-\\w\\.]+)/i,/(opera)(?:.+version\\/|[\\/ ]+)([\\w\\.]+)/i],[p,v],[/opios[\\/ ]+([\\w\\.]+)/i],[v,[p,D+" Mini"]],[/\\bopr\\/([\\w\\.]+)/i],[v,[p,D]],[/(kindle)\\/([\\w\\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\\/ ]?([\\w\\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\\/ ]?([\\w\\.]*)/i,/(ba?idubrowser)[\\/ ]?([\\w\\.]+)/i,/(?:ms|\\()(ie) ([\\w\\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\\/([-\\w\\.]+)/i,/(heytap|ovi)browser\\/([\\d\\.]+)/i,/(weibo)__([\\d\\.]+)/i],[p,v],[/(?:\\buc? ?browser|(?:juc.+)ucweb)[\\/ ]?([\\w\\.]+)/i],[v,[p,"UC"+O]],[/microm.+\\bqbcore\\/([\\w\\.]+)/i,/\\bqbcore\\/([\\w\\.]+).+microm/i],[v,[p,"WeChat(Win) Desktop"]],[/micromessenger\\/([\\w\\.]+)/i],[v,[p,"WeChat"]],[/konqueror\\/([\\w\\.]+)/i],[v,[p,"Konqueror"]],[/trident.+rv[: ]([\\w\\.]{1,9})\\b.+like gecko/i],[v,[p,"IE"]],[/ya(?:search)?browser\\/([\\w\\.]+)/i],[v,[p,"Yandex"]],[/(avast|avg)\\/([\\w\\.]+)/i],[[p,/(.+)/,"$1 Secure "+O],v],[/\\bfocus\\/([\\w\\.]+)/i],[v,[p,N+" Focus"]],[/\\bopt\\/([\\w\\.]+)/i],[v,[p,D+" Touch"]],[/coc_coc\\w+\\/([\\w\\.]+)/i],[v,[p,"Coc Coc"]],[/dolfin\\/([\\w\\.]+)/i],[v,[p,"Dolphin"]],[/coast\\/([\\w\\.]+)/i],[v,[p,D+" Coast"]],[/miuibrowser\\/([\\w\\.]+)/i],[v,[p,"MIUI "+O]],[/fxios\\/([-\\w\\.]+)/i],[v,[p,N]],[/\\bqihu|(qi?ho?o?|360)browser/i],[[p,"360 "+O]],[/(oculus|samsung|sailfish|huawei)browser\\/([\\w\\.]+)/i],[[p,/(.+)/,"$1 "+O],v],[/(comodo_dragon)\\/([\\w\\.]+)/i],[[p,/_/g," "],v],[/(electron)\\/([\\w\\.]+) safari/i,/(tesla)(?: qtcarbrowser|\\/(20\\d\\d\\.[-\\w\\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\\/ ]?([\\w\\.]+)/i],[p,v],[/(metasr)[\\/ ]?([\\w\\.]+)/i,/(lbbrowser)/i,/\\[(linkedin)app\\]/i],[p],[/((?:fban\\/fbios|fb_iab\\/fb4a)(?!.+fbav)|;fbav\\/([\\w\\.]+);)/i],[[p,F],v],[/(kakao(?:talk|story))[\\/ ]([\\w\\.]+)/i,/(naver)\\(.*?(\\d+\\.[\\w\\.]+).*\\)/i,/safari (line)\\/([\\w\\.]+)/i,/\\b(line)\\/([\\w\\.]+)\\/iab/i,/(chromium|instagram)[\\/ ]([-\\w\\.]+)/i],[p,v],[/\\bgsa\\/([\\w\\.]+) .*safari\\//i],[v,[p,"GSA"]],[/musical_ly(?:.+app_?version\\/|_)([\\w\\.]+)/i],[v,[p,"TikTok"]],[/headlesschrome(?:\\/([\\w\\.]+)| )/i],[v,[p,j+" Headless"]],[/ wv\\).+(chrome)\\/([\\w\\.]+)/i],[[p,j+" WebView"],v],[/droid.+ version\\/([\\w\\.]+)\\b.+(?:mobile safari|safari)/i],[v,[p,"Android "+O]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\\/v?([\\w\\.]+)/i],[p,v],[/version\\/([\\w\\.\\,]+) .*mobile\\/\\w+ (safari)/i],[v,[p,"Mobile Safari"]],[/version\\/([\\w(\\.|\\,)]+) .*(mobile ?safari|safari)/i],[v,p],[/webkit.+?(mobile ?safari|safari)(\\/[\\w\\.]+)/i],[p,[v,J,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\\/([\\w\\.]+)/i],[p,v],[/(navigator|netscape\\d?)\\/([-\\w\\.]+)/i],[[p,"Netscape"],v],[/mobile vr; rv:([\\w\\.]+)\\).+firefox/i],[v,[p,N+" Reality"]],[/ekiohf.+(flow)\\/([\\w\\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\\/ ]?([\\w\\.\\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\\/([-\\w\\.]+)$/i,/(firefox)\\/([\\w\\.]+)/i,/(mozilla)\\/([\\w\\.]+) .+rv\\:.+gecko\\/\\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\\. ]?browser)[-\\/ ]?v?([\\w\\.]+)/i,/(links) \\(([\\w\\.]+)/i,/panasonic;(viera)/i],[p,v],[/(cobalt)\\/([\\w\\.]+)/i],[p,[v,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\\)]/i],[[g,"amd64"]],[/(ia32(?=;))/i],[[g,W]],[/((?:i[346]|x)86)[;\\)]/i],[[g,"ia32"]],[/\\b(aarch64|arm(v?8e?l?|_?64))\\b/i],[[g,"arm64"]],[/\\b(arm(?:v[67])?ht?n?[fl]p?)\\b/i],[[g,"armhf"]],[/windows (ce|mobile); ppc;/i],[[g,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\\))/i],[[g,/ower/,"",W]],[/(sun4\\w)[;\\)]/i],[[g,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\\))|\\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\\b|pa-risc)/i],[[g,W]]],device:[[/\\b(sch-i[89]0\\d|shw-m380s|sm-[ptx]\\w{2,4}|gt-[pn]\\d{2,4}|sgh-t8[56]9|nexus 10)/i],[d,[f,A],[m,w]],[/\\b((?:s[cgp]h|gt|sm)-\\w+|sc[g-]?[\\d]+a?|galaxy nexus)/i,/samsung[- ]([-\\w]+)/i,/sec-(sgh\\w+)/i],[d,[f,A],[m,h]],[/(?:\\/|\\()(ip(?:hone|od)[\\w, ]*)(?:\\/|;)/i],[d,[f,S],[m,h]],[/\\((ipad);[-\\w\\),; ]+apple/i,/applecoremedia\\/[\\w\\.]+ \\((ipad)/i,/\\b(ipad)\\d\\d?,\\d\\d?[;\\]].+ios/i],[d,[f,S],[m,w]],[/(macintosh);/i],[d,[f,S]],[/\\b(sh-?[altvz]?\\d\\d[a-ekm]?)/i],[d,[f,L],[m,h]],[/\\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\\d{2})\\b(?!.+d\\/s)/i],[d,[f,P],[m,w]],[/(?:huawei|honor)([-\\w ]+)[;\\)]/i,/\\b(nexus 6p|\\w{2,4}e?-[atu]?[ln][\\dx][012359c][adn]?)\\b(?!.+d\\/s)/i],[d,[f,P],[m,h]],[/\\b(poco[\\w ]+)(?: bui|\\))/i,/\\b; (\\w+) build\\/hm\\1/i,/\\b(hm[-_ ]?note?[_ ]?(?:\\d\\w)?) bui/i,/\\b(redmi[\\-_ ]?(?:note|k)?[\\w_ ]+)(?: bui|\\))/i,/\\b(mi[-_ ]?(?:a\\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\\d?\\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\\))/i],[[d,/_/g," "],[f,R],[m,h]],[/\\b(mi[-_ ]?(?:pad)(?:[\\w_ ]+))(?: bui|\\))/i],[[d,/_/g," "],[f,R],[m,w]],[/; (\\w+) bui.+ oppo/i,/\\b(cph[12]\\d{3}|p(?:af|c[al]|d\\w|e[ar])[mt]\\d0|x9007|a101op)\\b/i],[d,[f,"OPPO"],[m,h]],[/vivo (\\w+)(?: bui|\\))/i,/\\b(v[12]\\d{3}\\w?[at])(?: bui|;)/i],[d,[f,"Vivo"],[m,h]],[/\\b(rmx[12]\\d{3})(?: bui|;|\\))/i],[d,[f,"Realme"],[m,h]],[/\\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\\b[\\w ]+build\\//i,/\\bmot(?:orola)?[- ](\\w*)/i,/((?:moto[\\w\\(\\) ]+|xt\\d{3,4}|nexus 6)(?= bui|\\)))/i],[d,[f,C],[m,h]],[/\\b(mz60\\d|xoom[2 ]{0,2}) build\\//i],[d,[f,C],[m,w]],[/((?=lg)?[vl]k\\-?\\d{3}) bui| 3\\.[-\\w; ]{10}lg?-([06cv9]{3,4})/i],[d,[f,M],[m,w]],[/(lm(?:-?f100[nv]?|-[\\w\\.]+)(?= bui|\\))|nexus [45])/i,/\\blg[-e;\\/ ]+((?!browser|netcast|android tv)\\w+)/i,/\\blg-?([\\d\\w]+) bui/i],[d,[f,M],[m,h]],[/(ideatab[-\\w ]+)/i,/lenovo ?(s[56]000[-\\w]+|tab(?:[\\w ]+)|yt[-\\d\\w]{6}|tb[-\\d\\w]{6})/i],[d,[f,"Lenovo"],[m,w]],[/(?:maemo|nokia).*(n900|lumia \\d+)/i,/nokia[-_ ]?([-\\w\\.]*)/i],[[d,/_/g," "],[f,"Nokia"],[m,h]],[/(pixel c)\\b/i],[d,[f,I],[m,w]],[/droid.+; (pixel[\\daxl ]{0,6})(?: bui|\\))/i],[d,[f,I],[m,h]],[/droid.+ (a?\\d[0-2]{2}so|[c-g]\\d{4}|so[-gl]\\w+|xq-a\\w[4-7][12])(?= bui|\\).+chrome\\/(?![1-6]{0,1}\\d\\.))/i],[d,[f,U],[m,h]],[/sony tablet [ps]/i,/\\b(?:sony)?sgp\\w+(?: bui|\\))/i],[[d,"Xperia Tablet"],[f,U],[m,w]],[/ (kb2005|in20[12]5|be20[12][59])\\b/i,/(?:one)?(?:plus)? (a\\d0\\d\\d)(?: b|\\))/i],[d,[f,"OnePlus"],[m,h]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\\))/i,/(kf[a-z]+)( bui|\\)).+silk\\//i],[d,[f,_],[m,w]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\\)).+silk\\//i],[[d,/(.+)/g,"Fire Phone $1"],[f,_],[m,h]],[/(playbook);[-\\w\\),; ]+(rim)/i],[d,f,[m,w]],[/\\b((?:bb[a-f]|st[hv])100-\\d)/i,/\\(bb10; (\\w+)/i],[d,[f,x],[m,h]],[/(?:\\b|asus_)(transfo[prime ]{4,10} \\w+|eeepc|slider \\w+|nexus 7|padfone|p00[cj])/i],[d,[f,E],[m,w]],[/ (z[bes]6[027][012][km][ls]|zenfone \\d\\w?)\\b/i],[d,[f,E],[m,h]],[/(nexus 9)/i],[d,[f,"HTC"],[m,w]],[/(htc)[-;_ ]{1,2}([\\w ]+(?=\\)| bui)|\\w+)/i,/(zte)[- ]([\\w ]+?)(?: bui|\\/|\\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\\.))|sony(?!-bra))[-_ ]?([-\\w]*)/i],[f,[d,/_/g," "],[m,h]],[/droid.+; ([ab][1-7]-?[0178a]\\d\\d?)/i],[d,[f,"Acer"],[m,w]],[/droid.+; (m[1-5] note) bui/i,/\\bmz-([-\\w]{2,})/i],[d,[f,"Meizu"],[m,h]],[/(blackberry|benq|palm(?=\\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\\w]*)/i,/(hp) ([\\w ]+\\w)/i,/(asus)-?(\\w+)/i,/(microsoft); (lumia[\\w ]+)/i,/(lenovo)[-_ ]?([-\\w]+)/i,/(jolla)/i,/(oppo) ?([\\w ]+) bui/i],[f,d,[m,h]],[/(kobo)\\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\\/([\\w\\.]+)/i,/(nook)[\\w ]+build\\/(\\w+)/i,/(dell) (strea[kpr\\d ]*[\\dko])/i,/(le[- ]+pan)[- ]+(\\w{1,9}) bui/i,/(trinity)[- ]*(t\\d{3}) bui/i,/(gigaset)[- ]+(q\\w{1,9}) bui/i,/(vodafone) ([\\w ]+)(?:\\)| bui)/i],[f,d,[m,w]],[/(surface duo)/i],[d,[f,B],[m,w]],[/droid [\\d\\.]+; (fp\\du?)(?: b|\\))/i],[d,[f,"Fairphone"],[m,h]],[/(u304aa)/i],[d,[f,"AT&T"],[m,h]],[/\\bsie-(\\w*)/i],[d,[f,"Siemens"],[m,h]],[/\\b(rct\\w+) b/i],[d,[f,"RCA"],[m,w]],[/\\b(venue[\\d ]{2,7}) b/i],[d,[f,"Dell"],[m,w]],[/\\b(q(?:mv|ta)\\w+) b/i],[d,[f,"Verizon"],[m,w]],[/\\b(?:barnes[& ]+noble |bn[rt])([\\w\\+ ]*) b/i],[d,[f,"Barnes & Noble"],[m,w]],[/\\b(tm\\d{3}\\w+) b/i],[d,[f,"NuVision"],[m,w]],[/\\b(k88) b/i],[d,[f,"ZTE"],[m,w]],[/\\b(nx\\d{3}j) b/i],[d,[f,"ZTE"],[m,h]],[/\\b(gen\\d{3}) b.+49h/i],[d,[f,"Swiss"],[m,h]],[/\\b(zur\\d{3}) b/i],[d,[f,"Swiss"],[m,w]],[/\\b((zeki)?tb.*\\b) b/i],[d,[f,"Zeki"],[m,w]],[/\\b([yr]\\d{2}) b/i,/\\b(dragon[- ]+touch |dt)(\\w{5}) b/i],[[f,"Dragon Touch"],d,[m,w]],[/\\b(ns-?\\w{0,9}) b/i],[d,[f,"Insignia"],[m,w]],[/\\b((nxa|next)-?\\w{0,9}) b/i],[d,[f,"NextBook"],[m,w]],[/\\b(xtreme\\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[f,"Voice"],d,[m,h]],[/\\b(lvtel\\-)?(v1[12]) b/i],[[f,"LvTel"],d,[m,h]],[/\\b(ph-1) /i],[d,[f,"Essential"],[m,h]],[/\\b(v(100md|700na|7011|917g).*\\b) b/i],[d,[f,"Envizen"],[m,w]],[/\\b(trio[-\\w\\. ]+) b/i],[d,[f,"MachSpeed"],[m,w]],[/\\btu_(1491) b/i],[d,[f,"Rotor"],[m,w]],[/(shield[\\w ]+) b/i],[d,[f,"Nvidia"],[m,w]],[/(sprint) (\\w+)/i],[f,d,[m,h]],[/(kin\\.[onetw]{3})/i],[[d,/\\./g," "],[f,B],[m,h]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\\)/i],[d,[f,q],[m,w]],[/droid.+; (ec30|ps20|tc[2-8]\\d[kx])\\)/i],[d,[f,q],[m,h]],[/smart-tv.+(samsung)/i],[f,[m,y]],[/hbbtv.+maple;(\\d+)/i],[[d,/^/,"SmartTV"],[f,A],[m,y]],[/(nux; netcast.+smarttv|lg (netcast\\.tv-201\\d|android tv))/i],[[f,M],[m,y]],[/(apple) ?tv/i],[f,[d,S+" TV"],[m,y]],[/crkey/i],[[d,j+"cast"],[f,I],[m,y]],[/droid.+aft(\\w)( bui|\\))/i],[d,[f,_],[m,y]],[/\\(dtv[\\);].+(aquos)/i,/(aquos-tv[\\w ]+)\\)/i],[d,[f,L],[m,y]],[/(bravia[\\w ]+)( bui|\\))/i],[d,[f,U],[m,y]],[/(mitv-\\w{5}) bui/i],[d,[f,R],[m,y]],[/Hbbtv.*(technisat) (.*);/i],[f,d,[m,y]],[/\\b(roku)[\\dx]*[\\)\\/]((?:dvp-)?[\\d\\.]*)/i,/hbbtv\\/\\d+\\.\\d+\\.\\d+ +\\([\\w\\+ ]*; *([\\w\\d][^;]*);([^;]*)/i],[[f,H],[d,H],[m,y]],[/\\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\\b/i],[[m,y]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[f,d,[m,b]],[/droid.+; (shield) bui/i],[d,[f,"Nvidia"],[m,b]],[/(playstation [345portablevi]+)/i],[d,[f,U],[m,b]],[/\\b(xbox(?: one)?(?!; xbox))[\\); ]/i],[d,[f,B],[m,b]],[/((pebble))app/i],[f,d,[m,T]],[/(watch)(?: ?os[,\\/]|\\d,\\d\\/)[\\d\\.]+/i],[d,[f,S],[m,T]],[/droid.+; (glass) \\d/i],[d,[f,I],[m,T]],[/droid.+; (wt63?0{2,3})\\)/i],[d,[f,q],[m,T]],[/(quest( 2| pro)?)/i],[d,[f,F],[m,T]],[/(tesla)(?: qtcarbrowser|\\/[-\\w\\.]+)/i],[f,[m,k]],[/(aeobc)\\b/i],[d,[f,_],[m,k]],[/droid .+?; ([^;]+?)(?: bui|\\) applew).+? mobile safari/i],[d,[m,h]],[/droid .+?; ([^;]+?)(?: bui|\\) applew).+?(?! mobile) safari/i],[d,[m,w]],[/\\b((tablet|tab)[;\\/]|focus\\/\\d(?!.+mobile))/i],[[m,w]],[/(phone|mobile(?:[;\\/]| [ \\w\\/\\.]*safari)|pda(?=.+windows ce))/i],[[m,h]],[/(android[-\\w\\. ]{0,9});.+buil/i],[d,[f,"Generic"]]],engine:[[/windows.+ edge\\/([\\w\\.]+)/i],[v,[p,"EdgeHTML"]],[/webkit\\/537\\.36.+chrome\\/(?!27)([\\w\\.]+)/i],[v,[p,"Blink"]],[/(presto)\\/([\\w\\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\\/([\\w\\.]+)/i,/ekioh(flow)\\/([\\w\\.]+)/i,/(khtml|tasman|links)[\\/ ]\\(?([\\w\\.]+)/i,/(icab)[\\/ ]([23]\\.[\\d\\.]+)/i,/\\b(libweb)/i],[p,v],[/rv\\:([\\w\\.]{1,9})\\b.+(gecko)/i],[v,p]],os:[[/microsoft (windows) (vista|xp)/i],[p,v],[/(windows) nt 6\\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\\/ ]?([\\d\\.\\w ]*)/i,/(windows)[\\/ ]?([ntce\\d\\. ]+\\w)(?!.+xbox)/i],[p,[v,J,X]],[/(win(?=3|9|n)|win 9x )([nt\\d\\.]+)/i],[[p,"Windows"],[v,J,X]],[/ip[honead]{2,4}\\b(?:.*os ([\\w]+) like mac|; opera)/i,/ios;fbsv\\/([\\d\\.]+)/i,/cfnetwork\\/.+darwin/i],[[v,/_/g,"."],[p,"iOS"]],[/(mac os x) ?([\\w\\. ]*)/i,/(macintosh|mac_powerpc\\b)(?!.+haiku)/i],[[p,K],[v,/_/g,"."]],[/droid ([\\w\\.]+)\\b.+(android[- ]x86|harmonyos)/i],[v,p],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\\/ ]?([\\w\\.]*)/i,/(blackberry)\\w*\\/([\\w\\.]*)/i,/(tizen|kaios)[\\/ ]([\\w\\.]+)/i,/\\((series40);/i],[p,v],[/\\(bb(10);/i],[v,[p,x]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\\/ ]?([\\w\\.]*)/i],[v,[p,"Symbian"]],[/mozilla\\/[\\d\\.]+ \\((?:mobile|tablet|tv|mobile; [\\w ]+); rv:.+ gecko\\/([\\w\\.]+)/i],[v,[p,N+" OS"]],[/web0s;.+rt(tv)/i,/\\b(?:hp)?wos(?:browser)?\\/([\\w\\.]+)/i],[v,[p,"webOS"]],[/watch(?: ?os[,\\/]|\\d,\\d\\/)([\\d\\.]+)/i],[v,[p,"watchOS"]],[/crkey\\/([\\d\\.]+)/i],[v,[p,j+"cast"]],[/(cros) [\\w]+(?:\\)| ([\\w\\.]+)\\b)/i],[[p,z],v],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\\/(\\d+\\.[\\w\\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\\);]+)/i,/\\b(joli|palm)\\b ?(?:os)?\\/?([\\w\\.]*)/i,/(mint)[\\/\\(\\) ]?(\\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\\/ ]?(?!chrom|package)([-\\w\\.]*)/i,/(hurd|linux) ?([\\w\\.]*)/i,/(gnu) ?([\\w\\.]*)/i,/\\b([-frentopcghs]{0,5}bsd|dragonfly)[\\/ ]?(?!amd|[ix346]{1,2}86)([\\w\\.]*)/i,/(haiku) (\\w+)/i],[p,v],[/(sunos) ?([\\w\\.\\d]*)/i],[[p,"Solaris"],v],[/((?:open)?solaris)[-\\/ ]?([\\w\\.]*)/i,/(aix) ((\\d)(?=\\.|\\)| )[\\w\\.])*/i,/\\b(beos|os\\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\\w\\.]*)/i],[p,v]]},Z=function(e,t){if(typeof e===c&&(t=e,e=a),!(this instanceof Z))return new Z(e,t).getResult();var n=typeof i!==s&&i.navigator?i.navigator:a,r=e||(n&&n.userAgent?n.userAgent:""),b=n&&n.userAgentData?n.userAgentData:a,y=t?function(e,t){var n={};for(var r in e)t[r]&&t[r].length%2==0?n[r]=t[r].concat(e[r]):n[r]=e[r];return n}(G,t):G,T=n&&n.userAgent==r;return this.getBrowser=function(){var e,t={};return t[p]=a,t[v]=a,V.call(t,r,y.browser),t[l]=typeof(e=t[v])===u?e.replace(/[^\\d\\.]/g,"").split(".")[0]:a,T&&n&&n.brave&&typeof n.brave.isBrave==o&&(t[p]="Brave"),t},this.getCPU=function(){var e={};return e[g]=a,V.call(e,r,y.cpu),e},this.getDevice=function(){var e={};return e[f]=a,e[d]=a,e[m]=a,V.call(e,r,y.device),T&&!e[m]&&b&&b.mobile&&(e[m]=h),T&&"Macintosh"==e[d]&&n&&typeof n.standalone!==s&&n.maxTouchPoints&&n.maxTouchPoints>2&&(e[d]="iPad",e[m]=w),e},this.getEngine=function(){var e={};return e[p]=a,e[v]=a,V.call(e,r,y.engine),e},this.getOS=function(){var e={};return e[p]=a,e[v]=a,V.call(e,r,y.os),T&&!e[p]&&b&&"Unknown"!=b.platform&&(e[p]=b.platform.replace(/chrome os/i,z).replace(/macos/i,K)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return r},this.setUA=function(e){return r=typeof e===u&&e.length>350?H(e,350):e,this},this.setUA(r),this};Z.VERSION="1.0.35",Z.BROWSER=$([p,v,l]),Z.CPU=$([g]),Z.DEVICE=$([d,f,m,b,h,y,w,T,k]),Z.ENGINE=Z.OS=$([p,v]),typeof t!==s?(e.exports&&(t=e.exports=Z),t.UAParser=Z):n.amdO?(r=function(){return Z}.call(t,n,t,e))===a||(e.exports=r):typeof i!==s&&(i.UAParser=Z);var Y=typeof i!==s&&(i.jQuery||i.Zepto);if(Y&&!Y.ua){var ee=new Z;Y.ua=ee.getResult(),Y.ua.get=function(){return ee.getUA()},Y.ua.set=function(e){ee.setUA(e);var t=ee.getResult();for(var n in t)Y.ua[n]=t[n]}}}("object"==typeof window?window:this)}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var a=t[r]={exports:{}};return e[r].call(a.exports,a,a.exports,n),a.exports}n.amdO={},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{ActionType:()=>f,AmplitudePlatformName:()=>g,AnalyticsEventImportance:()=>l,AnalyticsQueries:()=>e,AuthStatus:()=>b,ComponentType:()=>m,IThresholdTier:()=>Jt,MetricType:()=>d,PlatformName:()=>v,SessionActions:()=>h,SessionAutomatedEvents:()=>w,SessionRank:()=>y,SubjectType:()=>p,UserTypeCommerce:()=>c,UserTypeInsto:()=>i,UserTypeRetail:()=>t,UserTypeRetailBusinessBanking:()=>s,UserTypeRetailEmployeeInternal:()=>a,UserTypeRetailEmployeePersonal:()=>o,UserTypeWallet:()=>u,automatedEvents:()=>xn,automatedMappingConfig:()=>In,clearMarkEntry:()=>Vn,clearPerformanceMarkEntries:()=>Xn,config:()=>A,createEventConfig:()=>On,createNewSpan:()=>Ln,createNewTrace:()=>Un,device:()=>W,endPerfMark:()=>Jn,exposeExperiment:()=>wn,flushQueue:()=>or,generateUUID:()=>V,getAnalyticsHeaders:()=>sr,getReferrerData:()=>le,getTracingHeaders:()=>An,getTracingId:()=>Dn,getUrlHostname:()=>pe,getUrlParams:()=>me,getUrlPathname:()=>fe,getUserContext:()=>ar,identify:()=>Tn,identifyFlow:()=>xe,identity:()=>H,identityFlow:()=>Se,incrementUjNavigation:()=>an,init:()=>yn,initNextJsTrackPageview:()=>_n,initTrackPageview:()=>kn,isEventKeyFormatValid:()=>we,isSessionEnded:()=>pt,location:()=>re,logEvent:()=>$t,logMetric:()=>Ht,logPageView:()=>on,logTrace:()=>Rn,markNTBT:()=>tn,markStep:()=>nn,markStepOnce:()=>rn,onVisibilityChange:()=>ln,optIn:()=>En,optOut:()=>Sn,perfMark:()=>Wn,persistentData:()=>oe,postMessage:()=>K,recordSessionDuration:()=>pn,removeFromIdentifyFlow:()=>Ee,savePersistentData:()=>st,sendScheduledEvents:()=>Bt,setBreadcrumbs:()=>ie,setConfig:()=>U,setLocation:()=>ae,setPagePath:()=>ve,setPageview:()=>Kt,setPersistentData:()=>se,setSessionStart:()=>dt,setTime:()=>Ue,startPerfMark:()=>Hn,timeStone:()=>Le,useEventLogger:()=>Yn,useLogEventOnMount:()=>tr,usePerformanceMarks:()=>rr});let e=function(e){return e.fbclid="fbclid",e.gclid="gclid",e.msclkid="msclkid",e.ptclid="ptclid",e.ttclid="ttclid",e.utm_source="utm_source",e.utm_medium="utm_medium",e.utm_campaign="utm_campaign",e.utm_term="utm_term",e.utm_content="utm_content",e}({});const t=0,i=1,a=2,o=3,s=4,c=5,u=6;let l=function(e){return e.low="low",e.high="high",e}({}),d=function(e){return e.count="count",e.rate="rate",e.gauge="gauge",e.distribution="distribution",e.histogram="histogram",e}({}),p=function(e){return e.commerce_merchant="commerce_merchant",e.device="device",e.edp_fingerprint_id="edp_fingerprint_id",e.nft_user="nft_user",e.user="user",e.wallet_user="wallet_user",e.uuid="user_uuid",e}({}),m=function(e){return e.unknown="unknown",e.banner="banner",e.button="button",e.card="card",e.chart="chart",e.content_script="content_script",e.dropdown="dropdown",e.link="link",e.page="page",e.modal="modal",e.table="table",e.search_bar="search_bar",e.service_worker="service_worker",e.text="text",e.text_input="text_input",e.tray="tray",e.checkbox="checkbox",e.icon="icon",e}({}),f=function(e){return e.unknown="unknown",e.blur="blur",e.click="click",e.change="change",e.dismiss="dismiss",e.focus="focus",e.hover="hover",e.select="select",e.measurement="measurement",e.move="move",e.process="process",e.render="render",e.scroll="scroll",e.view="view",e.search="search",e.keyPress="keyPress",e}({}),v=function(e){return e.unknown="unknown",e.web="web",e.android="android",e.ios="ios",e.mobile_web="mobile_web",e.tablet_web="tablet_web",e.server="server",e.windows="windows",e.macos="macos",e.extension="extension",e}({}),g=function(e){return e.web="Web",e.ios="iOS",e.android="Android",e}({}),b=function(e){return e[e.notLoggedIn=0]="notLoggedIn",e[e.loggedIn=1]="loggedIn",e}({}),h=function(e){return e.ac="ac",e.af="af",e.ah="ah",e.al="al",e.am="am",e.ar="ar",e.as="as",e}({}),w=function(e){return e.pv="pv",e}({}),y=function(e){return e.xs="xs",e.s="s",e.m="m",e.l="l",e.xl="xl",e.xxl="xxl",e}({});const T="https://analytics-service-dev.cbhq.net",k=3e5,_=5e3,S="analytics-db",E="experiment-exposure-db",x="Analytics SDK:",O=Object.values(e),j="pageview",N="session_duration",I={navigationTiming:{eventName:"perf_navigation_timing"},redirectTime:{eventName:"perf_redirect_time"},RT:{eventName:"perf_redirect_time"},TTFB:{eventName:"perf_time_to_first_byte"},networkInformation:{eventName:"perf_network_information"},storageEstimate:{eventName:"perf_storage_estimate"},FCP:{eventName:"perf_first_contentful_paint"},FID:{eventName:"perf_first_input_delay"},LCP:{eventName:"perf_largest_contentful_paint"},CLS:{eventName:"perf_cumulative_layout_shift"},TBT:{eventName:"perf_total_blocking_time"},NTBT:{eventName:"perf_navigation_total_blocking_time"},INP:{eventName:"perf_interact_to_next_paint"},ET:{eventName:"perf_element_timing"},userJourneyStep:{eventName:"perf_user_journey_step"}},P="1",M="web";function B(){return B=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},B.apply(this,arguments)}const C=/^(https?:\\/\\/)/;function D(e){return{eventsEndpoint:e+"/amp",metricsEndPoint:e+"/metrics",exposureEndpoint:e+"/track-exposures",tracesEndpoint:e+"/traces"}}const A=B({authCookie:"logged_in",amplitudeApiKey:"",batchEventsPeriod:_,batchEventsThreshold:30,batchMetricsPeriod:_,batchMetricsThreshold:30,batchTracesPeriod:_,batchTracesThreshold:30,headers:{},interactionManager:null,isAlwaysAuthed:!1,isProd:!1,isInternalApplication:!1,onError:(e,t)=>{console.error(x,e,t)},platform:v.unknown,projectName:"",ricTimeoutScheduleEvent:1e3,ricTimeoutSetDevice:500,showDebugLogging:!1,trackUserId:!1,version:null,apiEndpoint:T},D(T),{steps:{}}),L=[].reduce(((e,t)=>n=>e(t(n))),(e=>{if(!e.isProd)return e.isInternalApplication?(e.apiEndpoint="https://analytics-service-internal-dev.cbhq.net",B({},e,D(e.apiEndpoint))):e;const t=(e=>e.apiEndpoint?C.test(e.apiEndpoint)?e.apiEndpoint:\`https://\${e.apiEndpoint}\`:e.isInternalApplication?"https://analytics-service-internal.cbhq.net":"https://as.coinbase.com")(e);return B({},e,{apiEndpoint:t},D(t))})),U=e=>{const{batchEventsThreshold:t,batchMetricsThreshold:n,batchTracesThreshold:r}=e,i=[t,n,r];for(const e of i)if((e||0)>30){console.warn("You are setting the threshhold for the batch limit to be greater than 30. This may cause request overload.");break}Object.assign(A,L(e))},R=[v.web,v.mobile_web,v.tablet_web];function q(){return"android"===A.platform}function F(){return"ios"===A.platform}function z(){return R.includes(A.platform)}function K(e){if(z()&&navigator&&"serviceWorker"in navigator&&navigator.serviceWorker.controller)try{navigator.serviceWorker.controller.postMessage(e)}catch(e){e instanceof Error&&A.onError(e)}}var $=n(353),Q=n.n($);const W={amplitudeOSName:null,amplitudeOSVersion:null,amplitudeDeviceModel:null,amplitudePlatform:null,browserName:null,browserMajor:null,osName:null,userAgent:null,width:null,height:null},H={countryCode:null,deviceId:null,device_os:null,isOptOut:!1,languageCode:null,locale:null,jwt:null,session_lcc_id:null,userAgent:null,userId:null},V=e=>e?(e^16*Math.random()>>e/4).toString(16):"10000000-1000-4000-8000-100000000000".replace(/[018]/g,V),J=()=>A.isAlwaysAuthed||!!H.userId,X=()=>{const e={};return H.countryCode&&(e.country_code=H.countryCode),e},G=()=>{const{platform:e}=A;if(e===v.web)switch(!0){case window.matchMedia("(max-width: 560px)").matches:return v.mobile_web;case window.matchMedia("(max-width: 1024px, min-width: 561px)").matches:return v.tablet_web}return e},Z=()=>{var e,t,n,r,i;z()?("requestIdleCallback"in window?window.requestIdleCallback(ne,{timeout:A.ricTimeoutSetDevice}):ne(),W.amplitudePlatform=g.web,W.userAgent=(null==(e=window)||null==(e=e.navigator)?void 0:e.userAgent)||null,ee({height:null!=(t=null==(n=window)?void 0:n.innerHeight)?t:null,width:null!=(r=null==(i=window)?void 0:i.innerWidth)?r:null})):F()?(W.amplitudePlatform=g.ios,W.userAgent=H.userAgent,W.userAgent&&ne()):q()&&(W.userAgent=H.userAgent,W.amplitudePlatform=g.android,W.userAgent&&ne())},Y=e=>{Object.assign(H,e),z()&&K({identity:{isAuthed:!!H.userId,locale:H.locale||null}})},ee=e=>{W.height=e.height,W.width=e.width},te=()=>{U({platform:G()}),z()&&K({config:{platform:A.platform}})},ne=()=>{var e;performance.mark&&performance.mark("ua_parser_start");const t=new(Q())(null!=(e=W.userAgent)?e:"").getResult();W.browserName=t.browser.name||null,W.browserMajor=t.browser.major||null,W.osName=t.os.name||null,W.amplitudeOSName=W.browserName,W.amplitudeOSVersion=W.browserMajor,W.amplitudeDeviceModel=W.osName,K({device:{browserName:W.browserName,osName:W.osName}}),performance.mark&&(performance.mark("ua_parser_end"),performance.measure("ua_parser","ua_parser_start","ua_parser_end"))},re={breadcrumbs:[],initialUAAData:{},pageKey:"",pageKeyRegex:{},pagePath:"",prevPageKey:"",prevPagePath:""};function ie(e){Object.assign(re,{breadcrumbs:e})}function ae(e){Object.assign(re,e)}const oe={eventId:0,sequenceNumber:0,sessionId:0,lastEventTime:0,sessionStart:0,sessionUUID:null,userId:null,ac:0,af:0,ah:0,al:0,am:0,ar:0,as:0,pv:0};function se(e){Object.assign(oe,e)}function ce(){var e,t;return null!=(e=null==(t=document)?void 0:t.referrer)?e:""}function ue(){return ue=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ue.apply(this,arguments)}const le=()=>{const e=ce();if(!e)return{};const t=new URL(e);return t.hostname===pe()?{}:{referrer:e,referring_domain:t.hostname}},de=()=>{const e=new URLSearchParams(me()),t={};return O.forEach((n=>{e.has(n)&&(t[n]=(e.get(n)||"").toLowerCase())})),t},pe=()=>{var e;return(null==(e=window)||null==(e=e.location)?void 0:e.hostname)||""},me=()=>{var e;return(null==(e=window)||null==(e=e.location)?void 0:e.search)||""},fe=()=>{var e;return(null==(e=window)||null==(e=e.location)?void 0:e.pathname)||""},ve=()=>{const e=A.overrideWindowLocation?re.pagePath:fe()+me();e&&e!==re.pagePath&&(e!==re.pagePath&&ge(),re.pagePath=e,re.pageKeyRegex&&Object.keys(re.pageKeyRegex).some((e=>{if(re.pageKeyRegex[e].test(re.pagePath))return re.pageKey=e,!0})))},ge=()=>{if(z()){const e=ce();if(!re.prevPagePath&&e){const t=new URL(e);if(t.hostname===pe())return void(re.prevPagePath=t.pathname)}}re.prevPagePath=re.pagePath,re.prevPageKey=re.pageKey},be=e=>{z()&&Object.assign(e,z()?(Object.keys(re.initialUAAData).length>0||(new URLSearchParams(me()),re.initialUAAData=ue({},(()=>{const e={};return O.forEach((t=>{oe[t]&&(e[t]=oe[t])})),e})(),de(),le())),re.initialUAAData):re.initialUAAData)},he=/^[a-zd]+(_[a-zd]+)*$/;function we(e){return he.test(e)}function ye(){return ye=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ye.apply(this,arguments)}const Te=["action","component_type","component_name","context","logging_id"],ke=["num_non_hardware_accounts","ujs"],_e="ujs_",Se={};function Ee(e){e.forEach((e=>{ke.includes(e)&&delete Se[e]}))}function xe(e){var t;const n=Object.entries(e).reduce(((e,t)=>{const[n,r]=t;return!Te.includes(n)&&ke.includes(n)?we(n)?ye({},e,{[n]:r}):(A.onError(new Error("IdentityFlow property names must have snake case format"),{[n]:r}),e):e}),{});null!=(t=n.ujs)&&t.length&&(n.ujs=n.ujs.map((e=>\`\${_e}\${e}\`))),Object.assign(Se,n)}function Oe(){return A.platform!==v.unknown||(A.onError(new Error("SDK platform not initialized")),!1)}const je={eventsQueue:[],eventsScheduled:!1,metricsQueue:[],metricsScheduled:!1,tracesQueue:[],tracesScheduled:!1};function Ne(e){Object.assign(je,e)}const Ie={ac:0,af:0,ah:0,al:0,am:0,ar:0,as:0,pv:0,sqs:0},Pe={ac:20,af:5,ah:1,al:1,am:0,ar:10,as:20},Me={pv:25},Be={xs:0,s:1,m:1,l:2,xl:2,xxl:2},Ce=e=>e<15?y.xs:e<60?y.s:e<240?y.m:e<960?y.l:e<3840?y.xl:y.xxl,De=e=>{Object.assign(Ie,e)};function Ae(){return(new Date).getTime()}const Le={timeStart:Ae(),timeOnPagePath:0,timeOnPageKey:0,prevTimeOnPagePath:0,prevTimeOnPageKey:0,sessionDuration:0,sessionEnd:0,sessionStart:0,prevSessionDuration:0};function Ue(e){Object.assign(Le,e)}const Re=(e,t)=>t.some((t=>e instanceof t));let qe,Fe;const ze=new WeakMap,Ke=new WeakMap,$e=new WeakMap,Qe=new WeakMap,We=new WeakMap;let He={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return Ke.get(e);if("objectStoreNames"===t)return e.objectStoreNames||$e.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return Je(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function Ve(e){return"function"==typeof e?(t=e)!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(Fe||(Fe=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(t)?function(...e){return t.apply(Xe(this),e),Je(ze.get(this))}:function(...e){return Je(t.apply(Xe(this),e))}:function(e,...n){const r=t.call(Xe(this),e,...n);return $e.set(r,e.sort?e.sort():[e]),Je(r)}:(e instanceof IDBTransaction&&function(e){if(Ke.has(e))return;const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("complete",i),e.removeEventListener("error",a),e.removeEventListener("abort",a)},i=()=>{t(),r()},a=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",i),e.addEventListener("error",a),e.addEventListener("abort",a)}));Ke.set(e,t)}(e),Re(e,qe||(qe=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,He):e);var t}function Je(e){if(e instanceof IDBRequest)return function(e){const t=new Promise(((t,n)=>{const r=()=>{e.removeEventListener("success",i),e.removeEventListener("error",a)},i=()=>{t(Je(e.result)),r()},a=()=>{n(e.error),r()};e.addEventListener("success",i),e.addEventListener("error",a)}));return t.then((t=>{t instanceof IDBCursor&&ze.set(t,e)})).catch((()=>{})),We.set(t,e),t}(e);if(Qe.has(e))return Qe.get(e);const t=Ve(e);return t!==e&&(Qe.set(e,t),We.set(t,e)),t}const Xe=e=>We.get(e),Ge=["get","getKey","getAll","getAllKeys","count"],Ze=["put","add","delete","clear"],Ye=new Map;function et(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(Ye.get(t))return Ye.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,i=Ze.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!i&&!Ge.includes(n))return;const a=async function(e,...t){const a=this.transaction(e,i?"readwrite":"readonly");let o=a.store;return r&&(o=o.index(t.shift())),(await Promise.all([o[n](...t),i&&a.done]))[0]};return Ye.set(t,a),a}var tt;tt=He,He={...tt,get:(e,t,n)=>et(e,t)||tt.get(e,t,n),has:(e,t)=>!!et(e,t)||tt.has(e,t)};const nt={isReady:!1,idbKeyval:null};function rt(e){Object.assign(nt,e)}const it={},at=async e=>{if(!nt.idbKeyval)return Promise.resolve(null);try{return await nt.idbKeyval.get(e)}catch(e){return A.onError(new Error("IndexedDB:Get:InternalError")),Promise.resolve(null)}},ot=async(e,t)=>{if(nt.idbKeyval)try{await nt.idbKeyval.set(e,t)}catch(e){A.onError(new Error("IndexedDB:Set:InternalError"))}},st=()=>{"server"!==A.platform&&(se({sessionStart:Le.sessionStart,ac:Ie.ac,af:Ie.af,ah:Ie.ah,al:Ie.al,am:Ie.am,ar:Ie.ar,as:Ie.as,pv:Ie.pv}),H.userId&&se({userId:H.userId}),ot(S,oe))},ct="rgb(5,177,105)",ut=e=>{const{metricName:t,data:n}=e,r=e.importance||l.low;if(!A.showDebugLogging||!console)return;const i=\`%c \${x}\`,a=\`color:\${ct};font-size:11px;\`,o=\`Importance: \${r}\`;console.group(i,a,t,o),n.forEach((e=>{e.event_type?console.log(e.event_type,e):console.log(e)})),console.groupEnd()},lt=e=>{const{metricName:t,data:n}=e,r=e.importance||l.low;if(!A.showDebugLogging||!console)return;const i=\`color:\${ct};font-size:11px;\`,a=\`%c \${x}\`,o=\`Importance: \${r}\`;console.log(a,i,t,n,o)},dt=()=>{const e=Ae();oe.sessionId&&oe.lastEventTime&&oe.sessionUUID&&!pt(e)||(oe.sessionId=e,oe.sessionUUID=V(),Ue({sessionStart:e}),lt({metricName:"Started new session:",data:{persistentData:oe,timeStone:Le}})),oe.lastEventTime=e},pt=e=>e-oe.lastEventTime>18e5;function mt(){return mt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mt.apply(this,arguments)}const ft=e=>{var t;(e=>{switch(e.action){case f.click:Ie.ac+=1;break;case f.focus:Ie.af+=1;break;case f.hover:Ie.ah+=1;break;case f.move:Ie.am+=1;break;case f.scroll:Ie.al+=1;break;case f.search:Ie.ar+=1;break;case f.select:Ie.as+=1}})(t=e),t.event_type!==j?t.event_type===N&&((e=>{if(!e.session_rank)return;const t=e.session_rank;Object.values(h).forEach((e=>{Ie.sqs+=Ie[e]*Pe[e]})),Object.values(w).forEach((e=>{Ie.sqs+=Ie[e]*Me[e]})),Ie.sqs*=Be[t]})(t),Object.assign(t,Ie),De({ac:0,af:0,ah:0,al:0,am:0,ar:0,as:0,pv:0,sqs:0})):Ie.pv+=1;const n=e.event_type;delete e.event_type;const r=e.deviceId?e.deviceId:null,i=e.timestamp;return delete e.timestamp,se({eventId:oe.eventId+1}),se({sequenceNumber:oe.sequenceNumber+1}),dt(),st(),{device_id:H.deviceId||r||null,user_id:H.userId,timestamp:i,event_id:oe.eventId,session_id:oe.sessionId||-1,event_type:n,version_name:A.version||null,platform:W.amplitudePlatform,os_name:W.amplitudeOSName,os_version:W.amplitudeOSVersion,device_model:W.amplitudeDeviceModel,language:H.languageCode,event_properties:mt({},e,{session_uuid:oe.sessionUUID,height:W.height,width:W.width}),user_properties:X(),uuid:V(),library:{name:"@cbhq/client-analytics",version:"10.6.0"},sequence_number:oe.sequenceNumber,user_agent:W.userAgent||H.userAgent}},vt=e=>e.map((e=>ft(e)));function gt(){return gt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gt.apply(this,arguments)}const bt=e=>e.map((e=>(e=>{const t=e.tags||{},n=gt({authed:J()?"true":"false",platform:A.platform},t,{project_name:A.projectName,version_name:A.version||null});return{metric_name:e.metricName,page_path:e.pagePath||null,value:e.value,tags:n,type:e.metricType}})(e))),ht=e=>0!==je.metricsQueue.length&&(je.metricsQueue.length>=A.batchMetricsThreshold||(je.metricsScheduled||(je.metricsScheduled=!0,setTimeout((()=>{je.metricsScheduled=!1,e(bt(je.metricsQueue)),je.metricsQueue=[]}),A.batchMetricsPeriod)),!1)),wt=e=>0!==je.tracesQueue.length&&(je.tracesQueue.length>=A.batchTracesThreshold||(je.tracesScheduled||(je.tracesScheduled=!0,setTimeout((()=>{je.tracesScheduled=!1,e(je.tracesQueue),je.tracesQueue=[]}),A.batchTracesPeriod)),!1)),yt=e=>{var t;z()&&null!=(t=window)&&t.requestIdleCallback?window.requestIdleCallback(e,{timeout:A.ricTimeoutScheduleEvent}):(q()||F())&&A.interactionManager?A.interactionManager.runAfterInteractions(e):e()};function Tt(){return Tt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Tt.apply(this,arguments)}const kt="application/x-www-form-urlencoded; charset=UTF-8",_t=e=>{const{data:t,importance:n,isJSON:r,onError:i,url:a}=e,o=r?"application/json":kt,s=n||l.low,c=r?JSON.stringify(t):new URLSearchParams(t).toString();function u(){const e=new XMLHttpRequest;e.open("POST",a,!0),Object.keys(A.headers||{}).forEach((t=>{e.setRequestHeader(t,A.headers[t])})),e.setRequestHeader("Content-Type",kt),H.jwt&&e.setRequestHeader("authorization",\`Bearer \${H.jwt}\`),e.send(c)}if(!z()||r||!("sendBeacon"in navigator)||s!==l.low||A.headers&&0!==Object.keys(A.headers).length)if(z()&&!r)u();else{const e=Tt({},A.headers,{"Content-Type":o});H.jwt&&(e.Authorization=\`Bearer \${H.jwt}\`),fetch(a,{method:"POST",mode:"no-cors",headers:e,body:c}).catch((e=>{i(e,{context:"AnalyticsSDKApiError"})}))}else{const e=new Blob([c],{type:kt});try{navigator.sendBeacon.bind(navigator)(a,e)||u()}catch(e){console.error(e),u()}}};var St=n(762),Et=n.n(St);const xt=(e,t,n)=>{const r=e||"";return Et()("2"+r+t+n)};function Ot(){return Ot=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ot.apply(this,arguments)}class jt extends Error{constructor(e){super(e),this.name="CircularJsonReference",this.message=e,"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error(e).stack}}class Nt extends jt{constructor(...e){super(...e),this.name="DomReferenceInAnalyticsEvent"}}function It(){return It=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},It.apply(this,arguments)}const Pt=(e,t=l.low)=>{var n;e&&je.eventsQueue.push(e),nt.isReady&&(!A.trackUserId||H.userId?(t===l.high||(n=Mt,0!==je.eventsQueue.length&&(je.eventsQueue.length>=A.batchEventsThreshold||(je.eventsScheduled||(je.eventsScheduled=!0,setTimeout((()=>{je.eventsScheduled=!1,n(vt(je.eventsQueue)),je.eventsQueue=[]}),A.batchEventsPeriod)),0))))&&Bt():je.eventsQueue.length>10&&(A.trackUserId=!1,A.onError(new Error("userId not set in Logged-in"))))},Mt=(e,t=l.low)=>{if(H.isOptOut||0===e.length)return;let n;try{n=JSON.stringify(e)}catch(t){const r=e.map((e=>e.event_type)).join(", "),[i,a]=(e=>{try{const n=[];for(const r of e){const e=Ot({},r);r.event_properties&&(e.event_properties=Ot({},e.event_properties,{currentTarget:null,target:null,relatedTarget:null,_dispatchInstances:null,_targetInst:null,view:(t=r.event_properties.view,["string","number","boolean"].includes(typeof t)?r.event_properties.view:null)})),n.push(e)}return[!0,JSON.stringify(n)]}catch(e){return[!1,""]}var t})(e);if(!i)return void A.onError(new jt(t instanceof Error?t.message:"unknown"),{listEventType:r});n=a,A.onError(new Nt("Found DOM element reference"),{listEventType:r,stringifiedEventData:n})}const r=Ae().toString(),i=It({},{e:n,v:"2",upload_time:r},{client:A.amplitudeApiKey,checksum:xt(A.amplitudeApiKey,n,r)});_t({url:A.eventsEndpoint,data:i,importance:t,onError:A.onError}),ut({metricName:"Batch Events",data:e,importance:t})},Bt=()=>{Mt(vt(je.eventsQueue)),Ne({eventsQueue:[]})};function Ct(){return Ct=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ct.apply(this,arguments)}const Dt=Object.values(f),At=Object.values(m),Lt=e=>Dt.includes(e)?e:f.unknown,Ut=e=>At.includes(e)?e:m.unknown,Rt=(e,t,n)=>{const r={auth:J()?b.loggedIn:b.notLoggedIn,action:Lt(e),component_type:Ut(t),logging_id:n,platform:A.platform,project_name:A.projectName};return"number"==typeof H.userTypeEnum&&(r.user_type_enum=H.userTypeEnum),r},qt=e=>{const t=Ae();if(!e)return A.onError(new Error("missing logData")),Ct({},Rt(f.unknown,m.unknown),{locale:H.locale,session_lcc_id:H.session_lcc_id,timestamp:t,time_start:Le.timeStart});const n=Ct({},e,Rt(e.action,e.componentType,e.loggingId),{locale:H.locale,session_lcc_id:H.session_lcc_id,timestamp:t,time_start:Le.timeStart});return delete n.componentType,delete n.loggingId,n},Ft={blacklistRegex:[],isEnabled:!1};function zt(){return{page_key:re.pageKey,page_path:re.pagePath,prev_page_key:re.prevPageKey,prev_page_path:re.prevPagePath}}function Kt(e){Object.assign(Ft,e)}function $t(e,t,n=l.low){if(H.isOptOut)return;if(!Oe())return;const r=qt(t);!function(e){Ft.isEnabled&&(ve(),Object.assign(e,zt()))}(r),be(r),function(e){Object.keys(Se).length>0&&Object.assign(e,Se)}(r),r.has_double_fired=!1,r.event_type=e,n===l.high?Pt(r,n):yt((()=>{Pt(r)}))}function Qt(e,t=!1){t?_t({url:A.metricsEndPoint,data:{metrics:e},isJSON:!0,onError:A.onError}):yt((()=>{_t({url:A.metricsEndPoint,data:{metrics:e},isJSON:!0,onError:A.onError})})),ut({metricName:"Batch Metrics",data:e})}function Wt(){return Wt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Wt.apply(this,arguments)}function Ht(e){if(!Oe())return;v.server!==A.platform&&!e.pagePath&&re.pagePath&&(e.pagePath=re.pagePath);const t=Object.keys(Se).length?Wt({},e.tags,Se):e.tags;t&&Object.assign(e,{tags:t}),je.metricsQueue.push(e),ht(Qt)&&(Qt(bt(je.metricsQueue)),je.metricsQueue=[])}function Vt(){return Vt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Vt.apply(this,arguments)}let Jt=function(e){return e.instant="instant",e.quick="quick",e.moderate="moderate",e.slow="slow",e.unavoidable="unavoidable",e}({});function Xt(e){return e.toLowerCase()}let Gt={};const Zt=(e,t)=>{null!=A&&A.onMarkStep&&A.onMarkStep(e,t),xe({ujs:t})};let Yt;const en={Perfume:()=>{},markStep:e=>{},markStepOnce:e=>{},incrementUjNavigation:()=>{}},tn=()=>{z()&&Yt&&Yt.markNTBT&&Yt.markNTBT()},nn=e=>{z()&&Yt&&en.markStep&&en.markStep(e)},rn=e=>{z()&&Yt&&en.markStepOnce&&en.markStepOnce(e)},an=()=>{z()&&Yt&&en.incrementUjNavigation&&en.incrementUjNavigation()};function on(e={callMarkNTBT:!0}){"unknown"!==A.platform&&(Ft.blacklistRegex.some((e=>e.test(fe())))||($t(j,{action:f.render,componentType:m.page}),e.callMarkNTBT&&tn()))}let sn=!1,cn=!1;const un=e=>{sn=!e.persisted},ln=(e,t="hidden",n=!1)=>{cn||(addEventListener("pagehide",un),addEventListener("beforeunload",(()=>{})),cn=!0),addEventListener("visibilitychange",(({timeStamp:n})=>{document.visibilityState===t&&e({timeStamp:n,isUnloading:sn})}),{capture:!0,once:n})},dn=36e3;function pn(){const e=pt(Ae());if(e&&(O.forEach((e=>{oe[e]&&delete oe[e]})),st()),!oe.lastEventTime||!Le.sessionStart||!e)return;const t=Math.round((oe.lastEventTime-Le.sessionStart)/1e3);if(t<1||t>dn)return;const n=Ce(t);$t(N,{action:f.measurement,componentType:m.page,session_duration:t,session_end:oe.lastEventTime,session_start:Le.sessionStart,session_rank:n})}function mn(){return mn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mn.apply(this,arguments)}const fn=[],vn=[],gn=()=>{const e=fn.shift();e&&e()},bn=()=>{const e=vn.shift();e&&e()};let hn={};function wn(e){const t=function(e){return{test_name:e.testName,group_name:e.group,subject_id:e.subjectId,exposed_at:Ae(),subject_type:e.subjectType,platform:A.platform}}(e);hn[e.testName]=hn[e.testName]||0,hn[e.testName]+k>Ae()?lt({metricName:\`Event: exposeExperiment \${e.testName} not sent\`,data:t}):(hn[e.testName]=Ae(),ot(E,hn),lt({metricName:\`Event: exposeExperiment \${e.testName} sent\`,data:t}),_t({url:A.exposureEndpoint,data:[t],onError:(t,n)=>{hn[e.testName]=0,ot(E,hn),A.onError(t,n)},isJSON:!0,importance:l.high}))}const yn=e=>{var t,r,i;U(e),z()&&(H.languageCode=(null==(t=navigator)?void 0:t.languages[0])||(null==(r=navigator)?void 0:r.language)||""),te(),(()=>{var e;if(z()&&null!=(e=window)&&e.indexedDB){const e=function(e,t,{blocked:n,upgrade:r,blocking:i,terminated:a}={}){const o=indexedDB.open(e,t),s=Je(o);return r&&o.addEventListener("upgradeneeded",(e=>{r(Je(o.result),e.oldVersion,e.newVersion,Je(o.transaction),e)})),n&&o.addEventListener("blocked",(e=>n(e.oldVersion,e.newVersion,e))),s.then((e=>{a&&e.addEventListener("close",(()=>a())),i&&e.addEventListener("versionchange",(e=>i(e.oldVersion,e.newVersion,e)))})).catch((()=>{})),s}("keyval-store",1,{upgrade(e){e.createObjectStore("keyval")}});rt({idbKeyval:{get:async t=>(await e).get("keyval",t),set:async(t,n)=>(await e).put("keyval",n,t),delete:async t=>(await e).delete("keyval",t),keys:async()=>(await e).getAllKeys("keyval")}})}else rt({idbKeyval:{get:async e=>new Promise((t=>{t(it[e])})),set:async(e,t)=>new Promise((n=>{it[e]=t,n(e)})),delete:async e=>new Promise((()=>{delete it[e]})),keys:async()=>new Promise((e=>{e(Object.keys(it))}))}})})(),lt({metricName:"Initialized Analytics:",data:{deviceId:H.deviceId}}),fn.push((()=>{Pt()})),(async()=>{const e=await at(S);rt({isReady:!0}),gn(),e&&(bn(),se({eventId:e.eventId||oe.eventId,sequenceNumber:e.sequenceNumber||oe.sequenceNumber,sessionId:e.sessionId||oe.sessionId,lastEventTime:e.lastEventTime||oe.lastEventTime,sessionUUID:e.sessionUUID||oe.sessionUUID}),function(e){se(mn({},function(e){const t={};return O.forEach((n=>{e[n]&&(t[n]=e[n])})),t}(e),de()))}(e),Ue({sessionStart:e.sessionStart||oe.sessionStart}),De({ac:e.ac||Ie.ac,af:e.af||Ie.af,ah:e.ah||Ie.ah,al:e.al||Ie.al,am:e.am||Ie.am,ar:e.ar||Ie.ar,as:e.as||Ie.as,pv:e.pv||Ie.pv}),A.trackUserId&&Y({userId:e.userId||H.userId}),pn(),lt({metricName:"Initialized Analytics IndexedDB:",data:e}))})(),async function(){at(E).then((e=>{hn=null!=e?e:{}})).catch((e=>{e instanceof Error&&A.onError(e)}))}(),Z(),z()&&(ln((()=>{se({lastEventTime:Ae()}),st(),Bt()}),"hidden"),ln((()=>{pn()}),"visible")),z()&&(i=()=>{var e,t,n,r;te(),ee({width:null!=(e=null==(t=window)?void 0:t.innerWidth)?e:null,height:null!=(n=null==(r=window)?void 0:r.innerHeight)?n:null})},addEventListener("resize",(()=>{requestAnimationFrame((()=>{i()}))}))),(()=>{if(z())try{const e=n(2);en.markStep=e.markStep,en.markStepOnce=e.markStepOnce,en.incrementUjNavigation=e.incrementUjNavigation,Yt=new e.Perfume({analyticsTracker:e=>{const{data:t,attribution:n,metricName:r,navigatorInformation:i,rating:a}=e,o=I[r],s=(null==n?void 0:n.category)||null;if(!o&&!s)return;const c=(null==i?void 0:i.deviceMemory)||0,u=(null==i?void 0:i.hardwareConcurrency)||0,l=(null==i?void 0:i.isLowEndDevice)||!1,p=(null==i?void 0:i.isLowEndExperience)||!1,v=(null==i?void 0:i.serviceWorkerStatus)||"unsupported",g=Vt({deviceMemory:c,hardwareConcurrency:u,isLowEndDevice:l,isLowEndExperience:p,serviceWorkerStatus:v},Gt),b={is_low_end_device:l,is_low_end_experience:p,page_key:re.pageKey||"",save_data:t.saveData||!1,service_worker:v,is_perf_metric:!0};if("navigationTiming"===r)t&&"number"==typeof t.redirectTime&&Ht({metricName:I.redirectTime.eventName,metricType:d.histogram,tags:b,value:t.redirectTime||0});else if("TTFB"===r)$t(o.eventName,Vt({action:f.measurement,componentType:m.page,duration:t||null,vitalsScore:a||null},g)),Ht({metricName:I.TTFB.eventName,metricType:d.histogram,tags:Vt({},b),value:t}),a&&Ht({metricName:\`perf_web_vitals_ttfb_\${a}\`,metricType:d.count,tags:b,value:1});else if("networkInformation"===r)null!=t&&t.effectiveType&&(Gt=t,$t(o.eventName,{action:f.measurement,componentType:m.page,networkInformationDownlink:t.downlink,networkInformationEffectiveType:t.effectiveType,networkInformationRtt:t.rtt,networkInformationSaveData:t.saveData,navigatorDeviceMemory:c,navigatorHardwareConcurrency:u}));else if("storageEstimate"===r)$t(o.eventName,Vt({action:f.measurement,componentType:m.page},t,g)),Ht({metricName:"perf_storage_estimate_caches",metricType:d.histogram,tags:b,value:t.caches}),Ht({metricName:"perf_storage_estimate_indexed_db",metricType:d.histogram,tags:b,value:t.indexedDB});else if("CLS"===r)$t(o.eventName,Vt({action:f.measurement,componentType:m.page,score:100*t||null,vitalsScore:a||null},g)),a&&Ht({metricName:\`perf_web_vitals_cls_\${a}\`,metricType:d.count,tags:b,value:1});else if("FID"===r){const e=(null==n?void 0:n.performanceEntry)||null,r=parseInt((null==e?void 0:e.processingStart)||"");$t(o.eventName,Vt({action:f.measurement,componentType:m.page,duration:t||null,processingStart:null!=e&&e.processingStart?r:null,startTime:null!=e&&e.startTime?parseInt(e.startTime):null,vitalsScore:a||null},g)),a&&Ht({metricName:\`perf_web_vitals_fidVitals_\${a}\`,metricType:d.count,tags:b,value:1})}else"userJourneyStep"===r?($t("perf_user_journey_step",Vt({action:f.measurement,componentType:m.page,duration:t||null,rating:null!=a?a:null,step_name:(null==n?void 0:n.stepName)||""},g)),Ht({metricName:\`user_journey_step.\${A.projectName}.\${A.platform}.\${(null==n?void 0:n.stepName)||""}_vitals_\${a}\`,metricType:d.count,tags:b,value:1}),Ht({metricName:\`user_journey_step.\${A.projectName}.\${A.platform}.\${(null==n?void 0:n.stepName)||""}\`,metricType:d.distribution,tags:b,value:t||null})):I[r]&&t&&($t(o.eventName,Vt({action:f.measurement,componentType:m.page,duration:t||null,vitalsScore:a||null},g)),a&&(Ht({metricName:\`perf_web_vitals_\${Xt(r)}_\${a}\`,metricType:d.count,tags:b,value:1}),"LCP"===r&&Ht({metricName:\`perf_web_vitals_\${Xt(r)}\`,metricType:d.distribution,tags:b,value:t})))},maxMeasureTime:3e4,steps:A.steps,onMarkStep:Zt})}catch(e){e instanceof Error&&A.onError(e)}})()},Tn=e=>{Y(e),e.userAgent&&Z(),lt({metricName:"Identify:",data:{countryCode:H.countryCode,deviceId:H.deviceId,userId:H.userId}})},kn=({blacklistRegex:e,pageKeyRegex:t,browserHistory:n})=>{Kt({blacklistRegex:e||[],isEnabled:!0}),ae({pageKeyRegex:t}),on({callMarkNTBT:!1}),n.listen((()=>{on()}))},_n=({blacklistRegex:e,pageKeyRegex:t,nextJsRouter:n})=>{Kt({blacklistRegex:e||[],isEnabled:!0}),ae({pageKeyRegex:t}),on({callMarkNTBT:!1}),n.events.on("routeChangeComplete",(()=>{on()}))},Sn=()=>{Y({isOptOut:!0}),ot(S,{})},En=()=>{Y({isOptOut:!1})},xn={Button:{label:"cb_button",uuid:"e921a074-40e6-4371-8700-134d5cd633e6",componentType:m.button}};function On(e,t,n){return{componentName:e,actions:t,data:n}}function jn(){return jn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jn.apply(this,arguments)}function Nn(e,t,n){const{componentName:r,data:i}=n;$t(e.label,jn({componentType:e.componentType,action:t,loggingId:e.uuid,component_name:r},i))}const In={actionMapping:{onPress:f.click,onHover:f.hover},handlers:{Button:{[f.click]:e=>Nn(xn.Button,f.click,e),[f.hover]:e=>Nn(xn.Button,f.hover,e)}}};function Pn(e,t=!1){t?_t({url:A.tracesEndpoint,data:{traces:e},isJSON:!0,onError:A.onError}):yt((()=>{_t({url:A.tracesEndpoint,data:{traces:e},isJSON:!0,onError:A.onError})})),ut({metricName:"Batch Traces",data:e})}function Mn(){return Mn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Mn.apply(this,arguments)}const Bn=1e6;function Cn(e){return e*Bn}function Dn(e=function(){var e;return null==(e=window)?void 0:e.crypto}()){const t=new Uint32Array(2);return null==e||e.getRandomValues(t),((BigInt(t[0])<<BigInt(32))+BigInt(t[1])).toString()}function An(e,t){return{"x-datadog-origin":"rum","x-datadog-parent-id":t,"x-datadog-sampling-priority":"1","x-datadog-trace-id":e}}function Ln(e){var t;const{name:n,traceId:r,spanId:i,start:a,duration:o,resource:s,meta:c}=e;return{duration:o?Cn(o):0,name:n,resource:s,service:A.projectName,span_id:null!=i?i:Dn(),start:a?Cn(a):0,trace_id:null!=r?r:Dn(),parent_id:P,type:M,meta:Mn({platform:A.platform},re.pageKey?{page_key:re.pageKey}:{},null!=(t=Se.ujs)&&t.length?{last_ujs:Se.ujs[Se.ujs.length-1]}:{},null!=c?c:{})}}function Un(e){return[Ln(e)]}function Rn(e,t){Oe()&&function(e){return e.length>0}(e)&&(t&&function(e,t){e.forEach((e=>function(e,t){const n=Mn({},e.meta,t.meta),r={start:t.start?Cn(t.start):e.start,duration:t.duration?Cn(t.duration):e.duration};Object.assign(e,t,Mn({meta:n},r))}(e,t)))}(e,t),je.tracesQueue.push(e),wt(Pn)&&(Pn(je.tracesQueue),je.tracesQueue=[]))}function qn(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}function Fn(){return Fn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fn.apply(this,arguments)}function zn(){return void 0!==typeof window&&"performance"in window&&"mark"in performance&&"getEntriesByName"in performance}function Kn(e,t){return\`perf_\${e}\${null!=t&&t.label?\`_\${t.label}\`:""}\`}function $n(e,t,n){return\`\${Kn(e,n)}__\${t}\`}let Qn={};function Wn(e,t,n){if(!zn())return;const r=$n(e,t,n);if(performance.mark(r),"end"===t){const t=Kn(e,n);!function(e,t,n){try{performance.measure(e,t,n)}catch(e){A.onError(e)}}(t,$n(e,"start",n),r);const i=performance.getEntriesByName(t).pop();i&&Ht(Fn({metricName:e,metricType:d.distribution,value:i.duration},null!=n&&n.tags?{tags:n.tags}:{}))}}function Hn(e,t){if(!zn())return;const n=$n(e,"start",t);Qn[n]||(Wn(e,"start",t),Qn[n]=!0)}function Vn(e,t){const n=$n(e,"start",t),r=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(Qn,[n].map(qn));Qn=r}function Jn(e,t){if(!zn())return;const n=$n(e,"start",t);Qn[n]&&(Wn(e,"end",t),Vn(e,t))}function Xn(){zn()&&(performance.clearMarks(),Qn={})}var Gn=n(784);function Zn(){return Zn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zn.apply(this,arguments)}function Yn(e,t,n=l.low){const r=(0,Gn.useRef)(t);return(0,Gn.useEffect)((()=>{r.current=t}),[t]),(0,Gn.useCallback)((t=>{$t(e,Zn({},r.current,t),n)}),[e,n])}function er(){return er=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},er.apply(this,arguments)}function tr(e,t,n=l.low){(0,Gn.useEffect)((()=>{const r=er({},t,{action:f.render});$t(e,r,n)}),[])}function nr(){return nr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},nr.apply(this,arguments)}const rr=function(e,t){return{markStartPerf:(0,Gn.useCallback)((()=>Hn(e,t)),[e,t]),markEndPerf:(0,Gn.useCallback)((n=>Jn(e,nr({},t,n))),[e,t])}};function ir(){return ir=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ir.apply(this,arguments)}function ar(){return Object.entries(ir({},Se,zt(),{sessionUUID:oe.sessionUUID,userId:oe.userId})).reduce(((e,t)=>{return null!=(n=t[1])&&""!==n?ir({},e,{[t[0]]:t[1]}):e;var n}),{})}async function or(){return new Promise((e=>{Mt(vt(je.eventsQueue)),Qt(bt(je.metricsQueue),!0),Pn(je.tracesQueue,!0),Ne({eventsQueue:[],metricsQueue:[],tracesQueue:[]}),e()}))}function sr(){return{"X-CB-Device-ID":H.deviceId||"unknown","X-CB-Is-Logged-In":H.userId?"true":"false","X-CB-Pagekey":re.pageKey||"unknown","X-CB-UJS":(e=Se.ujs,void 0===e||0===e.length?"":e.join(",")),"X-CB-Platform":A.platform||"unknown","X-CB-Project-Name":A.projectName||"unknown","X-CB-Session-UUID":oe.sessionUUID||"unknown","X-CB-Version-Name":A.version?String(A.version):"unknown"};var e}})(),r})()}));`;
|
|
157
|
+
const loadTelemetryScript = () => {
|
|
158
|
+
return new Promise((resolve, reject) => {
|
|
159
|
+
if (window.ClientAnalytics) {
|
|
160
|
+
return resolve();
|
|
161
|
+
}
|
|
162
|
+
try {
|
|
163
|
+
const script = document.createElement("script");
|
|
164
|
+
script.textContent = TELEMETRY_SCRIPT_CONTENT;
|
|
165
|
+
script.type = "text/javascript";
|
|
166
|
+
document.head.appendChild(script);
|
|
167
|
+
initCCA();
|
|
168
|
+
document.head.removeChild(script);
|
|
169
|
+
resolve();
|
|
170
|
+
} catch (_a) {
|
|
171
|
+
console.error("Failed to execute inlined telemetry script");
|
|
172
|
+
reject();
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
};
|
|
176
|
+
const initCCA = () => {
|
|
177
|
+
var _a, _b, _c;
|
|
178
|
+
if (typeof window !== "undefined") {
|
|
179
|
+
const deviceId = (_c = (_a = store.config.get().deviceId) !== null && _a !== void 0 ? _a : (_b = window.crypto) === null || _b === void 0 ? void 0 : _b.randomUUID()) !== null && _c !== void 0 ? _c : "";
|
|
180
|
+
if (window.ClientAnalytics) {
|
|
181
|
+
const { init, identify, PlatformName } = window.ClientAnalytics;
|
|
182
|
+
init({
|
|
183
|
+
isProd: true,
|
|
184
|
+
amplitudeApiKey: "c66737ad47ec354ced777935b0af822e",
|
|
185
|
+
platform: PlatformName.web,
|
|
186
|
+
projectName: "base_account_sdk",
|
|
187
|
+
showDebugLogging: false,
|
|
188
|
+
version: "1.0.0",
|
|
189
|
+
apiEndpoint: "https://cca-lite.coinbase.com"
|
|
190
|
+
});
|
|
191
|
+
identify({ deviceId });
|
|
192
|
+
store.config.set({ deviceId });
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
const factoryAddress = "0xba5ed110efdba3d005bfc882d75358acbbb85842";
|
|
197
|
+
const spendPermissionManagerAddress = "0xf85210B21cC50302F477BA56686d2019dC9b67Ad";
|
|
198
|
+
const abi = [
|
|
199
|
+
{ inputs: [], stateMutability: "nonpayable", type: "constructor" },
|
|
200
|
+
{
|
|
201
|
+
inputs: [{ name: "owner", type: "bytes" }],
|
|
202
|
+
name: "AlreadyOwner",
|
|
203
|
+
type: "error"
|
|
204
|
+
},
|
|
205
|
+
{ inputs: [], name: "Initialized", type: "error" },
|
|
206
|
+
{
|
|
207
|
+
inputs: [{ name: "owner", type: "bytes" }],
|
|
208
|
+
name: "InvalidEthereumAddressOwner",
|
|
209
|
+
type: "error"
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
inputs: [{ name: "key", type: "uint256" }],
|
|
213
|
+
name: "InvalidNonceKey",
|
|
214
|
+
type: "error"
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
inputs: [{ name: "owner", type: "bytes" }],
|
|
218
|
+
name: "InvalidOwnerBytesLength",
|
|
219
|
+
type: "error"
|
|
220
|
+
},
|
|
221
|
+
{ inputs: [], name: "LastOwner", type: "error" },
|
|
222
|
+
{
|
|
223
|
+
inputs: [{ name: "index", type: "uint256" }],
|
|
224
|
+
name: "NoOwnerAtIndex",
|
|
225
|
+
type: "error"
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
inputs: [{ name: "ownersRemaining", type: "uint256" }],
|
|
229
|
+
name: "NotLastOwner",
|
|
230
|
+
type: "error"
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
inputs: [{ name: "selector", type: "bytes4" }],
|
|
234
|
+
name: "SelectorNotAllowed",
|
|
235
|
+
type: "error"
|
|
236
|
+
},
|
|
237
|
+
{ inputs: [], name: "Unauthorized", type: "error" },
|
|
238
|
+
{ inputs: [], name: "UnauthorizedCallContext", type: "error" },
|
|
239
|
+
{ inputs: [], name: "UpgradeFailed", type: "error" },
|
|
240
|
+
{
|
|
241
|
+
inputs: [
|
|
242
|
+
{ name: "index", type: "uint256" },
|
|
243
|
+
{ name: "expectedOwner", type: "bytes" },
|
|
244
|
+
{ name: "actualOwner", type: "bytes" }
|
|
245
|
+
],
|
|
246
|
+
name: "WrongOwnerAtIndex",
|
|
247
|
+
type: "error"
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
anonymous: false,
|
|
251
|
+
inputs: [
|
|
252
|
+
{
|
|
253
|
+
indexed: true,
|
|
254
|
+
name: "index",
|
|
255
|
+
type: "uint256"
|
|
256
|
+
},
|
|
257
|
+
{ indexed: false, name: "owner", type: "bytes" }
|
|
258
|
+
],
|
|
259
|
+
name: "AddOwner",
|
|
260
|
+
type: "event"
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
anonymous: false,
|
|
264
|
+
inputs: [
|
|
265
|
+
{
|
|
266
|
+
indexed: true,
|
|
267
|
+
name: "index",
|
|
268
|
+
type: "uint256"
|
|
269
|
+
},
|
|
270
|
+
{ indexed: false, name: "owner", type: "bytes" }
|
|
271
|
+
],
|
|
272
|
+
name: "RemoveOwner",
|
|
273
|
+
type: "event"
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
anonymous: false,
|
|
277
|
+
inputs: [
|
|
278
|
+
{
|
|
279
|
+
indexed: true,
|
|
280
|
+
name: "implementation",
|
|
281
|
+
type: "address"
|
|
282
|
+
}
|
|
283
|
+
],
|
|
284
|
+
name: "Upgraded",
|
|
285
|
+
type: "event"
|
|
286
|
+
},
|
|
287
|
+
{ stateMutability: "payable", type: "fallback" },
|
|
288
|
+
{
|
|
289
|
+
inputs: [],
|
|
290
|
+
name: "REPLAYABLE_NONCE_KEY",
|
|
291
|
+
outputs: [{ name: "", type: "uint256" }],
|
|
292
|
+
stateMutability: "view",
|
|
293
|
+
type: "function"
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
inputs: [{ name: "owner", type: "address" }],
|
|
297
|
+
name: "addOwnerAddress",
|
|
298
|
+
outputs: [],
|
|
299
|
+
stateMutability: "nonpayable",
|
|
300
|
+
type: "function"
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
inputs: [
|
|
304
|
+
{ name: "x", type: "bytes32" },
|
|
305
|
+
{ name: "y", type: "bytes32" }
|
|
306
|
+
],
|
|
307
|
+
name: "addOwnerPublicKey",
|
|
308
|
+
outputs: [],
|
|
309
|
+
stateMutability: "nonpayable",
|
|
310
|
+
type: "function"
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
inputs: [{ name: "functionSelector", type: "bytes4" }],
|
|
314
|
+
name: "canSkipChainIdValidation",
|
|
315
|
+
outputs: [{ name: "", type: "bool" }],
|
|
316
|
+
stateMutability: "pure",
|
|
317
|
+
type: "function"
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
inputs: [],
|
|
321
|
+
name: "domainSeparator",
|
|
322
|
+
outputs: [{ name: "", type: "bytes32" }],
|
|
323
|
+
stateMutability: "view",
|
|
324
|
+
type: "function"
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
inputs: [],
|
|
328
|
+
name: "eip712Domain",
|
|
329
|
+
outputs: [
|
|
330
|
+
{ name: "fields", type: "bytes1" },
|
|
331
|
+
{ name: "name", type: "string" },
|
|
332
|
+
{ name: "version", type: "string" },
|
|
333
|
+
{ name: "chainId", type: "uint256" },
|
|
334
|
+
{ name: "verifyingContract", type: "address" },
|
|
335
|
+
{ name: "salt", type: "bytes32" },
|
|
336
|
+
{ name: "extensions", type: "uint256[]" }
|
|
337
|
+
],
|
|
338
|
+
stateMutability: "view",
|
|
339
|
+
type: "function"
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
inputs: [],
|
|
343
|
+
name: "entryPoint",
|
|
344
|
+
outputs: [{ name: "", type: "address" }],
|
|
345
|
+
stateMutability: "view",
|
|
346
|
+
type: "function"
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
inputs: [
|
|
350
|
+
{ name: "target", type: "address" },
|
|
351
|
+
{ name: "value", type: "uint256" },
|
|
352
|
+
{ name: "data", type: "bytes" }
|
|
353
|
+
],
|
|
354
|
+
name: "execute",
|
|
355
|
+
outputs: [],
|
|
356
|
+
stateMutability: "payable",
|
|
357
|
+
type: "function"
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
inputs: [
|
|
361
|
+
{
|
|
362
|
+
components: [
|
|
363
|
+
{ name: "target", type: "address" },
|
|
364
|
+
{ name: "value", type: "uint256" },
|
|
365
|
+
{ name: "data", type: "bytes" }
|
|
366
|
+
],
|
|
367
|
+
name: "calls",
|
|
368
|
+
type: "tuple[]"
|
|
369
|
+
}
|
|
370
|
+
],
|
|
371
|
+
name: "executeBatch",
|
|
372
|
+
outputs: [],
|
|
373
|
+
stateMutability: "payable",
|
|
374
|
+
type: "function"
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
inputs: [{ name: "calls", type: "bytes[]" }],
|
|
378
|
+
name: "executeWithoutChainIdValidation",
|
|
379
|
+
outputs: [],
|
|
380
|
+
stateMutability: "payable",
|
|
381
|
+
type: "function"
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
inputs: [
|
|
385
|
+
{
|
|
386
|
+
components: [
|
|
387
|
+
{ name: "sender", type: "address" },
|
|
388
|
+
{ name: "nonce", type: "uint256" },
|
|
389
|
+
{ name: "initCode", type: "bytes" },
|
|
390
|
+
{ name: "callData", type: "bytes" },
|
|
391
|
+
{ name: "callGasLimit", type: "uint256" },
|
|
392
|
+
{
|
|
393
|
+
name: "verificationGasLimit",
|
|
394
|
+
type: "uint256"
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
name: "preVerificationGas",
|
|
398
|
+
type: "uint256"
|
|
399
|
+
},
|
|
400
|
+
{ name: "maxFeePerGas", type: "uint256" },
|
|
401
|
+
{
|
|
402
|
+
name: "maxPriorityFeePerGas",
|
|
403
|
+
type: "uint256"
|
|
404
|
+
},
|
|
405
|
+
{ name: "paymasterAndData", type: "bytes" },
|
|
406
|
+
{ name: "signature", type: "bytes" }
|
|
407
|
+
],
|
|
408
|
+
name: "userOp",
|
|
409
|
+
type: "tuple"
|
|
410
|
+
}
|
|
411
|
+
],
|
|
412
|
+
name: "getUserOpHashWithoutChainId",
|
|
413
|
+
outputs: [{ name: "", type: "bytes32" }],
|
|
414
|
+
stateMutability: "view",
|
|
415
|
+
type: "function"
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
inputs: [],
|
|
419
|
+
name: "implementation",
|
|
420
|
+
outputs: [{ name: "$", type: "address" }],
|
|
421
|
+
stateMutability: "view",
|
|
422
|
+
type: "function"
|
|
423
|
+
},
|
|
424
|
+
{
|
|
425
|
+
inputs: [{ name: "owners", type: "bytes[]" }],
|
|
426
|
+
name: "initialize",
|
|
427
|
+
outputs: [],
|
|
428
|
+
stateMutability: "payable",
|
|
429
|
+
type: "function"
|
|
430
|
+
},
|
|
431
|
+
{
|
|
432
|
+
inputs: [{ name: "account", type: "address" }],
|
|
433
|
+
name: "isOwnerAddress",
|
|
434
|
+
outputs: [{ name: "", type: "bool" }],
|
|
435
|
+
stateMutability: "view",
|
|
436
|
+
type: "function"
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
inputs: [{ name: "account", type: "bytes" }],
|
|
440
|
+
name: "isOwnerBytes",
|
|
441
|
+
outputs: [{ name: "", type: "bool" }],
|
|
442
|
+
stateMutability: "view",
|
|
443
|
+
type: "function"
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
inputs: [
|
|
447
|
+
{ name: "x", type: "bytes32" },
|
|
448
|
+
{ name: "y", type: "bytes32" }
|
|
449
|
+
],
|
|
450
|
+
name: "isOwnerPublicKey",
|
|
451
|
+
outputs: [{ name: "", type: "bool" }],
|
|
452
|
+
stateMutability: "view",
|
|
453
|
+
type: "function"
|
|
454
|
+
},
|
|
455
|
+
{
|
|
456
|
+
inputs: [
|
|
457
|
+
{ name: "hash", type: "bytes32" },
|
|
458
|
+
{ name: "signature", type: "bytes" }
|
|
459
|
+
],
|
|
460
|
+
name: "isValidSignature",
|
|
461
|
+
outputs: [{ name: "result", type: "bytes4" }],
|
|
462
|
+
stateMutability: "view",
|
|
463
|
+
type: "function"
|
|
464
|
+
},
|
|
465
|
+
{
|
|
466
|
+
inputs: [],
|
|
467
|
+
name: "nextOwnerIndex",
|
|
468
|
+
outputs: [{ name: "", type: "uint256" }],
|
|
469
|
+
stateMutability: "view",
|
|
470
|
+
type: "function"
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
inputs: [{ name: "index", type: "uint256" }],
|
|
474
|
+
name: "ownerAtIndex",
|
|
475
|
+
outputs: [{ name: "", type: "bytes" }],
|
|
476
|
+
stateMutability: "view",
|
|
477
|
+
type: "function"
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
inputs: [],
|
|
481
|
+
name: "ownerCount",
|
|
482
|
+
outputs: [{ name: "", type: "uint256" }],
|
|
483
|
+
stateMutability: "view",
|
|
484
|
+
type: "function"
|
|
485
|
+
},
|
|
486
|
+
{
|
|
487
|
+
inputs: [],
|
|
488
|
+
name: "proxiableUUID",
|
|
489
|
+
outputs: [{ name: "", type: "bytes32" }],
|
|
490
|
+
stateMutability: "view",
|
|
491
|
+
type: "function"
|
|
492
|
+
},
|
|
493
|
+
{
|
|
494
|
+
inputs: [
|
|
495
|
+
{ name: "index", type: "uint256" },
|
|
496
|
+
{ name: "owner", type: "bytes" }
|
|
497
|
+
],
|
|
498
|
+
name: "removeLastOwner",
|
|
499
|
+
outputs: [],
|
|
500
|
+
stateMutability: "nonpayable",
|
|
501
|
+
type: "function"
|
|
502
|
+
},
|
|
503
|
+
{
|
|
504
|
+
inputs: [
|
|
505
|
+
{ name: "index", type: "uint256" },
|
|
506
|
+
{ name: "owner", type: "bytes" }
|
|
507
|
+
],
|
|
508
|
+
name: "removeOwnerAtIndex",
|
|
509
|
+
outputs: [],
|
|
510
|
+
stateMutability: "nonpayable",
|
|
511
|
+
type: "function"
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
inputs: [],
|
|
515
|
+
name: "removedOwnersCount",
|
|
516
|
+
outputs: [{ name: "", type: "uint256" }],
|
|
517
|
+
stateMutability: "view",
|
|
518
|
+
type: "function"
|
|
519
|
+
},
|
|
520
|
+
{
|
|
521
|
+
inputs: [{ name: "hash", type: "bytes32" }],
|
|
522
|
+
name: "replaySafeHash",
|
|
523
|
+
outputs: [{ name: "", type: "bytes32" }],
|
|
524
|
+
stateMutability: "view",
|
|
525
|
+
type: "function"
|
|
526
|
+
},
|
|
527
|
+
{
|
|
528
|
+
inputs: [
|
|
529
|
+
{ name: "newImplementation", type: "address" },
|
|
530
|
+
{ name: "data", type: "bytes" }
|
|
531
|
+
],
|
|
532
|
+
name: "upgradeToAndCall",
|
|
533
|
+
outputs: [],
|
|
534
|
+
stateMutability: "payable",
|
|
535
|
+
type: "function"
|
|
536
|
+
},
|
|
537
|
+
{
|
|
538
|
+
inputs: [
|
|
539
|
+
{
|
|
540
|
+
components: [
|
|
541
|
+
{ name: "sender", type: "address" },
|
|
542
|
+
{ name: "nonce", type: "uint256" },
|
|
543
|
+
{ name: "initCode", type: "bytes" },
|
|
544
|
+
{ name: "callData", type: "bytes" },
|
|
545
|
+
{ name: "callGasLimit", type: "uint256" },
|
|
546
|
+
{
|
|
547
|
+
name: "verificationGasLimit",
|
|
548
|
+
type: "uint256"
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
name: "preVerificationGas",
|
|
552
|
+
type: "uint256"
|
|
553
|
+
},
|
|
554
|
+
{ name: "maxFeePerGas", type: "uint256" },
|
|
555
|
+
{
|
|
556
|
+
name: "maxPriorityFeePerGas",
|
|
557
|
+
type: "uint256"
|
|
558
|
+
},
|
|
559
|
+
{ name: "paymasterAndData", type: "bytes" },
|
|
560
|
+
{ name: "signature", type: "bytes" }
|
|
561
|
+
],
|
|
562
|
+
name: "userOp",
|
|
563
|
+
type: "tuple"
|
|
564
|
+
},
|
|
565
|
+
{ name: "userOpHash", type: "bytes32" },
|
|
566
|
+
{ name: "missingAccountFunds", type: "uint256" }
|
|
567
|
+
],
|
|
568
|
+
name: "validateUserOp",
|
|
569
|
+
outputs: [{ name: "validationData", type: "uint256" }],
|
|
570
|
+
stateMutability: "nonpayable",
|
|
571
|
+
type: "function"
|
|
572
|
+
},
|
|
573
|
+
{ stateMutability: "payable", type: "receive" }
|
|
574
|
+
];
|
|
575
|
+
const factoryAbi = [
|
|
576
|
+
{
|
|
577
|
+
inputs: [{ name: "implementation_", type: "address" }],
|
|
578
|
+
stateMutability: "payable",
|
|
579
|
+
type: "constructor"
|
|
580
|
+
},
|
|
581
|
+
{ inputs: [], name: "OwnerRequired", type: "error" },
|
|
582
|
+
{
|
|
583
|
+
inputs: [
|
|
584
|
+
{ name: "owners", type: "bytes[]" },
|
|
585
|
+
{ name: "nonce", type: "uint256" }
|
|
586
|
+
],
|
|
587
|
+
name: "createAccount",
|
|
588
|
+
outputs: [
|
|
589
|
+
{
|
|
590
|
+
name: "account",
|
|
591
|
+
type: "address"
|
|
592
|
+
}
|
|
593
|
+
],
|
|
594
|
+
stateMutability: "payable",
|
|
595
|
+
type: "function"
|
|
596
|
+
},
|
|
597
|
+
{
|
|
598
|
+
inputs: [
|
|
599
|
+
{ name: "owners", type: "bytes[]" },
|
|
600
|
+
{ name: "nonce", type: "uint256" }
|
|
601
|
+
],
|
|
602
|
+
name: "getAddress",
|
|
603
|
+
outputs: [{ name: "", type: "address" }],
|
|
604
|
+
stateMutability: "view",
|
|
605
|
+
type: "function"
|
|
606
|
+
},
|
|
607
|
+
{
|
|
608
|
+
inputs: [],
|
|
609
|
+
name: "implementation",
|
|
610
|
+
outputs: [{ name: "", type: "address" }],
|
|
611
|
+
stateMutability: "view",
|
|
612
|
+
type: "function"
|
|
613
|
+
},
|
|
614
|
+
{
|
|
615
|
+
inputs: [],
|
|
616
|
+
name: "initCodeHash",
|
|
617
|
+
outputs: [{ name: "", type: "bytes32" }],
|
|
618
|
+
stateMutability: "view",
|
|
619
|
+
type: "function"
|
|
620
|
+
}
|
|
621
|
+
];
|
|
622
|
+
const standardErrorCodes = {
|
|
623
|
+
rpc: {
|
|
624
|
+
invalidInput: -32e3,
|
|
625
|
+
resourceNotFound: -32001,
|
|
626
|
+
resourceUnavailable: -32002,
|
|
627
|
+
transactionRejected: -32003,
|
|
628
|
+
methodNotSupported: -32004,
|
|
629
|
+
limitExceeded: -32005,
|
|
630
|
+
parse: -32700,
|
|
631
|
+
invalidRequest: -32600,
|
|
632
|
+
methodNotFound: -32601,
|
|
633
|
+
invalidParams: -32602,
|
|
634
|
+
internal: -32603
|
|
635
|
+
},
|
|
636
|
+
provider: {
|
|
637
|
+
userRejectedRequest: 4001,
|
|
638
|
+
unauthorized: 4100,
|
|
639
|
+
unsupportedMethod: 4200,
|
|
640
|
+
disconnected: 4900,
|
|
641
|
+
chainDisconnected: 4901,
|
|
642
|
+
unsupportedChain: 4902
|
|
643
|
+
}
|
|
644
|
+
};
|
|
645
|
+
const errorValues = {
|
|
646
|
+
"-32700": {
|
|
647
|
+
standard: "JSON RPC 2.0",
|
|
648
|
+
message: "Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."
|
|
649
|
+
},
|
|
650
|
+
"-32600": {
|
|
651
|
+
standard: "JSON RPC 2.0",
|
|
652
|
+
message: "The JSON sent is not a valid Request object."
|
|
653
|
+
},
|
|
654
|
+
"-32601": {
|
|
655
|
+
standard: "JSON RPC 2.0",
|
|
656
|
+
message: "The method does not exist / is not available."
|
|
657
|
+
},
|
|
658
|
+
"-32602": {
|
|
659
|
+
standard: "JSON RPC 2.0",
|
|
660
|
+
message: "Invalid method parameter(s)."
|
|
661
|
+
},
|
|
662
|
+
"-32603": {
|
|
663
|
+
standard: "JSON RPC 2.0",
|
|
664
|
+
message: "Internal JSON-RPC error."
|
|
665
|
+
},
|
|
666
|
+
"-32000": {
|
|
667
|
+
standard: "EIP-1474",
|
|
668
|
+
message: "Invalid input."
|
|
669
|
+
},
|
|
670
|
+
"-32001": {
|
|
671
|
+
standard: "EIP-1474",
|
|
672
|
+
message: "Resource not found."
|
|
673
|
+
},
|
|
674
|
+
"-32002": {
|
|
675
|
+
standard: "EIP-1474",
|
|
676
|
+
message: "Resource unavailable."
|
|
677
|
+
},
|
|
678
|
+
"-32003": {
|
|
679
|
+
standard: "EIP-1474",
|
|
680
|
+
message: "Transaction rejected."
|
|
681
|
+
},
|
|
682
|
+
"-32004": {
|
|
683
|
+
standard: "EIP-1474",
|
|
684
|
+
message: "Method not supported."
|
|
685
|
+
},
|
|
686
|
+
"-32005": {
|
|
687
|
+
standard: "EIP-1474",
|
|
688
|
+
message: "Request limit exceeded."
|
|
689
|
+
},
|
|
690
|
+
"4001": {
|
|
691
|
+
standard: "EIP-1193",
|
|
692
|
+
message: "User rejected the request."
|
|
693
|
+
},
|
|
694
|
+
"4100": {
|
|
695
|
+
standard: "EIP-1193",
|
|
696
|
+
message: "The requested account and/or method has not been authorized by the user."
|
|
697
|
+
},
|
|
698
|
+
"4200": {
|
|
699
|
+
standard: "EIP-1193",
|
|
700
|
+
message: "The requested method is not supported by this Ethereum provider."
|
|
701
|
+
},
|
|
702
|
+
"4900": {
|
|
703
|
+
standard: "EIP-1193",
|
|
704
|
+
message: "The provider is disconnected from all chains."
|
|
705
|
+
},
|
|
706
|
+
"4901": {
|
|
707
|
+
standard: "EIP-1193",
|
|
708
|
+
message: "The provider is disconnected from the specified chain."
|
|
709
|
+
},
|
|
710
|
+
"4902": {
|
|
711
|
+
standard: "EIP-3085",
|
|
712
|
+
message: "Unrecognized chain ID."
|
|
713
|
+
}
|
|
714
|
+
};
|
|
715
|
+
const FALLBACK_MESSAGE = "Unspecified error message.";
|
|
716
|
+
const JSON_RPC_SERVER_ERROR_MESSAGE = "Unspecified server error.";
|
|
717
|
+
function getMessageFromCode(code, fallbackMessage = FALLBACK_MESSAGE) {
|
|
718
|
+
if (code && Number.isInteger(code)) {
|
|
719
|
+
const codeString = code.toString();
|
|
720
|
+
if (hasKey(errorValues, codeString)) {
|
|
721
|
+
return errorValues[codeString].message;
|
|
722
|
+
}
|
|
723
|
+
if (isJsonRpcServerError(code)) {
|
|
724
|
+
return JSON_RPC_SERVER_ERROR_MESSAGE;
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
return fallbackMessage;
|
|
728
|
+
}
|
|
729
|
+
function isValidCode(code) {
|
|
730
|
+
if (!Number.isInteger(code)) {
|
|
731
|
+
return false;
|
|
732
|
+
}
|
|
733
|
+
const codeString = code.toString();
|
|
734
|
+
if (errorValues[codeString]) {
|
|
735
|
+
return true;
|
|
736
|
+
}
|
|
737
|
+
if (isJsonRpcServerError(code)) {
|
|
738
|
+
return true;
|
|
739
|
+
}
|
|
740
|
+
return false;
|
|
741
|
+
}
|
|
742
|
+
function serialize(error, { shouldIncludeStack = false } = {}) {
|
|
743
|
+
const serialized = {};
|
|
744
|
+
if (error && typeof error === "object" && !Array.isArray(error) && hasKey(error, "code") && isValidCode(error.code)) {
|
|
745
|
+
const _error = error;
|
|
746
|
+
serialized.code = _error.code;
|
|
747
|
+
if (_error.message && typeof _error.message === "string") {
|
|
748
|
+
serialized.message = _error.message;
|
|
749
|
+
if (hasKey(_error, "data")) {
|
|
750
|
+
serialized.data = _error.data;
|
|
751
|
+
}
|
|
752
|
+
} else {
|
|
753
|
+
serialized.message = getMessageFromCode(serialized.code);
|
|
754
|
+
serialized.data = { originalError: assignOriginalError(error) };
|
|
755
|
+
}
|
|
756
|
+
} else {
|
|
757
|
+
serialized.code = standardErrorCodes.rpc.internal;
|
|
758
|
+
serialized.message = hasStringProperty(error, "message") ? error.message : FALLBACK_MESSAGE;
|
|
759
|
+
serialized.data = { originalError: assignOriginalError(error) };
|
|
760
|
+
}
|
|
761
|
+
if (shouldIncludeStack) {
|
|
762
|
+
serialized.stack = hasStringProperty(error, "stack") ? error.stack : void 0;
|
|
763
|
+
}
|
|
764
|
+
return serialized;
|
|
765
|
+
}
|
|
766
|
+
function isJsonRpcServerError(code) {
|
|
767
|
+
return code >= -32099 && code <= -32e3;
|
|
768
|
+
}
|
|
769
|
+
function assignOriginalError(error) {
|
|
770
|
+
if (error && typeof error === "object" && !Array.isArray(error)) {
|
|
771
|
+
return Object.assign({}, error);
|
|
772
|
+
}
|
|
773
|
+
return error;
|
|
774
|
+
}
|
|
775
|
+
function hasKey(obj, key) {
|
|
776
|
+
return Object.prototype.hasOwnProperty.call(obj, key);
|
|
777
|
+
}
|
|
778
|
+
function hasStringProperty(obj, prop) {
|
|
779
|
+
return typeof obj === "object" && obj !== null && prop in obj && typeof obj[prop] === "string";
|
|
780
|
+
}
|
|
781
|
+
const standardErrors = {
|
|
782
|
+
rpc: {
|
|
783
|
+
parse: (arg) => getEthJsonRpcError(standardErrorCodes.rpc.parse, arg),
|
|
784
|
+
invalidRequest: (arg) => getEthJsonRpcError(standardErrorCodes.rpc.invalidRequest, arg),
|
|
785
|
+
invalidParams: (arg) => getEthJsonRpcError(standardErrorCodes.rpc.invalidParams, arg),
|
|
786
|
+
methodNotFound: (arg) => getEthJsonRpcError(standardErrorCodes.rpc.methodNotFound, arg),
|
|
787
|
+
internal: (arg) => getEthJsonRpcError(standardErrorCodes.rpc.internal, arg),
|
|
788
|
+
server: (opts) => {
|
|
789
|
+
if (!opts || typeof opts !== "object" || Array.isArray(opts)) {
|
|
790
|
+
throw new Error("Ethereum RPC Server errors must provide single object argument.");
|
|
791
|
+
}
|
|
792
|
+
const { code } = opts;
|
|
793
|
+
if (!Number.isInteger(code) || code > -32005 || code < -32099) {
|
|
794
|
+
throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');
|
|
795
|
+
}
|
|
796
|
+
return getEthJsonRpcError(code, opts);
|
|
797
|
+
},
|
|
798
|
+
invalidInput: (arg) => getEthJsonRpcError(standardErrorCodes.rpc.invalidInput, arg),
|
|
799
|
+
resourceNotFound: (arg) => getEthJsonRpcError(standardErrorCodes.rpc.resourceNotFound, arg),
|
|
800
|
+
resourceUnavailable: (arg) => getEthJsonRpcError(standardErrorCodes.rpc.resourceUnavailable, arg),
|
|
801
|
+
transactionRejected: (arg) => getEthJsonRpcError(standardErrorCodes.rpc.transactionRejected, arg),
|
|
802
|
+
methodNotSupported: (arg) => getEthJsonRpcError(standardErrorCodes.rpc.methodNotSupported, arg),
|
|
803
|
+
limitExceeded: (arg) => getEthJsonRpcError(standardErrorCodes.rpc.limitExceeded, arg)
|
|
804
|
+
},
|
|
805
|
+
provider: {
|
|
806
|
+
userRejectedRequest: (arg) => {
|
|
807
|
+
return getEthProviderError(standardErrorCodes.provider.userRejectedRequest, arg);
|
|
808
|
+
},
|
|
809
|
+
unauthorized: (arg) => {
|
|
810
|
+
return getEthProviderError(standardErrorCodes.provider.unauthorized, arg);
|
|
811
|
+
},
|
|
812
|
+
unsupportedMethod: (arg) => {
|
|
813
|
+
return getEthProviderError(standardErrorCodes.provider.unsupportedMethod, arg);
|
|
814
|
+
},
|
|
815
|
+
disconnected: (arg) => {
|
|
816
|
+
return getEthProviderError(standardErrorCodes.provider.disconnected, arg);
|
|
817
|
+
},
|
|
818
|
+
chainDisconnected: (arg) => {
|
|
819
|
+
return getEthProviderError(standardErrorCodes.provider.chainDisconnected, arg);
|
|
820
|
+
},
|
|
821
|
+
unsupportedChain: (arg) => {
|
|
822
|
+
return getEthProviderError(standardErrorCodes.provider.unsupportedChain, arg);
|
|
823
|
+
},
|
|
824
|
+
custom: (opts) => {
|
|
825
|
+
if (!opts || typeof opts !== "object" || Array.isArray(opts)) {
|
|
826
|
+
throw new Error("Ethereum Provider custom errors must provide single object argument.");
|
|
827
|
+
}
|
|
828
|
+
const { code, message, data } = opts;
|
|
829
|
+
if (!message || typeof message !== "string") {
|
|
830
|
+
throw new Error('"message" must be a nonempty string');
|
|
831
|
+
}
|
|
832
|
+
return new EthereumProviderError(code, message, data);
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
};
|
|
836
|
+
function getEthJsonRpcError(code, arg) {
|
|
837
|
+
const [message, data] = parseOpts(arg);
|
|
838
|
+
return new EthereumRpcError(code, message || getMessageFromCode(code), data);
|
|
839
|
+
}
|
|
840
|
+
function getEthProviderError(code, arg) {
|
|
841
|
+
const [message, data] = parseOpts(arg);
|
|
842
|
+
return new EthereumProviderError(code, message || getMessageFromCode(code), data);
|
|
843
|
+
}
|
|
844
|
+
function parseOpts(arg) {
|
|
845
|
+
if (arg) {
|
|
846
|
+
if (typeof arg === "string") {
|
|
847
|
+
return [arg];
|
|
848
|
+
}
|
|
849
|
+
if (typeof arg === "object" && !Array.isArray(arg)) {
|
|
850
|
+
const { message, data } = arg;
|
|
851
|
+
if (message && typeof message !== "string") {
|
|
852
|
+
throw new Error("Must specify string message.");
|
|
853
|
+
}
|
|
854
|
+
return [message || void 0, data];
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
return [];
|
|
858
|
+
}
|
|
859
|
+
class EthereumRpcError extends Error {
|
|
860
|
+
constructor(code, message, data) {
|
|
861
|
+
if (!Number.isInteger(code)) {
|
|
862
|
+
throw new Error('"code" must be an integer.');
|
|
863
|
+
}
|
|
864
|
+
if (!message || typeof message !== "string") {
|
|
865
|
+
throw new Error('"message" must be a nonempty string.');
|
|
866
|
+
}
|
|
867
|
+
super(message);
|
|
868
|
+
this.code = code;
|
|
869
|
+
if (data !== void 0) {
|
|
870
|
+
this.data = data;
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
class EthereumProviderError extends EthereumRpcError {
|
|
875
|
+
/**
|
|
876
|
+
* Create an Ethereum Provider JSON-RPC error.
|
|
877
|
+
* `code` must be an integer in the 1000 <= 4999 range.
|
|
878
|
+
*/
|
|
879
|
+
constructor(code, message, data) {
|
|
880
|
+
if (!isValidEthProviderCode(code)) {
|
|
881
|
+
throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');
|
|
882
|
+
}
|
|
883
|
+
super(code, message, data);
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
function isValidEthProviderCode(code) {
|
|
887
|
+
return Number.isInteger(code) && code >= 1e3 && code <= 4999;
|
|
888
|
+
}
|
|
889
|
+
function isActionableHttpRequestError(errorObject) {
|
|
890
|
+
return typeof errorObject === "object" && errorObject !== null && "code" in errorObject && "data" in errorObject && errorObject.code === -32090 && typeof errorObject.data === "object" && errorObject.data !== null && "type" in errorObject.data && errorObject.data.type === "INSUFFICIENT_FUNDS";
|
|
891
|
+
}
|
|
892
|
+
function isViemError(error) {
|
|
893
|
+
return typeof error === "object" && error !== null && "details" in error;
|
|
894
|
+
}
|
|
895
|
+
function viemHttpErrorToProviderError(error) {
|
|
896
|
+
try {
|
|
897
|
+
const details = JSON.parse(error.details);
|
|
898
|
+
return new EthereumRpcError(details.code, details.message, details.data);
|
|
899
|
+
} catch (_2) {
|
|
900
|
+
return null;
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
function assertPresence(value, error, message) {
|
|
904
|
+
if (value === null || value === void 0) {
|
|
905
|
+
throw error !== null && error !== void 0 ? error : standardErrors.rpc.invalidParams({
|
|
906
|
+
message: "value must be present",
|
|
907
|
+
data: value
|
|
908
|
+
});
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
function assertArrayPresence(value, message) {
|
|
912
|
+
if (!Array.isArray(value)) {
|
|
913
|
+
throw standardErrors.rpc.invalidParams({
|
|
914
|
+
message: message !== null && message !== void 0 ? message : "value must be an array",
|
|
915
|
+
data: value
|
|
916
|
+
});
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
const COOP_ERROR_MESSAGE = `Base Account SDK requires the Cross-Origin-Opener-Policy header to not be set to 'same-origin'. This is to ensure that the SDK can communicate with the Base Account app.
|
|
920
|
+
|
|
921
|
+
Please see https://docs.base.org/smart-wallet/quickstart#cross-origin-opener-policy for more information.`;
|
|
922
|
+
const createCoopChecker = () => {
|
|
923
|
+
let crossOriginOpenerPolicy;
|
|
924
|
+
return {
|
|
925
|
+
getCrossOriginOpenerPolicy: () => {
|
|
926
|
+
if (crossOriginOpenerPolicy === void 0) {
|
|
927
|
+
return "undefined";
|
|
928
|
+
}
|
|
929
|
+
return crossOriginOpenerPolicy;
|
|
930
|
+
},
|
|
931
|
+
checkCrossOriginOpenerPolicy: async () => {
|
|
932
|
+
if (typeof window === "undefined") {
|
|
933
|
+
crossOriginOpenerPolicy = "non-browser-env";
|
|
934
|
+
return;
|
|
935
|
+
}
|
|
936
|
+
try {
|
|
937
|
+
const url = `${window.location.origin}${window.location.pathname}`;
|
|
938
|
+
const response = await fetch(url, {
|
|
939
|
+
method: "HEAD"
|
|
940
|
+
});
|
|
941
|
+
if (!response.ok) {
|
|
942
|
+
throw new Error(`HTTP error! status: ${response.status}`);
|
|
943
|
+
}
|
|
944
|
+
const result = response.headers.get("Cross-Origin-Opener-Policy");
|
|
945
|
+
crossOriginOpenerPolicy = result !== null && result !== void 0 ? result : "null";
|
|
946
|
+
if (crossOriginOpenerPolicy === "same-origin") {
|
|
947
|
+
console.error(COOP_ERROR_MESSAGE);
|
|
948
|
+
}
|
|
949
|
+
} catch (error) {
|
|
950
|
+
console.error("Error checking Cross-Origin-Opener-Policy:", error.message);
|
|
951
|
+
crossOriginOpenerPolicy = "error";
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
};
|
|
955
|
+
};
|
|
956
|
+
const { checkCrossOriginOpenerPolicy, getCrossOriginOpenerPolicy } = createCoopChecker();
|
|
957
|
+
function validatePreferences(preference) {
|
|
958
|
+
if (!preference) {
|
|
959
|
+
return;
|
|
960
|
+
}
|
|
961
|
+
if (preference.attribution) {
|
|
962
|
+
if (preference.attribution.auto !== void 0 && preference.attribution.dataSuffix !== void 0) {
|
|
963
|
+
throw new Error(`Attribution cannot contain both auto and dataSuffix properties`);
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
if (preference.telemetry) {
|
|
967
|
+
if (typeof preference.telemetry !== "boolean") {
|
|
968
|
+
throw new Error(`Telemetry must be a boolean`);
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
function validateSubAccount(toAccount) {
|
|
973
|
+
if (typeof toAccount !== "function") {
|
|
974
|
+
throw new Error(`toAccount is not a function`);
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
var ComponentType;
|
|
978
|
+
(function(ComponentType2) {
|
|
979
|
+
ComponentType2["unknown"] = "unknown";
|
|
980
|
+
ComponentType2["banner"] = "banner";
|
|
981
|
+
ComponentType2["button"] = "button";
|
|
982
|
+
ComponentType2["card"] = "card";
|
|
983
|
+
ComponentType2["chart"] = "chart";
|
|
984
|
+
ComponentType2["content_script"] = "content_script";
|
|
985
|
+
ComponentType2["dropdown"] = "dropdown";
|
|
986
|
+
ComponentType2["link"] = "link";
|
|
987
|
+
ComponentType2["page"] = "page";
|
|
988
|
+
ComponentType2["modal"] = "modal";
|
|
989
|
+
ComponentType2["table"] = "table";
|
|
990
|
+
ComponentType2["search_bar"] = "search_bar";
|
|
991
|
+
ComponentType2["service_worker"] = "service_worker";
|
|
992
|
+
ComponentType2["text"] = "text";
|
|
993
|
+
ComponentType2["text_input"] = "text_input";
|
|
994
|
+
ComponentType2["tray"] = "tray";
|
|
995
|
+
ComponentType2["checkbox"] = "checkbox";
|
|
996
|
+
ComponentType2["icon"] = "icon";
|
|
997
|
+
})(ComponentType || (ComponentType = {}));
|
|
998
|
+
var ActionType;
|
|
999
|
+
(function(ActionType2) {
|
|
1000
|
+
ActionType2["unknown"] = "unknown";
|
|
1001
|
+
ActionType2["blur"] = "blur";
|
|
1002
|
+
ActionType2["click"] = "click";
|
|
1003
|
+
ActionType2["change"] = "change";
|
|
1004
|
+
ActionType2["dismiss"] = "dismiss";
|
|
1005
|
+
ActionType2["focus"] = "focus";
|
|
1006
|
+
ActionType2["hover"] = "hover";
|
|
1007
|
+
ActionType2["select"] = "select";
|
|
1008
|
+
ActionType2["measurement"] = "measurement";
|
|
1009
|
+
ActionType2["move"] = "move";
|
|
1010
|
+
ActionType2["process"] = "process";
|
|
1011
|
+
ActionType2["render"] = "render";
|
|
1012
|
+
ActionType2["scroll"] = "scroll";
|
|
1013
|
+
ActionType2["view"] = "view";
|
|
1014
|
+
ActionType2["search"] = "search";
|
|
1015
|
+
ActionType2["keyPress"] = "keyPress";
|
|
1016
|
+
ActionType2["error"] = "error";
|
|
1017
|
+
})(ActionType || (ActionType = {}));
|
|
1018
|
+
var AnalyticsEventImportance;
|
|
1019
|
+
(function(AnalyticsEventImportance2) {
|
|
1020
|
+
AnalyticsEventImportance2["low"] = "low";
|
|
1021
|
+
AnalyticsEventImportance2["high"] = "high";
|
|
1022
|
+
})(AnalyticsEventImportance || (AnalyticsEventImportance = {}));
|
|
1023
|
+
function logEvent(name2, event, importance) {
|
|
1024
|
+
var _a, _b, _c;
|
|
1025
|
+
if (window.ClientAnalytics) {
|
|
1026
|
+
(_a = window.ClientAnalytics) === null || _a === void 0 ? void 0 : _a.logEvent(name2, Object.assign(Object.assign({}, event), { sdkVersion: PACKAGE_VERSION, sdkName: PACKAGE_NAME, appName: (_c = (_b = store.config.get().metadata) === null || _b === void 0 ? void 0 : _b.appName) !== null && _c !== void 0 ? _c : "", appOrigin: window.location.origin }), importance);
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
const logPopupSetupStarted = () => {
|
|
1030
|
+
logEvent("communicator.popup_setup.started", {
|
|
1031
|
+
action: ActionType.unknown,
|
|
1032
|
+
componentType: ComponentType.unknown
|
|
1033
|
+
}, AnalyticsEventImportance.high);
|
|
1034
|
+
};
|
|
1035
|
+
const logPopupSetupCompleted = () => {
|
|
1036
|
+
logEvent("communicator.popup_setup.completed", {
|
|
1037
|
+
action: ActionType.unknown,
|
|
1038
|
+
componentType: ComponentType.unknown
|
|
1039
|
+
}, AnalyticsEventImportance.high);
|
|
1040
|
+
};
|
|
1041
|
+
const logPopupUnloadReceived = () => {
|
|
1042
|
+
logEvent("communicator.popup_unload.received", {
|
|
1043
|
+
action: ActionType.unknown,
|
|
1044
|
+
componentType: ComponentType.unknown
|
|
1045
|
+
}, AnalyticsEventImportance.high);
|
|
1046
|
+
};
|
|
1047
|
+
const logDialogShown = ({ dialogContext }) => {
|
|
1048
|
+
logEvent(`dialog.${dialogContext}.shown`, {
|
|
1049
|
+
action: ActionType.render,
|
|
1050
|
+
componentType: ComponentType.modal,
|
|
1051
|
+
dialogContext
|
|
1052
|
+
}, AnalyticsEventImportance.high);
|
|
1053
|
+
};
|
|
1054
|
+
const logDialogDismissed = ({ dialogContext }) => {
|
|
1055
|
+
logEvent(`dialog.${dialogContext}.dismissed`, {
|
|
1056
|
+
action: ActionType.dismiss,
|
|
1057
|
+
componentType: ComponentType.modal,
|
|
1058
|
+
dialogContext
|
|
1059
|
+
}, AnalyticsEventImportance.high);
|
|
1060
|
+
};
|
|
1061
|
+
const logDialogActionClicked = ({ dialogContext, dialogAction }) => {
|
|
1062
|
+
logEvent(`dialog.${dialogContext}.action_clicked`, {
|
|
1063
|
+
action: ActionType.click,
|
|
1064
|
+
componentType: ComponentType.button,
|
|
1065
|
+
dialogContext,
|
|
1066
|
+
dialogAction
|
|
1067
|
+
}, AnalyticsEventImportance.high);
|
|
1068
|
+
};
|
|
1069
|
+
const FONT_FACE_CSS = `
|
|
1070
|
+
@font-face {
|
|
1071
|
+
font-family: "BaseSans-Regular";
|
|
1072
|
+
src: url("data:font/woff2;charset=utf-8;base64,d09GMgABAAAAAJigAA8AAAACCywAAJg8AAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP0ZGVE0cGoIuG4L7BhzCdAZgAJIGEQgKg+k0gv4NC4p0AAE2AiQDlWQEIAWGfgeublsIz5EGVeP2TiXfSAJ0G0LBr7Zlqf6pcAA3dwBbquuITJr6o7y2YrpNHoSyAwBKe/rZ//////+/IlmMMf8PuQcEUUitMtva1oSQhGamQkxJxpSLWVScqgQ1RW16VovNJTZ2uagkVSeuNje11QubnvZpYVB7yUGi4thNqJYBdoegR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
1076
|
+
font-display: swap;
|
|
1077
|
+
}
|
|
1078
|
+
`;
|
|
1079
|
+
const FONT_NAME = "BaseSans-Regular";
|
|
1080
|
+
function injectFontStyle() {
|
|
1081
|
+
const existing = document.head.querySelector(`style[base-sdk-font="${FONT_NAME}"]`);
|
|
1082
|
+
if (existing)
|
|
1083
|
+
return;
|
|
1084
|
+
const style = document.createElement("style");
|
|
1085
|
+
style.setAttribute("base-sdk-font", FONT_NAME);
|
|
1086
|
+
style.textContent = FONT_FACE_CSS;
|
|
1087
|
+
document.head.appendChild(style);
|
|
1088
|
+
}
|
|
1089
|
+
async function getDisplayableUsername(address) {
|
|
1090
|
+
return truncateAddress(address);
|
|
1091
|
+
}
|
|
1092
|
+
function truncateAddress(address, length = 4) {
|
|
1093
|
+
return `${address.slice(0, 2 + length)}...${address.slice(-length)}`;
|
|
1094
|
+
}
|
|
1095
|
+
const WHITE = "#FFF";
|
|
1096
|
+
const BRAND_BLUE = "#0000FF";
|
|
1097
|
+
const BaseLogo = ({ fill }) => {
|
|
1098
|
+
const fillColor = fill === "blue" ? BRAND_BLUE : WHITE;
|
|
1099
|
+
return u("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: u("path", { d: "M0 2.014C0 1.58105 0 1.36457 0.0815779 1.19805C0.159686 1.03861 0.288611 0.909686 0.448049 0.831578C0.61457 0.75 0.831047 0.75 1.264 0.75H14.736C15.169 0.75 15.3854 0.75 15.552 0.831578C15.7114 0.909686 15.8403 1.03861 15.9184 1.19805C16 1.36457 16 1.58105 16 2.014V15.486C16 15.919 16 16.1354 15.9184 16.302C15.8403 16.4614 15.7114 16.5903 15.552 16.6684C15.3854 16.75 15.169 16.75 14.736 16.75H1.264C0.831047 16.75 0.61457 16.75 0.448049 16.6684C0.288611 16.5903 0.159686 16.4614 0.0815779 16.302C0 16.1354 0 15.919 0 15.486V2.014Z", fill: fillColor }) });
|
|
1100
|
+
};
|
|
1101
|
+
const css = /* @__PURE__ */ (() => `.-base-acc-sdk-css-reset{-webkit-font-smoothing:antialiased;pointer-events:auto !important}.-base-acc-sdk-css-reset .-base-acc-sdk-dialog-container{position:fixed;top:0;left:0;width:100%;height:100%;z-index:2147483647}.-base-acc-sdk-css-reset .-base-acc-sdk-dialog-container *{user-select:none;box-sizing:border-box}.-base-acc-sdk-css-reset .-base-acc-sdk-dialog-backdrop{position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,.5);display:flex;align-items:center;justify-content:center;padding:20px}@media(max-width: 600px)and (orientation: portrait){.-base-acc-sdk-css-reset .-base-acc-sdk-dialog-backdrop{align-items:flex-end;justify-content:stretch;padding:0}}.-base-acc-sdk-css-reset .-base-acc-sdk-dialog{position:relative;z-index:2147483648}@media(max-width: 600px)and (orientation: portrait){.-base-acc-sdk-css-reset .-base-acc-sdk-dialog{width:100%}}.-base-acc-sdk-css-reset .-base-acc-sdk-dialog-instance{background:#fff;border-radius:12px;box-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 10px 10px -5px rgba(0,0,0,.04);width:380px;max-height:90vh;overflow:hidden;transform:scale(0.95);opacity:0;transition:all .2s ease-in-out}@media(max-width: 600px)and (orientation: portrait){.-base-acc-sdk-css-reset .-base-acc-sdk-dialog-instance{touch-action:pan-y;user-select:none}}.-base-acc-sdk-css-reset .-base-acc-sdk-dialog-instance-hidden{transform:scale(0.9);opacity:0}@media(max-width: 600px)and (orientation: portrait){.-base-acc-sdk-css-reset .-base-acc-sdk-dialog-instance-hidden{transform:translateY(100%)}}.-base-acc-sdk-css-reset .-base-acc-sdk-dialog-instance:not(.-base-acc-sdk-dialog-instance-hidden){transform:scale(1);opacity:1}@media(max-width: 600px)and (orientation: portrait){.-base-acc-sdk-css-reset .-base-acc-sdk-dialog-instance:not(.-base-acc-sdk-dialog-instance-hidden){transform:translateY(0)}}@media(max-width: 600px)and (orientation: portrait){.-base-acc-sdk-css-reset .-base-acc-sdk-dialog-instance{width:100%;max-width:100%;border-radius:20px 20px 0 0;box-shadow:0 -10px 25px rgba(0,0,0,.15);max-height:80vh;transform:translateY(0)}.-base-acc-sdk-css-reset .-base-acc-sdk-dialog-instance-hidden{transform:translateY(100%);opacity:1}.-base-acc-sdk-css-reset .-base-acc-sdk-dialog-instance:not(.-base-acc-sdk-dialog-instance-hidden){transform:translateY(0);opacity:1}}.-base-acc-sdk-css-reset .-base-acc-sdk-dialog-instance-header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px 0 20px}@media(max-width: 600px)and (orientation: portrait){.-base-acc-sdk-css-reset .-base-acc-sdk-dialog-instance-header{padding:16px 20px 12px 20px}}.-base-acc-sdk-css-reset .-base-acc-sdk-dialog-instance-header-icon-and-title{display:flex;align-items:center;gap:8px}.-base-acc-sdk-css-reset .-base-acc-sdk-dialog-instance-header-icon-and-title-title{font-family:"BaseSans-Regular",sans-serif;font-size:14px;font-weight:400;color:#5b616e}.-base-acc-sdk-css-reset .-base-acc-sdk-dialog-instance-header-cblogo{width:32px;height:32px}.-base-acc-sdk-css-reset .-base-acc-sdk-dialog-instance-header-close{display:flex;align-items:center;justify-content:center;width:32px;height:32px;cursor:pointer;border-radius:6px;transition:background-color .2s}.-base-acc-sdk-css-reset .-base-acc-sdk-dialog-instance-header-close:hover{background-color:#f5f7f8}.-base-acc-sdk-css-reset .-base-acc-sdk-dialog-instance-header-close-icon{width:14px;height:14px}@media(max-width: 600px)and (orientation: portrait){.-base-acc-sdk-css-reset .-base-acc-sdk-dialog-instance-header-close-icon{display:none}}.-base-acc-sdk-css-reset .-base-acc-sdk-dialog-instance-content{padding:20px 20px 16px 20px;font-family:"BaseSans-Regular",sans-serif}@media(max-width: 600px)and (orientation: portrait){.-base-acc-sdk-css-reset .-base-acc-sdk-dialog-instance-content{padding:8px 20px 12px 20px}}.-base-acc-sdk-css-reset .-base-acc-sdk-dialog-instance-content-title{font-size:20px;font-weight:600;line-height:28px;color:#0a0b0d;margin-bottom:10px}.-base-acc-sdk-css-reset .-base-acc-sdk-dialog-instance-content-message{font-size:16px;font-weight:400;line-height:24px;color:#5b616e;margin-bottom:0}.-base-acc-sdk-css-reset .-base-acc-sdk-dialog-instance-actions{display:flex;padding:16px 20px 20px 20px;flex-direction:column}@media(max-width: 600px)and (orientation: portrait){.-base-acc-sdk-css-reset .-base-acc-sdk-dialog-instance-actions{padding:16px 20px calc(20px + env(safe-area-inset-bottom)) 20px;gap:6px}}.-base-acc-sdk-css-reset .-base-acc-sdk-dialog-instance-button{font-family:"BaseSans-Regular",sans-serif;font-size:16px;font-weight:500;line-height:24px;border:none;border-radius:12px;padding:16px 24px;cursor:pointer;transition:all .2s ease-in-out;width:100%;margin:4px 0}.-base-acc-sdk-css-reset .-base-acc-sdk-dialog-instance-button:disabled{opacity:.5;cursor:not-allowed}.-base-acc-sdk-css-reset .-base-acc-sdk-dialog-instance-button-primary{background-color:#0a0b0d;color:#fff}.-base-acc-sdk-css-reset .-base-acc-sdk-dialog-instance-button-primary:hover:not(:disabled){background-color:#1c1e20}.-base-acc-sdk-css-reset .-base-acc-sdk-dialog-instance-button-primary:active:not(:disabled){background-color:#2a2d31}.-base-acc-sdk-css-reset .-base-acc-sdk-dialog-instance-button-secondary{background-color:#eef0f3;color:#0a0b0d}.-base-acc-sdk-css-reset .-base-acc-sdk-dialog-instance-button-secondary:hover:not(:disabled){background-color:#e1e4e8}.-base-acc-sdk-css-reset .-base-acc-sdk-dialog-instance-button-secondary:active:not(:disabled){background-color:#d4d8dd}.-base-acc-sdk-css-reset .-base-acc-sdk-dialog-handle-bar{position:absolute;top:-16px;left:50%;transform:translateX(-50%);width:64px;height:4px;background-color:#d1d5db;border-radius:2px;opacity:0;animation:handleBarFadeIn .2s ease-in-out .2s forwards}@keyframes handleBarFadeIn{from{opacity:0}to{opacity:1}}`)();
|
|
1102
|
+
const closeIcon = `data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEzIDFMMSAxM20wLTEyTDEzIDEzIiBzdHJva2U9IiM5Q0EzQUYiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+PC9zdmc+`;
|
|
1103
|
+
function isPhonePortrait() {
|
|
1104
|
+
return window.innerWidth <= 600 && window.innerHeight > window.innerWidth;
|
|
1105
|
+
}
|
|
1106
|
+
const DialogHandleBar = () => {
|
|
1107
|
+
const [showHandleBar, setShowHandleBar] = h(false);
|
|
1108
|
+
y(() => {
|
|
1109
|
+
const checkOrientation = () => {
|
|
1110
|
+
setShowHandleBar(isPhonePortrait());
|
|
1111
|
+
};
|
|
1112
|
+
checkOrientation();
|
|
1113
|
+
window.addEventListener("resize", checkOrientation);
|
|
1114
|
+
window.addEventListener("orientationchange", checkOrientation);
|
|
1115
|
+
return () => {
|
|
1116
|
+
window.removeEventListener("resize", checkOrientation);
|
|
1117
|
+
window.removeEventListener("orientationchange", checkOrientation);
|
|
1118
|
+
};
|
|
1119
|
+
}, []);
|
|
1120
|
+
if (!showHandleBar) {
|
|
1121
|
+
return null;
|
|
1122
|
+
}
|
|
1123
|
+
return u("div", { class: "-base-acc-sdk-dialog-handle-bar" });
|
|
1124
|
+
};
|
|
1125
|
+
class Dialog {
|
|
1126
|
+
constructor() {
|
|
1127
|
+
this.items = /* @__PURE__ */ new Map();
|
|
1128
|
+
this.nextItemKey = 0;
|
|
1129
|
+
this.root = null;
|
|
1130
|
+
}
|
|
1131
|
+
attach(el) {
|
|
1132
|
+
this.root = document.createElement("div");
|
|
1133
|
+
this.root.className = "-base-acc-sdk-dialog-root";
|
|
1134
|
+
el.appendChild(this.root);
|
|
1135
|
+
this.render();
|
|
1136
|
+
}
|
|
1137
|
+
presentItem(itemProps) {
|
|
1138
|
+
const key = this.nextItemKey++;
|
|
1139
|
+
this.items.set(key, itemProps);
|
|
1140
|
+
this.render();
|
|
1141
|
+
}
|
|
1142
|
+
clear() {
|
|
1143
|
+
this.items.clear();
|
|
1144
|
+
if (this.root) {
|
|
1145
|
+
B(null, this.root);
|
|
1146
|
+
}
|
|
1147
|
+
}
|
|
1148
|
+
render() {
|
|
1149
|
+
if (this.root) {
|
|
1150
|
+
B(u("div", { children: u(DialogContainer, { children: Array.from(this.items.entries()).map(([key, itemProps]) => _(DialogInstance, Object.assign({}, itemProps, { key, handleClose: () => {
|
|
1151
|
+
var _a;
|
|
1152
|
+
this.clear();
|
|
1153
|
+
(_a = itemProps.onClose) === null || _a === void 0 ? void 0 : _a.call(itemProps);
|
|
1154
|
+
} }))) }) }), this.root);
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
}
|
|
1158
|
+
const DialogContainer = (props) => {
|
|
1159
|
+
const [dragY, setDragY] = h(0);
|
|
1160
|
+
const [isDragging, setIsDragging] = h(false);
|
|
1161
|
+
const [startY, setStartY] = h(0);
|
|
1162
|
+
const handleTouchStart = (e) => {
|
|
1163
|
+
if (!isPhonePortrait())
|
|
1164
|
+
return;
|
|
1165
|
+
const touch = e.touches[0];
|
|
1166
|
+
setStartY(touch.clientY);
|
|
1167
|
+
setIsDragging(true);
|
|
1168
|
+
};
|
|
1169
|
+
const handleTouchMove = (e) => {
|
|
1170
|
+
if (!isDragging)
|
|
1171
|
+
return;
|
|
1172
|
+
const touch = e.touches[0];
|
|
1173
|
+
const deltaY = touch.clientY - startY;
|
|
1174
|
+
if (deltaY > 0) {
|
|
1175
|
+
setDragY(deltaY);
|
|
1176
|
+
e.preventDefault();
|
|
1177
|
+
}
|
|
1178
|
+
};
|
|
1179
|
+
const handleTouchEnd = () => {
|
|
1180
|
+
if (!isDragging)
|
|
1181
|
+
return;
|
|
1182
|
+
setIsDragging(false);
|
|
1183
|
+
if (dragY > 100) {
|
|
1184
|
+
const closeButton = document.querySelector(".-base-acc-sdk-dialog-instance-header-close");
|
|
1185
|
+
if (closeButton) {
|
|
1186
|
+
closeButton.click();
|
|
1187
|
+
}
|
|
1188
|
+
} else {
|
|
1189
|
+
setDragY(0);
|
|
1190
|
+
}
|
|
1191
|
+
};
|
|
1192
|
+
return u("div", { class: clsx("-base-acc-sdk-dialog-container"), children: [u("style", { children: css }), u("div", { class: "-base-acc-sdk-dialog-backdrop", onTouchStart: handleTouchStart, onTouchMove: handleTouchMove, onTouchEnd: handleTouchEnd, children: u("div", { class: "-base-acc-sdk-dialog", style: {
|
|
1193
|
+
transform: `translateY(${dragY}px)`,
|
|
1194
|
+
transition: isDragging ? "none" : "transform 0.2s ease-out"
|
|
1195
|
+
}, children: [u(DialogHandleBar, {}), props.children] }) })] });
|
|
1196
|
+
};
|
|
1197
|
+
const DialogInstance = ({ title, message, actionItems, handleClose }) => {
|
|
1198
|
+
const [hidden, setHidden] = h(true);
|
|
1199
|
+
const [isLoadingUsername, setIsLoadingUsername] = h(true);
|
|
1200
|
+
const [username, setUsername] = h(null);
|
|
1201
|
+
y(() => {
|
|
1202
|
+
const timer = window.setTimeout(() => {
|
|
1203
|
+
setHidden(false);
|
|
1204
|
+
}, 1);
|
|
1205
|
+
return () => {
|
|
1206
|
+
window.clearTimeout(timer);
|
|
1207
|
+
};
|
|
1208
|
+
}, []);
|
|
1209
|
+
y(() => {
|
|
1210
|
+
const fetchEnsName = async () => {
|
|
1211
|
+
var _a;
|
|
1212
|
+
const address = (_a = store.account.get().accounts) === null || _a === void 0 ? void 0 : _a[0];
|
|
1213
|
+
if (address) {
|
|
1214
|
+
const username2 = await getDisplayableUsername(address);
|
|
1215
|
+
setUsername(username2);
|
|
1216
|
+
}
|
|
1217
|
+
setIsLoadingUsername(false);
|
|
1218
|
+
};
|
|
1219
|
+
fetchEnsName();
|
|
1220
|
+
}, []);
|
|
1221
|
+
const headerTitle = T(() => {
|
|
1222
|
+
return username ? `Signed in as ${username}` : "Base Account";
|
|
1223
|
+
}, [username]);
|
|
1224
|
+
const shouldShowHeaderTitle = !isLoadingUsername;
|
|
1225
|
+
return u("div", { class: clsx("-base-acc-sdk-dialog-instance", hidden && "-base-acc-sdk-dialog-instance-hidden"), children: [u("div", { class: "-base-acc-sdk-dialog-instance-header", children: [u("div", { class: "-base-acc-sdk-dialog-instance-header-icon-and-title", children: [u(BaseLogo, { fill: "blue" }), shouldShowHeaderTitle && u("div", { class: "-base-acc-sdk-dialog-instance-header-icon-and-title-title", children: headerTitle })] }), u("div", { class: "-base-acc-sdk-dialog-instance-header-close", onClick: handleClose, children: u("img", { src: closeIcon, class: "-base-acc-sdk-dialog-instance-header-close-icon" }) })] }), u("div", { class: "-base-acc-sdk-dialog-instance-content", children: [u("div", { class: "-base-acc-sdk-dialog-instance-content-title", children: title }), u("div", { class: "-base-acc-sdk-dialog-instance-content-message", children: message })] }), actionItems && actionItems.length > 0 && u("div", { class: "-base-acc-sdk-dialog-instance-actions", children: actionItems.map((action, i) => u("button", { class: clsx("-base-acc-sdk-dialog-instance-button", action.variant === "primary" && "-base-acc-sdk-dialog-instance-button-primary", action.variant === "secondary" && "-base-acc-sdk-dialog-instance-button-secondary"), onClick: action.onClick, children: action.text }, i)) })] });
|
|
1226
|
+
};
|
|
1227
|
+
let dialog = null;
|
|
1228
|
+
function initDialog() {
|
|
1229
|
+
if (!dialog) {
|
|
1230
|
+
const root = document.createElement("div");
|
|
1231
|
+
root.className = "-base-acc-sdk-css-reset";
|
|
1232
|
+
document.body.appendChild(root);
|
|
1233
|
+
dialog = new Dialog();
|
|
1234
|
+
dialog.attach(root);
|
|
1235
|
+
}
|
|
1236
|
+
injectFontStyle();
|
|
1237
|
+
return dialog;
|
|
1238
|
+
}
|
|
1239
|
+
const POPUP_WIDTH = 420;
|
|
1240
|
+
const POPUP_HEIGHT = 700;
|
|
1241
|
+
const POPUP_BLOCKED_TITLE = "{app} wants to continue in Base Account";
|
|
1242
|
+
const POPUP_BLOCKED_MESSAGE = "This action requires your permission to open a new window.";
|
|
1243
|
+
function openPopup(url) {
|
|
1244
|
+
const left = (window.innerWidth - POPUP_WIDTH) / 2 + window.screenX;
|
|
1245
|
+
const top = (window.innerHeight - POPUP_HEIGHT) / 2 + window.screenY;
|
|
1246
|
+
appendAppInfoQueryParams(url);
|
|
1247
|
+
function tryOpenPopup() {
|
|
1248
|
+
const popupId = `wallet_${crypto.randomUUID()}`;
|
|
1249
|
+
const popup2 = window.open(url, popupId, `width=${POPUP_WIDTH}, height=${POPUP_HEIGHT}, left=${left}, top=${top}`);
|
|
1250
|
+
popup2 === null || popup2 === void 0 ? void 0 : popup2.focus();
|
|
1251
|
+
if (!popup2) {
|
|
1252
|
+
return null;
|
|
1253
|
+
}
|
|
1254
|
+
return popup2;
|
|
1255
|
+
}
|
|
1256
|
+
const popup = tryOpenPopup();
|
|
1257
|
+
if (!popup) {
|
|
1258
|
+
return openPopupWithDialog(tryOpenPopup);
|
|
1259
|
+
}
|
|
1260
|
+
return Promise.resolve(popup);
|
|
1261
|
+
}
|
|
1262
|
+
function closePopup(popup) {
|
|
1263
|
+
if (popup && !popup.closed) {
|
|
1264
|
+
popup.close();
|
|
1265
|
+
}
|
|
1266
|
+
}
|
|
1267
|
+
function appendAppInfoQueryParams(url) {
|
|
1268
|
+
const params = {
|
|
1269
|
+
sdkName: PACKAGE_NAME,
|
|
1270
|
+
sdkVersion: PACKAGE_VERSION,
|
|
1271
|
+
origin: window.location.origin,
|
|
1272
|
+
coop: getCrossOriginOpenerPolicy()
|
|
1273
|
+
};
|
|
1274
|
+
for (const [key, value] of Object.entries(params)) {
|
|
1275
|
+
if (!url.searchParams.has(key)) {
|
|
1276
|
+
url.searchParams.append(key, value.toString());
|
|
1277
|
+
}
|
|
1278
|
+
}
|
|
1279
|
+
}
|
|
1280
|
+
function openPopupWithDialog(tryOpenPopup) {
|
|
1281
|
+
var _a, _b;
|
|
1282
|
+
const dappName = (_b = (_a = store.config.get().metadata) === null || _a === void 0 ? void 0 : _a.appName) !== null && _b !== void 0 ? _b : "App";
|
|
1283
|
+
const dialog2 = initDialog();
|
|
1284
|
+
return new Promise((resolve, reject) => {
|
|
1285
|
+
logDialogShown({ dialogContext: "popup_blocked" });
|
|
1286
|
+
dialog2.presentItem({
|
|
1287
|
+
title: POPUP_BLOCKED_TITLE.replace("{app}", dappName),
|
|
1288
|
+
message: POPUP_BLOCKED_MESSAGE,
|
|
1289
|
+
onClose: () => {
|
|
1290
|
+
logDialogActionClicked({
|
|
1291
|
+
dialogContext: "popup_blocked",
|
|
1292
|
+
dialogAction: "cancel"
|
|
1293
|
+
});
|
|
1294
|
+
reject(standardErrors.rpc.internal("Popup window was blocked"));
|
|
1295
|
+
},
|
|
1296
|
+
actionItems: [
|
|
1297
|
+
{
|
|
1298
|
+
text: "Try again",
|
|
1299
|
+
variant: "primary",
|
|
1300
|
+
onClick: () => {
|
|
1301
|
+
logDialogActionClicked({
|
|
1302
|
+
dialogContext: "popup_blocked",
|
|
1303
|
+
dialogAction: "confirm"
|
|
1304
|
+
});
|
|
1305
|
+
const popup = tryOpenPopup();
|
|
1306
|
+
if (popup) {
|
|
1307
|
+
resolve(popup);
|
|
1308
|
+
} else {
|
|
1309
|
+
reject(standardErrors.rpc.internal("Popup window was blocked"));
|
|
1310
|
+
}
|
|
1311
|
+
dialog2.clear();
|
|
1312
|
+
}
|
|
1313
|
+
},
|
|
1314
|
+
{
|
|
1315
|
+
text: "Cancel",
|
|
1316
|
+
variant: "secondary",
|
|
1317
|
+
onClick: () => {
|
|
1318
|
+
logDialogActionClicked({
|
|
1319
|
+
dialogContext: "popup_blocked",
|
|
1320
|
+
dialogAction: "cancel"
|
|
1321
|
+
});
|
|
1322
|
+
reject(standardErrors.rpc.internal("Popup window was blocked"));
|
|
1323
|
+
dialog2.clear();
|
|
1324
|
+
}
|
|
1325
|
+
}
|
|
1326
|
+
]
|
|
1327
|
+
});
|
|
1328
|
+
});
|
|
1329
|
+
}
|
|
1330
|
+
class Communicator {
|
|
1331
|
+
constructor({ url = CB_KEYS_URL, metadata, preference }) {
|
|
1332
|
+
this.popup = null;
|
|
1333
|
+
this.listeners = /* @__PURE__ */ new Map();
|
|
1334
|
+
this.postMessage = async (message) => {
|
|
1335
|
+
const popup = await this.waitForPopupLoaded();
|
|
1336
|
+
popup.postMessage(message, this.url.origin);
|
|
1337
|
+
};
|
|
1338
|
+
this.postRequestAndWaitForResponse = async (request) => {
|
|
1339
|
+
const responsePromise = this.onMessage(({ requestId }) => requestId === request.id);
|
|
1340
|
+
this.postMessage(request);
|
|
1341
|
+
return await responsePromise;
|
|
1342
|
+
};
|
|
1343
|
+
this.onMessage = async (predicate) => {
|
|
1344
|
+
return new Promise((resolve, reject) => {
|
|
1345
|
+
const listener = (event) => {
|
|
1346
|
+
if (event.origin !== this.url.origin)
|
|
1347
|
+
return;
|
|
1348
|
+
const message = event.data;
|
|
1349
|
+
if (predicate(message)) {
|
|
1350
|
+
resolve(message);
|
|
1351
|
+
window.removeEventListener("message", listener);
|
|
1352
|
+
this.listeners.delete(listener);
|
|
1353
|
+
}
|
|
1354
|
+
};
|
|
1355
|
+
window.addEventListener("message", listener);
|
|
1356
|
+
this.listeners.set(listener, { reject });
|
|
1357
|
+
});
|
|
1358
|
+
};
|
|
1359
|
+
this.disconnect = () => {
|
|
1360
|
+
closePopup(this.popup);
|
|
1361
|
+
this.popup = null;
|
|
1362
|
+
this.listeners.forEach(({ reject }, listener) => {
|
|
1363
|
+
reject(standardErrors.provider.userRejectedRequest("Request rejected"));
|
|
1364
|
+
window.removeEventListener("message", listener);
|
|
1365
|
+
});
|
|
1366
|
+
this.listeners.clear();
|
|
1367
|
+
};
|
|
1368
|
+
this.waitForPopupLoaded = async () => {
|
|
1369
|
+
if (this.popup && !this.popup.closed) {
|
|
1370
|
+
this.popup.focus();
|
|
1371
|
+
return this.popup;
|
|
1372
|
+
}
|
|
1373
|
+
logPopupSetupStarted();
|
|
1374
|
+
this.popup = await openPopup(this.url);
|
|
1375
|
+
this.onMessage(({ event }) => event === "PopupUnload").then(() => {
|
|
1376
|
+
this.disconnect();
|
|
1377
|
+
logPopupUnloadReceived();
|
|
1378
|
+
}).catch(() => {
|
|
1379
|
+
});
|
|
1380
|
+
return this.onMessage(({ event }) => event === "PopupLoaded").then((message) => {
|
|
1381
|
+
this.postMessage({
|
|
1382
|
+
requestId: message.id,
|
|
1383
|
+
data: {
|
|
1384
|
+
version: PACKAGE_VERSION,
|
|
1385
|
+
sdkName: PACKAGE_NAME,
|
|
1386
|
+
metadata: this.metadata,
|
|
1387
|
+
preference: this.preference,
|
|
1388
|
+
location: window.location.toString()
|
|
1389
|
+
}
|
|
1390
|
+
});
|
|
1391
|
+
}).then(() => {
|
|
1392
|
+
if (!this.popup)
|
|
1393
|
+
throw standardErrors.rpc.internal();
|
|
1394
|
+
logPopupSetupCompleted();
|
|
1395
|
+
return this.popup;
|
|
1396
|
+
});
|
|
1397
|
+
};
|
|
1398
|
+
this.url = new URL(url);
|
|
1399
|
+
this.metadata = metadata;
|
|
1400
|
+
this.preference = preference;
|
|
1401
|
+
}
|
|
1402
|
+
}
|
|
1403
|
+
function serializeError(error) {
|
|
1404
|
+
const serialized = serialize(getErrorObject(error), {
|
|
1405
|
+
shouldIncludeStack: true
|
|
1406
|
+
});
|
|
1407
|
+
const docUrl = new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");
|
|
1408
|
+
docUrl.searchParams.set("version", PACKAGE_VERSION);
|
|
1409
|
+
docUrl.searchParams.set("code", serialized.code.toString());
|
|
1410
|
+
docUrl.searchParams.set("message", serialized.message);
|
|
1411
|
+
return Object.assign(Object.assign({}, serialized), { docUrl: docUrl.href });
|
|
1412
|
+
}
|
|
1413
|
+
function isErrorResponse(response) {
|
|
1414
|
+
return response.errorMessage !== void 0;
|
|
1415
|
+
}
|
|
1416
|
+
function getErrorObject(error) {
|
|
1417
|
+
var _a;
|
|
1418
|
+
if (typeof error === "string") {
|
|
1419
|
+
return {
|
|
1420
|
+
message: error,
|
|
1421
|
+
code: standardErrorCodes.rpc.internal
|
|
1422
|
+
};
|
|
1423
|
+
}
|
|
1424
|
+
if (isErrorResponse(error)) {
|
|
1425
|
+
const message = error.errorMessage;
|
|
1426
|
+
const code = (_a = error.errorCode) !== null && _a !== void 0 ? _a : message.match(/(denied|rejected)/i) ? standardErrorCodes.provider.userRejectedRequest : void 0;
|
|
1427
|
+
return Object.assign(Object.assign({}, error), {
|
|
1428
|
+
message,
|
|
1429
|
+
code,
|
|
1430
|
+
data: { method: error.method }
|
|
1431
|
+
});
|
|
1432
|
+
}
|
|
1433
|
+
return error;
|
|
1434
|
+
}
|
|
1435
|
+
class ProviderEventEmitter extends EventEmitter {
|
|
1436
|
+
}
|
|
1437
|
+
const logRequestStarted$1 = ({ method, correlationId }) => {
|
|
1438
|
+
logEvent("provider.request.started", {
|
|
1439
|
+
action: ActionType.unknown,
|
|
1440
|
+
componentType: ComponentType.unknown,
|
|
1441
|
+
method,
|
|
1442
|
+
signerType: "base-account",
|
|
1443
|
+
correlationId
|
|
1444
|
+
}, AnalyticsEventImportance.high);
|
|
1445
|
+
};
|
|
1446
|
+
const logRequestError$1 = ({ method, correlationId, errorMessage }) => {
|
|
1447
|
+
logEvent("provider.request.error", {
|
|
1448
|
+
action: ActionType.error,
|
|
1449
|
+
componentType: ComponentType.unknown,
|
|
1450
|
+
method,
|
|
1451
|
+
signerType: "base-account",
|
|
1452
|
+
correlationId,
|
|
1453
|
+
errorMessage
|
|
1454
|
+
}, AnalyticsEventImportance.high);
|
|
1455
|
+
};
|
|
1456
|
+
const logRequestResponded = ({ method, correlationId }) => {
|
|
1457
|
+
logEvent("provider.request.responded", {
|
|
1458
|
+
action: ActionType.unknown,
|
|
1459
|
+
componentType: ComponentType.unknown,
|
|
1460
|
+
method,
|
|
1461
|
+
signerType: "base-account",
|
|
1462
|
+
correlationId
|
|
1463
|
+
}, AnalyticsEventImportance.high);
|
|
1464
|
+
};
|
|
1465
|
+
function OpaqueType() {
|
|
1466
|
+
return (value) => value;
|
|
1467
|
+
}
|
|
1468
|
+
const HexString = OpaqueType();
|
|
1469
|
+
function IntNumber(num) {
|
|
1470
|
+
return Math.floor(num);
|
|
1471
|
+
}
|
|
1472
|
+
const INT_STRING_REGEX = /^[0-9]*$/;
|
|
1473
|
+
const HEXADECIMAL_STRING_REGEX = /^[a-f0-9]*$/;
|
|
1474
|
+
function uint8ArrayToHex(value) {
|
|
1475
|
+
return [...value].map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
1476
|
+
}
|
|
1477
|
+
function hexStringToUint8Array(hexString) {
|
|
1478
|
+
return new Uint8Array(hexString.match(/.{1,2}/g).map((byte) => Number.parseInt(byte, 16)));
|
|
1479
|
+
}
|
|
1480
|
+
function hexStringFromNumber(num) {
|
|
1481
|
+
return HexString(`0x${BigInt(num).toString(16)}`);
|
|
1482
|
+
}
|
|
1483
|
+
function has0xPrefix(str) {
|
|
1484
|
+
return str.startsWith("0x") || str.startsWith("0X");
|
|
1485
|
+
}
|
|
1486
|
+
function strip0x(hex) {
|
|
1487
|
+
if (has0xPrefix(hex)) {
|
|
1488
|
+
return hex.slice(2);
|
|
1489
|
+
}
|
|
1490
|
+
return hex;
|
|
1491
|
+
}
|
|
1492
|
+
function isHexString(hex) {
|
|
1493
|
+
if (typeof hex !== "string") {
|
|
1494
|
+
return false;
|
|
1495
|
+
}
|
|
1496
|
+
const s = strip0x(hex).toLowerCase();
|
|
1497
|
+
return HEXADECIMAL_STRING_REGEX.test(s);
|
|
1498
|
+
}
|
|
1499
|
+
function ensureHexString(hex, includePrefix = false) {
|
|
1500
|
+
if (typeof hex === "string") {
|
|
1501
|
+
const s = strip0x(hex).toLowerCase();
|
|
1502
|
+
if (HEXADECIMAL_STRING_REGEX.test(s)) {
|
|
1503
|
+
return HexString(includePrefix ? `0x${s}` : s);
|
|
1504
|
+
}
|
|
1505
|
+
}
|
|
1506
|
+
throw standardErrors.rpc.invalidParams(`"${String(hex)}" is not a hexadecimal string`);
|
|
1507
|
+
}
|
|
1508
|
+
function ensureEvenLengthHexString(hex, includePrefix = false) {
|
|
1509
|
+
let h2 = ensureHexString(hex, false);
|
|
1510
|
+
if (h2.length % 2 === 1) {
|
|
1511
|
+
h2 = HexString(`0${h2}`);
|
|
1512
|
+
}
|
|
1513
|
+
return includePrefix ? HexString(`0x${h2}`) : h2;
|
|
1514
|
+
}
|
|
1515
|
+
function ensureIntNumber(num) {
|
|
1516
|
+
if (typeof num === "number" && Number.isInteger(num)) {
|
|
1517
|
+
return IntNumber(num);
|
|
1518
|
+
}
|
|
1519
|
+
if (typeof num === "string") {
|
|
1520
|
+
if (INT_STRING_REGEX.test(num)) {
|
|
1521
|
+
return IntNumber(Number(num));
|
|
1522
|
+
}
|
|
1523
|
+
if (isHexString(num)) {
|
|
1524
|
+
return IntNumber(Number(BigInt(ensureEvenLengthHexString(num, true))));
|
|
1525
|
+
}
|
|
1526
|
+
}
|
|
1527
|
+
throw standardErrors.rpc.invalidParams(`Not an integer: ${String(num)}`);
|
|
1528
|
+
}
|
|
1529
|
+
const logHandshakeStarted = ({ method, correlationId }) => {
|
|
1530
|
+
var _a;
|
|
1531
|
+
logEvent("scw_signer.handshake.started", {
|
|
1532
|
+
action: ActionType.unknown,
|
|
1533
|
+
componentType: ComponentType.unknown,
|
|
1534
|
+
method,
|
|
1535
|
+
correlationId,
|
|
1536
|
+
enableAutoSubAccounts: (_a = store.subAccountsConfig.get()) === null || _a === void 0 ? void 0 : _a.enableAutoSubAccounts
|
|
1537
|
+
}, AnalyticsEventImportance.high);
|
|
1538
|
+
};
|
|
1539
|
+
const logHandshakeError = ({ method, correlationId, errorMessage }) => {
|
|
1540
|
+
var _a;
|
|
1541
|
+
logEvent("scw_signer.handshake.error", {
|
|
1542
|
+
action: ActionType.error,
|
|
1543
|
+
componentType: ComponentType.unknown,
|
|
1544
|
+
method,
|
|
1545
|
+
correlationId,
|
|
1546
|
+
errorMessage,
|
|
1547
|
+
enableAutoSubAccounts: (_a = store.subAccountsConfig.get()) === null || _a === void 0 ? void 0 : _a.enableAutoSubAccounts
|
|
1548
|
+
}, AnalyticsEventImportance.high);
|
|
1549
|
+
};
|
|
1550
|
+
const logHandshakeCompleted = ({ method, correlationId }) => {
|
|
1551
|
+
var _a;
|
|
1552
|
+
logEvent("scw_signer.handshake.completed", {
|
|
1553
|
+
action: ActionType.unknown,
|
|
1554
|
+
componentType: ComponentType.unknown,
|
|
1555
|
+
method,
|
|
1556
|
+
correlationId,
|
|
1557
|
+
enableAutoSubAccounts: (_a = store.subAccountsConfig.get()) === null || _a === void 0 ? void 0 : _a.enableAutoSubAccounts
|
|
1558
|
+
}, AnalyticsEventImportance.high);
|
|
1559
|
+
};
|
|
1560
|
+
const logRequestStarted = ({ method, correlationId }) => {
|
|
1561
|
+
var _a;
|
|
1562
|
+
logEvent("scw_signer.request.started", {
|
|
1563
|
+
action: ActionType.unknown,
|
|
1564
|
+
componentType: ComponentType.unknown,
|
|
1565
|
+
method,
|
|
1566
|
+
correlationId,
|
|
1567
|
+
enableAutoSubAccounts: (_a = store.subAccountsConfig.get()) === null || _a === void 0 ? void 0 : _a.enableAutoSubAccounts
|
|
1568
|
+
}, AnalyticsEventImportance.high);
|
|
1569
|
+
};
|
|
1570
|
+
const logRequestError = ({ method, correlationId, errorMessage }) => {
|
|
1571
|
+
var _a;
|
|
1572
|
+
logEvent("scw_signer.request.error", {
|
|
1573
|
+
action: ActionType.error,
|
|
1574
|
+
componentType: ComponentType.unknown,
|
|
1575
|
+
method,
|
|
1576
|
+
correlationId,
|
|
1577
|
+
errorMessage,
|
|
1578
|
+
enableAutoSubAccounts: (_a = store.subAccountsConfig.get()) === null || _a === void 0 ? void 0 : _a.enableAutoSubAccounts
|
|
1579
|
+
}, AnalyticsEventImportance.high);
|
|
1580
|
+
};
|
|
1581
|
+
const logRequestCompleted = ({ method, correlationId }) => {
|
|
1582
|
+
var _a;
|
|
1583
|
+
logEvent("scw_signer.request.completed", {
|
|
1584
|
+
action: ActionType.unknown,
|
|
1585
|
+
componentType: ComponentType.unknown,
|
|
1586
|
+
method,
|
|
1587
|
+
correlationId,
|
|
1588
|
+
enableAutoSubAccounts: (_a = store.subAccountsConfig.get()) === null || _a === void 0 ? void 0 : _a.enableAutoSubAccounts
|
|
1589
|
+
}, AnalyticsEventImportance.high);
|
|
1590
|
+
};
|
|
1591
|
+
const logSubAccountRequestStarted = ({ method, correlationId }) => {
|
|
1592
|
+
var _a;
|
|
1593
|
+
logEvent("scw_sub_account.request.started", {
|
|
1594
|
+
action: ActionType.unknown,
|
|
1595
|
+
componentType: ComponentType.unknown,
|
|
1596
|
+
method,
|
|
1597
|
+
correlationId,
|
|
1598
|
+
enableAutoSubAccounts: (_a = store.subAccountsConfig.get()) === null || _a === void 0 ? void 0 : _a.enableAutoSubAccounts
|
|
1599
|
+
}, AnalyticsEventImportance.high);
|
|
1600
|
+
};
|
|
1601
|
+
const logSubAccountRequestCompleted = ({ method, correlationId }) => {
|
|
1602
|
+
var _a;
|
|
1603
|
+
logEvent("scw_sub_account.request.completed", {
|
|
1604
|
+
action: ActionType.unknown,
|
|
1605
|
+
componentType: ComponentType.unknown,
|
|
1606
|
+
method,
|
|
1607
|
+
correlationId,
|
|
1608
|
+
enableAutoSubAccounts: (_a = store.subAccountsConfig.get()) === null || _a === void 0 ? void 0 : _a.enableAutoSubAccounts
|
|
1609
|
+
}, AnalyticsEventImportance.high);
|
|
1610
|
+
};
|
|
1611
|
+
const logSubAccountRequestError = ({ method, correlationId, errorMessage }) => {
|
|
1612
|
+
var _a;
|
|
1613
|
+
logEvent("scw_sub_account.request.error", {
|
|
1614
|
+
action: ActionType.error,
|
|
1615
|
+
componentType: ComponentType.unknown,
|
|
1616
|
+
method,
|
|
1617
|
+
correlationId,
|
|
1618
|
+
errorMessage,
|
|
1619
|
+
enableAutoSubAccounts: (_a = store.subAccountsConfig.get()) === null || _a === void 0 ? void 0 : _a.enableAutoSubAccounts
|
|
1620
|
+
}, AnalyticsEventImportance.high);
|
|
1621
|
+
};
|
|
1622
|
+
const logAddOwnerStarted = ({ method, correlationId }) => {
|
|
1623
|
+
var _a;
|
|
1624
|
+
logEvent("scw_sub_account.add_owner.started", {
|
|
1625
|
+
action: ActionType.unknown,
|
|
1626
|
+
componentType: ComponentType.unknown,
|
|
1627
|
+
method,
|
|
1628
|
+
correlationId,
|
|
1629
|
+
enableAutoSubAccounts: (_a = store.subAccountsConfig.get()) === null || _a === void 0 ? void 0 : _a.enableAutoSubAccounts
|
|
1630
|
+
}, AnalyticsEventImportance.high);
|
|
1631
|
+
};
|
|
1632
|
+
const logAddOwnerCompleted = ({ method, correlationId }) => {
|
|
1633
|
+
var _a;
|
|
1634
|
+
logEvent("scw_sub_account.add_owner.completed", {
|
|
1635
|
+
action: ActionType.unknown,
|
|
1636
|
+
componentType: ComponentType.unknown,
|
|
1637
|
+
method,
|
|
1638
|
+
correlationId,
|
|
1639
|
+
enableAutoSubAccounts: (_a = store.subAccountsConfig.get()) === null || _a === void 0 ? void 0 : _a.enableAutoSubAccounts
|
|
1640
|
+
}, AnalyticsEventImportance.high);
|
|
1641
|
+
};
|
|
1642
|
+
const logAddOwnerError = ({ method, correlationId, errorMessage }) => {
|
|
1643
|
+
var _a;
|
|
1644
|
+
logEvent("scw_sub_account.add_owner.error", {
|
|
1645
|
+
action: ActionType.error,
|
|
1646
|
+
componentType: ComponentType.unknown,
|
|
1647
|
+
method,
|
|
1648
|
+
correlationId,
|
|
1649
|
+
errorMessage,
|
|
1650
|
+
enableAutoSubAccounts: (_a = store.subAccountsConfig.get()) === null || _a === void 0 ? void 0 : _a.enableAutoSubAccounts
|
|
1651
|
+
}, AnalyticsEventImportance.high);
|
|
1652
|
+
};
|
|
1653
|
+
const logInsufficientBalanceErrorHandlingStarted = ({ method, correlationId }) => {
|
|
1654
|
+
var _a;
|
|
1655
|
+
logEvent("scw_sub_account.insufficient_balance.error_handling.started", {
|
|
1656
|
+
action: ActionType.unknown,
|
|
1657
|
+
componentType: ComponentType.unknown,
|
|
1658
|
+
method,
|
|
1659
|
+
correlationId,
|
|
1660
|
+
enableAutoSubAccounts: (_a = store.subAccountsConfig.get()) === null || _a === void 0 ? void 0 : _a.enableAutoSubAccounts
|
|
1661
|
+
}, AnalyticsEventImportance.high);
|
|
1662
|
+
};
|
|
1663
|
+
const logInsufficientBalanceErrorHandlingCompleted = ({ method, correlationId }) => {
|
|
1664
|
+
var _a;
|
|
1665
|
+
logEvent("scw_sub_account.insufficient_balance.error_handling.completed", {
|
|
1666
|
+
action: ActionType.unknown,
|
|
1667
|
+
componentType: ComponentType.unknown,
|
|
1668
|
+
method,
|
|
1669
|
+
correlationId,
|
|
1670
|
+
enableAutoSubAccounts: (_a = store.subAccountsConfig.get()) === null || _a === void 0 ? void 0 : _a.enableAutoSubAccounts
|
|
1671
|
+
}, AnalyticsEventImportance.high);
|
|
1672
|
+
};
|
|
1673
|
+
const logInsufficientBalanceErrorHandlingError = ({ method, correlationId, errorMessage }) => {
|
|
1674
|
+
var _a;
|
|
1675
|
+
logEvent("scw_sub_account.insufficient_balance.error_handling.error", {
|
|
1676
|
+
action: ActionType.error,
|
|
1677
|
+
componentType: ComponentType.unknown,
|
|
1678
|
+
method,
|
|
1679
|
+
correlationId,
|
|
1680
|
+
errorMessage,
|
|
1681
|
+
enableAutoSubAccounts: (_a = store.subAccountsConfig.get()) === null || _a === void 0 ? void 0 : _a.enableAutoSubAccounts
|
|
1682
|
+
}, AnalyticsEventImportance.high);
|
|
1683
|
+
};
|
|
1684
|
+
const parseErrorMessageFromAny = (errorOrAny) => {
|
|
1685
|
+
return "message" in errorOrAny && typeof errorOrAny.message === "string" ? errorOrAny.message : "";
|
|
1686
|
+
};
|
|
1687
|
+
const ChainClients = createStore(() => ({}));
|
|
1688
|
+
function createClients(chains2) {
|
|
1689
|
+
chains2.forEach((c) => {
|
|
1690
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1691
|
+
if (!c.rpcUrl) {
|
|
1692
|
+
return;
|
|
1693
|
+
}
|
|
1694
|
+
const viemchain = defineChain({
|
|
1695
|
+
id: c.id,
|
|
1696
|
+
rpcUrls: {
|
|
1697
|
+
default: {
|
|
1698
|
+
http: [c.rpcUrl]
|
|
1699
|
+
}
|
|
1700
|
+
},
|
|
1701
|
+
name: (_b = (_a = c.nativeCurrency) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : "",
|
|
1702
|
+
nativeCurrency: {
|
|
1703
|
+
name: (_d = (_c = c.nativeCurrency) === null || _c === void 0 ? void 0 : _c.name) !== null && _d !== void 0 ? _d : "",
|
|
1704
|
+
symbol: (_f = (_e = c.nativeCurrency) === null || _e === void 0 ? void 0 : _e.symbol) !== null && _f !== void 0 ? _f : "",
|
|
1705
|
+
decimals: (_h = (_g = c.nativeCurrency) === null || _g === void 0 ? void 0 : _g.decimal) !== null && _h !== void 0 ? _h : 18
|
|
1706
|
+
}
|
|
1707
|
+
});
|
|
1708
|
+
const client = createPublicClient({
|
|
1709
|
+
chain: viemchain,
|
|
1710
|
+
transport: http(c.rpcUrl)
|
|
1711
|
+
});
|
|
1712
|
+
const bundlerClient = createBundlerClient({
|
|
1713
|
+
client,
|
|
1714
|
+
transport: http(c.rpcUrl)
|
|
1715
|
+
});
|
|
1716
|
+
ChainClients.setState({
|
|
1717
|
+
[c.id]: {
|
|
1718
|
+
client,
|
|
1719
|
+
bundlerClient
|
|
1720
|
+
}
|
|
1721
|
+
});
|
|
1722
|
+
});
|
|
1723
|
+
}
|
|
1724
|
+
function getClient(chainId) {
|
|
1725
|
+
var _a;
|
|
1726
|
+
return (_a = ChainClients.getState()[chainId]) === null || _a === void 0 ? void 0 : _a.client;
|
|
1727
|
+
}
|
|
1728
|
+
const correlationIdsStore = createStore(() => ({
|
|
1729
|
+
correlationIds: /* @__PURE__ */ new Map()
|
|
1730
|
+
}));
|
|
1731
|
+
const correlationIds = {
|
|
1732
|
+
get: (key) => {
|
|
1733
|
+
const correlationId = correlationIdsStore.getState().correlationIds.get(key);
|
|
1734
|
+
return correlationId;
|
|
1735
|
+
},
|
|
1736
|
+
set: (key, correlationId) => {
|
|
1737
|
+
correlationIdsStore.setState((state) => {
|
|
1738
|
+
const newMap = new Map(state.correlationIds);
|
|
1739
|
+
newMap.set(key, correlationId);
|
|
1740
|
+
return { correlationIds: newMap };
|
|
1741
|
+
});
|
|
1742
|
+
},
|
|
1743
|
+
delete: (key) => {
|
|
1744
|
+
correlationIdsStore.setState((state) => {
|
|
1745
|
+
const newMap = new Map(state.correlationIds);
|
|
1746
|
+
newMap.delete(key);
|
|
1747
|
+
return { correlationIds: newMap };
|
|
1748
|
+
});
|
|
1749
|
+
},
|
|
1750
|
+
clear: () => {
|
|
1751
|
+
correlationIdsStore.setState({
|
|
1752
|
+
correlationIds: /* @__PURE__ */ new Map()
|
|
1753
|
+
});
|
|
1754
|
+
}
|
|
1755
|
+
};
|
|
1756
|
+
function assertSubAccount(info) {
|
|
1757
|
+
if (typeof info !== "object" || info === null) {
|
|
1758
|
+
throw standardErrors.rpc.internal("sub account info is not an object");
|
|
1759
|
+
}
|
|
1760
|
+
if (!("address" in info)) {
|
|
1761
|
+
throw standardErrors.rpc.internal("sub account is invalid");
|
|
1762
|
+
}
|
|
1763
|
+
if ("address" in info && typeof info.address === "string" && !isAddress(info.address)) {
|
|
1764
|
+
throw standardErrors.rpc.internal("sub account address is invalid");
|
|
1765
|
+
}
|
|
1766
|
+
if ("factory" in info && typeof info.factory === "string" && !isAddress(info.factory)) {
|
|
1767
|
+
throw standardErrors.rpc.internal("sub account factory address is invalid");
|
|
1768
|
+
}
|
|
1769
|
+
if ("factoryData" in info && typeof info.factoryData === "string" && !isHex(info.factoryData)) {
|
|
1770
|
+
throw standardErrors.rpc.internal("sub account factory data is invalid");
|
|
1771
|
+
}
|
|
1772
|
+
}
|
|
1773
|
+
async function generateKeyPair$1() {
|
|
1774
|
+
return crypto.subtle.generateKey({
|
|
1775
|
+
name: "ECDH",
|
|
1776
|
+
namedCurve: "P-256"
|
|
1777
|
+
}, true, ["deriveKey"]);
|
|
1778
|
+
}
|
|
1779
|
+
async function deriveSharedSecret(ownPrivateKey, peerPublicKey) {
|
|
1780
|
+
return crypto.subtle.deriveKey({
|
|
1781
|
+
name: "ECDH",
|
|
1782
|
+
public: peerPublicKey
|
|
1783
|
+
}, ownPrivateKey, {
|
|
1784
|
+
name: "AES-GCM",
|
|
1785
|
+
length: 256
|
|
1786
|
+
}, false, ["encrypt", "decrypt"]);
|
|
1787
|
+
}
|
|
1788
|
+
async function encrypt(sharedSecret, plainText) {
|
|
1789
|
+
const iv = crypto.getRandomValues(new Uint8Array(12));
|
|
1790
|
+
const cipherText = await crypto.subtle.encrypt({
|
|
1791
|
+
name: "AES-GCM",
|
|
1792
|
+
iv
|
|
1793
|
+
}, sharedSecret, new TextEncoder().encode(plainText));
|
|
1794
|
+
return { iv, cipherText };
|
|
1795
|
+
}
|
|
1796
|
+
async function decrypt(sharedSecret, { iv, cipherText }) {
|
|
1797
|
+
const plainText = await crypto.subtle.decrypt({
|
|
1798
|
+
name: "AES-GCM",
|
|
1799
|
+
iv
|
|
1800
|
+
}, sharedSecret, cipherText);
|
|
1801
|
+
return new TextDecoder().decode(plainText);
|
|
1802
|
+
}
|
|
1803
|
+
function getFormat(keyType) {
|
|
1804
|
+
switch (keyType) {
|
|
1805
|
+
case "public":
|
|
1806
|
+
return "spki";
|
|
1807
|
+
case "private":
|
|
1808
|
+
return "pkcs8";
|
|
1809
|
+
}
|
|
1810
|
+
}
|
|
1811
|
+
async function exportKeyToHexString(type, key) {
|
|
1812
|
+
const format = getFormat(type);
|
|
1813
|
+
const exported = await crypto.subtle.exportKey(format, key);
|
|
1814
|
+
return uint8ArrayToHex(new Uint8Array(exported));
|
|
1815
|
+
}
|
|
1816
|
+
async function importKeyFromHexString(type, hexString) {
|
|
1817
|
+
const format = getFormat(type);
|
|
1818
|
+
const arrayBuffer = hexStringToUint8Array(hexString).buffer;
|
|
1819
|
+
return await crypto.subtle.importKey(format, new Uint8Array(arrayBuffer), {
|
|
1820
|
+
name: "ECDH",
|
|
1821
|
+
namedCurve: "P-256"
|
|
1822
|
+
}, true, type === "private" ? ["deriveKey"] : []);
|
|
1823
|
+
}
|
|
1824
|
+
async function encryptContent(content, sharedSecret) {
|
|
1825
|
+
const serialized = JSON.stringify(content, (_2, value) => {
|
|
1826
|
+
if (!(value instanceof Error))
|
|
1827
|
+
return value;
|
|
1828
|
+
const error = value;
|
|
1829
|
+
return Object.assign(Object.assign({}, error.code ? { code: error.code } : {}), { message: error.message });
|
|
1830
|
+
});
|
|
1831
|
+
return encrypt(sharedSecret, serialized);
|
|
1832
|
+
}
|
|
1833
|
+
async function decryptContent(encryptedData, sharedSecret) {
|
|
1834
|
+
return JSON.parse(await decrypt(sharedSecret, encryptedData));
|
|
1835
|
+
}
|
|
1836
|
+
async function fetchRPCRequest(request, rpcUrl) {
|
|
1837
|
+
const requestBody = Object.assign(Object.assign({}, request), { jsonrpc: "2.0", id: crypto.randomUUID() });
|
|
1838
|
+
const res = await window.fetch(rpcUrl, {
|
|
1839
|
+
method: "POST",
|
|
1840
|
+
body: JSON.stringify(requestBody),
|
|
1841
|
+
mode: "cors",
|
|
1842
|
+
headers: {
|
|
1843
|
+
"Content-Type": "application/json",
|
|
1844
|
+
"X-Cbw-Sdk-Version": PACKAGE_VERSION,
|
|
1845
|
+
"X-Cbw-Sdk-Platform": PACKAGE_NAME
|
|
1846
|
+
}
|
|
1847
|
+
});
|
|
1848
|
+
const { result, error } = await res.json();
|
|
1849
|
+
if (error)
|
|
1850
|
+
throw error;
|
|
1851
|
+
return result;
|
|
1852
|
+
}
|
|
1853
|
+
function checkErrorForInvalidRequestArgs(args) {
|
|
1854
|
+
if (!args || typeof args !== "object" || Array.isArray(args)) {
|
|
1855
|
+
throw standardErrors.rpc.invalidParams({
|
|
1856
|
+
message: "Expected a single, non-array, object argument.",
|
|
1857
|
+
data: args
|
|
1858
|
+
});
|
|
1859
|
+
}
|
|
1860
|
+
const { method, params } = args;
|
|
1861
|
+
if (typeof method !== "string" || method.length === 0) {
|
|
1862
|
+
throw standardErrors.rpc.invalidParams({
|
|
1863
|
+
message: "'args.method' must be a non-empty string.",
|
|
1864
|
+
data: args
|
|
1865
|
+
});
|
|
1866
|
+
}
|
|
1867
|
+
if (params !== void 0 && !Array.isArray(params) && (typeof params !== "object" || params === null)) {
|
|
1868
|
+
throw standardErrors.rpc.invalidParams({
|
|
1869
|
+
message: "'args.params' must be an object or array if provided.",
|
|
1870
|
+
data: args
|
|
1871
|
+
});
|
|
1872
|
+
}
|
|
1873
|
+
switch (method) {
|
|
1874
|
+
case "eth_sign":
|
|
1875
|
+
case "eth_signTypedData_v2":
|
|
1876
|
+
case "eth_subscribe":
|
|
1877
|
+
case "eth_unsubscribe":
|
|
1878
|
+
throw standardErrors.provider.unsupportedMethod();
|
|
1879
|
+
}
|
|
1880
|
+
}
|
|
1881
|
+
function createStorage(scope, name2) {
|
|
1882
|
+
const store2 = typeof indexedDB !== "undefined" ? createStore$1(scope, name2) : void 0;
|
|
1883
|
+
return {
|
|
1884
|
+
getItem: async (key) => {
|
|
1885
|
+
const value = await get$1(key, store2);
|
|
1886
|
+
if (!value) {
|
|
1887
|
+
return null;
|
|
1888
|
+
}
|
|
1889
|
+
return value;
|
|
1890
|
+
},
|
|
1891
|
+
removeItem: async (key) => {
|
|
1892
|
+
return del(key, store2);
|
|
1893
|
+
},
|
|
1894
|
+
setItem: async (key, value) => {
|
|
1895
|
+
return set(key, value, store2);
|
|
1896
|
+
}
|
|
1897
|
+
};
|
|
1898
|
+
}
|
|
1899
|
+
const STORAGE_SCOPE = "base-acc-sdk";
|
|
1900
|
+
const STORAGE_NAME = "keys";
|
|
1901
|
+
const ACTIVE_ID_KEY = "activeId";
|
|
1902
|
+
const storage = createStorage(STORAGE_SCOPE, STORAGE_NAME);
|
|
1903
|
+
async function generateKeyPair() {
|
|
1904
|
+
const keypair = await createKeyPair({ extractable: false });
|
|
1905
|
+
const publicKey = slice(toHex(keypair.publicKey), 1);
|
|
1906
|
+
await storage.setItem(publicKey, keypair);
|
|
1907
|
+
await storage.setItem(ACTIVE_ID_KEY, publicKey);
|
|
1908
|
+
return keypair;
|
|
1909
|
+
}
|
|
1910
|
+
async function getKeypair() {
|
|
1911
|
+
const id = await storage.getItem(ACTIVE_ID_KEY);
|
|
1912
|
+
if (!id) {
|
|
1913
|
+
return null;
|
|
1914
|
+
}
|
|
1915
|
+
const keypair = await storage.getItem(id);
|
|
1916
|
+
if (!keypair) {
|
|
1917
|
+
return null;
|
|
1918
|
+
}
|
|
1919
|
+
return keypair;
|
|
1920
|
+
}
|
|
1921
|
+
async function getOrCreateKeypair() {
|
|
1922
|
+
const keypair = await getKeypair();
|
|
1923
|
+
if (!keypair) {
|
|
1924
|
+
const kp = await generateKeyPair();
|
|
1925
|
+
const pubKey = slice(toHex(kp.publicKey), 1);
|
|
1926
|
+
await storage.setItem(pubKey, kp);
|
|
1927
|
+
await storage.setItem(ACTIVE_ID_KEY, pubKey);
|
|
1928
|
+
return kp;
|
|
1929
|
+
}
|
|
1930
|
+
return keypair;
|
|
1931
|
+
}
|
|
1932
|
+
async function getAccount() {
|
|
1933
|
+
const keypair = await getOrCreateKeypair();
|
|
1934
|
+
const publicKey = slice(toHex(keypair.publicKey), 1);
|
|
1935
|
+
const sign2 = async (payload) => {
|
|
1936
|
+
const { payload: message, metadata } = getSignPayload({
|
|
1937
|
+
challenge: payload,
|
|
1938
|
+
origin: "https://keys.coinbase.com",
|
|
1939
|
+
userVerification: "preferred"
|
|
1940
|
+
});
|
|
1941
|
+
const signature = await sign$1({
|
|
1942
|
+
payload: message,
|
|
1943
|
+
privateKey: keypair.privateKey
|
|
1944
|
+
});
|
|
1945
|
+
return {
|
|
1946
|
+
signature: toHex$1(signature),
|
|
1947
|
+
raw: {},
|
|
1948
|
+
// type changed in viem
|
|
1949
|
+
webauthn: metadata
|
|
1950
|
+
};
|
|
1951
|
+
};
|
|
1952
|
+
return {
|
|
1953
|
+
id: publicKey,
|
|
1954
|
+
publicKey,
|
|
1955
|
+
async sign({ hash }) {
|
|
1956
|
+
return sign2(hash);
|
|
1957
|
+
},
|
|
1958
|
+
async signMessage({ message }) {
|
|
1959
|
+
return sign2(hashMessage(message));
|
|
1960
|
+
},
|
|
1961
|
+
async signTypedData(parameters) {
|
|
1962
|
+
return sign2(hashTypedData(parameters));
|
|
1963
|
+
},
|
|
1964
|
+
type: "webAuthn"
|
|
1965
|
+
};
|
|
1966
|
+
}
|
|
1967
|
+
async function getCryptoKeyAccount() {
|
|
1968
|
+
const account2 = await getAccount();
|
|
1969
|
+
return {
|
|
1970
|
+
account: account2
|
|
1971
|
+
};
|
|
1972
|
+
}
|
|
1973
|
+
const OWN_PRIVATE_KEY = {
|
|
1974
|
+
storageKey: "ownPrivateKey",
|
|
1975
|
+
keyType: "private"
|
|
1976
|
+
};
|
|
1977
|
+
const OWN_PUBLIC_KEY = {
|
|
1978
|
+
storageKey: "ownPublicKey",
|
|
1979
|
+
keyType: "public"
|
|
1980
|
+
};
|
|
1981
|
+
const PEER_PUBLIC_KEY = {
|
|
1982
|
+
storageKey: "peerPublicKey",
|
|
1983
|
+
keyType: "public"
|
|
1984
|
+
};
|
|
1985
|
+
class SCWKeyManager {
|
|
1986
|
+
constructor() {
|
|
1987
|
+
this.ownPrivateKey = null;
|
|
1988
|
+
this.ownPublicKey = null;
|
|
1989
|
+
this.peerPublicKey = null;
|
|
1990
|
+
this.sharedSecret = null;
|
|
1991
|
+
}
|
|
1992
|
+
async getOwnPublicKey() {
|
|
1993
|
+
await this.loadKeysIfNeeded();
|
|
1994
|
+
return this.ownPublicKey;
|
|
1995
|
+
}
|
|
1996
|
+
// returns null if the shared secret is not yet derived
|
|
1997
|
+
async getSharedSecret() {
|
|
1998
|
+
await this.loadKeysIfNeeded();
|
|
1999
|
+
return this.sharedSecret;
|
|
2000
|
+
}
|
|
2001
|
+
async setPeerPublicKey(key) {
|
|
2002
|
+
this.sharedSecret = null;
|
|
2003
|
+
this.peerPublicKey = key;
|
|
2004
|
+
await this.storeKey(PEER_PUBLIC_KEY, key);
|
|
2005
|
+
await this.loadKeysIfNeeded();
|
|
2006
|
+
}
|
|
2007
|
+
async clear() {
|
|
2008
|
+
this.ownPrivateKey = null;
|
|
2009
|
+
this.ownPublicKey = null;
|
|
2010
|
+
this.peerPublicKey = null;
|
|
2011
|
+
this.sharedSecret = null;
|
|
2012
|
+
store.keys.clear();
|
|
2013
|
+
}
|
|
2014
|
+
async generateKeyPair() {
|
|
2015
|
+
const newKeyPair = await generateKeyPair$1();
|
|
2016
|
+
this.ownPrivateKey = newKeyPair.privateKey;
|
|
2017
|
+
this.ownPublicKey = newKeyPair.publicKey;
|
|
2018
|
+
await this.storeKey(OWN_PRIVATE_KEY, newKeyPair.privateKey);
|
|
2019
|
+
await this.storeKey(OWN_PUBLIC_KEY, newKeyPair.publicKey);
|
|
2020
|
+
}
|
|
2021
|
+
async loadKeysIfNeeded() {
|
|
2022
|
+
if (this.ownPrivateKey === null) {
|
|
2023
|
+
this.ownPrivateKey = await this.loadKey(OWN_PRIVATE_KEY);
|
|
2024
|
+
}
|
|
2025
|
+
if (this.ownPublicKey === null) {
|
|
2026
|
+
this.ownPublicKey = await this.loadKey(OWN_PUBLIC_KEY);
|
|
2027
|
+
}
|
|
2028
|
+
if (this.ownPrivateKey === null || this.ownPublicKey === null) {
|
|
2029
|
+
await this.generateKeyPair();
|
|
2030
|
+
}
|
|
2031
|
+
if (this.peerPublicKey === null) {
|
|
2032
|
+
this.peerPublicKey = await this.loadKey(PEER_PUBLIC_KEY);
|
|
2033
|
+
}
|
|
2034
|
+
if (this.sharedSecret === null) {
|
|
2035
|
+
if (this.ownPrivateKey === null || this.peerPublicKey === null)
|
|
2036
|
+
return;
|
|
2037
|
+
this.sharedSecret = await deriveSharedSecret(this.ownPrivateKey, this.peerPublicKey);
|
|
2038
|
+
}
|
|
2039
|
+
}
|
|
2040
|
+
// storage methods
|
|
2041
|
+
async loadKey(item) {
|
|
2042
|
+
const key = store.keys.get(item.storageKey);
|
|
2043
|
+
if (!key)
|
|
2044
|
+
return null;
|
|
2045
|
+
return importKeyFromHexString(item.keyType, key);
|
|
2046
|
+
}
|
|
2047
|
+
async storeKey(item, key) {
|
|
2048
|
+
const hexString = await exportKeyToHexString(item.keyType, key);
|
|
2049
|
+
store.keys.set(item.storageKey, hexString);
|
|
2050
|
+
}
|
|
2051
|
+
}
|
|
2052
|
+
function get(obj, path) {
|
|
2053
|
+
if (typeof obj !== "object" || obj === null)
|
|
2054
|
+
return void 0;
|
|
2055
|
+
return path.split(/[.[\]]+/).filter(Boolean).reduce((value, key) => {
|
|
2056
|
+
if (typeof value === "object" && value !== null) {
|
|
2057
|
+
return value[key];
|
|
2058
|
+
}
|
|
2059
|
+
return void 0;
|
|
2060
|
+
}, obj);
|
|
2061
|
+
}
|
|
2062
|
+
function getSenderFromRequest(request) {
|
|
2063
|
+
var _a;
|
|
2064
|
+
if (!Array.isArray(request.params)) {
|
|
2065
|
+
return null;
|
|
2066
|
+
}
|
|
2067
|
+
switch (request.method) {
|
|
2068
|
+
case "personal_sign":
|
|
2069
|
+
return request.params[1];
|
|
2070
|
+
case "eth_signTypedData_v4":
|
|
2071
|
+
return request.params[0];
|
|
2072
|
+
case "eth_signTransaction":
|
|
2073
|
+
case "eth_sendTransaction":
|
|
2074
|
+
case "wallet_sendCalls":
|
|
2075
|
+
return (_a = request.params[0]) === null || _a === void 0 ? void 0 : _a.from;
|
|
2076
|
+
default:
|
|
2077
|
+
return null;
|
|
2078
|
+
}
|
|
2079
|
+
}
|
|
2080
|
+
function addSenderToRequest(request, sender) {
|
|
2081
|
+
if (!Array.isArray(request.params)) {
|
|
2082
|
+
throw standardErrors.rpc.invalidParams();
|
|
2083
|
+
}
|
|
2084
|
+
const params = [...request.params];
|
|
2085
|
+
switch (request.method) {
|
|
2086
|
+
case "eth_signTransaction":
|
|
2087
|
+
case "eth_sendTransaction":
|
|
2088
|
+
case "wallet_sendCalls":
|
|
2089
|
+
params[0].from = sender;
|
|
2090
|
+
break;
|
|
2091
|
+
case "eth_signTypedData_v4":
|
|
2092
|
+
params[0] = sender;
|
|
2093
|
+
break;
|
|
2094
|
+
case "personal_sign":
|
|
2095
|
+
params[1] = sender;
|
|
2096
|
+
break;
|
|
2097
|
+
}
|
|
2098
|
+
return Object.assign(Object.assign({}, request), { params });
|
|
2099
|
+
}
|
|
2100
|
+
function assertParamsChainId(params) {
|
|
2101
|
+
var _a;
|
|
2102
|
+
if (!params || !Array.isArray(params) || !((_a = params[0]) === null || _a === void 0 ? void 0 : _a.chainId)) {
|
|
2103
|
+
throw standardErrors.rpc.invalidParams();
|
|
2104
|
+
}
|
|
2105
|
+
if (typeof params[0].chainId !== "string" && typeof params[0].chainId !== "number") {
|
|
2106
|
+
throw standardErrors.rpc.invalidParams();
|
|
2107
|
+
}
|
|
2108
|
+
}
|
|
2109
|
+
function assertGetCapabilitiesParams(params) {
|
|
2110
|
+
if (!params || !Array.isArray(params) || params.length !== 1 && params.length !== 2) {
|
|
2111
|
+
throw standardErrors.rpc.invalidParams();
|
|
2112
|
+
}
|
|
2113
|
+
if (typeof params[0] !== "string" || !isAddress(params[0])) {
|
|
2114
|
+
throw standardErrors.rpc.invalidParams();
|
|
2115
|
+
}
|
|
2116
|
+
if (params.length === 2) {
|
|
2117
|
+
if (!Array.isArray(params[1])) {
|
|
2118
|
+
throw standardErrors.rpc.invalidParams();
|
|
2119
|
+
}
|
|
2120
|
+
for (const param of params[1]) {
|
|
2121
|
+
if (typeof param !== "string" || !param.startsWith("0x")) {
|
|
2122
|
+
throw standardErrors.rpc.invalidParams();
|
|
2123
|
+
}
|
|
2124
|
+
}
|
|
2125
|
+
}
|
|
2126
|
+
}
|
|
2127
|
+
function injectRequestCapabilities(request, capabilities) {
|
|
2128
|
+
const modifiedRequest = Object.assign({}, request);
|
|
2129
|
+
if (capabilities && request.method.startsWith("wallet_")) {
|
|
2130
|
+
let requestCapabilities = get(modifiedRequest, "params.0.capabilities");
|
|
2131
|
+
if (typeof requestCapabilities === "undefined") {
|
|
2132
|
+
requestCapabilities = {};
|
|
2133
|
+
}
|
|
2134
|
+
if (typeof requestCapabilities !== "object") {
|
|
2135
|
+
throw standardErrors.rpc.invalidParams();
|
|
2136
|
+
}
|
|
2137
|
+
requestCapabilities = Object.assign(Object.assign({}, capabilities), requestCapabilities);
|
|
2138
|
+
if (modifiedRequest.params && Array.isArray(modifiedRequest.params)) {
|
|
2139
|
+
modifiedRequest.params[0] = Object.assign(Object.assign({}, modifiedRequest.params[0]), { capabilities: requestCapabilities });
|
|
2140
|
+
}
|
|
2141
|
+
}
|
|
2142
|
+
return modifiedRequest;
|
|
2143
|
+
}
|
|
2144
|
+
async function initSubAccountConfig() {
|
|
2145
|
+
var _a;
|
|
2146
|
+
const config2 = (_a = store.subAccountsConfig.get()) !== null && _a !== void 0 ? _a : {};
|
|
2147
|
+
const capabilities = {};
|
|
2148
|
+
if (config2.enableAutoSubAccounts) {
|
|
2149
|
+
const { account: owner } = config2.toOwnerAccount ? await config2.toOwnerAccount() : await getCryptoKeyAccount();
|
|
2150
|
+
if (!owner) {
|
|
2151
|
+
throw standardErrors.provider.unauthorized("No owner account found");
|
|
2152
|
+
}
|
|
2153
|
+
capabilities.addSubAccount = {
|
|
2154
|
+
account: {
|
|
2155
|
+
type: "create",
|
|
2156
|
+
keys: [
|
|
2157
|
+
{
|
|
2158
|
+
type: owner.address ? "address" : "webauthn-p256",
|
|
2159
|
+
publicKey: owner.address || owner.publicKey
|
|
2160
|
+
}
|
|
2161
|
+
]
|
|
2162
|
+
}
|
|
2163
|
+
};
|
|
2164
|
+
}
|
|
2165
|
+
store.subAccountsConfig.set({
|
|
2166
|
+
capabilities
|
|
2167
|
+
});
|
|
2168
|
+
}
|
|
2169
|
+
function assertFetchPermissionsRequest(request) {
|
|
2170
|
+
if (request.method === "coinbase_fetchPermissions" && request.params === void 0) {
|
|
2171
|
+
return;
|
|
2172
|
+
}
|
|
2173
|
+
if (request.method === "coinbase_fetchPermissions" && Array.isArray(request.params) && request.params.length === 1 && typeof request.params[0] === "object") {
|
|
2174
|
+
if (typeof request.params[0].account !== "string" || !request.params[0].chainId.startsWith("0x")) {
|
|
2175
|
+
throw standardErrors.rpc.invalidParams("FetchPermissions - Invalid params: params[0].account must be a hex string");
|
|
2176
|
+
}
|
|
2177
|
+
if (typeof request.params[0].chainId !== "string" || !request.params[0].chainId.startsWith("0x")) {
|
|
2178
|
+
throw standardErrors.rpc.invalidParams("FetchPermissions - Invalid params: params[0].chainId must be a hex string");
|
|
2179
|
+
}
|
|
2180
|
+
if (typeof request.params[0].spender !== "string" || !request.params[0].spender.startsWith("0x")) {
|
|
2181
|
+
throw standardErrors.rpc.invalidParams("FetchPermissions - Invalid params: params[0].spender must be a hex string");
|
|
2182
|
+
}
|
|
2183
|
+
return;
|
|
2184
|
+
}
|
|
2185
|
+
throw standardErrors.rpc.invalidParams();
|
|
2186
|
+
}
|
|
2187
|
+
function fillMissingParamsForFetchPermissions(request) {
|
|
2188
|
+
var _a, _b, _c;
|
|
2189
|
+
if (request.params !== void 0) {
|
|
2190
|
+
return request;
|
|
2191
|
+
}
|
|
2192
|
+
const accountFromStore = (_a = store.getState().account.accounts) === null || _a === void 0 ? void 0 : _a[0];
|
|
2193
|
+
const chainId = (_b = store.getState().account.chain) === null || _b === void 0 ? void 0 : _b.id;
|
|
2194
|
+
const subAccountFromStore = (_c = store.getState().subAccount) === null || _c === void 0 ? void 0 : _c.address;
|
|
2195
|
+
if (!accountFromStore || !subAccountFromStore || !chainId) {
|
|
2196
|
+
throw standardErrors.rpc.invalidParams("FetchPermissions - one or more of account, sub account, or chain id is missing, connect to sub account via wallet_connect first");
|
|
2197
|
+
}
|
|
2198
|
+
return {
|
|
2199
|
+
method: "coinbase_fetchPermissions",
|
|
2200
|
+
params: [
|
|
2201
|
+
{
|
|
2202
|
+
account: accountFromStore,
|
|
2203
|
+
chainId: numberToHex(chainId),
|
|
2204
|
+
spender: subAccountFromStore
|
|
2205
|
+
}
|
|
2206
|
+
]
|
|
2207
|
+
};
|
|
2208
|
+
}
|
|
2209
|
+
function createSpendPermissionMessage({ spendPermission, chainId }) {
|
|
2210
|
+
return {
|
|
2211
|
+
domain: {
|
|
2212
|
+
name: "Spend Permission Manager",
|
|
2213
|
+
version: "1",
|
|
2214
|
+
chainId,
|
|
2215
|
+
verifyingContract: spendPermissionManagerAddress
|
|
2216
|
+
},
|
|
2217
|
+
types: {
|
|
2218
|
+
SpendPermission: [
|
|
2219
|
+
{ name: "account", type: "address" },
|
|
2220
|
+
{ name: "spender", type: "address" },
|
|
2221
|
+
{ name: "token", type: "address" },
|
|
2222
|
+
{ name: "allowance", type: "uint160" },
|
|
2223
|
+
{ name: "period", type: "uint48" },
|
|
2224
|
+
{ name: "start", type: "uint48" },
|
|
2225
|
+
{ name: "end", type: "uint48" },
|
|
2226
|
+
{ name: "salt", type: "uint256" },
|
|
2227
|
+
{ name: "extraData", type: "bytes" }
|
|
2228
|
+
]
|
|
2229
|
+
},
|
|
2230
|
+
primaryType: "SpendPermission",
|
|
2231
|
+
message: {
|
|
2232
|
+
account: spendPermission.account,
|
|
2233
|
+
spender: spendPermission.spender,
|
|
2234
|
+
token: spendPermission.token,
|
|
2235
|
+
allowance: spendPermission.allowance,
|
|
2236
|
+
period: spendPermission.period,
|
|
2237
|
+
start: spendPermission.start,
|
|
2238
|
+
end: spendPermission.end,
|
|
2239
|
+
salt: spendPermission.salt,
|
|
2240
|
+
extraData: spendPermission.extraData
|
|
2241
|
+
}
|
|
2242
|
+
};
|
|
2243
|
+
}
|
|
2244
|
+
function createSpendPermissionBatchMessage({ spendPermissionBatch, chainId }) {
|
|
2245
|
+
return {
|
|
2246
|
+
domain: {
|
|
2247
|
+
name: "Spend Permission Manager",
|
|
2248
|
+
version: "1",
|
|
2249
|
+
chainId,
|
|
2250
|
+
verifyingContract: spendPermissionManagerAddress
|
|
2251
|
+
},
|
|
2252
|
+
types: {
|
|
2253
|
+
SpendPermissionBatch: [
|
|
2254
|
+
{ name: "account", type: "address" },
|
|
2255
|
+
{ name: "period", type: "uint48" },
|
|
2256
|
+
{ name: "start", type: "uint48" },
|
|
2257
|
+
{ name: "end", type: "uint48" },
|
|
2258
|
+
{ name: "permissions", type: "PermissionDetails[]" }
|
|
2259
|
+
],
|
|
2260
|
+
PermissionDetails: [
|
|
2261
|
+
{ name: "spender", type: "address" },
|
|
2262
|
+
{ name: "token", type: "address" },
|
|
2263
|
+
{ name: "allowance", type: "uint160" },
|
|
2264
|
+
{ name: "salt", type: "uint256" },
|
|
2265
|
+
{ name: "extraData", type: "bytes" }
|
|
2266
|
+
]
|
|
2267
|
+
},
|
|
2268
|
+
primaryType: "SpendPermissionBatch",
|
|
2269
|
+
message: {
|
|
2270
|
+
account: spendPermissionBatch.account,
|
|
2271
|
+
period: spendPermissionBatch.period,
|
|
2272
|
+
start: spendPermissionBatch.start,
|
|
2273
|
+
end: spendPermissionBatch.end,
|
|
2274
|
+
permissions: spendPermissionBatch.permissions.map((p) => ({
|
|
2275
|
+
spender: p.spender,
|
|
2276
|
+
token: p.token,
|
|
2277
|
+
allowance: p.allowance,
|
|
2278
|
+
salt: p.salt,
|
|
2279
|
+
extraData: p.extraData
|
|
2280
|
+
}))
|
|
2281
|
+
}
|
|
2282
|
+
};
|
|
2283
|
+
}
|
|
2284
|
+
async function waitForCallsTransactionHash({ client, id }) {
|
|
2285
|
+
var _a;
|
|
2286
|
+
const result = await waitForCallsStatus(client, {
|
|
2287
|
+
id
|
|
2288
|
+
});
|
|
2289
|
+
if (result.status === "success") {
|
|
2290
|
+
return (_a = result.receipts) === null || _a === void 0 ? void 0 : _a[0].transactionHash;
|
|
2291
|
+
}
|
|
2292
|
+
throw standardErrors.rpc.internal("failed to send transaction");
|
|
2293
|
+
}
|
|
2294
|
+
function createWalletSendCallsRequest({ calls, from, chainId, capabilities }) {
|
|
2295
|
+
const paymasterUrls = config.get().paymasterUrls;
|
|
2296
|
+
let request = {
|
|
2297
|
+
method: "wallet_sendCalls",
|
|
2298
|
+
params: [
|
|
2299
|
+
{
|
|
2300
|
+
version: "1.0",
|
|
2301
|
+
calls,
|
|
2302
|
+
chainId: numberToHex(chainId),
|
|
2303
|
+
from,
|
|
2304
|
+
atomicRequired: true,
|
|
2305
|
+
capabilities
|
|
2306
|
+
}
|
|
2307
|
+
]
|
|
2308
|
+
};
|
|
2309
|
+
if (paymasterUrls === null || paymasterUrls === void 0 ? void 0 : paymasterUrls[chainId]) {
|
|
2310
|
+
request = injectRequestCapabilities(request, {
|
|
2311
|
+
paymasterService: { url: paymasterUrls === null || paymasterUrls === void 0 ? void 0 : paymasterUrls[chainId] }
|
|
2312
|
+
});
|
|
2313
|
+
}
|
|
2314
|
+
return request;
|
|
2315
|
+
}
|
|
2316
|
+
async function presentSubAccountFundingDialog() {
|
|
2317
|
+
const dialog2 = initDialog();
|
|
2318
|
+
const userChoice = await new Promise((resolve) => {
|
|
2319
|
+
logDialogShown({ dialogContext: "sub_account_insufficient_balance" });
|
|
2320
|
+
dialog2.presentItem({
|
|
2321
|
+
title: "Insufficient spend permission",
|
|
2322
|
+
message: "Your spend permission's remaining balance cannot cover this transaction. Please choose how to proceed:",
|
|
2323
|
+
onClose: () => {
|
|
2324
|
+
logDialogDismissed({ dialogContext: "sub_account_insufficient_balance" });
|
|
2325
|
+
dialog2.clear();
|
|
2326
|
+
},
|
|
2327
|
+
actionItems: [
|
|
2328
|
+
{
|
|
2329
|
+
text: "Edit spend permission",
|
|
2330
|
+
variant: "primary",
|
|
2331
|
+
onClick: () => {
|
|
2332
|
+
logDialogActionClicked({
|
|
2333
|
+
dialogContext: "sub_account_insufficient_balance",
|
|
2334
|
+
dialogAction: "create_permission"
|
|
2335
|
+
});
|
|
2336
|
+
dialog2.clear();
|
|
2337
|
+
resolve("update_permission");
|
|
2338
|
+
}
|
|
2339
|
+
},
|
|
2340
|
+
{
|
|
2341
|
+
text: "Use primary account",
|
|
2342
|
+
variant: "secondary",
|
|
2343
|
+
onClick: () => {
|
|
2344
|
+
logDialogActionClicked({
|
|
2345
|
+
dialogContext: "sub_account_insufficient_balance",
|
|
2346
|
+
dialogAction: "continue_in_popup"
|
|
2347
|
+
});
|
|
2348
|
+
dialog2.clear();
|
|
2349
|
+
resolve("continue_popup");
|
|
2350
|
+
}
|
|
2351
|
+
}
|
|
2352
|
+
]
|
|
2353
|
+
});
|
|
2354
|
+
});
|
|
2355
|
+
return userChoice;
|
|
2356
|
+
}
|
|
2357
|
+
function parseFundingOptions({ errorData, sourceAddress }) {
|
|
2358
|
+
var _a;
|
|
2359
|
+
const spendPermissionRequests = [];
|
|
2360
|
+
for (const [token, { amount, sources }] of Object.entries((_a = errorData === null || errorData === void 0 ? void 0 : errorData.required) !== null && _a !== void 0 ? _a : {})) {
|
|
2361
|
+
const sourcesWithSufficientBalance = sources.filter((source) => {
|
|
2362
|
+
return hexToBigInt(source.balance) >= hexToBigInt(amount) && source.address.toLowerCase() === (sourceAddress === null || sourceAddress === void 0 ? void 0 : sourceAddress.toLowerCase());
|
|
2363
|
+
});
|
|
2364
|
+
if (sourcesWithSufficientBalance.length === 0) {
|
|
2365
|
+
throw new Error("Source address has insufficient balance for a token");
|
|
2366
|
+
}
|
|
2367
|
+
spendPermissionRequests.push({
|
|
2368
|
+
token,
|
|
2369
|
+
requiredAmount: hexToBigInt(amount)
|
|
2370
|
+
});
|
|
2371
|
+
}
|
|
2372
|
+
return spendPermissionRequests;
|
|
2373
|
+
}
|
|
2374
|
+
function isSendCallsParams(params) {
|
|
2375
|
+
return typeof params === "object" && params !== null && "calls" in params;
|
|
2376
|
+
}
|
|
2377
|
+
function isEthSendTransactionParams(params) {
|
|
2378
|
+
return Array.isArray(params) && params.length === 1 && typeof params[0] === "object" && params[0] !== null && "to" in params[0];
|
|
2379
|
+
}
|
|
2380
|
+
function compute16ByteHash(input) {
|
|
2381
|
+
return slice$1(keccak256(toHex$2(input)), 0, 16);
|
|
2382
|
+
}
|
|
2383
|
+
function makeDataSuffix({ attribution, dappOrigin }) {
|
|
2384
|
+
if (!attribution) {
|
|
2385
|
+
return;
|
|
2386
|
+
}
|
|
2387
|
+
if ("auto" in attribution && attribution.auto && dappOrigin) {
|
|
2388
|
+
return compute16ByteHash(dappOrigin);
|
|
2389
|
+
}
|
|
2390
|
+
if ("dataSuffix" in attribution) {
|
|
2391
|
+
return attribution.dataSuffix;
|
|
2392
|
+
}
|
|
2393
|
+
return;
|
|
2394
|
+
}
|
|
2395
|
+
function requestHasCapability(request, capabilityName) {
|
|
2396
|
+
var _a;
|
|
2397
|
+
if (!Array.isArray(request === null || request === void 0 ? void 0 : request.params))
|
|
2398
|
+
return false;
|
|
2399
|
+
const capabilities = (_a = request.params[0]) === null || _a === void 0 ? void 0 : _a.capabilities;
|
|
2400
|
+
if (!capabilities || typeof capabilities !== "object")
|
|
2401
|
+
return false;
|
|
2402
|
+
return capabilityName in capabilities;
|
|
2403
|
+
}
|
|
2404
|
+
function prependWithoutDuplicates(array, item) {
|
|
2405
|
+
const filtered = array.filter((i) => i !== item);
|
|
2406
|
+
return [item, ...filtered];
|
|
2407
|
+
}
|
|
2408
|
+
function appendWithoutDuplicates(array, item) {
|
|
2409
|
+
const filtered = array.filter((i) => i !== item);
|
|
2410
|
+
return [...filtered, item];
|
|
2411
|
+
}
|
|
2412
|
+
async function getCachedWalletConnectResponse() {
|
|
2413
|
+
const spendPermissions2 = store.spendPermissions.get();
|
|
2414
|
+
const subAccount = store.subAccounts.get();
|
|
2415
|
+
const accounts = store.account.get().accounts;
|
|
2416
|
+
if (!accounts) {
|
|
2417
|
+
return null;
|
|
2418
|
+
}
|
|
2419
|
+
const walletConnectAccounts = accounts === null || accounts === void 0 ? void 0 : accounts.map((account2) => ({
|
|
2420
|
+
address: account2,
|
|
2421
|
+
capabilities: {
|
|
2422
|
+
subAccounts: subAccount ? [subAccount] : void 0,
|
|
2423
|
+
spendPermissions: spendPermissions2.length > 0 ? { permissions: spendPermissions2 } : void 0
|
|
2424
|
+
}
|
|
2425
|
+
}));
|
|
2426
|
+
return {
|
|
2427
|
+
accounts: walletConnectAccounts
|
|
2428
|
+
};
|
|
2429
|
+
}
|
|
2430
|
+
function base64ToBase64Url(base64) {
|
|
2431
|
+
return base64.replaceAll("+", "-").replaceAll("/", "_").replace(/=+$/, "");
|
|
2432
|
+
}
|
|
2433
|
+
function arrayBufferToBase64Url(buffer) {
|
|
2434
|
+
const base64String = btoa(String.fromCharCode(...new Uint8Array(buffer)));
|
|
2435
|
+
return base64ToBase64Url(base64String);
|
|
2436
|
+
}
|
|
2437
|
+
function convertCredentialToJSON({ webauthn, signature, id }) {
|
|
2438
|
+
const signatureRaw = fromHex(signature);
|
|
2439
|
+
return {
|
|
2440
|
+
id,
|
|
2441
|
+
rawId: arrayBufferToBase64Url(stringToBytes(id)),
|
|
2442
|
+
response: {
|
|
2443
|
+
authenticatorData: arrayBufferToBase64Url(hexToBytes(webauthn.authenticatorData)),
|
|
2444
|
+
clientDataJSON: arrayBufferToBase64Url(stringToBytes(webauthn.clientDataJSON)),
|
|
2445
|
+
signature: arrayBufferToBase64Url(asn1EncodeSignature(signatureRaw.r, signatureRaw.s))
|
|
2446
|
+
},
|
|
2447
|
+
type: JSON.parse(webauthn.clientDataJSON).type
|
|
2448
|
+
};
|
|
2449
|
+
}
|
|
2450
|
+
function asn1EncodeSignature(r, s) {
|
|
2451
|
+
const rBytes = hexToBytes(trim(numberToHex(r)));
|
|
2452
|
+
const sBytes = hexToBytes(trim(numberToHex(s)));
|
|
2453
|
+
const rLength = rBytes.length;
|
|
2454
|
+
const sLength = sBytes.length;
|
|
2455
|
+
const totalLength = rLength + sLength + 4;
|
|
2456
|
+
const signature = new Uint8Array(totalLength + 2);
|
|
2457
|
+
signature[0] = 48;
|
|
2458
|
+
signature[1] = totalLength;
|
|
2459
|
+
signature[2] = 2;
|
|
2460
|
+
signature[3] = rLength;
|
|
2461
|
+
signature.set(rBytes, 4);
|
|
2462
|
+
signature[rLength + 4] = 2;
|
|
2463
|
+
signature[rLength + 5] = sLength;
|
|
2464
|
+
signature.set(sBytes, rLength + 6);
|
|
2465
|
+
return signature;
|
|
2466
|
+
}
|
|
2467
|
+
var __rest$1 = function(s, e) {
|
|
2468
|
+
var t = {};
|
|
2469
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2470
|
+
t[p] = s[p];
|
|
2471
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
2472
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
2473
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
2474
|
+
t[p[i]] = s[p[i]];
|
|
2475
|
+
}
|
|
2476
|
+
return t;
|
|
2477
|
+
};
|
|
2478
|
+
async function createSmartAccount(parameters) {
|
|
2479
|
+
const { owner, ownerIndex, address, client, factoryData } = parameters;
|
|
2480
|
+
const entryPoint = {
|
|
2481
|
+
abi: entryPoint06Abi,
|
|
2482
|
+
address: entryPoint06Address,
|
|
2483
|
+
version: "0.6"
|
|
2484
|
+
};
|
|
2485
|
+
const factory = {
|
|
2486
|
+
abi: factoryAbi,
|
|
2487
|
+
address: factoryAddress
|
|
2488
|
+
};
|
|
2489
|
+
return toSmartAccount({
|
|
2490
|
+
client,
|
|
2491
|
+
entryPoint,
|
|
2492
|
+
extend: { abi, factory },
|
|
2493
|
+
async decodeCalls(data) {
|
|
2494
|
+
const result = decodeFunctionData({
|
|
2495
|
+
abi,
|
|
2496
|
+
data
|
|
2497
|
+
});
|
|
2498
|
+
if (result.functionName === "execute")
|
|
2499
|
+
return [{ to: result.args[0], value: result.args[1], data: result.args[2] }];
|
|
2500
|
+
if (result.functionName === "executeBatch")
|
|
2501
|
+
return result.args[0].map((arg) => ({
|
|
2502
|
+
to: arg.target,
|
|
2503
|
+
value: arg.value,
|
|
2504
|
+
data: arg.data
|
|
2505
|
+
}));
|
|
2506
|
+
throw new BaseError(`unable to decode calls for "${result.functionName}"`);
|
|
2507
|
+
},
|
|
2508
|
+
async encodeCalls(calls) {
|
|
2509
|
+
var _a, _b;
|
|
2510
|
+
if (calls.length === 1) {
|
|
2511
|
+
return encodeFunctionData({
|
|
2512
|
+
abi,
|
|
2513
|
+
functionName: "execute",
|
|
2514
|
+
args: [calls[0].to, (_a = calls[0].value) !== null && _a !== void 0 ? _a : BigInt(0), (_b = calls[0].data) !== null && _b !== void 0 ? _b : "0x"]
|
|
2515
|
+
});
|
|
2516
|
+
}
|
|
2517
|
+
return encodeFunctionData({
|
|
2518
|
+
abi,
|
|
2519
|
+
functionName: "executeBatch",
|
|
2520
|
+
args: [
|
|
2521
|
+
calls.map((call) => {
|
|
2522
|
+
var _a2, _b2;
|
|
2523
|
+
return {
|
|
2524
|
+
data: (_a2 = call.data) !== null && _a2 !== void 0 ? _a2 : "0x",
|
|
2525
|
+
target: call.to,
|
|
2526
|
+
value: (_b2 = call.value) !== null && _b2 !== void 0 ? _b2 : BigInt(0)
|
|
2527
|
+
};
|
|
2528
|
+
})
|
|
2529
|
+
]
|
|
2530
|
+
});
|
|
2531
|
+
},
|
|
2532
|
+
async getAddress() {
|
|
2533
|
+
return address;
|
|
2534
|
+
},
|
|
2535
|
+
async getFactoryArgs() {
|
|
2536
|
+
if (factoryData)
|
|
2537
|
+
return { factory: factory.address, factoryData };
|
|
2538
|
+
return { factory: factory.address, factoryData };
|
|
2539
|
+
},
|
|
2540
|
+
async getStubSignature() {
|
|
2541
|
+
if (owner.type === "webAuthn")
|
|
2542
|
+
return "0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000170000000000000000000000000000000000000000000000000000000000000001949fc7c88032b9fcb5f6efc7a7b8c63668eae9871b765e23123bb473ff57aa831a7c0d9276168ebcc29f2875a0239cffdf2a9cd1c2007c5c77c071db9264df1d000000000000000000000000000000000000000000000000000000000000002549960de5880e8c687434170f6476605b8fe4aeb9a28632c7995cf3ba831d97630500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008a7b2274797065223a22776562617574686e2e676574222c226368616c6c656e6765223a2273496a396e6164474850596759334b7156384f7a4a666c726275504b474f716d59576f4d57516869467773222c226f726967696e223a2268747470733a2f2f7369676e2e636f696e626173652e636f6d222c2263726f73734f726967696e223a66616c73657d00000000000000000000000000000000000000000000";
|
|
2543
|
+
return wrapSignature({
|
|
2544
|
+
ownerIndex,
|
|
2545
|
+
signature: "0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c"
|
|
2546
|
+
});
|
|
2547
|
+
},
|
|
2548
|
+
async sign(parameters2) {
|
|
2549
|
+
const address2 = await this.getAddress();
|
|
2550
|
+
const hash = toReplaySafeHash({
|
|
2551
|
+
address: address2,
|
|
2552
|
+
chainId: client.chain.id,
|
|
2553
|
+
hash: parameters2.hash
|
|
2554
|
+
});
|
|
2555
|
+
const signature = await sign({ hash, owner });
|
|
2556
|
+
return wrapSignature({
|
|
2557
|
+
ownerIndex,
|
|
2558
|
+
signature
|
|
2559
|
+
});
|
|
2560
|
+
},
|
|
2561
|
+
async signMessage(parameters2) {
|
|
2562
|
+
const { message } = parameters2;
|
|
2563
|
+
const address2 = await this.getAddress();
|
|
2564
|
+
const hash = toReplaySafeHash({
|
|
2565
|
+
address: address2,
|
|
2566
|
+
chainId: client.chain.id,
|
|
2567
|
+
hash: hashMessage(message)
|
|
2568
|
+
});
|
|
2569
|
+
const signature = await sign({ hash, owner });
|
|
2570
|
+
return wrapSignature({
|
|
2571
|
+
ownerIndex,
|
|
2572
|
+
signature
|
|
2573
|
+
});
|
|
2574
|
+
},
|
|
2575
|
+
async signTypedData(parameters2) {
|
|
2576
|
+
const { domain, types, primaryType, message } = parameters2;
|
|
2577
|
+
const address2 = await this.getAddress();
|
|
2578
|
+
const hash = toReplaySafeHash({
|
|
2579
|
+
address: address2,
|
|
2580
|
+
chainId: client.chain.id,
|
|
2581
|
+
hash: hashTypedData({
|
|
2582
|
+
domain,
|
|
2583
|
+
message,
|
|
2584
|
+
primaryType,
|
|
2585
|
+
types
|
|
2586
|
+
})
|
|
2587
|
+
});
|
|
2588
|
+
const signature = await sign({ hash, owner });
|
|
2589
|
+
return wrapSignature({
|
|
2590
|
+
ownerIndex,
|
|
2591
|
+
signature
|
|
2592
|
+
});
|
|
2593
|
+
},
|
|
2594
|
+
async signUserOperation(parameters2) {
|
|
2595
|
+
const { chainId = client.chain.id } = parameters2, userOperation = __rest$1(parameters2, ["chainId"]);
|
|
2596
|
+
const address2 = await this.getAddress();
|
|
2597
|
+
const hash = getUserOperationHash({
|
|
2598
|
+
chainId,
|
|
2599
|
+
entryPointAddress: entryPoint.address,
|
|
2600
|
+
entryPointVersion: entryPoint.version,
|
|
2601
|
+
userOperation: Object.assign(Object.assign({}, userOperation), { sender: address2 })
|
|
2602
|
+
});
|
|
2603
|
+
const signature = await sign({ hash, owner });
|
|
2604
|
+
return wrapSignature({
|
|
2605
|
+
ownerIndex,
|
|
2606
|
+
signature
|
|
2607
|
+
});
|
|
2608
|
+
},
|
|
2609
|
+
userOperation: {
|
|
2610
|
+
async estimateGas(userOperation) {
|
|
2611
|
+
var _a;
|
|
2612
|
+
if (owner.type !== "webAuthn")
|
|
2613
|
+
return;
|
|
2614
|
+
return {
|
|
2615
|
+
verificationGasLimit: BigInt(Math.max(Number((_a = userOperation.verificationGasLimit) !== null && _a !== void 0 ? _a : BigInt(0)), 8e5))
|
|
2616
|
+
};
|
|
2617
|
+
}
|
|
2618
|
+
}
|
|
2619
|
+
});
|
|
2620
|
+
}
|
|
2621
|
+
async function sign({ hash, owner }) {
|
|
2622
|
+
if (owner.type === "webAuthn") {
|
|
2623
|
+
const { signature, webauthn } = await owner.sign({
|
|
2624
|
+
hash
|
|
2625
|
+
});
|
|
2626
|
+
return toWebAuthnSignature({ signature, webauthn });
|
|
2627
|
+
}
|
|
2628
|
+
if (owner.sign)
|
|
2629
|
+
return owner.sign({ hash });
|
|
2630
|
+
throw new BaseError("`owner` does not support raw sign.");
|
|
2631
|
+
}
|
|
2632
|
+
function toReplaySafeHash({ address, chainId, hash }) {
|
|
2633
|
+
return hashTypedData({
|
|
2634
|
+
domain: {
|
|
2635
|
+
chainId,
|
|
2636
|
+
name: "Coinbase Smart Wallet",
|
|
2637
|
+
verifyingContract: address,
|
|
2638
|
+
version: "1"
|
|
2639
|
+
},
|
|
2640
|
+
types: {
|
|
2641
|
+
CoinbaseSmartWalletMessage: [
|
|
2642
|
+
{
|
|
2643
|
+
name: "hash",
|
|
2644
|
+
type: "bytes32"
|
|
2645
|
+
}
|
|
2646
|
+
]
|
|
2647
|
+
},
|
|
2648
|
+
primaryType: "CoinbaseSmartWalletMessage",
|
|
2649
|
+
message: {
|
|
2650
|
+
hash
|
|
2651
|
+
}
|
|
2652
|
+
});
|
|
2653
|
+
}
|
|
2654
|
+
function toWebAuthnSignature({ webauthn, signature }) {
|
|
2655
|
+
const { r, s } = fromHex(signature);
|
|
2656
|
+
return encodeAbiParameters([
|
|
2657
|
+
{
|
|
2658
|
+
components: [
|
|
2659
|
+
{
|
|
2660
|
+
name: "authenticatorData",
|
|
2661
|
+
type: "bytes"
|
|
2662
|
+
},
|
|
2663
|
+
{ name: "clientDataJSON", type: "bytes" },
|
|
2664
|
+
{ name: "challengeIndex", type: "uint256" },
|
|
2665
|
+
{ name: "typeIndex", type: "uint256" },
|
|
2666
|
+
{
|
|
2667
|
+
name: "r",
|
|
2668
|
+
type: "uint256"
|
|
2669
|
+
},
|
|
2670
|
+
{
|
|
2671
|
+
name: "s",
|
|
2672
|
+
type: "uint256"
|
|
2673
|
+
}
|
|
2674
|
+
],
|
|
2675
|
+
type: "tuple"
|
|
2676
|
+
}
|
|
2677
|
+
], [
|
|
2678
|
+
{
|
|
2679
|
+
authenticatorData: webauthn.authenticatorData,
|
|
2680
|
+
clientDataJSON: stringToHex(webauthn.clientDataJSON),
|
|
2681
|
+
challengeIndex: BigInt(webauthn.challengeIndex),
|
|
2682
|
+
typeIndex: BigInt(webauthn.typeIndex),
|
|
2683
|
+
r,
|
|
2684
|
+
s
|
|
2685
|
+
}
|
|
2686
|
+
]);
|
|
2687
|
+
}
|
|
2688
|
+
function wrapSignature(parameters) {
|
|
2689
|
+
const { ownerIndex = 0 } = parameters;
|
|
2690
|
+
const signatureData = (() => {
|
|
2691
|
+
if (size(parameters.signature) !== 65)
|
|
2692
|
+
return parameters.signature;
|
|
2693
|
+
const signature = parseSignature(parameters.signature);
|
|
2694
|
+
return encodePacked(["bytes32", "bytes32", "uint8"], [signature.r, signature.s, signature.yParity === 0 ? 27 : 28]);
|
|
2695
|
+
})();
|
|
2696
|
+
return encodeAbiParameters([
|
|
2697
|
+
{
|
|
2698
|
+
components: [
|
|
2699
|
+
{
|
|
2700
|
+
name: "ownerIndex",
|
|
2701
|
+
type: "uint8"
|
|
2702
|
+
},
|
|
2703
|
+
{
|
|
2704
|
+
name: "signatureData",
|
|
2705
|
+
type: "bytes"
|
|
2706
|
+
}
|
|
2707
|
+
],
|
|
2708
|
+
type: "tuple"
|
|
2709
|
+
}
|
|
2710
|
+
], [
|
|
2711
|
+
{
|
|
2712
|
+
ownerIndex,
|
|
2713
|
+
signatureData
|
|
2714
|
+
}
|
|
2715
|
+
]);
|
|
2716
|
+
}
|
|
2717
|
+
async function createSubAccountSigner({ address, client, factory, factoryData, owner, ownerIndex, parentAddress, attribution }) {
|
|
2718
|
+
var _a;
|
|
2719
|
+
const subAccount = {
|
|
2720
|
+
address,
|
|
2721
|
+
factory,
|
|
2722
|
+
factoryData
|
|
2723
|
+
};
|
|
2724
|
+
const chainId = (_a = client.chain) === null || _a === void 0 ? void 0 : _a.id;
|
|
2725
|
+
if (!chainId) {
|
|
2726
|
+
throw standardErrors.rpc.internal("chainId not found");
|
|
2727
|
+
}
|
|
2728
|
+
const account2 = await createSmartAccount({
|
|
2729
|
+
owner,
|
|
2730
|
+
ownerIndex: ownerIndex !== null && ownerIndex !== void 0 ? ownerIndex : 1,
|
|
2731
|
+
address,
|
|
2732
|
+
client,
|
|
2733
|
+
factoryData
|
|
2734
|
+
});
|
|
2735
|
+
const request = async (args) => {
|
|
2736
|
+
var _a2, _b, _c, _d, _e, _f;
|
|
2737
|
+
try {
|
|
2738
|
+
switch (args.method) {
|
|
2739
|
+
case "wallet_addSubAccount":
|
|
2740
|
+
return subAccount;
|
|
2741
|
+
case "eth_accounts":
|
|
2742
|
+
return [subAccount.address];
|
|
2743
|
+
case "eth_coinbase":
|
|
2744
|
+
return subAccount.address;
|
|
2745
|
+
case "net_version":
|
|
2746
|
+
return chainId.toString();
|
|
2747
|
+
case "eth_chainId":
|
|
2748
|
+
return numberToHex(chainId);
|
|
2749
|
+
case "eth_sendTransaction": {
|
|
2750
|
+
assertArrayPresence(args.params);
|
|
2751
|
+
const rawParams = args.params[0];
|
|
2752
|
+
assertPresence(rawParams.to, standardErrors.rpc.invalidParams("to is required"));
|
|
2753
|
+
const params = {
|
|
2754
|
+
to: rawParams.to,
|
|
2755
|
+
data: ensureHexString((_a2 = rawParams.data) !== null && _a2 !== void 0 ? _a2 : "0x", true),
|
|
2756
|
+
value: ensureHexString((_b = rawParams.value) !== null && _b !== void 0 ? _b : "0x", true),
|
|
2757
|
+
from: (_c = rawParams.from) !== null && _c !== void 0 ? _c : subAccount.address
|
|
2758
|
+
};
|
|
2759
|
+
const sendCallsRequest = createWalletSendCallsRequest({
|
|
2760
|
+
calls: [params],
|
|
2761
|
+
chainId,
|
|
2762
|
+
from: params.from
|
|
2763
|
+
});
|
|
2764
|
+
const response = await request(sendCallsRequest);
|
|
2765
|
+
return waitForCallsTransactionHash({
|
|
2766
|
+
client,
|
|
2767
|
+
id: response
|
|
2768
|
+
});
|
|
2769
|
+
}
|
|
2770
|
+
case "wallet_sendCalls": {
|
|
2771
|
+
assertArrayPresence(args.params);
|
|
2772
|
+
const chainId2 = get(args.params[0], "chainId");
|
|
2773
|
+
if (!chainId2) {
|
|
2774
|
+
throw standardErrors.rpc.invalidParams("chainId is required");
|
|
2775
|
+
}
|
|
2776
|
+
if (!isHex(chainId2)) {
|
|
2777
|
+
throw standardErrors.rpc.invalidParams("chainId must be a hex encoded integer");
|
|
2778
|
+
}
|
|
2779
|
+
if (!args.params[0]) {
|
|
2780
|
+
throw standardErrors.rpc.invalidParams("params are required");
|
|
2781
|
+
}
|
|
2782
|
+
if (!("calls" in args.params[0])) {
|
|
2783
|
+
throw standardErrors.rpc.invalidParams("calls are required");
|
|
2784
|
+
}
|
|
2785
|
+
let prepareCallsRequest = {
|
|
2786
|
+
method: "wallet_prepareCalls",
|
|
2787
|
+
params: [
|
|
2788
|
+
{
|
|
2789
|
+
version: "1.0",
|
|
2790
|
+
calls: args.params[0].calls,
|
|
2791
|
+
chainId: chainId2,
|
|
2792
|
+
from: subAccount.address,
|
|
2793
|
+
capabilities: "capabilities" in args.params[0] ? args.params[0].capabilities : {}
|
|
2794
|
+
}
|
|
2795
|
+
]
|
|
2796
|
+
};
|
|
2797
|
+
if (parentAddress) {
|
|
2798
|
+
prepareCallsRequest = injectRequestCapabilities(prepareCallsRequest, {
|
|
2799
|
+
funding: [
|
|
2800
|
+
{
|
|
2801
|
+
type: "spendPermission",
|
|
2802
|
+
data: {
|
|
2803
|
+
autoApply: true,
|
|
2804
|
+
sources: [parentAddress],
|
|
2805
|
+
preference: "PREFER_DIRECT_BALANCE"
|
|
2806
|
+
}
|
|
2807
|
+
}
|
|
2808
|
+
]
|
|
2809
|
+
});
|
|
2810
|
+
}
|
|
2811
|
+
let prepareCallsResponse = await request(prepareCallsRequest);
|
|
2812
|
+
const signResponse = await ((_e = (_d = owner).sign) === null || _e === void 0 ? void 0 : _e.call(_d, {
|
|
2813
|
+
// Hash returned from wallet_prepareCalls is double hex encoded
|
|
2814
|
+
hash: hexToString(prepareCallsResponse.signatureRequest.hash)
|
|
2815
|
+
}));
|
|
2816
|
+
let signatureData;
|
|
2817
|
+
if (!signResponse) {
|
|
2818
|
+
throw standardErrors.rpc.internal("signature not found");
|
|
2819
|
+
}
|
|
2820
|
+
if (isHex(signResponse)) {
|
|
2821
|
+
signatureData = {
|
|
2822
|
+
type: "secp256k1",
|
|
2823
|
+
data: {
|
|
2824
|
+
address: owner.address,
|
|
2825
|
+
signature: signResponse
|
|
2826
|
+
}
|
|
2827
|
+
};
|
|
2828
|
+
} else {
|
|
2829
|
+
signatureData = {
|
|
2830
|
+
type: "webauthn",
|
|
2831
|
+
data: {
|
|
2832
|
+
signature: JSON.stringify(convertCredentialToJSON(Object.assign({ id: (_f = owner.id) !== null && _f !== void 0 ? _f : "1" }, signResponse))),
|
|
2833
|
+
publicKey: owner.publicKey
|
|
2834
|
+
}
|
|
2835
|
+
};
|
|
2836
|
+
}
|
|
2837
|
+
const sendPreparedCallsResponse = await request({
|
|
2838
|
+
method: "wallet_sendPreparedCalls",
|
|
2839
|
+
params: [
|
|
2840
|
+
{
|
|
2841
|
+
version: "1.0",
|
|
2842
|
+
type: prepareCallsResponse.type,
|
|
2843
|
+
data: prepareCallsResponse.userOp,
|
|
2844
|
+
chainId: prepareCallsResponse.chainId,
|
|
2845
|
+
signature: signatureData
|
|
2846
|
+
}
|
|
2847
|
+
]
|
|
2848
|
+
});
|
|
2849
|
+
return sendPreparedCallsResponse[0];
|
|
2850
|
+
}
|
|
2851
|
+
case "wallet_sendPreparedCalls": {
|
|
2852
|
+
assertArrayPresence(args.params);
|
|
2853
|
+
const chainId2 = get(args.params[0], "chainId");
|
|
2854
|
+
if (!chainId2) {
|
|
2855
|
+
throw standardErrors.rpc.invalidParams("chainId is required");
|
|
2856
|
+
}
|
|
2857
|
+
if (!isHex(chainId2)) {
|
|
2858
|
+
throw standardErrors.rpc.invalidParams("chainId must be a hex encoded integer");
|
|
2859
|
+
}
|
|
2860
|
+
const sendPreparedCallsResponse = await client.request({
|
|
2861
|
+
method: "wallet_sendPreparedCalls",
|
|
2862
|
+
params: args.params
|
|
2863
|
+
});
|
|
2864
|
+
return sendPreparedCallsResponse;
|
|
2865
|
+
}
|
|
2866
|
+
case "wallet_prepareCalls": {
|
|
2867
|
+
assertArrayPresence(args.params);
|
|
2868
|
+
const chainId2 = get(args.params[0], "chainId");
|
|
2869
|
+
if (!chainId2) {
|
|
2870
|
+
throw standardErrors.rpc.invalidParams("chainId is required");
|
|
2871
|
+
}
|
|
2872
|
+
if (!isHex(chainId2)) {
|
|
2873
|
+
throw standardErrors.rpc.invalidParams("chainId must be a hex encoded integer");
|
|
2874
|
+
}
|
|
2875
|
+
if (!args.params[0]) {
|
|
2876
|
+
throw standardErrors.rpc.invalidParams("params are required");
|
|
2877
|
+
}
|
|
2878
|
+
if (!get(args.params[0], "calls")) {
|
|
2879
|
+
throw standardErrors.rpc.invalidParams("calls are required");
|
|
2880
|
+
}
|
|
2881
|
+
const prepareCallsParams = args.params[0];
|
|
2882
|
+
if (attribution && prepareCallsParams.capabilities && !("attribution" in prepareCallsParams.capabilities)) {
|
|
2883
|
+
prepareCallsParams.capabilities.attribution = attribution;
|
|
2884
|
+
}
|
|
2885
|
+
const prepareCallsResponse = await client.request({
|
|
2886
|
+
method: "wallet_prepareCalls",
|
|
2887
|
+
params: [Object.assign(Object.assign({}, args.params[0]), { chainId: chainId2 })]
|
|
2888
|
+
});
|
|
2889
|
+
return prepareCallsResponse;
|
|
2890
|
+
}
|
|
2891
|
+
case "personal_sign": {
|
|
2892
|
+
assertArrayPresence(args.params);
|
|
2893
|
+
if (!isHex(args.params[0])) {
|
|
2894
|
+
throw standardErrors.rpc.invalidParams("message must be a hex encoded string");
|
|
2895
|
+
}
|
|
2896
|
+
const message = hexToString(args.params[0]);
|
|
2897
|
+
return account2.signMessage({ message });
|
|
2898
|
+
}
|
|
2899
|
+
case "eth_signTypedData_v4": {
|
|
2900
|
+
assertArrayPresence(args.params);
|
|
2901
|
+
const typedData = typeof args.params[1] === "string" ? JSON.parse(args.params[1]) : args.params[1];
|
|
2902
|
+
return account2.signTypedData(typedData);
|
|
2903
|
+
}
|
|
2904
|
+
case "eth_signTypedData_v1":
|
|
2905
|
+
case "eth_signTypedData_v3":
|
|
2906
|
+
case "wallet_addEthereumChain":
|
|
2907
|
+
case "wallet_switchEthereumChain":
|
|
2908
|
+
default:
|
|
2909
|
+
throw standardErrors.rpc.methodNotSupported();
|
|
2910
|
+
}
|
|
2911
|
+
} catch (error) {
|
|
2912
|
+
if (isViemError(error)) {
|
|
2913
|
+
const newError = viemHttpErrorToProviderError(error);
|
|
2914
|
+
if (newError) {
|
|
2915
|
+
throw newError;
|
|
2916
|
+
}
|
|
2917
|
+
}
|
|
2918
|
+
throw error;
|
|
2919
|
+
}
|
|
2920
|
+
};
|
|
2921
|
+
return { request };
|
|
2922
|
+
}
|
|
2923
|
+
async function findOwnerIndex({ address, client, publicKey, factory, factoryData }) {
|
|
2924
|
+
const code = await getCode(client, {
|
|
2925
|
+
address
|
|
2926
|
+
});
|
|
2927
|
+
if (!code && factory && factoryData) {
|
|
2928
|
+
const initData = decodeFunctionData({
|
|
2929
|
+
abi: factoryAbi,
|
|
2930
|
+
data: factoryData
|
|
2931
|
+
});
|
|
2932
|
+
if (initData.functionName !== "createAccount") {
|
|
2933
|
+
throw standardErrors.rpc.internal("unknown factory function");
|
|
2934
|
+
}
|
|
2935
|
+
const [owners] = initData.args;
|
|
2936
|
+
return owners.findIndex((owner) => {
|
|
2937
|
+
return owner.toLowerCase() === formatPublicKey(publicKey).toLowerCase();
|
|
2938
|
+
});
|
|
2939
|
+
}
|
|
2940
|
+
const ownerCount = await readContract(client, {
|
|
2941
|
+
address,
|
|
2942
|
+
abi,
|
|
2943
|
+
functionName: "ownerCount"
|
|
2944
|
+
});
|
|
2945
|
+
for (let i = Number(ownerCount) - 1; i >= 0; i--) {
|
|
2946
|
+
const owner = await readContract(client, {
|
|
2947
|
+
address,
|
|
2948
|
+
abi,
|
|
2949
|
+
functionName: "ownerAtIndex",
|
|
2950
|
+
args: [BigInt(i)]
|
|
2951
|
+
});
|
|
2952
|
+
const formatted = formatPublicKey(publicKey);
|
|
2953
|
+
if (owner.toLowerCase() === formatted.toLowerCase()) {
|
|
2954
|
+
return i;
|
|
2955
|
+
}
|
|
2956
|
+
}
|
|
2957
|
+
return -1;
|
|
2958
|
+
}
|
|
2959
|
+
function formatPublicKey(publicKey) {
|
|
2960
|
+
if (isAddress(publicKey)) {
|
|
2961
|
+
return pad(publicKey);
|
|
2962
|
+
}
|
|
2963
|
+
return publicKey;
|
|
2964
|
+
}
|
|
2965
|
+
async function presentAddOwnerDialog() {
|
|
2966
|
+
var _a, _b;
|
|
2967
|
+
const appName = (_b = (_a = store.config.get().metadata) === null || _a === void 0 ? void 0 : _a.appName) !== null && _b !== void 0 ? _b : "App";
|
|
2968
|
+
const dialog2 = initDialog();
|
|
2969
|
+
return new Promise((resolve) => {
|
|
2970
|
+
logDialogShown({ dialogContext: "sub_account_add_owner" });
|
|
2971
|
+
dialog2.presentItem({
|
|
2972
|
+
title: `Re-authorize ${appName}`,
|
|
2973
|
+
message: `${appName} has lost access to your account. Please sign at the next step to re-authorize ${appName}`,
|
|
2974
|
+
onClose: () => {
|
|
2975
|
+
logDialogDismissed({ dialogContext: "sub_account_add_owner" });
|
|
2976
|
+
resolve("cancel");
|
|
2977
|
+
},
|
|
2978
|
+
actionItems: [
|
|
2979
|
+
{
|
|
2980
|
+
text: "Continue",
|
|
2981
|
+
variant: "primary",
|
|
2982
|
+
onClick: () => {
|
|
2983
|
+
logDialogActionClicked({
|
|
2984
|
+
dialogContext: "sub_account_add_owner",
|
|
2985
|
+
dialogAction: "confirm"
|
|
2986
|
+
});
|
|
2987
|
+
dialog2.clear();
|
|
2988
|
+
resolve("authenticate");
|
|
2989
|
+
}
|
|
2990
|
+
},
|
|
2991
|
+
{
|
|
2992
|
+
text: "Not now",
|
|
2993
|
+
variant: "secondary",
|
|
2994
|
+
onClick: () => {
|
|
2995
|
+
logDialogActionClicked({
|
|
2996
|
+
dialogContext: "sub_account_add_owner",
|
|
2997
|
+
dialogAction: "cancel"
|
|
2998
|
+
});
|
|
2999
|
+
dialog2.clear();
|
|
3000
|
+
resolve("cancel");
|
|
3001
|
+
}
|
|
3002
|
+
}
|
|
3003
|
+
]
|
|
3004
|
+
});
|
|
3005
|
+
});
|
|
3006
|
+
}
|
|
3007
|
+
async function handleAddSubAccountOwner({ ownerAccount, globalAccountRequest }) {
|
|
3008
|
+
var _a, _b;
|
|
3009
|
+
const account2 = store.account.get();
|
|
3010
|
+
const subAccount = store.subAccounts.get();
|
|
3011
|
+
const globalAccount = (_a = account2.accounts) === null || _a === void 0 ? void 0 : _a.find((account3) => account3.toLowerCase() !== (subAccount === null || subAccount === void 0 ? void 0 : subAccount.address.toLowerCase()));
|
|
3012
|
+
assertPresence(globalAccount, standardErrors.provider.unauthorized("no global account"));
|
|
3013
|
+
assertPresence((_b = account2.chain) === null || _b === void 0 ? void 0 : _b.id, standardErrors.provider.unauthorized("no chain id"));
|
|
3014
|
+
assertPresence(subAccount === null || subAccount === void 0 ? void 0 : subAccount.address, standardErrors.provider.unauthorized("no sub account"));
|
|
3015
|
+
const calls = [];
|
|
3016
|
+
if (ownerAccount.type === "local" && ownerAccount.address) {
|
|
3017
|
+
calls.push({
|
|
3018
|
+
to: subAccount.address,
|
|
3019
|
+
data: encodeFunctionData({
|
|
3020
|
+
abi,
|
|
3021
|
+
functionName: "addOwnerAddress",
|
|
3022
|
+
args: [ownerAccount.address]
|
|
3023
|
+
}),
|
|
3024
|
+
value: toHex$2(0)
|
|
3025
|
+
});
|
|
3026
|
+
}
|
|
3027
|
+
if (ownerAccount.publicKey) {
|
|
3028
|
+
const [x, y2] = decodeAbiParameters([{ type: "bytes32" }, { type: "bytes32" }], ownerAccount.publicKey);
|
|
3029
|
+
calls.push({
|
|
3030
|
+
to: subAccount.address,
|
|
3031
|
+
data: encodeFunctionData({
|
|
3032
|
+
abi,
|
|
3033
|
+
functionName: "addOwnerPublicKey",
|
|
3034
|
+
args: [x, y2]
|
|
3035
|
+
}),
|
|
3036
|
+
value: toHex$2(0)
|
|
3037
|
+
});
|
|
3038
|
+
}
|
|
3039
|
+
const request = {
|
|
3040
|
+
method: "wallet_sendCalls",
|
|
3041
|
+
params: [
|
|
3042
|
+
{
|
|
3043
|
+
version: "1",
|
|
3044
|
+
calls,
|
|
3045
|
+
chainId: numberToHex(84532),
|
|
3046
|
+
from: globalAccount
|
|
3047
|
+
}
|
|
3048
|
+
]
|
|
3049
|
+
};
|
|
3050
|
+
const selection = await presentAddOwnerDialog();
|
|
3051
|
+
if (selection === "cancel") {
|
|
3052
|
+
throw standardErrors.provider.unauthorized("user cancelled");
|
|
3053
|
+
}
|
|
3054
|
+
const callsId = await globalAccountRequest(request);
|
|
3055
|
+
const client = getClient(account2.chain.id);
|
|
3056
|
+
assertPresence(client, standardErrors.rpc.internal(`client not found for chainId ${account2.chain.id}`));
|
|
3057
|
+
const callsResult = await waitForCallsStatus(client, {
|
|
3058
|
+
id: callsId
|
|
3059
|
+
});
|
|
3060
|
+
if (callsResult.status !== "success") {
|
|
3061
|
+
throw standardErrors.rpc.internal("add owner call failed");
|
|
3062
|
+
}
|
|
3063
|
+
const ownerIndex = await findOwnerIndex({
|
|
3064
|
+
address: subAccount.address,
|
|
3065
|
+
publicKey: ownerAccount.type === "local" && ownerAccount.address ? ownerAccount.address : ownerAccount.publicKey,
|
|
3066
|
+
client
|
|
3067
|
+
});
|
|
3068
|
+
if (ownerIndex === -1) {
|
|
3069
|
+
throw standardErrors.rpc.internal("failed to find owner index");
|
|
3070
|
+
}
|
|
3071
|
+
return ownerIndex;
|
|
3072
|
+
}
|
|
3073
|
+
async function handleInsufficientBalanceError({ errorData, globalAccountAddress, subAccountAddress, client, request, subAccountRequest, globalAccountRequest }) {
|
|
3074
|
+
var _a;
|
|
3075
|
+
const chainId = (_a = client.chain) === null || _a === void 0 ? void 0 : _a.id;
|
|
3076
|
+
assertPresence(chainId, standardErrors.rpc.internal(`invalid chainId`));
|
|
3077
|
+
const spendPermissionRequests = parseFundingOptions({
|
|
3078
|
+
errorData,
|
|
3079
|
+
sourceAddress: globalAccountAddress
|
|
3080
|
+
});
|
|
3081
|
+
const userChoice = await presentSubAccountFundingDialog();
|
|
3082
|
+
if (userChoice === "cancel") {
|
|
3083
|
+
throw new Error("User cancelled funding");
|
|
3084
|
+
}
|
|
3085
|
+
let signatureRequest;
|
|
3086
|
+
const defaultPeriod = 60 * 60 * 24;
|
|
3087
|
+
const defaultMultiplier = 3;
|
|
3088
|
+
if (userChoice === "update_permission") {
|
|
3089
|
+
if (spendPermissionRequests.length === 1) {
|
|
3090
|
+
const spendPermission = spendPermissionRequests[0];
|
|
3091
|
+
const message = createSpendPermissionMessage({
|
|
3092
|
+
spendPermission: {
|
|
3093
|
+
token: spendPermission.token,
|
|
3094
|
+
allowance: numberToHex(spendPermission.requiredAmount * BigInt(defaultMultiplier)),
|
|
3095
|
+
period: defaultPeriod,
|
|
3096
|
+
account: globalAccountAddress,
|
|
3097
|
+
spender: subAccountAddress,
|
|
3098
|
+
start: 0,
|
|
3099
|
+
end: 281474976710655,
|
|
3100
|
+
salt: numberToHex(BigInt(Math.floor(Math.random() * Number.MAX_SAFE_INTEGER))),
|
|
3101
|
+
extraData: "0x"
|
|
3102
|
+
},
|
|
3103
|
+
chainId
|
|
3104
|
+
});
|
|
3105
|
+
signatureRequest = {
|
|
3106
|
+
method: "eth_signTypedData_v4",
|
|
3107
|
+
params: [globalAccountAddress, message]
|
|
3108
|
+
};
|
|
3109
|
+
} else {
|
|
3110
|
+
const message = createSpendPermissionBatchMessage({
|
|
3111
|
+
spendPermissionBatch: {
|
|
3112
|
+
account: globalAccountAddress,
|
|
3113
|
+
period: defaultPeriod,
|
|
3114
|
+
start: 0,
|
|
3115
|
+
end: 281474976710655,
|
|
3116
|
+
permissions: spendPermissionRequests.map((spendPermission) => ({
|
|
3117
|
+
token: spendPermission.token,
|
|
3118
|
+
allowance: numberToHex(spendPermission.requiredAmount * BigInt(defaultMultiplier)),
|
|
3119
|
+
period: defaultPeriod,
|
|
3120
|
+
account: globalAccountAddress,
|
|
3121
|
+
spender: subAccountAddress,
|
|
3122
|
+
salt: "0x0",
|
|
3123
|
+
extraData: "0x"
|
|
3124
|
+
}))
|
|
3125
|
+
},
|
|
3126
|
+
chainId
|
|
3127
|
+
});
|
|
3128
|
+
signatureRequest = {
|
|
3129
|
+
method: "eth_signTypedData_v4",
|
|
3130
|
+
params: [globalAccountAddress, message]
|
|
3131
|
+
};
|
|
3132
|
+
}
|
|
3133
|
+
try {
|
|
3134
|
+
await globalAccountRequest(signatureRequest);
|
|
3135
|
+
} catch (error) {
|
|
3136
|
+
console.error(error);
|
|
3137
|
+
throw new Error("User denied spend permission request");
|
|
3138
|
+
}
|
|
3139
|
+
return subAccountRequest(request);
|
|
3140
|
+
}
|
|
3141
|
+
const transferCalls = spendPermissionRequests.map((spendPermission) => {
|
|
3142
|
+
const isNative = spendPermission.token.toLowerCase() === "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE".toLowerCase();
|
|
3143
|
+
if (isNative) {
|
|
3144
|
+
return {
|
|
3145
|
+
to: subAccountAddress,
|
|
3146
|
+
value: numberToHex(spendPermission.requiredAmount),
|
|
3147
|
+
data: "0x"
|
|
3148
|
+
};
|
|
3149
|
+
}
|
|
3150
|
+
return {
|
|
3151
|
+
to: spendPermission.token,
|
|
3152
|
+
value: "0x0",
|
|
3153
|
+
data: encodeFunctionData({
|
|
3154
|
+
abi: erc20Abi,
|
|
3155
|
+
functionName: "transfer",
|
|
3156
|
+
args: [subAccountAddress, spendPermission.requiredAmount]
|
|
3157
|
+
})
|
|
3158
|
+
};
|
|
3159
|
+
});
|
|
3160
|
+
let originalSendCallsParams;
|
|
3161
|
+
if (request.method === "wallet_sendCalls" && isSendCallsParams(request.params)) {
|
|
3162
|
+
originalSendCallsParams = request.params[0];
|
|
3163
|
+
} else if (request.method === "eth_sendTransaction" && isEthSendTransactionParams(request.params)) {
|
|
3164
|
+
const sendCallsRequest = createWalletSendCallsRequest({
|
|
3165
|
+
calls: [request.params[0]],
|
|
3166
|
+
chainId,
|
|
3167
|
+
from: request.params[0].from
|
|
3168
|
+
});
|
|
3169
|
+
originalSendCallsParams = sendCallsRequest.params[0];
|
|
3170
|
+
} else {
|
|
3171
|
+
throw new Error("Could not get original call");
|
|
3172
|
+
}
|
|
3173
|
+
const subAccountCallData = encodeFunctionData({
|
|
3174
|
+
abi,
|
|
3175
|
+
functionName: "executeBatch",
|
|
3176
|
+
args: [
|
|
3177
|
+
originalSendCallsParams.calls.map((call) => {
|
|
3178
|
+
var _a2, _b;
|
|
3179
|
+
return {
|
|
3180
|
+
target: call.to,
|
|
3181
|
+
value: hexToBigInt((_a2 = call.value) !== null && _a2 !== void 0 ? _a2 : "0x0"),
|
|
3182
|
+
data: (_b = call.data) !== null && _b !== void 0 ? _b : "0x"
|
|
3183
|
+
};
|
|
3184
|
+
})
|
|
3185
|
+
]
|
|
3186
|
+
});
|
|
3187
|
+
const calls = [
|
|
3188
|
+
...transferCalls,
|
|
3189
|
+
{ data: subAccountCallData, to: subAccountAddress, value: "0x0" }
|
|
3190
|
+
];
|
|
3191
|
+
const result = await globalAccountRequest({
|
|
3192
|
+
method: "wallet_sendCalls",
|
|
3193
|
+
params: [Object.assign(Object.assign({}, originalSendCallsParams), { calls, from: globalAccountAddress })]
|
|
3194
|
+
});
|
|
3195
|
+
if (request.method === "eth_sendTransaction") {
|
|
3196
|
+
return waitForCallsTransactionHash({
|
|
3197
|
+
client,
|
|
3198
|
+
id: result
|
|
3199
|
+
});
|
|
3200
|
+
}
|
|
3201
|
+
return result;
|
|
3202
|
+
}
|
|
3203
|
+
class Signer {
|
|
3204
|
+
constructor(params) {
|
|
3205
|
+
var _a, _b, _c, _d;
|
|
3206
|
+
this.communicator = params.communicator;
|
|
3207
|
+
this.callback = params.callback;
|
|
3208
|
+
this.keyManager = new SCWKeyManager();
|
|
3209
|
+
const { account: account2, chains: chains2 } = store.getState();
|
|
3210
|
+
this.accounts = (_a = account2.accounts) !== null && _a !== void 0 ? _a : [];
|
|
3211
|
+
this.chain = (_b = account2.chain) !== null && _b !== void 0 ? _b : {
|
|
3212
|
+
id: (_d = (_c = params.metadata.appChainIds) === null || _c === void 0 ? void 0 : _c[0]) !== null && _d !== void 0 ? _d : 1
|
|
3213
|
+
};
|
|
3214
|
+
if (chains2) {
|
|
3215
|
+
createClients(chains2);
|
|
3216
|
+
}
|
|
3217
|
+
}
|
|
3218
|
+
get isConnected() {
|
|
3219
|
+
return this.accounts.length > 0;
|
|
3220
|
+
}
|
|
3221
|
+
async handshake(args) {
|
|
3222
|
+
var _a, _b, _c;
|
|
3223
|
+
const correlationId = correlationIds.get(args);
|
|
3224
|
+
logHandshakeStarted({ method: args.method, correlationId });
|
|
3225
|
+
try {
|
|
3226
|
+
await ((_b = (_a = this.communicator).waitForPopupLoaded) === null || _b === void 0 ? void 0 : _b.call(_a));
|
|
3227
|
+
const handshakeMessage = await this.createRequestMessage({
|
|
3228
|
+
handshake: {
|
|
3229
|
+
method: args.method,
|
|
3230
|
+
params: (_c = args.params) !== null && _c !== void 0 ? _c : []
|
|
3231
|
+
}
|
|
3232
|
+
}, correlationId);
|
|
3233
|
+
const response = await this.communicator.postRequestAndWaitForResponse(handshakeMessage);
|
|
3234
|
+
if ("failure" in response.content) {
|
|
3235
|
+
throw response.content.failure;
|
|
3236
|
+
}
|
|
3237
|
+
const peerPublicKey = await importKeyFromHexString("public", response.sender);
|
|
3238
|
+
await this.keyManager.setPeerPublicKey(peerPublicKey);
|
|
3239
|
+
const decrypted = await this.decryptResponseMessage(response);
|
|
3240
|
+
this.handleResponse(args, decrypted);
|
|
3241
|
+
logHandshakeCompleted({ method: args.method, correlationId });
|
|
3242
|
+
} catch (error) {
|
|
3243
|
+
logHandshakeError({
|
|
3244
|
+
method: args.method,
|
|
3245
|
+
correlationId,
|
|
3246
|
+
errorMessage: parseErrorMessageFromAny(error)
|
|
3247
|
+
});
|
|
3248
|
+
throw error;
|
|
3249
|
+
}
|
|
3250
|
+
}
|
|
3251
|
+
async request(request) {
|
|
3252
|
+
const correlationId = correlationIds.get(request);
|
|
3253
|
+
logRequestStarted({ method: request.method, correlationId });
|
|
3254
|
+
try {
|
|
3255
|
+
const result = await this._request(request);
|
|
3256
|
+
logRequestCompleted({ method: request.method, correlationId });
|
|
3257
|
+
return result;
|
|
3258
|
+
} catch (error) {
|
|
3259
|
+
logRequestError({
|
|
3260
|
+
method: request.method,
|
|
3261
|
+
correlationId,
|
|
3262
|
+
errorMessage: parseErrorMessageFromAny(error)
|
|
3263
|
+
});
|
|
3264
|
+
throw error;
|
|
3265
|
+
}
|
|
3266
|
+
}
|
|
3267
|
+
async _request(request) {
|
|
3268
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
3269
|
+
if (this.accounts.length === 0) {
|
|
3270
|
+
switch (request.method) {
|
|
3271
|
+
case "wallet_switchEthereumChain": {
|
|
3272
|
+
assertParamsChainId(request.params);
|
|
3273
|
+
this.chain.id = Number(request.params[0].chainId);
|
|
3274
|
+
return;
|
|
3275
|
+
}
|
|
3276
|
+
case "wallet_connect": {
|
|
3277
|
+
await ((_b = (_a = this.communicator).waitForPopupLoaded) === null || _b === void 0 ? void 0 : _b.call(_a));
|
|
3278
|
+
await initSubAccountConfig();
|
|
3279
|
+
let capabilitiesToInject = {};
|
|
3280
|
+
if (requestHasCapability(request, "addSubAccount")) {
|
|
3281
|
+
capabilitiesToInject = (_d = (_c = store.subAccountsConfig.get()) === null || _c === void 0 ? void 0 : _c.capabilities) !== null && _d !== void 0 ? _d : {};
|
|
3282
|
+
}
|
|
3283
|
+
const modifiedRequest = injectRequestCapabilities(request, capabilitiesToInject);
|
|
3284
|
+
return this.sendRequestToPopup(modifiedRequest);
|
|
3285
|
+
}
|
|
3286
|
+
case "wallet_sendCalls":
|
|
3287
|
+
case "wallet_sign": {
|
|
3288
|
+
return this.sendRequestToPopup(request);
|
|
3289
|
+
}
|
|
3290
|
+
default:
|
|
3291
|
+
throw standardErrors.provider.unauthorized();
|
|
3292
|
+
}
|
|
3293
|
+
}
|
|
3294
|
+
if (this.shouldRequestUseSubAccountSigner(request)) {
|
|
3295
|
+
const correlationId = correlationIds.get(request);
|
|
3296
|
+
logSubAccountRequestStarted({ method: request.method, correlationId });
|
|
3297
|
+
try {
|
|
3298
|
+
const result = await this.sendRequestToSubAccountSigner(request);
|
|
3299
|
+
logSubAccountRequestCompleted({ method: request.method, correlationId });
|
|
3300
|
+
return result;
|
|
3301
|
+
} catch (error) {
|
|
3302
|
+
logSubAccountRequestError({
|
|
3303
|
+
method: request.method,
|
|
3304
|
+
correlationId,
|
|
3305
|
+
errorMessage: parseErrorMessageFromAny(error)
|
|
3306
|
+
});
|
|
3307
|
+
throw error;
|
|
3308
|
+
}
|
|
3309
|
+
}
|
|
3310
|
+
switch (request.method) {
|
|
3311
|
+
case "eth_requestAccounts":
|
|
3312
|
+
case "eth_accounts": {
|
|
3313
|
+
const subAccount = store.subAccounts.get();
|
|
3314
|
+
const subAccountsConfig2 = store.subAccountsConfig.get();
|
|
3315
|
+
if (subAccount === null || subAccount === void 0 ? void 0 : subAccount.address) {
|
|
3316
|
+
this.accounts = (subAccountsConfig2 === null || subAccountsConfig2 === void 0 ? void 0 : subAccountsConfig2.enableAutoSubAccounts) ? prependWithoutDuplicates(this.accounts, subAccount.address) : appendWithoutDuplicates(this.accounts, subAccount.address);
|
|
3317
|
+
}
|
|
3318
|
+
(_e = this.callback) === null || _e === void 0 ? void 0 : _e.call(this, "connect", { chainId: numberToHex(this.chain.id) });
|
|
3319
|
+
return this.accounts;
|
|
3320
|
+
}
|
|
3321
|
+
case "eth_coinbase":
|
|
3322
|
+
return this.accounts[0];
|
|
3323
|
+
case "net_version":
|
|
3324
|
+
return this.chain.id;
|
|
3325
|
+
case "eth_chainId":
|
|
3326
|
+
return numberToHex(this.chain.id);
|
|
3327
|
+
case "wallet_getCapabilities":
|
|
3328
|
+
return this.handleGetCapabilitiesRequest(request);
|
|
3329
|
+
case "wallet_switchEthereumChain":
|
|
3330
|
+
return this.handleSwitchChainRequest(request);
|
|
3331
|
+
case "eth_ecRecover":
|
|
3332
|
+
case "personal_sign":
|
|
3333
|
+
case "wallet_sign":
|
|
3334
|
+
case "personal_ecRecover":
|
|
3335
|
+
case "eth_signTransaction":
|
|
3336
|
+
case "eth_sendTransaction":
|
|
3337
|
+
case "eth_signTypedData_v1":
|
|
3338
|
+
case "eth_signTypedData_v3":
|
|
3339
|
+
case "eth_signTypedData_v4":
|
|
3340
|
+
case "eth_signTypedData":
|
|
3341
|
+
case "wallet_addEthereumChain":
|
|
3342
|
+
case "wallet_watchAsset":
|
|
3343
|
+
case "wallet_sendCalls":
|
|
3344
|
+
case "wallet_showCallsStatus":
|
|
3345
|
+
case "wallet_grantPermissions":
|
|
3346
|
+
return this.sendRequestToPopup(request);
|
|
3347
|
+
case "wallet_connect": {
|
|
3348
|
+
const cachedResponse = await getCachedWalletConnectResponse();
|
|
3349
|
+
if (cachedResponse) {
|
|
3350
|
+
return cachedResponse;
|
|
3351
|
+
}
|
|
3352
|
+
await ((_g = (_f = this.communicator).waitForPopupLoaded) === null || _g === void 0 ? void 0 : _g.call(_f));
|
|
3353
|
+
await initSubAccountConfig();
|
|
3354
|
+
const subAccountsConfig2 = store.subAccountsConfig.get();
|
|
3355
|
+
const modifiedRequest = injectRequestCapabilities(request, (_h = subAccountsConfig2 === null || subAccountsConfig2 === void 0 ? void 0 : subAccountsConfig2.capabilities) !== null && _h !== void 0 ? _h : {});
|
|
3356
|
+
const result = await this.sendRequestToPopup(modifiedRequest);
|
|
3357
|
+
(_j = this.callback) === null || _j === void 0 ? void 0 : _j.call(this, "connect", { chainId: numberToHex(this.chain.id) });
|
|
3358
|
+
return result;
|
|
3359
|
+
}
|
|
3360
|
+
// Sub Account Support
|
|
3361
|
+
case "wallet_getSubAccounts": {
|
|
3362
|
+
const subAccount = store.subAccounts.get();
|
|
3363
|
+
if (subAccount === null || subAccount === void 0 ? void 0 : subAccount.address) {
|
|
3364
|
+
return {
|
|
3365
|
+
subAccounts: [subAccount]
|
|
3366
|
+
};
|
|
3367
|
+
}
|
|
3368
|
+
if (!this.chain.rpcUrl) {
|
|
3369
|
+
throw standardErrors.rpc.internal("No RPC URL set for chain");
|
|
3370
|
+
}
|
|
3371
|
+
const response = await fetchRPCRequest(request, this.chain.rpcUrl);
|
|
3372
|
+
assertArrayPresence(response.subAccounts, "subAccounts");
|
|
3373
|
+
if (response.subAccounts.length > 0) {
|
|
3374
|
+
assertSubAccount(response.subAccounts[0]);
|
|
3375
|
+
const subAccount2 = response.subAccounts[0];
|
|
3376
|
+
store.subAccounts.set({
|
|
3377
|
+
address: subAccount2.address,
|
|
3378
|
+
factory: subAccount2.factory,
|
|
3379
|
+
factoryData: subAccount2.factoryData
|
|
3380
|
+
});
|
|
3381
|
+
}
|
|
3382
|
+
return response;
|
|
3383
|
+
}
|
|
3384
|
+
case "wallet_addSubAccount":
|
|
3385
|
+
return this.addSubAccount(request);
|
|
3386
|
+
case "coinbase_fetchPermissions": {
|
|
3387
|
+
assertFetchPermissionsRequest(request);
|
|
3388
|
+
const completeRequest = fillMissingParamsForFetchPermissions(request);
|
|
3389
|
+
const permissions = await fetchRPCRequest(completeRequest, CB_WALLET_RPC_URL);
|
|
3390
|
+
const requestedChainId = hexToNumber((_k = completeRequest.params) === null || _k === void 0 ? void 0 : _k[0].chainId);
|
|
3391
|
+
store.spendPermissions.set(permissions.permissions.map((permission) => Object.assign(Object.assign({}, permission), { chainId: requestedChainId })));
|
|
3392
|
+
return permissions;
|
|
3393
|
+
}
|
|
3394
|
+
default:
|
|
3395
|
+
if (!this.chain.rpcUrl) {
|
|
3396
|
+
throw standardErrors.rpc.internal("No RPC URL set for chain");
|
|
3397
|
+
}
|
|
3398
|
+
return fetchRPCRequest(request, this.chain.rpcUrl);
|
|
3399
|
+
}
|
|
3400
|
+
}
|
|
3401
|
+
async sendRequestToPopup(request) {
|
|
3402
|
+
var _a, _b;
|
|
3403
|
+
await ((_b = (_a = this.communicator).waitForPopupLoaded) === null || _b === void 0 ? void 0 : _b.call(_a));
|
|
3404
|
+
const response = await this.sendEncryptedRequest(request);
|
|
3405
|
+
const decrypted = await this.decryptResponseMessage(response);
|
|
3406
|
+
return this.handleResponse(request, decrypted);
|
|
3407
|
+
}
|
|
3408
|
+
async handleResponse(request, decrypted) {
|
|
3409
|
+
var _a, _b, _c, _d, _e;
|
|
3410
|
+
const result = decrypted.result;
|
|
3411
|
+
if ("error" in result)
|
|
3412
|
+
throw result.error;
|
|
3413
|
+
switch (request.method) {
|
|
3414
|
+
case "eth_requestAccounts": {
|
|
3415
|
+
const accounts = result.value;
|
|
3416
|
+
this.accounts = accounts;
|
|
3417
|
+
store.account.set({
|
|
3418
|
+
accounts,
|
|
3419
|
+
chain: this.chain
|
|
3420
|
+
});
|
|
3421
|
+
(_a = this.callback) === null || _a === void 0 ? void 0 : _a.call(this, "accountsChanged", accounts);
|
|
3422
|
+
break;
|
|
3423
|
+
}
|
|
3424
|
+
case "wallet_connect": {
|
|
3425
|
+
const response = result.value;
|
|
3426
|
+
const accounts = response.accounts.map((account3) => account3.address);
|
|
3427
|
+
this.accounts = accounts;
|
|
3428
|
+
store.account.set({
|
|
3429
|
+
accounts
|
|
3430
|
+
});
|
|
3431
|
+
const account2 = response.accounts.at(0);
|
|
3432
|
+
const capabilities = account2 === null || account2 === void 0 ? void 0 : account2.capabilities;
|
|
3433
|
+
if (capabilities === null || capabilities === void 0 ? void 0 : capabilities.subAccounts) {
|
|
3434
|
+
const capabilityResponse = capabilities === null || capabilities === void 0 ? void 0 : capabilities.subAccounts;
|
|
3435
|
+
assertArrayPresence(capabilityResponse, "subAccounts");
|
|
3436
|
+
assertSubAccount(capabilityResponse[0]);
|
|
3437
|
+
store.subAccounts.set({
|
|
3438
|
+
address: capabilityResponse[0].address,
|
|
3439
|
+
factory: capabilityResponse[0].factory,
|
|
3440
|
+
factoryData: capabilityResponse[0].factoryData
|
|
3441
|
+
});
|
|
3442
|
+
}
|
|
3443
|
+
let accounts_ = [this.accounts[0]];
|
|
3444
|
+
const subAccount = store.subAccounts.get();
|
|
3445
|
+
const subAccountsConfig2 = store.subAccountsConfig.get();
|
|
3446
|
+
if (subAccount === null || subAccount === void 0 ? void 0 : subAccount.address) {
|
|
3447
|
+
this.accounts = (subAccountsConfig2 === null || subAccountsConfig2 === void 0 ? void 0 : subAccountsConfig2.enableAutoSubAccounts) ? prependWithoutDuplicates(this.accounts, subAccount.address) : appendWithoutDuplicates(this.accounts, subAccount.address);
|
|
3448
|
+
}
|
|
3449
|
+
const spendPermissions2 = (_c = (_b = response === null || response === void 0 ? void 0 : response.accounts) === null || _b === void 0 ? void 0 : _b[0].capabilities) === null || _c === void 0 ? void 0 : _c.spendPermissions;
|
|
3450
|
+
if (spendPermissions2 && "permissions" in spendPermissions2) {
|
|
3451
|
+
store.spendPermissions.set(spendPermissions2 === null || spendPermissions2 === void 0 ? void 0 : spendPermissions2.permissions);
|
|
3452
|
+
}
|
|
3453
|
+
(_d = this.callback) === null || _d === void 0 ? void 0 : _d.call(this, "accountsChanged", accounts_);
|
|
3454
|
+
break;
|
|
3455
|
+
}
|
|
3456
|
+
case "wallet_addSubAccount": {
|
|
3457
|
+
assertSubAccount(result.value);
|
|
3458
|
+
const subAccount = result.value;
|
|
3459
|
+
store.subAccounts.set(subAccount);
|
|
3460
|
+
const subAccountsConfig2 = store.subAccountsConfig.get();
|
|
3461
|
+
this.accounts = (subAccountsConfig2 === null || subAccountsConfig2 === void 0 ? void 0 : subAccountsConfig2.enableAutoSubAccounts) ? prependWithoutDuplicates(this.accounts, subAccount.address) : appendWithoutDuplicates(this.accounts, subAccount.address);
|
|
3462
|
+
(_e = this.callback) === null || _e === void 0 ? void 0 : _e.call(this, "accountsChanged", this.accounts);
|
|
3463
|
+
break;
|
|
3464
|
+
}
|
|
3465
|
+
}
|
|
3466
|
+
return result.value;
|
|
3467
|
+
}
|
|
3468
|
+
async cleanup() {
|
|
3469
|
+
var _a, _b;
|
|
3470
|
+
const metadata = store.config.get().metadata;
|
|
3471
|
+
await this.keyManager.clear();
|
|
3472
|
+
store.account.clear();
|
|
3473
|
+
store.subAccounts.clear();
|
|
3474
|
+
store.spendPermissions.clear();
|
|
3475
|
+
store.chains.clear();
|
|
3476
|
+
this.accounts = [];
|
|
3477
|
+
this.chain = {
|
|
3478
|
+
id: (_b = (_a = metadata === null || metadata === void 0 ? void 0 : metadata.appChainIds) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : 1
|
|
3479
|
+
};
|
|
3480
|
+
}
|
|
3481
|
+
/**
|
|
3482
|
+
* @returns `null` if the request was successful.
|
|
3483
|
+
* https://eips.ethereum.org/EIPS/eip-3326#wallet_switchethereumchain
|
|
3484
|
+
*/
|
|
3485
|
+
async handleSwitchChainRequest(request) {
|
|
3486
|
+
assertParamsChainId(request.params);
|
|
3487
|
+
const chainId = ensureIntNumber(request.params[0].chainId);
|
|
3488
|
+
const localResult = this.updateChain(chainId);
|
|
3489
|
+
if (localResult)
|
|
3490
|
+
return null;
|
|
3491
|
+
const popupResult = await this.sendRequestToPopup(request);
|
|
3492
|
+
if (popupResult === null) {
|
|
3493
|
+
this.updateChain(chainId);
|
|
3494
|
+
}
|
|
3495
|
+
return popupResult;
|
|
3496
|
+
}
|
|
3497
|
+
async handleGetCapabilitiesRequest(request) {
|
|
3498
|
+
assertGetCapabilitiesParams(request.params);
|
|
3499
|
+
const requestedAccount = request.params[0];
|
|
3500
|
+
const filterChainIds = request.params[1];
|
|
3501
|
+
if (!this.accounts.some((account2) => isAddressEqual(account2, requestedAccount))) {
|
|
3502
|
+
throw standardErrors.provider.unauthorized("no active account found when getting capabilities");
|
|
3503
|
+
}
|
|
3504
|
+
const capabilities = store.getState().account.capabilities;
|
|
3505
|
+
if (!capabilities) {
|
|
3506
|
+
return {};
|
|
3507
|
+
}
|
|
3508
|
+
if (!filterChainIds || filterChainIds.length === 0) {
|
|
3509
|
+
return capabilities;
|
|
3510
|
+
}
|
|
3511
|
+
const filterChainNumbers = new Set(filterChainIds.map((chainId) => hexToNumber(chainId)));
|
|
3512
|
+
const filteredCapabilities = Object.fromEntries(Object.entries(capabilities).filter(([capabilityKey]) => {
|
|
3513
|
+
try {
|
|
3514
|
+
const capabilityChainNumber = hexToNumber(capabilityKey);
|
|
3515
|
+
return filterChainNumbers.has(capabilityChainNumber);
|
|
3516
|
+
} catch (_a) {
|
|
3517
|
+
return false;
|
|
3518
|
+
}
|
|
3519
|
+
}));
|
|
3520
|
+
return filteredCapabilities;
|
|
3521
|
+
}
|
|
3522
|
+
async sendEncryptedRequest(request) {
|
|
3523
|
+
const sharedSecret = await this.keyManager.getSharedSecret();
|
|
3524
|
+
if (!sharedSecret) {
|
|
3525
|
+
throw standardErrors.provider.unauthorized("No shared secret found when encrypting request");
|
|
3526
|
+
}
|
|
3527
|
+
const encrypted = await encryptContent({
|
|
3528
|
+
action: request,
|
|
3529
|
+
chainId: this.chain.id
|
|
3530
|
+
}, sharedSecret);
|
|
3531
|
+
const correlationId = correlationIds.get(request);
|
|
3532
|
+
const message = await this.createRequestMessage({ encrypted }, correlationId);
|
|
3533
|
+
return this.communicator.postRequestAndWaitForResponse(message);
|
|
3534
|
+
}
|
|
3535
|
+
async createRequestMessage(content, correlationId) {
|
|
3536
|
+
const publicKey = await exportKeyToHexString("public", await this.keyManager.getOwnPublicKey());
|
|
3537
|
+
return {
|
|
3538
|
+
id: crypto.randomUUID(),
|
|
3539
|
+
correlationId,
|
|
3540
|
+
sender: publicKey,
|
|
3541
|
+
content,
|
|
3542
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
3543
|
+
};
|
|
3544
|
+
}
|
|
3545
|
+
async decryptResponseMessage(message) {
|
|
3546
|
+
var _a, _b, _c;
|
|
3547
|
+
const content = message.content;
|
|
3548
|
+
if ("failure" in content) {
|
|
3549
|
+
throw content.failure;
|
|
3550
|
+
}
|
|
3551
|
+
const sharedSecret = await this.keyManager.getSharedSecret();
|
|
3552
|
+
if (!sharedSecret) {
|
|
3553
|
+
throw standardErrors.provider.unauthorized("Invalid session: no shared secret found when decrypting response");
|
|
3554
|
+
}
|
|
3555
|
+
const response = await decryptContent(content.encrypted, sharedSecret);
|
|
3556
|
+
const availableChains = (_a = response.data) === null || _a === void 0 ? void 0 : _a.chains;
|
|
3557
|
+
if (availableChains) {
|
|
3558
|
+
const nativeCurrencies = (_b = response.data) === null || _b === void 0 ? void 0 : _b.nativeCurrencies;
|
|
3559
|
+
const chains2 = Object.entries(availableChains).map(([id, rpcUrl]) => {
|
|
3560
|
+
const nativeCurrency = nativeCurrencies === null || nativeCurrencies === void 0 ? void 0 : nativeCurrencies[Number(id)];
|
|
3561
|
+
return Object.assign({ id: Number(id), rpcUrl }, nativeCurrency ? { nativeCurrency } : {});
|
|
3562
|
+
});
|
|
3563
|
+
store.chains.set(chains2);
|
|
3564
|
+
this.updateChain(this.chain.id, chains2);
|
|
3565
|
+
createClients(chains2);
|
|
3566
|
+
}
|
|
3567
|
+
const walletCapabilities = (_c = response.data) === null || _c === void 0 ? void 0 : _c.capabilities;
|
|
3568
|
+
if (walletCapabilities) {
|
|
3569
|
+
store.account.set({
|
|
3570
|
+
capabilities: walletCapabilities
|
|
3571
|
+
});
|
|
3572
|
+
}
|
|
3573
|
+
return response;
|
|
3574
|
+
}
|
|
3575
|
+
updateChain(chainId, newAvailableChains) {
|
|
3576
|
+
var _a;
|
|
3577
|
+
const state = store.getState();
|
|
3578
|
+
const chains2 = newAvailableChains !== null && newAvailableChains !== void 0 ? newAvailableChains : state.chains;
|
|
3579
|
+
const chain = chains2 === null || chains2 === void 0 ? void 0 : chains2.find((chain2) => chain2.id === chainId);
|
|
3580
|
+
if (!chain)
|
|
3581
|
+
return false;
|
|
3582
|
+
if (chain !== this.chain) {
|
|
3583
|
+
this.chain = chain;
|
|
3584
|
+
store.account.set({
|
|
3585
|
+
chain
|
|
3586
|
+
});
|
|
3587
|
+
(_a = this.callback) === null || _a === void 0 ? void 0 : _a.call(this, "chainChanged", hexStringFromNumber(chain.id));
|
|
3588
|
+
}
|
|
3589
|
+
return true;
|
|
3590
|
+
}
|
|
3591
|
+
async addSubAccount(request) {
|
|
3592
|
+
var _a, _b, _c, _d;
|
|
3593
|
+
const state = store.getState();
|
|
3594
|
+
const subAccount = state.subAccount;
|
|
3595
|
+
const subAccountsConfig2 = store.subAccountsConfig.get();
|
|
3596
|
+
if (subAccount === null || subAccount === void 0 ? void 0 : subAccount.address) {
|
|
3597
|
+
this.accounts = (subAccountsConfig2 === null || subAccountsConfig2 === void 0 ? void 0 : subAccountsConfig2.enableAutoSubAccounts) ? prependWithoutDuplicates(this.accounts, subAccount.address) : appendWithoutDuplicates(this.accounts, subAccount.address);
|
|
3598
|
+
(_a = this.callback) === null || _a === void 0 ? void 0 : _a.call(this, "accountsChanged", this.accounts);
|
|
3599
|
+
return subAccount;
|
|
3600
|
+
}
|
|
3601
|
+
await ((_c = (_b = this.communicator).waitForPopupLoaded) === null || _c === void 0 ? void 0 : _c.call(_b));
|
|
3602
|
+
if (Array.isArray(request.params) && request.params.length > 0 && request.params[0].account && request.params[0].account.type === "create") {
|
|
3603
|
+
let keys2;
|
|
3604
|
+
if (request.params[0].account.keys && request.params[0].account.keys.length > 0) {
|
|
3605
|
+
keys2 = request.params[0].account.keys;
|
|
3606
|
+
} else {
|
|
3607
|
+
const config2 = (_d = store.subAccountsConfig.get()) !== null && _d !== void 0 ? _d : {};
|
|
3608
|
+
const { account: ownerAccount } = config2.toOwnerAccount ? await config2.toOwnerAccount() : await getCryptoKeyAccount();
|
|
3609
|
+
if (!ownerAccount) {
|
|
3610
|
+
throw standardErrors.provider.unauthorized("could not get subaccount owner account when adding sub account");
|
|
3611
|
+
}
|
|
3612
|
+
keys2 = [
|
|
3613
|
+
{
|
|
3614
|
+
type: ownerAccount.address ? "address" : "webauthn-p256",
|
|
3615
|
+
publicKey: ownerAccount.address || ownerAccount.publicKey
|
|
3616
|
+
}
|
|
3617
|
+
];
|
|
3618
|
+
}
|
|
3619
|
+
request.params[0].account.keys = keys2;
|
|
3620
|
+
}
|
|
3621
|
+
const response = await this.sendRequestToPopup(request);
|
|
3622
|
+
assertSubAccount(response);
|
|
3623
|
+
return response;
|
|
3624
|
+
}
|
|
3625
|
+
shouldRequestUseSubAccountSigner(request) {
|
|
3626
|
+
const sender = getSenderFromRequest(request);
|
|
3627
|
+
const subAccount = store.subAccounts.get();
|
|
3628
|
+
if (sender) {
|
|
3629
|
+
return sender.toLowerCase() === (subAccount === null || subAccount === void 0 ? void 0 : subAccount.address.toLowerCase());
|
|
3630
|
+
}
|
|
3631
|
+
return false;
|
|
3632
|
+
}
|
|
3633
|
+
async sendRequestToSubAccountSigner(request) {
|
|
3634
|
+
var _a;
|
|
3635
|
+
const subAccount = store.subAccounts.get();
|
|
3636
|
+
const subAccountsConfig2 = store.subAccountsConfig.get();
|
|
3637
|
+
const config2 = store.config.get();
|
|
3638
|
+
assertPresence(subAccount === null || subAccount === void 0 ? void 0 : subAccount.address, standardErrors.provider.unauthorized("no active sub account when sending request to sub account signer"));
|
|
3639
|
+
const ownerAccount = (subAccountsConfig2 === null || subAccountsConfig2 === void 0 ? void 0 : subAccountsConfig2.toOwnerAccount) ? await subAccountsConfig2.toOwnerAccount() : await getCryptoKeyAccount();
|
|
3640
|
+
assertPresence(ownerAccount === null || ownerAccount === void 0 ? void 0 : ownerAccount.account, standardErrors.provider.unauthorized("no active sub account owner when sending request to sub account signer"));
|
|
3641
|
+
const sender = getSenderFromRequest(request);
|
|
3642
|
+
if (sender === void 0) {
|
|
3643
|
+
request = addSenderToRequest(request, subAccount.address);
|
|
3644
|
+
}
|
|
3645
|
+
const client = getClient(this.chain.id);
|
|
3646
|
+
assertPresence(client, standardErrors.rpc.internal(`client not found for chainId ${this.chain.id} when sending request to sub account signer`));
|
|
3647
|
+
const globalAccountAddress = this.accounts.find((account2) => account2.toLowerCase() !== subAccount.address.toLowerCase());
|
|
3648
|
+
assertPresence(globalAccountAddress, standardErrors.provider.unauthorized("no global account found when sending request to sub account signer"));
|
|
3649
|
+
const dataSuffix = makeDataSuffix({
|
|
3650
|
+
attribution: (_a = config2.preference) === null || _a === void 0 ? void 0 : _a.attribution,
|
|
3651
|
+
dappOrigin: window.location.origin
|
|
3652
|
+
});
|
|
3653
|
+
const publicKey = ownerAccount.account.type === "local" ? ownerAccount.account.address : ownerAccount.account.publicKey;
|
|
3654
|
+
let ownerIndex = await findOwnerIndex({
|
|
3655
|
+
address: subAccount.address,
|
|
3656
|
+
factory: subAccount.factory,
|
|
3657
|
+
factoryData: subAccount.factoryData,
|
|
3658
|
+
publicKey,
|
|
3659
|
+
client
|
|
3660
|
+
});
|
|
3661
|
+
if (ownerIndex === -1) {
|
|
3662
|
+
const correlationId = correlationIds.get(request);
|
|
3663
|
+
logAddOwnerStarted({ method: request.method, correlationId });
|
|
3664
|
+
try {
|
|
3665
|
+
ownerIndex = await handleAddSubAccountOwner({
|
|
3666
|
+
ownerAccount: ownerAccount.account,
|
|
3667
|
+
globalAccountRequest: this.sendRequestToPopup.bind(this)
|
|
3668
|
+
});
|
|
3669
|
+
logAddOwnerCompleted({ method: request.method, correlationId });
|
|
3670
|
+
} catch (error) {
|
|
3671
|
+
logAddOwnerError({
|
|
3672
|
+
method: request.method,
|
|
3673
|
+
correlationId,
|
|
3674
|
+
errorMessage: parseErrorMessageFromAny(error)
|
|
3675
|
+
});
|
|
3676
|
+
return standardErrors.provider.unauthorized("failed to add sub account owner when sending request to sub account signer");
|
|
3677
|
+
}
|
|
3678
|
+
}
|
|
3679
|
+
const { request: subAccountRequest } = await createSubAccountSigner({
|
|
3680
|
+
address: subAccount.address,
|
|
3681
|
+
owner: ownerAccount.account,
|
|
3682
|
+
client,
|
|
3683
|
+
factory: subAccount.factory,
|
|
3684
|
+
factoryData: subAccount.factoryData,
|
|
3685
|
+
parentAddress: globalAccountAddress,
|
|
3686
|
+
attribution: dataSuffix ? { suffix: dataSuffix } : void 0,
|
|
3687
|
+
ownerIndex
|
|
3688
|
+
});
|
|
3689
|
+
try {
|
|
3690
|
+
const result = await subAccountRequest(request);
|
|
3691
|
+
return result;
|
|
3692
|
+
} catch (error) {
|
|
3693
|
+
let errorObject;
|
|
3694
|
+
if (isViemError(error)) {
|
|
3695
|
+
errorObject = JSON.parse(error.details);
|
|
3696
|
+
} else if (isActionableHttpRequestError(error)) {
|
|
3697
|
+
errorObject = error;
|
|
3698
|
+
} else {
|
|
3699
|
+
throw error;
|
|
3700
|
+
}
|
|
3701
|
+
if (!(isActionableHttpRequestError(errorObject) && errorObject.data)) {
|
|
3702
|
+
throw error;
|
|
3703
|
+
}
|
|
3704
|
+
if (!errorObject.data) {
|
|
3705
|
+
throw error;
|
|
3706
|
+
}
|
|
3707
|
+
const correlationId = correlationIds.get(request);
|
|
3708
|
+
logInsufficientBalanceErrorHandlingStarted({ method: request.method, correlationId });
|
|
3709
|
+
try {
|
|
3710
|
+
const result = await handleInsufficientBalanceError({
|
|
3711
|
+
errorData: errorObject.data,
|
|
3712
|
+
globalAccountAddress,
|
|
3713
|
+
subAccountAddress: subAccount.address,
|
|
3714
|
+
client,
|
|
3715
|
+
request,
|
|
3716
|
+
subAccountRequest,
|
|
3717
|
+
globalAccountRequest: this.request.bind(this)
|
|
3718
|
+
});
|
|
3719
|
+
logInsufficientBalanceErrorHandlingCompleted({ method: request.method, correlationId });
|
|
3720
|
+
return result;
|
|
3721
|
+
} catch (handlingError) {
|
|
3722
|
+
console.error(handlingError);
|
|
3723
|
+
logInsufficientBalanceErrorHandlingError({
|
|
3724
|
+
method: request.method,
|
|
3725
|
+
correlationId,
|
|
3726
|
+
errorMessage: parseErrorMessageFromAny(handlingError)
|
|
3727
|
+
});
|
|
3728
|
+
throw error;
|
|
3729
|
+
}
|
|
3730
|
+
}
|
|
3731
|
+
}
|
|
3732
|
+
}
|
|
3733
|
+
var __rest = function(s, e) {
|
|
3734
|
+
var t = {};
|
|
3735
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
3736
|
+
t[p] = s[p];
|
|
3737
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
3738
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
3739
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
3740
|
+
t[p[i]] = s[p[i]];
|
|
3741
|
+
}
|
|
3742
|
+
return t;
|
|
3743
|
+
};
|
|
3744
|
+
class BaseAccountProvider extends ProviderEventEmitter {
|
|
3745
|
+
constructor(_a) {
|
|
3746
|
+
var { metadata } = _a, _b = _a.preference, { walletUrl } = _b, preference = __rest(_b, ["walletUrl"]);
|
|
3747
|
+
super();
|
|
3748
|
+
this.isBaseAccount = true;
|
|
3749
|
+
this.communicator = new Communicator({
|
|
3750
|
+
url: walletUrl,
|
|
3751
|
+
metadata,
|
|
3752
|
+
preference
|
|
3753
|
+
});
|
|
3754
|
+
this.signer = new Signer({
|
|
3755
|
+
metadata,
|
|
3756
|
+
communicator: this.communicator,
|
|
3757
|
+
callback: this.emit.bind(this)
|
|
3758
|
+
});
|
|
3759
|
+
}
|
|
3760
|
+
async request(args) {
|
|
3761
|
+
const correlationId = crypto.randomUUID();
|
|
3762
|
+
correlationIds.set(args, correlationId);
|
|
3763
|
+
logRequestStarted$1({ method: args.method, correlationId });
|
|
3764
|
+
try {
|
|
3765
|
+
const result = await this._request(args);
|
|
3766
|
+
logRequestResponded({
|
|
3767
|
+
method: args.method,
|
|
3768
|
+
correlationId
|
|
3769
|
+
});
|
|
3770
|
+
return result;
|
|
3771
|
+
} catch (error) {
|
|
3772
|
+
logRequestError$1({
|
|
3773
|
+
method: args.method,
|
|
3774
|
+
correlationId,
|
|
3775
|
+
errorMessage: error instanceof Error ? error.message : ""
|
|
3776
|
+
});
|
|
3777
|
+
throw error;
|
|
3778
|
+
} finally {
|
|
3779
|
+
correlationIds.delete(args);
|
|
3780
|
+
}
|
|
3781
|
+
}
|
|
3782
|
+
async _request(args) {
|
|
3783
|
+
var _a, _b;
|
|
3784
|
+
try {
|
|
3785
|
+
checkErrorForInvalidRequestArgs(args);
|
|
3786
|
+
if (!this.signer.isConnected) {
|
|
3787
|
+
switch (args.method) {
|
|
3788
|
+
case "eth_requestAccounts": {
|
|
3789
|
+
await this.signer.handshake({ method: "handshake" });
|
|
3790
|
+
await initSubAccountConfig();
|
|
3791
|
+
await this.signer.request({
|
|
3792
|
+
method: "wallet_connect",
|
|
3793
|
+
params: [
|
|
3794
|
+
{
|
|
3795
|
+
version: "1",
|
|
3796
|
+
capabilities: Object.assign({}, (_b = (_a = store.subAccountsConfig.get()) === null || _a === void 0 ? void 0 : _a.capabilities) !== null && _b !== void 0 ? _b : {})
|
|
3797
|
+
}
|
|
3798
|
+
]
|
|
3799
|
+
});
|
|
3800
|
+
break;
|
|
3801
|
+
}
|
|
3802
|
+
case "wallet_connect": {
|
|
3803
|
+
await this.signer.handshake({ method: "handshake" });
|
|
3804
|
+
const result2 = await this.signer.request(args);
|
|
3805
|
+
return result2;
|
|
3806
|
+
}
|
|
3807
|
+
case "wallet_sendCalls":
|
|
3808
|
+
case "wallet_sign": {
|
|
3809
|
+
try {
|
|
3810
|
+
await this.signer.handshake({ method: "handshake" });
|
|
3811
|
+
const result2 = await this.signer.request(args);
|
|
3812
|
+
return result2;
|
|
3813
|
+
} finally {
|
|
3814
|
+
await this.signer.cleanup();
|
|
3815
|
+
}
|
|
3816
|
+
}
|
|
3817
|
+
case "wallet_getCallsStatus": {
|
|
3818
|
+
const result2 = await fetchRPCRequest(args, CB_WALLET_RPC_URL);
|
|
3819
|
+
return result2;
|
|
3820
|
+
}
|
|
3821
|
+
case "eth_accounts": {
|
|
3822
|
+
return [];
|
|
3823
|
+
}
|
|
3824
|
+
case "net_version": {
|
|
3825
|
+
const result2 = 1;
|
|
3826
|
+
return result2;
|
|
3827
|
+
}
|
|
3828
|
+
case "eth_chainId": {
|
|
3829
|
+
const result2 = hexStringFromNumber(1);
|
|
3830
|
+
return result2;
|
|
3831
|
+
}
|
|
3832
|
+
default: {
|
|
3833
|
+
throw standardErrors.provider.unauthorized("Must call 'eth_requestAccounts' before other methods");
|
|
3834
|
+
}
|
|
3835
|
+
}
|
|
3836
|
+
}
|
|
3837
|
+
const result = await this.signer.request(args);
|
|
3838
|
+
return result;
|
|
3839
|
+
} catch (error) {
|
|
3840
|
+
const { code } = error;
|
|
3841
|
+
if (code === standardErrorCodes.provider.unauthorized) {
|
|
3842
|
+
await this.disconnect();
|
|
3843
|
+
}
|
|
3844
|
+
return Promise.reject(serializeError(error));
|
|
3845
|
+
}
|
|
3846
|
+
}
|
|
3847
|
+
async disconnect() {
|
|
3848
|
+
await this.signer.cleanup();
|
|
3849
|
+
correlationIds.clear();
|
|
3850
|
+
this.emit("disconnect", standardErrors.provider.disconnected("User initiated disconnection"));
|
|
3851
|
+
}
|
|
3852
|
+
}
|
|
3853
|
+
const TBA_PROVIDER_IDENTIFIER = "isCoinbaseBrowser";
|
|
3854
|
+
function getInjectedProvider() {
|
|
3855
|
+
var _a, _b;
|
|
3856
|
+
const injectedProvider = (_a = window.ethereum) !== null && _a !== void 0 ? _a : (_b = window.top) === null || _b === void 0 ? void 0 : _b.ethereum;
|
|
3857
|
+
if (injectedProvider === null || injectedProvider === void 0 ? void 0 : injectedProvider[TBA_PROVIDER_IDENTIFIER]) {
|
|
3858
|
+
return injectedProvider;
|
|
3859
|
+
}
|
|
3860
|
+
return null;
|
|
3861
|
+
}
|
|
3862
|
+
function createBaseAccountSDK(params) {
|
|
3863
|
+
var _a, _b, _c, _d;
|
|
3864
|
+
const options = {
|
|
3865
|
+
metadata: {
|
|
3866
|
+
appName: params.appName || "App",
|
|
3867
|
+
appLogoUrl: params.appLogoUrl || "",
|
|
3868
|
+
appChainIds: params.appChainIds || []
|
|
3869
|
+
},
|
|
3870
|
+
preference: (_a = params.preference) !== null && _a !== void 0 ? _a : {},
|
|
3871
|
+
paymasterUrls: params.paymasterUrls
|
|
3872
|
+
};
|
|
3873
|
+
if ((_b = params.subAccounts) === null || _b === void 0 ? void 0 : _b.toOwnerAccount) {
|
|
3874
|
+
validateSubAccount(params.subAccounts.toOwnerAccount);
|
|
3875
|
+
}
|
|
3876
|
+
store.subAccountsConfig.set({
|
|
3877
|
+
toOwnerAccount: (_c = params.subAccounts) === null || _c === void 0 ? void 0 : _c.toOwnerAccount,
|
|
3878
|
+
// @ts-expect-error - enableSubAccounts is not officially supported yet
|
|
3879
|
+
enableAutoSubAccounts: (_d = params.subAccounts) === null || _d === void 0 ? void 0 : _d.enableAutoSubAccounts
|
|
3880
|
+
});
|
|
3881
|
+
store.config.set(options);
|
|
3882
|
+
void store.persist.rehydrate();
|
|
3883
|
+
void checkCrossOriginOpenerPolicy();
|
|
3884
|
+
validatePreferences(options.preference);
|
|
3885
|
+
if (options.preference.telemetry !== false) {
|
|
3886
|
+
void loadTelemetryScript();
|
|
3887
|
+
}
|
|
3888
|
+
let provider = null;
|
|
3889
|
+
const sdk = {
|
|
3890
|
+
getProvider: () => {
|
|
3891
|
+
var _a2;
|
|
3892
|
+
if (!provider) {
|
|
3893
|
+
provider = (_a2 = getInjectedProvider()) !== null && _a2 !== void 0 ? _a2 : new BaseAccountProvider(options);
|
|
3894
|
+
}
|
|
3895
|
+
return provider;
|
|
3896
|
+
},
|
|
3897
|
+
subAccount: {
|
|
3898
|
+
async create(accountParam) {
|
|
3899
|
+
var _a2;
|
|
3900
|
+
return await ((_a2 = sdk.getProvider()) === null || _a2 === void 0 ? void 0 : _a2.request({
|
|
3901
|
+
method: "wallet_addSubAccount",
|
|
3902
|
+
params: [
|
|
3903
|
+
{
|
|
3904
|
+
version: "1",
|
|
3905
|
+
account: accountParam
|
|
3906
|
+
}
|
|
3907
|
+
]
|
|
3908
|
+
}));
|
|
3909
|
+
},
|
|
3910
|
+
async get() {
|
|
3911
|
+
var _a2, _b2;
|
|
3912
|
+
const subAccount = store.subAccounts.get();
|
|
3913
|
+
if (subAccount === null || subAccount === void 0 ? void 0 : subAccount.address) {
|
|
3914
|
+
return subAccount;
|
|
3915
|
+
}
|
|
3916
|
+
const response = await ((_a2 = sdk.getProvider()) === null || _a2 === void 0 ? void 0 : _a2.request({
|
|
3917
|
+
method: "wallet_connect",
|
|
3918
|
+
params: [
|
|
3919
|
+
{
|
|
3920
|
+
version: "1",
|
|
3921
|
+
capabilities: {}
|
|
3922
|
+
}
|
|
3923
|
+
]
|
|
3924
|
+
}));
|
|
3925
|
+
const subAccounts2 = (_b2 = response.accounts[0].capabilities) === null || _b2 === void 0 ? void 0 : _b2.subAccounts;
|
|
3926
|
+
if (!Array.isArray(subAccounts2)) {
|
|
3927
|
+
return null;
|
|
3928
|
+
}
|
|
3929
|
+
return subAccounts2[0];
|
|
3930
|
+
},
|
|
3931
|
+
addOwner: async ({ address, publicKey, chainId }) => {
|
|
3932
|
+
var _a2, _b2;
|
|
3933
|
+
const subAccount = store.subAccounts.get();
|
|
3934
|
+
const account2 = store.account.get();
|
|
3935
|
+
assertPresence(account2, new Error("account does not exist"));
|
|
3936
|
+
assertPresence(subAccount === null || subAccount === void 0 ? void 0 : subAccount.address, new Error("subaccount does not exist"));
|
|
3937
|
+
const calls = [];
|
|
3938
|
+
if (publicKey) {
|
|
3939
|
+
const [x, y2] = decodeAbiParameters([{ type: "bytes32" }, { type: "bytes32" }], publicKey);
|
|
3940
|
+
calls.push({
|
|
3941
|
+
to: subAccount.address,
|
|
3942
|
+
data: encodeFunctionData({
|
|
3943
|
+
abi,
|
|
3944
|
+
functionName: "addOwnerPublicKey",
|
|
3945
|
+
args: [x, y2]
|
|
3946
|
+
}),
|
|
3947
|
+
value: toHex$2(0)
|
|
3948
|
+
});
|
|
3949
|
+
}
|
|
3950
|
+
if (address) {
|
|
3951
|
+
calls.push({
|
|
3952
|
+
to: subAccount.address,
|
|
3953
|
+
data: encodeFunctionData({
|
|
3954
|
+
abi,
|
|
3955
|
+
functionName: "addOwnerAddress",
|
|
3956
|
+
args: [address]
|
|
3957
|
+
}),
|
|
3958
|
+
value: toHex$2(0)
|
|
3959
|
+
});
|
|
3960
|
+
}
|
|
3961
|
+
return await ((_a2 = sdk.getProvider()) === null || _a2 === void 0 ? void 0 : _a2.request({
|
|
3962
|
+
method: "wallet_sendCalls",
|
|
3963
|
+
params: [
|
|
3964
|
+
{
|
|
3965
|
+
calls,
|
|
3966
|
+
chainId: toHex$2(chainId),
|
|
3967
|
+
from: (_b2 = account2.accounts) === null || _b2 === void 0 ? void 0 : _b2[0],
|
|
3968
|
+
version: "1"
|
|
3969
|
+
}
|
|
3970
|
+
]
|
|
3971
|
+
}));
|
|
3972
|
+
},
|
|
3973
|
+
setToOwnerAccount(toSubAccountOwner) {
|
|
3974
|
+
validateSubAccount(toSubAccountOwner);
|
|
3975
|
+
store.subAccountsConfig.set({
|
|
3976
|
+
toOwnerAccount: toSubAccountOwner
|
|
3977
|
+
});
|
|
3978
|
+
}
|
|
3979
|
+
}
|
|
3980
|
+
};
|
|
3981
|
+
return sdk;
|
|
3982
|
+
}
|
|
3983
|
+
export {
|
|
3984
|
+
createBaseAccountSDK,
|
|
3985
|
+
getCryptoKeyAccount
|
|
3986
|
+
};
|
|
3987
|
+
//# sourceMappingURL=index-Cmdv-EKc.js.map
|