@reown/appkit-cdn 1.8.15-ea982070c1d274f5971447c430b6d77717082e78.0 → 1.8.15-viem-upgrade.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/package.json +10 -10
- package/dist/ConstantsUtil-BTJjr2qs.js +0 -24
- package/dist/ConstantsUtil-BTJjr2qs.js.map +0 -1
- package/dist/ExchangeController-CncqkHeT.js +0 -265
- package/dist/ExchangeController-CncqkHeT.js.map +0 -1
- package/dist/HelpersUtil-CwxnHyjS.js +0 -141
- package/dist/HelpersUtil-CwxnHyjS.js.map +0 -1
- package/dist/NavigationUtil-Ci15WS4K.js +0 -9
- package/dist/NavigationUtil-Ci15WS4K.js.map +0 -1
- package/dist/PhArrowCircleDown-B41iUlWV.js +0 -74
- package/dist/PhArrowCircleDown-B41iUlWV.js.map +0 -1
- package/dist/PhArrowClockwise-BY8u5n41.js +0 -74
- package/dist/PhArrowClockwise-BY8u5n41.js.map +0 -1
- package/dist/PhArrowDown-ClD8GZ65.js +0 -74
- package/dist/PhArrowDown-ClD8GZ65.js.map +0 -1
- package/dist/PhArrowLeft-B8MXUz60.js +0 -74
- package/dist/PhArrowLeft-B8MXUz60.js.map +0 -1
- package/dist/PhArrowRight-Cewa_Slb.js +0 -74
- package/dist/PhArrowRight-Cewa_Slb.js.map +0 -1
- package/dist/PhArrowSquareOut-whgWh-lD.js +0 -74
- package/dist/PhArrowSquareOut-whgWh-lD.js.map +0 -1
- package/dist/PhArrowUp-B1HXBxie.js +0 -74
- package/dist/PhArrowUp-B1HXBxie.js.map +0 -1
- package/dist/PhArrowUpRight-CfFYe4FP.js +0 -74
- package/dist/PhArrowUpRight-CfFYe4FP.js.map +0 -1
- package/dist/PhArrowsClockwise-gL1Gkrtx.js +0 -74
- package/dist/PhArrowsClockwise-gL1Gkrtx.js.map +0 -1
- package/dist/PhArrowsDownUp-BqUEdUQr.js +0 -74
- package/dist/PhArrowsDownUp-BqUEdUQr.js.map +0 -1
- package/dist/PhArrowsLeftRight-BlZU63eY.js +0 -74
- package/dist/PhArrowsLeftRight-BlZU63eY.js.map +0 -1
- package/dist/PhBank-gbg_jlI7.js +0 -74
- package/dist/PhBank-gbg_jlI7.js.map +0 -1
- package/dist/PhBrowser-CMlD-YJw.js +0 -74
- package/dist/PhBrowser-CMlD-YJw.js.map +0 -1
- package/dist/PhCaretDown-3agTO8Jp.js +0 -74
- package/dist/PhCaretDown-3agTO8Jp.js.map +0 -1
- package/dist/PhCaretLeft-_MTni7Z5.js +0 -74
- package/dist/PhCaretLeft-_MTni7Z5.js.map +0 -1
- package/dist/PhCaretRight-Ci9fAHPG.js +0 -74
- package/dist/PhCaretRight-Ci9fAHPG.js.map +0 -1
- package/dist/PhCaretUp-vFG4Fame.js +0 -74
- package/dist/PhCaretUp-vFG4Fame.js.map +0 -1
- package/dist/PhCheck-mChGK6K_.js +0 -74
- package/dist/PhCheck-mChGK6K_.js.map +0 -1
- package/dist/PhCircleHalf-DZ7-vfxf.js +0 -74
- package/dist/PhCircleHalf-DZ7-vfxf.js.map +0 -1
- package/dist/PhClock-Bc5XWXb6.js +0 -74
- package/dist/PhClock-Bc5XWXb6.js.map +0 -1
- package/dist/PhCompass-Cu2MB-55.js +0 -74
- package/dist/PhCompass-Cu2MB-55.js.map +0 -1
- package/dist/PhCopy-BGUjyTts.js +0 -74
- package/dist/PhCopy-BGUjyTts.js.map +0 -1
- package/dist/PhCreditCard-vxFWID4B.js +0 -74
- package/dist/PhCreditCard-vxFWID4B.js.map +0 -1
- package/dist/PhCurrencyDollar-BfOoDhJr.js +0 -74
- package/dist/PhCurrencyDollar-BfOoDhJr.js.map +0 -1
- package/dist/PhDesktop-Cq6jwzbS.js +0 -74
- package/dist/PhDesktop-Cq6jwzbS.js.map +0 -1
- package/dist/PhDeviceMobile-BCtTp6jj.js +0 -74
- package/dist/PhDeviceMobile-BCtTp6jj.js.map +0 -1
- package/dist/PhDotsThree-BGgD-WIO.js +0 -74
- package/dist/PhDotsThree-BGgD-WIO.js.map +0 -1
- package/dist/PhEnvelope-CQiV0-zG.js +0 -74
- package/dist/PhEnvelope-CQiV0-zG.js.map +0 -1
- package/dist/PhFunnelSimple-BHGtxTNf.js +0 -74
- package/dist/PhFunnelSimple-BHGtxTNf.js.map +0 -1
- package/dist/PhGlobe-Q8oVkf6X.js +0 -74
- package/dist/PhGlobe-Q8oVkf6X.js.map +0 -1
- package/dist/PhIdentificationCard-Cz9LzvVR.js +0 -74
- package/dist/PhIdentificationCard-Cz9LzvVR.js.map +0 -1
- package/dist/PhImage-CP5_qKk-.js +0 -74
- package/dist/PhImage-CP5_qKk-.js.map +0 -1
- package/dist/PhInfo-CTlE1X9Z.js +0 -74
- package/dist/PhInfo-CTlE1X9Z.js.map +0 -1
- package/dist/PhLightbulb-CcLpnAAb.js +0 -74
- package/dist/PhLightbulb-CcLpnAAb.js.map +0 -1
- package/dist/PhMagnifyingGlass-n58GUAck.js +0 -74
- package/dist/PhMagnifyingGlass-n58GUAck.js.map +0 -1
- package/dist/PhPaperPlaneRight-C0sf2XV8.js +0 -74
- package/dist/PhPaperPlaneRight-C0sf2XV8.js.map +0 -1
- package/dist/PhPlus-BJxvt7Uc.js +0 -74
- package/dist/PhPlus-BJxvt7Uc.js.map +0 -1
- package/dist/PhPower-BvktxO2-.js +0 -74
- package/dist/PhPower-BvktxO2-.js.map +0 -1
- package/dist/PhPuzzlePiece-CDDyUPYo.js +0 -74
- package/dist/PhPuzzlePiece-CDDyUPYo.js.map +0 -1
- package/dist/PhQrCode-BlGI8529.js +0 -74
- package/dist/PhQrCode-BlGI8529.js.map +0 -1
- package/dist/PhQuestion-DGZj6iDZ.js +0 -74
- package/dist/PhQuestion-DGZj6iDZ.js.map +0 -1
- package/dist/PhQuestionMark-CTmeI7MQ.js +0 -74
- package/dist/PhQuestionMark-CTmeI7MQ.js.map +0 -1
- package/dist/PhSealCheck-BSlqkxnH.js +0 -74
- package/dist/PhSealCheck-BSlqkxnH.js.map +0 -1
- package/dist/PhSignOut-CEXxlRk3.js +0 -74
- package/dist/PhSignOut-CEXxlRk3.js.map +0 -1
- package/dist/PhSpinner-Do1pY8fG.js +0 -74
- package/dist/PhSpinner-Do1pY8fG.js.map +0 -1
- package/dist/PhTrash-JNKavmpg.js +0 -74
- package/dist/PhTrash-JNKavmpg.js.map +0 -1
- package/dist/PhUser-BW7E-xYg.js +0 -74
- package/dist/PhUser-BW7E-xYg.js.map +0 -1
- package/dist/PhVault-mzxUgBYN.js +0 -74
- package/dist/PhVault-mzxUgBYN.js.map +0 -1
- package/dist/PhWallet-BR9JThKU.js +0 -74
- package/dist/PhWallet-BR9JThKU.js.map +0 -1
- package/dist/PhWarning-DxuQ70WM.js +0 -74
- package/dist/PhWarning-DxuQ70WM.js.map +0 -1
- package/dist/PhWarningCircle-DCI0JC1F.js +0 -74
- package/dist/PhWarningCircle-DCI0JC1F.js.map +0 -1
- package/dist/PhX-CWNXqpGn.js +0 -74
- package/dist/PhX-CWNXqpGn.js.map +0 -1
- package/dist/SwapController-DsYbP4IS.js +0 -684
- package/dist/SwapController-DsYbP4IS.js.map +0 -1
- package/dist/WebCryptoP256-Czt7ZkJ7.js +0 -3299
- package/dist/WebCryptoP256-Czt7ZkJ7.js.map +0 -1
- package/dist/add-UkulHTXi.js +0 -20
- package/dist/add-UkulHTXi.js.map +0 -1
- package/dist/all-wallets-DhJCVmL_.js +0 -11
- package/dist/all-wallets-DhJCVmL_.js.map +0 -1
- package/dist/app-store-Ern3I2La.js +0 -22
- package/dist/app-store-Ern3I2La.js.map +0 -1
- package/dist/appkit-ppmICUF1.js +0 -118106
- package/dist/appkit-ppmICUF1.js.map +0 -1
- package/dist/appkit.js +0 -11
- package/dist/appkit.js.map +0 -1
- package/dist/apple-_SZ-XSIx.js +0 -23
- package/dist/apple-_SZ-XSIx.js.map +0 -1
- package/dist/arrow-bottom-D7Qlu6xE.js +0 -13
- package/dist/arrow-bottom-D7Qlu6xE.js.map +0 -1
- package/dist/arrow-bottom-circle-Cel-TDaT.js +0 -16
- package/dist/arrow-bottom-circle-Cel-TDaT.js.map +0 -1
- package/dist/arrow-left-ByNxCvA_.js +0 -13
- package/dist/arrow-left-ByNxCvA_.js.map +0 -1
- package/dist/arrow-right-yep9R_ud.js +0 -13
- package/dist/arrow-right-yep9R_ud.js.map +0 -1
- package/dist/arrow-top-C1WlBAfk.js +0 -13
- package/dist/arrow-top-C1WlBAfk.js.map +0 -1
- package/dist/async-directive-C9EnweIr.js +0 -73
- package/dist/async-directive-C9EnweIr.js.map +0 -1
- package/dist/bank-Dm8zmIr0.js +0 -19
- package/dist/bank-Dm8zmIr0.js.map +0 -1
- package/dist/basic-UB459qAF.js +0 -4914
- package/dist/basic-UB459qAF.js.map +0 -1
- package/dist/browser-5XoTmr4n.js +0 -1991
- package/dist/browser-5XoTmr4n.js.map +0 -1
- package/dist/browser-LYv8PF5c.js +0 -19
- package/dist/browser-LYv8PF5c.js.map +0 -1
- package/dist/card-CEQLkIir.js +0 -19
- package/dist/card-CEQLkIir.js.map +0 -1
- package/dist/ccip-Dj8tRQd7.js +0 -164
- package/dist/ccip-Dj8tRQd7.js.map +0 -1
- package/dist/checkmark-DPFC_0yn.js +0 -16
- package/dist/checkmark-DPFC_0yn.js.map +0 -1
- package/dist/checkmark-bold-Hwfezlkn.js +0 -13
- package/dist/checkmark-bold-Hwfezlkn.js.map +0 -1
- package/dist/chevron-bottom-qsPvhQDo.js +0 -13
- package/dist/chevron-bottom-qsPvhQDo.js.map +0 -1
- package/dist/chevron-left-CA4SOr_F.js +0 -13
- package/dist/chevron-left-CA4SOr_F.js.map +0 -1
- package/dist/chevron-right-TeVZyORZ.js +0 -13
- package/dist/chevron-right-TeVZyORZ.js.map +0 -1
- package/dist/chevron-top-B7LCiM2n.js +0 -13
- package/dist/chevron-top-B7LCiM2n.js.map +0 -1
- package/dist/chrome-store-CU7w_5QC.js +0 -66
- package/dist/chrome-store-CU7w_5QC.js.map +0 -1
- package/dist/class-map-B814K2ej.js +0 -101
- package/dist/class-map-B814K2ej.js.map +0 -1
- package/dist/clock-DcbItfiJ.js +0 -13
- package/dist/clock-DcbItfiJ.js.map +0 -1
- package/dist/close-B22QsrS0.js +0 -13
- package/dist/close-B22QsrS0.js.map +0 -1
- package/dist/clsx.m-D57qXwfE.js +0 -21
- package/dist/clsx.m-D57qXwfE.js.map +0 -1
- package/dist/coinPlaceholder-BNrjpg6-.js +0 -13
- package/dist/coinPlaceholder-BNrjpg6-.js.map +0 -1
- package/dist/compass-C7GRFU39.js +0 -13
- package/dist/compass-C7GRFU39.js.map +0 -1
- package/dist/copy-BcrOhyLL.js +0 -20
- package/dist/copy-BcrOhyLL.js.map +0 -1
- package/dist/core-BI_Ap4BF.js +0 -16288
- package/dist/core-BI_Ap4BF.js.map +0 -1
- package/dist/cursor-AJkpyAWk.js +0 -8
- package/dist/cursor-AJkpyAWk.js.map +0 -1
- package/dist/cursor-transparent-C1dF4GFm.js +0 -17
- package/dist/cursor-transparent-C1dF4GFm.js.map +0 -1
- package/dist/data-capture-CqwQ1053.js +0 -549
- package/dist/data-capture-CqwQ1053.js.map +0 -1
- package/dist/desktop-C60oOo59.js +0 -14
- package/dist/desktop-C60oOo59.js.map +0 -1
- package/dist/disconnect-DqS517fE.js +0 -13
- package/dist/disconnect-DqS517fE.js.map +0 -1
- package/dist/discord-D1qNpgLJ.js +0 -22
- package/dist/discord-D1qNpgLJ.js.map +0 -1
- package/dist/email-UK97sxf8.js +0 -421
- package/dist/email-UK97sxf8.js.map +0 -1
- package/dist/embedded-wallet-f8ft4R2q.js +0 -952
- package/dist/embedded-wallet-f8ft4R2q.js.map +0 -1
- package/dist/etherscan-BWSY3GuJ.js +0 -11
- package/dist/etherscan-BWSY3GuJ.js.map +0 -1
- package/dist/exclamation-triangle-nypPoZ5T.js +0 -9
- package/dist/exclamation-triangle-nypPoZ5T.js.map +0 -1
- package/dist/extension-BuFHuaRl.js +0 -13
- package/dist/extension-BuFHuaRl.js.map +0 -1
- package/dist/external-link-L3QQJwck.js +0 -13
- package/dist/external-link-L3QQJwck.js.map +0 -1
- package/dist/facebook-BbbjiGyt.js +0 -31
- package/dist/facebook-BbbjiGyt.js.map +0 -1
- package/dist/farcaster-CDar3vjq.js +0 -17
- package/dist/farcaster-CDar3vjq.js.map +0 -1
- package/dist/features-Dne1ZyJy.js +0 -319
- package/dist/features-Dne1ZyJy.js.map +0 -1
- package/dist/filters-BprVfwTM.js +0 -13
- package/dist/filters-BprVfwTM.js.map +0 -1
- package/dist/github-BFRFSS65.js +0 -23
- package/dist/github-BFRFSS65.js.map +0 -1
- package/dist/google-DX3b-tuu.js +0 -23
- package/dist/google-DX3b-tuu.js.map +0 -1
- package/dist/hashTypedData-MEx8_Z-J.js +0 -262
- package/dist/hashTypedData-MEx8_Z-J.js.map +0 -1
- package/dist/help-circle-PtWG4XV9.js +0 -17
- package/dist/help-circle-PtWG4XV9.js.map +0 -1
- package/dist/id-BKzsrqpW.js +0 -17
- package/dist/id-BKzsrqpW.js.map +0 -1
- package/dist/if-defined-CyuCf775.js +0 -11
- package/dist/if-defined-CyuCf775.js.map +0 -1
- package/dist/image-2qjHFSqv.js +0 -9
- package/dist/image-2qjHFSqv.js.map +0 -1
- package/dist/index-57er67ch.js +0 -131
- package/dist/index-57er67ch.js.map +0 -1
- package/dist/index-B-MpJOWW.js +0 -3987
- package/dist/index-B-MpJOWW.js.map +0 -1
- package/dist/index-B2f4UbAK.js +0 -257
- package/dist/index-B2f4UbAK.js.map +0 -1
- package/dist/index-B4xD2s69.js +0 -62
- package/dist/index-B4xD2s69.js.map +0 -1
- package/dist/index-BF4uePO9.js +0 -126
- package/dist/index-BF4uePO9.js.map +0 -1
- package/dist/index-BG3007yu.js +0 -542
- package/dist/index-BG3007yu.js.map +0 -1
- package/dist/index-BPqsyCu1.js +0 -249
- package/dist/index-BPqsyCu1.js.map +0 -1
- package/dist/index-BTFeMb7h.js +0 -2277
- package/dist/index-BTFeMb7h.js.map +0 -1
- package/dist/index-B_z_MPZ-.js +0 -180
- package/dist/index-B_z_MPZ-.js.map +0 -1
- package/dist/index-Biw_bFmP.js +0 -70
- package/dist/index-Biw_bFmP.js.map +0 -1
- package/dist/index-BnY1urGu.js +0 -441
- package/dist/index-BnY1urGu.js.map +0 -1
- package/dist/index-C1OrBJOZ.js +0 -218
- package/dist/index-C1OrBJOZ.js.map +0 -1
- package/dist/index-CHvzOG0E.js +0 -1372
- package/dist/index-CHvzOG0E.js.map +0 -1
- package/dist/index-CKaIBA_q.js +0 -153
- package/dist/index-CKaIBA_q.js.map +0 -1
- package/dist/index-CLefivQ6.js +0 -124
- package/dist/index-CLefivQ6.js.map +0 -1
- package/dist/index-COvWUE72.js +0 -716
- package/dist/index-COvWUE72.js.map +0 -1
- package/dist/index-CRhk6ovx.js +0 -198
- package/dist/index-CRhk6ovx.js.map +0 -1
- package/dist/index-CfTNvhZC.js +0 -967
- package/dist/index-CfTNvhZC.js.map +0 -1
- package/dist/index-CjCwufpz.js +0 -120
- package/dist/index-CjCwufpz.js.map +0 -1
- package/dist/index-Ck3zz_LE.js +0 -984
- package/dist/index-Ck3zz_LE.js.map +0 -1
- package/dist/index-CqVDx2Ua.js +0 -9350
- package/dist/index-CqVDx2Ua.js.map +0 -1
- package/dist/index-CrF2nCtM.js +0 -211
- package/dist/index-CrF2nCtM.js.map +0 -1
- package/dist/index-Crnbnlbl.js +0 -8825
- package/dist/index-Crnbnlbl.js.map +0 -1
- package/dist/index-D7bwcPcO.js +0 -147
- package/dist/index-D7bwcPcO.js.map +0 -1
- package/dist/index-DAmhDlFG.js +0 -985
- package/dist/index-DAmhDlFG.js.map +0 -1
- package/dist/index-DF9XlWjQ.js +0 -456
- package/dist/index-DF9XlWjQ.js.map +0 -1
- package/dist/index-DGtLnlsD.js +0 -521
- package/dist/index-DGtLnlsD.js.map +0 -1
- package/dist/index-DIDlQZ9c.js +0 -1582
- package/dist/index-DIDlQZ9c.js.map +0 -1
- package/dist/index-DJe9wj3q.js +0 -136
- package/dist/index-DJe9wj3q.js.map +0 -1
- package/dist/index-DPlE9Qgr.js +0 -73
- package/dist/index-DPlE9Qgr.js.map +0 -1
- package/dist/index-DVXtgl7V.js +0 -7481
- package/dist/index-DVXtgl7V.js.map +0 -1
- package/dist/index-DWLAu0nH.js +0 -110
- package/dist/index-DWLAu0nH.js.map +0 -1
- package/dist/index-DXCwyaz_.js +0 -147
- package/dist/index-DXCwyaz_.js.map +0 -1
- package/dist/index-D_NteNrS.js +0 -198
- package/dist/index-D_NteNrS.js.map +0 -1
- package/dist/index-Dg65-p7m.js +0 -7258
- package/dist/index-Dg65-p7m.js.map +0 -1
- package/dist/index-Du7PdWv1.js +0 -181
- package/dist/index-Du7PdWv1.js.map +0 -1
- package/dist/index-HOjNYM_k.js +0 -92
- package/dist/index-HOjNYM_k.js.map +0 -1
- package/dist/index-MwW0rp8T.js +0 -286
- package/dist/index-MwW0rp8T.js.map +0 -1
- package/dist/index-OCzLDbWt.js +0 -18322
- package/dist/index-OCzLDbWt.js.map +0 -1
- package/dist/index-Sf3UCmHB.js +0 -611
- package/dist/index-Sf3UCmHB.js.map +0 -1
- package/dist/index-Zt_Jj4gf.js +0 -520
- package/dist/index-Zt_Jj4gf.js.map +0 -1
- package/dist/index-kb6zqfNt.js +0 -1178
- package/dist/index-kb6zqfNt.js.map +0 -1
- package/dist/index-rYPftA0P.js +0 -52
- package/dist/index-rYPftA0P.js.map +0 -1
- package/dist/index-tdPUUHj0.js +0 -281
- package/dist/index-tdPUUHj0.js.map +0 -1
- package/dist/index-wVp4UjVg.js +0 -182
- package/dist/index-wVp4UjVg.js.map +0 -1
- package/dist/index-ywRnp0Bi.js +0 -109
- package/dist/index-ywRnp0Bi.js.map +0 -1
- package/dist/index.es-BrfaQK0n.js +0 -8391
- package/dist/index.es-BrfaQK0n.js.map +0 -1
- package/dist/info-BhM-vMtG.js +0 -8
- package/dist/info-BhM-vMtG.js.map +0 -1
- package/dist/info-circle-DwGnsKMj.js +0 -17
- package/dist/info-circle-DwGnsKMj.js.map +0 -1
- package/dist/jsxRuntime.module-BW0yCO8A.js +0 -14
- package/dist/jsxRuntime.module-BW0yCO8A.js.map +0 -1
- package/dist/lightbulb-BvGmXMuo.js +0 -8
- package/dist/lightbulb-BvGmXMuo.js.map +0 -1
- package/dist/localBatchGatewayRequest-CLL1gABv.js +0 -103
- package/dist/localBatchGatewayRequest-CLL1gABv.js.map +0 -1
- package/dist/mail-Cl70v1Dx.js +0 -13
- package/dist/mail-Cl70v1Dx.js.map +0 -1
- package/dist/metamask-sdk-BzQ933Ju.js +0 -16699
- package/dist/metamask-sdk-BzQ933Ju.js.map +0 -1
- package/dist/mobile-BCINjy0Y.js +0 -14
- package/dist/mobile-BCINjy0Y.js.map +0 -1
- package/dist/more-Cozw6-SQ.js +0 -16
- package/dist/more-Cozw6-SQ.js.map +0 -1
- package/dist/native-Dc_5StoC.js +0 -17
- package/dist/native-Dc_5StoC.js.map +0 -1
- package/dist/network-placeholder-o2Dz_YnK.js +0 -19
- package/dist/network-placeholder-o2Dz_YnK.js.map +0 -1
- package/dist/nftPlaceholder-Bjf9SAC-.js +0 -13
- package/dist/nftPlaceholder-Bjf9SAC-.js.map +0 -1
- package/dist/off-BsVJ8v6H.js +0 -13
- package/dist/off-BsVJ8v6H.js.map +0 -1
- package/dist/onramp-C4DqYEmw.js +0 -979
- package/dist/onramp-C4DqYEmw.js.map +0 -1
- package/dist/parseAbiParameters-DfJcIE_w.js +0 -757
- package/dist/parseAbiParameters-DfJcIE_w.js.map +0 -1
- package/dist/parseSignature-MJforcG6.js +0 -4690
- package/dist/parseSignature-MJforcG6.js.map +0 -1
- package/dist/pay-with-exchange-DC29BzBo.js +0 -603
- package/dist/pay-with-exchange-DC29BzBo.js.map +0 -1
- package/dist/play-store-DIOK4cBW.js +0 -37
- package/dist/play-store-DIOK4cBW.js.map +0 -1
- package/dist/plus-Cxls3O6G.js +0 -18
- package/dist/plus-Cxls3O6G.js.map +0 -1
- package/dist/property-8UcTqffH.js +0 -623
- package/dist/property-8UcTqffH.js.map +0 -1
- package/dist/qr-code-Cp6lpAcY.js +0 -11
- package/dist/qr-code-Cp6lpAcY.js.map +0 -1
- package/dist/receive-BLI57snb.js +0 -262
- package/dist/receive-BLI57snb.js.map +0 -1
- package/dist/recycle-horizontal-AEJ_nbSP.js +0 -14
- package/dist/recycle-horizontal-AEJ_nbSP.js.map +0 -1
- package/dist/ref-BobNUvS_.js +0 -43
- package/dist/ref-BobNUvS_.js.map +0 -1
- package/dist/refresh-7roUeD2M.js +0 -13
- package/dist/refresh-7roUeD2M.js.map +0 -1
- package/dist/reown-logo-xggoIKX2.js +0 -17
- package/dist/reown-logo-xggoIKX2.js.map +0 -1
- package/dist/search-DgzcpMUb.js +0 -13
- package/dist/search-DgzcpMUb.js.map +0 -1
- package/dist/secp256k1-D_j0Z4BY.js +0 -2031
- package/dist/secp256k1-D_j0Z4BY.js.map +0 -1
- package/dist/send-D7M2-Upc.js +0 -20
- package/dist/send-D7M2-Upc.js.map +0 -1
- package/dist/send-TAzhXOOa.js +0 -1365
- package/dist/send-TAzhXOOa.js.map +0 -1
- package/dist/socials-BXTq602s.js +0 -796
- package/dist/socials-BXTq602s.js.map +0 -1
- package/dist/swapHorizontal-2gzDDUNF.js +0 -13
- package/dist/swapHorizontal-2gzDDUNF.js.map +0 -1
- package/dist/swapHorizontalBold-C1cHwAjU.js +0 -13
- package/dist/swapHorizontalBold-C1cHwAjU.js.map +0 -1
- package/dist/swapHorizontalMedium-BQno5vep.js +0 -21
- package/dist/swapHorizontalMedium-BQno5vep.js.map +0 -1
- package/dist/swapHorizontalRoundedBold-CYmZDeQ5.js +0 -13
- package/dist/swapHorizontalRoundedBold-CYmZDeQ5.js.map +0 -1
- package/dist/swapVertical-BhRPysBs.js +0 -13
- package/dist/swapVertical-BhRPysBs.js.map +0 -1
- package/dist/swaps-DQ-uUZvX.js +0 -2121
- package/dist/swaps-DQ-uUZvX.js.map +0 -1
- package/dist/telegram-B-YOyhte.js +0 -21
- package/dist/telegram-B-YOyhte.js.map +0 -1
- package/dist/three-dots-8mr70UzU.js +0 -10
- package/dist/three-dots-8mr70UzU.js.map +0 -1
- package/dist/transactions-C4p83vMQ.js +0 -38
- package/dist/transactions-C4p83vMQ.js.map +0 -1
- package/dist/twitch-C2ccExfT.js +0 -23
- package/dist/twitch-C2ccExfT.js.map +0 -1
- package/dist/twitterIcon-IkT5wPxq.js +0 -11
- package/dist/twitterIcon-IkT5wPxq.js.map +0 -1
- package/dist/vanilla-CgG5xMJO.js +0 -448
- package/dist/vanilla-CgG5xMJO.js.map +0 -1
- package/dist/verify-BfilAaob.js +0 -13
- package/dist/verify-BfilAaob.js.map +0 -1
- package/dist/verify-filled-COkWKgPo.js +0 -13
- package/dist/verify-filled-COkWKgPo.js.map +0 -1
- package/dist/w3m-modal-9MzgEqm3.js +0 -1725
- package/dist/w3m-modal-9MzgEqm3.js.map +0 -1
- package/dist/w3m-modal-DBQU256b.js +0 -2008
- package/dist/w3m-modal-DBQU256b.js.map +0 -1
- package/dist/wallet-9D5svrZj.js +0 -13
- package/dist/wallet-9D5svrZj.js.map +0 -1
- package/dist/wallet-placeholder-CfLGKG93.js +0 -19
- package/dist/wallet-placeholder-CfLGKG93.js.map +0 -1
- package/dist/wallet-standard-CkMoUaGA.js +0 -523
- package/dist/wallet-standard-CkMoUaGA.js.map +0 -1
- package/dist/walletconnect-MtAz2u7z.js +0 -39
- package/dist/walletconnect-MtAz2u7z.js.map +0 -1
- package/dist/warning-circle-Cf2AJecu.js +0 -17
- package/dist/warning-circle-Cf2AJecu.js.map +0 -1
- package/dist/x-B0KhGb39.js +0 -17
- package/dist/x-B0KhGb39.js.map +0 -1
package/dist/index-CHvzOG0E.js
DELETED
|
@@ -1,1372 +0,0 @@
|
|
|
1
|
-
import { O as OptionsController, av as ParseUtil, a as CoreHelperUtil, C as ChainController, u as ConstantsUtil, aS as ProviderController, t as ConnectionController, aT as ContractUtil, aU as proxy, E as EventsController, S as SnackController, R as RouterController, a3 as ModalController, aV as subscribeKey, aW as subscribe, q as i, o as i$1, x, a5 as ThemeController, F as ConnectorController, a4 as AssetUtil } from "./appkit-ppmICUF1.js";
|
|
2
|
-
import { r } from "./class-map-B814K2ej.js";
|
|
3
|
-
import { o } from "./if-defined-CyuCf775.js";
|
|
4
|
-
import { c as customElement } from "./index-kb6zqfNt.js";
|
|
5
|
-
import "./index-C1OrBJOZ.js";
|
|
6
|
-
import "./index-Du7PdWv1.js";
|
|
7
|
-
import "./index-CLefivQ6.js";
|
|
8
|
-
import "./index-D7bwcPcO.js";
|
|
9
|
-
import "./index-DJe9wj3q.js";
|
|
10
|
-
import "./index-HOjNYM_k.js";
|
|
11
|
-
import "./index-DXCwyaz_.js";
|
|
12
|
-
import "./index-rYPftA0P.js";
|
|
13
|
-
import "./index-CKaIBA_q.js";
|
|
14
|
-
import "./index-DPlE9Qgr.js";
|
|
15
|
-
const AppKitPayErrorCodes = {
|
|
16
|
-
INVALID_PAYMENT_CONFIG: "INVALID_PAYMENT_CONFIG",
|
|
17
|
-
INVALID_RECIPIENT: "INVALID_RECIPIENT",
|
|
18
|
-
INVALID_ASSET: "INVALID_ASSET",
|
|
19
|
-
INVALID_AMOUNT: "INVALID_AMOUNT",
|
|
20
|
-
UNKNOWN_ERROR: "UNKNOWN_ERROR",
|
|
21
|
-
UNABLE_TO_INITIATE_PAYMENT: "UNABLE_TO_INITIATE_PAYMENT",
|
|
22
|
-
INVALID_CHAIN_NAMESPACE: "INVALID_CHAIN_NAMESPACE",
|
|
23
|
-
GENERIC_PAYMENT_ERROR: "GENERIC_PAYMENT_ERROR",
|
|
24
|
-
UNABLE_TO_GET_EXCHANGES: "UNABLE_TO_GET_EXCHANGES",
|
|
25
|
-
ASSET_NOT_SUPPORTED: "ASSET_NOT_SUPPORTED",
|
|
26
|
-
UNABLE_TO_GET_PAY_URL: "UNABLE_TO_GET_PAY_URL",
|
|
27
|
-
UNABLE_TO_GET_BUY_STATUS: "UNABLE_TO_GET_BUY_STATUS"
|
|
28
|
-
};
|
|
29
|
-
const AppKitPayErrorMessages = {
|
|
30
|
-
[AppKitPayErrorCodes.INVALID_PAYMENT_CONFIG]: "Invalid payment configuration",
|
|
31
|
-
[AppKitPayErrorCodes.INVALID_RECIPIENT]: "Invalid recipient address",
|
|
32
|
-
[AppKitPayErrorCodes.INVALID_ASSET]: "Invalid asset specified",
|
|
33
|
-
[AppKitPayErrorCodes.INVALID_AMOUNT]: "Invalid payment amount",
|
|
34
|
-
[AppKitPayErrorCodes.UNKNOWN_ERROR]: "Unknown payment error occurred",
|
|
35
|
-
[AppKitPayErrorCodes.UNABLE_TO_INITIATE_PAYMENT]: "Unable to initiate payment",
|
|
36
|
-
[AppKitPayErrorCodes.INVALID_CHAIN_NAMESPACE]: "Invalid chain namespace",
|
|
37
|
-
[AppKitPayErrorCodes.GENERIC_PAYMENT_ERROR]: "Unable to process payment",
|
|
38
|
-
[AppKitPayErrorCodes.UNABLE_TO_GET_EXCHANGES]: "Unable to get exchanges",
|
|
39
|
-
[AppKitPayErrorCodes.ASSET_NOT_SUPPORTED]: "Asset not supported by the selected exchange",
|
|
40
|
-
[AppKitPayErrorCodes.UNABLE_TO_GET_PAY_URL]: "Unable to get payment URL",
|
|
41
|
-
[AppKitPayErrorCodes.UNABLE_TO_GET_BUY_STATUS]: "Unable to get buy status"
|
|
42
|
-
};
|
|
43
|
-
class AppKitPayError extends Error {
|
|
44
|
-
get message() {
|
|
45
|
-
return AppKitPayErrorMessages[this.code];
|
|
46
|
-
}
|
|
47
|
-
constructor(code, details) {
|
|
48
|
-
super(AppKitPayErrorMessages[code]);
|
|
49
|
-
this.name = "AppKitPayError";
|
|
50
|
-
this.code = code;
|
|
51
|
-
this.details = details;
|
|
52
|
-
if (Error.captureStackTrace) {
|
|
53
|
-
Error.captureStackTrace(this, AppKitPayError);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
const API_URL = "https://rpc.walletconnect.org/v1/json-rpc";
|
|
58
|
-
class JsonRpcError extends Error {
|
|
59
|
-
}
|
|
60
|
-
function getApiUrl() {
|
|
61
|
-
const projectId = OptionsController.getSnapshot().projectId;
|
|
62
|
-
return `${API_URL}?projectId=${projectId}`;
|
|
63
|
-
}
|
|
64
|
-
async function sendRequest(method, params) {
|
|
65
|
-
const url = getApiUrl();
|
|
66
|
-
const { sdkType: st, sdkVersion: sv, projectId } = OptionsController.getSnapshot();
|
|
67
|
-
const requestBody = {
|
|
68
|
-
jsonrpc: "2.0",
|
|
69
|
-
id: 1,
|
|
70
|
-
method,
|
|
71
|
-
params: {
|
|
72
|
-
...params || {},
|
|
73
|
-
st,
|
|
74
|
-
sv,
|
|
75
|
-
projectId
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
const response = await fetch(url, {
|
|
79
|
-
method: "POST",
|
|
80
|
-
body: JSON.stringify(requestBody),
|
|
81
|
-
headers: { "Content-Type": "application/json" }
|
|
82
|
-
});
|
|
83
|
-
const json = await response.json();
|
|
84
|
-
if (json.error) {
|
|
85
|
-
throw new JsonRpcError(json.error.message);
|
|
86
|
-
}
|
|
87
|
-
return json;
|
|
88
|
-
}
|
|
89
|
-
async function getExchanges$1(params) {
|
|
90
|
-
const response = await sendRequest("reown_getExchanges", params);
|
|
91
|
-
return response.result;
|
|
92
|
-
}
|
|
93
|
-
async function getPayUrl(params) {
|
|
94
|
-
const response = await sendRequest("reown_getExchangePayUrl", params);
|
|
95
|
-
return response.result;
|
|
96
|
-
}
|
|
97
|
-
async function getBuyStatus(params) {
|
|
98
|
-
const response = await sendRequest("reown_getExchangeBuyStatus", params);
|
|
99
|
-
return response.result;
|
|
100
|
-
}
|
|
101
|
-
const SUPPORT_PAY_WITH_WALLET_CHAIN_NAMESPACES = ["eip155", "solana"];
|
|
102
|
-
const CHAIN_ASSET_INFO_MAP = {
|
|
103
|
-
eip155: {
|
|
104
|
-
native: { assetNamespace: "slip44", assetReference: "60" },
|
|
105
|
-
defaultTokenNamespace: "erc20"
|
|
106
|
-
},
|
|
107
|
-
solana: {
|
|
108
|
-
native: { assetNamespace: "slip44", assetReference: "501" },
|
|
109
|
-
defaultTokenNamespace: "token"
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
function formatCaip19Asset(caipNetworkId, asset) {
|
|
113
|
-
const { chainNamespace, chainId } = ParseUtil.parseCaipNetworkId(caipNetworkId);
|
|
114
|
-
const chainInfo = CHAIN_ASSET_INFO_MAP[chainNamespace];
|
|
115
|
-
if (!chainInfo) {
|
|
116
|
-
throw new Error(`Unsupported chain namespace for CAIP-19 formatting: ${chainNamespace}`);
|
|
117
|
-
}
|
|
118
|
-
let assetNamespace = chainInfo.native.assetNamespace;
|
|
119
|
-
let assetReference = chainInfo.native.assetReference;
|
|
120
|
-
if (asset !== "native") {
|
|
121
|
-
assetNamespace = chainInfo.defaultTokenNamespace;
|
|
122
|
-
assetReference = asset;
|
|
123
|
-
}
|
|
124
|
-
const networkPart = `${chainNamespace}:${chainId}`;
|
|
125
|
-
return `${networkPart}/${assetNamespace}:${assetReference}`;
|
|
126
|
-
}
|
|
127
|
-
function isPayWithWalletSupported(networkId) {
|
|
128
|
-
const { chainNamespace } = ParseUtil.parseCaipNetworkId(networkId);
|
|
129
|
-
return SUPPORT_PAY_WITH_WALLET_CHAIN_NAMESPACES.includes(chainNamespace);
|
|
130
|
-
}
|
|
131
|
-
async function ensureCorrectNetwork(options) {
|
|
132
|
-
const { paymentAssetNetwork, activeCaipNetwork, approvedCaipNetworkIds, requestedCaipNetworks } = options;
|
|
133
|
-
const sortedNetworks = CoreHelperUtil.sortRequestedNetworks(approvedCaipNetworkIds, requestedCaipNetworks);
|
|
134
|
-
const assetCaipNetwork = sortedNetworks.find((network) => network.caipNetworkId === paymentAssetNetwork);
|
|
135
|
-
if (!assetCaipNetwork) {
|
|
136
|
-
throw new AppKitPayError(AppKitPayErrorCodes.INVALID_PAYMENT_CONFIG);
|
|
137
|
-
}
|
|
138
|
-
if (assetCaipNetwork.caipNetworkId === activeCaipNetwork.caipNetworkId) {
|
|
139
|
-
return;
|
|
140
|
-
}
|
|
141
|
-
const isSupportingAllNetworks = ChainController.getNetworkProp("supportsAllNetworks", assetCaipNetwork.chainNamespace);
|
|
142
|
-
const isSwitchAllowed = (approvedCaipNetworkIds == null ? void 0 : approvedCaipNetworkIds.includes(assetCaipNetwork.caipNetworkId)) || isSupportingAllNetworks;
|
|
143
|
-
if (!isSwitchAllowed) {
|
|
144
|
-
throw new AppKitPayError(AppKitPayErrorCodes.INVALID_PAYMENT_CONFIG);
|
|
145
|
-
}
|
|
146
|
-
try {
|
|
147
|
-
await ChainController.switchActiveNetwork(assetCaipNetwork);
|
|
148
|
-
} catch (error) {
|
|
149
|
-
throw new AppKitPayError(AppKitPayErrorCodes.GENERIC_PAYMENT_ERROR, error);
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
async function processEvmNativePayment(paymentAsset, chainNamespace, params) {
|
|
153
|
-
var _a;
|
|
154
|
-
if (chainNamespace !== ConstantsUtil.CHAIN.EVM) {
|
|
155
|
-
throw new AppKitPayError(AppKitPayErrorCodes.INVALID_CHAIN_NAMESPACE);
|
|
156
|
-
}
|
|
157
|
-
if (!params.fromAddress) {
|
|
158
|
-
throw new AppKitPayError(AppKitPayErrorCodes.INVALID_PAYMENT_CONFIG, "fromAddress is required for native EVM payments.");
|
|
159
|
-
}
|
|
160
|
-
const amountValue = typeof params.amount === "string" ? parseFloat(params.amount) : params.amount;
|
|
161
|
-
if (isNaN(amountValue)) {
|
|
162
|
-
throw new AppKitPayError(AppKitPayErrorCodes.INVALID_PAYMENT_CONFIG);
|
|
163
|
-
}
|
|
164
|
-
const decimals = ((_a = paymentAsset.metadata) == null ? void 0 : _a.decimals) ?? 18;
|
|
165
|
-
const amountBigInt = ConnectionController.parseUnits(amountValue.toString(), decimals);
|
|
166
|
-
if (typeof amountBigInt !== "bigint") {
|
|
167
|
-
throw new AppKitPayError(AppKitPayErrorCodes.GENERIC_PAYMENT_ERROR);
|
|
168
|
-
}
|
|
169
|
-
const txResponse = await ConnectionController.sendTransaction({
|
|
170
|
-
chainNamespace,
|
|
171
|
-
to: params.recipient,
|
|
172
|
-
address: params.fromAddress,
|
|
173
|
-
value: amountBigInt,
|
|
174
|
-
data: "0x"
|
|
175
|
-
});
|
|
176
|
-
return txResponse ?? void 0;
|
|
177
|
-
}
|
|
178
|
-
async function processEvmErc20Payment(paymentAsset, params) {
|
|
179
|
-
if (!params.fromAddress) {
|
|
180
|
-
throw new AppKitPayError(AppKitPayErrorCodes.INVALID_PAYMENT_CONFIG, "fromAddress is required for ERC20 EVM payments.");
|
|
181
|
-
}
|
|
182
|
-
const tokenAddress = paymentAsset.asset;
|
|
183
|
-
const recipientAddress = params.recipient;
|
|
184
|
-
const decimals = Number(paymentAsset.metadata.decimals);
|
|
185
|
-
const amountBigInt = ConnectionController.parseUnits(params.amount.toString(), decimals);
|
|
186
|
-
if (amountBigInt === void 0) {
|
|
187
|
-
throw new AppKitPayError(AppKitPayErrorCodes.GENERIC_PAYMENT_ERROR);
|
|
188
|
-
}
|
|
189
|
-
const txResponse = await ConnectionController.writeContract({
|
|
190
|
-
fromAddress: params.fromAddress,
|
|
191
|
-
tokenAddress,
|
|
192
|
-
args: [recipientAddress, amountBigInt],
|
|
193
|
-
method: "transfer",
|
|
194
|
-
abi: ContractUtil.getERC20Abi(tokenAddress),
|
|
195
|
-
chainNamespace: ConstantsUtil.CHAIN.EVM
|
|
196
|
-
});
|
|
197
|
-
return txResponse ?? void 0;
|
|
198
|
-
}
|
|
199
|
-
async function processSolanaPayment(chainNamespace, params) {
|
|
200
|
-
if (chainNamespace !== ConstantsUtil.CHAIN.SOLANA) {
|
|
201
|
-
throw new AppKitPayError(AppKitPayErrorCodes.INVALID_CHAIN_NAMESPACE);
|
|
202
|
-
}
|
|
203
|
-
if (!params.fromAddress) {
|
|
204
|
-
throw new AppKitPayError(AppKitPayErrorCodes.INVALID_PAYMENT_CONFIG, "fromAddress is required for Solana payments.");
|
|
205
|
-
}
|
|
206
|
-
const amountValue = typeof params.amount === "string" ? parseFloat(params.amount) : params.amount;
|
|
207
|
-
if (isNaN(amountValue) || amountValue <= 0) {
|
|
208
|
-
throw new AppKitPayError(AppKitPayErrorCodes.INVALID_PAYMENT_CONFIG, "Invalid payment amount.");
|
|
209
|
-
}
|
|
210
|
-
try {
|
|
211
|
-
const provider = ProviderController.getProvider(chainNamespace);
|
|
212
|
-
if (!provider) {
|
|
213
|
-
throw new AppKitPayError(AppKitPayErrorCodes.GENERIC_PAYMENT_ERROR, "No Solana provider available.");
|
|
214
|
-
}
|
|
215
|
-
const txResponse = await ConnectionController.sendTransaction({
|
|
216
|
-
chainNamespace: ConstantsUtil.CHAIN.SOLANA,
|
|
217
|
-
to: params.recipient,
|
|
218
|
-
value: amountValue,
|
|
219
|
-
tokenMint: params.tokenMint
|
|
220
|
-
});
|
|
221
|
-
if (!txResponse) {
|
|
222
|
-
throw new AppKitPayError(AppKitPayErrorCodes.GENERIC_PAYMENT_ERROR, "Transaction failed.");
|
|
223
|
-
}
|
|
224
|
-
return txResponse;
|
|
225
|
-
} catch (error) {
|
|
226
|
-
if (error instanceof AppKitPayError) {
|
|
227
|
-
throw error;
|
|
228
|
-
}
|
|
229
|
-
throw new AppKitPayError(AppKitPayErrorCodes.GENERIC_PAYMENT_ERROR, `Solana payment failed: ${error}`);
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
const DEFAULT_PAGE = 0;
|
|
233
|
-
const DEFAULT_PAYMENT_ID = "unknown";
|
|
234
|
-
const state = proxy({
|
|
235
|
-
paymentAsset: {
|
|
236
|
-
network: "eip155:1",
|
|
237
|
-
asset: "0x0",
|
|
238
|
-
metadata: {
|
|
239
|
-
name: "0x0",
|
|
240
|
-
symbol: "0x0",
|
|
241
|
-
decimals: 0
|
|
242
|
-
}
|
|
243
|
-
},
|
|
244
|
-
recipient: "0x0",
|
|
245
|
-
amount: 0,
|
|
246
|
-
isConfigured: false,
|
|
247
|
-
error: null,
|
|
248
|
-
isPaymentInProgress: false,
|
|
249
|
-
exchanges: [],
|
|
250
|
-
isLoading: false,
|
|
251
|
-
openInNewTab: true,
|
|
252
|
-
redirectUrl: void 0,
|
|
253
|
-
payWithExchange: void 0,
|
|
254
|
-
currentPayment: void 0,
|
|
255
|
-
analyticsSet: false,
|
|
256
|
-
paymentId: void 0
|
|
257
|
-
});
|
|
258
|
-
const PayController = {
|
|
259
|
-
state,
|
|
260
|
-
subscribe(callback) {
|
|
261
|
-
return subscribe(state, () => callback(state));
|
|
262
|
-
},
|
|
263
|
-
subscribeKey(key, callback) {
|
|
264
|
-
return subscribeKey(state, key, callback);
|
|
265
|
-
},
|
|
266
|
-
async handleOpenPay(options) {
|
|
267
|
-
this.resetState();
|
|
268
|
-
this.setPaymentConfig(options);
|
|
269
|
-
this.subscribeEvents();
|
|
270
|
-
this.initializeAnalytics();
|
|
271
|
-
state.isConfigured = true;
|
|
272
|
-
EventsController.sendEvent({
|
|
273
|
-
type: "track",
|
|
274
|
-
event: "PAY_MODAL_OPEN",
|
|
275
|
-
properties: {
|
|
276
|
-
exchanges: state.exchanges,
|
|
277
|
-
configuration: {
|
|
278
|
-
network: state.paymentAsset.network,
|
|
279
|
-
asset: state.paymentAsset.asset,
|
|
280
|
-
recipient: state.recipient,
|
|
281
|
-
amount: state.amount
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
});
|
|
285
|
-
await ModalController.open({
|
|
286
|
-
view: "Pay"
|
|
287
|
-
});
|
|
288
|
-
},
|
|
289
|
-
resetState() {
|
|
290
|
-
state.paymentAsset = {
|
|
291
|
-
network: "eip155:1",
|
|
292
|
-
asset: "0x0",
|
|
293
|
-
metadata: { name: "0x0", symbol: "0x0", decimals: 0 }
|
|
294
|
-
};
|
|
295
|
-
state.recipient = "0x0";
|
|
296
|
-
state.amount = 0;
|
|
297
|
-
state.isConfigured = false;
|
|
298
|
-
state.error = null;
|
|
299
|
-
state.isPaymentInProgress = false;
|
|
300
|
-
state.isLoading = false;
|
|
301
|
-
state.currentPayment = void 0;
|
|
302
|
-
},
|
|
303
|
-
setPaymentConfig(config) {
|
|
304
|
-
if (!config.paymentAsset) {
|
|
305
|
-
throw new AppKitPayError(AppKitPayErrorCodes.INVALID_PAYMENT_CONFIG);
|
|
306
|
-
}
|
|
307
|
-
try {
|
|
308
|
-
state.paymentAsset = config.paymentAsset;
|
|
309
|
-
state.recipient = config.recipient;
|
|
310
|
-
state.amount = config.amount;
|
|
311
|
-
state.openInNewTab = config.openInNewTab ?? true;
|
|
312
|
-
state.redirectUrl = config.redirectUrl;
|
|
313
|
-
state.payWithExchange = config.payWithExchange;
|
|
314
|
-
state.error = null;
|
|
315
|
-
} catch (error) {
|
|
316
|
-
throw new AppKitPayError(AppKitPayErrorCodes.INVALID_PAYMENT_CONFIG, error.message);
|
|
317
|
-
}
|
|
318
|
-
},
|
|
319
|
-
getPaymentAsset() {
|
|
320
|
-
return state.paymentAsset;
|
|
321
|
-
},
|
|
322
|
-
getExchanges() {
|
|
323
|
-
return state.exchanges;
|
|
324
|
-
},
|
|
325
|
-
async fetchExchanges() {
|
|
326
|
-
try {
|
|
327
|
-
state.isLoading = true;
|
|
328
|
-
const response = await getExchanges$1({
|
|
329
|
-
page: DEFAULT_PAGE,
|
|
330
|
-
asset: formatCaip19Asset(state.paymentAsset.network, state.paymentAsset.asset),
|
|
331
|
-
amount: state.amount.toString()
|
|
332
|
-
});
|
|
333
|
-
state.exchanges = response.exchanges.slice(0, 2);
|
|
334
|
-
} catch (error) {
|
|
335
|
-
SnackController.showError(AppKitPayErrorMessages.UNABLE_TO_GET_EXCHANGES);
|
|
336
|
-
throw new AppKitPayError(AppKitPayErrorCodes.UNABLE_TO_GET_EXCHANGES);
|
|
337
|
-
} finally {
|
|
338
|
-
state.isLoading = false;
|
|
339
|
-
}
|
|
340
|
-
},
|
|
341
|
-
async getAvailableExchanges(params) {
|
|
342
|
-
var _a;
|
|
343
|
-
try {
|
|
344
|
-
const asset = (params == null ? void 0 : params.asset) && (params == null ? void 0 : params.network) ? formatCaip19Asset(params.network, params.asset) : void 0;
|
|
345
|
-
const response = await getExchanges$1({
|
|
346
|
-
page: (params == null ? void 0 : params.page) ?? DEFAULT_PAGE,
|
|
347
|
-
asset,
|
|
348
|
-
amount: (_a = params == null ? void 0 : params.amount) == null ? void 0 : _a.toString()
|
|
349
|
-
});
|
|
350
|
-
return response;
|
|
351
|
-
} catch (error) {
|
|
352
|
-
throw new AppKitPayError(AppKitPayErrorCodes.UNABLE_TO_GET_EXCHANGES);
|
|
353
|
-
}
|
|
354
|
-
},
|
|
355
|
-
async getPayUrl(exchangeId, params, headless = false) {
|
|
356
|
-
try {
|
|
357
|
-
const numericAmount = Number(params.amount);
|
|
358
|
-
const response = await getPayUrl({
|
|
359
|
-
exchangeId,
|
|
360
|
-
asset: formatCaip19Asset(params.network, params.asset),
|
|
361
|
-
amount: numericAmount.toString(),
|
|
362
|
-
recipient: `${params.network}:${params.recipient}`
|
|
363
|
-
});
|
|
364
|
-
EventsController.sendEvent({
|
|
365
|
-
type: "track",
|
|
366
|
-
event: "PAY_EXCHANGE_SELECTED",
|
|
367
|
-
properties: {
|
|
368
|
-
source: "pay",
|
|
369
|
-
exchange: {
|
|
370
|
-
id: exchangeId
|
|
371
|
-
},
|
|
372
|
-
configuration: {
|
|
373
|
-
network: params.network,
|
|
374
|
-
asset: params.asset,
|
|
375
|
-
recipient: params.recipient,
|
|
376
|
-
amount: numericAmount
|
|
377
|
-
},
|
|
378
|
-
currentPayment: {
|
|
379
|
-
type: "exchange",
|
|
380
|
-
exchangeId
|
|
381
|
-
},
|
|
382
|
-
headless
|
|
383
|
-
}
|
|
384
|
-
});
|
|
385
|
-
if (headless) {
|
|
386
|
-
this.initiatePayment();
|
|
387
|
-
EventsController.sendEvent({
|
|
388
|
-
type: "track",
|
|
389
|
-
event: "PAY_INITIATED",
|
|
390
|
-
properties: {
|
|
391
|
-
source: "pay",
|
|
392
|
-
paymentId: state.paymentId || DEFAULT_PAYMENT_ID,
|
|
393
|
-
configuration: {
|
|
394
|
-
network: params.network,
|
|
395
|
-
asset: params.asset,
|
|
396
|
-
recipient: params.recipient,
|
|
397
|
-
amount: numericAmount
|
|
398
|
-
},
|
|
399
|
-
currentPayment: {
|
|
400
|
-
type: "exchange",
|
|
401
|
-
exchangeId
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
});
|
|
405
|
-
}
|
|
406
|
-
return response;
|
|
407
|
-
} catch (error) {
|
|
408
|
-
if (error instanceof Error && error.message.includes("is not supported")) {
|
|
409
|
-
throw new AppKitPayError(AppKitPayErrorCodes.ASSET_NOT_SUPPORTED);
|
|
410
|
-
}
|
|
411
|
-
throw new Error(error.message);
|
|
412
|
-
}
|
|
413
|
-
},
|
|
414
|
-
async openPayUrl(openParams, params, headless = false) {
|
|
415
|
-
try {
|
|
416
|
-
const payUrl = await this.getPayUrl(openParams.exchangeId, params, headless);
|
|
417
|
-
if (!payUrl) {
|
|
418
|
-
throw new AppKitPayError(AppKitPayErrorCodes.UNABLE_TO_GET_PAY_URL);
|
|
419
|
-
}
|
|
420
|
-
const shouldOpenInNewTab = openParams.openInNewTab ?? true;
|
|
421
|
-
const target = shouldOpenInNewTab ? "_blank" : "_self";
|
|
422
|
-
CoreHelperUtil.openHref(payUrl.url, target);
|
|
423
|
-
return payUrl;
|
|
424
|
-
} catch (error) {
|
|
425
|
-
if (error instanceof AppKitPayError) {
|
|
426
|
-
state.error = error.message;
|
|
427
|
-
} else {
|
|
428
|
-
state.error = AppKitPayErrorMessages.GENERIC_PAYMENT_ERROR;
|
|
429
|
-
}
|
|
430
|
-
throw new AppKitPayError(AppKitPayErrorCodes.UNABLE_TO_GET_PAY_URL);
|
|
431
|
-
}
|
|
432
|
-
},
|
|
433
|
-
subscribeEvents() {
|
|
434
|
-
if (state.isConfigured) {
|
|
435
|
-
return;
|
|
436
|
-
}
|
|
437
|
-
ConnectionController.subscribeKey("connections", (connections) => {
|
|
438
|
-
if (connections.size > 0) {
|
|
439
|
-
this.handlePayment();
|
|
440
|
-
}
|
|
441
|
-
});
|
|
442
|
-
ChainController.subscribeChainProp("accountState", (accountState) => {
|
|
443
|
-
const hasWcConnection = ConnectionController.hasAnyConnection(ConstantsUtil.CONNECTOR_ID.WALLET_CONNECT);
|
|
444
|
-
if (accountState == null ? void 0 : accountState.caipAddress) {
|
|
445
|
-
if (hasWcConnection) {
|
|
446
|
-
setTimeout(() => {
|
|
447
|
-
this.handlePayment();
|
|
448
|
-
}, 100);
|
|
449
|
-
} else {
|
|
450
|
-
this.handlePayment();
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
});
|
|
454
|
-
},
|
|
455
|
-
async handlePayment() {
|
|
456
|
-
state.currentPayment = {
|
|
457
|
-
type: "wallet",
|
|
458
|
-
status: "IN_PROGRESS"
|
|
459
|
-
};
|
|
460
|
-
const caipAddress = ChainController.getActiveCaipAddress();
|
|
461
|
-
if (!caipAddress) {
|
|
462
|
-
return;
|
|
463
|
-
}
|
|
464
|
-
const { chainId, address } = ParseUtil.parseCaipAddress(caipAddress);
|
|
465
|
-
const chainNamespace = ChainController.state.activeChain;
|
|
466
|
-
if (!address || !chainId || !chainNamespace) {
|
|
467
|
-
return;
|
|
468
|
-
}
|
|
469
|
-
const provider = ProviderController.getProvider(chainNamespace);
|
|
470
|
-
if (!provider) {
|
|
471
|
-
return;
|
|
472
|
-
}
|
|
473
|
-
const caipNetwork = ChainController.state.activeCaipNetwork;
|
|
474
|
-
if (!caipNetwork) {
|
|
475
|
-
return;
|
|
476
|
-
}
|
|
477
|
-
if (state.isPaymentInProgress) {
|
|
478
|
-
return;
|
|
479
|
-
}
|
|
480
|
-
try {
|
|
481
|
-
this.initiatePayment();
|
|
482
|
-
const requestedCaipNetworks = ChainController.getAllRequestedCaipNetworks();
|
|
483
|
-
const approvedCaipNetworkIds = ChainController.getAllApprovedCaipNetworkIds();
|
|
484
|
-
await ensureCorrectNetwork({
|
|
485
|
-
paymentAssetNetwork: state.paymentAsset.network,
|
|
486
|
-
activeCaipNetwork: caipNetwork,
|
|
487
|
-
approvedCaipNetworkIds,
|
|
488
|
-
requestedCaipNetworks
|
|
489
|
-
});
|
|
490
|
-
await ModalController.open({
|
|
491
|
-
view: "PayLoading"
|
|
492
|
-
});
|
|
493
|
-
switch (chainNamespace) {
|
|
494
|
-
case ConstantsUtil.CHAIN.EVM:
|
|
495
|
-
if (state.paymentAsset.asset === "native") {
|
|
496
|
-
state.currentPayment.result = await processEvmNativePayment(state.paymentAsset, chainNamespace, {
|
|
497
|
-
recipient: state.recipient,
|
|
498
|
-
amount: state.amount,
|
|
499
|
-
fromAddress: address
|
|
500
|
-
});
|
|
501
|
-
}
|
|
502
|
-
if (state.paymentAsset.asset.startsWith("0x")) {
|
|
503
|
-
state.currentPayment.result = await processEvmErc20Payment(state.paymentAsset, {
|
|
504
|
-
recipient: state.recipient,
|
|
505
|
-
amount: state.amount,
|
|
506
|
-
fromAddress: address
|
|
507
|
-
});
|
|
508
|
-
}
|
|
509
|
-
state.currentPayment.status = "SUCCESS";
|
|
510
|
-
break;
|
|
511
|
-
case ConstantsUtil.CHAIN.SOLANA:
|
|
512
|
-
state.currentPayment.result = await processSolanaPayment(chainNamespace, {
|
|
513
|
-
recipient: state.recipient,
|
|
514
|
-
amount: state.amount,
|
|
515
|
-
fromAddress: address,
|
|
516
|
-
tokenMint: state.paymentAsset.asset === "native" ? void 0 : state.paymentAsset.asset
|
|
517
|
-
});
|
|
518
|
-
state.currentPayment.status = "SUCCESS";
|
|
519
|
-
break;
|
|
520
|
-
default:
|
|
521
|
-
throw new AppKitPayError(AppKitPayErrorCodes.INVALID_CHAIN_NAMESPACE);
|
|
522
|
-
}
|
|
523
|
-
} catch (error) {
|
|
524
|
-
if (error instanceof AppKitPayError) {
|
|
525
|
-
state.error = error.message;
|
|
526
|
-
} else {
|
|
527
|
-
state.error = AppKitPayErrorMessages.GENERIC_PAYMENT_ERROR;
|
|
528
|
-
}
|
|
529
|
-
state.currentPayment.status = "FAILED";
|
|
530
|
-
SnackController.showError(state.error);
|
|
531
|
-
} finally {
|
|
532
|
-
state.isPaymentInProgress = false;
|
|
533
|
-
}
|
|
534
|
-
},
|
|
535
|
-
getExchangeById(exchangeId) {
|
|
536
|
-
return state.exchanges.find((exchange) => exchange.id === exchangeId);
|
|
537
|
-
},
|
|
538
|
-
validatePayConfig(config) {
|
|
539
|
-
const { paymentAsset, recipient, amount } = config;
|
|
540
|
-
if (!paymentAsset) {
|
|
541
|
-
throw new AppKitPayError(AppKitPayErrorCodes.INVALID_PAYMENT_CONFIG);
|
|
542
|
-
}
|
|
543
|
-
if (!recipient) {
|
|
544
|
-
throw new AppKitPayError(AppKitPayErrorCodes.INVALID_RECIPIENT);
|
|
545
|
-
}
|
|
546
|
-
if (!paymentAsset.asset) {
|
|
547
|
-
throw new AppKitPayError(AppKitPayErrorCodes.INVALID_ASSET);
|
|
548
|
-
}
|
|
549
|
-
if (amount === void 0 || amount === null || amount <= 0) {
|
|
550
|
-
throw new AppKitPayError(AppKitPayErrorCodes.INVALID_AMOUNT);
|
|
551
|
-
}
|
|
552
|
-
},
|
|
553
|
-
handlePayWithWallet() {
|
|
554
|
-
const caipAddress = ChainController.getActiveCaipAddress();
|
|
555
|
-
if (!caipAddress) {
|
|
556
|
-
RouterController.push("Connect");
|
|
557
|
-
return;
|
|
558
|
-
}
|
|
559
|
-
const { chainId, address } = ParseUtil.parseCaipAddress(caipAddress);
|
|
560
|
-
const chainNamespace = ChainController.state.activeChain;
|
|
561
|
-
if (!address || !chainId || !chainNamespace) {
|
|
562
|
-
RouterController.push("Connect");
|
|
563
|
-
return;
|
|
564
|
-
}
|
|
565
|
-
this.handlePayment();
|
|
566
|
-
},
|
|
567
|
-
async handlePayWithExchange(exchangeId) {
|
|
568
|
-
try {
|
|
569
|
-
state.currentPayment = {
|
|
570
|
-
type: "exchange",
|
|
571
|
-
exchangeId
|
|
572
|
-
};
|
|
573
|
-
const { network, asset } = state.paymentAsset;
|
|
574
|
-
const payUrlParams = {
|
|
575
|
-
network,
|
|
576
|
-
asset,
|
|
577
|
-
amount: state.amount,
|
|
578
|
-
recipient: state.recipient
|
|
579
|
-
};
|
|
580
|
-
const payUrl = await this.getPayUrl(exchangeId, payUrlParams);
|
|
581
|
-
if (!payUrl) {
|
|
582
|
-
throw new AppKitPayError(AppKitPayErrorCodes.UNABLE_TO_INITIATE_PAYMENT);
|
|
583
|
-
}
|
|
584
|
-
state.currentPayment.sessionId = payUrl.sessionId;
|
|
585
|
-
state.currentPayment.status = "IN_PROGRESS";
|
|
586
|
-
state.currentPayment.exchangeId = exchangeId;
|
|
587
|
-
this.initiatePayment();
|
|
588
|
-
return {
|
|
589
|
-
url: payUrl.url,
|
|
590
|
-
openInNewTab: state.openInNewTab
|
|
591
|
-
};
|
|
592
|
-
} catch (error) {
|
|
593
|
-
if (error instanceof AppKitPayError) {
|
|
594
|
-
state.error = error.message;
|
|
595
|
-
} else {
|
|
596
|
-
state.error = AppKitPayErrorMessages.GENERIC_PAYMENT_ERROR;
|
|
597
|
-
}
|
|
598
|
-
state.isPaymentInProgress = false;
|
|
599
|
-
SnackController.showError(state.error);
|
|
600
|
-
return null;
|
|
601
|
-
}
|
|
602
|
-
},
|
|
603
|
-
async getBuyStatus(exchangeId, sessionId) {
|
|
604
|
-
var _a, _b;
|
|
605
|
-
try {
|
|
606
|
-
const status = await getBuyStatus({ sessionId, exchangeId });
|
|
607
|
-
if (status.status === "SUCCESS" || status.status === "FAILED") {
|
|
608
|
-
EventsController.sendEvent({
|
|
609
|
-
type: "track",
|
|
610
|
-
event: status.status === "SUCCESS" ? "PAY_SUCCESS" : "PAY_ERROR",
|
|
611
|
-
properties: {
|
|
612
|
-
message: status.status === "FAILED" ? CoreHelperUtil.parseError(state.error) : void 0,
|
|
613
|
-
source: "pay",
|
|
614
|
-
paymentId: state.paymentId || DEFAULT_PAYMENT_ID,
|
|
615
|
-
configuration: {
|
|
616
|
-
network: state.paymentAsset.network,
|
|
617
|
-
asset: state.paymentAsset.asset,
|
|
618
|
-
recipient: state.recipient,
|
|
619
|
-
amount: state.amount
|
|
620
|
-
},
|
|
621
|
-
currentPayment: {
|
|
622
|
-
type: "exchange",
|
|
623
|
-
exchangeId: (_a = state.currentPayment) == null ? void 0 : _a.exchangeId,
|
|
624
|
-
sessionId: (_b = state.currentPayment) == null ? void 0 : _b.sessionId,
|
|
625
|
-
result: status.txHash
|
|
626
|
-
}
|
|
627
|
-
}
|
|
628
|
-
});
|
|
629
|
-
}
|
|
630
|
-
return status;
|
|
631
|
-
} catch (error) {
|
|
632
|
-
throw new AppKitPayError(AppKitPayErrorCodes.UNABLE_TO_GET_BUY_STATUS);
|
|
633
|
-
}
|
|
634
|
-
},
|
|
635
|
-
async updateBuyStatus(exchangeId, sessionId) {
|
|
636
|
-
try {
|
|
637
|
-
const status = await this.getBuyStatus(exchangeId, sessionId);
|
|
638
|
-
if (state.currentPayment) {
|
|
639
|
-
state.currentPayment.status = status.status;
|
|
640
|
-
state.currentPayment.result = status.txHash;
|
|
641
|
-
}
|
|
642
|
-
if (status.status === "SUCCESS" || status.status === "FAILED") {
|
|
643
|
-
state.isPaymentInProgress = false;
|
|
644
|
-
}
|
|
645
|
-
} catch (error) {
|
|
646
|
-
throw new AppKitPayError(AppKitPayErrorCodes.UNABLE_TO_GET_BUY_STATUS);
|
|
647
|
-
}
|
|
648
|
-
},
|
|
649
|
-
initiatePayment() {
|
|
650
|
-
state.isPaymentInProgress = true;
|
|
651
|
-
state.paymentId = crypto.randomUUID();
|
|
652
|
-
},
|
|
653
|
-
initializeAnalytics() {
|
|
654
|
-
if (state.analyticsSet) {
|
|
655
|
-
return;
|
|
656
|
-
}
|
|
657
|
-
state.analyticsSet = true;
|
|
658
|
-
this.subscribeKey("isPaymentInProgress", (_) => {
|
|
659
|
-
var _a;
|
|
660
|
-
if (((_a = state.currentPayment) == null ? void 0 : _a.status) && state.currentPayment.status !== "UNKNOWN") {
|
|
661
|
-
const eventType = {
|
|
662
|
-
IN_PROGRESS: "PAY_INITIATED",
|
|
663
|
-
SUCCESS: "PAY_SUCCESS",
|
|
664
|
-
FAILED: "PAY_ERROR"
|
|
665
|
-
}[state.currentPayment.status];
|
|
666
|
-
EventsController.sendEvent({
|
|
667
|
-
type: "track",
|
|
668
|
-
event: eventType,
|
|
669
|
-
properties: {
|
|
670
|
-
message: state.currentPayment.status === "FAILED" ? CoreHelperUtil.parseError(state.error) : void 0,
|
|
671
|
-
source: "pay",
|
|
672
|
-
paymentId: state.paymentId || DEFAULT_PAYMENT_ID,
|
|
673
|
-
configuration: {
|
|
674
|
-
network: state.paymentAsset.network,
|
|
675
|
-
asset: state.paymentAsset.asset,
|
|
676
|
-
recipient: state.recipient,
|
|
677
|
-
amount: state.amount
|
|
678
|
-
},
|
|
679
|
-
currentPayment: {
|
|
680
|
-
type: state.currentPayment.type,
|
|
681
|
-
exchangeId: state.currentPayment.exchangeId,
|
|
682
|
-
sessionId: state.currentPayment.sessionId,
|
|
683
|
-
result: state.currentPayment.result
|
|
684
|
-
}
|
|
685
|
-
}
|
|
686
|
-
});
|
|
687
|
-
}
|
|
688
|
-
});
|
|
689
|
-
}
|
|
690
|
-
};
|
|
691
|
-
const styles$1 = i`
|
|
692
|
-
wui-separator {
|
|
693
|
-
margin: var(--apkt-spacing-3) calc(var(--apkt-spacing-3) * -1) var(--apkt-spacing-2)
|
|
694
|
-
calc(var(--apkt-spacing-3) * -1);
|
|
695
|
-
width: calc(100% + var(--apkt-spacing-3) * 2);
|
|
696
|
-
}
|
|
697
|
-
|
|
698
|
-
.token-display {
|
|
699
|
-
padding: var(--apkt-spacing-3) var(--apkt-spacing-3);
|
|
700
|
-
border-radius: var(--apkt-borderRadius-5);
|
|
701
|
-
background-color: var(--apkt-tokens-theme-backgroundPrimary);
|
|
702
|
-
margin-top: var(--apkt-spacing-3);
|
|
703
|
-
margin-bottom: var(--apkt-spacing-3);
|
|
704
|
-
}
|
|
705
|
-
|
|
706
|
-
.token-display wui-text {
|
|
707
|
-
text-transform: none;
|
|
708
|
-
}
|
|
709
|
-
|
|
710
|
-
wui-loading-spinner {
|
|
711
|
-
padding: var(--apkt-spacing-2);
|
|
712
|
-
}
|
|
713
|
-
`;
|
|
714
|
-
var __decorate$1 = function(decorators, target, key, desc) {
|
|
715
|
-
var c = arguments.length, r2 = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
716
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc);
|
|
717
|
-
else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r2 = (c < 3 ? d(r2) : c > 3 ? d(target, key, r2) : d(target, key)) || r2;
|
|
718
|
-
return c > 3 && r2 && Object.defineProperty(target, key, r2), r2;
|
|
719
|
-
};
|
|
720
|
-
let W3mPayView = class W3mPayView2 extends i$1 {
|
|
721
|
-
constructor() {
|
|
722
|
-
var _a;
|
|
723
|
-
super();
|
|
724
|
-
this.unsubscribe = [];
|
|
725
|
-
this.amount = "";
|
|
726
|
-
this.tokenSymbol = "";
|
|
727
|
-
this.networkName = "";
|
|
728
|
-
this.exchanges = PayController.state.exchanges;
|
|
729
|
-
this.isLoading = PayController.state.isLoading;
|
|
730
|
-
this.loadingExchangeId = null;
|
|
731
|
-
this.connectedWalletInfo = (_a = ChainController.getAccountData()) == null ? void 0 : _a.connectedWalletInfo;
|
|
732
|
-
this.initializePaymentDetails();
|
|
733
|
-
this.unsubscribe.push(PayController.subscribeKey("exchanges", (val) => this.exchanges = val));
|
|
734
|
-
this.unsubscribe.push(PayController.subscribeKey("isLoading", (val) => this.isLoading = val));
|
|
735
|
-
this.unsubscribe.push(ChainController.subscribeChainProp("accountState", (val) => {
|
|
736
|
-
this.connectedWalletInfo = val == null ? void 0 : val.connectedWalletInfo;
|
|
737
|
-
}));
|
|
738
|
-
PayController.fetchExchanges();
|
|
739
|
-
}
|
|
740
|
-
get isWalletConnected() {
|
|
741
|
-
const accountData = ChainController.getAccountData();
|
|
742
|
-
return (accountData == null ? void 0 : accountData.status) === "connected";
|
|
743
|
-
}
|
|
744
|
-
render() {
|
|
745
|
-
return x`
|
|
746
|
-
<wui-flex flexDirection="column">
|
|
747
|
-
<wui-flex flexDirection="column" .padding=${["0", "4", "4", "4"]} gap="3">
|
|
748
|
-
${this.renderPaymentHeader()}
|
|
749
|
-
|
|
750
|
-
<wui-flex flexDirection="column" gap="3">
|
|
751
|
-
${this.renderPayWithWallet()} ${this.renderExchangeOptions()}
|
|
752
|
-
</wui-flex>
|
|
753
|
-
</wui-flex>
|
|
754
|
-
</wui-flex>
|
|
755
|
-
`;
|
|
756
|
-
}
|
|
757
|
-
initializePaymentDetails() {
|
|
758
|
-
const paymentAsset = PayController.getPaymentAsset();
|
|
759
|
-
this.networkName = paymentAsset.network;
|
|
760
|
-
this.tokenSymbol = paymentAsset.metadata.symbol;
|
|
761
|
-
this.amount = PayController.state.amount.toString();
|
|
762
|
-
}
|
|
763
|
-
renderPayWithWallet() {
|
|
764
|
-
if (!isPayWithWalletSupported(this.networkName)) {
|
|
765
|
-
return x``;
|
|
766
|
-
}
|
|
767
|
-
return x`<wui-flex flexDirection="column" gap="3">
|
|
768
|
-
${this.isWalletConnected ? this.renderConnectedView() : this.renderDisconnectedView()}
|
|
769
|
-
</wui-flex>
|
|
770
|
-
<wui-separator text="or"></wui-separator>`;
|
|
771
|
-
}
|
|
772
|
-
renderPaymentHeader() {
|
|
773
|
-
let displayNetworkName = this.networkName;
|
|
774
|
-
if (this.networkName) {
|
|
775
|
-
const allNetworks = ChainController.getAllRequestedCaipNetworks();
|
|
776
|
-
const targetNetwork = allNetworks.find((net) => net.caipNetworkId === this.networkName);
|
|
777
|
-
if (targetNetwork) {
|
|
778
|
-
displayNetworkName = targetNetwork["name"];
|
|
779
|
-
}
|
|
780
|
-
}
|
|
781
|
-
return x`
|
|
782
|
-
<wui-flex flexDirection="column" alignItems="center">
|
|
783
|
-
<wui-flex alignItems="center" gap="2">
|
|
784
|
-
<wui-text variant="h1-regular" color="primary">${this.amount || "0.0000"}</wui-text>
|
|
785
|
-
<wui-flex class="token-display" alignItems="center" gap="1">
|
|
786
|
-
<wui-text variant="md-medium" color="primary">
|
|
787
|
-
${this.tokenSymbol || "Unknown Asset"}
|
|
788
|
-
</wui-text>
|
|
789
|
-
${displayNetworkName ? x`
|
|
790
|
-
<wui-text variant="sm-medium" color="secondary">
|
|
791
|
-
on ${displayNetworkName}
|
|
792
|
-
</wui-text>
|
|
793
|
-
` : ""}
|
|
794
|
-
</wui-flex>
|
|
795
|
-
</wui-flex>
|
|
796
|
-
</wui-flex>
|
|
797
|
-
`;
|
|
798
|
-
}
|
|
799
|
-
renderConnectedView() {
|
|
800
|
-
var _a, _b;
|
|
801
|
-
const walletName = ((_a = this.connectedWalletInfo) == null ? void 0 : _a.name) || "connected wallet";
|
|
802
|
-
return x`
|
|
803
|
-
<wui-list-item
|
|
804
|
-
@click=${this.onWalletPayment}
|
|
805
|
-
?chevron=${true}
|
|
806
|
-
?fullSize=${true}
|
|
807
|
-
?rounded=${true}
|
|
808
|
-
data-testid="wallet-payment-option"
|
|
809
|
-
imageSrc=${o((_b = this.connectedWalletInfo) == null ? void 0 : _b.icon)}
|
|
810
|
-
>
|
|
811
|
-
<wui-text variant="lg-regular" color="primary">Pay with ${walletName}</wui-text>
|
|
812
|
-
</wui-list-item>
|
|
813
|
-
|
|
814
|
-
<wui-list-item
|
|
815
|
-
icon="power"
|
|
816
|
-
?rounded=${true}
|
|
817
|
-
iconColor="error"
|
|
818
|
-
@click=${this.onDisconnect}
|
|
819
|
-
data-testid="disconnect-button"
|
|
820
|
-
?chevron=${false}
|
|
821
|
-
>
|
|
822
|
-
<wui-text variant="lg-regular" color="secondary">Disconnect</wui-text>
|
|
823
|
-
</wui-list-item>
|
|
824
|
-
`;
|
|
825
|
-
}
|
|
826
|
-
renderDisconnectedView() {
|
|
827
|
-
return x`<wui-list-item
|
|
828
|
-
variant="icon"
|
|
829
|
-
iconVariant="overlay"
|
|
830
|
-
icon="wallet"
|
|
831
|
-
?rounded=${true}
|
|
832
|
-
@click=${this.onWalletPayment}
|
|
833
|
-
?chevron=${true}
|
|
834
|
-
data-testid="wallet-payment-option"
|
|
835
|
-
>
|
|
836
|
-
<wui-text variant="lg-regular" color="primary">Pay from wallet</wui-text>
|
|
837
|
-
</wui-list-item>`;
|
|
838
|
-
}
|
|
839
|
-
renderExchangeOptions() {
|
|
840
|
-
if (this.isLoading) {
|
|
841
|
-
return x`<wui-flex justifyContent="center" alignItems="center">
|
|
842
|
-
<wui-spinner size="md"></wui-spinner>
|
|
843
|
-
</wui-flex>`;
|
|
844
|
-
}
|
|
845
|
-
if (this.exchanges.length === 0) {
|
|
846
|
-
return x`<wui-flex justifyContent="center" alignItems="center">
|
|
847
|
-
<wui-text variant="md-medium" color="primary">No exchanges available</wui-text>
|
|
848
|
-
</wui-flex>`;
|
|
849
|
-
}
|
|
850
|
-
return this.exchanges.map((exchange) => x`
|
|
851
|
-
<wui-list-item
|
|
852
|
-
@click=${() => this.onExchangePayment(exchange.id)}
|
|
853
|
-
data-testid="exchange-option-${exchange.id}"
|
|
854
|
-
?chevron=${true}
|
|
855
|
-
?disabled=${this.loadingExchangeId !== null}
|
|
856
|
-
?loading=${this.loadingExchangeId === exchange.id}
|
|
857
|
-
imageSrc=${o(exchange.imageUrl)}
|
|
858
|
-
>
|
|
859
|
-
<wui-flex alignItems="center" gap="3">
|
|
860
|
-
<wui-text flexGrow="1" variant="md-medium" color="primary"
|
|
861
|
-
>Pay with ${exchange.name} <wui-spinner size="sm" color="secondary"></wui-spinner
|
|
862
|
-
></wui-text>
|
|
863
|
-
</wui-flex>
|
|
864
|
-
</wui-list-item>
|
|
865
|
-
`);
|
|
866
|
-
}
|
|
867
|
-
onWalletPayment() {
|
|
868
|
-
PayController.handlePayWithWallet();
|
|
869
|
-
}
|
|
870
|
-
async onExchangePayment(exchangeId) {
|
|
871
|
-
try {
|
|
872
|
-
this.loadingExchangeId = exchangeId;
|
|
873
|
-
const result = await PayController.handlePayWithExchange(exchangeId);
|
|
874
|
-
if (result) {
|
|
875
|
-
await ModalController.open({
|
|
876
|
-
view: "PayLoading"
|
|
877
|
-
});
|
|
878
|
-
CoreHelperUtil.openHref(result.url, result.openInNewTab ? "_blank" : "_self");
|
|
879
|
-
}
|
|
880
|
-
} catch (error) {
|
|
881
|
-
console.error("Failed to pay with exchange", error);
|
|
882
|
-
SnackController.showError("Failed to pay with exchange");
|
|
883
|
-
} finally {
|
|
884
|
-
this.loadingExchangeId = null;
|
|
885
|
-
}
|
|
886
|
-
}
|
|
887
|
-
async onDisconnect(e) {
|
|
888
|
-
e.stopPropagation();
|
|
889
|
-
try {
|
|
890
|
-
await ConnectionController.disconnect();
|
|
891
|
-
} catch {
|
|
892
|
-
console.error("Failed to disconnect");
|
|
893
|
-
SnackController.showError("Failed to disconnect");
|
|
894
|
-
}
|
|
895
|
-
}
|
|
896
|
-
disconnectedCallback() {
|
|
897
|
-
this.unsubscribe.forEach((unsubscribe) => unsubscribe());
|
|
898
|
-
}
|
|
899
|
-
};
|
|
900
|
-
W3mPayView.styles = styles$1;
|
|
901
|
-
__decorate$1([
|
|
902
|
-
r()
|
|
903
|
-
], W3mPayView.prototype, "amount", void 0);
|
|
904
|
-
__decorate$1([
|
|
905
|
-
r()
|
|
906
|
-
], W3mPayView.prototype, "tokenSymbol", void 0);
|
|
907
|
-
__decorate$1([
|
|
908
|
-
r()
|
|
909
|
-
], W3mPayView.prototype, "networkName", void 0);
|
|
910
|
-
__decorate$1([
|
|
911
|
-
r()
|
|
912
|
-
], W3mPayView.prototype, "exchanges", void 0);
|
|
913
|
-
__decorate$1([
|
|
914
|
-
r()
|
|
915
|
-
], W3mPayView.prototype, "isLoading", void 0);
|
|
916
|
-
__decorate$1([
|
|
917
|
-
r()
|
|
918
|
-
], W3mPayView.prototype, "loadingExchangeId", void 0);
|
|
919
|
-
__decorate$1([
|
|
920
|
-
r()
|
|
921
|
-
], W3mPayView.prototype, "connectedWalletInfo", void 0);
|
|
922
|
-
W3mPayView = __decorate$1([
|
|
923
|
-
customElement("w3m-pay-view")
|
|
924
|
-
], W3mPayView);
|
|
925
|
-
const styles = i`
|
|
926
|
-
:host {
|
|
927
|
-
display: block;
|
|
928
|
-
height: 100%;
|
|
929
|
-
width: 100%;
|
|
930
|
-
}
|
|
931
|
-
|
|
932
|
-
wui-flex:first-child:not(:only-child) {
|
|
933
|
-
position: relative;
|
|
934
|
-
}
|
|
935
|
-
|
|
936
|
-
wui-loading-thumbnail {
|
|
937
|
-
position: absolute;
|
|
938
|
-
}
|
|
939
|
-
`;
|
|
940
|
-
var __decorate = function(decorators, target, key, desc) {
|
|
941
|
-
var c = arguments.length, r2 = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
942
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r2 = Reflect.decorate(decorators, target, key, desc);
|
|
943
|
-
else for (var i2 = decorators.length - 1; i2 >= 0; i2--) if (d = decorators[i2]) r2 = (c < 3 ? d(r2) : c > 3 ? d(target, key, r2) : d(target, key)) || r2;
|
|
944
|
-
return c > 3 && r2 && Object.defineProperty(target, key, r2), r2;
|
|
945
|
-
};
|
|
946
|
-
const EXCHANGE_STATUS_CHECK_INTERVAL = 4e3;
|
|
947
|
-
let W3mPayLoadingView = class W3mPayLoadingView2 extends i$1 {
|
|
948
|
-
constructor() {
|
|
949
|
-
super();
|
|
950
|
-
this.loadingMessage = "";
|
|
951
|
-
this.subMessage = "";
|
|
952
|
-
this.paymentState = "in-progress";
|
|
953
|
-
this.paymentState = PayController.state.isPaymentInProgress ? "in-progress" : "completed";
|
|
954
|
-
this.updateMessages();
|
|
955
|
-
this.setupSubscription();
|
|
956
|
-
this.setupExchangeSubscription();
|
|
957
|
-
}
|
|
958
|
-
disconnectedCallback() {
|
|
959
|
-
clearInterval(this.exchangeSubscription);
|
|
960
|
-
}
|
|
961
|
-
render() {
|
|
962
|
-
return x`
|
|
963
|
-
<wui-flex
|
|
964
|
-
flexDirection="column"
|
|
965
|
-
alignItems="center"
|
|
966
|
-
.padding=${["7", "5", "5", "5"]}
|
|
967
|
-
gap="9"
|
|
968
|
-
>
|
|
969
|
-
<wui-flex justifyContent="center" alignItems="center"> ${this.getStateIcon()} </wui-flex>
|
|
970
|
-
<wui-flex flexDirection="column" alignItems="center" gap="2">
|
|
971
|
-
<wui-text align="center" variant="lg-medium" color="primary">
|
|
972
|
-
${this.loadingMessage}
|
|
973
|
-
</wui-text>
|
|
974
|
-
<wui-text align="center" variant="lg-regular" color="secondary">
|
|
975
|
-
${this.subMessage}
|
|
976
|
-
</wui-text>
|
|
977
|
-
</wui-flex>
|
|
978
|
-
</wui-flex>
|
|
979
|
-
`;
|
|
980
|
-
}
|
|
981
|
-
updateMessages() {
|
|
982
|
-
var _a;
|
|
983
|
-
switch (this.paymentState) {
|
|
984
|
-
case "completed":
|
|
985
|
-
this.loadingMessage = "Payment completed";
|
|
986
|
-
this.subMessage = "Your transaction has been successfully processed";
|
|
987
|
-
break;
|
|
988
|
-
case "error":
|
|
989
|
-
this.loadingMessage = "Payment failed";
|
|
990
|
-
this.subMessage = "There was an error processing your transaction";
|
|
991
|
-
break;
|
|
992
|
-
case "in-progress":
|
|
993
|
-
default:
|
|
994
|
-
if (((_a = PayController.state.currentPayment) == null ? void 0 : _a.type) === "exchange") {
|
|
995
|
-
this.loadingMessage = "Payment initiated";
|
|
996
|
-
this.subMessage = `Please complete the payment on the exchange`;
|
|
997
|
-
} else {
|
|
998
|
-
this.loadingMessage = "Awaiting payment confirmation";
|
|
999
|
-
this.subMessage = "Please confirm the payment transaction in your wallet";
|
|
1000
|
-
}
|
|
1001
|
-
break;
|
|
1002
|
-
}
|
|
1003
|
-
}
|
|
1004
|
-
getStateIcon() {
|
|
1005
|
-
switch (this.paymentState) {
|
|
1006
|
-
case "completed":
|
|
1007
|
-
return this.successTemplate();
|
|
1008
|
-
case "error":
|
|
1009
|
-
return this.errorTemplate();
|
|
1010
|
-
case "in-progress":
|
|
1011
|
-
default:
|
|
1012
|
-
return this.loaderTemplate();
|
|
1013
|
-
}
|
|
1014
|
-
}
|
|
1015
|
-
setupExchangeSubscription() {
|
|
1016
|
-
var _a;
|
|
1017
|
-
if (((_a = PayController.state.currentPayment) == null ? void 0 : _a.type) !== "exchange") {
|
|
1018
|
-
return;
|
|
1019
|
-
}
|
|
1020
|
-
this.exchangeSubscription = setInterval(async () => {
|
|
1021
|
-
var _a2, _b, _c;
|
|
1022
|
-
const exchangeId = (_a2 = PayController.state.currentPayment) == null ? void 0 : _a2.exchangeId;
|
|
1023
|
-
const sessionId = (_b = PayController.state.currentPayment) == null ? void 0 : _b.sessionId;
|
|
1024
|
-
if (exchangeId && sessionId) {
|
|
1025
|
-
await PayController.updateBuyStatus(exchangeId, sessionId);
|
|
1026
|
-
if (((_c = PayController.state.currentPayment) == null ? void 0 : _c.status) === "SUCCESS") {
|
|
1027
|
-
clearInterval(this.exchangeSubscription);
|
|
1028
|
-
}
|
|
1029
|
-
}
|
|
1030
|
-
}, EXCHANGE_STATUS_CHECK_INTERVAL);
|
|
1031
|
-
}
|
|
1032
|
-
setupSubscription() {
|
|
1033
|
-
PayController.subscribeKey("isPaymentInProgress", (inProgress) => {
|
|
1034
|
-
var _a;
|
|
1035
|
-
if (!inProgress && this.paymentState === "in-progress") {
|
|
1036
|
-
if (PayController.state.error || !((_a = PayController.state.currentPayment) == null ? void 0 : _a.result)) {
|
|
1037
|
-
this.paymentState = "error";
|
|
1038
|
-
} else {
|
|
1039
|
-
this.paymentState = "completed";
|
|
1040
|
-
}
|
|
1041
|
-
this.updateMessages();
|
|
1042
|
-
setTimeout(() => {
|
|
1043
|
-
if (ConnectionController.state.status === "disconnected") {
|
|
1044
|
-
return;
|
|
1045
|
-
}
|
|
1046
|
-
ModalController.close();
|
|
1047
|
-
}, 3e3);
|
|
1048
|
-
}
|
|
1049
|
-
});
|
|
1050
|
-
PayController.subscribeKey("error", (error) => {
|
|
1051
|
-
if (error && this.paymentState === "in-progress") {
|
|
1052
|
-
this.paymentState = "error";
|
|
1053
|
-
this.updateMessages();
|
|
1054
|
-
}
|
|
1055
|
-
});
|
|
1056
|
-
}
|
|
1057
|
-
loaderTemplate() {
|
|
1058
|
-
const borderRadiusMaster = ThemeController.state.themeVariables["--w3m-border-radius-master"];
|
|
1059
|
-
const radius = borderRadiusMaster ? parseInt(borderRadiusMaster.replace("px", ""), 10) : 4;
|
|
1060
|
-
const iconSrc = this.getPaymentIcon();
|
|
1061
|
-
return x`
|
|
1062
|
-
<wui-flex justifyContent="center" alignItems="center" style="position: relative;">
|
|
1063
|
-
${iconSrc ? x`<wui-wallet-image size="lg" imageSrc=${iconSrc}></wui-wallet-image>` : null}
|
|
1064
|
-
<wui-loading-thumbnail radius=${radius * 9}></wui-loading-thumbnail>
|
|
1065
|
-
</wui-flex>
|
|
1066
|
-
`;
|
|
1067
|
-
}
|
|
1068
|
-
getPaymentIcon() {
|
|
1069
|
-
var _a, _b;
|
|
1070
|
-
const currentPayment = PayController.state.currentPayment;
|
|
1071
|
-
if (!currentPayment) {
|
|
1072
|
-
return void 0;
|
|
1073
|
-
}
|
|
1074
|
-
if (currentPayment.type === "exchange") {
|
|
1075
|
-
const exchangeId = currentPayment.exchangeId;
|
|
1076
|
-
if (exchangeId) {
|
|
1077
|
-
const exchange = PayController.getExchangeById(exchangeId);
|
|
1078
|
-
return exchange == null ? void 0 : exchange.imageUrl;
|
|
1079
|
-
}
|
|
1080
|
-
}
|
|
1081
|
-
if (currentPayment.type === "wallet") {
|
|
1082
|
-
const walletIcon = (_b = (_a = ChainController.getAccountData()) == null ? void 0 : _a.connectedWalletInfo) == null ? void 0 : _b.icon;
|
|
1083
|
-
if (walletIcon) {
|
|
1084
|
-
return walletIcon;
|
|
1085
|
-
}
|
|
1086
|
-
const chainNamespace = ChainController.state.activeChain;
|
|
1087
|
-
if (!chainNamespace) {
|
|
1088
|
-
return void 0;
|
|
1089
|
-
}
|
|
1090
|
-
const connectorId = ConnectorController.getConnectorId(chainNamespace);
|
|
1091
|
-
if (!connectorId) {
|
|
1092
|
-
return void 0;
|
|
1093
|
-
}
|
|
1094
|
-
const connector = ConnectorController.getConnectorById(connectorId);
|
|
1095
|
-
if (!connector) {
|
|
1096
|
-
return void 0;
|
|
1097
|
-
}
|
|
1098
|
-
return AssetUtil.getConnectorImage(connector);
|
|
1099
|
-
}
|
|
1100
|
-
return void 0;
|
|
1101
|
-
}
|
|
1102
|
-
successTemplate() {
|
|
1103
|
-
return x`<wui-icon size="xl" color="success" name="checkmark"></wui-icon>`;
|
|
1104
|
-
}
|
|
1105
|
-
errorTemplate() {
|
|
1106
|
-
return x`<wui-icon size="xl" color="error" name="close"></wui-icon>`;
|
|
1107
|
-
}
|
|
1108
|
-
};
|
|
1109
|
-
W3mPayLoadingView.styles = styles;
|
|
1110
|
-
__decorate([
|
|
1111
|
-
r()
|
|
1112
|
-
], W3mPayLoadingView.prototype, "loadingMessage", void 0);
|
|
1113
|
-
__decorate([
|
|
1114
|
-
r()
|
|
1115
|
-
], W3mPayLoadingView.prototype, "subMessage", void 0);
|
|
1116
|
-
__decorate([
|
|
1117
|
-
r()
|
|
1118
|
-
], W3mPayLoadingView.prototype, "paymentState", void 0);
|
|
1119
|
-
W3mPayLoadingView = __decorate([
|
|
1120
|
-
customElement("w3m-pay-loading-view")
|
|
1121
|
-
], W3mPayLoadingView);
|
|
1122
|
-
const PAYMENT_TIMEOUT_MS = 3e5;
|
|
1123
|
-
async function openPay(options) {
|
|
1124
|
-
return PayController.handleOpenPay(options);
|
|
1125
|
-
}
|
|
1126
|
-
async function pay(options, timeoutMs = PAYMENT_TIMEOUT_MS) {
|
|
1127
|
-
if (timeoutMs <= 0) {
|
|
1128
|
-
throw new AppKitPayError(AppKitPayErrorCodes.INVALID_PAYMENT_CONFIG, "Timeout must be greater than 0");
|
|
1129
|
-
}
|
|
1130
|
-
try {
|
|
1131
|
-
await openPay(options);
|
|
1132
|
-
} catch (error) {
|
|
1133
|
-
if (error instanceof AppKitPayError) {
|
|
1134
|
-
throw error;
|
|
1135
|
-
}
|
|
1136
|
-
throw new AppKitPayError(AppKitPayErrorCodes.UNABLE_TO_INITIATE_PAYMENT, error.message);
|
|
1137
|
-
}
|
|
1138
|
-
return new Promise((resolve, reject) => {
|
|
1139
|
-
let isSettled = false;
|
|
1140
|
-
const timeoutId = setTimeout(() => {
|
|
1141
|
-
if (isSettled) {
|
|
1142
|
-
return;
|
|
1143
|
-
}
|
|
1144
|
-
isSettled = true;
|
|
1145
|
-
cleanup();
|
|
1146
|
-
reject(new AppKitPayError(AppKitPayErrorCodes.GENERIC_PAYMENT_ERROR, "Payment timeout"));
|
|
1147
|
-
}, timeoutMs);
|
|
1148
|
-
function checkAndResolve() {
|
|
1149
|
-
if (isSettled) {
|
|
1150
|
-
return;
|
|
1151
|
-
}
|
|
1152
|
-
const currentPayment = PayController.state.currentPayment;
|
|
1153
|
-
const error = PayController.state.error;
|
|
1154
|
-
const isInProgress = PayController.state.isPaymentInProgress;
|
|
1155
|
-
if ((currentPayment == null ? void 0 : currentPayment.status) === "SUCCESS") {
|
|
1156
|
-
isSettled = true;
|
|
1157
|
-
cleanup();
|
|
1158
|
-
clearTimeout(timeoutId);
|
|
1159
|
-
resolve({
|
|
1160
|
-
success: true,
|
|
1161
|
-
result: currentPayment.result
|
|
1162
|
-
});
|
|
1163
|
-
return;
|
|
1164
|
-
}
|
|
1165
|
-
if ((currentPayment == null ? void 0 : currentPayment.status) === "FAILED") {
|
|
1166
|
-
isSettled = true;
|
|
1167
|
-
cleanup();
|
|
1168
|
-
clearTimeout(timeoutId);
|
|
1169
|
-
resolve({
|
|
1170
|
-
success: false,
|
|
1171
|
-
error: error || "Payment failed"
|
|
1172
|
-
});
|
|
1173
|
-
return;
|
|
1174
|
-
}
|
|
1175
|
-
if (error && !isInProgress && !currentPayment) {
|
|
1176
|
-
isSettled = true;
|
|
1177
|
-
cleanup();
|
|
1178
|
-
clearTimeout(timeoutId);
|
|
1179
|
-
resolve({
|
|
1180
|
-
success: false,
|
|
1181
|
-
error
|
|
1182
|
-
});
|
|
1183
|
-
}
|
|
1184
|
-
}
|
|
1185
|
-
const unsubscribePayment = subscribeStateKey("currentPayment", checkAndResolve);
|
|
1186
|
-
const unsubscribeError = subscribeStateKey("error", checkAndResolve);
|
|
1187
|
-
const unsubscribeProgress = subscribeStateKey("isPaymentInProgress", checkAndResolve);
|
|
1188
|
-
const cleanup = createCleanupHandler([
|
|
1189
|
-
unsubscribePayment,
|
|
1190
|
-
unsubscribeError,
|
|
1191
|
-
unsubscribeProgress
|
|
1192
|
-
]);
|
|
1193
|
-
checkAndResolve();
|
|
1194
|
-
});
|
|
1195
|
-
}
|
|
1196
|
-
function getExchanges() {
|
|
1197
|
-
return PayController.getExchanges();
|
|
1198
|
-
}
|
|
1199
|
-
function getPayResult() {
|
|
1200
|
-
var _a;
|
|
1201
|
-
return (_a = PayController.state.currentPayment) == null ? void 0 : _a.result;
|
|
1202
|
-
}
|
|
1203
|
-
function getPayError() {
|
|
1204
|
-
return PayController.state.error;
|
|
1205
|
-
}
|
|
1206
|
-
function getIsPaymentInProgress() {
|
|
1207
|
-
return PayController.state.isPaymentInProgress;
|
|
1208
|
-
}
|
|
1209
|
-
function subscribeStateKey(key, callback) {
|
|
1210
|
-
return PayController.subscribeKey(key, callback);
|
|
1211
|
-
}
|
|
1212
|
-
function createCleanupHandler(unsubscribeFunctions) {
|
|
1213
|
-
return () => {
|
|
1214
|
-
unsubscribeFunctions.forEach((unsubscribe) => {
|
|
1215
|
-
try {
|
|
1216
|
-
unsubscribe();
|
|
1217
|
-
} catch {
|
|
1218
|
-
}
|
|
1219
|
-
});
|
|
1220
|
-
};
|
|
1221
|
-
}
|
|
1222
|
-
const baseETH = {
|
|
1223
|
-
network: "eip155:8453",
|
|
1224
|
-
asset: "native",
|
|
1225
|
-
metadata: {
|
|
1226
|
-
name: "Ethereum",
|
|
1227
|
-
symbol: "ETH",
|
|
1228
|
-
decimals: 18
|
|
1229
|
-
}
|
|
1230
|
-
};
|
|
1231
|
-
const baseUSDC = {
|
|
1232
|
-
network: "eip155:8453",
|
|
1233
|
-
asset: "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
|
|
1234
|
-
metadata: {
|
|
1235
|
-
name: "USD Coin",
|
|
1236
|
-
symbol: "USDC",
|
|
1237
|
-
decimals: 6
|
|
1238
|
-
}
|
|
1239
|
-
};
|
|
1240
|
-
const baseSepoliaETH = {
|
|
1241
|
-
network: "eip155:84532",
|
|
1242
|
-
asset: "native",
|
|
1243
|
-
metadata: {
|
|
1244
|
-
name: "Ethereum",
|
|
1245
|
-
symbol: "ETH",
|
|
1246
|
-
decimals: 18
|
|
1247
|
-
}
|
|
1248
|
-
};
|
|
1249
|
-
const ethereumUSDC = {
|
|
1250
|
-
network: "eip155:1",
|
|
1251
|
-
asset: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
|
1252
|
-
metadata: {
|
|
1253
|
-
name: "USD Coin",
|
|
1254
|
-
symbol: "USDC",
|
|
1255
|
-
decimals: 6
|
|
1256
|
-
}
|
|
1257
|
-
};
|
|
1258
|
-
const optimismUSDC = {
|
|
1259
|
-
network: "eip155:10",
|
|
1260
|
-
asset: "0x0b2c639c533813f4aa9d7837caf62653d097ff85",
|
|
1261
|
-
metadata: {
|
|
1262
|
-
name: "USD Coin",
|
|
1263
|
-
symbol: "USDC",
|
|
1264
|
-
decimals: 6
|
|
1265
|
-
}
|
|
1266
|
-
};
|
|
1267
|
-
const arbitrumUSDC = {
|
|
1268
|
-
network: "eip155:42161",
|
|
1269
|
-
asset: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
|
|
1270
|
-
metadata: {
|
|
1271
|
-
name: "USD Coin",
|
|
1272
|
-
symbol: "USDC",
|
|
1273
|
-
decimals: 6
|
|
1274
|
-
}
|
|
1275
|
-
};
|
|
1276
|
-
const polygonUSDC = {
|
|
1277
|
-
network: "eip155:137",
|
|
1278
|
-
asset: "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",
|
|
1279
|
-
metadata: {
|
|
1280
|
-
name: "USD Coin",
|
|
1281
|
-
symbol: "USDC",
|
|
1282
|
-
decimals: 6
|
|
1283
|
-
}
|
|
1284
|
-
};
|
|
1285
|
-
const solanaUSDC = {
|
|
1286
|
-
network: "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
|
|
1287
|
-
asset: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
|
|
1288
|
-
metadata: {
|
|
1289
|
-
name: "USD Coin",
|
|
1290
|
-
symbol: "USDC",
|
|
1291
|
-
decimals: 6
|
|
1292
|
-
}
|
|
1293
|
-
};
|
|
1294
|
-
const ethereumUSDT = {
|
|
1295
|
-
network: "eip155:1",
|
|
1296
|
-
asset: "0xdAC17F958D2ee523a2206206994597C13D831ec7",
|
|
1297
|
-
metadata: {
|
|
1298
|
-
name: "Tether USD",
|
|
1299
|
-
symbol: "USDT",
|
|
1300
|
-
decimals: 6
|
|
1301
|
-
}
|
|
1302
|
-
};
|
|
1303
|
-
const optimismUSDT = {
|
|
1304
|
-
network: "eip155:10",
|
|
1305
|
-
asset: "0x94b008aA00579c1307B0EF2c499aD98a8ce58e58",
|
|
1306
|
-
metadata: {
|
|
1307
|
-
name: "Tether USD",
|
|
1308
|
-
symbol: "USDT",
|
|
1309
|
-
decimals: 6
|
|
1310
|
-
}
|
|
1311
|
-
};
|
|
1312
|
-
const arbitrumUSDT = {
|
|
1313
|
-
network: "eip155:42161",
|
|
1314
|
-
asset: "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",
|
|
1315
|
-
metadata: {
|
|
1316
|
-
name: "Tether USD",
|
|
1317
|
-
symbol: "USDT",
|
|
1318
|
-
decimals: 6
|
|
1319
|
-
}
|
|
1320
|
-
};
|
|
1321
|
-
const polygonUSDT = {
|
|
1322
|
-
network: "eip155:137",
|
|
1323
|
-
asset: "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
|
|
1324
|
-
metadata: {
|
|
1325
|
-
name: "Tether USD",
|
|
1326
|
-
symbol: "USDT",
|
|
1327
|
-
decimals: 6
|
|
1328
|
-
}
|
|
1329
|
-
};
|
|
1330
|
-
const solanaUSDT = {
|
|
1331
|
-
network: "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
|
|
1332
|
-
asset: "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB",
|
|
1333
|
-
metadata: {
|
|
1334
|
-
name: "Tether USD",
|
|
1335
|
-
symbol: "USDT",
|
|
1336
|
-
decimals: 6
|
|
1337
|
-
}
|
|
1338
|
-
};
|
|
1339
|
-
const solanaSOL = {
|
|
1340
|
-
network: "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
|
|
1341
|
-
asset: "native",
|
|
1342
|
-
metadata: {
|
|
1343
|
-
name: "Solana",
|
|
1344
|
-
symbol: "SOL",
|
|
1345
|
-
decimals: 9
|
|
1346
|
-
}
|
|
1347
|
-
};
|
|
1348
|
-
export {
|
|
1349
|
-
W3mPayLoadingView,
|
|
1350
|
-
W3mPayView,
|
|
1351
|
-
arbitrumUSDC,
|
|
1352
|
-
arbitrumUSDT,
|
|
1353
|
-
baseETH,
|
|
1354
|
-
baseSepoliaETH,
|
|
1355
|
-
baseUSDC,
|
|
1356
|
-
ethereumUSDC,
|
|
1357
|
-
ethereumUSDT,
|
|
1358
|
-
getExchanges,
|
|
1359
|
-
getIsPaymentInProgress,
|
|
1360
|
-
getPayError,
|
|
1361
|
-
getPayResult,
|
|
1362
|
-
openPay,
|
|
1363
|
-
optimismUSDC,
|
|
1364
|
-
optimismUSDT,
|
|
1365
|
-
pay,
|
|
1366
|
-
polygonUSDC,
|
|
1367
|
-
polygonUSDT,
|
|
1368
|
-
solanaSOL,
|
|
1369
|
-
solanaUSDC,
|
|
1370
|
-
solanaUSDT
|
|
1371
|
-
};
|
|
1372
|
-
//# sourceMappingURL=index-CHvzOG0E.js.map
|