@gearbox-protocol/sdk 12.9.8-beta.1 → 12.9.8
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/plugins/degen-distributors/DegenDistributorsPlugin.js +2 -1
- package/dist/cjs/plugins/zappers/ZappersPlugin.js +2 -1
- package/dist/cjs/sdk/base/ChainContractsRegister.js +2 -0
- package/dist/cjs/sdk/market/MarketConfiguratorContract.js +3 -2
- package/dist/esm/plugins/degen-distributors/DegenDistributorsPlugin.js +2 -1
- package/dist/esm/plugins/zappers/ZappersPlugin.js +2 -1
- package/dist/esm/sdk/base/ChainContractsRegister.js +2 -0
- package/dist/esm/sdk/market/MarketConfiguratorContract.js +3 -2
- package/dist/types/sdk/market/MarketConfiguratorContract.d.ts +1 -1
- package/package.json +1 -1
|
@@ -43,7 +43,8 @@ class DegenDistributorsPlugin extends import_sdk.BasePlugin {
|
|
|
43
43
|
const distributors = await import_MarketConfiguratorContract.MarketConfiguratorContract.getPeripheryContractBatch(
|
|
44
44
|
Object.values(configurators),
|
|
45
45
|
this.sdk.client,
|
|
46
|
-
"DEGEN_DISTRIBUTOR"
|
|
46
|
+
"DEGEN_DISTRIBUTOR",
|
|
47
|
+
this.sdk.currentBlock
|
|
47
48
|
);
|
|
48
49
|
const distributorByConfigurator = configurators.reduce((acc, cfg, index) => {
|
|
49
50
|
const cfgLC = cfg.address.toLowerCase();
|
|
@@ -52,7 +52,8 @@ class ZappersPlugin extends import_sdk.BasePlugin {
|
|
|
52
52
|
})
|
|
53
53
|
),
|
|
54
54
|
allowFailure: true,
|
|
55
|
-
batchSize: 0
|
|
55
|
+
batchSize: 0,
|
|
56
|
+
blockNumber: this.sdk.currentBlock
|
|
56
57
|
});
|
|
57
58
|
this.#zappers = new import_sdk.AddressMap(void 0, "zappers");
|
|
58
59
|
for (let i = 0; i < resp.length; i++) {
|
|
@@ -55,7 +55,9 @@ class ChainContractsRegister {
|
|
|
55
55
|
this.logger?.debug(
|
|
56
56
|
`resetting contacts register with ${this.contracts.size} contracts`
|
|
57
57
|
);
|
|
58
|
+
this.labels.clear();
|
|
58
59
|
this.contracts.clear();
|
|
60
|
+
this.tokensMeta.reset();
|
|
59
61
|
}
|
|
60
62
|
getContract(address) {
|
|
61
63
|
return this.contracts.get(address);
|
|
@@ -47,7 +47,7 @@ class MarketConfiguratorContract extends import_base.BaseContract {
|
|
|
47
47
|
`Market configurator ${this.#curatorName}`
|
|
48
48
|
);
|
|
49
49
|
}
|
|
50
|
-
static async getPeripheryContractBatch(configurators, client, contract) {
|
|
50
|
+
static async getPeripheryContractBatch(configurators, client, contract, blockNumber) {
|
|
51
51
|
const resp = await client.multicall({
|
|
52
52
|
allowFailure: true,
|
|
53
53
|
contracts: configurators.map(
|
|
@@ -58,7 +58,8 @@ class MarketConfiguratorContract extends import_base.BaseContract {
|
|
|
58
58
|
args: [(0, import_viem.stringToHex)(contract, { size: 32 })]
|
|
59
59
|
})
|
|
60
60
|
),
|
|
61
|
-
batchSize: 0
|
|
61
|
+
batchSize: 0,
|
|
62
|
+
blockNumber
|
|
62
63
|
});
|
|
63
64
|
return resp;
|
|
64
65
|
}
|
|
@@ -20,7 +20,8 @@ class DegenDistributorsPlugin extends BasePlugin {
|
|
|
20
20
|
const distributors = await MarketConfiguratorContract.getPeripheryContractBatch(
|
|
21
21
|
Object.values(configurators),
|
|
22
22
|
this.sdk.client,
|
|
23
|
-
"DEGEN_DISTRIBUTOR"
|
|
23
|
+
"DEGEN_DISTRIBUTOR",
|
|
24
|
+
this.sdk.currentBlock
|
|
24
25
|
);
|
|
25
26
|
const distributorByConfigurator = configurators.reduce((acc, cfg, index) => {
|
|
26
27
|
const cfgLC = cfg.address.toLowerCase();
|
|
@@ -32,7 +32,9 @@ class ChainContractsRegister {
|
|
|
32
32
|
this.logger?.debug(
|
|
33
33
|
`resetting contacts register with ${this.contracts.size} contracts`
|
|
34
34
|
);
|
|
35
|
+
this.labels.clear();
|
|
35
36
|
this.contracts.clear();
|
|
37
|
+
this.tokensMeta.reset();
|
|
36
38
|
}
|
|
37
39
|
getContract(address) {
|
|
38
40
|
return this.contracts.get(address);
|
|
@@ -26,7 +26,7 @@ class MarketConfiguratorContract extends BaseContract {
|
|
|
26
26
|
`Market configurator ${this.#curatorName}`
|
|
27
27
|
);
|
|
28
28
|
}
|
|
29
|
-
static async getPeripheryContractBatch(configurators, client, contract) {
|
|
29
|
+
static async getPeripheryContractBatch(configurators, client, contract, blockNumber) {
|
|
30
30
|
const resp = await client.multicall({
|
|
31
31
|
allowFailure: true,
|
|
32
32
|
contracts: configurators.map(
|
|
@@ -37,7 +37,8 @@ class MarketConfiguratorContract extends BaseContract {
|
|
|
37
37
|
args: [stringToHex(contract, { size: 32 })]
|
|
38
38
|
})
|
|
39
39
|
),
|
|
40
|
-
batchSize: 0
|
|
40
|
+
batchSize: 0,
|
|
41
|
+
blockNumber
|
|
41
42
|
});
|
|
42
43
|
return resp;
|
|
43
44
|
}
|
|
@@ -1531,7 +1531,7 @@ export declare class MarketConfiguratorContract extends BaseContract<abi> {
|
|
|
1531
1531
|
#private;
|
|
1532
1532
|
constructor(options: ConstructOptions, address: Address);
|
|
1533
1533
|
loadCuratorName(): Promise<void>;
|
|
1534
|
-
static getPeripheryContractBatch(configurators: MarketConfiguratorContract[], client: MarketConfiguratorContract["client"], contract: PeripheryContract): Promise<({
|
|
1534
|
+
static getPeripheryContractBatch(configurators: MarketConfiguratorContract[], client: MarketConfiguratorContract["client"], contract: PeripheryContract, blockNumber?: bigint): Promise<({
|
|
1535
1535
|
error: Error;
|
|
1536
1536
|
result?: undefined;
|
|
1537
1537
|
status: "failure";
|