@tokenup/web3kit
TypeScript icon, indicating that this package has built-in type declarations

1.1.2 • Public • Published

@tokenup/web3kit

Introduction

@tokenup/web3kit is an interface layer that communicates with TokenUp. By integrating @tokenup/web3kit, web2 and web3 developers can easily use multi-chain wallets.

Usage

import { Web3Kit, ChainType } from "@tokenup/web3kit";

// Web3Kit uses a singleton, multiple instances of new Web3Kit() will not cause memory consumption

// Example of getting user balance
function example() {
  const web3Kit = new Web3Kit();
  web3Kit.request({
    chainType: ChainType.SOL,
    methodName: "connect",
  });
}

// Send Connect And SignMessage
function multiple() {
  const web3Kit = new Web3Kit();
  const response = await web3Kit.multipleRequest({
    chainType: ChainType.SOL,
    events: [
      {
        methodName: "connect",
      },
      {
        methodName: "signMessage",
        params: {
          message: "", // base58
          display: "utf8",
        },
      },
    ],
  });
}

Readme

Keywords

none

Package Sidebar

Install

npm i @tokenup/web3kit

Weekly Downloads

209

Version

1.1.2

License

none

Unpacked Size

4.01 MB

Total Files

32

Last publish

Collaborators

  • xonenpm