Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@layerzerolabs/lz-definitions

Package Overview
Dependencies
Maintainers
8
Versions
249
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@layerzerolabs/lz-definitions - npm Package Compare versions

Comparing version 1.5.7 to 1.5.8

1

dist/utils/utils.d.ts

@@ -19,2 +19,3 @@ import { Chain, ChainType, EndpointVersion, Environment, Stage } from '../enums';

export declare function getNetworksForStage(stage: Stage): string[];
export declare const getEndpointVersionForUlnVersion: (ulnVersion: string) => EndpointVersion;
export declare function getChainIdForNetwork(chain: string, stage: string, ulnVersion: string): string;

@@ -21,0 +22,0 @@ export declare function getNetworkForChainId(targetchainId: number): {

@@ -6,3 +6,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.getNetworkForChainId = exports.getChainIdForNetwork = exports.getNetworksForStage = exports.endpointIdToChainType = exports.endpointIdToStage = exports.endpointIdToChain = exports.getChainType = exports.networkToChainType = exports.networkToChain = exports.chainAndStageToNetwork = exports.chainAndStageToEndpointId = exports.endpointIdToNetwork = exports.networkToStage = exports.networkToEnv = exports.networkToEndpointId = void 0;
exports.getNetworkForChainId = exports.getChainIdForNetwork = exports.getEndpointVersionForUlnVersion = exports.getNetworksForStage = exports.endpointIdToChainType = exports.endpointIdToStage = exports.endpointIdToChain = exports.getChainType = exports.networkToChainType = exports.networkToChain = exports.chainAndStageToNetwork = exports.chainAndStageToEndpointId = exports.endpointIdToNetwork = exports.networkToStage = exports.networkToEnv = exports.networkToEndpointId = void 0;
const tiny_invariant_1 = __importDefault(require("tiny-invariant"));

@@ -121,4 +121,19 @@ const constants_1 = require("../constants");

const ULN_V1_BIAS = 100;
const getEndpointVersionForUlnVersion = (ulnVersion) => {
const [majorVerion, minorVersion, endpointVersion] = ulnVersion.split('.');
if (!endpointVersion) {
return enums_1.EndpointVersion.V1;
}
const version = {
'1': enums_1.EndpointVersion.V1,
'2': enums_1.EndpointVersion.V2,
}[endpointVersion];
if (!version) {
throw new Error(`Invalid ulnVersion: ${ulnVersion}`);
}
return version;
};
exports.getEndpointVersionForUlnVersion = getEndpointVersionForUlnVersion;
function getChainIdForNetwork(chain, stage, ulnVersion) {
const endpointId = chainAndStageToEndpointId(chain, stage, enums_1.EndpointVersion.V1);
const endpointId = chainAndStageToEndpointId(chain, stage, (0, exports.getEndpointVersionForUlnVersion)(ulnVersion));
return (ulnVersion == '1' ? endpointId - ULN_V1_BIAS : endpointId).toString();

@@ -125,0 +140,0 @@ }

8

package.json
{
"name": "@layerzerolabs/lz-definitions",
"version": "1.5.7",
"version": "1.5.8",
"description": "LayerZero Utility",

@@ -9,3 +9,3 @@ "license": "MIT",

"files": [
"dist"
"dist/**/*"
],

@@ -24,4 +24,4 @@ "scripts": {

"@jest/globals": "^29.5.0",
"@layerzerolabs/eslint-config": "^1.5.7",
"@layerzerolabs/typescript-config": "^1.5.7",
"@layerzerolabs/eslint-config": "^1.5.8",
"@layerzerolabs/typescript-config": "^1.5.8",
"@types/jest": "^29.4.0",

@@ -28,0 +28,0 @@ "eslint": "^8.17.0",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc