@augustdigital/sdk 8.3.1 → 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 +7 -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 +70 -0
- package/lib/modules/vaults/utils.js +108 -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 +139 -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,19 +1,55 @@
|
|
|
1
1
|
import { IAddress, IContractRunner, INormalizedNumber } from '../../types';
|
|
2
2
|
import { IContractWriteOptions } from './write.actions';
|
|
3
|
+
/**
|
|
4
|
+
* Function to fetch instant redemption fee
|
|
5
|
+
* @param signer - signer / provider object
|
|
6
|
+
* @param options - object including pool contract address, user wallet address
|
|
7
|
+
* @returns normalized number object of the instant redemption fee
|
|
8
|
+
*/
|
|
3
9
|
export declare function fetchInstantRedemptionFee(signer: IContractRunner, options: IContractWriteOptions): Promise<INormalizedNumber>;
|
|
10
|
+
/**
|
|
11
|
+
* allowance checks user's current allowance per pool
|
|
12
|
+
* @param signer - signer / provider object
|
|
13
|
+
* @param options - object including pool contract address, user wallet address
|
|
14
|
+
* @returns normalized number object of the user's current allowance
|
|
15
|
+
*/
|
|
4
16
|
export declare function vaultAllowance(signer: IContractRunner, options: IContractWriteOptions): Promise<INormalizedNumber>;
|
|
17
|
+
/**
|
|
18
|
+
* Fetches the senders whitelist contract address from a whitelisted allocation vault
|
|
19
|
+
* @param signer - signer / provider object
|
|
20
|
+
* @param options - object including vault contract address
|
|
21
|
+
* @returns the senders whitelist contract address
|
|
22
|
+
*/
|
|
5
23
|
export declare function sendersWhitelistAddress(signer: IContractRunner, options: {
|
|
6
24
|
vault: IAddress;
|
|
7
25
|
}): Promise<IAddress | undefined>;
|
|
26
|
+
/**
|
|
27
|
+
* Checks if an address is whitelisted on a whitelist contract
|
|
28
|
+
* @param signer - signer / provider object
|
|
29
|
+
* @param options - object including whitelist contract address and wallet address to check
|
|
30
|
+
* @returns boolean indicating if the address is whitelisted
|
|
31
|
+
*/
|
|
8
32
|
export declare function isWhitelisted(signer: IContractRunner, options: {
|
|
9
33
|
whitelist: IAddress;
|
|
10
34
|
wallet: IAddress;
|
|
11
35
|
}): Promise<boolean | undefined>;
|
|
36
|
+
/**
|
|
37
|
+
* Fetches the total amount deposited by an address on a whitelist contract
|
|
38
|
+
* @param signer - signer / provider object
|
|
39
|
+
* @param options - object including whitelist contract address, wallet address, and vault address
|
|
40
|
+
* @returns normalized number of the deposited amount
|
|
41
|
+
*/
|
|
12
42
|
export declare function getDeposited(signer: IContractRunner, options: {
|
|
13
43
|
whitelist: IAddress;
|
|
14
44
|
wallet: IAddress;
|
|
15
45
|
vault: IAddress;
|
|
16
46
|
}): Promise<INormalizedNumber | undefined>;
|
|
47
|
+
/**
|
|
48
|
+
* Fetches the remaining allocation for an address on a whitelist contract
|
|
49
|
+
* @param signer - signer / provider object
|
|
50
|
+
* @param options - object including whitelist contract address, wallet address, vault address, and optional deposit cap amount
|
|
51
|
+
* @returns the remaining allocation as normalized number
|
|
52
|
+
*/
|
|
17
53
|
export declare function getRemainingAllocations(signer: IContractRunner, options: {
|
|
18
54
|
whitelist: IAddress;
|
|
19
55
|
wallet: IAddress;
|
|
@@ -21,37 +57,169 @@ export declare function getRemainingAllocations(signer: IContractRunner, options
|
|
|
21
57
|
depositCapAmount?: bigint;
|
|
22
58
|
}): Promise<INormalizedNumber | undefined>;
|
|
23
59
|
export type IPreviewRwaRedemptionOptions = {
|
|
60
|
+
/** RwaRedeemSubaccount contract address */
|
|
24
61
|
target: IAddress;
|
|
62
|
+
/** Redeemable asset address (e.g. USDC, USDT) */
|
|
25
63
|
asset: IAddress;
|
|
64
|
+
/** Amount of vault shares to preview */
|
|
26
65
|
amount: string | bigint | number;
|
|
66
|
+
/** Decimals of the vault share token */
|
|
27
67
|
decimals: number;
|
|
68
|
+
/** Decimals of the output/redeemable asset */
|
|
28
69
|
outputDecimals: number;
|
|
29
70
|
};
|
|
71
|
+
/**
|
|
72
|
+
* Preview the output amount for an RWA instant redemption via the RwaRedeemSubaccount contract.
|
|
73
|
+
* @param signer - signer / provider object
|
|
74
|
+
* @param options - object including subaccount address, asset, amount, decimals, and outputDecimals
|
|
75
|
+
* @returns normalized number of the expected output amount (in output asset decimals)
|
|
76
|
+
*/
|
|
30
77
|
export declare function previewRwaRedemption(signer: IContractRunner, options: IPreviewRwaRedemptionOptions): Promise<INormalizedNumber | undefined>;
|
|
78
|
+
/** Options for {@link previewDeposit}. */
|
|
31
79
|
export type IPreviewDepositOptions = {
|
|
80
|
+
/** Vault contract address. */
|
|
32
81
|
vault: IAddress;
|
|
82
|
+
/** Deposit amount in the deposit asset's smallest unit (raw bigint-shaped). */
|
|
33
83
|
amount: string | bigint | number;
|
|
84
|
+
/**
|
|
85
|
+
* Optional deposit asset. Required for multi-asset vaults (EVM-2); ignored
|
|
86
|
+
* for single-asset vaults where the underlying is implicit.
|
|
87
|
+
*/
|
|
34
88
|
asset?: IAddress;
|
|
35
89
|
};
|
|
90
|
+
/** Options for {@link previewRedeem}. */
|
|
36
91
|
export type IPreviewRedeemOptions = {
|
|
92
|
+
/** Vault contract address. */
|
|
37
93
|
vault: IAddress;
|
|
94
|
+
/** Share amount in the vault share token's smallest unit (raw bigint-shaped). */
|
|
38
95
|
shares: string | bigint | number;
|
|
39
96
|
};
|
|
97
|
+
/** Options for {@link allowance}. */
|
|
40
98
|
export type IAllowanceOptions = {
|
|
99
|
+
/** Spender contract — usually the vault address. */
|
|
41
100
|
vault: IAddress;
|
|
101
|
+
/** Owner whose ERC-20 allowance is being queried. */
|
|
42
102
|
owner: IAddress;
|
|
103
|
+
/**
|
|
104
|
+
* Token whose allowance is queried. Defaults to the vault's underlying
|
|
105
|
+
* asset, resolved via `IERC4626.asset()`.
|
|
106
|
+
*/
|
|
43
107
|
asset?: IAddress;
|
|
44
108
|
};
|
|
109
|
+
/** Options for {@link balanceOf}. */
|
|
45
110
|
export type IBalanceOfOptions = {
|
|
111
|
+
/** ERC-20 token address. */
|
|
46
112
|
asset: IAddress;
|
|
113
|
+
/** Owner whose balance is queried. */
|
|
47
114
|
owner: IAddress;
|
|
48
115
|
};
|
|
116
|
+
/** Options for {@link maxDeposit}. */
|
|
49
117
|
export type IMaxDepositOptions = {
|
|
118
|
+
/** Vault contract address. */
|
|
50
119
|
vault: IAddress;
|
|
120
|
+
/**
|
|
121
|
+
* Receiver address — passed to ERC-4626 `maxDeposit(address)` on single-
|
|
122
|
+
* asset vaults. Ignored by EVM-2 multi-asset vaults which expose a vault-
|
|
123
|
+
* level `maxDepositAmount()` without a receiver argument.
|
|
124
|
+
*/
|
|
51
125
|
receiver?: IAddress;
|
|
52
126
|
};
|
|
127
|
+
/**
|
|
128
|
+
* Preview the number of shares that would be minted for a deposit, without
|
|
129
|
+
* touching on-chain state. Routes between single-asset ERC-4626 and EVM-2
|
|
130
|
+
* multi-asset vaults using the vault version detected from backend metadata.
|
|
131
|
+
*
|
|
132
|
+
* @returns The number of shares (raw on-chain units, share-token decimals).
|
|
133
|
+
* @throws AugustValidationError on invalid vault address or amount.
|
|
134
|
+
* @throws AugustSDKError when the underlying contract call fails.
|
|
135
|
+
*
|
|
136
|
+
* @example
|
|
137
|
+
* ```ts
|
|
138
|
+
* const shares = await augustSdk.evm.previewDeposit({
|
|
139
|
+
* vault: '0xE9B725010A9E419412ed67d0fA5f3A5f40159D32',
|
|
140
|
+
* amount: 1_000_000n, // 1 USDC (6 decimals)
|
|
141
|
+
* });
|
|
142
|
+
* ```
|
|
143
|
+
*/
|
|
53
144
|
export declare function previewDeposit(signer: IContractRunner, options: IPreviewDepositOptions): Promise<bigint>;
|
|
145
|
+
/**
|
|
146
|
+
* Preview the number of underlying assets returned by redeeming a given
|
|
147
|
+
* number of shares, without touching on-chain state. Routes between single-
|
|
148
|
+
* asset ERC-4626 (`previewRedeem`) and EVM-2 multi-asset
|
|
149
|
+
* (`previewRedemption(shares, isInstant=false)`) using the vault version.
|
|
150
|
+
*
|
|
151
|
+
* @returns The assets that would be redeemed (raw on-chain units, asset
|
|
152
|
+
* decimals).
|
|
153
|
+
* @throws AugustValidationError on invalid vault or share input.
|
|
154
|
+
* @throws AugustSDKError when the underlying contract call fails.
|
|
155
|
+
*
|
|
156
|
+
* @example
|
|
157
|
+
* ```ts
|
|
158
|
+
* const assets = await augustSdk.evm.previewRedeem({
|
|
159
|
+
* vault: '0xE9B725010A9E419412ed67d0fA5f3A5f40159D32',
|
|
160
|
+
* shares: 1_000_000_000_000_000_000n, // 1 share (18 decimals)
|
|
161
|
+
* });
|
|
162
|
+
* ```
|
|
163
|
+
*/
|
|
54
164
|
export declare function previewRedeem(signer: IContractRunner, options: IPreviewRedeemOptions): Promise<bigint>;
|
|
165
|
+
/**
|
|
166
|
+
* Read the ERC-20 allowance an `owner` has granted to a vault (the spender).
|
|
167
|
+
* If `asset` is omitted, the vault's underlying asset is resolved via
|
|
168
|
+
* `IERC4626.asset()` and used as the token.
|
|
169
|
+
*
|
|
170
|
+
* Returns a raw `bigint` to keep BigInt math precise — call
|
|
171
|
+
* {@link toNormalizedBn} if you need a UI-shaped {@link INormalizedNumber}.
|
|
172
|
+
*
|
|
173
|
+
* @returns Allowance in raw on-chain units of `asset`.
|
|
174
|
+
* @throws AugustValidationError on invalid addresses.
|
|
175
|
+
* @throws AugustSDKError when the underlying contract call fails.
|
|
176
|
+
*
|
|
177
|
+
* @example
|
|
178
|
+
* ```ts
|
|
179
|
+
* const raw = await augustSdk.evm.allowance({
|
|
180
|
+
* vault: '0xE9B725010A9E419412ed67d0fA5f3A5f40159D32',
|
|
181
|
+
* owner: walletAddress,
|
|
182
|
+
* });
|
|
183
|
+
* if (raw < requiredAmount) {
|
|
184
|
+
* await augustSdk.evm.vaultApprove({
|
|
185
|
+
* target: vault,
|
|
186
|
+
* wallet: walletAddress,
|
|
187
|
+
* amount: requiredAmount.toString(),
|
|
188
|
+
* });
|
|
189
|
+
* }
|
|
190
|
+
* ```
|
|
191
|
+
*/
|
|
55
192
|
export declare function allowance(signer: IContractRunner, options: IAllowanceOptions): Promise<bigint>;
|
|
193
|
+
/**
|
|
194
|
+
* Read an ERC-20 balance directly. Returns the raw on-chain value as
|
|
195
|
+
* `bigint`; call {@link toNormalizedBn} if you need a {@link INormalizedNumber}.
|
|
196
|
+
*
|
|
197
|
+
* @returns Balance in raw on-chain units of `asset`.
|
|
198
|
+
* @throws AugustValidationError on invalid asset / owner addresses.
|
|
199
|
+
* @throws AugustSDKError when the underlying contract call fails.
|
|
200
|
+
*
|
|
201
|
+
* @example
|
|
202
|
+
* ```ts
|
|
203
|
+
* const raw = await augustSdk.evm.balanceOf({
|
|
204
|
+
* asset: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', // USDC
|
|
205
|
+
* owner: walletAddress,
|
|
206
|
+
* });
|
|
207
|
+
* ```
|
|
208
|
+
*/
|
|
56
209
|
export declare function balanceOf(signer: IContractRunner, options: IBalanceOfOptions): Promise<bigint>;
|
|
210
|
+
/**
|
|
211
|
+
* Read the maximum deposit currently accepted by a vault. Routes between
|
|
212
|
+
* single-asset ERC-4626 (`maxDeposit(receiver)`) and EVM-2 multi-asset
|
|
213
|
+
* (`maxDepositAmount()`, vault-level cap, no receiver dependence).
|
|
214
|
+
*
|
|
215
|
+
* @returns Max deposit in raw on-chain units of the deposit asset.
|
|
216
|
+
* @throws AugustValidationError on invalid vault address.
|
|
217
|
+
* @throws AugustSDKError when the underlying contract call fails.
|
|
218
|
+
*
|
|
219
|
+
* @example
|
|
220
|
+
* ```ts
|
|
221
|
+
* const cap = await augustSdk.evm.maxDeposit({ vault });
|
|
222
|
+
* if (cap === 0n) showVaultIsFullToast();
|
|
223
|
+
* ```
|
|
224
|
+
*/
|
|
57
225
|
export declare function maxDeposit(signer: IContractRunner, options: IMaxDepositOptions): Promise<bigint>;
|
|
@@ -14,6 +14,12 @@ exports.balanceOf = balanceOf;
|
|
|
14
14
|
exports.maxDeposit = maxDeposit;
|
|
15
15
|
const abis_1 = require("../../abis");
|
|
16
16
|
const core_1 = require("../../core");
|
|
17
|
+
/**
|
|
18
|
+
* Function to fetch instant redemption fee
|
|
19
|
+
* @param signer - signer / provider object
|
|
20
|
+
* @param options - object including pool contract address, user wallet address
|
|
21
|
+
* @returns normalized number object of the instant redemption fee
|
|
22
|
+
*/
|
|
17
23
|
async function fetchInstantRedemptionFee(signer, options) {
|
|
18
24
|
const { wallet, target } = options;
|
|
19
25
|
const [goodWallet, goodPool] = [
|
|
@@ -38,6 +44,12 @@ async function fetchInstantRedemptionFee(signer, options) {
|
|
|
38
44
|
throw new Error(`Failed to fetch instant redeem fee for ${target}: ${e instanceof Error ? e.message : 'Unknown error'}`);
|
|
39
45
|
}
|
|
40
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* allowance checks user's current allowance per pool
|
|
49
|
+
* @param signer - signer / provider object
|
|
50
|
+
* @param options - object including pool contract address, user wallet address
|
|
51
|
+
* @returns normalized number object of the user's current allowance
|
|
52
|
+
*/
|
|
41
53
|
async function vaultAllowance(signer, options) {
|
|
42
54
|
const { wallet, target } = options;
|
|
43
55
|
const [goodWallet, goodPool] = [
|
|
@@ -47,16 +59,19 @@ async function vaultAllowance(signer, options) {
|
|
|
47
59
|
if (!goodWallet || !goodPool)
|
|
48
60
|
return;
|
|
49
61
|
try {
|
|
62
|
+
// ERC4626 vault
|
|
50
63
|
const poolContract = (0, core_1.createContract)({
|
|
51
64
|
address: target,
|
|
52
65
|
abi: abis_1.ABI_LENDING_POOLS,
|
|
53
66
|
provider: signer,
|
|
54
67
|
});
|
|
68
|
+
// get vault asset address and decimals
|
|
55
69
|
const [asset, rawDecimals] = await Promise.all([
|
|
56
70
|
poolContract.asset(),
|
|
57
71
|
poolContract.decimals(),
|
|
58
72
|
]);
|
|
59
73
|
const decimals = Number(rawDecimals);
|
|
74
|
+
// check amount vault approves user for
|
|
60
75
|
const depositTokenContract = (0, core_1.createContract)({
|
|
61
76
|
address: asset,
|
|
62
77
|
abi: abis_1.ABI_ERC20,
|
|
@@ -72,6 +87,12 @@ async function vaultAllowance(signer, options) {
|
|
|
72
87
|
throw new Error(`Failed to fetch allowance: ${e instanceof Error ? e.message : 'Unknown error'}`);
|
|
73
88
|
}
|
|
74
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* Fetches the senders whitelist contract address from a whitelisted allocation vault
|
|
92
|
+
* @param signer - signer / provider object
|
|
93
|
+
* @param options - object including vault contract address
|
|
94
|
+
* @returns the senders whitelist contract address
|
|
95
|
+
*/
|
|
75
96
|
async function sendersWhitelistAddress(signer, options) {
|
|
76
97
|
const { vault } = options;
|
|
77
98
|
const goodTarget = (0, core_1.checkAddress)(vault, console);
|
|
@@ -92,6 +113,12 @@ async function sendersWhitelistAddress(signer, options) {
|
|
|
92
113
|
throw new Error(`Failed to fetch senders whitelist address: ${e instanceof Error ? e.message : 'Unknown error'}`);
|
|
93
114
|
}
|
|
94
115
|
}
|
|
116
|
+
/**
|
|
117
|
+
* Checks if an address is whitelisted on a whitelist contract
|
|
118
|
+
* @param signer - signer / provider object
|
|
119
|
+
* @param options - object including whitelist contract address and wallet address to check
|
|
120
|
+
* @returns boolean indicating if the address is whitelisted
|
|
121
|
+
*/
|
|
95
122
|
async function isWhitelisted(signer, options) {
|
|
96
123
|
const { whitelist, wallet } = options;
|
|
97
124
|
const [goodWhitelist, goodWallet] = [
|
|
@@ -115,6 +142,12 @@ async function isWhitelisted(signer, options) {
|
|
|
115
142
|
throw new Error(`Failed to check whitelist status: ${e instanceof Error ? e.message : 'Unknown error'}`);
|
|
116
143
|
}
|
|
117
144
|
}
|
|
145
|
+
/**
|
|
146
|
+
* Fetches the total amount deposited by an address on a whitelist contract
|
|
147
|
+
* @param signer - signer / provider object
|
|
148
|
+
* @param options - object including whitelist contract address, wallet address, and vault address
|
|
149
|
+
* @returns normalized number of the deposited amount
|
|
150
|
+
*/
|
|
118
151
|
async function getDeposited(signer, options) {
|
|
119
152
|
const { whitelist, wallet, vault } = options;
|
|
120
153
|
const [goodWhitelist, goodWallet, goodVault] = [
|
|
@@ -154,6 +187,12 @@ async function getDeposited(signer, options) {
|
|
|
154
187
|
throw new Error(`Failed to fetch deposited amount: ${e instanceof Error ? e.message : 'Unknown error'}`);
|
|
155
188
|
}
|
|
156
189
|
}
|
|
190
|
+
/**
|
|
191
|
+
* Fetches the remaining allocation for an address on a whitelist contract
|
|
192
|
+
* @param signer - signer / provider object
|
|
193
|
+
* @param options - object including whitelist contract address, wallet address, vault address, and optional deposit cap amount
|
|
194
|
+
* @returns the remaining allocation as normalized number
|
|
195
|
+
*/
|
|
157
196
|
async function getRemainingAllocations(signer, options) {
|
|
158
197
|
const { whitelist, wallet, vault, depositCapAmount } = options;
|
|
159
198
|
const [goodWhitelist, goodWallet, goodVault] = [
|
|
@@ -174,6 +213,7 @@ async function getRemainingAllocations(signer, options) {
|
|
|
174
213
|
abi: abis_1.ABI_TOKENIZED_VAULT_V2_SENDER_ALLOCATION_WHITELIST,
|
|
175
214
|
provider: signer,
|
|
176
215
|
});
|
|
216
|
+
// Fetch depositCap if not provided, along with asset address
|
|
177
217
|
const [capAmount, asset] = await Promise.all([
|
|
178
218
|
depositCapAmount !== undefined
|
|
179
219
|
? Promise.resolve(depositCapAmount)
|
|
@@ -196,6 +236,12 @@ async function getRemainingAllocations(signer, options) {
|
|
|
196
236
|
throw new Error(`Failed to fetch remaining allocations: ${e instanceof Error ? e.message : 'Unknown error'}`);
|
|
197
237
|
}
|
|
198
238
|
}
|
|
239
|
+
/**
|
|
240
|
+
* Preview the output amount for an RWA instant redemption via the RwaRedeemSubaccount contract.
|
|
241
|
+
* @param signer - signer / provider object
|
|
242
|
+
* @param options - object including subaccount address, asset, amount, decimals, and outputDecimals
|
|
243
|
+
* @returns normalized number of the expected output amount (in output asset decimals)
|
|
244
|
+
*/
|
|
199
245
|
async function previewRwaRedemption(signer, options) {
|
|
200
246
|
const { target, asset, amount, decimals, outputDecimals } = options;
|
|
201
247
|
const goodTarget = (0, core_1.checkAddress)(target, console, 'contract');
|
|
@@ -255,6 +301,23 @@ function toRawBigInt(value, label) {
|
|
|
255
301
|
}
|
|
256
302
|
throw new core_1.AugustValidationError('INVALID_INPUT', `${label}: amount must be a string, bigint, or number`);
|
|
257
303
|
}
|
|
304
|
+
/**
|
|
305
|
+
* Preview the number of shares that would be minted for a deposit, without
|
|
306
|
+
* touching on-chain state. Routes between single-asset ERC-4626 and EVM-2
|
|
307
|
+
* multi-asset vaults using the vault version detected from backend metadata.
|
|
308
|
+
*
|
|
309
|
+
* @returns The number of shares (raw on-chain units, share-token decimals).
|
|
310
|
+
* @throws AugustValidationError on invalid vault address or amount.
|
|
311
|
+
* @throws AugustSDKError when the underlying contract call fails.
|
|
312
|
+
*
|
|
313
|
+
* @example
|
|
314
|
+
* ```ts
|
|
315
|
+
* const shares = await augustSdk.evm.previewDeposit({
|
|
316
|
+
* vault: '0xE9B725010A9E419412ed67d0fA5f3A5f40159D32',
|
|
317
|
+
* amount: 1_000_000n, // 1 USDC (6 decimals)
|
|
318
|
+
* });
|
|
319
|
+
* ```
|
|
320
|
+
*/
|
|
258
321
|
async function previewDeposit(signer, options) {
|
|
259
322
|
const { vault, amount, asset } = options;
|
|
260
323
|
if (!(0, core_1.checkAddress)(vault, console, 'contract')) {
|
|
@@ -275,6 +338,7 @@ async function previewDeposit(signer, options) {
|
|
|
275
338
|
abi: abis_1.ABI_TOKENIZED_VAULT_V2,
|
|
276
339
|
});
|
|
277
340
|
const result = await contract.previewDeposit(asset, amountRaw);
|
|
341
|
+
// TokenizedVaultV2 previewDeposit returns (shares, _); take shares.
|
|
278
342
|
const shares = Array.isArray(result) ? result[0] : result;
|
|
279
343
|
return BigInt(shares);
|
|
280
344
|
}
|
|
@@ -294,6 +358,25 @@ async function previewDeposit(signer, options) {
|
|
|
294
358
|
throw new core_1.AugustSDKError('UNKNOWN', `previewDeposit failed: ${e instanceof Error ? e.message : 'Unknown error'}`, { cause: e, context: { vault, amount: amount.toString() } });
|
|
295
359
|
}
|
|
296
360
|
}
|
|
361
|
+
/**
|
|
362
|
+
* Preview the number of underlying assets returned by redeeming a given
|
|
363
|
+
* number of shares, without touching on-chain state. Routes between single-
|
|
364
|
+
* asset ERC-4626 (`previewRedeem`) and EVM-2 multi-asset
|
|
365
|
+
* (`previewRedemption(shares, isInstant=false)`) using the vault version.
|
|
366
|
+
*
|
|
367
|
+
* @returns The assets that would be redeemed (raw on-chain units, asset
|
|
368
|
+
* decimals).
|
|
369
|
+
* @throws AugustValidationError on invalid vault or share input.
|
|
370
|
+
* @throws AugustSDKError when the underlying contract call fails.
|
|
371
|
+
*
|
|
372
|
+
* @example
|
|
373
|
+
* ```ts
|
|
374
|
+
* const assets = await augustSdk.evm.previewRedeem({
|
|
375
|
+
* vault: '0xE9B725010A9E419412ed67d0fA5f3A5f40159D32',
|
|
376
|
+
* shares: 1_000_000_000_000_000_000n, // 1 share (18 decimals)
|
|
377
|
+
* });
|
|
378
|
+
* ```
|
|
379
|
+
*/
|
|
297
380
|
async function previewRedeem(signer, options) {
|
|
298
381
|
const { vault, shares } = options;
|
|
299
382
|
if (!(0, core_1.checkAddress)(vault, console, 'contract')) {
|
|
@@ -311,6 +394,7 @@ async function previewRedeem(signer, options) {
|
|
|
311
394
|
abi: abis_1.ABI_TOKENIZED_VAULT_V2,
|
|
312
395
|
});
|
|
313
396
|
const result = await contract.previewRedemption(sharesRaw, false);
|
|
397
|
+
// EVM-2 previewRedemption returns (assetsAmount, assetsAfterFee); take gross.
|
|
314
398
|
const assets = Array.isArray(result) ? result[0] : result;
|
|
315
399
|
return BigInt(assets);
|
|
316
400
|
}
|
|
@@ -333,6 +417,33 @@ async function previewRedeem(signer, options) {
|
|
|
333
417
|
throw new core_1.AugustSDKError('UNKNOWN', `previewRedeem failed: ${e instanceof Error ? e.message : 'Unknown error'}`, { cause: e, context: { vault, shares: shares.toString() } });
|
|
334
418
|
}
|
|
335
419
|
}
|
|
420
|
+
/**
|
|
421
|
+
* Read the ERC-20 allowance an `owner` has granted to a vault (the spender).
|
|
422
|
+
* If `asset` is omitted, the vault's underlying asset is resolved via
|
|
423
|
+
* `IERC4626.asset()` and used as the token.
|
|
424
|
+
*
|
|
425
|
+
* Returns a raw `bigint` to keep BigInt math precise — call
|
|
426
|
+
* {@link toNormalizedBn} if you need a UI-shaped {@link INormalizedNumber}.
|
|
427
|
+
*
|
|
428
|
+
* @returns Allowance in raw on-chain units of `asset`.
|
|
429
|
+
* @throws AugustValidationError on invalid addresses.
|
|
430
|
+
* @throws AugustSDKError when the underlying contract call fails.
|
|
431
|
+
*
|
|
432
|
+
* @example
|
|
433
|
+
* ```ts
|
|
434
|
+
* const raw = await augustSdk.evm.allowance({
|
|
435
|
+
* vault: '0xE9B725010A9E419412ed67d0fA5f3A5f40159D32',
|
|
436
|
+
* owner: walletAddress,
|
|
437
|
+
* });
|
|
438
|
+
* if (raw < requiredAmount) {
|
|
439
|
+
* await augustSdk.evm.vaultApprove({
|
|
440
|
+
* target: vault,
|
|
441
|
+
* wallet: walletAddress,
|
|
442
|
+
* amount: requiredAmount.toString(),
|
|
443
|
+
* });
|
|
444
|
+
* }
|
|
445
|
+
* ```
|
|
446
|
+
*/
|
|
336
447
|
async function allowance(signer, options) {
|
|
337
448
|
const { vault, owner, asset } = options;
|
|
338
449
|
if (!(0, core_1.checkAddress)(vault, console, 'contract')) {
|
|
@@ -373,6 +484,22 @@ async function allowance(signer, options) {
|
|
|
373
484
|
throw new core_1.AugustSDKError('UNKNOWN', `allowance failed: ${e instanceof Error ? e.message : 'Unknown error'}`, { cause: e, context: { vault, owner, asset } });
|
|
374
485
|
}
|
|
375
486
|
}
|
|
487
|
+
/**
|
|
488
|
+
* Read an ERC-20 balance directly. Returns the raw on-chain value as
|
|
489
|
+
* `bigint`; call {@link toNormalizedBn} if you need a {@link INormalizedNumber}.
|
|
490
|
+
*
|
|
491
|
+
* @returns Balance in raw on-chain units of `asset`.
|
|
492
|
+
* @throws AugustValidationError on invalid asset / owner addresses.
|
|
493
|
+
* @throws AugustSDKError when the underlying contract call fails.
|
|
494
|
+
*
|
|
495
|
+
* @example
|
|
496
|
+
* ```ts
|
|
497
|
+
* const raw = await augustSdk.evm.balanceOf({
|
|
498
|
+
* asset: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', // USDC
|
|
499
|
+
* owner: walletAddress,
|
|
500
|
+
* });
|
|
501
|
+
* ```
|
|
502
|
+
*/
|
|
376
503
|
async function balanceOf(signer, options) {
|
|
377
504
|
const { asset, owner } = options;
|
|
378
505
|
if (!(0, core_1.checkAddress)(asset, console, 'contract')) {
|
|
@@ -398,6 +525,21 @@ async function balanceOf(signer, options) {
|
|
|
398
525
|
throw new core_1.AugustSDKError('UNKNOWN', `balanceOf failed: ${e instanceof Error ? e.message : 'Unknown error'}`, { cause: e, context: { asset, owner } });
|
|
399
526
|
}
|
|
400
527
|
}
|
|
528
|
+
/**
|
|
529
|
+
* Read the maximum deposit currently accepted by a vault. Routes between
|
|
530
|
+
* single-asset ERC-4626 (`maxDeposit(receiver)`) and EVM-2 multi-asset
|
|
531
|
+
* (`maxDepositAmount()`, vault-level cap, no receiver dependence).
|
|
532
|
+
*
|
|
533
|
+
* @returns Max deposit in raw on-chain units of the deposit asset.
|
|
534
|
+
* @throws AugustValidationError on invalid vault address.
|
|
535
|
+
* @throws AugustSDKError when the underlying contract call fails.
|
|
536
|
+
*
|
|
537
|
+
* @example
|
|
538
|
+
* ```ts
|
|
539
|
+
* const cap = await augustSdk.evm.maxDeposit({ vault });
|
|
540
|
+
* if (cap === 0n) showVaultIsFullToast();
|
|
541
|
+
* ```
|
|
542
|
+
*/
|
|
401
543
|
async function maxDeposit(signer, options) {
|
|
402
544
|
const { vault, receiver } = options;
|
|
403
545
|
if (!(0, core_1.checkAddress)(vault, console, 'contract')) {
|
|
@@ -424,6 +566,7 @@ async function maxDeposit(signer, options) {
|
|
|
424
566
|
provider: signer,
|
|
425
567
|
abi: abis_1.ABI_LENDING_POOLS,
|
|
426
568
|
});
|
|
569
|
+
// Zero-address default: vaults that require a receiver arg won't revert.
|
|
427
570
|
const target = receiver ?? '0x0000000000000000000000000000000000000000';
|
|
428
571
|
const raw = (await contract.maxDeposit(target));
|
|
429
572
|
return BigInt(raw);
|
|
@@ -1,14 +1,38 @@
|
|
|
1
1
|
import type { Connection } from '@solana/web3.js';
|
|
2
2
|
import type { IAddress, IEnv, IWSMonitorHeaders } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Structural interface for the Solana adapter surface used by vault operations.
|
|
5
|
+
* Avoids importing the concrete SolanaAdapter class to prevent circular dependencies.
|
|
6
|
+
*/
|
|
3
7
|
export interface ISolanaService {
|
|
4
8
|
connection: Connection;
|
|
5
9
|
getVaultState: (vaultProgramId: any, idl: any, vaultAddress?: any) => Promise<any>;
|
|
6
10
|
fetchUserShareBalance: (publicKey: any, shareMint: any) => Promise<any>;
|
|
11
|
+
/**
|
|
12
|
+
* Raw (BigInt-safe) variant. Required — `fetchUserShareBalance` alone
|
|
13
|
+
* returns a JS-number `uiAmount` which is lossy and silently encodes
|
|
14
|
+
* against 18 decimals when fed back through `toNormalizedBn` without an
|
|
15
|
+
* explicit decimals argument. Every consumer that needs a correct
|
|
16
|
+
* `walletBalance.raw` (positions, redemptions, max actions) MUST use this
|
|
17
|
+
* entry point.
|
|
18
|
+
*
|
|
19
|
+
* Returns `{ amount, decimals }`:
|
|
20
|
+
* - `amount` is the on-chain u64 as a base-units string (always set;
|
|
21
|
+
* `'0'` when no balance / no account / no args / RPC failure).
|
|
22
|
+
* - `decimals` matches the mint when a parsed `tokenAmount` is
|
|
23
|
+
* available; otherwise **`null`**. `decimals === null` is the
|
|
24
|
+
* "scale unknown" signal — callers must substitute a known decimals
|
|
25
|
+
* value (typically the deposit mint's decimals from backend metadata)
|
|
26
|
+
* before constructing an `INormalizedNumber`. Never throws.
|
|
27
|
+
*/
|
|
7
28
|
fetchUserShareBalanceRaw: (publicKey: any, shareMint: any) => Promise<{
|
|
8
29
|
amount: string;
|
|
9
30
|
decimals: number | null;
|
|
10
31
|
}>;
|
|
11
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* Base configuration for vault operations.
|
|
35
|
+
*/
|
|
12
36
|
export interface IVaultBaseOptions {
|
|
13
37
|
rpcUrl: string;
|
|
14
38
|
env?: IEnv;
|
|
@@ -17,7 +41,17 @@ export interface IVaultBaseOptions {
|
|
|
17
41
|
chainId?: number;
|
|
18
42
|
solanaService?: ISolanaService;
|
|
19
43
|
headers?: IWSMonitorHeaders;
|
|
44
|
+
/**
|
|
45
|
+
* Portfolio mode: when true, the per-vault EVM getter does NOT null out a
|
|
46
|
+
* closed + invisible vault. Needed so a user's position in a closed,
|
|
47
|
+
* invisible vault can still resolve its metadata. Defaults to undefined
|
|
48
|
+
* (false) so marketplace/discovery reads keep hiding closed staging vaults.
|
|
49
|
+
*/
|
|
50
|
+
includeClosed?: boolean;
|
|
20
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Optional enrichment options for vault queries.
|
|
54
|
+
*/
|
|
21
55
|
export interface IVaultCustomOptions {
|
|
22
56
|
loans?: boolean;
|
|
23
57
|
allocations?: boolean;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Withdrawal Processing Transaction Decoder
|
|
3
|
+
*
|
|
4
|
+
* Decodes transaction calldata to extract which (year, month, day) cluster
|
|
5
|
+
* was processed when a WithdrawalProcessed event was emitted.
|
|
6
|
+
*/
|
|
1
7
|
import { ContractTransactionReceipt, Interface } from 'ethers';
|
|
2
8
|
export interface ProcessingCallData {
|
|
3
9
|
functionName: 'processAllClaimsByDate' | 'claim' | 'unknown';
|
|
@@ -8,7 +14,48 @@ export interface ProcessingCallData {
|
|
|
8
14
|
receiverAddr?: string;
|
|
9
15
|
error?: string;
|
|
10
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Decode withdrawal processing transaction calldata.
|
|
19
|
+
* Handles both processAllClaimsByDate() and claim() functions.
|
|
20
|
+
*
|
|
21
|
+
* Both functions have the same first 3 parameters: (year, month, day)
|
|
22
|
+
*
|
|
23
|
+
* @param txData - Raw transaction data (tx.data from provider.getTransaction())
|
|
24
|
+
* @param iface - ethers Interface initialized with vault ABI
|
|
25
|
+
* @returns Decoded parameters or error
|
|
26
|
+
*/
|
|
11
27
|
export declare function decodeWithdrawalProcessing(txData: string, iface: Interface): ProcessingCallData;
|
|
28
|
+
/**
|
|
29
|
+
* Fallback: Parse receipt logs if calldata decoding fails.
|
|
30
|
+
*
|
|
31
|
+
* This handles the multicall wrapper case where the outer tx.data
|
|
32
|
+
* is the multicall wrapper, not the vault function. By parsing logs,
|
|
33
|
+
* we can infer what happened on-chain.
|
|
34
|
+
*
|
|
35
|
+
* Note: This is a best-effort fallback. Ideal solution is Option 2
|
|
36
|
+
* (subgraph indexing) to avoid RPC calls altogether.
|
|
37
|
+
*
|
|
38
|
+
* @param receipt - Transaction receipt from provider
|
|
39
|
+
* @param vaultAddress - Expected vault address
|
|
40
|
+
* @param iface - ethers Interface with vault ABI
|
|
41
|
+
* @returns Decoded parameters from logs, or error
|
|
42
|
+
*/
|
|
12
43
|
export declare function decodeFromReceiptLogs(receipt: ContractTransactionReceipt | null, vaultAddress: string, iface: Interface): Promise<ProcessingCallData>;
|
|
44
|
+
/**
|
|
45
|
+
* Detect if this is a multicall/batch transaction.
|
|
46
|
+
* Common patterns:
|
|
47
|
+
* - Uniswap Multicall: 0x1f0464f6
|
|
48
|
+
* - Gnosis Safe: 0x6a761202
|
|
49
|
+
* - 1inch Aggregator: 0x7c025200
|
|
50
|
+
*
|
|
51
|
+
* @param functionName - Function name from parsed decoded tx
|
|
52
|
+
* @returns true if this appears to be a batch/multicall
|
|
53
|
+
*/
|
|
13
54
|
export declare function isMulticall(functionName: string): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Detect if the decoded function is one we care about for withdrawal processing.
|
|
57
|
+
*
|
|
58
|
+
* @param functionName - Function name from decoding
|
|
59
|
+
* @returns true if this is a withdrawal processing function
|
|
60
|
+
*/
|
|
14
61
|
export declare function isWithdrawalProcessingFunction(functionName: string): boolean;
|