mobius-js
a javascript lib that is used to interact with mobius protocol
Setup
npm install mobius-js
Init
import {mobius as Mobius} from "../src";
(async () => {
await mobius.init('JsonRpc', {url: 'http://localhost:8545/', privateKey: ''}, { gasPrice: 0, maxFeePerGas: 0, maxPriorityFeePerGas: 0, chainId: 1 });
await mobius.init('JsonRpc', {}, { chainId: 1 });
mobius.init("Infura", { network: "homestead", apiKey: <INFURA_KEY> }, { chainId: 1 });
mobius.init('Web3', { externalProvider: <WEB3_PROVIDER> }, { chainId: 1 });
})()
Note 1. chainId
parameter is optional, but you must specify it in the case you use Metamask on localhost network, because Metamask has that bug
Note 2. Web3 init requires the address. Therefore, it can be initialized only after receiving the address.