File tree Expand file tree Collapse file tree 5 files changed +345
-69
lines changed
apps/kyberswap-interface/src/pages/CrossChainSwap Expand file tree Collapse file tree 5 files changed +345
-69
lines changed Original file line number Diff line number Diff line change @@ -142,6 +142,7 @@ export interface SwapProvider {
142142 connection ?: Connection ,
143143 ) : Promise < NormalizedTxResponse >
144144 getTransactionStatus ( p : NormalizedTxResponse ) : Promise < SwapStatus >
145+ canSupport ( category : string ) : boolean
145146}
146147export abstract class BaseSwapAdapter implements SwapProvider {
147148 abstract getName ( ) : string
@@ -156,6 +157,11 @@ export abstract class BaseSwapAdapter implements SwapProvider {
156157 ) : Promise < NormalizedTxResponse >
157158 abstract getTransactionStatus ( p : NormalizedTxResponse ) : Promise < SwapStatus >
158159
160+ canSupport ( _category : string ) : boolean {
161+ // Default implementation - support all categories
162+ return true
163+ }
164+
159165 protected handleError ( error : any ) : never {
160166 console . error ( `[${ this . getName ( ) } ] Error:` , error )
161167 throw new Error ( `${ this . getName ( ) } provider error: ${ error . message || 'Unknown error' } ` )
Original file line number Diff line number Diff line change @@ -26,6 +26,12 @@ export class SymbiosisAdapter extends BaseSwapAdapter {
2626 getIcon ( ) : string {
2727 return 'https://app.symbiosis.finance/images/favicon-32x32.png'
2828 }
29+
30+ canSupport ( category : string ) : boolean {
31+ // Symbiosis should only be used for stablePair category
32+ return category === 'stablePair'
33+ }
34+
2935 getSupportedChains ( ) : Chain [ ] {
3036 return [
3137 ChainId . MAINNET ,
Original file line number Diff line number Diff line change @@ -124,7 +124,7 @@ export class CrossChainSwapFactory {
124124 // CrossChainSwapFactory.getXyFinanceAdapter(),
125125 CrossChainSwapFactory . getNearIntentsAdapter ( ) ,
126126 CrossChainSwapFactory . getMayanAdapter ( ) ,
127- // CrossChainSwapFactory.getSymbiosisAdapter(),
127+ CrossChainSwapFactory . getSymbiosisAdapter ( ) ,
128128 CrossChainSwapFactory . getDebridgeInstance ( ) ,
129129 CrossChainSwapFactory . getLifiInstance ( ) ,
130130 CrossChainSwapFactory . getOptimexAdapter ( ) ,
You can’t perform that action at this time.
0 commit comments