Integrate MTO Metamask driver into web applications
Integrating the mto-metamask-driver is very simple.
You will need at least node
version 14 installed in your system.
Installation
To obtain the latest version, simply require the project using npm
or yarn
:
npm i mto-metamask-driver
or
yarn add mto-metamask-driver
How to use metamask SDK in nodejs based app (goerli testnet)
import { MTOMetamaskDriver } from "mto-metamask-driver"; // TODO check import types issue
const MTO_BLOCKCHAIN = 'goerli-testnet';
const scDriver = new MTOMetamaskDriver({
blockchain: MTO_BLOCKCHAIN,
});
await scDriver.init();
// get wallet balance
const balance = await scDriver.getTokenBalance();
// participate agents
const participate = await scDriver.participate();
Updated almost 2 years ago