The @matic.js client library makes it easy for developers, who may not be deeply familiar with smart contract development, to interact with the various components of Matic Network.

Quick Setup

Install the maticjs package via npm:

$ npm install --save @maticnetwork/maticjs

Bridge

A bridge is basically a set of contracts that help in moving assets from the root chain to the child chain and vice versa.

There are primarily two bridges to move assets between Ethereum and Matic.

  1. POS
  2. Plasma

You can read more about Bridge here

Matic.js provides you respective client to use these bridges

Plasma Bridge

const MaticPlasmaClient = require('@maticnetwork/maticjs')

Now using MaticPlasmaClient we can do transaction on plasma bridge. The client contains different apis to help you with the transaction. These API are covered in Plasma API.

POS Bridge

const { MaticPoSClient } = require('@maticnetwork/maticjs')

Now using MaticPoSClient we can do transaction on POS bridge. The client contains different apis to help you with the transaction. These API are covered in POS API.