forked from wormhole-foundation/wormhole-connect
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SDKv2 migration: Route adapter (wormhole-foundation#2090)
* sdkv2 route unit tests wip * fix mistake * ugh * injective * version lock deps to fix SDK clashes * move mappings * circular dep? * ugh * moar tests * provide better rpc for solana * compare isSupportedChain * add exception for cosmos token bridge check * supported src, dest token * disable RPC-heavy tests for now * clean up logs * get rid of unused methods * working quotes sorta * example of local sdk working (in case i break it) * script for using local copy of sdk * repro * script for installing local copy of sdk * it works \o/ * remove unnecessary overrides * remove old copy * move route mapping to its own file * moar route mapping * fix mapping * muahahaa * revert part of 541607b * fix mistake * bamp * test * test2 * move localStorage call * move wormhole deps to top level package * sigh * package lock * i can do this all day mof * move RPC-hungry tests to idle file for now * rename fn * remove redundant check
- Loading branch information
1 parent
e3c3655
commit aefabd3
Showing
16 changed files
with
18,903 additions
and
9,872 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
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"env": { | ||
"node": true | ||
}, | ||
"root": true, | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": ["@typescript-eslint"], | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"prettier" | ||
], | ||
"rules": { | ||
"comma-dangle": ["error", "always-multiline"], | ||
"semi": ["error", "always"], | ||
"@typescript-eslint/explicit-module-boundary-types": ["error"], | ||
"@typescript-eslint/no-non-null-assertion": ["error"], | ||
"@typescript-eslint/no-explicit-any": ["error", { "ignoreRestArgs": 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
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 |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import { Route } from 'config/types'; | ||
|
||
import { routes } from '@wormhole-foundation/sdk'; | ||
import { RouteAbstract } from './abstracts/routeAbstract'; | ||
|
||
// Legacy routes | ||
import { BridgeRoute } from './bridge'; | ||
import { RelayRoute } from './relay'; | ||
import { CCTPRelayRoute } from './cctpRelay'; | ||
import { CCTPManualRoute } from './cctpManual'; | ||
import { TBTCRoute } from './tbtc'; | ||
import { ETHBridge } from './porticoBridge/ethBridge'; | ||
import { wstETHBridge } from './porticoBridge/wstETHBridge'; | ||
import { CosmosGatewayRoute } from './cosmosGateway'; | ||
import { NttManual, NttRelay } from './ntt'; | ||
|
||
export interface RouteImpls { | ||
v1: RouteAbstract; | ||
v2?: routes.RouteConstructor; | ||
} | ||
|
||
export function getRouteImpls(route: Route): RouteImpls { | ||
return { | ||
[Route.Bridge]: { | ||
v1: new BridgeRoute(), | ||
v2: routes.TokenBridgeRoute, | ||
}, | ||
[Route.Relay]: { | ||
v1: new RelayRoute(), | ||
v2: routes.AutomaticTokenBridgeRoute, | ||
}, | ||
[Route.CCTPManual]: { | ||
v1: new CCTPManualRoute(), | ||
v2: routes.CCTPRoute, | ||
}, | ||
[Route.CCTPRelay]: { | ||
v1: new CCTPRelayRoute(), | ||
v2: routes.AutomaticCCTPRoute, | ||
}, | ||
[Route.CosmosGateway]: { | ||
v1: new CosmosGatewayRoute(), | ||
}, | ||
[Route.TBTC]: { | ||
v1: new TBTCRoute(), | ||
}, | ||
[Route.ETHBridge]: { | ||
v1: new ETHBridge(), | ||
v2: routes.AutomaticPorticoRoute, | ||
}, | ||
[Route.wstETHBridge]: { | ||
v1: new wstETHBridge(), | ||
v2: routes.AutomaticPorticoRoute, | ||
}, | ||
[Route.NttManual]: { | ||
v1: new NttManual(), | ||
}, | ||
[Route.NttRelay]: { | ||
v1: new NttRelay(), | ||
}, | ||
}[route]; | ||
} |
Oops, something went wrong.