@hwallet/web3kit
v1.0.5
Published
## Introduction
Readme
@hwallet/web3kit
Introduction
@hwallet/web3kit is an interface layer that communicates with HWallet. By integrating @hwallet/web3kit, web2 and web3 developers can easily use multi-chain wallets.
Usage
import { Web3Kit, ChainType } from "@hwallet/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.HC,
methodName: "connect",
});
}
// Send Connect And SignMessage
function multiple() {
const web3Kit = new Web3Kit();
const response = await web3Kit.multipleRequest({
chainType: ChainType.HC,
events: [
{
methodName: "connect",
},
{
methodName: "signMessage",
params: {
message: "", // base58
display: "utf8",
},
},
],
});
}