Skip to content

Commit

Permalink
feat: Adds feature - Transaction Data | Account
Browse files Browse the repository at this point in the history
  • Loading branch information
saszer committed Jun 9, 2022
1 parent fac3856 commit e32f4d1
Show file tree
Hide file tree
Showing 13 changed files with 435 additions and 15 deletions.
20 changes: 13 additions & 7 deletions Editor/FeatureSpawner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,42 +48,48 @@ static void Spawn_StorageMetadata()

[MenuItem(PortConstants.BaseFeatureSpawnerMenu + PortConstants.FeatureName_AssetDownloader)]
[MenuItem(GameObjMenu + PortConstants.FeatureName_AssetDownloader)]
static void FeatureName_AssetDownloader()
static void Spawn_AssetDownloader()
{
Selection.activeGameObject= new GameObject(PortConstants.FeatureName_AssetDownloader).AddComponent<AssetDownloader>().gameObject;
}

[MenuItem(PortConstants.BaseFeatureSpawnerMenu + PortConstants.FeatureName_ConnectUserWallet)]
[MenuItem(GameObjMenu + PortConstants.FeatureName_ConnectUserWallet)]
static void FeatureName_ConnectWallet()
static void Spawn_ConnectWallet()
{
Selection.activeGameObject= new GameObject(PortConstants.FeatureName_ConnectUserWallet).AddComponent<ConnectPlayerWallet>().gameObject;
}

[MenuItem(PortConstants.BaseFeatureSpawnerMenu + PortConstants.FeatureName_Mint_Custom)]
[MenuItem(GameObjMenu + PortConstants.FeatureName_Mint_Custom)]
static void FeatureName_Mint_Custom()
static void Spawn_Mint_Custom()
{
Selection.activeGameObject= new GameObject(PortConstants.FeatureName_Mint_Custom).AddComponent<Mint_Custom>().gameObject;
}

[MenuItem(PortConstants.BaseFeatureSpawnerMenu + PortConstants.FeatureName_Mint_URL)]
[MenuItem(GameObjMenu + PortConstants.FeatureName_Mint_URL)]
static void FeatureName_Mint_URL()
static void Spawn_Mint_URL()
{
Selection.activeGameObject= new GameObject(PortConstants.FeatureName_Mint_URL).AddComponent<Mint_URL>().gameObject;
}
/*
[MenuItem(PortConstants.BaseFeatureSpawnerMenu + PortConstants.FeatureName_Deploy)]
[MenuItem(GameObjMenu + PortConstants.FeatureName_Deploy)]
static void FeatureName_Deploy()
static void Spawn_Deploy()
{
Selection.activeGameObject= new GameObject(PortConstants.FeatureName_Deploy).AddComponent<Deploy>().gameObject;
}
*/

[MenuItem(PortConstants.BaseFeatureSpawnerMenu + PortConstants.FeatureName_Txn_Account)]
[MenuItem(GameObjMenu + PortConstants.FeatureName_Txn_Account)]
static void Spawn_Txn_Account()
{
Selection.activeGameObject= new GameObject(PortConstants.FeatureName_Txn_Account).AddComponent<Txn_Account>().gameObject;
}




}

}
3 changes: 0 additions & 3 deletions Editor/Resources/c_tx.psd

This file was deleted.

3 changes: 3 additions & 0 deletions Editor/Resources/c_tx_account.psd
Git LFS file not shown
File renamed without changes.
3 changes: 3 additions & 0 deletions Editor/Resources/c_txn.psd
Git LFS file not shown
134 changes: 134 additions & 0 deletions Editor/Resources/c_txn.psd.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions Editor/Txn_Account_Editor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using UnityEngine;

namespace NFTPort.Editor
{
using UnityEditor;
using Internal;

[CustomEditor(typeof(Txn_Account))]
public class Txn_Account_Editor : Editor
{
public override void OnInspectorGUI()
{

Txn_Account myScript = (Txn_Account)target;


Texture banner = Resources.Load<Texture>("c_tx_account");
GUILayout.BeginHorizontal();
GUILayout.Box(banner);
GUILayout.EndHorizontal();

if (GUILayout.Button("Get Account NFT TXNs", GUILayout.Height(45)))
{
myScript.Run();
}


if(GUILayout.Button("View Documentation", GUILayout.Height(25)))
Application.OpenURL(PortConstants.Docs_Txns_Account);
DrawDefaultInspector();
}
}
}

11 changes: 11 additions & 0 deletions Editor/Txn_Account_Editor.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Runtime/Internal/PortConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ public static class PortConstants
public const string Docs_AssetDownloader = "https://docs.nftport.xyz/docs/nftport/ZG9jOjU2NjAzOTE0-asset-downloader";
public const string Docs_ConnectUserWallet = "https://docs.nftport.xyz/docs/nftport/ZG9jOjU3MTU2NTE5-player-wallet-connect";
public const string Docs_DeployContract = "https://docs.nftport.xyz/docs/nftport/ZG9jOjYzOTc1Mzgw-deploy-contract";

public const string Docs_Txns_Account = "https://docs.nftport.xyz/docs/nftport/ZG9jOjYzOTc1Mzgw-deploy-contract";


public const string DiscordInvite = "https://discord.gg/w92sXkNmBR";
Expand All @@ -34,6 +36,7 @@ public static class PortConstants
public const string FeatureName_Mint_Custom = "Mint | Customizable minting";
public const string FeatureName_Mint_URL = "Mint | Easy mint using URL";
public const string FeatureName_Deploy = "Deploy Contract";
public const string FeatureName_Txn_Account = "Transaction Data | Account";

}
}
Expand Down
2 changes: 1 addition & 1 deletion Runtime/Internal/models/Txn_model.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class Txn_model
{
public string response ;
public Statistics statistics ;
public Transactions transactions ;
public Transactions[] transactions ;
public string continuation ;
}

Expand Down
8 changes: 4 additions & 4 deletions Runtime/NFT_Details.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public static NFT_Details Initialize(bool destroyAtEnd = true)
}

/// <summary>
/// Set Parameters to retrieve NFT From
/// Set Parameters to retrieve NFT From. ≧◔◡◔≦ .
/// </summary>
/// <param name="contract_address"> as string.</param>
/// <param name="token_id"> as int.</param>
Expand All @@ -123,7 +123,7 @@ public NFT_Details SetChain(Chains chain)
}

/// <summary>
/// Action on successful API Fetch.
/// Action on successful API Fetch. (*^∇^)ヾ( ̄▽ ̄*)
/// </summary>
/// <param name="NFTs_OwnedByAnAccount_model.Root"> Use: .OnComplete(NFTs=> NFTsOfUser = NFTs) , where NFTsOfUser = NFTs_OwnedByAnAccount_model.Root;</param>
/// <returns> NFTs_OwnedByAnAccount_model.Root </returns>
Expand All @@ -134,7 +134,7 @@ public NFT_Details OnComplete(UnityAction<NFTs_model> action)
}

/// <summary>
/// Action on Error
/// Action on Error (⊙.◎)
/// </summary>
/// <param name="UnityAction action"> string.</param>
/// <returns> Information on Error as string text.</returns>
Expand Down Expand Up @@ -186,7 +186,7 @@ IEnumerator CallAPIProcess()
if(OnErrorAction!=null)
OnErrorAction($"Null data. Response code: {request.responseCode}. Result {jsonResult}");
if(debugErrorLog)
Debug.Log($"Null data. Response code: {request.responseCode}. Result {jsonResult}");
Debug.Log($"(⊙.◎) Null data. Response code: {request.responseCode}. Result {jsonResult}");
if(afterError!=null)
afterError.Invoke();
//yield break;
Expand Down
Loading

0 comments on commit e32f4d1

Please sign in to comment.