Skip to content

Safe{Core} A A SDK Release 34

Compare
Choose a tag to compare
@dasanra dasanra released this 27 Nov 15:10
· 130 commits to main since this release
e587f6c

New Versions

  • account-abstraction-kit-poc: v2.0.0
  • api-kit: v2.0.0
  • onramp-kit: v2.0.0
  • protocol-kit: v2.0.0
  • relay-kit: v2.0.0
  • safe-core-sdk-types: v3.0.0

What's Changed

⚠️ Breaking Changes

api-kit

  • SafeApiKit instantiation
// old:
constructor({ txServiceUrl, ethAdapter }: SafeApiKitConfig)

// new:
constructor({ chainId, txServiceUrl? }: SafeApiKitConfig)
  • '/api' is not added to the txServiceUrl prop
  • Rename type MasterCopyResponse to SafeSingletonResponse
  • Rename method getServiceMasterCopiesInfo() to getServiceSingletonsInfo()

protocol-kit

  • Rename isL1SafeMasterCopy to isL1SafeSingleton
// old:
SafeFactory.create({ ethAdapter, isL1SafeMasterCopy: true })

// new:
SafeFactory.create({ ethAdapter, isL1SafeSingleton: true })
  • EthersAdapter now it's only compatible with ethers v6.
  • createTransaction now only accepts array of transactions
// old:
const safeTransactionData = {
  to: '',
 data: '',
 value: '',
  nonce: '',
  safeTxGas: ''
}
const safeTransaction = protocolKit.createTransaction({ safeTransactionData })

// new:
const safeTransactionData = {
  to: '',
 data: '',
 value: ''
}
const options = {
  nonce: '',
  safeTxGas: ''
}
const safeTransaction = protocolKit.createTransaction({ [safeTransactionData], options })

account-abstraction-kit (AccountAbstraction class)

  • The constructor signer is changed to an EthAdapter
//old:
const safeAccountAbstraction = new AccountAbstraction(signer)

// new: 
const ethAdapter = new EthersAdapter({ ethers, signerOrProvider: signer })
const safeAccountAbstraction = new AccountAbstraction(ethAdapter)
  • The init() method now is parameterless and creates a protocolKit instance with the predicted or current safe address
//old:
async init(options: AccountAbstractionConfig)

//new:
async init()
  • We removed the getSignerAddress(), getNonce(), getSafeAddress() and isSafeDeployed() methods as they can be accessed from the new protocolKit property
  • The relayTransaction() method now returns and unknown type instead an string as we don't know what the relayer pack returns on advance. We were currently assuming the Gelato taskId
async relayTransaction(
    transactions: MetaTransactionData[],
    options?: MetaTransactionOptions
  ): Promise<unknown>

relay-kit

  • The GelatoRelayPack constructor now includes a mandatory protocolKit parameter as we made it required for any new pack extending the RelayKitBasePack
constructor({ apiKey, protocolKit }: GelatoOptions)
  • We removed the protocolKit parameter from the createTransactionWithHandlePayment(), createTransactionWithTransfer() and executeRelayTransaction() methods in the GelatoRelayPack as we now include it in the constructor

  • Removed the type export interface RelayPack as we use now an abstract class

New Contributors

Full Changelog: r33...r34