@gearbox-protocol/sdk 18.2.0-next.4 → 18.2.0-next.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/permissionless/api/oracles/PermissionlessOracles.js +3 -3
- package/dist/cjs/permissionless/api/oracles/schemas.js +44 -35
- package/dist/cjs/permissionless/api/schemas.js +0 -3
- package/dist/esm/permissionless/api/oracles/PermissionlessOracles.js +3 -3
- package/dist/esm/permissionless/api/oracles/schemas.js +44 -35
- package/dist/esm/permissionless/api/schemas.js +2 -4
- package/dist/types/permissionless/api/index.d.ts +2 -2
- package/dist/types/permissionless/api/oracles/PermissionlessOracles.d.ts +2 -4
- package/dist/types/permissionless/api/oracles/index.d.ts +2 -2
- package/dist/types/permissionless/api/oracles/schemas.d.ts +39 -24
- package/dist/types/permissionless/api/oracles/types.d.ts +47 -54
- package/dist/types/permissionless/api/schemas.d.ts +0 -2
- package/dist/types/permissionless/index.d.ts +2 -2
- package/package.json +1 -1
|
@@ -125,10 +125,10 @@ var PermissionlessOracles = class extends require_offchain_AbstractOffchainNames
|
|
|
125
125
|
* const everywhere = await permissionless.oracles.assets();
|
|
126
126
|
* ```
|
|
127
127
|
**/
|
|
128
|
-
async assets(
|
|
129
|
-
const query = args.chainId === void 0 ? "" : `?chainId=${encodeURIComponent(args.chainId)}`;
|
|
128
|
+
async assets({ chainId } = {}) {
|
|
130
129
|
return this.getData({
|
|
131
|
-
path:
|
|
130
|
+
path: "/pfs/assets",
|
|
131
|
+
query: { chainId: chainId?.toString() },
|
|
132
132
|
schema: require_permissionless_api_oracles_schemas.assetSummariesSchema
|
|
133
133
|
});
|
|
134
134
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_permissionless_api_chains_schemas = require("../chains/schemas.js");
|
|
2
3
|
const require_permissionless_api_schemas = require("../schemas.js");
|
|
3
4
|
let zod_v4 = require("zod/v4");
|
|
4
5
|
//#region src/permissionless/api/oracles/schemas.ts
|
|
@@ -19,22 +20,29 @@ const priceFeedSchema = zod_v4.z.looseObject({
|
|
|
19
20
|
stalenessPeriod: zod_v4.z.number(),
|
|
20
21
|
name: zod_v4.z.string()
|
|
21
22
|
});
|
|
22
|
-
/**
|
|
23
|
-
|
|
23
|
+
/**
|
|
24
|
+
* {@link PermissionlessPriceFeedAsset}
|
|
25
|
+
*
|
|
26
|
+
* What identifies an asset, which is all a feed's own listing of one says.
|
|
27
|
+
**/
|
|
28
|
+
const priceFeedAssetSchema = zod_v4.z.looseObject({
|
|
24
29
|
address: require_permissionless_api_schemas.addressSchema,
|
|
25
30
|
symbol: zod_v4.z.string(),
|
|
26
31
|
name: zod_v4.z.string(),
|
|
27
|
-
decimals: zod_v4.z.number()
|
|
32
|
+
decimals: zod_v4.z.number()
|
|
33
|
+
});
|
|
34
|
+
/** {@link PermissionlessAsset} — identified as above, plus what prices it. */
|
|
35
|
+
const assetSchema = priceFeedAssetSchema.extend({
|
|
28
36
|
owner: require_permissionless_api_schemas.addressSchema,
|
|
29
37
|
priceFeeds: zod_v4.z.array(priceFeedSchema)
|
|
30
38
|
});
|
|
31
|
-
/**
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
39
|
+
/**
|
|
40
|
+
* {@link PermissionlessPriceFeedStore}
|
|
41
|
+
*
|
|
42
|
+
* A store is a chain's, and is described by the same five fields the chain
|
|
43
|
+
* list answers with, so those are extended rather than restated.
|
|
44
|
+
**/
|
|
45
|
+
const priceFeedStoreSchema = require_permissionless_api_chains_schemas.chainSchema.extend({
|
|
38
46
|
assets: zod_v4.z.array(assetSchema),
|
|
39
47
|
priceFeeds: zod_v4.z.array(priceFeedSchema)
|
|
40
48
|
});
|
|
@@ -44,26 +52,29 @@ const pricesSchema = zod_v4.z.looseObject({
|
|
|
44
52
|
marketCaps: require_permissionless_api_schemas.addressRecord(require_permissionless_api_schemas.addressRecord(zod_v4.z.string().nullable())),
|
|
45
53
|
time: zod_v4.z.number()
|
|
46
54
|
});
|
|
47
|
-
/**
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
const
|
|
55
|
+
/**
|
|
56
|
+
* What names a market, whichever side it is being listed from.
|
|
57
|
+
*
|
|
58
|
+
* A feed's markets and an asset's markets are different reads, but they
|
|
59
|
+
* answer with the same market: who curates it, what it is denominated in and
|
|
60
|
+
* how much of the quota is taken. Only what the read is about differs, which
|
|
61
|
+
* is what each of the two below adds.
|
|
62
|
+
**/
|
|
63
|
+
const marketSchema = zod_v4.z.looseObject({
|
|
56
64
|
market: require_permissionless_api_schemas.addressSchema,
|
|
57
65
|
marketConfigurator: require_permissionless_api_schemas.addressSchema,
|
|
58
66
|
curatorName: zod_v4.z.string().nullable(),
|
|
59
67
|
marketName: zod_v4.z.string().nullable(),
|
|
60
|
-
token: require_permissionless_api_schemas.addressSchema,
|
|
61
|
-
tokenSymbol: zod_v4.z.string().nullable(),
|
|
62
68
|
underlyingSymbol: zod_v4.z.string().nullable(),
|
|
63
|
-
reserve: zod_v4.z.boolean(),
|
|
64
69
|
isUnderlying: zod_v4.z.boolean(),
|
|
65
70
|
quotaLimit: zod_v4.z.number().nullable(),
|
|
66
|
-
quotaUsed: zod_v4.z.number().nullable()
|
|
71
|
+
quotaUsed: zod_v4.z.number().nullable()
|
|
72
|
+
});
|
|
73
|
+
/** {@link PermissionlessPriceFeedMarket} — the market as the feed's slot in it. */
|
|
74
|
+
const priceFeedMarketSchema = marketSchema.extend({
|
|
75
|
+
token: require_permissionless_api_schemas.addressSchema,
|
|
76
|
+
tokenSymbol: zod_v4.z.string().nullable(),
|
|
77
|
+
reserve: zod_v4.z.boolean(),
|
|
67
78
|
marketStalenessPeriod: zod_v4.z.number().nullable()
|
|
68
79
|
});
|
|
69
80
|
/** {@link PermissionlessPriceFeedDetails} */
|
|
@@ -84,20 +95,12 @@ const assetMarketFeedSchema = zod_v4.z.looseObject({
|
|
|
84
95
|
name: zod_v4.z.string().nullable(),
|
|
85
96
|
inStore: zod_v4.z.boolean()
|
|
86
97
|
});
|
|
87
|
-
/** {@link PermissionlessAssetMarket} */
|
|
88
|
-
const assetMarketSchema =
|
|
89
|
-
market: require_permissionless_api_schemas.addressSchema,
|
|
90
|
-
marketConfigurator: require_permissionless_api_schemas.addressSchema,
|
|
91
|
-
curatorName: zod_v4.z.string().nullable(),
|
|
92
|
-
marketName: zod_v4.z.string().nullable(),
|
|
98
|
+
/** {@link PermissionlessAssetMarket} — the market as what prices the asset in it. */
|
|
99
|
+
const assetMarketSchema = marketSchema.extend({
|
|
93
100
|
underlyingToken: require_permissionless_api_schemas.addressSchema,
|
|
94
|
-
underlyingSymbol: zod_v4.z.string().nullable(),
|
|
95
|
-
isUnderlying: zod_v4.z.boolean(),
|
|
96
101
|
isShutdown: zod_v4.z.boolean(),
|
|
97
102
|
mainFeed: assetMarketFeedSchema.nullable(),
|
|
98
|
-
reserveFeed: assetMarketFeedSchema.nullable()
|
|
99
|
-
quotaLimit: zod_v4.z.number().nullable(),
|
|
100
|
-
quotaUsed: zod_v4.z.number().nullable()
|
|
103
|
+
reserveFeed: assetMarketFeedSchema.nullable()
|
|
101
104
|
});
|
|
102
105
|
/** {@link PermissionlessAssetDetails} */
|
|
103
106
|
const assetDetailsSchema = zod_v4.z.looseObject({
|
|
@@ -108,7 +111,13 @@ const assetDetailsSchema = zod_v4.z.looseObject({
|
|
|
108
111
|
quotaLimitUsd: zod_v4.z.number().nullable(),
|
|
109
112
|
quotaUsedUsd: zod_v4.z.number().nullable()
|
|
110
113
|
});
|
|
111
|
-
/**
|
|
114
|
+
/**
|
|
115
|
+
* {@link PermissionlessAssetPrices}
|
|
116
|
+
*
|
|
117
|
+
* The same shape as {@link priceFeedMarketCapsSchema} plus the prices, but not
|
|
118
|
+
* an extension of it: the caps there are keyed by asset and these are keyed by
|
|
119
|
+
* feed, so what the two have in common is a coincidence of form.
|
|
120
|
+
**/
|
|
112
121
|
const assetPricesSchema = zod_v4.z.looseObject({
|
|
113
122
|
prices: require_permissionless_api_schemas.addressRecord(zod_v4.z.string().nullable()),
|
|
114
123
|
marketCaps: require_permissionless_api_schemas.addressRecord(zod_v4.z.string().nullable()),
|
|
@@ -12,8 +12,6 @@ let zod_v4 = require("zod/v4");
|
|
|
12
12
|
**/
|
|
13
13
|
/** An address, in whatever case the backend serves it. */
|
|
14
14
|
const addressSchema = zod_v4.z.custom((value) => typeof value === "string" && (0, viem.isAddress)(value, { strict: false }), { message: "invalid address" });
|
|
15
|
-
/** A `0x`-prefixed hex string, as viem's `Hex`. */
|
|
16
|
-
const hexSchema = zod_v4.z.custom((value) => typeof value === "string" && (0, viem.isHex)(value), { message: "invalid hex string" });
|
|
17
15
|
/**
|
|
18
16
|
* A record keyed by address. Spelled out here because zod types a record key
|
|
19
17
|
* by the schema's output, which the branded `Address` is not inferred as.
|
|
@@ -25,4 +23,3 @@ function addressRecord(value) {
|
|
|
25
23
|
//#endregion
|
|
26
24
|
exports.addressRecord = addressRecord;
|
|
27
25
|
exports.addressSchema = addressSchema;
|
|
28
|
-
exports.hexSchema = hexSchema;
|
|
@@ -124,10 +124,10 @@ var PermissionlessOracles = class extends AbstractOffchainNamespace {
|
|
|
124
124
|
* const everywhere = await permissionless.oracles.assets();
|
|
125
125
|
* ```
|
|
126
126
|
**/
|
|
127
|
-
async assets(
|
|
128
|
-
const query = args.chainId === void 0 ? "" : `?chainId=${encodeURIComponent(args.chainId)}`;
|
|
127
|
+
async assets({ chainId } = {}) {
|
|
129
128
|
return this.getData({
|
|
130
|
-
path:
|
|
129
|
+
path: "/pfs/assets",
|
|
130
|
+
query: { chainId: chainId?.toString() },
|
|
131
131
|
schema: assetSummariesSchema
|
|
132
132
|
});
|
|
133
133
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { chainSchema } from "../chains/schemas.js";
|
|
1
2
|
import { addressRecord, addressSchema } from "../schemas.js";
|
|
2
3
|
import { z } from "zod/v4";
|
|
3
4
|
//#region src/permissionless/api/oracles/schemas.ts
|
|
@@ -18,22 +19,29 @@ const priceFeedSchema = z.looseObject({
|
|
|
18
19
|
stalenessPeriod: z.number(),
|
|
19
20
|
name: z.string()
|
|
20
21
|
});
|
|
21
|
-
/**
|
|
22
|
-
|
|
22
|
+
/**
|
|
23
|
+
* {@link PermissionlessPriceFeedAsset}
|
|
24
|
+
*
|
|
25
|
+
* What identifies an asset, which is all a feed's own listing of one says.
|
|
26
|
+
**/
|
|
27
|
+
const priceFeedAssetSchema = z.looseObject({
|
|
23
28
|
address: addressSchema,
|
|
24
29
|
symbol: z.string(),
|
|
25
30
|
name: z.string(),
|
|
26
|
-
decimals: z.number()
|
|
31
|
+
decimals: z.number()
|
|
32
|
+
});
|
|
33
|
+
/** {@link PermissionlessAsset} — identified as above, plus what prices it. */
|
|
34
|
+
const assetSchema = priceFeedAssetSchema.extend({
|
|
27
35
|
owner: addressSchema,
|
|
28
36
|
priceFeeds: z.array(priceFeedSchema)
|
|
29
37
|
});
|
|
30
|
-
/**
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
38
|
+
/**
|
|
39
|
+
* {@link PermissionlessPriceFeedStore}
|
|
40
|
+
*
|
|
41
|
+
* A store is a chain's, and is described by the same five fields the chain
|
|
42
|
+
* list answers with, so those are extended rather than restated.
|
|
43
|
+
**/
|
|
44
|
+
const priceFeedStoreSchema = chainSchema.extend({
|
|
37
45
|
assets: z.array(assetSchema),
|
|
38
46
|
priceFeeds: z.array(priceFeedSchema)
|
|
39
47
|
});
|
|
@@ -43,26 +51,29 @@ const pricesSchema = z.looseObject({
|
|
|
43
51
|
marketCaps: addressRecord(addressRecord(z.string().nullable())),
|
|
44
52
|
time: z.number()
|
|
45
53
|
});
|
|
46
|
-
/**
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const
|
|
54
|
+
/**
|
|
55
|
+
* What names a market, whichever side it is being listed from.
|
|
56
|
+
*
|
|
57
|
+
* A feed's markets and an asset's markets are different reads, but they
|
|
58
|
+
* answer with the same market: who curates it, what it is denominated in and
|
|
59
|
+
* how much of the quota is taken. Only what the read is about differs, which
|
|
60
|
+
* is what each of the two below adds.
|
|
61
|
+
**/
|
|
62
|
+
const marketSchema = z.looseObject({
|
|
55
63
|
market: addressSchema,
|
|
56
64
|
marketConfigurator: addressSchema,
|
|
57
65
|
curatorName: z.string().nullable(),
|
|
58
66
|
marketName: z.string().nullable(),
|
|
59
|
-
token: addressSchema,
|
|
60
|
-
tokenSymbol: z.string().nullable(),
|
|
61
67
|
underlyingSymbol: z.string().nullable(),
|
|
62
|
-
reserve: z.boolean(),
|
|
63
68
|
isUnderlying: z.boolean(),
|
|
64
69
|
quotaLimit: z.number().nullable(),
|
|
65
|
-
quotaUsed: z.number().nullable()
|
|
70
|
+
quotaUsed: z.number().nullable()
|
|
71
|
+
});
|
|
72
|
+
/** {@link PermissionlessPriceFeedMarket} — the market as the feed's slot in it. */
|
|
73
|
+
const priceFeedMarketSchema = marketSchema.extend({
|
|
74
|
+
token: addressSchema,
|
|
75
|
+
tokenSymbol: z.string().nullable(),
|
|
76
|
+
reserve: z.boolean(),
|
|
66
77
|
marketStalenessPeriod: z.number().nullable()
|
|
67
78
|
});
|
|
68
79
|
/** {@link PermissionlessPriceFeedDetails} */
|
|
@@ -83,20 +94,12 @@ const assetMarketFeedSchema = z.looseObject({
|
|
|
83
94
|
name: z.string().nullable(),
|
|
84
95
|
inStore: z.boolean()
|
|
85
96
|
});
|
|
86
|
-
/** {@link PermissionlessAssetMarket} */
|
|
87
|
-
const assetMarketSchema =
|
|
88
|
-
market: addressSchema,
|
|
89
|
-
marketConfigurator: addressSchema,
|
|
90
|
-
curatorName: z.string().nullable(),
|
|
91
|
-
marketName: z.string().nullable(),
|
|
97
|
+
/** {@link PermissionlessAssetMarket} — the market as what prices the asset in it. */
|
|
98
|
+
const assetMarketSchema = marketSchema.extend({
|
|
92
99
|
underlyingToken: addressSchema,
|
|
93
|
-
underlyingSymbol: z.string().nullable(),
|
|
94
|
-
isUnderlying: z.boolean(),
|
|
95
100
|
isShutdown: z.boolean(),
|
|
96
101
|
mainFeed: assetMarketFeedSchema.nullable(),
|
|
97
|
-
reserveFeed: assetMarketFeedSchema.nullable()
|
|
98
|
-
quotaLimit: z.number().nullable(),
|
|
99
|
-
quotaUsed: z.number().nullable()
|
|
102
|
+
reserveFeed: assetMarketFeedSchema.nullable()
|
|
100
103
|
});
|
|
101
104
|
/** {@link PermissionlessAssetDetails} */
|
|
102
105
|
const assetDetailsSchema = z.looseObject({
|
|
@@ -107,7 +110,13 @@ const assetDetailsSchema = z.looseObject({
|
|
|
107
110
|
quotaLimitUsd: z.number().nullable(),
|
|
108
111
|
quotaUsedUsd: z.number().nullable()
|
|
109
112
|
});
|
|
110
|
-
/**
|
|
113
|
+
/**
|
|
114
|
+
* {@link PermissionlessAssetPrices}
|
|
115
|
+
*
|
|
116
|
+
* The same shape as {@link priceFeedMarketCapsSchema} plus the prices, but not
|
|
117
|
+
* an extension of it: the caps there are keyed by asset and these are keyed by
|
|
118
|
+
* feed, so what the two have in common is a coincidence of form.
|
|
119
|
+
**/
|
|
111
120
|
const assetPricesSchema = z.looseObject({
|
|
112
121
|
prices: addressRecord(z.string().nullable()),
|
|
113
122
|
marketCaps: addressRecord(z.string().nullable()),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isAddress
|
|
1
|
+
import { isAddress } from "viem";
|
|
2
2
|
import { z } from "zod/v4";
|
|
3
3
|
//#region src/permissionless/api/schemas.ts
|
|
4
4
|
/**
|
|
@@ -11,8 +11,6 @@ import { z } from "zod/v4";
|
|
|
11
11
|
**/
|
|
12
12
|
/** An address, in whatever case the backend serves it. */
|
|
13
13
|
const addressSchema = z.custom((value) => typeof value === "string" && isAddress(value, { strict: false }), { message: "invalid address" });
|
|
14
|
-
/** A `0x`-prefixed hex string, as viem's `Hex`. */
|
|
15
|
-
const hexSchema = z.custom((value) => typeof value === "string" && isHex(value), { message: "invalid hex string" });
|
|
16
14
|
/**
|
|
17
15
|
* A record keyed by address. Spelled out here because zod types a record key
|
|
18
16
|
* by the schema's output, which the branded `Address` is not inferred as.
|
|
@@ -22,4 +20,4 @@ function addressRecord(value) {
|
|
|
22
20
|
return z.record(key, value);
|
|
23
21
|
}
|
|
24
22
|
//#endregion
|
|
25
|
-
export { addressRecord, addressSchema
|
|
23
|
+
export { addressRecord, addressSchema };
|
|
@@ -5,7 +5,7 @@ import { AttachChainsArgs, ChainScope, ChainSummaryArgs, PermissionlessChain, Pe
|
|
|
5
5
|
import { ChainsNamespace } from "./chains/ChainsNamespace.js";
|
|
6
6
|
import { DeployArgs, DeployContractArgs, DeployPriceFeedArgs, PreparedDeployment, PreparedPriceFeedDeployment } from "./deploy/types.js";
|
|
7
7
|
import { DEFAULT_DEPLOY_SALT, PermissionlessDeploy, priceFeedSalt } from "./deploy/PermissionlessDeploy.js";
|
|
8
|
-
import { AssetArgs, GetPricesArgs, PermissionlessAsset, PermissionlessAssetDetails, PermissionlessAssetMarket, PermissionlessAssetMarketFeed, PermissionlessAssetPrices, PermissionlessAssetSummary, PermissionlessPriceFeedAsset, PermissionlessPriceFeedDetails, PermissionlessPriceFeedMarket, PermissionlessPriceFeedMarketCaps, PermissionlessPriceFeedStore, PermissionlessPrices, PriceFeedArgs } from "./oracles/types.js";
|
|
8
|
+
import { AssetArgs, AssetsArgs, GetPricesArgs, PermissionlessAsset, PermissionlessAssetDetails, PermissionlessAssetMarket, PermissionlessAssetMarketFeed, PermissionlessAssetPrices, PermissionlessAssetSummary, PermissionlessMarket, PermissionlessPriceFeedAsset, PermissionlessPriceFeedDetails, PermissionlessPriceFeedMarket, PermissionlessPriceFeedMarketCaps, PermissionlessPriceFeedStore, PermissionlessPrices, PriceFeedArgs } from "./oracles/types.js";
|
|
9
9
|
import { GET_PRICES_CHUNK_SIZE, GET_PRICES_GAS_LIMIT_BY_CHAIN_ID, PermissionlessOracles } from "./oracles/PermissionlessOracles.js";
|
|
10
10
|
import { AddFeedsArgs, ChangeNamesArgs, ChangeStalenessPeriodsArgs, ForbidFeedsArgs, InstanceTxsArgs, PriceFeedPair } from "./transactions/types.js";
|
|
11
11
|
import { InstanceOwnerTransactions } from "./transactions/InstanceOwnerTransactions.js";
|
|
@@ -17,4 +17,4 @@ import "./deploy/index.js";
|
|
|
17
17
|
import { PermissionlessChainUnreachableError, PermissionlessNotAttachedError, PriceFeedNotInStoreError, PriceFeedSaltMissingError, PriceFeedStalenessUnknownError } from "./errors.js";
|
|
18
18
|
import "./oracles/index.js";
|
|
19
19
|
import "./transactions/index.js";
|
|
20
|
-
export { AddFeedsArgs, AssetArgs, AttachChainsArgs, ChainScope, ChainSummaryArgs, ChainsNamespace, ChangeNamesArgs, ChangeStalenessPeriodsArgs, DEFAULT_DEPLOY_SALT, DeployArgs, DeployContractArgs, DeployPriceFeedArgs, ForbidFeedsArgs, GET_PRICES_CHUNK_SIZE, GET_PRICES_GAS_LIMIT_BY_CHAIN_ID, GearboxPermissionless, GearboxPermissionlessOptions, GetPricesArgs, InstanceOwnerTransactions, InstanceTxsArgs, PermissionlessAnalytics, PermissionlessAsset, PermissionlessAssetDetails, PermissionlessAssetMarket, PermissionlessAssetMarketFeed, PermissionlessAssetPrices, PermissionlessAssetSummary, PermissionlessChain, PermissionlessChainSummary, PermissionlessChainUnreachableError, PermissionlessDeploy, PermissionlessNotAttachedError, PermissionlessOracles, PermissionlessPriceFeedAsset, PermissionlessPriceFeedDetails, PermissionlessPriceFeedMarket, PermissionlessPriceFeedMarketCaps, PermissionlessPriceFeedStore, PermissionlessPrices, PreparedDeployment, PreparedPriceFeedDeployment, PriceChartArgs, PriceFeedArgs, PriceFeedChartPoint, PriceFeedNotInStoreError, PriceFeedPair, PriceFeedPriceChart, PriceFeedSaltMissingError, PriceFeedStalenessUnknownError, deriveEffectiveStalenessPeriod, priceFeedSalt };
|
|
20
|
+
export { AddFeedsArgs, AssetArgs, AssetsArgs, AttachChainsArgs, ChainScope, ChainSummaryArgs, ChainsNamespace, ChangeNamesArgs, ChangeStalenessPeriodsArgs, DEFAULT_DEPLOY_SALT, DeployArgs, DeployContractArgs, DeployPriceFeedArgs, ForbidFeedsArgs, GET_PRICES_CHUNK_SIZE, GET_PRICES_GAS_LIMIT_BY_CHAIN_ID, GearboxPermissionless, GearboxPermissionlessOptions, GetPricesArgs, InstanceOwnerTransactions, InstanceTxsArgs, PermissionlessAnalytics, PermissionlessAsset, PermissionlessAssetDetails, PermissionlessAssetMarket, PermissionlessAssetMarketFeed, PermissionlessAssetPrices, PermissionlessAssetSummary, PermissionlessChain, PermissionlessChainSummary, PermissionlessChainUnreachableError, PermissionlessDeploy, PermissionlessMarket, PermissionlessNotAttachedError, PermissionlessOracles, PermissionlessPriceFeedAsset, PermissionlessPriceFeedDetails, PermissionlessPriceFeedMarket, PermissionlessPriceFeedMarketCaps, PermissionlessPriceFeedStore, PermissionlessPrices, PreparedDeployment, PreparedPriceFeedDeployment, PriceChartArgs, PriceFeedArgs, PriceFeedChartPoint, PriceFeedNotInStoreError, PriceFeedPair, PriceFeedPriceChart, PriceFeedSaltMissingError, PriceFeedStalenessUnknownError, deriveEffectiveStalenessPeriod, priceFeedSalt };
|
|
@@ -2,7 +2,7 @@ import { PriceFeedData } from "../../../model/opportunities.js";
|
|
|
2
2
|
import { AbstractOffchainNamespace } from "../../../offchain/AbstractOffchainNamespace.js";
|
|
3
3
|
import { GearboxPermissionlessOptions } from "../types.js";
|
|
4
4
|
import { ChainsNamespace } from "../chains/ChainsNamespace.js";
|
|
5
|
-
import { AssetArgs, GetPricesArgs, PermissionlessAssetDetails, PermissionlessAssetPrices, PermissionlessAssetSummary, PermissionlessPriceFeedDetails, PermissionlessPriceFeedMarketCaps, PermissionlessPriceFeedStore, PermissionlessPrices, PriceFeedArgs } from "./types.js";
|
|
5
|
+
import { AssetArgs, AssetsArgs, GetPricesArgs, PermissionlessAssetDetails, PermissionlessAssetPrices, PermissionlessAssetSummary, PermissionlessPriceFeedDetails, PermissionlessPriceFeedMarketCaps, PermissionlessPriceFeedStore, PermissionlessPrices, PriceFeedArgs } from "./types.js";
|
|
6
6
|
import { Address } from "viem";
|
|
7
7
|
//#region src/permissionless/api/oracles/PermissionlessOracles.d.ts
|
|
8
8
|
export declare const GET_PRICES_GAS_LIMIT_BY_CHAIN_ID: Record<number, bigint>;
|
|
@@ -102,9 +102,7 @@ export declare class PermissionlessOracles extends AbstractOffchainNamespace {
|
|
|
102
102
|
* const everywhere = await permissionless.oracles.assets();
|
|
103
103
|
* ```
|
|
104
104
|
**/
|
|
105
|
-
assets(
|
|
106
|
-
chainId?: number;
|
|
107
|
-
}): Promise<PermissionlessAssetSummary[]>;
|
|
105
|
+
assets({ chainId }?: AssetsArgs): Promise<PermissionlessAssetSummary[]>;
|
|
108
106
|
/**
|
|
109
107
|
* The feeds one feed reads from, recursively.
|
|
110
108
|
*
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { AssetArgs, GetPricesArgs, PermissionlessAsset, PermissionlessAssetDetails, PermissionlessAssetMarket, PermissionlessAssetMarketFeed, PermissionlessAssetPrices, PermissionlessAssetSummary, PermissionlessPriceFeedAsset, PermissionlessPriceFeedDetails, PermissionlessPriceFeedMarket, PermissionlessPriceFeedMarketCaps, PermissionlessPriceFeedStore, PermissionlessPrices, PriceFeedArgs } from "./types.js";
|
|
1
|
+
import { AssetArgs, AssetsArgs, GetPricesArgs, PermissionlessAsset, PermissionlessAssetDetails, PermissionlessAssetMarket, PermissionlessAssetMarketFeed, PermissionlessAssetPrices, PermissionlessAssetSummary, PermissionlessMarket, PermissionlessPriceFeedAsset, PermissionlessPriceFeedDetails, PermissionlessPriceFeedMarket, PermissionlessPriceFeedMarketCaps, PermissionlessPriceFeedStore, PermissionlessPrices, PriceFeedArgs } from "./types.js";
|
|
2
2
|
import { GET_PRICES_CHUNK_SIZE, GET_PRICES_GAS_LIMIT_BY_CHAIN_ID, PermissionlessOracles } from "./PermissionlessOracles.js";
|
|
3
|
-
export { AssetArgs, GET_PRICES_CHUNK_SIZE, GET_PRICES_GAS_LIMIT_BY_CHAIN_ID, GetPricesArgs, PermissionlessAsset, PermissionlessAssetDetails, PermissionlessAssetMarket, PermissionlessAssetMarketFeed, PermissionlessAssetPrices, PermissionlessAssetSummary, PermissionlessOracles, PermissionlessPriceFeedAsset, PermissionlessPriceFeedDetails, PermissionlessPriceFeedMarket, PermissionlessPriceFeedMarketCaps, PermissionlessPriceFeedStore, PermissionlessPrices, PriceFeedArgs };
|
|
3
|
+
export { AssetArgs, AssetsArgs, GET_PRICES_CHUNK_SIZE, GET_PRICES_GAS_LIMIT_BY_CHAIN_ID, GetPricesArgs, PermissionlessAsset, PermissionlessAssetDetails, PermissionlessAssetMarket, PermissionlessAssetMarketFeed, PermissionlessAssetPrices, PermissionlessAssetSummary, PermissionlessMarket, PermissionlessOracles, PermissionlessPriceFeedAsset, PermissionlessPriceFeedDetails, PermissionlessPriceFeedMarket, PermissionlessPriceFeedMarketCaps, PermissionlessPriceFeedStore, PermissionlessPrices, PriceFeedArgs };
|
|
@@ -17,7 +17,18 @@ export declare const priceFeedSchema: z.ZodObject<{
|
|
|
17
17
|
stalenessPeriod: z.ZodNumber;
|
|
18
18
|
name: z.ZodString;
|
|
19
19
|
}, z.core.$loose>;
|
|
20
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* {@link PermissionlessPriceFeedAsset}
|
|
22
|
+
*
|
|
23
|
+
* What identifies an asset, which is all a feed's own listing of one says.
|
|
24
|
+
**/
|
|
25
|
+
export declare const priceFeedAssetSchema: z.ZodObject<{
|
|
26
|
+
address: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
27
|
+
symbol: z.ZodString;
|
|
28
|
+
name: z.ZodString;
|
|
29
|
+
decimals: z.ZodNumber;
|
|
30
|
+
}, z.core.$loose>;
|
|
31
|
+
/** {@link PermissionlessAsset} — identified as above, plus what prices it. */
|
|
21
32
|
export declare const assetSchema: z.ZodObject<{
|
|
22
33
|
address: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
23
34
|
symbol: z.ZodString;
|
|
@@ -33,7 +44,12 @@ export declare const assetSchema: z.ZodObject<{
|
|
|
33
44
|
name: z.ZodString;
|
|
34
45
|
}, z.core.$loose>>;
|
|
35
46
|
}, z.core.$loose>;
|
|
36
|
-
/**
|
|
47
|
+
/**
|
|
48
|
+
* {@link PermissionlessPriceFeedStore}
|
|
49
|
+
*
|
|
50
|
+
* A store is a chain's, and is described by the same five fields the chain
|
|
51
|
+
* list answers with, so those are extended rather than restated.
|
|
52
|
+
**/
|
|
37
53
|
export declare const priceFeedStoreSchema: z.ZodObject<{
|
|
38
54
|
chainId: z.ZodNumber;
|
|
39
55
|
name: z.ZodString;
|
|
@@ -70,26 +86,19 @@ export declare const pricesSchema: z.ZodObject<{
|
|
|
70
86
|
marketCaps: z.ZodType<Record<`0x${string}`, Record<`0x${string}`, string | null>>, unknown, z.core.$ZodTypeInternals<Record<`0x${string}`, Record<`0x${string}`, string | null>>, unknown>>;
|
|
71
87
|
time: z.ZodNumber;
|
|
72
88
|
}, z.core.$loose>;
|
|
73
|
-
/** {@link
|
|
74
|
-
export declare const priceFeedAssetSchema: z.ZodObject<{
|
|
75
|
-
address: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
76
|
-
symbol: z.ZodString;
|
|
77
|
-
name: z.ZodString;
|
|
78
|
-
decimals: z.ZodNumber;
|
|
79
|
-
}, z.core.$loose>;
|
|
80
|
-
/** {@link PermissionlessPriceFeedMarket} */
|
|
89
|
+
/** {@link PermissionlessPriceFeedMarket} — the market as the feed's slot in it. */
|
|
81
90
|
export declare const priceFeedMarketSchema: z.ZodObject<{
|
|
82
91
|
market: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
83
92
|
marketConfigurator: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
84
93
|
curatorName: z.ZodNullable<z.ZodString>;
|
|
85
94
|
marketName: z.ZodNullable<z.ZodString>;
|
|
86
|
-
token: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
87
|
-
tokenSymbol: z.ZodNullable<z.ZodString>;
|
|
88
95
|
underlyingSymbol: z.ZodNullable<z.ZodString>;
|
|
89
|
-
reserve: z.ZodBoolean;
|
|
90
96
|
isUnderlying: z.ZodBoolean;
|
|
91
97
|
quotaLimit: z.ZodNullable<z.ZodNumber>;
|
|
92
98
|
quotaUsed: z.ZodNullable<z.ZodNumber>;
|
|
99
|
+
token: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
100
|
+
tokenSymbol: z.ZodNullable<z.ZodString>;
|
|
101
|
+
reserve: z.ZodBoolean;
|
|
93
102
|
marketStalenessPeriod: z.ZodNullable<z.ZodNumber>;
|
|
94
103
|
}, z.core.$loose>;
|
|
95
104
|
/** {@link PermissionlessPriceFeedDetails} */
|
|
@@ -114,13 +123,13 @@ export declare const priceFeedDetailsSchema: z.ZodObject<{
|
|
|
114
123
|
marketConfigurator: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
115
124
|
curatorName: z.ZodNullable<z.ZodString>;
|
|
116
125
|
marketName: z.ZodNullable<z.ZodString>;
|
|
117
|
-
token: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
118
|
-
tokenSymbol: z.ZodNullable<z.ZodString>;
|
|
119
126
|
underlyingSymbol: z.ZodNullable<z.ZodString>;
|
|
120
|
-
reserve: z.ZodBoolean;
|
|
121
127
|
isUnderlying: z.ZodBoolean;
|
|
122
128
|
quotaLimit: z.ZodNullable<z.ZodNumber>;
|
|
123
129
|
quotaUsed: z.ZodNullable<z.ZodNumber>;
|
|
130
|
+
token: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
131
|
+
tokenSymbol: z.ZodNullable<z.ZodString>;
|
|
132
|
+
reserve: z.ZodBoolean;
|
|
124
133
|
marketStalenessPeriod: z.ZodNullable<z.ZodNumber>;
|
|
125
134
|
}, z.core.$loose>>;
|
|
126
135
|
}, z.core.$loose>;
|
|
@@ -135,15 +144,17 @@ export declare const assetMarketFeedSchema: z.ZodObject<{
|
|
|
135
144
|
name: z.ZodNullable<z.ZodString>;
|
|
136
145
|
inStore: z.ZodBoolean;
|
|
137
146
|
}, z.core.$loose>;
|
|
138
|
-
/** {@link PermissionlessAssetMarket} */
|
|
147
|
+
/** {@link PermissionlessAssetMarket} — the market as what prices the asset in it. */
|
|
139
148
|
export declare const assetMarketSchema: z.ZodObject<{
|
|
140
149
|
market: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
141
150
|
marketConfigurator: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
142
151
|
curatorName: z.ZodNullable<z.ZodString>;
|
|
143
152
|
marketName: z.ZodNullable<z.ZodString>;
|
|
144
|
-
underlyingToken: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
145
153
|
underlyingSymbol: z.ZodNullable<z.ZodString>;
|
|
146
154
|
isUnderlying: z.ZodBoolean;
|
|
155
|
+
quotaLimit: z.ZodNullable<z.ZodNumber>;
|
|
156
|
+
quotaUsed: z.ZodNullable<z.ZodNumber>;
|
|
157
|
+
underlyingToken: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
147
158
|
isShutdown: z.ZodBoolean;
|
|
148
159
|
mainFeed: z.ZodNullable<z.ZodObject<{
|
|
149
160
|
address: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
@@ -155,8 +166,6 @@ export declare const assetMarketSchema: z.ZodObject<{
|
|
|
155
166
|
name: z.ZodNullable<z.ZodString>;
|
|
156
167
|
inStore: z.ZodBoolean;
|
|
157
168
|
}, z.core.$loose>>;
|
|
158
|
-
quotaLimit: z.ZodNullable<z.ZodNumber>;
|
|
159
|
-
quotaUsed: z.ZodNullable<z.ZodNumber>;
|
|
160
169
|
}, z.core.$loose>;
|
|
161
170
|
/** {@link PermissionlessAssetDetails} */
|
|
162
171
|
export declare const assetDetailsSchema: z.ZodObject<{
|
|
@@ -180,9 +189,11 @@ export declare const assetDetailsSchema: z.ZodObject<{
|
|
|
180
189
|
marketConfigurator: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
181
190
|
curatorName: z.ZodNullable<z.ZodString>;
|
|
182
191
|
marketName: z.ZodNullable<z.ZodString>;
|
|
183
|
-
underlyingToken: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
184
192
|
underlyingSymbol: z.ZodNullable<z.ZodString>;
|
|
185
193
|
isUnderlying: z.ZodBoolean;
|
|
194
|
+
quotaLimit: z.ZodNullable<z.ZodNumber>;
|
|
195
|
+
quotaUsed: z.ZodNullable<z.ZodNumber>;
|
|
196
|
+
underlyingToken: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
186
197
|
isShutdown: z.ZodBoolean;
|
|
187
198
|
mainFeed: z.ZodNullable<z.ZodObject<{
|
|
188
199
|
address: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
@@ -194,13 +205,17 @@ export declare const assetDetailsSchema: z.ZodObject<{
|
|
|
194
205
|
name: z.ZodNullable<z.ZodString>;
|
|
195
206
|
inStore: z.ZodBoolean;
|
|
196
207
|
}, z.core.$loose>>;
|
|
197
|
-
quotaLimit: z.ZodNullable<z.ZodNumber>;
|
|
198
|
-
quotaUsed: z.ZodNullable<z.ZodNumber>;
|
|
199
208
|
}, z.core.$loose>>;
|
|
200
209
|
quotaLimitUsd: z.ZodNullable<z.ZodNumber>;
|
|
201
210
|
quotaUsedUsd: z.ZodNullable<z.ZodNumber>;
|
|
202
211
|
}, z.core.$loose>;
|
|
203
|
-
/**
|
|
212
|
+
/**
|
|
213
|
+
* {@link PermissionlessAssetPrices}
|
|
214
|
+
*
|
|
215
|
+
* The same shape as {@link priceFeedMarketCapsSchema} plus the prices, but not
|
|
216
|
+
* an extension of it: the caps there are keyed by asset and these are keyed by
|
|
217
|
+
* feed, so what the two have in common is a coincidence of form.
|
|
218
|
+
**/
|
|
204
219
|
export declare const assetPricesSchema: z.ZodObject<{
|
|
205
220
|
prices: z.ZodType<Record<`0x${string}`, string | null>, unknown, z.core.$ZodTypeInternals<Record<`0x${string}`, string | null>, unknown>>;
|
|
206
221
|
marketCaps: z.ZodType<Record<`0x${string}`, string | null>, unknown, z.core.$ZodTypeInternals<Record<`0x${string}`, string | null>, unknown>>;
|
|
@@ -1,30 +1,37 @@
|
|
|
1
|
+
import { PermissionlessChain } from "../chains/types.js";
|
|
1
2
|
import { PriceFeed } from "../../core/pricefeed.js";
|
|
2
3
|
import "../../core/index.js";
|
|
3
4
|
import { Address } from "viem";
|
|
4
5
|
//#region src/permissionless/api/oracles/types.d.ts
|
|
5
6
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* What identifies an asset, which is all a feed's own listing of one says.
|
|
8
|
+
*
|
|
9
|
+
* Used on its own where the asset hangs off something else — a feed's assets,
|
|
10
|
+
* say, where listing the feeds allowed for each would only name the feed back.
|
|
9
11
|
**/
|
|
10
|
-
export interface
|
|
12
|
+
export interface PermissionlessPriceFeedAsset {
|
|
11
13
|
address: Address;
|
|
12
14
|
symbol: string;
|
|
13
15
|
name: string;
|
|
14
16
|
decimals: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* One asset of a chain, with the feeds allowed for it. The backend indexes
|
|
20
|
+
* the chain, so every feed listed here is one the PriceFeedStore carries and
|
|
21
|
+
* allows for the asset.
|
|
22
|
+
**/
|
|
23
|
+
export interface PermissionlessAsset extends PermissionlessPriceFeedAsset {
|
|
15
24
|
owner: Address;
|
|
16
25
|
priceFeeds: PriceFeed[];
|
|
17
26
|
}
|
|
18
27
|
/**
|
|
19
28
|
* The PriceFeedStore of one chain as the backend has indexed it: the assets
|
|
20
29
|
* it prices, the feeds it carries, and which feed is allowed on which asset.
|
|
30
|
+
*
|
|
31
|
+
* A store is a chain's, so it is described by the same fields the chain list
|
|
32
|
+
* answers with, plus what it holds.
|
|
21
33
|
**/
|
|
22
|
-
export interface PermissionlessPriceFeedStore {
|
|
23
|
-
chainId: number;
|
|
24
|
-
name: string;
|
|
25
|
-
isPublic: boolean;
|
|
26
|
-
isActivated: boolean;
|
|
27
|
-
explorerUrl: string;
|
|
34
|
+
export interface PermissionlessPriceFeedStore extends PermissionlessChain {
|
|
28
35
|
assets: PermissionlessAsset[];
|
|
29
36
|
priceFeeds: PriceFeed[];
|
|
30
37
|
}
|
|
@@ -38,25 +45,17 @@ export interface PermissionlessPrices {
|
|
|
38
45
|
time: number;
|
|
39
46
|
}
|
|
40
47
|
/**
|
|
41
|
-
*
|
|
48
|
+
* What names a market, whichever side it is being listed from.
|
|
42
49
|
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
address: Address;
|
|
48
|
-
symbol: string;
|
|
49
|
-
name: string;
|
|
50
|
-
decimals: number;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* One token a market prices with the feed.
|
|
50
|
+
* A feed's markets and an asset's markets are different reads, but what they
|
|
51
|
+
* say about the market is the same: who curates it, what it is denominated in
|
|
52
|
+
* and how much of its quota is taken. Only the thing the row is about differs,
|
|
53
|
+
* which is what each of the two below adds.
|
|
54
54
|
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
* same market, and both are reported.
|
|
55
|
+
* "This token" throughout means whatever the extending row is about — the
|
|
56
|
+
* token the feed prices, or the asset the market holds as collateral.
|
|
58
57
|
**/
|
|
59
|
-
export interface
|
|
58
|
+
export interface PermissionlessMarket {
|
|
60
59
|
market: Address;
|
|
61
60
|
marketConfigurator: Address;
|
|
62
61
|
/** The configurator's own name, as the backend's sync recorded it. */
|
|
@@ -66,17 +65,12 @@ export interface PermissionlessPriceFeedMarket {
|
|
|
66
65
|
* of the backend calls a market by as well.
|
|
67
66
|
*/
|
|
68
67
|
marketName: string | null;
|
|
69
|
-
token: Address;
|
|
70
|
-
/** `null` for a token the backend has no metadata row for. */
|
|
71
|
-
tokenSymbol: string | null;
|
|
72
68
|
/**
|
|
73
69
|
* Symbol of the market's underlying, which is both what the market is
|
|
74
|
-
* pictured by and what its quota
|
|
70
|
+
* pictured by and what its quota figures are denominated in.
|
|
75
71
|
*/
|
|
76
72
|
underlyingSymbol: string | null;
|
|
77
|
-
/**
|
|
78
|
-
reserve: boolean;
|
|
79
|
-
/** The token is the market's underlying. */
|
|
73
|
+
/** This token is the market's own underlying, so it is not quota-managed. */
|
|
80
74
|
isUnderlying: boolean;
|
|
81
75
|
/**
|
|
82
76
|
* What the pool will take of this token, in units of the market's
|
|
@@ -101,6 +95,20 @@ export interface PermissionlessPriceFeedMarket {
|
|
|
101
95
|
* holds no entry for at all.
|
|
102
96
|
*/
|
|
103
97
|
quotaUsed: number | null;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* One token a market prices with the feed.
|
|
101
|
+
*
|
|
102
|
+
* A row per `(market, token, role)` rather than per market: the same feed can
|
|
103
|
+
* be the main feed of one token and the reserve feed of another in the very
|
|
104
|
+
* same market, and both are reported.
|
|
105
|
+
**/
|
|
106
|
+
export interface PermissionlessPriceFeedMarket extends PermissionlessMarket {
|
|
107
|
+
token: Address;
|
|
108
|
+
/** `null` for a token the backend has no metadata row for. */
|
|
109
|
+
tokenSymbol: string | null;
|
|
110
|
+
/** The feed is the market's reserve feed for this token, not its main one. */
|
|
111
|
+
reserve: boolean;
|
|
104
112
|
/**
|
|
105
113
|
* Staleness period this market's own price oracle holds for the slot, in
|
|
106
114
|
* seconds.
|
|
@@ -165,19 +173,9 @@ export interface PermissionlessAssetMarketFeed {
|
|
|
165
173
|
* columns of the same market's row, and the quota is the market's whatever
|
|
166
174
|
* feed holds which slot.
|
|
167
175
|
**/
|
|
168
|
-
export interface PermissionlessAssetMarket {
|
|
169
|
-
market: Address;
|
|
170
|
-
marketConfigurator: Address;
|
|
171
|
-
/** The configurator's own name, as the backend's sync recorded it. */
|
|
172
|
-
curatorName: string | null;
|
|
173
|
-
/** The market's own name, which is the name of its pool token. */
|
|
174
|
-
marketName: string | null;
|
|
176
|
+
export interface PermissionlessAssetMarket extends PermissionlessMarket {
|
|
175
177
|
/** The market's underlying, which its quota figures are denominated in. */
|
|
176
178
|
underlyingToken: Address;
|
|
177
|
-
/** `null` for an underlying the backend has no metadata row for. */
|
|
178
|
-
underlyingSymbol: string | null;
|
|
179
|
-
/** The asset is this market's own underlying, so it is not quota-managed. */
|
|
180
|
-
isUnderlying: boolean;
|
|
181
179
|
/**
|
|
182
180
|
* The market has been shut down.
|
|
183
181
|
*
|
|
@@ -190,16 +188,6 @@ export interface PermissionlessAssetMarket {
|
|
|
190
188
|
mainFeed: PermissionlessAssetMarketFeed | null;
|
|
191
189
|
/** The feed the market falls back to, or `null` if it has none. */
|
|
192
190
|
reserveFeed: PermissionlessAssetMarketFeed | null;
|
|
193
|
-
/**
|
|
194
|
-
* What the pool will take of the asset, in units of {@link underlyingToken}.
|
|
195
|
-
*
|
|
196
|
-
* `null` for an asset the quota keeper was never told a limit for, which the
|
|
197
|
-
* market's own underlying always is. A zero is a limit set to zero, and the
|
|
198
|
-
* two are different answers.
|
|
199
|
-
*/
|
|
200
|
-
quotaLimit: number | null;
|
|
201
|
-
/** How much of {@link quotaLimit} is actually taken, in the same units. */
|
|
202
|
-
quotaUsed: number | null;
|
|
203
191
|
}
|
|
204
192
|
/**
|
|
205
193
|
* One asset of the store: what prices it, and what it is used as collateral
|
|
@@ -318,6 +306,11 @@ export interface AssetArgs {
|
|
|
318
306
|
chainId: number;
|
|
319
307
|
address: Address;
|
|
320
308
|
}
|
|
309
|
+
/** Args of {@link PermissionlessOracles.assets}. */
|
|
310
|
+
export interface AssetsArgs {
|
|
311
|
+
/** Omit for every chain the backend serves. */
|
|
312
|
+
chainId?: number;
|
|
313
|
+
}
|
|
321
314
|
/** Args of {@link PermissionlessOracles.getPrices}. */
|
|
322
315
|
export interface GetPricesArgs {
|
|
323
316
|
chainId: number;
|
|
@@ -11,8 +11,6 @@ import { z } from "zod/v4";
|
|
|
11
11
|
**/
|
|
12
12
|
/** An address, in whatever case the backend serves it. */
|
|
13
13
|
export declare const addressSchema: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
14
|
-
/** A `0x`-prefixed hex string, as viem's `Hex`. */
|
|
15
|
-
export declare const hexSchema: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
16
14
|
/**
|
|
17
15
|
* A record keyed by address. Spelled out here because zod types a record key
|
|
18
16
|
* by the schema's output, which the branded `Address` is not inferred as.
|
|
@@ -13,7 +13,7 @@ import "./core/index.js";
|
|
|
13
13
|
import { FunctionParams, ValueParams, encodeFunctionParams } from "./utils/abi-encoder.js";
|
|
14
14
|
import { DeployArgs, DeployContractArgs, DeployPriceFeedArgs, PreparedDeployment, PreparedPriceFeedDeployment } from "./api/deploy/types.js";
|
|
15
15
|
import { DEFAULT_DEPLOY_SALT, PermissionlessDeploy, priceFeedSalt } from "./api/deploy/PermissionlessDeploy.js";
|
|
16
|
-
import { AssetArgs, GetPricesArgs, PermissionlessAsset, PermissionlessAssetDetails, PermissionlessAssetMarket, PermissionlessAssetMarketFeed, PermissionlessAssetPrices, PermissionlessAssetSummary, PermissionlessPriceFeedAsset, PermissionlessPriceFeedDetails, PermissionlessPriceFeedMarket, PermissionlessPriceFeedMarketCaps, PermissionlessPriceFeedStore, PermissionlessPrices, PriceFeedArgs } from "./api/oracles/types.js";
|
|
16
|
+
import { AssetArgs, AssetsArgs, GetPricesArgs, PermissionlessAsset, PermissionlessAssetDetails, PermissionlessAssetMarket, PermissionlessAssetMarketFeed, PermissionlessAssetPrices, PermissionlessAssetSummary, PermissionlessMarket, PermissionlessPriceFeedAsset, PermissionlessPriceFeedDetails, PermissionlessPriceFeedMarket, PermissionlessPriceFeedMarketCaps, PermissionlessPriceFeedStore, PermissionlessPrices, PriceFeedArgs } from "./api/oracles/types.js";
|
|
17
17
|
import { GET_PRICES_CHUNK_SIZE, GET_PRICES_GAS_LIMIT_BY_CHAIN_ID, PermissionlessOracles } from "./api/oracles/PermissionlessOracles.js";
|
|
18
18
|
import { AddressProviderContract } from "./bindings/address-provider.js";
|
|
19
19
|
import { BytecodeRepositoryContract } from "./bindings/bytecode-repository.js";
|
|
@@ -54,4 +54,4 @@ import { getPrices } from "./utils/price-update/get-prices.js";
|
|
|
54
54
|
import { GetUpdatablePriceFeedsArgs, getUpdatablePriceFeeds } from "./utils/price-update/get-updatable-feeds.js";
|
|
55
55
|
import { normalizeSignature } from "./utils/signature.js";
|
|
56
56
|
import "./utils/index.js";
|
|
57
|
-
export { AccessMode, AddAssetParams, AddFeedsArgs, AddressProviderContract, Addresses, AllowTokenParams, ArchiveTransport, ArchiveTransportConfig, AssetArgs, AttachChainsArgs, AuditEvent, Auditor, BYTECODE_REPOSITORY, Batch, Bytecode, BytecodeRepositoryContract, CCMConstructorParams, CROSS_CHAIN_GOVERNANCE, CROSS_CHAIN_MULTISIG, ChainScope, ChainSummaryArgs, ChainsNamespace, ChangeNamesArgs, ChangeStalenessPeriodsArgs, ConstructorParams, CreditManagerFees, CrossChainCall, CrossChainMultisigContract, DEFAULT_DEPLOY_SALT, DeployArgs, DeployContractArgs, DeployParams, DeployPriceFeedArgs, Deployment, DeploymentExtended, ForbidAdapterParams, ForbidFeedsArgs, ForbidTokenParams, FunctionParams, GET_PRICES_CHUNK_SIZE, GET_PRICES_GAS_LIMIT_BY_CHAIN_ID, GearboxPermissionless, GearboxPermissionlessOptions, GetPricesArgs, GetUpdatablePriceFeedsArgs, GovernorContract, INSTANCE_MANAGER, InputValueParams, InstanceManagerContract, InstanceOwnerTransactions, InstanceTxs, InstanceTxsArgs, MAINNET_CCM_CONSTRUCTOR_PARAMS, MAINNET_DEPLOYMENT_BLOCK, MAINNET_DEPLOYMENT_CCM_SALT, MAINNET_DEPLOYMENT_IM_SALT, MARKET_CONFIGURATOR_FACTORY, Market, MarketConfiguratorContract, MarketConfiguratorFactoryContract, PRICE_FEED_STORE, PUBLIC_CREATE2_FACTORY, PauseCreditManagerParams, PeripheryDomain, PermissionlessAnalytics, PermissionlessAsset, PermissionlessAssetDetails, PermissionlessAssetMarket, PermissionlessAssetMarketFeed, PermissionlessAssetPrices, PermissionlessAssetSummary, PermissionlessChain, PermissionlessChainSummary, PermissionlessChainUnreachableError, PermissionlessDeploy, PermissionlessNotAttachedError, PermissionlessOracles, PermissionlessPriceFeedAsset, PermissionlessPriceFeedDetails, PermissionlessPriceFeedMarket, PermissionlessPriceFeedMarketCaps, PermissionlessPriceFeedStore, PermissionlessPrices, PreparedDeployment, PreparedPriceFeedDeployment, PriceChartArgs, PriceFeed, PriceFeedArgs, PriceFeedChartPoint, PriceFeedConstructorParam, PriceFeedNotInStoreError, PriceFeedPair, PriceFeedParamType, PriceFeedParams, PriceFeedPriceChart, PriceFeedSaltMissingError, PriceFeedSetupParams, PriceFeedStalenessUnknownError, PriceFeedStoreContract, Proposal, QueuedAndExecutedTransaction, RecoveryMessage, RoutingManagerContract, SafeBatch, SafeMeta, SafeTx, SetExpirationDateParams, SetFeesParams, SetPriceFeedParams, SetReservePriceFeedParams, SetTokenQuotaIncreaseFeeParams, Signature, TOKEN_COMPRESSOR, TimeLockContract, TimelockTransaction, TimelockTxParams, TimelockTxs, TokenCompressorContract, TreasurySplitterContract, UnpauseCreditManagerParams, ValueParams, WithdrawalCompressorContract, calculateChecksum, checkCreate2Deployment, checkCreate2DeploymentAddress, chunkedLogsTransport, convertPercent, convertQueueBatchToExecuteTx, convertRawTxToSafeMultisigTx, createCallData, createCreate2DeployRawTx, deepJsonParse, deployUsingPublicCreate2, deriveEffectiveStalenessPeriod, encodeFunctionParams, formatBytecodeSize, formatBytecodeVersion, getBlockNumberByTimestamp, getCreate2AddressPublicFactory, getCreate2DeploymentAddress, getPriceUpdateTx, getPrices, getSafeBatch, getSafeBatches, getUpdatablePriceFeeds, handleSalt, normalizeSignature, priceFeedSalt, priceFeedSetupParams, shortenHash, significantTrunc };
|
|
57
|
+
export { AccessMode, AddAssetParams, AddFeedsArgs, AddressProviderContract, Addresses, AllowTokenParams, ArchiveTransport, ArchiveTransportConfig, AssetArgs, AssetsArgs, AttachChainsArgs, AuditEvent, Auditor, BYTECODE_REPOSITORY, Batch, Bytecode, BytecodeRepositoryContract, CCMConstructorParams, CROSS_CHAIN_GOVERNANCE, CROSS_CHAIN_MULTISIG, ChainScope, ChainSummaryArgs, ChainsNamespace, ChangeNamesArgs, ChangeStalenessPeriodsArgs, ConstructorParams, CreditManagerFees, CrossChainCall, CrossChainMultisigContract, DEFAULT_DEPLOY_SALT, DeployArgs, DeployContractArgs, DeployParams, DeployPriceFeedArgs, Deployment, DeploymentExtended, ForbidAdapterParams, ForbidFeedsArgs, ForbidTokenParams, FunctionParams, GET_PRICES_CHUNK_SIZE, GET_PRICES_GAS_LIMIT_BY_CHAIN_ID, GearboxPermissionless, GearboxPermissionlessOptions, GetPricesArgs, GetUpdatablePriceFeedsArgs, GovernorContract, INSTANCE_MANAGER, InputValueParams, InstanceManagerContract, InstanceOwnerTransactions, InstanceTxs, InstanceTxsArgs, MAINNET_CCM_CONSTRUCTOR_PARAMS, MAINNET_DEPLOYMENT_BLOCK, MAINNET_DEPLOYMENT_CCM_SALT, MAINNET_DEPLOYMENT_IM_SALT, MARKET_CONFIGURATOR_FACTORY, Market, MarketConfiguratorContract, MarketConfiguratorFactoryContract, PRICE_FEED_STORE, PUBLIC_CREATE2_FACTORY, PauseCreditManagerParams, PeripheryDomain, PermissionlessAnalytics, PermissionlessAsset, PermissionlessAssetDetails, PermissionlessAssetMarket, PermissionlessAssetMarketFeed, PermissionlessAssetPrices, PermissionlessAssetSummary, PermissionlessChain, PermissionlessChainSummary, PermissionlessChainUnreachableError, PermissionlessDeploy, PermissionlessMarket, PermissionlessNotAttachedError, PermissionlessOracles, PermissionlessPriceFeedAsset, PermissionlessPriceFeedDetails, PermissionlessPriceFeedMarket, PermissionlessPriceFeedMarketCaps, PermissionlessPriceFeedStore, PermissionlessPrices, PreparedDeployment, PreparedPriceFeedDeployment, PriceChartArgs, PriceFeed, PriceFeedArgs, PriceFeedChartPoint, PriceFeedConstructorParam, PriceFeedNotInStoreError, PriceFeedPair, PriceFeedParamType, PriceFeedParams, PriceFeedPriceChart, PriceFeedSaltMissingError, PriceFeedSetupParams, PriceFeedStalenessUnknownError, PriceFeedStoreContract, Proposal, QueuedAndExecutedTransaction, RecoveryMessage, RoutingManagerContract, SafeBatch, SafeMeta, SafeTx, SetExpirationDateParams, SetFeesParams, SetPriceFeedParams, SetReservePriceFeedParams, SetTokenQuotaIncreaseFeeParams, Signature, TOKEN_COMPRESSOR, TimeLockContract, TimelockTransaction, TimelockTxParams, TimelockTxs, TokenCompressorContract, TreasurySplitterContract, UnpauseCreditManagerParams, ValueParams, WithdrawalCompressorContract, calculateChecksum, checkCreate2Deployment, checkCreate2DeploymentAddress, chunkedLogsTransport, convertPercent, convertQueueBatchToExecuteTx, convertRawTxToSafeMultisigTx, createCallData, createCreate2DeployRawTx, deepJsonParse, deployUsingPublicCreate2, deriveEffectiveStalenessPeriod, encodeFunctionParams, formatBytecodeSize, formatBytecodeVersion, getBlockNumberByTimestamp, getCreate2AddressPublicFactory, getCreate2DeploymentAddress, getPriceUpdateTx, getPrices, getSafeBatch, getSafeBatches, getUpdatablePriceFeeds, handleSalt, normalizeSignature, priceFeedSalt, priceFeedSetupParams, shortenHash, significantTrunc };
|