@misofm/platform 0.27.0 → 0.28.1
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
|
@@ -50,21 +50,84 @@ export const RoutedStakeKey = new MoveTuple({ name: `${$moduleName}::RoutedStake
|
|
|
50
50
|
export const RoutedStakeCreatedEvent = new MoveStruct({ name: `${$moduleName}::RoutedStakeCreatedEvent<phantom StakeShare, phantom PoolShare>`, fields: {
|
|
51
51
|
routed_stake_id: bcs.Address,
|
|
52
52
|
parent_id: bcs.Address,
|
|
53
|
+
stake_id: bcs.Address,
|
|
53
54
|
staked_value: bcs.u64()
|
|
54
55
|
} });
|
|
56
|
+
export const RoutedStakeSharedEvent = new MoveStruct({ name: `${$moduleName}::RoutedStakeSharedEvent<phantom StakeShare, phantom PoolShare>`, fields: {
|
|
57
|
+
routed_stake_id: bcs.Address,
|
|
58
|
+
has_stake: bcs.bool(),
|
|
59
|
+
stake_id: bcs.Address,
|
|
60
|
+
staked_value: bcs.u64(),
|
|
61
|
+
registration_count: bcs.u64()
|
|
62
|
+
} });
|
|
63
|
+
export const RoutedStakeRegisteredEvent = new MoveStruct({ name: `${$moduleName}::RoutedStakeRegisteredEvent<phantom StakeShare, phantom PoolShare, phantom Currency>`, fields: {
|
|
64
|
+
routed_stake_id: bcs.Address,
|
|
65
|
+
parent_id: bcs.Address,
|
|
66
|
+
stake_id: bcs.Address,
|
|
67
|
+
stake_pool_id: bcs.Address,
|
|
68
|
+
staked_value: bcs.u64(),
|
|
69
|
+
registration_count_before: bcs.u64(),
|
|
70
|
+
registration_count_after: bcs.u64(),
|
|
71
|
+
pool_staked_shares_before: bcs.u64(),
|
|
72
|
+
pool_staked_shares_after: bcs.u64(),
|
|
73
|
+
pool_cumulative_reward_per_share: bcs.u256(),
|
|
74
|
+
registration_debt_after: bcs.u256()
|
|
75
|
+
} });
|
|
76
|
+
export const RoutedStakeUnregisteredEvent = new MoveStruct({ name: `${$moduleName}::RoutedStakeUnregisteredEvent<phantom StakeShare, phantom PoolShare, phantom Currency>`, fields: {
|
|
77
|
+
routed_stake_id: bcs.Address,
|
|
78
|
+
parent_id: bcs.Address,
|
|
79
|
+
stake_id: bcs.Address,
|
|
80
|
+
stake_pool_id: bcs.Address,
|
|
81
|
+
staked_value: bcs.u64(),
|
|
82
|
+
registration_count_before: bcs.u64(),
|
|
83
|
+
registration_count_after: bcs.u64(),
|
|
84
|
+
pool_staked_shares_before: bcs.u64(),
|
|
85
|
+
pool_staked_shares_after: bcs.u64(),
|
|
86
|
+
pool_cumulative_reward_per_share: bcs.u256(),
|
|
87
|
+
registration_debt_before: bcs.u256()
|
|
88
|
+
} });
|
|
55
89
|
export const RoutedStakeSweptEvent = new MoveStruct({ name: `${$moduleName}::RoutedStakeSweptEvent<phantom StakeShare, phantom PoolShare, phantom Currency>`, fields: {
|
|
56
90
|
routed_stake_id: bcs.Address,
|
|
57
91
|
parent_id: bcs.Address,
|
|
58
|
-
|
|
92
|
+
stake_id: bcs.Address,
|
|
93
|
+
stake_pool_id: bcs.Address,
|
|
94
|
+
routed_pool_id: bcs.Address,
|
|
95
|
+
value: bcs.u64(),
|
|
96
|
+
/**
|
|
97
|
+
* `true` when the reward was sent to the routed pool's own address because it had
|
|
98
|
+
* no stakers to attribute the deposit to; `false` when it was deposited into the
|
|
99
|
+
* accumulator directly.
|
|
100
|
+
*/
|
|
101
|
+
parked: bcs.bool(),
|
|
102
|
+
staked_value: bcs.u64(),
|
|
103
|
+
source_balance_before: bcs.u64(),
|
|
104
|
+
source_balance_after: bcs.u64(),
|
|
105
|
+
source_staked_shares: bcs.u64(),
|
|
106
|
+
source_index: bcs.u256(),
|
|
107
|
+
source_carry: bcs.u128(),
|
|
108
|
+
source_cumulative_deposits: bcs.u128(),
|
|
109
|
+
registration_debt_before: bcs.u256(),
|
|
110
|
+
registration_debt_after: bcs.u256(),
|
|
111
|
+
destination_balance_before: bcs.u64(),
|
|
112
|
+
destination_balance_after: bcs.u64(),
|
|
113
|
+
destination_staked_shares: bcs.u64(),
|
|
114
|
+
destination_index_before: bcs.u256(),
|
|
115
|
+
destination_index_after: bcs.u256(),
|
|
116
|
+
destination_carry_before: bcs.u128(),
|
|
117
|
+
destination_carry_after: bcs.u128(),
|
|
118
|
+
destination_cumulative_deposits_before: bcs.u128(),
|
|
119
|
+
destination_cumulative_deposits_after: bcs.u128()
|
|
59
120
|
} });
|
|
60
121
|
export const RoutedStakeUnstakedEvent = new MoveStruct({ name: `${$moduleName}::RoutedStakeUnstakedEvent<phantom StakeShare, phantom PoolShare>`, fields: {
|
|
61
122
|
routed_stake_id: bcs.Address,
|
|
62
123
|
parent_id: bcs.Address,
|
|
124
|
+
stake_id: bcs.Address,
|
|
63
125
|
unstaked_value: bcs.u64()
|
|
64
126
|
} });
|
|
65
127
|
export const RoutedStakeRestakedEvent = new MoveStruct({ name: `${$moduleName}::RoutedStakeRestakedEvent<phantom StakeShare, phantom PoolShare>`, fields: {
|
|
66
128
|
routed_stake_id: bcs.Address,
|
|
67
129
|
parent_id: bcs.Address,
|
|
130
|
+
stake_id: bcs.Address,
|
|
68
131
|
staked_value: bcs.u64()
|
|
69
132
|
} });
|
|
70
133
|
export interface NewArguments {
|
|
@@ -311,15 +374,24 @@ export interface SweepOptions {
|
|
|
311
374
|
* Claim the wrapped stake's accrued rewards from `stake_pool` and commit them to
|
|
312
375
|
* `routed_pool` — the parent's own pool. Permissionless: the caller supplies
|
|
313
376
|
* `parent_id`, but cannot lie, because both the wrapper's own address and
|
|
314
|
-
* `routed_pool`'s address must derive from it
|
|
315
|
-
*
|
|
377
|
+
* `routed_pool`'s address must derive from it (checked first, and always — these
|
|
378
|
+
* are wrong-object asserts, not "nothing to do"). Returns the value moved,
|
|
379
|
+
* deposited or parked.
|
|
380
|
+
*
|
|
381
|
+
* A crank-facing call never aborts for having nothing to do: `sweep` is a total
|
|
382
|
+
* no-op — 0 returned, no event — in each of these cases, checked in this order
|
|
383
|
+
* before touching either pool: the wrapper is empty (`has_stake` false); the
|
|
384
|
+
* wrapped stake has no registration for `Currency`; or its registration names a
|
|
385
|
+
* pool other than `stake_pool`. Only once all three pass does it claim from
|
|
386
|
+
* `stake_pool` — where a zero reward is, again, a no-op.
|
|
316
387
|
*
|
|
317
388
|
* A pool deposit needs a registered stake to attribute to. While `routed_pool` has
|
|
318
389
|
* none, the reward is instead sent to the pool's own address — ordinary
|
|
319
|
-
* address-delivered funds, folded in permissionlessly by `pool::
|
|
320
|
-
*
|
|
321
|
-
* so the route stays fixed and this call — and
|
|
322
|
-
* can never be blocked by the destination's
|
|
390
|
+
* address-delivered funds, folded in permissionlessly by `pool::settle` once a
|
|
391
|
+
* stake registers (`parked: true` in the emitted event). Either way the money is
|
|
392
|
+
* committed to the parent's pool, so the route stays fixed and this call — and
|
|
393
|
+
* therefore `unregister`/`unstake` — can never be blocked by the destination's
|
|
394
|
+
* state.
|
|
323
395
|
*/
|
|
324
396
|
export function sweep(options: SweepOptions) {
|
|
325
397
|
const packageAddress = options.package ?? '@local-pkg/routed_stake';
|
|
@@ -29,11 +29,14 @@
|
|
|
29
29
|
* track's split there). The address is a pure function of
|
|
30
30
|
* `(parent_id, Share, Currency)`, so senders need the pool neither shared nor
|
|
31
31
|
* even created yet; a later `new` claims exactly that ID — and can only be the
|
|
32
|
-
* correctly-typed, shared pool. `
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
32
|
+
* correctly-typed, shared pool. `recover_coins` and `settle` fold such funds
|
|
33
|
+
* into the accumulator, permissionlessly: anyone can complete the delivery. Both
|
|
34
|
+
* are total — a crank-facing call never aborts for having nothing to do.
|
|
35
|
+
* `settle` folds in what is settled at the pool's own address once stakers
|
|
36
|
+
* exist; while `staked_shares == 0` it returns 0 and reads nothing, so funds at
|
|
37
|
+
* the pool's address wait, unredeemed, until a stake registers. `recover_coins`
|
|
38
|
+
* never deposits — it only converts coin objects into funds at the same address
|
|
39
|
+
* for a later `settle` to redeem.
|
|
37
40
|
*
|
|
38
41
|
* ### No activation delay (deliberate)
|
|
39
42
|
*
|
|
@@ -95,26 +98,95 @@ export const RoyaltyPool = new MoveStruct({ name: `${$moduleName}::RoyaltyPool<p
|
|
|
95
98
|
export const RoyaltyPoolKey = new MoveTuple({ name: `${$moduleName}::RoyaltyPoolKey<phantom Share, phantom Currency>`, fields: [bcs.bool()] });
|
|
96
99
|
export const RoyaltyPoolCreatedEvent = new MoveStruct({ name: `${$moduleName}::RoyaltyPoolCreatedEvent<phantom Share, phantom Currency>`, fields: {
|
|
97
100
|
pool_id: bcs.Address,
|
|
98
|
-
parent_id: bcs.Address
|
|
101
|
+
parent_id: bcs.Address,
|
|
102
|
+
precision: bcs.u128(),
|
|
103
|
+
pool_balance_after: bcs.u64(),
|
|
104
|
+
staked_shares_after: bcs.u64(),
|
|
105
|
+
cumulative_reward_per_share_after: bcs.u256(),
|
|
106
|
+
carry_after: bcs.u128(),
|
|
107
|
+
cumulative_deposits_after: bcs.u128()
|
|
108
|
+
} });
|
|
109
|
+
export const RoyaltyPoolSharedEvent = new MoveStruct({ name: `${$moduleName}::RoyaltyPoolSharedEvent<phantom Share, phantom Currency>`, fields: {
|
|
110
|
+
pool_id: bcs.Address,
|
|
111
|
+
pool_balance_after: bcs.u64(),
|
|
112
|
+
staked_shares_after: bcs.u64(),
|
|
113
|
+
cumulative_reward_per_share_after: bcs.u256(),
|
|
114
|
+
carry_after: bcs.u128(),
|
|
115
|
+
cumulative_deposits_after: bcs.u128()
|
|
99
116
|
} });
|
|
100
117
|
export const RoyaltyDepositedEvent = new MoveStruct({ name: `${$moduleName}::RoyaltyDepositedEvent<phantom Share, phantom Currency>`, fields: {
|
|
101
118
|
pool_id: bcs.Address,
|
|
102
|
-
value: bcs.u64()
|
|
119
|
+
value: bcs.u64(),
|
|
120
|
+
cumulative_reward_per_share_before: bcs.u256(),
|
|
121
|
+
carry_before: bcs.u128(),
|
|
122
|
+
pool_balance_after: bcs.u64(),
|
|
123
|
+
staked_shares_after: bcs.u64(),
|
|
124
|
+
cumulative_reward_per_share_after: bcs.u256(),
|
|
125
|
+
carry_after: bcs.u128(),
|
|
126
|
+
cumulative_deposits_after: bcs.u128()
|
|
127
|
+
} });
|
|
128
|
+
export const RoyaltyPoolFundsSettledEvent = new MoveStruct({ name: `${$moduleName}::RoyaltyPoolFundsSettledEvent<phantom Share, phantom Currency>`, fields: {
|
|
129
|
+
pool_id: bcs.Address,
|
|
130
|
+
source_address: bcs.Address,
|
|
131
|
+
accumulator_root_id: bcs.Address,
|
|
132
|
+
value: bcs.u64(),
|
|
133
|
+
pool_balance_after: bcs.u64(),
|
|
134
|
+
staked_shares_after: bcs.u64(),
|
|
135
|
+
cumulative_reward_per_share_after: bcs.u256(),
|
|
136
|
+
carry_after: bcs.u128(),
|
|
137
|
+
cumulative_deposits_after: bcs.u128()
|
|
138
|
+
} });
|
|
139
|
+
export const RoyaltyPoolCoinsRecoveredEvent = new MoveStruct({ name: `${$moduleName}::RoyaltyPoolCoinsRecoveredEvent<phantom Share, phantom Currency>`, fields: {
|
|
140
|
+
pool_id: bcs.Address,
|
|
141
|
+
coin_ids: bcs.vector(bcs.Address),
|
|
142
|
+
coin_count: bcs.u64(),
|
|
143
|
+
funds_recipient: bcs.Address,
|
|
144
|
+
value: bcs.u64(),
|
|
145
|
+
pool_balance_after: bcs.u64(),
|
|
146
|
+
staked_shares_after: bcs.u64(),
|
|
147
|
+
cumulative_reward_per_share_after: bcs.u256(),
|
|
148
|
+
carry_after: bcs.u128(),
|
|
149
|
+
cumulative_deposits_after: bcs.u128()
|
|
103
150
|
} });
|
|
104
151
|
export const StakeRegisteredEvent = new MoveStruct({ name: `${$moduleName}::StakeRegisteredEvent<phantom Share, phantom Currency>`, fields: {
|
|
105
152
|
pool_id: bcs.Address,
|
|
106
153
|
stake_id: bcs.Address,
|
|
107
|
-
staked_amount: bcs.u64()
|
|
154
|
+
staked_amount: bcs.u64(),
|
|
155
|
+
registration_debt_after: bcs.u256(),
|
|
156
|
+
stake_registration_count_after: bcs.u64(),
|
|
157
|
+
pool_balance_after: bcs.u64(),
|
|
158
|
+
staked_shares_after: bcs.u64(),
|
|
159
|
+
cumulative_reward_per_share_after: bcs.u256(),
|
|
160
|
+
carry_after: bcs.u128(),
|
|
161
|
+
cumulative_deposits_after: bcs.u128()
|
|
108
162
|
} });
|
|
109
163
|
export const StakeUnregisteredEvent = new MoveStruct({ name: `${$moduleName}::StakeUnregisteredEvent<phantom Share, phantom Currency>`, fields: {
|
|
110
164
|
pool_id: bcs.Address,
|
|
111
165
|
stake_id: bcs.Address,
|
|
112
|
-
unstaked_amount: bcs.u64()
|
|
166
|
+
unstaked_amount: bcs.u64(),
|
|
167
|
+
removed_registration_debt: bcs.u256(),
|
|
168
|
+
forfeited_reward_numerator: bcs.u256(),
|
|
169
|
+
stake_registration_count_after: bcs.u64(),
|
|
170
|
+
pool_balance_after: bcs.u64(),
|
|
171
|
+
staked_shares_after: bcs.u64(),
|
|
172
|
+
cumulative_reward_per_share_after: bcs.u256(),
|
|
173
|
+
carry_after: bcs.u128(),
|
|
174
|
+
cumulative_deposits_after: bcs.u128()
|
|
113
175
|
} });
|
|
114
176
|
export const RoyaltyClaimedEvent = new MoveStruct({ name: `${$moduleName}::RoyaltyClaimedEvent<phantom Share, phantom Currency>`, fields: {
|
|
115
177
|
pool_id: bcs.Address,
|
|
116
178
|
stake_id: bcs.Address,
|
|
117
|
-
|
|
179
|
+
staked_amount: bcs.u64(),
|
|
180
|
+
reward_amount: bcs.u64(),
|
|
181
|
+
registration_debt_before: bcs.u256(),
|
|
182
|
+
registration_debt_after: bcs.u256(),
|
|
183
|
+
reward_residue_after: bcs.u256(),
|
|
184
|
+
stake_registration_count_after: bcs.u64(),
|
|
185
|
+
pool_balance_after: bcs.u64(),
|
|
186
|
+
staked_shares_after: bcs.u64(),
|
|
187
|
+
cumulative_reward_per_share_after: bcs.u256(),
|
|
188
|
+
carry_after: bcs.u128(),
|
|
189
|
+
cumulative_deposits_after: bcs.u128()
|
|
118
190
|
} });
|
|
119
191
|
export interface NewArguments {
|
|
120
192
|
parent: RawTransactionArgument<string>;
|
|
@@ -219,15 +291,13 @@ export function deposit(options: DepositOptions) {
|
|
|
219
291
|
typeArguments: options.typeArguments
|
|
220
292
|
});
|
|
221
293
|
}
|
|
222
|
-
export interface
|
|
294
|
+
export interface SettleArguments {
|
|
223
295
|
self: RawTransactionArgument<string>;
|
|
224
|
-
coins: TransactionArgument;
|
|
225
296
|
}
|
|
226
|
-
export interface
|
|
297
|
+
export interface SettleOptions {
|
|
227
298
|
package?: string;
|
|
228
|
-
arguments:
|
|
229
|
-
self: RawTransactionArgument<string
|
|
230
|
-
coins: TransactionArgument
|
|
299
|
+
arguments: SettleArguments | [
|
|
300
|
+
self: RawTransactionArgument<string>
|
|
231
301
|
];
|
|
232
302
|
typeArguments: [
|
|
233
303
|
string,
|
|
@@ -235,32 +305,36 @@ export interface ReceiveAndDepositOptions {
|
|
|
235
305
|
];
|
|
236
306
|
}
|
|
237
307
|
/**
|
|
238
|
-
*
|
|
239
|
-
*
|
|
240
|
-
*
|
|
308
|
+
* Redeem everything settled at this pool's own address and fold it into the
|
|
309
|
+
* accumulator. Recovery path for funds a routed sweep parked here while the pool
|
|
310
|
+
* had no stakers. Returns the value deposited. Returns 0 and changes nothing when
|
|
311
|
+
* nothing is settled or when `staked_shares == 0` (the funds stay at the pool's
|
|
312
|
+
* address until a stake registers). Permissionless.
|
|
241
313
|
*/
|
|
242
|
-
export function
|
|
314
|
+
export function settle(options: SettleOptions) {
|
|
243
315
|
const packageAddress = options.package ?? '@local-pkg/royalty_pool';
|
|
244
316
|
const argumentsTypes = [
|
|
245
317
|
null,
|
|
246
|
-
'
|
|
318
|
+
'0x2::accumulator::AccumulatorRoot'
|
|
247
319
|
] satisfies (string | null)[];
|
|
248
|
-
const parameterNames = ["self"
|
|
320
|
+
const parameterNames = ["self"];
|
|
249
321
|
return (tx: Transaction) => tx.moveCall({
|
|
250
322
|
package: packageAddress,
|
|
251
323
|
module: 'pool',
|
|
252
|
-
function: '
|
|
324
|
+
function: 'settle',
|
|
253
325
|
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
254
326
|
typeArguments: options.typeArguments
|
|
255
327
|
});
|
|
256
328
|
}
|
|
257
|
-
export interface
|
|
329
|
+
export interface RecoverCoinsArguments {
|
|
258
330
|
self: RawTransactionArgument<string>;
|
|
331
|
+
coins: TransactionArgument;
|
|
259
332
|
}
|
|
260
|
-
export interface
|
|
333
|
+
export interface RecoverCoinsOptions {
|
|
261
334
|
package?: string;
|
|
262
|
-
arguments:
|
|
263
|
-
self: RawTransactionArgument<string
|
|
335
|
+
arguments: RecoverCoinsArguments | [
|
|
336
|
+
self: RawTransactionArgument<string>,
|
|
337
|
+
coins: TransactionArgument
|
|
264
338
|
];
|
|
265
339
|
typeArguments: [
|
|
266
340
|
string,
|
|
@@ -268,25 +342,21 @@ export interface SweepAndDepositOptions {
|
|
|
268
342
|
];
|
|
269
343
|
}
|
|
270
344
|
/**
|
|
271
|
-
*
|
|
272
|
-
* fold them
|
|
273
|
-
*
|
|
274
|
-
*
|
|
275
|
-
* The framework returns at most `u64::MAX` per call. Any excess, along with funds
|
|
276
|
-
* sent later in the current commit, remains for a subsequent sweep. Aborts with
|
|
277
|
-
* `ENoSettledFunds` when no positive amount is currently eligible.
|
|
345
|
+
* Convert `Coin` objects sent to this pool's address into funds at the same
|
|
346
|
+
* address, so `settle` can fold them in next commit. Deposits nothing. Returns the
|
|
347
|
+
* value converted; 0 for an empty vector. Permissionless.
|
|
278
348
|
*/
|
|
279
|
-
export function
|
|
349
|
+
export function recoverCoins(options: RecoverCoinsOptions) {
|
|
280
350
|
const packageAddress = options.package ?? '@local-pkg/royalty_pool';
|
|
281
351
|
const argumentsTypes = [
|
|
282
352
|
null,
|
|
283
|
-
'
|
|
353
|
+
'vector<null>'
|
|
284
354
|
] satisfies (string | null)[];
|
|
285
|
-
const parameterNames = ["self"];
|
|
355
|
+
const parameterNames = ["self", "coins"];
|
|
286
356
|
return (tx: Transaction) => tx.moveCall({
|
|
287
357
|
package: packageAddress,
|
|
288
358
|
module: 'pool',
|
|
289
|
-
function: '
|
|
359
|
+
function: 'recover_coins',
|
|
290
360
|
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
291
361
|
typeArguments: options.typeArguments
|
|
292
362
|
});
|
|
@@ -569,6 +639,38 @@ export function cumulativeDeposits(options: CumulativeDepositsOptions) {
|
|
|
569
639
|
typeArguments: options.typeArguments
|
|
570
640
|
});
|
|
571
641
|
}
|
|
642
|
+
export interface SettledValueArguments {
|
|
643
|
+
self: RawTransactionArgument<string>;
|
|
644
|
+
}
|
|
645
|
+
export interface SettledValueOptions {
|
|
646
|
+
package?: string;
|
|
647
|
+
arguments: SettledValueArguments | [
|
|
648
|
+
self: RawTransactionArgument<string>
|
|
649
|
+
];
|
|
650
|
+
typeArguments: [
|
|
651
|
+
string,
|
|
652
|
+
string
|
|
653
|
+
];
|
|
654
|
+
}
|
|
655
|
+
/**
|
|
656
|
+
* Funds of `Currency` settled at this pool's own address as of the start of the
|
|
657
|
+
* current consensus commit — what `settle` would redeem right now.
|
|
658
|
+
*/
|
|
659
|
+
export function settledValue(options: SettledValueOptions) {
|
|
660
|
+
const packageAddress = options.package ?? '@local-pkg/royalty_pool';
|
|
661
|
+
const argumentsTypes = [
|
|
662
|
+
null,
|
|
663
|
+
'0x2::accumulator::AccumulatorRoot'
|
|
664
|
+
] satisfies (string | null)[];
|
|
665
|
+
const parameterNames = ["self"];
|
|
666
|
+
return (tx: Transaction) => tx.moveCall({
|
|
667
|
+
package: packageAddress,
|
|
668
|
+
module: 'pool',
|
|
669
|
+
function: 'settled_value',
|
|
670
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
671
|
+
typeArguments: options.typeArguments
|
|
672
|
+
});
|
|
673
|
+
}
|
|
572
674
|
export interface DerivedAddressArguments {
|
|
573
675
|
parentId: RawTransactionArgument<string>;
|
|
574
676
|
}
|
|
@@ -54,11 +54,14 @@ export const Stake = new MoveStruct({ name: `${$moduleName}::Stake<phantom Share
|
|
|
54
54
|
} });
|
|
55
55
|
export const StakeCreatedEvent = new MoveStruct({ name: `${$moduleName}::StakeCreatedEvent<phantom Share>`, fields: {
|
|
56
56
|
stake_id: bcs.Address,
|
|
57
|
-
|
|
57
|
+
transaction_sender: bcs.Address,
|
|
58
|
+
amount: bcs.u64(),
|
|
59
|
+
registration_count_after: bcs.u64()
|
|
58
60
|
} });
|
|
59
61
|
export const StakeDestroyedEvent = new MoveStruct({ name: `${$moduleName}::StakeDestroyedEvent<phantom Share>`, fields: {
|
|
60
62
|
stake_id: bcs.Address,
|
|
61
|
-
amount: bcs.u64()
|
|
63
|
+
amount: bcs.u64(),
|
|
64
|
+
registration_count_before: bcs.u64()
|
|
62
65
|
} });
|
|
63
66
|
export interface NewArguments {
|
|
64
67
|
balance: TransactionArgument;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Fixed-supply currency issuance for representing equity-like ownership stakes.
|
|
8
|
+
*
|
|
9
|
+
* ### Usage:
|
|
10
|
+
*
|
|
11
|
+
* 1. Create a package with a `share` module containing a `Share` type
|
|
12
|
+
* 2. Create a currency with `sui::coin_registry::new_currency`
|
|
13
|
+
* 3. Delete the metadata cap via `finalize_and_delete_metadata_cap`
|
|
14
|
+
* 4. Call `share::share::initialize` with the currency and its canonical treasury
|
|
15
|
+
* cap (the one created together with the currency)
|
|
16
|
+
* 5. Distribute the returned balance to shareholders
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
import { MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.ts';
|
|
20
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
21
|
+
import type {} from "@mysten/bcs";
|
|
22
|
+
import { type Transaction } from '@mysten/sui/transactions';
|
|
23
|
+
const $moduleName = '@local-pkg/share::share';
|
|
24
|
+
export const ShareInitializedEvent = new MoveStruct({ name: `${$moduleName}::ShareInitializedEvent<phantom ShareType>`, fields: {
|
|
25
|
+
currency_id: bcs.Address,
|
|
26
|
+
treasury_cap_id: bcs.Address,
|
|
27
|
+
share_type: bcs.vector(bcs.u8()),
|
|
28
|
+
decimals: bcs.u8(),
|
|
29
|
+
supply: bcs.u64(),
|
|
30
|
+
fixed_supply: bcs.bool(),
|
|
31
|
+
metadata_cap_deleted: bcs.bool(),
|
|
32
|
+
regulated: bcs.bool(),
|
|
33
|
+
name: bcs.vector(bcs.u8()),
|
|
34
|
+
symbol: bcs.vector(bcs.u8()),
|
|
35
|
+
description: bcs.vector(bcs.u8()),
|
|
36
|
+
icon_url: bcs.vector(bcs.u8())
|
|
37
|
+
} });
|
|
38
|
+
export interface InitializeArguments {
|
|
39
|
+
currency: RawTransactionArgument<string>;
|
|
40
|
+
treasuryCap: RawTransactionArgument<string>;
|
|
41
|
+
}
|
|
42
|
+
export interface InitializeOptions {
|
|
43
|
+
package?: string;
|
|
44
|
+
arguments: InitializeArguments | [
|
|
45
|
+
currency: RawTransactionArgument<string>,
|
|
46
|
+
treasuryCap: RawTransactionArgument<string>
|
|
47
|
+
];
|
|
48
|
+
typeArguments: [
|
|
49
|
+
string
|
|
50
|
+
];
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Initializes a fixed-supply share token with 10,000,000.000000 supply. Validates
|
|
54
|
+
* the currency configuration, mints the fixed supply, and makes the supply
|
|
55
|
+
* immutable. Returns the full token balance.
|
|
56
|
+
*
|
|
57
|
+
* The type parameter must be a `Share` type defined in a `share` module (i.e.
|
|
58
|
+
* `<address>::share::Share`).
|
|
59
|
+
*/
|
|
60
|
+
export function initialize(options: InitializeOptions) {
|
|
61
|
+
const packageAddress = options.package ?? '@local-pkg/share';
|
|
62
|
+
const argumentsTypes = [
|
|
63
|
+
null,
|
|
64
|
+
null
|
|
65
|
+
] satisfies (string | null)[];
|
|
66
|
+
const parameterNames = ["currency", "treasuryCap"];
|
|
67
|
+
return (tx: Transaction) => tx.moveCall({
|
|
68
|
+
package: packageAddress,
|
|
69
|
+
module: 'share',
|
|
70
|
+
function: 'initialize',
|
|
71
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
72
|
+
typeArguments: options.typeArguments
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
export interface AssertValidShareTypeOptions {
|
|
76
|
+
package?: string;
|
|
77
|
+
arguments?: [
|
|
78
|
+
];
|
|
79
|
+
typeArguments: [
|
|
80
|
+
string
|
|
81
|
+
];
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Asserts that the share type name ends with the expected suffix
|
|
85
|
+
* (`<address>::share::Share`). Public so downstream packages that hold or route
|
|
86
|
+
* share types (e.g. cap inventories) can enforce the same gate this package's
|
|
87
|
+
* `initialize` enforces, instead of mirroring it.
|
|
88
|
+
*/
|
|
89
|
+
export function assertValidShareType(options: AssertValidShareTypeOptions) {
|
|
90
|
+
const packageAddress = options.package ?? '@local-pkg/share';
|
|
91
|
+
return (tx: Transaction) => tx.moveCall({
|
|
92
|
+
package: packageAddress,
|
|
93
|
+
module: 'share',
|
|
94
|
+
function: 'assert_valid_share_type',
|
|
95
|
+
typeArguments: options.typeArguments
|
|
96
|
+
});
|
|
97
|
+
}
|
|
@@ -49,21 +49,72 @@ export const VaultAdminCap = new MoveStruct({ name: `${$moduleName}::VaultAdminC
|
|
|
49
49
|
export const VaultKey = new MoveTuple({ name: `${$moduleName}::VaultKey<phantom Cap>`, fields: [bcs.Address] });
|
|
50
50
|
export const VaultAdminCapKey = new MoveTuple({ name: `${$moduleName}::VaultAdminCapKey`, fields: [bcs.bool()] });
|
|
51
51
|
export const AuthorizedPluginKey = new MoveTuple({ name: `${$moduleName}::AuthorizedPluginKey<phantom Witness>`, fields: [bcs.bool()] });
|
|
52
|
+
export const VaultRegistryCreatedEvent = new MoveStruct({ name: `${$moduleName}::VaultRegistryCreatedEvent`, fields: {
|
|
53
|
+
registry_id: bcs.Address,
|
|
54
|
+
shared: bcs.bool()
|
|
55
|
+
} });
|
|
52
56
|
export const VaultCreatedEvent = new MoveStruct({ name: `${$moduleName}::VaultCreatedEvent<phantom Cap>`, fields: {
|
|
57
|
+
registry_id: bcs.Address,
|
|
58
|
+
vault_id: bcs.Address,
|
|
59
|
+
cap_id: bcs.Address,
|
|
60
|
+
admin_cap_id: bcs.Address,
|
|
61
|
+
authorized_plugins_id: bcs.Address,
|
|
62
|
+
authorized_plugin_count: bcs.u64(),
|
|
63
|
+
active: bcs.bool(),
|
|
64
|
+
capability_available: bcs.bool()
|
|
65
|
+
} });
|
|
66
|
+
export const VaultSharedEvent = new MoveStruct({ name: `${$moduleName}::VaultSharedEvent<phantom Cap>`, fields: {
|
|
53
67
|
vault_id: bcs.Address,
|
|
54
68
|
cap_id: bcs.Address
|
|
55
69
|
} });
|
|
56
70
|
export const PluginAuthorizedEvent = new MoveStruct({ name: `${$moduleName}::PluginAuthorizedEvent<phantom Cap, phantom Witness>`, fields: {
|
|
57
|
-
vault_id: bcs.Address
|
|
71
|
+
vault_id: bcs.Address,
|
|
72
|
+
cap_id: bcs.Address,
|
|
73
|
+
admin_cap_id: bcs.Address,
|
|
74
|
+
authorized_plugins_id: bcs.Address,
|
|
75
|
+
authorized_plugin_count: bcs.u64(),
|
|
76
|
+
authorized: bcs.bool()
|
|
58
77
|
} });
|
|
59
78
|
export const PluginRevokedEvent = new MoveStruct({ name: `${$moduleName}::PluginRevokedEvent<phantom Cap, phantom Witness>`, fields: {
|
|
60
|
-
vault_id: bcs.Address
|
|
79
|
+
vault_id: bcs.Address,
|
|
80
|
+
cap_id: bcs.Address,
|
|
81
|
+
admin_cap_id: bcs.Address,
|
|
82
|
+
authorized_plugins_id: bcs.Address,
|
|
83
|
+
authorized_plugin_count: bcs.u64(),
|
|
84
|
+
authorized: bcs.bool()
|
|
61
85
|
} });
|
|
62
86
|
export const VaultCapabilityWithdrawnEvent = new MoveStruct({ name: `${$moduleName}::VaultCapabilityWithdrawnEvent<phantom Cap>`, fields: {
|
|
63
|
-
vault_id: bcs.Address
|
|
87
|
+
vault_id: bcs.Address,
|
|
88
|
+
cap_id: bcs.Address,
|
|
89
|
+
admin_cap_id: bcs.Address,
|
|
90
|
+
active: bcs.bool(),
|
|
91
|
+
capability_available: bcs.bool()
|
|
64
92
|
} });
|
|
65
93
|
export const VaultCapabilityRestoredEvent = new MoveStruct({ name: `${$moduleName}::VaultCapabilityRestoredEvent<phantom Cap>`, fields: {
|
|
66
|
-
vault_id: bcs.Address
|
|
94
|
+
vault_id: bcs.Address,
|
|
95
|
+
cap_id: bcs.Address,
|
|
96
|
+
admin_cap_id: bcs.Address,
|
|
97
|
+
active: bcs.bool(),
|
|
98
|
+
capability_available: bcs.bool()
|
|
99
|
+
} });
|
|
100
|
+
export const VaultCapabilityBorrowedByPluginEvent = new MoveStruct({ name: `${$moduleName}::VaultCapabilityBorrowedByPluginEvent<phantom Cap, phantom Witness>`, fields: {
|
|
101
|
+
vault_id: bcs.Address,
|
|
102
|
+
cap_id: bcs.Address,
|
|
103
|
+
active: bcs.bool(),
|
|
104
|
+
capability_available: bcs.bool()
|
|
105
|
+
} });
|
|
106
|
+
export const VaultCapabilityBorrowedByAdminEvent = new MoveStruct({ name: `${$moduleName}::VaultCapabilityBorrowedByAdminEvent<phantom Cap>`, fields: {
|
|
107
|
+
vault_id: bcs.Address,
|
|
108
|
+
cap_id: bcs.Address,
|
|
109
|
+
admin_cap_id: bcs.Address,
|
|
110
|
+
active: bcs.bool(),
|
|
111
|
+
capability_available: bcs.bool()
|
|
112
|
+
} });
|
|
113
|
+
export const VaultCapabilityReturnedEvent = new MoveStruct({ name: `${$moduleName}::VaultCapabilityReturnedEvent<phantom Cap>`, fields: {
|
|
114
|
+
vault_id: bcs.Address,
|
|
115
|
+
cap_id: bcs.Address,
|
|
116
|
+
active: bcs.bool(),
|
|
117
|
+
capability_available: bcs.bool()
|
|
67
118
|
} });
|
|
68
119
|
export interface NewArguments<Cap extends BcsType<any>> {
|
|
69
120
|
registry: RawTransactionArgument<string>;
|
package/src/contracts.ts
CHANGED
|
@@ -35,6 +35,24 @@ import * as rawRoyaltyPool from "./contracts/royalty_pool/pool.ts";
|
|
|
35
35
|
import * as rawRoyaltyStake from "./contracts/royalty_pool/stake.ts";
|
|
36
36
|
import * as rawRoutedStake from "./contracts/routed_stake/routed_stake.ts";
|
|
37
37
|
import * as rawPartyProfile from "./contracts/party_profile/party_profile.ts";
|
|
38
|
+
import * as rawShare from "./contracts/share/share.ts";
|
|
39
|
+
import * as rawPay from "./contracts/miso_pay/pay.ts";
|
|
40
|
+
import * as rawPlatformLink from "./contracts/platform_link/platform_link.ts";
|
|
41
|
+
|
|
42
|
+
// Generic inputs have no configured platform deployment or client-bound call
|
|
43
|
+
// surface yet. Expose their event codecs through this curated barrel while
|
|
44
|
+
// keeping generated transaction functions available only through the raw
|
|
45
|
+
// wildcard `./contracts/*` subpath.
|
|
46
|
+
export const share = {
|
|
47
|
+
ShareInitializedEvent: rawShare.ShareInitializedEvent,
|
|
48
|
+
} as const;
|
|
49
|
+
export const pay = {
|
|
50
|
+
PaymentSentEvent: rawPay.PaymentSentEvent,
|
|
51
|
+
} as const;
|
|
52
|
+
export const platformLink = {
|
|
53
|
+
PlatformLinkSetEvent: rawPlatformLink.PlatformLinkSetEvent,
|
|
54
|
+
PlatformLinkRemovedEvent: rawPlatformLink.PlatformLinkRemovedEvent,
|
|
55
|
+
} as const;
|
|
38
56
|
|
|
39
57
|
// Record identity/issuance and Record Shop primary-sale mechanics. The
|
|
40
58
|
// package-restricted witness constructor is intentionally not exported here.
|