@misofm/sdk 0.15.10 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +153 -56
- package/dist/client.d.ts +175 -47
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +302 -47
- package/dist/client.js.map +1 -1
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.d.ts +11 -11
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.d.ts.map +1 -1
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.js +9 -9
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.js.map +1 -1
- package/dist/contracts/miso_record/deps/std/type_name.d.ts.map +1 -0
- package/dist/contracts/miso_record/deps/std/type_name.js.map +1 -0
- package/dist/contracts/miso_record/deps/sui/vec_set.d.ts +21 -0
- package/dist/contracts/miso_record/deps/sui/vec_set.d.ts.map +1 -0
- package/dist/contracts/miso_record/deps/sui/vec_set.js +20 -0
- package/dist/contracts/miso_record/deps/sui/vec_set.js.map +1 -0
- package/dist/contracts/miso_record/pressing.d.ts +327 -0
- package/dist/contracts/miso_record/pressing.d.ts.map +1 -0
- package/dist/contracts/miso_record/pressing.js +345 -0
- package/dist/contracts/miso_record/pressing.js.map +1 -0
- package/dist/contracts/miso_record/record.d.ts +190 -0
- package/dist/contracts/miso_record/record.d.ts.map +1 -0
- package/dist/contracts/miso_record/record.js +226 -0
- package/dist/contracts/miso_record/record.js.map +1 -0
- package/dist/contracts/miso_record_shop/deps/std/type_name.d.ts +18 -0
- package/dist/contracts/miso_record_shop/deps/std/type_name.d.ts.map +1 -0
- package/dist/contracts/miso_record_shop/deps/std/type_name.js +20 -0
- package/dist/contracts/miso_record_shop/deps/std/type_name.js.map +1 -0
- package/dist/contracts/miso_record_shop/listing.d.ts +387 -0
- package/dist/contracts/miso_record_shop/listing.d.ts.map +1 -0
- package/dist/contracts/miso_record_shop/listing.js +380 -0
- package/dist/contracts/miso_record_shop/listing.js.map +1 -0
- package/dist/contracts/miso_record_shop/witness.d.ts +7 -0
- package/dist/contracts/miso_record_shop/witness.d.ts.map +1 -0
- package/dist/contracts/miso_record_shop/witness.js +9 -0
- package/dist/contracts/miso_record_shop/witness.js.map +1 -0
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.d.ts +10 -12
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.d.ts.map +1 -1
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.js +8 -10
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.js.map +1 -1
- package/dist/contracts/vault/vault.d.ts +149 -23
- package/dist/contracts/vault/vault.d.ts.map +1 -1
- package/dist/contracts/vault/vault.js +144 -18
- package/dist/contracts/vault/vault.js.map +1 -1
- package/dist/contracts.d.ts +3 -3
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js +5 -4
- package/dist/contracts.js.map +1 -1
- package/dist/deployments.d.ts +47 -11
- package/dist/deployments.d.ts.map +1 -1
- package/dist/deployments.js +48 -9
- package/dist/deployments.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/mix.d.ts +144 -0
- package/dist/mix.d.ts.map +1 -0
- package/dist/mix.js +656 -0
- package/dist/mix.js.map +1 -0
- package/dist/pressing.d.ts +72 -156
- package/dist/pressing.d.ts.map +1 -1
- package/dist/pressing.js +269 -261
- package/dist/pressing.js.map +1 -1
- package/dist/publication.d.ts +5 -2
- package/dist/publication.d.ts.map +1 -1
- package/dist/publication.js +63 -34
- package/dist/publication.js.map +1 -1
- package/dist/read/catalog.d.ts +8 -5
- package/dist/read/catalog.d.ts.map +1 -1
- package/dist/read/catalog.js +47 -35
- package/dist/read/catalog.js.map +1 -1
- package/dist/read/config.d.ts +6 -4
- package/dist/read/config.d.ts.map +1 -1
- package/dist/read/config.js +1 -2
- package/dist/read/config.js.map +1 -1
- package/dist/read/index.d.ts +1 -1
- package/dist/read/index.d.ts.map +1 -1
- package/dist/read/index.js +1 -1
- package/dist/read/index.js.map +1 -1
- package/dist/read/internal/scalars.d.ts.map +1 -1
- package/dist/read/internal/scalars.js +4 -3
- package/dist/read/internal/scalars.js.map +1 -1
- package/dist/read/internal/walrus.d.ts.map +1 -1
- package/dist/read/internal/walrus.js +2 -1
- package/dist/read/internal/walrus.js.map +1 -1
- package/dist/read/receipts.d.ts +21 -12
- package/dist/read/receipts.d.ts.map +1 -1
- package/dist/read/receipts.js +159 -56
- package/dist/read/receipts.js.map +1 -1
- package/dist/read/types.d.ts +40 -26
- package/dist/read/types.d.ts.map +1 -1
- package/dist/read/wallet.d.ts +3 -4
- package/dist/read/wallet.d.ts.map +1 -1
- package/dist/read/wallet.js +72 -53
- package/dist/read/wallet.js.map +1 -1
- package/dist/vault.d.ts +71 -15
- package/dist/vault.d.ts.map +1 -1
- package/dist/vault.js +135 -29
- package/dist/vault.js.map +1 -1
- package/package.json +10 -3
- package/src/client.ts +404 -69
- package/src/contracts/composition_royalty_pool/composition_royalty_pool.ts +15 -15
- package/src/contracts/miso_record/deps/sui/vec_set.ts +21 -0
- package/src/contracts/miso_record/pressing.ts +522 -0
- package/src/contracts/miso_record/record.ts +338 -0
- package/src/contracts/miso_record_shop/deps/std/type_name.ts +22 -0
- package/src/contracts/miso_record_shop/listing.ts +602 -0
- package/src/contracts/miso_record_shop/witness.ts +11 -0
- package/src/contracts/recording_royalty_pool/recording_royalty_pool.ts +14 -16
- package/src/contracts/vault/vault.ts +226 -21
- package/src/contracts.ts +5 -4
- package/src/deployments.ts +134 -38
- package/src/index.ts +2 -0
- package/src/mix.ts +910 -0
- package/src/pressing.ts +428 -423
- package/src/publication.ts +69 -36
- package/src/read/catalog.ts +49 -34
- package/src/read/config.ts +7 -7
- package/src/read/index.ts +9 -1
- package/src/read/internal/scalars.ts +4 -2
- package/src/read/internal/walrus.ts +2 -1
- package/src/read/receipts.ts +181 -66
- package/src/read/types.ts +41 -24
- package/src/read/wallet.ts +70 -57
- package/src/vault.ts +228 -41
- package/dist/contracts/miso_pressing/certificate.d.ts +0 -89
- package/dist/contracts/miso_pressing/certificate.d.ts.map +0 -1
- package/dist/contracts/miso_pressing/certificate.js +0 -108
- package/dist/contracts/miso_pressing/certificate.js.map +0 -1
- package/dist/contracts/miso_pressing/deps/std/type_name.d.ts.map +0 -1
- package/dist/contracts/miso_pressing/deps/std/type_name.js.map +0 -1
- package/dist/contracts/miso_pressing/listing.d.ts +0 -434
- package/dist/contracts/miso_pressing/listing.d.ts.map +0 -1
- package/dist/contracts/miso_pressing/listing.js +0 -401
- package/dist/contracts/miso_pressing/listing.js.map +0 -1
- package/dist/contracts/miso_pressing/pressing.d.ts +0 -334
- package/dist/contracts/miso_pressing/pressing.d.ts.map +0 -1
- package/dist/contracts/miso_pressing/pressing.js +0 -298
- package/dist/contracts/miso_pressing/pressing.js.map +0 -1
- package/src/contracts/miso_pressing/certificate.ts +0 -164
- package/src/contracts/miso_pressing/listing.ts +0 -592
- package/src/contracts/miso_pressing/pressing.ts +0 -399
- /package/dist/contracts/{miso_pressing → miso_record}/deps/std/type_name.d.ts +0 -0
- /package/dist/contracts/{miso_pressing → miso_record}/deps/std/type_name.js +0 -0
- /package/src/contracts/{miso_pressing → miso_record}/deps/std/type_name.ts +0 -0
package/README.md
CHANGED
|
@@ -10,13 +10,13 @@ protocol and data-extension primitives.
|
|
|
10
10
|
Miso ships two SDK families, and the npm scope tells you which promise you are
|
|
11
11
|
holding:
|
|
12
12
|
|
|
13
|
-
| Scope
|
|
14
|
-
|
|
|
13
|
+
| Scope | Layer | Owns |
|
|
14
|
+
| ---------------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------- |
|
|
15
15
|
| `@misonetwork/*` | **Protocol** | Composition, Recording, Release, Party identity; metadata/data extensions; utilities; generic royalty-pool and routed-stake primitives |
|
|
16
|
-
| `@misofm/*`
|
|
16
|
+
| `@misofm/*` | **Platform** | Pressing, Listing, Record, and Vault plugins that apply Miso business logic to custodied protocol admin caps |
|
|
17
17
|
|
|
18
18
|
A release is protocol. Pressing a record off that release and selling it is
|
|
19
|
-
platform. So is deciding
|
|
19
|
+
platform. So is deciding _what to do_ with a freshly-minted work's share
|
|
20
20
|
supply — the protocol only knows how to mint one. Keeping the boundary at the
|
|
21
21
|
package line is what stops the open protocol from quietly growing a
|
|
22
22
|
storefront (or an opinion about tokenomics).
|
|
@@ -26,7 +26,8 @@ Extensions add data to a work. Plugins provide business logic: a shared
|
|
|
26
26
|
`VaultAdminCap<AdminCap>`. A plugin borrows the cap and must return the exact
|
|
27
27
|
object in the same PTB. The SDK supports both vault authorities and legacy
|
|
28
28
|
address-owned admin caps explicitly; it never silently treats a legacy cap as a
|
|
29
|
-
vaulted one.
|
|
29
|
+
vaulted one. New Vault IDs are derived from the shared `VaultRegistry`, the raw
|
|
30
|
+
cap ID, and its type; each VaultAdminCap ID is then derived from its Vault.
|
|
30
31
|
|
|
31
32
|
This package requires `@misonetwork/sdk` as a peer and imports its bare
|
|
32
33
|
`createComposition`/`createRecording` primitives, composing them with its own
|
|
@@ -39,30 +40,44 @@ Install both SDKs at the application boundary; the platform package intentionall
|
|
|
39
40
|
does not carry its own protocol SDK copy:
|
|
40
41
|
|
|
41
42
|
```sh
|
|
42
|
-
bun add @misofm/sdk@^0.
|
|
43
|
+
bun add @misofm/sdk@^0.16.0 @misonetwork/sdk@^0.10.0
|
|
43
44
|
```
|
|
44
45
|
|
|
45
46
|
Both SDKs are consumed from npm. The platform package keeps
|
|
46
47
|
`@misonetwork/sdk` as a peer so applications resolve exactly one protocol SDK
|
|
47
48
|
and one compatible deployment map.
|
|
48
49
|
|
|
50
|
+
### Canonical Record-gated sessions
|
|
51
|
+
|
|
52
|
+
`@misofm/sdk/mix` defines the complete protected-playback wire contract. A
|
|
53
|
+
Record resolves its immutable Release track to a Recording, then derives that
|
|
54
|
+
Recording's `recording_engine_session::ExtensionKey` dynamic field directly.
|
|
55
|
+
The field names one plaintext Walrus `miso.engine-session/1` document containing
|
|
56
|
+
the encrypted stem blob IDs and one Seal-wrapped 32-byte session key. No event
|
|
57
|
+
scan, indexer-maintained relationship, or second encrypted manifest is needed.
|
|
58
|
+
|
|
59
|
+
The same entry point exposes exact identity encoding, strict canonical-session
|
|
60
|
+
parsing, Seal-envelope inspection, and explicit attach/replace/unset PTB
|
|
61
|
+
builders. Applications must pin the Record, policy, gate, and engine-session
|
|
62
|
+
package IDs from one verified deployment.
|
|
63
|
+
|
|
49
64
|
## The model
|
|
50
65
|
|
|
51
|
-
A release
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
nothing else.
|
|
66
|
+
A release may have one `Pressing` per positive `u16` edition. Each Pressing owns its
|
|
67
|
+
independent `u32` Record-number sequence, current supply, optional immutable `u32`
|
|
68
|
+
maximum supply, and authorized distributor witness types.
|
|
55
69
|
|
|
56
70
|
Selling in a currency is a `Listing<Currency>`, one per currency, permanent, edited in
|
|
57
|
-
place rather than replaced.
|
|
58
|
-
|
|
71
|
+
place rather than replaced. The Listing's enabled/disabled state is the sale switch;
|
|
72
|
+
the Pressing has no schedule state.
|
|
59
73
|
|
|
60
74
|
**Everything is address math.** The pressing's UID derives off its release's, each
|
|
61
75
|
listing's off the pressing's. The protocol's canonical `ReleaseRegistry` creates the
|
|
62
|
-
release; there is no
|
|
63
|
-
"where is it" is answered offline
|
|
64
|
-
|
|
65
|
-
|
|
76
|
+
release; there is no _pressing_ registry or mutable lookup pointer to follow, so
|
|
77
|
+
"where is it" is answered offline. A Pressing derives from `(release, edition)`, a
|
|
78
|
+
Record from `(pressing, number)`, and a `Listing<Currency>` from its Pressing under
|
|
79
|
+
the separate immutable Record Shop package. There are no Record Registry or Settings
|
|
80
|
+
singletons.
|
|
66
81
|
|
|
67
82
|
## Usage
|
|
68
83
|
|
|
@@ -85,29 +100,37 @@ const party = await client.miso.party.getPartyById(partyId);
|
|
|
85
100
|
// Read: run + one currency's offer, one round trip, no registry lookup.
|
|
86
101
|
const { pressing, listing } = await client.miso.getSale({
|
|
87
102
|
releaseId,
|
|
103
|
+
edition,
|
|
88
104
|
currencyType: USD_COIN_TYPE,
|
|
89
105
|
});
|
|
90
106
|
|
|
91
107
|
// Write: a thunk, so it composes with protocol calls in the same PTB.
|
|
92
108
|
const tx = new Transaction();
|
|
93
109
|
tx.add(
|
|
94
|
-
client.miso.tx.
|
|
110
|
+
client.miso.tx.purchaseRecord({
|
|
95
111
|
releaseId,
|
|
112
|
+
edition,
|
|
96
113
|
currencyType: USD_COIN_TYPE,
|
|
97
|
-
|
|
114
|
+
paymentAmount: listing.pricing.amount,
|
|
115
|
+
expectedPricing: listing.pricing,
|
|
98
116
|
recipient: buyer,
|
|
99
117
|
}),
|
|
100
118
|
);
|
|
101
119
|
```
|
|
102
120
|
|
|
103
|
-
|
|
104
|
-
|
|
121
|
+
The deployment records sales as either explicitly unavailable (legacy) or available
|
|
122
|
+
with both verified immutable package IDs. New sales builders and readers fail closed
|
|
123
|
+
when either package is unavailable.
|
|
124
|
+
|
|
125
|
+
Holding the ids yourself? The bare APIs take `recordPackageId` and/or
|
|
126
|
+
`recordShopPackageId` explicitly:
|
|
105
127
|
|
|
106
128
|
```ts
|
|
107
|
-
import {
|
|
129
|
+
import { purchaseRecord, getSale } from "@misofm/sdk/pressing";
|
|
108
130
|
```
|
|
109
131
|
|
|
110
|
-
|
|
132
|
+
Verified package IDs are bundled only after immutable publication. Legacy Testnet
|
|
133
|
+
identities remain labeled unavailable and are never reused as the new packages.
|
|
111
134
|
`MISO_PLATFORM_DEPLOYMENTS.testnet`. Calling `miso()` selects that verified map
|
|
112
135
|
from the Sui client's network. Unbundled and custom networks still fail closed
|
|
113
136
|
unless the caller passes one complete deployment through `miso({ deployment })`.
|
|
@@ -176,7 +199,7 @@ address, and the exact authorized route on every protected request.
|
|
|
176
199
|
|
|
177
200
|
### Payment
|
|
178
201
|
|
|
179
|
-
`listing::
|
|
202
|
+
`listing::purchase` takes a bare `Balance<Currency>`, and `purchaseRecord` sources it with
|
|
180
203
|
`tx.balance()` — which draws from the buyer's **address balance** first and falls back
|
|
181
204
|
to coin objects only if it must. When the address balance covers the price, that is a
|
|
182
205
|
single `balance::redeem_funds` and **no coin object is minted, touched, or destroyed**,
|
|
@@ -186,17 +209,24 @@ Never hand-pick coin objects for a payment. That road shows a buyer their $1,000
|
|
|
186
209
|
then refuses to spend a cent of it, because a coin listing cannot see money that lives
|
|
187
210
|
in the address balance.
|
|
188
211
|
|
|
189
|
-
Purchases
|
|
190
|
-
|
|
191
|
-
|
|
212
|
+
Purchases always set `useGasCoin: false`: the gas coin may belong to a sponsor. Buyers
|
|
213
|
+
also pass the exact expected `Fixed` or `Floor` pricing variant and value, protecting
|
|
214
|
+
them from stale pricing-mode changes as well as amount changes.
|
|
215
|
+
|
|
216
|
+
### Vault fund settlement
|
|
192
217
|
|
|
193
|
-
|
|
218
|
+
`settleAndDistributeReleaseRevenue`, `settleCompositionRoyaltyPool`, and
|
|
219
|
+
`settleRecordingRoyaltyPool` read the amount from the framework's
|
|
220
|
+
`balance::settled_funds_value` and pass that command result directly to the
|
|
221
|
+
plugin's exact-value redemption call. The caller never supplies or estimates a
|
|
222
|
+
`u64`. The lower-level `redeemAndDistributeReleaseRevenue`,
|
|
223
|
+
`redeemAndDepositCompositionRoyaltyPool`, and
|
|
224
|
+
`redeemAndDepositRecordingRoyaltyPool` remain available when an earlier PTB
|
|
225
|
+
command already produced the exact value.
|
|
194
226
|
|
|
195
|
-
|
|
196
|
-
`AccumulatorRoot` and let Move determine the commit-settled amount; callers no
|
|
197
|
-
longer provide a `u64`. Party-wallet monetary builders are similarly composable:
|
|
227
|
+
Party-wallet monetary builders are similarly composable:
|
|
198
228
|
`receivePartyWalletBalance`, `redeemPartyWalletBalance`, and
|
|
199
|
-
`
|
|
229
|
+
`settlePartyWalletBalance` return the PTB `Balance<Currency>` result. Pass that
|
|
200
230
|
result directly to another Move call, or convert it with `coin::from_balance`
|
|
201
231
|
only when an owned Coin is required. Every returned Balance must be consumed in
|
|
202
232
|
the same PTB.
|
|
@@ -233,8 +263,9 @@ const thunk = client.miso.tx.publishComposition({
|
|
|
233
263
|
`client.miso.tx.publishRecording` and `publishCompositionAndRecording`
|
|
234
264
|
follow the same shape (the latter atomically, borrow-before-share, in one PTB —
|
|
235
265
|
see `@misonetwork/sdk`'s README for why the ordering is load-bearing).
|
|
236
|
-
The protocol,
|
|
237
|
-
|
|
266
|
+
The protocol, immutable Record and Record Shop packages, minato, and core
|
|
267
|
+
`ReleaseRegistry` address all come from the deployment selected by the Sui
|
|
268
|
+
client's network. Record sales have no Record Registry or Settings singleton.
|
|
238
269
|
The deprecated `misoPlatform()` constructor still accepts those values manually
|
|
239
270
|
for compatibility with existing integrations.
|
|
240
271
|
|
|
@@ -247,8 +278,28 @@ import { publishReleaseGraph } from "@misofm/sdk";
|
|
|
247
278
|
// Every composition and recording, optional royalty pools, tracks, and
|
|
248
279
|
// the release — with the release id derived ON-CHAIN — in one atomic PTB.
|
|
249
280
|
const thunk = publishReleaseGraph({
|
|
250
|
-
compositions: [
|
|
251
|
-
|
|
281
|
+
compositions: [
|
|
282
|
+
{
|
|
283
|
+
shareType,
|
|
284
|
+
shareCurrencyId,
|
|
285
|
+
shareTreasuryCapId,
|
|
286
|
+
title: "Song",
|
|
287
|
+
royaltyRateBps: 1000,
|
|
288
|
+
shareRecipients,
|
|
289
|
+
adminAddress,
|
|
290
|
+
},
|
|
291
|
+
],
|
|
292
|
+
recordings: [
|
|
293
|
+
{
|
|
294
|
+
shareType,
|
|
295
|
+
shareCurrencyId,
|
|
296
|
+
shareTreasuryCapId,
|
|
297
|
+
compositionShareType,
|
|
298
|
+
parentCompositionIndex: 0,
|
|
299
|
+
shareRecipients,
|
|
300
|
+
adminAddress,
|
|
301
|
+
},
|
|
302
|
+
],
|
|
252
303
|
release: {
|
|
253
304
|
title: "Album",
|
|
254
305
|
nonce: "42",
|
|
@@ -335,10 +386,20 @@ const currency = await client.miso.createShareCurrency(signer, {
|
|
|
335
386
|
|
|
336
387
|
// Batched (many currencies, via a ParallelTransactionExecutor):
|
|
337
388
|
import { publishShareCurrencies, initializeShareCurrencies } from "@misofm/sdk";
|
|
338
|
-
const { packageIds } = await publishShareCurrencies(
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
389
|
+
const { packageIds } = await publishShareCurrencies(
|
|
390
|
+
executor,
|
|
391
|
+
initializerAddress,
|
|
392
|
+
10,
|
|
393
|
+
);
|
|
394
|
+
const { currencies } = await initializeShareCurrencies(
|
|
395
|
+
executor,
|
|
396
|
+
signerAddress,
|
|
397
|
+
packageIds,
|
|
398
|
+
(pkg) => ({
|
|
399
|
+
name: "…",
|
|
400
|
+
description: "…",
|
|
401
|
+
}),
|
|
402
|
+
);
|
|
342
403
|
```
|
|
343
404
|
|
|
344
405
|
`executeViaExecutor(executor, ...thunks)` (`execute.ts`) submits a
|
|
@@ -368,9 +429,14 @@ duplicate roles.
|
|
|
368
429
|
|
|
369
430
|
```ts
|
|
370
431
|
import {
|
|
371
|
-
attachCompositionCredit,
|
|
372
|
-
|
|
373
|
-
|
|
432
|
+
attachCompositionCredit,
|
|
433
|
+
attachRecordingCredit,
|
|
434
|
+
addReleaseCredit,
|
|
435
|
+
addRecordingPrimaryArtist,
|
|
436
|
+
addRecordingFeaturedArtist,
|
|
437
|
+
getCompositionCredits,
|
|
438
|
+
getRecordingCredits,
|
|
439
|
+
getReleaseCredits,
|
|
374
440
|
} from "@misofm/sdk";
|
|
375
441
|
|
|
376
442
|
const thunk = attachRecordingCredit({
|
|
@@ -378,7 +444,10 @@ const thunk = attachRecordingCredit({
|
|
|
378
444
|
recordingAdminCapId: "0x...",
|
|
379
445
|
partyId: "0x...",
|
|
380
446
|
displayName: "Jane Doe",
|
|
381
|
-
roles: [
|
|
447
|
+
roles: [
|
|
448
|
+
{ type: "Vocalist", level: "Lead" },
|
|
449
|
+
{ type: "Instrumentalist", instrument: "Guitar" },
|
|
450
|
+
],
|
|
382
451
|
recordingShareType: "0x...::share::Share",
|
|
383
452
|
compositionShareType: "0x...::share::Share",
|
|
384
453
|
recordingCreditsPackageId: "0x...",
|
|
@@ -386,12 +455,27 @@ const thunk = attachRecordingCredit({
|
|
|
386
455
|
});
|
|
387
456
|
|
|
388
457
|
// Designate an already-credited party (same params minus displayName/roles/misoCreditPackageId):
|
|
389
|
-
addRecordingPrimaryArtist({
|
|
458
|
+
addRecordingPrimaryArtist({
|
|
459
|
+
recordingId,
|
|
460
|
+
recordingAdminCapId,
|
|
461
|
+
partyId,
|
|
462
|
+
recordingShareType,
|
|
463
|
+
compositionShareType,
|
|
464
|
+
recordingCreditsPackageId,
|
|
465
|
+
});
|
|
390
466
|
|
|
391
467
|
// Reads return null when no credits field is attached.
|
|
392
|
-
const credits = await getCompositionCredits(
|
|
468
|
+
const credits = await getCompositionCredits(
|
|
469
|
+
client,
|
|
470
|
+
compositionId,
|
|
471
|
+
compositionCreditsPackageId,
|
|
472
|
+
);
|
|
393
473
|
// CreditView[]: { partyId, displayName, roles: string[] } — e.g. "Producer (Lead)", "Instrumentalist: Guitar"
|
|
394
|
-
const rc = await getRecordingCredits(
|
|
474
|
+
const rc = await getRecordingCredits(
|
|
475
|
+
client,
|
|
476
|
+
recordingId,
|
|
477
|
+
recordingCreditsPackageId,
|
|
478
|
+
);
|
|
395
479
|
// { credits: CreditView[], primaryArtistIds: string[], featuredArtistIds: string[] }
|
|
396
480
|
```
|
|
397
481
|
|
|
@@ -415,14 +499,18 @@ import { setReleaseCover, getReleaseCover } from "@misofm/sdk";
|
|
|
415
499
|
const thunk = setReleaseCover({
|
|
416
500
|
releaseId: "0x...",
|
|
417
501
|
releaseAdminCapId: "0x...",
|
|
418
|
-
stillBlobId: "987654321",
|
|
419
|
-
animatedBlobId: null,
|
|
502
|
+
stillBlobId: "987654321", // Walrus blob id as u256 (decimal string or bigint)
|
|
503
|
+
animatedBlobId: null, // optional animated cover
|
|
420
504
|
coverArtPackageId: "0x...",
|
|
421
505
|
releaseCoverArtPackageId: "0x...",
|
|
422
506
|
oriPackageId: "0x...",
|
|
423
507
|
});
|
|
424
508
|
|
|
425
|
-
const cover = await getReleaseCover(
|
|
509
|
+
const cover = await getReleaseCover(
|
|
510
|
+
client,
|
|
511
|
+
releaseId,
|
|
512
|
+
releaseCoverArtPackageId,
|
|
513
|
+
);
|
|
426
514
|
// ReleaseCoverView | null: { still, animated } as normalized Walrus refs
|
|
427
515
|
// ({ kind: "blob", blobId } | { kind: "quiltPatch", quiltId, version, startIndex, endIndex })
|
|
428
516
|
```
|
|
@@ -432,8 +520,12 @@ const cover = await getReleaseCover(client, releaseId, releaseCoverArtPackageId)
|
|
|
432
520
|
`vault.ts` contains composable PTB builders for custody and plugin flows:
|
|
433
521
|
`invokeWithAdminCap` safely sequences `borrow_as_admin → Move call → put_back`, and
|
|
434
522
|
`custodyNewAdminCap` shares the Vault while transferring only its owner-held
|
|
435
|
-
`VaultAdminCap
|
|
436
|
-
|
|
523
|
+
`VaultAdminCap` through the Vault module. `deriveVaultId` and
|
|
524
|
+
`deriveVaultAdminCapId` discover both canonical object IDs without an RPC lookup.
|
|
525
|
+
`withdrawVaultCapability` and `restoreVaultCapability` operate on the permanent
|
|
526
|
+
Vault shell; withdrawal requires every plugin to have been removed. Plugin
|
|
527
|
+
installers construct their witnesses inside their Move package; callers supply no
|
|
528
|
+
witness.
|
|
437
529
|
|
|
438
530
|
It also builds Composition/Recording royalty-pool initialization and cranks,
|
|
439
531
|
Release `redeem_and_distribute` / `receive_and_distribute`, and the full
|
|
@@ -444,10 +536,15 @@ the required `vector<Receiving<Coin<Currency>>>` in the PTB.
|
|
|
444
536
|
|
|
445
537
|
```ts
|
|
446
538
|
import type {
|
|
447
|
-
CreditView,
|
|
448
|
-
|
|
539
|
+
CreditView,
|
|
540
|
+
RecordingCreditsView,
|
|
541
|
+
CompositionRole,
|
|
542
|
+
RecordingRole,
|
|
543
|
+
RecordingRoleLevel,
|
|
544
|
+
RecordingLeveledRoleType,
|
|
449
545
|
ReleaseRole,
|
|
450
|
-
ReleaseCoverView,
|
|
546
|
+
ReleaseCoverView,
|
|
547
|
+
CoverImageRef,
|
|
451
548
|
} from "@misofm/sdk";
|
|
452
549
|
```
|
|
453
550
|
|
|
@@ -488,7 +585,7 @@ the on-chain ABI:
|
|
|
488
585
|
bun run codegen # reads sui-codegen.config.ts → src/contracts/
|
|
489
586
|
```
|
|
490
587
|
|
|
491
|
-
`sui-codegen.config.ts` lists
|
|
588
|
+
`sui-codegen.config.ts` lists `miso_record`, `miso_record_shop`, data
|
|
492
589
|
extensions, generic `royalty_pool`/`routed_stake`, and the `vault` plus all
|
|
493
590
|
vault-plugin packages. The protocol CORE (`miso` —
|
|
494
591
|
composition/recording/release/track) generates into
|
|
@@ -497,7 +594,7 @@ adding the core here to save an import is how the split this package exists to
|
|
|
497
594
|
enforce gets undone.
|
|
498
595
|
|
|
499
596
|
Paths resolve against sibling checkouts, so regenerating requires
|
|
500
|
-
`~/Documents/GitHub/misofm/{sdk,
|
|
597
|
+
`~/Documents/GitHub/misofm/{sdk, record, record-shop, vault, vault-plugins}` and
|
|
501
598
|
`~/Documents/GitHub/misonetwork/{protocol, protocol-extensions,
|
|
502
599
|
royalty-pool, routed-stake, share}`.
|
|
503
600
|
|