Skip to content

Commit 1d5b969

Browse files
committed
pass siwe ids in iaw/eco opts
1 parent 0f10ab3 commit 1d5b969

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

Assets/Thirdweb/Runtime/Unity/ThirdwebManagerBase.cs

+16-8
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ public InAppWalletOptions(
3030
string storageDirectoryPath = null,
3131
IThirdwebWallet siweSigner = null,
3232
string legacyEncryptionKey = null,
33-
string walletSecret = null
33+
string walletSecret = null,
34+
List<string> forceSiweExternalWalletIds = null
3435
)
3536
: base(
3637
email: email,
@@ -40,7 +41,8 @@ public InAppWalletOptions(
4041
storageDirectoryPath: storageDirectoryPath,
4142
siweSigner: siweSigner,
4243
legacyEncryptionKey: legacyEncryptionKey,
43-
walletSecret: walletSecret
44+
walletSecret: walletSecret,
45+
forceSiweExternalWalletIds: forceSiweExternalWalletIds
4446
) { }
4547
}
4648

@@ -77,6 +79,9 @@ public class EcosystemWalletOptions
7779
[JsonProperty("walletSecret")]
7880
public string WalletSecret;
7981

82+
[JsonProperty("forceSiweExternalWalletIds")]
83+
public List<string> ForceSiweExternalWalletIds;
84+
8085
public EcosystemWalletOptions(
8186
string ecosystemId = null,
8287
string ecosystemPartnerId = null,
@@ -87,7 +92,8 @@ public EcosystemWalletOptions(
8792
string storageDirectoryPath = null,
8893
IThirdwebWallet siweSigner = null,
8994
string legacyEncryptionKey = null,
90-
string walletSecret = null
95+
string walletSecret = null,
96+
List<string> forceSiweExternalWalletIds = null
9197
)
9298
{
9399
EcosystemId = ecosystemId;
@@ -100,6 +106,7 @@ public EcosystemWalletOptions(
100106
SiweSigner = siweSigner;
101107
LegacyEncryptionKey = legacyEncryptionKey;
102108
WalletSecret = walletSecret;
109+
ForceSiweExternalWalletIds = forceSiweExternalWalletIds;
103110
}
104111
}
105112

@@ -215,9 +222,6 @@ public abstract class ThirdwebManagerBase : MonoBehaviour
215222
[field: SerializeField]
216223
protected List<RpcOverride> RpcOverrides { get; set; } = null;
217224

218-
[field: SerializeField]
219-
protected List<string> SiweExternalForcedWalletIds { get; set; } = null;
220-
221225
public ThirdwebClient Client { get; protected set; }
222226
public IThirdwebWallet ActiveWallet { get; protected set; }
223227
public bool Initialized { get; protected set; }
@@ -444,7 +448,9 @@ public virtual async Task<IThirdwebWallet> ConnectWallet(WalletOptions walletOpt
444448
_ = await inAppWallet.LoginWithSiweExternal(
445449
isMobile: Application.isMobilePlatform,
446450
browserOpenAction: (url) => Application.OpenURL(url),
447-
forceWalletIds: SiweExternalForcedWalletIds == null || SiweExternalForcedWalletIds.Count == 0 ? null : SiweExternalForcedWalletIds,
451+
forceWalletIds: walletOptions.InAppWalletOptions.ForceSiweExternalWalletIds == null || walletOptions.InAppWalletOptions.ForceSiweExternalWalletIds.Count == 0
452+
? null
453+
: walletOptions.InAppWalletOptions.ForceSiweExternalWalletIds,
448454
mobileRedirectScheme: MobileRedirectScheme,
449455
browser: new CrossPlatformUnityBrowser(RedirectPageHtmlOverride)
450456
);
@@ -491,7 +497,9 @@ public virtual async Task<IThirdwebWallet> ConnectWallet(WalletOptions walletOpt
491497
_ = await ecosystemWallet.LoginWithSiweExternal(
492498
isMobile: Application.isMobilePlatform,
493499
browserOpenAction: (url) => Application.OpenURL(url),
494-
forceWalletIds: SiweExternalForcedWalletIds == null || SiweExternalForcedWalletIds.Count == 0 ? null : SiweExternalForcedWalletIds,
500+
forceWalletIds: walletOptions.EcosystemWalletOptions.ForceSiweExternalWalletIds == null || walletOptions.EcosystemWalletOptions.ForceSiweExternalWalletIds.Count == 0
501+
? null
502+
: walletOptions.EcosystemWalletOptions.ForceSiweExternalWalletIds,
495503
mobileRedirectScheme: MobileRedirectScheme,
496504
browser: new CrossPlatformUnityBrowser(RedirectPageHtmlOverride)
497505
);

0 commit comments

Comments
 (0)