Skip to content

v4.0.0

Choose a tag to compare

This major release marks the introduction of splits v2, for more information on v2 itself please refer to this article. This release has multiple breaking changes across our core SDK and React SDK.

With this release we have made a departure from the hosted service provided by The Graph and moved to an in house graphQL service. All previous versions of the SDK will become partially functional following the sunset of the hosted service by The Graph.

The new API for the SDK (Core and React) can be found in our docs.

The breaking changes from 3.x.x to 4.x.x are:

  1. viem has moved to a peer dependency. You will need to have it installed alongside the splits sdk, the sdk will no longer install it for you.
  2. The formatted earnings functions/hooks have been removed. If you were using any of the formatted functions/hooks before (e.g. getFormattedSplitEarnings or useFormattedUserEarnings), you can just use the regular version now (e.g. getSplitEarnings or useUserEarnings) and you'll receive back the same data. If you are using any of the regular earnings functions, the returned data will now be in a new format. That means instead of getting just the raw value as a bigint, you'll now receive a dictionary of the form:
{
  rawAmount: bigint
  symbol: string
  decimals: number
  formattedAmount: string
}
  1. The main SplitsClient no longer has any functionality directly tied to it. You'll need to access the appropriate client to perform any functions. If you want access to the Splits V1 functions, you can use (new SplitsClient(...)).splitV1 or import { SplitV1Client } from '@0xsplits/splits-sdk'
  2. All data fetching from the new subgraph runs through the DataClient now. Any fetching of metadata or earnings will be done off of that client.
  3. Supported networks in 4.0.0 are: [Mainnet, Polygon, Optimism, Base, Zora, Arbitrum, BSC, xDAI, Blast, Sepolia, Holesky, Zora Sepolia, Base Sepolia, Optimism Sepolia].

Some changes to highlight in 4.0.0 that are not breaking changes:

  1. Splits v2 support! The SplitV2Client and WarehouseClient have all the functionality needed to interact with the new Splits v2 contracts. Checkout the blog post for more details.
  2. Blast network is now supported
  3. The SDK now supports either Viem v1 or Viem v2.