@augustdigital/sdk 8.3.2 → 8.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/abis/ERC20_Bytes32.d.ts +4 -0
- package/lib/abis/ERC20_Bytes32.js +4 -0
- package/lib/abis/ERC4626.d.ts +1 -0
- package/lib/abis/ERC4626.js +1 -0
- package/lib/abis/ERC721.d.ts +1 -0
- package/lib/abis/ERC721.js +1 -0
- package/lib/abis/FeeOracle.js +1 -0
- package/lib/abis/LendingPool.js +1 -0
- package/lib/abis/LendingPoolV2.js +1 -0
- package/lib/abis/Multicall3.js +3 -0
- package/lib/abis/OFT.d.ts +20 -0
- package/lib/abis/OFT.js +20 -0
- package/lib/abis/SmartAccount.d.ts +1 -0
- package/lib/abis/SmartAccount.js +3 -0
- package/lib/abis/SwapRouter.d.ts +1 -0
- package/lib/abis/SwapRouter.js +1 -0
- package/lib/abis/UniversalSignatureValidator.js +3 -0
- package/lib/abis/index.d.ts +5 -0
- package/lib/abis/index.js +5 -0
- package/lib/adapters/evm/getters.d.ts +17 -2
- package/lib/adapters/evm/getters.js +35 -3
- package/lib/adapters/evm/index.d.ts +262 -0
- package/lib/adapters/evm/index.js +268 -1
- package/lib/adapters/evm/utils.d.ts +6 -0
- package/lib/adapters/evm/utils.js +7 -0
- package/lib/adapters/solana/constants.js +4 -1
- package/lib/adapters/solana/getters.d.ts +8 -0
- package/lib/adapters/solana/getters.js +21 -0
- package/lib/adapters/solana/idl/vault-idl.js +9 -0
- package/lib/adapters/solana/index.d.ts +55 -0
- package/lib/adapters/solana/index.js +57 -0
- package/lib/adapters/solana/utils.d.ts +28 -0
- package/lib/adapters/solana/utils.js +79 -4
- package/lib/adapters/solana/vault.actions.d.ts +19 -0
- package/lib/adapters/solana/vault.actions.js +47 -3
- package/lib/adapters/stellar/actions.d.ts +25 -0
- package/lib/adapters/stellar/actions.js +33 -0
- package/lib/adapters/stellar/constants.d.ts +26 -0
- package/lib/adapters/stellar/constants.js +29 -0
- package/lib/adapters/stellar/getters.d.ts +56 -0
- package/lib/adapters/stellar/getters.js +81 -0
- package/lib/adapters/stellar/index.d.ts +48 -0
- package/lib/adapters/stellar/index.js +48 -0
- package/lib/adapters/stellar/soroban.d.ts +20 -0
- package/lib/adapters/stellar/soroban.js +46 -0
- package/lib/adapters/stellar/submit.d.ts +12 -0
- package/lib/adapters/stellar/submit.js +19 -0
- package/lib/adapters/stellar/types.d.ts +27 -0
- package/lib/adapters/stellar/types.js +3 -0
- package/lib/adapters/stellar/utils.d.ts +10 -0
- package/lib/adapters/stellar/utils.js +10 -0
- package/lib/adapters/sui/getters.d.ts +6 -0
- package/lib/adapters/sui/getters.js +6 -0
- package/lib/adapters/sui/index.d.ts +15 -0
- package/lib/adapters/sui/index.js +15 -0
- package/lib/adapters/sui/transformer.d.ts +6 -0
- package/lib/adapters/sui/transformer.js +6 -0
- package/lib/adapters/sui/utils.d.ts +6 -0
- package/lib/adapters/sui/utils.js +6 -0
- package/lib/core/analytics/chain-name.d.ts +8 -0
- package/lib/core/analytics/chain-name.js +8 -0
- package/lib/core/analytics/constants.d.ts +4 -0
- package/lib/core/analytics/constants.js +4 -0
- package/lib/core/analytics/env.d.ts +25 -0
- package/lib/core/analytics/env.js +26 -0
- package/lib/core/analytics/index.d.ts +26 -0
- package/lib/core/analytics/index.js +35 -0
- package/lib/core/analytics/instrumentation.d.ts +26 -0
- package/lib/core/analytics/instrumentation.js +66 -2
- package/lib/core/analytics/method-taxonomy.d.ts +16 -0
- package/lib/core/analytics/method-taxonomy.js +18 -0
- package/lib/core/analytics/metrics.d.ts +23 -0
- package/lib/core/analytics/metrics.js +40 -0
- package/lib/core/analytics/sanitize.d.ts +38 -0
- package/lib/core/analytics/sanitize.js +46 -0
- package/lib/core/analytics/sentry-runtime.d.ts +11 -0
- package/lib/core/analytics/sentry-runtime.js +19 -0
- package/lib/core/analytics/sentry.d.ts +45 -0
- package/lib/core/analytics/sentry.js +115 -2
- package/lib/core/analytics/types.d.ts +27 -0
- package/lib/core/analytics/user-identity.d.ts +34 -0
- package/lib/core/analytics/user-identity.js +42 -0
- package/lib/core/analytics/version.d.ts +6 -1
- package/lib/core/analytics/version.js +6 -1
- package/lib/core/auth/verify.js +5 -0
- package/lib/core/base.class.d.ts +75 -0
- package/lib/core/base.class.js +56 -0
- package/lib/core/cache.d.ts +5 -0
- package/lib/core/cache.js +6 -0
- package/lib/core/constants/adapters.d.ts +15 -0
- package/lib/core/constants/adapters.js +28 -8
- package/lib/core/constants/core.d.ts +12 -1
- package/lib/core/constants/core.js +12 -0
- package/lib/core/constants/swap-router.d.ts +46 -0
- package/lib/core/constants/swap-router.js +50 -0
- package/lib/core/constants/vaults.d.ts +56 -0
- package/lib/core/constants/vaults.js +66 -1
- package/lib/core/constants/web3.d.ts +3 -0
- package/lib/core/constants/web3.js +18 -5
- package/lib/core/errors/index.d.ts +36 -0
- package/lib/core/errors/index.js +29 -0
- package/lib/core/fetcher.d.ts +134 -0
- package/lib/core/fetcher.js +191 -5
- package/lib/core/helpers/adapters.d.ts +9 -0
- package/lib/core/helpers/adapters.js +11 -0
- package/lib/core/helpers/chain-address.d.ts +10 -0
- package/lib/core/helpers/chain-address.js +11 -0
- package/lib/core/helpers/core.d.ts +42 -0
- package/lib/core/helpers/core.js +66 -1
- package/lib/core/helpers/explorer-link.d.ts +14 -0
- package/lib/core/helpers/explorer-link.js +14 -0
- package/lib/core/helpers/signer.d.ts +26 -0
- package/lib/core/helpers/signer.js +39 -0
- package/lib/core/helpers/swap-router.d.ts +32 -0
- package/lib/core/helpers/swap-router.js +32 -0
- package/lib/core/helpers/vault-version.d.ts +1 -0
- package/lib/core/helpers/vault-version.js +2 -0
- package/lib/core/helpers/vaults.d.ts +8 -0
- package/lib/core/helpers/vaults.js +22 -8
- package/lib/core/helpers/web3.d.ts +152 -0
- package/lib/core/helpers/web3.js +183 -6
- package/lib/core/logger/index.d.ts +55 -0
- package/lib/core/logger/index.js +19 -0
- package/lib/core/logger/slack.d.ts +3 -0
- package/lib/core/logger/slack.js +3 -0
- package/lib/core/vault-metadata.d.ts +6 -0
- package/lib/core/vault-metadata.js +6 -0
- package/lib/core/version-check.d.ts +52 -0
- package/lib/core/version-check.js +81 -0
- package/lib/evm/methods/crossChainVault.d.ts +90 -0
- package/lib/evm/methods/crossChainVault.js +186 -1
- package/lib/evm/methods/crossChainVaultRegistry.d.ts +93 -0
- package/lib/evm/methods/crossChainVaultRegistry.js +240 -0
- package/lib/evm/methods/index.d.ts +1 -0
- package/lib/evm/methods/index.js +1 -0
- package/lib/evm/types/crossChain.d.ts +202 -0
- package/lib/evm/types/crossChain.js +11 -0
- package/lib/index.d.ts +16 -0
- package/lib/index.js +19 -0
- package/lib/main.d.ts +288 -5
- package/lib/main.js +305 -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 +52 -0
- package/lib/modules/api/main.js +130 -0
- package/lib/modules/sub-accounts/fetcher.d.ts +15 -0
- package/lib/modules/sub-accounts/fetcher.js +15 -0
- package/lib/modules/sub-accounts/main.d.ts +33 -0
- package/lib/modules/sub-accounts/main.js +38 -0
- package/lib/modules/sub-accounts/utils.d.ts +3 -0
- package/lib/modules/sub-accounts/utils.js +3 -0
- package/lib/modules/vaults/adapter.helpers.d.ts +18 -0
- package/lib/modules/vaults/adapter.helpers.js +34 -0
- package/lib/modules/vaults/fetcher.d.ts +20 -0
- package/lib/modules/vaults/fetcher.js +40 -3
- package/lib/modules/vaults/getters.d.ts +295 -0
- package/lib/modules/vaults/getters.js +552 -12
- package/lib/modules/vaults/index.d.ts +12 -0
- package/lib/modules/vaults/index.js +12 -0
- package/lib/modules/vaults/main.d.ts +292 -4
- package/lib/modules/vaults/main.js +379 -7
- package/lib/modules/vaults/read.actions.d.ts +168 -0
- package/lib/modules/vaults/read.actions.js +143 -0
- package/lib/modules/vaults/types.d.ts +34 -0
- package/lib/modules/vaults/utils/call-data-decoder.d.ts +47 -0
- package/lib/modules/vaults/utils/call-data-decoder.js +56 -0
- package/lib/modules/vaults/utils/date-utils.d.ts +39 -0
- package/lib/modules/vaults/utils/date-utils.js +47 -1
- package/lib/modules/vaults/utils.d.ts +69 -0
- package/lib/modules/vaults/utils.js +104 -5
- package/lib/modules/vaults/write.actions.d.ts +363 -3
- package/lib/modules/vaults/write.actions.js +364 -2
- package/lib/polyfills.js +2 -0
- package/lib/sdk.d.ts +23705 -0
- package/lib/services/coingecko/fetcher.d.ts +13 -0
- package/lib/services/coingecko/fetcher.js +17 -0
- package/lib/services/debank/fetcher.d.ts +14 -0
- package/lib/services/debank/fetcher.js +12 -0
- package/lib/services/debank/utils.js +17 -0
- package/lib/services/layerzero/deposits.d.ts +11 -0
- package/lib/services/layerzero/deposits.js +34 -11
- package/lib/services/layerzero/redeems.d.ts +10 -0
- package/lib/services/layerzero/redeems.js +13 -0
- package/lib/services/layerzero/utils.d.ts +8 -0
- package/lib/services/layerzero/utils.js +11 -0
- package/lib/services/octavfi/fetcher.d.ts +7 -0
- package/lib/services/octavfi/fetcher.js +25 -0
- package/lib/services/octavfi/utils.d.ts +12 -0
- package/lib/services/octavfi/utils.js +44 -10
- package/lib/services/subgraph/fetcher.js +4 -2
- package/lib/services/subgraph/vaults.d.ts +12 -0
- package/lib/services/subgraph/vaults.js +43 -2
- package/lib/services/swap-quotes/index.d.ts +71 -0
- package/lib/services/swap-quotes/index.js +25 -0
- package/lib/services/swap-quotes/paraswap.d.ts +17 -0
- package/lib/services/swap-quotes/paraswap.js +14 -0
- package/lib/types/pools.d.ts +3 -0
- package/lib/types/typed-contract.d.ts +64 -0
- package/lib/types/vaults.d.ts +137 -2
- package/lib/types/vaults.js +10 -0
- package/lib/types/web3.d.ts +8 -0
- package/lib/types/web3.js +1 -0
- package/lib/types/webserver.d.ts +45 -0
- package/package.json +6 -5
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* [bytes32-flavored ERC-20](https://docs.makerdao.com/smart-contract-modules/mkr-module#4.-gotchas-potential-source-of-user-error)
|
|
3
|
+
* for tokens (ie. Maker) that use bytes32 instead of string.
|
|
4
|
+
*/
|
|
1
5
|
export declare const ABI_ERC20_BYTES32: readonly [{
|
|
2
6
|
readonly type: "event";
|
|
3
7
|
readonly name: "Approval";
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ABI_ERC20_BYTES32 = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* [bytes32-flavored ERC-20](https://docs.makerdao.com/smart-contract-modules/mkr-module#4.-gotchas-potential-source-of-user-error)
|
|
6
|
+
* for tokens (ie. Maker) that use bytes32 instead of string.
|
|
7
|
+
*/
|
|
4
8
|
exports.ABI_ERC20_BYTES32 = [
|
|
5
9
|
{
|
|
6
10
|
type: 'event',
|
package/lib/abis/ERC4626.d.ts
CHANGED
package/lib/abis/ERC4626.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ABI_ERC4626 = void 0;
|
|
4
|
+
/** [ERC-4626 Tokenized Vaults Standard](https://ethereum.org/en/developers/docs/standards/tokens/erc-4626) */
|
|
4
5
|
exports.ABI_ERC4626 = [
|
|
5
6
|
{
|
|
6
7
|
anonymous: false,
|
package/lib/abis/ERC721.d.ts
CHANGED
package/lib/abis/ERC721.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ABI_ERC721 = void 0;
|
|
4
|
+
/** [ERC-721 Non-Fungible Token Standard](https://ethereum.org/en/developers/docs/standards/tokens/erc-721) */
|
|
4
5
|
exports.ABI_ERC721 = [
|
|
5
6
|
{
|
|
6
7
|
type: 'event',
|
package/lib/abis/FeeOracle.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ABI_FEE_ORACLE = void 0;
|
|
4
|
+
// export const ABI_FEE_ORACLE = [{"type":"constructor","inputs":[{"name":"ownerAddr","type":"address","internalType":"address"}],"stateMutability":"nonpayable"},{"type":"function","name":"FEES_DIVISOR","inputs":[],"outputs":[{"name":"","type":"uint256","internalType":"uint256"}],"stateMutability":"view"},{"type":"function","name":"getContextFeeAmount","inputs":[{"name":"amount","type":"uint256","internalType":"uint256"},{"name":"categoryId","type":"bytes32","internalType":"bytes32"},{"name":"specificAddr","type":"address","internalType":"address"}],"outputs":[{"name":"feePercent","type":"uint256","internalType":"uint256"},{"name":"feeAmount","type":"uint256","internalType":"uint256"}],"stateMutability":"view"},{"type":"function","name":"getContextFeeRate","inputs":[{"name":"categoryId","type":"bytes32","internalType":"bytes32"},{"name":"specificAddr","type":"address","internalType":"address"}],"outputs":[{"name":"","type":"uint256","internalType":"uint256"}],"stateMutability":"view"},{"type":"function","name":"owner","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"setContextFeeRate","inputs":[{"name":"feePercent","type":"uint256","internalType":"uint256"},{"name":"categoryId","type":"bytes32","internalType":"bytes32"},{"name":"specificAddr","type":"address","internalType":"address"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"transferOwnership","inputs":[{"name":"newOwner","type":"address","internalType":"address"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"event","name":"OwnershipTransferred","inputs":[{"name":"previousOwner","type":"address","indexed":true,"internalType":"address"},{"name":"newOwner","type":"address","indexed":true,"internalType":"address"}],"anonymous":false}] as const;
|
|
4
5
|
exports.ABI_FEE_ORACLE = [
|
|
5
6
|
{
|
|
6
7
|
inputs: [
|
package/lib/abis/LendingPool.js
CHANGED
package/lib/abis/Multicall3.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ABI_MULTICALL3 = void 0;
|
|
4
|
+
/* [Multicall3](https://github.com/mds1/multicall) */
|
|
4
5
|
exports.ABI_MULTICALL3 = [
|
|
5
6
|
{
|
|
6
7
|
inputs: [
|
|
@@ -44,6 +45,8 @@ exports.ABI_MULTICALL3 = [
|
|
|
44
45
|
type: 'function',
|
|
45
46
|
},
|
|
46
47
|
];
|
|
48
|
+
// Universal resolver error definitions (reserved for future use)
|
|
49
|
+
// @ts-expect-error - Reserved for future ENS integration
|
|
47
50
|
const universalResolverErrors = [
|
|
48
51
|
{
|
|
49
52
|
inputs: [],
|
package/lib/abis/OFT.d.ts
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ABI fragments for OFT (Omnichain Fungible Token) and related contracts
|
|
3
|
+
* used in LayerZero cross-chain vault operations.
|
|
4
|
+
*
|
|
5
|
+
* @module ABIs/OFT
|
|
6
|
+
*/
|
|
7
|
+
/** ERC20 allowance + approve ABI for cross-chain approval checks */
|
|
1
8
|
export declare const ABI_CROSS_CHAIN_ERC20: readonly [{
|
|
2
9
|
readonly inputs: readonly [{
|
|
3
10
|
readonly internalType: "address";
|
|
@@ -35,6 +42,11 @@ export declare const ABI_CROSS_CHAIN_ERC20: readonly [{
|
|
|
35
42
|
readonly stateMutability: "nonpayable";
|
|
36
43
|
readonly type: "function";
|
|
37
44
|
}];
|
|
45
|
+
/**
|
|
46
|
+
* Multi-asset vault previewDeposit ABI.
|
|
47
|
+
* Uses `previewDeposit(address, uint256)` instead of standard ERC4626's
|
|
48
|
+
* `previewDeposit(uint256)` to specify which asset is being deposited.
|
|
49
|
+
*/
|
|
38
50
|
export declare const ABI_MULTI_ASSET_PREVIEW_DEPOSIT: readonly [{
|
|
39
51
|
readonly type: "function";
|
|
40
52
|
readonly name: "previewDeposit";
|
|
@@ -58,6 +70,11 @@ export declare const ABI_MULTI_ASSET_PREVIEW_DEPOSIT: readonly [{
|
|
|
58
70
|
}];
|
|
59
71
|
readonly stateMutability: "view";
|
|
60
72
|
}];
|
|
73
|
+
/**
|
|
74
|
+
* Multi-asset vault previewRedemption ABI.
|
|
75
|
+
* Uses `previewRedemption(uint256, bool)` to preview redeem output
|
|
76
|
+
* with an `isInstant` flag.
|
|
77
|
+
*/
|
|
61
78
|
export declare const ABI_MULTI_ASSET_PREVIEW_REDEEM: readonly [{
|
|
62
79
|
readonly type: "function";
|
|
63
80
|
readonly name: "previewRedemption";
|
|
@@ -81,6 +98,9 @@ export declare const ABI_MULTI_ASSET_PREVIEW_REDEEM: readonly [{
|
|
|
81
98
|
}];
|
|
82
99
|
readonly stateMutability: "view";
|
|
83
100
|
}];
|
|
101
|
+
/**
|
|
102
|
+
* Standard ERC4626 previewRedeem ABI.
|
|
103
|
+
*/
|
|
84
104
|
export declare const ABI_STANDARD_PREVIEW_REDEEM: readonly [{
|
|
85
105
|
readonly type: "function";
|
|
86
106
|
readonly name: "previewRedeem";
|
package/lib/abis/OFT.js
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* ABI fragments for OFT (Omnichain Fungible Token) and related contracts
|
|
4
|
+
* used in LayerZero cross-chain vault operations.
|
|
5
|
+
*
|
|
6
|
+
* @module ABIs/OFT
|
|
7
|
+
*/
|
|
2
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
9
|
exports.ABI_STANDARD_PREVIEW_REDEEM = exports.ABI_MULTI_ASSET_PREVIEW_REDEEM = exports.ABI_MULTI_ASSET_PREVIEW_DEPOSIT = exports.ABI_CROSS_CHAIN_ERC20 = void 0;
|
|
10
|
+
/** ERC20 allowance + approve ABI for cross-chain approval checks */
|
|
4
11
|
exports.ABI_CROSS_CHAIN_ERC20 = [
|
|
5
12
|
{
|
|
6
13
|
inputs: [
|
|
@@ -23,6 +30,11 @@ exports.ABI_CROSS_CHAIN_ERC20 = [
|
|
|
23
30
|
type: 'function',
|
|
24
31
|
},
|
|
25
32
|
];
|
|
33
|
+
/**
|
|
34
|
+
* Multi-asset vault previewDeposit ABI.
|
|
35
|
+
* Uses `previewDeposit(address, uint256)` instead of standard ERC4626's
|
|
36
|
+
* `previewDeposit(uint256)` to specify which asset is being deposited.
|
|
37
|
+
*/
|
|
26
38
|
exports.ABI_MULTI_ASSET_PREVIEW_DEPOSIT = [
|
|
27
39
|
{
|
|
28
40
|
type: 'function',
|
|
@@ -38,6 +50,11 @@ exports.ABI_MULTI_ASSET_PREVIEW_DEPOSIT = [
|
|
|
38
50
|
stateMutability: 'view',
|
|
39
51
|
},
|
|
40
52
|
];
|
|
53
|
+
/**
|
|
54
|
+
* Multi-asset vault previewRedemption ABI.
|
|
55
|
+
* Uses `previewRedemption(uint256, bool)` to preview redeem output
|
|
56
|
+
* with an `isInstant` flag.
|
|
57
|
+
*/
|
|
41
58
|
exports.ABI_MULTI_ASSET_PREVIEW_REDEEM = [
|
|
42
59
|
{
|
|
43
60
|
type: 'function',
|
|
@@ -53,6 +70,9 @@ exports.ABI_MULTI_ASSET_PREVIEW_REDEEM = [
|
|
|
53
70
|
stateMutability: 'view',
|
|
54
71
|
},
|
|
55
72
|
];
|
|
73
|
+
/**
|
|
74
|
+
* Standard ERC4626 previewRedeem ABI.
|
|
75
|
+
*/
|
|
56
76
|
exports.ABI_STANDARD_PREVIEW_REDEEM = [
|
|
57
77
|
{
|
|
58
78
|
type: 'function',
|
package/lib/abis/SmartAccount.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ABI_SMART_ACCOUNT = void 0;
|
|
4
|
+
// ERC-1271
|
|
5
|
+
// isValidSignature(bytes32 hash, bytes signature) → bytes4 magicValue
|
|
6
|
+
/** @internal */
|
|
4
7
|
exports.ABI_SMART_ACCOUNT = [
|
|
5
8
|
{
|
|
6
9
|
name: 'isValidSignature',
|
package/lib/abis/SwapRouter.d.ts
CHANGED
package/lib/abis/SwapRouter.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ABI_SWAP_ROUTER = void 0;
|
|
4
|
+
/** ABI for the August `SwapRouter` periphery contract. */
|
|
4
5
|
exports.ABI_SWAP_ROUTER = [
|
|
5
6
|
{ inputs: [], stateMutability: 'nonpayable', type: 'constructor' },
|
|
6
7
|
{ inputs: [], name: 'AlreadyConfigured', type: 'error' },
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ABI_UNIVERSAL_SIGNATURE_VALIDATOR = void 0;
|
|
4
|
+
// ERC-6492 - universal deployless signature validator contract
|
|
5
|
+
// constructor(address _signer, bytes32 _hash, bytes _signature) → bytes4 returnValue
|
|
6
|
+
// returnValue is either 0x1 (valid) or 0x0 (invalid)
|
|
4
7
|
exports.ABI_UNIVERSAL_SIGNATURE_VALIDATOR = [
|
|
5
8
|
{
|
|
6
9
|
inputs: [
|
package/lib/abis/index.d.ts
CHANGED
package/lib/abis/index.js
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Contract ABI definitions for interacting with August/Upshift smart contracts.
|
|
4
|
+
*
|
|
5
|
+
* @module ABIs
|
|
6
|
+
*/
|
|
2
7
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
8
|
if (k2 === undefined) k2 = k;
|
|
4
9
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -1,4 +1,19 @@
|
|
|
1
|
-
import { ITokenizedVault } from '../../types';
|
|
2
|
-
import { IVaultBaseOptions } from '../../modules/vaults/types';
|
|
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
|
+
*/
|
|
3
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
|
+
*/
|
|
4
19
|
export declare const getEvmVaultV2: (tokenizedVault: ITokenizedVault, options: IVaultBaseOptions) => Promise<import("../../types").IVault>;
|
|
@@ -6,17 +6,29 @@ const core_1 = require("../../core");
|
|
|
6
6
|
const utils_1 = require("../../modules/vaults/utils");
|
|
7
7
|
const TokenizedVaultV2_1 = require("../../abis/TokenizedVaultV2");
|
|
8
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
|
+
*/
|
|
9
16
|
const getEvmVaultV1 = async (tokenizedVault, options) => {
|
|
10
17
|
const vault = tokenizedVault.address;
|
|
11
18
|
if (!vault) {
|
|
12
19
|
throw new Error('Vault address is undefined');
|
|
13
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.
|
|
14
24
|
if (tokenizedVault.status === 'closed' &&
|
|
15
|
-
tokenizedVault.is_visible === false
|
|
25
|
+
tokenizedVault.is_visible === false &&
|
|
26
|
+
!options?.includeClosed) {
|
|
16
27
|
core_1.Logger.log.warn('getEvmVaultV1', `closed: ${tokenizedVault.vault_name}`);
|
|
17
28
|
return null;
|
|
18
29
|
}
|
|
19
30
|
const provider = (0, core_1.createProvider)(options.rpcUrl);
|
|
31
|
+
// Batch fetch all vault contract data
|
|
20
32
|
const vaultContract = (0, core_1.createContract)({
|
|
21
33
|
address: vault,
|
|
22
34
|
abi: abis_1.ABI_LENDING_POOL_V2,
|
|
@@ -45,6 +57,7 @@ const getEvmVaultV1 = async (tokenizedVault, options) => {
|
|
|
45
57
|
}
|
|
46
58
|
return vaultContract[f]();
|
|
47
59
|
}));
|
|
60
|
+
// Normalize contract call results into typed object
|
|
48
61
|
const formattedContractCalls = vaultContractCalls.reduce((acc, curr, i) => {
|
|
49
62
|
let val;
|
|
50
63
|
if (core_1.VAULT_FUNCTIONS_V1[i] === 'maxDepositAmount') {
|
|
@@ -69,6 +82,7 @@ const getEvmVaultV1 = async (tokenizedVault, options) => {
|
|
|
69
82
|
val = Number(curr.toString());
|
|
70
83
|
}
|
|
71
84
|
else if (core_1.VAULT_FUNCTIONS_V1[i] === 'loansOperator') {
|
|
85
|
+
// TODO: hardcoded as we cannot pull the real strategist
|
|
72
86
|
val = '0x4DCb388488622e47683EAd1a147947140a31e485';
|
|
73
87
|
}
|
|
74
88
|
else {
|
|
@@ -76,21 +90,35 @@ const getEvmVaultV1 = async (tokenizedVault, options) => {
|
|
|
76
90
|
}
|
|
77
91
|
return { ...acc, [core_1.VAULT_FUNCTIONS_V1[i]]: val };
|
|
78
92
|
}, {});
|
|
93
|
+
// Combine on-chain and backend data into unified vault object
|
|
79
94
|
const returnObj = await (0, utils_1.buildFormattedVault)(provider, tokenizedVault, formattedContractCalls);
|
|
80
95
|
return returnObj;
|
|
81
96
|
};
|
|
82
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
|
+
*/
|
|
83
106
|
const getEvmVaultV2 = async (tokenizedVault, options) => {
|
|
84
107
|
const provider = (0, core_1.createProvider)(options.rpcUrl);
|
|
85
108
|
const vault = tokenizedVault.address;
|
|
86
109
|
if (!vault) {
|
|
87
110
|
throw new Error('Vault address is undefined');
|
|
88
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.
|
|
89
115
|
if (tokenizedVault.status === 'closed' &&
|
|
90
|
-
tokenizedVault.is_visible === false
|
|
116
|
+
tokenizedVault.is_visible === false &&
|
|
117
|
+
!options?.includeClosed) {
|
|
91
118
|
core_1.Logger.log.warn('getEvmVaultV2', `closed: ${tokenizedVault.vault_name}`);
|
|
92
119
|
return null;
|
|
93
120
|
}
|
|
121
|
+
// Fetch vault contract state
|
|
94
122
|
const vaultContract = (0, core_1.createContract)({
|
|
95
123
|
address: vault,
|
|
96
124
|
abi: TokenizedVaultV2_1.ABI_TOKENIZED_VAULT_V2,
|
|
@@ -110,7 +138,7 @@ const getEvmVaultV2 = async (tokenizedVault, options) => {
|
|
|
110
138
|
const receiptAddress = vaultContractCalls[core_1.VAULT_FUNCTIONS_V2.length - 1];
|
|
111
139
|
const whitelistedAssetsAddress = vaultContractCalls[0];
|
|
112
140
|
const reciptContract = (0, core_1.createContract)({
|
|
113
|
-
address: receiptAddress,
|
|
141
|
+
address: receiptAddress, // lpTokenAddress
|
|
114
142
|
abi: TokenizedVaultV2Receipt_1.ABI_TOKENIZED_VAULT_V2_RECEIPT,
|
|
115
143
|
provider,
|
|
116
144
|
});
|
|
@@ -127,6 +155,7 @@ const getEvmVaultV2 = async (tokenizedVault, options) => {
|
|
|
127
155
|
(0, core_1.getWhitelistedAssets)(provider, whitelistedAssetsAddress),
|
|
128
156
|
]);
|
|
129
157
|
const whitelistedAssetsContractCalls = [whitelistedList];
|
|
158
|
+
// Merge all contract call results
|
|
130
159
|
const combinedCalls = [
|
|
131
160
|
...vaultContractCalls,
|
|
132
161
|
...receiptContractCalls,
|
|
@@ -137,6 +166,7 @@ const getEvmVaultV2 = async (tokenizedVault, options) => {
|
|
|
137
166
|
...core_1.VAULT_FUNCTIONS_V2_RECEIPT,
|
|
138
167
|
...core_1.VAULT_FUNCTIONS_V2_WHITELISTED_ASSETS,
|
|
139
168
|
];
|
|
169
|
+
// Normalize all contract results with proper decimal handling
|
|
140
170
|
const formattedContractCalls = combinedCalls.reduce((acc, curr, i) => {
|
|
141
171
|
let val;
|
|
142
172
|
if (combinedFunctions[i] === 'depositCap') {
|
|
@@ -163,6 +193,7 @@ const getEvmVaultV2 = async (tokenizedVault, options) => {
|
|
|
163
193
|
val = Number(curr.toString());
|
|
164
194
|
}
|
|
165
195
|
else if (combinedFunctions[i] === 'loansOperator') {
|
|
196
|
+
// @hardcoded: we cannot pull the real strategist
|
|
166
197
|
val = '0x4DCb388488622e47683EAd1a147947140a31e485';
|
|
167
198
|
}
|
|
168
199
|
else {
|
|
@@ -170,6 +201,7 @@ const getEvmVaultV2 = async (tokenizedVault, options) => {
|
|
|
170
201
|
}
|
|
171
202
|
return { ...acc, [combinedFunctions[i]]: val };
|
|
172
203
|
}, {});
|
|
204
|
+
// Combine on-chain and backend data into unified vault object
|
|
173
205
|
const returnObj = await (0, utils_1.buildFormattedVault)(provider, tokenizedVault, formattedContractCalls);
|
|
174
206
|
return returnObj;
|
|
175
207
|
};
|