Skip to content

Latest commit

 

History

History
26 lines (16 loc) · 1.11 KB

File metadata and controls

26 lines (16 loc) · 1.11 KB

API Kit: Migrating from v1

This guide aims to be a reference of the major changes between v1 and v2 to help those migrating an existing app.

API Kit constructor

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)

Use the route you prefer

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.

MasterCopy to Singleton

To avoid confusion between terms that have been used as synonyms we aligned all our code to use the word singleton.

  • Rename type MasterCopyResponse to SafeSingletonResponse
  • Rename method getServiceMasterCopiesInfo() to getServiceSingletonsInfo()