@rango-dev/widget-embedded 0.40.2-next.1 → 0.40.2-next.11
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.
- package/dist/components/CustomTokenModal/CustomTokenModal.constants.d.ts +2 -0
- package/dist/components/CustomTokenModal/CustomTokenModal.constants.d.ts.map +1 -0
- package/dist/components/CustomTokenModal/CustomTokenModal.d.ts.map +1 -1
- package/dist/components/CustomTokenModal/CustomTokenModal.types.d.ts +1 -0
- package/dist/components/CustomTokenModal/CustomTokenModal.types.d.ts.map +1 -1
- package/dist/components/ImportCustomToken/ImportCustomToken.d.ts +4 -0
- package/dist/components/ImportCustomToken/ImportCustomToken.d.ts.map +1 -0
- package/dist/components/ImportCustomToken/ImportCustomToken.types.d.ts +15 -0
- package/dist/components/ImportCustomToken/ImportCustomToken.types.d.ts.map +1 -0
- package/dist/components/ImportCustomToken/index.d.ts +2 -0
- package/dist/components/ImportCustomToken/index.d.ts.map +1 -0
- package/dist/components/Layout/Layout.d.ts.map +1 -1
- package/dist/components/Layout/Layout.styles.d.ts +161 -0
- package/dist/components/Layout/Layout.styles.d.ts.map +1 -1
- package/dist/components/Quote/Quote.styles.d.ts +2 -2
- package/dist/components/SearchInput/SearchInput.d.ts.map +1 -1
- package/dist/components/SearchInput/SearchInput.types.d.ts +4 -2
- package/dist/components/SearchInput/SearchInput.types.d.ts.map +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsModal.types.d.ts +2 -2
- package/dist/components/SwapDetailsModal/SwapDetailsModal.types.d.ts.map +1 -1
- package/dist/components/TokenList/TokenList.d.ts.map +1 -1
- package/dist/components/TokenList/TokenList.styles.d.ts +323 -1
- package/dist/components/TokenList/TokenList.styles.d.ts.map +1 -1
- package/dist/components/TokenList/TokenList.types.d.ts +6 -1
- package/dist/components/TokenList/TokenList.types.d.ts.map +1 -1
- package/dist/constants/customTokens.d.ts +1 -0
- package/dist/constants/customTokens.d.ts.map +1 -1
- package/dist/containers/Inputs/Inputs.d.ts.map +1 -1
- package/dist/hooks/useFetchCustomToken.d.ts +8 -4
- package/dist/hooks/useFetchCustomToken.d.ts.map +1 -1
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.helpers.d.ts +2 -2
- package/dist/hooks/useSearchCustomTokens/index.d.ts +2 -0
- package/dist/hooks/useSearchCustomTokens/index.d.ts.map +1 -0
- package/dist/hooks/useSearchCustomTokens/types.d.ts +9 -0
- package/dist/hooks/useSearchCustomTokens/types.d.ts.map +1 -0
- package/dist/hooks/useSearchCustomTokens/useSearchCustomTokens.constants.d.ts +2 -0
- package/dist/hooks/useSearchCustomTokens/useSearchCustomTokens.constants.d.ts.map +1 -0
- package/dist/hooks/useSearchCustomTokens/useSearchCustomTokens.d.ts +3 -0
- package/dist/hooks/useSearchCustomTokens/useSearchCustomTokens.d.ts.map +1 -0
- package/dist/hooks/useSwapInput.d.ts.map +1 -1
- package/dist/hooks/useSyncStoresWithConfig.d.ts.map +1 -1
- package/dist/hooks/useSyncUrlAndStore/useSyncUrlAndStore.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +4 -4
- package/dist/pages/AddCustomTokenPage.d.ts.map +1 -1
- package/dist/pages/CustomTokensPage.d.ts.map +1 -1
- package/dist/pages/SelectSwapItemPage/SelectSwapItemPage.constants.d.ts +3 -0
- package/dist/pages/SelectSwapItemPage/SelectSwapItemPage.constants.d.ts.map +1 -0
- package/dist/pages/SelectSwapItemPage/SelectSwapItemPage.helpers.d.ts +4 -0
- package/dist/pages/SelectSwapItemPage/SelectSwapItemPage.helpers.d.ts.map +1 -0
- package/dist/pages/SelectSwapItemPage/SelectSwapItemsPage.d.ts.map +1 -0
- package/dist/pages/SelectSwapItemPage/index.d.ts +2 -0
- package/dist/pages/SelectSwapItemPage/index.d.ts.map +1 -0
- package/dist/store/app.d.ts +1 -1
- package/dist/store/app.d.ts.map +1 -1
- package/dist/store/quote.d.ts +9 -6
- package/dist/store/quote.d.ts.map +1 -1
- package/dist/store/slices/settings.d.ts +4 -2
- package/dist/store/slices/settings.d.ts.map +1 -1
- package/dist/store/slices/wallets.d.ts +5 -1
- package/dist/store/slices/wallets.d.ts.map +1 -1
- package/dist/store/utils/wallets.d.ts +2 -1
- package/dist/store/utils/wallets.d.ts.map +1 -1
- package/dist/types/config.d.ts +5 -0
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/wallets.d.ts +1 -0
- package/dist/types/wallets.d.ts.map +1 -1
- package/dist/utils/quote.d.ts +1 -1
- package/dist/utils/quote.d.ts.map +1 -1
- package/dist/utils/settings.d.ts +1 -1
- package/dist/utils/swap.d.ts +1 -0
- package/dist/utils/swap.d.ts.map +1 -1
- package/dist/utils/wallets.d.ts.map +1 -1
- package/dist/widget-embedded.build.json +1 -1
- package/package.json +12 -12
- package/src/components/AppRoutes.tsx +1 -1
- package/src/components/CustomTokenModal/CustomTokenModal.constants.ts +2 -0
- package/src/components/CustomTokenModal/CustomTokenModal.tsx +26 -5
- package/src/components/CustomTokenModal/CustomTokenModal.types.ts +1 -0
- package/src/components/ImportCustomToken/ImportCustomToken.tsx +121 -0
- package/src/components/ImportCustomToken/ImportCustomToken.types.ts +18 -0
- package/src/components/ImportCustomToken/index.ts +1 -0
- package/src/components/Layout/Layout.styles.ts +12 -0
- package/src/components/Layout/Layout.tsx +37 -5
- package/src/components/NotificationContent/NotificationContent.tsx +2 -2
- package/src/components/Quote/QuoteTrigger.tsx +5 -5
- package/src/components/QuoteSkeleton/QuoteSummarySkeleton.tsx +2 -2
- package/src/components/QuoteSkeleton/StepSkeleton.tsx +2 -2
- package/src/components/SearchInput/SearchInput.tsx +13 -10
- package/src/components/SearchInput/SearchInput.types.ts +4 -2
- package/src/components/SwapDetailsModal/SwapDetailsModal.types.ts +2 -2
- package/src/components/TokenList/TokenList.styles.ts +40 -0
- package/src/components/TokenList/TokenList.tsx +134 -22
- package/src/components/TokenList/TokenList.types.ts +5 -1
- package/src/constants/customTokens.ts +3 -0
- package/src/containers/Inputs/Inputs.tsx +6 -4
- package/src/hooks/useFetchCustomToken.ts +39 -16
- package/src/hooks/useSearchCustomTokens/index.ts +1 -0
- package/src/hooks/useSearchCustomTokens/types.ts +9 -0
- package/src/hooks/useSearchCustomTokens/useSearchCustomTokens.constants.ts +1 -0
- package/src/hooks/useSearchCustomTokens/useSearchCustomTokens.ts +81 -0
- package/src/hooks/useSwapInput.ts +9 -2
- package/src/hooks/useSyncStoresWithConfig.ts +2 -3
- package/src/hooks/useSyncUrlAndStore/useSyncUrlAndStore.ts +1 -3
- package/src/pages/AddCustomTokenPage.tsx +24 -94
- package/src/pages/CustomTokensPage.tsx +1 -0
- package/src/pages/SelectSwapItemPage/SelectSwapItemPage.constants.ts +2 -0
- package/src/pages/SelectSwapItemPage/SelectSwapItemPage.helpers.ts +51 -0
- package/src/pages/{SelectSwapItemsPage.tsx → SelectSwapItemPage/SelectSwapItemsPage.tsx} +54 -13
- package/src/pages/SelectSwapItemPage/index.ts +1 -0
- package/src/store/app.ts +12 -1
- package/src/store/quote.ts +6 -3
- package/src/store/slices/settings.ts +11 -4
- package/src/store/slices/wallets.ts +106 -2
- package/src/store/utils/wallets.ts +31 -2
- package/src/types/config.ts +5 -0
- package/src/types/wallets.ts +1 -0
- package/src/utils/quote.ts +1 -1
- package/src/utils/swap.ts +3 -0
- package/src/utils/wallets.ts +9 -2
- package/dist/pages/SelectSwapItemsPage.d.ts.map +0 -1
- /package/dist/pages/{SelectSwapItemsPage.d.ts → SelectSwapItemPage/SelectSwapItemsPage.d.ts} +0 -0
package/src/utils/quote.ts
CHANGED
|
@@ -293,7 +293,7 @@ export function getPriceImpact(
|
|
|
293
293
|
|
|
294
294
|
export const getUniqueBlockchains = (steps: Step[]) => {
|
|
295
295
|
const set = new Set();
|
|
296
|
-
const result: { displayName: string; image
|
|
296
|
+
const result: { displayName: string; image?: string }[] = [];
|
|
297
297
|
steps.forEach((step) => {
|
|
298
298
|
if (!set.has(step.from.chain.displayName)) {
|
|
299
299
|
set.add(step.from.chain.displayName);
|
package/src/utils/swap.ts
CHANGED
|
@@ -455,6 +455,7 @@ export function createQuoteRequestBody(params: {
|
|
|
455
455
|
affiliatePercent: number | null;
|
|
456
456
|
affiliateWallets: { [key: string]: string } | null;
|
|
457
457
|
destination?: string;
|
|
458
|
+
contractCall: boolean;
|
|
458
459
|
}): BestRouteRequest {
|
|
459
460
|
const {
|
|
460
461
|
fromToken,
|
|
@@ -470,6 +471,7 @@ export function createQuoteRequestBody(params: {
|
|
|
470
471
|
affiliatePercent,
|
|
471
472
|
affiliateWallets,
|
|
472
473
|
destination,
|
|
474
|
+
contractCall,
|
|
473
475
|
} = params;
|
|
474
476
|
const selectedWalletsMap = selectedWallets?.reduce(
|
|
475
477
|
(
|
|
@@ -509,6 +511,7 @@ export function createQuoteRequestBody(params: {
|
|
|
509
511
|
connectedWallets,
|
|
510
512
|
selectedWallets: selectedWalletsMap ?? {},
|
|
511
513
|
slippage: slippage.toString(),
|
|
514
|
+
contractCall,
|
|
512
515
|
...(destination && { destination: destination }),
|
|
513
516
|
...(excludeLiquiditySources && {
|
|
514
517
|
swapperGroups: disabledLiquiditySources.concat(liquiditySources ?? []),
|
package/src/utils/wallets.ts
CHANGED
|
@@ -45,6 +45,8 @@ export type ExtendedModalWalletInfo = WalletInfoWithExtra &
|
|
|
45
45
|
Pick<ExtendedWalletInfo, 'properties' | 'isHub'>;
|
|
46
46
|
|
|
47
47
|
export function mapStatusToWalletState(state: WalletState): WalletStatus {
|
|
48
|
+
// TODO: refactor
|
|
49
|
+
// eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check
|
|
48
50
|
switch (true) {
|
|
49
51
|
case state.connected:
|
|
50
52
|
return WalletStatus.CONNECTED;
|
|
@@ -137,7 +139,11 @@ export function prepareAccountsForWalletStore(
|
|
|
137
139
|
): Wallet[] {
|
|
138
140
|
const result: Wallet[] = [];
|
|
139
141
|
|
|
140
|
-
function addAccount(
|
|
142
|
+
function addAccount(
|
|
143
|
+
network: Network,
|
|
144
|
+
address: string,
|
|
145
|
+
isContractWallet?: boolean
|
|
146
|
+
) {
|
|
141
147
|
const accountForChainAlreadyExists = !!result.find(
|
|
142
148
|
(account) => account.chain === network
|
|
143
149
|
);
|
|
@@ -146,6 +152,7 @@ export function prepareAccountsForWalletStore(
|
|
|
146
152
|
address,
|
|
147
153
|
chain: network,
|
|
148
154
|
walletType: wallet,
|
|
155
|
+
isContractWallet: isContractWallet ?? false,
|
|
149
156
|
};
|
|
150
157
|
|
|
151
158
|
result.push(newAccount);
|
|
@@ -192,7 +199,7 @@ export function prepareAccountsForWalletStore(
|
|
|
192
199
|
* for contract wallets like Safe wallet, we should add only account for the
|
|
193
200
|
* current connected blockchain not all of the supported blockchains
|
|
194
201
|
*/
|
|
195
|
-
addAccount(network, address.toLowerCase());
|
|
202
|
+
addAccount(network, address.toLowerCase(), isContractWallet);
|
|
196
203
|
} else {
|
|
197
204
|
/*
|
|
198
205
|
* all evm chains are not supported in wallets, so we are adding
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelectSwapItemsPage.d.ts","sourceRoot":"","sources":["../../src/pages/SelectSwapItemsPage.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAYxC,UAAU,SAAS;IACjB,IAAI,EAAE,QAAQ,GAAG,aAAa,CAAC;CAChC;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,SAAS,qBAiGnD"}
|
/package/dist/pages/{SelectSwapItemsPage.d.ts → SelectSwapItemPage/SelectSwapItemsPage.d.ts}
RENAMED
|
File without changes
|