Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

granadanet configuration example? #447

Open
dadaphl opened this issue Oct 21, 2021 · 1 comment
Open

granadanet configuration example? #447

dadaphl opened this issue Oct 21, 2021 · 1 comment

Comments

@dadaphl
Copy link

dadaphl commented Oct 21, 2021

Hello, I would like to use open minter with granadanet. Unfortunatelly it doesnt seem to work because I can not configure nftFaucet and marketplace for granada due to the lack of knowledge if they exist. Could somebody please post a sample config for granada? so far i have

{
	"network": "granadanet",
	"rpc": "https://granadanet.smartpy.io",
	"bcd": {
		"api": "https://api.better-call.dev",
		"gui": "https://better-call.dev"
	},
	"tzkt": {
		"api": "https://granadanet.api.tez.ie"
	},
	"contracts": {
		"nftFaucet": "???",
		"marketplace": {
			"fixedPrice": {
				"tez": "???"
			}
		}
	},
	"ipfsApi": "https://minter-api.tqhosted.com",
	"ipfsGateway": "https://tqtezos.mypinata.cloud"
}

@dadaphl
Copy link
Author

dadaphl commented Nov 2, 2021

I got it running with the following patch

diff --git a/config/testnet.json b/config/testnet.json
index ced5bd8..758f990 100644
--- a/config/testnet.json
+++ b/config/testnet.json
@@ -1,21 +1,21 @@
 {
-       "network": "florencenet",
-       "rpc": "https://api.tez.ie/rpc/florencenet",
-       "bcd": {
-               "api": "https://api.better-call.dev",
-               "gui": "https://better-call.dev"
-       },
-       "tzkt": {
-               "api": "https://api.florencenet.tzkt.io"
-       },
-       "contracts": {
-               "nftFaucet": "KT1DzPX2SHnviWURFUfD5NQ9FcHQVmYFuPYu",
-               "marketplace": {
-                       "fixedPrice": {
-                               "tez": "KT1X9YgJbwhGgPcJqtvcyn6ceGeUZ7DwPsDm"
-                       }
-               }
-       },
-       "ipfsApi": "https://minter-api.tqhosted.com",
-       "ipfsGateway": "https://tqtezos.mypinata.cloud"
-}
\ No newline at end of file
+ "network": "granadanet",
+ "rpc": "https://granadanet.smartpy.io",
+ "bcd": {
+  "api": "https://api.better-call.dev",
+  "gui": "https://better-call.dev"
+ },
+ "tzkt": {
+  "api": "https://api.granadanet.tzkt.io"
+ },
+ "contracts": {
+  "nftFaucet": "KT1Hk8noapGVAU5TXA4eKPNiYaQAnBbVp4Yw",
+  "marketplace": {
+   "fixedPrice": {
+    "tez": "KT1X9YgJbwhGgPcJqtvcyn6ceGeUZ7DwPsDm"
+   }
+  }
+ },
+ "ipfsApi": "https://minter-api.tqhosted.com",
+ "ipfsGateway": "https://tqtezos.mypinata.cloud"
+}
diff --git a/src/lib/nfts/queries.ts b/src/lib/nfts/queries.ts
index 29a0fb5..80534ea 100644
--- a/src/lib/nfts/queries.ts
+++ b/src/lib/nfts/queries.ts
@@ -127,8 +127,8 @@ export async function getContractNfts(
   const ledger = await getLedgerBigMap(system.tzkt, address);
   const tokens = await getTokenMetadataBigMap(system.tzkt, address);
   const mktAddress = system.config.contracts.marketplace.fixedPrice.tez;
-  const tokenSales = await getFixedPriceSalesBigMap(system.tzkt, mktAddress);
-  const activeSales = tokenSales.filter(sale => sale.active);
+  // const tokenSales = await getFixedPriceSalesBigMap(system.tzkt, mktAddress);
+  // const activeSales = tokenSales.filter(sale => sale.active);

   // Sort by token id - descending
   const tokensSorted = [...tokens].sort((a,b)=>- (Number.parseInt(a.value.token_id, 10) - Number.parseInt(b.value.token_id, 10)));
@@ -146,24 +146,24 @@ export async function getContractNfts(
         );
         const metadata = { ...decodedInfo, ...resolvedInfo.metadata };

-        const saleData = activeSales.find(
-          v =>
-            v.value.sale_data.sale_token.fa2_address === address &&
-            v.value.sale_data.sale_token.token_id === tokenId
-        );
-
-        const sale = saleData && {
-          id: saleData.id,
-          seller: saleData.value.seller,
-          price: Number.parseInt(saleData.value.sale_data.price, 10) / 1000000,
-          mutez: Number.parseInt(saleData.value.sale_data.price, 10),
-          saleToken: {
-            address: saleData.value.sale_data.sale_token.fa2_address,
-            tokenId: Number.parseInt(saleData.value.sale_data.sale_token.token_id)
-          },
-          saleId: saleData.value.isLegacy ? 0 : Number.parseInt(saleData.key),
-          type: saleData.value.isLegacy ? 'fixedPriceLegacy' : 'fixedPrice'
-        };
+        // const saleData = activeSales.find(
+        //   v =>
+        //     v.value.sale_data.sale_token.fa2_address === address &&
+        //     v.value.sale_data.sale_token.token_id === tokenId
+        // );
+
+        // const sale = saleData && {
+        //   id: saleData.id,
+        //   seller: saleData.value.seller,
+        //   price: Number.parseInt(saleData.value.sale_data.price, 10) / 1000000,
+        //   mutez: Number.parseInt(saleData.value.sale_data.price, 10),
+        //   saleToken: {
+        //     address: saleData.value.sale_data.sale_token.fa2_address,
+        //     tokenId: Number.parseInt(saleData.value.sale_data.sale_token.token_id)
+        //   },
+        //   saleId: saleData.value.isLegacy ? 0 : Number.parseInt(saleData.key),
+        //   type: saleData.value.isLegacy ? 'fixedPriceLegacy' : 'fixedPrice'
+        // };

         return {
           id: parseInt(tokenId, 10),
@@ -171,8 +171,8 @@ export async function getContractNfts(
           title: metadata.name,
           description: metadata.description,
           artifactUri: metadata.artifactUri,
-          metadata: metadata,
-          sale
+          metadata: metadata
+          // sale
         };
       }
     )

save it as granada-hack.patch
and then git apply granada-hack.patch

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant