sui-effect 0.1.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/AGENTS.md +209 -0
- package/LICENSE +21 -0
- package/LLMS.md +6707 -0
- package/README.md +300 -0
- package/dist/domain/bcs.d.ts +101 -0
- package/dist/domain/bcs.d.ts.map +1 -0
- package/dist/domain/bcs.js +183 -0
- package/dist/domain/bcs.js.map +1 -0
- package/dist/domain/errors.d.ts +595 -0
- package/dist/domain/errors.d.ts.map +1 -0
- package/dist/domain/errors.js +476 -0
- package/dist/domain/errors.js.map +1 -0
- package/dist/domain/executed.d.ts +325 -0
- package/dist/domain/executed.d.ts.map +1 -0
- package/dist/domain/executed.js +253 -0
- package/dist/domain/executed.js.map +1 -0
- package/dist/domain/journal-entry.d.ts +468 -0
- package/dist/domain/journal-entry.d.ts.map +1 -0
- package/dist/domain/journal-entry.js +63 -0
- package/dist/domain/journal-entry.js.map +1 -0
- package/dist/domain/schemas.d.ts +950 -0
- package/dist/domain/schemas.d.ts.map +1 -0
- package/dist/domain/schemas.js +571 -0
- package/dist/domain/schemas.js.map +1 -0
- package/dist/domain/sui-schema.d.ts +12 -0
- package/dist/domain/sui-schema.d.ts.map +1 -0
- package/dist/domain/sui-schema.js +12 -0
- package/dist/domain/sui-schema.js.map +1 -0
- package/dist/extension.d.ts +7 -0
- package/dist/extension.d.ts.map +1 -0
- package/dist/extension.js +7 -0
- package/dist/extension.js.map +1 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +31 -0
- package/dist/index.js.map +1 -0
- package/dist/internal.d.ts +18 -0
- package/dist/internal.d.ts.map +1 -0
- package/dist/internal.js +18 -0
- package/dist/internal.js.map +1 -0
- package/dist/journal.d.ts +51 -0
- package/dist/journal.d.ts.map +1 -0
- package/dist/journal.js +18 -0
- package/dist/journal.js.map +1 -0
- package/dist/script.d.ts +7 -0
- package/dist/script.d.ts.map +1 -0
- package/dist/script.js +7 -0
- package/dist/script.js.map +1 -0
- package/dist/services/Journal.d.ts +76 -0
- package/dist/services/Journal.d.ts.map +1 -0
- package/dist/services/Journal.js +70 -0
- package/dist/services/Journal.js.map +1 -0
- package/dist/services/JournalKeyValueStore.d.ts +73 -0
- package/dist/services/JournalKeyValueStore.d.ts.map +1 -0
- package/dist/services/JournalKeyValueStore.js +155 -0
- package/dist/services/JournalKeyValueStore.js.map +1 -0
- package/dist/services/Script.d.ts +210 -0
- package/dist/services/Script.d.ts.map +1 -0
- package/dist/services/Script.js +441 -0
- package/dist/services/Script.js.map +1 -0
- package/dist/services/Signer.d.ts +132 -0
- package/dist/services/Signer.d.ts.map +1 -0
- package/dist/services/Signer.js +158 -0
- package/dist/services/Signer.js.map +1 -0
- package/dist/services/SubmitConfig.d.ts +175 -0
- package/dist/services/SubmitConfig.d.ts.map +1 -0
- package/dist/services/SubmitConfig.js +52 -0
- package/dist/services/SubmitConfig.js.map +1 -0
- package/dist/services/Sui.d.ts +295 -0
- package/dist/services/Sui.d.ts.map +1 -0
- package/dist/services/Sui.js +414 -0
- package/dist/services/Sui.js.map +1 -0
- package/dist/services/SuiCore.d.ts +227 -0
- package/dist/services/SuiCore.d.ts.map +1 -0
- package/dist/services/SuiCore.js +400 -0
- package/dist/services/SuiCore.js.map +1 -0
- package/dist/services/SuiCoreFake.d.ts +278 -0
- package/dist/services/SuiCoreFake.d.ts.map +1 -0
- package/dist/services/SuiCoreFake.js +1003 -0
- package/dist/services/SuiCoreFake.js.map +1 -0
- package/dist/services/SuiExtension.d.ts +208 -0
- package/dist/services/SuiExtension.d.ts.map +1 -0
- package/dist/services/SuiExtension.js +355 -0
- package/dist/services/SuiExtension.js.map +1 -0
- package/dist/services/SuiGraphQL.d.ts +98 -0
- package/dist/services/SuiGraphQL.d.ts.map +1 -0
- package/dist/services/SuiGraphQL.js +118 -0
- package/dist/services/SuiGraphQL.js.map +1 -0
- package/dist/services/Tx.d.ts +687 -0
- package/dist/services/Tx.d.ts.map +1 -0
- package/dist/services/Tx.js +1224 -0
- package/dist/services/Tx.js.map +1 -0
- package/dist/testing.d.ts +88 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/testing.js +163 -0
- package/dist/testing.js.map +1 -0
- package/dist/tx.d.ts +24 -0
- package/dist/tx.d.ts.map +1 -0
- package/dist/tx.js +24 -0
- package/dist/tx.js.map +1 -0
- package/docs/extensions.md +1685 -0
- package/examples/extension-template/README.md +170 -0
- package/examples/extension-template/package.json +44 -0
- package/examples/extension-template/scripts/check-package.ts +145 -0
- package/examples/extension-template/src/Escrow.ts +445 -0
- package/examples/extension-template/src/Platform.ts +136 -0
- package/examples/extension-template/src/errors.ts +61 -0
- package/examples/extension-template/src/extension.ts +63 -0
- package/examples/extension-template/src/index.ts +34 -0
- package/examples/extension-template/src/schema.ts +158 -0
- package/examples/extension-template/src/upstream.ts +66 -0
- package/examples/extension-template/test/escrow.test.ts +559 -0
- package/examples/extension-template/tsconfig.build.json +26 -0
- package/examples/extension-template/tsconfig.json +35 -0
- package/package.json +87 -0
|
@@ -0,0 +1,595 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The closed error taxonomy. Every failure sui-effect can produce is one of the
|
|
3
|
+
* classes in this file, every one is a `Schema.TaggedError` so it serializes,
|
|
4
|
+
* and the tags are flat: there is no error inheritance to match on.
|
|
5
|
+
*
|
|
6
|
+
* @since 0.1.0
|
|
7
|
+
*/
|
|
8
|
+
import { Schema } from "effect";
|
|
9
|
+
import { Digest } from "./schemas.ts";
|
|
10
|
+
export { CleverError, ExecutionReason, MoveLocation } from "./schemas.ts";
|
|
11
|
+
declare const TransportError_base: Schema.Class<TransportError, Schema.TaggedStruct<"TransportError", {
|
|
12
|
+
readonly method: Schema.String;
|
|
13
|
+
readonly retryable: Schema.Boolean;
|
|
14
|
+
readonly status: Schema.optional<Schema.String>;
|
|
15
|
+
readonly cause: Schema.Defect;
|
|
16
|
+
}>, import("effect/Cause").YieldableError>;
|
|
17
|
+
/**
|
|
18
|
+
* A request did not reach a usable answer. `retryable` is true for the statuses
|
|
19
|
+
* a read may be retried on: gRPC `UNAVAILABLE`, `DEADLINE_EXCEEDED`,
|
|
20
|
+
* `RESOURCE_EXHAUSTED`, `INTERNAL` and `UNKNOWN`, HTTP 5xx and 429, and
|
|
21
|
+
* timeouts. `INTERNAL` and `UNKNOWN` are in the set because the grpc-web
|
|
22
|
+
* transport reports a refused connection or a DNS failure as `INTERNAL` and an
|
|
23
|
+
* HTTP 500 as `UNKNOWN`, so without them a node that is merely down is never
|
|
24
|
+
* retried.
|
|
25
|
+
*/
|
|
26
|
+
export declare class TransportError extends TransportError_base {
|
|
27
|
+
/**
|
|
28
|
+
* Builds a `TransportError` out of whatever a call threw, classifying the
|
|
29
|
+
* status and the retryability the way `SuiCore` does for the SDK's own
|
|
30
|
+
* failures.
|
|
31
|
+
*
|
|
32
|
+
* This is for an extension that makes its own network calls — an operator
|
|
33
|
+
* HTTP API, a GraphQL endpoint, a sidecar — and wants its failures to sit on
|
|
34
|
+
* the same axis as the library's: `retryable` read off a gRPC status name, an
|
|
35
|
+
* HTTP status number (5xx and 429), or an abort or timeout, and `status`
|
|
36
|
+
* recorded as the node or the transport spelled it. Hand-building the three
|
|
37
|
+
* fields per call site is how they drift.
|
|
38
|
+
*
|
|
39
|
+
* `retryable` may be forced when the caller knows better than the shape of
|
|
40
|
+
* the cause — an idempotent read that is always safe to repeat, a write that
|
|
41
|
+
* never is. Left out, it is inferred, and inferred conservatively: an
|
|
42
|
+
* unrecognisable cause is **not** retryable.
|
|
43
|
+
*
|
|
44
|
+
* Never fails.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```ts
|
|
48
|
+
* import { TransportError } from "sui-effect"
|
|
49
|
+
* import { Effect } from "effect"
|
|
50
|
+
*
|
|
51
|
+
* const status = Effect.tryPromise({
|
|
52
|
+
* try: (signal) => fetch("https://operator.example/status", { signal }),
|
|
53
|
+
* catch: (cause) => TransportError.fromUnknown("operator.status", cause)
|
|
54
|
+
* })
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
static readonly fromUnknown: (method: string, cause: unknown, retryable?: boolean) => TransportError;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* gRPC status names a read may be retried on, plus HTTP 5xx and 429. Timeouts
|
|
61
|
+
* map to `DEADLINE_EXCEEDED` with `retryable: true`.
|
|
62
|
+
*
|
|
63
|
+
* `INTERNAL` and `UNKNOWN` are transport-level failures, not answers from the
|
|
64
|
+
* node: `@protobuf-ts/grpcweb-transport` turns a rejected `fetch` (connection
|
|
65
|
+
* refused, DNS failure) into an `RpcError` with code `INTERNAL`, and its
|
|
66
|
+
* grpc-web format maps HTTP 500 to `UNKNOWN` (503 to `UNAVAILABLE`, 504 to
|
|
67
|
+
* `DEADLINE_EXCEEDED`, 429 to `RESOURCE_EXHAUSTED`). Without them a read
|
|
68
|
+
* against a node that is merely down or restarting is never retried.
|
|
69
|
+
*/
|
|
70
|
+
export declare const RETRYABLE_GRPC_STATUSES: ReadonlySet<string>;
|
|
71
|
+
/**
|
|
72
|
+
* The `status` and `retryable` of a thrown value: a timeout or an abort, an
|
|
73
|
+
* HTTP status number, a gRPC status name, or nothing recognisable. Never fails.
|
|
74
|
+
*/
|
|
75
|
+
export declare const classifyTransportCause: (cause: unknown) => {
|
|
76
|
+
readonly status?: string;
|
|
77
|
+
readonly retryable: boolean;
|
|
78
|
+
};
|
|
79
|
+
declare const ObjectNotFound_base: Schema.Class<ObjectNotFound, Schema.TaggedStruct<"ObjectNotFound", {
|
|
80
|
+
readonly objectId: Schema.brand<Schema.decodeTo<Schema.toType<Schema.String>, Schema.String, never, never>, "ObjectId">;
|
|
81
|
+
readonly version: Schema.optional<Schema.brand<Schema.BigIntFromString, "Version">>;
|
|
82
|
+
}>, import("effect/Cause").YieldableError>;
|
|
83
|
+
/** The object does not exist, or has never existed. */
|
|
84
|
+
export declare class ObjectNotFound extends ObjectNotFound_base {
|
|
85
|
+
}
|
|
86
|
+
declare const ObjectDeleted_base: Schema.Class<ObjectDeleted, Schema.TaggedStruct<"ObjectDeleted", {
|
|
87
|
+
readonly objectId: Schema.brand<Schema.decodeTo<Schema.toType<Schema.String>, Schema.String, never, never>, "ObjectId">;
|
|
88
|
+
readonly version: Schema.optional<Schema.brand<Schema.BigIntFromString, "Version">>;
|
|
89
|
+
}>, import("effect/Cause").YieldableError>;
|
|
90
|
+
/** The object existed and has been deleted or wrapped. */
|
|
91
|
+
export declare class ObjectDeleted extends ObjectDeleted_base {
|
|
92
|
+
}
|
|
93
|
+
declare const ObjectUnavailable_base: Schema.Class<ObjectUnavailable, Schema.TaggedStruct<"ObjectUnavailable", {
|
|
94
|
+
readonly objectId: Schema.brand<Schema.decodeTo<Schema.toType<Schema.String>, Schema.String, never, never>, "ObjectId">;
|
|
95
|
+
readonly version: Schema.optional<Schema.brand<Schema.BigIntFromString, "Version">>;
|
|
96
|
+
}>, import("effect/Cause").YieldableError>;
|
|
97
|
+
/** The node could not say what happened to the object (`ObjectError.reason: "unknown"`). */
|
|
98
|
+
export declare class ObjectUnavailable extends ObjectUnavailable_base {
|
|
99
|
+
}
|
|
100
|
+
declare const TransactionNotFound_base: Schema.Class<TransactionNotFound, Schema.TaggedStruct<"TransactionNotFound", {
|
|
101
|
+
readonly digest: Schema.brand<Schema.String, "Digest">;
|
|
102
|
+
}>, import("effect/Cause").YieldableError>;
|
|
103
|
+
/** No transaction with this digest is known to the node. */
|
|
104
|
+
export declare class TransactionNotFound extends TransactionNotFound_base {
|
|
105
|
+
}
|
|
106
|
+
declare const NetworkMismatch_base: Schema.Class<NetworkMismatch, Schema.TaggedStruct<"NetworkMismatch", {
|
|
107
|
+
readonly expected: Schema.String;
|
|
108
|
+
readonly actual: Schema.String;
|
|
109
|
+
}>, import("effect/Cause").YieldableError>;
|
|
110
|
+
/** The chain identifier the node reported is not the one the layer was built for. */
|
|
111
|
+
export declare class NetworkMismatch extends NetworkMismatch_base {
|
|
112
|
+
}
|
|
113
|
+
declare const DecodeError_base: Schema.Class<DecodeError, Schema.TaggedStruct<"DecodeError", {
|
|
114
|
+
readonly objectId: Schema.optional<Schema.brand<Schema.decodeTo<Schema.toType<Schema.String>, Schema.String, never, never>, "ObjectId">>;
|
|
115
|
+
readonly expectedType: Schema.optional<Schema.String>;
|
|
116
|
+
readonly issue: Schema.String;
|
|
117
|
+
}>, import("effect/Cause").YieldableError>;
|
|
118
|
+
/** BCS content or a schema boundary did not decode. */
|
|
119
|
+
export declare class DecodeError extends DecodeError_base {
|
|
120
|
+
}
|
|
121
|
+
declare const SimulationFailed_base: Schema.Class<SimulationFailed, Schema.TaggedStruct<"SimulationFailed", {
|
|
122
|
+
readonly reason: Schema.toTaggedUnion<"$kind", readonly [Schema.Struct<{
|
|
123
|
+
readonly $kind: Schema.Literal<"MoveAbort">;
|
|
124
|
+
readonly MoveAbort: Schema.Struct<{
|
|
125
|
+
readonly abortCode: Schema.BigIntFromString;
|
|
126
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
127
|
+
readonly package: Schema.optional<Schema.String>;
|
|
128
|
+
readonly module: Schema.optional<Schema.String>;
|
|
129
|
+
readonly function: Schema.optional<Schema.Number>;
|
|
130
|
+
readonly functionName: Schema.optional<Schema.String>;
|
|
131
|
+
readonly instruction: Schema.optional<Schema.Number>;
|
|
132
|
+
}>>;
|
|
133
|
+
readonly cleverError: Schema.optional<Schema.Struct<{
|
|
134
|
+
readonly errorCode: Schema.optional<Schema.Number>;
|
|
135
|
+
readonly lineNumber: Schema.optional<Schema.Number>;
|
|
136
|
+
readonly constantName: Schema.optional<Schema.String>;
|
|
137
|
+
readonly constantType: Schema.optional<Schema.String>;
|
|
138
|
+
readonly value: Schema.optional<Schema.String>;
|
|
139
|
+
}>>;
|
|
140
|
+
}>;
|
|
141
|
+
}>, Schema.Struct<{
|
|
142
|
+
readonly $kind: Schema.Literal<"SizeError">;
|
|
143
|
+
readonly SizeError: Schema.Struct<{
|
|
144
|
+
readonly name: Schema.String;
|
|
145
|
+
readonly size: Schema.Number;
|
|
146
|
+
readonly maxSize: Schema.Number;
|
|
147
|
+
}>;
|
|
148
|
+
}>, Schema.Struct<{
|
|
149
|
+
readonly $kind: Schema.Literal<"CommandArgumentError">;
|
|
150
|
+
readonly CommandArgumentError: Schema.Struct<{
|
|
151
|
+
readonly argument: Schema.Number;
|
|
152
|
+
readonly name: Schema.String;
|
|
153
|
+
}>;
|
|
154
|
+
}>, Schema.Struct<{
|
|
155
|
+
readonly $kind: Schema.Literal<"TypeArgumentError">;
|
|
156
|
+
readonly TypeArgumentError: Schema.Struct<{
|
|
157
|
+
readonly typeArgument: Schema.Number;
|
|
158
|
+
readonly name: Schema.String;
|
|
159
|
+
}>;
|
|
160
|
+
}>, Schema.Struct<{
|
|
161
|
+
readonly $kind: Schema.Literal<"PackageUpgradeError">;
|
|
162
|
+
readonly PackageUpgradeError: Schema.Struct<{
|
|
163
|
+
readonly name: Schema.String;
|
|
164
|
+
readonly packageId: Schema.optional<Schema.String>;
|
|
165
|
+
readonly digest: Schema.optional<Schema.String>;
|
|
166
|
+
}>;
|
|
167
|
+
}>, Schema.Struct<{
|
|
168
|
+
readonly $kind: Schema.Literal<"IndexError">;
|
|
169
|
+
readonly IndexError: Schema.Struct<{
|
|
170
|
+
readonly index: Schema.optional<Schema.Number>;
|
|
171
|
+
readonly subresult: Schema.optional<Schema.Number>;
|
|
172
|
+
}>;
|
|
173
|
+
}>, Schema.Struct<{
|
|
174
|
+
readonly $kind: Schema.Literal<"CoinDenyListError">;
|
|
175
|
+
readonly CoinDenyListError: Schema.Struct<{
|
|
176
|
+
readonly name: Schema.String;
|
|
177
|
+
readonly coinType: Schema.String;
|
|
178
|
+
readonly address: Schema.optional<Schema.String>;
|
|
179
|
+
}>;
|
|
180
|
+
}>, Schema.Struct<{
|
|
181
|
+
readonly $kind: Schema.Literal<"CongestedObjects">;
|
|
182
|
+
readonly CongestedObjects: Schema.Struct<{
|
|
183
|
+
readonly name: Schema.String;
|
|
184
|
+
readonly objects: Schema.$Array<Schema.String>;
|
|
185
|
+
}>;
|
|
186
|
+
}>, Schema.Struct<{
|
|
187
|
+
readonly $kind: Schema.Literal<"ObjectIdError">;
|
|
188
|
+
readonly ObjectIdError: Schema.Struct<{
|
|
189
|
+
readonly name: Schema.optional<Schema.String>;
|
|
190
|
+
readonly objectId: Schema.String;
|
|
191
|
+
}>;
|
|
192
|
+
}>, Schema.Struct<{
|
|
193
|
+
readonly $kind: Schema.Literal<"Unknown">;
|
|
194
|
+
}>]>;
|
|
195
|
+
readonly message: Schema.String;
|
|
196
|
+
}>, import("effect/Cause").YieldableError>;
|
|
197
|
+
/** Simulation reported an execution failure. No gas was charged. */
|
|
198
|
+
export declare class SimulationFailed extends SimulationFailed_base {
|
|
199
|
+
}
|
|
200
|
+
declare const ExecutionFailed_base: Schema.Class<ExecutionFailed, Schema.TaggedStruct<"ExecutionFailed", {
|
|
201
|
+
readonly digest: Schema.brand<Schema.String, "Digest">;
|
|
202
|
+
readonly reason: Schema.toTaggedUnion<"$kind", readonly [Schema.Struct<{
|
|
203
|
+
readonly $kind: Schema.Literal<"MoveAbort">;
|
|
204
|
+
readonly MoveAbort: Schema.Struct<{
|
|
205
|
+
readonly abortCode: Schema.BigIntFromString;
|
|
206
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
207
|
+
readonly package: Schema.optional<Schema.String>;
|
|
208
|
+
readonly module: Schema.optional<Schema.String>;
|
|
209
|
+
readonly function: Schema.optional<Schema.Number>;
|
|
210
|
+
readonly functionName: Schema.optional<Schema.String>;
|
|
211
|
+
readonly instruction: Schema.optional<Schema.Number>;
|
|
212
|
+
}>>;
|
|
213
|
+
readonly cleverError: Schema.optional<Schema.Struct<{
|
|
214
|
+
readonly errorCode: Schema.optional<Schema.Number>;
|
|
215
|
+
readonly lineNumber: Schema.optional<Schema.Number>;
|
|
216
|
+
readonly constantName: Schema.optional<Schema.String>;
|
|
217
|
+
readonly constantType: Schema.optional<Schema.String>;
|
|
218
|
+
readonly value: Schema.optional<Schema.String>;
|
|
219
|
+
}>>;
|
|
220
|
+
}>;
|
|
221
|
+
}>, Schema.Struct<{
|
|
222
|
+
readonly $kind: Schema.Literal<"SizeError">;
|
|
223
|
+
readonly SizeError: Schema.Struct<{
|
|
224
|
+
readonly name: Schema.String;
|
|
225
|
+
readonly size: Schema.Number;
|
|
226
|
+
readonly maxSize: Schema.Number;
|
|
227
|
+
}>;
|
|
228
|
+
}>, Schema.Struct<{
|
|
229
|
+
readonly $kind: Schema.Literal<"CommandArgumentError">;
|
|
230
|
+
readonly CommandArgumentError: Schema.Struct<{
|
|
231
|
+
readonly argument: Schema.Number;
|
|
232
|
+
readonly name: Schema.String;
|
|
233
|
+
}>;
|
|
234
|
+
}>, Schema.Struct<{
|
|
235
|
+
readonly $kind: Schema.Literal<"TypeArgumentError">;
|
|
236
|
+
readonly TypeArgumentError: Schema.Struct<{
|
|
237
|
+
readonly typeArgument: Schema.Number;
|
|
238
|
+
readonly name: Schema.String;
|
|
239
|
+
}>;
|
|
240
|
+
}>, Schema.Struct<{
|
|
241
|
+
readonly $kind: Schema.Literal<"PackageUpgradeError">;
|
|
242
|
+
readonly PackageUpgradeError: Schema.Struct<{
|
|
243
|
+
readonly name: Schema.String;
|
|
244
|
+
readonly packageId: Schema.optional<Schema.String>;
|
|
245
|
+
readonly digest: Schema.optional<Schema.String>;
|
|
246
|
+
}>;
|
|
247
|
+
}>, Schema.Struct<{
|
|
248
|
+
readonly $kind: Schema.Literal<"IndexError">;
|
|
249
|
+
readonly IndexError: Schema.Struct<{
|
|
250
|
+
readonly index: Schema.optional<Schema.Number>;
|
|
251
|
+
readonly subresult: Schema.optional<Schema.Number>;
|
|
252
|
+
}>;
|
|
253
|
+
}>, Schema.Struct<{
|
|
254
|
+
readonly $kind: Schema.Literal<"CoinDenyListError">;
|
|
255
|
+
readonly CoinDenyListError: Schema.Struct<{
|
|
256
|
+
readonly name: Schema.String;
|
|
257
|
+
readonly coinType: Schema.String;
|
|
258
|
+
readonly address: Schema.optional<Schema.String>;
|
|
259
|
+
}>;
|
|
260
|
+
}>, Schema.Struct<{
|
|
261
|
+
readonly $kind: Schema.Literal<"CongestedObjects">;
|
|
262
|
+
readonly CongestedObjects: Schema.Struct<{
|
|
263
|
+
readonly name: Schema.String;
|
|
264
|
+
readonly objects: Schema.$Array<Schema.String>;
|
|
265
|
+
}>;
|
|
266
|
+
}>, Schema.Struct<{
|
|
267
|
+
readonly $kind: Schema.Literal<"ObjectIdError">;
|
|
268
|
+
readonly ObjectIdError: Schema.Struct<{
|
|
269
|
+
readonly name: Schema.optional<Schema.String>;
|
|
270
|
+
readonly objectId: Schema.String;
|
|
271
|
+
}>;
|
|
272
|
+
}>, Schema.Struct<{
|
|
273
|
+
readonly $kind: Schema.Literal<"Unknown">;
|
|
274
|
+
}>]>;
|
|
275
|
+
readonly command: Schema.optional<Schema.Number>;
|
|
276
|
+
readonly effects: Schema.Struct<{
|
|
277
|
+
readonly version: Schema.Number;
|
|
278
|
+
readonly status: Schema.Struct<{
|
|
279
|
+
readonly success: Schema.Boolean;
|
|
280
|
+
}>;
|
|
281
|
+
readonly gasUsed: Schema.Struct<{
|
|
282
|
+
readonly computationCost: Schema.brand<Schema.BigIntFromString, "Mist">;
|
|
283
|
+
readonly storageCost: Schema.brand<Schema.BigIntFromString, "Mist">;
|
|
284
|
+
readonly storageRebate: Schema.brand<Schema.BigIntFromString, "Mist">;
|
|
285
|
+
readonly nonRefundableStorageFee: Schema.brand<Schema.BigIntFromString, "Mist">;
|
|
286
|
+
}>;
|
|
287
|
+
readonly transactionDigest: Schema.brand<Schema.String, "Digest">;
|
|
288
|
+
readonly gasObject: Schema.NullOr<Schema.Struct<{
|
|
289
|
+
readonly objectId: Schema.brand<Schema.decodeTo<Schema.toType<Schema.String>, Schema.String, never, never>, "ObjectId">;
|
|
290
|
+
readonly inputState: Schema.Literals<readonly ["Unknown", "DoesNotExist", "Exists"]>;
|
|
291
|
+
readonly inputVersion: Schema.NullOr<Schema.brand<Schema.BigIntFromString, "Version">>;
|
|
292
|
+
readonly inputDigest: Schema.NullOr<Schema.String>;
|
|
293
|
+
readonly inputOwner: Schema.NullOr<Schema.toTaggedUnion<"$kind", readonly [Schema.Struct<{
|
|
294
|
+
readonly $kind: Schema.Literal<"AddressOwner">;
|
|
295
|
+
readonly AddressOwner: Schema.brand<Schema.decodeTo<Schema.toType<Schema.String>, Schema.String, never, never>, "SuiAddress">;
|
|
296
|
+
}>, Schema.Struct<{
|
|
297
|
+
readonly $kind: Schema.Literal<"ObjectOwner">;
|
|
298
|
+
readonly ObjectOwner: Schema.brand<Schema.decodeTo<Schema.toType<Schema.String>, Schema.String, never, never>, "ObjectId">;
|
|
299
|
+
}>, Schema.Struct<{
|
|
300
|
+
readonly $kind: Schema.Literal<"Shared">;
|
|
301
|
+
readonly Shared: Schema.Struct<{
|
|
302
|
+
readonly initialSharedVersion: Schema.brand<Schema.BigIntFromString, "Version">;
|
|
303
|
+
}>;
|
|
304
|
+
}>, Schema.Struct<{
|
|
305
|
+
readonly $kind: Schema.Literal<"Immutable">;
|
|
306
|
+
readonly Immutable: Schema.Literal<true>;
|
|
307
|
+
}>, Schema.Struct<{
|
|
308
|
+
readonly $kind: Schema.Literal<"ConsensusAddressOwner">;
|
|
309
|
+
readonly ConsensusAddressOwner: Schema.Struct<{
|
|
310
|
+
readonly startVersion: Schema.brand<Schema.BigIntFromString, "Version">;
|
|
311
|
+
readonly owner: Schema.brand<Schema.decodeTo<Schema.toType<Schema.String>, Schema.String, never, never>, "SuiAddress">;
|
|
312
|
+
}>;
|
|
313
|
+
}>, Schema.Struct<{
|
|
314
|
+
readonly $kind: Schema.Literal<"Unknown">;
|
|
315
|
+
}>]>>;
|
|
316
|
+
readonly outputState: Schema.Literals<readonly ["Unknown", "DoesNotExist", "ObjectWrite", "PackageWrite", "AccumulatorWriteV1"]>;
|
|
317
|
+
readonly outputVersion: Schema.NullOr<Schema.brand<Schema.BigIntFromString, "Version">>;
|
|
318
|
+
readonly outputDigest: Schema.NullOr<Schema.String>;
|
|
319
|
+
readonly outputOwner: Schema.NullOr<Schema.toTaggedUnion<"$kind", readonly [Schema.Struct<{
|
|
320
|
+
readonly $kind: Schema.Literal<"AddressOwner">;
|
|
321
|
+
readonly AddressOwner: Schema.brand<Schema.decodeTo<Schema.toType<Schema.String>, Schema.String, never, never>, "SuiAddress">;
|
|
322
|
+
}>, Schema.Struct<{
|
|
323
|
+
readonly $kind: Schema.Literal<"ObjectOwner">;
|
|
324
|
+
readonly ObjectOwner: Schema.brand<Schema.decodeTo<Schema.toType<Schema.String>, Schema.String, never, never>, "ObjectId">;
|
|
325
|
+
}>, Schema.Struct<{
|
|
326
|
+
readonly $kind: Schema.Literal<"Shared">;
|
|
327
|
+
readonly Shared: Schema.Struct<{
|
|
328
|
+
readonly initialSharedVersion: Schema.brand<Schema.BigIntFromString, "Version">;
|
|
329
|
+
}>;
|
|
330
|
+
}>, Schema.Struct<{
|
|
331
|
+
readonly $kind: Schema.Literal<"Immutable">;
|
|
332
|
+
readonly Immutable: Schema.Literal<true>;
|
|
333
|
+
}>, Schema.Struct<{
|
|
334
|
+
readonly $kind: Schema.Literal<"ConsensusAddressOwner">;
|
|
335
|
+
readonly ConsensusAddressOwner: Schema.Struct<{
|
|
336
|
+
readonly startVersion: Schema.brand<Schema.BigIntFromString, "Version">;
|
|
337
|
+
readonly owner: Schema.brand<Schema.decodeTo<Schema.toType<Schema.String>, Schema.String, never, never>, "SuiAddress">;
|
|
338
|
+
}>;
|
|
339
|
+
}>, Schema.Struct<{
|
|
340
|
+
readonly $kind: Schema.Literal<"Unknown">;
|
|
341
|
+
}>]>>;
|
|
342
|
+
readonly idOperation: Schema.Literals<readonly ["Unknown", "None", "Created", "Deleted"]>;
|
|
343
|
+
}>>;
|
|
344
|
+
readonly eventsDigest: Schema.NullOr<Schema.String>;
|
|
345
|
+
readonly dependencies: Schema.$Array<Schema.String>;
|
|
346
|
+
readonly lamportVersion: Schema.NullOr<Schema.brand<Schema.BigIntFromString, "Version">>;
|
|
347
|
+
readonly changedObjects: Schema.$Array<Schema.Struct<{
|
|
348
|
+
readonly objectId: Schema.brand<Schema.decodeTo<Schema.toType<Schema.String>, Schema.String, never, never>, "ObjectId">;
|
|
349
|
+
readonly inputState: Schema.Literals<readonly ["Unknown", "DoesNotExist", "Exists"]>;
|
|
350
|
+
readonly inputVersion: Schema.NullOr<Schema.brand<Schema.BigIntFromString, "Version">>;
|
|
351
|
+
readonly inputDigest: Schema.NullOr<Schema.String>;
|
|
352
|
+
readonly inputOwner: Schema.NullOr<Schema.toTaggedUnion<"$kind", readonly [Schema.Struct<{
|
|
353
|
+
readonly $kind: Schema.Literal<"AddressOwner">;
|
|
354
|
+
readonly AddressOwner: Schema.brand<Schema.decodeTo<Schema.toType<Schema.String>, Schema.String, never, never>, "SuiAddress">;
|
|
355
|
+
}>, Schema.Struct<{
|
|
356
|
+
readonly $kind: Schema.Literal<"ObjectOwner">;
|
|
357
|
+
readonly ObjectOwner: Schema.brand<Schema.decodeTo<Schema.toType<Schema.String>, Schema.String, never, never>, "ObjectId">;
|
|
358
|
+
}>, Schema.Struct<{
|
|
359
|
+
readonly $kind: Schema.Literal<"Shared">;
|
|
360
|
+
readonly Shared: Schema.Struct<{
|
|
361
|
+
readonly initialSharedVersion: Schema.brand<Schema.BigIntFromString, "Version">;
|
|
362
|
+
}>;
|
|
363
|
+
}>, Schema.Struct<{
|
|
364
|
+
readonly $kind: Schema.Literal<"Immutable">;
|
|
365
|
+
readonly Immutable: Schema.Literal<true>;
|
|
366
|
+
}>, Schema.Struct<{
|
|
367
|
+
readonly $kind: Schema.Literal<"ConsensusAddressOwner">;
|
|
368
|
+
readonly ConsensusAddressOwner: Schema.Struct<{
|
|
369
|
+
readonly startVersion: Schema.brand<Schema.BigIntFromString, "Version">;
|
|
370
|
+
readonly owner: Schema.brand<Schema.decodeTo<Schema.toType<Schema.String>, Schema.String, never, never>, "SuiAddress">;
|
|
371
|
+
}>;
|
|
372
|
+
}>, Schema.Struct<{
|
|
373
|
+
readonly $kind: Schema.Literal<"Unknown">;
|
|
374
|
+
}>]>>;
|
|
375
|
+
readonly outputState: Schema.Literals<readonly ["Unknown", "DoesNotExist", "ObjectWrite", "PackageWrite", "AccumulatorWriteV1"]>;
|
|
376
|
+
readonly outputVersion: Schema.NullOr<Schema.brand<Schema.BigIntFromString, "Version">>;
|
|
377
|
+
readonly outputDigest: Schema.NullOr<Schema.String>;
|
|
378
|
+
readonly outputOwner: Schema.NullOr<Schema.toTaggedUnion<"$kind", readonly [Schema.Struct<{
|
|
379
|
+
readonly $kind: Schema.Literal<"AddressOwner">;
|
|
380
|
+
readonly AddressOwner: Schema.brand<Schema.decodeTo<Schema.toType<Schema.String>, Schema.String, never, never>, "SuiAddress">;
|
|
381
|
+
}>, Schema.Struct<{
|
|
382
|
+
readonly $kind: Schema.Literal<"ObjectOwner">;
|
|
383
|
+
readonly ObjectOwner: Schema.brand<Schema.decodeTo<Schema.toType<Schema.String>, Schema.String, never, never>, "ObjectId">;
|
|
384
|
+
}>, Schema.Struct<{
|
|
385
|
+
readonly $kind: Schema.Literal<"Shared">;
|
|
386
|
+
readonly Shared: Schema.Struct<{
|
|
387
|
+
readonly initialSharedVersion: Schema.brand<Schema.BigIntFromString, "Version">;
|
|
388
|
+
}>;
|
|
389
|
+
}>, Schema.Struct<{
|
|
390
|
+
readonly $kind: Schema.Literal<"Immutable">;
|
|
391
|
+
readonly Immutable: Schema.Literal<true>;
|
|
392
|
+
}>, Schema.Struct<{
|
|
393
|
+
readonly $kind: Schema.Literal<"ConsensusAddressOwner">;
|
|
394
|
+
readonly ConsensusAddressOwner: Schema.Struct<{
|
|
395
|
+
readonly startVersion: Schema.brand<Schema.BigIntFromString, "Version">;
|
|
396
|
+
readonly owner: Schema.brand<Schema.decodeTo<Schema.toType<Schema.String>, Schema.String, never, never>, "SuiAddress">;
|
|
397
|
+
}>;
|
|
398
|
+
}>, Schema.Struct<{
|
|
399
|
+
readonly $kind: Schema.Literal<"Unknown">;
|
|
400
|
+
}>]>>;
|
|
401
|
+
readonly idOperation: Schema.Literals<readonly ["Unknown", "None", "Created", "Deleted"]>;
|
|
402
|
+
}>>;
|
|
403
|
+
readonly unchangedConsensusObjects: Schema.$Array<Schema.Struct<{
|
|
404
|
+
readonly kind: Schema.Literals<readonly ["Unknown", "ReadOnlyRoot", "MutateConsensusStreamEnded", "ReadConsensusStreamEnded", "Cancelled", "PerEpochConfig"]>;
|
|
405
|
+
readonly objectId: Schema.brand<Schema.decodeTo<Schema.toType<Schema.String>, Schema.String, never, never>, "ObjectId">;
|
|
406
|
+
readonly version: Schema.NullOr<Schema.brand<Schema.BigIntFromString, "Version">>;
|
|
407
|
+
readonly digest: Schema.NullOr<Schema.String>;
|
|
408
|
+
}>>;
|
|
409
|
+
readonly auxiliaryDataDigest: Schema.NullOr<Schema.String>;
|
|
410
|
+
}>;
|
|
411
|
+
}>, import("effect/Cause").YieldableError>;
|
|
412
|
+
/** The transaction was applied on chain and failed. Gas was charged. */
|
|
413
|
+
export declare class ExecutionFailed extends ExecutionFailed_base {
|
|
414
|
+
}
|
|
415
|
+
declare const SubmissionUnknown_base: Schema.Class<SubmissionUnknown, Schema.TaggedStruct<"SubmissionUnknown", {
|
|
416
|
+
readonly digest: Schema.brand<Schema.String, "Digest">;
|
|
417
|
+
readonly signed: Schema.optional<Schema.Struct<{
|
|
418
|
+
readonly digest: Schema.brand<Schema.String, "Digest">;
|
|
419
|
+
readonly bytes: Schema.Uint8ArrayFromBase64;
|
|
420
|
+
readonly signatures: Schema.$Array<Schema.brand<Schema.String, "Signature">>;
|
|
421
|
+
readonly sender: Schema.brand<Schema.decodeTo<Schema.toType<Schema.String>, Schema.String, never, never>, "SuiAddress">;
|
|
422
|
+
readonly expiration: Schema.optional<Schema.toTaggedUnion<"$kind", readonly [Schema.Struct<{
|
|
423
|
+
readonly $kind: Schema.Literal<"None">;
|
|
424
|
+
readonly None: Schema.Literal<true>;
|
|
425
|
+
}>, Schema.Struct<{
|
|
426
|
+
readonly $kind: Schema.Literal<"Epoch">;
|
|
427
|
+
readonly Epoch: Schema.decodeTo<Schema.BigInt, Schema.Union<readonly [Schema.String, Schema.Number]>, never, never>;
|
|
428
|
+
}>, Schema.Struct<{
|
|
429
|
+
readonly $kind: Schema.Literal<"ValidDuring">;
|
|
430
|
+
readonly ValidDuring: Schema.Struct<{
|
|
431
|
+
readonly minEpoch: Schema.NullOr<Schema.decodeTo<Schema.BigInt, Schema.Union<readonly [Schema.String, Schema.Number]>, never, never>>;
|
|
432
|
+
readonly maxEpoch: Schema.NullOr<Schema.decodeTo<Schema.BigInt, Schema.Union<readonly [Schema.String, Schema.Number]>, never, never>>;
|
|
433
|
+
readonly minTimestamp: Schema.NullOr<Schema.decodeTo<Schema.BigInt, Schema.Union<readonly [Schema.String, Schema.Number]>, never, never>>;
|
|
434
|
+
readonly maxTimestamp: Schema.NullOr<Schema.decodeTo<Schema.BigInt, Schema.Union<readonly [Schema.String, Schema.Number]>, never, never>>;
|
|
435
|
+
readonly chain: Schema.String;
|
|
436
|
+
readonly nonce: Schema.Number;
|
|
437
|
+
}>;
|
|
438
|
+
}>, Schema.Struct<{
|
|
439
|
+
readonly $kind: Schema.Literal<"Validity">;
|
|
440
|
+
readonly Validity: Schema.Struct<{
|
|
441
|
+
readonly allowedProposers: Schema.NullOr<Schema.Struct<{
|
|
442
|
+
readonly epoch: Schema.decodeTo<Schema.BigInt, Schema.Union<readonly [Schema.String, Schema.Number]>, never, never>;
|
|
443
|
+
readonly proposers: Schema.$Array<Schema.Number>;
|
|
444
|
+
}>>;
|
|
445
|
+
readonly minEpoch: Schema.NullOr<Schema.decodeTo<Schema.BigInt, Schema.Union<readonly [Schema.String, Schema.Number]>, never, never>>;
|
|
446
|
+
readonly maxEpoch: Schema.NullOr<Schema.decodeTo<Schema.BigInt, Schema.Union<readonly [Schema.String, Schema.Number]>, never, never>>;
|
|
447
|
+
readonly minTimestamp: Schema.NullOr<Schema.decodeTo<Schema.BigInt, Schema.Union<readonly [Schema.String, Schema.Number]>, never, never>>;
|
|
448
|
+
readonly maxTimestamp: Schema.NullOr<Schema.decodeTo<Schema.BigInt, Schema.Union<readonly [Schema.String, Schema.Number]>, never, never>>;
|
|
449
|
+
readonly chain: Schema.String;
|
|
450
|
+
readonly nonce: Schema.Number;
|
|
451
|
+
}>;
|
|
452
|
+
}>]>>;
|
|
453
|
+
readonly chain: Schema.optional<Schema.String>;
|
|
454
|
+
}>>;
|
|
455
|
+
readonly cause: Schema.Defect;
|
|
456
|
+
}>, import("effect/Cause").YieldableError>;
|
|
457
|
+
/**
|
|
458
|
+
* Bytes may have reached the network and the outcome is unknown. Carries the
|
|
459
|
+
* signed transaction so an operator or a later process can reconcile it.
|
|
460
|
+
*/
|
|
461
|
+
export declare class SubmissionUnknown extends SubmissionUnknown_base {
|
|
462
|
+
}
|
|
463
|
+
declare const NotApplied_base: Schema.Class<NotApplied, Schema.TaggedStruct<"NotApplied", {
|
|
464
|
+
readonly digest: Schema.brand<Schema.String, "Digest">;
|
|
465
|
+
readonly evidence: Schema.Literals<readonly ["expired", "inputConsumed"]>;
|
|
466
|
+
}>, import("effect/Cause").YieldableError>;
|
|
467
|
+
/**
|
|
468
|
+
* The transaction provably cannot have been applied, and never will be.
|
|
469
|
+
*
|
|
470
|
+
* `evidence` is why. `"inputConsumed"` is only ever produced when a
|
|
471
|
+
* **different** transaction's own effects report that it took a pinned object
|
|
472
|
+
* at exactly the version these bytes pinned. An owned input that merely moved
|
|
473
|
+
* on, one whose consumer took a later version, and one whose last mutation the
|
|
474
|
+
* node will not name are all `SubmissionUnknown`, not this.
|
|
475
|
+
*/
|
|
476
|
+
export declare class NotApplied extends NotApplied_base {
|
|
477
|
+
}
|
|
478
|
+
declare const SigningError_base: Schema.Class<SigningError, Schema.TaggedStruct<"SigningError", {
|
|
479
|
+
readonly cause: Schema.Defect;
|
|
480
|
+
}>, import("effect/Cause").YieldableError>;
|
|
481
|
+
/** A signer refused or failed to produce a signature. */
|
|
482
|
+
export declare class SigningError extends SigningError_base {
|
|
483
|
+
}
|
|
484
|
+
declare const BuildError_base: Schema.Class<BuildError, Schema.TaggedStruct<"BuildError", {
|
|
485
|
+
readonly message: Schema.String;
|
|
486
|
+
readonly cause: Schema.Defect;
|
|
487
|
+
}>, import("effect/Cause").YieldableError>;
|
|
488
|
+
/** The transaction could not be built into bytes. */
|
|
489
|
+
export declare class BuildError extends BuildError_base {
|
|
490
|
+
}
|
|
491
|
+
declare const PolicyDenied_base: Schema.Class<PolicyDenied, Schema.TaggedStruct<"PolicyDenied", {
|
|
492
|
+
readonly rule: Schema.String;
|
|
493
|
+
readonly message: Schema.String;
|
|
494
|
+
}>, import("effect/Cause").YieldableError>;
|
|
495
|
+
/** A preflight policy refused the transaction before it was signed. */
|
|
496
|
+
export declare class PolicyDenied extends PolicyDenied_base {
|
|
497
|
+
}
|
|
498
|
+
declare const JournalError_base: Schema.Class<JournalError, Schema.TaggedStruct<"JournalError", {
|
|
499
|
+
readonly cause: Schema.Defect;
|
|
500
|
+
}>, import("effect/Cause").YieldableError>;
|
|
501
|
+
/** The submission journal could not be read or written. */
|
|
502
|
+
export declare class JournalError extends JournalError_base {
|
|
503
|
+
}
|
|
504
|
+
declare const UnexpectedEffects_base: Schema.Class<UnexpectedEffects, Schema.TaggedStruct<"UnexpectedEffects", {
|
|
505
|
+
readonly digest: Schema.brand<Schema.String, "Digest">;
|
|
506
|
+
readonly expected: Schema.String;
|
|
507
|
+
readonly found: Schema.$Array<Schema.brand<Schema.decodeTo<Schema.toType<Schema.String>, Schema.String, never, never>, "ObjectId">>;
|
|
508
|
+
}>, import("effect/Cause").YieldableError>;
|
|
509
|
+
/**
|
|
510
|
+
* The effects of an applied transaction did not contain what the caller
|
|
511
|
+
* expected.
|
|
512
|
+
*
|
|
513
|
+
* Outcome `applied`, and exit 5: this error can only come from an `Executed`,
|
|
514
|
+
* which means the transaction reached the chain and gas was charged. What is
|
|
515
|
+
* missing is a receipt, not the transaction. Classifying it `not_applied`
|
|
516
|
+
* would tell the documented retry idiom to send the caller's intent a second
|
|
517
|
+
* time for a transaction that already ran.
|
|
518
|
+
*/
|
|
519
|
+
export declare class UnexpectedEffects extends UnexpectedEffects_base {
|
|
520
|
+
}
|
|
521
|
+
declare const GraphQLUnavailable_base: Schema.Class<GraphQLUnavailable, Schema.TaggedStruct<"GraphQLUnavailable", {
|
|
522
|
+
readonly method: Schema.String;
|
|
523
|
+
readonly reason: Schema.String;
|
|
524
|
+
}>, import("effect/Cause").YieldableError>;
|
|
525
|
+
/**
|
|
526
|
+
* The GraphQL endpoint an extension needs is not usable: none was configured,
|
|
527
|
+
* or the one that was could not be reached.
|
|
528
|
+
*
|
|
529
|
+
* sui-effect does not wrap the GraphQL API — it owns the {@link SuiGraphQL}
|
|
530
|
+
* *tag*, so two extensions that both read GraphQL share one client rather than
|
|
531
|
+
* opening two. This is the failure the tag's `layerUnavailable` produces, which
|
|
532
|
+
* is what an application provides when it has no endpoint: every call rejects
|
|
533
|
+
* with this instead of the extension discovering a missing dependency at
|
|
534
|
+
* construction. An extension maps it into its own union, or lets it through.
|
|
535
|
+
*
|
|
536
|
+
* Outcome `not_applied`: a read that did not happen changed nothing.
|
|
537
|
+
*/
|
|
538
|
+
export declare class GraphQLUnavailable extends GraphQLUnavailable_base {
|
|
539
|
+
}
|
|
540
|
+
declare const ExtensionNotReady_base: Schema.Class<ExtensionNotReady, Schema.TaggedStruct<"ExtensionNotReady", {
|
|
541
|
+
readonly extension: Schema.String;
|
|
542
|
+
readonly member: Schema.String;
|
|
543
|
+
}>, import("effect/Cause").YieldableError>;
|
|
544
|
+
/**
|
|
545
|
+
* A synchronous member of a Promise-faced extension was called before its
|
|
546
|
+
* runtime existed.
|
|
547
|
+
*
|
|
548
|
+
* `SuiExtension.fromService` builds its `ManagedRuntime` on first use, so until
|
|
549
|
+
* something has been awaited there is no service object and no synchronous
|
|
550
|
+
* member to read. Rather than hand back a Promise where the type says a value,
|
|
551
|
+
* the face throws this. Two cures, both in the extension's own hands:
|
|
552
|
+
* `await client.<name>.$ready()` once after registering, or register with
|
|
553
|
+
* `warm`, which builds the runtime inside `register` and makes every member
|
|
554
|
+
* real immediately.
|
|
555
|
+
*
|
|
556
|
+
* Outcome `not_applied`: nothing was sent.
|
|
557
|
+
*/
|
|
558
|
+
export declare class ExtensionNotReady extends ExtensionNotReady_base {
|
|
559
|
+
}
|
|
560
|
+
/** Every failure sui-effect can produce. */
|
|
561
|
+
export type SuiError = TransportError | ObjectNotFound | ObjectDeleted | ObjectUnavailable | TransactionNotFound | NetworkMismatch | DecodeError | SimulationFailed | ExecutionFailed | SubmissionUnknown | NotApplied | SigningError | BuildError | PolicyDenied | JournalError | UnexpectedEffects | GraphQLUnavailable | ExtensionNotReady;
|
|
562
|
+
/** The schema of the whole taxonomy, used for serialization. */
|
|
563
|
+
export declare const SuiErrorSchema: Schema.Union<readonly [typeof TransportError, typeof ObjectNotFound, typeof ObjectDeleted, typeof ObjectUnavailable, typeof TransactionNotFound, typeof NetworkMismatch, typeof DecodeError, typeof SimulationFailed, typeof ExecutionFailed, typeof SubmissionUnknown, typeof NotApplied, typeof SigningError, typeof BuildError, typeof PolicyDenied, typeof JournalError, typeof UnexpectedEffects, typeof GraphQLUnavailable, typeof ExtensionNotReady]>;
|
|
564
|
+
/**
|
|
565
|
+
* What a failure says about the transaction it came from, on the axis a caller
|
|
566
|
+
* or a wrapper script acts on.
|
|
567
|
+
*/
|
|
568
|
+
export type Outcome = "applied" | "not_applied" | "unknown";
|
|
569
|
+
/**
|
|
570
|
+
* An extension error may declare its own `outcome`, and `SuiError.outcome` and
|
|
571
|
+
* `Script.run` honour it before anything else.
|
|
572
|
+
*
|
|
573
|
+
* An error that declares none and carries a tag the taxonomy does not own is
|
|
574
|
+
* `"unknown"`, not `"not_applied"`: a tag this library has never heard of says
|
|
575
|
+
* nothing about whether a transaction applied, and `"not_applied"` would tell
|
|
576
|
+
* the documented retry idiom to send again on no evidence at all.
|
|
577
|
+
*/
|
|
578
|
+
export interface HasOutcome {
|
|
579
|
+
readonly outcome: Outcome;
|
|
580
|
+
}
|
|
581
|
+
/**
|
|
582
|
+
* The four helpers every repo hand-rolls: is this worth retrying, did the
|
|
583
|
+
* transaction land, what does an operator need to read, and what goes in a log.
|
|
584
|
+
*/
|
|
585
|
+
export declare const SuiError: {
|
|
586
|
+
readonly isRetryable: (error: SuiError) => boolean;
|
|
587
|
+
readonly outcome: (error: SuiError | HasOutcome) => Outcome;
|
|
588
|
+
readonly describe: (error: SuiError) => string;
|
|
589
|
+
readonly toJson: (error: SuiError | {
|
|
590
|
+
readonly _tag: string;
|
|
591
|
+
}) => Record<string, unknown>;
|
|
592
|
+
};
|
|
593
|
+
/** The digest of the transaction a failure refers to, when it has one. */
|
|
594
|
+
export declare const digestOf: (error: SuiError) => Digest | undefined;
|
|
595
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/domain/errors.ts"],"names":[],"mappings":"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"}
|