@@ -67,8 +67,31 @@ public class ThirdwebManager : MonoBehaviour
6767 public string forwaderVersionOverride = null ;
6868
6969 [ Header ( "MAGIC LINK OPTIONS" ) ]
70+ [ Tooltip ( "Magic Link API Key (https://dashboard.magic.link)" ) ]
7071 public string magicLinkApiKey = null ;
7172
73+ [ Header ( "SMART WALLET OPTIONS" ) ]
74+ [ Tooltip ( "Factory Contract Address" ) ]
75+ public string factoryAddress ;
76+
77+ [ Tooltip ( "Thirdweb API Key (https://thirdweb.com/dashboard/api-keys)" ) ]
78+ public string thirdwebApiKey ;
79+
80+ [ Tooltip ( "Whether it should use a paymaster for gasless transactions or not" ) ]
81+ public bool gasless ;
82+
83+ [ Tooltip ( "Optional - If you want to use a custom relayer, you can provide the URL here" ) ]
84+ public string bundlerUrl ;
85+
86+ [ Tooltip ( "Optional - If you want to use a custom paymaster, you can provide the URL here" ) ]
87+ public string paymasterUrl ;
88+
89+ [ Tooltip ( "Optional - If you want to use a custom paymaster, you can provide the API key here" ) ]
90+ public string paymasterAPI ;
91+
92+ [ Tooltip ( "Optional - If you want to use a custom entry point, you can provide the contract address here" ) ]
93+ public string entryPointAddress ;
94+
7295 [ Header ( "NATIVE PREFABS (DANGER ZONE)" ) ]
7396 [ Tooltip ( "Instantiates the WalletConnect SDK for Native platforms." ) ]
7497 public GameObject WalletConnectPrefab ;
@@ -157,17 +180,30 @@ private void Awake()
157180 } ;
158181 }
159182
160- // Set up app metadata
161-
183+ // Set up wallet data
162184 options . wallet = new ThirdwebSDK . WalletOptions ( )
163185 {
164186 appName = string . IsNullOrEmpty ( appName ) ? "Thirdweb Game" : appName ,
165187 appDescription = string . IsNullOrEmpty ( appDescription ) ? "Thirdweb Game Demo" : appDescription ,
166188 appIcons = appIcons . Length == 0 ? new string [ ] { "https://thirdweb.com/favicon.ico" } : appIcons ,
167189 appUrl = string . IsNullOrEmpty ( appUrl ) ? "https://thirdweb.com" : appUrl ,
168- magicLinkApiKey = string . IsNullOrEmpty ( magicLinkApiKey ) ? null : magicLinkApiKey
190+ magicLinkApiKey = string . IsNullOrEmpty ( magicLinkApiKey ) ? null : magicLinkApiKey ,
169191 } ;
170192
193+ options . smartWalletConfig =
194+ string . IsNullOrEmpty ( factoryAddress ) || string . IsNullOrEmpty ( thirdwebApiKey )
195+ ? null
196+ : new ThirdwebSDK . SmartWalletConfig ( )
197+ {
198+ factoryAddress = factoryAddress ,
199+ thirdwebApiKey = thirdwebApiKey ,
200+ gasless = gasless ,
201+ bundlerUrl = bundlerUrl ,
202+ paymasterUrl = paymasterUrl ,
203+ paymasterAPI = paymasterAPI ,
204+ entryPointAddress = entryPointAddress
205+ } ;
206+
171207 SDK = new ThirdwebSDK ( chainOrRPC , chainId , options ) ;
172208 }
173209
0 commit comments