Skip to content

Commit 58699fd

Browse files
committed
-Renamed NFTImageType to NFTOffChainMetaType in OASIS.API.Core.
- Fixed a bug in SaveDNA in OASISDNAManager in OASIS.API.Core. - Upgraded NFTManager in OASIS.API.ONODE.Core to allow minting for both ERC721 and ERC1155 NFT standards at the same time. - Updated GenerateNFTRequestAsync in STARCLI.Lib to now ask what NFTStandard they wish to mint for as well as where the meta data/image should be stored.
1 parent 6668f3b commit 58699fd

8 files changed

Lines changed: 247 additions & 201 deletions

File tree

NextGenSoftware.OASIS.API.Core/Enums/NFTImageType.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
namespace NextGenSoftware.OASIS.API.Core.Enums
33
{
4-
public enum NFTImageType
4+
public enum NFTOffChainMetaType
55
{
66
OASIS,
77
IPFS,

NextGenSoftware.OASIS.API.Core/Interfaces/NFT/Requests/IMintNFTTransactionRequest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public interface IMintNFTTransactionRequest
2525
public EnumValue<ProviderType> OffChainProvider { get; set; }
2626
public EnumValue<ProviderType> OnChainProvider { get; set; }
2727
public NFTStandardType NFTStandardType { get; set; }
28-
public NFTImageType NFTImageType { get; set; }
28+
public NFTOffChainMetaType NFTOffChainMetaType { get; set; }
2929
//public bool SaveIPFSImageOnTheOASIS { get; set; }
3030
//public string JsonUrl { get; set; }
3131
}

NextGenSoftware.OASIS.API.Core/Objects/NFT/Requests/MintAndPlaceGeoSpatialNFTRequest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ public class MintAndPlaceGeoSpatialNFTRequest : PlaceGeoSpatialNFTRequestBase, I
2828
public EnumValue<ProviderType> OffChainProvider { get; set; }
2929
public EnumValue<ProviderType> OnChainProvider { get; set; }
3030
public NFTStandardType NFTStandardType { get; set; }
31-
public NFTImageType NFTImageType { get; set; }
31+
public NFTOffChainMetaType NFTOffChainMetaType { get; set; }
3232
}
3333
}

NextGenSoftware.OASIS.API.Core/Objects/NFT/Requests/MintNFTTransactionRequest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ public class MintNFTTransactionRequest : IMintNFTTransactionRequest
2626
public EnumValue<ProviderType> OffChainProvider { get; set; }
2727
public EnumValue<ProviderType> OnChainProvider { get; set; }
2828
public NFTStandardType NFTStandardType { get; set; }
29-
public NFTImageType NFTImageType { get; set; }
29+
public NFTOffChainMetaType NFTOffChainMetaType { get; set; }
3030
}
3131
}

NextGenSoftware.OASIS.API.DNA/OASISDNAManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public static OASISResult<bool> SaveDNA(string OASISDNAPath, OASISDNA OASISDNA)
102102
if (string.IsNullOrEmpty(OASISDNAPath))
103103
OASISErrorHandling.HandleError(ref result, $"{errorMessage}OASISDNAPath cannot be null.");
104104

105-
else if (File.Exists(OASISDNAPath))
105+
else if (!File.Exists(OASISDNAPath))
106106
OASISErrorHandling.HandleError(ref result, $"{errorMessage}The OASISDNAPath ({OASISDNAPath}) is not valid. Please make sure the OASISDNAPath is valid and that it points to the OASISDNA.json file.");
107107

108108
else

NextGenSoftware.OASIS.API.ONODE.Core/Managers/NFTManager.cs

Lines changed: 228 additions & 193 deletions
Large diffs are not rendered by default.

NextGenSoftware.OASIS.STAR.CLI.Lib/STARCLI.cs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2277,6 +2277,8 @@ private static async Task<IMintNFTTransactionRequest> GenerateNFTRequestAsync()
22772277
string desc = CLIEngine.GetValidInput("What is the NFT's description?");
22782278
string memotext = CLIEngine.GetValidInput("What is the NFT's memotext? (optional)");
22792279
ProviderType offChainProvider = ProviderType.None;
2280+
NFTOffChainMetaType NFTOffchainMetaType = NFTOffChainMetaType.OASIS;
2281+
NFTStandardType NFTStandardType = NFTStandardType.Both;
22802282
Dictionary<string, object> metaData = new Dictionary<string, object>();
22812283

22822284
if (CLIEngine.GetConfirmation("Do you want to upload a local image on your device to represent the NFT or input a URI to an online image? (Press Y for local or N for online)"))
@@ -2316,10 +2318,19 @@ private static async Task<IMintNFTTransactionRequest> GenerateNFTRequestAsync()
23162318

23172319
if (!storeMetaDataOnChain)
23182320
{
2319-
object offChainProviderObj = CLIEngine.GetValidInputForEnum("What off-chain provider do you wish to store the metadata on? (NOTE: It will automatically auto-replicate to other providers across the OASIS through the auto-replication feature in the OASIS HyperDrive)", typeof(ProviderType));
2320-
offChainProvider = (ProviderType)offChainProviderObj;
2321+
object offChainMetaDataTypeObj = CLIEngine.GetValidInputForEnum("How do you wish to store the offchain meta data/image? IPFS, OASIS or Pinata? If you choose OASIS, it will automatically auto-replicate to other providers across the OASIS through the auto-replication feature in the OASIS HyperDrive. If you choose OASIS and then IPFSOASIS for the next question for the OASIS Provider it will store it on IPFS via The OASIS and then benefit from the OASIS HyperDrive feature to provide more reliable service and up-time etc. If you choose IPFS or Pinata for this question then it will store it directly on IPFS/Pinata without any additional benefits of The OASIS.", typeof(NFTOffChainMetaType));
2322+
NFTOffchainMetaType = (NFTOffChainMetaType)offChainMetaDataTypeObj;
2323+
2324+
if (NFTOffchainMetaType == NFTOffChainMetaType.OASIS)
2325+
{
2326+
object offChainProviderObj = CLIEngine.GetValidInputForEnum("What OASIS off-chain provider do you wish to store the metadata on? (NOTE: It will automatically auto-replicate to other providers across the OASIS through the auto-replication feature in the OASIS HyperDrive)", typeof(ProviderType));
2327+
offChainProvider = (ProviderType)offChainProviderObj;
2328+
}
23212329
}
23222330

2331+
object nftStandardObj = CLIEngine.GetValidInputForEnum("What NFT ERC standard do you wish to support? ERC721, ERC1155 or both?", typeof(NFTStandardType));
2332+
NFTStandardType = (NFTStandardType)nftStandardObj;
2333+
23232334
if (CLIEngine.GetConfirmation("Do you wish to add any metadata to this NFT?"))
23242335
{
23252336
metaData = AddMetaDataToNFT(metaData);

NextGenSoftware.OASIS.STAR.CLI/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System;
22
using System.Linq;
3-
using System.Drawing
3+
using System.Drawing;
44
using System.Threading.Tasks;
55
using System.Collections.Generic;
66
using MongoDB.Driver;

0 commit comments

Comments
 (0)