@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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@misofm/sdk",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "description": "Typed query helpers and transaction builders for the Miso platform layer on Sui \u2014 pressings, listings, records, and opinionated work publishing.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -64,6 +64,18 @@
64
64
  "types": "./dist/catalog.d.ts",
65
65
  "default": "./dist/catalog.js"
66
66
  },
67
+ "./credits": {
68
+ "types": "./dist/credits.d.ts",
69
+ "default": "./dist/credits.js"
70
+ },
71
+ "./cover": {
72
+ "types": "./dist/cover.d.ts",
73
+ "default": "./dist/cover.js"
74
+ },
75
+ "./extensions/royalty-pool": {
76
+ "types": "./dist/extensions/royalty-pool.d.ts",
77
+ "default": "./dist/extensions/royalty-pool.js"
78
+ },
67
79
  "./package.json": "./package.json"
68
80
  },
69
81
  "files": [
@@ -93,7 +105,7 @@
93
105
  "typescript": "^5"
94
106
  },
95
107
  "dependencies": {
96
- "@misonetwork/sdk": "^0.2.2"
108
+ "@misonetwork/sdk": "^0.3.0"
97
109
  },
98
110
  "main": "./dist/index.js"
99
111
  }
@@ -0,0 +1,169 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+
5
+
6
+ /**
7
+ * First-party credits extension for compositions.
8
+ *
9
+ * Attribution (writing credits) is display-oriented and varies across platforms,
10
+ * so it lives here as a dynamic field on the composition rather than in immutable
11
+ * core. The data is attached under `ExtensionKey()` via the composition's
12
+ * cap-gated `uid_mut`, so every mutation is authorized by the composition's admin
13
+ * and credits survive into any lifecycle state (they may be attached before or
14
+ * after the composition is published).
15
+ *
16
+ * This is Miso's canonical credits standard; because it is an extension, other
17
+ * parties may publish their own composition-credits standard against the same
18
+ * `Composition`. 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 composition_party_role from './composition_party_role.js';
27
+ const $moduleName = '@local-pkg/composition_credits::composition_credits';
28
+ export const ExtensionKey = new MoveTuple({ name: `${$moduleName}::ExtensionKey`, fields: [bcs.bool()] });
29
+ export const CompositionCredits = new MoveStruct({ name: `${$moduleName}::CompositionCredits`, fields: {
30
+ /** Map of party IDs to their credit (display name + roles). */
31
+ credits: vec_map.VecMap(bcs.Address, credit.Credit(composition_party_role.CompositionPartyRole))
32
+ } });
33
+ export const CreditAddedEvent = new MoveStruct({ name: `${$moduleName}::CreditAddedEvent`, fields: {
34
+ composition_id: bcs.Address,
35
+ party_id: bcs.Address,
36
+ credit: credit.Credit(composition_party_role.CompositionPartyRole)
37
+ } });
38
+ export const CreditRemovedEvent = new MoveStruct({ name: `${$moduleName}::CreditRemovedEvent`, fields: {
39
+ composition_id: bcs.Address,
40
+ party_id: bcs.Address,
41
+ credit: credit.Credit(composition_party_role.CompositionPartyRole)
42
+ } });
43
+ export interface AddCreditArguments {
44
+ self: RawTransactionArgument<string>;
45
+ cap: RawTransactionArgument<string>;
46
+ party: RawTransactionArgument<string>;
47
+ credit: TransactionArgument;
48
+ }
49
+ export interface AddCreditOptions {
50
+ package?: string;
51
+ arguments: AddCreditArguments | [
52
+ self: RawTransactionArgument<string>,
53
+ cap: RawTransactionArgument<string>,
54
+ party: RawTransactionArgument<string>,
55
+ credit: TransactionArgument
56
+ ];
57
+ typeArguments: [
58
+ string
59
+ ];
60
+ }
61
+ /**
62
+ * Adds a credit for a party on the composition, lazily creating the credits record
63
+ * on first use. Each credit must have 1-5 roles, and a party may hold at most one
64
+ * credit. Requires the composition's admin capability.
65
+ */
66
+ export function addCredit(options: AddCreditOptions) {
67
+ const packageAddress = options.package ?? '@local-pkg/composition_credits';
68
+ const argumentsTypes = [
69
+ null,
70
+ null,
71
+ null,
72
+ null
73
+ ] satisfies (string | null)[];
74
+ const parameterNames = ["self", "cap", "party", "credit"];
75
+ return (tx: Transaction) => tx.moveCall({
76
+ package: packageAddress,
77
+ module: 'composition_credits',
78
+ function: 'add_credit',
79
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
80
+ typeArguments: options.typeArguments
81
+ });
82
+ }
83
+ export interface RemoveCreditArguments {
84
+ self: RawTransactionArgument<string>;
85
+ cap: RawTransactionArgument<string>;
86
+ partyId: RawTransactionArgument<string>;
87
+ }
88
+ export interface RemoveCreditOptions {
89
+ package?: string;
90
+ arguments: RemoveCreditArguments | [
91
+ self: RawTransactionArgument<string>,
92
+ cap: RawTransactionArgument<string>,
93
+ partyId: RawTransactionArgument<string>
94
+ ];
95
+ typeArguments: [
96
+ string
97
+ ];
98
+ }
99
+ /** Removes a party's credit. Requires the composition's admin capability. */
100
+ export function removeCredit(options: RemoveCreditOptions) {
101
+ const packageAddress = options.package ?? '@local-pkg/composition_credits';
102
+ const argumentsTypes = [
103
+ null,
104
+ null,
105
+ '0x2::object::ID'
106
+ ] satisfies (string | null)[];
107
+ const parameterNames = ["self", "cap", "partyId"];
108
+ return (tx: Transaction) => tx.moveCall({
109
+ package: packageAddress,
110
+ module: 'composition_credits',
111
+ function: 'remove_credit',
112
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
113
+ typeArguments: options.typeArguments
114
+ });
115
+ }
116
+ export interface HasCreditsArguments {
117
+ self: RawTransactionArgument<string>;
118
+ }
119
+ export interface HasCreditsOptions {
120
+ package?: string;
121
+ arguments: HasCreditsArguments | [
122
+ self: RawTransactionArgument<string>
123
+ ];
124
+ typeArguments: [
125
+ string
126
+ ];
127
+ }
128
+ /** Returns whether a credits record has been attached to this composition yet. */
129
+ export function hasCredits(options: HasCreditsOptions) {
130
+ const packageAddress = options.package ?? '@local-pkg/composition_credits';
131
+ const argumentsTypes = [
132
+ null
133
+ ] satisfies (string | null)[];
134
+ const parameterNames = ["self"];
135
+ return (tx: Transaction) => tx.moveCall({
136
+ package: packageAddress,
137
+ module: 'composition_credits',
138
+ function: 'has_credits',
139
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
140
+ typeArguments: options.typeArguments
141
+ });
142
+ }
143
+ export interface CreditsArguments {
144
+ self: RawTransactionArgument<string>;
145
+ }
146
+ export interface CreditsOptions {
147
+ package?: string;
148
+ arguments: CreditsArguments | [
149
+ self: RawTransactionArgument<string>
150
+ ];
151
+ typeArguments: [
152
+ string
153
+ ];
154
+ }
155
+ /** Returns the party-to-credit map. Aborts if no credits are attached. */
156
+ export function credits(options: CreditsOptions) {
157
+ const packageAddress = options.package ?? '@local-pkg/composition_credits';
158
+ const argumentsTypes = [
159
+ null
160
+ ] satisfies (string | null)[];
161
+ const parameterNames = ["self"];
162
+ return (tx: Transaction) => tx.moveCall({
163
+ package: packageAddress,
164
+ module: 'composition_credits',
165
+ function: 'credits',
166
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
167
+ typeArguments: options.typeArguments
168
+ });
169
+ }
@@ -0,0 +1,189 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+
5
+
6
+ /**
7
+ * Defines the roles that parties can hold on a composition. Compositions are the
8
+ * underlying musical works (melody + lyrics), and these roles represent the
9
+ * writing and adaptation contributions to them.
10
+ *
11
+ * ### Design
12
+ *
13
+ * `CompositionPartyRole` is a closed enum: variants can only be constructed and
14
+ * matched inside this module, so the `new_*_role` constructors are the external
15
+ * write-API and `name()` is the external read-API.
16
+ *
17
+ * - **No seniority axis.** Unlike recording roles, composition roles carry no
18
+ * level — a writer either contributed in a given capacity or did not.
19
+ * - **`Custom` is the escape hatch.** The canonical variants cover the common
20
+ * writing vocabulary; anything outside it is a `Custom(name)` whose name is
21
+ * validated. Prefer a canonical variant when one fits.
22
+ * - **`name()` is the canonical identifier**, returned as a stable PascalCase
23
+ * token (e.g. `"Songwriter"`). For `Custom`, `name()` returns the user-supplied
24
+ * string.
25
+ *
26
+ * These identifiers are Miso's own canonical vocabulary; any overlap with an
27
+ * external standard (e.g. DDEX) is coincidental, not a reproduction of it.
28
+ */
29
+
30
+ import { MoveEnum, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';
31
+ import { bcs } from '@mysten/sui/bcs';
32
+ import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
33
+ const $moduleName = '@local-pkg/composition_credits::composition_party_role';
34
+ /** Represents a party's role on a composition. */
35
+ export const CompositionPartyRole = new MoveEnum({ name: `${$moduleName}::CompositionPartyRole`, fields: {
36
+ /** Adapted an existing work into this composition. */
37
+ Adapter: null,
38
+ /** Arranged the musical parts of the composition. */
39
+ Arranger: null,
40
+ /** Composed the music of the composition. */
41
+ Composer: null,
42
+ /** Wrote the lyrics of the composition. */
43
+ Lyricist: null,
44
+ /** Wrote both music and lyrics of the composition. */
45
+ Songwriter: null,
46
+ /** Translated the lyrics of the composition. */
47
+ Translator: null,
48
+ /**
49
+ * A user-defined role not covered by a canonical variant. Carries the role name
50
+ * (validated). An escape hatch — prefer a canonical variant when one fits.
51
+ */
52
+ Custom: bcs.string()
53
+ } });
54
+ export interface NewAdapterRoleOptions {
55
+ package?: string;
56
+ arguments?: [
57
+ ];
58
+ }
59
+ /** Creates a new Adapter role. */
60
+ export function newAdapterRole(options: NewAdapterRoleOptions = {}) {
61
+ const packageAddress = options.package ?? '@local-pkg/composition_credits';
62
+ return (tx: Transaction) => tx.moveCall({
63
+ package: packageAddress,
64
+ module: 'composition_party_role',
65
+ function: 'new_adapter_role',
66
+ });
67
+ }
68
+ export interface NewArrangerRoleOptions {
69
+ package?: string;
70
+ arguments?: [
71
+ ];
72
+ }
73
+ /** Creates a new Arranger role. */
74
+ export function newArrangerRole(options: NewArrangerRoleOptions = {}) {
75
+ const packageAddress = options.package ?? '@local-pkg/composition_credits';
76
+ return (tx: Transaction) => tx.moveCall({
77
+ package: packageAddress,
78
+ module: 'composition_party_role',
79
+ function: 'new_arranger_role',
80
+ });
81
+ }
82
+ export interface NewComposerRoleOptions {
83
+ package?: string;
84
+ arguments?: [
85
+ ];
86
+ }
87
+ /** Creates a new Composer role. */
88
+ export function newComposerRole(options: NewComposerRoleOptions = {}) {
89
+ const packageAddress = options.package ?? '@local-pkg/composition_credits';
90
+ return (tx: Transaction) => tx.moveCall({
91
+ package: packageAddress,
92
+ module: 'composition_party_role',
93
+ function: 'new_composer_role',
94
+ });
95
+ }
96
+ export interface NewLyricistRoleOptions {
97
+ package?: string;
98
+ arguments?: [
99
+ ];
100
+ }
101
+ /** Creates a new Lyricist role. */
102
+ export function newLyricistRole(options: NewLyricistRoleOptions = {}) {
103
+ const packageAddress = options.package ?? '@local-pkg/composition_credits';
104
+ return (tx: Transaction) => tx.moveCall({
105
+ package: packageAddress,
106
+ module: 'composition_party_role',
107
+ function: 'new_lyricist_role',
108
+ });
109
+ }
110
+ export interface NewSongwriterRoleOptions {
111
+ package?: string;
112
+ arguments?: [
113
+ ];
114
+ }
115
+ /** Creates a new Songwriter role. */
116
+ export function newSongwriterRole(options: NewSongwriterRoleOptions = {}) {
117
+ const packageAddress = options.package ?? '@local-pkg/composition_credits';
118
+ return (tx: Transaction) => tx.moveCall({
119
+ package: packageAddress,
120
+ module: 'composition_party_role',
121
+ function: 'new_songwriter_role',
122
+ });
123
+ }
124
+ export interface NewTranslatorRoleOptions {
125
+ package?: string;
126
+ arguments?: [
127
+ ];
128
+ }
129
+ /** Creates a new Translator role. */
130
+ export function newTranslatorRole(options: NewTranslatorRoleOptions = {}) {
131
+ const packageAddress = options.package ?? '@local-pkg/composition_credits';
132
+ return (tx: Transaction) => tx.moveCall({
133
+ package: packageAddress,
134
+ module: 'composition_party_role',
135
+ function: 'new_translator_role',
136
+ });
137
+ }
138
+ export interface NewCustomRoleArguments {
139
+ roleName: RawTransactionArgument<string>;
140
+ }
141
+ export interface NewCustomRoleOptions {
142
+ package?: string;
143
+ arguments: NewCustomRoleArguments | [
144
+ roleName: RawTransactionArgument<string>
145
+ ];
146
+ }
147
+ /**
148
+ * Creates a new Custom role with a user-defined name. The name freezes into
149
+ * credits, so it is validated here. Prefer a canonical variant when one fits.
150
+ */
151
+ export function newCustomRole(options: NewCustomRoleOptions) {
152
+ const packageAddress = options.package ?? '@local-pkg/composition_credits';
153
+ const argumentsTypes = [
154
+ '0x1::string::String'
155
+ ] satisfies (string | null)[];
156
+ const parameterNames = ["roleName"];
157
+ return (tx: Transaction) => tx.moveCall({
158
+ package: packageAddress,
159
+ module: 'composition_party_role',
160
+ function: 'new_custom_role',
161
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
162
+ });
163
+ }
164
+ export interface NameArguments {
165
+ self: TransactionArgument;
166
+ }
167
+ export interface NameOptions {
168
+ package?: string;
169
+ arguments: NameArguments | [
170
+ self: TransactionArgument
171
+ ];
172
+ }
173
+ /**
174
+ * Returns the canonical identifier of the role as a stable PascalCase token. For
175
+ * `Custom`, returns the user-supplied name.
176
+ */
177
+ export function name(options: NameOptions) {
178
+ const packageAddress = options.package ?? '@local-pkg/composition_credits';
179
+ const argumentsTypes = [
180
+ null
181
+ ] satisfies (string | null)[];
182
+ const parameterNames = ["self"];
183
+ return (tx: Transaction) => tx.moveCall({
184
+ package: packageAddress,
185
+ module: 'composition_party_role',
186
+ function: 'name',
187
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
188
+ });
189
+ }
@@ -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,135 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+
5
+
6
+ /**
7
+ * Cap-gated royalty-pool extension for `Composition`.
8
+ *
9
+ * Royalty payers send `Coin<Currency>` directly to the composition's address — a
10
+ * stable, well-known inbox available from the composition's creation. The
11
+ * composition admin (cap holder) folds those funds into the underlying
12
+ * `royalty_pool::pool::RoyaltyPool` via `receive_and_deposit` (for direct coin
13
+ * transfers) or `redeem_and_deposit` (for funds-accumulator balances).
14
+ *
15
+ * All three entry points require `&CompositionAdminCap`, so timing of fold
16
+ * operations stays under admin control.
17
+ */
18
+
19
+ import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
20
+ import { normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';
21
+ export interface InitializePoolArguments {
22
+ composition: RawTransactionArgument<string>;
23
+ cap: RawTransactionArgument<string>;
24
+ }
25
+ export interface InitializePoolOptions {
26
+ package?: string;
27
+ arguments: InitializePoolArguments | [
28
+ composition: RawTransactionArgument<string>,
29
+ cap: RawTransactionArgument<string>
30
+ ];
31
+ typeArguments: [
32
+ string,
33
+ string
34
+ ];
35
+ }
36
+ /**
37
+ * Create a royalty pool for a composition. Pool address derives from
38
+ * `(composition_id, Currency)` — calling twice with the same Currency aborts
39
+ * because the address is already claimed.
40
+ */
41
+ export function initializePool(options: InitializePoolOptions) {
42
+ const packageAddress = options.package ?? '@local-pkg/composition_royalty_pool';
43
+ const argumentsTypes = [
44
+ null,
45
+ null
46
+ ] satisfies (string | null)[];
47
+ const parameterNames = ["composition", "cap"];
48
+ return (tx: Transaction) => tx.moveCall({
49
+ package: packageAddress,
50
+ module: 'composition_royalty_pool',
51
+ function: 'initialize_pool',
52
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
53
+ typeArguments: options.typeArguments
54
+ });
55
+ }
56
+ export interface ReceiveAndDepositArguments {
57
+ composition: RawTransactionArgument<string>;
58
+ cap: RawTransactionArgument<string>;
59
+ coins: TransactionArgument;
60
+ pool: RawTransactionArgument<string>;
61
+ }
62
+ export interface ReceiveAndDepositOptions {
63
+ package?: string;
64
+ arguments: ReceiveAndDepositArguments | [
65
+ composition: RawTransactionArgument<string>,
66
+ cap: RawTransactionArgument<string>,
67
+ coins: TransactionArgument,
68
+ pool: RawTransactionArgument<string>
69
+ ];
70
+ typeArguments: [
71
+ string,
72
+ string
73
+ ];
74
+ }
75
+ /**
76
+ * Receive `Coin<Currency>` objects sent to the composition's address and fold them
77
+ * into the pool's accumulator.
78
+ */
79
+ export function receiveAndDeposit(options: ReceiveAndDepositOptions) {
80
+ const packageAddress = options.package ?? '@local-pkg/composition_royalty_pool';
81
+ const argumentsTypes = [
82
+ null,
83
+ null,
84
+ 'vector<null>',
85
+ null
86
+ ] satisfies (string | null)[];
87
+ const parameterNames = ["composition", "cap", "coins", "pool"];
88
+ return (tx: Transaction) => tx.moveCall({
89
+ package: packageAddress,
90
+ module: 'composition_royalty_pool',
91
+ function: 'receive_and_deposit',
92
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
93
+ typeArguments: options.typeArguments
94
+ });
95
+ }
96
+ export interface RedeemAndDepositArguments {
97
+ composition: RawTransactionArgument<string>;
98
+ cap: RawTransactionArgument<string>;
99
+ value: RawTransactionArgument<number | bigint>;
100
+ pool: RawTransactionArgument<string>;
101
+ }
102
+ export interface RedeemAndDepositOptions {
103
+ package?: string;
104
+ arguments: RedeemAndDepositArguments | [
105
+ composition: RawTransactionArgument<string>,
106
+ cap: RawTransactionArgument<string>,
107
+ value: RawTransactionArgument<number | bigint>,
108
+ pool: RawTransactionArgument<string>
109
+ ];
110
+ typeArguments: [
111
+ string,
112
+ string
113
+ ];
114
+ }
115
+ /**
116
+ * Redeem `value` base units from the composition's funds accumulator and fold the
117
+ * resulting balance into the pool's accumulator.
118
+ */
119
+ export function redeemAndDeposit(options: RedeemAndDepositOptions) {
120
+ const packageAddress = options.package ?? '@local-pkg/composition_royalty_pool';
121
+ const argumentsTypes = [
122
+ null,
123
+ null,
124
+ 'u64',
125
+ null
126
+ ] satisfies (string | null)[];
127
+ const parameterNames = ["composition", "cap", "value", "pool"];
128
+ return (tx: Transaction) => tx.moveCall({
129
+ package: packageAddress,
130
+ module: 'composition_royalty_pool',
131
+ function: 'redeem_and_deposit',
132
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
133
+ typeArguments: options.typeArguments
134
+ });
135
+ }
@@ -0,0 +1,99 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+
5
+
6
+ /**
7
+ * The evolvable cover art value used by the recording/release cover art
8
+ * extensions.
9
+ *
10
+ * CoverArt format changes over time (static-only → +animated → future formats).
11
+ * Keeping it in an extension rather than immutable core means a new format is a
12
+ * republish of this small package (or a brand-new cover art standard), not of the
13
+ * frozen protocol. `CoverArt` references external storage via `ori::WalrusData`.
14
+ */
15
+
16
+ import { MoveStruct, normalizeMoveArguments } from '../utils/index.js';
17
+ import { bcs } from '@mysten/sui/bcs';
18
+ import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
19
+ import * as walrus_data from './deps/ori/walrus_data.js';
20
+ const $moduleName = '@local-pkg/cover_art::cover_art';
21
+ export const CoverArt = new MoveStruct({ name: `${$moduleName}::CoverArt`, fields: {
22
+ still: walrus_data.WalrusData,
23
+ animated: bcs.option(walrus_data.WalrusData)
24
+ } });
25
+ export interface NewArguments {
26
+ still: TransactionArgument;
27
+ animated: TransactionArgument;
28
+ }
29
+ export interface NewOptions {
30
+ package?: string;
31
+ arguments: NewArguments | [
32
+ still: TransactionArgument,
33
+ animated: TransactionArgument
34
+ ];
35
+ }
36
+ /**
37
+ * Creates cover art with a still image and optional animated version. Both
38
+ * references must be Walrus blobs.
39
+ */
40
+ export function _new(options: NewOptions) {
41
+ const packageAddress = options.package ?? '@local-pkg/cover_art';
42
+ const argumentsTypes = [
43
+ null,
44
+ null
45
+ ] satisfies (string | null)[];
46
+ const parameterNames = ["still", "animated"];
47
+ return (tx: Transaction) => tx.moveCall({
48
+ package: packageAddress,
49
+ module: 'cover_art',
50
+ function: 'new',
51
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
52
+ });
53
+ }
54
+ export interface StillArguments {
55
+ self: TransactionArgument;
56
+ }
57
+ export interface StillOptions {
58
+ package?: string;
59
+ arguments: StillArguments | [
60
+ self: TransactionArgument
61
+ ];
62
+ }
63
+ /** Returns a reference to the still image data. */
64
+ export function still(options: StillOptions) {
65
+ const packageAddress = options.package ?? '@local-pkg/cover_art';
66
+ const argumentsTypes = [
67
+ null
68
+ ] satisfies (string | null)[];
69
+ const parameterNames = ["self"];
70
+ return (tx: Transaction) => tx.moveCall({
71
+ package: packageAddress,
72
+ module: 'cover_art',
73
+ function: 'still',
74
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
75
+ });
76
+ }
77
+ export interface AnimatedArguments {
78
+ self: TransactionArgument;
79
+ }
80
+ export interface AnimatedOptions {
81
+ package?: string;
82
+ arguments: AnimatedArguments | [
83
+ self: TransactionArgument
84
+ ];
85
+ }
86
+ /** Returns a reference to the optional animated cover art data. */
87
+ export function animated(options: AnimatedOptions) {
88
+ const packageAddress = options.package ?? '@local-pkg/cover_art';
89
+ const argumentsTypes = [
90
+ null
91
+ ] satisfies (string | null)[];
92
+ const parameterNames = ["self"];
93
+ return (tx: Transaction) => tx.moveCall({
94
+ package: packageAddress,
95
+ module: 'cover_art',
96
+ function: 'animated',
97
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
98
+ });
99
+ }