Skip to content

Commit

Permalink
[PLA-2078] Correct probabilities format (#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
enjinabner committed Nov 14, 2024
1 parent c0deeda commit 25a007c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Models/Laravel/Beam.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
}

Expand Down

0 comments on commit 25a007c

Please sign in to comment.