@xoxno/types 1.0.392 → 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.
@@ -19,41 +19,47 @@ export declare class SwapHopDto {
19
19
  venue: SwapVenue;
20
20
  }
21
21
  /**
22
- * One allocated path in a (possibly multi-path) aggregator swap.
22
+ * One path in a (possibly multi-path) aggregator swap.
23
23
  *
24
- * `amountIn` is the slice of the user's total input routed through this
25
- * path. `minAmountOut` is the per-path slippage guard on the last hop's
26
- * output token it lets the contract reject one branch being executed
27
- * at a worse rate even if the aggregate `totalMinOut` is still satisfied.
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.
28
31
  */
29
32
  export declare class SwapPathDto {
30
- amountIn: string;
31
33
  hops: SwapHopDto[];
32
- minAmountOut: string;
34
+ splitPpm: number;
33
35
  }
34
36
  /**
35
37
  * User-facing aggregator swap request as accepted by the Soroban
36
38
  * lending controller's strategy methods (`multiply`, `swap_debt`,
37
39
  * `swap_collateral`, `repay_debt_with_collateral`). The controller
38
- * wraps this in `BatchSwap` (filling `sender = current_contract_address`)
39
- * before forwarding to the aggregator router.
40
+ * wraps this in `BatchSwap` (filling `sender = current_contract_address`
41
+ * and `totalIn = actual_withdrawn`) before forwarding to the aggregator
42
+ * router.
40
43
  */
41
44
  export declare class AggregatorSwapDto {
42
45
  paths: SwapPathDto[];
43
46
  totalMinOut: string;
44
47
  }
45
48
  /**
46
- * Full payload for the aggregator router\'s `batch_execute` entry point.
49
+ * Full payload for the aggregator router's `batch_execute` entry point.
47
50
  * Identical to `AggregatorSwapDto` plus an explicit `sender` (G or
48
- * C strkey) whose SAC balances fund the swap and receive the output.
51
+ * C strkey) whose SAC balance funds the swap (the router pulls
52
+ * `totalIn` once at the start) and receives the output.
49
53
  *
50
54
  * Lending callers never construct `BatchSwap` directly — the controller
51
- * fills `sender` with `current_contract_address` so user funds remain
52
- * under the controller\'s custody for the duration of the strategy.
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.
53
58
  */
54
59
  export declare class BatchSwapDto {
55
60
  paths: SwapPathDto[];
56
61
  sender: string;
62
+ totalIn: string;
57
63
  totalMinOut: string;
58
64
  }
59
65
  /**
@@ -77,27 +77,22 @@ __decorate([
77
77
  __metadata("design:type", String)
78
78
  ], SwapHopDto.prototype, "venue", void 0);
79
79
  /**
80
- * One allocated path in a (possibly multi-path) aggregator swap.
80
+ * One path in a (possibly multi-path) aggregator swap.
81
81
  *
82
- * `amountIn` is the slice of the user's total input routed through this
83
- * path. `minAmountOut` is the per-path slippage guard on the last hop's
84
- * output token it lets the contract reject one branch being executed
85
- * at a worse rate even if the aggregate `totalMinOut` is still satisfied.
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.
86
89
  */
87
90
  class SwapPathDto {
88
91
  }
89
92
  exports.SwapPathDto = SwapPathDto;
90
93
  __decorate([
91
94
  (0, swagger_1.ApiProperty)({
92
- description: 'Input amount for this path as an i128 decimal string.',
93
- example: '1000000000',
94
- }),
95
- (0, class_validator_1.IsString)(),
96
- __metadata("design:type", String)
97
- ], SwapPathDto.prototype, "amountIn", void 0);
98
- __decorate([
99
- (0, swagger_1.ApiProperty)({
100
- description: 'Sequential hops executed within this path.',
95
+ description: 'Sequential hops executed within this path. Output of hop N flows directly into hop N+1.',
101
96
  type: () => SwapHopDto,
102
97
  isArray: true,
103
98
  }),
@@ -109,18 +104,21 @@ __decorate([
109
104
  ], SwapPathDto.prototype, "hops", void 0);
110
105
  __decorate([
111
106
  (0, swagger_1.ApiProperty)({
112
- description: "Minimum acceptable output for THIS path on the final hop's output token (i128 decimal string). Enforced per-path on-chain.",
113
- example: '6679778663',
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,
114
109
  }),
115
- (0, class_validator_1.IsString)(),
116
- __metadata("design:type", String)
117
- ], SwapPathDto.prototype, "minAmountOut", void 0);
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);
118
115
  /**
119
116
  * User-facing aggregator swap request as accepted by the Soroban
120
117
  * lending controller's strategy methods (`multiply`, `swap_debt`,
121
118
  * `swap_collateral`, `repay_debt_with_collateral`). The controller
122
- * wraps this in `BatchSwap` (filling `sender = current_contract_address`)
123
- * before forwarding to the aggregator router.
119
+ * wraps this in `BatchSwap` (filling `sender = current_contract_address`
120
+ * and `totalIn = actual_withdrawn`) before forwarding to the aggregator
121
+ * router.
124
122
  */
125
123
  class AggregatorSwapDto {
126
124
  }
@@ -139,20 +137,22 @@ __decorate([
139
137
  ], AggregatorSwapDto.prototype, "paths", void 0);
140
138
  __decorate([
141
139
  (0, swagger_1.ApiProperty)({
142
- description: "Aggregate slippage guard across all paths' final output token (i128 decimal string).",
140
+ description: "Aggregate slippage guard across all paths' final output token (i128 decimal string). Must be > 0.",
143
141
  example: '6679778663',
144
142
  }),
145
143
  (0, class_validator_1.IsString)(),
146
144
  __metadata("design:type", String)
147
145
  ], AggregatorSwapDto.prototype, "totalMinOut", void 0);
148
146
  /**
149
- * Full payload for the aggregator router\'s `batch_execute` entry point.
147
+ * Full payload for the aggregator router's `batch_execute` entry point.
150
148
  * Identical to `AggregatorSwapDto` plus an explicit `sender` (G or
151
- * C strkey) whose SAC balances fund the swap and receive the output.
149
+ * C strkey) whose SAC balance funds the swap (the router pulls
150
+ * `totalIn` once at the start) and receives the output.
152
151
  *
153
152
  * Lending callers never construct `BatchSwap` directly — the controller
154
- * fills `sender` with `current_contract_address` so user funds remain
155
- * under the controller\'s custody for the duration of the strategy.
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
156
  */
157
157
  class BatchSwapDto {
158
158
  }
@@ -173,6 +173,14 @@ __decorate([
173
173
  (0, class_validator_1.IsString)(),
174
174
  __metadata("design:type", String)
175
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);
176
184
  __decorate([
177
185
  (0, swagger_1.ApiProperty)({
178
186
  description: 'Aggregate slippage guard across all paths.',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xoxno/types",
3
- "version": "1.0.392",
3
+ "version": "1.0.393",
4
4
  "description": "Shared types and utilities for XOXNO API.",
5
5
  "exports": {
6
6
  ".": {