@misofm/sdk 0.1.1 → 0.2.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.
Files changed (166) hide show
  1. package/README.md +138 -10
  2. package/dist/contracts/composition_credits/composition_credits.d.ts +181 -0
  3. package/dist/contracts/composition_credits/composition_credits.d.ts.map +1 -0
  4. package/dist/contracts/composition_credits/composition_credits.js +109 -0
  5. package/dist/contracts/composition_credits/composition_credits.js.map +1 -0
  6. package/dist/contracts/composition_credits/composition_party_role.d.ts +119 -0
  7. package/dist/contracts/composition_credits/composition_party_role.d.ts.map +1 -0
  8. package/dist/contracts/composition_credits/composition_party_role.js +139 -0
  9. package/dist/contracts/composition_credits/composition_party_role.js.map +1 -0
  10. package/dist/contracts/composition_credits/deps/miso_credit/credit.d.ts +24 -0
  11. package/dist/contracts/composition_credits/deps/miso_credit/credit.d.ts.map +1 -0
  12. package/dist/contracts/composition_credits/deps/miso_credit/credit.js +23 -0
  13. package/dist/contracts/composition_credits/deps/miso_credit/credit.js.map +1 -0
  14. package/dist/contracts/composition_credits/deps/sui/vec_map.d.ts +37 -0
  15. package/dist/contracts/composition_credits/deps/sui/vec_map.d.ts.map +1 -0
  16. package/dist/contracts/composition_credits/deps/sui/vec_map.js +28 -0
  17. package/dist/contracts/composition_credits/deps/sui/vec_map.js.map +1 -0
  18. package/dist/contracts/composition_royalty_pool/composition_royalty_pool.d.ts +87 -0
  19. package/dist/contracts/composition_royalty_pool/composition_royalty_pool.d.ts.map +1 -0
  20. package/dist/contracts/composition_royalty_pool/composition_royalty_pool.js +80 -0
  21. package/dist/contracts/composition_royalty_pool/composition_royalty_pool.js.map +1 -0
  22. package/dist/contracts/cover_art/cover_art.d.ts +85 -0
  23. package/dist/contracts/cover_art/cover_art.d.ts.map +1 -0
  24. package/dist/contracts/cover_art/cover_art.js +68 -0
  25. package/dist/contracts/cover_art/cover_art.js.map +1 -0
  26. package/dist/contracts/cover_art/deps/ori/walrus_data.d.ts +52 -0
  27. package/dist/contracts/cover_art/deps/ori/walrus_data.d.ts.map +1 -0
  28. package/dist/contracts/cover_art/deps/ori/walrus_data.js +37 -0
  29. package/dist/contracts/cover_art/deps/ori/walrus_data.js.map +1 -0
  30. package/dist/contracts/recording_credits/deps/miso_credit/credit.d.ts +24 -0
  31. package/dist/contracts/recording_credits/deps/miso_credit/credit.d.ts.map +1 -0
  32. package/dist/contracts/recording_credits/deps/miso_credit/credit.js +23 -0
  33. package/dist/contracts/recording_credits/deps/miso_credit/credit.js.map +1 -0
  34. package/dist/contracts/recording_credits/deps/sui/vec_map.d.ts +37 -0
  35. package/dist/contracts/recording_credits/deps/sui/vec_map.d.ts.map +1 -0
  36. package/dist/contracts/recording_credits/deps/sui/vec_map.js +28 -0
  37. package/dist/contracts/recording_credits/deps/sui/vec_map.js.map +1 -0
  38. package/dist/contracts/recording_credits/deps/sui/vec_set.d.ts +21 -0
  39. package/dist/contracts/recording_credits/deps/sui/vec_set.d.ts.map +1 -0
  40. package/dist/contracts/recording_credits/deps/sui/vec_set.js +20 -0
  41. package/dist/contracts/recording_credits/deps/sui/vec_set.js.map +1 -0
  42. package/dist/contracts/recording_credits/recording_credits.d.ts +2313 -0
  43. package/dist/contracts/recording_credits/recording_credits.d.ts.map +1 -0
  44. package/dist/contracts/recording_credits/recording_credits.js +270 -0
  45. package/dist/contracts/recording_credits/recording_credits.js.map +1 -0
  46. package/dist/contracts/recording_credits/recording_party_role.d.ts +1174 -0
  47. package/dist/contracts/recording_credits/recording_party_role.d.ts.map +1 -0
  48. package/dist/contracts/recording_credits/recording_party_role.js +692 -0
  49. package/dist/contracts/recording_credits/recording_party_role.js.map +1 -0
  50. package/dist/contracts/recording_royalty_pool/recording_royalty_pool.d.ts +90 -0
  51. package/dist/contracts/recording_royalty_pool/recording_royalty_pool.d.ts.map +1 -0
  52. package/dist/contracts/recording_royalty_pool/recording_royalty_pool.js +80 -0
  53. package/dist/contracts/recording_royalty_pool/recording_royalty_pool.js.map +1 -0
  54. package/dist/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.d.ts +52 -0
  55. package/dist/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.d.ts.map +1 -0
  56. package/dist/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.js +37 -0
  57. package/dist/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.js.map +1 -0
  58. package/dist/contracts/release_cover_art/deps/cover_art/cover_art.d.ts +46 -0
  59. package/dist/contracts/release_cover_art/deps/cover_art/cover_art.d.ts.map +1 -0
  60. package/dist/contracts/release_cover_art/deps/cover_art/cover_art.js +21 -0
  61. package/dist/contracts/release_cover_art/deps/cover_art/cover_art.js.map +1 -0
  62. package/dist/contracts/release_cover_art/deps/per_track/per_track.d.ts +33 -0
  63. package/dist/contracts/release_cover_art/deps/per_track/per_track.d.ts.map +1 -0
  64. package/dist/contracts/release_cover_art/deps/per_track/per_track.js +32 -0
  65. package/dist/contracts/release_cover_art/deps/per_track/per_track.js.map +1 -0
  66. package/dist/contracts/release_cover_art/release_cover_art.d.ts +300 -0
  67. package/dist/contracts/release_cover_art/release_cover_art.d.ts.map +1 -0
  68. package/dist/contracts/release_cover_art/release_cover_art.js +168 -0
  69. package/dist/contracts/release_cover_art/release_cover_art.js.map +1 -0
  70. package/dist/contracts/release_credits/deps/miso_credit/credit.d.ts +24 -0
  71. package/dist/contracts/release_credits/deps/miso_credit/credit.d.ts.map +1 -0
  72. package/dist/contracts/release_credits/deps/miso_credit/credit.js +23 -0
  73. package/dist/contracts/release_credits/deps/miso_credit/credit.js.map +1 -0
  74. package/dist/contracts/release_credits/deps/sui/vec_map.d.ts +37 -0
  75. package/dist/contracts/release_credits/deps/sui/vec_map.d.ts.map +1 -0
  76. package/dist/contracts/release_credits/deps/sui/vec_map.js +28 -0
  77. package/dist/contracts/release_credits/deps/sui/vec_map.js.map +1 -0
  78. package/dist/contracts/release_credits/release_credits.d.ts +142 -0
  79. package/dist/contracts/release_credits/release_credits.d.ts.map +1 -0
  80. package/dist/contracts/release_credits/release_credits.js +108 -0
  81. package/dist/contracts/release_credits/release_credits.js.map +1 -0
  82. package/dist/contracts/release_credits/release_party_role.d.ts +58 -0
  83. package/dist/contracts/release_credits/release_party_role.d.ts.map +1 -0
  84. package/dist/contracts/release_credits/release_party_role.js +66 -0
  85. package/dist/contracts/release_credits/release_party_role.js.map +1 -0
  86. package/dist/contracts/royalty_pool/deps/std/type_name.d.ts +18 -0
  87. package/dist/contracts/royalty_pool/deps/std/type_name.d.ts.map +1 -0
  88. package/dist/contracts/royalty_pool/deps/std/type_name.js +20 -0
  89. package/dist/contracts/royalty_pool/deps/std/type_name.js.map +1 -0
  90. package/dist/contracts/royalty_pool/deps/sui/balance.d.ts +13 -0
  91. package/dist/contracts/royalty_pool/deps/sui/balance.d.ts.map +1 -0
  92. package/dist/contracts/royalty_pool/deps/sui/balance.js +15 -0
  93. package/dist/contracts/royalty_pool/deps/sui/balance.js.map +1 -0
  94. package/dist/contracts/royalty_pool/deps/sui/vec_map.d.ts +37 -0
  95. package/dist/contracts/royalty_pool/deps/sui/vec_map.d.ts.map +1 -0
  96. package/dist/contracts/royalty_pool/deps/sui/vec_map.js +28 -0
  97. package/dist/contracts/royalty_pool/deps/sui/vec_map.js.map +1 -0
  98. package/dist/contracts/royalty_pool/pool.d.ts +358 -0
  99. package/dist/contracts/royalty_pool/pool.d.ts.map +1 -0
  100. package/dist/contracts/royalty_pool/pool.js +352 -0
  101. package/dist/contracts/royalty_pool/pool.js.map +1 -0
  102. package/dist/contracts/royalty_pool/stake.d.ts +202 -0
  103. package/dist/contracts/royalty_pool/stake.d.ts.map +1 -0
  104. package/dist/contracts/royalty_pool/stake.js +197 -0
  105. package/dist/contracts/royalty_pool/stake.js.map +1 -0
  106. package/dist/contracts.d.ts +16 -0
  107. package/dist/contracts.d.ts.map +1 -0
  108. package/dist/contracts.js +29 -0
  109. package/dist/contracts.js.map +1 -0
  110. package/dist/cover.d.ts +48 -0
  111. package/dist/cover.d.ts.map +1 -0
  112. package/dist/cover.js +68 -0
  113. package/dist/cover.js.map +1 -0
  114. package/dist/credits.d.ts +171 -0
  115. package/dist/credits.d.ts.map +1 -0
  116. package/dist/credits.js +360 -0
  117. package/dist/credits.js.map +1 -0
  118. package/dist/extensions/royalty-pool.d.ts +32 -0
  119. package/dist/extensions/royalty-pool.d.ts.map +1 -0
  120. package/dist/extensions/royalty-pool.js +33 -0
  121. package/dist/extensions/royalty-pool.js.map +1 -0
  122. package/dist/index.d.ts +4 -0
  123. package/dist/index.d.ts.map +1 -1
  124. package/dist/index.js +17 -3
  125. package/dist/index.js.map +1 -1
  126. package/dist/internal.d.ts +4 -0
  127. package/dist/internal.d.ts.map +1 -0
  128. package/dist/internal.js +18 -0
  129. package/dist/internal.js.map +1 -0
  130. package/dist/release-graph.d.ts.map +1 -1
  131. package/dist/release-graph.js +5 -4
  132. package/dist/release-graph.js.map +1 -1
  133. package/package.json +14 -2
  134. package/src/contracts/composition_credits/composition_credits.ts +169 -0
  135. package/src/contracts/composition_credits/composition_party_role.ts +189 -0
  136. package/src/contracts/composition_credits/deps/miso_credit/credit.ts +27 -0
  137. package/src/contracts/composition_credits/deps/sui/vec_map.ts +33 -0
  138. package/src/contracts/composition_royalty_pool/composition_royalty_pool.ts +135 -0
  139. package/src/contracts/cover_art/cover_art.ts +99 -0
  140. package/src/contracts/cover_art/deps/ori/walrus_data.ts +36 -0
  141. package/src/contracts/recording_credits/deps/miso_credit/credit.ts +27 -0
  142. package/src/contracts/recording_credits/deps/sui/vec_map.ts +33 -0
  143. package/src/contracts/recording_credits/deps/sui/vec_set.ts +21 -0
  144. package/src/contracts/recording_credits/recording_credits.ts +458 -0
  145. package/src/contracts/recording_credits/recording_party_role.ts +1041 -0
  146. package/src/contracts/recording_royalty_pool/recording_royalty_pool.ts +138 -0
  147. package/src/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.ts +36 -0
  148. package/src/contracts/release_cover_art/deps/cover_art/cover_art.ts +23 -0
  149. package/src/contracts/release_cover_art/deps/per_track/per_track.ts +36 -0
  150. package/src/contracts/release_cover_art/release_cover_art.ts +251 -0
  151. package/src/contracts/release_credits/deps/miso_credit/credit.ts +27 -0
  152. package/src/contracts/release_credits/deps/sui/vec_map.ts +33 -0
  153. package/src/contracts/release_credits/release_credits.ts +156 -0
  154. package/src/contracts/release_credits/release_party_role.ts +87 -0
  155. package/src/contracts/royalty_pool/deps/std/type_name.ts +22 -0
  156. package/src/contracts/royalty_pool/deps/sui/balance.ts +17 -0
  157. package/src/contracts/royalty_pool/deps/sui/vec_map.ts +33 -0
  158. package/src/contracts/royalty_pool/pool.ts +577 -0
  159. package/src/contracts/royalty_pool/stake.ts +317 -0
  160. package/src/contracts.ts +33 -0
  161. package/src/cover.ts +140 -0
  162. package/src/credits.ts +651 -0
  163. package/src/extensions/royalty-pool.ts +90 -0
  164. package/src/index.ts +19 -3
  165. package/src/internal.ts +19 -0
  166. package/src/release-graph.ts +5 -10
@@ -0,0 +1,36 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+ import { MoveEnum, MoveStruct, MoveTuple } from '../../../utils/index.js';
5
+ import { bcs } from '@mysten/sui/bcs';
6
+ const $moduleName = 'ori::walrus_data';
7
+ /**
8
+ * Confidentiality of a stored blob: cleartext, or encrypted with an access policy.
9
+ * Only applies to standalone blobs — a quilt patch is a slice of a shared quilt
10
+ * blob and can never be the direct product of an encryption.
11
+ */
12
+ export const Confidentiality = new MoveEnum({ name: `${$moduleName}::Confidentiality`, fields: {
13
+ /** The blob is stored in the clear. */
14
+ Unencrypted: null,
15
+ /**
16
+ * The blob is AES-encrypted. `dek` is the AES data-encryption key sealed via Seal
17
+ * — a small ciphertext stored on-chain, not the blob bytes. The sealed DEK is
18
+ * itself a Seal `EncryptedObject`, which already carries the decryption-policy
19
+ * package id, so no separate policy field is stored here. Decryption is gated by
20
+ * that policy package's `seal_approve`, not by this library.
21
+ */
22
+ Encrypted: new MoveStruct({ name: `Confidentiality.Encrypted`, fields: {
23
+ dek: bcs.vector(bcs.u8())
24
+ } })
25
+ } });
26
+ /** Represents either a standalone Walrus blob or a patch within a quilt. */
27
+ export const WalrusData = new MoveEnum({ name: `${$moduleName}::WalrusData`, fields: {
28
+ /** A standalone Walrus blob. Fields: blob_id, confidentiality. */
29
+ Blob: new MoveTuple({ name: `WalrusData.Blob`, fields: [bcs.u256(), Confidentiality] }),
30
+ /**
31
+ * A patch within a Walrus quilt. Fields: quilt_id, version, start_index,
32
+ * end_index. Always a plaintext reference into a (possibly separately encrypted)
33
+ * quilt blob.
34
+ */
35
+ QuiltPatch: new MoveTuple({ name: `WalrusData.QuiltPatch`, fields: [bcs.u256(), bcs.u8(), bcs.u16(), bcs.u16()] })
36
+ } });
@@ -0,0 +1,27 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+
5
+
6
+ /**
7
+ * Represents a party's credit on a work or activity. A credit pairs a display name
8
+ * with one or more roles, identifying how a party contributed to the work.
9
+ */
10
+
11
+ import { type BcsType, bcs } from '@mysten/sui/bcs';
12
+ import { MoveStruct } from '../../../utils/index.js';
13
+ const $moduleName = 'miso_credit::credit';
14
+ /**
15
+ * A credit attributing roles to a party on a work. Generic over the role type to
16
+ * support domain-specific roles.
17
+ */
18
+ export function Credit<Role extends BcsType<any>>(...typeParameters: [
19
+ Role
20
+ ]) {
21
+ return new MoveStruct({ name: `${$moduleName}::Credit<${typeParameters[0].name as Role['name']}>`, fields: {
22
+ /** Human-readable name to display for this credit. */
23
+ display_name: bcs.string(),
24
+ /** Roles assigned to the credited party. */
25
+ roles: bcs.vector(typeParameters[0])
26
+ } });
27
+ }
@@ -0,0 +1,33 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+ import { type BcsType, bcs } from '@mysten/sui/bcs';
5
+ import { MoveStruct } from '../../../utils/index.js';
6
+ const $moduleName = '0x2::vec_map';
7
+ /** An entry in the map */
8
+ export function Entry<K extends BcsType<any>, V extends BcsType<any>>(...typeParameters: [
9
+ K,
10
+ V
11
+ ]) {
12
+ return new MoveStruct({ name: `${$moduleName}::Entry<${typeParameters[0].name as K['name']}, ${typeParameters[1].name as V['name']}>`, fields: {
13
+ key: typeParameters[0],
14
+ value: typeParameters[1]
15
+ } });
16
+ }
17
+ /**
18
+ * A map data structure backed by a vector. The map is guaranteed not to contain
19
+ * duplicate keys, but entries are _not_ sorted by key--entries are included in
20
+ * insertion order. All operations are O(N) in the size of the map--the intention
21
+ * of this data structure is only to provide the convenience of programming against
22
+ * a map API. Large maps should use handwritten parent/child relationships instead.
23
+ * Maps that need sorted iteration rather than insertion order iteration should
24
+ * also be handwritten.
25
+ */
26
+ export function VecMap<K extends BcsType<any>, V extends BcsType<any>>(...typeParameters: [
27
+ K,
28
+ V
29
+ ]) {
30
+ return new MoveStruct({ name: `${$moduleName}::VecMap<${typeParameters[0].name as K['name']}, ${typeParameters[1].name as V['name']}>`, fields: {
31
+ contents: bcs.vector(Entry(typeParameters[0], typeParameters[1]))
32
+ } });
33
+ }
@@ -0,0 +1,21 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+ import { type BcsType, bcs } from '@mysten/sui/bcs';
5
+ import { MoveStruct } from '../../../utils/index.js';
6
+ const $moduleName = '0x2::vec_set';
7
+ /**
8
+ * A set data structure backed by a vector. The set is guaranteed not to contain
9
+ * duplicate keys. All operations are O(N) in the size of the set
10
+ *
11
+ * - the intention of this data structure is only to provide the convenience of
12
+ * programming against a set API. Sets that need sorted iteration rather than
13
+ * insertion order iteration should be handwritten.
14
+ */
15
+ export function VecSet<K extends BcsType<any>>(...typeParameters: [
16
+ K
17
+ ]) {
18
+ return new MoveStruct({ name: `${$moduleName}::VecSet<${typeParameters[0].name as K['name']}>`, fields: {
19
+ contents: bcs.vector(typeParameters[0])
20
+ } });
21
+ }
@@ -0,0 +1,458 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+
5
+
6
+ /**
7
+ * First-party credits extension for recordings.
8
+ *
9
+ * Attribution (credits + primary/featured artists) is display-oriented and varies
10
+ * across platforms, so it lives here as a dynamic field on the recording rather
11
+ * than in immutable core. The data is attached under `ExtensionKey()` via the
12
+ * recording's cap-gated `uid_mut`, so every mutation is authorized by the
13
+ * recording's admin and credits survive into any lifecycle state (they may be
14
+ * attached before or after the recording is published).
15
+ *
16
+ * This is Miso's canonical credits standard; because it is an extension, other
17
+ * parties may publish their own recording-credits standard against the same
18
+ * `Recording`. Credits are NOT read by the economics — they are attribution.
19
+ */
20
+
21
+ import { MoveTuple, MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';
22
+ import { bcs } from '@mysten/sui/bcs';
23
+ import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
24
+ import * as vec_map from './deps/sui/vec_map.js';
25
+ import * as credit from './deps/miso_credit/credit.js';
26
+ import * as recording_party_role from './recording_party_role.js';
27
+ import * as vec_set from './deps/sui/vec_set.js';
28
+ const $moduleName = '@local-pkg/recording_credits::recording_credits';
29
+ export const ExtensionKey = new MoveTuple({ name: `${$moduleName}::ExtensionKey`, fields: [bcs.bool()] });
30
+ export const RecordingCredits = new MoveStruct({ name: `${$moduleName}::RecordingCredits`, fields: {
31
+ /** Map of party IDs to their credit (display name + roles). */
32
+ credits: vec_map.VecMap(bcs.Address, credit.Credit(recording_party_role.RecordingPartyRole)),
33
+ /** IDs of the primary artists. Always a subset of `credits`. */
34
+ primary_artist_ids: vec_set.VecSet(bcs.Address),
35
+ /** IDs of the featured artists. Always a subset of `credits`. */
36
+ featured_artist_ids: vec_set.VecSet(bcs.Address)
37
+ } });
38
+ export const CreditAddedEvent = new MoveStruct({ name: `${$moduleName}::CreditAddedEvent`, fields: {
39
+ recording_id: bcs.Address,
40
+ party_id: bcs.Address,
41
+ credit: credit.Credit(recording_party_role.RecordingPartyRole)
42
+ } });
43
+ export const CreditRemovedEvent = new MoveStruct({ name: `${$moduleName}::CreditRemovedEvent`, fields: {
44
+ recording_id: bcs.Address,
45
+ party_id: bcs.Address,
46
+ credit: credit.Credit(recording_party_role.RecordingPartyRole)
47
+ } });
48
+ export const PrimaryArtistAddedEvent = new MoveStruct({ name: `${$moduleName}::PrimaryArtistAddedEvent`, fields: {
49
+ recording_id: bcs.Address,
50
+ party_id: bcs.Address
51
+ } });
52
+ export const PrimaryArtistRemovedEvent = new MoveStruct({ name: `${$moduleName}::PrimaryArtistRemovedEvent`, fields: {
53
+ recording_id: bcs.Address,
54
+ party_id: bcs.Address
55
+ } });
56
+ export const FeaturedArtistAddedEvent = new MoveStruct({ name: `${$moduleName}::FeaturedArtistAddedEvent`, fields: {
57
+ recording_id: bcs.Address,
58
+ party_id: bcs.Address
59
+ } });
60
+ export const FeaturedArtistRemovedEvent = new MoveStruct({ name: `${$moduleName}::FeaturedArtistRemovedEvent`, fields: {
61
+ recording_id: bcs.Address,
62
+ party_id: bcs.Address
63
+ } });
64
+ export interface AddCreditArguments {
65
+ self: RawTransactionArgument<string>;
66
+ cap: RawTransactionArgument<string>;
67
+ party: RawTransactionArgument<string>;
68
+ credit: TransactionArgument;
69
+ }
70
+ export interface AddCreditOptions {
71
+ package?: string;
72
+ arguments: AddCreditArguments | [
73
+ self: RawTransactionArgument<string>,
74
+ cap: RawTransactionArgument<string>,
75
+ party: RawTransactionArgument<string>,
76
+ credit: TransactionArgument
77
+ ];
78
+ typeArguments: [
79
+ string,
80
+ string
81
+ ];
82
+ }
83
+ /**
84
+ * Adds a credit for a party on the recording, lazily creating the credits record
85
+ * on first use. Each credit must have 1-10 roles, and a party may hold at most one
86
+ * credit. Requires the recording's admin capability.
87
+ */
88
+ export function addCredit(options: AddCreditOptions) {
89
+ const packageAddress = options.package ?? '@local-pkg/recording_credits';
90
+ const argumentsTypes = [
91
+ null,
92
+ null,
93
+ null,
94
+ null
95
+ ] satisfies (string | null)[];
96
+ const parameterNames = ["self", "cap", "party", "credit"];
97
+ return (tx: Transaction) => tx.moveCall({
98
+ package: packageAddress,
99
+ module: 'recording_credits',
100
+ function: 'add_credit',
101
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
102
+ typeArguments: options.typeArguments
103
+ });
104
+ }
105
+ export interface RemoveCreditArguments {
106
+ self: RawTransactionArgument<string>;
107
+ cap: RawTransactionArgument<string>;
108
+ partyId: RawTransactionArgument<string>;
109
+ }
110
+ export interface RemoveCreditOptions {
111
+ package?: string;
112
+ arguments: RemoveCreditArguments | [
113
+ self: RawTransactionArgument<string>,
114
+ cap: RawTransactionArgument<string>,
115
+ partyId: RawTransactionArgument<string>
116
+ ];
117
+ typeArguments: [
118
+ string,
119
+ string
120
+ ];
121
+ }
122
+ /**
123
+ * Removes a party's credit. Also drops them from the primary/featured sets,
124
+ * preserving the invariant that those are subsets of the credited parties.
125
+ * Requires the recording's admin capability.
126
+ */
127
+ export function removeCredit(options: RemoveCreditOptions) {
128
+ const packageAddress = options.package ?? '@local-pkg/recording_credits';
129
+ const argumentsTypes = [
130
+ null,
131
+ null,
132
+ '0x2::object::ID'
133
+ ] satisfies (string | null)[];
134
+ const parameterNames = ["self", "cap", "partyId"];
135
+ return (tx: Transaction) => tx.moveCall({
136
+ package: packageAddress,
137
+ module: 'recording_credits',
138
+ function: 'remove_credit',
139
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
140
+ typeArguments: options.typeArguments
141
+ });
142
+ }
143
+ export interface AddPrimaryArtistArguments {
144
+ self: RawTransactionArgument<string>;
145
+ cap: RawTransactionArgument<string>;
146
+ party: RawTransactionArgument<string>;
147
+ }
148
+ export interface AddPrimaryArtistOptions {
149
+ package?: string;
150
+ arguments: AddPrimaryArtistArguments | [
151
+ self: RawTransactionArgument<string>,
152
+ cap: RawTransactionArgument<string>,
153
+ party: RawTransactionArgument<string>
154
+ ];
155
+ typeArguments: [
156
+ string,
157
+ string
158
+ ];
159
+ }
160
+ /**
161
+ * Designates an already-credited party as a primary artist. The party must be
162
+ * credited and not already a primary or featured artist.
163
+ */
164
+ export function addPrimaryArtist(options: AddPrimaryArtistOptions) {
165
+ const packageAddress = options.package ?? '@local-pkg/recording_credits';
166
+ const argumentsTypes = [
167
+ null,
168
+ null,
169
+ null
170
+ ] satisfies (string | null)[];
171
+ const parameterNames = ["self", "cap", "party"];
172
+ return (tx: Transaction) => tx.moveCall({
173
+ package: packageAddress,
174
+ module: 'recording_credits',
175
+ function: 'add_primary_artist',
176
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
177
+ typeArguments: options.typeArguments
178
+ });
179
+ }
180
+ export interface RemovePrimaryArtistArguments {
181
+ self: RawTransactionArgument<string>;
182
+ cap: RawTransactionArgument<string>;
183
+ partyId: RawTransactionArgument<string>;
184
+ }
185
+ export interface RemovePrimaryArtistOptions {
186
+ package?: string;
187
+ arguments: RemovePrimaryArtistArguments | [
188
+ self: RawTransactionArgument<string>,
189
+ cap: RawTransactionArgument<string>,
190
+ partyId: RawTransactionArgument<string>
191
+ ];
192
+ typeArguments: [
193
+ string,
194
+ string
195
+ ];
196
+ }
197
+ /** Removes a party from the primary-artist set (leaves the credit intact). */
198
+ export function removePrimaryArtist(options: RemovePrimaryArtistOptions) {
199
+ const packageAddress = options.package ?? '@local-pkg/recording_credits';
200
+ const argumentsTypes = [
201
+ null,
202
+ null,
203
+ '0x2::object::ID'
204
+ ] satisfies (string | null)[];
205
+ const parameterNames = ["self", "cap", "partyId"];
206
+ return (tx: Transaction) => tx.moveCall({
207
+ package: packageAddress,
208
+ module: 'recording_credits',
209
+ function: 'remove_primary_artist',
210
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
211
+ typeArguments: options.typeArguments
212
+ });
213
+ }
214
+ export interface AddFeaturedArtistArguments {
215
+ self: RawTransactionArgument<string>;
216
+ cap: RawTransactionArgument<string>;
217
+ party: RawTransactionArgument<string>;
218
+ }
219
+ export interface AddFeaturedArtistOptions {
220
+ package?: string;
221
+ arguments: AddFeaturedArtistArguments | [
222
+ self: RawTransactionArgument<string>,
223
+ cap: RawTransactionArgument<string>,
224
+ party: RawTransactionArgument<string>
225
+ ];
226
+ typeArguments: [
227
+ string,
228
+ string
229
+ ];
230
+ }
231
+ /**
232
+ * Designates an already-credited party as a featured artist. The party must be
233
+ * credited and not already a primary or featured artist.
234
+ */
235
+ export function addFeaturedArtist(options: AddFeaturedArtistOptions) {
236
+ const packageAddress = options.package ?? '@local-pkg/recording_credits';
237
+ const argumentsTypes = [
238
+ null,
239
+ null,
240
+ null
241
+ ] satisfies (string | null)[];
242
+ const parameterNames = ["self", "cap", "party"];
243
+ return (tx: Transaction) => tx.moveCall({
244
+ package: packageAddress,
245
+ module: 'recording_credits',
246
+ function: 'add_featured_artist',
247
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
248
+ typeArguments: options.typeArguments
249
+ });
250
+ }
251
+ export interface RemoveFeaturedArtistArguments {
252
+ self: RawTransactionArgument<string>;
253
+ cap: RawTransactionArgument<string>;
254
+ partyId: RawTransactionArgument<string>;
255
+ }
256
+ export interface RemoveFeaturedArtistOptions {
257
+ package?: string;
258
+ arguments: RemoveFeaturedArtistArguments | [
259
+ self: RawTransactionArgument<string>,
260
+ cap: RawTransactionArgument<string>,
261
+ partyId: RawTransactionArgument<string>
262
+ ];
263
+ typeArguments: [
264
+ string,
265
+ string
266
+ ];
267
+ }
268
+ /** Removes a party from the featured-artist set (leaves the credit intact). */
269
+ export function removeFeaturedArtist(options: RemoveFeaturedArtistOptions) {
270
+ const packageAddress = options.package ?? '@local-pkg/recording_credits';
271
+ const argumentsTypes = [
272
+ null,
273
+ null,
274
+ '0x2::object::ID'
275
+ ] satisfies (string | null)[];
276
+ const parameterNames = ["self", "cap", "partyId"];
277
+ return (tx: Transaction) => tx.moveCall({
278
+ package: packageAddress,
279
+ module: 'recording_credits',
280
+ function: 'remove_featured_artist',
281
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
282
+ typeArguments: options.typeArguments
283
+ });
284
+ }
285
+ export interface HasCreditsArguments {
286
+ self: RawTransactionArgument<string>;
287
+ }
288
+ export interface HasCreditsOptions {
289
+ package?: string;
290
+ arguments: HasCreditsArguments | [
291
+ self: RawTransactionArgument<string>
292
+ ];
293
+ typeArguments: [
294
+ string,
295
+ string
296
+ ];
297
+ }
298
+ /** Returns whether a credits record has been attached to this recording yet. */
299
+ export function hasCredits(options: HasCreditsOptions) {
300
+ const packageAddress = options.package ?? '@local-pkg/recording_credits';
301
+ const argumentsTypes = [
302
+ null
303
+ ] satisfies (string | null)[];
304
+ const parameterNames = ["self"];
305
+ return (tx: Transaction) => tx.moveCall({
306
+ package: packageAddress,
307
+ module: 'recording_credits',
308
+ function: 'has_credits',
309
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
310
+ typeArguments: options.typeArguments
311
+ });
312
+ }
313
+ export interface CreditsArguments {
314
+ self: RawTransactionArgument<string>;
315
+ }
316
+ export interface CreditsOptions {
317
+ package?: string;
318
+ arguments: CreditsArguments | [
319
+ self: RawTransactionArgument<string>
320
+ ];
321
+ typeArguments: [
322
+ string,
323
+ string
324
+ ];
325
+ }
326
+ /** Returns the party-to-credit map. Aborts if no credits are attached. */
327
+ export function credits(options: CreditsOptions) {
328
+ const packageAddress = options.package ?? '@local-pkg/recording_credits';
329
+ const argumentsTypes = [
330
+ null
331
+ ] satisfies (string | null)[];
332
+ const parameterNames = ["self"];
333
+ return (tx: Transaction) => tx.moveCall({
334
+ package: packageAddress,
335
+ module: 'recording_credits',
336
+ function: 'credits',
337
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
338
+ typeArguments: options.typeArguments
339
+ });
340
+ }
341
+ export interface PrimaryArtistIdsArguments {
342
+ self: RawTransactionArgument<string>;
343
+ }
344
+ export interface PrimaryArtistIdsOptions {
345
+ package?: string;
346
+ arguments: PrimaryArtistIdsArguments | [
347
+ self: RawTransactionArgument<string>
348
+ ];
349
+ typeArguments: [
350
+ string,
351
+ string
352
+ ];
353
+ }
354
+ /** Returns the primary-artist IDs. Aborts if no credits are attached. */
355
+ export function primaryArtistIds(options: PrimaryArtistIdsOptions) {
356
+ const packageAddress = options.package ?? '@local-pkg/recording_credits';
357
+ const argumentsTypes = [
358
+ null
359
+ ] satisfies (string | null)[];
360
+ const parameterNames = ["self"];
361
+ return (tx: Transaction) => tx.moveCall({
362
+ package: packageAddress,
363
+ module: 'recording_credits',
364
+ function: 'primary_artist_ids',
365
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
366
+ typeArguments: options.typeArguments
367
+ });
368
+ }
369
+ export interface FeaturedArtistIdsArguments {
370
+ self: RawTransactionArgument<string>;
371
+ }
372
+ export interface FeaturedArtistIdsOptions {
373
+ package?: string;
374
+ arguments: FeaturedArtistIdsArguments | [
375
+ self: RawTransactionArgument<string>
376
+ ];
377
+ typeArguments: [
378
+ string,
379
+ string
380
+ ];
381
+ }
382
+ /** Returns the featured-artist IDs. Aborts if no credits are attached. */
383
+ export function featuredArtistIds(options: FeaturedArtistIdsOptions) {
384
+ const packageAddress = options.package ?? '@local-pkg/recording_credits';
385
+ const argumentsTypes = [
386
+ null
387
+ ] satisfies (string | null)[];
388
+ const parameterNames = ["self"];
389
+ return (tx: Transaction) => tx.moveCall({
390
+ package: packageAddress,
391
+ module: 'recording_credits',
392
+ function: 'featured_artist_ids',
393
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
394
+ typeArguments: options.typeArguments
395
+ });
396
+ }
397
+ export interface IsPrimaryArtistArguments {
398
+ self: RawTransactionArgument<string>;
399
+ partyId: RawTransactionArgument<string>;
400
+ }
401
+ export interface IsPrimaryArtistOptions {
402
+ package?: string;
403
+ arguments: IsPrimaryArtistArguments | [
404
+ self: RawTransactionArgument<string>,
405
+ partyId: RawTransactionArgument<string>
406
+ ];
407
+ typeArguments: [
408
+ string,
409
+ string
410
+ ];
411
+ }
412
+ /** Returns whether the party is a primary artist (false if no credits attached). */
413
+ export function isPrimaryArtist(options: IsPrimaryArtistOptions) {
414
+ const packageAddress = options.package ?? '@local-pkg/recording_credits';
415
+ const argumentsTypes = [
416
+ null,
417
+ '0x2::object::ID'
418
+ ] satisfies (string | null)[];
419
+ const parameterNames = ["self", "partyId"];
420
+ return (tx: Transaction) => tx.moveCall({
421
+ package: packageAddress,
422
+ module: 'recording_credits',
423
+ function: 'is_primary_artist',
424
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
425
+ typeArguments: options.typeArguments
426
+ });
427
+ }
428
+ export interface IsFeaturedArtistArguments {
429
+ self: RawTransactionArgument<string>;
430
+ partyId: RawTransactionArgument<string>;
431
+ }
432
+ export interface IsFeaturedArtistOptions {
433
+ package?: string;
434
+ arguments: IsFeaturedArtistArguments | [
435
+ self: RawTransactionArgument<string>,
436
+ partyId: RawTransactionArgument<string>
437
+ ];
438
+ typeArguments: [
439
+ string,
440
+ string
441
+ ];
442
+ }
443
+ /** Returns whether the party is a featured artist (false if no credits attached). */
444
+ export function isFeaturedArtist(options: IsFeaturedArtistOptions) {
445
+ const packageAddress = options.package ?? '@local-pkg/recording_credits';
446
+ const argumentsTypes = [
447
+ null,
448
+ '0x2::object::ID'
449
+ ] satisfies (string | null)[];
450
+ const parameterNames = ["self", "partyId"];
451
+ return (tx: Transaction) => tx.moveCall({
452
+ package: packageAddress,
453
+ module: 'recording_credits',
454
+ function: 'is_featured_artist',
455
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
456
+ typeArguments: options.typeArguments
457
+ });
458
+ }