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

@layerzerolabs/lz-corekit-initia

Package Overview
Dependencies
Maintainers
0
Versions
91
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@layerzerolabs/lz-corekit-initia

LayerZero Core Library

  • 3.0.47
  • latest
  • npm
  • Socket score

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

@layerzerolabs/lz-corekit-initia

The Initia CoreKit is a comprehensive SDK designed to interact with the Initia blockchain. It provides a set of utilities and modules to facilitate the development and integration of applications with the Initia blockchain.

Features

  • Retrieve Account Information: Gets the balance of the specified address.
  • Retrieve Block Information: Gets the block height, timestamp and related transactions of the specified block.
  • Transaction Management: Get, build, sign, send and confirm transactions.

Installation

To install the Initia CoreKit, you can use npm or yarn:

npm install @layerzerolabs/lz-corekit-initia

or

yarn add @layerzerolabs/lz-corekit-initia

Usage

Initialization

import { InitiaProvider } from "@layerzerolabs/lz-corekit-initia";

// url is the Initia chain full node url
const url = "http://127.0.0.1:8516";
const provider = InitiaProvider.from(url);

Retrieve Account Information

Get Account Balance
import { InitiaProvider } from "@layerzerolabs/lz-corekit-initia";

// url is the Initia chain full node url
const url = "http://127.0.0.1:8516";
const provider = InitiaProvider.from(url);

const address = "0x1";
const balance = await provider.getBalance(address);

Retrieve Block Information

Get Latest Block Height
import { InitiaProvider } from "@layerzerolabs/lz-corekit-initia";

// url is the Initia chain full node url
const url = "http://127.0.0.1:8516";
const provider = InitiaProvider.from(url);

const number = await provider.getBlockNumber();

Transaction Management

Get Transaction by hash
import { InitiaProvider } from "@layerzerolabs/lz-corekit-initia";

// url is the Initia chain full node url
const url = "http://127.0.0.1:8516";
const provider = InitiaProvider.from(url);

const hash = "0x1";
const tx = await provider.getTransaction(hash);
Sign, Send and Confirm Transaction
import { InitiaProvider, InitiaSigner } from '@layerzerolabs/lz-corekit-initia'
import { SignedTransaction, TransactionReceipt, TransactionRequest } from '@layerzerolabs/lz-core'

// url is the Initia chain full node url
const url = 'http://127.0.0.1:8516'
const provider = InitiaProvider.from(url)

const privateKey = '0x1234'
const signer = InitiaSigner.from(privateKey)
signer.connect(provider)

const tx: TransactionRequest = ...
const stx: SignedTransaction = await signer.signTransaction(tx)
const receipt: TransactionReceipt = await signer.sendAndConfirm(stx)

FAQs

Package last updated on 21 Jan 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