From 25a007c29c4217cded90121be4832a4661caa4cf Mon Sep 17 00:00:00 2001 From: Abner Tudtud <114082473+enjinabner@users.noreply.github.com> Date: Thu, 14 Nov 2024 10:28:44 +0800 Subject: [PATCH] [PLA-2078] Correct probabilities format (#110) --- src/Models/Laravel/Beam.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Models/Laravel/Beam.php b/src/Models/Laravel/Beam.php index 986fe43..01f3e48 100644 --- a/src/Models/Laravel/Beam.php +++ b/src/Models/Laravel/Beam.php @@ -147,8 +147,16 @@ protected function claimsRemaining(): Attribute */ protected function probabilities(): Attribute { + $probabilities = ClaimProbabilities::getProbabilities($this->code)['probabilities'] ?? null; + return Attribute::make( - get: fn () => ClaimProbabilities::getProbabilities($this->code)['probabilities'] ?? null + get: fn () => $probabilities ? [ + 'ft' => (object) $probabilities['ft'], + 'nft' => $probabilities['nft'], + 'ftTokenIds' => (object) $probabilities['ftTokenIds'], + 'nftTokenIds' => (object) $probabilities['nftTokenIds'], + + ] : null ); }