Q & A

About Mnemonic

A mnemonic can derive multiple private keys, one for each address.Refer to hdwallet

Notice

  1. Keep your mnemonics carefully
  2. Don't transfer to an unknown address

About quota

Sending transaction needs quota, which can be obtained through PoW or pledge Vite. Refer to quota

About Mintage

Client provides mintage function. Refer to client/builtinTxBlock/Mintage

Gvite-RPC Mintage

About Subscription

Client extends netProcessor, providers subscription Refer to client/subscription

About Account Instances under wallet

Wallet module is mainly used to quickly generate a wallet.

About Send Transaction

Refer to account and hdAccount

  1. You can generate an hdAccount instance through your mnemonic. Refer to more instances
import WS_RPC from '@vite/vitejs-ws';
import { client, hdAccount } from '@vite/vitejs';
let myClient = new client( new WS_RPC("ws://example.com") );
let myHdAccount = new hdAccount({ 
    client: myClient,
    mnemonic: 'your mnemonic'
});
  1. Get the account instance of address through the hdAccount instance. For example, get an account instance of 0'address under the mnemonic.
const firstAccount = myHdAccount.getAccount({
    index: 0
});
  1. Send transactions through the account instance.
firstAccount.sendTx({
    toAddress: 'Your toAddress',
    amount: '10000000000000000000',    // 10Vite + 18个0
    tokenId: Vite_TokenId
}).then((accountBlock) => {
    console.log(accountBlock);
}).catch((err) => {
    console.log(err);
});