wallet tron transactions

This commit is contained in:
cano
2024-03-25 06:15:36 +08:00
parent 4b8f205e86
commit 489090382f
83 changed files with 5424 additions and 1343 deletions

View File

@ -0,0 +1,25 @@
<?php
namespace App\Bean\Queue;
use App\Bean\Model\Base\BaseBean;
class QueueBaseBean extends BaseBean
{
const TRY_LIMIT = 3;
protected $try_times = 0;
public function IncrTryTimes($num = 1): void
{
$this->try_times += $num;
}
public function checkTryTimes(): bool
{
if($this->try_times >= self::TRY_LIMIT) {
return false;
}
return true;
}
}

View File

@ -0,0 +1,123 @@
<?php
namespace App\Bean\Queue\Wallet;
use App\Bean\Queue\QueueBaseBean;
use App\Bean\Sdk\Wallet\Tron\EventResultBean;
use App\Bean\Sdk\Wallet\Tron\EventResultTypeBean;
class QueueEventBean extends QueueBaseBean
{
const QUEUE_NAME = 'queue_wallet_address_transaction';
protected $block_number;
protected $block_timestamp;
protected $caller_contract_address;
protected $contract_address;
protected $event;
protected $event_index;
protected $event_name;
protected EventResultBean $result;
protected EventResultTypeBean $result_type;
protected $transaction_id;
public function getBlockNumber()
{
return $this->block_number;
}
public function setBlockNumber($block_number): void
{
$this->block_number = $block_number;
}
public function getBlockTimestamp()
{
return $this->block_timestamp;
}
public function setBlockTimestamp($block_timestamp): void
{
$this->block_timestamp = $block_timestamp;
}
public function getCallerContractAddress()
{
return $this->caller_contract_address;
}
public function setCallerContractAddress($caller_contract_address): void
{
$this->caller_contract_address = $caller_contract_address;
}
public function getContractAddress()
{
return $this->contract_address;
}
public function setContractAddress($contract_address): void
{
$this->contract_address = $contract_address;
}
public function getEvent()
{
return $this->event;
}
public function setEvent($event): void
{
$this->event = $event;
}
public function getEventIndex()
{
return $this->event_index;
}
public function setEventIndex($event_index): void
{
$this->event_index = $event_index;
}
public function getEventName()
{
return $this->event_name;
}
public function setEventName($event_name): void
{
$this->event_name = $event_name;
}
public function getResult(): EventResultBean
{
return $this->result;
}
public function setResult(EventResultBean $result): void
{
$this->result = $result;
}
public function getResultType(): EventResultTypeBean
{
return $this->result_type;
}
public function setResultType(EventResultTypeBean $result_type): void
{
$this->result_type = $result_type;
}
public function getTransactionId()
{
return $this->transaction_id;
}
public function setTransactionId($transaction_id): void
{
$this->transaction_id = $transaction_id;
}
}

View File

@ -0,0 +1,84 @@
<?php
namespace App\Bean\Queue\Wallet;
use App\Bean\Queue\QueueBaseBean;
class QueueNotifyToPlatformBean extends QueueBaseBean
{
const QUEUE_NAME = 'queue_notify_to_platform';
const TYPE_WITHDRAW = 1;
protected $type;
protected $sn;
protected $amount;
protected $currency_code;
protected $status;
protected $platform_id;
public function getPlatformId()
{
return $this->platform_id;
}
public function setPlatformId($platform_id): void
{
$this->platform_id = $platform_id;
}
public function getType()
{
return $this->type;
}
public function setType($type): void
{
$this->type = $type;
}
public function getSn()
{
return $this->sn;
}
public function setSn($sn): void
{
$this->sn = $sn;
}
public function getAmount()
{
return $this->amount;
}
public function setAmount($amount): void
{
$this->amount = $amount;
}
public function getCurrencyCode()
{
return $this->currency_code;
}
public function setCurrencyCode($currency_code): void
{
$this->currency_code = $currency_code;
}
public function getStatus()
{
return $this->status;
}
public function setStatus($status): void
{
$this->status = $status;
}
}

View File

@ -0,0 +1,35 @@
<?php
namespace App\Bean\Queue\Wallet;
use App\Bean\Queue\QueueBaseBean;
class QueueWalletBlockBean extends QueueBaseBean
{
const QUEUE_NAME = 'queue_wallet_block';
protected $id;
protected $block_number;
public function getId()
{
return $this->id;
}
public function setId($id): void
{
$this->id = $id;
}
public function getBlockNumber()
{
return $this->block_number;
}
public function setBlockNumber($block_number): void
{
$this->block_number = $block_number;
}
}

View File

@ -0,0 +1,25 @@
<?php
namespace App\Bean\Queue\Wallet;
use App\Bean\Queue\QueueBaseBean;
class QueueWalletBlockTransactionBean extends QueueBaseBean
{
const QUEUE_NAME = 'queue_wallet_block_transaction';
protected array $data = [];
public function getData(): array
{
return $this->data;
}
public function setData(array $data): void
{
$this->data = $data;
}
}

View File

@ -0,0 +1,69 @@
<?php
namespace App\Bean\Queue\Wallet;
use App\Bean\Queue\QueueBaseBean;
class QueueWalletPlatformTransactionBean extends QueueBaseBean
{
const QUEUE_NAME = 'queue_wallet_platform_transaction';
protected $wallet_id;
protected $wallet_transaction_id;
protected $block_transaction_id;
protected $amount;
protected $type;
public function getWalletId()
{
return $this->wallet_id;
}
public function setWalletId($wallet_id): void
{
$this->wallet_id = $wallet_id;
}
public function getWalletTransactionId()
{
return $this->wallet_transaction_id;
}
public function setWalletTransactionId($wallet_transaction_id): void
{
$this->wallet_transaction_id = $wallet_transaction_id;
}
public function getBlockTransactionId()
{
return $this->block_transaction_id;
}
public function setBlockTransactionId($block_transaction_id): void
{
$this->block_transaction_id = $block_transaction_id;
}
public function getAmount()
{
return $this->amount;
}
public function setAmount($amount): void
{
$this->amount = $amount;
}
public function getType()
{
return $this->type;
}
public function setType($type): void
{
$this->type = $type;
}
}

View File

@ -0,0 +1,25 @@
<?php
namespace App\Bean\Queue\Wallet;
use App\Bean\Queue\QueueBaseBean;
class QueueWalletPlatformWithdrawTransferBean extends QueueBaseBean
{
const QUEUE_NAME = 'queue_wallet_platform_withdraw_transfer';
protected $transaction_id;
public function getTransactionId()
{
return $this->transaction_id;
}
public function setTransactionId($transaction_id): void
{
$this->transaction_id = $transaction_id;
}
}