diff --git a/app/Console/Commands/LiveDumpNfts.php b/app/Console/Commands/LiveDumpNfts.php index 513fb45d3..257353b56 100644 --- a/app/Console/Commands/LiveDumpNfts.php +++ b/app/Console/Commands/LiveDumpNfts.php @@ -300,7 +300,7 @@ private function getCollectionTraitsAndPersist(Chain $chain, string $address): v $fs = Storage::disk(self::diskName); - $traits = Mnemonic::getNftCollectionTraits($chain, $address); + $traits = Mnemonic::getCollectionTraits($chain, $address); $path = $this->prepareCollectionPath($chain, $address); diff --git a/app/Console/Commands/LiveDumpWallets.php b/app/Console/Commands/LiveDumpWallets.php index 072f20c0f..d5253cb45 100644 --- a/app/Console/Commands/LiveDumpWallets.php +++ b/app/Console/Commands/LiveDumpWallets.php @@ -84,7 +84,7 @@ public function handle(): int $collectionFloorPrices = $collectionAddresses ->mapWithKeys(fn (string $collectionAddress - ) => [$collectionAddress => Mnemonic::getNftCollectionFloorPrice($chain, $collectionAddress)]); + ) => [$collectionAddress => Mnemonic::getCollectionFloorPrice($chain, $collectionAddress)]); // modify `network` and `retrievedAt` to make output stable between reruns as these change independent // of the API response. @@ -114,7 +114,7 @@ public function handle(): int // Download traits for each collection $allTraits = $nftCollections->mapWithKeys(function ($collectionAddresses, $chainId) { $traits = $collectionAddresses->unique() - ->mapWithKeys(fn ($collectionAddress) => [$collectionAddress => Mnemonic::getNftCollectionTraits(Chain::from($chainId), $collectionAddress)]); + ->mapWithKeys(fn ($collectionAddress) => [$collectionAddress => Mnemonic::getCollectionTraits(Chain::from($chainId), $collectionAddress)]); return [$chainId => $traits]; }); diff --git a/app/Contracts/Web3DataProvider.php b/app/Contracts/Web3DataProvider.php index 43447d370..bc8c096e1 100644 --- a/app/Contracts/Web3DataProvider.php +++ b/app/Contracts/Web3DataProvider.php @@ -38,5 +38,5 @@ public function getBlockTimestamp(Network $network, int $blockNumber): Carbon; */ public function getMiddleware(): array; - public function getNftCollectionFloorPrice(Chain $chain, string $contractAddress): ?Web3NftCollectionFloorPrice; + public function getCollectionFloorPrice(Chain $chain, string $contractAddress): ?Web3NftCollectionFloorPrice; } diff --git a/app/Http/Client/Alchemy/AlchemyPendingRequest.php b/app/Http/Client/Alchemy/AlchemyPendingRequest.php index 4a1951016..622515cfd 100644 --- a/app/Http/Client/Alchemy/AlchemyPendingRequest.php +++ b/app/Http/Client/Alchemy/AlchemyPendingRequest.php @@ -484,7 +484,7 @@ private function tokenMetadata(string $tokenAddress): ?array } // https://docs.alchemy.com/reference/getfloorprice - public function getNftCollectionFloorPrice(Chain $chain, string $contractAddress): ?Web3NftCollectionFloorPrice + public function getCollectionFloorPrice(Chain $chain, string $contractAddress): ?Web3NftCollectionFloorPrice { // Only ETH is supported at the moment since this API is still considered in beta: diff --git a/app/Http/Client/Mnemonic/MnemonicPendingRequest.php b/app/Http/Client/Mnemonic/MnemonicPendingRequest.php index b99f003ba..c1b428bae 100644 --- a/app/Http/Client/Mnemonic/MnemonicPendingRequest.php +++ b/app/Http/Client/Mnemonic/MnemonicPendingRequest.php @@ -99,7 +99,7 @@ public function send(string $method, string $path, array $options = []): Respons } // https://docs.mnemonichq.com/reference/marketplacesservice_getfloorprice - public function getNftCollectionFloorPrice(Chain $chain, string $contractAddress): ?Web3NftCollectionFloorPrice + public function getCollectionFloorPrice(Chain $chain, string $contractAddress): ?Web3NftCollectionFloorPrice { $this->chain = MnemonicChain::fromChain($chain); @@ -180,7 +180,7 @@ public function getNftCollectionFloorPrice(Chain $chain, string $contractAddress } // https://docs.mnemonichq.com/reference/collectionsservice_getmetadata - public function getNftCollectionBanner(Chain $chain, string $contractAddress): ?string + public function getCollectionBanner(Chain $chain, string $contractAddress): ?string { $this->chain = MnemonicChain::fromChain($chain); @@ -215,7 +215,7 @@ public function getNftCollectionBanner(Chain $chain, string $contractAddress): ? } // https://docs.mnemonichq.com/reference/collectionsservice_getownerscount - public function getNftCollectionOwners(Chain $chain, string $contractAddress): ?int + public function getCollectionOwners(Chain $chain, string $contractAddress): ?int { $this->chain = MnemonicChain::fromChain($chain); @@ -232,7 +232,7 @@ public function getNftCollectionOwners(Chain $chain, string $contractAddress): ? } // https://docs.mnemonichq.com/reference/collectionsservice_getsalesvolume - public function getNftCollectionVolume(Chain $chain, string $contractAddress): ?string + public function getCollectionVolume(Chain $chain, string $contractAddress): ?string { $this->chain = MnemonicChain::fromChain($chain); @@ -258,7 +258,7 @@ public function getNftCollectionVolume(Chain $chain, string $contractAddress): ? /** * @return Collection */ - public function getNftCollectionTraits(Chain $chain, string $contractAddress): Collection + public function getCollectionTraits(Chain $chain, string $contractAddress): Collection { // { // "name": "string", diff --git a/app/Http/Client/Moralis/MoralisPendingRequest.php b/app/Http/Client/Moralis/MoralisPendingRequest.php index 1a0e8fced..e1f7365aa 100644 --- a/app/Http/Client/Moralis/MoralisPendingRequest.php +++ b/app/Http/Client/Moralis/MoralisPendingRequest.php @@ -242,7 +242,7 @@ public function getNativeBalances(array $walletAddresses, Network $network): Col * @see https://docs.moralis.io/web3-data-api/evm/reference/get-nft-lowest-price * Get the lowest executed price for an NFT contract for the last x days (only trades paid in ETH). */ - public function getNftCollectionFloorPrice(Chain $chain, string $contractAddress): ?Web3NftCollectionFloorPrice + public function getCollectionFloorPrice(Chain $chain, string $contractAddress): ?Web3NftCollectionFloorPrice { try { $data = self::get(sprintf('nft/%s/lowestprice', $contractAddress), [ diff --git a/app/Http/Client/Opensea/OpenseaPendingRequest.php b/app/Http/Client/Opensea/OpenseaPendingRequest.php index e76a03814..894e338a8 100644 --- a/app/Http/Client/Opensea/OpenseaPendingRequest.php +++ b/app/Http/Client/Opensea/OpenseaPendingRequest.php @@ -96,7 +96,7 @@ public function nft(Chain $chain, string $address, string $identifier): ?Opensea /** * @see https://docs.opensea.io/v1.0/reference/retrieving-collection-stats */ - public function getNftCollectionFloorPrice(string $collectionSlug): ?Web3NftCollectionFloorPrice + public function getCollectionFloorPrice(string $collectionSlug): ?Web3NftCollectionFloorPrice { try { $response = $this->makeCollectionStatsRequest($collectionSlug); diff --git a/app/Jobs/FetchCollectionBanner.php b/app/Jobs/FetchCollectionBanner.php index a89e1201d..27d86b0f5 100644 --- a/app/Jobs/FetchCollectionBanner.php +++ b/app/Jobs/FetchCollectionBanner.php @@ -40,7 +40,7 @@ public function handle(): void 'collection' => $this->collection->address, ]); - $banner = Mnemonic::getNftCollectionBanner( + $banner = Mnemonic::getCollectionBanner( chain: $this->collection->network->chain(), contractAddress: $this->collection->address ); diff --git a/app/Jobs/FetchCollectionFloorPrice.php b/app/Jobs/FetchCollectionFloorPrice.php index 14dde68de..51ebc7462 100644 --- a/app/Jobs/FetchCollectionFloorPrice.php +++ b/app/Jobs/FetchCollectionFloorPrice.php @@ -53,7 +53,7 @@ public function handle(): void $collection->save(); $web3DataProvider = $this->getWeb3DataProvider(); - $floorPrice = $web3DataProvider->getNftCollectionFloorPrice( + $floorPrice = $web3DataProvider->getCollectionFloorPrice( Chain::from($this->chainId), $this->address ); diff --git a/app/Jobs/FetchCollectionOwners.php b/app/Jobs/FetchCollectionOwners.php index b8dc999cd..75f10f6bf 100644 --- a/app/Jobs/FetchCollectionOwners.php +++ b/app/Jobs/FetchCollectionOwners.php @@ -39,7 +39,7 @@ public function handle(): void 'collection' => $this->collection->address, ]); - $owners = Mnemonic::getNftCollectionOwners( + $owners = Mnemonic::getCollectionOwners( chain: $this->collection->network->chain(), contractAddress: $this->collection->address ); diff --git a/app/Jobs/FetchCollectionTraits.php b/app/Jobs/FetchCollectionTraits.php index f866b4589..ed0632c97 100644 --- a/app/Jobs/FetchCollectionTraits.php +++ b/app/Jobs/FetchCollectionTraits.php @@ -41,7 +41,7 @@ public function handle(): void 'collection' => $this->collection->address, ]); - $traits = Mnemonic::getNftCollectionTraits( + $traits = Mnemonic::getCollectionTraits( chain: $this->collection->network->chain(), contractAddress: $this->collection->address ); diff --git a/app/Jobs/FetchCollectionVolume.php b/app/Jobs/FetchCollectionVolume.php index 1dbd8cb24..d8addf787 100644 --- a/app/Jobs/FetchCollectionVolume.php +++ b/app/Jobs/FetchCollectionVolume.php @@ -39,7 +39,7 @@ public function handle(): void 'collection' => $this->collection->address, ]); - $volume = Mnemonic::getNftCollectionVolume( + $volume = Mnemonic::getCollectionVolume( chain: $this->collection->network->chain(), contractAddress: $this->collection->address ); diff --git a/app/Services/Web3/Alchemy/AlchemyWeb3DataProvider.php b/app/Services/Web3/Alchemy/AlchemyWeb3DataProvider.php index d9c905df2..441616f65 100644 --- a/app/Services/Web3/Alchemy/AlchemyWeb3DataProvider.php +++ b/app/Services/Web3/Alchemy/AlchemyWeb3DataProvider.php @@ -82,10 +82,10 @@ public function getMiddleware(): array return []; } - public function getNftCollectionFloorPrice(Chain $chain, string $contractAddress): ?Web3NftCollectionFloorPrice + public function getCollectionFloorPrice(Chain $chain, string $contractAddress): ?Web3NftCollectionFloorPrice { return $this->fromCache( - static fn () => Alchemy::getNftCollectionFloorPrice($chain, $contractAddress), + static fn () => Alchemy::getCollectionFloorPrice($chain, $contractAddress), [$chain->name, $contractAddress] ); } diff --git a/app/Services/Web3/Fake/FakeWeb3DataProvider.php b/app/Services/Web3/Fake/FakeWeb3DataProvider.php index 321e80228..c1c31f92e 100644 --- a/app/Services/Web3/Fake/FakeWeb3DataProvider.php +++ b/app/Services/Web3/Fake/FakeWeb3DataProvider.php @@ -82,7 +82,7 @@ public function getWalletNfts(Wallet $wallet, Network $network, ?string $cursor name: $nft->name, description: null, extraAttributes: $nft['extra_attributes']->toArray(), - floorPrice: $this->getNftCollectionFloorPrice(Chain::ETH, $wallet->address), + floorPrice: $this->getCollectionFloorPrice(Chain::ETH, $wallet->address), traits: [], mintedBlock: random_int(1, 10000), mintedAt: now(), @@ -114,7 +114,7 @@ public function getBlockTimestamp(Network $network, int $blockNumber): Carbon return now(); } - public function getNftCollectionFloorPrice(Chain $chain, string $contractAddress): ?Web3NftCollectionFloorPrice + public function getCollectionFloorPrice(Chain $chain, string $contractAddress): ?Web3NftCollectionFloorPrice { return new Web3NftCollectionFloorPrice((string) (random_int(50, 1000) * 1e18), 'eth', Carbon::now()); } diff --git a/app/Services/Web3/Mnemonic/MnemonicWeb3DataProvider.php b/app/Services/Web3/Mnemonic/MnemonicWeb3DataProvider.php index c530efbaa..fe1c27472 100644 --- a/app/Services/Web3/Mnemonic/MnemonicWeb3DataProvider.php +++ b/app/Services/Web3/Mnemonic/MnemonicWeb3DataProvider.php @@ -49,10 +49,10 @@ public function getCollectionsNfts(CollectionModel $collection, ?string $startTo throw new NotImplementedException(); } - public function getNftCollectionFloorPrice(Chain $chain, string $contractAddress): ?Web3NftCollectionFloorPrice + public function getCollectionFloorPrice(Chain $chain, string $contractAddress): ?Web3NftCollectionFloorPrice { return $this->fromCache( - static fn () => Mnemonic::getNftCollectionFloorPrice($chain, $contractAddress), + static fn () => Mnemonic::getCollectionFloorPrice($chain, $contractAddress), [$chain->name, $contractAddress] ); } diff --git a/app/Services/Web3/Moralis/MoralisWeb3DataProvider.php b/app/Services/Web3/Moralis/MoralisWeb3DataProvider.php index f577258d2..f715dc31a 100644 --- a/app/Services/Web3/Moralis/MoralisWeb3DataProvider.php +++ b/app/Services/Web3/Moralis/MoralisWeb3DataProvider.php @@ -76,10 +76,10 @@ public function getMiddleware(): array return [new RateLimited(Service::Moralis)]; } - public function getNftCollectionFloorPrice(Chain $chain, string $contractAddress): ?Web3NftCollectionFloorPrice + public function getCollectionFloorPrice(Chain $chain, string $contractAddress): ?Web3NftCollectionFloorPrice { return $this->fromCache( - static fn () => Moralis::getNftCollectionFloorPrice($chain, $contractAddress), + static fn () => Moralis::getCollectionFloorPrice($chain, $contractAddress), [$chain->name, $contractAddress] ); } diff --git a/app/Services/Web3/Opensea/OpenseaWeb3DataProvider.php b/app/Services/Web3/Opensea/OpenseaWeb3DataProvider.php index 6755e3f4e..eb9369113 100644 --- a/app/Services/Web3/Opensea/OpenseaWeb3DataProvider.php +++ b/app/Services/Web3/Opensea/OpenseaWeb3DataProvider.php @@ -50,7 +50,7 @@ public function getCollectionsNfts(CollectionModel $collection, ?string $startTo throw new NotImplementedException(); } - public function getNftCollectionFloorPrice(Chain $chain, string $contractAddress): ?Web3NftCollectionFloorPrice + public function getCollectionFloorPrice(Chain $chain, string $contractAddress): ?Web3NftCollectionFloorPrice { return $this->fromCache( function () use ($contractAddress, $chain) { @@ -64,7 +64,7 @@ function () use ($contractAddress, $chain) { return null; } - return Opensea::getNftCollectionFloorPrice($openseaSlug); + return Opensea::getCollectionFloorPrice($openseaSlug); }, [$chain->name, $contractAddress] ); diff --git a/app/Support/Facades/Alchemy.php b/app/Support/Facades/Alchemy.php index b8189a267..cab3cc57b 100644 --- a/app/Support/Facades/Alchemy.php +++ b/app/Support/Facades/Alchemy.php @@ -29,7 +29,7 @@ * @method static Web3NftData parseNft(array $nft, int $networkId) * @method static string getNativeBalance(Wallet $wallet, Network $network) * @method static Carbon getBlockTimestamp(Network $network, int $blockNumber) - * @method static Web3NftCollectionFloorPrice | null getNftCollectionFloorPrice(Chain $chain, string $contractAddress) + * @method static Web3NftCollectionFloorPrice | null getCollectionFloorPrice(Chain $chain, string $contractAddress) * * @see App\Http\Client\Alchemy\AlchemyPendingRequest */ diff --git a/app/Support/Facades/Mnemonic.php b/app/Support/Facades/Mnemonic.php index 19bf036d0..8a6dc8061 100644 --- a/app/Support/Facades/Mnemonic.php +++ b/app/Support/Facades/Mnemonic.php @@ -17,11 +17,11 @@ /** * @method static string getNativeBalance(Wallet $wallet, Network $network) - * @method static Web3NftCollectionFloorPrice | null getNftCollectionFloorPrice(Chain $chain, string $contractAddress) - * @method static string | null getNftCollectionBanner(Chain $chain, string $contractAddress) - * @method static int | null getNftCollectionOwners(Chain $chain, string $contractAddress) - * @method static string | null getNftCollectionVolume(Chain $chain, string $contractAddress) - * @method static Collection getNftCollectionTraits(Chain $chain, string $contractAddress) + * @method static Web3NftCollectionFloorPrice | null getCollectionFloorPrice(Chain $chain, string $contractAddress) + * @method static string | null getCollectionBanner(Chain $chain, string $contractAddress) + * @method static int | null getCollectionOwners(Chain $chain, string $contractAddress) + * @method static string | null getCollectionVolume(Chain $chain, string $contractAddress) + * @method static Collection getCollectionTraits(Chain $chain, string $contractAddress) * @method static Collection getCollectionActivity(Chain $chain, string $contractAddress, int $limit, ?Carbon $from = null) * @method static Collection getBurnActivity(Chain $chain, string $contractAddress, int $limit, ?Carbon $from = null) * diff --git a/app/Support/Facades/Moralis.php b/app/Support/Facades/Moralis.php index b4b203f9b..48cd17c6c 100644 --- a/app/Support/Facades/Moralis.php +++ b/app/Support/Facades/Moralis.php @@ -23,7 +23,7 @@ * @method static string getNativeBalance(Wallet $wallet, Network $network) * @method static Collection getNativeBalances(array $walletAddresses, Network $network) * @method static Carbon getBlockTimestamp(Network $network, int $blockNumber) - * @method static Web3NftCollectionFloorPrice | null getNftCollectionFloorPrice(Chain $chain, string $contractAddress) + * @method static Web3NftCollectionFloorPrice | null getCollectionFloorPrice(Chain $chain, string $contractAddress) * * @see App\Http\Client\Moralis\MoralisPendingRequest */ diff --git a/app/Support/Facades/Opensea.php b/app/Support/Facades/Opensea.php index 30d59c2ff..268ea0ca6 100644 --- a/app/Support/Facades/Opensea.php +++ b/app/Support/Facades/Opensea.php @@ -13,7 +13,7 @@ /** * @method static string getCollectionTotalVolume(Collection $collection) - * @method static Web3NftCollectionFloorPrice | null getNftCollectionFloorPrice(string $collectionSlug) + * @method static Web3NftCollectionFloorPrice | null getCollectionFloorPrice(string $collectionSlug) * @method static OpenseaNftDetails | null nft(Chain $chain, string $address, string $identifier) * * @see App\Http\Client\Opensea\OpenseaPendingRequest diff --git a/config/dashbrd.php b/config/dashbrd.php index 6a78ed51d..b458ce8d3 100644 --- a/config/dashbrd.php +++ b/config/dashbrd.php @@ -81,19 +81,19 @@ 'cache_ttl' => [ 'alchemy' => [ 'getBlockTimestamp' => 60 * 60 * 24 * 10, // 10 days... Creation date for blocks will never change, so we can safely cache in a distant future... - 'getNftCollectionFloorPrice' => 60, // 1 minute + 'getCollectionFloorPrice' => 60, // 1 minute ], 'moralis' => [ 'getEnsDomain' => 60, // 1 minute 'getBlockTimestamp' => 60 * 60 * 24 * 10, // 10 days... Creation date for blocks will never change, so we can safely cache in a distant future... - 'getNftCollectionFloorPrice' => 60, // 1 minute + 'getCollectionFloorPrice' => 60, // 1 minute ], 'mnemonic' => [ 'getBlockTimestamp' => 60 * 60 * 24 * 10, // 10 days... Creation date for blocks will never change, so we can safely cache in a distant future... - 'getNftCollectionFloorPrice' => 60, // 1 minute + 'getCollectionFloorPrice' => 60, // 1 minute ], 'opensea' => [ - 'getNftCollectionFloorPrice' => 60, // 1 minute + 'getCollectionFloorPrice' => 60, // 1 minute ], 'coingecko' => [ 'getPriceHistory' => [ diff --git a/tests/App/Http/Client/Mnemonic/MnemonicPendingRequestTest.php b/tests/App/Http/Client/Mnemonic/MnemonicPendingRequestTest.php index 975fbb1f9..bdb9c93a6 100644 --- a/tests/App/Http/Client/Mnemonic/MnemonicPendingRequestTest.php +++ b/tests/App/Http/Client/Mnemonic/MnemonicPendingRequestTest.php @@ -36,7 +36,7 @@ 'network_id' => $network->id, ]); - Mnemonic::getNftCollectionFloorPrice(Chain::Polygon, $collection->address); + Mnemonic::getCollectionFloorPrice(Chain::Polygon, $collection->address); })->throws(ConnectionException::class); it('should throw on 401', function () { @@ -50,7 +50,7 @@ 'network_id' => $network->id, ]); - Mnemonic::getNftCollectionFloorPrice(Chain::Polygon, $collection->address); + Mnemonic::getCollectionFloorPrice(Chain::Polygon, $collection->address); })->throws(Exception::class); it('should throw a custom exception on rate limits', function () { @@ -66,7 +66,7 @@ 'network_id' => $network->id, ]); - Mnemonic::getNftCollectionFloorPrice(Chain::Polygon, $collection->address); + Mnemonic::getCollectionFloorPrice(Chain::Polygon, $collection->address); })->throws(RateLimitException::class); it('should not retry request on 400', function () { @@ -100,7 +100,7 @@ 'network_id' => $network->id, ]); - $data = Mnemonic::getNftCollectionOwners(Chain::Polygon, $collection->address); + $data = Mnemonic::getCollectionOwners(Chain::Polygon, $collection->address); expect($data)->toBe(789); }); @@ -121,7 +121,7 @@ 'network_id' => $network->id, ]); - $data = Mnemonic::getNftCollectionVolume(Chain::Polygon, $collection->address); + $data = Mnemonic::getCollectionVolume(Chain::Polygon, $collection->address); expect($data)->toBe('12300000000000000000'); }); @@ -138,7 +138,7 @@ 'network_id' => $network->id, ]); - $data = Mnemonic::getNftCollectionVolume(Chain::Polygon, $collection->address); + $data = Mnemonic::getCollectionVolume(Chain::Polygon, $collection->address); expect($data)->toBe(null); })->with([ @@ -171,7 +171,7 @@ 'network_id' => $network->id, ]); - $data = Mnemonic::getNftCollectionTraits(Chain::Polygon, $collection->address); + $data = Mnemonic::getCollectionTraits(Chain::Polygon, $collection->address); expect($data)->toHaveCount(25); }); @@ -198,7 +198,7 @@ 'network_id' => $network->id, ]); - $data = Mnemonic::getNftCollectionTraits(Chain::Polygon, $collection->address); + $data = Mnemonic::getCollectionTraits(Chain::Polygon, $collection->address); expect($data)->toHaveCount(500 + 500 + 0 + 0); }); @@ -219,7 +219,7 @@ 'network_id' => $network->id, ]); - $data = Mnemonic::getNftCollectionTraits(Chain::Polygon, $collection->address); + $data = Mnemonic::getCollectionTraits(Chain::Polygon, $collection->address); expect($data)->toHaveCount(1); }); @@ -240,7 +240,7 @@ 'network_id' => $network->id, ]); - $data = Mnemonic::getNftCollectionTraits(Chain::Polygon, $collection->address); + $data = Mnemonic::getCollectionTraits(Chain::Polygon, $collection->address); expect($data)->toHaveCount(1); }); @@ -472,5 +472,5 @@ 'network_id' => $network->id, ]); - expect(Mnemonic::getNftCollectionFloorPrice(Chain::ETH, $collection->address))->toBeNull(); + expect(Mnemonic::getCollectionFloorPrice(Chain::ETH, $collection->address))->toBeNull(); }); diff --git a/tests/App/Http/Client/Moralis/MoralisPendingRequestTest.php b/tests/App/Http/Client/Moralis/MoralisPendingRequestTest.php index af990e26b..99a19343c 100644 --- a/tests/App/Http/Client/Moralis/MoralisPendingRequestTest.php +++ b/tests/App/Http/Client/Moralis/MoralisPendingRequestTest.php @@ -67,7 +67,7 @@ 'https://deep-index.moralis.io/api/v2/nft/*/lowestprice?*' => Http::response(null, 404), ]); - expect(Moralis::getNftCollectionFloorPrice(Chain::ETH, '1'))->toBeNull(); + expect(Moralis::getCollectionFloorPrice(Chain::ETH, '1'))->toBeNull(); }); it('should throw any non-404 error when getting nft floor price', function () { @@ -75,5 +75,5 @@ 'https://deep-index.moralis.io/api/v2/nft/*/lowestprice?*' => Http::response(null, 400), ]); - expect(fn () => Moralis::getNftCollectionFloorPrice(Chain::ETH, '1'))->toThrow('400 Bad Request'); + expect(fn () => Moralis::getCollectionFloorPrice(Chain::ETH, '1'))->toThrow('400 Bad Request'); }); diff --git a/tests/App/Http/Client/Opensea/OpenseaPendingRequestTest.php b/tests/App/Http/Client/Opensea/OpenseaPendingRequestTest.php index a237d632d..46a09f5ac 100644 --- a/tests/App/Http/Client/Opensea/OpenseaPendingRequestTest.php +++ b/tests/App/Http/Client/Opensea/OpenseaPendingRequestTest.php @@ -18,7 +18,7 @@ $collectionSlug = 'doodles-official'; - Opensea::getNftCollectionFloorPrice($collectionSlug); + Opensea::getCollectionFloorPrice($collectionSlug); })->throws(ConnectionException::class); it('should throw a custom exception when rate limited', function () { @@ -28,7 +28,7 @@ $collectionSlug = 'doodles-official'; - Opensea::getNftCollectionFloorPrice($collectionSlug); + Opensea::getCollectionFloorPrice($collectionSlug); })->throws(RateLimitException::class); it('should throw a custom exception on client error', function () { @@ -38,7 +38,7 @@ $collectionSlug = 'doodles-official'; - Opensea::getNftCollectionFloorPrice($collectionSlug); + Opensea::getCollectionFloorPrice($collectionSlug); })->throws(ClientException::class); it('can get floor price for the collection', function () { @@ -48,7 +48,7 @@ $collectionSlug = 'doodles-official'; - $data = Opensea::getNftCollectionFloorPrice($collectionSlug); + $data = Opensea::getCollectionFloorPrice($collectionSlug); expect($data)->toBeInstanceOf(Web3NftCollectionFloorPrice::class); }); diff --git a/tests/App/Services/Web3/Alchemy/AlchemyWeb3DataProviderTest.php b/tests/App/Services/Web3/Alchemy/AlchemyWeb3DataProviderTest.php index d16e156eb..a3de80ea4 100644 --- a/tests/App/Services/Web3/Alchemy/AlchemyWeb3DataProviderTest.php +++ b/tests/App/Services/Web3/Alchemy/AlchemyWeb3DataProviderTest.php @@ -246,7 +246,7 @@ ]); $provider = new AlchemyWeb3DataProvider(); - expect($provider->getNftCollectionFloorPrice(Chain::ETH, 'asdf'))->toEqual(new Web3NftCollectionFloorPrice( + expect($provider->getCollectionFloorPrice(Chain::ETH, 'asdf'))->toEqual(new Web3NftCollectionFloorPrice( '1235000000000000000', 'eth', Carbon::parse('2023-03-30T04:08:09.791Z'), @@ -259,7 +259,7 @@ ]); $provider = new AlchemyWeb3DataProvider(); - expect($provider->getNftCollectionFloorPrice(Chain::ETH, 'asdf'))->toEqual(new Web3NftCollectionFloorPrice( + expect($provider->getCollectionFloorPrice(Chain::ETH, 'asdf'))->toEqual(new Web3NftCollectionFloorPrice( '1247200000000000000', 'eth', Carbon::parse('2023-03-30T03:59:09.707Z'), @@ -275,7 +275,7 @@ ]); $provider = new AlchemyWeb3DataProvider(); - expect($provider->getNftCollectionFloorPrice(Chain::ETH, 'asdf'))->toBeNull(); + expect($provider->getCollectionFloorPrice(Chain::ETH, 'asdf'))->toBeNull(); }); it('returns null for unsupported network when calling nft floor price', function () { @@ -290,7 +290,7 @@ collect(Chain::cases()) ->filter(fn ($case) => $case !== Chain::ETH) ->each( - fn ($case) => expect($provider->getNftCollectionFloorPrice($case, 'asdf')) + fn ($case) => expect($provider->getCollectionFloorPrice($case, 'asdf')) ->toBeNull() ); }); diff --git a/tests/App/Services/Web3/Mnemonic/MnemonicWeb3DataProviderTest.php b/tests/App/Services/Web3/Mnemonic/MnemonicWeb3DataProviderTest.php index 20b713e56..9d55b900d 100644 --- a/tests/App/Services/Web3/Mnemonic/MnemonicWeb3DataProviderTest.php +++ b/tests/App/Services/Web3/Mnemonic/MnemonicWeb3DataProviderTest.php @@ -21,7 +21,7 @@ $collection = Collection::factory()->create(); $provider = new MnemonicWeb3DataProvider(); - $floorPrice = $provider->getNftCollectionFloorPrice(Chain::Polygon, $collection->address); + $floorPrice = $provider->getCollectionFloorPrice(Chain::Polygon, $collection->address); expect($floorPrice->price)->toBe('10267792581881993') ->and($floorPrice->currency)->toBe('matic'); }); @@ -45,7 +45,7 @@ ]); $provider = new MnemonicWeb3DataProvider(); - $floorPrice = $provider->getNftCollectionFloorPrice(Chain::Polygon, $collection->address); + $floorPrice = $provider->getCollectionFloorPrice(Chain::Polygon, $collection->address); expect($floorPrice->price)->toBe('6000000000000') ->and($floorPrice->currency)->toBe('weth'); }); @@ -62,7 +62,7 @@ ]); $provider = new MnemonicWeb3DataProvider(); - expect($provider->getNftCollectionFloorPrice(Chain::Polygon, $collection->address)) + expect($provider->getCollectionFloorPrice(Chain::Polygon, $collection->address)) ->toBeNull(); }); diff --git a/tests/App/Services/Web3/Moralis/MoralisWeb3DataProviderTest.php b/tests/App/Services/Web3/Moralis/MoralisWeb3DataProviderTest.php index 7538a658d..1c9930210 100644 --- a/tests/App/Services/Web3/Moralis/MoralisWeb3DataProviderTest.php +++ b/tests/App/Services/Web3/Moralis/MoralisWeb3DataProviderTest.php @@ -61,7 +61,7 @@ $provider = new MoralisWeb3DataProvider(); - expect($provider->getNftCollectionFloorPrice(Chain::ETH, ''))->toEqual(new Web3NftCollectionFloorPrice( + expect($provider->getCollectionFloorPrice(Chain::ETH, ''))->toEqual(new Web3NftCollectionFloorPrice( '1000000000000000', 'eth', Carbon::parse('2021-06-04T16:00:15'), @@ -74,7 +74,7 @@ ]); $provider = new MoralisWeb3DataProvider(); - expect($provider->getNftCollectionFloorPrice(Chain::ETH, 'asdf'))->toBeNull(); + expect($provider->getCollectionFloorPrice(Chain::ETH, 'asdf'))->toBeNull(); }); it('can get native balance for a wallet', function () { diff --git a/tests/App/Services/Web3/Opensea/OpenseaWeb3DataProviderTest.php b/tests/App/Services/Web3/Opensea/OpenseaWeb3DataProviderTest.php index 3c547a580..c5f1ec5e8 100644 --- a/tests/App/Services/Web3/Opensea/OpenseaWeb3DataProviderTest.php +++ b/tests/App/Services/Web3/Opensea/OpenseaWeb3DataProviderTest.php @@ -12,7 +12,7 @@ use App\Services\Web3\Opensea\OpenseaWeb3DataProvider; use App\Support\Facades\Opensea; -it('should getNftCollectionFloorPrice if no open sea slug', function () { +it('should getCollectionFloorPrice if no open sea slug', function () { Collection::factory()->create([ 'address' => '0x23581767a106ae21c074b2276D25e5C3e136a68b', 'network_id' => Network::where('chain_id', Chain::ETH->value)->first()->id, @@ -22,12 +22,12 @@ $provider = new OpenseaWeb3DataProvider(); - $data = $provider->getNftCollectionFloorPrice(Chain::ETH, $contractAddress); + $data = $provider->getCollectionFloorPrice(Chain::ETH, $contractAddress); expect($data)->toBeNull(); }); -it('should getNftCollectionFloorPrice ', function () { +it('should getCollectionFloorPrice ', function () { Collection::factory()->create([ 'address' => '0x23581767a106ae21c074b2276D25e5C3e136a68b', 'network_id' => Network::where('chain_id', Chain::ETH->value)->first()->id, @@ -42,7 +42,7 @@ $provider = new OpenseaWeb3DataProvider(); - $data = $provider->getNftCollectionFloorPrice(Chain::ETH, $contractAddress); + $data = $provider->getCollectionFloorPrice(Chain::ETH, $contractAddress); expect($data)->toBeInstanceOf(Web3NftCollectionFloorPrice::class); }); diff --git a/tests/App/Support/Facades/MnemonicTest.php b/tests/App/Support/Facades/MnemonicTest.php index eba6af19a..cf4d223b1 100644 --- a/tests/App/Support/Facades/MnemonicTest.php +++ b/tests/App/Support/Facades/MnemonicTest.php @@ -20,7 +20,7 @@ $collection = Collection::factory()->create([ 'network_id' => $network->id, ]); - $data = Mnemonic::getNftCollectionFloorPrice(Chain::Polygon, $collection->address); + $data = Mnemonic::getCollectionFloorPrice(Chain::Polygon, $collection->address); expect($data)->toBeInstanceOf(Web3NftCollectionFloorPrice::class); });