@misonetwork/sdk 0.2.2 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -98
- package/dist/contracts.d.ts +0 -12
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js +3 -16
- package/dist/contracts.js.map +1 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/internal.d.ts +7 -3
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +22 -4
- package/dist/internal.js.map +1 -1
- package/dist/queries.d.ts +8 -0
- package/dist/queries.d.ts.map +1 -1
- package/dist/queries.js +30 -8
- package/dist/queries.js.map +1 -1
- package/package.json +1 -13
- package/src/contracts.ts +3 -19
- package/src/index.ts +3 -3
- package/src/internal.ts +34 -15
- package/src/queries.ts +40 -12
- package/dist/contracts/composition_credits/composition_credits.d.ts +0 -181
- package/dist/contracts/composition_credits/composition_credits.d.ts.map +0 -1
- package/dist/contracts/composition_credits/composition_credits.js +0 -109
- package/dist/contracts/composition_credits/composition_credits.js.map +0 -1
- package/dist/contracts/composition_credits/composition_party_role.d.ts +0 -119
- package/dist/contracts/composition_credits/composition_party_role.d.ts.map +0 -1
- package/dist/contracts/composition_credits/composition_party_role.js +0 -139
- package/dist/contracts/composition_credits/composition_party_role.js.map +0 -1
- package/dist/contracts/composition_credits/deps/miso_credit/credit.d.ts +0 -24
- package/dist/contracts/composition_credits/deps/miso_credit/credit.d.ts.map +0 -1
- package/dist/contracts/composition_credits/deps/miso_credit/credit.js +0 -23
- package/dist/contracts/composition_credits/deps/miso_credit/credit.js.map +0 -1
- package/dist/contracts/composition_credits/deps/sui/vec_map.d.ts +0 -37
- package/dist/contracts/composition_credits/deps/sui/vec_map.d.ts.map +0 -1
- package/dist/contracts/composition_credits/deps/sui/vec_map.js +0 -28
- package/dist/contracts/composition_credits/deps/sui/vec_map.js.map +0 -1
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.d.ts +0 -87
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.d.ts.map +0 -1
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.js +0 -80
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.js.map +0 -1
- package/dist/contracts/cover_art/cover_art.d.ts +0 -85
- package/dist/contracts/cover_art/cover_art.d.ts.map +0 -1
- package/dist/contracts/cover_art/cover_art.js +0 -68
- package/dist/contracts/cover_art/cover_art.js.map +0 -1
- package/dist/contracts/cover_art/deps/ori/walrus_data.d.ts +0 -52
- package/dist/contracts/cover_art/deps/ori/walrus_data.d.ts.map +0 -1
- package/dist/contracts/cover_art/deps/ori/walrus_data.js +0 -37
- package/dist/contracts/cover_art/deps/ori/walrus_data.js.map +0 -1
- package/dist/contracts/recording_credits/deps/miso_credit/credit.d.ts +0 -24
- package/dist/contracts/recording_credits/deps/miso_credit/credit.d.ts.map +0 -1
- package/dist/contracts/recording_credits/deps/miso_credit/credit.js +0 -23
- package/dist/contracts/recording_credits/deps/miso_credit/credit.js.map +0 -1
- package/dist/contracts/recording_credits/deps/sui/vec_map.d.ts +0 -37
- package/dist/contracts/recording_credits/deps/sui/vec_map.d.ts.map +0 -1
- package/dist/contracts/recording_credits/deps/sui/vec_map.js +0 -28
- package/dist/contracts/recording_credits/deps/sui/vec_map.js.map +0 -1
- package/dist/contracts/recording_credits/deps/sui/vec_set.d.ts +0 -21
- package/dist/contracts/recording_credits/deps/sui/vec_set.d.ts.map +0 -1
- package/dist/contracts/recording_credits/deps/sui/vec_set.js +0 -20
- package/dist/contracts/recording_credits/deps/sui/vec_set.js.map +0 -1
- package/dist/contracts/recording_credits/recording_credits.d.ts +0 -2313
- package/dist/contracts/recording_credits/recording_credits.d.ts.map +0 -1
- package/dist/contracts/recording_credits/recording_credits.js +0 -270
- package/dist/contracts/recording_credits/recording_credits.js.map +0 -1
- package/dist/contracts/recording_credits/recording_party_role.d.ts +0 -1174
- package/dist/contracts/recording_credits/recording_party_role.d.ts.map +0 -1
- package/dist/contracts/recording_credits/recording_party_role.js +0 -692
- package/dist/contracts/recording_credits/recording_party_role.js.map +0 -1
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.d.ts +0 -90
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.d.ts.map +0 -1
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.js +0 -80
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.js.map +0 -1
- package/dist/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.d.ts +0 -52
- package/dist/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.d.ts.map +0 -1
- package/dist/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.js +0 -37
- package/dist/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.js.map +0 -1
- package/dist/contracts/release_cover_art/deps/cover_art/cover_art.d.ts +0 -46
- package/dist/contracts/release_cover_art/deps/cover_art/cover_art.d.ts.map +0 -1
- package/dist/contracts/release_cover_art/deps/cover_art/cover_art.js +0 -21
- package/dist/contracts/release_cover_art/deps/cover_art/cover_art.js.map +0 -1
- package/dist/contracts/release_cover_art/deps/per_track/per_track.d.ts +0 -33
- package/dist/contracts/release_cover_art/deps/per_track/per_track.d.ts.map +0 -1
- package/dist/contracts/release_cover_art/deps/per_track/per_track.js +0 -32
- package/dist/contracts/release_cover_art/deps/per_track/per_track.js.map +0 -1
- package/dist/contracts/release_cover_art/release_cover_art.d.ts +0 -300
- package/dist/contracts/release_cover_art/release_cover_art.d.ts.map +0 -1
- package/dist/contracts/release_cover_art/release_cover_art.js +0 -168
- package/dist/contracts/release_cover_art/release_cover_art.js.map +0 -1
- package/dist/contracts/release_credits/deps/miso_credit/credit.d.ts +0 -24
- package/dist/contracts/release_credits/deps/miso_credit/credit.d.ts.map +0 -1
- package/dist/contracts/release_credits/deps/miso_credit/credit.js +0 -23
- package/dist/contracts/release_credits/deps/miso_credit/credit.js.map +0 -1
- package/dist/contracts/release_credits/deps/sui/vec_map.d.ts +0 -37
- package/dist/contracts/release_credits/deps/sui/vec_map.d.ts.map +0 -1
- package/dist/contracts/release_credits/deps/sui/vec_map.js +0 -28
- package/dist/contracts/release_credits/deps/sui/vec_map.js.map +0 -1
- package/dist/contracts/release_credits/release_credits.d.ts +0 -142
- package/dist/contracts/release_credits/release_credits.d.ts.map +0 -1
- package/dist/contracts/release_credits/release_credits.js +0 -108
- package/dist/contracts/release_credits/release_credits.js.map +0 -1
- package/dist/contracts/release_credits/release_party_role.d.ts +0 -58
- package/dist/contracts/release_credits/release_party_role.d.ts.map +0 -1
- package/dist/contracts/release_credits/release_party_role.js +0 -66
- package/dist/contracts/release_credits/release_party_role.js.map +0 -1
- package/dist/contracts/royalty_pool/deps/std/type_name.d.ts +0 -18
- package/dist/contracts/royalty_pool/deps/std/type_name.d.ts.map +0 -1
- package/dist/contracts/royalty_pool/deps/std/type_name.js +0 -20
- package/dist/contracts/royalty_pool/deps/std/type_name.js.map +0 -1
- package/dist/contracts/royalty_pool/deps/sui/balance.d.ts +0 -13
- package/dist/contracts/royalty_pool/deps/sui/balance.d.ts.map +0 -1
- package/dist/contracts/royalty_pool/deps/sui/balance.js +0 -15
- package/dist/contracts/royalty_pool/deps/sui/balance.js.map +0 -1
- package/dist/contracts/royalty_pool/deps/sui/vec_map.d.ts +0 -37
- package/dist/contracts/royalty_pool/deps/sui/vec_map.d.ts.map +0 -1
- package/dist/contracts/royalty_pool/deps/sui/vec_map.js +0 -28
- package/dist/contracts/royalty_pool/deps/sui/vec_map.js.map +0 -1
- package/dist/contracts/royalty_pool/pool.d.ts +0 -358
- package/dist/contracts/royalty_pool/pool.d.ts.map +0 -1
- package/dist/contracts/royalty_pool/pool.js +0 -352
- package/dist/contracts/royalty_pool/pool.js.map +0 -1
- package/dist/contracts/royalty_pool/stake.d.ts +0 -202
- package/dist/contracts/royalty_pool/stake.d.ts.map +0 -1
- package/dist/contracts/royalty_pool/stake.js +0 -197
- package/dist/contracts/royalty_pool/stake.js.map +0 -1
- package/dist/cover.d.ts +0 -48
- package/dist/cover.d.ts.map +0 -1
- package/dist/cover.js +0 -68
- package/dist/cover.js.map +0 -1
- package/dist/credits.d.ts +0 -171
- package/dist/credits.d.ts.map +0 -1
- package/dist/credits.js +0 -360
- package/dist/credits.js.map +0 -1
- package/dist/extensions/royalty-pool.d.ts +0 -32
- package/dist/extensions/royalty-pool.d.ts.map +0 -1
- package/dist/extensions/royalty-pool.js +0 -33
- package/dist/extensions/royalty-pool.js.map +0 -1
- package/src/contracts/composition_credits/composition_credits.ts +0 -169
- package/src/contracts/composition_credits/composition_party_role.ts +0 -189
- package/src/contracts/composition_credits/deps/miso_credit/credit.ts +0 -27
- package/src/contracts/composition_credits/deps/sui/vec_map.ts +0 -33
- package/src/contracts/composition_royalty_pool/composition_royalty_pool.ts +0 -135
- package/src/contracts/cover_art/cover_art.ts +0 -99
- package/src/contracts/cover_art/deps/ori/walrus_data.ts +0 -36
- package/src/contracts/recording_credits/deps/miso_credit/credit.ts +0 -27
- package/src/contracts/recording_credits/deps/sui/vec_map.ts +0 -33
- package/src/contracts/recording_credits/deps/sui/vec_set.ts +0 -21
- package/src/contracts/recording_credits/recording_credits.ts +0 -458
- package/src/contracts/recording_credits/recording_party_role.ts +0 -1041
- package/src/contracts/recording_royalty_pool/recording_royalty_pool.ts +0 -138
- package/src/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.ts +0 -36
- package/src/contracts/release_cover_art/deps/cover_art/cover_art.ts +0 -23
- package/src/contracts/release_cover_art/deps/per_track/per_track.ts +0 -36
- package/src/contracts/release_cover_art/release_cover_art.ts +0 -251
- package/src/contracts/release_credits/deps/miso_credit/credit.ts +0 -27
- package/src/contracts/release_credits/deps/sui/vec_map.ts +0 -33
- package/src/contracts/release_credits/release_credits.ts +0 -156
- package/src/contracts/release_credits/release_party_role.ts +0 -87
- package/src/contracts/royalty_pool/deps/std/type_name.ts +0 -22
- package/src/contracts/royalty_pool/deps/sui/balance.ts +0 -17
- package/src/contracts/royalty_pool/deps/sui/vec_map.ts +0 -33
- package/src/contracts/royalty_pool/pool.ts +0 -577
- package/src/contracts/royalty_pool/stake.ts +0 -317
- package/src/cover.ts +0 -136
- package/src/credits.ts +0 -645
- package/src/extensions/royalty-pool.ts +0 -85
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
/**************************************************************
|
|
2
|
-
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
-
**************************************************************/
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Defines the roles that parties can hold on a composition. Compositions are the
|
|
8
|
-
* underlying musical works (melody + lyrics), and these roles represent the
|
|
9
|
-
* writing and adaptation contributions to them.
|
|
10
|
-
*
|
|
11
|
-
* ### Design
|
|
12
|
-
*
|
|
13
|
-
* `CompositionPartyRole` is a closed enum: variants can only be constructed and
|
|
14
|
-
* matched inside this module, so the `new_*_role` constructors are the external
|
|
15
|
-
* write-API and `name()` is the external read-API.
|
|
16
|
-
*
|
|
17
|
-
* - **No seniority axis.** Unlike recording roles, composition roles carry no
|
|
18
|
-
* level — a writer either contributed in a given capacity or did not.
|
|
19
|
-
* - **`Custom` is the escape hatch.** The canonical variants cover the common
|
|
20
|
-
* writing vocabulary; anything outside it is a `Custom(name)` whose name is
|
|
21
|
-
* validated. Prefer a canonical variant when one fits.
|
|
22
|
-
* - **`name()` is the canonical identifier**, returned as a stable PascalCase
|
|
23
|
-
* token (e.g. `"Songwriter"`). For `Custom`, `name()` returns the user-supplied
|
|
24
|
-
* string.
|
|
25
|
-
*
|
|
26
|
-
* These identifiers are Miso's own canonical vocabulary; any overlap with an
|
|
27
|
-
* external standard (e.g. DDEX) is coincidental, not a reproduction of it.
|
|
28
|
-
*/
|
|
29
|
-
|
|
30
|
-
import { MoveEnum, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';
|
|
31
|
-
import { bcs } from '@mysten/sui/bcs';
|
|
32
|
-
import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
|
|
33
|
-
const $moduleName = '@local-pkg/composition_credits::composition_party_role';
|
|
34
|
-
/** Represents a party's role on a composition. */
|
|
35
|
-
export const CompositionPartyRole = new MoveEnum({ name: `${$moduleName}::CompositionPartyRole`, fields: {
|
|
36
|
-
/** Adapted an existing work into this composition. */
|
|
37
|
-
Adapter: null,
|
|
38
|
-
/** Arranged the musical parts of the composition. */
|
|
39
|
-
Arranger: null,
|
|
40
|
-
/** Composed the music of the composition. */
|
|
41
|
-
Composer: null,
|
|
42
|
-
/** Wrote the lyrics of the composition. */
|
|
43
|
-
Lyricist: null,
|
|
44
|
-
/** Wrote both music and lyrics of the composition. */
|
|
45
|
-
Songwriter: null,
|
|
46
|
-
/** Translated the lyrics of the composition. */
|
|
47
|
-
Translator: null,
|
|
48
|
-
/**
|
|
49
|
-
* A user-defined role not covered by a canonical variant. Carries the role name
|
|
50
|
-
* (validated). An escape hatch — prefer a canonical variant when one fits.
|
|
51
|
-
*/
|
|
52
|
-
Custom: bcs.string()
|
|
53
|
-
} });
|
|
54
|
-
export interface NewAdapterRoleOptions {
|
|
55
|
-
package?: string;
|
|
56
|
-
arguments?: [
|
|
57
|
-
];
|
|
58
|
-
}
|
|
59
|
-
/** Creates a new Adapter role. */
|
|
60
|
-
export function newAdapterRole(options: NewAdapterRoleOptions = {}) {
|
|
61
|
-
const packageAddress = options.package ?? '@local-pkg/composition_credits';
|
|
62
|
-
return (tx: Transaction) => tx.moveCall({
|
|
63
|
-
package: packageAddress,
|
|
64
|
-
module: 'composition_party_role',
|
|
65
|
-
function: 'new_adapter_role',
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
export interface NewArrangerRoleOptions {
|
|
69
|
-
package?: string;
|
|
70
|
-
arguments?: [
|
|
71
|
-
];
|
|
72
|
-
}
|
|
73
|
-
/** Creates a new Arranger role. */
|
|
74
|
-
export function newArrangerRole(options: NewArrangerRoleOptions = {}) {
|
|
75
|
-
const packageAddress = options.package ?? '@local-pkg/composition_credits';
|
|
76
|
-
return (tx: Transaction) => tx.moveCall({
|
|
77
|
-
package: packageAddress,
|
|
78
|
-
module: 'composition_party_role',
|
|
79
|
-
function: 'new_arranger_role',
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
export interface NewComposerRoleOptions {
|
|
83
|
-
package?: string;
|
|
84
|
-
arguments?: [
|
|
85
|
-
];
|
|
86
|
-
}
|
|
87
|
-
/** Creates a new Composer role. */
|
|
88
|
-
export function newComposerRole(options: NewComposerRoleOptions = {}) {
|
|
89
|
-
const packageAddress = options.package ?? '@local-pkg/composition_credits';
|
|
90
|
-
return (tx: Transaction) => tx.moveCall({
|
|
91
|
-
package: packageAddress,
|
|
92
|
-
module: 'composition_party_role',
|
|
93
|
-
function: 'new_composer_role',
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
export interface NewLyricistRoleOptions {
|
|
97
|
-
package?: string;
|
|
98
|
-
arguments?: [
|
|
99
|
-
];
|
|
100
|
-
}
|
|
101
|
-
/** Creates a new Lyricist role. */
|
|
102
|
-
export function newLyricistRole(options: NewLyricistRoleOptions = {}) {
|
|
103
|
-
const packageAddress = options.package ?? '@local-pkg/composition_credits';
|
|
104
|
-
return (tx: Transaction) => tx.moveCall({
|
|
105
|
-
package: packageAddress,
|
|
106
|
-
module: 'composition_party_role',
|
|
107
|
-
function: 'new_lyricist_role',
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
export interface NewSongwriterRoleOptions {
|
|
111
|
-
package?: string;
|
|
112
|
-
arguments?: [
|
|
113
|
-
];
|
|
114
|
-
}
|
|
115
|
-
/** Creates a new Songwriter role. */
|
|
116
|
-
export function newSongwriterRole(options: NewSongwriterRoleOptions = {}) {
|
|
117
|
-
const packageAddress = options.package ?? '@local-pkg/composition_credits';
|
|
118
|
-
return (tx: Transaction) => tx.moveCall({
|
|
119
|
-
package: packageAddress,
|
|
120
|
-
module: 'composition_party_role',
|
|
121
|
-
function: 'new_songwriter_role',
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
export interface NewTranslatorRoleOptions {
|
|
125
|
-
package?: string;
|
|
126
|
-
arguments?: [
|
|
127
|
-
];
|
|
128
|
-
}
|
|
129
|
-
/** Creates a new Translator role. */
|
|
130
|
-
export function newTranslatorRole(options: NewTranslatorRoleOptions = {}) {
|
|
131
|
-
const packageAddress = options.package ?? '@local-pkg/composition_credits';
|
|
132
|
-
return (tx: Transaction) => tx.moveCall({
|
|
133
|
-
package: packageAddress,
|
|
134
|
-
module: 'composition_party_role',
|
|
135
|
-
function: 'new_translator_role',
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
export interface NewCustomRoleArguments {
|
|
139
|
-
roleName: RawTransactionArgument<string>;
|
|
140
|
-
}
|
|
141
|
-
export interface NewCustomRoleOptions {
|
|
142
|
-
package?: string;
|
|
143
|
-
arguments: NewCustomRoleArguments | [
|
|
144
|
-
roleName: RawTransactionArgument<string>
|
|
145
|
-
];
|
|
146
|
-
}
|
|
147
|
-
/**
|
|
148
|
-
* Creates a new Custom role with a user-defined name. The name freezes into
|
|
149
|
-
* credits, so it is validated here. Prefer a canonical variant when one fits.
|
|
150
|
-
*/
|
|
151
|
-
export function newCustomRole(options: NewCustomRoleOptions) {
|
|
152
|
-
const packageAddress = options.package ?? '@local-pkg/composition_credits';
|
|
153
|
-
const argumentsTypes = [
|
|
154
|
-
'0x1::string::String'
|
|
155
|
-
] satisfies (string | null)[];
|
|
156
|
-
const parameterNames = ["roleName"];
|
|
157
|
-
return (tx: Transaction) => tx.moveCall({
|
|
158
|
-
package: packageAddress,
|
|
159
|
-
module: 'composition_party_role',
|
|
160
|
-
function: 'new_custom_role',
|
|
161
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
export interface NameArguments {
|
|
165
|
-
self: TransactionArgument;
|
|
166
|
-
}
|
|
167
|
-
export interface NameOptions {
|
|
168
|
-
package?: string;
|
|
169
|
-
arguments: NameArguments | [
|
|
170
|
-
self: TransactionArgument
|
|
171
|
-
];
|
|
172
|
-
}
|
|
173
|
-
/**
|
|
174
|
-
* Returns the canonical identifier of the role as a stable PascalCase token. For
|
|
175
|
-
* `Custom`, returns the user-supplied name.
|
|
176
|
-
*/
|
|
177
|
-
export function name(options: NameOptions) {
|
|
178
|
-
const packageAddress = options.package ?? '@local-pkg/composition_credits';
|
|
179
|
-
const argumentsTypes = [
|
|
180
|
-
null
|
|
181
|
-
] satisfies (string | null)[];
|
|
182
|
-
const parameterNames = ["self"];
|
|
183
|
-
return (tx: Transaction) => tx.moveCall({
|
|
184
|
-
package: packageAddress,
|
|
185
|
-
module: 'composition_party_role',
|
|
186
|
-
function: 'name',
|
|
187
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
188
|
-
});
|
|
189
|
-
}
|
|
@@ -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
|
-
}
|
|
@@ -1,135 +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 `Composition`.
|
|
8
|
-
*
|
|
9
|
-
* Royalty payers send `Coin<Currency>` directly to the composition's address — a
|
|
10
|
-
* stable, well-known inbox available from the composition's creation. The
|
|
11
|
-
* composition 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 `&CompositionAdminCap`, 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
|
-
composition: RawTransactionArgument<string>;
|
|
23
|
-
cap: RawTransactionArgument<string>;
|
|
24
|
-
}
|
|
25
|
-
export interface InitializePoolOptions {
|
|
26
|
-
package?: string;
|
|
27
|
-
arguments: InitializePoolArguments | [
|
|
28
|
-
composition: RawTransactionArgument<string>,
|
|
29
|
-
cap: RawTransactionArgument<string>
|
|
30
|
-
];
|
|
31
|
-
typeArguments: [
|
|
32
|
-
string,
|
|
33
|
-
string
|
|
34
|
-
];
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Create a royalty pool for a composition. Pool address derives from
|
|
38
|
-
* `(composition_id, Currency)` — calling twice with the same Currency aborts
|
|
39
|
-
* because the address is already claimed.
|
|
40
|
-
*/
|
|
41
|
-
export function initializePool(options: InitializePoolOptions) {
|
|
42
|
-
const packageAddress = options.package ?? '@local-pkg/composition_royalty_pool';
|
|
43
|
-
const argumentsTypes = [
|
|
44
|
-
null,
|
|
45
|
-
null
|
|
46
|
-
] satisfies (string | null)[];
|
|
47
|
-
const parameterNames = ["composition", "cap"];
|
|
48
|
-
return (tx: Transaction) => tx.moveCall({
|
|
49
|
-
package: packageAddress,
|
|
50
|
-
module: 'composition_royalty_pool',
|
|
51
|
-
function: 'initialize_pool',
|
|
52
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
53
|
-
typeArguments: options.typeArguments
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
export interface ReceiveAndDepositArguments {
|
|
57
|
-
composition: RawTransactionArgument<string>;
|
|
58
|
-
cap: RawTransactionArgument<string>;
|
|
59
|
-
coins: TransactionArgument;
|
|
60
|
-
pool: RawTransactionArgument<string>;
|
|
61
|
-
}
|
|
62
|
-
export interface ReceiveAndDepositOptions {
|
|
63
|
-
package?: string;
|
|
64
|
-
arguments: ReceiveAndDepositArguments | [
|
|
65
|
-
composition: RawTransactionArgument<string>,
|
|
66
|
-
cap: RawTransactionArgument<string>,
|
|
67
|
-
coins: TransactionArgument,
|
|
68
|
-
pool: RawTransactionArgument<string>
|
|
69
|
-
];
|
|
70
|
-
typeArguments: [
|
|
71
|
-
string,
|
|
72
|
-
string
|
|
73
|
-
];
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Receive `Coin<Currency>` objects sent to the composition's address and fold them
|
|
77
|
-
* into the pool's accumulator.
|
|
78
|
-
*/
|
|
79
|
-
export function receiveAndDeposit(options: ReceiveAndDepositOptions) {
|
|
80
|
-
const packageAddress = options.package ?? '@local-pkg/composition_royalty_pool';
|
|
81
|
-
const argumentsTypes = [
|
|
82
|
-
null,
|
|
83
|
-
null,
|
|
84
|
-
'vector<null>',
|
|
85
|
-
null
|
|
86
|
-
] satisfies (string | null)[];
|
|
87
|
-
const parameterNames = ["composition", "cap", "coins", "pool"];
|
|
88
|
-
return (tx: Transaction) => tx.moveCall({
|
|
89
|
-
package: packageAddress,
|
|
90
|
-
module: 'composition_royalty_pool',
|
|
91
|
-
function: 'receive_and_deposit',
|
|
92
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
93
|
-
typeArguments: options.typeArguments
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
export interface RedeemAndDepositArguments {
|
|
97
|
-
composition: RawTransactionArgument<string>;
|
|
98
|
-
cap: RawTransactionArgument<string>;
|
|
99
|
-
value: RawTransactionArgument<number | bigint>;
|
|
100
|
-
pool: RawTransactionArgument<string>;
|
|
101
|
-
}
|
|
102
|
-
export interface RedeemAndDepositOptions {
|
|
103
|
-
package?: string;
|
|
104
|
-
arguments: RedeemAndDepositArguments | [
|
|
105
|
-
composition: RawTransactionArgument<string>,
|
|
106
|
-
cap: RawTransactionArgument<string>,
|
|
107
|
-
value: RawTransactionArgument<number | bigint>,
|
|
108
|
-
pool: RawTransactionArgument<string>
|
|
109
|
-
];
|
|
110
|
-
typeArguments: [
|
|
111
|
-
string,
|
|
112
|
-
string
|
|
113
|
-
];
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* Redeem `value` base units from the composition's funds accumulator and fold the
|
|
117
|
-
* resulting balance into the pool's accumulator.
|
|
118
|
-
*/
|
|
119
|
-
export function redeemAndDeposit(options: RedeemAndDepositOptions) {
|
|
120
|
-
const packageAddress = options.package ?? '@local-pkg/composition_royalty_pool';
|
|
121
|
-
const argumentsTypes = [
|
|
122
|
-
null,
|
|
123
|
-
null,
|
|
124
|
-
'u64',
|
|
125
|
-
null
|
|
126
|
-
] satisfies (string | null)[];
|
|
127
|
-
const parameterNames = ["composition", "cap", "value", "pool"];
|
|
128
|
-
return (tx: Transaction) => tx.moveCall({
|
|
129
|
-
package: packageAddress,
|
|
130
|
-
module: 'composition_royalty_pool',
|
|
131
|
-
function: 'redeem_and_deposit',
|
|
132
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
133
|
-
typeArguments: options.typeArguments
|
|
134
|
-
});
|
|
135
|
-
}
|
|
@@ -1,99 +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, normalizeMoveArguments } from '../utils/index.js';
|
|
17
|
-
import { bcs } from '@mysten/sui/bcs';
|
|
18
|
-
import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
|
|
19
|
-
import * as walrus_data from './deps/ori/walrus_data.js';
|
|
20
|
-
const $moduleName = '@local-pkg/cover_art::cover_art';
|
|
21
|
-
export const CoverArt = new MoveStruct({ name: `${$moduleName}::CoverArt`, fields: {
|
|
22
|
-
still: walrus_data.WalrusData,
|
|
23
|
-
animated: bcs.option(walrus_data.WalrusData)
|
|
24
|
-
} });
|
|
25
|
-
export interface NewArguments {
|
|
26
|
-
still: TransactionArgument;
|
|
27
|
-
animated: TransactionArgument;
|
|
28
|
-
}
|
|
29
|
-
export interface NewOptions {
|
|
30
|
-
package?: string;
|
|
31
|
-
arguments: NewArguments | [
|
|
32
|
-
still: TransactionArgument,
|
|
33
|
-
animated: TransactionArgument
|
|
34
|
-
];
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Creates cover art with a still image and optional animated version. Both
|
|
38
|
-
* references must be Walrus blobs.
|
|
39
|
-
*/
|
|
40
|
-
export function _new(options: NewOptions) {
|
|
41
|
-
const packageAddress = options.package ?? '@local-pkg/cover_art';
|
|
42
|
-
const argumentsTypes = [
|
|
43
|
-
null,
|
|
44
|
-
null
|
|
45
|
-
] satisfies (string | null)[];
|
|
46
|
-
const parameterNames = ["still", "animated"];
|
|
47
|
-
return (tx: Transaction) => tx.moveCall({
|
|
48
|
-
package: packageAddress,
|
|
49
|
-
module: 'cover_art',
|
|
50
|
-
function: 'new',
|
|
51
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
export interface StillArguments {
|
|
55
|
-
self: TransactionArgument;
|
|
56
|
-
}
|
|
57
|
-
export interface StillOptions {
|
|
58
|
-
package?: string;
|
|
59
|
-
arguments: StillArguments | [
|
|
60
|
-
self: TransactionArgument
|
|
61
|
-
];
|
|
62
|
-
}
|
|
63
|
-
/** Returns a reference to the still image data. */
|
|
64
|
-
export function still(options: StillOptions) {
|
|
65
|
-
const packageAddress = options.package ?? '@local-pkg/cover_art';
|
|
66
|
-
const argumentsTypes = [
|
|
67
|
-
null
|
|
68
|
-
] satisfies (string | null)[];
|
|
69
|
-
const parameterNames = ["self"];
|
|
70
|
-
return (tx: Transaction) => tx.moveCall({
|
|
71
|
-
package: packageAddress,
|
|
72
|
-
module: 'cover_art',
|
|
73
|
-
function: 'still',
|
|
74
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
export interface AnimatedArguments {
|
|
78
|
-
self: TransactionArgument;
|
|
79
|
-
}
|
|
80
|
-
export interface AnimatedOptions {
|
|
81
|
-
package?: string;
|
|
82
|
-
arguments: AnimatedArguments | [
|
|
83
|
-
self: TransactionArgument
|
|
84
|
-
];
|
|
85
|
-
}
|
|
86
|
-
/** Returns a reference to the optional animated cover art data. */
|
|
87
|
-
export function animated(options: AnimatedOptions) {
|
|
88
|
-
const packageAddress = options.package ?? '@local-pkg/cover_art';
|
|
89
|
-
const argumentsTypes = [
|
|
90
|
-
null
|
|
91
|
-
] satisfies (string | null)[];
|
|
92
|
-
const parameterNames = ["self"];
|
|
93
|
-
return (tx: Transaction) => tx.moveCall({
|
|
94
|
-
package: packageAddress,
|
|
95
|
-
module: 'cover_art',
|
|
96
|
-
function: 'animated',
|
|
97
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
98
|
-
});
|
|
99
|
-
}
|
|
@@ -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 = '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
|
-
} });
|
|
@@ -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
|
-
}
|
|
@@ -1,21 +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_set';
|
|
7
|
-
/**
|
|
8
|
-
* A set data structure backed by a vector. The set is guaranteed not to contain
|
|
9
|
-
* duplicate keys. All operations are O(N) in the size of the set
|
|
10
|
-
*
|
|
11
|
-
* - the intention of this data structure is only to provide the convenience of
|
|
12
|
-
* programming against a set API. Sets that need sorted iteration rather than
|
|
13
|
-
* insertion order iteration should be handwritten.
|
|
14
|
-
*/
|
|
15
|
-
export function VecSet<K extends BcsType<any>>(...typeParameters: [
|
|
16
|
-
K
|
|
17
|
-
]) {
|
|
18
|
-
return new MoveStruct({ name: `${$moduleName}::VecSet<${typeParameters[0].name as K['name']}>`, fields: {
|
|
19
|
-
contents: bcs.vector(typeParameters[0])
|
|
20
|
-
} });
|
|
21
|
-
}
|