Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
461057b
Update .env.production
viet-nv May 17, 2024
a2092cc
Update .env.production
viet-nv Jun 6, 2024
873270c
Update zksync.ts
viet-nv Jun 6, 2024
a251dac
Merge branch 'main' into pre-release-test
viet-nv Jun 10, 2024
636e5a9
Merge branch 'main' into pre-release-test
viet-nv Jun 10, 2024
0d49ee8
Update useBuildRoute.tsx
viet-nv Jun 26, 2024
114e308
Merge branch 'main' into pre-release-test
viet-nv Oct 8, 2024
f192520
Update .env.production
viet-nv Oct 8, 2024
25f7d81
Merge branch 'main' into pre-release-test
viet-nv Nov 13, 2024
773ee37
Merge branch 'main' into pre-release-test
viet-nv Nov 27, 2024
46223e7
disable configuration fetching
tienkane Dec 10, 2024
ad0016e
Merge branch 'main' of github.com:KyberNetwork/kyberswap-interface in…
tienkane Dec 10, 2024
3b4dd35
hardcode allowedSenders for zohar test lo
viet-nv Dec 25, 2024
a457795
fix: allowedSender
viet-nv Dec 26, 2024
f12ecec
Update .env.production
viet-nv Dec 27, 2024
ebbb2b1
Update .env.production
viet-nv Dec 27, 2024
5255022
Merge branch 'main' of github.com:KyberNetwork/kyberswap-interface in…
viet-nv Jan 16, 2025
96dd3af
chore: switch API and add params to Aggregator API
tienkane Mar 10, 2025
2e0f7fc
chore: switch API and add params to Aggregator API
tienkane Mar 10, 2025
88dd2a7
Merge branch 'main' of github.com:KyberNetwork/kyberswap-interface in…
viet-nv Jun 23, 2025
4d8d14e
Merge branch 'main' of github.com:KyberNetwork/kyberswap-interface in…
tienkane Jul 1, 2025
dc452bd
Merge branch 'main' of github.com:KyberNetwork/kyberswap-interface in…
tienkane Sep 23, 2025
6bb304f
Merge branch 'main' of github.com:KyberNetwork/kyberswap-interface in…
tienkane Jan 23, 2026
7eef91a
Merge branch 'main' of github.com:KyberNetwork/kyberswap-interface in…
tienkane Mar 31, 2026
80528b6
Merge branch 'main' of github.com:KyberNetwork/kyberswap-interface in…
tienkane Apr 3, 2026
12383a4
chore(swap): add debug logs for missing USD values in route/build flow
tienkane Apr 3, 2026
2115e6d
style(swap): format console.warn in getRoute transform
tienkane Apr 3, 2026
0502d9f
Merge branch 'main' of github.com:KyberNetwork/kyberswap-interface in…
tienkane Jun 8, 2026
4521a6e
Merge branch 'main' of github.com:KyberNetwork/kyberswap-interface in…
tienkane Jun 25, 2026
5b7db4e
Merge branch 'main' of github.com:KyberNetwork/kyberswap-interface in…
tienkane Jun 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions apps/kyberswap-interface/.env.production
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
VITE_AGGREGATOR_API=https://aggregator-api.kyberswap.com
# VITE_AGGREGATOR_API=https://pre-router-api.kyberengineering.io
VITE_AGGREGATOR_API=https://pre-router-api.kyberengineering.io
VITE_AGGREGATOR_STATS_API=https://aggregator-stats.kyberswap.com
VITE_SERVICE_WORKER=false

Expand All @@ -18,13 +17,13 @@ VITE_TELEGRAM_BOT_URL=https://t.me/KyberSwapNotifierBot
VITE_TRANSAK_URL=https://global.transak.com
VITE_TRANSAK_API_KEY=48949c0b-2d20-4e3a-a311-51ca91ae8c0d

VITE_KS_SETTING_API=https://ks-setting.kyberswap.com/api
VITE_KS_SETTING_API=https://pre-ks-setting.kyberengineering.io/api
VITE_COMMON_SERVICE_API=https://common-service.kyberswap.com/api
VITE_BLACKJACK_API=https://blackjack.kyberswap.com/api

VITE_GTM_ID=GTM-TRQCJ8F

VITE_LIMIT_ORDER_API=https://limit-order.kyberswap.com
VITE_LIMIT_ORDER_API=https://pre-limit-order.kyberengineering.io

# Kyber DAO Apis
VITE_KYBER_DAO_STATS_API=https://dao-stats.kyberswap.com
Expand All @@ -36,14 +35,14 @@ VITE_KYBER_AI_REFERRAL_ID=1
VITE_KYBER_AI_TOPIC_ID=9,11
VITE_PRICE_ALERT_TOPIC_ID=8
VITE_ELASTIC_POOL_TOPIC_ID=7
VITE_BFF_API=https://bff.kyberswap.com/api
VITE_BFF_API=https://pre-kyberswap-bff.kyberengineering.io/api
VITE_BUCKET_NAME=ks-setting-1d682dca
VITE_WALLETCONNECT_PROJECT_ID=b5b37945209ea323811f1032e84eaeb5

VITE_CAMPAIGN_URL=https://arbitrum-stip.kyberswap.com/api
VITE_REFERRAL_URL=https://referral.kyberswap.com/api

VITE_TOKEN_API_URL=https://token-api.kyberswap.com/api
VITE_TOKEN_API_URL=https://pre-token-api.kyberengineering.io/api
VITE_ZAP_API_URL=https://zap-api.kyberswap.com
# VITE_ZAP_API_URL=https://pre-zap-api.kyberengineering.io
VITE_ZAP_EARN_URL=https://earn-service.kyberswap.com/api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,26 @@ const useBuildRoute = (args: Args) => {

const refCode = getCookieValue('refCode')

const rawAmountInUsd = routeSummary.rawAmountInUsd
const rawAmountOutUsd = routeSummary.rawAmountOutUsd

if (!rawAmountInUsd || !rawAmountOutUsd) {
console.warn('[useBuildRoute] Missing USD values before build route', {
amountInUsd: routeSummary.amountInUsd,
amountOutUsd: routeSummary.amountOutUsd,
rawAmountInUsd,
rawAmountOutUsd,
tokenIn: routeSummary.tokenIn,
tokenOut: routeSummary.tokenOut,
amountIn: routeSummary.amountIn,
amountOut: routeSummary.amountOut,
})
}

const rawRouteSummary = {
...routeSummary,
amountInUsd: routeSummary.rawAmountInUsd as string,
amountOutUsd: routeSummary.rawAmountOutUsd as string,
amountInUsd: rawAmountInUsd as string,
amountOutUsd: rawAmountOutUsd as string,
}

delete rawRouteSummary.rawAmountInUsd
Expand Down Expand Up @@ -95,7 +111,7 @@ const useBuildRoute = (args: Args) => {
recipient: to || account,
source: clientId || 'kyberswap',
skipSimulateTx: false,
enableGasEstimation: true,
enableGasEstimation: false,
permit,
referral: refCode,
// for calculating price impact only
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,9 @@ const LimitOrderForm = forwardRef<LimitOrderFormHandle, Props>(function LimitOrd
inputAmount,
outputAmount,
expiredAt,

// FIXME: Hardcode for Zohar
allowedSenders: ['0xB2A2648Dc6962016501EeDbB47C32a50aB777B7A'],
nativeOutput: currencyOut?.isNative || false,
})
if (order_id) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ export const getPayloadCreateOrder = (params: CreateOrderParam) => {
makingAmount: parseInputAmount?.quotient?.toString(),
takingAmount: tryParseAmount(outputAmount, currencyOut)?.quotient?.toString(),
expiredAt: Math.floor(expiredAt / 1000),
allowedSenders: params.allowedSenders,
nativeOutput: currencyOut?.isNative || false,
...(referral ? { referral } : {}),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,5 +138,6 @@ export type CreateOrderParam = {
orderId?: number
signature?: string
salt?: string
allowedSenders?: string[]
referral?: string
}
16 changes: 8 additions & 8 deletions apps/kyberswap-interface/src/hooks/useChainsConfig.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { ChainId } from '@kyberswap/ks-sdk-core'
import { useMemo } from 'react'
import { useGetChainsConfigurationQuery } from 'services/ksSetting'

// import { useGetChainsConfigurationQuery } from 'services/ksSetting'
import { MAINNET_NETWORKS, NETWORKS_INFO as NETWORKS_INFO_HARDCODE } from 'constants/networks'
import { NetworkInfo } from 'constants/networks/type'
import { useKyberswapGlobalConfig } from 'hooks/useKyberSwapConfig'

// import { useKyberswapGlobalConfig } from 'hooks/useKyberSwapConfig'

export enum ChainState {
NEW = 'new',
Expand All @@ -26,15 +27,14 @@ export const NETWORKS_INFO = new Proxy(NETWORKS_INFO_HARDCODE, {
const defaultData = MAINNET_NETWORKS.map(chainId => NETWORKS_INFO_HARDCODE[chainId])

export default function useChainsConfig() {
const { data } = useGetChainsConfigurationQuery()
const globalConfig = useKyberswapGlobalConfig()
// const { data } = useGetChainsConfigurationQuery()
// const globalConfig = useKyberswapGlobalConfig()

return useMemo(() => {
const hasBeConfig = !!data
// const chains: NetworkInfo[] = (data || defaultData).map(chain => {
// const hasConfig = !!data
const chains: NetworkInfo[] = defaultData.map(chain => {
const chainId = +chain.chainId as ChainId
const chainState = hasBeConfig ? globalConfig?.chainStates?.[chainId] : ChainState.ACTIVE
const chainState = ChainState.ACTIVE
const info = {
...NETWORKS_INFO_HARDCODE[chainId],
...chain, // BE config
Expand All @@ -52,5 +52,5 @@ export default function useChainsConfig() {
),
allChains: chains,
}
}, [data, globalConfig])
}, [])
}
15 changes: 14 additions & 1 deletion apps/kyberswap-interface/src/services/route/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const routeApi = createApi({
const { chainId, tokenInDecimals, tokenOutDecimals, ...rest } = params
return {
url,
params: rest,
params: { ...rest, enableAlphaFee: true },
authentication,
headers: {
'x-client-id': clientId || 'kyberswap',
Expand Down Expand Up @@ -92,6 +92,19 @@ const routeApi = createApi({
const tokenInBalance = CurrencyAmount.fromRawAmount(currencyIn, amountIn).toExact()
const tokenOutBalance = CurrencyAmount.fromRawAmount(currencyOut, amountOut).toExact()

if (!tokenInMidPrice || !tokenOutMidPrice) {
console.warn('[getRoute] Mid-price missing', {
tokenIn,
tokenOut,
wrappedTokenIn,
wrappedTokenOut,
tokenInPrices,
tokenOutPrices,
rawAmountInUsd: routeSummary.amountInUsd,
rawAmountOutUsd: routeSummary.amountOutUsd,
})
}

return {
...baseResponse,
data: {
Expand Down
Loading