upshift-finance 1.0.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 +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,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ABI_WRAPPER_ADAPTER = void 0;
|
|
4
|
+
exports.ABI_WRAPPER_ADAPTER = [
|
|
5
|
+
{
|
|
6
|
+
inputs: [{ internalType: 'address', name: 'referralId', type: 'address' }],
|
|
7
|
+
name: 'depositETH',
|
|
8
|
+
outputs: [],
|
|
9
|
+
stateMutability: 'payable',
|
|
10
|
+
type: 'function',
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
inputs: [
|
|
14
|
+
{ internalType: 'uint256', name: 'amount', type: 'uint256' },
|
|
15
|
+
{ internalType: 'address', name: 'referralId', type: 'address' },
|
|
16
|
+
],
|
|
17
|
+
name: 'depositWETH',
|
|
18
|
+
outputs: [],
|
|
19
|
+
stateMutability: 'nonpayable',
|
|
20
|
+
type: 'function',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
inputs: [{ internalType: 'address', name: 'referralId', type: 'address' }],
|
|
24
|
+
name: 'getRSETHWithETH',
|
|
25
|
+
outputs: [],
|
|
26
|
+
stateMutability: 'payable',
|
|
27
|
+
type: 'function',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
inputs: [
|
|
31
|
+
{
|
|
32
|
+
internalType: 'address',
|
|
33
|
+
name: 'asset',
|
|
34
|
+
type: 'address',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
internalType: 'uint256',
|
|
38
|
+
name: 'depositAmount',
|
|
39
|
+
type: 'uint256',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
internalType: 'string',
|
|
43
|
+
name: 'referralId',
|
|
44
|
+
type: 'string',
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
name: 'getRSETHWithERC20',
|
|
48
|
+
outputs: [],
|
|
49
|
+
stateMutability: 'nonpayable',
|
|
50
|
+
type: 'function',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
inputs: [
|
|
54
|
+
{
|
|
55
|
+
internalType: 'address',
|
|
56
|
+
name: 'asset',
|
|
57
|
+
type: 'address',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
internalType: 'uint256',
|
|
61
|
+
name: 'depositAmount',
|
|
62
|
+
type: 'uint256',
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
name: 'getRsETHAmountToMint',
|
|
66
|
+
outputs: [
|
|
67
|
+
{
|
|
68
|
+
internalType: 'uint256',
|
|
69
|
+
name: 'rsETHAmount',
|
|
70
|
+
type: 'uint256',
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
stateMutability: 'view',
|
|
74
|
+
type: 'function',
|
|
75
|
+
},
|
|
76
|
+
];
|
|
77
|
+
//# sourceMappingURL=WrapperAdapter.js.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Contract ABI definitions for interacting with August/Upshift smart contracts.
|
|
3
|
+
*
|
|
4
|
+
* @module ABIs
|
|
5
|
+
*/
|
|
6
|
+
export * from './LendingPool';
|
|
7
|
+
export * from './ERC20';
|
|
8
|
+
export * from './Loan';
|
|
9
|
+
export * from './FeeOracle';
|
|
10
|
+
export * from './AddressResolver';
|
|
11
|
+
export * from './ERC20_Bytes32';
|
|
12
|
+
export * from './ERC4626';
|
|
13
|
+
export * from './ERC721';
|
|
14
|
+
export * from './LendingPoolV2';
|
|
15
|
+
export * from './Multicall3';
|
|
16
|
+
export * from './SmartAccount';
|
|
17
|
+
export * from './TextResolver';
|
|
18
|
+
export * from './UniversalResolverResolve';
|
|
19
|
+
export * from './UniversalSignatureValidator';
|
|
20
|
+
export * from './ChainlinkV3';
|
|
21
|
+
export * from './RewardDistributor';
|
|
22
|
+
export * from './WrapperAdapter';
|
|
23
|
+
export * from './PoolAdapter';
|
|
24
|
+
export * from './LendingPoolV3';
|
|
25
|
+
export * from './TokenizedVaultV2WhitelistedAssets';
|
|
26
|
+
export * from './TokenizedVaultV2';
|
|
27
|
+
export * from './TokenizedVaultV2Receipt';
|
|
28
|
+
export * from './TokenizedVaultV2DepositWithPermit';
|
|
29
|
+
export * from './TokenizedVaultV2WhitelistedAllocation';
|
|
30
|
+
export * from './MultiAssetNativeDepositWrapper';
|
|
31
|
+
export * from './TokenizedVaultV2SenderAllocationWhitelist';
|
|
32
|
+
export * from './RwaRedeemSubaccount';
|
|
33
|
+
export * from './OFT';
|
|
34
|
+
export * from './SwapRouter';
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Contract ABI definitions for interacting with August/Upshift smart contracts.
|
|
4
|
+
*
|
|
5
|
+
* @module ABIs
|
|
6
|
+
*/
|
|
7
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
8
|
+
if (k2 === undefined) k2 = k;
|
|
9
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
10
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
11
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
12
|
+
}
|
|
13
|
+
Object.defineProperty(o, k2, desc);
|
|
14
|
+
}) : (function(o, m, k, k2) {
|
|
15
|
+
if (k2 === undefined) k2 = k;
|
|
16
|
+
o[k2] = m[k];
|
|
17
|
+
}));
|
|
18
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
19
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
__exportStar(require("./LendingPool"), exports);
|
|
23
|
+
__exportStar(require("./ERC20"), exports);
|
|
24
|
+
__exportStar(require("./Loan"), exports);
|
|
25
|
+
__exportStar(require("./FeeOracle"), exports);
|
|
26
|
+
__exportStar(require("./AddressResolver"), exports);
|
|
27
|
+
__exportStar(require("./ERC20_Bytes32"), exports);
|
|
28
|
+
__exportStar(require("./ERC4626"), exports);
|
|
29
|
+
__exportStar(require("./ERC721"), exports);
|
|
30
|
+
__exportStar(require("./LendingPoolV2"), exports);
|
|
31
|
+
__exportStar(require("./Multicall3"), exports);
|
|
32
|
+
__exportStar(require("./SmartAccount"), exports);
|
|
33
|
+
__exportStar(require("./TextResolver"), exports);
|
|
34
|
+
__exportStar(require("./UniversalResolverResolve"), exports);
|
|
35
|
+
__exportStar(require("./UniversalSignatureValidator"), exports);
|
|
36
|
+
__exportStar(require("./ChainlinkV3"), exports);
|
|
37
|
+
__exportStar(require("./RewardDistributor"), exports);
|
|
38
|
+
__exportStar(require("./WrapperAdapter"), exports);
|
|
39
|
+
__exportStar(require("./PoolAdapter"), exports);
|
|
40
|
+
__exportStar(require("./LendingPoolV3"), exports);
|
|
41
|
+
__exportStar(require("./TokenizedVaultV2WhitelistedAssets"), exports);
|
|
42
|
+
__exportStar(require("./TokenizedVaultV2"), exports);
|
|
43
|
+
__exportStar(require("./TokenizedVaultV2Receipt"), exports);
|
|
44
|
+
__exportStar(require("./TokenizedVaultV2DepositWithPermit"), exports);
|
|
45
|
+
__exportStar(require("./TokenizedVaultV2WhitelistedAllocation"), exports);
|
|
46
|
+
__exportStar(require("./MultiAssetNativeDepositWrapper"), exports);
|
|
47
|
+
__exportStar(require("./TokenizedVaultV2SenderAllocationWhitelist"), exports);
|
|
48
|
+
__exportStar(require("./RwaRedeemSubaccount"), exports);
|
|
49
|
+
__exportStar(require("./OFT"), exports);
|
|
50
|
+
__exportStar(require("./SwapRouter"), exports);
|
|
51
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ITokenizedVault } from '../../types';
|
|
2
|
+
import type { IVaultBaseOptions } from '../../modules/vaults/types';
|
|
3
|
+
/**
|
|
4
|
+
* Fetch EVM vault data for v1 vault contracts (legacy format).
|
|
5
|
+
* Queries on-chain state and combines with backend metadata.
|
|
6
|
+
* @param tokenizedVault Vault metadata from backend
|
|
7
|
+
* @param options RPC configuration and chain details
|
|
8
|
+
* @returns Formatted vault object or null if closed/invisible
|
|
9
|
+
*/
|
|
10
|
+
export declare const getEvmVaultV1: (tokenizedVault: ITokenizedVault, options: IVaultBaseOptions) => Promise<import("../../types").IVault>;
|
|
11
|
+
/**
|
|
12
|
+
* Fetch EVM vault data for v2 vault contracts (current format).
|
|
13
|
+
* V2 vaults use separate contracts for vault, receipt token, and whitelist.
|
|
14
|
+
* Queries all three contracts and combines results.
|
|
15
|
+
* @param tokenizedVault Vault metadata from backend
|
|
16
|
+
* @param options RPC configuration and chain details
|
|
17
|
+
* @returns Formatted vault object or null if closed/invisible
|
|
18
|
+
*/
|
|
19
|
+
export declare const getEvmVaultV2: (tokenizedVault: ITokenizedVault, options: IVaultBaseOptions) => Promise<import("../../types").IVault>;
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getEvmVaultV2 = exports.getEvmVaultV1 = void 0;
|
|
4
|
+
const abis_1 = require("../../abis");
|
|
5
|
+
const core_1 = require("../../core");
|
|
6
|
+
const utils_1 = require("../../modules/vaults/utils");
|
|
7
|
+
const TokenizedVaultV2_1 = require("../../abis/TokenizedVaultV2");
|
|
8
|
+
const TokenizedVaultV2Receipt_1 = require("../../abis/TokenizedVaultV2Receipt");
|
|
9
|
+
/**
|
|
10
|
+
* Fetch EVM vault data for v1 vault contracts (legacy format).
|
|
11
|
+
* Queries on-chain state and combines with backend metadata.
|
|
12
|
+
* @param tokenizedVault Vault metadata from backend
|
|
13
|
+
* @param options RPC configuration and chain details
|
|
14
|
+
* @returns Formatted vault object or null if closed/invisible
|
|
15
|
+
*/
|
|
16
|
+
const getEvmVaultV1 = async (tokenizedVault, options) => {
|
|
17
|
+
const vault = tokenizedVault.address;
|
|
18
|
+
if (!vault) {
|
|
19
|
+
throw new Error('Vault address is undefined');
|
|
20
|
+
}
|
|
21
|
+
// Skip closed staging vaults that shouldn't be displayed — unless the caller
|
|
22
|
+
// explicitly opts in (portfolio mode), where a user's position in a closed,
|
|
23
|
+
// invisible vault must still resolve its metadata.
|
|
24
|
+
if (tokenizedVault.status === 'closed' &&
|
|
25
|
+
tokenizedVault.is_visible === false &&
|
|
26
|
+
!options?.includeClosed) {
|
|
27
|
+
core_1.Logger.log.warn('getEvmVaultV1', `closed: ${tokenizedVault.vault_name}`);
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
const provider = (0, core_1.createProvider)(options.rpcUrl);
|
|
31
|
+
// Batch fetch all vault contract data
|
|
32
|
+
const vaultContract = (0, core_1.createContract)({
|
|
33
|
+
address: vault,
|
|
34
|
+
abi: abis_1.ABI_LENDING_POOL_V2,
|
|
35
|
+
provider,
|
|
36
|
+
});
|
|
37
|
+
const vaultContractCalls = await Promise.all(core_1.VAULT_FUNCTIONS_V1.map(async (f) => {
|
|
38
|
+
if (f === 'totalSupply' || f === 'totalAssets') {
|
|
39
|
+
if ((0, core_1.getVaultVersionV2)(tokenizedVault) === 'evm-2' ||
|
|
40
|
+
core_1.MULTI_ASSET_VAULTS.includes(vault)) {
|
|
41
|
+
return 0;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if (f === 'maxDepositAmount') {
|
|
45
|
+
try {
|
|
46
|
+
return await vaultContract[f]();
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (f === 'symbol') {
|
|
53
|
+
return (0, core_1.getSymbol)(provider, vault);
|
|
54
|
+
}
|
|
55
|
+
if (f === 'decimals') {
|
|
56
|
+
return (0, core_1.getDecimals)(provider, vault);
|
|
57
|
+
}
|
|
58
|
+
return vaultContract[f]();
|
|
59
|
+
}));
|
|
60
|
+
// Normalize contract call results into typed object
|
|
61
|
+
const formattedContractCalls = vaultContractCalls.reduce((acc, curr, i) => {
|
|
62
|
+
let val;
|
|
63
|
+
if (core_1.VAULT_FUNCTIONS_V1[i] === 'maxDepositAmount') {
|
|
64
|
+
if (curr === null) {
|
|
65
|
+
return acc;
|
|
66
|
+
}
|
|
67
|
+
val = (0, core_1.toNormalizedBn)(curr, vaultContractCalls[0]);
|
|
68
|
+
}
|
|
69
|
+
else if (core_1.VAULT_FUNCTIONS_V1[i] === 'totalSupply' ||
|
|
70
|
+
core_1.VAULT_FUNCTIONS_V1[i] === 'totalAssets' ||
|
|
71
|
+
core_1.VAULT_FUNCTIONS_V1[i] === 'globalLoansAmount' ||
|
|
72
|
+
core_1.VAULT_FUNCTIONS_V1[i] === 'maxSupply') {
|
|
73
|
+
val = (0, core_1.toNormalizedBn)(curr, vaultContractCalls[0]);
|
|
74
|
+
}
|
|
75
|
+
else if (core_1.VAULT_FUNCTIONS_V1[i] === 'getTotalLoansDeployed') {
|
|
76
|
+
val = (0, core_1.toNormalizedBn)(curr, 0);
|
|
77
|
+
}
|
|
78
|
+
else if (core_1.VAULT_FUNCTIONS_V1[i] === 'withdrawalFee') {
|
|
79
|
+
val = (0, core_1.toNormalizedBn)(curr, 2);
|
|
80
|
+
}
|
|
81
|
+
else if (core_1.VAULT_FUNCTIONS_V1[i] === 'decimals') {
|
|
82
|
+
val = Number(curr.toString());
|
|
83
|
+
}
|
|
84
|
+
else if (core_1.VAULT_FUNCTIONS_V1[i] === 'loansOperator') {
|
|
85
|
+
// TODO: hardcoded as we cannot pull the real strategist
|
|
86
|
+
val = '0x4DCb388488622e47683EAd1a147947140a31e485';
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
val = curr;
|
|
90
|
+
}
|
|
91
|
+
return { ...acc, [core_1.VAULT_FUNCTIONS_V1[i]]: val };
|
|
92
|
+
}, {});
|
|
93
|
+
// Combine on-chain and backend data into unified vault object
|
|
94
|
+
const returnObj = await (0, utils_1.buildFormattedVault)(provider, tokenizedVault, formattedContractCalls);
|
|
95
|
+
return returnObj;
|
|
96
|
+
};
|
|
97
|
+
exports.getEvmVaultV1 = getEvmVaultV1;
|
|
98
|
+
/**
|
|
99
|
+
* Fetch EVM vault data for v2 vault contracts (current format).
|
|
100
|
+
* V2 vaults use separate contracts for vault, receipt token, and whitelist.
|
|
101
|
+
* Queries all three contracts and combines results.
|
|
102
|
+
* @param tokenizedVault Vault metadata from backend
|
|
103
|
+
* @param options RPC configuration and chain details
|
|
104
|
+
* @returns Formatted vault object or null if closed/invisible
|
|
105
|
+
*/
|
|
106
|
+
const getEvmVaultV2 = async (tokenizedVault, options) => {
|
|
107
|
+
const provider = (0, core_1.createProvider)(options.rpcUrl);
|
|
108
|
+
const vault = tokenizedVault.address;
|
|
109
|
+
if (!vault) {
|
|
110
|
+
throw new Error('Vault address is undefined');
|
|
111
|
+
}
|
|
112
|
+
// Skip closed staging vaults that shouldn't be displayed — unless the caller
|
|
113
|
+
// explicitly opts in (portfolio mode), where a user's position in a closed,
|
|
114
|
+
// invisible vault must still resolve its metadata.
|
|
115
|
+
if (tokenizedVault.status === 'closed' &&
|
|
116
|
+
tokenizedVault.is_visible === false &&
|
|
117
|
+
!options?.includeClosed) {
|
|
118
|
+
core_1.Logger.log.warn('getEvmVaultV2', `closed: ${tokenizedVault.vault_name}`);
|
|
119
|
+
return null;
|
|
120
|
+
}
|
|
121
|
+
// Fetch vault contract state
|
|
122
|
+
const vaultContract = (0, core_1.createContract)({
|
|
123
|
+
address: vault,
|
|
124
|
+
abi: TokenizedVaultV2_1.ABI_TOKENIZED_VAULT_V2,
|
|
125
|
+
provider,
|
|
126
|
+
});
|
|
127
|
+
const vaultContractCalls = await Promise.all(core_1.VAULT_FUNCTIONS_V2.map(async (f) => {
|
|
128
|
+
if (f === 'depositCap') {
|
|
129
|
+
try {
|
|
130
|
+
return await vaultContract[f]();
|
|
131
|
+
}
|
|
132
|
+
catch (error) {
|
|
133
|
+
return null;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return vaultContract[f]();
|
|
137
|
+
}));
|
|
138
|
+
const receiptAddress = vaultContractCalls[core_1.VAULT_FUNCTIONS_V2.length - 1];
|
|
139
|
+
const whitelistedAssetsAddress = vaultContractCalls[0];
|
|
140
|
+
const reciptContract = (0, core_1.createContract)({
|
|
141
|
+
address: receiptAddress, // lpTokenAddress
|
|
142
|
+
abi: TokenizedVaultV2Receipt_1.ABI_TOKENIZED_VAULT_V2_RECEIPT,
|
|
143
|
+
provider,
|
|
144
|
+
});
|
|
145
|
+
const [receiptContractCalls, whitelistedList] = await Promise.all([
|
|
146
|
+
Promise.all(core_1.VAULT_FUNCTIONS_V2_RECEIPT.map((f) => {
|
|
147
|
+
if (f === 'symbol') {
|
|
148
|
+
return (0, core_1.getSymbol)(provider, receiptAddress, false);
|
|
149
|
+
}
|
|
150
|
+
if (f === 'decimals') {
|
|
151
|
+
return (0, core_1.getDecimals)(provider, receiptAddress, false);
|
|
152
|
+
}
|
|
153
|
+
return reciptContract[f]();
|
|
154
|
+
})),
|
|
155
|
+
(0, core_1.getWhitelistedAssets)(provider, whitelistedAssetsAddress),
|
|
156
|
+
]);
|
|
157
|
+
const whitelistedAssetsContractCalls = [whitelistedList];
|
|
158
|
+
// Merge all contract call results
|
|
159
|
+
const combinedCalls = [
|
|
160
|
+
...vaultContractCalls,
|
|
161
|
+
...receiptContractCalls,
|
|
162
|
+
...whitelistedAssetsContractCalls,
|
|
163
|
+
];
|
|
164
|
+
const combinedFunctions = [
|
|
165
|
+
...core_1.VAULT_FUNCTIONS_V2,
|
|
166
|
+
...core_1.VAULT_FUNCTIONS_V2_RECEIPT,
|
|
167
|
+
...core_1.VAULT_FUNCTIONS_V2_WHITELISTED_ASSETS,
|
|
168
|
+
];
|
|
169
|
+
// Normalize all contract results with proper decimal handling
|
|
170
|
+
const formattedContractCalls = combinedCalls.reduce((acc, curr, i) => {
|
|
171
|
+
let val;
|
|
172
|
+
if (combinedFunctions[i] === 'depositCap') {
|
|
173
|
+
if (curr === null) {
|
|
174
|
+
return acc;
|
|
175
|
+
}
|
|
176
|
+
val = (0, core_1.toNormalizedBn)(curr, receiptContractCalls[0]);
|
|
177
|
+
}
|
|
178
|
+
else if (combinedFunctions[i] === 'totalSupply' ||
|
|
179
|
+
combinedFunctions[i] === 'totalAssets' ||
|
|
180
|
+
combinedFunctions[i] === 'globalLoansAmount' ||
|
|
181
|
+
combinedFunctions[i] === 'maxSupply' ||
|
|
182
|
+
combinedFunctions[i] === 'getTotalAssets' ||
|
|
183
|
+
combinedFunctions[i] === 'maxDepositAmount') {
|
|
184
|
+
val = (0, core_1.toNormalizedBn)(curr, receiptContractCalls[0]);
|
|
185
|
+
}
|
|
186
|
+
else if (combinedFunctions[i] === 'getTotalLoansDeployed') {
|
|
187
|
+
val = (0, core_1.toNormalizedBn)(curr, 0);
|
|
188
|
+
}
|
|
189
|
+
else if (combinedFunctions[i] === 'withdrawalFee') {
|
|
190
|
+
val = (0, core_1.toNormalizedBn)(curr, 2);
|
|
191
|
+
}
|
|
192
|
+
else if (combinedFunctions[i] === 'decimals') {
|
|
193
|
+
val = Number(curr.toString());
|
|
194
|
+
}
|
|
195
|
+
else if (combinedFunctions[i] === 'loansOperator') {
|
|
196
|
+
// @hardcoded: we cannot pull the real strategist
|
|
197
|
+
val = '0x4DCb388488622e47683EAd1a147947140a31e485';
|
|
198
|
+
}
|
|
199
|
+
else {
|
|
200
|
+
val = curr;
|
|
201
|
+
}
|
|
202
|
+
return { ...acc, [combinedFunctions[i]]: val };
|
|
203
|
+
}, {});
|
|
204
|
+
// Combine on-chain and backend data into unified vault object
|
|
205
|
+
const returnObj = await (0, utils_1.buildFormattedVault)(provider, tokenizedVault, formattedContractCalls);
|
|
206
|
+
return returnObj;
|
|
207
|
+
};
|
|
208
|
+
exports.getEvmVaultV2 = getEvmVaultV2;
|
|
209
|
+
//# sourceMappingURL=getters.js.map
|