@misofm/platform 0.27.0 → 0.28.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 +309 -204
- package/dist/Miso.d.ts +403 -0
- package/dist/Miso.d.ts.map +1 -0
- package/dist/Miso.js +455 -0
- package/dist/Miso.js.map +1 -0
- package/dist/auth.d.ts +11 -1
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +16 -3
- package/dist/auth.js.map +1 -1
- package/dist/catalog.d.ts +8 -5
- package/dist/catalog.d.ts.map +1 -1
- package/dist/catalog.js +36 -19
- package/dist/catalog.js.map +1 -1
- package/dist/client.d.ts +52 -443
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +58 -775
- package/dist/client.js.map +1 -1
- package/dist/contracts/composition_credits/composition_credits.d.ts +38 -48
- package/dist/contracts/composition_credits/composition_credits.d.ts.map +1 -1
- package/dist/contracts/composition_credits/composition_credits.js +20 -4
- package/dist/contracts/composition_credits/composition_credits.js.map +1 -1
- package/dist/contracts/composition_routed_stake/composition_routed_stake.d.ts +64 -1
- package/dist/contracts/composition_routed_stake/composition_routed_stake.d.ts.map +1 -1
- package/dist/contracts/composition_routed_stake/composition_routed_stake.js +66 -1
- package/dist/contracts/composition_routed_stake/composition_routed_stake.js.map +1 -1
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.d.ts +52 -4
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.d.ts.map +1 -1
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.js +52 -4
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.js.map +1 -1
- package/dist/contracts/composition_royalty_pool_plugin/composition_royalty_pool_plugin.d.ts +63 -1
- package/dist/contracts/composition_royalty_pool_plugin/composition_royalty_pool_plugin.d.ts.map +1 -1
- package/dist/contracts/composition_royalty_pool_plugin/composition_royalty_pool_plugin.js +63 -1
- package/dist/contracts/composition_royalty_pool_plugin/composition_royalty_pool_plugin.js.map +1 -1
- package/dist/contracts/genre/genre.d.ts +10 -1
- package/dist/contracts/genre/genre.d.ts.map +1 -1
- package/dist/contracts/genre/genre.js +8 -1
- package/dist/contracts/genre/genre.js.map +1 -1
- package/dist/contracts/miso_pay/deps/std/type_name.d.ts.map +1 -0
- package/dist/contracts/miso_pay/deps/std/type_name.js.map +1 -0
- package/dist/contracts/miso_pay/pay.d.ts +209 -0
- package/dist/contracts/miso_pay/pay.d.ts.map +1 -0
- package/dist/contracts/miso_pay/pay.js +195 -0
- package/dist/contracts/miso_pay/pay.js.map +1 -0
- package/dist/contracts/party_cta/party_cta.d.ts +49 -3
- package/dist/contracts/party_cta/party_cta.d.ts.map +1 -1
- package/dist/contracts/party_cta/party_cta.js +27 -5
- package/dist/contracts/party_cta/party_cta.js.map +1 -1
- package/dist/contracts/party_genre/party_genre.d.ts +25 -0
- package/dist/contracts/party_genre/party_genre.d.ts.map +1 -1
- package/dist/contracts/party_genre/party_genre.js +14 -3
- package/dist/contracts/party_genre/party_genre.js.map +1 -1
- package/dist/contracts/party_media/party_media.d.ts +19 -3
- package/dist/contracts/party_media/party_media.d.ts.map +1 -1
- package/dist/contracts/party_media/party_media.js +20 -4
- package/dist/contracts/party_media/party_media.js.map +1 -1
- package/dist/contracts/party_platform_link/party_platform_link.d.ts +15 -7
- package/dist/contracts/party_platform_link/party_platform_link.d.ts.map +1 -1
- package/dist/contracts/party_platform_link/party_platform_link.js +15 -7
- package/dist/contracts/party_platform_link/party_platform_link.js.map +1 -1
- package/dist/contracts/party_profile/party_profile.d.ts +63 -8
- package/dist/contracts/party_profile/party_profile.d.ts.map +1 -1
- package/dist/contracts/party_profile/party_profile.js +33 -8
- package/dist/contracts/party_profile/party_profile.js.map +1 -1
- package/dist/contracts/party_roles/party_roles.d.ts +28 -3
- package/dist/contracts/party_roles/party_roles.d.ts.map +1 -1
- package/dist/contracts/party_roles/party_roles.js +19 -4
- package/dist/contracts/party_roles/party_roles.js.map +1 -1
- package/dist/contracts/party_tags/party_tags.d.ts +23 -3
- package/dist/contracts/party_tags/party_tags.d.ts.map +1 -1
- package/dist/contracts/party_tags/party_tags.js +16 -4
- package/dist/contracts/party_tags/party_tags.js.map +1 -1
- package/dist/contracts/party_wallet/party_wallet.d.ts +4 -1
- package/dist/contracts/party_wallet/party_wallet.d.ts.map +1 -1
- package/dist/contracts/party_wallet/party_wallet.js +2 -1
- package/dist/contracts/party_wallet/party_wallet.js.map +1 -1
- package/dist/contracts/platform_link/platform_link.d.ts +207 -0
- package/dist/contracts/platform_link/platform_link.d.ts.map +1 -0
- package/dist/contracts/platform_link/platform_link.js +209 -0
- package/dist/contracts/platform_link/platform_link.js.map +1 -0
- package/dist/contracts/record/pressing.d.ts +53 -7
- package/dist/contracts/record/pressing.d.ts.map +1 -1
- package/dist/contracts/record/pressing.js +50 -4
- package/dist/contracts/record/pressing.js.map +1 -1
- package/dist/contracts/record/record.d.ts +14 -0
- package/dist/contracts/record/record.d.ts.map +1 -1
- package/dist/contracts/record/record.js +15 -1
- package/dist/contracts/record/record.js.map +1 -1
- package/dist/contracts/record_shop/listing.d.ts +80 -35
- package/dist/contracts/record_shop/listing.d.ts.map +1 -1
- package/dist/contracts/record_shop/listing.js +76 -13
- package/dist/contracts/record_shop/listing.js.map +1 -1
- package/dist/contracts/recording_advisory/recording_advisory.d.ts +15 -15
- package/dist/contracts/recording_advisory/recording_advisory.d.ts.map +1 -1
- package/dist/contracts/recording_advisory/recording_advisory.js +15 -8
- package/dist/contracts/recording_advisory/recording_advisory.js.map +1 -1
- package/dist/contracts/recording_credits/recording_credits.d.ts +95 -1350
- package/dist/contracts/recording_credits/recording_credits.d.ts.map +1 -1
- package/dist/contracts/recording_credits/recording_credits.js +63 -12
- package/dist/contracts/recording_credits/recording_credits.js.map +1 -1
- package/dist/contracts/recording_engine_session/recording_engine_session.d.ts +30 -49
- package/dist/contracts/recording_engine_session/recording_engine_session.d.ts.map +1 -1
- package/dist/contracts/recording_engine_session/recording_engine_session.js +19 -4
- package/dist/contracts/recording_engine_session/recording_engine_session.js.map +1 -1
- package/dist/contracts/recording_genre/recording_genre.d.ts +67 -9
- package/dist/contracts/recording_genre/recording_genre.d.ts.map +1 -1
- package/dist/contracts/recording_genre/recording_genre.js +53 -9
- package/dist/contracts/recording_genre/recording_genre.js.map +1 -1
- package/dist/contracts/recording_language/recording_language.d.ts +29 -5
- package/dist/contracts/recording_language/recording_language.d.ts.map +1 -1
- package/dist/contracts/recording_language/recording_language.js +18 -5
- package/dist/contracts/recording_language/recording_language.js.map +1 -1
- package/dist/contracts/recording_master_reference/recording_master_reference.d.ts +25 -15
- package/dist/contracts/recording_master_reference/recording_master_reference.d.ts.map +1 -1
- package/dist/contracts/recording_master_reference/recording_master_reference.js +18 -5
- package/dist/contracts/recording_master_reference/recording_master_reference.js.map +1 -1
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.d.ts +55 -4
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.d.ts.map +1 -1
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.js +55 -4
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.js.map +1 -1
- package/dist/contracts/recording_royalty_pool_plugin/recording_royalty_pool_plugin.d.ts +66 -1
- package/dist/contracts/recording_royalty_pool_plugin/recording_royalty_pool_plugin.d.ts.map +1 -1
- package/dist/contracts/recording_royalty_pool_plugin/recording_royalty_pool_plugin.js +66 -1
- package/dist/contracts/recording_royalty_pool_plugin/recording_royalty_pool_plugin.js.map +1 -1
- package/dist/contracts/recording_streaming_transcode/recording_streaming_transcode.d.ts +12 -9
- package/dist/contracts/recording_streaming_transcode/recording_streaming_transcode.d.ts.map +1 -1
- package/dist/contracts/recording_streaming_transcode/recording_streaming_transcode.js +11 -4
- package/dist/contracts/recording_streaming_transcode/recording_streaming_transcode.js.map +1 -1
- package/dist/contracts/release_cover_art/release_cover_art.d.ts +168 -74
- package/dist/contracts/release_cover_art/release_cover_art.d.ts.map +1 -1
- package/dist/contracts/release_cover_art/release_cover_art.js +126 -10
- package/dist/contracts/release_cover_art/release_cover_art.js.map +1 -1
- package/dist/contracts/release_credits/release_credits.d.ts +24 -28
- package/dist/contracts/release_credits/release_credits.d.ts.map +1 -1
- package/dist/contracts/release_credits/release_credits.js +18 -4
- package/dist/contracts/release_credits/release_credits.js.map +1 -1
- package/dist/contracts/release_description/release_description.d.ts +16 -5
- package/dist/contracts/release_description/release_description.d.ts.map +1 -1
- package/dist/contracts/release_description/release_description.js +9 -4
- package/dist/contracts/release_description/release_description.js.map +1 -1
- package/dist/contracts/release_dsp_link/release_dsp_link.d.ts +130 -160
- package/dist/contracts/release_dsp_link/release_dsp_link.d.ts.map +1 -1
- package/dist/contracts/release_dsp_link/release_dsp_link.js +74 -19
- package/dist/contracts/release_dsp_link/release_dsp_link.js.map +1 -1
- package/dist/contracts/release_genre/release_genre.d.ts +66 -11
- package/dist/contracts/release_genre/release_genre.d.ts.map +1 -1
- package/dist/contracts/release_genre/release_genre.js +52 -11
- package/dist/contracts/release_genre/release_genre.js.map +1 -1
- package/dist/contracts/release_kind/release_kind.d.ts +28 -5
- package/dist/contracts/release_kind/release_kind.d.ts.map +1 -1
- package/dist/contracts/release_kind/release_kind.js +19 -4
- package/dist/contracts/release_kind/release_kind.js.map +1 -1
- package/dist/contracts/release_revenue_distributor/release_revenue_distributor.d.ts +17 -0
- package/dist/contracts/release_revenue_distributor/release_revenue_distributor.d.ts.map +1 -1
- package/dist/contracts/release_revenue_distributor/release_revenue_distributor.js +15 -0
- package/dist/contracts/release_revenue_distributor/release_revenue_distributor.js.map +1 -1
- package/dist/contracts/release_revenue_distributor_plugin/release_revenue_distributor_plugin.d.ts +37 -1
- package/dist/contracts/release_revenue_distributor_plugin/release_revenue_distributor_plugin.d.ts.map +1 -1
- package/dist/contracts/release_revenue_distributor_plugin/release_revenue_distributor_plugin.js +37 -1
- package/dist/contracts/release_revenue_distributor_plugin/release_revenue_distributor_plugin.js.map +1 -1
- package/dist/contracts/routed_stake/routed_stake.d.ts +78 -6
- package/dist/contracts/routed_stake/routed_stake.d.ts.map +1 -1
- package/dist/contracts/routed_stake/routed_stake.js +79 -7
- package/dist/contracts/routed_stake/routed_stake.js.map +1 -1
- package/dist/contracts/royalty_pool/pool.d.ts +117 -27
- package/dist/contracts/royalty_pool/pool.d.ts.map +1 -1
- package/dist/contracts/royalty_pool/pool.js +117 -28
- package/dist/contracts/royalty_pool/pool.js.map +1 -1
- package/dist/contracts/royalty_pool/stake.d.ts +3 -0
- package/dist/contracts/royalty_pool/stake.d.ts.map +1 -1
- package/dist/contracts/royalty_pool/stake.js +5 -2
- package/dist/contracts/royalty_pool/stake.js.map +1 -1
- package/dist/contracts/share/share.d.ts +80 -0
- package/dist/contracts/share/share.d.ts.map +1 -0
- package/dist/contracts/share/share.js +72 -0
- package/dist/contracts/share/share.js.map +1 -0
- package/dist/contracts/vault/vault.d.ts +51 -0
- package/dist/contracts/vault/vault.d.ts.map +1 -1
- package/dist/contracts/vault/vault.js +55 -4
- package/dist/contracts/vault/vault.js.map +1 -1
- package/dist/contracts.d.ts +60 -0
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js +17 -0
- package/dist/contracts.js.map +1 -1
- package/dist/cover.d.ts +5 -6
- package/dist/cover.d.ts.map +1 -1
- package/dist/cover.js +10 -10
- package/dist/cover.js.map +1 -1
- package/dist/credits.d.ts +12 -13
- package/dist/credits.d.ts.map +1 -1
- package/dist/credits.js +16 -10
- package/dist/credits.js.map +1 -1
- package/dist/deployments.d.ts +3 -3
- package/dist/deployments.d.ts.map +1 -1
- package/dist/deployments.js +2 -3
- package/dist/deployments.js.map +1 -1
- package/dist/errors.d.ts +24 -9
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +43 -16
- package/dist/errors.js.map +1 -1
- package/dist/events.d.ts +1687 -835
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js +258 -39
- package/dist/events.js.map +1 -1
- package/dist/genre.d.ts +11 -12
- package/dist/genre.d.ts.map +1 -1
- package/dist/genre.js +5 -3
- package/dist/genre.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/packages.d.ts +1047 -1695
- package/dist/packages.d.ts.map +1 -1
- package/dist/party/client.d.ts +113 -296
- package/dist/party/client.d.ts.map +1 -1
- package/dist/party/client.js +93 -178
- package/dist/party/client.js.map +1 -1
- package/dist/party/extensions/ctas.d.ts +3 -3
- package/dist/party/extensions/ctas.d.ts.map +1 -1
- package/dist/party/extensions/genres.d.ts +4 -4
- package/dist/party/extensions/genres.d.ts.map +1 -1
- package/dist/party/extensions/links.d.ts +5 -5
- package/dist/party/extensions/links.d.ts.map +1 -1
- package/dist/party/extensions/links.js.map +1 -1
- package/dist/party/extensions/media.d.ts +3 -3
- package/dist/party/extensions/media.d.ts.map +1 -1
- package/dist/party/extensions/profile.d.ts +3 -3
- package/dist/party/extensions/profile.d.ts.map +1 -1
- package/dist/party/extensions/roles.d.ts +4 -4
- package/dist/party/extensions/roles.d.ts.map +1 -1
- package/dist/party/extensions/roles.js.map +1 -1
- package/dist/party/extensions/tags.d.ts +4 -4
- package/dist/party/extensions/tags.d.ts.map +1 -1
- package/dist/party/index.d.ts +1 -1
- package/dist/party/index.d.ts.map +1 -1
- package/dist/party/index.js.map +1 -1
- package/dist/party/queries.d.ts +8 -8
- package/dist/party/queries.d.ts.map +1 -1
- package/dist/party/queries.js +83 -56
- package/dist/party/queries.js.map +1 -1
- package/dist/pressing.d.ts +13 -15
- package/dist/pressing.d.ts.map +1 -1
- package/dist/pressing.js +99 -29
- package/dist/pressing.js.map +1 -1
- package/dist/publication.d.ts +13 -6
- package/dist/publication.d.ts.map +1 -1
- package/dist/publication.js +26 -21
- package/dist/publication.js.map +1 -1
- package/dist/queries.js +3 -3
- package/dist/queries.js.map +1 -1
- package/dist/read/artist.d.ts +4 -3
- package/dist/read/artist.d.ts.map +1 -1
- package/dist/read/artist.js +24 -8
- package/dist/read/artist.js.map +1 -1
- package/dist/read/catalog.d.ts +17 -16
- package/dist/read/catalog.d.ts.map +1 -1
- package/dist/read/catalog.js +25 -11
- package/dist/read/catalog.js.map +1 -1
- package/dist/read/client.d.ts +41 -20
- package/dist/read/client.d.ts.map +1 -1
- package/dist/read/client.js +20 -12
- package/dist/read/client.js.map +1 -1
- package/dist/read/config.d.ts +25 -3
- package/dist/read/config.d.ts.map +1 -1
- package/dist/read/config.js +42 -25
- package/dist/read/config.js.map +1 -1
- package/dist/read/genres.d.ts +8 -3
- package/dist/read/genres.d.ts.map +1 -1
- package/dist/read/genres.js +23 -17
- package/dist/read/genres.js.map +1 -1
- package/dist/read/index.d.ts +1 -1
- package/dist/read/index.d.ts.map +1 -1
- package/dist/read/index.js +8 -6
- package/dist/read/index.js.map +1 -1
- package/dist/read/receipts.d.ts +5 -4
- package/dist/read/receipts.d.ts.map +1 -1
- package/dist/read/receipts.js +94 -46
- package/dist/read/receipts.js.map +1 -1
- package/dist/read/royalties.d.ts +6 -5
- package/dist/read/royalties.d.ts.map +1 -1
- package/dist/read/royalties.js +16 -9
- package/dist/read/royalties.js.map +1 -1
- package/dist/read/wallet.d.ts +23 -12
- package/dist/read/wallet.d.ts.map +1 -1
- package/dist/read/wallet.js +158 -177
- package/dist/read/wallet.js.map +1 -1
- package/dist/read/works.d.ts +6 -6
- package/dist/read/works.d.ts.map +1 -1
- package/dist/read/works.js +40 -26
- package/dist/read/works.js.map +1 -1
- package/dist/recording-extensions.d.ts +15 -16
- package/dist/recording-extensions.d.ts.map +1 -1
- package/dist/recording-extensions.js +12 -8
- package/dist/recording-extensions.js.map +1 -1
- package/dist/release-extensions.d.ts +5 -6
- package/dist/release-extensions.d.ts.map +1 -1
- package/dist/release-extensions.js +3 -2
- package/dist/release-extensions.js.map +1 -1
- package/dist/release-graph.d.ts +2 -2
- package/dist/release-graph.d.ts.map +1 -1
- package/dist/release-graph.js.map +1 -1
- package/dist/royalty.d.ts +4 -4
- package/dist/royalty.d.ts.map +1 -1
- package/dist/royalty.js +16 -7
- package/dist/royalty.js.map +1 -1
- package/dist/share.d.ts +58 -24
- package/dist/share.d.ts.map +1 -1
- package/dist/share.js +167 -92
- package/dist/share.js.map +1 -1
- package/dist/transactions.d.ts +15 -6
- package/dist/transactions.d.ts.map +1 -1
- package/dist/transactions.js +1 -0
- package/dist/transactions.js.map +1 -1
- package/dist/vault.d.ts +13 -3
- package/dist/vault.d.ts.map +1 -1
- package/dist/vault.js +22 -16
- package/dist/vault.js.map +1 -1
- package/package.json +9 -8
- package/src/Miso.ts +951 -0
- package/src/auth.ts +16 -3
- package/src/catalog.ts +58 -25
- package/src/client.ts +98 -1359
- package/src/contracts/composition_credits/composition_credits.ts +20 -4
- package/src/contracts/composition_routed_stake/composition_routed_stake.ts +67 -1
- package/src/contracts/composition_royalty_pool/composition_royalty_pool.ts +53 -4
- package/src/contracts/composition_royalty_pool_plugin/composition_royalty_pool_plugin.ts +64 -1
- package/src/contracts/genre/genre.ts +8 -1
- package/src/contracts/miso_pay/pay.ts +356 -0
- package/src/contracts/party_cta/party_cta.ts +27 -5
- package/src/contracts/party_genre/party_genre.ts +14 -3
- package/src/contracts/party_media/party_media.ts +20 -4
- package/src/contracts/party_platform_link/party_platform_link.ts +15 -7
- package/src/contracts/party_profile/party_profile.ts +33 -8
- package/src/contracts/party_roles/party_roles.ts +19 -4
- package/src/contracts/party_tags/party_tags.ts +16 -4
- package/src/contracts/party_wallet/party_wallet.ts +2 -1
- package/src/contracts/platform_link/platform_link.ts +322 -0
- package/src/contracts/record/pressing.ts +50 -4
- package/src/contracts/record/record.ts +15 -1
- package/src/contracts/record_shop/listing.ts +76 -13
- package/src/contracts/recording_advisory/recording_advisory.ts +15 -8
- package/src/contracts/recording_credits/recording_credits.ts +63 -12
- package/src/contracts/recording_engine_session/recording_engine_session.ts +19 -4
- package/src/contracts/recording_genre/recording_genre.ts +53 -9
- package/src/contracts/recording_language/recording_language.ts +18 -5
- package/src/contracts/recording_master_reference/recording_master_reference.ts +18 -5
- package/src/contracts/recording_royalty_pool/recording_royalty_pool.ts +56 -4
- package/src/contracts/recording_royalty_pool_plugin/recording_royalty_pool_plugin.ts +67 -1
- package/src/contracts/recording_streaming_transcode/recording_streaming_transcode.ts +11 -4
- package/src/contracts/release_cover_art/release_cover_art.ts +126 -10
- package/src/contracts/release_credits/release_credits.ts +18 -4
- package/src/contracts/release_description/release_description.ts +9 -4
- package/src/contracts/release_dsp_link/release_dsp_link.ts +74 -19
- package/src/contracts/release_genre/release_genre.ts +52 -11
- package/src/contracts/release_kind/release_kind.ts +19 -4
- package/src/contracts/release_revenue_distributor/release_revenue_distributor.ts +15 -0
- package/src/contracts/release_revenue_distributor_plugin/release_revenue_distributor_plugin.ts +38 -1
- package/src/contracts/routed_stake/routed_stake.ts +79 -7
- package/src/contracts/royalty_pool/pool.ts +140 -38
- package/src/contracts/royalty_pool/stake.ts +5 -2
- package/src/contracts/share/share.ts +97 -0
- package/src/contracts/vault/vault.ts +55 -4
- package/src/contracts.ts +18 -0
- package/src/cover.ts +14 -15
- package/src/credits.ts +27 -22
- package/src/deployments.ts +3 -4
- package/src/errors.ts +64 -34
- package/src/events.ts +260 -39
- package/src/genre.ts +15 -14
- package/src/index.ts +19 -10
- package/src/party/client.ts +217 -208
- package/src/party/extensions/ctas.ts +3 -3
- package/src/party/extensions/genres.ts +4 -4
- package/src/party/extensions/links.ts +7 -7
- package/src/party/extensions/media.ts +3 -3
- package/src/party/extensions/profile.ts +3 -3
- package/src/party/extensions/roles.ts +5 -5
- package/src/party/extensions/tags.ts +4 -4
- package/src/party/index.ts +0 -1
- package/src/party/queries.ts +90 -87
- package/src/pressing.ts +132 -89
- package/src/publication.ts +33 -32
- package/src/queries.ts +3 -3
- package/src/read/artist.ts +36 -17
- package/src/read/catalog.ts +68 -36
- package/src/read/client.ts +55 -30
- package/src/read/config.ts +55 -30
- package/src/read/genres.ts +22 -18
- package/src/read/index.ts +8 -6
- package/src/read/receipts.ts +130 -67
- package/src/read/royalties.ts +22 -10
- package/src/read/wallet.ts +226 -216
- package/src/read/works.ts +51 -44
- package/src/recording-extensions.ts +27 -24
- package/src/release-extensions.ts +7 -7
- package/src/release-graph.ts +2 -1
- package/src/royalty.ts +19 -25
- package/src/share.ts +197 -128
- package/src/transactions.ts +15 -8
- package/src/vault.ts +24 -31
- package/dist/contracts/record_shop/deps/std/type_name.d.ts.map +0 -1
- package/dist/contracts/record_shop/deps/std/type_name.js.map +0 -1
- package/dist/contracts/recording_language/deps/language_code/language_code.d.ts +0 -6
- package/dist/contracts/recording_language/deps/language_code/language_code.d.ts.map +0 -1
- package/dist/contracts/recording_language/deps/language_code/language_code.js +0 -8
- package/dist/contracts/recording_language/deps/language_code/language_code.js.map +0 -1
- package/dist/contracts/recording_master_reference/deps/ori/confidentiality.d.ts +0 -24
- package/dist/contracts/recording_master_reference/deps/ori/confidentiality.d.ts.map +0 -1
- package/dist/contracts/recording_master_reference/deps/ori/confidentiality.js +0 -24
- package/dist/contracts/recording_master_reference/deps/ori/confidentiality.js.map +0 -1
- package/dist/contracts/recording_master_reference/deps/ori/data.d.ts +0 -16
- package/dist/contracts/recording_master_reference/deps/ori/data.d.ts.map +0 -1
- package/dist/contracts/recording_master_reference/deps/ori/data.js +0 -12
- package/dist/contracts/recording_master_reference/deps/ori/data.js.map +0 -1
- package/dist/execute.d.ts +0 -32
- package/dist/execute.d.ts.map +0 -1
- package/dist/execute.js +0 -36
- package/dist/execute.js.map +0 -1
- package/src/contracts/recording_language/deps/language_code/language_code.ts +0 -8
- package/src/contracts/recording_master_reference/deps/ori/confidentiality.ts +0 -24
- package/src/contracts/recording_master_reference/deps/ori/data.ts +0 -12
- package/src/execute.ts +0 -56
- /package/dist/contracts/{record_shop → miso_pay}/deps/std/type_name.d.ts +0 -0
- /package/dist/contracts/{record_shop → miso_pay}/deps/std/type_name.js +0 -0
- /package/src/contracts/{record_shop → miso_pay}/deps/std/type_name.ts +0 -0
package/src/share.ts
CHANGED
|
@@ -13,42 +13,41 @@
|
|
|
13
13
|
// The bytecode is identical for every currency (only the baked-in INITIALIZER
|
|
14
14
|
// matters, and it is the same signer for all), so publishes are fungible: a whole
|
|
15
15
|
// batch can be published — up to 5 `tx.publish` per PTB (the protocol's
|
|
16
|
-
// `max_publish_or_upgrade_per_ptb` cap) —
|
|
17
|
-
// `
|
|
18
|
-
//
|
|
19
|
-
//
|
|
20
|
-
//
|
|
21
|
-
//
|
|
16
|
+
// `max_publish_or_upgrade_per_ptb` cap) — in one `Tx.run`. Every Publish result is
|
|
17
|
+
// consumed immediately by `package::make_immutable` in that same PTB, so no
|
|
18
|
+
// share-package UpgradeCap is ever left with the publisher. Initialization is
|
|
19
|
+
// likewise batched. The caller assigns packages to work slots and supplies
|
|
20
|
+
// per-package metadata, so each currency still gets a descriptive, work-specific
|
|
21
|
+
// name.
|
|
22
|
+
//
|
|
23
|
+
// Every write here goes through `Tx.run`: the three submit-on-behalf members
|
|
24
|
+
// (`createShareCurrency`, `publishShareCurrencies`, `initializeShareCurrencies`,
|
|
25
|
+
// misofm/sdks#35 WP4) take the signer as a parameter, plus an optional `gasOwner`
|
|
26
|
+
// and `sponsor` when the gas owner differs from the sender. `Tx.run` holds one
|
|
27
|
+
// sender lock per address, so what used to run concurrently through a
|
|
28
|
+
// `ParallelTransactionExecutor` now serializes per batch under that lock — an
|
|
29
|
+
// accepted behaviour change for 0.28 (parallel submission needs distinct gas
|
|
30
|
+
// owners, `docs/extensions.md` §5).
|
|
22
31
|
|
|
23
|
-
import type { ParallelTransactionExecutor } from "@mysten/sui/transactions";
|
|
24
|
-
import type { Signer } from "@mysten/sui/cryptography";
|
|
25
32
|
import { fromBase64, fromHex, toBase64 } from "@mysten/sui/utils";
|
|
26
33
|
import { update_constants } from "@mysten/move-bytecode-template";
|
|
27
34
|
import { Effect } from "effect";
|
|
28
|
-
import {
|
|
29
|
-
|
|
30
|
-
publishedPackageId,
|
|
31
|
-
allPublishedPackageIds,
|
|
32
|
-
createdByType,
|
|
33
|
-
allCreatedByType,
|
|
34
|
-
type ExecResult,
|
|
35
|
-
} from "@misofm/musicos";
|
|
36
|
-
import { SuiClient, SuiRpcError, type TransactionFailedError } from "@misofm/effect";
|
|
35
|
+
import { ObjectId, UnexpectedEffects, type Executed, type Sui, type SuiAddress } from "@unconfirmed/sui-effect";
|
|
36
|
+
import { Tx, type RunError, type Signer } from "@unconfirmed/sui-effect/tx";
|
|
37
37
|
|
|
38
38
|
import { publishShareCurrency, initializeShareCurrency, type PackageBytecode } from "./transactions.ts";
|
|
39
39
|
import { SHARE_TEMPLATE } from "./share-template.ts";
|
|
40
|
-
import { executeViaExecutor } from "./execute.ts";
|
|
41
40
|
|
|
42
41
|
/** The protocol cap on Publish/Upgrade commands per programmable transaction. */
|
|
43
42
|
const PUBLISHES_PER_PTB = 5;
|
|
44
43
|
/** Initializes batched per PTB (each is one moveCall + transfer; all share the 0xc registry). */
|
|
45
44
|
const INITS_PER_PTB = 10;
|
|
46
45
|
|
|
47
|
-
//
|
|
48
|
-
//
|
|
49
|
-
//
|
|
50
|
-
const CURRENCY_TYPE = "::coin_registry::Currency
|
|
51
|
-
const TREASURY_CAP_TYPE = "::coin::TreasuryCap
|
|
46
|
+
// A bare (no type-argument) expected tag: per sui-effect's generic-Move-type
|
|
47
|
+
// rule, this matches every instantiation (`Currency<pkg::share::Share>` for
|
|
48
|
+
// any `pkg`), comparing only `address::module::name`.
|
|
49
|
+
const CURRENCY_TYPE = "0x2::coin_registry::Currency";
|
|
50
|
+
const TREASURY_CAP_TYPE = "0x2::coin::TreasuryCap";
|
|
52
51
|
|
|
53
52
|
export interface ShareCurrency {
|
|
54
53
|
/** The published share package id. */
|
|
@@ -59,8 +58,8 @@ export interface ShareCurrency {
|
|
|
59
58
|
shareType: string;
|
|
60
59
|
/** The `TreasuryCap<Share>` object id (held by the treasury-cap recipient). */
|
|
61
60
|
treasuryCapId: string;
|
|
62
|
-
/** Net gas (MIST)
|
|
63
|
-
gasUsed:
|
|
61
|
+
/** Net gas (MIST), summed over every `Tx.run` this currency's provisioning made. Can be negative. */
|
|
62
|
+
gasUsed: bigint;
|
|
64
63
|
}
|
|
65
64
|
|
|
66
65
|
export interface ShareCurrencyMeta {
|
|
@@ -69,6 +68,14 @@ export interface ShareCurrencyMeta {
|
|
|
69
68
|
iconUrl?: string;
|
|
70
69
|
}
|
|
71
70
|
|
|
71
|
+
/** A signer to run a submit-on-behalf member as, plus a sponsor when the gas owner differs. */
|
|
72
|
+
export interface RunOpts {
|
|
73
|
+
readonly signer: Signer;
|
|
74
|
+
readonly gasOwner?: SuiAddress;
|
|
75
|
+
/** The gas owner's signer. Required whenever `gasOwner` names an address that is not `signer`'s. */
|
|
76
|
+
readonly sponsor?: Signer;
|
|
77
|
+
}
|
|
78
|
+
|
|
72
79
|
// ── Bytecode patching ────────────────────────────────────────────────────────
|
|
73
80
|
|
|
74
81
|
/**
|
|
@@ -107,23 +114,46 @@ export interface CreateShareCurrencyParams {
|
|
|
107
114
|
treasuryCapRecipient?: string;
|
|
108
115
|
}
|
|
109
116
|
|
|
110
|
-
/**
|
|
117
|
+
/**
|
|
118
|
+
* Publishes an immutable package, then initializes a fresh share currency in a
|
|
119
|
+
* second tx — two `Tx.run`s, because a `moveCall` target needs the package's
|
|
120
|
+
* id and a package published in the same PTB has none until it executes.
|
|
121
|
+
*
|
|
122
|
+
* Fails with: everything `Tx.run` does (`RunError`: `BuildError`,
|
|
123
|
+
* `SimulationFailed`, `PolicyDenied`, `SigningError`, `ExecutionFailed`,
|
|
124
|
+
* `NotApplied`, `SubmissionUnknown`, `JournalError`, `TransportError`), and
|
|
125
|
+
* `UnexpectedEffects` when a run applied but did not create the object this
|
|
126
|
+
* step expected (a Move-side change already on chain — not a "retry" outcome).
|
|
127
|
+
*/
|
|
111
128
|
export const createShareCurrency = Effect.fn("createShareCurrency")(function* (
|
|
112
|
-
signer: Signer,
|
|
113
129
|
params: CreateShareCurrencyParams,
|
|
114
|
-
|
|
115
|
-
|
|
130
|
+
opts: RunOpts,
|
|
131
|
+
): Effect.fn.Return<ShareCurrency, RunError | UnexpectedEffects, Sui> {
|
|
132
|
+
const signerAddress = opts.signer.address;
|
|
116
133
|
const initializer = params.initializerAddress ?? signerAddress;
|
|
117
134
|
const recipient = params.treasuryCapRecipient ?? signerAddress;
|
|
118
135
|
|
|
119
136
|
// Tx 1: publish the share package with the initializer baked in.
|
|
120
137
|
const patched = patchInitializer(params.template ?? SHARE_TEMPLATE, initializer);
|
|
121
|
-
const
|
|
122
|
-
const
|
|
138
|
+
const published = yield* Tx.run(publishShareCurrency(patched), opts);
|
|
139
|
+
const packagesPublished = published.packagesPublished();
|
|
140
|
+
const packageId = String(packagesPublished[0]?.id ?? "");
|
|
141
|
+
if (packageId === "") {
|
|
142
|
+
// The publish `Tx.run` already applied (gas was charged) but the effects
|
|
143
|
+
// carried no published package — `UnexpectedEffects` (outcome "applied"),
|
|
144
|
+
// not a defect, per B9 (misofm/sdks#35 verification): a caller must be
|
|
145
|
+
// able to `catchTag` this the same way `expectCreated` lets it below.
|
|
146
|
+
return yield* Effect.fail(
|
|
147
|
+
new UnexpectedEffects({
|
|
148
|
+
digest: published.digest,
|
|
149
|
+
expected: "a published share package",
|
|
150
|
+
found: packagesPublished.map((ref) => ref.id),
|
|
151
|
+
}),
|
|
152
|
+
);
|
|
153
|
+
}
|
|
123
154
|
|
|
124
155
|
// Tx 2: initialize → creates the Currency object + transfers the TreasuryCap.
|
|
125
|
-
const
|
|
126
|
-
signer,
|
|
156
|
+
const initialized = yield* Tx.run(
|
|
127
157
|
initializeShareCurrency({
|
|
128
158
|
shareCurrencyPackageId: packageId,
|
|
129
159
|
name: params.name,
|
|
@@ -131,42 +161,51 @@ export const createShareCurrency = Effect.fn("createShareCurrency")(function* (
|
|
|
131
161
|
iconUrl: params.iconUrl ?? "",
|
|
132
162
|
treasuryCapRecipient: recipient,
|
|
133
163
|
}),
|
|
164
|
+
opts,
|
|
134
165
|
);
|
|
166
|
+
const currency = yield* initialized.expectCreated(CURRENCY_TYPE);
|
|
167
|
+
const treasuryCap = yield* initialized.expectCreated(TREASURY_CAP_TYPE);
|
|
135
168
|
|
|
136
169
|
return {
|
|
137
170
|
packageId,
|
|
138
|
-
currencyId:
|
|
171
|
+
currencyId: String(currency.id),
|
|
139
172
|
shareType: `${packageId}::share::Share`,
|
|
140
|
-
treasuryCapId:
|
|
141
|
-
gasUsed:
|
|
173
|
+
treasuryCapId: String(treasuryCap.id),
|
|
174
|
+
gasUsed: published.gasUsedTotal + initialized.gasUsedTotal,
|
|
142
175
|
};
|
|
143
176
|
});
|
|
144
177
|
|
|
145
|
-
// ── Batched
|
|
178
|
+
// ── Batched ────────────────────────────────────────────────────────────────
|
|
146
179
|
|
|
147
180
|
/** Splits an array into fixed-size chunks. */
|
|
148
|
-
function chunk<T>(items: T[], size: number): T[][] {
|
|
181
|
+
function chunk<T>(items: readonly T[], size: number): T[][] {
|
|
149
182
|
const out: T[][] = [];
|
|
150
183
|
for (let i = 0; i < items.length; i += size) out.push(items.slice(i, i + size));
|
|
151
184
|
return out;
|
|
152
185
|
}
|
|
153
186
|
|
|
154
187
|
/**
|
|
155
|
-
* Publishes `count` fresh, permanently immutable share-currency packages,
|
|
156
|
-
* at ≤5 publishes per
|
|
157
|
-
*
|
|
158
|
-
*
|
|
188
|
+
* Publishes `count` fresh, permanently immutable share-currency packages,
|
|
189
|
+
* batched at ≤5 publishes per `Tx.run`. Each publish consumes its UpgradeCap
|
|
190
|
+
* in the same PTB. Returns the published package ids (fungible — order is not
|
|
191
|
+
* meaningful; the caller assigns them to work slots).
|
|
192
|
+
*
|
|
193
|
+
* Batches run as concurrent `Effect`s, but `Tx.run` holds one sender lock per
|
|
194
|
+
* address, so they serialize at the submission boundary — the accepted
|
|
195
|
+
* `ParallelTransactionExecutor` behaviour change for 0.28 (`docs/extensions.md`
|
|
196
|
+
* §5; parallel submission needs distinct gas owners).
|
|
197
|
+
*
|
|
198
|
+
* Fails with: `RunError`.
|
|
159
199
|
*/
|
|
160
200
|
export const publishShareCurrencies = Effect.fn("publishShareCurrencies")(function* (
|
|
161
|
-
executor: ParallelTransactionExecutor,
|
|
162
|
-
initializerAddress: string,
|
|
163
201
|
count: number,
|
|
164
|
-
|
|
165
|
-
): Effect.fn.Return<{ packageIds: string[]; gasUsed:
|
|
166
|
-
if (count <= 0) return { packageIds: [], gasUsed:
|
|
202
|
+
opts: RunOpts & { readonly initializerAddress?: string; readonly template?: PackageBytecode },
|
|
203
|
+
): Effect.fn.Return<{ packageIds: string[]; gasUsed: bigint }, RunError | UnexpectedEffects, Sui> {
|
|
204
|
+
if (count <= 0) return { packageIds: [], gasUsed: 0n };
|
|
167
205
|
|
|
168
206
|
// One patched template, reused for every publish (identical bytecode → distinct packages).
|
|
169
|
-
const
|
|
207
|
+
const initializer = opts.initializerAddress ?? opts.signer.address;
|
|
208
|
+
const patched = patchInitializer(opts.template ?? SHARE_TEMPLATE, initializer);
|
|
170
209
|
|
|
171
210
|
const batchSizes: number[] = [];
|
|
172
211
|
for (let remaining = count; remaining > 0; remaining -= PUBLISHES_PER_PTB) {
|
|
@@ -175,102 +214,132 @@ export const publishShareCurrencies = Effect.fn("publishShareCurrencies")(functi
|
|
|
175
214
|
|
|
176
215
|
const results = yield* Effect.forEach(
|
|
177
216
|
batchSizes,
|
|
178
|
-
(n) =>
|
|
217
|
+
(n) =>
|
|
218
|
+
Tx.run(
|
|
219
|
+
(tx) => {
|
|
220
|
+
for (let i = 0; i < n; i++) publishShareCurrency(patched)(tx);
|
|
221
|
+
},
|
|
222
|
+
{ signer: opts.signer, gasOwner: opts.gasOwner, sponsor: opts.sponsor },
|
|
223
|
+
),
|
|
179
224
|
{ concurrency: "unbounded" },
|
|
180
225
|
);
|
|
181
226
|
|
|
182
|
-
const packageIds = results.flatMap(
|
|
183
|
-
const gasUsed = results.reduce((sum, r) => sum + r.
|
|
227
|
+
const packageIds = results.flatMap((executed) => executed.packagesPublished().map((ref) => String(ref.id)));
|
|
228
|
+
const gasUsed = results.reduce((sum, r) => sum + r.gasUsedTotal, 0n);
|
|
184
229
|
if (packageIds.length !== count) {
|
|
185
|
-
|
|
230
|
+
// Every batch here already applied (each is its own `Tx.run`, gas
|
|
231
|
+
// charged) but the total published count disagrees with what was asked
|
|
232
|
+
// for — `UnexpectedEffects` (outcome "applied"), not a defect, per B9
|
|
233
|
+
// (misofm/sdks#35 verification). The last batch's digest is the most
|
|
234
|
+
// recent applied transaction; `found` lists every package actually seen.
|
|
235
|
+
const lastResult = results[results.length - 1]!;
|
|
236
|
+
return yield* Effect.fail(
|
|
237
|
+
new UnexpectedEffects({
|
|
238
|
+
digest: lastResult.digest,
|
|
239
|
+
expected: `${count} published share packages`,
|
|
240
|
+
found: packageIds.map((id) => ObjectId.make(id)),
|
|
241
|
+
}),
|
|
242
|
+
);
|
|
186
243
|
}
|
|
187
244
|
return { packageIds, gasUsed };
|
|
188
245
|
});
|
|
189
246
|
|
|
190
|
-
/**
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
247
|
+
/**
|
|
248
|
+
* Re-associates one init PTB's created objects back to their packages by
|
|
249
|
+
* share type. `expectCreated` (an already-applied `Executed`'s own typed
|
|
250
|
+
* accessor) is what turns "the initialize applied but this package's
|
|
251
|
+
* Currency/TreasuryCap is missing" into `UnexpectedEffects` (outcome
|
|
252
|
+
* `"applied"`) instead of a bare throw a caller could not `catchTag` (B9,
|
|
253
|
+
* misofm/sdks#35 verification).
|
|
254
|
+
*/
|
|
255
|
+
function currenciesFromResult(executed: Executed, batchPkgs: readonly string[]): Effect.Effect<ShareCurrency[], UnexpectedEffects> {
|
|
256
|
+
return Effect.forEach(batchPkgs, (pkg) =>
|
|
257
|
+
Effect.gen(function* () {
|
|
258
|
+
const shareType = `${pkg}::share::Share`;
|
|
259
|
+
const currency = yield* executed.expectCreated(`${CURRENCY_TYPE}<${shareType}>`);
|
|
260
|
+
const treasury = yield* executed.expectCreated(`${TREASURY_CAP_TYPE}<${shareType}>`);
|
|
261
|
+
return { packageId: pkg, currencyId: String(currency.id), shareType, treasuryCapId: String(treasury.id), gasUsed: 0n };
|
|
262
|
+
}),
|
|
263
|
+
);
|
|
202
264
|
}
|
|
203
265
|
|
|
204
266
|
/**
|
|
205
267
|
* Initializes each published package into a `Currency<Share>` + `TreasuryCap`,
|
|
206
|
-
* batched
|
|
207
|
-
* so a currency destined for a specific work is named for it.
|
|
268
|
+
* batched (≤10 per `Tx.run`). `metaOf` supplies each package's display
|
|
269
|
+
* metadata, so a currency destined for a specific work is named for it.
|
|
208
270
|
*
|
|
209
|
-
* `share::initialize` is NON-idempotent (`coin_registry` registers one
|
|
210
|
-
* per type), so a batch must never be re-run.
|
|
211
|
-
*
|
|
212
|
-
*
|
|
213
|
-
*
|
|
271
|
+
* `share::initialize` is NON-idempotent (`coin_registry` registers one
|
|
272
|
+
* `Currency` per type), so a batch must never be re-run. `onBatch` fires for
|
|
273
|
+
* each succeeded batch as it lands, letting the caller persist it
|
|
274
|
+
* immediately, before the whole call settles. If any batch fails, the ones
|
|
275
|
+
* that already succeeded have already been reported through `onBatch`; this
|
|
276
|
+
* then fails with that batch's own typed error (the first one encountered),
|
|
277
|
+
* so a resume re-initializes only the still-missing packages.
|
|
278
|
+
*
|
|
279
|
+
* Fails with: `RunError`; `UnexpectedEffects` when a batch applied but a
|
|
280
|
+
* package's `Currency`/`TreasuryCap` is missing from its effects, or from a
|
|
281
|
+
* rejecting `onBatch` effect; or whatever `onBatch` itself declares (typed `E`).
|
|
214
282
|
*/
|
|
215
|
-
export
|
|
216
|
-
|
|
217
|
-
signerAddress: string,
|
|
218
|
-
packageIds: string[],
|
|
283
|
+
export function initializeShareCurrencies<E = never>(
|
|
284
|
+
packageIds: readonly string[],
|
|
219
285
|
metaOf: (packageId: string) => ShareCurrencyMeta,
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
286
|
+
opts: RunOpts & {
|
|
287
|
+
readonly onBatch?: (currencies: ShareCurrency[], gasUsed: bigint) => Effect.Effect<void, E>;
|
|
288
|
+
},
|
|
289
|
+
): Effect.Effect<{ currencies: ShareCurrency[]; gasUsed: bigint }, RunError | UnexpectedEffects | E, Sui> {
|
|
290
|
+
return Effect.gen(function* () {
|
|
291
|
+
if (packageIds.length === 0) return { currencies: [], gasUsed: 0n };
|
|
223
292
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
: Effect.void
|
|
293
|
+
const batches = chunk(packageIds, INITS_PER_PTB);
|
|
294
|
+
// `Effect.result` per batch preserves the predecessor's partial-failure
|
|
295
|
+
// tolerance: one batch's error does not cancel sibling batches already in
|
|
296
|
+
// flight.
|
|
297
|
+
const outcomes = yield* Effect.forEach(
|
|
298
|
+
batches,
|
|
299
|
+
(batchPkgs) =>
|
|
300
|
+
Tx.run(
|
|
301
|
+
(tx) => {
|
|
302
|
+
for (const pkg of batchPkgs) {
|
|
303
|
+
const meta = metaOf(pkg);
|
|
304
|
+
initializeShareCurrency({
|
|
305
|
+
shareCurrencyPackageId: pkg,
|
|
306
|
+
name: meta.name,
|
|
307
|
+
description: meta.description,
|
|
308
|
+
iconUrl: meta.iconUrl ?? "",
|
|
309
|
+
treasuryCapRecipient: opts.signer.address,
|
|
310
|
+
})(tx);
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
{ signer: opts.signer, gasOwner: opts.gasOwner, sponsor: opts.sponsor },
|
|
314
|
+
).pipe(
|
|
315
|
+
Effect.flatMap((executed) =>
|
|
316
|
+
Effect.map(currenciesFromResult(executed, batchPkgs), (batchCurrencies) => ({
|
|
317
|
+
batchCurrencies,
|
|
318
|
+
gasUsed: executed.gasUsedTotal,
|
|
319
|
+
})),
|
|
320
|
+
),
|
|
321
|
+
Effect.flatMap(({ batchCurrencies, gasUsed }) =>
|
|
322
|
+
(opts.onBatch ? opts.onBatch(batchCurrencies, gasUsed) : Effect.void).pipe(
|
|
323
|
+
Effect.as({ batchCurrencies, gasUsed }),
|
|
324
|
+
),
|
|
325
|
+
),
|
|
326
|
+
Effect.result,
|
|
254
327
|
),
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
{ concurrency: "unbounded" },
|
|
258
|
-
);
|
|
328
|
+
{ concurrency: "unbounded" },
|
|
329
|
+
);
|
|
259
330
|
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
331
|
+
const currencies: ShareCurrency[] = [];
|
|
332
|
+
let gasUsed = 0n;
|
|
333
|
+
let firstFailure: RunError | UnexpectedEffects | E | undefined;
|
|
334
|
+
for (const outcome of outcomes) {
|
|
335
|
+
if (outcome._tag === "Success") {
|
|
336
|
+
currencies.push(...outcome.success.batchCurrencies);
|
|
337
|
+
gasUsed += outcome.success.gasUsed;
|
|
338
|
+
} else if (firstFailure === undefined) {
|
|
339
|
+
firstFailure = outcome.failure;
|
|
340
|
+
}
|
|
269
341
|
}
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
}
|
|
275
|
-
return { currencies, gasUsed };
|
|
276
|
-
});
|
|
342
|
+
if (firstFailure !== undefined) return yield* Effect.fail(firstFailure);
|
|
343
|
+
return { currencies, gasUsed };
|
|
344
|
+
});
|
|
345
|
+
}
|
package/src/transactions.ts
CHANGED
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
// transaction-thunk composition pattern, just crossing a package boundary now).
|
|
32
32
|
|
|
33
33
|
import { Transaction, type TransactionObjectArgument } from "@mysten/sui/transactions";
|
|
34
|
+
import { type Recipe } from "@unconfirmed/sui-effect";
|
|
34
35
|
import {
|
|
35
36
|
contracts,
|
|
36
37
|
createComposition,
|
|
@@ -53,8 +54,14 @@ interface ReleaseParts {
|
|
|
53
54
|
adminCap: TransactionObjectArgument;
|
|
54
55
|
}
|
|
55
56
|
|
|
56
|
-
|
|
57
|
-
|
|
57
|
+
/**
|
|
58
|
+
* @deprecated `TxThunk` was the predecessor hand-written name for what
|
|
59
|
+
* sui-effect calls `Recipe`. Kept as one minor for source compatibility
|
|
60
|
+
* (misofm/sdks#35's migration map); every builder in this package is typed
|
|
61
|
+
* `Recipe` directly (B8, misofm/sdks#35 verification — `git grep TxThunk
|
|
62
|
+
* packages/platform/src` shows only this re-export). Import `Recipe` from
|
|
63
|
+
* `@unconfirmed/sui-effect` instead.
|
|
64
|
+
*/
|
|
58
65
|
export type { TxThunk };
|
|
59
66
|
|
|
60
67
|
/** New custody is explicit; the legacy address shape remains mutually exclusive. */
|
|
@@ -239,7 +246,7 @@ export interface PackageBytecode {
|
|
|
239
246
|
}
|
|
240
247
|
|
|
241
248
|
/** Publish a share package and permanently destroy its UpgradeCap in the same PTB. */
|
|
242
|
-
export function publishShareCurrency(bytecode: PackageBytecode):
|
|
249
|
+
export function publishShareCurrency(bytecode: PackageBytecode): Recipe {
|
|
243
250
|
return (tx) => {
|
|
244
251
|
const upgradeCap = tx.publish(bytecode);
|
|
245
252
|
tx.moveCall({ target: "0x2::package::make_immutable", arguments: [upgradeCap] });
|
|
@@ -256,7 +263,7 @@ export interface InitializeShareCurrencyParams {
|
|
|
256
263
|
treasuryCapRecipient: string;
|
|
257
264
|
}
|
|
258
265
|
|
|
259
|
-
export function initializeShareCurrency(params: InitializeShareCurrencyParams):
|
|
266
|
+
export function initializeShareCurrency(params: InitializeShareCurrencyParams): Recipe {
|
|
260
267
|
const { shareCurrencyPackageId, name, description, iconUrl, treasuryCapRecipient } = params;
|
|
261
268
|
return (tx) => {
|
|
262
269
|
const treasuryCap = tx.moveCall({
|
|
@@ -302,7 +309,7 @@ interface PublishCompositionParamsBase extends ShareCurrencyBinding {
|
|
|
302
309
|
export type PublishCompositionParams = PublishCompositionParamsBase & AdminCustodyInput;
|
|
303
310
|
|
|
304
311
|
/** Convenience: publish a composition end-to-end (createComposition → finalizeComposition). */
|
|
305
|
-
export function publishComposition(params: PublishCompositionParams):
|
|
312
|
+
export function publishComposition(params: PublishCompositionParams): Recipe {
|
|
306
313
|
return (tx) => {
|
|
307
314
|
const parts = createComposition(tx, {
|
|
308
315
|
shareType: params.shareType,
|
|
@@ -365,7 +372,7 @@ interface PublishRecordingParamsBase extends ShareCurrencyBinding {
|
|
|
365
372
|
export type PublishRecordingParams = PublishRecordingParamsBase & AdminCustodyInput;
|
|
366
373
|
|
|
367
374
|
/** Convenience: publish a recording against an already-on-chain composition. */
|
|
368
|
-
export function publishRecording(params: PublishRecordingParams):
|
|
375
|
+
export function publishRecording(params: PublishRecordingParams): Recipe {
|
|
369
376
|
return (tx) => {
|
|
370
377
|
const parts = createRecording(tx, {
|
|
371
378
|
shareType: params.shareType,
|
|
@@ -412,7 +419,7 @@ export interface PublishCompositionAndRecordingParams {
|
|
|
412
419
|
* `composition::new` → `recording::new(&comp)` → finalize composition (publish) →
|
|
413
420
|
* finalize recording (publish).
|
|
414
421
|
*/
|
|
415
|
-
export function publishCompositionAndRecording(params: PublishCompositionAndRecordingParams):
|
|
422
|
+
export function publishCompositionAndRecording(params: PublishCompositionAndRecordingParams): Recipe {
|
|
416
423
|
return (tx) => {
|
|
417
424
|
const comp = createComposition(tx, {
|
|
418
425
|
shareType: params.composition.shareType,
|
|
@@ -517,7 +524,7 @@ function buildTrackVec(
|
|
|
517
524
|
* Convenience: publish a release end-to-end, assembling its tracklist from
|
|
518
525
|
* recording admin caps held by the sender.
|
|
519
526
|
*/
|
|
520
|
-
export function publishRelease(params: PublishReleaseParams):
|
|
527
|
+
export function publishRelease(params: PublishReleaseParams): Recipe {
|
|
521
528
|
return (tx) => {
|
|
522
529
|
const { misoPackageId } = params;
|
|
523
530
|
const trackArgs = params.tracks.map((t) => {
|
package/src/vault.ts
CHANGED
|
@@ -20,15 +20,7 @@ import type {
|
|
|
20
20
|
} from "@mysten/sui/transactions";
|
|
21
21
|
import { deriveObjectID, normalizeStructTag } from "@mysten/sui/utils";
|
|
22
22
|
import { Effect, Schema } from "effect";
|
|
23
|
-
import {
|
|
24
|
-
assertObjectType,
|
|
25
|
-
decodeBcs,
|
|
26
|
-
getOptionalObjectContent,
|
|
27
|
-
SuiClient,
|
|
28
|
-
SuiRpcError,
|
|
29
|
-
type BcsDecodeError,
|
|
30
|
-
type ObjectTypeMismatchError,
|
|
31
|
-
} from "@misofm/effect";
|
|
23
|
+
import { ObjectId, Sui, SuiSchema, type BatchItemError, type DecodeError, type ObjectUnavailable, type TransportError } from "@unconfirmed/sui-effect";
|
|
32
24
|
import * as vault from "./contracts/vault/vault.ts";
|
|
33
25
|
import * as releaseRevenueDistributor from "./contracts/release_revenue_distributor/release_revenue_distributor.ts";
|
|
34
26
|
import * as compositionRoyaltyPoolPlugin from "./contracts/composition_royalty_pool_plugin/composition_royalty_pool_plugin.ts";
|
|
@@ -940,6 +932,7 @@ export function parseReleaseRevenueDistributedEvent(content: Uint8Array) {
|
|
|
940
932
|
);
|
|
941
933
|
return {
|
|
942
934
|
releaseId: event.release_id,
|
|
935
|
+
trackCount: event.track_count.toString(),
|
|
943
936
|
totalInput: event.total_input.toString(),
|
|
944
937
|
totalDistributed: event.total_distributed.toString(),
|
|
945
938
|
remainder: event.remainder.toString(),
|
|
@@ -952,7 +945,10 @@ export function parseReleaseTrackRevenueDistributedEvent(content: Uint8Array) {
|
|
|
952
945
|
return {
|
|
953
946
|
releaseId: event.release_id,
|
|
954
947
|
trackIndex: event.track_index.toString(),
|
|
948
|
+
compositionId: event.composition_id,
|
|
955
949
|
recordingId: event.recording_id,
|
|
950
|
+
splitBps: event.split_bps,
|
|
951
|
+
totalInput: event.total_input.toString(),
|
|
956
952
|
amount: event.amount.toString(),
|
|
957
953
|
};
|
|
958
954
|
}
|
|
@@ -977,17 +973,17 @@ function mapVaultAdminCap(id: string, parsed: ReturnType<typeof vault.VaultAdmin
|
|
|
977
973
|
export const getVaultAdminCap = Effect.fn("getVaultAdminCap")(function* (
|
|
978
974
|
vaultAdminCapId: string,
|
|
979
975
|
expected: { readonly vaultPackageId: string; readonly capType: string },
|
|
980
|
-
): Effect.fn.Return<VaultAdminCap | null,
|
|
981
|
-
const
|
|
982
|
-
|
|
976
|
+
): Effect.fn.Return<VaultAdminCap | null, DecodeError | ObjectUnavailable | TransportError, Sui> {
|
|
977
|
+
const sui = yield* Sui;
|
|
978
|
+
const id = ObjectId.make(vaultAdminCapId);
|
|
983
979
|
const expectedType = normalizeStructTag(`${expected.vaultPackageId}::vault::VaultAdminCap<${expected.capType}>`);
|
|
984
|
-
yield*
|
|
985
|
-
return
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
found.value.
|
|
989
|
-
|
|
990
|
-
);
|
|
980
|
+
const found = yield* sui.getObjectOption(id, { expectedType });
|
|
981
|
+
if (found._tag === "None") return null;
|
|
982
|
+
const parsed = yield* SuiSchema.decode(SuiSchema.bcs(vault.VaultAdminCap), found.value.content, {
|
|
983
|
+
objectId: id,
|
|
984
|
+
actualType: found.value.type,
|
|
985
|
+
});
|
|
986
|
+
return new VaultAdminCap(mapVaultAdminCap(vaultAdminCapId, parsed));
|
|
991
987
|
});
|
|
992
988
|
|
|
993
989
|
/**
|
|
@@ -1004,18 +1000,15 @@ export interface ReceivingObjectRef {
|
|
|
1004
1000
|
/** Resolve owned coins to the exact references required by a Receiving input. */
|
|
1005
1001
|
export const resolveReceivingCoins = Effect.fn("resolveReceivingCoins")(function* (
|
|
1006
1002
|
coinIds: readonly string[],
|
|
1007
|
-
): Effect.fn.Return<ReceivingObjectRef[],
|
|
1008
|
-
const
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
}
|
|
1017
|
-
return { objectId: coin.objectId, version: coin.version, digest: coin.digest };
|
|
1018
|
-
});
|
|
1003
|
+
): Effect.fn.Return<ReceivingObjectRef[], BatchItemError | TransportError, Sui> {
|
|
1004
|
+
const sui = yield* Sui;
|
|
1005
|
+
// `getObjectsOrFail`: every id must resolve, same "hard read" idiom
|
|
1006
|
+
// `getSale` uses — a coin the caller named to receive but that the node
|
|
1007
|
+
// cannot produce is a typed `BatchItemError`, not a hand-rolled defect
|
|
1008
|
+
// from a raw `sui.core.getObjects` per-item `Error | null` check (B9,
|
|
1009
|
+
// misofm/sdks#35 verification).
|
|
1010
|
+
const objects = yield* sui.getObjectsOrFail(coinIds.map((id) => ObjectId.make(id)));
|
|
1011
|
+
return objects.map((object) => ({ objectId: object.id, version: String(object.version), digest: object.digest }));
|
|
1019
1012
|
});
|
|
1020
1013
|
|
|
1021
1014
|
export function receivingCoins(
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"type_name.d.ts","sourceRoot":"","sources":["../../../../../src/contracts/record_shop/deps/std/type_name.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAGhE,0EAA0E;AAE1E,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAIrD,eAAO,MAAM,QAAQ;IACb;;;;;;;;SAQK;;8BAEL,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"type_name.js","sourceRoot":"","sources":["../../../../../src/contracts/record_shop/deps/std/type_name.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAGhE,0EAA0E;AAE1E,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEtC,MAAM,WAAW,GAAG,gBAAgB,CAAC;AACrC,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,UAAU,CAAC,EAAE,IAAI,EAAE,GAAG,WAAW,YAAY,EAAE,MAAM,EAAE;QAC3E;;;;;;;;aAQK;QACL,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE;KACrB,EAAE,CAAC,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/**************************************************************
|
|
2
|
-
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
-
**************************************************************/
|
|
4
|
-
import { MoveTuple } from '../../../utils/index.ts';
|
|
5
|
-
export declare const LanguageCode: MoveTuple<readonly [import("@mysten/bcs").BcsType<string, string, "string">], "language_code::language_code::LanguageCode">;
|
|
6
|
-
//# sourceMappingURL=language_code.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"language_code.d.ts","sourceRoot":"","sources":["../../../../../src/contracts/recording_language/deps/language_code/language_code.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAIpD,eAAO,MAAM,YAAY,6HAAkF,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**************************************************************
|
|
2
|
-
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
-
**************************************************************/
|
|
4
|
-
import { MoveTuple } from '../../../utils/index.js';
|
|
5
|
-
import { bcs } from '@mysten/sui/bcs';
|
|
6
|
-
const $moduleName = 'language_code::language_code';
|
|
7
|
-
export const LanguageCode = new MoveTuple({ name: `${$moduleName}::LanguageCode`, fields: [bcs.string()] });
|
|
8
|
-
//# sourceMappingURL=language_code.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"language_code.js","sourceRoot":"","sources":["../../../../../src/contracts/recording_language/deps/language_code/language_code.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEtC,MAAM,WAAW,GAAG,8BAA8B,CAAC;AACnD,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,SAAS,CAAC,EAAE,IAAI,EAAE,GAAG,WAAW,gBAAgB,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC"}
|