Events and Monitoring
Global Events
const wayfinder = createWayfinderClient({
routingSettings: {
events: {
onRoutingStarted: (event) => console.log('Routing started:', event),
onRoutingSucceeded: (event) => console.log('Gateway selected:', event),
},
},
verificationSettings: {
events: {
onVerificationProgress: (event) => {
const percentage = (event.processedBytes / event.totalBytes) * 100;
console.log(`Verification: ${percentage.toFixed(2)}%`);
},
onVerificationSucceeded: (event) => console.log('Verified:', event.txId),
},
},
});Request-Specific Events
const response = await wayfinder.request('ar://example', {
verificationSettings: {
events: {
onVerificationProgress: (event) => {
console.log(`This request: ${event.txId}`);
},
},
},
});How is this guide?