Skip to content

Commit 6131c32

Browse files
committed
Remove EngineWallet.Create backend wallet check
1 parent 1dec5a4 commit 6131c32

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

Thirdweb/Thirdweb.Wallets/EngineWallet/EngineWallet.cs

+3-16
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,7 @@ internal EngineWallet(ThirdwebClient client, IThirdwebHttpClient engineClient, s
4242
/// <param name="walletAddress">The backend wallet address to use.</param>
4343
/// <param name="timeoutSeconds">The timeout in seconds for the transaction. Defaults to no timeout.</param>
4444
/// <param name="additionalHeaders">Additional headers to include in requests. Authorization and X-Backend-Wallet-Address automatically included.</param>
45-
public static async Task<EngineWallet> Create(
46-
ThirdwebClient client,
47-
string engineUrl,
48-
string authToken,
49-
string walletAddress,
50-
int? timeoutSeconds = null,
51-
Dictionary<string, string> additionalHeaders = null
52-
)
45+
public static EngineWallet Create(ThirdwebClient client, string engineUrl, string authToken, string walletAddress, int? timeoutSeconds = null, Dictionary<string, string> additionalHeaders = null)
5346
{
5447
if (client == null)
5548
{
@@ -76,15 +69,9 @@ public static async Task<EngineWallet> Create(
7669
engineUrl = engineUrl[..^1];
7770
}
7871

72+
walletAddress = walletAddress.ToChecksumAddress();
73+
7974
var engineClient = Utils.ReconstructHttpClient(client.HttpClient, new Dictionary<string, string> { { "Authorization", $"Bearer {authToken}" }, });
80-
var allWalletsResponse = await engineClient.GetAsync($"{engineUrl}/backend-wallet/get-all").ConfigureAwait(false);
81-
_ = allWalletsResponse.EnsureSuccessStatusCode();
82-
var allWallets = JObject.Parse(await allWalletsResponse.Content.ReadAsStringAsync().ConfigureAwait(false));
83-
var walletExists = allWallets["result"].Any(w => string.Equals(w["address"].Value<string>(), walletAddress, StringComparison.OrdinalIgnoreCase));
84-
if (!walletExists)
85-
{
86-
throw new Exception("Wallet does not exist in the engine.");
87-
}
8875
engineClient.AddHeader("X-Backend-Wallet-Address", walletAddress);
8976
if (additionalHeaders != null)
9077
{

0 commit comments

Comments
 (0)