@sodax/sdk 2.0.0-rc.12 → 2.0.0-rc.13
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/dist/index.cjs +961 -22
- package/dist/index.d.cts +479 -4
- package/dist/index.d.ts +479 -4
- package/dist/index.mjs +950 -24
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IConfigApi, ApiConfig, SodaxLogger, Result, SubmitSwapTxRequest, SubmitSwapTxResponse, GetSubmitSwapTxStatusParams, SubmitSwapTxStatusResponse, Address, GetAllConfigApiResponse, GetChainsApiResponse, GetSwapTokensApiResponse, SpokeChainKey, GetSwapTokensByChainIdApiResponse, GetMoneyMarketTokensApiResponse, GetMoneyMarketReserveAssetsApiResponse, GetMoneyMarketTokensByChainIdApiResponse, GetRelayChainIdMapApiResponse, GetSpokeChainConfigApiResponse, SodaxConfig, DeepPartial, XToken, OriginalAssetAddress, IntentRelayChainId, HubChainKey, HubConfig, PoolKey, SpokeChainConfig, RelayConfig, SolverConfig, SwapsConfig, BridgeConfig, MoneyMarketConfig, DexConfig, GetSpokeChainConfigType, EvmContractCall, Hex, IEvmWalletProvider, EvmRawTransactionReceipt, PartnerFee, QuoteType, EvmChainKey, WalletProviderSlot, TxReturnType, ChainType, GetChainType, SolanaRawTransactionReceipt, StellarSorobanTransactionReceipt, IconTransactionResult, SuiRawTransactionReceipt, InjectiveRawTransactionReceipt, NearRawTransactionReceipt, StacksRawTransactionReceipt, BitcoinRawTransactionReceipt, GetAddressType, HubAddress, GetTokenAddressType, EvmSpokeOnlyChainKey, StellarChainKey, SonicChainKey, AssetInfo, TokenInfo, VaultReserves, StacksChainKey, FeeEstimateTransaction, StacksTransactionParams, HttpUrl, RadfiConfig, IBitcoinWalletProvider, RadfiDepositTxResponse, BtcAddressType, BitcoinChainKey, NearChainKey, FillData, NearRawTransaction, INearWalletProvider, SuiPaginatedCoins, SuiChainKey, SuiExecutionResult, SuiGasEstimate, IStellarWalletProvider, StellarGasEstimate, SolanaChainKey, SolanaGasEstimate, SolanaBase58PublicKey, SolanaRawTransactionInstruction, SolanaSerializedTransaction, SolanaRpcResponseAndContext, SolanaTokenAmount, IconChainKey, IconGasEstimate, InjectiveChainKey, InjectiveGasEstimate, JsonObject, InjectiveRawTransaction, IInjectiveWalletProvider, InjectiveExecuteResponse, GetEstimateGasReturnType, IconAddress, IWalletProvider, EvmSpokeChainConfig, PartnerFeeAmount, PartnerFeePercentage, GetWalletProviderType, SodaxLoggerOption, SpokeExecActionParams, FeeAmount, Hash as Hash$1, SolverIntentQuoteRequest, SolverIntentQuoteResponse, SolverErrorResponse, SolverIntentStatusRequest, SolverIntentStatusResponse, SolverExecutionRequest, SolverExecutionResponse, IconEoaAddress, IcxTokenType, IconContractAddress, BridgeLimit, UserUnstakeInfo, ConcentratedLiquidityConfig, SodaxOptions } from '@sodax/types';
|
|
1
|
+
import { IConfigApi, ApiConfig, SodaxLogger, Result, SubmitSwapTxRequest, SubmitSwapTxResponse, GetSubmitSwapTxStatusParams, SubmitSwapTxStatusResponse, Address, GetAllConfigApiResponse, GetChainsApiResponse, GetSwapTokensApiResponse, SpokeChainKey, GetSwapTokensByChainIdApiResponse, GetMoneyMarketTokensApiResponse, GetMoneyMarketReserveAssetsApiResponse, GetMoneyMarketTokensByChainIdApiResponse, GetRelayChainIdMapApiResponse, GetSpokeChainConfigApiResponse, SodaxConfig, DeepPartial, XToken, OriginalAssetAddress, IntentRelayChainId, HubChainKey, HubConfig, PoolKey, SpokeChainConfig, RelayConfig, SolverConfig, SwapsConfig, BridgeConfig, MoneyMarketConfig, DexConfig, GetSpokeChainConfigType, EvmContractCall, Hex, IEvmWalletProvider, EvmRawTransactionReceipt, PartnerFee, QuoteType, EvmChainKey, WalletProviderSlot, TxReturnType, ChainType, GetChainType, SolanaRawTransactionReceipt, StellarSorobanTransactionReceipt, IconTransactionResult, SuiRawTransactionReceipt, InjectiveRawTransactionReceipt, NearRawTransactionReceipt, StacksRawTransactionReceipt, BitcoinRawTransactionReceipt, GetAddressType, HubAddress, GetTokenAddressType, EvmSpokeOnlyChainKey, StellarChainKey, SonicChainKey, AssetInfo, TokenInfo, VaultReserves, StacksChainKey, FeeEstimateTransaction, StacksTransactionParams, HttpUrl, RadfiConfig, IBitcoinWalletProvider, RadfiDepositTxResponse, BtcAddressType, BitcoinChainKey, NearChainKey, FillData, NearRawTransaction, INearWalletProvider, SuiPaginatedCoins, SuiChainKey, SuiExecutionResult, SuiGasEstimate, IStellarWalletProvider, StellarGasEstimate, SolanaChainKey, SolanaGasEstimate, SolanaBase58PublicKey, SolanaRawTransactionInstruction, SolanaSerializedTransaction, SolanaRpcResponseAndContext, SolanaTokenAmount, IconChainKey, IconGasEstimate, InjectiveChainKey, InjectiveGasEstimate, JsonObject, InjectiveRawTransaction, IInjectiveWalletProvider, InjectiveExecuteResponse, GetEstimateGasReturnType, IconAddress, IWalletProvider, EvmSpokeChainConfig, PartnerFeeAmount, PartnerFeePercentage, GetWalletProviderType, SodaxLoggerOption, SpokeExecActionParams, FeeAmount, Hash as Hash$1, SolverIntentQuoteRequest, SolverIntentQuoteResponse, SolverErrorResponse, SolverIntentStatusRequest, SolverIntentStatusResponse, SolverExecutionRequest, SolverExecutionResponse, IconEoaAddress, IcxTokenType, IconContractAddress, BridgeLimit, UserUnstakeInfo, ConcentratedLiquidityConfig, LeverageYieldVault, SodaxOptions } from '@sodax/types';
|
|
2
2
|
export * from '@sodax/types';
|
|
3
3
|
import * as viem from 'viem';
|
|
4
4
|
import { Hex as Hex$1, Chain, Address as Address$1, PublicClient, HttpTransport, Hash, GetLogsReturnType } from 'viem';
|
|
@@ -62,7 +62,7 @@ type SodaxErrorCode = 'VALIDATION_FAILED' | 'INTENT_CREATION_FAILED' | 'EXECUTIO
|
|
|
62
62
|
* The producing feature of a SodaxError. Required at construction so consumers /
|
|
63
63
|
* loggers always have a feature tag.
|
|
64
64
|
*/
|
|
65
|
-
type SodaxFeature = 'swap' | 'moneyMarket' | 'bridge' | 'staking' | 'migration' | 'dex' | 'partner' | 'recovery';
|
|
65
|
+
type SodaxFeature = 'swap' | 'moneyMarket' | 'bridge' | 'staking' | 'migration' | 'dex' | 'partner' | 'recovery' | 'leverageYield';
|
|
66
66
|
/**
|
|
67
67
|
* Orchestration phase tag attached via `context.phase`. Canonical superset across all
|
|
68
68
|
* features — all features draw from this list rather than minting their own.
|
|
@@ -133,7 +133,7 @@ declare const LOOKUP_CODES: ReadonlySet<LookupErrorCode>;
|
|
|
133
133
|
/** Runtime list of all valid error codes — useful for membership checks and exhaustive switches. */
|
|
134
134
|
declare const SODAX_ERROR_CODES: readonly ["VALIDATION_FAILED", "INTENT_CREATION_FAILED", "EXECUTION_FAILED", "TX_VERIFICATION_FAILED", "TX_SUBMIT_FAILED", "RELAY_TIMEOUT", "RELAY_FAILED", "APPROVE_FAILED", "ALLOWANCE_CHECK_FAILED", "GAS_ESTIMATION_FAILED", "LOOKUP_FAILED", "EXTERNAL_API_ERROR", "UNKNOWN"];
|
|
135
135
|
/** Runtime list of all valid feature tags. */
|
|
136
|
-
declare const SODAX_FEATURES: readonly ["swap", "moneyMarket", "bridge", "staking", "migration", "dex", "partner", "recovery"];
|
|
136
|
+
declare const SODAX_FEATURES: readonly ["swap", "moneyMarket", "bridge", "staking", "migration", "dex", "partner", "recovery", "leverageYield"];
|
|
137
137
|
|
|
138
138
|
/**
|
|
139
139
|
* Canonical error type for the SODAX SDK.
|
|
@@ -16011,6 +16011,480 @@ declare class RecoveryService {
|
|
|
16011
16011
|
withdrawHubAsset<K extends SpokeChainKey, Raw extends boolean>(_params: WithdrawHubAssetAction<K, Raw>): Promise<Result<TxReturnType<K, Raw>>>;
|
|
16012
16012
|
}
|
|
16013
16013
|
|
|
16014
|
+
/**
|
|
16015
|
+
* leverageYield module narrow error types.
|
|
16016
|
+
*
|
|
16017
|
+
* The service owns the full vault-swap lifecycle: `deposit` / `withdraw` build
|
|
16018
|
+
* `CreateIntentParams`, `createVaultIntent` submits the intent on the source spoke chain,
|
|
16019
|
+
* and `vaultSwap` orchestrates the end-to-end flow (create → verify → relay → notify
|
|
16020
|
+
* solver). `approve` / `isAllowanceValid` manage the underlying-asset allowance on Sonic,
|
|
16021
|
+
* and the read methods query on-chain state.
|
|
16022
|
+
*
|
|
16023
|
+
* User-facing actions discriminated by `context.action`: `'deposit' | 'withdraw' |
|
|
16024
|
+
* 'approve' | 'vaultSwap'`. Read-only methods emit `LOOKUP_FAILED` partitioned by
|
|
16025
|
+
* `context.method`. Relay/verify codes appear only on `vaultSwap` — `createVaultIntent`
|
|
16026
|
+
* alone emits the create-intent subset.
|
|
16027
|
+
*/
|
|
16028
|
+
|
|
16029
|
+
declare const leverageYieldInvariant: FeatureInvariant;
|
|
16030
|
+
type LeverageYieldAction = 'deposit' | 'withdraw' | 'approve' | 'allowanceCheck' | 'vaultSwap';
|
|
16031
|
+
type LeverageYieldCreateIntentErrorCode = CreateIntentErrorCode;
|
|
16032
|
+
type LeverageYieldApproveErrorCode = ApproveErrorCode;
|
|
16033
|
+
type LeverageYieldAllowanceCheckErrorCode = AllowanceCheckErrorCode;
|
|
16034
|
+
type LeverageYieldLookupErrorCode = LookupErrorCode;
|
|
16035
|
+
/**
|
|
16036
|
+
* Codes returnable by the solver-notify step inside `vaultSwap`. Mirrors the swap
|
|
16037
|
+
* domain's `PostExecutionErrorCode` — duplicated deliberately so the leverage-yield
|
|
16038
|
+
* error surface stands alone (see `vaultSwap`).
|
|
16039
|
+
*/
|
|
16040
|
+
type LeverageYieldPostExecutionErrorCode = Extract<SodaxErrorCode, 'EXECUTION_FAILED' | 'EXTERNAL_API_ERROR' | 'UNKNOWN'>;
|
|
16041
|
+
/**
|
|
16042
|
+
* Codes returnable by the end-to-end `vaultSwap` orchestrator: the create-intent subset
|
|
16043
|
+
* plus verify, relay and solver-notify codes. Mirrors the swap domain's `SwapErrorCode`.
|
|
16044
|
+
*/
|
|
16045
|
+
type LeverageYieldSwapErrorCode = Extract<SodaxErrorCode, 'VALIDATION_FAILED' | 'INTENT_CREATION_FAILED' | 'TX_VERIFICATION_FAILED' | 'TX_SUBMIT_FAILED' | 'RELAY_TIMEOUT' | 'RELAY_FAILED' | 'EXECUTION_FAILED' | 'EXTERNAL_API_ERROR' | 'UNKNOWN'>;
|
|
16046
|
+
type LeverageYieldErrorCode = Extract<SodaxErrorCode, 'VALIDATION_FAILED' | 'INTENT_CREATION_FAILED' | 'APPROVE_FAILED' | 'ALLOWANCE_CHECK_FAILED' | 'LOOKUP_FAILED' | 'TX_VERIFICATION_FAILED' | 'TX_SUBMIT_FAILED' | 'RELAY_TIMEOUT' | 'RELAY_FAILED' | 'EXECUTION_FAILED' | 'EXTERNAL_API_ERROR' | 'UNKNOWN'>;
|
|
16047
|
+
type LeverageYieldCreateIntentError = SodaxError<LeverageYieldCreateIntentErrorCode>;
|
|
16048
|
+
type LeverageYieldApproveError = SodaxError<LeverageYieldApproveErrorCode>;
|
|
16049
|
+
type LeverageYieldAllowanceCheckError = SodaxError<LeverageYieldAllowanceCheckErrorCode>;
|
|
16050
|
+
type LeverageYieldLookupError = SodaxError<LeverageYieldLookupErrorCode>;
|
|
16051
|
+
type LeverageYieldPostExecutionError = SodaxError<LeverageYieldPostExecutionErrorCode>;
|
|
16052
|
+
type LeverageYieldSwapError = SodaxError<LeverageYieldSwapErrorCode>;
|
|
16053
|
+
type LeverageYieldError = SodaxError<LeverageYieldErrorCode>;
|
|
16054
|
+
declare const isLeverageYieldCreateIntentError: (e: unknown) => e is SodaxError<CreateIntentErrorCode>;
|
|
16055
|
+
declare const isLeverageYieldApproveError: (e: unknown) => e is SodaxError<ApproveErrorCode>;
|
|
16056
|
+
declare const isLeverageYieldAllowanceCheckError: (e: unknown) => e is SodaxError<AllowanceCheckErrorCode>;
|
|
16057
|
+
declare const isLeverageYieldLookupError: (e: unknown) => e is SodaxError<LookupErrorCode>;
|
|
16058
|
+
declare const isLeverageYieldPostExecutionError: (e: unknown) => e is SodaxError<LeverageYieldPostExecutionErrorCode>;
|
|
16059
|
+
declare const isLeverageYieldSwapError: (e: unknown) => e is SodaxError<LeverageYieldSwapErrorCode>;
|
|
16060
|
+
declare const isLeverageYieldError: (e: unknown) => e is SodaxError<LeverageYieldErrorCode>;
|
|
16061
|
+
|
|
16062
|
+
/**
|
|
16063
|
+
* Leveraged-position snapshot from the vault's non-standard `getPositionDetails()`.
|
|
16064
|
+
* Field scales (mirroring the AAVE conventions the vault inherits):
|
|
16065
|
+
*/
|
|
16066
|
+
type LeverageYieldPosition = {
|
|
16067
|
+
/** Collateral supplied to the AAVE pool, in vault-asset units (18 decimals). */
|
|
16068
|
+
collateral: bigint;
|
|
16069
|
+
/** Variable debt borrowed against the collateral, in vault-asset units (18 decimals). */
|
|
16070
|
+
debt: bigint;
|
|
16071
|
+
/** Current loan-to-value in basis points (out of `10_000`; e.g. `8_500` = 85%). */
|
|
16072
|
+
ltv: bigint;
|
|
16073
|
+
/** AAVE health factor in WAD (1e18); below `1e18` implies liquidation risk, `type(uint256).max` = no debt. */
|
|
16074
|
+
healthFactor: bigint;
|
|
16075
|
+
/** Asset held by the vault but not yet supplied to the pool, in vault-asset units (18 decimals). */
|
|
16076
|
+
idleAsset: bigint;
|
|
16077
|
+
};
|
|
16078
|
+
/**
|
|
16079
|
+
* Output of {@link LeverageYieldService.getApr}. All rate fields are in RAY (1e27 = 100%)
|
|
16080
|
+
* matching the AAVE convention — divide by `RAY = 10n ** 27n` for the decimal form.
|
|
16081
|
+
*
|
|
16082
|
+
* `netAprRay` is the headline number a UI shows: net APR earned by a depositor at the
|
|
16083
|
+
* vault's `targetLTV`. It's a STEADY-STATE APR, not realised APY — assumes the AAVE rates
|
|
16084
|
+
* stay constant and the vault holds at `targetLTV` continuously. Realised APY in practice
|
|
16085
|
+
* depends on tick cadence, rate volatility, and the spread between supplyApr and borrowApr.
|
|
16086
|
+
*
|
|
16087
|
+
* The math:
|
|
16088
|
+
* ```
|
|
16089
|
+
* leverageMultiplier = targetLTV / (1 - targetLTV) // e.g. 0.85 / 0.15 = 5.667x
|
|
16090
|
+
* netAprRay = supplyAprRay + leverageMultiplier × (supplyAprRay - borrowAprRay)
|
|
16091
|
+
* ```
|
|
16092
|
+
* Equivalent to the geometric-series limit of recursive borrow → swap → supply at the
|
|
16093
|
+
* vault's target LTV. When `supplyApr > borrowApr` the leverage adds yield; when the
|
|
16094
|
+
* spread inverts the loop is a net cost and `netAprRay` goes negative.
|
|
16095
|
+
*/
|
|
16096
|
+
type LeverageYieldApr = {
|
|
16097
|
+
/** AAVE supply rate of the vault's `asset` (sodaWEETH-style), in RAY. */
|
|
16098
|
+
supplyAprRay: bigint;
|
|
16099
|
+
/** AAVE variable borrow rate of the vault's `borrowToken` (sodaETH-style), in RAY. */
|
|
16100
|
+
borrowAprRay: bigint;
|
|
16101
|
+
/** Target LTV in basis points, as read from `vault.targetLTV()`. */
|
|
16102
|
+
targetLtvBps: bigint;
|
|
16103
|
+
/**
|
|
16104
|
+
* Leverage multiplier ×1e18 (e.g. 5.667x is `5_666_666_666_666_666_667n`). Caller can
|
|
16105
|
+
* divide by `10n ** 18n` for the decimal form.
|
|
16106
|
+
*/
|
|
16107
|
+
leverageMultiplierWad: bigint;
|
|
16108
|
+
/** Net APR earned by a depositor at `targetLtvBps`, in RAY. Can be negative. */
|
|
16109
|
+
netAprRay: bigint;
|
|
16110
|
+
};
|
|
16111
|
+
/**
|
|
16112
|
+
* Off-chain LSD staking-APR snapshot for a leverage-yield vault's underlying asset.
|
|
16113
|
+
* Returned by {@link LeverageYieldService.getLsdApr} and embedded in
|
|
16114
|
+
* {@link LeverageYieldEffectiveApr}.
|
|
16115
|
+
*/
|
|
16116
|
+
type LeverageYieldLsdApr = {
|
|
16117
|
+
/** LSD staking APR in RAY (1e27 = 100%). Zero when the vault has no configured LSD source. */
|
|
16118
|
+
aprRay: bigint;
|
|
16119
|
+
/** Human-readable provider label, e.g. `'Lido (stETH)'` (suffixed with `(fallback)` on error). */
|
|
16120
|
+
label: string;
|
|
16121
|
+
/**
|
|
16122
|
+
* `true` when this value came from the hardcoded `fallbackAprPct` rather than a live
|
|
16123
|
+
* fetch — either because the provider has no live endpoint (`manual`), the network
|
|
16124
|
+
* call failed, or the vault has no LSD source configured. UIs should label the value
|
|
16125
|
+
* as an estimate in this state.
|
|
16126
|
+
*/
|
|
16127
|
+
stale: boolean;
|
|
16128
|
+
};
|
|
16129
|
+
/**
|
|
16130
|
+
* Combined AAVE + LSD APR view — extends {@link LeverageYieldApr} with the LSD staking
|
|
16131
|
+
* yield folded into the supply side. Returned by {@link LeverageYieldService.getEffectiveApr}.
|
|
16132
|
+
*
|
|
16133
|
+
* The `netAprRay` inherited from {@link LeverageYieldApr} is the **AAVE-only** number —
|
|
16134
|
+
* the negative-spread case the SDK historically reported. `effectiveNetAprRay` is the
|
|
16135
|
+
* honest one for LSD-backed strategies because it includes the LSD's native staking yield,
|
|
16136
|
+
* which is the dominant component for these vaults.
|
|
16137
|
+
*/
|
|
16138
|
+
type LeverageYieldEffectiveApr = LeverageYieldApr & {
|
|
16139
|
+
/** LSD staking APR snapshot used to compute the effective rates. */
|
|
16140
|
+
lsdApr: LeverageYieldLsdApr;
|
|
16141
|
+
/** `supplyAprRay + lsdApr.aprRay`, in RAY — the yield the supply side actually earns. */
|
|
16142
|
+
effectiveSupplyAprRay: bigint;
|
|
16143
|
+
/**
|
|
16144
|
+
* `effectiveSupplyAprRay + leverage × (effectiveSupplyAprRay − borrowAprRay)`, in RAY.
|
|
16145
|
+
* The headline number a UI should display.
|
|
16146
|
+
*/
|
|
16147
|
+
effectiveNetAprRay: bigint;
|
|
16148
|
+
};
|
|
16149
|
+
/**
|
|
16150
|
+
* Builds the swap payload for a swap-style leverage-yield deposit — swapping any
|
|
16151
|
+
* solver-supported `inputToken` on `srcChainKey` into the vault's lsoda* share token,
|
|
16152
|
+
* delivered to the user's hub wallet on Sonic. Spread the result into `swaps.swap()`.
|
|
16153
|
+
*/
|
|
16154
|
+
type LeverageYieldSwapDepositParams = {
|
|
16155
|
+
/** Hub-side LeverageYieldVault proxy address — its address doubles as the lsoda* token. */
|
|
16156
|
+
vault: Address;
|
|
16157
|
+
/** Spoke chain the user holds `inputToken` on and signs from. */
|
|
16158
|
+
srcChainKey: SpokeChainKey;
|
|
16159
|
+
/** User's EOA on `srcChainKey`. */
|
|
16160
|
+
srcAddress: string;
|
|
16161
|
+
/** Spoke-side token the user pays in. */
|
|
16162
|
+
inputToken: string;
|
|
16163
|
+
/** Amount of `inputToken` to swap (input-token decimals). */
|
|
16164
|
+
inputAmount: bigint;
|
|
16165
|
+
/** Minimum acceptable lsoda* output (18 decimals). Slippage already applied. */
|
|
16166
|
+
minOutputAmount: bigint;
|
|
16167
|
+
/** Deadline (unix seconds). Defaults to the hub block timestamp + 5 min. */
|
|
16168
|
+
deadline?: bigint;
|
|
16169
|
+
/** Optional specific solver. `0x0` = any solver. */
|
|
16170
|
+
solver?: Address;
|
|
16171
|
+
/**
|
|
16172
|
+
* Partner fee for this deposit, carried on the payload as the swap layer's per-intent
|
|
16173
|
+
* fee override. Defaults to the globally configured `config.swaps.partnerFee`.
|
|
16174
|
+
*/
|
|
16175
|
+
partnerFee?: PartnerFee;
|
|
16176
|
+
};
|
|
16177
|
+
/**
|
|
16178
|
+
* Builds the swap payload for a swap-style leverage-yield withdraw — swapping the vault's
|
|
16179
|
+
* lsoda* shares (held in the user's hub wallet) back into any solver-supported token on
|
|
16180
|
+
* any chain. The payload carries `hubWalletSwap: true`; spread it into `swaps.swap()`,
|
|
16181
|
+
* which authorises the hub wallet via `Connection.sendMessage`.
|
|
16182
|
+
*/
|
|
16183
|
+
type LeverageYieldSwapWithdrawParams = {
|
|
16184
|
+
/** Hub-side LeverageYieldVault proxy address — its address doubles as the lsoda* token. */
|
|
16185
|
+
vault: Address;
|
|
16186
|
+
/** Spoke chain the user signs the `sendMessage` from (drives hub-wallet derivation). */
|
|
16187
|
+
srcChainKey: SpokeChainKey;
|
|
16188
|
+
/** User's EOA on `srcChainKey`. */
|
|
16189
|
+
srcAddress: string;
|
|
16190
|
+
/** Output chain — where the solver delivers the swapped-back token. */
|
|
16191
|
+
dstChainKey: SpokeChainKey;
|
|
16192
|
+
/** Output spoke-side token address. */
|
|
16193
|
+
outputToken: string;
|
|
16194
|
+
/** Amount of lsoda* shares to swap (18 decimals). */
|
|
16195
|
+
inputAmount: bigint;
|
|
16196
|
+
/** Minimum acceptable output (output-token decimals). Slippage already applied. */
|
|
16197
|
+
minOutputAmount: bigint;
|
|
16198
|
+
/** Recipient on `dstChainKey`. Defaults to `srcAddress`. */
|
|
16199
|
+
recipient?: string;
|
|
16200
|
+
/** Deadline (unix seconds). Defaults to the hub block timestamp + 5 min. */
|
|
16201
|
+
deadline?: bigint;
|
|
16202
|
+
/** Optional specific solver. `0x0` = any solver. */
|
|
16203
|
+
solver?: Address;
|
|
16204
|
+
};
|
|
16205
|
+
/**
|
|
16206
|
+
* Action-shaped swap payload built by {@link LeverageYieldService.deposit} /
|
|
16207
|
+
* {@link LeverageYieldService.withdraw}. Spread it into
|
|
16208
|
+
* {@link LeverageYieldService.vaultSwap} (or {@link LeverageYieldService.createVaultIntent})
|
|
16209
|
+
* alongside the wallet provider: `vaultSwap({ ...payload, walletProvider })`.
|
|
16210
|
+
* `withdraw` sets `hubWalletSwap: true` so the swap spends the lsoda* held in the
|
|
16211
|
+
* user's hub wallet.
|
|
16212
|
+
*/
|
|
16213
|
+
type LeverageYieldSwapPayload = {
|
|
16214
|
+
params: CreateIntentParams;
|
|
16215
|
+
hubWalletSwap?: true;
|
|
16216
|
+
/** Per-intent partner-fee override (deposit only). */
|
|
16217
|
+
partnerFee?: PartnerFee;
|
|
16218
|
+
};
|
|
16219
|
+
/**
|
|
16220
|
+
* Exec-mode params for {@link LeverageYieldService.createVaultIntent} /
|
|
16221
|
+
* {@link LeverageYieldService.vaultSwap}: `walletProvider` is required and K-narrowed
|
|
16222
|
+
* (`raw: true` returns unsigned tx data instead). The two vault-specific execution
|
|
16223
|
+
* modifiers live HERE — on the leverage-yield action wrapper, never on the generic swap
|
|
16224
|
+
* surface:
|
|
16225
|
+
* - `hubWalletSwap` marks `params.inputToken` as a hub-chain token already sitting in the
|
|
16226
|
+
* user's hub wallet — `srcChainKey` is then the chain the user *signs* on, and the
|
|
16227
|
+
* intent is created by authorising the hub wallet via a `Connection.sendMessage`
|
|
16228
|
+
* instead of a spoke-side AssetManager deposit.
|
|
16229
|
+
* - `partnerFee` overrides the globally configured `config.swaps.partnerFee` for this
|
|
16230
|
+
* intent only.
|
|
16231
|
+
*/
|
|
16232
|
+
type VaultSwapActionParams<K extends SpokeChainKey, Raw extends boolean = false> = SpokeExecActionParams<K, Raw, CreateIntentParams<K>> & {
|
|
16233
|
+
hubWalletSwap?: boolean;
|
|
16234
|
+
partnerFee?: PartnerFee;
|
|
16235
|
+
};
|
|
16236
|
+
/**
|
|
16237
|
+
* Success value of {@link LeverageYieldService.createVaultIntent}. Mirrors the swap
|
|
16238
|
+
* domain's `CreateIntentResult` — duplicated deliberately so the leverage-yield surface
|
|
16239
|
+
* stands alone.
|
|
16240
|
+
*/
|
|
16241
|
+
type CreateVaultIntentResult<K extends SpokeChainKey, Raw extends boolean> = {
|
|
16242
|
+
tx: TxReturnType<K, Raw>;
|
|
16243
|
+
intent: Intent & FeeAmount;
|
|
16244
|
+
relayData: RelayExtraData;
|
|
16245
|
+
};
|
|
16246
|
+
/**
|
|
16247
|
+
* Success value of {@link LeverageYieldService.vaultSwap}. Mirrors the swap domain's
|
|
16248
|
+
* `SwapResponse` — duplicated deliberately so the leverage-yield surface stands alone.
|
|
16249
|
+
*/
|
|
16250
|
+
type VaultSwapResponse = {
|
|
16251
|
+
solverExecutionResponse: SolverExecutionResponse;
|
|
16252
|
+
intent: Intent;
|
|
16253
|
+
intentDeliveryInfo: IntentDeliveryInfo;
|
|
16254
|
+
};
|
|
16255
|
+
type LeverageYieldApproveParams<R extends boolean> = {
|
|
16256
|
+
vault: Address;
|
|
16257
|
+
/** Amount of the vault's underlying asset to approve. */
|
|
16258
|
+
amount: bigint;
|
|
16259
|
+
walletProvider: IEvmWalletProvider;
|
|
16260
|
+
raw?: R;
|
|
16261
|
+
};
|
|
16262
|
+
type LeverageYieldAllowanceParams = {
|
|
16263
|
+
vault: Address;
|
|
16264
|
+
amount: bigint;
|
|
16265
|
+
owner: Address;
|
|
16266
|
+
};
|
|
16267
|
+
type LeverageYieldServiceConstructorParams = {
|
|
16268
|
+
hubProvider: HubProvider;
|
|
16269
|
+
config: ConfigService;
|
|
16270
|
+
spoke: SpokeService;
|
|
16271
|
+
};
|
|
16272
|
+
/**
|
|
16273
|
+
* Treats leverage-yield ERC-4626 vault shares (lsoda* tokens) as solver-tradeable tokens:
|
|
16274
|
+
* deposits and withdrawals are intent-based swaps the service executes itself via
|
|
16275
|
+
* `vaultSwap()` — the generic swap surface stays untouched by vault concerns.
|
|
16276
|
+
*
|
|
16277
|
+
* Methods:
|
|
16278
|
+
* - `deposit` / `withdraw` — build a {@link LeverageYieldSwapPayload} for a swap-style deposit
|
|
16279
|
+
* (any token → lsoda*) and withdraw (lsoda* → any token); spread the result into
|
|
16280
|
+
* `vaultSwap()`. `withdraw` sets `hubWalletSwap: true` so the vault swap spends the lsoda*
|
|
16281
|
+
* held in the user's hub wallet via a `Connection.sendMessage`.
|
|
16282
|
+
* - `createVaultIntent` / `vaultSwap` / `notifySolver` — leverage-yield copies of the swap
|
|
16283
|
+
* domain's `createIntent` / `swap()` / `postExecution` (duplicated deliberately — the vault
|
|
16284
|
+
* execution modifiers `hubWalletSwap` and per-intent `partnerFee` live here, not on the swap
|
|
16285
|
+
* domain). `createVaultIntent` submits the intent tx on the source spoke chain; `vaultSwap`
|
|
16286
|
+
* orchestrates the full create → verify → relay → notify-solver lifecycle; `notifySolver` is
|
|
16287
|
+
* the standalone notify step, public so callers driving the relay themselves (after a
|
|
16288
|
+
* `createVaultIntent`) can complete the flow.
|
|
16289
|
+
* - `approve` / `isAllowanceValid` — Sonic-direct allowance management for the vault's
|
|
16290
|
+
* underlying asset (sodaWEETH-style).
|
|
16291
|
+
* - `getPosition` / `getApr` / `getEffectiveApr` / `getLsdApr` / `getMaxWithdraw` /
|
|
16292
|
+
* `getMaxWithdrawForUser` / `getShareBalance` / `getShareBalanceForUser` /
|
|
16293
|
+
* `getTotalAssets` / `previewDeposit` / `previewWithdraw` / `previewRedeem` — reads.
|
|
16294
|
+
* Use `getEffectiveApr` for the honest LSD-aware APR; `getApr` reports the AAVE-only
|
|
16295
|
+
* spread and goes negative when the LSD's native staking yield is the alpha source.
|
|
16296
|
+
* - `listVaults` / `getVault` / `getVaultByAddress` — registry lookups.
|
|
16297
|
+
*/
|
|
16298
|
+
declare class LeverageYieldService {
|
|
16299
|
+
private readonly hubProvider;
|
|
16300
|
+
private readonly config;
|
|
16301
|
+
private readonly spoke;
|
|
16302
|
+
constructor({ hubProvider, config, spoke }: LeverageYieldServiceConstructorParams);
|
|
16303
|
+
/** Returns the static registry of known leverage-yield vaults. */
|
|
16304
|
+
listVaults(): readonly LeverageYieldVault[];
|
|
16305
|
+
/** Looks up a vault by its `name` field. Returns `undefined` when not registered. */
|
|
16306
|
+
getVault(name: string): LeverageYieldVault | undefined;
|
|
16307
|
+
/**
|
|
16308
|
+
* Looks up a registered vault by its on-chain proxy address (case-insensitive).
|
|
16309
|
+
* Returns `undefined` when the address isn't in the registry.
|
|
16310
|
+
*/
|
|
16311
|
+
getVaultByAddress(address: Address): LeverageYieldVault | undefined;
|
|
16312
|
+
/**
|
|
16313
|
+
* Resolves the intent `deadline`: returns the caller-supplied value verbatim, otherwise
|
|
16314
|
+
* derives a default from the hub-chain (Sonic) block timestamp plus
|
|
16315
|
+
* {@link INTENT_DEADLINE_BUFFER_SECONDS}. The deadline is enforced on-chain against the hub
|
|
16316
|
+
* block time, so the default is anchored to that block — never the client clock, which can
|
|
16317
|
+
* drift and produce an already-expired or over-extended deadline.
|
|
16318
|
+
*
|
|
16319
|
+
* Returns a {@link Result}: a `getBlock` RPC outage is a read failure, surfaced as
|
|
16320
|
+
* `LOOKUP_FAILED` (`method: 'resolveDeadline'`) rather than masquerading as an intent-build
|
|
16321
|
+
* failure. The `deposit` / `withdraw` callers forward it verbatim.
|
|
16322
|
+
*/
|
|
16323
|
+
private resolveDeadline;
|
|
16324
|
+
/**
|
|
16325
|
+
* Builds the {@link LeverageYieldSwapPayload} for a leverage-yield deposit (any token → lsoda*).
|
|
16326
|
+
* The lsoda* output is delivered to the user's hub wallet on Sonic so a later
|
|
16327
|
+
* {@link LeverageYieldService.withdraw} can swap it back. Spread the result into
|
|
16328
|
+
* {@link LeverageYieldService.vaultSwap}: `vaultSwap({ ...payload, walletProvider })`.
|
|
16329
|
+
* An optional `partnerFee` is forwarded on the payload as the per-intent fee override.
|
|
16330
|
+
*
|
|
16331
|
+
* For `minOutputAmount`, quote via `sodax.swaps.getQuote` with the vault address as the
|
|
16332
|
+
* destination token (`token_dst`) — vault shares are solver-tradeable, so the generic swap
|
|
16333
|
+
* quote applies; then subtract your slippage tolerance.
|
|
16334
|
+
*/
|
|
16335
|
+
deposit(params: LeverageYieldSwapDepositParams): Promise<Result<LeverageYieldSwapPayload, LeverageYieldCreateIntentError | LeverageYieldLookupError>>;
|
|
16336
|
+
/**
|
|
16337
|
+
* Builds the {@link LeverageYieldSwapPayload} for a leverage-yield withdraw (lsoda* → any
|
|
16338
|
+
* token). The payload carries `hubWalletSwap: true` — {@link LeverageYieldService.vaultSwap}
|
|
16339
|
+
* then spends the lsoda* held in the user's hub wallet by authorising it via a
|
|
16340
|
+
* `Connection.sendMessage` the user signs on `srcChainKey`. Wrapped in a {@link Result} for
|
|
16341
|
+
* a call shape uniform with {@link LeverageYieldService.deposit}; async because the default
|
|
16342
|
+
* `deadline` is read from the hub block timestamp.
|
|
16343
|
+
*
|
|
16344
|
+
* For `minOutputAmount`, quote via `sodax.swaps.getQuote` with the vault address as the
|
|
16345
|
+
* source token (`token_src`) — vault shares are solver-tradeable, so the generic swap quote
|
|
16346
|
+
* applies; then subtract your slippage tolerance.
|
|
16347
|
+
*/
|
|
16348
|
+
withdraw(params: LeverageYieldSwapWithdrawParams): Promise<Result<LeverageYieldSwapPayload, LeverageYieldCreateIntentError | LeverageYieldLookupError>>;
|
|
16349
|
+
/**
|
|
16350
|
+
* Creates a vault swap intent on the user's source spoke chain without submitting it to
|
|
16351
|
+
* the solver. Leverage-yield copy of the swap domain's `createIntent`, specialised for
|
|
16352
|
+
* vault flows — duplicated deliberately so the vault-specific execution modifiers
|
|
16353
|
+
* (`hubWalletSwap`, per-intent `partnerFee`) stay off the generic swap surface.
|
|
16354
|
+
*
|
|
16355
|
+
* Use {@link LeverageYieldService.vaultSwap} for the full end-to-end flow
|
|
16356
|
+
* (create → relay → notify solver); use this directly when you need the raw transaction
|
|
16357
|
+
* or drive the relay yourself (e.g. the backend submit-tx path). To complete a manual flow,
|
|
16358
|
+
* relay the returned `relayData` (the shared `relayTxAndWaitPacket` helper) and then call
|
|
16359
|
+
* {@link LeverageYieldService.notifySolver} with the hub-side intent tx hash.
|
|
16360
|
+
*
|
|
16361
|
+
* @param _params - Intent parameters, source chain key, wallet provider (when `raw: false`),
|
|
16362
|
+
* and optional `skipSimulation` / `hubWalletSwap` / `partnerFee`.
|
|
16363
|
+
* @returns A `Result<CreateVaultIntentResult<K, Raw>, LeverageYieldCreateIntentError>`.
|
|
16364
|
+
* On success contains:
|
|
16365
|
+
* - `tx` — chain-specific tx hash (executed) or raw tx data (raw mode).
|
|
16366
|
+
* - `intent` — the fully constructed `Intent` object augmented with `feeAmount`.
|
|
16367
|
+
* - `relayData` — `{ address, payload }` needed to submit the intent to the relayer.
|
|
16368
|
+
*
|
|
16369
|
+
* On failure `result.error` is a SodaxError with `VALIDATION_FAILED` (invariant
|
|
16370
|
+
* precondition), `INTENT_CREATION_FAILED` (spoke-side creation/deposit failed) or
|
|
16371
|
+
* `UNKNOWN` (defensive fallback).
|
|
16372
|
+
*/
|
|
16373
|
+
createVaultIntent<K extends SpokeChainKey, Raw extends boolean>(_params: VaultSwapActionParams<K, Raw>): Promise<Result<CreateVaultIntentResult<K, Raw>, LeverageYieldCreateIntentError>>;
|
|
16374
|
+
/**
|
|
16375
|
+
* Executes a full end-to-end leverage-yield vault swap (deposit or withdraw).
|
|
16376
|
+
* Leverage-yield copy of the swap domain's `swap()` orchestrator:
|
|
16377
|
+
* 1. Calls {@link LeverageYieldService.createVaultIntent} to submit the intent
|
|
16378
|
+
* transaction on the source spoke chain.
|
|
16379
|
+
* 2. Verifies the spoke transaction landed on-chain.
|
|
16380
|
+
* 3. For non-hub source chains: submits the spoke tx to the relayer and waits for the
|
|
16381
|
+
* relay packet to land on the hub (Sonic). Skipped when `srcChainKey` is the hub.
|
|
16382
|
+
* 4. Notifies the solver, triggering it to fill the intent.
|
|
16383
|
+
*
|
|
16384
|
+
* Spread a {@link LeverageYieldSwapPayload} from `deposit` / `withdraw` into this method
|
|
16385
|
+
* alongside the wallet provider: `vaultSwap({ ...payload, walletProvider })`.
|
|
16386
|
+
*
|
|
16387
|
+
* @returns A `Result<VaultSwapResponse, LeverageYieldSwapError>`. On success:
|
|
16388
|
+
* - `solverExecutionResponse` — solver acknowledgement (`{ answer: 'OK', intent_hash }`).
|
|
16389
|
+
* - `intent` — the on-chain intent object that was created.
|
|
16390
|
+
* - `intentDeliveryInfo` — source/destination chain keys, tx hashes, and user addresses.
|
|
16391
|
+
*
|
|
16392
|
+
* On failure `result.error` carries one of the create-intent codes plus
|
|
16393
|
+
* `TX_VERIFICATION_FAILED`, `TX_SUBMIT_FAILED`, `RELAY_TIMEOUT`, `RELAY_FAILED`,
|
|
16394
|
+
* `EXECUTION_FAILED`, `EXTERNAL_API_ERROR` or `UNKNOWN`.
|
|
16395
|
+
*/
|
|
16396
|
+
vaultSwap<K extends SpokeChainKey>(_params: VaultSwapActionParams<K, false>): Promise<Result<VaultSwapResponse, LeverageYieldSwapError>>;
|
|
16397
|
+
/**
|
|
16398
|
+
* Notifies the solver that the vault intent landed on the hub, triggering it to fill.
|
|
16399
|
+
* Leverage-yield copy of the swap domain's `postExecution` — emits only
|
|
16400
|
+
* `EXECUTION_FAILED` / `EXTERNAL_API_ERROR` / `UNKNOWN` (relay/verify codes appear only
|
|
16401
|
+
* on {@link LeverageYieldService.vaultSwap}, which owns the verify + relay steps).
|
|
16402
|
+
*
|
|
16403
|
+
* Called automatically by {@link LeverageYieldService.vaultSwap} after the relay packet
|
|
16404
|
+
* lands on the hub. Public so callers who created the intent via
|
|
16405
|
+
* {@link LeverageYieldService.createVaultIntent} and relayed it themselves can finish the
|
|
16406
|
+
* flow manually.
|
|
16407
|
+
*
|
|
16408
|
+
* @param request - `{ intent_tx_hash }` — the hub-chain (Sonic) tx hash where the intent
|
|
16409
|
+
* was registered (the relay packet's `dst_tx_hash`, or the spoke tx hash for hub-sourced
|
|
16410
|
+
* intents).
|
|
16411
|
+
*/
|
|
16412
|
+
notifySolver(request: SolverExecutionRequest): Promise<Result<SolverExecutionResponse, LeverageYieldPostExecutionError>>;
|
|
16413
|
+
/**
|
|
16414
|
+
* Approves the vault's underlying asset to the leverage vault on Sonic. For callers
|
|
16415
|
+
* interacting with the vault directly on the hub — the swap-style {@link
|
|
16416
|
+
* LeverageYieldService.deposit} flow handles its own approvals.
|
|
16417
|
+
*/
|
|
16418
|
+
approve<R extends boolean = false>(params: LeverageYieldApproveParams<R>): Promise<Result<TxReturnType<HubChainKey, R>, LeverageYieldApproveError>>;
|
|
16419
|
+
/**
|
|
16420
|
+
* Reads on-chain allowance of the vault's underlying asset for `owner → vault`. Returns
|
|
16421
|
+
* `true` when the allowance covers `amount`. Use before a direct
|
|
16422
|
+
* {@link LeverageYieldService.deposit}.
|
|
16423
|
+
*/
|
|
16424
|
+
isAllowanceValid(params: LeverageYieldAllowanceParams): Promise<Result<boolean, LeverageYieldAllowanceCheckError>>;
|
|
16425
|
+
/** ERC-4626 `asset()` of the vault — the sodaWEETH-style underlying. */
|
|
16426
|
+
getAsset(vault: Address): Promise<Result<Address, LeverageYieldLookupError>>;
|
|
16427
|
+
/** Reads the vault's leveraged position snapshot via the non-standard `getPositionDetails`. */
|
|
16428
|
+
getPosition(vault: Address): Promise<Result<LeverageYieldPosition, LeverageYieldLookupError>>;
|
|
16429
|
+
/**
|
|
16430
|
+
* Computes the steady-state APR of a leverage-yield vault from the AAVE supply/borrow
|
|
16431
|
+
* rates of its asset and borrowToken, scaled by the vault's target leverage. Matches the
|
|
16432
|
+
* convention used by leveraged-LSD vaults (Origami, Gearbox, etc.) — assumes constant
|
|
16433
|
+
* LTV at `targetLTV` and constant AAVE rates.
|
|
16434
|
+
*
|
|
16435
|
+
* Returns raw fields in RAY (1e27, AAVE's native rate scale) plus the leverage multiplier
|
|
16436
|
+
* in WAD (1e18). See {@link LeverageYieldApr} for the formula and caveats.
|
|
16437
|
+
*/
|
|
16438
|
+
getApr(vault: Address): Promise<Result<LeverageYieldApr, LeverageYieldLookupError>>;
|
|
16439
|
+
/**
|
|
16440
|
+
* Off-chain LSD staking-APR for the vault's underlying asset. Looks the vault up in the
|
|
16441
|
+
* registry, hits DefiLlama's per-pool chart endpoint for the configured `poolId`, and on
|
|
16442
|
+
* any fetch failure returns the registry's hardcoded `fallbackAprPct` with `stale: true`.
|
|
16443
|
+
*
|
|
16444
|
+
* Always resolves to `{ ok: true, ... }` for a known vault — the fallback path replaces
|
|
16445
|
+
* the error, since a missing LSD APR shouldn't break the parent call. Returns
|
|
16446
|
+
* `{ aprRay: 0n, stale: true, label: 'no LSD source' }` for vaults without an
|
|
16447
|
+
* `lsdSource` configured (non-LSD strategies); callers can treat that as "skip LSD".
|
|
16448
|
+
*/
|
|
16449
|
+
getLsdApr(vault: Address): Promise<Result<LeverageYieldLsdApr, LeverageYieldLookupError>>;
|
|
16450
|
+
/**
|
|
16451
|
+
* Combined view of {@link getApr} + {@link getLsdApr}: re-applies the vault's leverage
|
|
16452
|
+
* formula with the LSD's native staking yield folded into the supply side, exposing the
|
|
16453
|
+
* **effective** net APR that LSD-backed strategies actually earn. The AAVE-only
|
|
16454
|
+
* `netAprRay` is preserved on the return value for callers who want to display both.
|
|
16455
|
+
*
|
|
16456
|
+
* effectiveSupply = supplyAprRay + lsdApr.aprRay
|
|
16457
|
+
* effectiveNet = effectiveSupply + leverage × (effectiveSupply − borrowAprRay)
|
|
16458
|
+
*
|
|
16459
|
+
* Fetches AAVE rates and the LSD APR in parallel for one round-trip's worth of latency.
|
|
16460
|
+
*/
|
|
16461
|
+
getEffectiveApr(vault: Address): Promise<Result<LeverageYieldEffectiveApr, LeverageYieldLookupError>>;
|
|
16462
|
+
/** Synchronously withdrawable assets for `owner` (clamped against leverage HF floor). */
|
|
16463
|
+
getMaxWithdraw(vault: Address, owner: Address): Promise<Result<bigint, LeverageYieldLookupError>>;
|
|
16464
|
+
/** Total underlying assets currently held by the vault (vault-asset units, 18 decimals) — TVL. */
|
|
16465
|
+
getTotalAssets(vault: Address): Promise<Result<bigint, LeverageYieldLookupError>>;
|
|
16466
|
+
/** Shares minted for a given asset deposit. */
|
|
16467
|
+
previewDeposit(vault: Address, assets: bigint): Promise<Result<bigint, LeverageYieldLookupError>>;
|
|
16468
|
+
/** Shares burned for a given asset withdrawal. */
|
|
16469
|
+
previewWithdraw(vault: Address, assets: bigint): Promise<Result<bigint, LeverageYieldLookupError>>;
|
|
16470
|
+
/** Assets received for a given share redemption. */
|
|
16471
|
+
previewRedeem(vault: Address, shares: bigint): Promise<Result<bigint, LeverageYieldLookupError>>;
|
|
16472
|
+
/** Vault shares held by `owner`. */
|
|
16473
|
+
getShareBalance(vault: Address, owner: Address): Promise<Result<bigint, LeverageYieldLookupError>>;
|
|
16474
|
+
/**
|
|
16475
|
+
* Convenience: resolves the user's hub wallet from `(srcChainKey, srcAddress)` and
|
|
16476
|
+
* returns its on-chain `maxWithdraw`, less {@link MAX_WITHDRAW_DUST_BUFFER}. The trim
|
|
16477
|
+
* keeps the value safe for an asset-denominated ERC-4626 `withdraw` — the raw
|
|
16478
|
+
* `maxWithdraw` can trip the round-up that asks for one more share than the user holds.
|
|
16479
|
+
*/
|
|
16480
|
+
getMaxWithdrawForUser<K extends SpokeChainKey>(vault: Address, srcChainKey: K, srcAddress: string): Promise<Result<bigint, LeverageYieldLookupError>>;
|
|
16481
|
+
/**
|
|
16482
|
+
* Convenience: resolves the user's hub wallet from `(srcChainKey, srcAddress)` and
|
|
16483
|
+
* returns its on-chain share balance.
|
|
16484
|
+
*/
|
|
16485
|
+
getShareBalanceForUser<K extends SpokeChainKey>(vault: Address, srcChainKey: K, srcAddress: string): Promise<Result<bigint, LeverageYieldLookupError>>;
|
|
16486
|
+
}
|
|
16487
|
+
|
|
16014
16488
|
/**
|
|
16015
16489
|
* Sodax class is used to interact with the Sodax.
|
|
16016
16490
|
*
|
|
@@ -16027,6 +16501,7 @@ declare class Sodax {
|
|
|
16027
16501
|
readonly partners: PartnerService;
|
|
16028
16502
|
readonly recovery: RecoveryService;
|
|
16029
16503
|
readonly dex: DexService;
|
|
16504
|
+
readonly leverageYield: LeverageYieldService;
|
|
16030
16505
|
readonly config: ConfigService;
|
|
16031
16506
|
readonly hubProvider: HubProvider;
|
|
16032
16507
|
readonly spoke: SpokeService;
|
|
@@ -16587,4 +17062,4 @@ type DexErrorCode = LookupErrorCode;
|
|
|
16587
17062
|
type DexError = SodaxError<DexErrorCode>;
|
|
16588
17063
|
declare const isDexError: (e: unknown) => e is SodaxError<LookupErrorCode>;
|
|
16589
17064
|
|
|
16590
|
-
export { ALLOWANCE_CHECK_CODES, APPROVE_CODES, type AggregatedReserveData, type AllowanceCheckErrorCode, type AllowanceInfo, type AllowanceResponse, type AllowanceTransferDetails, type ApiResponse, type ApproveErrorCode, type ApyRange, type AssetDepositAction, type AssetEntry, AssetService, type AssetServiceConstructorParams, type AssetWithdrawAction, type AutoSwapPreferences, BackendApiService, type BalnLockParams, type BalnMigrateAction, type BalnMigrateParams, type BalnSwapAbi, BalnSwapService, type BalnSwapServiceConstructorParams, type BaseCurrencyInfo, BigIntToHex, type BigNumberValue, BigNumberZeroDecimal, BitcoinSpokeService, type BitcoinTransactionResult, type BitcoinUTXO, BnUSDMigrationService, type BnUSDMigrationServiceConstructorParams, type BnUSDRevertMigrationParams, type BorrowInfo, type BridgeAction, type BridgeAllowanceCheckError, type BridgeAllowanceCheckErrorCode, type BridgeApproveError, type BridgeApproveErrorCode, type BridgeCreateIntentError, type BridgeCreateIntentErrorCode, type BridgeError, type BridgeErrorCode, type BridgeLookupError, type BridgeLookupErrorCode, type BridgeOrchestrationError, type BridgeOrchestrationErrorCode, type BridgeParams, BridgeService, type BridgeServiceConstructorParams, type BtcPayload, CREATE_INTENT_CODES, type CalculateAllReserveIncentivesRequest, type CalculateAllUserIncentivesRequest, type CalculateCompoundedRateRequest, type CallResponse, type CancelIntentActionParams, type CancelIntentParams, type CancelUnstakeAction, type CancelUnstakeParams, type ClClaimRewardsParams, type ClDecreaseLiquidityParams, type ClGetPoolDataParams, type ClIncreaseLiquidityParams, type ClLiquidityClaimRewardsAction, type ClLiquidityDecreaseLiquidityAction, type ClLiquidityIncreaseLiquidityAction, type ClLiquidityWithdrawAction, type ClMintPositionEventLog, type ClPositionInfo, ClService, type ClServiceConstructorParams, type ClSupplyAction, type ClSupplyParams, type ClWithdrawParams, type ClaimAction, type ClaimParams, type CombinedReserveData, type ComputedUserReserve, type ConcentratedLiquidityParams, type ConcentratedLiquidityTokenInfo, ConfigService, type ConfigServiceConstructorParams, type ConnMsg, type CreateAssetDepositParams, type CreateAssetWithdrawParams, type CreateBridgeIntentParams, type CreateIntentErrorCode, type CreateIntentParams, type CreateIntentResult, type CreateLimitOrderParams, type CreateSonicSwapIntentParams, type CreateViemPublicClientParams, CustomSorobanServer, CustomStellarAccount, type DepositParams, type DepositSimulationParams, type DestinationParamsType, type DetailedLock, type DexError, type DexErrorCode, DexService, type DexServiceConstructorParams, type EModeCategory, type EModeCategoryHumanized, type EModeData, type EModeDataString, type EmodeDataHumanized, type EnrichedToken, type Erc20ApproveParams, type Erc20IsAllowanceParams, Erc20Service, type Erc20Token, Erc4626Service, type EstimateGasParams, EvmAssetManagerService, type EvmDepositToDataParams, EvmHubProvider, type EvmHubProviderConstructorParams, EvmSolverService, EvmSpokeService, EvmVaultTokenService, type EvmWithdrawAssetDataParams, type ExecuteMsg, type FeatureInvariant, type FeeData, type FeeTokenApproveAction, type FeeTokenApproveParams, type FetchHubAssetBalancesParams, type FormatReserveRequest, type FormatReserveResponse, type FormatReserveUSDRequest, type FormatReserveUSDResponse, type FormatReservesAndIncentivesUSDRequest, type FormatReservesUSDRequest, type FormatUserSummaryAndIncentivesRequest, type FormatUserSummaryAndIncentivesResponse, type FormatUserSummaryRequest, type FormatUserSummaryResponse, type FormattedReserveEMode, GAS_ESTIMATION_CODES, type GasEstimationErrorCode, type GetDepositParams, type GetIntentSubmitTxExtraDataParams, type GetPacketParams, type GetPacketResponse, type GetRelayRequestParamType, type GetRelayResponse, type GetSpokeServiceType, type GetTransactionPacketsParams, type GetTransactionPacketsResponse, type GetTxReceiptType, type GetUserRouterParams, HALF_RAY, HALF_WAD, type HanaWalletRequestEvent, type HanaWalletResponseEvent, HttpRelayError, type HubAssetBalance, type HubProvider, type IconJsonRpcVersion, IconSpokeService, type IcxCreateRevertMigrationParams, type IcxMigrateAction, type IcxMigrateParams, IcxMigrationService, type IcxMigrationServiceConstructorParams, type IcxRevertMigrationAction, type IcxRevertMigrationParams, type IncentiveDataHumanized, type InjTokenInfo, Injective20Token, type InjectiveBalance, InjectiveSpokeService, type InstantUnstakeAction, type InstantUnstakeParams, type InstantiateMsg, type Intent, type IntentAutoSwapResult, IntentCreatedEventAbi, type IntentCreatedEventLog, type IntentData, IntentDataType, type IntentDeliveryInfo, IntentFilledEventAbi, type IntentFilledEventLog, type IntentRelayRequest, type IntentRelayRequestParams, type IntentResponse, type IntentState, type IntentTxResult, IntentsAbi, type JsonRpcPayloadResponse, LOOKUP_CODES, LTV_PRECISION, LendingPoolService, type LendingPoolServiceConstructorParams, type LimitOrderActionParams, LockupMultiplier, LockupPeriod, type LookupErrorCode, type MapRelayFailureCtx, type MigrateOrchestrationError, type MigrateOrchestrationErrorCode, type MigrationAction, type MigrationAllowanceCheckError, type MigrationAllowanceCheckErrorCode, type MigrationApproveError, type MigrationApproveErrorCode, type MigrationCreateIntentError, type MigrationCreateIntentErrorCode, type MigrationDirection, type MigrationError, type MigrationErrorCode, type MigrationLookupError, type MigrationLookupErrorCode, type MigrationOp, type MigrationParams, type MigrationRevertParams, MigrationService, type MigrationServiceConstructorParams, type MigrationTokens, MintPositionEventAbi, type MintPositionEventLog, type MoneyMarketAction, type MoneyMarketAllowanceCheckError, type MoneyMarketAllowanceCheckErrorCode, type MoneyMarketAllowanceParams, type MoneyMarketApproveActionParams, type MoneyMarketApproveError, type MoneyMarketApproveErrorCode, type MoneyMarketAsset, type MoneyMarketAssetBorrowers, type MoneyMarketAssetSuppliers, type MoneyMarketBorrowActionParams, type MoneyMarketBorrowParams, type MoneyMarketBorrowers, type MoneyMarketCreateIntentError, type MoneyMarketCreateIntentErrorCode, MoneyMarketDataService, type MoneyMarketDataServiceConstructorParams, type MoneyMarketEncodeBorrowParams, type MoneyMarketEncodeRepayParams, type MoneyMarketEncodeRepayWithATokensParams, type MoneyMarketEncodeSupplyParams, type MoneyMarketEncodeWithdrawParams, type MoneyMarketError, type MoneyMarketErrorCode, type MoneyMarketGasEstimationError, type MoneyMarketGasEstimationErrorCode, type MoneyMarketOrchestrationError, type MoneyMarketOrchestrationErrorCode, type MoneyMarketParams, type MoneyMarketPosition, type MoneyMarketRepayActionParams, type MoneyMarketRepayParams, MoneyMarketService, type MoneyMarketServiceConstructorParams, type MoneyMarketSupplyActionParams, type MoneyMarketSupplyParams, type MoneyMarketWithdrawActionParams, type MoneyMarketWithdrawParams, NEAR_DEFAULT_GAS, NEAR_STORAGE_DEPOSIT, NearSpokeService, type OnDemandBtcPayload, type OnDemandRelayData, type OptionalRaw, type OptionalSkipSimulation, type OptionalTimeout, type OrderbookResponse, type PacketData, type PartnerAction, type PartnerError, type PartnerErrorCode, type PartnerFeeClaimAssetBalance, PartnerFeeClaimService, type PartnerFeeClaimServiceConstructorParams, type PartnerFeeClaimSwapAction, type PartnerFeeClaimSwapParams, PartnerService, type PartnerServiceConfig, type PartnerServiceConstructorParams, Permit2Service, type PermitBatch, type PermitDetails, type PermitSingle, type PoolBaseCurrencyHumanized, type PoolData, type PoolRewardConfig, type PoolSpokeAssets, type PostExecutionError, type PostExecutionErrorCode, ProtocolIntentsAbi, type QueryMsg, type QueryResponse, RAY, RAY_DECIMALS, RELAY_ERROR_CODES, RadfiApiError, type RadfiAuthResult, type RadfiBuildTxResponse, type RadfiErrorBody, type RadfiMaxSpentResponse, RadfiProvider, type RadfiTradingWallet, type RadfiUtxo, type RadfiUtxoListResponse, type RadfiWalletBalance, type RateLimitConfig, type RawDestinationParams, type RecoveryAction, type RecoveryError, type RecoveryErrorCode, RecoveryService, type RecoveryServiceConstructorParams, type RelayAction, type RelayAndWaitParams, type RelayCode, type RelayErrorCode, type RelayExtraData, type RelayRequestDetail, type RelayRequestSigning, type RelayTxStatus, type RelayWrappedErrorCode, type RequestConfig, type RequestOverrideConfig, type RequestTrustlineParams, type ReserveCalculationData, type ReserveData, type ReserveDataHumanized, type ReserveDataLegacy, type ReserveDataWithPrice, type ReserveEMode, type ReserveIncentiveDict, type ReservesDataHumanized, type ReservesIncentiveDataHumanized, type ResponseAddressType, type ResponseSigningType, type RevertMigrationOrchestrationError, type RevertMigrationOrchestrationErrorCode, type RewardInfoHumanized, SECONDS_PER_YEAR, SODAX_ERROR_CODES, SODAX_FEATURES, type SendMessageParams, type SetSwapPreferenceAction, type SetSwapPreferenceParams, Sodax, SodaxError, type SodaxErrorCode, type SodaxErrorContext, type SodaxErrorJSON, type SodaxFeature, type SodaxPhase, SolanaSpokeService, SolverApiService, SonicSpokeService, type SpokeApproveParams, type SpokeApproveParamsEvmSpoke, type SpokeApproveParamsHub, type SpokeApproveParamsStellar, type SpokeIsAllowanceValidParams, type SpokeIsAllowanceValidParamsEvmSpoke, type SpokeIsAllowanceValidParamsHub, type SpokeIsAllowanceValidParamsOther, type SpokeIsAllowanceValidParamsStellar, SpokeService, type SpokeServiceConstructorParams, type SpokeServiceType, StacksSpokeService, type StakeAction, type StakeOrchestrationError, type StakeOrchestrationErrorCode, type StakeParams, type StakingActionType, type StakingActionUnion, type StakingAllowanceCheckError, type StakingAllowanceCheckErrorCode, type StakingApproveError, type StakingApproveErrorCode, type StakingConfig, type StakingCreateIntentError, type StakingCreateIntentErrorCode, type StakingError, type StakingErrorCode, type StakingInfo, type StakingInfoFetchError, type StakingInfoFetchErrorCode, StakingLogic, type StakingOrchestrationError, type StakingOrchestrationErrorCode, type StakingParamsUnion, StakingService, type StakingServiceConstructorParams, type State, StellarSpokeService, type SubmitTxParams, type SubmitTxResponse, SuiSpokeService, SupportedMigrationTokens, type SwapAction, type SwapActionParams, type SwapCreateIntentError, type SwapCreateIntentErrorCode, type SwapError, type SwapErrorCode, type SwapResponse, SwapService, type SwapServiceConstructorParams, type TokenSpenderPair, type TokenWithConversion, type TxHashPair, type TxStatus, USD_DECIMALS, type UiPoolDataProviderInterface, UiPoolDataProviderService, type UiPoolDataProviderServiceConstructorParams, type UnifiedBnUSDMigrateAction, type UnifiedBnUSDMigrateParams, type UnstakeAction, type UnstakeParams, type UnstakeRequest, type UnstakeRequestWithPenalty, type UnstakingInfo, type UserIncentiveData, type UserIncentiveDataHumanized, type UserIncentiveDict, type UserIntentsResponse, type UserReserveCalculationData, type UserReserveData, type UserReserveDataHumanized, type UserReserveDataString, type UserReservesIncentivesDataHumanized, type UserRewardInfoHumanized, type VerifySimulationParams, type VerifyTxHashParams, WAD, WAD_RAY_RATIO, WEI_DECIMALS, type WaitForTxReceiptParams, type WaitForTxReceiptReturnType, type WaitUntilIntentExecutedPayload, type WalletMode, type WalletSimulationParams, type WithdrawHubAssetAction, type WithdrawHubAssetParams, type WithdrawInfo, adjustAmountByFee, allowanceCheckFailed, approveFailed, assetManagerAbi, balnSwapAbi, binomialApproximatedRayPow, bridgeInvariant, calcOpReturnOutputVbytes, calculateAllReserveIncentives, calculateAllUserIncentives, calculateAvailableBorrowsMarketReferenceCurrency, calculateCompoundedInterest, calculateCompoundedRate, calculateFeeAmount, calculateHealthFactorFromBalances, calculateHealthFactorFromBalancesBigUnits, calculateLinearInterest, calculatePercentageFeeAmount, clPoolAbi, clPoolManagerAbi, clPositionManagerAbi, clQuoterAbi, clRouterAbi, clTickLensAbi, connectionAbi, consoleLogger, convertTransactionInstructionToRaw, createInvariant, deepMerge, defaultHookAbi, dexInvariant, encodeAddress, encodeBtcPayloadToBytes, encodeContractCalls, erc20Abi, erc4626Abi, estimateBitcoinTxSize, executionFailed, formatBasisPoints, formatEModeCategory, formatEModes, formatPercentage, formatReserve, formatReserveUSD, formatReserves, formatReservesAndIncentives, formatUserSummary, formatUserSummaryAndIncentives, gasEstimationFailed, getAndFormatReserveEModes, getAssetManagerIdl, getAssetManagerProgram, getCompoundedBalance, getConnectionIdl, getConnectionProgram, getEvmViemChain, getIconAddressBytes, getLinearBalance, getMarketReferenceCurrencyAndUsdBalance, getPacket, getProvider, getRandomBytes, getReserveNormalizedIncome, getReservesEModes, getSolanaAddressBytes, getTransactionPackets, hexToBigInt, hexToSolanaAddress, hyper, intentCreationFailed, isBalnMigrateParams, isBitcoinChainKeyType, isBitcoinWalletProviderType, isBridgeAllowanceCheckError, isBridgeApproveError, isBridgeCreateIntentError, isBridgeError, isBridgeLookupError, isBridgeOrchestrationError, isCodeMember, isDexError, isEvmChainKeyType, isEvmSpokeChainConfig, isEvmSpokeOnlyChainKeyType, isEvmWalletProviderType, isFeatureError, isHubChainKeyType, isIconAddress, isIconChainKeyType, isIcxCreateRevertMigrationParams, isIcxMigrateParams, isInjectiveChainKeyType, isJsonRpcPayloadResponse, isMigrateOrchestrationError, isMigrationAllowanceCheckError, isMigrationApproveError, isMigrationCreateIntentError, isMigrationError, isMigrationLookupError, isMoneyMarketAllowanceCheckError, isMoneyMarketApproveError, isMoneyMarketCreateIntentError, isMoneyMarketError, isMoneyMarketGasEstimationError, isMoneyMarketOrchestrationError, isNearChainKeyType, isOptionalBitcoinWalletProviderType, isOptionalEvmWalletProviderType, isOptionalStellarWalletProviderType, isPartnerError, isPartnerFeeAmount, isPartnerFeePercentage, isPostExecutionError, isRawDestinationParams, isRecoveryError, isResponseAddressType, isResponseSigningType, isRevertMigrationOrchestrationError, isSodaxError, isSolanaChainKeyType, isSolanaNativeToken, isSonicChainKeyType, isSpokeApproveParamsEvmSpoke, isSpokeApproveParamsHub, isSpokeApproveParamsStellar, isSpokeIsAllowanceValidParamsEvmSpoke, isSpokeIsAllowanceValidParamsHub, isSpokeIsAllowanceValidParamsStellar, isStacksChainKeyType, isStakeOrchestrationError, isStakingAllowanceCheckError, isStakingApproveError, isStakingCreateIntentError, isStakingError, isStakingInfoFetchError, isStakingOrchestrationError, isStellarChainKeyType, isStellarWalletProviderType, isSubmitSwapTxResponse, isSubmitSwapTxStatusResponse, isSuiChainKeyType, isSwapCreateIntentError, isSwapError, isUndefinedOrValidWalletProviderForChainKey, isUnifiedBnUSDMigrateParams, lookupFailed, mapRelayFailure, mergeSodaxConfig, messageOf, migrationInvariant, mintPositionParamsAbi, mmInvariant, modifyLiquidityParamsAbi, nativeToUSD, normalize, normalizeBN, normalizePsbtToBase64, normalizeSignatureToBase64, normalizedToUsd, pancakeSwapInfinityDefaultHookAbi, pancakeSwapInfinityPoolManagerAbi, pancakeSwapInfinityPositionManagerAbi, parseToStroops, parseTokenArrayFromJson, partnerInvariant, permit2Abi, poolAbi, poolKeyAbi, randomUint256, rayDiv, rayMul, rayPow, rayToWad, recoveryInvariant, relayTxAndWaitPacket, requestAddress, requestJsonRpc, requestSigning, resolveLogger, retry, reverseEncodeAddress, serializeAddressData, silentLogger, sleep, sodaxInvariant, sonicWalletFactoryAbi, spokeAssetManagerAbi, stakedSodaAbi, stakingInvariant, stakingRouterAbi, stataTokenFactoryAbi, submitTransaction, swapExactInSingleParamsAbi, swapInvariant, uiPoolDataAbi, universalRouterAbi, unknownFailed, valueToBigNumber, valueToZDBigNumber, variableDebtTokenAbi, vaultTokenAbi, verifyFailed, wadToRay, waitForStacksTransaction, waitForTransactionReceipt, waitUntilIntentExecuted, walletFactoryAbi, wrappedSonicAbi };
|
|
17065
|
+
export { ALLOWANCE_CHECK_CODES, APPROVE_CODES, type AggregatedReserveData, type AllowanceCheckErrorCode, type AllowanceInfo, type AllowanceResponse, type AllowanceTransferDetails, type ApiResponse, type ApproveErrorCode, type ApyRange, type AssetDepositAction, type AssetEntry, AssetService, type AssetServiceConstructorParams, type AssetWithdrawAction, type AutoSwapPreferences, BackendApiService, type BalnLockParams, type BalnMigrateAction, type BalnMigrateParams, type BalnSwapAbi, BalnSwapService, type BalnSwapServiceConstructorParams, type BaseCurrencyInfo, BigIntToHex, type BigNumberValue, BigNumberZeroDecimal, BitcoinSpokeService, type BitcoinTransactionResult, type BitcoinUTXO, BnUSDMigrationService, type BnUSDMigrationServiceConstructorParams, type BnUSDRevertMigrationParams, type BorrowInfo, type BridgeAction, type BridgeAllowanceCheckError, type BridgeAllowanceCheckErrorCode, type BridgeApproveError, type BridgeApproveErrorCode, type BridgeCreateIntentError, type BridgeCreateIntentErrorCode, type BridgeError, type BridgeErrorCode, type BridgeLookupError, type BridgeLookupErrorCode, type BridgeOrchestrationError, type BridgeOrchestrationErrorCode, type BridgeParams, BridgeService, type BridgeServiceConstructorParams, type BtcPayload, CREATE_INTENT_CODES, type CalculateAllReserveIncentivesRequest, type CalculateAllUserIncentivesRequest, type CalculateCompoundedRateRequest, type CallResponse, type CancelIntentActionParams, type CancelIntentParams, type CancelUnstakeAction, type CancelUnstakeParams, type ClClaimRewardsParams, type ClDecreaseLiquidityParams, type ClGetPoolDataParams, type ClIncreaseLiquidityParams, type ClLiquidityClaimRewardsAction, type ClLiquidityDecreaseLiquidityAction, type ClLiquidityIncreaseLiquidityAction, type ClLiquidityWithdrawAction, type ClMintPositionEventLog, type ClPositionInfo, ClService, type ClServiceConstructorParams, type ClSupplyAction, type ClSupplyParams, type ClWithdrawParams, type ClaimAction, type ClaimParams, type CombinedReserveData, type ComputedUserReserve, type ConcentratedLiquidityParams, type ConcentratedLiquidityTokenInfo, ConfigService, type ConfigServiceConstructorParams, type ConnMsg, type CreateAssetDepositParams, type CreateAssetWithdrawParams, type CreateBridgeIntentParams, type CreateIntentErrorCode, type CreateIntentParams, type CreateIntentResult, type CreateLimitOrderParams, type CreateSonicSwapIntentParams, type CreateVaultIntentResult, type CreateViemPublicClientParams, CustomSorobanServer, CustomStellarAccount, type DepositParams, type DepositSimulationParams, type DestinationParamsType, type DetailedLock, type DexError, type DexErrorCode, DexService, type DexServiceConstructorParams, type EModeCategory, type EModeCategoryHumanized, type EModeData, type EModeDataString, type EmodeDataHumanized, type EnrichedToken, type Erc20ApproveParams, type Erc20IsAllowanceParams, Erc20Service, type Erc20Token, Erc4626Service, type EstimateGasParams, EvmAssetManagerService, type EvmDepositToDataParams, EvmHubProvider, type EvmHubProviderConstructorParams, EvmSolverService, EvmSpokeService, EvmVaultTokenService, type EvmWithdrawAssetDataParams, type ExecuteMsg, type FeatureInvariant, type FeeData, type FeeTokenApproveAction, type FeeTokenApproveParams, type FetchHubAssetBalancesParams, type FormatReserveRequest, type FormatReserveResponse, type FormatReserveUSDRequest, type FormatReserveUSDResponse, type FormatReservesAndIncentivesUSDRequest, type FormatReservesUSDRequest, type FormatUserSummaryAndIncentivesRequest, type FormatUserSummaryAndIncentivesResponse, type FormatUserSummaryRequest, type FormatUserSummaryResponse, type FormattedReserveEMode, GAS_ESTIMATION_CODES, type GasEstimationErrorCode, type GetDepositParams, type GetIntentSubmitTxExtraDataParams, type GetPacketParams, type GetPacketResponse, type GetRelayRequestParamType, type GetRelayResponse, type GetSpokeServiceType, type GetTransactionPacketsParams, type GetTransactionPacketsResponse, type GetTxReceiptType, type GetUserRouterParams, HALF_RAY, HALF_WAD, type HanaWalletRequestEvent, type HanaWalletResponseEvent, HttpRelayError, type HubAssetBalance, type HubProvider, type IconJsonRpcVersion, IconSpokeService, type IcxCreateRevertMigrationParams, type IcxMigrateAction, type IcxMigrateParams, IcxMigrationService, type IcxMigrationServiceConstructorParams, type IcxRevertMigrationAction, type IcxRevertMigrationParams, type IncentiveDataHumanized, type InjTokenInfo, Injective20Token, type InjectiveBalance, InjectiveSpokeService, type InstantUnstakeAction, type InstantUnstakeParams, type InstantiateMsg, type Intent, type IntentAutoSwapResult, IntentCreatedEventAbi, type IntentCreatedEventLog, type IntentData, IntentDataType, type IntentDeliveryInfo, IntentFilledEventAbi, type IntentFilledEventLog, type IntentRelayRequest, type IntentRelayRequestParams, type IntentResponse, type IntentState, type IntentTxResult, IntentsAbi, type JsonRpcPayloadResponse, LOOKUP_CODES, LTV_PRECISION, LendingPoolService, type LendingPoolServiceConstructorParams, type LeverageYieldAction, type LeverageYieldAllowanceCheckError, type LeverageYieldAllowanceCheckErrorCode, type LeverageYieldAllowanceParams, type LeverageYieldApproveError, type LeverageYieldApproveErrorCode, type LeverageYieldApproveParams, type LeverageYieldApr, type LeverageYieldCreateIntentError, type LeverageYieldCreateIntentErrorCode, type LeverageYieldEffectiveApr, type LeverageYieldError, type LeverageYieldErrorCode, type LeverageYieldLookupError, type LeverageYieldLookupErrorCode, type LeverageYieldLsdApr, type LeverageYieldPosition, type LeverageYieldPostExecutionError, type LeverageYieldPostExecutionErrorCode, LeverageYieldService, type LeverageYieldServiceConstructorParams, type LeverageYieldSwapDepositParams, type LeverageYieldSwapError, type LeverageYieldSwapErrorCode, type LeverageYieldSwapPayload, type LeverageYieldSwapWithdrawParams, type LimitOrderActionParams, LockupMultiplier, LockupPeriod, type LookupErrorCode, type MapRelayFailureCtx, type MigrateOrchestrationError, type MigrateOrchestrationErrorCode, type MigrationAction, type MigrationAllowanceCheckError, type MigrationAllowanceCheckErrorCode, type MigrationApproveError, type MigrationApproveErrorCode, type MigrationCreateIntentError, type MigrationCreateIntentErrorCode, type MigrationDirection, type MigrationError, type MigrationErrorCode, type MigrationLookupError, type MigrationLookupErrorCode, type MigrationOp, type MigrationParams, type MigrationRevertParams, MigrationService, type MigrationServiceConstructorParams, type MigrationTokens, MintPositionEventAbi, type MintPositionEventLog, type MoneyMarketAction, type MoneyMarketAllowanceCheckError, type MoneyMarketAllowanceCheckErrorCode, type MoneyMarketAllowanceParams, type MoneyMarketApproveActionParams, type MoneyMarketApproveError, type MoneyMarketApproveErrorCode, type MoneyMarketAsset, type MoneyMarketAssetBorrowers, type MoneyMarketAssetSuppliers, type MoneyMarketBorrowActionParams, type MoneyMarketBorrowParams, type MoneyMarketBorrowers, type MoneyMarketCreateIntentError, type MoneyMarketCreateIntentErrorCode, MoneyMarketDataService, type MoneyMarketDataServiceConstructorParams, type MoneyMarketEncodeBorrowParams, type MoneyMarketEncodeRepayParams, type MoneyMarketEncodeRepayWithATokensParams, type MoneyMarketEncodeSupplyParams, type MoneyMarketEncodeWithdrawParams, type MoneyMarketError, type MoneyMarketErrorCode, type MoneyMarketGasEstimationError, type MoneyMarketGasEstimationErrorCode, type MoneyMarketOrchestrationError, type MoneyMarketOrchestrationErrorCode, type MoneyMarketParams, type MoneyMarketPosition, type MoneyMarketRepayActionParams, type MoneyMarketRepayParams, MoneyMarketService, type MoneyMarketServiceConstructorParams, type MoneyMarketSupplyActionParams, type MoneyMarketSupplyParams, type MoneyMarketWithdrawActionParams, type MoneyMarketWithdrawParams, NEAR_DEFAULT_GAS, NEAR_STORAGE_DEPOSIT, NearSpokeService, type OnDemandBtcPayload, type OnDemandRelayData, type OptionalRaw, type OptionalSkipSimulation, type OptionalTimeout, type OrderbookResponse, type PacketData, type PartnerAction, type PartnerError, type PartnerErrorCode, type PartnerFeeClaimAssetBalance, PartnerFeeClaimService, type PartnerFeeClaimServiceConstructorParams, type PartnerFeeClaimSwapAction, type PartnerFeeClaimSwapParams, PartnerService, type PartnerServiceConfig, type PartnerServiceConstructorParams, Permit2Service, type PermitBatch, type PermitDetails, type PermitSingle, type PoolBaseCurrencyHumanized, type PoolData, type PoolRewardConfig, type PoolSpokeAssets, type PostExecutionError, type PostExecutionErrorCode, ProtocolIntentsAbi, type QueryMsg, type QueryResponse, RAY, RAY_DECIMALS, RELAY_ERROR_CODES, RadfiApiError, type RadfiAuthResult, type RadfiBuildTxResponse, type RadfiErrorBody, type RadfiMaxSpentResponse, RadfiProvider, type RadfiTradingWallet, type RadfiUtxo, type RadfiUtxoListResponse, type RadfiWalletBalance, type RateLimitConfig, type RawDestinationParams, type RecoveryAction, type RecoveryError, type RecoveryErrorCode, RecoveryService, type RecoveryServiceConstructorParams, type RelayAction, type RelayAndWaitParams, type RelayCode, type RelayErrorCode, type RelayExtraData, type RelayRequestDetail, type RelayRequestSigning, type RelayTxStatus, type RelayWrappedErrorCode, type RequestConfig, type RequestOverrideConfig, type RequestTrustlineParams, type ReserveCalculationData, type ReserveData, type ReserveDataHumanized, type ReserveDataLegacy, type ReserveDataWithPrice, type ReserveEMode, type ReserveIncentiveDict, type ReservesDataHumanized, type ReservesIncentiveDataHumanized, type ResponseAddressType, type ResponseSigningType, type RevertMigrationOrchestrationError, type RevertMigrationOrchestrationErrorCode, type RewardInfoHumanized, SECONDS_PER_YEAR, SODAX_ERROR_CODES, SODAX_FEATURES, type SendMessageParams, type SetSwapPreferenceAction, type SetSwapPreferenceParams, Sodax, SodaxError, type SodaxErrorCode, type SodaxErrorContext, type SodaxErrorJSON, type SodaxFeature, type SodaxPhase, SolanaSpokeService, SolverApiService, SonicSpokeService, type SpokeApproveParams, type SpokeApproveParamsEvmSpoke, type SpokeApproveParamsHub, type SpokeApproveParamsStellar, type SpokeIsAllowanceValidParams, type SpokeIsAllowanceValidParamsEvmSpoke, type SpokeIsAllowanceValidParamsHub, type SpokeIsAllowanceValidParamsOther, type SpokeIsAllowanceValidParamsStellar, SpokeService, type SpokeServiceConstructorParams, type SpokeServiceType, StacksSpokeService, type StakeAction, type StakeOrchestrationError, type StakeOrchestrationErrorCode, type StakeParams, type StakingActionType, type StakingActionUnion, type StakingAllowanceCheckError, type StakingAllowanceCheckErrorCode, type StakingApproveError, type StakingApproveErrorCode, type StakingConfig, type StakingCreateIntentError, type StakingCreateIntentErrorCode, type StakingError, type StakingErrorCode, type StakingInfo, type StakingInfoFetchError, type StakingInfoFetchErrorCode, StakingLogic, type StakingOrchestrationError, type StakingOrchestrationErrorCode, type StakingParamsUnion, StakingService, type StakingServiceConstructorParams, type State, StellarSpokeService, type SubmitTxParams, type SubmitTxResponse, SuiSpokeService, SupportedMigrationTokens, type SwapAction, type SwapActionParams, type SwapCreateIntentError, type SwapCreateIntentErrorCode, type SwapError, type SwapErrorCode, type SwapResponse, SwapService, type SwapServiceConstructorParams, type TokenSpenderPair, type TokenWithConversion, type TxHashPair, type TxStatus, USD_DECIMALS, type UiPoolDataProviderInterface, UiPoolDataProviderService, type UiPoolDataProviderServiceConstructorParams, type UnifiedBnUSDMigrateAction, type UnifiedBnUSDMigrateParams, type UnstakeAction, type UnstakeParams, type UnstakeRequest, type UnstakeRequestWithPenalty, type UnstakingInfo, type UserIncentiveData, type UserIncentiveDataHumanized, type UserIncentiveDict, type UserIntentsResponse, type UserReserveCalculationData, type UserReserveData, type UserReserveDataHumanized, type UserReserveDataString, type UserReservesIncentivesDataHumanized, type UserRewardInfoHumanized, type VaultSwapActionParams, type VaultSwapResponse, type VerifySimulationParams, type VerifyTxHashParams, WAD, WAD_RAY_RATIO, WEI_DECIMALS, type WaitForTxReceiptParams, type WaitForTxReceiptReturnType, type WaitUntilIntentExecutedPayload, type WalletMode, type WalletSimulationParams, type WithdrawHubAssetAction, type WithdrawHubAssetParams, type WithdrawInfo, adjustAmountByFee, allowanceCheckFailed, approveFailed, assetManagerAbi, balnSwapAbi, binomialApproximatedRayPow, bridgeInvariant, calcOpReturnOutputVbytes, calculateAllReserveIncentives, calculateAllUserIncentives, calculateAvailableBorrowsMarketReferenceCurrency, calculateCompoundedInterest, calculateCompoundedRate, calculateFeeAmount, calculateHealthFactorFromBalances, calculateHealthFactorFromBalancesBigUnits, calculateLinearInterest, calculatePercentageFeeAmount, clPoolAbi, clPoolManagerAbi, clPositionManagerAbi, clQuoterAbi, clRouterAbi, clTickLensAbi, connectionAbi, consoleLogger, convertTransactionInstructionToRaw, createInvariant, deepMerge, defaultHookAbi, dexInvariant, encodeAddress, encodeBtcPayloadToBytes, encodeContractCalls, erc20Abi, erc4626Abi, estimateBitcoinTxSize, executionFailed, formatBasisPoints, formatEModeCategory, formatEModes, formatPercentage, formatReserve, formatReserveUSD, formatReserves, formatReservesAndIncentives, formatUserSummary, formatUserSummaryAndIncentives, gasEstimationFailed, getAndFormatReserveEModes, getAssetManagerIdl, getAssetManagerProgram, getCompoundedBalance, getConnectionIdl, getConnectionProgram, getEvmViemChain, getIconAddressBytes, getLinearBalance, getMarketReferenceCurrencyAndUsdBalance, getPacket, getProvider, getRandomBytes, getReserveNormalizedIncome, getReservesEModes, getSolanaAddressBytes, getTransactionPackets, hexToBigInt, hexToSolanaAddress, hyper, intentCreationFailed, isBalnMigrateParams, isBitcoinChainKeyType, isBitcoinWalletProviderType, isBridgeAllowanceCheckError, isBridgeApproveError, isBridgeCreateIntentError, isBridgeError, isBridgeLookupError, isBridgeOrchestrationError, isCodeMember, isDexError, isEvmChainKeyType, isEvmSpokeChainConfig, isEvmSpokeOnlyChainKeyType, isEvmWalletProviderType, isFeatureError, isHubChainKeyType, isIconAddress, isIconChainKeyType, isIcxCreateRevertMigrationParams, isIcxMigrateParams, isInjectiveChainKeyType, isJsonRpcPayloadResponse, isLeverageYieldAllowanceCheckError, isLeverageYieldApproveError, isLeverageYieldCreateIntentError, isLeverageYieldError, isLeverageYieldLookupError, isLeverageYieldPostExecutionError, isLeverageYieldSwapError, isMigrateOrchestrationError, isMigrationAllowanceCheckError, isMigrationApproveError, isMigrationCreateIntentError, isMigrationError, isMigrationLookupError, isMoneyMarketAllowanceCheckError, isMoneyMarketApproveError, isMoneyMarketCreateIntentError, isMoneyMarketError, isMoneyMarketGasEstimationError, isMoneyMarketOrchestrationError, isNearChainKeyType, isOptionalBitcoinWalletProviderType, isOptionalEvmWalletProviderType, isOptionalStellarWalletProviderType, isPartnerError, isPartnerFeeAmount, isPartnerFeePercentage, isPostExecutionError, isRawDestinationParams, isRecoveryError, isResponseAddressType, isResponseSigningType, isRevertMigrationOrchestrationError, isSodaxError, isSolanaChainKeyType, isSolanaNativeToken, isSonicChainKeyType, isSpokeApproveParamsEvmSpoke, isSpokeApproveParamsHub, isSpokeApproveParamsStellar, isSpokeIsAllowanceValidParamsEvmSpoke, isSpokeIsAllowanceValidParamsHub, isSpokeIsAllowanceValidParamsStellar, isStacksChainKeyType, isStakeOrchestrationError, isStakingAllowanceCheckError, isStakingApproveError, isStakingCreateIntentError, isStakingError, isStakingInfoFetchError, isStakingOrchestrationError, isStellarChainKeyType, isStellarWalletProviderType, isSubmitSwapTxResponse, isSubmitSwapTxStatusResponse, isSuiChainKeyType, isSwapCreateIntentError, isSwapError, isUndefinedOrValidWalletProviderForChainKey, isUnifiedBnUSDMigrateParams, leverageYieldInvariant, lookupFailed, mapRelayFailure, mergeSodaxConfig, messageOf, migrationInvariant, mintPositionParamsAbi, mmInvariant, modifyLiquidityParamsAbi, nativeToUSD, normalize, normalizeBN, normalizePsbtToBase64, normalizeSignatureToBase64, normalizedToUsd, pancakeSwapInfinityDefaultHookAbi, pancakeSwapInfinityPoolManagerAbi, pancakeSwapInfinityPositionManagerAbi, parseToStroops, parseTokenArrayFromJson, partnerInvariant, permit2Abi, poolAbi, poolKeyAbi, randomUint256, rayDiv, rayMul, rayPow, rayToWad, recoveryInvariant, relayTxAndWaitPacket, requestAddress, requestJsonRpc, requestSigning, resolveLogger, retry, reverseEncodeAddress, serializeAddressData, silentLogger, sleep, sodaxInvariant, sonicWalletFactoryAbi, spokeAssetManagerAbi, stakedSodaAbi, stakingInvariant, stakingRouterAbi, stataTokenFactoryAbi, submitTransaction, swapExactInSingleParamsAbi, swapInvariant, uiPoolDataAbi, universalRouterAbi, unknownFailed, valueToBigNumber, valueToZDBigNumber, variableDebtTokenAbi, vaultTokenAbi, verifyFailed, wadToRay, waitForStacksTransaction, waitForTransactionReceipt, waitUntilIntentExecuted, walletFactoryAbi, wrappedSonicAbi };
|