@lifi/composer-sdk 0.6.1 → 0.6.3

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.
@@ -123,6 +123,8 @@ export interface ServerFailedPreparedOp {
123
123
  readonly kind: string;
124
124
  readonly message: string;
125
125
  readonly path?: string;
126
+ readonly port?: string;
127
+ readonly fix?: string;
126
128
  }
127
129
 
128
130
  /** Error envelope returned on non-2xx responses. */
@@ -131,6 +133,8 @@ export interface ServerErrorBody {
131
133
  readonly kind?: string;
132
134
  readonly message?: string;
133
135
  readonly path?: string;
136
+ readonly port?: string;
137
+ readonly fix?: string;
134
138
  readonly sdkVersion?: string;
135
139
  readonly serverVersion?: string;
136
140
  readonly minimumSdkVersion?: string;
@@ -146,6 +150,8 @@ const failedPreparedOpSchema = z.object({
146
150
  kind: z.string(),
147
151
  message: z.string(),
148
152
  path: z.string().optional(),
153
+ port: z.string().optional(),
154
+ fix: z.string().optional(),
149
155
  });
150
156
 
151
157
  // `details` is passed through (`z.custom`) rather than parsed: the SDK does not
@@ -154,13 +160,17 @@ const failedPreparedOpSchema = z.object({
154
160
  //
155
161
  // `failedOps`/`succeededOps` are optional here because every error kind shares
156
162
  // this envelope; they are only populated for `preparation_error` (422). Zod
157
- // strips undeclared keys, so omitting them would silently drop them.
163
+ // strips undeclared keys, so omitting them would silently drop them — which is
164
+ // also why `port` and `fix`, set on every author-caused `validation_error`,
165
+ // have to be declared here to reach the caller.
158
166
  const serverErrorBodySchema = z.object({
159
167
  error: z
160
168
  .object({
161
169
  kind: z.string().optional(),
162
170
  message: z.string().optional(),
163
171
  path: z.string().optional(),
172
+ port: z.string().optional(),
173
+ fix: z.string().optional(),
164
174
  sdkVersion: z.string().optional(),
165
175
  serverVersion: z.string().optional(),
166
176
  minimumSdkVersion: z.string().optional(),
package/src/sdk.ts CHANGED
@@ -149,12 +149,11 @@ export interface ComposeSdk {
149
149
  run: ComposeRunInput<T>,
150
150
  ) => ComposeCompileRequest;
151
151
  /**
152
- * Compiles a token pair on one chain — as of today a single zap step over
153
- * one routing-catalog edge. Thin pass-through to
154
- * {@link ComposeClient.route}; see it for the current single-step limit,
155
- * when to prefer `flow(...).compile(...)`, the `success` / `partial`
156
- * discrimination, and error behaviour. Build the `amount` with
157
- * `routeAmount.exact(...)` / `routeAmount.all(...)`.
152
+ * Compiles a token pair on one chain into a submit-ready transaction. Thin
153
+ * pass-through to {@link ComposeClient.route}; see it for the short chain of
154
+ * catalog edges the server plans, when to prefer `flow(...).compile(...)`,
155
+ * the `success` / `partial` discrimination, and error behaviour. Build the
156
+ * `amount` with `routeAmount.exact(...)` / `routeAmount.all(...)`.
158
157
  *
159
158
  * @param request - The from/to token pair, amount, signer, and route options.
160
159
  * @returns A discriminated result: `status: 'success'` or `status: 'partial'`.