-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
XLabs/portal-bridge-ui#980 - refactor and fix check availability logic (
- Loading branch information
1 parent
9e807eb
commit cf810d9
Showing
10 changed files
with
58 additions
and
192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,8 @@ | ||
import { Route } from 'config/types'; | ||
import { NttBase } from './nttBase'; | ||
import { ChainId, ChainName } from '@wormhole-foundation/wormhole-connect-sdk'; | ||
import { | ||
REASON_MANUAL_ADDRESS_NOT_SUPPORTED, | ||
RouteAvailability, | ||
} from 'routes/abstracts'; | ||
|
||
export class NttManual extends NttBase { | ||
readonly NATIVE_GAS_DROPOFF_SUPPORTED: boolean = false; | ||
readonly AUTOMATIC_DEPOSIT: boolean = false; | ||
readonly TYPE: Route = Route.NttManual; | ||
|
||
async isRouteAvailable( | ||
sourceToken: string, | ||
destToken: string, | ||
amount: string, | ||
sourceChain: ChainName | ChainId, | ||
destChain: ChainName | ChainId, | ||
manualAddress?: boolean, | ||
): Promise<RouteAvailability> { | ||
// this route is not available if the target addres is manual | ||
if (manualAddress) | ||
return { | ||
isAvailable: false, | ||
reason: REASON_MANUAL_ADDRESS_NOT_SUPPORTED, | ||
}; | ||
return { isAvailable: true }; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.