@gearbox-protocol/sdk 14.11.3 → 14.11.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/permissionless/bindings/factory/rate-keeper-factory.js +35 -0
- package/dist/cjs/permissionless/bindings/market-configurator.js +11 -0
- package/dist/esm/permissionless/bindings/factory/rate-keeper-factory.js +11 -0
- package/dist/esm/permissionless/bindings/market-configurator.js +11 -0
- package/dist/types/permissionless/bindings/factory/rate-keeper-factory.d.ts +179 -0
- package/dist/types/permissionless/bindings/market-configurator.d.ts +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,35 @@
|
|
|
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 rate_keeper_factory_exports = {};
|
|
20
|
+
__export(rate_keeper_factory_exports, {
|
|
21
|
+
RateKeeperFactory: () => RateKeeperFactory
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(rate_keeper_factory_exports);
|
|
24
|
+
var import_generated = require("../../../abi/310/generated.js");
|
|
25
|
+
var import_abstract_factory = require("./abstract-factory.js");
|
|
26
|
+
const abi = import_generated.iTumblerV310Abi;
|
|
27
|
+
class RateKeeperFactory extends import_abstract_factory.AbstractFactory {
|
|
28
|
+
constructor() {
|
|
29
|
+
super(abi);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
33
|
+
0 && (module.exports = {
|
|
34
|
+
RateKeeperFactory
|
|
35
|
+
});
|
|
@@ -32,6 +32,7 @@ var import_credit_factory = require("./factory/credit-factory.js");
|
|
|
32
32
|
var import_loss_policy_factory = require("./factory/loss-policy-factory.js");
|
|
33
33
|
var import_pool_factory = require("./factory/pool-factory.js");
|
|
34
34
|
var import_price_oracle_factory = require("./factory/price-oracle-factory.js");
|
|
35
|
+
var import_rate_keeper_factory = require("./factory/rate-keeper-factory.js");
|
|
35
36
|
var import_index = require("./index.js");
|
|
36
37
|
const PERIPHERY_DOMAINS = ["ZAPPER", "DEGEN_NFT"];
|
|
37
38
|
const abi = import_generated.iMarketConfiguratorV310Abi;
|
|
@@ -40,12 +41,14 @@ class MarketConfiguratorContract extends import_sdk.BaseContract {
|
|
|
40
41
|
poolFactory;
|
|
41
42
|
priceOracleFactory;
|
|
42
43
|
lossPolicyFactory;
|
|
44
|
+
rateKeeperFactory;
|
|
43
45
|
constructor(addr, client) {
|
|
44
46
|
super({ client }, { abi, addr, name: "MarketConfigurator" });
|
|
45
47
|
this.creditFactory = new import_credit_factory.CreditFactory();
|
|
46
48
|
this.poolFactory = new import_pool_factory.PoolFactory();
|
|
47
49
|
this.priceOracleFactory = new import_price_oracle_factory.PriceOracleFactory();
|
|
48
50
|
this.lossPolicyFactory = new import_loss_policy_factory.LossPolicyFactory();
|
|
51
|
+
this.rateKeeperFactory = new import_rate_keeper_factory.RateKeeperFactory();
|
|
49
52
|
}
|
|
50
53
|
async getAddressProvider() {
|
|
51
54
|
const addressProvider = await this.contract.read.addressProvider();
|
|
@@ -703,6 +706,14 @@ class MarketConfiguratorContract extends import_sdk.BaseContract {
|
|
|
703
706
|
data: (0, import_sdk.json_stringify)(decoded)
|
|
704
707
|
};
|
|
705
708
|
}
|
|
709
|
+
case "configureRateKeeper": {
|
|
710
|
+
const [pool, calldata] = args;
|
|
711
|
+
const decoded = this.rateKeeperFactory.decodeConfig(calldata);
|
|
712
|
+
return {
|
|
713
|
+
pool,
|
|
714
|
+
data: (0, import_sdk.json_stringify)(decoded)
|
|
715
|
+
};
|
|
716
|
+
}
|
|
706
717
|
case "updateInterestRateModel": {
|
|
707
718
|
const [pool, deployParams] = args;
|
|
708
719
|
return {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { iTumblerV310Abi } from "../../../abi/310/generated.js";
|
|
2
|
+
import { AbstractFactory } from "./abstract-factory.js";
|
|
3
|
+
const abi = iTumblerV310Abi;
|
|
4
|
+
class RateKeeperFactory extends AbstractFactory {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(abi);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
RateKeeperFactory
|
|
11
|
+
};
|
|
@@ -27,6 +27,7 @@ import { CreditFactory } from "./factory/credit-factory.js";
|
|
|
27
27
|
import { LossPolicyFactory } from "./factory/loss-policy-factory.js";
|
|
28
28
|
import { PoolFactory } from "./factory/pool-factory.js";
|
|
29
29
|
import { PriceOracleFactory } from "./factory/price-oracle-factory.js";
|
|
30
|
+
import { RateKeeperFactory } from "./factory/rate-keeper-factory.js";
|
|
30
31
|
import { AddressProviderContract } from "./index.js";
|
|
31
32
|
const PERIPHERY_DOMAINS = ["ZAPPER", "DEGEN_NFT"];
|
|
32
33
|
const abi = iMarketConfiguratorV310Abi;
|
|
@@ -35,12 +36,14 @@ class MarketConfiguratorContract extends BaseContract {
|
|
|
35
36
|
poolFactory;
|
|
36
37
|
priceOracleFactory;
|
|
37
38
|
lossPolicyFactory;
|
|
39
|
+
rateKeeperFactory;
|
|
38
40
|
constructor(addr, client) {
|
|
39
41
|
super({ client }, { abi, addr, name: "MarketConfigurator" });
|
|
40
42
|
this.creditFactory = new CreditFactory();
|
|
41
43
|
this.poolFactory = new PoolFactory();
|
|
42
44
|
this.priceOracleFactory = new PriceOracleFactory();
|
|
43
45
|
this.lossPolicyFactory = new LossPolicyFactory();
|
|
46
|
+
this.rateKeeperFactory = new RateKeeperFactory();
|
|
44
47
|
}
|
|
45
48
|
async getAddressProvider() {
|
|
46
49
|
const addressProvider = await this.contract.read.addressProvider();
|
|
@@ -698,6 +701,14 @@ class MarketConfiguratorContract extends BaseContract {
|
|
|
698
701
|
data: json_stringify(decoded)
|
|
699
702
|
};
|
|
700
703
|
}
|
|
704
|
+
case "configureRateKeeper": {
|
|
705
|
+
const [pool, calldata] = args;
|
|
706
|
+
const decoded = this.rateKeeperFactory.decodeConfig(calldata);
|
|
707
|
+
return {
|
|
708
|
+
pool,
|
|
709
|
+
data: json_stringify(decoded)
|
|
710
|
+
};
|
|
711
|
+
}
|
|
701
712
|
case "updateInterestRateModel": {
|
|
702
713
|
const [pool, deployParams] = args;
|
|
703
714
|
return {
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { AbstractFactory } from "./abstract-factory.js";
|
|
2
|
+
declare const abi: readonly [{
|
|
3
|
+
readonly type: "function";
|
|
4
|
+
readonly inputs: readonly [];
|
|
5
|
+
readonly name: "acl";
|
|
6
|
+
readonly outputs: readonly [{
|
|
7
|
+
readonly name: "";
|
|
8
|
+
readonly internalType: "address";
|
|
9
|
+
readonly type: "address";
|
|
10
|
+
}];
|
|
11
|
+
readonly stateMutability: "view";
|
|
12
|
+
}, {
|
|
13
|
+
readonly type: "function";
|
|
14
|
+
readonly inputs: readonly [{
|
|
15
|
+
readonly name: "token";
|
|
16
|
+
readonly internalType: "address";
|
|
17
|
+
readonly type: "address";
|
|
18
|
+
}];
|
|
19
|
+
readonly name: "addToken";
|
|
20
|
+
readonly outputs: readonly [];
|
|
21
|
+
readonly stateMutability: "nonpayable";
|
|
22
|
+
}, {
|
|
23
|
+
readonly type: "function";
|
|
24
|
+
readonly inputs: readonly [];
|
|
25
|
+
readonly name: "contractType";
|
|
26
|
+
readonly outputs: readonly [{
|
|
27
|
+
readonly name: "";
|
|
28
|
+
readonly internalType: "bytes32";
|
|
29
|
+
readonly type: "bytes32";
|
|
30
|
+
}];
|
|
31
|
+
readonly stateMutability: "view";
|
|
32
|
+
}, {
|
|
33
|
+
readonly type: "function";
|
|
34
|
+
readonly inputs: readonly [];
|
|
35
|
+
readonly name: "epochLength";
|
|
36
|
+
readonly outputs: readonly [{
|
|
37
|
+
readonly name: "";
|
|
38
|
+
readonly internalType: "uint256";
|
|
39
|
+
readonly type: "uint256";
|
|
40
|
+
}];
|
|
41
|
+
readonly stateMutability: "view";
|
|
42
|
+
}, {
|
|
43
|
+
readonly type: "function";
|
|
44
|
+
readonly inputs: readonly [{
|
|
45
|
+
readonly name: "tokens";
|
|
46
|
+
readonly internalType: "address[]";
|
|
47
|
+
readonly type: "address[]";
|
|
48
|
+
}];
|
|
49
|
+
readonly name: "getRates";
|
|
50
|
+
readonly outputs: readonly [{
|
|
51
|
+
readonly name: "";
|
|
52
|
+
readonly internalType: "uint16[]";
|
|
53
|
+
readonly type: "uint16[]";
|
|
54
|
+
}];
|
|
55
|
+
readonly stateMutability: "view";
|
|
56
|
+
}, {
|
|
57
|
+
readonly type: "function";
|
|
58
|
+
readonly inputs: readonly [];
|
|
59
|
+
readonly name: "getTokens";
|
|
60
|
+
readonly outputs: readonly [{
|
|
61
|
+
readonly name: "";
|
|
62
|
+
readonly internalType: "address[]";
|
|
63
|
+
readonly type: "address[]";
|
|
64
|
+
}];
|
|
65
|
+
readonly stateMutability: "view";
|
|
66
|
+
}, {
|
|
67
|
+
readonly type: "function";
|
|
68
|
+
readonly inputs: readonly [{
|
|
69
|
+
readonly name: "token";
|
|
70
|
+
readonly internalType: "address";
|
|
71
|
+
readonly type: "address";
|
|
72
|
+
}];
|
|
73
|
+
readonly name: "isTokenAdded";
|
|
74
|
+
readonly outputs: readonly [{
|
|
75
|
+
readonly name: "";
|
|
76
|
+
readonly internalType: "bool";
|
|
77
|
+
readonly type: "bool";
|
|
78
|
+
}];
|
|
79
|
+
readonly stateMutability: "view";
|
|
80
|
+
}, {
|
|
81
|
+
readonly type: "function";
|
|
82
|
+
readonly inputs: readonly [];
|
|
83
|
+
readonly name: "pool";
|
|
84
|
+
readonly outputs: readonly [{
|
|
85
|
+
readonly name: "";
|
|
86
|
+
readonly internalType: "address";
|
|
87
|
+
readonly type: "address";
|
|
88
|
+
}];
|
|
89
|
+
readonly stateMutability: "view";
|
|
90
|
+
}, {
|
|
91
|
+
readonly type: "function";
|
|
92
|
+
readonly inputs: readonly [];
|
|
93
|
+
readonly name: "poolQuotaKeeper";
|
|
94
|
+
readonly outputs: readonly [{
|
|
95
|
+
readonly name: "";
|
|
96
|
+
readonly internalType: "address";
|
|
97
|
+
readonly type: "address";
|
|
98
|
+
}];
|
|
99
|
+
readonly stateMutability: "view";
|
|
100
|
+
}, {
|
|
101
|
+
readonly type: "function";
|
|
102
|
+
readonly inputs: readonly [];
|
|
103
|
+
readonly name: "serialize";
|
|
104
|
+
readonly outputs: readonly [{
|
|
105
|
+
readonly name: "serializedData";
|
|
106
|
+
readonly internalType: "bytes";
|
|
107
|
+
readonly type: "bytes";
|
|
108
|
+
}];
|
|
109
|
+
readonly stateMutability: "view";
|
|
110
|
+
}, {
|
|
111
|
+
readonly type: "function";
|
|
112
|
+
readonly inputs: readonly [{
|
|
113
|
+
readonly name: "token";
|
|
114
|
+
readonly internalType: "address";
|
|
115
|
+
readonly type: "address";
|
|
116
|
+
}, {
|
|
117
|
+
readonly name: "rate";
|
|
118
|
+
readonly internalType: "uint16";
|
|
119
|
+
readonly type: "uint16";
|
|
120
|
+
}];
|
|
121
|
+
readonly name: "setRate";
|
|
122
|
+
readonly outputs: readonly [];
|
|
123
|
+
readonly stateMutability: "nonpayable";
|
|
124
|
+
}, {
|
|
125
|
+
readonly type: "function";
|
|
126
|
+
readonly inputs: readonly [];
|
|
127
|
+
readonly name: "underlying";
|
|
128
|
+
readonly outputs: readonly [{
|
|
129
|
+
readonly name: "";
|
|
130
|
+
readonly internalType: "address";
|
|
131
|
+
readonly type: "address";
|
|
132
|
+
}];
|
|
133
|
+
readonly stateMutability: "view";
|
|
134
|
+
}, {
|
|
135
|
+
readonly type: "function";
|
|
136
|
+
readonly inputs: readonly [];
|
|
137
|
+
readonly name: "updateRates";
|
|
138
|
+
readonly outputs: readonly [];
|
|
139
|
+
readonly stateMutability: "nonpayable";
|
|
140
|
+
}, {
|
|
141
|
+
readonly type: "function";
|
|
142
|
+
readonly inputs: readonly [];
|
|
143
|
+
readonly name: "version";
|
|
144
|
+
readonly outputs: readonly [{
|
|
145
|
+
readonly name: "";
|
|
146
|
+
readonly internalType: "uint256";
|
|
147
|
+
readonly type: "uint256";
|
|
148
|
+
}];
|
|
149
|
+
readonly stateMutability: "view";
|
|
150
|
+
}, {
|
|
151
|
+
readonly type: "event";
|
|
152
|
+
readonly anonymous: false;
|
|
153
|
+
readonly inputs: readonly [{
|
|
154
|
+
readonly name: "token";
|
|
155
|
+
readonly internalType: "address";
|
|
156
|
+
readonly type: "address";
|
|
157
|
+
readonly indexed: true;
|
|
158
|
+
}];
|
|
159
|
+
readonly name: "AddToken";
|
|
160
|
+
}, {
|
|
161
|
+
readonly type: "event";
|
|
162
|
+
readonly anonymous: false;
|
|
163
|
+
readonly inputs: readonly [{
|
|
164
|
+
readonly name: "token";
|
|
165
|
+
readonly internalType: "address";
|
|
166
|
+
readonly type: "address";
|
|
167
|
+
readonly indexed: true;
|
|
168
|
+
}, {
|
|
169
|
+
readonly name: "rate";
|
|
170
|
+
readonly internalType: "uint16";
|
|
171
|
+
readonly type: "uint16";
|
|
172
|
+
readonly indexed: false;
|
|
173
|
+
}];
|
|
174
|
+
readonly name: "SetRate";
|
|
175
|
+
}];
|
|
176
|
+
export declare class RateKeeperFactory extends AbstractFactory<typeof abi> {
|
|
177
|
+
constructor();
|
|
178
|
+
}
|
|
179
|
+
export {};
|
|
@@ -5,6 +5,7 @@ import { CreditFactory } from "./factory/credit-factory.js";
|
|
|
5
5
|
import { LossPolicyFactory } from "./factory/loss-policy-factory.js";
|
|
6
6
|
import { PoolFactory } from "./factory/pool-factory.js";
|
|
7
7
|
import { PriceOracleFactory } from "./factory/price-oracle-factory.js";
|
|
8
|
+
import { RateKeeperFactory } from "./factory/rate-keeper-factory.js";
|
|
8
9
|
import { AddressProviderContract } from "./index.js";
|
|
9
10
|
import type { AddAssetParams, AllowTokenParams, DeployParams, ForbidAdapterParams, ForbidTokenParams, Market, PauseCreditManagerParams, PeripheryDomain, SetExpirationDateParams, SetFeesParams, SetPriceFeedParams, SetReservePriceFeedParams, SetTokenQuotaIncreaseFeeParams, UnpauseCreditManagerParams } from "./types.js";
|
|
10
11
|
declare const abi: readonly [{
|
|
@@ -1536,6 +1537,7 @@ export declare class MarketConfiguratorContract extends BaseContract<typeof abi>
|
|
|
1536
1537
|
readonly poolFactory: PoolFactory;
|
|
1537
1538
|
readonly priceOracleFactory: PriceOracleFactory;
|
|
1538
1539
|
readonly lossPolicyFactory: LossPolicyFactory;
|
|
1540
|
+
readonly rateKeeperFactory: RateKeeperFactory;
|
|
1539
1541
|
constructor(addr: Address, client: PublicClient<Transport, Chain>);
|
|
1540
1542
|
getAddressProvider(): Promise<AddressProviderContract>;
|
|
1541
1543
|
previewCreateMarket(params: {
|