diff --git a/safe-core-sdk/api-kit/migrating/v2.md b/safe-core-sdk/api-kit/migrating/v2.md new file mode 100644 index 00000000..ca32cecd --- /dev/null +++ b/safe-core-sdk/api-kit/migrating/v2.md @@ -0,0 +1,26 @@ +# 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. + +```js +// 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()` \ No newline at end of file diff --git a/safe-core-sdk/protocol-kit/migrating/v2.md b/safe-core-sdk/protocol-kit/migrating/v2.md new file mode 100644 index 00000000..25d53192 --- /dev/null +++ b/safe-core-sdk/protocol-kit/migrating/v2.md @@ -0,0 +1,48 @@ +# Protocol 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. + +## 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 `isL1SafeMasterCopy` to `isL1SafeSingleton` +```js +// old: +SafeFactory.create({ ethAdapter, isL1SafeMasterCopy: true }) + +// new: +SafeFactory.create({ ethAdapter, isL1SafeSingleton: true }) +``` + +## Ethers v6 + +From protocolKit v2, EthersAdapter will only be compatible with ethers.js v6. If you still need to use v5 we recommend you to keep protocolKit v1, but encourage you to migrate to the latest version when you have the chance. + +## Protocol Kit createTransaction() accepts only transaction array + +In protocolKit v1 the `createTranasction()` method accepted either an object or an array as parameter. To avoid confusion we aligned to accept an array only. Migration can be done as the code below: + +```js +// 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 }) +``` \ No newline at end of file diff --git a/safe-core-sdk/relay-kit/migrating/v2.md b/safe-core-sdk/relay-kit/migrating/v2.md new file mode 100644 index 00000000..ee707f54 --- /dev/null +++ b/safe-core-sdk/relay-kit/migrating/v2.md @@ -0,0 +1,15 @@ +# Relay 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. + +## GelatoRelayPack + +- The `GelatoRelayPack` constructor now includes a mandatory `protocolKit` parameter as we made it required for any new pack extending the `RelayKitBasePack` + +```js +constructor({ apiKey, protocolKit }: GelatoOptions) +``` + +- We removed the `protocolKit` parameter from `createTransactionWithHandlePayment()`, `createTransactionWithTransfer()` and `executeRelayTransaction()` methods in the `GelatoRelayPack` as we now it's included in the constructor. + +- Removed the type `export interface RelayPack` as we use now an abstract class. \ No newline at end of file