Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions apps/kyberswap-interface/.env
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,6 @@ VITE_ZAP_EARN_URL=https://zap-earn-service-v3.kyberengineering.io/api

VITE_AFFILIATE_SERVICE=https://pre-affiliate-service.kyberengineering.io/api
VITE_OAUTH_INTERCEPTOR_API=https://pre-oauth-interceptor-api.kyberengineering.io/api
VITE_SOLANA_RPC=https://solana.kyberengineering.io

VITE_CROSSCHAIN_AGGREGATOR_API=https://pre-crosschain-aggregator.kyberengineering.io
3 changes: 3 additions & 0 deletions apps/kyberswap-interface/.env.dev
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,6 @@ VITE_ZAP_EARN_URL=https://zap-earn-service-v3.kyberengineering.io/api

VITE_AFFILIATE_SERVICE=https://pre-affiliate-service.kyberengineering.io/api
VITE_OAUTH_INTERCEPTOR_API=https://pre-oauth-interceptor-api.kyberengineering.io/api
VITE_SOLANA_RPC=https://solana.kyberengineering.io

VITE_CROSSCHAIN_AGGREGATOR_API=https://pre-crosschain-aggregator.kyberengineering.io
2 changes: 2 additions & 0 deletions apps/kyberswap-interface/.env.production
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,5 @@ VITE_ZAP_EARN_URL=https://zap-earn-service-v3.kyberengineering.io/api

VITE_AFFILIATE_SERVICE=https://affiliate-service.kyberengineering.io/api
VITE_SOLANA_RPC=https://solana.kyberengineering.io

VITE_CROSSCHAIN_AGGREGATOR_API=https://pre-crosschain-aggregator.kyberengineering.io
3 changes: 3 additions & 0 deletions apps/kyberswap-interface/.env.stg
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,6 @@ VITE_ZAP_EARN_URL=https://zap-earn-service-v3.kyberengineering.io/api

VITE_AFFILIATE_SERVICE=https://pre-affiliate-service.kyberengineering.io/api
VITE_OAUTH_INTERCEPTOR_API=https://pre-oauth-interceptor-api.kyberengineering.io/api
VITE_SOLANA_RPC=https://solana.kyberengineering.io

VITE_CROSSCHAIN_AGGREGATOR_API=https://pre-crosschain-aggregator.kyberengineering.io
1 change: 1 addition & 0 deletions apps/kyberswap-interface/src/constants/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export const REFERRAL_URL = required('REFERRAL_URL')
export const TOKEN_API_URL = required('TOKEN_API_URL')
export const AFFILIATE_SERVICE_URL = required('AFFILIATE_SERVICE')
export const SOLANA_RPC = required('SOLANA_RPC')
export const CROSSCHAIN_AGGREGATOR_API = required('CROSSCHAIN_AGGREGATOR_API')

type FirebaseConfig = {
apiKey: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,9 @@ export class NearIntentsAdapter extends BaseSwapAdapter {
) {
throw new Error('Near Intent recipient or refundTo is ZERO ADDRESS')
}

console.log('refreshedQuote.quote.minAmountOut ======', refreshedQuote.quote.minAmountOut)
console.log('quote.rawQuote.quote.minAmountOut ======', quote.rawQuote.quote.minAmountOut)
if (BigInt(refreshedQuote.quote.minAmountOut) < BigInt(quote.rawQuote.quote.minAmountOut)) {
throw new Error('Quote amount out is less than expected')
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ export class OptimexAdapter extends BaseSwapAdapter {
constructor() {
super()
this.tokens = []

// Initialize tokens asynchronously when the adapter is created
this.getTokens().catch(error => {
console.error('Failed to initialize Optimex tokens:', error)
})
}

private async getTokens() {
Expand Down Expand Up @@ -251,6 +256,10 @@ export class OptimexAdapter extends BaseSwapAdapter {
_nearWallet: any,
sendBtcFn?: (params: { recipient: string; amount: string | number }) => Promise<string>,
): Promise<NormalizedTxResponse> {
if (!this.tokens?.length) {
await this.getTokens()
}

// For EVM -> BTC flow, txData should already exist from getQuote
// For BTC -> EVM flow, we need to initiate the trade here
let txData: { deposit_address: string; payload?: string; trade_id: string }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export const SwapAction = ({ setShowBtcModal }: { setShowBtcModal: (val: boolean
toChainId,
currencyIn,
currencyOut,
allLoading,
loading,
selectedQuote,
recipient,
Expand Down Expand Up @@ -79,7 +78,7 @@ export const SwapAction = ({ setShowBtcModal }: { setShowBtcModal: (val: boolean
onClick: () => {},
}
}
if (allLoading)
if (loading)
return {
label: t`Finding the best route...`,
disabled: true,
Expand Down
Loading