Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Tanay Pant <[email protected]>
  • Loading branch information
dasanra and tanay1337 authored Nov 24, 2023
1 parent de1f687 commit 4505482
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions safe-core-sdk/api-kit/migrating/v2.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# 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.
This guide references 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, providing 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.
It won't be necessary to specify a `txServiceUrl` in environments where Safe has a Transaction Service running. Providing the chain ID will be enough. If you want to use your custom service or the kit in a chain not supported by a Safe Transaction Service, you can add the `txServiceUrl` parameter.

```js
// old:
Expand All @@ -16,9 +16,9 @@ constructor({ chainId, txServiceUrl? }: SafeApiKitConfig)
## Use the route you prefer
API Kit v1 forced that any custom service was hosted under `/api` route of the URL specified in `txServiceUrl`. This isn't the case anymore, you can specify any route you prefer or subdomain.
API Kit v1 forced any custom service to be hosted under the `/api` route of the URL specified in `txServiceUrl`. This isn't the case anymore; you can specify any preferred route or subdomain.
Note that if you use a custom service running under `/api` you will now need to migrate as follow:
Note that if you use a custom service running under `/api`, you will now need to migrate as follows:
```js
// old:
Expand All @@ -32,7 +32,7 @@ constructor({ chainId, txServiceUrl? }: SafeApiKitConfig)
## MasterCopy to Singleton
To avoid confusion between terms that have been used as synonyms we aligned all our code to use the word `singleton`.
To avoid confusion between terms used as synonyms, we aligned all our code to use the word `singleton`.
- Rename type `MasterCopyResponse` to `SafeSingletonResponse`
- Rename method `getServiceMasterCopiesInfo()` to `getServiceSingletonsInfo()`
8 changes: 4 additions & 4 deletions safe-core-sdk/protocol-kit/migrating/v2.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# 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.
This guide references 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`.
To avoid confusion between terms used as synonyms, we aligned all our code to use the word `singleton`.

- Rename `isL1SafeMasterCopy` to `isL1SafeSingleton`
```js
Expand All @@ -17,11 +17,11 @@ 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 we encourage you to migrate to the latest version when you have the chance.
From `protocolKit v2`, EthersAdapter will only be compatible with ethers.js v6. If you still need to use v5, we recommend you keep `protocolKit v1`, but we encourage you to migrate to the latest version when you can.

## 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 only an array. Here is a migration example:
In `protocolKit v1`, the `createTransaction()` method accepted either an object or an array as a parameter. To avoid confusion, we changed it to accept only an array. Here is a migration example:

```js
// old:
Expand Down
6 changes: 3 additions & 3 deletions safe-core-sdk/relay-kit/migrating/v2.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 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.
This guide references the major changes between v1 and v2 to help those migrating an existing app.

## GelatoRelayPack

Expand All @@ -10,6 +10,6 @@ This guide aims to be a reference of the major changes between v1 and v2 to help
constructor({ apiKey, protocolKit }: GelatoOptions)
```

- We removed the `protocolKit` parameter from `createTransactionWithHandlePayment()`, `createTransactionWithTransfer()` and `executeRelayTransaction()` methods in the `GelatoRelayPack` as now it's included in the constructor.
- We removed the `protocolKit` parameter from the `createTransactionWithHandlePayment()`, `createTransactionWithTransfer()`, and `executeRelayTransaction()` methods in the `GelatoRelayPack` as now it's included in the constructor.

- Removed the type `export interface RelayPack` as we use now an abstract class.
- Removed the `export interface RelayPack` type as we now use an abstract class.

0 comments on commit 4505482

Please sign in to comment.