Rescanning swaps

The SDK continuously monitors any ongoing swap transactions until they are either completed or refunded. Once one of these outcomes occurs, the SDK ceases its monitoring activities, and users are advised against sending additional funds to the swap address.

However, if users inadvertently send additional funds to a swap address that was already used, the SDK won't automatically recognize it. In such cases, the SDK provides an option to manually scan the used swap addressed to identify additional transactions. This action allows the address to be included in the list eligible for refunds, enabling the initiation of a refund process. For the purpose of rescanning all historical swap addresses and updating their on-chain status, the following code can be used:

Rust
sdk.rescan_onchain_swaps().await?;
Swift
try? sdk.rescanOnchainSwaps()
Kotlin
try {
    sdk.rescanOnchainSwaps()
} catch (e: Exception) {
    // handle error
}
React Native
try {
  await rescanOnchainSwaps()
} catch (err) {
  console.error(err)
}
Dart
await breezSDKLiquid.instance!.rescanOnchainSwaps();
Python
try:
    sdk.rescan_onchain_swaps()
except Exception as error:
    logging.error(error)
    raise
Go
if err := sdk.RescanOnchainSwaps(); err == nil {
    log.Println("Rescan finished")
}
C#
try
{
    sdk.RescanOnchainSwaps();
}
catch (Exception)
{
    // Handle error
}