@augustdigital/sdk 8.24.0 → 8.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,12 @@
1
1
  import type { IEmberVault, IFetchEmberVaultsOptions } from './types';
2
2
  /**
3
- * Fetch Ember vaults from API
3
+ * Fetch Ember vaults from API.
4
+ *
5
+ * Results are cached for {@link EMBER_CACHE_TTL_MS} (keyed by the full request
6
+ * URL, so different query options cache independently) and the request is
7
+ * aborted after {@link EMBER_FETCH_TIMEOUT_MS}. Failures — including timeouts —
8
+ * are never cached and resolve to `[]`, preserving the long-standing
9
+ * fail-tolerant contract of this getter.
4
10
  */
5
11
  export declare function getEmberVaults(options?: IFetchEmberVaultsOptions): Promise<IEmberVault[]>;
6
12
  /**
@@ -4,9 +4,32 @@ exports.getEmberVaults = getEmberVaults;
4
4
  exports.getEmberTVL = getEmberTVL;
5
5
  const constants_1 = require("./constants");
6
6
  const core_1 = require("../../core");
7
+ const cache_1 = require("../../core/cache");
7
8
  const logger_1 = require("../../core/logger");
8
9
  /**
9
- * Fetch Ember vaults from API
10
+ * Hard ceiling on the Ember (Bluefin) vaults request. The endpoint is a
11
+ * third-party API awaited on the `getVaults` hot path; without a bound, a
12
+ * hung connection stalls every vault-list consumer indefinitely (the fetch
13
+ * options carry no signal and no timeout). Measured latency is 0.24–1.02s,
14
+ * so 5s is ~5× the observed worst case while still failing fast enough for
15
+ * callers racing `getVaults` against their own budgets.
16
+ */
17
+ const EMBER_FETCH_TIMEOUT_MS = 5_000;
18
+ /**
19
+ * TTL for the cached Ember vaults payload. The set of active Ember vaults
20
+ * changes rarely (the SDK additionally filters it to a hardcoded allowlist),
21
+ * so 5 minutes matches the freshness of the other list-shaped caches without
22
+ * letting a stale payload outlive a delisting for long.
23
+ */
24
+ const EMBER_CACHE_TTL_MS = 5 * 60 * 1000;
25
+ /**
26
+ * Fetch Ember vaults from API.
27
+ *
28
+ * Results are cached for {@link EMBER_CACHE_TTL_MS} (keyed by the full request
29
+ * URL, so different query options cache independently) and the request is
30
+ * aborted after {@link EMBER_FETCH_TIMEOUT_MS}. Failures — including timeouts —
31
+ * are never cached and resolve to `[]`, preserving the long-standing
32
+ * fail-tolerant contract of this getter.
10
33
  */
11
34
  async function getEmberVaults(options) {
12
35
  try {
@@ -19,12 +42,36 @@ async function getEmberVaults(options) {
19
42
  params.append('status', options.status);
20
43
  const queryString = params.toString();
21
44
  const url = `${constants_1.EMBER_API_BASE_URL}${queryString ? `?${queryString}` : ''}`;
22
- const response = await fetch(url, core_1.DEFAULT_FETCH_OPTIONS);
23
- if (!response.ok) {
24
- throw new Error(`HTTP error! status: ${response.status}`);
45
+ const cacheKey = `ember-vaults-${url}`;
46
+ // The shared LRU is constructed with `allowStale: true`; opt out here so a
47
+ // payload past its TTL is refetched rather than served one last time —
48
+ // keeping the 5-minute bound above an exact contract.
49
+ const cached = cache_1.CACHE.get(cacheKey, { allowStale: false });
50
+ if (cached)
51
+ return cached;
52
+ // AbortController (not AbortSignal.timeout) for browser + older-Node parity.
53
+ // The timer stays armed through the body read: `fetch` resolves as soon as
54
+ // headers arrive, so clearing it there would leave a stalled `json()`
55
+ // unbounded — the exact hang the ceiling exists to prevent.
56
+ const controller = new AbortController();
57
+ const timer = setTimeout(() => controller.abort(), EMBER_FETCH_TIMEOUT_MS);
58
+ let data;
59
+ try {
60
+ const response = await fetch(url, {
61
+ ...core_1.DEFAULT_FETCH_OPTIONS,
62
+ signal: controller.signal,
63
+ });
64
+ if (!response.ok) {
65
+ throw new Error(`HTTP error! status: ${response.status}`);
66
+ }
67
+ data = await response.json();
68
+ }
69
+ finally {
70
+ clearTimeout(timer);
25
71
  }
26
- const data = await response.json();
27
- return Array.isArray(data) ? data : [];
72
+ const vaults = Array.isArray(data) ? data : [];
73
+ cache_1.CACHE.set(cacheKey, vaults, { ttl: EMBER_CACHE_TTL_MS });
74
+ return vaults;
28
75
  }
29
76
  catch (error) {
30
77
  logger_1.Logger.log.error('getEmberVaults', error);
@@ -36,6 +36,16 @@ exports.METHOD_CATEGORIES = {
36
36
  getTimelockRequests: 'read.vault',
37
37
  getVaultPerformanceFees: 'read.vault',
38
38
  getVaultOracleClassification: 'read.vault',
39
+ // Transparency dashboard (one per card/tab)
40
+ getVaultPositionSnapshot: 'read.vault',
41
+ getVaultBackingSeries: 'read.vault',
42
+ getVaultSmoothedApy: 'read.vault',
43
+ getVaultHistoricalAllocations: 'read.vault',
44
+ getVaultFeeConfig: 'read.vault',
45
+ getVaultGovernanceRoles: 'read.vault',
46
+ getVaultGovernancePermissions: 'read.vault',
47
+ getVaultGovernanceTimelocks: 'read.vault',
48
+ getVaultGovernanceAuditLog: 'read.vault',
39
49
  getVaultBorrowerHealthFactor: 'read.vault',
40
50
  getYieldLastRealizedOn: 'read.vault',
41
51
  getVaultActivity: 'read.vault',
@@ -3,4 +3,4 @@
3
3
  * Generated during publish from package.json version
4
4
  * This file is gitignored and created at publish time
5
5
  */
6
- export declare const SDK_VERSION = "8.24.0";
6
+ export declare const SDK_VERSION = "8.26.0";
@@ -6,5 +6,5 @@ exports.SDK_VERSION = void 0;
6
6
  * Generated during publish from package.json version
7
7
  * This file is gitignored and created at publish time
8
8
  */
9
- exports.SDK_VERSION = '8.24.0';
9
+ exports.SDK_VERSION = '8.26.0';
10
10
  //# sourceMappingURL=version.js.map
@@ -117,6 +117,17 @@ export declare const WEBSERVER_ENDPOINTS: {
117
117
  };
118
118
  revertReason: (txHash: string, chain: number) => string;
119
119
  oracleClassification: (vaultAddress: string, chainId: number) => string;
120
+ transparency: {
121
+ positions: (vaultAddress: string, chainId: number) => string;
122
+ historicalAllocations: (vaultAddress: string, chainId: number, startDate?: string, endDate?: string) => string;
123
+ fees: (vaultAddress: string, chainId: number) => string;
124
+ ratioSeries: (vaultAddress: string, startDate?: string, endDate?: string, limit?: number) => string;
125
+ smoothedApy: (vaultAddress: string, daysAgo: number, averagingPeriodDays: number, applySmoothing: boolean) => string;
126
+ governanceRoles: (vaultAddress: string, chainId: number) => string;
127
+ governancePermissions: (vaultAddress: string, chainId: number) => string;
128
+ governanceTimelocks: (vaultAddress: string, chainId: number, status?: string) => string;
129
+ governanceAuditLog: (vaultAddress: string, chainId: number, category?: string, before?: string, limit?: number) => string;
130
+ };
120
131
  };
121
132
  upshift: {
122
133
  vaults: {
@@ -191,6 +191,60 @@ exports.WEBSERVER_ENDPOINTS = {
191
191
  chain: String(chain),
192
192
  }).toString()}`,
193
193
  oracleClassification: (vaultAddress, chainId) => `/upshift/oracle_classification/${encodeURIComponent(vaultAddress)}?chain_id=${chainId}`,
194
+ // Transparency dashboard endpoints (all public, snapshot-backed).
195
+ transparency: {
196
+ positions: (vaultAddress, chainId) => `/upshift/positions/${encodeURIComponent(vaultAddress)}?chain_id=${chainId}`,
197
+ historicalAllocations: (vaultAddress, chainId, startDate, endDate) => {
198
+ const q = new URLSearchParams({ chain_id: String(chainId) });
199
+ if (startDate)
200
+ q.set('start_date', startDate);
201
+ // The backend compares `<= end_date` as a datetime, so a bare date
202
+ // would exclude the whole last day; widen to end-of-day for the
203
+ // documented inclusive semantics.
204
+ if (endDate)
205
+ q.set('end_date', `${endDate}T23:59:59.999`);
206
+ return `/upshift/historical_allocations/${encodeURIComponent(vaultAddress)}?${q.toString()}`;
207
+ },
208
+ fees: (vaultAddress, chainId) => `/upshift/fees/${encodeURIComponent(vaultAddress)}?chain_id=${chainId}`,
209
+ ratioSeries: (vaultAddress, startDate, endDate, limit) => {
210
+ const q = new URLSearchParams({
211
+ vault_address: vaultAddress,
212
+ fields: 'ratio',
213
+ });
214
+ if (startDate)
215
+ q.set('start_date', startDate);
216
+ // See historicalAllocations: widen to end-of-day for inclusive semantics.
217
+ if (endDate)
218
+ q.set('end_date', `${endDate}T23:59:59.999`);
219
+ if (limit !== undefined)
220
+ q.set('limit', String(limit));
221
+ return `/upshift/unrealized_pnl?${q.toString()}`;
222
+ },
223
+ smoothedApy: (vaultAddress, daysAgo, averagingPeriodDays, applySmoothing) => `/upshift/historical_apy/chart?${new URLSearchParams({
224
+ vault_address: vaultAddress,
225
+ days_ago: String(daysAgo),
226
+ averaging_period_in_days: String(averagingPeriodDays),
227
+ apply_smoothing: String(applySmoothing),
228
+ }).toString()}`,
229
+ governanceRoles: (vaultAddress, chainId) => `/upshift/governance/${encodeURIComponent(vaultAddress)}/roles?chain_id=${chainId}`,
230
+ governancePermissions: (vaultAddress, chainId) => `/upshift/governance/${encodeURIComponent(vaultAddress)}/permissions?chain_id=${chainId}`,
231
+ governanceTimelocks: (vaultAddress, chainId, status) => {
232
+ const q = new URLSearchParams({ chain_id: String(chainId) });
233
+ if (status)
234
+ q.set('status', status);
235
+ return `/upshift/governance/${encodeURIComponent(vaultAddress)}/timelocks?${q.toString()}`;
236
+ },
237
+ governanceAuditLog: (vaultAddress, chainId, category, before, limit) => {
238
+ const q = new URLSearchParams({ chain_id: String(chainId) });
239
+ if (category)
240
+ q.set('category', category);
241
+ if (before)
242
+ q.set('before', before);
243
+ if (limit !== undefined)
244
+ q.set('limit', String(limit));
245
+ return `/upshift/governance/${encodeURIComponent(vaultAddress)}/audit_log?${q.toString()}`;
246
+ },
247
+ },
194
248
  },
195
249
  upshift: {
196
250
  vaults: {
package/lib/main.d.ts CHANGED
@@ -7,9 +7,9 @@ import SolanaAdapter from './adapters/solana';
7
7
  import SuiAdapter from './adapters/sui';
8
8
  import StellarAdapter from './adapters/stellar';
9
9
  import EVMAdapter from './adapters/evm';
10
- import type { IAddress, IChainId, IVaultHistoricalParams, IWSMonitorHeaders } from './types';
10
+ import type { IAddress, IChainId, IVaultHistoricalParams } from './types';
11
11
  import { AugustBase, type IAugustBase } from './core';
12
- import { AugustVaults, type IVaultBaseOptions, type IVaultCustomOptions } from './modules/vaults';
12
+ import { AugustVaults, type IGetVaultsOptions, type IVaultBaseOptions, type IVaultCustomOptions } from './modules/vaults';
13
13
  import type { Signer, Wallet } from 'ethers';
14
14
  import type { IContractWriteOptions } from './modules/vaults/write.actions';
15
15
  import { AugustSubAccounts } from './modules/sub-accounts';
@@ -41,8 +41,9 @@ export declare class AugustSDK extends AugustBase {
41
41
  get vaultsModule(): AugustVaults;
42
42
  /**
43
43
  * Get the backend API module instance ({@link AugustApi}) — read-only
44
- * access to backend-computed data with no on-chain equivalent
45
- * (unrealized-PnL series).
44
+ * access to backend-computed data with no on-chain equivalent: the
45
+ * unrealized-PnL series and the transparency dashboard (position snapshot,
46
+ * backing series, smoothed APY, allocations, fee config, governance).
46
47
  */
47
48
  get apiModule(): AugustApi;
48
49
  /**
@@ -76,15 +77,12 @@ export declare class AugustSDK extends AugustBase {
76
77
  /**
77
78
  * Fetch all available vaults across configured networks.
78
79
  * Optionally filter by chain IDs and include loan/allocation data.
79
- * @param options - Configuration for filtering and enriching vault data
80
+ * @param options - Configuration for filtering and enriching vault data
81
+ * see {@link IGetVaultsOptions} for the full surface (`includeClosed`
82
+ * portfolio mode, `maxRetries`/`baseDelay` retry tuning)
80
83
  * @returns Array of vault objects with metadata and optional position data
81
84
  */
82
- getVaults(options?: {
83
- chainIds?: number[];
84
- headers?: IWSMonitorHeaders;
85
- loadSubaccounts?: boolean;
86
- loadSnapshots?: boolean;
87
- } & IVaultCustomOptions): Promise<import("./types").IVault[]>;
85
+ getVaults(options?: IGetVaultsOptions): Promise<import("./types").IVault[]>;
88
86
  getTotalDeposited(options?: {
89
87
  loadSubaccounts?: boolean;
90
88
  loadSnapshots?: boolean;
@@ -119,8 +117,27 @@ export declare class AugustSDK extends AugustBase {
119
117
  }): Promise<import("./types").IVaultLoan[]>;
120
118
  /**
121
119
  * Get vault asset allocations across DeFi protocols, CeFi, and OTC positions.
120
+ *
121
+ * This is the data behind the "Vault Exposure" section of the Upshift app —
122
+ * a partner rendering that section in their own frontend needs only this
123
+ * call. Read `exposurePerCategory` for the pre-bucketed view the UI renders
124
+ * (`supplying` / `borrowing` / `wallet` / `lending` legs plus per-category
125
+ * USD totals) and `netValue` for the headline figure; the raw `defi` /
126
+ * `cefi` / `otc` arrays back the drill-downs. See the "Rendering the Vault
127
+ * Exposure section" guide in the vaults docs for a faithful reproduction.
128
+ *
122
129
  * @param props - Vault address and chain ID
123
130
  * @returns Detailed breakdown of vault allocations by category
131
+ * @example
132
+ * ```ts
133
+ * const { exposurePerCategory, netValue } = await sdk.getVaultAllocations({
134
+ * vault: '0xcd69123b3FBBfC666E1f6a501da27B564C00De54',
135
+ * chainId: 1,
136
+ * });
137
+ * for (const item of exposurePerCategory?.supplying ?? []) {
138
+ * console.log(item.protocol, item.symbol, item.amount);
139
+ * }
140
+ * ```
124
141
  */
125
142
  getVaultAllocations(props: {
126
143
  vault: IAddress;
package/lib/main.js CHANGED
@@ -146,8 +146,9 @@ class AugustSDK extends core_1.AugustBase {
146
146
  }
147
147
  /**
148
148
  * Get the backend API module instance ({@link AugustApi}) — read-only
149
- * access to backend-computed data with no on-chain equivalent
150
- * (unrealized-PnL series).
149
+ * access to backend-computed data with no on-chain equivalent: the
150
+ * unrealized-PnL series and the transparency dashboard (position snapshot,
151
+ * backing series, smoothed APY, allocations, fee config, governance).
151
152
  */
152
153
  get apiModule() {
153
154
  return this.api;
@@ -206,7 +207,9 @@ class AugustSDK extends core_1.AugustBase {
206
207
  /**
207
208
  * Fetch all available vaults across configured networks.
208
209
  * Optionally filter by chain IDs and include loan/allocation data.
209
- * @param options - Configuration for filtering and enriching vault data
210
+ * @param options - Configuration for filtering and enriching vault data
211
+ * see {@link IGetVaultsOptions} for the full surface (`includeClosed`
212
+ * portfolio mode, `maxRetries`/`baseDelay` retry tuning)
210
213
  * @returns Array of vault objects with metadata and optional position data
211
214
  */
212
215
  async getVaults(options) {
@@ -242,8 +245,27 @@ class AugustSDK extends core_1.AugustBase {
242
245
  }
243
246
  /**
244
247
  * Get vault asset allocations across DeFi protocols, CeFi, and OTC positions.
248
+ *
249
+ * This is the data behind the "Vault Exposure" section of the Upshift app —
250
+ * a partner rendering that section in their own frontend needs only this
251
+ * call. Read `exposurePerCategory` for the pre-bucketed view the UI renders
252
+ * (`supplying` / `borrowing` / `wallet` / `lending` legs plus per-category
253
+ * USD totals) and `netValue` for the headline figure; the raw `defi` /
254
+ * `cefi` / `otc` arrays back the drill-downs. See the "Rendering the Vault
255
+ * Exposure section" guide in the vaults docs for a faithful reproduction.
256
+ *
245
257
  * @param props - Vault address and chain ID
246
258
  * @returns Detailed breakdown of vault allocations by category
259
+ * @example
260
+ * ```ts
261
+ * const { exposurePerCategory, netValue } = await sdk.getVaultAllocations({
262
+ * vault: '0xcd69123b3FBBfC666E1f6a501da27B564C00De54',
263
+ * chainId: 1,
264
+ * });
265
+ * for (const item of exposurePerCategory?.supplying ?? []) {
266
+ * console.log(item.protocol, item.symbol, item.amount);
267
+ * }
268
+ * ```
247
269
  */
248
270
  async getVaultAllocations(props) {
249
271
  return await this.vaults.getVaultAllocations(props);
@@ -1,5 +1,5 @@
1
1
  import { type IFetchAugustOptions } from '../../core';
2
- import type { ICollateralExcessOrDeficit, ICollateralSimulationInput, ICollateralSimulationResults, ICuratorWhitelistStatus, IDiscountFactorLadder, ILoanBookInfo, IOracleClassification, IOtcMarginRequirement, IOtcPositionRead, IRevertReason, ITimelockRequest, IVaultPerformanceFees, IWSSubaccountListItem } from '../../types';
2
+ import type { ICollateralExcessOrDeficit, ICollateralSimulationInput, ICollateralSimulationResults, ICuratorWhitelistStatus, IDiscountFactorLadder, ILoanBookInfo, IOracleClassification, IOtcMarginRequirement, IOtcPositionRead, IRevertReason, ITimelockRequest, ITransparencyAuditLog, ITransparencyFees, ITransparencyGovernancePermissions, ITransparencyGovernanceRoles, ITransparencyHistoricalAllocations, ITransparencyPositions, ITransparencyRatioPoint, ITransparencyTimelocks, IVaultPerformanceFees, IWSSubaccountListItem } from '../../types';
3
3
  /**
4
4
  * Fetch the global loan-book aggregate (admin-only `GET /dashboard/loans`).
5
5
  */
@@ -80,3 +80,29 @@ export declare const fetchVaultPerformanceFees: (params: {
80
80
  * required.
81
81
  */
82
82
  export declare const fetchVaultOracleClassification: (vaultAddress: string, chainId: number, headers?: IFetchAugustOptions["headers"]) => Promise<IOracleClassification>;
83
+ /** Public `GET /upshift/positions/{vault}` — latest per-wallet position snapshot. */
84
+ export declare const fetchTransparencyPositions: (vaultAddress: string, chainId: number, headers?: IFetchAugustOptions["headers"]) => Promise<ITransparencyPositions>;
85
+ /** Public `GET /upshift/historical_allocations/{vault}` — daily per-protocol allocation history. */
86
+ export declare const fetchTransparencyHistoricalAllocations: (vaultAddress: string, chainId: number, startDate?: string, endDate?: string, headers?: IFetchAugustOptions["headers"]) => Promise<ITransparencyHistoricalAllocations>;
87
+ /** Public `GET /upshift/fees/{vault}` — vault fee configuration. */
88
+ export declare const fetchTransparencyFees: (vaultAddress: string, chainId: number, headers?: IFetchAugustOptions["headers"]) => Promise<ITransparencyFees>;
89
+ /** Public `GET /upshift/unrealized_pnl?fields=ratio` — hourly backing / supply / collateral-ratio series. */
90
+ export declare const fetchTransparencyRatioSeries: (vaultAddress: string, startDate?: string, endDate?: string, limit?: number, headers?: IFetchAugustOptions["headers"]) => Promise<ITransparencyRatioPoint[]>;
91
+ /** Public `GET /upshift/historical_apy/chart` — smoothed rolling-APY series; returns the raw backend envelope. */
92
+ export declare const fetchTransparencySmoothedApy: (vaultAddress: string, daysAgo: number, averagingPeriodDays: number, applySmoothing: boolean, headers?: IFetchAugustOptions["headers"]) => Promise<{
93
+ data: {
94
+ labels: string[];
95
+ values: number[];
96
+ };
97
+ average_apy?: number | null;
98
+ status: number;
99
+ error?: string | null;
100
+ }>;
101
+ /** Public `GET /upshift/governance/{vault}/roles` — owner/operator addresses with custody enrichment. */
102
+ export declare const fetchTransparencyGovernanceRoles: (vaultAddress: string, chainId: number, headers?: IFetchAugustOptions["headers"]) => Promise<ITransparencyGovernanceRoles>;
103
+ /** Public `GET /upshift/governance/{vault}/permissions` — whitelisted integrations per vault wallet. */
104
+ export declare const fetchTransparencyGovernancePermissions: (vaultAddress: string, chainId: number, headers?: IFetchAugustOptions["headers"]) => Promise<ITransparencyGovernancePermissions>;
105
+ /** Public `GET /upshift/governance/{vault}/timelocks` — timelock queue, default pending only. */
106
+ export declare const fetchTransparencyGovernanceTimelocks: (vaultAddress: string, chainId: number, status?: string, headers?: IFetchAugustOptions["headers"]) => Promise<ITransparencyTimelocks>;
107
+ /** Public `GET /upshift/governance/{vault}/audit_log` — one page of the governance audit log. */
108
+ export declare const fetchTransparencyGovernanceAuditLog: (vaultAddress: string, chainId: number, category?: string, before?: string, limit?: number, headers?: IFetchAugustOptions["headers"]) => Promise<ITransparencyAuditLog>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.fetchVaultOracleClassification = exports.fetchVaultPerformanceFees = exports.fetchTimelockRequests = exports.fetchCuratorVaultWhitelist = exports.fetchCuratorVaultSubaccounts = exports.fetchOtcMarginRequirements = exports.fetchOtcPositions = exports.fetchRevertReason = exports.fetchCollateralSimulation = exports.fetchCollateralExcessOrDeficit = exports.fetchDiscountFactors = exports.fetchDashboardLoans = void 0;
3
+ exports.fetchTransparencyGovernanceAuditLog = exports.fetchTransparencyGovernanceTimelocks = exports.fetchTransparencyGovernancePermissions = exports.fetchTransparencyGovernanceRoles = exports.fetchTransparencySmoothedApy = exports.fetchTransparencyRatioSeries = exports.fetchTransparencyFees = exports.fetchTransparencyHistoricalAllocations = exports.fetchTransparencyPositions = exports.fetchVaultOracleClassification = exports.fetchVaultPerformanceFees = exports.fetchTimelockRequests = exports.fetchCuratorVaultWhitelist = exports.fetchCuratorVaultSubaccounts = exports.fetchOtcMarginRequirements = exports.fetchOtcPositions = exports.fetchRevertReason = exports.fetchCollateralSimulation = exports.fetchCollateralExcessOrDeficit = exports.fetchDiscountFactors = exports.fetchDashboardLoans = void 0;
4
4
  const core_1 = require("../../core");
5
5
  /**
6
6
  * Fetch the global loan-book aggregate (admin-only `GET /dashboard/loans`).
@@ -147,4 +147,41 @@ const fetchVaultOracleClassification = async (vaultAddress, chainId, headers) =>
147
147
  return response.json();
148
148
  };
149
149
  exports.fetchVaultOracleClassification = fetchVaultOracleClassification;
150
+ /**
151
+ * Shared GET for the public transparency-dashboard endpoints. One HTTPS
152
+ * request, no RPC. `fetchAugustPublic` already maps non-2xx to typed
153
+ * `AugustServerError` / `AugustRateLimitError` / `AugustTimeoutError`, so
154
+ * this only parses the body; validation happens in the module layer.
155
+ */
156
+ const fetchTransparency = async (endpoint, headers) => {
157
+ const response = await (0, core_1.fetchAugustPublic)(endpoint, { headers });
158
+ return response.json();
159
+ };
160
+ /** Public `GET /upshift/positions/{vault}` — latest per-wallet position snapshot. */
161
+ const fetchTransparencyPositions = (vaultAddress, chainId, headers) => fetchTransparency(core_1.WEBSERVER_ENDPOINTS.public.transparency.positions(vaultAddress, chainId), headers);
162
+ exports.fetchTransparencyPositions = fetchTransparencyPositions;
163
+ /** Public `GET /upshift/historical_allocations/{vault}` — daily per-protocol allocation history. */
164
+ const fetchTransparencyHistoricalAllocations = (vaultAddress, chainId, startDate, endDate, headers) => fetchTransparency(core_1.WEBSERVER_ENDPOINTS.public.transparency.historicalAllocations(vaultAddress, chainId, startDate, endDate), headers);
165
+ exports.fetchTransparencyHistoricalAllocations = fetchTransparencyHistoricalAllocations;
166
+ /** Public `GET /upshift/fees/{vault}` — vault fee configuration. */
167
+ const fetchTransparencyFees = (vaultAddress, chainId, headers) => fetchTransparency(core_1.WEBSERVER_ENDPOINTS.public.transparency.fees(vaultAddress, chainId), headers);
168
+ exports.fetchTransparencyFees = fetchTransparencyFees;
169
+ /** Public `GET /upshift/unrealized_pnl?fields=ratio` — hourly backing / supply / collateral-ratio series. */
170
+ const fetchTransparencyRatioSeries = (vaultAddress, startDate, endDate, limit, headers) => fetchTransparency(core_1.WEBSERVER_ENDPOINTS.public.transparency.ratioSeries(vaultAddress, startDate, endDate, limit), headers);
171
+ exports.fetchTransparencyRatioSeries = fetchTransparencyRatioSeries;
172
+ /** Public `GET /upshift/historical_apy/chart` — smoothed rolling-APY series; returns the raw backend envelope. */
173
+ const fetchTransparencySmoothedApy = (vaultAddress, daysAgo, averagingPeriodDays, applySmoothing, headers) => fetchTransparency(core_1.WEBSERVER_ENDPOINTS.public.transparency.smoothedApy(vaultAddress, daysAgo, averagingPeriodDays, applySmoothing), headers);
174
+ exports.fetchTransparencySmoothedApy = fetchTransparencySmoothedApy;
175
+ /** Public `GET /upshift/governance/{vault}/roles` — owner/operator addresses with custody enrichment. */
176
+ const fetchTransparencyGovernanceRoles = (vaultAddress, chainId, headers) => fetchTransparency(core_1.WEBSERVER_ENDPOINTS.public.transparency.governanceRoles(vaultAddress, chainId), headers);
177
+ exports.fetchTransparencyGovernanceRoles = fetchTransparencyGovernanceRoles;
178
+ /** Public `GET /upshift/governance/{vault}/permissions` — whitelisted integrations per vault wallet. */
179
+ const fetchTransparencyGovernancePermissions = (vaultAddress, chainId, headers) => fetchTransparency(core_1.WEBSERVER_ENDPOINTS.public.transparency.governancePermissions(vaultAddress, chainId), headers);
180
+ exports.fetchTransparencyGovernancePermissions = fetchTransparencyGovernancePermissions;
181
+ /** Public `GET /upshift/governance/{vault}/timelocks` — timelock queue, default pending only. */
182
+ const fetchTransparencyGovernanceTimelocks = (vaultAddress, chainId, status, headers) => fetchTransparency(core_1.WEBSERVER_ENDPOINTS.public.transparency.governanceTimelocks(vaultAddress, chainId, status), headers);
183
+ exports.fetchTransparencyGovernanceTimelocks = fetchTransparencyGovernanceTimelocks;
184
+ /** Public `GET /upshift/governance/{vault}/audit_log` — one page of the governance audit log. */
185
+ const fetchTransparencyGovernanceAuditLog = (vaultAddress, chainId, category, before, limit, headers) => fetchTransparency(core_1.WEBSERVER_ENDPOINTS.public.transparency.governanceAuditLog(vaultAddress, chainId, category, before, limit), headers);
186
+ exports.fetchTransparencyGovernanceAuditLog = fetchTransparencyGovernanceAuditLog;
150
187
  //# sourceMappingURL=fetcher.js.map