You can listen to bridge events that are emitted throughout the transfer lifecycle for each provider installed into the kit. Events for the built-in CCTP provider follow its transaction steps. You can subscribe to each event multiple times with different callbacks.
This section lists the CCTP event types to which you can subscribe.
Emitted when the transaction is approved. This happens when the transaction signer has approved the transfer amount.
kit.on("approve", (payload) => {
console.log("Approval completed:", payload.values.txHash);
});
Emitted when tokens are burned on the source chain.
kit.on("burn", (payload) => {
console.log("Burn completed:", payload.values.txHash);
});
Emitted when the kit receives the attestation, which serves as proof of the burn.
kit.on("fetchAttestation", (payload) => {
console.log("Attestation completed:", payload.values.data.attestation);
});
Emitted when tokens are minted on the destination chain.
kit.on("mint", (payload) => {
console.log("Mint completed:", payload.values.txHash);
});
Listen to all events.
kit.on("*", (payload) => {
console.log("Event received:", payload);
});