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

@moonbeam-network/mrl

Package Overview
Dependencies
Maintainers
0
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@moonbeam-network/mrl

Moonbeam Routed Liquidity

  • 3.0.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

The Moonbeam MRL SDK enables developers to easily transfer liquidity into and across the Polkadot ecosystem from other ecosystems like Ethereum. With the SDK, you don't need to worry about setting up the different contract calls and extrinsics involved in the process of moving assets between the chains and ecosystems. It is an extension of the XCM SDK as it uses the same config and utils.

The MRL SDK offers helper functions that provide a very simple interface to execute transfers from parachains or contract calls from EVM chains. In addition, the MRL config package allows any external project to add their information in a standard way, allowing immediate support by the MRL SDK.

Documentation

You can find the documentation at https://moonbeam-foundation.github.io/xcm-sdk/latest/.

Installation

npm i @moonbeam-network/mrl

:warning: You need to have peer dependencies of SDK installed as well.

npm install @polkadot/api @polkadot/util-crypto

Usage

The following sections contain basic examples of how to work with the MRL SDK to build transfer data to transfer an asset from one chain to another and how to submit the transfer. For a detailed overview on how to use it, please refer to the XCM SDK docs.

Build MRL Transfer Data

import { Mrl } from '@moonbeam-network/mrl';

const fromEvm = async () => {
  const transferData = await Mrl()
    .setSource(INSERT_SOURCE_CHAIN)
    .setDestination(INSERT_DESTINATION_CHAIN)
    .setAsset(INSERT_ASSET)
    .setIsAutomatic(INSERT_IF_IS_AUTOMATIC)
    .setAddresses({
      sourceAddress: INSERT_SOURCE_ADDRESS,
      destinationAddress: INSERT_DESTINATION_ADDRESS,
    });
};

fromEvm();

Transfer

...

const hash = await transferData.transfer(INSERT_TRANSFER_AMOUNT, INSERT_IF_IS_AUTOMATIC, { INSERT_SIGNERS });

Examples

  • mrl
git clone git@github.com:moonbeam-foundation/xcm-sdk.git
cd xcm-sdk
pnpm install
cd examples/mrl-simple

# edit index.ts by adding your accounts

pnpm run start

Contributing

First fork the repository and clone it.

git clone git@github.com:YOUR_GITHUB_USERNAME/xcm-sdk.git
pnpm install

Optionally, you can install the pre-commit hook to run the linter and tests before committing:

pnpm lefthook install

Tests

Unit tests

pnpm run test

Acceptance tests

pnpm run test:acc

Release

To create a dev version go to GitHub actions and run publish dev versions workflow.

To create a release version run:

pnpm run changeset

Testing the change in the SDK locally

Build the project:

pnpm run build

Link the SDK:

pnpm run clean && pnpm run build && pnpm run link

In your project where you would like to test the changes:

pnpm link @moonbeam-network/xcm-types @moonbeam-network/xcm-utils @moonbeam-network/xcm-builder @moonbeam-network/xcm-config @moonbeam-network/xcm-sdk @moonbeam-network/mrl

If you need you can link other packages too.

After testing is done, unlink the SDK:

pnpm unlink @moonbeam-network/xcm-types @moonbeam-network/xcm-utils @moonbeam-network/xcm-builder @moonbeam-network/xcm-config @moonbeam-network/xcm-sdk @moonbeam-network/mrl

Keywords

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