@misonetwork/sdk 0.2.2 → 0.3.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 +44 -98
- package/dist/contracts.d.ts +0 -12
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js +3 -16
- package/dist/contracts.js.map +1 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/internal.d.ts +0 -3
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +0 -4
- package/dist/internal.js.map +1 -1
- package/dist/queries.d.ts.map +1 -1
- package/dist/queries.js.map +1 -1
- package/package.json +1 -13
- package/src/contracts.ts +3 -19
- package/src/index.ts +3 -3
- package/src/internal.ts +10 -15
- package/src/queries.ts +5 -4
- package/dist/contracts/composition_credits/composition_credits.d.ts +0 -181
- package/dist/contracts/composition_credits/composition_credits.d.ts.map +0 -1
- package/dist/contracts/composition_credits/composition_credits.js +0 -109
- package/dist/contracts/composition_credits/composition_credits.js.map +0 -1
- package/dist/contracts/composition_credits/composition_party_role.d.ts +0 -119
- package/dist/contracts/composition_credits/composition_party_role.d.ts.map +0 -1
- package/dist/contracts/composition_credits/composition_party_role.js +0 -139
- package/dist/contracts/composition_credits/composition_party_role.js.map +0 -1
- package/dist/contracts/composition_credits/deps/miso_credit/credit.d.ts +0 -24
- package/dist/contracts/composition_credits/deps/miso_credit/credit.d.ts.map +0 -1
- package/dist/contracts/composition_credits/deps/miso_credit/credit.js +0 -23
- package/dist/contracts/composition_credits/deps/miso_credit/credit.js.map +0 -1
- package/dist/contracts/composition_credits/deps/sui/vec_map.d.ts +0 -37
- package/dist/contracts/composition_credits/deps/sui/vec_map.d.ts.map +0 -1
- package/dist/contracts/composition_credits/deps/sui/vec_map.js +0 -28
- package/dist/contracts/composition_credits/deps/sui/vec_map.js.map +0 -1
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.d.ts +0 -87
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.d.ts.map +0 -1
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.js +0 -80
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.js.map +0 -1
- package/dist/contracts/cover_art/cover_art.d.ts +0 -85
- package/dist/contracts/cover_art/cover_art.d.ts.map +0 -1
- package/dist/contracts/cover_art/cover_art.js +0 -68
- package/dist/contracts/cover_art/cover_art.js.map +0 -1
- package/dist/contracts/cover_art/deps/ori/walrus_data.d.ts +0 -52
- package/dist/contracts/cover_art/deps/ori/walrus_data.d.ts.map +0 -1
- package/dist/contracts/cover_art/deps/ori/walrus_data.js +0 -37
- package/dist/contracts/cover_art/deps/ori/walrus_data.js.map +0 -1
- package/dist/contracts/recording_credits/deps/miso_credit/credit.d.ts +0 -24
- package/dist/contracts/recording_credits/deps/miso_credit/credit.d.ts.map +0 -1
- package/dist/contracts/recording_credits/deps/miso_credit/credit.js +0 -23
- package/dist/contracts/recording_credits/deps/miso_credit/credit.js.map +0 -1
- package/dist/contracts/recording_credits/deps/sui/vec_map.d.ts +0 -37
- package/dist/contracts/recording_credits/deps/sui/vec_map.d.ts.map +0 -1
- package/dist/contracts/recording_credits/deps/sui/vec_map.js +0 -28
- package/dist/contracts/recording_credits/deps/sui/vec_map.js.map +0 -1
- package/dist/contracts/recording_credits/deps/sui/vec_set.d.ts +0 -21
- package/dist/contracts/recording_credits/deps/sui/vec_set.d.ts.map +0 -1
- package/dist/contracts/recording_credits/deps/sui/vec_set.js +0 -20
- package/dist/contracts/recording_credits/deps/sui/vec_set.js.map +0 -1
- package/dist/contracts/recording_credits/recording_credits.d.ts +0 -2313
- package/dist/contracts/recording_credits/recording_credits.d.ts.map +0 -1
- package/dist/contracts/recording_credits/recording_credits.js +0 -270
- package/dist/contracts/recording_credits/recording_credits.js.map +0 -1
- package/dist/contracts/recording_credits/recording_party_role.d.ts +0 -1174
- package/dist/contracts/recording_credits/recording_party_role.d.ts.map +0 -1
- package/dist/contracts/recording_credits/recording_party_role.js +0 -692
- package/dist/contracts/recording_credits/recording_party_role.js.map +0 -1
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.d.ts +0 -90
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.d.ts.map +0 -1
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.js +0 -80
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.js.map +0 -1
- package/dist/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.d.ts +0 -52
- package/dist/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.d.ts.map +0 -1
- package/dist/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.js +0 -37
- package/dist/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.js.map +0 -1
- package/dist/contracts/release_cover_art/deps/cover_art/cover_art.d.ts +0 -46
- package/dist/contracts/release_cover_art/deps/cover_art/cover_art.d.ts.map +0 -1
- package/dist/contracts/release_cover_art/deps/cover_art/cover_art.js +0 -21
- package/dist/contracts/release_cover_art/deps/cover_art/cover_art.js.map +0 -1
- package/dist/contracts/release_cover_art/deps/per_track/per_track.d.ts +0 -33
- package/dist/contracts/release_cover_art/deps/per_track/per_track.d.ts.map +0 -1
- package/dist/contracts/release_cover_art/deps/per_track/per_track.js +0 -32
- package/dist/contracts/release_cover_art/deps/per_track/per_track.js.map +0 -1
- package/dist/contracts/release_cover_art/release_cover_art.d.ts +0 -300
- package/dist/contracts/release_cover_art/release_cover_art.d.ts.map +0 -1
- package/dist/contracts/release_cover_art/release_cover_art.js +0 -168
- package/dist/contracts/release_cover_art/release_cover_art.js.map +0 -1
- package/dist/contracts/release_credits/deps/miso_credit/credit.d.ts +0 -24
- package/dist/contracts/release_credits/deps/miso_credit/credit.d.ts.map +0 -1
- package/dist/contracts/release_credits/deps/miso_credit/credit.js +0 -23
- package/dist/contracts/release_credits/deps/miso_credit/credit.js.map +0 -1
- package/dist/contracts/release_credits/deps/sui/vec_map.d.ts +0 -37
- package/dist/contracts/release_credits/deps/sui/vec_map.d.ts.map +0 -1
- package/dist/contracts/release_credits/deps/sui/vec_map.js +0 -28
- package/dist/contracts/release_credits/deps/sui/vec_map.js.map +0 -1
- package/dist/contracts/release_credits/release_credits.d.ts +0 -142
- package/dist/contracts/release_credits/release_credits.d.ts.map +0 -1
- package/dist/contracts/release_credits/release_credits.js +0 -108
- package/dist/contracts/release_credits/release_credits.js.map +0 -1
- package/dist/contracts/release_credits/release_party_role.d.ts +0 -58
- package/dist/contracts/release_credits/release_party_role.d.ts.map +0 -1
- package/dist/contracts/release_credits/release_party_role.js +0 -66
- package/dist/contracts/release_credits/release_party_role.js.map +0 -1
- package/dist/contracts/royalty_pool/deps/std/type_name.d.ts +0 -18
- package/dist/contracts/royalty_pool/deps/std/type_name.d.ts.map +0 -1
- package/dist/contracts/royalty_pool/deps/std/type_name.js +0 -20
- package/dist/contracts/royalty_pool/deps/std/type_name.js.map +0 -1
- package/dist/contracts/royalty_pool/deps/sui/balance.d.ts +0 -13
- package/dist/contracts/royalty_pool/deps/sui/balance.d.ts.map +0 -1
- package/dist/contracts/royalty_pool/deps/sui/balance.js +0 -15
- package/dist/contracts/royalty_pool/deps/sui/balance.js.map +0 -1
- package/dist/contracts/royalty_pool/deps/sui/vec_map.d.ts +0 -37
- package/dist/contracts/royalty_pool/deps/sui/vec_map.d.ts.map +0 -1
- package/dist/contracts/royalty_pool/deps/sui/vec_map.js +0 -28
- package/dist/contracts/royalty_pool/deps/sui/vec_map.js.map +0 -1
- package/dist/contracts/royalty_pool/pool.d.ts +0 -358
- package/dist/contracts/royalty_pool/pool.d.ts.map +0 -1
- package/dist/contracts/royalty_pool/pool.js +0 -352
- package/dist/contracts/royalty_pool/pool.js.map +0 -1
- package/dist/contracts/royalty_pool/stake.d.ts +0 -202
- package/dist/contracts/royalty_pool/stake.d.ts.map +0 -1
- package/dist/contracts/royalty_pool/stake.js +0 -197
- package/dist/contracts/royalty_pool/stake.js.map +0 -1
- package/dist/cover.d.ts +0 -48
- package/dist/cover.d.ts.map +0 -1
- package/dist/cover.js +0 -68
- package/dist/cover.js.map +0 -1
- package/dist/credits.d.ts +0 -171
- package/dist/credits.d.ts.map +0 -1
- package/dist/credits.js +0 -360
- package/dist/credits.js.map +0 -1
- package/dist/extensions/royalty-pool.d.ts +0 -32
- package/dist/extensions/royalty-pool.d.ts.map +0 -1
- package/dist/extensions/royalty-pool.js +0 -33
- package/dist/extensions/royalty-pool.js.map +0 -1
- package/src/contracts/composition_credits/composition_credits.ts +0 -169
- package/src/contracts/composition_credits/composition_party_role.ts +0 -189
- package/src/contracts/composition_credits/deps/miso_credit/credit.ts +0 -27
- package/src/contracts/composition_credits/deps/sui/vec_map.ts +0 -33
- package/src/contracts/composition_royalty_pool/composition_royalty_pool.ts +0 -135
- package/src/contracts/cover_art/cover_art.ts +0 -99
- package/src/contracts/cover_art/deps/ori/walrus_data.ts +0 -36
- package/src/contracts/recording_credits/deps/miso_credit/credit.ts +0 -27
- package/src/contracts/recording_credits/deps/sui/vec_map.ts +0 -33
- package/src/contracts/recording_credits/deps/sui/vec_set.ts +0 -21
- package/src/contracts/recording_credits/recording_credits.ts +0 -458
- package/src/contracts/recording_credits/recording_party_role.ts +0 -1041
- package/src/contracts/recording_royalty_pool/recording_royalty_pool.ts +0 -138
- package/src/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.ts +0 -36
- package/src/contracts/release_cover_art/deps/cover_art/cover_art.ts +0 -23
- package/src/contracts/release_cover_art/deps/per_track/per_track.ts +0 -36
- package/src/contracts/release_cover_art/release_cover_art.ts +0 -251
- package/src/contracts/release_credits/deps/miso_credit/credit.ts +0 -27
- package/src/contracts/release_credits/deps/sui/vec_map.ts +0 -33
- package/src/contracts/release_credits/release_credits.ts +0 -156
- package/src/contracts/release_credits/release_party_role.ts +0 -87
- package/src/contracts/royalty_pool/deps/std/type_name.ts +0 -22
- package/src/contracts/royalty_pool/deps/sui/balance.ts +0 -17
- package/src/contracts/royalty_pool/deps/sui/vec_map.ts +0 -33
- package/src/contracts/royalty_pool/pool.ts +0 -577
- package/src/contracts/royalty_pool/stake.ts +0 -317
- package/src/cover.ts +0 -136
- package/src/credits.ts +0 -645
- package/src/extensions/royalty-pool.ts +0 -85
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
/**************************************************************
|
|
2
|
-
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
-
**************************************************************/
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Cap-gated royalty-pool extension for `Recording`.
|
|
8
|
-
*
|
|
9
|
-
* Royalty payers send `Coin<Currency>` directly to the recording's address — a
|
|
10
|
-
* stable, well-known inbox available from the recording's creation. The recording
|
|
11
|
-
* admin (cap holder) folds those funds into the underlying
|
|
12
|
-
* `royalty_pool::pool::RoyaltyPool` via `receive_and_deposit` (for direct coin
|
|
13
|
-
* transfers) or `redeem_and_deposit` (for funds-accumulator balances).
|
|
14
|
-
*
|
|
15
|
-
* All three entry points require `&RecordingAdminCap`, so timing of fold
|
|
16
|
-
* operations stays under admin control.
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
|
|
20
|
-
import { normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';
|
|
21
|
-
export interface InitializePoolArguments {
|
|
22
|
-
recording: RawTransactionArgument<string>;
|
|
23
|
-
cap: RawTransactionArgument<string>;
|
|
24
|
-
}
|
|
25
|
-
export interface InitializePoolOptions {
|
|
26
|
-
package?: string;
|
|
27
|
-
arguments: InitializePoolArguments | [
|
|
28
|
-
recording: RawTransactionArgument<string>,
|
|
29
|
-
cap: RawTransactionArgument<string>
|
|
30
|
-
];
|
|
31
|
-
typeArguments: [
|
|
32
|
-
string,
|
|
33
|
-
string,
|
|
34
|
-
string
|
|
35
|
-
];
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Create a royalty pool for a recording. Pool address derives from
|
|
39
|
-
* `(recording_id, Currency)` — calling twice with the same Currency aborts because
|
|
40
|
-
* the address is already claimed.
|
|
41
|
-
*/
|
|
42
|
-
export function initializePool(options: InitializePoolOptions) {
|
|
43
|
-
const packageAddress = options.package ?? '@local-pkg/recording_royalty_pool';
|
|
44
|
-
const argumentsTypes = [
|
|
45
|
-
null,
|
|
46
|
-
null
|
|
47
|
-
] satisfies (string | null)[];
|
|
48
|
-
const parameterNames = ["recording", "cap"];
|
|
49
|
-
return (tx: Transaction) => tx.moveCall({
|
|
50
|
-
package: packageAddress,
|
|
51
|
-
module: 'recording_royalty_pool',
|
|
52
|
-
function: 'initialize_pool',
|
|
53
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
54
|
-
typeArguments: options.typeArguments
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
export interface ReceiveAndDepositArguments {
|
|
58
|
-
recording: RawTransactionArgument<string>;
|
|
59
|
-
cap: RawTransactionArgument<string>;
|
|
60
|
-
coins: TransactionArgument;
|
|
61
|
-
pool: RawTransactionArgument<string>;
|
|
62
|
-
}
|
|
63
|
-
export interface ReceiveAndDepositOptions {
|
|
64
|
-
package?: string;
|
|
65
|
-
arguments: ReceiveAndDepositArguments | [
|
|
66
|
-
recording: RawTransactionArgument<string>,
|
|
67
|
-
cap: RawTransactionArgument<string>,
|
|
68
|
-
coins: TransactionArgument,
|
|
69
|
-
pool: RawTransactionArgument<string>
|
|
70
|
-
];
|
|
71
|
-
typeArguments: [
|
|
72
|
-
string,
|
|
73
|
-
string,
|
|
74
|
-
string
|
|
75
|
-
];
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Receive `Coin<Currency>` objects sent to the recording's address and fold them
|
|
79
|
-
* into the pool's accumulator.
|
|
80
|
-
*/
|
|
81
|
-
export function receiveAndDeposit(options: ReceiveAndDepositOptions) {
|
|
82
|
-
const packageAddress = options.package ?? '@local-pkg/recording_royalty_pool';
|
|
83
|
-
const argumentsTypes = [
|
|
84
|
-
null,
|
|
85
|
-
null,
|
|
86
|
-
'vector<null>',
|
|
87
|
-
null
|
|
88
|
-
] satisfies (string | null)[];
|
|
89
|
-
const parameterNames = ["recording", "cap", "coins", "pool"];
|
|
90
|
-
return (tx: Transaction) => tx.moveCall({
|
|
91
|
-
package: packageAddress,
|
|
92
|
-
module: 'recording_royalty_pool',
|
|
93
|
-
function: 'receive_and_deposit',
|
|
94
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
95
|
-
typeArguments: options.typeArguments
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
export interface RedeemAndDepositArguments {
|
|
99
|
-
recording: RawTransactionArgument<string>;
|
|
100
|
-
cap: RawTransactionArgument<string>;
|
|
101
|
-
value: RawTransactionArgument<number | bigint>;
|
|
102
|
-
pool: RawTransactionArgument<string>;
|
|
103
|
-
}
|
|
104
|
-
export interface RedeemAndDepositOptions {
|
|
105
|
-
package?: string;
|
|
106
|
-
arguments: RedeemAndDepositArguments | [
|
|
107
|
-
recording: RawTransactionArgument<string>,
|
|
108
|
-
cap: RawTransactionArgument<string>,
|
|
109
|
-
value: RawTransactionArgument<number | bigint>,
|
|
110
|
-
pool: RawTransactionArgument<string>
|
|
111
|
-
];
|
|
112
|
-
typeArguments: [
|
|
113
|
-
string,
|
|
114
|
-
string,
|
|
115
|
-
string
|
|
116
|
-
];
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Redeem `value` base units from the recording's funds accumulator and fold the
|
|
120
|
-
* resulting balance into the pool's accumulator.
|
|
121
|
-
*/
|
|
122
|
-
export function redeemAndDeposit(options: RedeemAndDepositOptions) {
|
|
123
|
-
const packageAddress = options.package ?? '@local-pkg/recording_royalty_pool';
|
|
124
|
-
const argumentsTypes = [
|
|
125
|
-
null,
|
|
126
|
-
null,
|
|
127
|
-
'u64',
|
|
128
|
-
null
|
|
129
|
-
] satisfies (string | null)[];
|
|
130
|
-
const parameterNames = ["recording", "cap", "value", "pool"];
|
|
131
|
-
return (tx: Transaction) => tx.moveCall({
|
|
132
|
-
package: packageAddress,
|
|
133
|
-
module: 'recording_royalty_pool',
|
|
134
|
-
function: 'redeem_and_deposit',
|
|
135
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
136
|
-
typeArguments: options.typeArguments
|
|
137
|
-
});
|
|
138
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
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 = '0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78::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
|
-
} });
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**************************************************************
|
|
2
|
-
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
-
**************************************************************/
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* The evolvable cover art value used by the recording/release cover art
|
|
8
|
-
* extensions.
|
|
9
|
-
*
|
|
10
|
-
* CoverArt format changes over time (static-only → +animated → future formats).
|
|
11
|
-
* Keeping it in an extension rather than immutable core means a new format is a
|
|
12
|
-
* republish of this small package (or a brand-new cover art standard), not of the
|
|
13
|
-
* frozen protocol. `CoverArt` references external storage via `ori::WalrusData`.
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
import { MoveStruct } from '../../../utils/index.js';
|
|
17
|
-
import { bcs } from '@mysten/sui/bcs';
|
|
18
|
-
import * as walrus_data from '../0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.js';
|
|
19
|
-
const $moduleName = 'cover_art::cover_art';
|
|
20
|
-
export const CoverArt = new MoveStruct({ name: `${$moduleName}::CoverArt`, fields: {
|
|
21
|
-
still: walrus_data.WalrusData,
|
|
22
|
-
animated: bcs.option(walrus_data.WalrusData)
|
|
23
|
-
} });
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**************************************************************
|
|
2
|
-
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
-
**************************************************************/
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* `PerTrack<Data>` — one `Data` value per track of a release, held in tracklist
|
|
8
|
-
* order.
|
|
9
|
-
*
|
|
10
|
-
* A release's tracks are a flat, ordered `vector<Track>`, frozen at release
|
|
11
|
-
* creation. `PerTrack` is the parallel array to that list: index `i` holds the
|
|
12
|
-
* payload for the `i`-th track. It is the shared shape behind per-track release
|
|
13
|
-
* metadata such as cover art (`PerTrack<Option<CoverArt>>`) or genre — and the
|
|
14
|
-
* natural home for display grouping (disc/side boundaries), which core
|
|
15
|
-
* deliberately does not store.
|
|
16
|
-
*
|
|
17
|
-
* Construction reads the `Release` and sizes/validates the array against the
|
|
18
|
-
* tracklist length, so a `PerTrack` is parallel to the tracklist _by construction_
|
|
19
|
-
* — an extension cannot attach a misaligned array. Because a release's tracklist
|
|
20
|
-
* is frozen at creation, that alignment holds for the release's whole life.
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
import { type BcsType, bcs } from '@mysten/sui/bcs';
|
|
24
|
-
import { MoveTuple } from '../../../utils/index.js';
|
|
25
|
-
const $moduleName = 'per_track::per_track';
|
|
26
|
-
/**
|
|
27
|
-
* One `Data` per track, indexed by the release's tracklist position. `Data` is the
|
|
28
|
-
* per-track payload — e.g. `CoverArt` when every track carries one, or
|
|
29
|
-
* `Option<CoverArt>` for override-style metadata layered over an album-level
|
|
30
|
-
* default.
|
|
31
|
-
*/
|
|
32
|
-
export function PerTrack<Data extends BcsType<any>>(...typeParameters: [
|
|
33
|
-
Data
|
|
34
|
-
]) {
|
|
35
|
-
return new MoveTuple({ name: `${$moduleName}::PerTrack<${typeParameters[0].name as Data['name']}>`, fields: [bcs.vector(typeParameters[0])] });
|
|
36
|
-
}
|
|
@@ -1,251 +0,0 @@
|
|
|
1
|
-
/**************************************************************
|
|
2
|
-
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
-
**************************************************************/
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Release cover art: an album-level cover plus optional per-track cover overrides.
|
|
8
|
-
* Stored as a dynamic field on the release's UID, set/cleared via the release's
|
|
9
|
-
* cap-gated `uid_mut`.
|
|
10
|
-
*
|
|
11
|
-
* Cover art is presentation, not objective recording data, so it lives on the
|
|
12
|
-
* release (the consumer object) rather than the recording. A track's effective
|
|
13
|
-
* cover resolves as: its per-track override if set, else the album cover. The
|
|
14
|
-
* overrides are a `PerTrack<Option<CoverArt>>` — one slot per track, aligned to
|
|
15
|
-
* the release's tracklist by construction (sized from `tracks().length()`).
|
|
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 cover_art from './deps/cover_art/cover_art.js';
|
|
22
|
-
import * as per_track from './deps/per_track/per_track.js';
|
|
23
|
-
const $moduleName = '@local-pkg/release_cover_art::release_cover_art';
|
|
24
|
-
export const ExtensionKey = new MoveTuple({ name: `${$moduleName}::ExtensionKey`, fields: [bcs.bool()] });
|
|
25
|
-
export const ReleaseCoverArt = new MoveStruct({ name: `${$moduleName}::ReleaseCoverArt`, fields: {
|
|
26
|
-
cover: bcs.option(cover_art.CoverArt),
|
|
27
|
-
track_covers: per_track.PerTrack(bcs.option(cover_art.CoverArt))
|
|
28
|
-
} });
|
|
29
|
-
export const CoverSetEvent = new MoveStruct({ name: `${$moduleName}::CoverSetEvent`, fields: {
|
|
30
|
-
release_id: bcs.Address,
|
|
31
|
-
/** The full cover art record that was written. */
|
|
32
|
-
art: cover_art.CoverArt
|
|
33
|
-
} });
|
|
34
|
-
export const CoverUnsetEvent = new MoveStruct({ name: `${$moduleName}::CoverUnsetEvent`, fields: {
|
|
35
|
-
release_id: bcs.Address
|
|
36
|
-
} });
|
|
37
|
-
export const TrackCoverSetEvent = new MoveStruct({ name: `${$moduleName}::TrackCoverSetEvent`, fields: {
|
|
38
|
-
release_id: bcs.Address,
|
|
39
|
-
track_index: bcs.u64(),
|
|
40
|
-
/** The full cover art record that was written. */
|
|
41
|
-
art: cover_art.CoverArt
|
|
42
|
-
} });
|
|
43
|
-
export const TrackCoverUnsetEvent = new MoveStruct({ name: `${$moduleName}::TrackCoverUnsetEvent`, fields: {
|
|
44
|
-
release_id: bcs.Address,
|
|
45
|
-
track_index: bcs.u64()
|
|
46
|
-
} });
|
|
47
|
-
export interface SetCoverArguments {
|
|
48
|
-
self: RawTransactionArgument<string>;
|
|
49
|
-
cap: RawTransactionArgument<string>;
|
|
50
|
-
art: TransactionArgument;
|
|
51
|
-
}
|
|
52
|
-
export interface SetCoverOptions {
|
|
53
|
-
package?: string;
|
|
54
|
-
arguments: SetCoverArguments | [
|
|
55
|
-
self: RawTransactionArgument<string>,
|
|
56
|
-
cap: RawTransactionArgument<string>,
|
|
57
|
-
art: TransactionArgument
|
|
58
|
-
];
|
|
59
|
-
}
|
|
60
|
-
/** Sets (or replaces) the album-level cover. */
|
|
61
|
-
export function setCover(options: SetCoverOptions) {
|
|
62
|
-
const packageAddress = options.package ?? '@local-pkg/release_cover_art';
|
|
63
|
-
const argumentsTypes = [
|
|
64
|
-
null,
|
|
65
|
-
null,
|
|
66
|
-
null
|
|
67
|
-
] satisfies (string | null)[];
|
|
68
|
-
const parameterNames = ["self", "cap", "art"];
|
|
69
|
-
return (tx: Transaction) => tx.moveCall({
|
|
70
|
-
package: packageAddress,
|
|
71
|
-
module: 'release_cover_art',
|
|
72
|
-
function: 'set_cover',
|
|
73
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
export interface UnsetCoverArguments {
|
|
77
|
-
self: RawTransactionArgument<string>;
|
|
78
|
-
cap: RawTransactionArgument<string>;
|
|
79
|
-
}
|
|
80
|
-
export interface UnsetCoverOptions {
|
|
81
|
-
package?: string;
|
|
82
|
-
arguments: UnsetCoverArguments | [
|
|
83
|
-
self: RawTransactionArgument<string>,
|
|
84
|
-
cap: RawTransactionArgument<string>
|
|
85
|
-
];
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Removes the album-level cover. Per-track overrides are untouched. Aborts with
|
|
89
|
-
* `ENoCoverArt` if no cover art record is attached.
|
|
90
|
-
*/
|
|
91
|
-
export function unsetCover(options: UnsetCoverOptions) {
|
|
92
|
-
const packageAddress = options.package ?? '@local-pkg/release_cover_art';
|
|
93
|
-
const argumentsTypes = [
|
|
94
|
-
null,
|
|
95
|
-
null
|
|
96
|
-
] satisfies (string | null)[];
|
|
97
|
-
const parameterNames = ["self", "cap"];
|
|
98
|
-
return (tx: Transaction) => tx.moveCall({
|
|
99
|
-
package: packageAddress,
|
|
100
|
-
module: 'release_cover_art',
|
|
101
|
-
function: 'unset_cover',
|
|
102
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
export interface SetTrackCoverArguments {
|
|
106
|
-
self: RawTransactionArgument<string>;
|
|
107
|
-
cap: RawTransactionArgument<string>;
|
|
108
|
-
trackIndex: RawTransactionArgument<number | bigint>;
|
|
109
|
-
art: TransactionArgument;
|
|
110
|
-
}
|
|
111
|
-
export interface SetTrackCoverOptions {
|
|
112
|
-
package?: string;
|
|
113
|
-
arguments: SetTrackCoverArguments | [
|
|
114
|
-
self: RawTransactionArgument<string>,
|
|
115
|
-
cap: RawTransactionArgument<string>,
|
|
116
|
-
trackIndex: RawTransactionArgument<number | bigint>,
|
|
117
|
-
art: TransactionArgument
|
|
118
|
-
];
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Sets (or replaces) the cover override for a specific track (by tracklist index).
|
|
122
|
-
* Aborts if the index is out of range for the release.
|
|
123
|
-
*/
|
|
124
|
-
export function setTrackCover(options: SetTrackCoverOptions) {
|
|
125
|
-
const packageAddress = options.package ?? '@local-pkg/release_cover_art';
|
|
126
|
-
const argumentsTypes = [
|
|
127
|
-
null,
|
|
128
|
-
null,
|
|
129
|
-
'u64',
|
|
130
|
-
null
|
|
131
|
-
] satisfies (string | null)[];
|
|
132
|
-
const parameterNames = ["self", "cap", "trackIndex", "art"];
|
|
133
|
-
return (tx: Transaction) => tx.moveCall({
|
|
134
|
-
package: packageAddress,
|
|
135
|
-
module: 'release_cover_art',
|
|
136
|
-
function: 'set_track_cover',
|
|
137
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
export interface UnsetTrackCoverArguments {
|
|
141
|
-
self: RawTransactionArgument<string>;
|
|
142
|
-
cap: RawTransactionArgument<string>;
|
|
143
|
-
trackIndex: RawTransactionArgument<number | bigint>;
|
|
144
|
-
}
|
|
145
|
-
export interface UnsetTrackCoverOptions {
|
|
146
|
-
package?: string;
|
|
147
|
-
arguments: UnsetTrackCoverArguments | [
|
|
148
|
-
self: RawTransactionArgument<string>,
|
|
149
|
-
cap: RawTransactionArgument<string>,
|
|
150
|
-
trackIndex: RawTransactionArgument<number | bigint>
|
|
151
|
-
];
|
|
152
|
-
}
|
|
153
|
-
/**
|
|
154
|
-
* Removes the cover override for a specific track — the track then falls back to
|
|
155
|
-
* the album cover. Aborts if no cover art record is attached, or if the index is
|
|
156
|
-
* out of range for the release.
|
|
157
|
-
*/
|
|
158
|
-
export function unsetTrackCover(options: UnsetTrackCoverOptions) {
|
|
159
|
-
const packageAddress = options.package ?? '@local-pkg/release_cover_art';
|
|
160
|
-
const argumentsTypes = [
|
|
161
|
-
null,
|
|
162
|
-
null,
|
|
163
|
-
'u64'
|
|
164
|
-
] satisfies (string | null)[];
|
|
165
|
-
const parameterNames = ["self", "cap", "trackIndex"];
|
|
166
|
-
return (tx: Transaction) => tx.moveCall({
|
|
167
|
-
package: packageAddress,
|
|
168
|
-
module: 'release_cover_art',
|
|
169
|
-
function: 'unset_track_cover',
|
|
170
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
export interface HasCoverArtArguments {
|
|
174
|
-
self: RawTransactionArgument<string>;
|
|
175
|
-
}
|
|
176
|
-
export interface HasCoverArtOptions {
|
|
177
|
-
package?: string;
|
|
178
|
-
arguments: HasCoverArtArguments | [
|
|
179
|
-
self: RawTransactionArgument<string>
|
|
180
|
-
];
|
|
181
|
-
}
|
|
182
|
-
/** Returns whether a cover art record is attached to this release. */
|
|
183
|
-
export function hasCoverArt(options: HasCoverArtOptions) {
|
|
184
|
-
const packageAddress = options.package ?? '@local-pkg/release_cover_art';
|
|
185
|
-
const argumentsTypes = [
|
|
186
|
-
null
|
|
187
|
-
] satisfies (string | null)[];
|
|
188
|
-
const parameterNames = ["self"];
|
|
189
|
-
return (tx: Transaction) => tx.moveCall({
|
|
190
|
-
package: packageAddress,
|
|
191
|
-
module: 'release_cover_art',
|
|
192
|
-
function: 'has_cover_art',
|
|
193
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
export interface CoverArguments {
|
|
197
|
-
self: RawTransactionArgument<string>;
|
|
198
|
-
}
|
|
199
|
-
export interface CoverOptions {
|
|
200
|
-
package?: string;
|
|
201
|
-
arguments: CoverArguments | [
|
|
202
|
-
self: RawTransactionArgument<string>
|
|
203
|
-
];
|
|
204
|
-
}
|
|
205
|
-
/**
|
|
206
|
-
* Returns the album-level cover (none if unset). Aborts if no cover art record is
|
|
207
|
-
* attached at all.
|
|
208
|
-
*/
|
|
209
|
-
export function cover(options: CoverOptions) {
|
|
210
|
-
const packageAddress = options.package ?? '@local-pkg/release_cover_art';
|
|
211
|
-
const argumentsTypes = [
|
|
212
|
-
null
|
|
213
|
-
] satisfies (string | null)[];
|
|
214
|
-
const parameterNames = ["self"];
|
|
215
|
-
return (tx: Transaction) => tx.moveCall({
|
|
216
|
-
package: packageAddress,
|
|
217
|
-
module: 'release_cover_art',
|
|
218
|
-
function: 'cover',
|
|
219
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
export interface TrackCoverArguments {
|
|
223
|
-
self: RawTransactionArgument<string>;
|
|
224
|
-
trackIndex: RawTransactionArgument<number | bigint>;
|
|
225
|
-
}
|
|
226
|
-
export interface TrackCoverOptions {
|
|
227
|
-
package?: string;
|
|
228
|
-
arguments: TrackCoverArguments | [
|
|
229
|
-
self: RawTransactionArgument<string>,
|
|
230
|
-
trackIndex: RawTransactionArgument<number | bigint>
|
|
231
|
-
];
|
|
232
|
-
}
|
|
233
|
-
/**
|
|
234
|
-
* Returns a track's effective cover: its per-track override if set, otherwise the
|
|
235
|
-
* album cover (which may itself be none). Aborts if no cover art record is
|
|
236
|
-
* attached, or if the track index is out of range.
|
|
237
|
-
*/
|
|
238
|
-
export function trackCover(options: TrackCoverOptions) {
|
|
239
|
-
const packageAddress = options.package ?? '@local-pkg/release_cover_art';
|
|
240
|
-
const argumentsTypes = [
|
|
241
|
-
null,
|
|
242
|
-
'u64'
|
|
243
|
-
] satisfies (string | null)[];
|
|
244
|
-
const parameterNames = ["self", "trackIndex"];
|
|
245
|
-
return (tx: Transaction) => tx.moveCall({
|
|
246
|
-
package: packageAddress,
|
|
247
|
-
module: 'release_cover_art',
|
|
248
|
-
function: 'track_cover',
|
|
249
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
250
|
-
});
|
|
251
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
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.js';
|
|
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
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
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.js';
|
|
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
|
-
}
|