@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,346 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Vault-authorized control over Recording shares owned by a Composition.
|
|
8
|
+
*
|
|
9
|
+
* The plugin redeems Recording shares held at the Composition address and places
|
|
10
|
+
* them in a generic `routed_stake::RoutedStake`. The independently shared wrapper
|
|
11
|
+
* prevents rewards from surfacing as freely claimable funds: its permissionless
|
|
12
|
+
* `sweep` operation can route them only into the royalty pool derived from the
|
|
13
|
+
* same Composition.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import { type Transaction } from '@mysten/sui/transactions';
|
|
17
|
+
import { normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';
|
|
18
|
+
export interface InstallArguments {
|
|
19
|
+
vault: RawTransactionArgument<string>;
|
|
20
|
+
vaultAdminCap: RawTransactionArgument<string>;
|
|
21
|
+
}
|
|
22
|
+
export interface InstallOptions {
|
|
23
|
+
package?: string;
|
|
24
|
+
arguments: InstallArguments | [
|
|
25
|
+
vault: RawTransactionArgument<string>,
|
|
26
|
+
vaultAdminCap: RawTransactionArgument<string>
|
|
27
|
+
];
|
|
28
|
+
typeArguments: [
|
|
29
|
+
string
|
|
30
|
+
];
|
|
31
|
+
}
|
|
32
|
+
/** Authorize this package on a Composition capability Vault. */
|
|
33
|
+
export function install(options: InstallOptions) {
|
|
34
|
+
const packageAddress = options.package ?? '@local-pkg/composition_routed_stake';
|
|
35
|
+
const argumentsTypes = [
|
|
36
|
+
null,
|
|
37
|
+
null
|
|
38
|
+
] satisfies (string | null)[];
|
|
39
|
+
const parameterNames = ["vault", "vaultAdminCap"];
|
|
40
|
+
return (tx: Transaction) => tx.moveCall({
|
|
41
|
+
package: packageAddress,
|
|
42
|
+
module: 'composition_routed_stake',
|
|
43
|
+
function: 'install',
|
|
44
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
45
|
+
typeArguments: options.typeArguments
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
export interface UninstallArguments {
|
|
49
|
+
vault: RawTransactionArgument<string>;
|
|
50
|
+
vaultAdminCap: RawTransactionArgument<string>;
|
|
51
|
+
}
|
|
52
|
+
export interface UninstallOptions {
|
|
53
|
+
package?: string;
|
|
54
|
+
arguments: UninstallArguments | [
|
|
55
|
+
vault: RawTransactionArgument<string>,
|
|
56
|
+
vaultAdminCap: RawTransactionArgument<string>
|
|
57
|
+
];
|
|
58
|
+
typeArguments: [
|
|
59
|
+
string
|
|
60
|
+
];
|
|
61
|
+
}
|
|
62
|
+
/** Revoke this package from a Composition capability Vault. */
|
|
63
|
+
export function uninstall(options: UninstallOptions) {
|
|
64
|
+
const packageAddress = options.package ?? '@local-pkg/composition_routed_stake';
|
|
65
|
+
const argumentsTypes = [
|
|
66
|
+
null,
|
|
67
|
+
null
|
|
68
|
+
] satisfies (string | null)[];
|
|
69
|
+
const parameterNames = ["vault", "vaultAdminCap"];
|
|
70
|
+
return (tx: Transaction) => tx.moveCall({
|
|
71
|
+
package: packageAddress,
|
|
72
|
+
module: 'composition_routed_stake',
|
|
73
|
+
function: 'uninstall',
|
|
74
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
75
|
+
typeArguments: options.typeArguments
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
export interface CreateStakeArguments {
|
|
79
|
+
vault: RawTransactionArgument<string>;
|
|
80
|
+
composition: RawTransactionArgument<string>;
|
|
81
|
+
Recording: RawTransactionArgument<string>;
|
|
82
|
+
vaultAdminCap: RawTransactionArgument<string>;
|
|
83
|
+
value: RawTransactionArgument<number | bigint>;
|
|
84
|
+
}
|
|
85
|
+
export interface CreateStakeOptions {
|
|
86
|
+
package?: string;
|
|
87
|
+
arguments: CreateStakeArguments | [
|
|
88
|
+
vault: RawTransactionArgument<string>,
|
|
89
|
+
composition: RawTransactionArgument<string>,
|
|
90
|
+
Recording: RawTransactionArgument<string>,
|
|
91
|
+
vaultAdminCap: RawTransactionArgument<string>,
|
|
92
|
+
value: RawTransactionArgument<number | bigint>
|
|
93
|
+
];
|
|
94
|
+
typeArguments: [
|
|
95
|
+
string,
|
|
96
|
+
string
|
|
97
|
+
];
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Redeem Composition-owned Recording shares, create the Composition-derived routed
|
|
101
|
+
* stake, and share it. The Recording reference pins both share types to a real
|
|
102
|
+
* Composition/Recording relationship.
|
|
103
|
+
*/
|
|
104
|
+
export function createStake(options: CreateStakeOptions) {
|
|
105
|
+
const packageAddress = options.package ?? '@local-pkg/composition_routed_stake';
|
|
106
|
+
const argumentsTypes = [
|
|
107
|
+
null,
|
|
108
|
+
null,
|
|
109
|
+
null,
|
|
110
|
+
null,
|
|
111
|
+
'u64'
|
|
112
|
+
] satisfies (string | null)[];
|
|
113
|
+
const parameterNames = ["vault", "composition", "Recording", "vaultAdminCap", "value"];
|
|
114
|
+
return (tx: Transaction) => tx.moveCall({
|
|
115
|
+
package: packageAddress,
|
|
116
|
+
module: 'composition_routed_stake',
|
|
117
|
+
function: 'create_stake',
|
|
118
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
119
|
+
typeArguments: options.typeArguments
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
export interface RegisterArguments {
|
|
123
|
+
vault: RawTransactionArgument<string>;
|
|
124
|
+
composition: RawTransactionArgument<string>;
|
|
125
|
+
recording: RawTransactionArgument<string>;
|
|
126
|
+
routed: RawTransactionArgument<string>;
|
|
127
|
+
pool: RawTransactionArgument<string>;
|
|
128
|
+
vaultAdminCap: RawTransactionArgument<string>;
|
|
129
|
+
}
|
|
130
|
+
export interface RegisterOptions {
|
|
131
|
+
package?: string;
|
|
132
|
+
arguments: RegisterArguments | [
|
|
133
|
+
vault: RawTransactionArgument<string>,
|
|
134
|
+
composition: RawTransactionArgument<string>,
|
|
135
|
+
recording: RawTransactionArgument<string>,
|
|
136
|
+
routed: RawTransactionArgument<string>,
|
|
137
|
+
pool: RawTransactionArgument<string>,
|
|
138
|
+
vaultAdminCap: RawTransactionArgument<string>
|
|
139
|
+
];
|
|
140
|
+
typeArguments: [
|
|
141
|
+
string,
|
|
142
|
+
string,
|
|
143
|
+
string
|
|
144
|
+
];
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Register the routed stake with the canonical pool derived from the supplied
|
|
148
|
+
* Recording. The Vault administrator controls which currencies are enabled.
|
|
149
|
+
*/
|
|
150
|
+
export function register(options: RegisterOptions) {
|
|
151
|
+
const packageAddress = options.package ?? '@local-pkg/composition_routed_stake';
|
|
152
|
+
const argumentsTypes = [
|
|
153
|
+
null,
|
|
154
|
+
null,
|
|
155
|
+
null,
|
|
156
|
+
null,
|
|
157
|
+
null,
|
|
158
|
+
null
|
|
159
|
+
] satisfies (string | null)[];
|
|
160
|
+
const parameterNames = ["vault", "composition", "recording", "routed", "pool", "vaultAdminCap"];
|
|
161
|
+
return (tx: Transaction) => tx.moveCall({
|
|
162
|
+
package: packageAddress,
|
|
163
|
+
module: 'composition_routed_stake',
|
|
164
|
+
function: 'register',
|
|
165
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
166
|
+
typeArguments: options.typeArguments
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
export interface UnregisterArguments {
|
|
170
|
+
vault: RawTransactionArgument<string>;
|
|
171
|
+
composition: RawTransactionArgument<string>;
|
|
172
|
+
routed: RawTransactionArgument<string>;
|
|
173
|
+
pool: RawTransactionArgument<string>;
|
|
174
|
+
vaultAdminCap: RawTransactionArgument<string>;
|
|
175
|
+
}
|
|
176
|
+
export interface UnregisterOptions {
|
|
177
|
+
package?: string;
|
|
178
|
+
arguments: UnregisterArguments | [
|
|
179
|
+
vault: RawTransactionArgument<string>,
|
|
180
|
+
composition: RawTransactionArgument<string>,
|
|
181
|
+
routed: RawTransactionArgument<string>,
|
|
182
|
+
pool: RawTransactionArgument<string>,
|
|
183
|
+
vaultAdminCap: RawTransactionArgument<string>
|
|
184
|
+
];
|
|
185
|
+
typeArguments: [
|
|
186
|
+
string,
|
|
187
|
+
string,
|
|
188
|
+
string
|
|
189
|
+
];
|
|
190
|
+
}
|
|
191
|
+
/** Unregister the routed stake after its pending reward has been swept. */
|
|
192
|
+
export function unregister(options: UnregisterOptions) {
|
|
193
|
+
const packageAddress = options.package ?? '@local-pkg/composition_routed_stake';
|
|
194
|
+
const argumentsTypes = [
|
|
195
|
+
null,
|
|
196
|
+
null,
|
|
197
|
+
null,
|
|
198
|
+
null,
|
|
199
|
+
null
|
|
200
|
+
] satisfies (string | null)[];
|
|
201
|
+
const parameterNames = ["vault", "composition", "routed", "pool", "vaultAdminCap"];
|
|
202
|
+
return (tx: Transaction) => tx.moveCall({
|
|
203
|
+
package: packageAddress,
|
|
204
|
+
module: 'composition_routed_stake',
|
|
205
|
+
function: 'unregister',
|
|
206
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
207
|
+
typeArguments: options.typeArguments
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
export interface UnstakeArguments {
|
|
211
|
+
vault: RawTransactionArgument<string>;
|
|
212
|
+
composition: RawTransactionArgument<string>;
|
|
213
|
+
routed: RawTransactionArgument<string>;
|
|
214
|
+
vaultAdminCap: RawTransactionArgument<string>;
|
|
215
|
+
}
|
|
216
|
+
export interface UnstakeOptions {
|
|
217
|
+
package?: string;
|
|
218
|
+
arguments: UnstakeArguments | [
|
|
219
|
+
vault: RawTransactionArgument<string>,
|
|
220
|
+
composition: RawTransactionArgument<string>,
|
|
221
|
+
routed: RawTransactionArgument<string>,
|
|
222
|
+
vaultAdminCap: RawTransactionArgument<string>
|
|
223
|
+
];
|
|
224
|
+
typeArguments: [
|
|
225
|
+
string,
|
|
226
|
+
string
|
|
227
|
+
];
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Remove the routed position and return its principal to the Composition address.
|
|
231
|
+
* Principal never becomes a caller-controlled Coin or Balance.
|
|
232
|
+
*/
|
|
233
|
+
export function unstake(options: UnstakeOptions) {
|
|
234
|
+
const packageAddress = options.package ?? '@local-pkg/composition_routed_stake';
|
|
235
|
+
const argumentsTypes = [
|
|
236
|
+
null,
|
|
237
|
+
null,
|
|
238
|
+
null,
|
|
239
|
+
null
|
|
240
|
+
] satisfies (string | null)[];
|
|
241
|
+
const parameterNames = ["vault", "composition", "routed", "vaultAdminCap"];
|
|
242
|
+
return (tx: Transaction) => tx.moveCall({
|
|
243
|
+
package: packageAddress,
|
|
244
|
+
module: 'composition_routed_stake',
|
|
245
|
+
function: 'unstake',
|
|
246
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
247
|
+
typeArguments: options.typeArguments
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
export interface RestakeArguments {
|
|
251
|
+
vault: RawTransactionArgument<string>;
|
|
252
|
+
composition: RawTransactionArgument<string>;
|
|
253
|
+
routed: RawTransactionArgument<string>;
|
|
254
|
+
vaultAdminCap: RawTransactionArgument<string>;
|
|
255
|
+
value: RawTransactionArgument<number | bigint>;
|
|
256
|
+
}
|
|
257
|
+
export interface RestakeOptions {
|
|
258
|
+
package?: string;
|
|
259
|
+
arguments: RestakeArguments | [
|
|
260
|
+
vault: RawTransactionArgument<string>,
|
|
261
|
+
composition: RawTransactionArgument<string>,
|
|
262
|
+
routed: RawTransactionArgument<string>,
|
|
263
|
+
vaultAdminCap: RawTransactionArgument<string>,
|
|
264
|
+
value: RawTransactionArgument<number | bigint>
|
|
265
|
+
];
|
|
266
|
+
typeArguments: [
|
|
267
|
+
string,
|
|
268
|
+
string
|
|
269
|
+
];
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Refill an empty routed stake from Recording shares held at the Composition
|
|
273
|
+
* address.
|
|
274
|
+
*/
|
|
275
|
+
export function restake(options: RestakeOptions) {
|
|
276
|
+
const packageAddress = options.package ?? '@local-pkg/composition_routed_stake';
|
|
277
|
+
const argumentsTypes = [
|
|
278
|
+
null,
|
|
279
|
+
null,
|
|
280
|
+
null,
|
|
281
|
+
null,
|
|
282
|
+
'u64'
|
|
283
|
+
] satisfies (string | null)[];
|
|
284
|
+
const parameterNames = ["vault", "composition", "routed", "vaultAdminCap", "value"];
|
|
285
|
+
return (tx: Transaction) => tx.moveCall({
|
|
286
|
+
package: packageAddress,
|
|
287
|
+
module: 'composition_routed_stake',
|
|
288
|
+
function: 'restake',
|
|
289
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
290
|
+
typeArguments: options.typeArguments
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
export interface IsInstalledArguments {
|
|
294
|
+
vault: RawTransactionArgument<string>;
|
|
295
|
+
}
|
|
296
|
+
export interface IsInstalledOptions {
|
|
297
|
+
package?: string;
|
|
298
|
+
arguments: IsInstalledArguments | [
|
|
299
|
+
vault: RawTransactionArgument<string>
|
|
300
|
+
];
|
|
301
|
+
typeArguments: [
|
|
302
|
+
string
|
|
303
|
+
];
|
|
304
|
+
}
|
|
305
|
+
export function isInstalled(options: IsInstalledOptions) {
|
|
306
|
+
const packageAddress = options.package ?? '@local-pkg/composition_routed_stake';
|
|
307
|
+
const argumentsTypes = [
|
|
308
|
+
null
|
|
309
|
+
] satisfies (string | null)[];
|
|
310
|
+
const parameterNames = ["vault"];
|
|
311
|
+
return (tx: Transaction) => tx.moveCall({
|
|
312
|
+
package: packageAddress,
|
|
313
|
+
module: 'composition_routed_stake',
|
|
314
|
+
function: 'is_installed',
|
|
315
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
316
|
+
typeArguments: options.typeArguments
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
export interface StakeAddressArguments {
|
|
320
|
+
composition: RawTransactionArgument<string>;
|
|
321
|
+
}
|
|
322
|
+
export interface StakeAddressOptions {
|
|
323
|
+
package?: string;
|
|
324
|
+
arguments: StakeAddressArguments | [
|
|
325
|
+
composition: RawTransactionArgument<string>
|
|
326
|
+
];
|
|
327
|
+
typeArguments: [
|
|
328
|
+
string,
|
|
329
|
+
string
|
|
330
|
+
];
|
|
331
|
+
}
|
|
332
|
+
/** Canonical routed-stake address for this Composition and RecordingShare. */
|
|
333
|
+
export function stakeAddress(options: StakeAddressOptions) {
|
|
334
|
+
const packageAddress = options.package ?? '@local-pkg/composition_routed_stake';
|
|
335
|
+
const argumentsTypes = [
|
|
336
|
+
null
|
|
337
|
+
] satisfies (string | null)[];
|
|
338
|
+
const parameterNames = ["composition"];
|
|
339
|
+
return (tx: Transaction) => tx.moveCall({
|
|
340
|
+
package: packageAddress,
|
|
341
|
+
module: 'composition_routed_stake',
|
|
342
|
+
function: 'stake_address',
|
|
343
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
344
|
+
typeArguments: options.typeArguments
|
|
345
|
+
});
|
|
346
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/** Canonical installation identity for the Composition routed-stake plugin. */
|
|
7
|
+
|
|
8
|
+
import { MoveTuple } from '../utils/index.js';
|
|
9
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
10
|
+
const $moduleName = '@local-pkg/composition_routed_stake::witness';
|
|
11
|
+
export const Witness = new MoveTuple({ name: `${$moduleName}::Witness`, fields: [bcs.bool()] });
|
|
@@ -4,29 +4,87 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Vault-authorized royalty-pool business logic for Miso Compositions.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
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.
|
|
9
|
+
* The plugin temporarily leases the CompositionAdminCap from its Vault, uses it
|
|
10
|
+
* only to reach the matching Composition UID, and returns it before calling
|
|
11
|
+
* external pool logic. Pools remain derived from the Composition, not the Vault,
|
|
12
|
+
* so their canonical identity survives vault replacement.
|
|
17
13
|
*/
|
|
18
14
|
|
|
19
15
|
import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
|
|
20
16
|
import { normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';
|
|
17
|
+
export interface InstallArguments {
|
|
18
|
+
vault: RawTransactionArgument<string>;
|
|
19
|
+
vaultAdminCap: RawTransactionArgument<string>;
|
|
20
|
+
}
|
|
21
|
+
export interface InstallOptions {
|
|
22
|
+
package?: string;
|
|
23
|
+
arguments: InstallArguments | [
|
|
24
|
+
vault: RawTransactionArgument<string>,
|
|
25
|
+
vaultAdminCap: RawTransactionArgument<string>
|
|
26
|
+
];
|
|
27
|
+
typeArguments: [
|
|
28
|
+
string
|
|
29
|
+
];
|
|
30
|
+
}
|
|
31
|
+
/** Authorize this package on a Composition capability Vault. */
|
|
32
|
+
export function install(options: InstallOptions) {
|
|
33
|
+
const packageAddress = options.package ?? '@local-pkg/composition_royalty_pool';
|
|
34
|
+
const argumentsTypes = [
|
|
35
|
+
null,
|
|
36
|
+
null
|
|
37
|
+
] satisfies (string | null)[];
|
|
38
|
+
const parameterNames = ["vault", "vaultAdminCap"];
|
|
39
|
+
return (tx: Transaction) => tx.moveCall({
|
|
40
|
+
package: packageAddress,
|
|
41
|
+
module: 'composition_royalty_pool',
|
|
42
|
+
function: 'install',
|
|
43
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
44
|
+
typeArguments: options.typeArguments
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
export interface UninstallArguments {
|
|
48
|
+
vault: RawTransactionArgument<string>;
|
|
49
|
+
vaultAdminCap: RawTransactionArgument<string>;
|
|
50
|
+
}
|
|
51
|
+
export interface UninstallOptions {
|
|
52
|
+
package?: string;
|
|
53
|
+
arguments: UninstallArguments | [
|
|
54
|
+
vault: RawTransactionArgument<string>,
|
|
55
|
+
vaultAdminCap: RawTransactionArgument<string>
|
|
56
|
+
];
|
|
57
|
+
typeArguments: [
|
|
58
|
+
string
|
|
59
|
+
];
|
|
60
|
+
}
|
|
61
|
+
/** Revoke this package from a Composition capability Vault. */
|
|
62
|
+
export function uninstall(options: UninstallOptions) {
|
|
63
|
+
const packageAddress = options.package ?? '@local-pkg/composition_royalty_pool';
|
|
64
|
+
const argumentsTypes = [
|
|
65
|
+
null,
|
|
66
|
+
null
|
|
67
|
+
] satisfies (string | null)[];
|
|
68
|
+
const parameterNames = ["vault", "vaultAdminCap"];
|
|
69
|
+
return (tx: Transaction) => tx.moveCall({
|
|
70
|
+
package: packageAddress,
|
|
71
|
+
module: 'composition_royalty_pool',
|
|
72
|
+
function: 'uninstall',
|
|
73
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
74
|
+
typeArguments: options.typeArguments
|
|
75
|
+
});
|
|
76
|
+
}
|
|
21
77
|
export interface InitializePoolArguments {
|
|
78
|
+
vault: RawTransactionArgument<string>;
|
|
22
79
|
composition: RawTransactionArgument<string>;
|
|
23
|
-
|
|
80
|
+
vaultAdminCap: RawTransactionArgument<string>;
|
|
24
81
|
}
|
|
25
82
|
export interface InitializePoolOptions {
|
|
26
83
|
package?: string;
|
|
27
84
|
arguments: InitializePoolArguments | [
|
|
85
|
+
vault: RawTransactionArgument<string>,
|
|
28
86
|
composition: RawTransactionArgument<string>,
|
|
29
|
-
|
|
87
|
+
vaultAdminCap: RawTransactionArgument<string>
|
|
30
88
|
];
|
|
31
89
|
typeArguments: [
|
|
32
90
|
string,
|
|
@@ -34,17 +92,20 @@ export interface InitializePoolOptions {
|
|
|
34
92
|
];
|
|
35
93
|
}
|
|
36
94
|
/**
|
|
37
|
-
* Create
|
|
38
|
-
*
|
|
39
|
-
*
|
|
95
|
+
* Create and share the canonical pool derived from this Composition.
|
|
96
|
+
*
|
|
97
|
+
* The matching VaultAdminCap chooses which Currency pools may be created. The
|
|
98
|
+
* result cannot be redirected: the pool ID is claimed from the Composition UID and
|
|
99
|
+
* is typed by both CompositionShare and Currency.
|
|
40
100
|
*/
|
|
41
101
|
export function initializePool(options: InitializePoolOptions) {
|
|
42
102
|
const packageAddress = options.package ?? '@local-pkg/composition_royalty_pool';
|
|
43
103
|
const argumentsTypes = [
|
|
104
|
+
null,
|
|
44
105
|
null,
|
|
45
106
|
null
|
|
46
107
|
] satisfies (string | null)[];
|
|
47
|
-
const parameterNames = ["composition", "
|
|
108
|
+
const parameterNames = ["vault", "composition", "vaultAdminCap"];
|
|
48
109
|
return (tx: Transaction) => tx.moveCall({
|
|
49
110
|
package: packageAddress,
|
|
50
111
|
module: 'composition_royalty_pool',
|
|
@@ -54,18 +115,18 @@ export function initializePool(options: InitializePoolOptions) {
|
|
|
54
115
|
});
|
|
55
116
|
}
|
|
56
117
|
export interface ReceiveAndDepositArguments {
|
|
118
|
+
vault: RawTransactionArgument<string>;
|
|
57
119
|
composition: RawTransactionArgument<string>;
|
|
58
|
-
cap: RawTransactionArgument<string>;
|
|
59
|
-
coins: TransactionArgument;
|
|
60
120
|
pool: RawTransactionArgument<string>;
|
|
121
|
+
coins: TransactionArgument;
|
|
61
122
|
}
|
|
62
123
|
export interface ReceiveAndDepositOptions {
|
|
63
124
|
package?: string;
|
|
64
125
|
arguments: ReceiveAndDepositArguments | [
|
|
126
|
+
vault: RawTransactionArgument<string>,
|
|
65
127
|
composition: RawTransactionArgument<string>,
|
|
66
|
-
|
|
67
|
-
coins: TransactionArgument
|
|
68
|
-
pool: RawTransactionArgument<string>
|
|
128
|
+
pool: RawTransactionArgument<string>,
|
|
129
|
+
coins: TransactionArgument
|
|
69
130
|
];
|
|
70
131
|
typeArguments: [
|
|
71
132
|
string,
|
|
@@ -73,18 +134,19 @@ export interface ReceiveAndDepositOptions {
|
|
|
73
134
|
];
|
|
74
135
|
}
|
|
75
136
|
/**
|
|
76
|
-
* Receive
|
|
77
|
-
*
|
|
137
|
+
* Receive coins sent to the Composition and deposit them into its canonical pool.
|
|
138
|
+
* Anyone may crank this after the plugin is installed, but the funds can only
|
|
139
|
+
* reach the pool derived from this Composition.
|
|
78
140
|
*/
|
|
79
141
|
export function receiveAndDeposit(options: ReceiveAndDepositOptions) {
|
|
80
142
|
const packageAddress = options.package ?? '@local-pkg/composition_royalty_pool';
|
|
81
143
|
const argumentsTypes = [
|
|
82
144
|
null,
|
|
83
145
|
null,
|
|
84
|
-
|
|
85
|
-
null
|
|
146
|
+
null,
|
|
147
|
+
'vector<null>'
|
|
86
148
|
] satisfies (string | null)[];
|
|
87
|
-
const parameterNames = ["
|
|
149
|
+
const parameterNames = ["vault", "composition", "pool", "coins"];
|
|
88
150
|
return (tx: Transaction) => tx.moveCall({
|
|
89
151
|
package: packageAddress,
|
|
90
152
|
module: 'composition_royalty_pool',
|
|
@@ -94,18 +156,18 @@ export function receiveAndDeposit(options: ReceiveAndDepositOptions) {
|
|
|
94
156
|
});
|
|
95
157
|
}
|
|
96
158
|
export interface RedeemAndDepositArguments {
|
|
159
|
+
vault: RawTransactionArgument<string>;
|
|
97
160
|
composition: RawTransactionArgument<string>;
|
|
98
|
-
cap: RawTransactionArgument<string>;
|
|
99
|
-
value: RawTransactionArgument<number | bigint>;
|
|
100
161
|
pool: RawTransactionArgument<string>;
|
|
162
|
+
value: RawTransactionArgument<number | bigint>;
|
|
101
163
|
}
|
|
102
164
|
export interface RedeemAndDepositOptions {
|
|
103
165
|
package?: string;
|
|
104
166
|
arguments: RedeemAndDepositArguments | [
|
|
167
|
+
vault: RawTransactionArgument<string>,
|
|
105
168
|
composition: RawTransactionArgument<string>,
|
|
106
|
-
|
|
107
|
-
value: RawTransactionArgument<number | bigint
|
|
108
|
-
pool: RawTransactionArgument<string>
|
|
169
|
+
pool: RawTransactionArgument<string>,
|
|
170
|
+
value: RawTransactionArgument<number | bigint>
|
|
109
171
|
];
|
|
110
172
|
typeArguments: [
|
|
111
173
|
string,
|
|
@@ -113,18 +175,18 @@ export interface RedeemAndDepositOptions {
|
|
|
113
175
|
];
|
|
114
176
|
}
|
|
115
177
|
/**
|
|
116
|
-
* Redeem
|
|
117
|
-
*
|
|
178
|
+
* Redeem funds accumulated at the Composition address and deposit them into its
|
|
179
|
+
* canonical pool. Anyone may crank this after installation.
|
|
118
180
|
*/
|
|
119
181
|
export function redeemAndDeposit(options: RedeemAndDepositOptions) {
|
|
120
182
|
const packageAddress = options.package ?? '@local-pkg/composition_royalty_pool';
|
|
121
183
|
const argumentsTypes = [
|
|
122
184
|
null,
|
|
123
185
|
null,
|
|
124
|
-
|
|
125
|
-
|
|
186
|
+
null,
|
|
187
|
+
'u64'
|
|
126
188
|
] satisfies (string | null)[];
|
|
127
|
-
const parameterNames = ["
|
|
189
|
+
const parameterNames = ["vault", "composition", "pool", "value"];
|
|
128
190
|
return (tx: Transaction) => tx.moveCall({
|
|
129
191
|
package: packageAddress,
|
|
130
192
|
module: 'composition_royalty_pool',
|
|
@@ -132,4 +194,58 @@ export function redeemAndDeposit(options: RedeemAndDepositOptions) {
|
|
|
132
194
|
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
133
195
|
typeArguments: options.typeArguments
|
|
134
196
|
});
|
|
197
|
+
}
|
|
198
|
+
export interface IsInstalledArguments {
|
|
199
|
+
vault: RawTransactionArgument<string>;
|
|
200
|
+
}
|
|
201
|
+
export interface IsInstalledOptions {
|
|
202
|
+
package?: string;
|
|
203
|
+
arguments: IsInstalledArguments | [
|
|
204
|
+
vault: RawTransactionArgument<string>
|
|
205
|
+
];
|
|
206
|
+
typeArguments: [
|
|
207
|
+
string
|
|
208
|
+
];
|
|
209
|
+
}
|
|
210
|
+
export function isInstalled(options: IsInstalledOptions) {
|
|
211
|
+
const packageAddress = options.package ?? '@local-pkg/composition_royalty_pool';
|
|
212
|
+
const argumentsTypes = [
|
|
213
|
+
null
|
|
214
|
+
] satisfies (string | null)[];
|
|
215
|
+
const parameterNames = ["vault"];
|
|
216
|
+
return (tx: Transaction) => tx.moveCall({
|
|
217
|
+
package: packageAddress,
|
|
218
|
+
module: 'composition_royalty_pool',
|
|
219
|
+
function: 'is_installed',
|
|
220
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
221
|
+
typeArguments: options.typeArguments
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
export interface PoolAddressArguments {
|
|
225
|
+
composition: RawTransactionArgument<string>;
|
|
226
|
+
}
|
|
227
|
+
export interface PoolAddressOptions {
|
|
228
|
+
package?: string;
|
|
229
|
+
arguments: PoolAddressArguments | [
|
|
230
|
+
composition: RawTransactionArgument<string>
|
|
231
|
+
];
|
|
232
|
+
typeArguments: [
|
|
233
|
+
string,
|
|
234
|
+
string
|
|
235
|
+
];
|
|
236
|
+
}
|
|
237
|
+
/** The canonical pool address for this Composition, share type, and Currency. */
|
|
238
|
+
export function poolAddress(options: PoolAddressOptions) {
|
|
239
|
+
const packageAddress = options.package ?? '@local-pkg/composition_royalty_pool';
|
|
240
|
+
const argumentsTypes = [
|
|
241
|
+
null
|
|
242
|
+
] satisfies (string | null)[];
|
|
243
|
+
const parameterNames = ["composition"];
|
|
244
|
+
return (tx: Transaction) => tx.moveCall({
|
|
245
|
+
package: packageAddress,
|
|
246
|
+
module: 'composition_royalty_pool',
|
|
247
|
+
function: 'pool_address',
|
|
248
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
249
|
+
typeArguments: options.typeArguments
|
|
250
|
+
});
|
|
135
251
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
import { MoveTuple } from '../utils/index.js';
|
|
5
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
6
|
+
const $moduleName = '@local-pkg/composition_royalty_pool::witness';
|
|
7
|
+
export const Witness = new MoveTuple({ name: `${$moduleName}::Witness`, fields: [bcs.bool()] });
|