Icon LinkGetting a Message Proof

A message proof is a cryptographic proof that a message was included in a block. You can use the getMessageProof method to retrieve a message proof for a given transaction ID and message ID.

const result = await tx.wait();
 
// Wait for the next block to be minter on out case we are using a local provider
// so we can create a new tx to generate next block
const resp = await sender.transfer(sender.address, AMOUNT, BaseAssetId);
const nextBlock = await resp.wait();
 
const messageOutReceipt = <TransactionResultMessageOutReceipt>result.receipts[0];
const messageProof = await provider.getMessageProof(
	result.gqlTransaction.id,
	messageOutReceipt.messageId,
	nextBlock.blockId
);

Was this page helpful?