0xSplits / splits-sdk

An SDK for building apps on top of 0xSplits
https://docs.splits.org/sdk
MIT License
31 stars 11 forks source link

Issue with updateSplit() #7

Closed simonmullaney closed 1 year ago

simonmullaney commented 1 year ago

I am trying to update a split with the SDK. I am getting the below error which doesn't make much sense to me as the controller and signer are the same address?

InvalidAuthError: Action only available to the split controller. Split id: 0x25717De030A65dDE008d92D871645559FF4Cd7cf, split controller: 0x7E7C1a060215955fde8d98D8701b108C90504bf7, signer: 0x7e7c1a060215955fde8d98d8701b108c90504bf7

Code:

const updateArgs = {
    splitId: splitId,
    recipients: recipients,
    distributorFeePercent: 2.0000
    }

  console.log(updateArgs);

  const response = await splitsClient.updateSplit(updateArgs)

updateArgs:

  {
  splitId: '0x25717De030A65dDE008d92D871645559FF4Cd7cf',
  recipients: [
    {
      address: '0x0029669C9451B353E3826384cB794d89E365Df80',
      percentAllocation: 50
    },
    {
      address: '0x002b06DC88FAA2055DF5F2caB18eEeB885641E0A',
      percentAllocation: 50
    }
  ],
  distributorFeePercent: 2
}
mihoward21 commented 1 year ago

hmm, looks like one of the addresses is all lowercase and the other is not. not sure exactly why they're being formatted differently, but should be a simple fix. will get that out soon.

mihoward21 commented 1 year ago

ok @simonmullaney if you download the latest version (2.13.1) this should be fixed.

simonmullaney commented 1 year ago

Done, thanks @mihoward21