@layerzerolabs/lz-definitions 2.3.42 → 2.3.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @layerzerolabs/lz-definitions
2
2
 
3
+ ## 2.3.44
4
+
5
+ ### Patch Changes
6
+
7
+ - aded88c: Fix issue with workspace:^ protocol in package.json for packages version 2.3.43.
8
+
9
+ ## 2.3.43
10
+
11
+ ### Patch Changes
12
+
13
+ - eced6b4: mainnet: Hedera, testnet: bevm
14
+
3
15
  ## 2.3.42
4
16
 
5
17
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -167,6 +167,7 @@ var EvmChain = /* @__PURE__ */ ((EvmChain2) => {
167
167
  EvmChain2["DM2VERSE"] = "dm2verse";
168
168
  EvmChain2["APE"] = "ape";
169
169
  EvmChain2["OZEAN"] = "ozean";
170
+ EvmChain2["BEVM"] = "bevm";
170
171
  return EvmChain2;
171
172
  })(EvmChain || {});
172
173
 
@@ -290,6 +291,7 @@ var MainnetEndpointId = /* @__PURE__ */ ((MainnetEndpointId2) => {
290
291
  MainnetEndpointId2[MainnetEndpointId2["REYA_MAINNET"] = 313] = "REYA_MAINNET";
291
292
  MainnetEndpointId2[MainnetEndpointId2["BITLAYER_MAINNET"] = 314] = "BITLAYER_MAINNET";
292
293
  MainnetEndpointId2[MainnetEndpointId2["DM2VERSE_MAINNET"] = 315] = "DM2VERSE_MAINNET";
294
+ MainnetEndpointId2[MainnetEndpointId2["HEDERA_MAINNET"] = 316] = "HEDERA_MAINNET";
293
295
  return MainnetEndpointId2;
294
296
  })(MainnetEndpointId || {});
295
297
  var TestnetEndpointId = /* @__PURE__ */ ((TestnetEndpointId2) => {
@@ -434,6 +436,7 @@ var TestnetEndpointId = /* @__PURE__ */ ((TestnetEndpointId2) => {
434
436
  TestnetEndpointId2[TestnetEndpointId2["DM2VERSE_TESTNET"] = 10321] = "DM2VERSE_TESTNET";
435
437
  TestnetEndpointId2[TestnetEndpointId2["MORPH_TESTNET"] = 10322] = "MORPH_TESTNET";
436
438
  TestnetEndpointId2[TestnetEndpointId2["OZEAN_TESTNET"] = 10323] = "OZEAN_TESTNET";
439
+ TestnetEndpointId2[TestnetEndpointId2["BEVM_TESTNET"] = 10324] = "BEVM_TESTNET";
437
440
  return TestnetEndpointId2;
438
441
  })(TestnetEndpointId || {});
439
442
  var SandboxEndpointId = /* @__PURE__ */ ((SandboxEndpointId2) => {
@@ -545,6 +548,7 @@ var MainnetV2EndpointId = /* @__PURE__ */ ((MainnetV2EndpointId2) => {
545
548
  MainnetV2EndpointId2[MainnetV2EndpointId2["REYA_V2_MAINNET"] = 30313] = "REYA_V2_MAINNET";
546
549
  MainnetV2EndpointId2[MainnetV2EndpointId2["BITLAYER_V2_MAINNET"] = 30314] = "BITLAYER_V2_MAINNET";
547
550
  MainnetV2EndpointId2[MainnetV2EndpointId2["DM2VERSE_V2_MAINNET"] = 30315] = "DM2VERSE_V2_MAINNET";
551
+ MainnetV2EndpointId2[MainnetV2EndpointId2["HEDERA_V2_MAINNET"] = 30316] = "HEDERA_V2_MAINNET";
548
552
  return MainnetV2EndpointId2;
549
553
  })(MainnetV2EndpointId || {});
550
554
  var TestnetV2EndpointId = /* @__PURE__ */ ((TestnetV2EndpointId2) => {
@@ -686,6 +690,7 @@ var TestnetV2EndpointId = /* @__PURE__ */ ((TestnetV2EndpointId2) => {
686
690
  TestnetV2EndpointId2[TestnetV2EndpointId2["DM2VERSE_V2_TESTNET"] = 40321] = "DM2VERSE_V2_TESTNET";
687
691
  TestnetV2EndpointId2[TestnetV2EndpointId2["MORPH_V2_TESTNET"] = 40322] = "MORPH_V2_TESTNET";
688
692
  TestnetV2EndpointId2[TestnetV2EndpointId2["OZEAN_V2_TESTNET"] = 40323] = "OZEAN_V2_TESTNET";
693
+ TestnetV2EndpointId2[TestnetV2EndpointId2["BEVM_V2_TESTNET"] = 40324] = "BEVM_V2_TESTNET";
689
694
  return TestnetV2EndpointId2;
690
695
  })(TestnetV2EndpointId || {});
691
696
  var SandboxV2EndpointId = /* @__PURE__ */ ((SandboxV2EndpointId2) => {
@@ -891,7 +896,6 @@ var ChainKey = /* @__PURE__ */ ((ChainKey3) => {
891
896
  ChainKey3["FRAXTAL"] = "fraxtal";
892
897
  ChainKey3["MODE_TESTNET"] = "mode-testnet";
893
898
  ChainKey3["MODE"] = "mode";
894
- ChainKey3["HEDERA_TESTNET"] = "hedera-testnet";
895
899
  ChainKey3["REAL"] = "real";
896
900
  ChainKey3["UNREAL_TESTNET"] = "unreal-testnet";
897
901
  ChainKey3["MASA"] = "masa";
@@ -991,6 +995,9 @@ var ChainKey = /* @__PURE__ */ ((ChainKey3) => {
991
995
  ChainKey3["BITLAYER_TESTNET"] = "bitlayer-testnet";
992
996
  ChainKey3["DM2VERSE"] = "dm2verse";
993
997
  ChainKey3["DM2VERSE_TESTNET"] = "dm2verse-testnet";
998
+ ChainKey3["BEVM_TESTNET"] = "bevm-testnet";
999
+ ChainKey3["HEDERA_TESTNET"] = "hedera-testnet";
1000
+ ChainKey3["HEDERA"] = "hedera";
994
1001
  return ChainKey3;
995
1002
  })(ChainKey || {});
996
1003
 
@@ -1091,6 +1098,7 @@ var CHAIN_KEY = {
1091
1098
  [EndpointId.REYA_MAINNET]: "reya" /* REYA */,
1092
1099
  [EndpointId.BITLAYER_MAINNET]: "bitlayer" /* BITLAYER */,
1093
1100
  [EndpointId.DM2VERSE_MAINNET]: "dm2verse" /* DM2VERSE */,
1101
+ [EndpointId.HEDERA_MAINNET]: "hedera" /* HEDERA */,
1094
1102
  // v2 mainnet
1095
1103
  [EndpointId.ETHEREUM_V2_MAINNET]: "ethereum" /* ETHEREUM */,
1096
1104
  [EndpointId.BSC_V2_MAINNET]: "bsc" /* BSC */,
@@ -1186,6 +1194,7 @@ var CHAIN_KEY = {
1186
1194
  [EndpointId.REYA_V2_MAINNET]: "reya" /* REYA */,
1187
1195
  [EndpointId.BITLAYER_V2_MAINNET]: "bitlayer" /* BITLAYER */,
1188
1196
  [EndpointId.DM2VERSE_V2_MAINNET]: "dm2verse" /* DM2VERSE */,
1197
+ [EndpointId.HEDERA_V2_MAINNET]: "hedera" /* HEDERA */,
1189
1198
  // testnet
1190
1199
  [EndpointId.ETHEREUM_TESTNET]: "sepolia" /* SEPOLIA */,
1191
1200
  [EndpointId.BSC_TESTNET]: "bsc-testnet" /* BSC_TESTNET */,
@@ -1328,6 +1337,7 @@ var CHAIN_KEY = {
1328
1337
  [EndpointId.BITLAYER_TESTNET]: "bitlayer-testnet" /* BITLAYER_TESTNET */,
1329
1338
  [EndpointId.DM2VERSE_TESTNET]: "dm2verse-testnet" /* DM2VERSE_TESTNET */,
1330
1339
  [EndpointId.OZEAN_TESTNET]: "ozean-testnet" /* OZEAN_TESTNET */,
1340
+ [EndpointId.BEVM_TESTNET]: "bevm-testnet" /* BEVM_TESTNET */,
1331
1341
  // v2 testnet
1332
1342
  [EndpointId.ETHEREUM_V2_TESTNET]: "sepolia" /* SEPOLIA */,
1333
1343
  [EndpointId.POLYGON_V2_TESTNET]: "mumbai" /* MUMBAI */,
@@ -1466,6 +1476,7 @@ var CHAIN_KEY = {
1466
1476
  [EndpointId.BITLAYER_V2_TESTNET]: "bitlayer-testnet" /* BITLAYER_TESTNET */,
1467
1477
  [EndpointId.DM2VERSE_V2_TESTNET]: "dm2verse-testnet" /* DM2VERSE_TESTNET */,
1468
1478
  [EndpointId.OZEAN_V2_TESTNET]: "ozean-testnet" /* OZEAN_TESTNET */,
1479
+ [EndpointId.BEVM_V2_TESTNET]: "bevm-testnet" /* BEVM_TESTNET */,
1469
1480
  [EndpointId.SOLANA_V2_TESTNET]: "solana-testnet" /* SOLANA_TESTNET */,
1470
1481
  // sandbox
1471
1482
  [EndpointId.ETHEREUM_SANDBOX]: "ethereum-sandbox" /* ETHEREUM_SANDBOX */,
@@ -1586,6 +1597,7 @@ var ENVIRONMENT = {
1586
1597
  [EndpointId.REYA_MAINNET]: "mainnet" /* MAINNET */,
1587
1598
  [EndpointId.BITLAYER_MAINNET]: "mainnet" /* MAINNET */,
1588
1599
  [EndpointId.DM2VERSE_MAINNET]: "mainnet" /* MAINNET */,
1600
+ [EndpointId.HEDERA_MAINNET]: "mainnet" /* MAINNET */,
1589
1601
  // v2 mainnet
1590
1602
  [EndpointId.ETHEREUM_V2_MAINNET]: "mainnet" /* MAINNET */,
1591
1603
  [EndpointId.BSC_V2_MAINNET]: "mainnet" /* MAINNET */,
@@ -1681,6 +1693,7 @@ var ENVIRONMENT = {
1681
1693
  [EndpointId.REYA_V2_MAINNET]: "mainnet" /* MAINNET */,
1682
1694
  [EndpointId.BITLAYER_V2_MAINNET]: "mainnet" /* MAINNET */,
1683
1695
  [EndpointId.DM2VERSE_V2_MAINNET]: "mainnet" /* MAINNET */,
1696
+ [EndpointId.HEDERA_V2_MAINNET]: "mainnet" /* MAINNET */,
1684
1697
  // testnet
1685
1698
  [EndpointId.ETHEREUM_TESTNET]: "testnet" /* TESTNET */,
1686
1699
  [EndpointId.BSC_TESTNET]: "testnet" /* TESTNET */,
@@ -1824,6 +1837,7 @@ var ENVIRONMENT = {
1824
1837
  [EndpointId.BITLAYER_TESTNET]: "testnet" /* TESTNET */,
1825
1838
  [EndpointId.DM2VERSE_TESTNET]: "testnet" /* TESTNET */,
1826
1839
  [EndpointId.OZEAN_TESTNET]: "testnet" /* TESTNET */,
1840
+ [EndpointId.BEVM_TESTNET]: "testnet" /* TESTNET */,
1827
1841
  // v2 testnet
1828
1842
  [EndpointId.ETHEREUM_V2_TESTNET]: "testnet" /* TESTNET */,
1829
1843
  [EndpointId.POLYGON_V2_TESTNET]: "testnet" /* TESTNET */,
@@ -1963,6 +1977,7 @@ var ENVIRONMENT = {
1963
1977
  [EndpointId.BITLAYER_V2_TESTNET]: "testnet" /* TESTNET */,
1964
1978
  [EndpointId.DM2VERSE_V2_TESTNET]: "testnet" /* TESTNET */,
1965
1979
  [EndpointId.OZEAN_V2_TESTNET]: "testnet" /* TESTNET */,
1980
+ [EndpointId.BEVM_V2_TESTNET]: "testnet" /* TESTNET */,
1966
1981
  [EndpointId.SOLANA_V2_TESTNET]: "testnet" /* TESTNET */,
1967
1982
  // sandbox
1968
1983
  [EndpointId.ETHEREUM_SANDBOX]: "testnet" /* TESTNET */,
@@ -2016,6 +2031,14 @@ var ULN_V1_CHAINS = [
2016
2031
  EndpointId.CELO_TESTNET,
2017
2032
  EndpointId.INTAIN_TESTNET
2018
2033
  ];
2034
+
2035
+ // src/constants/uln.ts
2036
+ var UlnVersion = /* @__PURE__ */ ((UlnVersion2) => {
2037
+ UlnVersion2[UlnVersion2["V1"] = 1] = "V1";
2038
+ UlnVersion2[UlnVersion2["V2"] = 2] = "V2";
2039
+ UlnVersion2[UlnVersion2["V3"] = 3] = "V3";
2040
+ return UlnVersion2;
2041
+ })(UlnVersion || {});
2019
2042
  function networkToEndpointId(network, version) {
2020
2043
  const name = network.replace("-local", "");
2021
2044
  const [chain, stage] = name.split("-");
@@ -2069,26 +2092,20 @@ function chainAndStageToNetwork(chain, stage, envOrIsLocal) {
2069
2092
  }
2070
2093
  return `${chain}-${stage}`;
2071
2094
  }
2072
- function endpointDomainToNetwork(domain) {
2073
- return chainAndStageToNetwork(domain.chain, domain.stage, domain.isLocal ? "local" /* LOCAL */ : void 0);
2095
+ function endpointSpecToNetwork(spec) {
2096
+ return chainAndStageToNetwork(spec.chain, spec.stage, spec.env);
2074
2097
  }
2075
- function endpointDomainToEnv(domain) {
2076
- return domain.isLocal ? "local" /* LOCAL */ : networkToEnv(endpointDomainToNetwork(domain), domain.version);
2098
+ function endpointSpecToEnv(spec) {
2099
+ return spec.env;
2077
2100
  }
2078
- function endpointDomainToEndpointId(domain) {
2079
- return chainAndStageToEndpointId(domain.chain, domain.stage, domain.version);
2101
+ function endpointSpecToEndpointId(spec) {
2102
+ return chainAndStageToEndpointId(spec.chain, spec.stage, spec.version);
2080
2103
  }
2081
- function endpointIdToEndpointDomain(endpointId, isLocal = false) {
2104
+ function endpointIdToEndpointSpec(endpointId, env) {
2082
2105
  const chain = endpointIdToChain(endpointId);
2083
2106
  const stage = endpointIdToStage(endpointId);
2084
2107
  const version = endpointIdToVersion(endpointId);
2085
- return { chain, stage, version, isLocal };
2086
- }
2087
- function networkToEndpointDomain(network, version) {
2088
- const chain = networkToChain(network);
2089
- const stage = networkToStage(network);
2090
- const isLocal = network.endsWith("-local");
2091
- return { chain, stage, version, isLocal };
2108
+ return { chain, stage, version, env };
2092
2109
  }
2093
2110
  function networkToChain(network) {
2094
2111
  return network.split("-")[0];
@@ -2097,7 +2114,7 @@ function networkToChainType(network) {
2097
2114
  const chain = networkToChain(network);
2098
2115
  return getChainType(chain);
2099
2116
  }
2100
- function getChainType(chain) {
2117
+ function chainToChainType(chain) {
2101
2118
  switch (chain) {
2102
2119
  case Chain.APTOS:
2103
2120
  return "aptos" /* APTOS */;
@@ -2111,6 +2128,9 @@ function getChainType(chain) {
2111
2128
  }
2112
2129
  }
2113
2130
  }
2131
+ function getChainType(chain) {
2132
+ return chainToChainType(chain);
2133
+ }
2114
2134
  function endpointIdToChain(endpointId) {
2115
2135
  const key = EndpointId[endpointId];
2116
2136
  invariant__default.default(key, `Invalid endpointId: ${endpointId}`);
@@ -2221,10 +2241,51 @@ function isSolanaChain(chain) {
2221
2241
  return getChainType(chain) === "solana" /* SOLANA */;
2222
2242
  }
2223
2243
 
2244
+ // src/chainspec.ts
2245
+ var chainSpecConfig = {
2246
+ ["evm" /* EVM */]: {
2247
+ default: {
2248
+ addressSizeInBytes: 20,
2249
+ decimals: 18
2250
+ },
2251
+ [Chain.TRON]: {
2252
+ decimals: 6
2253
+ }
2254
+ },
2255
+ ["aptos" /* APTOS */]: {
2256
+ default: {
2257
+ addressSizeInBytes: 32,
2258
+ decimals: 8
2259
+ }
2260
+ },
2261
+ ["solana" /* SOLANA */]: {
2262
+ default: {
2263
+ addressSizeInBytes: 32,
2264
+ decimals: 9
2265
+ }
2266
+ }
2267
+ };
2268
+ var ChainSpecs = class {
2269
+ static getAddressSizeInBytes(chain) {
2270
+ return this.getChainSpec(getChainType(chain), chain).addressSizeInBytes;
2271
+ }
2272
+ static getChainSpec(chainType, chain) {
2273
+ if (chainSpecConfig[chainType] === void 0) {
2274
+ throw new Error(`config for ${chainType} not found in staticConfig`);
2275
+ }
2276
+ const config = {
2277
+ ...chainSpecConfig[chainType]?.default,
2278
+ ...chainSpecConfig[chainType]?.[chain]
2279
+ };
2280
+ return config;
2281
+ }
2282
+ };
2283
+
2224
2284
  exports.AptosChain = AptosChain;
2225
2285
  exports.CHAIN_KEY = CHAIN_KEY;
2226
2286
  exports.Chain = Chain;
2227
2287
  exports.ChainKey = ChainKey;
2288
+ exports.ChainSpecs = ChainSpecs;
2228
2289
  exports.ChainType = ChainType;
2229
2290
  exports.ENVIRONMENT = ENVIRONMENT;
2230
2291
  exports.EndpointId = EndpointId;
@@ -2243,18 +2304,20 @@ exports.Stage = Stage;
2243
2304
  exports.TestnetEndpointId = TestnetEndpointId;
2244
2305
  exports.TestnetV2EndpointId = TestnetV2EndpointId;
2245
2306
  exports.ULN_V1_CHAINS = ULN_V1_CHAINS;
2307
+ exports.UlnVersion = UlnVersion;
2246
2308
  exports.chainAndStageToEndpointId = chainAndStageToEndpointId;
2247
2309
  exports.chainAndStageToNetwork = chainAndStageToNetwork;
2248
- exports.endpointDomainToEndpointId = endpointDomainToEndpointId;
2249
- exports.endpointDomainToEnv = endpointDomainToEnv;
2250
- exports.endpointDomainToNetwork = endpointDomainToNetwork;
2310
+ exports.chainToChainType = chainToChainType;
2251
2311
  exports.endpointIdToChain = endpointIdToChain;
2252
2312
  exports.endpointIdToChainKey = endpointIdToChainKey;
2253
2313
  exports.endpointIdToChainType = endpointIdToChainType;
2254
- exports.endpointIdToEndpointDomain = endpointIdToEndpointDomain;
2314
+ exports.endpointIdToEndpointSpec = endpointIdToEndpointSpec;
2255
2315
  exports.endpointIdToNetwork = endpointIdToNetwork;
2256
2316
  exports.endpointIdToStage = endpointIdToStage;
2257
2317
  exports.endpointIdToVersion = endpointIdToVersion;
2318
+ exports.endpointSpecToEndpointId = endpointSpecToEndpointId;
2319
+ exports.endpointSpecToEnv = endpointSpecToEnv;
2320
+ exports.endpointSpecToNetwork = endpointSpecToNetwork;
2258
2321
  exports.getChainIdForNetwork = getChainIdForNetwork;
2259
2322
  exports.getChainType = getChainType;
2260
2323
  exports.getEndpointVersionForUlnVersion = getEndpointVersionForUlnVersion;
@@ -2268,7 +2331,6 @@ exports.isTronChain = isTronChain;
2268
2331
  exports.isZKSyncBasedChain = isZKSyncBasedChain;
2269
2332
  exports.networkToChain = networkToChain;
2270
2333
  exports.networkToChainType = networkToChainType;
2271
- exports.networkToEndpointDomain = networkToEndpointDomain;
2272
2334
  exports.networkToEndpointId = networkToEndpointId;
2273
2335
  exports.networkToEnv = networkToEnv;
2274
2336
  exports.networkToStage = networkToStage;