Skip to content

Commit e868dc4

Browse files
authored
Merge pull request #319 from 0xsequence/Fix/swap-response-ios
Fixed swap response converter on ios
2 parents 2695852 + 8f824fa commit e868dc4

File tree

6 files changed

+16
-7
lines changed

6 files changed

+16
-7
lines changed

Packages/Sequence-Unity/Sequence/SequenceSDK/EmbeddedWallet/EOAWalletLinker.cs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Collections.Generic;
33
using System.Threading.Tasks;
44
using UnityEngine;
5+
using UnityEngine.Scripting;
56

67
namespace Sequence.EmbeddedWallet
78
{
@@ -109,7 +110,8 @@ public async Task OpenEoaWalletLink()
109110
}
110111
}
111112

112-
internal class LinkedWalletsRequestData
113+
[Preserve]
114+
public class LinkedWalletsRequestData
113115
{
114116
public string signatureChainId;
115117
public string parentWalletAddress;
@@ -118,11 +120,13 @@ internal class LinkedWalletsRequestData
118120
public string linkedWalletAddress;
119121
}
120122

121-
internal class LinkedWalletsResponseData
123+
[Preserve]
124+
public class LinkedWalletsResponseData
122125
{
123126
public LinkedWalletData[] linkedWallets;
124127
}
125128

129+
[Preserve]
126130
public class LinkedWalletData
127131
{
128132
public int id;
@@ -132,21 +136,23 @@ public class LinkedWalletData
132136
public string createdAt;
133137
}
134138

135-
internal class NonceRequestData
139+
public class NonceRequestData
136140
{
137141
public string walletAddress;
138142

143+
[Preserve]
139144
public NonceRequestData(string walletAddress)
140145
{
141146
this.walletAddress = walletAddress;
142147
}
143148
}
144149

145-
internal class NonceResponseData
150+
public class NonceResponseData
146151
{
147152
public string nonce;
148153
public string verificationUrl;
149154

155+
[Preserve]
150156
public NonceResponseData(string nonce, string verificationUrl)
151157
{
152158
this.nonce = nonce;

Packages/Sequence-Unity/Sequence/SequenceSDK/Ethereum/Token.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ public Token(BigInteger chainId, string contractAddress, string tokenId = null,
5454
}
5555
}
5656

57+
[Preserve]
5758
internal class TokenConverter : JsonConverter<Token>
5859
{
5960
public override void WriteJson(JsonWriter writer, Token value, JsonSerializer serializer)

Packages/Sequence-Unity/Sequence/SequenceSDK/Marketplace/DataTypes/SwapPrice.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public class SwapPrice
1515
[Obsolete("To retrieve the transaction value, please request a Swap Quote instead")]
1616
public string transactionValue;
1717

18+
[Preserve]
1819
public SwapPrice(Address currencyAddress, string currencyBalance, string price, string maxPrice, string transactionValue)
1920
{
2021
this.currencyAddress = currencyAddress;

Packages/Sequence-Unity/Sequence/SequenceSDK/Marketplace/TransferFundsViaQR.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System.Globalization;
12
using System.Threading.Tasks;
23
using UnityEngine;
34
using UnityEngine.UI;
@@ -26,7 +27,7 @@ public async void Checkout()
2627
if (_order != null)
2728
{
2829
//Price must be converted into specific ScientificNotation format following eip-681 standard (see below)
29-
await SetQrCode((int)_order.order.chainId, _wallet.GetWalletAddress(), PriceValuetoEIP618Standard(float.Parse(_order.order.priceAmount)));
30+
await SetQrCode((int)_order.order.chainId, _wallet.GetWalletAddress(), PriceValuetoEIP618Standard(float.Parse(_order.order.priceAmount, CultureInfo.InvariantCulture)));
3031
_qrPanel.SetActive(true);
3132
}
3233
else Debug.LogError("Collectible order not set for checkout option.");

Packages/Sequence-Unity/Sequence/SequenceSDK/Utils/DecimalNormalizer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public static string ReturnToNormalString(BigInteger x, int decimals = 18)
7171
/// <returns></returns>
7272
public static float ReturnToNormal(BigInteger x, int decimals = 18)
7373
{
74-
return float.Parse(ReturnToNormalString(x, decimals));
74+
return float.Parse(ReturnToNormalString(x, decimals), CultureInfo.InvariantCulture);
7575
}
7676

7777
/// <summary>

Packages/Sequence-Unity/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "xyz.0xsequence.waas-unity",
3-
"version": "4.3.0",
3+
"version": "4.3.1",
44
"displayName": "Sequence Embedded Wallet SDK",
55
"description": "A Unity SDK for Sequence APIs",
66
"unity": "2021.3",

0 commit comments

Comments
 (0)