@gearbox-protocol/sdk 3.0.0-vfour.68 → 3.0.0-vfour.69
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/index.cjs +165 -25
- package/dist/cjs/sdk/index.d.ts +91 -29
- package/dist/esm/sdk/index.d.mts +91 -29
- package/dist/esm/sdk/index.mjs +165 -25
- package/package.json +1 -1
package/dist/cjs/sdk/index.cjs
CHANGED
|
@@ -675,6 +675,11 @@ var iMarketCompressorAbi = [
|
|
|
675
675
|
type: "address",
|
|
676
676
|
internalType: "address"
|
|
677
677
|
},
|
|
678
|
+
{
|
|
679
|
+
name: "acl",
|
|
680
|
+
type: "address",
|
|
681
|
+
internalType: "address"
|
|
682
|
+
},
|
|
678
683
|
{
|
|
679
684
|
name: "name",
|
|
680
685
|
type: "string",
|
|
@@ -1638,6 +1643,11 @@ var iMarketCompressorAbi = [
|
|
|
1638
1643
|
type: "address",
|
|
1639
1644
|
internalType: "address"
|
|
1640
1645
|
},
|
|
1646
|
+
{
|
|
1647
|
+
name: "acl",
|
|
1648
|
+
type: "address",
|
|
1649
|
+
internalType: "address"
|
|
1650
|
+
},
|
|
1641
1651
|
{
|
|
1642
1652
|
name: "name",
|
|
1643
1653
|
type: "string",
|
|
@@ -2536,6 +2546,64 @@ var iMarketCompressorAbi = [
|
|
|
2536
2546
|
],
|
|
2537
2547
|
stateMutability: "view"
|
|
2538
2548
|
},
|
|
2549
|
+
{
|
|
2550
|
+
type: "function",
|
|
2551
|
+
name: "getUpdatablePriceFeeds",
|
|
2552
|
+
inputs: [
|
|
2553
|
+
{
|
|
2554
|
+
name: "filter",
|
|
2555
|
+
type: "tuple",
|
|
2556
|
+
internalType: "struct MarketFilter",
|
|
2557
|
+
components: [
|
|
2558
|
+
{
|
|
2559
|
+
name: "curators",
|
|
2560
|
+
type: "address[]",
|
|
2561
|
+
internalType: "address[]"
|
|
2562
|
+
},
|
|
2563
|
+
{
|
|
2564
|
+
name: "pools",
|
|
2565
|
+
type: "address[]",
|
|
2566
|
+
internalType: "address[]"
|
|
2567
|
+
},
|
|
2568
|
+
{
|
|
2569
|
+
name: "underlying",
|
|
2570
|
+
type: "address",
|
|
2571
|
+
internalType: "address"
|
|
2572
|
+
}
|
|
2573
|
+
]
|
|
2574
|
+
}
|
|
2575
|
+
],
|
|
2576
|
+
outputs: [
|
|
2577
|
+
{
|
|
2578
|
+
name: "updatablePriceFeeds",
|
|
2579
|
+
type: "tuple[]",
|
|
2580
|
+
internalType: "struct BaseParams[]",
|
|
2581
|
+
components: [
|
|
2582
|
+
{
|
|
2583
|
+
name: "addr",
|
|
2584
|
+
type: "address",
|
|
2585
|
+
internalType: "address"
|
|
2586
|
+
},
|
|
2587
|
+
{
|
|
2588
|
+
name: "version",
|
|
2589
|
+
type: "uint256",
|
|
2590
|
+
internalType: "uint256"
|
|
2591
|
+
},
|
|
2592
|
+
{
|
|
2593
|
+
name: "contractType",
|
|
2594
|
+
type: "bytes32",
|
|
2595
|
+
internalType: "bytes32"
|
|
2596
|
+
},
|
|
2597
|
+
{
|
|
2598
|
+
name: "serializedParams",
|
|
2599
|
+
type: "bytes",
|
|
2600
|
+
internalType: "bytes"
|
|
2601
|
+
}
|
|
2602
|
+
]
|
|
2603
|
+
}
|
|
2604
|
+
],
|
|
2605
|
+
stateMutability: "view"
|
|
2606
|
+
},
|
|
2539
2607
|
{
|
|
2540
2608
|
type: "function",
|
|
2541
2609
|
name: "version",
|
|
@@ -20695,10 +20763,10 @@ var AbstractPriceFeedContract = class extends BaseContract {
|
|
|
20695
20763
|
/**
|
|
20696
20764
|
* True if the contract deployed at this address implements IUpdatablePriceFeed interface
|
|
20697
20765
|
*/
|
|
20698
|
-
updatable;
|
|
20699
|
-
decimals;
|
|
20700
|
-
underlyingPriceFeeds;
|
|
20701
|
-
skipCheck;
|
|
20766
|
+
#updatable;
|
|
20767
|
+
#decimals;
|
|
20768
|
+
#underlyingPriceFeeds;
|
|
20769
|
+
#skipCheck;
|
|
20702
20770
|
hasLowerBoundCap = false;
|
|
20703
20771
|
constructor(sdk, args) {
|
|
20704
20772
|
super(sdk, {
|
|
@@ -20708,12 +20776,45 @@ var AbstractPriceFeedContract = class extends BaseContract {
|
|
|
20708
20776
|
contractType: args.baseParams.contractType,
|
|
20709
20777
|
version: args.baseParams.version
|
|
20710
20778
|
});
|
|
20711
|
-
this
|
|
20712
|
-
this
|
|
20713
|
-
this
|
|
20714
|
-
|
|
20715
|
-
|
|
20716
|
-
|
|
20779
|
+
this.#decimals = args.decimals;
|
|
20780
|
+
this.#updatable = args.updatable;
|
|
20781
|
+
this.#skipCheck = args.skipCheck;
|
|
20782
|
+
if (args.underlyingFeeds && args.underlyingStalenessPeriods) {
|
|
20783
|
+
this.#underlyingPriceFeeds = args.underlyingFeeds.map(
|
|
20784
|
+
(address, i) => new PriceFeedRef(
|
|
20785
|
+
this.sdk,
|
|
20786
|
+
address,
|
|
20787
|
+
args.underlyingStalenessPeriods[i]
|
|
20788
|
+
)
|
|
20789
|
+
);
|
|
20790
|
+
}
|
|
20791
|
+
}
|
|
20792
|
+
get loaded() {
|
|
20793
|
+
return this.#decimals !== void 0;
|
|
20794
|
+
}
|
|
20795
|
+
get decimals() {
|
|
20796
|
+
if (this.#decimals === void 0) {
|
|
20797
|
+
throw new Error("price feed has been initialized with BaseParams only");
|
|
20798
|
+
}
|
|
20799
|
+
return this.#decimals;
|
|
20800
|
+
}
|
|
20801
|
+
get updatable() {
|
|
20802
|
+
if (this.#updatable === void 0) {
|
|
20803
|
+
throw new Error("price feed has been initialized with BaseParams only");
|
|
20804
|
+
}
|
|
20805
|
+
return this.#updatable;
|
|
20806
|
+
}
|
|
20807
|
+
get skipCheck() {
|
|
20808
|
+
if (this.#skipCheck === void 0) {
|
|
20809
|
+
throw new Error("price feed has been initialized with BaseParams only");
|
|
20810
|
+
}
|
|
20811
|
+
return this.#skipCheck;
|
|
20812
|
+
}
|
|
20813
|
+
get underlyingPriceFeeds() {
|
|
20814
|
+
if (!this.#underlyingPriceFeeds) {
|
|
20815
|
+
throw new Error("price feed has been initialized with BaseParams only");
|
|
20816
|
+
}
|
|
20817
|
+
return this.#underlyingPriceFeeds;
|
|
20717
20818
|
}
|
|
20718
20819
|
get priceFeedType() {
|
|
20719
20820
|
return this.contractType;
|
|
@@ -20858,8 +20959,7 @@ var CompositePriceFeedContract = class extends AbstractPriceFeedContract {
|
|
|
20858
20959
|
super(sdk, {
|
|
20859
20960
|
...args,
|
|
20860
20961
|
name: "CompositePriceFeed",
|
|
20861
|
-
abi: compositePriceFeedAbi
|
|
20862
|
-
decimals: 8
|
|
20962
|
+
abi: compositePriceFeedAbi
|
|
20863
20963
|
});
|
|
20864
20964
|
}
|
|
20865
20965
|
get targetToBasePriceFeed() {
|
|
@@ -20991,7 +21091,6 @@ var Hooks = class {
|
|
|
20991
21091
|
}
|
|
20992
21092
|
};
|
|
20993
21093
|
var RedstonePriceFeedContract = class extends AbstractPriceFeedContract {
|
|
20994
|
-
decimals = 8;
|
|
20995
21094
|
dataServiceId;
|
|
20996
21095
|
dataId;
|
|
20997
21096
|
signers;
|
|
@@ -21339,7 +21438,7 @@ var PriceFeedRegister = class extends SDKConstruct {
|
|
|
21339
21438
|
}
|
|
21340
21439
|
getOrCreate(data) {
|
|
21341
21440
|
const existing = this.#feeds.get(data.baseParams.addr);
|
|
21342
|
-
if (existing) {
|
|
21441
|
+
if (existing?.loaded) {
|
|
21343
21442
|
return existing;
|
|
21344
21443
|
}
|
|
21345
21444
|
const feed = this.#create(data);
|
|
@@ -21353,6 +21452,36 @@ var PriceFeedRegister = class extends SDKConstruct {
|
|
|
21353
21452
|
setRedstoneHistoricalTimestamp(timestampMs) {
|
|
21354
21453
|
this.#redstoneUpdater.setHistoricalTimestamp(timestampMs);
|
|
21355
21454
|
}
|
|
21455
|
+
/**
|
|
21456
|
+
* Loads PARTIAL information about all updatable price feeds from MarketCompressor
|
|
21457
|
+
* This can later be used to load price feed updates
|
|
21458
|
+
*/
|
|
21459
|
+
async loadUpdatablePriceFeeds(curators, pools) {
|
|
21460
|
+
const marketCompressorAddress = this.sdk.addressProvider.getAddress(
|
|
21461
|
+
AP_MARKET_COMPRESSOR,
|
|
21462
|
+
310
|
|
21463
|
+
);
|
|
21464
|
+
const feedsData = await this.provider.publicClient.readContract({
|
|
21465
|
+
address: marketCompressorAddress,
|
|
21466
|
+
abi: iMarketCompressorAbi,
|
|
21467
|
+
functionName: "getUpdatablePriceFeeds",
|
|
21468
|
+
args: [
|
|
21469
|
+
{
|
|
21470
|
+
curators: curators ?? this.sdk.marketRegister.curators,
|
|
21471
|
+
pools: pools ?? [],
|
|
21472
|
+
underlying: ADDRESS_0X0
|
|
21473
|
+
}
|
|
21474
|
+
],
|
|
21475
|
+
// It's passed as ...rest in viem readContract action, but this might change
|
|
21476
|
+
// @ts-ignore
|
|
21477
|
+
gas: 500000000n
|
|
21478
|
+
});
|
|
21479
|
+
for (const data of feedsData) {
|
|
21480
|
+
const feed = this.#create({ baseParams: data });
|
|
21481
|
+
this.#feeds.upsert(feed.address, feed);
|
|
21482
|
+
}
|
|
21483
|
+
this.logger?.debug(`loaded ${feedsData.length} updatable price feeds`);
|
|
21484
|
+
}
|
|
21356
21485
|
#create(data) {
|
|
21357
21486
|
const contractType = bytes32ToString(
|
|
21358
21487
|
data.baseParams.contractType
|
|
@@ -21675,6 +21804,7 @@ var priceFeedToTicker = {
|
|
|
21675
21804
|
|
|
21676
21805
|
// src/sdk/market/MarketFactory.ts
|
|
21677
21806
|
var MarketFactory = class extends SDKConstruct {
|
|
21807
|
+
acl;
|
|
21678
21808
|
riskCurator;
|
|
21679
21809
|
poolFactory;
|
|
21680
21810
|
priceOracle;
|
|
@@ -21687,6 +21817,7 @@ var MarketFactory = class extends SDKConstruct {
|
|
|
21687
21817
|
super(sdk);
|
|
21688
21818
|
this.state = marketData;
|
|
21689
21819
|
this.riskCurator = marketData.owner;
|
|
21820
|
+
this.acl = marketData.acl;
|
|
21690
21821
|
for (const t of marketData.tokens) {
|
|
21691
21822
|
sdk.tokensMeta.upsert(t.addr, t);
|
|
21692
21823
|
sdk.provider.addressLabels.set(t.addr, t.symbol);
|
|
@@ -21985,21 +22116,30 @@ var MarketRegister = class extends SDKConstruct {
|
|
|
21985
22116
|
AP_MARKET_COMPRESSOR,
|
|
21986
22117
|
310
|
|
21987
22118
|
);
|
|
21988
|
-
|
|
21989
|
-
|
|
21990
|
-
|
|
21991
|
-
|
|
21992
|
-
|
|
22119
|
+
await this.sdk.priceFeeds.loadUpdatablePriceFeeds(curators, pools);
|
|
22120
|
+
const { txs } = await this.sdk.priceFeeds.generatePriceFeedsUpdateTxs();
|
|
22121
|
+
const resp = await simulateMulticall(this.provider.publicClient, {
|
|
22122
|
+
contracts: [
|
|
22123
|
+
...txs.map(rawTxToMulticallPriceUpdate),
|
|
21993
22124
|
{
|
|
21994
|
-
|
|
21995
|
-
|
|
21996
|
-
|
|
22125
|
+
abi: iMarketCompressorAbi,
|
|
22126
|
+
address: marketCompressorAddress,
|
|
22127
|
+
functionName: "getMarkets",
|
|
22128
|
+
args: [
|
|
22129
|
+
{
|
|
22130
|
+
curators,
|
|
22131
|
+
pools,
|
|
22132
|
+
underlying: ADDRESS_0X0
|
|
22133
|
+
}
|
|
22134
|
+
]
|
|
21997
22135
|
}
|
|
21998
22136
|
],
|
|
21999
|
-
|
|
22000
|
-
|
|
22001
|
-
|
|
22137
|
+
allowFailure: false,
|
|
22138
|
+
gas: 550000000n,
|
|
22139
|
+
batchSize: 0
|
|
22140
|
+
// we cannot have price updates and compressor request in different batches
|
|
22002
22141
|
});
|
|
22142
|
+
const markets = resp.pop();
|
|
22003
22143
|
for (const data of markets) {
|
|
22004
22144
|
this.#markets.upsert(
|
|
22005
22145
|
data.pool.baseParams.addr,
|
package/dist/cjs/sdk/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Address, Chain, Transport, PublicClient, Abi, Log, ContractEventName, DecodeFunctionDataReturnType, Hex, ContractFunctionName, EncodeFunctionDataParameters, TransactionReceipt, UnionOmit, GetContractReturnType, Client, ContractFunctionParameters, CallParameters, MulticallContracts, Narrow, AbiStateMutability, MulticallResults, GetChainContractAddressErrorType, ReadContractErrorType, GetContractErrorReturnType, EncodeFunctionDataErrorType, DecodeFunctionResultErrorType } from 'viem';
|
|
1
|
+
import { Address, Chain, Transport, PublicClient, Abi, Log, ContractEventName, DecodeFunctionDataReturnType, Hex, ContractFunctionName, EncodeFunctionDataParameters, TransactionReceipt, UnionOmit, RequiredBy, GetContractReturnType, Client, ContractFunctionParameters, CallParameters, MulticallContracts, Narrow, AbiStateMutability, MulticallResults, GetChainContractAddressErrorType, ReadContractErrorType, GetContractErrorReturnType, EncodeFunctionDataErrorType, DecodeFunctionResultErrorType } from 'viem';
|
|
2
2
|
import { AbiParametersToPrimitiveTypes, ExtractAbiFunction } from 'abitype';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -1191,6 +1191,10 @@ declare const iMarketCompressorAbi: readonly [{
|
|
|
1191
1191
|
readonly name: "owner";
|
|
1192
1192
|
readonly type: "address";
|
|
1193
1193
|
readonly internalType: "address";
|
|
1194
|
+
}, {
|
|
1195
|
+
readonly name: "acl";
|
|
1196
|
+
readonly type: "address";
|
|
1197
|
+
readonly internalType: "address";
|
|
1194
1198
|
}, {
|
|
1195
1199
|
readonly name: "name";
|
|
1196
1200
|
readonly type: "string";
|
|
@@ -1941,6 +1945,10 @@ declare const iMarketCompressorAbi: readonly [{
|
|
|
1941
1945
|
readonly name: "owner";
|
|
1942
1946
|
readonly type: "address";
|
|
1943
1947
|
readonly internalType: "address";
|
|
1948
|
+
}, {
|
|
1949
|
+
readonly name: "acl";
|
|
1950
|
+
readonly type: "address";
|
|
1951
|
+
readonly internalType: "address";
|
|
1944
1952
|
}, {
|
|
1945
1953
|
readonly name: "name";
|
|
1946
1954
|
readonly type: "string";
|
|
@@ -2641,6 +2649,50 @@ declare const iMarketCompressorAbi: readonly [{
|
|
|
2641
2649
|
}];
|
|
2642
2650
|
}];
|
|
2643
2651
|
readonly stateMutability: "view";
|
|
2652
|
+
}, {
|
|
2653
|
+
readonly type: "function";
|
|
2654
|
+
readonly name: "getUpdatablePriceFeeds";
|
|
2655
|
+
readonly inputs: readonly [{
|
|
2656
|
+
readonly name: "filter";
|
|
2657
|
+
readonly type: "tuple";
|
|
2658
|
+
readonly internalType: "struct MarketFilter";
|
|
2659
|
+
readonly components: readonly [{
|
|
2660
|
+
readonly name: "curators";
|
|
2661
|
+
readonly type: "address[]";
|
|
2662
|
+
readonly internalType: "address[]";
|
|
2663
|
+
}, {
|
|
2664
|
+
readonly name: "pools";
|
|
2665
|
+
readonly type: "address[]";
|
|
2666
|
+
readonly internalType: "address[]";
|
|
2667
|
+
}, {
|
|
2668
|
+
readonly name: "underlying";
|
|
2669
|
+
readonly type: "address";
|
|
2670
|
+
readonly internalType: "address";
|
|
2671
|
+
}];
|
|
2672
|
+
}];
|
|
2673
|
+
readonly outputs: readonly [{
|
|
2674
|
+
readonly name: "updatablePriceFeeds";
|
|
2675
|
+
readonly type: "tuple[]";
|
|
2676
|
+
readonly internalType: "struct BaseParams[]";
|
|
2677
|
+
readonly components: readonly [{
|
|
2678
|
+
readonly name: "addr";
|
|
2679
|
+
readonly type: "address";
|
|
2680
|
+
readonly internalType: "address";
|
|
2681
|
+
}, {
|
|
2682
|
+
readonly name: "version";
|
|
2683
|
+
readonly type: "uint256";
|
|
2684
|
+
readonly internalType: "uint256";
|
|
2685
|
+
}, {
|
|
2686
|
+
readonly name: "contractType";
|
|
2687
|
+
readonly type: "bytes32";
|
|
2688
|
+
readonly internalType: "bytes32";
|
|
2689
|
+
}, {
|
|
2690
|
+
readonly name: "serializedParams";
|
|
2691
|
+
readonly type: "bytes";
|
|
2692
|
+
readonly internalType: "bytes";
|
|
2693
|
+
}];
|
|
2694
|
+
}];
|
|
2695
|
+
readonly stateMutability: "view";
|
|
2644
2696
|
}, {
|
|
2645
2697
|
readonly type: "function";
|
|
2646
2698
|
readonly name: "version";
|
|
@@ -22146,6 +22198,11 @@ interface IPriceFeedContract extends IBaseContract {
|
|
|
22146
22198
|
* True if the contract deployed at this address implements IUpdatablePriceFeed interface
|
|
22147
22199
|
*/
|
|
22148
22200
|
readonly updatable: boolean;
|
|
22201
|
+
/**
|
|
22202
|
+
* It's possible to create PriceFeed with base params only.
|
|
22203
|
+
* This flag idicates that all the price feed data (decimals, skip check, dependencies...) has been loaded from compressor
|
|
22204
|
+
*/
|
|
22205
|
+
readonly loaded: boolean;
|
|
22149
22206
|
answer: (overrides?: {
|
|
22150
22207
|
blockNumber?: bigint;
|
|
22151
22208
|
}) => Promise<bigint>;
|
|
@@ -22175,20 +22232,20 @@ declare class PriceFeedRef extends SDKConstruct {
|
|
|
22175
22232
|
stateHuman(raw?: boolean): PriceFeedStateHuman;
|
|
22176
22233
|
}
|
|
22177
22234
|
|
|
22178
|
-
type
|
|
22235
|
+
type PartialPriceFeedTreeNode = RequiredBy<Partial<PriceFeedTreeNode>, "baseParams">;
|
|
22236
|
+
type PriceFeedConstructorArgs<abi extends Abi | readonly unknown[]> = PartialPriceFeedTreeNode & {
|
|
22179
22237
|
abi: abi;
|
|
22180
22238
|
name: string;
|
|
22181
22239
|
};
|
|
22182
22240
|
declare abstract class AbstractPriceFeedContract<const abi extends Abi | readonly unknown[]> extends BaseContract<abi> implements IPriceFeedContract {
|
|
22183
|
-
|
|
22184
|
-
* True if the contract deployed at this address implements IUpdatablePriceFeed interface
|
|
22185
|
-
*/
|
|
22186
|
-
readonly updatable: boolean;
|
|
22187
|
-
readonly decimals: number;
|
|
22188
|
-
readonly underlyingPriceFeeds: PriceFeedRef[];
|
|
22189
|
-
readonly skipCheck: boolean;
|
|
22241
|
+
#private;
|
|
22190
22242
|
hasLowerBoundCap: boolean;
|
|
22191
22243
|
constructor(sdk: GearboxSDK, args: PriceFeedConstructorArgs<abi>);
|
|
22244
|
+
get loaded(): boolean;
|
|
22245
|
+
get decimals(): number;
|
|
22246
|
+
get updatable(): boolean;
|
|
22247
|
+
get skipCheck(): boolean;
|
|
22248
|
+
get underlyingPriceFeeds(): readonly PriceFeedRef[];
|
|
22192
22249
|
get priceFeedType(): PriceFeedContractType;
|
|
22193
22250
|
stateHuman(raw?: boolean): UnionOmit<PriceFeedStateHuman, "stalenessPeriod">;
|
|
22194
22251
|
currentLowerBound(): Promise<bigint>;
|
|
@@ -22211,62 +22268,62 @@ declare abstract class AbstractLPPriceFeedContract<const abi extends Abi | reado
|
|
|
22211
22268
|
|
|
22212
22269
|
type abi$q = typeof bptStablePriceFeedAbi;
|
|
22213
22270
|
declare class BalancerStablePriceFeedContract extends AbstractLPPriceFeedContract<abi$q> {
|
|
22214
|
-
constructor(sdk: GearboxSDK, args:
|
|
22271
|
+
constructor(sdk: GearboxSDK, args: PartialPriceFeedTreeNode);
|
|
22215
22272
|
getValue(): Promise<bigint>;
|
|
22216
22273
|
}
|
|
22217
22274
|
|
|
22218
22275
|
type abi$p = typeof bptWeightedPriceFeedAbi;
|
|
22219
22276
|
declare class BalancerWeightedPriceFeedContract extends AbstractLPPriceFeedContract<abi$p> {
|
|
22220
|
-
constructor(sdk: GearboxSDK, args:
|
|
22277
|
+
constructor(sdk: GearboxSDK, args: PartialPriceFeedTreeNode);
|
|
22221
22278
|
getValue(): Promise<bigint>;
|
|
22222
22279
|
}
|
|
22223
22280
|
|
|
22224
22281
|
type abi$o = typeof boundedPriceFeedAbi;
|
|
22225
22282
|
declare class BoundedPriceFeedContract extends AbstractPriceFeedContract<abi$o> {
|
|
22226
22283
|
upperBound: bigint;
|
|
22227
|
-
constructor(sdk: GearboxSDK, args:
|
|
22284
|
+
constructor(sdk: GearboxSDK, args: PartialPriceFeedTreeNode);
|
|
22228
22285
|
stateHuman(raw?: boolean): Omit<BoundedOracleStateHuman, "stalenessPeriod">;
|
|
22229
22286
|
}
|
|
22230
22287
|
|
|
22231
22288
|
type abi$n = typeof chainlinkReadableAggregatorAbi;
|
|
22232
22289
|
declare class ChainlinkPriceFeedContract extends AbstractPriceFeedContract<abi$n> {
|
|
22233
|
-
constructor(sdk: GearboxSDK, args:
|
|
22290
|
+
constructor(sdk: GearboxSDK, args: PartialPriceFeedTreeNode);
|
|
22234
22291
|
}
|
|
22235
22292
|
|
|
22236
22293
|
type abi$m = typeof compositePriceFeedAbi;
|
|
22237
22294
|
declare class CompositePriceFeedContract extends AbstractPriceFeedContract<abi$m> {
|
|
22238
|
-
constructor(sdk: GearboxSDK, args:
|
|
22295
|
+
constructor(sdk: GearboxSDK, args: PartialPriceFeedTreeNode);
|
|
22239
22296
|
get targetToBasePriceFeed(): PriceFeedRef;
|
|
22240
22297
|
get baseToUsdPriceFeed(): PriceFeedRef;
|
|
22241
22298
|
}
|
|
22242
22299
|
|
|
22243
22300
|
type abi$l = typeof curveCryptoLpPriceFeedAbi;
|
|
22244
22301
|
declare class CurveCryptoPriceFeedContract extends AbstractLPPriceFeedContract<abi$l> {
|
|
22245
|
-
constructor(sdk: GearboxSDK, args:
|
|
22302
|
+
constructor(sdk: GearboxSDK, args: PartialPriceFeedTreeNode);
|
|
22246
22303
|
getValue(): Promise<bigint>;
|
|
22247
22304
|
}
|
|
22248
22305
|
|
|
22249
22306
|
type abi$k = typeof curveStableLpPriceFeedAbi;
|
|
22250
22307
|
declare class CurveStablePriceFeedContract extends AbstractLPPriceFeedContract<abi$k> {
|
|
22251
|
-
constructor(sdk: GearboxSDK, args:
|
|
22308
|
+
constructor(sdk: GearboxSDK, args: PartialPriceFeedTreeNode);
|
|
22252
22309
|
getValue(): Promise<bigint>;
|
|
22253
22310
|
}
|
|
22254
22311
|
|
|
22255
22312
|
type abi$j = typeof curveUsdPriceFeedAbi;
|
|
22256
22313
|
declare class CurveUSDPriceFeedContract extends AbstractLPPriceFeedContract<abi$j> {
|
|
22257
|
-
constructor(sdk: GearboxSDK, args:
|
|
22314
|
+
constructor(sdk: GearboxSDK, args: PartialPriceFeedTreeNode);
|
|
22258
22315
|
getValue(): Promise<bigint>;
|
|
22259
22316
|
}
|
|
22260
22317
|
|
|
22261
22318
|
type abi$i = typeof erc4626PriceFeedAbi;
|
|
22262
22319
|
declare class Erc4626PriceFeedContract extends AbstractLPPriceFeedContract<abi$i> {
|
|
22263
|
-
constructor(sdk: GearboxSDK, args:
|
|
22320
|
+
constructor(sdk: GearboxSDK, args: PartialPriceFeedTreeNode);
|
|
22264
22321
|
getValue(): Promise<bigint>;
|
|
22265
22322
|
}
|
|
22266
22323
|
|
|
22267
22324
|
type abi$h = typeof mellowLrtPriceFeedAbi;
|
|
22268
22325
|
declare class MellowLRTPriceFeedContract extends AbstractLPPriceFeedContract<abi$h> {
|
|
22269
|
-
constructor(sdk: GearboxSDK, args:
|
|
22326
|
+
constructor(sdk: GearboxSDK, args: PartialPriceFeedTreeNode);
|
|
22270
22327
|
getValue(): Promise<bigint>;
|
|
22271
22328
|
}
|
|
22272
22329
|
|
|
@@ -22305,16 +22362,20 @@ declare class PriceFeedRegister extends SDKConstruct implements IHooks<PriceFeed
|
|
|
22305
22362
|
* @param timestampMs in milliseconds
|
|
22306
22363
|
*/
|
|
22307
22364
|
setRedstoneHistoricalTimestamp(timestampMs: number): void;
|
|
22365
|
+
/**
|
|
22366
|
+
* Loads PARTIAL information about all updatable price feeds from MarketCompressor
|
|
22367
|
+
* This can later be used to load price feed updates
|
|
22368
|
+
*/
|
|
22369
|
+
loadUpdatablePriceFeeds(curators?: Address[], pools?: Address[]): Promise<void>;
|
|
22308
22370
|
}
|
|
22309
22371
|
|
|
22310
22372
|
type abi$g = typeof redstonePriceFeedAbi;
|
|
22311
22373
|
declare class RedstonePriceFeedContract extends AbstractPriceFeedContract<abi$g> {
|
|
22312
|
-
|
|
22313
|
-
|
|
22314
|
-
|
|
22315
|
-
|
|
22316
|
-
|
|
22317
|
-
constructor(sdk: GearboxSDK, args: PriceFeedTreeNode);
|
|
22374
|
+
readonly dataServiceId: string;
|
|
22375
|
+
readonly dataId: string;
|
|
22376
|
+
readonly signers: Hex[];
|
|
22377
|
+
readonly signersThreshold: number;
|
|
22378
|
+
constructor(sdk: GearboxSDK, args: PartialPriceFeedTreeNode);
|
|
22318
22379
|
stateHuman(raw?: boolean): Omit<RedstonePriceFeedStateHuman, "stalenessPeriod">;
|
|
22319
22380
|
}
|
|
22320
22381
|
|
|
@@ -22429,19 +22490,19 @@ declare function rawTxToMulticallPriceUpdate(tx: RawTx): {
|
|
|
22429
22490
|
|
|
22430
22491
|
type abi$f = typeof wstEthPriceFeedAbi;
|
|
22431
22492
|
declare class WstETHPriceFeedContract extends AbstractLPPriceFeedContract<abi$f> {
|
|
22432
|
-
constructor(sdk: GearboxSDK, args:
|
|
22493
|
+
constructor(sdk: GearboxSDK, args: PartialPriceFeedTreeNode);
|
|
22433
22494
|
getValue(): Promise<bigint>;
|
|
22434
22495
|
}
|
|
22435
22496
|
|
|
22436
22497
|
type abi$e = typeof yearnPriceFeedAbi;
|
|
22437
22498
|
declare class YearnPriceFeedContract extends AbstractLPPriceFeedContract<abi$e> {
|
|
22438
|
-
constructor(sdk: GearboxSDK, args:
|
|
22499
|
+
constructor(sdk: GearboxSDK, args: PartialPriceFeedTreeNode);
|
|
22439
22500
|
getValue(): Promise<bigint>;
|
|
22440
22501
|
}
|
|
22441
22502
|
|
|
22442
22503
|
type abi$d = typeof zeroPriceFeedAbi;
|
|
22443
22504
|
declare class ZeroPriceFeedContract extends AbstractPriceFeedContract<abi$d> {
|
|
22444
|
-
constructor(sdk: GearboxSDK, args:
|
|
22505
|
+
constructor(sdk: GearboxSDK, args: PartialPriceFeedTreeNode);
|
|
22445
22506
|
}
|
|
22446
22507
|
|
|
22447
22508
|
type abi$c = typeof priceOracleV3Abi;
|
|
@@ -24286,6 +24347,7 @@ declare class PoolFactory extends SDKConstruct {
|
|
|
24286
24347
|
}
|
|
24287
24348
|
|
|
24288
24349
|
declare class MarketFactory extends SDKConstruct {
|
|
24350
|
+
readonly acl: Address;
|
|
24289
24351
|
readonly riskCurator: Address;
|
|
24290
24352
|
readonly poolFactory: PoolFactory;
|
|
24291
24353
|
readonly priceOracle: PriceOracleContract;
|
|
@@ -25258,4 +25320,4 @@ type MulticallErrorType = GetChainContractAddressErrorType | ReadContractErrorTy
|
|
|
25258
25320
|
*/
|
|
25259
25321
|
declare function simulateMulticall<const contracts extends readonly unknown[], chain extends Chain | undefined, allowFailure extends boolean = true>(client: Client<Transport, chain>, parameters: MulticallParameters<contracts, allowFailure>): Promise<MulticallReturnType<contracts, allowFailure>>;
|
|
25260
25322
|
|
|
25261
|
-
export { ADDRESS_0X0, ADDRESS_PROVIDER, ADDRESS_PROVIDER_BLOCK, AP_ACCOUNT_FACTORY, AP_ACL, AP_ADAPTER_COMPRESSOR, AP_BOT_LIST, AP_CONTRACTS_REGISTER, AP_CONTROLLER_TIMELOCK, AP_CREDIT_ACCOUNT_COMPRESSOR, AP_DATA_COMPRESSOR, AP_DEGEN_DISTRIBUTOR, AP_DEGEN_NFT, AP_DELEVERAGE_BOT_HV, AP_DELEVERAGE_BOT_LV, AP_DELEVERAGE_BOT_PEGGED, AP_GEAR_STAKING, AP_GEAR_TOKEN, AP_INFLATION_ATTACK_BLOCKER, AP_INSOLVENCY_CHECKER, AP_MARKET_COMPRESSOR, AP_MARKET_CONFIGURATOR, AP_MULTI_PAUSE, AP_PARTIAL_LIQUIDATION_BOT, AP_PRICE_FEED_COMPRESSOR, AP_PRICE_ORACLE, AP_ROUTER, AP_TREASURY, AP_WETH_GATEWAY, AP_WETH_TOKEN, AP_ZAPPER_REGISTER, AP_ZERO_PRICE_FEED, AbstractPriceFeedContract, type AdapterContractType, type AdapterData, AddressLabeller, AddressMap, AddressProviderContractV3_1, type AddressProviderV3StateHuman, type Asset, type AssetPriceFeedStateHuman, BalancerStablePriceFeedContract, BalancerV2VaultAdapterContract, BalancerWeightedPriceFeedContract, BaseContract, type BaseContractOptions, type BaseContractStateHuman, type BaseParams, type BasePriceFeedStateHuman, BotListContract, type BotListStateHuman, BotPermissions, type BoundedOracleStateHuman, BoundedPriceFeedContract, CamelotV3AdapterContract, ChainlinkPriceFeedContract, CompositePriceFeedContract, type ConnectionOptions, type ContractMethod, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, type CoreStateHuman, type CreditAccountData, type CreditAccountFilter, CreditAccountsService, CreditConfiguratorContract, type CreditConfiguratorState, type CreditConfiguratorStateHuman, type CreditFacadeState, type CreditFacadeStateHuman, CreditFacadeV300Contract, CreditFacadeV310Contract, CreditFactory, type CreditFactoryStateHuman, CreditManagerContract, type CreditManagerData, type CreditManagerDebtParams, type CreditManagerDebtParamsHuman, type CreditManagerState, type CreditManagerStateHuman, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveCryptoPriceFeedContract, type CurvePoolStruct, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, CurveV1AdapterStETHContract, CurveV1AdapterStableNGContract, ERC4626AdapterContract, Erc4626PriceFeedContract, type EtherscanURLParam, type FindClosePathInput, GaugeContract, type GaugeParams, type GaugeParamsHuman, type GaugeStateHuman, GearStakingContract, type GearStakingV3StateHuman, GearboxSDK, type GearboxStateHuman, type IAdapterContract, type IBaseContract, type ILPPriceFeedContract, type ILogger, type IPriceFeedContract, LinearModelContract, type LinearModelStateHuman, type LogFn, MAX_UINT16, MAX_UINT256, MIN_INT96, type MarketData, MarketFactory, MarketRegister, type MarketStateHuman, MellowLRTPriceFeedContract, type MultiCall, type MulticallErrorType, type MulticallParameters, type MulticallReturnType, NOT_DEPLOYED, NO_VERSION, type NetworkOptions, type NetworkType, type OnDemandPriceUpdate, type OpenStrategyResult, PERCENTAGE_DECIMALS, PERCENTAGE_FACTOR, PRICE_DECIMALS, PRICE_DECIMALS_POW, type PathOption, type PathOptionSerie, PoolContract, type PoolData, PoolFactory, type PoolFactoryStateHuman, PoolQuotaKeeperContract, type PoolQuotaKeeperData, type PoolQuotaKeeperStateHuman, type PoolStateHuman, type PriceFeedConstructorArgs, type PriceFeedContractType, type PriceFeedMapEntry, PriceFeedRef, PriceFeedRegister, type PriceFeedRegisterHooks, type PriceFeedStateHuman, type PriceFeedTreeNode, type PriceFeedUsageType, PriceOracleContract, type PriceOracleData, type PriceOracleV3StateHuman, Provider, type QuotaParamsHuman, type QuotaState, RAY, RAY_DECIMALS_POW, type RateKeeperData, type RawTx, RedstonePriceFeedContract, type RedstonePriceFeedStateHuman, type RouterCloseResult, type RouterHooks, type RouterResult, RouterV3Contract, SDKConstruct, type SDKHooks, type SDKOptions, SUPPORTED_CHAINS, type SwapOperation, type SwapTask, type SyncStateOptions, TIMELOCK, type TVL, type TokenMetaData, TokensMeta, type TransportOptions, USDC, UniswapV2AdapterContract, UniswapV3AdapterContract, type UpdatePriceFeedsResult, VelodromeV2RouterAdapterContract, VotingContractStatus, WAD, WAD_DECIMALS_POW, WstETHPriceFeedContract, WstETHV1AdapterContract, YearnPriceFeedContract, YearnV2RouterAdapterContract, ZeroPriceFeedContract, botPermissionsToString, bytes32ToString, chains, childLogger, createAdapter, createRawTx, createTransport, detectNetwork, etherscanUrl, filterDust, fmtBinaryMask, formatBN, formatBNvalue, formatBn4dig, formatDuration, formatNumberToString_, halfRAY, json_parse, json_stringify, numberWithCommas, percentFmt, rawTxToMulticallPriceUpdate, simulateMulticall, toHumanFormat };
|
|
25323
|
+
export { ADDRESS_0X0, ADDRESS_PROVIDER, ADDRESS_PROVIDER_BLOCK, AP_ACCOUNT_FACTORY, AP_ACL, AP_ADAPTER_COMPRESSOR, AP_BOT_LIST, AP_CONTRACTS_REGISTER, AP_CONTROLLER_TIMELOCK, AP_CREDIT_ACCOUNT_COMPRESSOR, AP_DATA_COMPRESSOR, AP_DEGEN_DISTRIBUTOR, AP_DEGEN_NFT, AP_DELEVERAGE_BOT_HV, AP_DELEVERAGE_BOT_LV, AP_DELEVERAGE_BOT_PEGGED, AP_GEAR_STAKING, AP_GEAR_TOKEN, AP_INFLATION_ATTACK_BLOCKER, AP_INSOLVENCY_CHECKER, AP_MARKET_COMPRESSOR, AP_MARKET_CONFIGURATOR, AP_MULTI_PAUSE, AP_PARTIAL_LIQUIDATION_BOT, AP_PRICE_FEED_COMPRESSOR, AP_PRICE_ORACLE, AP_ROUTER, AP_TREASURY, AP_WETH_GATEWAY, AP_WETH_TOKEN, AP_ZAPPER_REGISTER, AP_ZERO_PRICE_FEED, AbstractPriceFeedContract, type AdapterContractType, type AdapterData, AddressLabeller, AddressMap, AddressProviderContractV3_1, type AddressProviderV3StateHuman, type Asset, type AssetPriceFeedStateHuman, BalancerStablePriceFeedContract, BalancerV2VaultAdapterContract, BalancerWeightedPriceFeedContract, BaseContract, type BaseContractOptions, type BaseContractStateHuman, type BaseParams, type BasePriceFeedStateHuman, BotListContract, type BotListStateHuman, BotPermissions, type BoundedOracleStateHuman, BoundedPriceFeedContract, CamelotV3AdapterContract, ChainlinkPriceFeedContract, CompositePriceFeedContract, type ConnectionOptions, type ContractMethod, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, type CoreStateHuman, type CreditAccountData, type CreditAccountFilter, CreditAccountsService, CreditConfiguratorContract, type CreditConfiguratorState, type CreditConfiguratorStateHuman, type CreditFacadeState, type CreditFacadeStateHuman, CreditFacadeV300Contract, CreditFacadeV310Contract, CreditFactory, type CreditFactoryStateHuman, CreditManagerContract, type CreditManagerData, type CreditManagerDebtParams, type CreditManagerDebtParamsHuman, type CreditManagerState, type CreditManagerStateHuman, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveCryptoPriceFeedContract, type CurvePoolStruct, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, CurveV1AdapterStETHContract, CurveV1AdapterStableNGContract, ERC4626AdapterContract, Erc4626PriceFeedContract, type EtherscanURLParam, type FindClosePathInput, GaugeContract, type GaugeParams, type GaugeParamsHuman, type GaugeStateHuman, GearStakingContract, type GearStakingV3StateHuman, GearboxSDK, type GearboxStateHuman, type IAdapterContract, type IBaseContract, type ILPPriceFeedContract, type ILogger, type IPriceFeedContract, LinearModelContract, type LinearModelStateHuman, type LogFn, MAX_UINT16, MAX_UINT256, MIN_INT96, type MarketData, MarketFactory, MarketRegister, type MarketStateHuman, MellowLRTPriceFeedContract, type MultiCall, type MulticallErrorType, type MulticallParameters, type MulticallReturnType, NOT_DEPLOYED, NO_VERSION, type NetworkOptions, type NetworkType, type OnDemandPriceUpdate, type OpenStrategyResult, PERCENTAGE_DECIMALS, PERCENTAGE_FACTOR, PRICE_DECIMALS, PRICE_DECIMALS_POW, type PartialPriceFeedTreeNode, type PathOption, type PathOptionSerie, PoolContract, type PoolData, PoolFactory, type PoolFactoryStateHuman, PoolQuotaKeeperContract, type PoolQuotaKeeperData, type PoolQuotaKeeperStateHuman, type PoolStateHuman, type PriceFeedConstructorArgs, type PriceFeedContractType, type PriceFeedMapEntry, PriceFeedRef, PriceFeedRegister, type PriceFeedRegisterHooks, type PriceFeedStateHuman, type PriceFeedTreeNode, type PriceFeedUsageType, PriceOracleContract, type PriceOracleData, type PriceOracleV3StateHuman, Provider, type QuotaParamsHuman, type QuotaState, RAY, RAY_DECIMALS_POW, type RateKeeperData, type RawTx, RedstonePriceFeedContract, type RedstonePriceFeedStateHuman, type RouterCloseResult, type RouterHooks, type RouterResult, RouterV3Contract, SDKConstruct, type SDKHooks, type SDKOptions, SUPPORTED_CHAINS, type SwapOperation, type SwapTask, type SyncStateOptions, TIMELOCK, type TVL, type TokenMetaData, TokensMeta, type TransportOptions, USDC, UniswapV2AdapterContract, UniswapV3AdapterContract, type UpdatePriceFeedsResult, VelodromeV2RouterAdapterContract, VotingContractStatus, WAD, WAD_DECIMALS_POW, WstETHPriceFeedContract, WstETHV1AdapterContract, YearnPriceFeedContract, YearnV2RouterAdapterContract, ZeroPriceFeedContract, botPermissionsToString, bytes32ToString, chains, childLogger, createAdapter, createRawTx, createTransport, detectNetwork, etherscanUrl, filterDust, fmtBinaryMask, formatBN, formatBNvalue, formatBn4dig, formatDuration, formatNumberToString_, halfRAY, json_parse, json_stringify, numberWithCommas, percentFmt, rawTxToMulticallPriceUpdate, simulateMulticall, toHumanFormat };
|
package/dist/esm/sdk/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Address, Chain, Transport, PublicClient, Abi, Log, ContractEventName, DecodeFunctionDataReturnType, Hex, ContractFunctionName, EncodeFunctionDataParameters, TransactionReceipt, UnionOmit, GetContractReturnType, Client, ContractFunctionParameters, CallParameters, MulticallContracts, Narrow, AbiStateMutability, MulticallResults, GetChainContractAddressErrorType, ReadContractErrorType, GetContractErrorReturnType, EncodeFunctionDataErrorType, DecodeFunctionResultErrorType } from 'viem';
|
|
1
|
+
import { Address, Chain, Transport, PublicClient, Abi, Log, ContractEventName, DecodeFunctionDataReturnType, Hex, ContractFunctionName, EncodeFunctionDataParameters, TransactionReceipt, UnionOmit, RequiredBy, GetContractReturnType, Client, ContractFunctionParameters, CallParameters, MulticallContracts, Narrow, AbiStateMutability, MulticallResults, GetChainContractAddressErrorType, ReadContractErrorType, GetContractErrorReturnType, EncodeFunctionDataErrorType, DecodeFunctionResultErrorType } from 'viem';
|
|
2
2
|
import { AbiParametersToPrimitiveTypes, ExtractAbiFunction } from 'abitype';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -1191,6 +1191,10 @@ declare const iMarketCompressorAbi: readonly [{
|
|
|
1191
1191
|
readonly name: "owner";
|
|
1192
1192
|
readonly type: "address";
|
|
1193
1193
|
readonly internalType: "address";
|
|
1194
|
+
}, {
|
|
1195
|
+
readonly name: "acl";
|
|
1196
|
+
readonly type: "address";
|
|
1197
|
+
readonly internalType: "address";
|
|
1194
1198
|
}, {
|
|
1195
1199
|
readonly name: "name";
|
|
1196
1200
|
readonly type: "string";
|
|
@@ -1941,6 +1945,10 @@ declare const iMarketCompressorAbi: readonly [{
|
|
|
1941
1945
|
readonly name: "owner";
|
|
1942
1946
|
readonly type: "address";
|
|
1943
1947
|
readonly internalType: "address";
|
|
1948
|
+
}, {
|
|
1949
|
+
readonly name: "acl";
|
|
1950
|
+
readonly type: "address";
|
|
1951
|
+
readonly internalType: "address";
|
|
1944
1952
|
}, {
|
|
1945
1953
|
readonly name: "name";
|
|
1946
1954
|
readonly type: "string";
|
|
@@ -2641,6 +2649,50 @@ declare const iMarketCompressorAbi: readonly [{
|
|
|
2641
2649
|
}];
|
|
2642
2650
|
}];
|
|
2643
2651
|
readonly stateMutability: "view";
|
|
2652
|
+
}, {
|
|
2653
|
+
readonly type: "function";
|
|
2654
|
+
readonly name: "getUpdatablePriceFeeds";
|
|
2655
|
+
readonly inputs: readonly [{
|
|
2656
|
+
readonly name: "filter";
|
|
2657
|
+
readonly type: "tuple";
|
|
2658
|
+
readonly internalType: "struct MarketFilter";
|
|
2659
|
+
readonly components: readonly [{
|
|
2660
|
+
readonly name: "curators";
|
|
2661
|
+
readonly type: "address[]";
|
|
2662
|
+
readonly internalType: "address[]";
|
|
2663
|
+
}, {
|
|
2664
|
+
readonly name: "pools";
|
|
2665
|
+
readonly type: "address[]";
|
|
2666
|
+
readonly internalType: "address[]";
|
|
2667
|
+
}, {
|
|
2668
|
+
readonly name: "underlying";
|
|
2669
|
+
readonly type: "address";
|
|
2670
|
+
readonly internalType: "address";
|
|
2671
|
+
}];
|
|
2672
|
+
}];
|
|
2673
|
+
readonly outputs: readonly [{
|
|
2674
|
+
readonly name: "updatablePriceFeeds";
|
|
2675
|
+
readonly type: "tuple[]";
|
|
2676
|
+
readonly internalType: "struct BaseParams[]";
|
|
2677
|
+
readonly components: readonly [{
|
|
2678
|
+
readonly name: "addr";
|
|
2679
|
+
readonly type: "address";
|
|
2680
|
+
readonly internalType: "address";
|
|
2681
|
+
}, {
|
|
2682
|
+
readonly name: "version";
|
|
2683
|
+
readonly type: "uint256";
|
|
2684
|
+
readonly internalType: "uint256";
|
|
2685
|
+
}, {
|
|
2686
|
+
readonly name: "contractType";
|
|
2687
|
+
readonly type: "bytes32";
|
|
2688
|
+
readonly internalType: "bytes32";
|
|
2689
|
+
}, {
|
|
2690
|
+
readonly name: "serializedParams";
|
|
2691
|
+
readonly type: "bytes";
|
|
2692
|
+
readonly internalType: "bytes";
|
|
2693
|
+
}];
|
|
2694
|
+
}];
|
|
2695
|
+
readonly stateMutability: "view";
|
|
2644
2696
|
}, {
|
|
2645
2697
|
readonly type: "function";
|
|
2646
2698
|
readonly name: "version";
|
|
@@ -22146,6 +22198,11 @@ interface IPriceFeedContract extends IBaseContract {
|
|
|
22146
22198
|
* True if the contract deployed at this address implements IUpdatablePriceFeed interface
|
|
22147
22199
|
*/
|
|
22148
22200
|
readonly updatable: boolean;
|
|
22201
|
+
/**
|
|
22202
|
+
* It's possible to create PriceFeed with base params only.
|
|
22203
|
+
* This flag idicates that all the price feed data (decimals, skip check, dependencies...) has been loaded from compressor
|
|
22204
|
+
*/
|
|
22205
|
+
readonly loaded: boolean;
|
|
22149
22206
|
answer: (overrides?: {
|
|
22150
22207
|
blockNumber?: bigint;
|
|
22151
22208
|
}) => Promise<bigint>;
|
|
@@ -22175,20 +22232,20 @@ declare class PriceFeedRef extends SDKConstruct {
|
|
|
22175
22232
|
stateHuman(raw?: boolean): PriceFeedStateHuman;
|
|
22176
22233
|
}
|
|
22177
22234
|
|
|
22178
|
-
type
|
|
22235
|
+
type PartialPriceFeedTreeNode = RequiredBy<Partial<PriceFeedTreeNode>, "baseParams">;
|
|
22236
|
+
type PriceFeedConstructorArgs<abi extends Abi | readonly unknown[]> = PartialPriceFeedTreeNode & {
|
|
22179
22237
|
abi: abi;
|
|
22180
22238
|
name: string;
|
|
22181
22239
|
};
|
|
22182
22240
|
declare abstract class AbstractPriceFeedContract<const abi extends Abi | readonly unknown[]> extends BaseContract<abi> implements IPriceFeedContract {
|
|
22183
|
-
|
|
22184
|
-
* True if the contract deployed at this address implements IUpdatablePriceFeed interface
|
|
22185
|
-
*/
|
|
22186
|
-
readonly updatable: boolean;
|
|
22187
|
-
readonly decimals: number;
|
|
22188
|
-
readonly underlyingPriceFeeds: PriceFeedRef[];
|
|
22189
|
-
readonly skipCheck: boolean;
|
|
22241
|
+
#private;
|
|
22190
22242
|
hasLowerBoundCap: boolean;
|
|
22191
22243
|
constructor(sdk: GearboxSDK, args: PriceFeedConstructorArgs<abi>);
|
|
22244
|
+
get loaded(): boolean;
|
|
22245
|
+
get decimals(): number;
|
|
22246
|
+
get updatable(): boolean;
|
|
22247
|
+
get skipCheck(): boolean;
|
|
22248
|
+
get underlyingPriceFeeds(): readonly PriceFeedRef[];
|
|
22192
22249
|
get priceFeedType(): PriceFeedContractType;
|
|
22193
22250
|
stateHuman(raw?: boolean): UnionOmit<PriceFeedStateHuman, "stalenessPeriod">;
|
|
22194
22251
|
currentLowerBound(): Promise<bigint>;
|
|
@@ -22211,62 +22268,62 @@ declare abstract class AbstractLPPriceFeedContract<const abi extends Abi | reado
|
|
|
22211
22268
|
|
|
22212
22269
|
type abi$q = typeof bptStablePriceFeedAbi;
|
|
22213
22270
|
declare class BalancerStablePriceFeedContract extends AbstractLPPriceFeedContract<abi$q> {
|
|
22214
|
-
constructor(sdk: GearboxSDK, args:
|
|
22271
|
+
constructor(sdk: GearboxSDK, args: PartialPriceFeedTreeNode);
|
|
22215
22272
|
getValue(): Promise<bigint>;
|
|
22216
22273
|
}
|
|
22217
22274
|
|
|
22218
22275
|
type abi$p = typeof bptWeightedPriceFeedAbi;
|
|
22219
22276
|
declare class BalancerWeightedPriceFeedContract extends AbstractLPPriceFeedContract<abi$p> {
|
|
22220
|
-
constructor(sdk: GearboxSDK, args:
|
|
22277
|
+
constructor(sdk: GearboxSDK, args: PartialPriceFeedTreeNode);
|
|
22221
22278
|
getValue(): Promise<bigint>;
|
|
22222
22279
|
}
|
|
22223
22280
|
|
|
22224
22281
|
type abi$o = typeof boundedPriceFeedAbi;
|
|
22225
22282
|
declare class BoundedPriceFeedContract extends AbstractPriceFeedContract<abi$o> {
|
|
22226
22283
|
upperBound: bigint;
|
|
22227
|
-
constructor(sdk: GearboxSDK, args:
|
|
22284
|
+
constructor(sdk: GearboxSDK, args: PartialPriceFeedTreeNode);
|
|
22228
22285
|
stateHuman(raw?: boolean): Omit<BoundedOracleStateHuman, "stalenessPeriod">;
|
|
22229
22286
|
}
|
|
22230
22287
|
|
|
22231
22288
|
type abi$n = typeof chainlinkReadableAggregatorAbi;
|
|
22232
22289
|
declare class ChainlinkPriceFeedContract extends AbstractPriceFeedContract<abi$n> {
|
|
22233
|
-
constructor(sdk: GearboxSDK, args:
|
|
22290
|
+
constructor(sdk: GearboxSDK, args: PartialPriceFeedTreeNode);
|
|
22234
22291
|
}
|
|
22235
22292
|
|
|
22236
22293
|
type abi$m = typeof compositePriceFeedAbi;
|
|
22237
22294
|
declare class CompositePriceFeedContract extends AbstractPriceFeedContract<abi$m> {
|
|
22238
|
-
constructor(sdk: GearboxSDK, args:
|
|
22295
|
+
constructor(sdk: GearboxSDK, args: PartialPriceFeedTreeNode);
|
|
22239
22296
|
get targetToBasePriceFeed(): PriceFeedRef;
|
|
22240
22297
|
get baseToUsdPriceFeed(): PriceFeedRef;
|
|
22241
22298
|
}
|
|
22242
22299
|
|
|
22243
22300
|
type abi$l = typeof curveCryptoLpPriceFeedAbi;
|
|
22244
22301
|
declare class CurveCryptoPriceFeedContract extends AbstractLPPriceFeedContract<abi$l> {
|
|
22245
|
-
constructor(sdk: GearboxSDK, args:
|
|
22302
|
+
constructor(sdk: GearboxSDK, args: PartialPriceFeedTreeNode);
|
|
22246
22303
|
getValue(): Promise<bigint>;
|
|
22247
22304
|
}
|
|
22248
22305
|
|
|
22249
22306
|
type abi$k = typeof curveStableLpPriceFeedAbi;
|
|
22250
22307
|
declare class CurveStablePriceFeedContract extends AbstractLPPriceFeedContract<abi$k> {
|
|
22251
|
-
constructor(sdk: GearboxSDK, args:
|
|
22308
|
+
constructor(sdk: GearboxSDK, args: PartialPriceFeedTreeNode);
|
|
22252
22309
|
getValue(): Promise<bigint>;
|
|
22253
22310
|
}
|
|
22254
22311
|
|
|
22255
22312
|
type abi$j = typeof curveUsdPriceFeedAbi;
|
|
22256
22313
|
declare class CurveUSDPriceFeedContract extends AbstractLPPriceFeedContract<abi$j> {
|
|
22257
|
-
constructor(sdk: GearboxSDK, args:
|
|
22314
|
+
constructor(sdk: GearboxSDK, args: PartialPriceFeedTreeNode);
|
|
22258
22315
|
getValue(): Promise<bigint>;
|
|
22259
22316
|
}
|
|
22260
22317
|
|
|
22261
22318
|
type abi$i = typeof erc4626PriceFeedAbi;
|
|
22262
22319
|
declare class Erc4626PriceFeedContract extends AbstractLPPriceFeedContract<abi$i> {
|
|
22263
|
-
constructor(sdk: GearboxSDK, args:
|
|
22320
|
+
constructor(sdk: GearboxSDK, args: PartialPriceFeedTreeNode);
|
|
22264
22321
|
getValue(): Promise<bigint>;
|
|
22265
22322
|
}
|
|
22266
22323
|
|
|
22267
22324
|
type abi$h = typeof mellowLrtPriceFeedAbi;
|
|
22268
22325
|
declare class MellowLRTPriceFeedContract extends AbstractLPPriceFeedContract<abi$h> {
|
|
22269
|
-
constructor(sdk: GearboxSDK, args:
|
|
22326
|
+
constructor(sdk: GearboxSDK, args: PartialPriceFeedTreeNode);
|
|
22270
22327
|
getValue(): Promise<bigint>;
|
|
22271
22328
|
}
|
|
22272
22329
|
|
|
@@ -22305,16 +22362,20 @@ declare class PriceFeedRegister extends SDKConstruct implements IHooks<PriceFeed
|
|
|
22305
22362
|
* @param timestampMs in milliseconds
|
|
22306
22363
|
*/
|
|
22307
22364
|
setRedstoneHistoricalTimestamp(timestampMs: number): void;
|
|
22365
|
+
/**
|
|
22366
|
+
* Loads PARTIAL information about all updatable price feeds from MarketCompressor
|
|
22367
|
+
* This can later be used to load price feed updates
|
|
22368
|
+
*/
|
|
22369
|
+
loadUpdatablePriceFeeds(curators?: Address[], pools?: Address[]): Promise<void>;
|
|
22308
22370
|
}
|
|
22309
22371
|
|
|
22310
22372
|
type abi$g = typeof redstonePriceFeedAbi;
|
|
22311
22373
|
declare class RedstonePriceFeedContract extends AbstractPriceFeedContract<abi$g> {
|
|
22312
|
-
|
|
22313
|
-
|
|
22314
|
-
|
|
22315
|
-
|
|
22316
|
-
|
|
22317
|
-
constructor(sdk: GearboxSDK, args: PriceFeedTreeNode);
|
|
22374
|
+
readonly dataServiceId: string;
|
|
22375
|
+
readonly dataId: string;
|
|
22376
|
+
readonly signers: Hex[];
|
|
22377
|
+
readonly signersThreshold: number;
|
|
22378
|
+
constructor(sdk: GearboxSDK, args: PartialPriceFeedTreeNode);
|
|
22318
22379
|
stateHuman(raw?: boolean): Omit<RedstonePriceFeedStateHuman, "stalenessPeriod">;
|
|
22319
22380
|
}
|
|
22320
22381
|
|
|
@@ -22429,19 +22490,19 @@ declare function rawTxToMulticallPriceUpdate(tx: RawTx): {
|
|
|
22429
22490
|
|
|
22430
22491
|
type abi$f = typeof wstEthPriceFeedAbi;
|
|
22431
22492
|
declare class WstETHPriceFeedContract extends AbstractLPPriceFeedContract<abi$f> {
|
|
22432
|
-
constructor(sdk: GearboxSDK, args:
|
|
22493
|
+
constructor(sdk: GearboxSDK, args: PartialPriceFeedTreeNode);
|
|
22433
22494
|
getValue(): Promise<bigint>;
|
|
22434
22495
|
}
|
|
22435
22496
|
|
|
22436
22497
|
type abi$e = typeof yearnPriceFeedAbi;
|
|
22437
22498
|
declare class YearnPriceFeedContract extends AbstractLPPriceFeedContract<abi$e> {
|
|
22438
|
-
constructor(sdk: GearboxSDK, args:
|
|
22499
|
+
constructor(sdk: GearboxSDK, args: PartialPriceFeedTreeNode);
|
|
22439
22500
|
getValue(): Promise<bigint>;
|
|
22440
22501
|
}
|
|
22441
22502
|
|
|
22442
22503
|
type abi$d = typeof zeroPriceFeedAbi;
|
|
22443
22504
|
declare class ZeroPriceFeedContract extends AbstractPriceFeedContract<abi$d> {
|
|
22444
|
-
constructor(sdk: GearboxSDK, args:
|
|
22505
|
+
constructor(sdk: GearboxSDK, args: PartialPriceFeedTreeNode);
|
|
22445
22506
|
}
|
|
22446
22507
|
|
|
22447
22508
|
type abi$c = typeof priceOracleV3Abi;
|
|
@@ -24286,6 +24347,7 @@ declare class PoolFactory extends SDKConstruct {
|
|
|
24286
24347
|
}
|
|
24287
24348
|
|
|
24288
24349
|
declare class MarketFactory extends SDKConstruct {
|
|
24350
|
+
readonly acl: Address;
|
|
24289
24351
|
readonly riskCurator: Address;
|
|
24290
24352
|
readonly poolFactory: PoolFactory;
|
|
24291
24353
|
readonly priceOracle: PriceOracleContract;
|
|
@@ -25258,4 +25320,4 @@ type MulticallErrorType = GetChainContractAddressErrorType | ReadContractErrorTy
|
|
|
25258
25320
|
*/
|
|
25259
25321
|
declare function simulateMulticall<const contracts extends readonly unknown[], chain extends Chain | undefined, allowFailure extends boolean = true>(client: Client<Transport, chain>, parameters: MulticallParameters<contracts, allowFailure>): Promise<MulticallReturnType<contracts, allowFailure>>;
|
|
25260
25322
|
|
|
25261
|
-
export { ADDRESS_0X0, ADDRESS_PROVIDER, ADDRESS_PROVIDER_BLOCK, AP_ACCOUNT_FACTORY, AP_ACL, AP_ADAPTER_COMPRESSOR, AP_BOT_LIST, AP_CONTRACTS_REGISTER, AP_CONTROLLER_TIMELOCK, AP_CREDIT_ACCOUNT_COMPRESSOR, AP_DATA_COMPRESSOR, AP_DEGEN_DISTRIBUTOR, AP_DEGEN_NFT, AP_DELEVERAGE_BOT_HV, AP_DELEVERAGE_BOT_LV, AP_DELEVERAGE_BOT_PEGGED, AP_GEAR_STAKING, AP_GEAR_TOKEN, AP_INFLATION_ATTACK_BLOCKER, AP_INSOLVENCY_CHECKER, AP_MARKET_COMPRESSOR, AP_MARKET_CONFIGURATOR, AP_MULTI_PAUSE, AP_PARTIAL_LIQUIDATION_BOT, AP_PRICE_FEED_COMPRESSOR, AP_PRICE_ORACLE, AP_ROUTER, AP_TREASURY, AP_WETH_GATEWAY, AP_WETH_TOKEN, AP_ZAPPER_REGISTER, AP_ZERO_PRICE_FEED, AbstractPriceFeedContract, type AdapterContractType, type AdapterData, AddressLabeller, AddressMap, AddressProviderContractV3_1, type AddressProviderV3StateHuman, type Asset, type AssetPriceFeedStateHuman, BalancerStablePriceFeedContract, BalancerV2VaultAdapterContract, BalancerWeightedPriceFeedContract, BaseContract, type BaseContractOptions, type BaseContractStateHuman, type BaseParams, type BasePriceFeedStateHuman, BotListContract, type BotListStateHuman, BotPermissions, type BoundedOracleStateHuman, BoundedPriceFeedContract, CamelotV3AdapterContract, ChainlinkPriceFeedContract, CompositePriceFeedContract, type ConnectionOptions, type ContractMethod, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, type CoreStateHuman, type CreditAccountData, type CreditAccountFilter, CreditAccountsService, CreditConfiguratorContract, type CreditConfiguratorState, type CreditConfiguratorStateHuman, type CreditFacadeState, type CreditFacadeStateHuman, CreditFacadeV300Contract, CreditFacadeV310Contract, CreditFactory, type CreditFactoryStateHuman, CreditManagerContract, type CreditManagerData, type CreditManagerDebtParams, type CreditManagerDebtParamsHuman, type CreditManagerState, type CreditManagerStateHuman, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveCryptoPriceFeedContract, type CurvePoolStruct, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, CurveV1AdapterStETHContract, CurveV1AdapterStableNGContract, ERC4626AdapterContract, Erc4626PriceFeedContract, type EtherscanURLParam, type FindClosePathInput, GaugeContract, type GaugeParams, type GaugeParamsHuman, type GaugeStateHuman, GearStakingContract, type GearStakingV3StateHuman, GearboxSDK, type GearboxStateHuman, type IAdapterContract, type IBaseContract, type ILPPriceFeedContract, type ILogger, type IPriceFeedContract, LinearModelContract, type LinearModelStateHuman, type LogFn, MAX_UINT16, MAX_UINT256, MIN_INT96, type MarketData, MarketFactory, MarketRegister, type MarketStateHuman, MellowLRTPriceFeedContract, type MultiCall, type MulticallErrorType, type MulticallParameters, type MulticallReturnType, NOT_DEPLOYED, NO_VERSION, type NetworkOptions, type NetworkType, type OnDemandPriceUpdate, type OpenStrategyResult, PERCENTAGE_DECIMALS, PERCENTAGE_FACTOR, PRICE_DECIMALS, PRICE_DECIMALS_POW, type PathOption, type PathOptionSerie, PoolContract, type PoolData, PoolFactory, type PoolFactoryStateHuman, PoolQuotaKeeperContract, type PoolQuotaKeeperData, type PoolQuotaKeeperStateHuman, type PoolStateHuman, type PriceFeedConstructorArgs, type PriceFeedContractType, type PriceFeedMapEntry, PriceFeedRef, PriceFeedRegister, type PriceFeedRegisterHooks, type PriceFeedStateHuman, type PriceFeedTreeNode, type PriceFeedUsageType, PriceOracleContract, type PriceOracleData, type PriceOracleV3StateHuman, Provider, type QuotaParamsHuman, type QuotaState, RAY, RAY_DECIMALS_POW, type RateKeeperData, type RawTx, RedstonePriceFeedContract, type RedstonePriceFeedStateHuman, type RouterCloseResult, type RouterHooks, type RouterResult, RouterV3Contract, SDKConstruct, type SDKHooks, type SDKOptions, SUPPORTED_CHAINS, type SwapOperation, type SwapTask, type SyncStateOptions, TIMELOCK, type TVL, type TokenMetaData, TokensMeta, type TransportOptions, USDC, UniswapV2AdapterContract, UniswapV3AdapterContract, type UpdatePriceFeedsResult, VelodromeV2RouterAdapterContract, VotingContractStatus, WAD, WAD_DECIMALS_POW, WstETHPriceFeedContract, WstETHV1AdapterContract, YearnPriceFeedContract, YearnV2RouterAdapterContract, ZeroPriceFeedContract, botPermissionsToString, bytes32ToString, chains, childLogger, createAdapter, createRawTx, createTransport, detectNetwork, etherscanUrl, filterDust, fmtBinaryMask, formatBN, formatBNvalue, formatBn4dig, formatDuration, formatNumberToString_, halfRAY, json_parse, json_stringify, numberWithCommas, percentFmt, rawTxToMulticallPriceUpdate, simulateMulticall, toHumanFormat };
|
|
25323
|
+
export { ADDRESS_0X0, ADDRESS_PROVIDER, ADDRESS_PROVIDER_BLOCK, AP_ACCOUNT_FACTORY, AP_ACL, AP_ADAPTER_COMPRESSOR, AP_BOT_LIST, AP_CONTRACTS_REGISTER, AP_CONTROLLER_TIMELOCK, AP_CREDIT_ACCOUNT_COMPRESSOR, AP_DATA_COMPRESSOR, AP_DEGEN_DISTRIBUTOR, AP_DEGEN_NFT, AP_DELEVERAGE_BOT_HV, AP_DELEVERAGE_BOT_LV, AP_DELEVERAGE_BOT_PEGGED, AP_GEAR_STAKING, AP_GEAR_TOKEN, AP_INFLATION_ATTACK_BLOCKER, AP_INSOLVENCY_CHECKER, AP_MARKET_COMPRESSOR, AP_MARKET_CONFIGURATOR, AP_MULTI_PAUSE, AP_PARTIAL_LIQUIDATION_BOT, AP_PRICE_FEED_COMPRESSOR, AP_PRICE_ORACLE, AP_ROUTER, AP_TREASURY, AP_WETH_GATEWAY, AP_WETH_TOKEN, AP_ZAPPER_REGISTER, AP_ZERO_PRICE_FEED, AbstractPriceFeedContract, type AdapterContractType, type AdapterData, AddressLabeller, AddressMap, AddressProviderContractV3_1, type AddressProviderV3StateHuman, type Asset, type AssetPriceFeedStateHuman, BalancerStablePriceFeedContract, BalancerV2VaultAdapterContract, BalancerWeightedPriceFeedContract, BaseContract, type BaseContractOptions, type BaseContractStateHuman, type BaseParams, type BasePriceFeedStateHuman, BotListContract, type BotListStateHuman, BotPermissions, type BoundedOracleStateHuman, BoundedPriceFeedContract, CamelotV3AdapterContract, ChainlinkPriceFeedContract, CompositePriceFeedContract, type ConnectionOptions, type ContractMethod, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, type CoreStateHuman, type CreditAccountData, type CreditAccountFilter, CreditAccountsService, CreditConfiguratorContract, type CreditConfiguratorState, type CreditConfiguratorStateHuman, type CreditFacadeState, type CreditFacadeStateHuman, CreditFacadeV300Contract, CreditFacadeV310Contract, CreditFactory, type CreditFactoryStateHuman, CreditManagerContract, type CreditManagerData, type CreditManagerDebtParams, type CreditManagerDebtParamsHuman, type CreditManagerState, type CreditManagerStateHuman, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveCryptoPriceFeedContract, type CurvePoolStruct, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, CurveV1AdapterStETHContract, CurveV1AdapterStableNGContract, ERC4626AdapterContract, Erc4626PriceFeedContract, type EtherscanURLParam, type FindClosePathInput, GaugeContract, type GaugeParams, type GaugeParamsHuman, type GaugeStateHuman, GearStakingContract, type GearStakingV3StateHuman, GearboxSDK, type GearboxStateHuman, type IAdapterContract, type IBaseContract, type ILPPriceFeedContract, type ILogger, type IPriceFeedContract, LinearModelContract, type LinearModelStateHuman, type LogFn, MAX_UINT16, MAX_UINT256, MIN_INT96, type MarketData, MarketFactory, MarketRegister, type MarketStateHuman, MellowLRTPriceFeedContract, type MultiCall, type MulticallErrorType, type MulticallParameters, type MulticallReturnType, NOT_DEPLOYED, NO_VERSION, type NetworkOptions, type NetworkType, type OnDemandPriceUpdate, type OpenStrategyResult, PERCENTAGE_DECIMALS, PERCENTAGE_FACTOR, PRICE_DECIMALS, PRICE_DECIMALS_POW, type PartialPriceFeedTreeNode, type PathOption, type PathOptionSerie, PoolContract, type PoolData, PoolFactory, type PoolFactoryStateHuman, PoolQuotaKeeperContract, type PoolQuotaKeeperData, type PoolQuotaKeeperStateHuman, type PoolStateHuman, type PriceFeedConstructorArgs, type PriceFeedContractType, type PriceFeedMapEntry, PriceFeedRef, PriceFeedRegister, type PriceFeedRegisterHooks, type PriceFeedStateHuman, type PriceFeedTreeNode, type PriceFeedUsageType, PriceOracleContract, type PriceOracleData, type PriceOracleV3StateHuman, Provider, type QuotaParamsHuman, type QuotaState, RAY, RAY_DECIMALS_POW, type RateKeeperData, type RawTx, RedstonePriceFeedContract, type RedstonePriceFeedStateHuman, type RouterCloseResult, type RouterHooks, type RouterResult, RouterV3Contract, SDKConstruct, type SDKHooks, type SDKOptions, SUPPORTED_CHAINS, type SwapOperation, type SwapTask, type SyncStateOptions, TIMELOCK, type TVL, type TokenMetaData, TokensMeta, type TransportOptions, USDC, UniswapV2AdapterContract, UniswapV3AdapterContract, type UpdatePriceFeedsResult, VelodromeV2RouterAdapterContract, VotingContractStatus, WAD, WAD_DECIMALS_POW, WstETHPriceFeedContract, WstETHV1AdapterContract, YearnPriceFeedContract, YearnV2RouterAdapterContract, ZeroPriceFeedContract, botPermissionsToString, bytes32ToString, chains, childLogger, createAdapter, createRawTx, createTransport, detectNetwork, etherscanUrl, filterDust, fmtBinaryMask, formatBN, formatBNvalue, formatBn4dig, formatDuration, formatNumberToString_, halfRAY, json_parse, json_stringify, numberWithCommas, percentFmt, rawTxToMulticallPriceUpdate, simulateMulticall, toHumanFormat };
|
package/dist/esm/sdk/index.mjs
CHANGED
|
@@ -673,6 +673,11 @@ var iMarketCompressorAbi = [
|
|
|
673
673
|
type: "address",
|
|
674
674
|
internalType: "address"
|
|
675
675
|
},
|
|
676
|
+
{
|
|
677
|
+
name: "acl",
|
|
678
|
+
type: "address",
|
|
679
|
+
internalType: "address"
|
|
680
|
+
},
|
|
676
681
|
{
|
|
677
682
|
name: "name",
|
|
678
683
|
type: "string",
|
|
@@ -1636,6 +1641,11 @@ var iMarketCompressorAbi = [
|
|
|
1636
1641
|
type: "address",
|
|
1637
1642
|
internalType: "address"
|
|
1638
1643
|
},
|
|
1644
|
+
{
|
|
1645
|
+
name: "acl",
|
|
1646
|
+
type: "address",
|
|
1647
|
+
internalType: "address"
|
|
1648
|
+
},
|
|
1639
1649
|
{
|
|
1640
1650
|
name: "name",
|
|
1641
1651
|
type: "string",
|
|
@@ -2534,6 +2544,64 @@ var iMarketCompressorAbi = [
|
|
|
2534
2544
|
],
|
|
2535
2545
|
stateMutability: "view"
|
|
2536
2546
|
},
|
|
2547
|
+
{
|
|
2548
|
+
type: "function",
|
|
2549
|
+
name: "getUpdatablePriceFeeds",
|
|
2550
|
+
inputs: [
|
|
2551
|
+
{
|
|
2552
|
+
name: "filter",
|
|
2553
|
+
type: "tuple",
|
|
2554
|
+
internalType: "struct MarketFilter",
|
|
2555
|
+
components: [
|
|
2556
|
+
{
|
|
2557
|
+
name: "curators",
|
|
2558
|
+
type: "address[]",
|
|
2559
|
+
internalType: "address[]"
|
|
2560
|
+
},
|
|
2561
|
+
{
|
|
2562
|
+
name: "pools",
|
|
2563
|
+
type: "address[]",
|
|
2564
|
+
internalType: "address[]"
|
|
2565
|
+
},
|
|
2566
|
+
{
|
|
2567
|
+
name: "underlying",
|
|
2568
|
+
type: "address",
|
|
2569
|
+
internalType: "address"
|
|
2570
|
+
}
|
|
2571
|
+
]
|
|
2572
|
+
}
|
|
2573
|
+
],
|
|
2574
|
+
outputs: [
|
|
2575
|
+
{
|
|
2576
|
+
name: "updatablePriceFeeds",
|
|
2577
|
+
type: "tuple[]",
|
|
2578
|
+
internalType: "struct BaseParams[]",
|
|
2579
|
+
components: [
|
|
2580
|
+
{
|
|
2581
|
+
name: "addr",
|
|
2582
|
+
type: "address",
|
|
2583
|
+
internalType: "address"
|
|
2584
|
+
},
|
|
2585
|
+
{
|
|
2586
|
+
name: "version",
|
|
2587
|
+
type: "uint256",
|
|
2588
|
+
internalType: "uint256"
|
|
2589
|
+
},
|
|
2590
|
+
{
|
|
2591
|
+
name: "contractType",
|
|
2592
|
+
type: "bytes32",
|
|
2593
|
+
internalType: "bytes32"
|
|
2594
|
+
},
|
|
2595
|
+
{
|
|
2596
|
+
name: "serializedParams",
|
|
2597
|
+
type: "bytes",
|
|
2598
|
+
internalType: "bytes"
|
|
2599
|
+
}
|
|
2600
|
+
]
|
|
2601
|
+
}
|
|
2602
|
+
],
|
|
2603
|
+
stateMutability: "view"
|
|
2604
|
+
},
|
|
2537
2605
|
{
|
|
2538
2606
|
type: "function",
|
|
2539
2607
|
name: "version",
|
|
@@ -20693,10 +20761,10 @@ var AbstractPriceFeedContract = class extends BaseContract {
|
|
|
20693
20761
|
/**
|
|
20694
20762
|
* True if the contract deployed at this address implements IUpdatablePriceFeed interface
|
|
20695
20763
|
*/
|
|
20696
|
-
updatable;
|
|
20697
|
-
decimals;
|
|
20698
|
-
underlyingPriceFeeds;
|
|
20699
|
-
skipCheck;
|
|
20764
|
+
#updatable;
|
|
20765
|
+
#decimals;
|
|
20766
|
+
#underlyingPriceFeeds;
|
|
20767
|
+
#skipCheck;
|
|
20700
20768
|
hasLowerBoundCap = false;
|
|
20701
20769
|
constructor(sdk, args) {
|
|
20702
20770
|
super(sdk, {
|
|
@@ -20706,12 +20774,45 @@ var AbstractPriceFeedContract = class extends BaseContract {
|
|
|
20706
20774
|
contractType: args.baseParams.contractType,
|
|
20707
20775
|
version: args.baseParams.version
|
|
20708
20776
|
});
|
|
20709
|
-
this
|
|
20710
|
-
this
|
|
20711
|
-
this
|
|
20712
|
-
|
|
20713
|
-
|
|
20714
|
-
|
|
20777
|
+
this.#decimals = args.decimals;
|
|
20778
|
+
this.#updatable = args.updatable;
|
|
20779
|
+
this.#skipCheck = args.skipCheck;
|
|
20780
|
+
if (args.underlyingFeeds && args.underlyingStalenessPeriods) {
|
|
20781
|
+
this.#underlyingPriceFeeds = args.underlyingFeeds.map(
|
|
20782
|
+
(address, i) => new PriceFeedRef(
|
|
20783
|
+
this.sdk,
|
|
20784
|
+
address,
|
|
20785
|
+
args.underlyingStalenessPeriods[i]
|
|
20786
|
+
)
|
|
20787
|
+
);
|
|
20788
|
+
}
|
|
20789
|
+
}
|
|
20790
|
+
get loaded() {
|
|
20791
|
+
return this.#decimals !== void 0;
|
|
20792
|
+
}
|
|
20793
|
+
get decimals() {
|
|
20794
|
+
if (this.#decimals === void 0) {
|
|
20795
|
+
throw new Error("price feed has been initialized with BaseParams only");
|
|
20796
|
+
}
|
|
20797
|
+
return this.#decimals;
|
|
20798
|
+
}
|
|
20799
|
+
get updatable() {
|
|
20800
|
+
if (this.#updatable === void 0) {
|
|
20801
|
+
throw new Error("price feed has been initialized with BaseParams only");
|
|
20802
|
+
}
|
|
20803
|
+
return this.#updatable;
|
|
20804
|
+
}
|
|
20805
|
+
get skipCheck() {
|
|
20806
|
+
if (this.#skipCheck === void 0) {
|
|
20807
|
+
throw new Error("price feed has been initialized with BaseParams only");
|
|
20808
|
+
}
|
|
20809
|
+
return this.#skipCheck;
|
|
20810
|
+
}
|
|
20811
|
+
get underlyingPriceFeeds() {
|
|
20812
|
+
if (!this.#underlyingPriceFeeds) {
|
|
20813
|
+
throw new Error("price feed has been initialized with BaseParams only");
|
|
20814
|
+
}
|
|
20815
|
+
return this.#underlyingPriceFeeds;
|
|
20715
20816
|
}
|
|
20716
20817
|
get priceFeedType() {
|
|
20717
20818
|
return this.contractType;
|
|
@@ -20856,8 +20957,7 @@ var CompositePriceFeedContract = class extends AbstractPriceFeedContract {
|
|
|
20856
20957
|
super(sdk, {
|
|
20857
20958
|
...args,
|
|
20858
20959
|
name: "CompositePriceFeed",
|
|
20859
|
-
abi: compositePriceFeedAbi
|
|
20860
|
-
decimals: 8
|
|
20960
|
+
abi: compositePriceFeedAbi
|
|
20861
20961
|
});
|
|
20862
20962
|
}
|
|
20863
20963
|
get targetToBasePriceFeed() {
|
|
@@ -20989,7 +21089,6 @@ var Hooks = class {
|
|
|
20989
21089
|
}
|
|
20990
21090
|
};
|
|
20991
21091
|
var RedstonePriceFeedContract = class extends AbstractPriceFeedContract {
|
|
20992
|
-
decimals = 8;
|
|
20993
21092
|
dataServiceId;
|
|
20994
21093
|
dataId;
|
|
20995
21094
|
signers;
|
|
@@ -21337,7 +21436,7 @@ var PriceFeedRegister = class extends SDKConstruct {
|
|
|
21337
21436
|
}
|
|
21338
21437
|
getOrCreate(data) {
|
|
21339
21438
|
const existing = this.#feeds.get(data.baseParams.addr);
|
|
21340
|
-
if (existing) {
|
|
21439
|
+
if (existing?.loaded) {
|
|
21341
21440
|
return existing;
|
|
21342
21441
|
}
|
|
21343
21442
|
const feed = this.#create(data);
|
|
@@ -21351,6 +21450,36 @@ var PriceFeedRegister = class extends SDKConstruct {
|
|
|
21351
21450
|
setRedstoneHistoricalTimestamp(timestampMs) {
|
|
21352
21451
|
this.#redstoneUpdater.setHistoricalTimestamp(timestampMs);
|
|
21353
21452
|
}
|
|
21453
|
+
/**
|
|
21454
|
+
* Loads PARTIAL information about all updatable price feeds from MarketCompressor
|
|
21455
|
+
* This can later be used to load price feed updates
|
|
21456
|
+
*/
|
|
21457
|
+
async loadUpdatablePriceFeeds(curators, pools) {
|
|
21458
|
+
const marketCompressorAddress = this.sdk.addressProvider.getAddress(
|
|
21459
|
+
AP_MARKET_COMPRESSOR,
|
|
21460
|
+
310
|
|
21461
|
+
);
|
|
21462
|
+
const feedsData = await this.provider.publicClient.readContract({
|
|
21463
|
+
address: marketCompressorAddress,
|
|
21464
|
+
abi: iMarketCompressorAbi,
|
|
21465
|
+
functionName: "getUpdatablePriceFeeds",
|
|
21466
|
+
args: [
|
|
21467
|
+
{
|
|
21468
|
+
curators: curators ?? this.sdk.marketRegister.curators,
|
|
21469
|
+
pools: pools ?? [],
|
|
21470
|
+
underlying: ADDRESS_0X0
|
|
21471
|
+
}
|
|
21472
|
+
],
|
|
21473
|
+
// It's passed as ...rest in viem readContract action, but this might change
|
|
21474
|
+
// @ts-ignore
|
|
21475
|
+
gas: 500000000n
|
|
21476
|
+
});
|
|
21477
|
+
for (const data of feedsData) {
|
|
21478
|
+
const feed = this.#create({ baseParams: data });
|
|
21479
|
+
this.#feeds.upsert(feed.address, feed);
|
|
21480
|
+
}
|
|
21481
|
+
this.logger?.debug(`loaded ${feedsData.length} updatable price feeds`);
|
|
21482
|
+
}
|
|
21354
21483
|
#create(data) {
|
|
21355
21484
|
const contractType = bytes32ToString(
|
|
21356
21485
|
data.baseParams.contractType
|
|
@@ -21673,6 +21802,7 @@ var priceFeedToTicker = {
|
|
|
21673
21802
|
|
|
21674
21803
|
// src/sdk/market/MarketFactory.ts
|
|
21675
21804
|
var MarketFactory = class extends SDKConstruct {
|
|
21805
|
+
acl;
|
|
21676
21806
|
riskCurator;
|
|
21677
21807
|
poolFactory;
|
|
21678
21808
|
priceOracle;
|
|
@@ -21685,6 +21815,7 @@ var MarketFactory = class extends SDKConstruct {
|
|
|
21685
21815
|
super(sdk);
|
|
21686
21816
|
this.state = marketData;
|
|
21687
21817
|
this.riskCurator = marketData.owner;
|
|
21818
|
+
this.acl = marketData.acl;
|
|
21688
21819
|
for (const t of marketData.tokens) {
|
|
21689
21820
|
sdk.tokensMeta.upsert(t.addr, t);
|
|
21690
21821
|
sdk.provider.addressLabels.set(t.addr, t.symbol);
|
|
@@ -21983,21 +22114,30 @@ var MarketRegister = class extends SDKConstruct {
|
|
|
21983
22114
|
AP_MARKET_COMPRESSOR,
|
|
21984
22115
|
310
|
|
21985
22116
|
);
|
|
21986
|
-
|
|
21987
|
-
|
|
21988
|
-
|
|
21989
|
-
|
|
21990
|
-
|
|
22117
|
+
await this.sdk.priceFeeds.loadUpdatablePriceFeeds(curators, pools);
|
|
22118
|
+
const { txs } = await this.sdk.priceFeeds.generatePriceFeedsUpdateTxs();
|
|
22119
|
+
const resp = await simulateMulticall(this.provider.publicClient, {
|
|
22120
|
+
contracts: [
|
|
22121
|
+
...txs.map(rawTxToMulticallPriceUpdate),
|
|
21991
22122
|
{
|
|
21992
|
-
|
|
21993
|
-
|
|
21994
|
-
|
|
22123
|
+
abi: iMarketCompressorAbi,
|
|
22124
|
+
address: marketCompressorAddress,
|
|
22125
|
+
functionName: "getMarkets",
|
|
22126
|
+
args: [
|
|
22127
|
+
{
|
|
22128
|
+
curators,
|
|
22129
|
+
pools,
|
|
22130
|
+
underlying: ADDRESS_0X0
|
|
22131
|
+
}
|
|
22132
|
+
]
|
|
21995
22133
|
}
|
|
21996
22134
|
],
|
|
21997
|
-
|
|
21998
|
-
|
|
21999
|
-
|
|
22135
|
+
allowFailure: false,
|
|
22136
|
+
gas: 550000000n,
|
|
22137
|
+
batchSize: 0
|
|
22138
|
+
// we cannot have price updates and compressor request in different batches
|
|
22000
22139
|
});
|
|
22140
|
+
const markets = resp.pop();
|
|
22001
22141
|
for (const data of markets) {
|
|
22002
22142
|
this.#markets.upsert(
|
|
22003
22143
|
data.pool.baseParams.addr,
|