@sodax/sdk 2.0.0 → 2.1.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/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
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, IConfigApiV1, ApiConfig, Address, GetAllConfigApiResponse, GetChainsApiResponse, GetSwapTokensApiResponse, SpokeChainKey, GetSwapTokensByChainIdApiResponse, GetMoneyMarketTokensApiResponse, GetMoneyMarketReserveAssetsApiResponse, GetMoneyMarketTokensByChainIdApiResponse, GetRelayChainIdMapApiResponse, GetSpokeChainConfigApiResponse, AnalyticsDetailLevel, AnalyticsEventPhase, AnalyticsOption, PartnerFee, SodaxConfig, SodaxOptions, XToken, OriginalAssetAddress, IntentRelayChainId, HubChainKey, HubConfig, PoolKey, SpokeChainConfig, RelayConfig, SolverConfig, SwapsConfig, BridgeConfig, MoneyMarketConfig, LeverageYieldConfig, DexConfig, GetSpokeChainConfigType, SodaxDefaultConfig, EvmContractCall, Hex, IEvmWalletProvider, EvmRawTransactionReceipt, QuoteType, EvmChainKey, DeepPartial, WalletProviderSlot, TxReturnType, ChainType, GetChainType, SolanaRawTransactionReceipt, StellarSorobanTransactionReceipt, IconTransactionResult, SuiRawTransactionReceipt, InjectiveRawTransactionReceipt, NearRawTransactionReceipt, StacksRawTransactionReceipt, BitcoinRawTransactionReceipt, GetAddressType, HubAddress, GetTokenAddressType, EvmSpokeOnlyChainKey, StellarChainKey, HookKind, SonicChainKey, AssetInfo, TokenInfo, VaultReserves, StacksChainKey, FeeEstimateTransaction, StacksTransactionParams, HttpUrl, RadfiConfig, IBitcoinWalletProvider, RadfiDepositTxResponse, BtcAddressType, BitcoinChainKey, BitcoinRawTransaction, NearChainKey, FillData, NearRawTransaction, INearWalletProvider, SuiPaginatedCoins, SuiChainKey, SuiExecutionResult, SuiGasEstimate, IStellarWalletProvider, StellarGasEstimate, SolanaChainKey, SolanaGasEstimate, SolanaBase58PublicKey, SolanaRawTransactionInstruction, SolanaSerializedTransaction, SolanaRpcResponseAndContext, SolanaTokenAmount, IconChainKey, IconGasEstimate, InjectiveChainKey, InjectiveGasEstimate, JsonObject, InjectiveCoin, InjectiveRawTransaction, IInjectiveWalletProvider, InjectiveExecuteResponse, GetEstimateGasReturnType, IconAddress, IWalletProvider, EvmSpokeChainConfig, PartnerFeeAmount, PartnerFeePercentage, GetWalletProviderType, SodaxLoggerOption, SpokeExecActionParams, FeeAmount, Hash as Hash$1, SolverIntentQuoteRequest, SolverIntentQuoteResponse, SolverErrorResponse, SolverIntentStatusRequest, SolverIntentStatusResponse, SolverExecutionRequest, SolverExecutionResponse, IconEoaAddress, IcxTokenType, IconContractAddress, BridgeLimit, UserUnstakeInfo, ConcentratedLiquidityConfig, LeverageYieldVault } from '@sodax/types';
1
+ import { SodaxFeature, 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, SuiPaginatedCoins, SuiChainKey, SuiExecutionResult, SuiGasEstimate, IStellarWalletProvider, StellarGasEstimate, SolanaChainKey, SolanaGasEstimate, SolanaBase58PublicKey, SolanaRawTransactionInstruction, SolanaSerializedTransaction, SolanaRpcResponseAndContext, SolanaTokenAmount, IconChainKey, IconGasEstimate, InjectiveChainKey, InjectiveGasEstimate, JsonObject, InjectiveCoin, InjectiveRawTransaction, IInjectiveWalletProvider, InjectiveExecuteResponse, GetEstimateGasReturnType, IconAddress, IWalletProvider, EvmSpokeChainConfig, PartnerFeeAmount, PartnerFeePercentage, GetWalletProviderType, SodaxLoggerOption, SpokeExecActionParams, FeeAmount, Hash as Hash$1, SolverIntentQuoteRequest, SolverIntentQuoteResponse, SolverErrorResponse, SolverIntentStatusRequest, SolverIntentStatusResponse, SolverExecutionRequest, SolverExecutionResponse, IconEoaAddress, IcxTokenType, IconContractAddress, BridgeLimit, UserUnstakeInfo, ConcentratedLiquidityConfig, LeverageYieldVault, SponsoringApiErrorCode } from '@sodax/types';
2
2
  export * from '@sodax/types';
3
3
  export { SodaxFeature } from '@sodax/types';
4
4
  import * as viem from 'viem';
@@ -59,7 +59,7 @@ export { SwapsApiError, SwapsApiErrorCode, SwapsApiErrorContext } from '@sodax/s
59
59
  * because retry semantics differ — re-estimation is cheap, retry-on-failure is the norm).
60
60
  * - `LOOKUP_FAILED` — any other read-only on-chain query / off-chain config fetch.
61
61
  * `context.method` partitions this code (`'getStakingInfo'`, `'getBridgeableAmount'`, …).
62
- * - `EXTERNAL_API_ERROR` — an upstream API call failed (e.g. solver, backend, swaps). `context.api`
62
+ * - `EXTERNAL_API_ERROR` — an upstream API call failed (e.g. solver, backend, swaps, bridge). `context.api`
63
63
  * identifies which service.
64
64
  * - `UNKNOWN` — last-resort catch in an outer `try`. Should be extremely rare in production.
65
65
  */
@@ -97,6 +97,7 @@ type RelayCode = 'SUBMIT_TX_FAILED' | 'RELAY_TIMEOUT' | 'RELAY_POLLING_FAILED' |
97
97
  * - `relayCode` — set on errors whose root cause is a relay-layer failure.
98
98
  * - `api` — set on `EXTERNAL_API_ERROR`. Identifies the upstream service.
99
99
  * - `method` — set on `LOOKUP_FAILED`. Names the read-only method that failed.
100
+ * - `status` / `nextAction` / retry fields — backend failure classification.
100
101
  * - `direction` — only set on migration's `migratebnUSD` (forward = legacy → new bnUSD;
101
102
  * reverse = new → legacy bnUSD).
102
103
  * - `field` / `reason` — set on `VALIDATION_FAILED` to identify which precondition tripped.
@@ -110,8 +111,13 @@ type SodaxErrorContext = {
110
111
  srcChainKey?: string;
111
112
  dstChainKey?: string;
112
113
  relayCode?: RelayCode;
113
- api?: 'solver' | 'backend' | 'swaps';
114
+ api?: 'solver' | 'backend' | 'swaps' | 'sponsoring' | 'bridge';
114
115
  method?: string;
116
+ status?: number;
117
+ nextAction?: string;
118
+ retryable?: boolean;
119
+ retryAfterSeconds?: number;
120
+ sponsorSequence?: string;
115
121
  direction?: 'forward' | 'reverse';
116
122
  field?: string;
117
123
  reason?: string;
@@ -135,7 +141,7 @@ declare const LOOKUP_CODES: ReadonlySet<LookupErrorCode>;
135
141
  /** Runtime list of all valid error codes — useful for membership checks and exhaustive switches. */
136
142
  declare const SODAX_ERROR_CODES: readonly ["USER_REJECTED", "VALIDATION_FAILED", "INTENT_CREATION_FAILED", "EXECUTION_FAILED", "TX_VERIFICATION_FAILED", "TX_SUBMIT_FAILED", "RELAY_TIMEOUT", "RELAY_FAILED", "APPROVE_FAILED", "ALLOWANCE_CHECK_FAILED", "GAS_ESTIMATION_FAILED", "LOOKUP_FAILED", "EXTERNAL_API_ERROR", "UNKNOWN"];
137
143
  /** Runtime list of all valid feature tags. */
138
- declare const SODAX_FEATURES: readonly ["swap", "moneyMarket", "bridge", "staking", "migration", "dex", "partner", "recovery", "backend", "leverageYield"];
144
+ declare const SODAX_FEATURES: readonly ["swap", "moneyMarket", "bridge", "staking", "migration", "dex", "partner", "recovery", "backend", "sponsoring", "leverageYield"];
139
145
 
140
146
  /**
141
147
  * Canonical error type for the SODAX SDK.
@@ -7502,6 +7508,19 @@ type RequestOverrideConfig = {
7502
7508
  timeout?: number;
7503
7509
  headers?: Record<string, string>;
7504
7510
  };
7511
+ /**
7512
+ * Non-2xx failure with structured status and body. The legacy
7513
+ * `HTTP_REQUEST_FAILED` message and cause chain are preserved.
7514
+ */
7515
+ declare class BackendHttpError extends Error {
7516
+ readonly status: number;
7517
+ readonly bodyText: string;
7518
+ /** Parsed JSON, or `undefined` for empty or malformed bodies. */
7519
+ readonly body: unknown;
7520
+ constructor(status: number, bodyText: string);
7521
+ }
7522
+ /** Bundle-safe guard that tolerates duplicate SDK copies. */
7523
+ declare function isBackendHttpError(error: unknown): error is BackendHttpError;
7505
7524
 
7506
7525
  /**
7507
7526
  * {@link ISwapsApiV2} with every method's return wrapped in `Result<T>` and an
@@ -7618,6 +7637,189 @@ declare class SwapsApiService implements ResultifiedSwapsApiV2 {
7618
7637
  getBaseURL(): string;
7619
7638
  }
7620
7639
 
7640
+ /** Result-wrapped {@link IStellarSponsoringApi} with per-request overrides. */
7641
+ type ResultifiedSponsoringApi = {
7642
+ [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;
7643
+ };
7644
+ /**
7645
+ * Uncached HTTP client for the sponsoring API. Stellar orchestration and
7646
+ * config caching belong to `SponsoringService`.
7647
+ *
7648
+ * Transport errors use `feature: 'backend'`; only the user-facing orchestrator
7649
+ * uses `feature: 'sponsoring'`.
7650
+ */
7651
+ declare class SponsoringApiService implements ResultifiedSponsoringApi {
7652
+ private readonly config;
7653
+ private readonly headers;
7654
+ private readonly logger;
7655
+ constructor(config: SponsoringApiConfig, logger?: SodaxLogger);
7656
+ /**
7657
+ * Validate a response while preserving HTTP failures on `error.cause` for
7658
+ * sponsor-error classification.
7659
+ */
7660
+ private request;
7661
+ /** Fetch build parameters, including the rotatable sponsor account. */
7662
+ getStellarSponsorConfig(config?: RequestOverrideConfig): Promise<Result<StellarSponsorConfig, SodaxError<'EXTERNAL_API_ERROR'>>>;
7663
+ /**
7664
+ * Submit a client-signed transaction for sponsor co-signing. An
7665
+ * `alreadyActive` response is also successful.
7666
+ */
7667
+ createStellarSponsoredAccount(body: StellarSponsoredAccountRequest, config?: RequestOverrideConfig): Promise<Result<StellarSponsoredAccountResponse, SodaxError<'EXTERNAL_API_ERROR'>>>;
7668
+ setHeaders(headers: Record<string, string>): void;
7669
+ getBaseURL(): string;
7670
+ }
7671
+
7672
+ /**
7673
+ * {@link IBridgeApiV2} with every method's return wrapped in `Result<T>` and an
7674
+ * optional trailing `RequestOverrideConfig`. `BridgeApiService` implements this
7675
+ * (rather than `IBridgeApiV2` directly) because it never throws — like
7676
+ * `SwapsApiService`, it returns `{ ok: false }` on failure instead of
7677
+ * `Promise<T>` rejection. The mapped type keeps the class in lockstep with the
7678
+ * canonical interface: every endpoint is covered with its exact payload types.
7679
+ */
7680
+ type ResultifiedBridgeApiV2 = {
7681
+ [K in keyof IBridgeApiV2]: IBridgeApiV2[K] extends (...args: infer A) => Promise<infer R> ? (...args: [...A, config?: RequestOverrideConfig]) => Promise<Result<R>> : never;
7682
+ };
7683
+ /**
7684
+ * Map the SDK-domain bridge params (`CreateBridgeIntentParams`) onto the wire DTO
7685
+ * {@link CreateBridgeIntentParamsV2} (swaps naming). The input is typed structurally rather
7686
+ * than imported from `../bridge/BridgeService.js` to keep `backendApi` free of a
7687
+ * `backendApi → bridge` import cycle.
7688
+ *
7689
+ * @param params - SDK-domain params (`srcToken`/`dstToken`/`amount`/`recipient`).
7690
+ * @param extras - Optional `srcPublicKey` / Bitcoin `bound` extras.
7691
+ */
7692
+ declare function toCreateBridgeIntentParamsV2(params: {
7693
+ srcChainKey: string;
7694
+ dstChainKey: string;
7695
+ srcToken: string;
7696
+ dstToken: string;
7697
+ amount: bigint;
7698
+ srcAddress: string;
7699
+ recipient: string;
7700
+ }, extras?: {
7701
+ srcPublicKey?: string;
7702
+ bound?: BitcoinBoundExtrasV2;
7703
+ partnerFee?: PartnerFeeV2;
7704
+ }): CreateBridgeIntentParamsV2;
7705
+ /**
7706
+ * HTTP client for the backend **Bridge API v2** (`/bridge/*`).
7707
+ *
7708
+ * Mirrors every endpoint of {@link IBridgeApiV2} (one method per route) and
7709
+ * validates each response at runtime with a valibot schema (see
7710
+ * `bridgeApiSchemas.ts`). On a contract drift, the response is rejected as
7711
+ * `{ ok: false }` with a descriptive error rather than returned untyped.
7712
+ *
7713
+ * All public methods return `Promise<Result<T>>` — they never throw. On network
7714
+ * failure, timeout, non-2xx HTTP response, or response-shape validation failure,
7715
+ * the returned Result has `ok: false` with a canonical
7716
+ * `SodaxError<'EXTERNAL_API_ERROR'>` (`feature: 'backend'`, `context.api: 'bridge'`)
7717
+ * in the `error` field; the underlying failure is preserved on `error.cause`.
7718
+ *
7719
+ * Per-call request overrides (base URL, timeout, headers) can be passed as the
7720
+ * optional last argument to any method via `RequestOverrideConfig`.
7721
+ *
7722
+ * The Bridge API is served on the base backend host (`/bridge/*` sub-paths) — its config is resolved by
7723
+ * `resolveBridgeApiConfig` (an alias of `resolveBaseApiConfig`), so it is typed as a flat
7724
+ * {@link BaseApiConfig}. It defaults to the same host as the swaps client but is not configured with it:
7725
+ * a `swapsApiConfig` slice does not move the bridge routes; set `baseURL` / `baseApiConfig` instead.
7726
+ *
7727
+ * Reachable on the Sodax facade as `sodax.api.bridge`.
7728
+ */
7729
+ declare class BridgeApiService implements ResultifiedBridgeApiV2 {
7730
+ private readonly config;
7731
+ private readonly headers;
7732
+ private readonly logger;
7733
+ constructor(config: BaseApiConfig, logger?: SodaxLogger);
7734
+ /**
7735
+ * Issues a single HTTP request, validates the JSON body against `schema`, and
7736
+ * wraps the result in `Result<T>`. The service-level `baseURL`/`timeout`/
7737
+ * `headers` are merged with the optional per-call `overrideConfig` (which takes
7738
+ * precedence) inside {@link makeRequest}. Every public method delegates here.
7739
+ */
7740
+ private request;
7741
+ /**
7742
+ * Fetch all supported bridge tokens grouped by SpokeChainKey.
7743
+ *
7744
+ * @returns `Result<GetBridgeTokensResponseV2>` — map of chain key → token list.
7745
+ */
7746
+ getTokens(config?: RequestOverrideConfig): Promise<Result<GetBridgeTokensResponseV2>>;
7747
+ /**
7748
+ * Fetch supported bridge tokens for a single SpokeChainKey.
7749
+ *
7750
+ * @param chainKey - SODAX SpokeChainKey (e.g. `0xa4b1.arbitrum`, `solana`).
7751
+ * @returns `Result<GetBridgeTokensByChainResponseV2>` — token list for the chain.
7752
+ */
7753
+ getTokensByChain(chainKey: string, config?: RequestOverrideConfig): Promise<Result<GetBridgeTokensByChainResponseV2>>;
7754
+ /**
7755
+ * Check whether the source token allowance is already sufficient for the bridge.
7756
+ *
7757
+ * @returns `Result<BridgeAllowanceCheckResponseV2>` — `{ valid }`.
7758
+ */
7759
+ checkAllowance(body: CreateBridgeIntentParamsV2, config?: RequestOverrideConfig): Promise<Result<BridgeAllowanceCheckResponseV2>>;
7760
+ /**
7761
+ * Build an unsigned token-approval transaction for the source token.
7762
+ *
7763
+ * @returns `Result<BridgeApproveResponseV2>` — `{ tx }` (chain-specific unsigned tx).
7764
+ */
7765
+ approve(body: CreateBridgeIntentParamsV2, config?: RequestOverrideConfig): Promise<Result<BridgeApproveResponseV2>>;
7766
+ /**
7767
+ * Build an unsigned spoke-deposit (create-bridge-intent) transaction.
7768
+ *
7769
+ * @returns `Result<CreateBridgeIntentResponseV2>` — `{ tx, relayData }` (no intent struct).
7770
+ */
7771
+ createBridgeIntent(body: CreateBridgeIntentParamsV2, config?: RequestOverrideConfig): Promise<Result<CreateBridgeIntentResponseV2>>;
7772
+ /**
7773
+ * Submit a broadcast bridge (spoke-deposit) transaction to be processed (relayed).
7774
+ * Carries the FULL `relayData { address, payload }` envelope. Idempotent on `(txHash, srcChainKey)`.
7775
+ *
7776
+ * @returns `Result<BridgeSubmitTxResponseV2>` — `{ success, data: { status, message } }`.
7777
+ */
7778
+ submitTx(body: BridgeSubmitTxRequestV2, config?: RequestOverrideConfig): Promise<Result<BridgeSubmitTxResponseV2>>;
7779
+ /**
7780
+ * Get the processing status of a submitted bridge transaction by `(txHash, srcChainKey)`.
7781
+ *
7782
+ * @returns `Result<BridgeSubmitTxStatusResponseV2>` — `{ success, data }` (processing state).
7783
+ */
7784
+ getSubmitTxStatus(query: BridgeSubmitTxStatusQueryV2, config?: RequestOverrideConfig): Promise<Result<BridgeSubmitTxStatusResponseV2>>;
7785
+ /**
7786
+ * Bridge partner fee for an input amount (per-request `partnerFee` override, else the configured default).
7787
+ * NOTE: this is a pure client-side computation
7788
+ * in the SDK core (`sodax.bridge.getFee`) — prefer that (no round-trip); this HTTP variant exists for
7789
+ * parity with the backend `/bridge/fee` endpoint (for consumers using only `sodax.api.bridge`).
7790
+ *
7791
+ * @returns `Result<BridgeFeeResponseV2>` — `{ fee }` (decimal string).
7792
+ */
7793
+ getFee(body: BridgeFeeRequestV2, config?: RequestOverrideConfig): Promise<Result<BridgeFeeResponseV2>>;
7794
+ /**
7795
+ * Deposit capacity / withdrawal liquidity for a (from, to) token pair. Computable client-side in the
7796
+ * SDK core (`sodax.bridge.getBridgeableAmount`); this HTTP variant mirrors `/bridge/bridgeable-amount`.
7797
+ *
7798
+ * @returns `Result<BridgeableAmountResponseV2>` — `{ limit }`.
7799
+ */
7800
+ getBridgeableAmount(body: BridgeQuoteRequestV2, config?: RequestOverrideConfig): Promise<Result<BridgeableAmountResponseV2>>;
7801
+ /**
7802
+ * Whether a (from, to) token pair is bridgeable. Computable client-side in the SDK core
7803
+ * (`sodax.bridge.isBridgeable`); this HTTP variant mirrors `/bridge/bridgeable/check`.
7804
+ *
7805
+ * @returns `Result<BridgeableCheckResponseV2>` — `{ bridgeable }`.
7806
+ */
7807
+ isBridgeable(body: BridgeQuoteRequestV2, config?: RequestOverrideConfig): Promise<Result<BridgeableCheckResponseV2>>;
7808
+ /**
7809
+ * Merge additional headers into the service's default header set. Existing
7810
+ * keys are overwritten; keys absent from `headers` are preserved.
7811
+ */
7812
+ setHeaders(headers: Record<string, string>): void;
7813
+ /** Return the base URL the service is currently pointing at. */
7814
+ getBaseURL(): string;
7815
+ /**
7816
+ * Return the effective per-request timeout (ms). Callers that bound a request tighter than the
7817
+ * service default (e.g. `pollBackendSubmitTx` clamping to its poll cutoff) need this as the ceiling,
7818
+ * because a `RequestOverrideConfig.timeout` REPLACES the service value rather than lowering it.
7819
+ */
7820
+ getTimeout(): number;
7821
+ }
7822
+
7621
7823
  /** Full details of a single swap intent as stored and returned by the backend. */
7622
7824
  interface IntentResponse {
7623
7825
  intentHash: string;
@@ -7762,27 +7964,12 @@ interface MoneyMarketBorrowers {
7762
7964
  */
7763
7965
  declare class BackendApiService implements IConfigApiV1 {
7764
7966
  readonly swaps: SwapsApiService;
7967
+ readonly sponsoring: SponsoringApiService;
7968
+ readonly bridge: BridgeApiService;
7765
7969
  private readonly config;
7766
7970
  private readonly headers;
7767
7971
  private readonly logger;
7768
7972
  constructor(config: ApiConfig, logger?: SodaxLogger);
7769
- /**
7770
- * Wraps {@link makeRequest} in a `Result<T>` so all errors are captured rather
7771
- * than propagated as thrown exceptions. Every public endpoint method delegates
7772
- * here instead of calling `makeRequest` directly.
7773
- */
7774
- /**
7775
- * Fold any per-call override (carried on `config` alongside `method`/`body`) over the service
7776
- * defaults: baseURL truthy-fallback (an empty-string override defers to the default), timeout
7777
- * nullish-fallback, headers merged (override wins per key). Mirrors the original makeRequest merge.
7778
- */
7779
- private resolveRequestConfig;
7780
- /**
7781
- * Wrap a thrown transport failure (HTTP_REQUEST_FAILED / REQUEST_TIMEOUT / network error) as the
7782
- * canonical backend `SodaxError` — identical shape to SwapsApiService; the underlying failure is
7783
- * preserved on `error.cause`.
7784
- */
7785
- private toExternalApiError;
7786
7973
  /**
7787
7974
  * Issue a request and validate the JSON body against `schema`, wrapping the result in `Result<T>`.
7788
7975
  * Mirrors {@link SwapsApiService}: a 2xx body that fails the schema is surfaced as
@@ -8022,9 +8209,8 @@ declare class BackendApiService implements IConfigApiV1 {
8022
8209
  * without constructing a new service instance. Existing header keys are
8023
8210
  * overwritten; keys absent from `headers` are preserved.
8024
8211
  *
8025
- * The headers are also fanned out to the sub-services (`swaps`), which hold
8026
- * their own header copies — so a token set here applies to every request made
8027
- * through this client, including `swaps.*`.
8212
+ * Headers also reach `swaps`, which shares this origin, but never `sponsoring`,
8213
+ * whose separate origin must not receive base-API credentials.
8028
8214
  *
8029
8215
  * @param headers - Key-value pairs to add or overwrite in the default headers.
8030
8216
  */
@@ -8115,6 +8301,12 @@ type ConfigServiceConstructorParams = {
8115
8301
  * never supplies it; it is purely a client-side option.
8116
8302
  */
8117
8303
  fee?: PartnerFee;
8304
+ /**
8305
+ * RadFi/Bound request signer (the `radfi.signRequest` option passed to `new Sodax(...)`). Held
8306
+ * outside the swappable `SodaxConfig` — like {@link logger} — so a dynamic config fetch never
8307
+ * replaces it. Read by {@link BitcoinSpokeService} to inject Bound `x-api-signature` headers.
8308
+ */
8309
+ radfiSigner?: RadfiSigner;
8118
8310
  };
8119
8311
  /**
8120
8312
  * ConfigApiService - Service for fetching configuration data from the backend API or fallbacking to default values
@@ -8138,6 +8330,13 @@ declare class ConfigService {
8138
8330
  * a client-side option set via `new Sodax({ fee })`. Per-feature overrides live on the feature config.
8139
8331
  */
8140
8332
  readonly fee: PartnerFee | undefined;
8333
+ /**
8334
+ * RadFi/Bound request signer. Resolved once at construction and kept independent of {@link sodax}
8335
+ * so that {@link initialize}'s dynamic-config swap never clobbers it. Read by `BitcoinSpokeService`
8336
+ * via `config.radfiSigner`; `undefined` unless the consumer passed `radfi.signRequest` to
8337
+ * `new Sodax(...)`. Holds the function reference only — never a credential.
8338
+ */
8339
+ readonly radfiSigner: RadfiSigner | undefined;
8141
8340
  private initialized;
8142
8341
  private supportedHubAssetsSet;
8143
8342
  private supportedSodaVaultAssetsSet;
@@ -8148,7 +8347,7 @@ declare class ConfigService {
8148
8347
  private stakedATokenAddressesSet;
8149
8348
  private chainToSupportedTokenAddressMap;
8150
8349
  private hubAssetToXTokenMap;
8151
- constructor({ api, config, userConfig, logger, analytics, fee }: ConfigServiceConstructorParams);
8350
+ constructor({ api, config, userConfig, logger, analytics, fee, radfiSigner }: ConfigServiceConstructorParams);
8152
8351
  initialize(): Promise<Result<void>>;
8153
8352
  getChains(): GetChainsApiResponse;
8154
8353
  getSwapTokens(): GetSwapTokensApiResponse;
@@ -8255,6 +8454,12 @@ declare function mergeSodaxConfig(base: SodaxDefaultConfig, override: SodaxOptio
8255
8454
  declare function encodeContractCalls(calls: EvmContractCall[]): Hex;
8256
8455
  declare function waitForTransactionReceipt(hash: Hex, provider: IEvmWalletProvider): Promise<EvmRawTransactionReceipt>;
8257
8456
 
8457
+ /**
8458
+ * True when `(chainKey, token)` denotes native BTC on the Bitcoin chain — the only transfer whose amount is
8459
+ * denominated in satoshis and therefore subject to `BITCOIN_DUST_SATS`. BTC-family tokens are 8-decimal,
8460
+ * so a base-unit amount equals its satoshi value on both the deposit (source) and delivery (destination) side.
8461
+ */
8462
+ declare function isNativeBitcoinTransfer(config: ConfigService, chainKey: SpokeChainKey, token: XToken | undefined): boolean;
8258
8463
  declare function retry<T>(action: (retryCount: number) => Promise<T>, retryCount?: number, delayMs?: number): Promise<T>;
8259
8464
  declare function getRandomBytes(length: number): Uint8Array;
8260
8465
  declare function randomUint256(): bigint;
@@ -9201,11 +9406,22 @@ type RadfiMaxSpentResponse = {
9201
9406
  feeRate: number;
9202
9407
  fee: number;
9203
9408
  };
9409
+ /**
9410
+ * Runtime wiring for {@link RadfiProvider} — everything that is a live object rather than
9411
+ * serializable config (which belongs on {@link RadfiConfig}). An object, not a positional
9412
+ * parameter, because this is a public class and the next such dependency would otherwise be
9413
+ * a third argument. gh-831.
9414
+ */
9415
+ type RadfiProviderOptions = {
9416
+ /** Attaches per-request headers to outbound Bound `apiUrl` calls, e.g. a backend's HMAC closure. */
9417
+ signer?: RadfiSigner;
9418
+ };
9204
9419
  declare class RadfiProvider {
9205
9420
  private readonly config;
9421
+ private readonly signer?;
9206
9422
  accessToken: string;
9207
9423
  refreshToken: string;
9208
- constructor(config: RadfiConfig);
9424
+ constructor(config: RadfiConfig, options?: RadfiProviderOptions);
9209
9425
  /**
9210
9426
  * Authenticate with Bound Exchange: BIP322-sign a login message, then call the Bound Exchange API.
9211
9427
  * Returns accessToken, refreshToken, and tradingAddress.
@@ -9263,6 +9479,9 @@ declare class RadfiProvider {
9263
9479
  }, accessToken: string): Promise<string>;
9264
9480
  /**
9265
9481
  * Fetch expired (or near-expiry) UTXOs for a trading wallet address from UMS API.
9482
+ *
9483
+ * UMS call — unsigned by design, like `getBalance`: the backend credential is scoped to the
9484
+ * Sodax endpoints on `apiUrl`, so a configured signer intentionally does not reach here.
9266
9485
  */
9267
9486
  getExpiredUtxos(tradingAddress: string, params?: {
9268
9487
  page?: number;
@@ -9752,6 +9971,11 @@ declare class StellarSpokeService {
9752
9971
  * @returns {Promise<TxReturnType<StellarChainKey, R>>} A promise that resolves to the transaction hash or raw transaction.
9753
9972
  */
9754
9973
  deposit<R extends boolean = false>(params: DepositParams<StellarChainKey, R>): Promise<TxReturnType<StellarChainKey, R>>;
9974
+ /**
9975
+ * Whether a token requires a trustline. Native XLM and legacy bnUSD are
9976
+ * exempt and therefore need no subentry reserve.
9977
+ */
9978
+ requiresTrustline(token: string): boolean;
9755
9979
  /**
9756
9980
  * Check if the user has sufficient trustline established for the token.
9757
9981
  * @param token - The token address to check the trustline for.
@@ -10164,6 +10388,14 @@ type RelayAndWaitParams = {
10164
10388
  timeout: number | undefined;
10165
10389
  pollTxHash?: string;
10166
10390
  };
10391
+ /**
10392
+ * Minimum `timeout` a feature's client-side relay fallback passes to {@link relayTxAndWaitPacket} when
10393
+ * its shared budget is spent. `relayTxAndWaitPacket` submits the tx to the relay BEFORE `timeout`
10394
+ * bounds anything (only the packet wait is bounded), so a zero/negative remainder must never skip the
10395
+ * call: the spoke deposit has already landed on chain and would otherwise sit unrelayed. Re-relay is
10396
+ * idempotent, so spending this floor is always safe.
10397
+ */
10398
+ declare const RELAY_FALLBACK_FLOOR_MS = 5000;
10167
10399
  /**
10168
10400
  * Submits a transaction to the intent relay service.
10169
10401
  *
@@ -13291,11 +13523,40 @@ type CreateBridgeIntentParams<K extends SpokeChainKey = SpokeChainKey> = {
13291
13523
  dstToken: string;
13292
13524
  recipient: string;
13293
13525
  };
13294
- type BridgeParams<ChainKey extends SpokeChainKey, Raw extends boolean> = SpokeExecActionParams<ChainKey, Raw, CreateBridgeIntentParams<ChainKey>>;
13526
+ /**
13527
+ * Per-action extras for bridge intent creation, supplied via the `extras` slot of the bridge
13528
+ * action params. Mirrors `SwapExtras` chain-keyed slots, plus a chain-agnostic `partnerFee` per-action
13529
+ * override that takes precedence over the config-level `bridgePartnerFee` (omit it to use the configured fee).
13530
+ *
13531
+ * - `srcPublicKey` — only for Stacks sources (their address can't yield the signer public key at
13532
+ * raw-tx build time); keyed off `K` so non-Stacks actions can't set it.
13533
+ * - `bound` — Bound Exchange (Radfi) inputs for raw Bitcoin TRADING-mode sources; keyed off `K`
13534
+ * so non-Bitcoin actions can't set it.
13535
+ */
13536
+ type BridgeExtras<K extends SpokeChainKey = SpokeChainKey> = (GetChainType<K> extends 'STACKS' ? {
13537
+ srcPublicKey?: string;
13538
+ } : {
13539
+ srcPublicKey?: never;
13540
+ }) & (GetChainType<K> extends 'BITCOIN' ? {
13541
+ bound?: BitcoinBoundExtras;
13542
+ } : {
13543
+ bound?: never;
13544
+ }) & {
13545
+ /**
13546
+ * Per-action partner-fee override. When present, takes precedence over the config-level
13547
+ * `bridgePartnerFee` for this call, so an integrator can charge (and route) its own fee per bridge.
13548
+ * Omit to use the configured fee. Chain-agnostic (unlike `srcPublicKey`/`bound`).
13549
+ */
13550
+ partnerFee?: PartnerFee;
13551
+ };
13552
+ type BridgeParams<ChainKey extends SpokeChainKey, Raw extends boolean> = SpokeExecActionParams<ChainKey, Raw, CreateBridgeIntentParams<ChainKey>, BridgeExtras<ChainKey>>;
13295
13553
  type BridgeServiceConstructorParams = {
13296
13554
  hubProvider: HubProvider;
13297
13555
  config: ConfigService;
13298
13556
  spoke: SpokeService;
13557
+ backendApi: BackendApiService;
13558
+ /** Opt-in backend submit-tx flow (from `SodaxOptions.bridgeOptions.useBackendSubmitTx`). Default off. */
13559
+ useBackendSubmitTx?: boolean;
13299
13560
  };
13300
13561
  /**
13301
13562
  * Orchestrates cross-chain token transfers within the SODAX hub-and-spoke architecture.
@@ -13316,17 +13577,21 @@ declare class BridgeService {
13316
13577
  readonly hubProvider: HubProvider;
13317
13578
  readonly config: ConfigService;
13318
13579
  readonly spoke: SpokeService;
13319
- constructor({ hubProvider, config, spoke }: BridgeServiceConstructorParams);
13580
+ readonly backendApi: BackendApiService;
13581
+ readonly useBackendSubmitTx: boolean;
13582
+ constructor({ hubProvider, config, spoke, backendApi, useBackendSubmitTx }: BridgeServiceConstructorParams);
13320
13583
  /**
13321
13584
  * Calculates the partner fee deducted from a given bridge input amount.
13322
13585
  *
13323
- * Returns `0n` when no partner fee is configured. The fee is denominated in the
13324
- * same units as `inputAmount` (vault token decimals, 18 dp).
13586
+ * Returns `0n` when no partner fee is configured. `inputAmount` must be in 18-dp hub/vault
13587
+ * units — the units the hub deducts the fee in (see `buildBridgeData`) — NOT the spoke token's
13588
+ * native base units. This matters for a fixed `PartnerFee.amount`, which is wei-denominated
13589
+ * (18 dp); a percentage fee is unit-agnostic.
13325
13590
  *
13326
- * @param inputAmount - Gross amount being bridged, in vault token base units.
13591
+ * @param inputAmount - Gross amount being bridged, in 18-dp hub/vault units.
13327
13592
  * @returns Fee amount to be deducted, in the same units as `inputAmount`.
13328
13593
  */
13329
- getFee(inputAmount: bigint): bigint;
13594
+ getFee(inputAmount: bigint, partnerFee?: PartnerFee | undefined): bigint;
13330
13595
  /**
13331
13596
  * Checks whether the caller has sufficient token allowance to execute the bridge.
13332
13597
  *
@@ -13392,6 +13657,27 @@ declare class BridgeService {
13392
13657
  * }
13393
13658
  */
13394
13659
  bridge<K extends SpokeChainKey>(_params: BridgeParams<K, false>): Promise<Result<TxHashPair, BridgeOrchestrationError>>;
13660
+ /**
13661
+ * Client-side bridge completion (the default path): verify the broadcast spoke-deposit tx, then
13662
+ * relay it to the hub and wait for the settlement packet. Extracted verbatim from `bridge()` so the
13663
+ * opt-in backend submit-tx path ({@link submitTx}) can fall back to it on any non-success. Bridge
13664
+ * always relays — there is no hub-source short-circuit.
13665
+ */
13666
+ private fallbackBridgeSteps;
13667
+ /**
13668
+ * Backend bridge path (opt-in via `bridgeOptions.useBackendSubmitTx`): hand the broadcast
13669
+ * spoke-deposit tx to the bridge API (`POST /bridge/submit-tx`) with the FULL `relayData`
13670
+ * envelope; the backend relays server-side. Polls `getSubmitTxStatus` until `executed`, then
13671
+ * returns the same {@link TxHashPair} the client-side path returns (`result.dstIntentTxHash` →
13672
+ * destination tx hash; bridge has no solver `intent_hash`).
13673
+ *
13674
+ * Never throws — returns `{ ok: false }` on any non-success (submit `!ok`, terminal `failed` /
13675
+ * abandoned, or poll timeout) so `bridge()` falls back to {@link fallbackBridgeSteps}. Falling back
13676
+ * is safe: re-relaying an already-relayed bridge tx is idempotent — the relay dedups and returns the
13677
+ * existing `executed` packet. Polling stops at `deadline - reserve` so the fallback keeps a
13678
+ * guaranteed slice of the shared `bridge` budget.
13679
+ */
13680
+ private submitTx;
13395
13681
  /**
13396
13682
  * Submits the spoke-side deposit transaction that initiates a bridge transfer,
13397
13683
  * without waiting for the cross-chain relay to complete.
@@ -13425,6 +13711,20 @@ declare class BridgeService {
13425
13711
  * Sonic-sourced "withdraw directly" bridge can find the matching vault/decimals.
13426
13712
  */
13427
13713
  private resolveBridgeEndpointToken;
13714
+ /**
13715
+ * Post-fee amounts for a bridge, in the units each hub step operates in. Single source for the fee +
13716
+ * vault-decimal pipeline, so {@link buildBridgeData}'s encoded hub calls and the BTC-destination dust
13717
+ * guard in {@link createBridgeIntent} can never disagree about what actually gets delivered.
13718
+ *
13719
+ * A spoke endpoint's amount is translated INTO 18-dp vault units on the way in (skipped when the
13720
+ * endpoint already IS the vault asset), the partner fee is deducted there — so a fixed
13721
+ * `PartnerFee.amount` is wei-denominated, never spoke-denominated — and the remainder is translated
13722
+ * back OUT into the destination endpoint's own units.
13723
+ *
13724
+ * @returns `feeAmount` and `withdrawAmount` in 18-dp vault units (what the hub fee transfer and vault
13725
+ * withdrawal use), and `delivered` in the destination endpoint's units (what the recipient receives).
13726
+ */
13727
+ private computeBridgeAmounts;
13428
13728
  /**
13429
13729
  * Encodes the hub-side execution payload for a bridge operation.
13430
13730
  *
@@ -17036,6 +17336,196 @@ declare class LeverageYieldService {
17036
17336
  getShareBalanceForUser<K extends SpokeChainKey>(vault: Address, srcChainKey: K, srcAddress: string): Promise<Result<bigint, LeverageYieldLookupError>>;
17037
17337
  }
17038
17338
 
17339
+ declare const sponsoringInvariant: FeatureInvariant;
17340
+ type SponsoringAction = 'activateStellarAccount';
17341
+ type SponsoringOrchestrationErrorCode = Extract<SodaxErrorCode, 'USER_REJECTED' | 'VALIDATION_FAILED' | 'INTENT_CREATION_FAILED' | 'LOOKUP_FAILED' | 'EXTERNAL_API_ERROR' | 'EXECUTION_FAILED' | 'UNKNOWN'>;
17342
+ type SponsoringConfigErrorCode = Extract<SodaxErrorCode, 'EXTERNAL_API_ERROR' | 'VALIDATION_FAILED' | 'UNKNOWN'>;
17343
+ type SponsoringLookupErrorCode = LookupErrorCode;
17344
+ type SponsoringOrchestrationError = SodaxError<SponsoringOrchestrationErrorCode>;
17345
+ type SponsoringConfigError = SodaxError<SponsoringConfigErrorCode>;
17346
+ type SponsoringLookupError = SodaxError<SponsoringLookupErrorCode>;
17347
+ declare const isSponsoringOrchestrationError: (e: unknown) => e is SodaxError<SponsoringOrchestrationErrorCode>;
17348
+ declare const isSponsoringConfigError: (e: unknown) => e is SodaxError<SponsoringConfigErrorCode>;
17349
+ declare const isSponsoringLookupError: (e: unknown) => e is SodaxError<LookupErrorCode>;
17350
+ /**
17351
+ * Caller action derived from a sponsoring failure.
17352
+ *
17353
+ * `rebuildAndResign` requires a new signature; `retrySameRequest` reuses
17354
+ * the signed XDR; `backoff` waits before retrying.
17355
+ */
17356
+ type SponsorFailureAction = 'fixIntegration' | 'checkApiKey' | 'rebuildAndResign' | 'retrySameRequest' | 'backoff' | 'contactOperator' | 'abort';
17357
+ interface SponsorFailureClass {
17358
+ action: SponsorFailureAction;
17359
+ retryable: boolean;
17360
+ requiresNewSignature: boolean;
17361
+ /** Absent for transport failures, timeouts, and schema failures. */
17362
+ status?: number;
17363
+ /** Present only for a recognized domain code. */
17364
+ code?: SponsoringApiErrorCode;
17365
+ /** Human-readable only; do not use for control flow. */
17366
+ message: string;
17367
+ /** Server-provided backoff in seconds. */
17368
+ retryAfterSeconds?: number;
17369
+ /** Advisory sponsor sequence supplied on a conflict. */
17370
+ sponsorSequence?: string;
17371
+ }
17372
+ /**
17373
+ * Classify a failed sponsoring request into the caller's next action.
17374
+ *
17375
+ * HTTP status is primary; recognized domain codes refine statuses whose handling
17376
+ * differs by cause.
17377
+ */
17378
+ declare function classifySponsorError(error: SodaxError<'EXTERNAL_API_ERROR'>): SponsorFailureClass;
17379
+
17380
+ /**
17381
+ * Mirrors the server's config cache window so sponsor rotation propagates
17382
+ * within one minute.
17383
+ */
17384
+ declare const SPONSOR_CONFIG_TTL_MS = 60000;
17385
+ /**
17386
+ * The base reserve only moves at a network upgrade, so one read per hour is
17387
+ * ample and keeps account-status polling to a single request.
17388
+ */
17389
+ declare const STELLAR_BASE_RESERVE_TTL_MS = 3600000;
17390
+ /**
17391
+ * Spendable XLM required for one trustline at the base reserve Stellar has
17392
+ * published since protocol 12. It is the fallback only: the live requirement
17393
+ * is `StellarAccountStatus.trustlineMinXlmStroops`, computed from the network's
17394
+ * current base reserve, which validators can vote to change.
17395
+ */
17396
+ declare const STELLAR_TRUSTLINE_MIN_XLM_STROOPS: bigint;
17397
+ type StellarAccountStatus = {
17398
+ exists: boolean;
17399
+ /** Total native XLM in stroops; `0n` when the account does not exist. */
17400
+ nativeBalanceStroops: bigint;
17401
+ /** Total minus locked reserves and selling liabilities. */
17402
+ availableBalanceStroops: bigint;
17403
+ /** Whether available balance can fund one additional trustline. */
17404
+ canAffordTrustline: boolean;
17405
+ /**
17406
+ * Spendable XLM one more trustline needs, at the network's current base
17407
+ * reserve. Render this rather than {@link STELLAR_TRUSTLINE_MIN_XLM_STROOPS}.
17408
+ */
17409
+ trustlineMinXlmStroops: bigint;
17410
+ };
17411
+ type ActivateStellarAccountParams = {
17412
+ /** Stellar account to activate. Must be the account `walletProvider` signs with. */
17413
+ address: string;
17414
+ /**
17415
+ * Signs as the account being created. The SDK must not broadcast before the
17416
+ * server adds the sponsor signature.
17417
+ */
17418
+ walletProvider: IStellarWalletProvider;
17419
+ /**
17420
+ * Allow one rebuild and new signature after a sequence conflict. Defaults to
17421
+ * `true`; disable for headless callers.
17422
+ */
17423
+ allowSequenceRetry?: boolean;
17424
+ /**
17425
+ * Re-submit the same signed payload after `HORIZON_UNAVAILABLE`.
17426
+ * Defaults to 2; `0` disables.
17427
+ */
17428
+ maxHorizonRetries?: number;
17429
+ /**
17430
+ * Fired before each wallet prompt so a UI can explain a required re-sign
17431
+ * before the extension takes focus.
17432
+ */
17433
+ onSignatureRequired?: (info: {
17434
+ attempt: 1 | 2;
17435
+ reason: 'initial' | 'sequenceConflict';
17436
+ }) => void;
17437
+ forceConfigRefresh?: boolean;
17438
+ requestConfig?: RequestOverrideConfig;
17439
+ };
17440
+ type ActivateStellarAccountResult = {
17441
+ status: 'submitted';
17442
+ hash: string;
17443
+ /** Number of wallet signatures; `2` means a sequence conflict was retried. */
17444
+ attempts: 1 | 2;
17445
+ } | {
17446
+ /** No transaction was needed; `attempts: 0` means no wallet prompt. */
17447
+ status: 'alreadyActive';
17448
+ hash: null;
17449
+ attempts: 0 | 1 | 2;
17450
+ };
17451
+ /**
17452
+ * Orchestrates sponsored Stellar activation: config caching, Horizon reads,
17453
+ * account signing, sponsor submission, and bounded retries.
17454
+ */
17455
+ declare class SponsoringService {
17456
+ private readonly config;
17457
+ private readonly spoke;
17458
+ private readonly api;
17459
+ /** Keyed by base URL to isolate deployment-specific sponsor config. */
17460
+ private readonly configCache;
17461
+ private readonly inflightConfig;
17462
+ private baseReserveCache;
17463
+ private inflightBaseReserve;
17464
+ constructor(deps: {
17465
+ config: ConfigService;
17466
+ spoke: SpokeService;
17467
+ api: BackendApiService;
17468
+ });
17469
+ private get horizon();
17470
+ /**
17471
+ * Whether an account exists. Read failures remain errors rather than being
17472
+ * misreported as inactive.
17473
+ */
17474
+ isStellarAccountActive(params: {
17475
+ address: string;
17476
+ }): Promise<Result<boolean, SponsoringLookupError>>;
17477
+ /**
17478
+ * Return account existence and trustline affordability. Costs one Horizon
17479
+ * account read, plus a base-reserve read on the first call per hour.
17480
+ */
17481
+ getStellarAccountStatus(params: {
17482
+ address: string;
17483
+ }): Promise<Result<StellarAccountStatus, SponsoringLookupError>>;
17484
+ /**
17485
+ * Shared account read. A 404 resolves to `undefined` because absence is a
17486
+ * legitimate answer; every other failure remains an error.
17487
+ */
17488
+ private readAccount;
17489
+ /**
17490
+ * The base reserve is a validator-controlled network setting, so read it from
17491
+ * the latest ledger rather than assuming the published 0.5 XLM. A failed read
17492
+ * degrades to that value: this drives a UI hint, never a signed transaction.
17493
+ */
17494
+ private resolveBaseReserveStroops;
17495
+ /**
17496
+ * Cache key for a config request: the resolved base URL plus any per-call
17497
+ * headers. Headers can select a different response from the same URL — an API
17498
+ * key scoped to another deployment, or a test harness's scenario header — so
17499
+ * folding them in stops one caller's override from being served to, or
17500
+ * overwriting, the default path. Kept in memory as a Map key only.
17501
+ */
17502
+ private configCacheKey;
17503
+ /**
17504
+ * Fetch sponsor config with per-endpoint caching and in-flight deduplication.
17505
+ * Failures are never cached.
17506
+ */
17507
+ getStellarSponsorConfig(params?: {
17508
+ forceRefresh?: boolean;
17509
+ requestConfig?: RequestOverrideConfig;
17510
+ }): Promise<Result<StellarSponsorConfig, SponsoringConfigError>>;
17511
+ /**
17512
+ * Activate an account with a sponsored base reserve. Config and existence are
17513
+ * checked before prompting; sponsor sequence is never cached.
17514
+ */
17515
+ activateStellarAccount(params: ActivateStellarAccountParams): Promise<Result<ActivateStellarAccountResult, SponsoringOrchestrationError>>;
17516
+ /** One build, sign, and submit attempt. */
17517
+ private attemptActivation;
17518
+ /**
17519
+ * Re-submit identical signed bytes only for `retrySameRequest` failures.
17520
+ */
17521
+ private submitWithHorizonRetry;
17522
+ /**
17523
+ * Best-effort existence pre-flight. Read failures continue to activation
17524
+ * because the server performs the authoritative check.
17525
+ */
17526
+ private accountExistsBestEffort;
17527
+ }
17528
+
17039
17529
  /**
17040
17530
  * Sodax class is used to interact with the Sodax.
17041
17531
  *
@@ -17053,6 +17543,7 @@ declare class Sodax {
17053
17543
  readonly partners: PartnerService;
17054
17544
  readonly recovery: RecoveryService;
17055
17545
  readonly dex: DexService;
17546
+ readonly sponsoring: SponsoringService;
17056
17547
  readonly leverageYield: LeverageYieldService;
17057
17548
  readonly config: ConfigService;
17058
17549
  readonly hubProvider: HubProvider;
@@ -17706,4 +18197,4 @@ type DexApproveErrorCode = ApproveErrorCode;
17706
18197
  type DexApproveError = SodaxError<DexApproveErrorCode>;
17707
18198
  declare const isDexApproveError: (e: unknown) => e is SodaxError<ApproveErrorCode>;
17708
18199
 
17709
- export { ALLOWANCE_CHECK_CODES, APPROVE_CODES, type AggregatedReserveData, type AllowanceCheckErrorCode, type AllowanceInfo, type AllowanceResponse, type AllowanceTransferDetails, type AnalyticsActionData, type ApiResponse, type ApproveErrorCode, type ApyRange, type AssetDepositAction, type AssetEntry, AssetService, type AssetServiceConstructorParams, type AssetWithdrawAction, type AutoSwapPreferences, BackendApiService, type BalnLockParams, type BalnMigrateAction, type BalnMigrateParams, type BalnSwapAbi, BalnSwapService, type BalnSwapServiceConstructorParams, type BaseCurrencyInfo, BigIntToHex, type BigNumberValue, BigNumberZeroDecimal, type BitcoinBoundExtras, BitcoinSpokeService, type BitcoinTransactionResult, type BitcoinUTXO, BnUSDMigrationService, type BnUSDMigrationServiceConstructorParams, type BnUSDRevertMigrationParams, type BorrowInfo, type BridgeAction, type BridgeAllowanceCheckError, type BridgeAllowanceCheckErrorCode, type BridgeApproveError, type BridgeApproveErrorCode, type BridgeCreateIntentError, type BridgeCreateIntentErrorCode, type BridgeError, type BridgeErrorCode, type BridgeLookupError, type BridgeLookupErrorCode, type BridgeOrchestrationError, type BridgeOrchestrationErrorCode, type BridgeParams, BridgeService, type BridgeServiceConstructorParams, type BtcPayload, CREATE_INTENT_CODES, type CalculateAllReserveIncentivesRequest, type CalculateAllUserIncentivesRequest, type CalculateCompoundedRateRequest, type CallResponse, type CancelIntentActionParams, type CancelIntentParams, type CancelUnstakeAction, type CancelUnstakeParams, type ClClaimRewardsParams, type ClDecreaseLiquidityParams, type ClGetPoolDataParams, type ClIncreaseLiquidityParams, type ClLiquidityClaimRewardsAction, type ClLiquidityDecreaseLiquidityAction, type ClLiquidityIncreaseLiquidityAction, type ClLiquidityWithdrawAction, type ClMintPositionEventLog, type ClPositionInfo, ClService, type ClServiceConstructorParams, type ClSupplyAction, type ClSupplyParams, type ClWithdrawParams, type ClaimAction, type ClaimParams, type CombinedReserveData, type ComputedUserReserve, type ConcentratedLiquidityParams, type ConcentratedLiquidityTokenInfo, ConfigService, type ConfigServiceConstructorParams, type ConnMsg, type CreateAssetDepositParams, type CreateAssetWithdrawParams, type CreateBridgeIntentParams, type CreateIntentErrorCode, type CreateIntentParams, type CreateIntentResult, type CreateLimitOrderParams, type CreateSonicSwapIntentParams, type CreateVaultIntentResult, type CreateViemPublicClientParams, CustomSorobanServer, CustomStellarAccount, type DepositParams, type DepositSimulationParams, type DestinationParamsType, type DetailedLock, type 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 Erc20ApproveParams, type Erc20IsAllowanceParams, Erc20Service, type Erc20Token, Erc4626Service, type EstimateGasParams, EvmAssetManagerService, type EvmDepositToDataParams, EvmHubProvider, type EvmHubProviderConstructorParams, EvmSolverService, EvmSpokeService, EvmVaultTokenService, type EvmWithdrawAssetDataParams, type ExecuteMsg, type FeatureInvariant, type FeeData, type FeeTokenApproveAction, type FeeTokenApproveParams, type FetchHubAssetBalancesParams, type FormatReserveRequest, type FormatReserveResponse, type FormatReserveUSDRequest, type FormatReserveUSDResponse, type FormatReservesAndIncentivesUSDRequest, type FormatReservesUSDRequest, type FormatUserSummaryAndIncentivesRequest, type FormatUserSummaryAndIncentivesResponse, type FormatUserSummaryRequest, type FormatUserSummaryResponse, type FormattedReserveEMode, GAS_ESTIMATION_CODES, type GasEstimationErrorCode, type GetDepositParams, type GetIntentSubmitTxExtraDataParams, type GetPacketParams, type GetPacketResponse, type GetQuoteParams, type GetRelayRequestParamType, type GetRelayResponse, type GetSpokeServiceType, type GetTransactionPacketsParams, type GetTransactionPacketsResponse, type GetTxReceiptType, type GetUserIntentParams, type GetUserRouterParams, HALF_RAY, HALF_WAD, type HanaWalletRequestEvent, type HanaWalletResponseEvent, type HookRequest, HookService, HttpRelayError, type HubAssetBalance, type HubProvider, type IconJsonRpcVersion, IconSpokeService, type IcxCreateRevertMigrationParams, type IcxMigrateAction, type IcxMigrateParams, IcxMigrationService, type IcxMigrationServiceConstructorParams, type IcxRevertMigrationAction, type IcxRevertMigrationParams, type IncentiveDataHumanized, type InjTokenInfo, Injective20Token, type InjectiveBalance, InjectiveSpokeService, type InstantUnstakeAction, type InstantUnstakeParams, type InstantiateMsg, type Intent, type IntentAutoSwapResult, IntentCreatedEventAbi, type IntentCreatedEventLog, type IntentData, IntentDataService, IntentDataType, type IntentDeliveryInfo, IntentFilledEventAbi, type IntentFilledEventLog, type IntentRelayRequest, type IntentRelayRequestParams, type IntentResponse, type IntentState, type IntentTxResult, IntentsAbi, type JsonRpcPayloadResponse, LOOKUP_CODES, LTV_PRECISION, LendingPoolService, type LendingPoolServiceConstructorParams, type LeverageYieldAction, type LeverageYieldAllowanceCheckError, type LeverageYieldAllowanceCheckErrorCode, type LeverageYieldAllowanceParams, type LeverageYieldApproveError, type LeverageYieldApproveErrorCode, type LeverageYieldApproveParams, type LeverageYieldApr, type LeverageYieldCreateIntentError, type LeverageYieldCreateIntentErrorCode, type LeverageYieldEffectiveApr, type LeverageYieldError, type LeverageYieldErrorCode, type LeverageYieldLookupError, type LeverageYieldLookupErrorCode, type LeverageYieldLsdApr, type LeverageYieldPosition, type LeverageYieldPostExecutionError, type LeverageYieldPostExecutionErrorCode, LeverageYieldService, type LeverageYieldServiceConstructorParams, type LeverageYieldSwapDepositParams, type LeverageYieldSwapError, type LeverageYieldSwapErrorCode, type LeverageYieldSwapPayload, type LeverageYieldSwapWithdrawParams, type LimitOrderActionParams, LockupMultiplier, LockupPeriod, type LookupErrorCode, type MapRelayFailureCtx, type MigrateOrchestrationError, type MigrateOrchestrationErrorCode, type MigrationAction, type MigrationAllowanceCheckError, type MigrationAllowanceCheckErrorCode, type MigrationApproveError, type MigrationApproveErrorCode, type MigrationCreateIntentError, type MigrationCreateIntentErrorCode, type MigrationDirection, type MigrationError, type MigrationErrorCode, type MigrationLookupError, type MigrationLookupErrorCode, type MigrationOp, type MigrationParams, type MigrationRevertParams, MigrationService, type MigrationServiceConstructorParams, type MigrationTokens, MintPositionEventAbi, type MintPositionEventLog, type MoneyMarketAction, type MoneyMarketAllowanceCheckError, type MoneyMarketAllowanceCheckErrorCode, type MoneyMarketAllowanceParams, type MoneyMarketApproveActionParams, type MoneyMarketApproveError, type MoneyMarketApproveErrorCode, type MoneyMarketAsset, type MoneyMarketAssetBorrowers, type MoneyMarketAssetSuppliers, type MoneyMarketBorrowActionParams, type MoneyMarketBorrowParams, type MoneyMarketBorrowers, type MoneyMarketCreateIntentError, type MoneyMarketCreateIntentErrorCode, MoneyMarketDataService, type MoneyMarketDataServiceConstructorParams, type MoneyMarketEncodeBorrowParams, type MoneyMarketEncodeRepayParams, type MoneyMarketEncodeRepayWithATokensParams, type MoneyMarketEncodeSupplyParams, type MoneyMarketEncodeWithdrawParams, type MoneyMarketError, type MoneyMarketErrorCode, type MoneyMarketGasEstimationError, type MoneyMarketGasEstimationErrorCode, type MoneyMarketOrchestrationError, type MoneyMarketOrchestrationErrorCode, type MoneyMarketParams, type MoneyMarketPosition, type MoneyMarketRepayActionParams, type MoneyMarketRepayParams, MoneyMarketService, type MoneyMarketServiceConstructorParams, type MoneyMarketSupplyActionParams, type MoneyMarketSupplyParams, type MoneyMarketWithdrawActionParams, type MoneyMarketWithdrawParams, NEAR_DEFAULT_GAS, NEAR_STORAGE_DEPOSIT, NearSpokeService, type OnDemandBtcPayload, type OnDemandRelayData, type OptionalRaw, type OptionalSkipSimulation, type OptionalTimeout, type OrderbookResponse, type PacketData, type PartnerAction, type PartnerError, type PartnerErrorCode, type PartnerFeeClaimAssetBalance, type PartnerFeeClaimCancelAction, type PartnerFeeClaimCancelParams, PartnerFeeClaimService, type PartnerFeeClaimServiceConstructorParams, type PartnerFeeClaimSwapAction, type PartnerFeeClaimSwapParams, PartnerService, type PartnerServiceConfig, type PartnerServiceConstructorParams, Permit2Service, type PermitBatch, type PermitDetails, type PermitSingle, type PoolBaseCurrencyHumanized, type PoolData, type PoolRewardConfig, type PoolSpokeAssets, type PostExecutionError, type PostExecutionErrorCode, ProtocolIntentsAbi, type QueryMsg, type QueryResponse, RAY, RAY_DECIMALS, RELAY_ERROR_CODES, RadfiApiError, type RadfiAuthResult, type RadfiBuildTxResponse, type RadfiErrorBody, type RadfiMaxSpentResponse, RadfiProvider, type RadfiResponseEnvelope, type RadfiTradingWallet, type RadfiUtxo, type RadfiUtxoListResponse, type RadfiWalletBalance, type RateLimitConfig, type RawDestinationParams, type RecoveryAction, type RecoveryError, type RecoveryErrorCode, RecoveryService, type RecoveryServiceConstructorParams, type RelayAction, type RelayAndWaitParams, type RelayCode, type RelayErrorCode, type RelayExtraData, type RelayRequestDetail, type RelayRequestSigning, type RelayTxStatus, type RelayWrappedErrorCode, type RequestConfig, type RequestOverrideConfig, type RequestTrustlineParams, type ReserveCalculationData, type ReserveData, type ReserveDataHumanized, type ReserveDataLegacy, type ReserveDataWithPrice, type ReserveEMode, type ReserveIncentiveDict, type ReservesDataHumanized, type ReservesIncentiveDataHumanized, type ResolvedAnalytics, type ResponseAddressType, type ResponseSigningType, type RevertMigrationOrchestrationError, type RevertMigrationOrchestrationErrorCode, type RewardInfoHumanized, SECONDS_PER_YEAR, SODAX_ERROR_CODES, SODAX_FEATURES, type SendMessageParams, type SetSwapPreferenceAction, type SetSwapPreferenceParams, Sodax, SodaxError, type SodaxErrorCode, type SodaxErrorContext, type SodaxErrorJSON, type SodaxPhase, SolanaSpokeService, SolverApiService, SonicSpokeService, type SpokeApproveParams, type SpokeApproveParamsEvmSpoke, type SpokeApproveParamsHub, type SpokeApproveParamsStellar, type SpokeIsAllowanceValidParams, type SpokeIsAllowanceValidParamsEvmSpoke, type SpokeIsAllowanceValidParamsHub, type SpokeIsAllowanceValidParamsOther, type SpokeIsAllowanceValidParamsStellar, SpokeService, type SpokeServiceConstructorParams, type SpokeServiceType, StacksSpokeService, type StakeAction, type StakeOrchestrationError, type StakeOrchestrationErrorCode, type StakeParams, type StakingActionType, type StakingActionUnion, type StakingAllowanceCheckError, type StakingAllowanceCheckErrorCode, type StakingApproveError, type StakingApproveErrorCode, type StakingConfig, type StakingCreateIntentError, type StakingCreateIntentErrorCode, type StakingError, type StakingErrorCode, type StakingInfo, type StakingInfoFetchError, type StakingInfoFetchErrorCode, StakingLogic, type StakingOrchestrationError, type StakingOrchestrationErrorCode, type StakingParamsUnion, StakingService, type StakingServiceConstructorParams, type State, StellarSpokeService, type SubmitTxParams, type SubmitTxResponse, SuiSpokeService, SupportedMigrationTokens, type SwapAction, type SwapActionParams, type SwapCreateIntentError, type SwapCreateIntentErrorCode, type SwapError, type SwapErrorCode, type SwapExtras, type SwapResponse, SwapService, type SwapServiceConstructorParams, SwapsApiService, type TokenSpenderPair, type TokenWithConversion, type TxHashPair, type TxStatus, USD_DECIMALS, type UiPoolDataProviderInterface, UiPoolDataProviderService, type UiPoolDataProviderServiceConstructorParams, type UnifiedBnUSDMigrateAction, type UnifiedBnUSDMigrateParams, type UnstakeAction, type UnstakeParams, type UnstakeRequest, type UnstakeRequestWithPenalty, type UnstakingInfo, type UserIncentiveData, type UserIncentiveDataHumanized, type UserIncentiveDict, type UserIntentsResponse, type UserReserveCalculationData, type UserReserveData, type UserReserveDataHumanized, type UserReserveDataString, type UserReservesIncentivesDataHumanized, type UserRewardInfoHumanized, type VaultSwapActionParams, type VaultSwapResponse, type VerifySimulationParams, type VerifyTxHashParams, WAD, WAD_RAY_RATIO, WEI_DECIMALS, type WaitForTxReceiptParams, type WaitForTxReceiptReturnType, type WaitUntilIntentExecutedPayload, type WalletMode, type WalletSimulationParams, type WithdrawHubAssetAction, type WithdrawHubAssetParams, type WithdrawInfo, adjustAmountByFee, allowanceCheckFailed, approveFailed, assetManagerAbi, balnSwapAbi, binomialApproximatedRayPow, bridgeInvariant, calcOpReturnOutputVbytes, calculateAllReserveIncentives, calculateAllUserIncentives, calculateAvailableBorrowsMarketReferenceCurrency, calculateCompoundedInterest, calculateCompoundedRate, calculateFeeAmount, calculateHealthFactorFromBalances, calculateHealthFactorFromBalancesBigUnits, calculateLinearInterest, calculatePercentageFeeAmount, clPoolAbi, clPoolManagerAbi, clPositionManagerAbi, clQuoterAbi, clRouterAbi, clTickLensAbi, connectionAbi, consoleLogger, convertTransactionInstructionToRaw, createInvariant, deepMerge, defaultHookAbi, dexInvariant, encodeAddress, encodeBtcPayloadToBytes, encodeContractCalls, erc20Abi, erc4626Abi, estimateBitcoinTxSize, executionFailed, formatBasisPoints, formatEModeCategory, formatEModes, formatPercentage, formatReserve, formatReserveUSD, formatReserves, formatReservesAndIncentives, formatUserSummary, formatUserSummaryAndIncentives, gasEstimationFailed, getAndFormatReserveEModes, getAssetManagerIdl, getAssetManagerProgram, getCompoundedBalance, getConnectionIdl, getConnectionProgram, getEvmViemChain, getIconAddressBytes, getLinearBalance, getMarketReferenceCurrencyAndUsdBalance, getPacket, getProvider, getRandomBytes, getReserveNormalizedIncome, getReservesEModes, getSolanaAddressBytes, getTransactionPackets, hexToBigInt, hexToSolanaAddress, hyper, intentCreationFailed, isBalnMigrateParams, isBitcoinChainKeyType, isBitcoinWalletProviderType, isBridgeAllowanceCheckError, isBridgeApproveError, isBridgeCreateIntentError, isBridgeError, isBridgeLookupError, isBridgeOrchestrationError, isCodeMember, isDexApproveError, isDexCreateIntentError, isDexError, isEvmChainKeyType, isEvmSpokeChainConfig, isEvmSpokeOnlyChainKeyType, isEvmWalletProviderType, isFeatureError, isHubChainKeyType, isIconAddress, isIconChainKeyType, isIcxCreateRevertMigrationParams, isIcxMigrateParams, isInjectiveChainKeyType, isJsonRpcPayloadResponse, isLeverageYieldAllowanceCheckError, isLeverageYieldApproveError, isLeverageYieldCreateIntentError, isLeverageYieldError, isLeverageYieldLookupError, isLeverageYieldPostExecutionError, isLeverageYieldSwapError, isMigrateOrchestrationError, isMigrationAllowanceCheckError, isMigrationApproveError, isMigrationCreateIntentError, isMigrationError, isMigrationLookupError, isMoneyMarketAllowanceCheckError, isMoneyMarketApproveError, isMoneyMarketCreateIntentError, isMoneyMarketError, isMoneyMarketGasEstimationError, isMoneyMarketOrchestrationError, isNearChainKeyType, isOptionalBitcoinWalletProviderType, isOptionalEvmWalletProviderType, isOptionalStellarWalletProviderType, isPartnerError, isPartnerFeeAmount, isPartnerFeePercentage, isPostExecutionError, isRawDestinationParams, isRecoveryError, isResponseAddressType, isResponseSigningType, isRevertMigrationOrchestrationError, isSodaxError, isSolanaChainKeyType, isSolanaNativeToken, isSonicChainKeyType, isSpokeApproveParamsEvmSpoke, isSpokeApproveParamsHub, isSpokeApproveParamsStellar, isSpokeIsAllowanceValidParamsEvmSpoke, isSpokeIsAllowanceValidParamsHub, isSpokeIsAllowanceValidParamsStellar, isStacksChainKeyType, isStakeOrchestrationError, isStakingAllowanceCheckError, isStakingApproveError, isStakingCreateIntentError, isStakingError, isStakingInfoFetchError, isStakingOrchestrationError, isStellarChainKeyType, isStellarWalletProviderType, isSuiChainKeyType, isSwapCreateIntentError, isSwapError, isUndefinedOrValidWalletProviderForChainKey, isUnifiedBnUSDMigrateParams, leverageYieldInvariant, lookupFailed, mapRelayFailure, mergeSodaxConfig, messageOf, migrationInvariant, mintPositionParamsAbi, mmInvariant, modifyLiquidityParamsAbi, nativeToUSD, noopAnalytics, normalize, normalizeBN, normalizePsbtToBase64, normalizeSignatureToBase64, normalizedToUsd, pancakeSwapInfinityDefaultHookAbi, pancakeSwapInfinityPoolManagerAbi, pancakeSwapInfinityPositionManagerAbi, parseToStroops, parseTokenArrayFromJson, partnerInvariant, permit2Abi, poolAbi, poolKeyAbi, randomUint256, rayDiv, rayMul, rayPow, rayToWad, recoveryInvariant, relayTxAndWaitPacket, requestAddress, requestJsonRpc, requestSigning, resolveAnalytics, resolveLogger, retry, reverseEncodeAddress, serializeAddressData, silentLogger, sleep, sodaxInvariant, sonicWalletFactoryAbi, spokeAssetManagerAbi, stakedSodaAbi, stakingInvariant, stakingRouterAbi, stataTokenFactoryAbi, submitTransaction, swapExactInSingleParamsAbi, swapInvariant, uiPoolDataAbi, universalRouterAbi, unknownFailed, valueToBigNumber, valueToZDBigNumber, variableDebtTokenAbi, vaultTokenAbi, verifyFailed, wadToRay, waitForStacksTransaction, waitForTransactionReceipt, waitUntilIntentExecuted, walletFactoryAbi, wrappedSonicAbi };
18200
+ 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 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 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, type DepositParams, type DepositSimulationParams, type DestinationParamsType, type DetailedLock, 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 Erc20ApproveParams, type Erc20IsAllowanceParams, Erc20Service, type Erc20Token, Erc4626Service, type EstimateGasParams, EvmAssetManagerService, type EvmDepositToDataParams, EvmHubProvider, type EvmHubProviderConstructorParams, EvmSolverService, EvmSpokeService, EvmVaultTokenService, type EvmWithdrawAssetDataParams, type ExecuteMsg, type FeatureInvariant, type FeeData, type FeeTokenApproveAction, type FeeTokenApproveParams, type FetchHubAssetBalancesParams, type FormatReserveRequest, type FormatReserveResponse, type FormatReserveUSDRequest, type FormatReserveUSDResponse, type FormatReservesAndIncentivesUSDRequest, type FormatReservesUSDRequest, type FormatUserSummaryAndIncentivesRequest, type FormatUserSummaryAndIncentivesResponse, type FormatUserSummaryRequest, type FormatUserSummaryResponse, type FormattedReserveEMode, GAS_ESTIMATION_CODES, type GasEstimationErrorCode, type GetDepositParams, type GetIntentSubmitTxExtraDataParams, type GetPacketParams, type GetPacketResponse, type GetQuoteParams, type GetRelayRequestParamType, type GetRelayResponse, type GetSpokeServiceType, type GetTransactionPacketsParams, type GetTransactionPacketsResponse, type GetTxReceiptType, type GetUserIntentParams, type GetUserRouterParams, HALF_RAY, HALF_WAD, type HanaWalletRequestEvent, type HanaWalletResponseEvent, type HookRequest, HookService, HttpRelayError, type HubAssetBalance, type HubProvider, type IconJsonRpcVersion, IconSpokeService, type IcxCreateRevertMigrationParams, type IcxMigrateAction, type IcxMigrateParams, IcxMigrationService, type IcxMigrationServiceConstructorParams, type IcxRevertMigrationAction, type IcxRevertMigrationParams, type IncentiveDataHumanized, type InjTokenInfo, Injective20Token, type InjectiveBalance, InjectiveSpokeService, type InstantUnstakeAction, type InstantUnstakeParams, type InstantiateMsg, type Intent, type IntentAutoSwapResult, IntentCreatedEventAbi, type IntentCreatedEventLog, type IntentData, IntentDataService, IntentDataType, type IntentDeliveryInfo, IntentFilledEventAbi, type IntentFilledEventLog, type IntentRelayRequest, type IntentRelayRequestParams, type IntentResponse, type IntentState, type IntentTxResult, IntentsAbi, type JsonRpcPayloadResponse, LOOKUP_CODES, LTV_PRECISION, LendingPoolService, type LendingPoolServiceConstructorParams, type LeverageYieldAction, type LeverageYieldAllowanceCheckError, type LeverageYieldAllowanceCheckErrorCode, type LeverageYieldAllowanceParams, type LeverageYieldApproveError, type LeverageYieldApproveErrorCode, type LeverageYieldApproveParams, type LeverageYieldApr, type LeverageYieldCreateIntentError, type LeverageYieldCreateIntentErrorCode, type LeverageYieldEffectiveApr, type LeverageYieldError, type LeverageYieldErrorCode, type LeverageYieldLookupError, type LeverageYieldLookupErrorCode, type LeverageYieldLsdApr, type LeverageYieldPosition, type LeverageYieldPostExecutionError, type LeverageYieldPostExecutionErrorCode, LeverageYieldService, type LeverageYieldServiceConstructorParams, type LeverageYieldSwapDepositParams, type LeverageYieldSwapError, type LeverageYieldSwapErrorCode, type LeverageYieldSwapPayload, type LeverageYieldSwapWithdrawParams, type LimitOrderActionParams, LockupMultiplier, LockupPeriod, type LookupErrorCode, type MapRelayFailureCtx, type MigrateOrchestrationError, type MigrateOrchestrationErrorCode, type MigrationAction, type MigrationAllowanceCheckError, type MigrationAllowanceCheckErrorCode, type MigrationApproveError, type MigrationApproveErrorCode, type MigrationCreateIntentError, type MigrationCreateIntentErrorCode, type MigrationDirection, type MigrationError, type MigrationErrorCode, type MigrationLookupError, type MigrationLookupErrorCode, type MigrationOp, type MigrationParams, type MigrationRevertParams, MigrationService, type MigrationServiceConstructorParams, type MigrationTokens, MintPositionEventAbi, type MintPositionEventLog, type MoneyMarketAction, type MoneyMarketAllowanceCheckError, type MoneyMarketAllowanceCheckErrorCode, type MoneyMarketAllowanceParams, type MoneyMarketApproveActionParams, type MoneyMarketApproveError, type MoneyMarketApproveErrorCode, type MoneyMarketAsset, type MoneyMarketAssetBorrowers, type MoneyMarketAssetSuppliers, type MoneyMarketBorrowActionParams, type MoneyMarketBorrowParams, type MoneyMarketBorrowers, type MoneyMarketCreateIntentError, type MoneyMarketCreateIntentErrorCode, MoneyMarketDataService, type MoneyMarketDataServiceConstructorParams, type MoneyMarketEncodeBorrowParams, type MoneyMarketEncodeRepayParams, type MoneyMarketEncodeRepayWithATokensParams, type MoneyMarketEncodeSupplyParams, type MoneyMarketEncodeWithdrawParams, type MoneyMarketError, type MoneyMarketErrorCode, type MoneyMarketGasEstimationError, type MoneyMarketGasEstimationErrorCode, type MoneyMarketOrchestrationError, type MoneyMarketOrchestrationErrorCode, type MoneyMarketParams, type MoneyMarketPosition, type MoneyMarketRepayActionParams, type MoneyMarketRepayParams, MoneyMarketService, type MoneyMarketServiceConstructorParams, type MoneyMarketSupplyActionParams, type MoneyMarketSupplyParams, type MoneyMarketWithdrawActionParams, type MoneyMarketWithdrawParams, NEAR_DEFAULT_GAS, NEAR_STORAGE_DEPOSIT, NearSpokeService, type OnDemandBtcPayload, type OnDemandRelayData, type OptionalRaw, type OptionalSkipSimulation, type OptionalTimeout, type OrderbookResponse, type PacketData, type PartnerAction, type PartnerError, type PartnerErrorCode, type PartnerFeeClaimAssetBalance, type PartnerFeeClaimCancelAction, type PartnerFeeClaimCancelParams, PartnerFeeClaimService, type PartnerFeeClaimServiceConstructorParams, type PartnerFeeClaimSwapAction, type PartnerFeeClaimSwapParams, PartnerService, type PartnerServiceConfig, type PartnerServiceConstructorParams, Permit2Service, type PermitBatch, type PermitDetails, type PermitSingle, type PoolBaseCurrencyHumanized, type PoolData, type PoolRewardConfig, type PoolSpokeAssets, type PostExecutionError, type PostExecutionErrorCode, ProtocolIntentsAbi, type QueryMsg, type QueryResponse, RAY, RAY_DECIMALS, RELAY_ERROR_CODES, RELAY_FALLBACK_FLOOR_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, SuiSpokeService, SupportedMigrationTokens, type SwapAction, type SwapActionParams, type SwapCreateIntentError, type SwapCreateIntentErrorCode, type SwapError, type SwapErrorCode, type SwapExtras, type SwapResponse, SwapService, type SwapServiceConstructorParams, SwapsApiService, 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, isBackendHttpError, isBalnMigrateParams, isBitcoinChainKeyType, isBitcoinWalletProviderType, isBridgeAllowanceCheckError, isBridgeApproveError, isBridgeCreateIntentError, isBridgeError, isBridgeLookupError, isBridgeOrchestrationError, isCodeMember, isDexApproveError, isDexCreateIntentError, isDexError, isEvmChainKeyType, isEvmSpokeChainConfig, isEvmSpokeOnlyChainKeyType, isEvmWalletProviderType, isFeatureError, isHubChainKeyType, isIconAddress, isIconChainKeyType, isIcxCreateRevertMigrationParams, isIcxMigrateParams, isInjectiveChainKeyType, isJsonRpcPayloadResponse, isLeverageYieldAllowanceCheckError, isLeverageYieldApproveError, isLeverageYieldCreateIntentError, isLeverageYieldError, isLeverageYieldLookupError, isLeverageYieldPostExecutionError, isLeverageYieldSwapError, isMigrateOrchestrationError, isMigrationAllowanceCheckError, isMigrationApproveError, isMigrationCreateIntentError, isMigrationError, isMigrationLookupError, isMoneyMarketAllowanceCheckError, isMoneyMarketApproveError, isMoneyMarketCreateIntentError, isMoneyMarketError, isMoneyMarketGasEstimationError, isMoneyMarketOrchestrationError, 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, 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 };