@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.
- package/README.md +213 -189
- package/dist/client.cjs +1 -1
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +7 -7
- package/dist/client.d.ts +7 -7
- package/dist/client.js +1 -1
- package/dist/client.js.map +1 -1
- package/dist/errors.cjs +20 -1
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.d.cts +18 -1
- package/dist/errors.d.ts +18 -1
- package/dist/errors.js +20 -1
- package/dist/errors.js.map +1 -1
- package/dist/index.cjs +3 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/reachability.cjs +123 -0
- package/dist/reachability.cjs.map +1 -0
- package/dist/reachability.d.cts +71 -0
- package/dist/reachability.d.ts +71 -0
- package/dist/reachability.js +99 -0
- package/dist/reachability.js.map +1 -0
- package/dist/responseSchemas.cjs +5 -1
- package/dist/responseSchemas.cjs.map +1 -1
- package/dist/responseSchemas.d.cts +4 -0
- package/dist/responseSchemas.d.ts +4 -0
- package/dist/responseSchemas.js +5 -1
- package/dist/responseSchemas.js.map +1 -1
- package/dist/sdk.cjs.map +1 -1
- package/dist/sdk.d.cts +5 -6
- package/dist/sdk.d.ts +5 -6
- package/dist/sdk.js.map +1 -1
- package/package.json +3 -2
- package/src/client.ts +7 -7
- package/src/errors.ts +22 -1
- package/src/index.ts +7 -0
- package/src/reachability.ts +203 -0
- package/src/responseSchemas.ts +11 -1
- package/src/sdk.ts +5 -6
package/src/responseSchemas.ts
CHANGED
|
@@ -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
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
*
|
|
156
|
-
*
|
|
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'`.
|