Skip to content

Commit

Permalink
rip out portico...
Browse files Browse the repository at this point in the history
  • Loading branch information
artursapek committed Jun 28, 2024
1 parent 07fcd1e commit 4d005e5
Show file tree
Hide file tree
Showing 24 changed files with 63 additions and 1,465 deletions.
12 changes: 7 additions & 5 deletions wormhole-connect/src/hooks/useComputeDestinationTokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ import {
setDestToken,
setSupportedDestTokens,
setAllSupportedDestTokens,
getNativeVersionOfToken,
//getNativeVersionOfToken,
} from 'store/transferInput';

import type { Route } from 'config/types';
import type { ChainName } from 'sdklegacy';

import { isPorticoRoute } from 'routes/porticoBridge/utils';
import { ETHBridge } from 'routes/porticoBridge/ethBridge';
import { wstETHBridge } from 'routes/porticoBridge/wstETHBridge';
//import { isPorticoRoute } from 'routes/porticoBridge/utils';
//import { ETHBridge } from 'routes/porticoBridge/ethBridge';
//import { wstETHBridge } from 'routes/porticoBridge/wstETHBridge';
import RouteOperator from 'routes/operator';

import { getWrappedToken } from 'utils';
//import { getWrappedToken } from 'utils';

type Props = {
sourceChain: ChainName | undefined;
Expand Down Expand Up @@ -86,6 +86,7 @@ export const useComputeDestinationTokens = (props: Props): void => {
}
}

/*
// If the source token is supported by a Portico bridge route,
// then select the native version on the dest chain
if (sourceToken && destChain && (!route || isPorticoRoute(route))) {
Expand All @@ -107,6 +108,7 @@ export const useComputeDestinationTokens = (props: Props): void => {
}
}
}
*/
};

computeDestTokens();
Expand Down
3 changes: 1 addition & 2 deletions wormhole-connect/src/hooks/useGetTokenBalances.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ const useGetTokenBalances = (
needsUpdate.push(token as TokenConfigWithId);
}
}

if (needsUpdate.length > 0) {
try {
const wh = await getWormholeContextV2();
Expand All @@ -82,8 +83,6 @@ const useGetTokenBalances = (
lastUpdated: now,
};

console.log(tokenConfig);

try {
let address: string | null = null;

Expand Down
3 changes: 2 additions & 1 deletion wormhole-connect/src/hooks/usePorticoSwapInfo.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useEffect } from 'react';
/*import { useEffect } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import RouteOperator from 'routes/operator';
import { PorticoBridge } from 'routes/porticoBridge';
Expand Down Expand Up @@ -88,3 +88,4 @@ export const usePorticoSwapInfo = (): void => {
dispatch,
]);
};
*/
2 changes: 1 addition & 1 deletion wormhole-connect/src/routes/abstracts/routeAbstract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export abstract class RouteAbstract {
public abstract getMaxSendAmount(): number;

public abstract send(
token: TokenId | 'native',
token: TokenConfig,
amount: string,
sendingChain: ChainName | ChainId,
senderAddress: string,
Expand Down
10 changes: 6 additions & 4 deletions wormhole-connect/src/routes/mappings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import { routes } from '@wormhole-foundation/sdk';
import { SDKv2Route } from './sdkv2/route';

// Legacy routes
import { RouteAbstract } from './abstracts/routeAbstract';
import { ETHBridge } from './porticoBridge/ethBridge';
import { wstETHBridge } from './porticoBridge/wstETHBridge';
//import { RouteAbstract } from './abstracts/routeAbstract';
//import { ETHBridge } from './porticoBridge/ethBridge';
//import { wstETHBridge } from './porticoBridge/wstETHBridge';

export function getRoute(route: Route): RouteAbstract {
export function getRoute(route: Route): SDKv2Route {
switch (route) {
// Migrated routes:
case Route.Bridge:
Expand All @@ -18,10 +18,12 @@ export function getRoute(route: Route): RouteAbstract {
return new SDKv2Route(routes.AutomaticTokenBridgeRoute, Route.Bridge);

// Legacy routes:
/*
case Route.ETHBridge:
return new ETHBridge();
case Route.wstETHBridge:
return new wstETHBridge();
*/
// TODO SDKV2
default:
return new SDKv2Route(routes.TokenBridgeRoute, Route.Bridge);
Expand Down
2 changes: 1 addition & 1 deletion wormhole-connect/src/routes/operator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ export class Operator {

async send(
route: Route,
token: TokenId | 'native',
token: TokenConfig,
amount: string,
sendingChain: ChainName | ChainId,
senderAddress: string,
Expand Down
12 changes: 0 additions & 12 deletions wormhole-connect/src/routes/porticoBridge/abis.ts

This file was deleted.

9 changes: 0 additions & 9 deletions wormhole-connect/src/routes/porticoBridge/consts.ts

This file was deleted.

12 changes: 0 additions & 12 deletions wormhole-connect/src/routes/porticoBridge/ethBridge.ts

This file was deleted.

1 change: 0 additions & 1 deletion wormhole-connect/src/routes/porticoBridge/index.ts

This file was deleted.

Loading

0 comments on commit 4d005e5

Please sign in to comment.