Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a9a982f
commit 53ab56a
Showing
1 changed file
with
51 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,51 @@ | ||
<?php | ||
include_once '../vendor/autoload.php'; | ||
|
||
use IEXBase\TronAPI\Tron; | ||
|
||
$tron = new Tron(); | ||
$tron->setPrivateKey('...'); | ||
|
||
|
||
/** | ||
* check multi balances | ||
* | ||
* $address = [ | ||
* ['address', 'isFromTron'], | ||
* ['address', 'isFromTron'], | ||
* ] | ||
*/ | ||
|
||
//address one -> TRWBqiqoFZysoAeyR1J35ibuyc8EvhUAoY | ||
$addresses = [ | ||
['address one', true], | ||
['address two', true], | ||
['address three', false], | ||
]; | ||
|
||
//isValid (tron address) - default false | ||
$check = $tron->balances($addresses); | ||
var_dump($check); | ||
|
||
|
||
/** | ||
* send one to many | ||
* | ||
* $address = [ | ||
* ['to address', 'amount float'], | ||
* ['to address', 'amount float'], | ||
* ] | ||
* | ||
* toAddress format: TRWBqiqoFZysoAeyR1J35ibuyc8EvhUAoY | ||
*/ | ||
|
||
|
||
$toArray = [ | ||
['TRWBqiqoFZysoAeyR1J35ibuyc8EvhUAoY', 0.1], | ||
['TRWBqiqoFZysoAeyR1J35ibuyc8EvhUAoY', 0.2], | ||
['other address', 0.001] | ||
]; | ||
|
||
//default: $this->setPrivateKey(); | ||
$send = $tron->sendOneToMany('from_address', $toArray, 'private_key alt'); | ||
var_dump($send); |