sui-helper
v1.1.7
Published
Sui Helper is a library that provides a set of tools for working with the Sui blockchain.
Downloads
21
Readme
Sui Helper
Sui Helper is a library that provides a set of tools for working with the Sui blockchain.
Installation
npm i sui-helper
Usage
import { SuiHelper, SuiNewWork } from'sui-helper';
const suiHelper = new SuiHelper(SuiNewWork.DEVNET); // for devnet
const suiHelper = new SuiHelper(SuiNewWork.TESTNET); // for testnet
const suiHelper = new SuiHelper(SuiNewWork.MAINNET); // for mainnet
build Split tx
const bytes = await suiHelper.buildSplitTx(
address: string,
coinType: string,
coinObjectId: string,
splitNum: number,
everyoneValue: number,
gas: number
);
RPC
getAllBalances
const rs = await suiHelper.getAllBalances(address);
getReferenceGasPrice
const rs = await suiHelper.getReferenceGasPrice();
sendTransaction
const rs = await suiHelper.sendTransaction(bytes, serializedSignature);
getCoins
const rs = await suiHelper.getCoins(address:string, coinType:string, cursor?:string, limit?:number)