Releases: 0xSplits/splits-sdk
v5.0.0
v4 --> v5 Migration Guide
What's Changed
- A new version of the Split contracts (v2.1) have been launched, including new factories. No changes are needed to start using the new contracts. Calling SplitV2Client.createSplit(args) will now create a v2.1 Split instead of a v2 Split. The only difference in the contracts are that the v2 Split could not properly handle non-compliant ERC20 tokens (e.g. USDT on mainnet). The v2.1 Split can handle those tokens. The other functions (i.e. distribute) will also work with no changes, and they will work for both v2 Splits and v2.1 Splits. For more information see here.
- Splits Kit v1 has launched. It is a wrapper around the Splits React SDK, providing easy React components to plug into your application. It currently supports a CreateSplit component and a DisplaySplit component. Documentation is here, you can see the components being used at Splits Lite which is a publicly available repo.
- Dropped support for viem v1. All three packages (splits-sdk, splits-sdk-react, and splits-kit) require viem v2.
Breaking Changes
- Need to upgrade to viem v2 if you are using v1. See here.
- All data hooks in the react sdk now have the same return values:
isLoading
,data
,status
,error
. The hooks that were specifically changed:useSplitMetadataViaProvider
,useSplitMetadata
,useSplitEarnings
,useContractEarnings
,useLiquidSplitMetadata
,useSwapperMetadata
,useUserEarnings
,useUserEarningsByContract
,useVestingMetadata
,useWaterfallMetadata
. - All data hooks should just take in the required args, and then an optional options dictionary. Any optional args now go into that dictionary. The updated hooks:
useSplitEarnings
,useContractEarnings
. - Added
_
to the start of all the submit functions. They are not meant to be called directly, so added an underscore to make that more clear.
Full Changelog: https://github.com/0xSplits/splits-sdk/compare/@0xsplits/[email protected]...@0xsplits/[email protected]
v4.1.1
What's Changed
- fix ownership calculation by @mihoward21 in #60
Full Changelog: https://github.com/0xSplits/splits-sdk/commits/@0xsplits/[email protected]
v4.0.5
What's Changed
- Balance fix by @mihoward21 in #54
Full Changelog: https://github.com/0xSplits/splits-sdk/commits/@0xsplits/[email protected]
v4.0.4
What's Changed
- Fix earnings by @mihoward21 in #52
Full Changelog: https://github.com/0xSplits/splits-sdk/commits/@0xsplits/[email protected]
@0xsplits/[email protected]
What's Changed
- PE-2201 optional public client arg on get earnings by @mihoward21 in #51
Full Changelog: https://github.com/0xSplits/splits-sdk/commits/@0xsplits/[email protected]
@0xsplits/[email protected]
What's Changed
- fix: v1/v2 viem support for split v1 by @r0ohafza in #48
- Fix split v2 arbitrary allocations by @r0ohafza in #49
Full Changelog: https://github.com/0xSplits/splits-sdk/compare/@0xsplits/[email protected]...@0xsplits/[email protected]
v4.0.0
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:
- 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.
- The formatted earnings functions/hooks have been removed. If you were using any of the formatted functions/hooks before (e.g.
getFormattedSplitEarnings
oruseFormattedUserEarnings
), you can just use the regular version now (e.g.getSplitEarnings
oruseUserEarnings
) 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
}
- 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
orimport { SplitV1Client } from '@0xsplits/splits-sdk'
- 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.
- 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:
- 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.
- Blast network is now supported
- The SDK now supports either Viem v1 or Viem v2.
v3.3.2
What's Changed
Full Changelog: https://github.com/0xSplits/splits-sdk/compare/@0xsplits/[email protected]...@0xsplits/[email protected]
v3.3.1
What's Changed
- Update zora & zora sepolia subgraph urls
Full Changelog: https://github.com/0xSplits/splits-sdk/commits/@0xsplits/[email protected]
v3.3.0
What's Changed
- Increased chain support by @mihoward21 in #27
Full Changelog: https://github.com/0xSplits/splits-sdk/commits/@0xsplits/[email protected]