File tree Expand file tree Collapse file tree 9 files changed +426
-84
lines changed
Expand file tree Collapse file tree 9 files changed +426
-84
lines changed Original file line number Diff line number Diff line change @@ -46,3 +46,6 @@ VITE_ZAP_EARN_URL=https://zap-earn-service-v3.kyberengineering.io/api
4646
4747VITE_AFFILIATE_SERVICE = https://pre-affiliate-service.kyberengineering.io/api
4848VITE_OAUTH_INTERCEPTOR_API = https://pre-oauth-interceptor-api.kyberengineering.io/api
49+ VITE_SOLANA_RPC = https://solana.kyberengineering.io
50+
51+ VITE_CROSSCHAIN_AGGREGATOR_API = https://pre-crosschain-aggregator.kyberengineering.io
Original file line number Diff line number Diff line change @@ -47,3 +47,6 @@ VITE_ZAP_EARN_URL=https://zap-earn-service-v3.kyberengineering.io/api
4747
4848VITE_AFFILIATE_SERVICE = https://pre-affiliate-service.kyberengineering.io/api
4949VITE_OAUTH_INTERCEPTOR_API = https://pre-oauth-interceptor-api.kyberengineering.io/api
50+ VITE_SOLANA_RPC = https://solana.kyberengineering.io
51+
52+ VITE_CROSSCHAIN_AGGREGATOR_API = https://pre-crosschain-aggregator.kyberengineering.io
Original file line number Diff line number Diff line change @@ -46,3 +46,5 @@ VITE_ZAP_EARN_URL=https://zap-earn-service-v3.kyberengineering.io/api
4646
4747VITE_AFFILIATE_SERVICE = https://affiliate-service.kyberengineering.io/api
4848VITE_SOLANA_RPC = https://solana.kyberengineering.io
49+
50+ VITE_CROSSCHAIN_AGGREGATOR_API = https://crosschain-aggregator.kyberswap.com
Original file line number Diff line number Diff line change @@ -45,3 +45,6 @@ VITE_ZAP_EARN_URL=https://zap-earn-service-v3.kyberengineering.io/api
4545
4646VITE_AFFILIATE_SERVICE=https://pre-affiliate-service.kyberengineering.io/api
4747VITE_OAUTH_INTERCEPTOR_API=https://pre-oauth-interceptor-api.kyberengineering.io/api
48+ VITE_SOLANA_RPC=https://solana.kyberengineering.io
49+
50+ VITE_CROSSCHAIN_AGGREGATOR_API=https://pre-crosschain-aggregator.kyberengineering.io
Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ export const REFERRAL_URL = required('REFERRAL_URL')
5757export const TOKEN_API_URL = required ( 'TOKEN_API_URL' )
5858export const AFFILIATE_SERVICE_URL = required ( 'AFFILIATE_SERVICE' )
5959export const SOLANA_RPC = required ( 'SOLANA_RPC' )
60+ export const CROSSCHAIN_AGGREGATOR_API = required ( 'CROSSCHAIN_AGGREGATOR_API' )
6061
6162type FirebaseConfig = {
6263 apiKey : string
Original file line number Diff line number Diff line change @@ -49,6 +49,11 @@ export class OptimexAdapter extends BaseSwapAdapter {
4949 constructor ( ) {
5050 super ( )
5151 this . tokens = [ ]
52+
53+ // Initialize tokens asynchronously when the adapter is created
54+ this . getTokens ( ) . catch ( error => {
55+ console . error ( 'Failed to initialize Optimex tokens:' , error )
56+ } )
5257 }
5358
5459 private async getTokens ( ) {
@@ -251,6 +256,10 @@ export class OptimexAdapter extends BaseSwapAdapter {
251256 _nearWallet : any ,
252257 sendBtcFn ?: ( params : { recipient : string ; amount : string | number } ) => Promise < string > ,
253258 ) : Promise < NormalizedTxResponse > {
259+ if ( ! this . tokens ?. length ) {
260+ await this . getTokens ( )
261+ }
262+
254263 // For EVM -> BTC flow, txData should already exist from getQuote
255264 // For BTC -> EVM flow, we need to initiate the trade here
256265 let txData : { deposit_address : string ; payload ?: string ; trade_id : string }
Original file line number Diff line number Diff line change @@ -31,7 +31,6 @@ export const SwapAction = ({ setShowBtcModal }: { setShowBtcModal: (val: boolean
3131 toChainId,
3232 currencyIn,
3333 currencyOut,
34- allLoading,
3534 loading,
3635 selectedQuote,
3736 recipient,
@@ -79,7 +78,7 @@ export const SwapAction = ({ setShowBtcModal }: { setShowBtcModal: (val: boolean
7978 onClick : ( ) => { } ,
8079 }
8180 }
82- if ( allLoading )
81+ if ( loading )
8382 return {
8483 label : t `Finding the best route...` ,
8584 disabled : true ,
You can’t perform that action at this time.
0 commit comments