Documentation Index
Fetch the complete documentation index at: https://docs.train.tech/llms.txt
Use this file to discover all available pages before exploring further.
Monitor the source chain
Subscribe to
TokenLocked events to detect any locks made to your address with a hashlock.Verify the lock on source chain
Receive secret from user
The user will sign and transmit the derived secret to you via off-chain channels. Verify that when hashed, this secret matches the hashlock on both chains.
Complete the exchange
- Once you receive the secret, call
redeem()on the destination chain to unlock the user’s funds. You are incentivized to do this quickly because a reward is reserved for whoever completes this transaction. If you delay, another actor can call redeem and claim the reward instead. - Call
redeem()on the source chain to claim your primary fee/reward. - Pass in the secret value received from the user.