Skip to content

Commit 5dff0d0

Browse files
authored
Remove redundant chain configs, add Sonic & Linea (#3525)
* add Sonic, Linea, use chain IDs from the SDK * remove unused ChainIds * rm key, disabledAsSource, disabledAsDestination * remove legacy "Context", switch to Platform * remove need for wrappedGasToken * fix sonic configs
1 parent ad6480e commit 5dff0d0

File tree

30 files changed

+664
-1780
lines changed

30 files changed

+664
-1780
lines changed

wormhole-connect/package-lock.json

Lines changed: 496 additions & 1213 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wormhole-connect/package.json

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@
5555
"@solana/spl-token": "0.4.0",
5656
"@solana/wallet-adapter-wallets": "0.19.32",
5757
"@solana/web3.js": "1.98.0",
58-
"@wormhole-foundation/sdk": "1.18.0",
59-
"@wormhole-foundation/sdk-definitions": "1.18.0",
58+
"@wormhole-foundation/sdk": "1.19.0",
59+
"@wormhole-foundation/sdk-definitions": "1.19.0",
6060
"@wormhole-foundation/sdk-definitions-ntt": "^0.7.1",
6161
"@wormhole-foundation/sdk-evm-ntt": "^0.7.1",
6262
"@wormhole-foundation/sdk-icons": "^1.0.0",
@@ -198,37 +198,37 @@
198198
"axios": "1.4.0"
199199
},
200200
"@mayanfinance/wormhole-sdk-route": {
201-
"@wormhole-foundation/sdk-connect": "1.18.0",
202-
"@wormhole-foundation/sdk-evm": "1.18.0",
203-
"@wormhole-foundation/sdk-solana": "1.18.0"
201+
"@wormhole-foundation/sdk-connect": "1.19.0",
202+
"@wormhole-foundation/sdk-evm": "1.19.0",
203+
"@wormhole-foundation/sdk-solana": "1.19.0"
204204
},
205205
"@wormhole-foundation/sdk-definitions-ntt": {
206-
"@wormhole-foundation/sdk-base": "1.18.0",
207-
"@wormhole-foundation/sdk-definitions": "1.18.0"
206+
"@wormhole-foundation/sdk-base": "1.19.0",
207+
"@wormhole-foundation/sdk-definitions": "1.19.0"
208208
},
209209
"@wormhole-foundation/sdk-evm-ntt": {
210-
"@wormhole-foundation/sdk-base": "1.18.0",
211-
"@wormhole-foundation/sdk-definitions": "1.18.0",
212-
"@wormhole-foundation/sdk-evm": "1.18.0",
213-
"@wormhole-foundation/sdk-evm-core": "1.18.0"
210+
"@wormhole-foundation/sdk-base": "1.19.0",
211+
"@wormhole-foundation/sdk-definitions": "1.19.0",
212+
"@wormhole-foundation/sdk-evm": "1.19.0",
213+
"@wormhole-foundation/sdk-evm-core": "1.19.0"
214214
},
215215
"@wormhole-foundation/sdk-route-ntt": {
216-
"@wormhole-foundation/sdk-connect": "1.18.0"
216+
"@wormhole-foundation/sdk-connect": "1.19.0"
217217
},
218218
"@wormhole-foundation/sdk-solana-ntt": {
219-
"@wormhole-foundation/sdk-base": "1.18.0",
220-
"@wormhole-foundation/sdk-definitions": "1.18.0",
221-
"@wormhole-foundation/sdk-solana": "1.18.0",
222-
"@wormhole-foundation/sdk-solana-core": "1.18.0"
219+
"@wormhole-foundation/sdk-base": "1.19.0",
220+
"@wormhole-foundation/sdk-definitions": "1.19.0",
221+
"@wormhole-foundation/sdk-solana": "1.19.0",
222+
"@wormhole-foundation/sdk-solana-core": "1.19.0"
223223
},
224224
"@wormhole-labs/cctp-executor-route": {
225-
"@wormhole-foundation/sdk-aptos": "1.18.0",
226-
"@wormhole-foundation/sdk-connect": "1.18.0",
227-
"@wormhole-foundation/sdk-evm": "1.18.0",
228-
"@wormhole-foundation/sdk-solana": "1.18.0",
229-
"@wormhole-foundation/sdk-solana-cctp": "1.18.0",
230-
"@wormhole-foundation/sdk-sui": "1.18.0",
231-
"@wormhole-foundation/sdk-sui-cctp": "1.18.0"
225+
"@wormhole-foundation/sdk-aptos": "1.19.0",
226+
"@wormhole-foundation/sdk-connect": "1.19.0",
227+
"@wormhole-foundation/sdk-evm": "1.19.0",
228+
"@wormhole-foundation/sdk-solana": "1.19.0",
229+
"@wormhole-foundation/sdk-solana-cctp": "1.19.0",
230+
"@wormhole-foundation/sdk-sui": "1.19.0",
231+
"@wormhole-foundation/sdk-sui-cctp": "1.19.0"
232232
},
233233
"@wormhole-foundation/wormhole-connect": {
234234
"aptos": "1.5.2"

wormhole-connect/src/WormholeConnect.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ export default function WormholeConnect({
2626
config,
2727
theme,
2828
}: WormholeConnectProps) {
29-
3029
React.useEffect(() => {
3130
// IMPORTANT: This is a workaround to expose the Redux store to the window object so it can be used in automated tests.
3231
if (!globalThis.dispatchReduxAction) {

wormhole-connect/src/components/Header.tsx

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,17 @@ import { makeStyles } from 'tss-react/mui';
44
export type Alignment = 'center' | 'left' | 'right';
55

66
type StyleProps = { align: Alignment; fontSize: number };
7-
const useStyles = makeStyles<StyleProps>()(
8-
(theme, { align, fontSize }) => ({
9-
title: {
10-
fontSize: `${fontSize}px`,
11-
width: '100%',
12-
textAlign: align,
13-
fontFamily: theme.typography.fontFamily,
14-
[theme.breakpoints.down('sm')]: {
15-
fontSize: '24px',
16-
},
7+
const useStyles = makeStyles<StyleProps>()((theme, { align, fontSize }) => ({
8+
title: {
9+
fontSize: `${fontSize}px`,
10+
width: '100%',
11+
textAlign: align,
12+
fontFamily: theme.typography.fontFamily,
13+
[theme.breakpoints.down('sm')]: {
14+
fontSize: '24px',
1715
},
18-
}),
19-
);
16+
},
17+
}));
2018

2119
type Props = {
2220
text: string;

wormhole-connect/src/config/devnet/chains.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,35 @@
1-
import { CONFIG } from 'sdklegacy';
21
import { ChainsConfig } from '../types';
32

4-
const { chains } = CONFIG.DEVNET;
5-
63
export const DEVNET_CHAINS: ChainsConfig = {
74
Ethereum: {
8-
...chains.Ethereum!,
95
sdkName: 'Ethereum',
106
displayName: 'EVM',
117
explorerUrl: '',
128
explorerName: '',
13-
wrappedGasToken: '0xDDb64fE46a91D46ee29420539FC25FD07c5FEa3E',
14-
chainId: 1,
159
icon: 'Ethereum',
1610
symbol: 'ETH',
1711
},
1812
Osmosis: {
19-
...chains.Osmosis!,
2013
displayName: 'Osmosis',
2114
sdkName: 'Osmosis',
2215
explorerUrl: '',
2316
explorerName: '',
24-
wrappedGasToken: '',
25-
chainId: 'osmosis-1002',
2617
icon: 'Osmosis',
2718
symbol: 'OSMO',
2819
},
2920
Wormchain: {
30-
...chains.Wormchain!,
3121
sdkName: 'Wormchain',
3222
displayName: 'Wormchain',
3323
explorerUrl: '',
3424
explorerName: '',
35-
wrappedGasToken: '',
36-
chainId: 'wormchain-1',
3725
icon: 'Osmosis',
3826
symbol: 'OSMO',
3927
},
4028
Terra2: {
41-
...chains.Terra2!,
4229
sdkName: 'Terra2',
4330
displayName: 'Terra',
4431
explorerUrl: '',
4532
explorerName: '',
46-
wrappedGasToken: '',
47-
chainId: 'localterra',
4833
icon: 'Terra2',
4934
symbol: 'OSMO',
5035
},

wormhole-connect/src/config/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,12 @@ export function buildConfig(
128128
chainsArr: Object.values(networkData.chains)
129129
.filter((chain) => {
130130
return customConfig.chains
131-
? customConfig.chains.includes(chain.key)
131+
? customConfig.chains.includes(chain.sdkName)
132132
: true;
133133
})
134134
.sort((a, b) => {
135-
const ai = CHAIN_ORDER.indexOf(a.key);
136-
const bi = CHAIN_ORDER.indexOf(b.key);
135+
const ai = CHAIN_ORDER.indexOf(a.sdkName);
136+
const bi = CHAIN_ORDER.indexOf(b.sdkName);
137137
if (ai >= 0 && bi >= 0) return ai - bi;
138138
if (ai === -1) return 1;
139139
if (bi === -1) return -1;

0 commit comments

Comments
 (0)