Skip to content

Commit

Permalink
style: fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
nattb8 committed Jan 19, 2025
1 parent b38eb26 commit c1a31bf
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 27 deletions.
6 changes: 3 additions & 3 deletions Assets/Shared/Scripts/Domain/GetTokenBalanceUseCase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ public async UniTask<string> GetBalance()
var rounded = Math.Round(Convert.ToDecimal(result.Quantity), 2);
return rounded.ToString("F2");
}

/// <summary>
/// Gets the user's IMX balance
/// </summary>
public async UniTask<string> GetImxBalance()
{
var balanceHex = await Passport.Instance.ZkEvmGetBalance(SaveManager.Instance.WalletAddress);

var balance = BigInteger.Parse(balanceHex.Replace("0x", ""), NumberStyles.HexNumber);

// Convert from smallest unit to main unit
Expand All @@ -49,7 +49,7 @@ public async UniTask<string> GetImxBalance()

return roundedValue.ToString("F2");
}

/// <summary>
/// Gets the user's USDC balance
/// </summary>
Expand Down
6 changes: 3 additions & 3 deletions Assets/Shared/Scripts/Model/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ public static class Config
// public const string SERVER_URL = "http://localhost:6060";

public const string CLIENT_ID = "mp6rxfMDwwZDogcdgNrAaHnG0qMlXuMK"; // Testnet
// public const string CLIENT_ID = "UnB98ngnXIZIEJWGJOjVe1BpCx5ix7qc"; // WebGL
// public const string CLIENT_ID = "UnB98ngnXIZIEJWGJOjVe1BpCx5ix7qc"; // WebGL

public const string ENVIRONMENT = "sandbox";

#if (UNITY_ANDROID && !UNITY_EDITOR_WIN) || (UNITY_IPHONE && !UNITY_EDITOR_WIN) || UNITY_STANDALONE_OSX
Expand Down Expand Up @@ -42,7 +42,7 @@ public static class Contract
public const string SKIN = "0xc8df1b1693e2beffd2e484a825a357c6a3d998f2"; // Testnet team
public const string TOKEN = "0xb237501b35dfdcad274299236a141425469ab9ba"; // Testnet team
public const string PACK = "0x8525b5e782f3fbe6460057460be020146b63ed0f"; // Testnet team

public const string USDC = "0x3B2d8A1931736Fc321C24864BceEe981B11c3c57"; // Transak Testnet USDC
}
}
16 changes: 8 additions & 8 deletions Assets/Shared/Scripts/UI/AddFunds/AddFunds.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,27 @@ public class AddFunds : MonoBehaviour
[SerializeField] Button m_SwapButton;
[SerializeField] Button m_BridgeButton;
[SerializeField] Button m_CancelButton;

[SerializeField] TransakView m_TransakView;

private Action m_OnDismiss;

public void Show(Action onDismiss)
{
m_OnDismiss = onDismiss;

m_FiatButton.onClick.RemoveListener(OnFiatButtonClicked);
m_FiatButton.onClick.AddListener(OnFiatButtonClicked);

m_SwapButton.onClick.RemoveListener(OnSwapButtonClicked);
m_SwapButton.onClick.AddListener(OnSwapButtonClicked);

m_BridgeButton.onClick.RemoveListener(OnBridgeButtonClicked);
m_BridgeButton.onClick.AddListener(OnBridgeButtonClicked);

m_CancelButton.onClick.RemoveListener(OnCancelButtonClicked);
m_CancelButton.onClick.AddListener(OnCancelButtonClicked);

m_Options.gameObject.SetActive(true);
m_TransakView.gameObject.SetActive(false);
gameObject.SetActive(true);
Expand All @@ -51,7 +51,7 @@ private async void OnFiatButtonClicked()
const string environment = Immutable.Passport.Model.Environment.SANDBOX;
var email = await Passport.Instance.GetEmail();
var walletAddress = await Passport.Instance.ZkEvmRequestAccounts();

var onRamp = new OnRamp(environment, email, walletAddress.FirstOrDefault());
var link = onRamp.GetLink();
Debug.Log($"onRamp.GetOnRampLink: {link}");
Expand All @@ -69,7 +69,7 @@ private void OnSwapButtonClicked()
var link = swap.GetLink(fromTokenAddress: Contract.USDC, toTokenAddress: Contract.TOKEN);
Application.OpenURL(link);
}

private void OnBridgeButtonClicked()
{
// On supports mainnet
Expand Down
4 changes: 2 additions & 2 deletions Assets/Shared/Scripts/UI/AddFunds/TransakView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ public void Show(string url, UnityAction onClose)
{
m_CloseButton.onClick.RemoveListener(onClose);
m_CloseButton.onClick.AddListener(onClose);

m_Url = url;
m_WebViewPrefab.InitialUrl = m_Url;

gameObject.SetActive(true);
}
}
Expand Down
14 changes: 7 additions & 7 deletions Assets/Shared/Scripts/UI/BalanceObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class BalanceObject : MonoBehaviour
[SerializeField] private TextMeshProUGUI m_ImrValue;
[SerializeField] private TextMeshProUGUI m_ImxValue;
[SerializeField] private TextMeshProUGUI m_UsdcValue;

[SerializeField] private HyperCasualButton m_AddFundsButton;
[SerializeField] private AddFunds m_AddFunds;

Expand Down Expand Up @@ -58,7 +58,7 @@ private void Start()

gameObject.SetActive(true);
}

/// <summary>
/// Displays or closes the panel
/// </summary>
Expand All @@ -69,7 +69,7 @@ private void TogglePanel()
m_Panel.SetActive(false);
return;
}

// Update balance
#pragma warning disable CS4014
UpdateBalance();
Expand All @@ -85,7 +85,7 @@ private void TogglePanel()
panelRectTransform.pivot = new Vector2(1, 1);

panelRectTransform.anchoredPosition = new Vector2(-32, -88);

m_Panel.SetActive(true);
}

Expand All @@ -97,7 +97,7 @@ private void ShowAddFunds()
#pragma warning disable CS4014
m_AddFunds.Show(() => UpdateBalance());
#pragma warning restore CS4014

TogglePanel();
}

Expand All @@ -114,11 +114,11 @@ private void ShowAddFunds()
// IMR balance
var imrBalance = await GetTokenBalanceUseCase.Instance.GetBalance();
m_ImrValue.text = imrBalance;

// IMX balance
var imxBalance = await GetTokenBalanceUseCase.Instance.GetImxBalance();
m_ImxValue.text = imxBalance;

// USDC balance
var usdcBalance = await GetTokenBalanceUseCase.Instance.GetUsdcBalance();
m_UsdcValue.text = usdcBalance;
Expand Down
2 changes: 1 addition & 1 deletion Assets/Shared/Scripts/UI/Inventory/InventoryScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ private void OnCreateItemView(int index, GameObject item)
clickable.OnClick += () =>
{
m_Balance.ClosePanel();

var view = UIManager.Instance.GetView<InventoryAssetDetailsView>();
UIManager.Instance.Show(view);
view.Initialise(asset);
Expand Down
2 changes: 1 addition & 1 deletion Assets/Shared/Scripts/UI/Marketplace/MarketplaceScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ private void OnCreateItemView(int index, GameObject item)
clickable.OnClick += () =>
{
m_Balance.ClosePanel();

var view = UIManager.Instance.GetView<MarketplaceAssetDetailsView>();
UIManager.Instance.Show(view);
view.Initialise(stack);
Expand Down
4 changes: 2 additions & 2 deletions Assets/Shared/Scripts/UI/Shop/ShopScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ private void OnCreateItemView(int index, GameObject item)
clickable.OnClick += () =>
{
m_Balance.ClosePanel();

var view = UIManager.Instance.GetView<PackDetailsView>();
UIManager.Instance.Show(view);
view.Initialise(pack);
Expand Down Expand Up @@ -138,7 +138,7 @@ private void OnBackButtonClick()

// Trigger back button event
m_BackEvent.Raise();

// Close balance panel
m_Balance.ClosePanel();
}
Expand Down

0 comments on commit c1a31bf

Please sign in to comment.