Crates.io | hcnet-xdr |
lib.rs | hcnet-xdr |
version | 20.0.22 |
source | src |
created_at | 2024-01-30 08:38:04.550268 |
updated_at | 2024-04-25 10:57:46.285939 |
description | Hcnet XDR types, encoding, and decoding. |
homepage | https://github.com/shantanu-hashcash/rs-hcnet-xdr |
repository | https://github.com/shantanu-hashcash/rs-hcnet-xdr |
max_upload_size | |
id | 1120021 |
size | 4,313,024 |
Library and CLI containing types and functionality for working with Hcnet XDR.
Types are generated from XDR definitions hosted at hcnet/hcnet-xdr using xdrgen.
To use the library, include in your toml:
hcnet-xdr = { version = "...", default-features = true, features = [] }
The crate has several features, tiers of functionality, ancillary functionality, and channels of XDR.
Default features: std
, curr
.
Teirs of functionality:
std
– The std feature provides all functionality (types, encode,
decode), and is the default feature set.alloc
– The alloc feature uses Box
and Vec
types for recursive
references and arrays, and is automatically enabled if the std feature is
enabled. The default global allocator is used. Support for a custom
allocator will be added in #39. No encode or decode capability exists,
only types. Encode and decode capability will be added in #46.Ancillary functionality:
base64
– Enables support for base64 encoding and decoding.serde
– Enables support for serializing and deserializing types with
the serde crate.arbitrary
– Enables support for interop with the arbitrary crate.Channels of XDR:
curr
– XDR types built from the hcnet/hcnet-xdr
curr
branch.next
– XDR types built from the hcnet/hcnet-xdr
next
branch.If a single channel is enabled the types are available at the root of the crate. If multiple channels are enabled they are available in modules at the root of the crate.
To use the CLI:
cargo install --locked hcnet-xdr --version ... --features cli
Parse a TransactionEnvelope
:
hcnet-xdr decode --type TransactionEnvelope << -
AAAAA...
-
Parse a ScSpecEntry
stream from a contract:
hcnet-xdr +next decode --type ScSpecEntry --input stream-base64 --output json-formatted << -
AAAAA...
-
Parse a BucketEntry
framed stream from a bucket file:
hcnet-xdr decode --type BucketEntry --input stream-framed --output json-formatted bucket.xdr
License: Apache-2.0