1
Monitor the source chain
Subscribe to
TokenCommitted events to detect any commitments made to your address.2
3
Verify the commitment lock
- Monitor the source chain for the
TokenLockAddedevent (orgetDetails()function) on the existing commitment. - Once detected, verify that the
hashlockmatches the one you previously generated. - Verify that the
timelockprovides sufficient time to act, ensuring it is at least . - Verify that the
Idis equal to the original commitment Id in theTokenCommittedevent.
4
(signature flow) addLockSig — only when user chose signature flow
Only applicable if the user explicitly chose the signature flow (see dApp implementation). In that case the user will provide a signed addLock message. The solver (or any authorized submitter) may call
addLockSig() providing the user’s signature and the signed message data (Id, hashlock, timelock) to finalize the lock on behalf of the user.If the user did not choose the signature flow (i.e., they will call addLock() on-chain themselves), the solver MUST NOT call addLockSig().4
Complete the exchange
- Once verified, call
redeem()on both the source and destination chains. - Pass in the previously generated
Svalue.