@misofm/sdk 0.6.0 → 0.7.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 +13 -9
- package/dist/client.d.ts +17 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +22 -3
- package/dist/client.js.map +1 -1
- package/dist/contracts/release_registry/release_registry.d.ts +114 -0
- package/dist/contracts/release_registry/release_registry.d.ts.map +1 -0
- package/dist/contracts/release_registry/release_registry.js +119 -0
- package/dist/contracts/release_registry/release_registry.js.map +1 -0
- package/dist/contracts/royalty_pool/pool.d.ts +28 -2
- package/dist/contracts/royalty_pool/pool.d.ts.map +1 -1
- package/dist/contracts/royalty_pool/pool.js +28 -2
- package/dist/contracts/royalty_pool/pool.js.map +1 -1
- package/dist/contracts/utils/index.d.ts +44 -0
- package/dist/contracts/utils/index.d.ts.map +1 -1
- package/dist/contracts/utils/index.js +104 -2
- package/dist/contracts/utils/index.js.map +1 -1
- package/dist/contracts.d.ts +1 -0
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js +4 -1
- package/dist/contracts.js.map +1 -1
- package/dist/cover.d.ts +3 -6
- package/dist/cover.d.ts.map +1 -1
- package/dist/cover.js +7 -16
- package/dist/cover.js.map +1 -1
- package/dist/credits.d.ts.map +1 -1
- package/dist/credits.js +17 -43
- package/dist/credits.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/read/catalog.d.ts +2 -12
- package/dist/read/catalog.d.ts.map +1 -1
- package/dist/read/catalog.js +9 -24
- package/dist/read/catalog.js.map +1 -1
- package/dist/read/config.d.ts +3 -8
- package/dist/read/config.d.ts.map +1 -1
- package/dist/read/config.js +15 -50
- package/dist/read/config.js.map +1 -1
- package/dist/read/index.d.ts +1 -1
- 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/types.d.ts +1 -1
- package/dist/read/types.d.ts.map +1 -1
- package/dist/read/wallet.d.ts +3 -7
- package/dist/read/wallet.d.ts.map +1 -1
- package/dist/read/wallet.js +11 -38
- package/dist/read/wallet.js.map +1 -1
- package/dist/read/works.d.ts +2 -5
- package/dist/read/works.d.ts.map +1 -1
- package/dist/read/works.js +7 -37
- package/dist/read/works.js.map +1 -1
- package/dist/release-graph.d.ts +6 -19
- package/dist/release-graph.d.ts.map +1 -1
- package/dist/release-graph.js +29 -43
- package/dist/release-graph.js.map +1 -1
- package/dist/transactions.d.ts +12 -28
- package/dist/transactions.d.ts.map +1 -1
- package/dist/transactions.js +23 -28
- package/dist/transactions.js.map +1 -1
- package/package.json +3 -3
- package/src/client.ts +33 -2
- package/src/contracts/release_registry/release_registry.ts +160 -0
- package/src/contracts/royalty_pool/pool.ts +28 -2
- package/src/contracts/utils/index.ts +156 -4
- package/src/contracts.ts +5 -1
- package/src/cover.ts +8 -19
- package/src/credits.ts +23 -63
- package/src/index.ts +3 -1
- package/src/read/catalog.ts +9 -29
- package/src/read/config.ts +18 -58
- package/src/read/index.ts +0 -1
- package/src/read/types.ts +1 -1
- package/src/read/wallet.ts +11 -37
- package/src/read/works.ts +5 -42
- package/src/release-graph.ts +40 -75
- package/src/transactions.ts +33 -62
package/README.md
CHANGED
|
@@ -207,7 +207,8 @@ const thunk = client.misoPlatform.tx.publishComposition({
|
|
|
207
207
|
`client.misoPlatform.tx.publishRecording` and `publishCompositionAndRecording`
|
|
208
208
|
follow the same shape (the latter atomically, borrow-before-share, in one PTB —
|
|
209
209
|
see `@misonetwork/sdk`'s README for why the ordering is load-bearing).
|
|
210
|
-
`misoPackageId`/`minatoPackageId`
|
|
210
|
+
`misoPackageId`/`minatoPackageId`/`releaseRegistryPackageId`/`releaseRegistryId`
|
|
211
|
+
are optional on the client — a sell-only
|
|
211
212
|
client (e.g. a storefront that never mints new works) can omit them; the
|
|
212
213
|
publish builders throw at call time, not at client construction, if they're
|
|
213
214
|
missing.
|
|
@@ -218,7 +219,7 @@ For custom PTBs, the bare primitives (`disperseShares`, `finalizeComposition`,
|
|
|
218
219
|
```ts
|
|
219
220
|
import { publishReleaseGraph } from "@misofm/sdk";
|
|
220
221
|
|
|
221
|
-
// Every composition and recording, optional royalty pools,
|
|
222
|
+
// Every composition and recording, optional royalty pools, tracks, and
|
|
222
223
|
// the release — with the release id derived ON-CHAIN — in one atomic PTB.
|
|
223
224
|
const thunk = publishReleaseGraph({
|
|
224
225
|
compositions: [{ shareType, shareCurrencyId, shareTreasuryCapId, title: "Song", royaltyRateBps: 1000, shareRecipients, adminAddress }],
|
|
@@ -232,6 +233,7 @@ const thunk = publishReleaseGraph({
|
|
|
232
233
|
},
|
|
233
234
|
misoPackageId: "0x...",
|
|
234
235
|
minatoPackageId: "0x...",
|
|
236
|
+
releaseRegistryPackageId: "0x...",
|
|
235
237
|
});
|
|
236
238
|
```
|
|
237
239
|
|
|
@@ -373,7 +375,7 @@ carry an optional `RecordingRoleLevel` (`Producer`, `Vocalist`, `Engineer`,
|
|
|
373
375
|
|
|
374
376
|
```
|
|
375
377
|
src/
|
|
376
|
-
client.ts the client extension — misoPlatform({ packageId, settingsId, misoPackageId?, minatoPackageId? })
|
|
378
|
+
client.ts the client extension — misoPlatform({ packageId, settingsId, misoPackageId?, minatoPackageId?, releaseRegistryPackageId?, releaseRegistryId? })
|
|
377
379
|
pressing.ts facade: builders, readers, and the id derivations
|
|
378
380
|
queries.ts shared read plumbing (isNotFound, re-exported from @misonetwork/sdk)
|
|
379
381
|
transactions.ts the TxThunk contract + the opinionated publish flow (disperse/finalize/publish*)
|
|
@@ -401,17 +403,19 @@ the on-chain ABI:
|
|
|
401
403
|
bun run codegen # reads sui-codegen.config.ts → src/contracts/
|
|
402
404
|
```
|
|
403
405
|
|
|
404
|
-
`sui-codegen.config.ts` lists the **platform** package (`miso_pressing`)
|
|
406
|
+
`sui-codegen.config.ts` lists the **platform** package (`miso_pressing`), the
|
|
407
|
+
canonical release-minting extension (`release_registry`), and the
|
|
405
408
|
first-party **extension** packages (`royalty_pool`, `composition_royalty_pool`,
|
|
406
409
|
`recording_royalty_pool`, `cover_art`, `release_cover_art`,
|
|
407
410
|
`composition_credits`, `recording_credits`, `release_credits`). The protocol
|
|
408
|
-
CORE (`miso` — composition/recording/release/
|
|
411
|
+
CORE (`miso` — composition/recording/release/track) generates into
|
|
409
412
|
`@misonetwork/sdk` instead, which this package depends on for those bindings —
|
|
410
413
|
adding the core here to save an import is how the split this package exists to
|
|
411
414
|
enforce gets undone.
|
|
412
415
|
|
|
413
416
|
Paths resolve against sibling checkouts, so regenerating requires
|
|
414
|
-
`~/Documents/GitHub/misofm/{sdk, pressing, protocol-extensions}
|
|
417
|
+
`~/Documents/GitHub/misofm/{sdk, pressing, protocol-extensions}` and
|
|
418
|
+
`~/Documents/GitHub/misonetwork/{protocol, share}`.
|
|
415
419
|
|
|
416
420
|
## Dependency on `@misonetwork/sdk`
|
|
417
421
|
|
|
@@ -432,8 +436,8 @@ bun install
|
|
|
432
436
|
```
|
|
433
437
|
|
|
434
438
|
If you are changing both packages at once, `bun link` still works for a local
|
|
435
|
-
loop — register the protocol SDK with `bun link` in its checkout, `bun
|
|
436
|
-
@misonetwork/sdk` here
|
|
437
|
-
committing. Note that `file:` does NOT work for this: Bun copies a `file:`
|
|
439
|
+
loop — register the protocol SDK with `bun link` in its checkout, then run `bun
|
|
440
|
+
link @misonetwork/sdk` here. Keep `@misonetwork/sdk` at its released semver
|
|
441
|
+
range (`^0.5.0`) when committing. Note that `file:` does NOT work for this: Bun copies a `file:`
|
|
438
442
|
dependency while honouring `.gitignore`, and `@misonetwork/sdk` builds to a
|
|
439
443
|
gitignored `dist/`, so the copy arrives empty and nothing resolves.
|
package/dist/client.d.ts
CHANGED
|
@@ -2,9 +2,10 @@ import type { ClientWithCoreApi } from "@mysten/sui/client";
|
|
|
2
2
|
import type { Signer } from "@mysten/sui/cryptography";
|
|
3
3
|
import * as listingContract from "./contracts/miso_pressing/listing.ts";
|
|
4
4
|
import * as pressingContract from "./contracts/miso_pressing/pressing.ts";
|
|
5
|
+
import * as releaseRegistry from "./contracts/release_registry/release_registry.ts";
|
|
5
6
|
import type { BuyRecordParams, GetSaleParams, ListingView, OpenListingParams, OpenPressingParams, PressingView, SetListingPriceParams, SetListingStateParams, SetPressingStateParams } from "./pressing.ts";
|
|
6
7
|
import { publishShareCurrency, initializeShareCurrency } from "./transactions.ts";
|
|
7
|
-
import type { TxThunk, PublishCompositionParams, PublishRecordingParams, PublishCompositionAndRecordingParams } from "./transactions.ts";
|
|
8
|
+
import type { TxThunk, PublishCompositionParams, PublishRecordingParams, PublishCompositionAndRecordingParams, PublishReleaseParams } from "./transactions.ts";
|
|
8
9
|
import * as share from "./share.ts";
|
|
9
10
|
export interface MisoPlatformConfig {
|
|
10
11
|
/** The published `miso_pressing` package. */
|
|
@@ -27,11 +28,17 @@ export interface MisoPlatformConfig {
|
|
|
27
28
|
* builders (they disperse shares via minato).
|
|
28
29
|
*/
|
|
29
30
|
minatoPackageId?: string;
|
|
31
|
+
/** The published `release_registry` extension package used to mint releases. */
|
|
32
|
+
releaseRegistryPackageId?: string;
|
|
33
|
+
/** The one shared `ReleaseRegistry` object created by that package's `init`. */
|
|
34
|
+
releaseRegistryId?: string;
|
|
30
35
|
}
|
|
31
36
|
/** Params with the ids this client already knows dropped from the call site. */
|
|
32
37
|
type Configured<T> = Omit<T, "misoPressingPackageId" | "settingsId">;
|
|
33
38
|
/** Publish-builder params with the protocol/minato ids this client already knows dropped. */
|
|
34
39
|
type ConfiguredPublish<T> = Omit<T, "misoPackageId" | "minatoPackageId">;
|
|
40
|
+
/** Release-builder params with this client's core, share, and registry ids dropped. */
|
|
41
|
+
type ConfiguredRelease<T> = Omit<T, "misoPackageId" | "minatoPackageId" | "releaseRegistryPackageId" | "releaseRegistryId">;
|
|
35
42
|
export declare class MisoPlatformClient {
|
|
36
43
|
#private;
|
|
37
44
|
constructor(client: ClientWithCoreApi, config: MisoPlatformConfig);
|
|
@@ -66,6 +73,7 @@ export declare class MisoPlatformClient {
|
|
|
66
73
|
publishComposition: (p: ConfiguredPublish<PublishCompositionParams>) => TxThunk;
|
|
67
74
|
publishRecording: (p: ConfiguredPublish<PublishRecordingParams>) => TxThunk;
|
|
68
75
|
publishCompositionAndRecording: (p: ConfiguredPublish<PublishCompositionAndRecordingParams>) => TxThunk;
|
|
76
|
+
publishRelease: (p: ConfiguredRelease<PublishReleaseParams>) => TxThunk;
|
|
69
77
|
};
|
|
70
78
|
/** Publishes + initializes a fresh share currency (two txs). */
|
|
71
79
|
createShareCurrency(signer: Signer, params: share.CreateShareCurrencyParams): Promise<share.ShareCurrency>;
|
|
@@ -73,6 +81,7 @@ export declare class MisoPlatformClient {
|
|
|
73
81
|
readonly call: {
|
|
74
82
|
listing: typeof listingContract;
|
|
75
83
|
pressing: typeof pressingContract;
|
|
84
|
+
releaseRegistry: typeof releaseRegistry;
|
|
76
85
|
};
|
|
77
86
|
/** Generated BCS definitions, for parsing objects or events yourself. */
|
|
78
87
|
readonly bcs: {
|
|
@@ -117,6 +126,13 @@ export declare class MisoPlatformClient {
|
|
|
117
126
|
amount: import("@mysten/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
118
127
|
}, "Price.Floor">;
|
|
119
128
|
}, "@local-pkg/miso_pressing::listing::Price">;
|
|
129
|
+
ReleaseRegistry: import("./contracts/utils/index.ts").MoveStruct<{
|
|
130
|
+
id: import("@mysten/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
131
|
+
}, "@local-pkg/release_registry::release_registry::ReleaseRegistry">;
|
|
132
|
+
ReleaseRegistryCreatedEvent: import("./contracts/utils/index.ts").MoveStruct<{
|
|
133
|
+
registry_id: import("@mysten/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
134
|
+
created_by: import("@mysten/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
135
|
+
}, "@local-pkg/release_registry::release_registry::ReleaseRegistryCreatedEvent">;
|
|
120
136
|
};
|
|
121
137
|
}
|
|
122
138
|
/**
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,KAAK,eAAe,MAAM,sCAAsC,CAAC;AACxE,OAAO,KAAK,gBAAgB,MAAM,uCAAuC,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,KAAK,eAAe,MAAM,sCAAsC,CAAC;AACxE,OAAO,KAAK,gBAAgB,MAAM,uCAAuC,CAAC;AAC1E,OAAO,KAAK,eAAe,MAAM,kDAAkD,CAAC;AAgBpF,OAAO,KAAK,EACV,eAAe,EACf,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,YAAY,EACZ,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EAKxB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EACV,OAAO,EACP,wBAAwB,EACxB,sBAAsB,EACtB,oCAAoC,EACpC,oBAAoB,EACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AAEpC,MAAM,WAAW,kBAAkB;IACjC,6CAA6C;IAC7C,SAAS,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,UAAU,CAAC,EA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AAU,CAAC,eAAe,CAAC,KAAG,OAAO;0BAMlC,UAAU,CAAC,kBAAkB,CAAC,KAAG,OAAO;yBAEzC,UAAU,CAAC,iBAAiB,CAAC,KAAG,OAAO;6BAEnC,UAAU,CAAC,qBAAqB,CAAC,KAAG,OAAO;6BAE3C,UAAU,CAAC,qBAAqB,CAAC,KAAG,OAAO;8BAE1C,UAAU,CAAC,sBAAsB,CAAC,KAAG,OAAO;;;gCAU1C,iBAAiB,CAAC,wBAAwB,CAAC,KAAG,OAAO;8BAEvD,iBAAiB,CAAC,sBAAsB,CAAC,KAAG,OAAO;4CAErC,iBAAiB,CAAC,oCAAoC,CAAC,KAAG,OAAO;4BAEjF,iBAAiB,CAAC,oBAAoB,CAAC,KAAG,OAAO;MASrE;IAIF,gEAAgE;IAC1D,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,yBAAyB,GAAG,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC;IAMhH,2EAA2E;IAC3E,QAAQ,CAAC,IAAI;;;;MAA6E;IAE1F,yEAAyE;IACzE,QAAQ,CAAC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAOV;CACH;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,kBAAkB;;uBAGhC,iBAAiB;EAEvC"}
|
package/dist/client.js
CHANGED
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
import * as listingContract from "./contracts/miso_pressing/listing.js";
|
|
4
4
|
import * as pressingContract from "./contracts/miso_pressing/pressing.js";
|
|
5
|
+
import * as releaseRegistry from "./contracts/release_registry/release_registry.js";
|
|
5
6
|
import { buyRecord, deriveListingId, derivePressingAdminCapId, derivePressingId, deriveSaleIds, getListing, getPressing, getSale, openListing, openPressing, setListingPrice, setListingState, setPressingState, } from "./pressing.js";
|
|
6
|
-
import { publishShareCurrency, initializeShareCurrency, publishComposition, publishRecording, publishCompositionAndRecording, } from "./transactions.js";
|
|
7
|
+
import { publishShareCurrency, initializeShareCurrency, publishComposition, publishRecording, publishCompositionAndRecording, publishRelease, } from "./transactions.js";
|
|
7
8
|
import * as share from "./share.js";
|
|
8
9
|
export class MisoPlatformClient {
|
|
9
10
|
#client;
|
|
@@ -26,7 +27,7 @@ export class MisoPlatformClient {
|
|
|
26
27
|
const { misoPackageId } = this.#config;
|
|
27
28
|
if (!misoPackageId) {
|
|
28
29
|
throw new Error("misoPlatform: `misoPackageId` is required for the publish builders " +
|
|
29
|
-
"(publishComposition, publishRecording, publishCompositionAndRecording) — pass it to misoPlatform({ misoPackageId }).");
|
|
30
|
+
"(publishComposition, publishRecording, publishCompositionAndRecording, publishRelease) — pass it to misoPlatform({ misoPackageId }).");
|
|
30
31
|
}
|
|
31
32
|
return misoPackageId;
|
|
32
33
|
}
|
|
@@ -38,6 +39,13 @@ export class MisoPlatformClient {
|
|
|
38
39
|
}
|
|
39
40
|
return minatoPackageId;
|
|
40
41
|
}
|
|
42
|
+
#releaseRegistry() {
|
|
43
|
+
const { releaseRegistryPackageId: packageId, releaseRegistryId: id } = this.#config;
|
|
44
|
+
if (!packageId || !id) {
|
|
45
|
+
throw new Error("misoPlatform: `releaseRegistryPackageId` and `releaseRegistryId` are required to build a release — pass both to misoPlatform(...).");
|
|
46
|
+
}
|
|
47
|
+
return { packageId, id };
|
|
48
|
+
}
|
|
41
49
|
// ── Reads ─────────────────────────────────────────────────────────────────
|
|
42
50
|
/** The run itself, or `null` if this release has never opened one. */
|
|
43
51
|
getPressing(pressingId) {
|
|
@@ -80,6 +88,15 @@ export class MisoPlatformClient {
|
|
|
80
88
|
publishComposition: (p) => publishComposition({ ...p, misoPackageId: this.#misoPackageId(), minatoPackageId: this.#minatoPackageId() }),
|
|
81
89
|
publishRecording: (p) => publishRecording({ ...p, misoPackageId: this.#misoPackageId(), minatoPackageId: this.#minatoPackageId() }),
|
|
82
90
|
publishCompositionAndRecording: (p) => publishCompositionAndRecording({ ...p, misoPackageId: this.#misoPackageId(), minatoPackageId: this.#minatoPackageId() }),
|
|
91
|
+
publishRelease: (p) => {
|
|
92
|
+
const registry = this.#releaseRegistry();
|
|
93
|
+
return publishRelease({
|
|
94
|
+
...p,
|
|
95
|
+
misoPackageId: this.#misoPackageId(),
|
|
96
|
+
releaseRegistryPackageId: registry.packageId,
|
|
97
|
+
releaseRegistryId: registry.id,
|
|
98
|
+
});
|
|
99
|
+
},
|
|
83
100
|
};
|
|
84
101
|
// ── Share currency provisioning (executes; Signer pattern) ─────────────────
|
|
85
102
|
/** Publishes + initializes a fresh share currency (two txs). */
|
|
@@ -88,13 +105,15 @@ export class MisoPlatformClient {
|
|
|
88
105
|
}
|
|
89
106
|
// ── Generated layer ───────────────────────────────────────────────────────
|
|
90
107
|
/** Generated Move-call bindings, for commands this facade doesn't wrap. */
|
|
91
|
-
call = { listing: listingContract, pressing: pressingContract };
|
|
108
|
+
call = { listing: listingContract, pressing: pressingContract, releaseRegistry };
|
|
92
109
|
/** Generated BCS definitions, for parsing objects or events yourself. */
|
|
93
110
|
bcs = {
|
|
94
111
|
Pressing: pressingContract.Pressing,
|
|
95
112
|
PressingAdminCap: pressingContract.PressingAdminCap,
|
|
96
113
|
Listing: listingContract.Listing,
|
|
97
114
|
Price: listingContract.Price,
|
|
115
|
+
ReleaseRegistry: releaseRegistry.ReleaseRegistry,
|
|
116
|
+
ReleaseRegistryCreatedEvent: releaseRegistry.ReleaseRegistryCreatedEvent,
|
|
98
117
|
};
|
|
99
118
|
}
|
|
100
119
|
/**
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,sCAAsC;AA8BtC,OAAO,KAAK,eAAe,MAAM,sCAAsC,CAAC;AACxE,OAAO,KAAK,gBAAgB,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EACL,SAAS,EACT,eAAe,EACf,wBAAwB,EACxB,gBAAgB,EAChB,aAAa,EACb,UAAU,EACV,WAAW,EACX,OAAO,EACP,WAAW,EACX,YAAY,EACZ,eAAe,EACf,eAAe,EACf,gBAAgB,GACjB,MAAM,eAAe,CAAC;AAYvB,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,gBAAgB,EAChB,8BAA8B,
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,sCAAsC;AA8BtC,OAAO,KAAK,eAAe,MAAM,sCAAsC,CAAC;AACxE,OAAO,KAAK,gBAAgB,MAAM,uCAAuC,CAAC;AAC1E,OAAO,KAAK,eAAe,MAAM,kDAAkD,CAAC;AACpF,OAAO,EACL,SAAS,EACT,eAAe,EACf,wBAAwB,EACxB,gBAAgB,EAChB,aAAa,EACb,UAAU,EACV,WAAW,EACX,OAAO,EACP,WAAW,EACX,YAAY,EACZ,eAAe,EACf,eAAe,EACf,gBAAgB,GACjB,MAAM,eAAe,CAAC;AAYvB,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,gBAAgB,EAChB,8BAA8B,EAC9B,cAAc,GACf,MAAM,mBAAmB,CAAC;AAQ3B,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AAsCpC,MAAM,OAAO,kBAAkB;IACpB,OAAO,CAAoB;IAC3B,OAAO,CAAqB;IAErC,YAAY,MAAyB,EAAE,MAA0B;QAC/D,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;IAChC,CAAC;IAED,SAAS;QACP,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC;QACpC,IAAI,CAAC,UAAU,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,CAAC,mBAAmB,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACjE,CAAC;IAED,6EAA6E;IAE7E,2EAA2E;IAClE,IAAI,GAAG,EAAE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,gBAAgB,EAAE,eAAe,EAAE,CAAC;IAE1F,yEAAyE;IAChE,GAAG,GAAG;QACb,QAAQ,EAAE,gBAAgB,CAAC,QAAQ;QACnC,gBAAgB,EAAE,gBAAgB,CAAC,gBAAgB;QACnD,OAAO,EAAE,eAAe,CAAC,OAAO;QAChC,KAAK,EAAE,eAAe,CAAC,KAAK;QAC5B,eAAe,EAAE,eAAe,CAAC,eAAe;QAChD,2BAA2B,EAAE,eAAe,CAAC,2BAA2B;KACzE,CAAC;CACH;AAED;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,MAA0B;IACrD,OAAO;QACL,IAAI,EAAE,cAAuB;QAC7B,QAAQ,EAAE,CAAC,MAAyB,EAAE,EAAE,CAAC,IAAI,kBAAkB,CAAC,MAAM,EAAE,MAAM,CAAC;KAChF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/**
|
|
5
|
+
* The recommended canonical parent namespace for `miso::release::new`.
|
|
6
|
+
*
|
|
7
|
+
* `miso::release::new` takes `parent: &mut UID` and derives every release's id
|
|
8
|
+
* from `(parent, digest)`: core is deliberately parent-agnostic and implements no
|
|
9
|
+
* coordination policy of its own (see the "Consent scope" section of
|
|
10
|
+
* `miso::release`'s module doc). This package supplies the one recommended parent
|
|
11
|
+
* — a shared, permissionless, undeletable `UID` — and is deliberately the _only_
|
|
12
|
+
* policy it implements: it neither gates who may assemble a release through it nor
|
|
13
|
+
* interprets what a `Track` means.
|
|
14
|
+
*
|
|
15
|
+
* ### One instance, ever
|
|
16
|
+
*
|
|
17
|
+
* The module exposes no constructor: the only `ReleaseRegistry` that can ever
|
|
18
|
+
* exist is the canonical one created and shared by package initialization. "The
|
|
19
|
+
* registry" is therefore unambiguous on-chain — the type itself names the
|
|
20
|
+
* namespace, not a config convention. Every `new_release` takes `&mut` on that one
|
|
21
|
+
* shared object, so release creation through it serializes per checkpoint; the
|
|
22
|
+
* ceiling is accepted — releases are rare events. Alternative namespaces are still
|
|
23
|
+
* possible, but they live in other packages: core is parent-agnostic, and any
|
|
24
|
+
* object exposing a `&mut UID` (a release escrow, for instance) can parent its own
|
|
25
|
+
* releases; ids derived under different parents never collide, by construction of
|
|
26
|
+
* `derive_address`.
|
|
27
|
+
*
|
|
28
|
+
* ### Liveness
|
|
29
|
+
*
|
|
30
|
+
* The canonical instance is shared at publish, and this module exposes no delete
|
|
31
|
+
* function and no `uid_mut`: its only capability is being a derivation parent.
|
|
32
|
+
* That undeletability is a consent guarantee, not an accident — a `Track`'s
|
|
33
|
+
* `target_release_id` commits to this namespace's liveness (see `miso::release`'s
|
|
34
|
+
* module doc), and a deletable parent would strand every track and offer that ever
|
|
35
|
+
* targeted it. Keeping the surface to exactly one capability is what makes that
|
|
36
|
+
* guarantee durable: there is nothing else here to reason about.
|
|
37
|
+
*
|
|
38
|
+
* ### Permissionless
|
|
39
|
+
*
|
|
40
|
+
* No capability gates `new_release`: anyone holding a fully-formed `vector<Track>`
|
|
41
|
+
* may assemble and claim a release through this registry. That is not a gap —
|
|
42
|
+
* consent already lives in the `Track`s themselves, each one minted by its
|
|
43
|
+
* recording's admin via cap-gated `miso::track::new` against this exact digest.
|
|
44
|
+
* Assembly is bookkeeping over consent already given, not a second authorization
|
|
45
|
+
* step.
|
|
46
|
+
*/
|
|
47
|
+
import { MoveStruct, type RawTransactionArgument } from '../utils/index.js';
|
|
48
|
+
import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
|
|
49
|
+
export declare const ReleaseRegistry: MoveStruct<{
|
|
50
|
+
id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
51
|
+
}, "@local-pkg/release_registry::release_registry::ReleaseRegistry">;
|
|
52
|
+
export declare const ReleaseRegistryCreatedEvent: MoveStruct<{
|
|
53
|
+
registry_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
54
|
+
created_by: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
55
|
+
}, "@local-pkg/release_registry::release_registry::ReleaseRegistryCreatedEvent">;
|
|
56
|
+
export interface NewReleaseArguments {
|
|
57
|
+
self: RawTransactionArgument<string>;
|
|
58
|
+
title: RawTransactionArgument<string>;
|
|
59
|
+
tracks: TransactionArgument;
|
|
60
|
+
nonce: RawTransactionArgument<number | bigint>;
|
|
61
|
+
}
|
|
62
|
+
export interface NewReleaseOptions {
|
|
63
|
+
package?: string;
|
|
64
|
+
arguments: NewReleaseArguments | [
|
|
65
|
+
self: RawTransactionArgument<string>,
|
|
66
|
+
title: RawTransactionArgument<string>,
|
|
67
|
+
tracks: TransactionArgument,
|
|
68
|
+
nonce: RawTransactionArgument<number | bigint>
|
|
69
|
+
];
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Assembles a release by delegating to `miso::release::new` with this registry as
|
|
73
|
+
* parent. Returns the `(Release, ReleaseAdminCap)` pair rather than transferring
|
|
74
|
+
* or sharing either: the release is not on-chain-final until `release::publish`
|
|
75
|
+
* consumes it by value — typically later in the same PTB — and where the cap ends
|
|
76
|
+
* up is the caller's decision, not this function's.
|
|
77
|
+
*/
|
|
78
|
+
export declare function newRelease(options: NewReleaseOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
79
|
+
export interface DeriveTargetReleaseIdArguments {
|
|
80
|
+
self: RawTransactionArgument<string>;
|
|
81
|
+
recordingIds: RawTransactionArgument<Array<string>>;
|
|
82
|
+
trackSplitValues: RawTransactionArgument<Array<number | bigint>>;
|
|
83
|
+
nonce: RawTransactionArgument<number | bigint>;
|
|
84
|
+
}
|
|
85
|
+
export interface DeriveTargetReleaseIdOptions {
|
|
86
|
+
package?: string;
|
|
87
|
+
arguments: DeriveTargetReleaseIdArguments | [
|
|
88
|
+
self: RawTransactionArgument<string>,
|
|
89
|
+
recordingIds: RawTransactionArgument<Array<string>>,
|
|
90
|
+
trackSplitValues: RawTransactionArgument<Array<number | bigint>>,
|
|
91
|
+
nonce: RawTransactionArgument<number | bigint>
|
|
92
|
+
];
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Derives the release id `new_release` would produce for the given inputs under
|
|
96
|
+
* this registry, without creating anything. Delegates to
|
|
97
|
+
* `miso::release::derive_target_release_id` with this registry's own id as parent.
|
|
98
|
+
*/
|
|
99
|
+
export declare function deriveTargetReleaseId(options: DeriveTargetReleaseIdOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
100
|
+
export interface IdArguments {
|
|
101
|
+
self: RawTransactionArgument<string>;
|
|
102
|
+
}
|
|
103
|
+
export interface IdOptions {
|
|
104
|
+
package?: string;
|
|
105
|
+
arguments: IdArguments | [
|
|
106
|
+
self: RawTransactionArgument<string>
|
|
107
|
+
];
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Returns the registry's object id — the derivation parent that
|
|
111
|
+
* `derive_target_release_id` and `new_release` both commit to.
|
|
112
|
+
*/
|
|
113
|
+
export declare function id(options: IdOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
114
|
+
//# sourceMappingURL=release_registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"release_registry.d.ts","sourceRoot":"","sources":["../../../src/contracts/release_registry/release_registry.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAGhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,OA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EAAE,sBAAsB,CAAC,MAAM,CAAC;QACpC,YAAY,EAAE,sBAAsB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACnD,gBAAgB,EAAE,sBAAsB,CAAC,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;QAChE,KAAK,EAAE,sBAAsB,CAAC,MAAM,GAAG,MAAM,CAAC;KACjD,CAAC;CACL;AACD;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,4BAA4B,IAS/D,IAAI,WAAW,0DAM1B;AACD,MAAM,WAAW,WAAW;IACxB,IAAI,EAAE,sBAAsB,CAAC,MAAM,CAAC,CAAC;CACxC;AACD,MAAM,WAAW,SAAS;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,WAAW,GAAG;QACrB,IAAI,EAAE,sBAAsB,CAAC,MAAM,CAAC;KACvC,CAAC;CACL;AACD;;;GAGG;AACH,wBAAgB,EAAE,CAAC,OAAO,EAAE,SAAS,IAMzB,IAAI,WAAW,0DAM1B"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/**
|
|
5
|
+
* The recommended canonical parent namespace for `miso::release::new`.
|
|
6
|
+
*
|
|
7
|
+
* `miso::release::new` takes `parent: &mut UID` and derives every release's id
|
|
8
|
+
* from `(parent, digest)`: core is deliberately parent-agnostic and implements no
|
|
9
|
+
* coordination policy of its own (see the "Consent scope" section of
|
|
10
|
+
* `miso::release`'s module doc). This package supplies the one recommended parent
|
|
11
|
+
* — a shared, permissionless, undeletable `UID` — and is deliberately the _only_
|
|
12
|
+
* policy it implements: it neither gates who may assemble a release through it nor
|
|
13
|
+
* interprets what a `Track` means.
|
|
14
|
+
*
|
|
15
|
+
* ### One instance, ever
|
|
16
|
+
*
|
|
17
|
+
* The module exposes no constructor: the only `ReleaseRegistry` that can ever
|
|
18
|
+
* exist is the canonical one created and shared by package initialization. "The
|
|
19
|
+
* registry" is therefore unambiguous on-chain — the type itself names the
|
|
20
|
+
* namespace, not a config convention. Every `new_release` takes `&mut` on that one
|
|
21
|
+
* shared object, so release creation through it serializes per checkpoint; the
|
|
22
|
+
* ceiling is accepted — releases are rare events. Alternative namespaces are still
|
|
23
|
+
* possible, but they live in other packages: core is parent-agnostic, and any
|
|
24
|
+
* object exposing a `&mut UID` (a release escrow, for instance) can parent its own
|
|
25
|
+
* releases; ids derived under different parents never collide, by construction of
|
|
26
|
+
* `derive_address`.
|
|
27
|
+
*
|
|
28
|
+
* ### Liveness
|
|
29
|
+
*
|
|
30
|
+
* The canonical instance is shared at publish, and this module exposes no delete
|
|
31
|
+
* function and no `uid_mut`: its only capability is being a derivation parent.
|
|
32
|
+
* That undeletability is a consent guarantee, not an accident — a `Track`'s
|
|
33
|
+
* `target_release_id` commits to this namespace's liveness (see `miso::release`'s
|
|
34
|
+
* module doc), and a deletable parent would strand every track and offer that ever
|
|
35
|
+
* targeted it. Keeping the surface to exactly one capability is what makes that
|
|
36
|
+
* guarantee durable: there is nothing else here to reason about.
|
|
37
|
+
*
|
|
38
|
+
* ### Permissionless
|
|
39
|
+
*
|
|
40
|
+
* No capability gates `new_release`: anyone holding a fully-formed `vector<Track>`
|
|
41
|
+
* may assemble and claim a release through this registry. That is not a gap —
|
|
42
|
+
* consent already lives in the `Track`s themselves, each one minted by its
|
|
43
|
+
* recording's admin via cap-gated `miso::track::new` against this exact digest.
|
|
44
|
+
* Assembly is bookkeeping over consent already given, not a second authorization
|
|
45
|
+
* step.
|
|
46
|
+
*/
|
|
47
|
+
import { MoveStruct, normalizeMoveArguments } from '../utils/index.js';
|
|
48
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
49
|
+
import {} from '@mysten/sui/transactions';
|
|
50
|
+
const $moduleName = '@local-pkg/release_registry::release_registry';
|
|
51
|
+
export const ReleaseRegistry = new MoveStruct({ name: `${$moduleName}::ReleaseRegistry`, fields: {
|
|
52
|
+
id: bcs.Address
|
|
53
|
+
} });
|
|
54
|
+
export const ReleaseRegistryCreatedEvent = new MoveStruct({ name: `${$moduleName}::ReleaseRegistryCreatedEvent`, fields: {
|
|
55
|
+
registry_id: bcs.Address,
|
|
56
|
+
created_by: bcs.Address
|
|
57
|
+
} });
|
|
58
|
+
/**
|
|
59
|
+
* Assembles a release by delegating to `miso::release::new` with this registry as
|
|
60
|
+
* parent. Returns the `(Release, ReleaseAdminCap)` pair rather than transferring
|
|
61
|
+
* or sharing either: the release is not on-chain-final until `release::publish`
|
|
62
|
+
* consumes it by value — typically later in the same PTB — and where the cap ends
|
|
63
|
+
* up is the caller's decision, not this function's.
|
|
64
|
+
*/
|
|
65
|
+
export function newRelease(options) {
|
|
66
|
+
const packageAddress = options.package ?? '@local-pkg/release_registry';
|
|
67
|
+
const argumentsTypes = [
|
|
68
|
+
null,
|
|
69
|
+
'0x1::string::String',
|
|
70
|
+
'vector<null>',
|
|
71
|
+
'u256'
|
|
72
|
+
];
|
|
73
|
+
const parameterNames = ["self", "title", "tracks", "nonce"];
|
|
74
|
+
return (tx) => tx.moveCall({
|
|
75
|
+
package: packageAddress,
|
|
76
|
+
module: 'release_registry',
|
|
77
|
+
function: 'new_release',
|
|
78
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Derives the release id `new_release` would produce for the given inputs under
|
|
83
|
+
* this registry, without creating anything. Delegates to
|
|
84
|
+
* `miso::release::derive_target_release_id` with this registry's own id as parent.
|
|
85
|
+
*/
|
|
86
|
+
export function deriveTargetReleaseId(options) {
|
|
87
|
+
const packageAddress = options.package ?? '@local-pkg/release_registry';
|
|
88
|
+
const argumentsTypes = [
|
|
89
|
+
null,
|
|
90
|
+
'vector<0x2::object::ID>',
|
|
91
|
+
'vector<u64>',
|
|
92
|
+
'u256'
|
|
93
|
+
];
|
|
94
|
+
const parameterNames = ["self", "recordingIds", "trackSplitValues", "nonce"];
|
|
95
|
+
return (tx) => tx.moveCall({
|
|
96
|
+
package: packageAddress,
|
|
97
|
+
module: 'release_registry',
|
|
98
|
+
function: 'derive_target_release_id',
|
|
99
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Returns the registry's object id — the derivation parent that
|
|
104
|
+
* `derive_target_release_id` and `new_release` both commit to.
|
|
105
|
+
*/
|
|
106
|
+
export function id(options) {
|
|
107
|
+
const packageAddress = options.package ?? '@local-pkg/release_registry';
|
|
108
|
+
const argumentsTypes = [
|
|
109
|
+
null
|
|
110
|
+
];
|
|
111
|
+
const parameterNames = ["self"];
|
|
112
|
+
return (tx) => tx.moveCall({
|
|
113
|
+
package: packageAddress,
|
|
114
|
+
module: 'release_registry',
|
|
115
|
+
function: 'id',
|
|
116
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=release_registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"release_registry.js","sourceRoot":"","sources":["../../../src/contracts/release_registry/release_registry.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAGhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,OAAO,EAAE,UAAU,EAAE,sBAAsB,EAA+B,MAAM,mBAAmB,CAAC;AACpG,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACtC,OAAO,EAA8C,MAAM,0BAA0B,CAAC;AACtF,MAAM,WAAW,GAAG,+CAA+C,CAAC;AACpE,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,UAAU,CAAC,EAAE,IAAI,EAAE,GAAG,WAAW,mBAAmB,EAAE,MAAM,EAAE;QACzF,EAA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AE,0BAA0B;QACpC,SAAS,EAAE,sBAAsB,CAAC,OAAO,CAAC,SAAS,EAAE,cAAc,EAAE,cAAc,CAAC;KACvF,CAAC,CAAC;AACP,CAAC;AAUD;;;GAGG;AACH,MAAM,UAAU,EAAE,CAAC,OAAkB;IACjC,MAAM,cAAc,GAAG,OAAO,CAAC,OAAO,IAAI,6BAA6B,CAAC;IACxE,MAAM,cAAc,GAAG;QACnB,IAAI;KACqB,CAAC;IAC9B,MAAM,cAAc,GAAG,CAAC,MAAM,CAAC,CAAC;IAChC,OAAO,CAAC,EAAe,EAAE,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC;QACpC,OAAO,EAAE,cAAc;QACvB,MAAM,EAAE,kBAAkB;QAC1B,QAAQ,EAAE,IAAI;QACd,SAAS,EAAE,sBAAsB,CAAC,OAAO,CAAC,SAAS,EAAE,cAAc,EAAE,cAAc,CAAC;KACvF,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
3
|
**************************************************************/
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Accumulator-based royalty distribution pool for the protocol's share tokens.
|
|
6
6
|
*
|
|
7
7
|
* A `RoyaltyPool<Share, Currency>` is a derived object of any UID-bearing parent.
|
|
8
8
|
* Its address is deterministically derived from `(parent_id, Currency)` — at most
|
|
@@ -19,7 +19,33 @@
|
|
|
19
19
|
* transfers or balances credited to the pool's funds-accumulator. Both are
|
|
20
20
|
* permissionless: anyone who notices stuck funds can fold them in. The canonical
|
|
21
21
|
* funding path remains `deposit(balance)` from a higher-layer extension (e.g.
|
|
22
|
-
* `composition_royalty_distributor`) that pulls from the parent's address.
|
|
22
|
+
* `composition_royalty_distributor`) that pulls from the parent's address. Note
|
|
23
|
+
* the recovery valves run through `deposit`, which aborts while no shares are
|
|
24
|
+
* staked — and the pool has no other withdrawal path — so funds sent to the pool's
|
|
25
|
+
* address before the first registration stay locked until a stake registers.
|
|
26
|
+
* Payers should always target the parent's address, never the pool's.
|
|
27
|
+
*
|
|
28
|
+
* ### No activation delay (deliberate)
|
|
29
|
+
*
|
|
30
|
+
* Registration earns from the next deposit onward; there is no bonding or
|
|
31
|
+
* unbonding period (contrast Sui native staking's next-epoch activation). With the
|
|
32
|
+
* protocol's fixed-supply share token this is safe: a stake's take of any deposit
|
|
33
|
+
* is `v · s / S` with `S` (total registered) bounded by the share supply, so a
|
|
34
|
+
* continuously registered stake is guaranteed at least its pro-rata share of total
|
|
35
|
+
* supply on every deposit. Short-lived or just-in-time registrations can only
|
|
36
|
+
* compete for the _unregistered_ supply's drift — the designed incentive for being
|
|
37
|
+
* registered — never below any registered stake's floor.
|
|
38
|
+
*
|
|
39
|
+
* ### Precision
|
|
40
|
+
*
|
|
41
|
+
* The share token's shape is fixed at issuance by the protocol — exactly 10¹³ base
|
|
42
|
+
* units, 6 decimals, supply made immutable via `miso_share::share::initialize`
|
|
43
|
+
* (`make_supply_fixed`) — so `staked_shares ≤ 10¹³` objectively. A deposit of
|
|
44
|
+
* `value ≥ 1` base units therefore advances the accumulator by
|
|
45
|
+
* `value · PRECISION / staked_shares ≥ 10¹⁸ / 10¹³ = 10⁵`: the truncation-to-zero
|
|
46
|
+
* case that would permanently lock a deposit in the pool balance is impossible by
|
|
47
|
+
* construction, not by convention. Sub-base-unit claim residue (the remaining
|
|
48
|
+
* source of locked dust) is documented on `unregister_stake`.
|
|
23
49
|
*/
|
|
24
50
|
import { MoveStruct, MoveTuple, type RawTransactionArgument } from '../utils/index.js';
|
|
25
51
|
import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pool.d.ts","sourceRoot":"","sources":["../../../src/contracts/royalty_pool/pool.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAGhE
|
|
1
|
+
{"version":3,"file":"pool.d.ts","sourceRoot":"","sources":["../../../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AC;IACjB,SAAS,EAAE,2BAA2B,GAAG;QACrC,IAAI,EAAE,sBAAsB,CAAC,MAAM,CAAC;KACvC,CAAC;IACF,aAAa,EAAE;QACX,MAAM;QACN,MAAM;KACT,CAAC;CACL;AACD,gFAAgF;AAChF,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,yBAAyB,IAMzD,IAAI,WAAW,0DAO1B;AACD,MAAM,WAAW,uBAAuB;IACpC,QAAQ,EAAE,sBAAsB,CAAC,MAAM,CAAC,CAAC;CAC5C;AACD,MAAM,WAAW,qBAAqB;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,uBAAuB,GAAG;QACjC,QAAQ,EAAE,sBAAsB,CAAC,MAAM,CAAC;KAC3C,CAAC;IACF,aAAa,EAAE;QACX,MAAM;KACT,CAAC;CACL;AACD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,qBAAqB,IAMjD,IAAI,WAAW,0DAO1B;AACD,MAAM,WAAW,0BAA0B;IACvC,IAAI,EAAE,sBAAsB,CAAC,MAAM,CAAC,CAAC;IACrC,QAAQ,EAAE,sBAAsB,CAAC,MAAM,CAAC,CAAC;CAC5C;AACD,MAAM,WAAW,wBAAwB;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,0BAA0B,GAAG;QACpC,IAAI,EAAE,sBAAsB,CAAC,MAAM,CAAC;QACpC,QAAQ,EAAE,sBAAsB,CAAC,MAAM,CAAC;KAC3C,CAAC;IACF,aAAa,EAAE;QACX,MAAM;QACN,MAAM;KACT,CAAC;CACL;AACD,iFAAiF;AACjF,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,IAOvD,IAAI,WAAW,0DAO1B"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
3
|
**************************************************************/
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Accumulator-based royalty distribution pool for the protocol's share tokens.
|
|
6
6
|
*
|
|
7
7
|
* A `RoyaltyPool<Share, Currency>` is a derived object of any UID-bearing parent.
|
|
8
8
|
* Its address is deterministically derived from `(parent_id, Currency)` — at most
|
|
@@ -19,7 +19,33 @@
|
|
|
19
19
|
* transfers or balances credited to the pool's funds-accumulator. Both are
|
|
20
20
|
* permissionless: anyone who notices stuck funds can fold them in. The canonical
|
|
21
21
|
* funding path remains `deposit(balance)` from a higher-layer extension (e.g.
|
|
22
|
-
* `composition_royalty_distributor`) that pulls from the parent's address.
|
|
22
|
+
* `composition_royalty_distributor`) that pulls from the parent's address. Note
|
|
23
|
+
* the recovery valves run through `deposit`, which aborts while no shares are
|
|
24
|
+
* staked — and the pool has no other withdrawal path — so funds sent to the pool's
|
|
25
|
+
* address before the first registration stay locked until a stake registers.
|
|
26
|
+
* Payers should always target the parent's address, never the pool's.
|
|
27
|
+
*
|
|
28
|
+
* ### No activation delay (deliberate)
|
|
29
|
+
*
|
|
30
|
+
* Registration earns from the next deposit onward; there is no bonding or
|
|
31
|
+
* unbonding period (contrast Sui native staking's next-epoch activation). With the
|
|
32
|
+
* protocol's fixed-supply share token this is safe: a stake's take of any deposit
|
|
33
|
+
* is `v · s / S` with `S` (total registered) bounded by the share supply, so a
|
|
34
|
+
* continuously registered stake is guaranteed at least its pro-rata share of total
|
|
35
|
+
* supply on every deposit. Short-lived or just-in-time registrations can only
|
|
36
|
+
* compete for the _unregistered_ supply's drift — the designed incentive for being
|
|
37
|
+
* registered — never below any registered stake's floor.
|
|
38
|
+
*
|
|
39
|
+
* ### Precision
|
|
40
|
+
*
|
|
41
|
+
* The share token's shape is fixed at issuance by the protocol — exactly 10¹³ base
|
|
42
|
+
* units, 6 decimals, supply made immutable via `miso_share::share::initialize`
|
|
43
|
+
* (`make_supply_fixed`) — so `staked_shares ≤ 10¹³` objectively. A deposit of
|
|
44
|
+
* `value ≥ 1` base units therefore advances the accumulator by
|
|
45
|
+
* `value · PRECISION / staked_shares ≥ 10¹⁸ / 10¹³ = 10⁵`: the truncation-to-zero
|
|
46
|
+
* case that would permanently lock a deposit in the pool balance is impossible by
|
|
47
|
+
* construction, not by convention. Sub-base-unit claim residue (the remaining
|
|
48
|
+
* source of locked dust) is documented on `unregister_stake`.
|
|
23
49
|
*/
|
|
24
50
|
import { MoveStruct, MoveTuple, normalizeMoveArguments } from '../utils/index.js';
|
|
25
51
|
import { bcs } from '@mysten/sui/bcs';
|