@gearbox-protocol/sdk 8.7.0 → 8.8.1
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/chain/chains.js +6 -0
- package/dist/cjs/sdk/index.js +2 -0
- package/dist/cjs/sdk/market/pricefeeds/updates/PythUpdater.js +25 -0
- package/dist/cjs/sdk/market/pricefeeds/updates/RedstoneUpdater.js +29 -0
- package/dist/cjs/sdk/market/pricefeeds/updates/index.js +4 -0
- package/dist/cjs/sdk/options.js +73 -0
- package/dist/cjs/sdk/sdk-gov-legacy/tokens/normal.js +15 -0
- package/dist/cjs/sdk/sdk-gov-legacy/tokens/token.js +12 -3
- package/dist/cjs/sdk/utils/index.js +3 -1
- package/dist/cjs/sdk/utils/zod.js +39 -0
- package/dist/esm/sdk/chain/chains.js +6 -0
- package/dist/esm/sdk/index.js +1 -0
- package/dist/esm/sdk/market/pricefeeds/updates/PythUpdater.js +24 -0
- package/dist/esm/sdk/market/pricefeeds/updates/RedstoneUpdater.js +28 -0
- package/dist/esm/sdk/market/pricefeeds/updates/index.js +4 -2
- package/dist/esm/sdk/options.js +52 -0
- package/dist/esm/sdk/sdk-gov-legacy/tokens/normal.js +15 -0
- package/dist/esm/sdk/sdk-gov-legacy/tokens/token.js +12 -3
- package/dist/esm/sdk/utils/index.js +1 -0
- package/dist/esm/sdk/utils/zod.js +15 -0
- package/dist/types/sdk/GearboxSDK.d.ts +1 -44
- package/dist/types/sdk/chain/chains.d.ts +1 -1
- package/dist/types/sdk/index.d.ts +1 -0
- package/dist/types/sdk/market/pricefeeds/updates/PythUpdater.d.ts +8 -22
- package/dist/types/sdk/market/pricefeeds/updates/RedstoneUpdater.d.ts +9 -26
- package/dist/types/sdk/market/pricefeeds/updates/index.d.ts +2 -2
- package/dist/types/sdk/options.d.ts +36 -0
- package/dist/types/sdk/sdk-gov-legacy/tokens/normal.d.ts +1 -1
- package/dist/types/sdk/utils/index.d.ts +1 -0
- package/dist/types/sdk/utils/zod.d.ts +5 -0
- package/package.json +1 -1
|
@@ -264,6 +264,9 @@ const chains = {
|
|
|
264
264
|
...import_chains.hemi,
|
|
265
265
|
network: "Hemi",
|
|
266
266
|
defaultMarketConfigurators: {},
|
|
267
|
+
testMarketConfigurators: {
|
|
268
|
+
"0xc9961b8a0c763779690577f2c76962c086af2fe3": "Invariant"
|
|
269
|
+
},
|
|
267
270
|
isPublic: false,
|
|
268
271
|
wellKnownToken: {
|
|
269
272
|
address: "0xad11a8BEb98bbf61dbb1aa0F6d6F2ECD87b35afA",
|
|
@@ -280,6 +283,9 @@ const chains = {
|
|
|
280
283
|
...import_chains.lisk,
|
|
281
284
|
network: "Lisk",
|
|
282
285
|
defaultMarketConfigurators: {},
|
|
286
|
+
testMarketConfigurators: {
|
|
287
|
+
"0x25778dbf0e56b7feb8358c4aa2f6f9e19a1c145a": "Re7"
|
|
288
|
+
},
|
|
283
289
|
isPublic: false,
|
|
284
290
|
wellKnownToken: {
|
|
285
291
|
address: "0xF242275d3a6527d877f2c927a82D9b057609cc71",
|
package/dist/cjs/sdk/index.js
CHANGED
|
@@ -23,6 +23,7 @@ __reExport(sdk_exports, require("./core/index.js"), module.exports);
|
|
|
23
23
|
__reExport(sdk_exports, require("./GearboxSDK.js"), module.exports);
|
|
24
24
|
__reExport(sdk_exports, require("./gauges/index.js"), module.exports);
|
|
25
25
|
__reExport(sdk_exports, require("./market/index.js"), module.exports);
|
|
26
|
+
__reExport(sdk_exports, require("./options.js"), module.exports);
|
|
26
27
|
__reExport(sdk_exports, require("./plugins/index.js"), module.exports);
|
|
27
28
|
__reExport(sdk_exports, require("./router/index.js"), module.exports);
|
|
28
29
|
__reExport(sdk_exports, require("./sdk-gov-legacy/index.js"), module.exports);
|
|
@@ -40,6 +41,7 @@ __reExport(sdk_exports, require("./utils/viem/index.js"), module.exports);
|
|
|
40
41
|
...require("./GearboxSDK.js"),
|
|
41
42
|
...require("./gauges/index.js"),
|
|
42
43
|
...require("./market/index.js"),
|
|
44
|
+
...require("./options.js"),
|
|
43
45
|
...require("./plugins/index.js"),
|
|
44
46
|
...require("./router/index.js"),
|
|
45
47
|
...require("./sdk-gov-legacy/index.js"),
|
|
@@ -18,11 +18,13 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var PythUpdater_exports = {};
|
|
20
20
|
__export(PythUpdater_exports, {
|
|
21
|
+
PythOptions: () => PythOptions,
|
|
21
22
|
PythUpdater: () => PythUpdater
|
|
22
23
|
});
|
|
23
24
|
module.exports = __toCommonJS(PythUpdater_exports);
|
|
24
25
|
var import_buffer = require("buffer");
|
|
25
26
|
var import_viem = require("viem");
|
|
27
|
+
var import_v4 = require("zod/v4");
|
|
26
28
|
var import_base = require("../../../base/index.js");
|
|
27
29
|
var import_utils = require("../../../utils/index.js");
|
|
28
30
|
var import_PriceUpdatesCache = require("./PriceUpdatesCache.js");
|
|
@@ -31,6 +33,28 @@ var import_PythAccumulatorUpdateData = require("./PythAccumulatorUpdateData.js")
|
|
|
31
33
|
class PythUpdateTx extends import_PriceUpdateTx.PriceUpdateTx {
|
|
32
34
|
name = "pyth";
|
|
33
35
|
}
|
|
36
|
+
const PythOptions = import_v4.z.object({
|
|
37
|
+
/**
|
|
38
|
+
* Fixed pyth historic timestamp in seconds
|
|
39
|
+
* Set to true to enable pyth historical mode using timestamp from attach block
|
|
40
|
+
*/
|
|
41
|
+
historicTimestamp: import_v4.z.union([import_v4.z.number().nonnegative(), import_v4.z.literal(true)]).optional(),
|
|
42
|
+
/**
|
|
43
|
+
* Override Hermes API with this proxy. Can be used to set caching proxies, to avoid rate limiting
|
|
44
|
+
*/
|
|
45
|
+
apiProxy: import_v4.z.url().optional(),
|
|
46
|
+
/**
|
|
47
|
+
* TTL for pyth cache in milliseconds
|
|
48
|
+
* If 0, disables caching
|
|
49
|
+
* If not set, uses some default value
|
|
50
|
+
* Cache is always enabled in historical mode
|
|
51
|
+
*/
|
|
52
|
+
cacheTTL: import_v4.z.number().nonnegative().optional(),
|
|
53
|
+
/**
|
|
54
|
+
* When true, no error will be thrown when pyth is unable to fetch data for some feeds
|
|
55
|
+
*/
|
|
56
|
+
ignoreMissingFeeds: import_v4.z.boolean().optional()
|
|
57
|
+
});
|
|
34
58
|
class PythUpdater extends import_base.SDKConstruct {
|
|
35
59
|
#logger;
|
|
36
60
|
#cache;
|
|
@@ -186,5 +210,6 @@ function splitAccumulatorUpdates(binary) {
|
|
|
186
210
|
}
|
|
187
211
|
// Annotate the CommonJS export names for ESM import in node:
|
|
188
212
|
0 && (module.exports = {
|
|
213
|
+
PythOptions,
|
|
189
214
|
PythUpdater
|
|
190
215
|
});
|
|
@@ -18,12 +18,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var RedstoneUpdater_exports = {};
|
|
20
20
|
__export(RedstoneUpdater_exports, {
|
|
21
|
+
RedstoneOptions: () => RedstoneOptions,
|
|
21
22
|
RedstoneUpdater: () => RedstoneUpdater
|
|
22
23
|
});
|
|
23
24
|
module.exports = __toCommonJS(RedstoneUpdater_exports);
|
|
24
25
|
var import_evm_connector = require("@redstone-finance/evm-connector");
|
|
25
26
|
var import_protocol = require("@redstone-finance/protocol");
|
|
26
27
|
var import_viem = require("viem");
|
|
28
|
+
var import_v4 = require("zod/v4");
|
|
27
29
|
var import_base = require("../../../base/index.js");
|
|
28
30
|
var import_utils = require("../../../utils/index.js");
|
|
29
31
|
var import_PriceUpdatesCache = require("./PriceUpdatesCache.js");
|
|
@@ -31,6 +33,32 @@ var import_PriceUpdateTx = require("./PriceUpdateTx.js");
|
|
|
31
33
|
class RedstoneUpdateTx extends import_PriceUpdateTx.PriceUpdateTx {
|
|
32
34
|
name = "redstone";
|
|
33
35
|
}
|
|
36
|
+
const RedstoneOptions = import_v4.z.object({
|
|
37
|
+
/**
|
|
38
|
+
* Fixed redstone historic timestamp in ms
|
|
39
|
+
* Set to true to enable redstone historical mode using timestamp from attach block
|
|
40
|
+
*/
|
|
41
|
+
historicTimestamp: import_v4.z.union([import_v4.z.number().nonnegative(), import_v4.z.literal(true)]).optional(),
|
|
42
|
+
/**
|
|
43
|
+
* Override redstone gateways. Can be used to set caching proxies, to avoid rate limiting
|
|
44
|
+
*/
|
|
45
|
+
gateways: import_v4.z.array(import_v4.z.url()).optional(),
|
|
46
|
+
/**
|
|
47
|
+
* TTL for redstone cache in milliseconds
|
|
48
|
+
* If 0, disables caching
|
|
49
|
+
* If not set, uses some default value
|
|
50
|
+
* Cache is always enabled in historical mode
|
|
51
|
+
*/
|
|
52
|
+
cacheTTL: import_v4.z.number().nonnegative().optional(),
|
|
53
|
+
/**
|
|
54
|
+
* When true, no error will be thrown when redstone is unable to fetch data for some feeds
|
|
55
|
+
*/
|
|
56
|
+
ignoreMissingFeeds: import_v4.z.boolean().optional(),
|
|
57
|
+
/**
|
|
58
|
+
* Enable redstone internal logging
|
|
59
|
+
*/
|
|
60
|
+
enableLogging: import_v4.z.boolean().optional()
|
|
61
|
+
});
|
|
34
62
|
class RedstoneUpdater extends import_base.SDKConstruct {
|
|
35
63
|
#logger;
|
|
36
64
|
#cache;
|
|
@@ -248,5 +276,6 @@ function isRedstone(pf) {
|
|
|
248
276
|
}
|
|
249
277
|
// Annotate the CommonJS export names for ESM import in node:
|
|
250
278
|
0 && (module.exports = {
|
|
279
|
+
RedstoneOptions,
|
|
251
280
|
RedstoneUpdater
|
|
252
281
|
});
|
|
@@ -18,7 +18,9 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var updates_exports = {};
|
|
20
20
|
__export(updates_exports, {
|
|
21
|
+
PythOptions: () => import_PythUpdater.PythOptions,
|
|
21
22
|
PythUpdater: () => import_PythUpdater.PythUpdater,
|
|
23
|
+
RedstoneOptions: () => import_RedstoneUpdater.RedstoneOptions,
|
|
22
24
|
RedstoneUpdater: () => import_RedstoneUpdater.RedstoneUpdater
|
|
23
25
|
});
|
|
24
26
|
module.exports = __toCommonJS(updates_exports);
|
|
@@ -26,6 +28,8 @@ var import_PythUpdater = require("./PythUpdater.js");
|
|
|
26
28
|
var import_RedstoneUpdater = require("./RedstoneUpdater.js");
|
|
27
29
|
// Annotate the CommonJS export names for ESM import in node:
|
|
28
30
|
0 && (module.exports = {
|
|
31
|
+
PythOptions,
|
|
29
32
|
PythUpdater,
|
|
33
|
+
RedstoneOptions,
|
|
30
34
|
RedstoneUpdater
|
|
31
35
|
});
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var options_exports = {};
|
|
20
|
+
__export(options_exports, {
|
|
21
|
+
SDKOptions: () => SDKOptions
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(options_exports);
|
|
24
|
+
var import_v4 = require("zod/v4");
|
|
25
|
+
var import_updates = require("./market/pricefeeds/updates/index.js");
|
|
26
|
+
var import_utils = require("./utils/index.js");
|
|
27
|
+
const SDKOptions = import_v4.z.object({
|
|
28
|
+
/**
|
|
29
|
+
* If not set, address provider address is determinted automatically from networkType
|
|
30
|
+
*/
|
|
31
|
+
addressProvider: (0, import_utils.ZodAddress)().optional(),
|
|
32
|
+
/**
|
|
33
|
+
* Market configurators
|
|
34
|
+
*/
|
|
35
|
+
marketConfigurators: import_v4.z.array((0, import_utils.ZodAddress)()).optional(),
|
|
36
|
+
/**
|
|
37
|
+
* Attach and load state at this specific block number
|
|
38
|
+
*/
|
|
39
|
+
blockNumber: import_v4.z.union([import_v4.z.bigint().nonnegative(), import_v4.z.number().int().nonnegative()]).optional(),
|
|
40
|
+
/**
|
|
41
|
+
* Will skip updateable prices on attach and sync
|
|
42
|
+
* Makes things faster when your service is not intereseted in prices
|
|
43
|
+
*/
|
|
44
|
+
ignoreUpdateablePrices: import_v4.z.boolean().optional(),
|
|
45
|
+
/**
|
|
46
|
+
* Will skip loading markets for these pools on attach/hydrate/sync
|
|
47
|
+
*/
|
|
48
|
+
ignoreMarkets: import_v4.z.array((0, import_utils.ZodAddress)()).optional(),
|
|
49
|
+
/**
|
|
50
|
+
* Will throw an error if contract type is not supported, otherwise will try to use generic contract first, if possible
|
|
51
|
+
*/
|
|
52
|
+
strictContractTypes: import_v4.z.boolean().optional(),
|
|
53
|
+
/**
|
|
54
|
+
* Plugins to extends SDK functionality
|
|
55
|
+
*/
|
|
56
|
+
plugins: import_v4.z.record(import_v4.z.string(), import_v4.z.any()).optional(),
|
|
57
|
+
/**
|
|
58
|
+
* Bring your own logger
|
|
59
|
+
*/
|
|
60
|
+
logger: import_v4.z.any(),
|
|
61
|
+
/**
|
|
62
|
+
* Options related to redstone price feeds
|
|
63
|
+
*/
|
|
64
|
+
redstone: import_updates.RedstoneOptions.optional(),
|
|
65
|
+
/**
|
|
66
|
+
* Options related to pyth price feeds
|
|
67
|
+
*/
|
|
68
|
+
pyth: import_updates.PythOptions.optional()
|
|
69
|
+
});
|
|
70
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
71
|
+
0 && (module.exports = {
|
|
72
|
+
SDKOptions
|
|
73
|
+
});
|
|
@@ -520,6 +520,21 @@ const normalTokens = {
|
|
|
520
520
|
name: "Pendle PT sUSDX 1 September 2025 expiry",
|
|
521
521
|
symbol: "PT_sUSDX_1SEP2025",
|
|
522
522
|
type: { AllNetworks: import_tokenType.TokenType.NORMAL_TOKEN }
|
|
523
|
+
},
|
|
524
|
+
lskETH: {
|
|
525
|
+
name: "lskETH",
|
|
526
|
+
symbol: "lskETH",
|
|
527
|
+
type: { AllNetworks: import_tokenType.TokenType.NORMAL_TOKEN }
|
|
528
|
+
},
|
|
529
|
+
hemiBTC: {
|
|
530
|
+
name: "hemiBTC",
|
|
531
|
+
symbol: "hemiBTC",
|
|
532
|
+
type: { AllNetworks: import_tokenType.TokenType.NORMAL_TOKEN }
|
|
533
|
+
},
|
|
534
|
+
bfBTC: {
|
|
535
|
+
name: "bfBTC",
|
|
536
|
+
symbol: "bfBTC",
|
|
537
|
+
type: { AllNetworks: import_tokenType.TokenType.NORMAL_TOKEN }
|
|
523
538
|
}
|
|
524
539
|
};
|
|
525
540
|
const isNormalToken = (t) => typeof t === "string" && !!normalTokens[t];
|
|
@@ -348,7 +348,10 @@ const tokenDataByNetwork = {
|
|
|
348
348
|
WXTZ: import_constants.NOT_DEPLOYED,
|
|
349
349
|
mBASIS: import_constants.NOT_DEPLOYED,
|
|
350
350
|
mTBILL: import_constants.NOT_DEPLOYED,
|
|
351
|
-
PT_sUSDX_1SEP2025: import_constants.NOT_DEPLOYED
|
|
351
|
+
PT_sUSDX_1SEP2025: import_constants.NOT_DEPLOYED,
|
|
352
|
+
lskETH: import_constants.NOT_DEPLOYED,
|
|
353
|
+
hemiBTC: import_constants.NOT_DEPLOYED,
|
|
354
|
+
bfBTC: import_constants.NOT_DEPLOYED
|
|
352
355
|
},
|
|
353
356
|
///
|
|
354
357
|
///
|
|
@@ -559,8 +562,14 @@ const tokenDataByNetwork = {
|
|
|
559
562
|
WXTZ: "0xc9b53ab2679f573e480d01e0f49e2b5cfb7a3eab",
|
|
560
563
|
mTBILL: "0xdd629e5241cbc5919847783e6c96b2de4754e438"
|
|
561
564
|
},
|
|
562
|
-
Hemi: {
|
|
563
|
-
|
|
565
|
+
Hemi: {
|
|
566
|
+
hemiBTC: "0xAA40c0c7644e0b2B224509571e10ad20d9C4ef28",
|
|
567
|
+
bfBTC: "0x623F2774d9f27B59bc6b954544487532CE79d9DF"
|
|
568
|
+
},
|
|
569
|
+
Lisk: {
|
|
570
|
+
wstETH: "0x76D8de471F54aAA87784119c60Df1bbFc852C415",
|
|
571
|
+
lskETH: "0x1b10E2270780858923cdBbC9B5423e29fffD1A44"
|
|
572
|
+
}
|
|
564
573
|
};
|
|
565
574
|
const tickerInfoTokensByNetwork = {
|
|
566
575
|
Mainnet: {
|
|
@@ -28,6 +28,7 @@ __reExport(utils_exports, require("./mappers.js"), module.exports);
|
|
|
28
28
|
__reExport(utils_exports, require("./retry.js"), module.exports);
|
|
29
29
|
__reExport(utils_exports, require("./toAddress.js"), module.exports);
|
|
30
30
|
__reExport(utils_exports, require("./type-utils.js"), module.exports);
|
|
31
|
+
__reExport(utils_exports, require("./zod.js"), module.exports);
|
|
31
32
|
// Annotate the CommonJS export names for ESM import in node:
|
|
32
33
|
0 && (module.exports = {
|
|
33
34
|
...require("./AddressMap.js"),
|
|
@@ -42,5 +43,6 @@ __reExport(utils_exports, require("./type-utils.js"), module.exports);
|
|
|
42
43
|
...require("./mappers.js"),
|
|
43
44
|
...require("./retry.js"),
|
|
44
45
|
...require("./toAddress.js"),
|
|
45
|
-
...require("./type-utils.js")
|
|
46
|
+
...require("./type-utils.js"),
|
|
47
|
+
...require("./zod.js")
|
|
46
48
|
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var zod_exports = {};
|
|
20
|
+
__export(zod_exports, {
|
|
21
|
+
ZodAddress: () => ZodAddress
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(zod_exports);
|
|
24
|
+
var import_viem = require("viem");
|
|
25
|
+
var import_v4 = require("zod/v4");
|
|
26
|
+
const ZodAddress = () => import_v4.z.string().transform((val, ctx) => {
|
|
27
|
+
if (!(0, import_viem.isAddress)(val)) {
|
|
28
|
+
ctx.issues.push({
|
|
29
|
+
code: "custom",
|
|
30
|
+
message: `invalid address ${val}`,
|
|
31
|
+
input: ctx.value
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
return (0, import_viem.getAddress)(val);
|
|
35
|
+
});
|
|
36
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
37
|
+
0 && (module.exports = {
|
|
38
|
+
ZodAddress
|
|
39
|
+
});
|
|
@@ -250,6 +250,9 @@ const chains = {
|
|
|
250
250
|
...hemi,
|
|
251
251
|
network: "Hemi",
|
|
252
252
|
defaultMarketConfigurators: {},
|
|
253
|
+
testMarketConfigurators: {
|
|
254
|
+
"0xc9961b8a0c763779690577f2c76962c086af2fe3": "Invariant"
|
|
255
|
+
},
|
|
253
256
|
isPublic: false,
|
|
254
257
|
wellKnownToken: {
|
|
255
258
|
address: "0xad11a8BEb98bbf61dbb1aa0F6d6F2ECD87b35afA",
|
|
@@ -266,6 +269,9 @@ const chains = {
|
|
|
266
269
|
...lisk,
|
|
267
270
|
network: "Lisk",
|
|
268
271
|
defaultMarketConfigurators: {},
|
|
272
|
+
testMarketConfigurators: {
|
|
273
|
+
"0x25778dbf0e56b7feb8358c4aa2f6f9e19a1c145a": "Re7"
|
|
274
|
+
},
|
|
269
275
|
isPublic: false,
|
|
270
276
|
wellKnownToken: {
|
|
271
277
|
address: "0xF242275d3a6527d877f2c927a82D9b057609cc71",
|
package/dist/esm/sdk/index.js
CHANGED
|
@@ -6,6 +6,7 @@ export * from "./core/index.js";
|
|
|
6
6
|
export * from "./GearboxSDK.js";
|
|
7
7
|
export * from "./gauges/index.js";
|
|
8
8
|
export * from "./market/index.js";
|
|
9
|
+
export * from "./options.js";
|
|
9
10
|
export * from "./plugins/index.js";
|
|
10
11
|
export * from "./router/index.js";
|
|
11
12
|
export * from "./sdk-gov-legacy/index.js";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Buffer } from "buffer";
|
|
2
2
|
import { encodeAbiParameters, toHex } from "viem";
|
|
3
|
+
import { z } from "zod/v4";
|
|
3
4
|
import { SDKConstruct } from "../../../base/index.js";
|
|
4
5
|
import { childLogger, retry } from "../../../utils/index.js";
|
|
5
6
|
import { PriceUpdatesCache } from "./PriceUpdatesCache.js";
|
|
@@ -12,6 +13,28 @@ import {
|
|
|
12
13
|
class PythUpdateTx extends PriceUpdateTx {
|
|
13
14
|
name = "pyth";
|
|
14
15
|
}
|
|
16
|
+
const PythOptions = z.object({
|
|
17
|
+
/**
|
|
18
|
+
* Fixed pyth historic timestamp in seconds
|
|
19
|
+
* Set to true to enable pyth historical mode using timestamp from attach block
|
|
20
|
+
*/
|
|
21
|
+
historicTimestamp: z.union([z.number().nonnegative(), z.literal(true)]).optional(),
|
|
22
|
+
/**
|
|
23
|
+
* Override Hermes API with this proxy. Can be used to set caching proxies, to avoid rate limiting
|
|
24
|
+
*/
|
|
25
|
+
apiProxy: z.url().optional(),
|
|
26
|
+
/**
|
|
27
|
+
* TTL for pyth cache in milliseconds
|
|
28
|
+
* If 0, disables caching
|
|
29
|
+
* If not set, uses some default value
|
|
30
|
+
* Cache is always enabled in historical mode
|
|
31
|
+
*/
|
|
32
|
+
cacheTTL: z.number().nonnegative().optional(),
|
|
33
|
+
/**
|
|
34
|
+
* When true, no error will be thrown when pyth is unable to fetch data for some feeds
|
|
35
|
+
*/
|
|
36
|
+
ignoreMissingFeeds: z.boolean().optional()
|
|
37
|
+
});
|
|
15
38
|
class PythUpdater extends SDKConstruct {
|
|
16
39
|
#logger;
|
|
17
40
|
#cache;
|
|
@@ -166,5 +189,6 @@ function splitAccumulatorUpdates(binary) {
|
|
|
166
189
|
return results;
|
|
167
190
|
}
|
|
168
191
|
export {
|
|
192
|
+
PythOptions,
|
|
169
193
|
PythUpdater
|
|
170
194
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DataServiceWrapper } from "@redstone-finance/evm-connector";
|
|
2
2
|
import { RedstonePayload } from "@redstone-finance/protocol";
|
|
3
3
|
import { encodeAbiParameters, toBytes } from "viem";
|
|
4
|
+
import { z } from "zod/v4";
|
|
4
5
|
import { SDKConstruct } from "../../../base/index.js";
|
|
5
6
|
import { AddressMap, childLogger, retry } from "../../../utils/index.js";
|
|
6
7
|
import { PriceUpdatesCache } from "./PriceUpdatesCache.js";
|
|
@@ -8,6 +9,32 @@ import { PriceUpdateTx } from "./PriceUpdateTx.js";
|
|
|
8
9
|
class RedstoneUpdateTx extends PriceUpdateTx {
|
|
9
10
|
name = "redstone";
|
|
10
11
|
}
|
|
12
|
+
const RedstoneOptions = z.object({
|
|
13
|
+
/**
|
|
14
|
+
* Fixed redstone historic timestamp in ms
|
|
15
|
+
* Set to true to enable redstone historical mode using timestamp from attach block
|
|
16
|
+
*/
|
|
17
|
+
historicTimestamp: z.union([z.number().nonnegative(), z.literal(true)]).optional(),
|
|
18
|
+
/**
|
|
19
|
+
* Override redstone gateways. Can be used to set caching proxies, to avoid rate limiting
|
|
20
|
+
*/
|
|
21
|
+
gateways: z.array(z.url()).optional(),
|
|
22
|
+
/**
|
|
23
|
+
* TTL for redstone cache in milliseconds
|
|
24
|
+
* If 0, disables caching
|
|
25
|
+
* If not set, uses some default value
|
|
26
|
+
* Cache is always enabled in historical mode
|
|
27
|
+
*/
|
|
28
|
+
cacheTTL: z.number().nonnegative().optional(),
|
|
29
|
+
/**
|
|
30
|
+
* When true, no error will be thrown when redstone is unable to fetch data for some feeds
|
|
31
|
+
*/
|
|
32
|
+
ignoreMissingFeeds: z.boolean().optional(),
|
|
33
|
+
/**
|
|
34
|
+
* Enable redstone internal logging
|
|
35
|
+
*/
|
|
36
|
+
enableLogging: z.boolean().optional()
|
|
37
|
+
});
|
|
11
38
|
class RedstoneUpdater extends SDKConstruct {
|
|
12
39
|
#logger;
|
|
13
40
|
#cache;
|
|
@@ -224,5 +251,6 @@ function isRedstone(pf) {
|
|
|
224
251
|
return pf.contractType === "PRICE_FEED::REDSTONE";
|
|
225
252
|
}
|
|
226
253
|
export {
|
|
254
|
+
RedstoneOptions,
|
|
227
255
|
RedstoneUpdater
|
|
228
256
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { PythUpdater } from "./PythUpdater.js";
|
|
2
|
-
import { RedstoneUpdater } from "./RedstoneUpdater.js";
|
|
1
|
+
import { PythOptions, PythUpdater } from "./PythUpdater.js";
|
|
2
|
+
import { RedstoneOptions, RedstoneUpdater } from "./RedstoneUpdater.js";
|
|
3
3
|
export {
|
|
4
|
+
PythOptions,
|
|
4
5
|
PythUpdater,
|
|
6
|
+
RedstoneOptions,
|
|
5
7
|
RedstoneUpdater
|
|
6
8
|
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { z } from "zod/v4";
|
|
2
|
+
import {
|
|
3
|
+
PythOptions,
|
|
4
|
+
RedstoneOptions
|
|
5
|
+
} from "./market/pricefeeds/updates/index.js";
|
|
6
|
+
import { ZodAddress } from "./utils/index.js";
|
|
7
|
+
const SDKOptions = z.object({
|
|
8
|
+
/**
|
|
9
|
+
* If not set, address provider address is determinted automatically from networkType
|
|
10
|
+
*/
|
|
11
|
+
addressProvider: ZodAddress().optional(),
|
|
12
|
+
/**
|
|
13
|
+
* Market configurators
|
|
14
|
+
*/
|
|
15
|
+
marketConfigurators: z.array(ZodAddress()).optional(),
|
|
16
|
+
/**
|
|
17
|
+
* Attach and load state at this specific block number
|
|
18
|
+
*/
|
|
19
|
+
blockNumber: z.union([z.bigint().nonnegative(), z.number().int().nonnegative()]).optional(),
|
|
20
|
+
/**
|
|
21
|
+
* Will skip updateable prices on attach and sync
|
|
22
|
+
* Makes things faster when your service is not intereseted in prices
|
|
23
|
+
*/
|
|
24
|
+
ignoreUpdateablePrices: z.boolean().optional(),
|
|
25
|
+
/**
|
|
26
|
+
* Will skip loading markets for these pools on attach/hydrate/sync
|
|
27
|
+
*/
|
|
28
|
+
ignoreMarkets: z.array(ZodAddress()).optional(),
|
|
29
|
+
/**
|
|
30
|
+
* Will throw an error if contract type is not supported, otherwise will try to use generic contract first, if possible
|
|
31
|
+
*/
|
|
32
|
+
strictContractTypes: z.boolean().optional(),
|
|
33
|
+
/**
|
|
34
|
+
* Plugins to extends SDK functionality
|
|
35
|
+
*/
|
|
36
|
+
plugins: z.record(z.string(), z.any()).optional(),
|
|
37
|
+
/**
|
|
38
|
+
* Bring your own logger
|
|
39
|
+
*/
|
|
40
|
+
logger: z.any(),
|
|
41
|
+
/**
|
|
42
|
+
* Options related to redstone price feeds
|
|
43
|
+
*/
|
|
44
|
+
redstone: RedstoneOptions.optional(),
|
|
45
|
+
/**
|
|
46
|
+
* Options related to pyth price feeds
|
|
47
|
+
*/
|
|
48
|
+
pyth: PythOptions.optional()
|
|
49
|
+
});
|
|
50
|
+
export {
|
|
51
|
+
SDKOptions
|
|
52
|
+
};
|
|
@@ -496,6 +496,21 @@ const normalTokens = {
|
|
|
496
496
|
name: "Pendle PT sUSDX 1 September 2025 expiry",
|
|
497
497
|
symbol: "PT_sUSDX_1SEP2025",
|
|
498
498
|
type: { AllNetworks: TokenType.NORMAL_TOKEN }
|
|
499
|
+
},
|
|
500
|
+
lskETH: {
|
|
501
|
+
name: "lskETH",
|
|
502
|
+
symbol: "lskETH",
|
|
503
|
+
type: { AllNetworks: TokenType.NORMAL_TOKEN }
|
|
504
|
+
},
|
|
505
|
+
hemiBTC: {
|
|
506
|
+
name: "hemiBTC",
|
|
507
|
+
symbol: "hemiBTC",
|
|
508
|
+
type: { AllNetworks: TokenType.NORMAL_TOKEN }
|
|
509
|
+
},
|
|
510
|
+
bfBTC: {
|
|
511
|
+
name: "bfBTC",
|
|
512
|
+
symbol: "bfBTC",
|
|
513
|
+
type: { AllNetworks: TokenType.NORMAL_TOKEN }
|
|
499
514
|
}
|
|
500
515
|
};
|
|
501
516
|
const isNormalToken = (t) => typeof t === "string" && !!normalTokens[t];
|
|
@@ -321,7 +321,10 @@ const tokenDataByNetwork = {
|
|
|
321
321
|
WXTZ: NOT_DEPLOYED,
|
|
322
322
|
mBASIS: NOT_DEPLOYED,
|
|
323
323
|
mTBILL: NOT_DEPLOYED,
|
|
324
|
-
PT_sUSDX_1SEP2025: NOT_DEPLOYED
|
|
324
|
+
PT_sUSDX_1SEP2025: NOT_DEPLOYED,
|
|
325
|
+
lskETH: NOT_DEPLOYED,
|
|
326
|
+
hemiBTC: NOT_DEPLOYED,
|
|
327
|
+
bfBTC: NOT_DEPLOYED
|
|
325
328
|
},
|
|
326
329
|
///
|
|
327
330
|
///
|
|
@@ -532,8 +535,14 @@ const tokenDataByNetwork = {
|
|
|
532
535
|
WXTZ: "0xc9b53ab2679f573e480d01e0f49e2b5cfb7a3eab",
|
|
533
536
|
mTBILL: "0xdd629e5241cbc5919847783e6c96b2de4754e438"
|
|
534
537
|
},
|
|
535
|
-
Hemi: {
|
|
536
|
-
|
|
538
|
+
Hemi: {
|
|
539
|
+
hemiBTC: "0xAA40c0c7644e0b2B224509571e10ad20d9C4ef28",
|
|
540
|
+
bfBTC: "0x623F2774d9f27B59bc6b954544487532CE79d9DF"
|
|
541
|
+
},
|
|
542
|
+
Lisk: {
|
|
543
|
+
wstETH: "0x76D8de471F54aAA87784119c60Df1bbFc852C415",
|
|
544
|
+
lskETH: "0x1b10E2270780858923cdBbC9B5423e29fffD1A44"
|
|
545
|
+
}
|
|
537
546
|
};
|
|
538
547
|
const tickerInfoTokensByNetwork = {
|
|
539
548
|
Mainnet: {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { getAddress, isAddress } from "viem";
|
|
2
|
+
import { z } from "zod/v4";
|
|
3
|
+
const ZodAddress = () => z.string().transform((val, ctx) => {
|
|
4
|
+
if (!isAddress(val)) {
|
|
5
|
+
ctx.issues.push({
|
|
6
|
+
code: "custom",
|
|
7
|
+
message: `invalid address ${val}`,
|
|
8
|
+
input: ctx.value
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
return getAddress(val);
|
|
12
|
+
});
|
|
13
|
+
export {
|
|
14
|
+
ZodAddress
|
|
15
|
+
};
|
|
@@ -8,7 +8,7 @@ import type { IAddressProviderContract } from "./core/index.js";
|
|
|
8
8
|
import { BotListContract, GearStakingContract } from "./core/index.js";
|
|
9
9
|
import { MarketRegister } from "./market/MarketRegister.js";
|
|
10
10
|
import { PriceFeedRegister } from "./market/pricefeeds/index.js";
|
|
11
|
-
import type {
|
|
11
|
+
import type { SDKOptions } from "./options.js";
|
|
12
12
|
import { type PluginsMap } from "./plugins/index.js";
|
|
13
13
|
import { type IRouterContract } from "./router/index.js";
|
|
14
14
|
import type { GearboxState, GearboxStateHuman, ILogger, MultiCall } from "./types/index.js";
|
|
@@ -17,49 +17,6 @@ import { AddressMap } from "./utils/index.js";
|
|
|
17
17
|
* State version, checked duryng hydration
|
|
18
18
|
*/
|
|
19
19
|
export declare const STATE_VERSION = 1;
|
|
20
|
-
export interface SDKOptions<Plugins extends PluginsMap> {
|
|
21
|
-
/**
|
|
22
|
-
* If not set, address provider address is determinted automatically from networkType
|
|
23
|
-
*/
|
|
24
|
-
addressProvider?: Address;
|
|
25
|
-
/**
|
|
26
|
-
* Market configurators
|
|
27
|
-
*/
|
|
28
|
-
marketConfigurators?: Address[];
|
|
29
|
-
/**
|
|
30
|
-
* Attach and load state at this specific block number
|
|
31
|
-
*/
|
|
32
|
-
blockNumber?: bigint | number;
|
|
33
|
-
/**
|
|
34
|
-
* Will skip updateable prices on attach and sync
|
|
35
|
-
* Makes things faster when your service is not intereseted in prices
|
|
36
|
-
*/
|
|
37
|
-
ignoreUpdateablePrices?: boolean;
|
|
38
|
-
/**
|
|
39
|
-
* Will skip loading markets for these pools on attach/hydrate/sync
|
|
40
|
-
*/
|
|
41
|
-
ignoreMarkets?: Address[];
|
|
42
|
-
/**
|
|
43
|
-
* Will throw an error if contract type is not supported, otherwise will try to use generic contract first, if possible
|
|
44
|
-
*/
|
|
45
|
-
strictContractTypes?: boolean;
|
|
46
|
-
/**
|
|
47
|
-
* Plugins to extends SDK functionality
|
|
48
|
-
*/
|
|
49
|
-
plugins?: Plugins;
|
|
50
|
-
/**
|
|
51
|
-
* Bring your own logger
|
|
52
|
-
*/
|
|
53
|
-
logger?: ILogger;
|
|
54
|
-
/**
|
|
55
|
-
* Options related to redstone price feeds
|
|
56
|
-
*/
|
|
57
|
-
redstone?: RedstoneOptions;
|
|
58
|
-
/**
|
|
59
|
-
* Options related to pyth price feeds
|
|
60
|
-
*/
|
|
61
|
-
pyth?: PythOptions;
|
|
62
|
-
}
|
|
63
20
|
export type HydrateOptions<Plugins extends PluginsMap> = Omit<SDKOptions<Plugins>, "blockNumber" | "addressProvider" | "marketConfigurators">;
|
|
64
21
|
export interface SyncStateOptions {
|
|
65
22
|
blockNumber: bigint;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Address, Chain } from "viem";
|
|
2
2
|
import { z } from "zod/v4";
|
|
3
|
-
export type Curator = "Chaos Labs" | "K3" | "cp0x" | "Re7";
|
|
3
|
+
export type Curator = "Chaos Labs" | "K3" | "cp0x" | "Re7" | "Invariant";
|
|
4
4
|
export interface GearboxChain extends Chain {
|
|
5
5
|
network: NetworkType;
|
|
6
6
|
defaultMarketConfigurators: Record<Address, Curator>;
|
|
@@ -6,6 +6,7 @@ export * from "./core/index.js";
|
|
|
6
6
|
export * from "./GearboxSDK.js";
|
|
7
7
|
export * from "./gauges/index.js";
|
|
8
8
|
export * from "./market/index.js";
|
|
9
|
+
export * from "./options.js";
|
|
9
10
|
export * from "./plugins/index.js";
|
|
10
11
|
export * from "./router/index.js";
|
|
11
12
|
export * from "./sdk-gov-legacy/index.js";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { z } from "zod/v4";
|
|
1
2
|
import { SDKConstruct } from "../../../base/index.js";
|
|
2
3
|
import type { GearboxSDK } from "../../../GearboxSDK.js";
|
|
3
4
|
import type { IPriceFeedContract } from "../types.js";
|
|
@@ -7,28 +8,13 @@ export type PythUpdateTask = IPriceUpdateTask;
|
|
|
7
8
|
declare class PythUpdateTx extends PriceUpdateTx<PythUpdateTask> {
|
|
8
9
|
readonly name = "pyth";
|
|
9
10
|
}
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
* Override Hermes API with this proxy. Can be used to set caching proxies, to avoid rate limiting
|
|
18
|
-
*/
|
|
19
|
-
apiProxy?: string;
|
|
20
|
-
/**
|
|
21
|
-
* TTL for pyth cache in milliseconds
|
|
22
|
-
* If 0, disables caching
|
|
23
|
-
* If not set, uses some default value
|
|
24
|
-
* Cache is always enabled in historical mode
|
|
25
|
-
*/
|
|
26
|
-
cacheTTL?: number;
|
|
27
|
-
/**
|
|
28
|
-
* When true, no error will be thrown when pyth is unable to fetch data for some feeds
|
|
29
|
-
*/
|
|
30
|
-
ignoreMissingFeeds?: boolean;
|
|
31
|
-
}
|
|
11
|
+
export declare const PythOptions: z.ZodObject<{
|
|
12
|
+
historicTimestamp: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<true>]>>;
|
|
13
|
+
apiProxy: z.ZodOptional<z.ZodURL>;
|
|
14
|
+
cacheTTL: z.ZodOptional<z.ZodNumber>;
|
|
15
|
+
ignoreMissingFeeds: z.ZodOptional<z.ZodBoolean>;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
export type PythOptions = z.infer<typeof PythOptions>;
|
|
32
18
|
/**
|
|
33
19
|
* Class to update multiple pyth price feeds at once
|
|
34
20
|
*/
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { z } from "zod/v4";
|
|
1
2
|
import { SDKConstruct } from "../../../base/index.js";
|
|
2
3
|
import type { GearboxSDK } from "../../../GearboxSDK.js";
|
|
3
4
|
import type { IPriceFeedContract } from "../types.js";
|
|
@@ -9,32 +10,14 @@ interface RedstoneUpdateTask extends IPriceUpdateTask {
|
|
|
9
10
|
declare class RedstoneUpdateTx extends PriceUpdateTx<RedstoneUpdateTask> {
|
|
10
11
|
readonly name = "redstone";
|
|
11
12
|
}
|
|
12
|
-
export
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
*/
|
|
21
|
-
gateways?: string[];
|
|
22
|
-
/**
|
|
23
|
-
* TTL for redstone cache in milliseconds
|
|
24
|
-
* If 0, disables caching
|
|
25
|
-
* If not set, uses some default value
|
|
26
|
-
* Cache is always enabled in historical mode
|
|
27
|
-
*/
|
|
28
|
-
cacheTTL?: number;
|
|
29
|
-
/**
|
|
30
|
-
* When true, no error will be thrown when redstone is unable to fetch data for some feeds
|
|
31
|
-
*/
|
|
32
|
-
ignoreMissingFeeds?: boolean;
|
|
33
|
-
/**
|
|
34
|
-
* Enable redstone internal logging
|
|
35
|
-
*/
|
|
36
|
-
enableLogging?: boolean;
|
|
37
|
-
}
|
|
13
|
+
export declare const RedstoneOptions: z.ZodObject<{
|
|
14
|
+
historicTimestamp: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<true>]>>;
|
|
15
|
+
gateways: z.ZodOptional<z.ZodArray<z.ZodURL>>;
|
|
16
|
+
cacheTTL: z.ZodOptional<z.ZodNumber>;
|
|
17
|
+
ignoreMissingFeeds: z.ZodOptional<z.ZodBoolean>;
|
|
18
|
+
enableLogging: z.ZodOptional<z.ZodBoolean>;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
export type RedstoneOptions = z.infer<typeof RedstoneOptions>;
|
|
38
21
|
/**
|
|
39
22
|
* Class to update multiple redstone price feeds at once
|
|
40
23
|
*/
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { PythOptions, PythUpdater } from "./PythUpdater.js";
|
|
2
|
+
export { RedstoneOptions, RedstoneUpdater } from "./RedstoneUpdater.js";
|
|
3
3
|
export type * from "./types.js";
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { z } from "zod/v4";
|
|
2
|
+
import type { PluginsMap } from "./plugins/index.js";
|
|
3
|
+
import type { ILogger } from "./types/index.js";
|
|
4
|
+
export declare const SDKOptions: z.ZodObject<{
|
|
5
|
+
addressProvider: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>;
|
|
6
|
+
marketConfigurators: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>>;
|
|
7
|
+
blockNumber: z.ZodOptional<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber]>>;
|
|
8
|
+
ignoreUpdateablePrices: z.ZodOptional<z.ZodBoolean>;
|
|
9
|
+
ignoreMarkets: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>>;
|
|
10
|
+
strictContractTypes: z.ZodOptional<z.ZodBoolean>;
|
|
11
|
+
plugins: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
12
|
+
logger: z.ZodAny;
|
|
13
|
+
redstone: z.ZodOptional<z.ZodObject<{
|
|
14
|
+
historicTimestamp: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<true>]>>;
|
|
15
|
+
gateways: z.ZodOptional<z.ZodArray<z.ZodURL>>;
|
|
16
|
+
cacheTTL: z.ZodOptional<z.ZodNumber>;
|
|
17
|
+
ignoreMissingFeeds: z.ZodOptional<z.ZodBoolean>;
|
|
18
|
+
enableLogging: z.ZodOptional<z.ZodBoolean>;
|
|
19
|
+
}, z.core.$strip>>;
|
|
20
|
+
pyth: z.ZodOptional<z.ZodObject<{
|
|
21
|
+
historicTimestamp: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<true>]>>;
|
|
22
|
+
apiProxy: z.ZodOptional<z.ZodURL>;
|
|
23
|
+
cacheTTL: z.ZodOptional<z.ZodNumber>;
|
|
24
|
+
ignoreMissingFeeds: z.ZodOptional<z.ZodBoolean>;
|
|
25
|
+
}, z.core.$strip>>;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
export type SDKOptions<Plugins extends PluginsMap> = Omit<z.infer<typeof SDKOptions>, "logger" | "plugins"> & {
|
|
28
|
+
/**
|
|
29
|
+
* Plugins to extends SDK functionality
|
|
30
|
+
*/
|
|
31
|
+
plugins?: Plugins;
|
|
32
|
+
/**
|
|
33
|
+
* Bring your own logger
|
|
34
|
+
*/
|
|
35
|
+
logger?: ILogger;
|
|
36
|
+
};
|
|
@@ -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" | "PT_sUSDX_1SEP2025" | "rstETH_Lido_wstETH" | "DVstETH_Prime_wstETH" | "SHIB" | "crvUSD" | "WBNB" | "BTCB" | "USD1" | "USDX" | "cp0xLRT" | "uptBTC" | "PT_uptBTC_14AUG2025" | "WXTZ" | "mTBILL" | "mBASIS";
|
|
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" | "PT_sUSDX_1SEP2025" | "rstETH_Lido_wstETH" | "DVstETH_Prime_wstETH" | "SHIB" | "crvUSD" | "WBNB" | "BTCB" | "USD1" | "USDX" | "cp0xLRT" | "uptBTC" | "PT_uptBTC_14AUG2025" | "WXTZ" | "mTBILL" | "mBASIS" | "lskETH" | "hemiBTC" | "bfBTC";
|
|
5
5
|
export type NormalTokenData = {
|
|
6
6
|
symbol: NormalToken;
|
|
7
7
|
type: Partial<Record<TokenNetwork, TokenType.NORMAL_TOKEN>>;
|