Confirm Route

Confirm the desired route by the user and pass user's wallets for executing the route

Confirm Route API

After presenting the best route or all possible routes to the user, and once the user confirms the swap via one of the routes, you need to call this method using the user's selected wallets and the request ID of the chosen route. This will inform Rango that the user has confirmed this route and initiate the swap execution. You can also pass the destination field to set a custom destination for the final output, which can be different from the selected wallets.

const confimedRoute = await rango.confirmRoute({
    requestId: "33e0b996-da5e-4922-9fdc-f7206247fc34",
    selectedWallets: {
        "BSC": "0xeae6d42093eae057e770010ffd6f4445f7956613",
        "AVAX_CCHAIN": "0xeae6d42093eae057e770010ffd6f4445f7956613",
    },
    destination: "0x6f33bb1763eebead07cf8815a62fcd7b30311fa3",
})
Route Confirmation Swagger

Confirm Route Request

  • requestId * String

    • Description: The unique ID for the selected route. (In the response of best route or best routes endpoints.)

  • selectedWallets * Object

    • Description: The list of user's selected wallets for this swap. For a multi-step swap, we need to have wallet address of every blockchain in the route. (Blockchain to wallet address map)

  • destination String

    • Description: Custom wallet address destination for the final output of the route. (If you want to set a wallet address different than selected wallet addresses)

Confirm Route Response

  • ok

    • Description: If true, route confirmation was successful and error message is null.

  • result

    • Description: The updated route.

  • error

    • Description: Error occurred during confirming the route.

  • errorCode

    • Description: Error code shows the type of error.

  • traceId

    • Description: Trace Id helps Rango support team to trace the issue.

Last updated