@misofm/sdk 0.9.0 → 0.11.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 +88 -56
- package/dist/client.d.ts +121 -18
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +200 -44
- package/dist/client.js.map +1 -1
- package/dist/contracts/composition_routed_stake/composition_routed_stake.d.ts +205 -0
- package/dist/contracts/composition_routed_stake/composition_routed_stake.d.ts.map +1 -0
- package/dist/contracts/composition_routed_stake/composition_routed_stake.js +184 -0
- package/dist/contracts/composition_routed_stake/composition_routed_stake.js.map +1 -0
- package/dist/contracts/composition_routed_stake/witness.d.ts +7 -0
- package/dist/contracts/composition_routed_stake/witness.d.ts.map +1 -0
- package/dist/contracts/composition_routed_stake/witness.js +9 -0
- package/dist/contracts/composition_routed_stake/witness.js.map +1 -0
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.d.ts +89 -28
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.d.ts.map +1 -1
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.js +84 -23
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.js.map +1 -1
- package/dist/contracts/composition_royalty_pool/witness.d.ts +6 -0
- package/dist/contracts/composition_royalty_pool/witness.d.ts.map +1 -0
- package/dist/contracts/composition_royalty_pool/witness.js +8 -0
- package/dist/contracts/composition_royalty_pool/witness.js.map +1 -0
- package/dist/contracts/genre/genre.d.ts +96 -0
- package/dist/contracts/genre/genre.d.ts.map +1 -0
- package/dist/contracts/genre/genre.js +107 -0
- package/dist/contracts/genre/genre.js.map +1 -0
- 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_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/recording_royalty_pool/recording_royalty_pool.d.ts +90 -28
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.d.ts.map +1 -1
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.js +84 -23
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.js.map +1 -1
- package/dist/contracts/recording_royalty_pool/witness.d.ts +6 -0
- package/dist/contracts/recording_royalty_pool/witness.d.ts.map +1 -0
- package/dist/contracts/recording_royalty_pool/witness.js +8 -0
- package/dist/contracts/recording_royalty_pool/witness.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_revenue_distributor/release_revenue_distributor.d.ts +106 -0
- package/dist/contracts/release_revenue_distributor/release_revenue_distributor.d.ts.map +1 -0
- package/dist/contracts/release_revenue_distributor/release_revenue_distributor.js +113 -0
- package/dist/contracts/release_revenue_distributor/release_revenue_distributor.js.map +1 -0
- package/dist/contracts/release_revenue_distributor/witness.d.ts +7 -0
- package/dist/contracts/release_revenue_distributor/witness.d.ts.map +1 -0
- package/dist/contracts/release_revenue_distributor/witness.js +9 -0
- package/dist/contracts/release_revenue_distributor/witness.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/pool.d.ts +27 -17
- package/dist/contracts/royalty_pool/pool.d.ts.map +1 -1
- package/dist/contracts/royalty_pool/pool.js +26 -17
- package/dist/contracts/royalty_pool/pool.js.map +1 -1
- package/dist/contracts/vault/deps/sui/bag.d.ts +35 -0
- package/dist/contracts/vault/deps/sui/bag.d.ts.map +1 -0
- package/dist/contracts/vault/deps/sui/bag.js +37 -0
- package/dist/contracts/vault/deps/sui/bag.js.map +1 -0
- package/dist/contracts/vault/deps/sui/borrow.d.ts +20 -0
- package/dist/contracts/vault/deps/sui/borrow.d.ts.map +1 -0
- package/dist/contracts/vault/deps/sui/borrow.js +21 -0
- package/dist/contracts/vault/deps/sui/borrow.js.map +1 -0
- package/dist/contracts/vault/vault.d.ts +276 -0
- package/dist/contracts/vault/vault.d.ts.map +1 -0
- package/dist/contracts/vault/vault.js +274 -0
- package/dist/contracts/vault/vault.js.map +1 -0
- package/dist/contracts.d.ts +13 -2
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js +15 -7
- package/dist/contracts.js.map +1 -1
- package/dist/cover.d.ts +17 -3
- package/dist/cover.d.ts.map +1 -1
- package/dist/cover.js +43 -20
- package/dist/cover.js.map +1 -1
- package/dist/credits.d.ts +31 -12
- package/dist/credits.d.ts.map +1 -1
- package/dist/credits.js +41 -25
- package/dist/credits.js.map +1 -1
- package/dist/deployments.d.ts +30 -57
- package/dist/deployments.d.ts.map +1 -1
- package/dist/deployments.js +5 -53
- package/dist/deployments.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/pressing.d.ts +8 -7
- package/dist/pressing.d.ts.map +1 -1
- package/dist/pressing.js +91 -32
- package/dist/pressing.js.map +1 -1
- package/dist/read/artist.js +3 -3
- package/dist/read/artist.js.map +1 -1
- package/dist/read/catalog.d.ts +14 -9
- package/dist/read/catalog.d.ts.map +1 -1
- package/dist/read/catalog.js +71 -37
- package/dist/read/catalog.js.map +1 -1
- package/dist/read/client.d.ts +4 -2
- package/dist/read/client.d.ts.map +1 -1
- package/dist/read/client.js +15 -4
- package/dist/read/client.js.map +1 -1
- package/dist/read/config.d.ts +14 -11
- package/dist/read/config.d.ts.map +1 -1
- package/dist/read/config.js +10 -37
- package/dist/read/config.js.map +1 -1
- package/dist/read/index.d.ts +2 -2
- package/dist/read/index.d.ts.map +1 -1
- package/dist/read/index.js +1 -1
- package/dist/read/index.js.map +1 -1
- package/dist/read/receipts.d.ts +24 -7
- package/dist/read/receipts.d.ts.map +1 -1
- package/dist/read/receipts.js +78 -25
- package/dist/read/receipts.js.map +1 -1
- package/dist/read/types.d.ts +43 -25
- package/dist/read/types.d.ts.map +1 -1
- package/dist/read/types.js +2 -2
- package/dist/read/types.js.map +1 -1
- package/dist/recording-extensions.d.ts +37 -0
- package/dist/recording-extensions.d.ts.map +1 -0
- package/dist/recording-extensions.js +61 -0
- package/dist/recording-extensions.js.map +1 -0
- package/dist/release-extensions.d.ts +84 -0
- package/dist/release-extensions.d.ts.map +1 -0
- package/dist/release-extensions.js +160 -0
- package/dist/release-extensions.js.map +1 -0
- package/dist/release-graph.d.ts +17 -26
- package/dist/release-graph.d.ts.map +1 -1
- package/dist/release-graph.js +55 -49
- package/dist/release-graph.js.map +1 -1
- package/dist/transactions.d.ts +43 -24
- package/dist/transactions.d.ts.map +1 -1
- package/dist/transactions.js +48 -27
- package/dist/transactions.js.map +1 -1
- package/dist/vault.d.ts +268 -0
- package/dist/vault.d.ts.map +1 -0
- package/dist/vault.js +389 -0
- package/dist/vault.js.map +1 -0
- package/package.json +17 -11
- package/src/client.ts +399 -61
- package/src/contracts/composition_routed_stake/composition_routed_stake.ts +346 -0
- package/src/contracts/composition_routed_stake/witness.ts +11 -0
- package/src/contracts/composition_royalty_pool/composition_royalty_pool.ts +151 -35
- package/src/contracts/composition_royalty_pool/witness.ts +7 -0
- package/src/contracts/genre/genre.ts +151 -0
- package/src/contracts/recording_advisory/recording_advisory.ts +315 -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/recording_royalty_pool/recording_royalty_pool.ts +152 -35
- package/src/contracts/recording_royalty_pool/witness.ts +7 -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_revenue_distributor/release_revenue_distributor.ts +178 -0
- package/src/contracts/release_revenue_distributor/witness.ts +11 -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/pool.ts +34 -24
- package/src/contracts/vault/deps/sui/bag.ts +39 -0
- package/src/contracts/vault/deps/sui/borrow.ts +25 -0
- package/src/contracts/vault/vault.ts +454 -0
- package/src/contracts.ts +16 -9
- package/src/cover.ts +62 -37
- package/src/credits.ts +64 -51
- package/src/deployments.ts +35 -97
- package/src/index.ts +11 -5
- package/src/pressing.ts +135 -39
- package/src/read/artist.ts +3 -3
- package/src/read/catalog.ts +99 -44
- package/src/read/client.ts +20 -4
- package/src/read/config.ts +23 -49
- package/src/read/index.ts +3 -1
- package/src/read/receipts.ts +103 -26
- package/src/read/types.ts +44 -27
- package/src/recording-extensions.ts +102 -0
- package/src/release-extensions.ts +261 -0
- package/src/release-graph.ts +68 -81
- package/src/transactions.ts +79 -53
- package/src/vault.ts +777 -0
- package/dist/contracts/miso_drop/drop.d.ts +0 -550
- package/dist/contracts/miso_drop/drop.d.ts.map +0 -1
- package/dist/contracts/miso_drop/drop.js +0 -523
- package/dist/contracts/miso_drop/drop.js.map +0 -1
- package/dist/contracts/release_registry/release_registry.d.ts +0 -114
- package/dist/contracts/release_registry/release_registry.d.ts.map +0 -1
- package/dist/contracts/release_registry/release_registry.js +0 -119
- package/dist/contracts/release_registry/release_registry.js.map +0 -1
- package/dist/drop.d.ts +0 -127
- package/dist/drop.d.ts.map +0 -1
- package/dist/drop.js +0 -202
- package/dist/drop.js.map +0 -1
- package/dist/extensions/royalty-pool.d.ts +0 -32
- package/dist/extensions/royalty-pool.d.ts.map +0 -1
- package/dist/extensions/royalty-pool.js +0 -33
- package/dist/extensions/royalty-pool.js.map +0 -1
- package/src/contracts/miso_drop/drop.ts +0 -798
- package/src/contracts/release_registry/release_registry.ts +0 -160
- package/src/drop.ts +0 -376
- package/src/extensions/royalty-pool.ts +0 -90
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The languages sung or spoken on a recording, stored as a dynamic field on the
|
|
8
|
+
* recording's UID and written through its cap-gated `uid_mut`.
|
|
9
|
+
*
|
|
10
|
+
* Its own package, for the same reason the advisory rating is: language is set by
|
|
11
|
+
* different people, at different times, and governed by a standard (ISO 639) that
|
|
12
|
+
* has nothing to do with any other fact about the recording. A consumer
|
|
13
|
+
* implementing a metadata profile picks this extension up or leaves it, and
|
|
14
|
+
* replacing it never disturbs anything else attached to the work.
|
|
15
|
+
*
|
|
16
|
+
* A `vector`, not a single code — bilingual and code-switching recordings are
|
|
17
|
+
* ordinary, and forcing one language would mean choosing which of them to erase.
|
|
18
|
+
* Order is the caller's: first is conventionally the predominant one.
|
|
19
|
+
*
|
|
20
|
+
* **An empty vector means instrumental** — attached, and asserting there is no
|
|
21
|
+
* sung or spoken content at all. That is a genuine claim about the recording and
|
|
22
|
+
* is deliberately distinct from attaching nothing, which says only that nobody has
|
|
23
|
+
* looked. `set_instrumental` exists so that claim reads as intent at the call site
|
|
24
|
+
* rather than as an empty argument someone might mistake for an oversight.
|
|
25
|
+
*
|
|
26
|
+
* `LanguageCode` is a valid ISO 639-1 code by construction, so this package checks
|
|
27
|
+
* only what construction cannot: how many, and whether any repeat.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
import { MoveTuple, MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';
|
|
31
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
32
|
+
import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
|
|
33
|
+
import * as language_code from './deps/language_code/language_code.js';
|
|
34
|
+
const $moduleName = '@local-pkg/recording_language::recording_language';
|
|
35
|
+
export const ExtensionKey = new MoveTuple({ name: `${$moduleName}::ExtensionKey`, fields: [bcs.bool()] });
|
|
36
|
+
export const LanguagesSetEvent = new MoveStruct({ name: `${$moduleName}::LanguagesSetEvent`, fields: {
|
|
37
|
+
recording_id: bcs.Address,
|
|
38
|
+
languages: bcs.vector(language_code.LanguageCode)
|
|
39
|
+
} });
|
|
40
|
+
export const LanguagesUnsetEvent = new MoveStruct({ name: `${$moduleName}::LanguagesUnsetEvent`, fields: {
|
|
41
|
+
recording_id: bcs.Address
|
|
42
|
+
} });
|
|
43
|
+
export interface SetLanguagesArguments {
|
|
44
|
+
self: RawTransactionArgument<string>;
|
|
45
|
+
cap: RawTransactionArgument<string>;
|
|
46
|
+
languages: TransactionArgument;
|
|
47
|
+
}
|
|
48
|
+
export interface SetLanguagesOptions {
|
|
49
|
+
package?: string;
|
|
50
|
+
arguments: SetLanguagesArguments | [
|
|
51
|
+
self: RawTransactionArgument<string>,
|
|
52
|
+
cap: RawTransactionArgument<string>,
|
|
53
|
+
languages: TransactionArgument
|
|
54
|
+
];
|
|
55
|
+
typeArguments: [
|
|
56
|
+
string,
|
|
57
|
+
string
|
|
58
|
+
];
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Sets (or replaces) the languages sung or spoken on the recording.
|
|
62
|
+
*
|
|
63
|
+
* Passing an empty vector asserts the recording is instrumental; prefer
|
|
64
|
+
* `set_instrumental`, which says so at the call site.
|
|
65
|
+
*/
|
|
66
|
+
export function setLanguages(options: SetLanguagesOptions) {
|
|
67
|
+
const packageAddress = options.package ?? '@local-pkg/recording_language';
|
|
68
|
+
const argumentsTypes = [
|
|
69
|
+
null,
|
|
70
|
+
null,
|
|
71
|
+
'vector<null>'
|
|
72
|
+
] satisfies (string | null)[];
|
|
73
|
+
const parameterNames = ["self", "cap", "languages"];
|
|
74
|
+
return (tx: Transaction) => tx.moveCall({
|
|
75
|
+
package: packageAddress,
|
|
76
|
+
module: 'recording_language',
|
|
77
|
+
function: 'set_languages',
|
|
78
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
79
|
+
typeArguments: options.typeArguments
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
export interface SetInstrumentalArguments {
|
|
83
|
+
self: RawTransactionArgument<string>;
|
|
84
|
+
cap: RawTransactionArgument<string>;
|
|
85
|
+
}
|
|
86
|
+
export interface SetInstrumentalOptions {
|
|
87
|
+
package?: string;
|
|
88
|
+
arguments: SetInstrumentalArguments | [
|
|
89
|
+
self: RawTransactionArgument<string>,
|
|
90
|
+
cap: RawTransactionArgument<string>
|
|
91
|
+
];
|
|
92
|
+
typeArguments: [
|
|
93
|
+
string,
|
|
94
|
+
string
|
|
95
|
+
];
|
|
96
|
+
}
|
|
97
|
+
/** Asserts the recording has no sung or spoken content. */
|
|
98
|
+
export function setInstrumental(options: SetInstrumentalOptions) {
|
|
99
|
+
const packageAddress = options.package ?? '@local-pkg/recording_language';
|
|
100
|
+
const argumentsTypes = [
|
|
101
|
+
null,
|
|
102
|
+
null
|
|
103
|
+
] satisfies (string | null)[];
|
|
104
|
+
const parameterNames = ["self", "cap"];
|
|
105
|
+
return (tx: Transaction) => tx.moveCall({
|
|
106
|
+
package: packageAddress,
|
|
107
|
+
module: 'recording_language',
|
|
108
|
+
function: 'set_instrumental',
|
|
109
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
110
|
+
typeArguments: options.typeArguments
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
export interface UnsetLanguagesArguments {
|
|
114
|
+
self: RawTransactionArgument<string>;
|
|
115
|
+
cap: RawTransactionArgument<string>;
|
|
116
|
+
}
|
|
117
|
+
export interface UnsetLanguagesOptions {
|
|
118
|
+
package?: string;
|
|
119
|
+
arguments: UnsetLanguagesArguments | [
|
|
120
|
+
self: RawTransactionArgument<string>,
|
|
121
|
+
cap: RawTransactionArgument<string>
|
|
122
|
+
];
|
|
123
|
+
typeArguments: [
|
|
124
|
+
string,
|
|
125
|
+
string
|
|
126
|
+
];
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Removes the language record, if any. Idempotent. Leaves the recording having
|
|
130
|
+
* said nothing — which is not the same as asserting it is instrumental.
|
|
131
|
+
*/
|
|
132
|
+
export function unsetLanguages(options: UnsetLanguagesOptions) {
|
|
133
|
+
const packageAddress = options.package ?? '@local-pkg/recording_language';
|
|
134
|
+
const argumentsTypes = [
|
|
135
|
+
null,
|
|
136
|
+
null
|
|
137
|
+
] satisfies (string | null)[];
|
|
138
|
+
const parameterNames = ["self", "cap"];
|
|
139
|
+
return (tx: Transaction) => tx.moveCall({
|
|
140
|
+
package: packageAddress,
|
|
141
|
+
module: 'recording_language',
|
|
142
|
+
function: 'unset_languages',
|
|
143
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
144
|
+
typeArguments: options.typeArguments
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
export interface HasLanguagesArguments {
|
|
148
|
+
self: RawTransactionArgument<string>;
|
|
149
|
+
}
|
|
150
|
+
export interface HasLanguagesOptions {
|
|
151
|
+
package?: string;
|
|
152
|
+
arguments: HasLanguagesArguments | [
|
|
153
|
+
self: RawTransactionArgument<string>
|
|
154
|
+
];
|
|
155
|
+
typeArguments: [
|
|
156
|
+
string,
|
|
157
|
+
string
|
|
158
|
+
];
|
|
159
|
+
}
|
|
160
|
+
/** Whether a language record is attached to this recording. */
|
|
161
|
+
export function hasLanguages(options: HasLanguagesOptions) {
|
|
162
|
+
const packageAddress = options.package ?? '@local-pkg/recording_language';
|
|
163
|
+
const argumentsTypes = [
|
|
164
|
+
null
|
|
165
|
+
] satisfies (string | null)[];
|
|
166
|
+
const parameterNames = ["self"];
|
|
167
|
+
return (tx: Transaction) => tx.moveCall({
|
|
168
|
+
package: packageAddress,
|
|
169
|
+
module: 'recording_language',
|
|
170
|
+
function: 'has_languages',
|
|
171
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
172
|
+
typeArguments: options.typeArguments
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
export interface LanguagesArguments {
|
|
176
|
+
self: RawTransactionArgument<string>;
|
|
177
|
+
}
|
|
178
|
+
export interface LanguagesOptions {
|
|
179
|
+
package?: string;
|
|
180
|
+
arguments: LanguagesArguments | [
|
|
181
|
+
self: RawTransactionArgument<string>
|
|
182
|
+
];
|
|
183
|
+
typeArguments: [
|
|
184
|
+
string,
|
|
185
|
+
string
|
|
186
|
+
];
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* The recording's languages, in the order given. Empty means instrumental. Aborts
|
|
190
|
+
* if nothing is attached — absence is a distinct state from an empty vector and
|
|
191
|
+
* must not collapse into it.
|
|
192
|
+
*/
|
|
193
|
+
export function languages(options: LanguagesOptions) {
|
|
194
|
+
const packageAddress = options.package ?? '@local-pkg/recording_language';
|
|
195
|
+
const argumentsTypes = [
|
|
196
|
+
null
|
|
197
|
+
] satisfies (string | null)[];
|
|
198
|
+
const parameterNames = ["self"];
|
|
199
|
+
return (tx: Transaction) => tx.moveCall({
|
|
200
|
+
package: packageAddress,
|
|
201
|
+
module: 'recording_language',
|
|
202
|
+
function: 'languages',
|
|
203
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
204
|
+
typeArguments: options.typeArguments
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
export interface IsInstrumentalArguments {
|
|
208
|
+
self: RawTransactionArgument<string>;
|
|
209
|
+
}
|
|
210
|
+
export interface IsInstrumentalOptions {
|
|
211
|
+
package?: string;
|
|
212
|
+
arguments: IsInstrumentalArguments | [
|
|
213
|
+
self: RawTransactionArgument<string>
|
|
214
|
+
];
|
|
215
|
+
typeArguments: [
|
|
216
|
+
string,
|
|
217
|
+
string
|
|
218
|
+
];
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Whether the recording asserts it is instrumental: attached, and empty. False
|
|
222
|
+
* when nothing is attached, because that asserts nothing.
|
|
223
|
+
*/
|
|
224
|
+
export function isInstrumental(options: IsInstrumentalOptions) {
|
|
225
|
+
const packageAddress = options.package ?? '@local-pkg/recording_language';
|
|
226
|
+
const argumentsTypes = [
|
|
227
|
+
null
|
|
228
|
+
] satisfies (string | null)[];
|
|
229
|
+
const parameterNames = ["self"];
|
|
230
|
+
return (tx: Transaction) => tx.moveCall({
|
|
231
|
+
package: packageAddress,
|
|
232
|
+
module: 'recording_language',
|
|
233
|
+
function: 'is_instrumental',
|
|
234
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
235
|
+
typeArguments: options.typeArguments
|
|
236
|
+
});
|
|
237
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
import { MoveEnum, MoveStruct, MoveTuple } from '../../../utils/index.js';
|
|
5
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
6
|
+
const $moduleName = 'ori::walrus_data';
|
|
7
|
+
/**
|
|
8
|
+
* Confidentiality of a stored blob: cleartext, or encrypted with an access policy.
|
|
9
|
+
* Only applies to standalone blobs — a quilt patch is a slice of a shared quilt
|
|
10
|
+
* blob and can never be the direct product of an encryption.
|
|
11
|
+
*/
|
|
12
|
+
export const Confidentiality = new MoveEnum({ name: `${$moduleName}::Confidentiality`, fields: {
|
|
13
|
+
/** The blob is stored in the clear. */
|
|
14
|
+
Unencrypted: null,
|
|
15
|
+
/**
|
|
16
|
+
* The blob is AES-encrypted. `dek` is the AES data-encryption key sealed via Seal
|
|
17
|
+
* — a small ciphertext stored on-chain, not the blob bytes. The sealed DEK is
|
|
18
|
+
* itself a Seal `EncryptedObject`, which already carries the decryption-policy
|
|
19
|
+
* package id, so no separate policy field is stored here. Decryption is gated by
|
|
20
|
+
* that policy package's `seal_approve`, not by this library.
|
|
21
|
+
*/
|
|
22
|
+
Encrypted: new MoveStruct({ name: `Confidentiality.Encrypted`, fields: {
|
|
23
|
+
dek: bcs.vector(bcs.u8())
|
|
24
|
+
} })
|
|
25
|
+
} });
|
|
26
|
+
/** Represents either a standalone Walrus blob or a patch within a quilt. */
|
|
27
|
+
export const WalrusData = new MoveEnum({ name: `${$moduleName}::WalrusData`, fields: {
|
|
28
|
+
/** A standalone Walrus blob. Fields: blob_id, confidentiality. */
|
|
29
|
+
Blob: new MoveTuple({ name: `WalrusData.Blob`, fields: [bcs.u256(), Confidentiality] }),
|
|
30
|
+
/**
|
|
31
|
+
* A patch within a Walrus quilt. Fields: quilt_id, version, start_index,
|
|
32
|
+
* end_index. Always a plaintext reference into a (possibly separately encrypted)
|
|
33
|
+
* quilt blob.
|
|
34
|
+
*/
|
|
35
|
+
QuiltPatch: new MoveTuple({ name: `WalrusData.QuiltPatch`, fields: [bcs.u256(), bcs.u8(), bcs.u16(), bcs.u16()] })
|
|
36
|
+
} });
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A pointer to a recording's master audio — nothing more.
|
|
8
|
+
*
|
|
9
|
+
* The value is a bare `ori::WalrusData` blob reference. This extension makes no
|
|
10
|
+
* claim about what the blob contains: not its codec, not its sample rate, not its
|
|
11
|
+
* duration, not that it is even audio. The only assertion is that the holder of
|
|
12
|
+
* the recording's admin cap says this blob is the master. Everything else is
|
|
13
|
+
* client-side convention.
|
|
14
|
+
*
|
|
15
|
+
* That thinness is the point. Miso's attested path — the Nautilus-verified master
|
|
16
|
+
* flow (`audio_ingester` producing a `miso_audio::Audio`), deferred — carries
|
|
17
|
+
* channel count, bit depth, sample rate, sample count and a PCM digest, and every
|
|
18
|
+
* one of those is backed by a Nautilus enclave signature over the measured audio.
|
|
19
|
+
* Until that path is running, stating the same fields _unverified_ would dress an
|
|
20
|
+
* assertion up as a measurement. A pointer cannot be mistaken for a measurement.
|
|
21
|
+
*
|
|
22
|
+
* # This extension is a holdover
|
|
23
|
+
*
|
|
24
|
+
* It exists to carry the catalogue until enclave ingestion is ready, and it is
|
|
25
|
+
* meant to be removed rather than grown. When a recording's master is ingested for
|
|
26
|
+
* real, attach the attested master via the ingester's master flow and call
|
|
27
|
+
* `unset_master_reference` here. The two never need to coexist, and this package
|
|
28
|
+
* deliberately holds nothing the attested path cannot restate.
|
|
29
|
+
*
|
|
30
|
+
* Resist adding fields. Anything worth asserting about the audio is worth
|
|
31
|
+
* attesting, and belongs in the ingested `Audio` rather than here.
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
import { MoveTuple, MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';
|
|
35
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
36
|
+
import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
|
|
37
|
+
import * as walrus_data from './deps/ori/walrus_data.js';
|
|
38
|
+
const $moduleName = '@local-pkg/recording_master_reference::recording_master_reference';
|
|
39
|
+
export const ExtensionKey = new MoveTuple({ name: `${$moduleName}::ExtensionKey`, fields: [bcs.bool()] });
|
|
40
|
+
export const MasterReferenceSetEvent = new MoveStruct({ name: `${$moduleName}::MasterReferenceSetEvent`, fields: {
|
|
41
|
+
recording_id: bcs.Address,
|
|
42
|
+
reference: walrus_data.WalrusData
|
|
43
|
+
} });
|
|
44
|
+
export const MasterReferenceUnsetEvent = new MoveStruct({ name: `${$moduleName}::MasterReferenceUnsetEvent`, fields: {
|
|
45
|
+
recording_id: bcs.Address
|
|
46
|
+
} });
|
|
47
|
+
export interface SetMasterReferenceArguments {
|
|
48
|
+
self: RawTransactionArgument<string>;
|
|
49
|
+
cap: RawTransactionArgument<string>;
|
|
50
|
+
reference: TransactionArgument;
|
|
51
|
+
}
|
|
52
|
+
export interface SetMasterReferenceOptions {
|
|
53
|
+
package?: string;
|
|
54
|
+
arguments: SetMasterReferenceArguments | [
|
|
55
|
+
self: RawTransactionArgument<string>,
|
|
56
|
+
cap: RawTransactionArgument<string>,
|
|
57
|
+
reference: TransactionArgument
|
|
58
|
+
];
|
|
59
|
+
typeArguments: [
|
|
60
|
+
string,
|
|
61
|
+
string
|
|
62
|
+
];
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Sets (or replaces) the recording's master reference.
|
|
66
|
+
*
|
|
67
|
+
* The reference must be a standalone blob. A quilt patch is rejected: a master is
|
|
68
|
+
* addressed and fetched on its own, and batching it with unrelated files would
|
|
69
|
+
* make its identity depend on what it happened to be stored alongside. Encrypted
|
|
70
|
+
* blobs are accepted — a sealed master is the expected shape once access control
|
|
71
|
+
* lands, and the reference is the same either way.
|
|
72
|
+
*/
|
|
73
|
+
export function setMasterReference(options: SetMasterReferenceOptions) {
|
|
74
|
+
const packageAddress = options.package ?? '@local-pkg/recording_master_reference';
|
|
75
|
+
const argumentsTypes = [
|
|
76
|
+
null,
|
|
77
|
+
null,
|
|
78
|
+
null
|
|
79
|
+
] satisfies (string | null)[];
|
|
80
|
+
const parameterNames = ["self", "cap", "reference"];
|
|
81
|
+
return (tx: Transaction) => tx.moveCall({
|
|
82
|
+
package: packageAddress,
|
|
83
|
+
module: 'recording_master_reference',
|
|
84
|
+
function: 'set_master_reference',
|
|
85
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
86
|
+
typeArguments: options.typeArguments
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
export interface UnsetMasterReferenceArguments {
|
|
90
|
+
self: RawTransactionArgument<string>;
|
|
91
|
+
cap: RawTransactionArgument<string>;
|
|
92
|
+
}
|
|
93
|
+
export interface UnsetMasterReferenceOptions {
|
|
94
|
+
package?: string;
|
|
95
|
+
arguments: UnsetMasterReferenceArguments | [
|
|
96
|
+
self: RawTransactionArgument<string>,
|
|
97
|
+
cap: RawTransactionArgument<string>
|
|
98
|
+
];
|
|
99
|
+
typeArguments: [
|
|
100
|
+
string,
|
|
101
|
+
string
|
|
102
|
+
];
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Removes the master reference, if any. Idempotent.
|
|
106
|
+
*
|
|
107
|
+
* The intended use is migration: once an attested master is attached via the
|
|
108
|
+
* Nautilus-verified master flow (deferred), this reference has nothing left to say
|
|
109
|
+
* and should go.
|
|
110
|
+
*/
|
|
111
|
+
export function unsetMasterReference(options: UnsetMasterReferenceOptions) {
|
|
112
|
+
const packageAddress = options.package ?? '@local-pkg/recording_master_reference';
|
|
113
|
+
const argumentsTypes = [
|
|
114
|
+
null,
|
|
115
|
+
null
|
|
116
|
+
] satisfies (string | null)[];
|
|
117
|
+
const parameterNames = ["self", "cap"];
|
|
118
|
+
return (tx: Transaction) => tx.moveCall({
|
|
119
|
+
package: packageAddress,
|
|
120
|
+
module: 'recording_master_reference',
|
|
121
|
+
function: 'unset_master_reference',
|
|
122
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
123
|
+
typeArguments: options.typeArguments
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
export interface HasMasterReferenceArguments {
|
|
127
|
+
self: RawTransactionArgument<string>;
|
|
128
|
+
}
|
|
129
|
+
export interface HasMasterReferenceOptions {
|
|
130
|
+
package?: string;
|
|
131
|
+
arguments: HasMasterReferenceArguments | [
|
|
132
|
+
self: RawTransactionArgument<string>
|
|
133
|
+
];
|
|
134
|
+
typeArguments: [
|
|
135
|
+
string,
|
|
136
|
+
string
|
|
137
|
+
];
|
|
138
|
+
}
|
|
139
|
+
/** Whether a master reference is attached to this recording. */
|
|
140
|
+
export function hasMasterReference(options: HasMasterReferenceOptions) {
|
|
141
|
+
const packageAddress = options.package ?? '@local-pkg/recording_master_reference';
|
|
142
|
+
const argumentsTypes = [
|
|
143
|
+
null
|
|
144
|
+
] satisfies (string | null)[];
|
|
145
|
+
const parameterNames = ["self"];
|
|
146
|
+
return (tx: Transaction) => tx.moveCall({
|
|
147
|
+
package: packageAddress,
|
|
148
|
+
module: 'recording_master_reference',
|
|
149
|
+
function: 'has_master_reference',
|
|
150
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
151
|
+
typeArguments: options.typeArguments
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
export interface MasterReferenceArguments {
|
|
155
|
+
self: RawTransactionArgument<string>;
|
|
156
|
+
}
|
|
157
|
+
export interface MasterReferenceOptions {
|
|
158
|
+
package?: string;
|
|
159
|
+
arguments: MasterReferenceArguments | [
|
|
160
|
+
self: RawTransactionArgument<string>
|
|
161
|
+
];
|
|
162
|
+
typeArguments: [
|
|
163
|
+
string,
|
|
164
|
+
string
|
|
165
|
+
];
|
|
166
|
+
}
|
|
167
|
+
/** The recording's master reference. Aborts if none is attached. */
|
|
168
|
+
export function masterReference(options: MasterReferenceOptions) {
|
|
169
|
+
const packageAddress = options.package ?? '@local-pkg/recording_master_reference';
|
|
170
|
+
const argumentsTypes = [
|
|
171
|
+
null
|
|
172
|
+
] satisfies (string | null)[];
|
|
173
|
+
const parameterNames = ["self"];
|
|
174
|
+
return (tx: Transaction) => tx.moveCall({
|
|
175
|
+
package: packageAddress,
|
|
176
|
+
module: 'recording_master_reference',
|
|
177
|
+
function: 'master_reference',
|
|
178
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
179
|
+
typeArguments: options.typeArguments
|
|
180
|
+
});
|
|
181
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
import { MoveEnum, MoveStruct, MoveTuple } from '../../../utils/index.js';
|
|
5
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
6
|
+
const $moduleName = 'ori::walrus_data';
|
|
7
|
+
/**
|
|
8
|
+
* Confidentiality of a stored blob: cleartext, or encrypted with an access policy.
|
|
9
|
+
* Only applies to standalone blobs — a quilt patch is a slice of a shared quilt
|
|
10
|
+
* blob and can never be the direct product of an encryption.
|
|
11
|
+
*/
|
|
12
|
+
export const Confidentiality = new MoveEnum({ name: `${$moduleName}::Confidentiality`, fields: {
|
|
13
|
+
/** The blob is stored in the clear. */
|
|
14
|
+
Unencrypted: null,
|
|
15
|
+
/**
|
|
16
|
+
* The blob is AES-encrypted. `dek` is the AES data-encryption key sealed via Seal
|
|
17
|
+
* — a small ciphertext stored on-chain, not the blob bytes. The sealed DEK is
|
|
18
|
+
* itself a Seal `EncryptedObject`, which already carries the decryption-policy
|
|
19
|
+
* package id, so no separate policy field is stored here. Decryption is gated by
|
|
20
|
+
* that policy package's `seal_approve`, not by this library.
|
|
21
|
+
*/
|
|
22
|
+
Encrypted: new MoveStruct({ name: `Confidentiality.Encrypted`, fields: {
|
|
23
|
+
dek: bcs.vector(bcs.u8())
|
|
24
|
+
} })
|
|
25
|
+
} });
|
|
26
|
+
/** Represents either a standalone Walrus blob or a patch within a quilt. */
|
|
27
|
+
export const WalrusData = new MoveEnum({ name: `${$moduleName}::WalrusData`, fields: {
|
|
28
|
+
/** A standalone Walrus blob. Fields: blob_id, confidentiality. */
|
|
29
|
+
Blob: new MoveTuple({ name: `WalrusData.Blob`, fields: [bcs.u256(), Confidentiality] }),
|
|
30
|
+
/**
|
|
31
|
+
* A patch within a Walrus quilt. Fields: quilt_id, version, start_index,
|
|
32
|
+
* end_index. Always a plaintext reference into a (possibly separately encrypted)
|
|
33
|
+
* quilt blob.
|
|
34
|
+
*/
|
|
35
|
+
QuiltPatch: new MoveTuple({ name: `WalrusData.QuiltPatch`, fields: [bcs.u256(), bcs.u8(), bcs.u16(), bcs.u16()] })
|
|
36
|
+
} });
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Recording audio preview: a short, public teaser clip for a recording, stored as
|
|
8
|
+
* a dynamic field on the recording's UID, set/cleared via the recording's
|
|
9
|
+
* cap-gated `uid_mut`.
|
|
10
|
+
*
|
|
11
|
+
* V1 is deliberately minimal: the value is a bare `ori::WalrusData` blob reference
|
|
12
|
+
* — no ingestion or attestation ties the preview to the recording's master. What
|
|
13
|
+
* the blob contains (codec, duration, clip offset) is client-side convention, not
|
|
14
|
+
* protocol state. An attested preview standard can ship later as its own extension
|
|
15
|
+
* without touching this one.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { MoveTuple, MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';
|
|
19
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
20
|
+
import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
|
|
21
|
+
import * as walrus_data from './deps/ori/walrus_data.js';
|
|
22
|
+
const $moduleName = '@local-pkg/recording_preview::recording_preview';
|
|
23
|
+
export const ExtensionKey = new MoveTuple({ name: `${$moduleName}::ExtensionKey`, fields: [bcs.bool()] });
|
|
24
|
+
export const PreviewSetEvent = new MoveStruct({ name: `${$moduleName}::PreviewSetEvent`, fields: {
|
|
25
|
+
recording_id: bcs.Address,
|
|
26
|
+
preview: walrus_data.WalrusData
|
|
27
|
+
} });
|
|
28
|
+
export const PreviewUnsetEvent = new MoveStruct({ name: `${$moduleName}::PreviewUnsetEvent`, fields: {
|
|
29
|
+
recording_id: bcs.Address
|
|
30
|
+
} });
|
|
31
|
+
export interface SetPreviewArguments {
|
|
32
|
+
self: RawTransactionArgument<string>;
|
|
33
|
+
cap: RawTransactionArgument<string>;
|
|
34
|
+
preview: TransactionArgument;
|
|
35
|
+
}
|
|
36
|
+
export interface SetPreviewOptions {
|
|
37
|
+
package?: string;
|
|
38
|
+
arguments: SetPreviewArguments | [
|
|
39
|
+
self: RawTransactionArgument<string>,
|
|
40
|
+
cap: RawTransactionArgument<string>,
|
|
41
|
+
preview: TransactionArgument
|
|
42
|
+
];
|
|
43
|
+
typeArguments: [
|
|
44
|
+
string,
|
|
45
|
+
string
|
|
46
|
+
];
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Sets (or replaces) the recording's preview. The reference must be a standalone
|
|
50
|
+
* Walrus blob.
|
|
51
|
+
*/
|
|
52
|
+
export function setPreview(options: SetPreviewOptions) {
|
|
53
|
+
const packageAddress = options.package ?? '@local-pkg/recording_preview';
|
|
54
|
+
const argumentsTypes = [
|
|
55
|
+
null,
|
|
56
|
+
null,
|
|
57
|
+
null
|
|
58
|
+
] satisfies (string | null)[];
|
|
59
|
+
const parameterNames = ["self", "cap", "preview"];
|
|
60
|
+
return (tx: Transaction) => tx.moveCall({
|
|
61
|
+
package: packageAddress,
|
|
62
|
+
module: 'recording_preview',
|
|
63
|
+
function: 'set_preview',
|
|
64
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
65
|
+
typeArguments: options.typeArguments
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
export interface UnsetPreviewArguments {
|
|
69
|
+
self: RawTransactionArgument<string>;
|
|
70
|
+
cap: RawTransactionArgument<string>;
|
|
71
|
+
}
|
|
72
|
+
export interface UnsetPreviewOptions {
|
|
73
|
+
package?: string;
|
|
74
|
+
arguments: UnsetPreviewArguments | [
|
|
75
|
+
self: RawTransactionArgument<string>,
|
|
76
|
+
cap: RawTransactionArgument<string>
|
|
77
|
+
];
|
|
78
|
+
typeArguments: [
|
|
79
|
+
string,
|
|
80
|
+
string
|
|
81
|
+
];
|
|
82
|
+
}
|
|
83
|
+
/** Removes the preview, if any. */
|
|
84
|
+
export function unsetPreview(options: UnsetPreviewOptions) {
|
|
85
|
+
const packageAddress = options.package ?? '@local-pkg/recording_preview';
|
|
86
|
+
const argumentsTypes = [
|
|
87
|
+
null,
|
|
88
|
+
null
|
|
89
|
+
] satisfies (string | null)[];
|
|
90
|
+
const parameterNames = ["self", "cap"];
|
|
91
|
+
return (tx: Transaction) => tx.moveCall({
|
|
92
|
+
package: packageAddress,
|
|
93
|
+
module: 'recording_preview',
|
|
94
|
+
function: 'unset_preview',
|
|
95
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
96
|
+
typeArguments: options.typeArguments
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
export interface HasPreviewArguments {
|
|
100
|
+
self: RawTransactionArgument<string>;
|
|
101
|
+
}
|
|
102
|
+
export interface HasPreviewOptions {
|
|
103
|
+
package?: string;
|
|
104
|
+
arguments: HasPreviewArguments | [
|
|
105
|
+
self: RawTransactionArgument<string>
|
|
106
|
+
];
|
|
107
|
+
typeArguments: [
|
|
108
|
+
string,
|
|
109
|
+
string
|
|
110
|
+
];
|
|
111
|
+
}
|
|
112
|
+
/** Returns whether a preview is attached to this recording. */
|
|
113
|
+
export function hasPreview(options: HasPreviewOptions) {
|
|
114
|
+
const packageAddress = options.package ?? '@local-pkg/recording_preview';
|
|
115
|
+
const argumentsTypes = [
|
|
116
|
+
null
|
|
117
|
+
] satisfies (string | null)[];
|
|
118
|
+
const parameterNames = ["self"];
|
|
119
|
+
return (tx: Transaction) => tx.moveCall({
|
|
120
|
+
package: packageAddress,
|
|
121
|
+
module: 'recording_preview',
|
|
122
|
+
function: 'has_preview',
|
|
123
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
124
|
+
typeArguments: options.typeArguments
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
export interface PreviewArguments {
|
|
128
|
+
self: RawTransactionArgument<string>;
|
|
129
|
+
}
|
|
130
|
+
export interface PreviewOptions {
|
|
131
|
+
package?: string;
|
|
132
|
+
arguments: PreviewArguments | [
|
|
133
|
+
self: RawTransactionArgument<string>
|
|
134
|
+
];
|
|
135
|
+
typeArguments: [
|
|
136
|
+
string,
|
|
137
|
+
string
|
|
138
|
+
];
|
|
139
|
+
}
|
|
140
|
+
/** Borrows the preview's Walrus reference. Aborts if none is attached. */
|
|
141
|
+
export function preview(options: PreviewOptions) {
|
|
142
|
+
const packageAddress = options.package ?? '@local-pkg/recording_preview';
|
|
143
|
+
const argumentsTypes = [
|
|
144
|
+
null
|
|
145
|
+
] satisfies (string | null)[];
|
|
146
|
+
const parameterNames = ["self"];
|
|
147
|
+
return (tx: Transaction) => tx.moveCall({
|
|
148
|
+
package: packageAddress,
|
|
149
|
+
module: 'recording_preview',
|
|
150
|
+
function: 'preview',
|
|
151
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
152
|
+
typeArguments: options.typeArguments
|
|
153
|
+
});
|
|
154
|
+
}
|