@directcryptopay/sdk 0.2.1 → 0.2.3
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/ExchangeController-CPMQq6Q-.js +217 -0
- package/dist/HelpersUtil-DfMFC7Bf.js +120 -0
- package/dist/NavigationUtil-kj9LEOOd.js +8 -0
- package/dist/PhArrowCircleDown-lsK25DCk.js +73 -0
- package/dist/PhArrowClockwise-NeKHZ1co.js +73 -0
- package/dist/PhArrowDown-C9AkNvLs.js +73 -0
- package/dist/PhArrowLeft-RNfIQP1X.js +73 -0
- package/dist/PhArrowRight-DM1tna0G.js +73 -0
- package/dist/PhArrowSquareOut-S5XYbAZj.js +73 -0
- package/dist/PhArrowUp-DmktzOWy.js +73 -0
- package/dist/PhArrowUpRight-BkNeW_5i.js +73 -0
- package/dist/PhArrowsClockwise-CQ4pG76b.js +73 -0
- package/dist/PhArrowsDownUp-H6gxaNM6.js +73 -0
- package/dist/PhArrowsLeftRight-DZSsfMR6.js +73 -0
- package/dist/PhBank-4_9QzqIB.js +73 -0
- package/dist/PhBrowser-B-JSznId.js +73 -0
- package/dist/PhCaretDown-vV5oHMNi.js +73 -0
- package/dist/PhCaretLeft-BLo6Y_f4.js +73 -0
- package/dist/PhCaretRight-CqQN4TT3.js +73 -0
- package/dist/PhCaretUp-Df7UCAHy.js +73 -0
- package/dist/PhCheck-gtpfK4ed.js +73 -0
- package/dist/PhCircleHalf-Uq7dwDYw.js +73 -0
- package/dist/PhClock-SDCW-NmF.js +73 -0
- package/dist/PhCompass-B7hgtdx-.js +73 -0
- package/dist/PhCopy-BcnhyXCy.js +73 -0
- package/dist/PhCreditCard-BJjByVgu.js +73 -0
- package/dist/PhCurrencyDollar-B7ZXqXBy.js +73 -0
- package/dist/PhDesktop-B3VKPuJx.js +73 -0
- package/dist/PhDeviceMobile-Bnd0TYEH.js +73 -0
- package/dist/PhDotsThree-yyMWyZ-R.js +73 -0
- package/dist/PhEnvelope-67uzHbI9.js +73 -0
- package/dist/PhFunnelSimple-B-DCsloI.js +73 -0
- package/dist/PhGlobe-TMm_6qGk.js +73 -0
- package/dist/PhIdentificationCard-CePPD2xc.js +73 -0
- package/dist/PhImage-gY96WtHR.js +73 -0
- package/dist/PhInfo-DRQM_ZDP.js +73 -0
- package/dist/PhLightbulb-B0TxPfZ1.js +73 -0
- package/dist/PhMagnifyingGlass-B8si5_6W.js +73 -0
- package/dist/PhPaperPlaneRight-DVu5PLYd.js +73 -0
- package/dist/PhPlus-BfTsQnUz.js +73 -0
- package/dist/PhPower-CxYUGOWn.js +73 -0
- package/dist/PhPuzzlePiece-CQ4wh0gV.js +73 -0
- package/dist/PhQrCode-BuJ97NYJ.js +73 -0
- package/dist/PhQuestion-kJoP8Mja.js +73 -0
- package/dist/PhQuestionMark-C46ZkFpu.js +73 -0
- package/dist/PhSealCheck-Eh8jVqSN.js +73 -0
- package/dist/PhSignOut-jk97OSVt.js +73 -0
- package/dist/PhSpinner-CiYOhwMg.js +73 -0
- package/dist/PhTrash-pxerMqzd.js +73 -0
- package/dist/PhUser-BMg0VV4A.js +73 -0
- package/dist/PhVault-DYQvx5A-.js +73 -0
- package/dist/PhWarning-NLC5Mj87.js +73 -0
- package/dist/PhWarningCircle-Ch2jU9fA.js +73 -0
- package/dist/PhX-Bx4wpwm3.js +73 -0
- package/dist/SwapController-Cti0Cyxa.js +457 -0
- package/dist/{ccip-BIGqktC1.js → ccip-CKZd2XJ7.js} +4 -4
- package/dist/data-capture-7D5CL385.js +490 -0
- package/dist/dcp-sdk.umd.js +7400 -6589
- package/dist/email-AmK0INbZ.js +344 -0
- package/dist/embedded-wallet-Pn0I_XLn.js +820 -0
- package/dist/features-x8XNprEe.js +274 -0
- package/dist/{hashTypedData-ZH9ZnWu3.js → hashTypedData-B50-z0AA.js} +6 -6
- package/dist/if-defined-CdZSZ6UL.js +10 -0
- package/dist/index-4ewUtPPp.js +7981 -0
- package/dist/{index-D6h-qfpt.js → index-51l86yqx.js} +5 -5
- package/dist/index-B6K56LF_.js +85 -0
- package/dist/index-BAmv9PxJ.js +257 -0
- package/dist/index-BEswjY9r.js +117 -0
- package/dist/index-BSKRq56S.js +355 -0
- package/dist/index-BaygXQxx.js +172 -0
- package/dist/index-BcPxaHr5.js +118 -0
- package/dist/index-Bjt7nGaJ.js +199 -0
- package/dist/{index-D5r0iSq4.js → index-BkTSyAJb.js} +1 -1
- package/dist/index-Bmnl7l2U.js +555 -0
- package/dist/index-BvPvouSq.js +56 -0
- package/dist/index-C-6iznUO.js +174 -0
- package/dist/index-C4M5s_AM.js +228 -0
- package/dist/index-CEqcN8QP.js +1175 -0
- package/dist/{index-CPTcEPbD.js → index-CM3YaYca.js} +296 -298
- package/dist/{index-f3LXSfM5.js → index-CclBLA5r.js} +56 -142
- package/dist/index-ChTxJOiF.js +46 -0
- package/dist/index-CmAv0Tzr.js +86 -0
- package/dist/index-CmvoKY4x.js +125 -0
- package/dist/{index-BdSIrl-R.js → index-D7PmdQ9B.js} +578 -570
- package/dist/{index-DobBVPe4.js → index-D7k2Pc4e.js} +481 -236
- package/dist/index-D7lmgqUR.js +153 -0
- package/dist/index-DG_-qYze.js +107 -0
- package/dist/{index-Dy4NyE6l.js → index-DHot9Fdb.js} +7 -7
- package/dist/index-DV2LrPtU.js +123 -0
- package/dist/index-DYBaJQ2W.js +65 -0
- package/dist/{index-BJ7cbG3N.js → index-D_8VUmn1.js} +36688 -40208
- package/dist/index-D_gLn3rT.js +100 -0
- package/dist/index-DqcVUSC9.js +62 -0
- package/dist/index-I7VDqINw.js +128 -0
- package/dist/index-Oz72I9VP.js +209 -0
- package/dist/index-UclsHkJ0.js +118 -0
- package/dist/index-X8zir_1j.js +110 -0
- package/dist/index-XvlWKGCu.js +1281 -0
- package/dist/index-dO97xPlt.js +171 -0
- package/dist/{index-5mp7WkhV.js → index-uBeF6OAB.js} +2 -2
- package/dist/index-zeA_RiCV.js +159 -0
- package/dist/index.js +1 -1
- package/dist/{localBatchGatewayRequest-CjGcn5nM.js → localBatchGatewayRequest-BUZHGdjw.js} +1 -1
- package/dist/onramp-CdnBuF0r.js +855 -0
- package/dist/{parseSignature-S8VEpRHC.js → parseSignature-CcyTNGr4.js} +2312 -2313
- package/dist/pay-with-exchange-CSM6WCOV.js +525 -0
- package/dist/property-Bd8U3_QP.js +618 -0
- package/dist/receive-DooMu4Dx.js +232 -0
- package/dist/ref-CpgjXAw7.js +107 -0
- package/dist/send-3T7CyYic.js +1166 -0
- package/dist/socials-Dt-iHL17.js +620 -0
- package/dist/swaps-CjA9Es42.js +1760 -0
- package/dist/{transactions-DujFkB-M.js → transactions-nRm9DVzn.js} +10 -10
- package/dist/w3m-modal-NV25AXhM.js +1706 -0
- package/package.json +3 -3
- package/dist/ConstantsUtil-B-_-u8aQ.js +0 -6
- package/dist/add-sji6scSD.js +0 -19
- package/dist/all-wallets-B4H-890E.js +0 -10
- package/dist/app-store-Z433s97G.js +0 -21
- package/dist/apple-b8Lxj7nb.js +0 -22
- package/dist/arrow-bottom-M9oWWo_9.js +0 -12
- package/dist/arrow-bottom-circle-N9c4CXY1.js +0 -15
- package/dist/arrow-left-Dw8AKfwf.js +0 -12
- package/dist/arrow-right-DwLQZSC_.js +0 -12
- package/dist/arrow-top-zhUjkBe1.js +0 -12
- package/dist/bank-CbQdnILK.js +0 -18
- package/dist/browser-xAqNwt7z.js +0 -18
- package/dist/card-Dr1QBmWp.js +0 -18
- package/dist/checkmark-BhT1dTgG.js +0 -15
- package/dist/checkmark-bold-CPB29wqQ.js +0 -12
- package/dist/chevron-bottom-BhNyx2II.js +0 -12
- package/dist/chevron-left-CGuEjQlY.js +0 -12
- package/dist/chevron-right-CvIRRsqZ.js +0 -12
- package/dist/chevron-top-RSzCqjBd.js +0 -12
- package/dist/chrome-store-Cs8dAgs0.js +0 -65
- package/dist/clock-fhZO5otC.js +0 -12
- package/dist/close-BPuztrdR.js +0 -12
- package/dist/coinPlaceholder-C8X2i7Kh.js +0 -12
- package/dist/compass-WMc5huk0.js +0 -12
- package/dist/copy-DVAeT17y.js +0 -19
- package/dist/cursor-BJ4YLXfy.js +0 -7
- package/dist/cursor-transparent-DN2fLQN4.js +0 -16
- package/dist/desktop-6avxisBw.js +0 -13
- package/dist/disconnect-AReVI8Gk.js +0 -12
- package/dist/discord-CxrI30BZ.js +0 -21
- package/dist/email-B8dIIaay.js +0 -696
- package/dist/embedded-wallet-C_5hF7rM.js +0 -468
- package/dist/etherscan-BnAy8cIF.js +0 -10
- package/dist/exclamation-triangle-Bu7nHwx9.js +0 -8
- package/dist/extension-F0LIhvcf.js +0 -12
- package/dist/external-link-CP6phyaM.js +0 -12
- package/dist/facebook-BtQ-Io2y.js +0 -30
- package/dist/farcaster-BmaN1ugd.js +0 -16
- package/dist/filters-DpEwoOmy.js +0 -12
- package/dist/github-q7qO9V-b.js +0 -22
- package/dist/google-DH_ZE8bW.js +0 -22
- package/dist/help-circle-BAQVmKas.js +0 -16
- package/dist/id-Cj68Zwgo.js +0 -16
- package/dist/if-defined-CNte9B3N.js +0 -744
- package/dist/image-BKJDw6N-.js +0 -8
- package/dist/index-7toZMdtG.js +0 -573
- package/dist/index-B1uKzdvN.js +0 -170
- package/dist/index-BHFZVF-b.js +0 -257
- package/dist/index-BKwa5JSA.js +0 -559
- package/dist/index-BP4B9VUt.js +0 -54
- package/dist/index-BVdzXHpO.js +0 -181
- package/dist/index-BYND0GJ9.js +0 -146
- package/dist/index-BaJ0zEbh.js +0 -97
- package/dist/index-Bh0MPFwP.js +0 -58
- package/dist/index-Bsh7_qTp.js +0 -511
- package/dist/index-BwnXTNNg.js +0 -199
- package/dist/index-C0kPDbg_.js +0 -77
- package/dist/index-CKikVKe2.js +0 -75
- package/dist/index-ChVh0Hkp.js +0 -243
- package/dist/index-Cle_NnnS.js +0 -305
- package/dist/index-CmWdvIFT.js +0 -51
- package/dist/index-D2AMA8Bu.js +0 -65
- package/dist/index-DAUM8CO4.js +0 -65
- package/dist/index-DGjZW6uR.js +0 -78
- package/dist/index-DQe94z7X.js +0 -265
- package/dist/index-DTo6w99t.js +0 -7864
- package/dist/index-DYdXjap2.js +0 -320
- package/dist/index-DceCxNV5.js +0 -181
- package/dist/index-Uw9cSw0q.js +0 -294
- package/dist/index-qiuyrukh.js +0 -45
- package/dist/index-zddvaohA.js +0 -78
- package/dist/info-RfPsmroW.js +0 -7
- package/dist/info-circle-DFKHB_ZN.js +0 -16
- package/dist/lightbulb-B-Bykj9X.js +0 -7
- package/dist/mail-mBAgGuw5.js +0 -12
- package/dist/mobile-Dhh3ndkf.js +0 -13
- package/dist/more-D1h7UTvg.js +0 -15
- package/dist/network-placeholder-Dqynvc-t.js +0 -18
- package/dist/nftPlaceholder-Df7MW4MM.js +0 -12
- package/dist/off-BmG3cHTX.js +0 -12
- package/dist/onramp-C401Aenb.js +0 -1279
- package/dist/play-store-4q1fzL_P.js +0 -36
- package/dist/plus-603Gs3yG.js +0 -17
- package/dist/qr-code-Dgwhf6M1.js +0 -10
- package/dist/receive-CYXbbEUR.js +0 -186
- package/dist/recycle-horizontal-Bu8zZ563.js +0 -13
- package/dist/ref-DpmKRWBK.js +0 -41
- package/dist/refresh-BMZFu0mu.js +0 -12
- package/dist/reown-logo-BXph7ThY.js +0 -16
- package/dist/search-Cm_V42Y_.js +0 -12
- package/dist/secp256k1-C0iX1TUr.js +0 -1510
- package/dist/secp256k1-DOQBqE4Z.js +0 -1302
- package/dist/send-BSMYxDuP.js +0 -19
- package/dist/send-C8EeIzRB.js +0 -1038
- package/dist/socials-DQrHQajs.js +0 -574
- package/dist/swapHorizontal-98rnJewS.js +0 -12
- package/dist/swapHorizontalBold-C299FjEt.js +0 -12
- package/dist/swapHorizontalMedium-Cqm6i4WJ.js +0 -20
- package/dist/swapHorizontalRoundedBold-De7hFfqZ.js +0 -12
- package/dist/swapVertical-DSL75l8L.js +0 -12
- package/dist/swaps-BuTNp65Y.js +0 -1637
- package/dist/telegram-cJP7hgUb.js +0 -20
- package/dist/three-dots-DHnEh28O.js +0 -9
- package/dist/twitch-CR2iGcBo.js +0 -22
- package/dist/twitterIcon-E5TAQjOn.js +0 -10
- package/dist/verify-DEukUJp0.js +0 -12
- package/dist/verify-filled-BXsx1i_p.js +0 -12
- package/dist/w3m-modal-Bm7BqVng.js +0 -1037
- package/dist/wallet-CzyyvdrT.js +0 -12
- package/dist/wallet-placeholder-BrcmyGEe.js +0 -18
- package/dist/walletconnect-BSYogWiE.js +0 -36
- package/dist/warning-circle-Cgp2BW3m.js +0 -16
- package/dist/x-BJinLpTw.js +0 -16
|
@@ -0,0 +1,457 @@
|
|
|
1
|
+
import { cN as T, c$ as W, cC as x, d0 as A, cH as g, d1 as B, d2 as P, cF as D, d3 as M, d4 as F, cE as w, cP as v, cG as L, d5 as N, d6 as z, d7 as R, cL as _, cO as H, d8 as V, cR as $, cS as q } from "./index-D_8VUmn1.js";
|
|
2
|
+
const I = {
|
|
3
|
+
getGasPriceInEther(n, t) {
|
|
4
|
+
const o = t * n;
|
|
5
|
+
return Number(o) / 1e18;
|
|
6
|
+
},
|
|
7
|
+
getGasPriceInUSD(n, t, o) {
|
|
8
|
+
const s = I.getGasPriceInEther(t, o);
|
|
9
|
+
return T.bigNumber(n).times(s).toNumber();
|
|
10
|
+
},
|
|
11
|
+
getPriceImpact({ sourceTokenAmount: n, sourceTokenPriceInUSD: t, toTokenPriceInUSD: o, toTokenAmount: s }) {
|
|
12
|
+
const c = T.bigNumber(n).times(t), r = T.bigNumber(s).times(o);
|
|
13
|
+
return c.minus(r).div(c).times(100).toNumber();
|
|
14
|
+
},
|
|
15
|
+
getMaxSlippage(n, t) {
|
|
16
|
+
const o = T.bigNumber(n).div(100);
|
|
17
|
+
return T.multiply(t, o).toNumber();
|
|
18
|
+
},
|
|
19
|
+
getProviderFee(n, t = 85e-4) {
|
|
20
|
+
return T.bigNumber(n).times(t).toString();
|
|
21
|
+
},
|
|
22
|
+
isInsufficientNetworkTokenForGas(n, t) {
|
|
23
|
+
const o = t || "0";
|
|
24
|
+
return T.bigNumber(n).eq(0) ? !0 : T.bigNumber(T.bigNumber(o)).gt(n);
|
|
25
|
+
},
|
|
26
|
+
isInsufficientSourceTokenForSwap(n, t, o) {
|
|
27
|
+
var r, d;
|
|
28
|
+
const s = (d = (r = o == null ? void 0 : o.find((l) => l.address === t)) == null ? void 0 : r.quantity) == null ? void 0 : d.numeric;
|
|
29
|
+
return T.bigNumber(s || "0").lt(n);
|
|
30
|
+
}
|
|
31
|
+
}, O = 15e4, Q = 6, k = {
|
|
32
|
+
// Loading states
|
|
33
|
+
initializing: !1,
|
|
34
|
+
initialized: !1,
|
|
35
|
+
loadingPrices: !1,
|
|
36
|
+
loadingQuote: !1,
|
|
37
|
+
loadingApprovalTransaction: !1,
|
|
38
|
+
loadingBuildTransaction: !1,
|
|
39
|
+
loadingTransaction: !1,
|
|
40
|
+
// Control states
|
|
41
|
+
switchingTokens: !1,
|
|
42
|
+
// Error states
|
|
43
|
+
fetchError: !1,
|
|
44
|
+
// Approval & Swap transaction states
|
|
45
|
+
approvalTransaction: void 0,
|
|
46
|
+
swapTransaction: void 0,
|
|
47
|
+
transactionError: void 0,
|
|
48
|
+
// Input values
|
|
49
|
+
sourceToken: void 0,
|
|
50
|
+
sourceTokenAmount: "",
|
|
51
|
+
sourceTokenPriceInUSD: 0,
|
|
52
|
+
toToken: void 0,
|
|
53
|
+
toTokenAmount: "",
|
|
54
|
+
toTokenPriceInUSD: 0,
|
|
55
|
+
networkPrice: "0",
|
|
56
|
+
networkBalanceInUSD: "0",
|
|
57
|
+
networkTokenSymbol: "",
|
|
58
|
+
inputError: void 0,
|
|
59
|
+
// Request values
|
|
60
|
+
slippage: _.CONVERT_SLIPPAGE_TOLERANCE,
|
|
61
|
+
// Tokens
|
|
62
|
+
tokens: void 0,
|
|
63
|
+
popularTokens: void 0,
|
|
64
|
+
suggestedTokens: void 0,
|
|
65
|
+
foundTokens: void 0,
|
|
66
|
+
myTokensWithBalance: void 0,
|
|
67
|
+
tokensPriceMap: {},
|
|
68
|
+
// Calculations
|
|
69
|
+
gasFee: "0",
|
|
70
|
+
gasPriceInUSD: 0,
|
|
71
|
+
priceImpact: void 0,
|
|
72
|
+
maxSlippage: void 0,
|
|
73
|
+
providerFee: void 0
|
|
74
|
+
}, e = x({ ...k }), E = {
|
|
75
|
+
state: e,
|
|
76
|
+
subscribe(n) {
|
|
77
|
+
return q(e, () => n(e));
|
|
78
|
+
},
|
|
79
|
+
subscribeKey(n, t) {
|
|
80
|
+
return $(e, n, t);
|
|
81
|
+
},
|
|
82
|
+
getParams() {
|
|
83
|
+
var i, u, p, f, S, h, y, b, C;
|
|
84
|
+
const n = w.state.activeChain, t = ((i = w.getAccountData(n)) == null ? void 0 : i.caipAddress) ?? w.state.activeCaipAddress, o = L.getPlainAddress(t), s = H(), c = V.getConnectorId(w.state.activeChain);
|
|
85
|
+
if (!o)
|
|
86
|
+
throw new Error("No address found to swap the tokens from.");
|
|
87
|
+
const r = !((u = e.toToken) != null && u.address) || !((p = e.toToken) != null && p.decimals), d = !((f = e.sourceToken) != null && f.address) || !((S = e.sourceToken) != null && S.decimals) || !T.bigNumber(e.sourceTokenAmount).gt(0), l = !e.sourceTokenAmount;
|
|
88
|
+
return {
|
|
89
|
+
networkAddress: s,
|
|
90
|
+
fromAddress: o,
|
|
91
|
+
fromCaipAddress: t,
|
|
92
|
+
sourceTokenAddress: (h = e.sourceToken) == null ? void 0 : h.address,
|
|
93
|
+
toTokenAddress: (y = e.toToken) == null ? void 0 : y.address,
|
|
94
|
+
toTokenAmount: e.toTokenAmount,
|
|
95
|
+
toTokenDecimals: (b = e.toToken) == null ? void 0 : b.decimals,
|
|
96
|
+
sourceTokenAmount: e.sourceTokenAmount,
|
|
97
|
+
sourceTokenDecimals: (C = e.sourceToken) == null ? void 0 : C.decimals,
|
|
98
|
+
invalidToToken: r,
|
|
99
|
+
invalidSourceToken: d,
|
|
100
|
+
invalidSourceTokenAmount: l,
|
|
101
|
+
availableToSwap: t && !r && !d && !l,
|
|
102
|
+
isAuthConnector: c === P.CONNECTOR_ID.AUTH
|
|
103
|
+
};
|
|
104
|
+
},
|
|
105
|
+
async setSourceToken(n) {
|
|
106
|
+
if (!n) {
|
|
107
|
+
e.sourceToken = n, e.sourceTokenAmount = "", e.sourceTokenPriceInUSD = 0;
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
e.sourceToken = n, await a.setTokenPrice(n.address, "sourceToken");
|
|
111
|
+
},
|
|
112
|
+
setSourceTokenAmount(n) {
|
|
113
|
+
e.sourceTokenAmount = n;
|
|
114
|
+
},
|
|
115
|
+
async setToToken(n) {
|
|
116
|
+
if (!n) {
|
|
117
|
+
e.toToken = n, e.toTokenAmount = "", e.toTokenPriceInUSD = 0;
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
e.toToken = n, await a.setTokenPrice(n.address, "toToken");
|
|
121
|
+
},
|
|
122
|
+
setToTokenAmount(n) {
|
|
123
|
+
e.toTokenAmount = n ? T.toFixed(n, Q) : "";
|
|
124
|
+
},
|
|
125
|
+
async setTokenPrice(n, t) {
|
|
126
|
+
let o = e.tokensPriceMap[n] || 0;
|
|
127
|
+
o || (e.loadingPrices = !0, o = await a.getAddressPrice(n)), t === "sourceToken" ? e.sourceTokenPriceInUSD = o : t === "toToken" && (e.toTokenPriceInUSD = o), e.loadingPrices && (e.loadingPrices = !1), a.getParams().availableToSwap && !e.switchingTokens && a.swapTokens();
|
|
128
|
+
},
|
|
129
|
+
async switchTokens() {
|
|
130
|
+
if (!(e.initializing || !e.initialized || e.switchingTokens)) {
|
|
131
|
+
e.switchingTokens = !0;
|
|
132
|
+
try {
|
|
133
|
+
const n = e.toToken ? { ...e.toToken } : void 0, t = e.sourceToken ? { ...e.sourceToken } : void 0, o = n && e.toTokenAmount === "" ? "1" : e.toTokenAmount;
|
|
134
|
+
a.setSourceTokenAmount(o), a.setToTokenAmount(""), await a.setSourceToken(n), await a.setToToken(t), e.switchingTokens = !1, a.swapTokens();
|
|
135
|
+
} catch (n) {
|
|
136
|
+
throw e.switchingTokens = !1, n;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
resetState() {
|
|
141
|
+
e.myTokensWithBalance = k.myTokensWithBalance, e.tokensPriceMap = k.tokensPriceMap, e.initialized = k.initialized, e.initializing = k.initializing, e.switchingTokens = k.switchingTokens, e.sourceToken = k.sourceToken, e.sourceTokenAmount = k.sourceTokenAmount, e.sourceTokenPriceInUSD = k.sourceTokenPriceInUSD, e.toToken = k.toToken, e.toTokenAmount = k.toTokenAmount, e.toTokenPriceInUSD = k.toTokenPriceInUSD, e.networkPrice = k.networkPrice, e.networkTokenSymbol = k.networkTokenSymbol, e.networkBalanceInUSD = k.networkBalanceInUSD, e.inputError = k.inputError;
|
|
142
|
+
},
|
|
143
|
+
resetValues() {
|
|
144
|
+
var o;
|
|
145
|
+
const { networkAddress: n } = a.getParams(), t = (o = e.tokens) == null ? void 0 : o.find((s) => s.address === n);
|
|
146
|
+
a.setSourceToken(t), a.setToToken(void 0);
|
|
147
|
+
},
|
|
148
|
+
getApprovalLoadingState() {
|
|
149
|
+
return e.loadingApprovalTransaction;
|
|
150
|
+
},
|
|
151
|
+
clearError() {
|
|
152
|
+
e.transactionError = void 0;
|
|
153
|
+
},
|
|
154
|
+
async initializeState() {
|
|
155
|
+
if (!e.initializing) {
|
|
156
|
+
if (e.initializing = !0, !e.initialized)
|
|
157
|
+
try {
|
|
158
|
+
await a.fetchTokens(), e.initialized = !0;
|
|
159
|
+
} catch {
|
|
160
|
+
e.initialized = !1, g.showError("Failed to initialize swap"), A.goBack();
|
|
161
|
+
}
|
|
162
|
+
e.initializing = !1;
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
async fetchTokens() {
|
|
166
|
+
var o;
|
|
167
|
+
const { networkAddress: n } = a.getParams();
|
|
168
|
+
await a.getNetworkTokenPrice(), await a.getMyTokensWithBalance();
|
|
169
|
+
const t = (o = e.myTokensWithBalance) == null ? void 0 : o.find((s) => s.address === n);
|
|
170
|
+
t && (e.networkTokenSymbol = t.symbol, a.setSourceToken(t), a.setSourceTokenAmount("0"));
|
|
171
|
+
},
|
|
172
|
+
async getTokenList() {
|
|
173
|
+
var t, o;
|
|
174
|
+
const n = (t = w.state.activeCaipNetwork) == null ? void 0 : t.caipNetworkId;
|
|
175
|
+
if (!(e.caipNetworkId === n && e.tokens))
|
|
176
|
+
try {
|
|
177
|
+
e.tokensLoading = !0;
|
|
178
|
+
const s = await N.getTokenList(n);
|
|
179
|
+
e.tokens = s, e.caipNetworkId = n, e.popularTokens = s.sort((i, u) => i.symbol < u.symbol ? -1 : i.symbol > u.symbol ? 1 : 0);
|
|
180
|
+
const r = (n && ((o = _.SUGGESTED_TOKENS_BY_CHAIN) == null ? void 0 : o[n]) || []).map((i) => s.find((u) => u.symbol === i)).filter((i) => !!i), l = (_.SWAP_SUGGESTED_TOKENS || []).map((i) => s.find((u) => u.symbol === i)).filter((i) => !!i).filter((i) => !r.some((u) => u.address === i.address));
|
|
181
|
+
e.suggestedTokens = [...r, ...l];
|
|
182
|
+
} catch {
|
|
183
|
+
e.tokens = [], e.popularTokens = [], e.suggestedTokens = [];
|
|
184
|
+
} finally {
|
|
185
|
+
e.tokensLoading = !1;
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
async getAddressPrice(n) {
|
|
189
|
+
var i, u;
|
|
190
|
+
const t = e.tokensPriceMap[n];
|
|
191
|
+
if (t)
|
|
192
|
+
return t;
|
|
193
|
+
const o = await v.fetchTokenPrice({
|
|
194
|
+
addresses: [n]
|
|
195
|
+
}), s = (o == null ? void 0 : o.fungibles) || [], c = [...e.tokens || [], ...e.myTokensWithBalance || []], r = (i = c == null ? void 0 : c.find((p) => p.address === n)) == null ? void 0 : i.symbol, d = ((u = s.find((p) => p.symbol.toLowerCase() === (r == null ? void 0 : r.toLowerCase()))) == null ? void 0 : u.price) || 0, l = parseFloat(d.toString());
|
|
196
|
+
return e.tokensPriceMap[n] = l, l;
|
|
197
|
+
},
|
|
198
|
+
async getNetworkTokenPrice() {
|
|
199
|
+
var c;
|
|
200
|
+
const { networkAddress: n } = a.getParams(), o = (c = (await v.fetchTokenPrice({
|
|
201
|
+
addresses: [n]
|
|
202
|
+
}).catch(() => (g.showError("Failed to fetch network token price"), { fungibles: [] }))).fungibles) == null ? void 0 : c[0], s = (o == null ? void 0 : o.price.toString()) || "0";
|
|
203
|
+
e.tokensPriceMap[n] = parseFloat(s), e.networkTokenSymbol = (o == null ? void 0 : o.symbol) || "", e.networkPrice = s;
|
|
204
|
+
},
|
|
205
|
+
async getMyTokensWithBalance(n) {
|
|
206
|
+
const t = await R.getMyTokensWithBalance(n), o = N.mapBalancesToSwapTokens(t);
|
|
207
|
+
o && (await a.getInitialGasPrice(), a.setBalances(o));
|
|
208
|
+
},
|
|
209
|
+
setBalances(n) {
|
|
210
|
+
const { networkAddress: t } = a.getParams(), o = w.state.activeCaipNetwork;
|
|
211
|
+
if (!o)
|
|
212
|
+
return;
|
|
213
|
+
const s = n.find((c) => c.address === t);
|
|
214
|
+
n.forEach((c) => {
|
|
215
|
+
e.tokensPriceMap[c.address] = c.price || 0;
|
|
216
|
+
}), e.myTokensWithBalance = n.filter((c) => c.address.startsWith(o.caipNetworkId)), e.networkBalanceInUSD = s ? T.multiply(s.quantity.numeric, s.price).toString() : "0";
|
|
217
|
+
},
|
|
218
|
+
async getInitialGasPrice() {
|
|
219
|
+
var t, o;
|
|
220
|
+
const n = await N.fetchGasPrice();
|
|
221
|
+
if (!n)
|
|
222
|
+
return { gasPrice: null, gasPriceInUSD: null };
|
|
223
|
+
switch ((o = (t = w.state) == null ? void 0 : t.activeCaipNetwork) == null ? void 0 : o.chainNamespace) {
|
|
224
|
+
case P.CHAIN.SOLANA:
|
|
225
|
+
return e.gasFee = n.standard ?? "0", e.gasPriceInUSD = T.multiply(n.standard, e.networkPrice).div(1e9).toNumber(), {
|
|
226
|
+
gasPrice: BigInt(e.gasFee),
|
|
227
|
+
gasPriceInUSD: Number(e.gasPriceInUSD)
|
|
228
|
+
};
|
|
229
|
+
case P.CHAIN.EVM:
|
|
230
|
+
default:
|
|
231
|
+
const s = n.standard ?? "0", c = BigInt(s), r = BigInt(O), d = I.getGasPriceInUSD(e.networkPrice, r, c);
|
|
232
|
+
return e.gasFee = s, e.gasPriceInUSD = d, { gasPrice: c, gasPriceInUSD: d };
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
// -- Swap -------------------------------------- //
|
|
236
|
+
async swapTokens() {
|
|
237
|
+
var r, d, l;
|
|
238
|
+
const n = (r = w.getAccountData()) == null ? void 0 : r.address, t = e.sourceToken, o = e.toToken, s = T.bigNumber(e.sourceTokenAmount).gt(0);
|
|
239
|
+
if (s || a.setToTokenAmount(""), !o || !t || e.loadingPrices || !s || !n)
|
|
240
|
+
return;
|
|
241
|
+
e.loadingQuote = !0;
|
|
242
|
+
const c = T.bigNumber(e.sourceTokenAmount).times(10 ** t.decimals).round(0);
|
|
243
|
+
try {
|
|
244
|
+
const i = await v.fetchSwapQuote({
|
|
245
|
+
userAddress: n,
|
|
246
|
+
from: t.address,
|
|
247
|
+
to: o.address,
|
|
248
|
+
gasPrice: e.gasFee,
|
|
249
|
+
amount: c.toString()
|
|
250
|
+
});
|
|
251
|
+
e.loadingQuote = !1;
|
|
252
|
+
const u = (l = (d = i == null ? void 0 : i.quotes) == null ? void 0 : d[0]) == null ? void 0 : l.toAmount;
|
|
253
|
+
if (!u) {
|
|
254
|
+
z.open({
|
|
255
|
+
displayMessage: "Incorrect amount",
|
|
256
|
+
debugMessage: "Please enter a valid amount"
|
|
257
|
+
}, "error");
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
const p = T.bigNumber(u).div(10 ** o.decimals).toString();
|
|
261
|
+
a.setToTokenAmount(p), a.hasInsufficientToken(e.sourceTokenAmount, t.address) ? e.inputError = "Insufficient balance" : (e.inputError = void 0, a.setTransactionDetails());
|
|
262
|
+
} catch (i) {
|
|
263
|
+
const u = await N.handleSwapError(i);
|
|
264
|
+
e.loadingQuote = !1, e.inputError = u || "Insufficient balance";
|
|
265
|
+
}
|
|
266
|
+
},
|
|
267
|
+
// -- Create Transactions -------------------------------------- //
|
|
268
|
+
async getTransaction() {
|
|
269
|
+
const { fromCaipAddress: n, availableToSwap: t } = a.getParams(), o = e.sourceToken, s = e.toToken;
|
|
270
|
+
if (!(!n || !t || !o || !s || e.loadingQuote))
|
|
271
|
+
try {
|
|
272
|
+
e.loadingBuildTransaction = !0;
|
|
273
|
+
const c = await N.fetchSwapAllowance({
|
|
274
|
+
userAddress: n,
|
|
275
|
+
tokenAddress: o.address,
|
|
276
|
+
sourceTokenAmount: e.sourceTokenAmount,
|
|
277
|
+
sourceTokenDecimals: o.decimals
|
|
278
|
+
});
|
|
279
|
+
let r;
|
|
280
|
+
return c ? r = await a.createSwapTransaction() : r = await a.createAllowanceTransaction(), e.loadingBuildTransaction = !1, e.fetchError = !1, r;
|
|
281
|
+
} catch {
|
|
282
|
+
A.goBack(), g.showError("Failed to check allowance"), e.loadingBuildTransaction = !1, e.approvalTransaction = void 0, e.swapTransaction = void 0, e.fetchError = !0;
|
|
283
|
+
return;
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
async createAllowanceTransaction() {
|
|
287
|
+
const { fromCaipAddress: n, sourceTokenAddress: t, toTokenAddress: o } = a.getParams();
|
|
288
|
+
if (!(!n || !o)) {
|
|
289
|
+
if (!t)
|
|
290
|
+
throw new Error("createAllowanceTransaction - No source token address found.");
|
|
291
|
+
try {
|
|
292
|
+
const s = await v.generateApproveCalldata({
|
|
293
|
+
from: t,
|
|
294
|
+
to: o,
|
|
295
|
+
userAddress: n
|
|
296
|
+
}), c = L.getPlainAddress(s.tx.from);
|
|
297
|
+
if (!c)
|
|
298
|
+
throw new Error("SwapController:createAllowanceTransaction - address is required");
|
|
299
|
+
const r = {
|
|
300
|
+
data: s.tx.data,
|
|
301
|
+
to: c,
|
|
302
|
+
gasPrice: BigInt(s.tx.eip155.gasPrice),
|
|
303
|
+
value: BigInt(s.tx.value),
|
|
304
|
+
toAmount: e.toTokenAmount
|
|
305
|
+
};
|
|
306
|
+
return e.swapTransaction = void 0, e.approvalTransaction = {
|
|
307
|
+
data: r.data,
|
|
308
|
+
to: r.to,
|
|
309
|
+
gasPrice: r.gasPrice,
|
|
310
|
+
value: r.value,
|
|
311
|
+
toAmount: r.toAmount
|
|
312
|
+
}, {
|
|
313
|
+
data: r.data,
|
|
314
|
+
to: r.to,
|
|
315
|
+
gasPrice: r.gasPrice,
|
|
316
|
+
value: r.value,
|
|
317
|
+
toAmount: r.toAmount
|
|
318
|
+
};
|
|
319
|
+
} catch {
|
|
320
|
+
A.goBack(), g.showError("Failed to create approval transaction"), e.approvalTransaction = void 0, e.swapTransaction = void 0, e.fetchError = !0;
|
|
321
|
+
return;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
async createSwapTransaction() {
|
|
326
|
+
var d;
|
|
327
|
+
const { networkAddress: n, fromCaipAddress: t, sourceTokenAmount: o } = a.getParams(), s = e.sourceToken, c = e.toToken;
|
|
328
|
+
if (!t || !o || !s || !c)
|
|
329
|
+
return;
|
|
330
|
+
const r = (d = B.parseUnits(o, s.decimals)) == null ? void 0 : d.toString();
|
|
331
|
+
try {
|
|
332
|
+
const l = await v.generateSwapCalldata({
|
|
333
|
+
userAddress: t,
|
|
334
|
+
from: s.address,
|
|
335
|
+
to: c.address,
|
|
336
|
+
amount: r,
|
|
337
|
+
disableEstimate: !0
|
|
338
|
+
}), i = s.address === n, u = BigInt(l.tx.eip155.gas), p = BigInt(l.tx.eip155.gasPrice), f = L.getPlainAddress(l.tx.to);
|
|
339
|
+
if (!f)
|
|
340
|
+
throw new Error("SwapController:createSwapTransaction - address is required");
|
|
341
|
+
const S = {
|
|
342
|
+
data: l.tx.data,
|
|
343
|
+
to: f,
|
|
344
|
+
gas: u,
|
|
345
|
+
gasPrice: p,
|
|
346
|
+
value: BigInt(i ? r ?? "0" : "0"),
|
|
347
|
+
toAmount: e.toTokenAmount
|
|
348
|
+
};
|
|
349
|
+
return e.gasPriceInUSD = I.getGasPriceInUSD(e.networkPrice, u, p), e.approvalTransaction = void 0, e.swapTransaction = S, S;
|
|
350
|
+
} catch {
|
|
351
|
+
A.goBack(), g.showError("Failed to create transaction"), e.approvalTransaction = void 0, e.swapTransaction = void 0, e.fetchError = !0;
|
|
352
|
+
return;
|
|
353
|
+
}
|
|
354
|
+
},
|
|
355
|
+
onEmbeddedWalletApprovalSuccess() {
|
|
356
|
+
g.showLoading("Approve limit increase in your wallet"), A.replace("SwapPreview");
|
|
357
|
+
},
|
|
358
|
+
// -- Send Transactions --------------------------------- //
|
|
359
|
+
async sendTransactionForApproval(n) {
|
|
360
|
+
var c, r, d;
|
|
361
|
+
const { fromAddress: t, isAuthConnector: o } = a.getParams();
|
|
362
|
+
e.loadingApprovalTransaction = !0, o ? A.pushTransactionStack({
|
|
363
|
+
onSuccess: a.onEmbeddedWalletApprovalSuccess
|
|
364
|
+
}) : g.showLoading("Approve limit increase in your wallet");
|
|
365
|
+
try {
|
|
366
|
+
await B.sendTransaction({
|
|
367
|
+
address: t,
|
|
368
|
+
to: n.to,
|
|
369
|
+
data: n.data,
|
|
370
|
+
value: n.value,
|
|
371
|
+
chainNamespace: P.CHAIN.EVM
|
|
372
|
+
}), await a.swapTokens(), await a.getTransaction(), e.approvalTransaction = void 0, e.loadingApprovalTransaction = !1;
|
|
373
|
+
} catch (l) {
|
|
374
|
+
const i = l;
|
|
375
|
+
e.transactionError = i == null ? void 0 : i.displayMessage, e.loadingApprovalTransaction = !1, g.showError((i == null ? void 0 : i.displayMessage) || "Transaction error"), D.sendEvent({
|
|
376
|
+
type: "track",
|
|
377
|
+
event: "SWAP_APPROVAL_ERROR",
|
|
378
|
+
properties: {
|
|
379
|
+
message: (i == null ? void 0 : i.displayMessage) || (i == null ? void 0 : i.message) || "Unknown",
|
|
380
|
+
network: ((c = w.state.activeCaipNetwork) == null ? void 0 : c.caipNetworkId) || "",
|
|
381
|
+
swapFromToken: ((r = a.state.sourceToken) == null ? void 0 : r.symbol) || "",
|
|
382
|
+
swapToToken: ((d = a.state.toToken) == null ? void 0 : d.symbol) || "",
|
|
383
|
+
swapFromAmount: a.state.sourceTokenAmount || "",
|
|
384
|
+
swapToAmount: a.state.toTokenAmount || "",
|
|
385
|
+
isSmartAccount: M(P.CHAIN.EVM) === F.ACCOUNT_TYPES.SMART_ACCOUNT
|
|
386
|
+
}
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
},
|
|
390
|
+
async sendTransactionForSwap(n) {
|
|
391
|
+
var d, l, i, u, p, f, S, h, y, b, C, G;
|
|
392
|
+
if (!n)
|
|
393
|
+
return;
|
|
394
|
+
const { fromAddress: t, toTokenAmount: o, isAuthConnector: s } = a.getParams();
|
|
395
|
+
e.loadingTransaction = !0;
|
|
396
|
+
const c = `Swapping ${(d = e.sourceToken) == null ? void 0 : d.symbol} to ${T.formatNumberToLocalString(o, 3)} ${(l = e.toToken) == null ? void 0 : l.symbol}`, r = `Swapped ${(i = e.sourceToken) == null ? void 0 : i.symbol} to ${T.formatNumberToLocalString(o, 3)} ${(u = e.toToken) == null ? void 0 : u.symbol}`;
|
|
397
|
+
s ? A.pushTransactionStack({
|
|
398
|
+
onSuccess() {
|
|
399
|
+
A.replace("Account"), g.showLoading(c), E.resetState();
|
|
400
|
+
}
|
|
401
|
+
}) : g.showLoading("Confirm transaction in your wallet");
|
|
402
|
+
try {
|
|
403
|
+
const U = [(p = e.sourceToken) == null ? void 0 : p.address, (f = e.toToken) == null ? void 0 : f.address].join(","), m = await B.sendTransaction({
|
|
404
|
+
address: t,
|
|
405
|
+
to: n.to,
|
|
406
|
+
data: n.data,
|
|
407
|
+
value: n.value,
|
|
408
|
+
chainNamespace: P.CHAIN.EVM
|
|
409
|
+
});
|
|
410
|
+
return e.loadingTransaction = !1, g.showSuccess(r), D.sendEvent({
|
|
411
|
+
type: "track",
|
|
412
|
+
event: "SWAP_SUCCESS",
|
|
413
|
+
properties: {
|
|
414
|
+
network: ((S = w.state.activeCaipNetwork) == null ? void 0 : S.caipNetworkId) || "",
|
|
415
|
+
swapFromToken: ((h = a.state.sourceToken) == null ? void 0 : h.symbol) || "",
|
|
416
|
+
swapToToken: ((y = a.state.toToken) == null ? void 0 : y.symbol) || "",
|
|
417
|
+
swapFromAmount: a.state.sourceTokenAmount || "",
|
|
418
|
+
swapToAmount: a.state.toTokenAmount || "",
|
|
419
|
+
isSmartAccount: M(P.CHAIN.EVM) === F.ACCOUNT_TYPES.SMART_ACCOUNT
|
|
420
|
+
}
|
|
421
|
+
}), E.resetState(), s || A.replace("Account"), E.getMyTokensWithBalance(U), m;
|
|
422
|
+
} catch (U) {
|
|
423
|
+
const m = U;
|
|
424
|
+
e.transactionError = m == null ? void 0 : m.displayMessage, e.loadingTransaction = !1, g.showError((m == null ? void 0 : m.displayMessage) || "Transaction error"), D.sendEvent({
|
|
425
|
+
type: "track",
|
|
426
|
+
event: "SWAP_ERROR",
|
|
427
|
+
properties: {
|
|
428
|
+
message: (m == null ? void 0 : m.displayMessage) || (m == null ? void 0 : m.message) || "Unknown",
|
|
429
|
+
network: ((b = w.state.activeCaipNetwork) == null ? void 0 : b.caipNetworkId) || "",
|
|
430
|
+
swapFromToken: ((C = a.state.sourceToken) == null ? void 0 : C.symbol) || "",
|
|
431
|
+
swapToToken: ((G = a.state.toToken) == null ? void 0 : G.symbol) || "",
|
|
432
|
+
swapFromAmount: a.state.sourceTokenAmount || "",
|
|
433
|
+
swapToAmount: a.state.toTokenAmount || "",
|
|
434
|
+
isSmartAccount: M(P.CHAIN.EVM) === F.ACCOUNT_TYPES.SMART_ACCOUNT
|
|
435
|
+
}
|
|
436
|
+
});
|
|
437
|
+
return;
|
|
438
|
+
}
|
|
439
|
+
},
|
|
440
|
+
// -- Checks -------------------------------------------- //
|
|
441
|
+
hasInsufficientToken(n, t) {
|
|
442
|
+
return I.isInsufficientSourceTokenForSwap(n, t, e.myTokensWithBalance);
|
|
443
|
+
},
|
|
444
|
+
// -- Calculations -------------------------------------- //
|
|
445
|
+
setTransactionDetails() {
|
|
446
|
+
const { toTokenAddress: n, toTokenDecimals: t } = a.getParams();
|
|
447
|
+
!n || !t || (e.gasPriceInUSD = I.getGasPriceInUSD(e.networkPrice, BigInt(e.gasFee), BigInt(O)), e.priceImpact = I.getPriceImpact({
|
|
448
|
+
sourceTokenAmount: e.sourceTokenAmount,
|
|
449
|
+
sourceTokenPriceInUSD: e.sourceTokenPriceInUSD,
|
|
450
|
+
toTokenPriceInUSD: e.toTokenPriceInUSD,
|
|
451
|
+
toTokenAmount: e.toTokenAmount
|
|
452
|
+
}), e.maxSlippage = I.getMaxSlippage(e.slippage, e.toTokenAmount), e.providerFee = I.getProviderFee(e.sourceTokenAmount));
|
|
453
|
+
}
|
|
454
|
+
}, a = W(E);
|
|
455
|
+
export {
|
|
456
|
+
a as S
|
|
457
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a1 as p,
|
|
2
|
-
import { l as
|
|
1
|
+
import { a1 as p, dd as y, cq as w, bf as g, br as k, de as E, bB as L, bi as O, aA as m, bE as x } from "./index-D_8VUmn1.js";
|
|
2
|
+
import { l as R, b as M } from "./localBatchGatewayRequest-BUZHGdjw.js";
|
|
3
3
|
class q extends p {
|
|
4
4
|
constructor({ callbackSelector: r, cause: a, data: n, extraData: i, sender: f, urls: t }) {
|
|
5
5
|
var o;
|
|
@@ -78,7 +78,7 @@ async function B(c, { blockNumber: r, blockTag: a, data: n, to: i }) {
|
|
|
78
78
|
try {
|
|
79
79
|
if (!k(i, t))
|
|
80
80
|
throw new $({ sender: t, to: i });
|
|
81
|
-
const u = o.includes(
|
|
81
|
+
const u = o.includes(R) ? await M({
|
|
82
82
|
data: d,
|
|
83
83
|
ccipRequest: h
|
|
84
84
|
}) : await h({ data: d, sender: t, urls: o }), { data: b } = await E(c, {
|
|
@@ -124,7 +124,7 @@ async function A({ data: c, sender: r, urls: a }) {
|
|
|
124
124
|
});
|
|
125
125
|
continue;
|
|
126
126
|
}
|
|
127
|
-
if (!
|
|
127
|
+
if (!x(e)) {
|
|
128
128
|
n = new S({
|
|
129
129
|
result: e,
|
|
130
130
|
url: t
|