Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TBR v3 route #2897

Open
wants to merge 3 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
354 changes: 341 additions & 13 deletions wormhole-connect/package-lock.json

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions wormhole-connect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@
"@xlabs-libs/wallet-aggregator-sei": "^0.0.1-alpha.14",
"@xlabs-libs/wallet-aggregator-solana": "^0.0.1-alpha.15",
"@xlabs-libs/wallet-aggregator-sui": "^0.0.1-alpha.10",
"@xlabs-xyz/arbitrary-token-transfer-evm-route": "^0.0.1-alpha.6",
"@xlabs-xyz/arbitrary-token-transfer-route": "^0.0.1-alpha.5",
"@xlabs-xyz/arbitrary-token-transfer-solana-route": "^0.0.1-alpha.5",
"@xlabs-xyz/arbitrary-token-transfers-definitions": "^0.0.1-alpha.6",
"aptos": "1.5.0",
"axios": "^1.2.4",
"binary-parser": "^2.2.1",
Expand Down
7 changes: 7 additions & 0 deletions wormhole-connect/src/components/DemoApp/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
} from '@mayanfinance/wormhole-sdk-route';
import { NTT_TEST_CONFIG_TESTNET, NTT_TEST_CONFIG_MAINNET } from './consts';
import { DEFAULT_ROUTES, nttRoutes } from 'routes/operator';
import { AutomaticTokenBridgeRouteV3 } from '@xlabs-xyz/arbitrary-token-transfer-route';

const MAX_URL_SIZE = 30_000; // 30kb (HTTP header limit is set to 32kb)

Expand Down Expand Up @@ -73,6 +74,8 @@
window.testNttRoutesTestnet = () => nttRoutes(NTT_TEST_CONFIG_TESTNET);
/* @ts-ignore */
window.testNttRoutesMainnet = () => nttRoutes(NTT_TEST_CONFIG_MAINNET);
/* @ts-ignore */
window.AutomaticTokenBridgeRouteV3 = AutomaticTokenBridgeRouteV3;

return eval(
`(function() { return ${config} })()`,
Expand Down Expand Up @@ -145,7 +148,7 @@
}
};

useEffect(emitCustomConfig, []);

Check warning on line 151 in wormhole-connect/src/components/DemoApp/index.tsx

View workflow job for this annotation

GitHub Actions / lint

React Hook useEffect has missing dependencies: 'customConfigInput', 'customConfigNonce', and 'isLoadingCustomConfig'. Either include them or remove the dependency array. You can also do a functional update 'setCustomConfigNonce(c => ...)' if you only need 'customConfigNonce' in the 'setCustomConfigNonce' call

return (
<>
Expand Down Expand Up @@ -239,6 +242,10 @@
<pre>testNttRoutesTestnet</pre>
<i>{'(NttRoute.Config) -> RouteConstructor[])'}</i>
</li>
{/* <li>
<pre>AutomaticTokenBridgeRouteV3</pre>
<i>{'RouteConstructor'}</i>
</li> */}
</ul>
</div>
) : undefined}
Expand Down
7 changes: 7 additions & 0 deletions wormhole-connect/src/config/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,11 @@ export const RoutesConfig: Record<string, RouteData> = {
icon: XLabsIcon,
pendingMessage: 'Waiting for Wormhole network consensus . . .',
},
AutomaticTokenBridgeV3: {
name: 'AutomaticTokenBridgeV3',
displayName: 'Automatic Bridge V3',
link: 'https://xlabs.xyz',
icon: XLabsIcon,
pendingMessage: 'Waiting for Wormhole network consensus . . .',
},
};
24 changes: 12 additions & 12 deletions wormhole-connect/src/config/testnet/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ export const TESTNET_TOKENS: TokensConfig = {
symbol: 'ETH',
nativeChain: 'Sepolia',
icon: Icon.ETH,
coinGeckoId: 'Ethereum',
coinGeckoId: 'ethereum',
color: '#5794EC',
decimals: 18,
wrappedAsset: 'WETHsepolia',
Expand All @@ -231,7 +231,7 @@ export const TESTNET_TOKENS: TokensConfig = {
chain: 'Sepolia',
address: '0xeef12A83EE5b7161D3873317c8E0E7B76e0B5D9c',
},
coinGeckoId: 'Ethereum',
coinGeckoId: 'ethereum',
color: '#5794EC',
decimals: 18,
},
Expand All @@ -253,7 +253,7 @@ export const TESTNET_TOKENS: TokensConfig = {
symbol: 'ETH',
nativeChain: 'ArbitrumSepolia',
icon: Icon.ETH,
coinGeckoId: 'Ethereum',
coinGeckoId: 'ethereum',
color: '#5794EC',
decimals: 18,
wrappedAsset: 'WETHarbitrum_sepolia',
Expand All @@ -267,7 +267,7 @@ export const TESTNET_TOKENS: TokensConfig = {
chain: 'ArbitrumSepolia',
address: '0x980B62Da83eFf3D4576C647993b0c1D7faf17c73',
},
coinGeckoId: 'Ethereum',
coinGeckoId: 'ethereum',
color: '#5794EC',
decimals: 18,
},
Expand All @@ -276,7 +276,7 @@ export const TESTNET_TOKENS: TokensConfig = {
symbol: 'ETH',
nativeChain: 'BaseSepolia',
icon: Icon.ETH,
coinGeckoId: 'Ethereum',
coinGeckoId: 'ethereum',
color: '#5794EC',
decimals: 18,
wrappedAsset: 'WETHbase_sepolia',
Expand All @@ -290,7 +290,7 @@ export const TESTNET_TOKENS: TokensConfig = {
chain: 'BaseSepolia',
address: '0x4200000000000000000000000000000000000006',
},
coinGeckoId: 'Ethereum',
coinGeckoId: 'ethereum',
color: '#5794EC',
decimals: 18,
},
Expand All @@ -299,7 +299,7 @@ export const TESTNET_TOKENS: TokensConfig = {
symbol: 'ETH',
nativeChain: 'OptimismSepolia',
icon: Icon.ETH,
coinGeckoId: 'Ethereum',
coinGeckoId: 'ethereum',
color: '#5794EC',
decimals: 18,
wrappedAsset: 'WETHoptimism_sepolia',
Expand All @@ -313,7 +313,7 @@ export const TESTNET_TOKENS: TokensConfig = {
chain: 'OptimismSepolia',
address: '0x4200000000000000000000000000000000000006',
},
coinGeckoId: 'Ethereum',
coinGeckoId: 'ethereum',
color: '#5794EC',
decimals: 18,
},
Expand All @@ -322,7 +322,7 @@ export const TESTNET_TOKENS: TokensConfig = {
symbol: 'ETH',
nativeChain: 'Scroll',
icon: Icon.SCROLL,
coinGeckoId: 'Ethereum',
coinGeckoId: 'ethereum',
decimals: 18,
wrappedAsset: 'WETHscroll',
},
Expand All @@ -335,15 +335,15 @@ export const TESTNET_TOKENS: TokensConfig = {
chain: 'Scroll',
address: '0x5300000000000000000000000000000000000004',
},
coinGeckoId: 'Ethereum',
coinGeckoId: 'ethereum',
decimals: 18,
},
ETHblast: {
key: 'ETHblast',
symbol: 'ETH',
nativeChain: 'Blast',
icon: Icon.BLAST,
coinGeckoId: 'Ethereum',
coinGeckoId: 'ethereum',
decimals: 18,
wrappedAsset: 'WETHblast',
},
Expand All @@ -356,7 +356,7 @@ export const TESTNET_TOKENS: TokensConfig = {
chain: 'Blast',
address: '0x9D020B1697035d9d54f115194c9e04a1e4Eb9aF7',
},
coinGeckoId: 'Ethereum',
coinGeckoId: 'ethereum',
decimals: 18,
},
OKB: {
Expand Down
7 changes: 7 additions & 0 deletions wormhole-connect/src/routes/operator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ import {
NttRoute,
} from '@wormhole-foundation/sdk-route-ntt';

import { AutomaticTokenBridgeRouteV3 } from '@xlabs-xyz/arbitrary-token-transfer-route';

import '@xlabs-xyz/arbitrary-token-transfers-definitions';
import '@xlabs-xyz/arbitrary-token-transfer-evm-route';
import '@xlabs-xyz/arbitrary-token-transfer-solana-route';

import '@wormhole-foundation/sdk-definitions-ntt';
import '@wormhole-foundation/sdk-evm-ntt';
import '@wormhole-foundation/sdk-solana-ntt';
Expand All @@ -27,6 +33,7 @@ type forEachCallback<T> = (name: string, route: SDKv2Route) => T;
export const DEFAULT_ROUTES = [
routes.AutomaticCCTPRoute,
routes.CCTPRoute,
AutomaticTokenBridgeRouteV3,
routes.AutomaticTokenBridgeRoute,
routes.TokenBridgeRoute,
routes.AutomaticPorticoRoute,
Expand Down
1 change: 1 addition & 0 deletions wormhole-connect/src/routes/sdkv2/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export class SDKv2Route {
this.IS_TOKEN_BRIDGE_ROUTE = [
'ManualTokenBridge',
'AutomaticTokenBridge',
'AutomaticTokenBridgeV3',
'CosmosGateway',
].includes(rc.meta.name);
}
Expand Down
1 change: 1 addition & 0 deletions wormhole-connect/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ const resolve = {
'process/': 'process',
'buffer/': 'buffer',
},
preserveSymlinks: true,
};

const plugins = [
Expand Down
Loading