diff --git a/Packages/io.chainsafe.web3-unity.hyperplay/Runtime/Scripts/HyperPlayWebGLProvider.cs b/Packages/io.chainsafe.web3-unity.hyperplay/Runtime/Scripts/HyperPlayWebGLProvider.cs
index 8e2ed3ed7..8abc568f3 100644
--- a/Packages/io.chainsafe.web3-unity.hyperplay/Runtime/Scripts/HyperPlayWebGLProvider.cs
+++ b/Packages/io.chainsafe.web3-unity.hyperplay/Runtime/Scripts/HyperPlayWebGLProvider.cs
@@ -20,7 +20,7 @@ public class HyperPlayWebGLProvider : HyperPlayProvider
private readonly IChainConfig _chainConfig;
private readonly ChainRegistryProvider _chainRegistryProvider;
private readonly EthereumWindowController _ethereumController;
-
+
///
/// Initializes a new instance of the class.
///
@@ -37,7 +37,7 @@ public HyperPlayWebGLProvider(IHyperPlayConfig config, IHyperPlayData data, Data
_dataStorage = dataStorage;
_chainConfig = chainConfig;
_chainRegistryProvider = chainRegistryProvider;
-
+
// Initialize Unity controller.
_ethereumController = Object.FindObjectOfType();
@@ -58,7 +58,7 @@ public HyperPlayWebGLProvider(IHyperPlayConfig config, IHyperPlayData data, Data
public override async Task Connect()
{
string account = await _ethereumController.Connect(_chainConfig, _chainRegistryProvider);
-
+
// Saved account exists.
if (_data.RememberSession)
{
@@ -87,7 +87,7 @@ public override async Task Connect()
public override async Task Perform(string method, params object[] parameters)
{
var response = await _ethereumController.Request(method, parameters);
-
+
return response.Result.ToObject();
}
}
diff --git a/Packages/io.chainsafe.web3-unity.marketplace/Editor/CscImporter.cs b/Packages/io.chainsafe.web3-unity.marketplace/Editor/CscImporter.cs
index 2a33642e6..4e6f6babf 100644
--- a/Packages/io.chainsafe.web3-unity.marketplace/Editor/CscImporter.cs
+++ b/Packages/io.chainsafe.web3-unity.marketplace/Editor/CscImporter.cs
@@ -11,7 +11,7 @@ public class CscRspChecker
static CscRspChecker()
{
-
+
CheckAndCreateCscRsp();
}
diff --git a/Packages/io.chainsafe.web3-unity.marketplace/Runtime/Scripts/Marketplace/Marketplace.cs b/Packages/io.chainsafe.web3-unity.marketplace/Runtime/Scripts/Marketplace/Marketplace.cs
index d07df65f5..f054eb2ff 100644
--- a/Packages/io.chainsafe.web3-unity.marketplace/Runtime/Scripts/Marketplace/Marketplace.cs
+++ b/Packages/io.chainsafe.web3-unity.marketplace/Runtime/Scripts/Marketplace/Marketplace.cs
@@ -57,7 +57,7 @@ public class Marketplace
var response = await CSServer.GetData(path);
return response;
}
-
+
///
/// Gets all tokens in a project.
/// Path: https://api.gaming.chainsafe.io/v1/projects/{projectID}/tokens
@@ -124,7 +124,7 @@ public class Marketplace
var response = await CSServer.GetData(path);
return response;
}
-
+
///
/// Creates a 721 collection
/// /// Path https://api.gaming.chainsafe.io/v1/projects/8524f420-ecd1-4cfd-a651-706ade97cac7/collections
@@ -136,9 +136,9 @@ public class Marketplace
/// Contract send data object
public static async Task Create721Collection(string _bearerToken, string _name, string _description, bool _isMintingPublic)
{
- var logoImageData = await UploadPlatforms.GetImageData();
- var bannerImageData = await UploadPlatforms.GetImageData();
- var formData = new List
+ var logoImageData = await UploadPlatforms.GetImageData();
+ var bannerImageData = await UploadPlatforms.GetImageData();
+ var formData = new List
{
new MultipartFormDataSection("name", _name),
new MultipartFormDataSection("description", _description),
@@ -151,12 +151,12 @@ public static async Task Create721Collection(string _bearerT
new MultipartFormDataSection("contractAddress", ChainSafeContracts.MarketplaceContracts[Web3Accessor.Web3.ChainConfig.ChainId]),
new MultipartFormDataSection("type", "erc721")
};
- var path = "/collections";
- var collectionResponse = await CSServer.CreateData(_bearerToken, path, formData);
- var collectionData = JsonConvert.DeserializeObject(collectionResponse);
- var method = "create721Collection";
- object[] args =
- {
+ var path = "/collections";
+ var collectionResponse = await CSServer.CreateData(_bearerToken, path, formData);
+ var collectionData = JsonConvert.DeserializeObject(collectionResponse);
+ var method = "create721Collection";
+ object[] args =
+ {
Web3Accessor.Web3.ProjectConfig.ProjectId,
collectionData.id,
_name,
@@ -164,11 +164,11 @@ public static async Task Create721Collection(string _bearerT
collectionData.banner,
_isMintingPublic
};
- var contract = Web3Accessor.Web3.ContractBuilder.Build(ABI.MarketplaceFactory, ChainSafeContracts.MarketplaceContracts[Web3Accessor.Web3.ChainConfig.ChainId]);
- var data = await contract.SendWithReceipt(method, args);
- return data.receipt;
+ var contract = Web3Accessor.Web3.ContractBuilder.Build(ABI.MarketplaceFactory, ChainSafeContracts.MarketplaceContracts[Web3Accessor.Web3.ChainConfig.ChainId]);
+ var data = await contract.SendWithReceipt(method, args);
+ return data.receipt;
}
-
+
///
/// Creates a 1155 collection
/// Path https://api.gaming.chainsafe.io/v1/projects/8524f420-ecd1-4cfd-a651-706ade97cac7/collections/
@@ -209,7 +209,7 @@ public static async Task Create1155Collection(string _bearer
_isMintingPublic
};
var contract = Web3Accessor.Web3.ContractBuilder.Build(ABI.MarketplaceFactory, ChainSafeContracts.MarketplaceContracts[Web3Accessor.Web3.ChainConfig.ChainId]);
- var data = await contract.SendWithReceipt(method, args);
+ var data = await contract.SendWithReceipt(method, args);
return data.receipt;
}
catch (Web3Exception e)
@@ -218,7 +218,7 @@ public static async Task Create1155Collection(string _bearer
throw;
}
}
-
+
///
/// /// Mints a 721 collection nft to the collection
///
@@ -236,7 +236,7 @@ public static async Task Mint721CollectionNft(string _collec
_uri
};
var contract = Web3Accessor.Web3.ContractBuilder.Build(ABI.GeneralErc721, _collectionContract);
- var data = await contract.SendWithReceipt(method, args);
+ var data = await contract.SendWithReceipt(method, args);
return data.receipt;
}
catch (Web3Exception e)
@@ -245,7 +245,7 @@ public static async Task Mint721CollectionNft(string _collec
throw;
}
}
-
+
///
/// Mints a 1155 collection nft to the collection
///
@@ -265,9 +265,9 @@ public static async Task Mint1155CollectionNft(string _colle
_uri,
amount
};
-
+
var contract = Web3Accessor.Web3.ContractBuilder.Build(ABI.GeneralErc1155, _collectionContract);
- var data = await contract.SendWithReceipt(method, args);
+ var data = await contract.SendWithReceipt(method, args);
return data.receipt;
}
catch (Web3Exception e)
@@ -276,7 +276,7 @@ public static async Task Mint1155CollectionNft(string _colle
throw;
}
}
-
+
///
/// Deletes a collection that isn't on chain yet by ID
/// Path https://api.gaming.chainsafe.io/v1/projects/8524f420-ecd1-4cfd-a651-706ade97cac7/collections/e38e9465-fb9b-4316-8d1d-c77e81b50d6a
@@ -290,7 +290,7 @@ public static async Task DeleteCollection(string _bearerToken, string _c
var response = await CSServer.DeleteData(_bearerToken, path);
return response;
}
-
+
///
/// Creates a marketplace
/// Path: https://api.gaming.chainsafe.io/v1/projects/8524f420-ecd1-4cfd-a651-706ade97cac7/marketplaces
@@ -324,7 +324,7 @@ public static async Task CreateMarketplace(string _bearerTok
_whitelisting
};
var contract = Web3Accessor.Web3.ContractBuilder.Build(ABI.MarketplaceFactory, ChainSafeContracts.MarketplaceContracts[Web3Accessor.Web3.ChainConfig.ChainId]);
- var data = await contract.SendWithReceipt(method, args);
+ var data = await contract.SendWithReceipt(method, args);
return data.receipt;
}
catch (Web3Exception e)
@@ -333,7 +333,7 @@ public static async Task CreateMarketplace(string _bearerTok
throw;
}
}
-
+
///
/// Deletes a marketplace that isn't on chain yet by ID
/// Path: https://api.gaming.chainsafe.io/v1/projects/8524f420-ecd1-4cfd-a651-706ade97cac7/marketplaces/{marketplaceId}
@@ -347,7 +347,7 @@ public static async Task DeleteMarketplace(string _bearerToken, string _
var response = await CSServer.DeleteData(_bearerToken, path);
return response;
}
-
+
///
/// Approves the marketplace to list 721 Nfts
///
@@ -367,7 +367,7 @@ public static async Task SetApprovalMarketplace(string _nftC
};
var abi = _type == "721" ? Token.ABI.GeneralErc721 : Token.ABI.GeneralErc1155;
var contract = Web3Accessor.Web3.ContractBuilder.Build(abi, _nftContract);
- var data = await contract.SendWithReceipt(method, args);
+ var data = await contract.SendWithReceipt(method, args);
return data.receipt;
}
catch (Web3Exception e)
@@ -376,7 +376,7 @@ public static async Task SetApprovalMarketplace(string _nftC
throw;
}
}
-
+
///
/// Purchases NFT from the marketplace
///
@@ -399,7 +399,7 @@ public static async Task PurchaseNft(string _marketplaceCont
Value = new HexBigInteger(BigInteger.Parse(_amountToSend).ToString("X"))
};
var contract = Web3Accessor.Web3.ContractBuilder.Build(ABI.Marketplace, _marketplaceContract);
- var data = await contract.SendWithReceipt(method, args, tx);
+ var data = await contract.SendWithReceipt(method, args, tx);
return data.receipt;
}
catch (Web3Exception e)
@@ -408,7 +408,7 @@ public static async Task PurchaseNft(string _marketplaceCont
throw;
}
}
-
+
///
/// Lists Nfts to the marketplace
///
@@ -433,7 +433,7 @@ public static async Task ListNftsToMarketplace(string _marke
deadline
};
var contract = Web3Accessor.Web3.ContractBuilder.Build(ABI.Marketplace, _marketplaceContract);
- var data = await contract.SendWithReceipt(method, args);
+ var data = await contract.SendWithReceipt(method, args);
return data.receipt;
}
catch (Web3Exception e)
@@ -460,7 +460,7 @@ public static void PrintObject(object obj)
}
#endregion
-
+
#endregion
}
}
\ No newline at end of file
diff --git a/Packages/io.chainsafe.web3-unity.ramp/Runtime/Scripts/RampExchangerUniversal.cs b/Packages/io.chainsafe.web3-unity.ramp/Runtime/Scripts/RampExchangerUniversal.cs
index 7c072424d..851157f6e 100644
--- a/Packages/io.chainsafe.web3-unity.ramp/Runtime/Scripts/RampExchangerUniversal.cs
+++ b/Packages/io.chainsafe.web3-unity.ramp/Runtime/Scripts/RampExchangerUniversal.cs
@@ -11,12 +11,12 @@ public class RampExchangerUniversal : IRampExchanger, ILifecycleParticipant
private readonly IRampExchangerConfig config;
private readonly ISigner signer;
private readonly IAnalyticsClient analyticsClient;
-
+
public event Action OnRampPurchaseCreated;
public event Action OffRampSaleCreated;
private IRampExchanger platformImplementation;
-
+
public RampExchangerUniversal(IRampExchangerConfig config, ISigner signer, IAnalyticsClient analyticsClient)
{
diff --git a/Packages/io.chainsafe.web3-unity.web3auth/Runtime/IWeb3AuthTransactionHandler.cs b/Packages/io.chainsafe.web3-unity.web3auth/Runtime/IWeb3AuthTransactionHandler.cs
index 38d9460a1..7b4ec9286 100644
--- a/Packages/io.chainsafe.web3-unity.web3auth/Runtime/IWeb3AuthTransactionHandler.cs
+++ b/Packages/io.chainsafe.web3-unity.web3auth/Runtime/IWeb3AuthTransactionHandler.cs
@@ -9,14 +9,14 @@ public interface IWeb3AuthTransactionHandler
public event Action OnTransactionConfirmed;
- public event Action OnTransactionApproved;
-
+ public event Action OnTransactionApproved;
+
public event Action OnTransactionDeclined;
-
+
public void RequestTransaction(TransactionRequested transactionRequested);
public void ConfirmTransaction(TransactionConfirmed transactionConfirmed);
-
+
public void ApproveTransaction(TransactionApproved transactionApproved);
public void DeclineTransaction(TransactionDeclined transactionDeclined);
diff --git a/Packages/io.chainsafe.web3-unity.web3auth/Runtime/Plugins/Web3AuthSDK/Web3Auth.cs b/Packages/io.chainsafe.web3-unity.web3auth/Runtime/Plugins/Web3AuthSDK/Web3Auth.cs
index 68e7b205f..4fb593eed 100644
--- a/Packages/io.chainsafe.web3-unity.web3auth/Runtime/Plugins/Web3AuthSDK/Web3Auth.cs
+++ b/Packages/io.chainsafe.web3-unity.web3auth/Runtime/Plugins/Web3AuthSDK/Web3Auth.cs
@@ -376,7 +376,7 @@ private void authorizeSession(string newSessionId)
sessionId = newSessionId;
// Debug.Log("sessionId during authorizeSession in else part =>" + sessionId);
}
-
+
if (!string.IsNullOrEmpty(sessionId))
{
var pubKey = KeyStoreManagerUtils.getPubKey(sessionId);
@@ -391,12 +391,12 @@ private void authorizeSession(string newSessionId)
shareMetadata.ephemPublicKey,
shareMetadata.iv
);
-
+
var encryptedShareBytes = AES256CBC.toByteArray(new BigInteger(shareMetadata.ciphertext, 16));
var share = aes256cbc.decrypt(encryptedShareBytes, shareMetadata.mac);
var tempJson = JsonConvert.DeserializeObject(System.Text.Encoding.UTF8.GetString(share));
-
+
this.web3AuthResponse = JsonConvert.DeserializeObject(tempJson.ToString());
if (this.web3AuthResponse != null)
diff --git a/Packages/io.chainsafe.web3-unity.web3auth/Runtime/WalletGUI/Scripts/Web3AuthEventManager.cs b/Packages/io.chainsafe.web3-unity.web3auth/Runtime/WalletGUI/Scripts/Web3AuthEventManager.cs
index 852a823d6..0c6755323 100644
--- a/Packages/io.chainsafe.web3-unity.web3auth/Runtime/WalletGUI/Scripts/Web3AuthEventManager.cs
+++ b/Packages/io.chainsafe.web3-unity.web3auth/Runtime/WalletGUI/Scripts/Web3AuthEventManager.cs
@@ -10,19 +10,19 @@ namespace ChainSafe.GamingSdk.Web3Auth
public static class Web3AuthEventManager
{
#region Events
-
+
public static event EventHandler ConfigureTxManager;
-
+
public static event EventHandler ConfigureGuiManager;
-
+
public static event Action SetTokens;
-
+
public static event Action ToggleWallet;
-
+
#endregion
#region Methods
-
+
///
/// Configures TX Manager.
///
@@ -31,7 +31,7 @@ public static void RaiseConfigureTxManager(TxManagerConfigEventArgs args)
{
ConfigureTxManager?.Invoke(null, args);
}
-
+
///
/// Configure GUI manager.
///
@@ -40,7 +40,7 @@ public static void RaiseConfigureGuiManager(GuiManagerConfigEventArgs args)
{
ConfigureGuiManager?.Invoke(null, args);
}
-
+
///
/// Invokes set tokens.
///
@@ -48,7 +48,7 @@ public static void RaiseSetTokens()
{
SetTokens?.Invoke();
}
-
+
///
/// Invokes toggle wallet.
///
@@ -56,12 +56,12 @@ public static void RaiseToggleWallet()
{
ToggleWallet?.Invoke();
}
-
+
#endregion
}
#region Configuration Classes
-
+
///
/// Configuration class for the Web3Auth Tx Manager.
///
@@ -71,7 +71,7 @@ public class TxManagerConfigEventArgs : EventArgs
public bool AutoPopUpWalletOnTx { get; private set; }
public bool AutoConfirmTransactions { get; private set; }
-
+
public TMP_FontAsset DisplayFont { get; private set; }
public Color SecondaryTextColour { get; private set; }
@@ -87,34 +87,34 @@ public TxManagerConfigEventArgs(bool autoPopUpWalletOnTx, bool autoConfirmTransa
DisplayFont = displayFont;
SecondaryTextColour = secondaryTextColour;
}
-
+
#endregion
}
-
+
///
/// Configuration class for the Web3Auth GUI manager.
///
public class GuiManagerConfigEventArgs : EventArgs
{
#region Properties
-
+
public bool DisplayWalletIcon { get; private set; }
public Sprite WalletIcon { get; private set; }
public Sprite WalletLogo { get; private set; }
-
+
#endregion
#region Methods
-
+
public GuiManagerConfigEventArgs(bool displayWalletIcon, Sprite walletIcon, Sprite walletLogo)
{
DisplayWalletIcon = displayWalletIcon;
WalletIcon = walletIcon;
WalletLogo = walletLogo;
}
-
+
#endregion
}
-
+
#endregion
}
\ No newline at end of file
diff --git a/Packages/io.chainsafe.web3-unity.web3auth/Runtime/WalletGUI/Scripts/Web3AuthWalletGUI.cs b/Packages/io.chainsafe.web3-unity.web3auth/Runtime/WalletGUI/Scripts/Web3AuthWalletGUI.cs
index 8e17f9508..7060df749 100644
--- a/Packages/io.chainsafe.web3-unity.web3auth/Runtime/WalletGUI/Scripts/Web3AuthWalletGUI.cs
+++ b/Packages/io.chainsafe.web3-unity.web3auth/Runtime/WalletGUI/Scripts/Web3AuthWalletGUI.cs
@@ -12,7 +12,7 @@
public class Web3AuthWalletGUI : MonoBehaviour
{
#region Fields
-
+
[SerializeField] private Text autoConfirmTxLabel;
[SerializeField] private GameObject walletIconContainer;
[SerializeField] private List primaryBackgroundObjects;
@@ -21,7 +21,7 @@ public class Web3AuthWalletGUI : MonoBehaviour
[SerializeField] private List secondaryTextObjects;
[SerializeField] private List displayLineObjects;
[SerializeField] private List borderButtonObjects;
-
+
#endregion
#region Properties
@@ -37,11 +37,11 @@ public class Web3AuthWalletGUI : MonoBehaviour
private Color SecondaryTextColour { get; set; }
private Color BorderButtonColour { get; set; }
private TMP_FontAsset DisplayFont { get; set; }
-
+
#endregion
#region Methods
-
+
///
/// Method to initialize parameters after prefab creation
///
@@ -62,7 +62,7 @@ public void Initialize(Web3AuthWalletConfig config)
BorderButtonColour = config.BorderButtonColour;
SetCustomConfig();
}
-
+
///
/// Sets custom config from the login scene.
///
@@ -75,7 +75,7 @@ private void SetCustomConfig()
walletIconContainer.SetActive(DisplayWalletIcon);
SetCustomColours();
}
-
+
///
/// Sets custom colours for menu and text objects.
///
@@ -114,7 +114,7 @@ private void SetCustomColours()
autoConfirmTxLabel.color = SecondaryTextColour;
SetButtonsAndLines();
}
-
+
///
/// Sets border buttons & menu lines.
///
@@ -142,11 +142,11 @@ private void SetButtonsAndLines()
}
}
}
-
+
#endregion
-
+
#region ConfigClass
-
+
[Serializable]
public class Web3AuthWalletConfig
{
@@ -162,6 +162,6 @@ public class Web3AuthWalletConfig
public Color SecondaryTextColour;
public Color BorderButtonColour;
}
-
+
#endregion
}
diff --git a/Packages/io.chainsafe.web3-unity.web3auth/Runtime/WalletGUI/Scripts/Web3AuthWalletGUITokenManager.cs b/Packages/io.chainsafe.web3-unity.web3auth/Runtime/WalletGUI/Scripts/Web3AuthWalletGUITokenManager.cs
index 10409751a..0d5b3a81d 100644
--- a/Packages/io.chainsafe.web3-unity.web3auth/Runtime/WalletGUI/Scripts/Web3AuthWalletGUITokenManager.cs
+++ b/Packages/io.chainsafe.web3-unity.web3auth/Runtime/WalletGUI/Scripts/Web3AuthWalletGUITokenManager.cs
@@ -18,7 +18,7 @@
public class Web3AuthWalletGUITokenManager : MonoBehaviour
{
#region Fields
-
+
[SerializeField] private GameObject customTokenPlaceHolder;
[SerializeField] private GameObject customTokenDisplay;
[SerializeField] private GameObject transferTokensContainer;
@@ -42,11 +42,11 @@ public class Web3AuthWalletGUITokenManager : MonoBehaviour
private bool isSymbolTaskRunning;
private string lastCheckedAddress;
private string customTokenContract;
-
+
#endregion
#region Methods
-
+
///
/// Initializes objects.
///
@@ -90,7 +90,7 @@ private async void SetTokens()
nativeTokenAmountText.text = ethBalance.ToString("0.#########");
SetTokenDropdownOptions();
}
-
+
///
/// Toggles the add token menu.
///
@@ -128,7 +128,7 @@ private async void GetSymbol()
isSymbolTaskRunning = false;
}
}
-
+
///
/// Adds a custom token to the wallet.
///
@@ -144,7 +144,7 @@ private void AddToken()
customTokenSymbolInput.text = string.Empty;
SetTokens();
}
-
+
///
/// Sets the dropdown options in the token transfer menu.
///
@@ -157,7 +157,7 @@ private void SetTokenDropdownOptions()
selectedTokenToTransfer.options.Add(customTokenOption);
selectedTokenToTransfer.RefreshShownValue();
}
-
+
///
/// Toggles the transfer tokens menu.
///
@@ -165,7 +165,7 @@ private void ToggleTransferTokensMenuButton()
{
transferTokensContainer.SetActive(!transferTokensContainer.activeSelf);
}
-
+
///
/// Transfers tokens to a wallet address.
///
@@ -191,7 +191,7 @@ private async void TransferTokens()
throw new Web3Exception("Transfer failed, please check that the token contract exists & you have enough tokens to complete the transfer");
}
}
-
+
///
/// Subscribes to events.
///
@@ -199,7 +199,7 @@ private void OnEnable()
{
Web3AuthEventManager.SetTokens += SetTokens;
}
-
+
///
/// Unsubscribes from events.
///
@@ -215,6 +215,6 @@ private void Update()
{
GetSymbol();
}
-
+
#endregion
}
diff --git a/Packages/io.chainsafe.web3-unity.web3auth/Runtime/WalletGUI/Scripts/Web3AuthWalletGUITxManager.cs b/Packages/io.chainsafe.web3-unity.web3auth/Runtime/WalletGUI/Scripts/Web3AuthWalletGUITxManager.cs
index 2920cdfa0..ca7adebaf 100644
--- a/Packages/io.chainsafe.web3-unity.web3auth/Runtime/WalletGUI/Scripts/Web3AuthWalletGUITxManager.cs
+++ b/Packages/io.chainsafe.web3-unity.web3auth/Runtime/WalletGUI/Scripts/Web3AuthWalletGUITxManager.cs
@@ -14,7 +14,7 @@
public class Web3AuthWalletGUITxManager : MonoBehaviour
{
#region Fields
-
+
[SerializeField] private ScrollRect txScrollRect;
[SerializeField] private TextMeshProUGUI incomingTxActionText;
[SerializeField] private TextMeshProUGUI incomingTxHashText;
@@ -35,20 +35,20 @@ public class Web3AuthWalletGUITxManager : MonoBehaviour
private bool _processingTransaction;
private IWeb3AuthTransactionHandler _transactionHandler;
private Queue _transactionQueue = new Queue();
-
+
#endregion
#region Properties
-
+
private bool AutoPopUpWalletOnTx { get; set; }
private bool AutoConfirmTransactions { get; set; }
private TMP_FontAsset DisplayFont { get; set; }
private Color SecondaryTextColour { get; set; }
-
+
#endregion
#region Methods
-
+
///
/// Initializes objects.
///
@@ -61,7 +61,7 @@ private void Awake()
_transactionHandler = Web3Accessor.Web3.ServiceProvider.GetService();
}
-
+
///
/// Populates the incoming transaction display.
///
@@ -75,23 +75,23 @@ private void OnTransactionRequested(TransactionRequested transactionRequested)
}
_processingTransaction = true;
-
+
PromptTransactionRequest();
}
-
+
///
/// Prompts transaction request display.
///
private void PromptTransactionRequest()
{
TransactionRequested transactionRequested = _transactionQueue.Peek();
-
+
incomingTxNotification.SetActive(true);
if (AutoConfirmTransactions)
{
AcceptRequest();
-
+
return;
}
@@ -105,7 +105,7 @@ private void PromptTransactionRequest()
incomingTxHashText.text = transactionRequested.Transaction.Data;
incomingTxActionText.text = transactionRequested.Transaction.Value?.ToString() ?? "Sign Request";
}
-
+
///
/// Accepts an incoming transaction request.
///
@@ -116,7 +116,7 @@ private void AcceptRequest()
_transactionHandler.ApproveTransaction(new TransactionApproved(transactionRequested.Id));
ResetTransactionDisplay();
}
-
+
///
/// Rejects an incoming transaction request.
///
@@ -126,21 +126,21 @@ private void RejectRequest()
_transactionHandler.DeclineTransaction(new TransactionDeclined(transactionRequested.Id));
ResetTransactionDisplay();
}
-
+
///
/// Gets transaction data.
///
private void OnTransactionConfirmed(TransactionConfirmed transactionConfirmed)
{
var response = transactionConfirmed.Transaction;
-
+
var txHash = response.Hash;
var txTime = DateTime.Now.ToString("hh:mm tt");
var txAmount = response.Value?.ToString() ?? "0";
var txAction = response.Value != null ? response.Value.ToString() : "Sign Request";
AddTransactionToHistory(txTime, txAction, txAmount, txHash);
}
-
+
///
/// Adds a transaction to the history area.
///
@@ -170,7 +170,7 @@ private void AddTransactionToHistory(string time, string action, string amount,
txObjectNumber++;
txScrollRect.verticalNormalizedPosition = 0;
}
-
+
///
/// Resets the transaction display.
///
@@ -192,7 +192,7 @@ private void ResetTransactionDisplay()
_processingTransaction = false;
}
}
-
+
///
/// Updates the transaction history prefab text.
///
@@ -221,7 +221,7 @@ private void UpdateTransactionHistory(int txObjectIndex, string txNumber, string
txHistoryObj.GetComponent
[JsonProperty(PropertyName = "marketplace_id")]
- public string MarketPlaceId { get; set; }
+ public string MarketplaceId { get; set; }
///
/// Gets or sets token.
@@ -86,18 +86,6 @@ public class MarketplaceItem
///
/// Gets the status of marketplace items.
///
- public MarketplaceItemStatus Status
- {
- get
- {
- switch (this.StatusRaw)
- {
- case "sold": return MarketplaceItemStatus.Sold;
- case "listed": return MarketplaceItemStatus.Listed;
- case "canceled": return MarketplaceItemStatus.Canceled;
- default: throw new ArgumentOutOfRangeException(nameof(this.StatusRaw));
- }
- }
- }
+ public MarketplaceItemStatus Status => MarketplaceItemStatusExtensions.FromString(this.StatusRaw);
}
}
\ No newline at end of file
diff --git a/src/ChainSafe.Gaming.Marketplace/Dto/MarketplaceItemStatus.cs b/src/ChainSafe.Gaming.Marketplace/Dto/MarketplaceItemStatus.cs
index dbd61ac21..c854f7196 100644
--- a/src/ChainSafe.Gaming.Marketplace/Dto/MarketplaceItemStatus.cs
+++ b/src/ChainSafe.Gaming.Marketplace/Dto/MarketplaceItemStatus.cs
@@ -1,8 +1,4 @@
-//
-// Copyright (c) PlaceholderCompany. All rights reserved.
-//
-
-namespace ChainSafe.Gaming.Marketplace
+namespace ChainSafe.Gaming.Marketplace
{
///
/// Enum of marketplace item status.
diff --git a/src/ChainSafe.Gaming.Marketplace/Dto/MarketplaceItemStatusExtensions.cs b/src/ChainSafe.Gaming.Marketplace/Dto/MarketplaceItemStatusExtensions.cs
new file mode 100644
index 000000000..b3200e904
--- /dev/null
+++ b/src/ChainSafe.Gaming.Marketplace/Dto/MarketplaceItemStatusExtensions.cs
@@ -0,0 +1,29 @@
+namespace ChainSafe.Gaming.Marketplace
+{
+ using System;
+
+ public static class MarketplaceItemStatusExtensions
+ {
+ public static MarketplaceItemStatus FromString(string rawValue)
+ {
+ return rawValue switch
+ {
+ "sold" => MarketplaceItemStatus.Sold,
+ "listed" => MarketplaceItemStatus.Listed,
+ "canceled" => MarketplaceItemStatus.Canceled,
+ _ => throw new ArgumentOutOfRangeException(nameof(rawValue))
+ };
+ }
+
+ public static string ToRequestParameter(this MarketplaceItemStatus value)
+ {
+ return value switch
+ {
+ MarketplaceItemStatus.Sold => "sold",
+ MarketplaceItemStatus.Listed => "listed",
+ MarketplaceItemStatus.Canceled => "canceled",
+ _ => throw new ArgumentOutOfRangeException(nameof(value))
+ };
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/ChainSafe.Gaming.Marketplace/Dto/MarketplaceSortOrder.cs b/src/ChainSafe.Gaming.Marketplace/Dto/MarketplaceSortOrder.cs
new file mode 100644
index 000000000..9da382757
--- /dev/null
+++ b/src/ChainSafe.Gaming.Marketplace/Dto/MarketplaceSortOrder.cs
@@ -0,0 +1,8 @@
+namespace ChainSafe.Gaming.Marketplace.Dto
+{
+ public enum MarketplaceSortOrder
+ {
+ Ascending,
+ Descending,
+ }
+}
\ No newline at end of file
diff --git a/src/ChainSafe.Gaming.Marketplace/Dto/MarketplaceSortOrderExtensions.cs b/src/ChainSafe.Gaming.Marketplace/Dto/MarketplaceSortOrderExtensions.cs
new file mode 100644
index 000000000..1cf6f1f39
--- /dev/null
+++ b/src/ChainSafe.Gaming.Marketplace/Dto/MarketplaceSortOrderExtensions.cs
@@ -0,0 +1,20 @@
+namespace ChainSafe.Gaming.Marketplace.Dto
+{
+ using System;
+
+ public static class MarketplaceSortOrderExtensions
+ {
+ public static string ToRequestParameter(this MarketplaceSortOrder type)
+ {
+ switch (type)
+ {
+ case MarketplaceSortOrder.Ascending:
+ return "asc";
+ case MarketplaceSortOrder.Descending:
+ return "desc";
+ default:
+ throw new ArgumentOutOfRangeException(nameof(type), type, null);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/ChainSafe.Gaming.Marketplace/Dto/MarketplaceSortType.cs b/src/ChainSafe.Gaming.Marketplace/Dto/MarketplaceSortType.cs
new file mode 100644
index 000000000..7fc76fdf7
--- /dev/null
+++ b/src/ChainSafe.Gaming.Marketplace/Dto/MarketplaceSortType.cs
@@ -0,0 +1,9 @@
+namespace ChainSafe.Gaming.Marketplace.Dto
+{
+ public enum MarketplaceSortType
+ {
+ None,
+ ListedAt,
+ Price,
+ }
+}
\ No newline at end of file
diff --git a/src/ChainSafe.Gaming.Marketplace/Dto/MarketplaceSortTypeExtensions.cs b/src/ChainSafe.Gaming.Marketplace/Dto/MarketplaceSortTypeExtensions.cs
new file mode 100644
index 000000000..6ab21126c
--- /dev/null
+++ b/src/ChainSafe.Gaming.Marketplace/Dto/MarketplaceSortTypeExtensions.cs
@@ -0,0 +1,20 @@
+namespace ChainSafe.Gaming.Marketplace.Dto
+{
+ using System;
+
+ public static class MarketplaceSortTypeExtensions
+ {
+ public static string ToRequestParameter(this MarketplaceSortType type)
+ {
+ switch (type)
+ {
+ case MarketplaceSortType.ListedAt:
+ return "listed_at";
+ case MarketplaceSortType.Price:
+ return "price";
+ default:
+ throw new ArgumentOutOfRangeException(nameof(type), type, null);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/ChainSafe.Gaming.Marketplace/MarketplaceClient.cs b/src/ChainSafe.Gaming.Marketplace/MarketplaceClient.cs
index de127706b..e535c460e 100644
--- a/src/ChainSafe.Gaming.Marketplace/MarketplaceClient.cs
+++ b/src/ChainSafe.Gaming.Marketplace/MarketplaceClient.cs
@@ -11,12 +11,13 @@ namespace ChainSafe.Gaming.Marketplace
using System.Web;
using ChainSafe.Gaming.Evm.Contracts;
using ChainSafe.Gaming.Evm.Transactions;
+ using ChainSafe.Gaming.Marketplace.Dto;
using ChainSafe.Gaming.Web3;
using ChainSafe.Gaming.Web3.Environment;
using Nethereum.Hex.HexTypes;
/*
- * todo add method wrappers for "Get Marketplace Items" and "Get Item" also
+ * todo add method wrappers for "Get Item" also
* https://docs.gaming.chainsafe.io/marketplace-api/docs/marketplaceapi/#tag/Items/operation/getItem
*/
@@ -27,9 +28,9 @@ public class MarketplaceClient
{
private readonly IMarketplaceConfig config;
private readonly IHttpClient httpClient;
- private IProjectConfig projectConfig;
- private IChainConfig chainConfig;
- private IContractBuilder contractBuilder;
+ private readonly IProjectConfig projectConfig;
+ private readonly IChainConfig chainConfig;
+ private readonly IContractBuilder contractBuilder;
///
/// Initializes a new instance of the class.
@@ -63,21 +64,39 @@ public MarketplaceClient(IHttpClient httpClient, IProjectConfig projectConfig, I
}
///
- /// Loads marketplace page via previous page.
+ /// Loads first marketplace page or a next one.
///
- /// Previous page.
+ /// Last loaded page.
/// A representing the asynchronous operation.
- public Task LoadPage(MarketplacePage? prevPage = null)
+ public Task LoadPage(
+ MarketplacePage? currentPage = null,
+ string? marketplaceId = null,
+ string? filterTokenContract = null,
+ MarketplaceItemStatus? filterStatus = null,
+ MarketplaceSortType sortType = MarketplaceSortType.None,
+ MarketplaceSortOrder? sortOrder = null)
{
- return this.LoadPage(prevPage?.Cursor ?? null);
+ return this.LoadPage(
+ currentPage?.Cursor ?? null,
+ marketplaceId,
+ filterTokenContract,
+ filterStatus,
+ sortType,
+ sortOrder);
}
///
- /// Loads marketplace page via cursor.
+ /// Loads first marketplace page or a next one, via cursor.
///
/// Cursor.
/// Loaded page.
- public async Task LoadPage(string? cursor)
+ public async Task LoadPage(
+ string? cursor,
+ string? marketplaceId = null,
+ string? filterTokenContract = null,
+ MarketplaceItemStatus? filterStatus = null,
+ MarketplaceSortType sortType = MarketplaceSortType.None,
+ MarketplaceSortOrder? sortOrder = null)
{
var endpoint = this.config.EndpointOverride;
if (endpoint.EndsWith('/'))
@@ -86,11 +105,35 @@ public async Task LoadPage(string? cursor)
}
var projectId = this.projectConfig.ProjectId;
- var baseUri = $"{endpoint}/v1/projects/{projectId}/items";
- var queryParameters = new Dictionary
+ var baseUri = marketplaceId == null
+ ? $"{endpoint}/v1/projects/{projectId}/items"
+ : $"{endpoint}/v1/projects/{projectId}/marketplaces/{marketplaceId}/items";
+ var queryParameters = new Dictionary();
+
+ if (marketplaceId == null)
+ {
+ queryParameters["chainId"] = this.chainConfig.ChainId;
+ }
+
+ if (filterTokenContract != null)
+ {
+ queryParameters["tokenContractAddress"] = filterTokenContract;
+ }
+
+ if (filterStatus != null)
+ {
+ queryParameters["status"] = filterStatus.Value.ToRequestParameter();
+ }
+
+ if (sortType != MarketplaceSortType.None)
+ {
+ queryParameters["sortBy"] = sortType.ToRequestParameter();
+ }
+
+ if (sortOrder != null)
{
- ["chainId"] = this.chainConfig.ChainId,
- };
+ queryParameters["sortOrder"] = sortOrder.Value.ToRequestParameter();
+ }
if (!string.IsNullOrEmpty(cursor))
{
@@ -110,9 +153,9 @@ public async Task LoadPage(string? cursor)
/// Purchase a marketplace item with string datatypes, falls back into the overloaded call with big int data types.
///
/// The marketplace contract.
- /// Item id inteifier.
+ /// Item id identifier.
/// Price of the item.
- /// Result of the purchase funtion.
+ /// A representing the asynchronous operation.
public Task Purchase(string marketplaceContract, string itemId, string itemPrice)
{
var itemIdInt = BigInteger.Parse(itemId);
@@ -124,9 +167,9 @@ public Task Purchase(string marketplaceContract, string itemId, string itemPrice
/// Purchase a marketplace item with big integer datatypes.
///
/// The marketplace contract.
- /// Item id inteifier.
+ /// Item id identifier.
/// Price of the item.
- /// A contract purchase.
+ /// A representing the asynchronous operation.
public async Task Purchase(string marketplaceContract, BigInteger itemId, BigInteger itemPrice)
{
var contract = this.contractBuilder.Build(this.config.MarketplaceContractAbi, marketplaceContract);
diff --git a/src/UnitySampleProject/Assets/Samples/web3.unity SDK HyperPlay/1.0.0/HyperPlay Samples/Scripts/HyperPlayLoginProvider.cs b/src/UnitySampleProject/Assets/Samples/web3.unity SDK HyperPlay/1.0.0/HyperPlay Samples/Scripts/HyperPlayLoginProvider.cs
index 93263321f..2683e7a57 100644
--- a/src/UnitySampleProject/Assets/Samples/web3.unity SDK HyperPlay/1.0.0/HyperPlay Samples/Scripts/HyperPlayLoginProvider.cs
+++ b/src/UnitySampleProject/Assets/Samples/web3.unity SDK HyperPlay/1.0.0/HyperPlay Samples/Scripts/HyperPlayLoginProvider.cs
@@ -16,13 +16,13 @@ public class HyperPlayLoginProvider : LoginProvider, IWeb3BuilderServiceAdapter
[SerializeField] private Toggle rememberMeToggle;
private bool _storedSessionAvailable;
-
+
protected override async void Initialize()
{
base.Initialize();
_storedSessionAvailable = false;
-
+
await using (var lightWeb3 = await HyperPlayWeb3.BuildLightweightWeb3(new HyperPlayConfig()))
{
var data = lightWeb3.ServiceProvider.GetService();
@@ -33,7 +33,7 @@ protected override async void Initialize()
if (_storedSessionAvailable) // auto-login
{
Debug.Log("Proceeding with auto-login.");
-
+
await TryLogin();
}
@@ -56,7 +56,7 @@ public Web3Builder ConfigureServices(Web3Builder web3Builder)
services.UseWalletSigner().UseWalletTransactionExecutor();
});
}
-
+
private async void OnLoginClicked()
{
await TryLogin();
diff --git a/src/UnitySampleProject/Assets/Samples/web3.unity SDK Marketplace/2.6.1/Marketplace Samples/Models/AuthPayload.cs b/src/UnitySampleProject/Assets/Samples/web3.unity SDK Marketplace/2.6.1/Marketplace Samples/Models/AuthPayload.cs
index 9cdb025a7..03181f226 100644
--- a/src/UnitySampleProject/Assets/Samples/web3.unity SDK Marketplace/2.6.1/Marketplace Samples/Models/AuthPayload.cs
+++ b/src/UnitySampleProject/Assets/Samples/web3.unity SDK Marketplace/2.6.1/Marketplace Samples/Models/AuthPayload.cs
@@ -12,7 +12,7 @@ public class EmailRequestPayload
{
public string email;
}
-
+
///
/// Payload class for authorization post request.
///
@@ -21,7 +21,7 @@ public class AuthCodePayload
public string email;
public string nonce;
}
-
+
///
/// Payload class for login request.
///
diff --git a/src/UnitySampleProject/Assets/Samples/web3.unity SDK Marketplace/2.6.1/Marketplace Samples/Scripts/BrowseMarketplaceManager.cs b/src/UnitySampleProject/Assets/Samples/web3.unity SDK Marketplace/2.6.1/Marketplace Samples/Scripts/BrowseMarketplaceManager.cs
index 0cad9ec01..dcc7c612c 100644
--- a/src/UnitySampleProject/Assets/Samples/web3.unity SDK Marketplace/2.6.1/Marketplace Samples/Scripts/BrowseMarketplaceManager.cs
+++ b/src/UnitySampleProject/Assets/Samples/web3.unity SDK Marketplace/2.6.1/Marketplace Samples/Scripts/BrowseMarketplaceManager.cs
@@ -35,14 +35,14 @@ public class BrowseMarketplaceManager : MonoBehaviour
private int marketplaceItemDisplayCount = 100;
#endregion
-
+
#region Properties
-
+
private string BearerToken { get; set; }
private TMP_FontAsset DisplayFont { get; set; }
private Color SecondaryTextColour { get; set; }
-
+
#endregion
#region Methods
@@ -55,7 +55,7 @@ private void Awake()
openSelectMarketplaceOptionButton.onClick.AddListener(OpenSelectMarketplaceOptionMenu);
marketplaceItemPrefabs = new GameObject[marketplaceItemDisplayCount];
}
-
+
///
/// Populates the marketplace drop down options.
///
@@ -102,7 +102,7 @@ private async void PopulateMarketplaceItems(int index)
AddMarketplaceItemToDisplay(item.id, item.token.token_type, item.price, item.token.uri);
}
}
-
+
///
/// Adds items to the marketplace display.
///
@@ -130,7 +130,7 @@ private void AddMarketplaceItemToDisplay(string nftId, string nftType, string nf
marketplaceObjectNumber++;
marketplaceScrollRect.horizontalNormalizedPosition = 0;
}
-
+
///
/// Imports texture (can probably be removed later for helper class)
///
@@ -139,7 +139,7 @@ private async Task ImportTexture(string uri)
{
var metaRequest = UnityWebRequest.Get(uri);
await metaRequest.SendWebRequest();
-
+
if (metaRequest.result != UnityWebRequest.Result.Success)
{
throw new Web3Exception($"Metadata request failure: {metaRequest.error}");
@@ -148,17 +148,17 @@ private async Task ImportTexture(string uri)
var textureUri = IpfsHelper.RollupIpfsUri(metadata.image);
var textureRequest = UnityWebRequestTexture.GetTexture(textureUri);
await textureRequest.SendWebRequest();
-
+
if (textureRequest.result != UnityWebRequest.Result.Success)
{
throw new Web3Exception($"Texture request failure: {metaRequest.error}");
}
-
+
var texture = ((DownloadHandlerTexture)textureRequest.downloadHandler).texture;
return texture;
}
-
+
///
/// Updates the marketplace display.
///
@@ -183,7 +183,7 @@ private async void UpdateMarketplaceDisplay(int marketplaceObjectIndex, string n
imageObj.material.mainTexture = image;
}
}
-
+
///
/// Called when the dropdown value is changed.
///
@@ -192,7 +192,7 @@ private void OnDropdownValueChanged(int index)
{
ResetMarketplacePrefabDisplay(index);
}
-
+
///
/// Resets marketplace display by destroying item prefabs.
///
@@ -220,7 +220,7 @@ private void OpenSelectMarketplaceOptionMenu()
browseMarketplaceMenu.SetActive(false);
selectMarketplaceMenu.SetActive(true);
}
-
+
///
/// Subscribes to events.
///
@@ -229,7 +229,7 @@ private void OnEnable()
EventManagerMarketplace.ConfigureMarketplaceBrowserManager += OnConfigureMarketPlaceBrowseManager;
GetMarketplaceOptions();
}
-
+
///
/// Unsubscribes from events.
///
@@ -238,7 +238,7 @@ private void OnDisable()
EventManagerMarketplace.ConfigureMarketplaceBrowserManager -= OnConfigureMarketPlaceBrowseManager;
ResetMarketplacePrefabDisplay();
}
-
+
///
/// Configures class properties.
///
diff --git a/src/UnitySampleProject/Assets/Samples/web3.unity SDK Marketplace/2.6.1/Marketplace Samples/Scripts/EventManagerMarketplace.cs b/src/UnitySampleProject/Assets/Samples/web3.unity SDK Marketplace/2.6.1/Marketplace Samples/Scripts/EventManagerMarketplace.cs
index b9a453642..b4d50ba0e 100644
--- a/src/UnitySampleProject/Assets/Samples/web3.unity SDK Marketplace/2.6.1/Marketplace Samples/Scripts/EventManagerMarketplace.cs
+++ b/src/UnitySampleProject/Assets/Samples/web3.unity SDK Marketplace/2.6.1/Marketplace Samples/Scripts/EventManagerMarketplace.cs
@@ -10,27 +10,27 @@ namespace ChainSafe.Gaming.Marketplace
public static class EventManagerMarketplace
{
#region Events
-
+
public static event EventHandler ConfigureMarketplaceGuiManager;
public static event EventHandler ConfigureMarketplaceBrowserManager;
public static event EventHandler ConfigureAuthSystemManager;
public static event Action LoginMarketplace;
public static event Action LogoutMarketplace;
-
+
#endregion
-
+
#region Methods
-
+
public static void RaiseLoginMarketplace()
{
LoginMarketplace?.Invoke();
}
-
+
public static void RaiseLogoutMarketplace()
{
LogoutMarketplace?.Invoke();
}
-
+
///
/// Configure GUI manager.
///
@@ -39,7 +39,7 @@ public static void RaiseConfigureMarketplaceGuiManager(MarketplaceGUIConfigEvent
{
ConfigureMarketplaceGuiManager?.Invoke(null, args);
}
-
+
///
/// Configure marketplace browser manager.
///
@@ -48,7 +48,7 @@ public static void RaiseConfigureMarketplaceBrowserManager(MarketplaceBrowserCon
{
ConfigureMarketplaceBrowserManager?.Invoke(null, args);
}
-
+
///
/// Configure auth system manager.
///
@@ -57,29 +57,29 @@ public static void RaiseConfigureAuthSystemManager(MarketplaceAuthSystemManagerC
{
ConfigureAuthSystemManager?.Invoke(null, args);
}
-
+
#endregion
-
+
#region Configuration Classes
-
+
///
/// Configuration class for the Marketplace GUI Manager.
///
public class MarketplaceGUIConfigEventArgs : EventArgs
{
#region Properties
-
+
public static TMP_FontAsset DisplayFont { get; private set; }
public static Color PrimaryBackgroundColour { get; private set; }
public static Color MenuBackgroundColour { get; private set; }
public static Color PrimaryTextColour { get; private set; }
public static Color SecondaryTextColour { get; private set; }
public static Color BorderButtonColour { get; private set; }
-
+
#endregion
-
+
#region Methods
-
+
public MarketplaceGUIConfigEventArgs(TMP_FontAsset displayFont, Color primaryBackgroundColour, Color menuBackgroundColour, Color primaryTextColour, Color secondaryTextColour, Color borderButtonColour)
{
DisplayFont = displayFont;
@@ -89,54 +89,54 @@ public MarketplaceGUIConfigEventArgs(TMP_FontAsset displayFont, Color primaryBac
SecondaryTextColour = secondaryTextColour;
BorderButtonColour = borderButtonColour;
}
-
+
#endregion
}
-
+
///
/// Configuration class for the Marketplace Browser Manager.
///
public class MarketplaceBrowserConfigEventArgs : EventArgs
{
#region Properties
-
+
public TMP_FontAsset DisplayFont { get; private set; }
public Color SecondaryTextColour { get; private set; }
public string BearerToken { get; private set; }
-
+
#endregion
-
+
#region Methods
-
+
public MarketplaceBrowserConfigEventArgs(TMP_FontAsset displayFont, Color secondaryTextColour, string bearerToken)
{
DisplayFont = displayFont;
SecondaryTextColour = secondaryTextColour;
BearerToken = bearerToken;
}
-
+
#endregion
}
-
+
///
/// Configuration class for the Marketplace Auth System Manager.
///
public class MarketplaceAuthSystemManagerConfigEventArgs : EventArgs
{
#region Properties
-
+
private string BearerToken { get; set; }
private DateTime BearerTokenExpires { get; set; }
-
+
private string RefreshToken { get; set; }
private DateTime RefreshTokenExpires { get; set; }
#endregion
-
+
#region Methods
-
+
public MarketplaceAuthSystemManagerConfigEventArgs(string bearerToken, DateTime bearerTokenExpires, string refreshToken, DateTime refreshTokenExpires)
{
BearerToken = bearerToken;
@@ -144,10 +144,10 @@ public MarketplaceAuthSystemManagerConfigEventArgs(string bearerToken, DateTime
RefreshToken = refreshToken;
RefreshTokenExpires = refreshTokenExpires;
}
-
+
#endregion
}
-
+
#endregion
}
}
diff --git a/src/UnitySampleProject/Assets/Samples/web3.unity SDK Marketplace/2.6.1/Marketplace Samples/Scripts/LoginManagerMarketplace.cs b/src/UnitySampleProject/Assets/Samples/web3.unity SDK Marketplace/2.6.1/Marketplace Samples/Scripts/LoginManagerMarketplace.cs
index 1645a99c7..36e6a2e0d 100644
--- a/src/UnitySampleProject/Assets/Samples/web3.unity SDK Marketplace/2.6.1/Marketplace Samples/Scripts/LoginManagerMarketplace.cs
+++ b/src/UnitySampleProject/Assets/Samples/web3.unity SDK Marketplace/2.6.1/Marketplace Samples/Scripts/LoginManagerMarketplace.cs
@@ -15,7 +15,7 @@ namespace ChainSafe.Gaming.Marketplace
public class LoginManagerMarketplace : MonoBehaviour
{
#region Fields
-
+
[SerializeField] private TMP_InputField emailAddressInput;
[SerializeField] private TMP_InputField authCodeInput;
[SerializeField] private GameObject marketplacePrefab;
@@ -58,7 +58,7 @@ private void Awake()
verifyAuthCodeBackButton.onClick.AddListener(ToggleEmailMenu);
SetCustomConfig();
}
-
+
///
/// Sets config & object colours.
///
@@ -102,7 +102,7 @@ private async void RequestEmailAuthCode()
ToggleEmailMenu();
}
}
-
+
///
/// Authorizes login via email code.
///
@@ -120,9 +120,9 @@ private async void VerifyEmailAuthCode()
request.uploadHandler = new UploadHandlerRaw(bodyRaw);
request.downloadHandler = new DownloadHandlerBuffer();
request.SetRequestHeader("Content-Type", "application/json");
-
+
await request.SendWebRequest();
-
+
if (request.result != UnityWebRequest.Result.Success)
{
Debug.LogError($"Error: {request.error}");
@@ -134,7 +134,7 @@ private async void VerifyEmailAuthCode()
TryLogin(authResponse.token);
}
}
-
+
///
/// Retrieves the user account ID.
///
@@ -152,9 +152,9 @@ private async void TryLogin(string authResponseToken)
request.uploadHandler = new UploadHandlerRaw(bodyRaw);
request.downloadHandler = new DownloadHandlerBuffer();
request.SetRequestHeader("Content-Type", "application/json");
-
+
await request.SendWebRequest();
-
+
if (request.result != UnityWebRequest.Result.Success)
{
Debug.LogError($"Error: {request.error}");
@@ -170,7 +170,7 @@ private async void TryLogin(string authResponseToken)
InstantiateMarketplace();
}
}
-
+
///
/// Toggles the email & auth menus.
///
@@ -179,7 +179,7 @@ private void ToggleEmailMenu()
emailLoginMenu.SetActive(!emailLoginMenu.activeSelf);
authCodeMenu.SetActive(!authCodeMenu.activeSelf);
}
-
+
///
/// Instantiates the marketplace prefab.
///
diff --git a/src/UnitySampleProject/Assets/Samples/web3.unity SDK Marketplace/2.6.1/Marketplace Samples/Scripts/MarketplaceSelectionManager.cs b/src/UnitySampleProject/Assets/Samples/web3.unity SDK Marketplace/2.6.1/Marketplace Samples/Scripts/MarketplaceSelectionManager.cs
index 2c1cc0154..998551589 100644
--- a/src/UnitySampleProject/Assets/Samples/web3.unity SDK Marketplace/2.6.1/Marketplace Samples/Scripts/MarketplaceSelectionManager.cs
+++ b/src/UnitySampleProject/Assets/Samples/web3.unity SDK Marketplace/2.6.1/Marketplace Samples/Scripts/MarketplaceSelectionManager.cs
@@ -62,7 +62,7 @@ private void OpenSelectMarketplaceOptionMenu()
browseMarketplaceMenu.SetActive(false);
selectMarketplaceMenu.SetActive(true);
}
-
+
// TODO: Shouldn't be firing instantly, fix later.
///
/// Waits for token expiry then refreshes it.
@@ -77,6 +77,6 @@ private IEnumerator WaitForTokenExpiration()
}
#endregion
-
+
}
}
diff --git a/src/UnitySampleProject/Assets/Samples/web3.unity SDK Web3Auth/2.6.0/Web3Auth Samples/Scripts/Web3AuthLoginProvider.cs b/src/UnitySampleProject/Assets/Samples/web3.unity SDK Web3Auth/2.6.0/Web3Auth Samples/Scripts/Web3AuthLoginProvider.cs
index 301510459..034965dc0 100644
--- a/src/UnitySampleProject/Assets/Samples/web3.unity SDK Web3Auth/2.6.0/Web3Auth Samples/Scripts/Web3AuthLoginProvider.cs
+++ b/src/UnitySampleProject/Assets/Samples/web3.unity SDK Web3Auth/2.6.0/Web3Auth Samples/Scripts/Web3AuthLoginProvider.cs
@@ -55,8 +55,8 @@ public struct ProviderAndButtonPair
[SerializeField] private Color borderButtonColour;
private Provider? selectedProvider;
private bool rememberMe;
-
- #if UNITY_WEBGL && !UNITY_EDITOR
+
+#if UNITY_WEBGL && !UNITY_EDITOR
[DllImport("__Internal")]
private static extern void InitWeb3Auth(string clientId, string chainId, string rpcTarget, string displayName, string blockExplorerUrl, string ticker, string tickerName, string network);
[DllImport("__Internal")]
@@ -65,9 +65,9 @@ public struct ProviderAndButtonPair
private static extern void SetLoginCallback(Action callback);
public static event Action Web3AuthWebGLConnected;
- #endif
-
-
+#endif
+
+
public void SetRememberMe(bool rememberMe)
{
this.rememberMe = rememberMe;
@@ -78,21 +78,21 @@ protected override async void Initialize()
base.Initialize();
providerAndButtonPairs.ForEach(p =>
p.Button.onClick.AddListener(delegate { LoginWithWeb3Auth(p.Provider); }));
- #if !UNITY_EDITOR && UNITY_WEBGL
+#if !UNITY_EDITOR && UNITY_WEBGL
Web3AuthWebGLConnected += Web3AuthSet;
var projectSettings = ProjectConfigUtilities.Load();
SetLoginCallback(Web3AuthConnected);
//1155 is a decimal number, we need to convert it to an integer
InitWeb3Auth(clientId, new HexBigInteger(BigInteger.Parse(projectSettings.ChainId)).HexValue,
projectSettings.Rpc, projectSettings.Network, "", projectSettings.Symbol, "", network.ToString().ToLower());
- #else
+#else
if (!string.IsNullOrEmpty(KeyStoreManagerUtils.getPreferencesData(KeyStoreManagerUtils.SESSION_ID)))
{
rememberMe = true;
await TryLogin();
Debug.Log("Restoring existing Web3Auth session (Remember Me");
}
- #endif
+#endif
}
#if !UNITY_EDITOR && UNITY_WEBGL
private async void Web3AuthSet(string sessionId)
@@ -102,7 +102,7 @@ private async void Web3AuthSet(string sessionId)
await TryLogin();
}
#endif
-
+
#if !UNITY_EDITOR && UNITY_WEBGL
[MonoPInvokeCallback(typeof(Action))]
private static void Web3AuthConnected(string sessionId)
@@ -120,7 +120,7 @@ private async void LoginWithWeb3Auth(Provider provider)
await TryLogin();
LogAnalytics(provider);
}
-
+
public override async Task TryLogin()
{
try
@@ -167,7 +167,7 @@ private void LogAnalytics(Provider provider)
#endif
}
-
+
public Web3Builder ConfigureServices(Web3Builder web3Builder)
{
return web3Builder.Configure(services =>
diff --git a/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.6.0/Web3.Unity Samples/Scripts/Scenes/SampleMain/EVM/EvmCalls.cs b/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.6.0/Web3.Unity Samples/Scripts/Scenes/SampleMain/EVM/EvmCalls.cs
index e0e25a1a6..e038bc275 100644
--- a/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.6.0/Web3.Unity Samples/Scripts/Scenes/SampleMain/EVM/EvmCalls.cs
+++ b/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.6.0/Web3.Unity Samples/Scripts/Scenes/SampleMain/EVM/EvmCalls.cs
@@ -19,7 +19,7 @@ public class EvmCalls : MonoBehaviour
[Header("Change the fields below for testing purposes")]
#region Contract Send
-
+
[Header("Contract Send")]
[SerializeField] private string methodSend = "addTotal";
[SerializeField] private int increaseAmountSend = 1;
@@ -27,18 +27,19 @@ public class EvmCalls : MonoBehaviour
#endregion
#region Contract Call
-
+
[Header("Contract Call")]
[SerializeField] private string methodCall = "myTotal";
#endregion
#region Get Send Array
-
+
[Header("Array Calls")]
[SerializeField] private string methodArrayGet = "getStore";
[SerializeField] private string methodArraySend = "setStore";
- [SerializeField] private string[] stringArraySend =
+ [SerializeField]
+ private string[] stringArraySend =
{
"0xFb3aECf08940785D4fB3Ad87cDC6e1Ceb20e9aac",
"0x92d4040e4f3591e60644aaa483821d1bd87001e3"
@@ -47,7 +48,7 @@ public class EvmCalls : MonoBehaviour
#endregion
#region Sign Verify Sha3
-
+
[Header("Sign Verify SHA3 calls")]
[SerializeField] private string messageSign = "The right man in the wrong place can make all the difference in the world.";
[SerializeField] private string messageSignVerify = "A man chooses, a slave obeys.";
@@ -56,7 +57,7 @@ public class EvmCalls : MonoBehaviour
#endregion
#region Send Transaction
-
+
[Header("Send Transaction Call")]
[SerializeField] private string toAddress = "0xdD4c825203f97984e7867F11eeCc813A036089D1";
[SerializeField] private string value = "12300000000000000";
@@ -64,14 +65,14 @@ public class EvmCalls : MonoBehaviour
#endregion
#region Registered Contract
-
+
[Header("Registered Contract Call")]
[SerializeField] private string registeredContractName = "CsTestErc20";
#endregion
#region ECDSA
-
+
[Header("ECDSA Calls")]
[SerializeField] private string ecdsaKey = "0x78dae1a22c7507a4ed30c06172e7614eb168d3546c13856340771e63ad3c0081";
[SerializeField] private string ecdsaMessage = "This is a test message";
@@ -81,7 +82,7 @@ public class EvmCalls : MonoBehaviour
#endregion
#region Multi Call
-
+
[Header("MutliCall")]
[SerializeField] private string Erc20Account = "0xd25b827D92b0fd656A1c829933e9b0b836d5C3e2";
diff --git a/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.6.0/Web3.Unity Samples/Scripts/Scenes/SampleMain/Erc1155/Erc1155Calls.cs b/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.6.0/Web3.Unity Samples/Scripts/Scenes/SampleMain/Erc1155/Erc1155Calls.cs
index 16dd9af8a..5664392d2 100644
--- a/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.6.0/Web3.Unity Samples/Scripts/Scenes/SampleMain/Erc1155/Erc1155Calls.cs
+++ b/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.6.0/Web3.Unity Samples/Scripts/Scenes/SampleMain/Erc1155/Erc1155Calls.cs
@@ -12,9 +12,9 @@ public class Erc1155Calls : MonoBehaviour
{
#region Fields
[Header("Change the fields below for testing purposes")]
-
+
#region Balance Of
-
+
[Header("Balance Of Call")]
[SerializeField] private string accountBalanceOf = "0xd25b827D92b0fd656A1c829933e9b0b836d5C3e2";
[SerializeField] private string tokenIdBalanceOf = "1";
@@ -22,7 +22,7 @@ public class Erc1155Calls : MonoBehaviour
#endregion
#region Balance Of Batch
-
+
[Header("Balance Of Batch Call")]
[SerializeField] private string[] accountsBalanceOfBatch = { "0xd25b827D92b0fd656A1c829933e9b0b836d5C3e2", "0xE51995Cdb3b1c109E0e6E67ab5aB31CDdBB83E4a" };
[SerializeField] private string[] tokenIdsBalanceOfBatch = { "1", "2" };
@@ -30,14 +30,14 @@ public class Erc1155Calls : MonoBehaviour
#endregion
#region Uri
-
+
[Header("URI Call")]
[SerializeField] private string tokenIdUri = "1";
#endregion
#region Mint
-
+
[Header("Mint Call")]
[SerializeField] private BigInteger idMint = 1;
[SerializeField] private BigInteger amountMint = 1;
@@ -45,7 +45,7 @@ public class Erc1155Calls : MonoBehaviour
#endregion
#region Transfer
-
+
[Header("Transfer Call")]
[SerializeField] private string toAccountTransfer = "0xdD4c825203f97984e7867F11eeCc813A036089D1";
[SerializeField] private BigInteger tokenIdTransfer = 1;
@@ -54,7 +54,7 @@ public class Erc1155Calls : MonoBehaviour
#endregion
#region Texture
-
+
[Header("Token ID for IPFS texture")]
[SerializeField] private string tokenIdTexture = "0";
public RawImage rawImage;
@@ -62,17 +62,17 @@ public class Erc1155Calls : MonoBehaviour
#endregion
#endregion
-
+
///
/// Balance Of ERC1155 Address
///
public async void BalanceOf()
{
var balance = await Web3Accessor.Web3.Erc1155.GetBalanceOf(
- ChainSafeContracts.Erc1155,
+ ChainSafeContracts.Erc1155,
tokenIdBalanceOf,
accountBalanceOf);
- SampleOutputUtil.PrintResult(balance.ToString(), "ERC-1155",nameof(Erc1155Service.GetBalanceOf));
+ SampleOutputUtil.PrintResult(balance.ToString(), "ERC-1155", nameof(Erc1155Service.GetBalanceOf));
}
///
@@ -82,9 +82,9 @@ public async void BalanceOfBatch()
{
var balances = await Web3Accessor.Web3.Erc1155.GetBalanceOfBatch(
ChainSafeContracts.Erc1155,
- accountsBalanceOfBatch,
+ accountsBalanceOfBatch,
tokenIdsBalanceOfBatch);
- SampleOutputUtil.PrintResult(string.Join(", ", balances), "ERC-1155",nameof(Erc1155Service.GetBalanceOfBatch));
+ SampleOutputUtil.PrintResult(string.Join(", ", balances), "ERC-1155", nameof(Erc1155Service.GetBalanceOfBatch));
}
///
@@ -95,7 +95,7 @@ public async void Uri()
var uri = await Web3Accessor.Web3.Erc1155.GetUri(
ChainSafeContracts.Erc1155,
tokenIdUri);
- SampleOutputUtil.PrintResult(uri, "ERC-1155",nameof(Erc1155Service.GetUri));
+ SampleOutputUtil.PrintResult(uri, "ERC-1155", nameof(Erc1155Service.GetUri));
}
///
@@ -108,7 +108,7 @@ public async void MintErc1155()
idMint,
amountMint);
var output = SampleOutputUtil.BuildOutputValue(response);
- SampleOutputUtil.PrintResult(output, "ERC-1155",nameof(Erc1155Service.Mint));
+ SampleOutputUtil.PrintResult(output, "ERC-1155", nameof(Erc1155Service.Mint));
}
///
@@ -122,7 +122,7 @@ public async void TransferErc1155()
amountTransfer,
toAccountTransfer);
var output = SampleOutputUtil.BuildOutputValue(response);
- SampleOutputUtil.PrintResult(output, "ERC-1155",nameof(Erc1155Service.Transfer));
+ SampleOutputUtil.PrintResult(output, "ERC-1155", nameof(Erc1155Service.Transfer));
}
///
diff --git a/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.6.0/Web3.Unity Samples/Scripts/Scenes/SampleMain/Erc20/Erc20Calls.cs b/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.6.0/Web3.Unity Samples/Scripts/Scenes/SampleMain/Erc20/Erc20Calls.cs
index 0d8d31c16..75340fb9a 100644
--- a/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.6.0/Web3.Unity Samples/Scripts/Scenes/SampleMain/Erc20/Erc20Calls.cs
+++ b/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.6.0/Web3.Unity Samples/Scripts/Scenes/SampleMain/Erc20/Erc20Calls.cs
@@ -14,21 +14,21 @@ public class Erc20Calls : MonoBehaviour
[Header("Change the fields below for testing purposes")]
#region Balance Of
-
+
[Header("Balance Of Call")]
[SerializeField] private string accountBalanceOf = "0xd25b827D92b0fd656A1c829933e9b0b836d5C3e2";
#endregion
#region Mint
-
+
[Header("Mint Call")]
[SerializeField] private BigInteger amountMint = 1000000000000000000;
#endregion
#region Transfer
-
+
[Header("Transfer Call")]
[SerializeField] private string toAccount = "0xdD4c825203f97984e7867F11eeCc813A036089D1";
[SerializeField] private BigInteger amountTransfer = 1000000000000000;
diff --git a/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.6.0/Web3.Unity Samples/Scripts/Scenes/SampleMain/Erc721/Erc721Calls.cs b/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.6.0/Web3.Unity Samples/Scripts/Scenes/SampleMain/Erc721/Erc721Calls.cs
index 4a1dc3524..8998dad99 100644
--- a/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.6.0/Web3.Unity Samples/Scripts/Scenes/SampleMain/Erc721/Erc721Calls.cs
+++ b/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.6.0/Web3.Unity Samples/Scripts/Scenes/SampleMain/Erc721/Erc721Calls.cs
@@ -14,19 +14,19 @@ public class Erc721Calls : MonoBehaviour
[Header("Change the fields below for testing purposes")]
#region Balance Of
-
+
[Header("Balance Of Call")]
[SerializeField] private string accountBalanceOf = "0xd25b827D92b0fd656A1c829933e9b0b836d5C3e2";
#endregion
#region Owner Of
-
+
[Header("Owner Of Call")]
[SerializeField] private string tokenIdOwnerOf = "1";
#endregion
-
+
[Header("Balance Of Batch Call")]
#region Owner Of Batch
@@ -35,21 +35,21 @@ public class Erc721Calls : MonoBehaviour
#endregion
#region Uri
-
+
[Header("URI Call")]
[SerializeField] private string tokenIdUri = "0x01559ae4021a565d5cc4740f1cefa95de8c1fb193949ecd32c337b03047da501";
#endregion
#region Mint
-
+
[Header("Mint Call")]
[SerializeField] private string uriMint = "1";
#endregion
#region Transfer
-
+
[Header("Transfer Call")]
[SerializeField] private string contractTransfer = "0x358AA13c52544ECCEF6B0ADD0f801012ADAD5eE3";
[SerializeField] private string toAccountTransfer = "0xdD4c825203f97984e7867F11eeCc813A036089D1";
diff --git a/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.6.0/Web3.Unity Samples/Scripts/Scenes/SampleMain/IPFS/IPFSCalls.cs b/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.6.0/Web3.Unity Samples/Scripts/Scenes/SampleMain/IPFS/IPFSCalls.cs
index 8e880b8a8..4a67ccefc 100644
--- a/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.6.0/Web3.Unity Samples/Scripts/Scenes/SampleMain/IPFS/IPFSCalls.cs
+++ b/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.6.0/Web3.Unity Samples/Scripts/Scenes/SampleMain/IPFS/IPFSCalls.cs
@@ -22,9 +22,9 @@ public class IPFSCalls : MonoBehaviour
[SerializeField] private string imageCID = "Enter your image CID from storage or upload call";
#endregion
-
+
#region Methods
-
+
///
/// Uploads an image selected by the user to IPFS
///
@@ -37,9 +37,9 @@ public async void IPFSUploadImage()
FileNameImage = fileNameImage
};
var cid = await IPFS.UploadImage(uploadRequest);
- Debug.Log($"Image uploaded to https://ipfs.chainsafe.io/ipfs/{cid}");
+ Debug.Log($"Image uploaded to https://ipfs.chainsafe.io/ipfs/{cid}");
}
-
+
///
/// Uploads metadata to IPFS
///
@@ -57,9 +57,9 @@ public async void IPFSUploadMetadata()
attributes = IPFS.CreateAttributesList(display_types, trait_types, values)
};
var cid = await IPFS.UploadMetaData(uploadRequest);
- Debug.Log($"Metadata uploaded to https://ipfs.chainsafe.io/ipfs/{cid}");
+ Debug.Log($"Metadata uploaded to https://ipfs.chainsafe.io/ipfs/{cid}");
}
-
+
///
/// Uploads an image selected by the user including metadata to IPFS
///
@@ -77,7 +77,7 @@ public async void IPFSUploadImageAndMetadata()
attributes = IPFS.CreateAttributesList(display_types, trait_types, values)
};
var cid = await IPFS.UploadImageAndMetadata(uploadRequest);
- Debug.Log($"Image & metadata uploaded to https://ipfs.chainsafe.io/ipfs/{cid}");
+ Debug.Log($"Image & metadata uploaded to https://ipfs.chainsafe.io/ipfs/{cid}");
}
#endregion
diff --git a/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.6.0/Web3.Unity Samples/Scripts/Scenes/SampleMain/Marketplace/MarketplaceCalls.cs b/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.6.0/Web3.Unity Samples/Scripts/Scenes/SampleMain/Marketplace/MarketplaceCalls.cs
index caef96831..c3de37cc0 100644
--- a/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.6.0/Web3.Unity Samples/Scripts/Scenes/SampleMain/Marketplace/MarketplaceCalls.cs
+++ b/src/UnitySampleProject/Assets/Samples/web3.unity SDK/2.6.0/Web3.Unity Samples/Scripts/Scenes/SampleMain/Marketplace/MarketplaceCalls.cs
@@ -11,65 +11,65 @@ public class MarketplaceCalls : MonoBehaviour
{
#region fields
[Header("Change the fields below for testing purposes")]
-
+
[Header("Bearer token")]
[SerializeField] private string bearerToken = "Please set your bearer token from the ChainSafe dashboard";
-
+
[Header("721 Collection Call")]
[SerializeField] private string collectionId721 = "Set 721 collection ID";
-
+
[Header("1155 Collection Call")]
[SerializeField] private string collectionId1155 = "Set 1155 collection ID";
-
+
[Header("Marketplace Calls")]
[SerializeField] private string marketplaceId = "Set marketplace ID";
-
+
[Header("Token Calls")]
[SerializeField] private string tokenId = "Set token ID i.e 1";
-
+
[Header("Create 721 Collection Call")]
[SerializeField] private string collectionName721 = "Set 721 collection name";
[SerializeField] private string collectionDescription721 = "Set 721 collection description";
[SerializeField] private bool collectionMintingPublic721 = false;
-
+
[Header("Create 1155 Collection Call")]
[SerializeField] private string collectionName1155 = "Set 1155 collection name";
[SerializeField] private string collectionDescription1155 = "Set 1155 collection description";
[SerializeField] private bool collectionMintingPublic1155 = false;
-
+
[Header("Delete calls (Can only be used before the item is on chain)")]
[SerializeField] private string collectionToDelete = "Set collection to delete";
[SerializeField] private string marketplaceToDelete = "Set marketplace to delete";
-
+
[Header("Mint 721 to collection calls")]
[SerializeField] private string collectionContract721 = "Set 721 collection to mint to";
[SerializeField] private string uri721 = "Set metadata uri with full path i.e. https://ipfs.chainsafe.io/ipfs/bafyjvzacdj4apx52hvbyjkwyf7i6a7t3pcqd4kw4xxfc67hgvn3a";
-
+
[Header("Mint 1155 to collection calls")]
[SerializeField] private string collectionContract1155 = "Set 1155 collection to mint to";
[SerializeField] private string uri1155 = "Set metadata uri with full path i.e. https://ipfs.chainsafe.io/ipfs/bafyjvzacdj4apx52hvbyjkwyf7i6a7t3pcqd4kw4xxfc67hgvn3a";
[SerializeField] private string amount1155 = "Set amount of Nfts to mint i.e 1";
-
+
[Header("Create marketplace call")]
[SerializeField] private string marketplaceName = "Set marketplace name";
[SerializeField] private string marketplaceDescription = "Set marketplace description";
[SerializeField] private bool marketplaceWhitelisting = false;
-
+
[Header("List to marketplace calls")]
[SerializeField] private string tokenIdToList = "Set token ID to list";
[SerializeField] private string weiPriceToList = "Set price in wei to list for i.e 100000000000000";
[SerializeField] private string marketplaceContractToListTo = "Set marketplace contract to list to";
[SerializeField] private string collectionContractToList = "Set collection contract to list from";
-
+
[Header("Marketplace purchase calls")]
[SerializeField] private string marketplaceContractToBuyFrom = "Set marketplace contract to buy from";
[SerializeField] private string itemIdToBuy = "Set item ID to buy (the index id of the nft in the marketplace i.e 0 or 1)";
[SerializeField] private string weiPriceToBuy = "Set price in wei to buy with i.e 100000000000000";
-
+
#endregion
#region Methods
-
+
///
/// Gets all items in a project.
///
@@ -82,7 +82,7 @@ public async void GetProjectItems()
Marketplace.PrintObject(item);
}
}
-
+
///
/// Gets all items in a marketplace.
///
@@ -95,7 +95,7 @@ public async void GetMarketplaceItems()
Marketplace.PrintObject(item);
}
}
-
+
///
/// Gets items listed by token id.
///
@@ -104,7 +104,7 @@ public async void GetItem()
var response = await Marketplace.GetItem(marketplaceId, tokenId);
Marketplace.PrintObject(response.token);
}
-
+
///
/// Gets all tokens in a project.
///
@@ -116,7 +116,7 @@ public async void GetProjectTokens()
Marketplace.PrintObject(token);
}
}
-
+
///
/// Gets all tokens in a 721 collection.
///
@@ -128,7 +128,7 @@ public async void GetCollectionTokens721()
Marketplace.PrintObject(token);
}
}
-
+
///
/// Gets all tokens in a 1155 collection.
///
@@ -140,7 +140,7 @@ public async void GetCollectionTokens1155()
Marketplace.PrintObject(token);
}
}
-
+
///
/// Gets the information of a token in a collection via id. Token id is optional.
///
@@ -149,7 +149,7 @@ public async void GetCollectionToken()
var response = await Marketplace.GetCollectionToken(collectionId721, tokenId);
Marketplace.PrintObject(response);
}
-
+
///
/// Gets the owners of a token id in a collection.
///
@@ -161,7 +161,7 @@ public async void GetTokenOwners()
Marketplace.PrintObject(owner);
}
}
-
+
///
/// Creates a 721 collection
///
@@ -170,7 +170,7 @@ public async void Create721Collection()
var response = await Marketplace.Create721Collection(bearerToken, collectionName721, collectionDescription721, collectionMintingPublic721);
Debug.Log($"TX: {response.TransactionHash}");
}
-
+
///
/// Creates a 1155 collection
///
@@ -179,7 +179,7 @@ public async void Create1155Collection()
var response = await Marketplace.Create1155Collection(bearerToken, collectionName1155, collectionDescription1155, collectionMintingPublic1155);
Debug.Log($"TX: {response.TransactionHash}");
}
-
+
///
/// Mints an NFT to a 721 collection
///
@@ -188,7 +188,7 @@ public async void Mint721CollectionNft()
var response = await Marketplace.Mint721CollectionNft(collectionContract721, uri721);
Debug.Log($"TX: {response.TransactionHash}");
}
-
+
///
/// Mints an NFT to a 1155 collection
///
@@ -197,7 +197,7 @@ public async void Mint1155CollectionNft()
var response = await Marketplace.Mint1155CollectionNft(collectionContract1155, uri1155, amount1155);
Debug.Log($"TX: {response.TransactionHash}");
}
-
+
///
/// Deletes a collection that isn't on chain yet
///
@@ -206,7 +206,7 @@ public async void DeleteCollection()
var response = await Marketplace.DeleteCollection(bearerToken, collectionToDelete);
Debug.Log(response);
}
-
+
///
/// Creates a marketplace
///
@@ -215,43 +215,43 @@ public async void CreateMarketplace()
var response = await Marketplace.CreateMarketplace(bearerToken, marketplaceName, marketplaceDescription, marketplaceWhitelisting);
Debug.Log($"TX: {response.TransactionHash}");
}
-
+
///
/// Deletes a marketplace that isn't on chain yet
///
public async void DeleteMarketplace()
{
- var response = await Marketplace.DeleteMarketplace(bearerToken,marketplaceToDelete);
+ var response = await Marketplace.DeleteMarketplace(bearerToken, marketplaceToDelete);
Debug.Log(response);
}
-
+
///
/// Approves marketplace to list tokens
///
public async void ApproveListNftsToMarketplace()
{
- var response = await Marketplace.SetApprovalMarketplace(collectionContractToList, marketplaceContractToListTo, "1155",true);
+ var response = await Marketplace.SetApprovalMarketplace(collectionContractToList, marketplaceContractToListTo, "1155", true);
Debug.Log($"TX: {response.TransactionHash}");
}
-
+
///
/// Revokes approval from marketplace to list tokens
///
public async void RevokeApprovalListNftsToMarketplace()
{
- var response = await Marketplace.SetApprovalMarketplace(collectionContractToList, marketplaceContractToListTo, "1155",false);
+ var response = await Marketplace.SetApprovalMarketplace(collectionContractToList, marketplaceContractToListTo, "1155", false);
Debug.Log($"TX: {response.TransactionHash}");
}
-
+
///
/// Lists NFTs to the marketplace
///
public async void ListNftsToMarketplace()
{
- var response = await Marketplace.ListNftsToMarketplace(marketplaceContractToListTo,collectionContractToList, tokenIdToList, weiPriceToList);
+ var response = await Marketplace.ListNftsToMarketplace(marketplaceContractToListTo, collectionContractToList, tokenIdToList, weiPriceToList);
Debug.Log($"TX: {response.TransactionHash}");
}
-
+
///
/// Purchases Nft from the marketplace
///
@@ -260,7 +260,7 @@ public async void PurchaseNftFromMarketplace()
var response = await Marketplace.PurchaseNft(marketplaceContractToBuyFrom, itemIdToBuy, weiPriceToBuy);
Debug.Log($"TX: {response.TransactionHash}");
}
-
+
#endregion
}
#endif
\ No newline at end of file