@@ -67,8 +67,31 @@ public class ThirdwebManager : MonoBehaviour
67
67
public string forwaderVersionOverride = null ;
68
68
69
69
[ Header ( "MAGIC LINK OPTIONS" ) ]
70
+ [ Tooltip ( "Magic Link API Key (https://dashboard.magic.link)" ) ]
70
71
public string magicLinkApiKey = null ;
71
72
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
+
72
95
[ Header ( "NATIVE PREFABS (DANGER ZONE)" ) ]
73
96
[ Tooltip ( "Instantiates the WalletConnect SDK for Native platforms." ) ]
74
97
public GameObject WalletConnectPrefab ;
@@ -157,17 +180,30 @@ private void Awake()
157
180
} ;
158
181
}
159
182
160
- // Set up app metadata
161
-
183
+ // Set up wallet data
162
184
options . wallet = new ThirdwebSDK . WalletOptions ( )
163
185
{
164
186
appName = string . IsNullOrEmpty ( appName ) ? "Thirdweb Game" : appName ,
165
187
appDescription = string . IsNullOrEmpty ( appDescription ) ? "Thirdweb Game Demo" : appDescription ,
166
188
appIcons = appIcons . Length == 0 ? new string [ ] { "https://thirdweb.com/favicon.ico" } : appIcons ,
167
189
appUrl = string . IsNullOrEmpty ( appUrl ) ? "https://thirdweb.com" : appUrl ,
168
- magicLinkApiKey = string . IsNullOrEmpty ( magicLinkApiKey ) ? null : magicLinkApiKey
190
+ magicLinkApiKey = string . IsNullOrEmpty ( magicLinkApiKey ) ? null : magicLinkApiKey ,
169
191
} ;
170
192
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
+
171
207
SDK = new ThirdwebSDK ( chainOrRPC , chainId , options ) ;
172
208
}
173
209
0 commit comments