@xoxno/sdk-js 1.0.221 → 1.0.223

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.
@@ -0,0 +1 @@
1
+ export {};
@@ -27,8 +27,6 @@ export declare const encodePriceKey: (key: StellarPriceKey | Record<string, stri
27
27
  * upper/lower bps (lower is derived as reciprocal when only bps is given).
28
28
  */
29
29
  export declare const encodeAssetOracle: (cfg: AssetOracleConfigInputDto | StellarAssetOracle | Record<string, unknown>) => xdr.ScVal;
30
- /** @deprecated Use {@link encodeAssetOracle}. */
31
- export declare const encodeMarketOracleConfigInput: (cfg: AssetOracleConfigInputDto | StellarAssetOracle | Record<string, unknown>) => xdr.ScVal;
32
30
  export interface RoleGrantArgs {
33
31
  account: string;
34
32
  role: string;
@@ -39,8 +37,6 @@ export interface TransferOwnershipArgs {
39
37
  }
40
38
  /** Governance / aggregator `ConfigureAssetOracle` args. */
41
39
  export type ConfigureAssetOracleArgs = ConfigureAssetOracleArgsDto;
42
- /** @deprecated Alias — use ConfigureAssetOracleArgs. */
43
- export type ConfigureMarketOracleArgs = ConfigureAssetOracleArgs;
44
40
  /** Edit dual-source tolerance (PriceKey + bps). */
45
41
  export type EditOracleToleranceArgs = EditOracleToleranceArgsDto;
46
42
  export interface CreateLiquidityPoolArgs {
@@ -90,8 +86,6 @@ export declare function buildStellarSetSwapAggregatorTx(opts: StellarLendingBuil
90
86
  export declare function buildStellarSetPriceAggregatorTx(opts: StellarLendingBuilderOptions, args: {
91
87
  aggregator: string;
92
88
  }): BuiltStellarTx;
93
- /** @deprecated Use buildStellarSetSwapAggregatorTx. */
94
- export declare const buildStellarSetAggregatorTx: typeof buildStellarSetSwapAggregatorTx;
95
89
  /** set_accumulator(addr: Address) — #[only_owner] */
96
90
  export declare function buildStellarSetAccumulatorTx(opts: StellarLendingBuilderOptions, args: {
97
91
  accumulator: string;
@@ -106,18 +100,12 @@ export declare function buildStellarApproveBlendPoolTx(opts: StellarLendingBuild
106
100
  export declare function buildStellarRevokeBlendPoolTx(opts: StellarLendingBuilderOptions, args: {
107
101
  pool: string;
108
102
  }): BuiltStellarTx;
109
- /** @deprecated Use buildStellarApproveBlendPoolTx. */
110
- export declare const buildStellarApproveTokenTx: typeof buildStellarApproveBlendPoolTx;
111
- /** @deprecated Use buildStellarRevokeBlendPoolTx. */
112
- export declare const buildStellarRevokeTokenTx: typeof buildStellarRevokeBlendPoolTx;
113
103
  /**
114
104
  * Direct price-aggregator `set_oracle(key, oracle)` — owner only (governance
115
105
  * contract address as tx source after deploy). Prefer governance propose path
116
106
  * in production.
117
107
  */
118
108
  export declare function buildStellarSetOracleTx(opts: StellarLendingBuilderOptions, args: ConfigureAssetOracleArgs): BuiltStellarTx;
119
- /** @deprecated Use buildStellarSetOracleTx. */
120
- export declare const buildStellarSetMarketOracleConfigTx: typeof buildStellarSetOracleTx;
121
109
  /** price-aggregator `set_tolerance(key, OracleTolerance)` — owner only. */
122
110
  export declare function buildStellarSetOracleToleranceTx(opts: StellarLendingBuilderOptions, args: EditOracleToleranceArgs & {
123
111
  upperRatioBps?: number;
@@ -113,8 +113,6 @@ export declare function buildStellarProposeSetSwapAggregatorTx(opts: StellarGove
113
113
  export declare function buildStellarProposeSetPriceAggregatorTx(opts: StellarGovernanceBuilderOptions, args: {
114
114
  aggregator: string;
115
115
  }, salt: StellarGovernanceSalt): BuiltStellarTx;
116
- /** @deprecated Use buildStellarProposeSetSwapAggregatorTx. */
117
- export declare const buildStellarProposeSetAggregatorTx: typeof buildStellarProposeSetSwapAggregatorTx;
118
116
  /** propose(SetAccumulator(addr)) */
119
117
  export declare function buildStellarProposeSetAccumulatorTx(opts: StellarGovernanceBuilderOptions, args: {
120
118
  accumulator: string;
@@ -187,8 +185,6 @@ export declare function buildStellarProposeTransferCtrlOwnershipTx(opts: Stellar
187
185
  * Token keys at propose time.
188
186
  */
189
187
  export declare function buildStellarProposeConfigureAssetOracleTx(opts: StellarGovernanceBuilderOptions, args: ConfigureAssetOracleArgs, salt: StellarGovernanceSalt): BuiltStellarTx;
190
- /** @deprecated Use buildStellarProposeConfigureAssetOracleTx. */
191
- export declare const buildStellarProposeConfigureMarketOracleTx: typeof buildStellarProposeConfigureAssetOracleTx;
192
188
  /** propose(EditOracleTolerance(EditToleranceArgs)) */
193
189
  export declare function buildStellarProposeEditOracleToleranceTx(opts: StellarGovernanceBuilderOptions, args: EditOracleToleranceProposalArgs, salt: StellarGovernanceSalt): BuiltStellarTx;
194
190
  /** propose(UpgradeGov(hash)) */
@@ -11,25 +11,78 @@
11
11
  * the wire shape is camelCase, the Soroban contract receives snake_case
12
12
  * after the SDK encoder rewrites field names.
13
13
  */
14
- import type { StellarAggregatorQuoteRequestDto, StellarAggregatorQuoteResponseDto, StellarTokenKind } from '@xoxno/types';
14
+ import type { StellarAggregatorQuoteRequestDto, StellarAggregatorQuoteResponseDto, StellarQuoteTransactionPayloadDto } from '@xoxno/types';
15
15
  import type { StellarNetwork } from './contracts.js';
16
16
  /**
17
- * Resolved token entry returned by the quote server's tokens endpoint.
18
- * Mirrors the indexer's `TokenEntry` JSON exactly.
17
+ * Token entry returned by `GET /api/v1/tokens`. Mirrors the service's
18
+ * `TokenEntry` schema exactly.
19
19
  */
20
20
  export interface StellarQuoteToken {
21
- /** Canonical token id. `C…` for Soroban contracts; `CODE:GISSUER…`
22
- * for Classic; `XLM` for native. */
21
+ /** Canonical Soroban token contract id (`C…`). `XLM` and `CODE:ISSUER`
22
+ * forms are rejected by the service. */
23
23
  id: string;
24
- kind: StellarTokenKind;
24
+ /** Decimal places: divide atomic amounts by 10^decimals for display. */
25
25
  decimals: number;
26
- /** Soroban Asset Contract peer for Classic assets (null otherwise). */
27
- sacPeer: string | null;
28
- /** Classic asset code (for Classic / SAC entries; null for Soroban). */
29
- code: string | null;
30
- /** Number of pools touching this token in the current snapshot. */
31
- degree: number;
26
+ /** `true` for a pool share token; quoting from/to it is a liquidity route. */
27
+ lp: boolean;
28
+ /** Venues the token appears on, sorted. For an LP token, the issuing venue. */
29
+ dexes: string[];
30
+ /** LP only: the pool contract that issued the shares. */
31
+ pool?: string | null;
32
+ /** LP only: constituent token ids in pool order. */
33
+ assets?: string[] | null;
32
34
  }
35
+ /** Liquidity snapshot the route was searched against. */
36
+ export interface StellarQuoteSnapshot {
37
+ ledger: number;
38
+ ageSeconds: number;
39
+ /** Live ledger compared against; present only when `fresh=true`. */
40
+ checkedLiveLedger?: number | null;
41
+ }
42
+ /** Set when the route was reduced to fit the simulation budget. */
43
+ export interface StellarQuoteDegraded {
44
+ requestedMaxSplits: number;
45
+ effectiveMaxSplits: number;
46
+ requestedMaxHops: number;
47
+ effectiveMaxHops: number;
48
+ fallbackAttempts: number;
49
+ reason: string;
50
+ }
51
+ export interface StellarQuoteLpConstituent {
52
+ token: string;
53
+ tokenKind: string;
54
+ /** Raw u128 amount as a string. */
55
+ amount: string;
56
+ amountShort: number;
57
+ }
58
+ /** Liquidity breakdown for add/remove/convert-liquidity quotes. Informational. */
59
+ export interface StellarQuoteLp {
60
+ pool: string;
61
+ dex: string;
62
+ kind: string;
63
+ feeBps: number;
64
+ shareToken: string;
65
+ amounts: StellarQuoteLpConstituent[];
66
+ refunded?: StellarQuoteLpConstituent[];
67
+ preSwap?: unknown;
68
+ }
69
+ /**
70
+ * Quote response as the service returns it. Extends the `@xoxno/types` DTO with
71
+ * fields the DTO does not yet declare. `alternatives` is still on the DTO but
72
+ * the service no longer returns it.
73
+ */
74
+ export type StellarQuoteResponse = StellarAggregatorQuoteResponseDto & {
75
+ snapshot?: StellarQuoteSnapshot | null;
76
+ degraded?: StellarQuoteDegraded | null;
77
+ lp?: StellarQuoteLp | null;
78
+ /** Ordered LP-conversion steps; mutually exclusive with `transaction`. */
79
+ transactions?: StellarQuoteTransactionPayloadDto[] | null;
80
+ };
81
+ /** Quote request; adds `simulate`, which the DTO does not yet declare. */
82
+ export type StellarQuoteRequest = StellarAggregatorQuoteRequestDto & {
83
+ /** With `sender`: simulate and prepare resource data (service default `true`). */
84
+ simulate?: boolean;
85
+ };
33
86
  export interface StellarQuoteFetchOptions {
34
87
  /** Quote-server base URL selected by the host application. */
35
88
  baseUrl: string;
@@ -49,14 +102,17 @@ export interface StellarQuoteFetchOptions {
49
102
  * `steps`. Amounts are token base-unit decimal strings. Requote after changes
50
103
  * to amount, direction or slippage; preparation is the execution check.
51
104
  *
52
- * Passing both `sender` (G...) and `router` (C...) may return a direct-swap
53
- * envelope under `transaction.envelopeXdr`. Prepare it before wallet signing.
105
+ * Passing `sender` (G...) together with `slippage` returns a direct-swap
106
+ * envelope under `transaction.envelopeXdr`. The router comes from the service's
107
+ * `/api/v1/config`; the `router` request field is ignored by the service and is
108
+ * no longer sent. Prepare the envelope before wallet signing unless
109
+ * `transaction.simulated` is true.
54
110
  * @param request - Exactly one of amountIn or amountOut; optional referralId is forwarded unchanged.
55
111
  * @param opts - Quote-server URL and optional fetch options supplied by the host.
56
112
  * @returns Quote estimates and opaque route bytes; does not execute a swap.
57
113
  * @category Strategy quotes
58
114
  */
59
- export declare function getStellarAggregatorQuote(request: StellarAggregatorQuoteRequestDto, opts: StellarQuoteFetchOptions): Promise<StellarAggregatorQuoteResponseDto>;
115
+ export declare function getStellarAggregatorQuote(request: StellarQuoteRequest, opts: StellarQuoteFetchOptions): Promise<StellarQuoteResponse>;
60
116
  /**
61
117
  * List tokens currently indexed by the quote server. Useful to populate
62
118
  * pickers or validate that a user-supplied token has on-chain liquidity.
@@ -161,8 +161,6 @@ export declare const scStruct: (fields: Record<string, xdr.ScVal>) => xdr.ScVal;
161
161
  * callers that construct routes locally.
162
162
  */
163
163
  export declare const encodeStrategyPayload: (payload: StellarStrategyPayloadInput) => xdr.ScVal;
164
- /** @deprecated Use `encodeStrategyPayload`. */
165
- export declare const encodeAggregatorSwap: (payload: StellarStrategyPayloadInput) => xdr.ScVal;
166
164
  export declare const encodeStrategyPayloadToBytes: (payload: StellarStrategyPayloadInput) => xdr.ScVal;
167
165
  /**
168
166
  * Validate the untyped `steps` field and narrow it to `StrategyPayload`.
@@ -185,8 +183,6 @@ export declare const emptyStrategySwapBytes: () => xdr.ScVal;
185
183
  * - decoded `StrategyPayload` object
186
184
  */
187
185
  export declare const asStellarStrategySwapBytes: (steps: unknown) => xdr.ScVal;
188
- /** @deprecated Use `asStellarStrategyPayload` or `asStellarStrategySwapBytes`. */
189
- export declare const asStellarSwapSteps: (steps: unknown) => StellarStrategyPayloadInput;
190
186
  /**
191
187
  * Validate the untyped `data` field on FlashLoanArgs and narrow it to
192
188
  * Buffer / hex string for Soroban `Bytes` encoding.
@@ -53,9 +53,6 @@ export interface StellarExecuteStrategyBuilderOptions extends StellarBuilderOpti
53
53
  */
54
54
  referralId?: number | string;
55
55
  }
56
- /** @deprecated Use `StellarExecuteStrategyBuilderOptions`. */
57
- export interface StellarBatchSwapBuilderOptions extends StellarExecuteStrategyBuilderOptions {
58
- }
59
56
  export declare const encodeStrategyPayloadToRouteXdr: (payload: StellarStrategyPayloadInput) => string;
60
57
  /**
61
58
  * Build an unsigned XDR for a direct user -> aggregator router swap.
@@ -65,11 +62,6 @@ export declare const encodeStrategyPayloadToRouteXdr: (payload: StellarStrategyP
65
62
  * custom route builders.
66
63
  */
67
64
  export declare function buildStellarExecuteStrategyTx(opts: StellarExecuteStrategyBuilderOptions, swap: StellarStrategySwapInput): BuiltStellarTx;
68
- /**
69
- * @deprecated The router no longer exposes `batch_execute`; this wrapper now
70
- * builds `execute_strategy(sender, total_in, swap_xdr)`.
71
- */
72
- export declare function buildStellarBatchSwapTx(opts: StellarBatchSwapBuilderOptions, swap: StellarStrategySwapInput): BuiltStellarTx;
73
65
  /**
74
66
  * Translate a quote-server response into the decoded `StrategyPayload` shape.
75
67
  * Prefer `mapQuoteResponseToStrategySwap` when the quote includes `routeXdr`.
@@ -85,5 +77,3 @@ export declare function mapQuoteResponseToStrategyPayload(quote: StellarAggregat
85
77
  * @throws StellarRouteVerificationError — never sign a quote that throws here.
86
78
  */
87
79
  export declare function mapQuoteResponseToStrategySwap(quote: StellarAggregatorQuoteResponseDto, opts?: StellarQuoteMapOptions): StellarStrategySwapInput;
88
- /** @deprecated Use `mapQuoteResponseToStrategyPayload`. */
89
- export declare const mapQuoteResponseToAggregatorSwap: typeof mapQuoteResponseToStrategyPayload;