@safe-global/api-kit 1.0.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 -0
- package/README.md +311 -0
- package/dist/src/SafeApiKit.d.ts +232 -0
- package/dist/src/SafeApiKit.js +517 -0
- package/dist/src/SafeApiKit.js.map +1 -0
- package/dist/src/index.d.ts +4 -0
- package/dist/src/index.js +23 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/types/safeTransactionServiceTypes.d.ts +206 -0
- package/dist/src/types/safeTransactionServiceTypes.js +3 -0
- package/dist/src/types/safeTransactionServiceTypes.js.map +1 -0
- package/dist/src/utils/httpRequests.d.ts +12 -0
- package/dist/src/utils/httpRequests.js +59 -0
- package/dist/src/utils/httpRequests.js.map +1 -0
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/src/utils/index.js +8 -0
- package/dist/src/utils/index.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/package.json +62 -0
|
@@ -0,0 +1,517 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
3
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
4
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
5
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
6
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
7
|
+
};
|
|
8
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
9
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
11
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12
|
+
};
|
|
13
|
+
var _SafeApiKit_txServiceBaseUrl, _SafeApiKit_ethAdapter;
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const utils_1 = require("@safe-global/api-kit/utils");
|
|
16
|
+
const httpRequests_1 = require("@safe-global/api-kit/utils/httpRequests");
|
|
17
|
+
class SafeApiKit {
|
|
18
|
+
constructor({ txServiceUrl, ethAdapter }) {
|
|
19
|
+
_SafeApiKit_txServiceBaseUrl.set(this, void 0);
|
|
20
|
+
_SafeApiKit_ethAdapter.set(this, void 0);
|
|
21
|
+
__classPrivateFieldSet(this, _SafeApiKit_txServiceBaseUrl, (0, utils_1.getTxServiceBaseUrl)(txServiceUrl), "f");
|
|
22
|
+
__classPrivateFieldSet(this, _SafeApiKit_ethAdapter, ethAdapter, "f");
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Returns the information and configuration of the service.
|
|
26
|
+
*
|
|
27
|
+
* @returns The information and configuration of the service
|
|
28
|
+
*/
|
|
29
|
+
async getServiceInfo() {
|
|
30
|
+
return (0, httpRequests_1.sendRequest)({
|
|
31
|
+
url: `${__classPrivateFieldGet(this, _SafeApiKit_txServiceBaseUrl, "f")}/v1/about`,
|
|
32
|
+
method: httpRequests_1.HttpMethod.Get
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Returns the list of Safe master copies.
|
|
37
|
+
*
|
|
38
|
+
* @returns The list of Safe master copies
|
|
39
|
+
*/
|
|
40
|
+
async getServiceMasterCopiesInfo() {
|
|
41
|
+
return (0, httpRequests_1.sendRequest)({
|
|
42
|
+
url: `${__classPrivateFieldGet(this, _SafeApiKit_txServiceBaseUrl, "f")}/v1/about/master-copies`,
|
|
43
|
+
method: httpRequests_1.HttpMethod.Get
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Decodes the specified Safe transaction data.
|
|
48
|
+
*
|
|
49
|
+
* @param data - The Safe transaction data
|
|
50
|
+
* @returns The transaction data decoded
|
|
51
|
+
* @throws "Invalid data"
|
|
52
|
+
* @throws "Not Found"
|
|
53
|
+
* @throws "Ensure this field has at least 1 hexadecimal chars (not counting 0x)."
|
|
54
|
+
*/
|
|
55
|
+
async decodeData(data) {
|
|
56
|
+
if (data === '') {
|
|
57
|
+
throw new Error('Invalid data');
|
|
58
|
+
}
|
|
59
|
+
return (0, httpRequests_1.sendRequest)({
|
|
60
|
+
url: `${__classPrivateFieldGet(this, _SafeApiKit_txServiceBaseUrl, "f")}/v1/data-decoder/`,
|
|
61
|
+
method: httpRequests_1.HttpMethod.Post,
|
|
62
|
+
body: { data }
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Returns the list of Safes where the address provided is an owner.
|
|
67
|
+
*
|
|
68
|
+
* @param ownerAddress - The owner address
|
|
69
|
+
* @returns The list of Safes where the address provided is an owner
|
|
70
|
+
* @throws "Invalid owner address"
|
|
71
|
+
* @throws "Checksum address validation failed"
|
|
72
|
+
*/
|
|
73
|
+
async getSafesByOwner(ownerAddress) {
|
|
74
|
+
if (ownerAddress === '') {
|
|
75
|
+
throw new Error('Invalid owner address');
|
|
76
|
+
}
|
|
77
|
+
const { address } = await __classPrivateFieldGet(this, _SafeApiKit_ethAdapter, "f").getEip3770Address(ownerAddress);
|
|
78
|
+
return (0, httpRequests_1.sendRequest)({
|
|
79
|
+
url: `${__classPrivateFieldGet(this, _SafeApiKit_txServiceBaseUrl, "f")}/v1/owners/${address}/safes/`,
|
|
80
|
+
method: httpRequests_1.HttpMethod.Get
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Returns the list of Safes where the module address provided is enabled.
|
|
85
|
+
*
|
|
86
|
+
* @param moduleAddress - The Safe module address
|
|
87
|
+
* @returns The list of Safe addresses where the module provided is enabled
|
|
88
|
+
* @throws "Invalid module address"
|
|
89
|
+
* @throws "Module address checksum not valid"
|
|
90
|
+
*/
|
|
91
|
+
async getSafesByModule(moduleAddress) {
|
|
92
|
+
if (moduleAddress === '') {
|
|
93
|
+
throw new Error('Invalid module address');
|
|
94
|
+
}
|
|
95
|
+
const { address } = await __classPrivateFieldGet(this, _SafeApiKit_ethAdapter, "f").getEip3770Address(moduleAddress);
|
|
96
|
+
return (0, httpRequests_1.sendRequest)({
|
|
97
|
+
url: `${__classPrivateFieldGet(this, _SafeApiKit_txServiceBaseUrl, "f")}/v1/modules/${address}/safes/`,
|
|
98
|
+
method: httpRequests_1.HttpMethod.Get
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Returns all the information of a Safe transaction.
|
|
103
|
+
*
|
|
104
|
+
* @param safeTxHash - Hash of the Safe transaction
|
|
105
|
+
* @returns The information of a Safe transaction
|
|
106
|
+
* @throws "Invalid safeTxHash"
|
|
107
|
+
* @throws "Not found."
|
|
108
|
+
*/
|
|
109
|
+
async getTransaction(safeTxHash) {
|
|
110
|
+
if (safeTxHash === '') {
|
|
111
|
+
throw new Error('Invalid safeTxHash');
|
|
112
|
+
}
|
|
113
|
+
return (0, httpRequests_1.sendRequest)({
|
|
114
|
+
url: `${__classPrivateFieldGet(this, _SafeApiKit_txServiceBaseUrl, "f")}/v1/multisig-transactions/${safeTxHash}/`,
|
|
115
|
+
method: httpRequests_1.HttpMethod.Get
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Returns the list of confirmations for a given a Safe transaction.
|
|
120
|
+
*
|
|
121
|
+
* @param safeTxHash - The hash of the Safe transaction
|
|
122
|
+
* @returns The list of confirmations
|
|
123
|
+
* @throws "Invalid safeTxHash"
|
|
124
|
+
*/
|
|
125
|
+
async getTransactionConfirmations(safeTxHash) {
|
|
126
|
+
if (safeTxHash === '') {
|
|
127
|
+
throw new Error('Invalid safeTxHash');
|
|
128
|
+
}
|
|
129
|
+
return (0, httpRequests_1.sendRequest)({
|
|
130
|
+
url: `${__classPrivateFieldGet(this, _SafeApiKit_txServiceBaseUrl, "f")}/v1/multisig-transactions/${safeTxHash}/confirmations/`,
|
|
131
|
+
method: httpRequests_1.HttpMethod.Get
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Adds a confirmation for a Safe transaction.
|
|
136
|
+
*
|
|
137
|
+
* @param safeTxHash - Hash of the Safe transaction that will be confirmed
|
|
138
|
+
* @param signature - Signature of the transaction
|
|
139
|
+
* @returns
|
|
140
|
+
* @throws "Invalid safeTxHash"
|
|
141
|
+
* @throws "Invalid signature"
|
|
142
|
+
* @throws "Malformed data"
|
|
143
|
+
* @throws "Error processing data"
|
|
144
|
+
*/
|
|
145
|
+
async confirmTransaction(safeTxHash, signature) {
|
|
146
|
+
if (safeTxHash === '') {
|
|
147
|
+
throw new Error('Invalid safeTxHash');
|
|
148
|
+
}
|
|
149
|
+
if (signature === '') {
|
|
150
|
+
throw new Error('Invalid signature');
|
|
151
|
+
}
|
|
152
|
+
return (0, httpRequests_1.sendRequest)({
|
|
153
|
+
url: `${__classPrivateFieldGet(this, _SafeApiKit_txServiceBaseUrl, "f")}/v1/multisig-transactions/${safeTxHash}/confirmations/`,
|
|
154
|
+
method: httpRequests_1.HttpMethod.Post,
|
|
155
|
+
body: {
|
|
156
|
+
signature
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Returns the information and configuration of the provided Safe address.
|
|
162
|
+
*
|
|
163
|
+
* @param safeAddress - The Safe address
|
|
164
|
+
* @returns The information and configuration of the provided Safe address
|
|
165
|
+
* @throws "Invalid Safe address"
|
|
166
|
+
* @throws "Checksum address validation failed"
|
|
167
|
+
*/
|
|
168
|
+
async getSafeInfo(safeAddress) {
|
|
169
|
+
if (safeAddress === '') {
|
|
170
|
+
throw new Error('Invalid Safe address');
|
|
171
|
+
}
|
|
172
|
+
const { address } = await __classPrivateFieldGet(this, _SafeApiKit_ethAdapter, "f").getEip3770Address(safeAddress);
|
|
173
|
+
return (0, httpRequests_1.sendRequest)({
|
|
174
|
+
url: `${__classPrivateFieldGet(this, _SafeApiKit_txServiceBaseUrl, "f")}/v1/safes/${address}/`,
|
|
175
|
+
method: httpRequests_1.HttpMethod.Get
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Returns the list of delegates.
|
|
180
|
+
*
|
|
181
|
+
* @param getSafeDelegateProps - Properties to filter the returned list of delegates
|
|
182
|
+
* @returns The list of delegates
|
|
183
|
+
* @throws "Checksum address validation failed"
|
|
184
|
+
*/
|
|
185
|
+
async getSafeDelegates({ safeAddress, delegateAddress, delegatorAddress, label, limit, offset }) {
|
|
186
|
+
const url = new URL(`${__classPrivateFieldGet(this, _SafeApiKit_txServiceBaseUrl, "f")}/v1/delegates`);
|
|
187
|
+
if (safeAddress) {
|
|
188
|
+
const { address: safe } = await __classPrivateFieldGet(this, _SafeApiKit_ethAdapter, "f").getEip3770Address(safeAddress);
|
|
189
|
+
url.searchParams.set('safe', safe);
|
|
190
|
+
}
|
|
191
|
+
if (delegateAddress) {
|
|
192
|
+
const { address: delegate } = await __classPrivateFieldGet(this, _SafeApiKit_ethAdapter, "f").getEip3770Address(delegateAddress);
|
|
193
|
+
url.searchParams.set('delegate', delegate);
|
|
194
|
+
}
|
|
195
|
+
if (delegatorAddress) {
|
|
196
|
+
const { address: delegator } = await __classPrivateFieldGet(this, _SafeApiKit_ethAdapter, "f").getEip3770Address(delegatorAddress);
|
|
197
|
+
url.searchParams.set('delegator', delegator);
|
|
198
|
+
}
|
|
199
|
+
if (label) {
|
|
200
|
+
url.searchParams.set('label', label);
|
|
201
|
+
}
|
|
202
|
+
if (limit) {
|
|
203
|
+
url.searchParams.set('limit', limit);
|
|
204
|
+
}
|
|
205
|
+
if (offset) {
|
|
206
|
+
url.searchParams.set('offset', offset);
|
|
207
|
+
}
|
|
208
|
+
return (0, httpRequests_1.sendRequest)({
|
|
209
|
+
url: url.toString(),
|
|
210
|
+
method: httpRequests_1.HttpMethod.Get
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Adds a new delegate for a given Safe address.
|
|
215
|
+
*
|
|
216
|
+
* @param addSafeDelegateProps - The configuration of the new delegate
|
|
217
|
+
* @returns
|
|
218
|
+
* @throws "Invalid Safe delegate address"
|
|
219
|
+
* @throws "Invalid Safe delegator address"
|
|
220
|
+
* @throws "Invalid label"
|
|
221
|
+
* @throws "Checksum address validation failed"
|
|
222
|
+
* @throws "Address <delegate_address> is not checksumed"
|
|
223
|
+
* @throws "Safe=<safe_address> does not exist or it's still not indexed"
|
|
224
|
+
* @throws "Signing owner is not an owner of the Safe"
|
|
225
|
+
*/
|
|
226
|
+
async addSafeDelegate({ safeAddress, delegateAddress, delegatorAddress, label, signer }) {
|
|
227
|
+
if (delegateAddress === '') {
|
|
228
|
+
throw new Error('Invalid Safe delegate address');
|
|
229
|
+
}
|
|
230
|
+
if (delegatorAddress === '') {
|
|
231
|
+
throw new Error('Invalid Safe delegator address');
|
|
232
|
+
}
|
|
233
|
+
if (label === '') {
|
|
234
|
+
throw new Error('Invalid label');
|
|
235
|
+
}
|
|
236
|
+
const { address: delegate } = await __classPrivateFieldGet(this, _SafeApiKit_ethAdapter, "f").getEip3770Address(delegateAddress);
|
|
237
|
+
const { address: delegator } = await __classPrivateFieldGet(this, _SafeApiKit_ethAdapter, "f").getEip3770Address(delegatorAddress);
|
|
238
|
+
const totp = Math.floor(Date.now() / 1000 / 3600);
|
|
239
|
+
const data = delegate + totp;
|
|
240
|
+
const signature = await signer.signMessage(data);
|
|
241
|
+
const body = {
|
|
242
|
+
safe: safeAddress ? (await __classPrivateFieldGet(this, _SafeApiKit_ethAdapter, "f").getEip3770Address(safeAddress)).address : null,
|
|
243
|
+
delegate,
|
|
244
|
+
delegator,
|
|
245
|
+
label,
|
|
246
|
+
signature
|
|
247
|
+
};
|
|
248
|
+
return (0, httpRequests_1.sendRequest)({
|
|
249
|
+
url: `${__classPrivateFieldGet(this, _SafeApiKit_txServiceBaseUrl, "f")}/v1/delegates/`,
|
|
250
|
+
method: httpRequests_1.HttpMethod.Post,
|
|
251
|
+
body
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Removes a delegate for a given Safe address.
|
|
256
|
+
*
|
|
257
|
+
* @param deleteSafeDelegateProps - The configuration for the delegate that will be removed
|
|
258
|
+
* @returns
|
|
259
|
+
* @throws "Invalid Safe delegate address"
|
|
260
|
+
* @throws "Invalid Safe delegator address"
|
|
261
|
+
* @throws "Checksum address validation failed"
|
|
262
|
+
* @throws "Signing owner is not an owner of the Safe"
|
|
263
|
+
* @throws "Not found"
|
|
264
|
+
*/
|
|
265
|
+
async removeSafeDelegate({ delegateAddress, delegatorAddress, signer }) {
|
|
266
|
+
if (delegateAddress === '') {
|
|
267
|
+
throw new Error('Invalid Safe delegate address');
|
|
268
|
+
}
|
|
269
|
+
if (delegatorAddress === '') {
|
|
270
|
+
throw new Error('Invalid Safe delegator address');
|
|
271
|
+
}
|
|
272
|
+
const { address: delegate } = await __classPrivateFieldGet(this, _SafeApiKit_ethAdapter, "f").getEip3770Address(delegateAddress);
|
|
273
|
+
const { address: delegator } = await __classPrivateFieldGet(this, _SafeApiKit_ethAdapter, "f").getEip3770Address(delegatorAddress);
|
|
274
|
+
const totp = Math.floor(Date.now() / 1000 / 3600);
|
|
275
|
+
const data = delegate + totp;
|
|
276
|
+
const signature = await signer.signMessage(data);
|
|
277
|
+
return (0, httpRequests_1.sendRequest)({
|
|
278
|
+
url: `${__classPrivateFieldGet(this, _SafeApiKit_txServiceBaseUrl, "f")}/v1/delegates/${delegate}`,
|
|
279
|
+
method: httpRequests_1.HttpMethod.Delete,
|
|
280
|
+
body: {
|
|
281
|
+
delegate,
|
|
282
|
+
delegator,
|
|
283
|
+
signature
|
|
284
|
+
}
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Returns the creation information of a Safe.
|
|
289
|
+
*
|
|
290
|
+
* @param safeAddress - The Safe address
|
|
291
|
+
* @returns The creation information of a Safe
|
|
292
|
+
* @throws "Invalid Safe address"
|
|
293
|
+
* @throws "Safe creation not found"
|
|
294
|
+
* @throws "Checksum address validation failed"
|
|
295
|
+
* @throws "Problem connecting to Ethereum network"
|
|
296
|
+
*/
|
|
297
|
+
async getSafeCreationInfo(safeAddress) {
|
|
298
|
+
if (safeAddress === '') {
|
|
299
|
+
throw new Error('Invalid Safe address');
|
|
300
|
+
}
|
|
301
|
+
const { address } = await __classPrivateFieldGet(this, _SafeApiKit_ethAdapter, "f").getEip3770Address(safeAddress);
|
|
302
|
+
return (0, httpRequests_1.sendRequest)({
|
|
303
|
+
url: `${__classPrivateFieldGet(this, _SafeApiKit_txServiceBaseUrl, "f")}/v1/safes/${address}/creation/`,
|
|
304
|
+
method: httpRequests_1.HttpMethod.Get
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Estimates the safeTxGas for a given Safe multi-signature transaction.
|
|
309
|
+
*
|
|
310
|
+
* @param safeAddress - The Safe address
|
|
311
|
+
* @param safeTransaction - The Safe transaction to estimate
|
|
312
|
+
* @returns The safeTxGas for the given Safe transaction
|
|
313
|
+
* @throws "Invalid Safe address"
|
|
314
|
+
* @throws "Data not valid"
|
|
315
|
+
* @throws "Safe not found"
|
|
316
|
+
* @throws "Tx not valid"
|
|
317
|
+
*/
|
|
318
|
+
async estimateSafeTransaction(safeAddress, safeTransaction) {
|
|
319
|
+
if (safeAddress === '') {
|
|
320
|
+
throw new Error('Invalid Safe address');
|
|
321
|
+
}
|
|
322
|
+
const { address } = await __classPrivateFieldGet(this, _SafeApiKit_ethAdapter, "f").getEip3770Address(safeAddress);
|
|
323
|
+
return (0, httpRequests_1.sendRequest)({
|
|
324
|
+
url: `${__classPrivateFieldGet(this, _SafeApiKit_txServiceBaseUrl, "f")}/v1/safes/${address}/multisig-transactions/estimations/`,
|
|
325
|
+
method: httpRequests_1.HttpMethod.Post,
|
|
326
|
+
body: safeTransaction
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* Creates a new multi-signature transaction with its confirmations and stores it in the Safe Transaction Service.
|
|
331
|
+
*
|
|
332
|
+
* @param proposeTransactionConfig - The configuration of the proposed transaction
|
|
333
|
+
* @returns The hash of the Safe transaction proposed
|
|
334
|
+
* @throws "Invalid Safe address"
|
|
335
|
+
* @throws "Invalid safeTxHash"
|
|
336
|
+
* @throws "Invalid data"
|
|
337
|
+
* @throws "Invalid ethereum address/User is not an owner/Invalid signature/Nonce already executed/Sender is not an owner"
|
|
338
|
+
*/
|
|
339
|
+
async proposeTransaction({ safeAddress, safeTransactionData, safeTxHash, senderAddress, senderSignature, origin }) {
|
|
340
|
+
if (safeAddress === '') {
|
|
341
|
+
throw new Error('Invalid Safe address');
|
|
342
|
+
}
|
|
343
|
+
const { address: safe } = await __classPrivateFieldGet(this, _SafeApiKit_ethAdapter, "f").getEip3770Address(safeAddress);
|
|
344
|
+
const { address: sender } = await __classPrivateFieldGet(this, _SafeApiKit_ethAdapter, "f").getEip3770Address(senderAddress);
|
|
345
|
+
if (safeTxHash === '') {
|
|
346
|
+
throw new Error('Invalid safeTxHash');
|
|
347
|
+
}
|
|
348
|
+
return (0, httpRequests_1.sendRequest)({
|
|
349
|
+
url: `${__classPrivateFieldGet(this, _SafeApiKit_txServiceBaseUrl, "f")}/v1/safes/${safe}/multisig-transactions/`,
|
|
350
|
+
method: httpRequests_1.HttpMethod.Post,
|
|
351
|
+
body: {
|
|
352
|
+
...safeTransactionData,
|
|
353
|
+
contractTransactionHash: safeTxHash,
|
|
354
|
+
sender,
|
|
355
|
+
signature: senderSignature,
|
|
356
|
+
origin
|
|
357
|
+
}
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* Returns the history of incoming transactions of a Safe account.
|
|
362
|
+
*
|
|
363
|
+
* @param safeAddress - The Safe address
|
|
364
|
+
* @returns The history of incoming transactions
|
|
365
|
+
* @throws "Invalid Safe address"
|
|
366
|
+
* @throws "Checksum address validation failed"
|
|
367
|
+
*/
|
|
368
|
+
async getIncomingTransactions(safeAddress) {
|
|
369
|
+
if (safeAddress === '') {
|
|
370
|
+
throw new Error('Invalid Safe address');
|
|
371
|
+
}
|
|
372
|
+
const { address } = await __classPrivateFieldGet(this, _SafeApiKit_ethAdapter, "f").getEip3770Address(safeAddress);
|
|
373
|
+
return (0, httpRequests_1.sendRequest)({
|
|
374
|
+
url: `${__classPrivateFieldGet(this, _SafeApiKit_txServiceBaseUrl, "f")}/v1/safes/${address}/incoming-transfers?executed=true`,
|
|
375
|
+
method: httpRequests_1.HttpMethod.Get
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* Returns the history of module transactions of a Safe account.
|
|
380
|
+
*
|
|
381
|
+
* @param safeAddress - The Safe address
|
|
382
|
+
* @returns The history of module transactions
|
|
383
|
+
* @throws "Invalid Safe address"
|
|
384
|
+
* @throws "Invalid data"
|
|
385
|
+
* @throws "Invalid ethereum address"
|
|
386
|
+
*/
|
|
387
|
+
async getModuleTransactions(safeAddress) {
|
|
388
|
+
if (safeAddress === '') {
|
|
389
|
+
throw new Error('Invalid Safe address');
|
|
390
|
+
}
|
|
391
|
+
const { address } = await __classPrivateFieldGet(this, _SafeApiKit_ethAdapter, "f").getEip3770Address(safeAddress);
|
|
392
|
+
return (0, httpRequests_1.sendRequest)({
|
|
393
|
+
url: `${__classPrivateFieldGet(this, _SafeApiKit_txServiceBaseUrl, "f")}/v1/safes/${address}/module-transactions/`,
|
|
394
|
+
method: httpRequests_1.HttpMethod.Get
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* Returns the history of multi-signature transactions of a Safe account.
|
|
399
|
+
*
|
|
400
|
+
* @param safeAddress - The Safe address
|
|
401
|
+
* @returns The history of multi-signature transactions
|
|
402
|
+
* @throws "Invalid Safe address"
|
|
403
|
+
* @throws "Checksum address validation failed"
|
|
404
|
+
*/
|
|
405
|
+
async getMultisigTransactions(safeAddress) {
|
|
406
|
+
if (safeAddress === '') {
|
|
407
|
+
throw new Error('Invalid Safe address');
|
|
408
|
+
}
|
|
409
|
+
const { address } = await __classPrivateFieldGet(this, _SafeApiKit_ethAdapter, "f").getEip3770Address(safeAddress);
|
|
410
|
+
return (0, httpRequests_1.sendRequest)({
|
|
411
|
+
url: `${__classPrivateFieldGet(this, _SafeApiKit_txServiceBaseUrl, "f")}/v1/safes/${address}/multisig-transactions/`,
|
|
412
|
+
method: httpRequests_1.HttpMethod.Get
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* Returns the list of multi-signature transactions that are waiting for the confirmation of the Safe owners.
|
|
417
|
+
*
|
|
418
|
+
* @param safeAddress - The Safe address
|
|
419
|
+
* @param currentNonce - Current nonce of the Safe
|
|
420
|
+
* @returns The list of transactions waiting for the confirmation of the Safe owners
|
|
421
|
+
* @throws "Invalid Safe address"
|
|
422
|
+
* @throws "Invalid data"
|
|
423
|
+
* @throws "Invalid ethereum address"
|
|
424
|
+
*/
|
|
425
|
+
async getPendingTransactions(safeAddress, currentNonce) {
|
|
426
|
+
if (safeAddress === '') {
|
|
427
|
+
throw new Error('Invalid Safe address');
|
|
428
|
+
}
|
|
429
|
+
const { address } = await __classPrivateFieldGet(this, _SafeApiKit_ethAdapter, "f").getEip3770Address(safeAddress);
|
|
430
|
+
const nonce = currentNonce ? currentNonce : (await this.getSafeInfo(address)).nonce;
|
|
431
|
+
return (0, httpRequests_1.sendRequest)({
|
|
432
|
+
url: `${__classPrivateFieldGet(this, _SafeApiKit_txServiceBaseUrl, "f")}/v1/safes/${address}/multisig-transactions/?executed=false&nonce__gte=${nonce}`,
|
|
433
|
+
method: httpRequests_1.HttpMethod.Get
|
|
434
|
+
});
|
|
435
|
+
}
|
|
436
|
+
/**
|
|
437
|
+
* Returns a list of transactions for a Safe. The list has different structures depending on the transaction type
|
|
438
|
+
*
|
|
439
|
+
* @param safeAddress - The Safe address
|
|
440
|
+
* @returns The list of transactions waiting for the confirmation of the Safe owners
|
|
441
|
+
* @throws "Invalid Safe address"
|
|
442
|
+
* @throws "Checksum address validation failed"
|
|
443
|
+
*/
|
|
444
|
+
async getAllTransactions(safeAddress, options) {
|
|
445
|
+
var _a, _b, _c;
|
|
446
|
+
if (safeAddress === '') {
|
|
447
|
+
throw new Error('Invalid Safe address');
|
|
448
|
+
}
|
|
449
|
+
const { address } = await __classPrivateFieldGet(this, _SafeApiKit_ethAdapter, "f").getEip3770Address(safeAddress);
|
|
450
|
+
const url = new URL(`${__classPrivateFieldGet(this, _SafeApiKit_txServiceBaseUrl, "f")}/v1/safes/${address}/all-transactions/`);
|
|
451
|
+
const trusted = ((_a = options === null || options === void 0 ? void 0 : options.trusted) === null || _a === void 0 ? void 0 : _a.toString()) || 'true';
|
|
452
|
+
url.searchParams.set('trusted', trusted);
|
|
453
|
+
const queued = ((_b = options === null || options === void 0 ? void 0 : options.queued) === null || _b === void 0 ? void 0 : _b.toString()) || 'true';
|
|
454
|
+
url.searchParams.set('queued', queued);
|
|
455
|
+
const executed = ((_c = options === null || options === void 0 ? void 0 : options.executed) === null || _c === void 0 ? void 0 : _c.toString()) || 'false';
|
|
456
|
+
url.searchParams.set('executed', executed);
|
|
457
|
+
return (0, httpRequests_1.sendRequest)({
|
|
458
|
+
url: url.toString(),
|
|
459
|
+
method: httpRequests_1.HttpMethod.Get
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
/**
|
|
463
|
+
* Returns the right nonce to propose a new transaction after the last pending transaction.
|
|
464
|
+
*
|
|
465
|
+
* @param safeAddress - The Safe address
|
|
466
|
+
* @returns The right nonce to propose a new transaction after the last pending transaction
|
|
467
|
+
* @throws "Invalid Safe address"
|
|
468
|
+
* @throws "Invalid data"
|
|
469
|
+
* @throws "Invalid ethereum address"
|
|
470
|
+
*/
|
|
471
|
+
async getNextNonce(safeAddress) {
|
|
472
|
+
if (safeAddress === '') {
|
|
473
|
+
throw new Error('Invalid Safe address');
|
|
474
|
+
}
|
|
475
|
+
const { address } = await __classPrivateFieldGet(this, _SafeApiKit_ethAdapter, "f").getEip3770Address(safeAddress);
|
|
476
|
+
const pendingTransactions = await this.getPendingTransactions(address);
|
|
477
|
+
if (pendingTransactions.results.length > 0) {
|
|
478
|
+
const nonces = pendingTransactions.results.map((tx) => tx.nonce);
|
|
479
|
+
const lastNonce = Math.max(...nonces);
|
|
480
|
+
return lastNonce + 1;
|
|
481
|
+
}
|
|
482
|
+
const safeInfo = await this.getSafeInfo(address);
|
|
483
|
+
return safeInfo.nonce;
|
|
484
|
+
}
|
|
485
|
+
/**
|
|
486
|
+
* Returns the list of all the ERC20 tokens handled by the Safe.
|
|
487
|
+
*
|
|
488
|
+
* @returns The list of all the ERC20 tokens
|
|
489
|
+
*/
|
|
490
|
+
async getTokenList() {
|
|
491
|
+
return (0, httpRequests_1.sendRequest)({
|
|
492
|
+
url: `${__classPrivateFieldGet(this, _SafeApiKit_txServiceBaseUrl, "f")}/v1/tokens/`,
|
|
493
|
+
method: httpRequests_1.HttpMethod.Get
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
/**
|
|
497
|
+
* Returns the information of a given ERC20 token.
|
|
498
|
+
*
|
|
499
|
+
* @param tokenAddress - The token address
|
|
500
|
+
* @returns The information of the given ERC20 token
|
|
501
|
+
* @throws "Invalid token address"
|
|
502
|
+
* @throws "Checksum address validation failed"
|
|
503
|
+
*/
|
|
504
|
+
async getToken(tokenAddress) {
|
|
505
|
+
if (tokenAddress === '') {
|
|
506
|
+
throw new Error('Invalid token address');
|
|
507
|
+
}
|
|
508
|
+
const { address } = await __classPrivateFieldGet(this, _SafeApiKit_ethAdapter, "f").getEip3770Address(tokenAddress);
|
|
509
|
+
return (0, httpRequests_1.sendRequest)({
|
|
510
|
+
url: `${__classPrivateFieldGet(this, _SafeApiKit_txServiceBaseUrl, "f")}/v1/tokens/${address}/`,
|
|
511
|
+
method: httpRequests_1.HttpMethod.Get
|
|
512
|
+
});
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
_SafeApiKit_txServiceBaseUrl = new WeakMap(), _SafeApiKit_ethAdapter = new WeakMap();
|
|
516
|
+
exports.default = SafeApiKit;
|
|
517
|
+
//# sourceMappingURL=SafeApiKit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SafeApiKit.js","sourceRoot":"","sources":["../../src/SafeApiKit.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAwBA,sDAAgE;AAChE,0EAAiF;AAcjF,MAAM,UAAU;IAId,YAAY,EAAE,YAAY,EAAE,UAAU,EAAoB;QAH1D,+CAAyB;QACzB,yCAAuB;QAGrB,uBAAA,IAAI,gCAAqB,IAAA,2BAAmB,EAAC,YAAY,CAAC,MAAA,CAAA;QAC1D,uBAAA,IAAI,0BAAe,UAAU,MAAA,CAAA;IAC/B,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,cAAc;QAClB,OAAO,IAAA,0BAAW,EAAC;YACjB,GAAG,EAAE,GAAG,uBAAA,IAAI,oCAAkB,WAAW;YACzC,MAAM,EAAE,yBAAU,CAAC,GAAG;SACvB,CAAC,CAAA;IACJ,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,0BAA0B;QAC9B,OAAO,IAAA,0BAAW,EAAC;YACjB,GAAG,EAAE,GAAG,uBAAA,IAAI,oCAAkB,yBAAyB;YACvD,MAAM,EAAE,yBAAU,CAAC,GAAG;SACvB,CAAC,CAAA;IACJ,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,UAAU,CAAC,IAAY;QAC3B,IAAI,IAAI,KAAK,EAAE,EAAE;YACf,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAA;SAChC;QACD,OAAO,IAAA,0BAAW,EAAC;YACjB,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,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;YAChE,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,CAAA;YACrC,OAAO,SAAS,GAAG,CAAC,CAAA;SACrB;QACD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAA;QAChD,OAAO,QAAQ,CAAC,KAAK,CAAA;IACvB,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,YAAY;QAChB,OAAO,IAAA,0BAAW,EAAC;YACjB,GAAG,EAAE,GAAG,uBAAA,IAAI,oCAAkB,aAAa;YAC3C,MAAM,EAAE,yBAAU,CAAC,GAAG;SACvB,CAAC,CAAA;IACJ,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,QAAQ,CAAC,YAAoB;QACjC,IAAI,YAAY,KAAK,EAAE,EAAE;YACvB,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAA;SACzC;QACD,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,uBAAA,IAAI,8BAAY,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAA;QAC1E,OAAO,IAAA,0BAAW,EAAC;YACjB,GAAG,EAAE,GAAG,uBAAA,IAAI,oCAAkB,cAAc,OAAO,GAAG;YACtD,MAAM,EAAE,yBAAU,CAAC,GAAG;SACvB,CAAC,CAAA;IACJ,CAAC;CACF;;AAED,kBAAe,UAAU,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
const SafeApiKit_1 = __importDefault(require("./SafeApiKit"));
|
|
21
|
+
__exportStar(require("./types/safeTransactionServiceTypes"), exports);
|
|
22
|
+
exports.default = SafeApiKit_1.default;
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,8DAA2D;AAE3D,sEAAmD;AAEnD,kBAAe,oBAAU,CAAA"}
|