Skip to content

Commit 1f2e7ee

Browse files
kantagararob1997
andauthored
Web3Auth SendTransaction Error when Wallet GUI is disabled Fixed (#1205)
* Fixing the issue with Web3auth not sending transactions with web3auth wallet gui being disabled * Sync Dependencies [skip ci] * Sync Dependencies - Auto Commit --------- Co-authored-by: kantagara <[email protected]> Co-authored-by: Robel Getnet Geremew <[email protected]> Co-authored-by: rob1997 <[email protected]>
1 parent fd7be13 commit 1f2e7ee

19 files changed

+10
-2
lines changed
Binary file not shown.
Binary file not shown.

Packages/io.chainsafe.web3-unity.web3auth/Runtime/Web3AuthConnectionProvider.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ protected override void ConfigureServices(IWeb3ServiceCollection services)
119119
},
120120
RememberMe = _rememberMe || RememberSession,
121121

122-
AutoLogin = _rememberMe
122+
AutoLogin = _rememberMe,
123+
UseWalletGui = enableWalletGui
123124
};
124125

125126
web3AuthConfig.CancellationToken = _rememberMe ? default : _modal.CancellationToken;

Packages/io.chainsafe.web3-unity.web3auth/Runtime/Web3AuthTransactionExecutor.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,19 @@ public class Web3AuthTransactionExecutor : InProcessTransactionExecutor, IWeb3Au
1919

2020
private readonly Dictionary<string, (TransactionRequest request, TaskCompletionSource<TransactionResponse> response)> _transactionPool = new();
2121

22-
public Web3AuthTransactionExecutor(IAccountProvider accountProvider, IRpcProvider rpcProvider) : base(accountProvider, rpcProvider)
22+
private Web3AuthWalletConfig _walletConfig;
23+
public Web3AuthTransactionExecutor(IAccountProvider accountProvider, IRpcProvider rpcProvider, Web3AuthWalletConfig walletConfig) : base(accountProvider, rpcProvider)
2324
{
25+
_walletConfig = walletConfig;
2426
}
2527

2628
public override Task<TransactionResponse> SendTransaction(TransactionRequest transaction)
2729
{
2830
transaction.Id = Guid.NewGuid().ToString();
2931

32+
if (!_walletConfig.UseWalletGui)
33+
return base.SendTransaction(transaction);;
34+
3035
var tcs = new TaskCompletionSource<TransactionResponse>();
3136

3237
// Add transaction to pool.

Packages/io.chainsafe.web3-unity.web3auth/Runtime/Web3AuthWalletConfig.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,7 @@ public class Web3AuthWalletConfig
2929
public bool RememberMe { get; set; }
3030

3131
public bool AutoLogin { get; set; }
32+
33+
public bool UseWalletGui { get; set; }
3234
}
3335
}
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)