https://github.com/stellar/rs-stellar-strkey
Rust lib for encode/decode of Stellar Strkeys.
https://github.com/stellar/rs-stellar-strkey
Last synced: 9 months ago
JSON representation
Rust lib for encode/decode of Stellar Strkeys.
- Host: GitHub
- URL: https://github.com/stellar/rs-stellar-strkey
- Owner: stellar
- License: apache-2.0
- Created: 2022-04-25T15:54:49.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-09-11T01:29:25.000Z (almost 2 years ago)
- Last Synced: 2024-12-06T09:51:28.295Z (over 1 year ago)
- Language: Rust
- Homepage:
- Size: 62.5 KB
- Stars: 1
- Watchers: 11
- Forks: 12
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rs-stellar-strkey
Library and CLI containing types and functionality for working with Stellar
Strkeys.
**This repository contains code that is in early development, incomplete,
not tested, and not recommended for use. The API is unstable, experimental,
and is receiving breaking changes frequently.**
### Usage
#### Library
To use the library, include in your toml:
```toml
stellar-strkey = "..."
```
This crate does not depend on the `std` crate and can be used in `no_std` environments.
However, please note that it relies on the [`alloc`](https://docs.rust-embedded.org/book/collections/#using-alloc) crate for certain types such as `Vec`.
#### CLI
To use the CLI:
```console
cargo install --locked stellar-strkey --version ... --features cli
```
##### Examples
Decode a `G` account/public-key strkey:
```console
$ stellar-strkey decode GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWHF
PublicKeyEd25519(PublicKey(0000000000000000000000000000000000000000000000000000000000000000))
```
Decode a `C` contract strkey:
```console
$ stellar-strkey decode CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABSC4
Contract(Contract(0000000000000000000000000000000000000000000000000000000000000000))
```
License: Apache-2.0