@zing-protocol/zing-sdk 0.0.1 → 0.0.3
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/dist/_generated/index.js +6 -0
- package/dist/_generated/utils/index.d.ts +12 -0
- package/dist/_generated/utils/index.js +135 -0
- package/dist/_generated/zing_framework/coin_utils.d.ts +15 -0
- package/dist/_generated/zing_framework/coin_utils.js +19 -0
- package/dist/_generated/zing_framework/deps/sui/object.d.ts +8 -0
- package/{src/_generated/zing_governance/deps/sui/object.ts → dist/_generated/zing_framework/deps/sui/object.js} +4 -7
- package/dist/_generated/zing_framework/derived_object_bag.d.ts +166 -0
- package/dist/_generated/zing_framework/derived_object_bag.js +221 -0
- package/dist/_generated/zing_framework/derived_table.d.ts +153 -0
- package/dist/_generated/zing_framework/derived_table.js +200 -0
- package/dist/_generated/zing_governance/admin.d.ts +20 -0
- package/dist/_generated/zing_governance/admin.js +26 -0
- package/dist/_generated/zing_governance/deps/sui/object.d.ts +8 -0
- package/{src/_generated/zing_identity/deps/sui/object.ts → dist/_generated/zing_governance/deps/sui/object.js} +4 -7
- package/dist/_generated/zing_governance/treasury.d.ts +56 -0
- package/dist/_generated/zing_governance/treasury.js +78 -0
- package/dist/_generated/zing_identity/config.d.ts +87 -0
- package/dist/_generated/zing_identity/config.js +98 -0
- package/{src/_generated/zing_studio/deps/std/type_name.ts → dist/_generated/zing_identity/deps/std/type_name.d.ts} +3 -11
- package/dist/_generated/zing_identity/deps/std/type_name.js +22 -0
- package/dist/_generated/zing_identity/deps/sui/object.d.ts +8 -0
- package/{src/_generated/zing_studio/deps/sui/object.ts → dist/_generated/zing_identity/deps/sui/object.js} +4 -7
- package/dist/_generated/zing_identity/deps/sui/object_table.d.ts +12 -0
- package/{src/_generated/zing_identity/deps/sui/object_table.ts → dist/_generated/zing_identity/deps/sui/object_table.js} +7 -10
- package/dist/_generated/zing_identity/deps/sui/table.d.ts +12 -0
- package/{src/_generated/zing_studio/deps/sui/table.ts → dist/_generated/zing_identity/deps/sui/table.js} +7 -10
- package/{src/_generated/zing_identity/deps/sui/vec_set.ts → dist/_generated/zing_identity/deps/sui/vec_set.d.ts} +3 -14
- package/dist/_generated/zing_identity/deps/sui/vec_set.js +22 -0
- package/dist/_generated/zing_identity/ecdsa.d.ts +81 -0
- package/dist/_generated/zing_identity/ecdsa.js +87 -0
- package/dist/_generated/zing_identity/identity.d.ts +262 -0
- package/dist/_generated/zing_identity/identity.js +294 -0
- package/dist/_generated/zing_identity/reclaim.d.ts +356 -0
- package/dist/_generated/zing_identity/reclaim.js +414 -0
- package/dist/_generated/zing_studio/app.d.ts +351 -0
- package/dist/_generated/zing_studio/app.js +451 -0
- package/dist/_generated/zing_studio/article.d.ts +331 -0
- package/dist/_generated/zing_studio/article.js +331 -0
- package/dist/_generated/zing_studio/config.d.ts +203 -0
- package/dist/_generated/zing_studio/config.js +233 -0
- package/{src/_generated/zing_identity/deps/std/type_name.ts → dist/_generated/zing_studio/deps/std/type_name.d.ts} +3 -11
- package/dist/_generated/zing_studio/deps/std/type_name.js +22 -0
- package/dist/_generated/zing_studio/deps/sui/bag.d.ts +12 -0
- package/{src/_generated/zing_studio/deps/sui/bag.ts → dist/_generated/zing_studio/deps/sui/bag.js} +7 -10
- package/dist/_generated/zing_studio/deps/sui/balance.d.ts +12 -0
- package/{src/_generated/zing_studio/deps/sui/balance.ts → dist/_generated/zing_studio/deps/sui/balance.js} +4 -7
- package/dist/_generated/zing_studio/deps/sui/coin.d.ts +12 -0
- package/{src/_generated/zing_studio/deps/sui/coin.ts → dist/_generated/zing_studio/deps/sui/coin.js} +5 -8
- package/dist/_generated/zing_studio/deps/sui/dynamic_field.d.ts +126 -0
- package/dist/_generated/zing_studio/deps/sui/dynamic_field.js +140 -0
- package/dist/_generated/zing_studio/deps/sui/object.d.ts +8 -0
- package/{src/_generated/zing_framework/deps/sui/object.ts → dist/_generated/zing_studio/deps/sui/object.js} +4 -7
- package/dist/_generated/zing_studio/deps/sui/table.d.ts +12 -0
- package/{src/_generated/zing_identity/deps/sui/table.ts → dist/_generated/zing_studio/deps/sui/table.js} +7 -10
- package/dist/_generated/zing_studio/deps/sui/vec_map.d.ts +30 -0
- package/{src/_generated/zing_studio/deps/sui/vec_map.ts → dist/_generated/zing_studio/deps/sui/vec_map.js} +15 -21
- package/{src/_generated/zing_studio/deps/sui/vec_set.ts → dist/_generated/zing_studio/deps/sui/vec_set.d.ts} +3 -14
- package/dist/_generated/zing_studio/deps/sui/vec_set.js +22 -0
- package/dist/_generated/zing_studio/deps/walrus/blob.d.ts +20 -0
- package/{src/_generated/zing_studio/deps/walrus/blob.ts → dist/_generated/zing_studio/deps/walrus/blob.js} +11 -12
- package/dist/_generated/zing_studio/deps/walrus/events.d.ts +83 -0
- package/dist/_generated/zing_studio/deps/walrus/events.js +122 -0
- package/dist/_generated/zing_studio/deps/walrus/metadata.d.ts +71 -0
- package/dist/_generated/zing_studio/deps/walrus/metadata.js +73 -0
- package/dist/_generated/zing_studio/deps/walrus/storage_resource.d.ts +12 -0
- package/{src/_generated/zing_studio/deps/walrus/storage_resource.ts → dist/_generated/zing_studio/deps/walrus/storage_resource.js} +7 -8
- package/dist/_generated/zing_studio/deps/zing_framework/derived_object_bag.d.ts +12 -0
- package/{src/_generated/zing_studio/deps/zing_framework/derived_object_bag.ts → dist/_generated/zing_studio/deps/zing_framework/derived_object_bag.js} +7 -8
- package/dist/_generated/zing_studio/deps/zing_framework/derived_table.d.ts +12 -0
- package/{src/_generated/zing_studio/deps/zing_framework/derived_table.ts → dist/_generated/zing_studio/deps/zing_framework/derived_table.js} +7 -8
- package/dist/_generated/zing_studio/donation.d.ts +24 -0
- package/{src/_generated/zing_studio/donation.ts → dist/_generated/zing_studio/donation.js} +7 -8
- package/dist/_generated/zing_studio/enclave.d.ts +187 -0
- package/dist/_generated/zing_studio/enclave.js +231 -0
- package/dist/_generated/zing_studio/nitro_attestation.d.ts +148 -0
- package/dist/_generated/zing_studio/nitro_attestation.js +183 -0
- package/dist/_generated/zing_studio/referral.d.ts +166 -0
- package/dist/_generated/zing_studio/referral.js +224 -0
- package/dist/_generated/zing_studio/storage.d.ts +327 -0
- package/dist/_generated/zing_studio/storage.js +365 -0
- package/dist/_generated/zing_studio/studio.d.ts +282 -0
- package/dist/_generated/zing_studio/studio.js +360 -0
- package/dist/bcs.d.ts +61 -0
- package/dist/bcs.js +109 -0
- package/dist/client/index.d.ts +228 -0
- package/dist/client/index.js +296 -0
- package/dist/client/types.d.ts +23 -0
- package/dist/client/types.js +1 -0
- package/dist/components/index.js +3 -0
- package/dist/components/wallet-provider.d.ts +7 -0
- package/dist/components/wallet-provider.js +33 -0
- package/dist/components/walrus-provider.d.ts +31 -0
- package/dist/components/walrus-provider.js +71 -0
- package/dist/components/zing-provider.d.ts +15 -0
- package/dist/components/zing-provider.js +22 -0
- package/dist/config/common.d.ts +23 -0
- package/dist/config/common.js +61 -0
- package/dist/config/index.d.ts +8 -0
- package/dist/config/index.js +28 -0
- package/dist/config/mainnet.d.ts +6 -0
- package/dist/config/mainnet.js +80 -0
- package/dist/config/testnet.d.ts +6 -0
- package/dist/config/testnet.js +81 -0
- package/dist/config/types.d.ts +49 -0
- package/dist/config/types.js +1 -0
- package/dist/const.d.ts +4 -0
- package/dist/const.js +25 -0
- package/dist/getters.d.ts +228 -0
- package/dist/getters.js +317 -0
- package/{src/hooks/index.ts → dist/hooks/index.d.ts} +2 -3
- package/dist/hooks/index.js +9 -0
- package/dist/hooks/useGetStudio.d.ts +26 -0
- package/dist/hooks/useGetStudio.js +17 -0
- package/dist/hooks/useGetTierPlan.d.ts +7 -0
- package/dist/hooks/useGetTierPlan.js +85 -0
- package/dist/hooks/useReclaim.d.ts +12 -0
- package/dist/hooks/useReclaim.js +87 -0
- package/dist/hooks/useSignAndExecuteTransaction.d.ts +6 -0
- package/dist/hooks/useSignAndExecuteTransaction.js +40 -0
- package/dist/hooks/useSignPersonalMessage.d.ts +8 -0
- package/dist/hooks/useSignPersonalMessage.js +21 -0
- package/dist/hooks/useZingInfiniteQueries.d.ts +75 -0
- package/dist/hooks/useZingInfiniteQueries.js +28 -0
- package/dist/hooks/useZingMutation.d.ts +35 -0
- package/dist/hooks/useZingMutation.js +37 -0
- package/dist/hooks/useZingQueries.d.ts +127 -0
- package/dist/hooks/useZingQueries.js +37 -0
- package/dist/hooks/useZingQuery.d.ts +147 -0
- package/dist/hooks/useZingQuery.js +34 -0
- package/{src/index.ts → dist/index.d.ts} +2 -3
- package/dist/index.js +9 -0
- package/dist/lib/utils/colorful-logger.d.ts +2 -0
- package/dist/lib/utils/colorful-logger.js +23 -0
- package/dist/lib/utils/const.d.ts +25 -0
- package/dist/lib/utils/const.js +25 -0
- package/dist/lib/utils/helpers.d.ts +10 -0
- package/dist/lib/utils/helpers.js +49 -0
- package/dist/lib/utils/index.js +4 -0
- package/dist/lib/utils/init-app-with-shadow.d.ts +6 -0
- package/dist/lib/utils/init-app-with-shadow.js +28 -0
- package/dist/lib/utils/quilt.d.ts +61 -0
- package/dist/lib/utils/quilt.js +194 -0
- package/dist/lib/utils/reclaim.d.ts +29 -0
- package/dist/lib/utils/reclaim.js +88 -0
- package/dist/lib/utils/types.d.ts +5 -0
- package/dist/lib/utils/types.js +1 -0
- package/dist/mutations/index.js +3 -0
- package/dist/mutations/seal.d.ts +12 -0
- package/dist/mutations/seal.js +41 -0
- package/dist/mutations/signer.d.ts +10 -0
- package/dist/mutations/signer.js +176 -0
- package/dist/mutations/walrus.d.ts +98 -0
- package/dist/mutations/walrus.js +488 -0
- package/dist/stores/index.js +3 -0
- package/dist/stores/walletStore.d.ts +48 -0
- package/dist/stores/walletStore.js +232 -0
- package/dist/stores/walrusStore.d.ts +28 -0
- package/dist/stores/walrusStore.js +61 -0
- package/dist/stores/zkloginStore.d.ts +28 -0
- package/dist/stores/zkloginStore.js +27 -0
- package/dist/types.d.ts +99 -0
- package/dist/types.js +1 -0
- package/package.json +18 -10
- package/src/_generated/utils/index.ts +0 -181
- package/src/_generated/zing_framework/coin_utils.ts +0 -41
- package/src/_generated/zing_framework/derived_object_bag.ts +0 -400
- package/src/_generated/zing_framework/derived_table.ts +0 -366
- package/src/_generated/zing_governance/admin.ts +0 -47
- package/src/_generated/zing_governance/treasury.ts +0 -134
- package/src/_generated/zing_identity/config.ts +0 -191
- package/src/_generated/zing_identity/ecdsa.ts +0 -166
- package/src/_generated/zing_identity/identity.ts +0 -661
- package/src/_generated/zing_identity/reclaim.ts +0 -803
- package/src/_generated/zing_studio/app.ts +0 -855
- package/src/_generated/zing_studio/article.ts +0 -598
- package/src/_generated/zing_studio/config.ts +0 -475
- package/src/_generated/zing_studio/deps/sui/dynamic_field.ts +0 -272
- package/src/_generated/zing_studio/deps/walrus/events.ts +0 -124
- package/src/_generated/zing_studio/deps/walrus/metadata.ts +0 -137
- package/src/_generated/zing_studio/enclave.ts +0 -466
- package/src/_generated/zing_studio/nitro_attestation.ts +0 -308
- package/src/_generated/zing_studio/referral.ts +0 -447
- package/src/_generated/zing_studio/storage.ts +0 -664
- package/src/_generated/zing_studio/studio.ts +0 -682
- package/src/bcs.ts +0 -139
- package/src/client/index.ts +0 -557
- package/src/client/types.ts +0 -28
- package/src/components/wallet-provider.tsx +0 -53
- package/src/components/walrus-provider.tsx +0 -212
- package/src/components/zing-provider.tsx +0 -54
- package/src/config/common.ts +0 -82
- package/src/config/index.ts +0 -45
- package/src/config/mainnet.ts +0 -109
- package/src/config/testnet.ts +0 -111
- package/src/config/types.ts +0 -69
- package/src/const.ts +0 -32
- package/src/getters.ts +0 -523
- package/src/hooks/useGetStudio.ts +0 -22
- package/src/hooks/useGetTierPlan.ts +0 -115
- package/src/hooks/useReclaim.ts +0 -165
- package/src/hooks/useSignAndExecuteTransaction.ts +0 -57
- package/src/hooks/useSignPersonalMessage.ts +0 -28
- package/src/hooks/useZingInfiniteQueries.ts +0 -92
- package/src/hooks/useZingMutation.ts +0 -66
- package/src/hooks/useZingQueries.ts +0 -107
- package/src/hooks/useZingQuery.ts +0 -88
- package/src/lib/utils/colorful-logger.ts +0 -27
- package/src/lib/utils/const.ts +0 -25
- package/src/lib/utils/helpers.ts +0 -78
- package/src/lib/utils/init-app-with-shadow.ts +0 -42
- package/src/lib/utils/quilt.ts +0 -317
- package/src/lib/utils/reclaim.ts +0 -148
- package/src/lib/utils/types.ts +0 -14
- package/src/mutations/seal.ts +0 -78
- package/src/mutations/signer.ts +0 -241
- package/src/mutations/walrus.ts +0 -862
- package/src/stores/walletStore.ts +0 -360
- package/src/stores/walrusStore.ts +0 -118
- package/src/stores/zkloginStore.ts +0 -53
- package/src/types.ts +0 -120
- package/tsconfig.json +0 -12
- /package/{src/_generated/index.js → dist/_generated/index.d.ts} +0 -0
- /package/{src/components/index.ts → dist/components/index.d.ts} +0 -0
- /package/{src/lib/utils/index.ts → dist/lib/utils/index.d.ts} +0 -0
- /package/{src/mutations/index.ts → dist/mutations/index.d.ts} +0 -0
- /package/{src/stores/index.ts → dist/stores/index.d.ts} +0 -0
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
import { MoveTuple, MoveStruct } from "../utils/index.js";
|
|
2
|
+
import type { RawTransactionArgument } from "../utils/index.js";
|
|
3
|
+
import type { Transaction } from "@mysten/sui/transactions";
|
|
4
|
+
export declare const Period: MoveTuple<import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">[], "@local-pkg/zing_studio::studio::Period">;
|
|
5
|
+
export declare const NewStudioEvent: MoveStruct<{
|
|
6
|
+
owner: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
7
|
+
studio_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
8
|
+
}, "@local-pkg/zing_studio::studio::NewStudioEvent">;
|
|
9
|
+
export declare const STUDIO: MoveStruct<{
|
|
10
|
+
dummy_field: import("@mysten/sui/bcs").BcsType<boolean, boolean, "bool">;
|
|
11
|
+
}, "@local-pkg/zing_studio::studio::STUDIO">;
|
|
12
|
+
export declare const Studio: MoveStruct<{
|
|
13
|
+
id: MoveStruct<{
|
|
14
|
+
id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
15
|
+
}, "0x2::object::UID">;
|
|
16
|
+
/** The owner of this studio - only they can add/remove works */
|
|
17
|
+
owner: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
18
|
+
period: MoveTuple<import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">[], "@local-pkg/zing_studio::studio::Period">;
|
|
19
|
+
/**
|
|
20
|
+
* The fee amount charged by creators for fans to access their content. (quoted in
|
|
21
|
+
* USD)
|
|
22
|
+
*/
|
|
23
|
+
monthly_subscription_fee: MoveStruct<{
|
|
24
|
+
contents: import("@mysten/sui/bcs").BcsType<{
|
|
25
|
+
key: number;
|
|
26
|
+
value: string;
|
|
27
|
+
}[], Iterable<{
|
|
28
|
+
key: number;
|
|
29
|
+
value: string | number | bigint;
|
|
30
|
+
}> & {
|
|
31
|
+
length: number;
|
|
32
|
+
}, string>;
|
|
33
|
+
}, "0x2::vec_map::VecMap<u8, u64>">;
|
|
34
|
+
/** membership of your studio and expired timestamp; none means permanent membership */
|
|
35
|
+
membership: MoveStruct<{
|
|
36
|
+
id: MoveStruct<{
|
|
37
|
+
id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
38
|
+
}, "0x2::object::UID">;
|
|
39
|
+
size: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
40
|
+
}, "zing_framework::derived_table::DerivedTable">;
|
|
41
|
+
/** Bag containing the actual asset objects, indexed by their IDs */
|
|
42
|
+
works: MoveStruct<{
|
|
43
|
+
id: MoveStruct<{
|
|
44
|
+
id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
45
|
+
}, "0x2::object::UID">;
|
|
46
|
+
size: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
47
|
+
}, "zing_framework::derived_object_bag::DerivedObjectBag">;
|
|
48
|
+
encrypted_file_key: import("@mysten/sui/bcs").BcsType<number[] | null, (Iterable<number> & {
|
|
49
|
+
length: number;
|
|
50
|
+
}) | null | undefined, "Option<vector<u8>>">;
|
|
51
|
+
}, "@local-pkg/zing_studio::studio::Studio">;
|
|
52
|
+
export declare const Member: MoveStruct<{
|
|
53
|
+
level: import("@mysten/sui/bcs").BcsType<number, number, "u8">;
|
|
54
|
+
expired_at: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
55
|
+
}, "@local-pkg/zing_studio::studio::Member">;
|
|
56
|
+
export interface OwnerArguments {
|
|
57
|
+
self: RawTransactionArgument<string>;
|
|
58
|
+
}
|
|
59
|
+
export interface OwnerOptions {
|
|
60
|
+
package?: string;
|
|
61
|
+
arguments: OwnerArguments | [self: RawTransactionArgument<string>];
|
|
62
|
+
}
|
|
63
|
+
/** Returns the owner address of this studio */
|
|
64
|
+
export declare function owner(options: OwnerOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
65
|
+
export interface PeriodArguments {
|
|
66
|
+
self: RawTransactionArgument<string>;
|
|
67
|
+
}
|
|
68
|
+
export interface PeriodOptions {
|
|
69
|
+
package?: string;
|
|
70
|
+
arguments: PeriodArguments | [self: RawTransactionArgument<string>];
|
|
71
|
+
}
|
|
72
|
+
export declare function period(options: PeriodOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
73
|
+
export interface StartAtArguments {
|
|
74
|
+
self: RawTransactionArgument<string>;
|
|
75
|
+
}
|
|
76
|
+
export interface StartAtOptions {
|
|
77
|
+
package?: string;
|
|
78
|
+
arguments: StartAtArguments | [self: RawTransactionArgument<string>];
|
|
79
|
+
}
|
|
80
|
+
export declare function startAt(options: StartAtOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
81
|
+
export interface EndAtArguments {
|
|
82
|
+
self: RawTransactionArgument<string>;
|
|
83
|
+
}
|
|
84
|
+
export interface EndAtOptions {
|
|
85
|
+
package?: string;
|
|
86
|
+
arguments: EndAtArguments | [self: RawTransactionArgument<string>];
|
|
87
|
+
}
|
|
88
|
+
export declare function endAt(options: EndAtOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
89
|
+
export interface MemberLevelArguments {
|
|
90
|
+
member: RawTransactionArgument<string>;
|
|
91
|
+
}
|
|
92
|
+
export interface MemberLevelOptions {
|
|
93
|
+
package?: string;
|
|
94
|
+
arguments: MemberLevelArguments | [member: RawTransactionArgument<string>];
|
|
95
|
+
}
|
|
96
|
+
export declare function memberLevel(options: MemberLevelOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
97
|
+
export interface MemberExpiredAtArguments {
|
|
98
|
+
member: RawTransactionArgument<string>;
|
|
99
|
+
}
|
|
100
|
+
export interface MemberExpiredAtOptions {
|
|
101
|
+
package?: string;
|
|
102
|
+
arguments: MemberExpiredAtArguments | [member: RawTransactionArgument<string>];
|
|
103
|
+
}
|
|
104
|
+
export declare function memberExpiredAt(options: MemberExpiredAtOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
105
|
+
export interface MonthlySubscriptionFeeArguments {
|
|
106
|
+
self: RawTransactionArgument<string>;
|
|
107
|
+
}
|
|
108
|
+
export interface MonthlySubscriptionFeeOptions {
|
|
109
|
+
package?: string;
|
|
110
|
+
arguments: MonthlySubscriptionFeeArguments | [self: RawTransactionArgument<string>];
|
|
111
|
+
}
|
|
112
|
+
export declare function monthlySubscriptionFee(options: MonthlySubscriptionFeeOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
113
|
+
export interface MembershipArguments {
|
|
114
|
+
self: RawTransactionArgument<string>;
|
|
115
|
+
}
|
|
116
|
+
export interface MembershipOptions {
|
|
117
|
+
package?: string;
|
|
118
|
+
arguments: MembershipArguments | [self: RawTransactionArgument<string>];
|
|
119
|
+
}
|
|
120
|
+
export declare function membership(options: MembershipOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
121
|
+
export interface AssetOfArguments {
|
|
122
|
+
self: RawTransactionArgument<string>;
|
|
123
|
+
assetId: RawTransactionArgument<string>;
|
|
124
|
+
}
|
|
125
|
+
export interface AssetOfOptions {
|
|
126
|
+
package?: string;
|
|
127
|
+
arguments: AssetOfArguments | [
|
|
128
|
+
self: RawTransactionArgument<string>,
|
|
129
|
+
assetId: RawTransactionArgument<string>
|
|
130
|
+
];
|
|
131
|
+
typeArguments: [string];
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Returns an immutable reference to a specific asset by its ID Panics if the asset
|
|
135
|
+
* doesn't exist or has wrong type
|
|
136
|
+
*/
|
|
137
|
+
export declare function assetOf(options: AssetOfOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
138
|
+
export interface WorksArguments {
|
|
139
|
+
self: RawTransactionArgument<string>;
|
|
140
|
+
}
|
|
141
|
+
export interface WorksOptions {
|
|
142
|
+
package?: string;
|
|
143
|
+
arguments: WorksArguments | [self: RawTransactionArgument<string>];
|
|
144
|
+
}
|
|
145
|
+
export declare function works(options: WorksOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
146
|
+
export interface EncryptedFileKeyArguments {
|
|
147
|
+
self: RawTransactionArgument<string>;
|
|
148
|
+
}
|
|
149
|
+
export interface EncryptedFileKeyOptions {
|
|
150
|
+
package?: string;
|
|
151
|
+
arguments: EncryptedFileKeyArguments | [self: RawTransactionArgument<string>];
|
|
152
|
+
}
|
|
153
|
+
export declare function encryptedFileKey(options: EncryptedFileKeyOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
154
|
+
export interface SealApproveStudioOwnerArguments {
|
|
155
|
+
id: RawTransactionArgument<number[]>;
|
|
156
|
+
config: RawTransactionArgument<string>;
|
|
157
|
+
self: RawTransactionArgument<string>;
|
|
158
|
+
}
|
|
159
|
+
export interface SealApproveStudioOwnerOptions {
|
|
160
|
+
package?: string;
|
|
161
|
+
arguments: SealApproveStudioOwnerArguments | [
|
|
162
|
+
id: RawTransactionArgument<number[]>,
|
|
163
|
+
config: RawTransactionArgument<string>,
|
|
164
|
+
self: RawTransactionArgument<string>
|
|
165
|
+
];
|
|
166
|
+
}
|
|
167
|
+
export declare function sealApproveStudioOwner(options: SealApproveStudioOwnerOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
168
|
+
export interface SealApproveRegisteredEnclaveArguments {
|
|
169
|
+
id: RawTransactionArgument<number[]>;
|
|
170
|
+
config: RawTransactionArgument<string>;
|
|
171
|
+
self: RawTransactionArgument<string>;
|
|
172
|
+
enclave: RawTransactionArgument<string>;
|
|
173
|
+
}
|
|
174
|
+
export interface SealApproveRegisteredEnclaveOptions {
|
|
175
|
+
package?: string;
|
|
176
|
+
arguments: SealApproveRegisteredEnclaveArguments | [
|
|
177
|
+
id: RawTransactionArgument<number[]>,
|
|
178
|
+
config: RawTransactionArgument<string>,
|
|
179
|
+
self: RawTransactionArgument<string>,
|
|
180
|
+
enclave: RawTransactionArgument<string>
|
|
181
|
+
];
|
|
182
|
+
}
|
|
183
|
+
export declare function sealApproveRegisteredEnclave(options: SealApproveRegisteredEnclaveOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
184
|
+
export interface SealApproveManagerArguments {
|
|
185
|
+
id: RawTransactionArgument<number[]>;
|
|
186
|
+
config: RawTransactionArgument<string>;
|
|
187
|
+
self: RawTransactionArgument<string>;
|
|
188
|
+
}
|
|
189
|
+
export interface SealApproveManagerOptions {
|
|
190
|
+
package?: string;
|
|
191
|
+
arguments: SealApproveManagerArguments | [
|
|
192
|
+
id: RawTransactionArgument<number[]>,
|
|
193
|
+
config: RawTransactionArgument<string>,
|
|
194
|
+
self: RawTransactionArgument<string>
|
|
195
|
+
];
|
|
196
|
+
}
|
|
197
|
+
export declare function sealApproveManager(options: SealApproveManagerOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
198
|
+
export interface StudioOfArguments {
|
|
199
|
+
config: RawTransactionArgument<string>;
|
|
200
|
+
owner: RawTransactionArgument<string>;
|
|
201
|
+
}
|
|
202
|
+
export interface StudioOfOptions {
|
|
203
|
+
package?: string;
|
|
204
|
+
arguments: StudioOfArguments | [
|
|
205
|
+
config: RawTransactionArgument<string>,
|
|
206
|
+
owner: RawTransactionArgument<string>
|
|
207
|
+
];
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Calculates the expected ID of a studio for a given owner Uses deterministic
|
|
211
|
+
* address derivation based on config and owner
|
|
212
|
+
*/
|
|
213
|
+
export declare function studioOf(options: StudioOfOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
214
|
+
export interface StudioExistsArguments {
|
|
215
|
+
config: RawTransactionArgument<string>;
|
|
216
|
+
owner: RawTransactionArgument<string>;
|
|
217
|
+
}
|
|
218
|
+
export interface StudioExistsOptions {
|
|
219
|
+
package?: string;
|
|
220
|
+
arguments: StudioExistsArguments | [
|
|
221
|
+
config: RawTransactionArgument<string>,
|
|
222
|
+
owner: RawTransactionArgument<string>
|
|
223
|
+
];
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Checks if a studio already exists for the given owner Returns true if the studio
|
|
227
|
+
* has been created, false otherwise
|
|
228
|
+
*/
|
|
229
|
+
export declare function studioExists(options: StudioExistsOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
230
|
+
export interface IsInValidPeriodArguments {
|
|
231
|
+
self: RawTransactionArgument<string>;
|
|
232
|
+
}
|
|
233
|
+
export interface IsInValidPeriodOptions {
|
|
234
|
+
package?: string;
|
|
235
|
+
arguments: IsInValidPeriodArguments | [self: RawTransactionArgument<string>];
|
|
236
|
+
}
|
|
237
|
+
export declare function isInValidPeriod(options: IsInValidPeriodOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
238
|
+
export interface MembershipLevelArguments {
|
|
239
|
+
self: RawTransactionArgument<string>;
|
|
240
|
+
member: RawTransactionArgument<string>;
|
|
241
|
+
}
|
|
242
|
+
export interface MembershipLevelOptions {
|
|
243
|
+
package?: string;
|
|
244
|
+
arguments: MembershipLevelArguments | [
|
|
245
|
+
self: RawTransactionArgument<string>,
|
|
246
|
+
member: RawTransactionArgument<string>
|
|
247
|
+
];
|
|
248
|
+
}
|
|
249
|
+
export declare function membershipLevel(options: MembershipLevelOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
250
|
+
export interface IsMembershipArguments {
|
|
251
|
+
self: RawTransactionArgument<string>;
|
|
252
|
+
member: RawTransactionArgument<string>;
|
|
253
|
+
}
|
|
254
|
+
export interface IsMembershipOptions {
|
|
255
|
+
package?: string;
|
|
256
|
+
arguments: IsMembershipArguments | [
|
|
257
|
+
self: RawTransactionArgument<string>,
|
|
258
|
+
member: RawTransactionArgument<string>
|
|
259
|
+
];
|
|
260
|
+
}
|
|
261
|
+
export declare function isMembership(options: IsMembershipOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
262
|
+
export interface NewArguments {
|
|
263
|
+
config: RawTransactionArgument<string>;
|
|
264
|
+
}
|
|
265
|
+
export interface NewOptions {
|
|
266
|
+
package?: string;
|
|
267
|
+
arguments: NewArguments | [config: RawTransactionArgument<string>];
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Creates a new personal studio as a shared object Each user can only have one
|
|
271
|
+
* studio, enforced by derived object mechanism The studio is immediately shared so
|
|
272
|
+
* others can view (but not modify) the works
|
|
273
|
+
*/
|
|
274
|
+
export declare function _new(options: NewOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
275
|
+
export interface ShareStudioArguments {
|
|
276
|
+
self: RawTransactionArgument<string>;
|
|
277
|
+
}
|
|
278
|
+
export interface ShareStudioOptions {
|
|
279
|
+
package?: string;
|
|
280
|
+
arguments: ShareStudioArguments | [self: RawTransactionArgument<string>];
|
|
281
|
+
}
|
|
282
|
+
export declare function shareStudio(options: ShareStudioOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
import * as object from "./deps/sui/object.js";
|
|
5
|
+
import * as vec_map from "./deps/sui/vec_map.js";
|
|
6
|
+
import * as derived_object_bag from "./deps/zing_framework/derived_object_bag.js";
|
|
7
|
+
import * as derived_table from "./deps/zing_framework/derived_table.js";
|
|
8
|
+
import { MoveTuple, MoveStruct, normalizeMoveArguments, } from "../utils/index.js";
|
|
9
|
+
import { bcs } from "@mysten/sui/bcs";
|
|
10
|
+
const $moduleName = "@local-pkg/zing_studio::studio";
|
|
11
|
+
export const Period = new MoveTuple({
|
|
12
|
+
name: `${$moduleName}::Period`,
|
|
13
|
+
fields: [bcs.u64(), bcs.u64()],
|
|
14
|
+
});
|
|
15
|
+
export const NewStudioEvent = new MoveStruct({
|
|
16
|
+
name: `${$moduleName}::NewStudioEvent`,
|
|
17
|
+
fields: {
|
|
18
|
+
owner: bcs.Address,
|
|
19
|
+
studio_id: bcs.Address,
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
export const STUDIO = new MoveStruct({
|
|
23
|
+
name: `${$moduleName}::STUDIO`,
|
|
24
|
+
fields: {
|
|
25
|
+
dummy_field: bcs.bool(),
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
export const Studio = new MoveStruct({
|
|
29
|
+
name: `${$moduleName}::Studio`,
|
|
30
|
+
fields: {
|
|
31
|
+
id: object.UID,
|
|
32
|
+
/** The owner of this studio - only they can add/remove works */
|
|
33
|
+
owner: bcs.Address,
|
|
34
|
+
period: Period,
|
|
35
|
+
/**
|
|
36
|
+
* The fee amount charged by creators for fans to access their content. (quoted in
|
|
37
|
+
* USD)
|
|
38
|
+
*/
|
|
39
|
+
monthly_subscription_fee: vec_map.VecMap(bcs.u8(), bcs.u64()),
|
|
40
|
+
/** membership of your studio and expired timestamp; none means permanent membership */
|
|
41
|
+
membership: derived_table.DerivedTable,
|
|
42
|
+
/** Bag containing the actual asset objects, indexed by their IDs */
|
|
43
|
+
works: derived_object_bag.DerivedObjectBag,
|
|
44
|
+
encrypted_file_key: bcs.option(bcs.vector(bcs.u8())),
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
export const Member = new MoveStruct({
|
|
48
|
+
name: `${$moduleName}::Member`,
|
|
49
|
+
fields: {
|
|
50
|
+
level: bcs.u8(),
|
|
51
|
+
expired_at: bcs.u64(),
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
/** Returns the owner address of this studio */
|
|
55
|
+
export function owner(options) {
|
|
56
|
+
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
57
|
+
const argumentsTypes = [
|
|
58
|
+
`${packageAddress}::studio::Studio`,
|
|
59
|
+
];
|
|
60
|
+
const parameterNames = ["self"];
|
|
61
|
+
return (tx) => tx.moveCall({
|
|
62
|
+
package: packageAddress,
|
|
63
|
+
module: "studio",
|
|
64
|
+
function: "owner",
|
|
65
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
export function period(options) {
|
|
69
|
+
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
70
|
+
const argumentsTypes = [
|
|
71
|
+
`${packageAddress}::studio::Studio`,
|
|
72
|
+
];
|
|
73
|
+
const parameterNames = ["self"];
|
|
74
|
+
return (tx) => tx.moveCall({
|
|
75
|
+
package: packageAddress,
|
|
76
|
+
module: "studio",
|
|
77
|
+
function: "period",
|
|
78
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
export function startAt(options) {
|
|
82
|
+
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
83
|
+
const argumentsTypes = [
|
|
84
|
+
`${packageAddress}::studio::Studio`,
|
|
85
|
+
];
|
|
86
|
+
const parameterNames = ["self"];
|
|
87
|
+
return (tx) => tx.moveCall({
|
|
88
|
+
package: packageAddress,
|
|
89
|
+
module: "studio",
|
|
90
|
+
function: "start_at",
|
|
91
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
export function endAt(options) {
|
|
95
|
+
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
96
|
+
const argumentsTypes = [
|
|
97
|
+
`${packageAddress}::studio::Studio`,
|
|
98
|
+
];
|
|
99
|
+
const parameterNames = ["self"];
|
|
100
|
+
return (tx) => tx.moveCall({
|
|
101
|
+
package: packageAddress,
|
|
102
|
+
module: "studio",
|
|
103
|
+
function: "end_at",
|
|
104
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
export function memberLevel(options) {
|
|
108
|
+
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
109
|
+
const argumentsTypes = [
|
|
110
|
+
`${packageAddress}::studio::Member`,
|
|
111
|
+
];
|
|
112
|
+
const parameterNames = ["member"];
|
|
113
|
+
return (tx) => tx.moveCall({
|
|
114
|
+
package: packageAddress,
|
|
115
|
+
module: "studio",
|
|
116
|
+
function: "member_level",
|
|
117
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
export function memberExpiredAt(options) {
|
|
121
|
+
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
122
|
+
const argumentsTypes = [
|
|
123
|
+
`${packageAddress}::studio::Member`,
|
|
124
|
+
];
|
|
125
|
+
const parameterNames = ["member"];
|
|
126
|
+
return (tx) => tx.moveCall({
|
|
127
|
+
package: packageAddress,
|
|
128
|
+
module: "studio",
|
|
129
|
+
function: "member_expired_at",
|
|
130
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
export function monthlySubscriptionFee(options) {
|
|
134
|
+
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
135
|
+
const argumentsTypes = [
|
|
136
|
+
`${packageAddress}::studio::Studio`,
|
|
137
|
+
];
|
|
138
|
+
const parameterNames = ["self"];
|
|
139
|
+
return (tx) => tx.moveCall({
|
|
140
|
+
package: packageAddress,
|
|
141
|
+
module: "studio",
|
|
142
|
+
function: "monthly_subscription_fee",
|
|
143
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
export function membership(options) {
|
|
147
|
+
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
148
|
+
const argumentsTypes = [
|
|
149
|
+
`${packageAddress}::studio::Studio`,
|
|
150
|
+
];
|
|
151
|
+
const parameterNames = ["self"];
|
|
152
|
+
return (tx) => tx.moveCall({
|
|
153
|
+
package: packageAddress,
|
|
154
|
+
module: "studio",
|
|
155
|
+
function: "membership",
|
|
156
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Returns an immutable reference to a specific asset by its ID Panics if the asset
|
|
161
|
+
* doesn't exist or has wrong type
|
|
162
|
+
*/
|
|
163
|
+
export function assetOf(options) {
|
|
164
|
+
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
165
|
+
const argumentsTypes = [
|
|
166
|
+
`${packageAddress}::studio::Studio`,
|
|
167
|
+
"0x0000000000000000000000000000000000000000000000000000000000000002::object::ID",
|
|
168
|
+
];
|
|
169
|
+
const parameterNames = ["self", "assetId"];
|
|
170
|
+
return (tx) => tx.moveCall({
|
|
171
|
+
package: packageAddress,
|
|
172
|
+
module: "studio",
|
|
173
|
+
function: "asset_of",
|
|
174
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
175
|
+
typeArguments: options.typeArguments,
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
export function works(options) {
|
|
179
|
+
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
180
|
+
const argumentsTypes = [
|
|
181
|
+
`${packageAddress}::studio::Studio`,
|
|
182
|
+
];
|
|
183
|
+
const parameterNames = ["self"];
|
|
184
|
+
return (tx) => tx.moveCall({
|
|
185
|
+
package: packageAddress,
|
|
186
|
+
module: "studio",
|
|
187
|
+
function: "works",
|
|
188
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
export function encryptedFileKey(options) {
|
|
192
|
+
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
193
|
+
const argumentsTypes = [
|
|
194
|
+
`${packageAddress}::studio::Studio`,
|
|
195
|
+
];
|
|
196
|
+
const parameterNames = ["self"];
|
|
197
|
+
return (tx) => tx.moveCall({
|
|
198
|
+
package: packageAddress,
|
|
199
|
+
module: "studio",
|
|
200
|
+
function: "encrypted_file_key",
|
|
201
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
export function sealApproveStudioOwner(options) {
|
|
205
|
+
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
206
|
+
const argumentsTypes = [
|
|
207
|
+
"vector<u8>",
|
|
208
|
+
`${packageAddress}::config::Config`,
|
|
209
|
+
`${packageAddress}::studio::Studio`,
|
|
210
|
+
];
|
|
211
|
+
const parameterNames = ["id", "config", "self"];
|
|
212
|
+
return (tx) => tx.moveCall({
|
|
213
|
+
package: packageAddress,
|
|
214
|
+
module: "studio",
|
|
215
|
+
function: "seal_approve_studio_owner",
|
|
216
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
export function sealApproveRegisteredEnclave(options) {
|
|
220
|
+
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
221
|
+
const argumentsTypes = [
|
|
222
|
+
"vector<u8>",
|
|
223
|
+
`${packageAddress}::config::Config`,
|
|
224
|
+
`${packageAddress}::studio::Studio`,
|
|
225
|
+
`${packageAddress}::enclave::Enclave`,
|
|
226
|
+
];
|
|
227
|
+
const parameterNames = ["id", "config", "self", "enclave"];
|
|
228
|
+
return (tx) => tx.moveCall({
|
|
229
|
+
package: packageAddress,
|
|
230
|
+
module: "studio",
|
|
231
|
+
function: "seal_approve_registered_enclave",
|
|
232
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
export function sealApproveManager(options) {
|
|
236
|
+
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
237
|
+
const argumentsTypes = [
|
|
238
|
+
"vector<u8>",
|
|
239
|
+
`${packageAddress}::config::Config`,
|
|
240
|
+
`${packageAddress}::studio::Studio`,
|
|
241
|
+
];
|
|
242
|
+
const parameterNames = ["id", "config", "self"];
|
|
243
|
+
return (tx) => tx.moveCall({
|
|
244
|
+
package: packageAddress,
|
|
245
|
+
module: "studio",
|
|
246
|
+
function: "seal_approve_manager",
|
|
247
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Calculates the expected ID of a studio for a given owner Uses deterministic
|
|
252
|
+
* address derivation based on config and owner
|
|
253
|
+
*/
|
|
254
|
+
export function studioOf(options) {
|
|
255
|
+
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
256
|
+
const argumentsTypes = [
|
|
257
|
+
`${packageAddress}::config::Config`,
|
|
258
|
+
"address",
|
|
259
|
+
];
|
|
260
|
+
const parameterNames = ["config", "owner"];
|
|
261
|
+
return (tx) => tx.moveCall({
|
|
262
|
+
package: packageAddress,
|
|
263
|
+
module: "studio",
|
|
264
|
+
function: "studio_of",
|
|
265
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Checks if a studio already exists for the given owner Returns true if the studio
|
|
270
|
+
* has been created, false otherwise
|
|
271
|
+
*/
|
|
272
|
+
export function studioExists(options) {
|
|
273
|
+
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
274
|
+
const argumentsTypes = [
|
|
275
|
+
`${packageAddress}::config::Config`,
|
|
276
|
+
"address",
|
|
277
|
+
];
|
|
278
|
+
const parameterNames = ["config", "owner"];
|
|
279
|
+
return (tx) => tx.moveCall({
|
|
280
|
+
package: packageAddress,
|
|
281
|
+
module: "studio",
|
|
282
|
+
function: "studio_exists",
|
|
283
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
export function isInValidPeriod(options) {
|
|
287
|
+
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
288
|
+
const argumentsTypes = [
|
|
289
|
+
`${packageAddress}::studio::Studio`,
|
|
290
|
+
"0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock",
|
|
291
|
+
];
|
|
292
|
+
const parameterNames = ["self"];
|
|
293
|
+
return (tx) => tx.moveCall({
|
|
294
|
+
package: packageAddress,
|
|
295
|
+
module: "studio",
|
|
296
|
+
function: "is_in_valid_period",
|
|
297
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
export function membershipLevel(options) {
|
|
301
|
+
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
302
|
+
const argumentsTypes = [
|
|
303
|
+
`${packageAddress}::studio::Studio`,
|
|
304
|
+
"address",
|
|
305
|
+
"0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock",
|
|
306
|
+
];
|
|
307
|
+
const parameterNames = ["self", "member"];
|
|
308
|
+
return (tx) => tx.moveCall({
|
|
309
|
+
package: packageAddress,
|
|
310
|
+
module: "studio",
|
|
311
|
+
function: "membership_level",
|
|
312
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
export function isMembership(options) {
|
|
316
|
+
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
317
|
+
const argumentsTypes = [
|
|
318
|
+
`${packageAddress}::studio::Studio`,
|
|
319
|
+
"address",
|
|
320
|
+
"0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock",
|
|
321
|
+
];
|
|
322
|
+
const parameterNames = ["self", "member"];
|
|
323
|
+
return (tx) => tx.moveCall({
|
|
324
|
+
package: packageAddress,
|
|
325
|
+
module: "studio",
|
|
326
|
+
function: "is_membership",
|
|
327
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Creates a new personal studio as a shared object Each user can only have one
|
|
332
|
+
* studio, enforced by derived object mechanism The studio is immediately shared so
|
|
333
|
+
* others can view (but not modify) the works
|
|
334
|
+
*/
|
|
335
|
+
export function _new(options) {
|
|
336
|
+
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
337
|
+
const argumentsTypes = [
|
|
338
|
+
`${packageAddress}::config::Config`,
|
|
339
|
+
];
|
|
340
|
+
const parameterNames = ["config"];
|
|
341
|
+
return (tx) => tx.moveCall({
|
|
342
|
+
package: packageAddress,
|
|
343
|
+
module: "studio",
|
|
344
|
+
function: "new",
|
|
345
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
export function shareStudio(options) {
|
|
349
|
+
const packageAddress = options.package ?? "@local-pkg/zing_studio";
|
|
350
|
+
const argumentsTypes = [
|
|
351
|
+
`${packageAddress}::studio::Studio`,
|
|
352
|
+
];
|
|
353
|
+
const parameterNames = ["self"];
|
|
354
|
+
return (tx) => tx.moveCall({
|
|
355
|
+
package: packageAddress,
|
|
356
|
+
module: "studio",
|
|
357
|
+
function: "share_studio",
|
|
358
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
359
|
+
});
|
|
360
|
+
}
|