@misonetwork/sdk 0.8.0 → 0.9.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/README.md +39 -7
- package/dist/client.d.ts +3 -17
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +13 -0
- package/dist/client.js.map +1 -1
- package/dist/contracts/miso/composition.d.ts +0 -14
- package/dist/contracts/miso/composition.d.ts.map +1 -1
- package/dist/contracts/miso/composition.js +0 -15
- package/dist/contracts/miso/composition.js.map +1 -1
- package/dist/contracts/miso/recording.d.ts +0 -15
- package/dist/contracts/miso/recording.d.ts.map +1 -1
- package/dist/contracts/miso/recording.js +0 -15
- package/dist/contracts/miso/recording.js.map +1 -1
- package/dist/contracts/miso/release.d.ts +0 -11
- package/dist/contracts/miso/release.d.ts.map +1 -1
- package/dist/contracts/miso/release.js +0 -14
- package/dist/contracts/miso/release.js.map +1 -1
- package/dist/contracts/miso_party/deps/sui/vec_set.d.ts +21 -0
- package/dist/contracts/miso_party/deps/sui/vec_set.d.ts.map +1 -0
- package/dist/contracts/miso_party/deps/sui/vec_set.js +20 -0
- package/dist/contracts/miso_party/deps/sui/vec_set.js.map +1 -0
- package/dist/contracts/miso_party/party.d.ts +481 -0
- package/dist/contracts/miso_party/party.d.ts.map +1 -0
- package/dist/contracts/miso_party/party.js +527 -0
- package/dist/contracts/miso_party/party.js.map +1 -0
- package/dist/contracts/party_cta/party_cta.d.ts +120 -0
- package/dist/contracts/party_cta/party_cta.d.ts.map +1 -0
- package/dist/contracts/party_cta/party_cta.js +139 -0
- package/dist/contracts/party_cta/party_cta.js.map +1 -0
- package/dist/contracts/party_genre/party_genre.d.ts +117 -0
- package/dist/contracts/party_genre/party_genre.d.ts.map +1 -0
- package/dist/contracts/party_genre/party_genre.js +131 -0
- package/dist/contracts/party_genre/party_genre.js.map +1 -0
- package/dist/contracts/party_media/party_media.d.ts +86 -0
- package/dist/contracts/party_media/party_media.d.ts.map +1 -0
- package/dist/contracts/party_media/party_media.js +97 -0
- package/dist/contracts/party_media/party_media.js.map +1 -0
- package/dist/contracts/party_music/party_music.d.ts +209 -0
- package/dist/contracts/party_music/party_music.d.ts.map +1 -0
- package/dist/contracts/party_music/party_music.js +259 -0
- package/dist/contracts/party_music/party_music.js.map +1 -0
- package/dist/contracts/party_platform_link/party_platform_link.d.ts +89 -0
- package/dist/contracts/party_platform_link/party_platform_link.d.ts.map +1 -0
- package/dist/contracts/party_platform_link/party_platform_link.js +92 -0
- package/dist/contracts/party_platform_link/party_platform_link.js.map +1 -0
- package/dist/contracts/party_pro_link/party_pro_link.d.ts +233 -0
- package/dist/contracts/party_pro_link/party_pro_link.d.ts.map +1 -0
- package/dist/contracts/party_pro_link/party_pro_link.js +289 -0
- package/dist/contracts/party_pro_link/party_pro_link.js.map +1 -0
- package/dist/contracts/party_profile/deps/country_code/country_code.d.ts +15 -0
- package/dist/contracts/party_profile/deps/country_code/country_code.d.ts.map +1 -0
- package/dist/contracts/party_profile/deps/country_code/country_code.js +17 -0
- package/dist/contracts/party_profile/deps/country_code/country_code.js.map +1 -0
- package/dist/contracts/party_profile/deps/language_code/language_code.d.ts +6 -0
- package/dist/contracts/party_profile/deps/language_code/language_code.d.ts.map +1 -0
- package/dist/contracts/party_profile/deps/language_code/language_code.js +8 -0
- package/dist/contracts/party_profile/deps/language_code/language_code.js.map +1 -0
- package/dist/contracts/party_profile/party_profile.d.ts +133 -0
- package/dist/contracts/party_profile/party_profile.d.ts.map +1 -0
- package/dist/contracts/party_profile/party_profile.js +153 -0
- package/dist/contracts/party_profile/party_profile.js.map +1 -0
- package/dist/contracts/party_roles/party_roles.d.ts +201 -0
- package/dist/contracts/party_roles/party_roles.d.ts.map +1 -0
- package/dist/contracts/party_roles/party_roles.js +237 -0
- package/dist/contracts/party_roles/party_roles.js.map +1 -0
- package/dist/contracts/party_social/party_social.d.ts +258 -0
- package/dist/contracts/party_social/party_social.d.ts.map +1 -0
- package/dist/contracts/party_social/party_social.js +320 -0
- package/dist/contracts/party_social/party_social.js.map +1 -0
- package/dist/contracts/party_tags/party_tags.d.ts +116 -0
- package/dist/contracts/party_tags/party_tags.d.ts.map +1 -0
- package/dist/contracts/party_tags/party_tags.js +130 -0
- package/dist/contracts/party_tags/party_tags.js.map +1 -0
- package/dist/contracts/routed_stake/routed_stake.d.ts +0 -14
- package/dist/contracts/routed_stake/routed_stake.d.ts.map +1 -1
- package/dist/contracts/routed_stake/routed_stake.js +0 -14
- package/dist/contracts/routed_stake/routed_stake.js.map +1 -1
- package/dist/contracts/royalty_pool/pool.d.ts +0 -14
- package/dist/contracts/royalty_pool/pool.d.ts.map +1 -1
- package/dist/contracts/royalty_pool/pool.js +0 -14
- package/dist/contracts/royalty_pool/pool.js.map +1 -1
- package/dist/contracts/royalty_pool/stake.d.ts +0 -13
- package/dist/contracts/royalty_pool/stake.d.ts.map +1 -1
- package/dist/contracts/royalty_pool/stake.js +0 -14
- package/dist/contracts/royalty_pool/stake.js.map +1 -1
- package/dist/contracts.d.ts +13 -2
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js +14 -2
- package/dist/contracts.js.map +1 -1
- package/dist/deployments.d.ts +2 -2
- package/dist/deployments.d.ts.map +1 -1
- package/dist/deployments.js +16 -3
- package/dist/deployments.js.map +1 -1
- package/dist/events.d.ts +0 -14
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js +0 -4
- package/dist/events.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/packages.d.ts +39 -4
- package/dist/packages.d.ts.map +1 -1
- package/dist/packages.js +39 -4
- package/dist/packages.js.map +1 -1
- package/dist/party/client.d.ts +233 -0
- package/dist/party/client.d.ts.map +1 -0
- package/dist/party/client.js +222 -0
- package/dist/party/client.js.map +1 -0
- package/dist/party/extensions/ctas.d.ts +19 -0
- package/dist/party/extensions/ctas.d.ts.map +1 -0
- package/dist/party/extensions/ctas.js +25 -0
- package/dist/party/extensions/ctas.js.map +1 -0
- package/dist/party/extensions/genres.d.ts +27 -0
- package/dist/party/extensions/genres.d.ts.map +1 -0
- package/dist/party/extensions/genres.js +31 -0
- package/dist/party/extensions/genres.js.map +1 -0
- package/dist/party/extensions/links.d.ts +65 -0
- package/dist/party/extensions/links.d.ts.map +1 -0
- package/dist/party/extensions/links.js +117 -0
- package/dist/party/extensions/links.js.map +1 -0
- package/dist/party/extensions/media.d.ts +36 -0
- package/dist/party/extensions/media.d.ts.map +1 -0
- package/dist/party/extensions/media.js +45 -0
- package/dist/party/extensions/media.js.map +1 -0
- package/dist/party/extensions/profile.d.ts +24 -0
- package/dist/party/extensions/profile.d.ts.map +1 -0
- package/dist/party/extensions/profile.js +48 -0
- package/dist/party/extensions/profile.js.map +1 -0
- package/dist/party/extensions/roles.d.ts +37 -0
- package/dist/party/extensions/roles.d.ts.map +1 -0
- package/dist/party/extensions/roles.js +46 -0
- package/dist/party/extensions/roles.js.map +1 -0
- package/dist/party/extensions/tags.d.ts +25 -0
- package/dist/party/extensions/tags.d.ts.map +1 -0
- package/dist/party/extensions/tags.js +25 -0
- package/dist/party/extensions/tags.js.map +1 -0
- package/dist/party/index.d.ts +12 -0
- package/dist/party/index.d.ts.map +1 -0
- package/dist/party/index.js +14 -0
- package/dist/party/index.js.map +1 -0
- package/dist/party/internal.d.ts +15 -0
- package/dist/party/internal.d.ts.map +1 -0
- package/dist/party/internal.js +103 -0
- package/dist/party/internal.js.map +1 -0
- package/dist/party/queries.d.ts +38 -0
- package/dist/party/queries.d.ts.map +1 -0
- package/dist/party/queries.js +232 -0
- package/dist/party/queries.js.map +1 -0
- package/dist/party/transactions.d.ts +74 -0
- package/dist/party/transactions.d.ts.map +1 -0
- package/dist/party/transactions.js +85 -0
- package/dist/party/transactions.js.map +1 -0
- package/dist/party/types.d.ts +54 -0
- package/dist/party/types.d.ts.map +1 -0
- package/dist/party/types.js +4 -0
- package/dist/party/types.js.map +1 -0
- package/package.json +6 -2
- package/src/client.ts +16 -0
- package/src/contracts/miso/composition.ts +0 -27
- package/src/contracts/miso/recording.ts +0 -28
- package/src/contracts/miso/release.ts +0 -23
- package/src/contracts/miso_party/deps/sui/vec_set.ts +21 -0
- package/src/contracts/miso_party/party.ts +797 -0
- package/src/contracts/party_cta/party_cta.ts +212 -0
- package/src/contracts/party_genre/party_genre.ts +199 -0
- package/src/contracts/party_media/party_media.ts +141 -0
- package/src/contracts/party_music/party_music.ts +405 -0
- package/src/contracts/party_platform_link/party_platform_link.ts +148 -0
- package/src/contracts/party_pro_link/party_pro_link.ts +453 -0
- package/src/contracts/party_profile/deps/country_code/country_code.ts +19 -0
- package/src/contracts/party_profile/deps/language_code/language_code.ts +7 -0
- package/src/contracts/party_profile/party_profile.ts +239 -0
- package/src/contracts/party_roles/party_roles.ts +363 -0
- package/src/contracts/party_social/party_social.ts +502 -0
- package/src/contracts/party_tags/party_tags.ts +198 -0
- package/src/contracts/routed_stake/routed_stake.ts +0 -27
- package/src/contracts/royalty_pool/pool.ts +0 -27
- package/src/contracts/royalty_pool/stake.ts +0 -26
- package/src/contracts.ts +15 -2
- package/src/deployments.ts +18 -3
- package/src/events.ts +0 -4
- package/src/index.ts +2 -0
- package/src/packages.ts +40 -8
- package/src/party/client.ts +283 -0
- package/src/party/extensions/ctas.ts +46 -0
- package/src/party/extensions/genres.ts +62 -0
- package/src/party/extensions/links.ts +185 -0
- package/src/party/extensions/media.ts +72 -0
- package/src/party/extensions/profile.ts +81 -0
- package/src/party/extensions/roles.ts +94 -0
- package/src/party/extensions/tags.ts +54 -0
- package/src/party/index.ts +14 -0
- package/src/party/internal.ts +119 -0
- package/src/party/queries.ts +303 -0
- package/src/party/transactions.ts +167 -0
- package/src/party/types.ts +95 -0
- package/dist/contracts/release_snapshot_bundle/deps/ori/walrus_data.d.ts +0 -52
- package/dist/contracts/release_snapshot_bundle/deps/ori/walrus_data.d.ts.map +0 -1
- package/dist/contracts/release_snapshot_bundle/deps/ori/walrus_data.js +0 -37
- package/dist/contracts/release_snapshot_bundle/deps/ori/walrus_data.js.map +0 -1
- package/dist/contracts/release_snapshot_bundle/release_snapshot_bundle.d.ts +0 -91
- package/dist/contracts/release_snapshot_bundle/release_snapshot_bundle.d.ts.map +0 -1
- package/dist/contracts/release_snapshot_bundle/release_snapshot_bundle.js +0 -91
- package/dist/contracts/release_snapshot_bundle/release_snapshot_bundle.js.map +0 -1
- package/src/contracts/release_snapshot_bundle/deps/ori/walrus_data.ts +0 -36
- package/src/contracts/release_snapshot_bundle/release_snapshot_bundle.ts +0 -124
|
@@ -0,0 +1,797 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Represents parties (individuals or groups) that participate in on-chain
|
|
8
|
+
* activities. A party is a named entity with capability-based authorization.
|
|
9
|
+
*
|
|
10
|
+
* ### Key Features:
|
|
11
|
+
*
|
|
12
|
+
* - Individual and group party types
|
|
13
|
+
* - Extensible metadata via dynamic fields
|
|
14
|
+
* - Capability-based authorization for modifications
|
|
15
|
+
* - Groups can contain multiple individual parties
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { MoveEnum, MoveStruct, MoveTuple, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.ts';
|
|
19
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
20
|
+
import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
|
|
21
|
+
import * as vec_set from './deps/sui/vec_set.ts';
|
|
22
|
+
const $moduleName = '@local-pkg/miso_party::party';
|
|
23
|
+
/** The type of self: individual person or group. */
|
|
24
|
+
export const PartyKind = new MoveEnum({ name: `${$moduleName}::PartyKind`, fields: {
|
|
25
|
+
/** A single person (artist, producer, etc.). */
|
|
26
|
+
Individual: null,
|
|
27
|
+
/** A group containing multiple individual parties. */
|
|
28
|
+
Group: vec_set.VecSet(bcs.Address)
|
|
29
|
+
} });
|
|
30
|
+
export const Party = new MoveStruct({ name: `${$moduleName}::Party`, fields: {
|
|
31
|
+
/** Unique identifier for this party. */
|
|
32
|
+
id: bcs.Address,
|
|
33
|
+
/** Whether this is an individual or group party. */
|
|
34
|
+
kind: PartyKind,
|
|
35
|
+
/**
|
|
36
|
+
* Human-readable name of the party. Note this name is not "official" or "verified"
|
|
37
|
+
* in any way. Verification should be performed by the application layer.
|
|
38
|
+
*/
|
|
39
|
+
name: bcs.string(),
|
|
40
|
+
/** Unix ms when the party was created. Set once at `new`; immutable. */
|
|
41
|
+
created_at_ms: bcs.u64()
|
|
42
|
+
} });
|
|
43
|
+
export const PartyAdminCap = new MoveStruct({ name: `${$moduleName}::PartyAdminCap`, fields: {
|
|
44
|
+
/** Unique identifier for this capability. */
|
|
45
|
+
id: bcs.Address,
|
|
46
|
+
/** ID of the party this capability controls. */
|
|
47
|
+
party_id: bcs.Address
|
|
48
|
+
} });
|
|
49
|
+
export const PartyAdminCapKey = new MoveTuple({ name: `${$moduleName}::PartyAdminCapKey`, fields: [bcs.Address] });
|
|
50
|
+
export const PendingInviteKey = new MoveTuple({ name: `${$moduleName}::PendingInviteKey`, fields: [bcs.Address] });
|
|
51
|
+
export const PendingMembershipKey = new MoveTuple({ name: `${$moduleName}::PendingMembershipKey`, fields: [bcs.Address] });
|
|
52
|
+
export const MembershipKey = new MoveTuple({ name: `${$moduleName}::MembershipKey`, fields: [bcs.Address] });
|
|
53
|
+
export const Membership = new MoveStruct({ name: `${$moduleName}::Membership`, fields: {
|
|
54
|
+
/** Epoch in which the party joined the group. */
|
|
55
|
+
since_epoch: bcs.u64()
|
|
56
|
+
} });
|
|
57
|
+
export const PartyCreatedEvent = new MoveStruct({ name: `${$moduleName}::PartyCreatedEvent`, fields: {
|
|
58
|
+
/** ID of the newly created party. */
|
|
59
|
+
party_id: bcs.Address,
|
|
60
|
+
/** Name of the party. */
|
|
61
|
+
name: bcs.string(),
|
|
62
|
+
/** Kind of the party. */
|
|
63
|
+
kind: bcs.string(),
|
|
64
|
+
/** Unix ms when the party was created. */
|
|
65
|
+
created_at_ms: bcs.u64()
|
|
66
|
+
} });
|
|
67
|
+
export const PartyNameSetEvent = new MoveStruct({ name: `${$moduleName}::PartyNameSetEvent`, fields: {
|
|
68
|
+
/** ID of the party. */
|
|
69
|
+
party_id: bcs.Address,
|
|
70
|
+
/** Name of the party. */
|
|
71
|
+
name: bcs.string()
|
|
72
|
+
} });
|
|
73
|
+
export const PartyInvitedEvent = new MoveStruct({ name: `${$moduleName}::PartyInvitedEvent`, fields: {
|
|
74
|
+
/** ID of the group. */
|
|
75
|
+
group_id: bcs.Address,
|
|
76
|
+
/** ID of the invited member party. */
|
|
77
|
+
member_id: bcs.Address
|
|
78
|
+
} });
|
|
79
|
+
export const PartyJoinedGroupEvent = new MoveStruct({ name: `${$moduleName}::PartyJoinedGroupEvent`, fields: {
|
|
80
|
+
/** ID of the group. */
|
|
81
|
+
group_id: bcs.Address,
|
|
82
|
+
/** ID of the party that joined. */
|
|
83
|
+
member_id: bcs.Address
|
|
84
|
+
} });
|
|
85
|
+
export const PartyInviteDeclinedEvent = new MoveStruct({ name: `${$moduleName}::PartyInviteDeclinedEvent`, fields: {
|
|
86
|
+
/** ID of the group. */
|
|
87
|
+
group_id: bcs.Address,
|
|
88
|
+
/** ID of the party that declined. */
|
|
89
|
+
member_id: bcs.Address
|
|
90
|
+
} });
|
|
91
|
+
export const PartyInviteRevokedEvent = new MoveStruct({ name: `${$moduleName}::PartyInviteRevokedEvent`, fields: {
|
|
92
|
+
/** ID of the group. */
|
|
93
|
+
group_id: bcs.Address,
|
|
94
|
+
/** ID of the party whose invite was revoked. */
|
|
95
|
+
member_id: bcs.Address
|
|
96
|
+
} });
|
|
97
|
+
export const PartyRemovedFromGroupEvent = new MoveStruct({ name: `${$moduleName}::PartyRemovedFromGroupEvent`, fields: {
|
|
98
|
+
/** ID of the group. */
|
|
99
|
+
group_id: bcs.Address,
|
|
100
|
+
/** ID of the party removed from the group. */
|
|
101
|
+
member_id: bcs.Address
|
|
102
|
+
} });
|
|
103
|
+
export const PartyLeftGroupEvent = new MoveStruct({ name: `${$moduleName}::PartyLeftGroupEvent`, fields: {
|
|
104
|
+
/** ID of the group. */
|
|
105
|
+
group_id: bcs.Address,
|
|
106
|
+
/** ID of the party that left the group. */
|
|
107
|
+
member_id: bcs.Address
|
|
108
|
+
} });
|
|
109
|
+
export interface NewArguments {
|
|
110
|
+
kind: TransactionArgument;
|
|
111
|
+
name: RawTransactionArgument<string>;
|
|
112
|
+
}
|
|
113
|
+
export interface NewOptions {
|
|
114
|
+
package?: string;
|
|
115
|
+
arguments: NewArguments | [
|
|
116
|
+
kind: TransactionArgument,
|
|
117
|
+
name: RawTransactionArgument<string>
|
|
118
|
+
];
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Creates a new party with the specified kind and name. Returns the admin
|
|
122
|
+
* capability for managing the party. The party is shared and starts in the Created
|
|
123
|
+
* state.
|
|
124
|
+
*/
|
|
125
|
+
export function _new(options: NewOptions) {
|
|
126
|
+
const packageAddress = options.package ?? '@local-pkg/miso_party';
|
|
127
|
+
const argumentsTypes = [
|
|
128
|
+
null,
|
|
129
|
+
'0x1::string::String',
|
|
130
|
+
'0x2::clock::Clock'
|
|
131
|
+
] satisfies (string | null)[];
|
|
132
|
+
const parameterNames = ["kind", "name"];
|
|
133
|
+
return (tx: Transaction) => tx.moveCall({
|
|
134
|
+
package: packageAddress,
|
|
135
|
+
module: 'party',
|
|
136
|
+
function: 'new',
|
|
137
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
export interface ShareArguments {
|
|
141
|
+
self: RawTransactionArgument<string>;
|
|
142
|
+
cap: RawTransactionArgument<string>;
|
|
143
|
+
}
|
|
144
|
+
export interface ShareOptions {
|
|
145
|
+
package?: string;
|
|
146
|
+
arguments: ShareArguments | [
|
|
147
|
+
self: RawTransactionArgument<string>,
|
|
148
|
+
cap: RawTransactionArgument<string>
|
|
149
|
+
];
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Shares the party object, making it publicly accessible. Requires the admin
|
|
153
|
+
* capability.
|
|
154
|
+
*/
|
|
155
|
+
export function share(options: ShareOptions) {
|
|
156
|
+
const packageAddress = options.package ?? '@local-pkg/miso_party';
|
|
157
|
+
const argumentsTypes = [
|
|
158
|
+
null,
|
|
159
|
+
null
|
|
160
|
+
] satisfies (string | null)[];
|
|
161
|
+
const parameterNames = ["self", "cap"];
|
|
162
|
+
return (tx: Transaction) => tx.moveCall({
|
|
163
|
+
package: packageAddress,
|
|
164
|
+
module: 'party',
|
|
165
|
+
function: 'share',
|
|
166
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
export interface SetNameArguments {
|
|
170
|
+
self: RawTransactionArgument<string>;
|
|
171
|
+
cap: RawTransactionArgument<string>;
|
|
172
|
+
name: RawTransactionArgument<string>;
|
|
173
|
+
}
|
|
174
|
+
export interface SetNameOptions {
|
|
175
|
+
package?: string;
|
|
176
|
+
arguments: SetNameArguments | [
|
|
177
|
+
self: RawTransactionArgument<string>,
|
|
178
|
+
cap: RawTransactionArgument<string>,
|
|
179
|
+
name: RawTransactionArgument<string>
|
|
180
|
+
];
|
|
181
|
+
}
|
|
182
|
+
/** Sets the human-readable name of the party. Requires the admin capability. */
|
|
183
|
+
export function setName(options: SetNameOptions) {
|
|
184
|
+
const packageAddress = options.package ?? '@local-pkg/miso_party';
|
|
185
|
+
const argumentsTypes = [
|
|
186
|
+
null,
|
|
187
|
+
null,
|
|
188
|
+
'0x1::string::String'
|
|
189
|
+
] satisfies (string | null)[];
|
|
190
|
+
const parameterNames = ["self", "cap", "name"];
|
|
191
|
+
return (tx: Transaction) => tx.moveCall({
|
|
192
|
+
package: packageAddress,
|
|
193
|
+
module: 'party',
|
|
194
|
+
function: 'set_name',
|
|
195
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
export interface InvitePartyArguments {
|
|
199
|
+
group: RawTransactionArgument<string>;
|
|
200
|
+
member: RawTransactionArgument<string>;
|
|
201
|
+
groupCap: RawTransactionArgument<string>;
|
|
202
|
+
}
|
|
203
|
+
export interface InvitePartyOptions {
|
|
204
|
+
package?: string;
|
|
205
|
+
arguments: InvitePartyArguments | [
|
|
206
|
+
group: RawTransactionArgument<string>,
|
|
207
|
+
member: RawTransactionArgument<string>,
|
|
208
|
+
groupCap: RawTransactionArgument<string>
|
|
209
|
+
];
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Invites an individual party to join a group. Requires the group's admin
|
|
213
|
+
* capability. Records matching pending-invite indexes on both parties; the invited
|
|
214
|
+
* party joins only by calling `accept_invite` with its own admin cap — so no party
|
|
215
|
+
* can be made a member without its consent. The party being invited must be an
|
|
216
|
+
* individual (not another group).
|
|
217
|
+
*/
|
|
218
|
+
export function inviteParty(options: InvitePartyOptions) {
|
|
219
|
+
const packageAddress = options.package ?? '@local-pkg/miso_party';
|
|
220
|
+
const argumentsTypes = [
|
|
221
|
+
null,
|
|
222
|
+
null,
|
|
223
|
+
null
|
|
224
|
+
] satisfies (string | null)[];
|
|
225
|
+
const parameterNames = ["group", "member", "groupCap"];
|
|
226
|
+
return (tx: Transaction) => tx.moveCall({
|
|
227
|
+
package: packageAddress,
|
|
228
|
+
module: 'party',
|
|
229
|
+
function: 'invite_party',
|
|
230
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
export interface AcceptInviteArguments {
|
|
234
|
+
group: RawTransactionArgument<string>;
|
|
235
|
+
member: RawTransactionArgument<string>;
|
|
236
|
+
memberCap: RawTransactionArgument<string>;
|
|
237
|
+
}
|
|
238
|
+
export interface AcceptInviteOptions {
|
|
239
|
+
package?: string;
|
|
240
|
+
arguments: AcceptInviteArguments | [
|
|
241
|
+
group: RawTransactionArgument<string>,
|
|
242
|
+
member: RawTransactionArgument<string>,
|
|
243
|
+
memberCap: RawTransactionArgument<string>
|
|
244
|
+
];
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Accepts a pending invite, joining `member` to `group`. Requires the _member's_
|
|
248
|
+
* own admin cap (consent). Consumes the pending invite, inserts the member into
|
|
249
|
+
* the group's set, and writes a `Membership` record onto the member party — both
|
|
250
|
+
* sides in one transaction, so they can't diverge.
|
|
251
|
+
*/
|
|
252
|
+
export function acceptInvite(options: AcceptInviteOptions) {
|
|
253
|
+
const packageAddress = options.package ?? '@local-pkg/miso_party';
|
|
254
|
+
const argumentsTypes = [
|
|
255
|
+
null,
|
|
256
|
+
null,
|
|
257
|
+
null
|
|
258
|
+
] satisfies (string | null)[];
|
|
259
|
+
const parameterNames = ["group", "member", "memberCap"];
|
|
260
|
+
return (tx: Transaction) => tx.moveCall({
|
|
261
|
+
package: packageAddress,
|
|
262
|
+
module: 'party',
|
|
263
|
+
function: 'accept_invite',
|
|
264
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
export interface DeclineInviteArguments {
|
|
268
|
+
group: RawTransactionArgument<string>;
|
|
269
|
+
member: RawTransactionArgument<string>;
|
|
270
|
+
memberCap: RawTransactionArgument<string>;
|
|
271
|
+
}
|
|
272
|
+
export interface DeclineInviteOptions {
|
|
273
|
+
package?: string;
|
|
274
|
+
arguments: DeclineInviteArguments | [
|
|
275
|
+
group: RawTransactionArgument<string>,
|
|
276
|
+
member: RawTransactionArgument<string>,
|
|
277
|
+
memberCap: RawTransactionArgument<string>
|
|
278
|
+
];
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Declines a pending invite, authorized by the invited party's own admin cap.
|
|
282
|
+
* Clears the group-side invitation and the member-facing inbox entry together.
|
|
283
|
+
*/
|
|
284
|
+
export function declineInvite(options: DeclineInviteOptions) {
|
|
285
|
+
const packageAddress = options.package ?? '@local-pkg/miso_party';
|
|
286
|
+
const argumentsTypes = [
|
|
287
|
+
null,
|
|
288
|
+
null,
|
|
289
|
+
null
|
|
290
|
+
] satisfies (string | null)[];
|
|
291
|
+
const parameterNames = ["group", "member", "memberCap"];
|
|
292
|
+
return (tx: Transaction) => tx.moveCall({
|
|
293
|
+
package: packageAddress,
|
|
294
|
+
module: 'party',
|
|
295
|
+
function: 'decline_invite',
|
|
296
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
export interface RevokeInviteArguments {
|
|
300
|
+
group: RawTransactionArgument<string>;
|
|
301
|
+
member: RawTransactionArgument<string>;
|
|
302
|
+
groupCap: RawTransactionArgument<string>;
|
|
303
|
+
}
|
|
304
|
+
export interface RevokeInviteOptions {
|
|
305
|
+
package?: string;
|
|
306
|
+
arguments: RevokeInviteArguments | [
|
|
307
|
+
group: RawTransactionArgument<string>,
|
|
308
|
+
member: RawTransactionArgument<string>,
|
|
309
|
+
groupCap: RawTransactionArgument<string>
|
|
310
|
+
];
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Revokes a pending invite, authorized by the group's admin cap. Clears the
|
|
314
|
+
* group-side invitation and the member-facing inbox entry together.
|
|
315
|
+
*/
|
|
316
|
+
export function revokeInvite(options: RevokeInviteOptions) {
|
|
317
|
+
const packageAddress = options.package ?? '@local-pkg/miso_party';
|
|
318
|
+
const argumentsTypes = [
|
|
319
|
+
null,
|
|
320
|
+
null,
|
|
321
|
+
null
|
|
322
|
+
] satisfies (string | null)[];
|
|
323
|
+
const parameterNames = ["group", "member", "groupCap"];
|
|
324
|
+
return (tx: Transaction) => tx.moveCall({
|
|
325
|
+
package: packageAddress,
|
|
326
|
+
module: 'party',
|
|
327
|
+
function: 'revoke_invite',
|
|
328
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
export interface LeaveArguments {
|
|
332
|
+
group: RawTransactionArgument<string>;
|
|
333
|
+
member: RawTransactionArgument<string>;
|
|
334
|
+
memberCap: RawTransactionArgument<string>;
|
|
335
|
+
}
|
|
336
|
+
export interface LeaveOptions {
|
|
337
|
+
package?: string;
|
|
338
|
+
arguments: LeaveArguments | [
|
|
339
|
+
group: RawTransactionArgument<string>,
|
|
340
|
+
member: RawTransactionArgument<string>,
|
|
341
|
+
memberCap: RawTransactionArgument<string>
|
|
342
|
+
];
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* Removes the caller's party from a group, authorized by the _member's_ own admin
|
|
346
|
+
* capability — the member's unconditional exit. Clears both the group's member set
|
|
347
|
+
* and the member's own membership record.
|
|
348
|
+
*/
|
|
349
|
+
export function leave(options: LeaveOptions) {
|
|
350
|
+
const packageAddress = options.package ?? '@local-pkg/miso_party';
|
|
351
|
+
const argumentsTypes = [
|
|
352
|
+
null,
|
|
353
|
+
null,
|
|
354
|
+
null
|
|
355
|
+
] satisfies (string | null)[];
|
|
356
|
+
const parameterNames = ["group", "member", "memberCap"];
|
|
357
|
+
return (tx: Transaction) => tx.moveCall({
|
|
358
|
+
package: packageAddress,
|
|
359
|
+
module: 'party',
|
|
360
|
+
function: 'leave',
|
|
361
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
export interface RemoveMemberArguments {
|
|
365
|
+
group: RawTransactionArgument<string>;
|
|
366
|
+
groupCap: RawTransactionArgument<string>;
|
|
367
|
+
member: RawTransactionArgument<string>;
|
|
368
|
+
}
|
|
369
|
+
export interface RemoveMemberOptions {
|
|
370
|
+
package?: string;
|
|
371
|
+
arguments: RemoveMemberArguments | [
|
|
372
|
+
group: RawTransactionArgument<string>,
|
|
373
|
+
groupCap: RawTransactionArgument<string>,
|
|
374
|
+
member: RawTransactionArgument<string>
|
|
375
|
+
];
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* Removes (evicts) a member from a group, authorized by the _group's_ admin
|
|
379
|
+
* capability. Because this module owns `Party`, it can scrub the member's own
|
|
380
|
+
* membership record here even without the member's cap — but only the record for
|
|
381
|
+
* _this_ group, so the admin's reach into the member is scoped to "cancel my
|
|
382
|
+
* group's membership" and nothing else on the member is touchable.
|
|
383
|
+
*/
|
|
384
|
+
export function removeMember(options: RemoveMemberOptions) {
|
|
385
|
+
const packageAddress = options.package ?? '@local-pkg/miso_party';
|
|
386
|
+
const argumentsTypes = [
|
|
387
|
+
null,
|
|
388
|
+
null,
|
|
389
|
+
null
|
|
390
|
+
] satisfies (string | null)[];
|
|
391
|
+
const parameterNames = ["group", "groupCap", "member"];
|
|
392
|
+
return (tx: Transaction) => tx.moveCall({
|
|
393
|
+
package: packageAddress,
|
|
394
|
+
module: 'party',
|
|
395
|
+
function: 'remove_member',
|
|
396
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
397
|
+
});
|
|
398
|
+
}
|
|
399
|
+
export interface NewIndividualKindOptions {
|
|
400
|
+
package?: string;
|
|
401
|
+
arguments?: [
|
|
402
|
+
];
|
|
403
|
+
}
|
|
404
|
+
/** Creates a new individual party kind. */
|
|
405
|
+
export function newIndividualKind(options: NewIndividualKindOptions = {}) {
|
|
406
|
+
const packageAddress = options.package ?? '@local-pkg/miso_party';
|
|
407
|
+
return (tx: Transaction) => tx.moveCall({
|
|
408
|
+
package: packageAddress,
|
|
409
|
+
module: 'party',
|
|
410
|
+
function: 'new_individual_kind',
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
export interface NewGroupKindOptions {
|
|
414
|
+
package?: string;
|
|
415
|
+
arguments?: [
|
|
416
|
+
];
|
|
417
|
+
}
|
|
418
|
+
/** Creates a new group party kind with an empty member set. */
|
|
419
|
+
export function newGroupKind(options: NewGroupKindOptions = {}) {
|
|
420
|
+
const packageAddress = options.package ?? '@local-pkg/miso_party';
|
|
421
|
+
return (tx: Transaction) => tx.moveCall({
|
|
422
|
+
package: packageAddress,
|
|
423
|
+
module: 'party',
|
|
424
|
+
function: 'new_group_kind',
|
|
425
|
+
});
|
|
426
|
+
}
|
|
427
|
+
export interface NameArguments {
|
|
428
|
+
self: RawTransactionArgument<string>;
|
|
429
|
+
}
|
|
430
|
+
export interface NameOptions {
|
|
431
|
+
package?: string;
|
|
432
|
+
arguments: NameArguments | [
|
|
433
|
+
self: RawTransactionArgument<string>
|
|
434
|
+
];
|
|
435
|
+
}
|
|
436
|
+
/** Returns the human-readable name of this party. */
|
|
437
|
+
export function name(options: NameOptions) {
|
|
438
|
+
const packageAddress = options.package ?? '@local-pkg/miso_party';
|
|
439
|
+
const argumentsTypes = [
|
|
440
|
+
null
|
|
441
|
+
] satisfies (string | null)[];
|
|
442
|
+
const parameterNames = ["self"];
|
|
443
|
+
return (tx: Transaction) => tx.moveCall({
|
|
444
|
+
package: packageAddress,
|
|
445
|
+
module: 'party',
|
|
446
|
+
function: 'name',
|
|
447
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
448
|
+
});
|
|
449
|
+
}
|
|
450
|
+
export interface CreatedAtMsArguments {
|
|
451
|
+
self: RawTransactionArgument<string>;
|
|
452
|
+
}
|
|
453
|
+
export interface CreatedAtMsOptions {
|
|
454
|
+
package?: string;
|
|
455
|
+
arguments: CreatedAtMsArguments | [
|
|
456
|
+
self: RawTransactionArgument<string>
|
|
457
|
+
];
|
|
458
|
+
}
|
|
459
|
+
/** Returns the Unix ms when this party was created. */
|
|
460
|
+
export function createdAtMs(options: CreatedAtMsOptions) {
|
|
461
|
+
const packageAddress = options.package ?? '@local-pkg/miso_party';
|
|
462
|
+
const argumentsTypes = [
|
|
463
|
+
null
|
|
464
|
+
] satisfies (string | null)[];
|
|
465
|
+
const parameterNames = ["self"];
|
|
466
|
+
return (tx: Transaction) => tx.moveCall({
|
|
467
|
+
package: packageAddress,
|
|
468
|
+
module: 'party',
|
|
469
|
+
function: 'created_at_ms',
|
|
470
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
471
|
+
});
|
|
472
|
+
}
|
|
473
|
+
export interface IsIndividualKindArguments {
|
|
474
|
+
self: RawTransactionArgument<string>;
|
|
475
|
+
}
|
|
476
|
+
export interface IsIndividualKindOptions {
|
|
477
|
+
package?: string;
|
|
478
|
+
arguments: IsIndividualKindArguments | [
|
|
479
|
+
self: RawTransactionArgument<string>
|
|
480
|
+
];
|
|
481
|
+
}
|
|
482
|
+
/** Returns true if this party is an individual. */
|
|
483
|
+
export function isIndividualKind(options: IsIndividualKindOptions) {
|
|
484
|
+
const packageAddress = options.package ?? '@local-pkg/miso_party';
|
|
485
|
+
const argumentsTypes = [
|
|
486
|
+
null
|
|
487
|
+
] satisfies (string | null)[];
|
|
488
|
+
const parameterNames = ["self"];
|
|
489
|
+
return (tx: Transaction) => tx.moveCall({
|
|
490
|
+
package: packageAddress,
|
|
491
|
+
module: 'party',
|
|
492
|
+
function: 'is_individual_kind',
|
|
493
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
export interface IsGroupKindArguments {
|
|
497
|
+
self: RawTransactionArgument<string>;
|
|
498
|
+
}
|
|
499
|
+
export interface IsGroupKindOptions {
|
|
500
|
+
package?: string;
|
|
501
|
+
arguments: IsGroupKindArguments | [
|
|
502
|
+
self: RawTransactionArgument<string>
|
|
503
|
+
];
|
|
504
|
+
}
|
|
505
|
+
/** Returns true if this party is a group. */
|
|
506
|
+
export function isGroupKind(options: IsGroupKindOptions) {
|
|
507
|
+
const packageAddress = options.package ?? '@local-pkg/miso_party';
|
|
508
|
+
const argumentsTypes = [
|
|
509
|
+
null
|
|
510
|
+
] satisfies (string | null)[];
|
|
511
|
+
const parameterNames = ["self"];
|
|
512
|
+
return (tx: Transaction) => tx.moveCall({
|
|
513
|
+
package: packageAddress,
|
|
514
|
+
module: 'party',
|
|
515
|
+
function: 'is_group_kind',
|
|
516
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
517
|
+
});
|
|
518
|
+
}
|
|
519
|
+
export interface GroupMembersArguments {
|
|
520
|
+
self: RawTransactionArgument<string>;
|
|
521
|
+
}
|
|
522
|
+
export interface GroupMembersOptions {
|
|
523
|
+
package?: string;
|
|
524
|
+
arguments: GroupMembersArguments | [
|
|
525
|
+
self: RawTransactionArgument<string>
|
|
526
|
+
];
|
|
527
|
+
}
|
|
528
|
+
/** Returns a reference to the group members. Aborts if this party is not a group. */
|
|
529
|
+
export function groupMembers(options: GroupMembersOptions) {
|
|
530
|
+
const packageAddress = options.package ?? '@local-pkg/miso_party';
|
|
531
|
+
const argumentsTypes = [
|
|
532
|
+
null
|
|
533
|
+
] satisfies (string | null)[];
|
|
534
|
+
const parameterNames = ["self"];
|
|
535
|
+
return (tx: Transaction) => tx.moveCall({
|
|
536
|
+
package: packageAddress,
|
|
537
|
+
module: 'party',
|
|
538
|
+
function: 'group_members',
|
|
539
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
540
|
+
});
|
|
541
|
+
}
|
|
542
|
+
export interface IsMemberArguments {
|
|
543
|
+
member: RawTransactionArgument<string>;
|
|
544
|
+
groupId: RawTransactionArgument<string>;
|
|
545
|
+
}
|
|
546
|
+
export interface IsMemberOptions {
|
|
547
|
+
package?: string;
|
|
548
|
+
arguments: IsMemberArguments | [
|
|
549
|
+
member: RawTransactionArgument<string>,
|
|
550
|
+
groupId: RawTransactionArgument<string>
|
|
551
|
+
];
|
|
552
|
+
}
|
|
553
|
+
/**
|
|
554
|
+
* Whether `member` currently holds a membership record for `group_id`. Reads the
|
|
555
|
+
* member side, so it needs only the member party (no group object) — the primitive
|
|
556
|
+
* extensions use for member-gated authorization.
|
|
557
|
+
*/
|
|
558
|
+
export function isMember(options: IsMemberOptions) {
|
|
559
|
+
const packageAddress = options.package ?? '@local-pkg/miso_party';
|
|
560
|
+
const argumentsTypes = [
|
|
561
|
+
null,
|
|
562
|
+
'0x2::object::ID'
|
|
563
|
+
] satisfies (string | null)[];
|
|
564
|
+
const parameterNames = ["member", "groupId"];
|
|
565
|
+
return (tx: Transaction) => tx.moveCall({
|
|
566
|
+
package: packageAddress,
|
|
567
|
+
module: 'party',
|
|
568
|
+
function: 'is_member',
|
|
569
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
570
|
+
});
|
|
571
|
+
}
|
|
572
|
+
export interface HasPendingInviteArguments {
|
|
573
|
+
group: RawTransactionArgument<string>;
|
|
574
|
+
memberId: RawTransactionArgument<string>;
|
|
575
|
+
}
|
|
576
|
+
export interface HasPendingInviteOptions {
|
|
577
|
+
package?: string;
|
|
578
|
+
arguments: HasPendingInviteArguments | [
|
|
579
|
+
group: RawTransactionArgument<string>,
|
|
580
|
+
memberId: RawTransactionArgument<string>
|
|
581
|
+
];
|
|
582
|
+
}
|
|
583
|
+
/** Whether the group has a pending invite outstanding for `member_id`. */
|
|
584
|
+
export function hasPendingInvite(options: HasPendingInviteOptions) {
|
|
585
|
+
const packageAddress = options.package ?? '@local-pkg/miso_party';
|
|
586
|
+
const argumentsTypes = [
|
|
587
|
+
null,
|
|
588
|
+
'0x2::object::ID'
|
|
589
|
+
] satisfies (string | null)[];
|
|
590
|
+
const parameterNames = ["group", "memberId"];
|
|
591
|
+
return (tx: Transaction) => tx.moveCall({
|
|
592
|
+
package: packageAddress,
|
|
593
|
+
module: 'party',
|
|
594
|
+
function: 'has_pending_invite',
|
|
595
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
596
|
+
});
|
|
597
|
+
}
|
|
598
|
+
export interface HasPendingMembershipArguments {
|
|
599
|
+
member: RawTransactionArgument<string>;
|
|
600
|
+
groupId: RawTransactionArgument<string>;
|
|
601
|
+
}
|
|
602
|
+
export interface HasPendingMembershipOptions {
|
|
603
|
+
package?: string;
|
|
604
|
+
arguments: HasPendingMembershipArguments | [
|
|
605
|
+
member: RawTransactionArgument<string>,
|
|
606
|
+
groupId: RawTransactionArgument<string>
|
|
607
|
+
];
|
|
608
|
+
}
|
|
609
|
+
/**
|
|
610
|
+
* Whether an individual party has a pending membership invitation from a group.
|
|
611
|
+
* Reads the member-facing invitation index, so callers can discover invitations by
|
|
612
|
+
* enumerating only the member party's dynamic fields.
|
|
613
|
+
*/
|
|
614
|
+
export function hasPendingMembership(options: HasPendingMembershipOptions) {
|
|
615
|
+
const packageAddress = options.package ?? '@local-pkg/miso_party';
|
|
616
|
+
const argumentsTypes = [
|
|
617
|
+
null,
|
|
618
|
+
'0x2::object::ID'
|
|
619
|
+
] satisfies (string | null)[];
|
|
620
|
+
const parameterNames = ["member", "groupId"];
|
|
621
|
+
return (tx: Transaction) => tx.moveCall({
|
|
622
|
+
package: packageAddress,
|
|
623
|
+
module: 'party',
|
|
624
|
+
function: 'has_pending_membership',
|
|
625
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
626
|
+
});
|
|
627
|
+
}
|
|
628
|
+
export interface PartyKindNameArguments {
|
|
629
|
+
self: TransactionArgument;
|
|
630
|
+
}
|
|
631
|
+
export interface PartyKindNameOptions {
|
|
632
|
+
package?: string;
|
|
633
|
+
arguments: PartyKindNameArguments | [
|
|
634
|
+
self: TransactionArgument
|
|
635
|
+
];
|
|
636
|
+
}
|
|
637
|
+
/** Returns the human-readable name of the party kind. */
|
|
638
|
+
export function partyKindName(options: PartyKindNameOptions) {
|
|
639
|
+
const packageAddress = options.package ?? '@local-pkg/miso_party';
|
|
640
|
+
const argumentsTypes = [
|
|
641
|
+
null
|
|
642
|
+
] satisfies (string | null)[];
|
|
643
|
+
const parameterNames = ["self"];
|
|
644
|
+
return (tx: Transaction) => tx.moveCall({
|
|
645
|
+
package: packageAddress,
|
|
646
|
+
module: 'party',
|
|
647
|
+
function: 'party_kind_name',
|
|
648
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
649
|
+
});
|
|
650
|
+
}
|
|
651
|
+
export interface AuthorizeArguments {
|
|
652
|
+
self: RawTransactionArgument<string>;
|
|
653
|
+
cap: RawTransactionArgument<string>;
|
|
654
|
+
}
|
|
655
|
+
export interface AuthorizeOptions {
|
|
656
|
+
package?: string;
|
|
657
|
+
arguments: AuthorizeArguments | [
|
|
658
|
+
self: RawTransactionArgument<string>,
|
|
659
|
+
cap: RawTransactionArgument<string>
|
|
660
|
+
];
|
|
661
|
+
}
|
|
662
|
+
/** Verifies that the admin capability matches this party. */
|
|
663
|
+
export function authorize(options: AuthorizeOptions) {
|
|
664
|
+
const packageAddress = options.package ?? '@local-pkg/miso_party';
|
|
665
|
+
const argumentsTypes = [
|
|
666
|
+
null,
|
|
667
|
+
null
|
|
668
|
+
] satisfies (string | null)[];
|
|
669
|
+
const parameterNames = ["self", "cap"];
|
|
670
|
+
return (tx: Transaction) => tx.moveCall({
|
|
671
|
+
package: packageAddress,
|
|
672
|
+
module: 'party',
|
|
673
|
+
function: 'authorize',
|
|
674
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
675
|
+
});
|
|
676
|
+
}
|
|
677
|
+
export interface PartyAdminCapPartyIdArguments {
|
|
678
|
+
cap: RawTransactionArgument<string>;
|
|
679
|
+
}
|
|
680
|
+
export interface PartyAdminCapPartyIdOptions {
|
|
681
|
+
package?: string;
|
|
682
|
+
arguments: PartyAdminCapPartyIdArguments | [
|
|
683
|
+
cap: RawTransactionArgument<string>
|
|
684
|
+
];
|
|
685
|
+
}
|
|
686
|
+
/** Returns the ID of the party associated with the admin capability. */
|
|
687
|
+
export function partyAdminCapPartyId(options: PartyAdminCapPartyIdOptions) {
|
|
688
|
+
const packageAddress = options.package ?? '@local-pkg/miso_party';
|
|
689
|
+
const argumentsTypes = [
|
|
690
|
+
null
|
|
691
|
+
] satisfies (string | null)[];
|
|
692
|
+
const parameterNames = ["cap"];
|
|
693
|
+
return (tx: Transaction) => tx.moveCall({
|
|
694
|
+
package: packageAddress,
|
|
695
|
+
module: 'party',
|
|
696
|
+
function: 'party_admin_cap_party_id',
|
|
697
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
698
|
+
});
|
|
699
|
+
}
|
|
700
|
+
export interface UidArguments {
|
|
701
|
+
self: RawTransactionArgument<string>;
|
|
702
|
+
}
|
|
703
|
+
export interface UidOptions {
|
|
704
|
+
package?: string;
|
|
705
|
+
arguments: UidArguments | [
|
|
706
|
+
self: RawTransactionArgument<string>
|
|
707
|
+
];
|
|
708
|
+
}
|
|
709
|
+
/** Returns a reference to the party's UID for reading dynamic fields. */
|
|
710
|
+
export function uid(options: UidOptions) {
|
|
711
|
+
const packageAddress = options.package ?? '@local-pkg/miso_party';
|
|
712
|
+
const argumentsTypes = [
|
|
713
|
+
null
|
|
714
|
+
] satisfies (string | null)[];
|
|
715
|
+
const parameterNames = ["self"];
|
|
716
|
+
return (tx: Transaction) => tx.moveCall({
|
|
717
|
+
package: packageAddress,
|
|
718
|
+
module: 'party',
|
|
719
|
+
function: 'uid',
|
|
720
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
721
|
+
});
|
|
722
|
+
}
|
|
723
|
+
export interface UidMutArguments {
|
|
724
|
+
self: RawTransactionArgument<string>;
|
|
725
|
+
cap: RawTransactionArgument<string>;
|
|
726
|
+
}
|
|
727
|
+
export interface UidMutOptions {
|
|
728
|
+
package?: string;
|
|
729
|
+
arguments: UidMutArguments | [
|
|
730
|
+
self: RawTransactionArgument<string>,
|
|
731
|
+
cap: RawTransactionArgument<string>
|
|
732
|
+
];
|
|
733
|
+
}
|
|
734
|
+
/**
|
|
735
|
+
* Returns a mutable reference to the party's UID for dynamic field operations.
|
|
736
|
+
* Requires the admin capability.
|
|
737
|
+
*/
|
|
738
|
+
export function uidMut(options: UidMutOptions) {
|
|
739
|
+
const packageAddress = options.package ?? '@local-pkg/miso_party';
|
|
740
|
+
const argumentsTypes = [
|
|
741
|
+
null,
|
|
742
|
+
null
|
|
743
|
+
] satisfies (string | null)[];
|
|
744
|
+
const parameterNames = ["self", "cap"];
|
|
745
|
+
return (tx: Transaction) => tx.moveCall({
|
|
746
|
+
package: packageAddress,
|
|
747
|
+
module: 'party',
|
|
748
|
+
function: 'uid_mut',
|
|
749
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
750
|
+
});
|
|
751
|
+
}
|
|
752
|
+
export interface AssertIsIndividualKindArguments {
|
|
753
|
+
self: RawTransactionArgument<string>;
|
|
754
|
+
}
|
|
755
|
+
export interface AssertIsIndividualKindOptions {
|
|
756
|
+
package?: string;
|
|
757
|
+
arguments: AssertIsIndividualKindArguments | [
|
|
758
|
+
self: RawTransactionArgument<string>
|
|
759
|
+
];
|
|
760
|
+
}
|
|
761
|
+
/** Aborts if this party is not an individual. */
|
|
762
|
+
export function assertIsIndividualKind(options: AssertIsIndividualKindOptions) {
|
|
763
|
+
const packageAddress = options.package ?? '@local-pkg/miso_party';
|
|
764
|
+
const argumentsTypes = [
|
|
765
|
+
null
|
|
766
|
+
] satisfies (string | null)[];
|
|
767
|
+
const parameterNames = ["self"];
|
|
768
|
+
return (tx: Transaction) => tx.moveCall({
|
|
769
|
+
package: packageAddress,
|
|
770
|
+
module: 'party',
|
|
771
|
+
function: 'assert_is_individual_kind',
|
|
772
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
773
|
+
});
|
|
774
|
+
}
|
|
775
|
+
export interface AssertIsGroupKindArguments {
|
|
776
|
+
self: RawTransactionArgument<string>;
|
|
777
|
+
}
|
|
778
|
+
export interface AssertIsGroupKindOptions {
|
|
779
|
+
package?: string;
|
|
780
|
+
arguments: AssertIsGroupKindArguments | [
|
|
781
|
+
self: RawTransactionArgument<string>
|
|
782
|
+
];
|
|
783
|
+
}
|
|
784
|
+
/** Aborts if this party is not a group. */
|
|
785
|
+
export function assertIsGroupKind(options: AssertIsGroupKindOptions) {
|
|
786
|
+
const packageAddress = options.package ?? '@local-pkg/miso_party';
|
|
787
|
+
const argumentsTypes = [
|
|
788
|
+
null
|
|
789
|
+
] satisfies (string | null)[];
|
|
790
|
+
const parameterNames = ["self"];
|
|
791
|
+
return (tx: Transaction) => tx.moveCall({
|
|
792
|
+
package: packageAddress,
|
|
793
|
+
module: 'party',
|
|
794
|
+
function: 'assert_is_group_kind',
|
|
795
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
796
|
+
});
|
|
797
|
+
}
|