[][src]Crate active_tx

Activeledger Transaction Helper

Activeledger

Activeledger is a powerful distributed ledger technology. Think about it as a single ledger, which is updated simultaneously in multiple locations. As the data is written to a ledger, it is approved and confirmed by all other locations.

This Crate

This crate provides Rust developers an easy way to build up transactions without needing other crates, such as Serde.

This crate provides macros as well as builders that help create a transaction with the correct structure. Additionally it provides two methods of creating a complete onboarding transaction. With and without a provided key.

Additional Activeledger crates

Adhearing to the Rust mentality of keeping things small we have created other crates that can be used in conjunction with this one to add additional functionality.

These crates are:

Activeledger

Activeledger Developers portal

Activeledger on GitHub

Activeledger on NPM

This SDK on GitHub

Report Issues

Example usage

let input = packet_data!({"[streamid]": {"input": "data"}});

let input_data = PacketBuilder::new(input).build().unwrap();
  
let mut tx_builder = TransactionBuilder::new("namespace", "contract");

let streamid = "streamid";
let key = Key::Ec(EllipticCurve::new(streamid).unwrap());

let signees = signees![{streamid => key}];

let tx = tx_builder
    .input(input_data)
    .unwrap()
    .build(signees)
    .unwrap();

For more information on the usage of this crate see the TransactionBuilder documentation.

Macros

packet_data

Packet data macro

signees

Signees Macro

Structs

PacketBuilder

Provides build methods

PacketData

Stores the data built by PacketBuilder

Signees

Holds an array of Signees

TransactionBuilder

Transaction builder

Enums

Key

Holds the key to use when signing the transaction packet

KeyType

Key Type for generating a key and onboarding it

PacketValue

Holds recursive values for the $i (input), $o (output), and $r (readonly) objects of a transaction packet.

TxBuilderError

KeyError data holder

Type Definitions

TxBuilderResult

KeyResult definition - Shorthand for: Result<T, TxBuilderError>