@augustdigital/sdk 8.3.2 → 8.6.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/README.md +207 -117
- 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 +266 -4
- package/lib/adapters/evm/index.js +270 -1
- package/lib/adapters/evm/utils.d.ts +6 -0
- package/lib/adapters/evm/utils.js +7 -0
- package/lib/adapters/solana/constants.d.ts +1 -1
- package/lib/adapters/solana/constants.js +4 -1
- package/lib/adapters/solana/getters.d.ts +9 -1
- 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 +59 -4
- package/lib/adapters/solana/index.js +61 -0
- package/lib/adapters/solana/types.d.ts +1 -1
- package/lib/adapters/solana/utils.d.ts +31 -3
- package/lib/adapters/solana/utils.js +79 -4
- package/lib/adapters/solana/vault.actions.d.ts +23 -4
- package/lib/adapters/solana/vault.actions.js +47 -3
- package/lib/adapters/stellar/actions.d.ts +26 -1
- 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 +70 -0
- package/lib/adapters/stellar/index.js +71 -0
- package/lib/adapters/stellar/soroban.d.ts +21 -1
- package/lib/adapters/stellar/soroban.js +47 -1
- package/lib/adapters/stellar/submit.d.ts +29 -0
- package/lib/adapters/stellar/submit.js +90 -5
- 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 +7 -1
- package/lib/adapters/sui/getters.js +6 -0
- package/lib/adapters/sui/index.d.ts +16 -1
- package/lib/adapters/sui/index.js +17 -0
- package/lib/adapters/sui/transformer.d.ts +8 -2
- package/lib/adapters/sui/transformer.js +7 -0
- package/lib/adapters/sui/types.d.ts +1 -1
- 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 +20 -1
- package/lib/core/analytics/sentry.d.ts +47 -2
- package/lib/core/analytics/sentry.js +115 -2
- package/lib/core/analytics/types.d.ts +28 -1
- package/lib/core/analytics/user-identity.d.ts +36 -2
- package/lib/core/analytics/user-identity.js +43 -1
- 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 +78 -3
- package/lib/core/base.class.js +66 -4
- package/lib/core/cache.d.ts +5 -0
- package/lib/core/cache.js +6 -0
- package/lib/core/constants/adapters.d.ts +16 -1
- package/lib/core/constants/adapters.js +28 -8
- package/lib/core/constants/core.d.ts +14 -1
- package/lib/core/constants/core.js +18 -0
- package/lib/core/constants/swap-router.d.ts +83 -1
- package/lib/core/constants/swap-router.js +91 -1
- package/lib/core/constants/vaults.d.ts +57 -1
- package/lib/core/constants/vaults.js +66 -1
- package/lib/core/constants/web3.d.ts +4 -1
- package/lib/core/constants/web3.js +15 -5
- package/lib/core/errors/index.d.ts +38 -2
- package/lib/core/errors/index.js +38 -0
- package/lib/core/fetcher.d.ts +136 -2
- package/lib/core/fetcher.js +229 -25
- package/lib/core/helpers/adapters.d.ts +10 -1
- 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 +49 -4
- package/lib/core/helpers/core.js +74 -7
- package/lib/core/helpers/explorer-link.d.ts +15 -1
- package/lib/core/helpers/explorer-link.js +14 -0
- package/lib/core/helpers/signer.d.ts +27 -1
- package/lib/core/helpers/signer.js +39 -0
- package/lib/core/helpers/swap-router.d.ts +33 -1
- package/lib/core/helpers/swap-router.js +32 -0
- package/lib/core/helpers/vault-version.d.ts +2 -1
- package/lib/core/helpers/vault-version.js +2 -0
- package/lib/core/helpers/vaults.d.ts +9 -1
- package/lib/core/helpers/vaults.js +22 -8
- package/lib/core/helpers/web3.d.ts +154 -2
- package/lib/core/helpers/web3.js +192 -15
- 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 +7 -1
- package/lib/core/vault-metadata.js +6 -0
- package/lib/core/version-check.d.ts +52 -0
- package/lib/core/version-check.js +82 -1
- package/lib/evm/methods/crossChainVault.d.ts +90 -0
- package/lib/evm/methods/crossChainVault.js +187 -2
- 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 +12 -1
- package/lib/index.d.ts +16 -0
- package/lib/index.js +19 -0
- package/lib/main.d.ts +289 -6
- package/lib/main.js +312 -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 +17 -2
- package/lib/modules/sub-accounts/fetcher.js +15 -0
- package/lib/modules/sub-accounts/main.d.ts +35 -2
- package/lib/modules/sub-accounts/main.js +39 -1
- package/lib/modules/sub-accounts/utils.d.ts +4 -1
- package/lib/modules/sub-accounts/utils.js +3 -0
- package/lib/modules/vaults/adapter.helpers.d.ts +21 -3
- package/lib/modules/vaults/adapter.helpers.js +34 -0
- package/lib/modules/vaults/fetcher.d.ts +45 -0
- package/lib/modules/vaults/fetcher.js +91 -4
- package/lib/modules/vaults/getters.d.ts +295 -0
- package/lib/modules/vaults/getters.js +567 -26
- 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 +382 -8
- package/lib/modules/vaults/read.actions.d.ts +170 -2
- 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 +48 -1
- 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 +85 -0
- package/lib/modules/vaults/utils.js +139 -7
- package/lib/modules/vaults/write.actions.d.ts +363 -3
- package/lib/modules/vaults/write.actions.js +399 -3
- package/lib/polyfills.js +4 -2
- package/lib/sdk.d.ts +23847 -0
- package/lib/services/coingecko/fetcher.d.ts +15 -1
- package/lib/services/coingecko/fetcher.js +30 -9
- package/lib/services/debank/fetcher.d.ts +15 -1
- package/lib/services/debank/fetcher.js +12 -0
- package/lib/services/debank/utils.d.ts +1 -1
- package/lib/services/debank/utils.js +18 -1
- package/lib/services/layerzero/deposits.d.ts +12 -1
- package/lib/services/layerzero/deposits.js +34 -11
- package/lib/services/layerzero/redeems.d.ts +11 -1
- 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 +8 -1
- package/lib/services/octavfi/fetcher.js +25 -0
- package/lib/services/octavfi/types.d.ts +1 -1
- package/lib/services/octavfi/utils.d.ts +14 -2
- 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 +119 -2
- package/lib/services/swap-quotes/index.d.ts +80 -0
- package/lib/services/swap-quotes/index.js +27 -1
- package/lib/services/swap-quotes/paraswap.d.ts +25 -0
- package/lib/services/swap-quotes/paraswap.js +22 -0
- package/lib/types/pools.d.ts +5 -2
- package/lib/types/staking.d.ts +1 -1
- package/lib/types/sub-accounts.d.ts +1 -1
- package/lib/types/subgraph.d.ts +10 -1
- package/lib/types/typed-contract.d.ts +64 -0
- package/lib/types/vaults.d.ts +163 -2
- package/lib/types/vaults.js +10 -0
- package/lib/types/web3.d.ts +9 -1
- package/lib/types/web3.js +1 -0
- package/lib/types/webserver.d.ts +47 -2
- package/package.json +6 -5
|
@@ -18,60 +18,268 @@ const write_actions_1 = require("../../modules/vaults/write.actions");
|
|
|
18
18
|
const read_actions_1 = require("../../modules/vaults/read.actions");
|
|
19
19
|
const signer_1 = require("../../core/helpers/signer");
|
|
20
20
|
__exportStar(require("./getters"), exports);
|
|
21
|
+
/**
|
|
22
|
+
* EVM Adapter for August SDK
|
|
23
|
+
* Supports both ethers Signer/Wallet and wagmi/viem WalletClient
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* To access the EVM adapter instance
|
|
27
|
+
* ```
|
|
28
|
+
* const sdk = new AugustSDK()
|
|
29
|
+
* sdk.evm.vaultRedeem()
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
21
32
|
class EVMAdapter {
|
|
33
|
+
signer;
|
|
34
|
+
rawSigner;
|
|
22
35
|
constructor(signer) {
|
|
23
36
|
this.rawSigner = signer;
|
|
37
|
+
// Don't normalize in constructor - do it lazily when needed
|
|
24
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Set a new signer (supports both ethers and viem/wagmi)
|
|
41
|
+
* @param signer - Either an ethers Signer/Wallet or viem WalletClient
|
|
42
|
+
*/
|
|
25
43
|
setSigner(signer) {
|
|
26
44
|
this.rawSigner = signer;
|
|
27
|
-
this.signer = undefined;
|
|
45
|
+
this.signer = undefined; // Reset normalized signer
|
|
28
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Get the normalized ethers-compatible signer
|
|
49
|
+
* Converts viem WalletClient to ethers Signer if needed
|
|
50
|
+
*/
|
|
29
51
|
async getSigner() {
|
|
30
52
|
if (!this.rawSigner) {
|
|
31
53
|
throw new Error('No signer provided');
|
|
32
54
|
}
|
|
55
|
+
// If we already have a normalized signer, return it
|
|
33
56
|
if (this.signer) {
|
|
34
57
|
return this.signer;
|
|
35
58
|
}
|
|
59
|
+
// Normalize and cache the signer
|
|
36
60
|
this.signer = await (0, signer_1.normalizeSigner)(this.rawSigner);
|
|
37
61
|
return this.signer;
|
|
38
62
|
}
|
|
63
|
+
// Core EVM operations
|
|
39
64
|
async vaultApprove(options) {
|
|
40
65
|
const signer = await this.getSigner();
|
|
41
66
|
return (0, write_actions_1.vaultApprove)(signer, options);
|
|
42
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* Approve a vault to spend a deposit token, returning a discriminated
|
|
70
|
+
* {@link ApproveResult} so callers can tell `sent` from `sufficient`
|
|
71
|
+
* (existing allowance covers) and `native` (no allowance applies).
|
|
72
|
+
* Prefer this over {@link vaultApprove} for new integrations.
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```ts
|
|
76
|
+
* const r = await augustSdk.evm.approve({
|
|
77
|
+
* target: vaultAddress,
|
|
78
|
+
* wallet: walletAddress,
|
|
79
|
+
* amount: '100',
|
|
80
|
+
* wait: true,
|
|
81
|
+
* });
|
|
82
|
+
* if (r.kind === 'sent') console.log('approve tx', r.hash);
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
43
85
|
async approve(options) {
|
|
44
86
|
const signer = await this.getSigner();
|
|
45
87
|
return (0, write_actions_1.approve)(signer, options);
|
|
46
88
|
}
|
|
89
|
+
/**
|
|
90
|
+
* Read the ERC-20 allowance the wallet has granted the vault to spend its
|
|
91
|
+
* underlying asset, returned as a normalized number. For the newer typed
|
|
92
|
+
* read that returns a raw `bigint` and accepts an explicit `asset` override,
|
|
93
|
+
* use {@link EVMAdapter.allowance}.
|
|
94
|
+
*
|
|
95
|
+
* Only `target` (vault address) and `wallet` are read from `options`; the
|
|
96
|
+
* remaining {@link IContractWriteOptions} fields are ignored.
|
|
97
|
+
*
|
|
98
|
+
* @param options - `{ target, wallet }` (other fields ignored).
|
|
99
|
+
* @returns Normalized allowance (`{ raw, normalized }`), or `undefined` when
|
|
100
|
+
* `target` / `wallet` fail address validation.
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```ts
|
|
104
|
+
* const a = await augustSdk.evm.vaultAllowance({
|
|
105
|
+
* target: vaultAddress,
|
|
106
|
+
* wallet: walletAddress,
|
|
107
|
+
* });
|
|
108
|
+
* console.log(a?.normalized);
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
47
111
|
async vaultAllowance(options) {
|
|
48
112
|
const signer = await this.getSigner();
|
|
49
113
|
return (0, read_actions_1.vaultAllowance)(signer, options);
|
|
50
114
|
}
|
|
115
|
+
// Vault operations (delegate to modules)
|
|
116
|
+
/**
|
|
117
|
+
* Deposit into an August vault. Routes automatically: V1 single-asset vaults
|
|
118
|
+
* deposit the underlying directly; V2 multi-asset vaults route through the
|
|
119
|
+
* adapter for non-underlying `depositAsset`. If allowance is insufficient
|
|
120
|
+
* the method submits an approve transaction first (the approve step always
|
|
121
|
+
* waits for confirmation to close a race window, regardless of `wait`).
|
|
122
|
+
*
|
|
123
|
+
* @param options - {@link IContractWriteOptions}. `target` and `wallet` are
|
|
124
|
+
* required; pass `amount`, `depositAsset` (defaults to the vault's
|
|
125
|
+
* underlying), `chainId`, `poolName`, `wait`, and `isDepositWithPermit`
|
|
126
|
+
* as needed.
|
|
127
|
+
* @returns The deposit `TransactionResponse`, or `undefined` if an
|
|
128
|
+
* approval-only path was taken and no deposit transaction was sent.
|
|
129
|
+
* @throws AugustValidationError on invalid inputs (bad address, bad amount).
|
|
130
|
+
* @throws AugustSDKError on RPC / contract revert during the deposit.
|
|
131
|
+
*
|
|
132
|
+
* @example
|
|
133
|
+
* ```ts
|
|
134
|
+
* const tx = await augustSdk.evm.vaultDeposit({
|
|
135
|
+
* target: vaultAddress,
|
|
136
|
+
* wallet: walletAddress,
|
|
137
|
+
* amount: '100',
|
|
138
|
+
* wait: true,
|
|
139
|
+
* });
|
|
140
|
+
* ```
|
|
141
|
+
*/
|
|
51
142
|
async vaultDeposit(options) {
|
|
52
143
|
const signer = await this.getSigner();
|
|
53
144
|
return (0, write_actions_1.vaultDeposit)(signer, options);
|
|
54
145
|
}
|
|
146
|
+
/**
|
|
147
|
+
* Submit a redemption request against a vault. Shares are escrowed and the
|
|
148
|
+
* underlying assets are released asynchronously by the protocol; callers
|
|
149
|
+
* collect the matured assets via {@link EVMAdapter.vaultRedeem}, or use the
|
|
150
|
+
* instant-redeem variant by setting `isInstantRedeem: true`.
|
|
151
|
+
*
|
|
152
|
+
* @param options - {@link IContractWriteOptions}. `target`, `wallet`, and
|
|
153
|
+
* `amount` (in shares) are required. Set `isInstantRedeem: true` to take
|
|
154
|
+
* the instant-redeem path when the vault supports it.
|
|
155
|
+
* @returns The request `TransactionResponse`, or `undefined` if the request
|
|
156
|
+
* could not be built (validation failure).
|
|
157
|
+
* @throws AugustValidationError on invalid inputs.
|
|
158
|
+
* @throws AugustSDKError on RPC / contract revert.
|
|
159
|
+
*
|
|
160
|
+
* @example
|
|
161
|
+
* ```ts
|
|
162
|
+
* const tx = await augustSdk.evm.vaultRequestRedeem({
|
|
163
|
+
* target: vaultAddress,
|
|
164
|
+
* wallet: walletAddress,
|
|
165
|
+
* amount: shareAmount,
|
|
166
|
+
* wait: true,
|
|
167
|
+
* });
|
|
168
|
+
* ```
|
|
169
|
+
*/
|
|
55
170
|
async vaultRequestRedeem(options) {
|
|
56
171
|
const signer = await this.getSigner();
|
|
57
172
|
return (0, write_actions_1.vaultRequestRedeem)(signer, options);
|
|
58
173
|
}
|
|
174
|
+
/**
|
|
175
|
+
* Deposit the chain's native asset (ETH / AVAX / etc.) into a vault by
|
|
176
|
+
* routing through the `MultiAssetNativeDepositWrapper`. The wrapper handles
|
|
177
|
+
* native-to-wrapped conversion and the subsequent vault deposit in a single
|
|
178
|
+
* transaction.
|
|
179
|
+
*
|
|
180
|
+
* @param options - {@link INativeDepositOptions}: `wrapperAddress`, `amount`
|
|
181
|
+
* (native, scaled by the chain's native decimals), optional `receiver`
|
|
182
|
+
* (defaults to the signer), and optional `wait`.
|
|
183
|
+
* @returns The deposit `TransactionResponse`.
|
|
184
|
+
* @throws AugustValidationError on invalid inputs.
|
|
185
|
+
* @throws AugustSDKError on RPC / contract revert.
|
|
186
|
+
*
|
|
187
|
+
* @example
|
|
188
|
+
* ```ts
|
|
189
|
+
* const tx = await augustSdk.evm.depositNative({
|
|
190
|
+
* wrapperAddress: nativeWrapperAddress,
|
|
191
|
+
* amount: parseEther('1'),
|
|
192
|
+
* wait: true,
|
|
193
|
+
* });
|
|
194
|
+
* ```
|
|
195
|
+
*/
|
|
59
196
|
async depositNative(options) {
|
|
60
197
|
const signer = await this.getSigner();
|
|
61
198
|
return (0, write_actions_1.depositNative)(signer, options);
|
|
62
199
|
}
|
|
200
|
+
/**
|
|
201
|
+
* Swap one or more whitelisted ERC-20s into a vault's reference asset via
|
|
202
|
+
* the on-chain `SwapRouter` and deposit the proceeds. The router handles
|
|
203
|
+
* fee accrual, slippage protection, and the v1/v3 vs v2 deposit-interface
|
|
204
|
+
* branching. Approval is sent automatically for each `swaps[i].tokenIn`
|
|
205
|
+
* when the caller's allowance against the SwapRouter is below `amountIn`.
|
|
206
|
+
*
|
|
207
|
+
* @param options - {@link ISwapAndDepositOptions}.
|
|
208
|
+
* @returns The transaction hash of the `swapAndDeposit` call.
|
|
209
|
+
* @throws AugustValidationError on invalid inputs (bad chain, empty swaps).
|
|
210
|
+
* @throws AugustSDKError on RPC / contract revert.
|
|
211
|
+
*
|
|
212
|
+
* @example
|
|
213
|
+
* ```ts
|
|
214
|
+
* const quote = await fetchSwapQuote({
|
|
215
|
+
* chainId: 1, srcToken: WBTC, srcDecimals: 8,
|
|
216
|
+
* destToken: USDC, destDecimals: 6, amount: 100_000_000n,
|
|
217
|
+
* receiver: SWAP_ROUTER_ADDRESSES[1]!,
|
|
218
|
+
* });
|
|
219
|
+
* const hash = await augustSdk.evm.swapAndDeposit({
|
|
220
|
+
* chainId: 1, vault, receiver: wallet,
|
|
221
|
+
* swaps: [{ tokenIn: WBTC, tokenOut: USDC, amountIn: 100_000_000n,
|
|
222
|
+
* minAmountOut: quote.minAmountOut, router: quote.router, payload: quote.payload }],
|
|
223
|
+
* });
|
|
224
|
+
* ```
|
|
225
|
+
*/
|
|
63
226
|
async swapAndDeposit(options) {
|
|
64
227
|
const signer = await this.getSigner();
|
|
65
228
|
return (0, write_actions_1.swapAndDeposit)(signer, options);
|
|
66
229
|
}
|
|
230
|
+
/**
|
|
231
|
+
* Deposit a vault's reference asset through the SwapRouter — no swap.
|
|
232
|
+
* Use this when the caller already holds the reference asset but wants
|
|
233
|
+
* the origin/referral fee accounting that the SwapRouter path provides.
|
|
234
|
+
*
|
|
235
|
+
* @param options - {@link ISwapRouterDirectDepositOptions}.
|
|
236
|
+
* @returns The transaction hash of the `deposit` call.
|
|
237
|
+
*/
|
|
67
238
|
async depositViaSwapRouter(options) {
|
|
68
239
|
const signer = await this.getSigner();
|
|
69
240
|
return (0, write_actions_1.depositViaSwapRouter)(signer, options);
|
|
70
241
|
}
|
|
242
|
+
/**
|
|
243
|
+
* Deposit native ETH (or chain-native equivalent) into a vault via the
|
|
244
|
+
* SwapRouter. Only valid when the vault's reference asset is the chain's
|
|
245
|
+
* wrapped-native token — the SwapRouter wraps `amount` and deposits.
|
|
246
|
+
*
|
|
247
|
+
* @param options - {@link ISwapRouterNativeDepositOptions}.
|
|
248
|
+
* @returns The transaction hash of the `depositNativeToken` call.
|
|
249
|
+
*/
|
|
71
250
|
async depositNativeViaSwapRouter(options) {
|
|
72
251
|
const signer = await this.getSigner();
|
|
73
252
|
return (0, write_actions_1.depositNativeViaSwapRouter)(signer, options);
|
|
74
253
|
}
|
|
254
|
+
/**
|
|
255
|
+
* Claim assets from a matured redemption request on a dated-redemption
|
|
256
|
+
* (RWA-style) vault. The `year`, `month`, `day`, and `receiverIndex` tuple
|
|
257
|
+
* identifies which batch of the user's matured requests to redeem from —
|
|
258
|
+
* these are emitted at request-time and indexed by the subgraph.
|
|
259
|
+
*
|
|
260
|
+
* For non-dated vaults that complete their redemption via `instantRedeem`,
|
|
261
|
+
* see {@link EVMAdapter.vaultRequestRedeem} with `isInstantRedeem: true`.
|
|
262
|
+
*
|
|
263
|
+
* @param options - {@link IContractWriteOptions} plus `year` / `month` /
|
|
264
|
+
* `day` / `receiverIndex` identifying the matured batch to claim.
|
|
265
|
+
* @returns The redeem `TransactionResponse`.
|
|
266
|
+
* @throws AugustValidationError on invalid inputs.
|
|
267
|
+
* @throws AugustSDKError on RPC / contract revert.
|
|
268
|
+
*
|
|
269
|
+
* @example
|
|
270
|
+
* ```ts
|
|
271
|
+
* const tx = await augustSdk.evm.vaultRedeem({
|
|
272
|
+
* target: vaultAddress,
|
|
273
|
+
* wallet: walletAddress,
|
|
274
|
+
* amount: shareAmount,
|
|
275
|
+
* year: '2026',
|
|
276
|
+
* month: '06',
|
|
277
|
+
* day: '02',
|
|
278
|
+
* receiverIndex: '0',
|
|
279
|
+
* wait: true,
|
|
280
|
+
* });
|
|
281
|
+
* ```
|
|
282
|
+
*/
|
|
75
283
|
async vaultRedeem(options) {
|
|
76
284
|
const signer = await this.getSigner();
|
|
77
285
|
return (0, write_actions_1.vaultRedeem)(signer, options);
|
|
@@ -92,22 +300,83 @@ class EVMAdapter {
|
|
|
92
300
|
const signer = await this.getSigner();
|
|
93
301
|
return (0, read_actions_1.getRemainingAllocations)(signer, options);
|
|
94
302
|
}
|
|
303
|
+
/**
|
|
304
|
+
* Preview the share output of a deposit without broadcasting a transaction.
|
|
305
|
+
* See {@link readPreviewDeposit} for the routing details (EVM-1 vs EVM-2
|
|
306
|
+
* multi-asset vaults).
|
|
307
|
+
*
|
|
308
|
+
* @returns Shares minted in raw on-chain units (share-token decimals).
|
|
309
|
+
*
|
|
310
|
+
* @example
|
|
311
|
+
* ```ts
|
|
312
|
+
* const shares = await augustSdk.evm.previewDeposit({
|
|
313
|
+
* vault: '0x...',
|
|
314
|
+
* amount: 1_000_000n,
|
|
315
|
+
* });
|
|
316
|
+
* ```
|
|
317
|
+
*/
|
|
95
318
|
async previewDeposit(options) {
|
|
96
319
|
const signer = await this.getSigner();
|
|
97
320
|
return (0, read_actions_1.previewDeposit)(signer, options);
|
|
98
321
|
}
|
|
322
|
+
/**
|
|
323
|
+
* Preview the assets returned by redeeming a number of shares, without
|
|
324
|
+
* broadcasting a transaction.
|
|
325
|
+
*
|
|
326
|
+
* @returns Assets returned in raw on-chain units (asset decimals).
|
|
327
|
+
*
|
|
328
|
+
* @example
|
|
329
|
+
* ```ts
|
|
330
|
+
* const assets = await augustSdk.evm.previewRedeem({
|
|
331
|
+
* vault: '0x...',
|
|
332
|
+
* shares: 1_000_000_000_000_000_000n,
|
|
333
|
+
* });
|
|
334
|
+
* ```
|
|
335
|
+
*/
|
|
99
336
|
async previewRedeem(options) {
|
|
100
337
|
const signer = await this.getSigner();
|
|
101
338
|
return (0, read_actions_1.previewRedeem)(signer, options);
|
|
102
339
|
}
|
|
340
|
+
/**
|
|
341
|
+
* Read the ERC-20 allowance an owner has granted the vault. Defaults to the
|
|
342
|
+
* vault's underlying asset; pass `asset` to override.
|
|
343
|
+
*
|
|
344
|
+
* @returns Allowance as a raw `bigint`.
|
|
345
|
+
*
|
|
346
|
+
* @example
|
|
347
|
+
* ```ts
|
|
348
|
+
* const raw = await augustSdk.evm.allowance({ vault, owner });
|
|
349
|
+
* ```
|
|
350
|
+
*/
|
|
103
351
|
async allowance(options) {
|
|
104
352
|
const signer = await this.getSigner();
|
|
105
353
|
return (0, read_actions_1.allowance)(signer, options);
|
|
106
354
|
}
|
|
355
|
+
/**
|
|
356
|
+
* Read an ERC-20 token balance.
|
|
357
|
+
*
|
|
358
|
+
* @returns Balance as a raw `bigint`.
|
|
359
|
+
*
|
|
360
|
+
* @example
|
|
361
|
+
* ```ts
|
|
362
|
+
* const raw = await augustSdk.evm.balanceOf({ asset: usdcAddress, owner });
|
|
363
|
+
* ```
|
|
364
|
+
*/
|
|
107
365
|
async balanceOf(options) {
|
|
108
366
|
const signer = await this.getSigner();
|
|
109
367
|
return (0, read_actions_1.balanceOf)(signer, options);
|
|
110
368
|
}
|
|
369
|
+
/**
|
|
370
|
+
* Read the maximum deposit accepted by the vault for the supplied
|
|
371
|
+
* receiver. Useful for "vault is full" gates.
|
|
372
|
+
*
|
|
373
|
+
* @returns Max deposit as a raw `bigint`.
|
|
374
|
+
*
|
|
375
|
+
* @example
|
|
376
|
+
* ```ts
|
|
377
|
+
* const cap = await augustSdk.evm.maxDeposit({ vault });
|
|
378
|
+
* ```
|
|
379
|
+
*/
|
|
111
380
|
async maxDeposit(options) {
|
|
112
381
|
const signer = await this.getSigner();
|
|
113
382
|
return (0, read_actions_1.maxDeposit)(signer, options);
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @todo
|
|
3
|
+
*/
|
|
1
4
|
export declare const functionsToCallMapping: (provider: any, contract: any, functionCalls: any[]) => any[];
|
|
5
|
+
/**
|
|
6
|
+
* @todo
|
|
7
|
+
*/
|
|
2
8
|
export declare const functionsToCallReduction: (acc: any, curr: any, i: number, functionCalls: any[], contractCalls: any[]) => any;
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.functionsToCallReduction = exports.functionsToCallMapping = void 0;
|
|
4
4
|
const core_1 = require("../../core");
|
|
5
|
+
/**
|
|
6
|
+
* @todo
|
|
7
|
+
*/
|
|
5
8
|
const functionsToCallMapping = (provider, contract, functionCalls) => {
|
|
6
9
|
return functionCalls.map((f) => {
|
|
7
10
|
if (f === 'symbol') {
|
|
@@ -14,6 +17,9 @@ const functionsToCallMapping = (provider, contract, functionCalls) => {
|
|
|
14
17
|
});
|
|
15
18
|
};
|
|
16
19
|
exports.functionsToCallMapping = functionsToCallMapping;
|
|
20
|
+
/**
|
|
21
|
+
* @todo
|
|
22
|
+
*/
|
|
17
23
|
const functionsToCallReduction = (acc, curr, i, functionCalls, contractCalls) => {
|
|
18
24
|
let val;
|
|
19
25
|
if (functionCalls[i] === 'totalSupply' ||
|
|
@@ -33,6 +39,7 @@ const functionsToCallReduction = (acc, curr, i, functionCalls, contractCalls) =>
|
|
|
33
39
|
val = Number(curr.toString());
|
|
34
40
|
}
|
|
35
41
|
else if (functionCalls[i] === 'loansOperator') {
|
|
42
|
+
// TODO: hardcoded as we cannot pull the real strategist
|
|
36
43
|
val = '0x4DCb388488622e47683EAd1a147947140a31e485';
|
|
37
44
|
}
|
|
38
45
|
else {
|
|
@@ -7,6 +7,9 @@ const fallbackDecimals = 8;
|
|
|
7
7
|
exports.fallbackDecimals = fallbackDecimals;
|
|
8
8
|
const fallbackNetwork = 'mainnet-beta';
|
|
9
9
|
exports.fallbackNetwork = fallbackNetwork;
|
|
10
|
+
// ============================================================================
|
|
11
|
+
// SOLANA CONFIGURATION
|
|
12
|
+
// ============================================================================
|
|
10
13
|
const fallbackRpcEndpoints = {
|
|
11
14
|
devnet: 'https://api.devnet.solana.com',
|
|
12
15
|
mainnet: 'https://api.mainnet-beta.solana.com',
|
|
@@ -19,7 +22,7 @@ const programIds = {
|
|
|
19
22
|
vault: '7B8n9vL51b6ibqRAd1adZsi3x3kxtq5NZaondh22Vkyq',
|
|
20
23
|
},
|
|
21
24
|
['mainnet-beta']: {
|
|
22
|
-
vault: '7B8n9vL51b6ibqRAd1adZsi3x3kxtq5NZaondh22Vkyq',
|
|
25
|
+
vault: '7B8n9vL51b6ibqRAd1adZsi3x3kxtq5NZaondh22Vkyq', // BTCsyrup vault
|
|
23
26
|
},
|
|
24
27
|
testnet: {
|
|
25
28
|
vault: '7B8n9vL51b6ibqRAd1adZsi3x3kxtq5NZaondh22Vkyq',
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
-
import { ITokenizedVault } from '../../types';
|
|
1
|
+
import type { ITokenizedVault } from '../../types';
|
|
2
2
|
import type { IVaultBaseOptions } from '../../modules/vaults/types';
|
|
3
|
+
/**
|
|
4
|
+
* Fetch Solana vault data from on-chain program state.
|
|
5
|
+
* Falls back to backend-only data when Solana RPC is unavailable,
|
|
6
|
+
* ensuring vaults always appear in the list even without on-chain access.
|
|
7
|
+
* @param tokenizedVault Vault metadata from backend
|
|
8
|
+
* @param options RPC configuration with Solana service
|
|
9
|
+
* @returns Formatted vault object with Solana-specific fields
|
|
10
|
+
*/
|
|
3
11
|
export declare const getSolanaVault: (tokenizedVault: ITokenizedVault, options: IVaultBaseOptions) => Promise<import("../../types").IVault>;
|
|
@@ -39,14 +39,24 @@ const utils_1 = require("./utils");
|
|
|
39
39
|
const SolanaConstants = __importStar(require("./constants"));
|
|
40
40
|
const core_1 = require("../../core");
|
|
41
41
|
const utils_2 = require("../../modules/vaults/utils");
|
|
42
|
+
/**
|
|
43
|
+
* Fetch Solana vault data from on-chain program state.
|
|
44
|
+
* Falls back to backend-only data when Solana RPC is unavailable,
|
|
45
|
+
* ensuring vaults always appear in the list even without on-chain access.
|
|
46
|
+
* @param tokenizedVault Vault metadata from backend
|
|
47
|
+
* @param options RPC configuration with Solana service
|
|
48
|
+
* @returns Formatted vault object with Solana-specific fields
|
|
49
|
+
*/
|
|
42
50
|
const getSolanaVault = async (tokenizedVault, options) => {
|
|
43
51
|
const solanaRpcUrl = options.rpcUrl;
|
|
44
52
|
const solanaMetadata = tokenizedVault.solana_vault_metadata;
|
|
45
53
|
const programId = utils_1.SolanaUtils.resolveProgramId(tokenizedVault.address, solanaMetadata);
|
|
54
|
+
// Fallback decimals: prefer backend metadata, then the application default
|
|
46
55
|
const fallbackDecimals = solanaMetadata?.deposit_token_decimals ?? SolanaConstants.fallbackDecimals;
|
|
47
56
|
let vaultState = null;
|
|
48
57
|
let depositMint = null;
|
|
49
58
|
let onChainAvailable = false;
|
|
59
|
+
// Attempt to fetch on-chain data; gracefully degrade if RPC is unavailable
|
|
50
60
|
try {
|
|
51
61
|
vaultState = await utils_1.SolanaUtils.getVaultStateReadOnly({
|
|
52
62
|
idl: SolanaConstants.vaultIdl,
|
|
@@ -70,6 +80,7 @@ const getSolanaVault = async (tokenizedVault, options) => {
|
|
|
70
80
|
}
|
|
71
81
|
}
|
|
72
82
|
catch (error) {
|
|
83
|
+
// Only degrade gracefully for network/RPC issues; re-throw everything else
|
|
73
84
|
const isNetworkError = error instanceof Error &&
|
|
74
85
|
(/fetch failed|ETIMEDOUT|timeout|ECONNREFUSED|403|503|network/i.test(error.message) ||
|
|
75
86
|
error.name === 'AbortError');
|
|
@@ -79,6 +90,9 @@ const getSolanaVault = async (tokenizedVault, options) => {
|
|
|
79
90
|
core_1.Logger.log.warn('getSolanaVault', 'RPC unavailable, using backend-only data', { vault: tokenizedVault.address, error });
|
|
80
91
|
}
|
|
81
92
|
const decimals = vaultState?.depositMintDecimals ?? fallbackDecimals;
|
|
93
|
+
// Fetch share mint supply to get totalSupply.
|
|
94
|
+
// Prefer vaultState.shareMint (correct for multi-vault programs like jitoSOL);
|
|
95
|
+
// fall back to deriveShareMintPda(programId) for legacy single-vault programs.
|
|
82
96
|
let totalSupply = (0, core_1.toNormalizedBn)(0, decimals);
|
|
83
97
|
if (onChainAvailable) {
|
|
84
98
|
try {
|
|
@@ -100,6 +114,11 @@ const getSolanaVault = async (tokenizedVault, options) => {
|
|
|
100
114
|
});
|
|
101
115
|
}
|
|
102
116
|
}
|
|
117
|
+
// Total assets must mirror the on-chain `VaultState::total_assets()` which
|
|
118
|
+
// is `local_aum + deployed_aum` (see solana-vaults/programs/august-vault/
|
|
119
|
+
// src/state/vault.rs). Reading deployed_aum alone makes the displayed share
|
|
120
|
+
// price drop below 1.0 the instant the operator deploys part of the vault,
|
|
121
|
+
// even though the vault has had no PnL.
|
|
103
122
|
let totalAssets;
|
|
104
123
|
if (onChainAvailable) {
|
|
105
124
|
const localAumRaw = vaultState?.vaultState?.localAum;
|
|
@@ -115,6 +134,7 @@ const getSolanaVault = async (tokenizedVault, options) => {
|
|
|
115
134
|
else {
|
|
116
135
|
totalAssets = (0, utils_2.backendTvlToNormalizedBn)(tokenizedVault.latest_reported_tvl, decimals);
|
|
117
136
|
}
|
|
137
|
+
// Deposit asset: use on-chain data if available, otherwise backend metadata
|
|
118
138
|
const depositAsset = {
|
|
119
139
|
address: depositMint?.address ?? solanaMetadata?.deposit_mint,
|
|
120
140
|
symbol: depositMint?.symbol ?? solanaMetadata?.deposit_token_symbol,
|
|
@@ -125,6 +145,7 @@ const getSolanaVault = async (tokenizedVault, options) => {
|
|
|
125
145
|
vault: tokenizedVault.address,
|
|
126
146
|
});
|
|
127
147
|
}
|
|
148
|
+
// Build unified vault object combining on-chain and backend data
|
|
128
149
|
return (0, utils_2.buildBackendVault)(tokenizedVault, {
|
|
129
150
|
chainId: core_1.SPECIAL_CHAINS.solana.chainId,
|
|
130
151
|
version: 'sol-0',
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.vaultIdl = void 0;
|
|
4
|
+
// /**
|
|
5
|
+
// * Program IDL in camelCase format in order to be used in JS/TS.
|
|
6
|
+
// *
|
|
7
|
+
// * Note that this is only a type helper and is not the actual IDL. The original
|
|
8
|
+
// * IDL can be found at `target/idl/august_vault.json`.
|
|
9
|
+
// */
|
|
4
10
|
exports.vaultIdl = {
|
|
5
11
|
address: '7B8n9vL51b6ibqRAd1adZsi3x3kxtq5NZaondh22Vkyq',
|
|
6
12
|
metadata: {
|
|
@@ -990,6 +996,9 @@ exports.vaultIdl = {
|
|
|
990
996
|
name: 'VaultState',
|
|
991
997
|
type: {
|
|
992
998
|
kind: 'struct',
|
|
999
|
+
// Field order MUST match programs/august-vault/src/state/vault.rs:36
|
|
1000
|
+
// exactly. Borsh deserialization is positional; any reorder, addition,
|
|
1001
|
+
// or omission silently corrupts every field after the drift point.
|
|
993
1002
|
fields: [
|
|
994
1003
|
{
|
|
995
1004
|
name: 'operator',
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Solana Adapter for August SDK
|
|
3
|
+
*
|
|
4
|
+
* @module SolanaAdapter
|
|
5
|
+
*/
|
|
1
6
|
import * as SolanaConstants from './constants';
|
|
2
7
|
import * as SolanaGetters from './getters';
|
|
3
8
|
import * as SolanaActions from './vault.actions';
|
|
4
|
-
import { AnchorProvider, web3 } from '@coral-xyz/anchor';
|
|
5
|
-
import { Connection, PublicKey, Transaction } from '@solana/web3.js';
|
|
6
|
-
import { ISolanaNetwork, ISolanaRpcEndpoint } from './types';
|
|
7
|
-
import { SendTransactionOptions } from '@solana/wallet-adapter-base';
|
|
9
|
+
import type { AnchorProvider, web3 } from '@coral-xyz/anchor';
|
|
10
|
+
import { Connection, PublicKey, type Transaction } from '@solana/web3.js';
|
|
11
|
+
import type { ISolanaNetwork, ISolanaRpcEndpoint } from './types';
|
|
12
|
+
import type { SendTransactionOptions } from '@solana/wallet-adapter-base';
|
|
8
13
|
export declare const Solana: {
|
|
9
14
|
utils: {
|
|
10
15
|
getExplorerLink: ({ signature, type, network, }: {
|
|
@@ -102,6 +107,16 @@ export declare const Solana: {
|
|
|
102
107
|
actions: typeof SolanaActions;
|
|
103
108
|
getters: typeof SolanaGetters;
|
|
104
109
|
};
|
|
110
|
+
/**
|
|
111
|
+
* Solana Adapter for August SDK
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* To access the Solana adapter instance
|
|
115
|
+
* ```
|
|
116
|
+
* const sdk = new AugustSDK()
|
|
117
|
+
* sdk.solana.getVaultState()
|
|
118
|
+
* ```
|
|
119
|
+
*/
|
|
105
120
|
declare class SolanaAdapter {
|
|
106
121
|
private _endpoint;
|
|
107
122
|
private _network;
|
|
@@ -132,11 +147,51 @@ declare class SolanaAdapter {
|
|
|
132
147
|
getTokenSymbol(mintAddress: string | PublicKey): Promise<string>;
|
|
133
148
|
fetchUserTokenBalance(publicKey: PublicKey | string, depositMint: PublicKey | string): Promise<any>;
|
|
134
149
|
fetchUserShareBalance(publicKey: PublicKey | string, shareMint: PublicKey | string): Promise<any>;
|
|
150
|
+
/**
|
|
151
|
+
* BigInt-safe variant of {@link fetchUserShareBalance}. Returns the raw u64
|
|
152
|
+
* `amount` (as a base-units string) plus the mint's `decimals` (or `null`
|
|
153
|
+
* when the scale can't be determined — see Returns), so the caller can
|
|
154
|
+
* produce a correct `INormalizedNumber` without losing precision.
|
|
155
|
+
*
|
|
156
|
+
* Prefer this anywhere the result feeds BigInt math — positions, max-
|
|
157
|
+
* actions, redemption sizing, allowance checks. `fetchUserShareBalance`
|
|
158
|
+
* returns a JS-number `uiAmount` which silently encodes against 18 decimals
|
|
159
|
+
* when passed through `toNormalizedBn(value)` without an explicit decimals
|
|
160
|
+
* argument; that's exactly how the jitoSOL "missing position" regression
|
|
161
|
+
* manifested.
|
|
162
|
+
*
|
|
163
|
+
* RPC cost: 1 `getParsedTokenAccountsByOwner` call. Worst case ~150ms on a
|
|
164
|
+
* healthy mainnet endpoint.
|
|
165
|
+
*
|
|
166
|
+
* @param publicKey Wallet owner (PublicKey or base58 string).
|
|
167
|
+
* @param shareMint The vault's share-token mint (PublicKey or base58).
|
|
168
|
+
* @returns
|
|
169
|
+
* `{ amount, decimals }`. Three observable shapes:
|
|
170
|
+
* - `{ amount: '<u64>', decimals: <number> }` — token account exists.
|
|
171
|
+
* - `{ amount: '0', decimals: null }` — no token account for this mint
|
|
172
|
+
* under this wallet, OR `tokenAmount` was missing from the response,
|
|
173
|
+
* OR `publicKey`/`shareMint` was not supplied. Distinguishable from a
|
|
174
|
+
* genuine zero-balance account (`decimals` would be set there).
|
|
175
|
+
* - `{ amount: '0', decimals: null }` — RPC threw (error is logged).
|
|
176
|
+
*
|
|
177
|
+
* `decimals === null` means "we could not determine the scale" — callers
|
|
178
|
+
* that need an `INormalizedNumber` must fall back to a known decimals
|
|
179
|
+
* value (typically the deposit mint's decimals from backend metadata)
|
|
180
|
+
* before normalizing. Never throws.
|
|
181
|
+
*/
|
|
135
182
|
fetchUserShareBalanceRaw(publicKey: PublicKey | string, shareMint: PublicKey | string): Promise<{
|
|
136
183
|
amount: string;
|
|
137
184
|
decimals: number | null;
|
|
138
185
|
}>;
|
|
186
|
+
/**
|
|
187
|
+
* Deposit funds into a Solana August vault.
|
|
188
|
+
* @param depositAmount `bigint` (raw on-chain units) or `number` (UI amount).
|
|
189
|
+
*/
|
|
139
190
|
vaultDeposit(vaultProgramId: PublicKey | string, idl: any, publicKey: PublicKey | string, depositAmount: number | bigint, sendTransaction: (transaction: Transaction | web3.VersionedTransaction, connection: Connection, options?: SendTransactionOptions) => Promise<web3.TransactionSignature>, vaultAddress?: PublicKey | string): Promise<any>;
|
|
191
|
+
/**
|
|
192
|
+
* Redeem vault shares from a Solana August vault.
|
|
193
|
+
* @param redeemShares `bigint` (raw share units) or `number` (UI amount).
|
|
194
|
+
*/
|
|
140
195
|
vaultRedeem(vaultProgramId: PublicKey | string, idl: any, publicKey: PublicKey | string, redeemShares: number | bigint, sendTransaction: (transaction: Transaction | web3.VersionedTransaction, connection: Connection, options?: SendTransactionOptions) => Promise<web3.TransactionSignature>, vaultAddress?: PublicKey | string): Promise<any>;
|
|
141
196
|
getProgramId(type: 'vault'): string;
|
|
142
197
|
}
|