Skip to main content
The One-Time Actions docs are under active development and will be subject to changes.
This code snippet briefly illustrates a few core concepts of @boostxyz/sdk

Targeting Specific Chains

The Boost SDK allows you to interact with the BoostCore and BoostRegistry contracts across different chains. You can specify which chain you want to target by including a chainId in the params object of your method calls.
Always ensure that the protocol is deployed on the chain you’re targeting. Specifying a chainId for a network where the protocol isn’t deployed could result in degraded UX if, in the browser, the SDK attempts to switch chains to its default network and there’s no supporting chain configuration in your Wagmi/Viem client.
By specifying the chainId in the params, you ensure that the SDK targets the correct contracts for the specific network you are targetting. The SDK uses the following process to determine which chain to interact with:
  1. It first attempts to use the contract address associated with the specified chainId passed in the params.
  2. If no address is found for the given chainId, it falls back to using the address for the connected account’s chain.
  3. If that also fails, it uses the address for the default chain set in the SDK config.