|
|
@@ -55,6 +55,8 @@ class UsdtWalletService extends BaseService
|
|
|
*/
|
|
|
public function __construct()
|
|
|
{
|
|
|
+ parent::__construct();
|
|
|
+
|
|
|
$this->memberModel = new MemberModel();
|
|
|
$this->coinModel = new CoinLogModel();
|
|
|
$this->capitalModel = new CapitalLogModel();
|
|
|
@@ -80,12 +82,19 @@ class UsdtWalletService extends BaseService
|
|
|
*/
|
|
|
public function getTrxAddress()
|
|
|
{
|
|
|
- $api = new Api(new Client(['base_uri' => $this->config['tron_api_url']]));
|
|
|
-
|
|
|
- $trxWallet = new TRX($api);
|
|
|
- $addressData = $trxWallet->generateAddress();
|
|
|
- $addressData = (array)$addressData;
|
|
|
- return ['wif' => $addressData['privateKey'], 'hexAddress' => $addressData['hexAddress'], 'address' => $addressData['address']];
|
|
|
+ try {
|
|
|
+ var_dump($this->config);
|
|
|
+ $api = new Api(new Client(['base_uri' => $this->config['tron_api_url']]));
|
|
|
+
|
|
|
+ $trxWallet = new TRX($api);
|
|
|
+ $addressData = $trxWallet->generateAddress();
|
|
|
+ $addressData = (array)$addressData;
|
|
|
+ return ['wif' => $addressData['privateKey'], 'hexAddress' => $addressData['hexAddress'], 'address' => $addressData['address']];
|
|
|
+
|
|
|
+ } catch (\Exception $exception){
|
|
|
+ $this->error = $exception->getMessage();
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|