@gearbox-protocol/sdk 3.0.0-vfour.346 → 3.0.0-vfour.348
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/core/address-provider/AbstractAddressProviderContract.js +0 -1
- package/dist/cjs/sdk/sdk-legacy/core/creditManager.js +5 -2
- package/dist/esm/sdk/core/address-provider/AbstractAddressProviderContract.js +0 -1
- package/dist/esm/sdk/sdk-legacy/core/creditManager.js +5 -2
- package/dist/types/sdk/sdk-legacy/core/creditManager.d.ts +3 -0
- package/package.json +1 -1
|
@@ -57,7 +57,6 @@ class AbstractAddressProviderContract extends import_base.BaseContract {
|
|
|
57
57
|
if (!version) {
|
|
58
58
|
throw new Error(`Latest version for ${contract} not found`);
|
|
59
59
|
}
|
|
60
|
-
this.logger?.debug(`Latest version found for ${contract} : ${version}`);
|
|
61
60
|
return [this.getAddress(contract, version), version];
|
|
62
61
|
}
|
|
63
62
|
get state() {
|
|
@@ -56,6 +56,9 @@ class CreditManagerData_Legacy {
|
|
|
56
56
|
liquidationDiscountExpired;
|
|
57
57
|
collateralTokens = [];
|
|
58
58
|
supportedTokens = {};
|
|
59
|
+
/**
|
|
60
|
+
* has LT !== 0 and Quota and not forbidden
|
|
61
|
+
*/
|
|
59
62
|
usableTokens = {};
|
|
60
63
|
forbiddenTokens = {};
|
|
61
64
|
adapters = {};
|
|
@@ -125,10 +128,10 @@ class CreditManagerData_Legacy {
|
|
|
125
128
|
);
|
|
126
129
|
payload.collateralTokens.forEach((t, index) => {
|
|
127
130
|
const tLc = t.toLowerCase();
|
|
128
|
-
const mask = BigInt(1 << index);
|
|
129
|
-
const isForbidden = (mask & payload.forbiddenTokenMask) !== 0n;
|
|
130
131
|
const zeroLt = this.liquidationThresholds[tLc] === 0n;
|
|
131
132
|
const quotaNotActive = this.quotas[tLc]?.isActive === false;
|
|
133
|
+
const mask = BigInt(1 << index);
|
|
134
|
+
const isForbidden = (mask & payload.forbiddenTokenMask) !== 0n;
|
|
132
135
|
const allowed = !zeroLt && !quotaNotActive && !isForbidden;
|
|
133
136
|
if (allowed) this.usableTokens[tLc] = true;
|
|
134
137
|
if (isForbidden) this.forbiddenTokens[tLc] = true;
|
|
@@ -34,7 +34,6 @@ class AbstractAddressProviderContract extends BaseContract {
|
|
|
34
34
|
if (!version) {
|
|
35
35
|
throw new Error(`Latest version for ${contract} not found`);
|
|
36
36
|
}
|
|
37
|
-
this.logger?.debug(`Latest version found for ${contract} : ${version}`);
|
|
38
37
|
return [this.getAddress(contract, version), version];
|
|
39
38
|
}
|
|
40
39
|
get state() {
|
|
@@ -36,6 +36,9 @@ class CreditManagerData_Legacy {
|
|
|
36
36
|
liquidationDiscountExpired;
|
|
37
37
|
collateralTokens = [];
|
|
38
38
|
supportedTokens = {};
|
|
39
|
+
/**
|
|
40
|
+
* has LT !== 0 and Quota and not forbidden
|
|
41
|
+
*/
|
|
39
42
|
usableTokens = {};
|
|
40
43
|
forbiddenTokens = {};
|
|
41
44
|
adapters = {};
|
|
@@ -105,10 +108,10 @@ class CreditManagerData_Legacy {
|
|
|
105
108
|
);
|
|
106
109
|
payload.collateralTokens.forEach((t, index) => {
|
|
107
110
|
const tLc = t.toLowerCase();
|
|
108
|
-
const mask = BigInt(1 << index);
|
|
109
|
-
const isForbidden = (mask & payload.forbiddenTokenMask) !== 0n;
|
|
110
111
|
const zeroLt = this.liquidationThresholds[tLc] === 0n;
|
|
111
112
|
const quotaNotActive = this.quotas[tLc]?.isActive === false;
|
|
113
|
+
const mask = BigInt(1 << index);
|
|
114
|
+
const isForbidden = (mask & payload.forbiddenTokenMask) !== 0n;
|
|
112
115
|
const allowed = !zeroLt && !quotaNotActive && !isForbidden;
|
|
113
116
|
if (allowed) this.usableTokens[tLc] = true;
|
|
114
117
|
if (isForbidden) this.forbiddenTokens[tLc] = true;
|
|
@@ -28,6 +28,9 @@ export declare class CreditManagerData_Legacy {
|
|
|
28
28
|
readonly liquidationDiscountExpired: number;
|
|
29
29
|
readonly collateralTokens: Array<Address>;
|
|
30
30
|
readonly supportedTokens: Record<Address, true>;
|
|
31
|
+
/**
|
|
32
|
+
* has LT !== 0 and Quota and not forbidden
|
|
33
|
+
*/
|
|
31
34
|
readonly usableTokens: Record<Address, true>;
|
|
32
35
|
readonly forbiddenTokens: Record<Address, true>;
|
|
33
36
|
readonly adapters: Record<Address, CreditManagerDataPayload["adapters"][1]>;
|