@directcryptopay/sdk 0.2.3 → 0.3.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.
Files changed (127) hide show
  1. package/README.md +51 -87
  2. package/dist/core/config.d.ts +9 -46
  3. package/dist/core/iframe.d.ts +16 -0
  4. package/dist/dcp-sdk.umd.js +1 -12811
  5. package/dist/dcp.d.ts +12 -5
  6. package/dist/index.d.ts +1 -1
  7. package/dist/index.js +219 -2
  8. package/dist/types.d.ts +26 -164
  9. package/package.json +3 -13
  10. package/dist/ExchangeController-CPMQq6Q-.js +0 -217
  11. package/dist/HelpersUtil-DfMFC7Bf.js +0 -120
  12. package/dist/NavigationUtil-kj9LEOOd.js +0 -8
  13. package/dist/PhArrowCircleDown-lsK25DCk.js +0 -73
  14. package/dist/PhArrowClockwise-NeKHZ1co.js +0 -73
  15. package/dist/PhArrowDown-C9AkNvLs.js +0 -73
  16. package/dist/PhArrowLeft-RNfIQP1X.js +0 -73
  17. package/dist/PhArrowRight-DM1tna0G.js +0 -73
  18. package/dist/PhArrowSquareOut-S5XYbAZj.js +0 -73
  19. package/dist/PhArrowUp-DmktzOWy.js +0 -73
  20. package/dist/PhArrowUpRight-BkNeW_5i.js +0 -73
  21. package/dist/PhArrowsClockwise-CQ4pG76b.js +0 -73
  22. package/dist/PhArrowsDownUp-H6gxaNM6.js +0 -73
  23. package/dist/PhArrowsLeftRight-DZSsfMR6.js +0 -73
  24. package/dist/PhBank-4_9QzqIB.js +0 -73
  25. package/dist/PhBrowser-B-JSznId.js +0 -73
  26. package/dist/PhCaretDown-vV5oHMNi.js +0 -73
  27. package/dist/PhCaretLeft-BLo6Y_f4.js +0 -73
  28. package/dist/PhCaretRight-CqQN4TT3.js +0 -73
  29. package/dist/PhCaretUp-Df7UCAHy.js +0 -73
  30. package/dist/PhCheck-gtpfK4ed.js +0 -73
  31. package/dist/PhCircleHalf-Uq7dwDYw.js +0 -73
  32. package/dist/PhClock-SDCW-NmF.js +0 -73
  33. package/dist/PhCompass-B7hgtdx-.js +0 -73
  34. package/dist/PhCopy-BcnhyXCy.js +0 -73
  35. package/dist/PhCreditCard-BJjByVgu.js +0 -73
  36. package/dist/PhCurrencyDollar-B7ZXqXBy.js +0 -73
  37. package/dist/PhDesktop-B3VKPuJx.js +0 -73
  38. package/dist/PhDeviceMobile-Bnd0TYEH.js +0 -73
  39. package/dist/PhDotsThree-yyMWyZ-R.js +0 -73
  40. package/dist/PhEnvelope-67uzHbI9.js +0 -73
  41. package/dist/PhFunnelSimple-B-DCsloI.js +0 -73
  42. package/dist/PhGlobe-TMm_6qGk.js +0 -73
  43. package/dist/PhIdentificationCard-CePPD2xc.js +0 -73
  44. package/dist/PhImage-gY96WtHR.js +0 -73
  45. package/dist/PhInfo-DRQM_ZDP.js +0 -73
  46. package/dist/PhLightbulb-B0TxPfZ1.js +0 -73
  47. package/dist/PhMagnifyingGlass-B8si5_6W.js +0 -73
  48. package/dist/PhPaperPlaneRight-DVu5PLYd.js +0 -73
  49. package/dist/PhPlus-BfTsQnUz.js +0 -73
  50. package/dist/PhPower-CxYUGOWn.js +0 -73
  51. package/dist/PhPuzzlePiece-CQ4wh0gV.js +0 -73
  52. package/dist/PhQrCode-BuJ97NYJ.js +0 -73
  53. package/dist/PhQuestion-kJoP8Mja.js +0 -73
  54. package/dist/PhQuestionMark-C46ZkFpu.js +0 -73
  55. package/dist/PhSealCheck-Eh8jVqSN.js +0 -73
  56. package/dist/PhSignOut-jk97OSVt.js +0 -73
  57. package/dist/PhSpinner-CiYOhwMg.js +0 -73
  58. package/dist/PhTrash-pxerMqzd.js +0 -73
  59. package/dist/PhUser-BMg0VV4A.js +0 -73
  60. package/dist/PhVault-DYQvx5A-.js +0 -73
  61. package/dist/PhWarning-NLC5Mj87.js +0 -73
  62. package/dist/PhWarningCircle-Ch2jU9fA.js +0 -73
  63. package/dist/PhX-Bx4wpwm3.js +0 -73
  64. package/dist/SwapController-Cti0Cyxa.js +0 -457
  65. package/dist/ccip-CKZd2XJ7.js +0 -150
  66. package/dist/core/api.d.ts +0 -39
  67. package/dist/core/logic.d.ts +0 -2
  68. package/dist/core/wallet.d.ts +0 -55
  69. package/dist/data-capture-7D5CL385.js +0 -490
  70. package/dist/email-AmK0INbZ.js +0 -344
  71. package/dist/embedded-wallet-Pn0I_XLn.js +0 -820
  72. package/dist/features-x8XNprEe.js +0 -274
  73. package/dist/hashTypedData-B50-z0AA.js +0 -197
  74. package/dist/if-defined-CdZSZ6UL.js +0 -10
  75. package/dist/index-4ewUtPPp.js +0 -7981
  76. package/dist/index-51l86yqx.js +0 -276
  77. package/dist/index-B6K56LF_.js +0 -85
  78. package/dist/index-BAmv9PxJ.js +0 -257
  79. package/dist/index-BEswjY9r.js +0 -117
  80. package/dist/index-BSKRq56S.js +0 -355
  81. package/dist/index-BaygXQxx.js +0 -172
  82. package/dist/index-BcPxaHr5.js +0 -118
  83. package/dist/index-Bjt7nGaJ.js +0 -199
  84. package/dist/index-BkTSyAJb.js +0 -21991
  85. package/dist/index-Bmnl7l2U.js +0 -555
  86. package/dist/index-BvPvouSq.js +0 -56
  87. package/dist/index-C-6iznUO.js +0 -174
  88. package/dist/index-C1QEJL-2.js +0 -572
  89. package/dist/index-C4M5s_AM.js +0 -228
  90. package/dist/index-CEqcN8QP.js +0 -1175
  91. package/dist/index-CM3YaYca.js +0 -8189
  92. package/dist/index-CclBLA5r.js +0 -517
  93. package/dist/index-ChTxJOiF.js +0 -46
  94. package/dist/index-CmAv0Tzr.js +0 -86
  95. package/dist/index-CmvoKY4x.js +0 -125
  96. package/dist/index-D7PmdQ9B.js +0 -1750
  97. package/dist/index-D7k2Pc4e.js +0 -1083
  98. package/dist/index-D7lmgqUR.js +0 -153
  99. package/dist/index-DG_-qYze.js +0 -107
  100. package/dist/index-DHot9Fdb.js +0 -218
  101. package/dist/index-DV2LrPtU.js +0 -123
  102. package/dist/index-DYBaJQ2W.js +0 -65
  103. package/dist/index-D_8VUmn1.js +0 -41543
  104. package/dist/index-D_gLn3rT.js +0 -100
  105. package/dist/index-DqcVUSC9.js +0 -62
  106. package/dist/index-I7VDqINw.js +0 -128
  107. package/dist/index-Oz72I9VP.js +0 -209
  108. package/dist/index-UclsHkJ0.js +0 -118
  109. package/dist/index-X8zir_1j.js +0 -110
  110. package/dist/index-XvlWKGCu.js +0 -1281
  111. package/dist/index-dO97xPlt.js +0 -171
  112. package/dist/index-uBeF6OAB.js +0 -387
  113. package/dist/index-zeA_RiCV.js +0 -159
  114. package/dist/localBatchGatewayRequest-BUZHGdjw.js +0 -91
  115. package/dist/onramp-CdnBuF0r.js +0 -855
  116. package/dist/parseSignature-CcyTNGr4.js +0 -3304
  117. package/dist/pay-with-exchange-CSM6WCOV.js +0 -525
  118. package/dist/property-Bd8U3_QP.js +0 -618
  119. package/dist/receive-DooMu4Dx.js +0 -232
  120. package/dist/ref-CpgjXAw7.js +0 -107
  121. package/dist/send-3T7CyYic.js +0 -1166
  122. package/dist/socials-Dt-iHL17.js +0 -620
  123. package/dist/swaps-CjA9Es42.js +0 -1760
  124. package/dist/transactions-nRm9DVzn.js +0 -37
  125. package/dist/ui/Modal.d.ts +0 -9
  126. package/dist/ui/index.d.ts +0 -6
  127. package/dist/w3m-modal-NV25AXhM.js +0 -1706
@@ -1,1083 +0,0 @@
1
- import { cM as $, dz as b, cG as C, cE as p, d2 as g, dA as B, d1 as w, dB as j, cC as q, cF as _, cH as T, d0 as L, df as x, cR as z, cS as X, c_ as F, cX as W, cY as m, di as J, d8 as M, dh as Z } from "./index-D_8VUmn1.js";
2
- import { r as h, c as H } from "./index-CEqcN8QP.js";
3
- import { o as Y } from "./if-defined-CdZSZ6UL.js";
4
- import "./index-Oz72I9VP.js";
5
- import "./index-BaygXQxx.js";
6
- import "./index-BEswjY9r.js";
7
- import "./index-I7VDqINw.js";
8
- import "./index-BcPxaHr5.js";
9
- import "./index-CmAv0Tzr.js";
10
- import "./index-CmvoKY4x.js";
11
- import "./index-ChTxJOiF.js";
12
- import "./index-DV2LrPtU.js";
13
- import "./index-DYBaJQ2W.js";
14
- const o = {
15
- INVALID_PAYMENT_CONFIG: "INVALID_PAYMENT_CONFIG",
16
- INVALID_RECIPIENT: "INVALID_RECIPIENT",
17
- INVALID_ASSET: "INVALID_ASSET",
18
- INVALID_AMOUNT: "INVALID_AMOUNT",
19
- UNKNOWN_ERROR: "UNKNOWN_ERROR",
20
- UNABLE_TO_INITIATE_PAYMENT: "UNABLE_TO_INITIATE_PAYMENT",
21
- INVALID_CHAIN_NAMESPACE: "INVALID_CHAIN_NAMESPACE",
22
- GENERIC_PAYMENT_ERROR: "GENERIC_PAYMENT_ERROR",
23
- UNABLE_TO_GET_EXCHANGES: "UNABLE_TO_GET_EXCHANGES",
24
- ASSET_NOT_SUPPORTED: "ASSET_NOT_SUPPORTED",
25
- UNABLE_TO_GET_PAY_URL: "UNABLE_TO_GET_PAY_URL",
26
- UNABLE_TO_GET_BUY_STATUS: "UNABLE_TO_GET_BUY_STATUS"
27
- }, N = {
28
- [o.INVALID_PAYMENT_CONFIG]: "Invalid payment configuration",
29
- [o.INVALID_RECIPIENT]: "Invalid recipient address",
30
- [o.INVALID_ASSET]: "Invalid asset specified",
31
- [o.INVALID_AMOUNT]: "Invalid payment amount",
32
- [o.UNKNOWN_ERROR]: "Unknown payment error occurred",
33
- [o.UNABLE_TO_INITIATE_PAYMENT]: "Unable to initiate payment",
34
- [o.INVALID_CHAIN_NAMESPACE]: "Invalid chain namespace",
35
- [o.GENERIC_PAYMENT_ERROR]: "Unable to process payment",
36
- [o.UNABLE_TO_GET_EXCHANGES]: "Unable to get exchanges",
37
- [o.ASSET_NOT_SUPPORTED]: "Asset not supported by the selected exchange",
38
- [o.UNABLE_TO_GET_PAY_URL]: "Unable to get payment URL",
39
- [o.UNABLE_TO_GET_BUY_STATUS]: "Unable to get buy status"
40
- };
41
- class c extends Error {
42
- get message() {
43
- return N[this.code];
44
- }
45
- constructor(e, s) {
46
- super(N[e]), this.name = "AppKitPayError", this.code = e, this.details = s, Error.captureStackTrace && Error.captureStackTrace(this, c);
47
- }
48
- }
49
- const Q = "https://rpc.walletconnect.org/v1/json-rpc";
50
- class ee extends Error {
51
- }
52
- function te() {
53
- const t = $.getSnapshot().projectId;
54
- return `${Q}?projectId=${t}`;
55
- }
56
- async function O(t, e) {
57
- const s = te(), { sdkType: a, sdkVersion: r, projectId: i } = $.getSnapshot(), u = {
58
- jsonrpc: "2.0",
59
- id: 1,
60
- method: t,
61
- params: {
62
- ...e || {},
63
- st: a,
64
- sv: r,
65
- projectId: i
66
- }
67
- }, A = await (await fetch(s, {
68
- method: "POST",
69
- body: JSON.stringify(u),
70
- headers: { "Content-Type": "application/json" }
71
- })).json();
72
- if (A.error)
73
- throw new ee(A.error.message);
74
- return A;
75
- }
76
- async function G(t) {
77
- return (await O("reown_getExchanges", t)).result;
78
- }
79
- async function ne(t) {
80
- return (await O("reown_getExchangePayUrl", t)).result;
81
- }
82
- async function se(t) {
83
- return (await O("reown_getExchangeBuyStatus", t)).result;
84
- }
85
- const ae = ["eip155", "solana"], re = {
86
- eip155: {
87
- native: { assetNamespace: "slip44", assetReference: "60" },
88
- defaultTokenNamespace: "erc20"
89
- },
90
- solana: {
91
- native: { assetNamespace: "slip44", assetReference: "501" },
92
- defaultTokenNamespace: "token"
93
- }
94
- };
95
- function R(t, e) {
96
- const { chainNamespace: s, chainId: a } = b.parseCaipNetworkId(t), r = re[s];
97
- if (!r)
98
- throw new Error(`Unsupported chain namespace for CAIP-19 formatting: ${s}`);
99
- let i = r.native.assetNamespace, u = r.native.assetReference;
100
- return e !== "native" && (i = r.defaultTokenNamespace, u = e), `${`${s}:${a}`}/${i}:${u}`;
101
- }
102
- function ie(t) {
103
- const { chainNamespace: e } = b.parseCaipNetworkId(t);
104
- return ae.includes(e);
105
- }
106
- async function oe(t) {
107
- const { paymentAssetNetwork: e, activeCaipNetwork: s, approvedCaipNetworkIds: a, requestedCaipNetworks: r } = t, u = C.sortRequestedNetworks(a, r).find((P) => P.caipNetworkId === e);
108
- if (!u)
109
- throw new c(o.INVALID_PAYMENT_CONFIG);
110
- if (u.caipNetworkId === s.caipNetworkId)
111
- return;
112
- const d = p.getNetworkProp("supportsAllNetworks", u.chainNamespace);
113
- if (!((a == null ? void 0 : a.includes(u.caipNetworkId)) || d))
114
- throw new c(o.INVALID_PAYMENT_CONFIG);
115
- try {
116
- await p.switchActiveNetwork(u);
117
- } catch (P) {
118
- throw new c(o.GENERIC_PAYMENT_ERROR, P);
119
- }
120
- }
121
- async function ce(t, e, s) {
122
- var d;
123
- if (e !== g.CHAIN.EVM)
124
- throw new c(o.INVALID_CHAIN_NAMESPACE);
125
- if (!s.fromAddress)
126
- throw new c(o.INVALID_PAYMENT_CONFIG, "fromAddress is required for native EVM payments.");
127
- const a = typeof s.amount == "string" ? parseFloat(s.amount) : s.amount;
128
- if (isNaN(a))
129
- throw new c(o.INVALID_PAYMENT_CONFIG);
130
- const r = ((d = t.metadata) == null ? void 0 : d.decimals) ?? 18, i = w.parseUnits(a.toString(), r);
131
- if (typeof i != "bigint")
132
- throw new c(o.GENERIC_PAYMENT_ERROR);
133
- return await w.sendTransaction({
134
- chainNamespace: e,
135
- to: s.recipient,
136
- address: s.fromAddress,
137
- value: i,
138
- data: "0x"
139
- }) ?? void 0;
140
- }
141
- async function ue(t, e) {
142
- if (!e.fromAddress)
143
- throw new c(o.INVALID_PAYMENT_CONFIG, "fromAddress is required for ERC20 EVM payments.");
144
- const s = t.asset, a = e.recipient, r = Number(t.metadata.decimals), i = w.parseUnits(e.amount.toString(), r);
145
- if (i === void 0)
146
- throw new c(o.GENERIC_PAYMENT_ERROR);
147
- return await w.writeContract({
148
- fromAddress: e.fromAddress,
149
- tokenAddress: s,
150
- args: [a, i],
151
- method: "transfer",
152
- abi: j.getERC20Abi(s),
153
- chainNamespace: g.CHAIN.EVM
154
- }) ?? void 0;
155
- }
156
- async function le(t, e) {
157
- if (t !== g.CHAIN.SOLANA)
158
- throw new c(o.INVALID_CHAIN_NAMESPACE);
159
- if (!e.fromAddress)
160
- throw new c(o.INVALID_PAYMENT_CONFIG, "fromAddress is required for Solana payments.");
161
- const s = typeof e.amount == "string" ? parseFloat(e.amount) : e.amount;
162
- if (isNaN(s) || s <= 0)
163
- throw new c(o.INVALID_PAYMENT_CONFIG, "Invalid payment amount.");
164
- try {
165
- if (!B.getProvider(t))
166
- throw new c(o.GENERIC_PAYMENT_ERROR, "No Solana provider available.");
167
- const r = await w.sendTransaction({
168
- chainNamespace: g.CHAIN.SOLANA,
169
- to: e.recipient,
170
- value: s,
171
- tokenMint: e.tokenMint
172
- });
173
- if (!r)
174
- throw new c(o.GENERIC_PAYMENT_ERROR, "Transaction failed.");
175
- return r;
176
- } catch (a) {
177
- throw a instanceof c ? a : new c(o.GENERIC_PAYMENT_ERROR, `Solana payment failed: ${a}`);
178
- }
179
- }
180
- const V = 0, v = "unknown", n = q({
181
- paymentAsset: {
182
- network: "eip155:1",
183
- asset: "0x0",
184
- metadata: {
185
- name: "0x0",
186
- symbol: "0x0",
187
- decimals: 0
188
- }
189
- },
190
- recipient: "0x0",
191
- amount: 0,
192
- isConfigured: !1,
193
- error: null,
194
- isPaymentInProgress: !1,
195
- exchanges: [],
196
- isLoading: !1,
197
- openInNewTab: !0,
198
- redirectUrl: void 0,
199
- payWithExchange: void 0,
200
- currentPayment: void 0,
201
- analyticsSet: !1,
202
- paymentId: void 0
203
- }), l = {
204
- state: n,
205
- subscribe(t) {
206
- return X(n, () => t(n));
207
- },
208
- subscribeKey(t, e) {
209
- return z(n, t, e);
210
- },
211
- async handleOpenPay(t) {
212
- this.resetState(), this.setPaymentConfig(t), this.subscribeEvents(), this.initializeAnalytics(), n.isConfigured = !0, _.sendEvent({
213
- type: "track",
214
- event: "PAY_MODAL_OPEN",
215
- properties: {
216
- exchanges: n.exchanges,
217
- configuration: {
218
- network: n.paymentAsset.network,
219
- asset: n.paymentAsset.asset,
220
- recipient: n.recipient,
221
- amount: n.amount
222
- }
223
- }
224
- }), await x.open({
225
- view: "Pay"
226
- });
227
- },
228
- resetState() {
229
- n.paymentAsset = {
230
- network: "eip155:1",
231
- asset: "0x0",
232
- metadata: { name: "0x0", symbol: "0x0", decimals: 0 }
233
- }, n.recipient = "0x0", n.amount = 0, n.isConfigured = !1, n.error = null, n.isPaymentInProgress = !1, n.isLoading = !1, n.currentPayment = void 0;
234
- },
235
- setPaymentConfig(t) {
236
- if (!t.paymentAsset)
237
- throw new c(o.INVALID_PAYMENT_CONFIG);
238
- try {
239
- n.paymentAsset = t.paymentAsset, n.recipient = t.recipient, n.amount = t.amount, n.openInNewTab = t.openInNewTab ?? !0, n.redirectUrl = t.redirectUrl, n.payWithExchange = t.payWithExchange, n.error = null;
240
- } catch (e) {
241
- throw new c(o.INVALID_PAYMENT_CONFIG, e.message);
242
- }
243
- },
244
- getPaymentAsset() {
245
- return n.paymentAsset;
246
- },
247
- getExchanges() {
248
- return n.exchanges;
249
- },
250
- async fetchExchanges() {
251
- try {
252
- n.isLoading = !0;
253
- const t = await G({
254
- page: V,
255
- asset: R(n.paymentAsset.network, n.paymentAsset.asset),
256
- amount: n.amount.toString()
257
- });
258
- n.exchanges = t.exchanges.slice(0, 2);
259
- } catch {
260
- throw T.showError(N.UNABLE_TO_GET_EXCHANGES), new c(o.UNABLE_TO_GET_EXCHANGES);
261
- } finally {
262
- n.isLoading = !1;
263
- }
264
- },
265
- async getAvailableExchanges(t) {
266
- var e;
267
- try {
268
- const s = t != null && t.asset && (t != null && t.network) ? R(t.network, t.asset) : void 0;
269
- return await G({
270
- page: (t == null ? void 0 : t.page) ?? V,
271
- asset: s,
272
- amount: (e = t == null ? void 0 : t.amount) == null ? void 0 : e.toString()
273
- });
274
- } catch {
275
- throw new c(o.UNABLE_TO_GET_EXCHANGES);
276
- }
277
- },
278
- async getPayUrl(t, e, s = !1) {
279
- try {
280
- const a = Number(e.amount), r = await ne({
281
- exchangeId: t,
282
- asset: R(e.network, e.asset),
283
- amount: a.toString(),
284
- recipient: `${e.network}:${e.recipient}`
285
- });
286
- return _.sendEvent({
287
- type: "track",
288
- event: "PAY_EXCHANGE_SELECTED",
289
- properties: {
290
- source: "pay",
291
- exchange: {
292
- id: t
293
- },
294
- configuration: {
295
- network: e.network,
296
- asset: e.asset,
297
- recipient: e.recipient,
298
- amount: a
299
- },
300
- currentPayment: {
301
- type: "exchange",
302
- exchangeId: t
303
- },
304
- headless: s
305
- }
306
- }), s && (this.initiatePayment(), _.sendEvent({
307
- type: "track",
308
- event: "PAY_INITIATED",
309
- properties: {
310
- source: "pay",
311
- paymentId: n.paymentId || v,
312
- configuration: {
313
- network: e.network,
314
- asset: e.asset,
315
- recipient: e.recipient,
316
- amount: a
317
- },
318
- currentPayment: {
319
- type: "exchange",
320
- exchangeId: t
321
- }
322
- }
323
- })), r;
324
- } catch (a) {
325
- throw a instanceof Error && a.message.includes("is not supported") ? new c(o.ASSET_NOT_SUPPORTED) : new Error(a.message);
326
- }
327
- },
328
- async openPayUrl(t, e, s = !1) {
329
- try {
330
- const a = await this.getPayUrl(t.exchangeId, e, s);
331
- if (!a)
332
- throw new c(o.UNABLE_TO_GET_PAY_URL);
333
- const i = t.openInNewTab ?? !0 ? "_blank" : "_self";
334
- return C.openHref(a.url, i), a;
335
- } catch (a) {
336
- throw a instanceof c ? n.error = a.message : n.error = N.GENERIC_PAYMENT_ERROR, new c(o.UNABLE_TO_GET_PAY_URL);
337
- }
338
- },
339
- subscribeEvents() {
340
- n.isConfigured || (w.subscribeKey("connections", (t) => {
341
- t.size > 0 && this.handlePayment();
342
- }), p.subscribeChainProp("accountState", (t) => {
343
- const e = w.hasAnyConnection(g.CONNECTOR_ID.WALLET_CONNECT);
344
- t != null && t.caipAddress && (e ? setTimeout(() => {
345
- this.handlePayment();
346
- }, 100) : this.handlePayment());
347
- }));
348
- },
349
- async handlePayment() {
350
- n.currentPayment = {
351
- type: "wallet",
352
- status: "IN_PROGRESS"
353
- };
354
- const t = p.getActiveCaipAddress();
355
- if (!t)
356
- return;
357
- const { chainId: e, address: s } = b.parseCaipAddress(t), a = p.state.activeChain;
358
- if (!s || !e || !a || !B.getProvider(a))
359
- return;
360
- const i = p.state.activeCaipNetwork;
361
- if (i && !n.isPaymentInProgress)
362
- try {
363
- this.initiatePayment();
364
- const u = p.getAllRequestedCaipNetworks(), d = p.getAllApprovedCaipNetworkIds();
365
- switch (await oe({
366
- paymentAssetNetwork: n.paymentAsset.network,
367
- activeCaipNetwork: i,
368
- approvedCaipNetworkIds: d,
369
- requestedCaipNetworks: u
370
- }), await x.open({
371
- view: "PayLoading"
372
- }), a) {
373
- case g.CHAIN.EVM:
374
- n.paymentAsset.asset === "native" && (n.currentPayment.result = await ce(n.paymentAsset, a, {
375
- recipient: n.recipient,
376
- amount: n.amount,
377
- fromAddress: s
378
- })), n.paymentAsset.asset.startsWith("0x") && (n.currentPayment.result = await ue(n.paymentAsset, {
379
- recipient: n.recipient,
380
- amount: n.amount,
381
- fromAddress: s
382
- })), n.currentPayment.status = "SUCCESS";
383
- break;
384
- case g.CHAIN.SOLANA:
385
- n.currentPayment.result = await le(a, {
386
- recipient: n.recipient,
387
- amount: n.amount,
388
- fromAddress: s,
389
- tokenMint: n.paymentAsset.asset === "native" ? void 0 : n.paymentAsset.asset
390
- }), n.currentPayment.status = "SUCCESS";
391
- break;
392
- default:
393
- throw new c(o.INVALID_CHAIN_NAMESPACE);
394
- }
395
- } catch (u) {
396
- u instanceof c ? n.error = u.message : n.error = N.GENERIC_PAYMENT_ERROR, n.currentPayment.status = "FAILED", T.showError(n.error);
397
- } finally {
398
- n.isPaymentInProgress = !1;
399
- }
400
- },
401
- getExchangeById(t) {
402
- return n.exchanges.find((e) => e.id === t);
403
- },
404
- validatePayConfig(t) {
405
- const { paymentAsset: e, recipient: s, amount: a } = t;
406
- if (!e)
407
- throw new c(o.INVALID_PAYMENT_CONFIG);
408
- if (!s)
409
- throw new c(o.INVALID_RECIPIENT);
410
- if (!e.asset)
411
- throw new c(o.INVALID_ASSET);
412
- if (a == null || a <= 0)
413
- throw new c(o.INVALID_AMOUNT);
414
- },
415
- handlePayWithWallet() {
416
- const t = p.getActiveCaipAddress();
417
- if (!t) {
418
- L.push("Connect");
419
- return;
420
- }
421
- const { chainId: e, address: s } = b.parseCaipAddress(t), a = p.state.activeChain;
422
- if (!s || !e || !a) {
423
- L.push("Connect");
424
- return;
425
- }
426
- this.handlePayment();
427
- },
428
- async handlePayWithExchange(t) {
429
- try {
430
- n.currentPayment = {
431
- type: "exchange",
432
- exchangeId: t
433
- };
434
- const { network: e, asset: s } = n.paymentAsset, a = {
435
- network: e,
436
- asset: s,
437
- amount: n.amount,
438
- recipient: n.recipient
439
- }, r = await this.getPayUrl(t, a);
440
- if (!r)
441
- throw new c(o.UNABLE_TO_INITIATE_PAYMENT);
442
- return n.currentPayment.sessionId = r.sessionId, n.currentPayment.status = "IN_PROGRESS", n.currentPayment.exchangeId = t, this.initiatePayment(), {
443
- url: r.url,
444
- openInNewTab: n.openInNewTab
445
- };
446
- } catch (e) {
447
- return e instanceof c ? n.error = e.message : n.error = N.GENERIC_PAYMENT_ERROR, n.isPaymentInProgress = !1, T.showError(n.error), null;
448
- }
449
- },
450
- async getBuyStatus(t, e) {
451
- var s, a;
452
- try {
453
- const r = await se({ sessionId: e, exchangeId: t });
454
- return (r.status === "SUCCESS" || r.status === "FAILED") && _.sendEvent({
455
- type: "track",
456
- event: r.status === "SUCCESS" ? "PAY_SUCCESS" : "PAY_ERROR",
457
- properties: {
458
- message: r.status === "FAILED" ? C.parseError(n.error) : void 0,
459
- source: "pay",
460
- paymentId: n.paymentId || v,
461
- configuration: {
462
- network: n.paymentAsset.network,
463
- asset: n.paymentAsset.asset,
464
- recipient: n.recipient,
465
- amount: n.amount
466
- },
467
- currentPayment: {
468
- type: "exchange",
469
- exchangeId: (s = n.currentPayment) == null ? void 0 : s.exchangeId,
470
- sessionId: (a = n.currentPayment) == null ? void 0 : a.sessionId,
471
- result: r.txHash
472
- }
473
- }
474
- }), r;
475
- } catch {
476
- throw new c(o.UNABLE_TO_GET_BUY_STATUS);
477
- }
478
- },
479
- async updateBuyStatus(t, e) {
480
- try {
481
- const s = await this.getBuyStatus(t, e);
482
- n.currentPayment && (n.currentPayment.status = s.status, n.currentPayment.result = s.txHash), (s.status === "SUCCESS" || s.status === "FAILED") && (n.isPaymentInProgress = !1);
483
- } catch {
484
- throw new c(o.UNABLE_TO_GET_BUY_STATUS);
485
- }
486
- },
487
- initiatePayment() {
488
- n.isPaymentInProgress = !0, n.paymentId = crypto.randomUUID();
489
- },
490
- initializeAnalytics() {
491
- n.analyticsSet || (n.analyticsSet = !0, this.subscribeKey("isPaymentInProgress", (t) => {
492
- var e;
493
- if ((e = n.currentPayment) != null && e.status && n.currentPayment.status !== "UNKNOWN") {
494
- const s = {
495
- IN_PROGRESS: "PAY_INITIATED",
496
- SUCCESS: "PAY_SUCCESS",
497
- FAILED: "PAY_ERROR"
498
- }[n.currentPayment.status];
499
- _.sendEvent({
500
- type: "track",
501
- event: s,
502
- properties: {
503
- message: n.currentPayment.status === "FAILED" ? C.parseError(n.error) : void 0,
504
- source: "pay",
505
- paymentId: n.paymentId || v,
506
- configuration: {
507
- network: n.paymentAsset.network,
508
- asset: n.paymentAsset.asset,
509
- recipient: n.recipient,
510
- amount: n.amount
511
- },
512
- currentPayment: {
513
- type: n.currentPayment.type,
514
- exchangeId: n.currentPayment.exchangeId,
515
- sessionId: n.currentPayment.sessionId,
516
- result: n.currentPayment.result
517
- }
518
- }
519
- });
520
- }
521
- }));
522
- }
523
- }, de = F`
524
- wui-separator {
525
- margin: var(--apkt-spacing-3) calc(var(--apkt-spacing-3) * -1) var(--apkt-spacing-2)
526
- calc(var(--apkt-spacing-3) * -1);
527
- width: calc(100% + var(--apkt-spacing-3) * 2);
528
- }
529
-
530
- .token-display {
531
- padding: var(--apkt-spacing-3) var(--apkt-spacing-3);
532
- border-radius: var(--apkt-borderRadius-5);
533
- background-color: var(--apkt-tokens-theme-backgroundPrimary);
534
- margin-top: var(--apkt-spacing-3);
535
- margin-bottom: var(--apkt-spacing-3);
536
- }
537
-
538
- .token-display wui-text {
539
- text-transform: none;
540
- }
541
-
542
- wui-loading-spinner {
543
- padding: var(--apkt-spacing-2);
544
- }
545
- `;
546
- var E = function(t, e, s, a) {
547
- var r = arguments.length, i = r < 3 ? e : a === null ? a = Object.getOwnPropertyDescriptor(e, s) : a, u;
548
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(t, e, s, a);
549
- else for (var d = t.length - 1; d >= 0; d--) (u = t[d]) && (i = (r < 3 ? u(i) : r > 3 ? u(e, s, i) : u(e, s)) || i);
550
- return r > 3 && i && Object.defineProperty(e, s, i), i;
551
- };
552
- let y = class extends W {
553
- constructor() {
554
- var e;
555
- super(), this.unsubscribe = [], this.amount = "", this.tokenSymbol = "", this.networkName = "", this.exchanges = l.state.exchanges, this.isLoading = l.state.isLoading, this.loadingExchangeId = null, this.connectedWalletInfo = (e = p.getAccountData()) == null ? void 0 : e.connectedWalletInfo, this.initializePaymentDetails(), this.unsubscribe.push(l.subscribeKey("exchanges", (s) => this.exchanges = s)), this.unsubscribe.push(l.subscribeKey("isLoading", (s) => this.isLoading = s)), this.unsubscribe.push(p.subscribeChainProp("accountState", (s) => {
556
- this.connectedWalletInfo = s == null ? void 0 : s.connectedWalletInfo;
557
- })), l.fetchExchanges();
558
- }
559
- get isWalletConnected() {
560
- const e = p.getAccountData();
561
- return (e == null ? void 0 : e.status) === "connected";
562
- }
563
- render() {
564
- return m`
565
- <wui-flex flexDirection="column">
566
- <wui-flex flexDirection="column" .padding=${["0", "4", "4", "4"]} gap="3">
567
- ${this.renderPaymentHeader()}
568
-
569
- <wui-flex flexDirection="column" gap="3">
570
- ${this.renderPayWithWallet()} ${this.renderExchangeOptions()}
571
- </wui-flex>
572
- </wui-flex>
573
- </wui-flex>
574
- `;
575
- }
576
- initializePaymentDetails() {
577
- const e = l.getPaymentAsset();
578
- this.networkName = e.network, this.tokenSymbol = e.metadata.symbol, this.amount = l.state.amount.toString();
579
- }
580
- renderPayWithWallet() {
581
- return ie(this.networkName) ? m`<wui-flex flexDirection="column" gap="3">
582
- ${this.isWalletConnected ? this.renderConnectedView() : this.renderDisconnectedView()}
583
- </wui-flex>
584
- <wui-separator text="or"></wui-separator>` : m``;
585
- }
586
- renderPaymentHeader() {
587
- let e = this.networkName;
588
- if (this.networkName) {
589
- const a = p.getAllRequestedCaipNetworks().find((r) => r.caipNetworkId === this.networkName);
590
- a && (e = a.name);
591
- }
592
- return m`
593
- <wui-flex flexDirection="column" alignItems="center">
594
- <wui-flex alignItems="center" gap="2">
595
- <wui-text variant="h1-regular" color="primary">${this.amount || "0.0000"}</wui-text>
596
- <wui-flex class="token-display" alignItems="center" gap="1">
597
- <wui-text variant="md-medium" color="primary">
598
- ${this.tokenSymbol || "Unknown Asset"}
599
- </wui-text>
600
- ${e ? m`
601
- <wui-text variant="sm-medium" color="secondary">
602
- on ${e}
603
- </wui-text>
604
- ` : ""}
605
- </wui-flex>
606
- </wui-flex>
607
- </wui-flex>
608
- `;
609
- }
610
- renderConnectedView() {
611
- var s, a;
612
- const e = ((s = this.connectedWalletInfo) == null ? void 0 : s.name) || "connected wallet";
613
- return m`
614
- <wui-list-item
615
- @click=${this.onWalletPayment}
616
- ?chevron=${!0}
617
- ?fullSize=${!0}
618
- ?rounded=${!0}
619
- data-testid="wallet-payment-option"
620
- imageSrc=${Y((a = this.connectedWalletInfo) == null ? void 0 : a.icon)}
621
- >
622
- <wui-text variant="lg-regular" color="primary">Pay with ${e}</wui-text>
623
- </wui-list-item>
624
-
625
- <wui-list-item
626
- icon="power"
627
- ?rounded=${!0}
628
- iconColor="error"
629
- @click=${this.onDisconnect}
630
- data-testid="disconnect-button"
631
- ?chevron=${!1}
632
- >
633
- <wui-text variant="lg-regular" color="secondary">Disconnect</wui-text>
634
- </wui-list-item>
635
- `;
636
- }
637
- renderDisconnectedView() {
638
- return m`<wui-list-item
639
- variant="icon"
640
- iconVariant="overlay"
641
- icon="wallet"
642
- ?rounded=${!0}
643
- @click=${this.onWalletPayment}
644
- ?chevron=${!0}
645
- data-testid="wallet-payment-option"
646
- >
647
- <wui-text variant="lg-regular" color="primary">Pay from wallet</wui-text>
648
- </wui-list-item>`;
649
- }
650
- renderExchangeOptions() {
651
- return this.isLoading ? m`<wui-flex justifyContent="center" alignItems="center">
652
- <wui-spinner size="md"></wui-spinner>
653
- </wui-flex>` : this.exchanges.length === 0 ? m`<wui-flex justifyContent="center" alignItems="center">
654
- <wui-text variant="md-medium" color="primary">No exchanges available</wui-text>
655
- </wui-flex>` : this.exchanges.map((e) => m`
656
- <wui-list-item
657
- @click=${() => this.onExchangePayment(e.id)}
658
- data-testid="exchange-option-${e.id}"
659
- ?chevron=${!0}
660
- ?disabled=${this.loadingExchangeId !== null}
661
- ?loading=${this.loadingExchangeId === e.id}
662
- imageSrc=${Y(e.imageUrl)}
663
- >
664
- <wui-flex alignItems="center" gap="3">
665
- <wui-text flexGrow="1" variant="md-medium" color="primary"
666
- >Pay with ${e.name} <wui-spinner size="sm" color="secondary"></wui-spinner
667
- ></wui-text>
668
- </wui-flex>
669
- </wui-list-item>
670
- `);
671
- }
672
- onWalletPayment() {
673
- l.handlePayWithWallet();
674
- }
675
- async onExchangePayment(e) {
676
- try {
677
- this.loadingExchangeId = e;
678
- const s = await l.handlePayWithExchange(e);
679
- s && (await x.open({
680
- view: "PayLoading"
681
- }), C.openHref(s.url, s.openInNewTab ? "_blank" : "_self"));
682
- } catch (s) {
683
- console.error("Failed to pay with exchange", s), T.showError("Failed to pay with exchange");
684
- } finally {
685
- this.loadingExchangeId = null;
686
- }
687
- }
688
- async onDisconnect(e) {
689
- e.stopPropagation();
690
- try {
691
- await w.disconnect();
692
- } catch {
693
- console.error("Failed to disconnect"), T.showError("Failed to disconnect");
694
- }
695
- }
696
- disconnectedCallback() {
697
- this.unsubscribe.forEach((e) => e());
698
- }
699
- };
700
- y.styles = de;
701
- E([
702
- h()
703
- ], y.prototype, "amount", void 0);
704
- E([
705
- h()
706
- ], y.prototype, "tokenSymbol", void 0);
707
- E([
708
- h()
709
- ], y.prototype, "networkName", void 0);
710
- E([
711
- h()
712
- ], y.prototype, "exchanges", void 0);
713
- E([
714
- h()
715
- ], y.prototype, "isLoading", void 0);
716
- E([
717
- h()
718
- ], y.prototype, "loadingExchangeId", void 0);
719
- E([
720
- h()
721
- ], y.prototype, "connectedWalletInfo", void 0);
722
- y = E([
723
- H("w3m-pay-view")
724
- ], y);
725
- const pe = F`
726
- :host {
727
- display: block;
728
- height: 100%;
729
- width: 100%;
730
- }
731
-
732
- wui-flex:first-child:not(:only-child) {
733
- position: relative;
734
- }
735
-
736
- wui-loading-thumbnail {
737
- position: absolute;
738
- }
739
- `;
740
- var U = function(t, e, s, a) {
741
- var r = arguments.length, i = r < 3 ? e : a === null ? a = Object.getOwnPropertyDescriptor(e, s) : a, u;
742
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(t, e, s, a);
743
- else for (var d = t.length - 1; d >= 0; d--) (u = t[d]) && (i = (r < 3 ? u(i) : r > 3 ? u(e, s, i) : u(e, s)) || i);
744
- return r > 3 && i && Object.defineProperty(e, s, i), i;
745
- };
746
- const me = 4e3;
747
- let I = class extends W {
748
- constructor() {
749
- super(), this.loadingMessage = "", this.subMessage = "", this.paymentState = "in-progress", this.paymentState = l.state.isPaymentInProgress ? "in-progress" : "completed", this.updateMessages(), this.setupSubscription(), this.setupExchangeSubscription();
750
- }
751
- disconnectedCallback() {
752
- clearInterval(this.exchangeSubscription);
753
- }
754
- render() {
755
- return m`
756
- <wui-flex
757
- flexDirection="column"
758
- alignItems="center"
759
- .padding=${["7", "5", "5", "5"]}
760
- gap="9"
761
- >
762
- <wui-flex justifyContent="center" alignItems="center"> ${this.getStateIcon()} </wui-flex>
763
- <wui-flex flexDirection="column" alignItems="center" gap="2">
764
- <wui-text align="center" variant="lg-medium" color="primary">
765
- ${this.loadingMessage}
766
- </wui-text>
767
- <wui-text align="center" variant="lg-regular" color="secondary">
768
- ${this.subMessage}
769
- </wui-text>
770
- </wui-flex>
771
- </wui-flex>
772
- `;
773
- }
774
- updateMessages() {
775
- var e;
776
- switch (this.paymentState) {
777
- case "completed":
778
- this.loadingMessage = "Payment completed", this.subMessage = "Your transaction has been successfully processed";
779
- break;
780
- case "error":
781
- this.loadingMessage = "Payment failed", this.subMessage = "There was an error processing your transaction";
782
- break;
783
- case "in-progress":
784
- default:
785
- ((e = l.state.currentPayment) == null ? void 0 : e.type) === "exchange" ? (this.loadingMessage = "Payment initiated", this.subMessage = "Please complete the payment on the exchange") : (this.loadingMessage = "Awaiting payment confirmation", this.subMessage = "Please confirm the payment transaction in your wallet");
786
- break;
787
- }
788
- }
789
- getStateIcon() {
790
- switch (this.paymentState) {
791
- case "completed":
792
- return this.successTemplate();
793
- case "error":
794
- return this.errorTemplate();
795
- case "in-progress":
796
- default:
797
- return this.loaderTemplate();
798
- }
799
- }
800
- setupExchangeSubscription() {
801
- var e;
802
- ((e = l.state.currentPayment) == null ? void 0 : e.type) === "exchange" && (this.exchangeSubscription = setInterval(async () => {
803
- var r, i, u;
804
- const s = (r = l.state.currentPayment) == null ? void 0 : r.exchangeId, a = (i = l.state.currentPayment) == null ? void 0 : i.sessionId;
805
- s && a && (await l.updateBuyStatus(s, a), ((u = l.state.currentPayment) == null ? void 0 : u.status) === "SUCCESS" && clearInterval(this.exchangeSubscription));
806
- }, me));
807
- }
808
- setupSubscription() {
809
- l.subscribeKey("isPaymentInProgress", (e) => {
810
- var s;
811
- !e && this.paymentState === "in-progress" && (l.state.error || !((s = l.state.currentPayment) != null && s.result) ? this.paymentState = "error" : this.paymentState = "completed", this.updateMessages(), setTimeout(() => {
812
- w.state.status !== "disconnected" && x.close();
813
- }, 3e3));
814
- }), l.subscribeKey("error", (e) => {
815
- e && this.paymentState === "in-progress" && (this.paymentState = "error", this.updateMessages());
816
- });
817
- }
818
- loaderTemplate() {
819
- const e = J.state.themeVariables["--w3m-border-radius-master"], s = e ? parseInt(e.replace("px", ""), 10) : 4, a = this.getPaymentIcon();
820
- return m`
821
- <wui-flex justifyContent="center" alignItems="center" style="position: relative;">
822
- ${a ? m`<wui-wallet-image size="lg" imageSrc=${a}></wui-wallet-image>` : null}
823
- <wui-loading-thumbnail radius=${s * 9}></wui-loading-thumbnail>
824
- </wui-flex>
825
- `;
826
- }
827
- getPaymentIcon() {
828
- var s, a;
829
- const e = l.state.currentPayment;
830
- if (e) {
831
- if (e.type === "exchange") {
832
- const r = e.exchangeId;
833
- if (r) {
834
- const i = l.getExchangeById(r);
835
- return i == null ? void 0 : i.imageUrl;
836
- }
837
- }
838
- if (e.type === "wallet") {
839
- const r = (a = (s = p.getAccountData()) == null ? void 0 : s.connectedWalletInfo) == null ? void 0 : a.icon;
840
- if (r)
841
- return r;
842
- const i = p.state.activeChain;
843
- if (!i)
844
- return;
845
- const u = M.getConnectorId(i);
846
- if (!u)
847
- return;
848
- const d = M.getConnectorById(u);
849
- return d ? Z.getConnectorImage(d) : void 0;
850
- }
851
- }
852
- }
853
- successTemplate() {
854
- return m`<wui-icon size="xl" color="success" name="checkmark"></wui-icon>`;
855
- }
856
- errorTemplate() {
857
- return m`<wui-icon size="xl" color="error" name="close"></wui-icon>`;
858
- }
859
- };
860
- I.styles = pe;
861
- U([
862
- h()
863
- ], I.prototype, "loadingMessage", void 0);
864
- U([
865
- h()
866
- ], I.prototype, "subMessage", void 0);
867
- U([
868
- h()
869
- ], I.prototype, "paymentState", void 0);
870
- I = U([
871
- H("w3m-pay-loading-view")
872
- ], I);
873
- const ye = 3e5;
874
- async function he(t) {
875
- return l.handleOpenPay(t);
876
- }
877
- async function Re(t, e = ye) {
878
- if (e <= 0)
879
- throw new c(o.INVALID_PAYMENT_CONFIG, "Timeout must be greater than 0");
880
- try {
881
- await he(t);
882
- } catch (s) {
883
- throw s instanceof c ? s : new c(o.UNABLE_TO_INITIATE_PAYMENT, s.message);
884
- }
885
- return new Promise((s, a) => {
886
- let r = !1;
887
- const i = setTimeout(() => {
888
- r || (r = !0, S(), a(new c(o.GENERIC_PAYMENT_ERROR, "Payment timeout")));
889
- }, e);
890
- function u() {
891
- if (r)
892
- return;
893
- const f = l.state.currentPayment, k = l.state.error, K = l.state.isPaymentInProgress;
894
- if ((f == null ? void 0 : f.status) === "SUCCESS") {
895
- r = !0, S(), clearTimeout(i), s({
896
- success: !0,
897
- result: f.result
898
- });
899
- return;
900
- }
901
- if ((f == null ? void 0 : f.status) === "FAILED") {
902
- r = !0, S(), clearTimeout(i), s({
903
- success: !1,
904
- error: k || "Payment failed"
905
- });
906
- return;
907
- }
908
- k && !K && !f && (r = !0, S(), clearTimeout(i), s({
909
- success: !1,
910
- error: k
911
- }));
912
- }
913
- const d = D("currentPayment", u), A = D("error", u), P = D("isPaymentInProgress", u), S = we([
914
- d,
915
- A,
916
- P
917
- ]);
918
- u();
919
- });
920
- }
921
- function ve() {
922
- return l.getExchanges();
923
- }
924
- function De() {
925
- var t;
926
- return (t = l.state.currentPayment) == null ? void 0 : t.result;
927
- }
928
- function Oe() {
929
- return l.state.error;
930
- }
931
- function Le() {
932
- return l.state.isPaymentInProgress;
933
- }
934
- function D(t, e) {
935
- return l.subscribeKey(t, e);
936
- }
937
- function we(t) {
938
- return () => {
939
- t.forEach((e) => {
940
- try {
941
- e();
942
- } catch {
943
- }
944
- });
945
- };
946
- }
947
- const Me = {
948
- network: "eip155:8453",
949
- asset: "native",
950
- metadata: {
951
- name: "Ethereum",
952
- symbol: "ETH",
953
- decimals: 18
954
- }
955
- }, Ye = {
956
- network: "eip155:8453",
957
- asset: "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
958
- metadata: {
959
- name: "USD Coin",
960
- symbol: "USDC",
961
- decimals: 6
962
- }
963
- }, Ge = {
964
- network: "eip155:84532",
965
- asset: "native",
966
- metadata: {
967
- name: "Ethereum",
968
- symbol: "ETH",
969
- decimals: 18
970
- }
971
- }, Ve = {
972
- network: "eip155:1",
973
- asset: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
974
- metadata: {
975
- name: "USD Coin",
976
- symbol: "USDC",
977
- decimals: 6
978
- }
979
- }, $e = {
980
- network: "eip155:10",
981
- asset: "0x0b2c639c533813f4aa9d7837caf62653d097ff85",
982
- metadata: {
983
- name: "USD Coin",
984
- symbol: "USDC",
985
- decimals: 6
986
- }
987
- }, Be = {
988
- network: "eip155:42161",
989
- asset: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
990
- metadata: {
991
- name: "USD Coin",
992
- symbol: "USDC",
993
- decimals: 6
994
- }
995
- }, Fe = {
996
- network: "eip155:137",
997
- asset: "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",
998
- metadata: {
999
- name: "USD Coin",
1000
- symbol: "USDC",
1001
- decimals: 6
1002
- }
1003
- }, We = {
1004
- network: "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
1005
- asset: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
1006
- metadata: {
1007
- name: "USD Coin",
1008
- symbol: "USDC",
1009
- decimals: 6
1010
- }
1011
- }, He = {
1012
- network: "eip155:1",
1013
- asset: "0xdAC17F958D2ee523a2206206994597C13D831ec7",
1014
- metadata: {
1015
- name: "Tether USD",
1016
- symbol: "USDT",
1017
- decimals: 6
1018
- }
1019
- }, Ke = {
1020
- network: "eip155:10",
1021
- asset: "0x94b008aA00579c1307B0EF2c499aD98a8ce58e58",
1022
- metadata: {
1023
- name: "Tether USD",
1024
- symbol: "USDT",
1025
- decimals: 6
1026
- }
1027
- }, je = {
1028
- network: "eip155:42161",
1029
- asset: "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",
1030
- metadata: {
1031
- name: "Tether USD",
1032
- symbol: "USDT",
1033
- decimals: 6
1034
- }
1035
- }, qe = {
1036
- network: "eip155:137",
1037
- asset: "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
1038
- metadata: {
1039
- name: "Tether USD",
1040
- symbol: "USDT",
1041
- decimals: 6
1042
- }
1043
- }, ze = {
1044
- network: "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
1045
- asset: "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB",
1046
- metadata: {
1047
- name: "Tether USD",
1048
- symbol: "USDT",
1049
- decimals: 6
1050
- }
1051
- }, Xe = {
1052
- network: "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
1053
- asset: "native",
1054
- metadata: {
1055
- name: "Solana",
1056
- symbol: "SOL",
1057
- decimals: 9
1058
- }
1059
- };
1060
- export {
1061
- I as W3mPayLoadingView,
1062
- y as W3mPayView,
1063
- Be as arbitrumUSDC,
1064
- je as arbitrumUSDT,
1065
- Me as baseETH,
1066
- Ge as baseSepoliaETH,
1067
- Ye as baseUSDC,
1068
- Ve as ethereumUSDC,
1069
- He as ethereumUSDT,
1070
- ve as getExchanges,
1071
- Le as getIsPaymentInProgress,
1072
- Oe as getPayError,
1073
- De as getPayResult,
1074
- he as openPay,
1075
- $e as optimismUSDC,
1076
- Ke as optimismUSDT,
1077
- Re as pay,
1078
- Fe as polygonUSDC,
1079
- qe as polygonUSDT,
1080
- Xe as solanaSOL,
1081
- We as solanaUSDC,
1082
- ze as solanaUSDT
1083
- };