@defisaver/sdk 1.3.32 → 1.3.34

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.
@@ -22,10 +22,6 @@ export const UtilsAccessLists : AccessLists = {
22
22
 
23
23
  SubInputs: [],
24
24
 
25
- ChangeProxyOwner: [
26
- ['0xF8f8B3C98Cf2E63Df3041b73f80F362a4cf3A576', []], // DFSProxyRegistryController
27
- ],
28
-
29
25
  TokenBalance: [],
30
26
 
31
27
  AutomationV2Unsub: [
@@ -13,9 +13,6 @@ export const UtilsAccessLists = {
13
13
  PullToken: [],
14
14
  SumInputs: [],
15
15
  SubInputs: [],
16
- ChangeProxyOwner: [
17
- ['0xF8f8B3C98Cf2E63Df3041b73f80F362a4cf3A576', []], // DFSProxyRegistryController
18
- ],
19
16
  TokenBalance: [],
20
17
  AutomationV2Unsub: [
21
18
  ['0x5c55B921f590a89C1Ebe84dF170E655a82b62126', []], // DefisaverLogger
@@ -34,6 +34,7 @@ export class DfsWeb3 {
34
34
  throw new Error('Method not implemented.');
35
35
  }
36
36
  prepareAccount() {
37
+ var _a, _b, _c;
37
38
  return __awaiter(this, void 0, void 0, function* () {
38
39
  const accounts = yield this.web3.eth.getAccounts();
39
40
  if (!accounts || !accounts.length)
@@ -42,8 +43,15 @@ export class DfsWeb3 {
42
43
  const DFSPRoxyRegistyAbiItems = DFSPRoxyRegistyAbi.map(item => (Object.assign(Object.assign({}, item), { stateMutability: item.stateMutability, type: item.type })));
43
44
  const dfsRegistry = new this.web3.eth.Contract(DFSPRoxyRegistyAbiItems, getAddr('DFSProxyRegistry', CONFIG.chainId));
44
45
  const proxies = yield dfsRegistry.methods.getAllProxies(this.account).call();
45
- if (proxies[0] !== '0x0000000000000000000000000000000000000000') {
46
- this.proxy = proxies[0];
46
+ const mcdProxy = (_a = proxies.mcdProxy) !== null && _a !== void 0 ? _a : proxies[0];
47
+ const additionalProxies = (_c = (_b = proxies.validAdditionalProxies) !== null && _b !== void 0 ? _b : proxies[1]) !== null && _c !== void 0 ? _c : [];
48
+ // DFSProxyRegistryV2 only returns mcdProxy when Maker registry still matches current owner.
49
+ // Ownership-transferred wallets show up in validAdditionalProxies instead.
50
+ if (mcdProxy && mcdProxy !== '0x0000000000000000000000000000000000000000') {
51
+ this.proxy = mcdProxy;
52
+ }
53
+ else if (additionalProxies.length > 0) {
54
+ this.proxy = additionalProxies[0];
47
55
  }
48
56
  this.accountReady = true;
49
57
  });
@@ -3,50 +3,144 @@
3
3
  "inputs": [
4
4
  {
5
5
  "internalType": "address",
6
- "name": "_user",
6
+ "name": "proxy",
7
+ "type": "address"
8
+ }
9
+ ],
10
+ "name": "InvalidDSProxy",
11
+ "type": "error"
12
+ },
13
+ {
14
+ "inputs": [],
15
+ "name": "NonContractCall",
16
+ "type": "error"
17
+ },
18
+ {
19
+ "inputs": [],
20
+ "name": "SenderNotAdmin",
21
+ "type": "error"
22
+ },
23
+ {
24
+ "inputs": [],
25
+ "name": "SenderNotOwner",
26
+ "type": "error"
27
+ },
28
+ {
29
+ "inputs": [
30
+ {
31
+ "internalType": "address",
32
+ "name": "sender",
7
33
  "type": "address"
8
34
  },
9
35
  {
10
36
  "internalType": "address",
11
- "name": "_proxy",
37
+ "name": "user",
12
38
  "type": "address"
13
39
  }
14
40
  ],
15
- "name": "addAdditionalProxy",
16
- "outputs": [],
17
- "stateMutability": "nonpayable",
18
- "type": "function"
41
+ "name": "SenderNotUserOrOwner",
42
+ "type": "error"
19
43
  },
20
44
  {
45
+ "anonymous": false,
21
46
  "inputs": [
22
47
  {
48
+ "indexed": true,
23
49
  "internalType": "address",
24
- "name": "",
50
+ "name": "user",
25
51
  "type": "address"
26
52
  },
27
53
  {
28
- "internalType": "uint256",
29
- "name": "",
30
- "type": "uint256"
54
+ "indexed": true,
55
+ "internalType": "address",
56
+ "name": "proxy",
57
+ "type": "address"
31
58
  }
32
59
  ],
33
- "name": "additionalProxies",
34
- "outputs": [
60
+ "name": "AdditionalProxyAdded",
61
+ "type": "event"
62
+ },
63
+ {
64
+ "anonymous": false,
65
+ "inputs": [
35
66
  {
67
+ "indexed": true,
36
68
  "internalType": "address",
37
- "name": "",
69
+ "name": "user",
70
+ "type": "address"
71
+ },
72
+ {
73
+ "indexed": true,
74
+ "internalType": "address",
75
+ "name": "proxy",
38
76
  "type": "address"
39
77
  }
40
78
  ],
41
- "stateMutability": "view",
42
- "type": "function"
79
+ "name": "AdditionalProxyRemoved",
80
+ "type": "event"
81
+ },
82
+ {
83
+ "anonymous": false,
84
+ "inputs": [
85
+ {
86
+ "indexed": true,
87
+ "internalType": "address",
88
+ "name": "user",
89
+ "type": "address"
90
+ },
91
+ {
92
+ "indexed": true,
93
+ "internalType": "address",
94
+ "name": "proxy",
95
+ "type": "address"
96
+ },
97
+ {
98
+ "indexed": true,
99
+ "internalType": "address",
100
+ "name": "caller",
101
+ "type": "address"
102
+ },
103
+ {
104
+ "indexed": false,
105
+ "internalType": "bool",
106
+ "name": "excluded",
107
+ "type": "bool"
108
+ }
109
+ ],
110
+ "name": "ProxyExclusionUpdated",
111
+ "type": "event"
112
+ },
113
+ {
114
+ "anonymous": false,
115
+ "inputs": [
116
+ {
117
+ "indexed": true,
118
+ "internalType": "address",
119
+ "name": "proxy",
120
+ "type": "address"
121
+ },
122
+ {
123
+ "indexed": true,
124
+ "internalType": "address",
125
+ "name": "oldOwner",
126
+ "type": "address"
127
+ },
128
+ {
129
+ "indexed": true,
130
+ "internalType": "address",
131
+ "name": "newOwner",
132
+ "type": "address"
133
+ }
134
+ ],
135
+ "name": "ProxySynced",
136
+ "type": "event"
43
137
  },
44
138
  {
45
139
  "inputs": [],
46
- "name": "adminVault",
140
+ "name": "MCD_REGISTRY",
47
141
  "outputs": [
48
142
  {
49
- "internalType": "contract AdminVault",
143
+ "internalType": "contract IDSProxyRegistry",
50
144
  "name": "",
51
145
  "type": "address"
52
146
  }
@@ -58,47 +152,82 @@
58
152
  "inputs": [
59
153
  {
60
154
  "internalType": "address",
61
- "name": "_newAdminVault",
155
+ "name": "user",
62
156
  "type": "address"
157
+ },
158
+ {
159
+ "internalType": "uint256",
160
+ "name": "",
161
+ "type": "uint256"
63
162
  }
64
163
  ],
65
- "name": "changeAdminVault",
66
- "outputs": [],
67
- "stateMutability": "nonpayable",
164
+ "name": "additionalProxies",
165
+ "outputs": [
166
+ {
167
+ "internalType": "address",
168
+ "name": "proxies",
169
+ "type": "address"
170
+ }
171
+ ],
172
+ "stateMutability": "view",
68
173
  "type": "function"
69
174
  },
70
175
  {
71
176
  "inputs": [
72
177
  {
73
178
  "internalType": "address",
74
- "name": "_user",
179
+ "name": "user",
75
180
  "type": "address"
76
181
  },
77
182
  {
78
183
  "internalType": "address",
79
- "name": "_proxy",
184
+ "name": "proxy",
80
185
  "type": "address"
81
186
  }
82
187
  ],
83
- "name": "changeMcdOwner",
84
- "outputs": [],
85
- "stateMutability": "nonpayable",
188
+ "name": "additionalProxyIndex",
189
+ "outputs": [
190
+ {
191
+ "internalType": "uint256",
192
+ "name": "indexPlusOne",
193
+ "type": "uint256"
194
+ }
195
+ ],
196
+ "stateMutability": "view",
197
+ "type": "function"
198
+ },
199
+ {
200
+ "inputs": [],
201
+ "name": "adminVault",
202
+ "outputs": [
203
+ {
204
+ "internalType": "contract IAdminVault",
205
+ "name": "",
206
+ "type": "address"
207
+ }
208
+ ],
209
+ "stateMutability": "view",
86
210
  "type": "function"
87
211
  },
88
212
  {
89
213
  "inputs": [
90
214
  {
91
215
  "internalType": "address",
92
- "name": "",
216
+ "name": "_user",
93
217
  "type": "address"
94
218
  }
95
219
  ],
96
- "name": "changedOwners",
220
+ "name": "getAllProxies",
97
221
  "outputs": [
98
222
  {
99
223
  "internalType": "address",
100
- "name": "",
224
+ "name": "mcdProxy",
101
225
  "type": "address"
226
+ },
227
+ {
228
+ "internalType": "address[]",
229
+ "name": "validAdditionalProxies",
230
+ "type": "address[]"
102
231
  }
103
232
  ],
104
233
  "stateMutability": "view",
@@ -112,20 +241,33 @@
112
241
  "type": "address"
113
242
  }
114
243
  ],
115
- "name": "getAllProxies",
244
+ "name": "getMcdProxy",
116
245
  "outputs": [
117
246
  {
118
247
  "internalType": "address",
119
- "name": "",
248
+ "name": "proxy",
249
+ "type": "address"
250
+ }
251
+ ],
252
+ "stateMutability": "view",
253
+ "type": "function"
254
+ },
255
+ {
256
+ "inputs": [
257
+ {
258
+ "internalType": "address",
259
+ "name": "_user",
120
260
  "type": "address"
121
261
  },
122
262
  {
123
263
  "internalType": "address[]",
124
- "name": "",
264
+ "name": "_proxies",
125
265
  "type": "address[]"
126
266
  }
127
267
  ],
128
- "stateMutability": "view",
268
+ "name": "removeAdditionalProxies",
269
+ "outputs": [],
270
+ "stateMutability": "nonpayable",
129
271
  "type": "function"
130
272
  },
131
273
  {
@@ -134,33 +276,99 @@
134
276
  "internalType": "address",
135
277
  "name": "_user",
136
278
  "type": "address"
279
+ },
280
+ {
281
+ "internalType": "address",
282
+ "name": "_proxy",
283
+ "type": "address"
137
284
  }
138
285
  ],
139
- "name": "getMcdProxy",
140
- "outputs": [
286
+ "name": "removeAdditionalProxy",
287
+ "outputs": [],
288
+ "stateMutability": "nonpayable",
289
+ "type": "function"
290
+ },
291
+ {
292
+ "inputs": [
141
293
  {
142
294
  "internalType": "address",
143
- "name": "",
295
+ "name": "user",
296
+ "type": "address"
297
+ },
298
+ {
299
+ "internalType": "address",
300
+ "name": "proxy",
144
301
  "type": "address"
145
302
  }
146
303
  ],
304
+ "name": "removedProxies",
305
+ "outputs": [
306
+ {
307
+ "internalType": "bool",
308
+ "name": "removed",
309
+ "type": "bool"
310
+ }
311
+ ],
147
312
  "stateMutability": "view",
148
313
  "type": "function"
149
314
  },
150
315
  {
151
- "inputs": [],
152
- "name": "kill",
316
+ "inputs": [
317
+ {
318
+ "internalType": "address",
319
+ "name": "_user",
320
+ "type": "address"
321
+ },
322
+ {
323
+ "internalType": "address",
324
+ "name": "_proxy",
325
+ "type": "address"
326
+ }
327
+ ],
328
+ "name": "restoreAdditionalProxy",
153
329
  "outputs": [],
154
330
  "stateMutability": "nonpayable",
155
331
  "type": "function"
156
332
  },
157
333
  {
158
- "inputs": [],
159
- "name": "mcdRegistry",
334
+ "inputs": [
335
+ {
336
+ "internalType": "address[]",
337
+ "name": "_proxies",
338
+ "type": "address[]"
339
+ }
340
+ ],
341
+ "name": "syncProxies",
342
+ "outputs": [],
343
+ "stateMutability": "nonpayable",
344
+ "type": "function"
345
+ },
346
+ {
347
+ "inputs": [
348
+ {
349
+ "internalType": "address",
350
+ "name": "_proxy",
351
+ "type": "address"
352
+ }
353
+ ],
354
+ "name": "syncProxy",
355
+ "outputs": [],
356
+ "stateMutability": "nonpayable",
357
+ "type": "function"
358
+ },
359
+ {
360
+ "inputs": [
361
+ {
362
+ "internalType": "address",
363
+ "name": "proxy",
364
+ "type": "address"
365
+ }
366
+ ],
367
+ "name": "trackedOwner",
160
368
  "outputs": [
161
369
  {
162
- "internalType": "contract IProxyRegistry",
163
- "name": "",
370
+ "internalType": "address",
371
+ "name": "owner",
164
372
  "type": "address"
165
373
  }
166
374
  ],
@@ -9,7 +9,7 @@ export const actionAddresses = {
9
9
  SendTokens: '0x7d05c0ABeF6d91300a237026507c4a2631ddAdEa',
10
10
  SumInputs: '0x70907d840aBBc984Fd949311d2f005e6aC4a4D7a',
11
11
  SubInputs: '0xe1804b756188F63f723d2FECc02988D0Cc1aB823',
12
- ChangeProxyOwner: '0x81cA52CfE66421d0ceF82d5F33230e43b5F23D2B',
12
+ ChangeProxyOwner: '0x1cc4A7f6B17a4C900F2afe4A0718A73714AC33f2',
13
13
  TokenBalance: '0xa92B177950F1460119940436515FD857C24494BC',
14
14
  AutomationV2Unsub: '0xe35Fb12fE9796847751076aCf5ee7d124108612C',
15
15
  SendTokenAndUnwrap: '0x4155537e6933E59a62deb68f6ad93d237d07242a',
@@ -357,7 +357,7 @@ export const actionAddresses = {
357
357
  CreateSub: '0x2daED8030BFC87B3d27c02E2f044B9CF4841Ff3e',
358
358
  TokenBalance: '0xC6FF5b01f7c7b35b6e093fF70D2332B361C5Be5A',
359
359
  TokenizedVaultAdapter: '0xdf31669FEd440f5BfF658ca0bBF0D22B8abdeb73',
360
- ChangeProxyOwner: '0x62769258ea8b3a85cc6fb4332fc2760a122dbc9e',
360
+ ChangeProxyOwner: '0xf573585C38d947D8A70F7F6c83D060F1F89855AE',
361
361
  PermitToken: '0xE70c05125E7Cfe929f7ccC1baD348004aCF0f0d6',
362
362
  HandleAuth: '0x7f143607250ee51e4dce31254c8ad33ec4c2dad5',
363
363
  MerklClaim: '0xa7574a72D93D236040648b1dc80ddA3E7A4de40F',
@@ -418,7 +418,7 @@ export const actionAddresses = {
418
418
  CreateSub: '0xbFD17a0a844b75976585a382a5BcCaFC9EAd731f',
419
419
  TokenBalance: '0x483B903E702F60698Dd8124558C6199922737f1F',
420
420
  TokenizedVaultAdapter: '0xD05C512bDFf6D3eAc5328807B3bC075F35271167',
421
- ChangeProxyOwner: '0x29F66A5fcB601c806E7156f29FDEC771BdC9c08d',
421
+ ChangeProxyOwner: '0xacf5bAD9543A98EcAcC620cF6CB989Ec88f1650D',
422
422
  PermitToken: '0x2E5E7a691092C158bb8341b936eF24FCcA6c0e00',
423
423
  HandleAuth: '0xbfcab1339e1a56a0a836cbca6457eaf71f148fcb',
424
424
  UpdateSub: '0x3511f444362F8cBd185DbF21C9488D16c1306461',
@@ -515,7 +515,7 @@ export const actionAddresses = {
515
515
  SumInputs: '0xC856ef8fe425B2EFe373e0e7038fAFF4a4f764fE',
516
516
  SubInputs: '0xd244B1991Fcb8FC0f32FA55bce37714fc5929B95',
517
517
  TokenBalance: '0xc44bcE580B1b3339fE9272D3bC3d6566083ea59C',
518
- ChangeProxyOwner: '0x1947a44d3717a47556175d64fdc208619aa08874',
518
+ ChangeProxyOwner: '0x7b55d25BfF49Fd62563823570f47E9a35AA39541',
519
519
  PermitToken: '0x57c8ae94a5A11dA33e0518054102488b604628D0',
520
520
  HandleAuth: '0x18a90e6db79199ace00140631ef931e0bd97837c',
521
521
  ToggleSub: '0x5F16C0a08d52b67fc73706c494F7535Dd3382b58',
@@ -679,7 +679,7 @@ export const otherAddresses = {
679
679
  [NETWORKS.ethereum.chainId]: {
680
680
  RecipeExecutor: '0xbc3Fc959FeF3F12a41738f406c02198cdeE7481F',
681
681
  DFSRegistry: '0x287778F121F134C66212FB16c9b53eC991D32f5b',
682
- DFSProxyRegistry: '0x29474FdaC7142f9aB7773B8e38264FA15E3805ed',
682
+ DFSProxyRegistry: '0x0cCB1F91beb8590949880D2a61C26C11d6280319',
683
683
  ProxyRegistry: '0x4678f0a6958e4D2Bc4F1BAF7Bc52E8F3564f3fE4',
684
684
  SFProxyEntryPoint: '0xAa15ca459659F35B1064EC546A44d962d54bA89e',
685
685
  McdCdpManager: '0x5ef30b9986345249bc32d8928b7ee64de9435e39',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defisaver/sdk",
3
- "version": "1.3.32",
3
+ "version": "1.3.34",
4
4
  "description": "",
5
5
  "main": "./umd/index.js",
6
6
  "module": "./esm/src/index.js",
@@ -21,13 +21,41 @@
21
21
  "author": "DeFi Saver",
22
22
  "repository": "https://github.com/DecenterApps/defisaver-sdk",
23
23
  "license": "ISC",
24
+ "overrides": {
25
+ "tar": "^7.5.21",
26
+ "ws": "^8.18.3",
27
+ "form-data": "^4.0.4",
28
+ "tough-cookie": "^4.1.3",
29
+ "qs": "^6.14.0",
30
+ "serialize-javascript": "^7.1.0",
31
+ "fast-uri": "^3.1.6",
32
+ "js-yaml": "^4.3.2",
33
+ "eslint": {
34
+ "minimatch": "^3.1.5"
35
+ },
36
+ "@eslint/eslintrc": {
37
+ "minimatch": "^3.1.5"
38
+ },
39
+ "@humanwhocodes/config-array": {
40
+ "minimatch": "^3.1.5"
41
+ },
42
+ "eslint-plugin-import": {
43
+ "minimatch": "^3.1.5"
44
+ },
45
+ "eslint-plugin-jsx-a11y": {
46
+ "minimatch": "^3.1.5"
47
+ },
48
+ "eslint-plugin-react": {
49
+ "minimatch": "^3.1.5"
50
+ }
51
+ },
24
52
  "dependencies": {
25
53
  "@defisaver/eslint-config": "^1.0.0",
26
54
  "@defisaver/tokens": "^1.7.9",
27
55
  "@ethersproject/address": "^5.0.10",
28
56
  "@ethersproject/solidity": "^5.0.9",
29
57
  "@types/web3-eth-abi": "^1.2.2",
30
- "axios": "^0.21.1",
58
+ "axios": "^1.19.0",
31
59
  "decimal.js": "^10.2.1",
32
60
  "web3": "^1.10.1",
33
61
  "web3-eth-abi": "^1.8.0",
@@ -46,8 +74,8 @@
46
74
  "chai": "^4.2.0",
47
75
  "dotenv": "^10.0.0",
48
76
  "eslint": "^8.57.0",
49
- "jsdoc-to-markdown": "^6.0.1",
50
- "mocha": "^8.4.0",
77
+ "jsdoc-to-markdown": "^9.1.3",
78
+ "mocha": "^11.8.0",
51
79
  "ts-node": "^10.9.1",
52
80
  "typedoc": "^0.23.20",
53
81
  "typedoc-plugin-markdown": "^3.13.6",
package/src/DfsWeb3.ts CHANGED
@@ -47,8 +47,14 @@ export class DfsWeb3 {
47
47
  const DFSPRoxyRegistyAbiItems : AbiItem[] = DFSPRoxyRegistyAbi.map(item => ({ ...item, stateMutability: item.stateMutability as StateMutabilityType, type: item.type as AbiType }));
48
48
  const dfsRegistry = new this.web3.eth.Contract(DFSPRoxyRegistyAbiItems, getAddr('DFSProxyRegistry', CONFIG.chainId));
49
49
  const proxies = await dfsRegistry.methods.getAllProxies(this.account).call();
50
- if (proxies[0] !== '0x0000000000000000000000000000000000000000') {
51
- this.proxy = proxies[0];
50
+ const mcdProxy = proxies.mcdProxy ?? proxies[0];
51
+ const additionalProxies = proxies.validAdditionalProxies ?? proxies[1] ?? [];
52
+ // DFSProxyRegistryV2 only returns mcdProxy when Maker registry still matches current owner.
53
+ // Ownership-transferred wallets show up in validAdditionalProxies instead.
54
+ if (mcdProxy && mcdProxy !== '0x0000000000000000000000000000000000000000') {
55
+ this.proxy = mcdProxy;
56
+ } else if (additionalProxies.length > 0) {
57
+ this.proxy = additionalProxies[0];
52
58
  }
53
59
  this.accountReady = true;
54
60
  }