@lifi/sdk 2.0.0-beta.9 → 2.0.1

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 (59) hide show
  1. package/dist/LiFi.d.ts +9 -9
  2. package/dist/LiFi.js +11 -11
  3. package/dist/allowance/checkAllowance.js +4 -2
  4. package/dist/cjs/LiFi.d.ts +9 -9
  5. package/dist/cjs/LiFi.js +12 -13
  6. package/dist/cjs/allowance/checkAllowance.js +4 -2
  7. package/dist/cjs/connectors.d.ts +1 -1
  8. package/dist/cjs/connectors.js +7 -9
  9. package/dist/cjs/execution/RouteExecutionManager.d.ts +1 -1
  10. package/dist/cjs/execution/RouteExecutionManager.js +1 -1
  11. package/dist/cjs/execution/StatusManager.js +1 -1
  12. package/dist/cjs/execution/StepExecutionManager.js +16 -2
  13. package/dist/cjs/execution/StepExecutor.js +13 -5
  14. package/dist/cjs/execution/stepComparison.d.ts +1 -1
  15. package/dist/cjs/execution/stepComparison.js +2 -5
  16. package/dist/cjs/execution/utils.js +5 -1
  17. package/dist/cjs/helpers.d.ts +2 -0
  18. package/dist/cjs/helpers.js +6 -1
  19. package/dist/cjs/services/ApiService.d.ts +1 -1
  20. package/dist/cjs/services/ConfigService.d.ts +1 -1
  21. package/dist/cjs/services/ConfigService.js +1 -2
  22. package/dist/cjs/typeguards.d.ts +2 -2
  23. package/dist/cjs/types/internal.types.d.ts +6 -10
  24. package/dist/cjs/utils/errors.d.ts +4 -2
  25. package/dist/cjs/utils/errors.js +9 -7
  26. package/dist/cjs/utils/parseError.js +19 -11
  27. package/dist/cjs/utils/preRestart.d.ts +2 -1
  28. package/dist/cjs/utils/preRestart.js +24 -3
  29. package/dist/cjs/version.d.ts +1 -1
  30. package/dist/cjs/version.js +1 -1
  31. package/dist/connectors.d.ts +1 -1
  32. package/dist/connectors.js +7 -9
  33. package/dist/execution/RouteExecutionManager.d.ts +1 -1
  34. package/dist/execution/RouteExecutionManager.js +1 -1
  35. package/dist/execution/StatusManager.js +1 -1
  36. package/dist/execution/StepExecutionManager.js +16 -2
  37. package/dist/execution/StepExecutor.js +13 -5
  38. package/dist/execution/stepComparison.d.ts +1 -1
  39. package/dist/execution/stepComparison.js +2 -5
  40. package/dist/execution/utils.js +5 -1
  41. package/dist/helpers.d.ts +2 -0
  42. package/dist/helpers.js +4 -0
  43. package/dist/services/ApiService.d.ts +1 -1
  44. package/dist/services/ConfigService.d.ts +1 -1
  45. package/dist/services/ConfigService.js +1 -2
  46. package/dist/typeguards.d.ts +2 -2
  47. package/dist/types/internal.types.d.ts +6 -10
  48. package/dist/utils/errors.d.ts +4 -2
  49. package/dist/utils/errors.js +3 -1
  50. package/dist/utils/parseError.js +20 -12
  51. package/dist/utils/preRestart.d.ts +2 -1
  52. package/dist/utils/preRestart.js +24 -3
  53. package/dist/version.d.ts +1 -1
  54. package/dist/version.js +1 -1
  55. package/package.json +15 -15
  56. package/dist/cjs/services/ApiService.unit.handlers.d.ts +0 -1
  57. package/dist/cjs/services/ApiService.unit.handlers.js +0 -50
  58. package/dist/services/ApiService.unit.handlers.d.ts +0 -1
  59. package/dist/services/ApiService.unit.handlers.js +0 -44
@@ -1,44 +0,0 @@
1
- import { ChainId, CoinKey, findDefaultToken } from '@lifi/types';
2
- import { rest } from 'msw';
3
- import ConfigService from './ConfigService';
4
- const config = ConfigService.getInstance().getConfig();
5
- export const handlers = [
6
- rest.post(`${config.apiUrl}/advanced/routes`, async (request, response, context) => {
7
- const data = await request.json();
8
- if (isNaN(parseFloat(data.fromAmount))) {
9
- return response(context.status(500), context.json({ message: `Oops` }));
10
- }
11
- return response(context.json({}));
12
- }),
13
- rest.post(`${config.apiUrl}/advanced/possibilities`, async (request, response, context) => {
14
- return response(context.json({}));
15
- }),
16
- rest.get(`${config.apiUrl}/token`, async (request, response, context) => {
17
- return response(context.json({}));
18
- }),
19
- rest.get(`${config.apiUrl}/quote`, async (request, response, context) => {
20
- return response(context.json({}));
21
- }),
22
- rest.get(`${config.apiUrl}/status`, async (request, response, context) => {
23
- return response(context.json({}));
24
- }),
25
- rest.get(`${config.apiUrl}/chains`, async (request, response, context) => {
26
- return response(context.json({ chains: [{ id: 1 }] }));
27
- }),
28
- rest.get(`${config.apiUrl}/tools`, async (request, response, context) => {
29
- return response(context.json({ bridges: [], exchanges: [] }));
30
- }),
31
- rest.get(`${config.apiUrl}/tokens`, async (request, response, context) => {
32
- return response(context.json({
33
- tokens: {
34
- [ChainId.ETH]: [findDefaultToken(CoinKey.ETH, ChainId.ETH)],
35
- },
36
- }));
37
- }),
38
- rest.post(`${config.apiUrl}/advanced/stepTransaction`, async (request, response, context) => {
39
- return response(context.json({}));
40
- }),
41
- rest.get(`${config.apiUrl}/gas/suggestion/${ChainId.OPT}`, async (request, response, context) => {
42
- return response(context.json({}));
43
- }),
44
- ];