| Crates.io | cma-rust-parser |
| lib.rs | cma-rust-parser |
| version | 0.1.3 |
| created_at | 2025-12-04 16:23:58.834326+00 |
| updated_at | 2025-12-08 11:20:17.858112+00 |
| description | Rust utilities for parsing Cartesi inputs and generating vouchers |
| homepage | |
| repository | https://github.com/Mugen-Builders/cma-rust-parser |
| max_upload_size | |
| id | 1966683 |
| size | 113,082 |
Lightweight Rust utilities to parse Cartesi Machine Application (CMA) inputs and to build on-chain voucher payloads to be executed on the base layer.
This crate is useful for Cartesi dApp developers who need to:
cma_decode_advance(input: JsonValue) -> Result<CmaParserInput, CmaParserError>CmaParserInput (enum + associated structs) with parsed fields (addresses, amounts, token ids, exec_layer data).cma_decode_inspect(input: JsonValue) -> Result<CmaParserInput, CmaParserError>ledgerGetBalance and ledgerGetTotalSupply encoded as JSON-in-hex and returns structured arguments.cma_encode_voucher(req_type: CmaParserVoucherType, voucher_request: CmaParserVoucherData) -> Result<CmaVoucher, CmaParserError>CmaVoucher (destination, value, payload) for sending to the chain. Implemented for Ether, ERC20 and ERC721 vouchers.CmaParserInputType — enumerates recognized request types (deposits, withdrawals, transfers, ledger queries).CmaParserInputData — enum wrapping specific parsed payload structs, e.g. EtherDeposit, Erc20Transfer, EtherWithdrawal, etc.CmaParserError — parsing error variants and helper conversions.CmaVoucher — final voucher structure (destination, value, payload) ready for submission.