@sodax/sdk 2.1.0 → 2.2.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -7
- package/dist/index.cjs +1067 -175
- package/dist/index.d.cts +529 -27
- package/dist/index.d.ts +529 -27
- package/dist/index.mjs +1061 -178
- package/package.json +6 -6
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { SodaxFeature, ISwapsApiV2, Result, SwapsApiConfig, SodaxLogger, GetSwapTokensResponseV2, GetSwapTokensByChainResponseV2, QuoteRequestV2, QuoteQueryV2, QuoteResponseV2, DeadlineQueryV2, DeadlineResponseV2, CreateIntentParamsV2, AllowanceCheckResponseV2, ApproveResponseV2, CreateIntentResponseV2, SubmitIntentRequestV2, SubmitIntentResponseV2, StatusRequestV2, StatusResponseV2, CancelIntentRequestV2, CancelIntentResponseV2, IntentHashRequestV2, IntentHashResponseV2, IntentPacketRequestV2, IntentPacketResponseV2, IntentExtraDataRequestV2, IntentExtraDataResponseV2, IntentStateV2, GetIntentResponseV2, CreateLimitOrderParamsV2, CreateLimitOrderResponseV2, GasEstimateRequestV2, GasEstimateResponseV2, FeeQueryV2, FeeResponseV2, SubmitTxRequestV2, SubmitTxResponseV2, SubmitTxStatusQueryV2, SubmitTxStatusResponseV2, IStellarSponsoringApi, SponsoringApiConfig, StellarSponsorConfig, StellarSponsoredAccountRequest, StellarSponsoredAccountResponse, IBridgeApiV2, BaseApiConfig, GetBridgeTokensResponseV2, GetBridgeTokensByChainResponseV2, CreateBridgeIntentParamsV2, BridgeAllowanceCheckResponseV2, BridgeApproveResponseV2, CreateBridgeIntentResponseV2, BridgeSubmitTxRequestV2, BridgeSubmitTxResponseV2, BridgeSubmitTxStatusQueryV2, BridgeSubmitTxStatusResponseV2, BridgeFeeRequestV2, BridgeFeeResponseV2, BridgeQuoteRequestV2, BridgeableAmountResponseV2, BridgeableCheckResponseV2, BitcoinBoundExtrasV2, PartnerFeeV2, IConfigApiV1, ApiConfig, Address, GetAllConfigApiResponse, GetChainsApiResponse, GetSwapTokensApiResponse, SpokeChainKey, GetSwapTokensByChainIdApiResponse, GetMoneyMarketTokensApiResponse, GetMoneyMarketReserveAssetsApiResponse, GetMoneyMarketTokensByChainIdApiResponse, GetRelayChainIdMapApiResponse, GetSpokeChainConfigApiResponse, AnalyticsDetailLevel, AnalyticsEventPhase, AnalyticsOption, PartnerFee, RadfiSigner, 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, BitcoinRawTransaction, NearChainKey, FillData, NearRawTransaction, INearWalletProvider, SuiTransport, SuiPaginatedCoins, SuiChainKey, SuiExecutionResult, SuiGasEstimate, IStellarWalletProvider, StellarGasEstimate, SolanaChainKey, SolanaGasEstimate, SolanaBase58PublicKey, SolanaRawTransactionInstruction, SolanaSerializedTransaction, SolanaRpcResponseAndContext, SolanaTokenAmount, IconChainKey, IconGasEstimate, InjectiveChainKey, InjectiveGasEstimate, JsonObject, InjectiveCoin, InjectiveRawTransaction, IInjectiveWalletProvider, InjectiveExecuteResponse, GetEstimateGasReturnType, SuiTransaction, SuiWaitForTransactionParams, IconAddress, IWalletProvider, EvmSpokeChainConfig, PartnerFeeAmount, PartnerFeePercentage, GetWalletProviderType, SodaxLoggerOption, SubmitTxStatusDataV2, SolverIntentStatusResponse, SpokeExecActionParams, FeeAmount, Hash as Hash$1, SolverIntentQuoteRequest, SolverIntentQuoteResponse, SolverErrorResponse, SolverIntentStatusRequest, SolverExecutionRequest, SolverExecutionResponse, IconEoaAddress, IcxTokenType, IconContractAddress, BridgeLimit, UserUnstakeInfo, ConcentratedLiquidityConfig, LeverageYieldVault, SponsoringApiErrorCode } from '@sodax/types';
|
|
2
2
|
export * from '@sodax/types';
|
|
3
3
|
export { SodaxFeature } from '@sodax/types';
|
|
4
|
+
import * as v from 'valibot';
|
|
4
5
|
import * as viem from 'viem';
|
|
5
6
|
import { Hex as Hex$1, Chain, Address as Address$1, PublicClient, Hash, HttpTransport, GetLogsReturnType } from 'viem';
|
|
6
7
|
import { StacksNetwork, ClarityValue } from '@sodax/libs/stacks/core';
|
|
@@ -10,13 +11,12 @@ import { Transaction, TransactionResult } from '@mysten/sui/transactions';
|
|
|
10
11
|
import { rpc, Transaction as Transaction$1, Memo, MemoType, Operation, FeeBumpTransaction, Horizon, Account, xdr } from '@stellar/stellar-sdk';
|
|
11
12
|
import { Connection as Connection$1, PublicKey, TransactionInstruction } from '@solana/web3.js';
|
|
12
13
|
import { IconService } from 'icon-sdk-js';
|
|
13
|
-
import { ChainGrpcWasmApi, TxGrpcApi } from '@injectivelabs/sdk-ts';
|
|
14
|
+
import { ChainGrpcWasmApi, IndexerGrpcAccountPortfolioApi, TxGrpcApi } from '@injectivelabs/sdk-ts';
|
|
14
15
|
import { NetworkEndpoints } from '@injectivelabs/networks';
|
|
15
16
|
import * as _coral_xyz_anchor from '@coral-xyz/anchor';
|
|
16
17
|
import { AnchorProvider, Program } from '@coral-xyz/anchor';
|
|
17
18
|
import { Price, Token } from '@pancakeswap/swap-sdk-core';
|
|
18
19
|
import BigNumber$1 from 'bignumber.js';
|
|
19
|
-
import * as v from 'valibot';
|
|
20
20
|
export { SwapsApiError, SwapsApiErrorCode, SwapsApiErrorContext } from '@sodax/swaps-api';
|
|
21
21
|
|
|
22
22
|
/**
|
|
@@ -275,6 +275,7 @@ declare function mapRelayFailure(error: unknown, ctx: MapRelayFailureCtx): Sodax
|
|
|
275
275
|
* - {@link isFeatureError} — narrows by `feature` field for cross-feature consumer code.
|
|
276
276
|
* - {@link isCodeMember} — builds a per-method narrow guard from a `Set` of codes. Per-feature
|
|
277
277
|
* `errors.ts` modules use this to expose `isSupplyError`, `isCreateSwapIntentError`, etc.
|
|
278
|
+
* - {@link isAuthStatus} / {@link isAuthFailure} — terminal API-key rejection, by status or by error.
|
|
278
279
|
*
|
|
279
280
|
* The base {@link isSodaxError} guard lives in `./SodaxError` so it ships next to the class.
|
|
280
281
|
*/
|
|
@@ -302,6 +303,22 @@ declare function isFeatureError<F extends SodaxFeature>(feature: F): (e: unknown
|
|
|
302
303
|
* export const isSupplyError = isCodeMember<SupplyErrorCode>(SUPPLY_CODES);
|
|
303
304
|
*/
|
|
304
305
|
declare function isCodeMember<C extends SodaxErrorCode>(codes: ReadonlySet<C>): (e: unknown) => e is SodaxError<C>;
|
|
306
|
+
/**
|
|
307
|
+
* True for an HTTP status that only a corrected API key can resolve: `401` (missing or invalid key)
|
|
308
|
+
* and `403` (suspended organisation, or a key lacking the route's scope). The guard's `503` is
|
|
309
|
+
* deliberately excluded — that one is transient and IS retried (see
|
|
310
|
+
* `API_KEY_VERIFICATION_UNAVAILABLE_MESSAGE` in `@sodax/swaps-api`).
|
|
311
|
+
*/
|
|
312
|
+
declare function isAuthStatus(status: number | undefined): boolean;
|
|
313
|
+
/**
|
|
314
|
+
* True for a backend rejection that only a corrected API key can resolve — see {@link isAuthStatus}.
|
|
315
|
+
* Terminal: callers should surface it rather than retry or keep polling.
|
|
316
|
+
*
|
|
317
|
+
* Reads the status the service lifted onto `context`, so it works for any `SodaxError` carrying one.
|
|
318
|
+
* All `sodax.api` services lift HTTP status; the legacy solver transport retains `SolverErrorResponse`
|
|
319
|
+
* and is not recognized by `isAuthFailure`.
|
|
320
|
+
*/
|
|
321
|
+
declare function isAuthFailure(error: unknown): boolean;
|
|
305
322
|
|
|
306
323
|
/**
|
|
307
324
|
* Constructor helpers for the most common {@link SodaxError} shapes.
|
|
@@ -7497,6 +7514,8 @@ interface RequestConfig {
|
|
|
7497
7514
|
body?: string;
|
|
7498
7515
|
timeout?: number;
|
|
7499
7516
|
baseURL?: string;
|
|
7517
|
+
/** Honoured only via {@link resolveRequestConfig}; `makeRequest` expands `overrideConfig.apiKey`, not this field. */
|
|
7518
|
+
apiKey?: string;
|
|
7500
7519
|
}
|
|
7501
7520
|
/**
|
|
7502
7521
|
* Per-call overrides that take precedence over the `ApiConfig` the service
|
|
@@ -7507,6 +7526,11 @@ type RequestOverrideConfig = {
|
|
|
7507
7526
|
baseURL?: string;
|
|
7508
7527
|
timeout?: number;
|
|
7509
7528
|
headers?: Record<string, string>;
|
|
7529
|
+
/**
|
|
7530
|
+
* Per-call API key, sent as the `x-api-key` header. Wins over the service's configured key; an
|
|
7531
|
+
* explicit `headers['x-api-key']` on this same override wins over it.
|
|
7532
|
+
*/
|
|
7533
|
+
apiKey?: string;
|
|
7510
7534
|
};
|
|
7511
7535
|
/**
|
|
7512
7536
|
* Non-2xx failure with structured status and body. The legacy
|
|
@@ -7546,8 +7570,8 @@ type ResultifiedSwapsApiV2 = {
|
|
|
7546
7570
|
* canonical `SodaxError<'EXTERNAL_API_ERROR'>` (`feature: 'backend'`, `context.api: 'swaps'`,
|
|
7547
7571
|
* `context.endpoint`); the underlying `SwapsApiError` is preserved on `error.cause`.
|
|
7548
7572
|
*
|
|
7549
|
-
* Per-call request overrides (base URL, timeout, headers) can be passed as the optional
|
|
7550
|
-
* argument to any method via `RequestOverrideConfig`.
|
|
7573
|
+
* Per-call request overrides (base URL, timeout, headers, API key) can be passed as the optional
|
|
7574
|
+
* last argument to any method via `RequestOverrideConfig`.
|
|
7551
7575
|
*
|
|
7552
7576
|
* Reachable on the Sodax facade as `sodax.api.swaps`.
|
|
7553
7577
|
*/
|
|
@@ -7665,6 +7689,18 @@ declare class SwapsApiService implements ResultifiedSwapsApiV2 {
|
|
|
7665
7689
|
type ResultifiedSponsoringApi = {
|
|
7666
7690
|
[K in keyof IStellarSponsoringApi]: IStellarSponsoringApi[K] extends (...args: infer A) => Promise<infer R> ? (...args: [...A, config?: RequestOverrideConfig]) => Promise<Result<R, SodaxError<'EXTERNAL_API_ERROR'>>> : never;
|
|
7667
7691
|
};
|
|
7692
|
+
/** Construction options for {@link SponsoringApiService}. */
|
|
7693
|
+
type SponsoringApiServiceOptions = {
|
|
7694
|
+
/**
|
|
7695
|
+
* The instance-wide `new Sodax({ apiKey })`, which sponsoring inherits only when its effective
|
|
7696
|
+
* target is one of `inheritedApiKeyBaseURLs`. Deliberately not baked into the headers: a per-request
|
|
7697
|
+
* `baseURL` retargets the call while keeping the default headers, which would carry the credential
|
|
7698
|
+
* off-gateway. Outranked by the configured slice key (`SponsoringApiConfig.apiKey`) and by headers.
|
|
7699
|
+
*/
|
|
7700
|
+
inheritedApiKey?: string;
|
|
7701
|
+
/** Roots the inherited key may be sent to — the packaged sponsoring default and the shared gateway. */
|
|
7702
|
+
inheritedApiKeyBaseURLs?: readonly string[];
|
|
7703
|
+
};
|
|
7668
7704
|
/**
|
|
7669
7705
|
* Uncached HTTP client for the sponsoring API. Stellar orchestration and
|
|
7670
7706
|
* config caching belong to `SponsoringService`.
|
|
@@ -7676,7 +7712,14 @@ declare class SponsoringApiService implements ResultifiedSponsoringApi {
|
|
|
7676
7712
|
private readonly config;
|
|
7677
7713
|
private readonly headers;
|
|
7678
7714
|
private readonly logger;
|
|
7679
|
-
|
|
7715
|
+
private readonly inheritedApiKey;
|
|
7716
|
+
private readonly inheritedApiKeyBaseURLs;
|
|
7717
|
+
constructor(config: SponsoringApiConfig, logger?: SodaxLogger, options?: SponsoringApiServiceOptions);
|
|
7718
|
+
/**
|
|
7719
|
+
* The inherited instance key, but only for a request whose effective target is an allowed root.
|
|
7720
|
+
* Evaluated per call because a `RequestOverrideConfig.baseURL` retargets the request.
|
|
7721
|
+
*/
|
|
7722
|
+
private inheritedKeyFor;
|
|
7680
7723
|
/**
|
|
7681
7724
|
* Validate a response while preserving HTTP failures on `error.cause` for
|
|
7682
7725
|
* sponsor-error classification.
|
|
@@ -7740,7 +7783,7 @@ declare function toCreateBridgeIntentParamsV2(params: {
|
|
|
7740
7783
|
* `SodaxError<'EXTERNAL_API_ERROR'>` (`feature: 'backend'`, `context.api: 'bridge'`)
|
|
7741
7784
|
* in the `error` field; the underlying failure is preserved on `error.cause`.
|
|
7742
7785
|
*
|
|
7743
|
-
* Per-call request overrides (base URL, timeout, headers) can be passed as the
|
|
7786
|
+
* Per-call request overrides (base URL, timeout, headers, API key) can be passed as the
|
|
7744
7787
|
* optional last argument to any method via `RequestOverrideConfig`.
|
|
7745
7788
|
*
|
|
7746
7789
|
* The Bridge API hangs off the shared gateway root as `/bridge/*` — a sibling of the data API's `/be`
|
|
@@ -7860,6 +7903,20 @@ declare class BridgeApiService implements ResultifiedBridgeApiV2 {
|
|
|
7860
7903
|
getTimeout(): number;
|
|
7861
7904
|
}
|
|
7862
7905
|
|
|
7906
|
+
/** An `intent-filled` entry in `IntentResponse.events`. Narrow with `isFillEvent`. */
|
|
7907
|
+
declare const FillEventSchema: v.ObjectSchema<{
|
|
7908
|
+
readonly eventType: v.LiteralSchema<"intent-filled", undefined>;
|
|
7909
|
+
readonly txHash: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>]>;
|
|
7910
|
+
readonly intentState: v.ObjectSchema<{
|
|
7911
|
+
readonly remainingInput: v.StringSchema<undefined>;
|
|
7912
|
+
}, undefined>;
|
|
7913
|
+
}, undefined>;
|
|
7914
|
+
/**
|
|
7915
|
+
* Candle bucket sizes the oracle serves (60s / 300s / 3600s / 86400s). Runtime source of truth for
|
|
7916
|
+
* the public `OracleCandleInterval` union, which is derived from it in `BackendApiService.ts`.
|
|
7917
|
+
*/
|
|
7918
|
+
declare const ORACLE_CANDLE_INTERVALS: readonly ["1m", "5m", "1h", "1d"];
|
|
7919
|
+
|
|
7863
7920
|
/** Full details of a single swap intent as stored and returned by the backend. */
|
|
7864
7921
|
interface IntentResponse {
|
|
7865
7922
|
intentHash: string;
|
|
@@ -7979,6 +8036,53 @@ interface MoneyMarketBorrowers {
|
|
|
7979
8036
|
offset: number;
|
|
7980
8037
|
limit: number;
|
|
7981
8038
|
}
|
|
8039
|
+
/** Interval keys accepted by the oracle candles endpoint (bucket sizes 60s / 300s / 3600s / 86400s). */
|
|
8040
|
+
type OracleCandleInterval = (typeof ORACLE_CANDLE_INTERVALS)[number];
|
|
8041
|
+
/** One selectable candle interval in the oracle markets discovery payload. */
|
|
8042
|
+
interface OracleMarketInterval {
|
|
8043
|
+
/**
|
|
8044
|
+
* Interval id for {@link BackendApiService.getOracleCandles}. Typed `string`, not
|
|
8045
|
+
* `OracleCandleInterval`: discovery must survive the backend adding an interval this SDK version
|
|
8046
|
+
* does not know, so membership-test against `ORACLE_CANDLE_INTERVALS` before passing it on.
|
|
8047
|
+
*/
|
|
8048
|
+
key: string;
|
|
8049
|
+
label: string;
|
|
8050
|
+
seconds: number;
|
|
8051
|
+
}
|
|
8052
|
+
/** Discovery payload for the oracle candle store: quote currency, selectable intervals, and covered symbols. */
|
|
8053
|
+
interface OracleMarketsResponse {
|
|
8054
|
+
quote: string;
|
|
8055
|
+
intervals: OracleMarketInterval[];
|
|
8056
|
+
symbols: string[];
|
|
8057
|
+
}
|
|
8058
|
+
/**
|
|
8059
|
+
* One USD OHLC bucket. `timestamp` is the bucket START in UNIX seconds; prices are USD decimal
|
|
8060
|
+
* strings. Treat `final === false` as "still forming" — the backend sends it only on the current
|
|
8061
|
+
* bucket and omits it on closed ones, so absent (or `true`) means closed.
|
|
8062
|
+
*/
|
|
8063
|
+
interface OracleCandle {
|
|
8064
|
+
timestamp: number;
|
|
8065
|
+
open: string;
|
|
8066
|
+
high: string;
|
|
8067
|
+
low: string;
|
|
8068
|
+
close: string;
|
|
8069
|
+
final?: boolean;
|
|
8070
|
+
}
|
|
8071
|
+
/** GET /oracle/candles response: the echoed query dimensions plus oldest-first candles (no volume field). */
|
|
8072
|
+
interface OracleCandlesResponse {
|
|
8073
|
+
symbol: string;
|
|
8074
|
+
quote: string;
|
|
8075
|
+
interval: OracleCandleInterval;
|
|
8076
|
+
candles: OracleCandle[];
|
|
8077
|
+
}
|
|
8078
|
+
/** Construction options for {@link BackendApiService}. */
|
|
8079
|
+
type BackendApiServiceOptions = {
|
|
8080
|
+
/**
|
|
8081
|
+
* Config-level API key for every gateway service (`new Sodax({ apiKey })`), sent as the `x-api-key`
|
|
8082
|
+
* header. Sponsoring receives it only when its target is an allowed root — see the constructor.
|
|
8083
|
+
*/
|
|
8084
|
+
apiKey?: string;
|
|
8085
|
+
};
|
|
7982
8086
|
/**
|
|
7983
8087
|
* HTTP client for the SODAX backend API.
|
|
7984
8088
|
*
|
|
@@ -7992,6 +8096,7 @@ interface MoneyMarketBorrowers {
|
|
|
7992
8096
|
* - **Solver orderbook** — read open intents waiting to be filled.
|
|
7993
8097
|
* - **Money market** — query per-user positions, per-reserve asset stats,
|
|
7994
8098
|
* and paginated borrower/supplier lists.
|
|
8099
|
+
* - **Oracle** — USD OHLC candle discovery and reads for charting.
|
|
7995
8100
|
*
|
|
7996
8101
|
* All public methods return `Promise<Result<T>>` — they never throw. On network
|
|
7997
8102
|
* failure, timeout, non-2xx HTTP response, or unexpected response shape the
|
|
@@ -7999,7 +8104,7 @@ interface MoneyMarketBorrowers {
|
|
|
7999
8104
|
* (`feature: 'backend'`, `context.api: 'backend'`) in the `error` field; the
|
|
8000
8105
|
* underlying failure is preserved on `error.cause`.
|
|
8001
8106
|
*
|
|
8002
|
-
* Per-call request overrides (base URL, timeout, headers) can be passed as
|
|
8107
|
+
* Per-call request overrides (base URL, timeout, headers, API key) can be passed as
|
|
8003
8108
|
* the optional last argument to any method via `RequestOverrideConfig`.
|
|
8004
8109
|
*/
|
|
8005
8110
|
declare class BackendApiService implements IConfigApiV1 {
|
|
@@ -8022,7 +8127,7 @@ declare class BackendApiService implements IConfigApiV1 {
|
|
|
8022
8127
|
* left exactly as given rather than having a real path segment eaten.
|
|
8023
8128
|
*/
|
|
8024
8129
|
private readonly trimsLegacyOverrides;
|
|
8025
|
-
constructor(config: ApiConfig, logger?: SodaxLogger);
|
|
8130
|
+
constructor(config: ApiConfig, logger?: SodaxLogger, options?: BackendApiServiceOptions);
|
|
8026
8131
|
/**
|
|
8027
8132
|
* Issue the HTTP call for a route.
|
|
8028
8133
|
*
|
|
@@ -8168,6 +8273,39 @@ declare class BackendApiService implements IConfigApiV1 {
|
|
|
8168
8273
|
offset: string;
|
|
8169
8274
|
limit: string;
|
|
8170
8275
|
}, config?: RequestOverrideConfig): Promise<Result<MoneyMarketBorrowers>>;
|
|
8276
|
+
/**
|
|
8277
|
+
* Fetch the oracle candle store's discovery payload: the quote currency (currently always
|
|
8278
|
+
* `"USD"`), the selectable candle intervals, and the canonical symbols that have candle data.
|
|
8279
|
+
*
|
|
8280
|
+
* Use this to populate a symbol picker and interval switcher before calling
|
|
8281
|
+
* {@link getOracleCandles}.
|
|
8282
|
+
*
|
|
8283
|
+
* @returns `Result<OracleMarketsResponse>` — on success, `{ quote, intervals, symbols }`.
|
|
8284
|
+
*/
|
|
8285
|
+
getOracleMarkets(config?: RequestOverrideConfig): Promise<Result<OracleMarketsResponse>>;
|
|
8286
|
+
/**
|
|
8287
|
+
* Fetch USD OHLC candles for a symbol over the half-open time range `[from, to)`.
|
|
8288
|
+
*
|
|
8289
|
+
* `from` and `to` are UNIX **seconds** (integers); `to` is exclusive and must exceed `from`,
|
|
8290
|
+
* and the range may cover at most 5000 buckets of the requested interval (invalid or wider
|
|
8291
|
+
* ranges fail with HTTP 400). A valid range with no stored candles resolves `ok` with
|
|
8292
|
+
* `candles: []`; an unknown symbol currently does the same rather than returning 404. The last
|
|
8293
|
+
* candle may still be forming; re-poll while its `final === false`.
|
|
8294
|
+
* Responses are cached server-side for roughly 10 seconds per distinct URL.
|
|
8295
|
+
*
|
|
8296
|
+
* @param params.symbol - Canonical symbol, exact case, from {@link getOracleMarkets} (e.g. `"ETH"`).
|
|
8297
|
+
* @param params.interval - Candle bucket size: `'1m' | '5m' | '1h' | '1d'`.
|
|
8298
|
+
* @param params.from - Range start, UNIX seconds, inclusive.
|
|
8299
|
+
* @param params.to - Range end, UNIX seconds, exclusive.
|
|
8300
|
+
* @returns `Result<OracleCandlesResponse>` — on success, the echoed query dimensions and
|
|
8301
|
+
* oldest-first candles with USD decimal-string prices (no volume field).
|
|
8302
|
+
*/
|
|
8303
|
+
getOracleCandles(params: {
|
|
8304
|
+
symbol: string;
|
|
8305
|
+
interval: OracleCandleInterval;
|
|
8306
|
+
from: number;
|
|
8307
|
+
to: number;
|
|
8308
|
+
}, config?: RequestOverrideConfig): Promise<Result<OracleCandlesResponse>>;
|
|
8171
8309
|
/**
|
|
8172
8310
|
* Fetch the complete SODAX runtime configuration in a single request.
|
|
8173
8311
|
*
|
|
@@ -8374,6 +8512,13 @@ type ConfigServiceConstructorParams = {
|
|
|
8374
8512
|
* never supplies it; it is purely a client-side option.
|
|
8375
8513
|
*/
|
|
8376
8514
|
fee?: PartnerFee;
|
|
8515
|
+
/**
|
|
8516
|
+
* Global backend API key (the `apiKey` option passed to `new Sodax(...)`). Held outside the
|
|
8517
|
+
* swappable `SodaxConfig` — like {@link fee} — so a dynamic config fetch never replaces it. Sent as
|
|
8518
|
+
* the `x-api-key` header on every backend API request; read here by the swap, leverage-yield, and
|
|
8519
|
+
* partner solver flows, whose transport does not go through `BackendApiService`.
|
|
8520
|
+
*/
|
|
8521
|
+
apiKey?: string;
|
|
8377
8522
|
/**
|
|
8378
8523
|
* RadFi/Bound request signer (the `radfi.signRequest` option passed to `new Sodax(...)`). Held
|
|
8379
8524
|
* outside the swappable `SodaxConfig` — like {@link logger} — so a dynamic config fetch never
|
|
@@ -8403,6 +8548,13 @@ declare class ConfigService {
|
|
|
8403
8548
|
* a client-side option set via `new Sodax({ fee })`. Per-feature overrides live on the feature config.
|
|
8404
8549
|
*/
|
|
8405
8550
|
readonly fee: PartnerFee | undefined;
|
|
8551
|
+
/**
|
|
8552
|
+
* Global backend API key. Resolved once at construction and kept independent of {@link sodax} so
|
|
8553
|
+
* that {@link initialize}'s dynamic-config swap never clobbers it. The backend never supplies it —
|
|
8554
|
+
* it is a client-side option set via `new Sodax({ apiKey })`. Never logged; read here by the swap,
|
|
8555
|
+
* leverage-yield, and partner solver flows, whose transport does not go through `BackendApiService`.
|
|
8556
|
+
*/
|
|
8557
|
+
readonly apiKey: string | undefined;
|
|
8406
8558
|
/**
|
|
8407
8559
|
* RadFi/Bound request signer. Resolved once at construction and kept independent of {@link sodax}
|
|
8408
8560
|
* so that {@link initialize}'s dynamic-config swap never clobbers it. Read by `BitcoinSpokeService`
|
|
@@ -8420,7 +8572,7 @@ declare class ConfigService {
|
|
|
8420
8572
|
private stakedATokenAddressesSet;
|
|
8421
8573
|
private chainToSupportedTokenAddressMap;
|
|
8422
8574
|
private hubAssetToXTokenMap;
|
|
8423
|
-
constructor({ api, config, userConfig, logger, analytics, fee, radfiSigner }: ConfigServiceConstructorParams);
|
|
8575
|
+
constructor({ api, config, userConfig, logger, analytics, fee, apiKey, radfiSigner, }: ConfigServiceConstructorParams);
|
|
8424
8576
|
initialize(): Promise<Result<void>>;
|
|
8425
8577
|
getChains(): GetChainsApiResponse;
|
|
8426
8578
|
getSwapTokens(): GetSwapTokensApiResponse;
|
|
@@ -8518,6 +8670,8 @@ declare function parseTokenArrayFromJson(input: unknown): readonly XToken[];
|
|
|
8518
8670
|
* and held on `ConfigService.fee`, where it acts as the per-feature fee fallback (`featureFee ?? fee`, via
|
|
8519
8671
|
* `ConfigService.swapPartnerFee` / `moneyMarketPartnerFee` / `bridgePartnerFee`). Config merging and
|
|
8520
8672
|
* effective-fee resolution are separate concerns, so the merge layer deliberately leaves `fee` alone.
|
|
8673
|
+
* The global `apiKey` is likewise kept off the merged config — `Sodax` strips it at the call site so the
|
|
8674
|
+
* credential never lands on the publicly readable `instanceConfig`; it is held on `ConfigService.apiKey`.
|
|
8521
8675
|
*/
|
|
8522
8676
|
declare function mergeSodaxConfig(base: SodaxDefaultConfig, override: SodaxOptions): SodaxConfig;
|
|
8523
8677
|
|
|
@@ -8801,6 +8955,50 @@ type GetDepositParams<ChainKey extends SpokeChainKey = SpokeChainKey> = {
|
|
|
8801
8955
|
srcAddress: GetAddressType<ChainKey>;
|
|
8802
8956
|
token: GetTokenAddressType<ChainKey>;
|
|
8803
8957
|
};
|
|
8958
|
+
/**
|
|
8959
|
+
* Parameters for reading a user's own wallet balance of a single token on a spoke chain.
|
|
8960
|
+
*
|
|
8961
|
+
* Unlike {@link GetDepositParams} (which reads the protocol asset-manager holding and keys
|
|
8962
|
+
* the token by raw address), this reads the balance held by `srcAddress` itself. `token` is
|
|
8963
|
+
* the full {@link XToken} so the reader can detect the native coin and resolve chain-specific
|
|
8964
|
+
* token identifiers (EVM erc20 address, Solana mint, Sui coinType, Soroban contract, …).
|
|
8965
|
+
*
|
|
8966
|
+
* The reader picks its RPC provider from `srcChainKey` and the on-chain identifier from
|
|
8967
|
+
* `token.address`; it never consults `token.chainKey`. Passing a token that does not live on
|
|
8968
|
+
* `srcChainKey` therefore reads the wrong chain and — on an EVM target — resolves to `0n` rather
|
|
8969
|
+
* than an error, so keep the chain key and the token list in step. This is NOT enforced: a few
|
|
8970
|
+
* config entries carry a `chainKey` that disagrees with where the address actually lives, so the
|
|
8971
|
+
* field is not reliable enough to validate against.
|
|
8972
|
+
*
|
|
8973
|
+
* Failure contract: this single-token read REJECTS on a network, RPC, or contract-read failure, and
|
|
8974
|
+
* the router turns that into an unsuccessful `Result`. The batch variant is deliberately more
|
|
8975
|
+
* forgiving — see {@link GetBalancesParams}.
|
|
8976
|
+
*/
|
|
8977
|
+
type GetBalanceParams<ChainKey extends SpokeChainKey = SpokeChainKey> = {
|
|
8978
|
+
srcChainKey: ChainKey;
|
|
8979
|
+
srcAddress: GetAddressType<ChainKey>;
|
|
8980
|
+
token: XToken;
|
|
8981
|
+
};
|
|
8982
|
+
/**
|
|
8983
|
+
* Parameters for reading a user's own wallet balances of multiple tokens on a spoke chain.
|
|
8984
|
+
* Per-chain implementations batch the reads where the chain supports it (EVM multicall3, ICON
|
|
8985
|
+
* `tryAggregate`, Injective portfolio).
|
|
8986
|
+
*
|
|
8987
|
+
* Returns `Record<tokenAddress, bigint>` in smallest units. A token that could not be read is logged
|
|
8988
|
+
* through the SDK logger and reported as `0n`, so one flaky token never discards the balances that
|
|
8989
|
+
* did resolve. Callers therefore cannot tell a failed read from an empty wallet; the direction is
|
|
8990
|
+
* deliberately conservative — under-reporting blocks a spend, it never permits one.
|
|
8991
|
+
*
|
|
8992
|
+
* The `Result` fails when the whole batch is unusable: an invalid chain key, a shared round-trip
|
|
8993
|
+
* every token depends on (ICON `tryAggregate`, Injective's portfolio fetch), or a batch in which NO
|
|
8994
|
+
* token could be read — a dead or rate-limited RPC would otherwise render as "this wallet is empty
|
|
8995
|
+
* on every asset".
|
|
8996
|
+
*/
|
|
8997
|
+
type GetBalancesParams<ChainKey extends SpokeChainKey = SpokeChainKey> = {
|
|
8998
|
+
srcChainKey: ChainKey;
|
|
8999
|
+
srcAddress: GetAddressType<ChainKey>;
|
|
9000
|
+
tokens: readonly XToken[];
|
|
9001
|
+
};
|
|
8804
9002
|
type DepositSimulationParams = {
|
|
8805
9003
|
spokeChainID: SpokeChainKey;
|
|
8806
9004
|
token: Hex;
|
|
@@ -8914,6 +9112,38 @@ type RawDestinationParams = {
|
|
|
8914
9112
|
dstAddress: string;
|
|
8915
9113
|
};
|
|
8916
9114
|
|
|
9115
|
+
/** A wallet balance map in smallest units, keyed by `token.address`. */
|
|
9116
|
+
type WalletBalanceMap = Record<string, bigint>;
|
|
9117
|
+
type BalanceReadContext = {
|
|
9118
|
+
readonly logger: SodaxLogger;
|
|
9119
|
+
readonly chainKey: SpokeChainKey;
|
|
9120
|
+
};
|
|
9121
|
+
/**
|
|
9122
|
+
* Accumulates a chain's per-token balance reads.
|
|
9123
|
+
*
|
|
9124
|
+
* A token that could not be read resolves to `0n` — the same value an empty wallet produces — so
|
|
9125
|
+
* every failure is logged through the SDK logger, which is where an integrator's error sink is
|
|
9126
|
+
* wired. That keeps one flaky token from discarding the balances that did resolve, but it means a
|
|
9127
|
+
* caller cannot tell the two apart; {@link BalanceCollector.finish} therefore refuses the one case
|
|
9128
|
+
* where the distinction is unmistakable and dangerous: an entire batch that read nothing at all
|
|
9129
|
+
* (a dead or rate-limited RPC) would otherwise render as "this wallet is empty on every asset".
|
|
9130
|
+
*/
|
|
9131
|
+
interface BalanceCollector {
|
|
9132
|
+
/** Record a balance that was actually read — including a genuine on-chain zero. */
|
|
9133
|
+
ok(tokenAddress: string, value: bigint): void;
|
|
9134
|
+
/** Record a failed read: logs the cause and falls back to `0n`. */
|
|
9135
|
+
fail(tokenAddress: string, reason: unknown): void;
|
|
9136
|
+
/** Return the map, or throw when a non-empty batch produced no successful read. */
|
|
9137
|
+
finish(): WalletBalanceMap;
|
|
9138
|
+
}
|
|
9139
|
+
declare function createBalanceCollector({ logger, chainKey }: BalanceReadContext): BalanceCollector;
|
|
9140
|
+
/**
|
|
9141
|
+
* Read every token independently into `collector`, so one failing token never discards the rest.
|
|
9142
|
+
* Chains with a native batch call (EVM multicall3, ICON `tryAggregate`, Injective portfolio) feed
|
|
9143
|
+
* the collector directly instead of using this.
|
|
9144
|
+
*/
|
|
9145
|
+
declare function settleWalletBalances(collector: BalanceCollector, tokens: readonly XToken[], read: (token: XToken) => Promise<bigint>): Promise<void>;
|
|
9146
|
+
|
|
8917
9147
|
/**
|
|
8918
9148
|
* High-level request for routing an intent's output through a deployed delivery hook. Pick a hook by
|
|
8919
9149
|
* its {@link HookKind}; the SDK resolves the hook's deployed address and encodes the payload it expects
|
|
@@ -8985,6 +9215,11 @@ type BitcoinBoundSlot<K extends SpokeChainKey> = GetChainType<K> extends 'BITCOI
|
|
|
8985
9215
|
type SwapExtras<K extends SpokeChainKey = SpokeChainKey> = {
|
|
8986
9216
|
/** Overrides the configured swap partner fee for this action; falls back to config when omitted. */
|
|
8987
9217
|
partnerFee?: PartnerFee;
|
|
9218
|
+
/**
|
|
9219
|
+
* Overrides the configured backend API key for this action's backend submit-tx leg; sent as the
|
|
9220
|
+
* `x-api-key` header. Falls back to config when omitted.
|
|
9221
|
+
*/
|
|
9222
|
+
apiKey?: string;
|
|
8988
9223
|
} & SrcPublicKeySlot<K> & BitcoinBoundSlot<K>;
|
|
8989
9224
|
type Intent = {
|
|
8990
9225
|
intentId: bigint;
|
|
@@ -9101,6 +9336,21 @@ declare class SonicSpokeService {
|
|
|
9101
9336
|
* @returns {Promise<bigint>} The balance of the token.
|
|
9102
9337
|
*/
|
|
9103
9338
|
getDeposit(params: GetDepositParams<SonicChainKey>): Promise<bigint>;
|
|
9339
|
+
/**
|
|
9340
|
+
* Get the user's own wallet balance of a token on the hub (Sonic) chain, in smallest units.
|
|
9341
|
+
* Native coin via `eth_getBalance`; erc20 via `balanceOf`.
|
|
9342
|
+
* @param {GetBalanceParams<SonicChainKey>} params - The chain key, user address, and token.
|
|
9343
|
+
* @returns {Promise<bigint>} The token balance in smallest units.
|
|
9344
|
+
*/
|
|
9345
|
+
getWalletBalance(params: GetBalanceParams<SonicChainKey>): Promise<bigint>;
|
|
9346
|
+
/**
|
|
9347
|
+
* Get the user's own wallet balances of multiple tokens on the hub (Sonic) chain, in smallest
|
|
9348
|
+
* units. Non-native tokens are batched via multicall3 when the chain supports it, otherwise
|
|
9349
|
+
* read in parallel.
|
|
9350
|
+
* @param {GetBalancesParams<SonicChainKey>} params - The chain key, user address, and tokens.
|
|
9351
|
+
* @returns {Promise<WalletBalanceMap>} A map of token address to balance in smallest units.
|
|
9352
|
+
*/
|
|
9353
|
+
getWalletBalances(params: GetBalancesParams<SonicChainKey>): Promise<WalletBalanceMap>;
|
|
9104
9354
|
/**
|
|
9105
9355
|
* Execute a batch of contract calls through the Sonic wallet contract.
|
|
9106
9356
|
* @param {Hex} payload - The encoded payload containing the calls array
|
|
@@ -9350,6 +9600,21 @@ declare class EvmSpokeService {
|
|
|
9350
9600
|
* @returns {Promise<bigint>} The balance of the token deposited in the spoke chain asset manager.
|
|
9351
9601
|
*/
|
|
9352
9602
|
getDeposit(params: GetDepositParams<EvmSpokeOnlyChainKey>): Promise<bigint>;
|
|
9603
|
+
/**
|
|
9604
|
+
* Get the user's own wallet balance of a token on an EVM spoke chain, in smallest units.
|
|
9605
|
+
* Native coin via `eth_getBalance` (Hedera scaled to canonical decimals); erc20 via `balanceOf`.
|
|
9606
|
+
* @param {GetBalanceParams<EvmSpokeOnlyChainKey>} params - The chain key, user address, and token.
|
|
9607
|
+
* @returns {Promise<bigint>} The token balance in smallest units.
|
|
9608
|
+
*/
|
|
9609
|
+
getWalletBalance(params: GetBalanceParams<EvmSpokeOnlyChainKey>): Promise<bigint>;
|
|
9610
|
+
/**
|
|
9611
|
+
* Get the user's own wallet balances of multiple tokens on an EVM spoke chain, in smallest
|
|
9612
|
+
* units. Non-native tokens are batched via multicall3 when the chain supports it, otherwise
|
|
9613
|
+
* read in parallel.
|
|
9614
|
+
* @param {GetBalancesParams<EvmSpokeOnlyChainKey>} params - The chain key, user address, and tokens.
|
|
9615
|
+
* @returns {Promise<WalletBalanceMap>} A map of token address to balance in smallest units.
|
|
9616
|
+
*/
|
|
9617
|
+
getWalletBalances(params: GetBalancesParams<EvmSpokeOnlyChainKey>): Promise<WalletBalanceMap>;
|
|
9353
9618
|
/**
|
|
9354
9619
|
* Sends a message to the hub chain.
|
|
9355
9620
|
* @param {SendMessageParams} params - Includes dstChainKey, the chain key of the hub chain.
|
|
@@ -9388,6 +9653,21 @@ declare class StacksSpokeService {
|
|
|
9388
9653
|
* @returns {Promise<bigint>} The balance of the token.
|
|
9389
9654
|
*/
|
|
9390
9655
|
getDeposit(params: GetDepositParams<StacksChainKey>): Promise<bigint>;
|
|
9656
|
+
/**
|
|
9657
|
+
* Get the user's own wallet balance of a token on Stacks, in smallest units. Native STX via the
|
|
9658
|
+
* Hiro REST `/extended/v1/address/{addr}/balances` endpoint; SIP-010 fungible tokens via the
|
|
9659
|
+
* read-only `get-balance` contract call. Unlike {@link getDeposit}, this reads the holding of
|
|
9660
|
+
* `srcAddress` (the user), not the protocol asset manager.
|
|
9661
|
+
* @param {GetBalanceParams<StacksChainKey>} params - The chain key, user address, and token.
|
|
9662
|
+
* @returns {Promise<bigint>} The token balance in smallest units.
|
|
9663
|
+
*/
|
|
9664
|
+
getWalletBalance(params: GetBalanceParams<StacksChainKey>): Promise<bigint>;
|
|
9665
|
+
/**
|
|
9666
|
+
* Get the user's own wallet balances of multiple tokens on Stacks, in smallest units.
|
|
9667
|
+
* @param {GetBalancesParams<StacksChainKey>} params - The chain key, user address, and tokens.
|
|
9668
|
+
* @returns {Promise<WalletBalanceMap>} A map of token address to balance in smallest units.
|
|
9669
|
+
*/
|
|
9670
|
+
getWalletBalances(params: GetBalancesParams<StacksChainKey>): Promise<WalletBalanceMap>;
|
|
9391
9671
|
/**
|
|
9392
9672
|
* Sends a message to the hub chain.
|
|
9393
9673
|
*/
|
|
@@ -9806,6 +10086,20 @@ declare class BitcoinSpokeService {
|
|
|
9806
10086
|
constructor(config: ConfigService);
|
|
9807
10087
|
getBtcNetwork(chainId: BitcoinChainKey): networks.Network;
|
|
9808
10088
|
getBalance(tokenAddress: string, walletAddress: string): Promise<bigint>;
|
|
10089
|
+
/**
|
|
10090
|
+
* Get the user's own wallet balance of a token on Bitcoin, in satoshis. Only native BTC is
|
|
10091
|
+
* readable (summed from confirmed/unconfirmed UTXOs). Non-native spoke tokens are Rune ids
|
|
10092
|
+
* (`block:tx`), whose amounts the Esplora UTXO endpoint does not carry, so they resolve to 0n.
|
|
10093
|
+
* @param {GetBalanceParams<BitcoinChainKey>} params - The chain key, user address, and token.
|
|
10094
|
+
* @returns {Promise<bigint>} The balance in satoshis.
|
|
10095
|
+
*/
|
|
10096
|
+
getWalletBalance(params: GetBalanceParams<BitcoinChainKey>): Promise<bigint>;
|
|
10097
|
+
/**
|
|
10098
|
+
* Get the user's own wallet balances of multiple tokens on Bitcoin, in satoshis.
|
|
10099
|
+
* @param {GetBalancesParams<BitcoinChainKey>} params - The chain key, user address, and tokens.
|
|
10100
|
+
* @returns {Promise<WalletBalanceMap>} A map of token address to balance in smallest units.
|
|
10101
|
+
*/
|
|
10102
|
+
getWalletBalances(params: GetBalancesParams<BitcoinChainKey>): Promise<WalletBalanceMap>;
|
|
9809
10103
|
fetchScriptPubKey(utxo: BitcoinUTXO): Promise<string>;
|
|
9810
10104
|
/**
|
|
9811
10105
|
* Get the effective wallet address for hub wallet derivation and relay submission.
|
|
@@ -9976,6 +10270,22 @@ declare class NearSpokeService {
|
|
|
9976
10270
|
* @returns {Promise<bigint>} The balance of the token.
|
|
9977
10271
|
*/
|
|
9978
10272
|
getDeposit(params: GetDepositParams<NearChainKey>): Promise<bigint>;
|
|
10273
|
+
/**
|
|
10274
|
+
* Get the user's own wallet balance of a token on NEAR, in smallest units (yoctoNEAR for the
|
|
10275
|
+
* native coin). Native NEAR via the account's `viewAccount().amount`; NEP-141 tokens via the
|
|
10276
|
+
* token contract's `ft_balance_of` view. Reads the balance held by `srcAddress` (the user
|
|
10277
|
+
* wallet), not the protocol asset manager. Uses this service's own configured RPC provider.
|
|
10278
|
+
* @param {GetBalanceParams<NearChainKey>} params - The chain key, user address, and token.
|
|
10279
|
+
* @returns {Promise<bigint>} The token balance in smallest units.
|
|
10280
|
+
*/
|
|
10281
|
+
getWalletBalance(params: GetBalanceParams<NearChainKey>): Promise<bigint>;
|
|
10282
|
+
/**
|
|
10283
|
+
* Get the user's own wallet balances of multiple tokens on NEAR, in smallest units. Fans out
|
|
10284
|
+
* over {@link getWalletBalance}, keyed by `token.address`.
|
|
10285
|
+
* @param {GetBalancesParams<NearChainKey>} params - The chain key, user address, and tokens.
|
|
10286
|
+
* @returns {Promise<WalletBalanceMap>} A map of token address to balance in smallest units.
|
|
10287
|
+
*/
|
|
10288
|
+
getWalletBalances(params: GetBalancesParams<NearChainKey>): Promise<WalletBalanceMap>;
|
|
9979
10289
|
/**
|
|
9980
10290
|
* Whether `accountId` is storage-registered on a NEP-141 `token` contract. NEP-141 requires an
|
|
9981
10291
|
* account to pay a one-time storage bond before it can receive (hold a balance of) the token, so
|
|
@@ -10082,6 +10392,21 @@ declare class SuiSpokeService {
|
|
|
10082
10392
|
* @returns {Promise<bigint>} The balance of the token.
|
|
10083
10393
|
*/
|
|
10084
10394
|
getDeposit(params: GetDepositParams<SuiChainKey>): Promise<bigint>;
|
|
10395
|
+
/**
|
|
10396
|
+
* Get the user's own wallet balance of a token on Sui, in smallest units. Unlike {@link getDeposit}
|
|
10397
|
+
* (which reads the protocol asset manager holding), this reads the balance held by `params.srcAddress`
|
|
10398
|
+
* itself. Native SUI is read via its canonical `0x2::sui::SUI` coin type; other coins use the token's
|
|
10399
|
+
* Sui coinType (`token.address`).
|
|
10400
|
+
* @param {GetBalanceParams<SuiChainKey>} params - The chain key, user address, and token.
|
|
10401
|
+
* @returns {Promise<bigint>} The token balance in smallest units.
|
|
10402
|
+
*/
|
|
10403
|
+
getWalletBalance(params: GetBalanceParams<SuiChainKey>): Promise<bigint>;
|
|
10404
|
+
/**
|
|
10405
|
+
* Get the user's own wallet balances of multiple tokens on Sui, in smallest units.
|
|
10406
|
+
* @param {GetBalancesParams<SuiChainKey>} params - The chain key, user address, and tokens.
|
|
10407
|
+
* @returns {Promise<WalletBalanceMap>} A map of token address to balance in smallest units.
|
|
10408
|
+
*/
|
|
10409
|
+
getWalletBalances(params: GetBalancesParams<SuiChainKey>): Promise<WalletBalanceMap>;
|
|
10085
10410
|
/**
|
|
10086
10411
|
* Fetch the asset manager config from the spoke chain.
|
|
10087
10412
|
* @param {SuiChainKey} chainId - The Sui chain key.
|
|
@@ -10139,6 +10464,37 @@ declare class StellarSpokeService {
|
|
|
10139
10464
|
private readonly baseFee;
|
|
10140
10465
|
constructor(config: ConfigService);
|
|
10141
10466
|
getBalance(params: GetDepositParams<StellarChainKey>): Promise<number>;
|
|
10467
|
+
/**
|
|
10468
|
+
* Get the user's own wallet balance of a token on Stellar, in smallest units. Native XLM returns
|
|
10469
|
+
* the spendable amount (total minus the minimum reserve and selling liabilities) via Horizon;
|
|
10470
|
+
* other assets return the Soroban token contract's `balance` for the user.
|
|
10471
|
+
* @param {GetBalanceParams<StellarChainKey>} params - The chain key, user address, and token.
|
|
10472
|
+
* @returns {Promise<bigint>} The token balance in smallest units.
|
|
10473
|
+
*/
|
|
10474
|
+
getWalletBalance(params: GetBalanceParams<StellarChainKey>): Promise<bigint>;
|
|
10475
|
+
/**
|
|
10476
|
+
* Spendable XLM in stroops: the account's native balance minus its minimum reserve and selling
|
|
10477
|
+
* liabilities. Reporting the raw balance would let a user try to spend reserves the network
|
|
10478
|
+
* refuses to release.
|
|
10479
|
+
*/
|
|
10480
|
+
private static spendableXlmStroops;
|
|
10481
|
+
/**
|
|
10482
|
+
* Simulate a Soroban token `balance` call. Takes the network passphrase and source account so a
|
|
10483
|
+
* batch can fetch them once; `getAccountClone()` hands each builder its own `Account`, because
|
|
10484
|
+
* `TransactionBuilder.build()` increments the source's sequence number and concurrent builders
|
|
10485
|
+
* would otherwise interleave on a shared one.
|
|
10486
|
+
*/
|
|
10487
|
+
private simulateTokenBalance;
|
|
10488
|
+
/**
|
|
10489
|
+
* Get the user's own wallet balances of multiple tokens on Stellar, in smallest units.
|
|
10490
|
+
*
|
|
10491
|
+
* The network passphrase and the source account are the same for every token, so they are
|
|
10492
|
+
* fetched once per batch instead of once per token — and only when a partition actually needs
|
|
10493
|
+
* them, so an all-native request issues no Soroban calls at all.
|
|
10494
|
+
* @param {GetBalancesParams<StellarChainKey>} params - The chain key, user address, and tokens.
|
|
10495
|
+
* @returns {Promise<WalletBalanceMap>} A map of token address to balance in smallest units.
|
|
10496
|
+
*/
|
|
10497
|
+
getWalletBalances(params: GetBalancesParams<StellarChainKey>): Promise<WalletBalanceMap>;
|
|
10142
10498
|
buildPriorityStellarTransaction(account: CustomStellarAccount, network: rpc.Api.GetNetworkResponse, operation: xdr.Operation<Operation.InvokeHostFunction>): Promise<[Transaction$1, rpc.Api.SimulateTransactionResponse]>;
|
|
10143
10499
|
buildDepositCall<Raw extends boolean>(params: DepositParams<StellarChainKey, Raw>): xdr.Operation<Operation.InvokeHostFunction>;
|
|
10144
10500
|
buildSendMessageCall<Raw extends boolean>(params: SendMessageParams<StellarChainKey, Raw>): xdr.Operation<Operation.InvokeHostFunction>;
|
|
@@ -10216,6 +10572,21 @@ declare class SolanaSpokeService {
|
|
|
10216
10572
|
*/
|
|
10217
10573
|
deposit<R extends boolean = false>(params: DepositParams<SolanaChainKey, R>): Promise<TxReturnType<SolanaChainKey, R>>;
|
|
10218
10574
|
getDeposit(params: GetDepositParams<SolanaChainKey>): Promise<bigint>;
|
|
10575
|
+
/**
|
|
10576
|
+
* Get the user's own wallet balance of a token on Solana, in smallest units. Native SOL via
|
|
10577
|
+
* `getBalance`; SPL via the associated token account. The mint may belong to the legacy SPL
|
|
10578
|
+
* Token program or Token-2022 (e.g. xStock tokens), which derive different ATAs, so both
|
|
10579
|
+
* candidate ATAs are read in one call and the existing one is used.
|
|
10580
|
+
* @param {GetBalanceParams<SolanaChainKey>} params - The chain key, user address, and token.
|
|
10581
|
+
* @returns {Promise<bigint>} The token balance in smallest units.
|
|
10582
|
+
*/
|
|
10583
|
+
getWalletBalance(params: GetBalanceParams<SolanaChainKey>): Promise<bigint>;
|
|
10584
|
+
/**
|
|
10585
|
+
* Get the user's own wallet balances of multiple tokens on Solana, in smallest units.
|
|
10586
|
+
* @param {GetBalancesParams<SolanaChainKey>} params - The chain key, user address, and tokens.
|
|
10587
|
+
* @returns {Promise<WalletBalanceMap>} A map of token address to balance in smallest units.
|
|
10588
|
+
*/
|
|
10589
|
+
getWalletBalances(params: GetBalancesParams<SolanaChainKey>): Promise<WalletBalanceMap>;
|
|
10219
10590
|
/**
|
|
10220
10591
|
* Sends a message to the hub chain.
|
|
10221
10592
|
* @param dstChainKey - The chain key of the hub chain.
|
|
@@ -10263,6 +10634,26 @@ declare class IconSpokeService {
|
|
|
10263
10634
|
* @returns {Promise<bigint>} The balance of the token
|
|
10264
10635
|
*/
|
|
10265
10636
|
getDeposit(params: GetDepositParams<IconChainKey>): Promise<bigint>;
|
|
10637
|
+
/**
|
|
10638
|
+
* Read an int-returning SCORE call. `iconService.call(...)` registers no result converter, so
|
|
10639
|
+
* `execute()` resolves the raw JSON-RPC `result` — a bare hex string for an int, not `{ value }`.
|
|
10640
|
+
*/
|
|
10641
|
+
private readIrc2Balance;
|
|
10642
|
+
/**
|
|
10643
|
+
* Get the user's own wallet balance of a token on ICON, in smallest units. Native ICX is read
|
|
10644
|
+
* via `iconService.getBalance`; IRC-2 tokens via a `balanceOf(_owner)` call on the token contract.
|
|
10645
|
+
* @param {GetBalanceParams<IconChainKey>} params - The chain key, user address, and token.
|
|
10646
|
+
* @returns {Promise<bigint>} The token balance in smallest units.
|
|
10647
|
+
*/
|
|
10648
|
+
getWalletBalance(params: GetBalanceParams<IconChainKey>): Promise<bigint>;
|
|
10649
|
+
/**
|
|
10650
|
+
* Get the user's own wallet balances of multiple tokens on ICON, in smallest units. Native ICX
|
|
10651
|
+
* is read via `iconService.getBalance`; IRC-2 balances are batched into a single `tryAggregate`
|
|
10652
|
+
* multicall so every `balanceOf(_owner)` read shares one round-trip.
|
|
10653
|
+
* @param {GetBalancesParams<IconChainKey>} params - The chain key, user address, and tokens.
|
|
10654
|
+
* @returns {Promise<WalletBalanceMap>} A map of token address to balance in smallest units.
|
|
10655
|
+
*/
|
|
10656
|
+
getWalletBalances(params: GetBalancesParams<IconChainKey>): Promise<WalletBalanceMap>;
|
|
10266
10657
|
/**
|
|
10267
10658
|
* Sends a message to the hub chain.
|
|
10268
10659
|
* @param {SendMessageParams} params - Includes dstChainKey, the chain key of the destination chain.
|
|
@@ -10325,6 +10716,7 @@ interface State {
|
|
|
10325
10716
|
declare class InjectiveSpokeService {
|
|
10326
10717
|
private readonly config;
|
|
10327
10718
|
readonly chainGrpcWasmApi: ChainGrpcWasmApi;
|
|
10719
|
+
readonly indexerGrpcAccountPortfolioApi: IndexerGrpcAccountPortfolioApi;
|
|
10328
10720
|
readonly txClient: TxGrpcApi;
|
|
10329
10721
|
readonly endpoints: NetworkEndpoints;
|
|
10330
10722
|
private readonly pollingIntervalMs;
|
|
@@ -10356,6 +10748,21 @@ declare class InjectiveSpokeService {
|
|
|
10356
10748
|
* @returns {Promise<bigint>} The balance of the token.
|
|
10357
10749
|
*/
|
|
10358
10750
|
getDeposit(params: GetDepositParams<InjectiveChainKey>): Promise<bigint>;
|
|
10751
|
+
/**
|
|
10752
|
+
* Get the user's own wallet balance of a token on Injective, in smallest units. On Injective every
|
|
10753
|
+
* asset is a bank coin, so the native coin (`inj`) and factory/peggy/IBC tokens are all read from the
|
|
10754
|
+
* account's portfolio bank balances and matched by denom. The denom is the chain's native denom for
|
|
10755
|
+
* the native coin and `params.token.address` for standard tokens.
|
|
10756
|
+
* @param {GetBalanceParams<InjectiveChainKey>} params - The chain key, user address, and token.
|
|
10757
|
+
* @returns {Promise<bigint>} The token balance in smallest units, or 0n when the account holds none.
|
|
10758
|
+
*/
|
|
10759
|
+
getWalletBalance(params: GetBalanceParams<InjectiveChainKey>): Promise<bigint>;
|
|
10760
|
+
/**
|
|
10761
|
+
* Get the user's own wallet balances of multiple tokens on Injective, in smallest units.
|
|
10762
|
+
* @param {GetBalancesParams<InjectiveChainKey>} params - The chain key, user address, and tokens.
|
|
10763
|
+
* @returns {Promise<WalletBalanceMap>} A map of token address to balance in smallest units.
|
|
10764
|
+
*/
|
|
10765
|
+
getWalletBalances(params: GetBalancesParams<InjectiveChainKey>): Promise<WalletBalanceMap>;
|
|
10359
10766
|
getRawTransaction(chainId: string, senderAddress: string, contractAddress: string, msg: JsonObject, memo?: string, funds?: InjectiveCoin[]): Promise<InjectiveRawTransaction>;
|
|
10360
10767
|
getState(chainId: InjectiveChainKey): Promise<State>;
|
|
10361
10768
|
/**
|
|
@@ -10504,6 +10911,26 @@ declare class SpokeService {
|
|
|
10504
10911
|
* @returns {Promise<bigint>} The balance of the token.
|
|
10505
10912
|
*/
|
|
10506
10913
|
getDeposit<C extends SpokeChainKey>(params: GetDepositParams<C>): Promise<Result<bigint>>;
|
|
10914
|
+
/**
|
|
10915
|
+
* Get a user's own wallet balance of a single token on a spoke chain, in smallest units.
|
|
10916
|
+
* Chain-agnostic: dispatches to the per-chain service, which reads the native coin or the
|
|
10917
|
+
* chain's token standard (EVM erc20, Solana SPL, …). Unlike {@link getDeposit}, this reads
|
|
10918
|
+
* `srcAddress` itself, not the protocol asset manager.
|
|
10919
|
+
* @param {GetBalanceParams<C>} params - The chain key, user address, and token.
|
|
10920
|
+
* @returns {Promise<Result<bigint>>} The token balance in smallest units.
|
|
10921
|
+
*/
|
|
10922
|
+
getWalletBalance<C extends SpokeChainKey>(params: GetBalanceParams<C>): Promise<Result<bigint>>;
|
|
10923
|
+
/**
|
|
10924
|
+
* Get a user's own wallet balances of multiple tokens on a spoke chain, in smallest units.
|
|
10925
|
+
* Chain-agnostic sibling of {@link getWalletBalance}; per-chain services batch the reads where the
|
|
10926
|
+
* chain supports it (e.g. EVM multicall3, ICON aggregated call data).
|
|
10927
|
+
* @param {GetBalancesParams<C>} params - The chain key, user address, and tokens.
|
|
10928
|
+
* @returns {Promise<Result<WalletBalanceMap>>} A map of token address to balance in smallest
|
|
10929
|
+
* units. A token that could not be read is logged and reported as `0n`; the `Result` fails when
|
|
10930
|
+
* the whole batch is unusable — invalid chain, a shared round-trip every token depends on, or a
|
|
10931
|
+
* batch in which no token could be read at all.
|
|
10932
|
+
*/
|
|
10933
|
+
getWalletBalances<C extends SpokeChainKey>(params: GetBalancesParams<C>): Promise<Result<WalletBalanceMap>>;
|
|
10507
10934
|
/**
|
|
10508
10935
|
* Calls the connection contract on the spoke chain to send a message to the hub wallet, which then executes the message's payload.
|
|
10509
10936
|
* @param {HubAddress} from - The address of the user on the hub chain.
|
|
@@ -10544,7 +10971,7 @@ declare class SuiGrpcTransport implements SuiTransport {
|
|
|
10544
10971
|
readonly endpoint: string;
|
|
10545
10972
|
private readonly client;
|
|
10546
10973
|
constructor(endpoint: string);
|
|
10547
|
-
getCoins(owner: string, coinType: string, limit?: number): Promise<SuiPaginatedCoins>;
|
|
10974
|
+
getCoins(owner: string, coinType: string, limit?: number, cursor?: string | null): Promise<SuiPaginatedCoins>;
|
|
10548
10975
|
simulate(tx: SuiTransaction, sender: string): Promise<SuiExecutionResult>;
|
|
10549
10976
|
estimateGas(tx: SuiTransaction, sender: string): Promise<SuiGasEstimate>;
|
|
10550
10977
|
fetchLatestPackageId(objectId: string): Promise<string>;
|
|
@@ -12592,18 +13019,73 @@ declare const silentLogger: SodaxLogger;
|
|
|
12592
13019
|
*/
|
|
12593
13020
|
declare function resolveLogger(option: SodaxLoggerOption | undefined): SodaxLogger;
|
|
12594
13021
|
|
|
12595
|
-
/** An `intent-filled` entry in `IntentResponse.events`. Narrow with `isFillEvent`. */
|
|
12596
|
-
declare const FillEventSchema: v.ObjectSchema<{
|
|
12597
|
-
readonly eventType: v.LiteralSchema<"intent-filled", undefined>;
|
|
12598
|
-
readonly txHash: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>]>;
|
|
12599
|
-
readonly intentState: v.ObjectSchema<{
|
|
12600
|
-
readonly remainingInput: v.StringSchema<undefined>;
|
|
12601
|
-
}, undefined>;
|
|
12602
|
-
}, undefined>;
|
|
12603
|
-
|
|
12604
13022
|
type FillEvent = v.InferOutput<typeof FillEventSchema>;
|
|
12605
13023
|
/** Narrows an `IntentResponse.events` entry, which is typed `unknown[]`. */
|
|
12606
13024
|
declare const isFillEvent: (value: unknown) => value is FillEvent;
|
|
13025
|
+
/** Narrows an oracle markets `intervals[].key`, which is `string` so discovery tolerates an unknown interval. */
|
|
13026
|
+
declare const isOracleCandleInterval: (value: string) => value is OracleCandleInterval;
|
|
13027
|
+
|
|
13028
|
+
/**
|
|
13029
|
+
* Estimated settlement-speed bucket for a swap token pair.
|
|
13030
|
+
*
|
|
13031
|
+
* TODO: confirm the label set (slow / normal / fast) against the referenced spec doc, which
|
|
13032
|
+
* mentions "slow, normal, fast, etc." without pinning the exact enum.
|
|
13033
|
+
*/
|
|
13034
|
+
type SwapSpeedTier = 'fast' | 'normal' | 'slow';
|
|
13035
|
+
/**
|
|
13036
|
+
* Rule-based estimate of how fast a src→dst swap settles, plus the tier bucket it falls into.
|
|
13037
|
+
* `estimatedSeconds` is the source of truth; `tier` is derived from it.
|
|
13038
|
+
*/
|
|
13039
|
+
type SwapSpeedTierResult = {
|
|
13040
|
+
tier: SwapSpeedTier;
|
|
13041
|
+
estimatedSeconds: number;
|
|
13042
|
+
};
|
|
13043
|
+
/** Token pair to estimate a settlement-speed tier for. */
|
|
13044
|
+
type SwapSpeedTierParams = {
|
|
13045
|
+
/** Source spoke token. */
|
|
13046
|
+
srcToken: XToken;
|
|
13047
|
+
/** Destination spoke token. */
|
|
13048
|
+
dstToken: XToken;
|
|
13049
|
+
};
|
|
13050
|
+
/**
|
|
13051
|
+
* Hardcoded base estimates (seconds) for the rule-based speed tier.
|
|
13052
|
+
*
|
|
13053
|
+
* These are fixed rule constants — derived once from observed solver settlement
|
|
13054
|
+
* behavior, NOT measured at runtime. The optional future enhancement (analyzing public intents
|
|
13055
|
+
* data) would refine them; for the base feature they are intentionally hardcoded.
|
|
13056
|
+
*
|
|
13057
|
+
* TODO: confirm the exact numbers against the referenced spec doc.
|
|
13058
|
+
*/
|
|
13059
|
+
declare const SPEED_TIER_SECONDS: {
|
|
13060
|
+
/** Either token maps to a money-market-reserve (sodaAsset) hub asset. */
|
|
13061
|
+
readonly sodaAsset: 15;
|
|
13062
|
+
/** Anything else / default. */
|
|
13063
|
+
readonly default: 35;
|
|
13064
|
+
/** Added once when either src or dst is an Ethereum asset. */
|
|
13065
|
+
readonly ethereumPenalty: 10;
|
|
13066
|
+
};
|
|
13067
|
+
/**
|
|
13068
|
+
* Provisional second→tier boundaries (inclusive upper bounds).
|
|
13069
|
+
*
|
|
13070
|
+
* TODO: confirm labels and boundaries — the possible totals under the current rules are
|
|
13071
|
+
* 15 / 25 / 35 / 45, so these thresholds bucket them as fast(15) · normal(25) · slow(35, 45).
|
|
13072
|
+
*/
|
|
13073
|
+
declare const SPEED_TIER_THRESHOLDS: {
|
|
13074
|
+
readonly fast: 20;
|
|
13075
|
+
readonly normal: 30;
|
|
13076
|
+
};
|
|
13077
|
+
/**
|
|
13078
|
+
* Pure, offline, rule-based estimate of how fast a src→dst swap will settle. Performs no
|
|
13079
|
+
* network or on-chain call — it classifies the pair from SDK config alone.
|
|
13080
|
+
*
|
|
13081
|
+
* @param params `{ srcToken, dstToken }` spoke token pair to classify
|
|
13082
|
+
* @param isSodaAssetRelated predicate answering "is this hub asset a money-market-reserve
|
|
13083
|
+
* (sodaAsset)?". In the service this is wired to `config.isMoneyMarketReserveHubAsset`; the
|
|
13084
|
+
* predicate is injected so this function stays pure and unit-testable without a ConfigService.
|
|
13085
|
+
*
|
|
13086
|
+
* The fast 15s base applies when either token is sodaAsset-related; otherwise the base is 35s.
|
|
13087
|
+
*/
|
|
13088
|
+
declare function estimateSwapSpeedTier({ srcToken, dstToken }: SwapSpeedTierParams, isSodaAssetRelated: (hubAsset: Address) => boolean): SwapSpeedTierResult;
|
|
12607
13089
|
|
|
12608
13090
|
/** The tagged status union behind `SwapService.getDetailedStatus`. Pure — no I/O. */
|
|
12609
13091
|
|
|
@@ -13206,6 +13688,17 @@ declare class SwapService {
|
|
|
13206
13688
|
* @returns A map from each `SpokeChainKey` to its readonly array of supported `XToken` objects.
|
|
13207
13689
|
*/
|
|
13208
13690
|
getSupportedSwapTokens(): Record<SpokeChainKey, readonly XToken[]>;
|
|
13691
|
+
/**
|
|
13692
|
+
* Offline, rule-based estimate of how fast a `srcToken`→`dstToken` swap will settle.
|
|
13693
|
+
*
|
|
13694
|
+
* Derived purely from SDK config (no network / on-chain / backend call): tokens tied to a
|
|
13695
|
+
* money-market-reserve sodaAsset settle faster, and an Ethereum leg adds a fixed penalty. See
|
|
13696
|
+
* {@link estimateSwapSpeedTier} for the rules.
|
|
13697
|
+
*
|
|
13698
|
+
* @param params `{ srcToken, dstToken }` spoke token pair to estimate
|
|
13699
|
+
* @returns the estimated `tier` bucket and `estimatedSeconds`
|
|
13700
|
+
*/
|
|
13701
|
+
getSwapSpeedTier(params: SwapSpeedTierParams): SwapSpeedTierResult;
|
|
13209
13702
|
}
|
|
13210
13703
|
|
|
13211
13704
|
/**
|
|
@@ -13964,6 +14457,11 @@ type BridgeExtras<K extends SpokeChainKey = SpokeChainKey> = (GetChainType<K> ex
|
|
|
13964
14457
|
* Omit to use the configured fee. Chain-agnostic (unlike `srcPublicKey`/`bound`).
|
|
13965
14458
|
*/
|
|
13966
14459
|
partnerFee?: PartnerFee;
|
|
14460
|
+
/**
|
|
14461
|
+
* Overrides the configured backend API key for this action's backend submit-tx leg; sent as the
|
|
14462
|
+
* `x-api-key` header. Falls back to config when omitted. Chain-agnostic.
|
|
14463
|
+
*/
|
|
14464
|
+
apiKey?: string;
|
|
13967
14465
|
};
|
|
13968
14466
|
type BridgeParams<ChainKey extends SpokeChainKey, Raw extends boolean> = SpokeExecActionParams<ChainKey, Raw, CreateBridgeIntentParams<ChainKey>, BridgeExtras<ChainKey>>;
|
|
13969
14467
|
type BridgeServiceConstructorParams = {
|
|
@@ -18014,11 +18512,12 @@ declare class SponsoringService {
|
|
|
18014
18512
|
*/
|
|
18015
18513
|
private resolveBaseReserveStroops;
|
|
18016
18514
|
/**
|
|
18017
|
-
* Cache key for a config request: the resolved base URL plus
|
|
18018
|
-
*
|
|
18019
|
-
* key scoped to another deployment, or a test harness's scenario header — so
|
|
18020
|
-
*
|
|
18021
|
-
*
|
|
18515
|
+
* Cache key for a config request: the resolved base URL plus the per-call headers the request will
|
|
18516
|
+
* actually carry, `apiKey` included. Headers can select a different response from the same URL — an
|
|
18517
|
+
* API key scoped to another deployment, or a test harness's scenario header — so folding them in
|
|
18518
|
+
* stops one caller's override from being served to, or overwriting, the default path. Names are
|
|
18519
|
+
* lower-cased before sorting and serialized as JSON so casing and delimiters cannot collide two
|
|
18520
|
+
* distinct header sets onto one key. Kept in memory as a Map key only.
|
|
18022
18521
|
*/
|
|
18023
18522
|
private configCacheKey;
|
|
18024
18523
|
/**
|
|
@@ -18471,9 +18970,11 @@ declare class SolverApiService {
|
|
|
18471
18970
|
*
|
|
18472
18971
|
* @param request - Object containing `intent_tx_hash` (the hub-chain tx hash of the created intent).
|
|
18473
18972
|
* @param config - Solver endpoint configuration.
|
|
18973
|
+
* @param logger - Diagnostics sink; defaults to the silent logger.
|
|
18974
|
+
* @param apiKey - Configured backend API key (`config.apiKey`), sent as the `x-api-key` header.
|
|
18474
18975
|
* @returns A `Result` containing `{ answer: 'OK', intent_hash: Hex }` on success.
|
|
18475
18976
|
*/
|
|
18476
|
-
static postExecution(request: SolverExecutionRequest, config: SolverConfig, logger?: SodaxLogger): Promise<Result<SolverExecutionResponse, SolverErrorResponse>>;
|
|
18977
|
+
static postExecution(request: SolverExecutionRequest, config: SolverConfig, logger?: SodaxLogger, apiKey?: string): Promise<Result<SolverExecutionResponse, SolverErrorResponse>>;
|
|
18477
18978
|
/**
|
|
18478
18979
|
* Polls the solver API for the current execution status of an intent (`POST /status`).
|
|
18479
18980
|
*
|
|
@@ -18488,11 +18989,12 @@ declare class SolverApiService {
|
|
|
18488
18989
|
* request instantly. A non-positive one is a real budget of zero: the request aborts at once.
|
|
18489
18990
|
* The relay's `getTransactionPackets` takes the same parameter but degrades a non-finite value
|
|
18490
18991
|
* to its own per-request budget instead; the divergence is deliberate, and explained inline.
|
|
18992
|
+
* @param apiKey - Configured backend API key (`config.apiKey`), sent as the `x-api-key` header.
|
|
18491
18993
|
* @returns A `Result` containing `{ status: SolverIntentStatusCode, fill_tx_hash?: string }`.
|
|
18492
18994
|
* `fill_tx_hash` is set only when `status === SolverIntentStatusCode.SOLVED (3)`.
|
|
18493
18995
|
* @throws Invariant error if `intent_tx_hash` is empty (thrown before the async request).
|
|
18494
18996
|
*/
|
|
18495
|
-
static getStatus(request: SolverIntentStatusRequest, config: SolverConfig, logger?: SodaxLogger, timeoutMs?: number): Promise<Result<SolverIntentStatusResponse, SolverErrorResponse>>;
|
|
18997
|
+
static getStatus(request: SolverIntentStatusRequest, config: SolverConfig, logger?: SodaxLogger, timeoutMs?: number, apiKey?: string): Promise<Result<SolverIntentStatusResponse, SolverErrorResponse>>;
|
|
18496
18998
|
}
|
|
18497
18999
|
|
|
18498
19000
|
/**
|
|
@@ -18733,4 +19235,4 @@ type DexApproveErrorCode = ApproveErrorCode;
|
|
|
18733
19235
|
type DexApproveError = SodaxError<DexApproveErrorCode>;
|
|
18734
19236
|
declare const isDexApproveError: (e: unknown) => e is SodaxError<ApproveErrorCode>;
|
|
18735
19237
|
|
|
18736
|
-
export { ALLOWANCE_CHECK_CODES, APPROVE_CODES, type ActivateStellarAccountParams, type ActivateStellarAccountResult, type AggregatedReserveData, type AllowanceCheckErrorCode, type AllowanceInfo, type AllowanceResponse, type AllowanceTransferDetails, type AnalyticsActionData, type ApiResponse, type ApprovalTxs, type ApproveErrorCode, type ApyRange, type AssetDepositAction, type AssetEntry, AssetService, type AssetServiceConstructorParams, type AssetWithdrawAction, type AutoSwapPreferences, BackendApiService, BackendHttpError, 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, BridgeApiService, type BridgeApiServiceOptions, type BridgeApproveError, type BridgeApproveErrorCode, type BridgeCreateIntentError, type BridgeCreateIntentErrorCode, type BridgeError, type BridgeErrorCode, type BridgeExtras, 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, DETAILED_STATUS_NOT_DELIVERED, type DepositParams, type DepositSimulationParams, type DestinationParamsType, type DetailedLock, type DetailedStatusError, type DetailedStatusErrorCode, type DetailedSwapStatus, type DetailedSwapStatusKey, type DexApproveError, type DexApproveErrorCode, type DexCreateIntentError, type DexCreateIntentErrorCode, type DexError, type DexErrorCode, DexService, type DexServiceConstructorParams, type EModeCategory, type EModeCategoryHumanized, type EModeData, type EModeDataString, type EmodeDataHumanized, type EnrichedToken, type Erc20ApprovalPlan, type Erc20ApprovalPlanReason, type Erc20ApproveParams, type Erc20GetAllowanceParams, type Erc20IsAllowanceParams, type Erc20PlanApprovalParams, 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 FillEvent, 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, type LeverageYieldQuoteParams, 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, RELAY_FALLBACK_FLOOR_MS, RELAY_REQUEST_TIMEOUT_MS, RadfiApiError, type RadfiAuthResult, type RadfiBuildTxResponse, type RadfiErrorBody, type RadfiMaxSpentResponse, RadfiProvider, type RadfiProviderOptions, 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, SPONSOR_CONFIG_TTL_MS, STELLAR_BASE_RESERVE_TTL_MS, STELLAR_TRUSTLINE_MIN_XLM_STROOPS, 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, type SponsorFailureAction, type SponsorFailureClass, type SponsoringAction, SponsoringApiService, type SponsoringConfigError, type SponsoringConfigErrorCode, type SponsoringLookupError, type SponsoringLookupErrorCode, type SponsoringOrchestrationError, type SponsoringOrchestrationErrorCode, SponsoringService, 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, type StellarAccountStatus, StellarSpokeService, type SubmitTxParams, type SubmitTxResponse, SuiGrpcTransport, SuiSpokeService, SupportedMigrationTokens, type SwapAction, type SwapActionParams, type SwapCreateIntentError, type SwapCreateIntentErrorCode, type SwapError, type SwapErrorCode, type SwapExtras, type SwapResponse, SwapService, type SwapServiceConstructorParams, SwapsApiService, type SwapsApiServiceOptions, 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, classifySponsorError, 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, isApprovalSupportedChainKeyType, isBackendHttpError, isBalnMigrateParams, isBitcoinChainKeyType, isBitcoinWalletProviderType, isBridgeAllowanceCheckError, isBridgeApproveError, isBridgeCreateIntentError, isBridgeError, isBridgeLookupError, isBridgeOrchestrationError, isCodeMember, isDexApproveError, isDexCreateIntentError, isDexError, isEvmChainKeyType, isEvmSpokeChainConfig, isEvmSpokeOnlyChainKeyType, isEvmWalletProviderType, isFeatureError, isFillEvent, 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, isNativeBitcoinTransfer, isNearChainKeyType, isOptionalBitcoinWalletProviderType, isOptionalEvmWalletProviderType, isOptionalStellarWalletProviderType, isPartnerError, isPartnerFeeAmount, isPartnerFeePercentage, isPostExecutionError, isRawDestinationParams, isRecoveryError, isResponseAddressType, isResponseSigningType, isRevertMigrationOrchestrationError, isSodaxError, isSolanaChainKeyType, isSolanaNativeToken, isSonicChainKeyType, isSpokeApproveParamsEvmSpoke, isSpokeApproveParamsHub, isSpokeApproveParamsStellar, isSpokeIsAllowanceValidParamsEvmSpoke, isSpokeIsAllowanceValidParamsHub, isSpokeIsAllowanceValidParamsStellar, isSponsoringConfigError, isSponsoringLookupError, isSponsoringOrchestrationError, isStacksChainKeyType, isStakeOrchestrationError, isStakingAllowanceCheckError, isStakingApproveError, isStakingCreateIntentError, isStakingError, isStakingInfoFetchError, isStakingOrchestrationError, isStellarChainKeyType, isStellarWalletProviderType, 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, robinhoodChain, serializeAddressData, silentLogger, sleep, sodaxInvariant, sonicWalletFactoryAbi, spokeAssetManagerAbi, sponsoringInvariant, stakedSodaAbi, stakingInvariant, stakingRouterAbi, stataTokenFactoryAbi, submitTransaction, swapExactInSingleParamsAbi, swapInvariant, toCreateBridgeIntentParamsV2, uiPoolDataAbi, universalRouterAbi, unknownFailed, valueToBigNumber, valueToZDBigNumber, variableDebtTokenAbi, vaultTokenAbi, verifyFailed, wadToRay, waitForStacksTransaction, waitForTransactionReceipt, waitUntilIntentExecuted, walletFactoryAbi, wrappedSonicAbi };
|
|
19238
|
+
export { ALLOWANCE_CHECK_CODES, APPROVE_CODES, type ActivateStellarAccountParams, type ActivateStellarAccountResult, type AggregatedReserveData, type AllowanceCheckErrorCode, type AllowanceInfo, type AllowanceResponse, type AllowanceTransferDetails, type AnalyticsActionData, type ApiResponse, type ApprovalTxs, type ApproveErrorCode, type ApyRange, type AssetDepositAction, type AssetEntry, AssetService, type AssetServiceConstructorParams, type AssetWithdrawAction, type AutoSwapPreferences, BackendApiService, type BackendApiServiceOptions, BackendHttpError, type BalanceCollector, type BalanceReadContext, 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, BridgeApiService, type BridgeApiServiceOptions, type BridgeApproveError, type BridgeApproveErrorCode, type BridgeCreateIntentError, type BridgeCreateIntentErrorCode, type BridgeError, type BridgeErrorCode, type BridgeExtras, 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, DETAILED_STATUS_NOT_DELIVERED, type DepositParams, type DepositSimulationParams, type DestinationParamsType, type DetailedLock, type DetailedStatusError, type DetailedStatusErrorCode, type DetailedSwapStatus, type DetailedSwapStatusKey, type DexApproveError, type DexApproveErrorCode, type DexCreateIntentError, type DexCreateIntentErrorCode, type DexError, type DexErrorCode, DexService, type DexServiceConstructorParams, type EModeCategory, type EModeCategoryHumanized, type EModeData, type EModeDataString, type EmodeDataHumanized, type EnrichedToken, type Erc20ApprovalPlan, type Erc20ApprovalPlanReason, type Erc20ApproveParams, type Erc20GetAllowanceParams, type Erc20IsAllowanceParams, type Erc20PlanApprovalParams, 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 FillEvent, 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 GetBalanceParams, type GetBalancesParams, 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, type LeverageYieldQuoteParams, 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, ORACLE_CANDLE_INTERVALS, type OnDemandBtcPayload, type OnDemandRelayData, type OptionalRaw, type OptionalSkipSimulation, type OptionalTimeout, type OracleCandle, type OracleCandleInterval, type OracleCandlesResponse, type OracleMarketInterval, type OracleMarketsResponse, 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, RELAY_FALLBACK_FLOOR_MS, RELAY_REQUEST_TIMEOUT_MS, RadfiApiError, type RadfiAuthResult, type RadfiBuildTxResponse, type RadfiErrorBody, type RadfiMaxSpentResponse, RadfiProvider, type RadfiProviderOptions, 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, SPEED_TIER_SECONDS, SPEED_TIER_THRESHOLDS, SPONSOR_CONFIG_TTL_MS, STELLAR_BASE_RESERVE_TTL_MS, STELLAR_TRUSTLINE_MIN_XLM_STROOPS, 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, type SponsorFailureAction, type SponsorFailureClass, type SponsoringAction, SponsoringApiService, type SponsoringApiServiceOptions, type SponsoringConfigError, type SponsoringConfigErrorCode, type SponsoringLookupError, type SponsoringLookupErrorCode, type SponsoringOrchestrationError, type SponsoringOrchestrationErrorCode, SponsoringService, 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, type StellarAccountStatus, StellarSpokeService, type SubmitTxParams, type SubmitTxResponse, SuiGrpcTransport, SuiSpokeService, SupportedMigrationTokens, type SwapAction, type SwapActionParams, type SwapCreateIntentError, type SwapCreateIntentErrorCode, type SwapError, type SwapErrorCode, type SwapExtras, type SwapResponse, SwapService, type SwapServiceConstructorParams, type SwapSpeedTier, type SwapSpeedTierParams, type SwapSpeedTierResult, SwapsApiService, type SwapsApiServiceOptions, 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 WalletBalanceMap, 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, classifySponsorError, connectionAbi, consoleLogger, convertTransactionInstructionToRaw, createBalanceCollector, createInvariant, deepMerge, defaultHookAbi, dexInvariant, encodeAddress, encodeBtcPayloadToBytes, encodeContractCalls, erc20Abi, erc4626Abi, estimateBitcoinTxSize, estimateSwapSpeedTier, 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, isApprovalSupportedChainKeyType, isAuthFailure, isAuthStatus, isBackendHttpError, isBalnMigrateParams, isBitcoinChainKeyType, isBitcoinWalletProviderType, isBridgeAllowanceCheckError, isBridgeApproveError, isBridgeCreateIntentError, isBridgeError, isBridgeLookupError, isBridgeOrchestrationError, isCodeMember, isDexApproveError, isDexCreateIntentError, isDexError, isEvmChainKeyType, isEvmSpokeChainConfig, isEvmSpokeOnlyChainKeyType, isEvmWalletProviderType, isFeatureError, isFillEvent, 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, isNativeBitcoinTransfer, isNearChainKeyType, isOptionalBitcoinWalletProviderType, isOptionalEvmWalletProviderType, isOptionalStellarWalletProviderType, isOracleCandleInterval, isPartnerError, isPartnerFeeAmount, isPartnerFeePercentage, isPostExecutionError, isRawDestinationParams, isRecoveryError, isResponseAddressType, isResponseSigningType, isRevertMigrationOrchestrationError, isSodaxError, isSolanaChainKeyType, isSolanaNativeToken, isSonicChainKeyType, isSpokeApproveParamsEvmSpoke, isSpokeApproveParamsHub, isSpokeApproveParamsStellar, isSpokeIsAllowanceValidParamsEvmSpoke, isSpokeIsAllowanceValidParamsHub, isSpokeIsAllowanceValidParamsStellar, isSponsoringConfigError, isSponsoringLookupError, isSponsoringOrchestrationError, isStacksChainKeyType, isStakeOrchestrationError, isStakingAllowanceCheckError, isStakingApproveError, isStakingCreateIntentError, isStakingError, isStakingInfoFetchError, isStakingOrchestrationError, isStellarChainKeyType, isStellarWalletProviderType, 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, robinhoodChain, serializeAddressData, settleWalletBalances, silentLogger, sleep, sodaxInvariant, sonicWalletFactoryAbi, spokeAssetManagerAbi, sponsoringInvariant, stakedSodaAbi, stakingInvariant, stakingRouterAbi, stataTokenFactoryAbi, submitTransaction, swapExactInSingleParamsAbi, swapInvariant, toCreateBridgeIntentParamsV2, uiPoolDataAbi, universalRouterAbi, unknownFailed, valueToBigNumber, valueToZDBigNumber, variableDebtTokenAbi, vaultTokenAbi, verifyFailed, wadToRay, waitForStacksTransaction, waitForTransactionReceipt, waitUntilIntentExecuted, walletFactoryAbi, wrappedSonicAbi };
|