You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a developer in the Dotsama ecosystem, usually i have to interact with multiple parachains (including the Kusama relychain) at once, the main idea with this example is to show how to interact or make multiple queries at once.
I think we can adapt the sube! macro to change based on different combinations of parameters to fit the simple and more complex cases.
I think something along this lines should be possible
// simple usage for storage queries, under the hood uses the builder to create a type that// implements `IntoFuture` that can be awaited(returns a scales::Value ?).let account = sube!("balances/account/0x1234").await?;// multi querylet(balanceKSM, balanceUSDT) = sube!("balances/account/0x1234",
"statemine://assets/account/1984/0x1234",
).await?;// subscribe to updates, the type returned by the builder has a method(e.g. `next`) to get updates// when async itereators are supported there is a some form of for-await it will be even more convenient to use whileletSome(n) = sube!("system/number").next().await{// handle update}// Single extrinsicsube!("balances/transfer" => { dest: "0x1234", value: 100_000}).await?;// Multi extrinsicsube!{"balances/transfer" => { dest: "0x1234", value: 100_000},
"statemine://assets/transfer" => { id: 1984, target: "0x1234", amount: 100_000},
}.await?;
As a developer in the Dotsama ecosystem, usually i have to interact with multiple parachains (including the Kusama relychain) at once, the main idea with this example is to show how to interact or make multiple queries at once.
The text was updated successfully, but these errors were encountered: