Skip to content

weavedb/webmax.js

 
 

Repository files navigation

webmax.js

webmax is intmaxwallet signer library.

Installation

With yarn

yarn add webmax

With npm

npm install webmax

Usage

Add intmaxWalletSigner to your app first.

Get account from intmaxWallet.

Signer can get account from intmaxWallet.

import { IntmaxWalletSigner } from "webmax";

const signer = new IntmaxWalletSigner();
const account = await signer.connectToAccount();

Request switch network

Signer can switch network on intmaxWallet.

import { IntmaxWalletSigner } from "webmax";

const chainId = 1;

const signer = new IntmaxWalletSigner();
const account = await signer.switchChain(chainId);

Sign transaction.

Signer can sign transactions. You will receive a serialized signature.

import { IntmaxWalletSigner } from "webmax";

const tx = {
  to,
  value,
  gasLimit,
};

const signer = new IntmaxWalletSigner();
const serializedSignature = await signer.signTransaction(tx);

Sign and send transaction to network.

Signer can sign and send transactions. You will receive a receipt.

import { IntmaxWalletSigner } from "webmax";

const tx = {
  to,
  value,
  gasLimit,
};

const signer = new IntmaxWalletSigner();
const receipt = await signer.sendTransaction(tx);

Sign message with intmaxWallet signer.

Signer can sign messages. You will receive a signature.

import { IntmaxWalletSigner } from "webmax";

const signer = new IntmaxWalletSigner();
const signature = await signer.signMessage("hello world");

Demo

See the demo on the website:

https://webmaxdemo.netlify.app/

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 93.7%
  • JavaScript 6.3%