@misofm/sdk 0.12.3 → 0.13.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 +49 -2
- package/dist/contracts/miso_pressing/certificate.d.ts +1 -1
- package/dist/contracts/miso_pressing/certificate.d.ts.map +1 -1
- package/dist/contracts/miso_pressing/certificate.js +1 -1
- package/dist/contracts/miso_pressing/certificate.js.map +1 -1
- package/dist/contracts/miso_pressing/listing.d.ts +5 -5
- package/dist/contracts/miso_pressing/listing.js +5 -5
- package/dist/contracts/miso_pressing/pressing.d.ts +10 -10
- package/dist/contracts/miso_pressing/pressing.js +7 -7
- package/dist/contracts/routed_stake/deps/royalty_pool/stake.d.ts +6 -0
- package/dist/contracts/routed_stake/deps/royalty_pool/stake.d.ts.map +1 -1
- package/dist/contracts/routed_stake/deps/royalty_pool/stake.js +6 -0
- package/dist/contracts/routed_stake/deps/royalty_pool/stake.js.map +1 -1
- package/dist/cover.d.ts +2 -2
- package/dist/cover.d.ts.map +1 -1
- package/dist/cover.js +5 -2
- package/dist/cover.js.map +1 -1
- package/dist/credits.d.ts +9 -9
- package/dist/credits.d.ts.map +1 -1
- package/dist/credits.js +8 -5
- package/dist/credits.js.map +1 -1
- package/dist/execute.d.ts +13 -1
- package/dist/execute.d.ts.map +1 -1
- package/dist/execute.js +8 -2
- package/dist/execute.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/pressing.d.ts +6 -6
- package/dist/pressing.js +4 -4
- package/dist/publication.d.ts +207 -0
- package/dist/publication.d.ts.map +1 -0
- package/dist/publication.js +666 -0
- package/dist/publication.js.map +1 -0
- package/dist/read/catalog.d.ts +3 -3
- package/dist/read/catalog.js +3 -3
- package/dist/read/receipts.d.ts +2 -2
- package/dist/read/receipts.js +2 -2
- package/dist/recording-extensions.d.ts +2 -2
- package/dist/recording-extensions.d.ts.map +1 -1
- package/dist/recording-extensions.js +8 -5
- package/dist/recording-extensions.js.map +1 -1
- package/dist/release-extensions.d.ts +2 -2
- package/dist/release-extensions.d.ts.map +1 -1
- package/dist/release-extensions.js +10 -7
- package/dist/release-extensions.js.map +1 -1
- package/dist/vault.d.ts +7 -1
- package/dist/vault.d.ts.map +1 -1
- package/dist/vault.js +8 -0
- package/dist/vault.js.map +1 -1
- package/package.json +6 -2
- package/src/contracts/miso_pressing/certificate.ts +1 -1
- package/src/contracts/miso_pressing/listing.ts +5 -5
- package/src/contracts/miso_pressing/pressing.ts +7 -7
- package/src/contracts/routed_stake/deps/royalty_pool/stake.ts +8 -2
- package/src/cover.ts +9 -4
- package/src/credits.ts +18 -14
- package/src/execute.ts +17 -4
- package/src/index.ts +1 -0
- package/src/pressing.ts +6 -6
- package/src/publication.ts +949 -0
- package/src/read/catalog.ts +3 -3
- package/src/read/receipts.ts +2 -2
- package/src/recording-extensions.ts +12 -8
- package/src/release-extensions.ts +14 -9
- package/src/vault.ts +20 -2
package/src/read/catalog.ts
CHANGED
|
@@ -456,8 +456,8 @@ export async function getPressingPreview(
|
|
|
456
456
|
|
|
457
457
|
/**
|
|
458
458
|
* Everything a currency-specific buy page renders. The Listing is derived from
|
|
459
|
-
* the release's Pressing and the requested currency, never found through
|
|
460
|
-
*
|
|
459
|
+
* the release's Pressing and the requested currency, never found through mutable
|
|
460
|
+
* lookup state.
|
|
461
461
|
*/
|
|
462
462
|
export async function getSaleDetail(
|
|
463
463
|
client: MisoClient,
|
|
@@ -481,7 +481,7 @@ export async function getSaleDetail(
|
|
|
481
481
|
* The records currently on sale.
|
|
482
482
|
*
|
|
483
483
|
* Configured by release + currency: Pressing and Listing ids are deterministic,
|
|
484
|
-
* permanent derived addresses. There is no
|
|
484
|
+
* permanent derived addresses. There is no mutable Pressing pointer or edition
|
|
485
485
|
* replacement in the current ABI.
|
|
486
486
|
*/
|
|
487
487
|
export async function getDiscoverShelf(
|
package/src/read/receipts.ts
CHANGED
|
@@ -325,8 +325,8 @@ export function breakdown(
|
|
|
325
325
|
|
|
326
326
|
/**
|
|
327
327
|
* The receipt for `txDigest`. The event identifies the exact immutable Pressing
|
|
328
|
-
* and Listing; callers cannot accidentally reinterpret a Pressing id as
|
|
329
|
-
*
|
|
328
|
+
* and Listing; callers cannot accidentally reinterpret a Pressing id as an
|
|
329
|
+
* obsolete sale-object id.
|
|
330
330
|
*
|
|
331
331
|
* The sale identifies the Pressing before its detail is fetched. `null` only when
|
|
332
332
|
* that immutable Pressing cannot be read; it is never superseded or destroyed.
|
|
@@ -3,21 +3,25 @@
|
|
|
3
3
|
|
|
4
4
|
/** Cap-authorized builders for data-only Recording metadata extensions. */
|
|
5
5
|
|
|
6
|
-
import type { TransactionArgument } from "@mysten/sui/transactions";
|
|
6
|
+
import type { Transaction, TransactionArgument, TransactionObjectArgument } from "@mysten/sui/transactions";
|
|
7
7
|
import type { TxThunk } from "./transactions.ts";
|
|
8
|
-
import { invokeWithAdminCap, type AdminCapAuthority } from "./vault.ts";
|
|
8
|
+
import { invokeWithAdminCap, type AdminCapAuthority, type ObjectInput } from "./vault.ts";
|
|
9
9
|
import * as advisory from "./contracts/recording_advisory/recording_advisory.ts";
|
|
10
10
|
import * as language from "./contracts/recording_language/recording_language.ts";
|
|
11
11
|
import * as masterReference from "./contracts/recording_master_reference/recording_master_reference.ts";
|
|
12
12
|
import * as preview from "./contracts/recording_preview/recording_preview.ts";
|
|
13
13
|
|
|
14
14
|
export interface RecordingExtensionTarget {
|
|
15
|
-
readonly recordingId:
|
|
15
|
+
readonly recordingId: ObjectInput;
|
|
16
16
|
readonly authority: AdminCapAuthority;
|
|
17
17
|
readonly recordingShareType: string;
|
|
18
18
|
readonly compositionShareType: string;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
function object(tx: Transaction, value: ObjectInput): TransactionObjectArgument {
|
|
22
|
+
return typeof value === "string" ? tx.object(value) : value;
|
|
23
|
+
}
|
|
24
|
+
|
|
21
25
|
type Rating = "Explicit" | "NotExplicit" | "Cleaned";
|
|
22
26
|
export interface SetRecordingAdvisoryParams extends RecordingExtensionTarget {
|
|
23
27
|
readonly recordingAdvisoryPackageId: string;
|
|
@@ -34,7 +38,7 @@ export function setRecordingAdvisory(p: SetRecordingAdvisoryParams): TxThunk {
|
|
|
34
38
|
invokeWithAdminCap(tx, p.authority, {
|
|
35
39
|
target: `${p.recordingAdvisoryPackageId}::recording_advisory::set_rating`,
|
|
36
40
|
typeArguments: [p.recordingShareType, p.compositionShareType],
|
|
37
|
-
arguments: [
|
|
41
|
+
arguments: [object(tx, p.recordingId), rating],
|
|
38
42
|
adminCapIndex: 1,
|
|
39
43
|
});
|
|
40
44
|
};
|
|
@@ -51,7 +55,7 @@ export function setRecordingLanguages(p: SetRecordingLanguagesParams): TxThunk {
|
|
|
51
55
|
invokeWithAdminCap(tx, p.authority, {
|
|
52
56
|
target: `${p.recordingLanguagePackageId}::recording_language::set_languages`,
|
|
53
57
|
typeArguments: [p.recordingShareType, p.compositionShareType],
|
|
54
|
-
arguments: [
|
|
58
|
+
arguments: [object(tx, p.recordingId), p.languages],
|
|
55
59
|
adminCapIndex: 1,
|
|
56
60
|
});
|
|
57
61
|
};
|
|
@@ -62,7 +66,7 @@ export function setRecordingInstrumental(p: Omit<SetRecordingLanguagesParams, "l
|
|
|
62
66
|
invokeWithAdminCap(tx, p.authority, {
|
|
63
67
|
target: `${p.recordingLanguagePackageId}::recording_language::set_instrumental`,
|
|
64
68
|
typeArguments: [p.recordingShareType, p.compositionShareType],
|
|
65
|
-
arguments: [
|
|
69
|
+
arguments: [object(tx, p.recordingId)],
|
|
66
70
|
adminCapIndex: 1,
|
|
67
71
|
});
|
|
68
72
|
};
|
|
@@ -81,7 +85,7 @@ export function setRecordingMasterReference(p: SetRecordingMasterReferenceParams
|
|
|
81
85
|
invokeWithAdminCap(tx, p.authority, {
|
|
82
86
|
target: `${p.recordingMasterReferencePackageId}::recording_master_reference::set_master_reference`,
|
|
83
87
|
typeArguments: [p.recordingShareType, p.compositionShareType],
|
|
84
|
-
arguments: [
|
|
88
|
+
arguments: [object(tx, p.recordingId), p.reference],
|
|
85
89
|
adminCapIndex: 1,
|
|
86
90
|
});
|
|
87
91
|
};
|
|
@@ -95,7 +99,7 @@ export function setRecordingPreview(p: SetRecordingPreviewParams): TxThunk {
|
|
|
95
99
|
invokeWithAdminCap(tx, p.authority, {
|
|
96
100
|
target: `${p.recordingPreviewPackageId}::recording_preview::set_preview`,
|
|
97
101
|
typeArguments: [p.recordingShareType, p.compositionShareType],
|
|
98
|
-
arguments: [
|
|
102
|
+
arguments: [object(tx, p.recordingId), p.reference],
|
|
99
103
|
adminCapIndex: 1,
|
|
100
104
|
});
|
|
101
105
|
};
|
|
@@ -9,6 +9,7 @@ import { deriveObjectID } from "@mysten/sui/utils";
|
|
|
9
9
|
import type {
|
|
10
10
|
Transaction,
|
|
11
11
|
TransactionArgument,
|
|
12
|
+
TransactionObjectArgument,
|
|
12
13
|
} from "@mysten/sui/transactions";
|
|
13
14
|
import type { TxThunk } from "./transactions.ts";
|
|
14
15
|
import * as genre from "./contracts/genre/genre.ts";
|
|
@@ -16,13 +17,17 @@ import * as releaseDescription from "./contracts/release_description/release_des
|
|
|
16
17
|
import * as releaseDspLink from "./contracts/release_dsp_link/release_dsp_link.ts";
|
|
17
18
|
import * as releaseGenre from "./contracts/release_genre/release_genre.ts";
|
|
18
19
|
import * as releaseKind from "./contracts/release_kind/release_kind.ts";
|
|
19
|
-
import { asU64, directAdminCap, invokeWithAdminCap, type AdminCapAuthority, type U64Input } from "./vault.ts";
|
|
20
|
+
import { asU64, directAdminCap, invokeWithAdminCap, type AdminCapAuthority, type ObjectInput, type U64Input } from "./vault.ts";
|
|
21
|
+
|
|
22
|
+
function object(tx: Transaction, value: ObjectInput): TransactionObjectArgument {
|
|
23
|
+
return typeof value === "string" ? tx.object(value) : value;
|
|
24
|
+
}
|
|
20
25
|
|
|
21
26
|
type ReleaseAuthorityInput =
|
|
22
27
|
| { readonly authority: AdminCapAuthority; readonly releaseAdminCapId?: never }
|
|
23
28
|
| { readonly authority?: never; readonly releaseAdminCapId: string };
|
|
24
29
|
interface ReleaseExtensionTargetBase {
|
|
25
|
-
releaseId:
|
|
30
|
+
releaseId: ObjectInput;
|
|
26
31
|
}
|
|
27
32
|
export type ReleaseExtensionTarget = ReleaseExtensionTargetBase & ReleaseAuthorityInput;
|
|
28
33
|
function authority(p: ReleaseExtensionTarget): AdminCapAuthority {
|
|
@@ -48,7 +53,7 @@ export function setReleaseKind(p: SetReleaseKindParams): TxThunk {
|
|
|
48
53
|
return (tx) => {
|
|
49
54
|
invokeWithAdminCap(tx, authority(p), {
|
|
50
55
|
target: `${p.releaseKindPackageId}::release_kind::set_kind`,
|
|
51
|
-
arguments: [
|
|
56
|
+
arguments: [object(tx, p.releaseId), tx.pure.string(p.kind)],
|
|
52
57
|
adminCapIndex: 1,
|
|
53
58
|
});
|
|
54
59
|
};
|
|
@@ -73,7 +78,7 @@ export function setReleaseDescription(p: SetReleaseDescriptionParams): TxThunk {
|
|
|
73
78
|
return (tx) => {
|
|
74
79
|
invokeWithAdminCap(tx, authority(p), {
|
|
75
80
|
target: `${p.releaseDescriptionPackageId}::release_description::set_description`,
|
|
76
|
-
arguments: [
|
|
81
|
+
arguments: [object(tx, p.releaseId), tx.pure.string(p.description)],
|
|
77
82
|
adminCapIndex: 1,
|
|
78
83
|
});
|
|
79
84
|
};
|
|
@@ -124,13 +129,13 @@ export function setReleaseGenres(p: SetReleaseGenresParams): TxThunk {
|
|
|
124
129
|
return (tx) => {
|
|
125
130
|
invokeWithAdminCap(tx, authority(p), {
|
|
126
131
|
target: `${p.releaseGenrePackageId}::release_genre::set_primary_genre`,
|
|
127
|
-
arguments: [
|
|
132
|
+
arguments: [object(tx, p.releaseId), tx.object(p.primaryGenreId)],
|
|
128
133
|
adminCapIndex: 1,
|
|
129
134
|
});
|
|
130
135
|
for (const genreId of p.secondaryGenreIds ?? []) {
|
|
131
136
|
invokeWithAdminCap(tx, authority(p), {
|
|
132
137
|
target: `${p.releaseGenrePackageId}::release_genre::add_secondary_genre`,
|
|
133
|
-
arguments: [
|
|
138
|
+
arguments: [object(tx, p.releaseId), tx.object(genreId)],
|
|
134
139
|
adminCapIndex: 1,
|
|
135
140
|
});
|
|
136
141
|
}
|
|
@@ -138,7 +143,7 @@ export function setReleaseGenres(p: SetReleaseGenresParams): TxThunk {
|
|
|
138
143
|
invokeWithAdminCap(tx, authority(p), {
|
|
139
144
|
target: `${p.releaseGenrePackageId}::release_genre::set_track_primary_genre`,
|
|
140
145
|
arguments: [
|
|
141
|
-
|
|
146
|
+
object(tx, p.releaseId),
|
|
142
147
|
tx.pure.u64(asU64("trackIndex", assignment.trackIndex)),
|
|
143
148
|
tx.object(assignment.genreId),
|
|
144
149
|
],
|
|
@@ -247,7 +252,7 @@ export function setReleaseDspLinks(p: SetReleaseDspLinksParams): TxThunk {
|
|
|
247
252
|
const value = buildDspLink(tx, p.releaseDspLinkPackageId, link);
|
|
248
253
|
invokeWithAdminCap(tx, authority(p), {
|
|
249
254
|
target: `${p.releaseDspLinkPackageId}::release_dsp_link::set_release_link`,
|
|
250
|
-
arguments: [
|
|
255
|
+
arguments: [object(tx, p.releaseId), value],
|
|
251
256
|
adminCapIndex: 1,
|
|
252
257
|
});
|
|
253
258
|
}
|
|
@@ -255,7 +260,7 @@ export function setReleaseDspLinks(p: SetReleaseDspLinksParams): TxThunk {
|
|
|
255
260
|
const value = buildDspLink(tx, p.releaseDspLinkPackageId, item.link);
|
|
256
261
|
invokeWithAdminCap(tx, authority(p), {
|
|
257
262
|
target: `${p.releaseDspLinkPackageId}::release_dsp_link::set_track_link`,
|
|
258
|
-
arguments: [
|
|
263
|
+
arguments: [object(tx, p.releaseId), tx.pure.u64(asU64("trackIndex", item.trackIndex)), value],
|
|
259
264
|
adminCapIndex: 1,
|
|
260
265
|
});
|
|
261
266
|
}
|
package/src/vault.ts
CHANGED
|
@@ -21,6 +21,7 @@ import { normalizeStructTag } from "@mysten/sui/utils";
|
|
|
21
21
|
import * as vault from "./contracts/vault/vault.ts";
|
|
22
22
|
import * as compositionRoyaltyPool from "./contracts/composition_royalty_pool/composition_royalty_pool.ts";
|
|
23
23
|
import * as recordingRoyaltyPool from "./contracts/recording_royalty_pool/recording_royalty_pool.ts";
|
|
24
|
+
import * as partyWallet from "./contracts/party_wallet/party_wallet.ts";
|
|
24
25
|
import * as compositionRoutedStake from "./contracts/composition_routed_stake/composition_routed_stake.ts";
|
|
25
26
|
import * as releaseRevenueDistributor from "./contracts/release_revenue_distributor/release_revenue_distributor.ts";
|
|
26
27
|
import * as routedStake from "./contracts/routed_stake/routed_stake.ts";
|
|
@@ -150,8 +151,8 @@ export interface CustodyNewAdminCapParams {
|
|
|
150
151
|
readonly owner: string | TransactionArgument;
|
|
151
152
|
/** Optional installation/configuration while the new Vault is still owned. */
|
|
152
153
|
readonly configure?: (
|
|
153
|
-
vaultObject:
|
|
154
|
-
vaultAdminCapObject:
|
|
154
|
+
vaultObject: TransactionObjectArgument,
|
|
155
|
+
vaultAdminCapObject: TransactionObjectArgument,
|
|
155
156
|
) => void;
|
|
156
157
|
}
|
|
157
158
|
|
|
@@ -360,6 +361,23 @@ export function installRecordingRoyaltyPoolPlugin(
|
|
|
360
361
|
);
|
|
361
362
|
}
|
|
362
363
|
|
|
364
|
+
/** Install the Party wallet plugin; its canonical witness stays internal. */
|
|
365
|
+
export function installPartyWalletPlugin(
|
|
366
|
+
tx: Transaction,
|
|
367
|
+
params: {
|
|
368
|
+
readonly vault: TransactionObjectArgument;
|
|
369
|
+
readonly vaultAdminCap: TransactionObjectArgument;
|
|
370
|
+
readonly pluginPackageId: string;
|
|
371
|
+
},
|
|
372
|
+
): void {
|
|
373
|
+
tx.add(
|
|
374
|
+
partyWallet.install({
|
|
375
|
+
package: params.pluginPackageId,
|
|
376
|
+
arguments: [params.vault, params.vaultAdminCap],
|
|
377
|
+
}),
|
|
378
|
+
);
|
|
379
|
+
}
|
|
380
|
+
|
|
363
381
|
export function uninstallRecordingRoyaltyPoolPlugin(
|
|
364
382
|
tx: Transaction,
|
|
365
383
|
params: RecordingRoyaltyPoolPluginParams,
|