@misofm/partyos 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 +201 -0
- package/README.md +50 -0
- package/dist/client.d.ts +84 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +109 -0
- package/dist/client.js.map +1 -0
- package/dist/contracts/partyos/deps/sui/vec_set.d.ts +21 -0
- package/dist/contracts/partyos/deps/sui/vec_set.d.ts.map +1 -0
- package/dist/contracts/partyos/deps/sui/vec_set.js +20 -0
- package/dist/contracts/partyos/deps/sui/vec_set.js.map +1 -0
- package/dist/contracts/partyos/party.d.ts +481 -0
- package/dist/contracts/partyos/party.d.ts.map +1 -0
- package/dist/contracts/partyos/party.js +527 -0
- package/dist/contracts/partyos/party.js.map +1 -0
- package/dist/contracts/utils/index.d.ts +104 -0
- package/dist/contracts/utils/index.d.ts.map +1 -0
- package/dist/contracts/utils/index.js +272 -0
- package/dist/contracts/utils/index.js.map +1 -0
- package/dist/contracts.d.ts +12 -0
- package/dist/contracts.d.ts.map +1 -0
- package/dist/contracts.js +21 -0
- package/dist/contracts.js.map +1 -0
- package/dist/deployments.d.ts +33 -0
- package/dist/deployments.d.ts.map +1 -0
- package/dist/deployments.js +63 -0
- package/dist/deployments.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/internal.d.ts +5 -0
- package/dist/internal.d.ts.map +1 -0
- package/dist/internal.js +24 -0
- package/dist/internal.js.map +1 -0
- package/dist/queries.d.ts +37 -0
- package/dist/queries.d.ts.map +1 -0
- package/dist/queries.js +123 -0
- package/dist/queries.js.map +1 -0
- package/dist/transactions.d.ts +74 -0
- package/dist/transactions.d.ts.map +1 -0
- package/dist/transactions.js +85 -0
- package/dist/transactions.js.map +1 -0
- package/dist/types.d.ts +12 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +4 -0
- package/dist/types.js.map +1 -0
- package/package.json +97 -0
- package/src/client.ts +165 -0
- package/src/contracts/partyos/deps/sui/vec_set.ts +22 -0
- package/src/contracts/partyos/party.ts +798 -0
- package/src/contracts/utils/index.ts +428 -0
- package/src/contracts.ts +31 -0
- package/src/deployments.ts +90 -0
- package/src/index.ts +15 -0
- package/src/internal.ts +30 -0
- package/src/queries.ts +167 -0
- package/src/transactions.ts +167 -0
- package/src/types.ts +18 -0
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,50 @@
|
|
|
1
|
+
# @misofm/partyos
|
|
2
|
+
|
|
3
|
+
Typed bindings, queries, and PTB builders for the PartyOS object model on Sui: the
|
|
4
|
+
`Party` object, its `PartyAdminCap`, and consent-based group membership.
|
|
5
|
+
|
|
6
|
+
> `@misofm/partyos` is the object model. Everything Miso offers on top of it is platform.
|
|
7
|
+
|
|
8
|
+
A Party's profile, media, roles, tags, genres, CTAs, platform links, and wallet are
|
|
9
|
+
extensions someone chose to offer, so they ship from
|
|
10
|
+
[`@misofm/platform`](https://www.npmjs.com/package/@misofm/platform), which depends on
|
|
11
|
+
this package. Which Move package generates into which SDK is decided by
|
|
12
|
+
`sui-codegen.config.ts` in the [misofm/sdks](https://github.com/misofm/sdks) repo.
|
|
13
|
+
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
bun add @misofm/partyos @mysten/sui
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
`@mysten/sui` is a peer dependency pinned to one exact version.
|
|
21
|
+
|
|
22
|
+
## Use
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
import { SuiGrpcClient } from "@mysten/sui/grpc";
|
|
26
|
+
import { partyos } from "@misofm/partyos";
|
|
27
|
+
|
|
28
|
+
const client = new SuiGrpcClient({ network: "testnet" }).$extend(partyos());
|
|
29
|
+
|
|
30
|
+
const party = await client.partyos.getPartyById("0x...");
|
|
31
|
+
const groups = await client.partyos.getMemberships(party.id);
|
|
32
|
+
|
|
33
|
+
const tx = new Transaction();
|
|
34
|
+
await client.partyos.tx.createIndividualParty({ name: "Ada", recipient: "0x..." })(tx);
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Every builder under `tx` appends commands to a caller-owned `Transaction` and never
|
|
38
|
+
executes. `call` exposes the generated, package-bound Move calls (minus the
|
|
39
|
+
reference-returning views a PTB cannot use), and `bcs` the generated codecs.
|
|
40
|
+
|
|
41
|
+
## Deployment manifest
|
|
42
|
+
|
|
43
|
+
`PARTYOS_DEPLOYMENTS` bundles the verified testnet deployment: a single key, `partyos`.
|
|
44
|
+
Pass `partyos({ deployment })` for another network; a manifest with any other shape is
|
|
45
|
+
rejected before a Move target is constructed.
|
|
46
|
+
|
|
47
|
+
## Subpaths
|
|
48
|
+
|
|
49
|
+
`@misofm/partyos` (everything), `/client`, `/deployments`, `/queries`, `/transactions`,
|
|
50
|
+
`/types`, `/contracts` (curated bindings), `/contracts/*` (raw generated modules).
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { ClientWithCoreApi, SuiClientRegistration } from "@mysten/sui/client";
|
|
2
|
+
import { type PartyDeployment } from "./deployments.ts";
|
|
3
|
+
import * as transactions from "./transactions.ts";
|
|
4
|
+
import type { TxThunk } from "./transactions.ts";
|
|
5
|
+
import type { Party } from "./types.ts";
|
|
6
|
+
import * as partyMod from "./contracts/partyos/party.ts";
|
|
7
|
+
type BoundMoveFunction<F> = F extends (options: infer Options) => infer Result ? Options extends {
|
|
8
|
+
package?: unknown;
|
|
9
|
+
} ? (options: Omit<Options, "package">) => Result : F : F;
|
|
10
|
+
type BoundModule<M extends object, Removed extends PropertyKey> = {
|
|
11
|
+
[Key in Exclude<keyof M, Removed>]: BoundMoveFunction<M[Key]>;
|
|
12
|
+
};
|
|
13
|
+
/** Defaults generated calls to one package and removes reference-returning calls. */
|
|
14
|
+
export declare function bindModulePackage<M extends object, K extends readonly (keyof M)[]>(mod: M, pkg: string, unavailable?: K): BoundModule<M, K[number]>;
|
|
15
|
+
export interface PartyosOptions<Name extends string = "partyos"> {
|
|
16
|
+
/** Name for the client extension. Defaults to "partyos". */
|
|
17
|
+
name?: Name;
|
|
18
|
+
/** Explicit deployment. Omit only when this SDK bundles a verified manifest for the client's network. */
|
|
19
|
+
deployment?: PartyDeployment;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Creates a PartyOS client extension for use with `$extend()`.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const client = new SuiGrpcClient({ network: "testnet" }).$extend(partyos());
|
|
27
|
+
* const party = await client.partyos.getPartyById("0x...");
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare function partyos<const Name extends string = "partyos">(options?: PartyosOptions<Name>): SuiClientRegistration<ClientWithCoreApi, Name, PartyosClient>;
|
|
31
|
+
/** Package-bound PartyOS client. */
|
|
32
|
+
export declare class PartyosClient {
|
|
33
|
+
#private;
|
|
34
|
+
constructor(client: ClientWithCoreApi, deployment: PartyDeployment);
|
|
35
|
+
/** The exact deployment selected for this client. */
|
|
36
|
+
get deployment(): PartyDeployment;
|
|
37
|
+
getPartyById(partyId: string): Promise<Party>;
|
|
38
|
+
getPartiesByIds(partyIds: readonly string[]): Promise<Partial<Record<string, Party>>>;
|
|
39
|
+
derivePartyAdminCapId(partyId: string): string;
|
|
40
|
+
/** Group ids a party belongs to (member-side membership records). */
|
|
41
|
+
getMemberships(partyId: string): Promise<string[]>;
|
|
42
|
+
/** Member ids invited to a group but not yet accepted. */
|
|
43
|
+
getPendingInvites(groupId: string): Promise<string[]>;
|
|
44
|
+
/** Group ids that have invited this party but are awaiting its response. */
|
|
45
|
+
getPendingMemberships(partyId: string): Promise<string[]>;
|
|
46
|
+
/** Whether a party is a member of a group. */
|
|
47
|
+
isMember(memberId: string, groupId: string): Promise<boolean>;
|
|
48
|
+
get tx(): {
|
|
49
|
+
createIndividualParty: (p: Omit<transactions.CreatePartyParams, "partyPackageId">) => TxThunk;
|
|
50
|
+
createGroupParty: (p: Omit<transactions.CreatePartyParams, "partyPackageId">) => TxThunk;
|
|
51
|
+
setName: (p: Omit<transactions.SetNameParams, "partyPackageId">) => TxThunk;
|
|
52
|
+
inviteParty: (p: Omit<transactions.InvitePartyParams, "partyPackageId">) => TxThunk;
|
|
53
|
+
acceptInvite: (p: Omit<transactions.AcceptInviteParams, "partyPackageId">) => TxThunk;
|
|
54
|
+
declineInvite: (p: Omit<transactions.DeclineInviteParams, "partyPackageId">) => TxThunk;
|
|
55
|
+
revokeInvite: (p: Omit<transactions.RevokeInviteParams, "partyPackageId">) => TxThunk;
|
|
56
|
+
leaveGroup: (p: Omit<transactions.LeaveGroupParams, "partyPackageId">) => TxThunk;
|
|
57
|
+
removeMember: (p: Omit<transactions.RemoveMemberParams, "partyPackageId">) => TxThunk;
|
|
58
|
+
};
|
|
59
|
+
get call(): {
|
|
60
|
+
party: BoundModule<typeof partyMod, "groupMembers" | "uid" | "uidMut">;
|
|
61
|
+
};
|
|
62
|
+
get bcs(): {
|
|
63
|
+
Party: import("./contracts/utils/index.ts").MoveStruct<{
|
|
64
|
+
id: import("@mysten/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
65
|
+
kind: import("./contracts/utils/index.ts").MoveEnum<{
|
|
66
|
+
Individual: null;
|
|
67
|
+
Group: import("./contracts/utils/index.ts").MoveStruct<{
|
|
68
|
+
contents: import("@mysten/bcs").BcsType<string[], Iterable<string | Uint8Array<ArrayBufferLike>> & {
|
|
69
|
+
length: number;
|
|
70
|
+
}, string>;
|
|
71
|
+
}, "0x2::vec_set::VecSet<bytes[32]>">;
|
|
72
|
+
}, "@local-pkg/partyos::party::PartyKind">;
|
|
73
|
+
name: import("@mysten/bcs").BcsType<string, string, "string">;
|
|
74
|
+
created_at_ms: import("@mysten/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
75
|
+
}, "@local-pkg/partyos::party::Party">;
|
|
76
|
+
PartyAdminCap: import("./contracts/utils/index.ts").MoveStruct<{
|
|
77
|
+
id: import("@mysten/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
78
|
+
party_id: import("@mysten/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
79
|
+
}, "@local-pkg/partyos::party::PartyAdminCap">;
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
/** @deprecated Use `PartyosClient`. Retained for callers migrating from `@misofm/protocol/party`. */
|
|
83
|
+
export { PartyosClient as PartyProtocolClient };
|
|
84
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AACnF,OAAO,EAAgD,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAGtG,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;AAEzD,KAAK,iBAAiB,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,MAAM,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AgB,EAAE,gBAAgB,CAAC,KAAG,OAAO;QAE/E,YAAY,MAAM,IAAI,CAAC,YAAY,CAAC,kBAAkB,EAAE,gBAAgB,CAAC,KAAG,OAAO;MAGtF;IAID,IAAI,IAAI;QAEJ,KAAK;MAER;IAID,IAAI,GAAG;QAEH,KAAK;;;;;;;;;;;;;QACL,aAAa;;;;MAEhB;CACF;AAED,qGAAqG;AACrG,OAAO,EAAE,aAAa,IAAI,mBAAmB,EAAE,CAAC"}
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
// Copyright (c) Miso Labs, Inc.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { getPartyDeployment, normalizePartyDeployment } from "./deployments.js";
|
|
4
|
+
import { PARTY_REF_RETURNING_CALLS } from "./contracts.js";
|
|
5
|
+
import * as queries from "./queries.js";
|
|
6
|
+
import * as transactions from "./transactions.js";
|
|
7
|
+
import * as partyMod from "./contracts/partyos/party.js";
|
|
8
|
+
/** Defaults generated calls to one package and removes reference-returning calls. */
|
|
9
|
+
export function bindModulePackage(mod, pkg, unavailable = []) {
|
|
10
|
+
const out = {};
|
|
11
|
+
for (const [key, value] of Object.entries({ ...mod })) {
|
|
12
|
+
if (unavailable.includes(key))
|
|
13
|
+
continue;
|
|
14
|
+
out[key] =
|
|
15
|
+
typeof value === "function"
|
|
16
|
+
? (options) => value({ package: pkg, ...options })
|
|
17
|
+
: value;
|
|
18
|
+
}
|
|
19
|
+
return out;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Creates a PartyOS client extension for use with `$extend()`.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const client = new SuiGrpcClient({ network: "testnet" }).$extend(partyos());
|
|
27
|
+
* const party = await client.partyos.getPartyById("0x...");
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export function partyos(options = {}) {
|
|
31
|
+
const name = (options.name ?? "partyos");
|
|
32
|
+
return {
|
|
33
|
+
name,
|
|
34
|
+
register: (client) => new PartyosClient(client, options.deployment ? normalizePartyDeployment(options.deployment) : getPartyDeployment(client.network)),
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/** Package-bound PartyOS client. */
|
|
38
|
+
export class PartyosClient {
|
|
39
|
+
#client;
|
|
40
|
+
#deployment;
|
|
41
|
+
constructor(client, deployment) {
|
|
42
|
+
this.#client = client;
|
|
43
|
+
this.#deployment = normalizePartyDeployment(deployment);
|
|
44
|
+
}
|
|
45
|
+
/** The exact deployment selected for this client. */
|
|
46
|
+
get deployment() {
|
|
47
|
+
return this.#deployment;
|
|
48
|
+
}
|
|
49
|
+
get #pkg() {
|
|
50
|
+
return this.#deployment.partyos;
|
|
51
|
+
}
|
|
52
|
+
// === Queries ===
|
|
53
|
+
async getPartyById(partyId) {
|
|
54
|
+
return queries.getPartyById(this.#client, partyId, this.#pkg);
|
|
55
|
+
}
|
|
56
|
+
async getPartiesByIds(partyIds) {
|
|
57
|
+
return queries.getPartiesByIds(this.#client, partyIds, this.#pkg);
|
|
58
|
+
}
|
|
59
|
+
derivePartyAdminCapId(partyId) {
|
|
60
|
+
return queries.derivePartyAdminCapId(partyId, this.#pkg);
|
|
61
|
+
}
|
|
62
|
+
/** Group ids a party belongs to (member-side membership records). */
|
|
63
|
+
async getMemberships(partyId) {
|
|
64
|
+
return queries.getMemberships(this.#client, partyId);
|
|
65
|
+
}
|
|
66
|
+
/** Member ids invited to a group but not yet accepted. */
|
|
67
|
+
async getPendingInvites(groupId) {
|
|
68
|
+
return queries.getPendingInvites(this.#client, groupId);
|
|
69
|
+
}
|
|
70
|
+
/** Group ids that have invited this party but are awaiting its response. */
|
|
71
|
+
async getPendingMemberships(partyId) {
|
|
72
|
+
return queries.getPendingMemberships(this.#client, partyId);
|
|
73
|
+
}
|
|
74
|
+
/** Whether a party is a member of a group. */
|
|
75
|
+
async isMember(memberId, groupId) {
|
|
76
|
+
return queries.isMember(this.#client, memberId, groupId, this.#pkg);
|
|
77
|
+
}
|
|
78
|
+
// === Transaction builders (thunks; the package id is bound from the client) ===
|
|
79
|
+
get tx() {
|
|
80
|
+
const pkg = this.#pkg;
|
|
81
|
+
return {
|
|
82
|
+
createIndividualParty: (p) => transactions.createIndividualParty({ ...p, partyPackageId: pkg }),
|
|
83
|
+
createGroupParty: (p) => transactions.createGroupParty({ ...p, partyPackageId: pkg }),
|
|
84
|
+
setName: (p) => transactions.setName({ ...p, partyPackageId: pkg }),
|
|
85
|
+
inviteParty: (p) => transactions.inviteParty({ ...p, partyPackageId: pkg }),
|
|
86
|
+
acceptInvite: (p) => transactions.acceptInvite({ ...p, partyPackageId: pkg }),
|
|
87
|
+
declineInvite: (p) => transactions.declineInvite({ ...p, partyPackageId: pkg }),
|
|
88
|
+
revokeInvite: (p) => transactions.revokeInvite({ ...p, partyPackageId: pkg }),
|
|
89
|
+
leaveGroup: (p) => transactions.leaveGroup({ ...p, partyPackageId: pkg }),
|
|
90
|
+
removeMember: (p) => transactions.removeMember({ ...p, partyPackageId: pkg }),
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
// === Generated type-safe Move calls (for tx.add) ===
|
|
94
|
+
get call() {
|
|
95
|
+
return {
|
|
96
|
+
party: bindModulePackage(partyMod, this.#pkg, PARTY_REF_RETURNING_CALLS),
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
// === Generated BCS structs (for parsing object/event content) ===
|
|
100
|
+
get bcs() {
|
|
101
|
+
return {
|
|
102
|
+
Party: partyMod.Party,
|
|
103
|
+
PartyAdminCap: partyMod.PartyAdminCap,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
/** @deprecated Use `PartyosClient`. Retained for callers migrating from `@misofm/protocol/party`. */
|
|
108
|
+
export { PartyosClient as PartyProtocolClient };
|
|
109
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":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EAAE,GAAG,CAAC,EAAE,cAAc,EAAE,GAAG,EAAE,CAAC;YAC1D,UAAU,EAAE,CAAC,CAAwD,EAAW,EAAE,CAChF,YAAY,CAAC,UAAU,CAAC,EAAE,GAAG,CAAC,EAAE,cAAc,EAAE,GAAG,EAAE,CAAC;YACxD,YAAY,EAAE,CAAC,CAA0D,EAAW,EAAE,CACpF,YAAY,CAAC,YAAY,CAAC,EAAE,GAAG,CAAC,EAAE,cAAc,EAAE,GAAG,EAAE,CAAC;SAC3D,CAAC;IACJ,CAAC;IAED,sDAAsD;IAEtD,IAAI,IAAI;QACN,OAAO;YACL,KAAK,EAAE,iBAAiB,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,yBAAyB,CAAC;SACzE,CAAC;IACJ,CAAC;IAED,mEAAmE;IAEnE,IAAI,GAAG;QACL,OAAO;YACL,KAAK,EAAE,QAAQ,CAAC,KAAK;YACrB,aAAa,EAAE,QAAQ,CAAC,aAAa;SACtC,CAAC;IACJ,CAAC;CACF;AAED,qGAAqG;AACrG,OAAO,EAAE,aAAa,IAAI,mBAAmB,EAAE,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
import { type BcsType } from '@mysten/sui/bcs';
|
|
5
|
+
import { MoveStruct } from '../../../utils/index.ts';
|
|
6
|
+
/**
|
|
7
|
+
* A set data structure backed by a vector. The set is guaranteed not to contain
|
|
8
|
+
* duplicate keys. All operations are O(N) in the size of the set
|
|
9
|
+
*
|
|
10
|
+
* - the intention of this data structure is only to provide the convenience of
|
|
11
|
+
* programming against a set API. Sets that need sorted iteration rather than
|
|
12
|
+
* insertion order iteration should be handwritten.
|
|
13
|
+
*/
|
|
14
|
+
export declare function VecSet<K extends BcsType<any>>(...typeParameters: [
|
|
15
|
+
K
|
|
16
|
+
]): MoveStruct<{
|
|
17
|
+
contents: BcsType<import("@mysten/bcs").InferBcsType<K>[], Iterable<import("@mysten/bcs").InferBcsInput<K>> & {
|
|
18
|
+
length: number;
|
|
19
|
+
}, string>;
|
|
20
|
+
}, `0x2::vec_set::VecSet<${K["name"]}>`>;
|
|
21
|
+
//# sourceMappingURL=vec_set.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vec_set.d.ts","sourceRoot":"","sources":["../../../../../src/contracts/partyos/deps/sui/vec_set.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAChE,OAAO,EAAE,KAAK,OAAO,EAAO,MAAM,iBAAiB,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD;;;;;;;GAOG;AACH,wBAAgB,MAAM,CAAC,CAAC,SAAS,OAAO,CAAC,GAAG,CAAC,EAAE,GAAG,cAAc,EAAE;IAC9D,CAAC;CACJ;;;;yCAIA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
5
|
+
import { MoveStruct } from '../../../utils/index.js';
|
|
6
|
+
const $moduleName = '0x2::vec_set';
|
|
7
|
+
/**
|
|
8
|
+
* A set data structure backed by a vector. The set is guaranteed not to contain
|
|
9
|
+
* duplicate keys. All operations are O(N) in the size of the set
|
|
10
|
+
*
|
|
11
|
+
* - the intention of this data structure is only to provide the convenience of
|
|
12
|
+
* programming against a set API. Sets that need sorted iteration rather than
|
|
13
|
+
* insertion order iteration should be handwritten.
|
|
14
|
+
*/
|
|
15
|
+
export function VecSet(...typeParameters) {
|
|
16
|
+
return new MoveStruct({ name: `${$moduleName}::VecSet<${typeParameters[0].name}>`, fields: {
|
|
17
|
+
contents: bcs.vector(typeParameters[0])
|
|
18
|
+
} });
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=vec_set.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vec_set.js","sourceRoot":"","sources":["../../../../../src/contracts/partyos/deps/sui/vec_set.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAChE,OAAO,EAAgB,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,MAAM,WAAW,GAAG,cAAc,CAAC;AACnC;;;;;;;GAOG;AACH,MAAM,UAAU,MAAM,CAAyB,GAAG,cAEjD;IACG,OAAO,IAAI,UAAU,CAAC,EAAE,IAAI,EAAE,GAAG,WAAW,YAAY,cAAc,CAAC,CAAC,CAAC,CAAC,IAAiB,GAAG,EAAE,MAAM,EAAE;YAChG,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;SAC1C,EAAE,CAAC,CAAC;AACb,CAAC"}
|