Prerequisites
Before you begin, ensure you have:- A Web3 wallet such as MetaMask connected to Kwala
- Sufficient Kwala credits in your account
- Basic understanding of bridge mechanics and cross-chain transactions
- Multi-chain wallet setup for the networks you want to monitor
- Bridge contract addresses for the protocols you’re monitoring
Use cases
This template is ideal for the following scenarios:- Tracking bridge transactions: Monitor your cross-chain transfers and get notified when they complete on the destination chain.
- Portfolio management: Track bridge transactions across multiple protocols and chains for comprehensive asset monitoring
- Security monitoring: Get alerted to bridge events that might indicate suspicious activity or require immediate attention
- Transaction logging: Maintain a detailed log of all bridge transactions for accounting and compliance purposes
- Failure notifications: Receive instant alerts when bridge transactions fail or encounter issues
- Multi-protocol monitoring: Track transactions across different bridge protocols
Step 1: Access the template
- Navigate to the Kwala dashboard and select My workflows
- Select Templates from the navigation menu
- Find and select Multi-Chain Bridge Monitor
- Select View Details to open the template
Step 2: Provide a workflow name
In the template overview, select Deploy Template or Edit Template to open it in the Workflow Editor. On the YAML editor, give your workflow a descriptive name:Step 3: Configure triggers
The template is pre-configured with event-based triggers that you can customize: Execute after Set toevent to trigger when a transaction event occurs:
event to repeat every time the event occurs:
Update the
TriggerChainID, TriggerSourceContract, and TriggerEventName to match the specific bridge or cross-chain contract you want to monitor. Common chains: Ethereum (1), Polygon (137), BSC (56), Arbitrum (42161).- Uploading your contract
.solfile in the Workflow Builder - Pasting the contract ABI directly
NA if no filtering is needed:
Step 4: Configure recurring triggers
For repeated execution, configure the recurring source to monitor events continuously:NA if no additional metadata is needed:
The recurring trigger monitors the same contract for continuous event tracking. You can modify
RecurringChainID and RecurringSourceContract to monitor a different chain or contract for cross-chain scenarios.Step 5: Configure notification actions
The template includes two actions that you can customize: Action 1: Transfer notification This action sends an alert when a transfer event is detected:APIEndpoint: Replace with your webhook URL (Discord, Telegram, Slack, or custom endpoint)APIPayload.message: Customize the notification messageAPIPayload.token: Specify the token being monitoredAPIPayload.threshold: Set the notification threshold valueRetriesUntilSuccess: Number of retry attempts if the notification fails
- name: “Source Chain” value: “Ethereum”
- name: “Destination Chain” value: “Polygon”
- name: “Token” value: “USDC”
- name: “Status” value: “Pending” color: 3447003 RetriesUntilSuccess: 5
APIEndpoint: Replace with your logging service URL or database APIAPIPayload.TargetContract: The contract address being monitoredAPIPayload.chainId: The chain ID where the transaction occurredRetriesUntilSuccess: Number of retry attempts if logging fails
Step 6: Set execution mode
The template uses sequential execution, ensuring actions execute in order:parallel if you want actions to run simultaneously:
Sequential execution ensures notifications are sent before logging occurs, providing a logical flow for monitoring. Use parallel mode if you want faster execution and the order doesn’t matter.
Step 7: Add notification settings (optional)
Configure status notifications to receive updates about workflow execution:Add more actions
You can extend the template to include additional actions like multiple notifications or database logging: Example: Telegram notificationStep 8: Compile and validate
Before deploying, compile and validate your workflow configuration to ensure there are no syntax errors or configuration issues.- Click the Validate button in the workflow editor
- Review any errors or warnings that appear
- Make necessary corrections to your YAML configuration
- Re-validate until all checks pass
Step 9: Deploy and activate
Once your workflow is validated, save and deploy it to start monitoring bridge transactions.- Click Save to store your workflow configuration
- Review the deployment details and gas estimation
- Approve the transaction in your connected wallet
- Click Deploy to publish your workflow to the network
- Click Activate to start monitoring bridge events
Complete workflow example
Here’s the full YAML configuration for the Multi-Chain Bridge Monitor workflow:How it works
The Multi-Chain Bridge Monitor workflow uses an event-based trigger system to monitor bridge transactions across multiple blockchain networks. When a bridge event is detected on the source chain (defined inTriggerChainID and TriggerSourceContract), the workflow executes immediately. The recurring trigger monitors for completion or related events on the same or different chains, allowing you to track the full lifecycle of cross-chain transactions.
Actions execute sequentially to ensure notifications are sent before transaction data is logged. The workflow includes built-in retry logic (RetriesUntilSuccess: 2) to help handle issues such as temporary network failure or API downtime. You can customize the notification payloads to include specific transaction details, user addresses, token amounts, or any other event data captured from the blockchain.
