Skip to content

Commit

Permalink
add nft metadata description
Browse files Browse the repository at this point in the history
  • Loading branch information
michavie committed Jan 15, 2022
1 parent 54ed789 commit fbafc59
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Domain/Nft.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public function __construct(
public ?string $owner = null,
public ?int $supply = null,
public array $tags = [],
public ?string $description = null,
) {
}

Expand Down Expand Up @@ -57,6 +58,7 @@ protected static function transformResponse(array $res): array
{
return array_merge($res, [
'attributes' => isset($res['attributes']) ? base64_decode($res['attributes']) : '',
'description' => $res['metadata']['description'] ?? null,
]);
}
}
1 change: 1 addition & 0 deletions src/Http/Converters/NftResponseConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public static function single(Nft $nft): array
'owner' => $nft->owner,
'supply' => $nft->supply,
'tags' => $nft->getTags(),
'description' => $nft->description,
];
}

Expand Down

0 comments on commit fbafc59

Please sign in to comment.