@gearbox-protocol/sdk 18.2.0-next.2 → 18.2.0-next.4

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.
@@ -62,6 +62,77 @@ var PermissionlessOracles = class extends require_offchain_AbstractOffchainNames
62
62
  });
63
63
  }
64
64
  /**
65
+ * One asset of the store: the feeds allowed for it, and the markets that
66
+ * take it as collateral.
67
+ *
68
+ * The mirror of {@link feed}, and the call to reach for when the question is
69
+ * "what prices this token and what is it backing" rather than "where is this
70
+ * feed used". Both read the same market slots; which end they are indexed
71
+ * from is the difference.
72
+ *
73
+ * ```ts
74
+ * const { priceFeeds, markets, quotaUsedUsd } =
75
+ * await permissionless.oracles.asset({ chainId: 1, address: token });
76
+ * ```
77
+ *
78
+ * @throws When the chain has no metadata for the address. An asset nothing
79
+ * was indexed for has no symbol or decimals, so there is no row to answer.
80
+ **/
81
+ async asset({ chainId, address }) {
82
+ return this.getData({
83
+ path: `/pfs/${chainId}/asset/${address}`,
84
+ schema: require_permissionless_api_oracles_schemas.assetDetailsSchema
85
+ });
86
+ }
87
+ /**
88
+ * What each of one asset's feeds prices it at, and the market cap each of
89
+ * them implies.
90
+ *
91
+ * The asset-side counterpart of {@link feedMarketCaps}, and priced the same
92
+ * way: one `totalSupply` read for the asset and one price per feed, rather
93
+ * than the chain-wide pass {@link prices} makes.
94
+ *
95
+ * Several feeds for one asset do not have to agree — that is the point of
96
+ * having a reserve feed — so this answers per feed rather than picking one.
97
+ *
98
+ * ```ts
99
+ * const { prices, marketCaps } = await permissionless.oracles.assetPrices({
100
+ * chainId: 1,
101
+ * address: token,
102
+ * });
103
+ * ```
104
+ **/
105
+ async assetPrices({ chainId, address }) {
106
+ return this.getData({
107
+ path: `/pfs/${chainId}/asset/${address}/prices`,
108
+ schema: require_permissionless_api_oracles_schemas.assetPricesSchema
109
+ });
110
+ }
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(args = {}) {
129
+ const query = args.chainId === void 0 ? "" : `?chainId=${encodeURIComponent(args.chainId)}`;
130
+ return this.getData({
131
+ path: `/pfs/assets${query}`,
132
+ schema: require_permissionless_api_oracles_schemas.assetSummariesSchema
133
+ });
134
+ }
135
+ /**
65
136
  * The feeds one feed reads from, recursively.
66
137
  *
67
138
  * Answers for any feed the chain has indexed, store member or not: a
@@ -62,7 +62,9 @@ const priceFeedMarketSchema = zod_v4.z.looseObject({
62
62
  underlyingSymbol: zod_v4.z.string().nullable(),
63
63
  reserve: zod_v4.z.boolean(),
64
64
  isUnderlying: zod_v4.z.boolean(),
65
- quotaLimit: zod_v4.z.number().nullable()
65
+ quotaLimit: zod_v4.z.number().nullable(),
66
+ quotaUsed: zod_v4.z.number().nullable(),
67
+ marketStalenessPeriod: zod_v4.z.number().nullable()
66
68
  });
67
69
  /** {@link PermissionlessPriceFeedDetails} */
68
70
  const priceFeedDetailsSchema = zod_v4.z.looseObject({
@@ -76,8 +78,61 @@ const priceFeedMarketCapsSchema = zod_v4.z.looseObject({
76
78
  marketCaps: require_permissionless_api_schemas.addressRecord(zod_v4.z.string().nullable()),
77
79
  time: zod_v4.z.number()
78
80
  });
81
+ /** {@link PermissionlessAssetMarketFeed} */
82
+ const assetMarketFeedSchema = zod_v4.z.looseObject({
83
+ address: require_permissionless_api_schemas.addressSchema,
84
+ name: zod_v4.z.string().nullable(),
85
+ inStore: zod_v4.z.boolean()
86
+ });
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(),
93
+ underlyingToken: require_permissionless_api_schemas.addressSchema,
94
+ underlyingSymbol: zod_v4.z.string().nullable(),
95
+ isUnderlying: zod_v4.z.boolean(),
96
+ isShutdown: zod_v4.z.boolean(),
97
+ mainFeed: assetMarketFeedSchema.nullable(),
98
+ reserveFeed: assetMarketFeedSchema.nullable(),
99
+ quotaLimit: zod_v4.z.number().nullable(),
100
+ quotaUsed: zod_v4.z.number().nullable()
101
+ });
102
+ /** {@link PermissionlessAssetDetails} */
103
+ const assetDetailsSchema = zod_v4.z.looseObject({
104
+ chainId: zod_v4.z.number(),
105
+ asset: priceFeedAssetSchema,
106
+ priceFeeds: zod_v4.z.array(priceFeedSchema),
107
+ markets: zod_v4.z.array(assetMarketSchema),
108
+ quotaLimitUsd: zod_v4.z.number().nullable(),
109
+ quotaUsedUsd: zod_v4.z.number().nullable()
110
+ });
111
+ /** {@link PermissionlessAssetPrices} */
112
+ const assetPricesSchema = zod_v4.z.looseObject({
113
+ prices: require_permissionless_api_schemas.addressRecord(zod_v4.z.string().nullable()),
114
+ marketCaps: require_permissionless_api_schemas.addressRecord(zod_v4.z.string().nullable()),
115
+ time: zod_v4.z.number()
116
+ });
117
+ /** {@link PermissionlessAssetSummary} */
118
+ const assetSummarySchema = zod_v4.z.looseObject({
119
+ chainId: zod_v4.z.number(),
120
+ address: require_permissionless_api_schemas.addressSchema,
121
+ symbol: zod_v4.z.string(),
122
+ underlyingMarketCount: zod_v4.z.number(),
123
+ quotaLimitUsd: zod_v4.z.number().nullable(),
124
+ quotaUsedUsd: zod_v4.z.number().nullable()
125
+ });
126
+ /** The list of {@link PermissionlessAssetSummary}, already ordered. */
127
+ const assetSummariesSchema = zod_v4.z.array(assetSummarySchema);
79
128
  //#endregion
129
+ exports.assetDetailsSchema = assetDetailsSchema;
130
+ exports.assetMarketFeedSchema = assetMarketFeedSchema;
131
+ exports.assetMarketSchema = assetMarketSchema;
132
+ exports.assetPricesSchema = assetPricesSchema;
80
133
  exports.assetSchema = assetSchema;
134
+ exports.assetSummariesSchema = assetSummariesSchema;
135
+ exports.assetSummarySchema = assetSummarySchema;
81
136
  exports.priceFeedAssetSchema = priceFeedAssetSchema;
82
137
  exports.priceFeedDetailsSchema = priceFeedDetailsSchema;
83
138
  exports.priceFeedMarketCapsSchema = priceFeedMarketCapsSchema;
@@ -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 { 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;
@@ -61,6 +61,77 @@ var PermissionlessOracles = class extends AbstractOffchainNamespace {
61
61
  });
62
62
  }
63
63
  /**
64
+ * One asset of the store: the feeds allowed for it, and the markets that
65
+ * take it as collateral.
66
+ *
67
+ * The mirror of {@link feed}, and the call to reach for when the question is
68
+ * "what prices this token and what is it backing" rather than "where is this
69
+ * feed used". Both read the same market slots; which end they are indexed
70
+ * from is the difference.
71
+ *
72
+ * ```ts
73
+ * const { priceFeeds, markets, quotaUsedUsd } =
74
+ * await permissionless.oracles.asset({ chainId: 1, address: token });
75
+ * ```
76
+ *
77
+ * @throws When the chain has no metadata for the address. An asset nothing
78
+ * was indexed for has no symbol or decimals, so there is no row to answer.
79
+ **/
80
+ async asset({ chainId, address }) {
81
+ return this.getData({
82
+ path: `/pfs/${chainId}/asset/${address}`,
83
+ schema: assetDetailsSchema
84
+ });
85
+ }
86
+ /**
87
+ * What each of one asset's feeds prices it at, and the market cap each of
88
+ * them implies.
89
+ *
90
+ * The asset-side counterpart of {@link feedMarketCaps}, and priced the same
91
+ * way: one `totalSupply` read for the asset and one price per feed, rather
92
+ * than the chain-wide pass {@link prices} makes.
93
+ *
94
+ * Several feeds for one asset do not have to agree — that is the point of
95
+ * having a reserve feed — so this answers per feed rather than picking one.
96
+ *
97
+ * ```ts
98
+ * const { prices, marketCaps } = await permissionless.oracles.assetPrices({
99
+ * chainId: 1,
100
+ * address: token,
101
+ * });
102
+ * ```
103
+ **/
104
+ async assetPrices({ chainId, address }) {
105
+ return this.getData({
106
+ path: `/pfs/${chainId}/asset/${address}/prices`,
107
+ schema: assetPricesSchema
108
+ });
109
+ }
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(args = {}) {
128
+ const query = args.chainId === void 0 ? "" : `?chainId=${encodeURIComponent(args.chainId)}`;
129
+ return this.getData({
130
+ path: `/pfs/assets${query}`,
131
+ schema: assetSummariesSchema
132
+ });
133
+ }
134
+ /**
64
135
  * The feeds one feed reads from, recursively.
65
136
  *
66
137
  * Answers for any feed the chain has indexed, store member or not: a
@@ -61,7 +61,9 @@ const priceFeedMarketSchema = z.looseObject({
61
61
  underlyingSymbol: z.string().nullable(),
62
62
  reserve: z.boolean(),
63
63
  isUnderlying: z.boolean(),
64
- quotaLimit: z.number().nullable()
64
+ quotaLimit: z.number().nullable(),
65
+ quotaUsed: z.number().nullable(),
66
+ marketStalenessPeriod: z.number().nullable()
65
67
  });
66
68
  /** {@link PermissionlessPriceFeedDetails} */
67
69
  const priceFeedDetailsSchema = z.looseObject({
@@ -75,5 +77,52 @@ const priceFeedMarketCapsSchema = z.looseObject({
75
77
  marketCaps: addressRecord(z.string().nullable()),
76
78
  time: z.number()
77
79
  });
80
+ /** {@link PermissionlessAssetMarketFeed} */
81
+ const assetMarketFeedSchema = z.looseObject({
82
+ address: addressSchema,
83
+ name: z.string().nullable(),
84
+ inStore: z.boolean()
85
+ });
86
+ /** {@link PermissionlessAssetMarket} */
87
+ const assetMarketSchema = z.looseObject({
88
+ market: addressSchema,
89
+ marketConfigurator: addressSchema,
90
+ curatorName: z.string().nullable(),
91
+ marketName: z.string().nullable(),
92
+ underlyingToken: addressSchema,
93
+ underlyingSymbol: z.string().nullable(),
94
+ isUnderlying: z.boolean(),
95
+ isShutdown: z.boolean(),
96
+ mainFeed: assetMarketFeedSchema.nullable(),
97
+ reserveFeed: assetMarketFeedSchema.nullable(),
98
+ quotaLimit: z.number().nullable(),
99
+ quotaUsed: z.number().nullable()
100
+ });
101
+ /** {@link PermissionlessAssetDetails} */
102
+ const assetDetailsSchema = z.looseObject({
103
+ chainId: z.number(),
104
+ asset: priceFeedAssetSchema,
105
+ priceFeeds: z.array(priceFeedSchema),
106
+ markets: z.array(assetMarketSchema),
107
+ quotaLimitUsd: z.number().nullable(),
108
+ quotaUsedUsd: z.number().nullable()
109
+ });
110
+ /** {@link PermissionlessAssetPrices} */
111
+ const assetPricesSchema = z.looseObject({
112
+ prices: addressRecord(z.string().nullable()),
113
+ marketCaps: addressRecord(z.string().nullable()),
114
+ time: z.number()
115
+ });
116
+ /** {@link PermissionlessAssetSummary} */
117
+ const assetSummarySchema = z.looseObject({
118
+ chainId: z.number(),
119
+ address: addressSchema,
120
+ symbol: z.string(),
121
+ underlyingMarketCount: z.number(),
122
+ quotaLimitUsd: z.number().nullable(),
123
+ quotaUsedUsd: z.number().nullable()
124
+ });
125
+ /** The list of {@link PermissionlessAssetSummary}, already ordered. */
126
+ const assetSummariesSchema = z.array(assetSummarySchema);
78
127
  //#endregion
79
- export { assetSchema, priceFeedAssetSchema, priceFeedDetailsSchema, priceFeedMarketCapsSchema, priceFeedMarketSchema, priceFeedSchema, priceFeedStoreSchema, pricesSchema };
128
+ export { assetDetailsSchema, assetMarketFeedSchema, assetMarketSchema, assetPricesSchema, assetSchema, assetSummariesSchema, assetSummarySchema, priceFeedAssetSchema, priceFeedDetailsSchema, priceFeedMarketCapsSchema, priceFeedMarketSchema, priceFeedSchema, priceFeedStoreSchema, pricesSchema };
@@ -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 { GetPricesArgs, PermissionlessAsset, PermissionlessPriceFeedAsset, PermissionlessPriceFeedDetails, PermissionlessPriceFeedMarket, PermissionlessPriceFeedMarketCaps, PermissionlessPriceFeedStore, PermissionlessPrices, PriceFeedArgs } from "./oracles/types.js";
8
+ import { AssetArgs, GetPricesArgs, PermissionlessAsset, PermissionlessAssetDetails, PermissionlessAssetMarket, PermissionlessAssetMarketFeed, PermissionlessAssetPrices, PermissionlessAssetSummary, 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, 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, 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, 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 };
@@ -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 { GetPricesArgs, PermissionlessPriceFeedDetails, PermissionlessPriceFeedMarketCaps, PermissionlessPriceFeedStore, PermissionlessPrices, PriceFeedArgs } from "./types.js";
5
+ import { AssetArgs, 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>;
@@ -48,6 +48,63 @@ export declare class PermissionlessOracles extends AbstractOffchainNamespace {
48
48
  * here — it lives in whichever app wrote it.
49
49
  **/
50
50
  feed({ chainId, address }: PriceFeedArgs): Promise<PermissionlessPriceFeedDetails>;
51
+ /**
52
+ * One asset of the store: the feeds allowed for it, and the markets that
53
+ * take it as collateral.
54
+ *
55
+ * The mirror of {@link feed}, and the call to reach for when the question is
56
+ * "what prices this token and what is it backing" rather than "where is this
57
+ * feed used". Both read the same market slots; which end they are indexed
58
+ * from is the difference.
59
+ *
60
+ * ```ts
61
+ * const { priceFeeds, markets, quotaUsedUsd } =
62
+ * await permissionless.oracles.asset({ chainId: 1, address: token });
63
+ * ```
64
+ *
65
+ * @throws When the chain has no metadata for the address. An asset nothing
66
+ * was indexed for has no symbol or decimals, so there is no row to answer.
67
+ **/
68
+ asset({ chainId, address }: AssetArgs): Promise<PermissionlessAssetDetails>;
69
+ /**
70
+ * What each of one asset's feeds prices it at, and the market cap each of
71
+ * them implies.
72
+ *
73
+ * The asset-side counterpart of {@link feedMarketCaps}, and priced the same
74
+ * way: one `totalSupply` read for the asset and one price per feed, rather
75
+ * than the chain-wide pass {@link prices} makes.
76
+ *
77
+ * Several feeds for one asset do not have to agree — that is the point of
78
+ * having a reserve feed — so this answers per feed rather than picking one.
79
+ *
80
+ * ```ts
81
+ * const { prices, marketCaps } = await permissionless.oracles.assetPrices({
82
+ * chainId: 1,
83
+ * address: token,
84
+ * });
85
+ * ```
86
+ **/
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(args?: {
106
+ chainId?: number;
107
+ }): Promise<PermissionlessAssetSummary[]>;
51
108
  /**
52
109
  * The feeds one feed reads from, recursively.
53
110
  *
@@ -1,3 +1,3 @@
1
- import { GetPricesArgs, PermissionlessAsset, PermissionlessPriceFeedAsset, PermissionlessPriceFeedDetails, PermissionlessPriceFeedMarket, PermissionlessPriceFeedMarketCaps, PermissionlessPriceFeedStore, PermissionlessPrices, PriceFeedArgs } from "./types.js";
1
+ import { AssetArgs, GetPricesArgs, PermissionlessAsset, PermissionlessAssetDetails, PermissionlessAssetMarket, PermissionlessAssetMarketFeed, PermissionlessAssetPrices, PermissionlessAssetSummary, 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 { GET_PRICES_CHUNK_SIZE, GET_PRICES_GAS_LIMIT_BY_CHAIN_ID, GetPricesArgs, PermissionlessAsset, PermissionlessOracles, PermissionlessPriceFeedAsset, PermissionlessPriceFeedDetails, PermissionlessPriceFeedMarket, PermissionlessPriceFeedMarketCaps, PermissionlessPriceFeedStore, PermissionlessPrices, PriceFeedArgs };
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 };
@@ -89,6 +89,8 @@ export declare const priceFeedMarketSchema: z.ZodObject<{
89
89
  reserve: z.ZodBoolean;
90
90
  isUnderlying: z.ZodBoolean;
91
91
  quotaLimit: z.ZodNullable<z.ZodNumber>;
92
+ quotaUsed: z.ZodNullable<z.ZodNumber>;
93
+ marketStalenessPeriod: z.ZodNullable<z.ZodNumber>;
92
94
  }, z.core.$loose>;
93
95
  /** {@link PermissionlessPriceFeedDetails} */
94
96
  export declare const priceFeedDetailsSchema: z.ZodObject<{
@@ -118,6 +120,8 @@ export declare const priceFeedDetailsSchema: z.ZodObject<{
118
120
  reserve: z.ZodBoolean;
119
121
  isUnderlying: z.ZodBoolean;
120
122
  quotaLimit: z.ZodNullable<z.ZodNumber>;
123
+ quotaUsed: z.ZodNullable<z.ZodNumber>;
124
+ marketStalenessPeriod: z.ZodNullable<z.ZodNumber>;
121
125
  }, z.core.$loose>>;
122
126
  }, z.core.$loose>;
123
127
  /** {@link PermissionlessPriceFeedMarketCaps} */
@@ -125,4 +129,99 @@ export declare const priceFeedMarketCapsSchema: z.ZodObject<{
125
129
  marketCaps: z.ZodType<Record<`0x${string}`, string | null>, unknown, z.core.$ZodTypeInternals<Record<`0x${string}`, string | null>, unknown>>;
126
130
  time: z.ZodNumber;
127
131
  }, z.core.$loose>;
132
+ /** {@link PermissionlessAssetMarketFeed} */
133
+ export declare const assetMarketFeedSchema: z.ZodObject<{
134
+ address: z.ZodCustom<`0x${string}`, `0x${string}`>;
135
+ name: z.ZodNullable<z.ZodString>;
136
+ inStore: z.ZodBoolean;
137
+ }, z.core.$loose>;
138
+ /** {@link PermissionlessAssetMarket} */
139
+ export declare const assetMarketSchema: z.ZodObject<{
140
+ market: z.ZodCustom<`0x${string}`, `0x${string}`>;
141
+ marketConfigurator: z.ZodCustom<`0x${string}`, `0x${string}`>;
142
+ curatorName: z.ZodNullable<z.ZodString>;
143
+ marketName: z.ZodNullable<z.ZodString>;
144
+ underlyingToken: z.ZodCustom<`0x${string}`, `0x${string}`>;
145
+ underlyingSymbol: z.ZodNullable<z.ZodString>;
146
+ isUnderlying: z.ZodBoolean;
147
+ isShutdown: z.ZodBoolean;
148
+ mainFeed: z.ZodNullable<z.ZodObject<{
149
+ address: z.ZodCustom<`0x${string}`, `0x${string}`>;
150
+ name: z.ZodNullable<z.ZodString>;
151
+ inStore: z.ZodBoolean;
152
+ }, z.core.$loose>>;
153
+ reserveFeed: z.ZodNullable<z.ZodObject<{
154
+ address: z.ZodCustom<`0x${string}`, `0x${string}`>;
155
+ name: z.ZodNullable<z.ZodString>;
156
+ inStore: z.ZodBoolean;
157
+ }, z.core.$loose>>;
158
+ quotaLimit: z.ZodNullable<z.ZodNumber>;
159
+ quotaUsed: z.ZodNullable<z.ZodNumber>;
160
+ }, z.core.$loose>;
161
+ /** {@link PermissionlessAssetDetails} */
162
+ export declare const assetDetailsSchema: z.ZodObject<{
163
+ chainId: z.ZodNumber;
164
+ asset: z.ZodObject<{
165
+ address: z.ZodCustom<`0x${string}`, `0x${string}`>;
166
+ symbol: z.ZodString;
167
+ name: z.ZodString;
168
+ decimals: z.ZodNumber;
169
+ }, z.core.$loose>;
170
+ priceFeeds: z.ZodArray<z.ZodObject<{
171
+ address: z.ZodCustom<`0x${string}`, `0x${string}`>;
172
+ contractType: z.ZodString;
173
+ version: z.ZodNumber;
174
+ deployedBy: z.ZodCustom<`0x${string}`, `0x${string}`>;
175
+ stalenessPeriod: z.ZodNumber;
176
+ name: z.ZodString;
177
+ }, z.core.$loose>>;
178
+ markets: z.ZodArray<z.ZodObject<{
179
+ market: z.ZodCustom<`0x${string}`, `0x${string}`>;
180
+ marketConfigurator: z.ZodCustom<`0x${string}`, `0x${string}`>;
181
+ curatorName: z.ZodNullable<z.ZodString>;
182
+ marketName: z.ZodNullable<z.ZodString>;
183
+ underlyingToken: z.ZodCustom<`0x${string}`, `0x${string}`>;
184
+ underlyingSymbol: z.ZodNullable<z.ZodString>;
185
+ isUnderlying: z.ZodBoolean;
186
+ isShutdown: z.ZodBoolean;
187
+ mainFeed: z.ZodNullable<z.ZodObject<{
188
+ address: z.ZodCustom<`0x${string}`, `0x${string}`>;
189
+ name: z.ZodNullable<z.ZodString>;
190
+ inStore: z.ZodBoolean;
191
+ }, z.core.$loose>>;
192
+ reserveFeed: z.ZodNullable<z.ZodObject<{
193
+ address: z.ZodCustom<`0x${string}`, `0x${string}`>;
194
+ name: z.ZodNullable<z.ZodString>;
195
+ inStore: z.ZodBoolean;
196
+ }, z.core.$loose>>;
197
+ quotaLimit: z.ZodNullable<z.ZodNumber>;
198
+ quotaUsed: z.ZodNullable<z.ZodNumber>;
199
+ }, z.core.$loose>>;
200
+ quotaLimitUsd: z.ZodNullable<z.ZodNumber>;
201
+ quotaUsedUsd: z.ZodNullable<z.ZodNumber>;
202
+ }, z.core.$loose>;
203
+ /** {@link PermissionlessAssetPrices} */
204
+ export declare const assetPricesSchema: z.ZodObject<{
205
+ prices: z.ZodType<Record<`0x${string}`, string | null>, unknown, z.core.$ZodTypeInternals<Record<`0x${string}`, string | null>, unknown>>;
206
+ marketCaps: z.ZodType<Record<`0x${string}`, string | null>, unknown, z.core.$ZodTypeInternals<Record<`0x${string}`, string | null>, unknown>>;
207
+ time: z.ZodNumber;
208
+ }, z.core.$loose>;
209
+ /** {@link PermissionlessAssetSummary} */
210
+ export declare const assetSummarySchema: z.ZodObject<{
211
+ chainId: z.ZodNumber;
212
+ address: z.ZodCustom<`0x${string}`, `0x${string}`>;
213
+ symbol: z.ZodString;
214
+ underlyingMarketCount: z.ZodNumber;
215
+ quotaLimitUsd: z.ZodNullable<z.ZodNumber>;
216
+ quotaUsedUsd: z.ZodNullable<z.ZodNumber>;
217
+ }, z.core.$loose>;
218
+ /** The list of {@link PermissionlessAssetSummary}, already ordered. */
219
+ export declare const assetSummariesSchema: z.ZodArray<z.ZodObject<{
220
+ chainId: z.ZodNumber;
221
+ address: z.ZodCustom<`0x${string}`, `0x${string}`>;
222
+ symbol: z.ZodString;
223
+ underlyingMarketCount: z.ZodNumber;
224
+ quotaLimitUsd: z.ZodNullable<z.ZodNumber>;
225
+ quotaUsedUsd: z.ZodNullable<z.ZodNumber>;
226
+ }, z.core.$loose>>;
128
227
  //#endregion
@@ -88,6 +88,33 @@ export interface PermissionlessPriceFeedMarket {
88
88
  * answers.
89
89
  */
90
90
  quotaLimit: number | null;
91
+ /**
92
+ * How much of {@link quotaLimit} the market's borrowers have actually taken,
93
+ * in the same units.
94
+ *
95
+ * The sum of every open credit account's current quota for this token across
96
+ * the credit managers borrowing from the market, so it is what the token is
97
+ * backing right now rather than what it is allowed to back.
98
+ *
99
+ * `null` only where {@link quotaLimit} is: a token nobody quotes reads as a
100
+ * zero against a limit, which is a different answer from a token the keeper
101
+ * holds no entry for at all.
102
+ */
103
+ quotaUsed: number | null;
104
+ /**
105
+ * Staleness period this market's own price oracle holds for the slot, in
106
+ * seconds.
107
+ *
108
+ * The market's figure rather than the store's: a curator sets one per slot
109
+ * in their price oracle, and nothing obliges it to agree with the period the
110
+ * PriceFeedStore carries for the feed. A reader comparing the two is
111
+ * comparing two contracts, which is why both are reported.
112
+ *
113
+ * Read off the oracle when the route is answered rather than taken from the
114
+ * index — the slot's period is not indexed — so `null` means the oracle
115
+ * would not answer, not that it holds no period.
116
+ */
117
+ marketStalenessPeriod: number | null;
91
118
  }
92
119
  /**
93
120
  * One feed of the store, with everywhere the store lets it be used.
@@ -107,6 +134,163 @@ export interface PermissionlessPriceFeedDetails {
107
134
  */
108
135
  markets: PermissionlessPriceFeedMarket[];
109
136
  }
137
+ /**
138
+ * One feed as a market slot holds it.
139
+ *
140
+ * The store's view of the feed and not the feed itself: a market keeps
141
+ * pricing with whatever it was last pointed at, and nothing removes it from a
142
+ * market when the store drops it. {@link inStore} is what tells those apart,
143
+ * and the name survives either way because the store recorded it before.
144
+ **/
145
+ export interface PermissionlessAssetMarketFeed {
146
+ address: Address;
147
+ /**
148
+ * Display name the store recorded, or `null` for a feed it never carried —
149
+ * an aggregator a curator pointed a market straight at, say.
150
+ */
151
+ name: string | null;
152
+ /**
153
+ * Whether the PriceFeedStore still carries the feed.
154
+ *
155
+ * `false` is the case worth showing: the market goes on pricing the asset
156
+ * with a feed the store has removed, or never had. Nothing on chain forbids
157
+ * that, which is exactly why it has to be visible.
158
+ */
159
+ inStore: boolean;
160
+ }
161
+ /**
162
+ * One market that prices an asset, with both of the slots it may fill.
163
+ *
164
+ * A row per market rather than per `(market, role)`: the two roles are two
165
+ * columns of the same market's row, and the quota is the market's whatever
166
+ * feed holds which slot.
167
+ **/
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;
175
+ /** The market's underlying, which its quota figures are denominated in. */
176
+ 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
+ /**
182
+ * The market has been shut down.
183
+ *
184
+ * Still reported, and still counted in {@link
185
+ * PermissionlessAssetDetails.quotaUsedUsd}: a shut down market carries no
186
+ * new borrowing but its open accounts are quoting all the same.
187
+ */
188
+ isShutdown: boolean;
189
+ /** The feed the market prices the asset with, or `null` if it has none. */
190
+ mainFeed: PermissionlessAssetMarketFeed | null;
191
+ /** The feed the market falls back to, or `null` if it has none. */
192
+ 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
+ }
204
+ /**
205
+ * One asset of the store: what prices it, and what it is used as collateral
206
+ * for.
207
+ *
208
+ * The counterpart of {@link PermissionlessPriceFeedDetails} — the same corner
209
+ * of the chain read from the asset's end instead of the feed's.
210
+ **/
211
+ export interface PermissionlessAssetDetails {
212
+ chainId: number;
213
+ asset: PermissionlessPriceFeedAsset;
214
+ /**
215
+ * Feeds the store currently allows for the asset.
216
+ *
217
+ * Only the store's. A feed a market still prices the asset with but the
218
+ * store has dropped is not here — it is on its market's row, flagged.
219
+ */
220
+ priceFeeds: PriceFeed[];
221
+ /** Ordered by curator, then by market. */
222
+ markets: PermissionlessAssetMarket[];
223
+ /**
224
+ * Total quota limit across the markets still running, in USD.
225
+ *
226
+ * In USD and not in token units because there is no token to state it in: a
227
+ * limit is denominated in its own market's underlying, and an asset is
228
+ * routinely collateral in markets underlain by different tokens, so the
229
+ * figures are not comparable until each is priced. Each market's limit is
230
+ * converted at the price that market's own oracle holds for its underlying.
231
+ *
232
+ * Shut down markets are left out — their limits are not borrowable — and so
233
+ * are markets whose underlying could not be priced, which makes this a floor
234
+ * rather than an estimate. `null` when no market contributed at all.
235
+ */
236
+ quotaLimitUsd: number | null;
237
+ /**
238
+ * Total quota actually taken across every market, in USD, converted the same
239
+ * way as {@link quotaLimitUsd}.
240
+ *
241
+ * Every market, including the shut down ones: debt outstanding is exposure
242
+ * whether or not the market still takes new borrowers.
243
+ */
244
+ quotaUsedUsd: number | null;
245
+ }
246
+ /**
247
+ * What each of one asset's feeds says the asset is worth, and what the market
248
+ * values the asset at through each.
249
+ *
250
+ * Keyed by the lowercased feed address throughout. The asset is the one asked
251
+ * for, so a cap here is that feed's price times the asset's supply — the same
252
+ * figure {@link PermissionlessPriceFeedMarketCaps} answers from the other
253
+ * side, and the reason both exist is that a page shows one row per feed or one
254
+ * row per asset, never the full cross product.
255
+ *
256
+ * `null` is a read that failed, not a zero.
257
+ **/
258
+ export interface PermissionlessAssetPrices {
259
+ prices: Record<Address, string | null>;
260
+ marketCaps: Record<Address, string | null>;
261
+ /** When the backend computed the figures; they are read live, not indexed. */
262
+ time: number;
263
+ }
264
+ /**
265
+ * One asset of the PriceFeedStore, with what its markets make of it.
266
+ *
267
+ * Everything a list of assets renders and nothing else: the store's own read
268
+ * carries each asset's feeds too, which is several times this payload and not
269
+ * what a reader scanning for the big positions is looking at.
270
+ *
271
+ * The two USD figures are the ones {@link PermissionlessAssetDetails} heads an
272
+ * asset's own page with, under the same rule — limits count only the markets
273
+ * still running, what is already quoted counts everywhere, and `null` is
274
+ * nothing to total rather than a zero — so the list and the page a row of it
275
+ * opens cannot disagree.
276
+ **/
277
+ export interface PermissionlessAssetSummary {
278
+ chainId: number;
279
+ /** Lowercased, as everything addressed in these payloads is. */
280
+ address: Address;
281
+ symbol: string;
282
+ /**
283
+ * How many markets still running are underlain by this asset.
284
+ *
285
+ * What makes an asset central rather than merely listed: a token several
286
+ * markets borrow against is the one a reader opens the list for. Shut down
287
+ * markets are left out for the reason their limits are — they are no longer
288
+ * a place anything happens.
289
+ */
290
+ underlyingMarketCount: number;
291
+ quotaLimitUsd: number | null;
292
+ quotaUsedUsd: number | null;
293
+ }
110
294
  /**
111
295
  * Market caps of one feed's assets, keyed by the lowercased asset address.
112
296
  *
@@ -129,6 +313,11 @@ export interface PriceFeedArgs {
129
313
  chainId: number;
130
314
  address: Address;
131
315
  }
316
+ /** Args of a read scoped to one asset. */
317
+ export interface AssetArgs {
318
+ chainId: number;
319
+ address: Address;
320
+ }
132
321
  /** Args of {@link PermissionlessOracles.getPrices}. */
133
322
  export interface GetPricesArgs {
134
323
  chainId: number;
@@ -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 { GetPricesArgs, PermissionlessAsset, PermissionlessPriceFeedAsset, PermissionlessPriceFeedDetails, PermissionlessPriceFeedMarket, PermissionlessPriceFeedMarketCaps, PermissionlessPriceFeedStore, PermissionlessPrices, PriceFeedArgs } from "./api/oracles/types.js";
16
+ import { AssetArgs, GetPricesArgs, PermissionlessAsset, PermissionlessAssetDetails, PermissionlessAssetMarket, PermissionlessAssetMarketFeed, PermissionlessAssetPrices, PermissionlessAssetSummary, 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, 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, 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, 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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "18.2.0-next.2",
3
+ "version": "18.2.0-next.4",
4
4
  "description": "Gearbox SDK",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -69,8 +69,9 @@
69
69
  "dev": "tsdown --watch",
70
70
  "example": "tsx scripts/example.ts | pino-pretty",
71
71
  "list-opportunities": "tsx scripts/list-opportunities.ts",
72
- "test:watch": "vitest --project unit",
73
- "test:unit": "vitest run --project unit",
72
+ "test:watch": "vitest --project unit --project api",
73
+ "test:unit": "vitest run --project unit --project api",
74
+ "test:api": "vitest run --project api",
74
75
  "test:e2e": "vitest run --project e2e",
75
76
  "test:all": "vitest run",
76
77
  "test": "vitest run",