@underscore-finance/sdk 1.2.20-next.0 → 1.2.20-next.2
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/AGENTS.md +28 -18
- package/abis.json +23476 -12295
- package/dist/contracts/Addys.d.ts +124 -0
- package/dist/contracts/Addys.d.ts.map +1 -0
- package/dist/contracts/Addys.js +134 -0
- package/dist/contracts/AgentSenderGeneric.d.ts +795 -153
- package/dist/contracts/AgentSenderGeneric.d.ts.map +1 -1
- package/dist/contracts/AgentSenderGeneric.js +892 -97
- package/dist/contracts/AgentSenderSpecial.d.ts +127 -0
- package/dist/contracts/AgentSenderSpecial.d.ts.map +1 -1
- package/dist/contracts/AgentSenderSpecial.js +139 -0
- package/dist/contracts/AgentSenderSpecialAdmin.d.ts +984 -0
- package/dist/contracts/AgentSenderSpecialAdmin.d.ts.map +1 -0
- package/dist/contracts/AgentSenderSpecialAdmin.js +1185 -0
- package/dist/contracts/AgentSenderSpecialSigHelper.d.ts +1010 -75
- package/dist/contracts/AgentSenderSpecialSigHelper.d.ts.map +1 -1
- package/dist/contracts/AgentSenderSpecialSigHelper.js +1240 -0
- package/dist/contracts/AgentWrapper.d.ts +164 -6
- package/dist/contracts/AgentWrapper.d.ts.map +1 -1
- package/dist/contracts/AgentWrapper.js +219 -6
- package/dist/contracts/ChequeBook.d.ts +360 -204
- package/dist/contracts/ChequeBook.d.ts.map +1 -1
- package/dist/contracts/ChequeBook.js +507 -298
- package/dist/contracts/DefaultsLocal.d.ts +320 -0
- package/dist/contracts/DefaultsLocal.d.ts.map +1 -0
- package/dist/contracts/DefaultsLocal.js +350 -0
- package/dist/contracts/ERC20.d.ts +552 -27
- package/dist/contracts/ERC20.d.ts.map +1 -1
- package/dist/contracts/ERC20.js +713 -66
- package/dist/contracts/EarnVault.d.ts +284 -255
- package/dist/contracts/EarnVault.d.ts.map +1 -1
- package/dist/contracts/EarnVault.js +488 -456
- package/dist/contracts/EarnVaultAgent.d.ts +127 -0
- package/dist/contracts/EarnVaultAgent.d.ts.map +1 -1
- package/dist/contracts/EarnVaultAgent.js +139 -0
- package/dist/contracts/EarnVaultWallet.d.ts +777 -0
- package/dist/contracts/EarnVaultWallet.d.ts.map +1 -0
- package/dist/contracts/EarnVaultWallet.js +987 -0
- package/dist/contracts/Erc20Token.d.ts +813 -0
- package/dist/contracts/Erc20Token.d.ts.map +1 -0
- package/dist/contracts/Erc20Token.js +1006 -0
- package/dist/contracts/HighCommand.d.ts +40 -0
- package/dist/contracts/HighCommand.d.ts.map +1 -1
- package/dist/contracts/HighCommand.js +45 -0
- package/dist/contracts/Kernel.d.ts +4 -0
- package/dist/contracts/Kernel.d.ts.map +1 -1
- package/dist/contracts/Kernel.js +4 -0
- package/dist/contracts/Ledger.d.ts +4 -75
- package/dist/contracts/Ledger.d.ts.map +1 -1
- package/dist/contracts/Ledger.js +4 -99
- package/dist/contracts/LevgVault.d.ts +299 -299
- package/dist/contracts/LevgVault.d.ts.map +1 -1
- package/dist/contracts/LevgVault.js +530 -530
- package/dist/contracts/LevgVaultAgent.d.ts +127 -69
- package/dist/contracts/LevgVaultAgent.d.ts.map +1 -1
- package/dist/contracts/LevgVaultAgent.js +134 -79
- package/dist/contracts/LevgVaultWallet.d.ts +1119 -0
- package/dist/contracts/LevgVaultWallet.d.ts.map +1 -0
- package/dist/contracts/LevgVaultWallet.js +1439 -0
- package/dist/contracts/LocalGov.d.ts +427 -0
- package/dist/contracts/LocalGov.d.ts.map +1 -0
- package/dist/contracts/LocalGov.js +507 -0
- package/dist/contracts/Migrator.d.ts +160 -0
- package/dist/contracts/Migrator.d.ts.map +1 -1
- package/dist/contracts/Migrator.js +187 -0
- package/dist/contracts/Ownership.d.ts +414 -0
- package/dist/contracts/Ownership.d.ts.map +1 -0
- package/dist/contracts/Ownership.js +472 -0
- package/dist/contracts/Paymaster.d.ts +119 -322
- package/dist/contracts/Paymaster.d.ts.map +1 -1
- package/dist/contracts/Paymaster.js +118 -404
- package/dist/contracts/Sentinel.d.ts +9 -6
- package/dist/contracts/Sentinel.d.ts.map +1 -1
- package/dist/contracts/Sentinel.js +8 -4
- package/dist/contracts/UndyToken.d.ts +821 -0
- package/dist/contracts/UndyToken.d.ts.map +1 -0
- package/dist/contracts/UndyToken.js +1017 -0
- package/dist/contracts/UserWalletConfig.d.ts +334 -317
- package/dist/contracts/UserWalletConfig.d.ts.map +1 -1
- package/dist/contracts/UserWalletConfig.js +391 -371
- package/dist/contracts/UserWalletSignatureHelper.d.ts +1520 -514
- package/dist/contracts/UserWalletSignatureHelper.d.ts.map +1 -1
- package/dist/contracts/UserWalletSignatureHelper.js +1906 -549
- package/dist/contracts/VaultErc20Token.d.ts +522 -0
- package/dist/contracts/VaultErc20Token.d.ts.map +1 -0
- package/dist/contracts/VaultErc20Token.js +658 -0
- package/dist/contracts/index.d.ts +10 -0
- package/dist/contracts/index.d.ts.map +1 -1
- package/dist/contracts/index.js +10 -0
- package/dist/contracts/sdk.d.ts +20 -0
- package/dist/contracts/sdk.d.ts.map +1 -1
- package/dist/contracts/sdk.js +20 -0
- package/package.json +1 -1
|
@@ -0,0 +1,472 @@
|
|
|
1
|
+
/* Autogenerated file. Do not edit manually. */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/* @ts-nocheck */
|
|
5
|
+
import { singleQuery, mutate } from '@dappql/async';
|
|
6
|
+
import { encodeEventTopics, parseEventLogs } from 'viem';
|
|
7
|
+
export const abi = [
|
|
8
|
+
{
|
|
9
|
+
"name": "OwnershipChangeInitiated",
|
|
10
|
+
"inputs": [
|
|
11
|
+
{
|
|
12
|
+
"name": "prevOwner",
|
|
13
|
+
"type": "address",
|
|
14
|
+
"indexed": true
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"name": "newOwner",
|
|
18
|
+
"type": "address",
|
|
19
|
+
"indexed": true
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"name": "confirmBlock",
|
|
23
|
+
"type": "uint256",
|
|
24
|
+
"indexed": false
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"anonymous": false,
|
|
28
|
+
"type": "event"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"name": "OwnershipChangeConfirmed",
|
|
32
|
+
"inputs": [
|
|
33
|
+
{
|
|
34
|
+
"name": "prevOwner",
|
|
35
|
+
"type": "address",
|
|
36
|
+
"indexed": true
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "newOwner",
|
|
40
|
+
"type": "address",
|
|
41
|
+
"indexed": true
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"name": "initiatedBlock",
|
|
45
|
+
"type": "uint256",
|
|
46
|
+
"indexed": false
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"name": "confirmBlock",
|
|
50
|
+
"type": "uint256",
|
|
51
|
+
"indexed": false
|
|
52
|
+
}
|
|
53
|
+
],
|
|
54
|
+
"anonymous": false,
|
|
55
|
+
"type": "event"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"name": "OwnershipChangeCancelled",
|
|
59
|
+
"inputs": [
|
|
60
|
+
{
|
|
61
|
+
"name": "cancelledOwner",
|
|
62
|
+
"type": "address",
|
|
63
|
+
"indexed": true
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"name": "cancelledBy",
|
|
67
|
+
"type": "address",
|
|
68
|
+
"indexed": true
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"name": "initiatedBlock",
|
|
72
|
+
"type": "uint256",
|
|
73
|
+
"indexed": false
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"name": "confirmBlock",
|
|
77
|
+
"type": "uint256",
|
|
78
|
+
"indexed": false
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
"anonymous": false,
|
|
82
|
+
"type": "event"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"name": "OwnershipTimeLockSet",
|
|
86
|
+
"inputs": [
|
|
87
|
+
{
|
|
88
|
+
"name": "numBlocks",
|
|
89
|
+
"type": "uint256",
|
|
90
|
+
"indexed": false
|
|
91
|
+
}
|
|
92
|
+
],
|
|
93
|
+
"anonymous": false,
|
|
94
|
+
"type": "event"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"name": "PendingOwnershipTimeLockSet",
|
|
98
|
+
"inputs": [
|
|
99
|
+
{
|
|
100
|
+
"name": "newTimeLock",
|
|
101
|
+
"type": "uint256",
|
|
102
|
+
"indexed": false
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"name": "initiatedBlock",
|
|
106
|
+
"type": "uint256",
|
|
107
|
+
"indexed": false
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"name": "confirmBlock",
|
|
111
|
+
"type": "uint256",
|
|
112
|
+
"indexed": false
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"name": "currentOwner",
|
|
116
|
+
"type": "address",
|
|
117
|
+
"indexed": true
|
|
118
|
+
}
|
|
119
|
+
],
|
|
120
|
+
"anonymous": false,
|
|
121
|
+
"type": "event"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"name": "PendingOwnershipTimeLockConfirmed",
|
|
125
|
+
"inputs": [
|
|
126
|
+
{
|
|
127
|
+
"name": "oldTimeLock",
|
|
128
|
+
"type": "uint256",
|
|
129
|
+
"indexed": false
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"name": "newTimeLock",
|
|
133
|
+
"type": "uint256",
|
|
134
|
+
"indexed": false
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"name": "initiatedBlock",
|
|
138
|
+
"type": "uint256",
|
|
139
|
+
"indexed": false
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"name": "confirmBlock",
|
|
143
|
+
"type": "uint256",
|
|
144
|
+
"indexed": false
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"name": "confirmedBy",
|
|
148
|
+
"type": "address",
|
|
149
|
+
"indexed": true
|
|
150
|
+
}
|
|
151
|
+
],
|
|
152
|
+
"anonymous": false,
|
|
153
|
+
"type": "event"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"name": "PendingOwnershipTimeLockCancelled",
|
|
157
|
+
"inputs": [
|
|
158
|
+
{
|
|
159
|
+
"name": "newTimeLock",
|
|
160
|
+
"type": "uint256",
|
|
161
|
+
"indexed": false
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"name": "initiatedBlock",
|
|
165
|
+
"type": "uint256",
|
|
166
|
+
"indexed": false
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"name": "confirmBlock",
|
|
170
|
+
"type": "uint256",
|
|
171
|
+
"indexed": false
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"name": "cancelledBy",
|
|
175
|
+
"type": "address",
|
|
176
|
+
"indexed": true
|
|
177
|
+
}
|
|
178
|
+
],
|
|
179
|
+
"anonymous": false,
|
|
180
|
+
"type": "event"
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"stateMutability": "nonpayable",
|
|
184
|
+
"type": "function",
|
|
185
|
+
"name": "changeOwnership",
|
|
186
|
+
"inputs": [
|
|
187
|
+
{
|
|
188
|
+
"name": "_newOwner",
|
|
189
|
+
"type": "address"
|
|
190
|
+
}
|
|
191
|
+
],
|
|
192
|
+
"outputs": []
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"stateMutability": "nonpayable",
|
|
196
|
+
"type": "function",
|
|
197
|
+
"name": "confirmOwnershipChange",
|
|
198
|
+
"inputs": [],
|
|
199
|
+
"outputs": []
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"stateMutability": "nonpayable",
|
|
203
|
+
"type": "function",
|
|
204
|
+
"name": "cancelOwnershipChange",
|
|
205
|
+
"inputs": [],
|
|
206
|
+
"outputs": []
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"stateMutability": "view",
|
|
210
|
+
"type": "function",
|
|
211
|
+
"name": "hasPendingOwnerChange",
|
|
212
|
+
"inputs": [],
|
|
213
|
+
"outputs": [
|
|
214
|
+
{
|
|
215
|
+
"name": "",
|
|
216
|
+
"type": "bool"
|
|
217
|
+
}
|
|
218
|
+
]
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"stateMutability": "nonpayable",
|
|
222
|
+
"type": "function",
|
|
223
|
+
"name": "setOwnershipTimeLock",
|
|
224
|
+
"inputs": [
|
|
225
|
+
{
|
|
226
|
+
"name": "_numBlocks",
|
|
227
|
+
"type": "uint256"
|
|
228
|
+
}
|
|
229
|
+
],
|
|
230
|
+
"outputs": []
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
"stateMutability": "nonpayable",
|
|
234
|
+
"type": "function",
|
|
235
|
+
"name": "confirmPendingOwnershipTimeLock",
|
|
236
|
+
"inputs": [],
|
|
237
|
+
"outputs": []
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
"stateMutability": "nonpayable",
|
|
241
|
+
"type": "function",
|
|
242
|
+
"name": "cancelPendingOwnershipTimeLock",
|
|
243
|
+
"inputs": [],
|
|
244
|
+
"outputs": []
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
"stateMutability": "view",
|
|
248
|
+
"type": "function",
|
|
249
|
+
"name": "owner",
|
|
250
|
+
"inputs": [],
|
|
251
|
+
"outputs": [
|
|
252
|
+
{
|
|
253
|
+
"name": "",
|
|
254
|
+
"type": "address"
|
|
255
|
+
}
|
|
256
|
+
]
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
"stateMutability": "view",
|
|
260
|
+
"type": "function",
|
|
261
|
+
"name": "ownershipTimeLock",
|
|
262
|
+
"inputs": [],
|
|
263
|
+
"outputs": [
|
|
264
|
+
{
|
|
265
|
+
"name": "",
|
|
266
|
+
"type": "uint256"
|
|
267
|
+
}
|
|
268
|
+
]
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
"stateMutability": "view",
|
|
272
|
+
"type": "function",
|
|
273
|
+
"name": "pendingOwner",
|
|
274
|
+
"inputs": [],
|
|
275
|
+
"outputs": [
|
|
276
|
+
{
|
|
277
|
+
"name": "",
|
|
278
|
+
"type": "tuple",
|
|
279
|
+
"components": [
|
|
280
|
+
{
|
|
281
|
+
"name": "newOwner",
|
|
282
|
+
"type": "address"
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
"name": "initiatedBlock",
|
|
286
|
+
"type": "uint256"
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
"name": "confirmBlock",
|
|
290
|
+
"type": "uint256"
|
|
291
|
+
}
|
|
292
|
+
]
|
|
293
|
+
}
|
|
294
|
+
]
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
"stateMutability": "view",
|
|
298
|
+
"type": "function",
|
|
299
|
+
"name": "pendingOwnershipTimeLock",
|
|
300
|
+
"inputs": [],
|
|
301
|
+
"outputs": [
|
|
302
|
+
{
|
|
303
|
+
"name": "",
|
|
304
|
+
"type": "tuple",
|
|
305
|
+
"components": [
|
|
306
|
+
{
|
|
307
|
+
"name": "newTimeLock",
|
|
308
|
+
"type": "uint256"
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
"name": "initiatedBlock",
|
|
312
|
+
"type": "uint256"
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
"name": "confirmBlock",
|
|
316
|
+
"type": "uint256"
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
"name": "currentOwner",
|
|
320
|
+
"type": "address"
|
|
321
|
+
}
|
|
322
|
+
]
|
|
323
|
+
}
|
|
324
|
+
]
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
"stateMutability": "view",
|
|
328
|
+
"type": "function",
|
|
329
|
+
"name": "MIN_OWNERSHIP_TIMELOCK",
|
|
330
|
+
"inputs": [],
|
|
331
|
+
"outputs": [
|
|
332
|
+
{
|
|
333
|
+
"name": "",
|
|
334
|
+
"type": "uint256"
|
|
335
|
+
}
|
|
336
|
+
]
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
"stateMutability": "view",
|
|
340
|
+
"type": "function",
|
|
341
|
+
"name": "MAX_OWNERSHIP_TIMELOCK",
|
|
342
|
+
"inputs": [],
|
|
343
|
+
"outputs": [
|
|
344
|
+
{
|
|
345
|
+
"name": "",
|
|
346
|
+
"type": "uint256"
|
|
347
|
+
}
|
|
348
|
+
]
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
"stateMutability": "nonpayable",
|
|
352
|
+
"type": "constructor",
|
|
353
|
+
"inputs": [
|
|
354
|
+
{
|
|
355
|
+
"name": "_undyHq",
|
|
356
|
+
"type": "address"
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
"name": "_owner",
|
|
360
|
+
"type": "address"
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
"name": "_minTimeLock",
|
|
364
|
+
"type": "uint256"
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
"name": "_maxTimeLock",
|
|
368
|
+
"type": "uint256"
|
|
369
|
+
}
|
|
370
|
+
],
|
|
371
|
+
"outputs": []
|
|
372
|
+
}
|
|
373
|
+
];
|
|
374
|
+
export const deployAddress = undefined;
|
|
375
|
+
function getRequest(method, args, contractAddressOrOptions) {
|
|
376
|
+
const address = typeof contractAddressOrOptions === 'string' ? contractAddressOrOptions : contractAddressOrOptions?.contractAddress;
|
|
377
|
+
const defaultValue = typeof contractAddressOrOptions === 'string' ? undefined : contractAddressOrOptions?.defaultValue;
|
|
378
|
+
const call = {
|
|
379
|
+
contractName: 'Ownership',
|
|
380
|
+
method,
|
|
381
|
+
args,
|
|
382
|
+
address,
|
|
383
|
+
deployAddress,
|
|
384
|
+
defaultValue,
|
|
385
|
+
getAbi: () => abi,
|
|
386
|
+
with: (options) => {
|
|
387
|
+
call.address = options.contractAddress;
|
|
388
|
+
call.defaultValue = options.defaultValue;
|
|
389
|
+
return call;
|
|
390
|
+
},
|
|
391
|
+
defaultTo: (defaultValue) => {
|
|
392
|
+
call.defaultValue = defaultValue;
|
|
393
|
+
return call;
|
|
394
|
+
},
|
|
395
|
+
at: (address) => {
|
|
396
|
+
call.address = address;
|
|
397
|
+
return call;
|
|
398
|
+
},
|
|
399
|
+
};
|
|
400
|
+
return call;
|
|
401
|
+
}
|
|
402
|
+
export const call = {
|
|
403
|
+
hasPendingOwnerChange: (...args) => getRequest('hasPendingOwnerChange', args),
|
|
404
|
+
owner: (...args) => getRequest('owner', args),
|
|
405
|
+
ownershipTimeLock: (...args) => getRequest('ownershipTimeLock', args),
|
|
406
|
+
pendingOwner: (...args) => getRequest('pendingOwner', args),
|
|
407
|
+
pendingOwnershipTimeLock: (...args) => getRequest('pendingOwnershipTimeLock', args),
|
|
408
|
+
MIN_OWNERSHIP_TIMELOCK: (...args) => getRequest('MIN_OWNERSHIP_TIMELOCK', args),
|
|
409
|
+
MAX_OWNERSHIP_TIMELOCK: (...args) => getRequest('MAX_OWNERSHIP_TIMELOCK', args),
|
|
410
|
+
};
|
|
411
|
+
function getMutation(functionName) {
|
|
412
|
+
return {
|
|
413
|
+
contractName: 'Ownership',
|
|
414
|
+
functionName,
|
|
415
|
+
deployAddress,
|
|
416
|
+
argsType: undefined,
|
|
417
|
+
getAbi: () => abi,
|
|
418
|
+
};
|
|
419
|
+
}
|
|
420
|
+
export const mutation = {
|
|
421
|
+
changeOwnership: getMutation('changeOwnership'),
|
|
422
|
+
confirmOwnershipChange: getMutation('confirmOwnershipChange'),
|
|
423
|
+
cancelOwnershipChange: getMutation('cancelOwnershipChange'),
|
|
424
|
+
setOwnershipTimeLock: getMutation('setOwnershipTimeLock'),
|
|
425
|
+
confirmPendingOwnershipTimeLock: getMutation('confirmPendingOwnershipTimeLock'),
|
|
426
|
+
cancelPendingOwnershipTimeLock: getMutation('cancelPendingOwnershipTimeLock'),
|
|
427
|
+
};
|
|
428
|
+
export function parseEvents(eventName, events) {
|
|
429
|
+
return events.map((event) => {
|
|
430
|
+
return {
|
|
431
|
+
event,
|
|
432
|
+
parsed: parseEventLogs({
|
|
433
|
+
abi,
|
|
434
|
+
eventName,
|
|
435
|
+
logs: [event],
|
|
436
|
+
}),
|
|
437
|
+
};
|
|
438
|
+
});
|
|
439
|
+
}
|
|
440
|
+
export function getEventTopic(eventName) {
|
|
441
|
+
return encodeEventTopics({ abi, eventName })[0];
|
|
442
|
+
}
|
|
443
|
+
export function toSdk(deployAddress, publicClient, walletClient, addressResolver) {
|
|
444
|
+
return {
|
|
445
|
+
deployAddress,
|
|
446
|
+
abi,
|
|
447
|
+
events: {
|
|
448
|
+
OwnershipChangeInitiated: { topic: getEventTopic('OwnershipChangeInitiated'), parse: (events) => parseEvents('OwnershipChangeInitiated', events) },
|
|
449
|
+
OwnershipChangeConfirmed: { topic: getEventTopic('OwnershipChangeConfirmed'), parse: (events) => parseEvents('OwnershipChangeConfirmed', events) },
|
|
450
|
+
OwnershipChangeCancelled: { topic: getEventTopic('OwnershipChangeCancelled'), parse: (events) => parseEvents('OwnershipChangeCancelled', events) },
|
|
451
|
+
OwnershipTimeLockSet: { topic: getEventTopic('OwnershipTimeLockSet'), parse: (events) => parseEvents('OwnershipTimeLockSet', events) },
|
|
452
|
+
PendingOwnershipTimeLockSet: { topic: getEventTopic('PendingOwnershipTimeLockSet'), parse: (events) => parseEvents('PendingOwnershipTimeLockSet', events) },
|
|
453
|
+
PendingOwnershipTimeLockConfirmed: { topic: getEventTopic('PendingOwnershipTimeLockConfirmed'), parse: (events) => parseEvents('PendingOwnershipTimeLockConfirmed', events) },
|
|
454
|
+
PendingOwnershipTimeLockCancelled: { topic: getEventTopic('PendingOwnershipTimeLockCancelled'), parse: (events) => parseEvents('PendingOwnershipTimeLockCancelled', events) },
|
|
455
|
+
},
|
|
456
|
+
// Queries
|
|
457
|
+
hasPendingOwnerChange: (...args) => singleQuery(publicClient, call.hasPendingOwnerChange(...args).at(deployAddress), {}, addressResolver),
|
|
458
|
+
owner: (...args) => singleQuery(publicClient, call.owner(...args).at(deployAddress), {}, addressResolver),
|
|
459
|
+
ownershipTimeLock: (...args) => singleQuery(publicClient, call.ownershipTimeLock(...args).at(deployAddress), {}, addressResolver),
|
|
460
|
+
pendingOwner: (...args) => singleQuery(publicClient, call.pendingOwner(...args).at(deployAddress), {}, addressResolver),
|
|
461
|
+
pendingOwnershipTimeLock: (...args) => singleQuery(publicClient, call.pendingOwnershipTimeLock(...args).at(deployAddress), {}, addressResolver),
|
|
462
|
+
MIN_OWNERSHIP_TIMELOCK: (...args) => singleQuery(publicClient, call.MIN_OWNERSHIP_TIMELOCK(...args).at(deployAddress), {}, addressResolver),
|
|
463
|
+
MAX_OWNERSHIP_TIMELOCK: (...args) => singleQuery(publicClient, call.MAX_OWNERSHIP_TIMELOCK(...args).at(deployAddress), {}, addressResolver),
|
|
464
|
+
// Mutations
|
|
465
|
+
changeOwnership: (...args) => mutate(walletClient, mutation.changeOwnership, { address: deployAddress, addressResolver })(...args),
|
|
466
|
+
confirmOwnershipChange: (...args) => mutate(walletClient, mutation.confirmOwnershipChange, { address: deployAddress, addressResolver })(...args),
|
|
467
|
+
cancelOwnershipChange: (...args) => mutate(walletClient, mutation.cancelOwnershipChange, { address: deployAddress, addressResolver })(...args),
|
|
468
|
+
setOwnershipTimeLock: (...args) => mutate(walletClient, mutation.setOwnershipTimeLock, { address: deployAddress, addressResolver })(...args),
|
|
469
|
+
confirmPendingOwnershipTimeLock: (...args) => mutate(walletClient, mutation.confirmPendingOwnershipTimeLock, { address: deployAddress, addressResolver })(...args),
|
|
470
|
+
cancelPendingOwnershipTimeLock: (...args) => mutate(walletClient, mutation.cancelPendingOwnershipTimeLock, { address: deployAddress, addressResolver })(...args),
|
|
471
|
+
};
|
|
472
|
+
}
|