Skip to content

Commit 258ef7e

Browse files
authored
fix: document using the sdk-starter-kit with apiKey (#779)
1 parent 9b96e84 commit 258ef7e

File tree

2 files changed

+52
-12
lines changed

2 files changed

+52
-12
lines changed

pages/reference-sdk-api-kit/constructor.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ const apiKit = new SafeApiKit({
6161

6262
- **Type:** `string`
6363

64-
A custom Safe Transaction Service URL that is not supported by default.
64+
The URL of the Safe Transaction Service. This can be provided instead of `apiKey` to specify a custom Transaction Service endpoint, such as when running your own Safe Transaction Service instance.
6565

6666
```typescript focus=3
6767
const apiKit = new SafeApiKit({

pages/reference-sdk-starter-kit/safe-client/constructor.mdx

Lines changed: 51 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ The `SafeClient` class provides a mechanism to extend its functionality via the
2020
const safeClient = await createSafeClient({
2121
provider,
2222
signer,
23-
safeAddress: '0x...'
23+
safeAddress: '0x...',
24+
apiKey: 'YOUR_API_KEY', // Necessary for Safe API interactions
25+
txServiceUrl = 'https://...' // Optional. Use it if you run your own service
2426
})
2527
```
2628

@@ -36,8 +38,10 @@ The `SafeClient` class provides a mechanism to extend its functionality via the
3638
safeOptions: {
3739
owners: ['0x...', '0x...', '0x...'],
3840
threshold: 2,
39-
saltNonce: 123n
40-
}
41+
saltNonce: '123'
42+
},
43+
apiKey: 'YOUR_API_KEY', // Necessary for Safe API interactions
44+
txServiceUrl = 'https://...' // Optional. Use it if you run your own service
4145
})
4246
```
4347

@@ -65,7 +69,8 @@ The provider connected to the blockchain.
6569
const safeClient = await createSafeClient({
6670
provider,
6771
signer,
68-
safeAddress: '0x...'
72+
safeAddress: '0x...',
73+
apiKey: 'YOUR_API_KEY'
6974
})
7075
```
7176

@@ -82,7 +87,8 @@ The signer connected to the Safe as an owner.
8287
const safeClient = await createSafeClient({
8388
provider,
8489
signer,
85-
safeAddress: '0x...'
90+
safeAddress: '0x...',
91+
apiKey: 'YOUR_API_KEY'
8692
})
8793
```
8894

@@ -96,7 +102,8 @@ The address of the connected Safe.
96102
const safeClient = await createSafeClient({
97103
provider,
98104
signer,
99-
safeAddress: '0x...'
105+
safeAddress: '0x...',
106+
apiKey: 'YOUR_API_KEY'
100107
})
101108
```
102109

@@ -113,8 +120,9 @@ const safeClient = await createSafeClient({
113120
safeOptions: {
114121
owners: ['0x...', '0x...', '0x...'],
115122
threshold: 2,
116-
saltNonce: 123n
117-
}
123+
saltNonce: '123'
124+
},
125+
apiKey: 'YOUR_API_KEY'
118126
})
119127
```
120128

@@ -131,8 +139,9 @@ const safeClient = await createSafeClient({
131139
safeOptions: {
132140
owners: ['0x...', '0x...', '0x...'],
133141
threshold: 2,
134-
saltNonce: 123n
135-
}
142+
saltNonce: '123'
143+
},
144+
apiKey: 'YOUR_API_KEY'
136145
})
137146
```
138147

@@ -149,7 +158,38 @@ const safeClient = await createSafeClient({
149158
safeOptions: {
150159
owners: ['0x...', '0x...', '0x...'],
151160
threshold: 2,
152-
saltNonce: 123n
161+
saltNonce: '123'
153162
}
163+
apiKey: 'YOUR_API_KEY'
164+
})
165+
```
166+
167+
### `apiKey` (Optional)
168+
169+
- **Type:** `string`
170+
171+
The API key for the Safe Transaction Service. This parameter is mandatory when using default Safe provided services. It can be omitted if using a custom Transaction Service. [Check how to get one](/core-api/how-to-use-api-keys).
172+
173+
```typescript focus=5
174+
const safeClient = await createSafeClient({
175+
provider,
176+
signer,
177+
safeAddress: '0x...',
178+
apiKey: 'YOUR_API_KEY'
179+
})
180+
```
181+
182+
### `txServiceUrl` (Optional)
183+
184+
- **Type:** `string`
185+
186+
The URL of the Safe Transaction Service. This can be provided instead of `apiKey` to specify a custom Transaction Service endpoint, such as when running your own Safe Transaction Service instance.
187+
188+
```typescript focus=5
189+
const safeClient = await createSafeClient({
190+
provider,
191+
signer,
192+
safeAddress: '0x...',
193+
txServiceUrl: 'https://...'
154194
})
155195
```

0 commit comments

Comments
 (0)