@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.
- package/README.md +44 -98
- package/dist/contracts.d.ts +0 -12
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js +3 -16
- package/dist/contracts.js.map +1 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/internal.d.ts +7 -3
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +22 -4
- package/dist/internal.js.map +1 -1
- package/dist/queries.d.ts +8 -0
- package/dist/queries.d.ts.map +1 -1
- package/dist/queries.js +30 -8
- package/dist/queries.js.map +1 -1
- package/package.json +1 -13
- package/src/contracts.ts +3 -19
- package/src/index.ts +3 -3
- package/src/internal.ts +34 -15
- package/src/queries.ts +40 -12
- package/dist/contracts/composition_credits/composition_credits.d.ts +0 -181
- package/dist/contracts/composition_credits/composition_credits.d.ts.map +0 -1
- package/dist/contracts/composition_credits/composition_credits.js +0 -109
- package/dist/contracts/composition_credits/composition_credits.js.map +0 -1
- package/dist/contracts/composition_credits/composition_party_role.d.ts +0 -119
- package/dist/contracts/composition_credits/composition_party_role.d.ts.map +0 -1
- package/dist/contracts/composition_credits/composition_party_role.js +0 -139
- package/dist/contracts/composition_credits/composition_party_role.js.map +0 -1
- package/dist/contracts/composition_credits/deps/miso_credit/credit.d.ts +0 -24
- package/dist/contracts/composition_credits/deps/miso_credit/credit.d.ts.map +0 -1
- package/dist/contracts/composition_credits/deps/miso_credit/credit.js +0 -23
- package/dist/contracts/composition_credits/deps/miso_credit/credit.js.map +0 -1
- package/dist/contracts/composition_credits/deps/sui/vec_map.d.ts +0 -37
- package/dist/contracts/composition_credits/deps/sui/vec_map.d.ts.map +0 -1
- package/dist/contracts/composition_credits/deps/sui/vec_map.js +0 -28
- package/dist/contracts/composition_credits/deps/sui/vec_map.js.map +0 -1
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.d.ts +0 -87
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.d.ts.map +0 -1
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.js +0 -80
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.js.map +0 -1
- package/dist/contracts/cover_art/cover_art.d.ts +0 -85
- package/dist/contracts/cover_art/cover_art.d.ts.map +0 -1
- package/dist/contracts/cover_art/cover_art.js +0 -68
- package/dist/contracts/cover_art/cover_art.js.map +0 -1
- package/dist/contracts/cover_art/deps/ori/walrus_data.d.ts +0 -52
- package/dist/contracts/cover_art/deps/ori/walrus_data.d.ts.map +0 -1
- package/dist/contracts/cover_art/deps/ori/walrus_data.js +0 -37
- package/dist/contracts/cover_art/deps/ori/walrus_data.js.map +0 -1
- package/dist/contracts/recording_credits/deps/miso_credit/credit.d.ts +0 -24
- package/dist/contracts/recording_credits/deps/miso_credit/credit.d.ts.map +0 -1
- package/dist/contracts/recording_credits/deps/miso_credit/credit.js +0 -23
- package/dist/contracts/recording_credits/deps/miso_credit/credit.js.map +0 -1
- package/dist/contracts/recording_credits/deps/sui/vec_map.d.ts +0 -37
- package/dist/contracts/recording_credits/deps/sui/vec_map.d.ts.map +0 -1
- package/dist/contracts/recording_credits/deps/sui/vec_map.js +0 -28
- package/dist/contracts/recording_credits/deps/sui/vec_map.js.map +0 -1
- package/dist/contracts/recording_credits/deps/sui/vec_set.d.ts +0 -21
- package/dist/contracts/recording_credits/deps/sui/vec_set.d.ts.map +0 -1
- package/dist/contracts/recording_credits/deps/sui/vec_set.js +0 -20
- package/dist/contracts/recording_credits/deps/sui/vec_set.js.map +0 -1
- package/dist/contracts/recording_credits/recording_credits.d.ts +0 -2313
- package/dist/contracts/recording_credits/recording_credits.d.ts.map +0 -1
- package/dist/contracts/recording_credits/recording_credits.js +0 -270
- package/dist/contracts/recording_credits/recording_credits.js.map +0 -1
- package/dist/contracts/recording_credits/recording_party_role.d.ts +0 -1174
- package/dist/contracts/recording_credits/recording_party_role.d.ts.map +0 -1
- package/dist/contracts/recording_credits/recording_party_role.js +0 -692
- package/dist/contracts/recording_credits/recording_party_role.js.map +0 -1
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.d.ts +0 -90
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.d.ts.map +0 -1
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.js +0 -80
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.js.map +0 -1
- package/dist/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.d.ts +0 -52
- package/dist/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.d.ts.map +0 -1
- package/dist/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.js +0 -37
- package/dist/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.js.map +0 -1
- package/dist/contracts/release_cover_art/deps/cover_art/cover_art.d.ts +0 -46
- package/dist/contracts/release_cover_art/deps/cover_art/cover_art.d.ts.map +0 -1
- package/dist/contracts/release_cover_art/deps/cover_art/cover_art.js +0 -21
- package/dist/contracts/release_cover_art/deps/cover_art/cover_art.js.map +0 -1
- package/dist/contracts/release_cover_art/deps/per_track/per_track.d.ts +0 -33
- package/dist/contracts/release_cover_art/deps/per_track/per_track.d.ts.map +0 -1
- package/dist/contracts/release_cover_art/deps/per_track/per_track.js +0 -32
- package/dist/contracts/release_cover_art/deps/per_track/per_track.js.map +0 -1
- package/dist/contracts/release_cover_art/release_cover_art.d.ts +0 -300
- package/dist/contracts/release_cover_art/release_cover_art.d.ts.map +0 -1
- package/dist/contracts/release_cover_art/release_cover_art.js +0 -168
- package/dist/contracts/release_cover_art/release_cover_art.js.map +0 -1
- package/dist/contracts/release_credits/deps/miso_credit/credit.d.ts +0 -24
- package/dist/contracts/release_credits/deps/miso_credit/credit.d.ts.map +0 -1
- package/dist/contracts/release_credits/deps/miso_credit/credit.js +0 -23
- package/dist/contracts/release_credits/deps/miso_credit/credit.js.map +0 -1
- package/dist/contracts/release_credits/deps/sui/vec_map.d.ts +0 -37
- package/dist/contracts/release_credits/deps/sui/vec_map.d.ts.map +0 -1
- package/dist/contracts/release_credits/deps/sui/vec_map.js +0 -28
- package/dist/contracts/release_credits/deps/sui/vec_map.js.map +0 -1
- package/dist/contracts/release_credits/release_credits.d.ts +0 -142
- package/dist/contracts/release_credits/release_credits.d.ts.map +0 -1
- package/dist/contracts/release_credits/release_credits.js +0 -108
- package/dist/contracts/release_credits/release_credits.js.map +0 -1
- package/dist/contracts/release_credits/release_party_role.d.ts +0 -58
- package/dist/contracts/release_credits/release_party_role.d.ts.map +0 -1
- package/dist/contracts/release_credits/release_party_role.js +0 -66
- package/dist/contracts/release_credits/release_party_role.js.map +0 -1
- package/dist/contracts/royalty_pool/deps/std/type_name.d.ts +0 -18
- package/dist/contracts/royalty_pool/deps/std/type_name.d.ts.map +0 -1
- package/dist/contracts/royalty_pool/deps/std/type_name.js +0 -20
- package/dist/contracts/royalty_pool/deps/std/type_name.js.map +0 -1
- package/dist/contracts/royalty_pool/deps/sui/balance.d.ts +0 -13
- package/dist/contracts/royalty_pool/deps/sui/balance.d.ts.map +0 -1
- package/dist/contracts/royalty_pool/deps/sui/balance.js +0 -15
- package/dist/contracts/royalty_pool/deps/sui/balance.js.map +0 -1
- package/dist/contracts/royalty_pool/deps/sui/vec_map.d.ts +0 -37
- package/dist/contracts/royalty_pool/deps/sui/vec_map.d.ts.map +0 -1
- package/dist/contracts/royalty_pool/deps/sui/vec_map.js +0 -28
- package/dist/contracts/royalty_pool/deps/sui/vec_map.js.map +0 -1
- package/dist/contracts/royalty_pool/pool.d.ts +0 -358
- package/dist/contracts/royalty_pool/pool.d.ts.map +0 -1
- package/dist/contracts/royalty_pool/pool.js +0 -352
- package/dist/contracts/royalty_pool/pool.js.map +0 -1
- package/dist/contracts/royalty_pool/stake.d.ts +0 -202
- package/dist/contracts/royalty_pool/stake.d.ts.map +0 -1
- package/dist/contracts/royalty_pool/stake.js +0 -197
- package/dist/contracts/royalty_pool/stake.js.map +0 -1
- package/dist/cover.d.ts +0 -48
- package/dist/cover.d.ts.map +0 -1
- package/dist/cover.js +0 -68
- package/dist/cover.js.map +0 -1
- package/dist/credits.d.ts +0 -171
- package/dist/credits.d.ts.map +0 -1
- package/dist/credits.js +0 -360
- package/dist/credits.js.map +0 -1
- package/dist/extensions/royalty-pool.d.ts +0 -32
- package/dist/extensions/royalty-pool.d.ts.map +0 -1
- package/dist/extensions/royalty-pool.js +0 -33
- package/dist/extensions/royalty-pool.js.map +0 -1
- package/src/contracts/composition_credits/composition_credits.ts +0 -169
- package/src/contracts/composition_credits/composition_party_role.ts +0 -189
- package/src/contracts/composition_credits/deps/miso_credit/credit.ts +0 -27
- package/src/contracts/composition_credits/deps/sui/vec_map.ts +0 -33
- package/src/contracts/composition_royalty_pool/composition_royalty_pool.ts +0 -135
- package/src/contracts/cover_art/cover_art.ts +0 -99
- package/src/contracts/cover_art/deps/ori/walrus_data.ts +0 -36
- package/src/contracts/recording_credits/deps/miso_credit/credit.ts +0 -27
- package/src/contracts/recording_credits/deps/sui/vec_map.ts +0 -33
- package/src/contracts/recording_credits/deps/sui/vec_set.ts +0 -21
- package/src/contracts/recording_credits/recording_credits.ts +0 -458
- package/src/contracts/recording_credits/recording_party_role.ts +0 -1041
- package/src/contracts/recording_royalty_pool/recording_royalty_pool.ts +0 -138
- package/src/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.ts +0 -36
- package/src/contracts/release_cover_art/deps/cover_art/cover_art.ts +0 -23
- package/src/contracts/release_cover_art/deps/per_track/per_track.ts +0 -36
- package/src/contracts/release_cover_art/release_cover_art.ts +0 -251
- package/src/contracts/release_credits/deps/miso_credit/credit.ts +0 -27
- package/src/contracts/release_credits/deps/sui/vec_map.ts +0 -33
- package/src/contracts/release_credits/release_credits.ts +0 -156
- package/src/contracts/release_credits/release_party_role.ts +0 -87
- package/src/contracts/royalty_pool/deps/std/type_name.ts +0 -22
- package/src/contracts/royalty_pool/deps/sui/balance.ts +0 -17
- package/src/contracts/royalty_pool/deps/sui/vec_map.ts +0 -33
- package/src/contracts/royalty_pool/pool.ts +0 -577
- package/src/contracts/royalty_pool/stake.ts +0 -317
- package/src/cover.ts +0 -136
- package/src/credits.ts +0 -645
- package/src/extensions/royalty-pool.ts +0 -85
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Miso Labs, Inc.
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
|
|
4
|
-
// First-party royalty-pool extension.
|
|
5
|
-
//
|
|
6
|
-
// A RoyaltyPool<Share, Currency> is an accumulator-based royalty-distribution pool
|
|
7
|
-
// bound to a composition or recording. It is created via the work's admin-gated
|
|
8
|
-
// `uid_mut(&AdminCap)` derived-object hook (`initialize_pool`), then shared
|
|
9
|
-
// (`pool::share`). Because `initialize_pool` borrows the work `&mut` (and the cap
|
|
10
|
-
// `&`) — not a shared on-chain input — it composes INSIDE the work's publish PTB:
|
|
11
|
-
// run it after `createComposition`/`createRecording` and before `finalize*` (which
|
|
12
|
-
// consumes the work into `share_object` and transfers the cap to the owner).
|
|
13
|
-
//
|
|
14
|
-
// Scope here is create + share only. Stake registration, funding (receive/redeem/
|
|
15
|
-
// deposit), and claiming are later owner/holder actions, not part of publishing.
|
|
16
|
-
|
|
17
|
-
import type { Transaction, TransactionObjectArgument } from "@mysten/sui/transactions";
|
|
18
|
-
import * as compositionRoyaltyPool from "../contracts/composition_royalty_pool/composition_royalty_pool.ts";
|
|
19
|
-
import * as recordingRoyaltyPool from "../contracts/recording_royalty_pool/recording_royalty_pool.ts";
|
|
20
|
-
import * as pool from "../contracts/royalty_pool/pool.ts";
|
|
21
|
-
|
|
22
|
-
export interface AttachCompositionRoyaltyPoolParams {
|
|
23
|
-
/** The Composition — an in-PTB `createComposition` result, borrowed `&mut`. */
|
|
24
|
-
composition: TransactionObjectArgument;
|
|
25
|
-
/** The CompositionAdminCap, borrowed `&`. */
|
|
26
|
-
adminCap: TransactionObjectArgument;
|
|
27
|
-
/** The composition's share type (the pool's `Share` phantom = CompositionShare). */
|
|
28
|
-
compositionShareType: string;
|
|
29
|
-
/** Fully-qualified coin type the pool accumulates (the `Currency` phantom). */
|
|
30
|
-
currency: string;
|
|
31
|
-
compositionRoyaltyPoolPackageId: string;
|
|
32
|
-
royaltyPoolPackageId: string;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/** Creates a royalty pool for a composition and shares it, appending to `tx`. */
|
|
36
|
-
export function attachCompositionRoyaltyPool(tx: Transaction, params: AttachCompositionRoyaltyPoolParams): void {
|
|
37
|
-
const created = tx.add(
|
|
38
|
-
compositionRoyaltyPool.initializePool({
|
|
39
|
-
package: params.compositionRoyaltyPoolPackageId,
|
|
40
|
-
typeArguments: [params.compositionShareType, params.currency],
|
|
41
|
-
arguments: [params.composition, params.adminCap],
|
|
42
|
-
}),
|
|
43
|
-
);
|
|
44
|
-
tx.add(
|
|
45
|
-
pool.share({
|
|
46
|
-
package: params.royaltyPoolPackageId,
|
|
47
|
-
typeArguments: [params.compositionShareType, params.currency],
|
|
48
|
-
arguments: [created],
|
|
49
|
-
}),
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export interface AttachRecordingRoyaltyPoolParams {
|
|
54
|
-
/** The Recording — an in-PTB `createRecording` result, borrowed `&mut`. */
|
|
55
|
-
recording: TransactionObjectArgument;
|
|
56
|
-
/** The RecordingAdminCap, borrowed `&`. */
|
|
57
|
-
adminCap: TransactionObjectArgument;
|
|
58
|
-
/** The recording's own share type (the pool's `Share` phantom = RecordingShare). */
|
|
59
|
-
recordingShareType: string;
|
|
60
|
-
/** The parent composition's share type (the recording's `CompositionShare` phantom). */
|
|
61
|
-
compositionShareType: string;
|
|
62
|
-
/** Fully-qualified coin type the pool accumulates (the `Currency` phantom). */
|
|
63
|
-
currency: string;
|
|
64
|
-
recordingRoyaltyPoolPackageId: string;
|
|
65
|
-
royaltyPoolPackageId: string;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/** Creates a royalty pool for a recording and shares it, appending to `tx`. */
|
|
69
|
-
export function attachRecordingRoyaltyPool(tx: Transaction, params: AttachRecordingRoyaltyPoolParams): void {
|
|
70
|
-
const created = tx.add(
|
|
71
|
-
recordingRoyaltyPool.initializePool({
|
|
72
|
-
package: params.recordingRoyaltyPoolPackageId,
|
|
73
|
-
typeArguments: [params.recordingShareType, params.compositionShareType, params.currency],
|
|
74
|
-
arguments: [params.recording, params.adminCap],
|
|
75
|
-
}),
|
|
76
|
-
);
|
|
77
|
-
// The pool is RoyaltyPool<RecordingShare, Currency> — Share is the recording's own share type.
|
|
78
|
-
tx.add(
|
|
79
|
-
pool.share({
|
|
80
|
-
package: params.royaltyPoolPackageId,
|
|
81
|
-
typeArguments: [params.recordingShareType, params.currency],
|
|
82
|
-
arguments: [created],
|
|
83
|
-
}),
|
|
84
|
-
);
|
|
85
|
-
}
|