Skip to content

Commit

Permalink
feat: update marketplace package
Browse files Browse the repository at this point in the history
  • Loading branch information
nattb8 committed Jan 28, 2025
1 parent c1a31bf commit 6cb4661
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
20 changes: 8 additions & 12 deletions Assets/Shared/Scripts/UI/AddFunds/AddFunds.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
using System;
using UnityEngine;
using UnityEngine.UI;
using System.Collections.Generic;
using System.Linq;
using Immutable.Marketplace.Bridge;
using Immutable.Marketplace.OnRamp;
using Immutable.Marketplace.Swap;
using Immutable.Marketplace;
using Immutable.Passport;
using Environment = Immutable.Marketplace.Environment;

namespace HyperCasual.Runner
{
Expand Down Expand Up @@ -52,8 +50,8 @@ private async void OnFiatButtonClicked()
var email = await Passport.Instance.GetEmail();
var walletAddress = await Passport.Instance.ZkEvmRequestAccounts();

var onRamp = new OnRamp(environment, email, walletAddress.FirstOrDefault());
var link = onRamp.GetLink();
var link = LinkFactory.GenerateOnRampLink(Environment.Sandbox, email, walletAddress.FirstOrDefault(),
cryptoCurrency: "USDC");
Debug.Log($"onRamp.GetOnRampLink: {link}");

m_TransakView.Show(link, () =>
Expand All @@ -65,16 +63,14 @@ private async void OnFiatButtonClicked()

private void OnSwapButtonClicked()
{
var swap = new Swap(Immutable.Passport.Model.Environment.SANDBOX);
var link = swap.GetLink(fromTokenAddress: Contract.USDC, toTokenAddress: Contract.TOKEN);
var link = LinkFactory.GenerateSwapLink(Environment.Sandbox, "pk_imapik-test-GrVY_g7JLzY2JKZy@ec-",
fromTokenAddress: Contract.USDC, toTokenAddress: Contract.TOKEN);
Application.OpenURL(link);
}

private void OnBridgeButtonClicked()
{
// On supports mainnet
var bridge = new Bridge(Immutable.Passport.Model.Environment.PRODUCTION);
var link = bridge.GetLink(toChain: "13371");
var link = LinkFactory.GenerateBridgeLink(Environment.Sandbox, toChainID: "13371");
Application.OpenURL(link);
}

Expand All @@ -86,4 +82,4 @@ private void OnCancelButtonClicked()
m_OnDismiss();
}
}
}
}
4 changes: 2 additions & 2 deletions Packages/packages-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"dependencies": {
"com.unity.nuget.newtonsoft-json": "3.0.2"
},
"hash": "daf0a1b029979053349efec7c382ef3e0dea27a4"
"hash": "62db9e356dc8141fbc871ed04cbe16b750b06086"
},
"com.immutable.marketplace": {
"version": "https://github.com/immutable/unity-immutable-sdk.git?path=/src/Packages/Marketplace",
Expand All @@ -23,7 +23,7 @@
"dependencies": {
"com.cysharp.unitask": "2.3.3"
},
"hash": "4a4c96fad53e7f0c40ac73e68e564b131e1a6d4a"
"hash": "96d4c5079869c77377495520432427ea7212f2ef"
},
"com.immutable.orderbook": {
"version": "https://github.com/immutable/unity-immutable-sdk.git?path=/src/Packages/Orderbook",
Expand Down

0 comments on commit 6cb4661

Please sign in to comment.