@misofm/sdk 0.12.0 → 0.12.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.
Files changed (37) hide show
  1. package/README.md +11 -32
  2. package/dist/client.d.ts +3 -0
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +5 -0
  5. package/dist/client.js.map +1 -1
  6. package/dist/contracts/party_wallet/party_wallet.d.ts +214 -0
  7. package/dist/contracts/party_wallet/party_wallet.d.ts.map +1 -0
  8. package/dist/contracts/party_wallet/party_wallet.js +214 -0
  9. package/dist/contracts/party_wallet/party_wallet.js.map +1 -0
  10. package/dist/contracts/party_wallet/witness.d.ts +6 -0
  11. package/dist/contracts/party_wallet/witness.d.ts.map +1 -0
  12. package/dist/contracts/party_wallet/witness.js +8 -0
  13. package/dist/contracts/party_wallet/witness.js.map +1 -0
  14. package/dist/contracts/royalty_pool/stake.d.ts +6 -0
  15. package/dist/contracts/royalty_pool/stake.d.ts.map +1 -1
  16. package/dist/contracts/royalty_pool/stake.js +6 -0
  17. package/dist/contracts/royalty_pool/stake.js.map +1 -1
  18. package/dist/contracts/vault/vault.d.ts +2 -1
  19. package/dist/contracts/vault/vault.d.ts.map +1 -1
  20. package/dist/contracts/vault/vault.js +2 -1
  21. package/dist/contracts/vault/vault.js.map +1 -1
  22. package/dist/contracts.d.ts +1 -0
  23. package/dist/contracts.d.ts.map +1 -1
  24. package/dist/contracts.js +1 -0
  25. package/dist/contracts.js.map +1 -1
  26. package/dist/deployments.d.ts +82 -6
  27. package/dist/deployments.d.ts.map +1 -1
  28. package/dist/deployments.js +46 -5
  29. package/dist/deployments.js.map +1 -1
  30. package/package.json +4 -4
  31. package/src/client.ts +10 -0
  32. package/src/contracts/party_wallet/party_wallet.ts +350 -0
  33. package/src/contracts/party_wallet/witness.ts +7 -0
  34. package/src/contracts/royalty_pool/stake.ts +8 -2
  35. package/src/contracts/vault/vault.ts +2 -1
  36. package/src/contracts.ts +1 -0
  37. package/src/deployments.ts +52 -5
@@ -1,14 +1,55 @@
1
1
  // Copyright (c) Miso Labs, Inc.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
+ import { MISO_DEPLOYMENTS } from "@misonetwork/sdk/deployments";
3
4
  /**
4
5
  * Platform deployments bundled with this SDK release.
5
6
  *
6
- * This release deliberately contains no bundled network deployment. The core
7
- * protocol is being republished as an immutable stack, so every old package ID
8
- * is an incompatible ABI and must not be selected by accident. The admin-cli
9
- * deployment flow injects verified IDs in a follow-up change.
7
+ * IDs come only from the verified output of the Ledger-backed deployment run.
8
+ * Consumers may still pass an explicit complete deployment for custom networks.
10
9
  */
11
- export const MISO_PLATFORM_DEPLOYMENTS = {};
10
+ export const MISO_PLATFORM_DEPLOYMENTS = {
11
+ testnet: {
12
+ network: "testnet",
13
+ chainIdentifier: "69WiPg3DAQiwdxfncX6wYQ2siKwAe6L9BZthQea3JNMD",
14
+ protocol: MISO_DEPLOYMENTS.testnet,
15
+ packages: {
16
+ pressing: "0x95fba53c968978f75d6ca8a5e6f0f3ba83fdc3af301bc8419be354a3990af5b9",
17
+ record: "0x6150c474200f63bf73072642564886e5ecb1a4c0498ede31acd7908d94dbc83b",
18
+ minato: "0x8466e9864c1d947888e73b0e349b035bc22805579eef18f132966f56c8efe1d2",
19
+ credit: "0x20d8e38f49445cbae45fd66c262c2cbc4bf4cccab487b3fb443a491dc24071cd",
20
+ compositionCredits: "0x8b376967e9c32169727ec5341890f28c66d8577d7bfcecb83aa78aec3e84dce5",
21
+ recordingCredits: "0x7096a47b0ba12063c037d6d417bffade758665a3f313574c8ba218823cfb159a",
22
+ releaseCredits: "0xbe293700ef758c95b69838df6cfa8377b9cad1dd59cbf933974f68b1766d87b5",
23
+ royaltyPool: "0xbeddbcfc2c42ed1bcaa74dc241957621b48241451e10af136c20cdc7df8266b8",
24
+ vault: "0x7075ce4bfc2c738e774c94f1eeb7dc532a5f11ead9b4e3815d90dc16053eae9c",
25
+ compositionRoyaltyPoolPlugin: "0x8d61aecceb597441a0d675b44291706742859c8ff7755b3ed143823daa430c50",
26
+ recordingRoyaltyPoolPlugin: "0x6de70d4e87a328259f00f354227fb329c63fbf50efb87f057c5da26d6908e1d1",
27
+ partyWalletPlugin: "0xccf17215193d1ae64a47480c83df9af2881ffdb75e5ac842ab3898cadd9eeca0",
28
+ routedStake: "0x7a55b1841043efea865d65a6601e057400a79a0aa7bb11e781a25dbe622cbe5f",
29
+ compositionRoutedStakePlugin: "0x54fb4befa1be03f7457abfddcfb9334c20a8df3e01c44aa257f1c3d718cd57ee",
30
+ coverArt: "0x2dae28058b89df93224bacfb9af42fd3ab41f001c2c815fd57fd575024d9a50b",
31
+ releaseCoverArt: "0x649b18f2bb3d94f6a611a8e4ad3a29dcf8b7bba3f684056d60897a8a5e835106",
32
+ genre: "0x978d5f67a4fdc3eb688ed3aeb23c6c3c37ae44e358fb709001e6ab21e6f19f34",
33
+ releaseDescription: "0x3e26e4c4c5b3f51070d6d7bb1527eaa304f34ae5dfde078661e180e7594d6d28",
34
+ releaseDspLink: "0xd9f9e7240c397a82e4af1ecb9ec75b29a91ef4084127eabcf22fbf24e72cab2f",
35
+ releaseGenre: "0xc1012f9768f178ca908ef4a6cfd150ad33baaa3587dc2154ea9852858243cd57",
36
+ releaseKind: "0x3e74c960d9446ae2ebf228456ddc1b099d2090501c9cbcd284a999aa2e774e12",
37
+ releaseRevenueDistributorPlugin: "0x42a22b24129988a5ce8069a1f78eb31d9aa5edf360d729ae3c2c0b8ed18876e1",
38
+ recordingAdvisory: "0x28e0e72c5b892fc888a9007afa59ebe04ed8e47f12632ddb42cd685d09c4af2e",
39
+ recordingLanguage: "0x4b284a9435cf4f48e3785e4485d16be2fcbcef5beaa2b44b6556d9c1028e2c0d",
40
+ recordingMasterReference: "0x2b06ab58f2d5a915b42fc5879d52241fc72e804b3da782fa752b2d2f242170c0",
41
+ recordingPreview: "0x449aafe29707adf249df7e90355ecb19d939ea77d9e19fd3e2fdb220e73e74f0",
42
+ ori: "0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78",
43
+ },
44
+ objects: {
45
+ releaseRegistry: "0xf5941ae9640f6f24b75e921da16c95fd23d776b9e6518c275a50a5ce6337c8ba",
46
+ genreRegistry: "0xad34d6b717b8c59ed9ac47a520feab31324f0c04d70fd31922be45d8209fce1c",
47
+ },
48
+ legacy: {
49
+ releaseCoverArtPackages: [],
50
+ },
51
+ },
52
+ };
12
53
  /** Resolve a bundled platform deployment, failing closed when it is unavailable. */
13
54
  export function getMisoPlatformDeployment(network) {
14
55
  const deployment = MISO_PLATFORM_DEPLOYMENTS[network];
@@ -1 +1 @@
1
- {"version":3,"file":"deployments.js","sourceRoot":"","sources":["../src/deployments.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,sCAAsC;AA2DtC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAExC,CAAC;AAEF,oFAAoF;AACpF,MAAM,UAAU,yBAAyB,CACvC,OAAe;IAEf,MAAM,UAAU,GACd,yBACD,CAAC,OAAO,CAAC,CAAC;IACX,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CACb,iEAAiE,OAAO,KAAK;YAC3E,4DAA4D,CAC/D,CAAC;IACJ,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC"}
1
+ {"version":3,"file":"deployments.js","sourceRoot":"","sources":["../src/deployments.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,sCAAsC;AAMtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AA4DhE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,OAAO,EAAE;QACP,OAAO,EAAE,SAAS;QAClB,eAAe,EAAE,8CAA8C;QAC/D,QAAQ,EAAE,gBAAgB,CAAC,OAAO;QAClC,QAAQ,EAAE;YACR,QAAQ,EAAE,oEAAoE;YAC9E,MAAM,EAAE,oEAAoE;YAC5E,MAAM,EAAE,oEAAoE;YAC5E,MAAM,EAAE,oEAAoE;YAC5E,kBAAkB,EAAE,oEAAoE;YACxF,gBAAgB,EAAE,oEAAoE;YACtF,cAAc,EAAE,oEAAoE;YACpF,WAAW,EAAE,oEAAoE;YACjF,KAAK,EAAE,oEAAoE;YAC3E,4BAA4B,EAAE,oEAAoE;YAClG,0BAA0B,EAAE,oEAAoE;YAChG,iBAAiB,EAAE,oEAAoE;YACvF,WAAW,EAAE,oEAAoE;YACjF,4BAA4B,EAAE,oEAAoE;YAClG,QAAQ,EAAE,oEAAoE;YAC9E,eAAe,EAAE,oEAAoE;YACrF,KAAK,EAAE,oEAAoE;YAC3E,kBAAkB,EAAE,oEAAoE;YACxF,cAAc,EAAE,oEAAoE;YACpF,YAAY,EAAE,oEAAoE;YAClF,WAAW,EAAE,oEAAoE;YACjF,+BAA+B,EAAE,oEAAoE;YACrG,iBAAiB,EAAE,oEAAoE;YACvF,iBAAiB,EAAE,oEAAoE;YACvF,wBAAwB,EAAE,oEAAoE;YAC9F,gBAAgB,EAAE,oEAAoE;YACtF,GAAG,EAAE,oEAAoE;SAC1E;QACD,OAAO,EAAE;YACP,eAAe,EAAE,oEAAoE;YACrF,aAAa,EAAE,oEAAoE;SACpF;QACD,MAAM,EAAE;YACN,uBAAuB,EAAE,EAAE;SAC5B;KACF;CAGF,CAAC;AAEF,oFAAoF;AACpF,MAAM,UAAU,yBAAyB,CACvC,OAAe;IAEf,MAAM,UAAU,GACd,yBACD,CAAC,OAAO,CAAC,CAAC;IACX,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CACb,iEAAiE,OAAO,KAAK;YAC3E,4DAA4D,CAC/D,CAAC;IACJ,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@misofm/sdk",
3
- "version": "0.12.0",
3
+ "version": "0.12.1",
4
4
  "packageManager": "bun@1.4.0",
5
5
  "description": "Complete client SDK for the Miso platform on Sui — high-level reads, pressings, listings, records, and work publishing.",
6
6
  "license": "Apache-2.0",
@@ -112,7 +112,7 @@
112
112
  ],
113
113
  "scripts": {
114
114
  "codegen": "sui-ts-codegen generate",
115
- "codegen:check": "bun run codegen && perl -pi -e 's/[ \\t]+$//' src/contracts/royalty_pool/pool.ts && git diff --exit-code -- src/contracts",
115
+ "codegen:check": "bun run codegen && perl -pi -e 's/[ \\t]+$//' src/contracts/royalty_pool/pool.ts src/contracts/royalty_pool/stake.ts src/contracts/party_wallet/party_wallet.ts && git diff --exit-code -- src/contracts",
116
116
  "typecheck": "tsc --noEmit",
117
117
  "test": "bun test",
118
118
  "build": "rm -rf dist && tsc -p tsconfig.build.json",
@@ -120,14 +120,14 @@
120
120
  "prepare": "rm -rf dist && tsc -p tsconfig.build.json --noCheck"
121
121
  },
122
122
  "devDependencies": {
123
- "@misonetwork/sdk": "^0.9.0",
123
+ "@misonetwork/sdk": "^0.9.1",
124
124
  "@mysten/codegen": "^0.11.14",
125
125
  "@mysten/move-bytecode-template": "^0.4.0",
126
126
  "@mysten/sui": "^2.24.0",
127
127
  "@types/bun": "^1.3.14"
128
128
  },
129
129
  "peerDependencies": {
130
- "@misonetwork/sdk": "^0.9.0",
130
+ "@misonetwork/sdk": "^0.9.1",
131
131
  "@mysten/move-bytecode-template": "^0.4.0",
132
132
  "@mysten/sui": "^2.4.0",
133
133
  "typescript": "^5"
package/src/client.ts CHANGED
@@ -49,6 +49,7 @@ import * as releaseRevenueDistributorContract from "./contracts/release_revenue_
49
49
  import * as vaultContract from "./contracts/vault/vault.ts";
50
50
  import * as compositionRoyaltyPoolContract from "./contracts/composition_royalty_pool/composition_royalty_pool.ts";
51
51
  import * as recordingRoyaltyPoolContract from "./contracts/recording_royalty_pool/recording_royalty_pool.ts";
52
+ import * as partyWalletContract from "./contracts/party_wallet/party_wallet.ts";
52
53
  import * as compositionRoutedStakeContract from "./contracts/composition_routed_stake/composition_routed_stake.ts";
53
54
  import * as routedStakeContract from "./contracts/routed_stake/routed_stake.ts";
54
55
  import * as royaltyPoolContract from "./contracts/royalty_pool/pool.ts";
@@ -203,6 +204,7 @@ export interface MisoPlatformConfig {
203
204
  /** Vault plugins, deliberately separate from data-extension package ids. */
204
205
  compositionRoyaltyPoolPluginPackageId?: string;
205
206
  recordingRoyaltyPoolPluginPackageId?: string;
207
+ partyWalletPluginPackageId?: string;
206
208
  compositionRoutedStakePluginPackageId?: string;
207
209
  routedStakePackageId?: string;
208
210
  releaseRevenueDistributorPluginPackageId?: string;
@@ -600,6 +602,13 @@ export class MisoPlatformClient {
600
602
  ["install", "uninstall", "initializePool", "receiveAndDeposit", "redeemAndDeposit", "isInstalled", "poolAddress"] as const,
601
603
  )
602
604
  : undefined,
605
+ partyWallet: this.#config.partyWalletPluginPackageId
606
+ ? bindModulePackage(
607
+ partyWalletContract,
608
+ this.#config.partyWalletPluginPackageId,
609
+ ["install", "uninstall", "receiveObject", "receiveObjects", "receiveCoins", "redeemCoin", "isInstalled", "inboxAddress", "settledFunds"] as const,
610
+ )
611
+ : undefined,
603
612
  compositionRoutedStake: this.#config.compositionRoutedStakePluginPackageId
604
613
  ? bindModulePackage(
605
614
  compositionRoutedStakeContract,
@@ -701,6 +710,7 @@ export function miso<const Name extends string = "miso">(
701
710
  deployment.packages.compositionRoyaltyPoolPlugin,
702
711
  recordingRoyaltyPoolPluginPackageId:
703
712
  deployment.packages.recordingRoyaltyPoolPlugin,
713
+ partyWalletPluginPackageId: deployment.packages.partyWalletPlugin,
704
714
  compositionRoutedStakePluginPackageId:
705
715
  deployment.packages.compositionRoutedStakePlugin,
706
716
  routedStakePackageId: deployment.packages.routedStake,
@@ -0,0 +1,350 @@
1
+ /**************************************************************
2
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
3
+ **************************************************************/
4
+
5
+
6
+ /**
7
+ * Vault-authorized withdrawals from a Party's object inbox and funds accumulator.
8
+ *
9
+ * Anyone may address objects or funds to a Party ID. This plugin is the bounded
10
+ * withdrawal door: it temporarily leases the matching `PartyAdminCap`, uses it
11
+ * only to reach that Party's UID, returns it to the Vault, and then transfers the
12
+ * withdrawn object or coin to the recipient selected by the Vault administrator.
13
+ *
14
+ * Installation alone never makes withdrawals permissionless. Every production
15
+ * withdrawal is an `entry fun` requiring the matching `VaultAdminCap`, and no
16
+ * endpoint returns the leased capability, its borrow receipt, or a privileged
17
+ * reference. The Party itself stores no plugin data.
18
+ */
19
+
20
+ import { MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';
21
+ import { bcs } from '@mysten/sui/bcs';
22
+ import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
23
+ const $moduleName = '@local-pkg/party_wallet::party_wallet';
24
+ export const ObjectReceivedEvent = new MoveStruct({ name: `${$moduleName}::ObjectReceivedEvent`, fields: {
25
+ party_id: bcs.Address,
26
+ object_id: bcs.Address
27
+ } });
28
+ export const CoinsReceivedEvent = new MoveStruct({ name: `${$moduleName}::CoinsReceivedEvent<phantom Currency>`, fields: {
29
+ party_id: bcs.Address,
30
+ amount: bcs.u64(),
31
+ coins: bcs.u64()
32
+ } });
33
+ export const FundsRedeemedEvent = new MoveStruct({ name: `${$moduleName}::FundsRedeemedEvent<phantom Currency>`, fields: {
34
+ party_id: bcs.Address,
35
+ amount: bcs.u64()
36
+ } });
37
+ export interface InstallArguments {
38
+ vault: RawTransactionArgument<string>;
39
+ vaultAdminCap: RawTransactionArgument<string>;
40
+ }
41
+ export interface InstallOptions {
42
+ package?: string;
43
+ arguments: InstallArguments | [
44
+ vault: RawTransactionArgument<string>,
45
+ vaultAdminCap: RawTransactionArgument<string>
46
+ ];
47
+ }
48
+ /** Authorize this package on a Party capability Vault. */
49
+ export function install(options: InstallOptions) {
50
+ const packageAddress = options.package ?? '@local-pkg/party_wallet';
51
+ const argumentsTypes = [
52
+ null,
53
+ null
54
+ ] satisfies (string | null)[];
55
+ const parameterNames = ["vault", "vaultAdminCap"];
56
+ return (tx: Transaction) => tx.moveCall({
57
+ package: packageAddress,
58
+ module: 'party_wallet',
59
+ function: 'install',
60
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
61
+ });
62
+ }
63
+ export interface UninstallArguments {
64
+ vault: RawTransactionArgument<string>;
65
+ vaultAdminCap: RawTransactionArgument<string>;
66
+ }
67
+ export interface UninstallOptions {
68
+ package?: string;
69
+ arguments: UninstallArguments | [
70
+ vault: RawTransactionArgument<string>,
71
+ vaultAdminCap: RawTransactionArgument<string>
72
+ ];
73
+ }
74
+ /** Revoke this package from a Party capability Vault. */
75
+ export function uninstall(options: UninstallOptions) {
76
+ const packageAddress = options.package ?? '@local-pkg/party_wallet';
77
+ const argumentsTypes = [
78
+ null,
79
+ null
80
+ ] satisfies (string | null)[];
81
+ const parameterNames = ["vault", "vaultAdminCap"];
82
+ return (tx: Transaction) => tx.moveCall({
83
+ package: packageAddress,
84
+ module: 'party_wallet',
85
+ function: 'uninstall',
86
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
87
+ });
88
+ }
89
+ export interface ReceiveObjectArguments {
90
+ vault: RawTransactionArgument<string>;
91
+ party: RawTransactionArgument<string>;
92
+ vaultAdminCap: RawTransactionArgument<string>;
93
+ objectToReceive: TransactionArgument;
94
+ recipient: RawTransactionArgument<string>;
95
+ }
96
+ export interface ReceiveObjectOptions {
97
+ package?: string;
98
+ arguments: ReceiveObjectArguments | [
99
+ vault: RawTransactionArgument<string>,
100
+ party: RawTransactionArgument<string>,
101
+ vaultAdminCap: RawTransactionArgument<string>,
102
+ objectToReceive: TransactionArgument,
103
+ recipient: RawTransactionArgument<string>
104
+ ];
105
+ typeArguments: [
106
+ string
107
+ ];
108
+ }
109
+ /**
110
+ * Receive one `key + store` object addressed to the Party and transfer it to
111
+ * `recipient`.
112
+ *
113
+ * Aborts if the Vault administrator is wrong, the plugin is not installed, the
114
+ * Vault contains another Party's cap, or the receiving ticket is invalid for the
115
+ * supplied Party.
116
+ */
117
+ export function receiveObject(options: ReceiveObjectOptions) {
118
+ const packageAddress = options.package ?? '@local-pkg/party_wallet';
119
+ const argumentsTypes = [
120
+ null,
121
+ null,
122
+ null,
123
+ null,
124
+ 'address'
125
+ ] satisfies (string | null)[];
126
+ const parameterNames = ["vault", "party", "vaultAdminCap", "objectToReceive", "recipient"];
127
+ return (tx: Transaction) => tx.moveCall({
128
+ package: packageAddress,
129
+ module: 'party_wallet',
130
+ function: 'receive_object',
131
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
132
+ typeArguments: options.typeArguments
133
+ });
134
+ }
135
+ export interface ReceiveObjectsArguments {
136
+ vault: RawTransactionArgument<string>;
137
+ party: RawTransactionArgument<string>;
138
+ vaultAdminCap: RawTransactionArgument<string>;
139
+ objectsToReceive: TransactionArgument;
140
+ recipient: RawTransactionArgument<string>;
141
+ }
142
+ export interface ReceiveObjectsOptions {
143
+ package?: string;
144
+ arguments: ReceiveObjectsArguments | [
145
+ vault: RawTransactionArgument<string>,
146
+ party: RawTransactionArgument<string>,
147
+ vaultAdminCap: RawTransactionArgument<string>,
148
+ objectsToReceive: TransactionArgument,
149
+ recipient: RawTransactionArgument<string>
150
+ ];
151
+ typeArguments: [
152
+ string
153
+ ];
154
+ }
155
+ /**
156
+ * Receive several `key + store` objects of one type and transfer each to
157
+ * `recipient` in input order.
158
+ *
159
+ * Aborts with `ENothingToReceive` if `objects_to_receive` is empty. It also aborts
160
+ * under the authorization and receiving conditions documented by `receive_object`.
161
+ */
162
+ export function receiveObjects(options: ReceiveObjectsOptions) {
163
+ const packageAddress = options.package ?? '@local-pkg/party_wallet';
164
+ const argumentsTypes = [
165
+ null,
166
+ null,
167
+ null,
168
+ 'vector<null>',
169
+ 'address'
170
+ ] satisfies (string | null)[];
171
+ const parameterNames = ["vault", "party", "vaultAdminCap", "objectsToReceive", "recipient"];
172
+ return (tx: Transaction) => tx.moveCall({
173
+ package: packageAddress,
174
+ module: 'party_wallet',
175
+ function: 'receive_objects',
176
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
177
+ typeArguments: options.typeArguments
178
+ });
179
+ }
180
+ export interface ReceiveCoinsArguments {
181
+ vault: RawTransactionArgument<string>;
182
+ party: RawTransactionArgument<string>;
183
+ vaultAdminCap: RawTransactionArgument<string>;
184
+ coins: TransactionArgument;
185
+ recipient: RawTransactionArgument<string>;
186
+ }
187
+ export interface ReceiveCoinsOptions {
188
+ package?: string;
189
+ arguments: ReceiveCoinsArguments | [
190
+ vault: RawTransactionArgument<string>,
191
+ party: RawTransactionArgument<string>,
192
+ vaultAdminCap: RawTransactionArgument<string>,
193
+ coins: TransactionArgument,
194
+ recipient: RawTransactionArgument<string>
195
+ ];
196
+ typeArguments: [
197
+ string
198
+ ];
199
+ }
200
+ /**
201
+ * Receive coin objects of one currency, merge them, and transfer the resulting
202
+ * Coin to `recipient`.
203
+ *
204
+ * Aborts with `ENothingToReceive` if `coins` is empty. It also aborts if the Vault
205
+ * administrator, plugin installation, Party capability, or a receiving ticket is
206
+ * invalid.
207
+ */
208
+ export function receiveCoins(options: ReceiveCoinsOptions) {
209
+ const packageAddress = options.package ?? '@local-pkg/party_wallet';
210
+ const argumentsTypes = [
211
+ null,
212
+ null,
213
+ null,
214
+ 'vector<null>',
215
+ 'address'
216
+ ] satisfies (string | null)[];
217
+ const parameterNames = ["vault", "party", "vaultAdminCap", "coins", "recipient"];
218
+ return (tx: Transaction) => tx.moveCall({
219
+ package: packageAddress,
220
+ module: 'party_wallet',
221
+ function: 'receive_coins',
222
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
223
+ typeArguments: options.typeArguments
224
+ });
225
+ }
226
+ export interface RedeemCoinArguments {
227
+ vault: RawTransactionArgument<string>;
228
+ party: RawTransactionArgument<string>;
229
+ vaultAdminCap: RawTransactionArgument<string>;
230
+ value: RawTransactionArgument<number | bigint>;
231
+ recipient: RawTransactionArgument<string>;
232
+ }
233
+ export interface RedeemCoinOptions {
234
+ package?: string;
235
+ arguments: RedeemCoinArguments | [
236
+ vault: RawTransactionArgument<string>,
237
+ party: RawTransactionArgument<string>,
238
+ vaultAdminCap: RawTransactionArgument<string>,
239
+ value: RawTransactionArgument<number | bigint>,
240
+ recipient: RawTransactionArgument<string>
241
+ ];
242
+ typeArguments: [
243
+ string
244
+ ];
245
+ }
246
+ /**
247
+ * Redeem `value` from the Party's accumulator balance, create a Coin, and transfer
248
+ * it to `recipient`.
249
+ *
250
+ * Aborts if the Vault administrator is wrong, the plugin is not installed, the
251
+ * Vault contains another Party's cap, `value` is zero, or the accumulator cannot
252
+ * cover the requested amount.
253
+ */
254
+ export function redeemCoin(options: RedeemCoinOptions) {
255
+ const packageAddress = options.package ?? '@local-pkg/party_wallet';
256
+ const argumentsTypes = [
257
+ null,
258
+ null,
259
+ null,
260
+ 'u64',
261
+ 'address'
262
+ ] satisfies (string | null)[];
263
+ const parameterNames = ["vault", "party", "vaultAdminCap", "value", "recipient"];
264
+ return (tx: Transaction) => tx.moveCall({
265
+ package: packageAddress,
266
+ module: 'party_wallet',
267
+ function: 'redeem_coin',
268
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
269
+ typeArguments: options.typeArguments
270
+ });
271
+ }
272
+ export interface IsInstalledArguments {
273
+ vault: RawTransactionArgument<string>;
274
+ }
275
+ export interface IsInstalledOptions {
276
+ package?: string;
277
+ arguments: IsInstalledArguments | [
278
+ vault: RawTransactionArgument<string>
279
+ ];
280
+ }
281
+ /** Return whether this plugin is installed on `vault`. */
282
+ export function isInstalled(options: IsInstalledOptions) {
283
+ const packageAddress = options.package ?? '@local-pkg/party_wallet';
284
+ const argumentsTypes = [
285
+ null
286
+ ] satisfies (string | null)[];
287
+ const parameterNames = ["vault"];
288
+ return (tx: Transaction) => tx.moveCall({
289
+ package: packageAddress,
290
+ module: 'party_wallet',
291
+ function: 'is_installed',
292
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
293
+ });
294
+ }
295
+ export interface InboxAddressArguments {
296
+ party: RawTransactionArgument<string>;
297
+ }
298
+ export interface InboxAddressOptions {
299
+ package?: string;
300
+ arguments: InboxAddressArguments | [
301
+ party: RawTransactionArgument<string>
302
+ ];
303
+ }
304
+ /** Return the Party ID as the address to which objects or funds may be sent. */
305
+ export function inboxAddress(options: InboxAddressOptions) {
306
+ const packageAddress = options.package ?? '@local-pkg/party_wallet';
307
+ const argumentsTypes = [
308
+ null
309
+ ] satisfies (string | null)[];
310
+ const parameterNames = ["party"];
311
+ return (tx: Transaction) => tx.moveCall({
312
+ package: packageAddress,
313
+ module: 'party_wallet',
314
+ function: 'inbox_address',
315
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
316
+ });
317
+ }
318
+ export interface SettledFundsArguments {
319
+ root: RawTransactionArgument<string>;
320
+ party: RawTransactionArgument<string>;
321
+ }
322
+ export interface SettledFundsOptions {
323
+ package?: string;
324
+ arguments: SettledFundsArguments | [
325
+ root: RawTransactionArgument<string>,
326
+ party: RawTransactionArgument<string>
327
+ ];
328
+ typeArguments: [
329
+ string
330
+ ];
331
+ }
332
+ /**
333
+ * Return the Party's accumulator balance settled at the start of the current
334
+ * consensus commit.
335
+ */
336
+ export function settledFunds(options: SettledFundsOptions) {
337
+ const packageAddress = options.package ?? '@local-pkg/party_wallet';
338
+ const argumentsTypes = [
339
+ null,
340
+ null
341
+ ] satisfies (string | null)[];
342
+ const parameterNames = ["root", "party"];
343
+ return (tx: Transaction) => tx.moveCall({
344
+ package: packageAddress,
345
+ module: 'party_wallet',
346
+ function: 'settled_funds',
347
+ arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
348
+ typeArguments: options.typeArguments
349
+ });
350
+ }
@@ -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/party_wallet::witness';
7
+ export const Witness = new MoveTuple({ name: `${$moduleName}::Witness`, fields: [bcs.bool()] });
@@ -5,16 +5,22 @@
5
5
 
6
6
  /**
7
7
  * A position holding share tokens registered against a `RoyaltyPool`.
8
- *
8
+ *
9
9
  * Stakes are owned objects with an immutable balance — to increase a holder's
10
10
  * total staked amount, mint additional Stake objects rather than modify an
11
11
  * existing one. This mirrors Sui's native staking model.
12
- *
12
+ *
13
13
  * Each stake tracks the royalty pools it is currently registered with via an
14
14
  * inline `VecMap<TypeName, Registration>`, keyed by the pool's `Currency`
15
15
  * `TypeName`. The stake cannot be destroyed while any registrations remain. Pool
16
16
  * registrations are mutated by `royalty_pool::pool` through the package-private
17
17
  * accessors below.
18
+ *
19
+ * Custody warning: `pool::claim_rewards` pays accrued rewards to the _caller_, and
20
+ * `Stake` is `key + store` — a bare shared stake (or one wrapped in a shared
21
+ * object that hands out `&mut`) is drainable by anyone. Stakes must stay
22
+ * address-owned, or wrapped by a contract that pins the reward route (e.g.
23
+ * `routed_stake`); the pool cannot enforce this itself.
18
24
  */
19
25
 
20
26
  import { MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';
@@ -229,7 +229,8 @@ export interface BorrowAsPluginOptions<Witness extends BcsType<any>> {
229
229
  * Temporarily lend the full custodied capability to an authorized plugin.
230
230
  *
231
231
  * `Borrow` has no abilities, so the exact capability must be returned through
232
- * `put_back` in this transaction.
232
+ * `put_back` in this transaction. Aborts if the supplied type is not the exact
233
+ * non-generic `0xpkg::witness::Witness` shape or is not authorized on this Vault.
233
234
  */
234
235
  export function borrowAsPlugin<Witness extends BcsType<any>>(options: BorrowAsPluginOptions<Witness>) {
235
236
  const packageAddress = options.package ?? '@local-pkg/vault';
package/src/contracts.ts CHANGED
@@ -20,6 +20,7 @@ export * as royaltyPoolStake from "./contracts/royalty_pool/stake.ts";
20
20
  export * as vault from "./contracts/vault/vault.ts";
21
21
  export * as compositionRoyaltyPool from "./contracts/composition_royalty_pool/composition_royalty_pool.ts";
22
22
  export * as recordingRoyaltyPool from "./contracts/recording_royalty_pool/recording_royalty_pool.ts";
23
+ export * as partyWallet from "./contracts/party_wallet/party_wallet.ts";
23
24
  export * as routedStake from "./contracts/routed_stake/routed_stake.ts";
24
25
  export * as compositionRoutedStake from "./contracts/composition_routed_stake/composition_routed_stake.ts";
25
26
 
@@ -5,9 +5,14 @@ import type {
5
5
  MisoDeployment,
6
6
  MisoNetwork,
7
7
  } from "@misonetwork/sdk/deployments";
8
+ import { MISO_DEPLOYMENTS } from "@misonetwork/sdk/deployments";
8
9
 
9
10
  /** Complete on-chain identity used by the Miso platform SDK on one network. */
10
11
  export interface MisoPlatformDeployment {
12
+ /** Network name this immutable deployment set belongs to. */
13
+ readonly network: MisoNetwork;
14
+ /** Full ledger genesis digest used to reject a mislabeled RPC endpoint. */
15
+ readonly chainIdentifier: string;
11
16
  /** The complete protocol and Party deployment this platform build targets. */
12
17
  readonly protocol: MisoDeployment;
13
18
  readonly packages: {
@@ -26,6 +31,8 @@ export interface MisoPlatformDeployment {
26
31
  readonly compositionRoyaltyPoolPlugin: string;
27
32
  /** Vault plugin that creates and cranks Recording royalty pools. */
28
33
  readonly recordingRoyaltyPoolPlugin: string;
34
+ /** Vault plugin that manages a Party's royalty-bearing wallet. */
35
+ readonly partyWalletPlugin: string;
29
36
  /** Generic stake wrapper used by the composition routed-stake plugin. */
30
37
  readonly routedStake: string;
31
38
  /** Vault plugin for Composition-owned Recording-share staking. */
@@ -61,12 +68,52 @@ export interface MisoPlatformDeployment {
61
68
  /**
62
69
  * Platform deployments bundled with this SDK release.
63
70
  *
64
- * This release deliberately contains no bundled network deployment. The core
65
- * protocol is being republished as an immutable stack, so every old package ID
66
- * is an incompatible ABI and must not be selected by accident. The admin-cli
67
- * deployment flow injects verified IDs in a follow-up change.
71
+ * IDs come only from the verified output of the Ledger-backed deployment run.
72
+ * Consumers may still pass an explicit complete deployment for custom networks.
68
73
  */
69
- export const MISO_PLATFORM_DEPLOYMENTS = {} as const satisfies Partial<
74
+ export const MISO_PLATFORM_DEPLOYMENTS = {
75
+ testnet: {
76
+ network: "testnet",
77
+ chainIdentifier: "69WiPg3DAQiwdxfncX6wYQ2siKwAe6L9BZthQea3JNMD",
78
+ protocol: MISO_DEPLOYMENTS.testnet,
79
+ packages: {
80
+ pressing: "0x95fba53c968978f75d6ca8a5e6f0f3ba83fdc3af301bc8419be354a3990af5b9",
81
+ record: "0x6150c474200f63bf73072642564886e5ecb1a4c0498ede31acd7908d94dbc83b",
82
+ minato: "0x8466e9864c1d947888e73b0e349b035bc22805579eef18f132966f56c8efe1d2",
83
+ credit: "0x20d8e38f49445cbae45fd66c262c2cbc4bf4cccab487b3fb443a491dc24071cd",
84
+ compositionCredits: "0x8b376967e9c32169727ec5341890f28c66d8577d7bfcecb83aa78aec3e84dce5",
85
+ recordingCredits: "0x7096a47b0ba12063c037d6d417bffade758665a3f313574c8ba218823cfb159a",
86
+ releaseCredits: "0xbe293700ef758c95b69838df6cfa8377b9cad1dd59cbf933974f68b1766d87b5",
87
+ royaltyPool: "0xbeddbcfc2c42ed1bcaa74dc241957621b48241451e10af136c20cdc7df8266b8",
88
+ vault: "0x7075ce4bfc2c738e774c94f1eeb7dc532a5f11ead9b4e3815d90dc16053eae9c",
89
+ compositionRoyaltyPoolPlugin: "0x8d61aecceb597441a0d675b44291706742859c8ff7755b3ed143823daa430c50",
90
+ recordingRoyaltyPoolPlugin: "0x6de70d4e87a328259f00f354227fb329c63fbf50efb87f057c5da26d6908e1d1",
91
+ partyWalletPlugin: "0xccf17215193d1ae64a47480c83df9af2881ffdb75e5ac842ab3898cadd9eeca0",
92
+ routedStake: "0x7a55b1841043efea865d65a6601e057400a79a0aa7bb11e781a25dbe622cbe5f",
93
+ compositionRoutedStakePlugin: "0x54fb4befa1be03f7457abfddcfb9334c20a8df3e01c44aa257f1c3d718cd57ee",
94
+ coverArt: "0x2dae28058b89df93224bacfb9af42fd3ab41f001c2c815fd57fd575024d9a50b",
95
+ releaseCoverArt: "0x649b18f2bb3d94f6a611a8e4ad3a29dcf8b7bba3f684056d60897a8a5e835106",
96
+ genre: "0x978d5f67a4fdc3eb688ed3aeb23c6c3c37ae44e358fb709001e6ab21e6f19f34",
97
+ releaseDescription: "0x3e26e4c4c5b3f51070d6d7bb1527eaa304f34ae5dfde078661e180e7594d6d28",
98
+ releaseDspLink: "0xd9f9e7240c397a82e4af1ecb9ec75b29a91ef4084127eabcf22fbf24e72cab2f",
99
+ releaseGenre: "0xc1012f9768f178ca908ef4a6cfd150ad33baaa3587dc2154ea9852858243cd57",
100
+ releaseKind: "0x3e74c960d9446ae2ebf228456ddc1b099d2090501c9cbcd284a999aa2e774e12",
101
+ releaseRevenueDistributorPlugin: "0x42a22b24129988a5ce8069a1f78eb31d9aa5edf360d729ae3c2c0b8ed18876e1",
102
+ recordingAdvisory: "0x28e0e72c5b892fc888a9007afa59ebe04ed8e47f12632ddb42cd685d09c4af2e",
103
+ recordingLanguage: "0x4b284a9435cf4f48e3785e4485d16be2fcbcef5beaa2b44b6556d9c1028e2c0d",
104
+ recordingMasterReference: "0x2b06ab58f2d5a915b42fc5879d52241fc72e804b3da782fa752b2d2f242170c0",
105
+ recordingPreview: "0x449aafe29707adf249df7e90355ecb19d939ea77d9e19fd3e2fdb220e73e74f0",
106
+ ori: "0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78",
107
+ },
108
+ objects: {
109
+ releaseRegistry: "0xf5941ae9640f6f24b75e921da16c95fd23d776b9e6518c275a50a5ce6337c8ba",
110
+ genreRegistry: "0xad34d6b717b8c59ed9ac47a520feab31324f0c04d70fd31922be45d8209fce1c",
111
+ },
112
+ legacy: {
113
+ releaseCoverArtPackages: [],
114
+ },
115
+ },
116
+ } as const satisfies Partial<
70
117
  Record<MisoNetwork, MisoPlatformDeployment>
71
118
  >;
72
119