@misonetwork/sdk 0.7.0 → 0.8.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 +181 -139
- package/dist/client.d.ts +1225 -8
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +43 -19
- package/dist/client.js.map +1 -1
- package/dist/contracts/composition_credits/composition_credits.d.ts +181 -0
- package/dist/contracts/composition_credits/composition_credits.d.ts.map +1 -0
- package/dist/contracts/composition_credits/composition_credits.js +109 -0
- package/dist/contracts/composition_credits/composition_credits.js.map +1 -0
- package/dist/contracts/composition_credits/composition_party_role.d.ts +119 -0
- package/dist/contracts/composition_credits/composition_party_role.d.ts.map +1 -0
- package/dist/contracts/composition_credits/composition_party_role.js +139 -0
- package/dist/contracts/composition_credits/composition_party_role.js.map +1 -0
- package/dist/contracts/composition_credits/deps/miso_credit/credit.d.ts +24 -0
- package/dist/contracts/composition_credits/deps/miso_credit/credit.d.ts.map +1 -0
- package/dist/contracts/composition_credits/deps/miso_credit/credit.js +23 -0
- package/dist/contracts/composition_credits/deps/miso_credit/credit.js.map +1 -0
- package/dist/contracts/composition_credits/deps/sui/vec_map.d.ts +37 -0
- package/dist/contracts/composition_credits/deps/sui/vec_map.d.ts.map +1 -0
- package/dist/contracts/composition_credits/deps/sui/vec_map.js +28 -0
- package/dist/contracts/composition_credits/deps/sui/vec_map.js.map +1 -0
- package/dist/contracts/miso/composition.d.ts +1 -1
- package/dist/contracts/miso/composition.js +2 -2
- package/dist/contracts/miso/deps/bps/bps.d.ts +1 -1
- package/dist/contracts/miso/deps/bps/bps.js +1 -1
- package/dist/contracts/miso/recording.d.ts +1 -1
- package/dist/contracts/miso/recording.js +1 -1
- package/dist/contracts/miso/release.d.ts +61 -37
- package/dist/contracts/miso/release.d.ts.map +1 -1
- package/dist/contracts/miso/release.js +65 -38
- package/dist/contracts/miso/release.js.map +1 -1
- package/dist/contracts/miso/track.d.ts +2 -2
- package/dist/contracts/miso/track.js +2 -2
- package/dist/contracts/recording_advisory/recording_advisory.d.ts +194 -0
- package/dist/contracts/recording_advisory/recording_advisory.d.ts.map +1 -0
- package/dist/contracts/recording_advisory/recording_advisory.js +204 -0
- package/dist/contracts/recording_advisory/recording_advisory.js.map +1 -0
- package/dist/contracts/recording_credits/deps/miso_credit/credit.d.ts +24 -0
- package/dist/contracts/recording_credits/deps/miso_credit/credit.d.ts.map +1 -0
- package/dist/contracts/recording_credits/deps/miso_credit/credit.js +23 -0
- package/dist/contracts/recording_credits/deps/miso_credit/credit.js.map +1 -0
- package/dist/contracts/recording_credits/deps/sui/vec_map.d.ts +37 -0
- package/dist/contracts/recording_credits/deps/sui/vec_map.d.ts.map +1 -0
- package/dist/contracts/recording_credits/deps/sui/vec_map.js +28 -0
- package/dist/contracts/recording_credits/deps/sui/vec_map.js.map +1 -0
- package/dist/contracts/recording_credits/deps/sui/vec_set.d.ts +21 -0
- package/dist/contracts/recording_credits/deps/sui/vec_set.d.ts.map +1 -0
- package/dist/contracts/recording_credits/deps/sui/vec_set.js +20 -0
- package/dist/contracts/recording_credits/deps/sui/vec_set.js.map +1 -0
- package/dist/contracts/recording_credits/recording_credits.d.ts +2313 -0
- package/dist/contracts/recording_credits/recording_credits.d.ts.map +1 -0
- package/dist/contracts/recording_credits/recording_credits.js +270 -0
- package/dist/contracts/recording_credits/recording_credits.js.map +1 -0
- package/dist/contracts/recording_credits/recording_party_role.d.ts +1174 -0
- package/dist/contracts/recording_credits/recording_party_role.d.ts.map +1 -0
- package/dist/contracts/recording_credits/recording_party_role.js +692 -0
- package/dist/contracts/recording_credits/recording_party_role.js.map +1 -0
- package/dist/contracts/recording_language/deps/language_code/language_code.d.ts +6 -0
- package/dist/contracts/recording_language/deps/language_code/language_code.d.ts.map +1 -0
- package/dist/contracts/recording_language/deps/language_code/language_code.js +8 -0
- package/dist/contracts/recording_language/deps/language_code/language_code.js.map +1 -0
- package/dist/contracts/recording_language/recording_language.d.ts +152 -0
- package/dist/contracts/recording_language/recording_language.d.ts.map +1 -0
- package/dist/contracts/recording_language/recording_language.js +149 -0
- package/dist/contracts/recording_language/recording_language.js.map +1 -0
- package/dist/contracts/recording_master_reference/deps/ori/walrus_data.d.ts +52 -0
- package/dist/contracts/recording_master_reference/deps/ori/walrus_data.d.ts.map +1 -0
- package/dist/contracts/recording_master_reference/deps/ori/walrus_data.js +37 -0
- package/dist/contracts/recording_master_reference/deps/ori/walrus_data.js.map +1 -0
- package/dist/contracts/recording_master_reference/recording_master_reference.d.ts +131 -0
- package/dist/contracts/recording_master_reference/recording_master_reference.d.ts.map +1 -0
- package/dist/contracts/recording_master_reference/recording_master_reference.js +121 -0
- package/dist/contracts/recording_master_reference/recording_master_reference.js.map +1 -0
- package/dist/contracts/recording_preview/deps/ori/walrus_data.d.ts +52 -0
- package/dist/contracts/recording_preview/deps/ori/walrus_data.d.ts.map +1 -0
- package/dist/contracts/recording_preview/deps/ori/walrus_data.js +37 -0
- package/dist/contracts/recording_preview/deps/ori/walrus_data.js.map +1 -0
- package/dist/contracts/recording_preview/recording_preview.d.ts +104 -0
- package/dist/contracts/recording_preview/recording_preview.d.ts.map +1 -0
- package/dist/contracts/recording_preview/recording_preview.js +94 -0
- package/dist/contracts/recording_preview/recording_preview.js.map +1 -0
- package/dist/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.d.ts +52 -0
- package/dist/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.d.ts.map +1 -0
- package/dist/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.js +37 -0
- package/dist/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.js.map +1 -0
- package/dist/contracts/release_cover_art/deps/cover_art/cover_art.d.ts +46 -0
- package/dist/contracts/release_cover_art/deps/cover_art/cover_art.d.ts.map +1 -0
- package/dist/contracts/release_cover_art/deps/cover_art/cover_art.js +21 -0
- package/dist/contracts/release_cover_art/deps/cover_art/cover_art.js.map +1 -0
- package/dist/contracts/release_cover_art/deps/per_track/per_track.d.ts +33 -0
- package/dist/contracts/release_cover_art/deps/per_track/per_track.d.ts.map +1 -0
- package/dist/contracts/release_cover_art/deps/per_track/per_track.js +32 -0
- package/dist/contracts/release_cover_art/deps/per_track/per_track.js.map +1 -0
- package/dist/contracts/release_cover_art/release_cover_art.d.ts +300 -0
- package/dist/contracts/release_cover_art/release_cover_art.d.ts.map +1 -0
- package/dist/contracts/release_cover_art/release_cover_art.js +168 -0
- package/dist/contracts/release_cover_art/release_cover_art.js.map +1 -0
- package/dist/contracts/release_credits/deps/miso_credit/credit.d.ts +24 -0
- package/dist/contracts/release_credits/deps/miso_credit/credit.d.ts.map +1 -0
- package/dist/contracts/release_credits/deps/miso_credit/credit.js +23 -0
- package/dist/contracts/release_credits/deps/miso_credit/credit.js.map +1 -0
- package/dist/contracts/release_credits/deps/sui/vec_map.d.ts +37 -0
- package/dist/contracts/release_credits/deps/sui/vec_map.d.ts.map +1 -0
- package/dist/contracts/release_credits/deps/sui/vec_map.js +28 -0
- package/dist/contracts/release_credits/deps/sui/vec_map.js.map +1 -0
- package/dist/contracts/release_credits/release_credits.d.ts +142 -0
- package/dist/contracts/release_credits/release_credits.d.ts.map +1 -0
- package/dist/contracts/release_credits/release_credits.js +108 -0
- package/dist/contracts/release_credits/release_credits.js.map +1 -0
- package/dist/contracts/release_credits/release_party_role.d.ts +58 -0
- package/dist/contracts/release_credits/release_party_role.d.ts.map +1 -0
- package/dist/contracts/release_credits/release_party_role.js +66 -0
- package/dist/contracts/release_credits/release_party_role.js.map +1 -0
- package/dist/contracts/release_description/release_description.d.ts +112 -0
- package/dist/contracts/release_description/release_description.d.ts.map +1 -0
- package/dist/contracts/release_description/release_description.js +123 -0
- package/dist/contracts/release_description/release_description.js.map +1 -0
- package/dist/contracts/release_dsp_link/release_dsp_link.d.ts +644 -0
- package/dist/contracts/release_dsp_link/release_dsp_link.d.ts.map +1 -0
- package/dist/contracts/release_dsp_link/release_dsp_link.js +556 -0
- package/dist/contracts/release_dsp_link/release_dsp_link.js.map +1 -0
- package/dist/contracts/release_genre/deps/per_track/per_track.d.ts +33 -0
- package/dist/contracts/release_genre/deps/per_track/per_track.d.ts.map +1 -0
- package/dist/contracts/release_genre/deps/per_track/per_track.js +32 -0
- package/dist/contracts/release_genre/deps/per_track/per_track.js.map +1 -0
- package/dist/contracts/release_genre/release_genre.d.ts +193 -0
- package/dist/contracts/release_genre/release_genre.d.ts.map +1 -0
- package/dist/contracts/release_genre/release_genre.js +207 -0
- package/dist/contracts/release_genre/release_genre.js.map +1 -0
- package/dist/contracts/release_kind/release_kind.d.ts +98 -0
- package/dist/contracts/release_kind/release_kind.d.ts.map +1 -0
- package/dist/contracts/release_kind/release_kind.js +109 -0
- package/dist/contracts/release_kind/release_kind.js.map +1 -0
- package/dist/contracts/release_snapshot_bundle/deps/ori/walrus_data.d.ts +52 -0
- package/dist/contracts/release_snapshot_bundle/deps/ori/walrus_data.d.ts.map +1 -0
- package/dist/contracts/release_snapshot_bundle/deps/ori/walrus_data.js +37 -0
- package/dist/contracts/release_snapshot_bundle/deps/ori/walrus_data.js.map +1 -0
- package/dist/contracts/release_snapshot_bundle/release_snapshot_bundle.d.ts +91 -0
- package/dist/contracts/release_snapshot_bundle/release_snapshot_bundle.d.ts.map +1 -0
- package/dist/contracts/release_snapshot_bundle/release_snapshot_bundle.js +91 -0
- package/dist/contracts/release_snapshot_bundle/release_snapshot_bundle.js.map +1 -0
- package/dist/contracts/routed_stake/deps/royalty_pool/stake.d.ts +54 -0
- package/dist/contracts/routed_stake/deps/royalty_pool/stake.d.ts.map +1 -0
- package/dist/contracts/routed_stake/deps/royalty_pool/stake.js +37 -0
- package/dist/contracts/routed_stake/deps/royalty_pool/stake.js.map +1 -0
- package/dist/contracts/routed_stake/deps/std/type_name.d.ts +18 -0
- package/dist/contracts/routed_stake/deps/std/type_name.d.ts.map +1 -0
- package/dist/contracts/routed_stake/deps/std/type_name.js +20 -0
- package/dist/contracts/routed_stake/deps/std/type_name.js.map +1 -0
- package/dist/contracts/routed_stake/deps/sui/balance.d.ts +13 -0
- package/dist/contracts/routed_stake/deps/sui/balance.d.ts.map +1 -0
- package/dist/contracts/routed_stake/deps/sui/balance.js +15 -0
- package/dist/contracts/routed_stake/deps/sui/balance.js.map +1 -0
- package/dist/contracts/routed_stake/deps/sui/vec_map.d.ts +37 -0
- package/dist/contracts/routed_stake/deps/sui/vec_map.d.ts.map +1 -0
- package/dist/contracts/routed_stake/deps/sui/vec_map.js +28 -0
- package/dist/contracts/routed_stake/deps/sui/vec_map.js.map +1 -0
- package/dist/contracts/routed_stake/routed_stake.d.ts +356 -0
- package/dist/contracts/routed_stake/routed_stake.d.ts.map +1 -0
- package/dist/contracts/routed_stake/routed_stake.js +311 -0
- package/dist/contracts/routed_stake/routed_stake.js.map +1 -0
- package/dist/contracts/royalty_pool/deps/std/type_name.d.ts +18 -0
- package/dist/contracts/royalty_pool/deps/std/type_name.d.ts.map +1 -0
- package/dist/contracts/royalty_pool/deps/std/type_name.js +20 -0
- package/dist/contracts/royalty_pool/deps/std/type_name.js.map +1 -0
- package/dist/contracts/royalty_pool/deps/sui/balance.d.ts +13 -0
- package/dist/contracts/royalty_pool/deps/sui/balance.d.ts.map +1 -0
- package/dist/contracts/royalty_pool/deps/sui/balance.js +15 -0
- package/dist/contracts/royalty_pool/deps/sui/balance.js.map +1 -0
- package/dist/contracts/royalty_pool/deps/sui/vec_map.d.ts +37 -0
- package/dist/contracts/royalty_pool/deps/sui/vec_map.d.ts.map +1 -0
- package/dist/contracts/royalty_pool/deps/sui/vec_map.js +28 -0
- package/dist/contracts/royalty_pool/deps/sui/vec_map.js.map +1 -0
- package/dist/contracts/royalty_pool/pool.d.ts +394 -0
- package/dist/contracts/royalty_pool/pool.d.ts.map +1 -0
- package/dist/contracts/royalty_pool/pool.js +387 -0
- package/dist/contracts/royalty_pool/pool.js.map +1 -0
- package/dist/contracts/royalty_pool/stake.d.ts +202 -0
- package/dist/contracts/royalty_pool/stake.d.ts.map +1 -0
- package/dist/contracts/royalty_pool/stake.js +197 -0
- package/dist/contracts/royalty_pool/stake.js.map +1 -0
- package/dist/contracts.d.ts +37 -3
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js +42 -8
- package/dist/contracts.js.map +1 -1
- package/dist/deployments.d.ts +46 -12
- package/dist/deployments.d.ts.map +1 -1
- package/dist/deployments.js +119 -11
- package/dist/deployments.js.map +1 -1
- package/dist/events.d.ts +1081 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +124 -0
- package/dist/events.js.map +1 -0
- package/dist/execute.d.ts.map +1 -1
- package/dist/execute.js +0 -4
- package/dist/execute.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js.map +1 -1
- package/dist/numeric.d.ts +5 -0
- package/dist/numeric.d.ts.map +1 -0
- package/dist/numeric.js +21 -0
- package/dist/numeric.js.map +1 -0
- package/dist/packages.d.ts +159 -0
- package/dist/packages.d.ts.map +1 -0
- package/dist/packages.js +179 -0
- package/dist/packages.js.map +1 -0
- package/dist/parsers.d.ts +5 -1
- package/dist/parsers.d.ts.map +1 -1
- package/dist/parsers.js +18 -2
- package/dist/parsers.js.map +1 -1
- package/dist/queries.d.ts +92 -0
- package/dist/queries.d.ts.map +1 -1
- package/dist/queries.js +132 -23
- package/dist/queries.js.map +1 -1
- package/dist/transactions.d.ts +96 -3
- package/dist/transactions.d.ts.map +1 -1
- package/dist/transactions.js +123 -11
- package/dist/transactions.js.map +1 -1
- package/dist/types.d.ts +18 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/view.d.ts +6 -5
- package/dist/view.d.ts.map +1 -1
- package/dist/view.js +8 -2
- package/dist/view.js.map +1 -1
- package/package.json +14 -4
- package/src/client.ts +57 -23
- package/src/contracts/composition_credits/composition_credits.ts +169 -0
- package/src/contracts/composition_credits/composition_party_role.ts +189 -0
- package/src/contracts/composition_credits/deps/miso_credit/credit.ts +27 -0
- package/src/contracts/composition_credits/deps/sui/vec_map.ts +33 -0
- package/src/contracts/miso/composition.ts +8 -8
- package/src/contracts/miso/deps/bps/bps.ts +3 -3
- package/src/contracts/miso/recording.ts +10 -10
- package/src/contracts/miso/release.ts +103 -67
- package/src/contracts/miso/track.ts +5 -5
- package/src/contracts/recording_advisory/recording_advisory.ts +315 -0
- package/src/contracts/recording_credits/deps/miso_credit/credit.ts +27 -0
- package/src/contracts/recording_credits/deps/sui/vec_map.ts +33 -0
- package/src/contracts/recording_credits/deps/sui/vec_set.ts +21 -0
- package/src/contracts/recording_credits/recording_credits.ts +458 -0
- package/src/contracts/recording_credits/recording_party_role.ts +1041 -0
- package/src/contracts/recording_language/deps/language_code/language_code.ts +7 -0
- package/src/contracts/recording_language/recording_language.ts +237 -0
- package/src/contracts/recording_master_reference/deps/ori/walrus_data.ts +36 -0
- package/src/contracts/recording_master_reference/recording_master_reference.ts +181 -0
- package/src/contracts/recording_preview/deps/ori/walrus_data.ts +36 -0
- package/src/contracts/recording_preview/recording_preview.ts +154 -0
- package/src/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.ts +36 -0
- package/src/contracts/release_cover_art/deps/cover_art/cover_art.ts +23 -0
- package/src/contracts/release_cover_art/deps/per_track/per_track.ts +36 -0
- package/src/contracts/release_cover_art/release_cover_art.ts +251 -0
- package/src/contracts/release_credits/deps/miso_credit/credit.ts +27 -0
- package/src/contracts/release_credits/deps/sui/vec_map.ts +33 -0
- package/src/contracts/release_credits/release_credits.ts +156 -0
- package/src/contracts/release_credits/release_party_role.ts +87 -0
- package/src/contracts/release_description/release_description.ts +167 -0
- package/src/contracts/release_dsp_link/release_dsp_link.ts +813 -0
- package/src/contracts/release_genre/deps/per_track/per_track.ts +36 -0
- package/src/contracts/release_genre/release_genre.ts +314 -0
- package/src/contracts/release_kind/release_kind.ts +153 -0
- package/src/contracts/release_snapshot_bundle/deps/ori/walrus_data.ts +36 -0
- package/src/contracts/release_snapshot_bundle/release_snapshot_bundle.ts +124 -0
- package/src/contracts/routed_stake/deps/royalty_pool/stake.ts +39 -0
- package/src/contracts/routed_stake/deps/std/type_name.ts +22 -0
- package/src/contracts/routed_stake/deps/sui/balance.ts +17 -0
- package/src/contracts/routed_stake/deps/sui/vec_map.ts +33 -0
- package/src/contracts/routed_stake/routed_stake.ts +508 -0
- package/src/contracts/royalty_pool/deps/std/type_name.ts +22 -0
- package/src/contracts/royalty_pool/deps/sui/balance.ts +17 -0
- package/src/contracts/royalty_pool/deps/sui/vec_map.ts +33 -0
- package/src/contracts/royalty_pool/pool.ts +613 -0
- package/src/contracts/royalty_pool/stake.ts +317 -0
- package/src/contracts.ts +59 -6
- package/src/deployments.ts +160 -22
- package/src/events.ts +129 -0
- package/src/execute.ts +0 -4
- package/src/index.ts +6 -3
- package/src/internal.ts +0 -4
- package/src/numeric.ts +25 -0
- package/src/packages.ts +251 -0
- package/src/parsers.ts +32 -2
- package/src/queries.ts +227 -25
- package/src/transactions.ts +254 -12
- package/src/types.ts +20 -0
- package/src/view.ts +12 -6
package/src/client.ts
CHANGED
|
@@ -8,9 +8,15 @@ import type {
|
|
|
8
8
|
import type { SuiGraphQLClient } from "@mysten/sui/graphql";
|
|
9
9
|
import {
|
|
10
10
|
getMisoProtocolDeployment,
|
|
11
|
+
normalizeMisoDeployment,
|
|
12
|
+
normalizeMisoProtocolDeployment,
|
|
13
|
+
protocolDeployment,
|
|
14
|
+
type MisoDeployment,
|
|
11
15
|
type MisoProtocolDeployment,
|
|
12
16
|
} from "./deployments.ts";
|
|
17
|
+
import { bindModulePackage, MisoPackageBindings, REF_RETURNING_CALLS } from "./packages.ts";
|
|
13
18
|
import * as parsers from "./parsers.ts";
|
|
19
|
+
import { eventParsers } from "./events.ts";
|
|
14
20
|
import * as queries from "./queries.ts";
|
|
15
21
|
import * as view from "./view.ts";
|
|
16
22
|
import type {
|
|
@@ -32,10 +38,10 @@ export interface MisoOptions<Name extends string = "miso"> {
|
|
|
32
38
|
/** Name for the client extension. Defaults to "miso". */
|
|
33
39
|
name?: Name;
|
|
34
40
|
/**
|
|
35
|
-
*
|
|
36
|
-
*
|
|
41
|
+
* Explicit core-only deployment or complete package manifest. Omit only after
|
|
42
|
+
* this SDK has a verified bundled manifest for the client's network.
|
|
37
43
|
*/
|
|
38
|
-
deployment?: MisoProtocolDeployment;
|
|
44
|
+
deployment?: MisoProtocolDeployment | MisoDeployment;
|
|
39
45
|
/** @deprecated Use `deployment`. Retained for compatibility with pre-0.4 callers. */
|
|
40
46
|
misoPackageId?: string;
|
|
41
47
|
/**
|
|
@@ -47,17 +53,10 @@ export interface MisoOptions<Name extends string = "miso"> {
|
|
|
47
53
|
graphqlClient?: SuiGraphQLClient;
|
|
48
54
|
}
|
|
49
55
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
out[key] =
|
|
55
|
-
typeof value === "function"
|
|
56
|
-
? (options: { package?: string }) =>
|
|
57
|
-
(value as (o: unknown) => unknown)({ package: pkg, ...options })
|
|
58
|
-
: value;
|
|
59
|
-
}
|
|
60
|
-
return out as M;
|
|
56
|
+
function isFullDeployment(
|
|
57
|
+
deployment: MisoProtocolDeployment | MisoDeployment,
|
|
58
|
+
): deployment is MisoDeployment {
|
|
59
|
+
return "miso" in deployment;
|
|
61
60
|
}
|
|
62
61
|
|
|
63
62
|
/**
|
|
@@ -77,13 +76,21 @@ export function miso<const Name extends string = "miso">(
|
|
|
77
76
|
return {
|
|
78
77
|
name,
|
|
79
78
|
register: (client) => {
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
(
|
|
83
|
-
?
|
|
84
|
-
:
|
|
79
|
+
const supplied = options.deployment;
|
|
80
|
+
const packageDeployment =
|
|
81
|
+
supplied && isFullDeployment(supplied)
|
|
82
|
+
? normalizeMisoDeployment(supplied)
|
|
83
|
+
: undefined;
|
|
84
|
+
const deployment = supplied
|
|
85
|
+
? isFullDeployment(supplied)
|
|
86
|
+
? protocolDeployment(packageDeployment!)
|
|
87
|
+
: normalizeMisoProtocolDeployment(supplied)
|
|
88
|
+
: options.misoPackageId
|
|
89
|
+
? normalizeMisoProtocolDeployment({ packageId: options.misoPackageId })
|
|
90
|
+
: getMisoProtocolDeployment(client.network);
|
|
85
91
|
return new MisoProtocolClient(client, {
|
|
86
92
|
deployment,
|
|
93
|
+
packageDeployment,
|
|
87
94
|
graphqlClient: options.graphqlClient,
|
|
88
95
|
});
|
|
89
96
|
},
|
|
@@ -92,6 +99,7 @@ export function miso<const Name extends string = "miso">(
|
|
|
92
99
|
|
|
93
100
|
export interface MisoProtocolClientOptions {
|
|
94
101
|
deployment: MisoProtocolDeployment;
|
|
102
|
+
packageDeployment?: MisoDeployment;
|
|
95
103
|
graphqlClient?: SuiGraphQLClient;
|
|
96
104
|
}
|
|
97
105
|
|
|
@@ -99,11 +107,15 @@ export class MisoProtocolClient {
|
|
|
99
107
|
#client: ClientWithCoreApi;
|
|
100
108
|
#graphqlClient?: SuiGraphQLClient;
|
|
101
109
|
#deployment: MisoProtocolDeployment;
|
|
110
|
+
#packageDeployment?: MisoDeployment;
|
|
102
111
|
|
|
103
112
|
constructor(client: ClientWithCoreApi, options: MisoProtocolClientOptions) {
|
|
104
113
|
this.#client = client;
|
|
105
114
|
this.#graphqlClient = options.graphqlClient;
|
|
106
|
-
this.#deployment = options.deployment;
|
|
115
|
+
this.#deployment = normalizeMisoProtocolDeployment(options.deployment);
|
|
116
|
+
this.#packageDeployment = options.packageDeployment
|
|
117
|
+
? normalizeMisoDeployment(options.packageDeployment)
|
|
118
|
+
: undefined;
|
|
107
119
|
}
|
|
108
120
|
|
|
109
121
|
/** The exact deployment selected for this client. */
|
|
@@ -111,6 +123,20 @@ export class MisoProtocolClient {
|
|
|
111
123
|
return this.#deployment;
|
|
112
124
|
}
|
|
113
125
|
|
|
126
|
+
/**
|
|
127
|
+
* Complete package-bound calls and BCS codecs, available only when `miso()`
|
|
128
|
+
* was given a full fresh deployment manifest.
|
|
129
|
+
*/
|
|
130
|
+
get packages(): MisoPackageBindings {
|
|
131
|
+
if (!this.#packageDeployment) {
|
|
132
|
+
throw new Error(
|
|
133
|
+
"@misonetwork/sdk: full package bindings require a complete MisoDeployment. " +
|
|
134
|
+
"Pass the verified post-publish manifest to miso({ deployment }).",
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
return new MisoPackageBindings(this.#packageDeployment);
|
|
138
|
+
}
|
|
139
|
+
|
|
114
140
|
get #misoPackageId(): string {
|
|
115
141
|
return this.#deployment.packageId;
|
|
116
142
|
}
|
|
@@ -211,6 +237,10 @@ export class MisoProtocolClient {
|
|
|
211
237
|
async getReleaseById(releaseId: string): Promise<Release> {
|
|
212
238
|
return queries.getReleaseById(this.#client, releaseId);
|
|
213
239
|
}
|
|
240
|
+
/** Read the shared canonical core `miso::release::ReleaseRegistry`. */
|
|
241
|
+
async getReleaseRegistryById(registryId: string) {
|
|
242
|
+
return queries.getReleaseRegistryById(this.#client, registryId);
|
|
243
|
+
}
|
|
214
244
|
async getReleasesByIds(ids: string[]): Promise<Record<string, Release>> {
|
|
215
245
|
return queries.getReleasesByIds(this.#client, ids);
|
|
216
246
|
}
|
|
@@ -260,9 +290,9 @@ export class MisoProtocolClient {
|
|
|
260
290
|
get call() {
|
|
261
291
|
const pkg = this.#misoPackageId;
|
|
262
292
|
return {
|
|
263
|
-
composition: bindModulePackage(composition, pkg),
|
|
264
|
-
recording: bindModulePackage(recording, pkg),
|
|
265
|
-
release: bindModulePackage(release, pkg),
|
|
293
|
+
composition: bindModulePackage(composition, pkg, REF_RETURNING_CALLS.composition),
|
|
294
|
+
recording: bindModulePackage(recording, pkg, REF_RETURNING_CALLS.recording),
|
|
295
|
+
release: bindModulePackage(release, pkg, REF_RETURNING_CALLS.release),
|
|
266
296
|
track: bindModulePackage(track, pkg),
|
|
267
297
|
};
|
|
268
298
|
}
|
|
@@ -287,7 +317,11 @@ export class MisoProtocolClient {
|
|
|
287
317
|
return {
|
|
288
318
|
compositionPublishedEvent: parsers.parseCompositionPublishedEvent,
|
|
289
319
|
recordingPublishedEvent: parsers.parseRecordingPublishedEvent,
|
|
320
|
+
compositionSharesGrantedEvent:
|
|
321
|
+
parsers.parseCompositionSharesGrantedEvent,
|
|
290
322
|
releasePublishedEvent: parsers.parseReleasePublishedEvent,
|
|
323
|
+
releaseRegistryCreatedEvent: parsers.parseReleaseRegistryCreatedEvent,
|
|
324
|
+
events: eventParsers,
|
|
291
325
|
};
|
|
292
326
|
}
|
|
293
327
|
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* First-party credits extension for compositions.
|
|
8
|
+
*
|
|
9
|
+
* Attribution (writing credits) is display-oriented and varies across platforms,
|
|
10
|
+
* so it lives here as a dynamic field on the composition rather than in immutable
|
|
11
|
+
* core. The data is attached under `ExtensionKey()` via the composition's
|
|
12
|
+
* cap-gated `uid_mut`, so every mutation is authorized by the composition's admin
|
|
13
|
+
* and credits survive into any lifecycle state (they may be attached before or
|
|
14
|
+
* after the composition is published).
|
|
15
|
+
*
|
|
16
|
+
* This is Miso's canonical credits standard; because it is an extension, other
|
|
17
|
+
* parties may publish their own composition-credits standard against the same
|
|
18
|
+
* `Composition`. Credits are NOT read by the economics — they are attribution.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
import { MoveTuple, MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.ts';
|
|
22
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
23
|
+
import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
|
|
24
|
+
import * as vec_map from './deps/sui/vec_map.ts';
|
|
25
|
+
import * as credit from './deps/miso_credit/credit.ts';
|
|
26
|
+
import * as composition_party_role from './composition_party_role.ts';
|
|
27
|
+
const $moduleName = '@local-pkg/composition_credits::composition_credits';
|
|
28
|
+
export const ExtensionKey = new MoveTuple({ name: `${$moduleName}::ExtensionKey`, fields: [bcs.bool()] });
|
|
29
|
+
export const CompositionCredits = new MoveStruct({ name: `${$moduleName}::CompositionCredits`, fields: {
|
|
30
|
+
/** Map of party IDs to their credit (display name + roles). */
|
|
31
|
+
credits: vec_map.VecMap(bcs.Address, credit.Credit(composition_party_role.CompositionPartyRole))
|
|
32
|
+
} });
|
|
33
|
+
export const CreditAddedEvent = new MoveStruct({ name: `${$moduleName}::CreditAddedEvent`, fields: {
|
|
34
|
+
composition_id: bcs.Address,
|
|
35
|
+
party_id: bcs.Address,
|
|
36
|
+
credit: credit.Credit(composition_party_role.CompositionPartyRole)
|
|
37
|
+
} });
|
|
38
|
+
export const CreditRemovedEvent = new MoveStruct({ name: `${$moduleName}::CreditRemovedEvent`, fields: {
|
|
39
|
+
composition_id: bcs.Address,
|
|
40
|
+
party_id: bcs.Address,
|
|
41
|
+
credit: credit.Credit(composition_party_role.CompositionPartyRole)
|
|
42
|
+
} });
|
|
43
|
+
export interface AddCreditArguments {
|
|
44
|
+
self: RawTransactionArgument<string>;
|
|
45
|
+
cap: RawTransactionArgument<string>;
|
|
46
|
+
party: RawTransactionArgument<string>;
|
|
47
|
+
credit: TransactionArgument;
|
|
48
|
+
}
|
|
49
|
+
export interface AddCreditOptions {
|
|
50
|
+
package?: string;
|
|
51
|
+
arguments: AddCreditArguments | [
|
|
52
|
+
self: RawTransactionArgument<string>,
|
|
53
|
+
cap: RawTransactionArgument<string>,
|
|
54
|
+
party: RawTransactionArgument<string>,
|
|
55
|
+
credit: TransactionArgument
|
|
56
|
+
];
|
|
57
|
+
typeArguments: [
|
|
58
|
+
string
|
|
59
|
+
];
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Adds a credit for a party on the composition, lazily creating the credits record
|
|
63
|
+
* on first use. Each credit must have 1-5 roles, and a party may hold at most one
|
|
64
|
+
* credit. Requires the composition's admin capability.
|
|
65
|
+
*/
|
|
66
|
+
export function addCredit(options: AddCreditOptions) {
|
|
67
|
+
const packageAddress = options.package ?? '@local-pkg/composition_credits';
|
|
68
|
+
const argumentsTypes = [
|
|
69
|
+
null,
|
|
70
|
+
null,
|
|
71
|
+
null,
|
|
72
|
+
null
|
|
73
|
+
] satisfies (string | null)[];
|
|
74
|
+
const parameterNames = ["self", "cap", "party", "credit"];
|
|
75
|
+
return (tx: Transaction) => tx.moveCall({
|
|
76
|
+
package: packageAddress,
|
|
77
|
+
module: 'composition_credits',
|
|
78
|
+
function: 'add_credit',
|
|
79
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
80
|
+
typeArguments: options.typeArguments
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
export interface RemoveCreditArguments {
|
|
84
|
+
self: RawTransactionArgument<string>;
|
|
85
|
+
cap: RawTransactionArgument<string>;
|
|
86
|
+
partyId: RawTransactionArgument<string>;
|
|
87
|
+
}
|
|
88
|
+
export interface RemoveCreditOptions {
|
|
89
|
+
package?: string;
|
|
90
|
+
arguments: RemoveCreditArguments | [
|
|
91
|
+
self: RawTransactionArgument<string>,
|
|
92
|
+
cap: RawTransactionArgument<string>,
|
|
93
|
+
partyId: RawTransactionArgument<string>
|
|
94
|
+
];
|
|
95
|
+
typeArguments: [
|
|
96
|
+
string
|
|
97
|
+
];
|
|
98
|
+
}
|
|
99
|
+
/** Removes a party's credit. Requires the composition's admin capability. */
|
|
100
|
+
export function removeCredit(options: RemoveCreditOptions) {
|
|
101
|
+
const packageAddress = options.package ?? '@local-pkg/composition_credits';
|
|
102
|
+
const argumentsTypes = [
|
|
103
|
+
null,
|
|
104
|
+
null,
|
|
105
|
+
'0x2::object::ID'
|
|
106
|
+
] satisfies (string | null)[];
|
|
107
|
+
const parameterNames = ["self", "cap", "partyId"];
|
|
108
|
+
return (tx: Transaction) => tx.moveCall({
|
|
109
|
+
package: packageAddress,
|
|
110
|
+
module: 'composition_credits',
|
|
111
|
+
function: 'remove_credit',
|
|
112
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
113
|
+
typeArguments: options.typeArguments
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
export interface HasCreditsArguments {
|
|
117
|
+
self: RawTransactionArgument<string>;
|
|
118
|
+
}
|
|
119
|
+
export interface HasCreditsOptions {
|
|
120
|
+
package?: string;
|
|
121
|
+
arguments: HasCreditsArguments | [
|
|
122
|
+
self: RawTransactionArgument<string>
|
|
123
|
+
];
|
|
124
|
+
typeArguments: [
|
|
125
|
+
string
|
|
126
|
+
];
|
|
127
|
+
}
|
|
128
|
+
/** Returns whether a credits record has been attached to this composition yet. */
|
|
129
|
+
export function hasCredits(options: HasCreditsOptions) {
|
|
130
|
+
const packageAddress = options.package ?? '@local-pkg/composition_credits';
|
|
131
|
+
const argumentsTypes = [
|
|
132
|
+
null
|
|
133
|
+
] satisfies (string | null)[];
|
|
134
|
+
const parameterNames = ["self"];
|
|
135
|
+
return (tx: Transaction) => tx.moveCall({
|
|
136
|
+
package: packageAddress,
|
|
137
|
+
module: 'composition_credits',
|
|
138
|
+
function: 'has_credits',
|
|
139
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
140
|
+
typeArguments: options.typeArguments
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
export interface CreditsArguments {
|
|
144
|
+
self: RawTransactionArgument<string>;
|
|
145
|
+
}
|
|
146
|
+
export interface CreditsOptions {
|
|
147
|
+
package?: string;
|
|
148
|
+
arguments: CreditsArguments | [
|
|
149
|
+
self: RawTransactionArgument<string>
|
|
150
|
+
];
|
|
151
|
+
typeArguments: [
|
|
152
|
+
string
|
|
153
|
+
];
|
|
154
|
+
}
|
|
155
|
+
/** Returns the party-to-credit map. Aborts if no credits are attached. */
|
|
156
|
+
export function credits(options: CreditsOptions) {
|
|
157
|
+
const packageAddress = options.package ?? '@local-pkg/composition_credits';
|
|
158
|
+
const argumentsTypes = [
|
|
159
|
+
null
|
|
160
|
+
] satisfies (string | null)[];
|
|
161
|
+
const parameterNames = ["self"];
|
|
162
|
+
return (tx: Transaction) => tx.moveCall({
|
|
163
|
+
package: packageAddress,
|
|
164
|
+
module: 'composition_credits',
|
|
165
|
+
function: 'credits',
|
|
166
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
167
|
+
typeArguments: options.typeArguments
|
|
168
|
+
});
|
|
169
|
+
}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Defines the roles that parties can hold on a composition. Compositions are the
|
|
8
|
+
* underlying musical works (melody + lyrics), and these roles represent the
|
|
9
|
+
* writing and adaptation contributions to them.
|
|
10
|
+
*
|
|
11
|
+
* ### Design
|
|
12
|
+
*
|
|
13
|
+
* `CompositionPartyRole` is a closed enum: variants can only be constructed and
|
|
14
|
+
* matched inside this module, so the `new_*_role` constructors are the external
|
|
15
|
+
* write-API and `name()` is the external read-API.
|
|
16
|
+
*
|
|
17
|
+
* - **No seniority axis.** Unlike recording roles, composition roles carry no
|
|
18
|
+
* level — a writer either contributed in a given capacity or did not.
|
|
19
|
+
* - **`Custom` is the escape hatch.** The canonical variants cover the common
|
|
20
|
+
* writing vocabulary; anything outside it is a `Custom(name)` whose name is
|
|
21
|
+
* validated. Prefer a canonical variant when one fits.
|
|
22
|
+
* - **`name()` is the canonical identifier**, returned as a stable PascalCase
|
|
23
|
+
* token (e.g. `"Songwriter"`). For `Custom`, `name()` returns the user-supplied
|
|
24
|
+
* string.
|
|
25
|
+
*
|
|
26
|
+
* These identifiers are Miso's own canonical vocabulary; any overlap with an
|
|
27
|
+
* external standard (e.g. DDEX) is coincidental, not a reproduction of it.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
import { MoveEnum, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.ts';
|
|
31
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
32
|
+
import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
|
|
33
|
+
const $moduleName = '@local-pkg/composition_credits::composition_party_role';
|
|
34
|
+
/** Represents a party's role on a composition. */
|
|
35
|
+
export const CompositionPartyRole = new MoveEnum({ name: `${$moduleName}::CompositionPartyRole`, fields: {
|
|
36
|
+
/** Adapted an existing work into this composition. */
|
|
37
|
+
Adapter: null,
|
|
38
|
+
/** Arranged the musical parts of the composition. */
|
|
39
|
+
Arranger: null,
|
|
40
|
+
/** Composed the music of the composition. */
|
|
41
|
+
Composer: null,
|
|
42
|
+
/** Wrote the lyrics of the composition. */
|
|
43
|
+
Lyricist: null,
|
|
44
|
+
/** Wrote both music and lyrics of the composition. */
|
|
45
|
+
Songwriter: null,
|
|
46
|
+
/** Translated the lyrics of the composition. */
|
|
47
|
+
Translator: null,
|
|
48
|
+
/**
|
|
49
|
+
* A user-defined role not covered by a canonical variant. Carries the role name
|
|
50
|
+
* (validated). An escape hatch — prefer a canonical variant when one fits.
|
|
51
|
+
*/
|
|
52
|
+
Custom: bcs.string()
|
|
53
|
+
} });
|
|
54
|
+
export interface NewAdapterRoleOptions {
|
|
55
|
+
package?: string;
|
|
56
|
+
arguments?: [
|
|
57
|
+
];
|
|
58
|
+
}
|
|
59
|
+
/** Creates a new Adapter role. */
|
|
60
|
+
export function newAdapterRole(options: NewAdapterRoleOptions = {}) {
|
|
61
|
+
const packageAddress = options.package ?? '@local-pkg/composition_credits';
|
|
62
|
+
return (tx: Transaction) => tx.moveCall({
|
|
63
|
+
package: packageAddress,
|
|
64
|
+
module: 'composition_party_role',
|
|
65
|
+
function: 'new_adapter_role',
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
export interface NewArrangerRoleOptions {
|
|
69
|
+
package?: string;
|
|
70
|
+
arguments?: [
|
|
71
|
+
];
|
|
72
|
+
}
|
|
73
|
+
/** Creates a new Arranger role. */
|
|
74
|
+
export function newArrangerRole(options: NewArrangerRoleOptions = {}) {
|
|
75
|
+
const packageAddress = options.package ?? '@local-pkg/composition_credits';
|
|
76
|
+
return (tx: Transaction) => tx.moveCall({
|
|
77
|
+
package: packageAddress,
|
|
78
|
+
module: 'composition_party_role',
|
|
79
|
+
function: 'new_arranger_role',
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
export interface NewComposerRoleOptions {
|
|
83
|
+
package?: string;
|
|
84
|
+
arguments?: [
|
|
85
|
+
];
|
|
86
|
+
}
|
|
87
|
+
/** Creates a new Composer role. */
|
|
88
|
+
export function newComposerRole(options: NewComposerRoleOptions = {}) {
|
|
89
|
+
const packageAddress = options.package ?? '@local-pkg/composition_credits';
|
|
90
|
+
return (tx: Transaction) => tx.moveCall({
|
|
91
|
+
package: packageAddress,
|
|
92
|
+
module: 'composition_party_role',
|
|
93
|
+
function: 'new_composer_role',
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
export interface NewLyricistRoleOptions {
|
|
97
|
+
package?: string;
|
|
98
|
+
arguments?: [
|
|
99
|
+
];
|
|
100
|
+
}
|
|
101
|
+
/** Creates a new Lyricist role. */
|
|
102
|
+
export function newLyricistRole(options: NewLyricistRoleOptions = {}) {
|
|
103
|
+
const packageAddress = options.package ?? '@local-pkg/composition_credits';
|
|
104
|
+
return (tx: Transaction) => tx.moveCall({
|
|
105
|
+
package: packageAddress,
|
|
106
|
+
module: 'composition_party_role',
|
|
107
|
+
function: 'new_lyricist_role',
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
export interface NewSongwriterRoleOptions {
|
|
111
|
+
package?: string;
|
|
112
|
+
arguments?: [
|
|
113
|
+
];
|
|
114
|
+
}
|
|
115
|
+
/** Creates a new Songwriter role. */
|
|
116
|
+
export function newSongwriterRole(options: NewSongwriterRoleOptions = {}) {
|
|
117
|
+
const packageAddress = options.package ?? '@local-pkg/composition_credits';
|
|
118
|
+
return (tx: Transaction) => tx.moveCall({
|
|
119
|
+
package: packageAddress,
|
|
120
|
+
module: 'composition_party_role',
|
|
121
|
+
function: 'new_songwriter_role',
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
export interface NewTranslatorRoleOptions {
|
|
125
|
+
package?: string;
|
|
126
|
+
arguments?: [
|
|
127
|
+
];
|
|
128
|
+
}
|
|
129
|
+
/** Creates a new Translator role. */
|
|
130
|
+
export function newTranslatorRole(options: NewTranslatorRoleOptions = {}) {
|
|
131
|
+
const packageAddress = options.package ?? '@local-pkg/composition_credits';
|
|
132
|
+
return (tx: Transaction) => tx.moveCall({
|
|
133
|
+
package: packageAddress,
|
|
134
|
+
module: 'composition_party_role',
|
|
135
|
+
function: 'new_translator_role',
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
export interface NewCustomRoleArguments {
|
|
139
|
+
roleName: RawTransactionArgument<string>;
|
|
140
|
+
}
|
|
141
|
+
export interface NewCustomRoleOptions {
|
|
142
|
+
package?: string;
|
|
143
|
+
arguments: NewCustomRoleArguments | [
|
|
144
|
+
roleName: RawTransactionArgument<string>
|
|
145
|
+
];
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Creates a new Custom role with a user-defined name. The name freezes into
|
|
149
|
+
* credits, so it is validated here. Prefer a canonical variant when one fits.
|
|
150
|
+
*/
|
|
151
|
+
export function newCustomRole(options: NewCustomRoleOptions) {
|
|
152
|
+
const packageAddress = options.package ?? '@local-pkg/composition_credits';
|
|
153
|
+
const argumentsTypes = [
|
|
154
|
+
'0x1::string::String'
|
|
155
|
+
] satisfies (string | null)[];
|
|
156
|
+
const parameterNames = ["roleName"];
|
|
157
|
+
return (tx: Transaction) => tx.moveCall({
|
|
158
|
+
package: packageAddress,
|
|
159
|
+
module: 'composition_party_role',
|
|
160
|
+
function: 'new_custom_role',
|
|
161
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
export interface NameArguments {
|
|
165
|
+
self: TransactionArgument;
|
|
166
|
+
}
|
|
167
|
+
export interface NameOptions {
|
|
168
|
+
package?: string;
|
|
169
|
+
arguments: NameArguments | [
|
|
170
|
+
self: TransactionArgument
|
|
171
|
+
];
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Returns the canonical identifier of the role as a stable PascalCase token. For
|
|
175
|
+
* `Custom`, returns the user-supplied name.
|
|
176
|
+
*/
|
|
177
|
+
export function name(options: NameOptions) {
|
|
178
|
+
const packageAddress = options.package ?? '@local-pkg/composition_credits';
|
|
179
|
+
const argumentsTypes = [
|
|
180
|
+
null
|
|
181
|
+
] satisfies (string | null)[];
|
|
182
|
+
const parameterNames = ["self"];
|
|
183
|
+
return (tx: Transaction) => tx.moveCall({
|
|
184
|
+
package: packageAddress,
|
|
185
|
+
module: 'composition_party_role',
|
|
186
|
+
function: 'name',
|
|
187
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
188
|
+
});
|
|
189
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Represents a party's credit on a work or activity. A credit pairs a display name
|
|
8
|
+
* with one or more roles, identifying how a party contributed to the work.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { type BcsType, bcs } from '@mysten/sui/bcs';
|
|
12
|
+
import { MoveStruct } from '../../../utils/index.ts';
|
|
13
|
+
const $moduleName = 'miso_credit::credit';
|
|
14
|
+
/**
|
|
15
|
+
* A credit attributing roles to a party on a work. Generic over the role type to
|
|
16
|
+
* support domain-specific roles.
|
|
17
|
+
*/
|
|
18
|
+
export function Credit<Role extends BcsType<any>>(...typeParameters: [
|
|
19
|
+
Role
|
|
20
|
+
]) {
|
|
21
|
+
return new MoveStruct({ name: `${$moduleName}::Credit<${typeParameters[0].name as Role['name']}>`, fields: {
|
|
22
|
+
/** Human-readable name to display for this credit. */
|
|
23
|
+
display_name: bcs.string(),
|
|
24
|
+
/** Roles assigned to the credited party. */
|
|
25
|
+
roles: bcs.vector(typeParameters[0])
|
|
26
|
+
} });
|
|
27
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
import { type BcsType, bcs } from '@mysten/sui/bcs';
|
|
5
|
+
import { MoveStruct } from '../../../utils/index.ts';
|
|
6
|
+
const $moduleName = '0x2::vec_map';
|
|
7
|
+
/** An entry in the map */
|
|
8
|
+
export function Entry<K extends BcsType<any>, V extends BcsType<any>>(...typeParameters: [
|
|
9
|
+
K,
|
|
10
|
+
V
|
|
11
|
+
]) {
|
|
12
|
+
return new MoveStruct({ name: `${$moduleName}::Entry<${typeParameters[0].name as K['name']}, ${typeParameters[1].name as V['name']}>`, fields: {
|
|
13
|
+
key: typeParameters[0],
|
|
14
|
+
value: typeParameters[1]
|
|
15
|
+
} });
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* A map data structure backed by a vector. The map is guaranteed not to contain
|
|
19
|
+
* duplicate keys, but entries are _not_ sorted by key--entries are included in
|
|
20
|
+
* insertion order. All operations are O(N) in the size of the map--the intention
|
|
21
|
+
* of this data structure is only to provide the convenience of programming against
|
|
22
|
+
* a map API. Large maps should use handwritten parent/child relationships instead.
|
|
23
|
+
* Maps that need sorted iteration rather than insertion order iteration should
|
|
24
|
+
* also be handwritten.
|
|
25
|
+
*/
|
|
26
|
+
export function VecMap<K extends BcsType<any>, V extends BcsType<any>>(...typeParameters: [
|
|
27
|
+
K,
|
|
28
|
+
V
|
|
29
|
+
]) {
|
|
30
|
+
return new MoveStruct({ name: `${$moduleName}::VecMap<${typeParameters[0].name as K['name']}, ${typeParameters[1].name as V['name']}>`, fields: {
|
|
31
|
+
contents: bcs.vector(Entry(typeParameters[0], typeParameters[1]))
|
|
32
|
+
} });
|
|
33
|
+
}
|
|
@@ -7,28 +7,28 @@
|
|
|
7
7
|
* Represents a musical composition (song, instrumental work) in Miso. Compositions
|
|
8
8
|
* are the underlying written works that recordings are based on. Each composition
|
|
9
9
|
* has its own share token for ownership distribution.
|
|
10
|
-
*
|
|
10
|
+
*
|
|
11
11
|
* ### Key Features:
|
|
12
|
-
*
|
|
12
|
+
*
|
|
13
13
|
* - Share token initialization with fixed supply (10M tokens, 6 decimals)
|
|
14
14
|
* - State machine: Initialized -> Published (embedded fields immutable after
|
|
15
15
|
* publish; dynamic fields remain extensible via `uid_mut`)
|
|
16
16
|
* - Deterministic addresses via derived object pattern
|
|
17
|
-
*
|
|
17
|
+
*
|
|
18
18
|
* Attribution (credits) is intentionally NOT part of core: it is display-oriented,
|
|
19
19
|
* varies across platforms, and is never read by the economics. It lives in a
|
|
20
20
|
* first-party credits extension attached via `uid_mut`, so core takes no
|
|
21
21
|
* dependency on an identity package and core publish enforces no attribution.
|
|
22
|
-
*
|
|
22
|
+
*
|
|
23
23
|
* ### Lifecycle and trust model
|
|
24
|
-
*
|
|
24
|
+
*
|
|
25
25
|
* A composition is `key`-only with no `drop`: a fresh `Initialized` object cannot
|
|
26
26
|
* be transferred, wrapped, publicly shared, or discarded, and its only by-value
|
|
27
27
|
* consumer is `publish`. Create-and-publish is therefore atomic by construction —
|
|
28
28
|
* an `Initialized` composition cannot outlive its creating transaction, and every
|
|
29
29
|
* composition that exists on-chain is `Published` and shared. There is
|
|
30
30
|
* deliberately no keep function; staged building must fit one transaction.
|
|
31
|
-
*
|
|
31
|
+
*
|
|
32
32
|
* `uid_mut` works in any lifecycle state and is permanent root over ALL dynamic
|
|
33
33
|
* fields on the object — including fields attached by other extensions. "Immutable
|
|
34
34
|
* after publish" covers the embedded fields only; extension-layer data stays
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
* holder as able to mutate or delete any extension data, forever.
|
|
38
38
|
*/
|
|
39
39
|
|
|
40
|
-
import { MoveEnum, MoveStruct, MoveTuple, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.
|
|
40
|
+
import { MoveEnum, MoveStruct, MoveTuple, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.ts';
|
|
41
41
|
import { bcs } from '@mysten/sui/bcs';
|
|
42
42
|
import { type Transaction } from '@mysten/sui/transactions';
|
|
43
|
-
import * as bps from './deps/bps/bps.
|
|
43
|
+
import * as bps from './deps/bps/bps.ts';
|
|
44
44
|
const $moduleName = '@local-pkg/miso::composition';
|
|
45
45
|
/** Lifecycle state of a composition. */
|
|
46
46
|
export const CompositionState = new MoveEnum({ name: `${$moduleName}::CompositionState`, fields: {
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Basis-points arithmetic with a newtype wrapper.
|
|
8
|
-
*
|
|
8
|
+
*
|
|
9
9
|
* 1 bps = 0.01%. 10_000 bps = 100%.
|
|
10
|
-
*
|
|
10
|
+
*
|
|
11
11
|
* Storage-optimal: `BPS` stores a `u16` (2 bytes), the tightest width that fits
|
|
12
12
|
* the `[0, 10_000]` range. Apply functions cover every standard integer width
|
|
13
13
|
* (`u8` through `u256`); overflow safety on `u8`–`u128` is delegated to
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* (~1.16e73).
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
import { MoveTuple } from '../../../utils/index.
|
|
20
|
+
import { MoveTuple } from '../../../utils/index.ts';
|
|
21
21
|
import { bcs } from '@mysten/sui/bcs';
|
|
22
22
|
const $moduleName = 'bps::bps';
|
|
23
23
|
export const BPS = new MoveTuple({ name: `${$moduleName}::BPS`, fields: [bcs.u16()] });
|