multi-transfer
v1.0.6
Published
Batch estimate account balances to the one address
Downloads
5
Maintainers
Readme
Install
npm install --save multi-transfer
Usage
Native token multi transfer:
const {Mt} = require("multi-transfer")
var chainUrl = "xxxxxxxxxxxxxxxxxxxxxx"
var chainId = "xxxxxx"
var mt = new Mt(chainUrl, chainId);
var emitName = "test"
var privateKeys = ["xxxxxxxxxxxxxxxxxxxxxx"]
var receiveAddress = "xxxxxxxxxxxxxxxxxxxxx"
var transferAmount = 0
mt.emitter.on(emitName, function (arg) {
console.log("arg", arg)
})
mt.multiCollection(emitName, privateKeys, receiveAddress, transferAmount,"",{
transferCount:10,
gasLimit:"xxxxxxx",
gasPrice:"xxxxxxx"
})
ERC20 token multi transfer:
const {Mt} = require("multi-transfer")
var chainUrl = "xxxxxxxxxxxxxxxxxxxxxx"
var chainId = "xxxxxx"
var mt = new Mt(chainUrl, chainId);
var emitName = "test"
var privateKeys = ["xxxxxxxxxxxxxxxxxxxxxx"]
var receiveAddress = "xxxxxxxxxxxxxxxxxxxxx"
var transferAmount = 0
var tokenAddress = "xxxxxxxxxxxxxxxxxxxx"
mt.emitter.on(emitName, function (arg) {
console.log("arg", arg)
})
mt.multiCollection(emitName,privateKeys, receiveAddress, transferAmount, tokenAddress,{
transferCount:10,
gasLimit:"xxxxxxx",
gasPrice:"xxxxxxx"
})
Note
If you want to get the callback data,you must enable listening for events before calling the method.This library uses the ethers library to interact with the chain, please pass in the RPC url and chain id when instantiating.