Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/q9f/eth.cr
A straightforward library to build, sign, and broadcast Ethereum transactions.
https://github.com/q9f/eth.cr
crystal ethereum
Last synced: 26 days ago
JSON representation
A straightforward library to build, sign, and broadcast Ethereum transactions.
- Host: GitHub
- URL: https://github.com/q9f/eth.cr
- Owner: q9f
- License: apache-2.0
- Created: 2022-04-07T10:56:59.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-04-26T13:48:29.000Z (over 1 year ago)
- Last Synced: 2024-10-04T19:37:50.820Z (about 2 months ago)
- Topics: crystal, ethereum
- Language: Crystal
- Homepage:
- Size: 32.2 KB
- Stars: 6
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# eth.cr
[![Build Status](https://img.shields.io/github/actions/workflow/status/q9f/eth.cr/crystal.yml?branch=main)](https://github.com/q9f/eth.cr/actions)
[![Language](https://img.shields.io/github/languages/top/q9f/eth.cr?color=black)](https://github.com/q9f/eth.cr/search?l=crystal)
[![License](https://img.shields.io/github/license/q9f/eth.cr.svg?color=black)](LICENSE)## Installation
Add the `Eth` library to your `shard.yml`.
```yaml
dependencies:
eth:
github: q9f/eth.cr
version: "~> 0.1"
```Run `shards install`.
## Usage
```crystal
require "eth"
```Create an Ethereum account:
```crystal
key = Key.new
# => #,
# @public_key=#,
# @y=#>,
# @address=#>key.private_hex
# => "d6c8ace470ab0ce03125cac6abf2779c199d21a47d3e75e93c212b1ec23cfe51"key.public_hex
# => "04bf0cf8c934bd3c57e962fdf2a47e99d6136b047f987ee2e0cb03110cafd92afc981974428f8162d3f8fce2f58d4e56341478e87d092aeb3a0edf8af97d638d04"key.address.to_s
# => "0x2Ef1f605AF5d03874eE88773f41c1382ac71C239"
```## Documentation
Generate a local copy with:
```shell
crystal docs
```## Testing
The library is entirely specified through tests in `./spec`; run:
```shell
crystal spec --verbose
```## Contribute
Create a pull request, and make sure tests and linter pass.
This pure crystal implementation is based on the ruby implementation [q9f/eth.rb](https://github.com/q9f/eth.rb) which is also used as reference to write tests against.
License: Apache License v2.0
Contributors: [**@q9f**](https://github.com/q9f/)