Credits SDK
The credits crate provides an interface for managing and handling operations related to credit transactions on the Aleo network. With this crate, you can effortlessly generate, authorize, and execute credit-related transactions like transferring credits, bonding, unbonding, and more.
Features
- Simple Transactions: Easily transfer credits between two accounts.
- Staking & Validators: Bond or unbond microcredits to validators, control validator states, and manage unbonded credits.
Usage
First, add credits to your Cargo.toml dependencies:
[]
= "0.1.3"
Then, incorporate it in your Rust code:
use Credits;
Notice
This repository is under active development and is subject to change.
Notably, this repository does not yet support the following:
- Private transfers
- Private join/splits
- Checking the fee is sufficient for a transaction before executing it
Examples
bond_public
use Credits;
use Result;
unbond_public
use Credits;
use Result;
unbond_delegator_as_validator
use Credits;
use Result;
claim_unbond_public
use Credits;
use Result;
set_validator_state
use Credits;
use Result;
transfer_public
use Credits;
use Result;
transfer_public_to_private
use Credits;
use Result;
Testing
This crate provides a comprehensive set of tests for every function in the credits program.
Use the following to run tests:
Contributing
Pull requests are welcome. For significant changes, please open an issue first to discuss the intended change.