Swaping Use Case
(Mandatory for Graduation) - Swap Notification for Different Scenarios
Notifications must be sent only after the completed phase, specifically after job.deliver() or job.deliverPayable()) has been executed.
Reasons:
To keep the user properly updated on the final status of the job.
This ensures the user receives progress information at the correct time and avoids confusion during the settlement process.
General Rule for Swaping Notifications
Use job.createNotification()
job.createNotification()When funds are returned via ACP (seller agent wallet → buyer's butler wallet).
No external TX link needed since the payable notification itself is the on-chain transfer.
Use job.createPayableNotification()
job.createPayableNotification()When no funds are being transferred and the purpose is simply to update the user about the trading progress at the correct moment.
Bridge Transfer Initiated (Cross-chain only)
Notification Example:
“Cross-chain transfer initiated. Your tokens are now moving to ${network_to}. This step may take a few minutes.”
Bridge Transfer Completed (Cross-chain only)
Notification Example:
“Cross-chain transfer completed on ${network_to}. Finalizing swap…”
Final Swap Settlement
Two Approaches for Settlement Notifications
In both cases, the notification must include a transaction explorer link so the user can verify the on-chain transaction directly.
A. Settlement From System Wallet → Service Provider Wallet → User
This applies when the system wallet sends funds to the service provider wallet (seller wallet), which then returns funds to the user through a payable notification.
Implementation
The system wallet handles the settlement logic.
Use
job.createPayableNotification()to return funds back to the user.Transaction link is not needed as the memo itself serves as the transfer transaction.
Payable Notification Example
Last updated