diff --git a/app/Models/Transaction.php b/app/Models/Transaction.php index 1efc71fcb..888d80657 100644 --- a/app/Models/Transaction.php +++ b/app/Models/Transaction.php @@ -31,6 +31,7 @@ * @property string $id * @property array|null $asset * @property BigNumber $amount + * @property BigNumber $gas_price * @property int $timestamp * @property int $type * @property int $type_group @@ -98,7 +99,7 @@ final class Transaction extends Model protected $casts = [ 'amount' => BigInteger::class, 'asset' => 'array', - 'fee' => BigInteger::class, + 'gas_price' => BigInteger::class, 'timestamp' => UnixSeconds::class, 'type_group' => 'int', 'type' => 'int', @@ -128,6 +129,7 @@ public function toSearchableArray(): array // To get the amount for single payments // Using `__toString` since are instances of `BigNumber` 'amount' => $this->amount->__toString(), + 'fee' => $this->gas_price->__toString(), // used to build the payments and sortable 'timestamp' => $this->timestamp, ]; @@ -146,6 +148,7 @@ public static function getSearchableQuery(): Builder 'sender_public_key', 'recipient_address', 'amount', + 'gas_price', 'timestamp', ]) ->when(true, function ($query) use ($self) { diff --git a/app/ViewModels/TransactionViewModel.php b/app/ViewModels/TransactionViewModel.php index e215e973a..fae2c83e8 100644 --- a/app/ViewModels/TransactionViewModel.php +++ b/app/ViewModels/TransactionViewModel.php @@ -93,12 +93,12 @@ public function nonce(): int public function fee(): float { - return $this->transaction->fee->toFloat(); + return $this->transaction->gas_price->toFloat(); } public function feeFiat(bool $showSmallAmounts = false): string { - return ExchangeRate::convert($this->transaction->fee->toFloat(), $this->transaction->timestamp, $showSmallAmounts); + return ExchangeRate::convert($this->transaction->gas_price->toFloat(), $this->transaction->timestamp, $showSmallAmounts); } public function amountForItself(): float