#serialization #protobuf #finance #model #transaction #bindings #price

bin+lib ledger-models

A comprehensive model library for financial products (securities, prices, transactions, etc). Protobuf used for serialization, with language-specific implementations

70 releases

0.1.92 Aug 29, 2024
0.1.90 Jul 27, 2024
0.1.75 Mar 30, 2024
0.1.68 Nov 26, 2023
0.1.11 Dec 29, 2022

#532 in Encoding

Download history 137/week @ 2024-06-20 3/week @ 2024-06-27 119/week @ 2024-07-04 111/week @ 2024-07-11 26/week @ 2024-07-18 224/week @ 2024-07-25 111/week @ 2024-08-01 23/week @ 2024-08-08 2/week @ 2024-08-15 105/week @ 2024-08-29 33/week @ 2024-09-12 106/week @ 2024-09-19 14/week @ 2024-09-26 3/week @ 2024-10-03

156 downloads per month

Apache-2.0

330KB
7K SLoC

Rust Types Derived from Proto Files

Context

This project contains protobuf models of financial objects & request/response formats for APIs; as well as language specific bindings.

Generating Types

To generate the types run cargo run --bin gen. This will overwrite the files in ledger-models-rust. Any new file must be exported in lib.rs.

This is included in the compile.sh script which creates types across all languages.

Project structure

Tonic/Prost is used to generate language bindings in Rust. Auto-generated files are created in the format fintekkers...rs.

Hand-written wrappers are included in the folder fintekkers/wrappers/file.rs. The purpose of this code is to make it easier to use the Rust implementation of fintekkers without having gitto understand all the nuance of protobufs, or nuances of performance optimizations made in the proto schema.

DevOps

Preparing Rust to publish

to publish a new version do the following

  1. generate the new protobus using the compile script
  2. export any new models in lib.rs
  3. bump the package version in Cargo.toml
  4. merge your pr then create a release tagged with the version, if the version = 0.1.1, set the tag to v0.1.1

Dependencies

~8–17MB
~222K SLoC