Skip to content

Commit

Permalink
examples tron universal
Browse files Browse the repository at this point in the history
  • Loading branch information
serderovsh committed Oct 17, 2018
1 parent a9a982f commit 53ab56a
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions examples/universal.php
@@ -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);

0 comments on commit 53ab56a

Please sign in to comment.