@upshiftfinance/sdk 0.0.0-stage → 0.1.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/constants.d.ts +1 -0
- package/lib/adapters/sui/constants.js +9 -0
- package/lib/adapters/sui/getters.d.ts +24 -0
- package/lib/adapters/sui/getters.js +134 -0
- package/lib/adapters/sui/index.d.ts +53 -0
- package/lib/adapters/sui/index.js +96 -0
- package/lib/adapters/sui/transformer.d.ts +10 -0
- package/lib/adapters/sui/transformer.js +115 -0
- package/lib/adapters/sui/types.d.ts +70 -0
- package/lib/adapters/sui/types.js +3 -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 +30154 -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 +81 -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 +78 -3
|
@@ -0,0 +1,539 @@
|
|
|
1
|
+
import { type IContractWriteOptions, type INativeDepositOptions, type ApproveResult, type IClaimWithdrawalOptions, type IGetDepositRouteOptions } from '../../modules/vaults/write.actions';
|
|
2
|
+
import type { ISwapAndDepositOptions, ISwapRouterDirectDepositOptions, ISwapRouterNativeDepositOptions, ISwapRouterDepositOptions, ISwapRouterDepositResultOptions } from '../../types';
|
|
3
|
+
import { type IPreviewDepositOptions, type IPreviewRedeemOptions, type IAllowanceOptions, type IBalanceOfOptions, type IMaxDepositOptions, type IGetIdleLiquidityOptions, type ILagDurationOptions, type IGetWithdrawalEpochOptions, type IWithdrawalEpoch, type IGetBurnableAmountByReceiverOptions, type IGetRequirementByDateOptions, type IGetScheduledTransactionsByDateOptions, type IScheduledTransactionsByDate } from '../../modules/vaults/read.actions';
|
|
4
|
+
import { type CompatibleSigner } from '../../core/helpers/signer';
|
|
5
|
+
import type { IAddress, IContractRunner } from '../../types';
|
|
6
|
+
export * from './getters';
|
|
7
|
+
/**
|
|
8
|
+
* EVM Adapter for Upshift SDK
|
|
9
|
+
* Supports both ethers Signer/Wallet and wagmi/viem WalletClient
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* To access the EVM adapter instance
|
|
13
|
+
* ```
|
|
14
|
+
* const sdk = new UpshiftSDK()
|
|
15
|
+
* sdk.evm.vaultRedeem()
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
declare class EVMAdapter {
|
|
19
|
+
private signer?;
|
|
20
|
+
private rawSigner?;
|
|
21
|
+
private getReadProvider?;
|
|
22
|
+
/**
|
|
23
|
+
* @param signer - Optional ethers Signer/Wallet or viem WalletClient. Required
|
|
24
|
+
* for writes; reads fall back to `getReadProvider` when absent.
|
|
25
|
+
* @param getReadProvider - Optional thunk returning a read-only provider for
|
|
26
|
+
* the SDK's active network. Called on every signerless read so it tracks
|
|
27
|
+
* `switchNetwork`. `UpshiftSDK` wires this to its configured `providers`.
|
|
28
|
+
*/
|
|
29
|
+
constructor(signer?: CompatibleSigner, getReadProvider?: () => IContractRunner | undefined);
|
|
30
|
+
/**
|
|
31
|
+
* Set a new signer (supports both ethers and viem/wagmi)
|
|
32
|
+
* @param signer - Either an ethers Signer/Wallet or viem WalletClient
|
|
33
|
+
*/
|
|
34
|
+
setSigner(signer: CompatibleSigner): void;
|
|
35
|
+
/**
|
|
36
|
+
* Get the normalized ethers-compatible signer
|
|
37
|
+
* Converts viem WalletClient to ethers Signer if needed
|
|
38
|
+
*/
|
|
39
|
+
private _getSigner;
|
|
40
|
+
/**
|
|
41
|
+
* Resolve the contract runner for a read-only call. Prefers the signer when
|
|
42
|
+
* one is set (preserving the signer's chain), otherwise falls back to the
|
|
43
|
+
* read provider for the SDK's active network, so reads such as `balanceOf`
|
|
44
|
+
* or `previewDeposit` work before `setSigner` is called.
|
|
45
|
+
*
|
|
46
|
+
* No extra RPC calls: the provider comes from the `createProvider` cache.
|
|
47
|
+
*
|
|
48
|
+
* @throws {@link UpshiftSDKError} `NO_SIGNER` when neither a signer nor a read
|
|
49
|
+
* provider (configured `providers` entry) is available.
|
|
50
|
+
*/
|
|
51
|
+
private _getReadRunner;
|
|
52
|
+
vaultApprove(options: IContractWriteOptions): Promise<string>;
|
|
53
|
+
/**
|
|
54
|
+
* Approve a vault to spend a deposit token, returning a discriminated
|
|
55
|
+
* {@link ApproveResult} so callers can tell `sent` from `sufficient`
|
|
56
|
+
* (existing allowance covers) and `native` (no allowance applies).
|
|
57
|
+
* Prefer this over {@link vaultApprove} for new integrations.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* const r = await upshiftSdk.evm.approve({
|
|
62
|
+
* target: vaultAddress,
|
|
63
|
+
* wallet: walletAddress,
|
|
64
|
+
* amount: '100',
|
|
65
|
+
* wait: true,
|
|
66
|
+
* });
|
|
67
|
+
* if (r.kind === 'sent') console.log('approve tx', r.hash);
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
approve(options: IContractWriteOptions): Promise<ApproveResult>;
|
|
71
|
+
/**
|
|
72
|
+
* Read the ERC-20 allowance the wallet has granted the vault to spend its
|
|
73
|
+
* underlying asset, returned as a normalized number. For the newer typed
|
|
74
|
+
* read that returns a raw `bigint` and accepts an explicit `asset` override,
|
|
75
|
+
* use {@link EVMAdapter.allowance}.
|
|
76
|
+
*
|
|
77
|
+
* Only `target` (vault address) and `wallet` are read from `options`; the
|
|
78
|
+
* remaining {@link IContractWriteOptions} fields are ignored.
|
|
79
|
+
*
|
|
80
|
+
* @param options - `{ target, wallet }` (other fields ignored).
|
|
81
|
+
* @returns Normalized allowance (`{ raw, normalized }`), or `undefined` when
|
|
82
|
+
* `target` / `wallet` fail address validation.
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```ts
|
|
86
|
+
* const a = await upshiftSdk.evm.vaultAllowance({
|
|
87
|
+
* target: vaultAddress,
|
|
88
|
+
* wallet: walletAddress,
|
|
89
|
+
* });
|
|
90
|
+
* console.log(a?.normalized);
|
|
91
|
+
* ```
|
|
92
|
+
*
|
|
93
|
+
* @throws {@link UpshiftSDKError} `NO_SIGNER` when the SDK has no signer and no
|
|
94
|
+
* configured provider for the active network.
|
|
95
|
+
*/
|
|
96
|
+
vaultAllowance(options: IContractWriteOptions): Promise<import("../../types").INormalizedNumber>;
|
|
97
|
+
/**
|
|
98
|
+
* Deposit into an Upshift vault. Routes automatically: V1 single-asset vaults
|
|
99
|
+
* deposit the underlying directly; V2 multi-asset vaults route through the
|
|
100
|
+
* adapter for non-underlying `depositAsset`. With `attribution.originCode`
|
|
101
|
+
* configured, eligible deposits go through the SwapRouter instead (see
|
|
102
|
+
* {@link EVMAdapter.getDepositRoute}). If allowance is insufficient
|
|
103
|
+
* the method submits an approve transaction first (the approve step always
|
|
104
|
+
* waits for confirmation to close a race window, regardless of `wait`).
|
|
105
|
+
*
|
|
106
|
+
* @param options - {@link IContractWriteOptions}. `target` and `wallet` are
|
|
107
|
+
* required; pass `amount`, `depositAsset` (defaults to the vault's
|
|
108
|
+
* underlying), `chainId`, `poolName`, `wait`, and `isDepositWithPermit`
|
|
109
|
+
* as needed.
|
|
110
|
+
* @returns The deposit `TransactionResponse`, or `undefined` if an
|
|
111
|
+
* approval-only path was taken and no deposit transaction was sent.
|
|
112
|
+
* @throws UpshiftValidationError on invalid inputs (bad address, bad amount).
|
|
113
|
+
* @throws UpshiftSDKError on RPC / contract revert during the deposit.
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* ```ts
|
|
117
|
+
* const tx = await upshiftSdk.evm.vaultDeposit({
|
|
118
|
+
* target: vaultAddress,
|
|
119
|
+
* wallet: walletAddress,
|
|
120
|
+
* amount: '100',
|
|
121
|
+
* wait: true,
|
|
122
|
+
* });
|
|
123
|
+
* ```
|
|
124
|
+
*/
|
|
125
|
+
vaultDeposit(options: IContractWriteOptions): Promise<string>;
|
|
126
|
+
/**
|
|
127
|
+
* Resolve whether a deposit goes through the SwapRouter with the instance
|
|
128
|
+
* origin code or takes the vault's native path, and the address to approve
|
|
129
|
+
* (`route.spender`, not necessarily the vault). See {@link getDepositRoute}.
|
|
130
|
+
*
|
|
131
|
+
* @param options - {@link IGetDepositRouteOptions}.
|
|
132
|
+
* @returns `{ via, spender, reason? }` — `reason` explains a native route
|
|
133
|
+
* (`router-paused` while the SwapRouter is paused).
|
|
134
|
+
* @throws UpshiftValidationError on an invalid target, or an unregistered
|
|
135
|
+
* code under `attribution.strictOrigin` while the router is not paused.
|
|
136
|
+
* @throws UpshiftSDKError when a backend, vault or router read fails.
|
|
137
|
+
* @example
|
|
138
|
+
* ```ts
|
|
139
|
+
* const { via, spender } = await upshiftSdk.evm.getDepositRoute({ target: vault });
|
|
140
|
+
* ```
|
|
141
|
+
*/
|
|
142
|
+
getDepositRoute(options: IGetDepositRouteOptions): Promise<import("../../modules/vaults/write.actions").IDepositRoute>;
|
|
143
|
+
/**
|
|
144
|
+
* Submit a redemption request against a vault. Shares are escrowed and the
|
|
145
|
+
* underlying assets are released asynchronously by the protocol; callers
|
|
146
|
+
* collect the matured assets via {@link EVMAdapter.vaultRedeem}, or use the
|
|
147
|
+
* instant-redeem variant by setting `isInstantRedeem: true`.
|
|
148
|
+
*
|
|
149
|
+
* @param options - {@link IContractWriteOptions}. `target`, `wallet`, and
|
|
150
|
+
* `amount` (in shares) are required. Set `isInstantRedeem: true` to take
|
|
151
|
+
* the instant-redeem path when the vault supports it.
|
|
152
|
+
* @returns The request `TransactionResponse`, or `undefined` if the request
|
|
153
|
+
* could not be built (validation failure).
|
|
154
|
+
* @throws UpshiftValidationError on invalid inputs.
|
|
155
|
+
* @throws UpshiftSDKError on RPC / contract revert.
|
|
156
|
+
*
|
|
157
|
+
* @example
|
|
158
|
+
* ```ts
|
|
159
|
+
* const tx = await upshiftSdk.evm.vaultRequestRedeem({
|
|
160
|
+
* target: vaultAddress,
|
|
161
|
+
* wallet: walletAddress,
|
|
162
|
+
* amount: shareAmount,
|
|
163
|
+
* wait: true,
|
|
164
|
+
* });
|
|
165
|
+
* ```
|
|
166
|
+
*/
|
|
167
|
+
vaultRequestRedeem(options: IContractWriteOptions): Promise<string>;
|
|
168
|
+
/**
|
|
169
|
+
* Deposit the chain's native asset (ETH / AVAX / etc.) into a vault by
|
|
170
|
+
* routing through the `MultiAssetNativeDepositWrapper`. The wrapper handles
|
|
171
|
+
* native-to-wrapped conversion and the subsequent vault deposit in a single
|
|
172
|
+
* transaction.
|
|
173
|
+
*
|
|
174
|
+
* @param options - {@link INativeDepositOptions}: `wrapperAddress`, `amount`
|
|
175
|
+
* (native, scaled by the chain's native decimals), optional `receiver`
|
|
176
|
+
* (defaults to the signer), and optional `wait`.
|
|
177
|
+
* @returns The deposit `TransactionResponse`.
|
|
178
|
+
* @throws UpshiftValidationError on invalid inputs.
|
|
179
|
+
* @throws UpshiftSDKError on RPC / contract revert.
|
|
180
|
+
*
|
|
181
|
+
* @example
|
|
182
|
+
* ```ts
|
|
183
|
+
* const tx = await upshiftSdk.evm.depositNative({
|
|
184
|
+
* wrapperAddress: nativeWrapperAddress,
|
|
185
|
+
* amount: parseEther('1'),
|
|
186
|
+
* wait: true,
|
|
187
|
+
* });
|
|
188
|
+
* ```
|
|
189
|
+
*/
|
|
190
|
+
depositNative(options: INativeDepositOptions): Promise<string>;
|
|
191
|
+
/**
|
|
192
|
+
* Swap one or more whitelisted ERC-20s into a vault's reference asset via
|
|
193
|
+
* the on-chain `SwapRouter` and deposit the proceeds. The router handles
|
|
194
|
+
* fee accrual, slippage protection, and the v1/v3 vs v2 deposit-interface
|
|
195
|
+
* branching. Approval is sent automatically for each `swaps[i].tokenIn`
|
|
196
|
+
* when the caller's allowance against the SwapRouter is below `amountIn`.
|
|
197
|
+
*
|
|
198
|
+
* @param options - {@link ISwapAndDepositOptions}.
|
|
199
|
+
* @returns The transaction hash of the `swapAndDeposit` call.
|
|
200
|
+
* @throws UpshiftValidationError on invalid inputs (bad chain, empty swaps).
|
|
201
|
+
* @throws UpshiftSDKError while the SwapRouter is paused (checked before any
|
|
202
|
+
* approval), or on RPC / contract revert.
|
|
203
|
+
*
|
|
204
|
+
* @example
|
|
205
|
+
* ```ts
|
|
206
|
+
* const quote = await fetchSwapQuote({
|
|
207
|
+
* chainId: 1, srcToken: WBTC, srcDecimals: 8,
|
|
208
|
+
* destToken: USDC, destDecimals: 6, amount: 100_000_000n,
|
|
209
|
+
* receiver: SWAP_ROUTER_ADDRESSES[1]!,
|
|
210
|
+
* });
|
|
211
|
+
* const hash = await upshiftSdk.evm.swapAndDeposit({
|
|
212
|
+
* chainId: 1, vault, receiver: wallet,
|
|
213
|
+
* swaps: [{ tokenIn: WBTC, tokenOut: USDC, amountIn: 100_000_000n,
|
|
214
|
+
* minAmountOut: quote.minAmountOut, router: quote.router, payload: quote.payload }],
|
|
215
|
+
* });
|
|
216
|
+
* ```
|
|
217
|
+
*/
|
|
218
|
+
swapAndDeposit(options: ISwapAndDepositOptions): Promise<string>;
|
|
219
|
+
/**
|
|
220
|
+
* Deposit a vault's reference asset through the SwapRouter — no swap.
|
|
221
|
+
* Use this when the caller already holds the reference asset but wants
|
|
222
|
+
* the origin/referral fee accounting that the SwapRouter path provides.
|
|
223
|
+
*
|
|
224
|
+
* @param options - {@link ISwapRouterDirectDepositOptions}.
|
|
225
|
+
* @returns The transaction hash of the `deposit` call.
|
|
226
|
+
* @throws UpshiftSDKError while the SwapRouter is paused (checked before any
|
|
227
|
+
* approval), or on RPC / contract revert.
|
|
228
|
+
*/
|
|
229
|
+
depositViaSwapRouter(options: ISwapRouterDirectDepositOptions): Promise<string>;
|
|
230
|
+
/**
|
|
231
|
+
* Deposit native ETH (or chain-native equivalent) into a vault via the
|
|
232
|
+
* SwapRouter. Only valid when the vault's reference asset is the chain's
|
|
233
|
+
* wrapped-native token — the SwapRouter wraps `amount` and deposits.
|
|
234
|
+
*
|
|
235
|
+
* @param options - {@link ISwapRouterNativeDepositOptions}.
|
|
236
|
+
* @returns The transaction hash of the `depositNativeToken` call.
|
|
237
|
+
* @throws UpshiftSDKError while the SwapRouter is paused (checked before any
|
|
238
|
+
* approval), or on RPC / contract revert.
|
|
239
|
+
*/
|
|
240
|
+
depositNativeViaSwapRouter(options: ISwapRouterNativeDepositOptions): Promise<string>;
|
|
241
|
+
/**
|
|
242
|
+
* Deposit into a vault through the on-chain `SwapRouter`, choosing the router
|
|
243
|
+
* path from `depositAsset` (direct deposit, native wrap, or a swap to the
|
|
244
|
+
* reference asset). The explicit, opt-in swap entry point —
|
|
245
|
+
* {@link vaultDeposit} never swaps — so a native-deposit vault is never
|
|
246
|
+
* accidentally swapped.
|
|
247
|
+
*
|
|
248
|
+
* Reads the vault's reference asset + decimals on-chain, resolves the swap
|
|
249
|
+
* quote and fail-closes on aggregator/whitelist drift, and sends the ERC-20
|
|
250
|
+
* approval to the SwapRouter when allowance is short.
|
|
251
|
+
*
|
|
252
|
+
* @param options - {@link ISwapRouterDepositOptions}.
|
|
253
|
+
* @returns The transaction hash of the router deposit call.
|
|
254
|
+
* @throws UpshiftValidationError on unsupported chain, invalid address, zero
|
|
255
|
+
* amount, a native deposit into a non-wrapped-native vault, or quote drift.
|
|
256
|
+
* @throws UpshiftSDKError while the SwapRouter is paused (checked before any
|
|
257
|
+
* approval), or on RPC / contract revert.
|
|
258
|
+
* @example
|
|
259
|
+
* ```ts
|
|
260
|
+
* const hash = await upshiftSdk.evm.swapRouterDeposit({
|
|
261
|
+
* chainId: 1, vault, depositAsset: USDT, amount: '100', slippageBps: 50,
|
|
262
|
+
* });
|
|
263
|
+
* ```
|
|
264
|
+
*/
|
|
265
|
+
swapRouterDeposit(options: ISwapRouterDepositOptions): Promise<string>;
|
|
266
|
+
/**
|
|
267
|
+
* Resolves the real, post-execution outcome of a SwapRouter deposit from
|
|
268
|
+
* its mined receipt — the actual amount that reached the vault (and shares
|
|
269
|
+
* minted), decoded from the vault's own `Deposit` event, rather than the
|
|
270
|
+
* pre-trade quote shown before submission.
|
|
271
|
+
*
|
|
272
|
+
* @param options - {@link ISwapRouterDepositResultOptions}.
|
|
273
|
+
* @returns The decoded {@link ISwapRouterDepositResult}, or `null` if the
|
|
274
|
+
* receipt isn't found yet or carries no matching `Deposit` log.
|
|
275
|
+
* @example
|
|
276
|
+
* ```ts
|
|
277
|
+
* const hash = await upshiftSdk.evm.swapRouterDeposit({ ... });
|
|
278
|
+
* const result = await upshiftSdk.evm.getSwapRouterDepositResult({ txHash: hash, vault });
|
|
279
|
+
* ```
|
|
280
|
+
*/
|
|
281
|
+
getSwapRouterDepositResult(options: ISwapRouterDepositResultOptions): Promise<import("../../types").ISwapRouterDepositResult>;
|
|
282
|
+
/**
|
|
283
|
+
* Claim assets from a matured redemption request on a dated-redemption
|
|
284
|
+
* (RWA-style) vault. The `year`, `month`, `day`, and `receiverIndex` tuple
|
|
285
|
+
* identifies which batch of the user's matured requests to redeem from —
|
|
286
|
+
* these are emitted at request-time and indexed by the subgraph.
|
|
287
|
+
*
|
|
288
|
+
* For non-dated vaults that complete their redemption via `instantRedeem`,
|
|
289
|
+
* see {@link EVMAdapter.vaultRequestRedeem} with `isInstantRedeem: true`.
|
|
290
|
+
*
|
|
291
|
+
* @param options - {@link IContractWriteOptions} plus `year` / `month` /
|
|
292
|
+
* `day` / `receiverIndex` identifying the matured batch to claim.
|
|
293
|
+
* @returns The redeem `TransactionResponse`.
|
|
294
|
+
* @throws UpshiftValidationError on invalid inputs.
|
|
295
|
+
* @throws UpshiftSDKError on RPC / contract revert.
|
|
296
|
+
*
|
|
297
|
+
* @example
|
|
298
|
+
* ```ts
|
|
299
|
+
* const tx = await upshiftSdk.evm.vaultRedeem({
|
|
300
|
+
* target: vaultAddress,
|
|
301
|
+
* wallet: walletAddress,
|
|
302
|
+
* amount: shareAmount,
|
|
303
|
+
* year: '2026',
|
|
304
|
+
* month: '06',
|
|
305
|
+
* day: '02',
|
|
306
|
+
* receiverIndex: '0',
|
|
307
|
+
* wait: true,
|
|
308
|
+
* });
|
|
309
|
+
* ```
|
|
310
|
+
*/
|
|
311
|
+
vaultRedeem(options: IContractWriteOptions & {
|
|
312
|
+
year: string;
|
|
313
|
+
month: string;
|
|
314
|
+
day: string;
|
|
315
|
+
receiverIndex: string;
|
|
316
|
+
}): Promise<string>;
|
|
317
|
+
/**
|
|
318
|
+
* Claim a previously-requested queued withdrawal on an EVM-2 (Tokenized
|
|
319
|
+
* Vault V2) vault, once its withdrawal epoch has passed. EVM-2 only — v1/v0
|
|
320
|
+
* vaults use {@link EVMAdapter.vaultRedeem} instead.
|
|
321
|
+
*
|
|
322
|
+
* @param options - {@link IClaimWithdrawalOptions}: `target` / `wallet`
|
|
323
|
+
* plus the `year` / `month` / `day` tuple returned by
|
|
324
|
+
* `vaultRequestRedeem`.
|
|
325
|
+
* @returns Claim transaction hash.
|
|
326
|
+
* @throws UpshiftValidationError on invalid inputs or a non-EVM-2 vault.
|
|
327
|
+
* @throws UpshiftSDKError on RPC / contract revert.
|
|
328
|
+
*
|
|
329
|
+
* @example
|
|
330
|
+
* ```ts
|
|
331
|
+
* const { year, month, day } = await upshiftSdk.evm.vaultRequestRedeem({
|
|
332
|
+
* target: vaultAddress,
|
|
333
|
+
* wallet: walletAddress,
|
|
334
|
+
* amount: '10',
|
|
335
|
+
* });
|
|
336
|
+
* await upshiftSdk.evm.claimWithdrawal({
|
|
337
|
+
* target: vaultAddress,
|
|
338
|
+
* wallet: walletAddress,
|
|
339
|
+
* year,
|
|
340
|
+
* month,
|
|
341
|
+
* day,
|
|
342
|
+
* wait: true,
|
|
343
|
+
* });
|
|
344
|
+
* ```
|
|
345
|
+
*/
|
|
346
|
+
claimWithdrawal(options: IClaimWithdrawalOptions): Promise<string>;
|
|
347
|
+
sendersWhitelistAddress(options: {
|
|
348
|
+
vault: IAddress;
|
|
349
|
+
}): Promise<`0x${string}`>;
|
|
350
|
+
isWhitelisted(options: {
|
|
351
|
+
whitelist: IAddress;
|
|
352
|
+
wallet: IAddress;
|
|
353
|
+
}): Promise<boolean>;
|
|
354
|
+
getDeposited(options: {
|
|
355
|
+
whitelist: IAddress;
|
|
356
|
+
wallet: IAddress;
|
|
357
|
+
vault: IAddress;
|
|
358
|
+
}): Promise<import("../../types").INormalizedNumber>;
|
|
359
|
+
getRemainingAllocations(options: {
|
|
360
|
+
whitelist: IAddress;
|
|
361
|
+
wallet: IAddress;
|
|
362
|
+
vault: IAddress;
|
|
363
|
+
depositCapAmount?: bigint;
|
|
364
|
+
}): Promise<import("../../types").INormalizedNumber>;
|
|
365
|
+
/**
|
|
366
|
+
* Preview the share output of a deposit without broadcasting a transaction.
|
|
367
|
+
* See {@link readPreviewDeposit} for the routing details (EVM-1 vs EVM-2
|
|
368
|
+
* multi-asset vaults).
|
|
369
|
+
*
|
|
370
|
+
* @returns Shares minted in raw on-chain units (share-token decimals).
|
|
371
|
+
*
|
|
372
|
+
* @example
|
|
373
|
+
* ```ts
|
|
374
|
+
* const shares = await upshiftSdk.evm.previewDeposit({
|
|
375
|
+
* vault: '0x...',
|
|
376
|
+
* amount: 1_000_000n,
|
|
377
|
+
* });
|
|
378
|
+
* ```
|
|
379
|
+
*
|
|
380
|
+
* @throws {@link UpshiftSDKError} `NO_SIGNER` when the SDK has no signer and no
|
|
381
|
+
* configured provider for the active network.
|
|
382
|
+
*/
|
|
383
|
+
previewDeposit(options: IPreviewDepositOptions): Promise<bigint>;
|
|
384
|
+
/**
|
|
385
|
+
* Preview the assets returned by redeeming a number of shares, without
|
|
386
|
+
* broadcasting a transaction.
|
|
387
|
+
*
|
|
388
|
+
* @returns Assets returned in raw on-chain units (asset decimals).
|
|
389
|
+
*
|
|
390
|
+
* @example
|
|
391
|
+
* ```ts
|
|
392
|
+
* const assets = await upshiftSdk.evm.previewRedeem({
|
|
393
|
+
* vault: '0x...',
|
|
394
|
+
* shares: 1_000_000_000_000_000_000n,
|
|
395
|
+
* });
|
|
396
|
+
* ```
|
|
397
|
+
*
|
|
398
|
+
* @throws {@link UpshiftSDKError} `NO_SIGNER` when the SDK has no signer and no
|
|
399
|
+
* configured provider for the active network.
|
|
400
|
+
*/
|
|
401
|
+
previewRedeem(options: IPreviewRedeemOptions): Promise<bigint>;
|
|
402
|
+
/**
|
|
403
|
+
* Read the ERC-20 allowance an owner has granted the vault. Defaults to the
|
|
404
|
+
* vault's underlying asset; pass `asset` to override.
|
|
405
|
+
*
|
|
406
|
+
* @returns Allowance as a raw `bigint`.
|
|
407
|
+
*
|
|
408
|
+
* @example
|
|
409
|
+
* ```ts
|
|
410
|
+
* const raw = await upshiftSdk.evm.allowance({ vault, owner });
|
|
411
|
+
* ```
|
|
412
|
+
*
|
|
413
|
+
* @throws {@link UpshiftSDKError} `NO_SIGNER` when the SDK has no signer and no
|
|
414
|
+
* configured provider for the active network.
|
|
415
|
+
*/
|
|
416
|
+
allowance(options: IAllowanceOptions): Promise<bigint>;
|
|
417
|
+
/**
|
|
418
|
+
* Read an ERC-20 token balance.
|
|
419
|
+
*
|
|
420
|
+
* @returns Balance as a raw `bigint`.
|
|
421
|
+
*
|
|
422
|
+
* @example
|
|
423
|
+
* ```ts
|
|
424
|
+
* const raw = await upshiftSdk.evm.balanceOf({ asset: usdcAddress, owner });
|
|
425
|
+
* ```
|
|
426
|
+
*
|
|
427
|
+
* @throws {@link UpshiftSDKError} `NO_SIGNER` when the SDK has no signer and no
|
|
428
|
+
* configured provider for the active network.
|
|
429
|
+
*/
|
|
430
|
+
balanceOf(options: IBalanceOfOptions): Promise<bigint>;
|
|
431
|
+
/**
|
|
432
|
+
* Read the maximum deposit accepted by the vault for the supplied
|
|
433
|
+
* receiver. Useful for "vault is full" gates.
|
|
434
|
+
*
|
|
435
|
+
* @returns Max deposit as a raw `bigint`.
|
|
436
|
+
*
|
|
437
|
+
* @example
|
|
438
|
+
* ```ts
|
|
439
|
+
* const cap = await upshiftSdk.evm.maxDeposit({ vault });
|
|
440
|
+
* ```
|
|
441
|
+
*
|
|
442
|
+
* @throws {@link UpshiftSDKError} `NO_SIGNER` when the SDK has no signer and no
|
|
443
|
+
* configured provider for the active network.
|
|
444
|
+
*/
|
|
445
|
+
maxDeposit(options: IMaxDepositOptions): Promise<bigint>;
|
|
446
|
+
/**
|
|
447
|
+
* Read an EVM-2 vault's idle liquidity (`getTotalAssets() -
|
|
448
|
+
* externalAssets()`) — the balance available to an instant redemption
|
|
449
|
+
* without a synchronous recall from the settlement module.
|
|
450
|
+
*
|
|
451
|
+
* @returns Idle liquidity as a raw `bigint`.
|
|
452
|
+
*
|
|
453
|
+
* @example
|
|
454
|
+
* ```ts
|
|
455
|
+
* const idle = await upshiftSdk.evm.getIdleLiquidity({ vault });
|
|
456
|
+
* ```
|
|
457
|
+
*
|
|
458
|
+
* @throws {@link UpshiftSDKError} `NO_SIGNER` when the SDK has no signer and no
|
|
459
|
+
* configured provider for the active network.
|
|
460
|
+
*/
|
|
461
|
+
getIdleLiquidity(options: IGetIdleLiquidityOptions): Promise<bigint>;
|
|
462
|
+
/**
|
|
463
|
+
* Read an EVM-2 vault's queued-withdrawal lag, in seconds.
|
|
464
|
+
*
|
|
465
|
+
* @returns Lag duration as a raw `bigint`.
|
|
466
|
+
*
|
|
467
|
+
* @example
|
|
468
|
+
* ```ts
|
|
469
|
+
* const seconds = await upshiftSdk.evm.lagDuration({ vault });
|
|
470
|
+
* ```
|
|
471
|
+
*
|
|
472
|
+
* @throws {@link UpshiftSDKError} `NO_SIGNER` when the SDK has no signer and no
|
|
473
|
+
* configured provider for the active network.
|
|
474
|
+
*/
|
|
475
|
+
lagDuration(options: ILagDurationOptions): Promise<bigint>;
|
|
476
|
+
/**
|
|
477
|
+
* Read an EVM-2 vault's current withdrawal epoch by named field
|
|
478
|
+
* (`year`/`month`/`day`/`claimableEpoch`).
|
|
479
|
+
*
|
|
480
|
+
* @returns {@link IWithdrawalEpoch}.
|
|
481
|
+
*
|
|
482
|
+
* @example
|
|
483
|
+
* ```ts
|
|
484
|
+
* const epoch = await upshiftSdk.evm.getWithdrawalEpoch({ vault });
|
|
485
|
+
* ```
|
|
486
|
+
*
|
|
487
|
+
* @throws {@link UpshiftSDKError} `NO_SIGNER` when the SDK has no signer and no
|
|
488
|
+
* configured provider for the active network.
|
|
489
|
+
*/
|
|
490
|
+
getWithdrawalEpoch(options: IGetWithdrawalEpochOptions): Promise<IWithdrawalEpoch>;
|
|
491
|
+
/**
|
|
492
|
+
* Read how much of a withdrawal-epoch date's queue a receiver can
|
|
493
|
+
* currently claim, before calling {@link EVMAdapter.claimWithdrawal}.
|
|
494
|
+
*
|
|
495
|
+
* @returns Claimable amount as a raw `bigint`.
|
|
496
|
+
*
|
|
497
|
+
* @example
|
|
498
|
+
* ```ts
|
|
499
|
+
* const claimable = await upshiftSdk.evm.getBurnableAmountByReceiver({
|
|
500
|
+
* vault, receiver, year, month, day,
|
|
501
|
+
* });
|
|
502
|
+
* ```
|
|
503
|
+
*
|
|
504
|
+
* @throws {@link UpshiftSDKError} `NO_SIGNER` when the SDK has no signer and no
|
|
505
|
+
* configured provider for the active network.
|
|
506
|
+
*/
|
|
507
|
+
getBurnableAmountByReceiver(options: IGetBurnableAmountByReceiverOptions): Promise<bigint>;
|
|
508
|
+
/**
|
|
509
|
+
* Read the total shares required to settle a withdrawal-epoch date's
|
|
510
|
+
* entire queue.
|
|
511
|
+
*
|
|
512
|
+
* @returns Required shares as a raw `bigint`.
|
|
513
|
+
*
|
|
514
|
+
* @example
|
|
515
|
+
* ```ts
|
|
516
|
+
* const shares = await upshiftSdk.evm.getRequirementByDate({ vault, year, month, day });
|
|
517
|
+
* ```
|
|
518
|
+
*
|
|
519
|
+
* @throws {@link UpshiftSDKError} `NO_SIGNER` when the SDK has no signer and no
|
|
520
|
+
* configured provider for the active network.
|
|
521
|
+
*/
|
|
522
|
+
getRequirementByDate(options: IGetRequirementByDateOptions): Promise<bigint>;
|
|
523
|
+
/**
|
|
524
|
+
* Read the scheduled queued-withdrawal volume for a withdrawal-epoch date.
|
|
525
|
+
*
|
|
526
|
+
* @returns {@link IScheduledTransactionsByDate}.
|
|
527
|
+
*
|
|
528
|
+
* @example
|
|
529
|
+
* ```ts
|
|
530
|
+
* const { totalTransactions, executionEpoch } =
|
|
531
|
+
* await upshiftSdk.evm.getScheduledTransactionsByDate({ vault, year, month, day });
|
|
532
|
+
* ```
|
|
533
|
+
*
|
|
534
|
+
* @throws {@link UpshiftSDKError} `NO_SIGNER` when the SDK has no signer and no
|
|
535
|
+
* configured provider for the active network.
|
|
536
|
+
*/
|
|
537
|
+
getScheduledTransactionsByDate(options: IGetScheduledTransactionsByDateOptions): Promise<IScheduledTransactionsByDate>;
|
|
538
|
+
}
|
|
539
|
+
export default EVMAdapter;
|