@safe-global/api-kit 1.3.0 → 2.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +9 -9
- package/README.md +313 -323
- package/dist/src/SafeApiKit.d.ts +9 -9
- package/dist/src/SafeApiKit.js +48 -36
- package/dist/src/SafeApiKit.js.map +1 -1
- package/dist/src/types/safeTransactionServiceTypes.d.ts +4 -4
- package/dist/src/utils/config.d.ts +1 -0
- package/dist/src/utils/config.js +18 -0
- package/dist/src/utils/config.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +63 -62
- package/dist/src/utils/index.d.ts +0 -1
- package/dist/src/utils/index.js +0 -8
- package/dist/src/utils/index.js.map +0 -1
package/LICENSE.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2021-2023 Safe Ecosystem Foundation
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
-
|
|
7
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
-
|
|
9
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021-2023 Safe Ecosystem Foundation
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,323 +1,313 @@
|
|
|
1
|
-
# Safe API Kit
|
|
2
|
-
|
|
3
|
-
[](https://badge.fury.io/js/%40safe-global%2Fapi-kit)
|
|
4
|
-
[](https://github.com/safe-global/safe-core-sdk/releases)
|
|
5
|
-
[](https://github.com/safe-global/safe-core-sdk/blob/main/LICENSE.md)
|
|
6
|
-
|
|
7
|
-
Software development kit that facilitates the interaction with the [Safe Transaction Service API](https://github.com/safe-global/safe-transaction-service).
|
|
8
|
-
|
|
9
|
-
## Table of contents
|
|
10
|
-
|
|
11
|
-
- [Installation](#installation)
|
|
12
|
-
- [Build](#build)
|
|
13
|
-
- [Tests](#tests)
|
|
14
|
-
- [Initialization](#initialization)
|
|
15
|
-
- [API Reference](#api-reference)
|
|
16
|
-
- [License](#license)
|
|
17
|
-
- [Contributors](#contributors)
|
|
18
|
-
|
|
19
|
-
## <a name="installation">Installation</a>
|
|
20
|
-
|
|
21
|
-
Install the package with yarn or npm:
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
yarn install
|
|
25
|
-
npm install
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
## <a name="build">Build</a>
|
|
29
|
-
|
|
30
|
-
Build the package with yarn or npm:
|
|
31
|
-
|
|
32
|
-
```bash
|
|
33
|
-
yarn build
|
|
34
|
-
npm run build
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
## <a name="tests">Tests</a>
|
|
38
|
-
|
|
39
|
-
Create a `.env` file with environment variables. You can use the `.env.example` file as a reference.
|
|
40
|
-
|
|
41
|
-
Test the package with yarn or npm:
|
|
42
|
-
|
|
43
|
-
```bash
|
|
44
|
-
yarn test
|
|
45
|
-
npm run test
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
## <a name="initialization">Initialization</a>
|
|
49
|
-
|
|
50
|
-
###
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
###
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
```js
|
|
196
|
-
const
|
|
197
|
-
safeAddress
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
```
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
```
|
|
233
|
-
|
|
234
|
-
###
|
|
235
|
-
|
|
236
|
-
Returns the history of
|
|
237
|
-
|
|
238
|
-
```js
|
|
239
|
-
const
|
|
240
|
-
safeAddress
|
|
241
|
-
)
|
|
242
|
-
```
|
|
243
|
-
|
|
244
|
-
###
|
|
245
|
-
|
|
246
|
-
Returns the
|
|
247
|
-
|
|
248
|
-
```js
|
|
249
|
-
const
|
|
250
|
-
safeAddress
|
|
251
|
-
)
|
|
252
|
-
```
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
)
|
|
269
|
-
```
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
```
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
```
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
```
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
const token: TokenInfoResponse = await safeService.getToken(tokenAddress)
|
|
315
|
-
```
|
|
316
|
-
|
|
317
|
-
## <a name="license">License</a>
|
|
318
|
-
|
|
319
|
-
This library is released under MIT.
|
|
320
|
-
|
|
321
|
-
## <a name="contributors">Contributors</a>
|
|
322
|
-
|
|
323
|
-
- Germán Martínez ([germartinez](https://github.com/germartinez))
|
|
1
|
+
# Safe API Kit
|
|
2
|
+
|
|
3
|
+
[](https://badge.fury.io/js/%40safe-global%2Fapi-kit)
|
|
4
|
+
[](https://github.com/safe-global/safe-core-sdk/releases)
|
|
5
|
+
[](https://github.com/safe-global/safe-core-sdk/blob/main/LICENSE.md)
|
|
6
|
+
|
|
7
|
+
Software development kit that facilitates the interaction with the [Safe Transaction Service API](https://github.com/safe-global/safe-transaction-service).
|
|
8
|
+
|
|
9
|
+
## Table of contents
|
|
10
|
+
|
|
11
|
+
- [Installation](#installation)
|
|
12
|
+
- [Build](#build)
|
|
13
|
+
- [Tests](#tests)
|
|
14
|
+
- [Initialization](#initialization)
|
|
15
|
+
- [API Reference](#api-reference)
|
|
16
|
+
- [License](#license)
|
|
17
|
+
- [Contributors](#contributors)
|
|
18
|
+
|
|
19
|
+
## <a name="installation">Installation</a>
|
|
20
|
+
|
|
21
|
+
Install the package with yarn or npm:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
yarn install
|
|
25
|
+
npm install
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## <a name="build">Build</a>
|
|
29
|
+
|
|
30
|
+
Build the package with yarn or npm:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
yarn build
|
|
34
|
+
npm run build
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## <a name="tests">Tests</a>
|
|
38
|
+
|
|
39
|
+
Create a `.env` file with environment variables. You can use the `.env.example` file as a reference.
|
|
40
|
+
|
|
41
|
+
Test the package with yarn or npm:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
yarn test
|
|
45
|
+
npm run test
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## <a name="initialization">Initialization</a>
|
|
49
|
+
|
|
50
|
+
### Initialize the SafeApiKit
|
|
51
|
+
|
|
52
|
+
```js
|
|
53
|
+
import SafeApiKit from '@safe-global/api-kit'
|
|
54
|
+
|
|
55
|
+
const safeService = new SafeApiKit({
|
|
56
|
+
chainId: 1n,
|
|
57
|
+
// Optional. txServiceUrl must be used to set a custom service. For example on chains where Safe doesn't run services.
|
|
58
|
+
txServiceUrl: 'https://safe-transaction-mainnet.safe.global'
|
|
59
|
+
})
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## <a name="api-reference">API Reference</a>
|
|
63
|
+
|
|
64
|
+
### getServiceInfo
|
|
65
|
+
|
|
66
|
+
Returns the information and configuration of the service.
|
|
67
|
+
|
|
68
|
+
```js
|
|
69
|
+
const serviceInfo: SafeServiceInfoResponse = await safeService.getServiceInfo()
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### getServiceSingletonsInfo
|
|
73
|
+
|
|
74
|
+
Returns the list of Safe singleton copies.
|
|
75
|
+
|
|
76
|
+
```js
|
|
77
|
+
const singletons: SafeSingletonResponse = await safeService.getServiceSingletonsInfo()
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### decodeData
|
|
81
|
+
|
|
82
|
+
Decodes the specified Safe transaction data.
|
|
83
|
+
|
|
84
|
+
```js
|
|
85
|
+
const decodedData = await safeService.decodeData(data)
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### getSafesByOwner
|
|
89
|
+
|
|
90
|
+
Returns the list of Safes where the address provided is an owner.
|
|
91
|
+
|
|
92
|
+
```js
|
|
93
|
+
const safes: OwnerResponse = await safeService.getSafesByOwner(ownerAddress)
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### getSafesByModule
|
|
97
|
+
|
|
98
|
+
Returns the list of Safes where the module address provided is enabled.
|
|
99
|
+
|
|
100
|
+
```js
|
|
101
|
+
const safes: ModulesResponse = await getSafesByModule(moduleAddress)
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### getTransaction
|
|
105
|
+
|
|
106
|
+
Returns all the information of a Safe transaction.
|
|
107
|
+
|
|
108
|
+
```js
|
|
109
|
+
const tx: SafeMultisigTransactionResponse = await safeService.getTransaction(safeTxHash)
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### getTransactionConfirmations
|
|
113
|
+
|
|
114
|
+
Returns the list of confirmations for a given a Safe transaction.
|
|
115
|
+
|
|
116
|
+
```js
|
|
117
|
+
const confirmations: SafeMultisigConfirmationListResponse =
|
|
118
|
+
await safeService.getTransactionConfirmations(safeTxHash)
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### confirmTransaction
|
|
122
|
+
|
|
123
|
+
Adds a confirmation for a Safe transaction.
|
|
124
|
+
|
|
125
|
+
```js
|
|
126
|
+
const signature: SignatureResponse = await safeService.confirmTransaction(safeTxHash, signature)
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### getSafeInfo
|
|
130
|
+
|
|
131
|
+
Returns the information and configuration of the provided Safe address.
|
|
132
|
+
|
|
133
|
+
```js
|
|
134
|
+
const safeInfo: SafeInfoResponse = await safeService.getSafeInfo(safeAddress)
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### getSafeDelegates
|
|
138
|
+
|
|
139
|
+
Returns the list of delegates for a given Safe address.
|
|
140
|
+
|
|
141
|
+
```js
|
|
142
|
+
const delegateConfig: GetSafeDelegateProps = {
|
|
143
|
+
safeAddress, // Optional
|
|
144
|
+
delegateAddress, // Optional
|
|
145
|
+
delegatorAddress, // Optional
|
|
146
|
+
label, // Optional
|
|
147
|
+
limit, // Optional
|
|
148
|
+
offset // Optional
|
|
149
|
+
}
|
|
150
|
+
const delegates: SafeDelegateListResponse = await safeService.getSafeDelegates(delegateConfig)
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### addSafeDelegate
|
|
154
|
+
|
|
155
|
+
Adds a new delegate for a given Safe address.
|
|
156
|
+
|
|
157
|
+
```js
|
|
158
|
+
const delegateConfig: AddSafeDelegateProps = {
|
|
159
|
+
safeAddress, // Optional
|
|
160
|
+
delegateAddress,
|
|
161
|
+
delegatorAddress,
|
|
162
|
+
label,
|
|
163
|
+
signer
|
|
164
|
+
}
|
|
165
|
+
await safeService.addSafeDelegate(delegateConfig)
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### removeSafeDelegate
|
|
169
|
+
|
|
170
|
+
Removes a delegate for a given Safe address.
|
|
171
|
+
|
|
172
|
+
```js
|
|
173
|
+
const delegateConfig: DeleteSafeDelegateProps = {
|
|
174
|
+
delegateAddress,
|
|
175
|
+
delegatorAddress,
|
|
176
|
+
signer
|
|
177
|
+
}
|
|
178
|
+
await safeService.removeSafeDelegate(delegateConfig)
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### getSafeCreationInfo
|
|
182
|
+
|
|
183
|
+
Returns the creation information of a Safe.
|
|
184
|
+
|
|
185
|
+
```js
|
|
186
|
+
const safeCreationInfo: SafeCreationInfoResponse = await safeService.getSafeCreationInfo(
|
|
187
|
+
safeAddress
|
|
188
|
+
)
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### estimateSafeTransaction
|
|
192
|
+
|
|
193
|
+
Estimates the safeTxGas for a given Safe multi-signature transaction.
|
|
194
|
+
|
|
195
|
+
```js
|
|
196
|
+
const estimateTx: SafeMultisigTransactionEstimateResponse =
|
|
197
|
+
await safeService.estimateSafeTransaction(safeAddress, safeTransaction)
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### proposeTransaction
|
|
201
|
+
|
|
202
|
+
Creates a new multi-signature transaction and stores it in the Safe Transaction Service.
|
|
203
|
+
|
|
204
|
+
```js
|
|
205
|
+
const transactionConfig: ProposeTransactionProps = {
|
|
206
|
+
safeAddress,
|
|
207
|
+
safeTxHash,
|
|
208
|
+
safeTransactionData,
|
|
209
|
+
senderAddress,
|
|
210
|
+
senderSignature,
|
|
211
|
+
origin
|
|
212
|
+
}
|
|
213
|
+
await safeService.proposeTransaction(transactionConfig)
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### getIncomingTransactions
|
|
217
|
+
|
|
218
|
+
Returns the history of incoming transactions of a Safe account.
|
|
219
|
+
|
|
220
|
+
```js
|
|
221
|
+
const incomingTxs: TransferListResponse = await safeService.getIncomingTransactions(safeAddress)
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### getModuleTransactions
|
|
225
|
+
|
|
226
|
+
Returns the history of module transactions of a Safe account.
|
|
227
|
+
|
|
228
|
+
```js
|
|
229
|
+
const moduleTxs: SafeModuleTransactionListResponse = await safeService.getModuleTransactions(
|
|
230
|
+
safeAddress
|
|
231
|
+
)
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### getMultisigTransactions
|
|
235
|
+
|
|
236
|
+
Returns the history of multi-signature transactions of a Safe account.
|
|
237
|
+
|
|
238
|
+
```js
|
|
239
|
+
const multisigTxs: SafeMultisigTransactionListResponse = await safeService.getMultisigTransactions(
|
|
240
|
+
safeAddress
|
|
241
|
+
)
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
### getPendingTransactions
|
|
245
|
+
|
|
246
|
+
Returns the list of multi-signature transactions that are waiting for the confirmation of the Safe owners.
|
|
247
|
+
|
|
248
|
+
```js
|
|
249
|
+
const pendingTxs: SafeMultisigTransactionListResponse = await safeService.getPendingTransactions(
|
|
250
|
+
safeAddress
|
|
251
|
+
)
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
```js
|
|
255
|
+
const pendingTxs: SafeMultisigTransactionListResponse = await safeService.getPendingTransactions(
|
|
256
|
+
safeAddress,
|
|
257
|
+
currentNonce
|
|
258
|
+
)
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
### getAllTransactions
|
|
262
|
+
|
|
263
|
+
Returns a list of transactions for a Safe. The list has different structures depending on the transaction type.
|
|
264
|
+
|
|
265
|
+
```js
|
|
266
|
+
const allTxs: SafeMultisigTransactionListResponse = await safeService.getAllTransactions(
|
|
267
|
+
safeAddress
|
|
268
|
+
)
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
```js
|
|
272
|
+
const allTxsOptions: AllTransactionsOptions = {
|
|
273
|
+
executed,
|
|
274
|
+
queued,
|
|
275
|
+
trusted
|
|
276
|
+
}
|
|
277
|
+
const allTxs: SafeMultisigTransactionListResponse = await safeService.getAllTransactions(
|
|
278
|
+
safeAddress,
|
|
279
|
+
allTxsOptions
|
|
280
|
+
)
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
### getNextNonce
|
|
284
|
+
|
|
285
|
+
Returns the right nonce to propose a new transaction right after the last pending transaction.
|
|
286
|
+
|
|
287
|
+
```js
|
|
288
|
+
const nextNonce = await safeService.getNextNonce(safeAddress)
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
### getTokenList
|
|
292
|
+
|
|
293
|
+
Returns the list of all the ERC20 tokens handled by the Safe.
|
|
294
|
+
|
|
295
|
+
```js
|
|
296
|
+
const tokens: TokenInfoListResponse = await safeService.getTokenList()
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
### getToken
|
|
300
|
+
|
|
301
|
+
Returns the information of a given ERC20 token.
|
|
302
|
+
|
|
303
|
+
```js
|
|
304
|
+
const token: TokenInfoResponse = await safeService.getToken(tokenAddress)
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
## <a name="license">License</a>
|
|
308
|
+
|
|
309
|
+
This library is released under MIT.
|
|
310
|
+
|
|
311
|
+
## <a name="contributors">Contributors</a>
|
|
312
|
+
|
|
313
|
+
- Germán Martínez ([germartinez](https://github.com/germartinez))
|