@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,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TypedContract type definitions for ethers v6 with abitype.
|
|
3
|
+
*
|
|
4
|
+
* This is a local copy of types from ethers-abitype to avoid the global
|
|
5
|
+
* abitype module augmentation that pollutes AddressType with `string | Addressable`,
|
|
6
|
+
* which breaks viem type compatibility.
|
|
7
|
+
*
|
|
8
|
+
* @see https://github.com/ethers-io/ethers.js/issues/4475
|
|
9
|
+
*/
|
|
1
10
|
import type { BaseContract, ContractTransaction, ContractTransactionResponse, DeferredTopicFilter, EventFragment, FunctionFragment, Result, Overrides } from 'ethers';
|
|
2
11
|
import type { Abi, AbiParametersToPrimitiveTypes, ExtractAbiEvent, ExtractAbiEventNames, ExtractAbiEvents, ExtractAbiFunction, ExtractAbiFunctionNames, ExtractAbiFunctions } from 'abitype';
|
|
3
12
|
type AsArray<T> = T extends readonly unknown[] ? T : never;
|
|
@@ -11,26 +20,81 @@ export type TypedFragment<TAbi extends Abi, TFunctionName extends string, TFunct
|
|
|
11
20
|
};
|
|
12
21
|
export interface TypedContractFunction<TAbi extends Abi, TFunctionName extends string, TFunction extends ExtractAbiFunctions<TAbi> = ExtractAbiFunction<TAbi, TFunctionName>, TInputArgs extends readonly unknown[] = AsArray<AbiParametersToPrimitiveTypes<TFunction['inputs']>>, TResult = TypedContractFunctionResult<TAbi, TFunctionName>, TFragment = TypedFragment<TAbi, TFunctionName>> {
|
|
13
22
|
(...args: [...TInputArgs, overrides?: Overrides]): Promise<TFunction['stateMutability'] extends 'view' | 'pure' ? TResult : ContractTransactionResponse>;
|
|
23
|
+
/**
|
|
24
|
+
* The name of the Contract method.
|
|
25
|
+
*/
|
|
14
26
|
name: TFunctionName;
|
|
27
|
+
/**
|
|
28
|
+
* The fragment of the Contract method. This will throw on ambiguous
|
|
29
|
+
* method names.
|
|
30
|
+
*/
|
|
15
31
|
fragment: TFragment;
|
|
32
|
+
/**
|
|
33
|
+
* Returns the fragment constrained by %%args%%. This can be used to
|
|
34
|
+
* resolve ambiguous method names.
|
|
35
|
+
*/
|
|
16
36
|
getFragment(...args: [...TInputArgs]): TFragment;
|
|
37
|
+
/**
|
|
38
|
+
* Returns a populated transaction that can be used to perform the
|
|
39
|
+
* contract method with %%args%%.
|
|
40
|
+
*/
|
|
17
41
|
populateTransaction(...args: [...TInputArgs, overrides?: Overrides]): Promise<ContractTransaction>;
|
|
42
|
+
/**
|
|
43
|
+
* Call the contract method with %%args%% and return the value.
|
|
44
|
+
*
|
|
45
|
+
* If the return value is a single type, it will be dereferenced and
|
|
46
|
+
* returned directly, otherwise the full Result will be returned.
|
|
47
|
+
*/
|
|
18
48
|
staticCall(...args: [...TInputArgs, overrides?: Overrides]): Promise<TResult>;
|
|
49
|
+
/**
|
|
50
|
+
* Send a transaction for the contract method with %%args%%.
|
|
51
|
+
*/
|
|
19
52
|
send(...args: [...TInputArgs, overrides?: Overrides]): Promise<ContractTransactionResponse>;
|
|
53
|
+
/**
|
|
54
|
+
* Estimate the gas to send the contract method with %%args%%.
|
|
55
|
+
*/
|
|
20
56
|
estimateGas(...args: [...TInputArgs, overrides?: Overrides]): Promise<bigint>;
|
|
57
|
+
/**
|
|
58
|
+
* Call the contract method with %%args%% and return the Result
|
|
59
|
+
* without any dereferencing.
|
|
60
|
+
*/
|
|
21
61
|
staticCallResult(...args: [...TInputArgs, overrides?: Overrides]): Promise<Result>;
|
|
22
62
|
}
|
|
23
63
|
export interface TypedContractEvent<TAbi extends Abi, TEventName extends string, TEvent extends ExtractAbiEvents<TAbi> = ExtractAbiEvent<TAbi, TEventName>, TEventArgs extends readonly unknown[] = AsArray<Partial<AbiParametersToPrimitiveTypes<TEvent['inputs']>>>> {
|
|
24
64
|
(...args: [...TEventArgs]): DeferredTopicFilter;
|
|
65
|
+
/**
|
|
66
|
+
* The name of the Contract event.
|
|
67
|
+
*/
|
|
25
68
|
name: TEventName;
|
|
69
|
+
/**
|
|
70
|
+
* The fragment of the Contract event. This will throw on ambiguous
|
|
71
|
+
* method names.
|
|
72
|
+
*/
|
|
26
73
|
fragment: EventFragment;
|
|
74
|
+
/**
|
|
75
|
+
* Returns the fragment constrained by %%args%%. This can be used to
|
|
76
|
+
* resolve ambiguous event names.
|
|
77
|
+
*/
|
|
27
78
|
getFragment(...args: [...TEventArgs]): EventFragment;
|
|
28
79
|
}
|
|
29
80
|
export type TypedContract<TAbi extends Abi> = Omit<BaseContract, 'getFunction' | 'getEvent'> & {
|
|
30
81
|
[Method in ExtractAbiFunctionNames<TAbi>]: TypedContractFunction<TAbi, Method>;
|
|
31
82
|
} & {
|
|
83
|
+
/**
|
|
84
|
+
* Return the function for a given name. This is useful when a contract
|
|
85
|
+
* method name conflicts with a JavaScript name such as ``prototype`` or
|
|
86
|
+
* when using a Contract programatically.
|
|
87
|
+
*/
|
|
32
88
|
getFunction<T extends ExtractAbiFunctionNames<TAbi>>(key: T | TypedFragment<TAbi, T>): TypedContractFunction<TAbi, T>;
|
|
89
|
+
/**
|
|
90
|
+
* Return the event for a given name. This is useful when a contract
|
|
91
|
+
* event name conflicts with a JavaScript name such as ``prototype`` or
|
|
92
|
+
* when using a Contract programatically.
|
|
93
|
+
*/
|
|
33
94
|
getEvent<T extends ExtractAbiEventNames<TAbi>>(key: T | EventFragment): TypedContractEvent<TAbi, T>;
|
|
95
|
+
/**
|
|
96
|
+
* All the Events available on this contract.
|
|
97
|
+
*/
|
|
34
98
|
filters: {
|
|
35
99
|
[EventName in ExtractAbiEventNames<TAbi>]: TypedContractEvent<TAbi, EventName>;
|
|
36
100
|
};
|
package/lib/types/vaults.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IAddress, INormalizedNumber, VaultAddress } from './web3';
|
|
2
|
-
import { IDebankProtocolExposure, IDebankTokenExposure, IOTCPosition, IWSSubaccountCefi, IWSSubaccountLoan, IWSTokenEntry, ITokenizedVaultOperator, ITokenizedVaultEoaOperator, IHIstoricalSnapshot, IApyOverride } from './webserver';
|
|
1
|
+
import type { IAddress, INormalizedNumber, VaultAddress } from './web3';
|
|
2
|
+
import type { IDebankProtocolExposure, IDebankTokenExposure, IOTCPosition, IWSSubaccountCefi, IWSSubaccountLoan, IWSTokenEntry, ITokenizedVaultOperator, ITokenizedVaultEoaOperator, IHIstoricalSnapshot, IApyOverride } from './webserver';
|
|
3
3
|
import type { InterfaceAbi } from 'ethers';
|
|
4
4
|
export interface IVaultLoan {
|
|
5
5
|
vault: VaultAddress;
|
|
@@ -22,6 +22,13 @@ export interface IVaultLoan {
|
|
|
22
22
|
isIdleCapital: boolean;
|
|
23
23
|
allocation: number;
|
|
24
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* One row of borrower-health-factor data for a vault. `health_factor` is
|
|
27
|
+
* absent when the upstream August backend has no record for `borrower`
|
|
28
|
+
* (e.g. test loans whose borrower is not a registered subaccount), or when
|
|
29
|
+
* the per-borrower fetch failed — callers must handle the undefined case
|
|
30
|
+
* rather than assume a numeric value is present.
|
|
31
|
+
*/
|
|
25
32
|
export interface IVaultBorrowerHealthFactor {
|
|
26
33
|
borrower: IAddress;
|
|
27
34
|
loan: IAddress;
|
|
@@ -72,6 +79,22 @@ export type IExposurePerCategory = {
|
|
|
72
79
|
walletBalance: number;
|
|
73
80
|
loanBalance: number;
|
|
74
81
|
};
|
|
82
|
+
/**
|
|
83
|
+
* @todo clean up to minimize data transfer
|
|
84
|
+
* ```typescript
|
|
85
|
+
* {
|
|
86
|
+
* defi: IOctavfiPortfolio[]
|
|
87
|
+
* cefi: IWSSubaccountCefi[]
|
|
88
|
+
* otc: Record<string, IOTCPosition>
|
|
89
|
+
* breakdown: { // this will be total net values
|
|
90
|
+
* defi: number;
|
|
91
|
+
* cefi: number;
|
|
92
|
+
* otc: number;
|
|
93
|
+
* total: number;
|
|
94
|
+
* }
|
|
95
|
+
* }
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
75
98
|
export interface IVaultAllocations {
|
|
76
99
|
defi: IDebankProtocolExposure[];
|
|
77
100
|
tokens: IDebankTokenExposure[];
|
|
@@ -104,6 +127,9 @@ export interface IVaultStrategist {
|
|
|
104
127
|
}
|
|
105
128
|
export type IVaultVersion = 'evm-0' | 'evm-1' | 'evm-2' | 'sol-0' | 'sui-0' | 'stellar-0';
|
|
106
129
|
export type { ChainType } from './web3';
|
|
130
|
+
/**
|
|
131
|
+
* Adapter configuration for vaults that support deposits with alternative tokens
|
|
132
|
+
*/
|
|
107
133
|
export interface IVaultAdapterConfig {
|
|
108
134
|
lpTokenAddress?: IAddress;
|
|
109
135
|
isNativeTokenDeposit: boolean;
|
|
@@ -119,9 +145,14 @@ export interface IVaultAdapterConfig {
|
|
|
119
145
|
export interface IVault {
|
|
120
146
|
max_drawdown?: number | null;
|
|
121
147
|
historical_apy?: Record<number, number> | null;
|
|
148
|
+
/** @deprecated Use getVaultHistoricalTimeseries instead */
|
|
122
149
|
historical_snapshots?: IHIstoricalSnapshot[];
|
|
123
150
|
depositCap?: INormalizedNumber;
|
|
124
151
|
maxDepositAmount?: INormalizedNumber;
|
|
152
|
+
/**
|
|
153
|
+
* Vault contract address. May be an EVM hex address, Solana base58 address,
|
|
154
|
+
* or Stellar base32 address depending on the vault's chain.
|
|
155
|
+
*/
|
|
125
156
|
address: VaultAddress;
|
|
126
157
|
chainId: number;
|
|
127
158
|
name: string;
|
|
@@ -195,8 +226,10 @@ export interface IVault {
|
|
|
195
226
|
latest_reported_tvl?: number | null;
|
|
196
227
|
cachedAt?: string | null;
|
|
197
228
|
showCapFilled?: boolean | null;
|
|
229
|
+
/** Controls how the vault's APY is displayed; null when the backend has not set an override. */
|
|
198
230
|
apyOverride?: IApyOverride | null;
|
|
199
231
|
programId?: string;
|
|
232
|
+
/** Instant redemption config, populated from backend instant_redeem_config */
|
|
200
233
|
instant_redeem_config?: {
|
|
201
234
|
subaccountAddress: IAddress;
|
|
202
235
|
outputAssetSymbol: string;
|
|
@@ -265,15 +298,29 @@ export interface IVaultPnl {
|
|
|
265
298
|
totalPnl: INormalizedNumber;
|
|
266
299
|
pnlUsd: number;
|
|
267
300
|
}
|
|
301
|
+
/**
|
|
302
|
+
* Response for GET /tokenized_vault/annualized_apy/{vault_address}
|
|
303
|
+
*
|
|
304
|
+
* Supported Vaults: cUSDO, tETH, wstETH, rsETH
|
|
305
|
+
*
|
|
306
|
+
* @deprecated The `hgETH30dLiquidAPY` and `hgETH7dLiquidAPY` fields are deprecated.
|
|
307
|
+
* These fields will be removed on 2026-01-01.
|
|
308
|
+
* Use `liquidAPY30Day` and `liquidAPY7Day` fields instead.
|
|
309
|
+
*/
|
|
268
310
|
export interface IVaultAnnualizedApy {
|
|
269
311
|
vaultAddress: IAddress;
|
|
270
312
|
liquidityApy: number;
|
|
271
313
|
annualizedApy: number;
|
|
314
|
+
/** @deprecated Use `liquidAPY7Day` instead. Will be removed on 2026-01-01. */
|
|
272
315
|
hgETH7dLiquidAPY?: number;
|
|
316
|
+
/** @deprecated Use `liquidAPY30Day` instead. Will be removed on 2026-01-01. */
|
|
273
317
|
hgETH30dLiquidAPY?: number;
|
|
274
318
|
liquidAPY7Day?: number;
|
|
275
319
|
liquidAPY30Day?: number;
|
|
276
320
|
}
|
|
321
|
+
/**
|
|
322
|
+
* Response for GET /tokenized_vault/vault_summary/{vault_address}
|
|
323
|
+
*/
|
|
277
324
|
export interface IVaultSummary {
|
|
278
325
|
vaultAddress: IAddress;
|
|
279
326
|
name: string;
|
|
@@ -285,6 +332,9 @@ export interface IVaultSummary {
|
|
|
285
332
|
month: number;
|
|
286
333
|
};
|
|
287
334
|
}
|
|
335
|
+
/**
|
|
336
|
+
* Response for GET /withdrawals/{chain}/{vault_address}
|
|
337
|
+
*/
|
|
288
338
|
export interface IVaultWithdrawals {
|
|
289
339
|
vaultAddress: IAddress;
|
|
290
340
|
chain: string;
|
|
@@ -297,6 +347,9 @@ export interface IVaultWithdrawals {
|
|
|
297
347
|
receiver: IAddress;
|
|
298
348
|
}>;
|
|
299
349
|
}
|
|
350
|
+
/**
|
|
351
|
+
* Response for GET /vaults/\{vault_addr\}/pending-redemptions
|
|
352
|
+
*/
|
|
300
353
|
export interface IVaultPendingRedemptions {
|
|
301
354
|
vault: {
|
|
302
355
|
address: string;
|
|
@@ -328,38 +381,120 @@ export interface IVaultPendingRedemptions {
|
|
|
328
381
|
isOverdue: boolean;
|
|
329
382
|
}>;
|
|
330
383
|
}
|
|
384
|
+
/**
|
|
385
|
+
* One unrealized-PnL snapshot for a vault, computed by the August backend
|
|
386
|
+
* from periodic vault state. `timestamp` is an ISO-8601 datetime; monetary
|
|
387
|
+
* fields are denominated in the vault's reference asset
|
|
388
|
+
* (`referenceAsset`) except `assetPrice`, which is the asset's USD price.
|
|
389
|
+
*/
|
|
390
|
+
export type IUnrealizedPnlSnapshot = {
|
|
391
|
+
timestamp: string;
|
|
392
|
+
vaultName: string;
|
|
393
|
+
vaultAddress: string;
|
|
394
|
+
strategistName: string | null;
|
|
395
|
+
referenceAsset: string;
|
|
396
|
+
assetPrice: number;
|
|
397
|
+
tvlOnVault: number;
|
|
398
|
+
currentRedeemRatio: number;
|
|
399
|
+
actualTvl: number;
|
|
400
|
+
adjustedRedeemRatio: number;
|
|
401
|
+
unrealizedPnl: number;
|
|
402
|
+
unrealizedPnlInAsset: number;
|
|
403
|
+
};
|
|
404
|
+
/**
|
|
405
|
+
* Vault metadata item from upshift API
|
|
406
|
+
*/
|
|
331
407
|
export interface IVaultMetadataItem {
|
|
332
408
|
symbol: string;
|
|
333
409
|
subgraph: string;
|
|
334
410
|
address: string;
|
|
335
411
|
}
|
|
412
|
+
/**
|
|
413
|
+
* Response type for getVaultMetadata
|
|
414
|
+
* Keys are lowercase of the symbol value
|
|
415
|
+
*/
|
|
336
416
|
export type IVaultMetadata = Record<string, IVaultMetadataItem>;
|
|
417
|
+
/**
|
|
418
|
+
* Numeric vault-type tag used by the on-chain `SwapRouter` to branch between
|
|
419
|
+
* the ERC-4626 (`deposit(uint256, address)`) and multi-asset
|
|
420
|
+
* (`deposit(address, uint256, address)`) deposit interfaces.
|
|
421
|
+
*
|
|
422
|
+
* Values match the contract's `VAULT_TYPE_ERC4626` / `VAULT_TYPE_TOKENIZED_VAULT_V2`
|
|
423
|
+
* constants exactly. Set by an admin per-vault via `enableVault` and looked
|
|
424
|
+
* up via `vaultInfo(vaultAddr).vaultType`. SDK callers normally do not pass
|
|
425
|
+
* this — the router resolves it internally.
|
|
426
|
+
*/
|
|
337
427
|
export declare enum SwapRouterVaultType {
|
|
338
428
|
ERC4626 = 1,
|
|
339
429
|
TokenizedVaultV2 = 2
|
|
340
430
|
}
|
|
431
|
+
/**
|
|
432
|
+
* One swap leg passed to `SwapRouter.swapAndDeposit`.
|
|
433
|
+
*
|
|
434
|
+
* The router pulls `amountIn` of `tokenIn` from the caller, approves the
|
|
435
|
+
* configured `tokenTransferProxies[router]` address, and calls `router` with
|
|
436
|
+
* `payload`. Output is measured by balance-diff and must clear `minAmountOut`
|
|
437
|
+
* or the call reverts with `SlippageError`.
|
|
438
|
+
*
|
|
439
|
+
* For a single-hop swap, `tokenOut` is typically the vault's reference asset.
|
|
440
|
+
* For multi-hop, intermediate legs use any whitelisted token.
|
|
441
|
+
*/
|
|
341
442
|
export interface ISwapParams {
|
|
443
|
+
/** ERC-20 address pulled from the caller. Must be whitelisted via `whitelistedTokens`. */
|
|
342
444
|
tokenIn: IAddress;
|
|
445
|
+
/** ERC-20 address the router is expected to produce. */
|
|
343
446
|
tokenOut: IAddress;
|
|
447
|
+
/** Input amount in `tokenIn`'s smallest unit (no decimals). */
|
|
344
448
|
amountIn: bigint;
|
|
449
|
+
/** Minimum acceptable `tokenOut` output. Below this the call reverts. */
|
|
345
450
|
minAmountOut: bigint;
|
|
451
|
+
/** Whitelisted DEX router target (enabled via `enableRouter`). */
|
|
346
452
|
router: IAddress;
|
|
453
|
+
/** ABI-encoded calldata to invoke on `router`. */
|
|
347
454
|
payload: `0x${string}`;
|
|
348
455
|
}
|
|
456
|
+
/**
|
|
457
|
+
* Common options shared by every public SwapRouter SDK method.
|
|
458
|
+
*/
|
|
349
459
|
export interface ISwapRouterBaseOptions {
|
|
460
|
+
/** EVM chain ID — must have an entry in `SWAP_ROUTER_ADDRESSES`. */
|
|
350
461
|
chainId: number;
|
|
462
|
+
/** August vault address. Must be registered via `enableVault` on the router. */
|
|
351
463
|
vault: IAddress;
|
|
464
|
+
/** Address that receives the minted vault shares. */
|
|
352
465
|
receiver: IAddress;
|
|
466
|
+
/**
|
|
467
|
+
* 32-byte origin/referral code registered via `addOrigin`. Drives the
|
|
468
|
+
* origin-fee accrual. Defaults to {@link ORIGIN_CODES.default} when omitted.
|
|
469
|
+
*/
|
|
353
470
|
originCode?: `0x${string}`;
|
|
471
|
+
/** When `true`, the helper awaits a single confirmation before returning. */
|
|
354
472
|
wait?: boolean;
|
|
355
473
|
}
|
|
474
|
+
/**
|
|
475
|
+
* Options for `swapAndDeposit` — ERC-20 in, vault reference asset out.
|
|
476
|
+
*/
|
|
356
477
|
export interface ISwapAndDepositOptions extends ISwapRouterBaseOptions {
|
|
478
|
+
/** One or more swap legs. Capped by the contract's `MAX_SWAPS`. */
|
|
357
479
|
swaps: ISwapParams[];
|
|
358
480
|
}
|
|
481
|
+
/**
|
|
482
|
+
* Options for `depositViaSwapRouter` — direct deposit (no swap) of an
|
|
483
|
+
* already-held asset, routed through the SwapRouter so origin/swap-fee
|
|
484
|
+
* accounting still applies.
|
|
485
|
+
*/
|
|
359
486
|
export interface ISwapRouterDirectDepositOptions extends ISwapRouterBaseOptions {
|
|
487
|
+
/** Deposited ERC-20 asset. For ERC-4626 vaults this must equal the reference asset. */
|
|
360
488
|
asset: IAddress;
|
|
489
|
+
/** Amount in `asset`'s smallest unit. */
|
|
361
490
|
amount: bigint;
|
|
362
491
|
}
|
|
492
|
+
/**
|
|
493
|
+
* Options for `depositNativeViaSwapRouter` — wraps `msg.value` to the
|
|
494
|
+
* chain's wrapped-native token and deposits. Only valid when the vault's
|
|
495
|
+
* reference asset equals `wrappedNativeTokenAddress`.
|
|
496
|
+
*/
|
|
363
497
|
export interface ISwapRouterNativeDepositOptions extends ISwapRouterBaseOptions {
|
|
498
|
+
/** Native token amount in wei. Sent as `msg.value`. */
|
|
364
499
|
amount: bigint;
|
|
365
500
|
}
|
package/lib/types/vaults.js
CHANGED
|
@@ -6,6 +6,16 @@ var VaultRedemptionStatus;
|
|
|
6
6
|
VaultRedemptionStatus["AWAITING_COOLDOWN"] = "awaiting_cooldown";
|
|
7
7
|
VaultRedemptionStatus["READY_TO_CLAIM"] = "ready_to_claim";
|
|
8
8
|
})(VaultRedemptionStatus || (exports.VaultRedemptionStatus = VaultRedemptionStatus = {}));
|
|
9
|
+
/**
|
|
10
|
+
* Numeric vault-type tag used by the on-chain `SwapRouter` to branch between
|
|
11
|
+
* the ERC-4626 (`deposit(uint256, address)`) and multi-asset
|
|
12
|
+
* (`deposit(address, uint256, address)`) deposit interfaces.
|
|
13
|
+
*
|
|
14
|
+
* Values match the contract's `VAULT_TYPE_ERC4626` / `VAULT_TYPE_TOKENIZED_VAULT_V2`
|
|
15
|
+
* constants exactly. Set by an admin per-vault via `enableVault` and looked
|
|
16
|
+
* up via `vaultInfo(vaultAddr).vaultType`. SDK callers normally do not pass
|
|
17
|
+
* this — the router resolves it internally.
|
|
18
|
+
*/
|
|
9
19
|
var SwapRouterVaultType;
|
|
10
20
|
(function (SwapRouterVaultType) {
|
|
11
21
|
SwapRouterVaultType[SwapRouterVaultType["ERC4626"] = 1] = "ERC4626";
|
package/lib/types/web3.d.ts
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
import { Signer, Provider } from 'ethers';
|
|
2
2
|
export type IAddress = `0x${string}`;
|
|
3
|
+
/**
|
|
4
|
+
* Address type for vault contracts across all supported chains.
|
|
5
|
+
* EVM vaults use `0x`-prefixed hex addresses, Solana vaults use base58,
|
|
6
|
+
* and Stellar vaults use 56-character base32 addresses (G/C prefix).
|
|
7
|
+
*
|
|
8
|
+
* Use this instead of `IAddress` when the address may belong to any chain.
|
|
9
|
+
*/
|
|
3
10
|
export type VaultAddress = string;
|
|
4
11
|
export type IChainId = number;
|
|
5
12
|
export type ChainType = 'evm' | 'solana' | 'sui' | 'stellar';
|
|
13
|
+
/** Runtime type guard for ChainType values (e.g. at API deserialization boundaries). */
|
|
6
14
|
export declare function isChainType(value: unknown): value is ChainType;
|
|
7
15
|
export type IChainObj = {
|
|
8
16
|
chainId: number;
|
package/lib/types/web3.js
CHANGED
package/lib/types/webserver.d.ts
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import { IUserRoles } from './user';
|
|
2
2
|
import { IAddress, type ChainType, type IStellarNetwork } from './web3';
|
|
3
|
+
/**
|
|
4
|
+
* Table of Contents
|
|
5
|
+
* 1) Subaccounts
|
|
6
|
+
* 2) Metrics
|
|
7
|
+
* 3) Tokens
|
|
8
|
+
* 4) Users
|
|
9
|
+
* 5) Statuses
|
|
10
|
+
* 6) Integrations
|
|
11
|
+
* 7) Lending Pools
|
|
12
|
+
*/
|
|
3
13
|
export type IHIstoricalSnapshot = {
|
|
4
14
|
total_assets: number;
|
|
5
15
|
total_shares: number;
|
|
@@ -14,6 +24,9 @@ export interface IWSMonitorHeaders {
|
|
|
14
24
|
'x-user-id'?: string;
|
|
15
25
|
'x-environment'?: string;
|
|
16
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* Subaccounts
|
|
29
|
+
*/
|
|
17
30
|
export type IWSSubaccountPermission = {
|
|
18
31
|
name: string;
|
|
19
32
|
chain: number;
|
|
@@ -117,6 +130,9 @@ export interface IWSSubaccountLoan {
|
|
|
117
130
|
payment_interval: number;
|
|
118
131
|
lender_apr: number;
|
|
119
132
|
}
|
|
133
|
+
/**
|
|
134
|
+
* Metrics
|
|
135
|
+
*/
|
|
120
136
|
export type IWSMetricsPnlAttributes = {
|
|
121
137
|
pnl: number;
|
|
122
138
|
percent_return: number;
|
|
@@ -289,6 +305,9 @@ export type IWSMetricsTimeseries = {
|
|
|
289
305
|
total_pnl_7d: number | null;
|
|
290
306
|
total_pnl_30d: number | null;
|
|
291
307
|
};
|
|
308
|
+
/**
|
|
309
|
+
* Tokens
|
|
310
|
+
*/
|
|
292
311
|
export type IWSTokenEntry = {
|
|
293
312
|
symbol: string;
|
|
294
313
|
address: `0x${string}`;
|
|
@@ -306,6 +325,9 @@ export type IWSTokenPrice = {
|
|
|
306
325
|
price: number;
|
|
307
326
|
dt: string;
|
|
308
327
|
};
|
|
328
|
+
/**
|
|
329
|
+
* Users
|
|
330
|
+
*/
|
|
309
331
|
export type IWSUserSubaccount = {
|
|
310
332
|
internal_name: string;
|
|
311
333
|
friendly_name: string;
|
|
@@ -332,12 +354,21 @@ export type IWSUser = {
|
|
|
332
354
|
disabled: boolean;
|
|
333
355
|
id: string;
|
|
334
356
|
};
|
|
357
|
+
/**
|
|
358
|
+
* Statuses
|
|
359
|
+
*/
|
|
335
360
|
export type IWSFireblocksTxStatus = 'SUBMITTED' | 'PENDING_AML_SCREENING' | 'PENDING_AUTHORIZATION' | 'QUEUED' | 'PENDING_SIGNATURE' | 'PENDING_3RD_PARTY_MANUAL_APPROVAL' | 'PENDING_3RD_PARTY' | 'BROADCASTING' | 'CONFIRMING' | 'COMPLETED' | 'CANCELLING' | 'BLOCKED' | 'REJECTED' | 'FAILED';
|
|
361
|
+
/**
|
|
362
|
+
* Integrations
|
|
363
|
+
*/
|
|
336
364
|
export interface IWSIntegrationMorphoApy {
|
|
337
365
|
apy: number;
|
|
338
366
|
vault_positions: any[];
|
|
339
367
|
token: IWSTokenEntry;
|
|
340
368
|
}
|
|
369
|
+
/**
|
|
370
|
+
* Lending Pools
|
|
371
|
+
*/
|
|
341
372
|
export interface IWSVaultLoan {
|
|
342
373
|
address: IAddress;
|
|
343
374
|
lender: IAddress;
|
|
@@ -392,14 +423,23 @@ export interface ITokenizedVaultEoaOperator {
|
|
|
392
423
|
id: string;
|
|
393
424
|
name: string;
|
|
394
425
|
}
|
|
426
|
+
/**
|
|
427
|
+
* Controls how the vault's APY is displayed in the UI.
|
|
428
|
+
* When `is_show_target_apy` is true, the UI should show a target/projected APY.
|
|
429
|
+
* When `is_show_hardcoded_apy` is true, `hardcoded_apy` overrides the computed APY.
|
|
430
|
+
*/
|
|
395
431
|
export interface IApyOverride {
|
|
432
|
+
/** Whether to display a target APY rather than historical performance. */
|
|
396
433
|
is_show_target_apy: boolean;
|
|
434
|
+
/** Whether to display `hardcoded_apy` in place of the computed APY. */
|
|
397
435
|
is_show_hardcoded_apy: boolean;
|
|
436
|
+
/** The fixed APY value to display when `is_show_hardcoded_apy` is true, or null. */
|
|
398
437
|
hardcoded_apy: number | null;
|
|
399
438
|
}
|
|
400
439
|
export interface ITokenizedVaultStrategist {
|
|
401
440
|
strategist_name: string;
|
|
402
441
|
strategist_logo: string;
|
|
442
|
+
/** URL of the strategist's website, or null if not provided. */
|
|
403
443
|
website_url: string | null;
|
|
404
444
|
id: string;
|
|
405
445
|
}
|
|
@@ -534,6 +574,7 @@ export interface ITokenizedVault {
|
|
|
534
574
|
stellar_vault_metadata?: IStellarVaultMetadata | null;
|
|
535
575
|
lagDuration: number;
|
|
536
576
|
historical_apy: Record<number, number> | null;
|
|
577
|
+
/** @deprecated Use getVaultHistoricalTimeseries instead */
|
|
537
578
|
historical_snapshots?: IHIstoricalSnapshot[];
|
|
538
579
|
max_drawdown: number | null;
|
|
539
580
|
daily_pnl_per_share: Record<string, number>;
|
|
@@ -552,8 +593,12 @@ export interface ITokenizedVault {
|
|
|
552
593
|
}>;
|
|
553
594
|
};
|
|
554
595
|
show_cap_filled: boolean | null;
|
|
596
|
+
/** Controls APY display behaviour in the UI; null when the server has not set an override. */
|
|
555
597
|
apy_override: IApyOverride | null;
|
|
556
598
|
}
|
|
599
|
+
/**
|
|
600
|
+
* @deprecated
|
|
601
|
+
*/
|
|
557
602
|
export interface IWSVaultHistoricalApy {
|
|
558
603
|
data: {
|
|
559
604
|
labels: string[];
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@augustdigital/sdk",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.5.0",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
|
+
"types": "lib/sdk.d.ts",
|
|
5
6
|
"keywords": [
|
|
6
7
|
"augustdigital",
|
|
7
8
|
"sdk",
|
|
@@ -59,11 +60,11 @@
|
|
|
59
60
|
}
|
|
60
61
|
},
|
|
61
62
|
"scripts": {
|
|
62
|
-
"build": "tsc",
|
|
63
|
+
"build": "tsc && node ../../scripts/run-api-extractor.mjs --only sdk",
|
|
63
64
|
"test": "pnpm build && cross-env node dist/test",
|
|
64
|
-
"test:jest": "jest",
|
|
65
|
-
"test:jest:watch": "jest --watch",
|
|
66
|
-
"test:jest:coverage": "jest --coverage",
|
|
65
|
+
"test:jest": "jest --config jest.config.unit.js",
|
|
66
|
+
"test:jest:watch": "jest --config jest.config.unit.js --watch",
|
|
67
|
+
"test:jest:coverage": "jest --config jest.config.unit.js --coverage",
|
|
67
68
|
"test:forknet": "node tests/forknet/run.mjs",
|
|
68
69
|
"clean": "rm -rf ./lib",
|
|
69
70
|
"format": "biome check --write .",
|