@rango-dev/widget-embedded 0.1.10-next.84 → 0.1.10-next.87

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 (43) hide show
  1. package/dist/App.d.ts.map +1 -1
  2. package/dist/QueueManager.d.ts +4 -0
  3. package/dist/QueueManager.d.ts.map +1 -0
  4. package/dist/components/AppRoutes.d.ts.map +1 -1
  5. package/dist/components/HeaderButtons.d.ts.map +1 -1
  6. package/dist/components/UpdateUrl.d.ts.map +1 -1
  7. package/dist/constants/navigationRoutes.d.ts +1 -1
  8. package/dist/hooks/useCopyToClipboard.d.ts +2 -0
  9. package/dist/hooks/useCopyToClipboard.d.ts.map +1 -0
  10. package/dist/hooks/useNavigateBack.d.ts.map +1 -1
  11. package/dist/pages/ConfirmSwapPage.d.ts.map +1 -1
  12. package/dist/pages/ConfirmWalletsPage.d.ts.map +1 -1
  13. package/dist/pages/HistoryPage.d.ts +0 -2
  14. package/dist/pages/HistoryPage.d.ts.map +1 -1
  15. package/dist/pages/SwapDetailsPage.d.ts.map +1 -1
  16. package/dist/store/confirmSwap.d.ts +2 -1
  17. package/dist/store/confirmSwap.d.ts.map +1 -1
  18. package/dist/store/ui.d.ts.map +1 -1
  19. package/dist/utils/queue.d.ts +4 -0
  20. package/dist/utils/queue.d.ts.map +1 -0
  21. package/dist/widget-embedded.cjs.development.js +154 -1132
  22. package/dist/widget-embedded.cjs.development.js.map +1 -1
  23. package/dist/widget-embedded.cjs.production.min.js +154 -1132
  24. package/dist/widget-embedded.cjs.production.min.js.map +1 -1
  25. package/dist/widget-embedded.esm.js +155 -1133
  26. package/dist/widget-embedded.esm.js.map +1 -1
  27. package/package.json +10 -5
  28. package/src/App.tsx +35 -12
  29. package/src/QueueManager.tsx +93 -0
  30. package/src/components/AppRoutes.tsx +5 -2
  31. package/src/components/HeaderButtons.tsx +17 -4
  32. package/src/components/UpdateUrl.tsx +15 -11
  33. package/src/constants/navigationRoutes.ts +2 -2
  34. package/src/hooks/useCopyToClipboard.ts +23 -0
  35. package/src/hooks/useNavigateBack.ts +7 -4
  36. package/src/pages/ConfirmSwapPage.tsx +17 -4
  37. package/src/pages/ConfirmWalletsPage.tsx +3 -1
  38. package/src/pages/HistoryPage.tsx +15 -822
  39. package/src/pages/Home.tsx +1 -1
  40. package/src/pages/SwapDetailsPage.tsx +21 -3
  41. package/src/store/confirmSwap.ts +24 -9
  42. package/src/store/ui.ts +8 -2
  43. package/src/utils/queue.ts +24 -0
@@ -1,836 +1,29 @@
1
1
  import { History } from '@rango-dev/ui';
2
- import { PendingSwap } from '@rango-dev/ui/dist/containers/History/types';
3
- import { TransactionType } from 'rango-sdk';
2
+ import { useManager } from '@rango-dev/queue-manager-react';
4
3
  import React from 'react';
5
4
  import { useNavigate } from 'react-router-dom';
6
5
  import { navigationRoutes } from '../constants/navigationRoutes';
7
6
  import { useNavigateBack } from '../hooks/useNavigateBack';
8
-
9
- export const pendingSwap: PendingSwap[] = [
10
- {
11
- creationTime: '1673164511955',
12
- finishTime: '1673164550137',
13
- requestId: '51e211d9-d61c-45d2-a4d4-1f9f7f90ee85',
14
- inputAmount: '1',
15
- wallets: {
16
- OSMOSIS: {
17
- walletType: 'keplr',
18
- address: 'osmo1unf2rcytjxfpz8x8ar63h4qeftadptg5t0nqcl',
19
- },
20
- },
21
- status: 'running',
22
- isPaused: false,
23
- extraMessage: null,
24
- extraMessageSeverity: 'info',
25
- extraMessageDetail: '',
26
- extraMessageErrorCode: null,
27
- networkStatusExtraMessage: null,
28
- networkStatusExtraMessageDetail: null,
29
- lastNotificationTime: null,
30
- settings: {
31
- slippage: '1.0',
32
- disabledSwappersIds: [],
33
- disabledSwappersGroups: [],
34
- },
35
- simulationResult: {
36
- outputAmount: '1.540670',
37
- swaps: [
38
- {
39
- swapperId: 'Osmosis',
40
- swapperType: 'DEX',
41
- swapperLogo: '',
42
- // @ts-ignore
43
- result: null,
44
- from: {
45
- symbol: 'JUNO',
46
- logo: 'https://api.rango.exchange/tokens/COSMOS/JUNO.png',
47
- address:
48
- 'ibc/46b44899322f3cd854d2d46deef881958467cdd4b3b10086da49296bbed94bed',
49
- blockchain: 'OSMOSIS',
50
- blockchainLogo: '',
51
- decimals: 6,
52
- usdPrice: 1.1091996179668873,
53
- },
54
- to: {
55
- symbol: 'OSMO',
56
- logo: 'https://api.rango.exchange/i/mJQPS2',
57
- address: null,
58
- blockchain: 'OSMOSIS',
59
- decimals: 6,
60
- blockchainLogo: '',
61
- usdPrice: 0.7192435454440882,
62
- },
63
- fromAmount: '1.000000',
64
- fromAmountPrecision: null,
65
- fromAmountMinValue: null,
66
- fromAmountMaxValue: null,
67
- toAmount: '1.540670',
68
- fee: [
69
- {
70
- name: '',
71
- asset: {
72
- blockchain: 'OSMOSIS',
73
- symbol: 'OSMO',
74
- address: null,
75
- },
76
- expenseType: 'FROM_SOURCE_WALLET',
77
- amount: '0',
78
- },
79
- ],
80
- estimatedTimeInSeconds: 45,
81
- swapChainType: 'INTRA_CHAIN',
82
- routes: [
83
- {
84
- nodes: [
85
- {
86
- nodes: [
87
- {
88
- marketName: 'pool#498',
89
- marketId: null,
90
- percent: 1,
91
- },
92
- ],
93
- from: 'JUNO',
94
- fromLogo: 'https://api.rango.exchange/tokens/COSMOS/JUNO.png',
95
- fromAddress:
96
- 'ibc/46b44899322f3cd854d2d46deef881958467cdd4b3b10086da49296bbed94bed',
97
- fromBlockchain: 'OSMOSIS',
98
- to: 'ATOM',
99
- toLogo: 'https://api.rango.exchange/tokens/COSMOS/ATOM.png',
100
- toAddress:
101
- 'ibc/27394fb092d2eccd56123c74f36e4c1f926001ceada9ca97ea622b25f41e5eb2',
102
- toBlockchain: 'OSMOSIS',
103
- },
104
- {
105
- nodes: [
106
- {
107
- marketName: 'pool#8',
108
- marketId: null,
109
- percent: 1,
110
- },
111
- ],
112
- from: 'ATOM',
113
- fromLogo: 'https://api.rango.exchange/tokens/COSMOS/ATOM.png',
114
- fromAddress:
115
- 'ibc/27394fb092d2eccd56123c74f36e4c1f926001ceada9ca97ea622b25f41e5eb2',
116
- fromBlockchain: 'OSMOSIS',
117
- to: 'IRIS',
118
- toLogo: 'https://api.rango.exchange/tokens/COSMOS/IRIS.png',
119
- toAddress:
120
- 'ibc/7c4d60aa95e5a7558b0a364860979ca34b7ff8aaf255b87af9e879374470cec0',
121
- toBlockchain: 'OSMOSIS',
122
- },
123
- {
124
- nodes: [
125
- {
126
- marketName: 'pool#7',
127
- marketId: null,
128
- percent: 1,
129
- },
130
- ],
131
- from: 'IRIS',
132
- fromLogo: 'https://api.rango.exchange/tokens/COSMOS/IRIS.png',
133
- fromAddress:
134
- 'ibc/7c4d60aa95e5a7558b0a364860979ca34b7ff8aaf255b87af9e879374470cec0',
135
- fromBlockchain: 'OSMOSIS',
136
- to: 'OSMO',
137
- toLogo: 'https://api.rango.exchange/tokens/COSMOS/OSMO.png',
138
- toAddress: null,
139
- toBlockchain: 'OSMOSIS',
140
- },
141
- ],
142
- },
143
- ],
144
- recommendedSlippage: null,
145
- timeStat: {
146
- min: 6,
147
- avg: 40,
148
- max: 241,
149
- },
150
- includesDestinationTx: false,
151
- },
152
- ],
153
- },
154
- validateBalanceOrFee: true,
155
- steps: [
156
- {
157
- id: 1,
158
- fromBlockchain: 'OSMOSIS',
159
- fromSymbol: 'JUNO',
160
- fromSymbolAddress:
161
- 'ibc/46b44899322f3cd854d2d46deef881958467cdd4b3b10086da49296bbed94bed',
162
- fromDecimals: 6,
163
- fromAmountPrecision: null,
164
- fromAmountMinValue: null,
165
- swapperLogo: '',
166
- swapperType: '',
167
- fromAmountMaxValue: null,
168
- toBlockchainLogo: 'https://api.rango.exchange/swappers/osmosis.png',
169
- fromBlockchainLogo: 'https://api.rango.exchange/swappers/osmosis.png',
170
- toBlockchain: 'OSMOSIS',
171
- fromLogo: 'https://api.rango.exchange/tokens/COSMOS/JUNO.png',
172
- toSymbol: 'OSMO',
173
- toSymbolAddress: null,
174
- toDecimals: 6,
175
- toLogo: 'https://api.rango.exchange/i/mJQPS2',
176
- startTransactionTime: 1673164519916,
177
- swapperId: 'Osmosis',
178
- expectedOutputAmountHumanReadable: '1.540670',
179
- outputAmount: '1.540658',
180
- status: 'running',
181
- networkStatus: null,
182
- executedTransactionId:
183
- '0f8f17eecc863c2d6be65ef52cfe3128ff3cd7baeddf133160bea8ccdfbf876b',
184
- explorerUrl: [
185
- {
186
- url: 'https://www.mintscan.io/osmosis/txs/0f8f17eecc863c2d6be65ef52cfe3128ff3cd7baeddf133160bea8ccdfbf876b',
187
- description: null,
188
- },
189
- ],
190
- cosmosTransaction: {
191
- type: TransactionType.COSMOS,
192
- fromWalletAddress: 'osmo1unf2rcytjxfpz8x8ar63h4qeftadptg5t0nqcl',
193
- blockChain: 'OSMOSIS',
194
- data: {
195
- chainId: 'osmosis-1',
196
- account_number: 102721,
197
- sequence: '308',
198
- msgs: [
199
- {
200
- __type: 'OsmosisSwapMessage',
201
- type: 'osmosis/gamm/swap-exact-amount-in',
202
- value: {
203
- sender: 'osmo1unf2rcytjxfpz8x8ar63h4qeftadptg5t0nqcl',
204
- routes: [
205
- {
206
- pool_id: '498',
207
- token_out_denom:
208
- 'ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2',
209
- },
210
- {
211
- pool_id: '8',
212
- token_out_denom:
213
- 'ibc/7C4D60AA95E5A7558B0A364860979CA34B7FF8AAF255B87AF9E879374470CEC0',
214
- },
215
- {
216
- pool_id: '7',
217
- token_out_denom: 'uosmo',
218
- },
219
- ],
220
- token_in: {
221
- denom:
222
- 'ibc/46B44899322F3CD854D2D46DEEF881958467CDD4B3B10086DA49296BBED94BED',
223
- amount: '1000000',
224
- },
225
- token_out_min_amount: '1525264',
226
- },
227
- },
228
- ],
229
- protoMsgs: [
230
- {
231
- type_url: '/osmosis.gamm.v1beta1.MsgSwapExactAmountIn',
232
- value: [
233
- 10, 43, 111, 115, 109, 111, 49, 117, 110, 102, 50, 114, 99,
234
- 121, 116, 106, 120, 102, 112, 122, 56, 120, 56, 97, 114, 54,
235
- 51, 104, 52, 113, 101, 102, 116, 97, 100, 112, 116, 103, 53,
236
- 116, 48, 110, 113, 99, 108, 18, 73, 8, -14, 3, 18, 68, 105,
237
- 98, 99, 47, 50, 55, 51, 57, 52, 70, 66, 48, 57, 50, 68, 50,
238
- 69, 67, 67, 68, 53, 54, 49, 50, 51, 67, 55, 52, 70, 51, 54,
239
- 69, 52, 67, 49, 70, 57, 50, 54, 48, 48, 49, 67, 69, 65, 68,
240
- 65, 57, 67, 65, 57, 55, 69, 65, 54, 50, 50, 66, 50, 53, 70,
241
- 52, 49, 69, 53, 69, 66, 50, 18, 72, 8, 8, 18, 68, 105, 98, 99,
242
- 47, 55, 67, 52, 68, 54, 48, 65, 65, 57, 53, 69, 53, 65, 55,
243
- 53, 53, 56, 66, 48, 65, 51, 54, 52, 56, 54, 48, 57, 55, 57,
244
- 67, 65, 51, 52, 66, 55, 70, 70, 56, 65, 65, 70, 50, 53, 53,
245
- 66, 56, 55, 65, 70, 57, 69, 56, 55, 57, 51, 55, 52, 52, 55,
246
- 48, 67, 69, 67, 48, 18, 9, 8, 7, 18, 5, 117, 111, 115, 109,
247
- 111, 26, 79, 10, 68, 105, 98, 99, 47, 52, 54, 66, 52, 52, 56,
248
- 57, 57, 51, 50, 50, 70, 51, 67, 68, 56, 53, 52, 68, 50, 68,
249
- 52, 54, 68, 69, 69, 70, 56, 56, 49, 57, 53, 56, 52, 54, 55,
250
- 67, 68, 68, 52, 66, 51, 66, 49, 48, 48, 56, 54, 68, 65, 52,
251
- 57, 50, 57, 54, 66, 66, 69, 68, 57, 52, 66, 69, 68, 18, 7, 49,
252
- 48, 48, 48, 48, 48, 48, 34, 7, 49, 53, 50, 53, 50, 54, 52,
253
- ],
254
- },
255
- ],
256
- memo: '',
257
- source: null,
258
- fee: {
259
- gas: '900000',
260
- amount: [
261
- {
262
- denom: 'uosmo',
263
- amount: '0',
264
- },
265
- ],
266
- },
267
- signType: 'AMINO',
268
- rpcUrl: '',
269
- },
270
- rawTransfer: null,
271
- },
272
- solanaTransaction: null,
273
- evmTransaction: null,
274
- evmApprovalTransaction: null,
275
- transferTransaction: null,
276
- diagnosisUrl: null,
277
- internalSteps: null,
278
- },
279
- ],
280
- },
281
- {
282
- creationTime: '1673164511955',
283
- finishTime: '1673164550137',
284
- requestId: '51e211d9-d61c-45d2-a4d4-1f9f7f90ee85',
285
- inputAmount: '1',
286
- wallets: {
287
- OSMOSIS: {
288
- walletType: 'keplr',
289
- address: 'osmo1unf2rcytjxfpz8x8ar63h4qeftadptg5t0nqcl',
290
- },
291
- },
292
- status: 'failed',
293
- isPaused: false,
294
- extraMessage: null,
295
- extraMessageSeverity: 'info',
296
- extraMessageDetail: '',
297
- extraMessageErrorCode: null,
298
- networkStatusExtraMessage: null,
299
- networkStatusExtraMessageDetail: null,
300
- lastNotificationTime: null,
301
- settings: {
302
- slippage: '1.0',
303
- disabledSwappersIds: [],
304
- disabledSwappersGroups: [],
305
- },
306
- simulationResult: {
307
- outputAmount: '1.540670',
308
- swaps: [
309
- {
310
- swapperId: 'Osmosis',
311
- swapperLogo: '',
312
- // @ts-ignore
313
- result: null,
314
- swapperType: 'DEX',
315
- from: {
316
- symbol: 'JUNO',
317
- logo: 'https://api.rango.exchange/tokens/COSMOS/JUNO.png',
318
- address:
319
- 'ibc/46b44899322f3cd854d2d46deef881958467cdd4b3b10086da49296bbed94bed',
320
- blockchain: 'OSMOSIS',
321
- blockchainLogo: '',
322
- decimals: 6,
323
- usdPrice: 1.1091996179668873,
324
- },
325
- to: {
326
- symbol: 'OSMO',
327
- logo: 'https://api.rango.exchange/i/mJQPS2',
328
- address: null,
329
- blockchain: 'OSMOSIS',
330
- decimals: 6,
331
- blockchainLogo: '',
332
- usdPrice: 0.7192435454440882,
333
- },
334
- fromAmount: '1.000000',
335
- fromAmountPrecision: null,
336
- fromAmountMinValue: null,
337
- fromAmountMaxValue: null,
338
- toAmount: '1.540670',
339
- fee: [
340
- {
341
- name: '',
342
- asset: {
343
- blockchain: 'OSMOSIS',
344
- symbol: 'OSMO',
345
- address: null,
346
- },
347
- expenseType: 'FROM_SOURCE_WALLET',
348
- amount: '0',
349
- },
350
- ],
351
- estimatedTimeInSeconds: 45,
352
- swapChainType: 'INTRA_CHAIN',
353
- routes: [
354
- {
355
- nodes: [
356
- {
357
- nodes: [
358
- {
359
- marketName: 'pool#498',
360
- marketId: null,
361
- percent: 1,
362
- },
363
- ],
364
- from: 'JUNO',
365
- fromLogo: 'https://api.rango.exchange/tokens/COSMOS/JUNO.png',
366
- fromAddress:
367
- 'ibc/46b44899322f3cd854d2d46deef881958467cdd4b3b10086da49296bbed94bed',
368
- fromBlockchain: 'OSMOSIS',
369
- to: 'ATOM',
370
- toLogo: 'https://api.rango.exchange/tokens/COSMOS/ATOM.png',
371
- toAddress:
372
- 'ibc/27394fb092d2eccd56123c74f36e4c1f926001ceada9ca97ea622b25f41e5eb2',
373
- toBlockchain: 'OSMOSIS',
374
- },
375
- {
376
- nodes: [
377
- {
378
- marketName: 'pool#8',
379
- marketId: null,
380
- percent: 1,
381
- },
382
- ],
383
- from: 'ATOM',
384
- fromLogo: 'https://api.rango.exchange/tokens/COSMOS/ATOM.png',
385
- fromAddress:
386
- 'ibc/27394fb092d2eccd56123c74f36e4c1f926001ceada9ca97ea622b25f41e5eb2',
387
- fromBlockchain: 'OSMOSIS',
388
- to: 'IRIS',
389
- toLogo: 'https://api.rango.exchange/tokens/COSMOS/IRIS.png',
390
- toAddress:
391
- 'ibc/7c4d60aa95e5a7558b0a364860979ca34b7ff8aaf255b87af9e879374470cec0',
392
- toBlockchain: 'OSMOSIS',
393
- },
394
- {
395
- nodes: [
396
- {
397
- marketName: 'pool#7',
398
- marketId: null,
399
- percent: 1,
400
- },
401
- ],
402
- from: 'IRIS',
403
- fromLogo: 'https://api.rango.exchange/tokens/COSMOS/IRIS.png',
404
- fromAddress:
405
- 'ibc/7c4d60aa95e5a7558b0a364860979ca34b7ff8aaf255b87af9e879374470cec0',
406
- fromBlockchain: 'OSMOSIS',
407
- to: 'OSMO',
408
- toLogo: 'https://api.rango.exchange/tokens/COSMOS/OSMO.png',
409
- toAddress: null,
410
- toBlockchain: 'OSMOSIS',
411
- },
412
- ],
413
- },
414
- ],
415
- recommendedSlippage: null,
416
- timeStat: {
417
- min: 6,
418
- avg: 40,
419
- max: 241,
420
- },
421
- includesDestinationTx: false,
422
- },
423
- ],
424
- },
425
- validateBalanceOrFee: true,
426
- steps: [
427
- {
428
- id: 1,
429
- fromBlockchain: 'OSMOSIS',
430
- fromSymbol: 'JUNO',
431
- fromSymbolAddress:
432
- 'ibc/46b44899322f3cd854d2d46deef881958467cdd4b3b10086da49296bbed94bed',
433
- fromDecimals: 6,
434
- fromAmountPrecision: null,
435
- fromAmountMinValue: null,
436
- fromAmountMaxValue: null,
437
- toBlockchainLogo: 'https://api.rango.exchange/swappers/osmosis.png',
438
- fromBlockchainLogo: 'https://api.rango.exchange/swappers/osmosis.png',
439
- toBlockchain: 'OSMOSIS',
440
- swapperLogo: '',
441
- swapperType: '',
442
- fromLogo: 'https://api.rango.exchange/tokens/COSMOS/JUNO.png',
443
- toSymbol: 'OSMO',
444
- toSymbolAddress: null,
445
- toDecimals: 6,
446
- toLogo: 'https://api.rango.exchange/i/mJQPS2',
447
- startTransactionTime: 1673164519916,
448
- swapperId: 'Osmosis',
449
- expectedOutputAmountHumanReadable: '1.540670',
450
- outputAmount: '1.540658',
451
- status: 'failed',
452
- networkStatus: null,
453
- executedTransactionId:
454
- '0f8f17eecc863c2d6be65ef52cfe3128ff3cd7baeddf133160bea8ccdfbf876b',
455
- explorerUrl: [
456
- {
457
- url: 'https://www.mintscan.io/osmosis/txs/0f8f17eecc863c2d6be65ef52cfe3128ff3cd7baeddf133160bea8ccdfbf876b',
458
- description: null,
459
- },
460
- ],
461
- cosmosTransaction: {
462
- type: TransactionType.COSMOS,
463
- fromWalletAddress: 'osmo1unf2rcytjxfpz8x8ar63h4qeftadptg5t0nqcl',
464
- blockChain: 'OSMOSIS',
465
- data: {
466
- chainId: 'osmosis-1',
467
- account_number: 102721,
468
- sequence: '308',
469
- msgs: [
470
- {
471
- __type: 'OsmosisSwapMessage',
472
- type: 'osmosis/gamm/swap-exact-amount-in',
473
- value: {
474
- sender: 'osmo1unf2rcytjxfpz8x8ar63h4qeftadptg5t0nqcl',
475
- routes: [
476
- {
477
- pool_id: '498',
478
- token_out_denom:
479
- 'ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2',
480
- },
481
- {
482
- pool_id: '8',
483
- token_out_denom:
484
- 'ibc/7C4D60AA95E5A7558B0A364860979CA34B7FF8AAF255B87AF9E879374470CEC0',
485
- },
486
- {
487
- pool_id: '7',
488
- token_out_denom: 'uosmo',
489
- },
490
- ],
491
- token_in: {
492
- denom:
493
- 'ibc/46B44899322F3CD854D2D46DEEF881958467CDD4B3B10086DA49296BBED94BED',
494
- amount: '1000000',
495
- },
496
- token_out_min_amount: '1525264',
497
- },
498
- },
499
- ],
500
- protoMsgs: [
501
- {
502
- type_url: '/osmosis.gamm.v1beta1.MsgSwapExactAmountIn',
503
- value: [
504
- 10, 43, 111, 115, 109, 111, 49, 117, 110, 102, 50, 114, 99,
505
- 121, 116, 106, 120, 102, 112, 122, 56, 120, 56, 97, 114, 54,
506
- 51, 104, 52, 113, 101, 102, 116, 97, 100, 112, 116, 103, 53,
507
- 116, 48, 110, 113, 99, 108, 18, 73, 8, -14, 3, 18, 68, 105,
508
- 98, 99, 47, 50, 55, 51, 57, 52, 70, 66, 48, 57, 50, 68, 50,
509
- 69, 67, 67, 68, 53, 54, 49, 50, 51, 67, 55, 52, 70, 51, 54,
510
- 69, 52, 67, 49, 70, 57, 50, 54, 48, 48, 49, 67, 69, 65, 68,
511
- 65, 57, 67, 65, 57, 55, 69, 65, 54, 50, 50, 66, 50, 53, 70,
512
- 52, 49, 69, 53, 69, 66, 50, 18, 72, 8, 8, 18, 68, 105, 98, 99,
513
- 47, 55, 67, 52, 68, 54, 48, 65, 65, 57, 53, 69, 53, 65, 55,
514
- 53, 53, 56, 66, 48, 65, 51, 54, 52, 56, 54, 48, 57, 55, 57,
515
- 67, 65, 51, 52, 66, 55, 70, 70, 56, 65, 65, 70, 50, 53, 53,
516
- 66, 56, 55, 65, 70, 57, 69, 56, 55, 57, 51, 55, 52, 52, 55,
517
- 48, 67, 69, 67, 48, 18, 9, 8, 7, 18, 5, 117, 111, 115, 109,
518
- 111, 26, 79, 10, 68, 105, 98, 99, 47, 52, 54, 66, 52, 52, 56,
519
- 57, 57, 51, 50, 50, 70, 51, 67, 68, 56, 53, 52, 68, 50, 68,
520
- 52, 54, 68, 69, 69, 70, 56, 56, 49, 57, 53, 56, 52, 54, 55,
521
- 67, 68, 68, 52, 66, 51, 66, 49, 48, 48, 56, 54, 68, 65, 52,
522
- 57, 50, 57, 54, 66, 66, 69, 68, 57, 52, 66, 69, 68, 18, 7, 49,
523
- 48, 48, 48, 48, 48, 48, 34, 7, 49, 53, 50, 53, 50, 54, 52,
524
- ],
525
- },
526
- ],
527
- memo: '',
528
- source: null,
529
- fee: {
530
- gas: '900000',
531
- amount: [
532
- {
533
- denom: 'uosmo',
534
- amount: '0',
535
- },
536
- ],
537
- },
538
- signType: 'AMINO',
539
- rpcUrl: '',
540
- },
541
- rawTransfer: null,
542
- },
543
- solanaTransaction: null,
544
- evmTransaction: null,
545
- evmApprovalTransaction: null,
546
- transferTransaction: null,
547
- diagnosisUrl: null,
548
- internalSteps: null,
549
- },
550
- ],
551
- },
552
- {
553
- creationTime: '1673164511955',
554
- finishTime: '1673164550137',
555
- requestId: '51e211d9-d61c-45d2-a4d4-1f9f7f90ee85',
556
- inputAmount: '1',
557
- wallets: {
558
- OSMOSIS: {
559
- walletType: 'keplr',
560
- address: 'osmo1unf2rcytjxfpz8x8ar63h4qeftadptg5t0nqcl',
561
- },
562
- },
563
- status: 'success',
564
- isPaused: false,
565
- extraMessage: null,
566
- extraMessageSeverity: 'info',
567
- extraMessageDetail: '',
568
- extraMessageErrorCode: null,
569
- networkStatusExtraMessage: null,
570
- networkStatusExtraMessageDetail: null,
571
- lastNotificationTime: null,
572
- settings: {
573
- slippage: '1.0',
574
- disabledSwappersIds: [],
575
- disabledSwappersGroups: [],
576
- },
577
- simulationResult: {
578
- outputAmount: '1.540670',
579
- swaps: [
580
- {
581
- // @ts-ignore
582
- result: [],
583
- swapperId: 'Osmosis',
584
- swapperType: 'DEX',
585
- swapperLogo: '',
586
-
587
- from: {
588
- symbol: 'JUNO',
589
- logo: 'https://api.rango.exchange/tokens/COSMOS/JUNO.png',
590
- address:
591
- 'ibc/46b44899322f3cd854d2d46deef881958467cdd4b3b10086da49296bbed94bed',
592
- blockchain: 'OSMOSIS',
593
- blockchainLogo: '',
594
- decimals: 6,
595
- usdPrice: 1.1091996179668873,
596
- },
597
- to: {
598
- symbol: 'OSMO',
599
- logo: 'https://api.rango.exchange/i/mJQPS2',
600
- address: null,
601
- blockchain: 'OSMOSIS',
602
- decimals: 6,
603
- blockchainLogo: '',
604
- usdPrice: 0.7192435454440882,
605
- },
606
- fromAmount: '1.000000',
607
- fromAmountPrecision: null,
608
- fromAmountMinValue: null,
609
- fromAmountMaxValue: null,
610
- toAmount: '1.540670',
611
- fee: [
612
- {
613
- name: '',
614
- asset: {
615
- blockchain: 'OSMOSIS',
616
- symbol: 'OSMO',
617
- address: null,
618
- },
619
- expenseType: 'FROM_SOURCE_WALLET',
620
- amount: '0',
621
- },
622
- ],
623
- estimatedTimeInSeconds: 45,
624
- swapChainType: 'INTRA_CHAIN',
625
- routes: [
626
- {
627
- nodes: [
628
- {
629
- nodes: [
630
- {
631
- marketName: 'pool#498',
632
- marketId: null,
633
- percent: 1,
634
- },
635
- ],
636
- from: 'JUNO',
637
- fromLogo: 'https://api.rango.exchange/tokens/COSMOS/JUNO.png',
638
- fromAddress:
639
- 'ibc/46b44899322f3cd854d2d46deef881958467cdd4b3b10086da49296bbed94bed',
640
- fromBlockchain: 'OSMOSIS',
641
- to: 'ATOM',
642
- toLogo: 'https://api.rango.exchange/tokens/COSMOS/ATOM.png',
643
- toAddress:
644
- 'ibc/27394fb092d2eccd56123c74f36e4c1f926001ceada9ca97ea622b25f41e5eb2',
645
- toBlockchain: 'OSMOSIS',
646
- },
647
- {
648
- nodes: [
649
- {
650
- marketName: 'pool#8',
651
- marketId: null,
652
- percent: 1,
653
- },
654
- ],
655
- from: 'ATOM',
656
- fromLogo: 'https://api.rango.exchange/tokens/COSMOS/ATOM.png',
657
- fromAddress:
658
- 'ibc/27394fb092d2eccd56123c74f36e4c1f926001ceada9ca97ea622b25f41e5eb2',
659
- fromBlockchain: 'OSMOSIS',
660
- to: 'IRIS',
661
- toLogo: 'https://api.rango.exchange/tokens/COSMOS/IRIS.png',
662
- toAddress:
663
- 'ibc/7c4d60aa95e5a7558b0a364860979ca34b7ff8aaf255b87af9e879374470cec0',
664
- toBlockchain: 'OSMOSIS',
665
- },
666
- {
667
- nodes: [
668
- {
669
- marketName: 'pool#7',
670
- marketId: null,
671
- percent: 1,
672
- },
673
- ],
674
- from: 'IRIS',
675
- fromLogo: 'https://api.rango.exchange/tokens/COSMOS/IRIS.png',
676
- fromAddress:
677
- 'ibc/7c4d60aa95e5a7558b0a364860979ca34b7ff8aaf255b87af9e879374470cec0',
678
- fromBlockchain: 'OSMOSIS',
679
- to: 'OSMO',
680
- toLogo: 'https://api.rango.exchange/tokens/COSMOS/OSMO.png',
681
- toAddress: null,
682
- toBlockchain: 'OSMOSIS',
683
- },
684
- ],
685
- },
686
- ],
687
- recommendedSlippage: null,
688
- timeStat: {
689
- min: 6,
690
- avg: 40,
691
- max: 241,
692
- },
693
- includesDestinationTx: false,
694
- },
695
- ],
696
- },
697
- validateBalanceOrFee: true,
698
- steps: [
699
- {
700
- id: 1,
701
- fromBlockchain: 'OSMOSIS',
702
- fromSymbol: 'JUNO',
703
- fromSymbolAddress:
704
- 'ibc/46b44899322f3cd854d2d46deef881958467cdd4b3b10086da49296bbed94bed',
705
- fromDecimals: 6,
706
- fromAmountPrecision: null,
707
- fromAmountMinValue: null,
708
- swapperLogo: '',
709
- swapperType: '',
710
- fromAmountMaxValue: null,
711
- toBlockchainLogo: 'https://api.rango.exchange/swappers/osmosis.png',
712
- fromBlockchainLogo: 'https://api.rango.exchange/swappers/osmosis.png',
713
- toBlockchain: 'OSMOSIS',
714
- fromLogo: 'https://api.rango.exchange/tokens/COSMOS/JUNO.png',
715
- toSymbol: 'OSMO',
716
- toSymbolAddress: null,
717
- toDecimals: 6,
718
- toLogo: 'https://api.rango.exchange/i/mJQPS2',
719
- startTransactionTime: 1673164519916,
720
- swapperId: 'Osmosis',
721
- expectedOutputAmountHumanReadable: '1.540670',
722
- outputAmount: '1.540658',
723
- status: 'success',
724
- networkStatus: null,
725
- executedTransactionId:
726
- '0f8f17eecc863c2d6be65ef52cfe3128ff3cd7baeddf133160bea8ccdfbf876b',
727
- explorerUrl: [
728
- {
729
- url: 'https://www.mintscan.io/osmosis/txs/0f8f17eecc863c2d6be65ef52cfe3128ff3cd7baeddf133160bea8ccdfbf876b',
730
- description: null,
731
- },
732
- ],
733
- cosmosTransaction: {
734
- type: TransactionType.COSMOS,
735
- fromWalletAddress: 'osmo1unf2rcytjxfpz8x8ar63h4qeftadptg5t0nqcl',
736
- blockChain: 'OSMOSIS',
737
- data: {
738
- chainId: 'osmosis-1',
739
- account_number: 102721,
740
- sequence: '308',
741
- msgs: [
742
- {
743
- __type: 'OsmosisSwapMessage',
744
- type: 'osmosis/gamm/swap-exact-amount-in',
745
- value: {
746
- sender: 'osmo1unf2rcytjxfpz8x8ar63h4qeftadptg5t0nqcl',
747
- routes: [
748
- {
749
- pool_id: '498',
750
- token_out_denom:
751
- 'ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2',
752
- },
753
- {
754
- pool_id: '8',
755
- token_out_denom:
756
- 'ibc/7C4D60AA95E5A7558B0A364860979CA34B7FF8AAF255B87AF9E879374470CEC0',
757
- },
758
- {
759
- pool_id: '7',
760
- token_out_denom: 'uosmo',
761
- },
762
- ],
763
- token_in: {
764
- denom:
765
- 'ibc/46B44899322F3CD854D2D46DEEF881958467CDD4B3B10086DA49296BBED94BED',
766
- amount: '1000000',
767
- },
768
- token_out_min_amount: '1525264',
769
- },
770
- },
771
- ],
772
- protoMsgs: [
773
- {
774
- type_url: '/osmosis.gamm.v1beta1.MsgSwapExactAmountIn',
775
- value: [
776
- 10, 43, 111, 115, 109, 111, 49, 117, 110, 102, 50, 114, 99,
777
- 121, 116, 106, 120, 102, 112, 122, 56, 120, 56, 97, 114, 54,
778
- 51, 104, 52, 113, 101, 102, 116, 97, 100, 112, 116, 103, 53,
779
- 116, 48, 110, 113, 99, 108, 18, 73, 8, -14, 3, 18, 68, 105,
780
- 98, 99, 47, 50, 55, 51, 57, 52, 70, 66, 48, 57, 50, 68, 50,
781
- 69, 67, 67, 68, 53, 54, 49, 50, 51, 67, 55, 52, 70, 51, 54,
782
- 69, 52, 67, 49, 70, 57, 50, 54, 48, 48, 49, 67, 69, 65, 68,
783
- 65, 57, 67, 65, 57, 55, 69, 65, 54, 50, 50, 66, 50, 53, 70,
784
- 52, 49, 69, 53, 69, 66, 50, 18, 72, 8, 8, 18, 68, 105, 98, 99,
785
- 47, 55, 67, 52, 68, 54, 48, 65, 65, 57, 53, 69, 53, 65, 55,
786
- 53, 53, 56, 66, 48, 65, 51, 54, 52, 56, 54, 48, 57, 55, 57,
787
- 67, 65, 51, 52, 66, 55, 70, 70, 56, 65, 65, 70, 50, 53, 53,
788
- 66, 56, 55, 65, 70, 57, 69, 56, 55, 57, 51, 55, 52, 52, 55,
789
- 48, 67, 69, 67, 48, 18, 9, 8, 7, 18, 5, 117, 111, 115, 109,
790
- 111, 26, 79, 10, 68, 105, 98, 99, 47, 52, 54, 66, 52, 52, 56,
791
- 57, 57, 51, 50, 50, 70, 51, 67, 68, 56, 53, 52, 68, 50, 68,
792
- 52, 54, 68, 69, 69, 70, 56, 56, 49, 57, 53, 56, 52, 54, 55,
793
- 67, 68, 68, 52, 66, 51, 66, 49, 48, 48, 56, 54, 68, 65, 52,
794
- 57, 50, 57, 54, 66, 66, 69, 68, 57, 52, 66, 69, 68, 18, 7, 49,
795
- 48, 48, 48, 48, 48, 48, 34, 7, 49, 53, 50, 53, 50, 54, 52,
796
- ],
797
- },
798
- ],
799
- memo: '',
800
- source: null,
801
- fee: {
802
- gas: '900000',
803
- amount: [
804
- {
805
- denom: 'uosmo',
806
- amount: '0',
807
- },
808
- ],
809
- },
810
- signType: 'AMINO',
811
- rpcUrl: '',
812
- },
813
- rawTransfer: null,
814
- },
815
- solanaTransaction: null,
816
- evmTransaction: null,
817
- evmApprovalTransaction: null,
818
- transferTransaction: null,
819
- diagnosisUrl: null,
820
- internalSteps: null,
821
- },
822
- ],
823
- },
824
- ];
7
+ import { getPendingSwaps } from '../utils/queue';
8
+ import { useUiStore } from '../store/ui';
825
9
 
826
10
  export function HistoryPage() {
11
+ const setSelectedSwap = useUiStore.use.setSelectedSwap();
827
12
  const navigate = useNavigate();
828
13
  const { navigateBackFrom } = useNavigateBack();
14
+ const { manager } = useManager();
15
+ const pendingSwaps = getPendingSwaps(manager).map(({ swap }) => swap);
16
+
829
17
  return (
830
18
  <History
831
- list={pendingSwap}
832
- onSwapClick={navigate.bind(null, navigationRoutes.swapDetails)}
833
- onBack={navigateBackFrom.bind(null, navigationRoutes.history)}
19
+ //todo: move PendingSwap type to rango-types
20
+ //@ts-ignore
21
+ list={pendingSwaps}
22
+ onSwapClick={(requestId) => {
23
+ setSelectedSwap(requestId);
24
+ navigate(navigationRoutes.swaps + `/${requestId}`);
25
+ }}
26
+ onBack={navigateBackFrom.bind(null, navigationRoutes.swaps)}
834
27
  />
835
28
  );
836
29
  }