@kroma/sdk
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

@kroma/sdk

The @kroma/sdk package provides a set of tools for interacting with Kroma.

Installation

> npm install @kroma/sdk

Using the SDK

CrossChainMessenger

The CrossChainMessenger class simplifies the process of moving assets and data between Ethereum and Kroma. You can use this class to, for example, initiate a withdrawal of ERC20 tokens from Kroma back to Ethereum, accurately track when the withdrawal is ready to be finalized on Ethereum, and execute the finalization transaction after the challenge period has elapsed. The CrossChainMessenger can handle deposits and withdrawals of ETH and any ERC20-compatible token. Detailed API descriptions can be found at sdk.optimism.io. The CrossChainMessenger automatically connects to all relevant contracts so complex configuration is not necessary.

L2Provider and related utilities

The Kroma SDK includes various utilities for handling Kroma's transaction fee model. For instance, estimateTotalGasCost will estimate the total cost (in wei) to send at transaction on Kroma including both the L2 execution cost and the L1 data cost. You can also use the asL2Provider function to wrap an ethers Provider object into an L2Provider which will have all of these helper functions attached.

Other utilities

The SDK contains other useful helper functions and constants. For a complete list, refer to the auto-generated SDK documentation

Readme

Keywords

Package Sidebar

Install

npm i @kroma/sdk

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

338 kB

Total Files

91

Last publish

Collaborators

  • 0xhanslee
  • pangssu
  • seolaoh
  • chokobole