Skip to content

Commit 399dc3e

Browse files
committed
Update to use with composer
1 parent b3efdbd commit 399dc3e

File tree

2 files changed

+14
-44
lines changed

2 files changed

+14
-44
lines changed

README.md

+8-42
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ A PHP API for interacting with the Tron Protocol
99

1010
## Install
1111

12+
```bash
13+
> composer require wawilow/tron-api --ignore-platform-reqs
14+
```
15+
16+
PS: To use Original library
1217
```bash
1318
> composer require iexbase/tron-api --ignore-platform-reqs
1419
```
@@ -18,51 +23,12 @@ The following versions of PHP are supported by this version.
1823

1924
* PHP 7.4
2025

21-
## Example Usage
22-
23-
```php
24-
use IEXBase\TronAPI\Tron;
25-
26-
$fullNode = new \IEXBase\TronAPI\Provider\HttpProvider('https://api.trongrid.io');
27-
$solidityNode = new \IEXBase\TronAPI\Provider\HttpProvider('https://api.trongrid.io');
28-
$eventServer = new \IEXBase\TronAPI\Provider\HttpProvider('https://api.trongrid.io');
29-
30-
try {
31-
$tron = new \IEXBase\TronAPI\Tron($fullNode, $solidityNode, $eventServer);
32-
} catch (\IEXBase\TronAPI\Exception\TronException $e) {
33-
exit($e->getMessage());
34-
}
35-
36-
37-
$this->setAddress('..');
38-
//Balance
39-
$tron->getBalance(null, true);
40-
41-
// Transfer Trx
42-
var_dump($tron->send('to', 1.5));
43-
44-
//Generate Address
45-
var_dump($tron->createAccount());
46-
47-
//Get Last Blocks
48-
var_dump($tron->getLatestBlocks(2));
49-
50-
//Change account name (only once)
51-
var_dump($tron->changeAccountName('address', 'NewName'));
52-
53-
54-
// Contract
55-
$tron->contract('Contract Address');
56-
57-
58-
59-
```
60-
6126
## Testing
6227

6328
``` bash
64-
$ vendor/bin/phpunit
29+
> composer install --ignore-platform-reqs
6530
```
6631

6732
## Donations
68-
**Tron(TRX)**: TRWBqiqoFZysoAeyR1J35ibuyc8EvhUAoY
33+
** Author - Tron(TRX)**: TRWBqiqoFZysoAeyR1J35ibuyc8EvhUAoY
34+
** Editor - Tron(TRX)**: TBKjxAsFPk9EMFu18WK6mT6bADyb6NgnkN

composer.json

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
{
2-
"name": "iexbase/tron-api",
2+
"name": "wawilow/tron-api",
33
"description": "A PHP API for interacting with Tron (Trx)",
44
"license": "MIT",
55
"type": "library",
6-
"homepage": "https://github.com/iexbase/tron-api",
6+
"homepage": "https://github.com/wawilow/tron-api",
77
"authors": [
88
{
99
"name": "Shamsudin Serderov",
1010
"email": "[email protected]"
11+
},
12+
{
13+
"name": "George Wawilow",
14+
"email": "[email protected]"
1115
}
1216
],
1317
"keywords": [

0 commit comments

Comments
 (0)