Transaction Finality

PolkadotJS API provides signAndSend function to send a transaction, the callback will yield information around the transaction pool status as well as any events when isInBlock or isFinalized. If you receive the isFinalized event, then your transaction is considered as finality and will never be reverted.

Sample Code

const API = require("@polkadot/api");
async function sendCLV(address, amount) {
const wsProvider = new API.WsProvider('wss://');
const api = await API.ApiPromise.create({
provider: wsProvider,
types: {
Amount: 'i128',
Keys: 'SessionKeys4',
AmountOf: 'Amount',
Balance: 'u128',
Rate: 'FixedU128',
Ratio: 'FixedU128',
EcdsaSignature: '[u8; 65]',
EvmAddress: 'H160',
EthereumTxHash: 'H256'
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)
.signAndSend(signer, {
}, ({ 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 });