Skip to content

Commit

Permalink
added worldchain mainnet and testnet (#3048)
Browse files Browse the repository at this point in the history
* added worldchain mainnet and testnet

* bump wallet aggregator for worldchain

* fix icons

* added wrapped tokens

* bump sdk

---------

Co-authored-by: Artur Sapek <[email protected]>
  • Loading branch information
kev1n-peters and artursapek authored Dec 16, 2024
1 parent 14b8c0d commit 283faaa
Show file tree
Hide file tree
Showing 23 changed files with 376 additions and 397 deletions.
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ const config: WormholeConnectConfig = {
}
```

See [`chains.ts`](https://github.com/wormhole-foundation/wormhole-sdk-ts/blob/main/core/base/src/constants/chains.ts) in the SDK. By default, Connect offers its full built-in list for both `mainnet` and `testnet`:
See [`chains.ts`](https://github.com/wormhole-foundation/wormhole-sdk-ts/blob/main/core/base/src/constants/chains.ts) in the SDK. By default, Connect offers a subset of chains for both `mainnet` and `testnet`:

| `mainnet` | `testnet` |
| ---------- | ------------- |
Expand All @@ -151,17 +151,13 @@ See [`chains.ts`](https://github.com/wormhole-foundation/wormhole-sdk-ts/blob/ma
| Sui | Sui |
| Aptos | Aptos |
| Base | BaseSepolia |
| Osmosis | Osmosis |
| Evmos | Evmos |
| Kujira | Kujira |
| Injective | Injective |
| Kaia | Kaia |
| Arbitrum | ArbitrumSepolia |
| Optimism | OptimismSepolia |
| Scroll | Scroll |
| Blast | Blast |
| Xlayer | Xlayer |
| Mantle | Mantle |
| Worldchain | Worldchain |

### RPC Endpoints (`rpcs`):

Expand Down
545 changes: 193 additions & 352 deletions wormhole-connect/package-lock.json

Large diffs are not rendered by default.

36 changes: 18 additions & 18 deletions wormhole-connect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@
"@solana/spl-token": "^0.3.9",
"@solana/wallet-adapter-wallets": "^0.19.25",
"@solana/web3.js": "^1.95.8",
"@wormhole-foundation/sdk": "^1.2.0",
"@wormhole-foundation/sdk-definitions": "^1.2.0",
"@wormhole-foundation/sdk": "^1.3.0-beta.2",
"@wormhole-foundation/sdk-definitions": "^1.3.0-beta.2",
"@wormhole-foundation/sdk-definitions-ntt": "^0.6.1",
"@wormhole-foundation/sdk-evm-ntt": "^0.6.1",
"@wormhole-foundation/sdk-icons": "^1.0.0",
"@wormhole-foundation/sdk-route-ntt": "^0.6.1",
"@wormhole-foundation/sdk-solana-ntt": "^0.6.1",
"@xlabs-libs/wallet-aggregator-aptos": "^0.0.1-alpha.14",
"@xlabs-libs/wallet-aggregator-core": "^0.0.1-alpha.18",
"@xlabs-libs/wallet-aggregator-evm": "^0.0.2-alpha.2",
"@xlabs-libs/wallet-aggregator-core": "^0.0.1-alpha.22",
"@xlabs-libs/wallet-aggregator-evm": "^0.0.2-alpha.5",
"@xlabs-libs/wallet-aggregator-solana": "^0.0.1-alpha.15",
"@xlabs-libs/wallet-aggregator-sui": "^0.0.1-alpha.10",
"aptos": "1.5.0",
Expand Down Expand Up @@ -155,28 +155,28 @@
"@ledgerhq/devices": "6.27.1"
},
"@mayanfinance/wormhole-sdk-route": {
"@wormhole-foundation/sdk-connect": "^1.2.0",
"@wormhole-foundation/sdk-evm": "^1.2.0",
"@wormhole-foundation/sdk-solana": "^1.2.0"
"@wormhole-foundation/sdk-connect": "^1.3.0-beta.2",
"@wormhole-foundation/sdk-evm": "^1.3.0-beta.2",
"@wormhole-foundation/sdk-solana": "^1.3.0-beta.2"
},
"@wormhole-foundation/sdk-definitions-ntt": {
"@wormhole-foundation/sdk-base": "^1.2.0",
"@wormhole-foundation/sdk-definitions": "^1.2.0"
"@wormhole-foundation/sdk-base": "^1.3.0-beta.2",
"@wormhole-foundation/sdk-definitions": "^1.3.0-beta.2"
},
"@wormhole-foundation/sdk-evm-ntt": {
"@wormhole-foundation/sdk-base": "^1.2.0",
"@wormhole-foundation/sdk-definitions": "^1.2.0",
"@wormhole-foundation/sdk-evm": "^1.2.0",
"@wormhole-foundation/sdk-evm-core": "^1.2.0"
"@wormhole-foundation/sdk-base": "^1.3.0-beta.2",
"@wormhole-foundation/sdk-definitions": "^1.3.0-beta.2",
"@wormhole-foundation/sdk-evm": "^1.3.0-beta.2",
"@wormhole-foundation/sdk-evm-core": "^1.3.0-beta.2"
},
"@wormhole-foundation/sdk-route-ntt": {
"@wormhole-foundation/sdk-connect": "^1.2.0"
"@wormhole-foundation/sdk-connect": "^1.3.0-beta.2"
},
"@wormhole-foundation/sdk-solana-ntt": {
"@wormhole-foundation/sdk-base": "^1.2.0",
"@wormhole-foundation/sdk-definitions": "^1.2.0",
"@wormhole-foundation/sdk-solana": "^1.2.0",
"@wormhole-foundation/sdk-solana-core": "^1.2.0"
"@wormhole-foundation/sdk-base": "^1.3.0-beta.2",
"@wormhole-foundation/sdk-definitions": "^1.3.0-beta.2",
"@wormhole-foundation/sdk-solana": "^1.3.0-beta.2",
"@wormhole-foundation/sdk-solana-core": "^1.3.0-beta.2"
},
"@wormhole-foundation/wormhole-connect": {
"aptos": "1.5.0"
Expand Down
11 changes: 11 additions & 0 deletions wormhole-connect/src/config/mainnet/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,4 +253,15 @@ export const MAINNET_CHAINS: ChainsConfig = {
maxBlockSearch: 2000,
symbol: 'MNT',
},
Worldchain: {
...chains.Worldchain!,
displayName: 'World Chain',
explorerUrl: 'https://worldscan.org/',
explorerName: 'World Scan',
gasToken: 'ETHworldchain',
chainId: 480,
icon: 'Worldchain',
maxBlockSearch: 2000,
symbol: 'WORLD',
},
};
2 changes: 2 additions & 0 deletions wormhole-connect/src/config/mainnet/rpcs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const {
REACT_APP_BLAST_RPC,
REACT_APP_XLAYER_RPC,
REACT_APP_MANTLE_RPC,
REACT_APP_WORLDCHAIN_RPC,
} = import.meta.env;

export const MAINNET_RPC_MAPPING = {
Expand Down Expand Up @@ -54,6 +55,7 @@ export const MAINNET_RPC_MAPPING = {
...populateRpcField('Blast', REACT_APP_BLAST_RPC),
...populateRpcField('Xlayer', REACT_APP_XLAYER_RPC),
...populateRpcField('Mantle', REACT_APP_MANTLE_RPC),
...populateRpcField('Worldchain', REACT_APP_WORLDCHAIN_RPC),
};

export const MAINNET_REST_MAPPING = {
Expand Down
38 changes: 38 additions & 0 deletions wormhole-connect/src/config/mainnet/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,27 @@ export const MAINNET_TOKENS: TokensConfig = {
color: '#000000',
decimals: 8,
},
ETHworldchain: {
key: 'ETHworldchain',
symbol: 'ETH',
nativeChain: 'Worldchain',
icon: TokenIcon.WORLDCHAIN,
coinGeckoId: 'ethereum',
decimals: 18,
wrappedAsset: 'WETHworldchain',
},
WETHworldchain: {
key: 'WETHworldchain',
symbol: 'WETH',
nativeChain: 'Worldchain',
icon: TokenIcon.WORLDCHAIN,
tokenId: {
chain: 'Worldchain',
address: '0x4200000000000000000000000000000000000006',
},
coinGeckoId: 'ethereum',
decimals: 18,
},
};

export const MAINNET_WRAPPED_TOKENS: TokenAddressesByChain = {
Expand All @@ -860,6 +881,7 @@ export const MAINNET_WRAPPED_TOKENS: TokenAddressesByChain = {
Blast: '0xC09a79fCF76ab2917c685896E3693e04EEbab69C',
Mantle: '0x115Fcc627AcE0457fbeb7Af3b8BcAcE7Ff6211A4',
Klaytn: '0x98A8345bB9D3DDa9D808Ca1c9142a28F6b0430E1',
Worldchain: '0x6938c3EfFEf84E5C69e3d7cc41eBC6Cff99EF8A7',
},
USDCeth: {
Bsc: '0xB04906e95AB5D797aDA81508115611fee694c2b3',
Expand All @@ -876,6 +898,7 @@ export const MAINNET_WRAPPED_TOKENS: TokenAddressesByChain = {
Arbitrum: '0xC96F2715E2a242d50D1b0bC923dbe1740b8eCf18',
Optimism: '0x711e53D031ea9B0bb0C24dD506df11b41AEA419e',
Klaytn: '0x608792Deb376CCE1c9FA4D0E6B7b44f507CfFa6A',
Worldchain: '0x2cbD3491d687A76bb9C53c30B212855520D47b52',
},
WBTC: {
Bsc: '0x43359676E1A3F9FbB5de095333f8e9c1B46dFA44',
Expand All @@ -892,6 +915,7 @@ export const MAINNET_WRAPPED_TOKENS: TokenAddressesByChain = {
Arbitrum: '0x397846a8078d4845c7f5c6Ca76aeBbcFDc044fAe',
Optimism: '0xB214C19d81c99E75e84706a3aa0A757319023e26',
Klaytn: '0x981846bE8d2d697f4dfeF6689a161A25FfbAb8F9',
Worldchain: '0x06c9ec7E18A7900E79Ad5BeCc6Cc29E3eebD81EC',
},
USDT: {
Bsc: '0x524bC91Dc82d6b90EF29F76A3ECAaBAffFD490Bc',
Expand All @@ -910,6 +934,7 @@ export const MAINNET_WRAPPED_TOKENS: TokenAddressesByChain = {
Blast: '0x37C1dea9C51864cc6640FA9c09f4dac574b8285E',
Klaytn: '0x5C13E303a62Fc5DEdf5B52D66873f2E59fEdADC2',
Xlayer: '0x5866709f926f26C5870191F40333ac462B917bC0',
Worldchain: '0x95dd0680Fd6B6c7546e75C1A4E6A3256072C0593',
},
DAI: {
Bsc: '0x3413a030EF81a3dD5a302F4B4D11d911e12ed337',
Expand All @@ -927,6 +952,7 @@ export const MAINNET_WRAPPED_TOKENS: TokenAddressesByChain = {
Blast: '0x286ebE2BacB0EBeF746DBDA24dED0fc001c6d0F6',
Sui: '0xc01c54cd767a60835bf100b0a8f7aae66ac9f4e374f76746af60f02493b6f2cf::coin::COIN',
Klaytn: '0xCB2C7998696Ef7a582dFD0aAFadCd008D03E791A',
Worldchain: '0x69635e59E89000e08a13C3F7B9f7293160Dc83a2',
},
BUSD: {
Bsc: '0x035de3679E692C471072d1A09bEb9298fBB2BD31',
Expand All @@ -936,6 +962,7 @@ export const MAINNET_WRAPPED_TOKENS: TokenAddressesByChain = {
Solana: '33fsBLA8djQm82RpHmE3SuVrPGtZBWNYExsEUeKX1HXX',
Aptos:
'0x77400d2f56a01bad2d7c8c6fa282f62647ce3c03f43f2a8742e47ea01a91e24a::coin::T',
Worldchain: '0x276719Fc6a38E62B717c6FF6E39d1C336ee633AB',
},
WPOL: {
Ethereum: '0x7c9f4C87d911613Fe9ca58b579f737911AAD2D43',
Expand All @@ -956,6 +983,7 @@ export const MAINNET_WRAPPED_TOKENS: TokenAddressesByChain = {
Klaytn: '0x9858e5A4f8202baD619D4BD39382CA67F4CA0E63',
Scroll: '0x982D057feCD66c3af27b16EBC67C4db24810bcD8',
Xlayer: '0xc97E2b2d7730C34adC389563721d9dF52EDA4A2a',
Worldchain: '0xDcB507ECEA06724d8c4F2f03964f7EE4da504E8C',
},
WETHpolygon: {
Bsc: '0x1384284E16e3375522Be54F50909Bc52A69e90e4',
Expand Down Expand Up @@ -1008,6 +1036,7 @@ export const MAINNET_WRAPPED_TOKENS: TokenAddressesByChain = {
Klaytn: '0xaC9C1E4787139aF4c751B1C0fadfb513C44Ed833',
Scroll: '0x5b0da0a36DC415714B53A4f24b56921332F42E7C',
Xlayer: '0x8bC46166E06122603bA10D2bCA63b75091c25cAe',
Worldchain: '0x59163d9c70E9b3852a504c5F1458e2daD33516Ff',
},
USDCbnb: {
Ethereum: '0x7cd167B101D2808Cfd2C45d17b2E7EA9F46b74B6',
Expand Down Expand Up @@ -1044,6 +1073,7 @@ export const MAINNET_WRAPPED_TOKENS: TokenAddressesByChain = {
Klaytn: '0x45830b92443a8f750247da2A76C85c70d0f1EBF3',
Scroll: '0xC043c8A3672f397e7b52bF0a04F47d6f1aA952Ed',
Xlayer: '0x5208Fb676B2DBab7aFaFB56e8997237F0ceECF71',
Worldchain: '0x5Bf2A0622aa1254D963A3074b593A379784C116a',
},
USDCavax: {
Ethereum: '0x39EbF69137D98FB7659Ef8D4ea21ec26394389d7',
Expand Down Expand Up @@ -1120,6 +1150,7 @@ export const MAINNET_WRAPPED_TOKENS: TokenAddressesByChain = {
Optimism: '0x9b88D293b7a791E40d36A39765FFd5A1B9b5c349',
Blast: '0x75345Cc6a3333cca03aCE2a28C7de328122Db3b1',
Klaytn: '0xB2b5bC9bc872c7107CBC8E8e0E2805Db0ac4FBc2',
Worldchain: '0x2250A0E2532A745b585B69dd2CdC75207384917c',
},
WGLMR: {
Ethereum: '0x93d3696A9F879b331f40CB5059e37015423A3Bd0',
Expand All @@ -1139,6 +1170,7 @@ export const MAINNET_WRAPPED_TOKENS: TokenAddressesByChain = {
Klaytn: '0x52a4558f98dDc7cb40cd9114C005f0B9571258Fc',
Scroll: '0x2Aba1Ed24EaFC17F801b1A7dF1c3a06737F8aB72',
Xlayer: '0xE2a44Dad57004517738FbD84cdf09Bd1451b4e43',
Worldchain: '0xaAe2Bd4EB640f02dD3a53bd994ad19110b4191b0',
},
WSOL: {
Ethereum: '0xD31a59c85aE9D8edEFeC411D448f90841571b89c',
Expand All @@ -1159,6 +1191,7 @@ export const MAINNET_WRAPPED_TOKENS: TokenAddressesByChain = {
Klaytn: '0xfAA03A2AC2d1B8481Ec3fF44A0152eA818340e6d',
Xlayer: '0x3a859D92da2E16Ad32C5C6F3ADAddFBa4dE3A47e',
Scroll: '0xCDf95E1F720caade4b1DC83ABfE15400D2a458AD',
Worldchain: '0xEfae32D1c15EDBaEA3ebdDe1e2C51003AED04d30',
},
USDCsol: {
Ethereum: '0x41f7B8b9b897276b7AAE926a9016935280b44E97',
Expand Down Expand Up @@ -1195,6 +1228,7 @@ export const MAINNET_WRAPPED_TOKENS: TokenAddressesByChain = {
Blast: '0x62c95Ffd6d2f893Ea2EF072d1EbBcb242a974b1A',
Klaytn: '0xB0B40516293e0204fB376A18aA230A210cbE0305',
Xlayer: '0xEa76dBFE6e449420f294e74E057518F750E99A16',
Worldchain: '0xf69005c35B5d9AcC22E4DbCf52f892cAE21F83B0',
},
APT: {
Ethereum: '0x8CDf7AF57E4c8B930e1B23c477c22f076530585e',
Expand All @@ -1212,6 +1246,7 @@ export const MAINNET_WRAPPED_TOKENS: TokenAddressesByChain = {
Blast: '0x2a3DdE20159FbDbC86f1da0e7a462711b610c815',
Klaytn: '0x68d5254007BE3a6d3d2A37e2C1ad3921D049F46D',
Xlayer: '0xEdF2AEaCE382A3c0722f110c4927d34b78bce34F',
Worldchain: '0xfC5011f2037f2Dad9c9aC05CbB6749B383C3099c',
},
WETHarbitrum: {
Ethereum: '0xb945E3F853B5f8033C8513Cf3cE9F8AD9beBB1c9',
Expand Down Expand Up @@ -1346,6 +1381,7 @@ export const MAINNET_WRAPPED_TOKENS: TokenAddressesByChain = {
Bsc: '0xad80E1A9B5824234afA9dE1F3bbDb8a994796169',
Avalanche: '0x11449fd2F05D93827972b40adE96F6ffBE42E35a',
Fantom: '0x2a2Ec6Ad3e47C536F47934F63b95BD647F1C730E',
Worldchain: '0xd977e0251db8d38155dC5d212944AB7B7a6777Ad',
},
wstETHarbitrum: {
Bsc: '0x159167e842C586a81f02E55bc043AC8EdB033E0b',
Expand Down Expand Up @@ -1390,6 +1426,7 @@ export const MAINNET_WRAPPED_TOKENS: TokenAddressesByChain = {
Solana: '2b8fZGLBZjpxFugCdnJbbLLBYxvx23rsrsvLYYueiHb7',
Blast: '0x5F6fE613528df9AE4Bf6f667fbCB923263098617',
Scroll: '0xA55FB7A046454998b2f6d8D99Df5F0E108b38229',
Worldchain: '0xC080f0082029fC6e8A4Bb33a9B0655B8d4f2BAB0',
},
PYTH: {
Aptos:
Expand All @@ -1406,6 +1443,7 @@ export const MAINNET_WRAPPED_TOKENS: TokenAddressesByChain = {
Sui: '0x9c6d76eb273e6b5ba2ec8d708b7fa336a5531f6be59f326b5be8d4d8b12348a4::coin::COIN',
Moonbeam: '0x27cc3FDbDD1F415b09a41232D0fD71345DAB8030',
Xlayer: '0x057b766b3fB76527cf815c3b5C38Dfa8144335CF',
Worldchain: '0x838f3045F3B2dcDFF8cB4e5CaB0c0092A69B790a',
},
WETHscroll: { Arbitrum: '0xAe81a542e20270b48Bd5297E3e0f280f79E46C42' },
WMNT: { Optimism: '0xf704F6a3241609Cfb3E44Db1237E68EB6CaC7C04' },
Expand Down
11 changes: 11 additions & 0 deletions wormhole-connect/src/config/testnet/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,4 +262,15 @@ export const TESTNET_CHAINS: ChainsConfig = {
maxBlockSearch: 2000,
symbol: 'MNT',
},
Worldchain: {
...chains.Worldchain!,
displayName: 'World Chain',
explorerUrl: 'https://worldchain-sepolia.explorer.alchemy.com/',
explorerName: 'World Scan',
gasToken: 'ETHworldchain',
chainId: 4801,
icon: 'Worldchain',
maxBlockSearch: 2000,
symbol: 'WORLD',
},
};
2 changes: 2 additions & 0 deletions wormhole-connect/src/config/testnet/rpcs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const {
REACT_APP_BLAST_TESTNET_RPC,
REACT_APP_XLAYER_TESTNET_RPC,
REACT_APP_MANTLE_TESTNET_RPC,
REACT_APP_WORLDCHAIN_TESTNET_RPC,
} = import.meta.env;

export const TESTNET_RPC_MAPPING = {
Expand Down Expand Up @@ -54,6 +55,7 @@ export const TESTNET_RPC_MAPPING = {
...populateRpcField('Blast', REACT_APP_BLAST_TESTNET_RPC),
...populateRpcField('Xlayer', REACT_APP_XLAYER_TESTNET_RPC),
...populateRpcField('Mantle', REACT_APP_MANTLE_TESTNET_RPC),
...populateRpcField('Worldchain', REACT_APP_WORLDCHAIN_TESTNET_RPC),
};

export const TESTNET_REST_MAPPING = {
Expand Down
21 changes: 21 additions & 0 deletions wormhole-connect/src/config/testnet/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,27 @@ export const TESTNET_TOKENS: TokensConfig = {
coinGeckoId: 'mantle',
decimals: 18,
},
ETHworldchain: {
key: 'ETHworldchain',
symbol: 'ETH',
nativeChain: 'Worldchain',
icon: TokenIcon.WORLDCHAIN,
coinGeckoId: 'ethereum',
decimals: 18,
wrappedAsset: 'WETHworldchain',
},
WETHworldchain: {
key: 'WETHworldchain',
symbol: 'WETH',
nativeChain: 'Worldchain',
icon: TokenIcon.WORLDCHAIN,
tokenId: {
chain: 'Worldchain',
address: '0x4200000000000000000000000000000000000006',
},
coinGeckoId: 'ethereum',
decimals: 18,
},
};

export const TESTNET_WRAPPED_TOKENS: TokenAddressesByChain = {
Expand Down
3 changes: 2 additions & 1 deletion wormhole-connect/src/config/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export enum TokenIcon {
'BLAST',
'XLAYER',
'MANTLE',
'WORLDCHAIN',
}

// Used in bridging components
Expand Down Expand Up @@ -302,7 +303,7 @@ export interface Transaction {
inProgress: boolean;
}

// Transanction data in local storage
// Transaction data in local storage
export interface TransactionLocal {
receipt: routes.Receipt<AttestationReceipt>;
route: string;
Expand Down
2 changes: 2 additions & 0 deletions wormhole-connect/src/icons/ChainIcons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import BLAST from './Chains/BLAST';
import MANTLE from './Chains/MANTLE';
import XLAYER from './Chains/XLAYER';
import OSMO from './Chains/OSMO';
import WORLD from './Chains/WORLD';

const useStyles = makeStyles<{ size: number }>()((theme, { size }) => ({
container: {
Expand Down Expand Up @@ -61,6 +62,7 @@ const iconMap: { [key in Chain]?: React.JSX.Element } = {
Xlayer: XLAYER(),
Mantle: MANTLE(),
Osmosis: OSMO(),
Worldchain: WORLD(),
};

function isBuiltinChainIcon(icon?: Chain | string): icon is Chain {
Expand Down
2 changes: 1 addition & 1 deletion wormhole-connect/src/icons/Chains/APT.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function APT() {
xmlns="http://www.w3.org/2000/svg"
>
<rect width="36" height="36" rx="6" fill="white" />
<g clip-path="url(#clip0_84_8298)">
<g clipPath="url(#clip0_84_8298)">
<path
d="M36 18C36 8.05887 27.9411 0 18 0C8.05887 0 0 8.05887 0 18C0 27.9411 8.05887 36 18 36C27.9411 36 36 27.9411 36 18Z"
fill="white"
Expand Down
Loading

0 comments on commit 283faaa

Please sign in to comment.