0.0.20 • Published 8 months ago

@kukoomomo/sdk v0.0.20

Weekly downloads
-
License
MIT
Repository
-
Last release
8 months ago

@morphism/sdk

The @morphism/sdk package provides a set of tools for interacting with Morphism.

Installation

npm install @morphism/sdk

Docs

You can find auto-generated API documentation over at docs.morphism.xyz.

Using the SDK

CrossChainMessenger

The CrossChainMessenger class simplifies the process of moving assets and data between Ethereum and Morphism. You can use this class to, for example, initiate a withdrawal of ERC20 tokens from morphism 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. The CrossChainMessenger automatically connects to all relevant contracts so complex configuration is not necessary.

L2Provider and related utilities

The Morphism SDK includes various utilities for handling Morphism's transaction fee model. For instance, estimateTotalGasCost will estimate the total cost (in wei) to send at transaction on Morphism 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

CrossChainMessenger

The CrossChainMessenger class simplifies the process of moving assets and data between Ethereum and Morphism. You can use this class to, for example, initiate a withdrawal of ERC20 tokens from morphism 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. The CrossChainMessenger automatically connects to all relevant contracts so complex configuration is not necessary.

L2Provider and related utilities

The Morphism SDK includes various utilities for handling Morphism's transaction fee model. For instance, estimateTotalGasCost will estimate the total cost (in wei) to send at transaction on Morphism 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.

0.0.20

8 months ago

0.0.10

10 months ago

0.0.11

10 months ago

0.0.12

10 months ago

0.0.13

10 months ago

0.0.14

10 months ago

0.0.9

10 months ago

0.0.16

10 months ago

0.0.8

10 months ago

0.0.17

10 months ago

0.0.18

10 months ago

0.0.19

9 months ago

0.0.7

10 months ago

0.0.6

10 months ago

0.0.5

11 months ago

0.0.4

12 months ago

0.0.3

12 months ago

0.0.2

12 months ago

0.0.1

12 months ago