@gearbox-protocol/sdk 12.0.0-next.8 → 12.0.0
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/permissionless/bindings/factory/loss-policy-factory.js +65 -0
- package/dist/cjs/permissionless/bindings/market-configurator.js +30 -1
- package/dist/cjs/permissionless/bindings/types.js +17 -0
- package/dist/esm/permissionless/bindings/factory/loss-policy-factory.js +41 -0
- package/dist/esm/permissionless/bindings/market-configurator.js +30 -1
- package/dist/esm/permissionless/bindings/types.js +9 -0
- package/dist/types/permissionless/bindings/factory/loss-policy-factory.d.ts +143 -0
- package/dist/types/permissionless/bindings/market-configurator.d.ts +4 -0
- package/dist/types/permissionless/bindings/types.d.ts +5 -0
- package/dist/types/sdk/sdk-legacy/core/creditAccount.d.ts +2 -2
- package/package.json +7 -7
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var loss_policy_factory_exports = {};
|
|
20
|
+
__export(loss_policy_factory_exports, {
|
|
21
|
+
LossPolicyFactory: () => LossPolicyFactory
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(loss_policy_factory_exports);
|
|
24
|
+
var import_viem = require("viem");
|
|
25
|
+
var import_generated = require("../../../abi/310/generated.js");
|
|
26
|
+
var import_types = require("../types.js");
|
|
27
|
+
var import_abstract_factory = require("./abstract-factory.js");
|
|
28
|
+
const abi = import_generated.iLossPolicyV310Abi;
|
|
29
|
+
class LossPolicyFactory extends import_abstract_factory.AbstractFactory {
|
|
30
|
+
constructor() {
|
|
31
|
+
super(abi);
|
|
32
|
+
}
|
|
33
|
+
setAccessMode(args) {
|
|
34
|
+
return this.createCallData({
|
|
35
|
+
functionName: "setAccessMode",
|
|
36
|
+
args: [args.accessMode]
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
setChecksEnabled(args) {
|
|
40
|
+
return this.createCallData({
|
|
41
|
+
functionName: "setChecksEnabled",
|
|
42
|
+
args: [args.enabled]
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
decodeConfig(calldata) {
|
|
46
|
+
const decoded = (0, import_viem.decodeFunctionData)({
|
|
47
|
+
abi: this.abi,
|
|
48
|
+
data: calldata
|
|
49
|
+
});
|
|
50
|
+
if (decoded.functionName === "setAccessMode") {
|
|
51
|
+
const [accessMode] = decoded.args;
|
|
52
|
+
return {
|
|
53
|
+
functionName: decoded.functionName,
|
|
54
|
+
args: {
|
|
55
|
+
mode: import_types.AccessMode[accessMode] ?? accessMode
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
return super.decodeConfig(calldata);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
63
|
+
0 && (module.exports = {
|
|
64
|
+
LossPolicyFactory
|
|
65
|
+
});
|
|
@@ -29,6 +29,7 @@ var import_plugins = require("../plugins/index.js");
|
|
|
29
29
|
var import_create2 = require("../utils/create2.js");
|
|
30
30
|
var import_utils = require("../utils/index.js");
|
|
31
31
|
var import_credit_factory = require("./factory/credit-factory.js");
|
|
32
|
+
var import_loss_policy_factory = require("./factory/loss-policy-factory.js");
|
|
32
33
|
var import_pool_factory = require("./factory/pool-factory.js");
|
|
33
34
|
var import_price_oracle_factory = require("./factory/price-oracle-factory.js");
|
|
34
35
|
var import_index = require("./index.js");
|
|
@@ -37,11 +38,13 @@ class MarketConfiguratorContract extends import_sdk.BaseContract {
|
|
|
37
38
|
creditFactory;
|
|
38
39
|
poolFactory;
|
|
39
40
|
priceOracleFactory;
|
|
41
|
+
lossPolicyFactory;
|
|
40
42
|
constructor(addr, client) {
|
|
41
43
|
super({ client }, { abi, addr, name: "MarketConfigurator" });
|
|
42
44
|
this.creditFactory = new import_credit_factory.CreditFactory();
|
|
43
45
|
this.poolFactory = new import_pool_factory.PoolFactory();
|
|
44
46
|
this.priceOracleFactory = new import_price_oracle_factory.PriceOracleFactory();
|
|
47
|
+
this.lossPolicyFactory = new import_loss_policy_factory.LossPolicyFactory();
|
|
45
48
|
}
|
|
46
49
|
async getAddressProvider() {
|
|
47
50
|
const addressProvider = await this.contract.read.addressProvider();
|
|
@@ -398,6 +401,22 @@ class MarketConfiguratorContract extends import_sdk.BaseContract {
|
|
|
398
401
|
]),
|
|
399
402
|
functionName: "getRoleHolders",
|
|
400
403
|
args: [(0, import_viem.stringToHex)("UNPAUSABLE_ADMIN", { size: 32 })]
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
address: acl,
|
|
407
|
+
abi: (0, import_viem.parseAbi)([
|
|
408
|
+
"function getRoleHolders(bytes32) view returns (address[])"
|
|
409
|
+
]),
|
|
410
|
+
functionName: "getRoleHolders",
|
|
411
|
+
args: [(0, import_viem.stringToHex)("LOSS_LIQUIDATOR", { size: 32 })]
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
address: acl,
|
|
415
|
+
abi: (0, import_viem.parseAbi)([
|
|
416
|
+
"function getRoleHolders(bytes32) view returns (address[])"
|
|
417
|
+
]),
|
|
418
|
+
functionName: "getRoleHolders",
|
|
419
|
+
args: [(0, import_viem.stringToHex)("EMERGENCY_LIQUIDATOR", { size: 32 })]
|
|
401
420
|
}
|
|
402
421
|
]
|
|
403
422
|
});
|
|
@@ -406,7 +425,9 @@ class MarketConfiguratorContract extends import_sdk.BaseContract {
|
|
|
406
425
|
emergencyAdmin,
|
|
407
426
|
treasury,
|
|
408
427
|
pausableAdmins: [...results[0]],
|
|
409
|
-
unpausableAdmins: [...results[1]]
|
|
428
|
+
unpausableAdmins: [...results[1]],
|
|
429
|
+
lossLiquidators: [...results[2]],
|
|
430
|
+
emergencyLiquidators: [...results[3]]
|
|
410
431
|
};
|
|
411
432
|
}
|
|
412
433
|
async multipause() {
|
|
@@ -645,6 +666,14 @@ class MarketConfiguratorContract extends import_sdk.BaseContract {
|
|
|
645
666
|
calldata
|
|
646
667
|
};
|
|
647
668
|
}
|
|
669
|
+
case "configureLossPolicy": {
|
|
670
|
+
const [pool, calldata] = args;
|
|
671
|
+
const decoded = this.lossPolicyFactory.decodeConfig(calldata);
|
|
672
|
+
return {
|
|
673
|
+
pool,
|
|
674
|
+
data: (0, import_sdk.json_stringify)(decoded)
|
|
675
|
+
};
|
|
676
|
+
}
|
|
648
677
|
case "updateInterestRateModel": {
|
|
649
678
|
const [pool, deployParams] = args;
|
|
650
679
|
return {
|
|
@@ -3,6 +3,10 @@ var __defProp = Object.defineProperty;
|
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
6
10
|
var __copyProps = (to, from, except, desc) => {
|
|
7
11
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
12
|
for (let key of __getOwnPropNames(from))
|
|
@@ -13,4 +17,17 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
13
17
|
};
|
|
14
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
19
|
var types_exports = {};
|
|
20
|
+
__export(types_exports, {
|
|
21
|
+
AccessMode: () => AccessMode
|
|
22
|
+
});
|
|
16
23
|
module.exports = __toCommonJS(types_exports);
|
|
24
|
+
var AccessMode = /* @__PURE__ */ ((AccessMode2) => {
|
|
25
|
+
AccessMode2[AccessMode2["Permissionless"] = 0] = "Permissionless";
|
|
26
|
+
AccessMode2[AccessMode2["Permissioned"] = 1] = "Permissioned";
|
|
27
|
+
AccessMode2[AccessMode2["Forbidden"] = 2] = "Forbidden";
|
|
28
|
+
return AccessMode2;
|
|
29
|
+
})(AccessMode || {});
|
|
30
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
31
|
+
0 && (module.exports = {
|
|
32
|
+
AccessMode
|
|
33
|
+
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { decodeFunctionData } from "viem";
|
|
2
|
+
import { iLossPolicyV310Abi } from "../../../abi/310/generated.js";
|
|
3
|
+
import { AccessMode } from "../types.js";
|
|
4
|
+
import { AbstractFactory } from "./abstract-factory.js";
|
|
5
|
+
const abi = iLossPolicyV310Abi;
|
|
6
|
+
class LossPolicyFactory extends AbstractFactory {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(abi);
|
|
9
|
+
}
|
|
10
|
+
setAccessMode(args) {
|
|
11
|
+
return this.createCallData({
|
|
12
|
+
functionName: "setAccessMode",
|
|
13
|
+
args: [args.accessMode]
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
setChecksEnabled(args) {
|
|
17
|
+
return this.createCallData({
|
|
18
|
+
functionName: "setChecksEnabled",
|
|
19
|
+
args: [args.enabled]
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
decodeConfig(calldata) {
|
|
23
|
+
const decoded = decodeFunctionData({
|
|
24
|
+
abi: this.abi,
|
|
25
|
+
data: calldata
|
|
26
|
+
});
|
|
27
|
+
if (decoded.functionName === "setAccessMode") {
|
|
28
|
+
const [accessMode] = decoded.args;
|
|
29
|
+
return {
|
|
30
|
+
functionName: decoded.functionName,
|
|
31
|
+
args: {
|
|
32
|
+
mode: AccessMode[accessMode] ?? accessMode
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
return super.decodeConfig(calldata);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
LossPolicyFactory
|
|
41
|
+
};
|
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
import { handleSalt } from "../utils/create2.js";
|
|
25
25
|
import { convertPercent } from "../utils/index.js";
|
|
26
26
|
import { CreditFactory } from "./factory/credit-factory.js";
|
|
27
|
+
import { LossPolicyFactory } from "./factory/loss-policy-factory.js";
|
|
27
28
|
import { PoolFactory } from "./factory/pool-factory.js";
|
|
28
29
|
import { PriceOracleFactory } from "./factory/price-oracle-factory.js";
|
|
29
30
|
import { AddressProviderContract } from "./index.js";
|
|
@@ -32,11 +33,13 @@ class MarketConfiguratorContract extends BaseContract {
|
|
|
32
33
|
creditFactory;
|
|
33
34
|
poolFactory;
|
|
34
35
|
priceOracleFactory;
|
|
36
|
+
lossPolicyFactory;
|
|
35
37
|
constructor(addr, client) {
|
|
36
38
|
super({ client }, { abi, addr, name: "MarketConfigurator" });
|
|
37
39
|
this.creditFactory = new CreditFactory();
|
|
38
40
|
this.poolFactory = new PoolFactory();
|
|
39
41
|
this.priceOracleFactory = new PriceOracleFactory();
|
|
42
|
+
this.lossPolicyFactory = new LossPolicyFactory();
|
|
40
43
|
}
|
|
41
44
|
async getAddressProvider() {
|
|
42
45
|
const addressProvider = await this.contract.read.addressProvider();
|
|
@@ -393,6 +396,22 @@ class MarketConfiguratorContract extends BaseContract {
|
|
|
393
396
|
]),
|
|
394
397
|
functionName: "getRoleHolders",
|
|
395
398
|
args: [stringToHex("UNPAUSABLE_ADMIN", { size: 32 })]
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
address: acl,
|
|
402
|
+
abi: parseAbi([
|
|
403
|
+
"function getRoleHolders(bytes32) view returns (address[])"
|
|
404
|
+
]),
|
|
405
|
+
functionName: "getRoleHolders",
|
|
406
|
+
args: [stringToHex("LOSS_LIQUIDATOR", { size: 32 })]
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
address: acl,
|
|
410
|
+
abi: parseAbi([
|
|
411
|
+
"function getRoleHolders(bytes32) view returns (address[])"
|
|
412
|
+
]),
|
|
413
|
+
functionName: "getRoleHolders",
|
|
414
|
+
args: [stringToHex("EMERGENCY_LIQUIDATOR", { size: 32 })]
|
|
396
415
|
}
|
|
397
416
|
]
|
|
398
417
|
});
|
|
@@ -401,7 +420,9 @@ class MarketConfiguratorContract extends BaseContract {
|
|
|
401
420
|
emergencyAdmin,
|
|
402
421
|
treasury,
|
|
403
422
|
pausableAdmins: [...results[0]],
|
|
404
|
-
unpausableAdmins: [...results[1]]
|
|
423
|
+
unpausableAdmins: [...results[1]],
|
|
424
|
+
lossLiquidators: [...results[2]],
|
|
425
|
+
emergencyLiquidators: [...results[3]]
|
|
405
426
|
};
|
|
406
427
|
}
|
|
407
428
|
async multipause() {
|
|
@@ -640,6 +661,14 @@ class MarketConfiguratorContract extends BaseContract {
|
|
|
640
661
|
calldata
|
|
641
662
|
};
|
|
642
663
|
}
|
|
664
|
+
case "configureLossPolicy": {
|
|
665
|
+
const [pool, calldata] = args;
|
|
666
|
+
const decoded = this.lossPolicyFactory.decodeConfig(calldata);
|
|
667
|
+
return {
|
|
668
|
+
pool,
|
|
669
|
+
data: json_stringify(decoded)
|
|
670
|
+
};
|
|
671
|
+
}
|
|
643
672
|
case "updateInterestRateModel": {
|
|
644
673
|
const [pool, deployParams] = args;
|
|
645
674
|
return {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
var AccessMode = /* @__PURE__ */ ((AccessMode2) => {
|
|
2
|
+
AccessMode2[AccessMode2["Permissionless"] = 0] = "Permissionless";
|
|
3
|
+
AccessMode2[AccessMode2["Permissioned"] = 1] = "Permissioned";
|
|
4
|
+
AccessMode2[AccessMode2["Forbidden"] = 2] = "Forbidden";
|
|
5
|
+
return AccessMode2;
|
|
6
|
+
})(AccessMode || {});
|
|
7
|
+
export {
|
|
8
|
+
AccessMode
|
|
9
|
+
};
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { type Hex } from "viem";
|
|
2
|
+
import { AccessMode } from "../types.js";
|
|
3
|
+
import { AbstractFactory } from "./abstract-factory.js";
|
|
4
|
+
declare const abi: readonly [{
|
|
5
|
+
readonly type: "function";
|
|
6
|
+
readonly name: "accessMode";
|
|
7
|
+
readonly inputs: readonly [];
|
|
8
|
+
readonly outputs: readonly [{
|
|
9
|
+
readonly name: "";
|
|
10
|
+
readonly type: "uint8";
|
|
11
|
+
readonly internalType: "enum ILossPolicy.AccessMode";
|
|
12
|
+
}];
|
|
13
|
+
readonly stateMutability: "view";
|
|
14
|
+
}, {
|
|
15
|
+
readonly type: "function";
|
|
16
|
+
readonly name: "checksEnabled";
|
|
17
|
+
readonly inputs: readonly [];
|
|
18
|
+
readonly outputs: readonly [{
|
|
19
|
+
readonly name: "";
|
|
20
|
+
readonly type: "bool";
|
|
21
|
+
readonly internalType: "bool";
|
|
22
|
+
}];
|
|
23
|
+
readonly stateMutability: "view";
|
|
24
|
+
}, {
|
|
25
|
+
readonly type: "function";
|
|
26
|
+
readonly name: "contractType";
|
|
27
|
+
readonly inputs: readonly [];
|
|
28
|
+
readonly outputs: readonly [{
|
|
29
|
+
readonly name: "";
|
|
30
|
+
readonly type: "bytes32";
|
|
31
|
+
readonly internalType: "bytes32";
|
|
32
|
+
}];
|
|
33
|
+
readonly stateMutability: "view";
|
|
34
|
+
}, {
|
|
35
|
+
readonly type: "function";
|
|
36
|
+
readonly name: "isLiquidatableWithLoss";
|
|
37
|
+
readonly inputs: readonly [{
|
|
38
|
+
readonly name: "creditAccount";
|
|
39
|
+
readonly type: "address";
|
|
40
|
+
readonly internalType: "address";
|
|
41
|
+
}, {
|
|
42
|
+
readonly name: "caller";
|
|
43
|
+
readonly type: "address";
|
|
44
|
+
readonly internalType: "address";
|
|
45
|
+
}, {
|
|
46
|
+
readonly name: "params";
|
|
47
|
+
readonly type: "tuple";
|
|
48
|
+
readonly internalType: "struct ILossPolicy.Params";
|
|
49
|
+
readonly components: readonly [{
|
|
50
|
+
readonly name: "totalDebtUSD";
|
|
51
|
+
readonly type: "uint256";
|
|
52
|
+
readonly internalType: "uint256";
|
|
53
|
+
}, {
|
|
54
|
+
readonly name: "twvUSD";
|
|
55
|
+
readonly type: "uint256";
|
|
56
|
+
readonly internalType: "uint256";
|
|
57
|
+
}, {
|
|
58
|
+
readonly name: "extraData";
|
|
59
|
+
readonly type: "bytes";
|
|
60
|
+
readonly internalType: "bytes";
|
|
61
|
+
}];
|
|
62
|
+
}];
|
|
63
|
+
readonly outputs: readonly [{
|
|
64
|
+
readonly name: "";
|
|
65
|
+
readonly type: "bool";
|
|
66
|
+
readonly internalType: "bool";
|
|
67
|
+
}];
|
|
68
|
+
readonly stateMutability: "nonpayable";
|
|
69
|
+
}, {
|
|
70
|
+
readonly type: "function";
|
|
71
|
+
readonly name: "serialize";
|
|
72
|
+
readonly inputs: readonly [];
|
|
73
|
+
readonly outputs: readonly [{
|
|
74
|
+
readonly name: "serializedData";
|
|
75
|
+
readonly type: "bytes";
|
|
76
|
+
readonly internalType: "bytes";
|
|
77
|
+
}];
|
|
78
|
+
readonly stateMutability: "view";
|
|
79
|
+
}, {
|
|
80
|
+
readonly type: "function";
|
|
81
|
+
readonly name: "setAccessMode";
|
|
82
|
+
readonly inputs: readonly [{
|
|
83
|
+
readonly name: "mode";
|
|
84
|
+
readonly type: "uint8";
|
|
85
|
+
readonly internalType: "enum ILossPolicy.AccessMode";
|
|
86
|
+
}];
|
|
87
|
+
readonly outputs: readonly [];
|
|
88
|
+
readonly stateMutability: "nonpayable";
|
|
89
|
+
}, {
|
|
90
|
+
readonly type: "function";
|
|
91
|
+
readonly name: "setChecksEnabled";
|
|
92
|
+
readonly inputs: readonly [{
|
|
93
|
+
readonly name: "enabled";
|
|
94
|
+
readonly type: "bool";
|
|
95
|
+
readonly internalType: "bool";
|
|
96
|
+
}];
|
|
97
|
+
readonly outputs: readonly [];
|
|
98
|
+
readonly stateMutability: "nonpayable";
|
|
99
|
+
}, {
|
|
100
|
+
readonly type: "function";
|
|
101
|
+
readonly name: "version";
|
|
102
|
+
readonly inputs: readonly [];
|
|
103
|
+
readonly outputs: readonly [{
|
|
104
|
+
readonly name: "";
|
|
105
|
+
readonly type: "uint256";
|
|
106
|
+
readonly internalType: "uint256";
|
|
107
|
+
}];
|
|
108
|
+
readonly stateMutability: "view";
|
|
109
|
+
}, {
|
|
110
|
+
readonly type: "event";
|
|
111
|
+
readonly name: "SetAccessMode";
|
|
112
|
+
readonly inputs: readonly [{
|
|
113
|
+
readonly name: "mode";
|
|
114
|
+
readonly type: "uint8";
|
|
115
|
+
readonly indexed: false;
|
|
116
|
+
readonly internalType: "enum ILossPolicy.AccessMode";
|
|
117
|
+
}];
|
|
118
|
+
readonly anonymous: false;
|
|
119
|
+
}, {
|
|
120
|
+
readonly type: "event";
|
|
121
|
+
readonly name: "SetChecksEnabled";
|
|
122
|
+
readonly inputs: readonly [{
|
|
123
|
+
readonly name: "enabled";
|
|
124
|
+
readonly type: "bool";
|
|
125
|
+
readonly indexed: false;
|
|
126
|
+
readonly internalType: "bool";
|
|
127
|
+
}];
|
|
128
|
+
readonly anonymous: false;
|
|
129
|
+
}];
|
|
130
|
+
export declare class LossPolicyFactory extends AbstractFactory<typeof abi> {
|
|
131
|
+
constructor();
|
|
132
|
+
setAccessMode(args: {
|
|
133
|
+
accessMode: AccessMode;
|
|
134
|
+
}): Hex;
|
|
135
|
+
setChecksEnabled(args: {
|
|
136
|
+
enabled: boolean;
|
|
137
|
+
}): Hex;
|
|
138
|
+
decodeConfig(calldata: Hex): {
|
|
139
|
+
functionName: string;
|
|
140
|
+
args: Record<string, string>;
|
|
141
|
+
} | null;
|
|
142
|
+
}
|
|
143
|
+
export {};
|
|
@@ -2,6 +2,7 @@ import { type Address, type Chain, type DecodeFunctionDataReturnType, type Hex,
|
|
|
2
2
|
import type { ParsedCallArgs, RawTx } from "../../sdk/index.js";
|
|
3
3
|
import { BaseContract } from "../../sdk/index.js";
|
|
4
4
|
import { CreditFactory } from "./factory/credit-factory.js";
|
|
5
|
+
import { LossPolicyFactory } from "./factory/loss-policy-factory.js";
|
|
5
6
|
import { PoolFactory } from "./factory/pool-factory.js";
|
|
6
7
|
import { PriceOracleFactory } from "./factory/price-oracle-factory.js";
|
|
7
8
|
import { AddressProviderContract } from "./index.js";
|
|
@@ -1534,6 +1535,7 @@ export declare class MarketConfiguratorContract extends BaseContract<typeof abi>
|
|
|
1534
1535
|
readonly creditFactory: CreditFactory;
|
|
1535
1536
|
readonly poolFactory: PoolFactory;
|
|
1536
1537
|
readonly priceOracleFactory: PriceOracleFactory;
|
|
1538
|
+
readonly lossPolicyFactory: LossPolicyFactory;
|
|
1537
1539
|
constructor(addr: Address, client: PublicClient<Transport, Chain>);
|
|
1538
1540
|
getAddressProvider(): Promise<AddressProviderContract>;
|
|
1539
1541
|
previewCreateMarket(params: {
|
|
@@ -1636,6 +1638,8 @@ export declare class MarketConfiguratorContract extends BaseContract<typeof abi>
|
|
|
1636
1638
|
treasury: Address;
|
|
1637
1639
|
pausableAdmins: Address[];
|
|
1638
1640
|
unpausableAdmins: Address[];
|
|
1641
|
+
lossLiquidators: Address[];
|
|
1642
|
+
emergencyLiquidators: Address[];
|
|
1639
1643
|
}>;
|
|
1640
1644
|
multipause(): Promise<Address | undefined>;
|
|
1641
1645
|
grantRole(role: string, address: Address): RawTx;
|
|
@@ -123,8 +123,8 @@ export declare class CreditAccountData_Legacy {
|
|
|
123
123
|
constructor(payload: CreditAccountDataPayload);
|
|
124
124
|
static sortBalances(balances: Record<Address, bigint>, prices: Record<Address, bigint>, tokens: Record<Address, TokenData>): Array<[Address, bigint]>;
|
|
125
125
|
static sortAssets<T extends Asset>(balances: Array<T>, prices: Record<Address, bigint>, tokens: Record<Address, TokenData>): T[];
|
|
126
|
-
static assetComparator<T extends Asset>(t1: T, t2: T, prices1: Record<Address, bigint> | undefined, prices2: Record<Address, bigint> | undefined, tokens1: Record<Address, TokenData> | undefined, tokens2: Record<Address, TokenData> | undefined): 1 |
|
|
127
|
-
static tokensAbcComparator(t1?: TokenData, t2?: TokenData): 1 |
|
|
126
|
+
static assetComparator<T extends Asset>(t1: T, t2: T, prices1: Record<Address, bigint> | undefined, prices2: Record<Address, bigint> | undefined, tokens1: Record<Address, TokenData> | undefined, tokens2: Record<Address, TokenData> | undefined): 1 | -1 | 0;
|
|
127
|
+
static tokensAbcComparator(t1?: TokenData, t2?: TokenData): 1 | -1 | 0;
|
|
128
128
|
static amountAbcComparator(t1: bigint, t2: bigint): 1 | -1;
|
|
129
129
|
isForbidden(token: Address): boolean;
|
|
130
130
|
isQuoted(token: Address): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gearbox-protocol/sdk",
|
|
3
|
-
"version": "12.0.0
|
|
3
|
+
"version": "12.0.0",
|
|
4
4
|
"description": "Gearbox SDK",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/cjs/sdk/index.js",
|
|
@@ -51,24 +51,24 @@
|
|
|
51
51
|
"typecheck:ci": "tsc --noEmit"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@gearbox-protocol/integrations-v3": "1.52.
|
|
54
|
+
"@gearbox-protocol/integrations-v3": "1.52.2",
|
|
55
55
|
"@redstone-finance/evm-connector": "^0.9.0",
|
|
56
56
|
"@redstone-finance/protocol": "^0.9.0",
|
|
57
57
|
"@redstone-finance/sdk": "^0.9.0",
|
|
58
58
|
"@types/bn.js": "^5.2.0",
|
|
59
|
-
"abitype": "^1.2.
|
|
59
|
+
"abitype": "^1.2.3",
|
|
60
60
|
"bn.js": "^5.2.2",
|
|
61
61
|
"buffer": "^6.0.3",
|
|
62
62
|
"date-fns": "^4.1.0",
|
|
63
63
|
"decimal.js-light": "^2.5.1",
|
|
64
64
|
"viem": ">=2.23.15 <3.0.0",
|
|
65
|
-
"zod": "^4.1
|
|
65
|
+
"zod": "^4.2.1"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@biomejs/biome": "^2.3.
|
|
68
|
+
"@biomejs/biome": "^2.3.10",
|
|
69
69
|
"@commitlint/cli": "^20.2.0",
|
|
70
70
|
"@commitlint/config-conventional": "^20.2.0",
|
|
71
|
-
"@gearbox-protocol/biome-config": "^1.0.
|
|
71
|
+
"@gearbox-protocol/biome-config": "^1.0.16",
|
|
72
72
|
"@types/cross-spawn": "^6.0.6",
|
|
73
73
|
"axios": "^1.13.2",
|
|
74
74
|
"cross-spawn": "^7.0.6",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"tsx": "^4.21.0",
|
|
81
81
|
"typescript": "^5.9.3",
|
|
82
82
|
"viem-deal": "^2.0.4",
|
|
83
|
-
"vitest": "^4.0.
|
|
83
|
+
"vitest": "^4.0.16"
|
|
84
84
|
},
|
|
85
85
|
"peerDependencies": {
|
|
86
86
|
"axios": "^1.0.0",
|