@misofm/platform 0.24.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 +262 -95
- 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 +6 -6
- 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 +124 -127
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +112 -114
- 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/credit/credit.d.ts +24 -0
- package/dist/contracts/composition_credits/deps/credit/credit.d.ts.map +1 -0
- package/dist/contracts/composition_credits/deps/credit/credit.js +23 -0
- package/dist/contracts/composition_credits/deps/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/composition_routed_stake/composition_routed_stake.d.ts +143 -0
- package/dist/contracts/composition_routed_stake/composition_routed_stake.d.ts.map +1 -0
- package/dist/contracts/composition_routed_stake/composition_routed_stake.js +125 -0
- package/dist/contracts/composition_routed_stake/composition_routed_stake.js.map +1 -0
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.d.ts +93 -0
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.d.ts.map +1 -0
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.js +86 -0
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.js.map +1 -0
- package/dist/contracts/composition_royalty_pool_plugin/composition_royalty_pool_plugin.d.ts +90 -0
- package/dist/contracts/composition_royalty_pool_plugin/composition_royalty_pool_plugin.d.ts.map +1 -0
- package/dist/contracts/composition_royalty_pool_plugin/composition_royalty_pool_plugin.js +85 -0
- package/dist/contracts/composition_royalty_pool_plugin/composition_royalty_pool_plugin.js.map +1 -0
- package/dist/contracts/composition_royalty_pool_plugin/witness.d.ts +6 -0
- package/dist/contracts/composition_royalty_pool_plugin/witness.d.ts.map +1 -0
- package/dist/contracts/composition_royalty_pool_plugin/witness.js +8 -0
- package/dist/contracts/composition_royalty_pool_plugin/witness.js.map +1 -0
- package/dist/contracts/cover_art/cover_art.d.ts +83 -0
- package/dist/contracts/cover_art/cover_art.d.ts.map +1 -0
- package/dist/contracts/cover_art/cover_art.js +66 -0
- package/dist/contracts/cover_art/cover_art.js.map +1 -0
- package/dist/contracts/cover_art/deps/ori/confidentiality.d.ts +24 -0
- package/dist/contracts/cover_art/deps/ori/confidentiality.d.ts.map +1 -0
- package/dist/contracts/cover_art/deps/ori/confidentiality.js +24 -0
- package/dist/contracts/cover_art/deps/ori/confidentiality.js.map +1 -0
- package/dist/contracts/cover_art/deps/ori/data.d.ts +16 -0
- package/dist/contracts/cover_art/deps/ori/data.d.ts.map +1 -0
- package/dist/contracts/cover_art/deps/ori/data.js +12 -0
- package/dist/contracts/cover_art/deps/ori/data.js.map +1 -0
- package/dist/contracts/genre/genre.d.ts +78 -0
- package/dist/contracts/genre/genre.d.ts.map +1 -0
- package/dist/contracts/genre/genre.js +87 -0
- package/dist/contracts/genre/genre.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/party_wallet/party_wallet.d.ts +112 -0
- package/dist/contracts/party_wallet/party_wallet.d.ts.map +1 -0
- package/dist/contracts/party_wallet/party_wallet.js +114 -0
- package/dist/contracts/party_wallet/party_wallet.js.map +1 -0
- package/dist/contracts/record/deps/std/type_name.d.ts +18 -0
- package/dist/contracts/record/deps/std/type_name.d.ts.map +1 -0
- package/dist/contracts/record/deps/std/type_name.js +20 -0
- package/dist/contracts/record/deps/std/type_name.js.map +1 -0
- package/dist/contracts/record/deps/sui/vec_set.d.ts +21 -0
- package/dist/contracts/record/deps/sui/vec_set.d.ts.map +1 -0
- package/dist/contracts/record/deps/sui/vec_set.js +20 -0
- package/dist/contracts/record/deps/sui/vec_set.js.map +1 -0
- package/dist/contracts/record/pressing.d.ts +327 -0
- package/dist/contracts/record/pressing.d.ts.map +1 -0
- package/dist/contracts/record/pressing.js +345 -0
- package/dist/contracts/record/pressing.js.map +1 -0
- package/dist/contracts/record/record.d.ts +190 -0
- package/dist/contracts/record/record.d.ts.map +1 -0
- package/dist/contracts/record/record.js +226 -0
- package/dist/contracts/record/record.js.map +1 -0
- package/dist/contracts/record_shop/deps/std/type_name.d.ts +18 -0
- package/dist/contracts/record_shop/deps/std/type_name.d.ts.map +1 -0
- package/dist/contracts/record_shop/deps/std/type_name.js +20 -0
- package/dist/contracts/record_shop/deps/std/type_name.js.map +1 -0
- package/dist/contracts/record_shop/listing.d.ts +387 -0
- package/dist/contracts/record_shop/listing.d.ts.map +1 -0
- package/dist/contracts/record_shop/listing.js +380 -0
- package/dist/contracts/record_shop/listing.js.map +1 -0
- package/dist/contracts/record_shop/witness.d.ts +7 -0
- package/dist/contracts/record_shop/witness.d.ts.map +1 -0
- package/dist/contracts/record_shop/witness.js +9 -0
- package/dist/contracts/record_shop/witness.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/credit/credit.d.ts +24 -0
- package/dist/contracts/recording_credits/deps/credit/credit.d.ts.map +1 -0
- package/dist/contracts/recording_credits/deps/credit/credit.js +23 -0
- package/dist/contracts/recording_credits/deps/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_engine_session/deps/ori/confidentiality.d.ts +24 -0
- package/dist/contracts/recording_engine_session/deps/ori/confidentiality.d.ts.map +1 -0
- package/dist/contracts/recording_engine_session/deps/ori/confidentiality.js +24 -0
- package/dist/contracts/recording_engine_session/deps/ori/confidentiality.js.map +1 -0
- package/dist/contracts/recording_engine_session/deps/ori/data.d.ts +16 -0
- package/dist/contracts/recording_engine_session/deps/ori/data.d.ts.map +1 -0
- package/dist/contracts/recording_engine_session/deps/ori/data.js +12 -0
- package/dist/contracts/recording_engine_session/deps/ori/data.js.map +1 -0
- package/dist/contracts/recording_engine_session/recording_engine_session.d.ts +296 -0
- package/dist/contracts/recording_engine_session/recording_engine_session.d.ts.map +1 -0
- package/dist/contracts/recording_engine_session/recording_engine_session.js +216 -0
- package/dist/contracts/recording_engine_session/recording_engine_session.js.map +1 -0
- package/dist/contracts/recording_genre/recording_genre.d.ts +173 -0
- package/dist/contracts/recording_genre/recording_genre.d.ts.map +1 -0
- package/dist/contracts/recording_genre/recording_genre.js +170 -0
- package/dist/contracts/recording_genre/recording_genre.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/confidentiality.d.ts +24 -0
- package/dist/contracts/recording_master_reference/deps/ori/confidentiality.d.ts.map +1 -0
- package/dist/contracts/recording_master_reference/deps/ori/confidentiality.js +24 -0
- package/dist/contracts/recording_master_reference/deps/ori/confidentiality.js.map +1 -0
- package/dist/contracts/recording_master_reference/deps/ori/data.d.ts +16 -0
- package/dist/contracts/recording_master_reference/deps/ori/data.d.ts.map +1 -0
- package/dist/contracts/recording_master_reference/deps/ori/data.js +12 -0
- package/dist/contracts/recording_master_reference/deps/ori/data.js.map +1 -0
- package/dist/contracts/recording_master_reference/recording_master_reference.d.ts +129 -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 +119 -0
- package/dist/contracts/recording_master_reference/recording_master_reference.js.map +1 -0
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.d.ts +96 -0
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.d.ts.map +1 -0
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.js +85 -0
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.js.map +1 -0
- package/dist/contracts/recording_royalty_pool_plugin/recording_royalty_pool_plugin.d.ts +92 -0
- package/dist/contracts/recording_royalty_pool_plugin/recording_royalty_pool_plugin.d.ts.map +1 -0
- package/dist/contracts/recording_royalty_pool_plugin/recording_royalty_pool_plugin.js +85 -0
- package/dist/contracts/recording_royalty_pool_plugin/recording_royalty_pool_plugin.js.map +1 -0
- package/dist/contracts/recording_royalty_pool_plugin/witness.d.ts +6 -0
- package/dist/contracts/recording_royalty_pool_plugin/witness.d.ts.map +1 -0
- package/dist/contracts/recording_royalty_pool_plugin/witness.js +8 -0
- package/dist/contracts/recording_royalty_pool_plugin/witness.js.map +1 -0
- package/dist/contracts/recording_streaming_transcode/deps/ori/data.d.ts +8 -0
- package/dist/contracts/recording_streaming_transcode/deps/ori/data.d.ts.map +1 -0
- package/dist/contracts/recording_streaming_transcode/deps/ori/data.js +10 -0
- package/dist/contracts/recording_streaming_transcode/deps/ori/data.js.map +1 -0
- package/dist/contracts/recording_streaming_transcode/recording_streaming_transcode.d.ts +124 -0
- package/dist/contracts/recording_streaming_transcode/recording_streaming_transcode.d.ts.map +1 -0
- package/dist/contracts/recording_streaming_transcode/recording_streaming_transcode.js +124 -0
- package/dist/contracts/recording_streaming_transcode/recording_streaming_transcode.js.map +1 -0
- package/dist/contracts/release_cover_art/deps/0x51792b9adb9a5d05d7c4d74d7d0cb5aefc5639afa80c0089399cab8b99752e60/confidentiality.d.ts +24 -0
- package/dist/contracts/release_cover_art/deps/0x51792b9adb9a5d05d7c4d74d7d0cb5aefc5639afa80c0089399cab8b99752e60/confidentiality.d.ts.map +1 -0
- package/dist/contracts/release_cover_art/deps/0x51792b9adb9a5d05d7c4d74d7d0cb5aefc5639afa80c0089399cab8b99752e60/confidentiality.js +24 -0
- package/dist/contracts/release_cover_art/deps/0x51792b9adb9a5d05d7c4d74d7d0cb5aefc5639afa80c0089399cab8b99752e60/confidentiality.js.map +1 -0
- package/dist/contracts/release_cover_art/deps/0x51792b9adb9a5d05d7c4d74d7d0cb5aefc5639afa80c0089399cab8b99752e60/data.d.ts +16 -0
- package/dist/contracts/release_cover_art/deps/0x51792b9adb9a5d05d7c4d74d7d0cb5aefc5639afa80c0089399cab8b99752e60/data.d.ts.map +1 -0
- package/dist/contracts/release_cover_art/deps/0x51792b9adb9a5d05d7c4d74d7d0cb5aefc5639afa80c0089399cab8b99752e60/data.js +12 -0
- package/dist/contracts/release_cover_art/deps/0x51792b9adb9a5d05d7c4d74d7d0cb5aefc5639afa80c0089399cab8b99752e60/data.js.map +1 -0
- package/dist/contracts/release_cover_art/deps/cover_art/cover_art.d.ts +47 -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 +22 -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/credit/credit.d.ts +24 -0
- package/dist/contracts/release_credits/deps/credit/credit.d.ts.map +1 -0
- package/dist/contracts/release_credits/deps/credit/credit.js +23 -0
- package/dist/contracts/release_credits/deps/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 +643 -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 +555 -0
- package/dist/contracts/release_dsp_link/release_dsp_link.js.map +1 -0
- package/dist/contracts/release_genre/release_genre.d.ts +145 -0
- package/dist/contracts/release_genre/release_genre.d.ts.map +1 -0
- package/dist/contracts/release_genre/release_genre.js +154 -0
- package/dist/contracts/release_genre/release_genre.js.map +1 -0
- package/dist/contracts/release_kind/release_kind.d.ts +98 -0
- package/dist/contracts/release_kind/release_kind.d.ts.map +1 -0
- package/dist/contracts/release_kind/release_kind.js +109 -0
- package/dist/contracts/release_kind/release_kind.js.map +1 -0
- package/dist/contracts/release_revenue_distributor/release_revenue_distributor.d.ts +91 -0
- package/dist/contracts/release_revenue_distributor/release_revenue_distributor.d.ts.map +1 -0
- package/dist/contracts/release_revenue_distributor/release_revenue_distributor.js +92 -0
- package/dist/contracts/release_revenue_distributor/release_revenue_distributor.js.map +1 -0
- package/dist/contracts/release_revenue_distributor_plugin/release_revenue_distributor_plugin.d.ts +73 -0
- package/dist/contracts/release_revenue_distributor_plugin/release_revenue_distributor_plugin.d.ts.map +1 -0
- package/dist/contracts/release_revenue_distributor_plugin/release_revenue_distributor_plugin.js +80 -0
- package/dist/contracts/release_revenue_distributor_plugin/release_revenue_distributor_plugin.js.map +1 -0
- package/dist/contracts/release_revenue_distributor_plugin/witness.d.ts +6 -0
- package/dist/contracts/release_revenue_distributor_plugin/witness.d.ts.map +1 -0
- package/dist/contracts/release_revenue_distributor_plugin/witness.js +8 -0
- package/dist/contracts/release_revenue_distributor_plugin/witness.js.map +1 -0
- package/dist/contracts/routed_stake/deps/royalty_pool/stake.d.ts +67 -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 +50 -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 +347 -0
- package/dist/contracts/routed_stake/routed_stake.d.ts.map +1 -0
- package/dist/contracts/routed_stake/routed_stake.js +302 -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 +414 -0
- package/dist/contracts/royalty_pool/pool.d.ts.map +1 -0
- package/dist/contracts/royalty_pool/pool.js +409 -0
- package/dist/contracts/royalty_pool/pool.js.map +1 -0
- package/dist/contracts/royalty_pool/stake.d.ts +202 -0
- package/dist/contracts/royalty_pool/stake.d.ts.map +1 -0
- package/dist/contracts/royalty_pool/stake.js +196 -0
- package/dist/contracts/royalty_pool/stake.js.map +1 -0
- package/dist/contracts/utils/index.d.ts +104 -0
- package/dist/contracts/utils/index.d.ts.map +1 -0
- package/dist/contracts/utils/index.js +272 -0
- package/dist/contracts/utils/index.js.map +1 -0
- package/dist/contracts/vault/deps/sui/bag.d.ts +35 -0
- package/dist/contracts/vault/deps/sui/bag.d.ts.map +1 -0
- package/dist/contracts/vault/deps/sui/bag.js +37 -0
- package/dist/contracts/vault/deps/sui/bag.js.map +1 -0
- package/dist/contracts/vault/deps/sui/borrow.d.ts +20 -0
- package/dist/contracts/vault/deps/sui/borrow.d.ts.map +1 -0
- package/dist/contracts/vault/deps/sui/borrow.js +21 -0
- package/dist/contracts/vault/deps/sui/borrow.js.map +1 -0
- package/dist/contracts/vault/vault.d.ts +316 -0
- package/dist/contracts/vault/vault.d.ts.map +1 -0
- package/dist/contracts/vault/vault.js +308 -0
- package/dist/contracts/vault/vault.js.map +1 -0
- package/dist/contracts.d.ts +57 -33
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js +63 -41
- package/dist/contracts.js.map +1 -1
- package/dist/cover.d.ts +4 -3
- package/dist/cover.d.ts.map +1 -1
- package/dist/cover.js +30 -19
- 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 +66 -39
- package/dist/credits.js.map +1 -1
- package/dist/deployments.d.ts +122 -74
- package/dist/deployments.d.ts.map +1 -1
- package/dist/deployments.js +239 -58
- 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/events.d.ts +1045 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +116 -0
- package/dist/events.js.map +1 -0
- package/dist/execute.d.ts +5 -3
- package/dist/execute.d.ts.map +1 -1
- package/dist/execute.js +11 -6
- package/dist/execute.js.map +1 -1
- package/dist/genre.d.ts +108 -0
- package/dist/genre.d.ts.map +1 -0
- package/dist/genre.js +289 -0
- package/dist/genre.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/dist/internal.js +2 -2
- package/dist/internal.js.map +1 -1
- package/dist/packages.d.ts +4185 -0
- package/dist/packages.d.ts.map +1 -0
- package/dist/packages.js +190 -0
- package/dist/packages.js.map +1 -0
- package/dist/party/client.d.ts +327 -0
- package/dist/party/client.d.ts.map +1 -0
- package/dist/party/client.js +225 -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 +66 -0
- package/dist/party/extensions/links.d.ts.map +1 -0
- package/dist/party/extensions/links.js +118 -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 +18 -0
- package/dist/party/index.js.map +1 -0
- package/dist/party/internal.d.ts +14 -0
- package/dist/party/internal.d.ts.map +1 -0
- package/dist/party/internal.js +89 -0
- package/dist/party/internal.js.map +1 -0
- package/dist/party/queries.d.ts +18 -0
- package/dist/party/queries.d.ts.map +1 -0
- package/dist/party/queries.js +124 -0
- package/dist/party/queries.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 +85 -0
- package/dist/party/types.js.map +1 -0
- package/dist/pressing.d.ts +55 -35
- package/dist/pressing.d.ts.map +1 -1
- package/dist/pressing.js +102 -79
- package/dist/pressing.js.map +1 -1
- package/dist/publication.d.ts +4 -8
- package/dist/publication.d.ts.map +1 -1
- package/dist/publication.js +53 -40
- package/dist/publication.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 +21 -18
- 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 +15 -11
- package/dist/read/client.d.ts.map +1 -1
- package/dist/read/client.js +5 -1
- package/dist/read/client.js.map +1 -1
- package/dist/read/config.d.ts +7 -2
- package/dist/read/config.d.ts.map +1 -1
- package/dist/read/config.js +2 -0
- package/dist/read/config.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 +8 -2
- 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 +76 -63
- package/dist/read/receipts.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 +12 -10
- package/dist/read/wallet.d.ts.map +1 -1
- package/dist/read/wallet.js +122 -136
- 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 +36 -69
- package/dist/recording-extensions.js.map +1 -1
- package/dist/release-extensions.d.ts +3 -20
- package/dist/release-extensions.d.ts.map +1 -1
- package/dist/release-extensions.js +13 -59
- package/dist/release-extensions.js.map +1 -1
- package/dist/release-graph.js +2 -2
- package/dist/release-graph.js.map +1 -1
- package/dist/royalty.d.ts +87 -0
- package/dist/royalty.d.ts.map +1 -0
- package/dist/royalty.js +160 -0
- package/dist/royalty.js.map +1 -0
- package/dist/share.d.ts +7 -6
- package/dist/share.d.ts.map +1 -1
- package/dist/share.js +38 -31
- package/dist/share.js.map +1 -1
- package/dist/transactions.d.ts +2 -2
- package/dist/transactions.d.ts.map +1 -1
- package/dist/transactions.js +6 -6
- package/dist/transactions.js.map +1 -1
- package/dist/vault.d.ts +20 -8
- package/dist/vault.d.ts.map +1 -1
- package/dist/vault.js +37 -21
- package/dist/vault.js.map +1 -1
- package/package.json +31 -10
- package/src/auth.ts +89 -70
- package/src/catalog.ts +35 -51
- package/src/client.ts +220 -141
- package/src/contracts/composition_credits/composition_credits.ts +170 -0
- package/src/contracts/composition_credits/composition_party_role.ts +190 -0
- package/src/contracts/composition_credits/deps/credit/credit.ts +28 -0
- package/src/contracts/composition_credits/deps/sui/vec_map.ts +34 -0
- package/src/contracts/composition_routed_stake/composition_routed_stake.ts +239 -0
- package/src/contracts/composition_royalty_pool/composition_royalty_pool.ts +154 -0
- package/src/contracts/composition_royalty_pool_plugin/composition_royalty_pool_plugin.ts +165 -0
- package/src/contracts/composition_royalty_pool_plugin/witness.ts +8 -0
- package/src/contracts/cover_art/cover_art.ts +98 -0
- package/src/contracts/cover_art/deps/ori/confidentiality.ts +24 -0
- package/src/contracts/cover_art/deps/ori/data.ts +12 -0
- package/src/contracts/genre/genre.ts +121 -0
- package/src/contracts/party_cta/party_cta.ts +213 -0
- package/src/contracts/party_genre/party_genre.ts +200 -0
- package/src/contracts/party_media/party_media.ts +142 -0
- package/src/contracts/party_music/party_music.ts +406 -0
- package/src/contracts/party_platform_link/party_platform_link.ts +149 -0
- package/src/contracts/party_pro_link/party_pro_link.ts +454 -0
- package/src/contracts/party_profile/deps/country_code/country_code.ts +20 -0
- package/src/contracts/party_profile/deps/language_code/language_code.ts +8 -0
- package/src/contracts/party_profile/party_profile.ts +240 -0
- package/src/contracts/party_roles/party_roles.ts +364 -0
- package/src/contracts/party_social/party_social.ts +503 -0
- package/src/contracts/party_tags/party_tags.ts +199 -0
- package/src/contracts/party_wallet/party_wallet.ts +174 -0
- package/src/contracts/record/deps/std/type_name.ts +23 -0
- package/src/contracts/record/deps/sui/vec_set.ts +22 -0
- package/src/contracts/record/pressing.ts +523 -0
- package/src/contracts/record/record.ts +339 -0
- package/src/contracts/record_shop/deps/std/type_name.ts +23 -0
- package/src/contracts/record_shop/listing.ts +603 -0
- package/src/contracts/record_shop/witness.ts +12 -0
- package/src/contracts/recording_advisory/recording_advisory.ts +316 -0
- package/src/contracts/recording_credits/deps/credit/credit.ts +28 -0
- package/src/contracts/recording_credits/deps/sui/vec_map.ts +34 -0
- package/src/contracts/recording_credits/deps/sui/vec_set.ts +22 -0
- package/src/contracts/recording_credits/recording_credits.ts +459 -0
- package/src/contracts/recording_credits/recording_party_role.ts +1042 -0
- package/src/contracts/recording_engine_session/deps/ori/confidentiality.ts +24 -0
- package/src/contracts/recording_engine_session/deps/ori/data.ts +12 -0
- package/src/contracts/recording_engine_session/recording_engine_session.ts +335 -0
- package/src/contracts/recording_genre/recording_genre.ts +235 -0
- package/src/contracts/recording_language/deps/language_code/language_code.ts +8 -0
- package/src/contracts/recording_language/recording_language.ts +238 -0
- package/src/contracts/recording_master_reference/deps/ori/confidentiality.ts +24 -0
- package/src/contracts/recording_master_reference/deps/ori/data.ts +12 -0
- package/src/contracts/recording_master_reference/recording_master_reference.ts +180 -0
- package/src/contracts/recording_royalty_pool/recording_royalty_pool.ts +157 -0
- package/src/contracts/recording_royalty_pool_plugin/recording_royalty_pool_plugin.ts +167 -0
- package/src/contracts/recording_royalty_pool_plugin/witness.ts +8 -0
- package/src/contracts/recording_streaming_transcode/deps/ori/data.ts +10 -0
- package/src/contracts/recording_streaming_transcode/recording_streaming_transcode.ts +203 -0
- package/src/contracts/release_cover_art/deps/0x51792b9adb9a5d05d7c4d74d7d0cb5aefc5639afa80c0089399cab8b99752e60/confidentiality.ts +24 -0
- package/src/contracts/release_cover_art/deps/0x51792b9adb9a5d05d7c4d74d7d0cb5aefc5639afa80c0089399cab8b99752e60/data.ts +12 -0
- package/src/contracts/release_cover_art/deps/cover_art/cover_art.ts +25 -0
- package/src/contracts/release_cover_art/deps/per_track/per_track.ts +37 -0
- package/src/contracts/release_cover_art/release_cover_art.ts +252 -0
- package/src/contracts/release_credits/deps/credit/credit.ts +28 -0
- package/src/contracts/release_credits/deps/sui/vec_map.ts +34 -0
- package/src/contracts/release_credits/release_credits.ts +157 -0
- package/src/contracts/release_credits/release_party_role.ts +87 -0
- package/src/contracts/release_description/release_description.ts +168 -0
- package/src/contracts/release_dsp_link/release_dsp_link.ts +813 -0
- package/src/contracts/release_genre/release_genre.ts +203 -0
- package/src/contracts/release_kind/release_kind.ts +154 -0
- package/src/contracts/release_revenue_distributor/release_revenue_distributor.ts +141 -0
- package/src/contracts/release_revenue_distributor_plugin/release_revenue_distributor_plugin.ts +143 -0
- package/src/contracts/release_revenue_distributor_plugin/witness.ts +8 -0
- package/src/contracts/routed_stake/deps/royalty_pool/stake.ts +53 -0
- package/src/contracts/routed_stake/deps/std/type_name.ts +23 -0
- package/src/contracts/routed_stake/deps/sui/balance.ts +18 -0
- package/src/contracts/routed_stake/deps/sui/vec_map.ts +34 -0
- package/src/contracts/routed_stake/routed_stake.ts +487 -0
- package/src/contracts/royalty_pool/deps/std/type_name.ts +23 -0
- package/src/contracts/royalty_pool/deps/sui/balance.ts +18 -0
- package/src/contracts/royalty_pool/deps/sui/vec_map.ts +34 -0
- package/src/contracts/royalty_pool/pool.ts +634 -0
- package/src/contracts/royalty_pool/stake.ts +305 -0
- package/src/contracts/utils/index.ts +428 -0
- package/src/contracts/vault/deps/sui/bag.ts +40 -0
- package/src/contracts/vault/deps/sui/borrow.ts +26 -0
- package/src/contracts/vault/vault.ts +509 -0
- package/src/contracts.ts +86 -39
- package/src/cover.ts +19 -28
- package/src/credits.ts +49 -81
- package/src/deployments.ts +321 -73
- package/src/errors.ts +156 -0
- package/src/events.ts +121 -0
- package/src/execute.ts +13 -9
- package/src/genre.ts +384 -0
- package/src/index.ts +10 -1
- package/src/internal.ts +2 -2
- package/src/packages.ts +243 -0
- package/src/party/client.ts +280 -0
- package/src/party/extensions/ctas.ts +46 -0
- package/src/party/extensions/genres.ts +62 -0
- package/src/party/extensions/links.ts +186 -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 +40 -0
- package/src/party/internal.ts +102 -0
- package/src/party/queries.ts +175 -0
- package/src/party/types.ts +88 -0
- package/src/pressing.ts +163 -166
- package/src/publication.ts +58 -45
- package/src/queries.ts +5 -5
- package/src/read/artist.ts +47 -42
- package/src/read/catalog.ts +201 -224
- package/src/read/client.ts +20 -13
- package/src/read/config.ts +9 -2
- package/src/read/genres.ts +24 -16
- package/src/read/index.ts +8 -2
- package/src/read/receipts.ts +131 -70
- package/src/read/types.ts +1 -1
- package/src/read/wallet.ts +199 -166
- package/src/read/works.ts +76 -195
- package/src/recording-extensions.ts +44 -98
- package/src/release-extensions.ts +11 -87
- package/src/release-graph.ts +2 -2
- package/src/royalty.ts +264 -0
- package/src/share.ts +45 -30
- package/src/transactions.ts +6 -6
- package/src/vault.ts +53 -30
|
@@ -5,20 +5,19 @@
|
|
|
5
5
|
// intent aggregates these concerns, but every value is written by its own
|
|
6
6
|
// independently deployed extension package.
|
|
7
7
|
|
|
8
|
-
import type { ClientWithCoreApi } from "@mysten/sui/client";
|
|
9
8
|
import { bcs } from "@mysten/sui/bcs";
|
|
10
|
-
import { deriveDynamicFieldID
|
|
9
|
+
import { deriveDynamicFieldID } from "@mysten/sui/utils";
|
|
11
10
|
import type {
|
|
12
11
|
Transaction,
|
|
13
12
|
TransactionArgument,
|
|
14
13
|
TransactionObjectArgument,
|
|
15
14
|
} from "@mysten/sui/transactions";
|
|
15
|
+
import { Effect, Option } from "effect";
|
|
16
|
+
import { getOptionalObjectContent, type SuiClient, type SuiRpcError } from "@misofm/effect";
|
|
16
17
|
import type { TxThunk } from "./transactions.ts";
|
|
17
|
-
import * as
|
|
18
|
-
import * as
|
|
19
|
-
import * as
|
|
20
|
-
import * as releaseGenre from "@misofm/protocol/contracts/release_genre/release_genre";
|
|
21
|
-
import * as releaseKind from "@misofm/protocol/contracts/release_kind/release_kind";
|
|
18
|
+
import * as releaseDescription from "./contracts/release_description/release_description.ts";
|
|
19
|
+
import * as releaseDspLink from "./contracts/release_dsp_link/release_dsp_link.ts";
|
|
20
|
+
import * as releaseKind from "./contracts/release_kind/release_kind.ts";
|
|
22
21
|
import { asU64, directAdminCap, invokeWithAdminCap, type AdminCapAuthority, type ObjectInput, type U64Input } from "./vault.ts";
|
|
23
22
|
|
|
24
23
|
function object(tx: Transaction, value: ObjectInput): TransactionObjectArgument {
|
|
@@ -88,19 +87,13 @@ export function parseReleaseKindContent(content: Uint8Array): string {
|
|
|
88
87
|
}
|
|
89
88
|
|
|
90
89
|
/** Read a Release's self-declared kind, or `null` when the extension is absent. */
|
|
91
|
-
export
|
|
92
|
-
client: ClientWithCoreApi,
|
|
90
|
+
export const getReleaseKind = Effect.fn("getReleaseKind")(function* (
|
|
93
91
|
releaseId: string,
|
|
94
92
|
releaseKindPackageId: string,
|
|
95
|
-
):
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
});
|
|
100
|
-
const object = objects[0];
|
|
101
|
-
if (!object || object instanceof Error || !object.content) return null;
|
|
102
|
-
return parseReleaseKindContent(object.content);
|
|
103
|
-
}
|
|
93
|
+
): Effect.fn.Return<string | null, SuiRpcError, SuiClient> {
|
|
94
|
+
const found = yield* getOptionalObjectContent(releaseKindFieldId(releaseId, releaseKindPackageId));
|
|
95
|
+
return Option.isNone(found) ? null : parseReleaseKindContent(found.value.content);
|
|
96
|
+
});
|
|
104
97
|
|
|
105
98
|
export type SetReleaseDescriptionParams = ReleaseExtensionTarget & {
|
|
106
99
|
description: string;
|
|
@@ -127,75 +120,6 @@ export function setReleaseDescription(p: SetReleaseDescriptionParams): TxThunk {
|
|
|
127
120
|
};
|
|
128
121
|
}
|
|
129
122
|
|
|
130
|
-
const GENRE_NAME_RE = /^[A-Z]+(?:_[A-Z]+)*$/;
|
|
131
|
-
|
|
132
|
-
/** Validate the canonical on-chain genre vocabulary spelling. */
|
|
133
|
-
export function assertCanonicalGenreName(name: string): void {
|
|
134
|
-
const bytes = new TextEncoder().encode(name).length;
|
|
135
|
-
if (bytes === 0 || bytes > 64 || !GENRE_NAME_RE.test(name)) {
|
|
136
|
-
throw new Error(
|
|
137
|
-
`Genre name must be 1-64 bytes of uppercase A-Z and underscores; got ${JSON.stringify(name)}`,
|
|
138
|
-
);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
/** Derive the immutable Genre object address for a canonical vocabulary name.
|
|
143
|
-
* `genrePackageId` must be the genre package's defining (original publish)
|
|
144
|
-
* address — the on-chain derivation hashes type names with defining IDs. */
|
|
145
|
-
export function deriveGenreAddress(
|
|
146
|
-
genreRegistryId: string,
|
|
147
|
-
genrePackageId: string,
|
|
148
|
-
canonicalName: string,
|
|
149
|
-
): string {
|
|
150
|
-
assertCanonicalGenreName(canonicalName);
|
|
151
|
-
return deriveObjectID(
|
|
152
|
-
genreRegistryId,
|
|
153
|
-
`${genrePackageId}::genre::GenreKey`,
|
|
154
|
-
genre.GenreKey.serialize([canonicalName]).toBytes(),
|
|
155
|
-
);
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
export interface TrackGenreAssignment {
|
|
159
|
-
trackIndex: U64Input;
|
|
160
|
-
genreId: string;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
export type SetReleaseGenresParams = ReleaseExtensionTarget & {
|
|
164
|
-
primaryGenreId: string;
|
|
165
|
-
secondaryGenreIds?: readonly string[];
|
|
166
|
-
trackPrimaryGenres?: readonly TrackGenreAssignment[];
|
|
167
|
-
releaseGenrePackageId: string;
|
|
168
|
-
};
|
|
169
|
-
|
|
170
|
-
/** Attach primary/secondary release genres and optional per-track overrides. */
|
|
171
|
-
export function setReleaseGenres(p: SetReleaseGenresParams): TxThunk {
|
|
172
|
-
return (tx) => {
|
|
173
|
-
invokeWithAdminCap(tx, authority(p), {
|
|
174
|
-
target: `${p.releaseGenrePackageId}::release_genre::set_primary_genre`,
|
|
175
|
-
arguments: [object(tx, p.releaseId), tx.object(p.primaryGenreId)],
|
|
176
|
-
adminCapIndex: 1,
|
|
177
|
-
});
|
|
178
|
-
for (const genreId of p.secondaryGenreIds ?? []) {
|
|
179
|
-
invokeWithAdminCap(tx, authority(p), {
|
|
180
|
-
target: `${p.releaseGenrePackageId}::release_genre::add_secondary_genre`,
|
|
181
|
-
arguments: [object(tx, p.releaseId), tx.object(genreId)],
|
|
182
|
-
adminCapIndex: 1,
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
for (const assignment of p.trackPrimaryGenres ?? []) {
|
|
186
|
-
invokeWithAdminCap(tx, authority(p), {
|
|
187
|
-
target: `${p.releaseGenrePackageId}::release_genre::set_track_primary_genre`,
|
|
188
|
-
arguments: [
|
|
189
|
-
object(tx, p.releaseId),
|
|
190
|
-
tx.pure.u64(asU64("trackIndex", assignment.trackIndex)),
|
|
191
|
-
tx.object(assignment.genreId),
|
|
192
|
-
],
|
|
193
|
-
adminCapIndex: 1,
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
};
|
|
197
|
-
}
|
|
198
|
-
|
|
199
123
|
export type DspLink =
|
|
200
124
|
| { platform: "Spotify"; id: string }
|
|
201
125
|
| {
|
package/src/release-graph.ts
CHANGED
|
@@ -18,14 +18,14 @@
|
|
|
18
18
|
// PTB, and existing recordings authorized by their admin cap.
|
|
19
19
|
//
|
|
20
20
|
// This is the whole-graph orchestration half of the opinionated publish flow —
|
|
21
|
-
// it composes `@misofm/
|
|
21
|
+
// it composes `@misofm/musicos`'s bare `composition`/`recording`/`track`/
|
|
22
22
|
// `release` core call bindings with its
|
|
23
23
|
// own `disperseShares`/`finalizeRelease` helpers into one PTB. Royalty pools are
|
|
24
24
|
// installed later through an admin-cap Vault plugin; the retired raw-cap helper
|
|
25
25
|
// is intentionally not used here.
|
|
26
26
|
|
|
27
27
|
import { Transaction, type TransactionObjectArgument } from "@mysten/sui/transactions";
|
|
28
|
-
import { contracts } from "@misofm/
|
|
28
|
+
import { contracts } from "@misofm/musicos";
|
|
29
29
|
import { custodyOf, disperseShares, finalizeRelease, recordingAuthorityOf, requiredCommandResult, type AdminCustodyInput, type RecordingAuthorityInput, type ShareRecipient } from "./transactions.ts";
|
|
30
30
|
import { disposeNewAdminCap, invokeWithAdminCap } from "./vault.ts";
|
|
31
31
|
|
package/src/royalty.ts
ADDED
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
// Copyright (c) Miso Labs, Inc.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
// Generic royalty-pool / stake / routed-stake reads and PTB builders. These are
|
|
5
|
+
// the raw, caller-owned primitives against the bare `royalty_pool` and
|
|
6
|
+
// `routed_stake` packages — Vault-gated crank operations (composition/recording
|
|
7
|
+
// royalty pool plugins, routed-stake Actions bound to a VaultAdminCap) live in
|
|
8
|
+
// `./vault.ts` instead; this module does not duplicate those.
|
|
9
|
+
|
|
10
|
+
import { Transaction, type TransactionArgument, type TransactionObjectArgument } from "@mysten/sui/transactions";
|
|
11
|
+
import { deriveObjectID, normalizeStructTag } from "@mysten/sui/utils";
|
|
12
|
+
import { Effect, Schema } from "effect";
|
|
13
|
+
import { decodeBcs, getOptionalObjectContent, type BcsDecodeError, type SuiClient, type SuiRpcError } from "@misofm/effect";
|
|
14
|
+
|
|
15
|
+
import { RoyaltyPool as RoyaltyPoolBcs } from "./contracts/royalty_pool/pool.ts";
|
|
16
|
+
import { Stake as RoyaltyStakeBcs } from "./contracts/royalty_pool/stake.ts";
|
|
17
|
+
import { RoutedStake as RoutedStakeBcs } from "./contracts/routed_stake/routed_stake.ts";
|
|
18
|
+
import * as royaltyPool from "./contracts/royalty_pool/pool.ts";
|
|
19
|
+
import * as royaltyStake from "./contracts/royalty_pool/stake.ts";
|
|
20
|
+
import * as routedStake from "./contracts/routed_stake/routed_stake.ts";
|
|
21
|
+
|
|
22
|
+
/** Key bytes for Move unit structs (single `0x00` for `dummy_field: bool = false`). */
|
|
23
|
+
const UNIT_STRUCT_KEY_BYTES = new Uint8Array([0x00]);
|
|
24
|
+
|
|
25
|
+
// ============================================================================
|
|
26
|
+
// Domain types
|
|
27
|
+
// ============================================================================
|
|
28
|
+
|
|
29
|
+
/** A stake's active registration against one royalty pool, keyed by currency type. */
|
|
30
|
+
export class RoyaltyStakeRegistration extends Schema.Class<RoyaltyStakeRegistration>(
|
|
31
|
+
"@misofm/platform/RoyaltyStakeRegistration",
|
|
32
|
+
)({
|
|
33
|
+
currencyType: Schema.String,
|
|
34
|
+
poolId: Schema.String,
|
|
35
|
+
/** Reward debt in `shares · index` units (u256, decimal string). */
|
|
36
|
+
debt: Schema.String,
|
|
37
|
+
}) {}
|
|
38
|
+
|
|
39
|
+
/** A bare `royalty_pool::pool::RoyaltyPool<Share, Currency>` object. Phantom type arguments do not affect BCS. */
|
|
40
|
+
export class RoyaltyPool extends Schema.Class<RoyaltyPool>("@misofm/platform/RoyaltyPool")({
|
|
41
|
+
id: Schema.String,
|
|
42
|
+
/** Currency balance held by the pool (u64, decimal string). */
|
|
43
|
+
balance: Schema.String,
|
|
44
|
+
/** Sum of every registered stake's shares (u64, decimal string). */
|
|
45
|
+
stakedShares: Schema.String,
|
|
46
|
+
/** Cumulative reward-per-share index (u256, decimal string). */
|
|
47
|
+
cumulativeRewardPerShare: Schema.String,
|
|
48
|
+
/** Deposit remainder not yet folded into the index (u128, decimal string). */
|
|
49
|
+
carry: Schema.String,
|
|
50
|
+
/** Lifetime sum of every deposited value; analytics only (u128, decimal string). */
|
|
51
|
+
cumulativeDeposits: Schema.String,
|
|
52
|
+
}) {}
|
|
53
|
+
|
|
54
|
+
/** A bare `royalty_pool::stake::Stake<Share>` object. */
|
|
55
|
+
export class RoyaltyStake extends Schema.Class<RoyaltyStake>("@misofm/platform/RoyaltyStake")({
|
|
56
|
+
id: Schema.String,
|
|
57
|
+
/** The staked balance (u64, decimal string). Immutable after creation. */
|
|
58
|
+
balance: Schema.String,
|
|
59
|
+
registrations: Schema.Array(RoyaltyStakeRegistration),
|
|
60
|
+
}) {}
|
|
61
|
+
|
|
62
|
+
/** A bare `routed_stake::routed_stake::RoutedStake<StakeShare, PoolShare>` object. */
|
|
63
|
+
export class RoutedStake extends Schema.Class<RoutedStake>("@misofm/platform/RoutedStake")({
|
|
64
|
+
id: Schema.String,
|
|
65
|
+
/** The wrapped position; `null` between `unstake` and `restake`. */
|
|
66
|
+
stake: Schema.NullOr(RoyaltyStake),
|
|
67
|
+
}) {}
|
|
68
|
+
|
|
69
|
+
// ============================================================================
|
|
70
|
+
// Reads
|
|
71
|
+
// ============================================================================
|
|
72
|
+
|
|
73
|
+
function mapRegistration(currencyType: string, poolId: string, debt: string): typeof RoyaltyStakeRegistration.Encoded {
|
|
74
|
+
return { currencyType: normalizeStructTag(currencyType), poolId, debt };
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function mapRoyaltyPool(poolId: string, parsed: ReturnType<typeof RoyaltyPoolBcs.parse>): typeof RoyaltyPool.Encoded {
|
|
78
|
+
return {
|
|
79
|
+
id: poolId,
|
|
80
|
+
balance: String(parsed.balance.value),
|
|
81
|
+
stakedShares: String(parsed.staked_shares),
|
|
82
|
+
cumulativeRewardPerShare: String(parsed.cumulative_reward_per_share),
|
|
83
|
+
carry: String(parsed.carry),
|
|
84
|
+
cumulativeDeposits: String(parsed.cumulative_deposits),
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function mapRoyaltyStake(stakeId: string, parsed: ReturnType<typeof RoyaltyStakeBcs.parse>): typeof RoyaltyStake.Encoded {
|
|
89
|
+
return {
|
|
90
|
+
id: stakeId,
|
|
91
|
+
balance: String(parsed.balance.value),
|
|
92
|
+
registrations: parsed.registrations.contents.map((entry) =>
|
|
93
|
+
mapRegistration(entry.key.name, entry.value.pool_id, String(entry.value.debt)),
|
|
94
|
+
),
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function mapRoutedStake(
|
|
99
|
+
routedStakeId: string,
|
|
100
|
+
parsed: ReturnType<typeof RoutedStakeBcs.parse>,
|
|
101
|
+
): typeof RoutedStake.Encoded {
|
|
102
|
+
return {
|
|
103
|
+
id: routedStakeId,
|
|
104
|
+
stake: parsed.stake ? mapRoyaltyStake(routedStakeId, parsed.stake) : null,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/** One royalty pool by object ID, or `null` when no such object exists. */
|
|
109
|
+
export const getRoyaltyPoolById = Effect.fn("getRoyaltyPoolById")(function* (
|
|
110
|
+
poolId: string,
|
|
111
|
+
): Effect.fn.Return<RoyaltyPool | null, BcsDecodeError | SuiRpcError, SuiClient> {
|
|
112
|
+
const found = yield* getOptionalObjectContent(poolId);
|
|
113
|
+
if (found._tag === "None") return null;
|
|
114
|
+
return yield* decodeBcs(
|
|
115
|
+
{ parse: (bytes) => mapRoyaltyPool(poolId, RoyaltyPoolBcs.parse(bytes)) },
|
|
116
|
+
RoyaltyPool,
|
|
117
|
+
found.value.content,
|
|
118
|
+
{ type: "RoyaltyPool", objectId: poolId },
|
|
119
|
+
);
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
/** One owned `Stake<Share>` by object ID, or `null` when no such object exists. */
|
|
123
|
+
export const getRoyaltyStakeById = Effect.fn("getRoyaltyStakeById")(function* (
|
|
124
|
+
stakeId: string,
|
|
125
|
+
): Effect.fn.Return<RoyaltyStake | null, BcsDecodeError | SuiRpcError, SuiClient> {
|
|
126
|
+
const found = yield* getOptionalObjectContent(stakeId);
|
|
127
|
+
if (found._tag === "None") return null;
|
|
128
|
+
return yield* decodeBcs(
|
|
129
|
+
{ parse: (bytes) => mapRoyaltyStake(stakeId, RoyaltyStakeBcs.parse(bytes)) },
|
|
130
|
+
RoyaltyStake,
|
|
131
|
+
found.value.content,
|
|
132
|
+
{ type: "RoyaltyStake", objectId: stakeId },
|
|
133
|
+
);
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
/** One shared routed stake by object ID, or `null` when no such object exists. */
|
|
137
|
+
export const getRoutedStakeById = Effect.fn("getRoutedStakeById")(function* (
|
|
138
|
+
routedStakeId: string,
|
|
139
|
+
): Effect.fn.Return<RoutedStake | null, BcsDecodeError | SuiRpcError, SuiClient> {
|
|
140
|
+
const found = yield* getOptionalObjectContent(routedStakeId);
|
|
141
|
+
if (found._tag === "None") return null;
|
|
142
|
+
return yield* decodeBcs(
|
|
143
|
+
{ parse: (bytes) => mapRoutedStake(routedStakeId, RoutedStakeBcs.parse(bytes)) },
|
|
144
|
+
RoutedStake,
|
|
145
|
+
found.value.content,
|
|
146
|
+
{ type: "RoutedStake", objectId: routedStakeId },
|
|
147
|
+
);
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
/** Deterministically derive the royalty-pool ID for a parent and type pair. */
|
|
151
|
+
export function deriveRoyaltyPoolId(
|
|
152
|
+
parentId: string,
|
|
153
|
+
shareType: string,
|
|
154
|
+
currencyType: string,
|
|
155
|
+
royaltyPoolPackageId: string,
|
|
156
|
+
): string {
|
|
157
|
+
return deriveObjectID(
|
|
158
|
+
parentId,
|
|
159
|
+
`${royaltyPoolPackageId}::pool::RoyaltyPoolKey<${shareType}, ${currencyType}>`,
|
|
160
|
+
UNIT_STRUCT_KEY_BYTES,
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/** Deterministically derive the routed-stake ID for a parent and stake share. */
|
|
165
|
+
export function deriveRoutedStakeId(
|
|
166
|
+
parentId: string,
|
|
167
|
+
stakeShareType: string,
|
|
168
|
+
routedStakePackageId: string,
|
|
169
|
+
): string {
|
|
170
|
+
return deriveObjectID(
|
|
171
|
+
parentId,
|
|
172
|
+
`${routedStakePackageId}::routed_stake::RoutedStakeKey<${stakeShareType}>`,
|
|
173
|
+
UNIT_STRUCT_KEY_BYTES,
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// ============================================================================
|
|
178
|
+
// Generic royalty primitives (PTB builders)
|
|
179
|
+
// ============================================================================
|
|
180
|
+
|
|
181
|
+
/** Create an owned `Stake<Share>` from a by-value `Balance<Share>`. */
|
|
182
|
+
export function createRoyaltyStake(
|
|
183
|
+
tx: Transaction,
|
|
184
|
+
params: {
|
|
185
|
+
balance: TransactionArgument;
|
|
186
|
+
shareType: string;
|
|
187
|
+
royaltyPoolPackageId: string;
|
|
188
|
+
},
|
|
189
|
+
): TransactionObjectArgument {
|
|
190
|
+
return tx.add(
|
|
191
|
+
royaltyStake._new({
|
|
192
|
+
package: params.royaltyPoolPackageId,
|
|
193
|
+
typeArguments: [params.shareType],
|
|
194
|
+
arguments: [params.balance],
|
|
195
|
+
}),
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/** Destroy an unregistered stake and return its principal `Balance<Share>`. */
|
|
200
|
+
export function destroyRoyaltyStake(
|
|
201
|
+
tx: Transaction,
|
|
202
|
+
params: {
|
|
203
|
+
stake: TransactionObjectArgument;
|
|
204
|
+
shareType: string;
|
|
205
|
+
royaltyPoolPackageId: string;
|
|
206
|
+
},
|
|
207
|
+
): TransactionObjectArgument {
|
|
208
|
+
return tx.add(
|
|
209
|
+
royaltyStake.destroy({
|
|
210
|
+
package: params.royaltyPoolPackageId,
|
|
211
|
+
typeArguments: [params.shareType],
|
|
212
|
+
arguments: [params.stake],
|
|
213
|
+
}),
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/** Register an owned stake against a shared royalty pool. */
|
|
218
|
+
export function registerRoyaltyStake(
|
|
219
|
+
tx: Transaction,
|
|
220
|
+
params: {
|
|
221
|
+
poolId: string;
|
|
222
|
+
stakeId?: string;
|
|
223
|
+
/** A `Stake` created earlier in this same PTB. */
|
|
224
|
+
stake?: TransactionObjectArgument;
|
|
225
|
+
shareType: string;
|
|
226
|
+
currencyType: string;
|
|
227
|
+
royaltyPoolPackageId: string;
|
|
228
|
+
},
|
|
229
|
+
): void {
|
|
230
|
+
if (!params.stake && !params.stakeId) {
|
|
231
|
+
throw new Error("registerRoyaltyStake: stakeId or stake required");
|
|
232
|
+
}
|
|
233
|
+
tx.add(
|
|
234
|
+
royaltyPool.registerStake({
|
|
235
|
+
package: params.royaltyPoolPackageId,
|
|
236
|
+
typeArguments: [params.shareType, params.currencyType],
|
|
237
|
+
arguments: [tx.object(params.poolId), params.stake ?? tx.object(params.stakeId!)],
|
|
238
|
+
}),
|
|
239
|
+
);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/** Claim rewards. The returned `Balance<Currency>` must be consumed in this PTB. */
|
|
243
|
+
export function claimRoyaltyRewards(
|
|
244
|
+
tx: Transaction,
|
|
245
|
+
params: {
|
|
246
|
+
poolId: string;
|
|
247
|
+
stakeId: string;
|
|
248
|
+
shareType: string;
|
|
249
|
+
currencyType: string;
|
|
250
|
+
royaltyPoolPackageId: string;
|
|
251
|
+
},
|
|
252
|
+
): TransactionObjectArgument {
|
|
253
|
+
return tx.add(
|
|
254
|
+
royaltyPool.claimRewards({
|
|
255
|
+
package: params.royaltyPoolPackageId,
|
|
256
|
+
typeArguments: [params.shareType, params.currencyType],
|
|
257
|
+
arguments: [tx.object(params.poolId), tx.object(params.stakeId)],
|
|
258
|
+
}),
|
|
259
|
+
);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
// `sweepRoutedStake` — the permissionless routed-stake reward sweep — already
|
|
263
|
+
// lives in `./vault.ts` and is exported from the package root from there; this
|
|
264
|
+
// module does not duplicate it.
|
package/src/share.ts
CHANGED
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
// currency still gets a descriptive, work-specific name.
|
|
22
22
|
|
|
23
23
|
import type { ParallelTransactionExecutor } from "@mysten/sui/transactions";
|
|
24
|
-
import type { ClientWithCoreApi } from "@mysten/sui/client";
|
|
25
24
|
import type { Signer } from "@mysten/sui/cryptography";
|
|
26
25
|
import { fromBase64, fromHex, toBase64 } from "@mysten/sui/utils";
|
|
27
26
|
import { update_constants } from "@mysten/move-bytecode-template";
|
|
27
|
+
import { Effect } from "effect";
|
|
28
28
|
import {
|
|
29
29
|
execThunks,
|
|
30
30
|
publishedPackageId,
|
|
@@ -32,7 +32,8 @@ import {
|
|
|
32
32
|
createdByType,
|
|
33
33
|
allCreatedByType,
|
|
34
34
|
type ExecResult,
|
|
35
|
-
} from "@misofm/
|
|
35
|
+
} from "@misofm/musicos";
|
|
36
|
+
import { SuiClient, SuiRpcError, type TransactionFailedError } from "@misofm/effect";
|
|
36
37
|
|
|
37
38
|
import { publishShareCurrency, initializeShareCurrency, type PackageBytecode } from "./transactions.ts";
|
|
38
39
|
import { SHARE_TEMPLATE } from "./share-template.ts";
|
|
@@ -107,23 +108,21 @@ export interface CreateShareCurrencyParams {
|
|
|
107
108
|
}
|
|
108
109
|
|
|
109
110
|
/** Publishes an immutable package, then initializes a fresh share currency in a second tx. */
|
|
110
|
-
export
|
|
111
|
-
client: ClientWithCoreApi,
|
|
111
|
+
export const createShareCurrency = Effect.fn("createShareCurrency")(function* (
|
|
112
112
|
signer: Signer,
|
|
113
113
|
params: CreateShareCurrencyParams,
|
|
114
|
-
):
|
|
114
|
+
): Effect.fn.Return<ShareCurrency, TransactionFailedError | SuiRpcError, SuiClient> {
|
|
115
115
|
const signerAddress = signer.toSuiAddress();
|
|
116
116
|
const initializer = params.initializerAddress ?? signerAddress;
|
|
117
117
|
const recipient = params.treasuryCapRecipient ?? signerAddress;
|
|
118
118
|
|
|
119
119
|
// Tx 1: publish the share package with the initializer baked in.
|
|
120
120
|
const patched = patchInitializer(params.template ?? SHARE_TEMPLATE, initializer);
|
|
121
|
-
const publishRes =
|
|
121
|
+
const publishRes = yield* execThunks(signer, publishShareCurrency(patched));
|
|
122
122
|
const packageId = publishedPackageId(publishRes);
|
|
123
123
|
|
|
124
124
|
// Tx 2: initialize → creates the Currency object + transfers the TreasuryCap.
|
|
125
|
-
const initRes =
|
|
126
|
-
client,
|
|
125
|
+
const initRes = yield* execThunks(
|
|
127
126
|
signer,
|
|
128
127
|
initializeShareCurrency({
|
|
129
128
|
shareCurrencyPackageId: packageId,
|
|
@@ -141,7 +140,7 @@ export async function createShareCurrency(
|
|
|
141
140
|
treasuryCapId: createdByType(initRes, TREASURY_CAP_TYPE),
|
|
142
141
|
gasUsed: publishRes.gasUsed + initRes.gasUsed,
|
|
143
142
|
};
|
|
144
|
-
}
|
|
143
|
+
});
|
|
145
144
|
|
|
146
145
|
// ── Batched (parallel) ─────────────────────────────────────────────────────
|
|
147
146
|
|
|
@@ -158,12 +157,12 @@ function chunk<T>(items: T[], size: number): T[][] {
|
|
|
158
157
|
* consumes its UpgradeCap in the same PTB. Returns the published package ids
|
|
159
158
|
* (fungible — order is not meaningful; the caller assigns them to work slots).
|
|
160
159
|
*/
|
|
161
|
-
export
|
|
160
|
+
export const publishShareCurrencies = Effect.fn("publishShareCurrencies")(function* (
|
|
162
161
|
executor: ParallelTransactionExecutor,
|
|
163
162
|
initializerAddress: string,
|
|
164
163
|
count: number,
|
|
165
164
|
template: PackageBytecode = SHARE_TEMPLATE,
|
|
166
|
-
):
|
|
165
|
+
): Effect.fn.Return<{ packageIds: string[]; gasUsed: number }, SuiRpcError> {
|
|
167
166
|
if (count <= 0) return { packageIds: [], gasUsed: 0 };
|
|
168
167
|
|
|
169
168
|
// One patched template, reused for every publish (identical bytecode → distinct packages).
|
|
@@ -174,8 +173,10 @@ export async function publishShareCurrencies(
|
|
|
174
173
|
batchSizes.push(Math.min(PUBLISHES_PER_PTB, remaining));
|
|
175
174
|
}
|
|
176
175
|
|
|
177
|
-
const results =
|
|
178
|
-
batchSizes
|
|
176
|
+
const results = yield* Effect.forEach(
|
|
177
|
+
batchSizes,
|
|
178
|
+
(n) => executeViaExecutor(executor, ...Array.from({ length: n }, () => publishShareCurrency(patched))),
|
|
179
|
+
{ concurrency: "unbounded" },
|
|
179
180
|
);
|
|
180
181
|
|
|
181
182
|
const packageIds = results.flatMap(allPublishedPackageIds);
|
|
@@ -184,7 +185,7 @@ export async function publishShareCurrencies(
|
|
|
184
185
|
throw new Error(`Expected ${count} published share packages, got ${packageIds.length}.`);
|
|
185
186
|
}
|
|
186
187
|
return { packageIds, gasUsed };
|
|
187
|
-
}
|
|
188
|
+
});
|
|
188
189
|
|
|
189
190
|
/** Re-associates one init PTB's created objects back to their packages by share type. */
|
|
190
191
|
function currenciesFromResult(res: ExecResult, batchPkgs: string[]): ShareCurrency[] {
|
|
@@ -211,19 +212,22 @@ function currenciesFromResult(res: ExecResult, batchPkgs: string[]): ShareCurren
|
|
|
211
212
|
* persist that batch immediately. If any batch fails, the succeeded ones are already
|
|
212
213
|
* reported and this throws, so a resume re-initializes only the still-missing packages.
|
|
213
214
|
*/
|
|
214
|
-
export
|
|
215
|
+
export const initializeShareCurrencies = Effect.fn("initializeShareCurrencies")(function* (
|
|
215
216
|
executor: ParallelTransactionExecutor,
|
|
216
217
|
signerAddress: string,
|
|
217
218
|
packageIds: string[],
|
|
218
219
|
metaOf: (packageId: string) => ShareCurrencyMeta,
|
|
219
220
|
onBatch?: (currencies: ShareCurrency[], gasUsed: number) => void | Promise<void>,
|
|
220
|
-
):
|
|
221
|
+
): Effect.fn.Return<{ currencies: ShareCurrency[]; gasUsed: number }, never> {
|
|
221
222
|
if (packageIds.length === 0) return { currencies: [], gasUsed: 0 };
|
|
222
223
|
|
|
223
224
|
const batches = chunk(packageIds, INITS_PER_PTB);
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
225
|
+
// `Effect.either` per batch preserves `Promise.allSettled`'s partial-failure
|
|
226
|
+
// tolerance: one batch's `SuiRpcError` does not cancel the others in flight.
|
|
227
|
+
const outcomes = yield* Effect.forEach(
|
|
228
|
+
batches,
|
|
229
|
+
(batchPkgs) =>
|
|
230
|
+
executeViaExecutor(
|
|
227
231
|
executor,
|
|
228
232
|
...batchPkgs.map((pkg) => {
|
|
229
233
|
const meta = metaOf(pkg);
|
|
@@ -235,22 +239,33 @@ export async function initializeShareCurrencies(
|
|
|
235
239
|
treasuryCapRecipient: signerAddress,
|
|
236
240
|
});
|
|
237
241
|
}),
|
|
238
|
-
)
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
242
|
+
).pipe(
|
|
243
|
+
Effect.map((res) => ({ batchCurrencies: currenciesFromResult(res, batchPkgs), gasUsed: res.gasUsed })),
|
|
244
|
+
// A rejecting callback is this batch's failure, not a defect: a defect
|
|
245
|
+
// would fail the whole forEach and interrupt sibling batches whose
|
|
246
|
+
// transactions are already submitted.
|
|
247
|
+
Effect.tap(({ batchCurrencies, gasUsed }) =>
|
|
248
|
+
onBatch
|
|
249
|
+
? Effect.tryPromise({
|
|
250
|
+
try: () => Promise.resolve(onBatch(batchCurrencies, gasUsed)),
|
|
251
|
+
catch: (cause) => new SuiRpcError({ operation: "onBatch", cause }),
|
|
252
|
+
})
|
|
253
|
+
: Effect.void,
|
|
254
|
+
),
|
|
255
|
+
Effect.result,
|
|
256
|
+
),
|
|
257
|
+
{ concurrency: "unbounded" },
|
|
243
258
|
);
|
|
244
259
|
|
|
245
260
|
const currencies: ShareCurrency[] = [];
|
|
246
261
|
const errors: unknown[] = [];
|
|
247
262
|
let gasUsed = 0;
|
|
248
|
-
for (const
|
|
249
|
-
if (
|
|
250
|
-
currencies.push(...
|
|
251
|
-
gasUsed +=
|
|
263
|
+
for (const outcome of outcomes) {
|
|
264
|
+
if (outcome._tag === "Success") {
|
|
265
|
+
currencies.push(...outcome.success.batchCurrencies);
|
|
266
|
+
gasUsed += outcome.success.gasUsed;
|
|
252
267
|
} else {
|
|
253
|
-
errors.push(
|
|
268
|
+
errors.push(outcome.failure);
|
|
254
269
|
}
|
|
255
270
|
}
|
|
256
271
|
if (errors.length > 0) {
|
|
@@ -258,4 +273,4 @@ export async function initializeShareCurrencies(
|
|
|
258
273
|
throw new Error(`${errors.length}/${batches.length} initialize batch(es) failed: ${msg}`);
|
|
259
274
|
}
|
|
260
275
|
return { currencies, gasUsed };
|
|
261
|
-
}
|
|
276
|
+
});
|
package/src/transactions.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
// `Transaction`, so a platform call composes with protocol calls and anything
|
|
7
7
|
// else in the same PTB.
|
|
8
8
|
//
|
|
9
|
-
// This module holds the OPINIONATED publish flows. `@misofm/
|
|
9
|
+
// This module holds the OPINIONATED publish flows. `@misofm/musicos` does the
|
|
10
10
|
// minimum the Move semantics FORCE and returns anything a caller could
|
|
11
11
|
// legitimately route elsewhere; deciding where those values GO is the
|
|
12
12
|
// platform-layer call that lives here:
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
// constraint, not a same-function one, which is exactly what makes this split
|
|
28
28
|
// possible.
|
|
29
29
|
//
|
|
30
|
-
// Composes with `@misofm/
|
|
30
|
+
// Composes with `@misofm/musicos`'s calls in the same PTB (the
|
|
31
31
|
// transaction-thunk composition pattern, just crossing a package boundary now).
|
|
32
32
|
|
|
33
33
|
import { Transaction, type TransactionObjectArgument } from "@mysten/sui/transactions";
|
|
@@ -41,10 +41,10 @@ import {
|
|
|
41
41
|
type RecordingParts,
|
|
42
42
|
type ShareCurrencyBinding,
|
|
43
43
|
type TxThunk,
|
|
44
|
-
} from "@misofm/
|
|
44
|
+
} from "@misofm/musicos";
|
|
45
45
|
import { asU64, directAdminCap, disposeNewAdminCap, invokeWithAdminCap, type AdminCapAuthority, type AdminCapCustody, type U64Input } from "./vault.ts";
|
|
46
|
-
import * as royaltyPool from "
|
|
47
|
-
import * as royaltyPoolStake from "
|
|
46
|
+
import * as royaltyPool from "./contracts/royalty_pool/pool.ts";
|
|
47
|
+
import * as royaltyPoolStake from "./contracts/royalty_pool/stake.ts";
|
|
48
48
|
|
|
49
49
|
const { track, release } = contracts;
|
|
50
50
|
|
|
@@ -284,7 +284,7 @@ export type FinalizeCompositionParams = FinalizeCompositionParamsBase & AdminCus
|
|
|
284
284
|
* The opinionated finish for a composition: disperse its share supply to
|
|
285
285
|
* `shareRecipients`, publish (share) it, and transfer its admin cap to
|
|
286
286
|
* `adminAddress`. Consumers that want different economics skip this and act on
|
|
287
|
-
* the `CompositionParts` from `@misofm/
|
|
287
|
+
* the `CompositionParts` from `@misofm/musicos`'s `createComposition` directly.
|
|
288
288
|
*/
|
|
289
289
|
export function finalizeComposition(tx: Transaction, params: FinalizeCompositionParams): void {
|
|
290
290
|
disperseShares(tx, params.minatoPackageId, params.shareType, params.balance, params.shareRecipients);
|