@gearbox-protocol/sdk 18.2.0-next.3 → 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.
@@ -109,6 +109,30 @@ var PermissionlessOracles = class extends require_offchain_AbstractOffchainNames
109
109
  });
110
110
  }
111
111
  /**
112
+ * Every asset the store carries, with what its markets make of it.
113
+ *
114
+ * Enough on its own to render a list of assets: the alternative is the
115
+ * store's whole read for the names plus a call per row for the quotas, and
116
+ * this is one request either way you scope it.
117
+ *
118
+ * Ordered by how central each asset is — the markets it underlies first,
119
+ * then what is quoted against it, then what it is allowed — so a consumer
120
+ * renders the rows as they arrive. Omit `chainId` for every chain the
121
+ * backend serves, ordered the same way across all of them.
122
+ *
123
+ * ```ts
124
+ * const assets = await permissionless.oracles.assets({ chainId: 1 });
125
+ * const everywhere = await permissionless.oracles.assets();
126
+ * ```
127
+ **/
128
+ async assets({ chainId } = {}) {
129
+ return this.getData({
130
+ path: "/pfs/assets",
131
+ query: { chainId: chainId?.toString() },
132
+ schema: require_permissionless_api_oracles_schemas.assetSummariesSchema
133
+ });
134
+ }
135
+ /**
112
136
  * The feeds one feed reads from, recursively.
113
137
  *
114
138
  * Answers for any feed the chain has indexed, store member or not: a
@@ -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
- /** {@link PermissionlessAsset} */
23
- const assetSchema = zod_v4.z.looseObject({
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
- /** {@link PermissionlessPriceFeedStore} */
32
- const priceFeedStoreSchema = zod_v4.z.looseObject({
33
- chainId: zod_v4.z.number(),
34
- name: zod_v4.z.string(),
35
- isPublic: zod_v4.z.boolean(),
36
- isActivated: zod_v4.z.boolean(),
37
- explorerUrl: zod_v4.z.string(),
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
- /** {@link PermissionlessPriceFeedAsset} */
48
- const priceFeedAssetSchema = zod_v4.z.looseObject({
49
- address: require_permissionless_api_schemas.addressSchema,
50
- symbol: zod_v4.z.string(),
51
- name: zod_v4.z.string(),
52
- decimals: zod_v4.z.number()
53
- });
54
- /** {@link PermissionlessPriceFeedMarket} */
55
- const priceFeedMarketSchema = zod_v4.z.looseObject({
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 = zod_v4.z.looseObject({
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,18 +111,37 @@ 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
- /** {@link PermissionlessAssetPrices} */
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()),
115
124
  time: zod_v4.z.number()
116
125
  });
126
+ /** {@link PermissionlessAssetSummary} */
127
+ const assetSummarySchema = zod_v4.z.looseObject({
128
+ chainId: zod_v4.z.number(),
129
+ address: require_permissionless_api_schemas.addressSchema,
130
+ symbol: zod_v4.z.string(),
131
+ underlyingMarketCount: zod_v4.z.number(),
132
+ quotaLimitUsd: zod_v4.z.number().nullable(),
133
+ quotaUsedUsd: zod_v4.z.number().nullable()
134
+ });
135
+ /** The list of {@link PermissionlessAssetSummary}, already ordered. */
136
+ const assetSummariesSchema = zod_v4.z.array(assetSummarySchema);
117
137
  //#endregion
118
138
  exports.assetDetailsSchema = assetDetailsSchema;
119
139
  exports.assetMarketFeedSchema = assetMarketFeedSchema;
120
140
  exports.assetMarketSchema = assetMarketSchema;
121
141
  exports.assetPricesSchema = assetPricesSchema;
122
142
  exports.assetSchema = assetSchema;
143
+ exports.assetSummariesSchema = assetSummariesSchema;
144
+ exports.assetSummarySchema = assetSummarySchema;
123
145
  exports.priceFeedAssetSchema = priceFeedAssetSchema;
124
146
  exports.priceFeedDetailsSchema = priceFeedDetailsSchema;
125
147
  exports.priceFeedMarketCapsSchema = priceFeedMarketCapsSchema;
@@ -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;
@@ -1,7 +1,7 @@
1
1
  import { priceFeedDataSchema } from "../../../model/opportunities.schema.js";
2
2
  import { AbstractOffchainNamespace } from "../../../offchain/AbstractOffchainNamespace.js";
3
3
  import { getPrices } from "../../utils/price-update/get-prices.js";
4
- import { assetDetailsSchema, assetPricesSchema, priceFeedDetailsSchema, priceFeedMarketCapsSchema, priceFeedStoreSchema, pricesSchema } from "./schemas.js";
4
+ import { assetDetailsSchema, assetPricesSchema, assetSummariesSchema, priceFeedDetailsSchema, priceFeedMarketCapsSchema, priceFeedStoreSchema, pricesSchema } from "./schemas.js";
5
5
  //#region src/permissionless/api/oracles/PermissionlessOracles.ts
6
6
  const GET_PRICES_GAS_LIMIT_BY_CHAIN_ID = { 143: 100000000n };
7
7
  const GET_PRICES_CHUNK_SIZE = 200;
@@ -108,6 +108,30 @@ var PermissionlessOracles = class extends AbstractOffchainNamespace {
108
108
  });
109
109
  }
110
110
  /**
111
+ * Every asset the store carries, with what its markets make of it.
112
+ *
113
+ * Enough on its own to render a list of assets: the alternative is the
114
+ * store's whole read for the names plus a call per row for the quotas, and
115
+ * this is one request either way you scope it.
116
+ *
117
+ * Ordered by how central each asset is — the markets it underlies first,
118
+ * then what is quoted against it, then what it is allowed — so a consumer
119
+ * renders the rows as they arrive. Omit `chainId` for every chain the
120
+ * backend serves, ordered the same way across all of them.
121
+ *
122
+ * ```ts
123
+ * const assets = await permissionless.oracles.assets({ chainId: 1 });
124
+ * const everywhere = await permissionless.oracles.assets();
125
+ * ```
126
+ **/
127
+ async assets({ chainId } = {}) {
128
+ return this.getData({
129
+ path: "/pfs/assets",
130
+ query: { chainId: chainId?.toString() },
131
+ schema: assetSummariesSchema
132
+ });
133
+ }
134
+ /**
111
135
  * The feeds one feed reads from, recursively.
112
136
  *
113
137
  * Answers for any feed the chain has indexed, store member or not: a
@@ -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
- /** {@link PermissionlessAsset} */
22
- const assetSchema = z.looseObject({
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
- /** {@link PermissionlessPriceFeedStore} */
31
- const priceFeedStoreSchema = z.looseObject({
32
- chainId: z.number(),
33
- name: z.string(),
34
- isPublic: z.boolean(),
35
- isActivated: z.boolean(),
36
- explorerUrl: z.string(),
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
- /** {@link PermissionlessPriceFeedAsset} */
47
- const priceFeedAssetSchema = z.looseObject({
48
- address: addressSchema,
49
- symbol: z.string(),
50
- name: z.string(),
51
- decimals: z.number()
52
- });
53
- /** {@link PermissionlessPriceFeedMarket} */
54
- const priceFeedMarketSchema = z.looseObject({
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 = z.looseObject({
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,11 +110,28 @@ const assetDetailsSchema = z.looseObject({
107
110
  quotaLimitUsd: z.number().nullable(),
108
111
  quotaUsedUsd: z.number().nullable()
109
112
  });
110
- /** {@link PermissionlessAssetPrices} */
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()),
114
123
  time: z.number()
115
124
  });
125
+ /** {@link PermissionlessAssetSummary} */
126
+ const assetSummarySchema = z.looseObject({
127
+ chainId: z.number(),
128
+ address: addressSchema,
129
+ symbol: z.string(),
130
+ underlyingMarketCount: z.number(),
131
+ quotaLimitUsd: z.number().nullable(),
132
+ quotaUsedUsd: z.number().nullable()
133
+ });
134
+ /** The list of {@link PermissionlessAssetSummary}, already ordered. */
135
+ const assetSummariesSchema = z.array(assetSummarySchema);
116
136
  //#endregion
117
- export { assetDetailsSchema, assetMarketFeedSchema, assetMarketSchema, assetPricesSchema, assetSchema, priceFeedAssetSchema, priceFeedDetailsSchema, priceFeedMarketCapsSchema, priceFeedMarketSchema, priceFeedSchema, priceFeedStoreSchema, pricesSchema };
137
+ export { assetDetailsSchema, assetMarketFeedSchema, assetMarketSchema, assetPricesSchema, assetSchema, assetSummariesSchema, assetSummarySchema, priceFeedAssetSchema, priceFeedDetailsSchema, priceFeedMarketCapsSchema, priceFeedMarketSchema, priceFeedSchema, priceFeedStoreSchema, pricesSchema };
@@ -1,4 +1,4 @@
1
- import { isAddress, isHex } from "viem";
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, hexSchema };
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, 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, 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, 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>;
@@ -85,6 +85,24 @@ export declare class PermissionlessOracles extends AbstractOffchainNamespace {
85
85
  * ```
86
86
  **/
87
87
  assetPrices({ chainId, address }: AssetArgs): Promise<PermissionlessAssetPrices>;
88
+ /**
89
+ * Every asset the store carries, with what its markets make of it.
90
+ *
91
+ * Enough on its own to render a list of assets: the alternative is the
92
+ * store's whole read for the names plus a call per row for the quotas, and
93
+ * this is one request either way you scope it.
94
+ *
95
+ * Ordered by how central each asset is — the markets it underlies first,
96
+ * then what is quoted against it, then what it is allowed — so a consumer
97
+ * renders the rows as they arrive. Omit `chainId` for every chain the
98
+ * backend serves, ordered the same way across all of them.
99
+ *
100
+ * ```ts
101
+ * const assets = await permissionless.oracles.assets({ chainId: 1 });
102
+ * const everywhere = await permissionless.oracles.assets();
103
+ * ```
104
+ **/
105
+ assets({ chainId }?: AssetsArgs): Promise<PermissionlessAssetSummary[]>;
88
106
  /**
89
107
  * The feeds one feed reads from, recursively.
90
108
  *
@@ -1,3 +1,3 @@
1
- import { AssetArgs, GetPricesArgs, PermissionlessAsset, PermissionlessAssetDetails, PermissionlessAssetMarket, PermissionlessAssetMarketFeed, PermissionlessAssetPrices, 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, 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
- /** {@link PermissionlessAsset} */
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
- /** {@link PermissionlessPriceFeedStore} */
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 PermissionlessPriceFeedAsset} */
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,16 +205,38 @@ 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
- /** {@link PermissionlessAssetPrices} */
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>>;
207
222
  time: z.ZodNumber;
208
223
  }, z.core.$loose>;
224
+ /** {@link PermissionlessAssetSummary} */
225
+ export declare const assetSummarySchema: z.ZodObject<{
226
+ chainId: z.ZodNumber;
227
+ address: z.ZodCustom<`0x${string}`, `0x${string}`>;
228
+ symbol: z.ZodString;
229
+ underlyingMarketCount: z.ZodNumber;
230
+ quotaLimitUsd: z.ZodNullable<z.ZodNumber>;
231
+ quotaUsedUsd: z.ZodNullable<z.ZodNumber>;
232
+ }, z.core.$loose>;
233
+ /** The list of {@link PermissionlessAssetSummary}, already ordered. */
234
+ export declare const assetSummariesSchema: z.ZodArray<z.ZodObject<{
235
+ chainId: z.ZodNumber;
236
+ address: z.ZodCustom<`0x${string}`, `0x${string}`>;
237
+ symbol: z.ZodString;
238
+ underlyingMarketCount: z.ZodNumber;
239
+ quotaLimitUsd: z.ZodNullable<z.ZodNumber>;
240
+ quotaUsedUsd: z.ZodNullable<z.ZodNumber>;
241
+ }, z.core.$loose>>;
209
242
  //#endregion
@@ -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
- * One asset of a chain, with the feeds allowed for it. The backend indexes
7
- * the chain, so every feed listed here is one the PriceFeedStore carries and
8
- * allows for the asset.
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 PermissionlessAsset {
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
- * An asset the PriceFeedStore currently allows one feed to price.
48
+ * What names a market, whichever side it is being listed from.
42
49
  *
43
- * Narrower than {@link PermissionlessAsset} on purpose: this hangs off the
44
- * feed, so listing the feeds allowed for it would just name the feed back.
45
- **/
46
- export interface PermissionlessPriceFeedAsset {
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
- * A row per `(market, token, role)` rather than per market: the same feed can
56
- * be the main feed of one token and the reserve feed of another in the very
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 PermissionlessPriceFeedMarket {
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 limit is denominated in.
70
+ * pictured by and what its quota figures are denominated in.
75
71
  */
76
72
  underlyingSymbol: string | null;
77
- /** The feed is the market's reserve feed for this token, not its main one. */
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
@@ -261,6 +249,36 @@ export interface PermissionlessAssetPrices {
261
249
  /** When the backend computed the figures; they are read live, not indexed. */
262
250
  time: number;
263
251
  }
252
+ /**
253
+ * One asset of the PriceFeedStore, with what its markets make of it.
254
+ *
255
+ * Everything a list of assets renders and nothing else: the store's own read
256
+ * carries each asset's feeds too, which is several times this payload and not
257
+ * what a reader scanning for the big positions is looking at.
258
+ *
259
+ * The two USD figures are the ones {@link PermissionlessAssetDetails} heads an
260
+ * asset's own page with, under the same rule — limits count only the markets
261
+ * still running, what is already quoted counts everywhere, and `null` is
262
+ * nothing to total rather than a zero — so the list and the page a row of it
263
+ * opens cannot disagree.
264
+ **/
265
+ export interface PermissionlessAssetSummary {
266
+ chainId: number;
267
+ /** Lowercased, as everything addressed in these payloads is. */
268
+ address: Address;
269
+ symbol: string;
270
+ /**
271
+ * How many markets still running are underlain by this asset.
272
+ *
273
+ * What makes an asset central rather than merely listed: a token several
274
+ * markets borrow against is the one a reader opens the list for. Shut down
275
+ * markets are left out for the reason their limits are — they are no longer
276
+ * a place anything happens.
277
+ */
278
+ underlyingMarketCount: number;
279
+ quotaLimitUsd: number | null;
280
+ quotaUsedUsd: number | null;
281
+ }
264
282
  /**
265
283
  * Market caps of one feed's assets, keyed by the lowercased asset address.
266
284
  *
@@ -288,6 +306,11 @@ export interface AssetArgs {
288
306
  chainId: number;
289
307
  address: Address;
290
308
  }
309
+ /** Args of {@link PermissionlessOracles.assets}. */
310
+ export interface AssetsArgs {
311
+ /** Omit for every chain the backend serves. */
312
+ chainId?: number;
313
+ }
291
314
  /** Args of {@link PermissionlessOracles.getPrices}. */
292
315
  export interface GetPricesArgs {
293
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, 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, 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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "18.2.0-next.3",
3
+ "version": "18.2.0-next.5",
4
4
  "description": "Gearbox SDK",
5
5
  "license": "MIT",
6
6
  "repository": {