Giter VIP home page Giter VIP logo

eth.rb's Introduction

Ethereum for Ruby

GitHub Workflow Status GitHub release (latest by date) Gem Gem Visitors codecov Maintainability Top Language Yard Doc API Usage Wiki Open-Source License Contributions Welcome

A straightforward library to build, sign, and broadcast Ethereum transactions. It allows the separation of key and node management. Sign transactions and handle keys anywhere you can run Ruby and broadcast transactions through any local or remote node. Sign messages and recover signatures for authentication.

What you get:

  • Secp256k1 Key-Pairs and Encrypted Ethereum Key-Stores (JSON)
  • EIP-20 Token Transfers (ERC20)
  • EIP-55 Checksummed Ethereum Addresses
  • EIP-137 Ethereum Domain Name Service (ENS)
  • EIP-155 Replay protection with Chain IDs (with presets)
  • EIP-191 Ethereum Signed Messages (with prefix and type)
  • EIP-712 Ethereum Signed Type Data
  • EIP-1271 Smart-Contract Authentification
  • EIP-1559 Ethereum Type-2 Transactions (with priority fee and max gas fee)
  • EIP-2028 Call-data intrinsic gas cost estimates (plus access lists)
  • EIP-2718 Ethereum Transaction Envelopes (and types)
  • EIP-2930 Ethereum Type-1 Transactions (with access lists)
  • ABI-Encoder and Decoder (including type parser)
  • RLP-Encoder and Decoder (including sedes)
  • RPC-Client (IPC/HTTP) for Execution-Layer APIs
  • Solidity bindings (compile contracts from Ruby)
  • Full smart-contract support (deploy, transact, and call)

Installation

Add this line to your application's Gemfile:

gem "eth"

Or install it yourself as:

gem install eth

Usage

Check out the Yard API Docs and the Usage Wiki for all the details and example snippets.

Documentation

The documentation can be found at: https://q9f.github.io/eth.rb

For any specific version, docs can be generated by yard:

gem install bundler rdoc yard
git checkout $VERSION
yard doc

The goal is to have 100% API documentation available.

Testing

The test suite expects working local HTTP and IPC endpoints with a prefunded developer account, e.g.:

geth --dev --http --ipcpath /tmp/geth.ipc &

It also expects an $INFURA_TOKEN in environment to test some ENS queries on mainnet.

To run tests, simply use rspec. Note, that the Ethereum test fixtures are also required.

git submodule update --init --recursive
bundle install
rspec

The goal is to have 100% specification coverage for all code inside this gem.

Contributing

Pull requests are welcome! To contribute, please consider the following:

  • Code should be fully documented. Run yard doc and make sure it does not yield any warnings or undocumented sets.
  • Code should be fully covered by tests. Run rspec to make sure all tests pass. The CI has an integration that will assis you to identify uncovered lines of code and get coverage up to 100%.
  • Code should be formatted properly. Try to eliminate the most common issues such as trailing white-spaces or duplicate new-lines. Usage of the rufo gem is recommended.
  • Submit pull requests, questions, or issues to Github: https://github.com/q9f/eth.rb

License and Credits

The eth gem is licensed under the conditions of Apache 2.0. Please see AUTHORS for contributors and copyright notices.

This gem is a complete rewrite of the old eth gem by Steve Ellis.

It is not only a rewrite of the eth gem but also a partial merge of the ethereum gem by Marek Kirejczyk and Yuta Kurotaki.

This gem also includes a revised version of the ABI gem by Jan Xie and Zhang Yaning.

It also contains a condensed version of the RLP gem by Jan Xie and Zhang Yaning.

eth.rb's People

Contributors

se3000 avatar q9f avatar dependabot[bot] avatar kurotaky avatar dansimpson avatar randoum avatar a-moreira avatar beacoding avatar d4mk0 avatar escoffon avatar josh avatar justinkchen avatar geeknees avatar buhrmi avatar chainoperator avatar iamajvillalobos avatar ab320012 avatar pienkowb avatar lgn21st avatar lasvad avatar dladowitz avatar regul777 avatar etscrivner avatar johnnybutler7 avatar peter-chung-xfers avatar k-s-a avatar an-lee avatar flanagansteve avatar kudohamu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.