@misonetwork/sdk 0.1.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/LICENSE +201 -0
- package/README.md +644 -0
- package/dist/client.d.ts +197 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +218 -0
- package/dist/client.js.map +1 -0
- 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/composition_royalty_pool/composition_royalty_pool.d.ts +87 -0
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.d.ts.map +1 -0
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.js +80 -0
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.js.map +1 -0
- package/dist/contracts/cover_art/cover_art.d.ts +85 -0
- package/dist/contracts/cover_art/cover_art.d.ts.map +1 -0
- package/dist/contracts/cover_art/cover_art.js +68 -0
- package/dist/contracts/cover_art/cover_art.js.map +1 -0
- package/dist/contracts/cover_art/deps/ori/walrus_data.d.ts +52 -0
- package/dist/contracts/cover_art/deps/ori/walrus_data.d.ts.map +1 -0
- package/dist/contracts/cover_art/deps/ori/walrus_data.js +37 -0
- package/dist/contracts/cover_art/deps/ori/walrus_data.js.map +1 -0
- package/dist/contracts/miso/composition.d.ts +231 -0
- package/dist/contracts/miso/composition.d.ts.map +1 -0
- package/dist/contracts/miso/composition.js +231 -0
- package/dist/contracts/miso/composition.js.map +1 -0
- package/dist/contracts/miso/deal.d.ts +184 -0
- package/dist/contracts/miso/deal.d.ts.map +1 -0
- package/dist/contracts/miso/deal.js +184 -0
- package/dist/contracts/miso/deal.js.map +1 -0
- package/dist/contracts/miso/deps/bps/bps.d.ts +19 -0
- package/dist/contracts/miso/deps/bps/bps.d.ts.map +1 -0
- package/dist/contracts/miso/deps/bps/bps.js +21 -0
- package/dist/contracts/miso/deps/bps/bps.js.map +1 -0
- package/dist/contracts/miso/recording.d.ts +228 -0
- package/dist/contracts/miso/recording.d.ts.map +1 -0
- package/dist/contracts/miso/recording.js +221 -0
- package/dist/contracts/miso/recording.js.map +1 -0
- package/dist/contracts/miso/release.d.ts +280 -0
- package/dist/contracts/miso/release.d.ts.map +1 -0
- package/dist/contracts/miso/release.js +282 -0
- package/dist/contracts/miso/release.js.map +1 -0
- package/dist/contracts/miso/track.d.ts +118 -0
- package/dist/contracts/miso/track.d.ts.map +1 -0
- package/dist/contracts/miso/track.js +118 -0
- package/dist/contracts/miso/track.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_royalty_pool/recording_royalty_pool.d.ts +90 -0
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.d.ts.map +1 -0
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.js +80 -0
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.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/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 +358 -0
- package/dist/contracts/royalty_pool/pool.d.ts.map +1 -0
- package/dist/contracts/royalty_pool/pool.js +352 -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/utils/index.d.ts +31 -0
- package/dist/contracts/utils/index.d.ts.map +1 -0
- package/dist/contracts/utils/index.js +162 -0
- package/dist/contracts/utils/index.js.map +1 -0
- package/dist/contracts.d.ts +18 -0
- package/dist/contracts.d.ts.map +1 -0
- package/dist/contracts.js +26 -0
- package/dist/contracts.js.map +1 -0
- package/dist/cover.d.ts +48 -0
- package/dist/cover.d.ts.map +1 -0
- package/dist/cover.js +68 -0
- package/dist/cover.js.map +1 -0
- package/dist/credits.d.ts +171 -0
- package/dist/credits.d.ts.map +1 -0
- package/dist/credits.js +360 -0
- package/dist/credits.js.map +1 -0
- package/dist/execute.d.ts +49 -0
- package/dist/execute.d.ts.map +1 -0
- package/dist/execute.js +114 -0
- package/dist/execute.js.map +1 -0
- package/dist/extensions/royalty-pool.d.ts +32 -0
- package/dist/extensions/royalty-pool.d.ts.map +1 -0
- package/dist/extensions/royalty-pool.js +33 -0
- package/dist/extensions/royalty-pool.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -0
- package/dist/internal.d.ts +20 -0
- package/dist/internal.d.ts.map +1 -0
- package/dist/internal.js +48 -0
- package/dist/internal.js.map +1 -0
- package/dist/parsers.d.ts +9 -0
- package/dist/parsers.d.ts.map +1 -0
- package/dist/parsers.js +52 -0
- package/dist/parsers.js.map +1 -0
- package/dist/queries.d.ts +105 -0
- package/dist/queries.d.ts.map +1 -0
- package/dist/queries.js +380 -0
- package/dist/queries.js.map +1 -0
- package/dist/schemas.d.ts +99 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/schemas.js +76 -0
- package/dist/schemas.js.map +1 -0
- package/dist/transactions.d.ts +158 -0
- package/dist/transactions.d.ts.map +1 -0
- package/dist/transactions.js +154 -0
- package/dist/transactions.js.map +1 -0
- package/dist/types.d.ts +204 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +4 -0
- package/dist/types.js.map +1 -0
- package/dist/view.d.ts +21 -0
- package/dist/view.d.ts.map +1 -0
- package/dist/view.js +36 -0
- package/dist/view.js.map +1 -0
- package/package.json +111 -0
- package/src/client.ts +278 -0
- 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/composition_royalty_pool/composition_royalty_pool.ts +135 -0
- package/src/contracts/cover_art/cover_art.ts +99 -0
- package/src/contracts/cover_art/deps/ori/walrus_data.ts +36 -0
- package/src/contracts/miso/composition.ts +343 -0
- package/src/contracts/miso/deal.ts +257 -0
- package/src/contracts/miso/deps/bps/bps.ts +23 -0
- package/src/contracts/miso/recording.ts +298 -0
- package/src/contracts/miso/release.ts +392 -0
- package/src/contracts/miso/track.ts +153 -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_royalty_pool/recording_royalty_pool.ts +138 -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/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 +577 -0
- package/src/contracts/royalty_pool/stake.ts +317 -0
- package/src/contracts/utils/index.ts +229 -0
- package/src/contracts.ts +30 -0
- package/src/cover.ts +136 -0
- package/src/credits.ts +645 -0
- package/src/execute.ts +141 -0
- package/src/extensions/royalty-pool.ts +85 -0
- package/src/index.ts +17 -0
- package/src/internal.ts +85 -0
- package/src/parsers.ts +80 -0
- package/src/queries.ts +478 -0
- package/src/schemas.ts +96 -0
- package/src/transactions.ts +290 -0
- package/src/types.ts +244 -0
- package/src/view.ts +59 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/**
|
|
5
|
+
* Basis-points arithmetic with a newtype wrapper.
|
|
6
|
+
*
|
|
7
|
+
* 1 bps = 0.01%. 10_000 bps = 100%.
|
|
8
|
+
*
|
|
9
|
+
* Storage-optimal: `BPS` stores a `u16` (2 bytes), the tightest width that fits
|
|
10
|
+
* the `[0, 10_000]` range. Apply functions cover every standard integer width
|
|
11
|
+
* (`u8` through `u256`); overflow safety on `u8`–`u128` is delegated to
|
|
12
|
+
* `std::uX::mul_div` / `mul_div_ceil`, which widen to the next-larger type
|
|
13
|
+
* internally. `u256` has no wider type, so the multiplication is performed
|
|
14
|
+
* directly and only overflows for amounts exceeding `u256::MAX / 10_000`
|
|
15
|
+
* (~1.16e73).
|
|
16
|
+
*/
|
|
17
|
+
import { MoveTuple } from '../../../utils/index.js';
|
|
18
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
19
|
+
const $moduleName = 'bps::bps';
|
|
20
|
+
export const BPS = new MoveTuple({ name: `${$moduleName}::BPS`, fields: [bcs.u16()] });
|
|
21
|
+
//# sourceMappingURL=bps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bps.js","sourceRoot":"","sources":["../../../../../src/contracts/miso/deps/bps/bps.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAGhE;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACtC,MAAM,WAAW,GAAG,UAAU,CAAC;AAC/B,MAAM,CAAC,MAAM,GAAG,GAAG,IAAI,SAAS,CAAC,EAAE,IAAI,EAAE,GAAG,WAAW,OAAO,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/**
|
|
5
|
+
* Represents an audio recording of a composition in Miso. Recordings are the audio
|
|
6
|
+
* performances that are distributed and played. Each recording has its own share
|
|
7
|
+
* token for ownership distribution.
|
|
8
|
+
*
|
|
9
|
+
* ### Key Features:
|
|
10
|
+
*
|
|
11
|
+
* - Share token initialization with fixed supply (10M tokens, 6 decimals)
|
|
12
|
+
* - State machine: Initialized -> Published (embedded fields immutable after
|
|
13
|
+
* publish; dynamic fields remain extensible via `uid_mut`, e.g. masters, and
|
|
14
|
+
* credits/attribution attached by the credits extension)
|
|
15
|
+
* - Deterministic addresses via derived object pattern
|
|
16
|
+
*
|
|
17
|
+
* Attribution (credits, primary/featured artists) is intentionally NOT part of
|
|
18
|
+
* core: it is display-oriented, varies across platforms, and is never read by the
|
|
19
|
+
* economics. It lives in a first-party credits extension attached via `uid_mut`,
|
|
20
|
+
* so core takes no dependency on an identity package and core publish enforces no
|
|
21
|
+
* attribution.
|
|
22
|
+
*
|
|
23
|
+
* A recording carries no name of its own. Its display title is its composition's
|
|
24
|
+
* title, read by reference — composition titles are immutable, so an embedded copy
|
|
25
|
+
* would carry no information. Anything that names this particular take — "(Live)",
|
|
26
|
+
* "Radio Edit", a translated title — has more than one correct rendering, which
|
|
27
|
+
* makes it presentation, and presentation lives in the metadata extension, never
|
|
28
|
+
* in the frozen core. Core stores what a recording _is_; extensions describe it.
|
|
29
|
+
*
|
|
30
|
+
* ### Lifecycle and trust model
|
|
31
|
+
*
|
|
32
|
+
* A recording is `key`-only with no `drop`: a fresh `Initialized` object cannot be
|
|
33
|
+
* transferred, wrapped, publicly shared, or discarded, and its only by-value
|
|
34
|
+
* consumer is `publish`. Create-and-publish is therefore atomic by construction —
|
|
35
|
+
* an `Initialized` recording cannot outlive its creating transaction, and every
|
|
36
|
+
* recording that exists on-chain is `Published` and shared. There is deliberately
|
|
37
|
+
* no keep function; staged building must fit one transaction.
|
|
38
|
+
*
|
|
39
|
+
* `uid_mut` works in any lifecycle state and is permanent root over ALL dynamic
|
|
40
|
+
* fields on the object — including fields attached by other extensions. "Immutable
|
|
41
|
+
* after publish" covers the embedded fields only; extension-layer data stays
|
|
42
|
+
* admin-mutable in perpetuity. This is the designed extension surface, and it is
|
|
43
|
+
* the one trust assumption that never expires: integrators should model the cap
|
|
44
|
+
* holder as able to mutate or delete any extension data, forever.
|
|
45
|
+
*
|
|
46
|
+
* The recording carries its parent composition's identity as the
|
|
47
|
+
* `CompositionShare` phantom type parameter — the composition's share type is its
|
|
48
|
+
* durable identity (a share currency is published independently of miso and
|
|
49
|
+
* survives a fresh republish, whereas an object ID does not). This makes the
|
|
50
|
+
* recording↔composition lineage compile-time enforced wherever the two meet, and
|
|
51
|
+
* it is the sole link: the composition's object id is not stored on the recording.
|
|
52
|
+
* Off-chain consumers that need the composition object resolve its share type to
|
|
53
|
+
* an id via `composition::CompositionPublishedEvent`, which binds the two.
|
|
54
|
+
*
|
|
55
|
+
* A recording is its own freshly-created object (`object::new`), not a derived
|
|
56
|
+
* child of its composition: `recording::new` takes a read-only `&Composition`
|
|
57
|
+
* (only to read its royalty rate and id), so publishing recordings under a
|
|
58
|
+
* composition neither contends on the composition's shared-object version nor
|
|
59
|
+
* collides on a per-composition index.
|
|
60
|
+
*/
|
|
61
|
+
import { MoveEnum, MoveStruct, MoveTuple, type RawTransactionArgument } from '../utils/index.js';
|
|
62
|
+
import { type Transaction } from '@mysten/sui/transactions';
|
|
63
|
+
/** Lifecycle state of a recording. */
|
|
64
|
+
export declare const RecordingState: MoveEnum<{
|
|
65
|
+
/** Recording is being set up and can be modified. */
|
|
66
|
+
Initialized: null;
|
|
67
|
+
/** Recording is published and immutable. Includes publication timestamp. */
|
|
68
|
+
Published: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
69
|
+
}, "@local-pkg/miso::recording::RecordingState">;
|
|
70
|
+
export declare const Recording: MoveStruct<{
|
|
71
|
+
/** Unique identifier for this recording. */
|
|
72
|
+
id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
73
|
+
/** Current lifecycle state. */
|
|
74
|
+
state: MoveEnum<{
|
|
75
|
+
/** Recording is being set up and can be modified. */
|
|
76
|
+
Initialized: null;
|
|
77
|
+
/** Recording is published and immutable. Includes publication timestamp. */
|
|
78
|
+
Published: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
79
|
+
}, "@local-pkg/miso::recording::RecordingState">;
|
|
80
|
+
}, "@local-pkg/miso::recording::Recording<phantom RecordingShare, phantom CompositionShare>">;
|
|
81
|
+
export declare const RecordingAdminCap: MoveStruct<{
|
|
82
|
+
/** Unique identifier for this capability. */
|
|
83
|
+
id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
84
|
+
}, "@local-pkg/miso::recording::RecordingAdminCap<phantom RecordingShare>">;
|
|
85
|
+
export declare const RecordingAdminCapKey: MoveTuple<readonly [import("@mysten/sui/bcs").BcsType<boolean, boolean, "bool">], "@local-pkg/miso::recording::RecordingAdminCapKey">;
|
|
86
|
+
export declare const RecordingPublishedEvent: MoveStruct<{
|
|
87
|
+
recording_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
88
|
+
}, "@local-pkg/miso::recording::RecordingPublishedEvent<phantom RecordingShare, phantom CompositionShare>">;
|
|
89
|
+
export declare const CompositionSharesGrantedEvent: MoveStruct<{
|
|
90
|
+
recording_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
91
|
+
composition_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
92
|
+
/** Recording-share base units granted to the composition. */
|
|
93
|
+
value: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
94
|
+
/** The composition royalty rate applied at creation, in basis points. */
|
|
95
|
+
rate_bps: import("@mysten/sui/bcs").BcsType<number, number, "u16">;
|
|
96
|
+
granted_by: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
97
|
+
}, "@local-pkg/miso::recording::CompositionSharesGrantedEvent<phantom RecordingShare, phantom CompositionShare>">;
|
|
98
|
+
export interface NewArguments {
|
|
99
|
+
composition: RawTransactionArgument<string>;
|
|
100
|
+
shareCurrency: RawTransactionArgument<string>;
|
|
101
|
+
shareTreasuryCap: RawTransactionArgument<string>;
|
|
102
|
+
maxRoyaltyRateBps: RawTransactionArgument<number>;
|
|
103
|
+
}
|
|
104
|
+
export interface NewOptions {
|
|
105
|
+
package?: string;
|
|
106
|
+
arguments: NewArguments | [
|
|
107
|
+
composition: RawTransactionArgument<string>,
|
|
108
|
+
shareCurrency: RawTransactionArgument<string>,
|
|
109
|
+
shareTreasuryCap: RawTransactionArgument<string>,
|
|
110
|
+
maxRoyaltyRateBps: RawTransactionArgument<number>
|
|
111
|
+
];
|
|
112
|
+
typeArguments: [
|
|
113
|
+
string,
|
|
114
|
+
string
|
|
115
|
+
];
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Creates a new recording for a composition.
|
|
119
|
+
*
|
|
120
|
+
* Initializes share tokens (10M supply, 6 decimals), then splits the composition's
|
|
121
|
+
* royalty-rate worth of those shares off the freshly minted supply and
|
|
122
|
+
* `send_funds`es them to the composition's address. This settles the composition's
|
|
123
|
+
* cut as cap-table ownership: the composition literally owns its share of the
|
|
124
|
+
* recording, so its claim on recording revenue is enforced by share ownership
|
|
125
|
+
* rather than by any revenue distributor choosing to honor a rate. What the
|
|
126
|
+
* composition owner then does with the shares (hold, stake, sell) is outside the
|
|
127
|
+
* protocol's scope.
|
|
128
|
+
*
|
|
129
|
+
* `max_royalty_rate_bps` is a slippage guard: `new` reads the composition's
|
|
130
|
+
* royalty rate live off a shared object, so a composition owner could land a rate
|
|
131
|
+
* increase in a transaction ordered just before this one and capture more of the
|
|
132
|
+
* recording's shares than the recorder saw. The call aborts if the composition's
|
|
133
|
+
* current rate exceeds `max_royalty_rate_bps`, so the recorder pins the most they
|
|
134
|
+
* will grant (pass the rate they observed, or `2000` to accept up to the protocol
|
|
135
|
+
* maximum).
|
|
136
|
+
*
|
|
137
|
+
* The composition need not be `Published`: within the composition's own creating
|
|
138
|
+
* transaction its creator can already mint recordings against it. Third parties
|
|
139
|
+
* only ever see `Published`, shared compositions (an `Initialized` one cannot
|
|
140
|
+
* escape its creating transaction), so indexers may observe a recording created
|
|
141
|
+
* "against an unpublished composition" only as an intra-transaction ordering,
|
|
142
|
+
* never across transactions.
|
|
143
|
+
*
|
|
144
|
+
* Returns:
|
|
145
|
+
*
|
|
146
|
+
* - The recording object (typed to its parent composition's `CompositionShare`)
|
|
147
|
+
* - Admin capability for the owner
|
|
148
|
+
* - The creator's remaining share balance (full supply minus the composition's
|
|
149
|
+
* cut)
|
|
150
|
+
*/
|
|
151
|
+
export declare function _new(options: NewOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
152
|
+
export interface PublishArguments {
|
|
153
|
+
self: RawTransactionArgument<string>;
|
|
154
|
+
_: RawTransactionArgument<string>;
|
|
155
|
+
}
|
|
156
|
+
export interface PublishOptions {
|
|
157
|
+
package?: string;
|
|
158
|
+
arguments: PublishArguments | [
|
|
159
|
+
self: RawTransactionArgument<string>,
|
|
160
|
+
_: RawTransactionArgument<string>
|
|
161
|
+
];
|
|
162
|
+
typeArguments: [
|
|
163
|
+
string,
|
|
164
|
+
string
|
|
165
|
+
];
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Publishes the recording, making its embedded fields immutable. Required State:
|
|
169
|
+
* Initialized
|
|
170
|
+
*
|
|
171
|
+
* Note: core enforces no attribution requirement — credits live in the credits
|
|
172
|
+
* extension and may be attached before or after publish via `uid_mut`.
|
|
173
|
+
*/
|
|
174
|
+
export declare function publish(options: PublishOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
175
|
+
export interface IdArguments {
|
|
176
|
+
self: RawTransactionArgument<string>;
|
|
177
|
+
}
|
|
178
|
+
export interface IdOptions {
|
|
179
|
+
package?: string;
|
|
180
|
+
arguments: IdArguments | [
|
|
181
|
+
self: RawTransactionArgument<string>
|
|
182
|
+
];
|
|
183
|
+
typeArguments: [
|
|
184
|
+
string,
|
|
185
|
+
string
|
|
186
|
+
];
|
|
187
|
+
}
|
|
188
|
+
/** Returns the recording's object ID. */
|
|
189
|
+
export declare function id(options: IdOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
190
|
+
export interface UidArguments {
|
|
191
|
+
self: RawTransactionArgument<string>;
|
|
192
|
+
}
|
|
193
|
+
export interface UidOptions {
|
|
194
|
+
package?: string;
|
|
195
|
+
arguments: UidArguments | [
|
|
196
|
+
self: RawTransactionArgument<string>
|
|
197
|
+
];
|
|
198
|
+
typeArguments: [
|
|
199
|
+
string,
|
|
200
|
+
string
|
|
201
|
+
];
|
|
202
|
+
}
|
|
203
|
+
/** Returns a reference to the recording's UID for reading dynamic fields. */
|
|
204
|
+
export declare function uid(options: UidOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
205
|
+
export interface UidMutArguments {
|
|
206
|
+
self: RawTransactionArgument<string>;
|
|
207
|
+
_: RawTransactionArgument<string>;
|
|
208
|
+
}
|
|
209
|
+
export interface UidMutOptions {
|
|
210
|
+
package?: string;
|
|
211
|
+
arguments: UidMutArguments | [
|
|
212
|
+
self: RawTransactionArgument<string>,
|
|
213
|
+
_: RawTransactionArgument<string>
|
|
214
|
+
];
|
|
215
|
+
typeArguments: [
|
|
216
|
+
string,
|
|
217
|
+
string
|
|
218
|
+
];
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Returns a mutable reference to the recording's UID. Requires the admin
|
|
222
|
+
* capability. Works in any lifecycle state — dynamic fields are the extension
|
|
223
|
+
* surface (e.g. masters, credits) and stay admin-mutable after publish; only the
|
|
224
|
+
* embedded fields are frozen. The reference is root over every dynamic field on
|
|
225
|
+
* the object, including fields attached by other extensions.
|
|
226
|
+
*/
|
|
227
|
+
export declare function uidMut(options: UidMutOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
228
|
+
//# sourceMappingURL=recording.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recording.d.ts","sourceRoot":"","sources":["../../../src/contracts/miso/recording.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAGhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AAEH,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAA0B,KAAK,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAEzH,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE5D,sCAAsC;AACtC,eAAO,MAAM,cAAc;IACnB,qDAAqD;;IAErD,4EAA4E;;gDAE5E,CAAC;AACT,eAAO,MAAM,SAAS;IACd,4CAA4C;;IAE5C,+BAA+B;;QAR/B,qDAAqD;;QAErD,4EAA4E;;;6FAQ5E,CAAC;AACT,eAAO,MAAM,iBAAiB;IACtB,6CAA6C;;2EAE7C,CAAC;AACT,eAAO,MAAM,oBAAoB,uIAAwF,CAAC;AAC1H,eAAO,MAAM,uBAAuB;;2GAE5B,CAAC;AACT,eAAO,MAAM,6BAA6B;;;IAGlC,6DAA6D;;IAE7D,yEAAyE;;;iHAGzE,CAAC;AACT,MAAM,WAAW,YAAY;IACzB,WAAW,EAAE,sBAAsB,CAAC,MAAM,CAAC,CAAC;IAC5C,aAAa,EAAE,sBAAsB,CAAC,MAAM,CAAC,CAAC;IAC9C,gBAAgB,EAAE,sBAAsB,CAAC,MAAM,CAAC,CAAC;IACjD,iBAAiB,EAAE,sBAAsB,CAAC,MAAM,CAAC,CAAC;CACrD;AACD,MAAM,WAAW,UAAU;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,YAAY,GAAG;QACtB,WAAW,EAAE,sBAAsB,CAAC,M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AM,CAAC,CAAC;CACxC;AACD,MAAM,WAAW,UAAU;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,YAAY,GAAG;QACtB,IAAI,EAAE,sBAAsB,CAAC,MAAM,CAAC;KACvC,CAAC;IACF,aAAa,EAAE;QACX,MAAM;QACN,MAAM;KACT,CAAC;CACL;AACD,6EAA6E;AAC7E,wBAAgB,GAAG,CAAC,OAAO,EAAE,UAAU,IAM3B,IAAI,WAAW,0DAO1B;AACD,MAAM,WAAW,eAAe;IAC5B,IAAI,EAAE,sBAAsB,CAAC,MAAM,CAAC,CAAC;IACrC,CAAC,EAAE,sBAAsB,CAAC,MAAM,CAAC,CAAC;CACrC;AACD,MAAM,WAAW,aAAa;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,eAAe,GAAG;QACzB,IAAI,EAAE,sBAAsB,CAAC,MAAM,CAAC;QACpC,CAAC,EAAE,sBAAsB,CAAC,MAAM,CAAC;KACpC,CAAC;IACF,aAAa,EAAE;QACX,MAAM;QACN,MAAM;KACT,CAAC;CACL;AACD;;;;;;GAMG;AACH,wBAAgB,MAAM,CAAC,OAAO,EAAE,aAAa,IAOjC,IAAI,WAAW,0DAO1B"}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/**
|
|
5
|
+
* Represents an audio recording of a composition in Miso. Recordings are the audio
|
|
6
|
+
* performances that are distributed and played. Each recording has its own share
|
|
7
|
+
* token for ownership distribution.
|
|
8
|
+
*
|
|
9
|
+
* ### Key Features:
|
|
10
|
+
*
|
|
11
|
+
* - Share token initialization with fixed supply (10M tokens, 6 decimals)
|
|
12
|
+
* - State machine: Initialized -> Published (embedded fields immutable after
|
|
13
|
+
* publish; dynamic fields remain extensible via `uid_mut`, e.g. masters, and
|
|
14
|
+
* credits/attribution attached by the credits extension)
|
|
15
|
+
* - Deterministic addresses via derived object pattern
|
|
16
|
+
*
|
|
17
|
+
* Attribution (credits, primary/featured artists) is intentionally NOT part of
|
|
18
|
+
* core: it is display-oriented, varies across platforms, and is never read by the
|
|
19
|
+
* economics. It lives in a first-party credits extension attached via `uid_mut`,
|
|
20
|
+
* so core takes no dependency on an identity package and core publish enforces no
|
|
21
|
+
* attribution.
|
|
22
|
+
*
|
|
23
|
+
* A recording carries no name of its own. Its display title is its composition's
|
|
24
|
+
* title, read by reference — composition titles are immutable, so an embedded copy
|
|
25
|
+
* would carry no information. Anything that names this particular take — "(Live)",
|
|
26
|
+
* "Radio Edit", a translated title — has more than one correct rendering, which
|
|
27
|
+
* makes it presentation, and presentation lives in the metadata extension, never
|
|
28
|
+
* in the frozen core. Core stores what a recording _is_; extensions describe it.
|
|
29
|
+
*
|
|
30
|
+
* ### Lifecycle and trust model
|
|
31
|
+
*
|
|
32
|
+
* A recording is `key`-only with no `drop`: a fresh `Initialized` object cannot be
|
|
33
|
+
* transferred, wrapped, publicly shared, or discarded, and its only by-value
|
|
34
|
+
* consumer is `publish`. Create-and-publish is therefore atomic by construction —
|
|
35
|
+
* an `Initialized` recording cannot outlive its creating transaction, and every
|
|
36
|
+
* recording that exists on-chain is `Published` and shared. There is deliberately
|
|
37
|
+
* no keep function; staged building must fit one transaction.
|
|
38
|
+
*
|
|
39
|
+
* `uid_mut` works in any lifecycle state and is permanent root over ALL dynamic
|
|
40
|
+
* fields on the object — including fields attached by other extensions. "Immutable
|
|
41
|
+
* after publish" covers the embedded fields only; extension-layer data stays
|
|
42
|
+
* admin-mutable in perpetuity. This is the designed extension surface, and it is
|
|
43
|
+
* the one trust assumption that never expires: integrators should model the cap
|
|
44
|
+
* holder as able to mutate or delete any extension data, forever.
|
|
45
|
+
*
|
|
46
|
+
* The recording carries its parent composition's identity as the
|
|
47
|
+
* `CompositionShare` phantom type parameter — the composition's share type is its
|
|
48
|
+
* durable identity (a share currency is published independently of miso and
|
|
49
|
+
* survives a fresh republish, whereas an object ID does not). This makes the
|
|
50
|
+
* recording↔composition lineage compile-time enforced wherever the two meet, and
|
|
51
|
+
* it is the sole link: the composition's object id is not stored on the recording.
|
|
52
|
+
* Off-chain consumers that need the composition object resolve its share type to
|
|
53
|
+
* an id via `composition::CompositionPublishedEvent`, which binds the two.
|
|
54
|
+
*
|
|
55
|
+
* A recording is its own freshly-created object (`object::new`), not a derived
|
|
56
|
+
* child of its composition: `recording::new` takes a read-only `&Composition`
|
|
57
|
+
* (only to read its royalty rate and id), so publishing recordings under a
|
|
58
|
+
* composition neither contends on the composition's shared-object version nor
|
|
59
|
+
* collides on a per-composition index.
|
|
60
|
+
*/
|
|
61
|
+
import { MoveEnum, MoveStruct, MoveTuple, normalizeMoveArguments } from '../utils/index.js';
|
|
62
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
63
|
+
import {} from '@mysten/sui/transactions';
|
|
64
|
+
const $moduleName = '@local-pkg/miso::recording';
|
|
65
|
+
/** Lifecycle state of a recording. */
|
|
66
|
+
export const RecordingState = new MoveEnum({ name: `${$moduleName}::RecordingState`, fields: {
|
|
67
|
+
/** Recording is being set up and can be modified. */
|
|
68
|
+
Initialized: null,
|
|
69
|
+
/** Recording is published and immutable. Includes publication timestamp. */
|
|
70
|
+
Published: bcs.u64()
|
|
71
|
+
} });
|
|
72
|
+
export const Recording = new MoveStruct({ name: `${$moduleName}::Recording<phantom RecordingShare, phantom CompositionShare>`, fields: {
|
|
73
|
+
/** Unique identifier for this recording. */
|
|
74
|
+
id: bcs.Address,
|
|
75
|
+
/** Current lifecycle state. */
|
|
76
|
+
state: RecordingState
|
|
77
|
+
} });
|
|
78
|
+
export const RecordingAdminCap = new MoveStruct({ name: `${$moduleName}::RecordingAdminCap<phantom RecordingShare>`, fields: {
|
|
79
|
+
/** Unique identifier for this capability. */
|
|
80
|
+
id: bcs.Address
|
|
81
|
+
} });
|
|
82
|
+
export const RecordingAdminCapKey = new MoveTuple({ name: `${$moduleName}::RecordingAdminCapKey`, fields: [bcs.bool()] });
|
|
83
|
+
export const RecordingPublishedEvent = new MoveStruct({ name: `${$moduleName}::RecordingPublishedEvent<phantom RecordingShare, phantom CompositionShare>`, fields: {
|
|
84
|
+
recording_id: bcs.Address
|
|
85
|
+
} });
|
|
86
|
+
export const CompositionSharesGrantedEvent = new MoveStruct({ name: `${$moduleName}::CompositionSharesGrantedEvent<phantom RecordingShare, phantom CompositionShare>`, fields: {
|
|
87
|
+
recording_id: bcs.Address,
|
|
88
|
+
composition_id: bcs.Address,
|
|
89
|
+
/** Recording-share base units granted to the composition. */
|
|
90
|
+
value: bcs.u64(),
|
|
91
|
+
/** The composition royalty rate applied at creation, in basis points. */
|
|
92
|
+
rate_bps: bcs.u16(),
|
|
93
|
+
granted_by: bcs.Address
|
|
94
|
+
} });
|
|
95
|
+
/**
|
|
96
|
+
* Creates a new recording for a composition.
|
|
97
|
+
*
|
|
98
|
+
* Initializes share tokens (10M supply, 6 decimals), then splits the composition's
|
|
99
|
+
* royalty-rate worth of those shares off the freshly minted supply and
|
|
100
|
+
* `send_funds`es them to the composition's address. This settles the composition's
|
|
101
|
+
* cut as cap-table ownership: the composition literally owns its share of the
|
|
102
|
+
* recording, so its claim on recording revenue is enforced by share ownership
|
|
103
|
+
* rather than by any revenue distributor choosing to honor a rate. What the
|
|
104
|
+
* composition owner then does with the shares (hold, stake, sell) is outside the
|
|
105
|
+
* protocol's scope.
|
|
106
|
+
*
|
|
107
|
+
* `max_royalty_rate_bps` is a slippage guard: `new` reads the composition's
|
|
108
|
+
* royalty rate live off a shared object, so a composition owner could land a rate
|
|
109
|
+
* increase in a transaction ordered just before this one and capture more of the
|
|
110
|
+
* recording's shares than the recorder saw. The call aborts if the composition's
|
|
111
|
+
* current rate exceeds `max_royalty_rate_bps`, so the recorder pins the most they
|
|
112
|
+
* will grant (pass the rate they observed, or `2000` to accept up to the protocol
|
|
113
|
+
* maximum).
|
|
114
|
+
*
|
|
115
|
+
* The composition need not be `Published`: within the composition's own creating
|
|
116
|
+
* transaction its creator can already mint recordings against it. Third parties
|
|
117
|
+
* only ever see `Published`, shared compositions (an `Initialized` one cannot
|
|
118
|
+
* escape its creating transaction), so indexers may observe a recording created
|
|
119
|
+
* "against an unpublished composition" only as an intra-transaction ordering,
|
|
120
|
+
* never across transactions.
|
|
121
|
+
*
|
|
122
|
+
* Returns:
|
|
123
|
+
*
|
|
124
|
+
* - The recording object (typed to its parent composition's `CompositionShare`)
|
|
125
|
+
* - Admin capability for the owner
|
|
126
|
+
* - The creator's remaining share balance (full supply minus the composition's
|
|
127
|
+
* cut)
|
|
128
|
+
*/
|
|
129
|
+
export function _new(options) {
|
|
130
|
+
const packageAddress = options.package ?? '@local-pkg/miso';
|
|
131
|
+
const argumentsTypes = [
|
|
132
|
+
null,
|
|
133
|
+
null,
|
|
134
|
+
null,
|
|
135
|
+
'u16'
|
|
136
|
+
];
|
|
137
|
+
const parameterNames = ["composition", "shareCurrency", "shareTreasuryCap", "maxRoyaltyRateBps"];
|
|
138
|
+
return (tx) => tx.moveCall({
|
|
139
|
+
package: packageAddress,
|
|
140
|
+
module: 'recording',
|
|
141
|
+
function: 'new',
|
|
142
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
143
|
+
typeArguments: options.typeArguments
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Publishes the recording, making its embedded fields immutable. Required State:
|
|
148
|
+
* Initialized
|
|
149
|
+
*
|
|
150
|
+
* Note: core enforces no attribution requirement — credits live in the credits
|
|
151
|
+
* extension and may be attached before or after publish via `uid_mut`.
|
|
152
|
+
*/
|
|
153
|
+
export function publish(options) {
|
|
154
|
+
const packageAddress = options.package ?? '@local-pkg/miso';
|
|
155
|
+
const argumentsTypes = [
|
|
156
|
+
null,
|
|
157
|
+
null,
|
|
158
|
+
'0x2::clock::Clock'
|
|
159
|
+
];
|
|
160
|
+
const parameterNames = ["self", "_"];
|
|
161
|
+
return (tx) => tx.moveCall({
|
|
162
|
+
package: packageAddress,
|
|
163
|
+
module: 'recording',
|
|
164
|
+
function: 'publish',
|
|
165
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
166
|
+
typeArguments: options.typeArguments
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
/** Returns the recording's object ID. */
|
|
170
|
+
export function id(options) {
|
|
171
|
+
const packageAddress = options.package ?? '@local-pkg/miso';
|
|
172
|
+
const argumentsTypes = [
|
|
173
|
+
null
|
|
174
|
+
];
|
|
175
|
+
const parameterNames = ["self"];
|
|
176
|
+
return (tx) => tx.moveCall({
|
|
177
|
+
package: packageAddress,
|
|
178
|
+
module: 'recording',
|
|
179
|
+
function: 'id',
|
|
180
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
181
|
+
typeArguments: options.typeArguments
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
/** Returns a reference to the recording's UID for reading dynamic fields. */
|
|
185
|
+
export function uid(options) {
|
|
186
|
+
const packageAddress = options.package ?? '@local-pkg/miso';
|
|
187
|
+
const argumentsTypes = [
|
|
188
|
+
null
|
|
189
|
+
];
|
|
190
|
+
const parameterNames = ["self"];
|
|
191
|
+
return (tx) => tx.moveCall({
|
|
192
|
+
package: packageAddress,
|
|
193
|
+
module: 'recording',
|
|
194
|
+
function: 'uid',
|
|
195
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
196
|
+
typeArguments: options.typeArguments
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Returns a mutable reference to the recording's UID. Requires the admin
|
|
201
|
+
* capability. Works in any lifecycle state — dynamic fields are the extension
|
|
202
|
+
* surface (e.g. masters, credits) and stay admin-mutable after publish; only the
|
|
203
|
+
* embedded fields are frozen. The reference is root over every dynamic field on
|
|
204
|
+
* the object, including fields attached by other extensions.
|
|
205
|
+
*/
|
|
206
|
+
export function uidMut(options) {
|
|
207
|
+
const packageAddress = options.package ?? '@local-pkg/miso';
|
|
208
|
+
const argumentsTypes = [
|
|
209
|
+
null,
|
|
210
|
+
null
|
|
211
|
+
];
|
|
212
|
+
const parameterNames = ["self", "_"];
|
|
213
|
+
return (tx) => tx.moveCall({
|
|
214
|
+
package: packageAddress,
|
|
215
|
+
module: 'recording',
|
|
216
|
+
function: 'uid_mut',
|
|
217
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
218
|
+
typeArguments: options.typeArguments
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
//# sourceMappingURL=recording.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recording.js","sourceRoot":"","sources":["../../../src/contracts/miso/recording.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAGhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AAEH,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,sBAAsB,EAA+B,MAAM,mBAAmB,CAAC;AACzH,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACtC,OAAO,EAAoB,MAAM,0BAA0B,CAAC;AAC5D,MAAM,WAAW,GAAG,4BAA4B,CAAC;AACjD,sCAAsC;AACtC,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,QAAQ,CAAC,EAAE,IAAI,EAAE,GAAG,WAAW,kBAAkB,EAAE,MAAM,EAAE;QACrF,qDAAqD;QACrD,WAAW,EAAE,IAAI;QACjB,4EAA4E;QAC5E,SAAS,EAAE,GAAG,CAAC,GAAG,EAAE;KACvB,EAAE,CAAC,CAAC;AACT,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,UAAU,CAAC,EAAE,IAAI,EAAE,GAAG,WAAW,+DAA+D,EAAE,MAAM,EAAE;QAC/H,4CAA4C;QAC5C,EAAE,EAAE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