@gearbox-protocol/sdk 12.3.5 → 12.3.7
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/dist/cjs/dev/AccountOpener.js +2 -1
- package/dist/cjs/dev/ltUtils.js +2 -1
- package/dist/cjs/dev/migrateFaucet.js +2 -1
- package/dist/cjs/permissionless/bindings/compressors/token-compressor.js +6 -3
- package/dist/cjs/permissionless/bindings/market-configurator.js +4 -2
- package/dist/cjs/permissionless/bindings/price-feed-store.js +2 -1
- package/dist/cjs/plugins/accounts-counter/AccountsCounterPlugin.js +2 -1
- package/dist/cjs/plugins/bots/BotsPlugin.js +4 -2
- package/dist/cjs/plugins/delayed-withdrawal/DelayedWithdrawalPlugin.js +2 -1
- package/dist/cjs/plugins/pools-history/Pools7DAgoPlugin.js +2 -1
- package/dist/cjs/plugins/zappers/ZappersPlugin.js +2 -1
- package/dist/cjs/sdk/accounts/AbstractCreditAccountsService.js +2 -1
- package/dist/cjs/sdk/base/TokensMeta.js +2 -1
- package/dist/cjs/sdk/core/address-provider/createAddressProvider.js +11 -5
- package/dist/cjs/sdk/gauges/GaugeStakingService.js +2 -1
- package/dist/cjs/sdk/market/MarketConfiguratorContract.js +2 -1
- package/dist/cjs/sdk/sdk-legacy/gearboxRewards/api.js +2 -1
- package/dist/esm/dev/AccountOpener.js +2 -1
- package/dist/esm/dev/ltUtils.js +2 -1
- package/dist/esm/dev/migrateFaucet.js +2 -1
- package/dist/esm/permissionless/bindings/compressors/token-compressor.js +6 -3
- package/dist/esm/permissionless/bindings/market-configurator.js +4 -2
- package/dist/esm/permissionless/bindings/price-feed-store.js +2 -1
- package/dist/esm/plugins/accounts-counter/AccountsCounterPlugin.js +2 -1
- package/dist/esm/plugins/bots/BotsPlugin.js +4 -2
- package/dist/esm/plugins/delayed-withdrawal/DelayedWithdrawalPlugin.js +2 -1
- package/dist/esm/plugins/pools-history/Pools7DAgoPlugin.js +2 -1
- package/dist/esm/plugins/zappers/ZappersPlugin.js +2 -1
- package/dist/esm/sdk/accounts/AbstractCreditAccountsService.js +2 -1
- package/dist/esm/sdk/base/TokensMeta.js +2 -1
- package/dist/esm/sdk/core/address-provider/createAddressProvider.js +16 -6
- package/dist/esm/sdk/gauges/GaugeStakingService.js +2 -1
- package/dist/esm/sdk/market/MarketConfiguratorContract.js +2 -1
- package/dist/esm/sdk/sdk-legacy/gearboxRewards/api.js +2 -1
- package/package.json +1 -1
|
@@ -713,7 +713,8 @@ class AccountOpener extends import_sdk.SDKConstruct {
|
|
|
713
713
|
args: [distributor.address]
|
|
714
714
|
})
|
|
715
715
|
),
|
|
716
|
-
allowFailure: false
|
|
716
|
+
allowFailure: false,
|
|
717
|
+
batchSize: 0
|
|
717
718
|
});
|
|
718
719
|
const tokensArr = tokens.asArray();
|
|
719
720
|
for (let i = 0; i < tokensArr.length; i++) {
|
package/dist/cjs/dev/ltUtils.js
CHANGED
|
@@ -45,7 +45,8 @@ class TokenCompressorContract extends import_sdk.BaseContract {
|
|
|
45
45
|
args: []
|
|
46
46
|
}));
|
|
47
47
|
const results = await this.client.multicall({
|
|
48
|
-
contracts
|
|
48
|
+
contracts,
|
|
49
|
+
batchSize: 0
|
|
49
50
|
});
|
|
50
51
|
const multivaultToToken = /* @__PURE__ */ new Map();
|
|
51
52
|
const multivaults = [];
|
|
@@ -64,7 +65,8 @@ class TokenCompressorContract extends import_sdk.BaseContract {
|
|
|
64
65
|
functionName: "symbol",
|
|
65
66
|
args: []
|
|
66
67
|
})),
|
|
67
|
-
allowFailure: true
|
|
68
|
+
allowFailure: true,
|
|
69
|
+
batchSize: 0
|
|
68
70
|
});
|
|
69
71
|
const tokenToSymbol = /* @__PURE__ */ new Map();
|
|
70
72
|
for (let i = 0; i < resultsSymbols.length; i++) {
|
|
@@ -86,7 +88,8 @@ class TokenCompressorContract extends import_sdk.BaseContract {
|
|
|
86
88
|
abi,
|
|
87
89
|
functionName: "getTokenInfo",
|
|
88
90
|
args: [token]
|
|
89
|
-
}))
|
|
91
|
+
})),
|
|
92
|
+
batchSize: 0
|
|
90
93
|
});
|
|
91
94
|
const tokenInfos = results.map((result, index) => {
|
|
92
95
|
if (result.status === "failure") {
|
|
@@ -418,7 +418,8 @@ class MarketConfiguratorContract extends import_sdk.BaseContract {
|
|
|
418
418
|
functionName: "getRoleHolders",
|
|
419
419
|
args: [(0, import_viem.stringToHex)("EMERGENCY_LIQUIDATOR", { size: 32 })]
|
|
420
420
|
}
|
|
421
|
-
]
|
|
421
|
+
],
|
|
422
|
+
batchSize: 0
|
|
422
423
|
});
|
|
423
424
|
return {
|
|
424
425
|
admin,
|
|
@@ -447,7 +448,8 @@ class MarketConfiguratorContract extends import_sdk.BaseContract {
|
|
|
447
448
|
address: admin,
|
|
448
449
|
abi: (0, import_viem.parseAbi)(["function contractType() view returns (bytes32)"]),
|
|
449
450
|
functionName: "contractType"
|
|
450
|
-
}))
|
|
451
|
+
})),
|
|
452
|
+
batchSize: 0
|
|
451
453
|
});
|
|
452
454
|
const pause = result.map((r, i) => ({
|
|
453
455
|
...r,
|
|
@@ -325,7 +325,8 @@ class PriceFeedStoreContract extends import_sdk.BaseContract {
|
|
|
325
325
|
args: [priceFeed]
|
|
326
326
|
}));
|
|
327
327
|
const results = await this.client.multicall({
|
|
328
|
-
contracts: multicallCalls
|
|
328
|
+
contracts: multicallCalls,
|
|
329
|
+
batchSize: 0
|
|
329
330
|
});
|
|
330
331
|
return results.map((result, index) => {
|
|
331
332
|
if (result.status === "failure") {
|
|
@@ -70,7 +70,8 @@ class BotsPlugin extends import_sdk.BasePlugin {
|
|
|
70
70
|
})
|
|
71
71
|
),
|
|
72
72
|
allowFailure: true,
|
|
73
|
-
blockNumber: this.sdk.currentBlock
|
|
73
|
+
blockNumber: this.sdk.currentBlock,
|
|
74
|
+
batchSize: 0
|
|
74
75
|
});
|
|
75
76
|
const expectedBots = new import_sdk.AddressMap();
|
|
76
77
|
for (let i = 0; i < configs.length; i++) {
|
|
@@ -98,7 +99,8 @@ class BotsPlugin extends import_sdk.BasePlugin {
|
|
|
98
99
|
})
|
|
99
100
|
),
|
|
100
101
|
allowFailure: true,
|
|
101
|
-
blockNumber: this.sdk.currentBlock
|
|
102
|
+
blockNumber: this.sdk.currentBlock,
|
|
103
|
+
batchSize: 0
|
|
102
104
|
});
|
|
103
105
|
for (let i = 0; i < botAddrs.length; i++) {
|
|
104
106
|
const serialized = serializedBots[i];
|
|
@@ -44,7 +44,8 @@ class DelayedWithdrawalPlugin extends import_sdk.BasePlugin {
|
|
|
44
44
|
args: [cm.creditManager.address]
|
|
45
45
|
})
|
|
46
46
|
) : [],
|
|
47
|
-
allowFailure: true
|
|
47
|
+
allowFailure: true,
|
|
48
|
+
batchSize: 0
|
|
48
49
|
});
|
|
49
50
|
this.#withdrawableAssets = new import_sdk.AddressMap(void 0, MAP_LABEL);
|
|
50
51
|
resp.forEach((r, index) => {
|
|
@@ -49,7 +49,8 @@ class Pools7DAgoPlugin extends import_sdk.BasePlugin {
|
|
|
49
49
|
args: [m.pool.pool.address]
|
|
50
50
|
})
|
|
51
51
|
),
|
|
52
|
-
blockNumber: import_sdk.BigIntMath.max(0n, targetBlock)
|
|
52
|
+
blockNumber: import_sdk.BigIntMath.max(0n, targetBlock),
|
|
53
|
+
batchSize: 0
|
|
53
54
|
});
|
|
54
55
|
this.#pools7DAgo = new import_sdk.AddressMap(void 0, MAP_LABEL);
|
|
55
56
|
resp.forEach((r, index) => {
|
|
@@ -51,7 +51,8 @@ class ZappersPlugin extends import_sdk.BasePlugin {
|
|
|
51
51
|
args: [m.configurator.address, m.pool.pool.address]
|
|
52
52
|
})
|
|
53
53
|
),
|
|
54
|
-
allowFailure: true
|
|
54
|
+
allowFailure: true,
|
|
55
|
+
batchSize: 0
|
|
55
56
|
});
|
|
56
57
|
this.#zappers = new import_sdk.AddressMap(void 0, "zappers");
|
|
57
58
|
for (let i = 0; i < resp.length; i++) {
|
|
@@ -24,14 +24,20 @@ __export(createAddressProvider_exports, {
|
|
|
24
24
|
module.exports = __toCommonJS(createAddressProvider_exports);
|
|
25
25
|
var import_iVersion = require("../../../abi/iVersion.js");
|
|
26
26
|
var import_constants = require("../../constants/index.js");
|
|
27
|
+
var import_hex = require("../../utils/hex.js");
|
|
27
28
|
var import_AddressProviderV300Contract = require("./AddressProviderV300Contract.js");
|
|
28
29
|
var import_AddressProviderV310Contract = require("./AddressProviderV310Contract.js");
|
|
29
30
|
async function createAddressProvider(sdk, address) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
let v;
|
|
32
|
+
if ((0, import_hex.hexEq)(address, import_constants.ADDRESS_PROVIDER_V310)) {
|
|
33
|
+
v = 310n;
|
|
34
|
+
} else {
|
|
35
|
+
v = await sdk.client.readContract({
|
|
36
|
+
address,
|
|
37
|
+
abi: import_iVersion.iVersionAbi,
|
|
38
|
+
functionName: "version"
|
|
39
|
+
});
|
|
40
|
+
}
|
|
35
41
|
return newAddressProvider(sdk, address, Number(v));
|
|
36
42
|
}
|
|
37
43
|
function hydrateAddressProvider(sdk, state) {
|
|
@@ -128,7 +128,8 @@ class GearboxRewardsApi {
|
|
|
128
128
|
const [response] = await Promise.allSettled([
|
|
129
129
|
provider.multicall({
|
|
130
130
|
allowFailure: false,
|
|
131
|
-
contracts: [...farmInfoCalls, ...rewardTokenCalls, ...farmedCalls]
|
|
131
|
+
contracts: [...farmInfoCalls, ...rewardTokenCalls, ...farmedCalls],
|
|
132
|
+
batchSize: 0
|
|
132
133
|
})
|
|
133
134
|
]);
|
|
134
135
|
const safeResponse = GearboxRewardsApi.extractFulfilled(response, reportError, "v3Rewards") || [];
|
|
@@ -704,7 +704,8 @@ class AccountOpener extends SDKConstruct {
|
|
|
704
704
|
args: [distributor.address]
|
|
705
705
|
})
|
|
706
706
|
),
|
|
707
|
-
allowFailure: false
|
|
707
|
+
allowFailure: false,
|
|
708
|
+
batchSize: 0
|
|
708
709
|
});
|
|
709
710
|
const tokensArr = tokens.asArray();
|
|
710
711
|
for (let i = 0; i < tokensArr.length; i++) {
|
package/dist/esm/dev/ltUtils.js
CHANGED
|
@@ -25,7 +25,8 @@ class TokenCompressorContract extends BaseContract {
|
|
|
25
25
|
args: []
|
|
26
26
|
}));
|
|
27
27
|
const results = await this.client.multicall({
|
|
28
|
-
contracts
|
|
28
|
+
contracts,
|
|
29
|
+
batchSize: 0
|
|
29
30
|
});
|
|
30
31
|
const multivaultToToken = /* @__PURE__ */ new Map();
|
|
31
32
|
const multivaults = [];
|
|
@@ -44,7 +45,8 @@ class TokenCompressorContract extends BaseContract {
|
|
|
44
45
|
functionName: "symbol",
|
|
45
46
|
args: []
|
|
46
47
|
})),
|
|
47
|
-
allowFailure: true
|
|
48
|
+
allowFailure: true,
|
|
49
|
+
batchSize: 0
|
|
48
50
|
});
|
|
49
51
|
const tokenToSymbol = /* @__PURE__ */ new Map();
|
|
50
52
|
for (let i = 0; i < resultsSymbols.length; i++) {
|
|
@@ -66,7 +68,8 @@ class TokenCompressorContract extends BaseContract {
|
|
|
66
68
|
abi,
|
|
67
69
|
functionName: "getTokenInfo",
|
|
68
70
|
args: [token]
|
|
69
|
-
}))
|
|
71
|
+
})),
|
|
72
|
+
batchSize: 0
|
|
70
73
|
});
|
|
71
74
|
const tokenInfos = results.map((result, index) => {
|
|
72
75
|
if (result.status === "failure") {
|
|
@@ -413,7 +413,8 @@ class MarketConfiguratorContract extends BaseContract {
|
|
|
413
413
|
functionName: "getRoleHolders",
|
|
414
414
|
args: [stringToHex("EMERGENCY_LIQUIDATOR", { size: 32 })]
|
|
415
415
|
}
|
|
416
|
-
]
|
|
416
|
+
],
|
|
417
|
+
batchSize: 0
|
|
417
418
|
});
|
|
418
419
|
return {
|
|
419
420
|
admin,
|
|
@@ -442,7 +443,8 @@ class MarketConfiguratorContract extends BaseContract {
|
|
|
442
443
|
address: admin,
|
|
443
444
|
abi: parseAbi(["function contractType() view returns (bytes32)"]),
|
|
444
445
|
functionName: "contractType"
|
|
445
|
-
}))
|
|
446
|
+
})),
|
|
447
|
+
batchSize: 0
|
|
446
448
|
});
|
|
447
449
|
const pause = result.map((r, i) => ({
|
|
448
450
|
...r,
|
|
@@ -310,7 +310,8 @@ class PriceFeedStoreContract extends BaseContract {
|
|
|
310
310
|
args: [priceFeed]
|
|
311
311
|
}));
|
|
312
312
|
const results = await this.client.multicall({
|
|
313
|
-
contracts: multicallCalls
|
|
313
|
+
contracts: multicallCalls,
|
|
314
|
+
batchSize: 0
|
|
314
315
|
});
|
|
315
316
|
return results.map((result, index) => {
|
|
316
317
|
if (result.status === "failure") {
|
|
@@ -62,7 +62,8 @@ class BotsPlugin extends BasePlugin {
|
|
|
62
62
|
})
|
|
63
63
|
),
|
|
64
64
|
allowFailure: true,
|
|
65
|
-
blockNumber: this.sdk.currentBlock
|
|
65
|
+
blockNumber: this.sdk.currentBlock,
|
|
66
|
+
batchSize: 0
|
|
66
67
|
});
|
|
67
68
|
const expectedBots = new AddressMap();
|
|
68
69
|
for (let i = 0; i < configs.length; i++) {
|
|
@@ -90,7 +91,8 @@ class BotsPlugin extends BasePlugin {
|
|
|
90
91
|
})
|
|
91
92
|
),
|
|
92
93
|
allowFailure: true,
|
|
93
|
-
blockNumber: this.sdk.currentBlock
|
|
94
|
+
blockNumber: this.sdk.currentBlock,
|
|
95
|
+
batchSize: 0
|
|
94
96
|
});
|
|
95
97
|
for (let i = 0; i < botAddrs.length; i++) {
|
|
96
98
|
const serialized = serializedBots[i];
|
|
@@ -25,7 +25,8 @@ class DelayedWithdrawalPlugin extends BasePlugin {
|
|
|
25
25
|
args: [cm.creditManager.address]
|
|
26
26
|
})
|
|
27
27
|
) : [],
|
|
28
|
-
allowFailure: true
|
|
28
|
+
allowFailure: true,
|
|
29
|
+
batchSize: 0
|
|
29
30
|
});
|
|
30
31
|
this.#withdrawableAssets = new AddressMap(void 0, MAP_LABEL);
|
|
31
32
|
resp.forEach((r, index) => {
|
|
@@ -33,7 +33,8 @@ class Pools7DAgoPlugin extends BasePlugin {
|
|
|
33
33
|
args: [m.pool.pool.address]
|
|
34
34
|
})
|
|
35
35
|
),
|
|
36
|
-
blockNumber: BigIntMath.max(0n, targetBlock)
|
|
36
|
+
blockNumber: BigIntMath.max(0n, targetBlock),
|
|
37
|
+
batchSize: 0
|
|
37
38
|
});
|
|
38
39
|
this.#pools7DAgo = new AddressMap(void 0, MAP_LABEL);
|
|
39
40
|
resp.forEach((r, index) => {
|
|
@@ -34,7 +34,8 @@ class ZappersPlugin extends BasePlugin {
|
|
|
34
34
|
args: [m.configurator.address, m.pool.pool.address]
|
|
35
35
|
})
|
|
36
36
|
),
|
|
37
|
-
allowFailure: true
|
|
37
|
+
allowFailure: true,
|
|
38
|
+
batchSize: 0
|
|
38
39
|
});
|
|
39
40
|
this.#zappers = new AddressMap(void 0, "zappers");
|
|
40
41
|
for (let i = 0; i < resp.length; i++) {
|
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
import { iVersionAbi } from "../../../abi/iVersion.js";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
ADDRESS_PROVIDER_V310,
|
|
4
|
+
isV300,
|
|
5
|
+
isV310
|
|
6
|
+
} from "../../constants/index.js";
|
|
7
|
+
import { hexEq } from "../../utils/hex.js";
|
|
3
8
|
import { AddressProviderV300Contract } from "./AddressProviderV300Contract.js";
|
|
4
9
|
import { AddressProviderV310Contract } from "./AddressProviderV310Contract.js";
|
|
5
10
|
async function createAddressProvider(sdk, address) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
let v;
|
|
12
|
+
if (hexEq(address, ADDRESS_PROVIDER_V310)) {
|
|
13
|
+
v = 310n;
|
|
14
|
+
} else {
|
|
15
|
+
v = await sdk.client.readContract({
|
|
16
|
+
address,
|
|
17
|
+
abi: iVersionAbi,
|
|
18
|
+
functionName: "version"
|
|
19
|
+
});
|
|
20
|
+
}
|
|
11
21
|
return newAddressProvider(sdk, address, Number(v));
|
|
12
22
|
}
|
|
13
23
|
function hydrateAddressProvider(sdk, state) {
|
|
@@ -95,7 +95,8 @@ class GearboxRewardsApi {
|
|
|
95
95
|
const [response] = await Promise.allSettled([
|
|
96
96
|
provider.multicall({
|
|
97
97
|
allowFailure: false,
|
|
98
|
-
contracts: [...farmInfoCalls, ...rewardTokenCalls, ...farmedCalls]
|
|
98
|
+
contracts: [...farmInfoCalls, ...rewardTokenCalls, ...farmedCalls],
|
|
99
|
+
batchSize: 0
|
|
99
100
|
})
|
|
100
101
|
]);
|
|
101
102
|
const safeResponse = GearboxRewardsApi.extractFulfilled(response, reportError, "v3Rewards") || [];
|