@unconfirmed/sui-effect 0.1.2 → 0.2.0
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/CHANGELOG.md +114 -0
- package/LLMS.md +111 -837
- package/README.md +9 -5
- package/dist/domain/bcs.d.ts.map +1 -1
- package/dist/domain/bcs.js +18 -9
- package/dist/domain/bcs.js.map +1 -1
- package/dist/domain/errors.d.ts +86 -44
- package/dist/domain/errors.d.ts.map +1 -1
- package/dist/domain/errors.js +121 -37
- package/dist/domain/errors.js.map +1 -1
- package/dist/domain/executed.d.ts +2 -2
- package/dist/domain/executed.d.ts.map +1 -1
- package/dist/domain/executed.js +21 -11
- package/dist/domain/executed.js.map +1 -1
- package/dist/domain/journal-entry.d.ts +51 -51
- package/dist/domain/journal-entry.js +2 -2
- package/dist/domain/journal-entry.js.map +1 -1
- package/dist/domain/schemas.d.ts +150 -69
- package/dist/domain/schemas.d.ts.map +1 -1
- package/dist/domain/schemas.js +119 -35
- package/dist/domain/schemas.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/services/Script.d.ts.map +1 -1
- package/dist/services/Script.js +44 -76
- package/dist/services/Script.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.map +1 -1
- package/dist/services/Sui.js +28 -13
- 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/Tx.d.ts +37 -819
- package/dist/services/Tx.d.ts.map +1 -1
- package/dist/services/Tx.js +18 -2
- package/dist/services/Tx.js.map +1 -1
- package/docs/extensions.md +95 -13
- package/examples/extension-template/package.json +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/README.md
CHANGED
|
@@ -664,13 +664,17 @@ process verbatim.
|
|
|
664
664
|
sponsor policy typically allows. Narrow it once, where the runtime is built:
|
|
665
665
|
|
|
666
666
|
```ts
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
})
|
|
667
|
+
program.pipe(SubmitConfig.with({
|
|
668
|
+
maxGasBudget: Mist.make(1_000_000_000n), // 1 SUI
|
|
669
|
+
lockSender: false // see below
|
|
670
|
+
}))
|
|
672
671
|
```
|
|
673
672
|
|
|
673
|
+
`SubmitConfig.with(overrides)` spreads `SubmitConfig.defaults` for you and
|
|
674
|
+
provides the whole value, which is what a `Context.Reference` holds;
|
|
675
|
+
`SubmitConfig.layer(overrides)` is the same thing as a `Layer`, for an
|
|
676
|
+
application that sets its policy once where the runtime is built.
|
|
677
|
+
|
|
674
678
|
`lockSender` is the other one worth a decision. The lock exists because two
|
|
675
679
|
concurrent builds from one address can pick the same gas coin; with
|
|
676
680
|
`tx.setGasPayment([])` there is no coin to pick — the node pays from the address
|
package/dist/domain/bcs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bcs.d.ts","sourceRoot":"","sources":["../../src/domain/bcs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAE1C,OAAO,EAAE,MAAM,EAAE,MAAM,EAAgD,MAAM,QAAQ,CAAA;AACrF,OAAO,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"bcs.d.ts","sourceRoot":"","sources":["../../src/domain/bcs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAE1C,OAAO,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C,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAC7B,KACA,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,WAAW,CAmC9B,CAAA"}
|
package/dist/domain/bcs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { normalizeStructTag, parseStructTag } from "@mysten/sui/utils";
|
|
2
2
|
import { Effect, Schema, SchemaAST, SchemaIssue, SchemaTransformation } from "effect";
|
|
3
|
-
import { DecodeError } from "./errors.js";
|
|
3
|
+
import { DecodeError, decodePayload } from "./errors.js";
|
|
4
4
|
const SUI_TYPE_ANNOTATION = "sui-effect/suiType";
|
|
5
5
|
const normalizeSafe = (value) => {
|
|
6
6
|
try {
|
|
@@ -37,7 +37,10 @@ export const bcs = (bcsType, expectedType) => {
|
|
|
37
37
|
// A BCS layout carries no runtime type to test a decoded value against: the
|
|
38
38
|
// parse below is the validation, so the target schema accepts whatever the
|
|
39
39
|
// layout produced.
|
|
40
|
-
const target = Schema.declare((_u) => true
|
|
40
|
+
const target = Schema.declare((_u) => true, {
|
|
41
|
+
identifier: label,
|
|
42
|
+
description: `BCS layout ${label}`
|
|
43
|
+
});
|
|
41
44
|
return Schema.Uint8Array.pipe(Schema.decodeTo(target, SchemaTransformation.transformOrFail({
|
|
42
45
|
decode: (bytes, options) => Effect.try({
|
|
43
46
|
try: () => {
|
|
@@ -57,7 +60,7 @@ export const bcs = (bcsType, expectedType) => {
|
|
|
57
60
|
try: () => bcsType.serialize(value).toBytes(),
|
|
58
61
|
catch: (cause) => new SchemaIssue.InvalidValue({ message: `Could not serialize ${label} to BCS: ${String(cause)}` }, value, options)
|
|
59
62
|
})
|
|
60
|
-
}))).annotate(normalized === undefined ? {} : { [SUI_TYPE_ANNOTATION]: normalized });
|
|
63
|
+
}))).annotate(normalized === undefined ? {} : { [SUI_TYPE_ANNOTATION]: normalized }).pipe(Schema.revealCodec);
|
|
61
64
|
};
|
|
62
65
|
/**
|
|
63
66
|
* A BCS layout plus the mapping into a domain value, as one codec.
|
|
@@ -103,18 +106,22 @@ export const bcs = (bcsType, expectedType) => {
|
|
|
103
106
|
* ```
|
|
104
107
|
*/
|
|
105
108
|
export const decodeWith = (bcsType, expectedType, map) => {
|
|
106
|
-
const
|
|
109
|
+
const label = expectedType ?? bcsType.name;
|
|
110
|
+
const target = Schema.declare((_u) => true, {
|
|
111
|
+
identifier: label,
|
|
112
|
+
description: `BCS layout ${label}`
|
|
113
|
+
});
|
|
107
114
|
return bcs(bcsType, expectedType).pipe(Schema.decodeTo(target, SchemaTransformation.transformOrFail({
|
|
108
115
|
decode: (parsed, options) => Effect.try({
|
|
109
116
|
try: () => map(parsed),
|
|
110
117
|
catch: (cause) => new SchemaIssue.InvalidValue({
|
|
111
|
-
message: `Could not map ${
|
|
118
|
+
message: `Could not map ${label} into its domain value: ${String(cause)}`
|
|
112
119
|
}, parsed, options)
|
|
113
120
|
}),
|
|
114
121
|
encode: (value, options) => Effect.fail(new SchemaIssue.Forbidden({
|
|
115
|
-
message: `${
|
|
122
|
+
message: `${label} was built with SuiSchema.decodeWith, which has no encoder: serialize with the BCS layout instead`
|
|
116
123
|
}, value, options))
|
|
117
|
-
})));
|
|
124
|
+
})), Schema.revealCodec);
|
|
118
125
|
};
|
|
119
126
|
const MAX_ENCODING_DEPTH = 32;
|
|
120
127
|
/**
|
|
@@ -234,14 +241,16 @@ export const decodeContent = (schema, content, context) => {
|
|
|
234
241
|
issue: `${context?.objectId === undefined ? "the bytes have" : `object ${context.objectId} has`} type ${actual}`
|
|
235
242
|
}));
|
|
236
243
|
}
|
|
237
|
-
|
|
244
|
+
// `{ errors: "all" }` so a value that is wrong in three places reports three
|
|
245
|
+
// paths on `DecodeError.issues`, not just the first sentence.
|
|
246
|
+
return Schema.decodeUnknownEffect(schema)(content, { errors: "all" }).pipe(Effect.mapError((error) => new DecodeError({
|
|
238
247
|
...withObject,
|
|
239
248
|
...withExpected,
|
|
240
249
|
// The tag matched (or there was none to check) and the bytes
|
|
241
250
|
// themselves did not parse: a layout mismatch or a corrupt object,
|
|
242
251
|
// never something to swallow.
|
|
243
252
|
kind: "bytes",
|
|
244
|
-
|
|
253
|
+
...decodePayload(error)
|
|
245
254
|
})));
|
|
246
255
|
};
|
|
247
256
|
//# sourceMappingURL=bcs.js.map
|
package/dist/domain/bcs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bcs.js","sourceRoot":"","sources":["../../src/domain/bcs.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAAA;AACrF,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"bcs.js","sourceRoot":"","sources":["../../src/domain/bcs.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAAA;AACrF,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAGxD,MAAM,mBAAmB,GAAG,oBAAoB,CAAA;AAEhD,MAAM,aAAa,GAAG,CAAC,KAAa,EAAU,EAAE;IAC9C,IAAI,CAAC;QACH,OAAO,kBAAkB,CAAC,KAAK,CAAC,CAAA;IAClC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC,CAAA;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,GAAG,GAAG,CACjB,OAA0B,EAC1B,YAAqB,EACQ,EAAE;IAC/B,MAAM,UAAU,GAAG,YAAY,KAAK,S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,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAA;IACxF,MAAM,MAAM,GAAG,OAAO,EAAE,UAAU,CAAA;IAClC,IAAI,QAAQ,KAAK,SAAS,IAAI,MAAM,KAAK,SAAS,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE,CAAC;QACrF,OAAO,MAAM,CAAC,IAAI,CAChB,IAAI,WAAW,CAAC;YACd,GAAG,UAAU;YACb,GAAG,YAAY;YACf,oEAAoE;YACpE,6DAA6D;YAC7D,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,GACL,OAAO,EAAE,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,UAAU,OAAO,CAAC,QAAQ,MACjF,SAAS,MAAM,EAAE;SAClB,CAAC,CACH,CAAA;IACH,CAAC;IACD,6EAA6E;IAC7E,8DAA8D;IAC9D,OAAO,MAAM,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,IAAI,CACxE,MAAM,CAAC,QAAQ,CACb,CAAC,KAAK,EAAE,EAAE,CACR,IAAI,WAAW,CAAC;QACd,GAAG,UAAU;QACb,GAAG,YAAY;QACf,6DAA6D;QAC7D,mEAAmE;QACnE,8BAA8B;QAC9B,IAAI,EAAE,OAAO;QACb,GAAG,aAAa,CAAC,KAAK,CAAC;KACxB,CAAC,CACL,CACF,CAAA;AACH,CAAC,CAAA"}
|
package/dist/domain/errors.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export { CleverError, ExecutionReason, MoveLocation } from "./schemas.ts";
|
|
|
11
11
|
declare const TransportError_base: Schema.Class<TransportError, Schema.TaggedStruct<"TransportError", {
|
|
12
12
|
readonly method: Schema.String;
|
|
13
13
|
readonly retryable: Schema.Boolean;
|
|
14
|
-
readonly status: Schema.
|
|
14
|
+
readonly status: Schema.optionalKey<Schema.String>;
|
|
15
15
|
readonly cause: Schema.Defect;
|
|
16
16
|
}>, import("effect/Cause").YieldableError>;
|
|
17
17
|
/**
|
|
@@ -82,7 +82,7 @@ declare const ObjectNotFound_base: Schema.Class<ObjectNotFound, Schema.TaggedStr
|
|
|
82
82
|
readonly objectId: Schema.brand<Schema.decodeTo<Schema.toType<Schema.String>, Schema.String, never, never>, "ObjectId"> & {
|
|
83
83
|
normalize: (input: string) => string & import("effect/Brand").Brand<"ObjectId">;
|
|
84
84
|
};
|
|
85
|
-
readonly version: Schema.
|
|
85
|
+
readonly version: Schema.optionalKey<Schema.brand<Schema.BigIntFromString, "Version">>;
|
|
86
86
|
}>, import("effect/Cause").YieldableError>;
|
|
87
87
|
/** The object does not exist, or has never existed. */
|
|
88
88
|
export declare class ObjectNotFound extends ObjectNotFound_base {
|
|
@@ -102,7 +102,7 @@ declare const ObjectDeleted_base: Schema.Class<ObjectDeleted, Schema.TaggedStruc
|
|
|
102
102
|
readonly objectId: Schema.brand<Schema.decodeTo<Schema.toType<Schema.String>, Schema.String, never, never>, "ObjectId"> & {
|
|
103
103
|
normalize: (input: string) => string & import("effect/Brand").Brand<"ObjectId">;
|
|
104
104
|
};
|
|
105
|
-
readonly version: Schema.
|
|
105
|
+
readonly version: Schema.optionalKey<Schema.brand<Schema.BigIntFromString, "Version">>;
|
|
106
106
|
}>, import("effect/Cause").YieldableError>;
|
|
107
107
|
/** The object existed and has been deleted or wrapped. */
|
|
108
108
|
export declare class ObjectDeleted extends ObjectDeleted_base {
|
|
@@ -113,7 +113,7 @@ declare const ObjectUnavailable_base: Schema.Class<ObjectUnavailable, Schema.Tag
|
|
|
113
113
|
readonly objectId: Schema.brand<Schema.decodeTo<Schema.toType<Schema.String>, Schema.String, never, never>, "ObjectId"> & {
|
|
114
114
|
normalize: (input: string) => string & import("effect/Brand").Brand<"ObjectId">;
|
|
115
115
|
};
|
|
116
|
-
readonly version: Schema.
|
|
116
|
+
readonly version: Schema.optionalKey<Schema.brand<Schema.BigIntFromString, "Version">>;
|
|
117
117
|
}>, import("effect/Cause").YieldableError>;
|
|
118
118
|
/** The node could not say what happened to the object (`ObjectError.reason: "unknown"`). */
|
|
119
119
|
export declare class ObjectUnavailable extends ObjectUnavailable_base {
|
|
@@ -161,10 +161,10 @@ export declare const DecodeKind: Schema.Literals<readonly ["type", "bytes", "sha
|
|
|
161
161
|
/** The three decode failures {@link DecodeKind} names. */
|
|
162
162
|
export type DecodeKind = typeof DecodeKind.Type;
|
|
163
163
|
declare const DecodeError_base: Schema.Class<DecodeError, Schema.TaggedStruct<"DecodeError", {
|
|
164
|
-
readonly objectId: Schema.
|
|
164
|
+
readonly objectId: Schema.optionalKey<Schema.brand<Schema.decodeTo<Schema.toType<Schema.String>, Schema.String, never, never>, "ObjectId"> & {
|
|
165
165
|
normalize: (input: string) => string & import("effect/Brand").Brand<"ObjectId">;
|
|
166
166
|
}>;
|
|
167
|
-
readonly expectedType: Schema.
|
|
167
|
+
readonly expectedType: Schema.optionalKey<Schema.String>;
|
|
168
168
|
/**
|
|
169
169
|
* Which boundary failed. See {@link DecodeKind}.
|
|
170
170
|
*
|
|
@@ -172,6 +172,26 @@ declare const DecodeError_base: Schema.Class<DecodeError, Schema.TaggedStruct<"D
|
|
|
172
172
|
*/
|
|
173
173
|
readonly kind: Schema.withConstructorDefault<Schema.withDecodingDefaultKey<Schema.Literals<readonly ["type", "bytes", "shape"]>, never>>;
|
|
174
174
|
readonly issue: Schema.String;
|
|
175
|
+
/**
|
|
176
|
+
* Every issue the schema reported, with its path — the structured form of
|
|
177
|
+
* {@link DecodeError.issue}, which is only the first issue's sentence.
|
|
178
|
+
*
|
|
179
|
+
* An operator debugging a relay envelope with three bad fields sees three
|
|
180
|
+
* paths rather than one line, and a UI can render a message per field. The
|
|
181
|
+
* key is absent when the producer had no structured issue to carry (a Move
|
|
182
|
+
* type mismatch, a hand-built `DecodeError`), so `SuiError.toJson` still
|
|
183
|
+
* round-trips for every error that was built without one.
|
|
184
|
+
*
|
|
185
|
+
* `kind` is still the field to branch on; this is for reading.
|
|
186
|
+
*
|
|
187
|
+
* @since 0.1.3
|
|
188
|
+
*/
|
|
189
|
+
readonly issues: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
190
|
+
/** The path into the decoded value, as the schema walked it. */
|
|
191
|
+
readonly path: Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Number]>>;
|
|
192
|
+
/** What the schema said about that path. */
|
|
193
|
+
readonly message: Schema.String;
|
|
194
|
+
}>>>;
|
|
175
195
|
}>, import("effect/Cause").YieldableError>;
|
|
176
196
|
/**
|
|
177
197
|
* BCS content or a schema boundary did not decode.
|
|
@@ -186,6 +206,22 @@ export declare class DecodeError extends DecodeError_base {
|
|
|
186
206
|
/** The one actionable line `SuiError.describe` produces for this error. */
|
|
187
207
|
get message(): string;
|
|
188
208
|
}
|
|
209
|
+
/**
|
|
210
|
+
* The `DecodeError` payload a failed decode deserves: the first issue as the
|
|
211
|
+
* sentence `issue` has always been, and every issue as `{ path, message }`.
|
|
212
|
+
*
|
|
213
|
+
* `SchemaError.issue` is a tree; the second half is Effect's own
|
|
214
|
+
* Standard-Schema formatter over it, so the paths are the ones every other
|
|
215
|
+
* tool prints. A decode run with `{ errors: "all" }` reports every field
|
|
216
|
+
* rather than the first. Never fails.
|
|
217
|
+
*/
|
|
218
|
+
export declare const decodePayload: (error: Schema.SchemaError) => {
|
|
219
|
+
readonly issue: string;
|
|
220
|
+
readonly issues: ReadonlyArray<{
|
|
221
|
+
readonly path: ReadonlyArray<string | number>;
|
|
222
|
+
readonly message: string;
|
|
223
|
+
}>;
|
|
224
|
+
};
|
|
189
225
|
declare const SimulationFailed_base: Schema.Class<SimulationFailed, Schema.TaggedStruct<"SimulationFailed", {
|
|
190
226
|
readonly reason: Schema.toTaggedUnion<"$kind", readonly [Schema.Struct<{
|
|
191
227
|
readonly $kind: Schema.Literal<"MoveAbort">;
|
|
@@ -194,13 +230,13 @@ declare const SimulationFailed_base: Schema.Class<SimulationFailed, Schema.Tagge
|
|
|
194
230
|
readonly location: Schema.optional<Schema.Struct<{
|
|
195
231
|
readonly package: Schema.optional<Schema.String>;
|
|
196
232
|
readonly module: Schema.optional<Schema.String>;
|
|
197
|
-
readonly function: Schema.optional<Schema.
|
|
233
|
+
readonly function: Schema.optional<Schema.Finite>;
|
|
198
234
|
readonly functionName: Schema.optional<Schema.String>;
|
|
199
|
-
readonly instruction: Schema.optional<Schema.
|
|
235
|
+
readonly instruction: Schema.optional<Schema.Finite>;
|
|
200
236
|
}>>;
|
|
201
237
|
readonly cleverError: Schema.optional<Schema.Struct<{
|
|
202
|
-
readonly errorCode: Schema.optional<Schema.
|
|
203
|
-
readonly lineNumber: Schema.optional<Schema.
|
|
238
|
+
readonly errorCode: Schema.optional<Schema.Finite>;
|
|
239
|
+
readonly lineNumber: Schema.optional<Schema.Finite>;
|
|
204
240
|
readonly constantName: Schema.optional<Schema.String>;
|
|
205
241
|
readonly constantType: Schema.optional<Schema.String>;
|
|
206
242
|
readonly value: Schema.optional<Schema.String>;
|
|
@@ -210,19 +246,19 @@ declare const SimulationFailed_base: Schema.Class<SimulationFailed, Schema.Tagge
|
|
|
210
246
|
readonly $kind: Schema.Literal<"SizeError">;
|
|
211
247
|
readonly SizeError: Schema.Struct<{
|
|
212
248
|
readonly name: Schema.String;
|
|
213
|
-
readonly size: Schema.
|
|
214
|
-
readonly maxSize: Schema.
|
|
249
|
+
readonly size: Schema.Finite;
|
|
250
|
+
readonly maxSize: Schema.Finite;
|
|
215
251
|
}>;
|
|
216
252
|
}>, Schema.Struct<{
|
|
217
253
|
readonly $kind: Schema.Literal<"CommandArgumentError">;
|
|
218
254
|
readonly CommandArgumentError: Schema.Struct<{
|
|
219
|
-
readonly argument: Schema.
|
|
255
|
+
readonly argument: Schema.Finite;
|
|
220
256
|
readonly name: Schema.String;
|
|
221
257
|
}>;
|
|
222
258
|
}>, Schema.Struct<{
|
|
223
259
|
readonly $kind: Schema.Literal<"TypeArgumentError">;
|
|
224
260
|
readonly TypeArgumentError: Schema.Struct<{
|
|
225
|
-
readonly typeArgument: Schema.
|
|
261
|
+
readonly typeArgument: Schema.Finite;
|
|
226
262
|
readonly name: Schema.String;
|
|
227
263
|
}>;
|
|
228
264
|
}>, Schema.Struct<{
|
|
@@ -235,8 +271,8 @@ declare const SimulationFailed_base: Schema.Class<SimulationFailed, Schema.Tagge
|
|
|
235
271
|
}>, Schema.Struct<{
|
|
236
272
|
readonly $kind: Schema.Literal<"IndexError">;
|
|
237
273
|
readonly IndexError: Schema.Struct<{
|
|
238
|
-
readonly index: Schema.optional<Schema.
|
|
239
|
-
readonly subresult: Schema.optional<Schema.
|
|
274
|
+
readonly index: Schema.optional<Schema.Finite>;
|
|
275
|
+
readonly subresult: Schema.optional<Schema.Finite>;
|
|
240
276
|
}>;
|
|
241
277
|
}>, Schema.Struct<{
|
|
242
278
|
readonly $kind: Schema.Literal<"CoinDenyListError">;
|
|
@@ -274,13 +310,13 @@ declare const ExecutionFailed_base: Schema.Class<ExecutionFailed, Schema.TaggedS
|
|
|
274
310
|
readonly location: Schema.optional<Schema.Struct<{
|
|
275
311
|
readonly package: Schema.optional<Schema.String>;
|
|
276
312
|
readonly module: Schema.optional<Schema.String>;
|
|
277
|
-
readonly function: Schema.optional<Schema.
|
|
313
|
+
readonly function: Schema.optional<Schema.Finite>;
|
|
278
314
|
readonly functionName: Schema.optional<Schema.String>;
|
|
279
|
-
readonly instruction: Schema.optional<Schema.
|
|
315
|
+
readonly instruction: Schema.optional<Schema.Finite>;
|
|
280
316
|
}>>;
|
|
281
317
|
readonly cleverError: Schema.optional<Schema.Struct<{
|
|
282
|
-
readonly errorCode: Schema.optional<Schema.
|
|
283
|
-
readonly lineNumber: Schema.optional<Schema.
|
|
318
|
+
readonly errorCode: Schema.optional<Schema.Finite>;
|
|
319
|
+
readonly lineNumber: Schema.optional<Schema.Finite>;
|
|
284
320
|
readonly constantName: Schema.optional<Schema.String>;
|
|
285
321
|
readonly constantType: Schema.optional<Schema.String>;
|
|
286
322
|
readonly value: Schema.optional<Schema.String>;
|
|
@@ -290,19 +326,19 @@ declare const ExecutionFailed_base: Schema.Class<ExecutionFailed, Schema.TaggedS
|
|
|
290
326
|
readonly $kind: Schema.Literal<"SizeError">;
|
|
291
327
|
readonly SizeError: Schema.Struct<{
|
|
292
328
|
readonly name: Schema.String;
|
|
293
|
-
readonly size: Schema.
|
|
294
|
-
readonly maxSize: Schema.
|
|
329
|
+
readonly size: Schema.Finite;
|
|
330
|
+
readonly maxSize: Schema.Finite;
|
|
295
331
|
}>;
|
|
296
332
|
}>, Schema.Struct<{
|
|
297
333
|
readonly $kind: Schema.Literal<"CommandArgumentError">;
|
|
298
334
|
readonly CommandArgumentError: Schema.Struct<{
|
|
299
|
-
readonly argument: Schema.
|
|
335
|
+
readonly argument: Schema.Finite;
|
|
300
336
|
readonly name: Schema.String;
|
|
301
337
|
}>;
|
|
302
338
|
}>, Schema.Struct<{
|
|
303
339
|
readonly $kind: Schema.Literal<"TypeArgumentError">;
|
|
304
340
|
readonly TypeArgumentError: Schema.Struct<{
|
|
305
|
-
readonly typeArgument: Schema.
|
|
341
|
+
readonly typeArgument: Schema.Finite;
|
|
306
342
|
readonly name: Schema.String;
|
|
307
343
|
}>;
|
|
308
344
|
}>, Schema.Struct<{
|
|
@@ -315,8 +351,8 @@ declare const ExecutionFailed_base: Schema.Class<ExecutionFailed, Schema.TaggedS
|
|
|
315
351
|
}>, Schema.Struct<{
|
|
316
352
|
readonly $kind: Schema.Literal<"IndexError">;
|
|
317
353
|
readonly IndexError: Schema.Struct<{
|
|
318
|
-
readonly index: Schema.optional<Schema.
|
|
319
|
-
readonly subresult: Schema.optional<Schema.
|
|
354
|
+
readonly index: Schema.optional<Schema.Finite>;
|
|
355
|
+
readonly subresult: Schema.optional<Schema.Finite>;
|
|
320
356
|
}>;
|
|
321
357
|
}>, Schema.Struct<{
|
|
322
358
|
readonly $kind: Schema.Literal<"CoinDenyListError">;
|
|
@@ -340,9 +376,9 @@ declare const ExecutionFailed_base: Schema.Class<ExecutionFailed, Schema.TaggedS
|
|
|
340
376
|
}>, Schema.Struct<{
|
|
341
377
|
readonly $kind: Schema.Literal<"Unknown">;
|
|
342
378
|
}>]>;
|
|
343
|
-
readonly command: Schema.
|
|
379
|
+
readonly command: Schema.optionalKey<Schema.Finite>;
|
|
344
380
|
readonly effects: Schema.Struct<{
|
|
345
|
-
readonly version: Schema.
|
|
381
|
+
readonly version: Schema.Finite;
|
|
346
382
|
readonly status: Schema.Struct<{
|
|
347
383
|
readonly success: Schema.Boolean;
|
|
348
384
|
}>;
|
|
@@ -514,45 +550,45 @@ export declare class ExecutionFailed extends ExecutionFailed_base {
|
|
|
514
550
|
}
|
|
515
551
|
declare const SubmissionUnknown_base: Schema.Class<SubmissionUnknown, Schema.TaggedStruct<"SubmissionUnknown", {
|
|
516
552
|
readonly digest: Schema.brand<Schema.String, "Digest">;
|
|
517
|
-
readonly signed: Schema.
|
|
553
|
+
readonly signed: Schema.optionalKey<Schema.Struct<{
|
|
518
554
|
readonly digest: Schema.brand<Schema.String, "Digest">;
|
|
519
555
|
readonly bytes: Schema.Uint8ArrayFromBase64;
|
|
520
556
|
readonly signatures: Schema.$Array<Schema.brand<Schema.String, "Signature">>;
|
|
521
557
|
readonly sender: Schema.brand<Schema.decodeTo<Schema.toType<Schema.String>, Schema.String, never, never>, "SuiAddress"> & {
|
|
522
558
|
normalize: (input: string) => string & import("effect/Brand").Brand<"SuiAddress">;
|
|
523
559
|
};
|
|
524
|
-
readonly expiration: Schema.
|
|
560
|
+
readonly expiration: Schema.optionalKey<Schema.toTaggedUnion<"$kind", readonly [Schema.Struct<{
|
|
525
561
|
readonly $kind: Schema.Literal<"None">;
|
|
526
562
|
readonly None: Schema.Literal<true>;
|
|
527
563
|
}>, Schema.Struct<{
|
|
528
564
|
readonly $kind: Schema.Literal<"Epoch">;
|
|
529
|
-
readonly Epoch: Schema.decodeTo<Schema.BigInt, Schema.Union<readonly [Schema.String, Schema.
|
|
565
|
+
readonly Epoch: Schema.decodeTo<Schema.BigInt, Schema.Union<readonly [Schema.String, Schema.Finite]>, never, never>;
|
|
530
566
|
}>, Schema.Struct<{
|
|
531
567
|
readonly $kind: Schema.Literal<"ValidDuring">;
|
|
532
568
|
readonly ValidDuring: Schema.Struct<{
|
|
533
|
-
readonly minEpoch: Schema.NullOr<Schema.decodeTo<Schema.BigInt, Schema.Union<readonly [Schema.String, Schema.
|
|
534
|
-
readonly maxEpoch: Schema.NullOr<Schema.decodeTo<Schema.BigInt, Schema.Union<readonly [Schema.String, Schema.
|
|
535
|
-
readonly minTimestamp: Schema.NullOr<Schema.decodeTo<Schema.BigInt, Schema.Union<readonly [Schema.String, Schema.
|
|
536
|
-
readonly maxTimestamp: Schema.NullOr<Schema.decodeTo<Schema.BigInt, Schema.Union<readonly [Schema.String, Schema.
|
|
569
|
+
readonly minEpoch: Schema.NullOr<Schema.decodeTo<Schema.BigInt, Schema.Union<readonly [Schema.String, Schema.Finite]>, never, never>>;
|
|
570
|
+
readonly maxEpoch: Schema.NullOr<Schema.decodeTo<Schema.BigInt, Schema.Union<readonly [Schema.String, Schema.Finite]>, never, never>>;
|
|
571
|
+
readonly minTimestamp: Schema.NullOr<Schema.decodeTo<Schema.BigInt, Schema.Union<readonly [Schema.String, Schema.Finite]>, never, never>>;
|
|
572
|
+
readonly maxTimestamp: Schema.NullOr<Schema.decodeTo<Schema.BigInt, Schema.Union<readonly [Schema.String, Schema.Finite]>, never, never>>;
|
|
537
573
|
readonly chain: Schema.String;
|
|
538
|
-
readonly nonce: Schema.
|
|
574
|
+
readonly nonce: Schema.Finite;
|
|
539
575
|
}>;
|
|
540
576
|
}>, Schema.Struct<{
|
|
541
577
|
readonly $kind: Schema.Literal<"Validity">;
|
|
542
578
|
readonly Validity: Schema.Struct<{
|
|
543
579
|
readonly allowedProposers: Schema.NullOr<Schema.Struct<{
|
|
544
|
-
readonly epoch: Schema.decodeTo<Schema.BigInt, Schema.Union<readonly [Schema.String, Schema.
|
|
545
|
-
readonly proposers: Schema.$Array<Schema.
|
|
580
|
+
readonly epoch: Schema.decodeTo<Schema.BigInt, Schema.Union<readonly [Schema.String, Schema.Finite]>, never, never>;
|
|
581
|
+
readonly proposers: Schema.$Array<Schema.Finite>;
|
|
546
582
|
}>>;
|
|
547
|
-
readonly minEpoch: Schema.NullOr<Schema.decodeTo<Schema.BigInt, Schema.Union<readonly [Schema.String, Schema.
|
|
548
|
-
readonly maxEpoch: Schema.NullOr<Schema.decodeTo<Schema.BigInt, Schema.Union<readonly [Schema.String, Schema.
|
|
549
|
-
readonly minTimestamp: Schema.NullOr<Schema.decodeTo<Schema.BigInt, Schema.Union<readonly [Schema.String, Schema.
|
|
550
|
-
readonly maxTimestamp: Schema.NullOr<Schema.decodeTo<Schema.BigInt, Schema.Union<readonly [Schema.String, Schema.
|
|
583
|
+
readonly minEpoch: Schema.NullOr<Schema.decodeTo<Schema.BigInt, Schema.Union<readonly [Schema.String, Schema.Finite]>, never, never>>;
|
|
584
|
+
readonly maxEpoch: Schema.NullOr<Schema.decodeTo<Schema.BigInt, Schema.Union<readonly [Schema.String, Schema.Finite]>, never, never>>;
|
|
585
|
+
readonly minTimestamp: Schema.NullOr<Schema.decodeTo<Schema.BigInt, Schema.Union<readonly [Schema.String, Schema.Finite]>, never, never>>;
|
|
586
|
+
readonly maxTimestamp: Schema.NullOr<Schema.decodeTo<Schema.BigInt, Schema.Union<readonly [Schema.String, Schema.Finite]>, never, never>>;
|
|
551
587
|
readonly chain: Schema.String;
|
|
552
|
-
readonly nonce: Schema.
|
|
588
|
+
readonly nonce: Schema.Finite;
|
|
553
589
|
}>;
|
|
554
590
|
}>]>>;
|
|
555
|
-
readonly chain: Schema.
|
|
591
|
+
readonly chain: Schema.optionalKey<Schema.String>;
|
|
556
592
|
}>>;
|
|
557
593
|
readonly cause: Schema.Defect;
|
|
558
594
|
}>, import("effect/Cause").YieldableError>;
|
|
@@ -714,6 +750,12 @@ export interface HasOutcome {
|
|
|
714
750
|
* The helpers every repo hand-rolls: is this worth retrying, did the
|
|
715
751
|
* transaction land, is it even one of ours, what does an operator need to read,
|
|
716
752
|
* and what goes in a log.
|
|
753
|
+
*
|
|
754
|
+
* For *branching* on a failure, the taxonomy is a flat tagged union, so
|
|
755
|
+
* `Effect.catchTags({ ObjectNotFound: ..., TransportError: ... })` in the error
|
|
756
|
+
* channel and `Match.tagsExhaustive` over a `SuiError` value both work and are
|
|
757
|
+
* the two documented consumer idioms; these helpers are for the questions that
|
|
758
|
+
* are the same whatever the tag is.
|
|
717
759
|
*/
|
|
718
760
|
export declare const SuiError: {
|
|
719
761
|
readonly isRetryable: (error: SuiError) => boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/domain/errors.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/domain/errors.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAA6B,MAAM,EAAe,MAAM,QAAQ,CAAA;AACvE,OAAO,EACL,MAAM,EAOP,MAAM,cAAc,CAAA;AAErB,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;;;;;;;AAEzE;;;;;;;;GAQG;AACH,qBAAa,cAAe,SAAQ,mBAKlC;IACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,MAAM,CAAC,QAAQ,CAAC,WAAW,GACzB,QAAQ,MAAM,EACd,OAAO,OAAO,EACd,YAAY,OAAO,KAClB,cAAc,CAQhB;IAED,2EAA2E;IAC3E,IAAa,OAAO,IAAI,MAAM,CAE7B;CACF;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,uBAAuB,EAAE,WAAW,CAAC,MAAM,CAMtD,CAAA;AAIF;;;G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