This guide aims to be a reference of the major changes between v1 and v2 to help those migrating an existing app.
Now it won't be necessary to specify a txServiceUrl
in those environments where Safe has a Transaction Service running, specifiying the chain ID will be enough. If you want to use your custom service or use the kit in a chain not supported by a Safe Transaction Service, you can add txServiceUrl
parameter.
// old:
constructor({ txServiceUrl, ethAdapter }: SafeApiKitConfig)
// new:
constructor({ chainId, txServiceUrl? }: SafeApiKitConfig)
API Kit v1 forced the use of a custom service hosted under /api
route of the URL specified in txServiceUrl
. This is not the case anymore, you can specify any route you prefer or subdomain.
To avoid confusion between terms that have been used as synonyms we aligned all our code to use the word singleton
.
- Rename type
MasterCopyResponse
toSafeSingletonResponse
- Rename method
getServiceMasterCopiesInfo()
togetServiceSingletonsInfo()