safe-global / safe-core-sdk

The Safe{Core} SDK allows builders to add account abstraction functionality into their apps.

Home Page:https://docs.safe.global/sdk/overview

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[4337] Add compatibility to convert API received Operations

dasanra opened this issue · comments

Context / issue

In the protocol-kit, those methods which make sense that receive a transaction from the API can receive either the SDK object or the API object (signTransaction, executeTransaction...) and they detect the type of object converting internally to something they can use. We are not doing this kind of conversion in the 4337 kit, which makes it unconvenient to use.

Proposed solution

Allow the sign and execute methods in Safe4337Pack to receive either the SDK object or the API object. If it's the API response, it should be able to convert to an object which is able to use.

We should also make sure that the SDK returned object is already compatible with the API consumed object.