承接 trenergy-wallet/trenergy_main_api 相关项目开发

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

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

trenergy-wallet/trenergy_main_api

最新稳定版本:v1.0.6

Composer 安装命令:

composer require trenergy-wallet/trenergy_main_api

包简介

Trenergy API client for Laravel

README 文档

README

Table of Contents

Contents
  1. 📦 Requirements
  2. 🚀 Installation
  3. ⚙️ Configuration
  4. 💻 Basic Usage example
  5. 🔧 Available Methods
  6. 🚨 Error Handling

Latest Stable Version Total Downloads License PHP Version

Official PHP client for TR.ENERGY API with full Laravel integration.

📦 Requirements

  • PHP 8.2+
  • Laravel 12
  • GuzzleHTTP 7.0+

🚀 Installation

composer config repositories.trenergy-main-api vcs https://github.com/Trenergy-wallet/trenergy_main_api
composer require trenergy-wallet/api:^1.0.1

⚙️ Configuration

Add to your .env:

TRENERGY_API_URL=https://api.trenergy.com
TRENERGY_API_KEY=your_api_key_here
TRENERGY_API_LANG=en  # Supported: en, ru

💻 Basic Usage example

use Apd\Trenergy\Facades\Trenergy;

// Get account info
$account = Trenergy::getAccount();

// Create consumer
$consumer = Trenergy::createConsumer(
    paymentPeriod: '15', 
    address: 'TXYZ...',
    resourceAmount: 100.0,
    name: 'My Consumer'
);

// Get wallets
$wallets = Trenergy::getWallets();

🔧 Available Methods

Method Parameters Returns Description
getAccount() - AccountDTO|array Get account information
getTopUp() - AccountTopUpDTO|array Get top-up information
subscribe() bool $isBalanceUsed, ?bool $isCredit = null SubscribeDTO|array Subscribe to service
getConsumers() - Collection<ConsumerDTO>|array List all consumers
downLoadConsumerList() ?string $name, ?bool $isActive, ?bool $autoRenewal, ?array $paymentPeriods, ?array $wallet, ?string $format string Download consumer list
createConsumer() string $paymentPeriod, string $address, float $resourceAmount, string $name, int $autoRenewal = 0 OrderCreatedDTO|array Create new consumer
getConsumer() int $consumerId ConsumerDTO|array Get consumer details
activateConsumer() int $consumerId ArrayDTO|array Activate consumer
deActivateConsumer() int $consumerId ArrayDTO|array Deactivate consumer
updateConsumer() int $consumerId, float $resourceAmount, int $paymentPeriod, bool $autoRenewal, ?string $name = null ConsumerDTO|array Update consumer
destroyConsumer() int $consumerId ArrayDTO|array Delete consumer
buyEnergy() string $paymentPeriod, string $address, float $resourceAmount, string $name, int $autoRenewal = 0 ArrayDTO|array Create and activate consumer
toggleAutoRenewal() bool $autoRenewal, array $consumersIds ArrayDTO|array Toggle auto-renewal
consumerBlockchainEnergy() int $consumerId BlockchainEnergyDTO|array Get blockchain energy
consumerMassTrx() float $amount, array $consumersIds ArrayDTO|array Mass TRX transfer
activateTronAddress() string $address ArrayDTO|array Activate TRON address
consumerResetValidity() int $consumerId ArrayDTO|array Reset validity period
consumerSummary() - ConsumerSummaryDTO|array Get consumer summary
consumerAddressReport() string $address, ?string $fromDate, ?string $toDate ArrayDTO|array Get address report
consumersConsumptionStats() string $fromDate, string $toDate, ?int $perPage ConsumptionStatTotalDTO|array Get consumption stats
consumerMassPaymentPeriod() array $consumersIds, int $paymentPeriod, bool $autoRenewal ArrayDTO|array Mass update payment period
amlList() ?string $fromDate, ?string $toDate, ?int $perPage AmlListDTO|array Get AML list
amlCheck() string $blockchain, ?string $address, ?string $txid ArrayDTO|array Check AML status
amlWalletType() string $address AmlWalletTypeDTO|array Check AML status
amlShow() int $amlId AmlCheckResultDTO|array Show AML
amlRepeatDeclined() int $amlId ArrayDTO|array Repeat AML when Declined
amlDeleteById() int $amlId ArrayDTO|array Delete AML Report
getWithdrawals() ?int $perPage = 5 GetWithdrawalsDTO|array Get withdrawals list
withdrawals() float $trxAmount, string $address, string $oneTimePassword ArrayDTO|array Create withdrawal
stakes() int $perPage = 5 GetStakeDTO|array Get stakes list
stake() float $trxAmount ArrayDTO|array Create stake
unstake() float $trxAmount, $oneTimePassword ArrayDTO|array Unstake funds
stakeSync() - ArrayDTO|array Sync stakes
stakeProfitability() ?int $period = null StakeProfitabilityDTO|array Get profitability stats
partners() ?int $leaderId = null StructureDTO|array Get partners structure
getWallets() - Collection<WalletDTO>|array Get wallets list
addWallet() string $address ArrayDTO|array Add wallet
dropWallet() int $walletId, string $oneTimePassword ArrayDTO|array Remove wallet

🚨 Error Handling

All methods may throw:

  • TrenergyServerErrorException
  • TrenergyWrongPaymentPeriod
  • RequireEnvParameters

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

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