Skip to main content

Know Your Cross-chain Status


The cross-chain status is known by listening to events on the chain, and there are two events related to the cross-chain:

  • MessageAccepted event of source chain

    When the cross-chain transaction is sent successfully on the source chain, the "MessageAccepted" event will be emitted.

  • MessageDispatched event of target chain

    When the task carried by the cross-chain message is executed on the target chain, the "MessageDispatched" event will be emitted.

  • MessageDelivered event of source chain

    When the cross-chain message is confirmed on the source chain, the "MessageDelivered" event will be emitted.

View events in Subscan

The cross-chain status can be viewed in




Replace "CHAIN_NAME" with the real chain name.

Track events with Darwinia.js

// Initialise the provider to connect to the local node
const provider = new WsProvider('ws://');

// Create the API and wait until ready
const api = await ApiPromise.create({ provider, typesBundle: typesBundleForPolkadotApps});
await api.isReady;

// Subscribe to system events via storage => {
console.log(`\nReceived ${events.length} events:`);

// Loop through the Vec<EventRecord>
events.forEach((record) => {
// Extract the phase, event and the event types
const { event, phase } = record;
const types = event.typeDef;

// Show what we are busy with
console.log(`\t${event.section}:${event.method}:: (phase=${phase.toString()})`);

// Loop through each of the parameters, displaying the type and data, index) => {
console.log(`\t\t\t${types[index].type}: ${data.toString()}`);

Query transaction status

async function main () {

const wsProvider = new WsProvider(dw);
// const address = "5DCqw8chJYP78V7KPXLr1HCf9TX9ixnorRiXJFdwqiyy2KPV"

const blockHash = "0xd337332b5260eef96f9029ec6ddc0696e33f0d7076da5860a0d594c4ebddf898"

ApiPromise.create({ provider: wsProvider, typesBundle: darwiniaTypesBundle })
.then( async (api) => {
const apiAt = await;
let allRecords = await
let signedBlock = await api.rpc.chain.getBlock(blockHash);

signedBlock.block.extrinsics.forEach(({ method: { method, section } }, index) => {
// filter the specific events based on the phase and then the
// index of our extrinsic in the block
const events = allRecords
.filter(({ phase }) =>
phase.isApplyExtrinsic &&
// show message events
console.log(`each event ${event.method} ${event.section} ${}`)
if ( {

const [dispatchInfo] =;
console.log(`${section}.${method}:: ExtrinsicSuccess:: ${JSON.stringify(dispatchInfo.toHuman())}`);
}else if ( {
// extract the data for this event
const [dispatchError, dispatchInfo] =;
let errorInfo;

// decode the error
if (dispatchError.isModule) {

const decoded = api.registry.findMetaError(dispatchError.asModule);

errorInfo = `${decoded.section}.${}`;
} else {

errorInfo = dispatchError.toString();

console.log(`${section}.${method}:: ExtrinsicFailed:: ${errorInfo}`);


}).catch((err) => {