@imtbl/checkout-widgets 2.10.3-alpha.0 → 2.10.4-alpha.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 (28) hide show
  1. package/dist/browser/{AddTokensWidget-Dfnd2VvT.js → AddTokensWidget-7xP3ash_.js} +24 -24
  2. package/dist/browser/{BridgeWidget-BM10WzmU.js → BridgeWidget-xF3mC-MN.js} +32 -32
  3. package/dist/browser/{CommerceWidget-Cz82zzFs.js → CommerceWidget-Dx44BFWy.js} +182 -182
  4. package/dist/browser/{FeesBreakdown-BsQ1oMQE.js → FeesBreakdown-Dy1ctSpO.js} +2 -2
  5. package/dist/browser/{OnRampWidget-cMjW2rIE.js → OnRampWidget-hWptERhu.js} +40 -26
  6. package/dist/browser/{SaleWidget-CU6ufFXx.js → SaleWidget-SueR-4Ck.js} +45 -45
  7. package/dist/browser/{SpendingCapHero-CELugT6p.js → SpendingCapHero-kPkYD5HR.js} +1 -1
  8. package/dist/browser/{SwapWidget-BrIskEwG.js → SwapWidget-B9Lgj2-6.js} +12 -12
  9. package/dist/browser/{TokenImage-BFM95uHq.js → TokenImage-C44Kn3Pq.js} +1 -1
  10. package/dist/browser/{TopUpView-h1VXHAgm.js → TopUpView-DZ6urV-T.js} +4 -4
  11. package/dist/browser/{WalletApproveHero-B2ON1dC3.js → WalletApproveHero-B3gMB-AI.js} +2 -2
  12. package/dist/browser/{WalletWidget-CReuAddE.js → WalletWidget-Cq1IwRPp.js} +11 -11
  13. package/dist/browser/{auto-track-C985jpFQ.js → auto-track-1sIh5Cg-.js} +1 -1
  14. package/dist/browser/{index-SmtxzcBz.js → index-BAjyTG-F.js} +1 -1
  15. package/dist/browser/{index-0LzWkrX3.js → index-BS6qjzzl.js} +1 -1
  16. package/dist/browser/{index-Co-HzKB-.js → index-BpeF_Hv4.js} +1 -1
  17. package/dist/browser/{index-BbuVyAAi.js → index-CJrC7v34.js} +1 -1
  18. package/dist/browser/{index-COUrrJgu.js → index-C_2UQ8ka.js} +2 -2
  19. package/dist/browser/{index-DEgS4sei.js → index-Cc4A5E_A.js} +1 -1
  20. package/dist/browser/{index-BJKKPxKK.js → index-DA9Xu4LZ.js} +1 -1
  21. package/dist/browser/{index-Dm7h0Kka.js → index-DFAGr0d5.js} +348 -338
  22. package/dist/browser/index.js +1 -1
  23. package/dist/browser/{index.umd-CDN3jaZ3.js → index.umd-BDwQTcot.js} +1 -1
  24. package/dist/browser/{useInterval-jAu1Whfi.js → useInterval-apxTIl_n.js} +1 -1
  25. package/dist/types/components/Transak/useTransakIframe.d.ts +5 -0
  26. package/package.json +7 -7
  27. package/src/components/Transak/useTransakIframe.ts +39 -12
  28. package/src/widgets/on-ramp/views/OnRampMain.tsx +56 -26
@@ -1,19 +1,19 @@
1
- import { o as oo, w as wo, n as no, g as go, a as ao, E as Eo, f as fo, i as io, R as Ro, s as so, C as Co, p as po, m as mo, c as co, T as To, I as Io, u as uo, r as reactExports, V as ViewActions, b as parseUnits, d as formatZeroAmount, e as calculateCryptoToFiat, h as Contract, j as ae, k as useTranslation, l as dist, q as getRemoteRive, t as tt, v as jsx, x as jsxs, B as Box, H as Heading, L as Link, y as Button, S as Stack, z as SimpleLayout, A as Body, D as useAnalytics, F as EventTargetContext, G as CryptoFiatContext, J as tokenValueFormat, K as getDefaultTokenImage, U as UserJourney, M as HeaderNavigation, N as sendCloseWidgetEvent, O as orchestrationEvents$1, P as amountInputValidation, Q as useTheme, W as CloudImage, X as getRemoteImage, Y as CryptoFiatProvider, Z as ConnectLoaderContext, _ as isAddress, $ as isError, a0 as LoadingView, a1 as CryptoFiatActions, a2 as useViewState, a3 as useEventTargetState, a4 as commerceFlows, a5 as SharedViews, a6 as ErrorView, a7 as ConnectWidget, a8 as ProvidersContextProvider, a9 as PurchaseWidget, aa as ConnectLoader, ab as ViewContextProvider } from './index-Dm7h0Kka.js';
2
- import { S as SelectInput, a as SwapWidget } from './SwapWidget-BrIskEwG.js';
3
- import { B as BridgeWidget } from './BridgeWidget-BM10WzmU.js';
4
- import OnRampWidget from './OnRampWidget-cMjW2rIE.js';
5
- import WalletWidget from './WalletWidget-CReuAddE.js';
6
- import SaleWidget from './SaleWidget-CU6ufFXx.js';
7
- import AddTokensWidget from './AddTokensWidget-Dfnd2VvT.js';
8
- import { g as getAllowedBalances, T as TextInputForm } from './WalletApproveHero-B2ON1dC3.js';
9
- import './useInterval-jAu1Whfi.js';
10
- import './TopUpView-h1VXHAgm.js';
11
- import './FeesBreakdown-BsQ1oMQE.js';
12
- import './SpendingCapHero-CELugT6p.js';
13
- import './TokenImage-BFM95uHq.js';
1
+ import { r as ro, A as Ao, o as oo, m as mo, n as no, f as fo, g as go, a as ao, E as Eo, i as io, R as Ro, l as lo, u as uo, s as so, C as Co, T as To, p as po, b as reactExports, V as ViewActions, c as parseUnits, d as formatZeroAmount, e as calculateCryptoToFiat, h as Contract, j as ie, k as useTranslation, q as dist, t as getRemoteRive, v as tt, w as jsx, x as jsxs, B as Box, H as Heading, L as Link, y as Button, S as Stack, z as SimpleLayout, D as Body, F as useAnalytics, G as EventTargetContext, I as CryptoFiatContext, J as tokenValueFormat, K as getDefaultTokenImage, U as UserJourney, M as HeaderNavigation, N as sendCloseWidgetEvent, O as orchestrationEvents$1, P as amountInputValidation, Q as useTheme, W as CloudImage, X as getRemoteImage, Y as CryptoFiatProvider, Z as ConnectLoaderContext, _ as isAddress, $ as isError, a0 as LoadingView, a1 as CryptoFiatActions, a2 as useViewState, a3 as useEventTargetState, a4 as commerceFlows, a5 as SharedViews, a6 as ErrorView, a7 as ConnectWidget, a8 as ProvidersContextProvider, a9 as PurchaseWidget, aa as ConnectLoader, ab as ViewContextProvider } from './index-DFAGr0d5.js';
2
+ import { S as SelectInput, a as SwapWidget } from './SwapWidget-B9Lgj2-6.js';
3
+ import { B as BridgeWidget } from './BridgeWidget-xF3mC-MN.js';
4
+ import OnRampWidget from './OnRampWidget-hWptERhu.js';
5
+ import WalletWidget from './WalletWidget-Cq1IwRPp.js';
6
+ import SaleWidget from './SaleWidget-SueR-4Ck.js';
7
+ import AddTokensWidget from './AddTokensWidget-7xP3ash_.js';
8
+ import { g as getAllowedBalances, T as TextInputForm } from './WalletApproveHero-B3gMB-AI.js';
9
+ import './useInterval-apxTIl_n.js';
10
+ import './TopUpView-DZ6urV-T.js';
11
+ import './FeesBreakdown-Dy1ctSpO.js';
12
+ import './SpendingCapHero-kPkYD5HR.js';
13
+ import './TokenImage-C44Kn3Pq.js';
14
14
 
15
15
  const sendCheckoutEvent = (eventTarget, detail) => {
16
- const event = new CustomEvent(oo.IMTBL_COMMERCE_WIDGET_EVENT, { detail });
16
+ const event = new CustomEvent(ro.IMTBL_COMMERCE_WIDGET_EVENT, { detail });
17
17
  // eslint-disable-next-line no-console
18
18
  console.log('checkout app event ', eventTarget, event);
19
19
  if (eventTarget !== undefined)
@@ -24,18 +24,18 @@ const sendCheckoutEvent = (eventTarget, detail) => {
24
24
  * List of views that require a connect loader wrapper
25
25
  */
26
26
  const connectLoaderFlows = [
27
- wo.SALE,
28
- wo.SWAP,
29
- wo.WALLET,
30
- wo.ONRAMP,
31
- wo.TRANSFER,
27
+ Ao.SALE,
28
+ Ao.SWAP,
29
+ Ao.WALLET,
30
+ Ao.ONRAMP,
31
+ Ao.TRANSFER,
32
32
  ];
33
33
  /**
34
34
  * List of views that require a providers context wrapper
35
35
  */
36
36
  const providersContextFlows = [
37
- wo.ADD_TOKENS,
38
- wo.PURCHASE,
37
+ Ao.ADD_TOKENS,
38
+ Ao.PURCHASE,
39
39
  ];
40
40
  /**
41
41
  * Check if the given view requires a connected wallet
@@ -56,25 +56,25 @@ function isProvidersContextFlow(view) {
56
56
  function mapConnectWidgetEvent(event) {
57
57
  const { type, data } = event.detail;
58
58
  switch (type) {
59
- case ao.SUCCESS:
59
+ case no.SUCCESS:
60
60
  return {
61
- type: go.SUCCESS,
61
+ type: mo.SUCCESS,
62
62
  data: {
63
- type: fo.CONNECT_SUCCESS,
63
+ type: go.CONNECT_SUCCESS,
64
64
  data,
65
65
  },
66
66
  };
67
- case ao.FAILURE:
67
+ case no.FAILURE:
68
68
  return {
69
- type: go.FAILURE,
69
+ type: mo.FAILURE,
70
70
  data: {
71
- type: Eo.CONNECT_FAILED,
71
+ type: fo.CONNECT_FAILED,
72
72
  data,
73
73
  },
74
74
  };
75
- case ao.CLOSE_WIDGET:
75
+ case no.CLOSE_WIDGET:
76
76
  return {
77
- type: go.CLOSE,
77
+ type: mo.CLOSE,
78
78
  data: {},
79
79
  };
80
80
  default:
@@ -87,22 +87,22 @@ function mapConnectWidgetEvent(event) {
87
87
  function mapWalletWidgetEvent(event) {
88
88
  const { type, data } = event.detail;
89
89
  switch (type) {
90
- case io.NETWORK_SWITCH:
90
+ case ao.NETWORK_SWITCH:
91
91
  return {
92
- type: go.USER_ACTION,
92
+ type: mo.USER_ACTION,
93
93
  data: {
94
- type: Ro.NETWORK_SWITCH,
94
+ type: Eo.NETWORK_SWITCH,
95
95
  data,
96
96
  },
97
97
  };
98
- case io.DISCONNECT_WALLET:
98
+ case ao.DISCONNECT_WALLET:
99
99
  return {
100
- type: go.DISCONNECTED,
100
+ type: mo.DISCONNECTED,
101
101
  data: {},
102
102
  };
103
- case io.CLOSE_WIDGET:
103
+ case ao.CLOSE_WIDGET:
104
104
  return {
105
- type: go.CLOSE,
105
+ type: mo.CLOSE,
106
106
  data: {},
107
107
  };
108
108
  default:
@@ -115,33 +115,33 @@ function mapWalletWidgetEvent(event) {
115
115
  function mapSwapWidgetEvent(event) {
116
116
  const { type, data } = event.detail;
117
117
  switch (type) {
118
- case so.SUCCESS:
118
+ case io.SUCCESS:
119
119
  return {
120
- type: go.SUCCESS,
120
+ type: mo.SUCCESS,
121
121
  data: {
122
- type: fo.SWAP_SUCCESS,
122
+ type: go.SWAP_SUCCESS,
123
123
  data,
124
124
  },
125
125
  };
126
- case so.FAILURE:
126
+ case io.FAILURE:
127
127
  return {
128
- type: go.FAILURE,
128
+ type: mo.FAILURE,
129
129
  data: {
130
- type: Eo.SWAP_FAILED,
130
+ type: fo.SWAP_FAILED,
131
131
  data,
132
132
  },
133
133
  };
134
- case so.REJECTED:
134
+ case io.REJECTED:
135
135
  return {
136
- type: go.FAILURE,
136
+ type: mo.FAILURE,
137
137
  data: {
138
- type: Eo.SWAP_REJECTED,
138
+ type: fo.SWAP_REJECTED,
139
139
  data,
140
140
  },
141
141
  };
142
- case so.CLOSE_WIDGET:
142
+ case io.CLOSE_WIDGET:
143
143
  return {
144
- type: go.CLOSE,
144
+ type: mo.CLOSE,
145
145
  data: {},
146
146
  };
147
147
  default:
@@ -154,33 +154,33 @@ function mapSwapWidgetEvent(event) {
154
154
  function mapAddTokensWidgetEvent(event) {
155
155
  const { type } = event.detail;
156
156
  switch (type) {
157
- case Co.SUCCESS:
157
+ case Ro.SUCCESS:
158
158
  return {
159
- type: go.SUCCESS,
159
+ type: mo.SUCCESS,
160
160
  data: {
161
- type: fo.ADD_TOKENS_SUCCESS,
161
+ type: go.ADD_TOKENS_SUCCESS,
162
162
  data: event.detail.data,
163
163
  },
164
164
  };
165
- case Co.CONNECT_SUCCESS:
165
+ case Ro.CONNECT_SUCCESS:
166
166
  return {
167
- type: go.SUCCESS,
167
+ type: mo.SUCCESS,
168
168
  data: {
169
- type: fo.ADD_TOKENS_CONNECT_SUCCESS,
169
+ type: go.ADD_TOKENS_CONNECT_SUCCESS,
170
170
  data: event.detail.data,
171
171
  },
172
172
  };
173
- case Co.FAILURE:
173
+ case Ro.FAILURE:
174
174
  return {
175
- type: go.FAILURE,
175
+ type: mo.FAILURE,
176
176
  data: {
177
- type: Eo.ADD_TOKENS_FAILED,
177
+ type: fo.ADD_TOKENS_FAILED,
178
178
  data: event.detail.data,
179
179
  },
180
180
  };
181
- case Co.CLOSE_WIDGET:
181
+ case Ro.CLOSE_WIDGET:
182
182
  return {
183
- type: go.CLOSE,
183
+ type: mo.CLOSE,
184
184
  data: {},
185
185
  };
186
186
  default:
@@ -193,41 +193,41 @@ function mapAddTokensWidgetEvent(event) {
193
193
  function mapBridgeWidgetEvent(event) {
194
194
  const { type, data } = event.detail;
195
195
  switch (type) {
196
- case po.TRANSACTION_SENT:
196
+ case lo.TRANSACTION_SENT:
197
197
  return {
198
- type: go.SUCCESS,
198
+ type: mo.SUCCESS,
199
199
  data: {
200
- type: fo.BRIDGE_SUCCESS,
200
+ type: go.BRIDGE_SUCCESS,
201
201
  data,
202
202
  },
203
203
  };
204
- case po.CLAIM_WITHDRAWAL_SUCCESS:
204
+ case lo.CLAIM_WITHDRAWAL_SUCCESS:
205
205
  return {
206
- type: go.SUCCESS,
206
+ type: mo.SUCCESS,
207
207
  data: {
208
- type: fo.BRIDGE_CLAIM_WITHDRAWAL_SUCCESS,
208
+ type: go.BRIDGE_CLAIM_WITHDRAWAL_SUCCESS,
209
209
  data,
210
210
  },
211
211
  };
212
- case po.CLAIM_WITHDRAWAL_FAILURE:
212
+ case lo.CLAIM_WITHDRAWAL_FAILURE:
213
213
  return {
214
- type: go.FAILURE,
214
+ type: mo.FAILURE,
215
215
  data: {
216
- type: Eo.BRIDGE_CLAIM_WITHDRAWAL_FAILED,
216
+ type: fo.BRIDGE_CLAIM_WITHDRAWAL_FAILED,
217
217
  data,
218
218
  },
219
219
  };
220
- case po.FAILURE:
220
+ case lo.FAILURE:
221
221
  return {
222
- type: go.FAILURE,
222
+ type: mo.FAILURE,
223
223
  data: {
224
- type: Eo.BRIDGE_FAILED,
224
+ type: fo.BRIDGE_FAILED,
225
225
  data,
226
226
  },
227
227
  };
228
- case po.CLOSE_WIDGET:
228
+ case lo.CLOSE_WIDGET:
229
229
  return {
230
- type: go.CLOSE,
230
+ type: mo.CLOSE,
231
231
  data: {},
232
232
  };
233
233
  default:
@@ -240,25 +240,25 @@ function mapBridgeWidgetEvent(event) {
240
240
  function mapOnrampWidgetEvent(event) {
241
241
  const { type, data } = event.detail;
242
242
  switch (type) {
243
- case mo.SUCCESS:
243
+ case uo.SUCCESS:
244
244
  return {
245
- type: go.SUCCESS,
245
+ type: mo.SUCCESS,
246
246
  data: {
247
- type: fo.ONRAMP_SUCCESS,
247
+ type: go.ONRAMP_SUCCESS,
248
248
  data,
249
249
  },
250
250
  };
251
- case mo.FAILURE:
251
+ case uo.FAILURE:
252
252
  return {
253
- type: go.FAILURE,
253
+ type: mo.FAILURE,
254
254
  data: {
255
- type: Eo.ONRAMP_FAILED,
255
+ type: fo.ONRAMP_FAILED,
256
256
  data,
257
257
  },
258
258
  };
259
- case mo.CLOSE_WIDGET:
259
+ case uo.CLOSE_WIDGET:
260
260
  return {
261
- type: go.CLOSE,
261
+ type: mo.CLOSE,
262
262
  data: {},
263
263
  };
264
264
  default:
@@ -268,48 +268,48 @@ function mapOnrampWidgetEvent(event) {
268
268
  function mapSaleWidgetEvent(event) {
269
269
  const { type, data } = event.detail;
270
270
  switch (type) {
271
- case co.SUCCESS:
271
+ case so.SUCCESS:
272
272
  return {
273
- type: go.SUCCESS,
273
+ type: mo.SUCCESS,
274
274
  data: {
275
- type: fo.SALE_SUCCESS,
275
+ type: go.SALE_SUCCESS,
276
276
  data,
277
277
  },
278
278
  };
279
- case co.FAILURE:
279
+ case so.FAILURE:
280
280
  return {
281
- type: go.FAILURE,
281
+ type: mo.FAILURE,
282
282
  data: {
283
- type: Eo.SALE_FAILED,
283
+ type: fo.SALE_FAILED,
284
284
  data,
285
285
  },
286
286
  };
287
- case co.CLOSE_WIDGET:
287
+ case so.CLOSE_WIDGET:
288
288
  return {
289
- type: go.CLOSE,
289
+ type: mo.CLOSE,
290
290
  data: {},
291
291
  };
292
- case co.TRANSACTION_SUCCESS:
292
+ case so.TRANSACTION_SUCCESS:
293
293
  return {
294
- type: go.SUCCESS,
294
+ type: mo.SUCCESS,
295
295
  data: {
296
- type: fo.SALE_TRANSACTION_SUCCESS,
296
+ type: go.SALE_TRANSACTION_SUCCESS,
297
297
  data,
298
298
  },
299
299
  };
300
- case co.PAYMENT_METHOD:
300
+ case so.PAYMENT_METHOD:
301
301
  return {
302
- type: go.USER_ACTION,
302
+ type: mo.USER_ACTION,
303
303
  data: {
304
- type: Ro.PAYMENT_METHOD_SELECTED,
304
+ type: Eo.PAYMENT_METHOD_SELECTED,
305
305
  data,
306
306
  },
307
307
  };
308
- case co.PAYMENT_TOKEN:
308
+ case so.PAYMENT_TOKEN:
309
309
  return {
310
- type: go.USER_ACTION,
310
+ type: mo.USER_ACTION,
311
311
  data: {
312
- type: Ro.PAYMENT_TOKEN_SELECTED,
312
+ type: Eo.PAYMENT_TOKEN_SELECTED,
313
313
  data,
314
314
  },
315
315
  };
@@ -320,25 +320,25 @@ function mapSaleWidgetEvent(event) {
320
320
  function mapPurchaseWidgetEvent(event) {
321
321
  const { type, data } = event.detail;
322
322
  switch (type) {
323
- case To.SUCCESS:
323
+ case Co.SUCCESS:
324
324
  return {
325
- type: go.SUCCESS,
325
+ type: mo.SUCCESS,
326
326
  data: {
327
- type: fo.SALE_SUCCESS,
327
+ type: go.SALE_SUCCESS,
328
328
  data,
329
329
  },
330
330
  };
331
- case To.FAILURE:
331
+ case Co.FAILURE:
332
332
  return {
333
- type: go.FAILURE,
333
+ type: mo.FAILURE,
334
334
  data: {
335
- type: Eo.SALE_FAILED,
335
+ type: fo.SALE_FAILED,
336
336
  data,
337
337
  },
338
338
  };
339
- case To.CLOSE_WIDGET:
339
+ case Co.CLOSE_WIDGET:
340
340
  return {
341
- type: go.CLOSE,
341
+ type: mo.CLOSE,
342
342
  data: {},
343
343
  };
344
344
  default:
@@ -351,25 +351,25 @@ function mapPurchaseWidgetEvent(event) {
351
351
  function mapTransferWidgetEvent(event) {
352
352
  const { type, data } = event.detail;
353
353
  switch (type) {
354
- case Io.SUCCESS:
354
+ case To.SUCCESS:
355
355
  return {
356
- type: go.SUCCESS,
356
+ type: mo.SUCCESS,
357
357
  data: {
358
- type: fo.TRANSFER_SUCCESS,
358
+ type: go.TRANSFER_SUCCESS,
359
359
  data,
360
360
  },
361
361
  };
362
- case Io.FAILURE:
362
+ case To.FAILURE:
363
363
  return {
364
- type: go.FAILURE,
364
+ type: mo.FAILURE,
365
365
  data: {
366
- type: Eo.TRANSFER_FAILED,
366
+ type: fo.TRANSFER_FAILED,
367
367
  data,
368
368
  },
369
369
  };
370
- case Io.CLOSE_WIDGET:
370
+ case To.CLOSE_WIDGET:
371
371
  return {
372
- type: go.CLOSE,
372
+ type: mo.CLOSE,
373
373
  data: {},
374
374
  };
375
375
  default:
@@ -380,30 +380,30 @@ function mapTransferWidgetEvent(event) {
380
380
  * Map widget events to commerce widget event detail
381
381
  */
382
382
  function getCommerceWidgetEvent(event) {
383
- if (event.detail.type === no.PROVIDER_UPDATED) {
383
+ if (event.detail.type === oo.PROVIDER_UPDATED) {
384
384
  return {
385
- type: go.PROVIDER_UPDATED,
385
+ type: mo.PROVIDER_UPDATED,
386
386
  data: event.detail.data,
387
387
  };
388
388
  }
389
389
  switch (event.type) {
390
- case oo.IMTBL_CONNECT_WIDGET_EVENT:
390
+ case ro.IMTBL_CONNECT_WIDGET_EVENT:
391
391
  return mapConnectWidgetEvent(event);
392
- case oo.IMTBL_WALLET_WIDGET_EVENT:
392
+ case ro.IMTBL_WALLET_WIDGET_EVENT:
393
393
  return mapWalletWidgetEvent(event);
394
- case oo.IMTBL_SWAP_WIDGET_EVENT:
394
+ case ro.IMTBL_SWAP_WIDGET_EVENT:
395
395
  return mapSwapWidgetEvent(event);
396
- case oo.IMTBL_ADD_TOKENS_WIDGET_EVENT:
396
+ case ro.IMTBL_ADD_TOKENS_WIDGET_EVENT:
397
397
  return mapAddTokensWidgetEvent(event);
398
- case oo.IMTBL_BRIDGE_WIDGET_EVENT:
398
+ case ro.IMTBL_BRIDGE_WIDGET_EVENT:
399
399
  return mapBridgeWidgetEvent(event);
400
- case oo.IMTBL_ONRAMP_WIDGET_EVENT:
400
+ case ro.IMTBL_ONRAMP_WIDGET_EVENT:
401
401
  return mapOnrampWidgetEvent(event);
402
- case oo.IMTBL_SALE_WIDGET_EVENT:
402
+ case ro.IMTBL_SALE_WIDGET_EVENT:
403
403
  return mapSaleWidgetEvent(event);
404
- case oo.IMTBL_PURCHASE_WIDGET_EVENT:
404
+ case ro.IMTBL_PURCHASE_WIDGET_EVENT:
405
405
  return mapPurchaseWidgetEvent(event);
406
- case oo.IMTBL_TRANSFER_WIDGET_EVENT:
406
+ case ro.IMTBL_TRANSFER_WIDGET_EVENT:
407
407
  return mapTransferWidgetEvent(event);
408
408
  default:
409
409
  throw new Error(`Unknown widget event type "${event.type}"`);
@@ -415,20 +415,20 @@ function getCommerceWidgetEvent(event) {
415
415
  */
416
416
  function getViewFromOrchestrationEventType(type) {
417
417
  switch (type) {
418
- case uo.REQUEST_SWAP:
419
- return wo.SWAP;
420
- case uo.REQUEST_CONNECT:
421
- return wo.CONNECT;
422
- case uo.REQUEST_WALLET:
423
- return wo.WALLET;
424
- case uo.REQUEST_BRIDGE:
425
- return wo.BRIDGE;
426
- case uo.REQUEST_ONRAMP:
427
- return wo.ONRAMP;
428
- case uo.REQUEST_ADD_TOKENS:
429
- return wo.ADD_TOKENS;
430
- case uo.REQUEST_PURCHASE:
431
- return wo.PURCHASE;
418
+ case po.REQUEST_SWAP:
419
+ return Ao.SWAP;
420
+ case po.REQUEST_CONNECT:
421
+ return Ao.CONNECT;
422
+ case po.REQUEST_WALLET:
423
+ return Ao.WALLET;
424
+ case po.REQUEST_BRIDGE:
425
+ return Ao.BRIDGE;
426
+ case po.REQUEST_ONRAMP:
427
+ return Ao.ONRAMP;
428
+ case po.REQUEST_ADD_TOKENS:
429
+ return Ao.ADD_TOKENS;
430
+ case po.REQUEST_PURCHASE:
431
+ return Ao.PURCHASE;
432
432
  default:
433
433
  return null;
434
434
  }
@@ -436,14 +436,14 @@ function getViewFromOrchestrationEventType(type) {
436
436
 
437
437
  /** Orchestration Events List */
438
438
  const orchestrationEvents = [
439
- uo.REQUEST_CONNECT,
440
- uo.REQUEST_WALLET,
441
- uo.REQUEST_SWAP,
442
- uo.REQUEST_BRIDGE,
443
- uo.REQUEST_ONRAMP,
444
- uo.REQUEST_ADD_TOKENS,
445
- uo.REQUEST_PURCHASE,
446
- uo.REQUEST_GO_BACK,
439
+ po.REQUEST_CONNECT,
440
+ po.REQUEST_WALLET,
441
+ po.REQUEST_SWAP,
442
+ po.REQUEST_BRIDGE,
443
+ po.REQUEST_ONRAMP,
444
+ po.REQUEST_ADD_TOKENS,
445
+ po.REQUEST_PURCHASE,
446
+ po.REQUEST_GO_BACK,
447
447
  ];
448
448
  /**
449
449
  * Check if event is orchestration event
@@ -454,15 +454,15 @@ function isOrchestrationEvent(event) {
454
454
 
455
455
  /** Widget Events List */
456
456
  const widgetEvents = [
457
- oo.IMTBL_CONNECT_WIDGET_EVENT,
458
- oo.IMTBL_WALLET_WIDGET_EVENT,
459
- oo.IMTBL_SWAP_WIDGET_EVENT,
460
- oo.IMTBL_BRIDGE_WIDGET_EVENT,
461
- oo.IMTBL_ONRAMP_WIDGET_EVENT,
462
- oo.IMTBL_SALE_WIDGET_EVENT,
463
- oo.IMTBL_ADD_TOKENS_WIDGET_EVENT,
464
- oo.IMTBL_PURCHASE_WIDGET_EVENT,
465
- oo.IMTBL_TRANSFER_WIDGET_EVENT,
457
+ ro.IMTBL_CONNECT_WIDGET_EVENT,
458
+ ro.IMTBL_WALLET_WIDGET_EVENT,
459
+ ro.IMTBL_SWAP_WIDGET_EVENT,
460
+ ro.IMTBL_BRIDGE_WIDGET_EVENT,
461
+ ro.IMTBL_ONRAMP_WIDGET_EVENT,
462
+ ro.IMTBL_SALE_WIDGET_EVENT,
463
+ ro.IMTBL_ADD_TOKENS_WIDGET_EVENT,
464
+ ro.IMTBL_PURCHASE_WIDGET_EVENT,
465
+ ro.IMTBL_TRANSFER_WIDGET_EVENT,
466
466
  ];
467
467
  /**
468
468
  * Subscribe and Handle widget events
@@ -474,7 +474,7 @@ function useWidgetEvents(eventTarget, viewState, handleProviderUpdated) {
474
474
  */
475
475
  const handleOrchestrationEvent = (event) => {
476
476
  const { type, data } = event.detail;
477
- if (type === uo.REQUEST_GO_BACK) {
477
+ if (type === po.REQUEST_GO_BACK) {
478
478
  viewDispatch({
479
479
  payload: {
480
480
  type: ViewActions.UPDATE_VIEW,
@@ -483,7 +483,7 @@ function useWidgetEvents(eventTarget, viewState, handleProviderUpdated) {
483
483
  });
484
484
  return;
485
485
  }
486
- if (type === uo.REQUEST_ONRAMP) {
486
+ if (type === po.REQUEST_ONRAMP) {
487
487
  const onRampEvent = data;
488
488
  if (onRampEvent.provider) {
489
489
  handleProviderUpdated(onRampEvent.provider);
@@ -517,7 +517,7 @@ function useWidgetEvents(eventTarget, viewState, handleProviderUpdated) {
517
517
  // ignore walletconnect provider updated event on CONNECT
518
518
  // as that is not really consumed and the provider is available to the consumer on success event
519
519
  // GFI-596
520
- const isConnectProviderUpdatedEvent = customEvent.detail.type === ao.WALLETCONNECT_PROVIDER_UPDATED;
520
+ const isConnectProviderUpdatedEvent = customEvent.detail.type === no.WALLETCONNECT_PROVIDER_UPDATED;
521
521
  if (isConnectProviderUpdatedEvent) {
522
522
  return;
523
523
  }
@@ -541,7 +541,7 @@ function useWidgetEvents(eventTarget, viewState, handleProviderUpdated) {
541
541
  function getConnectLoaderParams(view, flowConfig, checkout, browserProvider) {
542
542
  const { type } = view;
543
543
  switch (type) {
544
- case wo.WALLET:
544
+ case Ao.WALLET:
545
545
  return {
546
546
  checkout,
547
547
  browserProvider,
@@ -553,8 +553,8 @@ function getConnectLoaderParams(view, flowConfig, checkout, browserProvider) {
553
553
  allowlistWalletRdns: flowConfig.CONNECT?.allowlistWalletRdns,
554
554
  walletProviderName: undefined,
555
555
  };
556
- case wo.ONRAMP:
557
- case wo.ADD_TOKENS:
556
+ case Ao.ONRAMP:
557
+ case Ao.ADD_TOKENS:
558
558
  return {
559
559
  checkout,
560
560
  browserProvider,
@@ -566,9 +566,9 @@ function getConnectLoaderParams(view, flowConfig, checkout, browserProvider) {
566
566
  allowlistWalletRdns: flowConfig.CONNECT?.allowlistWalletRdns,
567
567
  walletProviderName: undefined,
568
568
  };
569
- case wo.SALE:
570
- case wo.SWAP:
571
- case wo.TRANSFER:
569
+ case Ao.SALE:
570
+ case Ao.SWAP:
571
+ case Ao.TRANSFER:
572
572
  return {
573
573
  checkout,
574
574
  browserProvider,
@@ -650,7 +650,7 @@ const loadBalances = async (checkout, provider) => {
650
650
  const result = await getAllowedBalances({
651
651
  checkout,
652
652
  provider,
653
- allowTokenListType: ae.ALL,
653
+ allowTokenListType: ie.ALL,
654
654
  });
655
655
  if (!result)
656
656
  throw new Error('Failed to load balances');
@@ -780,7 +780,7 @@ function TransferForm({ config, viewState, setViewState, onSend, showBackButton,
780
780
  }, [token, t]);
781
781
  const isButtonDisabled = reactExports.useMemo(() => !viewState.amount || !viewState.toAddress || !token, [viewState.amount, viewState.toAddress, token]);
782
782
  return (jsx(SimpleLayout, { header: showHeader ? (jsx(HeaderNavigation, { title: title, onCloseButtonClick: () => sendCloseWidgetEvent(eventTarget), showBack: showBackButton, onBackButtonClick: () => {
783
- orchestrationEvents$1.sendRequestGoBackEvent(eventTarget, oo.IMTBL_TRANSFER_WIDGET_EVENT, {});
783
+ orchestrationEvents$1.sendRequestGoBackEvent(eventTarget, ro.IMTBL_TRANSFER_WIDGET_EVENT, {});
784
784
  } })) : undefined, children: jsxs(Stack, { justifyContent: "space-between", sx: {
785
785
  height: '100%',
786
786
  mt: 'base.spacing.x6',
@@ -790,9 +790,9 @@ function TransferForm({ config, viewState, setViewState, onSend, showBackButton,
790
790
  }
791
791
 
792
792
  const sendSuccessEvent = (eventTarget, transactionHash) => {
793
- const successEvent = new CustomEvent(oo.IMTBL_TRANSFER_WIDGET_EVENT, {
793
+ const successEvent = new CustomEvent(ro.IMTBL_TRANSFER_WIDGET_EVENT, {
794
794
  detail: {
795
- type: Io.SUCCESS,
795
+ type: To.SUCCESS,
796
796
  data: {
797
797
  transactionHash,
798
798
  },
@@ -804,9 +804,9 @@ const sendSuccessEvent = (eventTarget, transactionHash) => {
804
804
  eventTarget.dispatchEvent(successEvent);
805
805
  };
806
806
  const sendFailedEvent = (eventTarget, reason) => {
807
- const failedEvent = new CustomEvent(oo.IMTBL_TRANSFER_WIDGET_EVENT, {
807
+ const failedEvent = new CustomEvent(ro.IMTBL_TRANSFER_WIDGET_EVENT, {
808
808
  detail: {
809
- type: Io.FAILURE,
809
+ type: To.FAILURE,
810
810
  data: {
811
811
  reason,
812
812
  timestamp: new Date().getTime(),
@@ -819,9 +819,9 @@ const sendFailedEvent = (eventTarget, reason) => {
819
819
  eventTarget.dispatchEvent(failedEvent);
820
820
  };
821
821
  const sendRejectedEvent = (eventTarget, reason) => {
822
- const rejectedEvent = new CustomEvent(oo.IMTBL_TRANSFER_WIDGET_EVENT, {
822
+ const rejectedEvent = new CustomEvent(ro.IMTBL_TRANSFER_WIDGET_EVENT, {
823
823
  detail: {
824
- type: Io.REJECTED,
824
+ type: To.REJECTED,
825
825
  data: {
826
826
  reason,
827
827
  timestamp: new Date().getTime(),
@@ -998,8 +998,8 @@ function CommerceWidget(props) {
998
998
  const commerceReducerValues = reactExports.useMemo(() => ({ commerceState, commerceDispatch }), [commerceState, commerceDispatch]);
999
999
  const { provider } = commerceState;
1000
1000
  const connectLoaderParams = reactExports.useMemo(() => getConnectLoaderParams(view, flowConfig, checkout, provider || browserProvider), [view, flowConfig, checkout, provider, browserProvider]);
1001
- const connectLoaderSuccessEvent = (flowParams.flow === wo.ADD_TOKENS
1002
- || flowParams.flow === wo.PURCHASE) ? () => { } : undefined;
1001
+ const connectLoaderSuccessEvent = (flowParams.flow === Ao.ADD_TOKENS
1002
+ || flowParams.flow === Ao.PURCHASE) ? () => { } : undefined;
1003
1003
  const goToPreviousView = reactExports.useCallback(() => {
1004
1004
  const sharedViews = [
1005
1005
  SharedViews.LOADING_VIEW,
@@ -1097,28 +1097,28 @@ function CommerceWidget(props) {
1097
1097
  const showBackButton = !!view.data?.showBackButton;
1098
1098
  return (jsx(ViewContextProvider, { children: jsxs(CommerceContext.Provider, { value: commerceReducerValues, children: [view.type === SharedViews.LOADING_VIEW && (jsx(LoadingView, { loadingText: t('views.LOADING_VIEW.text') })), view.type === SharedViews.ERROR_VIEW && (jsx(ErrorView, { onCloseClick: () => {
1099
1099
  sendCheckoutEvent(eventTarget, {
1100
- type: go.CLOSE,
1100
+ type: mo.CLOSE,
1101
1101
  data: {},
1102
1102
  });
1103
1103
  }, onActionClick: () => {
1104
1104
  // TODO: trigger a retry
1105
- }, actionText: t('views.ERROR_VIEW.actionText') })), view.type === wo.CONNECT && (jsx(ConnectWidget, { config: widgetsConfig, checkout: checkout, sendCloseEventOverride: () => {
1105
+ }, actionText: t('views.ERROR_VIEW.actionText') })), view.type === Ao.CONNECT && (jsx(ConnectWidget, { config: widgetsConfig, checkout: checkout, sendCloseEventOverride: () => {
1106
1106
  sendCheckoutEvent(eventTarget, {
1107
- type: go.CLOSE,
1107
+ type: mo.CLOSE,
1108
1108
  data: {},
1109
1109
  });
1110
- }, ...(view.data.params || {}) })), view.type === wo.BRIDGE && (jsx(BridgeWidget, { config: widgetsConfig, checkout: checkout, browserProvider: browserProvider, showBackButton: showBackButton, ...(view.data.params || {}) })), shouldWrapWithProvidersContext && view.type === wo.ADD_TOKENS && (jsx(ProvidersContextProvider, { initialState: { checkout, toProvider: view.data.params.toProvider }, children: jsx(AddTokensWidget, { config: widgetsConfig, ...(view.data.params || {}), ...(view.data.config || {}), showBackButton: showBackButton }) })), shouldWrapWithProvidersContext && view.type === wo.PURCHASE && (jsx(ProvidersContextProvider, { initialState: { checkout }, children: jsx(PurchaseWidget, { config: widgetsConfig, ...(view.data.params || {}), ...(view.data.config || {}), showBackButton: showBackButton }) })), shouldWrapWithConnectLoader && (jsx(ConnectLoader, { widgetConfig: widgetsConfig, params: connectLoaderParams, successEvent: connectLoaderSuccessEvent, closeEvent: () => {
1110
+ }, ...(view.data.params || {}) })), view.type === Ao.BRIDGE && (jsx(BridgeWidget, { config: widgetsConfig, checkout: checkout, browserProvider: browserProvider, showBackButton: showBackButton, ...(view.data.params || {}) })), shouldWrapWithProvidersContext && view.type === Ao.ADD_TOKENS && (jsx(ProvidersContextProvider, { initialState: { checkout, toProvider: view.data.params.toProvider }, children: jsx(AddTokensWidget, { config: widgetsConfig, ...(view.data.params || {}), ...(view.data.config || {}), showBackButton: showBackButton }) })), shouldWrapWithProvidersContext && view.type === Ao.PURCHASE && (jsx(ProvidersContextProvider, { initialState: { checkout }, children: jsx(PurchaseWidget, { config: widgetsConfig, ...(view.data.params || {}), ...(view.data.config || {}), showBackButton: showBackButton }) })), shouldWrapWithConnectLoader && (jsx(ConnectLoader, { widgetConfig: widgetsConfig, params: connectLoaderParams, successEvent: connectLoaderSuccessEvent, closeEvent: () => {
1111
1111
  sendCheckoutEvent(eventTarget, {
1112
- type: go.CLOSE,
1112
+ type: mo.CLOSE,
1113
1113
  data: {},
1114
1114
  });
1115
- }, showBackButton: showBackButton, goBackEvent: goToPreviousView, children: jsxs(reactExports.Suspense, { fallback: jsx(LoadingView, { loadingText: t('views.LOADING_VIEW.text') }), children: [view.type === wo.WALLET && (jsx(WalletWidget, { config: widgetsConfig, walletConfig: {
1115
+ }, showBackButton: showBackButton, goBackEvent: goToPreviousView, children: jsxs(reactExports.Suspense, { fallback: jsx(LoadingView, { loadingText: t('views.LOADING_VIEW.text') }), children: [view.type === Ao.WALLET && (jsx(WalletWidget, { config: widgetsConfig, walletConfig: {
1116
1116
  showNetworkMenu: true,
1117
1117
  showDisconnectButton: true,
1118
1118
  ...view.data.config,
1119
- }, ...(view.data.params || {}) })), view.type === wo.SALE && (jsx(SaleWidget, { config: widgetsConfig, ...(view.data.params || {}), hideExcludedPaymentTypes: false,
1119
+ }, ...(view.data.params || {}) })), view.type === Ao.SALE && (jsx(SaleWidget, { config: widgetsConfig, ...(view.data.params || {}), hideExcludedPaymentTypes: false,
1120
1120
  waitFulfillmentSettlements: true,
1121
- ...view.data.config })), view.type === wo.SWAP && (jsx(SwapWidget, { config: widgetsConfig, swapConfig: view.data.config, ...(view.data.params || {}), showBackButton: showBackButton })), view.type === wo.ONRAMP && (jsx(OnRampWidget, { config: widgetsConfig, ...(view.data.params || {}), onrampConfig: view.data.config, showBackButton: showBackButton })), view.type === wo.TRANSFER && (jsx(TransferWidget, { config: widgetsConfig, transferConfig: view.data.config, ...(view.data.params || {}), showBackButton: showBackButton }))] }) }))] }) }));
1121
+ ...view.data.config })), view.type === Ao.SWAP && (jsx(SwapWidget, { config: widgetsConfig, swapConfig: view.data.config, ...(view.data.params || {}), showBackButton: showBackButton })), view.type === Ao.ONRAMP && (jsx(OnRampWidget, { config: widgetsConfig, ...(view.data.params || {}), onrampConfig: view.data.config, showBackButton: showBackButton })), view.type === Ao.TRANSFER && (jsx(TransferWidget, { config: widgetsConfig, transferConfig: view.data.config, ...(view.data.params || {}), showBackButton: showBackButton }))] }) }))] }) }));
1122
1122
  }
1123
1123
 
1124
1124
  export { CommerceWidget as default };