diff --git a/src/components/SwapForm/hooks/useBuildRoute.tsx b/src/components/SwapForm/hooks/useBuildRoute.tsx index 5bb65c84f3..4dcf21405e 100644 --- a/src/components/SwapForm/hooks/useBuildRoute.tsx +++ b/src/components/SwapForm/hooks/useBuildRoute.tsx @@ -61,7 +61,7 @@ const useBuildRoute = (args: Args) => { slippageTolerance: slippage, sender: account, recipient: to || account, - source: clientId || 'kyberswap', + source: clientId || 'kyberswap-ui', skipSimulateTx: false, permit, } diff --git a/src/constants/index.ts b/src/constants/index.ts index fa340712f7..de1867f189 100644 --- a/src/constants/index.ts +++ b/src/constants/index.ts @@ -131,7 +131,7 @@ export const CAMPAIGN_LEADERBOARD_ITEM_PER_PAGE = 10 export const CAMPAIGN_YOUR_TRANSACTIONS_ITEM_PER_PAGE = 10000 export const ELASTIC_BASE_FEE_UNIT = 100_000 -export const KYBERSWAP_SOURCE = '{"source":"kyberswap"}' +export const KYBERSWAP_SOURCE = '{"source":"kyberswap-ui"}' export const SWR_KEYS = { getGrantProgramLeaderBoard: (id: number | string) => `${CAMPAIGN_BASE_URL}/api/v1/competitions/${id}/leaderboard`, diff --git a/src/services/route/index.ts b/src/services/route/index.ts index 8984d75c5b..cece92496c 100644 --- a/src/services/route/index.ts +++ b/src/services/route/index.ts @@ -24,7 +24,7 @@ const routeApi = createApi({ params, authentication, headers: { - 'x-client-id': clientId || 'kyberswap', + 'x-client-id': clientId || 'kyberswap-ui', }, }), }), @@ -39,7 +39,7 @@ const routeApi = createApi({ signal, authentication, headers: { - 'x-client-id': payload.source || 'kyberswap', + 'x-client-id': payload.source || 'kyberswap-ui', }, }), }), diff --git a/src/state/swap/hooks.ts b/src/state/swap/hooks.ts index a4f1dd3306..64b57bbc20 100644 --- a/src/state/swap/hooks.ts +++ b/src/state/swap/hooks.ts @@ -157,6 +157,8 @@ export function tryParseAmount( const typedValueParsed = parseFraction(value) .multiply(scaleDecimals ? 10 ** currency.decimals : 1) .toFixed(0) + + if (typedValueParsed === '0') return undefined const result = CurrencyAmount.fromRawAmount(currency, typedValueParsed) return result } catch (error) {