@sodax/sdk 2.0.0-rc.17 → 2.0.0-rc.18
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 +1744 -875
- package/dist/index.d.cts +262 -9
- package/dist/index.d.ts +262 -9
- package/dist/index.mjs +1743 -876
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { IConfigApi, ApiConfig, SodaxLogger, Result, SubmitSwapTxRequest, SubmitSwapTxResponse, GetSubmitSwapTxStatusParams, SubmitSwapTxStatusResponse, Address, GetAllConfigApiResponse, GetChainsApiResponse, GetSwapTokensApiResponse, SpokeChainKey, GetSwapTokensByChainIdApiResponse, GetMoneyMarketTokensApiResponse, GetMoneyMarketReserveAssetsApiResponse, GetMoneyMarketTokensByChainIdApiResponse, GetRelayChainIdMapApiResponse, GetSpokeChainConfigApiResponse, PartnerFee, SodaxConfig, SodaxOptions, XToken, OriginalAssetAddress, IntentRelayChainId, HubChainKey, HubConfig, PoolKey, SpokeChainConfig, RelayConfig, SolverConfig, SwapsConfig, BridgeConfig, MoneyMarketConfig, LeverageYieldConfig, DexConfig, GetSpokeChainConfigType, SodaxDefaultConfig, EvmContractCall, Hex, IEvmWalletProvider, EvmRawTransactionReceipt, QuoteType, EvmChainKey, DeepPartial, WalletProviderSlot, TxReturnType, ChainType, GetChainType, SolanaRawTransactionReceipt, StellarSorobanTransactionReceipt, IconTransactionResult, SuiRawTransactionReceipt, InjectiveRawTransactionReceipt, NearRawTransactionReceipt, StacksRawTransactionReceipt, BitcoinRawTransactionReceipt, GetAddressType, HubAddress, GetTokenAddressType, EvmSpokeOnlyChainKey, StellarChainKey, HookKind, 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, InjectiveCoin, 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 } from '@sodax/types';
|
|
1
|
+
import { SodaxFeature, IConfigApi, ApiConfig, SodaxLogger, Result, SubmitSwapTxRequest, SubmitSwapTxResponse, GetSubmitSwapTxStatusParams, SubmitSwapTxStatusResponse, Address, GetAllConfigApiResponse, GetChainsApiResponse, GetSwapTokensApiResponse, SpokeChainKey, GetSwapTokensByChainIdApiResponse, GetMoneyMarketTokensApiResponse, GetMoneyMarketReserveAssetsApiResponse, GetMoneyMarketTokensByChainIdApiResponse, GetRelayChainIdMapApiResponse, GetSpokeChainConfigApiResponse, AnalyticsDetailLevel, AnalyticsEventPhase, AnalyticsOption, PartnerFee, SodaxConfig, SodaxOptions, XToken, OriginalAssetAddress, IntentRelayChainId, HubChainKey, HubConfig, PoolKey, SpokeChainConfig, RelayConfig, SolverConfig, SwapsConfig, BridgeConfig, MoneyMarketConfig, LeverageYieldConfig, DexConfig, GetSpokeChainConfigType, SodaxDefaultConfig, EvmContractCall, Hex, IEvmWalletProvider, EvmRawTransactionReceipt, QuoteType, EvmChainKey, DeepPartial, WalletProviderSlot, TxReturnType, ChainType, GetChainType, SolanaRawTransactionReceipt, StellarSorobanTransactionReceipt, IconTransactionResult, SuiRawTransactionReceipt, InjectiveRawTransactionReceipt, NearRawTransactionReceipt, StacksRawTransactionReceipt, BitcoinRawTransactionReceipt, GetAddressType, HubAddress, GetTokenAddressType, EvmSpokeOnlyChainKey, StellarChainKey, HookKind, 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, InjectiveCoin, 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 } from '@sodax/types';
|
|
2
2
|
export * from '@sodax/types';
|
|
3
|
+
export { SodaxFeature } from '@sodax/types';
|
|
3
4
|
import * as viem from 'viem';
|
|
4
5
|
import { Hex as Hex$1, Chain, Address as Address$1, PublicClient, HttpTransport, Hash, GetLogsReturnType } from 'viem';
|
|
5
6
|
import { StacksNetwork, ClarityValue } from '@sodax/libs/stacks/core';
|
|
@@ -30,6 +31,7 @@ import BigNumber$1 from 'bignumber.js';
|
|
|
30
31
|
* The closed-union type `SodaxErrorCode` is the default generic of `SodaxError<C>`, so any
|
|
31
32
|
* throw with an unlisted string code is a compile error — additions go through this file.
|
|
32
33
|
*/
|
|
34
|
+
|
|
33
35
|
/**
|
|
34
36
|
* Reason-only error codes. Each code answers "what kind of failure was this?", not
|
|
35
37
|
* "which feature?".
|
|
@@ -58,11 +60,7 @@ import BigNumber$1 from 'bignumber.js';
|
|
|
58
60
|
* - `UNKNOWN` — last-resort catch in an outer `try`. Should be extremely rare in production.
|
|
59
61
|
*/
|
|
60
62
|
type SodaxErrorCode = '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';
|
|
61
|
-
|
|
62
|
-
* The producing feature of a SodaxError. Required at construction so consumers /
|
|
63
|
-
* loggers always have a feature tag.
|
|
64
|
-
*/
|
|
65
|
-
type SodaxFeature = 'swap' | 'moneyMarket' | 'bridge' | 'staking' | 'migration' | 'dex' | 'partner' | 'recovery' | 'leverageYield';
|
|
63
|
+
|
|
66
64
|
/**
|
|
67
65
|
* Orchestration phase tag attached via `context.phase`. Canonical superset across all
|
|
68
66
|
* features — all features draw from this list rather than minting their own.
|
|
@@ -4851,6 +4849,113 @@ declare const ProtocolIntentsAbi: readonly [{
|
|
|
4851
4849
|
}];
|
|
4852
4850
|
}];
|
|
4853
4851
|
readonly stateMutability: "view";
|
|
4852
|
+
}, {
|
|
4853
|
+
readonly type: "function";
|
|
4854
|
+
readonly name: "cancelIntent";
|
|
4855
|
+
readonly inputs: readonly [{
|
|
4856
|
+
readonly name: "fromToken";
|
|
4857
|
+
readonly type: "address";
|
|
4858
|
+
readonly internalType: "address";
|
|
4859
|
+
}, {
|
|
4860
|
+
readonly name: "toToken";
|
|
4861
|
+
readonly type: "address";
|
|
4862
|
+
readonly internalType: "address";
|
|
4863
|
+
}];
|
|
4864
|
+
readonly outputs: readonly [];
|
|
4865
|
+
readonly stateMutability: "nonpayable";
|
|
4866
|
+
}, {
|
|
4867
|
+
readonly type: "function";
|
|
4868
|
+
readonly name: "getUserIntent";
|
|
4869
|
+
readonly inputs: readonly [{
|
|
4870
|
+
readonly name: "user";
|
|
4871
|
+
readonly type: "address";
|
|
4872
|
+
readonly internalType: "address";
|
|
4873
|
+
}, {
|
|
4874
|
+
readonly name: "fromToken";
|
|
4875
|
+
readonly type: "address";
|
|
4876
|
+
readonly internalType: "address";
|
|
4877
|
+
}, {
|
|
4878
|
+
readonly name: "toToken";
|
|
4879
|
+
readonly type: "address";
|
|
4880
|
+
readonly internalType: "address";
|
|
4881
|
+
}];
|
|
4882
|
+
readonly outputs: readonly [{
|
|
4883
|
+
readonly name: "intentHash";
|
|
4884
|
+
readonly type: "bytes32";
|
|
4885
|
+
readonly internalType: "bytes32";
|
|
4886
|
+
}];
|
|
4887
|
+
readonly stateMutability: "view";
|
|
4888
|
+
}, {
|
|
4889
|
+
readonly type: "function";
|
|
4890
|
+
readonly name: "getIntentDetails";
|
|
4891
|
+
readonly inputs: readonly [{
|
|
4892
|
+
readonly name: "intentHash";
|
|
4893
|
+
readonly type: "bytes32";
|
|
4894
|
+
readonly internalType: "bytes32";
|
|
4895
|
+
}];
|
|
4896
|
+
readonly outputs: readonly [{
|
|
4897
|
+
readonly name: "intent";
|
|
4898
|
+
readonly type: "tuple";
|
|
4899
|
+
readonly internalType: "struct Intents.Intent";
|
|
4900
|
+
readonly components: readonly [{
|
|
4901
|
+
readonly name: "intentId";
|
|
4902
|
+
readonly type: "uint256";
|
|
4903
|
+
readonly internalType: "uint256";
|
|
4904
|
+
}, {
|
|
4905
|
+
readonly name: "creator";
|
|
4906
|
+
readonly type: "address";
|
|
4907
|
+
readonly internalType: "address";
|
|
4908
|
+
}, {
|
|
4909
|
+
readonly name: "inputToken";
|
|
4910
|
+
readonly type: "address";
|
|
4911
|
+
readonly internalType: "address";
|
|
4912
|
+
}, {
|
|
4913
|
+
readonly name: "outputToken";
|
|
4914
|
+
readonly type: "address";
|
|
4915
|
+
readonly internalType: "address";
|
|
4916
|
+
}, {
|
|
4917
|
+
readonly name: "inputAmount";
|
|
4918
|
+
readonly type: "uint256";
|
|
4919
|
+
readonly internalType: "uint256";
|
|
4920
|
+
}, {
|
|
4921
|
+
readonly name: "minOutputAmount";
|
|
4922
|
+
readonly type: "uint256";
|
|
4923
|
+
readonly internalType: "uint256";
|
|
4924
|
+
}, {
|
|
4925
|
+
readonly name: "deadline";
|
|
4926
|
+
readonly type: "uint256";
|
|
4927
|
+
readonly internalType: "uint256";
|
|
4928
|
+
}, {
|
|
4929
|
+
readonly name: "allowPartialFill";
|
|
4930
|
+
readonly type: "bool";
|
|
4931
|
+
readonly internalType: "bool";
|
|
4932
|
+
}, {
|
|
4933
|
+
readonly name: "srcChain";
|
|
4934
|
+
readonly type: "uint256";
|
|
4935
|
+
readonly internalType: "uint256";
|
|
4936
|
+
}, {
|
|
4937
|
+
readonly name: "dstChain";
|
|
4938
|
+
readonly type: "uint256";
|
|
4939
|
+
readonly internalType: "uint256";
|
|
4940
|
+
}, {
|
|
4941
|
+
readonly name: "srcAddress";
|
|
4942
|
+
readonly type: "bytes";
|
|
4943
|
+
readonly internalType: "bytes";
|
|
4944
|
+
}, {
|
|
4945
|
+
readonly name: "dstAddress";
|
|
4946
|
+
readonly type: "bytes";
|
|
4947
|
+
readonly internalType: "bytes";
|
|
4948
|
+
}, {
|
|
4949
|
+
readonly name: "solver";
|
|
4950
|
+
readonly type: "address";
|
|
4951
|
+
readonly internalType: "address";
|
|
4952
|
+
}, {
|
|
4953
|
+
readonly name: "data";
|
|
4954
|
+
readonly type: "bytes";
|
|
4955
|
+
readonly internalType: "bytes";
|
|
4956
|
+
}];
|
|
4957
|
+
}];
|
|
4958
|
+
readonly stateMutability: "view";
|
|
4854
4959
|
}];
|
|
4855
4960
|
|
|
4856
4961
|
declare const sonicWalletFactoryAbi: readonly [{
|
|
@@ -7809,6 +7914,59 @@ declare class BackendApiService implements IConfigApi {
|
|
|
7809
7914
|
getBaseURL(): string;
|
|
7810
7915
|
}
|
|
7811
7916
|
|
|
7917
|
+
/**
|
|
7918
|
+
* Optional per-phase payload builders for {@link ResolvedAnalytics.trackResult}. Each is a lazy thunk
|
|
7919
|
+
* invoked only if its event actually emits, so payloads are never built when analytics is off.
|
|
7920
|
+
* `success` receives the resolved value, `failure` the `Result` error.
|
|
7921
|
+
*/
|
|
7922
|
+
interface AnalyticsActionData<T, E> {
|
|
7923
|
+
start?: () => Record<string, unknown>;
|
|
7924
|
+
success?: (value: T) => Record<string, unknown>;
|
|
7925
|
+
failure?: (error: E) => Record<string, unknown>;
|
|
7926
|
+
}
|
|
7927
|
+
/**
|
|
7928
|
+
* The SDK-internal analytics emitter, resolved once from the consumer's {@link AnalyticsOption} and
|
|
7929
|
+
* held on `ConfigService` (`config.analytics`).
|
|
7930
|
+
*
|
|
7931
|
+
* Services never touch the raw config — they call {@link ResolvedAnalytics.emit}, which is the only
|
|
7932
|
+
* gate. When analytics is disabled, off for a feature/action, or above the configured detail level,
|
|
7933
|
+
* the `build` thunk is never invoked, so event payloads are never constructed on hot feature paths.
|
|
7934
|
+
* This is what keeps feature code free of analytics overhead unless a consumer explicitly opts in.
|
|
7935
|
+
*/
|
|
7936
|
+
interface ResolvedAnalytics {
|
|
7937
|
+
/**
|
|
7938
|
+
* Whether an event for `feature`/`action` at `level` would be emitted. Call sites rarely need this
|
|
7939
|
+
* directly — {@link emit} checks it internally — but it is exposed for the rare case where even
|
|
7940
|
+
* deciding what to emit is itself costly. Omit `action` to ask whether the feature is tracked at all.
|
|
7941
|
+
*/
|
|
7942
|
+
isEnabled(feature: SodaxFeature, action?: string, level?: AnalyticsDetailLevel): boolean;
|
|
7943
|
+
/**
|
|
7944
|
+
* Emit one user-action event. `build` produces the optional structured payload and is invoked
|
|
7945
|
+
* lazily — only when the event passes the enabled/feature/action/level gate — so disabled analytics
|
|
7946
|
+
* costs nothing but a boolean check at the call site. A faulty consumer tracker can never break a
|
|
7947
|
+
* feature flow: delivery is wrapped and fire-and-forget.
|
|
7948
|
+
*/
|
|
7949
|
+
emit(feature: SodaxFeature, action: string, phase: AnalyticsEventPhase, build?: () => Record<string, unknown>, level?: AnalyticsDetailLevel): void;
|
|
7950
|
+
/**
|
|
7951
|
+
* Wrap a `Result`-returning action flow: emit `start` before `run`, then `success` or `failure`
|
|
7952
|
+
* from the resolved `Result` (and `failure` + rethrow if `run` throws), returning the `Result`
|
|
7953
|
+
* unchanged. This is the canonical way to instrument a feature method — one call at the boundary
|
|
7954
|
+
* covers every internal return point, so action code stays free of scattered emit calls.
|
|
7955
|
+
*/
|
|
7956
|
+
trackResult<T, E>(feature: SodaxFeature, action: string, run: () => Promise<Result<T, E>>, data?: AnalyticsActionData<T, E>): Promise<Result<T, E>>;
|
|
7957
|
+
}
|
|
7958
|
+
/** Disabled emitter: every gate is closed, `build` is never called, nothing is delivered. */
|
|
7959
|
+
declare const noopAnalytics: ResolvedAnalytics;
|
|
7960
|
+
/**
|
|
7961
|
+
* Resolve an {@link AnalyticsOption} (a config object, `false`, or `undefined`) into a concrete
|
|
7962
|
+
* {@link ResolvedAnalytics}.
|
|
7963
|
+
*
|
|
7964
|
+
* Defaults to {@link noopAnalytics} so analytics is **off** unless a consumer opts in with an
|
|
7965
|
+
* `AnalyticsConfig`. This mirrors `resolveLogger` but with the opposite default — logging is on by
|
|
7966
|
+
* default, analytics is off — per issue #175 ("no needless invocations unless explicitly enabled").
|
|
7967
|
+
*/
|
|
7968
|
+
declare function resolveAnalytics(option: AnalyticsOption | undefined): ResolvedAnalytics;
|
|
7969
|
+
|
|
7812
7970
|
type ConfigServiceConstructorParams = {
|
|
7813
7971
|
api: BackendApiService;
|
|
7814
7972
|
config: SodaxConfig;
|
|
@@ -7823,6 +7981,11 @@ type ConfigServiceConstructorParams = {
|
|
|
7823
7981
|
* in {@link ConfigService.initialize} never replaces it. Defaults to the console logger when omitted.
|
|
7824
7982
|
*/
|
|
7825
7983
|
logger?: SodaxLogger;
|
|
7984
|
+
/**
|
|
7985
|
+
* Pre-resolved analytics emitter. Like {@link logger}, held outside the swappable `SodaxConfig` so a
|
|
7986
|
+
* dynamic config fetch never replaces it. Defaults to the no-op (disabled) emitter when omitted.
|
|
7987
|
+
*/
|
|
7988
|
+
analytics?: ResolvedAnalytics;
|
|
7826
7989
|
/**
|
|
7827
7990
|
* Global partner fee (the `fee` option passed to `new Sodax(...)`). Held outside the swappable
|
|
7828
7991
|
* `SodaxConfig` — like {@link logger} — so a dynamic config fetch never replaces it. The backend
|
|
@@ -7842,6 +8005,12 @@ declare class ConfigService {
|
|
|
7842
8005
|
* {@link initialize}'s dynamic-config swap never clobbers it. Read by services via `config.logger`.
|
|
7843
8006
|
*/
|
|
7844
8007
|
readonly logger: SodaxLogger;
|
|
8008
|
+
/**
|
|
8009
|
+
* Analytics emitter. Resolved once at construction and kept independent of {@link sodax} so that
|
|
8010
|
+
* {@link initialize}'s dynamic-config swap never clobbers it. Read by services via `config.analytics`;
|
|
8011
|
+
* disabled (no-op) unless the consumer passed an `analytics` config to `new Sodax(...)`.
|
|
8012
|
+
*/
|
|
8013
|
+
readonly analytics: ResolvedAnalytics;
|
|
7845
8014
|
/**
|
|
7846
8015
|
* Global partner fee. Resolved once at construction and kept independent of {@link sodax} so that
|
|
7847
8016
|
* {@link initialize}'s dynamic-config swap never clobbers it. The backend never supplies it — it is
|
|
@@ -7858,7 +8027,7 @@ declare class ConfigService {
|
|
|
7858
8027
|
private stakedATokenAddressesSet;
|
|
7859
8028
|
private chainToSupportedTokenAddressMap;
|
|
7860
8029
|
private hubAssetToXTokenMap;
|
|
7861
|
-
constructor({ api, config, userConfig, logger, fee }: ConfigServiceConstructorParams);
|
|
8030
|
+
constructor({ api, config, userConfig, logger, analytics, fee }: ConfigServiceConstructorParams);
|
|
7862
8031
|
initialize(): Promise<Result<void>>;
|
|
7863
8032
|
getChains(): GetChainsApiResponse;
|
|
7864
8033
|
getSwapTokens(): GetSwapTokensApiResponse;
|
|
@@ -7869,6 +8038,14 @@ declare class ConfigService {
|
|
|
7869
8038
|
getMoneyMarketReserveAssets(): GetMoneyMarketReserveAssetsApiResponse;
|
|
7870
8039
|
isValidOriginalAssetAddress(chainId: SpokeChainKey, asset: OriginalAssetAddress): boolean;
|
|
7871
8040
|
getOriginalAssetAddress(chainId: SpokeChainKey, hubAsset: Address): OriginalAssetAddress | undefined;
|
|
8041
|
+
/**
|
|
8042
|
+
* Resolves the {@link XToken} descriptor (hub asset, vault, decimals) for a hub-asset address.
|
|
8043
|
+
*
|
|
8044
|
+
* Useful when a caller holds a hub asset directly on Sonic that has no spoke-token entry under
|
|
8045
|
+
* the hub chain — e.g. a partner BTC fee held as the BTC hub asset, which only exists as a spoke
|
|
8046
|
+
* token on Bitcoin. Returns `undefined` when the address is not a known hub asset.
|
|
8047
|
+
*/
|
|
8048
|
+
getXTokenFromHubAsset(hubAsset: string): XToken | undefined;
|
|
7872
8049
|
getSpokeTokenFromOriginalAssetAddress(chainId: SpokeChainKey, originalAssetAddress: OriginalAssetAddress): XToken | undefined;
|
|
7873
8050
|
isValidHubAsset(hubAsset: Address): boolean;
|
|
7874
8051
|
/**
|
|
@@ -13060,6 +13237,16 @@ declare class BridgeService {
|
|
|
13060
13237
|
* contains the hub wallet address and encoded hub execution payload needed for relay.
|
|
13061
13238
|
*/
|
|
13062
13239
|
createBridgeIntent<K extends SpokeChainKey, Raw extends boolean>(_params: BridgeParams<K, Raw>): Promise<Result<IntentTxResult<K, Raw>, BridgeCreateIntentError>>;
|
|
13240
|
+
/**
|
|
13241
|
+
* Resolves a bridge endpoint's {@link XToken} descriptor from a chain key + token address.
|
|
13242
|
+
*
|
|
13243
|
+
* Spoke endpoints (and hub-native tokens such as USDC/WETH/S whose on-chain address equals their
|
|
13244
|
+
* hub asset) resolve by original asset address. On the hub a caller may instead hold a hub asset
|
|
13245
|
+
* that has no spoke-token entry under the hub chain — e.g. a partner BTC fee held as the BTC hub
|
|
13246
|
+
* asset, whose only spoke-token entry lives on Bitcoin. Resolve those by hub-asset address so the
|
|
13247
|
+
* Sonic-sourced "withdraw directly" bridge can find the matching vault/decimals.
|
|
13248
|
+
*/
|
|
13249
|
+
private resolveBridgeEndpointToken;
|
|
13063
13250
|
/**
|
|
13064
13251
|
* Encodes the hub-side execution payload for a bridge operation.
|
|
13065
13252
|
*
|
|
@@ -15839,6 +16026,18 @@ type PartnerFeeClaimSwapParams = {
|
|
|
15839
16026
|
timeout?: number;
|
|
15840
16027
|
};
|
|
15841
16028
|
type PartnerFeeClaimSwapAction<K extends SpokeChainKey, Raw extends boolean> = SpokeExecActionParams<K, Raw, PartnerFeeClaimSwapParams>;
|
|
16029
|
+
type PartnerFeeClaimCancelParams = {
|
|
16030
|
+
srcChainKey: HubChainKey;
|
|
16031
|
+
srcAddress: Address$1;
|
|
16032
|
+
fromToken: Address$1;
|
|
16033
|
+
toToken: Address$1;
|
|
16034
|
+
};
|
|
16035
|
+
type PartnerFeeClaimCancelAction<K extends SpokeChainKey, Raw extends boolean> = SpokeExecActionParams<K, Raw, PartnerFeeClaimCancelParams>;
|
|
16036
|
+
type GetUserIntentParams = {
|
|
16037
|
+
user: Address$1;
|
|
16038
|
+
fromToken: Address$1;
|
|
16039
|
+
toToken: Address$1;
|
|
16040
|
+
};
|
|
15842
16041
|
type PartnerFeeClaimServiceConstructorParams = {
|
|
15843
16042
|
config: ConfigService;
|
|
15844
16043
|
hubProvider: HubProvider;
|
|
@@ -15973,6 +16172,11 @@ declare class PartnerFeeClaimService {
|
|
|
15973
16172
|
* This is the low-level building block. Use `swap` for the full flow that also waits for
|
|
15974
16173
|
* the solver to execute the intent.
|
|
15975
16174
|
*
|
|
16175
|
+
* Guards against same-token intents: if the configured output token equals `fromToken` the solver
|
|
16176
|
+
* cannot fill the swap, so the call is rejected with `VALIDATION_FAILED` before any transaction is
|
|
16177
|
+
* built. The guard fails closed — if the preference lookup fails the call returns that error rather
|
|
16178
|
+
* than submitting an intent that may become unfillable.
|
|
16179
|
+
*
|
|
15976
16180
|
* @param _params - Action descriptor containing:
|
|
15977
16181
|
* - `params.srcChainKey` — must be the hub chain key (Sonic).
|
|
15978
16182
|
* - `params.srcAddress` — partner's EVM address; also used as the intent creator.
|
|
@@ -16003,10 +16207,59 @@ declare class PartnerFeeClaimService {
|
|
|
16003
16207
|
*
|
|
16004
16208
|
* On failure the `error` is tagged:
|
|
16005
16209
|
* - `WAIT_INTENT_AUTO_SWAP_FAILED` — transaction was submitted but receipt polling failed.
|
|
16006
|
-
* - Error from `createIntentAutoSwap` — if the initial submission failed
|
|
16210
|
+
* - Error from `createIntentAutoSwap` — if the initial submission failed, including
|
|
16211
|
+
* `VALIDATION_FAILED` when the output token equals the fee token (same-token guard) or the
|
|
16212
|
+
* preference lookup that backs the guard fails.
|
|
16007
16213
|
* - Error from `SolverApiService.postExecution` — if the solver notification failed.
|
|
16008
16214
|
*/
|
|
16009
16215
|
swap(_params: PartnerFeeClaimSwapAction<HubChainKey, false>): Promise<Result<IntentAutoSwapResult>>;
|
|
16216
|
+
/**
|
|
16217
|
+
* Cancels a partner fee-claim auto-swap intent and refunds the input token to the partner.
|
|
16218
|
+
*
|
|
16219
|
+
* This targets the ProtocolIntents contract's own `cancelIntent(fromToken, toToken)`, which is
|
|
16220
|
+
* the only authorized cancel path for partner auto-swap intents: the intent's `creator` is the
|
|
16221
|
+
* ProtocolIntents contract (not the partner), so the generic `SwapService.cancelIntent` reverts
|
|
16222
|
+
* with `Unauthorized()`. ProtocolIntents looks up the caller's intent for the token pair, cancels
|
|
16223
|
+
* it in the main intents contract (as the creator), and transfers the locked `inputAmount` back
|
|
16224
|
+
* to the partner (`msg.sender`).
|
|
16225
|
+
*
|
|
16226
|
+
* Use this to recover funds stuck in an unfillable intent — most commonly a same-token claim
|
|
16227
|
+
* (`fromToken === toToken`) the solver refused to fill (see the guard in {@link swap}).
|
|
16228
|
+
*
|
|
16229
|
+
* @param _params - Action descriptor containing:
|
|
16230
|
+
* - `params.srcChainKey` — must be the hub chain key (Sonic).
|
|
16231
|
+
* - `params.srcAddress` — the partner's EVM address; must match the intent's owner.
|
|
16232
|
+
* - `params.fromToken` — the stuck intent's input (fee) token, hub-chain address.
|
|
16233
|
+
* - `params.toToken` — the stuck intent's output token, hub-chain address.
|
|
16234
|
+
* - `raw` — when `true`, returns the unsigned transaction object instead of submitting it.
|
|
16235
|
+
* - `walletProvider` — required when `raw` is `false`; must be an EVM wallet provider.
|
|
16236
|
+
* @returns A `Result` containing the submitted transaction hash (`raw: false`) or the unsigned
|
|
16237
|
+
* raw transaction (`raw: true`).
|
|
16238
|
+
*/
|
|
16239
|
+
cancelIntent<Raw extends boolean>(_params: PartnerFeeClaimCancelAction<HubChainKey, Raw>): Promise<Result<TxReturnType<HubChainKey, Raw>>>;
|
|
16240
|
+
/**
|
|
16241
|
+
* Returns the stored intent hash for a partner's `(user, fromToken, toToken)` token pair.
|
|
16242
|
+
*
|
|
16243
|
+
* A non-zero hash means an auto-swap intent currently exists for that pair (e.g. an unfilled
|
|
16244
|
+
* same-token claim) and can be cancelled via {@link cancelIntent}. A zero hash
|
|
16245
|
+
* (`0x000…0`) means there is no open intent for the pair.
|
|
16246
|
+
*
|
|
16247
|
+
* @param params.user - The partner's EVM address on Sonic.
|
|
16248
|
+
* @param params.fromToken - Input (fee) token, hub-chain address.
|
|
16249
|
+
* @param params.toToken - Output token, hub-chain address.
|
|
16250
|
+
* @returns A `Result` containing the intent hash, or an `Error` tagged `LOOKUP_FAILED`.
|
|
16251
|
+
*/
|
|
16252
|
+
getUserIntent({ user, fromToken, toToken }: GetUserIntentParams): Promise<Result<Hex, Error>>;
|
|
16253
|
+
/**
|
|
16254
|
+
* Reads the full {@link Intent} details for a stored intent hash from the ProtocolIntents contract.
|
|
16255
|
+
*
|
|
16256
|
+
* Useful for displaying a stuck intent before cancelling it — e.g. the locked `inputAmount` and
|
|
16257
|
+
* `inputToken`. Pair with {@link getUserIntent} to resolve the hash from a token pair.
|
|
16258
|
+
*
|
|
16259
|
+
* @param intentHash - The intent hash (from {@link getUserIntent}).
|
|
16260
|
+
* @returns A `Result` containing the `Intent`, or an `Error` tagged `LOOKUP_FAILED`.
|
|
16261
|
+
*/
|
|
16262
|
+
getIntentDetails(intentHash: Hex): Promise<Result<Intent, Error>>;
|
|
16010
16263
|
}
|
|
16011
16264
|
|
|
16012
16265
|
type PartnerServiceConfig = {
|
|
@@ -17266,4 +17519,4 @@ type DexErrorCode = LookupErrorCode;
|
|
|
17266
17519
|
type DexError = SodaxError<DexErrorCode>;
|
|
17267
17520
|
declare const isDexError: (e: unknown) => e is SodaxError<LookupErrorCode>;
|
|
17268
17521
|
|
|
17269
|
-
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, type BitcoinBoundExtras, 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 GetQuoteParams, type GetRelayRequestParamType, type GetRelayResponse, type GetSpokeServiceType, type GetTransactionPacketsParams, type GetTransactionPacketsResponse, type GetTxReceiptType, type GetUserRouterParams, HALF_RAY, HALF_WAD, type HanaWalletRequestEvent, type HanaWalletResponseEvent, type HookRequest, HookService, 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, IntentDataService, 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 RadfiResponseEnvelope, 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 SwapExtras, 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 };
|
|
17522
|
+
export { ALLOWANCE_CHECK_CODES, APPROVE_CODES, type AggregatedReserveData, type AllowanceCheckErrorCode, type AllowanceInfo, type AllowanceResponse, type AllowanceTransferDetails, type AnalyticsActionData, 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, type BitcoinBoundExtras, 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 GetQuoteParams, type GetRelayRequestParamType, type GetRelayResponse, type GetSpokeServiceType, type GetTransactionPacketsParams, type GetTransactionPacketsResponse, type GetTxReceiptType, type GetUserIntentParams, type GetUserRouterParams, HALF_RAY, HALF_WAD, type HanaWalletRequestEvent, type HanaWalletResponseEvent, type HookRequest, HookService, 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, IntentDataService, 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, type PartnerFeeClaimCancelAction, type PartnerFeeClaimCancelParams, 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 RadfiResponseEnvelope, 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 ResolvedAnalytics, 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 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 SwapExtras, 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, noopAnalytics, normalize, normalizeBN, normalizePsbtToBase64, normalizeSignatureToBase64, normalizedToUsd, pancakeSwapInfinityDefaultHookAbi, pancakeSwapInfinityPoolManagerAbi, pancakeSwapInfinityPositionManagerAbi, parseToStroops, parseTokenArrayFromJson, partnerInvariant, permit2Abi, poolAbi, poolKeyAbi, randomUint256, rayDiv, rayMul, rayPow, rayToWad, recoveryInvariant, relayTxAndWaitPacket, requestAddress, requestJsonRpc, requestSigning, resolveAnalytics, 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 };
|