Skip to content

Commit

Permalink
Remove Opensea and add Sepolia testnet link
Browse files Browse the repository at this point in the history
  • Loading branch information
Hathoriel committed Sep 9, 2022
1 parent daddc6a commit 4b0af90
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 52 deletions.
7 changes: 1 addition & 6 deletions packages/nft-maker/src/Hooks/PublicHooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,7 @@ private function getNftDetail($chain, $txId, $testnet) {
$html = "Transction Hash: $txLink<br>";

if (array_key_exists("tokenId", $nftDetail)) {
if (in_array($chain, ['MATIC', 'ETH']) && array_key_exists("openSeaUrl", $nftDetail)) {
$openSeaLink = BlockchainLink::formatLink($nftDetail['tokenId'] . " (OpenSea) ", $nftDetail['openSeaUrl']);
$html .= "Token Id: " . $openSeaLink . " - once transaction is confirmed link should be valid<br>";
} else {
$html .= "Token Id: " . $nftDetail['tokenId'] . "<br>";
}
$html .= "Token Id: " . $nftDetail['tokenId'] . "<br>";
}

$html .= "Contract Address: " . $nftDetail['contractAddress'] . "<br><br>";
Expand Down
4 changes: 1 addition & 3 deletions packages/nft-maker/src/Services/NftService.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ private function formatMintedNft($order, $nft, $addTokenId = true) {
if ($addTokenId) {
$nftDetail = $this->getNftDetail($nft->chain, $nft->transaction_id, $nft->testnet);

if (array_key_exists("openSeaUrl", $nftDetail) && array_key_exists("tokenId", $nftDetail)) {
$formatted['openSeaUrl'] = $nftDetail['openSeaUrl'];
if (array_key_exists("tokenId", $nftDetail)) {
$formatted['tokenId'] = $nftDetail['tokenId'];
}
$formatted['contractAddress'] = $nftDetail['contractAddress'];
Expand Down Expand Up @@ -115,7 +114,6 @@ public function getNftDetail($chain, $txId, $testnet) {
}
return [
'contractAddress' => Constants::CONTRACT_ADDRESS[$isTestnet][$chain],
'openSeaUrl' => BlockchainLink::openSea($tokenId, $chain, $testnet),
'tokenId' => $tokenId
];
}
Expand Down
9 changes: 0 additions & 9 deletions packages/nft-maker/src/Utils/BlockchainLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,6 @@ public static function tx($txHash, $chain, $testnet = true) {
return $prefixes[$chain] . 'tx/' . $txHash;
}

public static function openSea($tokenId, $chain, $testnet = true) {
$isTestnet = $testnet ? 'TESTNET' : 'MAINNET';
$openSeaUrl = Constants::OPEN_SEA_BASE_URL[$isTestnet];
if ($chain === 'ETH') {
return $openSeaUrl . "assets/" . Constants::CONTRACT_ADDRESS[$isTestnet][$chain] . "/" . $tokenId;
}
return $openSeaUrl . "assets/" . Constants::OPEN_SEA_CHAIN_MAPPING[$isTestnet][$chain] . "/" . Constants::CONTRACT_ADDRESS[$isTestnet][$chain] . "/" . $tokenId;
}

public static function formatLink($text, $linkUrl) {
return "<a href='$linkUrl' target='_blank'>$text</a>";
}
Expand Down
16 changes: 1 addition & 15 deletions packages/nft-maker/src/Utils/Constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,9 @@ class Constants
]
];

const OPEN_SEA_BASE_URL = [
'TESTNET' => 'https://testnets.opensea.io/',
'MAINNET' => 'https://opensea.io/'
];

const OPEN_SEA_CHAIN_MAPPING = [
'TESTNET' => [
'MATIC' => 'mumbai'
],
'MAINNET' => [
'MATIC' => 'matic',
]
];

const EXPLORER = [
'TESTNET' => [
'ETH' => "https://ropsten.etherscan.io/",
'ETH' => "https://sepolia.etherscan.io/",
'CELO' => "https://alfajores-blockscout.celo-testnet.org/",
'BSC' => "https://testnet.bscscan.com/",
'MATIC' => "https://mumbai.polygonscan.com/",
Expand Down
2 changes: 1 addition & 1 deletion plugins/tatum/src/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Description: NFT Maker is the easiest and fastest free plugin to work with NFTs without any blockchain development experience.
* Author: Lukas Kotol
* Author URI: https://t.me/LukasKotol
* Version: 2.0.30
* Version: 2.0.31
* Text Domain: tatum
* Domain Path: /languages
* License: MIT
Expand Down
16 changes: 1 addition & 15 deletions plugins/tatum/src/public/ts/components/NftsOverview/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ const NftItem = ({ nft, lazy }: { nft: Nft; lazy: boolean }) => {
width: "100%",
align: "center"
};
console.log(nft);
return (
<Card.Grid hoverable={false} style={gridStyle}>
<div className="nftItem">
Expand All @@ -42,20 +41,7 @@ const NftItem = ({ nft, lazy }: { nft: Nft; lazy: boolean }) => {
</a>
</div>
)}
{nft.tokenId && (
<div>
Token ID:{" "}
{nft.openSeaUrl ? (
<span>
<a target="_blank" rel="noreferrer" href={nft.openSeaUrl}>
{nft.tokenId} (OpenSea) - wait till confirmation
</a>
</span>
) : (
nft.tokenId
)}
</div>
)}
{nft.tokenId && <div>Token ID:{nft.tokenId}</div>}

{nft.transactionId || nft.errorCause ? (
<DateFormatted label="Sold" date={nft?.sold?.date} />
Expand Down
1 change: 0 additions & 1 deletion plugins/tatum/src/public/ts/models/nft.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export interface Nft {
transactionLink: string | null;
errorCause: string | null;
imageUrl: string | null;
openSeaUrl: string | null;
tokenId: string | null;
chain: string;
productId: string;
Expand Down
7 changes: 5 additions & 2 deletions plugins/tatum/wordpress.org/README.wporg.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
=== NFT Maker ===
Contributors: lukaskotol
Donate link: lukas.kotol@gmail.com
Tags: nft, erc721, ethereum, celo, bsc, polygon, harmony, mint, tatum, blockchain, smart contract, opensea
Tags: nft, erc721, ethereum, celo, bsc, polygon, harmony, mint, tatum, blockchain, smart contract
Requires at least: 5.5
Requires PHP: 7.0
Tested up to: 5.8.2
Stable tag: 2.0.30
Stable tag: 2.0.31
License: MIT
License URI: https://opensource.org/licenses/MIT

Expand Down Expand Up @@ -208,6 +208,9 @@ Fixed API key submit validation
= 2.0.30 =
Fixed activator lazy nft testnet field & strip HTML and special chars from IPFS metadata

= 2.0.31 =
Removed open sea link and changed eth testnet link to sepolia

== Upgrade Notice ==

= 1.0.0 =
Expand Down

0 comments on commit 4b0af90

Please sign in to comment.