Skip to content

Commit c2e03cb

Browse files
committed
.NET SDK 2.1.0 // Ecosystem Linking, Guest & Line Login
1 parent 00a6084 commit c2e03cb

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed
14 KB
Binary file not shown.

Assets/Thirdweb/Runtime/Unity/ThirdwebManager.cs

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,8 @@ public async Task<IThirdwebWallet> ConnectWallet(WalletOptions walletOptions)
294294
email: walletOptions.InAppWalletOptions.Email,
295295
phoneNumber: walletOptions.InAppWalletOptions.PhoneNumber,
296296
authProvider: walletOptions.InAppWalletOptions.AuthProvider,
297-
storageDirectoryPath: walletOptions.InAppWalletOptions.StorageDirectoryPath
297+
storageDirectoryPath: walletOptions.InAppWalletOptions.StorageDirectoryPath,
298+
siweSigner: walletOptions.InAppWalletOptions.SiweSigner
298299
);
299300
break;
300301
case WalletProvider.EcosystemWallet:
@@ -313,7 +314,8 @@ public async Task<IThirdwebWallet> ConnectWallet(WalletOptions walletOptions)
313314
email: walletOptions.EcosystemWalletOptions.Email,
314315
phoneNumber: walletOptions.EcosystemWalletOptions.PhoneNumber,
315316
authProvider: walletOptions.EcosystemWalletOptions.AuthProvider,
316-
storageDirectoryPath: walletOptions.EcosystemWalletOptions.StorageDirectoryPath
317+
storageDirectoryPath: walletOptions.EcosystemWalletOptions.StorageDirectoryPath,
318+
siweSigner: walletOptions.EcosystemWalletOptions.SiweSigner
317319
);
318320
break;
319321
case WalletProvider.WalletConnectWallet:
@@ -348,6 +350,10 @@ public async Task<IThirdwebWallet> ConnectWallet(WalletOptions walletOptions)
348350
{
349351
_ = await inAppWallet.LoginWithAuthEndpoint(walletOptions.InAppWalletOptions.JwtOrPayload, walletOptions.InAppWalletOptions.EncryptionKey);
350352
}
353+
else if (walletOptions.InAppWalletOptions.AuthProvider == AuthProvider.Guest)
354+
{
355+
_ = await inAppWallet.LoginWithGuest();
356+
}
351357
else
352358
{
353359
_ = await inAppWallet.LoginWithOauth(
@@ -382,6 +388,10 @@ public async Task<IThirdwebWallet> ConnectWallet(WalletOptions walletOptions)
382388
{
383389
_ = await ecosystemWallet.LoginWithAuthEndpoint(walletOptions.EcosystemWalletOptions.JwtOrPayload);
384390
}
391+
else if (walletOptions.EcosystemWalletOptions.AuthProvider == AuthProvider.Guest)
392+
{
393+
_ = await ecosystemWallet.LoginWithGuest();
394+
}
385395
else
386396
{
387397
_ = await ecosystemWallet.LoginWithOauth(
@@ -472,6 +482,21 @@ public async Task<List<LinkedAccount>> LinkAccount(InAppWallet mainWallet, InApp
472482
);
473483
}
474484

485+
public async Task<List<LinkedAccount>> LinkAccount(EcosystemWallet mainWallet, EcosystemWallet walletToLink, string otp = null, BigInteger? chainId = null, string jwtOrPayload = null)
486+
{
487+
return await mainWallet.LinkAccount(
488+
walletToLink: walletToLink,
489+
otp: otp,
490+
isMobile: Application.isMobilePlatform,
491+
browserOpenAction: (url) => Application.OpenURL(url),
492+
mobileRedirectScheme: BundleId + "://",
493+
browser: new CrossPlatformUnityBrowser(),
494+
chainId: chainId,
495+
jwt: jwtOrPayload,
496+
payload: jwtOrPayload
497+
);
498+
}
499+
475500
private async void TrackUsage(string source, string action, string walletType, string walletAddress)
476501
{
477502
if (string.IsNullOrEmpty(source) || string.IsNullOrEmpty(action) || string.IsNullOrEmpty(walletType) || string.IsNullOrEmpty(walletAddress))

0 commit comments

Comments
 (0)