0.1.37 • Published 9 months ago

@foxone/mvm v0.1.37

Weekly downloads
-
License
GPL 3.0
Repository
-
Last release
9 months ago

Tools for Mixin Virtual Machine

Provider a tool for MVM connection, get assets, withdarw...

Usage

install from npm

yarn add @foxone/mvm

connect to MVM via metamask or walletconnect

import MVM from "@foxone/mvm";

const mvm = new MVM({
  infuraId: "..."
});

await mvm.connect("metamask");
// await mvm.connect("walletconnect")

after connected to MVM, interaction is avaliable.

withdraw to mixin:

// typeof payload
export interface WithdrawPayload {
  asset_id: string;
  amount: string | number;
  action: WithdrawAction;
}

export interface WithdrawAction {
  receivers: string[];
  threshold?: number;
  extra: string;
}

const payload: WithdrawPayload = "...";

mvm.withdraw(payload);

get asset balance:

// same struct as https://api.mixin.one/asset/:id
const asset = await mvm.getAsset("...asset id");

get wallet assets:

// same struct as https://api.mixin.one/assets
const assets = await mvm.getAssets();

get auth token:

// jwt token for https://api.mixin.one/me
const token = await mvm.getAuthToken();
0.1.35

10 months ago

0.1.36

9 months ago

0.1.37

9 months ago

0.1.34

11 months ago

0.1.32

1 year ago

0.1.33

1 year ago

0.1.31

1 year ago

0.1.30

1 year ago

0.1.29

1 year ago

0.1.26

2 years ago

0.1.27

1 year ago

0.1.20

2 years ago

0.1.22

2 years ago

0.1.23

2 years ago

0.1.24

2 years ago

0.1.25

2 years ago

0.1.19

2 years ago

0.1.18

2 years ago

0.1.17

2 years ago

0.1.16

2 years ago

0.1.15

2 years ago

0.1.14

2 years ago

0.1.13

2 years ago

0.1.12

2 years ago

0.1.11

2 years ago

0.1.10

2 years ago

0.1.9

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago