Skip to content

Commit

Permalink
Merge pull request #1 from sc0Vu/master
Browse files Browse the repository at this point in the history
Ethereum transaction php version prototype.
  • Loading branch information
sc0Vu committed Mar 13, 2018
2 parents c72d71b + 006bccf commit 20406b1
Show file tree
Hide file tree
Showing 8 changed files with 2,387 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .travis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
sudo: required

language: php

php:
- 7.1
- 7.2

install:
- composer install

notifications:
email:
recipients:
- [email protected]
on_success: always
on_failure: always

script:
- vendor/bin/phpunit --coverage-clover=coverage.xml

after_success:
- bash <(curl -s https://codecov.io/bash) -t 284c5fc4-2109-4bb3-822f-82026d67b1bd
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,44 @@
# ethereum-tx
[![Build Status](https://travis-ci.org/web3p/ethereum-tx.svg?branch=master)](https://travis-ci.org/web3p/ethereum-tx)
[![codecov](https://codecov.io/gh/web3p/ethereum-tx/branch/master/graph/badge.svg)](https://codecov.io/gh/web3p/ethereum-tx)

Ethereum transaction library in PHP.

# Install

```
composer require web3p/ethereum-tx
```

# Usage

Create a transaction:
```php
use EthereumTx\Transaction;

$transaction = new Transaction([
'nonce' => '0x01',
'from' => '0xb60e8dd61c5d32be8058bb8eb970870f07233155',
'to' => '0xd46e8dd67c5d32be8058bb8eb970870f07244567',
'gas' => '0x76c0',
'gasPrice' => '0x9184e72a000',
'value' => '0x9184e72a',
'data' => '0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675'
]);
```

Sign a transaction:
```php
use EthereumTx\Transaction;

$signedTransaction = $transaction->sign('your private key');
```

# API

Todo.

# License
MIT


31 changes: 31 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "web3p/ethereum-tx",
"description": "Ethereum transaction library in PHP.",
"type": "library",
"license": "MIT",
"authors": [
{
"name": "sc0Vu",
"email": "[email protected]"
}
],
"minimum-stability": "dev",
"require-dev": {
"phpunit/phpunit": "~6.0"
},
"autoload": {
"psr-4": {
"EthereumTx\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Test\\": "test/"
}
},
"require": {
"web3p/rlp": "dev-master",
"web3p/secp256k1": "dev-master",
"kornrunner/keccak": "dev-master"
}
}
Loading

0 comments on commit 20406b1

Please sign in to comment.