@upshiftfinance/sdk 0.0.0-stage → 0.2.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/LICENSE +21 -0
- package/README.md +408 -2
- 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 +953 -0
- package/lib/abis/SwapRouter.js +1228 -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 +249 -0
- package/lib/adapters/evm/index.d.ts +539 -0
- package/lib/adapters/evm/index.js +656 -0
- package/lib/adapters/evm/utils.d.ts +8 -0
- package/lib/adapters/evm/utils.js +51 -0
- package/lib/adapters/solana/confirm.d.ts +88 -0
- package/lib/adapters/solana/confirm.js +291 -0
- package/lib/adapters/solana/constants.d.ts +42 -0
- package/lib/adapters/solana/constants.js +59 -0
- package/lib/adapters/solana/getters.d.ts +42 -0
- package/lib/adapters/solana/getters.js +275 -0
- package/lib/adapters/solana/idl/vault-idl.d.ts +700 -0
- package/lib/adapters/solana/idl/vault-idl.js +2101 -0
- package/lib/adapters/solana/idl/withdrawal-queue-idl.d.ts +795 -0
- package/lib/adapters/solana/idl/withdrawal-queue-idl.js +1864 -0
- package/lib/adapters/solana/index.d.ts +372 -0
- package/lib/adapters/solana/index.js +459 -0
- package/lib/adapters/solana/pricing.d.ts +184 -0
- package/lib/adapters/solana/pricing.js +239 -0
- package/lib/adapters/solana/queue-hints.d.ts +29 -0
- package/lib/adapters/solana/queue-hints.js +59 -0
- package/lib/adapters/solana/queue.actions.d.ts +97 -0
- package/lib/adapters/solana/queue.actions.js +468 -0
- package/lib/adapters/solana/token-reads.d.ts +108 -0
- package/lib/adapters/solana/token-reads.js +145 -0
- package/lib/adapters/solana/types.d.ts +325 -0
- package/lib/adapters/solana/types.js +3 -0
- package/lib/adapters/solana/utils.d.ts +229 -0
- package/lib/adapters/solana/utils.js +773 -0
- package/lib/adapters/solana/vault.actions.d.ts +140 -0
- package/lib/adapters/solana/vault.actions.js +657 -0
- package/lib/adapters/solana/withdrawal-queue.d.ts +125 -0
- package/lib/adapters/solana/withdrawal-queue.js +301 -0
- package/lib/adapters/stellar/actions.d.ts +41 -0
- package/lib/adapters/stellar/actions.js +126 -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 +126 -0
- package/lib/adapters/stellar/index.js +187 -0
- package/lib/adapters/stellar/invocation.d.ts +55 -0
- package/lib/adapters/stellar/invocation.js +92 -0
- package/lib/adapters/stellar/soroban.d.ts +131 -0
- package/lib/adapters/stellar/soroban.js +617 -0
- package/lib/adapters/stellar/submit.d.ts +42 -0
- package/lib/adapters/stellar/submit.js +195 -0
- package/lib/adapters/stellar/types.d.ts +57 -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/client.d.ts +83 -0
- package/lib/adapters/sui/client.js +216 -0
- package/lib/adapters/sui/constants.d.ts +33 -0
- package/lib/adapters/sui/constants.js +31 -0
- package/lib/adapters/sui/index.d.ts +57 -0
- package/lib/adapters/sui/index.js +100 -0
- package/lib/adapters/sui/targets.d.ts +171 -0
- package/lib/adapters/sui/targets.js +225 -0
- package/lib/adapters/sui/utils.d.ts +8 -0
- package/lib/adapters/sui/utils.js +17 -0
- package/lib/core/analytics/app-name.d.ts +27 -0
- package/lib/core/analytics/app-name.js +48 -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 +15 -0
- package/lib/core/analytics/constants.js +28 -0
- package/lib/core/analytics/env.d.ts +46 -0
- package/lib/core/analytics/env.js +147 -0
- package/lib/core/analytics/index.d.ts +39 -0
- package/lib/core/analytics/index.js +83 -0
- package/lib/core/analytics/instrumentation.d.ts +29 -0
- package/lib/core/analytics/instrumentation.js +292 -0
- package/lib/core/analytics/method-taxonomy.d.ts +19 -0
- package/lib/core/analytics/method-taxonomy.js +156 -0
- package/lib/core/analytics/metrics.d.ts +48 -0
- package/lib/core/analytics/metrics.js +142 -0
- package/lib/core/analytics/sanitize.d.ts +57 -0
- package/lib/core/analytics/sanitize.js +272 -0
- package/lib/core/analytics/sentry-runtime.d.ts +15 -0
- package/lib/core/analytics/sentry-runtime.js +131 -0
- package/lib/core/analytics/sentry.d.ts +100 -0
- package/lib/core/analytics/sentry.js +696 -0
- package/lib/core/analytics/types.d.ts +55 -0
- package/lib/core/analytics/types.js +3 -0
- package/lib/core/analytics/user-identity.d.ts +55 -0
- package/lib/core/analytics/user-identity.js +218 -0
- package/lib/core/analytics/version.d.ts +6 -0
- package/lib/core/analytics/version.js +10 -0
- package/lib/core/attribution.d.ts +159 -0
- package/lib/core/attribution.js +194 -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 +35 -0
- package/lib/core/base.class.d.ts +193 -0
- package/lib/core/base.class.js +163 -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 +162 -0
- package/lib/core/constants/core.js +281 -0
- package/lib/core/constants/swap-router.d.ts +180 -0
- package/lib/core/constants/swap-router.js +203 -0
- package/lib/core/constants/vaults.d.ts +93 -0
- package/lib/core/constants/vaults.js +277 -0
- package/lib/core/constants/web3.d.ts +106 -0
- package/lib/core/constants/web3.js +251 -0
- package/lib/core/errors/index.d.ts +177 -0
- package/lib/core/errors/index.js +257 -0
- package/lib/core/fetcher.d.ts +237 -0
- package/lib/core/fetcher.js +1103 -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 +697 -0
- package/lib/core/helpers/chain-support.d.ts +98 -0
- package/lib/core/helpers/chain-support.js +139 -0
- package/lib/core/helpers/concurrency.d.ts +51 -0
- package/lib/core/helpers/concurrency.js +79 -0
- package/lib/core/helpers/core.d.ts +92 -0
- package/lib/core/helpers/core.js +368 -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 +61 -0
- package/lib/core/helpers/signer.js +184 -0
- package/lib/core/helpers/swap-router.d.ts +269 -0
- package/lib/core/helpers/swap-router.js +542 -0
- package/lib/core/helpers/vault-version.d.ts +24 -0
- package/lib/core/helpers/vault-version.js +83 -0
- package/lib/core/helpers/vaults.d.ts +89 -0
- package/lib/core/helpers/vaults.js +241 -0
- package/lib/core/helpers/web3.d.ts +366 -0
- package/lib/core/helpers/web3.js +1034 -0
- package/lib/core/index.d.ts +23 -0
- package/lib/core/index.js +40 -0
- package/lib/core/logger/curator-alert.d.ts +217 -0
- package/lib/core/logger/curator-alert.js +276 -0
- package/lib/core/logger/index.d.ts +99 -0
- package/lib/core/logger/index.js +163 -0
- package/lib/core/logger/slack.d.ts +49 -0
- package/lib/core/logger/slack.js +111 -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 +132 -0
- package/lib/evm/methods/crossChainVault.js +857 -0
- package/lib/evm/methods/crossChainVaultRegistry.d.ts +92 -0
- package/lib/evm/methods/crossChainVaultRegistry.js +239 -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 +596 -0
- package/lib/main.js +681 -0
- package/lib/modules/api/fetcher.d.ts +108 -0
- package/lib/modules/api/fetcher.js +187 -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 +587 -0
- package/lib/modules/api/main.js +911 -0
- package/lib/modules/sub-accounts/fetcher.d.ts +53 -0
- package/lib/modules/sub-accounts/fetcher.js +96 -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 +249 -0
- package/lib/modules/sub-accounts/main.js +211 -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 +84 -0
- package/lib/modules/vaults/adapter.helpers.js +202 -0
- package/lib/modules/vaults/fetcher.d.ts +147 -0
- package/lib/modules/vaults/fetcher.js +357 -0
- package/lib/modules/vaults/getters.d.ts +1060 -0
- package/lib/modules/vaults/getters.js +4079 -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 +607 -0
- package/lib/modules/vaults/main.js +1687 -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 +406 -0
- package/lib/modules/vaults/read.actions.js +891 -0
- package/lib/modules/vaults/types.d.ts +149 -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 +153 -0
- package/lib/modules/vaults/utils.js +818 -0
- package/lib/modules/vaults/write.actions.d.ts +812 -0
- package/lib/modules/vaults/write.actions.js +2377 -0
- package/lib/polyfills.d.ts +1 -0
- package/lib/polyfills.js +12 -0
- package/lib/sdk.d.ts +30173 -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 +50 -0
- package/lib/services/debank/utils.js +325 -0
- package/lib/services/layerzero/deposits.d.ts +55 -0
- package/lib/services/layerzero/deposits.js +174 -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 +33 -0
- package/lib/services/octavfi/fetcher.js +39 -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 +244 -0
- package/lib/services/subgraph/fetcher.d.ts +2 -0
- package/lib/services/subgraph/fetcher.js +66 -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 +48 -0
- package/lib/services/subgraph/schema.js +87 -0
- package/lib/services/subgraph/vaults.d.ts +83 -0
- package/lib/services/subgraph/vaults.js +1282 -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/services/untangled/fetcher.d.ts +40 -0
- package/lib/services/untangled/fetcher.js +110 -0
- package/lib/services/untangled/index.d.ts +3 -0
- package/lib/services/untangled/index.js +20 -0
- package/lib/services/untangled/types.d.ts +83 -0
- package/lib/services/untangled/types.js +10 -0
- package/lib/services/untangled/utils.d.ts +91 -0
- package/lib/services/untangled/utils.js +339 -0
- package/lib/types/api.d.ts +498 -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 +150 -0
- package/lib/types/sub-accounts.js +3 -0
- package/lib/types/subgraph.d.ts +84 -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 +886 -0
- package/lib/types/vaults.js +30 -0
- package/lib/types/web3.d.ts +100 -0
- package/lib/types/web3.js +14 -0
- package/lib/types/webserver.d.ts +730 -0
- package/lib/types/webserver.js +3 -0
- package/package.json +79 -3
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { type IFetchUpshiftOptions } from '../../core';
|
|
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
|
+
/**
|
|
4
|
+
* Fetch the global loan-book aggregate (admin-only `GET /dashboard/loans`).
|
|
5
|
+
*/
|
|
6
|
+
export declare const fetchDashboardLoans: (upshiftKey: string, headers?: IFetchUpshiftOptions["headers"]) => Promise<ILoanBookInfo[]>;
|
|
7
|
+
/**
|
|
8
|
+
* Fetch every token discount-factor ladder (`GET /risk/discount_factors`).
|
|
9
|
+
*/
|
|
10
|
+
export declare const fetchDiscountFactors: (upshiftKey: string, headers?: IFetchUpshiftOptions["headers"]) => Promise<IDiscountFactorLadder[]>;
|
|
11
|
+
/**
|
|
12
|
+
* Fetch a subaccount's collateral excess/deficit for one token
|
|
13
|
+
* (`GET /risk/collateral_excess_or_deficit`).
|
|
14
|
+
*/
|
|
15
|
+
export declare const fetchCollateralExcessOrDeficit: (params: {
|
|
16
|
+
subaccount: string;
|
|
17
|
+
tokenAddress: string;
|
|
18
|
+
tokenChain: number;
|
|
19
|
+
targetHealthFactor?: number;
|
|
20
|
+
}, upshiftKey: string, headers?: IFetchUpshiftOptions["headers"]) => Promise<ICollateralExcessOrDeficit>;
|
|
21
|
+
/**
|
|
22
|
+
* Run a collateral simulation (`POST /risk/collateral_simulation`). This is a
|
|
23
|
+
* pure, read-only simulation — the backend computes required collateral for a
|
|
24
|
+
* hypothetical loan and changes no state.
|
|
25
|
+
*/
|
|
26
|
+
export declare const fetchCollateralSimulation: (body: ICollateralSimulationInput, upshiftKey: string, headers?: IFetchUpshiftOptions["headers"]) => Promise<ICollateralSimulationResults>;
|
|
27
|
+
/**
|
|
28
|
+
* Fetch the decoded revert reason(s) for a transaction from the public
|
|
29
|
+
* `GET /revert_reason` endpoint. No API key required.
|
|
30
|
+
*/
|
|
31
|
+
export declare const fetchRevertReason: (txHash: string, chain: number, headers?: IFetchUpshiftOptions["headers"]) => Promise<IRevertReason>;
|
|
32
|
+
/**
|
|
33
|
+
* Fetch all OTC positions (admin-only `GET /otc/position`).
|
|
34
|
+
*/
|
|
35
|
+
export declare const fetchOtcPositions: (upshiftKey: string, headers?: IFetchUpshiftOptions["headers"]) => Promise<IOtcPositionRead[]>;
|
|
36
|
+
/**
|
|
37
|
+
* Fetch OTC margin requirements (admin-only `GET /otc/margin_requirement`),
|
|
38
|
+
* optionally filtered by counterparty id and/or payer.
|
|
39
|
+
*/
|
|
40
|
+
export declare const fetchOtcMarginRequirements: (filters: {
|
|
41
|
+
otcCounterpartyId?: string;
|
|
42
|
+
payer?: string;
|
|
43
|
+
}, upshiftKey: string, headers?: IFetchUpshiftOptions["headers"]) => Promise<IOtcMarginRequirement[]>;
|
|
44
|
+
/**
|
|
45
|
+
* Fetch the subaccounts linked to a vault (curator-or-admin
|
|
46
|
+
* `GET /curator/vaults/{vault_address}/subaccounts`).
|
|
47
|
+
*/
|
|
48
|
+
export declare const fetchCuratorVaultSubaccounts: (vaultAddress: string, upshiftKey: string, headers?: IFetchUpshiftOptions["headers"]) => Promise<IWSSubaccountListItem[]>;
|
|
49
|
+
/**
|
|
50
|
+
* Fetch on-chain whitelist status for a vault's subaccounts (curator-or-admin
|
|
51
|
+
* `GET /curator/vaults/{vault_address}/whitelist`). EVM vaults only — the
|
|
52
|
+
* backend 400s for non-EVM vaults.
|
|
53
|
+
*/
|
|
54
|
+
export declare const fetchCuratorVaultWhitelist: (vaultAddress: string, upshiftKey: string, headers?: IFetchUpshiftOptions["headers"]) => Promise<ICuratorWhitelistStatus[]>;
|
|
55
|
+
/**
|
|
56
|
+
* Fetch timelock requests for a vault on a chain (`GET /timelock-requests`),
|
|
57
|
+
* optionally filtered by status.
|
|
58
|
+
*/
|
|
59
|
+
export declare const fetchTimelockRequests: (params: {
|
|
60
|
+
vaultAddress: string;
|
|
61
|
+
chainId: number;
|
|
62
|
+
status?: string;
|
|
63
|
+
}, upshiftKey: string, headers?: IFetchUpshiftOptions["headers"]) => Promise<ITimelockRequest[]>;
|
|
64
|
+
/**
|
|
65
|
+
* Fetch a vault's performance-fee computation
|
|
66
|
+
* (`GET /metrics/vault_performance_fees`). Slow first call (pandas over full
|
|
67
|
+
* snapshot history); 20-minute server-side cache.
|
|
68
|
+
*/
|
|
69
|
+
export declare const fetchVaultPerformanceFees: (params: {
|
|
70
|
+
vaultAddress: string;
|
|
71
|
+
annualizedFeesPct: number;
|
|
72
|
+
nativeDenominated: boolean;
|
|
73
|
+
calculationPeriod: string;
|
|
74
|
+
startDate?: string;
|
|
75
|
+
endDate?: string;
|
|
76
|
+
}, upshiftKey: string, headers?: IFetchUpshiftOptions["headers"]) => Promise<IVaultPerformanceFees>;
|
|
77
|
+
/**
|
|
78
|
+
* Fetch a vault's NAV-oracle classification table from the public
|
|
79
|
+
* `GET /upshift/oracle_classification/{vault_address}` endpoint. No API key
|
|
80
|
+
* required.
|
|
81
|
+
*/
|
|
82
|
+
export declare const fetchVaultOracleClassification: (vaultAddress: string, chainId: number, headers?: IFetchUpshiftOptions["headers"]) => Promise<IOracleClassification>;
|
|
83
|
+
/** Public `GET /upshift/positions/{vault}` — latest per-wallet position snapshot. */
|
|
84
|
+
export declare const fetchTransparencyPositions: (vaultAddress: string, chainId: number, headers?: IFetchUpshiftOptions["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?: IFetchUpshiftOptions["headers"]) => Promise<ITransparencyHistoricalAllocations>;
|
|
87
|
+
/** Public `GET /upshift/fees/{vault}` — vault fee configuration. */
|
|
88
|
+
export declare const fetchTransparencyFees: (vaultAddress: string, chainId: number, headers?: IFetchUpshiftOptions["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?: IFetchUpshiftOptions["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?: IFetchUpshiftOptions["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?: IFetchUpshiftOptions["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?: IFetchUpshiftOptions["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?: IFetchUpshiftOptions["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?: IFetchUpshiftOptions["headers"]) => Promise<ITransparencyAuditLog>;
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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
|
+
const core_1 = require("../../core");
|
|
5
|
+
/**
|
|
6
|
+
* Fetch the global loan-book aggregate (admin-only `GET /dashboard/loans`).
|
|
7
|
+
*/
|
|
8
|
+
const fetchDashboardLoans = async (upshiftKey, headers) => {
|
|
9
|
+
const response = await (0, core_1.fetchUpshiftWithKey)(upshiftKey, core_1.WEBSERVER_ENDPOINTS.dashboard.loans, { headers });
|
|
10
|
+
if (!response.ok || typeof response.json !== 'function') {
|
|
11
|
+
throw new Error(`Failed to fetch dashboard loans: ${response.statusText || 'Unknown error'}`);
|
|
12
|
+
}
|
|
13
|
+
return response.json();
|
|
14
|
+
};
|
|
15
|
+
exports.fetchDashboardLoans = fetchDashboardLoans;
|
|
16
|
+
/**
|
|
17
|
+
* Fetch every token discount-factor ladder (`GET /risk/discount_factors`).
|
|
18
|
+
*/
|
|
19
|
+
const fetchDiscountFactors = async (upshiftKey, headers) => {
|
|
20
|
+
const response = await (0, core_1.fetchUpshiftWithKey)(upshiftKey, core_1.WEBSERVER_ENDPOINTS.risk.discountFactors, { headers });
|
|
21
|
+
if (!response.ok || typeof response.json !== 'function') {
|
|
22
|
+
throw new Error(`Failed to fetch discount factors: ${response.statusText || 'Unknown error'}`);
|
|
23
|
+
}
|
|
24
|
+
return response.json();
|
|
25
|
+
};
|
|
26
|
+
exports.fetchDiscountFactors = fetchDiscountFactors;
|
|
27
|
+
/**
|
|
28
|
+
* Fetch a subaccount's collateral excess/deficit for one token
|
|
29
|
+
* (`GET /risk/collateral_excess_or_deficit`).
|
|
30
|
+
*/
|
|
31
|
+
const fetchCollateralExcessOrDeficit = async (params, upshiftKey, headers) => {
|
|
32
|
+
const response = await (0, core_1.fetchUpshiftWithKey)(upshiftKey, core_1.WEBSERVER_ENDPOINTS.risk.collateralExcessOrDeficit(params.subaccount, params.tokenAddress, params.tokenChain, params.targetHealthFactor), { headers });
|
|
33
|
+
if (!response.ok || typeof response.json !== 'function') {
|
|
34
|
+
throw new Error(`Failed to fetch collateral excess or deficit: ${response.statusText || 'Unknown error'}`);
|
|
35
|
+
}
|
|
36
|
+
return response.json();
|
|
37
|
+
};
|
|
38
|
+
exports.fetchCollateralExcessOrDeficit = fetchCollateralExcessOrDeficit;
|
|
39
|
+
/**
|
|
40
|
+
* Run a collateral simulation (`POST /risk/collateral_simulation`). This is a
|
|
41
|
+
* pure, read-only simulation — the backend computes required collateral for a
|
|
42
|
+
* hypothetical loan and changes no state.
|
|
43
|
+
*/
|
|
44
|
+
const fetchCollateralSimulation = async (body, upshiftKey, headers) => {
|
|
45
|
+
const response = await (0, core_1.fetchUpshiftWithKey)(upshiftKey, core_1.WEBSERVER_ENDPOINTS.risk.collateralSimulation, { method: 'post', data: body, headers });
|
|
46
|
+
if (!response.ok || typeof response.json !== 'function') {
|
|
47
|
+
throw new Error(`Failed to run collateral simulation: ${response.statusText || 'Unknown error'}`);
|
|
48
|
+
}
|
|
49
|
+
return response.json();
|
|
50
|
+
};
|
|
51
|
+
exports.fetchCollateralSimulation = fetchCollateralSimulation;
|
|
52
|
+
/**
|
|
53
|
+
* Fetch the decoded revert reason(s) for a transaction from the public
|
|
54
|
+
* `GET /revert_reason` endpoint. No API key required.
|
|
55
|
+
*/
|
|
56
|
+
const fetchRevertReason = async (txHash, chain, headers) => {
|
|
57
|
+
const response = await (0, core_1.fetchUpshiftPublic)(core_1.WEBSERVER_ENDPOINTS.public.revertReason(txHash, chain), { headers });
|
|
58
|
+
if (!response.ok || typeof response.json !== 'function') {
|
|
59
|
+
throw new Error(`Failed to fetch revert reason: ${response.statusText || 'Unknown error'}`);
|
|
60
|
+
}
|
|
61
|
+
return response.json();
|
|
62
|
+
};
|
|
63
|
+
exports.fetchRevertReason = fetchRevertReason;
|
|
64
|
+
/**
|
|
65
|
+
* Fetch all OTC positions (admin-only `GET /otc/position`).
|
|
66
|
+
*/
|
|
67
|
+
const fetchOtcPositions = async (upshiftKey, headers) => {
|
|
68
|
+
const response = await (0, core_1.fetchUpshiftWithKey)(upshiftKey, core_1.WEBSERVER_ENDPOINTS.otc.positions, { headers });
|
|
69
|
+
if (!response.ok || typeof response.json !== 'function') {
|
|
70
|
+
throw new Error(`Failed to fetch OTC positions: ${response.statusText || 'Unknown error'}`);
|
|
71
|
+
}
|
|
72
|
+
return response.json();
|
|
73
|
+
};
|
|
74
|
+
exports.fetchOtcPositions = fetchOtcPositions;
|
|
75
|
+
/**
|
|
76
|
+
* Fetch OTC margin requirements (admin-only `GET /otc/margin_requirement`),
|
|
77
|
+
* optionally filtered by counterparty id and/or payer.
|
|
78
|
+
*/
|
|
79
|
+
const fetchOtcMarginRequirements = async (filters, upshiftKey, headers) => {
|
|
80
|
+
const response = await (0, core_1.fetchUpshiftWithKey)(upshiftKey, core_1.WEBSERVER_ENDPOINTS.otc.marginRequirements(filters.otcCounterpartyId, filters.payer), { headers });
|
|
81
|
+
if (!response.ok || typeof response.json !== 'function') {
|
|
82
|
+
throw new Error(`Failed to fetch OTC margin requirements: ${response.statusText || 'Unknown error'}`);
|
|
83
|
+
}
|
|
84
|
+
return response.json();
|
|
85
|
+
};
|
|
86
|
+
exports.fetchOtcMarginRequirements = fetchOtcMarginRequirements;
|
|
87
|
+
/**
|
|
88
|
+
* Fetch the subaccounts linked to a vault (curator-or-admin
|
|
89
|
+
* `GET /curator/vaults/{vault_address}/subaccounts`).
|
|
90
|
+
*/
|
|
91
|
+
const fetchCuratorVaultSubaccounts = async (vaultAddress, upshiftKey, headers) => {
|
|
92
|
+
const response = await (0, core_1.fetchUpshiftWithKey)(upshiftKey, core_1.WEBSERVER_ENDPOINTS.curator.vaultSubaccounts(vaultAddress), { headers });
|
|
93
|
+
if (!response.ok || typeof response.json !== 'function') {
|
|
94
|
+
throw new Error(`Failed to fetch curator vault subaccounts: ${response.statusText || 'Unknown error'}`);
|
|
95
|
+
}
|
|
96
|
+
return response.json();
|
|
97
|
+
};
|
|
98
|
+
exports.fetchCuratorVaultSubaccounts = fetchCuratorVaultSubaccounts;
|
|
99
|
+
/**
|
|
100
|
+
* Fetch on-chain whitelist status for a vault's subaccounts (curator-or-admin
|
|
101
|
+
* `GET /curator/vaults/{vault_address}/whitelist`). EVM vaults only — the
|
|
102
|
+
* backend 400s for non-EVM vaults.
|
|
103
|
+
*/
|
|
104
|
+
const fetchCuratorVaultWhitelist = async (vaultAddress, upshiftKey, headers) => {
|
|
105
|
+
const response = await (0, core_1.fetchUpshiftWithKey)(upshiftKey, core_1.WEBSERVER_ENDPOINTS.curator.vaultWhitelist(vaultAddress), { headers });
|
|
106
|
+
if (!response.ok || typeof response.json !== 'function') {
|
|
107
|
+
throw new Error(`Failed to fetch curator vault whitelist: ${response.statusText || 'Unknown error'}`);
|
|
108
|
+
}
|
|
109
|
+
return response.json();
|
|
110
|
+
};
|
|
111
|
+
exports.fetchCuratorVaultWhitelist = fetchCuratorVaultWhitelist;
|
|
112
|
+
/**
|
|
113
|
+
* Fetch timelock requests for a vault on a chain (`GET /timelock-requests`),
|
|
114
|
+
* optionally filtered by status.
|
|
115
|
+
*/
|
|
116
|
+
const fetchTimelockRequests = async (params, upshiftKey, headers) => {
|
|
117
|
+
const response = await (0, core_1.fetchUpshiftWithKey)(upshiftKey, core_1.WEBSERVER_ENDPOINTS.timelockRequests(params.vaultAddress, params.chainId, params.status), { headers });
|
|
118
|
+
if (!response.ok || typeof response.json !== 'function') {
|
|
119
|
+
throw new Error(`Failed to fetch timelock requests: ${response.statusText || 'Unknown error'}`);
|
|
120
|
+
}
|
|
121
|
+
return response.json();
|
|
122
|
+
};
|
|
123
|
+
exports.fetchTimelockRequests = fetchTimelockRequests;
|
|
124
|
+
/**
|
|
125
|
+
* Fetch a vault's performance-fee computation
|
|
126
|
+
* (`GET /metrics/vault_performance_fees`). Slow first call (pandas over full
|
|
127
|
+
* snapshot history); 20-minute server-side cache.
|
|
128
|
+
*/
|
|
129
|
+
const fetchVaultPerformanceFees = async (params, upshiftKey, headers) => {
|
|
130
|
+
const response = await (0, core_1.fetchUpshiftWithKey)(upshiftKey, core_1.WEBSERVER_ENDPOINTS.metrics.vaultPerformanceFees(params), { headers });
|
|
131
|
+
if (!response.ok || typeof response.json !== 'function') {
|
|
132
|
+
throw new Error(`Failed to fetch vault performance fees: ${response.statusText || 'Unknown error'}`);
|
|
133
|
+
}
|
|
134
|
+
return response.json();
|
|
135
|
+
};
|
|
136
|
+
exports.fetchVaultPerformanceFees = fetchVaultPerformanceFees;
|
|
137
|
+
/**
|
|
138
|
+
* Fetch a vault's NAV-oracle classification table from the public
|
|
139
|
+
* `GET /upshift/oracle_classification/{vault_address}` endpoint. No API key
|
|
140
|
+
* required.
|
|
141
|
+
*/
|
|
142
|
+
const fetchVaultOracleClassification = async (vaultAddress, chainId, headers) => {
|
|
143
|
+
const response = await (0, core_1.fetchUpshiftPublic)(core_1.WEBSERVER_ENDPOINTS.public.oracleClassification(vaultAddress, chainId), { headers });
|
|
144
|
+
if (!response.ok || typeof response.json !== 'function') {
|
|
145
|
+
throw new Error(`Failed to fetch vault oracle classification: ${response.statusText || 'Unknown error'}`);
|
|
146
|
+
}
|
|
147
|
+
return response.json();
|
|
148
|
+
};
|
|
149
|
+
exports.fetchVaultOracleClassification = fetchVaultOracleClassification;
|
|
150
|
+
/**
|
|
151
|
+
* Shared GET for the public transparency-dashboard endpoints. One HTTPS
|
|
152
|
+
* request, no RPC. `fetchUpshiftPublic` already maps non-2xx to typed
|
|
153
|
+
* `UpshiftServerError` / `UpshiftRateLimitError` / `UpshiftTimeoutError`, 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.fetchUpshiftPublic)(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;
|
|
187
|
+
//# sourceMappingURL=fetcher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { UpshiftApi } from './main';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpshiftApi = void 0;
|
|
4
|
+
var main_1 = require("./main");
|
|
5
|
+
Object.defineProperty(exports, "UpshiftApi", { enumerable: true, get: function () { return main_1.UpshiftApi; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|