Post

CodeMultiversX
CodeMultiversX@CodeMultiversX·
Meet the Tech: Async Calls from Contracts 🧩 The protocol-level mechanism that lets one MultiversX contract call another, even when they live on different shards. Cross-shard calls are asynchronous by design — there's no synchronous return across the metachain. The framework gives you a typed surface over the async semantics. Initiate with async_call_and_exit, receive the response in a #[callback]. 💡 🧵
CodeMultiversX tweet media
English
3
20
86
5.8K
CodeMultiversX
CodeMultiversX@CodeMultiversX·
How it works: self.tx() .to(&other_contract) .typed(OtherProxy) .do_work(arg) .with_callback(self.callbacks().on_work_done()) .async_call_and_exit(); The calling contract dispatches the call and exits. When the target contract responds, the protocol routes the result back, and the framework invokes the registered callback. #[callback] fn on_work_done(&self, #[call_result] result: ManagedAsyncCallResult) { match result { ManagedAsyncCallResult::Ok(value) => { /* success path */ } ManagedAsyncCallResult::Err(err) => { /* failure path */ } } }
English
1
1
22
188
Paylaş