From 1fef99ea54410a9de16ff3327e49525a0a03db98 Mon Sep 17 00:00:00 2001 From: John Date: Wed, 9 Mar 2022 14:39:15 +1000 Subject: [PATCH] fix issue with some cids not decoding --- LoopMintSharp/Program.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LoopMintSharp/Program.cs b/LoopMintSharp/Program.cs index cc035ff..329babe 100644 --- a/LoopMintSharp/Program.cs +++ b/LoopMintSharp/Program.cs @@ -9,7 +9,7 @@ //Changes these variables to suit string loopringApiKey = Environment.GetEnvironmentVariable("LOOPRINGAPIKEY", EnvironmentVariableTarget.Machine);//you can either set an environmental variable or input it here directly. You can export this from your account using loopring.io string loopringPrivateKey = Environment.GetEnvironmentVariable("LOOPRINGPRIVATEKEY", EnvironmentVariableTarget.Machine); //you can either set an environmental variable or input it here directly. You can export this from your account using loopring.io -var ipfsCid = "QmdjmxTW6fvS9Pn9oqKU1Kb3ryxhmPB4ScCHfZrUP7LHhS"; //the ipfs cid of your metadata.json +var ipfsCid = "QmVQ4jnoHAMrRycy4JMrndjrLVXDzPn6d7tjabZmCX5eXy"; //the ipfs cid of your metadata.json var minterAddress = "0x36Cd6b3b9329c04df55d55D41C257a5fdD387ACd"; //your loopring address var accountId = 40940; //your loopring account id var nftType = 0; //nfttype 0 = ERC1155, shouldn't need to change this unless you want ERC721 which is 1 @@ -46,7 +46,7 @@ #region Generate Eddsa Signature //Generate the nft id here -Multihash multiHash = Multihash.Parse(ipfsCid); +Multihash multiHash = Multihash.Parse(ipfsCid, Multiformats.Base.MultibaseEncoding.Base58Btc); string multiHashString = multiHash.ToString(); var ipfsCidBigInteger = Utils.ParseHexUnsigned(multiHashString); var nftId = "0x" + ipfsCidBigInteger.ToString("x").Substring(4);