承接 fenguoz/tron-php 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

fenguoz/tron-php

最新稳定版本:2.1.0

Composer 安装命令:

composer require fenguoz/tron-php

包简介

Support TRON's TRX and TRC20, which include functions such as address creation, balance query, transaction transfer, query the latest blockchain, query information based on the blockchain, and query information based on the transaction hash

README 文档

README

English | 中文

TRON-PHP

Stable Version Php Version tron-php License Total Downloads

Introduction

Support TRON's TRX and TRC20, which include functions such as address creation, balance query, transaction transfer, query the latest blockchain, query information based on the blockchain, and query information based on the transaction hash

Advantage

  1. One set of scripts is compatible with all TRX currencies and TRC20 certifications in the TRON network
  2. Interface methods can be added or subtracted flexibly

Support Method

  • Generate address generateAddress()
  • Verify address validateAddress(Address $address)
  • Get the address according to the private key privateKeyToAddress(string $privateKeyHex)
  • Check balances balance(Address $address)
  • Transaction transfer (offline signature) transfer(string $from, string $to, float $amount)
  • Query the latest block blockNumber()
  • Query information according to the blockchain blockByNumber(int $blockID)
  • *Query information based on transaction hash transactionReceipt(string $txHash)

Quick Start

Install

PHP8

composer require fenguoz/tron-php

or PHP7

composer require fenguoz/tron-php ~1.3

Interface

use GuzzleHttp\Client;

$uri = 'https://api.trongrid.io';// mainnet
// $uri = 'https://api.shasta.trongrid.io';// shasta testnet
$api = new \Tron\Api(new Client(['base_uri' => $uri]));

$trxWallet = new \Tron\TRX($api);
$addressData = $trxWallet->generateAddress();
// $addressData->privateKey
// $addressData->address

$config = [
    'contract_address' => 'TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t',// USDT TRC20
    'decimals' => 6,
];
$trc20Wallet = new \Tron\TRC20($api, $config);
$addressData = $trc20Wallet->generateAddress();

Plan

  • Support TRC10
  • Smart Contract

Package

Name description Scenes
Fenguoz/tron-api TRON official document recommends PHP extension package TRON basic API

🌟🌟

Stargazers over time

Cooperate

Contact

  • WX:zgf243944672
  • QQ:243944672

统计信息

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

GitHub 信息

  • Stars: 210
  • Watchers: 7
  • Forks: 74
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-03-10