@augustdigital/sdk 9.3.0 → 9.5.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.
- package/lib/adapters/evm/getters.js +40 -0
- package/lib/adapters/evm/index.d.ts +106 -2
- package/lib/adapters/evm/index.js +125 -0
- package/lib/adapters/solana/index.d.ts +12 -5
- package/lib/adapters/solana/index.js +12 -4
- package/lib/adapters/solana/pricing.d.ts +173 -0
- package/lib/adapters/solana/pricing.js +223 -0
- package/lib/adapters/solana/types.d.ts +45 -0
- package/lib/adapters/solana/vault.actions.d.ts +33 -8
- package/lib/adapters/solana/vault.actions.js +185 -28
- package/lib/adapters/stellar/actions.d.ts +2 -2
- package/lib/adapters/stellar/actions.js +2 -2
- package/lib/adapters/stellar/getters.d.ts +1 -1
- package/lib/adapters/stellar/getters.js +2 -2
- package/lib/adapters/stellar/index.d.ts +1 -1
- package/lib/adapters/stellar/index.js +1 -1
- package/lib/adapters/stellar/types.d.ts +1 -2
- package/lib/core/analytics/method-taxonomy.js +7 -0
- package/lib/core/analytics/version.d.ts +1 -1
- package/lib/core/analytics/version.js +1 -1
- package/lib/core/base.class.d.ts +2 -2
- package/lib/core/base.class.js +2 -2
- package/lib/core/constants/core.d.ts +17 -3
- package/lib/core/constants/core.js +17 -3
- package/lib/core/constants/vaults.js +4 -0
- package/lib/core/fetcher.js +112 -45
- package/lib/core/helpers/concurrency.d.ts +37 -0
- package/lib/core/helpers/concurrency.js +58 -0
- package/lib/core/helpers/core.d.ts +9 -0
- package/lib/core/helpers/core.js +47 -0
- package/lib/core/helpers/vaults.d.ts +1 -1
- package/lib/core/helpers/vaults.js +1 -1
- package/lib/core/helpers/web3.js +14 -1
- package/lib/core/logger/curator-alert.d.ts +2 -2
- package/lib/core/logger/curator-alert.js +2 -2
- package/lib/evm/methods/crossChainVaultRegistry.d.ts +2 -3
- package/lib/evm/methods/crossChainVaultRegistry.js +2 -3
- package/lib/evm/types/crossChain.d.ts +1 -1
- package/lib/main.d.ts +7 -5
- package/lib/main.js +7 -5
- package/lib/modules/vaults/getters.d.ts +10 -3
- package/lib/modules/vaults/getters.js +205 -71
- package/lib/modules/vaults/main.d.ts +4 -4
- package/lib/modules/vaults/main.js +7 -4
- package/lib/modules/vaults/read.actions.d.ts +181 -0
- package/lib/modules/vaults/read.actions.js +331 -36
- package/lib/modules/vaults/types.d.ts +13 -0
- package/lib/modules/vaults/utils.js +5 -1
- package/lib/modules/vaults/write.actions.d.ts +74 -6
- package/lib/modules/vaults/write.actions.js +133 -23
- package/lib/sdk.d.ts +9830 -9342
- package/lib/services/debank/utils.js +6 -5
- package/lib/services/subgraph/schema.d.ts +1 -1
- package/lib/services/subgraph/schema.js +1 -1
- package/lib/types/pools.d.ts +1 -1
- package/lib/types/vaults.d.ts +7 -4
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@ exports.getVaultExposure = getVaultExposure;
|
|
|
5
5
|
exports.parseLoanLevelDebank = parseLoanLevelDebank;
|
|
6
6
|
const core_1 = require("../../core");
|
|
7
7
|
const core_2 = require("../../core/helpers/core");
|
|
8
|
-
function addToTokenExposure(token, tokenExposure, exposureType, protocol, exposurePerCategory, netValue, borrower) {
|
|
8
|
+
function addToTokenExposure(token, tokenExposure, exposureType, protocol, exposurePerCategory, netValue, borrower, poolId) {
|
|
9
9
|
const usdAmount = Number(token?.price || 0) * Number(token?.amount);
|
|
10
10
|
if (exposureType === 'wallet'
|
|
11
11
|
? !(0, core_2.filterOutBySize)(usdAmount)
|
|
@@ -33,6 +33,7 @@ function addToTokenExposure(token, tokenExposure, exposureType, protocol, exposu
|
|
|
33
33
|
amount: usdAmount,
|
|
34
34
|
protocol: protocol,
|
|
35
35
|
exposureType: exposureType,
|
|
36
|
+
poolId: poolId,
|
|
36
37
|
};
|
|
37
38
|
if (exposureType === 'wallet') {
|
|
38
39
|
exposurePerCategory.wallet.push(protoReturnObj);
|
|
@@ -96,7 +97,7 @@ function parseVaultLevelDebank(debankRes, protocolExposure, tokenExposure, borro
|
|
|
96
97
|
existingArray.push(sup.symbol);
|
|
97
98
|
}
|
|
98
99
|
// add token to vault "token exposure"
|
|
99
|
-
addToTokenExposure(sup, tokenExposure, 'supply', pos.id, exposurePerCategory, netValue, borrower);
|
|
100
|
+
addToTokenExposure(sup, tokenExposure, 'supply', pos.id, exposurePerCategory, netValue, borrower, item?.pool?.id);
|
|
100
101
|
// add token image url to token mapping for display
|
|
101
102
|
if (sup?.symbol && sup?.logo_url) {
|
|
102
103
|
tokenMap[sup.symbol] = sup.logo_url;
|
|
@@ -105,7 +106,7 @@ function parseVaultLevelDebank(debankRes, protocolExposure, tokenExposure, borro
|
|
|
105
106
|
});
|
|
106
107
|
item.detail.borrow_token_list.forEach((bor) => {
|
|
107
108
|
// add token to vault "token exposure"
|
|
108
|
-
addToTokenExposure(bor, tokenExposure, 'borrow', pos.id, exposurePerCategory, netValue, borrower);
|
|
109
|
+
addToTokenExposure(bor, tokenExposure, 'borrow', pos.id, exposurePerCategory, netValue, borrower, item?.pool?.id);
|
|
109
110
|
// add token image url to token mapping for display
|
|
110
111
|
if (bor?.symbol && bor?.logo_url) {
|
|
111
112
|
tokenMap[bor.symbol] = bor.logo_url;
|
|
@@ -149,13 +150,13 @@ function parseVaultLevelDebank(debankRes, protocolExposure, tokenExposure, borro
|
|
|
149
150
|
}
|
|
150
151
|
pos?.portfolio_item_list?.forEach((item) => {
|
|
151
152
|
(item?.detail?.supply_token_list || []).forEach((sup) => {
|
|
152
|
-
addToTokenExposure(sup, tokenExposure, 'supply', pos.id, exposurePerCategory, netValue, borrower);
|
|
153
|
+
addToTokenExposure(sup, tokenExposure, 'supply', pos.id, exposurePerCategory, netValue, borrower, item?.pool?.id);
|
|
153
154
|
if (sup?.symbol && sup?.logo_url) {
|
|
154
155
|
tokenMap[sup.symbol] = sup.logo_url;
|
|
155
156
|
}
|
|
156
157
|
});
|
|
157
158
|
(item?.detail?.borrow_token_list || []).forEach((bor) => {
|
|
158
|
-
addToTokenExposure(bor, tokenExposure, 'borrow', pos.id, exposurePerCategory, netValue, borrower);
|
|
159
|
+
addToTokenExposure(bor, tokenExposure, 'borrow', pos.id, exposurePerCategory, netValue, borrower, item?.pool?.id);
|
|
159
160
|
if (bor?.symbol && bor?.logo_url) {
|
|
160
161
|
tokenMap[bor.symbol] = bor.logo_url;
|
|
161
162
|
}
|
|
@@ -28,7 +28,7 @@ export declare function isSubgraphSchemaFieldError(errors: {
|
|
|
28
28
|
* `august-citrea-earn-ctusd`). A wrong guess made every subgraph read query
|
|
29
29
|
* non-existent field names, so the subgraph returned GraphQL errors with no
|
|
30
30
|
* `data` and the SDK silently returned empty sets — emptying the Pending
|
|
31
|
-
* Withdrawals and History tabs for that vault
|
|
31
|
+
* Withdrawals and History tabs for that vault.
|
|
32
32
|
*
|
|
33
33
|
* Because the schema is immutable for a fixed subgraph deployment, the result is
|
|
34
34
|
* cached per URL ({@link SCHEMA_TTL_MS}); across a page's positions/history/
|
|
@@ -28,7 +28,7 @@ function isSubgraphSchemaFieldError(errors) {
|
|
|
28
28
|
* `august-citrea-earn-ctusd`). A wrong guess made every subgraph read query
|
|
29
29
|
* non-existent field names, so the subgraph returned GraphQL errors with no
|
|
30
30
|
* `data` and the SDK silently returned empty sets — emptying the Pending
|
|
31
|
-
* Withdrawals and History tabs for that vault
|
|
31
|
+
* Withdrawals and History tabs for that vault.
|
|
32
32
|
*
|
|
33
33
|
* Because the schema is immutable for a fixed subgraph deployment, the result is
|
|
34
34
|
* cached per URL ({@link SCHEMA_TTL_MS}); across a page's positions/history/
|
package/lib/types/pools.d.ts
CHANGED
|
@@ -111,7 +111,7 @@ export type IPoolWithPositions = IPoolWithUnderlying & {
|
|
|
111
111
|
redeemable: INormalizedNumber;
|
|
112
112
|
walletBalance: string;
|
|
113
113
|
};
|
|
114
|
-
export type IPoolFunctions = 'decimals' | 'symbol' | 'name' | 'asset' | 'totalSupply' | 'maxSupply' | 'totalAssets' | 'globalLoansAmount' | 'loansOperator' | 'getTotalLoansDeployed' | 'withdrawalFee' | 'lagDuration' | 'withdrawalsPaused' | 'assetsWhitelistAddress' | 'getWhitelistedAssets' | 'maxDepositAmount' | 'getTotalAssets' | 'lpTokenAddress' | 'depositCap';
|
|
114
|
+
export type IPoolFunctions = 'decimals' | 'symbol' | 'name' | 'asset' | 'totalSupply' | 'maxSupply' | 'totalAssets' | 'globalLoansAmount' | 'loansOperator' | 'getTotalLoansDeployed' | 'withdrawalFee' | 'lagDuration' | 'withdrawalsPaused' | 'depositsPaused' | 'assetsWhitelistAddress' | 'getWhitelistedAssets' | 'maxDepositAmount' | 'getTotalAssets' | 'lpTokenAddress' | 'depositCap';
|
|
115
115
|
export type IPoolAction = 'deposit' | 'withdraw' | 'claim' | 'stake' | 'getReward' | 'unstake';
|
|
116
116
|
export type IPoolModal = {
|
|
117
117
|
isOpen: boolean;
|
package/lib/types/vaults.d.ts
CHANGED
|
@@ -114,6 +114,9 @@ export type IVaultExposureItem = {
|
|
|
114
114
|
name: string;
|
|
115
115
|
protocol?: string;
|
|
116
116
|
symbol: string;
|
|
117
|
+
/** DeBank `pool.id` of the portfolio item the token belongs to — tells
|
|
118
|
+
* apart two positions in the same protocol holding the same token. */
|
|
119
|
+
poolId?: string;
|
|
117
120
|
};
|
|
118
121
|
export type IExposurePerCategory = {
|
|
119
122
|
borrowing: IVaultExposureItem[];
|
|
@@ -176,7 +179,7 @@ export interface IVaultAllocations {
|
|
|
176
179
|
*
|
|
177
180
|
* This is stated explicitly because the convention going undocumented let a
|
|
178
181
|
* consumer scale a subset of these fields twice, making them contribute 1/100th of
|
|
179
|
-
* their value to a displayed total
|
|
182
|
+
* their value to a displayed total. The unit is uniform here by
|
|
180
183
|
* design; treating some of these fields as decimals and others as percentages is
|
|
181
184
|
* always a bug on the consumer side.
|
|
182
185
|
*/
|
|
@@ -467,16 +470,16 @@ export interface IVaultPnl {
|
|
|
467
470
|
* Supported Vaults: cUSDO, tETH, wstETH, rsETH
|
|
468
471
|
*
|
|
469
472
|
* @deprecated The `hgETH30dLiquidAPY` and `hgETH7dLiquidAPY` fields are deprecated.
|
|
470
|
-
* These fields will be removed
|
|
473
|
+
* These fields will be removed in the next major release.
|
|
471
474
|
* Use `liquidAPY30Day` and `liquidAPY7Day` fields instead.
|
|
472
475
|
*/
|
|
473
476
|
export interface IVaultAnnualizedApy {
|
|
474
477
|
vaultAddress: IAddress;
|
|
475
478
|
liquidityApy: number;
|
|
476
479
|
annualizedApy: number;
|
|
477
|
-
/** @deprecated Use `liquidAPY7Day` instead. Will be removed
|
|
480
|
+
/** @deprecated Use `liquidAPY7Day` instead. Will be removed in the next major release. */
|
|
478
481
|
hgETH7dLiquidAPY?: number;
|
|
479
|
-
/** @deprecated Use `liquidAPY30Day` instead. Will be removed
|
|
482
|
+
/** @deprecated Use `liquidAPY30Day` instead. Will be removed in the next major release. */
|
|
480
483
|
hgETH30dLiquidAPY?: number;
|
|
481
484
|
liquidAPY7Day?: number;
|
|
482
485
|
liquidAPY30Day?: number;
|