const API = require("@polkadot/api");
const cloverTypes = require('@clover-network/node-types');
async function sendCLV(address, amount) {
const wsProvider = new API.WsProvider('wss://api-ivy.clover.finance');
const api = await API.ApiPromise.create({
const nonce = await api.rpc.system.accountNextIndex('your CLV address configured somewhere');
const keyring = new API.Keyring({ type: 'sr25519' });
const signer = keyring.addFromUri('your seeds configured somewhere');
return new Promise( (resolve, reject) => {
.transfer(address, amount)
}, ({ events = [], status }) => {
if (status.isFinalized) {
// filter events and check balances.transfer is succeed
resolve({ success: true });
if (status.isDropped || status.isInvalid || status.isUsurped) {
resolve({ success: false });