@gearbox-protocol/sdk 16.6.0 → 16.6.2
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/dev/midasUtils.js +8 -5
- package/dist/cjs/onchain/OnchainSDK.js +3 -3
- package/dist/cjs/onchain/index.js +49 -38
- package/dist/cjs/onchain/market/index.js +49 -38
- package/dist/cjs/onchain/market/oracle/PriceOracleBaseContract.js +3 -3
- package/dist/cjs/onchain/market/pricefeeds/AbstractPriceFeed.js +0 -5
- package/dist/cjs/onchain/market/pricefeeds/PriceFeedRegistry.js +127 -0
- package/dist/cjs/onchain/market/pricefeeds/{BalancerStablePriceFeed.js → feeds/BalancerStablePriceFeed.js} +4 -4
- package/dist/cjs/onchain/market/pricefeeds/{BalancerWeightedPriceFeed.js → feeds/BalancerWeightedPriceFeed.js} +4 -4
- package/dist/cjs/onchain/market/pricefeeds/{BoundedPriceFeed.js → feeds/BoundedPriceFeed.js} +4 -4
- package/dist/cjs/onchain/market/pricefeeds/{CompositePriceFeed.js → feeds/CompositePriceFeed.js} +4 -4
- package/dist/cjs/onchain/market/pricefeeds/{ConstantPriceFeed.js → feeds/ConstantPriceFeed.js} +3 -3
- package/dist/cjs/onchain/market/pricefeeds/{CurveCryptoPriceFeed.js → feeds/CurveCryptoPriceFeed.js} +4 -4
- package/dist/cjs/onchain/market/pricefeeds/{CurveStablePriceFeed.js → feeds/CurveStablePriceFeed.js} +4 -4
- package/dist/cjs/onchain/market/pricefeeds/{CurveUSDPriceFeed.js → feeds/CurveUSDPriceFeed.js} +4 -4
- package/dist/cjs/onchain/market/pricefeeds/{Erc4626PriceFeed.js → feeds/Erc4626PriceFeed.js} +4 -4
- package/dist/cjs/onchain/market/pricefeeds/{ExternalPriceFeed.js → feeds/ExternalPriceFeed.js} +4 -4
- package/dist/cjs/onchain/market/pricefeeds/{MellowLRTPriceFeed.js → feeds/MellowLRTPriceFeed.js} +4 -4
- package/dist/cjs/onchain/market/pricefeeds/{PendleTWAPPTPriceFeed.js → feeds/PendleTWAPPTPriceFeed.js} +4 -4
- package/dist/cjs/onchain/market/pricefeeds/{PythPriceFeed.js → feeds/PythPriceFeed.js} +3 -3
- package/dist/cjs/onchain/market/pricefeeds/{RedstonePriceFeed.js → feeds/RedstonePriceFeed.js} +6 -6
- package/dist/cjs/onchain/market/pricefeeds/{WstETHPriceFeed.js → feeds/WstETHPriceFeed.js} +4 -4
- package/dist/cjs/onchain/market/pricefeeds/{YearnPriceFeed.js → feeds/YearnPriceFeed.js} +4 -4
- package/dist/cjs/onchain/market/pricefeeds/{ZeroPriceFeed.js → feeds/ZeroPriceFeed.js} +4 -4
- package/dist/cjs/onchain/market/pricefeeds/feeds/index.js +35 -0
- package/dist/cjs/onchain/market/pricefeeds/index.js +51 -39
- package/dist/cjs/onchain/market/pricefeeds/updates/UpdatablePriceFeedRegistry.js +189 -0
- package/dist/cjs/onchain/market/pricefeeds/{getRawPriceUpdates.js → updates/getRawPriceUpdates.js} +2 -2
- package/dist/cjs/onchain/market/pricefeeds/updates/index.js +8 -0
- package/dist/cjs/onchain/market/pricefeeds/{isUpdatablePriceFeed.js → updates/isUpdatablePriceFeed.js} +1 -1
- package/dist/cjs/onchain/market/pricefeeds/updates/updatableDependencies.js +14 -0
- package/dist/cjs/permissionless/utils/price-update/get-price-update-tx.js +2 -2
- package/dist/cjs/permissionless/utils/price-update/get-updatable-feeds.js +2 -2
- package/dist/esm/dev/midasUtils.js +8 -5
- package/dist/esm/onchain/OnchainSDK.js +3 -3
- package/dist/esm/onchain/index.js +25 -20
- package/dist/esm/onchain/market/index.js +25 -20
- package/dist/esm/onchain/market/oracle/PriceOracleBaseContract.js +1 -1
- package/dist/esm/onchain/market/pricefeeds/AbstractPriceFeed.js +0 -5
- package/dist/esm/onchain/market/pricefeeds/PriceFeedRegistry.js +126 -0
- package/dist/esm/onchain/market/pricefeeds/{BalancerStablePriceFeed.js → feeds/BalancerStablePriceFeed.js} +4 -4
- package/dist/esm/onchain/market/pricefeeds/{BalancerWeightedPriceFeed.js → feeds/BalancerWeightedPriceFeed.js} +4 -4
- package/dist/esm/onchain/market/pricefeeds/{BoundedPriceFeed.js → feeds/BoundedPriceFeed.js} +4 -4
- package/dist/esm/onchain/market/pricefeeds/{CompositePriceFeed.js → feeds/CompositePriceFeed.js} +4 -4
- package/dist/esm/onchain/market/pricefeeds/{ConstantPriceFeed.js → feeds/ConstantPriceFeed.js} +3 -3
- package/dist/esm/onchain/market/pricefeeds/{CurveCryptoPriceFeed.js → feeds/CurveCryptoPriceFeed.js} +4 -4
- package/dist/esm/onchain/market/pricefeeds/{CurveStablePriceFeed.js → feeds/CurveStablePriceFeed.js} +4 -4
- package/dist/esm/onchain/market/pricefeeds/{CurveUSDPriceFeed.js → feeds/CurveUSDPriceFeed.js} +4 -4
- package/dist/esm/onchain/market/pricefeeds/{Erc4626PriceFeed.js → feeds/Erc4626PriceFeed.js} +4 -4
- package/dist/esm/onchain/market/pricefeeds/{ExternalPriceFeed.js → feeds/ExternalPriceFeed.js} +4 -4
- package/dist/esm/onchain/market/pricefeeds/{MellowLRTPriceFeed.js → feeds/MellowLRTPriceFeed.js} +4 -4
- package/dist/esm/onchain/market/pricefeeds/{PendleTWAPPTPriceFeed.js → feeds/PendleTWAPPTPriceFeed.js} +4 -4
- package/dist/esm/onchain/market/pricefeeds/{PythPriceFeed.js → feeds/PythPriceFeed.js} +3 -3
- package/dist/esm/onchain/market/pricefeeds/{RedstonePriceFeed.js → feeds/RedstonePriceFeed.js} +6 -6
- package/dist/esm/onchain/market/pricefeeds/{WstETHPriceFeed.js → feeds/WstETHPriceFeed.js} +4 -4
- package/dist/esm/onchain/market/pricefeeds/{YearnPriceFeed.js → feeds/YearnPriceFeed.js} +4 -4
- package/dist/esm/onchain/market/pricefeeds/{ZeroPriceFeed.js → feeds/ZeroPriceFeed.js} +4 -4
- package/dist/esm/onchain/market/pricefeeds/feeds/index.js +18 -0
- package/dist/esm/onchain/market/pricefeeds/index.js +27 -21
- package/dist/esm/onchain/market/pricefeeds/updates/UpdatablePriceFeedRegistry.js +188 -0
- package/dist/esm/onchain/market/pricefeeds/{getRawPriceUpdates.js → updates/getRawPriceUpdates.js} +2 -2
- package/dist/esm/onchain/market/pricefeeds/updates/index.js +5 -1
- package/dist/esm/onchain/market/pricefeeds/{isUpdatablePriceFeed.js → updates/isUpdatablePriceFeed.js} +1 -1
- package/dist/esm/onchain/market/pricefeeds/updates/updatableDependencies.js +13 -0
- package/dist/esm/permissionless/utils/price-update/get-price-update-tx.js +1 -1
- package/dist/esm/permissionless/utils/price-update/get-updatable-feeds.js +1 -1
- package/dist/types/dev/midasUtils.d.ts +6 -2
- package/dist/types/onchain/OnchainSDK.d.ts +2 -2
- package/dist/types/onchain/index.d.ts +27 -22
- package/dist/types/onchain/market/index.d.ts +27 -22
- package/dist/types/onchain/market/oracle/PriceOracleBaseContract.d.ts +2 -1
- package/dist/types/onchain/market/oracle/types.d.ts +2 -1
- package/dist/types/onchain/market/pricefeeds/AbstractPriceFeed.d.ts +1 -2
- package/dist/types/onchain/market/pricefeeds/PriceFeedRegistry.d.ts +60 -0
- package/dist/types/onchain/market/pricefeeds/feeds/BalancerStablePriceFeed.d.ts +12 -0
- package/dist/types/onchain/market/pricefeeds/{BalancerWeightedPriceFeed.d.ts → feeds/BalancerWeightedPriceFeed.d.ts} +7 -7
- package/dist/types/onchain/market/pricefeeds/feeds/BoundedPriceFeed.d.ts +15 -0
- package/dist/types/onchain/market/pricefeeds/{CompositePriceFeed.d.ts → feeds/CompositePriceFeed.d.ts} +6 -6
- package/dist/types/onchain/market/pricefeeds/{ConstantPriceFeed.d.ts → feeds/ConstantPriceFeed.d.ts} +6 -6
- package/dist/types/onchain/market/pricefeeds/feeds/CurveCryptoPriceFeed.d.ts +12 -0
- package/dist/types/onchain/market/pricefeeds/feeds/CurveStablePriceFeed.d.ts +12 -0
- package/dist/types/onchain/market/pricefeeds/feeds/CurveUSDPriceFeed.d.ts +12 -0
- package/dist/types/onchain/market/pricefeeds/feeds/Erc4626PriceFeed.d.ts +12 -0
- package/dist/types/onchain/market/pricefeeds/feeds/ExternalPriceFeed.d.ts +11 -0
- package/dist/types/onchain/market/pricefeeds/feeds/MellowLRTPriceFeed.d.ts +12 -0
- package/dist/types/onchain/market/pricefeeds/{PendleTWAPPTPriceFeed.d.ts → feeds/PendleTWAPPTPriceFeed.d.ts} +3 -3
- package/dist/types/onchain/market/pricefeeds/{PythPriceFeed.d.ts → feeds/PythPriceFeed.d.ts} +3 -3
- package/dist/types/onchain/market/pricefeeds/{RedstonePriceFeed.d.ts → feeds/RedstonePriceFeed.d.ts} +9 -9
- package/dist/types/onchain/market/pricefeeds/feeds/WstETHPriceFeed.d.ts +12 -0
- package/dist/types/onchain/market/pricefeeds/feeds/YearnPriceFeed.d.ts +12 -0
- package/dist/types/onchain/market/pricefeeds/feeds/ZeroPriceFeed.d.ts +11 -0
- package/dist/types/onchain/market/pricefeeds/feeds/index.d.ts +18 -0
- package/dist/types/onchain/market/pricefeeds/index.d.ts +28 -22
- package/dist/types/onchain/market/pricefeeds/types.d.ts +1 -31
- package/dist/types/onchain/market/pricefeeds/updates/RedstoneUpdater.d.ts +1 -1
- package/dist/types/onchain/market/pricefeeds/updates/UpdatablePriceFeedRegistry.d.ts +106 -0
- package/dist/types/onchain/market/pricefeeds/updates/getRawPriceUpdates.d.ts +6 -0
- package/dist/types/onchain/market/pricefeeds/updates/index.d.ts +7 -3
- package/dist/types/onchain/market/pricefeeds/updates/isUpdatablePriceFeed.d.ts +6 -0
- package/dist/types/onchain/market/pricefeeds/updates/types.d.ts +56 -2
- package/dist/types/onchain/market/pricefeeds/updates/updatableDependencies.d.ts +10 -0
- package/package.json +1 -1
- package/dist/cjs/onchain/market/pricefeeds/PriceFeedsRegister.js +0 -301
- package/dist/esm/onchain/market/pricefeeds/PriceFeedsRegister.js +0 -300
- package/dist/types/onchain/market/pricefeeds/BalancerStablePriceFeed.d.ts +0 -12
- package/dist/types/onchain/market/pricefeeds/BoundedPriceFeed.d.ts +0 -15
- package/dist/types/onchain/market/pricefeeds/CurveCryptoPriceFeed.d.ts +0 -12
- package/dist/types/onchain/market/pricefeeds/CurveStablePriceFeed.d.ts +0 -12
- package/dist/types/onchain/market/pricefeeds/CurveUSDPriceFeed.d.ts +0 -12
- package/dist/types/onchain/market/pricefeeds/Erc4626PriceFeed.d.ts +0 -12
- package/dist/types/onchain/market/pricefeeds/ExternalPriceFeed.d.ts +0 -11
- package/dist/types/onchain/market/pricefeeds/MellowLRTPriceFeed.d.ts +0 -12
- package/dist/types/onchain/market/pricefeeds/PriceFeedsRegister.d.ts +0 -180
- package/dist/types/onchain/market/pricefeeds/WstETHPriceFeed.d.ts +0 -12
- package/dist/types/onchain/market/pricefeeds/YearnPriceFeed.d.ts +0 -12
- package/dist/types/onchain/market/pricefeeds/ZeroPriceFeed.d.ts +0 -11
- package/dist/types/onchain/market/pricefeeds/getRawPriceUpdates.d.ts +0 -5
- package/dist/types/onchain/market/pricefeeds/isUpdatablePriceFeed.d.ts +0 -5
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PartialPriceFeedTreeNode } from "../AbstractPriceFeed.js";
|
|
2
|
+
import { AbstractLPPriceFeedContract } from "../AbstractLPPriceFeed.js";
|
|
3
|
+
import { erc4626PriceFeedAbi } from "../../../abi/oracles.js";
|
|
4
|
+
import "../../../abi/index.js";
|
|
5
|
+
import { ConstructOptions } from "../../../base/Construct.js";
|
|
6
|
+
//#region src/onchain/market/pricefeeds/feeds/Erc4626PriceFeed.d.ts
|
|
7
|
+
type abi = typeof erc4626PriceFeedAbi;
|
|
8
|
+
declare class Erc4626PriceFeedContract extends AbstractLPPriceFeedContract<abi> {
|
|
9
|
+
constructor(options: ConstructOptions, args: PartialPriceFeedTreeNode);
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { Erc4626PriceFeedContract };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AbstractPriceFeedContract, PartialPriceFeedTreeNode } from "../AbstractPriceFeed.js";
|
|
2
|
+
import { chainlinkReadableAggregatorAbi } from "../../../abi/oracles.js";
|
|
3
|
+
import "../../../abi/index.js";
|
|
4
|
+
import { ConstructOptions } from "../../../base/Construct.js";
|
|
5
|
+
//#region src/onchain/market/pricefeeds/feeds/ExternalPriceFeed.d.ts
|
|
6
|
+
type abi = typeof chainlinkReadableAggregatorAbi;
|
|
7
|
+
declare class ExternalPriceFeedContract extends AbstractPriceFeedContract<abi> {
|
|
8
|
+
constructor(options: ConstructOptions, args: PartialPriceFeedTreeNode);
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { ExternalPriceFeedContract };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PartialPriceFeedTreeNode } from "../AbstractPriceFeed.js";
|
|
2
|
+
import { AbstractLPPriceFeedContract } from "../AbstractLPPriceFeed.js";
|
|
3
|
+
import { mellowLrtPriceFeedAbi } from "../../../abi/oracles.js";
|
|
4
|
+
import "../../../abi/index.js";
|
|
5
|
+
import { ConstructOptions } from "../../../base/Construct.js";
|
|
6
|
+
//#region src/onchain/market/pricefeeds/feeds/MellowLRTPriceFeed.d.ts
|
|
7
|
+
type abi = typeof mellowLrtPriceFeedAbi;
|
|
8
|
+
declare class MellowLRTPriceFeedContract extends AbstractLPPriceFeedContract<abi> {
|
|
9
|
+
constructor(options: ConstructOptions, args: PartialPriceFeedTreeNode);
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { MellowLRTPriceFeedContract };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { AbstractPriceFeedContract, PartialPriceFeedTreeNode } from "
|
|
2
|
-
import { ConstructOptions } from "
|
|
1
|
+
import { AbstractPriceFeedContract, PartialPriceFeedTreeNode } from "../AbstractPriceFeed.js";
|
|
2
|
+
import { ConstructOptions } from "../../../base/Construct.js";
|
|
3
3
|
import { Address } from "viem";
|
|
4
|
-
//#region src/onchain/market/pricefeeds/PendleTWAPPTPriceFeed.d.ts
|
|
4
|
+
//#region src/onchain/market/pricefeeds/feeds/PendleTWAPPTPriceFeed.d.ts
|
|
5
5
|
declare const abi: readonly [{
|
|
6
6
|
readonly type: "constructor";
|
|
7
7
|
readonly inputs: readonly [{
|
package/dist/types/onchain/market/pricefeeds/{PythPriceFeed.d.ts → feeds/PythPriceFeed.d.ts}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { AbstractPriceFeedContract, PartialPriceFeedTreeNode } from "
|
|
2
|
-
import { ConstructOptions } from "
|
|
1
|
+
import { AbstractPriceFeedContract, PartialPriceFeedTreeNode } from "../AbstractPriceFeed.js";
|
|
2
|
+
import { ConstructOptions } from "../../../base/Construct.js";
|
|
3
3
|
import { Address, Hex } from "viem";
|
|
4
|
-
//#region src/onchain/market/pricefeeds/PythPriceFeed.d.ts
|
|
4
|
+
//#region src/onchain/market/pricefeeds/feeds/PythPriceFeed.d.ts
|
|
5
5
|
declare const abi: readonly [{
|
|
6
6
|
readonly type: "constructor";
|
|
7
7
|
readonly inputs: readonly [{
|
package/dist/types/onchain/market/pricefeeds/{RedstonePriceFeed.d.ts → feeds/RedstonePriceFeed.d.ts}
RENAMED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { RedstonePriceFeedStateHuman } from "
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import "
|
|
6
|
-
import { RawTx } from "
|
|
7
|
-
import { ConstructOptions } from "
|
|
8
|
-
import "
|
|
1
|
+
import { RedstonePriceFeedStateHuman } from "../../../types/state-human.js";
|
|
2
|
+
import { AbstractPriceFeedContract, PartialPriceFeedTreeNode } from "../AbstractPriceFeed.js";
|
|
3
|
+
import { redstonePriceFeedAbi } from "../../../abi/oracles.js";
|
|
4
|
+
import "../../../abi/index.js";
|
|
5
|
+
import { IUpdatablePriceFeedContract } from "../updates/types.js";
|
|
6
|
+
import { RawTx } from "../../../types/transactions.js";
|
|
7
|
+
import { ConstructOptions } from "../../../base/Construct.js";
|
|
8
|
+
import "../../../types/index.js";
|
|
9
9
|
import { Address, Hex } from "viem";
|
|
10
|
-
//#region src/onchain/market/pricefeeds/RedstonePriceFeed.d.ts
|
|
10
|
+
//#region src/onchain/market/pricefeeds/feeds/RedstonePriceFeed.d.ts
|
|
11
11
|
type abi = typeof redstonePriceFeedAbi;
|
|
12
12
|
declare class RedstonePriceFeedContract extends AbstractPriceFeedContract<abi> implements IUpdatablePriceFeedContract {
|
|
13
13
|
readonly token: Address;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PartialPriceFeedTreeNode } from "../AbstractPriceFeed.js";
|
|
2
|
+
import { AbstractLPPriceFeedContract } from "../AbstractLPPriceFeed.js";
|
|
3
|
+
import { wstEthPriceFeedAbi } from "../../../abi/oracles.js";
|
|
4
|
+
import "../../../abi/index.js";
|
|
5
|
+
import { ConstructOptions } from "../../../base/Construct.js";
|
|
6
|
+
//#region src/onchain/market/pricefeeds/feeds/WstETHPriceFeed.d.ts
|
|
7
|
+
type abi = typeof wstEthPriceFeedAbi;
|
|
8
|
+
declare class WstETHPriceFeedContract extends AbstractLPPriceFeedContract<abi> {
|
|
9
|
+
constructor(options: ConstructOptions, args: PartialPriceFeedTreeNode);
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { WstETHPriceFeedContract };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PartialPriceFeedTreeNode } from "../AbstractPriceFeed.js";
|
|
2
|
+
import { AbstractLPPriceFeedContract } from "../AbstractLPPriceFeed.js";
|
|
3
|
+
import { yearnPriceFeedAbi } from "../../../abi/oracles.js";
|
|
4
|
+
import "../../../abi/index.js";
|
|
5
|
+
import { ConstructOptions } from "../../../base/Construct.js";
|
|
6
|
+
//#region src/onchain/market/pricefeeds/feeds/YearnPriceFeed.d.ts
|
|
7
|
+
type abi = typeof yearnPriceFeedAbi;
|
|
8
|
+
declare class YearnPriceFeedContract extends AbstractLPPriceFeedContract<abi> {
|
|
9
|
+
constructor(options: ConstructOptions, args: PartialPriceFeedTreeNode);
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { YearnPriceFeedContract };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AbstractPriceFeedContract, PartialPriceFeedTreeNode } from "../AbstractPriceFeed.js";
|
|
2
|
+
import { zeroPriceFeedAbi } from "../../../abi/oracles.js";
|
|
3
|
+
import "../../../abi/index.js";
|
|
4
|
+
import { ConstructOptions } from "../../../base/Construct.js";
|
|
5
|
+
//#region src/onchain/market/pricefeeds/feeds/ZeroPriceFeed.d.ts
|
|
6
|
+
type abi = typeof zeroPriceFeedAbi;
|
|
7
|
+
declare class ZeroPriceFeedContract extends AbstractPriceFeedContract<abi> {
|
|
8
|
+
constructor(options: ConstructOptions, args: PartialPriceFeedTreeNode);
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { ZeroPriceFeedContract };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BalancerStablePriceFeedContract } from "./BalancerStablePriceFeed.js";
|
|
2
|
+
import { BalancerWeightedPriceFeedContract } from "./BalancerWeightedPriceFeed.js";
|
|
3
|
+
import { BoundedPriceFeedContract } from "./BoundedPriceFeed.js";
|
|
4
|
+
import { CompositePriceFeedContract } from "./CompositePriceFeed.js";
|
|
5
|
+
import { ConstantPriceFeedContract } from "./ConstantPriceFeed.js";
|
|
6
|
+
import { CurveCryptoPriceFeedContract } from "./CurveCryptoPriceFeed.js";
|
|
7
|
+
import { CurveStablePriceFeedContract } from "./CurveStablePriceFeed.js";
|
|
8
|
+
import { CurveUSDPriceFeedContract } from "./CurveUSDPriceFeed.js";
|
|
9
|
+
import { Erc4626PriceFeedContract } from "./Erc4626PriceFeed.js";
|
|
10
|
+
import { ExternalPriceFeedContract } from "./ExternalPriceFeed.js";
|
|
11
|
+
import { MellowLRTPriceFeedContract } from "./MellowLRTPriceFeed.js";
|
|
12
|
+
import { PendleTWAPPTPriceFeed } from "./PendleTWAPPTPriceFeed.js";
|
|
13
|
+
import { PythPriceFeed } from "./PythPriceFeed.js";
|
|
14
|
+
import { RedstonePriceFeedContract } from "./RedstonePriceFeed.js";
|
|
15
|
+
import { WstETHPriceFeedContract } from "./WstETHPriceFeed.js";
|
|
16
|
+
import { YearnPriceFeedContract } from "./YearnPriceFeed.js";
|
|
17
|
+
import { ZeroPriceFeedContract } from "./ZeroPriceFeed.js";
|
|
18
|
+
export { BalancerStablePriceFeedContract, BalancerWeightedPriceFeedContract, BoundedPriceFeedContract, CompositePriceFeedContract, ConstantPriceFeedContract, CurveCryptoPriceFeedContract, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, Erc4626PriceFeedContract, ExternalPriceFeedContract, MellowLRTPriceFeedContract, PendleTWAPPTPriceFeed, PythPriceFeed, RedstonePriceFeedContract, WstETHPriceFeedContract, YearnPriceFeedContract, ZeroPriceFeedContract };
|
|
@@ -1,27 +1,33 @@
|
|
|
1
|
-
import { IPriceFeedContract,
|
|
1
|
+
import { IPriceFeedContract, PriceFeedContractType, PriceFeedUsageType, PriceUpdate } from "./types.js";
|
|
2
2
|
import { PriceFeedRef } from "./PriceFeedRef.js";
|
|
3
3
|
import { AbstractPriceFeedContract, PartialPriceFeedInitError, PartialPriceFeedTreeNode, PriceFeedConstructorArgs } from "./AbstractPriceFeed.js";
|
|
4
4
|
import { AbstractLPPriceFeedContract, isLPPriceFeed } from "./AbstractLPPriceFeed.js";
|
|
5
|
-
import { BalancerStablePriceFeedContract } from "./BalancerStablePriceFeed.js";
|
|
6
|
-
import { BalancerWeightedPriceFeedContract } from "./BalancerWeightedPriceFeed.js";
|
|
7
|
-
import { BoundedPriceFeedContract } from "./BoundedPriceFeed.js";
|
|
8
|
-
import { CompositePriceFeedContract } from "./CompositePriceFeed.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
5
|
+
import { BalancerStablePriceFeedContract } from "./feeds/BalancerStablePriceFeed.js";
|
|
6
|
+
import { BalancerWeightedPriceFeedContract } from "./feeds/BalancerWeightedPriceFeed.js";
|
|
7
|
+
import { BoundedPriceFeedContract } from "./feeds/BoundedPriceFeed.js";
|
|
8
|
+
import { CompositePriceFeedContract } from "./feeds/CompositePriceFeed.js";
|
|
9
|
+
import { ConstantPriceFeedContract } from "./feeds/ConstantPriceFeed.js";
|
|
10
|
+
import { CurveCryptoPriceFeedContract } from "./feeds/CurveCryptoPriceFeed.js";
|
|
11
|
+
import { CurveStablePriceFeedContract } from "./feeds/CurveStablePriceFeed.js";
|
|
12
|
+
import { CurveUSDPriceFeedContract } from "./feeds/CurveUSDPriceFeed.js";
|
|
13
|
+
import { Erc4626PriceFeedContract } from "./feeds/Erc4626PriceFeed.js";
|
|
14
|
+
import { ExternalPriceFeedContract } from "./feeds/ExternalPriceFeed.js";
|
|
15
|
+
import { MellowLRTPriceFeedContract } from "./feeds/MellowLRTPriceFeed.js";
|
|
16
|
+
import { PendleTWAPPTPriceFeed } from "./feeds/PendleTWAPPTPriceFeed.js";
|
|
17
|
+
import { PythPriceFeed } from "./feeds/PythPriceFeed.js";
|
|
18
|
+
import { PriceUpdatesCache } from "./updates/PriceUpdatesCache.js";
|
|
19
|
+
import { RedstoneOptions, RedstoneUpdater } from "./updates/RedstoneUpdater.js";
|
|
20
|
+
import { IPriceUpdateTask, IPriceUpdater, IUpdatablePriceFeedContract, LatestUpdate, TimestampedCalldata, TimestampedCalldataWithPrice, UpdatablePriceFeedRegistryHooks, UpdatablePriceFeedRegistryOptions, UpdatePriceFeedsResult } from "./updates/types.js";
|
|
21
|
+
import { RedstonePriceFeedContract } from "./feeds/RedstonePriceFeed.js";
|
|
22
|
+
import { WstETHPriceFeedContract } from "./feeds/WstETHPriceFeed.js";
|
|
23
|
+
import { YearnPriceFeedContract } from "./feeds/YearnPriceFeed.js";
|
|
24
|
+
import { ZeroPriceFeedContract } from "./feeds/ZeroPriceFeed.js";
|
|
25
|
+
import "./feeds/index.js";
|
|
26
|
+
import { PriceFeedRegistry } from "./PriceFeedRegistry.js";
|
|
19
27
|
import { FetchRedstonePayloadsOptions, fetchRedstonePayloads } from "./updates/fetchRedstonePayloads.js";
|
|
28
|
+
import { getRawPriceUpdates } from "./updates/getRawPriceUpdates.js";
|
|
29
|
+
import { isUpdatablePriceFeed } from "./updates/isUpdatablePriceFeed.js";
|
|
30
|
+
import { UpdatablePriceFeedRegistry } from "./updates/UpdatablePriceFeedRegistry.js";
|
|
31
|
+
import { updatableDependencies } from "./updates/updatableDependencies.js";
|
|
20
32
|
import "./updates/index.js";
|
|
21
|
-
|
|
22
|
-
import { PythPriceFeed } from "./PythPriceFeed.js";
|
|
23
|
-
import { RedstonePriceFeedContract } from "./RedstonePriceFeed.js";
|
|
24
|
-
import { WstETHPriceFeedContract } from "./WstETHPriceFeed.js";
|
|
25
|
-
import { YearnPriceFeedContract } from "./YearnPriceFeed.js";
|
|
26
|
-
import { ZeroPriceFeedContract } from "./ZeroPriceFeed.js";
|
|
27
|
-
export { AbstractLPPriceFeedContract, AbstractPriceFeedContract, BalancerStablePriceFeedContract, BalancerWeightedPriceFeedContract, BoundedPriceFeedContract, CompositePriceFeedContract, CurveCryptoPriceFeedContract, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, Erc4626PriceFeedContract, ExternalPriceFeedContract, type FetchRedstonePayloadsOptions, IPriceFeedContract, IUpdatablePriceFeedContract, LatestUpdate, MellowLRTPriceFeedContract, PartialPriceFeedInitError, PartialPriceFeedTreeNode, PendleTWAPPTPriceFeed, PriceFeedConstructorArgs, PriceFeedContractType, PriceFeedRef, PriceFeedRegister, PriceFeedRegisterHooks, PriceFeedRegisterOptions, PriceFeedUsageType, PriceUpdate, PythPriceFeed, RedstonePriceFeedContract, type TimestampedCalldata, UpdatePriceFeedsResult, WstETHPriceFeedContract, YearnPriceFeedContract, ZeroPriceFeedContract, fetchRedstonePayloads, getRawPriceUpdates, isLPPriceFeed, isUpdatablePriceFeed };
|
|
33
|
+
export { AbstractLPPriceFeedContract, AbstractPriceFeedContract, BalancerStablePriceFeedContract, BalancerWeightedPriceFeedContract, BoundedPriceFeedContract, CompositePriceFeedContract, ConstantPriceFeedContract, CurveCryptoPriceFeedContract, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, Erc4626PriceFeedContract, ExternalPriceFeedContract, FetchRedstonePayloadsOptions, IPriceFeedContract, type IPriceUpdateTask, type IPriceUpdater, type IUpdatablePriceFeedContract, type LatestUpdate, MellowLRTPriceFeedContract, PartialPriceFeedInitError, PartialPriceFeedTreeNode, PendleTWAPPTPriceFeed, PriceFeedConstructorArgs, PriceFeedContractType, PriceFeedRef, PriceFeedRegistry, PriceFeedUsageType, PriceUpdate, PriceUpdatesCache, PythPriceFeed, RedstoneOptions, RedstonePriceFeedContract, RedstoneUpdater, type TimestampedCalldata, type TimestampedCalldataWithPrice, UpdatablePriceFeedRegistry, type UpdatablePriceFeedRegistryHooks, type UpdatablePriceFeedRegistryOptions, type UpdatePriceFeedsResult, WstETHPriceFeedContract, YearnPriceFeedContract, ZeroPriceFeedContract, fetchRedstonePayloads, getRawPriceUpdates, isLPPriceFeed, isUpdatablePriceFeed, updatableDependencies };
|
|
@@ -3,7 +3,6 @@ import "../../../model/index.js";
|
|
|
3
3
|
import { IBaseContract, PriceFeedAnswer } from "../../base/types.js";
|
|
4
4
|
import { PriceFeedStateHuman } from "../../types/state-human.js";
|
|
5
5
|
import { PriceFeedRef } from "./PriceFeedRef.js";
|
|
6
|
-
import { IPriceUpdateTx, RawTx } from "../../types/transactions.js";
|
|
7
6
|
import "../../types/index.js";
|
|
8
7
|
import "../../base/index.js";
|
|
9
8
|
import { Address, Hex, UnionOmit } from "viem";
|
|
@@ -74,11 +73,6 @@ interface IPriceFeedContract extends IBaseContract {
|
|
|
74
73
|
* @param raw - When `true`, includes raw/unformatted values.
|
|
75
74
|
**/
|
|
76
75
|
stateHuman: (raw?: boolean) => UnionOmit<PriceFeedStateHuman, "stalenessPeriod">;
|
|
77
|
-
/**
|
|
78
|
-
* Collects all updatable feeds in this feed's dependency tree,
|
|
79
|
-
* including this feed itself when it is updatable.
|
|
80
|
-
**/
|
|
81
|
-
updatableDependencies: () => IUpdatablePriceFeedContract[];
|
|
82
76
|
/**
|
|
83
77
|
* Describes this feed and the feeds it reads from the way the shared read
|
|
84
78
|
* model does.
|
|
@@ -88,30 +82,6 @@ interface IPriceFeedContract extends IBaseContract {
|
|
|
88
82
|
**/
|
|
89
83
|
describe: () => PriceFeedData;
|
|
90
84
|
}
|
|
91
|
-
/**
|
|
92
|
-
* Extended price feed interface for feeds whose price can be refreshed
|
|
93
|
-
* via an off-chain data push (e.g. Pyth or Redstone feeds).
|
|
94
|
-
**/
|
|
95
|
-
interface IUpdatablePriceFeedContract extends IPriceFeedContract {
|
|
96
|
-
/**
|
|
97
|
-
* Builds a raw transaction that pushes new price data to the on-chain feed.
|
|
98
|
-
* @param data - ABI-encoded update payload.
|
|
99
|
-
**/
|
|
100
|
-
createPriceUpdateTx: (data: `0x${string}`) => RawTx;
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Result of generating price-feed update transactions.
|
|
104
|
-
**/
|
|
105
|
-
interface UpdatePriceFeedsResult {
|
|
106
|
-
/**
|
|
107
|
-
* Transactions that push fresh prices to updatable feeds.
|
|
108
|
-
**/
|
|
109
|
-
txs: IPriceUpdateTx[];
|
|
110
|
-
/**
|
|
111
|
-
* Latest timestamp among all fetched price updates (unix seconds).
|
|
112
|
-
**/
|
|
113
|
-
timestamp: number;
|
|
114
|
-
}
|
|
115
85
|
/**
|
|
116
86
|
* Pair: updatable price feed address and
|
|
117
87
|
* data can be passed to IUpdatablePriceFeed.updatePrice
|
|
@@ -127,4 +97,4 @@ interface PriceUpdate {
|
|
|
127
97
|
data: Hex;
|
|
128
98
|
}
|
|
129
99
|
//#endregion
|
|
130
|
-
export { IPriceFeedContract,
|
|
100
|
+
export { IPriceFeedContract, PriceFeedContractType, PriceFeedUsageType, PriceUpdate };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IPriceFeedContract } from "../types.js";
|
|
2
|
-
import { IPriceUpdateTask, IPriceUpdater } from "./types.js";
|
|
3
2
|
import { PriceUpdatesCache } from "./PriceUpdatesCache.js";
|
|
4
3
|
import { PriceUpdateTx } from "./PriceUpdateTx.js";
|
|
4
|
+
import { IPriceUpdateTask, IPriceUpdater } from "./types.js";
|
|
5
5
|
import { OnchainSDK } from "../../../OnchainSDK.js";
|
|
6
6
|
import { SDKConstruct } from "../../../base/SDKConstruct.js";
|
|
7
7
|
import "../../../base/index.js";
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { IPriceFeedContract, PriceUpdate } from "../types.js";
|
|
2
|
+
import { LatestUpdate, UpdatablePriceFeedRegistryHooks, UpdatablePriceFeedRegistryOptions, UpdatePriceFeedsResult } from "./types.js";
|
|
3
|
+
import { PriceFeedRegistry } from "../PriceFeedRegistry.js";
|
|
4
|
+
import { IHooks } from "../../../utils/internal/Hooks.js";
|
|
5
|
+
import "../../../utils/internal/index.js";
|
|
6
|
+
import { RawTx } from "../../../types/transactions.js";
|
|
7
|
+
import { OnchainSDK } from "../../../OnchainSDK.js";
|
|
8
|
+
import "../../../types/index.js";
|
|
9
|
+
import { Address, BlockTag } from "viem";
|
|
10
|
+
//#region src/onchain/market/pricefeeds/updates/UpdatablePriceFeedRegistry.d.ts
|
|
11
|
+
/**
|
|
12
|
+
* {@link PriceFeedRegistry} that also orchestrates off-chain price updates
|
|
13
|
+
* (Redstone, etc.).
|
|
14
|
+
**/
|
|
15
|
+
declare class UpdatablePriceFeedRegistry extends PriceFeedRegistry implements IHooks<UpdatablePriceFeedRegistryHooks> {
|
|
16
|
+
#private;
|
|
17
|
+
constructor(sdk: OnchainSDK, opts?: UpdatablePriceFeedRegistryOptions);
|
|
18
|
+
/**
|
|
19
|
+
* @internal
|
|
20
|
+
* Registers a callback for price-feed registry lifecycle events.
|
|
21
|
+
* @param event - Event name.
|
|
22
|
+
* @param handler - Callback to invoke.
|
|
23
|
+
**/
|
|
24
|
+
addHook: <K extends "updatesGenerated">(hookName: K, fn: (...args: UpdatablePriceFeedRegistryHooks[K]) => void | Promise<void>) => void;
|
|
25
|
+
/**
|
|
26
|
+
* @internal
|
|
27
|
+
* Removes a previously registered hook.
|
|
28
|
+
* @param event - Event name.
|
|
29
|
+
* @param handler - Callback to remove.
|
|
30
|
+
**/
|
|
31
|
+
removeHook: <K extends "updatesGenerated">(hookName: K, fn: (...args: UpdatablePriceFeedRegistryHooks[K]) => void | Promise<void>) => void;
|
|
32
|
+
/**
|
|
33
|
+
* Generates transactions to push fresh off-chain prices to updatable feeds.
|
|
34
|
+
*
|
|
35
|
+
* @param priceFeeds - Top-level price feeds whose updatable dependencies
|
|
36
|
+
* will be resolved, or a filter (`{ main: true }` / `{ reserve: true }`)
|
|
37
|
+
* to gather feeds from all oracles. When omitted, all registered feeds
|
|
38
|
+
* are used.
|
|
39
|
+
**/
|
|
40
|
+
generatePriceFeedsUpdateTxs(priceFeeds?: IPriceFeedContract[] | {
|
|
41
|
+
main: true;
|
|
42
|
+
} | {
|
|
43
|
+
reserve: true;
|
|
44
|
+
}): Promise<UpdatePriceFeedsResult>;
|
|
45
|
+
/**
|
|
46
|
+
* Similar to {@link generatePriceFeedsUpdateTxs}, but returns raw structures instead of transactions
|
|
47
|
+
* @param priceFeeds
|
|
48
|
+
* @returns
|
|
49
|
+
*/
|
|
50
|
+
generatePriceFeedsUpdates(priceFeeds?: IPriceFeedContract[] | {
|
|
51
|
+
main: true;
|
|
52
|
+
} | {
|
|
53
|
+
reserve: true;
|
|
54
|
+
}): Promise<PriceUpdate[]>;
|
|
55
|
+
/**
|
|
56
|
+
* Similar to {@link generatePriceFeedsUpdates}, but returns raw transaction to PriceFeedStore.updatePrices
|
|
57
|
+
* @param priceFeeds
|
|
58
|
+
* @returns
|
|
59
|
+
*/
|
|
60
|
+
getPriceFeedStoreUpdateTx(priceFeeds?: IPriceFeedContract[] | {
|
|
61
|
+
main: true;
|
|
62
|
+
} | {
|
|
63
|
+
reserve: true;
|
|
64
|
+
}): Promise<RawTx>;
|
|
65
|
+
/**
|
|
66
|
+
* Similar to {@link generatePriceFeedsUpdateTxs}, but will generate necessary price update transactions for external price feeds (not known to sdk)
|
|
67
|
+
* This does not add feeds to this registry, so they won't be implicitly included in future generatePriceFeedsUpdateTxs calls
|
|
68
|
+
* @param feeds
|
|
69
|
+
* @param block
|
|
70
|
+
* @returns
|
|
71
|
+
*/
|
|
72
|
+
generateExternalPriceFeedsUpdateTxs(feeds: Address[], block?: {
|
|
73
|
+
blockNumber: bigint;
|
|
74
|
+
} | {
|
|
75
|
+
blockTag: BlockTag;
|
|
76
|
+
}): Promise<UpdatePriceFeedsResult>;
|
|
77
|
+
/**
|
|
78
|
+
* Similar to {@link generateExternalPriceFeedsUpdateTxs}, but returns raw structures instead of transactions
|
|
79
|
+
* @param feeds
|
|
80
|
+
* @param block
|
|
81
|
+
* @returns
|
|
82
|
+
*/
|
|
83
|
+
generateExternalPriceFeedsUpdates(feeds: Address[], block?: {
|
|
84
|
+
blockNumber: bigint;
|
|
85
|
+
} | {
|
|
86
|
+
blockTag: BlockTag;
|
|
87
|
+
}): Promise<PriceUpdate[]>;
|
|
88
|
+
/**
|
|
89
|
+
* Loads PARTIAL information about all updatable price feeds from MarketCompressor
|
|
90
|
+
* Discovered price feeds are not saved anywhere in PriceFeedRegistry, and can later be used to load price feed updates
|
|
91
|
+
*/
|
|
92
|
+
getPartialUpdatablePriceFeeds(configurators: Address[]): Promise<IPriceFeedContract[]>;
|
|
93
|
+
/**
|
|
94
|
+
* @internal
|
|
95
|
+
* Diagnostic snapshot of the most recent price-update round, or
|
|
96
|
+
* `undefined` if no updates have been generated yet.
|
|
97
|
+
**/
|
|
98
|
+
get latestUpdate(): LatestUpdate | undefined;
|
|
99
|
+
/**
|
|
100
|
+
* @internal
|
|
101
|
+
* Returns true if any of the updaters are in historical mode
|
|
102
|
+
*/
|
|
103
|
+
get historical(): boolean;
|
|
104
|
+
}
|
|
105
|
+
//#endregion
|
|
106
|
+
export { UpdatablePriceFeedRegistry };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PriceUpdate } from "../types.js";
|
|
2
|
+
import { UpdatePriceFeedsResult } from "./types.js";
|
|
3
|
+
//#region src/onchain/market/pricefeeds/updates/getRawPriceUpdates.d.ts
|
|
4
|
+
declare function getRawPriceUpdates(updates: UpdatePriceFeedsResult): PriceUpdate[];
|
|
5
|
+
//#endregion
|
|
6
|
+
export { getRawPriceUpdates };
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import { IPriceUpdateTask, IPriceUpdater, TimestampedCalldata, TimestampedCalldataWithPrice } from "./types.js";
|
|
2
|
-
import { FetchRedstonePayloadsOptions, fetchRedstonePayloads } from "./fetchRedstonePayloads.js";
|
|
3
1
|
import { PriceUpdatesCache } from "./PriceUpdatesCache.js";
|
|
4
2
|
import { RedstoneOptions, RedstoneUpdater } from "./RedstoneUpdater.js";
|
|
5
|
-
|
|
3
|
+
import { IPriceUpdateTask, IPriceUpdater, IUpdatablePriceFeedContract, LatestUpdate, TimestampedCalldata, TimestampedCalldataWithPrice, UpdatablePriceFeedRegistryHooks, UpdatablePriceFeedRegistryOptions, UpdatePriceFeedsResult } from "./types.js";
|
|
4
|
+
import { FetchRedstonePayloadsOptions, fetchRedstonePayloads } from "./fetchRedstonePayloads.js";
|
|
5
|
+
import { getRawPriceUpdates } from "./getRawPriceUpdates.js";
|
|
6
|
+
import { isUpdatablePriceFeed } from "./isUpdatablePriceFeed.js";
|
|
7
|
+
import { UpdatablePriceFeedRegistry } from "./UpdatablePriceFeedRegistry.js";
|
|
8
|
+
import { updatableDependencies } from "./updatableDependencies.js";
|
|
9
|
+
export { FetchRedstonePayloadsOptions, type IPriceUpdateTask, type IPriceUpdater, type IUpdatablePriceFeedContract, type LatestUpdate, PriceUpdatesCache, RedstoneOptions, RedstoneUpdater, type TimestampedCalldata, type TimestampedCalldataWithPrice, UpdatablePriceFeedRegistry, type UpdatablePriceFeedRegistryHooks, type UpdatablePriceFeedRegistryOptions, type UpdatePriceFeedsResult, fetchRedstonePayloads, getRawPriceUpdates, isUpdatablePriceFeed, updatableDependencies };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IPriceFeedContract } from "../types.js";
|
|
2
|
+
import { IUpdatablePriceFeedContract } from "./types.js";
|
|
3
|
+
//#region src/onchain/market/pricefeeds/updates/isUpdatablePriceFeed.d.ts
|
|
4
|
+
declare function isUpdatablePriceFeed(pf: IPriceFeedContract): pf is IUpdatablePriceFeedContract;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { isUpdatablePriceFeed };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IPriceFeedContract } from "../types.js";
|
|
2
|
-
import {
|
|
2
|
+
import { RedstoneOptions } from "./RedstoneUpdater.js";
|
|
3
|
+
import { IPriceUpdateTx, RawTx } from "../../../types/transactions.js";
|
|
3
4
|
import "../../../types/index.js";
|
|
4
5
|
import { Address } from "viem";
|
|
5
6
|
//#region src/onchain/market/pricefeeds/updates/types.d.ts
|
|
@@ -29,5 +30,58 @@ interface TimestampedCalldataWithPrice extends TimestampedCalldata {
|
|
|
29
30
|
price: bigint;
|
|
30
31
|
decimals: number;
|
|
31
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* Extended price feed interface for feeds whose price can be refreshed
|
|
35
|
+
* via an off-chain data push (e.g. Pyth or Redstone feeds).
|
|
36
|
+
**/
|
|
37
|
+
interface IUpdatablePriceFeedContract extends IPriceFeedContract {
|
|
38
|
+
/**
|
|
39
|
+
* Builds a raw transaction that pushes new price data to the on-chain feed.
|
|
40
|
+
* @param data - ABI-encoded update payload.
|
|
41
|
+
**/
|
|
42
|
+
createPriceUpdateTx: (data: `0x${string}`) => RawTx;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Result of generating price-feed update transactions.
|
|
46
|
+
**/
|
|
47
|
+
interface UpdatePriceFeedsResult {
|
|
48
|
+
/**
|
|
49
|
+
* Transactions that push fresh prices to updatable feeds.
|
|
50
|
+
**/
|
|
51
|
+
txs: IPriceUpdateTx[];
|
|
52
|
+
/**
|
|
53
|
+
* Latest timestamp among all fetched price updates (unix seconds).
|
|
54
|
+
**/
|
|
55
|
+
timestamp: number;
|
|
56
|
+
}
|
|
57
|
+
type UpdatablePriceFeedRegistryHooks = {
|
|
58
|
+
/**
|
|
59
|
+
* Emitted when transactions to update price feeds have been generated, but before they're used anywhere
|
|
60
|
+
*/
|
|
61
|
+
updatesGenerated: [UpdatePriceFeedsResult];
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Configuration for external price-update providers supported by the registry.
|
|
65
|
+
**/
|
|
66
|
+
interface UpdatablePriceFeedRegistryOptions {
|
|
67
|
+
/**
|
|
68
|
+
* Redstone price-update provider options.
|
|
69
|
+
**/
|
|
70
|
+
redstone?: RedstoneOptions;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* @internal
|
|
74
|
+
* Diagnostic snapshot of the most recent price-update round.
|
|
75
|
+
**/
|
|
76
|
+
interface LatestUpdate {
|
|
77
|
+
/**
|
|
78
|
+
* Unix timestamp (seconds) of the most recent update.
|
|
79
|
+
**/
|
|
80
|
+
timestamp: number;
|
|
81
|
+
/**
|
|
82
|
+
* Individual update tasks that were executed.
|
|
83
|
+
**/
|
|
84
|
+
updates: IPriceUpdateTask[];
|
|
85
|
+
}
|
|
32
86
|
//#endregion
|
|
33
|
-
export { IPriceUpdateTask, IPriceUpdater, TimestampedCalldata, TimestampedCalldataWithPrice };
|
|
87
|
+
export { IPriceUpdateTask, IPriceUpdater, IUpdatablePriceFeedContract, LatestUpdate, TimestampedCalldata, TimestampedCalldataWithPrice, UpdatablePriceFeedRegistryHooks, UpdatablePriceFeedRegistryOptions, UpdatePriceFeedsResult };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IPriceFeedContract } from "../types.js";
|
|
2
|
+
import { IUpdatablePriceFeedContract } from "./types.js";
|
|
3
|
+
//#region src/onchain/market/pricefeeds/updates/updatableDependencies.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Collects updatable feeds in this feed's dependency tree, including this
|
|
6
|
+
* feed itself when it is updatable.
|
|
7
|
+
**/
|
|
8
|
+
declare function updatableDependencies(feed: IPriceFeedContract): IUpdatablePriceFeedContract[];
|
|
9
|
+
//#endregion
|
|
10
|
+
export { updatableDependencies };
|