From 7bf40b4402df4e1df6d6d38336994d362169fe02 Mon Sep 17 00:00:00 2001 From: 3scava1i3r Date: Mon, 29 Aug 2022 00:18:30 +0530 Subject: [PATCH 1/8] added Contribute.md --- CONTRIBUTE.md | 91 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 CONTRIBUTE.md diff --git a/CONTRIBUTE.md b/CONTRIBUTE.md new file mode 100644 index 0000000..42146a5 --- /dev/null +++ b/CONTRIBUTE.md @@ -0,0 +1,91 @@ +# web3-unity-sdk + +The web3uiKit is aimed at helping developers build web3 based unity games fast, delivering a quality DX to our developers plus an inclusive and reliable UX to your end users. +Thank you for taking an interest in contributing + +  + +# Our core goals for this SDK 📈 + +  + +# About our stack + +  + +# Getting started + +  + +# Got an idea for a component? + +You can start coding right away but in order for us to organize the build, please follow these steps + +1. Open an issue in our gitHub repo https://github.com/MoralisWeb3/web3-unity-sdk/issues +2. Give the issue a title prefixed with feature, bugFix, docs or chore +3. Describe what you will build, or fix as best you can so we know what to expect +4. Add any examples like images, design ideas or CodePen mockups +5. Be open to refinement of your idea +6. Stay in communication, once we accept the proposal we want that update. If you disappear we might finish it for you or pass it to another dev +7. To complete your task and be merged, you should read about Pull Requests below +8. In need of inspiration? Keep an eye on the issue board as our team will open issues for you and even add new designs for components we need, hot from our Moralis design UX team. + +  + +# NewComp + +Just a friendly heads up incase you missed that above... +We have made a component called `NewComp` you can copy and paste this component to get started but don't change it or we will reject your pull request, sorry. Suggestions are welcome but we are pretty happy with it. +This component has an example of just about everything with a friendly non programmer comment to help you learn, how we do things, why we do them and what we expect when it comes to a pull request. + +Lets take a tour and look at some of our standards + + +# Pull Request + +For your pull request please follow this guide + +## Branch Name + +`pull request type + task` + +- so if i add a new tokenapi addon my branch is `feat-addedTokenApi` + +**Pull request types:** + +- feat = new feature +- fix = bug fix +- docs = added or changed documentation +- chore = some mindless work, like reformatting + +So if i fix the validation to the `Form` my branch is `fix-form-validation`... you get it, right? 😅 + +## Conventional Commits + +We follow a strict convectional commits pattern, and please if you change more than one component, then have 1 commit per components. No monster PRs please, its hard to review them if you change 500 files in one go, lol +https://www.conventionalcommits.org/en/v1.0.0/ + +## PR Feedback + +We are all students in this journey of life, so please accept any critique given. We are just trying to help you out or align your code with our base perhaps. This is a difficult but important part of collaboration and team work. +lets **review each others code and PRs** + +**Q:** Why peer review? + +**A:** So we can all learn from each other, the rising tide brings up all ships. + +  + +# Approval + +Don't forget we can approve and merge your code but you need to add your component to the projects base `index.ts` so the next dev can use it. + +  + + +# Any questions? + +Jump over to the Moralis Discord and checkout the channel `game-dev` + +  + From 6ea21e32df524378a37a505ba8403bec7aa4d98b Mon Sep 17 00:00:00 2001 From: 3scava1i3r Date: Tue, 30 Aug 2022 18:42:33 +0530 Subject: [PATCH 2/8] added token endpoint for SolanaApi --- Runtime/SolanaApi/Api/TokenApi.cs | 91 ++++++++++++++++++++++ Runtime/SolanaApi/CloudApi/TokenApi.cs | 91 ++++++++++++++++++++++ Runtime/SolanaApi/Interfaces/ISolanaApi.cs | 2 + Runtime/SolanaApi/Interfaces/ITokenApi.cs | 10 +++ Runtime/SolanaApi/Models/TokenPrice.cs | 32 ++++++++ 5 files changed, 226 insertions(+) create mode 100644 Runtime/SolanaApi/Api/TokenApi.cs create mode 100644 Runtime/SolanaApi/CloudApi/TokenApi.cs create mode 100644 Runtime/SolanaApi/Interfaces/ITokenApi.cs create mode 100644 Runtime/SolanaApi/Models/TokenPrice.cs diff --git a/Runtime/SolanaApi/Api/TokenApi.cs b/Runtime/SolanaApi/Api/TokenApi.cs new file mode 100644 index 0000000..dd43ad3 --- /dev/null +++ b/Runtime/SolanaApi/Api/TokenApi.cs @@ -0,0 +1,91 @@ +using System; +using System.Collections.Generic; +using Cysharp.Threading.Tasks; +using System.Net; +using MoralisUnity.SolanaApi.Client; +using MoralisUnity.SolanaApi.Interfaces; +using MoralisUnity.SolanaApi.Models; + +namespace MoralisUnity.SolanaApi.Api +{ + public class TokenApi : ITokenApi; + + { + + /// + /// Initializes a new instance of the class. + /// + /// an instance of ApiClient (optional) + /// + public TokenApi(ApiClient apiClient = null) + { + if (apiClient == null) // use the default one in Configuration + this.ApiClient = Configuration.DefaultApiClient; + else + this.ApiClient = apiClient; + } + + /// + /// Initializes a new instance of the class. + /// + /// + public TokenApi(String basePath) + { + this.ApiClient = new ApiClient(basePath); + } + + /// + /// Sets the base path of the API client. + /// + /// The base path + /// The base path + public void SetBasePath(String basePath) + { + this.ApiClient.BasePath = basePath; + } + + /// + /// Gets the base path of the API client. + /// + /// The base path + /// The base path + public String GetBasePath(String basePath) + { + return this.ApiClient.BasePath; + } + + /// + /// Gets or sets the API client. + /// + /// An instance of the ApiClient + public ApiClient ApiClient { get; set; } + + + public async UniTask GetTokenPrice(NetworkTypes network, string address) { + if (address == null) throw new ApiException(400, "Missing required parameter 'address' when calling GetTokenPrice"); + + var headerParams = new Dictionary(); + + var path = "/token/{network}/{address}/price"; + path = path.Replace("{" + "network" + "}", ApiClient.ParameterToString(network.ToString())); + path = path.Replace("{" + "address" + "}", ApiClient.ParameterToString(address)); + + // Authentication setting, if any + String[] authSettings = new String[] { "ApiKeyAuth" }; + + Tuple, string> response = await ApiClient.CallApi(path, Method.GET, null, null, headerParams, null, null, authSettings); + + if (((int)response.Item1) >= 400) + throw new ApiException((int)response.Item1, "Error calling GetTokenPrice: " + response.Item3, response.Item3); + else if (((int)response.Item1) == 0) + throw new ApiException((int)response.Item1, "Error calling GetTokenPrice: " + response.Item3, response.Item3); + + + return ((CloudFunctionResult)ApiClient.Deserialize(response.Item3, typeof(CloudFunctionResult), response.Item2)).Result; + + + } + + } + +} \ No newline at end of file diff --git a/Runtime/SolanaApi/CloudApi/TokenApi.cs b/Runtime/SolanaApi/CloudApi/TokenApi.cs new file mode 100644 index 0000000..aaa5793 --- /dev/null +++ b/Runtime/SolanaApi/CloudApi/TokenApi.cs @@ -0,0 +1,91 @@ +using System; +using System.Collections.Generic; +using Cysharp.Threading.Tasks; +using System.Net; +using MoralisUnity.SolanaApi.Client; +using MoralisUnity.SolanaApi.Interfaces; +using MoralisUnity.SolanaApi.Models; + +namespace MoralisUnity.SolanaApi.CloudApi +{ + public class TokenApi : ITokenApi; + + { + + /// + /// Initializes a new instance of the class. + /// + /// an instance of ApiClient (optional) + /// + public TokenApi(ApiClient apiClient = null) + { + if (apiClient == null) // use the default one in Configuration + this.ApiClient = Configuration.DefaultApiClient; + else + this.ApiClient = apiClient; + } + + /// + /// Initializes a new instance of the class. + /// + /// + public TokenApi(String basePath) + { + this.ApiClient = new ApiClient(basePath); + } + + /// + /// Sets the base path of the API client. + /// + /// The base path + /// The base path + public void SetBasePath(String basePath) + { + this.ApiClient.BasePath = basePath; + } + + /// + /// Gets the base path of the API client. + /// + /// The base path + /// The base path + public String GetBasePath(String basePath) + { + return this.ApiClient.BasePath; + } + + /// + /// Gets or sets the API client. + /// + /// An instance of the ApiClient + public ApiClient ApiClient { get; set; } + + + public async UniTask GetTokenPrice(NetworkTypes network, string address) { + if (address == null) throw new ApiException(400, "Missing required parameter 'address' when calling GetTokenPrice"); + + var headerParams = new Dictionary(); + + var path = "/token/{network}/{address}/price"; + path = path.Replace("{" + "network" + "}", ApiClient.ParameterToString(network.ToString())); + path = path.Replace("{" + "address" + "}", ApiClient.ParameterToString(address)); + + // Authentication setting, if any + String[] authSettings = new String[] { "ApiKeyAuth" }; + + Tuple, string> response = await ApiClient.CallApi(path, Method.GET, null, null, headerParams, null, null, authSettings); + + if (((int)response.Item1) >= 400) + throw new ApiException((int)response.Item1, "Error calling GetTokenPrice: " + response.Item3, response.Item3); + else if (((int)response.Item1) == 0) + throw new ApiException((int)response.Item1, "Error calling GetTokenPrice: " + response.Item3, response.Item3); + + + return ((CloudFunctionResult)ApiClient.Deserialize(response.Item3, typeof(CloudFunctionResult), response.Item2)).Result; + + + } + + } + +} \ No newline at end of file diff --git a/Runtime/SolanaApi/Interfaces/ISolanaApi.cs b/Runtime/SolanaApi/Interfaces/ISolanaApi.cs index 4b8e2bc..1c52771 100644 --- a/Runtime/SolanaApi/Interfaces/ISolanaApi.cs +++ b/Runtime/SolanaApi/Interfaces/ISolanaApi.cs @@ -12,6 +12,8 @@ public interface ISolanaApi /// TokenApi operations. /// INftApi Nft { get; } + + /// /// Indicates that the client has been initialized. diff --git a/Runtime/SolanaApi/Interfaces/ITokenApi.cs b/Runtime/SolanaApi/Interfaces/ITokenApi.cs new file mode 100644 index 0000000..9df1d91 --- /dev/null +++ b/Runtime/SolanaApi/Interfaces/ITokenApi.cs @@ -0,0 +1,10 @@ +using Cysharp.Threading.Tasks; +using MoralisUnity.SolanaApi.Models; + +namespace MoralisUnity.SolanaApi.Interfaces +{ + public interface ITokenApi + { + Unitask GetTokenPrice(string address, NetworkTypes network); + } +} \ No newline at end of file diff --git a/Runtime/SolanaApi/Models/TokenPrice.cs b/Runtime/SolanaApi/Models/TokenPrice.cs new file mode 100644 index 0000000..59300ef --- /dev/null +++ b/Runtime/SolanaApi/Models/TokenPrice.cs @@ -0,0 +1,32 @@ +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace DefaultNamespace +{ + public class TokenPrice + { + [DataContract] + public class TokenPrice + { + + [DataMember(Name = "usdPrice", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "usdPrice")] + public string UsdPrice { get; set; } + + [DataMember(Name = "exchangeName", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "exchangeName")] + public string ExchangeName { get; set; } + + [DataMember(Name = "exchangeAddress", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "exchangeAddress")] + public string ExchangeAddress { get; set; } + + [DataMember(Name = "nativePrice", EmitDefaultValue = false)] + [JsonProperty(PropertyName = "nativePrice")] + public string NativePrice { get; set; } + + + } + + } +} \ No newline at end of file From b0c38bab67f4112831a6ebf7d3dcb7c945cfe409 Mon Sep 17 00:00:00 2001 From: 3scava1i3r Date: Wed, 31 Aug 2022 11:01:16 +0530 Subject: [PATCH 3/8] some .meta files added --- ...countApi.cs.bak.meta => CONTRIBUTE.md.meta | 4 ++-- Runtime/SolanaApi/Api/TokenApi.cs | 3 +-- Runtime/SolanaApi/Api/TokenApi.cs.meta | 11 ++++++++++ Runtime/SolanaApi/CloudApi/TokenApi.cs | 20 +------------------ Runtime/SolanaApi/CloudApi/TokenApi.cs.meta | 11 ++++++++++ .../SolanaApi/Interfaces/ITokenApi.cs.meta | 11 ++++++++++ Runtime/SolanaApi/Models/TokenPrice.cs.meta | 11 ++++++++++ .../Web3Api/Interfaces/INativeApi.cs.bak.meta | 7 ------- .../Web3Api/Interfaces/ITokenApi.cs.bak.meta | 7 ------- 9 files changed, 48 insertions(+), 37 deletions(-) rename Runtime/Web3Api/Interfaces/IAccountApi.cs.bak.meta => CONTRIBUTE.md.meta (62%) create mode 100644 Runtime/SolanaApi/Api/TokenApi.cs.meta create mode 100644 Runtime/SolanaApi/CloudApi/TokenApi.cs.meta create mode 100644 Runtime/SolanaApi/Interfaces/ITokenApi.cs.meta create mode 100644 Runtime/SolanaApi/Models/TokenPrice.cs.meta delete mode 100644 Runtime/Web3Api/Interfaces/INativeApi.cs.bak.meta delete mode 100644 Runtime/Web3Api/Interfaces/ITokenApi.cs.bak.meta diff --git a/Runtime/Web3Api/Interfaces/IAccountApi.cs.bak.meta b/CONTRIBUTE.md.meta similarity index 62% rename from Runtime/Web3Api/Interfaces/IAccountApi.cs.bak.meta rename to CONTRIBUTE.md.meta index 72494da..f631c1b 100644 --- a/Runtime/Web3Api/Interfaces/IAccountApi.cs.bak.meta +++ b/CONTRIBUTE.md.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: 63588f59e24d44b4fb6ee8ea8b93c43c -DefaultImporter: +guid: 7fea776c1ea99cc52a465ac1e617f793 +TextScriptImporter: externalObjects: {} userData: assetBundleName: diff --git a/Runtime/SolanaApi/Api/TokenApi.cs b/Runtime/SolanaApi/Api/TokenApi.cs index dd43ad3..a22f839 100644 --- a/Runtime/SolanaApi/Api/TokenApi.cs +++ b/Runtime/SolanaApi/Api/TokenApi.cs @@ -8,8 +8,7 @@ namespace MoralisUnity.SolanaApi.Api { - public class TokenApi : ITokenApi; - + public class TokenApi : ITokenApi; { /// diff --git a/Runtime/SolanaApi/Api/TokenApi.cs.meta b/Runtime/SolanaApi/Api/TokenApi.cs.meta new file mode 100644 index 0000000..56c8c7d --- /dev/null +++ b/Runtime/SolanaApi/Api/TokenApi.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0a064024394ea02548e19b56c57ef87a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/SolanaApi/CloudApi/TokenApi.cs b/Runtime/SolanaApi/CloudApi/TokenApi.cs index aaa5793..6ec74fb 100644 --- a/Runtime/SolanaApi/CloudApi/TokenApi.cs +++ b/Runtime/SolanaApi/CloudApi/TokenApi.cs @@ -6,10 +6,9 @@ using MoralisUnity.SolanaApi.Interfaces; using MoralisUnity.SolanaApi.Models; -namespace MoralisUnity.SolanaApi.CloudApi +namespace MoralisUnity.SolanaApi.CloudApi; { public class TokenApi : ITokenApi; - { /// @@ -66,23 +65,6 @@ public async UniTask GetTokenPrice(NetworkTypes network, string addr var headerParams = new Dictionary(); - var path = "/token/{network}/{address}/price"; - path = path.Replace("{" + "network" + "}", ApiClient.ParameterToString(network.ToString())); - path = path.Replace("{" + "address" + "}", ApiClient.ParameterToString(address)); - - // Authentication setting, if any - String[] authSettings = new String[] { "ApiKeyAuth" }; - - Tuple, string> response = await ApiClient.CallApi(path, Method.GET, null, null, headerParams, null, null, authSettings); - - if (((int)response.Item1) >= 400) - throw new ApiException((int)response.Item1, "Error calling GetTokenPrice: " + response.Item3, response.Item3); - else if (((int)response.Item1) == 0) - throw new ApiException((int)response.Item1, "Error calling GetTokenPrice: " + response.Item3, response.Item3); - - - return ((CloudFunctionResult)ApiClient.Deserialize(response.Item3, typeof(CloudFunctionResult), response.Item2)).Result; - } diff --git a/Runtime/SolanaApi/CloudApi/TokenApi.cs.meta b/Runtime/SolanaApi/CloudApi/TokenApi.cs.meta new file mode 100644 index 0000000..a550f72 --- /dev/null +++ b/Runtime/SolanaApi/CloudApi/TokenApi.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d629fe6cf58d4c3cd93b42e620c0946b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/SolanaApi/Interfaces/ITokenApi.cs.meta b/Runtime/SolanaApi/Interfaces/ITokenApi.cs.meta new file mode 100644 index 0000000..c171f5c --- /dev/null +++ b/Runtime/SolanaApi/Interfaces/ITokenApi.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c5c9f8c02bbbc69e9954f92a414684c5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/SolanaApi/Models/TokenPrice.cs.meta b/Runtime/SolanaApi/Models/TokenPrice.cs.meta new file mode 100644 index 0000000..2df315f --- /dev/null +++ b/Runtime/SolanaApi/Models/TokenPrice.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dbe755c2ea1e860a7bdc588f7be72f7e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Web3Api/Interfaces/INativeApi.cs.bak.meta b/Runtime/Web3Api/Interfaces/INativeApi.cs.bak.meta deleted file mode 100644 index 48945b7..0000000 --- a/Runtime/Web3Api/Interfaces/INativeApi.cs.bak.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 8f7d359a7d4f8754eb9111eb201692d1 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Runtime/Web3Api/Interfaces/ITokenApi.cs.bak.meta b/Runtime/Web3Api/Interfaces/ITokenApi.cs.bak.meta deleted file mode 100644 index 5d6cd42..0000000 --- a/Runtime/Web3Api/Interfaces/ITokenApi.cs.bak.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: b61bfef82c05e384ca511a87a6527a44 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: From 5d0b22d3cfb6ed2ccc5293f65ce4f5b7340fa4e0 Mon Sep 17 00:00:00 2001 From: 3scava1i3r Date: Wed, 31 Aug 2022 11:52:17 +0530 Subject: [PATCH 4/8] made needed changes --- Runtime/SolanaApi/Api/TokenApi.cs | 3 +- Runtime/SolanaApi/Client/SolanaApiClient.cs | 5 +++ Runtime/SolanaApi/CloudApi/TokenApi.cs | 35 +++++++++++++++++++-- 3 files changed, 39 insertions(+), 4 deletions(-) diff --git a/Runtime/SolanaApi/Api/TokenApi.cs b/Runtime/SolanaApi/Api/TokenApi.cs index a22f839..878c9ab 100644 --- a/Runtime/SolanaApi/Api/TokenApi.cs +++ b/Runtime/SolanaApi/Api/TokenApi.cs @@ -60,7 +60,8 @@ public String GetBasePath(String basePath) public ApiClient ApiClient { get; set; } - public async UniTask GetTokenPrice(NetworkTypes network, string address) { + public async UniTask GetTokenPrice(NetworkTypes network, string address) + { if (address == null) throw new ApiException(400, "Missing required parameter 'address' when calling GetTokenPrice"); var headerParams = new Dictionary(); diff --git a/Runtime/SolanaApi/Client/SolanaApiClient.cs b/Runtime/SolanaApi/Client/SolanaApiClient.cs index 94aefe0..f699396 100644 --- a/Runtime/SolanaApi/Client/SolanaApiClient.cs +++ b/Runtime/SolanaApi/Client/SolanaApiClient.cs @@ -21,6 +21,11 @@ public class SolanaApiClient : ISolanaApi /// DefiApi operations /// public INftApi Nft { get; private set; } + + /// + /// TokenApi operations + /// + public ITokenApi Token { get; private set; } /// /// Indicates that the client has been initialized. diff --git a/Runtime/SolanaApi/CloudApi/TokenApi.cs b/Runtime/SolanaApi/CloudApi/TokenApi.cs index 6ec74fb..00841bc 100644 --- a/Runtime/SolanaApi/CloudApi/TokenApi.cs +++ b/Runtime/SolanaApi/CloudApi/TokenApi.cs @@ -19,9 +19,13 @@ public class TokenApi : ITokenApi; public TokenApi(ApiClient apiClient = null) { if (apiClient == null) // use the default one in Configuration - this.ApiClient = Configuration.DefaultApiClient; + { + this.ApiClient = Configuration.DefaultApiClient; + } else - this.ApiClient = apiClient; + { + this.ApiClient = apiClient; + } } /// @@ -60,11 +64,36 @@ public String GetBasePath(String basePath) public ApiClient ApiClient { get; set; } - public async UniTask GetTokenPrice(NetworkTypes network, string address) { + public async UniTask GetTokenPrice(NetworkTypes network, string address) + { if (address == null) throw new ApiException(400, "Missing required parameter 'address' when calling GetTokenPrice"); var headerParams = new Dictionary(); + var path = "/functions/sol-getTokenPrice"; + postBody.Add("network", ApiClient.ParameterToString(network.ToString())); + if (address != null) postBody.Add("address", ApiClient.ParameterToString(address)); + + // Authentication setting, if any + String[] authSettings = new String[] { "ApiKeyAuth" }; + + string bodyData = postBody.Count > 0 ? JsonConvert.SerializeObject(postBody) : null; + + Tuple, string> response = await ApiClient.CallApi(path, Method.POST, null, bodyData, headerParams, null, null, authSettings); + + if (((int)response.Item1) >= 400) + throw new ApiException((int)response.Item1, "Error calling GetTokenPrice: " + response.Item3, response.Item3); + else if (((int)response.Item1) == 0) + throw new ApiException((int)response.Item1, "Error calling GetTokenPrice: " + response.Item3, response.Item3); + + + return ((CloudFunctionResult)ApiClient.Deserialize(response.Item3, typeof(CloudFunctionResult), response.Item2)).Result; + + + + + + } From 78ed79f98d72c9abf37253ebecee37820ad4983c Mon Sep 17 00:00:00 2001 From: 3scava1i3r Date: Wed, 31 Aug 2022 11:56:42 +0530 Subject: [PATCH 5/8] comments added --- Runtime/SolanaApi/Api/TokenApi.cs | 4 ++++ Runtime/SolanaApi/CloudApi/TokenApi.cs | 4 ++++ Runtime/SolanaApi/Interfaces/ISolanaApi.cs | 7 +++++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Runtime/SolanaApi/Api/TokenApi.cs b/Runtime/SolanaApi/Api/TokenApi.cs index 878c9ab..ca528da 100644 --- a/Runtime/SolanaApi/Api/TokenApi.cs +++ b/Runtime/SolanaApi/Api/TokenApi.cs @@ -8,6 +8,10 @@ namespace MoralisUnity.SolanaApi.Api { + /// + /// Class for TokenApi endpoint under SolanaApi + /// + public class TokenApi : ITokenApi; { diff --git a/Runtime/SolanaApi/CloudApi/TokenApi.cs b/Runtime/SolanaApi/CloudApi/TokenApi.cs index 00841bc..a02b80d 100644 --- a/Runtime/SolanaApi/CloudApi/TokenApi.cs +++ b/Runtime/SolanaApi/CloudApi/TokenApi.cs @@ -8,6 +8,10 @@ namespace MoralisUnity.SolanaApi.CloudApi; { + /// + /// Class for TokenApi endpoint under SolanaApi + /// + public class TokenApi : ITokenApi; { diff --git a/Runtime/SolanaApi/Interfaces/ISolanaApi.cs b/Runtime/SolanaApi/Interfaces/ISolanaApi.cs index 1c52771..b7c9ebe 100644 --- a/Runtime/SolanaApi/Interfaces/ISolanaApi.cs +++ b/Runtime/SolanaApi/Interfaces/ISolanaApi.cs @@ -9,12 +9,15 @@ public interface ISolanaApi IAccountApi Account { get; } /// - /// TokenApi operations. + /// NftApi operations. /// INftApi Nft { get; } + /// + /// TokenApi operations. + /// + ITokenApi Token { get; } - /// /// Indicates that the client has been initialized. /// From abc7cd2ca7e39472cdd929b9db4d12104b7dd7ea Mon Sep 17 00:00:00 2001 From: 3scava1i3r Date: Wed, 31 Aug 2022 13:25:59 +0530 Subject: [PATCH 6/8] done more resolve work --- Runtime/SolanaApi/Api/TokenApi.cs | 10 ++++++---- Runtime/SolanaApi/CloudApi/TokenApi.cs | 7 ------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/Runtime/SolanaApi/Api/TokenApi.cs b/Runtime/SolanaApi/Api/TokenApi.cs index ca528da..08cc114 100644 --- a/Runtime/SolanaApi/Api/TokenApi.cs +++ b/Runtime/SolanaApi/Api/TokenApi.cs @@ -23,9 +23,13 @@ public class TokenApi : ITokenApi; public TokenApi(ApiClient apiClient = null) { if (apiClient == null) // use the default one in Configuration - this.ApiClient = Configuration.DefaultApiClient; + { + this.ApiClient = Configuration.DefaultApiClient; + } else - this.ApiClient = apiClient; + { + this.ApiClient = apiClient; + } } /// @@ -86,8 +90,6 @@ public async UniTask GetTokenPrice(NetworkTypes network, string addr return ((CloudFunctionResult)ApiClient.Deserialize(response.Item3, typeof(CloudFunctionResult), response.Item2)).Result; - - } } diff --git a/Runtime/SolanaApi/CloudApi/TokenApi.cs b/Runtime/SolanaApi/CloudApi/TokenApi.cs index a02b80d..38833e0 100644 --- a/Runtime/SolanaApi/CloudApi/TokenApi.cs +++ b/Runtime/SolanaApi/CloudApi/TokenApi.cs @@ -92,13 +92,6 @@ public async UniTask GetTokenPrice(NetworkTypes network, string addr return ((CloudFunctionResult)ApiClient.Deserialize(response.Item3, typeof(CloudFunctionResult), response.Item2)).Result; - - - - - - - } } From 980214365eaf523e344f5754ba34a80dbbbb739a Mon Sep 17 00:00:00 2001 From: 3scava1i3r Date: Wed, 31 Aug 2022 14:46:00 +0530 Subject: [PATCH 7/8] minor fix --- CONTRIBUTE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTE.md b/CONTRIBUTE.md index 42146a5..47d6903 100644 --- a/CONTRIBUTE.md +++ b/CONTRIBUTE.md @@ -1,6 +1,6 @@ # web3-unity-sdk -The web3uiKit is aimed at helping developers build web3 based unity games fast, delivering a quality DX to our developers plus an inclusive and reliable UX to your end users. +The web3-unity-sdk is aimed at helping developers build web3 based unity games fast, delivering a quality DX to our developers plus an inclusive and reliable UX to your end users. Thank you for taking an interest in contributing   From 58455a72dd7b9c0a015b1ad6ef67b804a943c447 Mon Sep 17 00:00:00 2001 From: 3scava1i3r Date: Wed, 31 Aug 2022 15:02:17 +0530 Subject: [PATCH 8/8] small namespace change --- Runtime/SolanaApi/Models/TokenPrice.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Runtime/SolanaApi/Models/TokenPrice.cs b/Runtime/SolanaApi/Models/TokenPrice.cs index 59300ef..9385db7 100644 --- a/Runtime/SolanaApi/Models/TokenPrice.cs +++ b/Runtime/SolanaApi/Models/TokenPrice.cs @@ -1,7 +1,7 @@ using System.Runtime.Serialization; using Newtonsoft.Json; -namespace DefaultNamespace +namespace MoralisUnity.SolanaApi.Models { public class TokenPrice {