@misofm/sdk 0.16.0 → 0.17.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 +79 -34
- package/dist/client.d.ts +72 -24
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +229 -84
- 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 +15 -99
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.d.ts.map +1 -1
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.js +12 -94
- 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_record/deps/std/type_name.d.ts +1 -1
- package/dist/contracts/miso_record/deps/std/type_name.d.ts.map +1 -1
- package/dist/contracts/miso_record/deps/std/type_name.js.map +1 -1
- package/dist/contracts/miso_record/deps/sui/vec_set.d.ts.map +1 -1
- package/dist/contracts/miso_record/deps/sui/vec_set.js.map +1 -1
- package/dist/contracts/miso_record/pressing.d.ts.map +1 -1
- package/dist/contracts/miso_record/pressing.js.map +1 -1
- package/dist/contracts/miso_record/record.d.ts +17 -17
- package/dist/contracts/miso_record/record.d.ts.map +1 -1
- package/dist/contracts/miso_record/record.js.map +1 -1
- package/dist/contracts/miso_record_shop/deps/std/type_name.d.ts +1 -1
- package/dist/contracts/miso_record_shop/deps/std/type_name.d.ts.map +1 -1
- package/dist/contracts/miso_record_shop/deps/std/type_name.js.map +1 -1
- package/dist/contracts/miso_record_shop/listing.d.ts +29 -29
- package/dist/contracts/miso_record_shop/listing.d.ts.map +1 -1
- package/dist/contracts/miso_record_shop/listing.js.map +1 -1
- package/dist/contracts/miso_record_shop/witness.d.ts +1 -1
- package/dist/contracts/miso_record_shop/witness.d.ts.map +1 -1
- package/dist/contracts/miso_record_shop/witness.js.map +1 -1
- 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 +14 -100
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.d.ts.map +1 -1
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.js +11 -94
- 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 +3 -0
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js +4 -1
- package/dist/contracts.js.map +1 -1
- package/dist/deployments.d.ts +125 -79
- package/dist/deployments.d.ts.map +1 -1
- package/dist/deployments.js +111 -35
- package/dist/deployments.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -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/publication.d.ts +1 -4
- package/dist/publication.d.ts.map +1 -1
- package/dist/publication.js +79 -60
- package/dist/publication.js.map +1 -1
- package/dist/read/config.d.ts.map +1 -1
- package/dist/read/config.js +9 -1
- package/dist/read/config.js.map +1 -1
- package/dist/vault.d.ts +42 -38
- package/dist/vault.d.ts.map +1 -1
- package/dist/vault.js +96 -169
- package/dist/vault.js.map +1 -1
- package/package.json +13 -10
- package/src/client.ts +291 -107
- 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 +20 -161
- 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_record/deps/std/type_name.ts +1 -0
- package/src/contracts/miso_record/deps/sui/vec_set.ts +1 -0
- package/src/contracts/miso_record/pressing.ts +1 -0
- package/src/contracts/miso_record/record.ts +1 -0
- package/src/contracts/miso_record_shop/deps/std/type_name.ts +1 -0
- package/src/contracts/miso_record_shop/listing.ts +1 -0
- package/src/contracts/miso_record_shop/witness.ts +1 -0
- 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 +19 -162
- 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 +4 -1
- package/src/deployments.ts +185 -60
- package/src/index.ts +3 -0
- package/src/internal.ts +27 -0
- package/src/publication.ts +87 -69
- package/src/read/config.ts +12 -1
- package/src/vault.ts +150 -256
- 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/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 +0 -7
- package/dist/contracts/release_revenue_distributor/witness.d.ts.map +0 -1
- package/dist/contracts/release_revenue_distributor/witness.js +0 -9
- package/dist/contracts/release_revenue_distributor/witness.js.map +0 -1
- package/src/contracts/composition_routed_stake/witness.ts +0 -11
- package/src/contracts/release_revenue_distributor/witness.ts +0 -11
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,11 +21,10 @@ 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. */
|
|
@@ -232,7 +233,7 @@ export function restoreVaultCapability(
|
|
|
232
233
|
}));
|
|
233
234
|
}
|
|
234
235
|
|
|
235
|
-
/** Transfer the key
|
|
236
|
+
/** Transfer the `key + store` VaultAdminCap to its next owner. */
|
|
236
237
|
export function transferVaultAdminCap(
|
|
237
238
|
tx: Transaction,
|
|
238
239
|
params: {
|
|
@@ -242,15 +243,11 @@ export function transferVaultAdminCap(
|
|
|
242
243
|
readonly vaultPackageId: string;
|
|
243
244
|
},
|
|
244
245
|
): void {
|
|
245
|
-
tx.
|
|
246
|
-
package: params.vaultPackageId,
|
|
247
|
-
typeArguments: [params.capType],
|
|
248
|
-
arguments: [object(tx, params.vaultAdminCap), params.owner],
|
|
249
|
-
}));
|
|
246
|
+
tx.transferObjects([object(tx, params.vaultAdminCap)], params.owner);
|
|
250
247
|
}
|
|
251
248
|
|
|
252
249
|
/**
|
|
253
|
-
* Custody a freshly-created raw admin cap, optionally
|
|
250
|
+
* Custody a freshly-created raw admin cap, optionally configure it, share the
|
|
254
251
|
* Vault, then transfer only the VaultAdminCap to its owner.
|
|
255
252
|
*/
|
|
256
253
|
export function custodyNewAdminCap(
|
|
@@ -326,7 +323,7 @@ export function installCompositionRoyaltyPoolPlugin(
|
|
|
326
323
|
params: CompositionRoyaltyPoolPluginParams,
|
|
327
324
|
): void {
|
|
328
325
|
tx.add(
|
|
329
|
-
|
|
326
|
+
compositionRoyaltyPoolPlugin.install({
|
|
330
327
|
package: params.pluginPackageId,
|
|
331
328
|
typeArguments: [params.compositionShareType],
|
|
332
329
|
arguments: [params.vault, params.vaultAdminCap],
|
|
@@ -338,41 +335,34 @@ export function uninstallCompositionRoyaltyPoolPlugin(
|
|
|
338
335
|
tx: Transaction,
|
|
339
336
|
params: CompositionRoyaltyPoolPluginParams,
|
|
340
337
|
): void {
|
|
341
|
-
tx.add(
|
|
338
|
+
tx.add(
|
|
339
|
+
compositionRoyaltyPoolPlugin.uninstall({
|
|
340
|
+
package: params.pluginPackageId,
|
|
341
|
+
typeArguments: [params.compositionShareType],
|
|
342
|
+
arguments: [params.vault, params.vaultAdminCap],
|
|
343
|
+
}),
|
|
344
|
+
);
|
|
342
345
|
}
|
|
343
346
|
|
|
344
|
-
export interface
|
|
345
|
-
|
|
347
|
+
export interface NewCompositionRoyaltyPoolParams {
|
|
348
|
+
readonly authority: AdminCapAuthority;
|
|
346
349
|
readonly composition: TransactionObjectArgument;
|
|
350
|
+
readonly actionPackageId: string;
|
|
347
351
|
readonly currencyType: string;
|
|
352
|
+
readonly compositionShareType: string;
|
|
348
353
|
}
|
|
349
354
|
|
|
350
355
|
/** Create the canonical pool without sharing it so callers can configure fresh stakes first. */
|
|
351
356
|
export function newCompositionRoyaltyPool(
|
|
352
357
|
tx: Transaction,
|
|
353
|
-
params:
|
|
358
|
+
params: NewCompositionRoyaltyPoolParams,
|
|
354
359
|
): TransactionObjectArgument {
|
|
355
|
-
return tx.
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
);
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
/** Create and immediately share the canonical Composition royalty pool. */
|
|
365
|
-
export function initializeCompositionRoyaltyPool(
|
|
366
|
-
tx: Transaction,
|
|
367
|
-
params: InitializeCompositionRoyaltyPoolParams,
|
|
368
|
-
): void {
|
|
369
|
-
tx.add(
|
|
370
|
-
compositionRoyaltyPool.initializePool({
|
|
371
|
-
package: params.pluginPackageId,
|
|
372
|
-
typeArguments: [params.compositionShareType, params.currencyType],
|
|
373
|
-
arguments: [params.vault, params.composition, params.vaultAdminCap],
|
|
374
|
-
}),
|
|
375
|
-
);
|
|
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
|
+
});
|
|
376
366
|
}
|
|
377
367
|
|
|
378
368
|
export interface CompositionRoyaltyPoolCrankParams {
|
|
@@ -405,13 +395,13 @@ export function asU64(name: string, value: U64Input): bigint {
|
|
|
405
395
|
return parsed;
|
|
406
396
|
}
|
|
407
397
|
|
|
408
|
-
function asU64Argument(name: string, value: U64Argument):
|
|
398
|
+
function asU64Argument(tx: Transaction, name: string, value: U64Argument): TransactionArgument {
|
|
409
399
|
if (
|
|
410
400
|
typeof value === "bigint" ||
|
|
411
401
|
typeof value === "string" ||
|
|
412
402
|
typeof value === "number"
|
|
413
403
|
) {
|
|
414
|
-
return asU64(name, value);
|
|
404
|
+
return tx.pure.u64(asU64(name, value));
|
|
415
405
|
}
|
|
416
406
|
return value;
|
|
417
407
|
}
|
|
@@ -445,14 +435,14 @@ export function redeemAndDepositCompositionRoyaltyPool(
|
|
|
445
435
|
},
|
|
446
436
|
): void {
|
|
447
437
|
tx.add(
|
|
448
|
-
|
|
438
|
+
compositionRoyaltyPoolPlugin.redeemAndDeposit({
|
|
449
439
|
package: params.pluginPackageId,
|
|
450
440
|
typeArguments: [params.compositionShareType, params.currencyType],
|
|
451
441
|
arguments: [
|
|
452
442
|
params.vault,
|
|
453
443
|
params.composition,
|
|
454
444
|
params.pool,
|
|
455
|
-
asU64Argument("value", params.value),
|
|
445
|
+
asU64Argument(tx, "value", params.value),
|
|
456
446
|
],
|
|
457
447
|
}),
|
|
458
448
|
);
|
|
@@ -484,7 +474,7 @@ export function receiveCompositionRoyaltyPool(
|
|
|
484
474
|
params: CompositionRoyaltyPoolCrankParams & { readonly coins: readonly ReceivingObjectRef[] },
|
|
485
475
|
): void {
|
|
486
476
|
tx.add(
|
|
487
|
-
|
|
477
|
+
compositionRoyaltyPoolPlugin.receiveAndDeposit({
|
|
488
478
|
package: params.pluginPackageId,
|
|
489
479
|
typeArguments: [params.compositionShareType, params.currencyType],
|
|
490
480
|
arguments: [
|
|
@@ -510,7 +500,7 @@ export function installRecordingRoyaltyPoolPlugin(
|
|
|
510
500
|
params: RecordingRoyaltyPoolPluginParams,
|
|
511
501
|
): void {
|
|
512
502
|
tx.add(
|
|
513
|
-
|
|
503
|
+
recordingRoyaltyPoolPlugin.install({
|
|
514
504
|
package: params.pluginPackageId,
|
|
515
505
|
typeArguments: [params.recordingShareType],
|
|
516
506
|
arguments: [params.vault, params.vaultAdminCap],
|
|
@@ -518,40 +508,11 @@ export function installRecordingRoyaltyPoolPlugin(
|
|
|
518
508
|
);
|
|
519
509
|
}
|
|
520
510
|
|
|
521
|
-
export interface
|
|
522
|
-
readonly
|
|
523
|
-
readonly vaultAdminCap: TransactionObjectArgument;
|
|
524
|
-
readonly pluginPackageId: string;
|
|
525
|
-
}
|
|
526
|
-
|
|
527
|
-
/** Install the Party wallet plugin; its canonical witness stays internal. */
|
|
528
|
-
export function installPartyWalletPlugin(
|
|
529
|
-
tx: Transaction,
|
|
530
|
-
params: PartyWalletPluginParams,
|
|
531
|
-
): void {
|
|
532
|
-
tx.add(
|
|
533
|
-
partyWallet.install({
|
|
534
|
-
package: params.pluginPackageId,
|
|
535
|
-
arguments: [params.vault, params.vaultAdminCap],
|
|
536
|
-
}),
|
|
537
|
-
);
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
export function uninstallPartyWalletPlugin(
|
|
541
|
-
tx: Transaction,
|
|
542
|
-
params: PartyWalletPluginParams,
|
|
543
|
-
): void {
|
|
544
|
-
tx.add(
|
|
545
|
-
partyWallet.uninstall({
|
|
546
|
-
package: params.pluginPackageId,
|
|
547
|
-
arguments: [params.vault, params.vaultAdminCap],
|
|
548
|
-
}),
|
|
549
|
-
);
|
|
550
|
-
}
|
|
551
|
-
|
|
552
|
-
export interface PartyWalletFundsParams extends PartyWalletPluginParams {
|
|
511
|
+
export interface PartyWalletFundsParams {
|
|
512
|
+
readonly authority: AdminCapAuthority;
|
|
553
513
|
readonly party: TransactionObjectArgument;
|
|
554
514
|
readonly currencyType: string;
|
|
515
|
+
readonly actionPackageId: string;
|
|
555
516
|
}
|
|
556
517
|
|
|
557
518
|
/** Receive selected Party-owned coins and return their merged Balance. */
|
|
@@ -559,18 +520,12 @@ export function receivePartyWalletBalance(
|
|
|
559
520
|
tx: Transaction,
|
|
560
521
|
params: PartyWalletFundsParams & { readonly coins: readonly ReceivingObjectRef[] },
|
|
561
522
|
): TransactionArgument {
|
|
562
|
-
return tx.
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
params.party,
|
|
569
|
-
params.vaultAdminCap,
|
|
570
|
-
receivingCoins(tx, params.currencyType, params.coins),
|
|
571
|
-
],
|
|
572
|
-
}),
|
|
573
|
-
);
|
|
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
|
+
});
|
|
574
529
|
}
|
|
575
530
|
|
|
576
531
|
/** Redeem an exact Party accumulator amount and return its Balance. */
|
|
@@ -578,18 +533,12 @@ export function redeemPartyWalletBalance(
|
|
|
578
533
|
tx: Transaction,
|
|
579
534
|
params: PartyWalletFundsParams & { readonly value: U64Argument },
|
|
580
535
|
): TransactionArgument {
|
|
581
|
-
return tx.
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
params.party,
|
|
588
|
-
params.vaultAdminCap,
|
|
589
|
-
asU64Argument("value", params.value),
|
|
590
|
-
],
|
|
591
|
-
}),
|
|
592
|
-
);
|
|
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
|
+
});
|
|
593
542
|
}
|
|
594
543
|
|
|
595
544
|
/** Redeem exactly the framework-reported settled Party funds. */
|
|
@@ -616,49 +565,39 @@ export function uninstallRecordingRoyaltyPoolPlugin(
|
|
|
616
565
|
tx: Transaction,
|
|
617
566
|
params: RecordingRoyaltyPoolPluginParams,
|
|
618
567
|
): void {
|
|
619
|
-
tx.add(
|
|
568
|
+
tx.add(
|
|
569
|
+
recordingRoyaltyPoolPlugin.uninstall({
|
|
570
|
+
package: params.pluginPackageId,
|
|
571
|
+
typeArguments: [params.recordingShareType],
|
|
572
|
+
arguments: [params.vault, params.vaultAdminCap],
|
|
573
|
+
}),
|
|
574
|
+
);
|
|
620
575
|
}
|
|
621
576
|
|
|
622
|
-
export interface
|
|
623
|
-
|
|
577
|
+
export interface NewRecordingRoyaltyPoolParams {
|
|
578
|
+
readonly authority: AdminCapAuthority;
|
|
624
579
|
readonly recording: TransactionObjectArgument;
|
|
580
|
+
readonly actionPackageId: string;
|
|
625
581
|
readonly currencyType: string;
|
|
582
|
+
readonly recordingShareType: string;
|
|
583
|
+
readonly compositionShareType: string;
|
|
626
584
|
}
|
|
627
585
|
|
|
628
586
|
/** Create the canonical pool without sharing it so callers can configure fresh stakes first. */
|
|
629
587
|
export function newRecordingRoyaltyPool(
|
|
630
588
|
tx: Transaction,
|
|
631
|
-
params:
|
|
589
|
+
params: NewRecordingRoyaltyPoolParams,
|
|
632
590
|
): TransactionObjectArgument {
|
|
633
|
-
return tx.
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
);
|
|
644
|
-
}
|
|
645
|
-
|
|
646
|
-
/** Create and immediately share the canonical Recording royalty pool. */
|
|
647
|
-
export function initializeRecordingRoyaltyPool(
|
|
648
|
-
tx: Transaction,
|
|
649
|
-
params: InitializeRecordingRoyaltyPoolParams,
|
|
650
|
-
): void {
|
|
651
|
-
tx.add(
|
|
652
|
-
recordingRoyaltyPool.initializePool({
|
|
653
|
-
package: params.pluginPackageId,
|
|
654
|
-
typeArguments: [
|
|
655
|
-
params.recordingShareType,
|
|
656
|
-
params.compositionShareType,
|
|
657
|
-
params.currencyType,
|
|
658
|
-
],
|
|
659
|
-
arguments: [params.vault, params.recording, params.vaultAdminCap],
|
|
660
|
-
}),
|
|
661
|
-
);
|
|
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
|
+
});
|
|
662
601
|
}
|
|
663
602
|
|
|
664
603
|
export interface RecordingRoyaltyPoolCrankParams {
|
|
@@ -679,7 +618,7 @@ export function redeemAndDepositRecordingRoyaltyPool(
|
|
|
679
618
|
},
|
|
680
619
|
): void {
|
|
681
620
|
tx.add(
|
|
682
|
-
|
|
621
|
+
recordingRoyaltyPoolPlugin.redeemAndDeposit({
|
|
683
622
|
package: params.pluginPackageId,
|
|
684
623
|
typeArguments: [
|
|
685
624
|
params.recordingShareType,
|
|
@@ -690,7 +629,7 @@ export function redeemAndDepositRecordingRoyaltyPool(
|
|
|
690
629
|
params.vault,
|
|
691
630
|
params.recording,
|
|
692
631
|
params.pool,
|
|
693
|
-
asU64Argument("value", params.value),
|
|
632
|
+
asU64Argument(tx, "value", params.value),
|
|
694
633
|
],
|
|
695
634
|
}),
|
|
696
635
|
);
|
|
@@ -722,7 +661,7 @@ export function receiveRecordingRoyaltyPool(
|
|
|
722
661
|
params: RecordingRoyaltyPoolCrankParams & { readonly coins: readonly ReceivingObjectRef[] },
|
|
723
662
|
): void {
|
|
724
663
|
tx.add(
|
|
725
|
-
|
|
664
|
+
recordingRoyaltyPoolPlugin.receiveAndDeposit({
|
|
726
665
|
package: params.pluginPackageId,
|
|
727
666
|
typeArguments: [
|
|
728
667
|
params.recordingShareType,
|
|
@@ -750,7 +689,7 @@ export function installReleaseRevenueDistributorPlugin(
|
|
|
750
689
|
params: ReleaseRevenueDistributorPluginParams,
|
|
751
690
|
): void {
|
|
752
691
|
tx.add(
|
|
753
|
-
|
|
692
|
+
releaseRevenueDistributorPlugin.install({
|
|
754
693
|
package: params.pluginPackageId,
|
|
755
694
|
arguments: [params.vault, params.vaultAdminCap],
|
|
756
695
|
}),
|
|
@@ -761,28 +700,54 @@ export function uninstallReleaseRevenueDistributorPlugin(
|
|
|
761
700
|
tx: Transaction,
|
|
762
701
|
params: ReleaseRevenueDistributorPluginParams,
|
|
763
702
|
): void {
|
|
764
|
-
tx.add(
|
|
703
|
+
tx.add(releaseRevenueDistributorPlugin.uninstall({ package: params.pluginPackageId, arguments: [params.vault, params.vaultAdminCap] }));
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
export interface ReleaseRevenueDistributorActionParams {
|
|
707
|
+
readonly authority: AdminCapAuthority;
|
|
708
|
+
readonly release: TransactionObjectArgument;
|
|
709
|
+
readonly currencyType: string;
|
|
710
|
+
readonly actionPackageId: string;
|
|
765
711
|
}
|
|
766
712
|
|
|
767
|
-
/**
|
|
713
|
+
/** Raw-admin composition: redeem an explicit amount and route it by track BPS. */
|
|
768
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(
|
|
769
730
|
tx: Transaction,
|
|
770
731
|
params: Omit<ReleaseRevenueDistributorPluginParams, "vaultAdminCap"> & {
|
|
771
732
|
readonly release: TransactionObjectArgument;
|
|
772
733
|
readonly currencyType: string;
|
|
773
|
-
readonly
|
|
734
|
+
readonly accumulatorRoot?: ObjectInput;
|
|
774
735
|
},
|
|
775
736
|
): void {
|
|
776
737
|
tx.add(
|
|
777
|
-
|
|
738
|
+
releaseRevenueDistributorPlugin.redeemAllAndDistribute({
|
|
778
739
|
package: params.pluginPackageId,
|
|
779
740
|
typeArguments: [params.currencyType],
|
|
780
|
-
arguments: [
|
|
741
|
+
arguments: [
|
|
742
|
+
params.vault,
|
|
743
|
+
params.release,
|
|
744
|
+
object(tx, params.accumulatorRoot ?? SUI_ACCUMULATOR_ROOT_OBJECT_ID),
|
|
745
|
+
],
|
|
781
746
|
}),
|
|
782
747
|
);
|
|
783
748
|
}
|
|
784
749
|
|
|
785
|
-
/**
|
|
750
|
+
/** Convenience form of the fixed crank for a known Release object ID. */
|
|
786
751
|
export function settleAndDistributeReleaseRevenue(
|
|
787
752
|
tx: Transaction,
|
|
788
753
|
params: Omit<ReleaseRevenueDistributorPluginParams, "vaultAdminCap"> & {
|
|
@@ -791,15 +756,9 @@ export function settleAndDistributeReleaseRevenue(
|
|
|
791
756
|
readonly accumulatorRoot?: ObjectInput;
|
|
792
757
|
},
|
|
793
758
|
): void {
|
|
794
|
-
|
|
795
|
-
address: params.releaseId,
|
|
796
|
-
currencyType: params.currencyType,
|
|
797
|
-
accumulatorRoot: params.accumulatorRoot,
|
|
798
|
-
});
|
|
799
|
-
redeemAndDistributeReleaseRevenue(tx, {
|
|
759
|
+
redeemAllAndDistributeReleaseRevenue(tx, {
|
|
800
760
|
...params,
|
|
801
761
|
release: tx.object(params.releaseId),
|
|
802
|
-
value,
|
|
803
762
|
});
|
|
804
763
|
}
|
|
805
764
|
|
|
@@ -813,7 +772,7 @@ export function receiveAndDistributeReleaseRevenue(
|
|
|
813
772
|
},
|
|
814
773
|
): void {
|
|
815
774
|
tx.add(
|
|
816
|
-
|
|
775
|
+
releaseRevenueDistributorPlugin.receiveAndDistribute({
|
|
817
776
|
package: params.pluginPackageId,
|
|
818
777
|
typeArguments: [params.currencyType],
|
|
819
778
|
arguments: [
|
|
@@ -825,35 +784,14 @@ export function receiveAndDistributeReleaseRevenue(
|
|
|
825
784
|
);
|
|
826
785
|
}
|
|
827
786
|
|
|
828
|
-
export interface
|
|
829
|
-
readonly
|
|
830
|
-
readonly vaultAdminCap: TransactionObjectArgument;
|
|
787
|
+
export interface CompositionRoutedStakeActionParams {
|
|
788
|
+
readonly authority: AdminCapAuthority;
|
|
831
789
|
readonly compositionShareType: string;
|
|
832
|
-
readonly
|
|
833
|
-
}
|
|
834
|
-
|
|
835
|
-
export function installCompositionRoutedStakePlugin(
|
|
836
|
-
tx: Transaction,
|
|
837
|
-
params: CompositionRoutedStakePluginParams,
|
|
838
|
-
): void {
|
|
839
|
-
tx.add(
|
|
840
|
-
compositionRoutedStake.install({
|
|
841
|
-
package: params.pluginPackageId,
|
|
842
|
-
typeArguments: [params.compositionShareType],
|
|
843
|
-
arguments: [params.vault, params.vaultAdminCap],
|
|
844
|
-
}),
|
|
845
|
-
);
|
|
846
|
-
}
|
|
847
|
-
|
|
848
|
-
export function uninstallCompositionRoutedStakePlugin(
|
|
849
|
-
tx: Transaction,
|
|
850
|
-
params: CompositionRoutedStakePluginParams,
|
|
851
|
-
): void {
|
|
852
|
-
tx.add(compositionRoutedStake.uninstall({ package: params.pluginPackageId, typeArguments: [params.compositionShareType], arguments: [params.vault, params.vaultAdminCap] }));
|
|
790
|
+
readonly actionPackageId: string;
|
|
853
791
|
}
|
|
854
792
|
|
|
855
793
|
export interface CreateCompositionRoutedStakeParams
|
|
856
|
-
extends
|
|
794
|
+
extends CompositionRoutedStakeActionParams {
|
|
857
795
|
readonly recording: TransactionObjectArgument;
|
|
858
796
|
readonly composition: TransactionObjectArgument;
|
|
859
797
|
readonly recordingShareType: string;
|
|
@@ -863,24 +801,17 @@ export interface CreateCompositionRoutedStakeParams
|
|
|
863
801
|
export function createCompositionRoutedStake(
|
|
864
802
|
tx: Transaction,
|
|
865
803
|
params: CreateCompositionRoutedStakeParams,
|
|
866
|
-
):
|
|
867
|
-
tx.
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
params.composition,
|
|
874
|
-
params.recording,
|
|
875
|
-
params.vaultAdminCap,
|
|
876
|
-
asU64("value", params.value),
|
|
877
|
-
],
|
|
878
|
-
}),
|
|
879
|
-
);
|
|
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
|
+
});
|
|
880
811
|
}
|
|
881
812
|
|
|
882
813
|
export interface ManageCompositionRoutedStakeParams
|
|
883
|
-
extends
|
|
814
|
+
extends CompositionRoutedStakeActionParams {
|
|
884
815
|
readonly composition: TransactionObjectArgument;
|
|
885
816
|
readonly recording: TransactionObjectArgument;
|
|
886
817
|
readonly routedStake: TransactionObjectArgument;
|
|
@@ -894,24 +825,12 @@ export function registerCompositionRoutedStake(
|
|
|
894
825
|
tx: Transaction,
|
|
895
826
|
params: ManageCompositionRoutedStakeParams,
|
|
896
827
|
): void {
|
|
897
|
-
tx.
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
params.currencyType,
|
|
904
|
-
],
|
|
905
|
-
arguments: [
|
|
906
|
-
params.vault,
|
|
907
|
-
params.composition,
|
|
908
|
-
params.recording,
|
|
909
|
-
params.routedStake,
|
|
910
|
-
params.royaltyPool,
|
|
911
|
-
params.vaultAdminCap,
|
|
912
|
-
],
|
|
913
|
-
}),
|
|
914
|
-
);
|
|
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
|
+
});
|
|
915
834
|
}
|
|
916
835
|
|
|
917
836
|
/** Unregister a routed stake after pending rewards have been swept. */
|
|
@@ -919,65 +838,40 @@ export function unregisterCompositionRoutedStake(
|
|
|
919
838
|
tx: Transaction,
|
|
920
839
|
params: ManageCompositionRoutedStakeParams,
|
|
921
840
|
): void {
|
|
922
|
-
tx.
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
params.currencyType,
|
|
929
|
-
],
|
|
930
|
-
arguments: [
|
|
931
|
-
params.vault,
|
|
932
|
-
params.composition,
|
|
933
|
-
params.recording,
|
|
934
|
-
params.routedStake,
|
|
935
|
-
params.royaltyPool,
|
|
936
|
-
params.vaultAdminCap,
|
|
937
|
-
],
|
|
938
|
-
}),
|
|
939
|
-
);
|
|
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
|
+
});
|
|
940
847
|
}
|
|
941
848
|
|
|
942
|
-
/**
|
|
849
|
+
/** Unstake and return the routed principal for caller-selected composition. */
|
|
943
850
|
export function unstakeCompositionRoutedStake(
|
|
944
851
|
tx: Transaction,
|
|
945
852
|
params: Omit<ManageCompositionRoutedStakeParams, "recording" | "royaltyPool" | "currencyType">,
|
|
946
|
-
):
|
|
947
|
-
tx.
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
params.composition,
|
|
954
|
-
params.routedStake,
|
|
955
|
-
params.vaultAdminCap,
|
|
956
|
-
],
|
|
957
|
-
}),
|
|
958
|
-
);
|
|
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
|
+
});
|
|
959
860
|
}
|
|
960
861
|
|
|
961
|
-
/** Refill an empty routed stake
|
|
862
|
+
/** Refill an empty routed stake with caller-supplied Recording shares. */
|
|
962
863
|
export function restakeCompositionRoutedStake(
|
|
963
864
|
tx: Transaction,
|
|
964
865
|
params: Omit<ManageCompositionRoutedStakeParams, "recording" | "royaltyPool" | "currencyType"> & {
|
|
965
|
-
readonly
|
|
866
|
+
readonly shares: TransactionArgument;
|
|
966
867
|
},
|
|
967
868
|
): void {
|
|
968
|
-
tx.
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
params.composition,
|
|
975
|
-
params.routedStake,
|
|
976
|
-
params.vaultAdminCap,
|
|
977
|
-
asU64("value", params.value),
|
|
978
|
-
],
|
|
979
|
-
}),
|
|
980
|
-
);
|
|
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
|
+
});
|
|
981
875
|
}
|
|
982
876
|
|
|
983
877
|
/** Permissionlessly sweep a routed stake's accrued rewards into its parent pool. */
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**************************************************************
|
|
2
|
-
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
-
**************************************************************/
|
|
4
|
-
/** Canonical installation identity for the Composition routed-stake plugin. */
|
|
5
|
-
import { MoveTuple } from '../utils/index.js';
|
|
6
|
-
export declare const Witness: MoveTuple<readonly [import("@mysten/sui/bcs").BcsType<boolean, boolean, "bool">], "@local-pkg/composition_routed_stake::witness::Witness">;
|
|
7
|
-
//# sourceMappingURL=witness.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"witness.d.ts","sourceRoot":"","sources":["../../../src/contracts/composition_routed_stake/witness.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAGhE,+EAA+E;AAE/E,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAG9C,eAAO,MAAM,OAAO,4IAA2E,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**************************************************************
|
|
2
|
-
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
-
**************************************************************/
|
|
4
|
-
/** Canonical installation identity for the Composition routed-stake plugin. */
|
|
5
|
-
import { MoveTuple } from '../utils/index.js';
|
|
6
|
-
import { bcs } from '@mysten/sui/bcs';
|
|
7
|
-
const $moduleName = '@local-pkg/composition_routed_stake::witness';
|
|
8
|
-
export const Witness = new MoveTuple({ name: `${$moduleName}::Witness`, fields: [bcs.bool()] });
|
|
9
|
-
//# sourceMappingURL=witness.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"witness.js","sourceRoot":"","sources":["../../../src/contracts/composition_routed_stake/witness.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAGhE,+EAA+E;AAE/E,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACtC,MAAM,WAAW,GAAG,8CAA8C,CAAC;AACnE,MAAM,CAAC,MAAM,OAAO,GAAG,IAAI,SAAS,CAAC,EAAE,IAAI,EAAE,GAAG,WAAW,WAAW,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC"}
|