@misofm/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/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2025 Miso Labs, Inc. (build@miso.network)
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,71 @@
1
+ # @misofm/effect
2
+
3
+ The shared Effect foundation for the Miso SDKs: one `SuiClient` service, one error
4
+ vocabulary, and the read/execute primitives every `@misofm/*` package's queries and
5
+ transaction builders are composed from.
6
+
7
+ Every other `@misofm/*` package depends on `@misofm/effect`, so there is exactly one
8
+ `SuiClient` service tag and one set of tagged errors across the SDKs — a program that
9
+ mixes primitives from `@misofm/musicos`, `@misofm/partyos`, and `@misofm/platform` still
10
+ needs only one `Effect.provide(SuiClient.layer(client))` at its boundary.
11
+
12
+ ## Use
13
+
14
+ ```ts
15
+ import { Effect } from "effect";
16
+ import { SuiGrpcClient } from "@mysten/sui/grpc";
17
+ import { SuiClient, getObjectContent } from "@misofm/effect";
18
+
19
+ const client = new SuiGrpcClient({ network: "testnet" });
20
+
21
+ const program = Effect.gen(function* () {
22
+ const object = yield* getObjectContent("0x...");
23
+ return object.type;
24
+ }).pipe(
25
+ // `ObjectNotFoundError` is a tagged failure, not a bare throw — recover
26
+ // from it without inspecting a message.
27
+ Effect.catchTag("ObjectNotFoundError", (error) =>
28
+ Effect.succeed(`missing: ${error.objectId}`),
29
+ ),
30
+ );
31
+
32
+ const type = await Effect.runPromise(
33
+ program.pipe(Effect.provide(SuiClient.layer(client))),
34
+ );
35
+ ```
36
+
37
+ `getObjectContent`, `getObjectsContent`, `getOptionalObjectContent`, `listDynamicFields`,
38
+ and `decodeBcs` all require the `SuiClient` service; `signAndExecute` and `execThunks`
39
+ additionally need a `Signer`. Provide `SuiClient.layer(client)` once at the edge of your
40
+ program — every primitive composed from these requires the service only once in `R`.
41
+
42
+ ## Errors
43
+
44
+ Every failure is a `Schema.TaggedError` carrying the fields a caller needs to act:
45
+ `ObjectNotFoundError { objectId }`, `ObjectTypeMismatchError { objectId, expected, actual }`,
46
+ `SuiRpcError { operation, cause }`, `BcsDecodeError { type, objectId?, cause }`,
47
+ `TransactionFailedError { digest, status }`, `GraphQLUnavailableError {}`, and
48
+ `DeploymentError { message }`. Recover from one with `Effect.catchTag("ObjectNotFoundError", ...)`
49
+ rather than an `isNotFound(error)` predicate.
50
+
51
+ ## Subpaths
52
+
53
+ | Subpath | Purpose |
54
+ | --------------------- | --------------------------------------------------------------- |
55
+ | `@misofm/effect` | Everything below, re-exported |
56
+ | `@misofm/effect/errors` | The `Schema.TaggedError` classes and the `SuiReadError` union |
57
+ | `@misofm/effect/sui-client` | The `SuiClient` and `SuiGraphQL` services + their layers |
58
+ | `@misofm/effect/reads` | `getObjectContent`, `getObjectsContent`, `getOptionalObjectContent`, `listDynamicFields`, `decodeBcs`, `assertObjectType` |
59
+ | `@misofm/effect/execute` | `buildTx`, `signAndExecute`, `execThunks`, and the pure `ExecResult` extractors |
60
+
61
+ ## Install
62
+
63
+ ```sh
64
+ bun add @misofm/effect effect @mysten/sui
65
+ ```
66
+
67
+ Peer dependencies: `effect@4.0.0-rc.112` and `@mysten/sui@2.29.0` (both exact).
68
+
69
+ ## License
70
+
71
+ Apache-2.0
@@ -0,0 +1,52 @@
1
+ import { Schema } from "effect";
2
+ import type { SuiClientTypes } from "@mysten/sui/client";
3
+ declare const ObjectNotFoundError_base: Schema.Class<ObjectNotFoundError, Schema.TaggedStruct<"ObjectNotFoundError", {
4
+ readonly objectId: Schema.String;
5
+ }>, import("effect/Cause").YieldableError>;
6
+ /** The requested object does not exist on-chain (never existed, was deleted, or has no such dynamic field). */
7
+ export declare class ObjectNotFoundError extends ObjectNotFoundError_base {
8
+ }
9
+ declare const ObjectTypeMismatchError_base: Schema.Class<ObjectTypeMismatchError, Schema.TaggedStruct<"ObjectTypeMismatchError", {
10
+ readonly objectId: Schema.String;
11
+ readonly expected: Schema.String;
12
+ readonly actual: Schema.String;
13
+ }>, import("effect/Cause").YieldableError>;
14
+ /** An object's on-chain type does not match the type the caller expected. */
15
+ export declare class ObjectTypeMismatchError extends ObjectTypeMismatchError_base {
16
+ }
17
+ declare const SuiRpcError_base: Schema.Class<SuiRpcError, Schema.TaggedStruct<"SuiRpcError", {
18
+ readonly operation: Schema.String;
19
+ readonly cause: Schema.Defect;
20
+ }>, import("effect/Cause").YieldableError>;
21
+ /** A Core API call threw or rejected for a reason other than a missing object. */
22
+ export declare class SuiRpcError extends SuiRpcError_base {
23
+ }
24
+ declare const BcsDecodeError_base: Schema.Class<BcsDecodeError, Schema.TaggedStruct<"BcsDecodeError", {
25
+ readonly type: Schema.String;
26
+ readonly objectId: Schema.optional<Schema.String>;
27
+ readonly cause: Schema.Defect;
28
+ }>, import("effect/Cause").YieldableError>;
29
+ /** A generated BCS codec's `.parse` threw, or the parsed value failed `Schema.decodeUnknown` into the domain type. */
30
+ export declare class BcsDecodeError extends BcsDecodeError_base {
31
+ }
32
+ declare const TransactionFailedError_base: Schema.Class<TransactionFailedError, Schema.TaggedStruct<"TransactionFailedError", {
33
+ readonly digest: Schema.String;
34
+ readonly status: Schema.declare<SuiClientTypes.ExecutionStatus, unknown>;
35
+ }>, import("effect/Cause").YieldableError>;
36
+ /** A submitted transaction executed but its on-chain effects reported failure. */
37
+ export declare class TransactionFailedError extends TransactionFailedError_base {
38
+ }
39
+ declare const GraphQLUnavailableError_base: Schema.Class<GraphQLUnavailableError, Schema.TaggedStruct<"GraphQLUnavailableError", {}>, import("effect/Cause").YieldableError>;
40
+ /** A `SuiGraphQL` read was requested but no GraphQL client is configured for this context. */
41
+ export declare class GraphQLUnavailableError extends GraphQLUnavailableError_base {
42
+ }
43
+ declare const DeploymentError_base: Schema.Class<DeploymentError, Schema.TaggedStruct<"DeploymentError", {
44
+ readonly message: Schema.String;
45
+ }>, import("effect/Cause").YieldableError>;
46
+ /** A deployment manifest failed validation (wrong shape, missing package id, unverified network, ...). */
47
+ export declare class DeploymentError extends DeploymentError_base {
48
+ }
49
+ /** The error union every `reads.ts` primitive can fail with. */
50
+ export type SuiReadError = ObjectNotFoundError | ObjectTypeMismatchError | SuiRpcError | BcsDecodeError;
51
+ export {};
52
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;;;;AAEzD,+GAA+G;AAC/G,qBAAa,mBAAoB,SAAQ,wBAEvC;CAAG;;;;;;AAEL,6EAA6E;AAC7E,qBAAa,uBAAwB,SAAQ,4BAO5C;CAAG;;;;;AAEJ,kFAAkF;AAClF,qBAAa,WAAY,SAAQ,gBAG/B;CAAG;;;;;;AAEL,sHAAsH;AACtH,qBAAa,cAAe,SAAQ,mBAIlC;CAAG;;;;;AAEL,kFAAkF;AAClF,qBAAa,sBAAuB,SAAQ,2BAG1C;CAAG;;AAEL,8FAA8F;AAC9F,qBAAa,uBAAwB,SAAQ,4BAG5C;CAAG;;;;AAEJ,0GAA0G;AAC1G,qBAAa,eAAgB,SAAQ,oBAEnC;CAAG;AAEL,gEAAgE;AAChE,MAAM,MAAM,YAAY,GAAG,mBAAmB,GAAG,uBAAuB,GAAG,WAAW,GAAG,cAAc,CAAC"}
package/dist/errors.js ADDED
@@ -0,0 +1,48 @@
1
+ // Copyright (c) Miso Labs, Inc.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ // The shared error vocabulary for every `@misofm/*` SDK. Every failure a caller
4
+ // might need to act on is a `Schema.TaggedError`, carrying the fields needed to
5
+ // act (object id, type, package, cause) rather than a bare message. Foreign
6
+ // failures (RPC rejections, thrown parsers) are wrapped with `cause: Schema.Defect()`
7
+ // so the original error is preserved but not part of the typed contract.
8
+ import { Schema } from "effect";
9
+ /** The requested object does not exist on-chain (never existed, was deleted, or has no such dynamic field). */
10
+ export class ObjectNotFoundError extends Schema.TaggedError()("ObjectNotFoundError", {
11
+ objectId: Schema.String,
12
+ }) {
13
+ }
14
+ /** An object's on-chain type does not match the type the caller expected. */
15
+ export class ObjectTypeMismatchError extends Schema.TaggedError()("ObjectTypeMismatchError", {
16
+ objectId: Schema.String,
17
+ expected: Schema.String,
18
+ actual: Schema.String,
19
+ }) {
20
+ }
21
+ /** A Core API call threw or rejected for a reason other than a missing object. */
22
+ export class SuiRpcError extends Schema.TaggedError()("SuiRpcError", {
23
+ operation: Schema.String,
24
+ cause: Schema.Defect(),
25
+ }) {
26
+ }
27
+ /** A generated BCS codec's `.parse` threw, or the parsed value failed `Schema.decodeUnknown` into the domain type. */
28
+ export class BcsDecodeError extends Schema.TaggedError()("BcsDecodeError", {
29
+ type: Schema.String,
30
+ objectId: Schema.optional(Schema.String),
31
+ cause: Schema.Defect(),
32
+ }) {
33
+ }
34
+ /** A submitted transaction executed but its on-chain effects reported failure. */
35
+ export class TransactionFailedError extends Schema.TaggedError()("TransactionFailedError", {
36
+ digest: Schema.String,
37
+ status: Schema.declare((u) => true),
38
+ }) {
39
+ }
40
+ /** A `SuiGraphQL` read was requested but no GraphQL client is configured for this context. */
41
+ export class GraphQLUnavailableError extends Schema.TaggedError()("GraphQLUnavailableError", {}) {
42
+ }
43
+ /** A deployment manifest failed validation (wrong shape, missing package id, unverified network, ...). */
44
+ export class DeploymentError extends Schema.TaggedError()("DeploymentError", {
45
+ message: Schema.String,
46
+ }) {
47
+ }
48
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,sCAAsC;AAEtC,gFAAgF;AAChF,gFAAgF;AAChF,4EAA4E;AAC5E,sFAAsF;AACtF,yEAAyE;AAEzE,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,C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EAAmB,CAAC,iBAAiB,EAAE;IAC5F,OAAO,EAAE,MAAM,CAAC,MAAM;CACvB,CAAC;CAAG"}
@@ -0,0 +1,54 @@
1
+ import { Effect } from "effect";
2
+ import { Transaction } from "@mysten/sui/transactions";
3
+ import type { SuiClientTypes } from "@mysten/sui/client";
4
+ import type { Signer } from "@mysten/sui/cryptography";
5
+ import { SuiRpcError, TransactionFailedError } from "./errors.ts";
6
+ import { SuiClient } from "./sui-client.ts";
7
+ /** A function that appends commands to a caller-owned `Transaction`; may be async. */
8
+ export type TxThunk = (tx: Transaction) => void | Promise<void>;
9
+ /** The effect fields every submit path requests, so extraction is uniform. */
10
+ export declare const FULL_INCLUDE: {
11
+ readonly effects: true;
12
+ readonly objectTypes: true;
13
+ readonly balanceChanges: true;
14
+ };
15
+ type FullInclude = typeof FULL_INCLUDE;
16
+ /** The normalized outcome of a successfully-executed transaction. */
17
+ export interface ExecResult {
18
+ digest: string;
19
+ /** Objects created/mutated/deleted by the transaction. */
20
+ changedObjects: SuiClientTypes.ChangedObject[];
21
+ /** Map of changed objectId → fully-qualified type. */
22
+ objectTypes: Record<string, string>;
23
+ /** Net coin balance deltas by address. */
24
+ balanceChanges: SuiClientTypes.BalanceChange[];
25
+ /** Net gas cost in MIST (computation + storage − rebate). */
26
+ gasUsed: number;
27
+ }
28
+ /** Builds a fresh `Transaction` from one or more thunks (awaiting async ones); never fails. */
29
+ export declare const buildTx: (...args: any[]) => Effect.Effect<Transaction, never, never>;
30
+ /** Normalizes the `{ $kind }` transaction-result envelope into an {@link ExecResult}; throws on a failed status. */
31
+ export declare function toExecResult(res: SuiClientTypes.TransactionResult<FullInclude>): ExecResult;
32
+ /** Signs, executes, and waits for a transaction; fails with `TransactionFailedError` if its effects report failure. */
33
+ export declare const signAndExecute: (signer: Signer, tx: Transaction) => Effect.Effect<ExecResult, SuiRpcError | TransactionFailedError, SuiClient>;
34
+ /** Convenience: build from thunks, then sign+execute in one call. */
35
+ export declare const execThunks: (signer: Signer, ...thunks: TxThunk[]) => Effect.Effect<ExecResult, SuiRpcError | TransactionFailedError, SuiClient>;
36
+ /** The package id from the (single) newly-published package. */
37
+ export declare function publishedPackageId(r: ExecResult): string;
38
+ /** All package ids newly published by the transaction (up to 5 per PTB). */
39
+ export declare function allPublishedPackageIds(r: ExecResult): string[];
40
+ /** The first newly-created object whose type contains `substr`. */
41
+ export declare function createdByType(r: ExecResult, substr: string): string;
42
+ /** Like {@link createdByType} but returns undefined instead of throwing. */
43
+ export declare function maybeCreatedByType(r: ExecResult, substr: string): string | undefined;
44
+ /** The first newly-created object whose type is EXACTLY `type` (for non-generic types). */
45
+ export declare function createdByExactType(r: ExecResult, type: string): string;
46
+ /** All newly-created objects whose type contains `substr`. */
47
+ export declare function allCreatedByType(r: ExecResult, substr: string): {
48
+ objectId: string;
49
+ objectType: string;
50
+ }[];
51
+ /** The signed balance delta for `address` in `coinType`, or "0" if absent. */
52
+ export declare function balanceDelta(r: ExecResult, address: string, coinType: string): string;
53
+ export {};
54
+ //# sourceMappingURL=execute.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../src/execute.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,sFAAsF;AACtF,MAAM,MAAM,OAAO,GAAG,CAAC,EAAE,EAAE,WAAW,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAEhE,8EAA8E;AAC9E,eAAO,MAAM,YAAY;aAAK,O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EAAE,MAAM,EAAE,MAAM,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,EAAE,CAO1G;AAED,8EAA8E;AAC9E,wBAAgB,YAAY,CAAC,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAGrF"}
@@ -0,0 +1,131 @@
1
+ // Copyright (c) Miso Labs, Inc.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ // Transaction building + execution + effect extraction (the Signer-parameter
4
+ // pattern). Builders elsewhere only *append* to a caller-owned Transaction;
5
+ // this module is where a transaction is actually built and submitted.
6
+ // `signAndExecute` submits over the unified Core API, unwraps the
7
+ // `{ $kind: "Transaction", Transaction }` envelope, waits for finality, and
8
+ // returns changed objects, the objectId→type map, balance changes, and net gas
9
+ // for downstream extraction. Everything here is transport-agnostic — it
10
+ // requires only the `SuiClient` service, so gRPC / JSON-RPC / GraphQL clients
11
+ // all work.
12
+ import { Effect } from "effect";
13
+ import { Transaction } from "@mysten/sui/transactions";
14
+ import { SuiRpcError, TransactionFailedError } from "./errors.js";
15
+ import { SuiClient } from "./sui-client.js";
16
+ /** The effect fields every submit path requests, so extraction is uniform. */
17
+ export const FULL_INCLUDE = { effects: true, objectTypes: true, balanceChanges: true };
18
+ /** Builds a fresh `Transaction` from one or more thunks (awaiting async ones); never fails. */
19
+ export const buildTx = Effect.fn("buildTx")(function* (...thunks) {
20
+ const tx = new Transaction();
21
+ for (const thunk of thunks) {
22
+ yield* Effect.promise(() => Promise.resolve(thunk(tx)));
23
+ }
24
+ return tx;
25
+ });
26
+ /** Normalizes the `{ $kind }` transaction-result envelope into an {@link ExecResult}; throws on a failed status. */
27
+ export function toExecResult(res) {
28
+ if (res.$kind !== "Transaction") {
29
+ const failed = res.FailedTransaction;
30
+ const status = failed.effects?.status;
31
+ const err = status && !status.success ? JSON.stringify(status.error) : "unknown error";
32
+ throw new Error(`Transaction failed: ${err} (digest ${failed.digest})`);
33
+ }
34
+ const t = res.Transaction;
35
+ const effects = t.effects;
36
+ if (!effects.status.success) {
37
+ throw new Error(`Transaction reverted: ${JSON.stringify(effects.status.error)} (digest ${t.digest})`);
38
+ }
39
+ return {
40
+ digest: t.digest,
41
+ changedObjects: effects.changedObjects,
42
+ objectTypes: t.objectTypes ?? {},
43
+ balanceChanges: t.balanceChanges ?? [],
44
+ gasUsed: netGas(effects.gasUsed),
45
+ };
46
+ }
47
+ /** Signs, executes, and waits for a transaction; fails with `TransactionFailedError` if its effects report failure. */
48
+ export const signAndExecute = Effect.fn("signAndExecute")(function* (signer, tx) {
49
+ const client = yield* SuiClient;
50
+ const res = yield* Effect.tryPromise({
51
+ try: (signal) => client.core.signAndExecuteTransaction({ transaction: tx, signer, include: FULL_INCLUDE, signal }),
52
+ catch: (cause) => new SuiRpcError({ operation: "signAndExecuteTransaction", cause }),
53
+ });
54
+ const { digest, status } = statusOf(res);
55
+ if (!status.success) {
56
+ return yield* new TransactionFailedError({ digest, status });
57
+ }
58
+ const result = toExecResult(res);
59
+ yield* Effect.tryPromise({
60
+ try: (signal) => client.core.waitForTransaction({ digest: result.digest, signal }),
61
+ catch: (cause) => new SuiRpcError({ operation: "waitForTransaction", cause }),
62
+ });
63
+ return result;
64
+ });
65
+ /** Convenience: build from thunks, then sign+execute in one call. */
66
+ export const execThunks = Effect.fn("execThunks")(function* (signer, ...thunks) {
67
+ const tx = yield* buildTx(...thunks);
68
+ return yield* signAndExecute(signer, tx);
69
+ });
70
+ // ── Object-change extractors (pure) ─────────────────────────────────────────
71
+ /** The package id from the (single) newly-published package. */
72
+ export function publishedPackageId(r) {
73
+ const pkg = r.changedObjects.find((c) => c.idOperation === "Created" && c.outputState === "PackageWrite");
74
+ if (!pkg)
75
+ throw new Error("No published package found in object changes.");
76
+ return pkg.objectId;
77
+ }
78
+ /** All package ids newly published by the transaction (up to 5 per PTB). */
79
+ export function allPublishedPackageIds(r) {
80
+ return r.changedObjects
81
+ .filter((c) => c.idOperation === "Created" && c.outputState === "PackageWrite")
82
+ .map((c) => c.objectId);
83
+ }
84
+ /** The first newly-created object whose type contains `substr`. */
85
+ export function createdByType(r, substr) {
86
+ const id = maybeCreatedByType(r, substr);
87
+ if (!id)
88
+ throw new Error(`No created object with type containing "${substr}" found in object changes.`);
89
+ return id;
90
+ }
91
+ /** Like {@link createdByType} but returns undefined instead of throwing. */
92
+ export function maybeCreatedByType(r, substr) {
93
+ for (const c of r.changedObjects) {
94
+ if (c.idOperation === "Created" && (r.objectTypes[c.objectId] ?? "").includes(substr))
95
+ return c.objectId;
96
+ }
97
+ return undefined;
98
+ }
99
+ /** The first newly-created object whose type is EXACTLY `type` (for non-generic types). */
100
+ export function createdByExactType(r, type) {
101
+ for (const c of r.changedObjects) {
102
+ if (c.idOperation === "Created" && r.objectTypes[c.objectId] === type)
103
+ return c.objectId;
104
+ }
105
+ throw new Error(`No created object of exact type "${type}" found in object changes.`);
106
+ }
107
+ /** All newly-created objects whose type contains `substr`. */
108
+ export function allCreatedByType(r, substr) {
109
+ const out = [];
110
+ for (const c of r.changedObjects) {
111
+ const type = r.objectTypes[c.objectId] ?? "";
112
+ if (c.idOperation === "Created" && type.includes(substr))
113
+ out.push({ objectId: c.objectId, objectType: type });
114
+ }
115
+ return out;
116
+ }
117
+ /** The signed balance delta for `address` in `coinType`, or "0" if absent. */
118
+ export function balanceDelta(r, address, coinType) {
119
+ const change = r.balanceChanges.find((b) => b.address === address && b.coinType === coinType);
120
+ return change?.amount ?? "0";
121
+ }
122
+ // ── Private ──────────────────────────────────────────────────────────────────
123
+ /** The digest and top-level execution status of a `TransactionResult`, whichever `$kind` it is. */
124
+ function statusOf(res) {
125
+ const t = res.$kind === "Transaction" ? res.Transaction : res.FailedTransaction;
126
+ return { digest: t.digest, status: t.status };
127
+ }
128
+ function netGas(gasUsed) {
129
+ return Number(gasUsed.computationCost) + Number(gasUsed.storageCost) - Number(gasUsed.storageRebate);
130
+ }
131
+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GAAG,CAAC,KAAK,KAAK,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,iBAAiB,CAAC;IAChF,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;AAChD,CAAC;AAED,SAAS,MAAM,CAAC,OAAsC;IACpD,OAAO,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;AACvG,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from "./errors.ts";
2
+ export * from "./sui-client.ts";
3
+ export * from "./reads.ts";
4
+ export * from "./execute.ts";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,10 @@
1
+ // Copyright (c) Miso Labs, Inc.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ // `@misofm/effect` — the shared Effect foundation for the Miso SDKs: one
4
+ // `SuiClient` service, one error vocabulary, and the read/execute primitives
5
+ // every package's queries and transaction builders are composed from.
6
+ export * from "./errors.js";
7
+ export * from "./sui-client.js";
8
+ export * from "./reads.js";
9
+ export * from "./execute.js";
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,sCAAsC;AAEtC,yEAAyE;AACzE,6EAA6E;AAC7E,sEAAsE;AACtE,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC"}