diff --git a/Thirdweb/Thirdweb.Wallets/SmartWallet/SmartWallet.cs b/Thirdweb/Thirdweb.Wallets/SmartWallet/SmartWallet.cs index c31934d7..7b2d60c0 100644 --- a/Thirdweb/Thirdweb.Wallets/SmartWallet/SmartWallet.cs +++ b/Thirdweb/Thirdweb.Wallets/SmartWallet/SmartWallet.cs @@ -402,12 +402,12 @@ public async Task> GetAllActiveSigners() /// The timestamp when the request validity ends. Make use of our Utils to get UNIX timestamps. public async Task CreateSessionKey( string signerAddress, - List approvedTargets, - string nativeTokenLimitPerTransactionInWei, - string permissionStartTimestamp, - string permissionEndTimestamp, - string reqValidityStartTimestamp, - string reqValidityEndTimestamp + List approvedTargets = null, + string nativeTokenLimitPerTransactionInWei = null, + string permissionStartTimestamp = null, + string permissionEndTimestamp = null, + string reqValidityStartTimestamp = null, + string reqValidityEndTimestamp = null ) { if (await Utils.IsZkSync(this.Client, this.ActiveChainId).ConfigureAwait(false)) @@ -419,12 +419,12 @@ string reqValidityEndTimestamp { Signer = signerAddress, IsAdmin = 0, - ApprovedTargets = approvedTargets, - NativeTokenLimitPerTransaction = BigInteger.Parse(nativeTokenLimitPerTransactionInWei), - PermissionStartTimestamp = BigInteger.Parse(permissionStartTimestamp), - PermissionEndTimestamp = BigInteger.Parse(permissionEndTimestamp), - ReqValidityStartTimestamp = BigInteger.Parse(reqValidityStartTimestamp), - ReqValidityEndTimestamp = BigInteger.Parse(reqValidityEndTimestamp), + ApprovedTargets = approvedTargets ?? new List { Constants.ADDRESS_ZERO }, + NativeTokenLimitPerTransaction = BigInteger.Parse(nativeTokenLimitPerTransactionInWei ?? "0"), + PermissionStartTimestamp = BigInteger.Parse(permissionStartTimestamp ?? "0"), + PermissionEndTimestamp = BigInteger.Parse(permissionEndTimestamp ?? Utils.GetUnixTimeStampIn10Years().ToString()), + ReqValidityStartTimestamp = BigInteger.Parse(reqValidityStartTimestamp ?? "0"), + ReqValidityEndTimestamp = BigInteger.Parse(reqValidityEndTimestamp ?? Utils.GetUnixTimeStampIn10Years().ToString()), Uid = Guid.NewGuid().ToByteArray(), };