@misofm/platform 0.24.0 → 0.25.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 +125 -57
- package/dist/catalog.d.ts +1 -1
- package/dist/catalog.d.ts.map +1 -1
- package/dist/catalog.js +1 -1
- package/dist/catalog.js.map +1 -1
- package/dist/client.d.ts +107 -97
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +59 -39
- 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.js +2 -2
- package/dist/cover.js.map +1 -1
- package/dist/credits.js +6 -6
- package/dist/credits.js.map +1 -1
- package/dist/deployments.d.ts +104 -64
- package/dist/deployments.d.ts.map +1 -1
- package/dist/deployments.js +170 -36
- package/dist/deployments.js.map +1 -1
- 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 +2 -2
- package/dist/execute.d.ts.map +1 -1
- package/dist/execute.js +2 -2
- package/dist/execute.js.map +1 -1
- package/dist/genre.d.ts +124 -0
- package/dist/genre.d.ts.map +1 -0
- package/dist/genre.js +238 -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 +324 -0
- package/dist/party/client.d.ts.map +1 -0
- package/dist/party/client.js +214 -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 +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 +17 -0
- package/dist/party/queries.d.ts.map +1 -0
- package/dist/party/queries.js +118 -0
- package/dist/party/queries.js.map +1 -0
- package/dist/party/types.d.ts +43 -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/pressing.js +3 -3
- 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 +2 -2
- package/dist/queries.js.map +1 -1
- package/dist/read/artist.js +3 -3
- package/dist/read/artist.js.map +1 -1
- package/dist/read/catalog.d.ts +1 -1
- package/dist/read/catalog.d.ts.map +1 -1
- package/dist/read/catalog.js +3 -3
- package/dist/read/catalog.js.map +1 -1
- package/dist/read/client.d.ts +6 -3
- 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/index.js +1 -1
- package/dist/read/index.js.map +1 -1
- package/dist/read/receipts.js +4 -4
- 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 +1 -1
- package/dist/read/wallet.d.ts.map +1 -1
- package/dist/read/wallet.js +15 -14
- package/dist/read/wallet.js.map +1 -1
- package/dist/read/works.d.ts +1 -1
- package/dist/read/works.d.ts.map +1 -1
- package/dist/read/works.js +1 -1
- package/dist/read/works.js.map +1 -1
- package/dist/recording-extensions.js +7 -7
- package/dist/recording-extensions.js.map +1 -1
- package/dist/release-extensions.d.ts +0 -18
- package/dist/release-extensions.d.ts.map +1 -1
- package/dist/release-extensions.js +4 -49
- 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 +78 -0
- package/dist/royalty.js.map +1 -0
- package/dist/share.js +1 -1
- 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.js +6 -6
- package/dist/vault.js.map +1 -1
- package/package.json +24 -10
- package/src/catalog.ts +2 -2
- package/src/client.ts +103 -44
- 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 +2 -2
- package/src/credits.ts +6 -6
- package/src/deployments.ts +253 -39
- package/src/events.ts +121 -0
- package/src/execute.ts +3 -3
- package/src/genre.ts +369 -0
- package/src/index.ts +10 -1
- package/src/internal.ts +2 -2
- package/src/packages.ts +243 -0
- package/src/party/client.ts +268 -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 +40 -0
- package/src/party/internal.ts +102 -0
- package/src/party/queries.ts +163 -0
- package/src/party/types.ts +84 -0
- package/src/pressing.ts +5 -5
- package/src/publication.ts +58 -45
- package/src/queries.ts +2 -2
- package/src/read/artist.ts +3 -3
- package/src/read/catalog.ts +4 -4
- package/src/read/client.ts +9 -3
- package/src/read/config.ts +9 -2
- package/src/read/index.ts +1 -1
- package/src/read/receipts.ts +4 -4
- package/src/read/types.ts +1 -1
- package/src/read/wallet.ts +15 -14
- package/src/read/works.ts +1 -1
- package/src/recording-extensions.ts +7 -7
- package/src/release-extensions.ts +4 -75
- package/src/release-graph.ts +2 -2
- package/src/royalty.ts +167 -0
- package/src/share.ts +1 -1
- package/src/transactions.ts +6 -6
- package/src/vault.ts +6 -6
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/**
|
|
5
|
+
* A position holding share tokens registered against a `RoyaltyPool`.
|
|
6
|
+
*
|
|
7
|
+
* Stakes are owned objects with an immutable balance — to increase a holder's
|
|
8
|
+
* total staked amount, mint additional Stake objects rather than modify an
|
|
9
|
+
* existing one. This mirrors Sui's native staking model.
|
|
10
|
+
*
|
|
11
|
+
* Each stake tracks the royalty pools it is currently registered with via an
|
|
12
|
+
* inline `VecMap<TypeName, Registration>`, keyed by the pool's `Currency`
|
|
13
|
+
* `TypeName`. The stake cannot be destroyed while any registrations remain. Pool
|
|
14
|
+
* registrations are mutated by `royalty_pool::pool` through the package-private
|
|
15
|
+
* accessors below.
|
|
16
|
+
*
|
|
17
|
+
* Custody warning: `pool::claim_rewards` pays accrued rewards to the _caller_, and
|
|
18
|
+
* `Stake` is `key + store` — a bare shared stake (or one wrapped in a shared
|
|
19
|
+
* object that hands out `&mut`) is drainable by anyone. Stakes must stay
|
|
20
|
+
* address-owned, or wrapped by a contract that pins the reward route (e.g.
|
|
21
|
+
* `routed_stake`); the pool cannot enforce this itself.
|
|
22
|
+
*/
|
|
23
|
+
import { MoveStruct, normalizeMoveArguments } from '../utils/index.js';
|
|
24
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
25
|
+
import {} from '@mysten/sui/transactions';
|
|
26
|
+
import * as balance_1 from './deps/sui/balance.js';
|
|
27
|
+
import * as vec_map from './deps/sui/vec_map.js';
|
|
28
|
+
import * as type_name from './deps/std/type_name.js';
|
|
29
|
+
const $moduleName = '@local-pkg/royalty_pool::stake';
|
|
30
|
+
export const Registration = new MoveStruct({ name: `${$moduleName}::Registration`, fields: {
|
|
31
|
+
pool_id: bcs.Address,
|
|
32
|
+
/**
|
|
33
|
+
* Reward debt in `shares · index` units: `shares · index` as of registration, plus
|
|
34
|
+
* `reward · PRECISION` for every payout since. The pending reward is
|
|
35
|
+
* `(shares · index − debt) / PRECISION`, computed by `royalty_pool::pool`. Kept at
|
|
36
|
+
* full precision so no rounding is ever stored: `debt ≤ shares · index` always
|
|
37
|
+
* holds.
|
|
38
|
+
*/
|
|
39
|
+
debt: bcs.u256()
|
|
40
|
+
} });
|
|
41
|
+
export const Stake = new MoveStruct({ name: `${$moduleName}::Stake<phantom Share>`, fields: {
|
|
42
|
+
id: bcs.Address,
|
|
43
|
+
/** The staked balance. Immutable after creation. */
|
|
44
|
+
balance: balance_1.Balance,
|
|
45
|
+
/**
|
|
46
|
+
* Active royalty-pool registrations, keyed by `Currency` `TypeName`. Must be empty
|
|
47
|
+
* to destroy.
|
|
48
|
+
*/
|
|
49
|
+
registrations: vec_map.VecMap(type_name.TypeName, Registration)
|
|
50
|
+
} });
|
|
51
|
+
export const StakeCreatedEvent = new MoveStruct({ name: `${$moduleName}::StakeCreatedEvent<phantom Share>`, fields: {
|
|
52
|
+
stake_id: bcs.Address,
|
|
53
|
+
amount: bcs.u64()
|
|
54
|
+
} });
|
|
55
|
+
export const StakeDestroyedEvent = new MoveStruct({ name: `${$moduleName}::StakeDestroyedEvent<phantom Share>`, fields: {
|
|
56
|
+
stake_id: bcs.Address,
|
|
57
|
+
amount: bcs.u64()
|
|
58
|
+
} });
|
|
59
|
+
/**
|
|
60
|
+
* Create a new stake with the given balance.
|
|
61
|
+
*
|
|
62
|
+
* Aborts if `balance` is zero.
|
|
63
|
+
*/
|
|
64
|
+
export function _new(options) {
|
|
65
|
+
const packageAddress = options.package ?? '@local-pkg/royalty_pool';
|
|
66
|
+
const argumentsTypes = [
|
|
67
|
+
null
|
|
68
|
+
];
|
|
69
|
+
const parameterNames = ["balance"];
|
|
70
|
+
return (tx) => tx.moveCall({
|
|
71
|
+
package: packageAddress,
|
|
72
|
+
module: 'stake',
|
|
73
|
+
function: 'new',
|
|
74
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
75
|
+
typeArguments: options.typeArguments
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Destroy a stake and reclaim its balance.
|
|
80
|
+
*
|
|
81
|
+
* Aborts if the stake is still registered with any royalty pools.
|
|
82
|
+
*/
|
|
83
|
+
export function destroy(options) {
|
|
84
|
+
const packageAddress = options.package ?? '@local-pkg/royalty_pool';
|
|
85
|
+
const argumentsTypes = [
|
|
86
|
+
null
|
|
87
|
+
];
|
|
88
|
+
const parameterNames = ["stake"];
|
|
89
|
+
return (tx) => tx.moveCall({
|
|
90
|
+
package: packageAddress,
|
|
91
|
+
module: 'stake',
|
|
92
|
+
function: 'destroy',
|
|
93
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
94
|
+
typeArguments: options.typeArguments
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
export function balance(options) {
|
|
98
|
+
const packageAddress = options.package ?? '@local-pkg/royalty_pool';
|
|
99
|
+
const argumentsTypes = [
|
|
100
|
+
null
|
|
101
|
+
];
|
|
102
|
+
const parameterNames = ["self"];
|
|
103
|
+
return (tx) => tx.moveCall({
|
|
104
|
+
package: packageAddress,
|
|
105
|
+
module: 'stake',
|
|
106
|
+
function: 'balance',
|
|
107
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
108
|
+
typeArguments: options.typeArguments
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
export function value(options) {
|
|
112
|
+
const packageAddress = options.package ?? '@local-pkg/royalty_pool';
|
|
113
|
+
const argumentsTypes = [
|
|
114
|
+
null
|
|
115
|
+
];
|
|
116
|
+
const parameterNames = ["self"];
|
|
117
|
+
return (tx) => tx.moveCall({
|
|
118
|
+
package: packageAddress,
|
|
119
|
+
module: 'stake',
|
|
120
|
+
function: 'value',
|
|
121
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
122
|
+
typeArguments: options.typeArguments
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
/** Number of royalty pools this stake is currently registered with. */
|
|
126
|
+
export function registrationCount(options) {
|
|
127
|
+
const packageAddress = options.package ?? '@local-pkg/royalty_pool';
|
|
128
|
+
const argumentsTypes = [
|
|
129
|
+
null
|
|
130
|
+
];
|
|
131
|
+
const parameterNames = ["self"];
|
|
132
|
+
return (tx) => tx.moveCall({
|
|
133
|
+
package: packageAddress,
|
|
134
|
+
module: 'stake',
|
|
135
|
+
function: 'registration_count',
|
|
136
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
137
|
+
typeArguments: options.typeArguments
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
export function hasRegistration(options) {
|
|
141
|
+
const packageAddress = options.package ?? '@local-pkg/royalty_pool';
|
|
142
|
+
const argumentsTypes = [
|
|
143
|
+
null,
|
|
144
|
+
null
|
|
145
|
+
];
|
|
146
|
+
const parameterNames = ["self", "currency"];
|
|
147
|
+
return (tx) => tx.moveCall({
|
|
148
|
+
package: packageAddress,
|
|
149
|
+
module: 'stake',
|
|
150
|
+
function: 'has_registration',
|
|
151
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
152
|
+
typeArguments: options.typeArguments
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
export function getRegistration(options) {
|
|
156
|
+
const packageAddress = options.package ?? '@local-pkg/royalty_pool';
|
|
157
|
+
const argumentsTypes = [
|
|
158
|
+
null,
|
|
159
|
+
null
|
|
160
|
+
];
|
|
161
|
+
const parameterNames = ["self", "currency"];
|
|
162
|
+
return (tx) => tx.moveCall({
|
|
163
|
+
package: packageAddress,
|
|
164
|
+
module: 'stake',
|
|
165
|
+
function: 'get_registration',
|
|
166
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
167
|
+
typeArguments: options.typeArguments
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
export function registrationPoolId(options) {
|
|
171
|
+
const packageAddress = options.package ?? '@local-pkg/royalty_pool';
|
|
172
|
+
const argumentsTypes = [
|
|
173
|
+
null
|
|
174
|
+
];
|
|
175
|
+
const parameterNames = ["r"];
|
|
176
|
+
return (tx) => tx.moveCall({
|
|
177
|
+
package: packageAddress,
|
|
178
|
+
module: 'stake',
|
|
179
|
+
function: 'registration_pool_id',
|
|
180
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
export function registrationDebt(options) {
|
|
184
|
+
const packageAddress = options.package ?? '@local-pkg/royalty_pool';
|
|
185
|
+
const argumentsTypes = [
|
|
186
|
+
null
|
|
187
|
+
];
|
|
188
|
+
const parameterNames = ["r"];
|
|
189
|
+
return (tx) => tx.moveCall({
|
|
190
|
+
package: packageAddress,
|
|
191
|
+
module: 'stake',
|
|
192
|
+
function: 'registration_debt',
|
|
193
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
//# sourceMappingURL=stake.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stake.js","sourceRoot":"","sources":["../../../src/contracts/royalty_pool/stake.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAGhE;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,UAAU,EAAE,sBAAsB,EAA+B,MAAM,mBAAmB,CAAC;AACpG,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEtC,OAAO,EAA8C,MAAM,0BAA0B,CAAC;AACtF,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,OAAO,MAAM,uBAAuB,CAAC;AACjD,OAAO,KAAK,SAAS,MAAM,yBAAyB,CAAC;AACrD,MAAM,WAAW,GAAG,gCAAgC,CAAC;AACrD,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,UAAU,CAAC,EAAE,IAAI,EAAE,GAAG,WAAW,gBAAgB,EAAE,MAAM,EAAE;QACnF,OAAO,EAAE,GAAG,CAAC,OAAO;QACpB;;;;;;WAMG;QACH,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE;KACnB,EAAE,CAAC,CAAC;AACT,MAAM,CAAC,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,EAAE,IAAI,EAAE,GAAG,WAAW,wBAAwB,EAAE,MAAM,EAAE;QACpF,EAAE,EAAE,GAAG,CAAC,OAAO;QACf,oDAAoD;QACpD,OAAO,EAAE,SAAS,CAAC,OAAO;QAC1B;;;WAGG;QACH,aAAa,EAAE,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE,YAAY,CAAC;KAClE,EAAE,CAAC,CAAC;AACT,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,UAAU,CAAC,EAAE,IAAI,EAAE,GAAG,WAAW,oCAAoC,EAAE,MAAM,EAAE;QAC5G,QAAQ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SAAS,EAAE,cAAc,EAAE,cAAc,CAAC;QACpF,aAAa,EAAE,OAAO,CAAC,aAAa;KACvC,CAAC,CAAC;AACP,CAAC;AAUD,MAAM,UAAU,kBAAkB,CAAC,OAAkC;IACjE,MAAM,cAAc,GAAG,OAAO,CAAC,OAAO,IAAI,yBAAyB,CAAC;IACpE,MAAM,cAAc,GAAG;QACnB,IAAI;KACqB,CAAC;IAC9B,MAAM,cAAc,GAAG,CAAC,GAAG,CAAC,CAAC;IAC7B,OAAO,CAAC,EAAe,EAAE,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC;QACpC,OAAO,EAAE,cAAc;QACvB,MAAM,EAAE,OAAO;QACf,QAAQ,EAAE,sBAAsB;QAChC,SAAS,EAAE,sBAAsB,CAAC,OAAO,CAAC,SAAS,EAAE,cAAc,EAAE,cAAc,CAAC;KACvF,CAAC,CAAC;AACP,CAAC;AAUD,MAAM,UAAU,gBAAgB,CAAC,OAAgC;IAC7D,MAAM,cAAc,GAAG,OAAO,CAAC,OAAO,IAAI,yBAAyB,CAAC;IACpE,MAAM,cAAc,GAAG;QACnB,IAAI;KACqB,CAAC;IAC9B,MAAM,cAAc,GAAG,CAAC,GAAG,CAAC,CAAC;IAC7B,OAAO,CAAC,EAAe,EAAE,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC;QACpC,OAAO,EAAE,cAAc;QACvB,MAAM,EAAE,OAAO;QACf,QAAQ,EAAE,mBAAmB;QAC7B,SAAS,EAAE,sBAAsB,CAAC,OAAO,CAAC,SAAS,EAAE,cAAc,EAAE,cAAc,CAAC;KACvF,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { type BcsType, type TypeTag, BcsStruct, BcsEnum, BcsTuple } from '@mysten/sui/bcs';
|
|
2
|
+
import { type TransactionArgument, type TransactionObjectArgument } from '@mysten/sui/transactions';
|
|
3
|
+
import { type ClientWithCoreApi, type SuiClientTypes } from '@mysten/sui/client';
|
|
4
|
+
export type RawTransactionArgument<T> = T | TransactionArgument;
|
|
5
|
+
export type GetOptions<Include extends Omit<SuiClientTypes.ObjectInclude, 'content'> = {}> = SuiClientTypes.GetObjectOptions<Include> & {
|
|
6
|
+
client: ClientWithCoreApi;
|
|
7
|
+
};
|
|
8
|
+
export type GetManyOptions<Include extends Omit<SuiClientTypes.ObjectInclude, 'content'> = {}> = SuiClientTypes.GetObjectsOptions<Include> & {
|
|
9
|
+
client: ClientWithCoreApi;
|
|
10
|
+
};
|
|
11
|
+
export declare function getPureBcsSchema(typeTag: string | TypeTag): BcsType<any> | null;
|
|
12
|
+
export declare function normalizeMoveArguments(args: unknown[] | object, argTypes: readonly (string | null)[], parameterNames?: string[]): TransactionArgument[];
|
|
13
|
+
/** Context passed to config resolver functions. */
|
|
14
|
+
export interface ConfigResolverContext {
|
|
15
|
+
/**
|
|
16
|
+
* The matched parameter's own instantiated type arguments (not the whole function's type
|
|
17
|
+
* argument tuple). Concrete instantiations are canonical type tags; generic positions pass
|
|
18
|
+
* the caller's `typeArguments` strings through as provided.
|
|
19
|
+
*/
|
|
20
|
+
typeArguments: string[];
|
|
21
|
+
/** The package address the generated call will be sent to. */
|
|
22
|
+
packageAddress: string;
|
|
23
|
+
/** The Move module of the generated call. */
|
|
24
|
+
moduleName: string;
|
|
25
|
+
/** The Move function of the generated call. */
|
|
26
|
+
functionName: string;
|
|
27
|
+
/** The Move name of the matched parameter, when the summary includes parameter names. */
|
|
28
|
+
parameterName?: string;
|
|
29
|
+
/** The matched parameter's position in the generated function's arguments. */
|
|
30
|
+
parameterIndex: number;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* A non-callback transaction argument in a generated config object, used for keys whose matched
|
|
34
|
+
* parameter can't be supplied as an object id string.
|
|
35
|
+
*/
|
|
36
|
+
export type ConfigObjectValue = Exclude<TransactionObjectArgument, (...args: never[]) => unknown>;
|
|
37
|
+
/**
|
|
38
|
+
* A plain value in a generated config object: an object id or a non-callback transaction
|
|
39
|
+
* argument. Keys that can resolve multiple bindings are typed as resolver functions instead.
|
|
40
|
+
*/
|
|
41
|
+
export type ConfigValue = string | ConfigObjectValue;
|
|
42
|
+
/** A type argument: a type tag string, or a BCS type whose name is a Move type. */
|
|
43
|
+
export type TypeArgument = string | BcsType<any>;
|
|
44
|
+
export interface TypeTagOptions {
|
|
45
|
+
package?: string;
|
|
46
|
+
typeArguments?: readonly TypeArgument[];
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* `typeArguments` is required when the type's name contains unfilled
|
|
50
|
+
* `phantom X` parameters (at any depth). Everything else — argument arity,
|
|
51
|
+
* position contents, and tag validity — is validated at runtime.
|
|
52
|
+
*/
|
|
53
|
+
type TypeTagParams<Name extends string> = Name extends `${string}phantom ${string}` ? [options: TypeTagOptions & {
|
|
54
|
+
typeArguments: readonly TypeArgument[];
|
|
55
|
+
}] : [options?: TypeTagOptions];
|
|
56
|
+
type ResolveTypeTagOptions<Name extends string> = {
|
|
57
|
+
client: ClientWithCoreApi;
|
|
58
|
+
} & (Name extends `${string}phantom ${string}` ? TypeTagOptions & {
|
|
59
|
+
typeArguments: readonly TypeArgument[];
|
|
60
|
+
} : TypeTagOptions);
|
|
61
|
+
export declare class MoveStruct<T extends Record<string, BcsType<any>>, const Name extends string = string> extends BcsStruct<T, Name> {
|
|
62
|
+
/**
|
|
63
|
+
* Build the type tag for this struct.
|
|
64
|
+
*
|
|
65
|
+
* `typeArguments` is the full positional list, in Move declaration order, and
|
|
66
|
+
* is required when the struct has unfilled phantom parameters. The result may
|
|
67
|
+
* contain MVR names: those are valid in transaction `typeArguments`, but for
|
|
68
|
+
* queries or comparisons against on-chain data use `resolveTypeTag` instead.
|
|
69
|
+
*/
|
|
70
|
+
typeTag(...args: TypeTagParams<Name>): string;
|
|
71
|
+
/**
|
|
72
|
+
* Build the type tag for this struct, then resolve any MVR names through the
|
|
73
|
+
* client (using its configured overrides and the MVR API) and return the
|
|
74
|
+
* normalized, address-only form suitable for queries and comparisons against
|
|
75
|
+
* on-chain data.
|
|
76
|
+
*/
|
|
77
|
+
resolveTypeTag(options: ResolveTypeTagOptions<Name>): Promise<string>;
|
|
78
|
+
get<Include extends Omit<SuiClientTypes.ObjectInclude, 'content' | 'json'> = {}>({ objectId, ...options }: GetOptions<Include>): Promise<SuiClientTypes.Object<Include & {
|
|
79
|
+
content: true;
|
|
80
|
+
json: true;
|
|
81
|
+
}> & {
|
|
82
|
+
json: BcsStruct<T>['$inferType'];
|
|
83
|
+
}>;
|
|
84
|
+
getMany<Include extends Omit<SuiClientTypes.ObjectInclude, 'content' | 'json'> = {}>({ client, ...options }: GetManyOptions<Include>): Promise<Array<SuiClientTypes.Object<Include & {
|
|
85
|
+
content: true;
|
|
86
|
+
json: true;
|
|
87
|
+
}> & {
|
|
88
|
+
json: BcsStruct<T>['$inferType'];
|
|
89
|
+
}>>;
|
|
90
|
+
}
|
|
91
|
+
export declare class MoveEnum<T extends Record<string, BcsType<any> | null>, const Name extends string> extends BcsEnum<T, Name> {
|
|
92
|
+
/** Build the type tag for this enum. See `MoveStruct.typeTag` for semantics. */
|
|
93
|
+
typeTag(...args: TypeTagParams<Name>): string;
|
|
94
|
+
/** Build and resolve the type tag for this enum. See `MoveStruct.resolveTypeTag`. */
|
|
95
|
+
resolveTypeTag(options: ResolveTypeTagOptions<Name>): Promise<string>;
|
|
96
|
+
}
|
|
97
|
+
export declare class MoveTuple<const T extends readonly BcsType<any>[], const Name extends string> extends BcsTuple<T, Name> {
|
|
98
|
+
/** Build the type tag for this struct. See `MoveStruct.typeTag` for semantics. */
|
|
99
|
+
typeTag(...args: TypeTagParams<Name>): string;
|
|
100
|
+
/** Build and resolve the type tag for this struct. See `MoveStruct.resolveTypeTag`. */
|
|
101
|
+
resolveTypeTag(options: ResolveTypeTagOptions<Name>): Promise<string>;
|
|
102
|
+
}
|
|
103
|
+
export {};
|
|
104
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
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;IACzB,gFAAgF;IAChF,OAAO,CAAC,GAAG,IAAI,EAAE,aAAa,CAAC,IAAI,CAAC,GAAG,MAAM,CAE5C;IAED,qFAAqF;IAC/E,cAAc,CAAC,OAAO,EAAE,qBAAqB,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAE1E;CACD;AAED,qBAAa,SAAS,CACrB,KAAK,CAAC,CAAC,SAAS,SAAS,OAAO,CAAC,GAAG,CAAC,EAAE,EACvC,KAAK,CAAC,IAAI,SAAS,MAAM,CACxB,SAAQ,QAAQ,CAAC,CAAC,EAAE,IAAI,CAAC;IAC1B,kFAAkF;IAClF,OAAO,CAAC,GAAG,IAAI,EAAE,aAAa,CAAC,IAAI,CAAC,GAAG,MAAM,CAE5C;IAED,uFAAuF;IACjF,cAAc,CAAC,OAAO,EAAE,qBAAqB,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAE1E;CACD"}
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
import { bcs, TypeTagSerializer, BcsStruct, BcsEnum, BcsTuple, } from '@mysten/sui/bcs';
|
|
2
|
+
import { normalizeStructTag, normalizeSuiAddress } from '@mysten/sui/utils';
|
|
3
|
+
import { isArgument, } from '@mysten/sui/transactions';
|
|
4
|
+
import {} from '@mysten/sui/client';
|
|
5
|
+
const MOVE_STDLIB_ADDRESS = normalizeSuiAddress('0x1');
|
|
6
|
+
const SUI_FRAMEWORK_ADDRESS = normalizeSuiAddress('0x2');
|
|
7
|
+
export function getPureBcsSchema(typeTag) {
|
|
8
|
+
const parsedTag = typeof typeTag === 'string' ? TypeTagSerializer.parseFromStr(typeTag) : typeTag;
|
|
9
|
+
if ('u8' in parsedTag) {
|
|
10
|
+
return bcs.U8;
|
|
11
|
+
}
|
|
12
|
+
else if ('u16' in parsedTag) {
|
|
13
|
+
return bcs.U16;
|
|
14
|
+
}
|
|
15
|
+
else if ('u32' in parsedTag) {
|
|
16
|
+
return bcs.U32;
|
|
17
|
+
}
|
|
18
|
+
else if ('u64' in parsedTag) {
|
|
19
|
+
return bcs.U64;
|
|
20
|
+
}
|
|
21
|
+
else if ('u128' in parsedTag) {
|
|
22
|
+
return bcs.U128;
|
|
23
|
+
}
|
|
24
|
+
else if ('u256' in parsedTag) {
|
|
25
|
+
return bcs.U256;
|
|
26
|
+
}
|
|
27
|
+
else if ('address' in parsedTag) {
|
|
28
|
+
return bcs.Address;
|
|
29
|
+
}
|
|
30
|
+
else if ('bool' in parsedTag) {
|
|
31
|
+
return bcs.Bool;
|
|
32
|
+
}
|
|
33
|
+
else if ('vector' in parsedTag) {
|
|
34
|
+
const type = getPureBcsSchema(parsedTag.vector);
|
|
35
|
+
return type ? bcs.vector(type) : null;
|
|
36
|
+
}
|
|
37
|
+
else if ('struct' in parsedTag) {
|
|
38
|
+
const structTag = parsedTag.struct;
|
|
39
|
+
const pkg = normalizeSuiAddress(structTag.address);
|
|
40
|
+
if (pkg === MOVE_STDLIB_ADDRESS) {
|
|
41
|
+
if ((structTag.module === 'ascii' || structTag.module === 'string') &&
|
|
42
|
+
structTag.name === 'String') {
|
|
43
|
+
return bcs.String;
|
|
44
|
+
}
|
|
45
|
+
if (structTag.module === 'option' && structTag.name === 'Option') {
|
|
46
|
+
const inner = structTag.typeParams[0];
|
|
47
|
+
const type = inner ? getPureBcsSchema(inner) : null;
|
|
48
|
+
return type ? bcs.option(type) : null;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
if (pkg === SUI_FRAMEWORK_ADDRESS &&
|
|
52
|
+
structTag.module === 'object' &&
|
|
53
|
+
(structTag.name === 'ID' || structTag.name === 'UID')) {
|
|
54
|
+
return bcs.Address;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
export function normalizeMoveArguments(args, argTypes, parameterNames) {
|
|
60
|
+
const argLen = Array.isArray(args) ? args.length : Object.keys(args).length;
|
|
61
|
+
if (parameterNames && argLen !== parameterNames.length) {
|
|
62
|
+
throw new Error(`Invalid number of arguments, expected ${parameterNames.length}, got ${argLen}`);
|
|
63
|
+
}
|
|
64
|
+
const normalizedArgs = [];
|
|
65
|
+
let index = 0;
|
|
66
|
+
for (const argType of argTypes) {
|
|
67
|
+
if (argType === '0x2::clock::Clock') {
|
|
68
|
+
normalizedArgs.push((tx) => tx.object.clock());
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
if (argType === '0x2::random::Random') {
|
|
72
|
+
normalizedArgs.push((tx) => tx.object.random());
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
if (argType === '0x2::deny_list::DenyList') {
|
|
76
|
+
normalizedArgs.push((tx) => tx.object.denyList());
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
if (argType === '0x2::accumulator::AccumulatorRoot') {
|
|
80
|
+
// Chain-wide shared singleton at a fixed address (SUI_ACCUMULATOR_ROOT_OBJECT_ID).
|
|
81
|
+
normalizedArgs.push((tx) => tx.object('0xacc'));
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
if (argType === '0x3::sui_system::SuiSystemState') {
|
|
85
|
+
normalizedArgs.push((tx) => tx.object.system());
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
let arg;
|
|
89
|
+
if (Array.isArray(args)) {
|
|
90
|
+
if (index >= args.length) {
|
|
91
|
+
throw new Error(`Invalid number of arguments, expected at least ${index + 1}, got ${args.length}`);
|
|
92
|
+
}
|
|
93
|
+
arg = args[index];
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
if (!parameterNames) {
|
|
97
|
+
throw new Error(`Expected arguments to be passed as an array`);
|
|
98
|
+
}
|
|
99
|
+
const name = parameterNames[index];
|
|
100
|
+
arg =
|
|
101
|
+
name !== undefined && Object.prototype.hasOwnProperty.call(args, name)
|
|
102
|
+
? args[name]
|
|
103
|
+
: undefined;
|
|
104
|
+
if (arg === undefined) {
|
|
105
|
+
throw new Error(`Parameter ${name} is required`);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
index += 1;
|
|
109
|
+
if (typeof arg === 'function' || isArgument(arg)) {
|
|
110
|
+
normalizedArgs.push(arg);
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
const bcsType = argType === null ? null : getPureBcsSchema(argType);
|
|
114
|
+
if (bcsType) {
|
|
115
|
+
const bytes = bcsType.serialize(arg);
|
|
116
|
+
normalizedArgs.push((tx) => tx.pure(bytes));
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
if (typeof arg === 'string') {
|
|
120
|
+
normalizedArgs.push((tx) => tx.object(arg));
|
|
121
|
+
continue;
|
|
122
|
+
}
|
|
123
|
+
throw new Error(`Invalid argument ${stringify(arg)} for type ${argType}`);
|
|
124
|
+
}
|
|
125
|
+
return normalizedArgs;
|
|
126
|
+
}
|
|
127
|
+
const HAS_PHANTOM_REGEX = /phantom [A-Za-z_$][A-Za-z0-9_$]*/;
|
|
128
|
+
function splitTopLevelTypeArgs(inner) {
|
|
129
|
+
const parts = [];
|
|
130
|
+
let depth = 0;
|
|
131
|
+
let current = '';
|
|
132
|
+
for (const char of inner) {
|
|
133
|
+
if (char === ',' && depth === 0) {
|
|
134
|
+
parts.push(current.trim());
|
|
135
|
+
current = '';
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
if (char === '<')
|
|
139
|
+
depth++;
|
|
140
|
+
if (char === '>')
|
|
141
|
+
depth--;
|
|
142
|
+
current += char;
|
|
143
|
+
}
|
|
144
|
+
if (current)
|
|
145
|
+
parts.push(current.trim());
|
|
146
|
+
return parts;
|
|
147
|
+
}
|
|
148
|
+
function buildTypeTag(name, options) {
|
|
149
|
+
const lt = name.indexOf('<');
|
|
150
|
+
const base = lt === -1 ? name : name.slice(0, lt);
|
|
151
|
+
if (base.split('::').length !== 3) {
|
|
152
|
+
throw new Error(`${name} is not a top-level Move type`);
|
|
153
|
+
}
|
|
154
|
+
let result = name;
|
|
155
|
+
if (options?.typeArguments) {
|
|
156
|
+
const baked = lt === -1 ? [] : splitTopLevelTypeArgs(name.slice(lt + 1, -1));
|
|
157
|
+
const supplied = options.typeArguments.map((arg) => {
|
|
158
|
+
if (typeof arg === 'string') {
|
|
159
|
+
return arg;
|
|
160
|
+
}
|
|
161
|
+
if (arg && typeof arg.serialize === 'function' && typeof arg.name === 'string') {
|
|
162
|
+
return arg.name;
|
|
163
|
+
}
|
|
164
|
+
throw new Error(`Invalid type argument ${stringify(arg)}`);
|
|
165
|
+
});
|
|
166
|
+
if (supplied.length !== baked.length) {
|
|
167
|
+
throw new Error(`Expected ${baked.length} type arguments for ${base}, got ${supplied.length}`);
|
|
168
|
+
}
|
|
169
|
+
result = supplied.length === 0 ? base : `${base}<${supplied.join(', ')}>`;
|
|
170
|
+
}
|
|
171
|
+
if (HAS_PHANTOM_REGEX.test(result)) {
|
|
172
|
+
throw new Error(options?.typeArguments
|
|
173
|
+
? `A type argument contains an unfilled phantom parameter in ${result}`
|
|
174
|
+
: `Missing type arguments for ${result}`);
|
|
175
|
+
}
|
|
176
|
+
if (options?.package) {
|
|
177
|
+
const [, ...rest] = result.split('::');
|
|
178
|
+
result = [options.package, ...rest].join('::');
|
|
179
|
+
}
|
|
180
|
+
// fully validate address-only tags (MVR names can't be parsed as type tags)
|
|
181
|
+
if (!HAS_PHANTOM_REGEX.test(result) && !/[@/]/.test(result)) {
|
|
182
|
+
TypeTagSerializer.parseFromStr(result);
|
|
183
|
+
}
|
|
184
|
+
return result;
|
|
185
|
+
}
|
|
186
|
+
async function resolveBuiltTypeTag(name, options) {
|
|
187
|
+
const { client, ...rest } = options;
|
|
188
|
+
const { type } = await client.core.mvr.resolveType({
|
|
189
|
+
type: buildTypeTag(name, rest),
|
|
190
|
+
});
|
|
191
|
+
return normalizeStructTag(type);
|
|
192
|
+
}
|
|
193
|
+
export class MoveStruct extends BcsStruct {
|
|
194
|
+
/**
|
|
195
|
+
* Build the type tag for this struct.
|
|
196
|
+
*
|
|
197
|
+
* `typeArguments` is the full positional list, in Move declaration order, and
|
|
198
|
+
* is required when the struct has unfilled phantom parameters. The result may
|
|
199
|
+
* contain MVR names: those are valid in transaction `typeArguments`, but for
|
|
200
|
+
* queries or comparisons against on-chain data use `resolveTypeTag` instead.
|
|
201
|
+
*/
|
|
202
|
+
typeTag(...args) {
|
|
203
|
+
return buildTypeTag(this.name, args[0]);
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Build the type tag for this struct, then resolve any MVR names through the
|
|
207
|
+
* client (using its configured overrides and the MVR API) and return the
|
|
208
|
+
* normalized, address-only form suitable for queries and comparisons against
|
|
209
|
+
* on-chain data.
|
|
210
|
+
*/
|
|
211
|
+
async resolveTypeTag(options) {
|
|
212
|
+
return resolveBuiltTypeTag(this.name, options);
|
|
213
|
+
}
|
|
214
|
+
async get({ objectId, ...options }) {
|
|
215
|
+
const [res] = await this.getMany({
|
|
216
|
+
...options,
|
|
217
|
+
objectIds: [objectId],
|
|
218
|
+
});
|
|
219
|
+
if (!res) {
|
|
220
|
+
throw new Error(`No object found for id ${objectId}`);
|
|
221
|
+
}
|
|
222
|
+
return res;
|
|
223
|
+
}
|
|
224
|
+
async getMany({ client, ...options }) {
|
|
225
|
+
const response = (await client.core.getObjects({
|
|
226
|
+
...options,
|
|
227
|
+
include: {
|
|
228
|
+
...options.include,
|
|
229
|
+
content: true,
|
|
230
|
+
},
|
|
231
|
+
}));
|
|
232
|
+
return response.objects.map((obj) => {
|
|
233
|
+
if (obj instanceof Error) {
|
|
234
|
+
throw obj;
|
|
235
|
+
}
|
|
236
|
+
return {
|
|
237
|
+
...obj,
|
|
238
|
+
json: this.parse(obj.content),
|
|
239
|
+
};
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
export class MoveEnum extends BcsEnum {
|
|
244
|
+
/** Build the type tag for this enum. See `MoveStruct.typeTag` for semantics. */
|
|
245
|
+
typeTag(...args) {
|
|
246
|
+
return buildTypeTag(this.name, args[0]);
|
|
247
|
+
}
|
|
248
|
+
/** Build and resolve the type tag for this enum. See `MoveStruct.resolveTypeTag`. */
|
|
249
|
+
async resolveTypeTag(options) {
|
|
250
|
+
return resolveBuiltTypeTag(this.name, options);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
export class MoveTuple extends BcsTuple {
|
|
254
|
+
/** Build the type tag for this struct. See `MoveStruct.typeTag` for semantics. */
|
|
255
|
+
typeTag(...args) {
|
|
256
|
+
return buildTypeTag(this.name, args[0]);
|
|
257
|
+
}
|
|
258
|
+
/** Build and resolve the type tag for this struct. See `MoveStruct.resolveTypeTag`. */
|
|
259
|
+
async resolveTypeTag(options) {
|
|
260
|
+
return resolveBuiltTypeTag(this.name, options);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
function stringify(val) {
|
|
264
|
+
if (typeof val === 'object') {
|
|
265
|
+
return JSON.stringify(val, (_key, value) => typeof value === 'bigint' ? value.toString() : value);
|
|
266
|
+
}
|
|
267
|
+
if (typeof val === 'bigint') {
|
|
268
|
+
return val.toString();
|
|
269
|
+
}
|
|
270
|
+
return val;
|
|
271
|
+
}
|
|
272
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/contracts/utils/index.ts"],"names":[],"mappings":"AACA,OAAO,EACN,GAAG,EAGH,iBAAiB,EACjB,SAAS,EACT,OAAO,EACP,QAAQ,GACR,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAGN,UAAU,GACV,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAA+C,MAAM,oBAAoB,CAAC;AAEjF,MAAM,mBAAmB,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;AACvD,MAAM,qBAAqB,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;AAUzD,M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QACxD,OAAO,mBAAmB,CAAC,IAAI,CAAC,IAAI,EAAE,OAAyD,CAAC,CAAC;IAClG,CAAC;CACD;AAED,MAAM,OAAO,SAGX,SAAQ,QAAiB;IAC1B,kFAAkF;IAClF,OAAO,CAAC,GAAG,IAAyB;QACnC,OAAO,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAA+B,CAAC,CAAC;IACvE,CAAC;IAED,uFAAuF;IACvF,KAAK,CAAC,cAAc,CAAC,OAAoC;QACxD,OAAO,mBAAmB,CAAC,IAAI,CAAC,IAAI,EAAE,OAAyD,CAAC,CAAC;IAClG,CAAC;CACD;AAED,SAAS,SAAS,CAAC,GAAY;IAC9B,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC7B,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAC1C,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,KAAK,CACpD,CAAC;IACH,CAAC;IACD,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC7B,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAC;IACvB,CAAC;IAED,OAAO,GAAG,CAAC;AACZ,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/**
|
|
5
|
+
* A bag is a heterogeneous map-like collection. The collection is similar to
|
|
6
|
+
* `sui::table` in that its keys and values are not stored within the `Bag` value,
|
|
7
|
+
* but instead are stored using Sui's object system. The `Bag` struct acts only as
|
|
8
|
+
* a handle into the object system to retrieve those keys and values. Note that
|
|
9
|
+
* this means that `Bag` values with exactly the same key-value mapping will not be
|
|
10
|
+
* equal, with `==`, at runtime. For example
|
|
11
|
+
*
|
|
12
|
+
* ```
|
|
13
|
+
* let bag1 = bag::new();
|
|
14
|
+
* let bag2 = bag::new();
|
|
15
|
+
* bag::add(&mut bag1, 0, false);
|
|
16
|
+
* bag::add(&mut bag1, 1, true);
|
|
17
|
+
* bag::add(&mut bag2, 0, false);
|
|
18
|
+
* bag::add(&mut bag2, 1, true);
|
|
19
|
+
* // bag1 does not equal bag2, despite having the same entries
|
|
20
|
+
* assert!(&bag1 != &bag2);
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* At it's core, `sui::bag` is a wrapper around `UID` that allows for access to
|
|
24
|
+
* `sui::dynamic_field` while preventing accidentally stranding field values. A
|
|
25
|
+
* `UID` can be deleted, even if it has dynamic fields associated with it, but a
|
|
26
|
+
* bag, on the other hand, must be empty to be destroyed.
|
|
27
|
+
*/
|
|
28
|
+
import { MoveStruct } from '../../../utils/index.ts';
|
|
29
|
+
export declare const Bag: MoveStruct<{
|
|
30
|
+
/** the ID of this bag */
|
|
31
|
+
id: import("@mysten/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
32
|
+
/** the number of key-value pairs in the bag */
|
|
33
|
+
size: import("@mysten/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
34
|
+
}, "0x2::bag::Bag">;
|
|
35
|
+
//# sourceMappingURL=bag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bag.d.ts","sourceRoot":"","sources":["../../../../../src/contracts/vault/deps/sui/bag.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAGhE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAIrD,eAAO,MAAM,GAAG;IACR,yBAAyB;;IAEzB,+CAA+C;;mBAE/C,CAAC"}
|