@misofm/platform 0.25.0 → 0.26.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 +144 -45
- package/dist/auth.d.ts +8 -13
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +78 -59
- package/dist/auth.js.map +1 -1
- package/dist/catalog.d.ts +5 -5
- package/dist/catalog.d.ts.map +1 -1
- package/dist/catalog.js +33 -21
- package/dist/catalog.js.map +1 -1
- package/dist/client.d.ts +17 -30
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +53 -75
- package/dist/client.js.map +1 -1
- package/dist/cover.d.ts +4 -3
- package/dist/cover.d.ts.map +1 -1
- package/dist/cover.js +28 -17
- package/dist/cover.js.map +1 -1
- package/dist/credits.d.ts +12 -10
- package/dist/credits.d.ts.map +1 -1
- package/dist/credits.js +60 -33
- package/dist/credits.js.map +1 -1
- package/dist/deployments.d.ts +21 -13
- package/dist/deployments.d.ts.map +1 -1
- package/dist/deployments.js +84 -37
- package/dist/deployments.js.map +1 -1
- package/dist/errors.d.ts +91 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +111 -0
- package/dist/errors.js.map +1 -0
- package/dist/execute.d.ts +3 -1
- package/dist/execute.d.ts.map +1 -1
- package/dist/execute.js +9 -4
- package/dist/execute.js.map +1 -1
- package/dist/genre.d.ts +25 -41
- package/dist/genre.d.ts.map +1 -1
- package/dist/genre.js +71 -20
- package/dist/genre.js.map +1 -1
- package/dist/party/client.d.ts +16 -13
- package/dist/party/client.d.ts.map +1 -1
- package/dist/party/client.js +33 -22
- package/dist/party/client.js.map +1 -1
- package/dist/party/extensions/links.d.ts +2 -1
- package/dist/party/extensions/links.d.ts.map +1 -1
- package/dist/party/extensions/links.js +2 -1
- package/dist/party/extensions/links.js.map +1 -1
- package/dist/party/queries.d.ts +12 -11
- package/dist/party/queries.d.ts.map +1 -1
- package/dist/party/queries.js +63 -57
- package/dist/party/queries.js.map +1 -1
- package/dist/party/types.d.ts +31 -20
- package/dist/party/types.d.ts.map +1 -1
- package/dist/party/types.js +82 -1
- package/dist/party/types.js.map +1 -1
- package/dist/pressing.d.ts +55 -35
- package/dist/pressing.d.ts.map +1 -1
- package/dist/pressing.js +99 -76
- package/dist/pressing.js.map +1 -1
- package/dist/queries.d.ts +1 -1
- package/dist/queries.d.ts.map +1 -1
- package/dist/queries.js +5 -4
- package/dist/queries.js.map +1 -1
- package/dist/read/artist.d.ts +6 -4
- package/dist/read/artist.d.ts.map +1 -1
- package/dist/read/artist.js +29 -27
- package/dist/read/artist.js.map +1 -1
- package/dist/read/catalog.d.ts +20 -17
- package/dist/read/catalog.d.ts.map +1 -1
- package/dist/read/catalog.js +120 -141
- package/dist/read/catalog.js.map +1 -1
- package/dist/read/client.d.ts +10 -9
- package/dist/read/client.d.ts.map +1 -1
- package/dist/read/client.js.map +1 -1
- package/dist/read/genres.d.ts +5 -3
- package/dist/read/genres.d.ts.map +1 -1
- package/dist/read/genres.js +18 -15
- package/dist/read/genres.js.map +1 -1
- package/dist/read/index.d.ts.map +1 -1
- package/dist/read/index.js +7 -1
- package/dist/read/index.js.map +1 -1
- package/dist/read/receipts.d.ts +15 -6
- package/dist/read/receipts.d.ts.map +1 -1
- package/dist/read/receipts.js +73 -60
- package/dist/read/receipts.js.map +1 -1
- package/dist/read/wallet.d.ts +11 -9
- package/dist/read/wallet.d.ts.map +1 -1
- package/dist/read/wallet.js +117 -132
- package/dist/read/wallet.js.map +1 -1
- package/dist/read/works.d.ts +9 -16
- package/dist/read/works.d.ts.map +1 -1
- package/dist/read/works.js +48 -117
- package/dist/read/works.js.map +1 -1
- package/dist/recording-extensions.d.ts +8 -7
- package/dist/recording-extensions.d.ts.map +1 -1
- package/dist/recording-extensions.js +30 -63
- package/dist/recording-extensions.js.map +1 -1
- package/dist/release-extensions.d.ts +3 -2
- package/dist/release-extensions.d.ts.map +1 -1
- package/dist/release-extensions.js +9 -10
- package/dist/release-extensions.js.map +1 -1
- package/dist/royalty.d.ts +51 -51
- package/dist/royalty.d.ts.map +1 -1
- package/dist/royalty.js +93 -11
- package/dist/royalty.js.map +1 -1
- package/dist/share.d.ts +7 -6
- package/dist/share.d.ts.map +1 -1
- package/dist/share.js +37 -30
- package/dist/share.js.map +1 -1
- package/dist/vault.d.ts +20 -8
- package/dist/vault.d.ts.map +1 -1
- package/dist/vault.js +31 -15
- package/dist/vault.js.map +1 -1
- package/package.json +11 -4
- package/src/auth.ts +89 -70
- package/src/catalog.ts +33 -49
- package/src/client.ts +117 -97
- package/src/cover.ts +17 -26
- package/src/credits.ts +43 -75
- package/src/deployments.ts +103 -69
- package/src/errors.ts +156 -0
- package/src/execute.ts +10 -6
- package/src/genre.ts +38 -23
- package/src/party/client.ts +35 -23
- package/src/party/extensions/links.ts +3 -2
- package/src/party/queries.ts +77 -65
- package/src/party/types.ts +52 -48
- package/src/pressing.ts +158 -161
- package/src/queries.ts +5 -5
- package/src/read/artist.ts +47 -42
- package/src/read/catalog.ts +200 -223
- package/src/read/client.ts +12 -11
- package/src/read/genres.ts +24 -16
- package/src/read/index.ts +7 -1
- package/src/read/receipts.ts +128 -67
- package/src/read/wallet.ts +194 -162
- package/src/read/works.ts +75 -194
- package/src/recording-extensions.ts +38 -92
- package/src/release-extensions.ts +7 -12
- package/src/royalty.ts +117 -20
- package/src/share.ts +44 -29
- package/src/vault.ts +47 -24
package/dist/party/queries.js
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
// Copyright (c) Miso Labs, Inc.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
// Typed reads for the Party EXTENSIONS: fetch an on-chain dynamic field via the
|
|
4
|
+
// Core API, BCS-parse it through the generated struct, and map to the public
|
|
5
|
+
// camelCase types. Party core reads (`getPartyById`, group membership, …) live
|
|
6
|
+
// in `@misofm/partyos` — this file only covers profile/media/roles/tags/genres/
|
|
7
|
+
// ctas/links.
|
|
8
|
+
import { Effect, Option, Stream } from "effect";
|
|
3
9
|
import { deriveDynamicFieldID } from "@mysten/sui/utils";
|
|
4
10
|
import { bcs } from "@mysten/sui/bcs";
|
|
5
|
-
import {
|
|
11
|
+
import { decodeBcs, getOptionalObjectContent, listDynamicFields, SuiClient, } from "@misofm/effect";
|
|
6
12
|
import { Profile as ProfileBcs, ProfileKey as ProfileKeyBcs } from "../contracts/party_profile/party_profile.js";
|
|
7
13
|
import { Media as MediaBcs, MediaKey as MediaKeyBcs } from "../contracts/party_media/party_media.js";
|
|
8
14
|
import { ArtistRole as ArtistRoleBcs, RolesKey as RolesKeyBcs } from "../contracts/party_roles/party_roles.js";
|
|
@@ -11,75 +17,79 @@ import { GenresKey as GenresKeyBcs } from "../contracts/party_genre/party_genre.
|
|
|
11
17
|
import { Cta as CtaBcs, CtasKey as CtasKeyBcs } from "../contracts/party_cta/party_cta.js";
|
|
12
18
|
import { mapCtas, mapGenres, mapMedia, mapProfile, mapRoles, mapTags } from "./internal.js";
|
|
13
19
|
import { buildLink, platformForDataType } from "./extensions/links.js";
|
|
20
|
+
import { Cta, Media, PlatformLink, Profile } from "./types.js";
|
|
14
21
|
// The profile is a dynamic field on the party UID under an empty `ProfileKey()`
|
|
15
22
|
// (Move's implicit `dummy_field: bool` → one zero byte).
|
|
16
23
|
const ProfileField = bcs.struct("Field", { id: bcs.Address, name: ProfileKeyBcs, value: ProfileBcs });
|
|
17
24
|
const PROFILE_KEY_BYTES = ProfileKeyBcs.serialize([false]).toBytes();
|
|
18
|
-
/** Fetches a party's profile
|
|
19
|
-
export
|
|
25
|
+
/** Fetches a party's profile; `Option.none()` if none is set. */
|
|
26
|
+
export const getProfile = Effect.fn("getProfile")(function* (partyId, partyProfilePackageId) {
|
|
20
27
|
const fieldId = deriveDynamicFieldID(partyId, `${partyProfilePackageId}::party_profile::ProfileKey`, PROFILE_KEY_BYTES);
|
|
21
|
-
const
|
|
22
|
-
if (
|
|
23
|
-
return
|
|
24
|
-
|
|
25
|
-
|
|
28
|
+
const contentOpt = yield* getOptionalObjectContent(fieldId);
|
|
29
|
+
if (Option.isNone(contentOpt))
|
|
30
|
+
return Option.none();
|
|
31
|
+
const profile = yield* decodeBcs({ parse: (bytes) => mapProfile(partyId, ProfileField.parse(bytes).value) }, Profile, contentOpt.value.content, { type: "Profile", objectId: fieldId });
|
|
32
|
+
return Option.some(profile);
|
|
33
|
+
});
|
|
26
34
|
// Media is a dynamic field on the party UID under an empty `MediaKey()` (same
|
|
27
35
|
// implicit `dummy_field: bool` → one zero byte as the profile key).
|
|
28
36
|
const MediaField = bcs.struct("Field", { id: bcs.Address, name: MediaKeyBcs, value: MediaBcs });
|
|
29
37
|
const MEDIA_KEY_BYTES = MediaKeyBcs.serialize([false]).toBytes();
|
|
30
|
-
/** Fetches a party's media (avatar + header)
|
|
31
|
-
export
|
|
38
|
+
/** Fetches a party's media (avatar + header); `Option.none()` if none is set. */
|
|
39
|
+
export const getMedia = Effect.fn("getMedia")(function* (partyId, partyMediaPackageId) {
|
|
32
40
|
const fieldId = deriveDynamicFieldID(partyId, `${partyMediaPackageId}::party_media::MediaKey`, MEDIA_KEY_BYTES);
|
|
33
|
-
const
|
|
34
|
-
if (
|
|
35
|
-
return
|
|
36
|
-
|
|
37
|
-
|
|
41
|
+
const contentOpt = yield* getOptionalObjectContent(fieldId);
|
|
42
|
+
if (Option.isNone(contentOpt))
|
|
43
|
+
return Option.none();
|
|
44
|
+
const media = yield* decodeBcs({ parse: (bytes) => mapMedia(partyId, MediaField.parse(bytes).value) }, Media, contentOpt.value.content, { type: "Media", objectId: fieldId });
|
|
45
|
+
return Option.some(media);
|
|
46
|
+
});
|
|
38
47
|
// === Collection extension reads (roles / tags / genres / ctas) ===
|
|
39
48
|
//
|
|
40
49
|
// Each is a single dynamic field on the party UID under an empty positional key
|
|
41
50
|
// (Move's implicit `dummy_field: bool` → one zero byte, same as the profile key).
|
|
51
|
+
// Absence keeps the pre-migration policy: an empty collection, not a failure.
|
|
42
52
|
const ROLES_KEY_BYTES = RolesKeyBcs.serialize([false]).toBytes();
|
|
43
53
|
const RolesField = bcs.struct("Field", { id: bcs.Address, name: RolesKeyBcs, value: bcs.vector(ArtistRoleBcs) });
|
|
44
54
|
/** The party's artist-type roles (display names), or `[]` if none are set. */
|
|
45
|
-
export
|
|
55
|
+
export const getRoles = Effect.fn("getRoles")(function* (partyId, partyRolesPackageId) {
|
|
46
56
|
const fieldId = deriveDynamicFieldID(partyId, `${partyRolesPackageId}::party_roles::RolesKey`, ROLES_KEY_BYTES);
|
|
47
|
-
const
|
|
48
|
-
if (
|
|
57
|
+
const contentOpt = yield* getOptionalObjectContent(fieldId);
|
|
58
|
+
if (Option.isNone(contentOpt))
|
|
49
59
|
return [];
|
|
50
|
-
return mapRoles(RolesField.parse(content).value);
|
|
51
|
-
}
|
|
60
|
+
return mapRoles(RolesField.parse(contentOpt.value.content).value);
|
|
61
|
+
});
|
|
52
62
|
const TAGS_KEY_BYTES = TagsKeyBcs.serialize([false]).toBytes();
|
|
53
63
|
const TagsField = bcs.struct("Field", { id: bcs.Address, name: TagsKeyBcs, value: bcs.vector(bcs.string()) });
|
|
54
64
|
/** The party's free-form tags, or `[]` if none are set. */
|
|
55
|
-
export
|
|
65
|
+
export const getTags = Effect.fn("getTags")(function* (partyId, partyTagsPackageId) {
|
|
56
66
|
const fieldId = deriveDynamicFieldID(partyId, `${partyTagsPackageId}::party_tags::TagsKey`, TAGS_KEY_BYTES);
|
|
57
|
-
const
|
|
58
|
-
if (
|
|
67
|
+
const contentOpt = yield* getOptionalObjectContent(fieldId);
|
|
68
|
+
if (Option.isNone(contentOpt))
|
|
59
69
|
return [];
|
|
60
|
-
return mapTags(TagsField.parse(content).value);
|
|
61
|
-
}
|
|
70
|
+
return mapTags(TagsField.parse(contentOpt.value.content).value);
|
|
71
|
+
});
|
|
62
72
|
const GENRES_KEY_BYTES = GenresKeyBcs.serialize([false]).toBytes();
|
|
63
73
|
const GenresField = bcs.struct("Field", { id: bcs.Address, name: GenresKeyBcs, value: bcs.vector(bcs.Address) });
|
|
64
74
|
/** The party's genre object ids, or `[]` if none are set. */
|
|
65
|
-
export
|
|
75
|
+
export const getGenres = Effect.fn("getGenres")(function* (partyId, partyGenrePackageId) {
|
|
66
76
|
const fieldId = deriveDynamicFieldID(partyId, `${partyGenrePackageId}::party_genre::GenresKey`, GENRES_KEY_BYTES);
|
|
67
|
-
const
|
|
68
|
-
if (
|
|
77
|
+
const contentOpt = yield* getOptionalObjectContent(fieldId);
|
|
78
|
+
if (Option.isNone(contentOpt))
|
|
69
79
|
return [];
|
|
70
|
-
return mapGenres(GenresField.parse(content).value);
|
|
71
|
-
}
|
|
80
|
+
return mapGenres(GenresField.parse(contentOpt.value.content).value);
|
|
81
|
+
});
|
|
72
82
|
const CTAS_KEY_BYTES = CtasKeyBcs.serialize([false]).toBytes();
|
|
73
83
|
// The CTA field's value is a bare `vector<Cta>` (not a wrapper struct).
|
|
74
84
|
const CtasField = bcs.struct("Field", { id: bcs.Address, name: CtasKeyBcs, value: bcs.vector(CtaBcs) });
|
|
75
85
|
/** The party's ordered CTA list (position is priority), or `[]` if none is set. */
|
|
76
|
-
export
|
|
86
|
+
export const getCtas = Effect.fn("getCtas")(function* (partyId, partyCtaPackageId) {
|
|
77
87
|
const fieldId = deriveDynamicFieldID(partyId, `${partyCtaPackageId}::party_cta::CtasKey`, CTAS_KEY_BYTES);
|
|
78
|
-
const
|
|
79
|
-
if (
|
|
88
|
+
const contentOpt = yield* getOptionalObjectContent(fieldId);
|
|
89
|
+
if (Option.isNone(contentOpt))
|
|
80
90
|
return [];
|
|
81
|
-
return mapCtas(CtasField.parse(content).value);
|
|
82
|
-
}
|
|
91
|
+
return mapCtas(CtasField.parse(contentOpt.value.content).value).map((c) => new Cta(c));
|
|
92
|
+
});
|
|
83
93
|
// === Platform-link reads ===
|
|
84
94
|
//
|
|
85
95
|
// Each platform is an independent `PlatformLink<Data>` dynamic field keyed by
|
|
@@ -91,28 +101,24 @@ export async function getCtas(client, partyId, partyCtaPackageId) {
|
|
|
91
101
|
const PlatformLinkField = bcs.struct("Field", { id: bcs.Address, name: bcs.bool(), value: bcs.string() });
|
|
92
102
|
const PLATFORM_LINK_KEY_RE = /::platform_link::PlatformLinkKey<(.+)>$/;
|
|
93
103
|
/** All external-platform links attached to a party (social, music, professional). */
|
|
94
|
-
export
|
|
104
|
+
export const getLinks = Effect.fn("getLinks")(function* (partyId) {
|
|
105
|
+
const fields = Array.from(yield* Stream.runCollect(listDynamicFields(partyId)));
|
|
95
106
|
const links = [];
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
continue;
|
|
112
|
-
links.push(buildLink(platform, PlatformLinkField.parse(content).value));
|
|
113
|
-
}
|
|
114
|
-
cursor = page.hasNextPage ? page.cursor : null;
|
|
115
|
-
} while (cursor);
|
|
107
|
+
for (const f of fields) {
|
|
108
|
+
if (typeof f.name?.type !== "string")
|
|
109
|
+
continue;
|
|
110
|
+
const match = f.name.type.match(PLATFORM_LINK_KEY_RE);
|
|
111
|
+
const dataType = match?.[1];
|
|
112
|
+
if (!dataType)
|
|
113
|
+
continue;
|
|
114
|
+
const platform = platformForDataType(dataType);
|
|
115
|
+
if (!platform)
|
|
116
|
+
continue;
|
|
117
|
+
const contentOpt = yield* getOptionalObjectContent(f.fieldId);
|
|
118
|
+
if (Option.isNone(contentOpt))
|
|
119
|
+
continue;
|
|
120
|
+
links.push(buildLink(platform, PlatformLinkField.parse(contentOpt.value.content).value));
|
|
121
|
+
}
|
|
116
122
|
return links;
|
|
117
|
-
}
|
|
123
|
+
});
|
|
118
124
|
//# sourceMappingURL=queries.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queries.js","sourceRoot":"","sources":["../../src/party/queries.ts"],"names":[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C,CAAC;IAChF,MAAM,KAAK,GAAmB,EAAE,CAAC;IACjC,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE,CAAC;QACvB,IAAI,OAAO,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,QAAQ;YAAE,SAAS;QAC/C,MAAM,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;QACtD,MAAM,QAAQ,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;QAC5B,IAAI,CAAC,QAAQ;YAAE,SAAS;QACxB,MAAM,QAAQ,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAAC;QAC/C,IAAI,CAAC,QAAQ;YAAE,SAAS;QACxB,MAAM,UAAU,GAAG,KAAK,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;QAC9D,IAAI,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC;YAAE,SAAS;QACxC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,iBAAiB,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IAC3F,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC,CAAC"}
|
package/dist/party/types.d.ts
CHANGED
|
@@ -1,43 +1,54 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
declare const Profile_base: Schema.Class<Profile, Schema.Struct<{
|
|
3
|
+
readonly partyId: Schema.String;
|
|
4
|
+
readonly bioShort: Schema.String;
|
|
5
|
+
readonly bioLong: Schema.optional<Schema.String>;
|
|
5
6
|
/** ISO 3166-1 alpha-2 country code, e.g. "GB". */
|
|
6
|
-
country
|
|
7
|
+
readonly country: Schema.optional<Schema.String>;
|
|
7
8
|
/** ISO 639-1 language codes, e.g. ["en"]. */
|
|
8
|
-
languages:
|
|
9
|
+
readonly languages: Schema.$Array<Schema.String>;
|
|
10
|
+
}>, {}>;
|
|
11
|
+
export declare class Profile extends Profile_base {
|
|
9
12
|
}
|
|
13
|
+
declare const Media_base: Schema.Class<Media, Schema.Struct<{
|
|
14
|
+
readonly partyId: Schema.String;
|
|
15
|
+
/** Walrus quilt blob id (base64url) holding the party's images. */
|
|
16
|
+
readonly quiltId: Schema.String;
|
|
17
|
+
}>, {}>;
|
|
10
18
|
/**
|
|
11
19
|
* A party's imagery, stored on-chain as a single Walrus quilt. Individual images
|
|
12
20
|
* (avatar, header, …) are quilt patches addressed by identifier off-chain — see
|
|
13
21
|
* `mediaUrls` / `MEDIA_IDENTIFIERS` in `extensions/media`.
|
|
14
22
|
*/
|
|
15
|
-
export
|
|
16
|
-
partyId: string;
|
|
17
|
-
/** Walrus quilt blob id (base64url) holding the party's images. */
|
|
18
|
-
quiltId: string;
|
|
23
|
+
export declare class Media extends Media_base {
|
|
19
24
|
}
|
|
25
|
+
declare const Cta_base: Schema.Class<Cta, Schema.Struct<{
|
|
26
|
+
readonly label: Schema.String;
|
|
27
|
+
readonly url: Schema.String;
|
|
28
|
+
}>, {}>;
|
|
20
29
|
/** A single call-to-action on a party: a labeled external link. Position is priority. */
|
|
21
|
-
export
|
|
22
|
-
label: string;
|
|
23
|
-
url: string;
|
|
30
|
+
export declare class Cta extends Cta_base {
|
|
24
31
|
}
|
|
25
32
|
/**
|
|
26
33
|
* A platform this SDK knows how to build a link for. One key per external
|
|
27
34
|
* platform, spanning social (`x`, `instagram`, …), music (`spotify`, `bandcamp`,
|
|
28
35
|
* …), and professional/industry (`website`, `patreon`, …) payloads.
|
|
29
36
|
*/
|
|
30
|
-
export
|
|
37
|
+
export declare const PlatformKey: Schema.Literals<readonly ["x", "instagram", "threads", "tiktok", "youtube", "discord", "telegram", "reddit", "twitch", "facebook", "spotify", "bandcamp", "soundcloud", "appleMusic", "deezer", "tidal", "amazonMusic", "audiomack", "website", "bookingPage", "managementPage", "publisherPage", "labelPage", "epk", "patreon", "substack", "kofi"]>;
|
|
38
|
+
export type PlatformKey = typeof PlatformKey.Type;
|
|
39
|
+
declare const PlatformLink_base: Schema.Class<PlatformLink, Schema.Struct<{
|
|
40
|
+
readonly platform: Schema.Literals<readonly ["x", "instagram", "threads", "tiktok", "youtube", "discord", "telegram", "reddit", "twitch", "facebook", "spotify", "bandcamp", "soundcloud", "appleMusic", "deezer", "tidal", "amazonMusic", "audiomack", "website", "bookingPage", "managementPage", "publisherPage", "labelPage", "epk", "patreon", "substack", "kofi"]>;
|
|
41
|
+
/** The platform-native identifier stored on-chain (handle / id / subdomain / URL). */
|
|
42
|
+
readonly value: Schema.String;
|
|
43
|
+
/** The public profile URL, rebuilt from `value`. */
|
|
44
|
+
readonly url: Schema.String;
|
|
45
|
+
}>, {}>;
|
|
31
46
|
/**
|
|
32
47
|
* One external-platform link attached to a party. Only the native identifier
|
|
33
48
|
* (`value` — a handle, artist id, subdomain, or full URL) is stored on-chain; the
|
|
34
49
|
* public `url` is rebuilt client-side from it.
|
|
35
50
|
*/
|
|
36
|
-
export
|
|
37
|
-
platform: PlatformKey;
|
|
38
|
-
/** The platform-native identifier stored on-chain (handle / id / subdomain / URL). */
|
|
39
|
-
value: string;
|
|
40
|
-
/** The public profile URL, rebuilt from `value`. */
|
|
41
|
-
url: string;
|
|
51
|
+
export declare class PlatformLink extends PlatformLink_base {
|
|
42
52
|
}
|
|
53
|
+
export {};
|
|
43
54
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/party/types.ts"],"names":[],"mappings":"AAQA,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/party/types.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;;;;;IAM9B,kDAAkD;;IAElD,6CAA6C;;;AAN/C,qBAAa,OAAQ,SAAQ,YAQ3B;CAAG;;;IASH,mEAAmE;;;AAPrE;;;;GAIG;AACH,qBAAa,KAAM,SAAQ,UAIzB;CAAG;;;;;AAEL,yFAAyF;AACzF,qBAAa,GAAI,SAAQ,QAGvB;CAAG;AAEL;;;;GAIG;AACH,eAAO,MAAM,WAAW,uVA+BtB,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,WAAW,CAAC,IAAI,CAAC;;;IAShD,sFAAsF;;IAEtF,oDAAoD;;;AATtD;;;;GAIG;AACH,qBAAa,YAAa,SAAQ,iBAMhC;CAAG"}
|
package/dist/party/types.js
CHANGED
|
@@ -1,4 +1,85 @@
|
|
|
1
1
|
// Copyright (c) Miso Labs, Inc.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
|
|
3
|
+
// Public, camelCase result types for the Party EXTENSIONS. The mappers in
|
|
4
|
+
// ./internal.ts turn the generated (snake_case, Move-shaped) parse output into
|
|
5
|
+
// these. The Party object model itself (`Party`, `PartyKind`) is owned by
|
|
6
|
+
// `@misofm/partyos` — import it from there.
|
|
7
|
+
import { Schema } from "effect";
|
|
8
|
+
export class Profile extends Schema.Class("@misofm/platform/Profile")({
|
|
9
|
+
partyId: Schema.String,
|
|
10
|
+
bioShort: Schema.String,
|
|
11
|
+
bioLong: Schema.optional(Schema.String),
|
|
12
|
+
/** ISO 3166-1 alpha-2 country code, e.g. "GB". */
|
|
13
|
+
country: Schema.optional(Schema.String),
|
|
14
|
+
/** ISO 639-1 language codes, e.g. ["en"]. */
|
|
15
|
+
languages: Schema.Array(Schema.String),
|
|
16
|
+
}) {
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* A party's imagery, stored on-chain as a single Walrus quilt. Individual images
|
|
20
|
+
* (avatar, header, …) are quilt patches addressed by identifier off-chain — see
|
|
21
|
+
* `mediaUrls` / `MEDIA_IDENTIFIERS` in `extensions/media`.
|
|
22
|
+
*/
|
|
23
|
+
export class Media extends Schema.Class("@misofm/platform/Media")({
|
|
24
|
+
partyId: Schema.String,
|
|
25
|
+
/** Walrus quilt blob id (base64url) holding the party's images. */
|
|
26
|
+
quiltId: Schema.String,
|
|
27
|
+
}) {
|
|
28
|
+
}
|
|
29
|
+
/** A single call-to-action on a party: a labeled external link. Position is priority. */
|
|
30
|
+
export class Cta extends Schema.Class("@misofm/platform/Cta")({
|
|
31
|
+
label: Schema.String,
|
|
32
|
+
url: Schema.String,
|
|
33
|
+
}) {
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* A platform this SDK knows how to build a link for. One key per external
|
|
37
|
+
* platform, spanning social (`x`, `instagram`, …), music (`spotify`, `bandcamp`,
|
|
38
|
+
* …), and professional/industry (`website`, `patreon`, …) payloads.
|
|
39
|
+
*/
|
|
40
|
+
export const PlatformKey = Schema.Literals([
|
|
41
|
+
// Social (party_social)
|
|
42
|
+
"x",
|
|
43
|
+
"instagram",
|
|
44
|
+
"threads",
|
|
45
|
+
"tiktok",
|
|
46
|
+
"youtube",
|
|
47
|
+
"discord",
|
|
48
|
+
"telegram",
|
|
49
|
+
"reddit",
|
|
50
|
+
"twitch",
|
|
51
|
+
"facebook",
|
|
52
|
+
// Music (party_music)
|
|
53
|
+
"spotify",
|
|
54
|
+
"bandcamp",
|
|
55
|
+
"soundcloud",
|
|
56
|
+
"appleMusic",
|
|
57
|
+
"deezer",
|
|
58
|
+
"tidal",
|
|
59
|
+
"amazonMusic",
|
|
60
|
+
"audiomack",
|
|
61
|
+
// Professional / industry (party_pro_link)
|
|
62
|
+
"website",
|
|
63
|
+
"bookingPage",
|
|
64
|
+
"managementPage",
|
|
65
|
+
"publisherPage",
|
|
66
|
+
"labelPage",
|
|
67
|
+
"epk",
|
|
68
|
+
"patreon",
|
|
69
|
+
"substack",
|
|
70
|
+
"kofi",
|
|
71
|
+
]);
|
|
72
|
+
/**
|
|
73
|
+
* One external-platform link attached to a party. Only the native identifier
|
|
74
|
+
* (`value` — a handle, artist id, subdomain, or full URL) is stored on-chain; the
|
|
75
|
+
* public `url` is rebuilt client-side from it.
|
|
76
|
+
*/
|
|
77
|
+
export class PlatformLink extends Schema.Class("@misofm/platform/PlatformLink")({
|
|
78
|
+
platform: PlatformKey,
|
|
79
|
+
/** The platform-native identifier stored on-chain (handle / id / subdomain / URL). */
|
|
80
|
+
value: Schema.String,
|
|
81
|
+
/** The public profile URL, rebuilt from `value`. */
|
|
82
|
+
url: Schema.String,
|
|
83
|
+
}) {
|
|
84
|
+
}
|
|
4
85
|
//# sourceMappingURL=types.js.map
|
package/dist/party/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/party/types.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,sCAAsC"}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/party/types.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,sCAAsC;AAEtC,0EAA0E;AAC1E,+EAA+E;AAC/E,0EAA0E;AAC1E,4CAA4C;AAE5C,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,MAAM,OAAO,OAAQ,SAAQ,MAAM,CAAC,KAAK,CAAU,0BAA0B,CAAC,CAAC;IAC7E,OAAO,EAAE,MAAM,CAAC,MAAM;IACtB,QAAQ,EAAE,MAAM,CAAC,MAAM;IACvB,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;IACvC,kDAAkD;IAClD,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;IACvC,6CAA6C;IAC7C,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC;CACvC,CAAC;CAAG;AAEL;;;;GAIG;AACH,MAAM,OAAO,KAAM,SAAQ,MAAM,CAAC,KAAK,CAAQ,wBAAwB,CAAC,CAAC;IACvE,OAAO,EAAE,MAAM,CAAC,MAAM;IACtB,mEAAmE;IACnE,OAAO,EAAE,MAAM,CAAC,MAAM;CACvB,CAAC;CAAG;AAEL,yFAAyF;AACzF,MAAM,OAAO,GAAI,SAAQ,MAAM,CAAC,KAAK,CAAM,sBAAsB,CAAC,CAAC;IACjE,KAAK,EAAE,MAAM,CAAC,MAAM;IACpB,GAAG,EAAE,MAAM,CAAC,MAAM;CACnB,CAAC;CAAG;AAEL;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,QAAQ,CAAC;IACzC,wBAAwB;IACxB,GAAG;IACH,WAAW;IACX,SAAS;IACT,QAAQ;IACR,SAAS;IACT,SAAS;IACT,UAAU;IACV,QAAQ;IACR,QAAQ;IACR,UAAU;IACV,sBAAsB;IACtB,SAAS;IACT,UAAU;IACV,YAAY;IACZ,YAAY;IACZ,QAAQ;IACR,OAAO;IACP,aAAa;IACb,WAAW;IACX,2CAA2C;IAC3C,SAAS;IACT,aAAa;IACb,gBAAgB;IAChB,eAAe;IACf,WAAW;IACX,KAAK;IACL,SAAS;IACT,UAAU;IACV,MAAM;CACP,CAAC,CAAC;AAGH;;;;GAIG;AACH,MAAM,OAAO,YAAa,SAAQ,MAAM,CAAC,KAAK,CAAe,+BAA+B,CAAC,CAAC;IAC5F,QAAQ,EAAE,WAAW;IACrB,sFAAsF;IACtF,KAAK,EAAE,MAAM,CAAC,MAAM;IACpB,oDAAoD;IACpD,GAAG,EAAE,MAAM,CAAC,MAAM;CACnB,CAAC;CAAG"}
|
package/dist/pressing.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Effect, Schema } from "effect";
|
|
2
|
+
import { ObjectTypeMismatchError, type SuiClient } from "@misofm/effect";
|
|
3
|
+
import type { BcsDecodeError, SuiRpcError } from "@misofm/effect";
|
|
2
4
|
import type { TxThunk } from "./transactions.ts";
|
|
3
5
|
import { type U64Input } from "./vault.ts";
|
|
4
6
|
/** Fixed cross-client parity vector for the finalized Record/Record Shop
|
|
@@ -90,39 +92,55 @@ export interface PurchaseRecordParams {
|
|
|
90
92
|
recordShopPackageId: string;
|
|
91
93
|
}
|
|
92
94
|
export declare function purchaseRecord(p: PurchaseRecordParams): TxThunk;
|
|
93
|
-
|
|
94
|
-
id:
|
|
95
|
-
releaseId:
|
|
96
|
-
edition:
|
|
97
|
-
supply:
|
|
98
|
-
maxSupply:
|
|
99
|
-
distributors:
|
|
95
|
+
declare const Pressing_base: Schema.Class<Pressing, Schema.Struct<{
|
|
96
|
+
readonly id: Schema.String;
|
|
97
|
+
readonly releaseId: Schema.String;
|
|
98
|
+
readonly edition: Schema.Number;
|
|
99
|
+
readonly supply: Schema.Number;
|
|
100
|
+
readonly maxSupply: Schema.NullOr<Schema.Number>;
|
|
101
|
+
readonly distributors: Schema.$Array<Schema.String>;
|
|
102
|
+
}>, {}>;
|
|
103
|
+
/** One permanent record-production run derived from a release. */
|
|
104
|
+
export declare class Pressing extends Pressing_base {
|
|
100
105
|
}
|
|
101
|
-
|
|
102
|
-
id:
|
|
103
|
-
releaseId:
|
|
104
|
-
pressingId:
|
|
105
|
-
pricing: {
|
|
106
|
-
kind: "fixed"
|
|
107
|
-
amount:
|
|
108
|
-
}
|
|
109
|
-
state:
|
|
110
|
-
currencyType:
|
|
106
|
+
declare const Listing_base: Schema.Class<Listing, Schema.Struct<{
|
|
107
|
+
readonly id: Schema.String;
|
|
108
|
+
readonly releaseId: Schema.String;
|
|
109
|
+
readonly pressingId: Schema.String;
|
|
110
|
+
readonly pricing: Schema.Struct<{
|
|
111
|
+
readonly kind: Schema.Literals<readonly ["fixed", "floor"]>;
|
|
112
|
+
readonly amount: Schema.String;
|
|
113
|
+
}>;
|
|
114
|
+
readonly state: Schema.Literals<readonly ["enabled", "disabled"]>;
|
|
115
|
+
readonly currencyType: Schema.String;
|
|
116
|
+
}>, {}>;
|
|
117
|
+
/** One permanent currency offer derived from a Pressing. */
|
|
118
|
+
export declare class Listing extends Listing_base {
|
|
111
119
|
}
|
|
112
|
-
|
|
113
|
-
id:
|
|
114
|
-
releaseId:
|
|
115
|
-
pressingId:
|
|
116
|
-
edition:
|
|
117
|
-
number:
|
|
118
|
-
purchaseCurrency:
|
|
119
|
-
purchasePrice:
|
|
120
|
-
purchasedBy:
|
|
121
|
-
purchasedTimestampMs:
|
|
120
|
+
declare const PressingRecord_base: Schema.Class<PressingRecord, Schema.Struct<{
|
|
121
|
+
readonly id: Schema.String;
|
|
122
|
+
readonly releaseId: Schema.String;
|
|
123
|
+
readonly pressingId: Schema.String;
|
|
124
|
+
readonly edition: Schema.Number;
|
|
125
|
+
readonly number: Schema.Number;
|
|
126
|
+
readonly purchaseCurrency: Schema.String;
|
|
127
|
+
readonly purchasePrice: Schema.String;
|
|
128
|
+
readonly purchasedBy: Schema.String;
|
|
129
|
+
readonly purchasedTimestampMs: Schema.String;
|
|
130
|
+
}>, {}>;
|
|
131
|
+
/**
|
|
132
|
+
* One purchased copy of a Pressing. Named `PressingRecord`, not `Record` — the
|
|
133
|
+
* Move type is `record::Record`, but `Record` collides with TypeScript's
|
|
134
|
+
* built-in `Record<K, V>` utility type, which this codebase uses constantly.
|
|
135
|
+
*/
|
|
136
|
+
export declare class PressingRecord extends PressingRecord_base {
|
|
122
137
|
}
|
|
123
|
-
|
|
124
|
-
export declare
|
|
125
|
-
|
|
138
|
+
/** One permanent pressing by id, or `null` when no such Pressing exists. */
|
|
139
|
+
export declare const getPressing: (pressingId: string, recordPackageId: string) => Effect.Effect<Pressing | null, BcsDecodeError | ObjectTypeMismatchError | SuiRpcError, SuiClient>;
|
|
140
|
+
/** One currency-specific listing by id, or `null` when no such Listing exists. */
|
|
141
|
+
export declare const getListing: (listingId: string, recordShopPackageId: string) => Effect.Effect<Listing | null, BcsDecodeError | ObjectTypeMismatchError | SuiRpcError, SuiClient>;
|
|
142
|
+
/** One purchased copy by id, or `null` when no such Record exists. */
|
|
143
|
+
export declare const getRecord: (recordId: string, recordPackageId: string) => Effect.Effect<PressingRecord | null, BcsDecodeError | ObjectTypeMismatchError | SuiRpcError, SuiClient>;
|
|
126
144
|
export interface GetSaleParams {
|
|
127
145
|
releaseId: string;
|
|
128
146
|
edition: number;
|
|
@@ -130,8 +148,10 @@ export interface GetSaleParams {
|
|
|
130
148
|
recordPackageId: string;
|
|
131
149
|
recordShopPackageId: string;
|
|
132
150
|
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
151
|
+
/** A Pressing and its currency-specific Listing, read in one Core batch. Either half may be `null`. */
|
|
152
|
+
export declare const getSale: (p: GetSaleParams) => Effect.Effect<{
|
|
153
|
+
pressing: Pressing | null;
|
|
154
|
+
listing: Listing | null;
|
|
155
|
+
}, BcsDecodeError | ObjectTypeMismatchError | SuiRpcError, SuiClient>;
|
|
156
|
+
export {};
|
|
137
157
|
//# sourceMappingURL=pressing.d.ts.map
|
package/dist/pressing.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pressing.d.ts","sourceRoot":"","sources":["../src/pressing.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pressing.d.ts","sourceRoot":"","sources":["../src/pressing.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAKL,uBAAuB,EACvB,KAAK,SAAS,EACf,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAS,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AASlD;;qCAEqC;AACrC,eAAO,MAAM,iCAAiC;aAC5C,SAAS,EACP,oEAAoE;aACtE,OAAO,EAAE,CAAC;aACV,YAAY,EAAE,eAAe;aAC7B,eAAe,EACb,oEAAoE;aACtE,mBAAmB,EACjB,oEAAoE;aACtE,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