Skip to content

Commit

Permalink
Merge pull request #70 from LayerZero-Labs/jan/new-chains
Browse files Browse the repository at this point in the history
feat: Add Loot, Loot testnet, Telos testnet, Tomo testnet, Zora testnet
  • Loading branch information
janjakubnanista authored Aug 24, 2023
2 parents ae62e1f + ebc5076 commit 8291f5e
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/lz-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@layerzerolabs/lz-sdk",
"version": "0.0.37",
"version": "0.0.38",
"license": "BUSL-1.1",
"description": "LayerZero SDK",
"type": "module",
Expand Down
15 changes: 15 additions & 0 deletions packages/lz-sdk/src/constants/addresses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ export const LZ_ADDRESS: { [chainKey in ChainKey]?: string } = {
[ChainKey.HARMONY_TESTNET]: "0x6098e96a28E02f27B1e6BD381f870F1C8Bd169d3",
[ChainKey.KAVA]: "0xb6319cC6c8c27A8F5dAF0dD3DF91EA35C4720dd7",
[ChainKey.KAVA_TESTNET]: "0x8b14D287B4150Ff22Ac73DF8BE720e933f659abc",
[ChainKey.LOOT]: "0xb6319cC6c8c27A8F5dAF0dD3DF91EA35C4720dd7",
[ChainKey.LOOT_TESTNET]: "0x83c73Da98cf733B03315aFa8758834b36a195b87",
[ChainKey.HARMONY]: "0x9740FF91F1985D8d2B71494aE1A2f723bb3Ed9E4",
[ChainKey.MANTLE]: "0xb6319cC6c8c27A8F5dAF0dD3DF91EA35C4720dd7",
[ChainKey.MANTLE_TESTNET]: "0x2cA20802fd1Fd9649bA8Aa7E50F0C82b479f35fe",
Expand All @@ -70,12 +72,15 @@ export const LZ_ADDRESS: { [chainKey in ChainKey]?: string } = {
[ChainKey.SWIMMER_TESTNET_SANDBOX]: "",
[ChainKey.SWIMMER_TESTNET]: "0x9DFdB0FC5b3454f43Bc76B693b75CFf2eccfAd13",
[ChainKey.SWIMMER]: "0x9740FF91F1985D8d2B71494aE1A2f723bb3Ed9E4",
[ChainKey.TELOS_TESTNET]: "0x83c73Da98cf733B03315aFa8758834b36a195b87",
[ChainKey.TENET]: "0x2D61DCDD36F10b22176E0433B86F74567d529aAa",
[ChainKey.TENET_TESTNET]: "0x6aB5Ae6822647046626e83ee6dB8187151E1d5ab",
[ChainKey.TOMO_TESTNET]: "0xae92d5aD7583AD66E49A0c67BAd18F6ba52dDDc1",
[ChainKey.ZKCONSENSYS]: "0xb6319cC6c8c27A8F5dAF0dD3DF91EA35C4720dd7",
[ChainKey.ZKCONSENSYS_TESTNET]: "0x6aB5Ae6822647046626e83ee6dB8187151E1d5ab",
[ChainKey.BEAM]: "0xb6319cC6c8c27A8F5dAF0dD3DF91EA35C4720dd7",
[ChainKey.BEAM_TESTNET]: "0xae92d5aD7583AD66E49A0c67BAd18F6ba52dDDc1",
[ChainKey.ZORA_TESTNET]: "0x83c73Da98cf733B03315aFa8758834b36a195b87",
}

export const LZ_RELAYER: { [chainKey in ChainKey]?: string } = {
Expand Down Expand Up @@ -176,6 +181,8 @@ export const LZ_RELAYER_V2: { [chainKey in ChainKey]?: string } = {
[ChainKey.KAVA_TESTNET]: "0x35AdD9321507A87471a11EBd4aE4f592d531e620",
[ChainKey.KLAYTN_TESTNET]: "0xb23b28012ee92E8dE39DEb57Af31722223034747",
[ChainKey.KLAYTN]: "0x5B19bd330A84c049b62D5B0FC2bA120217a18C1C",
[ChainKey.LOOT]: "0xA658742d33ebd2ce2F0bdFf73515Aa797Fd161D9",
[ChainKey.LOOT_TESTNET]: "0x35AdD9321507A87471a11EBd4aE4f592d531e620",
[ChainKey.MANTLE]: "0xcb566e3B6934Fa77258d68ea18E931fa75e1aaAa",
[ChainKey.MANTLE_TESTNET]: "0x6Ac7bdc07A0583A362F1497252872AE6c0A5F5B8",
[ChainKey.METER_TESTNET]: "0xf35848b061f7b0A4F69BCA8804947e1EE29Ff734",
Expand Down Expand Up @@ -208,10 +215,13 @@ export const LZ_RELAYER_V2: { [chainKey in ChainKey]?: string } = {
[ChainKey.ZKPOLYGON]: "0xA658742d33ebd2ce2F0bdFf73515Aa797Fd161D9",
[ChainKey.ZKSYNC_TESTNET]: "0xD5eE0055c37dDfaF7e2e0CA3dECb60f365848Bd5",
[ChainKey.ZKSYNC]: "0x9923573104957bF457a3C4DF0e21c8b389Dd43df",
[ChainKey.TELOS_TESTNET]: "0x35AdD9321507A87471a11EBd4aE4f592d531e620",
[ChainKey.TENET]: "0xAaB5A48CFC03Efa9cC34A2C1aAcCCB84b4b770e4",
[ChainKey.TENET_TESTNET]: "0x35AdD9321507A87471a11EBd4aE4f592d531e620",
[ChainKey.TOMO_TESTNET]: "0x35AdD9321507A87471a11EBd4aE4f592d531e620",
[ChainKey.BEAM]: "0xA658742d33ebd2ce2F0bdFf73515Aa797Fd161D9",
[ChainKey.BEAM_TESTNET]: "0x88866E5A296FffA511EF8011CB1BBd4d01Cd094F",
[ChainKey.ZORA_TESTNET]: "0x35AdD9321507A87471a11EBd4aE4f592d531e620",
}

export const LZ_ULTRA_LIGHT_NODE_V1: { [chainKey in ChainKey]?: string } = {
Expand Down Expand Up @@ -351,6 +361,8 @@ export const LZ_ULTRA_LIGHT_NODE_V2: { [chainKey in ChainKey]?: string } = {
[ChainKey.KLAYTN]: "",
[ChainKey.KOVAN_SANDBOX]: "",
[ChainKey.KOVAN]: "",
[ChainKey.LOOT]: "0x38dE71124f7a447a01D67945a51eDcE9FF491251",
[ChainKey.LOOT_TESTNET]: "0x55370E0fBB5f5b8dAeD978BA1c075a499eB107B8",
[ChainKey.MANTLE]: "0x38dE71124f7a447a01D67945a51eDcE9FF491251",
[ChainKey.MANTLE_TESTNET]: "0x533fB43e6808D9634CC0DD0c6c1195e8921D4FCC",
[ChainKey.METER_TESTNET]: "",
Expand Down Expand Up @@ -385,8 +397,10 @@ export const LZ_ULTRA_LIGHT_NODE_V2: { [chainKey in ChainKey]?: string } = {
[ChainKey.SWIMMER_TESTNET_SANDBOX]: "",
[ChainKey.SWIMMER_TESTNET]: "",
[ChainKey.SWIMMER]: "",
[ChainKey.TELOS_TESTNET]: "0x55370E0fBB5f5b8dAeD978BA1c075a499eB107B8",
[ChainKey.TENET]: "0xFe7C30860D01e28371D40434806F4A8fcDD3A098",
[ChainKey.TENET_TESTNET]: "0x2cA20802fd1Fd9649bA8Aa7E50F0C82b479f35fe",
[ChainKey.TOMO_TESTNET]: "0x4e08B1F1AC79898569CfB999FB92B5495FB18A2B",
[ChainKey.ZKCONSENSYS]: "0x38dE71124f7a447a01D67945a51eDcE9FF491251",
[ChainKey.ZKCONSENSYS_TESTNET]: "0x6C7Ab2202C98C4227C5c46f1417D81144DA716Ff",
[ChainKey.ZKPOLYGON_TESTNET]: "",
Expand All @@ -395,4 +409,5 @@ export const LZ_ULTRA_LIGHT_NODE_V2: { [chainKey in ChainKey]?: string } = {
[ChainKey.ZKSYNC]: "",
[ChainKey.BEAM]: "0x38dE71124f7a447a01D67945a51eDcE9FF491251",
[ChainKey.BEAM_TESTNET]: "0x4e08B1F1AC79898569CfB999FB92B5495FB18A2B",
[ChainKey.ZORA_TESTNET]: "0x55370E0fBB5f5b8dAeD978BA1c075a499eB107B8",
}
5 changes: 5 additions & 0 deletions packages/lz-sdk/src/constants/blockTime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ export const AVERAGE_BLOCK_TIME: { [chainId in ChainId]: number } = {
[ChainId.KLAYTN]: 1,
[ChainId.KOVAN_SANDBOX]: 4.2,
[ChainId.KOVAN]: 4.2,
[ChainId.LOOT]: 2,
[ChainId.LOOT_TESTNET]: 2,
[ChainId.MANTLE]: 5,
[ChainId.MANTLE_TESTNET]: 7,
[ChainId.METER_TESTNET]: 1,
Expand Down Expand Up @@ -112,8 +114,10 @@ export const AVERAGE_BLOCK_TIME: { [chainId in ChainId]: number } = {
[ChainId.SWIMMER_TESTNET_SANDBOX]: 5,
[ChainId.SWIMMER_TESTNET]: 5,
[ChainId.SWIMMER]: 5,
[ChainId.TELOS_TESTNET]: 1, // They don't actually produce blocks at regular intervals
[ChainId.TENET]: 3.5,
[ChainId.TENET_TESTNET]: 3.7,
[ChainId.TOMO_TESTNET]: 3,
[ChainId.ZKCONSENSYS]: 1,
[ChainId.ZKCONSENSYS_TESTNET]: 1,
[ChainId.ZKPOLYGON_TESTNET]: 2,
Expand All @@ -123,4 +127,5 @@ export const AVERAGE_BLOCK_TIME: { [chainId in ChainId]: number } = {
[ChainId.BLOCKGEN_TESTNET]: 1,
[ChainId.BEAM]: 1,
[ChainId.BEAM_TESTNET]: 1,
[ChainId.ZORA_TESTNET]: 1.8,
}
6 changes: 6 additions & 0 deletions packages/lz-sdk/src/constants/rpcs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,4 +192,10 @@ export const RPCS: { [chainId in ChainId]?: string[] } = {
"https://gnosischain-rpc.gateway.pokt.network",
"https://web3endpoints.com/gnosischain-mainnet",
],
[ChainId.BEAM]: ["https://subnets.avax.network/beam/mainnet/rpc"],
[ChainId.TELOS_TESTNET]: ["https://testnet15a.telos.net/evm"],
[ChainId.TOMO_TESTNET]: ["https://rpc.testnet.tomochain.com"],
[ChainId.LOOT]: ["https://rpc.lootchain.com/http", "https://rpc.lootchain.com/replica-http"],
[ChainId.LOOT_TESTNET]: ["https://testnet.rpc.lootchain.com/http"],
[ChainId.ZORA_TESTNET]: ["https://testnet.rpc.zora.energy"],
}
5 changes: 5 additions & 0 deletions packages/lz-sdk/src/enums/ChainId.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ export enum ChainId {
KAVA_TESTNET = 10172,
KLAYTN = 150,
KLAYTN_TESTNET = 10150,
LOOT = 197,
LOOT_TESTNET = 10197,
KOVAN = 10120,
KOVAN_SANDBOX = 20120,
MANTLE = 181,
Expand Down Expand Up @@ -111,12 +113,15 @@ export enum ChainId {
SWIMMER = 114,
SWIMMER_TESTNET = 10130,
SWIMMER_TESTNET_SANDBOX = 20130,
TELOS_TESTNET = 10199,
TENET = 173,
TENET_TESTNET = 10173,
TOMO_TESTNET = 10196,
ZKCONSENSYS = 183,
ZKCONSENSYS_TESTNET = 10157,
ZKPOLYGON = 158,
ZKPOLYGON_TESTNET = 10158,
ZKSYNC = 165,
ZKSYNC_TESTNET = 10165,
ZORA_TESTNET = 10195,
}
5 changes: 5 additions & 0 deletions packages/lz-sdk/src/enums/ChainKey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ export enum ChainKey {
KLAYTN_TESTNET = "klaytn-testnet",
KOVAN = "kovan",
KOVAN_SANDBOX = "kovan-sandbox",
LOOT = "loot",
LOOT_TESTNET = "loot-testnet",
MANTLE = "mantle",
MANTLE_TESTNET = "mantle-testnet",
METER = "meter",
Expand Down Expand Up @@ -111,12 +113,15 @@ export enum ChainKey {
SWIMMER = "swimmer",
SWIMMER_TESTNET = "swimmer-testnet",
SWIMMER_TESTNET_SANDBOX = "swimmer-testnet-sandbox",
TELOS_TESTNET = "telos-testnet",
TENET = "tenet",
TENET_TESTNET = "tenet-testnet",
TOMO_TESTNET = "tomo-testnet",
ZKCONSENSYS = "zkconsensys",
ZKCONSENSYS_TESTNET = "zkconsensys-testnet",
ZKPOLYGON = "zkpolygon",
ZKPOLYGON_TESTNET = "zkpolygon-testnet",
ZKSYNC = "zksync",
ZKSYNC_TESTNET = "zksync-testnet",
ZORA_TESTNET = "zora-testnet",
}
8 changes: 8 additions & 0 deletions packages/lz-sdk/src/enums/ChainListId.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ export enum ChainListId {
KLAYTN_TESTNET = 1001,
KOVAN = 42,
KOVAN_SANDBOX = 42,
LOOT = 5151706,
LOOT_TESTNET = 9088912,
MANTLE = 5000,
MANTLE_TESTNET = 5001,
METER = 82,
Expand Down Expand Up @@ -94,12 +96,18 @@ export enum ChainListId {
SWIMMER = 73772,
SWIMMER_TESTNET = 73771,
SWIMMER_TESTNET_SANDBOX = 73771,
TELOS = 40,
TELOS_TESTNET = 41,
TENET = 1559,
TENET_TESTNET = 155,
TOMO = 88,
TOMO_TESTNET = 89,
ZKCONSENSYS = 59144,
ZKCONSENSYS_TESTNET = 59140,
ZKPOLYGON = 1101,
ZKPOLYGON_TESTNET = 1442,
ZKSYNC = 324,
ZKSYNC_TESTNET = 280,
ZORA = 7777777,
ZORA_TESTNET = 999,
}

0 comments on commit 8291f5e

Please sign in to comment.