@xoxno/sdk-js 1.0.201 → 1.0.203

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.
@@ -8,12 +8,22 @@
8
8
  import { xdr } from '@stellar/stellar-sdk';
9
9
  /**
10
10
  * On-chain swap venues, validated at runtime for a caller-supplied venue.
11
- * Mirrors the Soroban-only aggregator router's `SwapVenue` enum.
11
+ * Mirrors the Soroban-only aggregator router's opcode table.
12
12
  */
13
13
  export declare const STELLAR_SWAP_VENUES: readonly ["Soroswap", "Aquarius", "Phoenix", "Sushi", "CometDex"];
14
14
  export type StellarSwapVenue = (typeof STELLAR_SWAP_VENUES)[number];
15
+ /**
16
+ * Instruction opcode per venue. Part of the on-chain ABI — see
17
+ * `contracts/swap-aggregator/src/program.rs`.
18
+ */
19
+ export declare const STELLAR_SWAP_VENUE_OPCODE: Record<StellarSwapVenue, number>;
20
+ /** Wire version of the packed program. Must match the contract's `VERSION`. */
21
+ export declare const STELLAR_PROGRAM_VERSION = 1;
22
+ /** Split weights are parts per million. */
23
+ export declare const PPM_DENOMINATOR = 1000000;
15
24
  export interface StellarStrategySwapHopInput {
16
- amountOut: string;
25
+ /** Quote-side estimate; not carried on the wire. */
26
+ amountOut?: string;
17
27
  pool: string;
18
28
  tokenIn: string;
19
29
  tokenOut: string;
@@ -21,10 +31,25 @@ export interface StellarStrategySwapHopInput {
21
31
  }
22
32
  export interface StellarStrategySwapPathInput {
23
33
  hops: StellarStrategySwapHopInput[];
34
+ /** Absolute share of this path's starting-token balance, in ppm. */
24
35
  splitPpm: number;
25
36
  }
26
37
  export interface StellarStrategyPayloadInput {
38
+ /** Aquarius pool whose LP shares (`tokenIn`) are burned before routing. */
39
+ burnPool?: string;
40
+ /** Per-constituent floors for the burn, in the pool's own token order. */
41
+ burnMinAmounts?: string[];
42
+ /** Aquarius pool that mints `tokenOut` from the routed constituents. */
43
+ mintPool?: string;
44
+ /** Minimum LP shares the mint must deliver. */
45
+ mintMinShares?: string;
46
+ /** Constituents of `mintPool`, in pool order. Required with `preSwapAmount`. */
47
+ mintPoolTokens?: string[];
27
48
  paths: StellarStrategySwapPathInput[];
49
+ /** Caller-solved amount that balances a lopsided mint before the deposit. */
50
+ preSwapAmount?: string;
51
+ /** Pre-swap direction: pool token A into B when true, B into A when false. */
52
+ preSwapFromA?: boolean;
28
53
  referralId?: number | string;
29
54
  tokenIn: string;
30
55
  tokenOut: string;
@@ -99,13 +124,8 @@ export declare const tupleHubAssetAmountVec: (entries: Array<{
99
124
  */
100
125
  export declare const scStruct: (fields: Record<string, xdr.ScVal>) => xdr.ScVal;
101
126
  /**
102
- * Encode a Soroban `enum SwapVenue` (tag-only / unit variant). At the XDR level
103
- * a unit variant is `scvVec([symbol_name])`.
104
- */
105
- export declare const encodeSwapVenue: (venue: StellarSwapVenue) => xdr.ScVal;
106
- /**
107
- * Encode the aggregator router's decoded `StrategyPayload` struct. The caller
108
- * usually receives this as quote `routeXdr`; this helper is for tests and for
127
+ * Encode the aggregator router's `StrategyPayload`. The caller usually receives
128
+ * this already encoded as quote `routeXdr`; this helper is for tests and for
109
129
  * callers that construct routes locally.
110
130
  */
111
131
  export declare const encodeStrategyPayload: (payload: StellarStrategyPayloadInput) => xdr.ScVal;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xoxno/sdk-js",
3
- "version": "1.0.201",
3
+ "version": "1.0.203",
4
4
  "description": "The SDK to interact with the XOXNO Protocol!",
5
5
  "type": "module",
6
6
  "exports": {