@misofm/sdk 0.15.11 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +210 -73
- package/dist/client.d.ts +224 -68
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +465 -79
- package/dist/client.js.map +1 -1
- package/dist/contracts/composition_credits/composition_credits.d.ts +10 -10
- package/dist/contracts/composition_credits/composition_credits.d.ts.map +1 -1
- package/dist/contracts/composition_credits/composition_credits.js.map +1 -1
- package/dist/contracts/composition_credits/composition_party_role.d.ts +1 -1
- package/dist/contracts/composition_credits/composition_party_role.d.ts.map +1 -1
- package/dist/contracts/composition_credits/composition_party_role.js.map +1 -1
- package/dist/contracts/composition_credits/deps/miso_credit/credit.d.ts.map +1 -1
- package/dist/contracts/composition_credits/deps/miso_credit/credit.js.map +1 -1
- package/dist/contracts/composition_credits/deps/sui/vec_map.d.ts.map +1 -1
- package/dist/contracts/composition_credits/deps/sui/vec_map.js.map +1 -1
- package/dist/contracts/composition_routed_stake/composition_routed_stake.d.ts +29 -93
- package/dist/contracts/composition_routed_stake/composition_routed_stake.d.ts.map +1 -1
- package/dist/contracts/composition_routed_stake/composition_routed_stake.js +19 -79
- package/dist/contracts/composition_routed_stake/composition_routed_stake.js.map +1 -1
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.d.ts +22 -106
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.d.ts.map +1 -1
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.js +16 -98
- 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 +90 -0
- package/dist/contracts/composition_royalty_pool_plugin/composition_royalty_pool_plugin.d.ts.map +1 -0
- package/dist/contracts/composition_royalty_pool_plugin/composition_royalty_pool_plugin.js +85 -0
- package/dist/contracts/composition_royalty_pool_plugin/composition_royalty_pool_plugin.js.map +1 -0
- package/dist/contracts/{party_wallet → composition_royalty_pool_plugin}/witness.d.ts +1 -1
- package/dist/contracts/composition_royalty_pool_plugin/witness.d.ts.map +1 -0
- package/dist/contracts/{recording_royalty_pool → composition_royalty_pool_plugin}/witness.js +1 -1
- package/dist/contracts/composition_royalty_pool_plugin/witness.js.map +1 -0
- package/dist/contracts/cover_art/cover_art.d.ts +4 -4
- package/dist/contracts/cover_art/cover_art.d.ts.map +1 -1
- package/dist/contracts/cover_art/cover_art.js.map +1 -1
- package/dist/contracts/cover_art/deps/ori/walrus_data.d.ts +4 -4
- package/dist/contracts/cover_art/deps/ori/walrus_data.d.ts.map +1 -1
- package/dist/contracts/cover_art/deps/ori/walrus_data.js.map +1 -1
- package/dist/contracts/genre/genre.d.ts +6 -6
- package/dist/contracts/genre/genre.d.ts.map +1 -1
- package/dist/contracts/genre/genre.js.map +1 -1
- package/dist/contracts/{miso_pressing → miso_record}/deps/std/type_name.d.ts +1 -1
- package/dist/contracts/miso_record/deps/std/type_name.d.ts.map +1 -0
- package/dist/contracts/miso_record/deps/std/type_name.js.map +1 -0
- package/dist/contracts/miso_record/deps/sui/vec_set.d.ts +21 -0
- package/dist/contracts/miso_record/deps/sui/vec_set.d.ts.map +1 -0
- package/dist/contracts/miso_record/deps/sui/vec_set.js +20 -0
- package/dist/contracts/miso_record/deps/sui/vec_set.js.map +1 -0
- package/dist/contracts/miso_record/pressing.d.ts +327 -0
- package/dist/contracts/miso_record/pressing.d.ts.map +1 -0
- package/dist/contracts/miso_record/pressing.js +345 -0
- package/dist/contracts/miso_record/pressing.js.map +1 -0
- package/dist/contracts/miso_record/record.d.ts +190 -0
- package/dist/contracts/miso_record/record.d.ts.map +1 -0
- package/dist/contracts/miso_record/record.js +226 -0
- package/dist/contracts/miso_record/record.js.map +1 -0
- package/dist/contracts/miso_record_shop/deps/std/type_name.d.ts +18 -0
- package/dist/contracts/miso_record_shop/deps/std/type_name.d.ts.map +1 -0
- package/dist/contracts/miso_record_shop/deps/std/type_name.js +20 -0
- package/dist/contracts/miso_record_shop/deps/std/type_name.js.map +1 -0
- package/dist/contracts/miso_record_shop/listing.d.ts +387 -0
- package/dist/contracts/miso_record_shop/listing.d.ts.map +1 -0
- package/dist/contracts/miso_record_shop/listing.js +380 -0
- package/dist/contracts/miso_record_shop/listing.js.map +1 -0
- package/dist/contracts/{release_revenue_distributor → miso_record_shop}/witness.d.ts +2 -2
- package/dist/contracts/miso_record_shop/witness.d.ts.map +1 -0
- package/dist/contracts/{release_revenue_distributor → miso_record_shop}/witness.js +2 -2
- package/dist/contracts/miso_record_shop/witness.js.map +1 -0
- package/dist/contracts/party_wallet/party_wallet.d.ts +41 -168
- package/dist/contracts/party_wallet/party_wallet.d.ts.map +1 -1
- package/dist/contracts/party_wallet/party_wallet.js +27 -152
- package/dist/contracts/party_wallet/party_wallet.js.map +1 -1
- package/dist/contracts/recording_advisory/recording_advisory.d.ts +3 -3
- package/dist/contracts/recording_advisory/recording_advisory.d.ts.map +1 -1
- package/dist/contracts/recording_advisory/recording_advisory.js.map +1 -1
- package/dist/contracts/recording_credits/deps/miso_credit/credit.d.ts.map +1 -1
- package/dist/contracts/recording_credits/deps/miso_credit/credit.js.map +1 -1
- package/dist/contracts/recording_credits/deps/sui/vec_map.d.ts.map +1 -1
- package/dist/contracts/recording_credits/deps/sui/vec_map.js.map +1 -1
- package/dist/contracts/recording_credits/deps/sui/vec_set.d.ts.map +1 -1
- package/dist/contracts/recording_credits/deps/sui/vec_set.js.map +1 -1
- package/dist/contracts/recording_credits/recording_credits.d.ts +20 -20
- package/dist/contracts/recording_credits/recording_credits.d.ts.map +1 -1
- package/dist/contracts/recording_credits/recording_credits.js.map +1 -1
- package/dist/contracts/recording_credits/recording_party_role.d.ts +30 -30
- package/dist/contracts/recording_credits/recording_party_role.d.ts.map +1 -1
- package/dist/contracts/recording_credits/recording_party_role.js.map +1 -1
- package/dist/contracts/recording_language/deps/language_code/language_code.d.ts +1 -1
- package/dist/contracts/recording_language/deps/language_code/language_code.d.ts.map +1 -1
- package/dist/contracts/recording_language/deps/language_code/language_code.js.map +1 -1
- package/dist/contracts/recording_language/recording_language.d.ts +4 -4
- package/dist/contracts/recording_language/recording_language.d.ts.map +1 -1
- package/dist/contracts/recording_language/recording_language.js.map +1 -1
- package/dist/contracts/recording_master_reference/deps/ori/walrus_data.d.ts +4 -4
- package/dist/contracts/recording_master_reference/deps/ori/walrus_data.d.ts.map +1 -1
- package/dist/contracts/recording_master_reference/deps/ori/walrus_data.js.map +1 -1
- package/dist/contracts/recording_master_reference/recording_master_reference.d.ts +6 -6
- package/dist/contracts/recording_master_reference/recording_master_reference.d.ts.map +1 -1
- package/dist/contracts/recording_master_reference/recording_master_reference.js.map +1 -1
- package/dist/contracts/recording_preview/deps/ori/walrus_data.d.ts +4 -4
- package/dist/contracts/recording_preview/deps/ori/walrus_data.d.ts.map +1 -1
- package/dist/contracts/recording_preview/deps/ori/walrus_data.js.map +1 -1
- package/dist/contracts/recording_preview/recording_preview.d.ts +6 -6
- package/dist/contracts/recording_preview/recording_preview.d.ts.map +1 -1
- package/dist/contracts/recording_preview/recording_preview.js.map +1 -1
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.d.ts +21 -109
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.d.ts.map +1 -1
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.js +15 -100
- 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 +92 -0
- package/dist/contracts/recording_royalty_pool_plugin/recording_royalty_pool_plugin.d.ts.map +1 -0
- package/dist/contracts/recording_royalty_pool_plugin/recording_royalty_pool_plugin.js +85 -0
- package/dist/contracts/recording_royalty_pool_plugin/recording_royalty_pool_plugin.js.map +1 -0
- package/dist/contracts/{composition_royalty_pool → recording_royalty_pool_plugin}/witness.d.ts +1 -1
- package/dist/contracts/recording_royalty_pool_plugin/witness.d.ts.map +1 -0
- package/dist/contracts/{party_wallet → recording_royalty_pool_plugin}/witness.js +1 -1
- package/dist/contracts/recording_royalty_pool_plugin/witness.js.map +1 -0
- package/dist/contracts/release_cover_art/deps/{0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78 → 0xf35cf353a62cef01084b51a9cf3da4c64c8724685ad1862f2f8284b71bd26c1a}/walrus_data.d.ts +7 -7
- package/dist/contracts/release_cover_art/deps/{0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78 → 0xf35cf353a62cef01084b51a9cf3da4c64c8724685ad1862f2f8284b71bd26c1a}/walrus_data.d.ts.map +1 -1
- package/dist/contracts/release_cover_art/deps/{0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78 → 0xf35cf353a62cef01084b51a9cf3da4c64c8724685ad1862f2f8284b71bd26c1a}/walrus_data.js +1 -1
- package/dist/contracts/release_cover_art/deps/{0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78 → 0xf35cf353a62cef01084b51a9cf3da4c64c8724685ad1862f2f8284b71bd26c1a}/walrus_data.js.map +1 -1
- package/dist/contracts/release_cover_art/deps/cover_art/cover_art.d.ts +7 -7
- package/dist/contracts/release_cover_art/deps/cover_art/cover_art.d.ts.map +1 -1
- package/dist/contracts/release_cover_art/deps/cover_art/cover_art.js +1 -1
- package/dist/contracts/release_cover_art/deps/cover_art/cover_art.js.map +1 -1
- package/dist/contracts/release_cover_art/deps/per_track/per_track.d.ts.map +1 -1
- package/dist/contracts/release_cover_art/deps/per_track/per_track.js.map +1 -1
- package/dist/contracts/release_cover_art/release_cover_art.d.ts +23 -23
- package/dist/contracts/release_cover_art/release_cover_art.d.ts.map +1 -1
- package/dist/contracts/release_cover_art/release_cover_art.js.map +1 -1
- package/dist/contracts/release_credits/deps/miso_credit/credit.d.ts.map +1 -1
- package/dist/contracts/release_credits/deps/miso_credit/credit.js.map +1 -1
- package/dist/contracts/release_credits/deps/sui/vec_map.d.ts.map +1 -1
- package/dist/contracts/release_credits/deps/sui/vec_map.js.map +1 -1
- package/dist/contracts/release_credits/release_credits.d.ts +10 -10
- package/dist/contracts/release_credits/release_credits.d.ts.map +1 -1
- package/dist/contracts/release_credits/release_credits.js.map +1 -1
- package/dist/contracts/release_description/release_description.d.ts +4 -4
- package/dist/contracts/release_description/release_description.d.ts.map +1 -1
- package/dist/contracts/release_description/release_description.js.map +1 -1
- package/dist/contracts/release_dsp_link/release_dsp_link.d.ts +41 -42
- package/dist/contracts/release_dsp_link/release_dsp_link.d.ts.map +1 -1
- package/dist/contracts/release_dsp_link/release_dsp_link.js +4 -5
- package/dist/contracts/release_dsp_link/release_dsp_link.js.map +1 -1
- package/dist/contracts/release_genre/deps/per_track/per_track.d.ts.map +1 -1
- package/dist/contracts/release_genre/deps/per_track/per_track.js.map +1 -1
- package/dist/contracts/release_genre/release_genre.d.ts +15 -15
- package/dist/contracts/release_genre/release_genre.d.ts.map +1 -1
- package/dist/contracts/release_genre/release_genre.js.map +1 -1
- package/dist/contracts/release_kind/release_kind.d.ts +4 -4
- package/dist/contracts/release_kind/release_kind.d.ts.map +1 -1
- package/dist/contracts/release_kind/release_kind.js.map +1 -1
- package/dist/contracts/release_revenue_distributor/release_revenue_distributor.d.ts +46 -59
- package/dist/contracts/release_revenue_distributor/release_revenue_distributor.d.ts.map +1 -1
- package/dist/contracts/release_revenue_distributor/release_revenue_distributor.js +27 -48
- 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 +75 -0
- package/dist/contracts/release_revenue_distributor_plugin/release_revenue_distributor_plugin.d.ts.map +1 -0
- package/dist/contracts/release_revenue_distributor_plugin/release_revenue_distributor_plugin.js +80 -0
- package/dist/contracts/release_revenue_distributor_plugin/release_revenue_distributor_plugin.js.map +1 -0
- package/dist/contracts/{recording_royalty_pool → release_revenue_distributor_plugin}/witness.d.ts +1 -1
- package/dist/contracts/release_revenue_distributor_plugin/witness.d.ts.map +1 -0
- package/dist/contracts/{composition_royalty_pool → release_revenue_distributor_plugin}/witness.js +1 -1
- package/dist/contracts/release_revenue_distributor_plugin/witness.js.map +1 -0
- package/dist/contracts/routed_stake/deps/royalty_pool/stake.d.ts +5 -5
- package/dist/contracts/routed_stake/deps/royalty_pool/stake.d.ts.map +1 -1
- package/dist/contracts/routed_stake/deps/royalty_pool/stake.js.map +1 -1
- package/dist/contracts/routed_stake/deps/std/type_name.d.ts +1 -1
- package/dist/contracts/routed_stake/deps/std/type_name.d.ts.map +1 -1
- package/dist/contracts/routed_stake/deps/std/type_name.js.map +1 -1
- package/dist/contracts/routed_stake/deps/sui/balance.d.ts +1 -1
- package/dist/contracts/routed_stake/deps/sui/balance.d.ts.map +1 -1
- package/dist/contracts/routed_stake/deps/sui/balance.js.map +1 -1
- package/dist/contracts/routed_stake/deps/sui/vec_map.d.ts.map +1 -1
- package/dist/contracts/routed_stake/deps/sui/vec_map.js.map +1 -1
- package/dist/contracts/routed_stake/routed_stake.d.ts +15 -15
- package/dist/contracts/routed_stake/routed_stake.d.ts.map +1 -1
- package/dist/contracts/routed_stake/routed_stake.js.map +1 -1
- package/dist/contracts/royalty_pool/deps/std/type_name.d.ts +1 -1
- package/dist/contracts/royalty_pool/deps/std/type_name.d.ts.map +1 -1
- package/dist/contracts/royalty_pool/deps/std/type_name.js.map +1 -1
- package/dist/contracts/royalty_pool/deps/sui/balance.d.ts +1 -1
- package/dist/contracts/royalty_pool/deps/sui/balance.d.ts.map +1 -1
- package/dist/contracts/royalty_pool/deps/sui/balance.js.map +1 -1
- package/dist/contracts/royalty_pool/deps/sui/vec_map.d.ts.map +1 -1
- package/dist/contracts/royalty_pool/deps/sui/vec_map.js.map +1 -1
- package/dist/contracts/royalty_pool/pool.d.ts +19 -19
- package/dist/contracts/royalty_pool/pool.d.ts.map +1 -1
- package/dist/contracts/royalty_pool/pool.js.map +1 -1
- package/dist/contracts/royalty_pool/stake.d.ts +9 -9
- package/dist/contracts/royalty_pool/stake.d.ts.map +1 -1
- package/dist/contracts/royalty_pool/stake.js.map +1 -1
- package/dist/contracts/vault/deps/sui/bag.d.ts +2 -2
- package/dist/contracts/vault/deps/sui/bag.d.ts.map +1 -1
- package/dist/contracts/vault/deps/sui/bag.js.map +1 -1
- package/dist/contracts/vault/deps/sui/borrow.d.ts.map +1 -1
- package/dist/contracts/vault/deps/sui/borrow.js.map +1 -1
- package/dist/contracts/vault/vault.d.ts +19 -93
- package/dist/contracts/vault/vault.d.ts.map +1 -1
- package/dist/contracts/vault/vault.js +16 -95
- package/dist/contracts/vault/vault.js.map +1 -1
- package/dist/contracts.d.ts +6 -3
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js +9 -5
- package/dist/contracts.js.map +1 -1
- package/dist/deployments.d.ts +156 -77
- package/dist/deployments.d.ts.map +1 -1
- package/dist/deployments.js +146 -32
- package/dist/deployments.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/internal.d.ts +9 -0
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +23 -0
- package/dist/internal.js.map +1 -1
- package/dist/mix.d.ts +144 -0
- package/dist/mix.d.ts.map +1 -0
- package/dist/mix.js +656 -0
- package/dist/mix.js.map +1 -0
- package/dist/pressing.d.ts +72 -156
- package/dist/pressing.d.ts.map +1 -1
- package/dist/pressing.js +269 -261
- package/dist/pressing.js.map +1 -1
- package/dist/publication.d.ts +6 -6
- package/dist/publication.d.ts.map +1 -1
- package/dist/publication.js +134 -90
- package/dist/publication.js.map +1 -1
- package/dist/read/catalog.d.ts +8 -5
- package/dist/read/catalog.d.ts.map +1 -1
- package/dist/read/catalog.js +47 -35
- package/dist/read/catalog.js.map +1 -1
- package/dist/read/config.d.ts +6 -4
- package/dist/read/config.d.ts.map +1 -1
- package/dist/read/config.js +10 -3
- package/dist/read/config.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 +1 -1
- package/dist/read/index.js.map +1 -1
- package/dist/read/internal/scalars.d.ts.map +1 -1
- package/dist/read/internal/scalars.js +4 -3
- package/dist/read/internal/scalars.js.map +1 -1
- package/dist/read/internal/walrus.d.ts.map +1 -1
- package/dist/read/internal/walrus.js +2 -1
- package/dist/read/internal/walrus.js.map +1 -1
- package/dist/read/receipts.d.ts +21 -12
- package/dist/read/receipts.d.ts.map +1 -1
- package/dist/read/receipts.js +159 -56
- package/dist/read/receipts.js.map +1 -1
- package/dist/read/types.d.ts +34 -24
- package/dist/read/types.d.ts.map +1 -1
- package/dist/read/wallet.d.ts.map +1 -1
- package/dist/read/wallet.js +31 -46
- package/dist/read/wallet.js.map +1 -1
- package/dist/vault.d.ts +81 -48
- package/dist/vault.d.ts.map +1 -1
- package/dist/vault.js +173 -174
- package/dist/vault.js.map +1 -1
- package/package.json +17 -7
- package/src/client.ts +618 -120
- package/src/contracts/composition_credits/composition_credits.ts +3 -2
- package/src/contracts/composition_credits/composition_party_role.ts +5 -4
- package/src/contracts/composition_credits/deps/miso_credit/credit.ts +1 -0
- package/src/contracts/composition_credits/deps/sui/vec_map.ts +1 -0
- package/src/contracts/composition_routed_stake/composition_routed_stake.ts +36 -146
- package/src/contracts/composition_royalty_pool/composition_royalty_pool.ts +28 -169
- package/src/contracts/composition_royalty_pool_plugin/composition_royalty_pool_plugin.ts +165 -0
- package/src/contracts/{recording_royalty_pool → composition_royalty_pool_plugin}/witness.ts +2 -1
- package/src/contracts/cover_art/cover_art.ts +2 -1
- package/src/contracts/cover_art/deps/ori/walrus_data.ts +1 -0
- package/src/contracts/genre/genre.ts +3 -2
- package/src/contracts/{miso_pressing → miso_record}/deps/std/type_name.ts +1 -0
- package/src/contracts/miso_record/deps/sui/vec_set.ts +22 -0
- package/src/contracts/miso_record/pressing.ts +523 -0
- package/src/contracts/miso_record/record.ts +339 -0
- package/src/contracts/miso_record_shop/deps/std/type_name.ts +23 -0
- package/src/contracts/miso_record_shop/listing.ts +603 -0
- package/src/contracts/{release_revenue_distributor → miso_record_shop}/witness.ts +3 -2
- package/src/contracts/party_wallet/party_wallet.ts +41 -256
- package/src/contracts/recording_advisory/recording_advisory.ts +4 -3
- package/src/contracts/recording_credits/deps/miso_credit/credit.ts +1 -0
- package/src/contracts/recording_credits/deps/sui/vec_map.ts +1 -0
- package/src/contracts/recording_credits/deps/sui/vec_set.ts +1 -0
- package/src/contracts/recording_credits/recording_credits.ts +3 -2
- package/src/contracts/recording_credits/recording_party_role.ts +5 -4
- package/src/contracts/recording_language/deps/language_code/language_code.ts +1 -0
- package/src/contracts/recording_language/recording_language.ts +5 -4
- package/src/contracts/recording_master_reference/deps/ori/walrus_data.ts +1 -0
- package/src/contracts/recording_master_reference/recording_master_reference.ts +6 -5
- package/src/contracts/recording_preview/deps/ori/walrus_data.ts +1 -0
- package/src/contracts/recording_preview/recording_preview.ts +2 -1
- package/src/contracts/recording_royalty_pool/recording_royalty_pool.ts +27 -172
- package/src/contracts/recording_royalty_pool_plugin/recording_royalty_pool_plugin.ts +167 -0
- package/src/contracts/{party_wallet → recording_royalty_pool_plugin}/witness.ts +2 -1
- package/src/contracts/release_cover_art/deps/{0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78 → 0xf35cf353a62cef01084b51a9cf3da4c64c8724685ad1862f2f8284b71bd26c1a}/walrus_data.ts +2 -1
- package/src/contracts/release_cover_art/deps/cover_art/cover_art.ts +3 -2
- package/src/contracts/release_cover_art/deps/per_track/per_track.ts +3 -2
- package/src/contracts/release_cover_art/release_cover_art.ts +2 -1
- package/src/contracts/release_credits/deps/miso_credit/credit.ts +1 -0
- package/src/contracts/release_credits/deps/sui/vec_map.ts +1 -0
- package/src/contracts/release_credits/release_credits.ts +4 -3
- package/src/contracts/release_credits/release_party_role.ts +4 -4
- package/src/contracts/release_description/release_description.ts +6 -5
- package/src/contracts/release_dsp_link/release_dsp_link.ts +8 -8
- package/src/contracts/release_genre/deps/per_track/per_track.ts +3 -2
- package/src/contracts/release_genre/release_genre.ts +4 -3
- package/src/contracts/release_kind/release_kind.ts +5 -4
- package/src/contracts/release_revenue_distributor/release_revenue_distributor.ts +50 -85
- package/src/contracts/release_revenue_distributor_plugin/release_revenue_distributor_plugin.ts +145 -0
- package/src/contracts/{composition_royalty_pool → release_revenue_distributor_plugin}/witness.ts +2 -1
- package/src/contracts/routed_stake/deps/royalty_pool/stake.ts +1 -0
- package/src/contracts/routed_stake/deps/std/type_name.ts +1 -0
- package/src/contracts/routed_stake/deps/sui/balance.ts +1 -0
- package/src/contracts/routed_stake/deps/sui/vec_map.ts +1 -0
- package/src/contracts/routed_stake/routed_stake.ts +4 -3
- package/src/contracts/royalty_pool/deps/std/type_name.ts +1 -0
- package/src/contracts/royalty_pool/deps/sui/balance.ts +1 -0
- package/src/contracts/royalty_pool/deps/sui/vec_map.ts +1 -0
- package/src/contracts/royalty_pool/pool.ts +1 -0
- package/src/contracts/royalty_pool/stake.ts +1 -0
- package/src/contracts/vault/deps/sui/bag.ts +3 -2
- package/src/contracts/vault/deps/sui/borrow.ts +2 -1
- package/src/contracts/vault/vault.ts +27 -152
- package/src/contracts.ts +9 -5
- package/src/deployments.ts +273 -55
- package/src/index.ts +5 -0
- package/src/internal.ts +27 -0
- package/src/mix.ts +910 -0
- package/src/pressing.ts +428 -423
- package/src/publication.ts +148 -101
- package/src/read/catalog.ts +49 -34
- package/src/read/config.ts +19 -8
- package/src/read/index.ts +9 -1
- package/src/read/internal/scalars.ts +4 -2
- package/src/read/internal/walrus.ts +2 -1
- package/src/read/receipts.ts +181 -66
- package/src/read/types.ts +35 -22
- package/src/read/wallet.ts +29 -50
- package/src/vault.ts +275 -271
- package/dist/contracts/composition_routed_stake/witness.d.ts +0 -7
- package/dist/contracts/composition_routed_stake/witness.d.ts.map +0 -1
- package/dist/contracts/composition_routed_stake/witness.js +0 -9
- package/dist/contracts/composition_routed_stake/witness.js.map +0 -1
- package/dist/contracts/composition_royalty_pool/witness.d.ts.map +0 -1
- package/dist/contracts/composition_royalty_pool/witness.js.map +0 -1
- package/dist/contracts/miso_pressing/certificate.d.ts +0 -89
- package/dist/contracts/miso_pressing/certificate.d.ts.map +0 -1
- package/dist/contracts/miso_pressing/certificate.js +0 -108
- package/dist/contracts/miso_pressing/certificate.js.map +0 -1
- package/dist/contracts/miso_pressing/deps/std/type_name.d.ts.map +0 -1
- package/dist/contracts/miso_pressing/deps/std/type_name.js.map +0 -1
- package/dist/contracts/miso_pressing/listing.d.ts +0 -434
- package/dist/contracts/miso_pressing/listing.d.ts.map +0 -1
- package/dist/contracts/miso_pressing/listing.js +0 -401
- package/dist/contracts/miso_pressing/listing.js.map +0 -1
- package/dist/contracts/miso_pressing/pressing.d.ts +0 -334
- package/dist/contracts/miso_pressing/pressing.d.ts.map +0 -1
- package/dist/contracts/miso_pressing/pressing.js +0 -298
- package/dist/contracts/miso_pressing/pressing.js.map +0 -1
- package/dist/contracts/party_wallet/witness.d.ts.map +0 -1
- package/dist/contracts/party_wallet/witness.js.map +0 -1
- package/dist/contracts/recording_royalty_pool/witness.d.ts.map +0 -1
- package/dist/contracts/recording_royalty_pool/witness.js.map +0 -1
- package/dist/contracts/release_revenue_distributor/witness.d.ts.map +0 -1
- package/dist/contracts/release_revenue_distributor/witness.js.map +0 -1
- package/src/contracts/composition_routed_stake/witness.ts +0 -11
- package/src/contracts/miso_pressing/certificate.ts +0 -164
- package/src/contracts/miso_pressing/listing.ts +0 -592
- package/src/contracts/miso_pressing/pressing.ts +0 -399
- /package/dist/contracts/{miso_pressing → miso_record}/deps/std/type_name.js +0 -0
package/src/vault.ts
CHANGED
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* Capability custody and
|
|
5
|
+
* Capability custody, raw-cap Action, and safe crank-plugin transaction builders.
|
|
6
6
|
*
|
|
7
7
|
* A direct admin cap remains supported for existing works. New work should give
|
|
8
8
|
* the owner a `VaultAdminCap<AdminCap>` and keep the raw admin cap inside the
|
|
9
9
|
* shared Vault. Every authorized call borrows and returns the raw cap inside
|
|
10
10
|
* one helper; borrowed capabilities are never exposed to application code.
|
|
11
|
+
* Party wallet and routed-stake operations remain Actions because their useful
|
|
12
|
+
* results must stay under the caller's control.
|
|
11
13
|
*/
|
|
12
14
|
|
|
13
15
|
import type { BcsType } from "@mysten/sui/bcs";
|
|
@@ -19,17 +21,19 @@ import type {
|
|
|
19
21
|
} from "@mysten/sui/transactions";
|
|
20
22
|
import { deriveObjectID, normalizeStructTag } from "@mysten/sui/utils";
|
|
21
23
|
import * as vault from "./contracts/vault/vault.ts";
|
|
22
|
-
import * as compositionRoyaltyPool from "./contracts/composition_royalty_pool/composition_royalty_pool.ts";
|
|
23
|
-
import * as recordingRoyaltyPool from "./contracts/recording_royalty_pool/recording_royalty_pool.ts";
|
|
24
|
-
import * as partyWallet from "./contracts/party_wallet/party_wallet.ts";
|
|
25
|
-
import * as compositionRoutedStake from "./contracts/composition_routed_stake/composition_routed_stake.ts";
|
|
26
24
|
import * as releaseRevenueDistributor from "./contracts/release_revenue_distributor/release_revenue_distributor.ts";
|
|
25
|
+
import * as compositionRoyaltyPoolPlugin from "./contracts/composition_royalty_pool_plugin/composition_royalty_pool_plugin.ts";
|
|
26
|
+
import * as recordingRoyaltyPoolPlugin from "./contracts/recording_royalty_pool_plugin/recording_royalty_pool_plugin.ts";
|
|
27
|
+
import * as releaseRevenueDistributorPlugin from "./contracts/release_revenue_distributor_plugin/release_revenue_distributor_plugin.ts";
|
|
27
28
|
import * as routedStake from "./contracts/routed_stake/routed_stake.ts";
|
|
28
29
|
|
|
29
30
|
/** A legacy work whose raw protocol admin cap is still address-owned. */
|
|
30
31
|
/** An object id resolved lazily when a transaction thunk is applied. */
|
|
31
32
|
export type ObjectInput = string | TransactionObjectArgument;
|
|
32
33
|
|
|
34
|
+
/** The framework singleton read by `balance::settled_funds_value`. */
|
|
35
|
+
export const SUI_ACCUMULATOR_ROOT_OBJECT_ID = "0xacc";
|
|
36
|
+
|
|
33
37
|
function object(tx: Transaction, value: ObjectInput): TransactionObjectArgument {
|
|
34
38
|
return typeof value === "string" ? tx.object(value) : value;
|
|
35
39
|
}
|
|
@@ -229,7 +233,7 @@ export function restoreVaultCapability(
|
|
|
229
233
|
}));
|
|
230
234
|
}
|
|
231
235
|
|
|
232
|
-
/** Transfer the key
|
|
236
|
+
/** Transfer the `key + store` VaultAdminCap to its next owner. */
|
|
233
237
|
export function transferVaultAdminCap(
|
|
234
238
|
tx: Transaction,
|
|
235
239
|
params: {
|
|
@@ -239,15 +243,11 @@ export function transferVaultAdminCap(
|
|
|
239
243
|
readonly vaultPackageId: string;
|
|
240
244
|
},
|
|
241
245
|
): void {
|
|
242
|
-
tx.
|
|
243
|
-
package: params.vaultPackageId,
|
|
244
|
-
typeArguments: [params.capType],
|
|
245
|
-
arguments: [object(tx, params.vaultAdminCap), params.owner],
|
|
246
|
-
}));
|
|
246
|
+
tx.transferObjects([object(tx, params.vaultAdminCap)], params.owner);
|
|
247
247
|
}
|
|
248
248
|
|
|
249
249
|
/**
|
|
250
|
-
* Custody a freshly-created raw admin cap, optionally
|
|
250
|
+
* Custody a freshly-created raw admin cap, optionally configure it, share the
|
|
251
251
|
* Vault, then transfer only the VaultAdminCap to its owner.
|
|
252
252
|
*/
|
|
253
253
|
export function custodyNewAdminCap(
|
|
@@ -323,7 +323,7 @@ export function installCompositionRoyaltyPoolPlugin(
|
|
|
323
323
|
params: CompositionRoyaltyPoolPluginParams,
|
|
324
324
|
): void {
|
|
325
325
|
tx.add(
|
|
326
|
-
|
|
326
|
+
compositionRoyaltyPoolPlugin.install({
|
|
327
327
|
package: params.pluginPackageId,
|
|
328
328
|
typeArguments: [params.compositionShareType],
|
|
329
329
|
arguments: [params.vault, params.vaultAdminCap],
|
|
@@ -335,48 +335,40 @@ export function uninstallCompositionRoyaltyPoolPlugin(
|
|
|
335
335
|
tx: Transaction,
|
|
336
336
|
params: CompositionRoyaltyPoolPluginParams,
|
|
337
337
|
): void {
|
|
338
|
-
tx.add(
|
|
338
|
+
tx.add(
|
|
339
|
+
compositionRoyaltyPoolPlugin.uninstall({
|
|
340
|
+
package: params.pluginPackageId,
|
|
341
|
+
typeArguments: [params.compositionShareType],
|
|
342
|
+
arguments: [params.vault, params.vaultAdminCap],
|
|
343
|
+
}),
|
|
344
|
+
);
|
|
339
345
|
}
|
|
340
346
|
|
|
341
|
-
export interface
|
|
342
|
-
|
|
347
|
+
export interface NewCompositionRoyaltyPoolParams {
|
|
348
|
+
readonly authority: AdminCapAuthority;
|
|
343
349
|
readonly composition: TransactionObjectArgument;
|
|
350
|
+
readonly actionPackageId: string;
|
|
344
351
|
readonly currencyType: string;
|
|
352
|
+
readonly compositionShareType: string;
|
|
345
353
|
}
|
|
346
354
|
|
|
347
355
|
/** Create the canonical pool without sharing it so callers can configure fresh stakes first. */
|
|
348
356
|
export function newCompositionRoyaltyPool(
|
|
349
357
|
tx: Transaction,
|
|
350
|
-
params:
|
|
358
|
+
params: NewCompositionRoyaltyPoolParams,
|
|
351
359
|
): TransactionObjectArgument {
|
|
352
|
-
return tx.
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
);
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
/** Create and immediately share the canonical Composition royalty pool. */
|
|
362
|
-
export function initializeCompositionRoyaltyPool(
|
|
363
|
-
tx: Transaction,
|
|
364
|
-
params: InitializeCompositionRoyaltyPoolParams,
|
|
365
|
-
): void {
|
|
366
|
-
tx.add(
|
|
367
|
-
compositionRoyaltyPool.initializePool({
|
|
368
|
-
package: params.pluginPackageId,
|
|
369
|
-
typeArguments: [params.compositionShareType, params.currencyType],
|
|
370
|
-
arguments: [params.vault, params.composition, params.vaultAdminCap],
|
|
371
|
-
}),
|
|
372
|
-
);
|
|
360
|
+
return invokeWithAdminCap(tx, params.authority, {
|
|
361
|
+
target: `${params.actionPackageId}::composition_royalty_pool::new_pool`,
|
|
362
|
+
typeArguments: [params.compositionShareType, params.currencyType],
|
|
363
|
+
arguments: [params.composition],
|
|
364
|
+
adminCapIndex: 1,
|
|
365
|
+
});
|
|
373
366
|
}
|
|
374
367
|
|
|
375
368
|
export interface CompositionRoyaltyPoolCrankParams {
|
|
376
369
|
readonly vault: TransactionObjectArgument;
|
|
377
370
|
readonly composition: TransactionObjectArgument;
|
|
378
371
|
readonly pool: TransactionObjectArgument;
|
|
379
|
-
readonly accumulatorRoot: TransactionObjectArgument;
|
|
380
372
|
readonly compositionShareType: string;
|
|
381
373
|
readonly currencyType: string;
|
|
382
374
|
readonly pluginPackageId: string;
|
|
@@ -385,6 +377,9 @@ export interface CompositionRoyaltyPoolCrankParams {
|
|
|
385
377
|
/** JSON-safe input for an on-chain u64. Numbers are rejected to prevent rounding. */
|
|
386
378
|
export type U64Input = bigint | string | number;
|
|
387
379
|
|
|
380
|
+
/** An exact scalar or the result of an earlier PTB command returning `u64`. */
|
|
381
|
+
export type U64Argument = U64Input | TransactionArgument;
|
|
382
|
+
|
|
388
383
|
/** Validate an SDK scalar before serializing it as a Move u64. */
|
|
389
384
|
export function asU64(name: string, value: U64Input): bigint {
|
|
390
385
|
if (typeof value === "number" && (!Number.isSafeInteger(value) || value < 0)) {
|
|
@@ -400,27 +395,86 @@ export function asU64(name: string, value: U64Input): bigint {
|
|
|
400
395
|
return parsed;
|
|
401
396
|
}
|
|
402
397
|
|
|
403
|
-
|
|
404
|
-
|
|
398
|
+
function asU64Argument(tx: Transaction, name: string, value: U64Argument): TransactionArgument {
|
|
399
|
+
if (
|
|
400
|
+
typeof value === "bigint" ||
|
|
401
|
+
typeof value === "string" ||
|
|
402
|
+
typeof value === "number"
|
|
403
|
+
) {
|
|
404
|
+
return tx.pure.u64(asU64(name, value));
|
|
405
|
+
}
|
|
406
|
+
return value;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
/** Read the commit-settled accumulator balance for an address inside this PTB. */
|
|
410
|
+
export function settledFundsValue(
|
|
411
|
+
tx: Transaction,
|
|
412
|
+
params: {
|
|
413
|
+
readonly address: string | TransactionArgument;
|
|
414
|
+
readonly currencyType: string;
|
|
415
|
+
readonly accumulatorRoot?: ObjectInput;
|
|
416
|
+
},
|
|
417
|
+
): TransactionArgument {
|
|
418
|
+
return tx.moveCall({
|
|
419
|
+
target: "0x2::balance::settled_funds_value",
|
|
420
|
+
typeArguments: [params.currencyType],
|
|
421
|
+
arguments: [
|
|
422
|
+
object(tx, params.accumulatorRoot ?? SUI_ACCUMULATOR_ROOT_OBJECT_ID),
|
|
423
|
+
typeof params.address === "string"
|
|
424
|
+
? tx.pure.address(params.address)
|
|
425
|
+
: params.address,
|
|
426
|
+
],
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
/** Permissionless crank: redeem an exact Composition amount into its pool. */
|
|
431
|
+
export function redeemAndDepositCompositionRoyaltyPool(
|
|
405
432
|
tx: Transaction,
|
|
406
|
-
params: CompositionRoyaltyPoolCrankParams
|
|
433
|
+
params: CompositionRoyaltyPoolCrankParams & {
|
|
434
|
+
readonly value: U64Argument;
|
|
435
|
+
},
|
|
407
436
|
): void {
|
|
408
437
|
tx.add(
|
|
409
|
-
|
|
438
|
+
compositionRoyaltyPoolPlugin.redeemAndDeposit({
|
|
410
439
|
package: params.pluginPackageId,
|
|
411
440
|
typeArguments: [params.compositionShareType, params.currencyType],
|
|
412
|
-
arguments: [
|
|
441
|
+
arguments: [
|
|
442
|
+
params.vault,
|
|
443
|
+
params.composition,
|
|
444
|
+
params.pool,
|
|
445
|
+
asU64Argument(tx, "value", params.value),
|
|
446
|
+
],
|
|
413
447
|
}),
|
|
414
448
|
);
|
|
415
449
|
}
|
|
416
450
|
|
|
451
|
+
/** Redeem exactly the framework-reported settled Composition funds. */
|
|
452
|
+
export function settleCompositionRoyaltyPool(
|
|
453
|
+
tx: Transaction,
|
|
454
|
+
params: Omit<CompositionRoyaltyPoolCrankParams, "composition"> & {
|
|
455
|
+
readonly compositionId: string;
|
|
456
|
+
readonly accumulatorRoot?: ObjectInput;
|
|
457
|
+
},
|
|
458
|
+
): void {
|
|
459
|
+
const value = settledFundsValue(tx, {
|
|
460
|
+
address: params.compositionId,
|
|
461
|
+
currencyType: params.currencyType,
|
|
462
|
+
accumulatorRoot: params.accumulatorRoot,
|
|
463
|
+
});
|
|
464
|
+
redeemAndDepositCompositionRoyaltyPool(tx, {
|
|
465
|
+
...params,
|
|
466
|
+
composition: tx.object(params.compositionId),
|
|
467
|
+
value,
|
|
468
|
+
});
|
|
469
|
+
}
|
|
470
|
+
|
|
417
471
|
/** Permissionless crank: receive selected Composition-owned coins into the pool. */
|
|
418
472
|
export function receiveCompositionRoyaltyPool(
|
|
419
473
|
tx: Transaction,
|
|
420
474
|
params: CompositionRoyaltyPoolCrankParams & { readonly coins: readonly ReceivingObjectRef[] },
|
|
421
475
|
): void {
|
|
422
476
|
tx.add(
|
|
423
|
-
|
|
477
|
+
compositionRoyaltyPoolPlugin.receiveAndDeposit({
|
|
424
478
|
package: params.pluginPackageId,
|
|
425
479
|
typeArguments: [params.compositionShareType, params.currencyType],
|
|
426
480
|
arguments: [
|
|
@@ -446,7 +500,7 @@ export function installRecordingRoyaltyPoolPlugin(
|
|
|
446
500
|
params: RecordingRoyaltyPoolPluginParams,
|
|
447
501
|
): void {
|
|
448
502
|
tx.add(
|
|
449
|
-
|
|
503
|
+
recordingRoyaltyPoolPlugin.install({
|
|
450
504
|
package: params.pluginPackageId,
|
|
451
505
|
typeArguments: [params.recordingShareType],
|
|
452
506
|
arguments: [params.vault, params.vaultAdminCap],
|
|
@@ -454,40 +508,11 @@ export function installRecordingRoyaltyPoolPlugin(
|
|
|
454
508
|
);
|
|
455
509
|
}
|
|
456
510
|
|
|
457
|
-
export interface
|
|
458
|
-
readonly
|
|
459
|
-
readonly vaultAdminCap: TransactionObjectArgument;
|
|
460
|
-
readonly pluginPackageId: string;
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
/** Install the Party wallet plugin; its canonical witness stays internal. */
|
|
464
|
-
export function installPartyWalletPlugin(
|
|
465
|
-
tx: Transaction,
|
|
466
|
-
params: PartyWalletPluginParams,
|
|
467
|
-
): void {
|
|
468
|
-
tx.add(
|
|
469
|
-
partyWallet.install({
|
|
470
|
-
package: params.pluginPackageId,
|
|
471
|
-
arguments: [params.vault, params.vaultAdminCap],
|
|
472
|
-
}),
|
|
473
|
-
);
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
export function uninstallPartyWalletPlugin(
|
|
477
|
-
tx: Transaction,
|
|
478
|
-
params: PartyWalletPluginParams,
|
|
479
|
-
): void {
|
|
480
|
-
tx.add(
|
|
481
|
-
partyWallet.uninstall({
|
|
482
|
-
package: params.pluginPackageId,
|
|
483
|
-
arguments: [params.vault, params.vaultAdminCap],
|
|
484
|
-
}),
|
|
485
|
-
);
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
export interface PartyWalletFundsParams extends PartyWalletPluginParams {
|
|
511
|
+
export interface PartyWalletFundsParams {
|
|
512
|
+
readonly authority: AdminCapAuthority;
|
|
489
513
|
readonly party: TransactionObjectArgument;
|
|
490
514
|
readonly currencyType: string;
|
|
515
|
+
readonly actionPackageId: string;
|
|
491
516
|
}
|
|
492
517
|
|
|
493
518
|
/** Receive selected Party-owned coins and return their merged Balance. */
|
|
@@ -495,145 +520,148 @@ export function receivePartyWalletBalance(
|
|
|
495
520
|
tx: Transaction,
|
|
496
521
|
params: PartyWalletFundsParams & { readonly coins: readonly ReceivingObjectRef[] },
|
|
497
522
|
): TransactionArgument {
|
|
498
|
-
return tx.
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
params.party,
|
|
505
|
-
params.vaultAdminCap,
|
|
506
|
-
receivingCoins(tx, params.currencyType, params.coins),
|
|
507
|
-
],
|
|
508
|
-
}),
|
|
509
|
-
);
|
|
523
|
+
return invokeWithAdminCap(tx, params.authority, {
|
|
524
|
+
target: `${params.actionPackageId}::party_wallet::receive_balance`,
|
|
525
|
+
typeArguments: [params.currencyType],
|
|
526
|
+
arguments: [params.party, receivingCoins(tx, params.currencyType, params.coins)],
|
|
527
|
+
adminCapIndex: 1,
|
|
528
|
+
});
|
|
510
529
|
}
|
|
511
530
|
|
|
512
531
|
/** Redeem an exact Party accumulator amount and return its Balance. */
|
|
513
532
|
export function redeemPartyWalletBalance(
|
|
514
533
|
tx: Transaction,
|
|
515
|
-
params: PartyWalletFundsParams & { readonly value:
|
|
534
|
+
params: PartyWalletFundsParams & { readonly value: U64Argument },
|
|
516
535
|
): TransactionArgument {
|
|
517
|
-
return tx.
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
params.party,
|
|
524
|
-
params.vaultAdminCap,
|
|
525
|
-
asU64("value", params.value),
|
|
526
|
-
],
|
|
527
|
-
}),
|
|
528
|
-
);
|
|
536
|
+
return invokeWithAdminCap(tx, params.authority, {
|
|
537
|
+
target: `${params.actionPackageId}::party_wallet::redeem_balance`,
|
|
538
|
+
typeArguments: [params.currencyType],
|
|
539
|
+
arguments: [params.party, asU64Argument(tx, "value", params.value)],
|
|
540
|
+
adminCapIndex: 1,
|
|
541
|
+
});
|
|
529
542
|
}
|
|
530
543
|
|
|
531
|
-
/**
|
|
532
|
-
export function
|
|
544
|
+
/** Redeem exactly the framework-reported settled Party funds. */
|
|
545
|
+
export function settlePartyWalletBalance(
|
|
533
546
|
tx: Transaction,
|
|
534
|
-
params: PartyWalletFundsParams & {
|
|
535
|
-
readonly
|
|
547
|
+
params: Omit<PartyWalletFundsParams, "party"> & {
|
|
548
|
+
readonly partyId: string;
|
|
549
|
+
readonly accumulatorRoot?: ObjectInput;
|
|
536
550
|
},
|
|
537
551
|
): TransactionArgument {
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
}),
|
|
549
|
-
);
|
|
552
|
+
const value = settledFundsValue(tx, {
|
|
553
|
+
address: params.partyId,
|
|
554
|
+
currencyType: params.currencyType,
|
|
555
|
+
accumulatorRoot: params.accumulatorRoot,
|
|
556
|
+
});
|
|
557
|
+
return redeemPartyWalletBalance(tx, {
|
|
558
|
+
...params,
|
|
559
|
+
party: tx.object(params.partyId),
|
|
560
|
+
value,
|
|
561
|
+
});
|
|
550
562
|
}
|
|
551
563
|
|
|
552
564
|
export function uninstallRecordingRoyaltyPoolPlugin(
|
|
553
565
|
tx: Transaction,
|
|
554
566
|
params: RecordingRoyaltyPoolPluginParams,
|
|
555
567
|
): void {
|
|
556
|
-
tx.add(
|
|
568
|
+
tx.add(
|
|
569
|
+
recordingRoyaltyPoolPlugin.uninstall({
|
|
570
|
+
package: params.pluginPackageId,
|
|
571
|
+
typeArguments: [params.recordingShareType],
|
|
572
|
+
arguments: [params.vault, params.vaultAdminCap],
|
|
573
|
+
}),
|
|
574
|
+
);
|
|
557
575
|
}
|
|
558
576
|
|
|
559
|
-
export interface
|
|
560
|
-
|
|
577
|
+
export interface NewRecordingRoyaltyPoolParams {
|
|
578
|
+
readonly authority: AdminCapAuthority;
|
|
561
579
|
readonly recording: TransactionObjectArgument;
|
|
580
|
+
readonly actionPackageId: string;
|
|
562
581
|
readonly currencyType: string;
|
|
582
|
+
readonly recordingShareType: string;
|
|
583
|
+
readonly compositionShareType: string;
|
|
563
584
|
}
|
|
564
585
|
|
|
565
586
|
/** Create the canonical pool without sharing it so callers can configure fresh stakes first. */
|
|
566
587
|
export function newRecordingRoyaltyPool(
|
|
567
588
|
tx: Transaction,
|
|
568
|
-
params:
|
|
589
|
+
params: NewRecordingRoyaltyPoolParams,
|
|
569
590
|
): TransactionObjectArgument {
|
|
570
|
-
return tx.
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
);
|
|
581
|
-
}
|
|
582
|
-
|
|
583
|
-
/** Create and immediately share the canonical Recording royalty pool. */
|
|
584
|
-
export function initializeRecordingRoyaltyPool(
|
|
585
|
-
tx: Transaction,
|
|
586
|
-
params: InitializeRecordingRoyaltyPoolParams,
|
|
587
|
-
): void {
|
|
588
|
-
tx.add(
|
|
589
|
-
recordingRoyaltyPool.initializePool({
|
|
590
|
-
package: params.pluginPackageId,
|
|
591
|
-
typeArguments: [
|
|
592
|
-
params.recordingShareType,
|
|
593
|
-
params.compositionShareType,
|
|
594
|
-
params.currencyType,
|
|
595
|
-
],
|
|
596
|
-
arguments: [params.vault, params.recording, params.vaultAdminCap],
|
|
597
|
-
}),
|
|
598
|
-
);
|
|
591
|
+
return invokeWithAdminCap(tx, params.authority, {
|
|
592
|
+
target: `${params.actionPackageId}::recording_royalty_pool::new_pool`,
|
|
593
|
+
typeArguments: [
|
|
594
|
+
params.recordingShareType,
|
|
595
|
+
params.compositionShareType,
|
|
596
|
+
params.currencyType,
|
|
597
|
+
],
|
|
598
|
+
arguments: [params.recording],
|
|
599
|
+
adminCapIndex: 1,
|
|
600
|
+
});
|
|
599
601
|
}
|
|
600
602
|
|
|
601
603
|
export interface RecordingRoyaltyPoolCrankParams {
|
|
602
604
|
readonly vault: TransactionObjectArgument;
|
|
603
605
|
readonly recording: TransactionObjectArgument;
|
|
604
606
|
readonly pool: TransactionObjectArgument;
|
|
605
|
-
readonly accumulatorRoot: TransactionObjectArgument;
|
|
606
607
|
readonly recordingShareType: string;
|
|
607
608
|
readonly compositionShareType: string;
|
|
608
609
|
readonly currencyType: string;
|
|
609
610
|
readonly pluginPackageId: string;
|
|
610
611
|
}
|
|
611
612
|
|
|
612
|
-
/** Permissionless crank:
|
|
613
|
-
export function
|
|
613
|
+
/** Permissionless crank: redeem an exact Recording amount into its pool. */
|
|
614
|
+
export function redeemAndDepositRecordingRoyaltyPool(
|
|
614
615
|
tx: Transaction,
|
|
615
|
-
params: RecordingRoyaltyPoolCrankParams
|
|
616
|
+
params: RecordingRoyaltyPoolCrankParams & {
|
|
617
|
+
readonly value: U64Argument;
|
|
618
|
+
},
|
|
616
619
|
): void {
|
|
617
620
|
tx.add(
|
|
618
|
-
|
|
621
|
+
recordingRoyaltyPoolPlugin.redeemAndDeposit({
|
|
619
622
|
package: params.pluginPackageId,
|
|
620
623
|
typeArguments: [
|
|
621
624
|
params.recordingShareType,
|
|
622
625
|
params.compositionShareType,
|
|
623
626
|
params.currencyType,
|
|
624
627
|
],
|
|
625
|
-
arguments: [
|
|
628
|
+
arguments: [
|
|
629
|
+
params.vault,
|
|
630
|
+
params.recording,
|
|
631
|
+
params.pool,
|
|
632
|
+
asU64Argument(tx, "value", params.value),
|
|
633
|
+
],
|
|
626
634
|
}),
|
|
627
635
|
);
|
|
628
636
|
}
|
|
629
637
|
|
|
638
|
+
/** Redeem exactly the framework-reported settled Recording funds. */
|
|
639
|
+
export function settleRecordingRoyaltyPool(
|
|
640
|
+
tx: Transaction,
|
|
641
|
+
params: Omit<RecordingRoyaltyPoolCrankParams, "recording"> & {
|
|
642
|
+
readonly recordingId: string;
|
|
643
|
+
readonly accumulatorRoot?: ObjectInput;
|
|
644
|
+
},
|
|
645
|
+
): void {
|
|
646
|
+
const value = settledFundsValue(tx, {
|
|
647
|
+
address: params.recordingId,
|
|
648
|
+
currencyType: params.currencyType,
|
|
649
|
+
accumulatorRoot: params.accumulatorRoot,
|
|
650
|
+
});
|
|
651
|
+
redeemAndDepositRecordingRoyaltyPool(tx, {
|
|
652
|
+
...params,
|
|
653
|
+
recording: tx.object(params.recordingId),
|
|
654
|
+
value,
|
|
655
|
+
});
|
|
656
|
+
}
|
|
657
|
+
|
|
630
658
|
/** Permissionless crank: receive selected Recording-owned coins into the pool. */
|
|
631
659
|
export function receiveRecordingRoyaltyPool(
|
|
632
660
|
tx: Transaction,
|
|
633
661
|
params: RecordingRoyaltyPoolCrankParams & { readonly coins: readonly ReceivingObjectRef[] },
|
|
634
662
|
): void {
|
|
635
663
|
tx.add(
|
|
636
|
-
|
|
664
|
+
recordingRoyaltyPoolPlugin.receiveAndDeposit({
|
|
637
665
|
package: params.pluginPackageId,
|
|
638
666
|
typeArguments: [
|
|
639
667
|
params.recordingShareType,
|
|
@@ -661,7 +689,7 @@ export function installReleaseRevenueDistributorPlugin(
|
|
|
661
689
|
params: ReleaseRevenueDistributorPluginParams,
|
|
662
690
|
): void {
|
|
663
691
|
tx.add(
|
|
664
|
-
|
|
692
|
+
releaseRevenueDistributorPlugin.install({
|
|
665
693
|
package: params.pluginPackageId,
|
|
666
694
|
arguments: [params.vault, params.vaultAdminCap],
|
|
667
695
|
}),
|
|
@@ -672,27 +700,68 @@ export function uninstallReleaseRevenueDistributorPlugin(
|
|
|
672
700
|
tx: Transaction,
|
|
673
701
|
params: ReleaseRevenueDistributorPluginParams,
|
|
674
702
|
): void {
|
|
675
|
-
tx.add(
|
|
703
|
+
tx.add(releaseRevenueDistributorPlugin.uninstall({ package: params.pluginPackageId, arguments: [params.vault, params.vaultAdminCap] }));
|
|
676
704
|
}
|
|
677
705
|
|
|
678
|
-
|
|
706
|
+
export interface ReleaseRevenueDistributorActionParams {
|
|
707
|
+
readonly authority: AdminCapAuthority;
|
|
708
|
+
readonly release: TransactionObjectArgument;
|
|
709
|
+
readonly currencyType: string;
|
|
710
|
+
readonly actionPackageId: string;
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
/** Raw-admin composition: redeem an explicit amount and route it by track BPS. */
|
|
679
714
|
export function redeemAndDistributeReleaseRevenue(
|
|
715
|
+
tx: Transaction,
|
|
716
|
+
params: ReleaseRevenueDistributorActionParams & {
|
|
717
|
+
readonly value: U64Argument;
|
|
718
|
+
},
|
|
719
|
+
): void {
|
|
720
|
+
invokeWithAdminCap(tx, params.authority, {
|
|
721
|
+
target: `${params.actionPackageId}::release_revenue_distributor::redeem_and_distribute`,
|
|
722
|
+
typeArguments: [params.currencyType],
|
|
723
|
+
arguments: [params.release, asU64Argument(tx, "value", params.value)],
|
|
724
|
+
adminCapIndex: 1,
|
|
725
|
+
});
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
/** Fixed permissionless crank: redeem the commit-settled Release balance. */
|
|
729
|
+
export function redeemAllAndDistributeReleaseRevenue(
|
|
680
730
|
tx: Transaction,
|
|
681
731
|
params: Omit<ReleaseRevenueDistributorPluginParams, "vaultAdminCap"> & {
|
|
682
732
|
readonly release: TransactionObjectArgument;
|
|
683
733
|
readonly currencyType: string;
|
|
684
|
-
readonly
|
|
734
|
+
readonly accumulatorRoot?: ObjectInput;
|
|
685
735
|
},
|
|
686
736
|
): void {
|
|
687
737
|
tx.add(
|
|
688
|
-
|
|
738
|
+
releaseRevenueDistributorPlugin.redeemAllAndDistribute({
|
|
689
739
|
package: params.pluginPackageId,
|
|
690
740
|
typeArguments: [params.currencyType],
|
|
691
|
-
arguments: [
|
|
741
|
+
arguments: [
|
|
742
|
+
params.vault,
|
|
743
|
+
params.release,
|
|
744
|
+
object(tx, params.accumulatorRoot ?? SUI_ACCUMULATOR_ROOT_OBJECT_ID),
|
|
745
|
+
],
|
|
692
746
|
}),
|
|
693
747
|
);
|
|
694
748
|
}
|
|
695
749
|
|
|
750
|
+
/** Convenience form of the fixed crank for a known Release object ID. */
|
|
751
|
+
export function settleAndDistributeReleaseRevenue(
|
|
752
|
+
tx: Transaction,
|
|
753
|
+
params: Omit<ReleaseRevenueDistributorPluginParams, "vaultAdminCap"> & {
|
|
754
|
+
readonly releaseId: string;
|
|
755
|
+
readonly currencyType: string;
|
|
756
|
+
readonly accumulatorRoot?: ObjectInput;
|
|
757
|
+
},
|
|
758
|
+
): void {
|
|
759
|
+
redeemAllAndDistributeReleaseRevenue(tx, {
|
|
760
|
+
...params,
|
|
761
|
+
release: tx.object(params.releaseId),
|
|
762
|
+
});
|
|
763
|
+
}
|
|
764
|
+
|
|
696
765
|
/** Permissionless crank: receive release-owned coins and route them by track BPS. */
|
|
697
766
|
export function receiveAndDistributeReleaseRevenue(
|
|
698
767
|
tx: Transaction,
|
|
@@ -703,7 +772,7 @@ export function receiveAndDistributeReleaseRevenue(
|
|
|
703
772
|
},
|
|
704
773
|
): void {
|
|
705
774
|
tx.add(
|
|
706
|
-
|
|
775
|
+
releaseRevenueDistributorPlugin.receiveAndDistribute({
|
|
707
776
|
package: params.pluginPackageId,
|
|
708
777
|
typeArguments: [params.currencyType],
|
|
709
778
|
arguments: [
|
|
@@ -715,35 +784,14 @@ export function receiveAndDistributeReleaseRevenue(
|
|
|
715
784
|
);
|
|
716
785
|
}
|
|
717
786
|
|
|
718
|
-
export interface
|
|
719
|
-
readonly
|
|
720
|
-
readonly vaultAdminCap: TransactionObjectArgument;
|
|
787
|
+
export interface CompositionRoutedStakeActionParams {
|
|
788
|
+
readonly authority: AdminCapAuthority;
|
|
721
789
|
readonly compositionShareType: string;
|
|
722
|
-
readonly
|
|
723
|
-
}
|
|
724
|
-
|
|
725
|
-
export function installCompositionRoutedStakePlugin(
|
|
726
|
-
tx: Transaction,
|
|
727
|
-
params: CompositionRoutedStakePluginParams,
|
|
728
|
-
): void {
|
|
729
|
-
tx.add(
|
|
730
|
-
compositionRoutedStake.install({
|
|
731
|
-
package: params.pluginPackageId,
|
|
732
|
-
typeArguments: [params.compositionShareType],
|
|
733
|
-
arguments: [params.vault, params.vaultAdminCap],
|
|
734
|
-
}),
|
|
735
|
-
);
|
|
736
|
-
}
|
|
737
|
-
|
|
738
|
-
export function uninstallCompositionRoutedStakePlugin(
|
|
739
|
-
tx: Transaction,
|
|
740
|
-
params: CompositionRoutedStakePluginParams,
|
|
741
|
-
): void {
|
|
742
|
-
tx.add(compositionRoutedStake.uninstall({ package: params.pluginPackageId, typeArguments: [params.compositionShareType], arguments: [params.vault, params.vaultAdminCap] }));
|
|
790
|
+
readonly actionPackageId: string;
|
|
743
791
|
}
|
|
744
792
|
|
|
745
793
|
export interface CreateCompositionRoutedStakeParams
|
|
746
|
-
extends
|
|
794
|
+
extends CompositionRoutedStakeActionParams {
|
|
747
795
|
readonly recording: TransactionObjectArgument;
|
|
748
796
|
readonly composition: TransactionObjectArgument;
|
|
749
797
|
readonly recordingShareType: string;
|
|
@@ -753,24 +801,17 @@ export interface CreateCompositionRoutedStakeParams
|
|
|
753
801
|
export function createCompositionRoutedStake(
|
|
754
802
|
tx: Transaction,
|
|
755
803
|
params: CreateCompositionRoutedStakeParams,
|
|
756
|
-
):
|
|
757
|
-
tx.
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
params.composition,
|
|
764
|
-
params.recording,
|
|
765
|
-
params.vaultAdminCap,
|
|
766
|
-
asU64("value", params.value),
|
|
767
|
-
],
|
|
768
|
-
}),
|
|
769
|
-
);
|
|
804
|
+
): TransactionObjectArgument {
|
|
805
|
+
return invokeWithAdminCap(tx, params.authority, {
|
|
806
|
+
target: `${params.actionPackageId}::composition_routed_stake::create_stake`,
|
|
807
|
+
typeArguments: [params.recordingShareType, params.compositionShareType],
|
|
808
|
+
arguments: [params.composition, params.recording, tx.pure.u64(asU64("value", params.value))],
|
|
809
|
+
adminCapIndex: 1,
|
|
810
|
+
});
|
|
770
811
|
}
|
|
771
812
|
|
|
772
813
|
export interface ManageCompositionRoutedStakeParams
|
|
773
|
-
extends
|
|
814
|
+
extends CompositionRoutedStakeActionParams {
|
|
774
815
|
readonly composition: TransactionObjectArgument;
|
|
775
816
|
readonly recording: TransactionObjectArgument;
|
|
776
817
|
readonly routedStake: TransactionObjectArgument;
|
|
@@ -784,24 +825,12 @@ export function registerCompositionRoutedStake(
|
|
|
784
825
|
tx: Transaction,
|
|
785
826
|
params: ManageCompositionRoutedStakeParams,
|
|
786
827
|
): void {
|
|
787
|
-
tx.
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
params.currencyType,
|
|
794
|
-
],
|
|
795
|
-
arguments: [
|
|
796
|
-
params.vault,
|
|
797
|
-
params.composition,
|
|
798
|
-
params.recording,
|
|
799
|
-
params.routedStake,
|
|
800
|
-
params.royaltyPool,
|
|
801
|
-
params.vaultAdminCap,
|
|
802
|
-
],
|
|
803
|
-
}),
|
|
804
|
-
);
|
|
828
|
+
invokeWithAdminCap(tx, params.authority, {
|
|
829
|
+
target: `${params.actionPackageId}::composition_routed_stake::register`,
|
|
830
|
+
typeArguments: [params.recordingShareType, params.compositionShareType, params.currencyType],
|
|
831
|
+
arguments: [params.composition, params.recording, params.routedStake, params.royaltyPool],
|
|
832
|
+
adminCapIndex: 1,
|
|
833
|
+
});
|
|
805
834
|
}
|
|
806
835
|
|
|
807
836
|
/** Unregister a routed stake after pending rewards have been swept. */
|
|
@@ -809,65 +838,40 @@ export function unregisterCompositionRoutedStake(
|
|
|
809
838
|
tx: Transaction,
|
|
810
839
|
params: ManageCompositionRoutedStakeParams,
|
|
811
840
|
): void {
|
|
812
|
-
tx.
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
params.currencyType,
|
|
819
|
-
],
|
|
820
|
-
arguments: [
|
|
821
|
-
params.vault,
|
|
822
|
-
params.composition,
|
|
823
|
-
params.recording,
|
|
824
|
-
params.routedStake,
|
|
825
|
-
params.royaltyPool,
|
|
826
|
-
params.vaultAdminCap,
|
|
827
|
-
],
|
|
828
|
-
}),
|
|
829
|
-
);
|
|
841
|
+
invokeWithAdminCap(tx, params.authority, {
|
|
842
|
+
target: `${params.actionPackageId}::composition_routed_stake::unregister`,
|
|
843
|
+
typeArguments: [params.recordingShareType, params.compositionShareType, params.currencyType],
|
|
844
|
+
arguments: [params.composition, params.recording, params.routedStake, params.royaltyPool],
|
|
845
|
+
adminCapIndex: 1,
|
|
846
|
+
});
|
|
830
847
|
}
|
|
831
848
|
|
|
832
|
-
/**
|
|
849
|
+
/** Unstake and return the routed principal for caller-selected composition. */
|
|
833
850
|
export function unstakeCompositionRoutedStake(
|
|
834
851
|
tx: Transaction,
|
|
835
852
|
params: Omit<ManageCompositionRoutedStakeParams, "recording" | "royaltyPool" | "currencyType">,
|
|
836
|
-
):
|
|
837
|
-
tx.
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
params.composition,
|
|
844
|
-
params.routedStake,
|
|
845
|
-
params.vaultAdminCap,
|
|
846
|
-
],
|
|
847
|
-
}),
|
|
848
|
-
);
|
|
853
|
+
): TransactionObjectArgument {
|
|
854
|
+
return invokeWithAdminCap(tx, params.authority, {
|
|
855
|
+
target: `${params.actionPackageId}::composition_routed_stake::unstake`,
|
|
856
|
+
typeArguments: [params.recordingShareType, params.compositionShareType],
|
|
857
|
+
arguments: [params.composition, params.routedStake],
|
|
858
|
+
adminCapIndex: 1,
|
|
859
|
+
});
|
|
849
860
|
}
|
|
850
861
|
|
|
851
|
-
/** Refill an empty routed stake
|
|
862
|
+
/** Refill an empty routed stake with caller-supplied Recording shares. */
|
|
852
863
|
export function restakeCompositionRoutedStake(
|
|
853
864
|
tx: Transaction,
|
|
854
865
|
params: Omit<ManageCompositionRoutedStakeParams, "recording" | "royaltyPool" | "currencyType"> & {
|
|
855
|
-
readonly
|
|
866
|
+
readonly shares: TransactionArgument;
|
|
856
867
|
},
|
|
857
868
|
): void {
|
|
858
|
-
tx.
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
params.composition,
|
|
865
|
-
params.routedStake,
|
|
866
|
-
params.vaultAdminCap,
|
|
867
|
-
asU64("value", params.value),
|
|
868
|
-
],
|
|
869
|
-
}),
|
|
870
|
-
);
|
|
869
|
+
invokeWithAdminCap(tx, params.authority, {
|
|
870
|
+
target: `${params.actionPackageId}::composition_routed_stake::restake`,
|
|
871
|
+
typeArguments: [params.recordingShareType, params.compositionShareType],
|
|
872
|
+
arguments: [params.composition, params.routedStake, params.shares],
|
|
873
|
+
adminCapIndex: 1,
|
|
874
|
+
});
|
|
871
875
|
}
|
|
872
876
|
|
|
873
877
|
/** Permissionlessly sweep a routed stake's accrued rewards into its parent pool. */
|