@xoxno/types 1.0.407 → 1.0.408
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.
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
* `SwapVenue` enum in `stellar-router-contract/src/types.rs` and
|
|
4
4
|
* `rs-lending-xlm/common/src/types.rs`.
|
|
5
5
|
*/
|
|
6
|
-
export declare const SWAP_VENUES: readonly ["Soroswap", "Aquarius", "Phoenix", "
|
|
6
|
+
export declare const SWAP_VENUES: readonly ["Soroswap", "Aquarius", "Phoenix", "Sushi", "CometDex"];
|
|
7
7
|
export type SwapVenue = (typeof SWAP_VENUES)[number];
|
|
8
8
|
/**
|
|
9
9
|
* Single hop in an aggregator path. Field names use camelCase on the
|
|
10
|
-
* wire; the SDK encoder rewrites them to snake_case (`
|
|
10
|
+
* wire; the SDK encoder rewrites them to snake_case (`amount_out`, `pool`,
|
|
11
11
|
* `token_in`, `token_out`, `venue`) when building the Soroban XDR so
|
|
12
12
|
* the bytes match the on-chain `SwapHop` struct exactly.
|
|
13
13
|
*/
|
|
14
14
|
export declare class SwapHopDto {
|
|
15
|
-
|
|
15
|
+
amountOut: string;
|
|
16
16
|
pool: string;
|
|
17
17
|
tokenIn: string;
|
|
18
18
|
tokenOut: string;
|
|
@@ -22,52 +22,57 @@ export declare class SwapHopDto {
|
|
|
22
22
|
* One path in a (possibly multi-path) aggregator swap.
|
|
23
23
|
*
|
|
24
24
|
* `splitPpm` is parts-per-million of the batch's total input allocated
|
|
25
|
-
* to this path. The router computes
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* amount fields. The single `totalMinOut` guard at the batch level is
|
|
30
|
-
* the only slippage gate.
|
|
25
|
+
* to this path. The router computes the input for each path from
|
|
26
|
+
* `totalIn` and the ppm split; the last path absorbs PPM rounding. Within
|
|
27
|
+
* a path, output of hop N feeds hop N+1 directly. The single
|
|
28
|
+
* `totalMinOut` guard at the payload level is the final slippage gate.
|
|
31
29
|
*/
|
|
32
30
|
export declare class SwapPathDto {
|
|
33
31
|
hops: SwapHopDto[];
|
|
34
32
|
splitPpm: number;
|
|
35
33
|
}
|
|
36
34
|
/**
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
* and
|
|
42
|
-
* router.
|
|
35
|
+
* Full payload encoded into `routeXdr` for the aggregator router's
|
|
36
|
+
* `execute_strategy(sender, total_in, swap_xdr)` entry point.
|
|
37
|
+
*
|
|
38
|
+
* Lending controllers receive the encoded bytes as an opaque `Bytes` value
|
|
39
|
+
* and forward them to the aggregator; they do not decode this struct.
|
|
43
40
|
*/
|
|
44
|
-
export declare class
|
|
41
|
+
export declare class StrategyPayloadDto {
|
|
45
42
|
paths: SwapPathDto[];
|
|
43
|
+
referralId?: number;
|
|
44
|
+
tokenIn: string;
|
|
45
|
+
tokenOut: string;
|
|
46
46
|
totalMinOut: string;
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
* `totalIn` once at the start) and receives the output.
|
|
53
|
-
*
|
|
54
|
-
* Lending callers never construct `BatchSwap` directly — the controller
|
|
55
|
-
* fills `sender` with `current_contract_address` and `totalIn` with the
|
|
56
|
-
* authoritative withdrawal delta so user funds remain under the
|
|
57
|
-
* controller's custody for the duration of the strategy.
|
|
49
|
+
* Opaque strategy swap payload as returned by the quote server. `routeXdr`
|
|
50
|
+
* is the base64 ScVal XDR for `StrategyPayloadDto`; callers pass the
|
|
51
|
+
* decoded bytes to `execute_strategy` or to a lending strategy method.
|
|
58
52
|
*/
|
|
59
|
-
export declare class
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
53
|
+
export declare class StrategySwapDto {
|
|
54
|
+
routeXdr: string;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* @deprecated Use `StrategyPayloadDto` for decoded payloads or
|
|
58
|
+
* `StrategySwapDto.routeXdr` for the executable opaque bytes.
|
|
59
|
+
*/
|
|
60
|
+
export declare class AggregatorSwapDto extends StrategyPayloadDto {
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* @deprecated The current router no longer exposes `batch_execute`.
|
|
64
|
+
* Use `execute_strategy(sender, total_in, swap_xdr)` with
|
|
65
|
+
* `StrategySwapDto.routeXdr`.
|
|
66
|
+
*/
|
|
67
|
+
export declare class BatchSwapDto extends StrategyPayloadDto {
|
|
68
|
+
sender?: string;
|
|
69
|
+
totalIn?: string;
|
|
65
70
|
}
|
|
66
71
|
/**
|
|
67
72
|
* Execution-plane filter for the quote server.
|
|
68
|
-
* - `aggregator` (default): Soroban venues only (Soroswap
|
|
69
|
-
* Phoenix
|
|
70
|
-
*
|
|
73
|
+
* - `aggregator` (default): Soroban venues only (Soroswap, Aquarius,
|
|
74
|
+
* Phoenix, Sushi, CometDex). Produces a `routeXdr` payload and,
|
|
75
|
+
* when requested, an `execute_strategy` envelope.
|
|
71
76
|
* - `sdex`: Stellar DEX (native AMM) only.
|
|
72
77
|
* - `all`: runs both planes and returns the winner with the runner-up
|
|
73
78
|
* attached as an alternative.
|
|
@@ -84,9 +89,10 @@ export type StellarTokenKind = 'native' | 'classic' | 'soroban';
|
|
|
84
89
|
/**
|
|
85
90
|
* Query parameters for `GET /api/v1/quote` on the Stellar quote server.
|
|
86
91
|
*
|
|
87
|
-
* Exactly one of `amountIn` or `amountOut` must be provided.
|
|
88
|
-
*
|
|
89
|
-
*
|
|
92
|
+
* Exactly one of `amountIn` or `amountOut` must be provided. The response
|
|
93
|
+
* includes `routeXdr` for the Soroban-only aggregator route. `router`
|
|
94
|
+
* + `sender` together populate `transaction.envelopeXdr` with a
|
|
95
|
+
* ready-to-sign `execute_strategy` envelope.
|
|
90
96
|
*/
|
|
91
97
|
export declare class StellarAggregatorQuoteRequestDto {
|
|
92
98
|
from: string;
|
|
@@ -111,7 +117,7 @@ export declare class StellarAggregatorQuoteRequestDto {
|
|
|
111
117
|
* quote-hop → contract-hop is:
|
|
112
118
|
*
|
|
113
119
|
* ```
|
|
114
|
-
* {
|
|
120
|
+
* { amountOut → amountOut, address → pool, from → tokenIn, to → tokenOut, dex → venue }
|
|
115
121
|
* ```
|
|
116
122
|
*/
|
|
117
123
|
export declare class StellarQuoteSwapHopDto {
|
|
@@ -129,8 +135,8 @@ export declare class StellarQuoteSwapHopDto {
|
|
|
129
135
|
amountOutShort: number;
|
|
130
136
|
}
|
|
131
137
|
/**
|
|
132
|
-
* Single allocated path in the quote response. Maps
|
|
133
|
-
* (with field renames) when
|
|
138
|
+
* Single allocated path in the quote response. Maps to `SwapPathDto`
|
|
139
|
+
* (with field renames) when constructing a decoded strategy payload.
|
|
134
140
|
*/
|
|
135
141
|
export declare class StellarQuotePathDto {
|
|
136
142
|
amountIn: string;
|
|
@@ -141,8 +147,9 @@ export declare class StellarQuotePathDto {
|
|
|
141
147
|
swaps: StellarQuoteSwapHopDto[];
|
|
142
148
|
}
|
|
143
149
|
/**
|
|
144
|
-
* Unsigned Soroban transaction envelope returned when the quote
|
|
145
|
-
*
|
|
150
|
+
* Unsigned Soroban transaction envelope returned when the quote request
|
|
151
|
+
* supplied both `sender` and `router`. It invokes
|
|
152
|
+
* `execute_strategy(sender, total_in, swap_xdr)`. The caller MUST:
|
|
146
153
|
* 1. Populate `seqNum` from the sender\'s account state.
|
|
147
154
|
* 2. Run `simulateTransaction` to attach Soroban resource fees.
|
|
148
155
|
* 3. Sign with the sender\'s key (Ed25519 / Stellar Wallets Kit).
|
|
@@ -184,6 +191,7 @@ export declare class StellarAggregatorQuoteResponseDto {
|
|
|
184
191
|
amountOutMinShort?: number;
|
|
185
192
|
slippage?: number;
|
|
186
193
|
priceImpact?: number;
|
|
194
|
+
routeXdr?: string;
|
|
187
195
|
rate: number;
|
|
188
196
|
rateInverse: number;
|
|
189
197
|
decimalsIn: number;
|
|
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.StellarAggregatorQuoteResponseDto = exports.StellarQuoteAlternativeDto = exports.StellarQuoteTransactionPayloadDto = exports.StellarQuotePathDto = exports.StellarQuoteSwapHopDto = exports.StellarAggregatorQuoteRequestDto = exports.STELLAR_QUOTE_PLATFORMS = exports.BatchSwapDto = exports.AggregatorSwapDto = exports.SwapPathDto = exports.SwapHopDto = exports.SWAP_VENUES = void 0;
|
|
12
|
+
exports.StellarAggregatorQuoteResponseDto = exports.StellarQuoteAlternativeDto = exports.StellarQuoteTransactionPayloadDto = exports.StellarQuotePathDto = exports.StellarQuoteSwapHopDto = exports.StellarAggregatorQuoteRequestDto = exports.STELLAR_QUOTE_PLATFORMS = exports.BatchSwapDto = exports.AggregatorSwapDto = exports.StrategySwapDto = exports.StrategyPayloadDto = exports.SwapPathDto = exports.SwapHopDto = exports.SWAP_VENUES = void 0;
|
|
13
13
|
const swagger_1 = require("@nestjs/swagger");
|
|
14
14
|
const class_transformer_1 = require("class-transformer");
|
|
15
15
|
const class_validator_1 = require("class-validator");
|
|
@@ -22,12 +22,12 @@ exports.SWAP_VENUES = [
|
|
|
22
22
|
'Soroswap',
|
|
23
23
|
'Aquarius',
|
|
24
24
|
'Phoenix',
|
|
25
|
-
'
|
|
26
|
-
'
|
|
25
|
+
'Sushi',
|
|
26
|
+
'CometDex',
|
|
27
27
|
];
|
|
28
28
|
/**
|
|
29
29
|
* Single hop in an aggregator path. Field names use camelCase on the
|
|
30
|
-
* wire; the SDK encoder rewrites them to snake_case (`
|
|
30
|
+
* wire; the SDK encoder rewrites them to snake_case (`amount_out`, `pool`,
|
|
31
31
|
* `token_in`, `token_out`, `venue`) when building the Soroban XDR so
|
|
32
32
|
* the bytes match the on-chain `SwapHop` struct exactly.
|
|
33
33
|
*/
|
|
@@ -36,16 +36,15 @@ class SwapHopDto {
|
|
|
36
36
|
exports.SwapHopDto = SwapHopDto;
|
|
37
37
|
__decorate([
|
|
38
38
|
(0, swagger_1.ApiProperty)({
|
|
39
|
-
description: '
|
|
40
|
-
example:
|
|
39
|
+
description: 'Expected output of this hop in raw token units (i128 decimal string). The router uses it as the venue-specific swap limit/hint.',
|
|
40
|
+
example: '6679778663',
|
|
41
41
|
}),
|
|
42
|
-
(0, class_validator_1.
|
|
43
|
-
(
|
|
44
|
-
|
|
45
|
-
], SwapHopDto.prototype, "feeBps", void 0);
|
|
42
|
+
(0, class_validator_1.IsString)(),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], SwapHopDto.prototype, "amountOut", void 0);
|
|
46
45
|
__decorate([
|
|
47
46
|
(0, swagger_1.ApiProperty)({
|
|
48
|
-
description: '
|
|
47
|
+
description: 'Soroban pool contract address for the venue executing this hop.',
|
|
49
48
|
example: 'CATK7WRKPAMZKSTNZJ5J6MT7Q7I3DLYEBIAB4CA6Z6SY6LAD2ASQOHNN',
|
|
50
49
|
}),
|
|
51
50
|
(0, class_validator_1.IsString)(),
|
|
@@ -80,12 +79,10 @@ __decorate([
|
|
|
80
79
|
* One path in a (possibly multi-path) aggregator swap.
|
|
81
80
|
*
|
|
82
81
|
* `splitPpm` is parts-per-million of the batch's total input allocated
|
|
83
|
-
* to this path. The router computes
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
* amount fields. The single `totalMinOut` guard at the batch level is
|
|
88
|
-
* the only slippage gate.
|
|
82
|
+
* to this path. The router computes the input for each path from
|
|
83
|
+
* `totalIn` and the ppm split; the last path absorbs PPM rounding. Within
|
|
84
|
+
* a path, output of hop N feeds hop N+1 directly. The single
|
|
85
|
+
* `totalMinOut` guard at the payload level is the final slippage gate.
|
|
89
86
|
*/
|
|
90
87
|
class SwapPathDto {
|
|
91
88
|
}
|
|
@@ -113,16 +110,15 @@ __decorate([
|
|
|
113
110
|
__metadata("design:type", Number)
|
|
114
111
|
], SwapPathDto.prototype, "splitPpm", void 0);
|
|
115
112
|
/**
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
* and
|
|
121
|
-
* router.
|
|
113
|
+
* Full payload encoded into `routeXdr` for the aggregator router's
|
|
114
|
+
* `execute_strategy(sender, total_in, swap_xdr)` entry point.
|
|
115
|
+
*
|
|
116
|
+
* Lending controllers receive the encoded bytes as an opaque `Bytes` value
|
|
117
|
+
* and forward them to the aggregator; they do not decode this struct.
|
|
122
118
|
*/
|
|
123
|
-
class
|
|
119
|
+
class StrategyPayloadDto {
|
|
124
120
|
}
|
|
125
|
-
exports.
|
|
121
|
+
exports.StrategyPayloadDto = StrategyPayloadDto;
|
|
126
122
|
__decorate([
|
|
127
123
|
(0, swagger_1.ApiProperty)({
|
|
128
124
|
description: 'Parallel paths to execute. Length >= 1.',
|
|
@@ -134,7 +130,34 @@ __decorate([
|
|
|
134
130
|
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
135
131
|
(0, class_transformer_1.Type)(() => SwapPathDto),
|
|
136
132
|
__metadata("design:type", Array)
|
|
137
|
-
],
|
|
133
|
+
], StrategyPayloadDto.prototype, "paths", void 0);
|
|
134
|
+
__decorate([
|
|
135
|
+
(0, swagger_1.ApiProperty)({
|
|
136
|
+
description: 'Referral identifier. `0` (or omitted) means no referral and no fee. Non-zero IDs must be registered on-chain via `add_referral` or the router rejects execution.',
|
|
137
|
+
example: 0,
|
|
138
|
+
required: false,
|
|
139
|
+
}),
|
|
140
|
+
(0, class_validator_1.IsOptional)(),
|
|
141
|
+
(0, class_validator_1.IsInt)(),
|
|
142
|
+
(0, class_validator_1.Min)(0),
|
|
143
|
+
__metadata("design:type", Number)
|
|
144
|
+
], StrategyPayloadDto.prototype, "referralId", void 0);
|
|
145
|
+
__decorate([
|
|
146
|
+
(0, swagger_1.ApiProperty)({
|
|
147
|
+
description: 'Soroban Asset Contract address of the input token.',
|
|
148
|
+
example: 'CDLZFC3SYJYDZT7K67VZ75HPJVIEUVNIXF47ZG2FB2RMQQVU2HHGCYSC',
|
|
149
|
+
}),
|
|
150
|
+
(0, class_validator_1.IsString)(),
|
|
151
|
+
__metadata("design:type", String)
|
|
152
|
+
], StrategyPayloadDto.prototype, "tokenIn", void 0);
|
|
153
|
+
__decorate([
|
|
154
|
+
(0, swagger_1.ApiProperty)({
|
|
155
|
+
description: 'Soroban Asset Contract address of the output token.',
|
|
156
|
+
example: 'CBIELTK6YBZJU5UP2WWQEUCYKLPU6AUNZ2BQ4WWFEIE3USCIHMXQDAMA',
|
|
157
|
+
}),
|
|
158
|
+
(0, class_validator_1.IsString)(),
|
|
159
|
+
__metadata("design:type", String)
|
|
160
|
+
], StrategyPayloadDto.prototype, "tokenOut", void 0);
|
|
138
161
|
__decorate([
|
|
139
162
|
(0, swagger_1.ApiProperty)({
|
|
140
163
|
description: "Aggregate slippage guard across all paths' final output token (i128 decimal string). Must be > 0.",
|
|
@@ -142,69 +165,63 @@ __decorate([
|
|
|
142
165
|
}),
|
|
143
166
|
(0, class_validator_1.IsString)(),
|
|
144
167
|
__metadata("design:type", String)
|
|
145
|
-
],
|
|
168
|
+
], StrategyPayloadDto.prototype, "totalMinOut", void 0);
|
|
146
169
|
/**
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
* `totalIn` once at the start) and receives the output.
|
|
151
|
-
*
|
|
152
|
-
* Lending callers never construct `BatchSwap` directly — the controller
|
|
153
|
-
* fills `sender` with `current_contract_address` and `totalIn` with the
|
|
154
|
-
* authoritative withdrawal delta so user funds remain under the
|
|
155
|
-
* controller's custody for the duration of the strategy.
|
|
170
|
+
* Opaque strategy swap payload as returned by the quote server. `routeXdr`
|
|
171
|
+
* is the base64 ScVal XDR for `StrategyPayloadDto`; callers pass the
|
|
172
|
+
* decoded bytes to `execute_strategy` or to a lending strategy method.
|
|
156
173
|
*/
|
|
157
|
-
class
|
|
174
|
+
class StrategySwapDto {
|
|
158
175
|
}
|
|
159
|
-
exports.
|
|
160
|
-
__decorate([
|
|
161
|
-
(0, swagger_1.ApiProperty)({ type: () => SwapPathDto, isArray: true }),
|
|
162
|
-
(0, class_validator_1.IsArray)(),
|
|
163
|
-
(0, class_validator_1.ArrayMinSize)(1),
|
|
164
|
-
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
165
|
-
(0, class_transformer_1.Type)(() => SwapPathDto),
|
|
166
|
-
__metadata("design:type", Array)
|
|
167
|
-
], BatchSwapDto.prototype, "paths", void 0);
|
|
176
|
+
exports.StrategySwapDto = StrategySwapDto;
|
|
168
177
|
__decorate([
|
|
169
178
|
(0, swagger_1.ApiProperty)({
|
|
170
|
-
description: '
|
|
171
|
-
example:
|
|
172
|
-
required: false,
|
|
179
|
+
description: 'Base64 ScVal XDR of `StrategyPayloadDto`, passed as Soroban `Bytes` to `execute_strategy(sender, total_in, swap_xdr)`.',
|
|
180
|
+
example: 'AAAA...',
|
|
173
181
|
}),
|
|
174
|
-
(0, class_validator_1.
|
|
175
|
-
(
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
182
|
+
(0, class_validator_1.IsString)(),
|
|
183
|
+
__metadata("design:type", String)
|
|
184
|
+
], StrategySwapDto.prototype, "routeXdr", void 0);
|
|
185
|
+
/**
|
|
186
|
+
* @deprecated Use `StrategyPayloadDto` for decoded payloads or
|
|
187
|
+
* `StrategySwapDto.routeXdr` for the executable opaque bytes.
|
|
188
|
+
*/
|
|
189
|
+
class AggregatorSwapDto extends StrategyPayloadDto {
|
|
190
|
+
}
|
|
191
|
+
exports.AggregatorSwapDto = AggregatorSwapDto;
|
|
192
|
+
/**
|
|
193
|
+
* @deprecated The current router no longer exposes `batch_execute`.
|
|
194
|
+
* Use `execute_strategy(sender, total_in, swap_xdr)` with
|
|
195
|
+
* `StrategySwapDto.routeXdr`.
|
|
196
|
+
*/
|
|
197
|
+
class BatchSwapDto extends StrategyPayloadDto {
|
|
198
|
+
}
|
|
199
|
+
exports.BatchSwapDto = BatchSwapDto;
|
|
179
200
|
__decorate([
|
|
180
201
|
(0, swagger_1.ApiProperty)({
|
|
181
|
-
description: '
|
|
202
|
+
description: 'Deprecated. `execute_strategy` takes the sender as a separate argument.',
|
|
182
203
|
example: 'GDBBOILYIJBSUQKC3Z3USAW3DGPFHIGVKYA5T4ZUZBO56HBUPHJEN3FV',
|
|
204
|
+
required: false,
|
|
183
205
|
}),
|
|
206
|
+
(0, class_validator_1.IsOptional)(),
|
|
184
207
|
(0, class_validator_1.IsString)(),
|
|
185
208
|
__metadata("design:type", String)
|
|
186
209
|
], BatchSwapDto.prototype, "sender", void 0);
|
|
187
210
|
__decorate([
|
|
188
211
|
(0, swagger_1.ApiProperty)({
|
|
189
|
-
description:
|
|
212
|
+
description: 'Deprecated. `execute_strategy` takes the total input as a separate argument.',
|
|
190
213
|
example: '1000000000',
|
|
214
|
+
required: false,
|
|
191
215
|
}),
|
|
216
|
+
(0, class_validator_1.IsOptional)(),
|
|
192
217
|
(0, class_validator_1.IsString)(),
|
|
193
218
|
__metadata("design:type", String)
|
|
194
219
|
], BatchSwapDto.prototype, "totalIn", void 0);
|
|
195
|
-
__decorate([
|
|
196
|
-
(0, swagger_1.ApiProperty)({
|
|
197
|
-
description: 'Aggregate slippage guard across all paths.',
|
|
198
|
-
example: '6679778663',
|
|
199
|
-
}),
|
|
200
|
-
(0, class_validator_1.IsString)(),
|
|
201
|
-
__metadata("design:type", String)
|
|
202
|
-
], BatchSwapDto.prototype, "totalMinOut", void 0);
|
|
203
220
|
/**
|
|
204
221
|
* Execution-plane filter for the quote server.
|
|
205
|
-
* - `aggregator` (default): Soroban venues only (Soroswap
|
|
206
|
-
* Phoenix
|
|
207
|
-
*
|
|
222
|
+
* - `aggregator` (default): Soroban venues only (Soroswap, Aquarius,
|
|
223
|
+
* Phoenix, Sushi, CometDex). Produces a `routeXdr` payload and,
|
|
224
|
+
* when requested, an `execute_strategy` envelope.
|
|
208
225
|
* - `sdex`: Stellar DEX (native AMM) only.
|
|
209
226
|
* - `all`: runs both planes and returns the winner with the runner-up
|
|
210
227
|
* attached as an alternative.
|
|
@@ -213,9 +230,10 @@ exports.STELLAR_QUOTE_PLATFORMS = ['aggregator', 'sdex', 'all'];
|
|
|
213
230
|
/**
|
|
214
231
|
* Query parameters for `GET /api/v1/quote` on the Stellar quote server.
|
|
215
232
|
*
|
|
216
|
-
* Exactly one of `amountIn` or `amountOut` must be provided.
|
|
217
|
-
*
|
|
218
|
-
*
|
|
233
|
+
* Exactly one of `amountIn` or `amountOut` must be provided. The response
|
|
234
|
+
* includes `routeXdr` for the Soroban-only aggregator route. `router`
|
|
235
|
+
* + `sender` together populate `transaction.envelopeXdr` with a
|
|
236
|
+
* ready-to-sign `execute_strategy` envelope.
|
|
219
237
|
*/
|
|
220
238
|
class StellarAggregatorQuoteRequestDto {
|
|
221
239
|
}
|
|
@@ -357,7 +375,7 @@ __decorate([
|
|
|
357
375
|
* quote-hop → contract-hop is:
|
|
358
376
|
*
|
|
359
377
|
* ```
|
|
360
|
-
* {
|
|
378
|
+
* { amountOut → amountOut, address → pool, from → tokenIn, to → tokenOut, dex → venue }
|
|
361
379
|
* ```
|
|
362
380
|
*/
|
|
363
381
|
class StellarQuoteSwapHopDto {
|
|
@@ -382,7 +400,7 @@ __decorate([
|
|
|
382
400
|
], StellarQuoteSwapHopDto.prototype, "kind", void 0);
|
|
383
401
|
__decorate([
|
|
384
402
|
(0, swagger_1.ApiProperty)({
|
|
385
|
-
description: 'Canonical pool identifier.
|
|
403
|
+
description: 'Canonical pool identifier. For aggregator routes this is always a Soroban pool C-strkey. Field name `address` mirrors MVX QuoteSwapResponse exactly so chain-agnostic clients can iterate hops without branching on chain.',
|
|
386
404
|
}),
|
|
387
405
|
(0, class_validator_1.IsString)(),
|
|
388
406
|
__metadata("design:type", String)
|
|
@@ -442,8 +460,8 @@ __decorate([
|
|
|
442
460
|
__metadata("design:type", Number)
|
|
443
461
|
], StellarQuoteSwapHopDto.prototype, "amountOutShort", void 0);
|
|
444
462
|
/**
|
|
445
|
-
* Single allocated path in the quote response. Maps
|
|
446
|
-
* (with field renames) when
|
|
463
|
+
* Single allocated path in the quote response. Maps to `SwapPathDto`
|
|
464
|
+
* (with field renames) when constructing a decoded strategy payload.
|
|
447
465
|
*/
|
|
448
466
|
class StellarQuotePathDto {
|
|
449
467
|
}
|
|
@@ -486,8 +504,9 @@ __decorate([
|
|
|
486
504
|
__metadata("design:type", Array)
|
|
487
505
|
], StellarQuotePathDto.prototype, "swaps", void 0);
|
|
488
506
|
/**
|
|
489
|
-
* Unsigned Soroban transaction envelope returned when the quote
|
|
490
|
-
*
|
|
507
|
+
* Unsigned Soroban transaction envelope returned when the quote request
|
|
508
|
+
* supplied both `sender` and `router`. It invokes
|
|
509
|
+
* `execute_strategy(sender, total_in, swap_xdr)`. The caller MUST:
|
|
491
510
|
* 1. Populate `seqNum` from the sender\'s account state.
|
|
492
511
|
* 2. Run `simulateTransaction` to attach Soroban resource fees.
|
|
493
512
|
* 3. Sign with the sender\'s key (Ed25519 / Stellar Wallets Kit).
|
|
@@ -640,6 +659,15 @@ __decorate([
|
|
|
640
659
|
(0, class_validator_1.IsNumber)(),
|
|
641
660
|
__metadata("design:type", Number)
|
|
642
661
|
], StellarAggregatorQuoteResponseDto.prototype, "priceImpact", void 0);
|
|
662
|
+
__decorate([
|
|
663
|
+
(0, swagger_1.ApiProperty)({
|
|
664
|
+
description: 'Base64 ScVal XDR of `StrategyPayloadDto`. Decode it to bytes and pass it as `swap_xdr` to `execute_strategy`, or forward it as opaque strategy bytes to lending controllers.',
|
|
665
|
+
required: false,
|
|
666
|
+
}),
|
|
667
|
+
(0, class_validator_1.IsOptional)(),
|
|
668
|
+
(0, class_validator_1.IsString)(),
|
|
669
|
+
__metadata("design:type", String)
|
|
670
|
+
], StellarAggregatorQuoteResponseDto.prototype, "routeXdr", void 0);
|
|
643
671
|
__decorate([
|
|
644
672
|
(0, swagger_1.ApiProperty)({ description: 'Output per 1 unit of input.' }),
|
|
645
673
|
(0, class_validator_1.IsNumber)(),
|
|
@@ -749,7 +777,7 @@ __decorate([
|
|
|
749
777
|
], StellarAggregatorQuoteResponseDto.prototype, "feeAmountShort", void 0);
|
|
750
778
|
__decorate([
|
|
751
779
|
(0, swagger_1.ApiProperty)({
|
|
752
|
-
description:
|
|
780
|
+
description: "`true` if the fee is charged on the input token, `false` if charged on the output. Mirrors the contract's `fee_on_input = !out_whitelisted || in_whitelisted` rule.",
|
|
753
781
|
required: false,
|
|
754
782
|
}),
|
|
755
783
|
(0, class_validator_1.IsOptional)(),
|
|
@@ -190,7 +190,7 @@ __decorate([
|
|
|
190
190
|
], MultiplyArgs.prototype, "mode", void 0);
|
|
191
191
|
__decorate([
|
|
192
192
|
(0, swagger_1.ApiProperty)({
|
|
193
|
-
description: 'Chain-specific swap
|
|
193
|
+
description: 'Chain-specific opaque swap bytes encoded by the SDK transaction builder',
|
|
194
194
|
}),
|
|
195
195
|
__metadata("design:type", Object)
|
|
196
196
|
], MultiplyArgs.prototype, "steps", void 0);
|
|
@@ -211,7 +211,7 @@ __decorate([
|
|
|
211
211
|
], MultiplyArgs.prototype, "initialPayment", void 0);
|
|
212
212
|
__decorate([
|
|
213
213
|
(0, swagger_1.ApiProperty)({
|
|
214
|
-
description: 'Optional secondary swap converting the initial payment into the collateral token',
|
|
214
|
+
description: 'Optional opaque secondary swap bytes converting the initial payment into the collateral token',
|
|
215
215
|
required: false,
|
|
216
216
|
}),
|
|
217
217
|
__metadata("design:type", Object)
|
|
@@ -246,7 +246,7 @@ __decorate([
|
|
|
246
246
|
], SwapDebtArgs.prototype, "newDebtToken", void 0);
|
|
247
247
|
__decorate([
|
|
248
248
|
(0, swagger_1.ApiProperty)({
|
|
249
|
-
description: 'Chain-specific swap
|
|
249
|
+
description: 'Chain-specific opaque swap bytes encoded by the SDK transaction builder',
|
|
250
250
|
}),
|
|
251
251
|
__metadata("design:type", Object)
|
|
252
252
|
], SwapDebtArgs.prototype, "steps", void 0);
|
|
@@ -280,7 +280,7 @@ __decorate([
|
|
|
280
280
|
], SwapCollateralArgs.prototype, "newCollateral", void 0);
|
|
281
281
|
__decorate([
|
|
282
282
|
(0, swagger_1.ApiProperty)({
|
|
283
|
-
description: 'Chain-specific swap
|
|
283
|
+
description: 'Chain-specific opaque swap bytes encoded by the SDK transaction builder',
|
|
284
284
|
}),
|
|
285
285
|
__metadata("design:type", Object)
|
|
286
286
|
], SwapCollateralArgs.prototype, "steps", void 0);
|
|
@@ -314,7 +314,7 @@ __decorate([
|
|
|
314
314
|
], RepayDebtWithCollateralArgs.prototype, "debtToken", void 0);
|
|
315
315
|
__decorate([
|
|
316
316
|
(0, swagger_1.ApiProperty)({
|
|
317
|
-
description: 'Chain-specific swap
|
|
317
|
+
description: 'Chain-specific opaque swap bytes encoded by the SDK transaction builder',
|
|
318
318
|
}),
|
|
319
319
|
__metadata("design:type", Object)
|
|
320
320
|
], RepayDebtWithCollateralArgs.prototype, "steps", void 0);
|