@unconfirmed/sui-effect 0.1.1 → 0.1.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/AGENTS.md +34 -11
- package/CHANGELOG.md +77 -0
- package/LLMS.md +630 -704
- package/README.md +175 -9
- package/dist/domain/bcs.d.ts.map +1 -1
- package/dist/domain/bcs.js +25 -9
- package/dist/domain/bcs.js.map +1 -1
- package/dist/domain/errors.d.ts +178 -40
- package/dist/domain/errors.d.ts.map +1 -1
- package/dist/domain/errors.js +271 -37
- package/dist/domain/errors.js.map +1 -1
- package/dist/domain/executed.d.ts +71 -2
- package/dist/domain/executed.d.ts.map +1 -1
- package/dist/domain/executed.js +210 -9
- package/dist/domain/executed.js.map +1 -1
- package/dist/domain/journal-entry.d.ts +37 -37
- package/dist/domain/journal-entry.js +1 -1
- package/dist/domain/schemas.d.ts +172 -65
- package/dist/domain/schemas.d.ts.map +1 -1
- package/dist/domain/schemas.js +131 -32
- package/dist/domain/schemas.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +1 -1
- package/dist/internal.js.map +1 -1
- package/dist/script.d.ts +1 -1
- package/dist/script.d.ts.map +1 -1
- package/dist/script.js +1 -1
- package/dist/script.js.map +1 -1
- package/dist/services/Script.d.ts +42 -0
- package/dist/services/Script.d.ts.map +1 -1
- package/dist/services/Script.js +112 -77
- package/dist/services/Script.js.map +1 -1
- package/dist/services/Signer.d.ts +32 -7
- package/dist/services/Signer.d.ts.map +1 -1
- package/dist/services/Signer.js +69 -10
- package/dist/services/Signer.js.map +1 -1
- package/dist/services/SubmitConfig.d.ts +3 -22
- package/dist/services/SubmitConfig.d.ts.map +1 -1
- package/dist/services/SubmitConfig.js +54 -9
- package/dist/services/SubmitConfig.js.map +1 -1
- package/dist/services/Sui.d.ts +42 -1
- package/dist/services/Sui.d.ts.map +1 -1
- package/dist/services/Sui.js +46 -17
- package/dist/services/Sui.js.map +1 -1
- package/dist/services/SuiCore.d.ts.map +1 -1
- package/dist/services/SuiCore.js +47 -33
- package/dist/services/SuiCore.js.map +1 -1
- package/dist/services/SuiCoreFake.d.ts +47 -4
- package/dist/services/SuiCoreFake.d.ts.map +1 -1
- package/dist/services/SuiCoreFake.js +193 -22
- package/dist/services/SuiCoreFake.js.map +1 -1
- package/dist/services/Tx.d.ts +236 -402
- package/dist/services/Tx.d.ts.map +1 -1
- package/dist/services/Tx.js +205 -10
- package/dist/services/Tx.js.map +1 -1
- package/dist/testing.d.ts +1 -0
- package/dist/testing.d.ts.map +1 -1
- package/dist/testing.js +9 -0
- package/dist/testing.js.map +1 -1
- package/dist/tx.d.ts +1 -1
- package/dist/tx.d.ts.map +1 -1
- package/dist/tx.js +1 -1
- package/dist/tx.js.map +1 -1
- package/docs/extensions.md +608 -19
- package/examples/extension-template/src/Escrow.ts +1 -1
- package/examples/extension-template/src/errors.ts +29 -0
- package/examples/extension-template/src/schema.ts +8 -17
- package/examples/extension-template/test/escrow.test.ts +44 -0
- package/package.json +1 -1
package/dist/domain/errors.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @since 0.1.0
|
|
7
7
|
*/
|
|
8
|
-
import { Result, Schema } from "effect";
|
|
8
|
+
import { Effect, Predicate, Result, Schema, SchemaIssue } from "effect";
|
|
9
9
|
import { Digest, ExecutionReason, NotAppliedEvidence, ObjectId, SignedTransaction, TransactionEffects, Version } from "./schemas.js";
|
|
10
10
|
export { CleverError, ExecutionReason, MoveLocation } from "./schemas.js";
|
|
11
11
|
/**
|
|
@@ -62,6 +62,10 @@ export class TransportError extends Schema.TaggedError()("TransportError", {
|
|
|
62
62
|
cause
|
|
63
63
|
});
|
|
64
64
|
};
|
|
65
|
+
/** The one actionable line `SuiError.describe` produces for this error. */
|
|
66
|
+
get message() {
|
|
67
|
+
return describe(this);
|
|
68
|
+
}
|
|
65
69
|
}
|
|
66
70
|
/**
|
|
67
71
|
* gRPC status names a read may be retried on, plus HTTP 5xx and 429. Timeouts
|
|
@@ -112,32 +116,157 @@ export class ObjectNotFound extends Schema.TaggedError()("ObjectNotFound", {
|
|
|
112
116
|
objectId: ObjectId,
|
|
113
117
|
version: Schema.optional(Version)
|
|
114
118
|
}) {
|
|
119
|
+
/**
|
|
120
|
+
* The one actionable line `SuiError.describe` produces for this error.
|
|
121
|
+
*
|
|
122
|
+
* `Schema.TaggedError` gives every class the `Error` constructor and no
|
|
123
|
+
* message of its own, so `error.message` was the empty string — and a
|
|
124
|
+
* consumer that surfaces `.message` (a log line, a UI, another library's
|
|
125
|
+
* error formatter) showed nothing at all. A getter rather than a schema
|
|
126
|
+
* field, so it is always in step with `describe`, costs nothing to
|
|
127
|
+
* construct, and stays out of `SuiError.toJson`'s encoding.
|
|
128
|
+
*/
|
|
129
|
+
get message() {
|
|
130
|
+
return describe(this);
|
|
131
|
+
}
|
|
115
132
|
}
|
|
116
133
|
/** The object existed and has been deleted or wrapped. */
|
|
117
134
|
export class ObjectDeleted extends Schema.TaggedError()("ObjectDeleted", {
|
|
118
135
|
objectId: ObjectId,
|
|
119
136
|
version: Schema.optional(Version)
|
|
120
137
|
}) {
|
|
138
|
+
/** The one actionable line `SuiError.describe` produces for this error. */
|
|
139
|
+
get message() {
|
|
140
|
+
return describe(this);
|
|
141
|
+
}
|
|
121
142
|
}
|
|
122
143
|
/** The node could not say what happened to the object (`ObjectError.reason: "unknown"`). */
|
|
123
144
|
export class ObjectUnavailable extends Schema.TaggedError()("ObjectUnavailable", { objectId: ObjectId, version: Schema.optional(Version) }) {
|
|
145
|
+
/** The one actionable line `SuiError.describe` produces for this error. */
|
|
146
|
+
get message() {
|
|
147
|
+
return describe(this);
|
|
148
|
+
}
|
|
124
149
|
}
|
|
125
150
|
/** No transaction with this digest is known to the node. */
|
|
126
151
|
export class TransactionNotFound extends Schema.TaggedError()("TransactionNotFound", { digest: Digest }) {
|
|
152
|
+
/** The one actionable line `SuiError.describe` produces for this error. */
|
|
153
|
+
get message() {
|
|
154
|
+
return describe(this);
|
|
155
|
+
}
|
|
127
156
|
}
|
|
128
157
|
/** The chain identifier the node reported is not the one the layer was built for. */
|
|
129
158
|
export class NetworkMismatch extends Schema.TaggedError()("NetworkMismatch", {
|
|
130
159
|
expected: Schema.String,
|
|
131
160
|
actual: Schema.String
|
|
132
161
|
}) {
|
|
162
|
+
/** The one actionable line `SuiError.describe` produces for this error. */
|
|
163
|
+
get message() {
|
|
164
|
+
return describe(this);
|
|
165
|
+
}
|
|
133
166
|
}
|
|
134
|
-
/**
|
|
167
|
+
/**
|
|
168
|
+
* Which of the three things that can go wrong at a decode boundary went wrong.
|
|
169
|
+
*
|
|
170
|
+
* - `"type"`: the object, the field or the event **is not of the expected Move
|
|
171
|
+
* type**. The bytes were never parsed. This is the one a caller answers with
|
|
172
|
+
* "that is not one of mine" — a 404 for a foreign object, a `filter` over a
|
|
173
|
+
* heterogeneous list — and the one it is safe to swallow.
|
|
174
|
+
* - `"bytes"`: the type matched and the **BCS parse failed**, or left trailing
|
|
175
|
+
* bytes. Either the layout this package was built with is not the layout the
|
|
176
|
+
* package on chain writes, or the object is corrupt. Never safe to swallow.
|
|
177
|
+
* - `"shape"`: a **domain schema** refused a value that was already parsed or
|
|
178
|
+
* that came from the node as JSON — a missing field in a node response, a
|
|
179
|
+
* number that is not a timestamp, a simulation with no such command. A bug
|
|
180
|
+
* here is in this library, the node, or the caller's expectations.
|
|
181
|
+
*
|
|
182
|
+
* Branch on this, never on {@link DecodeError}'s `issue`: `issue` is a human
|
|
183
|
+
* sentence and its wording changes between releases.
|
|
184
|
+
*
|
|
185
|
+
* @since 0.1.2
|
|
186
|
+
*/
|
|
187
|
+
export const DecodeKind = Schema.Literals(["type", "bytes", "shape"]);
|
|
188
|
+
/**
|
|
189
|
+
* BCS content or a schema boundary did not decode.
|
|
190
|
+
*
|
|
191
|
+
* `kind` says which of the three (`"type"`, `"bytes"`, `"shape"`) and is what a
|
|
192
|
+
* consumer branches on; `issue` is the sentence for a human and is not stable.
|
|
193
|
+
* It defaults to `"shape"` when neither a constructor nor an encoded value
|
|
194
|
+
* carries one, so an extension that builds a `DecodeError` with no `kind` still
|
|
195
|
+
* compiles and still answers the question conservatively.
|
|
196
|
+
*/
|
|
135
197
|
export class DecodeError extends Schema.TaggedError()("DecodeError", {
|
|
136
198
|
objectId: Schema.optional(ObjectId),
|
|
137
199
|
expectedType: Schema.optional(Schema.String),
|
|
138
|
-
|
|
200
|
+
/**
|
|
201
|
+
* Which boundary failed. See {@link DecodeKind}.
|
|
202
|
+
*
|
|
203
|
+
* @since 0.1.2
|
|
204
|
+
*/
|
|
205
|
+
kind: DecodeKind.pipe(Schema.withDecodingDefaultKey(Effect.succeed("shape")), Schema.withConstructorDefault(Effect.succeed("shape"))),
|
|
206
|
+
issue: Schema.String,
|
|
207
|
+
/**
|
|
208
|
+
* Every issue the schema reported, with its path — the structured form of
|
|
209
|
+
* {@link DecodeError.issue}, which is only the first issue's sentence.
|
|
210
|
+
*
|
|
211
|
+
* An operator debugging a relay envelope with three bad fields sees three
|
|
212
|
+
* paths rather than one line, and a UI can render a message per field. The
|
|
213
|
+
* key is absent when the producer had no structured issue to carry (a Move
|
|
214
|
+
* type mismatch, a hand-built `DecodeError`), so `SuiError.toJson` still
|
|
215
|
+
* round-trips for every error that was built without one.
|
|
216
|
+
*
|
|
217
|
+
* `kind` is still the field to branch on; this is for reading.
|
|
218
|
+
*
|
|
219
|
+
* @since 0.1.3
|
|
220
|
+
*/
|
|
221
|
+
issues: Schema.optionalKey(Schema.Array(Schema.Struct({
|
|
222
|
+
/** The path into the decoded value, as the schema walked it. */
|
|
223
|
+
path: Schema.Array(Schema.Union([Schema.String, Schema.Number])),
|
|
224
|
+
/** What the schema said about that path. */
|
|
225
|
+
message: Schema.String
|
|
226
|
+
})))
|
|
139
227
|
}) {
|
|
228
|
+
/** The one actionable line `SuiError.describe` produces for this error. */
|
|
229
|
+
get message() {
|
|
230
|
+
return describe(this);
|
|
231
|
+
}
|
|
140
232
|
}
|
|
233
|
+
const standardIssues = SchemaIssue.makeFormatterStandardSchemaV1();
|
|
234
|
+
/**
|
|
235
|
+
* The **first** issue of a `SchemaError`'s formatted message, which is what
|
|
236
|
+
* {@link DecodeError}'s `issue` has always carried.
|
|
237
|
+
*
|
|
238
|
+
* The producers decode with `{ errors: "all" }` so `issues` can carry every
|
|
239
|
+
* path, and the formatter joins those issues with a newline — which turned
|
|
240
|
+
* `error.message` into a paragraph. `issue` is one sentence for a human and
|
|
241
|
+
* its shape is part of what 0.1.2 shipped, so it is cut back to the first
|
|
242
|
+
* issue's block: the message plus the indented `at [...]` line the formatter
|
|
243
|
+
* puts under it. A single-issue failure has no second block, so it comes
|
|
244
|
+
* through byte for byte. Never fails.
|
|
245
|
+
*/
|
|
246
|
+
const firstIssue = (message) => {
|
|
247
|
+
const lines = message.split("\n");
|
|
248
|
+
// A continuation line of the same issue is indented; the next issue starts
|
|
249
|
+
// at column zero.
|
|
250
|
+
const next = lines.findIndex((line, index) => index > 0 && !line.startsWith(" "));
|
|
251
|
+
return next === -1 ? message : lines.slice(0, next).join("\n");
|
|
252
|
+
};
|
|
253
|
+
/**
|
|
254
|
+
* The `DecodeError` payload a failed decode deserves: the first issue as the
|
|
255
|
+
* sentence `issue` has always been, and every issue as `{ path, message }`.
|
|
256
|
+
*
|
|
257
|
+
* `SchemaError.issue` is a tree; the second half is Effect's own
|
|
258
|
+
* Standard-Schema formatter over it, so the paths are the ones every other
|
|
259
|
+
* tool prints. A decode run with `{ errors: "all" }` reports every field
|
|
260
|
+
* rather than the first. Never fails.
|
|
261
|
+
*/
|
|
262
|
+
export const decodePayload = (error) => ({ issue: firstIssue(error.message), issues: decodeIssues(error) });
|
|
263
|
+
const decodeIssues = (error) => standardIssues(error.issue).issues.map((issue) => ({
|
|
264
|
+
path: (issue.path ?? []).map((segment) => {
|
|
265
|
+
const key = Predicate.isObject(segment) ? segment["key"] : segment;
|
|
266
|
+
return typeof key === "number" ? key : String(key);
|
|
267
|
+
}),
|
|
268
|
+
message: issue.message
|
|
269
|
+
}));
|
|
141
270
|
/** Simulation reported an execution failure. No gas was charged. */
|
|
142
271
|
export class SimulationFailed extends Schema.TaggedError()("SimulationFailed", {
|
|
143
272
|
reason: ExecutionReason,
|
|
@@ -148,15 +277,23 @@ export class SimulationFailed extends Schema.TaggedError()("SimulationFailed", {
|
|
|
148
277
|
export class ExecutionFailed extends Schema.TaggedError()("ExecutionFailed", {
|
|
149
278
|
digest: Digest,
|
|
150
279
|
reason: ExecutionReason,
|
|
151
|
-
command: Schema.optional(Schema.
|
|
280
|
+
command: Schema.optional(Schema.Finite),
|
|
152
281
|
effects: TransactionEffects
|
|
153
282
|
}) {
|
|
283
|
+
/** The one actionable line `SuiError.describe` produces for this error. */
|
|
284
|
+
get message() {
|
|
285
|
+
return describe(this);
|
|
286
|
+
}
|
|
154
287
|
}
|
|
155
288
|
/**
|
|
156
289
|
* Bytes may have reached the network and the outcome is unknown. Carries the
|
|
157
290
|
* signed transaction so an operator or a later process can reconcile it.
|
|
158
291
|
*/
|
|
159
292
|
export class SubmissionUnknown extends Schema.TaggedError()("SubmissionUnknown", { digest: Digest, signed: Schema.optional(SignedTransaction), cause: Schema.Defect() }) {
|
|
293
|
+
/** The one actionable line `SuiError.describe` produces for this error. */
|
|
294
|
+
get message() {
|
|
295
|
+
return describe(this);
|
|
296
|
+
}
|
|
160
297
|
}
|
|
161
298
|
/**
|
|
162
299
|
* The transaction provably cannot have been applied, and never will be.
|
|
@@ -171,11 +308,19 @@ export class NotApplied extends Schema.TaggedError()("NotApplied", {
|
|
|
171
308
|
digest: Digest,
|
|
172
309
|
evidence: NotAppliedEvidence
|
|
173
310
|
}) {
|
|
311
|
+
/** The one actionable line `SuiError.describe` produces for this error. */
|
|
312
|
+
get message() {
|
|
313
|
+
return describe(this);
|
|
314
|
+
}
|
|
174
315
|
}
|
|
175
316
|
/** A signer refused or failed to produce a signature. */
|
|
176
317
|
export class SigningError extends Schema.TaggedError()("SigningError", {
|
|
177
318
|
cause: Schema.Defect()
|
|
178
319
|
}) {
|
|
320
|
+
/** The one actionable line `SuiError.describe` produces for this error. */
|
|
321
|
+
get message() {
|
|
322
|
+
return describe(this);
|
|
323
|
+
}
|
|
179
324
|
}
|
|
180
325
|
/** The transaction could not be built into bytes. */
|
|
181
326
|
export class BuildError extends Schema.TaggedError()("BuildError", {
|
|
@@ -193,6 +338,10 @@ export class PolicyDenied extends Schema.TaggedError()("PolicyDenied", {
|
|
|
193
338
|
export class JournalError extends Schema.TaggedError()("JournalError", {
|
|
194
339
|
cause: Schema.Defect()
|
|
195
340
|
}) {
|
|
341
|
+
/** The one actionable line `SuiError.describe` produces for this error. */
|
|
342
|
+
get message() {
|
|
343
|
+
return describe(this);
|
|
344
|
+
}
|
|
196
345
|
}
|
|
197
346
|
/**
|
|
198
347
|
* The effects of an applied transaction did not contain what the caller
|
|
@@ -205,6 +354,10 @@ export class JournalError extends Schema.TaggedError()("JournalError", {
|
|
|
205
354
|
* time for a transaction that already ran.
|
|
206
355
|
*/
|
|
207
356
|
export class UnexpectedEffects extends Schema.TaggedError()("UnexpectedEffects", { digest: Digest, expected: Schema.String, found: Schema.Array(ObjectId) }) {
|
|
357
|
+
/** The one actionable line `SuiError.describe` produces for this error. */
|
|
358
|
+
get message() {
|
|
359
|
+
return describe(this);
|
|
360
|
+
}
|
|
208
361
|
}
|
|
209
362
|
/**
|
|
210
363
|
* The GraphQL endpoint an extension needs is not usable: none was configured,
|
|
@@ -220,6 +373,10 @@ export class UnexpectedEffects extends Schema.TaggedError()("UnexpectedEffects",
|
|
|
220
373
|
* Outcome `not_applied`: a read that did not happen changed nothing.
|
|
221
374
|
*/
|
|
222
375
|
export class GraphQLUnavailable extends Schema.TaggedError()("GraphQLUnavailable", { method: Schema.String, reason: Schema.String }) {
|
|
376
|
+
/** The one actionable line `SuiError.describe` produces for this error. */
|
|
377
|
+
get message() {
|
|
378
|
+
return describe(this);
|
|
379
|
+
}
|
|
223
380
|
}
|
|
224
381
|
/**
|
|
225
382
|
* A synchronous member of a Promise-faced extension was called before its
|
|
@@ -236,6 +393,10 @@ export class GraphQLUnavailable extends Schema.TaggedError()("GraphQLUnavailable
|
|
|
236
393
|
* Outcome `not_applied`: nothing was sent.
|
|
237
394
|
*/
|
|
238
395
|
export class ExtensionNotReady extends Schema.TaggedError()("ExtensionNotReady", { extension: Schema.String, member: Schema.String }) {
|
|
396
|
+
/** The one actionable line `SuiError.describe` produces for this error. */
|
|
397
|
+
get message() {
|
|
398
|
+
return describe(this);
|
|
399
|
+
}
|
|
239
400
|
}
|
|
240
401
|
/** The schema of the whole taxonomy, used for serialization. */
|
|
241
402
|
export const SuiErrorSchema = Schema.Union([
|
|
@@ -258,31 +419,27 @@ export const SuiErrorSchema = Schema.Union([
|
|
|
258
419
|
GraphQLUnavailable,
|
|
259
420
|
ExtensionNotReady
|
|
260
421
|
]);
|
|
422
|
+
/**
|
|
423
|
+
* {@link SuiErrorSchema} as a tagged union, which is what makes the tag list
|
|
424
|
+
* derivable: `.cases` is keyed by `_tag`, so nothing has to repeat it.
|
|
425
|
+
*
|
|
426
|
+
* Not exported — `SuiErrorSchema` is the published shape and this is how the
|
|
427
|
+
* library reads its own keys.
|
|
428
|
+
*/
|
|
429
|
+
const SuiErrorTagged = SuiErrorSchema.pipe(Schema.toTaggedUnion("_tag"));
|
|
261
430
|
const OutcomeSchema = Schema.Literals(["applied", "not_applied", "unknown"]);
|
|
262
431
|
const isHasOutcome = Schema.is(Schema.Struct({ outcome: OutcomeSchema }));
|
|
263
432
|
const hasOutcome = (error) => isHasOutcome(error);
|
|
264
433
|
const isRetryable = (error) => error._tag === "TransportError" ? error.retryable : false;
|
|
265
|
-
/**
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
"SimulationFailed",
|
|
275
|
-
"ExecutionFailed",
|
|
276
|
-
"SubmissionUnknown",
|
|
277
|
-
"NotApplied",
|
|
278
|
-
"SigningError",
|
|
279
|
-
"BuildError",
|
|
280
|
-
"PolicyDenied",
|
|
281
|
-
"JournalError",
|
|
282
|
-
"UnexpectedEffects",
|
|
283
|
-
"GraphQLUnavailable",
|
|
284
|
-
"ExtensionNotReady"
|
|
285
|
-
]);
|
|
434
|
+
/**
|
|
435
|
+
* Every tag the taxonomy owns, so a foreign tag can be told from one of ours.
|
|
436
|
+
*
|
|
437
|
+
* Derived from {@link SuiErrorSchema} rather than written out: a hand-kept copy
|
|
438
|
+
* of the tag list is one edit that can be forgotten, and forgetting it here
|
|
439
|
+
* used to mean an error the library defines being classified as somebody
|
|
440
|
+
* else's. Adding a class to the union adds its tag here.
|
|
441
|
+
*/
|
|
442
|
+
const TAXONOMY_TAGS = new Set(Object.keys(SuiErrorTagged.cases));
|
|
286
443
|
/**
|
|
287
444
|
* What a failure says about the transaction it came from.
|
|
288
445
|
*
|
|
@@ -293,13 +450,25 @@ const TAXONOMY_TAGS = new Set([
|
|
|
293
450
|
* applied, and answering `"not_applied"` for it would tell a retry idiom to
|
|
294
451
|
* send again on no evidence at all. `Script.exitCode` agrees by exiting 1 for
|
|
295
452
|
* an unclassified error rather than 3.
|
|
453
|
+
*
|
|
454
|
+
* **`{ phase: "pre-submit" }` changes that last answer, and only that one.**
|
|
455
|
+
* A failure caught while building, simulating or signing cannot have applied,
|
|
456
|
+
* whoever's error it is, so an unrecognised tag there is `"not_applied"`
|
|
457
|
+
* rather than `"unknown"`. Use it where the code knows nothing has been sent —
|
|
458
|
+
* a `catchAll` around `Tx.build`/`Tx.sign`, an extension's validation — and
|
|
459
|
+
* leave the default everywhere a submission may already be on the wire.
|
|
460
|
+
* {@link isTaxonomy} answers the same question a level lower: is this even one
|
|
461
|
+
* of ours?
|
|
296
462
|
*/
|
|
297
|
-
const outcome = (error) => {
|
|
463
|
+
const outcome = (error, options) => {
|
|
298
464
|
if (hasOutcome(error))
|
|
299
465
|
return error.outcome;
|
|
300
466
|
const tag = error._tag;
|
|
301
|
-
if (typeof tag !== "string" || !TAXONOMY_TAGS.has(tag))
|
|
302
|
-
|
|
467
|
+
if (typeof tag !== "string" || !TAXONOMY_TAGS.has(tag)) {
|
|
468
|
+
// Before anything was sent, an unclassifiable failure still means nothing
|
|
469
|
+
// reached the chain; after, it means exactly nothing.
|
|
470
|
+
return options?.phase === "pre-submit" ? "not_applied" : "unknown";
|
|
471
|
+
}
|
|
303
472
|
switch (tag) {
|
|
304
473
|
case "ExecutionFailed":
|
|
305
474
|
// An `UnexpectedEffects` is built from an `Executed`: the transaction
|
|
@@ -360,7 +529,26 @@ const causeLine = (cause) => {
|
|
|
360
529
|
return cause.name;
|
|
361
530
|
return undefined;
|
|
362
531
|
};
|
|
532
|
+
/**
|
|
533
|
+
* One actionable line for a failure.
|
|
534
|
+
*
|
|
535
|
+
* **It accepts a foreign error too**, the way {@link outcome} and {@link toJson}
|
|
536
|
+
* do: an extension's own `Schema.TaggedError`, or any object carrying a `_tag`.
|
|
537
|
+
* A tag the taxonomy owns gets the taxonomy's wording; anything else gets its
|
|
538
|
+
* own `message` after the tag, or the bare tag when there is nothing readable —
|
|
539
|
+
* never `undefined`, which is what a `switch` with no default used to return
|
|
540
|
+
* for a foreign tag while the signature promised a `string`. A wrapper script
|
|
541
|
+
* that prints one line per failure should not have to know whose error it is
|
|
542
|
+
* holding.
|
|
543
|
+
*/
|
|
363
544
|
const describe = (error) => {
|
|
545
|
+
if (!TAXONOMY_TAGS.has(error._tag)) {
|
|
546
|
+
const line = causeLine(error);
|
|
547
|
+
return line === undefined || line === error._tag ? error._tag : `${error._tag}: ${line}`;
|
|
548
|
+
}
|
|
549
|
+
return describeTaxonomy(error);
|
|
550
|
+
};
|
|
551
|
+
const describeTaxonomy = (error) => {
|
|
364
552
|
switch (error._tag) {
|
|
365
553
|
case "TransportError": {
|
|
366
554
|
const cause = causeLine(error.cause);
|
|
@@ -375,7 +563,7 @@ const describe = (error) => {
|
|
|
375
563
|
case "NetworkMismatch":
|
|
376
564
|
return `NetworkMismatch expected ${error.expected} but the node reported ${error.actual}`;
|
|
377
565
|
case "DecodeError":
|
|
378
|
-
return `DecodeError ${error.expectedType ?? ""} ${error.objectId ?? ""} ${error.issue}`
|
|
566
|
+
return `DecodeError ${error.kind} ${error.expectedType ?? ""} ${error.objectId ?? ""} ${error.issue}`
|
|
379
567
|
.replace(/\s+/g, " ")
|
|
380
568
|
.trim();
|
|
381
569
|
case "SimulationFailed":
|
|
@@ -423,9 +611,7 @@ const encodeThroughOwnSchema = (error) => {
|
|
|
423
611
|
if (!Result.isSuccess(encoded))
|
|
424
612
|
return undefined;
|
|
425
613
|
const value = encoded.success;
|
|
426
|
-
return
|
|
427
|
-
? value
|
|
428
|
-
: undefined;
|
|
614
|
+
return Predicate.isObject(value) ? value : undefined;
|
|
429
615
|
};
|
|
430
616
|
/**
|
|
431
617
|
* The `outcome` of an error that declares one, when the encoded JSON has lost
|
|
@@ -448,6 +634,22 @@ const withOutcome = (error, json) => {
|
|
|
448
634
|
? { ...json, outcome: value }
|
|
449
635
|
: json;
|
|
450
636
|
};
|
|
637
|
+
/**
|
|
638
|
+
* The human sentence, in the same key for every error.
|
|
639
|
+
*
|
|
640
|
+
* Fifteen of the eighteen taxonomy classes carry `message` as an
|
|
641
|
+
* `override get message()` rather than as a schema field, and a getter stays
|
|
642
|
+
* out of the encoding — so a JSON log line had a sentence for three tags and
|
|
643
|
+
* none for the rest, and an operator had to special-case them. This adds it
|
|
644
|
+
* when the encoding did not produce one. Additive: a decoder ignores the
|
|
645
|
+
* excess key, so every round trip still holds. Never fails.
|
|
646
|
+
*/
|
|
647
|
+
const withMessage = (json, sentence) => {
|
|
648
|
+
if (typeof json["message"] === "string" && json["message"].length > 0)
|
|
649
|
+
return json;
|
|
650
|
+
const value = sentence();
|
|
651
|
+
return value === undefined || value.length === 0 ? json : { ...json, message: value };
|
|
652
|
+
};
|
|
451
653
|
/**
|
|
452
654
|
* The JSON an operator or a log line gets for a failure.
|
|
453
655
|
*
|
|
@@ -463,27 +665,59 @@ const withOutcome = (error, json) => {
|
|
|
463
665
|
* wrapper script acts on, and losing it in the log while `Script.exitCode` saw
|
|
464
666
|
* it was the one inconsistency in the serialization.
|
|
465
667
|
*
|
|
668
|
+
* **`message` is always there too**, for the same reason: fifteen of the
|
|
669
|
+
* eighteen taxonomy classes carry it as a getter, which stays out of the
|
|
670
|
+
* encoding, so a log line had a sentence for three tags and nothing for the
|
|
671
|
+
* rest. A taxonomy error gets {@link describe}; an extension error gets its own
|
|
672
|
+
* `.message` when it is a non-empty string. Added only when the encoding
|
|
673
|
+
* produced none, and ignored on decode, so nothing round-trips differently.
|
|
674
|
+
*
|
|
466
675
|
* Never fails.
|
|
467
676
|
*/
|
|
468
677
|
const toJson = (error) => {
|
|
469
678
|
const encoded = encode(error);
|
|
470
679
|
if (Result.isSuccess(encoded)) {
|
|
471
|
-
return withOutcome(error, encoded.success);
|
|
680
|
+
return withMessage(withOutcome(error, encoded.success), () => describe(error));
|
|
472
681
|
}
|
|
473
682
|
const own = encodeThroughOwnSchema(error);
|
|
474
|
-
if (own !== undefined)
|
|
475
|
-
return withOutcome(error, own)
|
|
683
|
+
if (own !== undefined) {
|
|
684
|
+
return withMessage(withOutcome(error, own), () => {
|
|
685
|
+
const value = error.message;
|
|
686
|
+
return typeof value === "string" && value.length > 0 ? value : undefined;
|
|
687
|
+
});
|
|
688
|
+
}
|
|
476
689
|
const message = TAXONOMY_TAGS.has(error._tag)
|
|
477
690
|
? describe(error)
|
|
478
691
|
: causeLine(error) ?? error._tag;
|
|
479
692
|
return withOutcome(error, { _tag: error._tag, message });
|
|
480
693
|
};
|
|
481
694
|
/**
|
|
482
|
-
*
|
|
483
|
-
*
|
|
695
|
+
* Whether this error is one of the tags the closed taxonomy owns.
|
|
696
|
+
*
|
|
697
|
+
* The question a wrapper asks before trusting {@link outcome}'s default answer,
|
|
698
|
+
* and the one a consumer asks before narrowing to `SuiError`. An extension's
|
|
699
|
+
* own error, a `ConfigError`, a `TypeError` — all `false`. Never fails.
|
|
700
|
+
*
|
|
701
|
+
* @since 0.1.2
|
|
702
|
+
*/
|
|
703
|
+
const isTaxonomy = (error) => {
|
|
704
|
+
const tag = error?._tag;
|
|
705
|
+
return typeof tag === "string" && TAXONOMY_TAGS.has(tag);
|
|
706
|
+
};
|
|
707
|
+
/**
|
|
708
|
+
* The helpers every repo hand-rolls: is this worth retrying, did the
|
|
709
|
+
* transaction land, is it even one of ours, what does an operator need to read,
|
|
710
|
+
* and what goes in a log.
|
|
711
|
+
*
|
|
712
|
+
* For *branching* on a failure, the taxonomy is a flat tagged union, so
|
|
713
|
+
* `Effect.catchTags({ ObjectNotFound: ..., TransportError: ... })` in the error
|
|
714
|
+
* channel and `Match.tagsExhaustive` over a `SuiError` value both work and are
|
|
715
|
+
* the two documented consumer idioms; these helpers are for the questions that
|
|
716
|
+
* are the same whatever the tag is.
|
|
484
717
|
*/
|
|
485
718
|
export const SuiError = {
|
|
486
719
|
isRetryable,
|
|
720
|
+
isTaxonomy,
|
|
487
721
|
outcome,
|
|
488
722
|
describe,
|
|
489
723
|
toJson
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/domain/errors.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACvC,OAAO,EACL,MAAM,EACN,eAAe,EACf,kBAAkB,EAClB,QAAQ,EACR,iBAAiB,EACjB,kBAAkB,EAClB,OAAO,EACR,MAAM,cAAc,CAAA;AAErB,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAEzE;;;;;;;;GAQG;AACH,MAAM,OAAO,cAAe,SAAQ,MAAM,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aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;QAC3C,CAAC,CAAC,QAAQ,CAAC,KAAiB,CAAC;QAC7B,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,CAAA;IAClC,OAAO,WAAW,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,CAAA;AAC1D,CAAC,CAAA;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,GAAG,CAAC,KAAc,EAAqB,EAAE;IACvD,MAAM,GAAG,GAAI,KAAqC,EAAE,IAAI,CAAA;IACxD,OAAO,OAAO,GAAG,KAAK,QAAQ,IAAI,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AAC1D,CAAC,CAAA;AAED;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,WAAW;IACX,UAAU;IACV,OAAO;IACP,QAAQ;IACR,MAAM;CACE,CAAA;AAEV,0EAA0E;AAC1E,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,KAAe,EAAsB,EAAE;IAC9D,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;QACnB,KAAK,qBAAqB,CAAC;QAC3B,KAAK,iBAAiB,CAAC;QACvB,KAAK,mBAAmB,CAAC;QACzB,KAAK,YAAY,CAAC;QAClB,KAAK,mBAAmB;YACtB,OAAO,KAAK,CAAC,MAAM,CAAA;QACrB;YACE,OAAO,SAAS,CAAA;IACpB,CAAC;AACH,CAAC,CAAA"}
|
|
@@ -69,7 +69,7 @@ export interface SdkObjectRef {
|
|
|
69
69
|
declare const Executed_base: Schema.Class<Executed, Schema.Struct<{
|
|
70
70
|
readonly digest: Schema.brand<Schema.String, "Digest">;
|
|
71
71
|
readonly effects: Schema.Struct<{
|
|
72
|
-
readonly version: Schema.
|
|
72
|
+
readonly version: Schema.Finite;
|
|
73
73
|
readonly status: Schema.Struct<{
|
|
74
74
|
readonly success: Schema.Boolean;
|
|
75
75
|
}>;
|
|
@@ -243,6 +243,7 @@ declare const Executed_base: Schema.Class<Executed, Schema.Struct<{
|
|
|
243
243
|
};
|
|
244
244
|
readonly eventType: Schema.String;
|
|
245
245
|
readonly bcs: Schema.Uint8Array;
|
|
246
|
+
readonly json: Schema.optional<Schema.Unknown>;
|
|
246
247
|
}>>;
|
|
247
248
|
readonly balanceChanges: Schema.$Array<Schema.Struct<{
|
|
248
249
|
readonly coinType: Schema.brand<Schema.decodeTo<Schema.toType<Schema.String>, Schema.String, never, never>, "CoinType">;
|
|
@@ -253,11 +254,21 @@ declare const Executed_base: Schema.Class<Executed, Schema.Struct<{
|
|
|
253
254
|
}>>;
|
|
254
255
|
readonly objectTypes: Schema.$Record<Schema.String, Schema.String>;
|
|
255
256
|
readonly checkpoint: Schema.NullOr<Schema.BigIntFromString>;
|
|
256
|
-
readonly timestampMs: Schema.NullOr<Schema.
|
|
257
|
+
readonly timestampMs: Schema.NullOr<Schema.Finite>;
|
|
257
258
|
}>, {}>;
|
|
258
259
|
/**
|
|
259
260
|
* A transaction the network executed, built from the fixed execute include set:
|
|
260
261
|
* effects, events, balance changes and object types.
|
|
262
|
+
*
|
|
263
|
+
* **`events` is `ReadonlyArray<Event>`, not `SuiClientTypes.Event[]`.** It is
|
|
264
|
+
* that type minus `json`: `packageId`, `module`, `sender`, `eventType` and
|
|
265
|
+
* `bcs`, with the branded ids this package uses. The SDK's `json` is dropped on
|
|
266
|
+
* purpose — it is the node's own rendering, it is absent on most transports,
|
|
267
|
+
* and the decode a caller wants is `SuiSchema.decode(codec, event.bcs)`, which
|
|
268
|
+
* gives a typed value rather than a shape that changes with the node. Code
|
|
269
|
+
* typed against the SDK's `Event[]` therefore does not accept these; take
|
|
270
|
+
* `ReadonlyArray<Event>` from `@unconfirmed/sui-effect`, or map the fields you
|
|
271
|
+
* need.
|
|
261
272
|
*/
|
|
262
273
|
export declare class Executed extends Executed_base {
|
|
263
274
|
/**
|
|
@@ -314,6 +325,17 @@ export declare class Executed extends Executed_base {
|
|
|
314
325
|
* Never fails.
|
|
315
326
|
*/
|
|
316
327
|
wrapped(): ReadonlyArray<ChangedRef>;
|
|
328
|
+
/**
|
|
329
|
+
* Whether this change wrote an object, treating `Unknown` as "the envelope
|
|
330
|
+
* did not say".
|
|
331
|
+
*
|
|
332
|
+
* A node always reports the output state; a reduced envelope from a relay or
|
|
333
|
+
* a sponsor often reports nothing but the id and the id operation, and
|
|
334
|
+
* {@link Executed.fromPartial} leaves what it was not told as `Unknown`
|
|
335
|
+
* rather than inventing `ObjectWrite`. Reading `Unknown` as "not an object
|
|
336
|
+
* write" would make `created()` silently empty for exactly those envelopes.
|
|
337
|
+
*/
|
|
338
|
+
private static wroteAnObject;
|
|
317
339
|
private static isDeleted;
|
|
318
340
|
private static isWrapped;
|
|
319
341
|
/**
|
|
@@ -328,6 +350,53 @@ export declare class Executed extends Executed_base {
|
|
|
328
350
|
balanceChange(address: SuiAddress, coinType: CoinType): bigint;
|
|
329
351
|
/** Computation plus storage less the storage rebate, in MIST. Can be negative. Never fails. */
|
|
330
352
|
get gasUsedTotal(): bigint;
|
|
353
|
+
/**
|
|
354
|
+
* An `Executed` from the SDK's own `TransactionResult`, read with
|
|
355
|
+
* {@link EXECUTE_INCLUDE}.
|
|
356
|
+
*
|
|
357
|
+
* This is what `Tx.submit` uses, exported so a caller holding a result from
|
|
358
|
+
* somewhere else — `client.core.executeTransaction`, a sponsor's SDK call —
|
|
359
|
+
* can get the accessors without re-implementing the decode.
|
|
360
|
+
*
|
|
361
|
+
* Fails with: `ExecutionFailed` (the transaction applied and failed),
|
|
362
|
+
* `DecodeError` (the response does not carry the include set).
|
|
363
|
+
*
|
|
364
|
+
* @since 0.1.2
|
|
365
|
+
*/
|
|
366
|
+
static readonly fromTransactionResult: (result: SuiClientTypes.TransactionResult<typeof EXECUTE_INCLUDE>) => Effect.Effect<Executed, ExecutionFailed | DecodeError>;
|
|
367
|
+
/**
|
|
368
|
+
* An `Executed` from a **reduced** execute envelope: what a relay, a sponsor
|
|
369
|
+
* or another service hands back, over JSON, after submitting on your behalf.
|
|
370
|
+
*
|
|
371
|
+
* Such an envelope is rarely the SDK's full include set. Everything optional
|
|
372
|
+
* is filled in with "the node did not say" rather than refused:
|
|
373
|
+
*
|
|
374
|
+
* - `changedObjects` entries need only `objectId` and `idOperation`; the
|
|
375
|
+
* version, digest and owner on either side default to `null`, and
|
|
376
|
+
* `outputState` defaults to `ObjectWrite` (`DoesNotExist` for a
|
|
377
|
+
* `Deleted`), so {@link created} and {@link deleted} classify correctly
|
|
378
|
+
* from the id operation alone.
|
|
379
|
+
* - `objectTypes` defaults to `{}`. **The type filters need it**:
|
|
380
|
+
* `created(type)`, `mutated(type)` and `expectCreated(type)` can only
|
|
381
|
+
* match a change whose type the envelope carried, so without
|
|
382
|
+
* `objectTypes` they return nothing. `created()` with no argument, and
|
|
383
|
+
* {@link createdWhere}, still list every created id.
|
|
384
|
+
* - `balanceChanges` and `events` default to `[]`, `checkpoint` and
|
|
385
|
+
* `timestampMs` to `null`, `gasUsed` to zeros, and `effects.status` to
|
|
386
|
+
* success.
|
|
387
|
+
* - **JSON spellings are accepted** where the SDK's types are not JSON:
|
|
388
|
+
* `bcs` as base64 or as an array of byte values as well as a
|
|
389
|
+
* `Uint8Array`, and every `u64` (versions, balances, gas, `checkpoint`)
|
|
390
|
+
* as a number or a `bigint` as well as the decimal string the wire uses.
|
|
391
|
+
*
|
|
392
|
+
* An envelope with no usable digest, or whose values are the wrong shape
|
|
393
|
+
* rather than merely absent, fails: absence is filled in, nonsense is not.
|
|
394
|
+
*
|
|
395
|
+
* Fails with: `DecodeError`.
|
|
396
|
+
*
|
|
397
|
+
* @since 0.1.2
|
|
398
|
+
*/
|
|
399
|
+
static readonly fromPartial: (envelope: unknown) => Effect.Effect<Executed, DecodeError>;
|
|
331
400
|
/**
|
|
332
401
|
* The single object of this type the transaction created.
|
|
333
402
|
*
|