@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,502 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Social-platform payloads for the `platform_link` primitive. Each network gets
|
|
8
|
+
* its own `…Data` type — a thin wrapper around the account's handle — so a party
|
|
9
|
+
* can carry one independent `PlatformLink<…Data>` per network (they never collide,
|
|
10
|
+
* and adding a network is a new type here, nothing elsewhere).
|
|
11
|
+
*
|
|
12
|
+
* Only the native handle is stored; the public profile URL is rebuilt client-side
|
|
13
|
+
* (e.g. `x.com/{handle}`, `discord.gg/{handle}`), so a platform reshaping its URLs
|
|
14
|
+
* needs no on-chain change. Validation is intentionally minimal — non-empty plus a
|
|
15
|
+
* generous max length as a storage-hygiene backstop; handle _format_ rules change
|
|
16
|
+
* over time and belong in the app layer.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
import { MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.ts';
|
|
20
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
21
|
+
import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
|
|
22
|
+
const $moduleName = '@local-pkg/party_social::party_social';
|
|
23
|
+
export const XData = new MoveStruct({ name: `${$moduleName}::XData`, fields: {
|
|
24
|
+
handle: bcs.string()
|
|
25
|
+
} });
|
|
26
|
+
export const InstagramData = new MoveStruct({ name: `${$moduleName}::InstagramData`, fields: {
|
|
27
|
+
handle: bcs.string()
|
|
28
|
+
} });
|
|
29
|
+
export const ThreadsData = new MoveStruct({ name: `${$moduleName}::ThreadsData`, fields: {
|
|
30
|
+
handle: bcs.string()
|
|
31
|
+
} });
|
|
32
|
+
export const TikTokData = new MoveStruct({ name: `${$moduleName}::TikTokData`, fields: {
|
|
33
|
+
handle: bcs.string()
|
|
34
|
+
} });
|
|
35
|
+
export const YouTubeData = new MoveStruct({ name: `${$moduleName}::YouTubeData`, fields: {
|
|
36
|
+
handle: bcs.string()
|
|
37
|
+
} });
|
|
38
|
+
export const DiscordData = new MoveStruct({ name: `${$moduleName}::DiscordData`, fields: {
|
|
39
|
+
handle: bcs.string()
|
|
40
|
+
} });
|
|
41
|
+
export const TelegramData = new MoveStruct({ name: `${$moduleName}::TelegramData`, fields: {
|
|
42
|
+
handle: bcs.string()
|
|
43
|
+
} });
|
|
44
|
+
export const RedditData = new MoveStruct({ name: `${$moduleName}::RedditData`, fields: {
|
|
45
|
+
handle: bcs.string()
|
|
46
|
+
} });
|
|
47
|
+
export const TwitchData = new MoveStruct({ name: `${$moduleName}::TwitchData`, fields: {
|
|
48
|
+
handle: bcs.string()
|
|
49
|
+
} });
|
|
50
|
+
export const FacebookData = new MoveStruct({ name: `${$moduleName}::FacebookData`, fields: {
|
|
51
|
+
handle: bcs.string()
|
|
52
|
+
} });
|
|
53
|
+
export interface XArguments {
|
|
54
|
+
handle: RawTransactionArgument<string>;
|
|
55
|
+
}
|
|
56
|
+
export interface XOptions {
|
|
57
|
+
package?: string;
|
|
58
|
+
arguments: XArguments | [
|
|
59
|
+
handle: RawTransactionArgument<string>
|
|
60
|
+
];
|
|
61
|
+
}
|
|
62
|
+
/** Builds an X link from a handle. Aborts if empty. */
|
|
63
|
+
export function x(options: XOptions) {
|
|
64
|
+
const packageAddress = options.package ?? '@local-pkg/party_social';
|
|
65
|
+
const argumentsTypes = [
|
|
66
|
+
'0x1::string::String'
|
|
67
|
+
] satisfies (string | null)[];
|
|
68
|
+
const parameterNames = ["handle"];
|
|
69
|
+
return (tx: Transaction) => tx.moveCall({
|
|
70
|
+
package: packageAddress,
|
|
71
|
+
module: 'party_social',
|
|
72
|
+
function: 'x',
|
|
73
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
export interface InstagramArguments {
|
|
77
|
+
handle: RawTransactionArgument<string>;
|
|
78
|
+
}
|
|
79
|
+
export interface InstagramOptions {
|
|
80
|
+
package?: string;
|
|
81
|
+
arguments: InstagramArguments | [
|
|
82
|
+
handle: RawTransactionArgument<string>
|
|
83
|
+
];
|
|
84
|
+
}
|
|
85
|
+
/** Builds an Instagram link from a handle. Aborts if empty. */
|
|
86
|
+
export function instagram(options: InstagramOptions) {
|
|
87
|
+
const packageAddress = options.package ?? '@local-pkg/party_social';
|
|
88
|
+
const argumentsTypes = [
|
|
89
|
+
'0x1::string::String'
|
|
90
|
+
] satisfies (string | null)[];
|
|
91
|
+
const parameterNames = ["handle"];
|
|
92
|
+
return (tx: Transaction) => tx.moveCall({
|
|
93
|
+
package: packageAddress,
|
|
94
|
+
module: 'party_social',
|
|
95
|
+
function: 'instagram',
|
|
96
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
export interface ThreadsArguments {
|
|
100
|
+
handle: RawTransactionArgument<string>;
|
|
101
|
+
}
|
|
102
|
+
export interface ThreadsOptions {
|
|
103
|
+
package?: string;
|
|
104
|
+
arguments: ThreadsArguments | [
|
|
105
|
+
handle: RawTransactionArgument<string>
|
|
106
|
+
];
|
|
107
|
+
}
|
|
108
|
+
/** Builds a Threads link from a handle. Aborts if empty. */
|
|
109
|
+
export function threads(options: ThreadsOptions) {
|
|
110
|
+
const packageAddress = options.package ?? '@local-pkg/party_social';
|
|
111
|
+
const argumentsTypes = [
|
|
112
|
+
'0x1::string::String'
|
|
113
|
+
] satisfies (string | null)[];
|
|
114
|
+
const parameterNames = ["handle"];
|
|
115
|
+
return (tx: Transaction) => tx.moveCall({
|
|
116
|
+
package: packageAddress,
|
|
117
|
+
module: 'party_social',
|
|
118
|
+
function: 'threads',
|
|
119
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
export interface TiktokArguments {
|
|
123
|
+
handle: RawTransactionArgument<string>;
|
|
124
|
+
}
|
|
125
|
+
export interface TiktokOptions {
|
|
126
|
+
package?: string;
|
|
127
|
+
arguments: TiktokArguments | [
|
|
128
|
+
handle: RawTransactionArgument<string>
|
|
129
|
+
];
|
|
130
|
+
}
|
|
131
|
+
/** Builds a TikTok link from a handle. Aborts if empty. */
|
|
132
|
+
export function tiktok(options: TiktokOptions) {
|
|
133
|
+
const packageAddress = options.package ?? '@local-pkg/party_social';
|
|
134
|
+
const argumentsTypes = [
|
|
135
|
+
'0x1::string::String'
|
|
136
|
+
] satisfies (string | null)[];
|
|
137
|
+
const parameterNames = ["handle"];
|
|
138
|
+
return (tx: Transaction) => tx.moveCall({
|
|
139
|
+
package: packageAddress,
|
|
140
|
+
module: 'party_social',
|
|
141
|
+
function: 'tiktok',
|
|
142
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
export interface YoutubeArguments {
|
|
146
|
+
handle: RawTransactionArgument<string>;
|
|
147
|
+
}
|
|
148
|
+
export interface YoutubeOptions {
|
|
149
|
+
package?: string;
|
|
150
|
+
arguments: YoutubeArguments | [
|
|
151
|
+
handle: RawTransactionArgument<string>
|
|
152
|
+
];
|
|
153
|
+
}
|
|
154
|
+
/** Builds a YouTube link from a handle or channel identifier. Aborts if empty. */
|
|
155
|
+
export function youtube(options: YoutubeOptions) {
|
|
156
|
+
const packageAddress = options.package ?? '@local-pkg/party_social';
|
|
157
|
+
const argumentsTypes = [
|
|
158
|
+
'0x1::string::String'
|
|
159
|
+
] satisfies (string | null)[];
|
|
160
|
+
const parameterNames = ["handle"];
|
|
161
|
+
return (tx: Transaction) => tx.moveCall({
|
|
162
|
+
package: packageAddress,
|
|
163
|
+
module: 'party_social',
|
|
164
|
+
function: 'youtube',
|
|
165
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
export interface DiscordArguments {
|
|
169
|
+
handle: RawTransactionArgument<string>;
|
|
170
|
+
}
|
|
171
|
+
export interface DiscordOptions {
|
|
172
|
+
package?: string;
|
|
173
|
+
arguments: DiscordArguments | [
|
|
174
|
+
handle: RawTransactionArgument<string>
|
|
175
|
+
];
|
|
176
|
+
}
|
|
177
|
+
/** Builds a Discord link from a server-invite code. Aborts if empty. */
|
|
178
|
+
export function discord(options: DiscordOptions) {
|
|
179
|
+
const packageAddress = options.package ?? '@local-pkg/party_social';
|
|
180
|
+
const argumentsTypes = [
|
|
181
|
+
'0x1::string::String'
|
|
182
|
+
] satisfies (string | null)[];
|
|
183
|
+
const parameterNames = ["handle"];
|
|
184
|
+
return (tx: Transaction) => tx.moveCall({
|
|
185
|
+
package: packageAddress,
|
|
186
|
+
module: 'party_social',
|
|
187
|
+
function: 'discord',
|
|
188
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
export interface TelegramArguments {
|
|
192
|
+
handle: RawTransactionArgument<string>;
|
|
193
|
+
}
|
|
194
|
+
export interface TelegramOptions {
|
|
195
|
+
package?: string;
|
|
196
|
+
arguments: TelegramArguments | [
|
|
197
|
+
handle: RawTransactionArgument<string>
|
|
198
|
+
];
|
|
199
|
+
}
|
|
200
|
+
/** Builds a Telegram link from a username or channel. Aborts if empty. */
|
|
201
|
+
export function telegram(options: TelegramOptions) {
|
|
202
|
+
const packageAddress = options.package ?? '@local-pkg/party_social';
|
|
203
|
+
const argumentsTypes = [
|
|
204
|
+
'0x1::string::String'
|
|
205
|
+
] satisfies (string | null)[];
|
|
206
|
+
const parameterNames = ["handle"];
|
|
207
|
+
return (tx: Transaction) => tx.moveCall({
|
|
208
|
+
package: packageAddress,
|
|
209
|
+
module: 'party_social',
|
|
210
|
+
function: 'telegram',
|
|
211
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
export interface RedditArguments {
|
|
215
|
+
handle: RawTransactionArgument<string>;
|
|
216
|
+
}
|
|
217
|
+
export interface RedditOptions {
|
|
218
|
+
package?: string;
|
|
219
|
+
arguments: RedditArguments | [
|
|
220
|
+
handle: RawTransactionArgument<string>
|
|
221
|
+
];
|
|
222
|
+
}
|
|
223
|
+
/** Builds a Reddit link from a username. Aborts if empty. */
|
|
224
|
+
export function reddit(options: RedditOptions) {
|
|
225
|
+
const packageAddress = options.package ?? '@local-pkg/party_social';
|
|
226
|
+
const argumentsTypes = [
|
|
227
|
+
'0x1::string::String'
|
|
228
|
+
] satisfies (string | null)[];
|
|
229
|
+
const parameterNames = ["handle"];
|
|
230
|
+
return (tx: Transaction) => tx.moveCall({
|
|
231
|
+
package: packageAddress,
|
|
232
|
+
module: 'party_social',
|
|
233
|
+
function: 'reddit',
|
|
234
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
export interface TwitchArguments {
|
|
238
|
+
handle: RawTransactionArgument<string>;
|
|
239
|
+
}
|
|
240
|
+
export interface TwitchOptions {
|
|
241
|
+
package?: string;
|
|
242
|
+
arguments: TwitchArguments | [
|
|
243
|
+
handle: RawTransactionArgument<string>
|
|
244
|
+
];
|
|
245
|
+
}
|
|
246
|
+
/** Builds a Twitch link from a channel name. Aborts if empty. */
|
|
247
|
+
export function twitch(options: TwitchOptions) {
|
|
248
|
+
const packageAddress = options.package ?? '@local-pkg/party_social';
|
|
249
|
+
const argumentsTypes = [
|
|
250
|
+
'0x1::string::String'
|
|
251
|
+
] satisfies (string | null)[];
|
|
252
|
+
const parameterNames = ["handle"];
|
|
253
|
+
return (tx: Transaction) => tx.moveCall({
|
|
254
|
+
package: packageAddress,
|
|
255
|
+
module: 'party_social',
|
|
256
|
+
function: 'twitch',
|
|
257
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
export interface FacebookArguments {
|
|
261
|
+
handle: RawTransactionArgument<string>;
|
|
262
|
+
}
|
|
263
|
+
export interface FacebookOptions {
|
|
264
|
+
package?: string;
|
|
265
|
+
arguments: FacebookArguments | [
|
|
266
|
+
handle: RawTransactionArgument<string>
|
|
267
|
+
];
|
|
268
|
+
}
|
|
269
|
+
/** Builds a Facebook link from a page username or id. Aborts if empty. */
|
|
270
|
+
export function facebook(options: FacebookOptions) {
|
|
271
|
+
const packageAddress = options.package ?? '@local-pkg/party_social';
|
|
272
|
+
const argumentsTypes = [
|
|
273
|
+
'0x1::string::String'
|
|
274
|
+
] satisfies (string | null)[];
|
|
275
|
+
const parameterNames = ["handle"];
|
|
276
|
+
return (tx: Transaction) => tx.moveCall({
|
|
277
|
+
package: packageAddress,
|
|
278
|
+
module: 'party_social',
|
|
279
|
+
function: 'facebook',
|
|
280
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
export interface XHandleArguments {
|
|
284
|
+
self: TransactionArgument;
|
|
285
|
+
}
|
|
286
|
+
export interface XHandleOptions {
|
|
287
|
+
package?: string;
|
|
288
|
+
arguments: XHandleArguments | [
|
|
289
|
+
self: TransactionArgument
|
|
290
|
+
];
|
|
291
|
+
}
|
|
292
|
+
export function xHandle(options: XHandleOptions) {
|
|
293
|
+
const packageAddress = options.package ?? '@local-pkg/party_social';
|
|
294
|
+
const argumentsTypes = [
|
|
295
|
+
null
|
|
296
|
+
] satisfies (string | null)[];
|
|
297
|
+
const parameterNames = ["self"];
|
|
298
|
+
return (tx: Transaction) => tx.moveCall({
|
|
299
|
+
package: packageAddress,
|
|
300
|
+
module: 'party_social',
|
|
301
|
+
function: 'x_handle',
|
|
302
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
export interface InstagramHandleArguments {
|
|
306
|
+
self: TransactionArgument;
|
|
307
|
+
}
|
|
308
|
+
export interface InstagramHandleOptions {
|
|
309
|
+
package?: string;
|
|
310
|
+
arguments: InstagramHandleArguments | [
|
|
311
|
+
self: TransactionArgument
|
|
312
|
+
];
|
|
313
|
+
}
|
|
314
|
+
export function instagramHandle(options: InstagramHandleOptions) {
|
|
315
|
+
const packageAddress = options.package ?? '@local-pkg/party_social';
|
|
316
|
+
const argumentsTypes = [
|
|
317
|
+
null
|
|
318
|
+
] satisfies (string | null)[];
|
|
319
|
+
const parameterNames = ["self"];
|
|
320
|
+
return (tx: Transaction) => tx.moveCall({
|
|
321
|
+
package: packageAddress,
|
|
322
|
+
module: 'party_social',
|
|
323
|
+
function: 'instagram_handle',
|
|
324
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
export interface ThreadsHandleArguments {
|
|
328
|
+
self: TransactionArgument;
|
|
329
|
+
}
|
|
330
|
+
export interface ThreadsHandleOptions {
|
|
331
|
+
package?: string;
|
|
332
|
+
arguments: ThreadsHandleArguments | [
|
|
333
|
+
self: TransactionArgument
|
|
334
|
+
];
|
|
335
|
+
}
|
|
336
|
+
export function threadsHandle(options: ThreadsHandleOptions) {
|
|
337
|
+
const packageAddress = options.package ?? '@local-pkg/party_social';
|
|
338
|
+
const argumentsTypes = [
|
|
339
|
+
null
|
|
340
|
+
] satisfies (string | null)[];
|
|
341
|
+
const parameterNames = ["self"];
|
|
342
|
+
return (tx: Transaction) => tx.moveCall({
|
|
343
|
+
package: packageAddress,
|
|
344
|
+
module: 'party_social',
|
|
345
|
+
function: 'threads_handle',
|
|
346
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
export interface TiktokHandleArguments {
|
|
350
|
+
self: TransactionArgument;
|
|
351
|
+
}
|
|
352
|
+
export interface TiktokHandleOptions {
|
|
353
|
+
package?: string;
|
|
354
|
+
arguments: TiktokHandleArguments | [
|
|
355
|
+
self: TransactionArgument
|
|
356
|
+
];
|
|
357
|
+
}
|
|
358
|
+
export function tiktokHandle(options: TiktokHandleOptions) {
|
|
359
|
+
const packageAddress = options.package ?? '@local-pkg/party_social';
|
|
360
|
+
const argumentsTypes = [
|
|
361
|
+
null
|
|
362
|
+
] satisfies (string | null)[];
|
|
363
|
+
const parameterNames = ["self"];
|
|
364
|
+
return (tx: Transaction) => tx.moveCall({
|
|
365
|
+
package: packageAddress,
|
|
366
|
+
module: 'party_social',
|
|
367
|
+
function: 'tiktok_handle',
|
|
368
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
export interface YoutubeHandleArguments {
|
|
372
|
+
self: TransactionArgument;
|
|
373
|
+
}
|
|
374
|
+
export interface YoutubeHandleOptions {
|
|
375
|
+
package?: string;
|
|
376
|
+
arguments: YoutubeHandleArguments | [
|
|
377
|
+
self: TransactionArgument
|
|
378
|
+
];
|
|
379
|
+
}
|
|
380
|
+
export function youtubeHandle(options: YoutubeHandleOptions) {
|
|
381
|
+
const packageAddress = options.package ?? '@local-pkg/party_social';
|
|
382
|
+
const argumentsTypes = [
|
|
383
|
+
null
|
|
384
|
+
] satisfies (string | null)[];
|
|
385
|
+
const parameterNames = ["self"];
|
|
386
|
+
return (tx: Transaction) => tx.moveCall({
|
|
387
|
+
package: packageAddress,
|
|
388
|
+
module: 'party_social',
|
|
389
|
+
function: 'youtube_handle',
|
|
390
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
export interface DiscordHandleArguments {
|
|
394
|
+
self: TransactionArgument;
|
|
395
|
+
}
|
|
396
|
+
export interface DiscordHandleOptions {
|
|
397
|
+
package?: string;
|
|
398
|
+
arguments: DiscordHandleArguments | [
|
|
399
|
+
self: TransactionArgument
|
|
400
|
+
];
|
|
401
|
+
}
|
|
402
|
+
export function discordHandle(options: DiscordHandleOptions) {
|
|
403
|
+
const packageAddress = options.package ?? '@local-pkg/party_social';
|
|
404
|
+
const argumentsTypes = [
|
|
405
|
+
null
|
|
406
|
+
] satisfies (string | null)[];
|
|
407
|
+
const parameterNames = ["self"];
|
|
408
|
+
return (tx: Transaction) => tx.moveCall({
|
|
409
|
+
package: packageAddress,
|
|
410
|
+
module: 'party_social',
|
|
411
|
+
function: 'discord_handle',
|
|
412
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
export interface TelegramHandleArguments {
|
|
416
|
+
self: TransactionArgument;
|
|
417
|
+
}
|
|
418
|
+
export interface TelegramHandleOptions {
|
|
419
|
+
package?: string;
|
|
420
|
+
arguments: TelegramHandleArguments | [
|
|
421
|
+
self: TransactionArgument
|
|
422
|
+
];
|
|
423
|
+
}
|
|
424
|
+
export function telegramHandle(options: TelegramHandleOptions) {
|
|
425
|
+
const packageAddress = options.package ?? '@local-pkg/party_social';
|
|
426
|
+
const argumentsTypes = [
|
|
427
|
+
null
|
|
428
|
+
] satisfies (string | null)[];
|
|
429
|
+
const parameterNames = ["self"];
|
|
430
|
+
return (tx: Transaction) => tx.moveCall({
|
|
431
|
+
package: packageAddress,
|
|
432
|
+
module: 'party_social',
|
|
433
|
+
function: 'telegram_handle',
|
|
434
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
435
|
+
});
|
|
436
|
+
}
|
|
437
|
+
export interface RedditHandleArguments {
|
|
438
|
+
self: TransactionArgument;
|
|
439
|
+
}
|
|
440
|
+
export interface RedditHandleOptions {
|
|
441
|
+
package?: string;
|
|
442
|
+
arguments: RedditHandleArguments | [
|
|
443
|
+
self: TransactionArgument
|
|
444
|
+
];
|
|
445
|
+
}
|
|
446
|
+
export function redditHandle(options: RedditHandleOptions) {
|
|
447
|
+
const packageAddress = options.package ?? '@local-pkg/party_social';
|
|
448
|
+
const argumentsTypes = [
|
|
449
|
+
null
|
|
450
|
+
] satisfies (string | null)[];
|
|
451
|
+
const parameterNames = ["self"];
|
|
452
|
+
return (tx: Transaction) => tx.moveCall({
|
|
453
|
+
package: packageAddress,
|
|
454
|
+
module: 'party_social',
|
|
455
|
+
function: 'reddit_handle',
|
|
456
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
457
|
+
});
|
|
458
|
+
}
|
|
459
|
+
export interface TwitchHandleArguments {
|
|
460
|
+
self: TransactionArgument;
|
|
461
|
+
}
|
|
462
|
+
export interface TwitchHandleOptions {
|
|
463
|
+
package?: string;
|
|
464
|
+
arguments: TwitchHandleArguments | [
|
|
465
|
+
self: TransactionArgument
|
|
466
|
+
];
|
|
467
|
+
}
|
|
468
|
+
export function twitchHandle(options: TwitchHandleOptions) {
|
|
469
|
+
const packageAddress = options.package ?? '@local-pkg/party_social';
|
|
470
|
+
const argumentsTypes = [
|
|
471
|
+
null
|
|
472
|
+
] satisfies (string | null)[];
|
|
473
|
+
const parameterNames = ["self"];
|
|
474
|
+
return (tx: Transaction) => tx.moveCall({
|
|
475
|
+
package: packageAddress,
|
|
476
|
+
module: 'party_social',
|
|
477
|
+
function: 'twitch_handle',
|
|
478
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
479
|
+
});
|
|
480
|
+
}
|
|
481
|
+
export interface FacebookHandleArguments {
|
|
482
|
+
self: TransactionArgument;
|
|
483
|
+
}
|
|
484
|
+
export interface FacebookHandleOptions {
|
|
485
|
+
package?: string;
|
|
486
|
+
arguments: FacebookHandleArguments | [
|
|
487
|
+
self: TransactionArgument
|
|
488
|
+
];
|
|
489
|
+
}
|
|
490
|
+
export function facebookHandle(options: FacebookHandleOptions) {
|
|
491
|
+
const packageAddress = options.package ?? '@local-pkg/party_social';
|
|
492
|
+
const argumentsTypes = [
|
|
493
|
+
null
|
|
494
|
+
] satisfies (string | null)[];
|
|
495
|
+
const parameterNames = ["self"];
|
|
496
|
+
return (tx: Transaction) => tx.moveCall({
|
|
497
|
+
package: packageAddress,
|
|
498
|
+
module: 'party_social',
|
|
499
|
+
function: 'facebook_handle',
|
|
500
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
501
|
+
});
|
|
502
|
+
}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Free-form tags for a party — moods, scenes, and descriptors (e.g. "ambient",
|
|
8
|
+
* "deconstructed club", "leftfield pop").
|
|
9
|
+
*
|
|
10
|
+
* The uncurated sibling to `party_genre`: genres reference a canonical, shared
|
|
11
|
+
* vocabulary; tags are whatever the artist types. The set mechanics — storage,
|
|
12
|
+
* duplicate and capacity checks, field reclamation — live in the shared
|
|
13
|
+
* `typed_set` primitive; this package keeps only what is tag-specific: length
|
|
14
|
+
* validation, the capacity, and the typed events. Duplicate / not-present /
|
|
15
|
+
* over-max aborts come from `typed_set` with its own error codes. Tags are stored
|
|
16
|
+
* as given (exact dedupe); normalization for search/display is a client concern.
|
|
17
|
+
* Gated by the `PartyAdminCap`; views are permissionless.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
import { MoveTuple, MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.ts';
|
|
21
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
22
|
+
import { type Transaction } from '@mysten/sui/transactions';
|
|
23
|
+
const $moduleName = '@local-pkg/party_tags::party_tags';
|
|
24
|
+
export const TagsKey = new MoveTuple({ name: `${$moduleName}::TagsKey`, fields: [bcs.bool()] });
|
|
25
|
+
export const TagAddedEvent = new MoveStruct({ name: `${$moduleName}::TagAddedEvent`, fields: {
|
|
26
|
+
party_id: bcs.Address,
|
|
27
|
+
tag: bcs.string()
|
|
28
|
+
} });
|
|
29
|
+
export const TagRemovedEvent = new MoveStruct({ name: `${$moduleName}::TagRemovedEvent`, fields: {
|
|
30
|
+
party_id: bcs.Address,
|
|
31
|
+
tag: bcs.string()
|
|
32
|
+
} });
|
|
33
|
+
export const TagsClearedEvent = new MoveStruct({ name: `${$moduleName}::TagsClearedEvent`, fields: {
|
|
34
|
+
party_id: bcs.Address
|
|
35
|
+
} });
|
|
36
|
+
export interface AddTagArguments {
|
|
37
|
+
self: RawTransactionArgument<string>;
|
|
38
|
+
cap: RawTransactionArgument<string>;
|
|
39
|
+
tag: RawTransactionArgument<string>;
|
|
40
|
+
}
|
|
41
|
+
export interface AddTagOptions {
|
|
42
|
+
package?: string;
|
|
43
|
+
arguments: AddTagArguments | [
|
|
44
|
+
self: RawTransactionArgument<string>,
|
|
45
|
+
cap: RawTransactionArgument<string>,
|
|
46
|
+
tag: RawTransactionArgument<string>
|
|
47
|
+
];
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Adds a tag to the party. Aborts if empty or too long here, and in `typed_set` if
|
|
51
|
+
* already present or the max is reached.
|
|
52
|
+
*/
|
|
53
|
+
export function addTag(options: AddTagOptions) {
|
|
54
|
+
const packageAddress = options.package ?? '@local-pkg/party_tags';
|
|
55
|
+
const argumentsTypes = [
|
|
56
|
+
null,
|
|
57
|
+
null,
|
|
58
|
+
'0x1::string::String'
|
|
59
|
+
] satisfies (string | null)[];
|
|
60
|
+
const parameterNames = ["self", "cap", "tag"];
|
|
61
|
+
return (tx: Transaction) => tx.moveCall({
|
|
62
|
+
package: packageAddress,
|
|
63
|
+
module: 'party_tags',
|
|
64
|
+
function: 'add_tag',
|
|
65
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
export interface RemoveTagArguments {
|
|
69
|
+
self: RawTransactionArgument<string>;
|
|
70
|
+
cap: RawTransactionArgument<string>;
|
|
71
|
+
tag: RawTransactionArgument<string>;
|
|
72
|
+
}
|
|
73
|
+
export interface RemoveTagOptions {
|
|
74
|
+
package?: string;
|
|
75
|
+
arguments: RemoveTagArguments | [
|
|
76
|
+
self: RawTransactionArgument<string>,
|
|
77
|
+
cap: RawTransactionArgument<string>,
|
|
78
|
+
tag: RawTransactionArgument<string>
|
|
79
|
+
];
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Removes a tag from the party. Aborts in `typed_set` if not present. The whole
|
|
83
|
+
* field is dropped when the last tag leaves, so `has_tags` tracks "carries tags",
|
|
84
|
+
* not "has ever tagged".
|
|
85
|
+
*/
|
|
86
|
+
export function removeTag(options: RemoveTagOptions) {
|
|
87
|
+
const packageAddress = options.package ?? '@local-pkg/party_tags';
|
|
88
|
+
const argumentsTypes = [
|
|
89
|
+
null,
|
|
90
|
+
null,
|
|
91
|
+
'0x1::string::String'
|
|
92
|
+
] satisfies (string | null)[];
|
|
93
|
+
const parameterNames = ["self", "cap", "tag"];
|
|
94
|
+
return (tx: Transaction) => tx.moveCall({
|
|
95
|
+
package: packageAddress,
|
|
96
|
+
module: 'party_tags',
|
|
97
|
+
function: 'remove_tag',
|
|
98
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
export interface ClearTagsArguments {
|
|
102
|
+
self: RawTransactionArgument<string>;
|
|
103
|
+
cap: RawTransactionArgument<string>;
|
|
104
|
+
}
|
|
105
|
+
export interface ClearTagsOptions {
|
|
106
|
+
package?: string;
|
|
107
|
+
arguments: ClearTagsArguments | [
|
|
108
|
+
self: RawTransactionArgument<string>,
|
|
109
|
+
cap: RawTransactionArgument<string>
|
|
110
|
+
];
|
|
111
|
+
}
|
|
112
|
+
/** Removes the party's entire tag set. No-op if none is set. */
|
|
113
|
+
export function clearTags(options: ClearTagsOptions) {
|
|
114
|
+
const packageAddress = options.package ?? '@local-pkg/party_tags';
|
|
115
|
+
const argumentsTypes = [
|
|
116
|
+
null,
|
|
117
|
+
null
|
|
118
|
+
] satisfies (string | null)[];
|
|
119
|
+
const parameterNames = ["self", "cap"];
|
|
120
|
+
return (tx: Transaction) => tx.moveCall({
|
|
121
|
+
package: packageAddress,
|
|
122
|
+
module: 'party_tags',
|
|
123
|
+
function: 'clear_tags',
|
|
124
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
export interface HasTagsArguments {
|
|
128
|
+
self: RawTransactionArgument<string>;
|
|
129
|
+
}
|
|
130
|
+
export interface HasTagsOptions {
|
|
131
|
+
package?: string;
|
|
132
|
+
arguments: HasTagsArguments | [
|
|
133
|
+
self: RawTransactionArgument<string>
|
|
134
|
+
];
|
|
135
|
+
}
|
|
136
|
+
/** Whether the party carries any tags. */
|
|
137
|
+
export function hasTags(options: HasTagsOptions) {
|
|
138
|
+
const packageAddress = options.package ?? '@local-pkg/party_tags';
|
|
139
|
+
const argumentsTypes = [
|
|
140
|
+
null
|
|
141
|
+
] satisfies (string | null)[];
|
|
142
|
+
const parameterNames = ["self"];
|
|
143
|
+
return (tx: Transaction) => tx.moveCall({
|
|
144
|
+
package: packageAddress,
|
|
145
|
+
module: 'party_tags',
|
|
146
|
+
function: 'has_tags',
|
|
147
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
export interface HasTagArguments {
|
|
151
|
+
self: RawTransactionArgument<string>;
|
|
152
|
+
tag: RawTransactionArgument<string>;
|
|
153
|
+
}
|
|
154
|
+
export interface HasTagOptions {
|
|
155
|
+
package?: string;
|
|
156
|
+
arguments: HasTagArguments | [
|
|
157
|
+
self: RawTransactionArgument<string>,
|
|
158
|
+
tag: RawTransactionArgument<string>
|
|
159
|
+
];
|
|
160
|
+
}
|
|
161
|
+
/** Whether the party carries the given tag. */
|
|
162
|
+
export function hasTag(options: HasTagOptions) {
|
|
163
|
+
const packageAddress = options.package ?? '@local-pkg/party_tags';
|
|
164
|
+
const argumentsTypes = [
|
|
165
|
+
null,
|
|
166
|
+
'0x1::string::String'
|
|
167
|
+
] satisfies (string | null)[];
|
|
168
|
+
const parameterNames = ["self", "tag"];
|
|
169
|
+
return (tx: Transaction) => tx.moveCall({
|
|
170
|
+
package: packageAddress,
|
|
171
|
+
module: 'party_tags',
|
|
172
|
+
function: 'has_tag',
|
|
173
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
export interface TagsArguments {
|
|
177
|
+
self: RawTransactionArgument<string>;
|
|
178
|
+
}
|
|
179
|
+
export interface TagsOptions {
|
|
180
|
+
package?: string;
|
|
181
|
+
arguments: TagsArguments | [
|
|
182
|
+
self: RawTransactionArgument<string>
|
|
183
|
+
];
|
|
184
|
+
}
|
|
185
|
+
/** The party's tags. */
|
|
186
|
+
export function tags(options: TagsOptions) {
|
|
187
|
+
const packageAddress = options.package ?? '@local-pkg/party_tags';
|
|
188
|
+
const argumentsTypes = [
|
|
189
|
+
null
|
|
190
|
+
] satisfies (string | null)[];
|
|
191
|
+
const parameterNames = ["self"];
|
|
192
|
+
return (tx: Transaction) => tx.moveCall({
|
|
193
|
+
package: packageAddress,
|
|
194
|
+
module: 'party_tags',
|
|
195
|
+
function: 'tags',
|
|
196
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
197
|
+
});
|
|
198
|
+
}
|