Skip to content

Commit

Permalink
Added X Layer mainnet and testnet
Browse files Browse the repository at this point in the history
  • Loading branch information
kev1n-peters authored and artursapek committed May 28, 2024
1 parent aefabd3 commit e9abac6
Show file tree
Hide file tree
Showing 17 changed files with 207 additions and 21 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ By default, it offers its full built-in list for both `mainnet` and `testnet`:
| optimism | optimismgoerli, optimism_sepolia |
| scroll | scroll |
| blast | blast |
| xlayer | xlayer |

> Osmosis support is in beta, reach out to a Wormhole contributor for early access.
Expand Down
93 changes: 74 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"sideEffects": false,
"dependencies": {
"@certusone/wormhole-sdk": "^0.10.15",
"@certusone/wormhole-sdk": "^0.10.16",
"@cosmjs/cosmwasm-stargate": "^0.31.3",
"@cosmjs/proto-signing": "^0.31.3",
"@cosmjs/stargate": "^0.31.3",
Expand Down
12 changes: 12 additions & 0 deletions sdk/src/config/MAINNET.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export const MAINNET_CHAINS = {
sei: 32,
scroll: 34,
blast: 36,
xlayer: 37,
wormchain: 3104,
osmosis: 20,
cosmoshub: 4000,
Expand Down Expand Up @@ -297,6 +298,16 @@ const MAINNET: { [chain in MainnetChainName]: ChainConfig } = {
finalityThreshold: 0,
nativeTokenDecimals: 18,
},
xlayer: {
key: 'xlayer',
id: 37,
context: Context.ETH,
contracts: {
...CONTRACTS.MAINNET.xlayer,
},
finalityThreshold: 0,
nativeTokenDecimals: 18,
},
wormchain: {
context: Context.COSMOS,
key: 'wormchain',
Expand Down Expand Up @@ -384,6 +395,7 @@ const MAINNET_CONFIG: WormholeConfig = {
klaytn: 'https://rpc.ankr.com/klaytn',
scroll: 'https://rpc.ankr.com/scroll',
blast: 'https://rpc.ankr.com/blast',
xlayer: 'https://rpc.xlayer.tech',
},
rest: {
sei: '',
Expand Down
12 changes: 12 additions & 0 deletions sdk/src/config/TESTNET.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export const TESTNET_CHAINS = {
sei: 32,
scroll: 34,
blast: 36,
xlayer: 37,
wormchain: 3104,
osmosis: 20,
cosmoshub: 4000,
Expand Down Expand Up @@ -283,6 +284,16 @@ const TESTNET: { [chain in TestnetChainName]: ChainConfig } = {
finalityThreshold: 0,
nativeTokenDecimals: 18,
},
xlayer: {
key: 'xlayer',
id: 37,
context: Context.ETH,
contracts: {
...CONTRACTS.TESTNET.xlayer,
},
finalityThreshold: 0,
nativeTokenDecimals: 18,
},
wormchain: {
context: Context.COSMOS,
key: 'wormchain',
Expand Down Expand Up @@ -422,6 +433,7 @@ const TESTNET_CONFIG: WormholeConfig = {
optimism_sepolia: 'https://sepolia.optimism.io',
scroll: 'https://rpc.ankr.com/scroll_sepolia_testnet',
blast: 'https://rpc.ankr.com/blast_testnet_sepolia',
xlayer: 'https://testrpc.xlayer.tech',
},
rest: {
sei: 'https://rest.atlantic-2.seinetwork.io',
Expand Down
3 changes: 2 additions & 1 deletion wormhole-connect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,12 @@
"@wormhole-foundation/sdk": "^0.7.0-beta.3",
"@wormhole-foundation/sdk-definitions": "^0.7.0-beta.3",
"@wormhole-foundation/sdk-definitions-ntt": "^0.0.1-beta.5",
"@wormhole-foundation/sdk-icons": "^0.6.8",
"@xlabs-libs/wallet-aggregator-aptos": "^0.0.1-alpha.14",
"@xlabs-libs/wallet-aggregator-core": "^0.0.1-alpha.18",
"@xlabs-libs/wallet-aggregator-cosmos": "^0.0.1-alpha.14",
"@xlabs-libs/wallet-aggregator-cosmos-evm": "^0.0.1-alpha.6",
"@xlabs-libs/wallet-aggregator-evm": "^0.0.1-alpha.39",
"@xlabs-libs/wallet-aggregator-evm": "^0.0.1-alpha.42",
"@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",
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 @@ -232,4 +232,15 @@ export const MAINNET_CHAINS: ChainsConfig = {
automaticRelayer: false,
maxBlockSearch: 2000,
},
xlayer: {
...chains.xlayer!,
displayName: 'X Layer',
explorerUrl: 'https://www.okx.com/web3/explorer/xlayer/',
explorerName: 'OKX Explorer',
gasToken: 'OKB',
chainId: 196,
icon: Icon.XLAYER,
automaticRelayer: false,
maxBlockSearch: 2000,
},
};
7 changes: 7 additions & 0 deletions wormhole-connect/src/config/mainnet/gasEstimates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,4 +332,11 @@ export const MAINNET_GAS_ESTIMATES: GasEstimates = {
claim: 300000,
},
},
xlayer: {
[Route.Bridge]: {
sendNative: 100000,
sendToken: 100000,
claim: 300000,
},
},
};
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 @@ -25,6 +25,7 @@ const {
REACT_APP_APTOS_GRAPHQL,
REACT_APP_SCROLL_RPC,
REACT_APP_BLAST_RPC,
REACT_APP_XLAYER_RPC,
} = import.meta.env;

export const MAINNET_RPC_MAPPING = {
Expand All @@ -50,6 +51,7 @@ export const MAINNET_RPC_MAPPING = {
...populateRpcField('klaytn', REACT_APP_KLAYTN_RPC),
...populateRpcField('scroll', REACT_APP_SCROLL_RPC),
...populateRpcField('blast', REACT_APP_BLAST_RPC),
...populateRpcField('xlayer', REACT_APP_XLAYER_RPC),
};

export const MAINNET_REST_MAPPING = {
Expand Down
27 changes: 27 additions & 0 deletions wormhole-connect/src/config/mainnet/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2775,4 +2775,31 @@ export const MAINNET_TOKENS: TokensConfig = {
default: 8,
},
},
OKB: {
key: 'OKB',
symbol: 'OKB',
nativeChain: 'xlayer',
icon: Icon.XLAYER,
coinGeckoId: 'okb',
decimals: {
Ethereum: 18,
default: 8,
},
wrappedAsset: 'WOKB',
},
WOKB: {
key: 'WOKB',
symbol: 'WOKB',
nativeChain: 'xlayer',
icon: Icon.XLAYER,
tokenId: {
chain: 'xlayer',
address: '0xe538905cf8410324e03A5A23C1c177a474D59b2b',
},
coinGeckoId: 'okb',
decimals: {
Ethereum: 18,
default: 8,
},
},
};
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 @@ -297,4 +297,15 @@ export const TESTNET_CHAINS: ChainsConfig = {
automaticRelayer: false,
maxBlockSearch: 2000,
},
xlayer: {
...chains.xlayer!,
displayName: 'X Layer',
explorerUrl: 'https://www.okx.com/web3/explorer/xlayer-test/',
explorerName: 'OKX Explorer',
gasToken: 'OKB',
chainId: 195,
icon: Icon.XLAYER,
automaticRelayer: false,
maxBlockSearch: 2000,
},
};
7 changes: 7 additions & 0 deletions wormhole-connect/src/config/testnet/gasEstimates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,4 +330,11 @@ export const TESTNET_GAS_ESTIMATES: GasEstimates = {
claim: 200000,
},
},
xlayer: {
[Route.Bridge]: {
sendNative: 100000,
sendToken: 150000,
claim: 200000,
},
},
};
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 @@ -30,6 +30,7 @@ const {
REACT_APP_APTOS_TESTNET_GRAPHQL,
REACT_APP_SCROLL_TESTNET_RPC,
REACT_APP_BLAST_TESTNET_RPC,
REACT_APP_XLAYER_TESTNET_RPC,
} = import.meta.env;

export const TESTNET_RPC_MAPPING = {
Expand Down Expand Up @@ -60,6 +61,7 @@ export const TESTNET_RPC_MAPPING = {
...populateRpcField('klaytn', REACT_APP_KLAYTN_TESTNET_RPC),
...populateRpcField('scroll', REACT_APP_SCROLL_TESTNET_RPC),
...populateRpcField('blast', REACT_APP_BLAST_TESTNET_RPC),
...populateRpcField('xlayer', REACT_APP_XLAYER_TESTNET_RPC),
};

export const TESTNET_REST_MAPPING = {
Expand Down
27 changes: 27 additions & 0 deletions wormhole-connect/src/config/testnet/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2320,4 +2320,31 @@ export const TESTNET_TOKENS: TokensConfig = {
default: 8,
},
},
OKB: {
key: 'OKB',
symbol: 'OKB',
nativeChain: 'xlayer',
icon: Icon.XLAYER,
coinGeckoId: 'okb',
decimals: {
Ethereum: 18,
default: 8,
},
wrappedAsset: 'WOKB',
},
WOKB: {
key: 'WOKB',
symbol: 'WOKB',
nativeChain: 'xlayer',
icon: Icon.XLAYER,
tokenId: {
chain: 'xlayer',
address: '0xa2aFfd8301BfB3c5b815829f2F509f053556D21B',
},
coinGeckoId: 'okb',
decimals: {
Ethereum: 18,
default: 8,
},
},
};
1 change: 1 addition & 0 deletions wormhole-connect/src/config/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export enum Icon {
'NTT',
'SCROLL',
'BLAST',
'XLAYER',
}

export enum Route {
Expand Down
Loading

0 comments on commit e9abac6

Please sign in to comment.