⌘K

Icon SunFilledIcon MoonStars
Getting a Message Proof

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.waitForResult();
 
// 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(recipient, AMOUNT, BaseAssetId, {
	gasPrice,
	gasLimit: 10_000,
});
const nextBlock = await resp.waitForResult();
 
const messageOutReceipt = <TransactionResultMessageOutReceipt>result.receipts[0];
const messageProof = await provider.getMessageProof(
	result.gqlTransaction.id,
	messageOutReceipt.nonce,
	nextBlock.blockId
);