Skip to content

fwx5618177/PHP-Torn-Transfer-From

Repository files navigation

Tron Transaction

.
├── READMD.md             # Instruction
├── TronTransaction.php   # Main class
├── TronTransactionTest.php     # Test case
└── useTronTransaction.php      # Example

Install dependency

composer require iexbase/tron-api

Usage

# Send TRX to address
$result = $tronTransaction->sendTRX('receiver-address-for-TRX', 100);

# Send TRC20 to address
$result = $tronTransaction->sendTRC20('your-send-address-for-TRC20', 'contract-address-for-TRC20', 100);

Test Case

  1. Install
composer require --dev phpunit/phpunit ^9
  1. Change variable in TronTransactionTest.php
  2. Run all test case
./vendor/bin/phpunit TronTransactionTest.php

# Global install phpunit
phpunit TronTransactionTest.php

Note:

  1. Replace 'your-test-private-key-here', 'TRC20-contract-address-here' and 'receiver-address-here' to your own.

About

To implement the function of torn transfer from by php

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages