@ensofinance/checkout-widget 0.0.12 → 0.0.14

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 (149) hide show
  1. package/dist/checkout-widget.es.js +14486 -13826
  2. package/dist/checkout-widget.es.js.map +1 -1
  3. package/dist/checkout-widget.umd.js +44 -43
  4. package/dist/checkout-widget.umd.js.map +1 -1
  5. package/dist/index.d.ts +7 -0
  6. package/orval.config.ts +40 -6
  7. package/package.json +1 -1
  8. package/src/components/BridgeFee.tsx +3 -3
  9. package/src/components/Checkout.tsx +5 -53
  10. package/src/components/ExchangeConfirmSecurity.tsx +16 -3
  11. package/src/components/QuoteParameters.tsx +84 -65
  12. package/src/components/TransactionDetailRow.tsx +6 -5
  13. package/src/components/cards/AssetCard.tsx +2 -2
  14. package/src/components/cards/OptionCard.tsx +2 -0
  15. package/src/components/steps/ExchangeFlow.tsx +414 -135
  16. package/src/components/steps/{InitialStep.tsx → FlowSelector.tsx} +76 -33
  17. package/src/components/steps/WalletFlow/WalletAmountStep.tsx +214 -0
  18. package/src/components/steps/{WalletConfirmStep.tsx → WalletFlow/WalletConfirmStep.tsx} +107 -156
  19. package/src/components/steps/WalletFlow/WalletFlow.tsx +116 -0
  20. package/src/components/steps/{QuoteStep.tsx → WalletFlow/WalletQuoteStep.tsx} +9 -58
  21. package/src/components/steps/WalletFlow/WalletTokenStep.tsx +75 -0
  22. package/src/components/ui/index.tsx +0 -3
  23. package/src/enso-api/api.ts +192 -3
  24. package/src/enso-api/custom-instance.ts +1 -0
  25. package/src/enso-api/index.ts +29 -118
  26. package/src/enso-api/model/approveActionDto.ts +17 -0
  27. package/src/enso-api/model/approveArgsDto.ts +22 -0
  28. package/src/enso-api/model/approveArgsDtoAmount.ts +16 -0
  29. package/src/enso-api/model/balanceActionDto.ts +17 -0
  30. package/src/enso-api/model/balanceArgsDto.ts +15 -0
  31. package/src/enso-api/model/borrowActionDto.ts +18 -0
  32. package/src/enso-api/model/borrowArgsDto.ts +22 -0
  33. package/src/enso-api/model/borrowArgsDtoAmountOut.ts +16 -0
  34. package/src/enso-api/model/bridgeActionDto.ts +19 -0
  35. package/src/enso-api/model/bridgeArgsDto.ts +29 -0
  36. package/src/enso-api/model/bridgeArgsDtoAmountIn.ts +16 -0
  37. package/src/enso-api/model/bridgeArgsDtoCallbackItem.ts +64 -0
  38. package/src/enso-api/model/bundleControllerBundleShortcutTransactionBodyItem.ts +69 -0
  39. package/src/enso-api/model/callActionDto.ts +18 -0
  40. package/src/enso-api/model/callArgsDto.ts +29 -0
  41. package/src/enso-api/model/callArgsDtoArgsItem.ts +17 -0
  42. package/src/enso-api/model/callArgsDtoArgsItemAnyOf.ts +12 -0
  43. package/src/enso-api/model/callArgsDtoValue.ts +16 -0
  44. package/src/enso-api/model/callOutput.ts +15 -0
  45. package/src/enso-api/model/depositActionDto.ts +18 -0
  46. package/src/enso-api/model/depositArgsDto.ts +28 -0
  47. package/src/enso-api/model/depositArgsDtoAmountIn.ts +20 -0
  48. package/src/enso-api/model/depositArgsDtoAmountInOneOfItem.ts +13 -0
  49. package/src/enso-api/model/depositArgsDtoTokenIn.ts +15 -0
  50. package/src/enso-api/model/depositArgsDtoTokenOut.ts +15 -0
  51. package/src/enso-api/model/depositCLMMActionDto.ts +18 -0
  52. package/src/enso-api/model/depositCLMMArgsDto.ts +30 -0
  53. package/src/enso-api/model/depositCLMMArgsDtoAmountInItem.ts +17 -0
  54. package/src/enso-api/model/depositCLMMArgsDtoAmountInItemAnyOf.ts +12 -0
  55. package/src/enso-api/model/ensoFeeActionDto.ts +17 -0
  56. package/src/enso-api/model/ensoFeeArgsDto.ts +20 -0
  57. package/src/enso-api/model/ensoFeeArgsDtoAmount.ts +16 -0
  58. package/src/enso-api/model/feeActionDto.ts +17 -0
  59. package/src/enso-api/model/feeArgsDto.ts +22 -0
  60. package/src/enso-api/model/feeArgsDtoAmount.ts +16 -0
  61. package/src/enso-api/model/harvestActionDto.ts +19 -0
  62. package/src/enso-api/model/harvestArgsDto.ts +17 -0
  63. package/src/enso-api/model/index.ts +115 -4
  64. package/src/enso-api/model/mergeActionDto.ts +17 -0
  65. package/src/enso-api/model/mergeArgsDto.ts +22 -0
  66. package/src/enso-api/model/mergeArgsDtoAmountInItem.ts +13 -0
  67. package/src/enso-api/model/minAmountOutActionDto.ts +17 -0
  68. package/src/enso-api/model/minAmountOutArgsDto.ts +19 -0
  69. package/src/enso-api/model/minAmountOutArgsDtoAmountOut.ts +16 -0
  70. package/src/enso-api/model/minAmountOutArgsDtoMinAmountOut.ts +16 -0
  71. package/src/enso-api/model/multiDepositActionDto.ts +18 -0
  72. package/src/enso-api/model/multiDepositArgsDto.ts +24 -0
  73. package/src/enso-api/model/multiDepositArgsDtoAmountInItem.ts +17 -0
  74. package/src/enso-api/model/multiDepositArgsDtoAmountInItemAnyOf.ts +12 -0
  75. package/src/enso-api/model/multiOutSingleDepositActionDto.ts +18 -0
  76. package/src/enso-api/model/multiOutSingleDepositArgsDto.ts +24 -0
  77. package/src/enso-api/model/multiOutSingleDepositArgsDtoAmountIn.ts +16 -0
  78. package/src/enso-api/model/multiRedeemActionDto.ts +18 -0
  79. package/src/enso-api/model/multiRedeemArgs2Dto.ts +24 -0
  80. package/src/enso-api/model/multiRedeemArgs2DtoAmountIn.ts +16 -0
  81. package/src/enso-api/model/nontokenizedControllerRouteNontokenizedShorcutTransactionParams.ts +8 -0
  82. package/src/enso-api/model/nontokenizedControllerRouteNontokenizedShorcutTransactionRoutingStrategy.ts +1 -0
  83. package/src/enso-api/model/nontokenizedRouteShortcutTransaction.ts +31 -0
  84. package/src/enso-api/model/paymasterFeeActionDto.ts +17 -0
  85. package/src/enso-api/model/paymasterFeeArgsDto.ts +18 -0
  86. package/src/enso-api/model/paymasterFeeArgsDtoAmount.ts +16 -0
  87. package/src/enso-api/model/permitTransferFromActionDto.ts +18 -0
  88. package/src/enso-api/model/permitTransferFromArgsDto.ts +29 -0
  89. package/src/enso-api/model/permitTransferFromArgsDtoAmount.ts +20 -0
  90. package/src/enso-api/model/permitTransferFromArgsDtoAmountOneOfItem.ts +13 -0
  91. package/src/enso-api/model/permitTransferFromArgsDtoToken.ts +15 -0
  92. package/src/enso-api/model/positionModel.ts +14 -0
  93. package/src/enso-api/model/redeemActionDto.ts +18 -0
  94. package/src/enso-api/model/redeemArgsDto.ts +25 -0
  95. package/src/enso-api/model/redeemArgsDtoAmountIn.ts +16 -0
  96. package/src/enso-api/model/redeemArgsDtoTokenOut.ts +15 -0
  97. package/src/enso-api/model/redeemCLMMActionDto.ts +18 -0
  98. package/src/enso-api/model/redeemCLMMArgsDto.ts +24 -0
  99. package/src/enso-api/model/redeemCLMMArgsDtoLiquidity.ts +16 -0
  100. package/src/enso-api/model/repayActionDto.ts +18 -0
  101. package/src/enso-api/model/repayArgsDto.ts +22 -0
  102. package/src/enso-api/model/repayArgsDtoAmountIn.ts +16 -0
  103. package/src/enso-api/model/routeActionDto.ts +20 -0
  104. package/src/enso-api/model/routeArgsDto.ts +38 -0
  105. package/src/enso-api/model/routeArgsDtoAmountIn.ts +16 -0
  106. package/src/enso-api/model/singleDepositActionDto.ts +18 -0
  107. package/src/enso-api/model/singleDepositArgsDto.ts +24 -0
  108. package/src/enso-api/model/singleDepositArgsDtoAmountIn.ts +16 -0
  109. package/src/enso-api/model/singleRedeemActionDto.ts +18 -0
  110. package/src/enso-api/model/singleRedeemArgs2Dto.ts +24 -0
  111. package/src/enso-api/model/singleRedeemArgs2DtoAmountIn.ts +16 -0
  112. package/src/enso-api/model/slippageActionDto.ts +17 -0
  113. package/src/enso-api/model/slippageArgsDto.ts +18 -0
  114. package/src/enso-api/model/slippageArgsDtoAmountOut.ts +16 -0
  115. package/src/enso-api/model/splitActionDto.ts +17 -0
  116. package/src/enso-api/model/splitArgsDto.ts +22 -0
  117. package/src/enso-api/model/splitArgsDtoAmountIn.ts +16 -0
  118. package/src/enso-api/model/swapActionDto.ts +18 -0
  119. package/src/enso-api/model/swapArgsDto.ts +30 -0
  120. package/src/enso-api/model/swapArgsDtoAmountIn.ts +16 -0
  121. package/src/enso-api/model/tokenizedMultiDepositActionDto.ts +18 -0
  122. package/src/enso-api/model/tokenizedMultiDepositArgsDto.ts +24 -0
  123. package/src/enso-api/model/tokenizedMultiDepositArgsDtoAmountInItem.ts +17 -0
  124. package/src/enso-api/model/tokenizedMultiDepositArgsDtoAmountInItemAnyOf.ts +14 -0
  125. package/src/enso-api/model/tokenizedMultiRedeemActionDto.ts +18 -0
  126. package/src/enso-api/model/tokenizedMultiRedeemArgsDto.ts +24 -0
  127. package/src/enso-api/model/tokenizedMultiRedeemArgsDtoAmountIn.ts +16 -0
  128. package/src/enso-api/model/tokenizedSingleDepositActionDto.ts +18 -0
  129. package/src/enso-api/model/tokenizedSingleDepositArgsDto.ts +24 -0
  130. package/src/enso-api/model/tokenizedSingleDepositArgsDtoAmountIn.ts +16 -0
  131. package/src/enso-api/model/tokenizedSingleRedeemActionDto.ts +18 -0
  132. package/src/enso-api/model/tokenizedSingleRedeemArgsDto.ts +24 -0
  133. package/src/enso-api/model/tokenizedSingleRedeemArgsDtoAmountIn.ts +16 -0
  134. package/src/enso-api/model/tokensControllerTokensLiquidityType.ts +19 -0
  135. package/src/enso-api/model/tokensControllerTokensParams.ts +6 -0
  136. package/src/enso-api/model/transferActionDto.ts +18 -0
  137. package/src/enso-api/model/transferArgsDto.ts +22 -0
  138. package/src/enso-api/model/transferArgsDtoAmount.ts +16 -0
  139. package/src/enso-api/model/transferFromActionDto.ts +18 -0
  140. package/src/enso-api/model/transferFromArgsDto.ts +24 -0
  141. package/src/enso-api/model/transferFromArgsDtoAmount.ts +16 -0
  142. package/src/index.ts +1 -0
  143. package/src/store.ts +13 -5
  144. package/src/types/index.ts +9 -3
  145. package/src/util/common.tsx +4 -1
  146. package/src/util/enso-hooks.tsx +137 -14
  147. package/src/util/wallet.tsx +2 -69
  148. package/src/components/steps/WalletAmountStep.tsx +0 -267
  149. package/src/components/steps/WalletTokenStep.tsx +0 -128
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Generated by orval v7.11.1 🍺
3
+ * Do not edit manually.
4
+ * #### Enso API
5
+ - Find detailed documentation on [docs.enso.finance](https://docs.enso.finance).
6
+ - To use the API, **you must include your API Key in the Authorization header** (Bearer format).
7
+ - For testing, Swagger pre-authorizes you using the key: `1e02632d-6feb-4a75-a157-documentation` (1rps).
8
+ - Get your own API Key at [enso.finance/developers](https://enso.finance/developers).
9
+ * OpenAPI spec version: 1.0
10
+ */
11
+ import type { CallOutput } from "./callOutput";
12
+
13
+ /**
14
+ * Amount to split (or previous output reference)
15
+ */
16
+ export type SplitArgsDtoAmountIn = string | CallOutput;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Generated by orval v7.11.1 🍺
3
+ * Do not edit manually.
4
+ * #### Enso API
5
+ - Find detailed documentation on [docs.enso.finance](https://docs.enso.finance).
6
+ - To use the API, **you must include your API Key in the Authorization header** (Bearer format).
7
+ - For testing, Swagger pre-authorizes you using the key: `1e02632d-6feb-4a75-a157-documentation` (1rps).
8
+ - Get your own API Key at [enso.finance/developers](https://enso.finance/developers).
9
+ * OpenAPI spec version: 1.0
10
+ */
11
+ import type { SwapArgsDto } from "./swapArgsDto";
12
+
13
+ export interface SwapActionDto {
14
+ /** Protocol */
15
+ protocol: string;
16
+ action: string;
17
+ args: SwapArgsDto;
18
+ }
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Generated by orval v7.11.1 🍺
3
+ * Do not edit manually.
4
+ * #### Enso API
5
+ - Find detailed documentation on [docs.enso.finance](https://docs.enso.finance).
6
+ - To use the API, **you must include your API Key in the Authorization header** (Bearer format).
7
+ - For testing, Swagger pre-authorizes you using the key: `1e02632d-6feb-4a75-a157-documentation` (1rps).
8
+ - Get your own API Key at [enso.finance/developers](https://enso.finance/developers).
9
+ * OpenAPI spec version: 1.0
10
+ */
11
+ import type { SwapArgsDtoAmountIn } from "./swapArgsDtoAmountIn";
12
+
13
+ export interface SwapArgsDto {
14
+ /** Input token address */
15
+ tokenIn: string;
16
+ /** Output token address */
17
+ tokenOut: string;
18
+ /** Amount to swap (or previous output reference) */
19
+ amountIn: SwapArgsDtoAmountIn;
20
+ /** Router or pool contract address */
21
+ primaryAddress?: string;
22
+ /** Receiver address */
23
+ receiver: string;
24
+ /** Slippage in basis points */
25
+ slippage?: string;
26
+ /** Pool fee in basis points */
27
+ poolFee?: string;
28
+ /** Pool identifier (if protocol-specific) */
29
+ poolId?: string;
30
+ }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Generated by orval v7.11.1 🍺
3
+ * Do not edit manually.
4
+ * #### Enso API
5
+ - Find detailed documentation on [docs.enso.finance](https://docs.enso.finance).
6
+ - To use the API, **you must include your API Key in the Authorization header** (Bearer format).
7
+ - For testing, Swagger pre-authorizes you using the key: `1e02632d-6feb-4a75-a157-documentation` (1rps).
8
+ - Get your own API Key at [enso.finance/developers](https://enso.finance/developers).
9
+ * OpenAPI spec version: 1.0
10
+ */
11
+ import type { CallOutput } from "./callOutput";
12
+
13
+ /**
14
+ * Amount to swap (or previous output reference)
15
+ */
16
+ export type SwapArgsDtoAmountIn = string | CallOutput;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Generated by orval v7.11.1 🍺
3
+ * Do not edit manually.
4
+ * #### Enso API
5
+ - Find detailed documentation on [docs.enso.finance](https://docs.enso.finance).
6
+ - To use the API, **you must include your API Key in the Authorization header** (Bearer format).
7
+ - For testing, Swagger pre-authorizes you using the key: `1e02632d-6feb-4a75-a157-documentation` (1rps).
8
+ - Get your own API Key at [enso.finance/developers](https://enso.finance/developers).
9
+ * OpenAPI spec version: 1.0
10
+ */
11
+ import type { TokenizedMultiDepositArgsDto } from "./tokenizedMultiDepositArgsDto";
12
+
13
+ export interface TokenizedMultiDepositActionDto {
14
+ /** Protocol */
15
+ protocol: string;
16
+ action: string;
17
+ args: TokenizedMultiDepositArgsDto;
18
+ }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Generated by orval v7.11.1 🍺
3
+ * Do not edit manually.
4
+ * #### Enso API
5
+ - Find detailed documentation on [docs.enso.finance](https://docs.enso.finance).
6
+ - To use the API, **you must include your API Key in the Authorization header** (Bearer format).
7
+ - For testing, Swagger pre-authorizes you using the key: `1e02632d-6feb-4a75-a157-documentation` (1rps).
8
+ - Get your own API Key at [enso.finance/developers](https://enso.finance/developers).
9
+ * OpenAPI spec version: 1.0
10
+ */
11
+ import type { TokenizedMultiDepositArgsDtoAmountInItem } from "./tokenizedMultiDepositArgsDtoAmountInItem";
12
+
13
+ export interface TokenizedMultiDepositArgsDto {
14
+ /** Input token addresses */
15
+ tokenIn: string[];
16
+ /** Output token address */
17
+ tokenOut: string;
18
+ /** Amounts to deposit (or previous output references) */
19
+ amountIn: TokenizedMultiDepositArgsDtoAmountInItem[];
20
+ /** Primary contract address */
21
+ primaryAddress: string;
22
+ /** Receiver address */
23
+ receiver?: string;
24
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Generated by orval v7.11.1 🍺
3
+ * Do not edit manually.
4
+ * #### Enso API
5
+ - Find detailed documentation on [docs.enso.finance](https://docs.enso.finance).
6
+ - To use the API, **you must include your API Key in the Authorization header** (Bearer format).
7
+ - For testing, Swagger pre-authorizes you using the key: `1e02632d-6feb-4a75-a157-documentation` (1rps).
8
+ - Get your own API Key at [enso.finance/developers](https://enso.finance/developers).
9
+ * OpenAPI spec version: 1.0
10
+ */
11
+ import type { TokenizedMultiDepositArgsDtoAmountInItemAnyOf } from "./tokenizedMultiDepositArgsDtoAmountInItemAnyOf";
12
+
13
+ export type TokenizedMultiDepositArgsDtoAmountInItem =
14
+ | string
15
+ | number
16
+ | boolean
17
+ | TokenizedMultiDepositArgsDtoAmountInItemAnyOf;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Generated by orval v7.11.1 🍺
3
+ * Do not edit manually.
4
+ * #### Enso API
5
+ - Find detailed documentation on [docs.enso.finance](https://docs.enso.finance).
6
+ - To use the API, **you must include your API Key in the Authorization header** (Bearer format).
7
+ - For testing, Swagger pre-authorizes you using the key: `1e02632d-6feb-4a75-a157-documentation` (1rps).
8
+ - Get your own API Key at [enso.finance/developers](https://enso.finance/developers).
9
+ * OpenAPI spec version: 1.0
10
+ */
11
+
12
+ export type TokenizedMultiDepositArgsDtoAmountInItemAnyOf = {
13
+ [key: string]: unknown;
14
+ };
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Generated by orval v7.11.1 🍺
3
+ * Do not edit manually.
4
+ * #### Enso API
5
+ - Find detailed documentation on [docs.enso.finance](https://docs.enso.finance).
6
+ - To use the API, **you must include your API Key in the Authorization header** (Bearer format).
7
+ - For testing, Swagger pre-authorizes you using the key: `1e02632d-6feb-4a75-a157-documentation` (1rps).
8
+ - Get your own API Key at [enso.finance/developers](https://enso.finance/developers).
9
+ * OpenAPI spec version: 1.0
10
+ */
11
+ import type { TokenizedMultiRedeemArgsDto } from "./tokenizedMultiRedeemArgsDto";
12
+
13
+ export interface TokenizedMultiRedeemActionDto {
14
+ /** Protocol */
15
+ protocol: string;
16
+ action: string;
17
+ args: TokenizedMultiRedeemArgsDto;
18
+ }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Generated by orval v7.11.1 🍺
3
+ * Do not edit manually.
4
+ * #### Enso API
5
+ - Find detailed documentation on [docs.enso.finance](https://docs.enso.finance).
6
+ - To use the API, **you must include your API Key in the Authorization header** (Bearer format).
7
+ - For testing, Swagger pre-authorizes you using the key: `1e02632d-6feb-4a75-a157-documentation` (1rps).
8
+ - Get your own API Key at [enso.finance/developers](https://enso.finance/developers).
9
+ * OpenAPI spec version: 1.0
10
+ */
11
+ import type { TokenizedMultiRedeemArgsDtoAmountIn } from "./tokenizedMultiRedeemArgsDtoAmountIn";
12
+
13
+ export interface TokenizedMultiRedeemArgsDto {
14
+ /** Input token address */
15
+ tokenIn: string;
16
+ /** Output token addresses */
17
+ tokenOut: string[];
18
+ /** Amount to redeem (or previous output reference) */
19
+ amountIn: TokenizedMultiRedeemArgsDtoAmountIn;
20
+ /** Primary contract address */
21
+ primaryAddress: string;
22
+ /** Receiver address */
23
+ receiver?: string;
24
+ }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Generated by orval v7.11.1 🍺
3
+ * Do not edit manually.
4
+ * #### Enso API
5
+ - Find detailed documentation on [docs.enso.finance](https://docs.enso.finance).
6
+ - To use the API, **you must include your API Key in the Authorization header** (Bearer format).
7
+ - For testing, Swagger pre-authorizes you using the key: `1e02632d-6feb-4a75-a157-documentation` (1rps).
8
+ - Get your own API Key at [enso.finance/developers](https://enso.finance/developers).
9
+ * OpenAPI spec version: 1.0
10
+ */
11
+ import type { CallOutput } from "./callOutput";
12
+
13
+ /**
14
+ * Amount to redeem (or previous output reference)
15
+ */
16
+ export type TokenizedMultiRedeemArgsDtoAmountIn = string | CallOutput;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Generated by orval v7.11.1 🍺
3
+ * Do not edit manually.
4
+ * #### Enso API
5
+ - Find detailed documentation on [docs.enso.finance](https://docs.enso.finance).
6
+ - To use the API, **you must include your API Key in the Authorization header** (Bearer format).
7
+ - For testing, Swagger pre-authorizes you using the key: `1e02632d-6feb-4a75-a157-documentation` (1rps).
8
+ - Get your own API Key at [enso.finance/developers](https://enso.finance/developers).
9
+ * OpenAPI spec version: 1.0
10
+ */
11
+ import type { TokenizedSingleDepositArgsDto } from "./tokenizedSingleDepositArgsDto";
12
+
13
+ export interface TokenizedSingleDepositActionDto {
14
+ /** Protocol */
15
+ protocol: string;
16
+ action: string;
17
+ args: TokenizedSingleDepositArgsDto;
18
+ }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Generated by orval v7.11.1 🍺
3
+ * Do not edit manually.
4
+ * #### Enso API
5
+ - Find detailed documentation on [docs.enso.finance](https://docs.enso.finance).
6
+ - To use the API, **you must include your API Key in the Authorization header** (Bearer format).
7
+ - For testing, Swagger pre-authorizes you using the key: `1e02632d-6feb-4a75-a157-documentation` (1rps).
8
+ - Get your own API Key at [enso.finance/developers](https://enso.finance/developers).
9
+ * OpenAPI spec version: 1.0
10
+ */
11
+ import type { TokenizedSingleDepositArgsDtoAmountIn } from "./tokenizedSingleDepositArgsDtoAmountIn";
12
+
13
+ export interface TokenizedSingleDepositArgsDto {
14
+ /** Input token address */
15
+ tokenIn: string;
16
+ /** Output token address */
17
+ tokenOut: string;
18
+ /** Amount to deposit (or previous output reference) */
19
+ amountIn: TokenizedSingleDepositArgsDtoAmountIn;
20
+ /** Primary contract address */
21
+ primaryAddress: string;
22
+ /** Receiver address */
23
+ receiver?: string;
24
+ }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Generated by orval v7.11.1 🍺
3
+ * Do not edit manually.
4
+ * #### Enso API
5
+ - Find detailed documentation on [docs.enso.finance](https://docs.enso.finance).
6
+ - To use the API, **you must include your API Key in the Authorization header** (Bearer format).
7
+ - For testing, Swagger pre-authorizes you using the key: `1e02632d-6feb-4a75-a157-documentation` (1rps).
8
+ - Get your own API Key at [enso.finance/developers](https://enso.finance/developers).
9
+ * OpenAPI spec version: 1.0
10
+ */
11
+ import type { CallOutput } from "./callOutput";
12
+
13
+ /**
14
+ * Amount to deposit (or previous output reference)
15
+ */
16
+ export type TokenizedSingleDepositArgsDtoAmountIn = string | CallOutput;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Generated by orval v7.11.1 🍺
3
+ * Do not edit manually.
4
+ * #### Enso API
5
+ - Find detailed documentation on [docs.enso.finance](https://docs.enso.finance).
6
+ - To use the API, **you must include your API Key in the Authorization header** (Bearer format).
7
+ - For testing, Swagger pre-authorizes you using the key: `1e02632d-6feb-4a75-a157-documentation` (1rps).
8
+ - Get your own API Key at [enso.finance/developers](https://enso.finance/developers).
9
+ * OpenAPI spec version: 1.0
10
+ */
11
+ import type { TokenizedSingleRedeemArgsDto } from "./tokenizedSingleRedeemArgsDto";
12
+
13
+ export interface TokenizedSingleRedeemActionDto {
14
+ /** Protocol */
15
+ protocol: string;
16
+ action: string;
17
+ args: TokenizedSingleRedeemArgsDto;
18
+ }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Generated by orval v7.11.1 🍺
3
+ * Do not edit manually.
4
+ * #### Enso API
5
+ - Find detailed documentation on [docs.enso.finance](https://docs.enso.finance).
6
+ - To use the API, **you must include your API Key in the Authorization header** (Bearer format).
7
+ - For testing, Swagger pre-authorizes you using the key: `1e02632d-6feb-4a75-a157-documentation` (1rps).
8
+ - Get your own API Key at [enso.finance/developers](https://enso.finance/developers).
9
+ * OpenAPI spec version: 1.0
10
+ */
11
+ import type { TokenizedSingleRedeemArgsDtoAmountIn } from "./tokenizedSingleRedeemArgsDtoAmountIn";
12
+
13
+ export interface TokenizedSingleRedeemArgsDto {
14
+ /** Input token address */
15
+ tokenIn: string;
16
+ /** Output token address */
17
+ tokenOut: string;
18
+ /** Amount to redeem (or previous output reference) */
19
+ amountIn: TokenizedSingleRedeemArgsDtoAmountIn;
20
+ /** Primary contract address */
21
+ primaryAddress: string;
22
+ /** Receiver address */
23
+ receiver?: string;
24
+ }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Generated by orval v7.11.1 🍺
3
+ * Do not edit manually.
4
+ * #### Enso API
5
+ - Find detailed documentation on [docs.enso.finance](https://docs.enso.finance).
6
+ - To use the API, **you must include your API Key in the Authorization header** (Bearer format).
7
+ - For testing, Swagger pre-authorizes you using the key: `1e02632d-6feb-4a75-a157-documentation` (1rps).
8
+ - Get your own API Key at [enso.finance/developers](https://enso.finance/developers).
9
+ * OpenAPI spec version: 1.0
10
+ */
11
+ import type { CallOutput } from "./callOutput";
12
+
13
+ /**
14
+ * Amount to redeem (or previous output reference)
15
+ */
16
+ export type TokenizedSingleRedeemArgsDtoAmountIn = string | CallOutput;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Generated by orval v7.11.1 🍺
3
+ * Do not edit manually.
4
+ * #### Enso API
5
+ - Find detailed documentation on [docs.enso.finance](https://docs.enso.finance).
6
+ - To use the API, **you must include your API Key in the Authorization header** (Bearer format).
7
+ - For testing, Swagger pre-authorizes you using the key: `1e02632d-6feb-4a75-a157-documentation` (1rps).
8
+ - Get your own API Key at [enso.finance/developers](https://enso.finance/developers).
9
+ * OpenAPI spec version: 1.0
10
+ */
11
+
12
+ export type TokensControllerTokensLiquidityType =
13
+ (typeof TokensControllerTokensLiquidityType)[keyof typeof TokensControllerTokensLiquidityType];
14
+
15
+ // eslint-disable-next-line @typescript-eslint/no-redeclare
16
+ export const TokensControllerTokensLiquidityType = {
17
+ SingleToken: "SingleToken",
18
+ MultiToken: "MultiToken",
19
+ } as const;
@@ -9,6 +9,7 @@
9
9
  * OpenAPI spec version: 1.0
10
10
  */
11
11
  import type { TokensControllerTokensType } from "./tokensControllerTokensType";
12
+ import type { TokensControllerTokensLiquidityType } from "./tokensControllerTokensLiquidityType";
12
13
 
13
14
  export type TokensControllerTokensParams = {
14
15
  /**
@@ -53,6 +54,11 @@ export type TokensControllerTokensParams = {
53
54
  */
54
55
  type?: TokensControllerTokensType;
55
56
  /**
57
+ * Type of liquidity.
58
+ If not provided, both types will be taken into account
59
+ */
60
+ liquidityType?: TokensControllerTokensLiquidityType;
61
+ /**
56
62
  * Pagination page number. Pages are of length 1000
57
63
  */
58
64
  page?: number;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Generated by orval v7.11.1 🍺
3
+ * Do not edit manually.
4
+ * #### Enso API
5
+ - Find detailed documentation on [docs.enso.finance](https://docs.enso.finance).
6
+ - To use the API, **you must include your API Key in the Authorization header** (Bearer format).
7
+ - For testing, Swagger pre-authorizes you using the key: `1e02632d-6feb-4a75-a157-documentation` (1rps).
8
+ - Get your own API Key at [enso.finance/developers](https://enso.finance/developers).
9
+ * OpenAPI spec version: 1.0
10
+ */
11
+ import type { TransferArgsDto } from "./transferArgsDto";
12
+
13
+ export interface TransferActionDto {
14
+ /** Protocol */
15
+ protocol: string;
16
+ action: string;
17
+ args: TransferArgsDto;
18
+ }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Generated by orval v7.11.1 🍺
3
+ * Do not edit manually.
4
+ * #### Enso API
5
+ - Find detailed documentation on [docs.enso.finance](https://docs.enso.finance).
6
+ - To use the API, **you must include your API Key in the Authorization header** (Bearer format).
7
+ - For testing, Swagger pre-authorizes you using the key: `1e02632d-6feb-4a75-a157-documentation` (1rps).
8
+ - Get your own API Key at [enso.finance/developers](https://enso.finance/developers).
9
+ * OpenAPI spec version: 1.0
10
+ */
11
+ import type { TransferArgsDtoAmount } from "./transferArgsDtoAmount";
12
+
13
+ export interface TransferArgsDto {
14
+ /** Token address */
15
+ token: string;
16
+ /** Amount to transfer (or previous output reference) */
17
+ amount: TransferArgsDtoAmount;
18
+ /** Receiver address */
19
+ receiver: string;
20
+ /** Optional ERC721/1155 token id */
21
+ id?: string;
22
+ }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Generated by orval v7.11.1 🍺
3
+ * Do not edit manually.
4
+ * #### Enso API
5
+ - Find detailed documentation on [docs.enso.finance](https://docs.enso.finance).
6
+ - To use the API, **you must include your API Key in the Authorization header** (Bearer format).
7
+ - For testing, Swagger pre-authorizes you using the key: `1e02632d-6feb-4a75-a157-documentation` (1rps).
8
+ - Get your own API Key at [enso.finance/developers](https://enso.finance/developers).
9
+ * OpenAPI spec version: 1.0
10
+ */
11
+ import type { CallOutput } from "./callOutput";
12
+
13
+ /**
14
+ * Amount to transfer (or previous output reference)
15
+ */
16
+ export type TransferArgsDtoAmount = string | CallOutput;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Generated by orval v7.11.1 🍺
3
+ * Do not edit manually.
4
+ * #### Enso API
5
+ - Find detailed documentation on [docs.enso.finance](https://docs.enso.finance).
6
+ - To use the API, **you must include your API Key in the Authorization header** (Bearer format).
7
+ - For testing, Swagger pre-authorizes you using the key: `1e02632d-6feb-4a75-a157-documentation` (1rps).
8
+ - Get your own API Key at [enso.finance/developers](https://enso.finance/developers).
9
+ * OpenAPI spec version: 1.0
10
+ */
11
+ import type { TransferFromArgsDto } from "./transferFromArgsDto";
12
+
13
+ export interface TransferFromActionDto {
14
+ /** Protocol */
15
+ protocol: string;
16
+ action: string;
17
+ args: TransferFromArgsDto;
18
+ }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Generated by orval v7.11.1 🍺
3
+ * Do not edit manually.
4
+ * #### Enso API
5
+ - Find detailed documentation on [docs.enso.finance](https://docs.enso.finance).
6
+ - To use the API, **you must include your API Key in the Authorization header** (Bearer format).
7
+ - For testing, Swagger pre-authorizes you using the key: `1e02632d-6feb-4a75-a157-documentation` (1rps).
8
+ - Get your own API Key at [enso.finance/developers](https://enso.finance/developers).
9
+ * OpenAPI spec version: 1.0
10
+ */
11
+ import type { TransferFromArgsDtoAmount } from "./transferFromArgsDtoAmount";
12
+
13
+ export interface TransferFromArgsDto {
14
+ /** Token address */
15
+ token: string;
16
+ /** Sender address */
17
+ sender: string;
18
+ /** Receiver address */
19
+ receiver: string;
20
+ /** Amount to transfer (or previous output reference) */
21
+ amount: TransferFromArgsDtoAmount;
22
+ /** Optional ERC721/1155 token id */
23
+ id?: string;
24
+ }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Generated by orval v7.11.1 🍺
3
+ * Do not edit manually.
4
+ * #### Enso API
5
+ - Find detailed documentation on [docs.enso.finance](https://docs.enso.finance).
6
+ - To use the API, **you must include your API Key in the Authorization header** (Bearer format).
7
+ - For testing, Swagger pre-authorizes you using the key: `1e02632d-6feb-4a75-a157-documentation` (1rps).
8
+ - Get your own API Key at [enso.finance/developers](https://enso.finance/developers).
9
+ * OpenAPI spec version: 1.0
10
+ */
11
+ import type { CallOutput } from "./callOutput";
12
+
13
+ /**
14
+ * Amount to transfer (or previous output reference)
15
+ */
16
+ export type TransferFromArgsDtoAmount = string | CallOutput;
package/src/index.ts CHANGED
@@ -17,3 +17,4 @@ export {
17
17
 
18
18
  // Export theme type for TypeScript users
19
19
  export type { WidgetTheme } from "./types";
20
+ export { SupportedExchanges } from "./types";
package/src/store.ts CHANGED
@@ -1,10 +1,17 @@
1
1
  import { create } from "zustand";
2
- import { DEFAULT_SLIPPAGE } from "./util/constants";
3
2
  import { AccessTokenPayload } from "@meshconnect/web-link-sdk";
3
+ import { DEFAULT_SLIPPAGE } from "./util/constants";
4
4
 
5
5
  type Store = {
6
- isCheckout: boolean;
7
- setIsCheckout: (isCheckout: boolean) => void;
6
+ // The selected integration object from Mesh /integrations
7
+ selectedIntegration?: {
8
+ id: string;
9
+ type: string; // brokerType
10
+ name: string;
11
+ } | null;
12
+ setSelectedIntegration: (
13
+ selectedIntegration: { id: string; type: string; name: string } | null,
14
+ ) => void;
8
15
 
9
16
  ensoApiToken: string;
10
17
  setEnsoApiToken: (ensoApiToken: string) => void;
@@ -35,8 +42,9 @@ type Store = {
35
42
  };
36
43
 
37
44
  export const useAppStore = create<Store>((set) => ({
38
- isCheckout: false,
39
- setIsCheckout: (isCheckout: boolean) => set({ isCheckout }),
45
+ selectedIntegration: null,
46
+ setSelectedIntegration: (selectedIntegration) =>
47
+ set({ selectedIntegration }),
40
48
 
41
49
  ensoApiToken: "",
42
50
  setEnsoApiToken: (ensoApiToken: string) => set({ ensoApiToken }),
@@ -1,9 +1,12 @@
1
1
  // Re-export Chakra's SystemConfig as the theme type
2
2
  import type { SystemConfig as WidgetTheme } from "@chakra-ui/react";
3
3
 
4
- export type { WidgetTheme };
5
-
6
- export type SupportedExchanges = "binance";
4
+ enum SupportedExchanges {
5
+ Binance = "binance",
6
+ Kraken = "kraken",
7
+ Coinbase = "coinbase",
8
+ Bybit = "bybit",
9
+ }
7
10
 
8
11
  export type CheckoutConfig = {
9
12
  tokenOut: string;
@@ -19,3 +22,6 @@ export type CheckoutModalProps = {
19
22
  setIsActive: (active: boolean) => void;
20
23
  onClose?: () => void;
21
24
  };
25
+
26
+ export type { WidgetTheme };
27
+ export { SupportedExchanges };
@@ -260,6 +260,8 @@ const getAlternativeMeshSymbol = (
260
260
  if (symbol === "USDT") {
261
261
  if (chainId === SupportedChainId.BSC) {
262
262
  return "BSC-USD";
263
+ } else if (chainId === SupportedChainId.MAINNET) {
264
+ return "USDT";
263
265
  }
264
266
 
265
267
  return "USDT0";
@@ -310,7 +312,8 @@ export const useEtherscanUrl = (
310
312
  if (address) return `${chainPrefix}${type}/${address}`;
311
313
  };
312
314
 
313
- export const capitalize = (s: string) => s.charAt(0).toUpperCase() + s.slice(1);
315
+ export const capitalize = (s: string) =>
316
+ s.charAt(0)?.toUpperCase() + s.slice(1);
314
317
 
315
318
  export const getChainName = (chainId: SupportedChainId) => {
316
319
  const geckoName = GECKO_CHAIN_NAMES[chainId];