@gearbox-protocol/sdk 8.27.2 → 8.27.4
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/sdk/accounts/AbstractCreditAccountsService.js +7 -10
- package/dist/cjs/sdk/accounts/index.js +6 -0
- package/dist/esm/sdk/accounts/AbstractCreditAccountsService.js +7 -10
- package/dist/esm/sdk/accounts/index.js +3 -0
- package/dist/types/sdk/accounts/AbstractCreditAccountsService.d.ts +1 -2
- package/dist/types/sdk/accounts/index.d.ts +3 -0
- package/package.json +1 -1
|
@@ -59,7 +59,7 @@ class AbstractCreditAccountService extends import_base.SDKConstruct {
|
|
|
59
59
|
async getCreditAccountData(account, blockNumber) {
|
|
60
60
|
let raw;
|
|
61
61
|
try {
|
|
62
|
-
raw = await this.
|
|
62
|
+
raw = await this.client.readContract({
|
|
63
63
|
abi: import_compressors.iCreditAccountCompressorAbi,
|
|
64
64
|
address: this.#compressor,
|
|
65
65
|
functionName: "getCreditAccountData",
|
|
@@ -77,7 +77,7 @@ class AbstractCreditAccountService extends import_base.SDKConstruct {
|
|
|
77
77
|
const { txs: priceUpdateTxs } = await this.sdk.priceFeeds.generatePriceFeedsUpdateTxs(void 0, {
|
|
78
78
|
account
|
|
79
79
|
});
|
|
80
|
-
const [cad] = await (0, import_viem2.simulateWithPriceUpdates)(this.
|
|
80
|
+
const [cad] = await (0, import_viem2.simulateWithPriceUpdates)(this.client, {
|
|
81
81
|
priceUpdates: priceUpdateTxs,
|
|
82
82
|
contracts: [
|
|
83
83
|
{
|
|
@@ -150,7 +150,7 @@ class AbstractCreditAccountService extends import_base.SDKConstruct {
|
|
|
150
150
|
* @returns {Array<Rewards>} list of {@link Rewards} that can be claimed
|
|
151
151
|
*/
|
|
152
152
|
async getRewards(creditAccount) {
|
|
153
|
-
const rewards = await this.
|
|
153
|
+
const rewards = await this.client.readContract({
|
|
154
154
|
abi: import_compressors.iRewardsCompressorAbi,
|
|
155
155
|
address: this.rewardCompressor,
|
|
156
156
|
functionName: "getRewards",
|
|
@@ -195,7 +195,7 @@ class AbstractCreditAccountService extends import_base.SDKConstruct {
|
|
|
195
195
|
*/
|
|
196
196
|
async getConnectedBots(accountsToCheck) {
|
|
197
197
|
const [resp, migration] = await Promise.all([
|
|
198
|
-
this.
|
|
198
|
+
this.client.multicall({
|
|
199
199
|
contracts: accountsToCheck.map((o) => {
|
|
200
200
|
const pool = this.sdk.marketRegister.findByCreditManager(
|
|
201
201
|
o.creditManager
|
|
@@ -218,7 +218,7 @@ class AbstractCreditAccountService extends import_base.SDKConstruct {
|
|
|
218
218
|
this.sdk.provider.chainId
|
|
219
219
|
);
|
|
220
220
|
if (migrationBot) {
|
|
221
|
-
const result = await this.
|
|
221
|
+
const result = await this.client.multicall({
|
|
222
222
|
contracts: accountsToCheck.map((ca) => {
|
|
223
223
|
const cm = this.sdk.marketRegister.findCreditManager(
|
|
224
224
|
ca.creditManager
|
|
@@ -755,7 +755,7 @@ class AbstractCreditAccountService extends import_base.SDKConstruct {
|
|
|
755
755
|
);
|
|
756
756
|
let resp;
|
|
757
757
|
if (priceUpdateTxs?.length) {
|
|
758
|
-
[resp] = await (0, import_viem2.simulateWithPriceUpdates)(this.
|
|
758
|
+
[resp] = await (0, import_viem2.simulateWithPriceUpdates)(this.client, {
|
|
759
759
|
priceUpdates: priceUpdateTxs,
|
|
760
760
|
contracts: [
|
|
761
761
|
{
|
|
@@ -769,7 +769,7 @@ class AbstractCreditAccountService extends import_base.SDKConstruct {
|
|
|
769
769
|
gas: this.sdk.gasLimit
|
|
770
770
|
});
|
|
771
771
|
} else {
|
|
772
|
-
resp = await this.
|
|
772
|
+
resp = await this.client.readContract({
|
|
773
773
|
abi: import_compressors.iCreditAccountCompressorAbi,
|
|
774
774
|
address: this.#compressor,
|
|
775
775
|
functionName: "getCreditAccounts",
|
|
@@ -1052,9 +1052,6 @@ class AbstractCreditAccountService extends import_base.SDKConstruct {
|
|
|
1052
1052
|
import_constants.VERSION_RANGE_310
|
|
1053
1053
|
)[0];
|
|
1054
1054
|
}
|
|
1055
|
-
get client() {
|
|
1056
|
-
return this.sdk.provider.publicClient;
|
|
1057
|
-
}
|
|
1058
1055
|
}
|
|
1059
1056
|
const iMellowClaimerAdapterAbi = [
|
|
1060
1057
|
{
|
|
@@ -15,11 +15,17 @@ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "defau
|
|
|
15
15
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
16
|
var accounts_exports = {};
|
|
17
17
|
module.exports = __toCommonJS(accounts_exports);
|
|
18
|
+
__reExport(accounts_exports, require("./AbstractCreditAccountsService.js"), module.exports);
|
|
19
|
+
__reExport(accounts_exports, require("./CreditAccountsServiceV300.js"), module.exports);
|
|
20
|
+
__reExport(accounts_exports, require("./CreditAccountsServiceV310.js"), module.exports);
|
|
18
21
|
__reExport(accounts_exports, require("./constants.js"), module.exports);
|
|
19
22
|
__reExport(accounts_exports, require("./createCreditAccountService.js"), module.exports);
|
|
20
23
|
__reExport(accounts_exports, require("./types.js"), module.exports);
|
|
21
24
|
// Annotate the CommonJS export names for ESM import in node:
|
|
22
25
|
0 && (module.exports = {
|
|
26
|
+
...require("./AbstractCreditAccountsService.js"),
|
|
27
|
+
...require("./CreditAccountsServiceV300.js"),
|
|
28
|
+
...require("./CreditAccountsServiceV310.js"),
|
|
23
29
|
...require("./constants.js"),
|
|
24
30
|
...require("./createCreditAccountService.js"),
|
|
25
31
|
...require("./types.js")
|
|
@@ -56,7 +56,7 @@ class AbstractCreditAccountService extends SDKConstruct {
|
|
|
56
56
|
async getCreditAccountData(account, blockNumber) {
|
|
57
57
|
let raw;
|
|
58
58
|
try {
|
|
59
|
-
raw = await this.
|
|
59
|
+
raw = await this.client.readContract({
|
|
60
60
|
abi: iCreditAccountCompressorAbi,
|
|
61
61
|
address: this.#compressor,
|
|
62
62
|
functionName: "getCreditAccountData",
|
|
@@ -74,7 +74,7 @@ class AbstractCreditAccountService extends SDKConstruct {
|
|
|
74
74
|
const { txs: priceUpdateTxs } = await this.sdk.priceFeeds.generatePriceFeedsUpdateTxs(void 0, {
|
|
75
75
|
account
|
|
76
76
|
});
|
|
77
|
-
const [cad] = await simulateWithPriceUpdates(this.
|
|
77
|
+
const [cad] = await simulateWithPriceUpdates(this.client, {
|
|
78
78
|
priceUpdates: priceUpdateTxs,
|
|
79
79
|
contracts: [
|
|
80
80
|
{
|
|
@@ -147,7 +147,7 @@ class AbstractCreditAccountService extends SDKConstruct {
|
|
|
147
147
|
* @returns {Array<Rewards>} list of {@link Rewards} that can be claimed
|
|
148
148
|
*/
|
|
149
149
|
async getRewards(creditAccount) {
|
|
150
|
-
const rewards = await this.
|
|
150
|
+
const rewards = await this.client.readContract({
|
|
151
151
|
abi: iRewardsCompressorAbi,
|
|
152
152
|
address: this.rewardCompressor,
|
|
153
153
|
functionName: "getRewards",
|
|
@@ -192,7 +192,7 @@ class AbstractCreditAccountService extends SDKConstruct {
|
|
|
192
192
|
*/
|
|
193
193
|
async getConnectedBots(accountsToCheck) {
|
|
194
194
|
const [resp, migration] = await Promise.all([
|
|
195
|
-
this.
|
|
195
|
+
this.client.multicall({
|
|
196
196
|
contracts: accountsToCheck.map((o) => {
|
|
197
197
|
const pool = this.sdk.marketRegister.findByCreditManager(
|
|
198
198
|
o.creditManager
|
|
@@ -215,7 +215,7 @@ class AbstractCreditAccountService extends SDKConstruct {
|
|
|
215
215
|
this.sdk.provider.chainId
|
|
216
216
|
);
|
|
217
217
|
if (migrationBot) {
|
|
218
|
-
const result = await this.
|
|
218
|
+
const result = await this.client.multicall({
|
|
219
219
|
contracts: accountsToCheck.map((ca) => {
|
|
220
220
|
const cm = this.sdk.marketRegister.findCreditManager(
|
|
221
221
|
ca.creditManager
|
|
@@ -752,7 +752,7 @@ class AbstractCreditAccountService extends SDKConstruct {
|
|
|
752
752
|
);
|
|
753
753
|
let resp;
|
|
754
754
|
if (priceUpdateTxs?.length) {
|
|
755
|
-
[resp] = await simulateWithPriceUpdates(this.
|
|
755
|
+
[resp] = await simulateWithPriceUpdates(this.client, {
|
|
756
756
|
priceUpdates: priceUpdateTxs,
|
|
757
757
|
contracts: [
|
|
758
758
|
{
|
|
@@ -766,7 +766,7 @@ class AbstractCreditAccountService extends SDKConstruct {
|
|
|
766
766
|
gas: this.sdk.gasLimit
|
|
767
767
|
});
|
|
768
768
|
} else {
|
|
769
|
-
resp = await this.
|
|
769
|
+
resp = await this.client.readContract({
|
|
770
770
|
abi: iCreditAccountCompressorAbi,
|
|
771
771
|
address: this.#compressor,
|
|
772
772
|
functionName: "getCreditAccounts",
|
|
@@ -1049,9 +1049,6 @@ class AbstractCreditAccountService extends SDKConstruct {
|
|
|
1049
1049
|
VERSION_RANGE_310
|
|
1050
1050
|
)[0];
|
|
1051
1051
|
}
|
|
1052
|
-
get client() {
|
|
1053
|
-
return this.sdk.provider.publicClient;
|
|
1054
|
-
}
|
|
1055
1052
|
}
|
|
1056
1053
|
const iMellowClaimerAdapterAbi = [
|
|
1057
1054
|
{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Address
|
|
1
|
+
import type { Address } from "viem";
|
|
2
2
|
import type { CreditAccountData } from "../base/index.js";
|
|
3
3
|
import { SDKConstruct } from "../base/index.js";
|
|
4
4
|
import type { GearboxSDK } from "../GearboxSDK.js";
|
|
@@ -213,5 +213,4 @@ export declare abstract class AbstractCreditAccountService extends SDKConstruct
|
|
|
213
213
|
private get marketConfigurators();
|
|
214
214
|
private get rewardCompressor();
|
|
215
215
|
private get peripheryCompressor();
|
|
216
|
-
get client(): PublicClient;
|
|
217
216
|
}
|