upshift-sdk 8.20.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/LICENSE +21 -0
- package/README.md +349 -0
- package/lib/abis/AddressResolver.d.ts +28 -0
- package/lib/abis/AddressResolver.js +23 -0
- package/lib/abis/ChainlinkV3.d.ts +87 -0
- package/lib/abis/ChainlinkV3.js +117 -0
- package/lib/abis/ERC20.d.ts +168 -0
- package/lib/abis/ERC20.js +226 -0
- package/lib/abis/ERC20_Bytes32.d.ts +139 -0
- package/lib/abis/ERC20_Bytes32.js +196 -0
- package/lib/abis/ERC4626.d.ts +364 -0
- package/lib/abis/ERC4626.js +507 -0
- package/lib/abis/ERC721.d.ts +231 -0
- package/lib/abis/ERC721.js +321 -0
- package/lib/abis/FeeOracle.d.ts +120 -0
- package/lib/abis/FeeOracle.js +162 -0
- package/lib/abis/LendingPool.d.ts +1393 -0
- package/lib/abis/LendingPool.js +1807 -0
- package/lib/abis/LendingPoolV2.d.ts +1413 -0
- package/lib/abis/LendingPoolV2.js +1833 -0
- package/lib/abis/LendingPoolV3.d.ts +1677 -0
- package/lib/abis/LendingPoolV3.js +1160 -0
- package/lib/abis/Loan.d.ts +837 -0
- package/lib/abis/Loan.js +1080 -0
- package/lib/abis/MultiAssetNativeDepositWrapper.d.ts +137 -0
- package/lib/abis/MultiAssetNativeDepositWrapper.js +125 -0
- package/lib/abis/Multicall3.d.ts +30 -0
- package/lib/abis/Multicall3.js +97 -0
- package/lib/abis/OFT.d.ts +116 -0
- package/lib/abis/OFT.js +85 -0
- package/lib/abis/PoolAdapter.d.ts +36 -0
- package/lib/abis/PoolAdapter.js +51 -0
- package/lib/abis/RewardDistributor.d.ts +267 -0
- package/lib/abis/RewardDistributor.js +352 -0
- package/lib/abis/RwaRedeemSubaccount.d.ts +747 -0
- package/lib/abis/RwaRedeemSubaccount.js +548 -0
- package/lib/abis/SmartAccount.d.ts +17 -0
- package/lib/abis/SmartAccount.js +19 -0
- package/lib/abis/SwapRouter.d.ts +1043 -0
- package/lib/abis/SwapRouter.js +740 -0
- package/lib/abis/TextResolver.d.ts +16 -0
- package/lib/abis/TextResolver.js +16 -0
- package/lib/abis/TokenizedVaultV2.d.ts +1364 -0
- package/lib/abis/TokenizedVaultV2.js +1041 -0
- package/lib/abis/TokenizedVaultV2DepositWithPermit.d.ts +1456 -0
- package/lib/abis/TokenizedVaultV2DepositWithPermit.js +1878 -0
- package/lib/abis/TokenizedVaultV2Receipt.d.ts +1568 -0
- package/lib/abis/TokenizedVaultV2Receipt.js +1061 -0
- package/lib/abis/TokenizedVaultV2SenderAllocationWhitelist.d.ts +454 -0
- package/lib/abis/TokenizedVaultV2SenderAllocationWhitelist.js +327 -0
- package/lib/abis/TokenizedVaultV2WhitelistedAllocation.d.ts +1466 -0
- package/lib/abis/TokenizedVaultV2WhitelistedAllocation.js +1092 -0
- package/lib/abis/TokenizedVaultV2WhitelistedAssets.d.ts +274 -0
- package/lib/abis/TokenizedVaultV2WhitelistedAssets.js +167 -0
- package/lib/abis/UniversalResolverResolve.d.ts +69 -0
- package/lib/abis/UniversalResolverResolve.js +35 -0
- package/lib/abis/UniversalSignatureValidator.d.ts +17 -0
- package/lib/abis/UniversalSignatureValidator.js +30 -0
- package/lib/abis/WrapperAdapter.d.ts +71 -0
- package/lib/abis/WrapperAdapter.js +77 -0
- package/lib/abis/index.d.ts +34 -0
- package/lib/abis/index.js +51 -0
- package/lib/adapters/evm/getters.d.ts +19 -0
- package/lib/adapters/evm/getters.js +209 -0
- package/lib/adapters/evm/index.d.ts +353 -0
- package/lib/adapters/evm/index.js +434 -0
- package/lib/adapters/evm/utils.d.ts +8 -0
- package/lib/adapters/evm/utils.js +51 -0
- package/lib/adapters/solana/constants.d.ts +33 -0
- package/lib/adapters/solana/constants.js +52 -0
- package/lib/adapters/solana/getters.d.ts +11 -0
- package/lib/adapters/solana/getters.js +165 -0
- package/lib/adapters/solana/idl/vault-idl.d.ts +272 -0
- package/lib/adapters/solana/idl/vault-idl.js +1084 -0
- package/lib/adapters/solana/index.d.ts +233 -0
- package/lib/adapters/solana/index.js +291 -0
- package/lib/adapters/solana/types.d.ts +67 -0
- package/lib/adapters/solana/types.js +3 -0
- package/lib/adapters/solana/utils.d.ts +141 -0
- package/lib/adapters/solana/utils.js +595 -0
- package/lib/adapters/solana/vault.actions.d.ts +57 -0
- package/lib/adapters/solana/vault.actions.js +379 -0
- package/lib/adapters/stellar/actions.d.ts +28 -0
- package/lib/adapters/stellar/actions.js +77 -0
- package/lib/adapters/stellar/constants.d.ts +43 -0
- package/lib/adapters/stellar/constants.js +53 -0
- package/lib/adapters/stellar/getters.d.ts +68 -0
- package/lib/adapters/stellar/getters.js +290 -0
- package/lib/adapters/stellar/index.d.ts +114 -0
- package/lib/adapters/stellar/index.js +175 -0
- package/lib/adapters/stellar/soroban.d.ts +123 -0
- package/lib/adapters/stellar/soroban.js +613 -0
- package/lib/adapters/stellar/submit.d.ts +34 -0
- package/lib/adapters/stellar/submit.js +149 -0
- package/lib/adapters/stellar/types.d.ts +58 -0
- package/lib/adapters/stellar/types.js +6 -0
- package/lib/adapters/stellar/utils.d.ts +24 -0
- package/lib/adapters/stellar/utils.js +34 -0
- package/lib/adapters/sui/constants.d.ts +14 -0
- package/lib/adapters/sui/constants.js +29 -0
- package/lib/adapters/sui/getters.d.ts +9 -0
- package/lib/adapters/sui/getters.js +60 -0
- package/lib/adapters/sui/index.d.ts +45 -0
- package/lib/adapters/sui/index.js +101 -0
- package/lib/adapters/sui/transformer.d.ts +10 -0
- package/lib/adapters/sui/transformer.js +107 -0
- package/lib/adapters/sui/types.d.ts +66 -0
- package/lib/adapters/sui/types.js +3 -0
- package/lib/adapters/sui/utils.d.ts +10 -0
- package/lib/adapters/sui/utils.js +29 -0
- package/lib/core/analytics/chain-name.d.ts +9 -0
- package/lib/core/analytics/chain-name.js +34 -0
- package/lib/core/analytics/constants.d.ts +5 -0
- package/lib/core/analytics/constants.js +9 -0
- package/lib/core/analytics/env.d.ts +29 -0
- package/lib/core/analytics/env.js +59 -0
- package/lib/core/analytics/index.d.ts +36 -0
- package/lib/core/analytics/index.js +79 -0
- package/lib/core/analytics/instrumentation.d.ts +29 -0
- package/lib/core/analytics/instrumentation.js +277 -0
- package/lib/core/analytics/method-taxonomy.d.ts +19 -0
- package/lib/core/analytics/method-taxonomy.js +128 -0
- package/lib/core/analytics/metrics.d.ts +33 -0
- package/lib/core/analytics/metrics.js +116 -0
- package/lib/core/analytics/sanitize.d.ts +44 -0
- package/lib/core/analytics/sanitize.js +260 -0
- package/lib/core/analytics/sentry-runtime.d.ts +15 -0
- package/lib/core/analytics/sentry-runtime.js +97 -0
- package/lib/core/analytics/sentry.d.ts +67 -0
- package/lib/core/analytics/sentry.js +613 -0
- package/lib/core/analytics/types.d.ts +48 -0
- package/lib/core/analytics/types.js +3 -0
- package/lib/core/analytics/user-identity.d.ts +41 -0
- package/lib/core/analytics/user-identity.js +141 -0
- package/lib/core/analytics/version.d.ts +6 -0
- package/lib/core/analytics/version.js +10 -0
- package/lib/core/attribution.d.ts +111 -0
- package/lib/core/attribution.js +142 -0
- package/lib/core/auth/index.d.ts +1 -0
- package/lib/core/auth/index.js +18 -0
- package/lib/core/auth/verify.d.ts +2 -0
- package/lib/core/auth/verify.js +31 -0
- package/lib/core/base.class.d.ts +152 -0
- package/lib/core/base.class.js +172 -0
- package/lib/core/cache.d.ts +9 -0
- package/lib/core/cache.js +31 -0
- package/lib/core/constants/adapters.d.ts +103 -0
- package/lib/core/constants/adapters.js +180 -0
- package/lib/core/constants/core.d.ts +133 -0
- package/lib/core/constants/core.js +209 -0
- package/lib/core/constants/swap-router.d.ts +150 -0
- package/lib/core/constants/swap-router.js +169 -0
- package/lib/core/constants/vaults.d.ts +93 -0
- package/lib/core/constants/vaults.js +273 -0
- package/lib/core/constants/web3.d.ts +91 -0
- package/lib/core/constants/web3.js +229 -0
- package/lib/core/errors/index.d.ts +114 -0
- package/lib/core/errors/index.js +183 -0
- package/lib/core/fetcher.d.ts +198 -0
- package/lib/core/fetcher.js +903 -0
- package/lib/core/helpers/adapters.d.ts +13 -0
- package/lib/core/helpers/adapters.js +39 -0
- package/lib/core/helpers/chain-address.d.ts +13 -0
- package/lib/core/helpers/chain-address.js +47 -0
- package/lib/core/helpers/chain-error.d.ts +207 -0
- package/lib/core/helpers/chain-error.js +682 -0
- package/lib/core/helpers/chain-support.d.ts +80 -0
- package/lib/core/helpers/chain-support.js +115 -0
- package/lib/core/helpers/core.d.ts +68 -0
- package/lib/core/helpers/core.js +285 -0
- package/lib/core/helpers/explorer-link.d.ts +16 -0
- package/lib/core/helpers/explorer-link.js +26 -0
- package/lib/core/helpers/multicall.d.ts +68 -0
- package/lib/core/helpers/multicall.js +103 -0
- package/lib/core/helpers/revert-decode.d.ts +248 -0
- package/lib/core/helpers/revert-decode.js +515 -0
- package/lib/core/helpers/signer.d.ts +52 -0
- package/lib/core/helpers/signer.js +145 -0
- package/lib/core/helpers/swap-router.d.ts +211 -0
- package/lib/core/helpers/swap-router.js +480 -0
- package/lib/core/helpers/vault-version.d.ts +23 -0
- package/lib/core/helpers/vault-version.js +75 -0
- package/lib/core/helpers/vaults.d.ts +89 -0
- package/lib/core/helpers/vaults.js +235 -0
- package/lib/core/helpers/web3.d.ts +353 -0
- package/lib/core/helpers/web3.js +992 -0
- package/lib/core/index.d.ts +23 -0
- package/lib/core/index.js +40 -0
- package/lib/core/logger/index.d.ts +98 -0
- package/lib/core/logger/index.js +144 -0
- package/lib/core/logger/slack.d.ts +16 -0
- package/lib/core/logger/slack.js +57 -0
- package/lib/core/vault-metadata.d.ts +12 -0
- package/lib/core/vault-metadata.js +42 -0
- package/lib/core/version-check.d.ts +58 -0
- package/lib/core/version-check.js +182 -0
- package/lib/evm/index.d.ts +2 -0
- package/lib/evm/index.js +19 -0
- package/lib/evm/methods/crossChainVault.d.ts +128 -0
- package/lib/evm/methods/crossChainVault.js +853 -0
- package/lib/evm/methods/crossChainVaultRegistry.d.ts +93 -0
- package/lib/evm/methods/crossChainVaultRegistry.js +240 -0
- package/lib/evm/methods/index.d.ts +2 -0
- package/lib/evm/methods/index.js +19 -0
- package/lib/evm/types/crossChain.d.ts +363 -0
- package/lib/evm/types/crossChain.js +20 -0
- package/lib/evm/types/index.d.ts +1 -0
- package/lib/evm/types/index.js +18 -0
- package/lib/index.d.ts +30 -0
- package/lib/index.js +52 -0
- package/lib/main.d.ts +527 -0
- package/lib/main.js +601 -0
- package/lib/modules/api/fetcher.d.ts +82 -0
- package/lib/modules/api/fetcher.js +150 -0
- package/lib/modules/api/index.d.ts +1 -0
- package/lib/modules/api/index.js +6 -0
- package/lib/modules/api/main.d.ts +313 -0
- package/lib/modules/api/main.js +479 -0
- package/lib/modules/sub-accounts/fetcher.d.ts +53 -0
- package/lib/modules/sub-accounts/fetcher.js +120 -0
- package/lib/modules/sub-accounts/index.d.ts +2 -0
- package/lib/modules/sub-accounts/index.js +19 -0
- package/lib/modules/sub-accounts/main.d.ts +243 -0
- package/lib/modules/sub-accounts/main.js +205 -0
- package/lib/modules/sub-accounts/utils.d.ts +106 -0
- package/lib/modules/sub-accounts/utils.js +112 -0
- package/lib/modules/vaults/adapter.helpers.d.ts +64 -0
- package/lib/modules/vaults/adapter.helpers.js +184 -0
- package/lib/modules/vaults/fetcher.d.ts +147 -0
- package/lib/modules/vaults/fetcher.js +368 -0
- package/lib/modules/vaults/getters.d.ts +570 -0
- package/lib/modules/vaults/getters.js +3051 -0
- package/lib/modules/vaults/index.d.ts +20 -0
- package/lib/modules/vaults/index.js +44 -0
- package/lib/modules/vaults/main.d.ts +601 -0
- package/lib/modules/vaults/main.js +1623 -0
- package/lib/modules/vaults/prefetch.d.ts +65 -0
- package/lib/modules/vaults/prefetch.js +120 -0
- package/lib/modules/vaults/read.actions.d.ts +225 -0
- package/lib/modules/vaults/read.actions.js +596 -0
- package/lib/modules/vaults/types.d.ts +71 -0
- package/lib/modules/vaults/types.js +3 -0
- package/lib/modules/vaults/utils/call-data-decoder.d.ts +61 -0
- package/lib/modules/vaults/utils/call-data-decoder.js +194 -0
- package/lib/modules/vaults/utils/date-utils.d.ts +50 -0
- package/lib/modules/vaults/utils/date-utils.js +84 -0
- package/lib/modules/vaults/utils.d.ts +140 -0
- package/lib/modules/vaults/utils.js +799 -0
- package/lib/modules/vaults/write.actions.d.ts +529 -0
- package/lib/modules/vaults/write.actions.js +1749 -0
- package/lib/polyfills.d.ts +1 -0
- package/lib/polyfills.js +12 -0
- package/lib/sdk.d.ts +26721 -0
- package/lib/services/coingecko/fetcher.d.ts +15 -0
- package/lib/services/coingecko/fetcher.js +67 -0
- package/lib/services/coingecko/index.d.ts +2 -0
- package/lib/services/coingecko/index.js +19 -0
- package/lib/services/coingecko/utils.d.ts +1 -0
- package/lib/services/coingecko/utils.js +24 -0
- package/lib/services/debank/fetcher.d.ts +126 -0
- package/lib/services/debank/fetcher.js +47 -0
- package/lib/services/debank/index.d.ts +2 -0
- package/lib/services/debank/index.js +19 -0
- package/lib/services/debank/utils.d.ts +38 -0
- package/lib/services/debank/utils.js +297 -0
- package/lib/services/layerzero/deposits.d.ts +49 -0
- package/lib/services/layerzero/deposits.js +166 -0
- package/lib/services/layerzero/redeems.d.ts +20 -0
- package/lib/services/layerzero/redeems.js +92 -0
- package/lib/services/layerzero/utils.d.ts +9 -0
- package/lib/services/layerzero/utils.js +22 -0
- package/lib/services/octavfi/fetcher.d.ts +9 -0
- package/lib/services/octavfi/fetcher.js +103 -0
- package/lib/services/octavfi/index.d.ts +3 -0
- package/lib/services/octavfi/index.js +20 -0
- package/lib/services/octavfi/types.d.ts +34 -0
- package/lib/services/octavfi/types.js +3 -0
- package/lib/services/octavfi/utils.d.ts +16 -0
- package/lib/services/octavfi/utils.js +212 -0
- package/lib/services/subgraph/fetcher.d.ts +2 -0
- package/lib/services/subgraph/fetcher.js +61 -0
- package/lib/services/subgraph/index.d.ts +2 -0
- package/lib/services/subgraph/index.js +19 -0
- package/lib/services/subgraph/schema.d.ts +45 -0
- package/lib/services/subgraph/schema.js +75 -0
- package/lib/services/subgraph/vaults.d.ts +25 -0
- package/lib/services/subgraph/vaults.js +1106 -0
- package/lib/services/swap-quotes/index.d.ts +105 -0
- package/lib/services/swap-quotes/index.js +77 -0
- package/lib/services/swap-quotes/paraswap.d.ts +51 -0
- package/lib/services/swap-quotes/paraswap.js +138 -0
- package/lib/types/api.d.ts +280 -0
- package/lib/types/api.js +3 -0
- package/lib/types/index.d.ts +12 -0
- package/lib/types/index.js +28 -0
- package/lib/types/points.d.ts +28 -0
- package/lib/types/points.js +3 -0
- package/lib/types/pools.d.ts +144 -0
- package/lib/types/pools.js +3 -0
- package/lib/types/staking.d.ts +28 -0
- package/lib/types/staking.js +3 -0
- package/lib/types/sub-accounts.d.ts +140 -0
- package/lib/types/sub-accounts.js +3 -0
- package/lib/types/subgraph.d.ts +74 -0
- package/lib/types/subgraph.js +3 -0
- package/lib/types/typed-contract.d.ts +102 -0
- package/lib/types/typed-contract.js +3 -0
- package/lib/types/user.d.ts +1 -0
- package/lib/types/user.js +3 -0
- package/lib/types/vaults.d.ts +714 -0
- package/lib/types/vaults.js +24 -0
- package/lib/types/web3.d.ts +51 -0
- package/lib/types/web3.js +14 -0
- package/lib/types/webserver.d.ts +698 -0
- package/lib/types/webserver.js +3 -0
- package/package.json +78 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Export getters
|
|
3
|
+
*/
|
|
4
|
+
export * from './getters';
|
|
5
|
+
export * from './utils';
|
|
6
|
+
/**
|
|
7
|
+
* AugustVaults class
|
|
8
|
+
*/
|
|
9
|
+
export * from './main';
|
|
10
|
+
/**
|
|
11
|
+
* Export points-related functions
|
|
12
|
+
*/
|
|
13
|
+
export { getUserPoints, registerUserForPoints, fetchPointsLeaderboard, getYieldLastRealizedOn, } from './getters';
|
|
14
|
+
export { fetchVaultMetadata } from './fetcher';
|
|
15
|
+
export { getRewardMultiplierByTimestamp } from './utils';
|
|
16
|
+
/**
|
|
17
|
+
* Export write/read actions
|
|
18
|
+
*/
|
|
19
|
+
export * from './write.actions';
|
|
20
|
+
export * from './read.actions';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.getRewardMultiplierByTimestamp = exports.fetchVaultMetadata = exports.getYieldLastRealizedOn = exports.fetchPointsLeaderboard = exports.registerUserForPoints = exports.getUserPoints = void 0;
|
|
18
|
+
/**
|
|
19
|
+
* Export getters
|
|
20
|
+
*/
|
|
21
|
+
__exportStar(require("./getters"), exports);
|
|
22
|
+
__exportStar(require("./utils"), exports);
|
|
23
|
+
/**
|
|
24
|
+
* AugustVaults class
|
|
25
|
+
*/
|
|
26
|
+
__exportStar(require("./main"), exports);
|
|
27
|
+
/**
|
|
28
|
+
* Export points-related functions
|
|
29
|
+
*/
|
|
30
|
+
var getters_1 = require("./getters");
|
|
31
|
+
Object.defineProperty(exports, "getUserPoints", { enumerable: true, get: function () { return getters_1.getUserPoints; } });
|
|
32
|
+
Object.defineProperty(exports, "registerUserForPoints", { enumerable: true, get: function () { return getters_1.registerUserForPoints; } });
|
|
33
|
+
Object.defineProperty(exports, "fetchPointsLeaderboard", { enumerable: true, get: function () { return getters_1.fetchPointsLeaderboard; } });
|
|
34
|
+
Object.defineProperty(exports, "getYieldLastRealizedOn", { enumerable: true, get: function () { return getters_1.getYieldLastRealizedOn; } });
|
|
35
|
+
var fetcher_1 = require("./fetcher");
|
|
36
|
+
Object.defineProperty(exports, "fetchVaultMetadata", { enumerable: true, get: function () { return fetcher_1.fetchVaultMetadata; } });
|
|
37
|
+
var utils_1 = require("./utils");
|
|
38
|
+
Object.defineProperty(exports, "getRewardMultiplierByTimestamp", { enumerable: true, get: function () { return utils_1.getRewardMultiplierByTimestamp; } });
|
|
39
|
+
/**
|
|
40
|
+
* Export write/read actions
|
|
41
|
+
*/
|
|
42
|
+
__exportStar(require("./write.actions"), exports);
|
|
43
|
+
__exportStar(require("./read.actions"), exports);
|
|
44
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,601 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The August Vaults Module.
|
|
3
|
+
*
|
|
4
|
+
* @module AugustVaults
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Export getters
|
|
8
|
+
*/
|
|
9
|
+
export * from './getters';
|
|
10
|
+
import type { IAddress, IChainId, INormalizedNumber, IVaultHistoricalParams, IVaultPosition, IVaultUserHistoryItem } from '../../types';
|
|
11
|
+
import type SolanaAdapter from '../../adapters/solana';
|
|
12
|
+
import { AugustBase, type IAugustBase } from '../../core';
|
|
13
|
+
import SuiAdapter from '../../adapters/sui';
|
|
14
|
+
import { type IContractWriteOptions, type INativeDepositOptions } from './write.actions';
|
|
15
|
+
import type { Signer, Wallet } from 'ethers';
|
|
16
|
+
import type { IVaultBaseOptions, IVaultCustomOptions } from './types';
|
|
17
|
+
export type { IVaultBaseOptions, IVaultCustomOptions } from './types';
|
|
18
|
+
/**
|
|
19
|
+
* Vault operations class handling multi-chain vault queries and user positions.
|
|
20
|
+
* Supports both EVM and Solana vaults with unified interface.
|
|
21
|
+
*/
|
|
22
|
+
export declare class AugustVaults extends AugustBase {
|
|
23
|
+
private solanaService;
|
|
24
|
+
private suiService;
|
|
25
|
+
private headers;
|
|
26
|
+
/**
|
|
27
|
+
* Consumer-supplied Soroban RPC override for Stellar vault reads, with the
|
|
28
|
+
* network it was configured for so it's only applied to matching-network
|
|
29
|
+
* vaults (see `IVaultBaseOptions.stellarRpc`).
|
|
30
|
+
*/
|
|
31
|
+
private _stellarRpc?;
|
|
32
|
+
constructor(baseConfig: IAugustBase, solana: SolanaAdapter, sui: SuiAdapter);
|
|
33
|
+
/**
|
|
34
|
+
* @description deposit underlying token into the specified pool with adapter support. This is for when we cannot pass in a signer in sdk and need to do so as an arg
|
|
35
|
+
* @param signer signer / wallet object
|
|
36
|
+
* @param options object including pool contract address, user wallet address, string amount, and optional depositAsset
|
|
37
|
+
* @returns deposit tx hash
|
|
38
|
+
*/
|
|
39
|
+
vaultDeposit(signer: Signer | Wallet, options: IContractWriteOptions): Promise<string>;
|
|
40
|
+
/**
|
|
41
|
+
* @description deposit native token (ETH/AVAX/etc) into a vault using MultiAssetNativeDepositWrapper
|
|
42
|
+
* @param signer signer / wallet object
|
|
43
|
+
* @param options object including wrapper contract address, receiver address (optional), and amount
|
|
44
|
+
* @returns deposit tx hash
|
|
45
|
+
*/
|
|
46
|
+
depositNative(signer: Signer | Wallet, options: INativeDepositOptions): Promise<string>;
|
|
47
|
+
/**
|
|
48
|
+
* Fetch all vaults across configured networks with optional enrichment.
|
|
49
|
+
* Automatically filters by available providers and optionally by chain IDs.
|
|
50
|
+
* Includes closed vaults that are still visible (`status: 'closed'`,
|
|
51
|
+
* `is_visible: true`) so consumers can render positions held in closed
|
|
52
|
+
* vaults; closed vaults with `is_visible: false` are excluded.
|
|
53
|
+
*
|
|
54
|
+
* RPC volume (worst case, wallet enrichment path): the per-vault
|
|
55
|
+
* `balanceOf`/`lagDuration` reads are aggregated into chunked Multicall3
|
|
56
|
+
* `aggregate3` batches per chain (10 calls per chunk) on chains where the
|
|
57
|
+
* canonical Multicall3 deployment is verified; other chains (e.g. Citrea
|
|
58
|
+
* 4114) keep one `eth_call` per read. Measured with
|
|
59
|
+
* `benchmarks/request-counter.js` on a cold cache for a wallet with 62
|
|
60
|
+
* vaults across Ethereum + Avalanche: 83 RPC HTTP requests before batching,
|
|
61
|
+
* 54 after (~35% fewer; 124 per-vault `eth_call`s collapse into ~13
|
|
62
|
+
* `aggregate3` calls — the remaining requests are the per-vault cached
|
|
63
|
+
* decimals/receipt-token reads on a cold cache).
|
|
64
|
+
* @param options Filtering and enrichment configuration
|
|
65
|
+
* @returns Array of vault objects with optional loans/allocations/positions
|
|
66
|
+
*/
|
|
67
|
+
getVaults(options?: {
|
|
68
|
+
chainIds?: number[];
|
|
69
|
+
loadSubaccounts?: boolean;
|
|
70
|
+
loadSnapshots?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Portfolio mode: include closed vaults in the result.
|
|
73
|
+
*
|
|
74
|
+
* By default (`false`) closed vaults are excluded, so marketplace /
|
|
75
|
+
* discovery callers never receive a `status: 'closed'` vault. When set,
|
|
76
|
+
* closed vaults are returned regardless of `is_visible` (closed +
|
|
77
|
+
* invisible vaults bucket as closed), so a consumer joining user
|
|
78
|
+
* positions can render a position held in a closed vault on the
|
|
79
|
+
* portfolio page.
|
|
80
|
+
*
|
|
81
|
+
* In this mode, loans/allocations enrichment is also skipped for closed
|
|
82
|
+
* vaults: they have none, and the per-vault enrichment
|
|
83
|
+
* (`getVault` → `getVaultAllocations`) otherwise re-throws when a closed
|
|
84
|
+
* vault has no live strategy/debank data or no subaccounts, which would
|
|
85
|
+
* land the vault in the `failed` bucket and silently drop it before it
|
|
86
|
+
* reaches the filter. Skipping enrichment lets the vault survive on its
|
|
87
|
+
* backend metadata + base on-chain read.
|
|
88
|
+
*
|
|
89
|
+
* @default false
|
|
90
|
+
*/
|
|
91
|
+
includeClosed?: boolean;
|
|
92
|
+
} & IVaultCustomOptions): Promise<import("../../types").IVault[]>;
|
|
93
|
+
/**
|
|
94
|
+
* Calculate total deposited across all tokenized vaults by summing latest_reported_tvl.
|
|
95
|
+
* Uses the /tokenized_vault endpoint which returns latest_reported_tvl in USD.
|
|
96
|
+
* @param options Optional configuration for loading vaults
|
|
97
|
+
* @returns Total deposited amount in USD (sum of all latest_reported_tvl values)
|
|
98
|
+
*/
|
|
99
|
+
getTotalDeposited(options?: {
|
|
100
|
+
loadSubaccounts?: boolean;
|
|
101
|
+
loadSnapshots?: boolean;
|
|
102
|
+
}): Promise<number>;
|
|
103
|
+
/**
|
|
104
|
+
* Fetch detailed data for a single vault with optional enrichment.
|
|
105
|
+
* Automatically includes loans and allocations unless explicitly disabled.
|
|
106
|
+
* @param vault Vault contract address
|
|
107
|
+
* @param chainId Optional chain ID (uses active network if not provided)
|
|
108
|
+
* @param options Enrichment and wallet options
|
|
109
|
+
* @returns Single vault object with optional position data
|
|
110
|
+
* @throws {@link AugustValidationError} (`INVALID_CHAIN`) when `chainId` is
|
|
111
|
+
* not a chain the SDK recognises, or is a supported EVM chain with no RPC
|
|
112
|
+
* URL configured on this SDK instance.
|
|
113
|
+
*/
|
|
114
|
+
getVault({ vault, chainId, options, loadSubaccounts, loadSnapshots, }: {
|
|
115
|
+
vault: IAddress;
|
|
116
|
+
chainId?: IChainId;
|
|
117
|
+
options?: IVaultCustomOptions;
|
|
118
|
+
loadSubaccounts?: boolean;
|
|
119
|
+
loadSnapshots?: boolean;
|
|
120
|
+
}): Promise<import("../../types").IVault>;
|
|
121
|
+
/**
|
|
122
|
+
* Fetch the active loans issued by a vault.
|
|
123
|
+
* @param vault Vault contract address
|
|
124
|
+
* @param chainId Optional chain ID (uses active network if not provided)
|
|
125
|
+
* @returns Loan data for the vault
|
|
126
|
+
* @throws {@link AugustValidationError} (`INVALID_CHAIN`) when `chainId` is
|
|
127
|
+
* not a chain the SDK recognises, or is a supported EVM chain with no RPC
|
|
128
|
+
* URL configured on this SDK instance.
|
|
129
|
+
*/
|
|
130
|
+
getVaultLoans({ vault, chainId, }: {
|
|
131
|
+
vault: IAddress;
|
|
132
|
+
chainId?: IChainId;
|
|
133
|
+
}): Promise<import("../../types").IVaultLoan[]>;
|
|
134
|
+
/**
|
|
135
|
+
* Fetch a vault's loans broken down by sub-account.
|
|
136
|
+
* @param vault Vault contract address
|
|
137
|
+
* @param chainId Optional chain ID (uses active network if not provided)
|
|
138
|
+
* @returns Sub-account loan data for the vault
|
|
139
|
+
* @throws {@link AugustValidationError} (`INVALID_CHAIN`) when `chainId` is
|
|
140
|
+
* not a chain the SDK recognises, or is a supported EVM chain with no RPC
|
|
141
|
+
* URL configured on this SDK instance.
|
|
142
|
+
*/
|
|
143
|
+
getVaultSubaccountLoans({ vault, chainId, }: {
|
|
144
|
+
vault: IAddress;
|
|
145
|
+
chainId?: IChainId;
|
|
146
|
+
}): Promise<import("../../types").IVaultLoan[]>;
|
|
147
|
+
/**
|
|
148
|
+
* Fetch a vault's DeFi / CeFi / OTC allocation breakdown.
|
|
149
|
+
* @param vault Vault contract address
|
|
150
|
+
* @param chainId Optional chain ID (uses active network if not provided)
|
|
151
|
+
* @returns Allocation data for the vault
|
|
152
|
+
* @throws {@link AugustValidationError} (`INVALID_CHAIN`) when `chainId` is
|
|
153
|
+
* not a chain the SDK recognises, or is a supported EVM chain with no RPC
|
|
154
|
+
* URL configured on this SDK instance.
|
|
155
|
+
*/
|
|
156
|
+
getVaultAllocations({ vault, chainId, }: {
|
|
157
|
+
vault: IAddress;
|
|
158
|
+
chainId?: IChainId;
|
|
159
|
+
}): Promise<import("../../types").IVaultAllocations | {
|
|
160
|
+
status: number;
|
|
161
|
+
message: string;
|
|
162
|
+
}>;
|
|
163
|
+
/**
|
|
164
|
+
* @deprecated use getVaultHistoricalTimeseries instead
|
|
165
|
+
* @function getVaultApy gets the vault/pool APR, both current and historical
|
|
166
|
+
* @param vault pool/vault contract address
|
|
167
|
+
* @param historical (optional) When passed, returns the historical records of the pool/vault APR
|
|
168
|
+
* @returns a value or array of objects containing the APR and timestamp
|
|
169
|
+
*/
|
|
170
|
+
getVaultApy({ vault, historical, }: {
|
|
171
|
+
vault: IAddress;
|
|
172
|
+
historical?: Partial<IVaultHistoricalParams>;
|
|
173
|
+
}): Promise<{
|
|
174
|
+
value: number;
|
|
175
|
+
timestamp: string;
|
|
176
|
+
}[]>;
|
|
177
|
+
/**
|
|
178
|
+
* @function getVaultHistoricalTimeseries gets historical timeseries data for a vault
|
|
179
|
+
* @param vault Vault contract address
|
|
180
|
+
* @param nDays Number of days of historical data (default 30, min 1)
|
|
181
|
+
* @returns Historical timeseries data with TVL, APY, PnL, share price, and other metrics
|
|
182
|
+
*/
|
|
183
|
+
getVaultHistoricalTimeseries({ vault, nDays, }: {
|
|
184
|
+
vault: IAddress;
|
|
185
|
+
nDays?: number;
|
|
186
|
+
}): Promise<import("../../types").IHistoricalTimeseriesResponse>;
|
|
187
|
+
/**
|
|
188
|
+
*
|
|
189
|
+
*/
|
|
190
|
+
getVaultAvailableRedemptions({ vault, chainId, wallet, verbose, }: {
|
|
191
|
+
vault: IAddress;
|
|
192
|
+
chainId?: number;
|
|
193
|
+
wallet?: IAddress;
|
|
194
|
+
verbose?: boolean;
|
|
195
|
+
}): Promise<{
|
|
196
|
+
processedWithdrawals: import("../../types").ISubgraphWithdrawProccessed[];
|
|
197
|
+
requestedWithdrawals: import("../../types").ISubgraphWithdrawRequest[];
|
|
198
|
+
availableRedemptions: import("../../types").IVaultAvailableRedemption[];
|
|
199
|
+
pendingRedemptions: import("../../types").IVaultAvailableRedemption[];
|
|
200
|
+
}>;
|
|
201
|
+
/**
|
|
202
|
+
* Historical redemption requests for a vault (settled, cancelled, and
|
|
203
|
+
* pending-but-out-of-window). Filterable by wallet.
|
|
204
|
+
*
|
|
205
|
+
* Stellar vaults return `[]` — on-chain redemption history is not yet
|
|
206
|
+
* indexed for that adapter.
|
|
207
|
+
*
|
|
208
|
+
* @param vault - Vault address (EVM or Stellar). Stellar input is
|
|
209
|
+
* accepted but always resolves to an empty array for now.
|
|
210
|
+
* @param chainId - Chain id to resolve the RPC URL against. Falls
|
|
211
|
+
* back to the active network.
|
|
212
|
+
* @param wallet - Optional EVM wallet filter; when omitted the
|
|
213
|
+
* response includes every wallet that has ever redeemed against
|
|
214
|
+
* the vault.
|
|
215
|
+
* @param lookbackBlocks - How far back to scan for redemption logs.
|
|
216
|
+
* Defaults to the SDK's internal lookback when omitted.
|
|
217
|
+
* @returns The same array shape `getVaultRedemptionHistory` returns
|
|
218
|
+
* at the module level — historical redemption records, newest
|
|
219
|
+
* first.
|
|
220
|
+
*
|
|
221
|
+
* @example
|
|
222
|
+
* ```ts
|
|
223
|
+
* const history = await sdk.vaultsModule.getVaultRedemptionHistory({
|
|
224
|
+
* vault: '0xVault',
|
|
225
|
+
* chainId: 8453,
|
|
226
|
+
* wallet: '0xWallet',
|
|
227
|
+
* });
|
|
228
|
+
* ```
|
|
229
|
+
*/
|
|
230
|
+
getVaultRedemptionHistory({ vault, chainId, wallet, lookbackBlocks, }: {
|
|
231
|
+
vault: IAddress;
|
|
232
|
+
chainId?: IChainId;
|
|
233
|
+
wallet?: IAddress;
|
|
234
|
+
lookbackBlocks?: number;
|
|
235
|
+
}): Promise<import("../../types").IVaultRedemptionHistoryItem[]>;
|
|
236
|
+
/**
|
|
237
|
+
* Fetch the wallet's positions across vaults — a single vault, one chain,
|
|
238
|
+
* or every chain with a configured provider.
|
|
239
|
+
*
|
|
240
|
+
* RPC volume (worst case, multi-vault paths): the two non-cacheable
|
|
241
|
+
* per-vault reads (`balanceOf`, `lagDuration`) are aggregated into chunked
|
|
242
|
+
* Multicall3 `aggregate3` batches per chain (10 calls per chunk) on chains
|
|
243
|
+
* where the canonical deployment is verified; unverified chains (e.g.
|
|
244
|
+
* Citrea 4114) and non-EVM vaults keep one `eth_call` per read. Measured
|
|
245
|
+
* with `benchmarks/request-counter.js` on a cold cache for a wallet with 62
|
|
246
|
+
* vaults across Ethereum + Avalanche: 83 RPC HTTP requests before batching,
|
|
247
|
+
* 54 after (~35% fewer). A vault whose batched read fails (e.g. paused)
|
|
248
|
+
* falls back to its own per-vault reads — never to a zeroed balance.
|
|
249
|
+
*/
|
|
250
|
+
getVaultPositions({ vault, wallet, chainId, showAllVaults, solanaWallet, stellarWallet, options, }: {
|
|
251
|
+
vault?: IAddress;
|
|
252
|
+
wallet?: IAddress;
|
|
253
|
+
chainId?: IChainId;
|
|
254
|
+
showAllVaults?: boolean;
|
|
255
|
+
solanaWallet?: string;
|
|
256
|
+
stellarWallet?: string;
|
|
257
|
+
options?: IVaultBaseOptions;
|
|
258
|
+
}): Promise<IVaultPosition[]>;
|
|
259
|
+
/**
|
|
260
|
+
*
|
|
261
|
+
*/
|
|
262
|
+
getUserHistory({ wallet, chainId, vault, }: {
|
|
263
|
+
wallet: IAddress;
|
|
264
|
+
chainId?: IChainId;
|
|
265
|
+
vault?: IAddress;
|
|
266
|
+
options?: IVaultBaseOptions;
|
|
267
|
+
}): Promise<IVaultUserHistoryItem[]>;
|
|
268
|
+
/**
|
|
269
|
+
* Get lifetime PnL for a user in a specific vault.
|
|
270
|
+
* @param props Vault address, wallet address, and optional chain ID
|
|
271
|
+
* @returns Lifetime PnL data including realized and unrealized PnL
|
|
272
|
+
*/
|
|
273
|
+
getVaultUserLifetimePnl({ vault, wallet, chainId, }: {
|
|
274
|
+
vault: IAddress;
|
|
275
|
+
wallet: IAddress;
|
|
276
|
+
chainId?: IChainId;
|
|
277
|
+
}): Promise<import("../../types").IVaultUserLifetimePnl>;
|
|
278
|
+
/**
|
|
279
|
+
* Get PnL for a vault (vault-level, not user-specific).
|
|
280
|
+
* Returns the vault's overall profit and loss across all users.
|
|
281
|
+
* @param props Vault address and optional chain ID
|
|
282
|
+
* @returns Vault PnL in USD and notional value
|
|
283
|
+
*/
|
|
284
|
+
getVaultPnl({ vault, chainId, }: {
|
|
285
|
+
vault: IAddress;
|
|
286
|
+
chainId?: IChainId;
|
|
287
|
+
}): Promise<import("../../types").IVaultPnl>;
|
|
288
|
+
/**
|
|
289
|
+
*
|
|
290
|
+
*/
|
|
291
|
+
getUserTransfers({ wallet, chainId, vault, options, }: {
|
|
292
|
+
wallet: IAddress;
|
|
293
|
+
chainId?: IChainId;
|
|
294
|
+
vault?: IAddress;
|
|
295
|
+
options?: IVaultBaseOptions;
|
|
296
|
+
}): Promise<{
|
|
297
|
+
id: string;
|
|
298
|
+
value: string;
|
|
299
|
+
to: string;
|
|
300
|
+
from: string;
|
|
301
|
+
pool: string;
|
|
302
|
+
block: number;
|
|
303
|
+
timestamp: number;
|
|
304
|
+
transactionHash: string;
|
|
305
|
+
}[]>;
|
|
306
|
+
/**
|
|
307
|
+
* Fetch a vault's deposit/withdrawal activity across every participant.
|
|
308
|
+
*
|
|
309
|
+
* This is the vault-wide counterpart to {@link getUserHistory}: instead of
|
|
310
|
+
* filtering the subgraph to one wallet, it returns every deposit,
|
|
311
|
+
* withdrawal-request, and processed-withdrawal event for the pool. Use it to
|
|
312
|
+
* answer flow questions ("how many deposits in the last 7 days", "net flow
|
|
313
|
+
* this week") that point-in-time TVL cannot.
|
|
314
|
+
*
|
|
315
|
+
* Rows are read from the Goldsky subgraph, paginated internally so busy
|
|
316
|
+
* vaults are not truncated at the 1000-row page cap. When `sinceTs` is
|
|
317
|
+
* supplied the reader stops paging once it passes the window boundary, so a
|
|
318
|
+
* short lookback stays cheap even on high-volume vaults.
|
|
319
|
+
*
|
|
320
|
+
* @param params - Query parameters.
|
|
321
|
+
* @param params.vault - Vault (pool) address to read activity for.
|
|
322
|
+
* @param params.chainId - Chain id of the vault; falls back to the active
|
|
323
|
+
* network when omitted. Required for the subgraph lookup.
|
|
324
|
+
* @param params.sinceTs - Lower bound (inclusive) as a Unix timestamp in
|
|
325
|
+
* seconds. Events at or after this time are returned.
|
|
326
|
+
* @param params.untilTs - Upper bound (inclusive) as a Unix timestamp in
|
|
327
|
+
* seconds. Events at or before this time are returned.
|
|
328
|
+
* @param params.types - Restrict to a subset of event types (e.g.
|
|
329
|
+
* `['deposit']`). Returns all types when omitted.
|
|
330
|
+
* @returns Activity items sorted oldest-first, each with a normalized
|
|
331
|
+
* `amount`, actor `address`, `type`, and `transactionHash`.
|
|
332
|
+
* @throws If `vault` is not a valid address, or no chain id can be resolved.
|
|
333
|
+
* @example
|
|
334
|
+
* ```ts
|
|
335
|
+
* const weekAgo = Math.floor(Date.now() / 1000) - 7 * 86_400;
|
|
336
|
+
* const deposits = await sdk.getVaultActivity({
|
|
337
|
+
* vault: '0x36eDbF0C834591BFdfCaC0Ef9605528c75c406aA',
|
|
338
|
+
* chainId: 143,
|
|
339
|
+
* sinceTs: weekAgo,
|
|
340
|
+
* types: ['deposit'],
|
|
341
|
+
* });
|
|
342
|
+
* console.log(`${deposits.length} deposits in the last 7 days`);
|
|
343
|
+
* ```
|
|
344
|
+
*/
|
|
345
|
+
getVaultActivity({ vault, chainId, sinceTs, untilTs, types, }: {
|
|
346
|
+
vault: IAddress;
|
|
347
|
+
chainId?: IChainId;
|
|
348
|
+
sinceTs?: number;
|
|
349
|
+
untilTs?: number;
|
|
350
|
+
types?: IVaultUserHistoryItem['type'][];
|
|
351
|
+
}): Promise<IVaultUserHistoryItem[]>;
|
|
352
|
+
/**
|
|
353
|
+
* Resolve the ERC-20 tokens currently whitelisted for the `SwapRouter` on a
|
|
354
|
+
* chain — the any-token set a deposit UI can offer as swap-and-deposit inputs,
|
|
355
|
+
* each verified `true` against the router's on-chain allowlist.
|
|
356
|
+
*
|
|
357
|
+
* Reconstructs the set from the router's `TokenEnabled` event history and
|
|
358
|
+
* re-checks `whitelistedTokens(token)` for each (the mapping is not
|
|
359
|
+
* enumerable). See {@link getSwapRouterWhitelistedTokens} for the full
|
|
360
|
+
* two-stage behavior and RPC cost. Uses this instance's configured provider
|
|
361
|
+
* for `chainId`; returns `[]` (no RPC) when no router is deployed there or no
|
|
362
|
+
* provider is configured.
|
|
363
|
+
*
|
|
364
|
+
* @param chainId - EVM chain ID to resolve the allowlist for.
|
|
365
|
+
* @param options - Optional `fromBlock` to override the deploy-block scan floor.
|
|
366
|
+
* @returns Checksummed whitelisted token addresses; `[]` when unavailable.
|
|
367
|
+
* Callers still exclude a target vault's natively-accepted assets (those
|
|
368
|
+
* deposit without a swap).
|
|
369
|
+
* @throws AugustSDKError when an `eth_getLogs` scan chunk fails.
|
|
370
|
+
* @example
|
|
371
|
+
* ```ts
|
|
372
|
+
* const tokens = await augustSdk.getSwapRouterWhitelistedTokens(1);
|
|
373
|
+
* ```
|
|
374
|
+
*/
|
|
375
|
+
getSwapRouterWhitelistedTokens(chainId: number, options?: {
|
|
376
|
+
fromBlock?: number;
|
|
377
|
+
}): Promise<IAddress[]>;
|
|
378
|
+
/**
|
|
379
|
+
* Resolve the vaults currently eligible for the any-token `SwapRouter`
|
|
380
|
+
* deposit surface on a chain — every vault the router has `enableVault`-ed
|
|
381
|
+
* whose on-chain registration is still live.
|
|
382
|
+
*
|
|
383
|
+
* Reconstructs the set from the router's `VaultEnabled` event history and
|
|
384
|
+
* re-checks `vaultInfo(vault).referenceAsset != 0` for each (the mapping is
|
|
385
|
+
* not enumerable). See {@link getSwapRouterEligibleVaults} for the full
|
|
386
|
+
* two-stage behavior and RPC cost. Uses this instance's configured provider
|
|
387
|
+
* for `chainId`; returns `[]` (no RPC) when no router is deployed there or no
|
|
388
|
+
* provider is configured.
|
|
389
|
+
*
|
|
390
|
+
* On-chain eligibility only — app-level policy (e.g. excluding vaults with
|
|
391
|
+
* their own OVault deposit flow) remains the caller's responsibility.
|
|
392
|
+
*
|
|
393
|
+
* @param chainId - EVM chain ID to resolve eligible vaults for.
|
|
394
|
+
* @param options - Optional `fromBlock` to override the deploy-block scan floor.
|
|
395
|
+
* @returns Checksummed eligible vault addresses; `[]` when unavailable.
|
|
396
|
+
* @throws AugustSDKError when an `eth_getLogs` scan chunk fails.
|
|
397
|
+
* @example
|
|
398
|
+
* ```ts
|
|
399
|
+
* const vaults = await augustSdk.getSwapRouterEligibleVaults(1);
|
|
400
|
+
* ```
|
|
401
|
+
*/
|
|
402
|
+
getSwapRouterEligibleVaults(chainId: number, options?: {
|
|
403
|
+
fromBlock?: number;
|
|
404
|
+
}): Promise<IAddress[]>;
|
|
405
|
+
/**
|
|
406
|
+
* @function getStakingPositions gets all available reward staking positions
|
|
407
|
+
* @param wallet optionally passed user wallet address
|
|
408
|
+
* @param chainId optionally passed chainId
|
|
409
|
+
* @returns all available staking positions for connected or passed network(s)
|
|
410
|
+
*/
|
|
411
|
+
getStakingPositions(wallet?: IAddress, chainId?: IChainId): Promise<import("../../types").IActiveStakingPosition[]>;
|
|
412
|
+
/**
|
|
413
|
+
* @function getVaultTvl gets the vault/pool TVL, both current and historical
|
|
414
|
+
* @param vault pool/vault contract address
|
|
415
|
+
* @param historical (optional) When passed, returns the historical records of the pool/vault TVL
|
|
416
|
+
* @returns an object or array of objects containing the TVL and timestamp
|
|
417
|
+
*/
|
|
418
|
+
getVaultTvl({ vault, chainId, historical, }: {
|
|
419
|
+
vault: IAddress;
|
|
420
|
+
chainId?: IChainId;
|
|
421
|
+
historical?: IVaultHistoricalParams;
|
|
422
|
+
}): Promise<{
|
|
423
|
+
value: INormalizedNumber;
|
|
424
|
+
timestamp: string;
|
|
425
|
+
}[]>;
|
|
426
|
+
/**
|
|
427
|
+
* @function getYieldLastRealizedOn gets the timestamp when yield was last realized for a vault
|
|
428
|
+
* @param vault Vault contract address
|
|
429
|
+
* @param chainId Optional chain ID (uses active network if not provided)
|
|
430
|
+
* @returns Timestamp (Unix timestamp in seconds) when yield was last realized
|
|
431
|
+
*/
|
|
432
|
+
getYieldLastRealizedOn({ vault, chainId, }: {
|
|
433
|
+
vault: IAddress;
|
|
434
|
+
chainId?: IChainId;
|
|
435
|
+
}): Promise<number>;
|
|
436
|
+
/**
|
|
437
|
+
* Gets borrower health-factor data for vaults on a chain, optionally
|
|
438
|
+
* scoped to a single vault.
|
|
439
|
+
*
|
|
440
|
+
* Pass `vault` whenever the caller knows which pool it cares about —
|
|
441
|
+
* this skips the all-vaults cross-chain fanout and only reads the loans
|
|
442
|
+
* for that one pool. The response map is keyed by **lowercased** vault
|
|
443
|
+
* address; look entries up with `address.toLowerCase()`.
|
|
444
|
+
*
|
|
445
|
+
* Individual loan failures (bad/test loan contracts, unrecognized
|
|
446
|
+
* borrowers) are isolated and logged rather than rejecting the batch.
|
|
447
|
+
*
|
|
448
|
+
* @param chainId Optional chain to scope the read to. When omitted,
|
|
449
|
+
* iterates the SDK's configured providers and returns the flattened
|
|
450
|
+
* list (legacy shape — prefer passing a chain).
|
|
451
|
+
* @param vault Optional vault address. When provided alongside
|
|
452
|
+
* `chainId`, only that vault's data is fetched.
|
|
453
|
+
* @returns When `chainId` is set, an object map of lowercased vault
|
|
454
|
+
* address → array of borrower-health-factor rows. When `chainId` is
|
|
455
|
+
* omitted, a flat array (legacy behavior, kept for backward compat).
|
|
456
|
+
*/
|
|
457
|
+
getVaultBorrowerHealthFactor(chainId?: IChainId, vault?: IAddress): Promise<Record<string, import("../../types").IVaultBorrowerHealthFactor[]> | Record<string, import("../../types").IVaultBorrowerHealthFactor[]>[]>;
|
|
458
|
+
/**
|
|
459
|
+
* @function getUserPoints fetches user points from the backend API
|
|
460
|
+
* @param userAddress User wallet address
|
|
461
|
+
* @returns Points data from the backend API
|
|
462
|
+
*/
|
|
463
|
+
getUserPoints(userAddress: IAddress): Promise<any>;
|
|
464
|
+
/**
|
|
465
|
+
* Register a user for the points program, authenticated by a wallet signature.
|
|
466
|
+
*
|
|
467
|
+
* The caller produces a personal_sign signature over a canonical message
|
|
468
|
+
* built from these primitives — see `registerUserForPoints` in
|
|
469
|
+
* `./getters` for the exact template and a worked example.
|
|
470
|
+
*
|
|
471
|
+
* @param userAddress EVM wallet address being registered.
|
|
472
|
+
* @param referrerAddress Optional referrer EVM address.
|
|
473
|
+
* @param chainId Chain on which the wallet signed; powers the EIP-1271
|
|
474
|
+
* fallback for smart-contract wallets and pins the signature cross-chain.
|
|
475
|
+
* @param signature 0x-prefixed hex personal_sign signature over the canonical message.
|
|
476
|
+
* @param nonce Single-use random string (8–128 chars).
|
|
477
|
+
* @param expiry Unix seconds; must be in the future, within the backend's TTL.
|
|
478
|
+
* @returns Raw `Response` from the backend.
|
|
479
|
+
*/
|
|
480
|
+
registerUserForPoints(userAddress: IAddress, referrerAddress: IAddress | undefined, chainId: number, signature: string, nonce: string, expiry: number): Promise<Response>;
|
|
481
|
+
/**
|
|
482
|
+
* @function fetchPointsLeaderboard fetches the points leaderboard data
|
|
483
|
+
* @param params Optional parameters for pagination and sorting
|
|
484
|
+
* @returns Leaderboard response data
|
|
485
|
+
*/
|
|
486
|
+
fetchPointsLeaderboard(params?: {
|
|
487
|
+
page?: number;
|
|
488
|
+
perPage?: number;
|
|
489
|
+
sortBy?: 'streakDays' | 'totalPoints';
|
|
490
|
+
}): Promise<any>;
|
|
491
|
+
/**
|
|
492
|
+
* Get annualized APY metrics for a vault.
|
|
493
|
+
*
|
|
494
|
+
* Supported Vaults: cUSDO, tETH, wstETH, rsETH
|
|
495
|
+
*
|
|
496
|
+
* @deprecated The `hgETH30dLiquidAPY` and `hgETH7dLiquidAPY` response fields are deprecated.
|
|
497
|
+
* These fields will be removed on 2026-01-01.
|
|
498
|
+
* Use `liquidAPY30Day` and `liquidAPY7Day` fields instead.
|
|
499
|
+
*
|
|
500
|
+
* @param vault Vault address
|
|
501
|
+
* @returns Annualized APY data including liquidity APY
|
|
502
|
+
*/
|
|
503
|
+
getVaultAnnualizedApy(vault: IAddress): Promise<import("../../types").IVaultAnnualizedApy>;
|
|
504
|
+
/**
|
|
505
|
+
* Get summary data for a vault (name, type, chain, recent returns).
|
|
506
|
+
* @param vault Vault address
|
|
507
|
+
* @returns Vault summary data
|
|
508
|
+
*/
|
|
509
|
+
getVaultSummary(vault: IAddress): Promise<import("../../types").IVaultSummary>;
|
|
510
|
+
/**
|
|
511
|
+
* Get withdrawal summary and pending queue for a vault.
|
|
512
|
+
* @param vault Vault address
|
|
513
|
+
* @param chainId Chain ID (will be converted to chain name)
|
|
514
|
+
* @returns Withdrawal summary and pending queue
|
|
515
|
+
*/
|
|
516
|
+
getVaultWithdrawals(vault: IAddress, chainId?: number): Promise<import("../../types").IVaultWithdrawals>;
|
|
517
|
+
/**
|
|
518
|
+
* Fetch pending redemptions for a vault with liquidity analysis.
|
|
519
|
+
* @param vault - Vault contract address
|
|
520
|
+
* @param pastDays - Number of past days to include (default 7, min 1, max 30)
|
|
521
|
+
* @param futureDays - Number of future days to include (default 14, min 1, max 30)
|
|
522
|
+
* @returns Pending redemptions grouped by date with liquidity summary
|
|
523
|
+
*/
|
|
524
|
+
getVaultPendingRedemptions({ vault, pastDays, futureDays, }: {
|
|
525
|
+
vault: IAddress;
|
|
526
|
+
pastDays?: number;
|
|
527
|
+
futureDays?: number;
|
|
528
|
+
}): Promise<import("../../types").IVaultPendingRedemptions>;
|
|
529
|
+
/**
|
|
530
|
+
* Preview the amount of assets that would be received for redeeming shares (queued redemption).
|
|
531
|
+
* @param vault Vault contract address
|
|
532
|
+
* @param sharesAmount Amount of shares to redeem (human-readable, raw bigint, or string)
|
|
533
|
+
* @param chainId Optional chain ID (uses active network if not provided)
|
|
534
|
+
* @returns The amount of assets as INormalizedNumber { normalized, raw }
|
|
535
|
+
*/
|
|
536
|
+
previewRedemption({ vault, sharesAmount, chainId, }: {
|
|
537
|
+
vault: IAddress;
|
|
538
|
+
sharesAmount: string | bigint | number;
|
|
539
|
+
chainId?: IChainId;
|
|
540
|
+
}): Promise<INormalizedNumber>;
|
|
541
|
+
/**
|
|
542
|
+
* Get all withdrawal requests for a vault with deterministic status tracking.
|
|
543
|
+
*
|
|
544
|
+
* Matches requests to processed events by `(receiver, claimableDate)` tuple.
|
|
545
|
+
*
|
|
546
|
+
* **Status values:**
|
|
547
|
+
* - `'processed'` — Matching `WithdrawalProcessed` event found on-chain.
|
|
548
|
+
* - `'ready_to_claim'` — Claimable date has passed, no processed event found yet.
|
|
549
|
+
* - `'pending'` — Claimable date is still in the future.
|
|
550
|
+
*
|
|
551
|
+
* **Lookback window:** Processed events are fetched from on-chain logs, which
|
|
552
|
+
* only cover a finite block range. Requests whose claimable date is older than
|
|
553
|
+
* this window with no matching processed event are excluded (assumed already
|
|
554
|
+
* processed). Use `lookbackBlocks` to widen or narrow the scan range.
|
|
555
|
+
*
|
|
556
|
+
* @param vault - Vault contract address
|
|
557
|
+
* @param receiver - Optional receiver address to filter by
|
|
558
|
+
* @param lookbackBlocks - Optional on-chain log lookback window in blocks.
|
|
559
|
+
* Defaults to chain-specific value (e.g. 150,000 for Ethereum, 3,456,000 for Monad).
|
|
560
|
+
* @param chainId - Optional chain id for the vault address
|
|
561
|
+
* @returns Array of withdrawal requests with status and claimable dates
|
|
562
|
+
*/
|
|
563
|
+
getWithdrawalRequestsWithStatus(vault: IAddress, receiver?: IAddress, lookbackBlocks?: number, chainId?: number): Promise<import("./getters").WithdrawalRequestStatus[]>;
|
|
564
|
+
/**
|
|
565
|
+
* Redeem vault shares for an underlying asset via instant redemption (RWA subaccount).
|
|
566
|
+
* Resolves the vault address to the RwaRedeemSubaccount internally.
|
|
567
|
+
* Handles vault share approval automatically.
|
|
568
|
+
* @param signer - Signer / wallet object
|
|
569
|
+
* @param vault - Vault contract address
|
|
570
|
+
* @param asset - Redeemable asset address (e.g. USDC, USDT)
|
|
571
|
+
* @param amount - Amount of vault shares to redeem
|
|
572
|
+
* @param minOut - Minimum output amount in output asset units (slippage protection)
|
|
573
|
+
* @param chainId - Optional chain ID (uses active network if not provided)
|
|
574
|
+
* @param wait - Wait for transaction confirmation
|
|
575
|
+
* @returns transaction hash
|
|
576
|
+
*/
|
|
577
|
+
rwaRedeemAsset(signer: Signer | Wallet, { vault, asset, amount, minOut, chainId, wait, }: {
|
|
578
|
+
vault: IAddress;
|
|
579
|
+
asset: IAddress;
|
|
580
|
+
amount: string | bigint | number;
|
|
581
|
+
minOut: string | bigint | number;
|
|
582
|
+
chainId?: IChainId;
|
|
583
|
+
wait?: boolean;
|
|
584
|
+
}): Promise<string>;
|
|
585
|
+
/**
|
|
586
|
+
* Preview the output amount for an RWA instant redemption.
|
|
587
|
+
* Resolves the vault address to the RwaRedeemSubaccount internally.
|
|
588
|
+
* @param vault - Vault contract address
|
|
589
|
+
* @param asset - Redeemable asset address (e.g. USDC, USDT)
|
|
590
|
+
* @param amount - Amount of vault shares to preview
|
|
591
|
+
* @param chainId - Optional chain ID (uses active network if not provided)
|
|
592
|
+
* @returns normalized number of the expected output amount (in output asset decimals)
|
|
593
|
+
*/
|
|
594
|
+
previewRwaRedemption({ vault, asset, amount, chainId, }: {
|
|
595
|
+
vault: IAddress;
|
|
596
|
+
asset: IAddress;
|
|
597
|
+
amount: string | bigint | number;
|
|
598
|
+
chainId?: IChainId;
|
|
599
|
+
}): Promise<INormalizedNumber>;
|
|
600
|
+
}
|
|
601
|
+
export default AugustVaults;
|