@sodax/sdk 2.1.0-rc.2 → 2.1.0-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +682 -173
- package/dist/index.d.cts +340 -62
- package/dist/index.d.ts +340 -62
- package/dist/index.mjs +682 -173
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -7623,7 +7623,9 @@ declare class SwapsApiService implements ResultifiedSwapsApiV2 {
|
|
|
7623
7623
|
getPartnerFee(query: FeeQueryV2, config?: RequestOverrideConfig): Promise<Result<FeeResponseV2>>;
|
|
7624
7624
|
/** Compute the protocol (solver) fee for a given input amount. */
|
|
7625
7625
|
getSolverFee(query: FeeQueryV2, config?: RequestOverrideConfig): Promise<Result<FeeResponseV2>>;
|
|
7626
|
-
/** Submit a swap transaction to be processed (relay, post-execution, etc.). Idempotent on `(txHash, srcChainKey)`.
|
|
7626
|
+
/** Submit a swap transaction to be processed (relay, post-execution, etc.). Idempotent on `(txHash, srcChainKey)`.
|
|
7627
|
+
* Response is immediate after successful submission. Use getSubmitTxStatus to poll the status of the submission.
|
|
7628
|
+
*/
|
|
7627
7629
|
submitTx(body: SubmitTxRequestV2, config?: RequestOverrideConfig): Promise<Result<SubmitTxResponseV2>>;
|
|
7628
7630
|
/** Get the processing status of a submitted swap transaction by `(txHash, srcChainKey)`. */
|
|
7629
7631
|
getSubmitTxStatus(query: SubmitTxStatusQueryV2, config?: RequestOverrideConfig): Promise<Result<SubmitTxStatusResponseV2>>;
|
|
@@ -7635,6 +7637,16 @@ declare class SwapsApiService implements ResultifiedSwapsApiV2 {
|
|
|
7635
7637
|
setHeaders(headers: Record<string, string>): void;
|
|
7636
7638
|
/** Return the base URL the service is currently pointing at. */
|
|
7637
7639
|
getBaseURL(): string;
|
|
7640
|
+
/**
|
|
7641
|
+
* Return the effective per-request timeout (ms) — the same value {@link buildClient} resolves, so
|
|
7642
|
+
* `SwapsApiConfig.timeout` being optional never leaks an `undefined` ceiling.
|
|
7643
|
+
*
|
|
7644
|
+
* Callers bounding a request tighter than this need it as the CEILING, because a
|
|
7645
|
+
* `RequestOverrideConfig.timeout` REPLACES the service value rather than lowering it: an override
|
|
7646
|
+
* derived from a caller budget alone would raise the bound whenever that budget is the larger of the
|
|
7647
|
+
* two. `SubmitTxAttempt.requestTimeout` clamps against both (`min(budget left in the attempt, this)`).
|
|
7648
|
+
*/
|
|
7649
|
+
getTimeout(): number;
|
|
7638
7650
|
}
|
|
7639
7651
|
|
|
7640
7652
|
/** Result-wrapped {@link IStellarSponsoringApi} with per-request overrides. */
|
|
@@ -7813,9 +7825,12 @@ declare class BridgeApiService implements ResultifiedBridgeApiV2 {
|
|
|
7813
7825
|
/** Return the base URL the service is currently pointing at. */
|
|
7814
7826
|
getBaseURL(): string;
|
|
7815
7827
|
/**
|
|
7816
|
-
* Return the effective per-request timeout (ms).
|
|
7817
|
-
*
|
|
7818
|
-
*
|
|
7828
|
+
* Return the effective per-request timeout (ms).
|
|
7829
|
+
*
|
|
7830
|
+
* Callers bounding a request tighter than this need it as the CEILING, because a
|
|
7831
|
+
* `RequestOverrideConfig.timeout` REPLACES the service value rather than lowering it: an override
|
|
7832
|
+
* derived from a caller budget alone would raise the bound whenever that budget is the larger of the
|
|
7833
|
+
* two. `SubmitTxAttempt.requestTimeout` clamps against both (`min(budget left in the attempt, this)`).
|
|
7819
7834
|
*/
|
|
7820
7835
|
getTimeout(): number;
|
|
7821
7836
|
}
|
|
@@ -8413,6 +8428,8 @@ declare class ConfigService {
|
|
|
8413
8428
|
get moneyMarketPartnerFee(): PartnerFee | undefined;
|
|
8414
8429
|
get bridgePartnerFee(): PartnerFee | undefined;
|
|
8415
8430
|
get leverageYieldPartnerFee(): PartnerFee | undefined;
|
|
8431
|
+
get swapUseBackendSubmitTx(): boolean;
|
|
8432
|
+
get bridgeUseBackendSubmitTx(): boolean;
|
|
8416
8433
|
get dex(): DexConfig;
|
|
8417
8434
|
getChainConfig<K extends SpokeChainKey>(key: K): GetSpokeChainConfigType<K>;
|
|
8418
8435
|
get sodaxConfig(): SodaxConfig;
|
|
@@ -8563,6 +8580,30 @@ type Erc20IsAllowanceParams<ChainKey extends EvmChainKey> = {
|
|
|
8563
8580
|
nativeToken: Address$1;
|
|
8564
8581
|
publicClient: PublicClient;
|
|
8565
8582
|
};
|
|
8583
|
+
type Erc20GetAllowanceParams = {
|
|
8584
|
+
token: Address$1;
|
|
8585
|
+
owner: Address$1;
|
|
8586
|
+
spender: Address$1;
|
|
8587
|
+
publicClient: PublicClient;
|
|
8588
|
+
};
|
|
8589
|
+
type Erc20PlanApprovalParams = Erc20GetAllowanceParams & {
|
|
8590
|
+
amount: bigint;
|
|
8591
|
+
nativeToken: Address$1;
|
|
8592
|
+
};
|
|
8593
|
+
/** Why {@link Erc20Service.planApproval} chose the plan it did. Diagnostic only. */
|
|
8594
|
+
type Erc20ApprovalPlanReason = 'native-token' | 'zero-allowance' | 'probe-passed' | 'reset-required' | 'reset-not-viable' | 'allowance-read-failed';
|
|
8595
|
+
type Erc20ApprovalPlan = {
|
|
8596
|
+
/**
|
|
8597
|
+
* Present only when the token rejects an allowance change from one non-zero value to another and
|
|
8598
|
+
* a stale allowance exists. Approve this first and wait for it to be mined — {@link approveAmount}
|
|
8599
|
+
* is not valid until it has landed. Always `0n`; it is carried as an amount so that no caller has
|
|
8600
|
+
* to hardcode the constant.
|
|
8601
|
+
*/
|
|
8602
|
+
readonly resetAmount?: bigint;
|
|
8603
|
+
/** The approval the caller actually asked for. */
|
|
8604
|
+
readonly approveAmount: bigint;
|
|
8605
|
+
readonly reason: Erc20ApprovalPlanReason;
|
|
8606
|
+
};
|
|
8566
8607
|
type Erc20Token = {
|
|
8567
8608
|
name: string;
|
|
8568
8609
|
symbol: string;
|
|
@@ -8572,12 +8613,42 @@ type Erc20Token = {
|
|
|
8572
8613
|
declare class Erc20Service {
|
|
8573
8614
|
private constructor();
|
|
8574
8615
|
static getErc20Token(token: Address$1, publicClient: PublicClient): Promise<Erc20Token>;
|
|
8616
|
+
/**
|
|
8617
|
+
* Read the current on-chain allowance of `spender` over `owner`'s balance.
|
|
8618
|
+
* @param params - Token, owner, spender, and publicClient for the chain.
|
|
8619
|
+
* @returns The raw allowance.
|
|
8620
|
+
*/
|
|
8621
|
+
static getAllowance(params: Erc20GetAllowanceParams): Promise<bigint>;
|
|
8575
8622
|
/**
|
|
8576
8623
|
* Check if spender has enough ERC20 allowance for given amount.
|
|
8577
8624
|
* @param params - Token, amount, owner, spender, chainKey, and publicClient for the chain.
|
|
8578
8625
|
* @returns Whether allowance is sufficient for the amount.
|
|
8579
8626
|
*/
|
|
8580
8627
|
static isAllowanceValid<ChainKey extends EvmChainKey>(params: Erc20IsAllowanceParams<ChainKey>): Promise<Result<boolean>>;
|
|
8628
|
+
/**
|
|
8629
|
+
* Decide how many approve transactions this token needs for `amount`.
|
|
8630
|
+
*
|
|
8631
|
+
* Tokens of the 2017 TetherToken lineage reject an allowance change from one non-zero value to
|
|
8632
|
+
* another, so a wallet holding a stale allowance can never approve — every retry reverts the same
|
|
8633
|
+
* way. Such a token needs `approve(0)` first.
|
|
8634
|
+
*
|
|
8635
|
+
* Detection is behavioural: a simulated approve either reverts or it does not. That answers the
|
|
8636
|
+
* question that actually matters ("will this approve revert?") instead of "is this token USDT?",
|
|
8637
|
+
* so a token listed later, or upgraded later behind the same address, is covered without a code
|
|
8638
|
+
* change — and no token list is hardcoded.
|
|
8639
|
+
*
|
|
8640
|
+
* The probes only run once an allowance is already set. The common path (nothing approved yet)
|
|
8641
|
+
* costs a single read.
|
|
8642
|
+
*/
|
|
8643
|
+
static planApproval(params: Erc20PlanApprovalParams): Promise<Erc20ApprovalPlan>;
|
|
8644
|
+
/**
|
|
8645
|
+
* Simulate `approve(spender, amount)` as `owner`.
|
|
8646
|
+
*
|
|
8647
|
+
* `call` rather than `simulateContract`, because a TetherToken-lineage `approve` returns no value
|
|
8648
|
+
* and ABI decoding would fail even on a successful call. `account` is required: the guard reads
|
|
8649
|
+
* `allowed[msg.sender][spender]`.
|
|
8650
|
+
*/
|
|
8651
|
+
private static canApprove;
|
|
8581
8652
|
/**
|
|
8582
8653
|
* Approve ERC20 amount spending
|
|
8583
8654
|
* @param token - ERC20 token address
|
|
@@ -8723,6 +8794,21 @@ type SpokeApproveParamsEvmSpoke<K extends EvmSpokeOnlyChainKey, Raw extends bool
|
|
|
8723
8794
|
type SpokeApproveParamsStellar<K extends StellarChainKey, Raw extends boolean> = SpokeApproveParamsCommon<K, Raw> & {
|
|
8724
8795
|
srcChainKey: K;
|
|
8725
8796
|
};
|
|
8797
|
+
/**
|
|
8798
|
+
* The unsigned transactions an approval needs, named rather than ordered.
|
|
8799
|
+
*
|
|
8800
|
+
* `resetTx` is present only for a token that rejects an allowance change from one non-zero value to
|
|
8801
|
+
* another while a stale allowance exists. When it is, **broadcast it first and wait for it to be
|
|
8802
|
+
* mined** — `approveTx` is not valid until the reset has landed.
|
|
8803
|
+
*
|
|
8804
|
+
* Deliberately not an array: the only consumers map these onto named fields anyway
|
|
8805
|
+
* (`ApproveResponseV2.tx` / `resetTx`), and a positional contract crossing a package boundary
|
|
8806
|
+
* invites a reader to guess which end is which.
|
|
8807
|
+
*/
|
|
8808
|
+
type ApprovalTxs<K extends SpokeChainKey> = {
|
|
8809
|
+
readonly resetTx?: TxReturnType<K, true>;
|
|
8810
|
+
readonly approveTx: TxReturnType<K, true>;
|
|
8811
|
+
};
|
|
8726
8812
|
/**
|
|
8727
8813
|
* Plain union of approve-capable variants. Callers who want narrow-`K` typing should instantiate
|
|
8728
8814
|
* the specific variant (e.g. `SpokeApproveParamsHub<R>`) directly.
|
|
@@ -8743,6 +8829,8 @@ type RawDestinationParams = {
|
|
|
8743
8829
|
*/
|
|
8744
8830
|
type HookRequest = {
|
|
8745
8831
|
kind: typeof HookKind.HYPERCORE_DEPOSIT;
|
|
8832
|
+
} | {
|
|
8833
|
+
kind: typeof HookKind.FLINT_DEPOSIT;
|
|
8746
8834
|
};
|
|
8747
8835
|
type CreateIntentParams<K extends SpokeChainKey = SpokeChainKey> = {
|
|
8748
8836
|
inputToken: string;
|
|
@@ -10226,8 +10314,51 @@ declare class SpokeService {
|
|
|
10226
10314
|
/**
|
|
10227
10315
|
* Approve ERC-20 spending on hub / EVM spoke or request a Stellar trustline using unified params.
|
|
10228
10316
|
* Feature services map their action payloads into {@link SpokeApproveParams}.
|
|
10317
|
+
*
|
|
10318
|
+
* A signed ERC-20 approval can take **two** transactions: a token of the TetherToken lineage
|
|
10319
|
+
* rejects an allowance change from one non-zero value to another, so a stale allowance is zeroed
|
|
10320
|
+
* first and the user signs twice. The returned hash is always the last transaction's, so the
|
|
10321
|
+
* contract callers see is unchanged. An unsigned caller still gets exactly one transaction — use
|
|
10322
|
+
* {@link SpokeService.buildApproveTxs} to get the whole plan.
|
|
10229
10323
|
*/
|
|
10230
10324
|
approve<K extends SpokeChainKey, Raw extends boolean>(params: SpokeApproveParams<K, Raw>): Promise<Result<TxReturnType<K, Raw>>>;
|
|
10325
|
+
/**
|
|
10326
|
+
* The unsigned approval transactions, named rather than ordered (see {@link ApprovalTxs}).
|
|
10327
|
+
*
|
|
10328
|
+
* `resetTx` is present only when the token needs its stale allowance cleared first (see
|
|
10329
|
+
* {@link Erc20Service.planApproval}); broadcast it and wait for it to be mined before `approveTx`,
|
|
10330
|
+
* which is not valid until the reset has landed. Unsigned callers — the swaps API and the apps
|
|
10331
|
+
* built on it — need this, because {@link SpokeService.approve} can only hand back a single `tx`.
|
|
10332
|
+
*
|
|
10333
|
+
* Deliberately separate from {@link SpokeService.approve} rather than a mode of it: the two return
|
|
10334
|
+
* genuinely different shapes, and folding them together would put a union in the return type of
|
|
10335
|
+
* the method every feature approves through.
|
|
10336
|
+
*/
|
|
10337
|
+
buildApproveTxs<K extends SpokeChainKey>(params: SpokeApproveParams<K, true>): Promise<Result<ApprovalTxs<K>>>;
|
|
10338
|
+
/**
|
|
10339
|
+
* Sign and broadcast the approval plan for an ERC-20 on the hub or an EVM spoke.
|
|
10340
|
+
*
|
|
10341
|
+
* A token of the TetherToken lineage rejects an allowance change from one non-zero value to
|
|
10342
|
+
* another, so a wallet holding a stale allowance needs `approve(0)` first. The transactions cannot
|
|
10343
|
+
* be batched: each one is only valid once its predecessor has been mined. The hash of the last is
|
|
10344
|
+
* returned, so the contract callers see is unchanged.
|
|
10345
|
+
*/
|
|
10346
|
+
private executeErc20ApprovalPlan;
|
|
10347
|
+
/**
|
|
10348
|
+
* Stellar approves by adding a trustline — always a single transaction, with no allowance to plan
|
|
10349
|
+
* around. Shared by both entry points so the param mapping and its cast live in one place.
|
|
10350
|
+
*/
|
|
10351
|
+
private requestTrustlineForApproval;
|
|
10352
|
+
/** Resolve the chain-specific inputs {@link Erc20Service.planApproval} needs, and record the plan. */
|
|
10353
|
+
private planErc20Approval;
|
|
10354
|
+
/** The read client for an EVM chain, whether it is the hub or a spoke. */
|
|
10355
|
+
private getEvmPublicClient;
|
|
10356
|
+
/**
|
|
10357
|
+
* Log a plan only when it says something: an extra transaction the user will have to sign, or a
|
|
10358
|
+
* probe that could not reach a verdict. The ordinary single approve is the vast majority of calls
|
|
10359
|
+
* and stays silent.
|
|
10360
|
+
*/
|
|
10361
|
+
private logApprovalPlan;
|
|
10231
10362
|
/**
|
|
10232
10363
|
* Estimate the gas for a raw transaction.
|
|
10233
10364
|
* @param {TxReturnType<T, true>} params - The parameters for the raw transaction.
|
|
@@ -10389,11 +10520,20 @@ type RelayAndWaitParams = {
|
|
|
10389
10520
|
pollTxHash?: string;
|
|
10390
10521
|
};
|
|
10391
10522
|
/**
|
|
10392
|
-
* Minimum `timeout` a feature's client-side relay
|
|
10393
|
-
*
|
|
10394
|
-
*
|
|
10395
|
-
*
|
|
10396
|
-
*
|
|
10523
|
+
* Minimum `timeout` a feature's client-side relay path passes to {@link relayTxAndWaitPacket}, applied
|
|
10524
|
+
* as `Math.max(timeout, RELAY_FALLBACK_FLOOR_MS)` over the caller's own `timeout` — NOT over a remainder.
|
|
10525
|
+
* The relay wait is a per-attempt budget that starts when this call does; nothing the caller spent
|
|
10526
|
+
* earlier (a backend submit-tx attempt, an on-chain verification) is subtracted from it.
|
|
10527
|
+
*
|
|
10528
|
+
* The floor exists because `relayTxAndWaitPacket` submits the tx to the relay BEFORE `timeout` bounds
|
|
10529
|
+
* anything (only the packet wait is bounded), so a caller passing 0 or a negative `timeout` must not
|
|
10530
|
+
* cause the call to be skipped: the spoke tx has already landed on chain and would otherwise sit
|
|
10531
|
+
* unrelayed. Re-relay is idempotent, so spending this floor is always safe.
|
|
10532
|
+
*
|
|
10533
|
+
* Do not reintroduce a `deadline - Date.now()` form here. Deriving the relay budget from elapsed time is
|
|
10534
|
+
* what let a stalled backend attempt or a slow source-chain confirmation shrink the wait to this floor
|
|
10535
|
+
* and fail chains whose relay legitimately needs longer — see `docs/SWAPS.md` § How `timeout` bounds
|
|
10536
|
+
* each attempt.
|
|
10397
10537
|
*/
|
|
10398
10538
|
declare const RELAY_FALLBACK_FLOOR_MS = 5000;
|
|
10399
10539
|
/**
|
|
@@ -12370,8 +12510,6 @@ type SwapServiceConstructorParams = {
|
|
|
12370
12510
|
spoke: SpokeService;
|
|
12371
12511
|
hubProvider: HubProvider;
|
|
12372
12512
|
backendApi: BackendApiService;
|
|
12373
|
-
/** Opt-in backend submit-tx 2-step flow (from `SodaxOptions.swapsOptions.useBackendSubmitTx`). Default off. */
|
|
12374
|
-
useBackendSubmitTx?: boolean;
|
|
12375
12513
|
};
|
|
12376
12514
|
/**
|
|
12377
12515
|
* Main entry point for the SODAX swap feature.
|
|
@@ -12394,11 +12532,22 @@ declare class SwapService {
|
|
|
12394
12532
|
readonly config: ConfigService;
|
|
12395
12533
|
readonly spoke: SpokeService;
|
|
12396
12534
|
readonly solver: SolverConfig;
|
|
12397
|
-
readonly partnerFee: PartnerFee | undefined;
|
|
12398
12535
|
readonly relayerApiEndpoint: HttpUrl;
|
|
12399
12536
|
readonly backendApi: BackendApiService;
|
|
12400
|
-
|
|
12401
|
-
|
|
12537
|
+
/**
|
|
12538
|
+
* Effective 2-step submit-tx flow (`swaps.useBackendSubmitTx`, default on). Read live off
|
|
12539
|
+
* `ConfigService`, like {@link SwapService.partnerFee}, so the config object and the behavior can
|
|
12540
|
+
* never disagree.
|
|
12541
|
+
*/
|
|
12542
|
+
get useBackendSubmitTx(): boolean;
|
|
12543
|
+
/**
|
|
12544
|
+
* Effective swap partner fee (`swaps.partnerFee`, else the global `fee`). Read live off
|
|
12545
|
+
* `ConfigService` rather than snapshotted in the constructor, so it cannot diverge from
|
|
12546
|
+
* `config.swapPartnerFee` if the config object is ever replaced (see `ConfigService.initialize`).
|
|
12547
|
+
* `BridgeService` and `LeverageYieldService` resolve their fees the same way.
|
|
12548
|
+
*/
|
|
12549
|
+
get partnerFee(): PartnerFee | undefined;
|
|
12550
|
+
constructor({ config, hubProvider, spoke, backendApi }: SwapServiceConstructorParams);
|
|
12402
12551
|
/**
|
|
12403
12552
|
* Estimates the gas cost for a raw (unsigned) transaction on a spoke chain.
|
|
12404
12553
|
*
|
|
@@ -12493,21 +12642,26 @@ declare class SwapService {
|
|
|
12493
12642
|
* Executes a full end-to-end cross-chain swap.
|
|
12494
12643
|
*
|
|
12495
12644
|
* Orchestrates the complete swap lifecycle. `createIntent` first submits the intent transaction on
|
|
12496
|
-
* the source spoke chain; completion then runs via one of two paths,
|
|
12497
|
-
*
|
|
12498
|
-
*
|
|
12499
|
-
* - **Client-side (
|
|
12500
|
-
* relays it to the hub (Sonic) and waits for the packet — skipped when
|
|
12501
|
-
* where the spoke tx already is the hub tx — then calls `postExecution` to
|
|
12502
|
-
* triggering it to fill the intent.
|
|
12503
|
-
* - **Backend 2-step (
|
|
12645
|
+
* the source spoke chain; completion then runs via one of two paths, each bounded by its own `timeout`
|
|
12646
|
+
* budget:
|
|
12647
|
+
*
|
|
12648
|
+
* - **Client-side (opt-out via `swaps.useBackendSubmitTx: false`), {@link fallbackSwapSteps}:** verifies
|
|
12649
|
+
* the spoke tx landed on-chain, relays it to the hub (Sonic) and waits for the packet — skipped when
|
|
12650
|
+
* `srcChainKey` is the hub, where the spoke tx already is the hub tx — then calls `postExecution` to
|
|
12651
|
+
* notify the solver, triggering it to fill the intent.
|
|
12652
|
+
* - **Backend 2-step (default via `swaps.useBackendSubmitTx`), {@link submitTx}:** hands the
|
|
12504
12653
|
* broadcast tx to the swaps API, which verifies, relays and post-executes server-side, then polls
|
|
12505
12654
|
* for completion. On ANY non-success it transparently falls back to the client-side path above —
|
|
12506
12655
|
* safe because re-relaying / re-posting an already-processed swap is idempotent (no double-fill).
|
|
12507
12656
|
*
|
|
12508
12657
|
* @param _params - Swap action params including intent parameters, wallet provider, and an optional
|
|
12509
|
-
* `timeout` —
|
|
12510
|
-
*
|
|
12658
|
+
* `timeout` — a PER-ATTEMPT budget, not an end-to-end one. The backend attempt (submit POST + status
|
|
12659
|
+
* poll) gets it, and if that attempt does not complete the client-side relay wait gets a fresh one
|
|
12660
|
+
* starting after verification, so neither a stalled backend nor a slow source-chain confirmation can
|
|
12661
|
+
* shorten it. Worst-case wall-clock is `createIntent + timeout + verification +
|
|
12662
|
+
* max(timeout, RELAY_FALLBACK_FLOOR_MS) + postExecution`, where verification is bounded by the source
|
|
12663
|
+
* chain's `pollingConfig.maxTimeoutMs` and the first and last terms are not bounded by `timeout` at
|
|
12664
|
+
* all. See `docs/SWAPS.md` § How `timeout` bounds each attempt.
|
|
12511
12665
|
* @returns A `Result<SwapResponse, SwapError>`. On success:
|
|
12512
12666
|
* - `solverExecutionResponse` — solver acknowledgement (`{ answer: 'OK', intent_hash }`).
|
|
12513
12667
|
* - `intent` — the on-chain intent object that was created.
|
|
@@ -12529,14 +12683,18 @@ declare class SwapService {
|
|
|
12529
12683
|
*/
|
|
12530
12684
|
swap<K extends SpokeChainKey>(_params: SwapActionParams<K, false>): Promise<Result<SwapResponse, SwapError>>;
|
|
12531
12685
|
/**
|
|
12532
|
-
* Client-side swap completion (
|
|
12533
|
-
* use it directly when the source IS the hub — then notify the
|
|
12534
|
-
* build the {@link SwapResponse}. Extracted verbatim from `swap()` so the
|
|
12535
|
-
* path ({@link submitTx}) can fall back to it on any non-success.
|
|
12686
|
+
* Client-side swap completion (opt-out via `swaps.useBackendSubmitTx: false`): verify the broadcast intent
|
|
12687
|
+
* tx landed, then relay it to the hub — or use it directly when the source IS the hub — then notify the
|
|
12688
|
+
* solver via post-execution and build the {@link SwapResponse}. Extracted verbatim from `swap()` so the
|
|
12689
|
+
* backend 2-step path ({@link submitTx}) can fall back to it on any non-success.
|
|
12690
|
+
*
|
|
12691
|
+
* Verification belongs to THIS path only: the backend runs its own, so verifying before handing over
|
|
12692
|
+
* would delay every backend success by the source chain's confirmation wait and could fail a swap the
|
|
12693
|
+
* backend would have completed.
|
|
12536
12694
|
*/
|
|
12537
12695
|
private fallbackSwapSteps;
|
|
12538
12696
|
/**
|
|
12539
|
-
* Backend 2-step swap path (
|
|
12697
|
+
* Backend 2-step swap path (default via `swaps.useBackendSubmitTx`): hand the broadcast
|
|
12540
12698
|
* intent tx to the swaps API (`POST /swaps/submit-tx`); the backend relays + post-executes
|
|
12541
12699
|
* server-side. Polls `getSubmitTxStatus` until `solved`, then reconstructs the same
|
|
12542
12700
|
* {@link SwapResponse} the client-side path returns (`result.dstIntentTxHash` → delivery info,
|
|
@@ -12547,8 +12705,16 @@ declare class SwapService {
|
|
|
12547
12705
|
*
|
|
12548
12706
|
* Falling back is safe: re-relaying / re-posting an already-processed swap is idempotent — the
|
|
12549
12707
|
* relay dedups and returns the existing `executed` packet, and the solver re-affirms the intent
|
|
12550
|
-
* (no double-fill). Verified live by `e2e-tests/e2e-relay.test.ts`.
|
|
12551
|
-
*
|
|
12708
|
+
* (no double-fill). Verified live by `e2e-tests/e2e-relay.test.ts`. It is also load-bearing rather
|
|
12709
|
+
* than belt-and-braces: the backend keeps processing after this attempt gives up, so the fallback's
|
|
12710
|
+
* relay can race the backend's own.
|
|
12711
|
+
*
|
|
12712
|
+
* The attempt itself — POST, budget clamps, status poll — is {@link runBackendSubmitTx}, shared with
|
|
12713
|
+
* bridge. What is swap-specific and lives here: the request body, the `solved` terminal status, the
|
|
12714
|
+
* mapping from a terminal result to a {@link SwapResponse}, and the swap error taxonomy.
|
|
12715
|
+
*
|
|
12716
|
+
* `attempt` bounds this attempt alone — the POST and every status request draw on it, and the
|
|
12717
|
+
* client-side fallback holds a separate fresh `timeout`.
|
|
12552
12718
|
*/
|
|
12553
12719
|
private submitTx;
|
|
12554
12720
|
/**
|
|
@@ -12574,14 +12740,29 @@ declare class SwapService {
|
|
|
12574
12740
|
* - Stellar: approves the trustline (adds/increases it).
|
|
12575
12741
|
* - Other chain types: returns an error — approval is not supported.
|
|
12576
12742
|
*
|
|
12577
|
-
* When `raw: true`, returns unsigned transaction data instead of broadcasting.
|
|
12743
|
+
* When `raw: true`, returns unsigned transaction data instead of broadcasting. That is always a
|
|
12744
|
+
* single transaction, which cannot express the two-step approval a TetherToken-lineage token
|
|
12745
|
+
* needs when a stale allowance already exists — use {@link SwapService.buildApproveTxs} for the
|
|
12746
|
+
* whole plan.
|
|
12578
12747
|
* When `raw: false`, a matching wallet provider for `K` must be supplied and the transaction
|
|
12579
|
-
* is signed and broadcast immediately.
|
|
12748
|
+
* is signed and broadcast immediately. Such an approval can take **two** transactions, so the
|
|
12749
|
+
* user may sign twice; the returned hash is the last one's.
|
|
12580
12750
|
*
|
|
12581
12751
|
* @param _params - Swap action params including the source chain key, input token, amount, and wallet provider.
|
|
12582
12752
|
* @returns A `Result` wrapping the chain-specific transaction return type (`TxReturnType<K, Raw>`).
|
|
12583
12753
|
*/
|
|
12584
12754
|
approve<K extends SpokeChainKey, Raw extends boolean>(_params: SwapActionParams<K, Raw>): Promise<Result<TxReturnType<K, Raw>>>;
|
|
12755
|
+
/**
|
|
12756
|
+
* The unsigned approval transactions for the swap's source token, in the order they must be
|
|
12757
|
+
* broadcast.
|
|
12758
|
+
*
|
|
12759
|
+
* Two transactions when the source token needs its stale allowance cleared first, one otherwise.
|
|
12760
|
+
* {@link SwapService.approve} is unchanged and still returns a single transaction; this is the
|
|
12761
|
+
* entry point for unsigned callers that need to handle the two-step case. When `resetTx` is
|
|
12762
|
+
* present, broadcast it and wait for it to be mined first — `approveTx` is not valid until the
|
|
12763
|
+
* reset has landed.
|
|
12764
|
+
*/
|
|
12765
|
+
buildApproveTxs<K extends SpokeChainKey>(_params: SwapActionParams<K, true>): Promise<Result<ApprovalTxs<K>>>;
|
|
12585
12766
|
/**
|
|
12586
12767
|
* Creates a swap intent on the user's source spoke chain without submitting it to the solver.
|
|
12587
12768
|
*
|
|
@@ -13555,8 +13736,6 @@ type BridgeServiceConstructorParams = {
|
|
|
13555
13736
|
config: ConfigService;
|
|
13556
13737
|
spoke: SpokeService;
|
|
13557
13738
|
backendApi: BackendApiService;
|
|
13558
|
-
/** Opt-in backend submit-tx flow (from `SodaxOptions.bridgeOptions.useBackendSubmitTx`). Default off. */
|
|
13559
|
-
useBackendSubmitTx?: boolean;
|
|
13560
13739
|
};
|
|
13561
13740
|
/**
|
|
13562
13741
|
* Orchestrates cross-chain token transfers within the SODAX hub-and-spoke architecture.
|
|
@@ -13578,8 +13757,12 @@ declare class BridgeService {
|
|
|
13578
13757
|
readonly config: ConfigService;
|
|
13579
13758
|
readonly spoke: SpokeService;
|
|
13580
13759
|
readonly backendApi: BackendApiService;
|
|
13581
|
-
|
|
13582
|
-
|
|
13760
|
+
/**
|
|
13761
|
+
* Effective backend submit-tx flow (`bridge.useBackendSubmitTx`, default on). Read live off
|
|
13762
|
+
* `ConfigService` like `bridgePartnerFee`, so the config object and the behavior can never disagree.
|
|
13763
|
+
*/
|
|
13764
|
+
get useBackendSubmitTx(): boolean;
|
|
13765
|
+
constructor({ hubProvider, config, spoke, backendApi }: BridgeServiceConstructorParams);
|
|
13583
13766
|
/**
|
|
13584
13767
|
* Calculates the partner fee deducted from a given bridge input amount.
|
|
13585
13768
|
*
|
|
@@ -13624,15 +13807,27 @@ declare class BridgeService {
|
|
|
13624
13807
|
/**
|
|
13625
13808
|
* Executes a full end-to-end bridge transfer: spoke deposit → relay → hub settlement.
|
|
13626
13809
|
*
|
|
13627
|
-
* Internally calls `createBridgeIntent()` to submit the spoke-side deposit transaction,
|
|
13628
|
-
*
|
|
13629
|
-
*
|
|
13810
|
+
* Internally calls `createBridgeIntent()` to submit the spoke-side deposit transaction, then
|
|
13811
|
+
* completes the transfer via one of two paths. Use this method for the typical "fire and wait" UX.
|
|
13812
|
+
*
|
|
13813
|
+
* - **Backend submit-tx (default, `bridge.useBackendSubmitTx`), {@link submitTx}:** hands the deposit
|
|
13814
|
+
* to the bridge API, which relays server-side, and polls until `executed`. On ANY non-success it
|
|
13815
|
+
* falls back to the path below — safe because re-relaying is idempotent.
|
|
13816
|
+
* - **Client-side (opt-out with `useBackendSubmitTx: false`), {@link fallbackBridgeSteps}:** verifies
|
|
13817
|
+
* the deposit landed on-chain, then relays it and waits for the settlement packet. `verifyTxHash`
|
|
13818
|
+
* runs on this path only; the backend runs its own.
|
|
13630
13819
|
*
|
|
13631
13820
|
* For manual relay control (e.g. monitoring or batching), use `createBridgeIntent()` directly
|
|
13632
13821
|
* and handle the relay step yourself.
|
|
13633
13822
|
*
|
|
13634
13823
|
* @param _params - Bridge parameters including source/destination chain keys, token addresses,
|
|
13635
|
-
* amount, recipient address, wallet provider, and optional timeout
|
|
13824
|
+
* amount, recipient address, wallet provider, and an optional `timeout` — a PER-ATTEMPT budget,
|
|
13825
|
+
* not an end-to-end one. The backend attempt gets it, and if that attempt does not complete the
|
|
13826
|
+
* client-side relay wait gets a fresh one starting after verification, so neither a stalled backend
|
|
13827
|
+
* nor a slow source-chain confirmation can shorten it. Worst-case wall-clock is
|
|
13828
|
+
* `createBridgeIntent + timeout + verification + max(timeout, RELAY_FALLBACK_FLOOR_MS)`, where
|
|
13829
|
+
* verification is bounded by the source chain's `pollingConfig.maxTimeoutMs` and intent creation is
|
|
13830
|
+
* not bounded by `timeout` at all. See `docs/BRIDGE.md` § Completion paths and `timeout`.
|
|
13636
13831
|
* @returns `Result<TxHashPair>` — `{ srcChainTxHash, dstChainTxHash }` on success,
|
|
13637
13832
|
* where `srcChainTxHash` is the spoke deposit tx and `dstChainTxHash` is the hub settlement tx.
|
|
13638
13833
|
*
|
|
@@ -13658,14 +13853,18 @@ declare class BridgeService {
|
|
|
13658
13853
|
*/
|
|
13659
13854
|
bridge<K extends SpokeChainKey>(_params: BridgeParams<K, false>): Promise<Result<TxHashPair, BridgeOrchestrationError>>;
|
|
13660
13855
|
/**
|
|
13661
|
-
* Client-side bridge completion (
|
|
13662
|
-
* relay it to the hub and wait for the settlement packet. Extracted verbatim from
|
|
13663
|
-
*
|
|
13664
|
-
* always relays — there is no hub-source short-circuit.
|
|
13856
|
+
* Client-side bridge completion (opt-out via `bridge.useBackendSubmitTx: false`): verify the broadcast
|
|
13857
|
+
* spoke-deposit tx, then relay it to the hub and wait for the settlement packet. Extracted verbatim from
|
|
13858
|
+
* `bridge()` so the backend submit-tx path ({@link submitTx}) can fall back to it on any non-success.
|
|
13859
|
+
* Bridge always relays — there is no hub-source short-circuit.
|
|
13860
|
+
*
|
|
13861
|
+
* Verification belongs to THIS path only: the backend runs its own, so verifying before handing over
|
|
13862
|
+
* would delay every backend success by the source chain's confirmation wait and could fail a bridge the
|
|
13863
|
+
* backend would have completed.
|
|
13665
13864
|
*/
|
|
13666
13865
|
private fallbackBridgeSteps;
|
|
13667
13866
|
/**
|
|
13668
|
-
* Backend bridge path (
|
|
13867
|
+
* Backend bridge path (default via `bridge.useBackendSubmitTx`): hand the broadcast
|
|
13669
13868
|
* spoke-deposit tx to the bridge API (`POST /bridge/submit-tx`) with the FULL `relayData`
|
|
13670
13869
|
* envelope; the backend relays server-side. Polls `getSubmitTxStatus` until `executed`, then
|
|
13671
13870
|
* returns the same {@link TxHashPair} the client-side path returns (`result.dstIntentTxHash` →
|
|
@@ -13674,8 +13873,15 @@ declare class BridgeService {
|
|
|
13674
13873
|
* Never throws — returns `{ ok: false }` on any non-success (submit `!ok`, terminal `failed` /
|
|
13675
13874
|
* abandoned, or poll timeout) so `bridge()` falls back to {@link fallbackBridgeSteps}. Falling back
|
|
13676
13875
|
* is safe: re-relaying an already-relayed bridge tx is idempotent — the relay dedups and returns the
|
|
13677
|
-
* existing `executed` packet.
|
|
13678
|
-
*
|
|
13876
|
+
* existing `executed` packet. It is also load-bearing rather than belt-and-braces: the backend keeps
|
|
13877
|
+
* processing after this attempt gives up, so the fallback's relay can race the backend's own.
|
|
13878
|
+
*
|
|
13879
|
+
* The attempt itself — POST, budget clamps, status poll — is {@link runBackendSubmitTx}, shared with
|
|
13880
|
+
* swaps. What is bridge-specific and lives here: the request body (the FULL `relayData` envelope), the
|
|
13881
|
+
* `executed` terminal status, the mapping to a {@link TxHashPair}, and the bridge error taxonomy.
|
|
13882
|
+
*
|
|
13883
|
+
* `attempt` bounds this attempt alone — the POST and every status request draw on it, and the
|
|
13884
|
+
* client-side fallback holds a separate fresh `timeout`.
|
|
13679
13885
|
*/
|
|
13680
13886
|
private submitTx;
|
|
13681
13887
|
/**
|
|
@@ -16138,9 +16344,18 @@ declare class MoneyMarketService {
|
|
|
16138
16344
|
readonly hubProvider: HubProvider;
|
|
16139
16345
|
readonly config: ConfigService;
|
|
16140
16346
|
readonly spoke: SpokeService;
|
|
16141
|
-
readonly partnerFee: PartnerFee | undefined;
|
|
16142
16347
|
readonly relayerApiEndpoint: HttpUrl;
|
|
16143
16348
|
readonly data: MoneyMarketDataService;
|
|
16349
|
+
/**
|
|
16350
|
+
* Effective money-market partner fee (`moneyMarket.partnerFee`, else the global `fee`). Read live
|
|
16351
|
+
* off `ConfigService` rather than snapshotted in the constructor, so it cannot diverge from
|
|
16352
|
+
* `config.moneyMarketPartnerFee` if the config object is ever replaced. Mirrors
|
|
16353
|
+
* {@link SwapService.partnerFee}.
|
|
16354
|
+
*
|
|
16355
|
+
* Money market has no per-action override: unlike swap / bridge / leverage-yield, every flow here
|
|
16356
|
+
* charges this configured fee.
|
|
16357
|
+
*/
|
|
16358
|
+
get partnerFee(): PartnerFee | undefined;
|
|
16144
16359
|
constructor({ config, hubProvider, spoke }: MoneyMarketServiceConstructorParams);
|
|
16145
16360
|
/**
|
|
16146
16361
|
* Estimate the gas cost of an already-encoded transaction on the given spoke chain.
|
|
@@ -17019,9 +17234,9 @@ type LeverageYieldSwapDepositParams = {
|
|
|
17019
17234
|
/** Optional specific solver. `0x0` = any solver. */
|
|
17020
17235
|
solver?: Address;
|
|
17021
17236
|
/**
|
|
17022
|
-
* Partner fee for this deposit, carried on the payload as the
|
|
17023
|
-
*
|
|
17024
|
-
* override if set, else the global `fee`).
|
|
17237
|
+
* Partner fee for this deposit, carried on the payload as the per-intent fee override.
|
|
17238
|
+
* Defaults to the effective leverage-yield fee (`config.leverageYieldPartnerFee` = the
|
|
17239
|
+
* `leverageYield` override if set, else the global `fee`).
|
|
17025
17240
|
*/
|
|
17026
17241
|
partnerFee?: PartnerFee;
|
|
17027
17242
|
};
|
|
@@ -17052,6 +17267,28 @@ type LeverageYieldSwapWithdrawParams = {
|
|
|
17052
17267
|
deadline?: bigint;
|
|
17053
17268
|
/** Optional specific solver. `0x0` = any solver. */
|
|
17054
17269
|
solver?: Address;
|
|
17270
|
+
/**
|
|
17271
|
+
* Partner fee for this withdraw, carried on the payload as the per-intent fee override.
|
|
17272
|
+
* Defaults to the effective leverage-yield fee (`config.leverageYieldPartnerFee` = the
|
|
17273
|
+
* `leverageYield` override if set, else the global `fee`).
|
|
17274
|
+
*
|
|
17275
|
+
* A withdraw's input token is the vault itself, so the fee is deducted from `inputAmount`
|
|
17276
|
+
* in **lsoda\* shares** — the fee receiver accrues vault shares, not the output token.
|
|
17277
|
+
*/
|
|
17278
|
+
partnerFee?: PartnerFee;
|
|
17279
|
+
};
|
|
17280
|
+
/**
|
|
17281
|
+
* Params for {@link LeverageYieldService.getQuote}. Superset of `SolverIntentQuoteRequest`
|
|
17282
|
+
* with the same per-call fee override the vault intent builders take, so a quote and the
|
|
17283
|
+
* intent it sizes can be driven by one value.
|
|
17284
|
+
*/
|
|
17285
|
+
type LeverageYieldQuoteParams = SolverIntentQuoteRequest & {
|
|
17286
|
+
/**
|
|
17287
|
+
* Per-call fee override. Omit to use the effective leverage-yield fee
|
|
17288
|
+
* (`config.leverageYieldPartnerFee`); pass the same value you pass to
|
|
17289
|
+
* {@link LeverageYieldService.vaultSwap} when overriding per intent.
|
|
17290
|
+
*/
|
|
17291
|
+
partnerFee?: PartnerFee;
|
|
17055
17292
|
};
|
|
17056
17293
|
/**
|
|
17057
17294
|
* Action-shaped swap payload built by {@link LeverageYieldService.deposit} /
|
|
@@ -17064,7 +17301,11 @@ type LeverageYieldSwapWithdrawParams = {
|
|
|
17064
17301
|
type LeverageYieldSwapPayload = {
|
|
17065
17302
|
params: CreateIntentParams;
|
|
17066
17303
|
hubWalletSwap?: true;
|
|
17067
|
-
/**
|
|
17304
|
+
/**
|
|
17305
|
+
* Per-intent partner-fee override, set by `deposit` / `withdraw` when the caller supplies one.
|
|
17306
|
+
* Absent means the effective leverage-yield fee applies — **both directions are charged**;
|
|
17307
|
+
* this key only controls whether that configured fee is overridden for this intent.
|
|
17308
|
+
*/
|
|
17068
17309
|
partnerFee?: PartnerFee;
|
|
17069
17310
|
};
|
|
17070
17311
|
/**
|
|
@@ -17077,8 +17318,8 @@ type LeverageYieldSwapPayload = {
|
|
|
17077
17318
|
* user's hub wallet — `srcChainKey` is then the chain the user *signs* on, and the
|
|
17078
17319
|
* intent is created by authorising the hub wallet via a `Connection.sendMessage`
|
|
17079
17320
|
* instead of a spoke-side AssetManager deposit.
|
|
17080
|
-
* - `partnerFee` overrides the effective
|
|
17081
|
-
* intent only.
|
|
17321
|
+
* - `partnerFee` overrides the effective leverage-yield fee
|
|
17322
|
+
* (`config.leverageYieldPartnerFee`) for this intent only.
|
|
17082
17323
|
*/
|
|
17083
17324
|
type VaultSwapActionParams<K extends SpokeChainKey, Raw extends boolean = false> = SpokeExecActionParams<K, Raw, CreateIntentParams<K>> & {
|
|
17084
17325
|
hubWalletSwap?: boolean;
|
|
@@ -17126,6 +17367,8 @@ type LeverageYieldServiceConstructorParams = {
|
|
|
17126
17367
|
* `vaultSwap()` — the generic swap surface stays untouched by vault concerns.
|
|
17127
17368
|
*
|
|
17128
17369
|
* Methods:
|
|
17370
|
+
* - `getQuote` — solver quote for a vault deposit/withdraw, sized with the effective
|
|
17371
|
+
* leverage-yield fee so the quote matches what the vault intent will charge.
|
|
17129
17372
|
* - `deposit` / `withdraw` — build a {@link LeverageYieldSwapPayload} for a swap-style deposit
|
|
17130
17373
|
* (any token → lsoda*) and withdraw (lsoda* → any token); spread the result into
|
|
17131
17374
|
* `vaultSwap()`. `withdraw` sets `hubWalletSwap: true` so the vault swap spends the lsoda*
|
|
@@ -17172,6 +17415,32 @@ declare class LeverageYieldService {
|
|
|
17172
17415
|
* failure. The `deposit` / `withdraw` callers forward it verbatim.
|
|
17173
17416
|
*/
|
|
17174
17417
|
private resolveDeadline;
|
|
17418
|
+
/**
|
|
17419
|
+
* Quotes a vault deposit or withdraw. Vault shares are solver-tradeable, so this is the
|
|
17420
|
+
* generic solver quote with one difference that matters: the fee deducted before quoting is
|
|
17421
|
+
* the effective **leverage-yield** fee, matching what {@link LeverageYieldService.createVaultIntent}
|
|
17422
|
+
* will charge. `sodax.swaps.getQuote` deducts the effective *swap* fee instead, so quoting a
|
|
17423
|
+
* vault flow through it makes the quote and the intent disagree whenever the two feature fees
|
|
17424
|
+
* differ. Quoting a vault flow through the swap service can be made to agree — pass the same fee
|
|
17425
|
+
* explicitly, using a zero fee (`{ address, percentage: 0 }`) where the effective leverage-yield
|
|
17426
|
+
* fee is `undefined`, since an explicit `undefined` there falls back to the swap fee — but this
|
|
17427
|
+
* method resolves it for you and is the canonical way to quote a vault flow.
|
|
17428
|
+
*
|
|
17429
|
+
* Pass the vault address as `token_dst` to quote a deposit, or as `token_src` to quote a
|
|
17430
|
+
* withdraw; subtract your slippage tolerance from `quoted_amount` to get `minOutputAmount`.
|
|
17431
|
+
* When overriding the fee per intent, pass the same `partnerFee` here and to whichever builder
|
|
17432
|
+
* you use ({@link LeverageYieldService.deposit}, {@link LeverageYieldService.withdraw}) or
|
|
17433
|
+
* directly to {@link LeverageYieldService.vaultSwap} — omitting it everywhere is equally safe,
|
|
17434
|
+
* since each side then resolves the same effective leverage-yield fee. Both directions are
|
|
17435
|
+
* charged, so this applies to withdrawals as much as deposits.
|
|
17436
|
+
*
|
|
17437
|
+
* @returns `SolverIntentQuoteResponse` on success. On failure `result.error` is either the
|
|
17438
|
+
* solver's own `SolverErrorResponse` (no path, insufficient liquidity, …) or a SodaxError
|
|
17439
|
+
* with `VALIDATION_FAILED` (bad `amount`, or a partner fee that leaves nothing to quote),
|
|
17440
|
+
* `LOOKUP_FAILED` (unsupported token — the solver payload could not be assembled) or
|
|
17441
|
+
* `UNKNOWN`. Discriminate with `isSodaxError(error)`.
|
|
17442
|
+
*/
|
|
17443
|
+
getQuote(payload: LeverageYieldQuoteParams): Promise<Result<SolverIntentQuoteResponse, SolverErrorResponse | LeverageYieldLookupError>>;
|
|
17175
17444
|
/**
|
|
17176
17445
|
* Builds the {@link LeverageYieldSwapPayload} for a leverage-yield deposit (any token → lsoda*).
|
|
17177
17446
|
* The lsoda* output is delivered to the user's hub wallet on Sonic so a later
|
|
@@ -17179,9 +17448,8 @@ declare class LeverageYieldService {
|
|
|
17179
17448
|
* {@link LeverageYieldService.vaultSwap}: `vaultSwap({ ...payload, walletProvider })`.
|
|
17180
17449
|
* An optional `partnerFee` is forwarded on the payload as the per-intent fee override.
|
|
17181
17450
|
*
|
|
17182
|
-
* For `minOutputAmount`, quote via
|
|
17183
|
-
* destination token (`token_dst`)
|
|
17184
|
-
* quote applies; then subtract your slippage tolerance.
|
|
17451
|
+
* For `minOutputAmount`, quote via {@link LeverageYieldService.getQuote} with the vault
|
|
17452
|
+
* address as the destination token (`token_dst`), then subtract your slippage tolerance.
|
|
17185
17453
|
*/
|
|
17186
17454
|
deposit(params: LeverageYieldSwapDepositParams): Promise<Result<LeverageYieldSwapPayload, LeverageYieldCreateIntentError | LeverageYieldLookupError>>;
|
|
17187
17455
|
/**
|
|
@@ -17192,9 +17460,13 @@ declare class LeverageYieldService {
|
|
|
17192
17460
|
* a call shape uniform with {@link LeverageYieldService.deposit}; async because the default
|
|
17193
17461
|
* `deadline` is read from the hub block timestamp.
|
|
17194
17462
|
*
|
|
17195
|
-
*
|
|
17196
|
-
*
|
|
17197
|
-
*
|
|
17463
|
+
* An optional `partnerFee` is forwarded on the payload as the per-intent fee override; omit it
|
|
17464
|
+
* and the configured leverage-yield fee applies. Withdrawals **are** charged — the fee comes out
|
|
17465
|
+
* of `inputAmount`, which for a withdraw is the vault's own shares, so the receiver accrues
|
|
17466
|
+
* lsoda\* rather than the output token.
|
|
17467
|
+
*
|
|
17468
|
+
* For `minOutputAmount`, quote via {@link LeverageYieldService.getQuote} with the vault
|
|
17469
|
+
* address as the source token (`token_src`), then subtract your slippage tolerance.
|
|
17198
17470
|
*/
|
|
17199
17471
|
withdraw(params: LeverageYieldSwapWithdrawParams): Promise<Result<LeverageYieldSwapPayload, LeverageYieldCreateIntentError | LeverageYieldLookupError>>;
|
|
17200
17472
|
/**
|
|
@@ -17838,6 +18110,12 @@ declare class HookService {
|
|
|
17838
18110
|
* Encodes a hook's `deliveryData` payload. One common entry point for all hooks — the encoding is
|
|
17839
18111
|
* selected by {@link HookRequest.kind} and uses that hook's schema from {@link HOOK_DELIVERY_ABI}.
|
|
17840
18112
|
*
|
|
18113
|
+
* Rejects the zero address. Every hook treats its recipient as the account to credit, and a
|
|
18114
|
+
* zero recipient is unrecoverable on arrival: the receiver reverts, which rolls back the whole
|
|
18115
|
+
* cross-chain withdrawal inside `SpokeAssetManager.recvMessage` and leaves the message wedged —
|
|
18116
|
+
* every retry hits the same revert. Failing here keeps that mistake client-side, before an intent
|
|
18117
|
+
* exists. Malformed and non-EVM addresses already throw inside viem's encoder.
|
|
18118
|
+
*
|
|
17841
18119
|
* @param request - The hook selection (and any hook-specific params).
|
|
17842
18120
|
* @param recipient - The end recipient the hook should credit (the intent's `dstAddress`).
|
|
17843
18121
|
*/
|
|
@@ -18197,4 +18475,4 @@ type DexApproveErrorCode = ApproveErrorCode;
|
|
|
18197
18475
|
type DexApproveError = SodaxError<DexApproveErrorCode>;
|
|
18198
18476
|
declare const isDexApproveError: (e: unknown) => e is SodaxError<ApproveErrorCode>;
|
|
18199
18477
|
|
|
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 };
|
|
18478
|
+
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 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 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 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, 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 };
|