New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@layerzerolabs/lz-config-types

Package Overview
Dependencies
Maintainers
0
Versions
116
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@layerzerolabs/lz-config-types

LayerZero Core Library

  • 3.0.67
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
0
Weekly downloads
 
Created
Source

@layerzerolabs/lz-config-types

This package defines the core interface for the tooling stack, and only includes neutral interfaces unrelated to the LayerZero protocol.

  • Transaction Interface: Used to express transactions in different stages.
  • Provider Interface: Define the connectors to a chain node.
  • Signer Interface: Sign message and transaction.
  • Deployment interface: Represent the structure for deployment information

Installation

To install the LayerZero Config Types package, you can use npm or yarn:

npm install @layerzerolabs/lz-config-types

or

yarn add @layerzerolabs/lz-config-types

Usage

Provider Configuration

ProviderManager

Provides methods to retrieve providers based on the specified chain and environment.

  • chain: The chain for which to retrieve the provider.
  • env: The environment for which to retrieve the provider.
  • Returns: A promise that resolves to the provider.
import { ProviderManager } from "@layerzerolabs/lz-config-types";
import { Chain, Environment } from "@layerzerolabs/lz-definitions";

const providerManager: ProviderManager = {
  async getProvider(chain: Chain, env: Environment): Promise<Provider> {
    // Implementation to retrieve the provider
  },
};

const chain: Chain = "ethereum";
const env: Environment = "mainnet";

providerManager.getProvider(chain, env).then((provider) => {
  console.log(`Provider: ${provider}`);
});

Signer Configuration

SignerManager

Provides methods to retrieve signers based on the specified chain, stage, environment, and key name.

  • chain: The chain for which to retrieve the signer.
  • stage: The stage for which to retrieve the signer.
  • env: The environment for which to retrieve the signer.
  • keyName: The key name for which to retrieve the signer.
  • Returns: A promise that resolves to the signer.
import { SignerManager } from "@layerzerolabs/lz-config-types";
import { Chain, Stage, Environment } from "@layerzerolabs/lz-definitions";

const signerManager: SignerManager = {
  async getSigner(chain: Chain, stage: Stage, env: Environment, keyName: string): Promise<Signer> {
    // Implementation to retrieve the signer
  },
};

const chain: Chain = "ethereum";
const stage: Stage = "development";
const env: Environment = "sandbox";
const keyName = "key1";

signerManager.getSigner(chain, stage, env, keyName).then((signer) => {
  console.log(`Signer: ${signer}`);
});

Configuration Manager

ConfigManager

Provides methods to retrieve configuration values based on a specified path.

  • path: The path to the configuration value.
  • Returns: A promise that resolves to the configuration value.
import { ConfigManager } from "@layerzerolabs/lz-config-types";

const configManager: ConfigManager = {
  async get(...path: (string | number | (string | number)[])[]): Promise<unknown> {
    // Implementation to retrieve the configuration value
  },
};

configManager.get("database", "host").then((value) => {
  console.log(`Configuration Value: ${value}`);
});

FAQs

Package last updated on 07 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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