diff --git a/README.md b/README.md index 8c86085..92f6dd7 100644 --- a/README.md +++ b/README.md @@ -390,15 +390,11 @@ quantus recovery claim --rescuer bob --lost alice ### Treasury -```bash -# Check treasury balance -quantus treasury balance - -# Submit a spend proposal -quantus treasury submit-spend --beneficiary
--amount 100.0 --track small --from alice +Treasury is the account that receives a configurable portion of mining rewards. No special spend/proposal flow — just view its state. -# Payout an approved spend -quantus treasury payout --index 0 --from alice +```bash +# Show treasury account and balance +quantus treasury info ``` --- diff --git a/src/chain/quantus_subxt.rs b/src/chain/quantus_subxt.rs index 0651a80..dd68717 100644 --- a/src/chain/quantus_subxt.rs +++ b/src/chain/quantus_subxt.rs @@ -6,7 +6,7 @@ pub mod api { mod root_mod { pub use super::*; } - pub static PALLETS: [&str; 22usize] = [ + pub static PALLETS: [&str; 21usize] = [ "System", "Timestamp", "Balances", @@ -23,7 +23,6 @@ pub mod api { "TechCollective", "TechReferenda", "TreasuryPallet", - "Origins", "Recovery", "Assets", "AssetsHolder", @@ -1470,9 +1469,10 @@ pub mod api { "query_call_info", types::QueryCallInfo { call, len }, [ - 204u8, 150u8, 141u8, 3u8, 172u8, 39u8, 127u8, 54u8, 249u8, 96u8, 163u8, - 158u8, 93u8, 236u8, 159u8, 71u8, 49u8, 22u8, 104u8, 202u8, 3u8, 96u8, - 247u8, 91u8, 244u8, 94u8, 201u8, 162u8, 142u8, 28u8, 197u8, 142u8, + 199u8, 188u8, 161u8, 1u8, 221u8, 186u8, 101u8, 194u8, 181u8, 107u8, + 212u8, 35u8, 2u8, 8u8, 198u8, 148u8, 37u8, 179u8, 92u8, 122u8, 253u8, + 235u8, 62u8, 173u8, 213u8, 18u8, 26u8, 170u8, 135u8, 120u8, 162u8, + 32u8, ], ) } @@ -1490,9 +1490,9 @@ pub mod api { "query_call_fee_details", types::QueryCallFeeDetails { call, len }, [ - 188u8, 8u8, 21u8, 155u8, 112u8, 74u8, 100u8, 5u8, 115u8, 144u8, 213u8, - 217u8, 106u8, 97u8, 48u8, 45u8, 93u8, 58u8, 101u8, 97u8, 226u8, 204u8, - 167u8, 167u8, 138u8, 151u8, 24u8, 106u8, 149u8, 11u8, 55u8, 170u8, + 156u8, 135u8, 85u8, 250u8, 145u8, 189u8, 63u8, 36u8, 186u8, 134u8, 9u8, + 17u8, 4u8, 79u8, 120u8, 98u8, 63u8, 219u8, 216u8, 44u8, 158u8, 88u8, + 126u8, 41u8, 0u8, 97u8, 93u8, 234u8, 249u8, 179u8, 170u8, 134u8, ], ) } @@ -1850,9 +1850,6 @@ pub mod api { pub fn tech_referenda(&self) -> tech_referenda::constants::ConstantsApi { tech_referenda::constants::ConstantsApi } - pub fn treasury_pallet(&self) -> treasury_pallet::constants::ConstantsApi { - treasury_pallet::constants::ConstantsApi - } pub fn recovery(&self) -> recovery::constants::ConstantsApi { recovery::constants::ConstantsApi } @@ -1994,9 +1991,9 @@ pub mod api { .hash(); runtime_metadata_hash == [ - 60u8, 255u8, 4u8, 208u8, 41u8, 252u8, 232u8, 254u8, 146u8, 6u8, 174u8, 75u8, 170u8, - 225u8, 3u8, 217u8, 68u8, 231u8, 231u8, 227u8, 166u8, 46u8, 206u8, 236u8, 155u8, - 201u8, 2u8, 240u8, 72u8, 62u8, 125u8, 106u8, + 6u8, 176u8, 107u8, 34u8, 235u8, 221u8, 156u8, 243u8, 98u8, 115u8, 170u8, 186u8, + 22u8, 200u8, 173u8, 142u8, 190u8, 154u8, 75u8, 86u8, 176u8, 207u8, 65u8, 103u8, + 203u8, 172u8, 16u8, 101u8, 182u8, 189u8, 166u8, 9u8, ] } pub mod system { @@ -3095,9 +3092,10 @@ pub mod api { "Events", (), [ - 137u8, 200u8, 171u8, 24u8, 189u8, 55u8, 241u8, 103u8, 215u8, 54u8, - 98u8, 177u8, 217u8, 184u8, 55u8, 205u8, 187u8, 36u8, 71u8, 136u8, 71u8, - 63u8, 1u8, 7u8, 221u8, 213u8, 113u8, 189u8, 226u8, 251u8, 216u8, 172u8, + 241u8, 44u8, 250u8, 237u8, 114u8, 188u8, 218u8, 139u8, 207u8, 203u8, + 98u8, 141u8, 52u8, 57u8, 67u8, 245u8, 118u8, 165u8, 129u8, 196u8, + 139u8, 67u8, 96u8, 116u8, 183u8, 195u8, 161u8, 74u8, 24u8, 241u8, 78u8, + 18u8, ], ) } @@ -5377,10 +5375,10 @@ pub mod api { call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), }, [ - 139u8, 70u8, 66u8, 133u8, 103u8, 122u8, 116u8, 79u8, 33u8, 114u8, - 121u8, 140u8, 45u8, 159u8, 190u8, 20u8, 82u8, 18u8, 149u8, 237u8, - 153u8, 207u8, 254u8, 49u8, 229u8, 147u8, 158u8, 47u8, 98u8, 221u8, - 64u8, 208u8, + 235u8, 252u8, 124u8, 242u8, 195u8, 130u8, 86u8, 167u8, 204u8, 55u8, + 207u8, 110u8, 60u8, 82u8, 15u8, 153u8, 58u8, 150u8, 49u8, 77u8, 183u8, + 179u8, 231u8, 126u8, 81u8, 68u8, 233u8, 247u8, 190u8, 21u8, 53u8, + 194u8, ], ) } @@ -5403,9 +5401,9 @@ pub mod api { weight, }, [ - 161u8, 255u8, 101u8, 97u8, 2u8, 224u8, 1u8, 98u8, 65u8, 47u8, 40u8, - 73u8, 58u8, 241u8, 87u8, 27u8, 49u8, 27u8, 58u8, 156u8, 63u8, 175u8, - 215u8, 152u8, 16u8, 46u8, 118u8, 155u8, 93u8, 41u8, 165u8, 173u8, + 214u8, 170u8, 23u8, 224u8, 160u8, 17u8, 199u8, 78u8, 163u8, 142u8, + 191u8, 81u8, 242u8, 253u8, 7u8, 41u8, 42u8, 123u8, 122u8, 6u8, 71u8, + 144u8, 194u8, 23u8, 2u8, 82u8, 99u8, 51u8, 26u8, 35u8, 125u8, 136u8, ], ) } @@ -5443,10 +5441,9 @@ pub mod api { call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), }, [ - 29u8, 143u8, 178u8, 190u8, 95u8, 145u8, 17u8, 240u8, 94u8, 218u8, 89u8, - 233u8, 194u8, 39u8, 196u8, 247u8, 210u8, 165u8, 71u8, 62u8, 164u8, - 175u8, 42u8, 179u8, 137u8, 187u8, 177u8, 10u8, 248u8, 157u8, 91u8, - 93u8, + 223u8, 26u8, 145u8, 224u8, 83u8, 235u8, 132u8, 251u8, 203u8, 56u8, + 35u8, 235u8, 15u8, 239u8, 96u8, 37u8, 70u8, 167u8, 19u8, 28u8, 179u8, + 196u8, 251u8, 19u8, 53u8, 98u8, 90u8, 187u8, 93u8, 139u8, 8u8, 46u8, ], ) } @@ -6006,22 +6003,6 @@ pub mod api { ], ) } - #[doc = " The portion of rewards that goes to treasury"] - pub fn treasury_portion( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - runtime_types::sp_arithmetic::per_things::Permill, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "MiningRewards", - "TreasuryPortion", - [ - 65u8, 93u8, 120u8, 165u8, 204u8, 81u8, 159u8, 163u8, 93u8, 135u8, - 114u8, 121u8, 147u8, 35u8, 215u8, 213u8, 4u8, 223u8, 83u8, 37u8, 225u8, - 200u8, 189u8, 156u8, 140u8, 36u8, 58u8, 46u8, 42u8, 232u8, 155u8, 0u8, - ], - ) - } #[doc = " The base unit for token amounts (e.g., 1e12 for 12 decimals)"] pub fn unit( &self, @@ -6038,22 +6019,6 @@ pub mod api { ], ) } - #[doc = " The treasury pallet ID"] - pub fn treasury_pallet_id( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - runtime_types::frame_support::PalletId, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "MiningRewards", - "TreasuryPalletId", - [ - 56u8, 243u8, 53u8, 83u8, 154u8, 179u8, 170u8, 80u8, 133u8, 173u8, 61u8, - 161u8, 47u8, 225u8, 146u8, 21u8, 50u8, 229u8, 248u8, 27u8, 104u8, 58u8, - 129u8, 197u8, 102u8, 160u8, 168u8, 205u8, 154u8, 42u8, 217u8, 53u8, - ], - ) - } #[doc = " Account ID used as the \"from\" account when creating transfer proofs for minted tokens"] pub fn minting_account( &self, @@ -6935,10 +6900,10 @@ pub mod api { call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), }, [ - 102u8, 103u8, 19u8, 115u8, 19u8, 43u8, 141u8, 147u8, 145u8, 130u8, - 118u8, 205u8, 116u8, 21u8, 169u8, 245u8, 91u8, 195u8, 69u8, 49u8, 11u8, - 189u8, 250u8, 142u8, 248u8, 124u8, 135u8, 217u8, 78u8, 252u8, 36u8, - 226u8, + 224u8, 6u8, 189u8, 143u8, 200u8, 31u8, 204u8, 102u8, 211u8, 15u8, + 164u8, 111u8, 111u8, 157u8, 53u8, 14u8, 41u8, 226u8, 8u8, 91u8, 222u8, + 46u8, 96u8, 23u8, 184u8, 224u8, 106u8, 73u8, 136u8, 212u8, 163u8, + 119u8, ], ) } @@ -6980,10 +6945,9 @@ pub mod api { call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), }, [ - 138u8, 207u8, 16u8, 247u8, 167u8, 103u8, 166u8, 249u8, 84u8, 160u8, - 115u8, 250u8, 241u8, 153u8, 56u8, 116u8, 81u8, 181u8, 152u8, 239u8, - 95u8, 135u8, 69u8, 165u8, 228u8, 216u8, 227u8, 71u8, 157u8, 114u8, - 117u8, 192u8, + 228u8, 52u8, 241u8, 237u8, 177u8, 69u8, 209u8, 126u8, 196u8, 0u8, 1u8, + 152u8, 0u8, 117u8, 117u8, 227u8, 72u8, 124u8, 81u8, 126u8, 11u8, 117u8, + 180u8, 18u8, 129u8, 149u8, 145u8, 206u8, 126u8, 13u8, 138u8, 140u8, ], ) } @@ -7022,9 +6986,10 @@ pub mod api { call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), }, [ - 229u8, 249u8, 88u8, 250u8, 31u8, 188u8, 238u8, 42u8, 94u8, 153u8, 29u8, - 70u8, 199u8, 95u8, 46u8, 113u8, 204u8, 236u8, 225u8, 200u8, 34u8, 55u8, - 82u8, 32u8, 14u8, 154u8, 73u8, 175u8, 205u8, 6u8, 165u8, 72u8, + 218u8, 34u8, 168u8, 237u8, 208u8, 192u8, 26u8, 15u8, 77u8, 152u8, + 243u8, 13u8, 66u8, 66u8, 168u8, 240u8, 182u8, 196u8, 247u8, 169u8, + 126u8, 238u8, 147u8, 25u8, 252u8, 154u8, 229u8, 118u8, 103u8, 62u8, + 252u8, 183u8, ], ) } @@ -7049,9 +7014,9 @@ pub mod api { call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), }, [ - 171u8, 36u8, 101u8, 188u8, 133u8, 123u8, 205u8, 135u8, 23u8, 2u8, 7u8, - 96u8, 10u8, 38u8, 102u8, 157u8, 170u8, 113u8, 223u8, 3u8, 144u8, 47u8, - 168u8, 57u8, 167u8, 12u8, 195u8, 66u8, 158u8, 250u8, 66u8, 157u8, + 157u8, 255u8, 142u8, 245u8, 199u8, 237u8, 39u8, 15u8, 52u8, 63u8, 11u8, + 103u8, 84u8, 123u8, 21u8, 63u8, 19u8, 191u8, 243u8, 74u8, 140u8, 253u8, + 23u8, 246u8, 33u8, 126u8, 198u8, 67u8, 171u8, 116u8, 6u8, 136u8, ], ) } @@ -7552,9 +7517,9 @@ pub mod api { "Agenda", (), [ - 188u8, 177u8, 84u8, 167u8, 206u8, 4u8, 136u8, 133u8, 67u8, 121u8, - 247u8, 186u8, 6u8, 46u8, 115u8, 104u8, 239u8, 41u8, 75u8, 143u8, 24u8, - 155u8, 212u8, 196u8, 166u8, 82u8, 63u8, 39u8, 104u8, 21u8, 19u8, 93u8, + 167u8, 175u8, 28u8, 224u8, 44u8, 149u8, 114u8, 12u8, 119u8, 107u8, + 50u8, 64u8, 173u8, 39u8, 48u8, 85u8, 151u8, 68u8, 15u8, 145u8, 182u8, + 105u8, 30u8, 18u8, 132u8, 11u8, 249u8, 54u8, 47u8, 73u8, 51u8, 49u8, ], ) } @@ -7576,9 +7541,9 @@ pub mod api { "Agenda", ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 188u8, 177u8, 84u8, 167u8, 206u8, 4u8, 136u8, 133u8, 67u8, 121u8, - 247u8, 186u8, 6u8, 46u8, 115u8, 104u8, 239u8, 41u8, 75u8, 143u8, 24u8, - 155u8, 212u8, 196u8, 166u8, 82u8, 63u8, 39u8, 104u8, 21u8, 19u8, 93u8, + 167u8, 175u8, 28u8, 224u8, 44u8, 149u8, 114u8, 12u8, 119u8, 107u8, + 50u8, 64u8, 173u8, 39u8, 48u8, 85u8, 151u8, 68u8, 15u8, 145u8, 182u8, + 105u8, 30u8, 18u8, 132u8, 11u8, 249u8, 54u8, 47u8, 73u8, 51u8, 49u8, ], ) } @@ -8079,10 +8044,9 @@ pub mod api { "batch", types::Batch { calls }, [ - 111u8, 193u8, 119u8, 118u8, 37u8, 86u8, 134u8, 214u8, 148u8, 113u8, - 255u8, 207u8, 186u8, 6u8, 247u8, 84u8, 23u8, 246u8, 144u8, 242u8, - 114u8, 20u8, 105u8, 119u8, 137u8, 247u8, 189u8, 240u8, 237u8, 176u8, - 71u8, 249u8, + 155u8, 149u8, 6u8, 3u8, 240u8, 237u8, 103u8, 22u8, 219u8, 24u8, 245u8, + 110u8, 138u8, 189u8, 75u8, 126u8, 215u8, 181u8, 117u8, 72u8, 196u8, + 39u8, 186u8, 101u8, 187u8, 8u8, 96u8, 149u8, 28u8, 248u8, 222u8, 109u8, ], ) } @@ -8112,9 +8076,10 @@ pub mod api { call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), }, [ - 50u8, 167u8, 42u8, 97u8, 124u8, 144u8, 249u8, 155u8, 195u8, 246u8, - 155u8, 91u8, 32u8, 182u8, 54u8, 42u8, 176u8, 178u8, 66u8, 99u8, 46u8, - 182u8, 8u8, 242u8, 233u8, 63u8, 68u8, 60u8, 204u8, 60u8, 49u8, 112u8, + 173u8, 115u8, 46u8, 156u8, 121u8, 254u8, 127u8, 247u8, 13u8, 159u8, + 73u8, 166u8, 201u8, 33u8, 250u8, 239u8, 35u8, 251u8, 200u8, 191u8, + 248u8, 135u8, 58u8, 73u8, 213u8, 223u8, 252u8, 27u8, 226u8, 201u8, + 246u8, 77u8, ], ) } @@ -8140,9 +8105,9 @@ pub mod api { "batch_all", types::BatchAll { calls }, [ - 252u8, 233u8, 123u8, 196u8, 206u8, 108u8, 105u8, 36u8, 203u8, 174u8, - 73u8, 179u8, 76u8, 42u8, 56u8, 144u8, 167u8, 61u8, 204u8, 87u8, 132u8, - 57u8, 191u8, 199u8, 63u8, 71u8, 132u8, 174u8, 54u8, 230u8, 21u8, 199u8, + 128u8, 37u8, 142u8, 195u8, 193u8, 178u8, 226u8, 203u8, 7u8, 68u8, 45u8, + 6u8, 57u8, 118u8, 167u8, 205u8, 14u8, 254u8, 113u8, 148u8, 121u8, 49u8, + 73u8, 85u8, 171u8, 120u8, 214u8, 244u8, 189u8, 148u8, 26u8, 42u8, ], ) } @@ -8165,10 +8130,9 @@ pub mod api { call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), }, [ - 243u8, 223u8, 67u8, 77u8, 222u8, 227u8, 101u8, 159u8, 246u8, 109u8, - 238u8, 21u8, 135u8, 5u8, 26u8, 29u8, 49u8, 17u8, 29u8, 167u8, 76u8, - 84u8, 227u8, 151u8, 234u8, 214u8, 35u8, 234u8, 129u8, 163u8, 181u8, - 149u8, + 180u8, 19u8, 17u8, 244u8, 48u8, 143u8, 161u8, 235u8, 101u8, 243u8, + 230u8, 227u8, 114u8, 194u8, 81u8, 81u8, 123u8, 243u8, 218u8, 8u8, 36u8, + 39u8, 113u8, 231u8, 135u8, 169u8, 130u8, 71u8, 161u8, 21u8, 32u8, 63u8, ], ) } @@ -8194,9 +8158,9 @@ pub mod api { "force_batch", types::ForceBatch { calls }, [ - 13u8, 145u8, 1u8, 24u8, 146u8, 209u8, 200u8, 218u8, 24u8, 166u8, 190u8, - 203u8, 29u8, 162u8, 219u8, 181u8, 35u8, 237u8, 96u8, 196u8, 199u8, - 85u8, 173u8, 24u8, 184u8, 12u8, 148u8, 51u8, 14u8, 105u8, 131u8, 132u8, + 192u8, 220u8, 30u8, 205u8, 109u8, 252u8, 9u8, 10u8, 4u8, 11u8, 39u8, + 93u8, 83u8, 157u8, 223u8, 68u8, 132u8, 9u8, 203u8, 158u8, 114u8, 64u8, + 238u8, 241u8, 48u8, 254u8, 246u8, 152u8, 43u8, 99u8, 30u8, 67u8, ], ) } @@ -8219,10 +8183,9 @@ pub mod api { weight, }, [ - 111u8, 148u8, 45u8, 217u8, 132u8, 185u8, 150u8, 232u8, 91u8, 77u8, - 142u8, 98u8, 175u8, 13u8, 252u8, 220u8, 199u8, 177u8, 171u8, 155u8, - 84u8, 242u8, 40u8, 132u8, 77u8, 201u8, 7u8, 25u8, 102u8, 169u8, 235u8, - 6u8, + 251u8, 120u8, 183u8, 92u8, 139u8, 200u8, 63u8, 201u8, 130u8, 145u8, + 125u8, 95u8, 17u8, 214u8, 57u8, 49u8, 199u8, 175u8, 155u8, 214u8, 64u8, + 61u8, 40u8, 245u8, 169u8, 110u8, 218u8, 80u8, 82u8, 68u8, 10u8, 212u8, ], ) } @@ -8262,9 +8225,9 @@ pub mod api { fallback: ::subxt::ext::subxt_core::alloc::boxed::Box::new(fallback), }, [ - 130u8, 245u8, 121u8, 31u8, 205u8, 1u8, 6u8, 43u8, 62u8, 146u8, 200u8, - 61u8, 223u8, 162u8, 42u8, 243u8, 202u8, 252u8, 66u8, 155u8, 227u8, - 70u8, 211u8, 133u8, 15u8, 65u8, 72u8, 47u8, 175u8, 127u8, 80u8, 88u8, + 42u8, 41u8, 254u8, 182u8, 132u8, 227u8, 59u8, 189u8, 21u8, 114u8, 86u8, + 54u8, 222u8, 2u8, 30u8, 39u8, 126u8, 189u8, 182u8, 196u8, 43u8, 144u8, + 82u8, 142u8, 193u8, 130u8, 12u8, 176u8, 130u8, 8u8, 224u8, 66u8, ], ) } @@ -8287,9 +8250,9 @@ pub mod api { call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), }, [ - 169u8, 9u8, 148u8, 133u8, 139u8, 233u8, 123u8, 12u8, 26u8, 40u8, 84u8, - 195u8, 239u8, 201u8, 104u8, 122u8, 9u8, 46u8, 249u8, 206u8, 220u8, - 186u8, 225u8, 142u8, 158u8, 10u8, 204u8, 24u8, 30u8, 246u8, 88u8, 15u8, + 75u8, 215u8, 72u8, 28u8, 158u8, 75u8, 120u8, 123u8, 163u8, 231u8, + 230u8, 11u8, 125u8, 11u8, 40u8, 218u8, 78u8, 60u8, 240u8, 31u8, 159u8, + 16u8, 135u8, 56u8, 244u8, 178u8, 72u8, 63u8, 14u8, 23u8, 193u8, 52u8, ], ) } @@ -8771,9 +8734,9 @@ pub mod api { enactment_moment, }, [ - 30u8, 232u8, 132u8, 0u8, 199u8, 166u8, 49u8, 94u8, 238u8, 61u8, 236u8, - 207u8, 2u8, 136u8, 37u8, 81u8, 67u8, 133u8, 2u8, 147u8, 177u8, 176u8, - 178u8, 113u8, 155u8, 180u8, 104u8, 176u8, 215u8, 255u8, 240u8, 100u8, + 0u8, 18u8, 14u8, 253u8, 33u8, 212u8, 33u8, 173u8, 241u8, 29u8, 88u8, + 160u8, 111u8, 21u8, 6u8, 234u8, 249u8, 230u8, 222u8, 119u8, 161u8, + 114u8, 43u8, 126u8, 164u8, 140u8, 199u8, 39u8, 2u8, 64u8, 132u8, 34u8, ], ) } @@ -9416,9 +9379,10 @@ pub mod api { "ReferendumInfoFor", (), [ - 141u8, 184u8, 126u8, 61u8, 215u8, 190u8, 148u8, 93u8, 186u8, 72u8, - 110u8, 37u8, 82u8, 237u8, 65u8, 197u8, 69u8, 83u8, 173u8, 114u8, 117u8, - 72u8, 146u8, 28u8, 235u8, 60u8, 188u8, 247u8, 80u8, 240u8, 16u8, 194u8, + 6u8, 83u8, 1u8, 153u8, 41u8, 128u8, 169u8, 32u8, 101u8, 55u8, 230u8, + 219u8, 157u8, 37u8, 148u8, 156u8, 183u8, 164u8, 133u8, 238u8, 54u8, + 243u8, 158u8, 246u8, 58u8, 235u8, 6u8, 127u8, 29u8, 163u8, 255u8, + 157u8, ], ) } @@ -9440,9 +9404,10 @@ pub mod api { "ReferendumInfoFor", ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 141u8, 184u8, 126u8, 61u8, 215u8, 190u8, 148u8, 93u8, 186u8, 72u8, - 110u8, 37u8, 82u8, 237u8, 65u8, 197u8, 69u8, 83u8, 173u8, 114u8, 117u8, - 72u8, 146u8, 28u8, 235u8, 60u8, 188u8, 247u8, 80u8, 240u8, 16u8, 194u8, + 6u8, 83u8, 1u8, 153u8, 41u8, 128u8, 169u8, 32u8, 101u8, 55u8, 230u8, + 219u8, 157u8, 37u8, 148u8, 156u8, 183u8, 164u8, 133u8, 238u8, 54u8, + 243u8, 158u8, 246u8, 58u8, 235u8, 6u8, 127u8, 29u8, 163u8, 255u8, + 157u8, ], ) } @@ -12838,9 +12803,9 @@ pub mod api { enactment_moment, }, [ - 30u8, 232u8, 132u8, 0u8, 199u8, 166u8, 49u8, 94u8, 238u8, 61u8, 236u8, - 207u8, 2u8, 136u8, 37u8, 81u8, 67u8, 133u8, 2u8, 147u8, 177u8, 176u8, - 178u8, 113u8, 155u8, 180u8, 104u8, 176u8, 215u8, 255u8, 240u8, 100u8, + 0u8, 18u8, 14u8, 253u8, 33u8, 212u8, 33u8, 173u8, 241u8, 29u8, 88u8, + 160u8, 111u8, 21u8, 6u8, 234u8, 249u8, 230u8, 222u8, 119u8, 161u8, + 114u8, 43u8, 126u8, 164u8, 140u8, 199u8, 39u8, 2u8, 64u8, 132u8, 34u8, ], ) } @@ -13475,9 +13440,9 @@ pub mod api { "ReferendumInfoFor", (), [ - 12u8, 160u8, 226u8, 48u8, 96u8, 127u8, 60u8, 27u8, 37u8, 158u8, 31u8, - 162u8, 106u8, 183u8, 90u8, 169u8, 244u8, 35u8, 25u8, 121u8, 84u8, - 120u8, 20u8, 206u8, 137u8, 42u8, 139u8, 47u8, 62u8, 73u8, 157u8, 182u8, + 242u8, 125u8, 226u8, 99u8, 67u8, 226u8, 43u8, 159u8, 222u8, 238u8, + 72u8, 38u8, 45u8, 26u8, 95u8, 64u8, 141u8, 140u8, 37u8, 44u8, 101u8, + 67u8, 46u8, 66u8, 45u8, 93u8, 41u8, 156u8, 63u8, 59u8, 9u8, 29u8, ], ) } @@ -13499,9 +13464,9 @@ pub mod api { "ReferendumInfoFor", ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), [ - 12u8, 160u8, 226u8, 48u8, 96u8, 127u8, 60u8, 27u8, 37u8, 158u8, 31u8, - 162u8, 106u8, 183u8, 90u8, 169u8, 244u8, 35u8, 25u8, 121u8, 84u8, - 120u8, 20u8, 206u8, 137u8, 42u8, 139u8, 47u8, 62u8, 73u8, 157u8, 182u8, + 242u8, 125u8, 226u8, 99u8, 67u8, 226u8, 43u8, 159u8, 222u8, 238u8, + 72u8, 38u8, 45u8, 26u8, 95u8, 64u8, 141u8, 140u8, 37u8, 44u8, 101u8, + 67u8, 46u8, 66u8, 45u8, 93u8, 41u8, 156u8, 63u8, 59u8, 9u8, 29u8, ], ) } @@ -13769,7 +13734,7 @@ pub mod api { } pub mod treasury_pallet { use super::{root_mod, runtime_types}; - #[doc = "Error for the treasury pallet."] + #[doc = "The `Error` enum of this pallet."] pub type Error = runtime_types::pallet_treasury::pallet::Error; #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub type Call = runtime_types::pallet_treasury::pallet::Call; @@ -13789,224 +13754,17 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Propose and approve a spend of treasury funds."] - #[doc = ""] - #[doc = "## Dispatch Origin"] - #[doc = ""] - #[doc = "Must be [`Config::SpendOrigin`] with the `Success` value being at least `amount`."] - #[doc = ""] - #[doc = "### Details"] - #[doc = "NOTE: For record-keeping purposes, the proposer is deemed to be equivalent to the"] - #[doc = "beneficiary."] - #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `amount`: The amount to be transferred from the treasury to the `beneficiary`."] - #[doc = "- `beneficiary`: The destination account for the transfer."] - #[doc = ""] - #[doc = "## Events"] - #[doc = ""] - #[doc = "Emits [`Event::SpendApproved`] if successful."] - pub struct SpendLocal { - #[codec(compact)] - pub amount: spend_local::Amount, - pub beneficiary: spend_local::Beneficiary, - } - pub mod spend_local { - use super::runtime_types; - pub type Amount = ::core::primitive::u128; - pub type Beneficiary = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SpendLocal { - const PALLET: &'static str = "TreasuryPallet"; - const CALL: &'static str = "spend_local"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Force a previously approved proposal to be removed from the approval queue."] - #[doc = ""] - #[doc = "## Dispatch Origin"] - #[doc = ""] - #[doc = "Must be [`Config::RejectOrigin`]."] - #[doc = ""] - #[doc = "## Details"] - #[doc = ""] - #[doc = "The original deposit will no longer be returned."] - #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `proposal_id`: The index of a proposal"] - #[doc = ""] - #[doc = "### Complexity"] - #[doc = "- O(A) where `A` is the number of approvals"] - #[doc = ""] - #[doc = "### Errors"] - #[doc = "- [`Error::ProposalNotApproved`]: The `proposal_id` supplied was not found in the"] - #[doc = " approval queue, i.e., the proposal has not been approved. This could also mean the"] - #[doc = " proposal does not exist altogether, thus there is no way it would have been approved"] - #[doc = " in the first place."] - pub struct RemoveApproval { - #[codec(compact)] - pub proposal_id: remove_approval::ProposalId, - } - pub mod remove_approval { - use super::runtime_types; - pub type ProposalId = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for RemoveApproval { - const PALLET: &'static str = "TreasuryPallet"; - const CALL: &'static str = "remove_approval"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Propose and approve a spend of treasury funds."] - #[doc = ""] - #[doc = "## Dispatch Origin"] - #[doc = ""] - #[doc = "Must be [`Config::SpendOrigin`] with the `Success` value being at least"] - #[doc = "`amount` of `asset_kind` in the native asset. The amount of `asset_kind` is converted"] - #[doc = "for assertion using the [`Config::BalanceConverter`]."] - #[doc = ""] - #[doc = "## Details"] - #[doc = ""] - #[doc = "Create an approved spend for transferring a specific `amount` of `asset_kind` to a"] - #[doc = "designated beneficiary. The spend must be claimed using the `payout` dispatchable within"] - #[doc = "the [`Config::PayoutPeriod`]."] - #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `asset_kind`: An indicator of the specific asset class to be spent."] - #[doc = "- `amount`: The amount to be transferred from the treasury to the `beneficiary`."] - #[doc = "- `beneficiary`: The beneficiary of the spend."] - #[doc = "- `valid_from`: The block number from which the spend can be claimed. It can refer to"] - #[doc = " the past if the resulting spend has not yet expired according to the"] - #[doc = " [`Config::PayoutPeriod`]. If `None`, the spend can be claimed immediately after"] - #[doc = " approval."] - #[doc = ""] - #[doc = "## Events"] - #[doc = ""] - #[doc = "Emits [`Event::AssetSpendApproved`] if successful."] - pub struct Spend { - pub asset_kind: ::subxt::ext::subxt_core::alloc::boxed::Box, - #[codec(compact)] - pub amount: spend::Amount, - pub beneficiary: - ::subxt::ext::subxt_core::alloc::boxed::Box, - pub valid_from: spend::ValidFrom, - } - pub mod spend { - use super::runtime_types; - pub type AssetKind = (); - pub type Amount = ::core::primitive::u128; - pub type Beneficiary = ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >; - pub type ValidFrom = ::core::option::Option<::core::primitive::u32>; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Spend { - const PALLET: &'static str = "TreasuryPallet"; - const CALL: &'static str = "spend"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Claim a spend."] - #[doc = ""] - #[doc = "## Dispatch Origin"] - #[doc = ""] - #[doc = "Must be signed"] - #[doc = ""] - #[doc = "## Details"] - #[doc = ""] - #[doc = "Spends must be claimed within some temporal bounds. A spend may be claimed within one"] - #[doc = "[`Config::PayoutPeriod`] from the `valid_from` block."] - #[doc = "In case of a payout failure, the spend status must be updated with the `check_status`"] - #[doc = "dispatchable before retrying with the current function."] - #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `index`: The spend index."] - #[doc = ""] - #[doc = "## Events"] - #[doc = ""] - #[doc = "Emits [`Event::Paid`] if successful."] - pub struct Payout { - pub index: payout::Index, - } - pub mod payout { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for Payout { - const PALLET: &'static str = "TreasuryPallet"; - const CALL: &'static str = "payout"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - #[doc = "Check the status of the spend and remove it from the storage if processed."] - #[doc = ""] - #[doc = "## Dispatch Origin"] - #[doc = ""] - #[doc = "Must be signed."] - #[doc = ""] - #[doc = "## Details"] - #[doc = ""] - #[doc = "The status check is a prerequisite for retrying a failed payout."] - #[doc = "If a spend has either succeeded or expired, it is removed from the storage by this"] - #[doc = "function. In such instances, transaction fees are refunded."] - #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `index`: The spend index."] - #[doc = ""] - #[doc = "## Events"] - #[doc = ""] - #[doc = "Emits [`Event::PaymentFailed`] if the spend payout has failed."] - #[doc = "Emits [`Event::SpendProcessed`] if the spend payout has succeed."] - pub struct CheckStatus { - pub index: check_status::Index, + #[doc = "Set the treasury account. Root only."] + pub struct SetTreasuryAccount { + pub account: set_treasury_account::Account, } - pub mod check_status { + pub mod set_treasury_account { use super::runtime_types; - pub type Index = ::core::primitive::u32; + pub type Account = ::subxt::ext::subxt_core::utils::AccountId32; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for CheckStatus { + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetTreasuryAccount { const PALLET: &'static str = "TreasuryPallet"; - const CALL: &'static str = "check_status"; + const CALL: &'static str = "set_treasury_account"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -14019,256 +13777,54 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Void previously approved spend."] - #[doc = ""] - #[doc = "## Dispatch Origin"] - #[doc = ""] - #[doc = "Must be [`Config::RejectOrigin`]."] - #[doc = ""] - #[doc = "## Details"] - #[doc = ""] - #[doc = "A spend void is only possible if the payout has not been attempted yet."] - #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `index`: The spend index."] - #[doc = ""] - #[doc = "## Events"] - #[doc = ""] - #[doc = "Emits [`Event::AssetSpendVoided`] if successful."] - pub struct VoidSpend { - pub index: void_spend::Index, + #[doc = "Set the treasury portion (0-100). Root only."] + pub struct SetTreasuryPortion { + pub portion: set_treasury_portion::Portion, } - pub mod void_spend { + pub mod set_treasury_portion { use super::runtime_types; - pub type Index = ::core::primitive::u32; + pub type Portion = ::core::primitive::u8; } - impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for VoidSpend { + impl ::subxt::ext::subxt_core::blocks::StaticExtrinsic for SetTreasuryPortion { const PALLET: &'static str = "TreasuryPallet"; - const CALL: &'static str = "void_spend"; + const CALL: &'static str = "set_treasury_portion"; } } pub struct TransactionApi; impl TransactionApi { - #[doc = "Propose and approve a spend of treasury funds."] - #[doc = ""] - #[doc = "## Dispatch Origin"] - #[doc = ""] - #[doc = "Must be [`Config::SpendOrigin`] with the `Success` value being at least `amount`."] - #[doc = ""] - #[doc = "### Details"] - #[doc = "NOTE: For record-keeping purposes, the proposer is deemed to be equivalent to the"] - #[doc = "beneficiary."] - #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `amount`: The amount to be transferred from the treasury to the `beneficiary`."] - #[doc = "- `beneficiary`: The destination account for the transfer."] - #[doc = ""] - #[doc = "## Events"] - #[doc = ""] - #[doc = "Emits [`Event::SpendApproved`] if successful."] - pub fn spend_local( - &self, - amount: types::spend_local::Amount, - beneficiary: types::spend_local::Beneficiary, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TreasuryPallet", - "spend_local", - types::SpendLocal { amount, beneficiary }, - [ - 137u8, 171u8, 83u8, 247u8, 245u8, 212u8, 152u8, 127u8, 210u8, 71u8, - 254u8, 134u8, 189u8, 26u8, 249u8, 41u8, 214u8, 175u8, 24u8, 64u8, 33u8, - 90u8, 23u8, 134u8, 44u8, 110u8, 63u8, 46u8, 46u8, 146u8, 222u8, 79u8, - ], - ) - } - #[doc = "Force a previously approved proposal to be removed from the approval queue."] - #[doc = ""] - #[doc = "## Dispatch Origin"] - #[doc = ""] - #[doc = "Must be [`Config::RejectOrigin`]."] - #[doc = ""] - #[doc = "## Details"] - #[doc = ""] - #[doc = "The original deposit will no longer be returned."] - #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `proposal_id`: The index of a proposal"] - #[doc = ""] - #[doc = "### Complexity"] - #[doc = "- O(A) where `A` is the number of approvals"] - #[doc = ""] - #[doc = "### Errors"] - #[doc = "- [`Error::ProposalNotApproved`]: The `proposal_id` supplied was not found in the"] - #[doc = " approval queue, i.e., the proposal has not been approved. This could also mean the"] - #[doc = " proposal does not exist altogether, thus there is no way it would have been approved"] - #[doc = " in the first place."] - pub fn remove_approval( + #[doc = "Set the treasury account. Root only."] + pub fn set_treasury_account( &self, - proposal_id: types::remove_approval::ProposalId, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + account: types::set_treasury_account::Account, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( "TreasuryPallet", - "remove_approval", - types::RemoveApproval { proposal_id }, - [ - 180u8, 20u8, 39u8, 227u8, 29u8, 228u8, 234u8, 36u8, 155u8, 114u8, - 197u8, 135u8, 185u8, 31u8, 56u8, 247u8, 224u8, 168u8, 254u8, 233u8, - 250u8, 134u8, 186u8, 155u8, 108u8, 84u8, 94u8, 226u8, 207u8, 130u8, - 196u8, 100u8, - ], - ) - } - #[doc = "Propose and approve a spend of treasury funds."] - #[doc = ""] - #[doc = "## Dispatch Origin"] - #[doc = ""] - #[doc = "Must be [`Config::SpendOrigin`] with the `Success` value being at least"] - #[doc = "`amount` of `asset_kind` in the native asset. The amount of `asset_kind` is converted"] - #[doc = "for assertion using the [`Config::BalanceConverter`]."] - #[doc = ""] - #[doc = "## Details"] - #[doc = ""] - #[doc = "Create an approved spend for transferring a specific `amount` of `asset_kind` to a"] - #[doc = "designated beneficiary. The spend must be claimed using the `payout` dispatchable within"] - #[doc = "the [`Config::PayoutPeriod`]."] - #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `asset_kind`: An indicator of the specific asset class to be spent."] - #[doc = "- `amount`: The amount to be transferred from the treasury to the `beneficiary`."] - #[doc = "- `beneficiary`: The beneficiary of the spend."] - #[doc = "- `valid_from`: The block number from which the spend can be claimed. It can refer to"] - #[doc = " the past if the resulting spend has not yet expired according to the"] - #[doc = " [`Config::PayoutPeriod`]. If `None`, the spend can be claimed immediately after"] - #[doc = " approval."] - #[doc = ""] - #[doc = "## Events"] - #[doc = ""] - #[doc = "Emits [`Event::AssetSpendApproved`] if successful."] - pub fn spend( - &self, - asset_kind: types::spend::AssetKind, - amount: types::spend::Amount, - beneficiary: types::spend::Beneficiary, - valid_from: types::spend::ValidFrom, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TreasuryPallet", - "spend", - types::Spend { - asset_kind: ::subxt::ext::subxt_core::alloc::boxed::Box::new( - asset_kind, - ), - amount, - beneficiary: ::subxt::ext::subxt_core::alloc::boxed::Box::new( - beneficiary, - ), - valid_from, - }, - [ - 64u8, 121u8, 249u8, 219u8, 22u8, 188u8, 167u8, 85u8, 45u8, 27u8, 200u8, - 219u8, 138u8, 17u8, 230u8, 106u8, 145u8, 39u8, 43u8, 161u8, 69u8, 10u8, - 202u8, 251u8, 127u8, 131u8, 0u8, 194u8, 25u8, 153u8, 169u8, 206u8, - ], - ) - } - #[doc = "Claim a spend."] - #[doc = ""] - #[doc = "## Dispatch Origin"] - #[doc = ""] - #[doc = "Must be signed"] - #[doc = ""] - #[doc = "## Details"] - #[doc = ""] - #[doc = "Spends must be claimed within some temporal bounds. A spend may be claimed within one"] - #[doc = "[`Config::PayoutPeriod`] from the `valid_from` block."] - #[doc = "In case of a payout failure, the spend status must be updated with the `check_status`"] - #[doc = "dispatchable before retrying with the current function."] - #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `index`: The spend index."] - #[doc = ""] - #[doc = "## Events"] - #[doc = ""] - #[doc = "Emits [`Event::Paid`] if successful."] - pub fn payout( - &self, - index: types::payout::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TreasuryPallet", - "payout", - types::Payout { index }, - [ - 179u8, 254u8, 82u8, 94u8, 248u8, 26u8, 6u8, 34u8, 93u8, 244u8, 186u8, - 199u8, 163u8, 32u8, 110u8, 220u8, 78u8, 11u8, 168u8, 182u8, 169u8, - 56u8, 53u8, 194u8, 168u8, 218u8, 131u8, 38u8, 46u8, 156u8, 93u8, 234u8, - ], - ) - } - #[doc = "Check the status of the spend and remove it from the storage if processed."] - #[doc = ""] - #[doc = "## Dispatch Origin"] - #[doc = ""] - #[doc = "Must be signed."] - #[doc = ""] - #[doc = "## Details"] - #[doc = ""] - #[doc = "The status check is a prerequisite for retrying a failed payout."] - #[doc = "If a spend has either succeeded or expired, it is removed from the storage by this"] - #[doc = "function. In such instances, transaction fees are refunded."] - #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `index`: The spend index."] - #[doc = ""] - #[doc = "## Events"] - #[doc = ""] - #[doc = "Emits [`Event::PaymentFailed`] if the spend payout has failed."] - #[doc = "Emits [`Event::SpendProcessed`] if the spend payout has succeed."] - pub fn check_status( - &self, - index: types::check_status::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { - ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( - "TreasuryPallet", - "check_status", - types::CheckStatus { index }, + "set_treasury_account", + types::SetTreasuryAccount { account }, [ - 164u8, 111u8, 10u8, 11u8, 104u8, 237u8, 112u8, 240u8, 104u8, 130u8, - 179u8, 221u8, 54u8, 18u8, 8u8, 172u8, 148u8, 245u8, 110u8, 174u8, 75u8, - 38u8, 46u8, 143u8, 101u8, 232u8, 65u8, 252u8, 36u8, 152u8, 29u8, 209u8, + 221u8, 22u8, 186u8, 39u8, 76u8, 65u8, 143u8, 149u8, 126u8, 244u8, + 227u8, 129u8, 16u8, 183u8, 56u8, 248u8, 82u8, 131u8, 255u8, 246u8, + 243u8, 145u8, 255u8, 5u8, 125u8, 142u8, 201u8, 38u8, 185u8, 124u8, + 76u8, 167u8, ], ) } - #[doc = "Void previously approved spend."] - #[doc = ""] - #[doc = "## Dispatch Origin"] - #[doc = ""] - #[doc = "Must be [`Config::RejectOrigin`]."] - #[doc = ""] - #[doc = "## Details"] - #[doc = ""] - #[doc = "A spend void is only possible if the payout has not been attempted yet."] - #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `index`: The spend index."] - #[doc = ""] - #[doc = "## Events"] - #[doc = ""] - #[doc = "Emits [`Event::AssetSpendVoided`] if successful."] - pub fn void_spend( + #[doc = "Set the treasury portion (0-100). Root only."] + pub fn set_treasury_portion( &self, - index: types::void_spend::Index, - ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload { + portion: types::set_treasury_portion::Portion, + ) -> ::subxt::ext::subxt_core::tx::payload::StaticPayload + { ::subxt::ext::subxt_core::tx::payload::StaticPayload::new_static( "TreasuryPallet", - "void_spend", - types::VoidSpend { index }, + "set_treasury_portion", + types::SetTreasuryPortion { portion }, [ - 9u8, 212u8, 174u8, 92u8, 43u8, 102u8, 224u8, 124u8, 247u8, 239u8, - 196u8, 68u8, 132u8, 171u8, 116u8, 206u8, 52u8, 23u8, 92u8, 31u8, 156u8, - 160u8, 25u8, 16u8, 125u8, 60u8, 9u8, 109u8, 145u8, 139u8, 102u8, 224u8, + 233u8, 84u8, 25u8, 145u8, 26u8, 255u8, 146u8, 109u8, 128u8, 122u8, + 219u8, 78u8, 209u8, 193u8, 255u8, 120u8, 59u8, 121u8, 225u8, 15u8, + 12u8, 203u8, 250u8, 6u8, 174u8, 6u8, 221u8, 153u8, 35u8, 240u8, 88u8, + 204u8, ], ) } @@ -14285,17 +13841,16 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "We have ended a spend period and will now allocate funds."] - pub struct Spending { - pub budget_remaining: spending::BudgetRemaining, + pub struct TreasuryAccountUpdated { + pub new_account: treasury_account_updated::NewAccount, } - pub mod spending { + pub mod treasury_account_updated { use super::runtime_types; - pub type BudgetRemaining = ::core::primitive::u128; + pub type NewAccount = ::subxt::ext::subxt_core::utils::AccountId32; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Spending { + impl ::subxt::ext::subxt_core::events::StaticEvent for TreasuryAccountUpdated { const PALLET: &'static str = "TreasuryPallet"; - const EVENT: &'static str = "Spending"; + const EVENT: &'static str = "TreasuryAccountUpdated"; } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -14304,614 +13859,79 @@ pub mod api { )] #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Some funds have been allocated."] - pub struct Awarded { - pub proposal_index: awarded::ProposalIndex, - pub award: awarded::Award, - pub account: awarded::Account, + pub struct TreasuryPortionUpdated { + pub new_portion: treasury_portion_updated::NewPortion, } - pub mod awarded { + pub mod treasury_portion_updated { use super::runtime_types; - pub type ProposalIndex = ::core::primitive::u32; - pub type Award = ::core::primitive::u128; - pub type Account = ::subxt::ext::subxt_core::utils::AccountId32; + pub type NewPortion = ::core::primitive::u8; } - impl ::subxt::ext::subxt_core::events::StaticEvent for Awarded { + impl ::subxt::ext::subxt_core::events::StaticEvent for TreasuryPortionUpdated { const PALLET: &'static str = "TreasuryPallet"; - const EVENT: &'static str = "Awarded"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Some of our funds have been burnt."] - pub struct Burnt { - pub burnt_funds: burnt::BurntFunds, + const EVENT: &'static str = "TreasuryPortionUpdated"; } - pub mod burnt { + } + pub mod storage { + use super::runtime_types; + pub mod types { use super::runtime_types; - pub type BurntFunds = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Burnt { - const PALLET: &'static str = "TreasuryPallet"; - const EVENT: &'static str = "Burnt"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Spending has finished; this is the amount that rolls over until next spend."] - pub struct Rollover { - pub rollover_balance: rollover::RolloverBalance, - } - pub mod rollover { - use super::runtime_types; - pub type RolloverBalance = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Rollover { - const PALLET: &'static str = "TreasuryPallet"; - const EVENT: &'static str = "Rollover"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "Some funds have been deposited."] - pub struct Deposit { - pub value: deposit::Value, - } - pub mod deposit { - use super::runtime_types; - pub type Value = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Deposit { - const PALLET: &'static str = "TreasuryPallet"; - const EVENT: &'static str = "Deposit"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A new spend proposal has been approved."] - pub struct SpendApproved { - pub proposal_index: spend_approved::ProposalIndex, - pub amount: spend_approved::Amount, - pub beneficiary: spend_approved::Beneficiary, - } - pub mod spend_approved { - use super::runtime_types; - pub type ProposalIndex = ::core::primitive::u32; - pub type Amount = ::core::primitive::u128; - pub type Beneficiary = ::subxt::ext::subxt_core::utils::AccountId32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for SpendApproved { - const PALLET: &'static str = "TreasuryPallet"; - const EVENT: &'static str = "SpendApproved"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "The inactive funds of the pallet have been updated."] - pub struct UpdatedInactive { - pub reactivated: updated_inactive::Reactivated, - pub deactivated: updated_inactive::Deactivated, - } - pub mod updated_inactive { - use super::runtime_types; - pub type Reactivated = ::core::primitive::u128; - pub type Deactivated = ::core::primitive::u128; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for UpdatedInactive { - const PALLET: &'static str = "TreasuryPallet"; - const EVENT: &'static str = "UpdatedInactive"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A new asset spend proposal has been approved."] - pub struct AssetSpendApproved { - pub index: asset_spend_approved::Index, - pub asset_kind: asset_spend_approved::AssetKind, - pub amount: asset_spend_approved::Amount, - pub beneficiary: asset_spend_approved::Beneficiary, - pub valid_from: asset_spend_approved::ValidFrom, - pub expire_at: asset_spend_approved::ExpireAt, - } - pub mod asset_spend_approved { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type AssetKind = (); - pub type Amount = ::core::primitive::u128; - pub type Beneficiary = ::subxt::ext::subxt_core::utils::AccountId32; - pub type ValidFrom = ::core::primitive::u32; - pub type ExpireAt = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for AssetSpendApproved { - const PALLET: &'static str = "TreasuryPallet"; - const EVENT: &'static str = "AssetSpendApproved"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "An approved spend was voided."] - pub struct AssetSpendVoided { - pub index: asset_spend_voided::Index, - } - pub mod asset_spend_voided { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for AssetSpendVoided { - const PALLET: &'static str = "TreasuryPallet"; - const EVENT: &'static str = "AssetSpendVoided"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A payment happened."] - pub struct Paid { - pub index: paid::Index, - pub payment_id: paid::PaymentId, - } - pub mod paid { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type PaymentId = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for Paid { - const PALLET: &'static str = "TreasuryPallet"; - const EVENT: &'static str = "Paid"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A payment failed and can be retried."] - pub struct PaymentFailed { - pub index: payment_failed::Index, - pub payment_id: payment_failed::PaymentId, - } - pub mod payment_failed { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - pub type PaymentId = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for PaymentFailed { - const PALLET: &'static str = "TreasuryPallet"; - const EVENT: &'static str = "PaymentFailed"; - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - #[doc = "A spend was processed and removed from the storage. It might have been successfully"] - #[doc = "paid or it may have expired."] - pub struct SpendProcessed { - pub index: spend_processed::Index, - } - pub mod spend_processed { - use super::runtime_types; - pub type Index = ::core::primitive::u32; - } - impl ::subxt::ext::subxt_core::events::StaticEvent for SpendProcessed { - const PALLET: &'static str = "TreasuryPallet"; - const EVENT: &'static str = "SpendProcessed"; - } - } - pub mod storage { - use super::runtime_types; - pub mod types { - use super::runtime_types; - pub mod proposal_count { - use super::runtime_types; - pub type ProposalCount = ::core::primitive::u32; - } - pub mod proposals { - use super::runtime_types; - pub type Proposals = runtime_types::pallet_treasury::Proposal< - ::subxt::ext::subxt_core::utils::AccountId32, - ::core::primitive::u128, - >; - pub type Param0 = ::core::primitive::u32; - } - pub mod deactivated { - use super::runtime_types; - pub type Deactivated = ::core::primitive::u128; - } - pub mod approvals { - use super::runtime_types; - pub type Approvals = - runtime_types::bounded_collections::bounded_vec::BoundedVec< - ::core::primitive::u32, - >; - } - pub mod spend_count { - use super::runtime_types; - pub type SpendCount = ::core::primitive::u32; - } - pub mod spends { - use super::runtime_types; - pub type Spends = runtime_types::pallet_treasury::SpendStatus< - (), - ::core::primitive::u128, - ::subxt::ext::subxt_core::utils::AccountId32, - ::core::primitive::u32, - ::core::primitive::u32, - >; - pub type Param0 = ::core::primitive::u32; - } - pub mod last_spend_period { - use super::runtime_types; - pub type LastSpendPeriod = ::core::primitive::u32; - } + pub mod treasury_account { + use super::runtime_types; + pub type TreasuryAccount = ::subxt::ext::subxt_core::utils::AccountId32; + } + pub mod treasury_portion { + use super::runtime_types; + pub type TreasuryPortion = ::core::primitive::u8; + } } pub struct StorageApi; impl StorageApi { - #[doc = " DEPRECATED: associated with `spend_local` call and will be removed in May 2025."] - #[doc = " Refer to for migration to `spend`."] - #[doc = ""] - #[doc = " Number of proposals that have been made."] - pub fn proposal_count( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::proposal_count::ProposalCount, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TreasuryPallet", - "ProposalCount", - (), - [ - 91u8, 238u8, 246u8, 106u8, 95u8, 66u8, 83u8, 134u8, 1u8, 225u8, 164u8, - 216u8, 113u8, 101u8, 203u8, 200u8, 113u8, 97u8, 246u8, 228u8, 140u8, - 29u8, 29u8, 48u8, 176u8, 137u8, 93u8, 230u8, 56u8, 75u8, 51u8, 149u8, - ], - ) - } - #[doc = " DEPRECATED: associated with `spend_local` call and will be removed in May 2025."] - #[doc = " Refer to for migration to `spend`."] - #[doc = ""] - #[doc = " Proposals that have been made."] - pub fn proposals_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::proposals::Proposals, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TreasuryPallet", - "Proposals", - (), - [ - 207u8, 135u8, 145u8, 146u8, 48u8, 10u8, 252u8, 40u8, 20u8, 115u8, - 205u8, 41u8, 173u8, 83u8, 115u8, 46u8, 106u8, 40u8, 130u8, 157u8, - 213u8, 87u8, 45u8, 23u8, 14u8, 167u8, 99u8, 208u8, 153u8, 163u8, 141u8, - 55u8, - ], - ) - } - #[doc = " DEPRECATED: associated with `spend_local` call and will be removed in May 2025."] - #[doc = " Refer to for migration to `spend`."] - #[doc = ""] - #[doc = " Proposals that have been made."] - pub fn proposals( - &self, - _0: types::proposals::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::proposals::Param0, - >, - types::proposals::Proposals, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TreasuryPallet", - "Proposals", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 207u8, 135u8, 145u8, 146u8, 48u8, 10u8, 252u8, 40u8, 20u8, 115u8, - 205u8, 41u8, 173u8, 83u8, 115u8, 46u8, 106u8, 40u8, 130u8, 157u8, - 213u8, 87u8, 45u8, 23u8, 14u8, 167u8, 99u8, 208u8, 153u8, 163u8, 141u8, - 55u8, - ], - ) - } - #[doc = " The amount which has been reported as inactive to Currency."] - pub fn deactivated( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::deactivated::Deactivated, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TreasuryPallet", - "Deactivated", - (), - [ - 120u8, 221u8, 159u8, 56u8, 161u8, 44u8, 54u8, 233u8, 47u8, 114u8, - 170u8, 150u8, 52u8, 24u8, 137u8, 212u8, 122u8, 247u8, 40u8, 17u8, - 208u8, 130u8, 42u8, 154u8, 33u8, 222u8, 59u8, 116u8, 0u8, 15u8, 79u8, - 123u8, - ], - ) - } - #[doc = " DEPRECATED: associated with `spend_local` call and will be removed in May 2025."] - #[doc = " Refer to for migration to `spend`."] - #[doc = ""] - #[doc = " Proposal indices that have been approved but not yet awarded."] - pub fn approvals( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::approvals::Approvals, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TreasuryPallet", - "Approvals", - (), - [ - 78u8, 147u8, 186u8, 235u8, 17u8, 40u8, 247u8, 235u8, 67u8, 222u8, 3u8, - 14u8, 248u8, 17u8, 67u8, 180u8, 93u8, 161u8, 64u8, 35u8, 119u8, 194u8, - 187u8, 226u8, 135u8, 162u8, 147u8, 174u8, 139u8, 72u8, 99u8, 212u8, - ], - ) - } - #[doc = " The count of spends that have been made."] - pub fn spend_count( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::spend_count::SpendCount, - ::subxt::ext::subxt_core::utils::Yes, - ::subxt::ext::subxt_core::utils::Yes, - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TreasuryPallet", - "SpendCount", - (), - [ - 220u8, 74u8, 248u8, 52u8, 243u8, 209u8, 42u8, 236u8, 27u8, 98u8, 76u8, - 153u8, 129u8, 176u8, 34u8, 177u8, 33u8, 132u8, 21u8, 71u8, 206u8, - 146u8, 222u8, 44u8, 232u8, 246u8, 205u8, 92u8, 240u8, 136u8, 182u8, - 30u8, - ], - ) - } - #[doc = " Spends that have been approved and being processed."] - pub fn spends_iter( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::spends::Spends, - (), - (), - ::subxt::ext::subxt_core::utils::Yes, - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TreasuryPallet", - "Spends", - (), - [ - 140u8, 4u8, 241u8, 80u8, 4u8, 219u8, 107u8, 152u8, 206u8, 175u8, 107u8, - 172u8, 208u8, 71u8, 174u8, 99u8, 198u8, 52u8, 142u8, 126u8, 145u8, - 171u8, 254u8, 9u8, 235u8, 158u8, 186u8, 101u8, 140u8, 200u8, 96u8, - 168u8, - ], - ) - } - #[doc = " Spends that have been approved and being processed."] - pub fn spends( - &self, - _0: types::spends::Param0, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - ::subxt::ext::subxt_core::storage::address::StaticStorageKey< - types::spends::Param0, - >, - types::spends::Spends, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TreasuryPallet", - "Spends", - ::subxt::ext::subxt_core::storage::address::StaticStorageKey::new(_0), - [ - 140u8, 4u8, 241u8, 80u8, 4u8, 219u8, 107u8, 152u8, 206u8, 175u8, 107u8, - 172u8, 208u8, 71u8, 174u8, 99u8, 198u8, 52u8, 142u8, 126u8, 145u8, - 171u8, 254u8, 9u8, 235u8, 158u8, 186u8, 101u8, 140u8, 200u8, 96u8, - 168u8, - ], - ) - } - #[doc = " The blocknumber for the last triggered spend period."] - pub fn last_spend_period( - &self, - ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< - (), - types::last_spend_period::LastSpendPeriod, - ::subxt::ext::subxt_core::utils::Yes, - (), - (), - > { - ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( - "TreasuryPallet", - "LastSpendPeriod", - (), - [ - 6u8, 200u8, 107u8, 132u8, 60u8, 31u8, 24u8, 196u8, 108u8, 227u8, 5u8, - 63u8, 249u8, 139u8, 82u8, 140u8, 169u8, 242u8, 118u8, 93u8, 83u8, - 155u8, 120u8, 175u8, 224u8, 227u8, 39u8, 39u8, 255u8, 247u8, 79u8, - 30u8, - ], - ) - } - } - } - pub mod constants { - use super::runtime_types; - pub struct ConstantsApi; - impl ConstantsApi { - #[doc = " Period between successive spends."] - pub fn spend_period( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "TreasuryPallet", - "SpendPeriod", - [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, - 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, - 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, - 145u8, - ], - ) - } - #[doc = " Percentage of spare funds (if any) that are burnt per spend period."] - pub fn burn( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - runtime_types::sp_arithmetic::per_things::Permill, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "TreasuryPallet", - "Burn", - [ - 65u8, 93u8, 120u8, 165u8, 204u8, 81u8, 159u8, 163u8, 93u8, 135u8, - 114u8, 121u8, 147u8, 35u8, 215u8, 213u8, 4u8, 223u8, 83u8, 37u8, 225u8, - 200u8, 189u8, 156u8, 140u8, 36u8, 58u8, 46u8, 42u8, 232u8, 155u8, 0u8, - ], - ) - } - #[doc = " The treasury's pallet id, used for deriving its sovereign account ID."] - pub fn pallet_id( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - runtime_types::frame_support::PalletId, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "TreasuryPallet", - "PalletId", - [ - 56u8, 243u8, 53u8, 83u8, 154u8, 179u8, 170u8, 80u8, 133u8, 173u8, 61u8, - 161u8, 47u8, 225u8, 146u8, 21u8, 50u8, 229u8, 248u8, 27u8, 104u8, 58u8, - 129u8, 197u8, 102u8, 160u8, 168u8, 205u8, 154u8, 42u8, 217u8, 53u8, - ], - ) - } - #[doc = " DEPRECATED: associated with `spend_local` call and will be removed in May 2025."] - #[doc = " Refer to for migration to `spend`."] - #[doc = ""] - #[doc = " The maximum number of approvals that can wait in the spending queue."] - #[doc = ""] - #[doc = " NOTE: This parameter is also used within the Bounties Pallet extension if enabled."] - pub fn max_approvals( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, - > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( - "TreasuryPallet", - "MaxApprovals", - [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, - 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, - 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, - 145u8, - ], - ) - } - #[doc = " The period during which an approved treasury spend has to be claimed."] - pub fn payout_period( - &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::core::primitive::u32, + #[doc = " The treasury account that receives mining rewards."] + pub fn treasury_account( + &self, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::treasury_account::TreasuryAccount, + ::subxt::ext::subxt_core::utils::Yes, + (), + (), > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "TreasuryPallet", - "PayoutPeriod", + "TreasuryAccount", + (), [ - 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, - 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, - 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, - 145u8, + 25u8, 40u8, 39u8, 114u8, 80u8, 247u8, 49u8, 5u8, 9u8, 118u8, 249u8, + 36u8, 77u8, 73u8, 229u8, 167u8, 107u8, 254u8, 175u8, 199u8, 203u8, + 238u8, 166u8, 158u8, 155u8, 209u8, 155u8, 219u8, 191u8, 204u8, 237u8, + 227u8, ], ) } - #[doc = " Gets this pallet's derived pot account."] - pub fn pot_account( + #[doc = " The portion of mining rewards that goes to treasury (0-100)."] + pub fn treasury_portion( &self, - ) -> ::subxt::ext::subxt_core::constants::address::StaticAddress< - ::subxt::ext::subxt_core::utils::AccountId32, + ) -> ::subxt::ext::subxt_core::storage::address::StaticAddress< + (), + types::treasury_portion::TreasuryPortion, + ::subxt::ext::subxt_core::utils::Yes, + ::subxt::ext::subxt_core::utils::Yes, + (), > { - ::subxt::ext::subxt_core::constants::address::StaticAddress::new_static( + ::subxt::ext::subxt_core::storage::address::StaticAddress::new_static( "TreasuryPallet", - "pot_account", + "TreasuryPortion", + (), [ - 115u8, 233u8, 13u8, 223u8, 88u8, 20u8, 202u8, 139u8, 153u8, 28u8, - 155u8, 157u8, 224u8, 66u8, 3u8, 250u8, 23u8, 53u8, 88u8, 168u8, 211u8, - 204u8, 122u8, 166u8, 248u8, 23u8, 174u8, 225u8, 99u8, 108u8, 89u8, - 135u8, + 102u8, 185u8, 214u8, 4u8, 191u8, 165u8, 131u8, 24u8, 160u8, 179u8, + 59u8, 196u8, 73u8, 169u8, 17u8, 104u8, 66u8, 3u8, 202u8, 255u8, 195u8, + 96u8, 65u8, 22u8, 145u8, 163u8, 6u8, 44u8, 47u8, 11u8, 42u8, 0u8, ], ) } } } } - pub mod origins { - use super::{root_mod, runtime_types}; - } pub mod recovery { use super::{root_mod, runtime_types}; #[doc = "The `Error` enum of this pallet."] @@ -15321,10 +14341,9 @@ pub mod api { call: ::subxt::ext::subxt_core::alloc::boxed::Box::new(call), }, [ - 125u8, 10u8, 181u8, 50u8, 177u8, 114u8, 92u8, 100u8, 221u8, 17u8, 19u8, - 106u8, 84u8, 156u8, 189u8, 217u8, 223u8, 233u8, 245u8, 200u8, 8u8, - 24u8, 21u8, 189u8, 205u8, 170u8, 119u8, 109u8, 156u8, 192u8, 139u8, - 202u8, + 236u8, 116u8, 42u8, 49u8, 236u8, 100u8, 253u8, 181u8, 98u8, 152u8, + 51u8, 82u8, 0u8, 40u8, 214u8, 186u8, 90u8, 117u8, 84u8, 251u8, 163u8, + 107u8, 39u8, 248u8, 22u8, 20u8, 231u8, 105u8, 247u8, 185u8, 37u8, 95u8, ], ) } @@ -27003,157 +26022,12 @@ pub mod api { )] #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."] pub enum Call { - #[codec(index = 3)] - #[doc = "Propose and approve a spend of treasury funds."] - #[doc = ""] - #[doc = "## Dispatch Origin"] - #[doc = ""] - #[doc = "Must be [`Config::SpendOrigin`] with the `Success` value being at least `amount`."] - #[doc = ""] - #[doc = "### Details"] - #[doc = "NOTE: For record-keeping purposes, the proposer is deemed to be equivalent to the"] - #[doc = "beneficiary."] - #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `amount`: The amount to be transferred from the treasury to the `beneficiary`."] - #[doc = "- `beneficiary`: The destination account for the transfer."] - #[doc = ""] - #[doc = "## Events"] - #[doc = ""] - #[doc = "Emits [`Event::SpendApproved`] if successful."] - spend_local { - #[codec(compact)] - amount: ::core::primitive::u128, - beneficiary: ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, - }, - #[codec(index = 4)] - #[doc = "Force a previously approved proposal to be removed from the approval queue."] - #[doc = ""] - #[doc = "## Dispatch Origin"] - #[doc = ""] - #[doc = "Must be [`Config::RejectOrigin`]."] - #[doc = ""] - #[doc = "## Details"] - #[doc = ""] - #[doc = "The original deposit will no longer be returned."] - #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `proposal_id`: The index of a proposal"] - #[doc = ""] - #[doc = "### Complexity"] - #[doc = "- O(A) where `A` is the number of approvals"] - #[doc = ""] - #[doc = "### Errors"] - #[doc = "- [`Error::ProposalNotApproved`]: The `proposal_id` supplied was not found in the"] - #[doc = " approval queue, i.e., the proposal has not been approved. This could also mean the"] - #[doc = " proposal does not exist altogether, thus there is no way it would have been approved"] - #[doc = " in the first place."] - remove_approval { - #[codec(compact)] - proposal_id: ::core::primitive::u32, - }, - #[codec(index = 5)] - #[doc = "Propose and approve a spend of treasury funds."] - #[doc = ""] - #[doc = "## Dispatch Origin"] - #[doc = ""] - #[doc = "Must be [`Config::SpendOrigin`] with the `Success` value being at least"] - #[doc = "`amount` of `asset_kind` in the native asset. The amount of `asset_kind` is converted"] - #[doc = "for assertion using the [`Config::BalanceConverter`]."] - #[doc = ""] - #[doc = "## Details"] - #[doc = ""] - #[doc = "Create an approved spend for transferring a specific `amount` of `asset_kind` to a"] - #[doc = "designated beneficiary. The spend must be claimed using the `payout` dispatchable within"] - #[doc = "the [`Config::PayoutPeriod`]."] - #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `asset_kind`: An indicator of the specific asset class to be spent."] - #[doc = "- `amount`: The amount to be transferred from the treasury to the `beneficiary`."] - #[doc = "- `beneficiary`: The beneficiary of the spend."] - #[doc = "- `valid_from`: The block number from which the spend can be claimed. It can refer to"] - #[doc = " the past if the resulting spend has not yet expired according to the"] - #[doc = " [`Config::PayoutPeriod`]. If `None`, the spend can be claimed immediately after"] - #[doc = " approval."] - #[doc = ""] - #[doc = "## Events"] - #[doc = ""] - #[doc = "Emits [`Event::AssetSpendApproved`] if successful."] - spend { - asset_kind: ::subxt::ext::subxt_core::alloc::boxed::Box<()>, - #[codec(compact)] - amount: ::core::primitive::u128, - beneficiary: ::subxt::ext::subxt_core::alloc::boxed::Box< - ::subxt::ext::subxt_core::utils::MultiAddress< - ::subxt::ext::subxt_core::utils::AccountId32, - (), - >, - >, - valid_from: ::core::option::Option<::core::primitive::u32>, - }, - #[codec(index = 6)] - #[doc = "Claim a spend."] - #[doc = ""] - #[doc = "## Dispatch Origin"] - #[doc = ""] - #[doc = "Must be signed"] - #[doc = ""] - #[doc = "## Details"] - #[doc = ""] - #[doc = "Spends must be claimed within some temporal bounds. A spend may be claimed within one"] - #[doc = "[`Config::PayoutPeriod`] from the `valid_from` block."] - #[doc = "In case of a payout failure, the spend status must be updated with the `check_status`"] - #[doc = "dispatchable before retrying with the current function."] - #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `index`: The spend index."] - #[doc = ""] - #[doc = "## Events"] - #[doc = ""] - #[doc = "Emits [`Event::Paid`] if successful."] - payout { index: ::core::primitive::u32 }, - #[codec(index = 7)] - #[doc = "Check the status of the spend and remove it from the storage if processed."] - #[doc = ""] - #[doc = "## Dispatch Origin"] - #[doc = ""] - #[doc = "Must be signed."] - #[doc = ""] - #[doc = "## Details"] - #[doc = ""] - #[doc = "The status check is a prerequisite for retrying a failed payout."] - #[doc = "If a spend has either succeeded or expired, it is removed from the storage by this"] - #[doc = "function. In such instances, transaction fees are refunded."] - #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `index`: The spend index."] - #[doc = ""] - #[doc = "## Events"] - #[doc = ""] - #[doc = "Emits [`Event::PaymentFailed`] if the spend payout has failed."] - #[doc = "Emits [`Event::SpendProcessed`] if the spend payout has succeed."] - check_status { index: ::core::primitive::u32 }, - #[codec(index = 8)] - #[doc = "Void previously approved spend."] - #[doc = ""] - #[doc = "## Dispatch Origin"] - #[doc = ""] - #[doc = "Must be [`Config::RejectOrigin`]."] - #[doc = ""] - #[doc = "## Details"] - #[doc = ""] - #[doc = "A spend void is only possible if the payout has not been attempted yet."] - #[doc = ""] - #[doc = "### Parameters"] - #[doc = "- `index`: The spend index."] - #[doc = ""] - #[doc = "## Events"] - #[doc = ""] - #[doc = "Emits [`Event::AssetSpendVoided`] if successful."] - void_spend { index: ::core::primitive::u32 }, + #[codec(index = 0)] + #[doc = "Set the treasury account. Root only."] + set_treasury_account { account: ::subxt::ext::subxt_core::utils::AccountId32 }, + #[codec(index = 1)] + #[doc = "Set the treasury portion (0-100). Root only."] + set_treasury_portion { portion: ::core::primitive::u8 }, } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -27166,42 +26040,10 @@ pub mod api { #[encode_as_type( crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" )] - #[doc = "Error for the treasury pallet."] + #[doc = "The `Error` enum of this pallet."] pub enum Error { #[codec(index = 0)] - #[doc = "No proposal, bounty or spend at that index."] - InvalidIndex, - #[codec(index = 1)] - #[doc = "Too many approvals in the queue."] - TooManyApprovals, - #[codec(index = 2)] - #[doc = "The spend origin is valid but the amount it is allowed to spend is lower than the"] - #[doc = "amount to be spent."] - InsufficientPermission, - #[codec(index = 3)] - #[doc = "Proposal has not been approved."] - ProposalNotApproved, - #[codec(index = 4)] - #[doc = "The balance of the asset kind is not convertible to the balance of the native asset."] - FailedToConvertBalance, - #[codec(index = 5)] - #[doc = "The spend has expired and cannot be claimed."] - SpendExpired, - #[codec(index = 6)] - #[doc = "The spend is not yet eligible for payout."] - EarlyPayout, - #[codec(index = 7)] - #[doc = "The payment has already been attempted."] - AlreadyAttempted, - #[codec(index = 8)] - #[doc = "There was some issue with the mechanism of payment."] - PayoutError, - #[codec(index = 9)] - #[doc = "The payout was not yet attempted/claimed."] - NotAttempted, - #[codec(index = 10)] - #[doc = "The payment has neither failed nor succeeded yet."] - Inconclusive, + InvalidPortion, } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, @@ -27217,110 +26059,13 @@ pub mod api { #[doc = "The `Event` enum of this pallet"] pub enum Event { #[codec(index = 0)] - #[doc = "We have ended a spend period and will now allocate funds."] - Spending { budget_remaining: ::core::primitive::u128 }, - #[codec(index = 1)] - #[doc = "Some funds have been allocated."] - Awarded { - proposal_index: ::core::primitive::u32, - award: ::core::primitive::u128, - account: ::subxt::ext::subxt_core::utils::AccountId32, - }, - #[codec(index = 2)] - #[doc = "Some of our funds have been burnt."] - Burnt { burnt_funds: ::core::primitive::u128 }, - #[codec(index = 3)] - #[doc = "Spending has finished; this is the amount that rolls over until next spend."] - Rollover { rollover_balance: ::core::primitive::u128 }, - #[codec(index = 4)] - #[doc = "Some funds have been deposited."] - Deposit { value: ::core::primitive::u128 }, - #[codec(index = 5)] - #[doc = "A new spend proposal has been approved."] - SpendApproved { - proposal_index: ::core::primitive::u32, - amount: ::core::primitive::u128, - beneficiary: ::subxt::ext::subxt_core::utils::AccountId32, - }, - #[codec(index = 6)] - #[doc = "The inactive funds of the pallet have been updated."] - UpdatedInactive { - reactivated: ::core::primitive::u128, - deactivated: ::core::primitive::u128, - }, - #[codec(index = 7)] - #[doc = "A new asset spend proposal has been approved."] - AssetSpendApproved { - index: ::core::primitive::u32, - asset_kind: (), - amount: ::core::primitive::u128, - beneficiary: ::subxt::ext::subxt_core::utils::AccountId32, - valid_from: ::core::primitive::u32, - expire_at: ::core::primitive::u32, - }, - #[codec(index = 8)] - #[doc = "An approved spend was voided."] - AssetSpendVoided { index: ::core::primitive::u32 }, - #[codec(index = 9)] - #[doc = "A payment happened."] - Paid { index: ::core::primitive::u32, payment_id: ::core::primitive::u32 }, - #[codec(index = 10)] - #[doc = "A payment failed and can be retried."] - PaymentFailed { - index: ::core::primitive::u32, - payment_id: ::core::primitive::u32, + TreasuryAccountUpdated { + new_account: ::subxt::ext::subxt_core::utils::AccountId32, }, - #[codec(index = 11)] - #[doc = "A spend was processed and removed from the storage. It might have been successfully"] - #[doc = "paid or it may have expired."] - SpendProcessed { index: ::core::primitive::u32 }, + #[codec(index = 1)] + TreasuryPortionUpdated { new_portion: ::core::primitive::u8 }, } } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - pub enum PaymentState<_0> { - #[codec(index = 0)] - Pending, - #[codec(index = 1)] - Attempted { id: _0 }, - #[codec(index = 2)] - Failed, - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - pub struct Proposal<_0, _1> { - pub proposer: _0, - pub value: _1, - pub beneficiary: _0, - pub bond: _1, - } - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] - #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] - pub struct SpendStatus<_0, _1, _2, _3, _4> { - pub asset_kind: _0, - pub amount: _1, - pub beneficiary: _2, - pub valid_from: _3, - pub expire_at: _3, - pub status: runtime_types::pallet_treasury::PaymentState<_3>, - #[codec(skip)] - pub __ignore: ::core::marker::PhantomData<_4>, - } } pub mod pallet_utility { use super::runtime_types; @@ -27791,33 +26536,6 @@ pub mod api { pub amount: ::core::primitive::u128, } } - pub mod origins { - use super::runtime_types; - pub mod pallet_custom_origins { - use super::runtime_types; - #[derive( - :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, - :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, - Debug, - )] - #[decode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode" - )] - #[encode_as_type( - crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode" - )] - pub enum Origin { - #[codec(index = 0)] - Treasurer, - #[codec(index = 1)] - SmallSpender, - #[codec(index = 2)] - MediumSpender, - #[codec(index = 3)] - BigSpender, - } - } - } } pub mod transaction_extensions { use super::runtime_types; @@ -27854,7 +26572,13 @@ pub mod api { #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] pub enum OriginCaller { - # [codec (index = 0)] system (runtime_types :: frame_support :: dispatch :: RawOrigin < :: subxt :: ext :: subxt_core :: utils :: AccountId32 > ,) , # [codec (index = 19)] Origins (runtime_types :: quantus_runtime :: governance :: origins :: pallet_custom_origins :: Origin ,) , } + #[codec(index = 0)] + system( + runtime_types::frame_support::dispatch::RawOrigin< + ::subxt::ext::subxt_core::utils::AccountId32, + >, + ), + } #[derive( :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType, :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType, @@ -27879,31 +26603,31 @@ pub mod api { Balances(runtime_types::pallet_balances::pallet::Call), #[codec(index = 4)] Sudo(runtime_types::pallet_sudo::pallet::Call), - #[codec(index = 9)] + #[codec(index = 7)] Preimage(runtime_types::pallet_preimage::pallet::Call), - #[codec(index = 10)] + #[codec(index = 8)] Scheduler(runtime_types::pallet_scheduler::pallet::Call), - #[codec(index = 11)] + #[codec(index = 9)] Utility(runtime_types::pallet_utility::pallet::Call), - #[codec(index = 12)] + #[codec(index = 10)] Referenda(runtime_types::pallet_referenda::pallet::Call), - #[codec(index = 13)] + #[codec(index = 11)] ReversibleTransfers(runtime_types::pallet_reversible_transfers::pallet::Call), - #[codec(index = 14)] + #[codec(index = 12)] ConvictionVoting(runtime_types::pallet_conviction_voting::pallet::Call), - #[codec(index = 15)] + #[codec(index = 13)] TechCollective(runtime_types::pallet_ranked_collective::pallet::Call), - #[codec(index = 16)] + #[codec(index = 14)] TechReferenda(runtime_types::pallet_referenda::pallet::Call), - #[codec(index = 18)] + #[codec(index = 15)] TreasuryPallet(runtime_types::pallet_treasury::pallet::Call), - #[codec(index = 20)] + #[codec(index = 16)] Recovery(runtime_types::pallet_recovery::pallet::Call), - #[codec(index = 21)] + #[codec(index = 17)] Assets(runtime_types::pallet_assets::pallet::Call), - #[codec(index = 23)] + #[codec(index = 19)] Multisig(runtime_types::pallet_multisig::pallet::Call), - #[codec(index = 24)] + #[codec(index = 20)] Wormhole(runtime_types::pallet_wormhole::pallet::Call), } #[derive( @@ -27920,33 +26644,33 @@ pub mod api { Balances(runtime_types::pallet_balances::pallet::Error), #[codec(index = 4)] Sudo(runtime_types::pallet_sudo::pallet::Error), - #[codec(index = 9)] + #[codec(index = 7)] Preimage(runtime_types::pallet_preimage::pallet::Error), - #[codec(index = 10)] + #[codec(index = 8)] Scheduler(runtime_types::pallet_scheduler::pallet::Error), - #[codec(index = 11)] + #[codec(index = 9)] Utility(runtime_types::pallet_utility::pallet::Error), - #[codec(index = 12)] + #[codec(index = 10)] Referenda(runtime_types::pallet_referenda::pallet::Error), - #[codec(index = 13)] + #[codec(index = 11)] ReversibleTransfers(runtime_types::pallet_reversible_transfers::pallet::Error), - #[codec(index = 14)] + #[codec(index = 12)] ConvictionVoting(runtime_types::pallet_conviction_voting::pallet::Error), - #[codec(index = 15)] + #[codec(index = 13)] TechCollective(runtime_types::pallet_ranked_collective::pallet::Error), - #[codec(index = 16)] + #[codec(index = 14)] TechReferenda(runtime_types::pallet_referenda::pallet::Error), - #[codec(index = 18)] + #[codec(index = 15)] TreasuryPallet(runtime_types::pallet_treasury::pallet::Error), - #[codec(index = 20)] + #[codec(index = 16)] Recovery(runtime_types::pallet_recovery::pallet::Error), - #[codec(index = 21)] + #[codec(index = 17)] Assets(runtime_types::pallet_assets::pallet::Error), - #[codec(index = 22)] + #[codec(index = 18)] AssetsHolder(runtime_types::pallet_assets_holder::pallet::Error), - #[codec(index = 23)] + #[codec(index = 19)] Multisig(runtime_types::pallet_multisig::pallet::Error), - #[codec(index = 24)] + #[codec(index = 20)] Wormhole(runtime_types::pallet_wormhole::pallet::Error), } #[derive( @@ -27967,35 +26691,35 @@ pub mod api { Sudo(runtime_types::pallet_sudo::pallet::Event), #[codec(index = 5)] QPoW(runtime_types::pallet_qpow::pallet::Event), - #[codec(index = 7)] + #[codec(index = 6)] MiningRewards(runtime_types::pallet_mining_rewards::pallet::Event), - #[codec(index = 9)] + #[codec(index = 7)] Preimage(runtime_types::pallet_preimage::pallet::Event), - #[codec(index = 10)] + #[codec(index = 8)] Scheduler(runtime_types::pallet_scheduler::pallet::Event), - #[codec(index = 11)] + #[codec(index = 9)] Utility(runtime_types::pallet_utility::pallet::Event), - #[codec(index = 12)] + #[codec(index = 10)] Referenda(runtime_types::pallet_referenda::pallet::Event1), - #[codec(index = 13)] + #[codec(index = 11)] ReversibleTransfers(runtime_types::pallet_reversible_transfers::pallet::Event), - #[codec(index = 14)] + #[codec(index = 12)] ConvictionVoting(runtime_types::pallet_conviction_voting::pallet::Event), - #[codec(index = 15)] + #[codec(index = 13)] TechCollective(runtime_types::pallet_ranked_collective::pallet::Event), - #[codec(index = 16)] + #[codec(index = 14)] TechReferenda(runtime_types::pallet_referenda::pallet::Event2), - #[codec(index = 18)] + #[codec(index = 15)] TreasuryPallet(runtime_types::pallet_treasury::pallet::Event), - #[codec(index = 20)] + #[codec(index = 16)] Recovery(runtime_types::pallet_recovery::pallet::Event), - #[codec(index = 21)] + #[codec(index = 17)] Assets(runtime_types::pallet_assets::pallet::Event), - #[codec(index = 22)] + #[codec(index = 18)] AssetsHolder(runtime_types::pallet_assets_holder::pallet::Event), - #[codec(index = 23)] + #[codec(index = 19)] Multisig(runtime_types::pallet_multisig::pallet::Event), - #[codec(index = 24)] + #[codec(index = 20)] Wormhole(runtime_types::pallet_wormhole::pallet::Event), } #[derive( @@ -28014,9 +26738,9 @@ pub mod api { #[decode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode")] #[encode_as_type(crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode")] pub enum RuntimeHoldReason { - #[codec(index = 9)] + #[codec(index = 7)] Preimage(runtime_types::pallet_preimage::pallet::HoldReason), - #[codec(index = 13)] + #[codec(index = 11)] ReversibleTransfers(runtime_types::pallet_reversible_transfers::pallet::HoldReason), } } diff --git a/src/cli/mod.rs b/src/cli/mod.rs index 5133ac4..34ce8a7 100644 --- a/src/cli/mod.rs +++ b/src/cli/mod.rs @@ -95,7 +95,7 @@ pub enum Commands { #[command(subcommand)] Preimage(preimage::PreimageCommands), - /// Treasury management commands + /// Treasury account info #[command(subcommand)] Treasury(treasury::TreasuryCommands), diff --git a/src/cli/treasury.rs b/src/cli/treasury.rs index e910bea..99b66b6 100644 --- a/src/cli/treasury.rs +++ b/src/cli/treasury.rs @@ -1,605 +1,69 @@ -//! `quantus treasury` subcommand - manage Treasury -use crate::{chain::quantus_subxt, cli::common::submit_transaction, log_print, log_success}; +//! `quantus treasury` subcommand – Treasury account info +//! +//! The chain Treasury is a single account that receives a configurable portion of mining rewards. +//! This command shows the treasury account and its balance. +use crate::{chain::quantus_subxt, cli::address_format::QuantusSS58, log_print}; use clap::Subcommand; use colored::Colorize; -use frame_support::sp_runtime::traits::AccountIdConversion; -/// Treasury management commands +/// Treasury commands #[derive(Subcommand, Debug)] pub enum TreasuryCommands { - /// Check current Treasury balance - Balance, - - /// Get Treasury configuration - Config, - - /// Show Treasury information and how to spend from it + /// Show Treasury account and balance Info, - - /// Submit a Treasury spend proposal via referendum (requires specific track) - /// This creates a referendum that, if approved, will approve a treasury spend - SubmitSpend { - /// Beneficiary address (will receive the funds) - #[arg(long)] - beneficiary: String, - - /// Amount to spend (e.g., "100.0" for 100 QUAN) - #[arg(long)] - amount: String, - - /// Track to use: "small", "medium", "big", or "treasurer" - /// - small: < 100 QUAN (Track 2) - /// - medium: < 1000 QUAN (Track 3) - /// - big: < 10000 QUAN (Track 4) - /// - treasurer: any amount (Track 5) - #[arg(long)] - track: String, - - /// Wallet name to sign the transaction - #[arg(long)] - from: String, - - /// Password for the wallet - #[arg(long)] - password: Option, - - /// Read password from file - #[arg(long)] - password_file: Option, - }, - - /// Payout an approved Treasury spend (anyone can call this) - Payout { - /// Spend index to payout - #[arg(long)] - index: u32, - - /// Wallet name to sign the transaction - #[arg(long)] - from: String, - - /// Password for the wallet - #[arg(long)] - password: Option, - - /// Read password from file - #[arg(long)] - password_file: Option, - }, - - /// Check and cleanup a Treasury spend status - CheckStatus { - /// Spend index to check - #[arg(long)] - index: u32, - - /// Wallet name to sign the transaction - #[arg(long)] - from: String, - - /// Password for the wallet - #[arg(long)] - password: Option, - - /// Read password from file - #[arg(long)] - password_file: Option, - }, - - /// List active Treasury spends - ListSpends, - - /// Directly create a Treasury spend via sudo (root only, for testing) - SpendSudo { - /// Beneficiary address (will receive the funds) - #[arg(long)] - beneficiary: String, - - /// Amount to spend (e.g., "50.0" for 50 QUAN) - #[arg(long)] - amount: String, - - /// Wallet name to sign with (must have sudo) - #[arg(long)] - from: String, - - /// Password for the wallet - #[arg(long)] - password: Option, - - /// Read password from file - #[arg(long)] - password_file: Option, - }, } /// Handle treasury commands pub async fn handle_treasury_command( command: TreasuryCommands, node_url: &str, - execution_mode: crate::cli::common::ExecutionMode, + _execution_mode: crate::cli::common::ExecutionMode, ) -> crate::error::Result<()> { let quantus_client = crate::chain::client::QuantusClient::new(node_url).await?; match command { - TreasuryCommands::Balance => get_treasury_balance(&quantus_client).await, - TreasuryCommands::Config => get_config(&quantus_client).await, - TreasuryCommands::Info => show_treasury_info().await, - TreasuryCommands::SubmitSpend { - beneficiary, - amount, - track, - from, - password, - password_file, - } => - submit_spend_referendum( - &quantus_client, - &beneficiary, - &amount, - &track, - &from, - password, - password_file, - execution_mode, - ) - .await, - TreasuryCommands::Payout { index, from, password, password_file } => - payout_spend(&quantus_client, index, &from, password, password_file, execution_mode) - .await, - TreasuryCommands::CheckStatus { index, from, password, password_file } => - check_spend_status( - &quantus_client, - index, - &from, - password, - password_file, - execution_mode, - ) - .await, - TreasuryCommands::ListSpends => list_spends(&quantus_client).await, - TreasuryCommands::SpendSudo { beneficiary, amount, from, password, password_file } => - spend_sudo( - &quantus_client, - &beneficiary, - &amount, - &from, - password, - password_file, - execution_mode, - ) - .await, + TreasuryCommands::Info => show_treasury_info(&quantus_client).await, } } -/// Get current Treasury balance -async fn get_treasury_balance( +/// Show Treasury account, portion and balance +async fn show_treasury_info( quantus_client: &crate::chain::client::QuantusClient, ) -> crate::error::Result<()> { - log_print!("💰 Treasury Balance"); + log_print!("💰 Treasury"); log_print!(""); - // Get Treasury account ID using the same method as runtime - let treasury_pallet_id = frame_support::PalletId(*b"py/trsry"); - let treasury_account_raw: sp_runtime::AccountId32 = - treasury_pallet_id.into_account_truncating(); - - // Convert to subxt's AccountId32 - let treasury_account = subxt::utils::AccountId32(*treasury_account_raw.as_ref()); - - // Query balance - let addr = quantus_subxt::api::storage().system().account(treasury_account.clone()); - let latest_block_hash = quantus_client.get_latest_block().await?; let storage_at = quantus_client.client().storage().at(latest_block_hash); - let account_info = storage_at.fetch(&addr).await?.ok_or_else(|| { - crate::error::QuantusError::Generic("Treasury account not found".to_string()) + // Treasury account from pallet storage (receives mining rewards) + let treasury_account_addr = quantus_subxt::api::storage().treasury_pallet().treasury_account(); + let treasury_account = storage_at.fetch(&treasury_account_addr).await?.ok_or_else(|| { + crate::error::QuantusError::Generic("Treasury account not set in storage".to_string()) })?; - let free_balance = account_info.data.free; - let reserved_balance = account_info.data.reserved; - - let formatted_free_balance = - crate::cli::send::format_balance_with_symbol(quantus_client, free_balance).await?; - let formatted_reserved_balance = - crate::cli::send::format_balance_with_symbol(quantus_client, reserved_balance).await?; - - log_print!("💰 Free Balance: {}", formatted_free_balance); - log_print!("💰 Reserved: {}", formatted_reserved_balance); - - // Display address in Quantus format (uses default SS58 version 189 set in main.rs) - use crate::cli::address_format::QuantusSS58; - let treasury_address = treasury_account_raw.to_quantus_ss58(); - log_print!("📍 Treasury Account: {}", treasury_address.bright_yellow()); - - Ok(()) -} - -/// Get Treasury configuration -async fn get_config( - quantus_client: &crate::chain::client::QuantusClient, -) -> crate::error::Result<()> { - log_print!("⚙️ Treasury Configuration"); - log_print!(""); - - let constants = quantus_client.client().constants(); - - // Get SpendPeriod - if let Ok(spend_period) = - constants.at(&quantus_subxt::api::constants().treasury_pallet().spend_period()) - { - log_print!("⏰ Spend Period: {} blocks", spend_period.to_string().bright_cyan()); - let hours = spend_period as f64 * 3.0 / 3600.0; // Assuming 3 sec blocks - log_print!(" (~{:.1} hours)", hours); - } - - // Get Burn percentage - if let Ok(burn) = constants.at(&quantus_subxt::api::constants().treasury_pallet().burn()) { - log_print!("🔥 Burn: {:?}", burn); - } - - // Get MaxApprovals - if let Ok(max_approvals) = - constants.at(&quantus_subxt::api::constants().treasury_pallet().max_approvals()) - { - log_print!("📊 Max Approvals: {}", max_approvals.to_string().bright_yellow()); - } - - // Get PayoutPeriod - if let Ok(payout_period) = - constants.at(&quantus_subxt::api::constants().treasury_pallet().payout_period()) - { - log_print!("💸 Payout Period: {} blocks", payout_period.to_string().bright_green()); - let days = payout_period as f64 * 3.0 / 86400.0; // Assuming 3 sec blocks - log_print!(" (~{:.1} days)", days); - } - - Ok(()) -} - -/// Show Treasury information -async fn show_treasury_info() -> crate::error::Result<()> { - log_print!("💰 Treasury Information"); - log_print!(""); - log_print!("The Treasury is a pot of funds collected through:"); - log_print!(" • Transaction fees"); - log_print!(" • Slashing"); - log_print!(" • Other network mechanisms"); - log_print!(""); - log_print!("📋 {} To spend from Treasury:", "HOW TO USE".bright_cyan().bold()); - log_print!(""); - log_print!( - "1. {} Create a spending proposal using Referenda:", - "Treasury Tracks".bright_yellow().bold() - ); - log_print!(" • Track 2: Treasury Small Spender (< certain amount)"); - log_print!(" • Track 3: Treasury Medium Spender"); - log_print!(" • Track 4: Treasury Big Spender"); - log_print!(" • Track 5: Treasury Treasurer (highest amounts)"); - log_print!(""); - log_print!( - "2. {} Submit referendum with Treasury spend call:", - "Example".bright_green().bold() - ); - log_print!( - " quantus referenda submit-remark --message \"Treasury spend: 1000 QUAN to Alice\"" - ); - log_print!(" --from --password "); - log_print!(""); - log_print!(" Note: Use appropriate origin for treasury tracks"); - log_print!(""); - log_print!("3. {} Community votes on the proposal", "Voting".bright_magenta().bold()); - log_print!(""); - log_print!("4. {} If approved, funds are paid automatically", "Execution".bright_blue().bold()); - log_print!(""); - log_print!("💡 {}", "Useful Commands:".bright_cyan().bold()); - log_print!(" quantus treasury balance - Check Treasury balance"); - log_print!(" quantus treasury config - View Treasury configuration"); - log_print!(" quantus referenda config - View available tracks"); - log_print!(""); - - Ok(()) -} - -/// Submit a Treasury spend proposal via referendum -async fn submit_spend_referendum( - quantus_client: &crate::chain::client::QuantusClient, - beneficiary: &str, - amount: &str, - track: &str, - from: &str, - password: Option, - password_file: Option, - execution_mode: crate::cli::common::ExecutionMode, -) -> crate::error::Result<()> { - use qp_poseidon::PoseidonHasher; - use sp_core::crypto::{AccountId32 as SpAccountId32, Ss58Codec}; - use subxt::tx::Payload; - - log_print!("💰 Submitting Treasury Spend Referendum"); - log_print!(" 📍 Beneficiary: {}", beneficiary.bright_yellow()); - log_print!(" 💵 Amount: {}", amount.bright_green()); - log_print!(" 🛤️ Track: {}", track.bright_cyan()); - - // Parse amount - let amount_value = crate::cli::send::parse_amount(quantus_client, amount).await?; - - // Parse beneficiary address - let beneficiary_resolved = crate::cli::common::resolve_address(beneficiary)?; - let (beneficiary_sp, _) = SpAccountId32::from_ss58check_with_version(&beneficiary_resolved) - .map_err(|e| { - crate::error::QuantusError::Generic(format!( - "Invalid beneficiary address '{beneficiary}': {e:?}" - )) - })?; - let bytes: [u8; 32] = *beneficiary_sp.as_ref(); - let beneficiary_account = subxt::utils::AccountId32::from(bytes); - - // Create the treasury spend call using the transaction API - let beneficiary_multi = subxt::utils::MultiAddress::Id(beneficiary_account.clone()); - - let treasury_spend_call = - quantus_subxt::api::tx() - .treasury_pallet() - .spend((), amount_value, beneficiary_multi, None); - - // Encode call_data - let encoded_call = treasury_spend_call - .encode_call_data(&quantus_client.client().metadata()) - .map_err(|e| { - crate::error::QuantusError::Generic(format!("Failed to encode call: {:?}", e)) - })?; - - log_print!("📝 Creating preimage..."); - - // Load wallet keypair - let keypair = - crate::wallet::load_keypair_from_wallet(from, password.clone(), password_file.clone())?; - - // Calculate preimage hash using Poseidon (runtime uses PoseidonHasher) - let preimage_hash: sp_core::H256 = - ::hash(&encoded_call); - - log_print!("🔗 Preimage hash: {:?}", preimage_hash); - - // Submit preimage - let preimage_call = quantus_subxt::api::tx().preimage().note_preimage(encoded_call.clone()); - let preimage_tx_hash = - submit_transaction(quantus_client, &keypair, preimage_call, None, execution_mode).await?; - - log_print!("✅ Preimage created {:?}", preimage_tx_hash); - - // Determine the origin based on track - let origin_caller = match track.to_lowercase().as_str() { - "small" => quantus_subxt::api::runtime_types::quantus_runtime::OriginCaller::Origins( - quantus_subxt::api::runtime_types::quantus_runtime::governance::origins::pallet_custom_origins::Origin::SmallSpender, - ), - "medium" => quantus_subxt::api::runtime_types::quantus_runtime::OriginCaller::Origins( - quantus_subxt::api::runtime_types::quantus_runtime::governance::origins::pallet_custom_origins::Origin::MediumSpender, - ), - "big" => quantus_subxt::api::runtime_types::quantus_runtime::OriginCaller::Origins( - quantus_subxt::api::runtime_types::quantus_runtime::governance::origins::pallet_custom_origins::Origin::BigSpender, - ), - "treasurer" => quantus_subxt::api::runtime_types::quantus_runtime::OriginCaller::Origins( - quantus_subxt::api::runtime_types::quantus_runtime::governance::origins::pallet_custom_origins::Origin::Treasurer, - ), - _ => { - return Err(crate::error::QuantusError::Generic(format!( - "Invalid track: {}. Must be 'small', 'medium', 'big', or 'treasurer'", - track - ))) - }, - }; - - // Create the bounded proposal - let proposal = - quantus_subxt::api::runtime_types::frame_support::traits::preimages::Bounded::Lookup { - hash: preimage_hash, - len: encoded_call.len() as u32, - }; - - log_print!("📜 Submitting referendum..."); - - // Submit referendum with DispatchTime::After - let enactment = - quantus_subxt::api::runtime_types::frame_support::traits::schedule::DispatchTime::After( - 1u32, - ); - let submit_call = - quantus_subxt::api::tx().referenda().submit(origin_caller, proposal, enactment); - let submit_tx_hash = - submit_transaction(quantus_client, &keypair, submit_call, None, execution_mode).await?; + // Portion of mining rewards that goes to treasury (0–100) + let portion_addr = quantus_subxt::api::storage().treasury_pallet().treasury_portion(); + let portion = storage_at.fetch(&portion_addr).await?.unwrap_or(0); - log_print!( - "✅ {} Treasury spend referendum submitted! {:?}", - "SUCCESS".bright_green().bold(), - submit_tx_hash - ); - log_print!("💡 Next steps:"); - log_print!(" 1. Place decision deposit: quantus referenda place-decision-deposit --index --from {}", from); - log_print!( - " 2. Vote on the referendum: quantus referenda vote --index --aye --from " - ); - log_print!( - " 3. After approval, payout: quantus treasury payout --index --from {}", - from - ); - - Ok(()) -} - -/// Payout an approved Treasury spend -async fn payout_spend( - quantus_client: &crate::chain::client::QuantusClient, - index: u32, - from: &str, - password: Option, - password_file: Option, - execution_mode: crate::cli::common::ExecutionMode, -) -> crate::error::Result<()> { - log_print!("💸 Paying out Treasury Spend #{}", index); - - // Load wallet keypair - let keypair = crate::wallet::load_keypair_from_wallet(from, password, password_file)?; - - // Create payout call - let payout_call = quantus_subxt::api::tx().treasury_pallet().payout(index); - - let tx_hash = - submit_transaction(quantus_client, &keypair, payout_call, None, execution_mode).await?; - log_print!( - "✅ {} Payout transaction submitted! Hash: {:?}", - "SUCCESS".bright_green().bold(), - tx_hash - ); - - log_success!("🎉 {} Treasury spend paid out!", "FINISHED".bright_green().bold()); - log_print!("💡 Use 'quantus treasury check-status --index {}' to cleanup", index); - - Ok(()) -} - -/// Check and cleanup a Treasury spend status -async fn check_spend_status( - quantus_client: &crate::chain::client::QuantusClient, - index: u32, - from: &str, - password: Option, - password_file: Option, - execution_mode: crate::cli::common::ExecutionMode, -) -> crate::error::Result<()> { - log_print!("🔍 Checking Treasury Spend #{} status", index); - - // Load wallet keypair - let keypair = crate::wallet::load_keypair_from_wallet(from, password, password_file)?; - - // Create check_status call - let check_call = quantus_subxt::api::tx().treasury_pallet().check_status(index); - - let tx_hash = - submit_transaction(quantus_client, &keypair, check_call, None, execution_mode).await?; - log_print!( - "✅ {} Check status transaction submitted! Hash: {:?}", - "SUCCESS".bright_green().bold(), - tx_hash - ); - - log_success!("🎉 {} Spend status checked and cleaned up!", "FINISHED".bright_green().bold()); - - Ok(()) -} - -/// List active Treasury spends -async fn list_spends( - quantus_client: &crate::chain::client::QuantusClient, -) -> crate::error::Result<()> { - log_print!("📋 Active Treasury Spends"); - log_print!(""); - - let latest_block_hash = quantus_client.get_latest_block().await?; - let storage_at = quantus_client.client().storage().at(latest_block_hash); - - // Iterate through spend storage indices (0 to 100 for example) - let mut count = 0; - for spend_index in 0..100 { - let spend_addr = quantus_subxt::api::storage().treasury_pallet().spends(spend_index); - if let Some(spend_status) = storage_at.fetch(&spend_addr).await? { - log_print!("💰 Spend #{}", spend_index.to_string().bright_yellow().bold()); - log_print!(" Amount: {} (raw)", spend_status.amount.to_string().bright_green()); - - // Format beneficiary address in Quantus SS58 format - use crate::cli::address_format::QuantusSS58; - let beneficiary_str = spend_status.beneficiary.to_quantus_ss58(); - log_print!(" Beneficiary: {}", beneficiary_str.bright_cyan()); - log_print!(" Valid From: Block #{}", spend_status.valid_from); - log_print!(" Expires At: Block #{}", spend_status.expire_at); - log_print!( - " Status: {}", - match spend_status.status { - quantus_subxt::api::runtime_types::pallet_treasury::PaymentState::Pending => - "Pending".bright_yellow(), - quantus_subxt::api::runtime_types::pallet_treasury::PaymentState::Attempted { .. } => - "Attempted".bright_blue(), - quantus_subxt::api::runtime_types::pallet_treasury::PaymentState::Failed => - "Failed".bright_red(), - } - ); - log_print!(""); - count += 1; - } - } - - if count == 0 { - log_print!("📭 No active Treasury spends found"); - } else { - log_print!("Total: {} active spend(s)", count.to_string().bright_green().bold()); - } - - Ok(()) -} - -/// Directly create a Treasury spend via sudo (testing/root only) -async fn spend_sudo( - quantus_client: &crate::chain::client::QuantusClient, - beneficiary: &str, - amount: &str, - from: &str, - password: Option, - password_file: Option, - execution_mode: crate::cli::common::ExecutionMode, -) -> crate::error::Result<()> { - use sp_core::crypto::{AccountId32 as SpAccountId32, Ss58Codec}; - - log_print!("💰 Creating Treasury Spend via Sudo (Root)"); - log_print!(" 📍 Beneficiary: {}", beneficiary.bright_yellow()); - log_print!(" 💵 Amount: {}", amount.bright_green()); - log_print!(" ⚠️ Using ROOT permissions (sudo)"); - - // Parse amount - let amount_value = crate::cli::send::parse_amount(quantus_client, amount).await?; - - // Parse beneficiary address - let beneficiary_resolved = crate::cli::common::resolve_address(beneficiary)?; - let (beneficiary_sp, _) = SpAccountId32::from_ss58check_with_version(&beneficiary_resolved) - .map_err(|e| { - crate::error::QuantusError::Generic(format!( - "Invalid beneficiary address '{beneficiary}': {e:?}" - )) - })?; - let bytes: [u8; 32] = *beneficiary_sp.as_ref(); - let beneficiary_account = subxt::utils::AccountId32::from(bytes); - let beneficiary_multi = subxt::utils::MultiAddress::Id(beneficiary_account.clone()); - - // Create the treasury spend call - let spend_call = quantus_subxt::api::Call::TreasuryPallet( - quantus_subxt::api::treasury_pallet::Call::spend { - asset_kind: Box::new(()), - amount: amount_value, - beneficiary: Box::new(beneficiary_multi), - valid_from: None, - }, - ); - - // Wrap with sudo - let sudo_call = quantus_subxt::api::tx().sudo().sudo(spend_call); + // Account balance + let account_storage = quantus_subxt::api::storage().system().account(treasury_account.clone()); + let account_info = storage_at.fetch(&account_storage).await?.ok_or_else(|| { + crate::error::QuantusError::Generic("Treasury account not found in system".to_string()) + })?; - // Load wallet keypair - let keypair = crate::wallet::load_keypair_from_wallet(from, password, password_file)?; + let free = account_info.data.free; + let reserved = account_info.data.reserved; - // Submit transaction - log_print!("📡 Submitting sudo transaction..."); - let tx_hash = - submit_transaction(quantus_client, &keypair, sudo_call, None, execution_mode).await?; - log_print!( - "✅ {} Sudo transaction submitted! Hash: {:?}", - "SUCCESS".bright_green().bold(), - tx_hash - ); + let formatted_free = crate::cli::send::format_balance_with_symbol(quantus_client, free).await?; + let formatted_reserved = + crate::cli::send::format_balance_with_symbol(quantus_client, reserved).await?; - log_success!("🎉 {} Treasury spend created via sudo!", "FINISHED".bright_green().bold()); - log_print!("💡 Next step: quantus treasury list-spends"); - log_print!("💡 Then payout: quantus treasury payout --index --from {}", beneficiary); + let account_ss58 = treasury_account.to_quantus_ss58(); + log_print!("📍 Account: {}", account_ss58.bright_yellow()); + log_print!("📊 Reward portion: {}%", portion.to_string().bright_cyan()); + log_print!("💰 Free: {}", formatted_free); + log_print!("💰 Reserved: {}", formatted_reserved); Ok(()) } diff --git a/src/quantus_metadata.scale b/src/quantus_metadata.scale index f55447c..c38c0f5 100644 Binary files a/src/quantus_metadata.scale and b/src/quantus_metadata.scale differ