@xoxno/types 1.0.391 → 1.0.393
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts
CHANGED
|
@@ -185,6 +185,7 @@ export * from './entities/web2user-data/web2user.doc';
|
|
|
185
185
|
export * from './entities/xoxno-liquid-egld-sc/provider.dto';
|
|
186
186
|
export * from './requests/aggregator/arda-swap-result.dto';
|
|
187
187
|
export * from './requests/aggregator/soroswap-quote.dto';
|
|
188
|
+
export * from './requests/aggregator/stellar-aggregator.dto';
|
|
188
189
|
export * from './requests/aggregator/swap';
|
|
189
190
|
export * from './requests/bober-battle/analytics';
|
|
190
191
|
export * from './requests/chat/chat-token';
|
package/dist/index.js
CHANGED
|
@@ -274,6 +274,7 @@ __exportStar(require("./enums/xoxno-egld-ls-activity.enum"), exports);
|
|
|
274
274
|
__exportStar(require("./enums/xoxno-ls-activity.enum"), exports);
|
|
275
275
|
__exportStar(require("./requests/aggregator/arda-swap-result.dto"), exports);
|
|
276
276
|
__exportStar(require("./requests/aggregator/soroswap-quote.dto"), exports);
|
|
277
|
+
__exportStar(require("./requests/aggregator/stellar-aggregator.dto"), exports);
|
|
277
278
|
__exportStar(require("./requests/aggregator/swap"), exports);
|
|
278
279
|
__exportStar(require("./requests/bober-battle/analytics"), exports);
|
|
279
280
|
__exportStar(require("./requests/chat/chat-token"), exports);
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* On-chain venue tag for a single hop. Matches the Soroban
|
|
3
|
+
* `SwapVenue` enum in `stellar-router-contract/src/types.rs` and
|
|
4
|
+
* `rs-lending-xlm/common/src/types.rs`.
|
|
5
|
+
*/
|
|
6
|
+
export declare const SWAP_VENUES: readonly ["Soroswap", "Aquarius", "Phoenix", "NativeAmm", "StaticBridge"];
|
|
7
|
+
export type SwapVenue = (typeof SWAP_VENUES)[number];
|
|
8
|
+
/**
|
|
9
|
+
* Single hop in an aggregator path. Field names use camelCase on the
|
|
10
|
+
* wire; the SDK encoder rewrites them to snake_case (`fee_bps`, `pool`,
|
|
11
|
+
* `token_in`, `token_out`, `venue`) when building the Soroban XDR so
|
|
12
|
+
* the bytes match the on-chain `SwapHop` struct exactly.
|
|
13
|
+
*/
|
|
14
|
+
export declare class SwapHopDto {
|
|
15
|
+
feeBps: number;
|
|
16
|
+
pool: string;
|
|
17
|
+
tokenIn: string;
|
|
18
|
+
tokenOut: string;
|
|
19
|
+
venue: SwapVenue;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* One path in a (possibly multi-path) aggregator swap.
|
|
23
|
+
*
|
|
24
|
+
* `splitPpm` is parts-per-million of the batch's total input allocated
|
|
25
|
+
* to this path. The router computes `path_input = totalIn * splitPpm /
|
|
26
|
+
* 1_000_000`; the LAST path absorbs PPM rounding so the entire `totalIn`
|
|
27
|
+
* is consumed and no dust is left on the sender. Within a path, output
|
|
28
|
+
* of hop N feeds hop N+1 directly — there are no per-hop or per-path
|
|
29
|
+
* amount fields. The single `totalMinOut` guard at the batch level is
|
|
30
|
+
* the only slippage gate.
|
|
31
|
+
*/
|
|
32
|
+
export declare class SwapPathDto {
|
|
33
|
+
hops: SwapHopDto[];
|
|
34
|
+
splitPpm: number;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* User-facing aggregator swap request as accepted by the Soroban
|
|
38
|
+
* lending controller's strategy methods (`multiply`, `swap_debt`,
|
|
39
|
+
* `swap_collateral`, `repay_debt_with_collateral`). The controller
|
|
40
|
+
* wraps this in `BatchSwap` (filling `sender = current_contract_address`
|
|
41
|
+
* and `totalIn = actual_withdrawn`) before forwarding to the aggregator
|
|
42
|
+
* router.
|
|
43
|
+
*/
|
|
44
|
+
export declare class AggregatorSwapDto {
|
|
45
|
+
paths: SwapPathDto[];
|
|
46
|
+
totalMinOut: string;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Full payload for the aggregator router's `batch_execute` entry point.
|
|
50
|
+
* Identical to `AggregatorSwapDto` plus an explicit `sender` (G or
|
|
51
|
+
* C strkey) whose SAC balance funds the swap (the router pulls
|
|
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.
|
|
58
|
+
*/
|
|
59
|
+
export declare class BatchSwapDto {
|
|
60
|
+
paths: SwapPathDto[];
|
|
61
|
+
sender: string;
|
|
62
|
+
totalIn: string;
|
|
63
|
+
totalMinOut: string;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Execution-plane filter for the quote server.
|
|
67
|
+
* - `aggregator` (default): Soroban venues only (Soroswap + Aquarius +
|
|
68
|
+
* Phoenix + static bridges). Produces a `batch_execute` envelope
|
|
69
|
+
* safe for composable contract-to-contract use (Lending → Router).
|
|
70
|
+
* - `sdex`: Stellar DEX (native AMM) only.
|
|
71
|
+
* - `all`: runs both planes and returns the winner with the runner-up
|
|
72
|
+
* attached as an alternative.
|
|
73
|
+
*/
|
|
74
|
+
export declare const STELLAR_QUOTE_PLATFORMS: readonly ["aggregator", "sdex", "all"];
|
|
75
|
+
export type StellarQuotePlatform = (typeof STELLAR_QUOTE_PLATFORMS)[number];
|
|
76
|
+
/**
|
|
77
|
+
* Token family resolved by the quote server\'s tokens endpoint.
|
|
78
|
+
* - `native`: Stellar native lumens (XLM).
|
|
79
|
+
* - `classic`: Stellar Classic asset (`CODE:GISSUER`).
|
|
80
|
+
* - `soroban`: Soroban asset contract (`C…`).
|
|
81
|
+
*/
|
|
82
|
+
export type StellarTokenKind = 'native' | 'classic' | 'soroban';
|
|
83
|
+
/**
|
|
84
|
+
* Query parameters for `GET /api/v1/quote` on the Stellar quote server.
|
|
85
|
+
*
|
|
86
|
+
* Exactly one of `amountIn` or `amountOut` must be provided. `router`
|
|
87
|
+
* + `sender` together populate `transaction.envelopeXdr` in the
|
|
88
|
+
* response with a ready-to-sign `batch_execute` envelope.
|
|
89
|
+
*/
|
|
90
|
+
export declare class StellarAggregatorQuoteRequestDto {
|
|
91
|
+
from: string;
|
|
92
|
+
to: string;
|
|
93
|
+
amountIn?: string;
|
|
94
|
+
amountOut?: string;
|
|
95
|
+
maxHops?: number;
|
|
96
|
+
maxSplits?: number;
|
|
97
|
+
slippage?: number;
|
|
98
|
+
includePaths?: boolean;
|
|
99
|
+
sender?: string;
|
|
100
|
+
router?: string;
|
|
101
|
+
platform?: StellarQuotePlatform;
|
|
102
|
+
fresh?: boolean;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Single hop entry on the quote response. The shape is wider than
|
|
106
|
+
* `SwapHopDto` because the server also returns metadata (`dex`, `kind`,
|
|
107
|
+
* `amountIn`/`amountOut` per hop, decimal-shifted display amounts) that
|
|
108
|
+
* the UI needs but the on-chain payload does not. The mapping
|
|
109
|
+
* quote-hop → contract-hop is:
|
|
110
|
+
*
|
|
111
|
+
* ```
|
|
112
|
+
* { feeBps, poolAddress → pool, from → tokenIn, to → tokenOut, dex → venue }
|
|
113
|
+
* ```
|
|
114
|
+
*/
|
|
115
|
+
export declare class StellarQuoteSwapHopDto {
|
|
116
|
+
dex: SwapVenue;
|
|
117
|
+
kind: string;
|
|
118
|
+
poolAddress: string;
|
|
119
|
+
feeBps: number;
|
|
120
|
+
from: string;
|
|
121
|
+
tokenInKind: StellarTokenKind;
|
|
122
|
+
to: string;
|
|
123
|
+
tokenOutKind: StellarTokenKind;
|
|
124
|
+
amountIn: string;
|
|
125
|
+
amountOut: string;
|
|
126
|
+
amountInShort: number;
|
|
127
|
+
amountOutShort: number;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Single allocated path in the quote response. Maps 1:1 to `SwapPathDto`
|
|
131
|
+
* (with field renames) when forwarded into the controller.
|
|
132
|
+
*/
|
|
133
|
+
export declare class StellarQuotePathDto {
|
|
134
|
+
amountIn: string;
|
|
135
|
+
amountOut: string;
|
|
136
|
+
amountInShort: number;
|
|
137
|
+
amountOutShort: number;
|
|
138
|
+
splitPpm: number;
|
|
139
|
+
swaps: StellarQuoteSwapHopDto[];
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Unsigned Soroban transaction envelope returned when the quote
|
|
143
|
+
* request supplied both `sender` and `router`. The caller MUST:
|
|
144
|
+
* 1. Populate `seqNum` from the sender\'s account state.
|
|
145
|
+
* 2. Run `simulateTransaction` to attach Soroban resource fees.
|
|
146
|
+
* 3. Sign with the sender\'s key (Ed25519 / Stellar Wallets Kit).
|
|
147
|
+
* 4. Submit via `sendTransaction`.
|
|
148
|
+
*/
|
|
149
|
+
export declare class StellarQuoteTransactionPayloadDto {
|
|
150
|
+
envelopeXdr: string;
|
|
151
|
+
sourceAccount: string;
|
|
152
|
+
routerContract: string;
|
|
153
|
+
baseFee: number;
|
|
154
|
+
networkPassphrase: string;
|
|
155
|
+
notes: string;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Side-by-side comparison entry attached when `platform=all` is
|
|
159
|
+
* requested. Always a different `platform` value than the parent
|
|
160
|
+
* response; nesting is one level deep by construction.
|
|
161
|
+
*/
|
|
162
|
+
export declare class StellarQuoteAlternativeDto {
|
|
163
|
+
platform: StellarQuotePlatform;
|
|
164
|
+
quote: StellarAggregatorQuoteResponseDto;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Response DTO for `GET /api/v1/quote` on the Stellar quote server.
|
|
168
|
+
* Mirrors the Rust `QuoteResponse` in
|
|
169
|
+
* `arb-algo/stellar-indexer/src/quote/types.rs` exactly.
|
|
170
|
+
*/
|
|
171
|
+
export declare class StellarAggregatorQuoteResponseDto {
|
|
172
|
+
mode: 'forward' | 'reverse';
|
|
173
|
+
from: string;
|
|
174
|
+
tokenInKind: StellarTokenKind;
|
|
175
|
+
to: string;
|
|
176
|
+
tokenOutKind: StellarTokenKind;
|
|
177
|
+
amountIn: string;
|
|
178
|
+
amountOut: string;
|
|
179
|
+
amountInShort: number;
|
|
180
|
+
amountOutShort: number;
|
|
181
|
+
amountOutMin?: string;
|
|
182
|
+
amountOutMinShort?: number;
|
|
183
|
+
slippage?: number;
|
|
184
|
+
priceImpact?: number;
|
|
185
|
+
rate: number;
|
|
186
|
+
rateInverse: number;
|
|
187
|
+
decimalsIn: number;
|
|
188
|
+
decimalsOut: number;
|
|
189
|
+
hops: StellarQuoteSwapHopDto[];
|
|
190
|
+
paths?: StellarQuotePathDto[];
|
|
191
|
+
transaction?: StellarQuoteTransactionPayloadDto;
|
|
192
|
+
platform: StellarQuotePlatform;
|
|
193
|
+
alternatives?: StellarQuoteAlternativeDto[];
|
|
194
|
+
}
|
|
@@ -0,0 +1,698 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
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;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const class_transformer_1 = require("class-transformer");
|
|
15
|
+
const class_validator_1 = require("class-validator");
|
|
16
|
+
/**
|
|
17
|
+
* On-chain venue tag for a single hop. Matches the Soroban
|
|
18
|
+
* `SwapVenue` enum in `stellar-router-contract/src/types.rs` and
|
|
19
|
+
* `rs-lending-xlm/common/src/types.rs`.
|
|
20
|
+
*/
|
|
21
|
+
exports.SWAP_VENUES = [
|
|
22
|
+
'Soroswap',
|
|
23
|
+
'Aquarius',
|
|
24
|
+
'Phoenix',
|
|
25
|
+
'NativeAmm',
|
|
26
|
+
'StaticBridge',
|
|
27
|
+
];
|
|
28
|
+
/**
|
|
29
|
+
* Single hop in an aggregator path. Field names use camelCase on the
|
|
30
|
+
* wire; the SDK encoder rewrites them to snake_case (`fee_bps`, `pool`,
|
|
31
|
+
* `token_in`, `token_out`, `venue`) when building the Soroban XDR so
|
|
32
|
+
* the bytes match the on-chain `SwapHop` struct exactly.
|
|
33
|
+
*/
|
|
34
|
+
class SwapHopDto {
|
|
35
|
+
}
|
|
36
|
+
exports.SwapHopDto = SwapHopDto;
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, swagger_1.ApiProperty)({
|
|
39
|
+
description: 'Pool fee in basis points (1 bps = 0.01%). Informational; the pool has authority over the fee actually applied.',
|
|
40
|
+
example: 30,
|
|
41
|
+
}),
|
|
42
|
+
(0, class_validator_1.IsInt)(),
|
|
43
|
+
(0, class_validator_1.Min)(0),
|
|
44
|
+
__metadata("design:type", Number)
|
|
45
|
+
], SwapHopDto.prototype, "feeBps", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, swagger_1.ApiProperty)({
|
|
48
|
+
description: 'Pool contract address (Soroswap/Aquarius/Phoenix), LP account (NativeAmm), or zero bytes (StaticBridge).',
|
|
49
|
+
example: 'CATK7WRKPAMZKSTNZJ5J6MT7Q7I3DLYEBIAB4CA6Z6SY6LAD2ASQOHNN',
|
|
50
|
+
}),
|
|
51
|
+
(0, class_validator_1.IsString)(),
|
|
52
|
+
__metadata("design:type", String)
|
|
53
|
+
], SwapHopDto.prototype, "pool", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, swagger_1.ApiProperty)({
|
|
56
|
+
description: 'Soroban Asset Contract address of the input token.',
|
|
57
|
+
example: 'CDLZFC3SYJYDZT7K67VZ75HPJVIEUVNIXF47ZG2FB2RMQQVU2HHGCYSC',
|
|
58
|
+
}),
|
|
59
|
+
(0, class_validator_1.IsString)(),
|
|
60
|
+
__metadata("design:type", String)
|
|
61
|
+
], SwapHopDto.prototype, "tokenIn", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, swagger_1.ApiProperty)({
|
|
64
|
+
description: 'Soroban Asset Contract address of the output token.',
|
|
65
|
+
example: 'CBIELTK6YBZJU5UP2WWQEUCYKLPU6AUNZ2BQ4WWFEIE3USCIHMXQDAMA',
|
|
66
|
+
}),
|
|
67
|
+
(0, class_validator_1.IsString)(),
|
|
68
|
+
__metadata("design:type", String)
|
|
69
|
+
], SwapHopDto.prototype, "tokenOut", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, swagger_1.ApiProperty)({
|
|
72
|
+
description: 'Which DEX/venue routes this hop.',
|
|
73
|
+
enum: exports.SWAP_VENUES,
|
|
74
|
+
example: 'Soroswap',
|
|
75
|
+
}),
|
|
76
|
+
(0, class_validator_1.IsIn)(exports.SWAP_VENUES),
|
|
77
|
+
__metadata("design:type", String)
|
|
78
|
+
], SwapHopDto.prototype, "venue", void 0);
|
|
79
|
+
/**
|
|
80
|
+
* One path in a (possibly multi-path) aggregator swap.
|
|
81
|
+
*
|
|
82
|
+
* `splitPpm` is parts-per-million of the batch's total input allocated
|
|
83
|
+
* to this path. The router computes `path_input = totalIn * splitPpm /
|
|
84
|
+
* 1_000_000`; the LAST path absorbs PPM rounding so the entire `totalIn`
|
|
85
|
+
* is consumed and no dust is left on the sender. Within a path, output
|
|
86
|
+
* of hop N feeds hop N+1 directly — there are no per-hop or per-path
|
|
87
|
+
* amount fields. The single `totalMinOut` guard at the batch level is
|
|
88
|
+
* the only slippage gate.
|
|
89
|
+
*/
|
|
90
|
+
class SwapPathDto {
|
|
91
|
+
}
|
|
92
|
+
exports.SwapPathDto = SwapPathDto;
|
|
93
|
+
__decorate([
|
|
94
|
+
(0, swagger_1.ApiProperty)({
|
|
95
|
+
description: 'Sequential hops executed within this path. Output of hop N flows directly into hop N+1.',
|
|
96
|
+
type: () => SwapHopDto,
|
|
97
|
+
isArray: true,
|
|
98
|
+
}),
|
|
99
|
+
(0, class_validator_1.IsArray)(),
|
|
100
|
+
(0, class_validator_1.ArrayMinSize)(1),
|
|
101
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
102
|
+
(0, class_transformer_1.Type)(() => SwapHopDto),
|
|
103
|
+
__metadata("design:type", Array)
|
|
104
|
+
], SwapPathDto.prototype, "hops", void 0);
|
|
105
|
+
__decorate([
|
|
106
|
+
(0, swagger_1.ApiProperty)({
|
|
107
|
+
description: 'Parts per million (ppm) of the batch total input to route through this path. Must be > 0; sum of all paths must equal 1_000_000.',
|
|
108
|
+
example: 1000000,
|
|
109
|
+
}),
|
|
110
|
+
(0, class_validator_1.IsInt)(),
|
|
111
|
+
(0, class_validator_1.Min)(1),
|
|
112
|
+
(0, class_validator_1.Max)(1000000),
|
|
113
|
+
__metadata("design:type", Number)
|
|
114
|
+
], SwapPathDto.prototype, "splitPpm", void 0);
|
|
115
|
+
/**
|
|
116
|
+
* User-facing aggregator swap request as accepted by the Soroban
|
|
117
|
+
* lending controller's strategy methods (`multiply`, `swap_debt`,
|
|
118
|
+
* `swap_collateral`, `repay_debt_with_collateral`). The controller
|
|
119
|
+
* wraps this in `BatchSwap` (filling `sender = current_contract_address`
|
|
120
|
+
* and `totalIn = actual_withdrawn`) before forwarding to the aggregator
|
|
121
|
+
* router.
|
|
122
|
+
*/
|
|
123
|
+
class AggregatorSwapDto {
|
|
124
|
+
}
|
|
125
|
+
exports.AggregatorSwapDto = AggregatorSwapDto;
|
|
126
|
+
__decorate([
|
|
127
|
+
(0, swagger_1.ApiProperty)({
|
|
128
|
+
description: 'Parallel paths to execute. Length >= 1.',
|
|
129
|
+
type: () => SwapPathDto,
|
|
130
|
+
isArray: true,
|
|
131
|
+
}),
|
|
132
|
+
(0, class_validator_1.IsArray)(),
|
|
133
|
+
(0, class_validator_1.ArrayMinSize)(1),
|
|
134
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
135
|
+
(0, class_transformer_1.Type)(() => SwapPathDto),
|
|
136
|
+
__metadata("design:type", Array)
|
|
137
|
+
], AggregatorSwapDto.prototype, "paths", void 0);
|
|
138
|
+
__decorate([
|
|
139
|
+
(0, swagger_1.ApiProperty)({
|
|
140
|
+
description: "Aggregate slippage guard across all paths' final output token (i128 decimal string). Must be > 0.",
|
|
141
|
+
example: '6679778663',
|
|
142
|
+
}),
|
|
143
|
+
(0, class_validator_1.IsString)(),
|
|
144
|
+
__metadata("design:type", String)
|
|
145
|
+
], AggregatorSwapDto.prototype, "totalMinOut", void 0);
|
|
146
|
+
/**
|
|
147
|
+
* Full payload for the aggregator router's `batch_execute` entry point.
|
|
148
|
+
* Identical to `AggregatorSwapDto` plus an explicit `sender` (G or
|
|
149
|
+
* C strkey) whose SAC balance funds the swap (the router pulls
|
|
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.
|
|
156
|
+
*/
|
|
157
|
+
class BatchSwapDto {
|
|
158
|
+
}
|
|
159
|
+
exports.BatchSwapDto = BatchSwapDto;
|
|
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);
|
|
168
|
+
__decorate([
|
|
169
|
+
(0, swagger_1.ApiProperty)({
|
|
170
|
+
description: 'Account whose SAC balances fund the swap and receive the output. G-strkey for user-direct swaps, C-strkey when called by another contract.',
|
|
171
|
+
example: 'GDBBOILYIJBSUQKC3Z3USAW3DGPFHIGVKYA5T4ZUZBO56HBUPHJEN3FV',
|
|
172
|
+
}),
|
|
173
|
+
(0, class_validator_1.IsString)(),
|
|
174
|
+
__metadata("design:type", String)
|
|
175
|
+
], BatchSwapDto.prototype, "sender", void 0);
|
|
176
|
+
__decorate([
|
|
177
|
+
(0, swagger_1.ApiProperty)({
|
|
178
|
+
description: "Total input amount the router will pull from `sender` once at the start of `batch_execute` (i128 decimal string). Per-path allocations come from the router's vault using each path's `splitPpm`.",
|
|
179
|
+
example: '1000000000',
|
|
180
|
+
}),
|
|
181
|
+
(0, class_validator_1.IsString)(),
|
|
182
|
+
__metadata("design:type", String)
|
|
183
|
+
], BatchSwapDto.prototype, "totalIn", void 0);
|
|
184
|
+
__decorate([
|
|
185
|
+
(0, swagger_1.ApiProperty)({
|
|
186
|
+
description: 'Aggregate slippage guard across all paths.',
|
|
187
|
+
example: '6679778663',
|
|
188
|
+
}),
|
|
189
|
+
(0, class_validator_1.IsString)(),
|
|
190
|
+
__metadata("design:type", String)
|
|
191
|
+
], BatchSwapDto.prototype, "totalMinOut", void 0);
|
|
192
|
+
/**
|
|
193
|
+
* Execution-plane filter for the quote server.
|
|
194
|
+
* - `aggregator` (default): Soroban venues only (Soroswap + Aquarius +
|
|
195
|
+
* Phoenix + static bridges). Produces a `batch_execute` envelope
|
|
196
|
+
* safe for composable contract-to-contract use (Lending → Router).
|
|
197
|
+
* - `sdex`: Stellar DEX (native AMM) only.
|
|
198
|
+
* - `all`: runs both planes and returns the winner with the runner-up
|
|
199
|
+
* attached as an alternative.
|
|
200
|
+
*/
|
|
201
|
+
exports.STELLAR_QUOTE_PLATFORMS = ['aggregator', 'sdex', 'all'];
|
|
202
|
+
/**
|
|
203
|
+
* Query parameters for `GET /api/v1/quote` on the Stellar quote server.
|
|
204
|
+
*
|
|
205
|
+
* Exactly one of `amountIn` or `amountOut` must be provided. `router`
|
|
206
|
+
* + `sender` together populate `transaction.envelopeXdr` in the
|
|
207
|
+
* response with a ready-to-sign `batch_execute` envelope.
|
|
208
|
+
*/
|
|
209
|
+
class StellarAggregatorQuoteRequestDto {
|
|
210
|
+
}
|
|
211
|
+
exports.StellarAggregatorQuoteRequestDto = StellarAggregatorQuoteRequestDto;
|
|
212
|
+
__decorate([
|
|
213
|
+
(0, swagger_1.ApiProperty)({
|
|
214
|
+
description: 'Input token. Accepts: `XLM`/`native`, `CODE` (first matching Classic), `CODE-SAC`, `XLM-SAC`, `CODE:GISSUER…`, or `C…` (56-char Soroban contract address).',
|
|
215
|
+
example: 'CDLZFC3SYJYDZT7K67VZ75HPJVIEUVNIXF47ZG2FB2RMQQVU2HHGCYSC',
|
|
216
|
+
}),
|
|
217
|
+
(0, class_validator_1.IsString)(),
|
|
218
|
+
__metadata("design:type", String)
|
|
219
|
+
], StellarAggregatorQuoteRequestDto.prototype, "from", void 0);
|
|
220
|
+
__decorate([
|
|
221
|
+
(0, swagger_1.ApiProperty)({
|
|
222
|
+
description: 'Output token (same accepted forms as `from`).',
|
|
223
|
+
example: 'CBIELTK6YBZJU5UP2WWQEUCYKLPU6AUNZ2BQ4WWFEIE3USCIHMXQDAMA',
|
|
224
|
+
}),
|
|
225
|
+
(0, class_validator_1.IsString)(),
|
|
226
|
+
__metadata("design:type", String)
|
|
227
|
+
], StellarAggregatorQuoteRequestDto.prototype, "to", void 0);
|
|
228
|
+
__decorate([
|
|
229
|
+
(0, swagger_1.ApiProperty)({
|
|
230
|
+
description: 'Forward mode: input amount in raw atomic units (i128 decimal string). Mutually exclusive with `amountOut`.',
|
|
231
|
+
required: false,
|
|
232
|
+
example: '1000000000',
|
|
233
|
+
}),
|
|
234
|
+
(0, class_validator_1.IsOptional)(),
|
|
235
|
+
(0, class_validator_1.IsString)(),
|
|
236
|
+
__metadata("design:type", String)
|
|
237
|
+
], StellarAggregatorQuoteRequestDto.prototype, "amountIn", void 0);
|
|
238
|
+
__decorate([
|
|
239
|
+
(0, swagger_1.ApiProperty)({
|
|
240
|
+
description: 'Reverse mode: target output in raw atomic units. Server computes the minimum input that delivers at least this output.',
|
|
241
|
+
required: false,
|
|
242
|
+
}),
|
|
243
|
+
(0, class_validator_1.IsOptional)(),
|
|
244
|
+
(0, class_validator_1.IsString)(),
|
|
245
|
+
__metadata("design:type", String)
|
|
246
|
+
], StellarAggregatorQuoteRequestDto.prototype, "amountOut", void 0);
|
|
247
|
+
__decorate([
|
|
248
|
+
(0, swagger_1.ApiProperty)({
|
|
249
|
+
description: "Maximum hops per path. Defaults to the server's built-in cap.",
|
|
250
|
+
required: false,
|
|
251
|
+
example: 4,
|
|
252
|
+
}),
|
|
253
|
+
(0, class_validator_1.IsOptional)(),
|
|
254
|
+
(0, class_validator_1.IsInt)(),
|
|
255
|
+
(0, class_validator_1.Min)(1),
|
|
256
|
+
__metadata("design:type", Number)
|
|
257
|
+
], StellarAggregatorQuoteRequestDto.prototype, "maxHops", void 0);
|
|
258
|
+
__decorate([
|
|
259
|
+
(0, swagger_1.ApiProperty)({
|
|
260
|
+
description: 'Maximum number of parallel paths the allocator may produce. Default 1 (no split).',
|
|
261
|
+
required: false,
|
|
262
|
+
example: 4,
|
|
263
|
+
}),
|
|
264
|
+
(0, class_validator_1.IsOptional)(),
|
|
265
|
+
(0, class_validator_1.IsInt)(),
|
|
266
|
+
(0, class_validator_1.Min)(1),
|
|
267
|
+
__metadata("design:type", Number)
|
|
268
|
+
], StellarAggregatorQuoteRequestDto.prototype, "maxSplits", void 0);
|
|
269
|
+
__decorate([
|
|
270
|
+
(0, swagger_1.ApiProperty)({
|
|
271
|
+
description: 'Slippage tolerance as a decimal (e.g. 0.01 = 1%). When set, the response populates `amountOutMin` at `amountOut * (1 - slippage)`.',
|
|
272
|
+
required: false,
|
|
273
|
+
example: 0.01,
|
|
274
|
+
}),
|
|
275
|
+
(0, class_validator_1.IsOptional)(),
|
|
276
|
+
(0, class_validator_1.IsNumber)(),
|
|
277
|
+
(0, class_validator_1.Min)(0),
|
|
278
|
+
(0, class_validator_1.Max)(1),
|
|
279
|
+
__metadata("design:type", Number)
|
|
280
|
+
], StellarAggregatorQuoteRequestDto.prototype, "slippage", void 0);
|
|
281
|
+
__decorate([
|
|
282
|
+
(0, swagger_1.ApiProperty)({
|
|
283
|
+
description: 'Force `paths[]` in the response even for single-path quotes. Mirrors MVX `includePaths=true` convention.',
|
|
284
|
+
required: false,
|
|
285
|
+
}),
|
|
286
|
+
(0, class_validator_1.IsOptional)(),
|
|
287
|
+
(0, class_validator_1.IsBoolean)(),
|
|
288
|
+
__metadata("design:type", Boolean)
|
|
289
|
+
], StellarAggregatorQuoteRequestDto.prototype, "includePaths", void 0);
|
|
290
|
+
__decorate([
|
|
291
|
+
(0, swagger_1.ApiProperty)({
|
|
292
|
+
description: 'Sender G-strkey. When combined with `router`, the response contains `transaction.envelopeXdr` (an unsigned envelope ready to sign + submit).',
|
|
293
|
+
required: false,
|
|
294
|
+
example: 'GDBBOILYIJBSUQKC3Z3USAW3DGPFHIGVKYA5T4ZUZBO56HBUPHJEN3FV',
|
|
295
|
+
}),
|
|
296
|
+
(0, class_validator_1.IsOptional)(),
|
|
297
|
+
(0, class_validator_1.IsString)(),
|
|
298
|
+
__metadata("design:type", String)
|
|
299
|
+
], StellarAggregatorQuoteRequestDto.prototype, "sender", void 0);
|
|
300
|
+
__decorate([
|
|
301
|
+
(0, swagger_1.ApiProperty)({
|
|
302
|
+
description: 'Aggregator router C-strkey for envelope construction.',
|
|
303
|
+
required: false,
|
|
304
|
+
example: 'CDH6RRN5P6KUAMMTR3TKSX36PZTHMOIG3M3WWEGU2G5GSSSEAYTRU4OK',
|
|
305
|
+
}),
|
|
306
|
+
(0, class_validator_1.IsOptional)(),
|
|
307
|
+
(0, class_validator_1.IsString)(),
|
|
308
|
+
__metadata("design:type", String)
|
|
309
|
+
], StellarAggregatorQuoteRequestDto.prototype, "router", void 0);
|
|
310
|
+
__decorate([
|
|
311
|
+
(0, swagger_1.ApiProperty)({
|
|
312
|
+
description: 'Execution-plane filter.',
|
|
313
|
+
enum: exports.STELLAR_QUOTE_PLATFORMS,
|
|
314
|
+
required: false,
|
|
315
|
+
example: 'aggregator',
|
|
316
|
+
}),
|
|
317
|
+
(0, class_validator_1.IsOptional)(),
|
|
318
|
+
(0, class_validator_1.IsIn)(exports.STELLAR_QUOTE_PLATFORMS),
|
|
319
|
+
__metadata("design:type", String)
|
|
320
|
+
], StellarAggregatorQuoteRequestDto.prototype, "platform", void 0);
|
|
321
|
+
__decorate([
|
|
322
|
+
(0, swagger_1.ApiProperty)({
|
|
323
|
+
description: 'Reject the quote with HTTP 409 if the indexer snapshot is more than one ledger behind the live network. Costs one extra RPC round-trip.',
|
|
324
|
+
required: false,
|
|
325
|
+
}),
|
|
326
|
+
(0, class_validator_1.IsOptional)(),
|
|
327
|
+
(0, class_validator_1.IsBoolean)(),
|
|
328
|
+
__metadata("design:type", Boolean)
|
|
329
|
+
], StellarAggregatorQuoteRequestDto.prototype, "fresh", void 0);
|
|
330
|
+
/**
|
|
331
|
+
* Single hop entry on the quote response. The shape is wider than
|
|
332
|
+
* `SwapHopDto` because the server also returns metadata (`dex`, `kind`,
|
|
333
|
+
* `amountIn`/`amountOut` per hop, decimal-shifted display amounts) that
|
|
334
|
+
* the UI needs but the on-chain payload does not. The mapping
|
|
335
|
+
* quote-hop → contract-hop is:
|
|
336
|
+
*
|
|
337
|
+
* ```
|
|
338
|
+
* { feeBps, poolAddress → pool, from → tokenIn, to → tokenOut, dex → venue }
|
|
339
|
+
* ```
|
|
340
|
+
*/
|
|
341
|
+
class StellarQuoteSwapHopDto {
|
|
342
|
+
}
|
|
343
|
+
exports.StellarQuoteSwapHopDto = StellarQuoteSwapHopDto;
|
|
344
|
+
__decorate([
|
|
345
|
+
(0, swagger_1.ApiProperty)({
|
|
346
|
+
description: 'Venue label. One of the `SwapVenue` variants.',
|
|
347
|
+
enum: exports.SWAP_VENUES,
|
|
348
|
+
example: 'Soroswap',
|
|
349
|
+
}),
|
|
350
|
+
(0, class_validator_1.IsIn)(exports.SWAP_VENUES),
|
|
351
|
+
__metadata("design:type", String)
|
|
352
|
+
], StellarQuoteSwapHopDto.prototype, "dex", void 0);
|
|
353
|
+
__decorate([
|
|
354
|
+
(0, swagger_1.ApiProperty)({
|
|
355
|
+
description: 'Pool shape: `ConstantProduct` | `Stable` | `Static`.',
|
|
356
|
+
example: 'ConstantProduct',
|
|
357
|
+
}),
|
|
358
|
+
(0, class_validator_1.IsString)(),
|
|
359
|
+
__metadata("design:type", String)
|
|
360
|
+
], StellarQuoteSwapHopDto.prototype, "kind", void 0);
|
|
361
|
+
__decorate([
|
|
362
|
+
(0, swagger_1.ApiProperty)({
|
|
363
|
+
description: 'Canonical pool identifier. C-strkey for Soroban pools, L-strkey for native AMM pools.',
|
|
364
|
+
}),
|
|
365
|
+
(0, class_validator_1.IsString)(),
|
|
366
|
+
__metadata("design:type", String)
|
|
367
|
+
], StellarQuoteSwapHopDto.prototype, "poolAddress", void 0);
|
|
368
|
+
__decorate([
|
|
369
|
+
(0, swagger_1.ApiProperty)({ description: 'Pool fee in basis points.', example: 30 }),
|
|
370
|
+
(0, class_validator_1.IsInt)(),
|
|
371
|
+
(0, class_validator_1.Min)(0),
|
|
372
|
+
__metadata("design:type", Number)
|
|
373
|
+
], StellarQuoteSwapHopDto.prototype, "feeBps", void 0);
|
|
374
|
+
__decorate([
|
|
375
|
+
(0, swagger_1.ApiProperty)({ description: 'Input token canonical id.' }),
|
|
376
|
+
(0, class_validator_1.IsString)(),
|
|
377
|
+
__metadata("design:type", String)
|
|
378
|
+
], StellarQuoteSwapHopDto.prototype, "from", void 0);
|
|
379
|
+
__decorate([
|
|
380
|
+
(0, swagger_1.ApiProperty)({
|
|
381
|
+
description: 'Token family of the input token.',
|
|
382
|
+
enum: ['native', 'classic', 'soroban'],
|
|
383
|
+
}),
|
|
384
|
+
(0, class_validator_1.IsIn)(['native', 'classic', 'soroban']),
|
|
385
|
+
__metadata("design:type", String)
|
|
386
|
+
], StellarQuoteSwapHopDto.prototype, "tokenInKind", void 0);
|
|
387
|
+
__decorate([
|
|
388
|
+
(0, swagger_1.ApiProperty)({ description: 'Output token canonical id.' }),
|
|
389
|
+
(0, class_validator_1.IsString)(),
|
|
390
|
+
__metadata("design:type", String)
|
|
391
|
+
], StellarQuoteSwapHopDto.prototype, "to", void 0);
|
|
392
|
+
__decorate([
|
|
393
|
+
(0, swagger_1.ApiProperty)({
|
|
394
|
+
description: 'Token family of the output token.',
|
|
395
|
+
enum: ['native', 'classic', 'soroban'],
|
|
396
|
+
}),
|
|
397
|
+
(0, class_validator_1.IsIn)(['native', 'classic', 'soroban']),
|
|
398
|
+
__metadata("design:type", String)
|
|
399
|
+
], StellarQuoteSwapHopDto.prototype, "tokenOutKind", void 0);
|
|
400
|
+
__decorate([
|
|
401
|
+
(0, swagger_1.ApiProperty)({ description: 'Input amount on this hop (i128 string).' }),
|
|
402
|
+
(0, class_validator_1.IsString)(),
|
|
403
|
+
__metadata("design:type", String)
|
|
404
|
+
], StellarQuoteSwapHopDto.prototype, "amountIn", void 0);
|
|
405
|
+
__decorate([
|
|
406
|
+
(0, swagger_1.ApiProperty)({ description: 'Output amount on this hop (i128 string).' }),
|
|
407
|
+
(0, class_validator_1.IsString)(),
|
|
408
|
+
__metadata("design:type", String)
|
|
409
|
+
], StellarQuoteSwapHopDto.prototype, "amountOut", void 0);
|
|
410
|
+
__decorate([
|
|
411
|
+
(0, swagger_1.ApiProperty)({
|
|
412
|
+
description: 'Display input amount (decimals applied; loses precision above 2^53).',
|
|
413
|
+
}),
|
|
414
|
+
(0, class_validator_1.IsNumber)(),
|
|
415
|
+
__metadata("design:type", Number)
|
|
416
|
+
], StellarQuoteSwapHopDto.prototype, "amountInShort", void 0);
|
|
417
|
+
__decorate([
|
|
418
|
+
(0, swagger_1.ApiProperty)({ description: 'Display output amount.' }),
|
|
419
|
+
(0, class_validator_1.IsNumber)(),
|
|
420
|
+
__metadata("design:type", Number)
|
|
421
|
+
], StellarQuoteSwapHopDto.prototype, "amountOutShort", void 0);
|
|
422
|
+
/**
|
|
423
|
+
* Single allocated path in the quote response. Maps 1:1 to `SwapPathDto`
|
|
424
|
+
* (with field renames) when forwarded into the controller.
|
|
425
|
+
*/
|
|
426
|
+
class StellarQuotePathDto {
|
|
427
|
+
}
|
|
428
|
+
exports.StellarQuotePathDto = StellarQuotePathDto;
|
|
429
|
+
__decorate([
|
|
430
|
+
(0, swagger_1.ApiProperty)({ description: 'Input amount routed through this path.' }),
|
|
431
|
+
(0, class_validator_1.IsString)(),
|
|
432
|
+
__metadata("design:type", String)
|
|
433
|
+
], StellarQuotePathDto.prototype, "amountIn", void 0);
|
|
434
|
+
__decorate([
|
|
435
|
+
(0, swagger_1.ApiProperty)({ description: 'Output amount produced by this path.' }),
|
|
436
|
+
(0, class_validator_1.IsString)(),
|
|
437
|
+
__metadata("design:type", String)
|
|
438
|
+
], StellarQuotePathDto.prototype, "amountOut", void 0);
|
|
439
|
+
__decorate([
|
|
440
|
+
(0, swagger_1.ApiProperty)({ description: 'Display input amount.' }),
|
|
441
|
+
(0, class_validator_1.IsNumber)(),
|
|
442
|
+
__metadata("design:type", Number)
|
|
443
|
+
], StellarQuotePathDto.prototype, "amountInShort", void 0);
|
|
444
|
+
__decorate([
|
|
445
|
+
(0, swagger_1.ApiProperty)({ description: 'Display output amount.' }),
|
|
446
|
+
(0, class_validator_1.IsNumber)(),
|
|
447
|
+
__metadata("design:type", Number)
|
|
448
|
+
], StellarQuotePathDto.prototype, "amountOutShort", void 0);
|
|
449
|
+
__decorate([
|
|
450
|
+
(0, swagger_1.ApiProperty)({
|
|
451
|
+
description: 'Parts-per-million of total input routed through this path. 1_000_000 = 100%.',
|
|
452
|
+
example: 1000000,
|
|
453
|
+
}),
|
|
454
|
+
(0, class_validator_1.IsInt)(),
|
|
455
|
+
(0, class_validator_1.Min)(0),
|
|
456
|
+
__metadata("design:type", Number)
|
|
457
|
+
], StellarQuotePathDto.prototype, "splitPpm", void 0);
|
|
458
|
+
__decorate([
|
|
459
|
+
(0, swagger_1.ApiProperty)({ type: () => StellarQuoteSwapHopDto, isArray: true }),
|
|
460
|
+
(0, class_validator_1.IsArray)(),
|
|
461
|
+
(0, class_validator_1.ArrayMinSize)(1),
|
|
462
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
463
|
+
(0, class_transformer_1.Type)(() => StellarQuoteSwapHopDto),
|
|
464
|
+
__metadata("design:type", Array)
|
|
465
|
+
], StellarQuotePathDto.prototype, "swaps", void 0);
|
|
466
|
+
/**
|
|
467
|
+
* Unsigned Soroban transaction envelope returned when the quote
|
|
468
|
+
* request supplied both `sender` and `router`. The caller MUST:
|
|
469
|
+
* 1. Populate `seqNum` from the sender\'s account state.
|
|
470
|
+
* 2. Run `simulateTransaction` to attach Soroban resource fees.
|
|
471
|
+
* 3. Sign with the sender\'s key (Ed25519 / Stellar Wallets Kit).
|
|
472
|
+
* 4. Submit via `sendTransaction`.
|
|
473
|
+
*/
|
|
474
|
+
class StellarQuoteTransactionPayloadDto {
|
|
475
|
+
}
|
|
476
|
+
exports.StellarQuoteTransactionPayloadDto = StellarQuoteTransactionPayloadDto;
|
|
477
|
+
__decorate([
|
|
478
|
+
(0, swagger_1.ApiProperty)({ description: 'Base64 XDR of the unsigned envelope.' }),
|
|
479
|
+
(0, class_validator_1.IsString)(),
|
|
480
|
+
__metadata("design:type", String)
|
|
481
|
+
], StellarQuoteTransactionPayloadDto.prototype, "envelopeXdr", void 0);
|
|
482
|
+
__decorate([
|
|
483
|
+
(0, swagger_1.ApiProperty)({ description: 'Sender G-strkey (echo of request).' }),
|
|
484
|
+
(0, class_validator_1.IsString)(),
|
|
485
|
+
__metadata("design:type", String)
|
|
486
|
+
], StellarQuoteTransactionPayloadDto.prototype, "sourceAccount", void 0);
|
|
487
|
+
__decorate([
|
|
488
|
+
(0, swagger_1.ApiProperty)({ description: 'Router contract C-strkey (echo of request).' }),
|
|
489
|
+
(0, class_validator_1.IsString)(),
|
|
490
|
+
__metadata("design:type", String)
|
|
491
|
+
], StellarQuoteTransactionPayloadDto.prototype, "routerContract", void 0);
|
|
492
|
+
__decorate([
|
|
493
|
+
(0, swagger_1.ApiProperty)({
|
|
494
|
+
description: 'Placeholder base fee in stroops; caller adjusts post-simulation.',
|
|
495
|
+
}),
|
|
496
|
+
(0, class_validator_1.IsInt)(),
|
|
497
|
+
(0, class_validator_1.Min)(0),
|
|
498
|
+
__metadata("design:type", Number)
|
|
499
|
+
], StellarQuoteTransactionPayloadDto.prototype, "baseFee", void 0);
|
|
500
|
+
__decorate([
|
|
501
|
+
(0, swagger_1.ApiProperty)({ description: 'Network passphrase the envelope is tied to.' }),
|
|
502
|
+
(0, class_validator_1.IsString)(),
|
|
503
|
+
__metadata("design:type", String)
|
|
504
|
+
], StellarQuoteTransactionPayloadDto.prototype, "networkPassphrase", void 0);
|
|
505
|
+
__decorate([
|
|
506
|
+
(0, swagger_1.ApiProperty)({ description: 'Human-readable pre-signing checklist.' }),
|
|
507
|
+
(0, class_validator_1.IsString)(),
|
|
508
|
+
__metadata("design:type", String)
|
|
509
|
+
], StellarQuoteTransactionPayloadDto.prototype, "notes", void 0);
|
|
510
|
+
/**
|
|
511
|
+
* Side-by-side comparison entry attached when `platform=all` is
|
|
512
|
+
* requested. Always a different `platform` value than the parent
|
|
513
|
+
* response; nesting is one level deep by construction.
|
|
514
|
+
*/
|
|
515
|
+
class StellarQuoteAlternativeDto {
|
|
516
|
+
}
|
|
517
|
+
exports.StellarQuoteAlternativeDto = StellarQuoteAlternativeDto;
|
|
518
|
+
__decorate([
|
|
519
|
+
(0, swagger_1.ApiProperty)({
|
|
520
|
+
description: 'Platform that produced this alternative.',
|
|
521
|
+
enum: exports.STELLAR_QUOTE_PLATFORMS,
|
|
522
|
+
}),
|
|
523
|
+
(0, class_validator_1.IsIn)(exports.STELLAR_QUOTE_PLATFORMS),
|
|
524
|
+
__metadata("design:type", String)
|
|
525
|
+
], StellarQuoteAlternativeDto.prototype, "platform", void 0);
|
|
526
|
+
__decorate([
|
|
527
|
+
(0, swagger_1.ApiProperty)({
|
|
528
|
+
description: 'Full alternative quote. Its own `alternatives` field is always omitted.',
|
|
529
|
+
type: () => StellarAggregatorQuoteResponseDto,
|
|
530
|
+
}),
|
|
531
|
+
(0, class_validator_1.ValidateNested)(),
|
|
532
|
+
(0, class_transformer_1.Type)(() => StellarAggregatorQuoteResponseDto),
|
|
533
|
+
__metadata("design:type", StellarAggregatorQuoteResponseDto)
|
|
534
|
+
], StellarQuoteAlternativeDto.prototype, "quote", void 0);
|
|
535
|
+
/**
|
|
536
|
+
* Response DTO for `GET /api/v1/quote` on the Stellar quote server.
|
|
537
|
+
* Mirrors the Rust `QuoteResponse` in
|
|
538
|
+
* `arb-algo/stellar-indexer/src/quote/types.rs` exactly.
|
|
539
|
+
*/
|
|
540
|
+
class StellarAggregatorQuoteResponseDto {
|
|
541
|
+
}
|
|
542
|
+
exports.StellarAggregatorQuoteResponseDto = StellarAggregatorQuoteResponseDto;
|
|
543
|
+
__decorate([
|
|
544
|
+
(0, swagger_1.ApiProperty)({ enum: ['forward', 'reverse'] }),
|
|
545
|
+
(0, class_validator_1.IsIn)(['forward', 'reverse']),
|
|
546
|
+
__metadata("design:type", String)
|
|
547
|
+
], StellarAggregatorQuoteResponseDto.prototype, "mode", void 0);
|
|
548
|
+
__decorate([
|
|
549
|
+
(0, swagger_1.ApiProperty)({ description: 'Input token canonical id.' }),
|
|
550
|
+
(0, class_validator_1.IsString)(),
|
|
551
|
+
__metadata("design:type", String)
|
|
552
|
+
], StellarAggregatorQuoteResponseDto.prototype, "from", void 0);
|
|
553
|
+
__decorate([
|
|
554
|
+
(0, swagger_1.ApiProperty)({ enum: ['native', 'classic', 'soroban'] }),
|
|
555
|
+
(0, class_validator_1.IsIn)(['native', 'classic', 'soroban']),
|
|
556
|
+
__metadata("design:type", String)
|
|
557
|
+
], StellarAggregatorQuoteResponseDto.prototype, "tokenInKind", void 0);
|
|
558
|
+
__decorate([
|
|
559
|
+
(0, swagger_1.ApiProperty)({ description: 'Output token canonical id.' }),
|
|
560
|
+
(0, class_validator_1.IsString)(),
|
|
561
|
+
__metadata("design:type", String)
|
|
562
|
+
], StellarAggregatorQuoteResponseDto.prototype, "to", void 0);
|
|
563
|
+
__decorate([
|
|
564
|
+
(0, swagger_1.ApiProperty)({ enum: ['native', 'classic', 'soroban'] }),
|
|
565
|
+
(0, class_validator_1.IsIn)(['native', 'classic', 'soroban']),
|
|
566
|
+
__metadata("design:type", String)
|
|
567
|
+
], StellarAggregatorQuoteResponseDto.prototype, "tokenOutKind", void 0);
|
|
568
|
+
__decorate([
|
|
569
|
+
(0, swagger_1.ApiProperty)({ description: 'Input amount (i128 string).' }),
|
|
570
|
+
(0, class_validator_1.IsString)(),
|
|
571
|
+
__metadata("design:type", String)
|
|
572
|
+
], StellarAggregatorQuoteResponseDto.prototype, "amountIn", void 0);
|
|
573
|
+
__decorate([
|
|
574
|
+
(0, swagger_1.ApiProperty)({ description: 'Output amount (i128 string).' }),
|
|
575
|
+
(0, class_validator_1.IsString)(),
|
|
576
|
+
__metadata("design:type", String)
|
|
577
|
+
], StellarAggregatorQuoteResponseDto.prototype, "amountOut", void 0);
|
|
578
|
+
__decorate([
|
|
579
|
+
(0, swagger_1.ApiProperty)({ description: 'Display input amount.' }),
|
|
580
|
+
(0, class_validator_1.IsNumber)(),
|
|
581
|
+
__metadata("design:type", Number)
|
|
582
|
+
], StellarAggregatorQuoteResponseDto.prototype, "amountInShort", void 0);
|
|
583
|
+
__decorate([
|
|
584
|
+
(0, swagger_1.ApiProperty)({ description: 'Display output amount.' }),
|
|
585
|
+
(0, class_validator_1.IsNumber)(),
|
|
586
|
+
__metadata("design:type", Number)
|
|
587
|
+
], StellarAggregatorQuoteResponseDto.prototype, "amountOutShort", void 0);
|
|
588
|
+
__decorate([
|
|
589
|
+
(0, swagger_1.ApiProperty)({
|
|
590
|
+
description: 'Minimum output after slippage (i128 string).',
|
|
591
|
+
required: false,
|
|
592
|
+
}),
|
|
593
|
+
(0, class_validator_1.IsOptional)(),
|
|
594
|
+
(0, class_validator_1.IsString)(),
|
|
595
|
+
__metadata("design:type", String)
|
|
596
|
+
], StellarAggregatorQuoteResponseDto.prototype, "amountOutMin", void 0);
|
|
597
|
+
__decorate([
|
|
598
|
+
(0, swagger_1.ApiProperty)({ description: 'Display min-out.', required: false }),
|
|
599
|
+
(0, class_validator_1.IsOptional)(),
|
|
600
|
+
(0, class_validator_1.IsNumber)(),
|
|
601
|
+
__metadata("design:type", Number)
|
|
602
|
+
], StellarAggregatorQuoteResponseDto.prototype, "amountOutMinShort", void 0);
|
|
603
|
+
__decorate([
|
|
604
|
+
(0, swagger_1.ApiProperty)({
|
|
605
|
+
description: 'Slippage tolerance echoed from the request.',
|
|
606
|
+
required: false,
|
|
607
|
+
}),
|
|
608
|
+
(0, class_validator_1.IsOptional)(),
|
|
609
|
+
(0, class_validator_1.IsNumber)(),
|
|
610
|
+
__metadata("design:type", Number)
|
|
611
|
+
], StellarAggregatorQuoteResponseDto.prototype, "slippage", void 0);
|
|
612
|
+
__decorate([
|
|
613
|
+
(0, swagger_1.ApiProperty)({
|
|
614
|
+
description: 'Price impact as a decimal: `1 - executed_rate / spot_rate`. Absent when spot rate cannot be determined.',
|
|
615
|
+
required: false,
|
|
616
|
+
}),
|
|
617
|
+
(0, class_validator_1.IsOptional)(),
|
|
618
|
+
(0, class_validator_1.IsNumber)(),
|
|
619
|
+
__metadata("design:type", Number)
|
|
620
|
+
], StellarAggregatorQuoteResponseDto.prototype, "priceImpact", void 0);
|
|
621
|
+
__decorate([
|
|
622
|
+
(0, swagger_1.ApiProperty)({ description: 'Output per 1 unit of input.' }),
|
|
623
|
+
(0, class_validator_1.IsNumber)(),
|
|
624
|
+
__metadata("design:type", Number)
|
|
625
|
+
], StellarAggregatorQuoteResponseDto.prototype, "rate", void 0);
|
|
626
|
+
__decorate([
|
|
627
|
+
(0, swagger_1.ApiProperty)({ description: 'Input per 1 unit of output.' }),
|
|
628
|
+
(0, class_validator_1.IsNumber)(),
|
|
629
|
+
__metadata("design:type", Number)
|
|
630
|
+
], StellarAggregatorQuoteResponseDto.prototype, "rateInverse", void 0);
|
|
631
|
+
__decorate([
|
|
632
|
+
(0, swagger_1.ApiProperty)({ description: 'Decimals of the input token.', example: 7 }),
|
|
633
|
+
(0, class_validator_1.IsInt)(),
|
|
634
|
+
(0, class_validator_1.Min)(0),
|
|
635
|
+
__metadata("design:type", Number)
|
|
636
|
+
], StellarAggregatorQuoteResponseDto.prototype, "decimalsIn", void 0);
|
|
637
|
+
__decorate([
|
|
638
|
+
(0, swagger_1.ApiProperty)({ description: 'Decimals of the output token.', example: 7 }),
|
|
639
|
+
(0, class_validator_1.IsInt)(),
|
|
640
|
+
(0, class_validator_1.Min)(0),
|
|
641
|
+
__metadata("design:type", Number)
|
|
642
|
+
], StellarAggregatorQuoteResponseDto.prototype, "decimalsOut", void 0);
|
|
643
|
+
__decorate([
|
|
644
|
+
(0, swagger_1.ApiProperty)({
|
|
645
|
+
description: 'Flat hop list (concatenation of all paths when split). Useful for compact UI display.',
|
|
646
|
+
type: () => StellarQuoteSwapHopDto,
|
|
647
|
+
isArray: true,
|
|
648
|
+
}),
|
|
649
|
+
(0, class_validator_1.IsArray)(),
|
|
650
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
651
|
+
(0, class_transformer_1.Type)(() => StellarQuoteSwapHopDto),
|
|
652
|
+
__metadata("design:type", Array)
|
|
653
|
+
], StellarAggregatorQuoteResponseDto.prototype, "hops", void 0);
|
|
654
|
+
__decorate([
|
|
655
|
+
(0, swagger_1.ApiProperty)({
|
|
656
|
+
description: 'Per-path breakdown. Populated when the allocator produced more than one path OR when `includePaths=true` was passed.',
|
|
657
|
+
required: false,
|
|
658
|
+
type: () => StellarQuotePathDto,
|
|
659
|
+
isArray: true,
|
|
660
|
+
}),
|
|
661
|
+
(0, class_validator_1.IsOptional)(),
|
|
662
|
+
(0, class_validator_1.IsArray)(),
|
|
663
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
664
|
+
(0, class_transformer_1.Type)(() => StellarQuotePathDto),
|
|
665
|
+
__metadata("design:type", Array)
|
|
666
|
+
], StellarAggregatorQuoteResponseDto.prototype, "paths", void 0);
|
|
667
|
+
__decorate([
|
|
668
|
+
(0, swagger_1.ApiProperty)({
|
|
669
|
+
description: 'Unsigned envelope ready to sign + submit. Populated when both `sender` and `router` query params were provided.',
|
|
670
|
+
required: false,
|
|
671
|
+
type: () => StellarQuoteTransactionPayloadDto,
|
|
672
|
+
}),
|
|
673
|
+
(0, class_validator_1.IsOptional)(),
|
|
674
|
+
(0, class_validator_1.ValidateNested)(),
|
|
675
|
+
(0, class_transformer_1.Type)(() => StellarQuoteTransactionPayloadDto),
|
|
676
|
+
__metadata("design:type", StellarQuoteTransactionPayloadDto)
|
|
677
|
+
], StellarAggregatorQuoteResponseDto.prototype, "transaction", void 0);
|
|
678
|
+
__decorate([
|
|
679
|
+
(0, swagger_1.ApiProperty)({
|
|
680
|
+
description: 'Execution plane that produced this quote.',
|
|
681
|
+
enum: exports.STELLAR_QUOTE_PLATFORMS,
|
|
682
|
+
}),
|
|
683
|
+
(0, class_validator_1.IsIn)(exports.STELLAR_QUOTE_PLATFORMS),
|
|
684
|
+
__metadata("design:type", String)
|
|
685
|
+
], StellarAggregatorQuoteResponseDto.prototype, "platform", void 0);
|
|
686
|
+
__decorate([
|
|
687
|
+
(0, swagger_1.ApiProperty)({
|
|
688
|
+
description: 'Side-by-side comparison. Populated only when `platform=all` was requested AND a non-winning platform produced a quote.',
|
|
689
|
+
required: false,
|
|
690
|
+
type: () => StellarQuoteAlternativeDto,
|
|
691
|
+
isArray: true,
|
|
692
|
+
}),
|
|
693
|
+
(0, class_validator_1.IsOptional)(),
|
|
694
|
+
(0, class_validator_1.IsArray)(),
|
|
695
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
696
|
+
(0, class_transformer_1.Type)(() => StellarQuoteAlternativeDto),
|
|
697
|
+
__metadata("design:type", Array)
|
|
698
|
+
], StellarAggregatorQuoteResponseDto.prototype, "alternatives", void 0);
|