Skip to content

v3.0.0

Compare
Choose a tag to compare
@mihoward21 mihoward21 released this 25 Oct 21:44
· 174 commits to main since this release

Major release, migrated from Ethers-v5 to Viem under the hood. The majority of the SDK remained untouched, notable changes are highlighted below. They are mostly related to the Viem upgrade, with a few formatting updates as well.

Documentation for the new SDK version using viem can be found here, and documentation for the old version using ethers can be found here

MIGRATION GUIDE:
Ethers --> Viem:
Followed the Viem guide for migration: https://viem.sh/docs/ethers-migration.html

In the SplitsClientConfig:

  • provider has been updated to publicClient
  • signer has been updated to walletClient. An account must be attached to the walletClient when it is passed in in order to perform any contract transactions.
  • ensProvider has been updated to ensPublicClient

All event and events that are returned from a contract transaction are now of type Log from viem instead of type Event from ethers.

All BigNumber values have been converted to BigInt.

Formatting Updates:
All id's have been converted to address. For example, any input our output named splitId is now named splitAddress.

All output recipients now use an object typed as so: { address: string; ensName?: string }. For example, the getSplitMetadata function now returns an object of the following format:

type Split = {
  type: 'Split'
  address: Address
  controller: {
    address: string
    ensName?: string
  } | null
  newPotentialController:{
    address: string
    ensName?: string
  } | null
  distributorFeePercent: number
  recipients: {
    percentAllocation: number
    recipient: {
      address: string
      ensName?: string
    }
  }[]
  createdBlock: number
}