Skip to content

Commit 5aaa3cb

Browse files
Merge remote-tracking branch 'origin/master' into Fix/betterUrlSchemeCheck
2 parents 4103eba + be4084e commit 5aaa3cb

File tree

6 files changed

+64
-1
lines changed

6 files changed

+64
-1
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ public enum Chain
6161
TestnetEtherlink = 128123,
6262
TestnetMonad = 10143,
6363
TestnetSomnia = 50312,
64+
TestnetFrequency = 53716,
6465

6566
TestnetXaiSepolia = -1, // Xai Sepolia's testnet's chain ID is too large to fit inside an int
6667

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public static class ChainDictionaries
5858
{ Chain.TestnetEtherlink, "Etherlink Testnet" },
5959
{ Chain.TestnetMonad, "Monad Testnet" },
6060
{ Chain.TestnetSomnia, "Somnia Testnet" },
61+
{ Chain.TestnetFrequency, "Frequency Testnet" },
6162
};
6263

6364
public static Dictionary<Chain, string> GasCurrencyOf = new Dictionary<Chain, string>()
@@ -114,6 +115,7 @@ public static class ChainDictionaries
114115
{ Chain.TestnetEtherlink, "XTZ" },
115116
{ Chain.TestnetMonad, "MON" },
116117
{ Chain.TestnetSomnia, "STT" },
118+
{ Chain.TestnetFrequency, "BERA" },
117119
};
118120

119121
public static Dictionary<Chain, string> NativeTokenAddressOf = new Dictionary<Chain, string>()
@@ -203,6 +205,7 @@ public static class ChainDictionaries
203205
{ Chain.TestnetEtherlink, "https://testnet.explorer.etherlink.com/" },
204206
{ Chain.TestnetMonad, "https://testnet.monadexplorer.com/" },
205207
{ Chain.TestnetSomnia, "https://somnia-testnet.socialscan.io/" },
208+
{ Chain.TestnetFrequency, "https://explorer.frequency.zeeve.net/" },
206209
};
207210

208211
public static Dictionary<Chain, string> ChainIdOf = new Dictionary<Chain, string>()
@@ -261,6 +264,7 @@ public static class ChainDictionaries
261264
{ Chain.TestnetEtherlink, "128123" },
262265
{ Chain.TestnetMonad, "10143" },
263266
{ Chain.TestnetSomnia, "50312" },
267+
{ Chain.TestnetFrequency, "53716" },
264268
};
265269

266270
public static Dictionary<string, Chain> ChainById = new Dictionary<string, Chain>()
@@ -317,6 +321,7 @@ public static class ChainDictionaries
317321
{ "128123", Chain.TestnetEtherlink },
318322
{ "10143", Chain.TestnetMonad },
319323
{ "50312", Chain.TestnetSomnia },
324+
{ "53716", Chain.TestnetFrequency },
320325
};
321326

322327
public static Dictionary<Chain, string> PathOf = new Dictionary<Chain, string>()
@@ -373,6 +378,7 @@ public static class ChainDictionaries
373378
{ Chain.TestnetEtherlink, "etherlink-testnet" },
374379
{ Chain.TestnetMonad, "monad-testnet" },
375380
{ Chain.TestnetSomnia, "somnia-testnet" },
381+
{ Chain.TestnetFrequency, "frequency-testnet" },
376382
};
377383
}
378384
}

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

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,36 @@ public static CollectibleOrder GetCollectibleOrder(this CollectibleOrder[] colle
6262

6363
return null;
6464
}
65+
66+
public static bool CheckSameCollectible(this CollectibleOrder[] orders)
67+
{
68+
int length = orders.Length;
69+
if (length == 0)
70+
{
71+
return true;
72+
}
73+
74+
Collectible collectible = new Collectible(new Address(orders[0].order.collectionContractAddress), orders[0].order.tokenId);
75+
for (int i = 1; i < length; i++)
76+
{
77+
if (orders[i].order.collectionContractAddress != collectible.Contract || orders[i].order.tokenId != collectible.TokenId)
78+
{
79+
return false;
80+
}
81+
}
82+
return true;
83+
}
84+
85+
private class Collectible
86+
{
87+
public Address Contract;
88+
public string TokenId;
89+
90+
public Collectible(Address contract, string tokenId)
91+
{
92+
Contract = contract;
93+
TokenId = tokenId;
94+
}
95+
}
6596
}
6697
}

Packages/Sequence-Unity/Sequence/SequenceSDK/Pay/Sardine/SardineCheckout.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,21 @@ public async Task OnRampAsync()
161161
private async Task<SardineNFTCheckout> SardineGetNFTCheckoutToken(CollectibleOrder[] orders, Address recipient,
162162
BigInteger quantity, Step step, Address marketplaceContractAddress)
163163
{
164+
if (quantity <= 0)
165+
{
166+
throw new ArgumentException($"{nameof(quantity)} must be greater than 0");
167+
}
168+
169+
if (orders == null || orders.Length == 0)
170+
{
171+
throw new ArgumentNullException(nameof(orders));
172+
}
173+
174+
if (!orders.CheckSameCollectible())
175+
{
176+
throw new ArgumentException("The provided collectible orders are not for the same collectible as expected");
177+
}
178+
164179
CollectibleOrder order = orders[0];
165180
string priceSymbol = ChainDictionaries.GasCurrencyOf[_chain];
166181
string currencyAddress = order.order.priceCurrencyAddress;

Packages/Sequence-Unity/Sequence/SequenceSDK/Pay/Transak/TransakNFTCheckout.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,16 @@ public async Task<string> GetNFTCheckoutLink(CollectibleOrder[] collectibleOrder
175175
{
176176
throw new ArgumentException($"{nameof(quantity)} must be greater than 0");
177177
}
178+
179+
if (collectibleOrder == null || collectibleOrder.Length == 0)
180+
{
181+
throw new ArgumentNullException(nameof(collectibleOrder));
182+
}
183+
184+
if (!collectibleOrder.CheckSameCollectible())
185+
{
186+
throw new ArgumentException("The provided collectible orders are not for the same collectible as expected");
187+
}
178188

179189
Order order = collectibleOrder[0].order;
180190
TokenMetadata metadata = collectibleOrder[0].metadata;

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.0.7",
3+
"version": "4.1.1",
44
"displayName": "Sequence Embedded Wallet SDK",
55
"description": "A Unity SDK for Sequence APIs",
66
"unity": "2021.3",

0 commit comments

Comments
 (0)