@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.
- package/README.md +1 -1
- package/lib/adapters/solana/types.d.ts +8 -0
- package/lib/adapters/solana/vault.actions.d.ts +6 -1
- package/lib/adapters/solana/vault.actions.js +99 -21
- package/lib/core/analytics/sanitize.d.ts +13 -0
- package/lib/core/analytics/sanitize.js +24 -12
- package/lib/core/analytics/version.d.ts +1 -1
- package/lib/core/analytics/version.js +1 -1
- package/lib/core/auth/verify.js +2 -2
- package/lib/core/base.class.d.ts +8 -1
- package/lib/core/base.class.js +4 -1
- package/lib/core/fetcher.d.ts +11 -5
- package/lib/core/fetcher.js +10 -7
- package/lib/main.d.ts +2 -1
- package/lib/main.js +2 -1
- package/lib/modules/api/main.d.ts +6 -6
- package/lib/modules/api/main.js +6 -6
- package/lib/modules/sub-accounts/main.d.ts +7 -1
- package/lib/modules/sub-accounts/main.js +7 -1
- package/lib/modules/vaults/getters.d.ts +97 -11
- package/lib/modules/vaults/getters.js +169 -17
- package/lib/modules/vaults/main.d.ts +2 -1
- package/lib/modules/vaults/main.js +2 -1
- package/lib/sdk.d.ts +1202 -1072
- package/lib/services/debank/fetcher.js +1 -1
- package/lib/services/subgraph/vaults.d.ts +18 -1
- package/lib/services/subgraph/vaults.js +19 -3
- package/lib/types/vaults.d.ts +5 -0
- package/package.json +1 -1
|
@@ -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), {
|
|
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
|
-
|
|
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
|
-
|
|
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 =
|
|
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) {
|
package/lib/types/vaults.d.ts
CHANGED
|
@@ -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
|