@misonetwork/sdk 0.2.2 → 0.3.1

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 (167) hide show
  1. package/README.md +44 -98
  2. package/dist/contracts.d.ts +0 -12
  3. package/dist/contracts.d.ts.map +1 -1
  4. package/dist/contracts.js +3 -16
  5. package/dist/contracts.js.map +1 -1
  6. package/dist/index.d.ts +0 -3
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +3 -3
  9. package/dist/index.js.map +1 -1
  10. package/dist/internal.d.ts +7 -3
  11. package/dist/internal.d.ts.map +1 -1
  12. package/dist/internal.js +22 -4
  13. package/dist/internal.js.map +1 -1
  14. package/dist/queries.d.ts +8 -0
  15. package/dist/queries.d.ts.map +1 -1
  16. package/dist/queries.js +30 -8
  17. package/dist/queries.js.map +1 -1
  18. package/package.json +1 -13
  19. package/src/contracts.ts +3 -19
  20. package/src/index.ts +3 -3
  21. package/src/internal.ts +34 -15
  22. package/src/queries.ts +40 -12
  23. package/dist/contracts/composition_credits/composition_credits.d.ts +0 -181
  24. package/dist/contracts/composition_credits/composition_credits.d.ts.map +0 -1
  25. package/dist/contracts/composition_credits/composition_credits.js +0 -109
  26. package/dist/contracts/composition_credits/composition_credits.js.map +0 -1
  27. package/dist/contracts/composition_credits/composition_party_role.d.ts +0 -119
  28. package/dist/contracts/composition_credits/composition_party_role.d.ts.map +0 -1
  29. package/dist/contracts/composition_credits/composition_party_role.js +0 -139
  30. package/dist/contracts/composition_credits/composition_party_role.js.map +0 -1
  31. package/dist/contracts/composition_credits/deps/miso_credit/credit.d.ts +0 -24
  32. package/dist/contracts/composition_credits/deps/miso_credit/credit.d.ts.map +0 -1
  33. package/dist/contracts/composition_credits/deps/miso_credit/credit.js +0 -23
  34. package/dist/contracts/composition_credits/deps/miso_credit/credit.js.map +0 -1
  35. package/dist/contracts/composition_credits/deps/sui/vec_map.d.ts +0 -37
  36. package/dist/contracts/composition_credits/deps/sui/vec_map.d.ts.map +0 -1
  37. package/dist/contracts/composition_credits/deps/sui/vec_map.js +0 -28
  38. package/dist/contracts/composition_credits/deps/sui/vec_map.js.map +0 -1
  39. package/dist/contracts/composition_royalty_pool/composition_royalty_pool.d.ts +0 -87
  40. package/dist/contracts/composition_royalty_pool/composition_royalty_pool.d.ts.map +0 -1
  41. package/dist/contracts/composition_royalty_pool/composition_royalty_pool.js +0 -80
  42. package/dist/contracts/composition_royalty_pool/composition_royalty_pool.js.map +0 -1
  43. package/dist/contracts/cover_art/cover_art.d.ts +0 -85
  44. package/dist/contracts/cover_art/cover_art.d.ts.map +0 -1
  45. package/dist/contracts/cover_art/cover_art.js +0 -68
  46. package/dist/contracts/cover_art/cover_art.js.map +0 -1
  47. package/dist/contracts/cover_art/deps/ori/walrus_data.d.ts +0 -52
  48. package/dist/contracts/cover_art/deps/ori/walrus_data.d.ts.map +0 -1
  49. package/dist/contracts/cover_art/deps/ori/walrus_data.js +0 -37
  50. package/dist/contracts/cover_art/deps/ori/walrus_data.js.map +0 -1
  51. package/dist/contracts/recording_credits/deps/miso_credit/credit.d.ts +0 -24
  52. package/dist/contracts/recording_credits/deps/miso_credit/credit.d.ts.map +0 -1
  53. package/dist/contracts/recording_credits/deps/miso_credit/credit.js +0 -23
  54. package/dist/contracts/recording_credits/deps/miso_credit/credit.js.map +0 -1
  55. package/dist/contracts/recording_credits/deps/sui/vec_map.d.ts +0 -37
  56. package/dist/contracts/recording_credits/deps/sui/vec_map.d.ts.map +0 -1
  57. package/dist/contracts/recording_credits/deps/sui/vec_map.js +0 -28
  58. package/dist/contracts/recording_credits/deps/sui/vec_map.js.map +0 -1
  59. package/dist/contracts/recording_credits/deps/sui/vec_set.d.ts +0 -21
  60. package/dist/contracts/recording_credits/deps/sui/vec_set.d.ts.map +0 -1
  61. package/dist/contracts/recording_credits/deps/sui/vec_set.js +0 -20
  62. package/dist/contracts/recording_credits/deps/sui/vec_set.js.map +0 -1
  63. package/dist/contracts/recording_credits/recording_credits.d.ts +0 -2313
  64. package/dist/contracts/recording_credits/recording_credits.d.ts.map +0 -1
  65. package/dist/contracts/recording_credits/recording_credits.js +0 -270
  66. package/dist/contracts/recording_credits/recording_credits.js.map +0 -1
  67. package/dist/contracts/recording_credits/recording_party_role.d.ts +0 -1174
  68. package/dist/contracts/recording_credits/recording_party_role.d.ts.map +0 -1
  69. package/dist/contracts/recording_credits/recording_party_role.js +0 -692
  70. package/dist/contracts/recording_credits/recording_party_role.js.map +0 -1
  71. package/dist/contracts/recording_royalty_pool/recording_royalty_pool.d.ts +0 -90
  72. package/dist/contracts/recording_royalty_pool/recording_royalty_pool.d.ts.map +0 -1
  73. package/dist/contracts/recording_royalty_pool/recording_royalty_pool.js +0 -80
  74. package/dist/contracts/recording_royalty_pool/recording_royalty_pool.js.map +0 -1
  75. package/dist/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.d.ts +0 -52
  76. package/dist/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.d.ts.map +0 -1
  77. package/dist/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.js +0 -37
  78. package/dist/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.js.map +0 -1
  79. package/dist/contracts/release_cover_art/deps/cover_art/cover_art.d.ts +0 -46
  80. package/dist/contracts/release_cover_art/deps/cover_art/cover_art.d.ts.map +0 -1
  81. package/dist/contracts/release_cover_art/deps/cover_art/cover_art.js +0 -21
  82. package/dist/contracts/release_cover_art/deps/cover_art/cover_art.js.map +0 -1
  83. package/dist/contracts/release_cover_art/deps/per_track/per_track.d.ts +0 -33
  84. package/dist/contracts/release_cover_art/deps/per_track/per_track.d.ts.map +0 -1
  85. package/dist/contracts/release_cover_art/deps/per_track/per_track.js +0 -32
  86. package/dist/contracts/release_cover_art/deps/per_track/per_track.js.map +0 -1
  87. package/dist/contracts/release_cover_art/release_cover_art.d.ts +0 -300
  88. package/dist/contracts/release_cover_art/release_cover_art.d.ts.map +0 -1
  89. package/dist/contracts/release_cover_art/release_cover_art.js +0 -168
  90. package/dist/contracts/release_cover_art/release_cover_art.js.map +0 -1
  91. package/dist/contracts/release_credits/deps/miso_credit/credit.d.ts +0 -24
  92. package/dist/contracts/release_credits/deps/miso_credit/credit.d.ts.map +0 -1
  93. package/dist/contracts/release_credits/deps/miso_credit/credit.js +0 -23
  94. package/dist/contracts/release_credits/deps/miso_credit/credit.js.map +0 -1
  95. package/dist/contracts/release_credits/deps/sui/vec_map.d.ts +0 -37
  96. package/dist/contracts/release_credits/deps/sui/vec_map.d.ts.map +0 -1
  97. package/dist/contracts/release_credits/deps/sui/vec_map.js +0 -28
  98. package/dist/contracts/release_credits/deps/sui/vec_map.js.map +0 -1
  99. package/dist/contracts/release_credits/release_credits.d.ts +0 -142
  100. package/dist/contracts/release_credits/release_credits.d.ts.map +0 -1
  101. package/dist/contracts/release_credits/release_credits.js +0 -108
  102. package/dist/contracts/release_credits/release_credits.js.map +0 -1
  103. package/dist/contracts/release_credits/release_party_role.d.ts +0 -58
  104. package/dist/contracts/release_credits/release_party_role.d.ts.map +0 -1
  105. package/dist/contracts/release_credits/release_party_role.js +0 -66
  106. package/dist/contracts/release_credits/release_party_role.js.map +0 -1
  107. package/dist/contracts/royalty_pool/deps/std/type_name.d.ts +0 -18
  108. package/dist/contracts/royalty_pool/deps/std/type_name.d.ts.map +0 -1
  109. package/dist/contracts/royalty_pool/deps/std/type_name.js +0 -20
  110. package/dist/contracts/royalty_pool/deps/std/type_name.js.map +0 -1
  111. package/dist/contracts/royalty_pool/deps/sui/balance.d.ts +0 -13
  112. package/dist/contracts/royalty_pool/deps/sui/balance.d.ts.map +0 -1
  113. package/dist/contracts/royalty_pool/deps/sui/balance.js +0 -15
  114. package/dist/contracts/royalty_pool/deps/sui/balance.js.map +0 -1
  115. package/dist/contracts/royalty_pool/deps/sui/vec_map.d.ts +0 -37
  116. package/dist/contracts/royalty_pool/deps/sui/vec_map.d.ts.map +0 -1
  117. package/dist/contracts/royalty_pool/deps/sui/vec_map.js +0 -28
  118. package/dist/contracts/royalty_pool/deps/sui/vec_map.js.map +0 -1
  119. package/dist/contracts/royalty_pool/pool.d.ts +0 -358
  120. package/dist/contracts/royalty_pool/pool.d.ts.map +0 -1
  121. package/dist/contracts/royalty_pool/pool.js +0 -352
  122. package/dist/contracts/royalty_pool/pool.js.map +0 -1
  123. package/dist/contracts/royalty_pool/stake.d.ts +0 -202
  124. package/dist/contracts/royalty_pool/stake.d.ts.map +0 -1
  125. package/dist/contracts/royalty_pool/stake.js +0 -197
  126. package/dist/contracts/royalty_pool/stake.js.map +0 -1
  127. package/dist/cover.d.ts +0 -48
  128. package/dist/cover.d.ts.map +0 -1
  129. package/dist/cover.js +0 -68
  130. package/dist/cover.js.map +0 -1
  131. package/dist/credits.d.ts +0 -171
  132. package/dist/credits.d.ts.map +0 -1
  133. package/dist/credits.js +0 -360
  134. package/dist/credits.js.map +0 -1
  135. package/dist/extensions/royalty-pool.d.ts +0 -32
  136. package/dist/extensions/royalty-pool.d.ts.map +0 -1
  137. package/dist/extensions/royalty-pool.js +0 -33
  138. package/dist/extensions/royalty-pool.js.map +0 -1
  139. package/src/contracts/composition_credits/composition_credits.ts +0 -169
  140. package/src/contracts/composition_credits/composition_party_role.ts +0 -189
  141. package/src/contracts/composition_credits/deps/miso_credit/credit.ts +0 -27
  142. package/src/contracts/composition_credits/deps/sui/vec_map.ts +0 -33
  143. package/src/contracts/composition_royalty_pool/composition_royalty_pool.ts +0 -135
  144. package/src/contracts/cover_art/cover_art.ts +0 -99
  145. package/src/contracts/cover_art/deps/ori/walrus_data.ts +0 -36
  146. package/src/contracts/recording_credits/deps/miso_credit/credit.ts +0 -27
  147. package/src/contracts/recording_credits/deps/sui/vec_map.ts +0 -33
  148. package/src/contracts/recording_credits/deps/sui/vec_set.ts +0 -21
  149. package/src/contracts/recording_credits/recording_credits.ts +0 -458
  150. package/src/contracts/recording_credits/recording_party_role.ts +0 -1041
  151. package/src/contracts/recording_royalty_pool/recording_royalty_pool.ts +0 -138
  152. package/src/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.ts +0 -36
  153. package/src/contracts/release_cover_art/deps/cover_art/cover_art.ts +0 -23
  154. package/src/contracts/release_cover_art/deps/per_track/per_track.ts +0 -36
  155. package/src/contracts/release_cover_art/release_cover_art.ts +0 -251
  156. package/src/contracts/release_credits/deps/miso_credit/credit.ts +0 -27
  157. package/src/contracts/release_credits/deps/sui/vec_map.ts +0 -33
  158. package/src/contracts/release_credits/release_credits.ts +0 -156
  159. package/src/contracts/release_credits/release_party_role.ts +0 -87
  160. package/src/contracts/royalty_pool/deps/std/type_name.ts +0 -22
  161. package/src/contracts/royalty_pool/deps/sui/balance.ts +0 -17
  162. package/src/contracts/royalty_pool/deps/sui/vec_map.ts +0 -33
  163. package/src/contracts/royalty_pool/pool.ts +0 -577
  164. package/src/contracts/royalty_pool/stake.ts +0 -317
  165. package/src/cover.ts +0 -136
  166. package/src/credits.ts +0 -645
  167. package/src/extensions/royalty-pool.ts +0 -85
@@ -1,197 +0,0 @@
1
- /**************************************************************
2
- * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
- **************************************************************/
4
- /**
5
- * A position holding share tokens registered against a `RoyaltyPool`.
6
- *
7
- * Stakes are owned objects with an immutable balance — to increase a holder's
8
- * total staked amount, mint additional Stake objects rather than modify an
9
- * existing one. This mirrors Sui's native staking model.
10
- *
11
- * Each stake tracks the royalty pools it is currently registered with via an
12
- * inline `VecMap<TypeName, Registration>`, keyed by the pool's `Currency`
13
- * `TypeName`. The stake cannot be destroyed while any registrations remain. Pool
14
- * registrations are mutated by `royalty_pool::pool` through the package-private
15
- * accessors below.
16
- */
17
- import { MoveStruct, normalizeMoveArguments } from '../utils/index.js';
18
- import { bcs } from '@mysten/sui/bcs';
19
- import {} from '@mysten/sui/transactions';
20
- import * as balance_1 from './deps/sui/balance.js';
21
- import * as vec_map from './deps/sui/vec_map.js';
22
- import * as type_name from './deps/std/type_name.js';
23
- const $moduleName = '@local-pkg/royalty_pool::stake';
24
- export const Registration = new MoveStruct({ name: `${$moduleName}::Registration`, fields: {
25
- pool_id: bcs.Address,
26
- last_claim_index: bcs.u256()
27
- } });
28
- export const Stake = new MoveStruct({ name: `${$moduleName}::Stake<phantom Share>`, fields: {
29
- id: bcs.Address,
30
- /** The staked balance. Immutable after creation. */
31
- balance: balance_1.Balance,
32
- /**
33
- * Active royalty-pool registrations, keyed by `Currency` `TypeName`. Must be empty
34
- * to destroy.
35
- */
36
- registrations: vec_map.VecMap(type_name.TypeName, Registration)
37
- } });
38
- export const StakeCreatedEvent = new MoveStruct({ name: `${$moduleName}::StakeCreatedEvent<phantom Share>`, fields: {
39
- stake_id: bcs.Address,
40
- amount: bcs.u64()
41
- } });
42
- export const StakeDestroyedEvent = new MoveStruct({ name: `${$moduleName}::StakeDestroyedEvent<phantom Share>`, fields: {
43
- stake_id: bcs.Address,
44
- amount: bcs.u64()
45
- } });
46
- /**
47
- * Create a new stake with the given balance.
48
- *
49
- * Aborts if `balance` is zero.
50
- */
51
- export function _new(options) {
52
- const packageAddress = options.package ?? '@local-pkg/royalty_pool';
53
- const argumentsTypes = [
54
- null
55
- ];
56
- const parameterNames = ["balance"];
57
- return (tx) => tx.moveCall({
58
- package: packageAddress,
59
- module: 'stake',
60
- function: 'new',
61
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
62
- typeArguments: options.typeArguments
63
- });
64
- }
65
- /**
66
- * Destroy a stake and reclaim its balance.
67
- *
68
- * Aborts if the stake is still registered with any royalty pools.
69
- */
70
- export function destroy(options) {
71
- const packageAddress = options.package ?? '@local-pkg/royalty_pool';
72
- const argumentsTypes = [
73
- null
74
- ];
75
- const parameterNames = ["stake"];
76
- return (tx) => tx.moveCall({
77
- package: packageAddress,
78
- module: 'stake',
79
- function: 'destroy',
80
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
81
- typeArguments: options.typeArguments
82
- });
83
- }
84
- export function id(options) {
85
- const packageAddress = options.package ?? '@local-pkg/royalty_pool';
86
- const argumentsTypes = [
87
- null
88
- ];
89
- const parameterNames = ["self"];
90
- return (tx) => tx.moveCall({
91
- package: packageAddress,
92
- module: 'stake',
93
- function: 'id',
94
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
95
- typeArguments: options.typeArguments
96
- });
97
- }
98
- export function balance(options) {
99
- const packageAddress = options.package ?? '@local-pkg/royalty_pool';
100
- const argumentsTypes = [
101
- null
102
- ];
103
- const parameterNames = ["self"];
104
- return (tx) => tx.moveCall({
105
- package: packageAddress,
106
- module: 'stake',
107
- function: 'balance',
108
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
109
- typeArguments: options.typeArguments
110
- });
111
- }
112
- export function value(options) {
113
- const packageAddress = options.package ?? '@local-pkg/royalty_pool';
114
- const argumentsTypes = [
115
- null
116
- ];
117
- const parameterNames = ["self"];
118
- return (tx) => tx.moveCall({
119
- package: packageAddress,
120
- module: 'stake',
121
- function: 'value',
122
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
123
- typeArguments: options.typeArguments
124
- });
125
- }
126
- /** Number of royalty pools this stake is currently registered with. */
127
- export function registrationCount(options) {
128
- const packageAddress = options.package ?? '@local-pkg/royalty_pool';
129
- const argumentsTypes = [
130
- null
131
- ];
132
- const parameterNames = ["self"];
133
- return (tx) => tx.moveCall({
134
- package: packageAddress,
135
- module: 'stake',
136
- function: 'registration_count',
137
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
138
- typeArguments: options.typeArguments
139
- });
140
- }
141
- export function hasRegistration(options) {
142
- const packageAddress = options.package ?? '@local-pkg/royalty_pool';
143
- const argumentsTypes = [
144
- null,
145
- null
146
- ];
147
- const parameterNames = ["self", "currency"];
148
- return (tx) => tx.moveCall({
149
- package: packageAddress,
150
- module: 'stake',
151
- function: 'has_registration',
152
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
153
- typeArguments: options.typeArguments
154
- });
155
- }
156
- export function getRegistration(options) {
157
- const packageAddress = options.package ?? '@local-pkg/royalty_pool';
158
- const argumentsTypes = [
159
- null,
160
- null
161
- ];
162
- const parameterNames = ["self", "currency"];
163
- return (tx) => tx.moveCall({
164
- package: packageAddress,
165
- module: 'stake',
166
- function: 'get_registration',
167
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
168
- typeArguments: options.typeArguments
169
- });
170
- }
171
- export function registrationPoolId(options) {
172
- const packageAddress = options.package ?? '@local-pkg/royalty_pool';
173
- const argumentsTypes = [
174
- null
175
- ];
176
- const parameterNames = ["r"];
177
- return (tx) => tx.moveCall({
178
- package: packageAddress,
179
- module: 'stake',
180
- function: 'registration_pool_id',
181
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
182
- });
183
- }
184
- export function registrationLastClaimIndex(options) {
185
- const packageAddress = options.package ?? '@local-pkg/royalty_pool';
186
- const argumentsTypes = [
187
- null
188
- ];
189
- const parameterNames = ["r"];
190
- return (tx) => tx.moveCall({
191
- package: packageAddress,
192
- module: 'stake',
193
- function: 'registration_last_claim_index',
194
- arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
195
- });
196
- }
197
- //# sourceMappingURL=stake.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stake.js","sourceRoot":"","sources":["../../../src/contracts/royalty_pool/stake.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAGhE;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,UAAU,EAAE,sBAAsB,EAA+B,MAAM,mBAAmB,CAAC;AACpG,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACtC,OAAO,E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AAc;QACvB,MAAM,EAAE,OAAO;QACf,QAAQ,EAAE,kBAAkB;QAC5B,SAAS,EAAE,sBAAsB,CAAC,OAAO,CAAC,SAAS,EAAE,cAAc,EAAE,cAAc,CAAC;QACpF,aAAa,EAAE,OAAO,CAAC,aAAa;KACvC,CAAC,CAAC;AACP,CAAC;AAUD,MAAM,UAAU,kBAAkB,CAAC,OAAkC;IACjE,MAAM,cAAc,GAAG,OAAO,CAAC,OAAO,IAAI,yBAAyB,CAAC;IACpE,MAAM,cAAc,GAAG;QACnB,IAAI;KACqB,CAAC;IAC9B,MAAM,cAAc,GAAG,CAAC,GAAG,CAAC,CAAC;IAC7B,OAAO,CAAC,EAAe,EAAE,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC;QACpC,OAAO,EAAE,cAAc;QACvB,MAAM,EAAE,OAAO;QACf,QAAQ,EAAE,sBAAsB;QAChC,SAAS,EAAE,sBAAsB,CAAC,OAAO,CAAC,SAAS,EAAE,cAAc,EAAE,cAAc,CAAC;KACvF,CAAC,CAAC;AACP,CAAC;AAUD,MAAM,UAAU,0BAA0B,CAAC,OAA0C;IACjF,MAAM,cAAc,GAAG,OAAO,CAAC,OAAO,IAAI,yBAAyB,CAAC;IACpE,MAAM,cAAc,GAAG;QACnB,IAAI;KACqB,CAAC;IAC9B,MAAM,cAAc,GAAG,CAAC,GAAG,CAAC,CAAC;IAC7B,OAAO,CAAC,EAAe,EAAE,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC;QACpC,OAAO,EAAE,cAAc;QACvB,MAAM,EAAE,OAAO;QACf,QAAQ,EAAE,+BAA+B;QACzC,SAAS,EAAE,sBAAsB,CAAC,OAAO,CAAC,SAAS,EAAE,cAAc,EAAE,cAAc,CAAC;KACvF,CAAC,CAAC;AACP,CAAC"}
package/dist/cover.d.ts DELETED
@@ -1,48 +0,0 @@
1
- import type { ClientWithCoreApi } from "@mysten/sui/client";
2
- import type { TxThunk } from "./transactions.ts";
3
- export interface SetReleaseCoverParams {
4
- /** The `Release` object to attach the cover to. */
5
- releaseId: string;
6
- /** The release's `ReleaseAdminCap`. */
7
- releaseAdminCapId: string;
8
- /** Walrus blob id of the still cover image, as `u256` (decimal string or bigint). */
9
- stillBlobId: bigint | string;
10
- /** Optional animated-cover Walrus blob id (`u256`); omit for a still-only cover. */
11
- animatedBlobId?: bigint | string | null;
12
- /** `cover_art` package — home of the `CoverArt` value type (`cover_art::new`). */
13
- coverArtPackageId: string;
14
- /** `release_cover_art` package — home of the `set_cover` extension entry point. */
15
- releaseCoverArtPackageId: string;
16
- /** `ori` package (home of `walrus_data::new_blob` / the `WalrusData` type). */
17
- oriPackageId: string;
18
- }
19
- /** Sets (or replaces) a release's album-level cover from Walrus blob ids. */
20
- export declare function setReleaseCover(p: SetReleaseCoverParams): TxThunk;
21
- /**
22
- * A normalized reference to a cover image's Walrus data. Blob ids are returned as
23
- * `u256` decimal strings (the on-chain form); callers convert to a base64url
24
- * aggregator URL with `@unconfirmed/ori` (`u256ToB64Url` / `walrusDataUrl`).
25
- */
26
- export type CoverImageRef = {
27
- kind: "blob";
28
- blobId: string;
29
- } | {
30
- kind: "quiltPatch";
31
- quiltId: string;
32
- version: number;
33
- startIndex: number;
34
- endIndex: number;
35
- };
36
- /** A release's album-level cover: a still image and an optional animation. */
37
- export interface ReleaseCoverView {
38
- still: CoverImageRef;
39
- animated: CoverImageRef | null;
40
- }
41
- /**
42
- * Reads a release's album-level cover (the `release_cover_art` extension), or
43
- * `null` if no cover is attached. Derives the `ExtensionKey` dynamic field on the
44
- * release, parses the `ReleaseCoverArt`, and returns the still (+ optional
45
- * animation) as normalized Walrus refs for the app's featured-pressing card.
46
- */
47
- export declare function getReleaseCover(client: ClientWithCoreApi, releaseId: string, releaseCoverArtPackageId: string): Promise<ReleaseCoverView | null>;
48
- //# sourceMappingURL=cover.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cover.d.ts","sourceRoot":"","sources":["../src/cover.ts"],"names":[],"mappings":"AAYA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
- // SPDX-License-Identifier: Apache-2.0
3
- import { bcs } from "@mysten/sui/bcs";
4
- import { deriveDynamicFieldID } from "@mysten/sui/utils";
5
- import { OPTION_NONE, OPTION_SOME } from "./internal.js";
6
- import { isNotFound } from "./queries.js";
7
- import * as coverArt from "./contracts/cover_art/cover_art.js";
8
- import * as releaseCoverArt from "./contracts/release_cover_art/release_cover_art.js";
9
- /** Sets (or replaces) a release's album-level cover from Walrus blob ids. */
10
- export function setReleaseCover(p) {
11
- return (tx) => {
12
- const walrusType = `${p.oriPackageId}::walrus_data::WalrusData`;
13
- const blob = (id) => tx.moveCall({ target: `${p.oriPackageId}::walrus_data::new_blob`, arguments: [tx.pure.u256(id)] });
14
- const still = blob(p.stillBlobId);
15
- const animated = p.animatedBlobId == null
16
- ? tx.moveCall({ target: OPTION_NONE, typeArguments: [walrusType] })
17
- : tx.moveCall({ target: OPTION_SOME, typeArguments: [walrusType], arguments: [blob(p.animatedBlobId)] });
18
- const cover = tx.add(coverArt._new({ package: p.coverArtPackageId, arguments: [still, animated] }));
19
- tx.add(releaseCoverArt.setCover({
20
- package: p.releaseCoverArtPackageId,
21
- arguments: [p.releaseId, p.releaseAdminCapId, cover],
22
- }));
23
- };
24
- }
25
- // The cover is a dynamic field on the release UID under an empty `ExtensionKey()`
26
- // (Move's implicit `dummy_field: bool` → one `false` byte). The stored value is a
27
- // `Field { id, name: ExtensionKey, value: ReleaseCoverArt }`.
28
- const CoverArtField = bcs.struct("Field", {
29
- id: bcs.Address,
30
- name: releaseCoverArt.ExtensionKey,
31
- value: releaseCoverArt.ReleaseCoverArt,
32
- });
33
- const COVER_ART_KEY_BYTES = releaseCoverArt.ExtensionKey.serialize([false]).toBytes();
34
- function toCoverImageRef(wd) {
35
- if (wd.$kind === "Blob")
36
- return { kind: "blob", blobId: String(wd.Blob[0]) };
37
- const [quiltId, version, startIndex, endIndex] = wd.QuiltPatch;
38
- return { kind: "quiltPatch", quiltId: String(quiltId), version, startIndex, endIndex };
39
- }
40
- /**
41
- * Reads a release's album-level cover (the `release_cover_art` extension), or
42
- * `null` if no cover is attached. Derives the `ExtensionKey` dynamic field on the
43
- * release, parses the `ReleaseCoverArt`, and returns the still (+ optional
44
- * animation) as normalized Walrus refs for the app's featured-pressing card.
45
- */
46
- export async function getReleaseCover(client, releaseId, releaseCoverArtPackageId) {
47
- const fieldId = deriveDynamicFieldID(releaseId, `${releaseCoverArtPackageId}::release_cover_art::ExtensionKey`, COVER_ART_KEY_BYTES);
48
- let content;
49
- try {
50
- const { object } = await client.core.getObject({ objectId: fieldId, include: { content: true } });
51
- content = object?.content ?? null;
52
- }
53
- catch (e) {
54
- if (isNotFound(e))
55
- return null;
56
- throw e;
57
- }
58
- if (!content)
59
- return null;
60
- const cover = CoverArtField.parse(content).value.cover;
61
- if (!cover)
62
- return null;
63
- return {
64
- still: toCoverImageRef(cover.still),
65
- animated: cover.animated ? toCoverImageRef(cover.animated) : null,
66
- };
67
- }
68
- //# sourceMappingURL=cover.js.map
package/dist/cover.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"cover.js","sourceRoot":"","sources":["../src/cover.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,sCAAsC;AAYtC,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAEzD,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,QAAQ,MAAM,oCAAoC,CAAC;AAC/D,OAAO,KAAK,eAAe,MAAM,oDAAoD,CAAC;AAmBtF,6EAA6E;AAC7E,MAAM,UAAU,eAAe,CAAC,CAAwB;IACtD,OAAO,CAAC,EAAE,EAAE,EAAE;QACZ,MAAM,UAAU,GAAG,GAAG,CAAC,CAAC,YAAY,2BAA2B,CAAC;QAChE,MAAM,IAAI,GAAG,CAAC,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E1B,MAAM,KAAK,GAAG,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,KAEzC,CAAC;IACT,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IAExB,OAAO;QACL,KAAK,EAAE,eAAe,CAAC,KAAK,CAAC,KAAK,CAAC;QACnC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI;KAClE,CAAC;AACJ,CAAC"}
package/dist/credits.d.ts DELETED
@@ -1,171 +0,0 @@
1
- import type { ClientWithCoreApi } from "@mysten/sui/client";
2
- import type { TxThunk } from "./transactions.ts";
3
- /** A composition writing role. `Custom` carries a free-form (validated) name. */
4
- export type CompositionRole = {
5
- type: "Adapter" | "Arranger" | "Composer" | "Lyricist" | "Songwriter" | "Translator";
6
- } | {
7
- type: "Custom";
8
- name: string;
9
- };
10
- /** Seniority/prominence level for a recording role. */
11
- export type RecordingRoleLevel = "Additional" | "Assistant" | "Associate" | "Backing" | "Executive" | "Featured" | "Lead" | "Primary" | "Principal";
12
- /** Recording role base names that carry an optional level. */
13
- export type RecordingLeveledRoleType = "Actor" | "Arranger" | "BandLeader" | "Choir" | "ChoirMaster" | "ConcertMaster" | "Conductor" | "Contractor" | "DJ" | "Editor" | "Engineer" | "Ensemble" | "MasteringEngineer" | "MixingEngineer" | "MusicDirector" | "MusicSupervisor" | "Narrator" | "Orchestra" | "Orchestrator" | "Performer" | "Producer" | "Programmer" | "RecordingEngineer" | "RemixingEngineer" | "Soloist" | "SoundDesigner" | "Speaker" | "Vocalist";
14
- /**
15
- * A recording production/performance role. Most roles take an optional `level`;
16
- * `Instrumentalist` also carries the instrument name; `Custom` carries a free-form
17
- * (validated) name; `ArtistsAndRepertoire` and `Copyist` are clerical and take no
18
- * level.
19
- */
20
- export type RecordingRole = {
21
- type: RecordingLeveledRoleType;
22
- level?: RecordingRoleLevel;
23
- } | {
24
- type: "Instrumentalist";
25
- instrument: string;
26
- level?: RecordingRoleLevel;
27
- } | {
28
- type: "Custom";
29
- name: string;
30
- level?: RecordingRoleLevel;
31
- } | {
32
- type: "ArtistsAndRepertoire";
33
- } | {
34
- type: "Copyist";
35
- };
36
- /** A release billing role — a release credit carries exactly one of these. */
37
- export type ReleaseRole = "Primary" | "Featured";
38
- export interface AttachCompositionCreditParams {
39
- /** The `Composition` object to credit on. */
40
- compositionId: string;
41
- /** The composition's `CompositionAdminCap`. */
42
- compositionAdminCapId: string;
43
- /** The `Party` being credited. */
44
- partyId: string;
45
- /** Human-readable name for the credit (≤200 bytes, non-empty). */
46
- displayName: string;
47
- /** 1–5 writing roles; duplicates are rejected on-chain. */
48
- roles: CompositionRole[];
49
- /** The composition's share coin type (the `CompositionShare` phantom). */
50
- compositionShareType: string;
51
- /** `composition_credits` package id (roles + `add_credit`). */
52
- compositionCreditsPackageId: string;
53
- /** `miso_credit` package id (home of `credit::new`). */
54
- misoCreditPackageId: string;
55
- }
56
- /**
57
- * Adds a writing credit for a party on a composition. Throws (client-side,
58
- * mirroring the Move aborts) when `displayName` is empty or over 200 UTF-8
59
- * bytes, or `roles` is empty, has more than 5 entries, or contains duplicates.
60
- */
61
- export declare function attachCompositionCredit(p: AttachCompositionCreditParams): TxThunk;
62
- export interface AttachRecordingCreditParams {
63
- /** The `Recording` object to credit on. */
64
- recordingId: string;
65
- /** The recording's `RecordingAdminCap`. */
66
- recordingAdminCapId: string;
67
- /** The `Party` being credited. */
68
- partyId: string;
69
- /** Human-readable name for the credit (≤200 bytes, non-empty). */
70
- displayName: string;
71
- /** 1–10 production/performance roles; duplicates are rejected on-chain. */
72
- roles: RecordingRole[];
73
- /** The recording's own share coin type (the `RecordingShare` phantom). */
74
- recordingShareType: string;
75
- /** The parent composition's share coin type (the `CompositionShare` phantom). */
76
- compositionShareType: string;
77
- /** `recording_credits` package id (roles + `add_credit`). */
78
- recordingCreditsPackageId: string;
79
- /** `miso_credit` package id (home of `credit::new`). */
80
- misoCreditPackageId: string;
81
- }
82
- /**
83
- * Adds a production/performance credit for a party on a recording. Throws
84
- * (client-side, mirroring the Move aborts) when `displayName` is empty or over
85
- * 200 UTF-8 bytes, or `roles` is empty, has more than 10 entries, or contains
86
- * duplicates (same type + instrument + custom name + level).
87
- */
88
- export declare function attachRecordingCredit(p: AttachRecordingCreditParams): TxThunk;
89
- export interface AddRecordingArtistParams {
90
- /** The `Recording` object. */
91
- recordingId: string;
92
- /** The recording's `RecordingAdminCap`. */
93
- recordingAdminCapId: string;
94
- /** The `Party` to designate. Must already be credited on the recording. */
95
- partyId: string;
96
- /** The recording's own share coin type (the `RecordingShare` phantom). */
97
- recordingShareType: string;
98
- /** The parent composition's share coin type (the `CompositionShare` phantom). */
99
- compositionShareType: string;
100
- /** `recording_credits` package id. */
101
- recordingCreditsPackageId: string;
102
- }
103
- /**
104
- * Designates an already-credited party as a primary artist on a recording. The
105
- * party must be credited first (via `attachRecordingCredit`) and not already a
106
- * primary or featured artist.
107
- */
108
- export declare function addRecordingPrimaryArtist(p: AddRecordingArtistParams): TxThunk;
109
- /**
110
- * Designates an already-credited party as a featured artist on a recording. The
111
- * party must be credited first (via `attachRecordingCredit`) and not already a
112
- * primary or featured artist.
113
- */
114
- export declare function addRecordingFeaturedArtist(p: AddRecordingArtistParams): TxThunk;
115
- export interface AddReleaseCreditParams {
116
- /** The `Release` object to credit on. */
117
- releaseId: string;
118
- /** The release's `ReleaseAdminCap`. */
119
- releaseAdminCapId: string;
120
- /** The `Party` being credited. */
121
- partyId: string;
122
- /** Human-readable name for the credit (≤200 bytes, non-empty). */
123
- displayName: string;
124
- /** The single billing role: `"Primary"` or `"Featured"`. */
125
- role: ReleaseRole;
126
- /** `release_credits` package id (roles + `add_credit`). */
127
- releaseCreditsPackageId: string;
128
- /** `miso_credit` package id (home of `credit::new`). */
129
- misoCreditPackageId: string;
130
- }
131
- /**
132
- * Adds a top-line billing credit (a single role) for a party on a release.
133
- * Throws (client-side, mirroring the Move aborts) when `displayName` is empty
134
- * or over 200 UTF-8 bytes. The single role is structural, so no role checks.
135
- */
136
- export declare function addReleaseCredit(p: AddReleaseCreditParams): TxThunk;
137
- /** A normalized credit: the party, its display name, and its role labels. */
138
- export interface CreditView {
139
- /** Object id of the credited `Party`. */
140
- partyId: string;
141
- /** Human-readable name for the credit. */
142
- displayName: string;
143
- /**
144
- * Role labels (the `name()` semantics). For a recording `Instrumentalist` the
145
- * instrument is included (`"Instrumentalist: Guitar"`); a recording role's level
146
- * is appended in parentheses (`"Producer (Lead)"`).
147
- */
148
- roles: string[];
149
- }
150
- /** A recording's credits, plus its primary/featured artist party ids. */
151
- export interface RecordingCreditsView {
152
- credits: CreditView[];
153
- primaryArtistIds: string[];
154
- featuredArtistIds: string[];
155
- }
156
- /**
157
- * Reads a composition's writing credits (the `composition_credits` extension), or
158
- * `null` if no credits field is attached.
159
- */
160
- export declare function getCompositionCredits(client: ClientWithCoreApi, compositionId: string, compositionCreditsPackageId: string): Promise<CreditView[] | null>;
161
- /**
162
- * Reads a recording's credits plus its primary/featured artist party ids (the
163
- * `recording_credits` extension), or `null` if no credits field is attached.
164
- */
165
- export declare function getRecordingCredits(client: ClientWithCoreApi, recordingId: string, recordingCreditsPackageId: string): Promise<RecordingCreditsView | null>;
166
- /**
167
- * Reads a release's top-line billing credits (the `release_credits` extension), or
168
- * `null` if no credits field is attached. Each credit has exactly one role.
169
- */
170
- export declare function getReleaseCredits(client: ClientWithCoreApi, releaseId: string, releaseCreditsPackageId: string): Promise<CreditView[] | null>;
171
- //# sourceMappingURL=credits.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"credits.d.ts","sourceRoot":"","sources":["../src/credits.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAI5D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAYjD,iFAAiF;AACjF,MAAM,MAAM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