定制 takpesar/tron 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

takpesar/tron

最新稳定版本:v1.0.4

Composer 安装命令:

composer require takpesar/tron

包简介

A PHP library to create Tron wallet addresses and manage wallets using the Tron API

README 文档

README

Tron ( TRX ) crypto currency API ! This library facilitates connectivity to the Tron network, enabling you to generate a personalized wallet address. This is achieved through utilization of the Tron API.

Installation

composer require takpesar/tron

Requirements

This package requires PHP 8 or later. BCMath and Curl extensions require this package

Usage

<?php

require __DIR__ . '/vendor/autoload.php';

use Tak\Tron\API;

$tron = new API();

$address = $tron->generateAddress();

var_dump($address);

$tron = new API(privatekey : $address->privatekey,wallet : $address->wallet);

$balance = $tron->getBalance();
print 'your balance : '.$balance;
print PHP_EOL;

try {
	$send = $tron->sendTron(to : 'TJZfm2PSQ38WNwzPqSBpTbVAynZpMEmfKR',amount : 10.5);
	print 'transaction : '.var_export($send,true);
} catch(Throwable $e){
	print 'transaction error : '.$e->getMessage();
}

Use Phar ( Faster and easier ! )

<?php

$path = __DIR__.DIRECTORY_SEPARATOR.'trx.phar';

if(file_exists($path) === false) copy('https://tron.phar.fun/tron.phar',$path);

require_once $path;

use Tak\Tron\API;

$tron = new API();

$address = $tron->generateAddress();

var_dump($address);

Note Please see examples for more examples

Issues

Should you encounter any issues, please do not hesitate to reach out to us via email at loser.man.2007@gmail.com.

License

The MIT License (MIT). Please see LICENSE for more information.

统计信息

  • 总下载量: 3.08k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 19
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 18
  • Watchers: 2
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-09-29