Post

CodeMultiversX
CodeMultiversX@CodeMultiversX·
Meet the Tech: The Tx Syntax 🧩 The unified fluent builder for outgoing transactions in a MultiversX Rust contract. EGLD transfer, ESDT, cross-contract call, deploy, read-only query. Same chain, different terminal operation. 💡 🧵
CodeMultiversX tweet media
English
2
32
122
8K
CodeMultiversX
CodeMultiversX@CodeMultiversX·
How it works: self.tx() .to(&recipient) .egld(&amount) .transfer(); Open the builder with self.tx(). Set the receiver with .to(). Attach value with .egld(). Dispatch with .transfer(). Every step is type-checked at compile time. The chain won't build if the pieces don't fit together.
English
1
1
20
334
CodeMultiversX
CodeMultiversX@CodeMultiversX·
The pattern that makes it broadly useful: typed proxies. Add .typed(MyProxy) mid-chain, and you get compile-time argument checking on a call to another contract. self.tx() .to(&counter_contract) .typed(CounterProxy) .get_count() .returns(ReturnsResult) .sync_call(); The proxy is auto-generated from the target contract's ABI. The arguments you pass and the result you receive are typed end-to-end.
English
1
2
17
267
CodeMultiversX
CodeMultiversX@CodeMultiversX·
What to use it for: • Native transfers — self.tx().to(&user).egld(&amt).transfer() • ESDT transfers — .single_esdt() for one token, .payment() for multi-token bundles • Cross-contract calls — sync (same-shard), async with callback (cross-shard), or fire-and-forget transfer_execute • Deploys, upgrades, and queries — same builder, different terminal operation
English
1
1
14
174
Paylaş