@gearbox-protocol/sdk 8.1.0-next.2 → 8.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/sdk/GearboxSDK.js +8 -20
- package/dist/cjs/sdk/abi/oracles.js +0 -141
- package/dist/cjs/sdk/chain/chains.js +3 -0
- package/dist/cjs/sdk/market/pricefeeds/AbstractPriceFeed.js +1 -2
- package/dist/cjs/sdk/market/pricefeeds/PriceFeedsRegister.js +23 -17
- package/dist/cjs/sdk/market/pricefeeds/PythPriceFeed.js +1 -9
- package/dist/cjs/sdk/market/pricefeeds/{updates/PriceUpdatesCache.js → RedstoneCache.js} +12 -12
- package/dist/cjs/sdk/market/pricefeeds/RedstonePriceFeed.js +7 -9
- package/dist/cjs/sdk/market/pricefeeds/{updates/RedstoneUpdater.js → RedstoneUpdater.js} +45 -21
- package/dist/cjs/sdk/market/pricefeeds/index.js +0 -2
- package/dist/cjs/sdk/sdk-gov-legacy/tokens/normal.js +5 -0
- package/dist/cjs/sdk/sdk-gov-legacy/tokens/token.js +5 -0
- package/dist/cjs/sdk/sdk-legacy/apy/index.js +1 -0
- package/dist/cjs/sdk/utils/retry.js +2 -4
- package/dist/esm/sdk/GearboxSDK.js +8 -20
- package/dist/esm/sdk/abi/oracles.js +0 -140
- package/dist/esm/sdk/chain/chains.js +3 -0
- package/dist/esm/sdk/market/pricefeeds/AbstractPriceFeed.js +1 -2
- package/dist/esm/sdk/market/pricefeeds/PriceFeedsRegister.js +24 -18
- package/dist/esm/sdk/market/pricefeeds/PythPriceFeed.js +1 -9
- package/dist/esm/sdk/market/pricefeeds/{updates/PriceUpdatesCache.js → RedstoneCache.js} +8 -8
- package/dist/esm/sdk/market/pricefeeds/RedstonePriceFeed.js +5 -8
- package/dist/esm/sdk/market/pricefeeds/{updates/RedstoneUpdater.js → RedstoneUpdater.js} +44 -21
- package/dist/esm/sdk/market/pricefeeds/index.js +0 -1
- package/dist/esm/sdk/sdk-gov-legacy/tokens/normal.js +5 -0
- package/dist/esm/sdk/sdk-gov-legacy/tokens/token.js +5 -0
- package/dist/esm/sdk/sdk-legacy/apy/index.js +1 -0
- package/dist/esm/sdk/utils/retry.js +2 -4
- package/dist/types/sdk/GearboxSDK.d.ts +1 -5
- package/dist/types/sdk/abi/oracles.d.ts +0 -212
- package/dist/types/sdk/chain/chains.d.ts +1 -1
- package/dist/types/sdk/market/pricefeeds/AbstractPriceFeed.d.ts +2 -2
- package/dist/types/sdk/market/pricefeeds/PriceFeedsRegister.d.ts +4 -4
- package/dist/types/sdk/market/pricefeeds/PythPriceFeed.d.ts +4 -218
- package/dist/types/sdk/market/pricefeeds/RedstoneCache.d.ts +25 -0
- package/dist/types/sdk/market/pricefeeds/RedstonePriceFeed.d.ts +4 -4
- package/dist/types/sdk/market/pricefeeds/{updates/RedstoneUpdater.d.ts → RedstoneUpdater.d.ts} +18 -11
- package/dist/types/sdk/market/pricefeeds/index.d.ts +0 -1
- package/dist/types/sdk/market/pricefeeds/types.d.ts +2 -5
- package/dist/types/sdk/sdk-gov-legacy/tokens/normal.d.ts +1 -1
- package/dist/types/sdk/sdk-legacy/apy/index.d.ts +1 -1
- package/dist/types/sdk/utils/retry.d.ts +0 -1
- package/package.json +1 -4
- package/dist/cjs/sdk/market/pricefeeds/isUpdatablePriceFeed.js +0 -30
- package/dist/cjs/sdk/market/pricefeeds/updates/PriceUpdateTx.js +0 -52
- package/dist/cjs/sdk/market/pricefeeds/updates/PythUpdater.js +0 -189
- package/dist/cjs/sdk/market/pricefeeds/updates/index.js +0 -31
- package/dist/cjs/sdk/market/pricefeeds/updates/types.js +0 -16
- package/dist/esm/sdk/market/pricefeeds/isUpdatablePriceFeed.js +0 -6
- package/dist/esm/sdk/market/pricefeeds/updates/PriceUpdateTx.js +0 -28
- package/dist/esm/sdk/market/pricefeeds/updates/PythUpdater.js +0 -169
- package/dist/esm/sdk/market/pricefeeds/updates/index.js +0 -6
- package/dist/esm/sdk/market/pricefeeds/updates/types.js +0 -0
- package/dist/types/sdk/market/pricefeeds/isUpdatablePriceFeed.d.ts +0 -2
- package/dist/types/sdk/market/pricefeeds/updates/PriceUpdateTx.d.ts +0 -10
- package/dist/types/sdk/market/pricefeeds/updates/PriceUpdatesCache.d.ts +0 -17
- package/dist/types/sdk/market/pricefeeds/updates/PythUpdater.d.ts +0 -40
- package/dist/types/sdk/market/pricefeeds/updates/RedstoneUpdater.test.d.ts +0 -1
- package/dist/types/sdk/market/pricefeeds/updates/index.d.ts +0 -3
- package/dist/types/sdk/market/pricefeeds/updates/types.d.ts +0 -21
|
@@ -6157,215 +6157,3 @@ export declare const pendleTWAPPTPriceFeedAbi: readonly [{
|
|
|
6157
6157
|
readonly name: "StalePriceException";
|
|
6158
6158
|
readonly inputs: readonly [];
|
|
6159
6159
|
}];
|
|
6160
|
-
export declare const pythPriceFeedAbi: readonly [{
|
|
6161
|
-
readonly type: "constructor";
|
|
6162
|
-
readonly inputs: readonly [{
|
|
6163
|
-
readonly name: "_token";
|
|
6164
|
-
readonly type: "address";
|
|
6165
|
-
readonly internalType: "address";
|
|
6166
|
-
}, {
|
|
6167
|
-
readonly name: "_priceFeedId";
|
|
6168
|
-
readonly type: "bytes32";
|
|
6169
|
-
readonly internalType: "bytes32";
|
|
6170
|
-
}, {
|
|
6171
|
-
readonly name: "_pyth";
|
|
6172
|
-
readonly type: "address";
|
|
6173
|
-
readonly internalType: "address";
|
|
6174
|
-
}, {
|
|
6175
|
-
readonly name: "_maxConfToPriceRatio";
|
|
6176
|
-
readonly type: "uint256";
|
|
6177
|
-
readonly internalType: "uint256";
|
|
6178
|
-
}, {
|
|
6179
|
-
readonly name: "descriptionTicker";
|
|
6180
|
-
readonly type: "string";
|
|
6181
|
-
readonly internalType: "string";
|
|
6182
|
-
}];
|
|
6183
|
-
readonly stateMutability: "nonpayable";
|
|
6184
|
-
}, {
|
|
6185
|
-
readonly type: "receive";
|
|
6186
|
-
readonly stateMutability: "payable";
|
|
6187
|
-
}, {
|
|
6188
|
-
readonly type: "function";
|
|
6189
|
-
readonly name: "contractType";
|
|
6190
|
-
readonly inputs: readonly [];
|
|
6191
|
-
readonly outputs: readonly [{
|
|
6192
|
-
readonly name: "";
|
|
6193
|
-
readonly type: "bytes32";
|
|
6194
|
-
readonly internalType: "bytes32";
|
|
6195
|
-
}];
|
|
6196
|
-
readonly stateMutability: "view";
|
|
6197
|
-
}, {
|
|
6198
|
-
readonly type: "function";
|
|
6199
|
-
readonly name: "decimals";
|
|
6200
|
-
readonly inputs: readonly [];
|
|
6201
|
-
readonly outputs: readonly [{
|
|
6202
|
-
readonly name: "";
|
|
6203
|
-
readonly type: "uint8";
|
|
6204
|
-
readonly internalType: "uint8";
|
|
6205
|
-
}];
|
|
6206
|
-
readonly stateMutability: "view";
|
|
6207
|
-
}, {
|
|
6208
|
-
readonly type: "function";
|
|
6209
|
-
readonly name: "description";
|
|
6210
|
-
readonly inputs: readonly [];
|
|
6211
|
-
readonly outputs: readonly [{
|
|
6212
|
-
readonly name: "";
|
|
6213
|
-
readonly type: "string";
|
|
6214
|
-
readonly internalType: "string";
|
|
6215
|
-
}];
|
|
6216
|
-
readonly stateMutability: "view";
|
|
6217
|
-
}, {
|
|
6218
|
-
readonly type: "function";
|
|
6219
|
-
readonly name: "latestRoundData";
|
|
6220
|
-
readonly inputs: readonly [];
|
|
6221
|
-
readonly outputs: readonly [{
|
|
6222
|
-
readonly name: "";
|
|
6223
|
-
readonly type: "uint80";
|
|
6224
|
-
readonly internalType: "uint80";
|
|
6225
|
-
}, {
|
|
6226
|
-
readonly name: "";
|
|
6227
|
-
readonly type: "int256";
|
|
6228
|
-
readonly internalType: "int256";
|
|
6229
|
-
}, {
|
|
6230
|
-
readonly name: "";
|
|
6231
|
-
readonly type: "uint256";
|
|
6232
|
-
readonly internalType: "uint256";
|
|
6233
|
-
}, {
|
|
6234
|
-
readonly name: "";
|
|
6235
|
-
readonly type: "uint256";
|
|
6236
|
-
readonly internalType: "uint256";
|
|
6237
|
-
}, {
|
|
6238
|
-
readonly name: "";
|
|
6239
|
-
readonly type: "uint80";
|
|
6240
|
-
readonly internalType: "uint80";
|
|
6241
|
-
}];
|
|
6242
|
-
readonly stateMutability: "view";
|
|
6243
|
-
}, {
|
|
6244
|
-
readonly type: "function";
|
|
6245
|
-
readonly name: "maxConfToPriceRatio";
|
|
6246
|
-
readonly inputs: readonly [];
|
|
6247
|
-
readonly outputs: readonly [{
|
|
6248
|
-
readonly name: "";
|
|
6249
|
-
readonly type: "uint256";
|
|
6250
|
-
readonly internalType: "uint256";
|
|
6251
|
-
}];
|
|
6252
|
-
readonly stateMutability: "view";
|
|
6253
|
-
}, {
|
|
6254
|
-
readonly type: "function";
|
|
6255
|
-
readonly name: "priceFeedId";
|
|
6256
|
-
readonly inputs: readonly [];
|
|
6257
|
-
readonly outputs: readonly [{
|
|
6258
|
-
readonly name: "";
|
|
6259
|
-
readonly type: "bytes32";
|
|
6260
|
-
readonly internalType: "bytes32";
|
|
6261
|
-
}];
|
|
6262
|
-
readonly stateMutability: "view";
|
|
6263
|
-
}, {
|
|
6264
|
-
readonly type: "function";
|
|
6265
|
-
readonly name: "pyth";
|
|
6266
|
-
readonly inputs: readonly [];
|
|
6267
|
-
readonly outputs: readonly [{
|
|
6268
|
-
readonly name: "";
|
|
6269
|
-
readonly type: "address";
|
|
6270
|
-
readonly internalType: "address";
|
|
6271
|
-
}];
|
|
6272
|
-
readonly stateMutability: "view";
|
|
6273
|
-
}, {
|
|
6274
|
-
readonly type: "function";
|
|
6275
|
-
readonly name: "serialize";
|
|
6276
|
-
readonly inputs: readonly [];
|
|
6277
|
-
readonly outputs: readonly [{
|
|
6278
|
-
readonly name: "";
|
|
6279
|
-
readonly type: "bytes";
|
|
6280
|
-
readonly internalType: "bytes";
|
|
6281
|
-
}];
|
|
6282
|
-
readonly stateMutability: "view";
|
|
6283
|
-
}, {
|
|
6284
|
-
readonly type: "function";
|
|
6285
|
-
readonly name: "skipPriceCheck";
|
|
6286
|
-
readonly inputs: readonly [];
|
|
6287
|
-
readonly outputs: readonly [{
|
|
6288
|
-
readonly name: "";
|
|
6289
|
-
readonly type: "bool";
|
|
6290
|
-
readonly internalType: "bool";
|
|
6291
|
-
}];
|
|
6292
|
-
readonly stateMutability: "view";
|
|
6293
|
-
}, {
|
|
6294
|
-
readonly type: "function";
|
|
6295
|
-
readonly name: "token";
|
|
6296
|
-
readonly inputs: readonly [];
|
|
6297
|
-
readonly outputs: readonly [{
|
|
6298
|
-
readonly name: "";
|
|
6299
|
-
readonly type: "address";
|
|
6300
|
-
readonly internalType: "address";
|
|
6301
|
-
}];
|
|
6302
|
-
readonly stateMutability: "view";
|
|
6303
|
-
}, {
|
|
6304
|
-
readonly type: "function";
|
|
6305
|
-
readonly name: "updatable";
|
|
6306
|
-
readonly inputs: readonly [];
|
|
6307
|
-
readonly outputs: readonly [{
|
|
6308
|
-
readonly name: "";
|
|
6309
|
-
readonly type: "bool";
|
|
6310
|
-
readonly internalType: "bool";
|
|
6311
|
-
}];
|
|
6312
|
-
readonly stateMutability: "view";
|
|
6313
|
-
}, {
|
|
6314
|
-
readonly type: "function";
|
|
6315
|
-
readonly name: "updatePrice";
|
|
6316
|
-
readonly inputs: readonly [{
|
|
6317
|
-
readonly name: "data";
|
|
6318
|
-
readonly type: "bytes";
|
|
6319
|
-
readonly internalType: "bytes";
|
|
6320
|
-
}];
|
|
6321
|
-
readonly outputs: readonly [];
|
|
6322
|
-
readonly stateMutability: "nonpayable";
|
|
6323
|
-
}, {
|
|
6324
|
-
readonly type: "function";
|
|
6325
|
-
readonly name: "version";
|
|
6326
|
-
readonly inputs: readonly [];
|
|
6327
|
-
readonly outputs: readonly [{
|
|
6328
|
-
readonly name: "";
|
|
6329
|
-
readonly type: "uint256";
|
|
6330
|
-
readonly internalType: "uint256";
|
|
6331
|
-
}];
|
|
6332
|
-
readonly stateMutability: "view";
|
|
6333
|
-
}, {
|
|
6334
|
-
readonly type: "event";
|
|
6335
|
-
readonly name: "UpdatePrice";
|
|
6336
|
-
readonly inputs: readonly [{
|
|
6337
|
-
readonly name: "price";
|
|
6338
|
-
readonly type: "uint256";
|
|
6339
|
-
readonly indexed: false;
|
|
6340
|
-
readonly internalType: "uint256";
|
|
6341
|
-
}];
|
|
6342
|
-
readonly anonymous: false;
|
|
6343
|
-
}, {
|
|
6344
|
-
readonly type: "error";
|
|
6345
|
-
readonly name: "ConfToPriceRatioTooHighException";
|
|
6346
|
-
readonly inputs: readonly [];
|
|
6347
|
-
}, {
|
|
6348
|
-
readonly type: "error";
|
|
6349
|
-
readonly name: "IncorrectExpectedPublishTimestampException";
|
|
6350
|
-
readonly inputs: readonly [];
|
|
6351
|
-
}, {
|
|
6352
|
-
readonly type: "error";
|
|
6353
|
-
readonly name: "IncorrectParameterException";
|
|
6354
|
-
readonly inputs: readonly [];
|
|
6355
|
-
}, {
|
|
6356
|
-
readonly type: "error";
|
|
6357
|
-
readonly name: "IncorrectPriceDecimalsException";
|
|
6358
|
-
readonly inputs: readonly [];
|
|
6359
|
-
}, {
|
|
6360
|
-
readonly type: "error";
|
|
6361
|
-
readonly name: "IncorrectPriceException";
|
|
6362
|
-
readonly inputs: readonly [];
|
|
6363
|
-
}, {
|
|
6364
|
-
readonly type: "error";
|
|
6365
|
-
readonly name: "PriceTimestampTooFarAheadException";
|
|
6366
|
-
readonly inputs: readonly [];
|
|
6367
|
-
}, {
|
|
6368
|
-
readonly type: "error";
|
|
6369
|
-
readonly name: "PriceTimestampTooFarBehindException";
|
|
6370
|
-
readonly inputs: readonly [];
|
|
6371
|
-
}];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Address, Chain } from "viem";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
export type Curator = "Chaos Labs" | "K3";
|
|
3
|
+
export type Curator = "Chaos Labs" | "K3" | "cp0x";
|
|
4
4
|
export interface GearboxChain extends Chain {
|
|
5
5
|
network: NetworkType;
|
|
6
6
|
defaultMarketConfigurators: Record<Address, Curator>;
|
|
@@ -4,7 +4,7 @@ import { BaseContract } from "../../base/index.js";
|
|
|
4
4
|
import type { GearboxSDK } from "../../GearboxSDK.js";
|
|
5
5
|
import type { PriceFeedStateHuman } from "../../types/index.js";
|
|
6
6
|
import { PriceFeedRef } from "./PriceFeedRef.js";
|
|
7
|
-
import type { IPriceFeedContract,
|
|
7
|
+
import type { IPriceFeedContract, PriceFeedContractType } from "./types.js";
|
|
8
8
|
export type PartialPriceFeedTreeNode = RequiredBy<Partial<PriceFeedTreeNode>, "baseParams">;
|
|
9
9
|
export type PriceFeedConstructorArgs<abi extends Abi | readonly unknown[]> = PartialPriceFeedTreeNode & {
|
|
10
10
|
abi: abi;
|
|
@@ -30,5 +30,5 @@ export declare abstract class AbstractPriceFeedContract<const abi extends Abi |
|
|
|
30
30
|
answer(overrides?: {
|
|
31
31
|
blockNumber?: bigint;
|
|
32
32
|
}): Promise<bigint>;
|
|
33
|
-
updatableDependencies():
|
|
33
|
+
updatableDependencies(): IPriceFeedContract[];
|
|
34
34
|
}
|
|
@@ -5,8 +5,9 @@ import type { GearboxSDK } from "../../GearboxSDK.js";
|
|
|
5
5
|
import type { ILogger } from "../../types/index.js";
|
|
6
6
|
import type { IHooks } from "../../utils/internal/index.js";
|
|
7
7
|
import { type PartialPriceFeedTreeNode } from "./AbstractPriceFeed.js";
|
|
8
|
+
import type { RedstoneOptions, RedstoneUpdateTask } from "./RedstoneUpdater.js";
|
|
9
|
+
import { RedstoneUpdater } from "./RedstoneUpdater.js";
|
|
8
10
|
import type { IPriceFeedContract, UpdatePriceFeedsResult } from "./types.js";
|
|
9
|
-
import type { IPriceUpdater, IPriceUpdateTask, PythOptions, RedstoneOptions } from "./updates/index.js";
|
|
10
11
|
export type PriceFeedRegisterHooks = {
|
|
11
12
|
/**
|
|
12
13
|
* Emitted when transactions to update price feeds have been generated, but before they're used anywhere
|
|
@@ -15,11 +16,10 @@ export type PriceFeedRegisterHooks = {
|
|
|
15
16
|
};
|
|
16
17
|
export interface PriceFeedRegisterOptions {
|
|
17
18
|
redstone?: RedstoneOptions;
|
|
18
|
-
pyth?: PythOptions;
|
|
19
19
|
}
|
|
20
20
|
export interface LatestUpdate {
|
|
21
21
|
timestamp: number;
|
|
22
|
-
|
|
22
|
+
redstone: RedstoneUpdateTask[];
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
25
|
* PriceFeedRegister acts as a chain-level cache to avoid creating multiple contract instances.
|
|
@@ -29,7 +29,7 @@ export interface LatestUpdate {
|
|
|
29
29
|
export declare class PriceFeedRegister extends SDKConstruct implements IHooks<PriceFeedRegisterHooks> {
|
|
30
30
|
#private;
|
|
31
31
|
readonly logger?: ILogger;
|
|
32
|
-
readonly
|
|
32
|
+
readonly redstoneUpdater: RedstoneUpdater;
|
|
33
33
|
constructor(sdk: GearboxSDK, opts?: PriceFeedRegisterOptions);
|
|
34
34
|
addHook: <K extends "updatesGenerated">(hookName: K, fn: (...args: PriceFeedRegisterHooks[K]) => void | Promise<void>) => void;
|
|
35
35
|
removeHook: <K extends "updatesGenerated">(hookName: K, fn: (...args: PriceFeedRegisterHooks[K]) => void | Promise<void>) => void;
|
|
@@ -1,228 +1,14 @@
|
|
|
1
|
-
import type { Address
|
|
1
|
+
import type { Address } from "viem";
|
|
2
2
|
import type { GearboxSDK } from "../../GearboxSDK.js";
|
|
3
|
-
import type { RawTx } from "../../types/index.js";
|
|
4
3
|
import type { PartialPriceFeedTreeNode } from "./AbstractPriceFeed.js";
|
|
5
4
|
import { AbstractPriceFeedContract } from "./AbstractPriceFeed.js";
|
|
6
|
-
|
|
7
|
-
declare const abi: readonly [{
|
|
8
|
-
readonly type: "constructor";
|
|
9
|
-
readonly inputs: readonly [{
|
|
10
|
-
readonly name: "_token";
|
|
11
|
-
readonly type: "address";
|
|
12
|
-
readonly internalType: "address";
|
|
13
|
-
}, {
|
|
14
|
-
readonly name: "_priceFeedId";
|
|
15
|
-
readonly type: "bytes32";
|
|
16
|
-
readonly internalType: "bytes32";
|
|
17
|
-
}, {
|
|
18
|
-
readonly name: "_pyth";
|
|
19
|
-
readonly type: "address";
|
|
20
|
-
readonly internalType: "address";
|
|
21
|
-
}, {
|
|
22
|
-
readonly name: "_maxConfToPriceRatio";
|
|
23
|
-
readonly type: "uint256";
|
|
24
|
-
readonly internalType: "uint256";
|
|
25
|
-
}, {
|
|
26
|
-
readonly name: "descriptionTicker";
|
|
27
|
-
readonly type: "string";
|
|
28
|
-
readonly internalType: "string";
|
|
29
|
-
}];
|
|
30
|
-
readonly stateMutability: "nonpayable";
|
|
31
|
-
}, {
|
|
32
|
-
readonly type: "receive";
|
|
33
|
-
readonly stateMutability: "payable";
|
|
34
|
-
}, {
|
|
35
|
-
readonly type: "function";
|
|
36
|
-
readonly name: "contractType";
|
|
37
|
-
readonly inputs: readonly [];
|
|
38
|
-
readonly outputs: readonly [{
|
|
39
|
-
readonly name: "";
|
|
40
|
-
readonly type: "bytes32";
|
|
41
|
-
readonly internalType: "bytes32";
|
|
42
|
-
}];
|
|
43
|
-
readonly stateMutability: "view";
|
|
44
|
-
}, {
|
|
45
|
-
readonly type: "function";
|
|
46
|
-
readonly name: "decimals";
|
|
47
|
-
readonly inputs: readonly [];
|
|
48
|
-
readonly outputs: readonly [{
|
|
49
|
-
readonly name: "";
|
|
50
|
-
readonly type: "uint8";
|
|
51
|
-
readonly internalType: "uint8";
|
|
52
|
-
}];
|
|
53
|
-
readonly stateMutability: "view";
|
|
54
|
-
}, {
|
|
55
|
-
readonly type: "function";
|
|
56
|
-
readonly name: "description";
|
|
57
|
-
readonly inputs: readonly [];
|
|
58
|
-
readonly outputs: readonly [{
|
|
59
|
-
readonly name: "";
|
|
60
|
-
readonly type: "string";
|
|
61
|
-
readonly internalType: "string";
|
|
62
|
-
}];
|
|
63
|
-
readonly stateMutability: "view";
|
|
64
|
-
}, {
|
|
65
|
-
readonly type: "function";
|
|
66
|
-
readonly name: "latestRoundData";
|
|
67
|
-
readonly inputs: readonly [];
|
|
68
|
-
readonly outputs: readonly [{
|
|
69
|
-
readonly name: "";
|
|
70
|
-
readonly type: "uint80";
|
|
71
|
-
readonly internalType: "uint80";
|
|
72
|
-
}, {
|
|
73
|
-
readonly name: "";
|
|
74
|
-
readonly type: "int256";
|
|
75
|
-
readonly internalType: "int256";
|
|
76
|
-
}, {
|
|
77
|
-
readonly name: "";
|
|
78
|
-
readonly type: "uint256";
|
|
79
|
-
readonly internalType: "uint256";
|
|
80
|
-
}, {
|
|
81
|
-
readonly name: "";
|
|
82
|
-
readonly type: "uint256";
|
|
83
|
-
readonly internalType: "uint256";
|
|
84
|
-
}, {
|
|
85
|
-
readonly name: "";
|
|
86
|
-
readonly type: "uint80";
|
|
87
|
-
readonly internalType: "uint80";
|
|
88
|
-
}];
|
|
89
|
-
readonly stateMutability: "view";
|
|
90
|
-
}, {
|
|
91
|
-
readonly type: "function";
|
|
92
|
-
readonly name: "maxConfToPriceRatio";
|
|
93
|
-
readonly inputs: readonly [];
|
|
94
|
-
readonly outputs: readonly [{
|
|
95
|
-
readonly name: "";
|
|
96
|
-
readonly type: "uint256";
|
|
97
|
-
readonly internalType: "uint256";
|
|
98
|
-
}];
|
|
99
|
-
readonly stateMutability: "view";
|
|
100
|
-
}, {
|
|
101
|
-
readonly type: "function";
|
|
102
|
-
readonly name: "priceFeedId";
|
|
103
|
-
readonly inputs: readonly [];
|
|
104
|
-
readonly outputs: readonly [{
|
|
105
|
-
readonly name: "";
|
|
106
|
-
readonly type: "bytes32";
|
|
107
|
-
readonly internalType: "bytes32";
|
|
108
|
-
}];
|
|
109
|
-
readonly stateMutability: "view";
|
|
110
|
-
}, {
|
|
111
|
-
readonly type: "function";
|
|
112
|
-
readonly name: "pyth";
|
|
113
|
-
readonly inputs: readonly [];
|
|
114
|
-
readonly outputs: readonly [{
|
|
115
|
-
readonly name: "";
|
|
116
|
-
readonly type: "address";
|
|
117
|
-
readonly internalType: "address";
|
|
118
|
-
}];
|
|
119
|
-
readonly stateMutability: "view";
|
|
120
|
-
}, {
|
|
121
|
-
readonly type: "function";
|
|
122
|
-
readonly name: "serialize";
|
|
123
|
-
readonly inputs: readonly [];
|
|
124
|
-
readonly outputs: readonly [{
|
|
125
|
-
readonly name: "";
|
|
126
|
-
readonly type: "bytes";
|
|
127
|
-
readonly internalType: "bytes";
|
|
128
|
-
}];
|
|
129
|
-
readonly stateMutability: "view";
|
|
130
|
-
}, {
|
|
131
|
-
readonly type: "function";
|
|
132
|
-
readonly name: "skipPriceCheck";
|
|
133
|
-
readonly inputs: readonly [];
|
|
134
|
-
readonly outputs: readonly [{
|
|
135
|
-
readonly name: "";
|
|
136
|
-
readonly type: "bool";
|
|
137
|
-
readonly internalType: "bool";
|
|
138
|
-
}];
|
|
139
|
-
readonly stateMutability: "view";
|
|
140
|
-
}, {
|
|
141
|
-
readonly type: "function";
|
|
142
|
-
readonly name: "token";
|
|
143
|
-
readonly inputs: readonly [];
|
|
144
|
-
readonly outputs: readonly [{
|
|
145
|
-
readonly name: "";
|
|
146
|
-
readonly type: "address";
|
|
147
|
-
readonly internalType: "address";
|
|
148
|
-
}];
|
|
149
|
-
readonly stateMutability: "view";
|
|
150
|
-
}, {
|
|
151
|
-
readonly type: "function";
|
|
152
|
-
readonly name: "updatable";
|
|
153
|
-
readonly inputs: readonly [];
|
|
154
|
-
readonly outputs: readonly [{
|
|
155
|
-
readonly name: "";
|
|
156
|
-
readonly type: "bool";
|
|
157
|
-
readonly internalType: "bool";
|
|
158
|
-
}];
|
|
159
|
-
readonly stateMutability: "view";
|
|
160
|
-
}, {
|
|
161
|
-
readonly type: "function";
|
|
162
|
-
readonly name: "updatePrice";
|
|
163
|
-
readonly inputs: readonly [{
|
|
164
|
-
readonly name: "data";
|
|
165
|
-
readonly type: "bytes";
|
|
166
|
-
readonly internalType: "bytes";
|
|
167
|
-
}];
|
|
168
|
-
readonly outputs: readonly [];
|
|
169
|
-
readonly stateMutability: "nonpayable";
|
|
170
|
-
}, {
|
|
171
|
-
readonly type: "function";
|
|
172
|
-
readonly name: "version";
|
|
173
|
-
readonly inputs: readonly [];
|
|
174
|
-
readonly outputs: readonly [{
|
|
175
|
-
readonly name: "";
|
|
176
|
-
readonly type: "uint256";
|
|
177
|
-
readonly internalType: "uint256";
|
|
178
|
-
}];
|
|
179
|
-
readonly stateMutability: "view";
|
|
180
|
-
}, {
|
|
181
|
-
readonly type: "event";
|
|
182
|
-
readonly name: "UpdatePrice";
|
|
183
|
-
readonly inputs: readonly [{
|
|
184
|
-
readonly name: "price";
|
|
185
|
-
readonly type: "uint256";
|
|
186
|
-
readonly indexed: false;
|
|
187
|
-
readonly internalType: "uint256";
|
|
188
|
-
}];
|
|
189
|
-
readonly anonymous: false;
|
|
190
|
-
}, {
|
|
191
|
-
readonly type: "error";
|
|
192
|
-
readonly name: "ConfToPriceRatioTooHighException";
|
|
193
|
-
readonly inputs: readonly [];
|
|
194
|
-
}, {
|
|
195
|
-
readonly type: "error";
|
|
196
|
-
readonly name: "IncorrectExpectedPublishTimestampException";
|
|
197
|
-
readonly inputs: readonly [];
|
|
198
|
-
}, {
|
|
199
|
-
readonly type: "error";
|
|
200
|
-
readonly name: "IncorrectParameterException";
|
|
201
|
-
readonly inputs: readonly [];
|
|
202
|
-
}, {
|
|
203
|
-
readonly type: "error";
|
|
204
|
-
readonly name: "IncorrectPriceDecimalsException";
|
|
205
|
-
readonly inputs: readonly [];
|
|
206
|
-
}, {
|
|
207
|
-
readonly type: "error";
|
|
208
|
-
readonly name: "IncorrectPriceException";
|
|
209
|
-
readonly inputs: readonly [];
|
|
210
|
-
}, {
|
|
211
|
-
readonly type: "error";
|
|
212
|
-
readonly name: "PriceTimestampTooFarAheadException";
|
|
213
|
-
readonly inputs: readonly [];
|
|
214
|
-
}, {
|
|
215
|
-
readonly type: "error";
|
|
216
|
-
readonly name: "PriceTimestampTooFarBehindException";
|
|
217
|
-
readonly inputs: readonly [];
|
|
218
|
-
}];
|
|
5
|
+
declare const abi: readonly [];
|
|
219
6
|
type abi = typeof abi;
|
|
220
|
-
export declare class PythPriceFeed extends AbstractPriceFeedContract<abi>
|
|
7
|
+
export declare class PythPriceFeed extends AbstractPriceFeedContract<abi> {
|
|
221
8
|
readonly token: Address;
|
|
222
|
-
readonly priceFeedId:
|
|
9
|
+
readonly priceFeedId: Address;
|
|
223
10
|
readonly pyth: Address;
|
|
224
11
|
readonly maxConfToPriceRatio?: bigint;
|
|
225
12
|
constructor(sdk: GearboxSDK, args: PartialPriceFeedTreeNode);
|
|
226
|
-
createPriceUpdateTx(data: `0x${string}`): RawTx;
|
|
227
13
|
}
|
|
228
14
|
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface TimestampedCalldata {
|
|
2
|
+
dataFeedId: string;
|
|
3
|
+
data: `0x${string}`;
|
|
4
|
+
/**
|
|
5
|
+
* This timestamp is in seconds
|
|
6
|
+
*/
|
|
7
|
+
timestamp: number;
|
|
8
|
+
cached: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface RedstoneCacheOptions {
|
|
11
|
+
/**
|
|
12
|
+
* Assume that in historical mode we only need to fetch once and then reuse from cache forever
|
|
13
|
+
*/
|
|
14
|
+
historical: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* TTL in milliseconds
|
|
17
|
+
*/
|
|
18
|
+
ttl: number;
|
|
19
|
+
}
|
|
20
|
+
export declare class RedstoneCache {
|
|
21
|
+
#private;
|
|
22
|
+
constructor(opts: RedstoneCacheOptions);
|
|
23
|
+
get(dataServiceId: string, dataFeedId: string, uniqueSignersCount: number): Omit<TimestampedCalldata, "cached"> | undefined;
|
|
24
|
+
set(dataServiceId: string, dataFeedId: string, uniqueSignersCount: number, value: Omit<TimestampedCalldata, "cached">): void;
|
|
25
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { Address, Hex } from "viem";
|
|
2
2
|
import { redstonePriceFeedAbi } from "../../abi/index.js";
|
|
3
3
|
import type { GearboxSDK } from "../../GearboxSDK.js";
|
|
4
|
-
import type {
|
|
4
|
+
import type { RedstonePriceFeedStateHuman } from "../../types/index.js";
|
|
5
5
|
import type { PartialPriceFeedTreeNode } from "./AbstractPriceFeed.js";
|
|
6
6
|
import { AbstractPriceFeedContract } from "./AbstractPriceFeed.js";
|
|
7
|
-
import type {
|
|
7
|
+
import type { IPriceFeedContract } from "./types.js";
|
|
8
8
|
type abi = typeof redstonePriceFeedAbi;
|
|
9
|
-
export declare class RedstonePriceFeedContract extends AbstractPriceFeedContract<abi>
|
|
9
|
+
export declare class RedstonePriceFeedContract extends AbstractPriceFeedContract<abi> {
|
|
10
10
|
readonly token: Address;
|
|
11
11
|
readonly dataServiceId: string;
|
|
12
12
|
readonly dataId: string;
|
|
@@ -16,6 +16,6 @@ export declare class RedstonePriceFeedContract extends AbstractPriceFeedContract
|
|
|
16
16
|
readonly lastPayloadTimestamp: number;
|
|
17
17
|
constructor(sdk: GearboxSDK, args: PartialPriceFeedTreeNode);
|
|
18
18
|
stateHuman(raw?: boolean): Omit<RedstonePriceFeedStateHuman, "stalenessPeriod">;
|
|
19
|
-
createPriceUpdateTx(data: `0x${string}`): RawTx;
|
|
20
19
|
}
|
|
20
|
+
export declare function isRedstone(pf: IPriceFeedContract): pf is RedstonePriceFeedContract;
|
|
21
21
|
export {};
|
package/dist/types/sdk/market/pricefeeds/{updates/RedstoneUpdater.d.ts → RedstoneUpdater.d.ts}
RENAMED
|
@@ -1,13 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import type {
|
|
4
|
-
import {
|
|
5
|
-
import type {
|
|
6
|
-
interface RedstoneUpdateTask
|
|
1
|
+
import type { Address } from "viem";
|
|
2
|
+
import { SDKConstruct } from "../../base/index.js";
|
|
3
|
+
import type { GearboxSDK } from "../../GearboxSDK.js";
|
|
4
|
+
import type { IPriceUpdateTx, RawTx } from "../../types/index.js";
|
|
5
|
+
import type { RedstonePriceFeedContract } from "./RedstonePriceFeed.js";
|
|
6
|
+
export interface RedstoneUpdateTask {
|
|
7
|
+
dataFeedId: string;
|
|
7
8
|
dataServiceId: string;
|
|
9
|
+
priceFeed: Address;
|
|
10
|
+
timestamp: number;
|
|
11
|
+
cached: boolean;
|
|
8
12
|
}
|
|
9
|
-
declare class RedstoneUpdateTx
|
|
10
|
-
readonly
|
|
13
|
+
export declare class RedstoneUpdateTx implements IPriceUpdateTx<RedstoneUpdateTask> {
|
|
14
|
+
readonly raw: RawTx;
|
|
15
|
+
readonly data: RedstoneUpdateTask;
|
|
16
|
+
constructor(raw: RawTx, data: RedstoneUpdateTask);
|
|
17
|
+
get pretty(): string;
|
|
18
|
+
validateTimestamp(blockTimestamp: bigint): "valid" | "too old" | "in future";
|
|
11
19
|
}
|
|
12
20
|
export interface RedstoneOptions {
|
|
13
21
|
/**
|
|
@@ -38,9 +46,8 @@ export interface RedstoneOptions {
|
|
|
38
46
|
/**
|
|
39
47
|
* Class to update multiple redstone price feeds at once
|
|
40
48
|
*/
|
|
41
|
-
export declare class RedstoneUpdater extends SDKConstruct
|
|
49
|
+
export declare class RedstoneUpdater extends SDKConstruct {
|
|
42
50
|
#private;
|
|
43
51
|
constructor(sdk: GearboxSDK, opts?: RedstoneOptions);
|
|
44
|
-
getUpdateTxs(feeds:
|
|
52
|
+
getUpdateTxs(feeds: RedstonePriceFeedContract[], logContext?: Record<string, any>): Promise<RedstoneUpdateTx[]>;
|
|
45
53
|
}
|
|
46
|
-
export {};
|
|
@@ -8,7 +8,6 @@ export * from "./CurveStablePriceFeed.js";
|
|
|
8
8
|
export * from "./CurveUSDPriceFeed.js";
|
|
9
9
|
export * from "./Erc4626PriceFeed.js";
|
|
10
10
|
export * from "./ExternalPriceFeed.js";
|
|
11
|
-
export * from "./isUpdatablePriceFeed.js";
|
|
12
11
|
export * from "./MellowLRTPriceFeed.js";
|
|
13
12
|
export * from "./PendleTWAPPTPriceFeed.js";
|
|
14
13
|
export * from "./PriceFeedRef.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { UnionOmit } from "viem";
|
|
2
2
|
import type { IBaseContract } from "../../base/index.js";
|
|
3
|
-
import type { IPriceUpdateTx, PriceFeedStateHuman
|
|
3
|
+
import type { IPriceUpdateTx, PriceFeedStateHuman } from "../../types/index.js";
|
|
4
4
|
import type { PriceFeedRef } from "./PriceFeedRef.js";
|
|
5
5
|
export type PriceFeedUsageType = "Main" | "Reserve";
|
|
6
6
|
export type PriceFeedContractTypeLegacy = "PF_BALANCER_STABLE_LP_ORACLE" | "PF_BALANCER_WEIGHTED_LP_ORACLE" | "PF_BOUNDED_ORACLE" | "PF_CHAINLINK_ORACLE" | "PF_COMPOSITE_ORACLE" | "PF_CURVE_CRYPTO_LP_ORACLE" | "PF_CURVE_STABLE_LP_ORACLE" | "PF_CURVE_USD_ORACLE" | "PF_ERC4626_ORACLE" | "PF_MELLOW_LRT_ORACLE" | "PF_PENDLE_PT_TWAP_ORACLE" | "PF_PYTH_ORACLE" | "PF_REDSTONE_ORACLE" | "PF_WSTETH_ORACLE" | "PF_YEARN_ORACLE" | "PF_ZERO_ORACLE";
|
|
@@ -27,10 +27,7 @@ export interface IPriceFeedContract extends IBaseContract {
|
|
|
27
27
|
* Returns all updatable depenedencies (uderlying price feeds) of this price feed, including price feed itself, if it's updatable
|
|
28
28
|
* @returns
|
|
29
29
|
*/
|
|
30
|
-
updatableDependencies: () =>
|
|
31
|
-
}
|
|
32
|
-
export interface IUpdatablePriceFeedContract extends IPriceFeedContract {
|
|
33
|
-
createPriceUpdateTx: (data: `0x${string}`) => RawTx;
|
|
30
|
+
updatableDependencies: () => IPriceFeedContract[];
|
|
34
31
|
}
|
|
35
32
|
export interface ILPPriceFeedContract extends IPriceFeedContract {
|
|
36
33
|
getValue: () => Promise<bigint>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { TokenBase } from "./token.js";
|
|
2
2
|
import type { TokenNetwork } from "./tokenType.js";
|
|
3
3
|
import { TokenType } from "./tokenType.js";
|
|
4
|
-
export type NormalToken = "1INCH" | "AAVE" | "CRV" | "LINK" | "SNX" | "UNI" | "USDT" | "DOLA" | "USDC" | "USDC_e" | "DAI" | "WETH" | "WBTC" | "tBTC" | "YFI" | "WLD" | "OP" | "STETH" | "CVX" | "FRAX" | "FXS" | "LDO" | "LUSD" | "sUSD" | "GUSD" | "LQTY" | "GMX" | "ARB" | "BAL" | "ARB" | "MKR" | "RPL" | "APE" | "rETH" | "AURA" | "LBTC" | "eBTC" | "solvBTC" | "pumpBTC" | "osETH" | "weETH" | "SWISE" | "ezETH" | "rsETH" | "PENDLE" | "frxETH" | "cbETH" | "rswETH" | "USDe" | "GHO" | "pufETH" | "wstETH" | "USDS" | "SKY" | "beraSTONE" | "wS" | "stS" | "scUSD" | "T" | "tETH" | "USDL" | "wUSDL" | "csUSDL" | "RLUSD" | "MORPHO" | "steakLRT" | "Re7LRT" | "amphrETH" | "rstETH" | "pzETH" | "DVstETH" | "waEthLidowstETH" | "PT_rsETH_26SEP2024" | "PT_sUSDe_26DEC2024" | "PT_eETH_26DEC2024" | "PT_ezETH_26DEC2024" | "PT_eBTC_26DEC2024" | "PT_LBTC_27MAR2025" | "PT_corn_solvBTC_BBN_26DEC2024" | "PT_corn_pumpBTC_26DEC2024" | "PT_cornLBTC_26DEC2024" | "PT_corn_eBTC_27MAR2025" | "PT_sUSDe_27MAR2025" | "PT_sUSDe_29MAY2025" | "PT_beraSTONE_10APR2025" | "rstETH_Lido_wstETH" | "DVstETH_Prime_wstETH" | "SHIB" | "crvUSD" | "WBNB" | "BTCB" | "USD1" | "USDX";
|
|
4
|
+
export type NormalToken = "1INCH" | "AAVE" | "CRV" | "LINK" | "SNX" | "UNI" | "USDT" | "DOLA" | "USDC" | "USDC_e" | "DAI" | "WETH" | "WBTC" | "tBTC" | "YFI" | "WLD" | "OP" | "STETH" | "CVX" | "FRAX" | "FXS" | "LDO" | "LUSD" | "sUSD" | "GUSD" | "LQTY" | "GMX" | "ARB" | "BAL" | "ARB" | "MKR" | "RPL" | "APE" | "rETH" | "AURA" | "LBTC" | "eBTC" | "solvBTC" | "pumpBTC" | "osETH" | "weETH" | "SWISE" | "ezETH" | "rsETH" | "PENDLE" | "frxETH" | "cbETH" | "rswETH" | "USDe" | "GHO" | "pufETH" | "wstETH" | "USDS" | "SKY" | "beraSTONE" | "wS" | "stS" | "scUSD" | "T" | "tETH" | "USDL" | "wUSDL" | "csUSDL" | "RLUSD" | "MORPHO" | "steakLRT" | "Re7LRT" | "amphrETH" | "rstETH" | "pzETH" | "DVstETH" | "waEthLidowstETH" | "PT_rsETH_26SEP2024" | "PT_sUSDe_26DEC2024" | "PT_eETH_26DEC2024" | "PT_ezETH_26DEC2024" | "PT_eBTC_26DEC2024" | "PT_LBTC_27MAR2025" | "PT_corn_solvBTC_BBN_26DEC2024" | "PT_corn_pumpBTC_26DEC2024" | "PT_cornLBTC_26DEC2024" | "PT_corn_eBTC_27MAR2025" | "PT_sUSDe_27MAR2025" | "PT_sUSDe_29MAY2025" | "PT_beraSTONE_10APR2025" | "rstETH_Lido_wstETH" | "DVstETH_Prime_wstETH" | "SHIB" | "crvUSD" | "WBNB" | "BTCB" | "USD1" | "USDX" | "cp0xLRT";
|
|
5
5
|
export type NormalTokenData = {
|
|
6
6
|
symbol: NormalToken;
|
|
7
7
|
type: Partial<Record<TokenNetwork, TokenType.NORMAL_TOKEN>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Address } from "viem";
|
|
2
2
|
import type { LPTokens, SupportedToken } from "../../sdk-gov-legacy/index.js";
|
|
3
|
-
type ExtraFarmTokens = Extract<SupportedToken, "STETH" | "rETH" | "osETH" | "cbETH" | "wstETH" | "weETH" | "ezETH" | "sfrxETH" | "USDe" | "rsETH" | "rswETH" | "pufETH" | "pzETH" | "rstETH" | "steakLRT" | "amphrETH" | "LBTC" | "Re7LRT" | "PT_ezETH_26DEC2024" | "PT_eETH_26DEC2024" | "PT_sUSDe_26DEC2024" | "PT_eBTC_26DEC2024" | "PT_LBTC_27MAR2025" | "eBTC" | "PT_cornLBTC_26DEC2024" | "PT_corn_eBTC_27MAR2025" | "PT_corn_pumpBTC_26DEC2024" | "pumpBTC" | "PT_sUSDe_27MAR2025" | "DVstETH" | "beraSTONE" | "PT_sUSDe_29MAY2025" | "tETH" | "PT_beraSTONE_10APR2025" | "stS" | "csUSDL" | "scUSD" | "ynBNBx">;
|
|
3
|
+
type ExtraFarmTokens = Extract<SupportedToken, "STETH" | "rETH" | "osETH" | "cbETH" | "wstETH" | "weETH" | "ezETH" | "sfrxETH" | "USDe" | "rsETH" | "rswETH" | "pufETH" | "pzETH" | "rstETH" | "steakLRT" | "amphrETH" | "LBTC" | "Re7LRT" | "PT_ezETH_26DEC2024" | "PT_eETH_26DEC2024" | "PT_sUSDe_26DEC2024" | "PT_eBTC_26DEC2024" | "PT_LBTC_27MAR2025" | "eBTC" | "PT_cornLBTC_26DEC2024" | "PT_corn_eBTC_27MAR2025" | "PT_corn_pumpBTC_26DEC2024" | "pumpBTC" | "PT_sUSDe_27MAR2025" | "DVstETH" | "beraSTONE" | "PT_sUSDe_29MAY2025" | "tETH" | "PT_beraSTONE_10APR2025" | "stS" | "csUSDL" | "scUSD" | "ynBNBx" | "cp0xLRT">;
|
|
4
4
|
type LRTAndLSTTokens = Exclude<ExtraFarmTokens, "USDe">;
|
|
5
5
|
export declare const isExtraFarmToken: (t: unknown) => t is ExtraFarmTokens;
|
|
6
6
|
export declare const isLRT_LSTToken: (t: unknown) => t is LRTAndLSTTokens;
|