Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(api-kit): Update SafeApiKit instantiation #230

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions examples/protocol-kit/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ const ethAdapterOwner1 = new EthersAdapter({
signerOrProvider: owner1Signer
})

const txServiceUrl = 'https://safe-transaction-goerli.safe.global'
const safeService = new SafeApiKit({ txServiceUrl, ethAdapter: ethAdapterOwner1 })
const safeService = new SafeApiKit({ chainId: 5 })
let safeFactory: SafeFactory
let safeSdkOwner1: Safe
let safeAddress: string
Expand Down
3 changes: 1 addition & 2 deletions safe-core-sdk/api-kit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ We need to create an instance of the API Kit.
import SafeApiKit from '@safe-global/api-kit'

const safeApiKit = new SafeApiKit({
txServiceUrl: 'https://safe-transaction-mainnet.safe.global',
ethAdapter
chainId: 1,
})
```

Expand Down
5 changes: 2 additions & 3 deletions safe-core-sdk/protocol-kit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,14 @@ const ethAdapterOwner1 = new EthersAdapter({

### Initialize the API Kit

The [API Kit](https://github.com/safe-global/safe-core-sdk/tree/main/packages/api-kit) consumes the [Safe Transaction Service API](https://github.com/safe-global/safe-transaction-service). To start using this library, create a new instance of the `SafeApiKit` class, imported from `@safe-global/api-kit`, and pass the Safe Transaction Service URL for your desired network to the constructor of the `SafeApiKit`.
The [API Kit](https://github.com/safe-global/safe-core-sdk/tree/main/packages/api-kit) consumes the [Safe Transaction Service API](https://github.com/safe-global/safe-transaction-service). To start using this library, create a new instance of the `SafeApiKit` class, imported from `@safe-global/api-kit`. Use the chainId you need from the Safe supported ones. If not supported you can use the optional `txServiceUrl` property with a custom Transaction Service deployment.

You will be using Goerli for this tutorial, however, you can also get [service URLs for different networks](../../safe-core-api/available-services.md).

```tsx
import SafeApiKit from '@safe-global/api-kit'

const txServiceUrl = 'https://safe-transaction-goerli.safe.global'
const safeService = new SafeApiKit({ txServiceUrl, ethAdapter: ethAdapterOwner1 })
const safeService = new SafeApiKit({ chainId: 5 })
```

### Initialize the Protocol Kit
Expand Down