@misonetwork/sdk 0.7.0 → 0.9.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 +210 -136
- package/dist/client.d.ts +1211 -8
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +56 -19
- package/dist/client.js.map +1 -1
- package/dist/contracts/composition_credits/composition_credits.d.ts +181 -0
- package/dist/contracts/composition_credits/composition_credits.d.ts.map +1 -0
- package/dist/contracts/composition_credits/composition_credits.js +109 -0
- package/dist/contracts/composition_credits/composition_credits.js.map +1 -0
- package/dist/contracts/composition_credits/composition_party_role.d.ts +119 -0
- package/dist/contracts/composition_credits/composition_party_role.d.ts.map +1 -0
- package/dist/contracts/composition_credits/composition_party_role.js +139 -0
- package/dist/contracts/composition_credits/composition_party_role.js.map +1 -0
- package/dist/contracts/composition_credits/deps/miso_credit/credit.d.ts +24 -0
- package/dist/contracts/composition_credits/deps/miso_credit/credit.d.ts.map +1 -0
- package/dist/contracts/composition_credits/deps/miso_credit/credit.js +23 -0
- package/dist/contracts/composition_credits/deps/miso_credit/credit.js.map +1 -0
- package/dist/contracts/composition_credits/deps/sui/vec_map.d.ts +37 -0
- package/dist/contracts/composition_credits/deps/sui/vec_map.d.ts.map +1 -0
- package/dist/contracts/composition_credits/deps/sui/vec_map.js +28 -0
- package/dist/contracts/composition_credits/deps/sui/vec_map.js.map +1 -0
- package/dist/contracts/miso/composition.d.ts +1 -15
- package/dist/contracts/miso/composition.d.ts.map +1 -1
- package/dist/contracts/miso/composition.js +2 -17
- package/dist/contracts/miso/composition.js.map +1 -1
- package/dist/contracts/miso/deps/bps/bps.d.ts +1 -1
- package/dist/contracts/miso/deps/bps/bps.js +1 -1
- package/dist/contracts/miso/recording.d.ts +1 -16
- package/dist/contracts/miso/recording.d.ts.map +1 -1
- package/dist/contracts/miso/recording.js +1 -16
- package/dist/contracts/miso/recording.js.map +1 -1
- package/dist/contracts/miso/release.d.ts +61 -48
- package/dist/contracts/miso/release.d.ts.map +1 -1
- package/dist/contracts/miso/release.js +59 -46
- package/dist/contracts/miso/release.js.map +1 -1
- package/dist/contracts/miso/track.d.ts +2 -2
- package/dist/contracts/miso/track.js +2 -2
- package/dist/contracts/miso_party/deps/sui/vec_set.d.ts +21 -0
- package/dist/contracts/miso_party/deps/sui/vec_set.d.ts.map +1 -0
- package/dist/contracts/miso_party/deps/sui/vec_set.js +20 -0
- package/dist/contracts/miso_party/deps/sui/vec_set.js.map +1 -0
- package/dist/contracts/miso_party/party.d.ts +481 -0
- package/dist/contracts/miso_party/party.d.ts.map +1 -0
- package/dist/contracts/miso_party/party.js +527 -0
- package/dist/contracts/miso_party/party.js.map +1 -0
- package/dist/contracts/party_cta/party_cta.d.ts +120 -0
- package/dist/contracts/party_cta/party_cta.d.ts.map +1 -0
- package/dist/contracts/party_cta/party_cta.js +139 -0
- package/dist/contracts/party_cta/party_cta.js.map +1 -0
- package/dist/contracts/party_genre/party_genre.d.ts +117 -0
- package/dist/contracts/party_genre/party_genre.d.ts.map +1 -0
- package/dist/contracts/party_genre/party_genre.js +131 -0
- package/dist/contracts/party_genre/party_genre.js.map +1 -0
- package/dist/contracts/party_media/party_media.d.ts +86 -0
- package/dist/contracts/party_media/party_media.d.ts.map +1 -0
- package/dist/contracts/party_media/party_media.js +97 -0
- package/dist/contracts/party_media/party_media.js.map +1 -0
- package/dist/contracts/party_music/party_music.d.ts +209 -0
- package/dist/contracts/party_music/party_music.d.ts.map +1 -0
- package/dist/contracts/party_music/party_music.js +259 -0
- package/dist/contracts/party_music/party_music.js.map +1 -0
- package/dist/contracts/party_platform_link/party_platform_link.d.ts +89 -0
- package/dist/contracts/party_platform_link/party_platform_link.d.ts.map +1 -0
- package/dist/contracts/party_platform_link/party_platform_link.js +92 -0
- package/dist/contracts/party_platform_link/party_platform_link.js.map +1 -0
- package/dist/contracts/party_pro_link/party_pro_link.d.ts +233 -0
- package/dist/contracts/party_pro_link/party_pro_link.d.ts.map +1 -0
- package/dist/contracts/party_pro_link/party_pro_link.js +289 -0
- package/dist/contracts/party_pro_link/party_pro_link.js.map +1 -0
- package/dist/contracts/party_profile/deps/country_code/country_code.d.ts +15 -0
- package/dist/contracts/party_profile/deps/country_code/country_code.d.ts.map +1 -0
- package/dist/contracts/party_profile/deps/country_code/country_code.js +17 -0
- package/dist/contracts/party_profile/deps/country_code/country_code.js.map +1 -0
- package/dist/contracts/party_profile/deps/language_code/language_code.d.ts +6 -0
- package/dist/contracts/party_profile/deps/language_code/language_code.d.ts.map +1 -0
- package/dist/contracts/party_profile/deps/language_code/language_code.js +8 -0
- package/dist/contracts/party_profile/deps/language_code/language_code.js.map +1 -0
- package/dist/contracts/party_profile/party_profile.d.ts +133 -0
- package/dist/contracts/party_profile/party_profile.d.ts.map +1 -0
- package/dist/contracts/party_profile/party_profile.js +153 -0
- package/dist/contracts/party_profile/party_profile.js.map +1 -0
- package/dist/contracts/party_roles/party_roles.d.ts +201 -0
- package/dist/contracts/party_roles/party_roles.d.ts.map +1 -0
- package/dist/contracts/party_roles/party_roles.js +237 -0
- package/dist/contracts/party_roles/party_roles.js.map +1 -0
- package/dist/contracts/party_social/party_social.d.ts +258 -0
- package/dist/contracts/party_social/party_social.d.ts.map +1 -0
- package/dist/contracts/party_social/party_social.js +320 -0
- package/dist/contracts/party_social/party_social.js.map +1 -0
- package/dist/contracts/party_tags/party_tags.d.ts +116 -0
- package/dist/contracts/party_tags/party_tags.d.ts.map +1 -0
- package/dist/contracts/party_tags/party_tags.js +130 -0
- package/dist/contracts/party_tags/party_tags.js.map +1 -0
- package/dist/contracts/recording_advisory/recording_advisory.d.ts +194 -0
- package/dist/contracts/recording_advisory/recording_advisory.d.ts.map +1 -0
- package/dist/contracts/recording_advisory/recording_advisory.js +204 -0
- package/dist/contracts/recording_advisory/recording_advisory.js.map +1 -0
- package/dist/contracts/recording_credits/deps/miso_credit/credit.d.ts +24 -0
- package/dist/contracts/recording_credits/deps/miso_credit/credit.d.ts.map +1 -0
- package/dist/contracts/recording_credits/deps/miso_credit/credit.js +23 -0
- package/dist/contracts/recording_credits/deps/miso_credit/credit.js.map +1 -0
- package/dist/contracts/recording_credits/deps/sui/vec_map.d.ts +37 -0
- package/dist/contracts/recording_credits/deps/sui/vec_map.d.ts.map +1 -0
- package/dist/contracts/recording_credits/deps/sui/vec_map.js +28 -0
- package/dist/contracts/recording_credits/deps/sui/vec_map.js.map +1 -0
- package/dist/contracts/recording_credits/deps/sui/vec_set.d.ts +21 -0
- package/dist/contracts/recording_credits/deps/sui/vec_set.d.ts.map +1 -0
- package/dist/contracts/recording_credits/deps/sui/vec_set.js +20 -0
- package/dist/contracts/recording_credits/deps/sui/vec_set.js.map +1 -0
- package/dist/contracts/recording_credits/recording_credits.d.ts +2313 -0
- package/dist/contracts/recording_credits/recording_credits.d.ts.map +1 -0
- package/dist/contracts/recording_credits/recording_credits.js +270 -0
- package/dist/contracts/recording_credits/recording_credits.js.map +1 -0
- package/dist/contracts/recording_credits/recording_party_role.d.ts +1174 -0
- package/dist/contracts/recording_credits/recording_party_role.d.ts.map +1 -0
- package/dist/contracts/recording_credits/recording_party_role.js +692 -0
- package/dist/contracts/recording_credits/recording_party_role.js.map +1 -0
- package/dist/contracts/recording_language/deps/language_code/language_code.d.ts +6 -0
- package/dist/contracts/recording_language/deps/language_code/language_code.d.ts.map +1 -0
- package/dist/contracts/recording_language/deps/language_code/language_code.js +8 -0
- package/dist/contracts/recording_language/deps/language_code/language_code.js.map +1 -0
- package/dist/contracts/recording_language/recording_language.d.ts +152 -0
- package/dist/contracts/recording_language/recording_language.d.ts.map +1 -0
- package/dist/contracts/recording_language/recording_language.js +149 -0
- package/dist/contracts/recording_language/recording_language.js.map +1 -0
- package/dist/contracts/recording_master_reference/deps/ori/walrus_data.d.ts +52 -0
- package/dist/contracts/recording_master_reference/deps/ori/walrus_data.d.ts.map +1 -0
- package/dist/contracts/recording_master_reference/deps/ori/walrus_data.js +37 -0
- package/dist/contracts/recording_master_reference/deps/ori/walrus_data.js.map +1 -0
- package/dist/contracts/recording_master_reference/recording_master_reference.d.ts +131 -0
- package/dist/contracts/recording_master_reference/recording_master_reference.d.ts.map +1 -0
- package/dist/contracts/recording_master_reference/recording_master_reference.js +121 -0
- package/dist/contracts/recording_master_reference/recording_master_reference.js.map +1 -0
- package/dist/contracts/recording_preview/deps/ori/walrus_data.d.ts +52 -0
- package/dist/contracts/recording_preview/deps/ori/walrus_data.d.ts.map +1 -0
- package/dist/contracts/recording_preview/deps/ori/walrus_data.js +37 -0
- package/dist/contracts/recording_preview/deps/ori/walrus_data.js.map +1 -0
- package/dist/contracts/recording_preview/recording_preview.d.ts +104 -0
- package/dist/contracts/recording_preview/recording_preview.d.ts.map +1 -0
- package/dist/contracts/recording_preview/recording_preview.js +94 -0
- package/dist/contracts/recording_preview/recording_preview.js.map +1 -0
- package/dist/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.d.ts +52 -0
- package/dist/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.d.ts.map +1 -0
- package/dist/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.js +37 -0
- package/dist/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.js.map +1 -0
- package/dist/contracts/release_cover_art/deps/cover_art/cover_art.d.ts +46 -0
- package/dist/contracts/release_cover_art/deps/cover_art/cover_art.d.ts.map +1 -0
- package/dist/contracts/release_cover_art/deps/cover_art/cover_art.js +21 -0
- package/dist/contracts/release_cover_art/deps/cover_art/cover_art.js.map +1 -0
- package/dist/contracts/release_cover_art/deps/per_track/per_track.d.ts +33 -0
- package/dist/contracts/release_cover_art/deps/per_track/per_track.d.ts.map +1 -0
- package/dist/contracts/release_cover_art/deps/per_track/per_track.js +32 -0
- package/dist/contracts/release_cover_art/deps/per_track/per_track.js.map +1 -0
- package/dist/contracts/release_cover_art/release_cover_art.d.ts +300 -0
- package/dist/contracts/release_cover_art/release_cover_art.d.ts.map +1 -0
- package/dist/contracts/release_cover_art/release_cover_art.js +168 -0
- package/dist/contracts/release_cover_art/release_cover_art.js.map +1 -0
- package/dist/contracts/release_credits/deps/miso_credit/credit.d.ts +24 -0
- package/dist/contracts/release_credits/deps/miso_credit/credit.d.ts.map +1 -0
- package/dist/contracts/release_credits/deps/miso_credit/credit.js +23 -0
- package/dist/contracts/release_credits/deps/miso_credit/credit.js.map +1 -0
- package/dist/contracts/release_credits/deps/sui/vec_map.d.ts +37 -0
- package/dist/contracts/release_credits/deps/sui/vec_map.d.ts.map +1 -0
- package/dist/contracts/release_credits/deps/sui/vec_map.js +28 -0
- package/dist/contracts/release_credits/deps/sui/vec_map.js.map +1 -0
- package/dist/contracts/release_credits/release_credits.d.ts +142 -0
- package/dist/contracts/release_credits/release_credits.d.ts.map +1 -0
- package/dist/contracts/release_credits/release_credits.js +108 -0
- package/dist/contracts/release_credits/release_credits.js.map +1 -0
- package/dist/contracts/release_credits/release_party_role.d.ts +58 -0
- package/dist/contracts/release_credits/release_party_role.d.ts.map +1 -0
- package/dist/contracts/release_credits/release_party_role.js +66 -0
- package/dist/contracts/release_credits/release_party_role.js.map +1 -0
- package/dist/contracts/release_description/release_description.d.ts +112 -0
- package/dist/contracts/release_description/release_description.d.ts.map +1 -0
- package/dist/contracts/release_description/release_description.js +123 -0
- package/dist/contracts/release_description/release_description.js.map +1 -0
- package/dist/contracts/release_dsp_link/release_dsp_link.d.ts +644 -0
- package/dist/contracts/release_dsp_link/release_dsp_link.d.ts.map +1 -0
- package/dist/contracts/release_dsp_link/release_dsp_link.js +556 -0
- package/dist/contracts/release_dsp_link/release_dsp_link.js.map +1 -0
- package/dist/contracts/release_genre/deps/per_track/per_track.d.ts +33 -0
- package/dist/contracts/release_genre/deps/per_track/per_track.d.ts.map +1 -0
- package/dist/contracts/release_genre/deps/per_track/per_track.js +32 -0
- package/dist/contracts/release_genre/deps/per_track/per_track.js.map +1 -0
- package/dist/contracts/release_genre/release_genre.d.ts +193 -0
- package/dist/contracts/release_genre/release_genre.d.ts.map +1 -0
- package/dist/contracts/release_genre/release_genre.js +207 -0
- package/dist/contracts/release_genre/release_genre.js.map +1 -0
- package/dist/contracts/release_kind/release_kind.d.ts +98 -0
- package/dist/contracts/release_kind/release_kind.d.ts.map +1 -0
- package/dist/contracts/release_kind/release_kind.js +109 -0
- package/dist/contracts/release_kind/release_kind.js.map +1 -0
- package/dist/contracts/routed_stake/deps/royalty_pool/stake.d.ts +54 -0
- package/dist/contracts/routed_stake/deps/royalty_pool/stake.d.ts.map +1 -0
- package/dist/contracts/routed_stake/deps/royalty_pool/stake.js +37 -0
- package/dist/contracts/routed_stake/deps/royalty_pool/stake.js.map +1 -0
- package/dist/contracts/routed_stake/deps/std/type_name.d.ts +18 -0
- package/dist/contracts/routed_stake/deps/std/type_name.d.ts.map +1 -0
- package/dist/contracts/routed_stake/deps/std/type_name.js +20 -0
- package/dist/contracts/routed_stake/deps/std/type_name.js.map +1 -0
- package/dist/contracts/routed_stake/deps/sui/balance.d.ts +13 -0
- package/dist/contracts/routed_stake/deps/sui/balance.d.ts.map +1 -0
- package/dist/contracts/routed_stake/deps/sui/balance.js +15 -0
- package/dist/contracts/routed_stake/deps/sui/balance.js.map +1 -0
- package/dist/contracts/routed_stake/deps/sui/vec_map.d.ts +37 -0
- package/dist/contracts/routed_stake/deps/sui/vec_map.d.ts.map +1 -0
- package/dist/contracts/routed_stake/deps/sui/vec_map.js +28 -0
- package/dist/contracts/routed_stake/deps/sui/vec_map.js.map +1 -0
- package/dist/contracts/routed_stake/routed_stake.d.ts +342 -0
- package/dist/contracts/routed_stake/routed_stake.d.ts.map +1 -0
- package/dist/contracts/routed_stake/routed_stake.js +297 -0
- package/dist/contracts/routed_stake/routed_stake.js.map +1 -0
- package/dist/contracts/royalty_pool/deps/std/type_name.d.ts +18 -0
- package/dist/contracts/royalty_pool/deps/std/type_name.d.ts.map +1 -0
- package/dist/contracts/royalty_pool/deps/std/type_name.js +20 -0
- package/dist/contracts/royalty_pool/deps/std/type_name.js.map +1 -0
- package/dist/contracts/royalty_pool/deps/sui/balance.d.ts +13 -0
- package/dist/contracts/royalty_pool/deps/sui/balance.d.ts.map +1 -0
- package/dist/contracts/royalty_pool/deps/sui/balance.js +15 -0
- package/dist/contracts/royalty_pool/deps/sui/balance.js.map +1 -0
- package/dist/contracts/royalty_pool/deps/sui/vec_map.d.ts +37 -0
- package/dist/contracts/royalty_pool/deps/sui/vec_map.d.ts.map +1 -0
- package/dist/contracts/royalty_pool/deps/sui/vec_map.js +28 -0
- package/dist/contracts/royalty_pool/deps/sui/vec_map.js.map +1 -0
- package/dist/contracts/royalty_pool/pool.d.ts +380 -0
- package/dist/contracts/royalty_pool/pool.d.ts.map +1 -0
- package/dist/contracts/royalty_pool/pool.js +373 -0
- package/dist/contracts/royalty_pool/pool.js.map +1 -0
- package/dist/contracts/royalty_pool/stake.d.ts +189 -0
- package/dist/contracts/royalty_pool/stake.d.ts.map +1 -0
- package/dist/contracts/royalty_pool/stake.js +183 -0
- package/dist/contracts/royalty_pool/stake.js.map +1 -0
- package/dist/contracts.d.ts +48 -3
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js +54 -8
- package/dist/contracts.js.map +1 -1
- package/dist/deployments.d.ts +46 -12
- package/dist/deployments.d.ts.map +1 -1
- package/dist/deployments.js +132 -11
- package/dist/deployments.js.map +1 -1
- package/dist/events.d.ts +1067 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +120 -0
- package/dist/events.js.map +1 -0
- package/dist/execute.d.ts.map +1 -1
- package/dist/execute.js +0 -4
- package/dist/execute.js.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js.map +1 -1
- package/dist/numeric.d.ts +5 -0
- package/dist/numeric.d.ts.map +1 -0
- package/dist/numeric.js +21 -0
- package/dist/numeric.js.map +1 -0
- package/dist/packages.d.ts +194 -0
- package/dist/packages.d.ts.map +1 -0
- package/dist/packages.js +214 -0
- package/dist/packages.js.map +1 -0
- package/dist/parsers.d.ts +5 -1
- package/dist/parsers.d.ts.map +1 -1
- package/dist/parsers.js +18 -2
- package/dist/parsers.js.map +1 -1
- package/dist/party/client.d.ts +233 -0
- package/dist/party/client.d.ts.map +1 -0
- package/dist/party/client.js +222 -0
- package/dist/party/client.js.map +1 -0
- package/dist/party/extensions/ctas.d.ts +19 -0
- package/dist/party/extensions/ctas.d.ts.map +1 -0
- package/dist/party/extensions/ctas.js +25 -0
- package/dist/party/extensions/ctas.js.map +1 -0
- package/dist/party/extensions/genres.d.ts +27 -0
- package/dist/party/extensions/genres.d.ts.map +1 -0
- package/dist/party/extensions/genres.js +31 -0
- package/dist/party/extensions/genres.js.map +1 -0
- package/dist/party/extensions/links.d.ts +65 -0
- package/dist/party/extensions/links.d.ts.map +1 -0
- package/dist/party/extensions/links.js +117 -0
- package/dist/party/extensions/links.js.map +1 -0
- package/dist/party/extensions/media.d.ts +36 -0
- package/dist/party/extensions/media.d.ts.map +1 -0
- package/dist/party/extensions/media.js +45 -0
- package/dist/party/extensions/media.js.map +1 -0
- package/dist/party/extensions/profile.d.ts +24 -0
- package/dist/party/extensions/profile.d.ts.map +1 -0
- package/dist/party/extensions/profile.js +48 -0
- package/dist/party/extensions/profile.js.map +1 -0
- package/dist/party/extensions/roles.d.ts +37 -0
- package/dist/party/extensions/roles.d.ts.map +1 -0
- package/dist/party/extensions/roles.js +46 -0
- package/dist/party/extensions/roles.js.map +1 -0
- package/dist/party/extensions/tags.d.ts +25 -0
- package/dist/party/extensions/tags.d.ts.map +1 -0
- package/dist/party/extensions/tags.js +25 -0
- package/dist/party/extensions/tags.js.map +1 -0
- package/dist/party/index.d.ts +12 -0
- package/dist/party/index.d.ts.map +1 -0
- package/dist/party/index.js +14 -0
- package/dist/party/index.js.map +1 -0
- package/dist/party/internal.d.ts +15 -0
- package/dist/party/internal.d.ts.map +1 -0
- package/dist/party/internal.js +103 -0
- package/dist/party/internal.js.map +1 -0
- package/dist/party/queries.d.ts +38 -0
- package/dist/party/queries.d.ts.map +1 -0
- package/dist/party/queries.js +232 -0
- package/dist/party/queries.js.map +1 -0
- package/dist/party/transactions.d.ts +74 -0
- package/dist/party/transactions.d.ts.map +1 -0
- package/dist/party/transactions.js +85 -0
- package/dist/party/transactions.js.map +1 -0
- package/dist/party/types.d.ts +54 -0
- package/dist/party/types.d.ts.map +1 -0
- package/dist/party/types.js +4 -0
- package/dist/party/types.js.map +1 -0
- package/dist/queries.d.ts +92 -0
- package/dist/queries.d.ts.map +1 -1
- package/dist/queries.js +132 -23
- package/dist/queries.js.map +1 -1
- package/dist/transactions.d.ts +96 -3
- package/dist/transactions.d.ts.map +1 -1
- package/dist/transactions.js +123 -11
- package/dist/transactions.js.map +1 -1
- package/dist/types.d.ts +18 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/view.d.ts +6 -5
- package/dist/view.d.ts.map +1 -1
- package/dist/view.js +8 -2
- package/dist/view.js.map +1 -1
- package/package.json +18 -4
- package/src/client.ts +73 -23
- package/src/contracts/composition_credits/composition_credits.ts +169 -0
- package/src/contracts/composition_credits/composition_party_role.ts +189 -0
- package/src/contracts/composition_credits/deps/miso_credit/credit.ts +27 -0
- package/src/contracts/composition_credits/deps/sui/vec_map.ts +33 -0
- package/src/contracts/miso/composition.ts +8 -35
- package/src/contracts/miso/deps/bps/bps.ts +3 -3
- package/src/contracts/miso/recording.ts +10 -38
- package/src/contracts/miso/release.ts +99 -86
- package/src/contracts/miso/track.ts +5 -5
- package/src/contracts/miso_party/deps/sui/vec_set.ts +21 -0
- package/src/contracts/miso_party/party.ts +797 -0
- package/src/contracts/party_cta/party_cta.ts +212 -0
- package/src/contracts/party_genre/party_genre.ts +199 -0
- package/src/contracts/party_media/party_media.ts +141 -0
- package/src/contracts/party_music/party_music.ts +405 -0
- package/src/contracts/party_platform_link/party_platform_link.ts +148 -0
- package/src/contracts/party_pro_link/party_pro_link.ts +453 -0
- package/src/contracts/party_profile/deps/country_code/country_code.ts +19 -0
- package/src/contracts/party_profile/deps/language_code/language_code.ts +7 -0
- package/src/contracts/party_profile/party_profile.ts +239 -0
- package/src/contracts/party_roles/party_roles.ts +363 -0
- package/src/contracts/party_social/party_social.ts +502 -0
- package/src/contracts/party_tags/party_tags.ts +198 -0
- package/src/contracts/recording_advisory/recording_advisory.ts +315 -0
- package/src/contracts/recording_credits/deps/miso_credit/credit.ts +27 -0
- package/src/contracts/recording_credits/deps/sui/vec_map.ts +33 -0
- package/src/contracts/recording_credits/deps/sui/vec_set.ts +21 -0
- package/src/contracts/recording_credits/recording_credits.ts +458 -0
- package/src/contracts/recording_credits/recording_party_role.ts +1041 -0
- package/src/contracts/recording_language/deps/language_code/language_code.ts +7 -0
- package/src/contracts/recording_language/recording_language.ts +237 -0
- package/src/contracts/recording_master_reference/deps/ori/walrus_data.ts +36 -0
- package/src/contracts/recording_master_reference/recording_master_reference.ts +181 -0
- package/src/contracts/recording_preview/deps/ori/walrus_data.ts +36 -0
- package/src/contracts/recording_preview/recording_preview.ts +154 -0
- package/src/contracts/release_cover_art/deps/0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78/walrus_data.ts +36 -0
- package/src/contracts/release_cover_art/deps/cover_art/cover_art.ts +23 -0
- package/src/contracts/release_cover_art/deps/per_track/per_track.ts +36 -0
- package/src/contracts/release_cover_art/release_cover_art.ts +251 -0
- package/src/contracts/release_credits/deps/miso_credit/credit.ts +27 -0
- package/src/contracts/release_credits/deps/sui/vec_map.ts +33 -0
- package/src/contracts/release_credits/release_credits.ts +156 -0
- package/src/contracts/release_credits/release_party_role.ts +87 -0
- package/src/contracts/release_description/release_description.ts +167 -0
- package/src/contracts/release_dsp_link/release_dsp_link.ts +813 -0
- package/src/contracts/release_genre/deps/per_track/per_track.ts +36 -0
- package/src/contracts/release_genre/release_genre.ts +314 -0
- package/src/contracts/release_kind/release_kind.ts +153 -0
- package/src/contracts/routed_stake/deps/royalty_pool/stake.ts +39 -0
- package/src/contracts/routed_stake/deps/std/type_name.ts +22 -0
- package/src/contracts/routed_stake/deps/sui/balance.ts +17 -0
- package/src/contracts/routed_stake/deps/sui/vec_map.ts +33 -0
- package/src/contracts/routed_stake/routed_stake.ts +481 -0
- package/src/contracts/royalty_pool/deps/std/type_name.ts +22 -0
- package/src/contracts/royalty_pool/deps/sui/balance.ts +17 -0
- package/src/contracts/royalty_pool/deps/sui/vec_map.ts +33 -0
- package/src/contracts/royalty_pool/pool.ts +586 -0
- package/src/contracts/royalty_pool/stake.ts +291 -0
- package/src/contracts.ts +72 -6
- package/src/deployments.ts +175 -22
- package/src/events.ts +125 -0
- package/src/execute.ts +0 -4
- package/src/index.ts +8 -3
- package/src/internal.ts +0 -4
- package/src/numeric.ts +25 -0
- package/src/packages.ts +283 -0
- package/src/parsers.ts +32 -2
- package/src/party/client.ts +283 -0
- package/src/party/extensions/ctas.ts +46 -0
- package/src/party/extensions/genres.ts +62 -0
- package/src/party/extensions/links.ts +185 -0
- package/src/party/extensions/media.ts +72 -0
- package/src/party/extensions/profile.ts +81 -0
- package/src/party/extensions/roles.ts +94 -0
- package/src/party/extensions/tags.ts +54 -0
- package/src/party/index.ts +14 -0
- package/src/party/internal.ts +119 -0
- package/src/party/queries.ts +303 -0
- package/src/party/transactions.ts +167 -0
- package/src/party/types.ts +95 -0
- package/src/queries.ts +227 -25
- package/src/transactions.ts +254 -12
- package/src/types.ts +20 -0
- package/src/view.ts +12 -6
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
// Copyright (c) Miso Labs, Inc.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
// Core PartyOS transaction builders. Every builder returns a thunk that *appends*
|
|
5
|
+
// commands to a caller-owned Transaction, so flows compose. Package ids are taken
|
|
6
|
+
// in params (the client binds them; see ./client.ts). Calls into the party package
|
|
7
|
+
// go through the generated typed call fns (party.*).
|
|
8
|
+
|
|
9
|
+
import type { Transaction } from "@mysten/sui/transactions";
|
|
10
|
+
import * as party from "../contracts/miso_party/party.ts";
|
|
11
|
+
|
|
12
|
+
export type TxThunk = (tx: Transaction) => void | Promise<void>;
|
|
13
|
+
|
|
14
|
+
export interface CreatePartyParams {
|
|
15
|
+
/** Human-readable party name (not verified; app-layer verifies). */
|
|
16
|
+
name: string;
|
|
17
|
+
/** Address that receives the PartyAdminCap. */
|
|
18
|
+
recipient: string;
|
|
19
|
+
partyPackageId: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** Creates an individual party, shares it, and transfers its admin cap to `recipient`. */
|
|
23
|
+
export function createIndividualParty(params: CreatePartyParams): TxThunk {
|
|
24
|
+
return (tx) => {
|
|
25
|
+
const kind = tx.add(party.newIndividualKind({ package: params.partyPackageId }));
|
|
26
|
+
const res = tx.add(party._new({ package: params.partyPackageId, arguments: [kind, params.name] }));
|
|
27
|
+
tx.add(party.share({ package: params.partyPackageId, arguments: [res[0]!, res[1]!] }));
|
|
28
|
+
tx.transferObjects([res[1]!], params.recipient);
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** Creates a group party (empty member set), shares it, transfers its admin cap. */
|
|
33
|
+
export function createGroupParty(params: CreatePartyParams): TxThunk {
|
|
34
|
+
return (tx) => {
|
|
35
|
+
const kind = tx.add(party.newGroupKind({ package: params.partyPackageId }));
|
|
36
|
+
const res = tx.add(party._new({ package: params.partyPackageId, arguments: [kind, params.name] }));
|
|
37
|
+
tx.add(party.share({ package: params.partyPackageId, arguments: [res[0]!, res[1]!] }));
|
|
38
|
+
tx.transferObjects([res[1]!], params.recipient);
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// === Group membership: invite / accept / decline / revoke / leave / evict ===
|
|
43
|
+
// Membership is consent-based: the group admin invites, the member accepts with
|
|
44
|
+
// its OWN admin cap. `member`/`group`/`*Cap` params are all object ids.
|
|
45
|
+
|
|
46
|
+
export interface InvitePartyParams {
|
|
47
|
+
groupId: string;
|
|
48
|
+
groupCapId: string;
|
|
49
|
+
/** The individual party (shared object id) to invite. */
|
|
50
|
+
memberId: string;
|
|
51
|
+
partyPackageId: string;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** Invites an individual party to a group (gated by the group's admin cap). */
|
|
55
|
+
export function inviteParty(params: InvitePartyParams): TxThunk {
|
|
56
|
+
return (tx) => {
|
|
57
|
+
tx.add(party.inviteParty({
|
|
58
|
+
package: params.partyPackageId,
|
|
59
|
+
arguments: [params.groupId, params.memberId, params.groupCapId],
|
|
60
|
+
}));
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface AcceptInviteParams {
|
|
65
|
+
groupId: string;
|
|
66
|
+
memberId: string;
|
|
67
|
+
/** The member party's admin cap id (proves consent). */
|
|
68
|
+
memberCapId: string;
|
|
69
|
+
partyPackageId: string;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** Accepts a pending invite, joining the member to the group (member's cap). */
|
|
73
|
+
export function acceptInvite(params: AcceptInviteParams): TxThunk {
|
|
74
|
+
return (tx) => {
|
|
75
|
+
tx.add(party.acceptInvite({
|
|
76
|
+
package: params.partyPackageId,
|
|
77
|
+
arguments: [params.groupId, params.memberId, params.memberCapId],
|
|
78
|
+
}));
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface DeclineInviteParams {
|
|
83
|
+
groupId: string;
|
|
84
|
+
/** The invited individual party (shared object id). */
|
|
85
|
+
memberId: string;
|
|
86
|
+
memberCapId: string;
|
|
87
|
+
partyPackageId: string;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/** Declines a pending invite (member's cap). */
|
|
91
|
+
export function declineInvite(params: DeclineInviteParams): TxThunk {
|
|
92
|
+
return (tx) => {
|
|
93
|
+
tx.add(party.declineInvite({
|
|
94
|
+
package: params.partyPackageId,
|
|
95
|
+
arguments: [params.groupId, params.memberId, params.memberCapId],
|
|
96
|
+
}));
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export interface RevokeInviteParams {
|
|
101
|
+
groupId: string;
|
|
102
|
+
/** The invited individual party (shared object id). */
|
|
103
|
+
memberId: string;
|
|
104
|
+
groupCapId: string;
|
|
105
|
+
partyPackageId: string;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/** Revokes a pending invite (group's admin cap). */
|
|
109
|
+
export function revokeInvite(params: RevokeInviteParams): TxThunk {
|
|
110
|
+
return (tx) => {
|
|
111
|
+
tx.add(party.revokeInvite({
|
|
112
|
+
package: params.partyPackageId,
|
|
113
|
+
arguments: [params.groupId, params.memberId, params.groupCapId],
|
|
114
|
+
}));
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export interface LeaveGroupParams {
|
|
119
|
+
groupId: string;
|
|
120
|
+
memberId: string;
|
|
121
|
+
memberCapId: string;
|
|
122
|
+
partyPackageId: string;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/** Leaves a group, authorized by the member's own admin cap. */
|
|
126
|
+
export function leaveGroup(params: LeaveGroupParams): TxThunk {
|
|
127
|
+
return (tx) => {
|
|
128
|
+
tx.add(party.leave({
|
|
129
|
+
package: params.partyPackageId,
|
|
130
|
+
arguments: [params.groupId, params.memberId, params.memberCapId],
|
|
131
|
+
}));
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export interface RemoveMemberParams {
|
|
136
|
+
groupId: string;
|
|
137
|
+
groupCapId: string;
|
|
138
|
+
memberId: string;
|
|
139
|
+
partyPackageId: string;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/** Evicts a member from a group (group's admin cap); scrubs the member's record too. */
|
|
143
|
+
export function removeMember(params: RemoveMemberParams): TxThunk {
|
|
144
|
+
return (tx) => {
|
|
145
|
+
tx.add(party.removeMember({
|
|
146
|
+
package: params.partyPackageId,
|
|
147
|
+
arguments: [params.groupId, params.groupCapId, params.memberId],
|
|
148
|
+
}));
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export interface SetNameParams {
|
|
153
|
+
partyId: string;
|
|
154
|
+
capId: string;
|
|
155
|
+
name: string;
|
|
156
|
+
partyPackageId: string;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/** Sets the party's human-readable name. */
|
|
160
|
+
export function setName(params: SetNameParams): TxThunk {
|
|
161
|
+
return (tx) => {
|
|
162
|
+
tx.add(party.setName({
|
|
163
|
+
package: params.partyPackageId,
|
|
164
|
+
arguments: [params.partyId, params.capId, params.name],
|
|
165
|
+
}));
|
|
166
|
+
};
|
|
167
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
// Copyright (c) Miso Labs, Inc.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
// Public, camelCase result types. The mappers in ./internal.ts turn the generated
|
|
5
|
+
// (snake_case, Move-shaped) parse output into these.
|
|
6
|
+
|
|
7
|
+
export type PartyKind = "individual" | "group";
|
|
8
|
+
|
|
9
|
+
export interface Party {
|
|
10
|
+
id: string;
|
|
11
|
+
kind: PartyKind;
|
|
12
|
+
/** Human-readable name (not verified). */
|
|
13
|
+
name: string;
|
|
14
|
+
/** Member party ids — present only when `kind === "group"`. */
|
|
15
|
+
members?: string[];
|
|
16
|
+
/** Unix ms when the party was created. */
|
|
17
|
+
createdAtMs: number;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface Profile {
|
|
21
|
+
partyId: string;
|
|
22
|
+
bioShort: string;
|
|
23
|
+
bioLong?: string;
|
|
24
|
+
/** ISO 3166-1 alpha-2 country code, e.g. "GB". */
|
|
25
|
+
country?: string;
|
|
26
|
+
/** ISO 639-1 language codes, e.g. ["en"]. */
|
|
27
|
+
languages: string[];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* A party's imagery, stored on-chain as a single Walrus quilt. Individual images
|
|
32
|
+
* (avatar, header, …) are quilt patches addressed by identifier off-chain — see
|
|
33
|
+
* `mediaUrls` / `MEDIA_IDENTIFIERS` in `extensions/media`.
|
|
34
|
+
*/
|
|
35
|
+
export interface Media {
|
|
36
|
+
partyId: string;
|
|
37
|
+
/** Walrus quilt blob id (base64url) holding the party's images. */
|
|
38
|
+
quiltId: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** A single call-to-action on a party: a labeled external link. Position is priority. */
|
|
42
|
+
export interface Cta {
|
|
43
|
+
label: string;
|
|
44
|
+
url: string;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* A platform this SDK knows how to build a link for. One key per external
|
|
49
|
+
* platform, spanning social (`x`, `instagram`, …), music (`spotify`, `bandcamp`,
|
|
50
|
+
* …), and professional/industry (`website`, `patreon`, …) payloads.
|
|
51
|
+
*/
|
|
52
|
+
export type PlatformKey =
|
|
53
|
+
// Social (party_social)
|
|
54
|
+
| "x"
|
|
55
|
+
| "instagram"
|
|
56
|
+
| "threads"
|
|
57
|
+
| "tiktok"
|
|
58
|
+
| "youtube"
|
|
59
|
+
| "discord"
|
|
60
|
+
| "telegram"
|
|
61
|
+
| "reddit"
|
|
62
|
+
| "twitch"
|
|
63
|
+
| "facebook"
|
|
64
|
+
// Music (party_music)
|
|
65
|
+
| "spotify"
|
|
66
|
+
| "bandcamp"
|
|
67
|
+
| "soundcloud"
|
|
68
|
+
| "appleMusic"
|
|
69
|
+
| "deezer"
|
|
70
|
+
| "tidal"
|
|
71
|
+
| "amazonMusic"
|
|
72
|
+
| "audiomack"
|
|
73
|
+
// Professional / industry (party_pro_link)
|
|
74
|
+
| "website"
|
|
75
|
+
| "bookingPage"
|
|
76
|
+
| "managementPage"
|
|
77
|
+
| "publisherPage"
|
|
78
|
+
| "labelPage"
|
|
79
|
+
| "epk"
|
|
80
|
+
| "patreon"
|
|
81
|
+
| "substack"
|
|
82
|
+
| "kofi";
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* One external-platform link attached to a party. Only the native identifier
|
|
86
|
+
* (`value` — a handle, artist id, subdomain, or full URL) is stored on-chain; the
|
|
87
|
+
* public `url` is rebuilt client-side from it.
|
|
88
|
+
*/
|
|
89
|
+
export interface PlatformLink {
|
|
90
|
+
platform: PlatformKey;
|
|
91
|
+
/** The platform-native identifier stored on-chain (handle / id / subdomain / URL). */
|
|
92
|
+
value: string;
|
|
93
|
+
/** The public profile URL, rebuilt from `value`. */
|
|
94
|
+
url: string;
|
|
95
|
+
}
|
package/src/queries.ts
CHANGED
|
@@ -12,10 +12,8 @@
|
|
|
12
12
|
// they obtained from the chain, so a miss means a broken reference — an
|
|
13
13
|
// exceptional state, not a normal one.
|
|
14
14
|
// - Extension dynamic-field readers return `null` — extension data is optional
|
|
15
|
-
// by design, and "not attached" is a normal, expected state.
|
|
16
|
-
//
|
|
17
|
-
// `getReleaseCredits`, `getReleaseCover`) and re-import {@link isNotFound}
|
|
18
|
-
// from here to keep one not-found taxonomy across both packages.
|
|
15
|
+
// by design, and "not attached" is a normal, expected state. Use
|
|
16
|
+
// `getExtensionField` with the generated BCS codec for the extension.
|
|
19
17
|
// All null-returning readers use {@link isNotFound} to distinguish a missing
|
|
20
18
|
// object from a transport failure (which still throws).
|
|
21
19
|
|
|
@@ -26,7 +24,13 @@ import { deriveObjectID, normalizeSuiAddress } from "@mysten/sui/utils";
|
|
|
26
24
|
|
|
27
25
|
import { Composition as CompositionBcs } from "./contracts/miso/composition.ts";
|
|
28
26
|
import { Recording as RecordingBcs } from "./contracts/miso/recording.ts";
|
|
29
|
-
import {
|
|
27
|
+
import {
|
|
28
|
+
Release as ReleaseBcs,
|
|
29
|
+
ReleaseRegistry as ReleaseRegistryBcs,
|
|
30
|
+
} from "./contracts/miso/release.ts";
|
|
31
|
+
import { RoyaltyPool as RoyaltyPoolBcs } from "./contracts/royalty_pool/pool.ts";
|
|
32
|
+
import { Stake as RoyaltyStakeBcs } from "./contracts/royalty_pool/stake.ts";
|
|
33
|
+
import { RoutedStake as RoutedStakeBcs } from "./contracts/routed_stake/routed_stake.ts";
|
|
30
34
|
import {
|
|
31
35
|
mapBps,
|
|
32
36
|
mapComposition,
|
|
@@ -117,6 +121,35 @@ export function isNotFound(e: unknown): boolean {
|
|
|
117
121
|
/** Key bytes for Move unit structs (single `0x00` for `dummy_field: bool = false`). */
|
|
118
122
|
const UNIT_STRUCT_KEY_BYTES = new Uint8Array([0x00]);
|
|
119
123
|
|
|
124
|
+
/** Any generated BCS codec with a `parse` method. */
|
|
125
|
+
export interface BcsParser<T> {
|
|
126
|
+
parse(bytes: Uint8Array): T;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/** Exhaust every Core owned-object page; cap discovery must not truncate. */
|
|
130
|
+
async function listAllOwnedObjects(
|
|
131
|
+
client: ClientWithCoreApi,
|
|
132
|
+
input: Record<string, unknown>,
|
|
133
|
+
): Promise<Array<{ objectId: string; type?: string; json?: unknown }>> {
|
|
134
|
+
const objects: Array<{ objectId: string; type?: string; json?: unknown }> = [];
|
|
135
|
+
let cursor: string | null | undefined;
|
|
136
|
+
do {
|
|
137
|
+
const page = await (client.core.listOwnedObjects as (args: unknown) => Promise<{
|
|
138
|
+
objects: Array<{ objectId: string; type?: string; json?: unknown }>;
|
|
139
|
+
pageInfo?: { hasNextPage?: boolean; endCursor?: string | null };
|
|
140
|
+
hasNextPage?: boolean;
|
|
141
|
+
cursor?: string | null;
|
|
142
|
+
}>)(cursor ? { ...input, cursor } : input);
|
|
143
|
+
objects.push(...page.objects);
|
|
144
|
+
cursor = page.pageInfo?.hasNextPage
|
|
145
|
+
? page.pageInfo.endCursor
|
|
146
|
+
: page.hasNextPage
|
|
147
|
+
? page.cursor
|
|
148
|
+
: null;
|
|
149
|
+
} while (cursor);
|
|
150
|
+
return objects;
|
|
151
|
+
}
|
|
152
|
+
|
|
120
153
|
/** Fetches one object's BCS content bytes (or null if absent). */
|
|
121
154
|
async function getContent(
|
|
122
155
|
client: ClientWithCoreApi,
|
|
@@ -129,6 +162,168 @@ async function getContent(
|
|
|
129
162
|
return object.content ?? null;
|
|
130
163
|
}
|
|
131
164
|
|
|
165
|
+
/**
|
|
166
|
+
* Fetch and parse an object through the transport-neutral Core API. Object
|
|
167
|
+
* content is BCS; never pass the full `objectBcs` envelope to a Move codec.
|
|
168
|
+
*/
|
|
169
|
+
export async function getObjectByBcs<T>(
|
|
170
|
+
client: ClientWithCoreApi,
|
|
171
|
+
objectId: string,
|
|
172
|
+
codec: BcsParser<T>,
|
|
173
|
+
): Promise<T> {
|
|
174
|
+
const content = await getContent(client, objectId);
|
|
175
|
+
if (!content) throw new Error(`Object not found: ${objectId}`);
|
|
176
|
+
return codec.parse(content);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export interface ExtensionFieldParams<T> {
|
|
180
|
+
/** Freshly published package address for the extension. */
|
|
181
|
+
packageId: string;
|
|
182
|
+
/** Move module declaring the fieldless `ExtensionKey`. */
|
|
183
|
+
module: string;
|
|
184
|
+
/** Generated codec for the dynamic-field value. */
|
|
185
|
+
codec: BcsParser<T>;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Read an optional first-party extension field from a core object's UID. Every
|
|
190
|
+
* current extension uses a fieldless `ExtensionKey`, whose BCS is one false
|
|
191
|
+
* boolean byte. Absence returns `null`; transport errors still propagate.
|
|
192
|
+
*/
|
|
193
|
+
export async function getExtensionField<T>(
|
|
194
|
+
client: ClientWithCoreApi,
|
|
195
|
+
parentId: string,
|
|
196
|
+
params: ExtensionFieldParams<T>,
|
|
197
|
+
): Promise<T | null> {
|
|
198
|
+
try {
|
|
199
|
+
const { dynamicField } = await client.core.getDynamicField({
|
|
200
|
+
parentId,
|
|
201
|
+
name: {
|
|
202
|
+
type: `${params.packageId}::${params.module}::ExtensionKey`,
|
|
203
|
+
bcs: UNIT_STRUCT_KEY_BYTES,
|
|
204
|
+
},
|
|
205
|
+
});
|
|
206
|
+
return params.codec.parse(dynamicField.value.bcs);
|
|
207
|
+
} catch (error) {
|
|
208
|
+
if (isNotFound(error)) return null;
|
|
209
|
+
throw error;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export interface ReleaseDspFieldParams<T> {
|
|
214
|
+
/** Freshly published `release_dsp_link` package address. */
|
|
215
|
+
packageId: string;
|
|
216
|
+
/** Numeric DSP discriminator (`DspLinkData::platform()`). */
|
|
217
|
+
platform: number;
|
|
218
|
+
/** Generated codec for `DspLinkData` or `PerTrack<Option<DspLinkData>>`. */
|
|
219
|
+
codec: BcsParser<T>;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
async function getReleaseDspField<T>(
|
|
223
|
+
client: ClientWithCoreApi,
|
|
224
|
+
releaseId: string,
|
|
225
|
+
key: "ReleaseLinkKey" | "TrackLinksKey",
|
|
226
|
+
params: ReleaseDspFieldParams<T>,
|
|
227
|
+
): Promise<T | null> {
|
|
228
|
+
if (!Number.isInteger(params.platform) || params.platform < 0 || params.platform > 255) {
|
|
229
|
+
throw new Error("DSP platform must be a u8 discriminator");
|
|
230
|
+
}
|
|
231
|
+
try {
|
|
232
|
+
const { dynamicField } = await client.core.getDynamicField({
|
|
233
|
+
parentId: releaseId,
|
|
234
|
+
name: {
|
|
235
|
+
type: `${params.packageId}::release_dsp_link::${key}`,
|
|
236
|
+
bcs: Uint8Array.of(params.platform),
|
|
237
|
+
},
|
|
238
|
+
});
|
|
239
|
+
return params.codec.parse(dynamicField.value.bcs);
|
|
240
|
+
} catch (error) {
|
|
241
|
+
if (isNotFound(error)) return null;
|
|
242
|
+
throw error;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/** Read a release-level DSP link stored under `ReleaseLinkKey(platform)`. */
|
|
247
|
+
export function getReleaseDspLink<T>(
|
|
248
|
+
client: ClientWithCoreApi,
|
|
249
|
+
releaseId: string,
|
|
250
|
+
params: ReleaseDspFieldParams<T>,
|
|
251
|
+
): Promise<T | null> {
|
|
252
|
+
return getReleaseDspField(client, releaseId, "ReleaseLinkKey", params);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/** Read the per-track DSP-link array stored under `TrackLinksKey(platform)`. */
|
|
256
|
+
export function getTrackDspLinks<T>(
|
|
257
|
+
client: ClientWithCoreApi,
|
|
258
|
+
releaseId: string,
|
|
259
|
+
params: ReleaseDspFieldParams<T>,
|
|
260
|
+
): Promise<T | null> {
|
|
261
|
+
return getReleaseDspField(client, releaseId, "TrackLinksKey", params);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
// ============================================================================
|
|
265
|
+
// Core registry and generic primitive reads
|
|
266
|
+
// ============================================================================
|
|
267
|
+
|
|
268
|
+
/** Parse the shared canonical core `miso::release::ReleaseRegistry` by ID. */
|
|
269
|
+
export async function getReleaseRegistryById(
|
|
270
|
+
client: ClientWithCoreApi,
|
|
271
|
+
registryId: string,
|
|
272
|
+
) {
|
|
273
|
+
return getObjectByBcs(client, registryId, ReleaseRegistryBcs);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/** Parse a royalty pool by object ID. Phantom type arguments do not affect BCS. */
|
|
277
|
+
export async function getRoyaltyPoolById(
|
|
278
|
+
client: ClientWithCoreApi,
|
|
279
|
+
poolId: string,
|
|
280
|
+
) {
|
|
281
|
+
return getObjectByBcs(client, poolId, RoyaltyPoolBcs);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/** Parse an owned `Stake<Share>` by object ID. */
|
|
285
|
+
export async function getRoyaltyStakeById(
|
|
286
|
+
client: ClientWithCoreApi,
|
|
287
|
+
stakeId: string,
|
|
288
|
+
) {
|
|
289
|
+
return getObjectByBcs(client, stakeId, RoyaltyStakeBcs);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/** Parse a shared routed stake by object ID. */
|
|
293
|
+
export async function getRoutedStakeById(
|
|
294
|
+
client: ClientWithCoreApi,
|
|
295
|
+
routedStakeId: string,
|
|
296
|
+
) {
|
|
297
|
+
return getObjectByBcs(client, routedStakeId, RoutedStakeBcs);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/** Deterministically derive the royalty-pool ID for a parent and type pair. */
|
|
301
|
+
export function deriveRoyaltyPoolId(
|
|
302
|
+
parentId: string,
|
|
303
|
+
shareType: string,
|
|
304
|
+
currencyType: string,
|
|
305
|
+
royaltyPoolPackageId: string,
|
|
306
|
+
): string {
|
|
307
|
+
return deriveObjectID(
|
|
308
|
+
parentId,
|
|
309
|
+
`${royaltyPoolPackageId}::pool::RoyaltyPoolKey<${shareType}, ${currencyType}>`,
|
|
310
|
+
UNIT_STRUCT_KEY_BYTES,
|
|
311
|
+
);
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/** Deterministically derive the routed-stake ID for a parent and stake share. */
|
|
315
|
+
export function deriveRoutedStakeId(
|
|
316
|
+
parentId: string,
|
|
317
|
+
stakeShareType: string,
|
|
318
|
+
routedStakePackageId: string,
|
|
319
|
+
): string {
|
|
320
|
+
return deriveObjectID(
|
|
321
|
+
parentId,
|
|
322
|
+
`${routedStakePackageId}::routed_stake::RoutedStakeKey<${stakeShareType}>`,
|
|
323
|
+
UNIT_STRUCT_KEY_BYTES,
|
|
324
|
+
);
|
|
325
|
+
}
|
|
326
|
+
|
|
132
327
|
// ============================================================================
|
|
133
328
|
// GraphQL discovery queries
|
|
134
329
|
// ============================================================================
|
|
@@ -465,10 +660,7 @@ export async function getOwnedCompositionAdminCaps(
|
|
|
465
660
|
misoPackageId: string,
|
|
466
661
|
): Promise<CompositionAdminCap[]> {
|
|
467
662
|
const capType = `${misoPackageId}::composition::CompositionAdminCap`;
|
|
468
|
-
const
|
|
469
|
-
owner,
|
|
470
|
-
type: capType,
|
|
471
|
-
});
|
|
663
|
+
const objects = await listAllOwnedObjects(client, { owner, type: capType });
|
|
472
664
|
const caps: CompositionAdminCap[] = [];
|
|
473
665
|
for (const obj of objects) {
|
|
474
666
|
const match = obj.type?.match(/<(.+)>$/);
|
|
@@ -590,10 +782,7 @@ export async function getOwnedRecordingAdminCaps(
|
|
|
590
782
|
misoPackageId: string,
|
|
591
783
|
): Promise<RecordingAdminCap[]> {
|
|
592
784
|
const capType = `${misoPackageId}::recording::RecordingAdminCap`;
|
|
593
|
-
const
|
|
594
|
-
owner,
|
|
595
|
-
type: capType,
|
|
596
|
-
});
|
|
785
|
+
const objects = await listAllOwnedObjects(client, { owner, type: capType });
|
|
597
786
|
const caps: RecordingAdminCap[] = [];
|
|
598
787
|
for (const obj of objects) {
|
|
599
788
|
const match = obj.type?.match(/<(.+)>$/);
|
|
@@ -666,7 +855,7 @@ export async function getOwnedReleaseAdminCaps(
|
|
|
666
855
|
misoPackageId: string,
|
|
667
856
|
): Promise<ReleaseAdminCap[]> {
|
|
668
857
|
const capType = `${misoPackageId}::release::ReleaseAdminCap`;
|
|
669
|
-
const
|
|
858
|
+
const objects = await listAllOwnedObjects(client, {
|
|
670
859
|
owner,
|
|
671
860
|
type: capType,
|
|
672
861
|
include: { json: true },
|
|
@@ -724,7 +913,7 @@ export async function getShareCurrencyTreasuryCap(
|
|
|
724
913
|
shareType: string,
|
|
725
914
|
owner: string,
|
|
726
915
|
): Promise<string> {
|
|
727
|
-
const
|
|
916
|
+
const objects = await listAllOwnedObjects(client, {
|
|
728
917
|
owner,
|
|
729
918
|
type: `0x2::coin::TreasuryCap<${shareType}>`,
|
|
730
919
|
});
|
|
@@ -766,15 +955,28 @@ async function addressOfRecordingWithShareType(
|
|
|
766
955
|
misoPackageId: string,
|
|
767
956
|
shareType: string,
|
|
768
957
|
): Promise<string | null> {
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
958
|
+
let cursor: string | null | undefined;
|
|
959
|
+
do {
|
|
960
|
+
const result = await client.query<
|
|
961
|
+
{ objects?: WorkAddressConnection | null },
|
|
962
|
+
{ type: string; cursor?: string | null }
|
|
963
|
+
>({
|
|
964
|
+
query: `query RecordingAddress($type: String!, $cursor: String) {
|
|
965
|
+
objects(first: 50, after: $cursor, filter: { type: $type }) {
|
|
966
|
+
pageInfo { hasNextPage endCursor }
|
|
967
|
+
nodes { address asMoveObject { contents { type { repr } } } }
|
|
968
|
+
}
|
|
969
|
+
}`,
|
|
970
|
+
variables: { type: `${misoPackageId}::recording::Recording`, cursor },
|
|
971
|
+
});
|
|
972
|
+
const page = result.data?.objects;
|
|
973
|
+
for (const node of page?.nodes ?? []) {
|
|
974
|
+
const repr = node?.asMoveObject?.contents?.type?.repr;
|
|
975
|
+
if (!repr || !node.address) continue;
|
|
976
|
+
const [recordingShareType] = extractTypeParams2(repr);
|
|
977
|
+
if (recordingShareType === shareType) return node.address;
|
|
978
|
+
}
|
|
979
|
+
cursor = page?.pageInfo?.hasNextPage ? page.pageInfo.endCursor : null;
|
|
980
|
+
} while (cursor);
|
|
779
981
|
return null;
|
|
780
982
|
}
|