Skip to main content
The onSwapIdChange event is called when the swap ID changes — for example, when a new swap is created or reset.
<LayerswapProvider
  callbacks={{
    onSwapIdChange: (swapId) => {
      console.log("Active swap ID:", swapId)
    },
  }}
>
  <Swap />
</LayerswapProvider>

Callback Argument Value

swapId: string