-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from sc0Vu/master
Ethereum transaction php version prototype.
- Loading branch information
Showing
8 changed files
with
2,387 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |
Oops, something went wrong.