@gearbox-protocol/sdk 7.3.0 → 7.3.1
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.
|
@@ -32,6 +32,12 @@ class AccountsCounterPlugin extends import_sdk.SDKConstruct {
|
|
|
32
32
|
async syncState() {
|
|
33
33
|
await this.#load();
|
|
34
34
|
}
|
|
35
|
+
get accounts() {
|
|
36
|
+
return this.#accounts;
|
|
37
|
+
}
|
|
38
|
+
forCreditManager(addr) {
|
|
39
|
+
return this.#accounts.mustGet(addr);
|
|
40
|
+
}
|
|
35
41
|
async #load() {
|
|
36
42
|
const [compressor] = this.sdk.addressProvider.mustGetLatest(
|
|
37
43
|
import_sdk.AP_CREDIT_ACCOUNT_COMPRESSOR,
|
|
@@ -17,6 +17,12 @@ class AccountsCounterPlugin extends SDKConstruct {
|
|
|
17
17
|
async syncState() {
|
|
18
18
|
await this.#load();
|
|
19
19
|
}
|
|
20
|
+
get accounts() {
|
|
21
|
+
return this.#accounts;
|
|
22
|
+
}
|
|
23
|
+
forCreditManager(addr) {
|
|
24
|
+
return this.#accounts.mustGet(addr);
|
|
25
|
+
}
|
|
20
26
|
async #load() {
|
|
21
27
|
const [compressor] = this.sdk.addressProvider.mustGetLatest(
|
|
22
28
|
AP_CREDIT_ACCOUNT_COMPRESSOR,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Address } from "viem";
|
|
2
2
|
import type { IGearboxSDKPlugin, IPluginState } from "../sdk/index.js";
|
|
3
|
-
import { SDKConstruct } from "../sdk/index.js";
|
|
3
|
+
import { AddressMap, SDKConstruct } from "../sdk/index.js";
|
|
4
4
|
export interface AccountsCounterPluginState extends IPluginState {
|
|
5
5
|
/**
|
|
6
6
|
* Mapping of credit manager addresses to the number of accounts
|
|
@@ -12,6 +12,8 @@ export declare class AccountsCounterPlugin extends SDKConstruct implements IGear
|
|
|
12
12
|
readonly version = 1;
|
|
13
13
|
attach(): Promise<void>;
|
|
14
14
|
syncState(): Promise<void>;
|
|
15
|
+
get accounts(): AddressMap<bigint>;
|
|
16
|
+
forCreditManager(addr: Address): bigint;
|
|
15
17
|
get state(): AccountsCounterPluginState;
|
|
16
18
|
hydrate(state: AccountsCounterPluginState): void;
|
|
17
19
|
}
|