@augustdigital/sdk 9.6.0 → 9.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -31,7 +31,7 @@ async function fetchVaultDebankResponse(vaultAddress, headers) {
31
31
  */
32
32
  async function fetchDebankResponse(address, headers) {
33
33
  // filter out hyperevm since debank does not yet support hyperevm
34
- const debankResponse = await (0, core_1.fetchAugustWithKey)(undefined, core_1.WEBSERVER_ENDPOINTS.subaccount.debank(address), { override: true, headers: headers });
34
+ const debankResponse = await (0, core_1.fetchAugustWithKey)(undefined, core_1.WEBSERVER_ENDPOINTS.subaccount.debank(address), { headers: headers });
35
35
  if (debankResponse.status !== 200) {
36
36
  core_1.Logger.log.error('fetchDebankResponse', new Error(`HTTP ${debankResponse.status} ${debankResponse.statusText}`), {
37
37
  status: debankResponse.status,
@@ -22,4 +22,21 @@ export declare function getSubgraphUserHistory(user: IAddress, provider: IContra
22
22
  export declare function getSubgraphVaultHistory(provider: IContractRunner, pool: IAddress, slackWebookUrl?: string, opts?: {
23
23
  sinceTs?: number;
24
24
  }): Promise<ISubgraphUserHistoryItem[]>;
25
- export declare function getSubgraphUserTransfers(user: IAddress, provider: IContractRunner, pool: IAddress, slackWebookUrl?: string): Promise<ISubgraphTransfer[]>;
25
+ /**
26
+ * Every transfer of the vault's share token into or out of `user`, oldest
27
+ * first. Transfers to or from the reward distributors are excluded.
28
+ *
29
+ * @param user - Wallet address.
30
+ * @param provider - EVM provider for the vault's chain.
31
+ * @param pool - Vault address.
32
+ * @param slackWebookUrl - Where a missing-subgraph alert is posted.
33
+ * @param options - `receiptSubgraph: true` reads the vault's receipt-token
34
+ * subgraph when the registry has one: evm-2 shares are a separate receipt
35
+ * token, which the base subgraph does not index. Falls back to the base
36
+ * subgraph, which indexes the shares of vaults that are their own token.
37
+ * @returns The transfers, or `[]` when the subgraph is missing or the query
38
+ * fails.
39
+ */
40
+ export declare function getSubgraphUserTransfers(user: IAddress, provider: IContractRunner, pool: IAddress, slackWebookUrl?: string, options?: {
41
+ receiptSubgraph?: boolean;
42
+ }): Promise<ISubgraphTransfer[]>;
@@ -1008,7 +1008,22 @@ async function getSubgraphVaultHistory(provider, pool, slackWebookUrl = (0, slac
1008
1008
  return [];
1009
1009
  }
1010
1010
  }
1011
- async function getSubgraphUserTransfers(user, provider, pool, slackWebookUrl = (0, slack_1.resolveSlackWebhookUrl)()) {
1011
+ /**
1012
+ * Every transfer of the vault's share token into or out of `user`, oldest
1013
+ * first. Transfers to or from the reward distributors are excluded.
1014
+ *
1015
+ * @param user - Wallet address.
1016
+ * @param provider - EVM provider for the vault's chain.
1017
+ * @param pool - Vault address.
1018
+ * @param slackWebookUrl - Where a missing-subgraph alert is posted.
1019
+ * @param options - `receiptSubgraph: true` reads the vault's receipt-token
1020
+ * subgraph when the registry has one: evm-2 shares are a separate receipt
1021
+ * token, which the base subgraph does not index. Falls back to the base
1022
+ * subgraph, which indexes the shares of vaults that are their own token.
1023
+ * @returns The transfers, or `[]` when the subgraph is missing or the query
1024
+ * fails.
1025
+ */
1026
+ async function getSubgraphUserTransfers(user, provider, pool, slackWebookUrl = (0, slack_1.resolveSlackWebhookUrl)(), options = {}) {
1012
1027
  try {
1013
1028
  // setup
1014
1029
  let amountOfTransfers = 0;
@@ -1031,8 +1046,9 @@ async function getSubgraphUserTransfers(user, provider, pool, slackWebookUrl = (
1031
1046
  return userTransfers;
1032
1047
  }
1033
1048
  const vaultsMetadata = await (0, fetcher_2.fetchVaultMetadata)();
1034
- const { subgraph } = vaultsMetadata?.[vaultSymbol?.toLowerCase()] || {};
1035
- const goldskyUrl = subgraph ||
1049
+ const { subgraph, receipt_subgraph } = vaultsMetadata?.[vaultSymbol?.toLowerCase()] || {};
1050
+ const goldskyUrl = (options.receiptSubgraph && receipt_subgraph) ||
1051
+ subgraph ||
1036
1052
  core_1.SUBGRAPH_VAULT_URLS[vaultSymbol?.toLowerCase()] ||
1037
1053
  (0, core_1.getDefaultSubgraphUrl)(networkValue.name, vaultSymbol);
1038
1054
  if (!goldskyUrl) {
@@ -574,6 +574,11 @@ export interface IVaultMetadataItem {
574
574
  symbol: string;
575
575
  subgraph: string;
576
576
  address: string;
577
+ /**
578
+ * Subgraph indexing the vault's separate receipt token (evm-2 vaults), when
579
+ * one is deployed. Absent for vaults whose shares are the vault token itself.
580
+ */
581
+ receipt_subgraph?: string;
577
582
  }
578
583
  /**
579
584
  * Response type for getVaultMetadata
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@augustdigital/sdk",
3
- "version": "9.6.0",
3
+ "version": "9.7.1",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/sdk.d.ts",
6
6
  "keywords": [