Skip to content

Commit 75c1f55

Browse files
committed
Refactor namespaces and consolidate type files
Moved several classes from Thirdweb.RPC and Thirdweb.Bridge namespaces to Thirdweb, and removed unused Thirdweb.RPC references across the codebase. Consolidated TimeoutOptions and TimeoutType into ThirdwebClient.Types.cs, and moved ThirdwebTransactionReceipt into ThirdwebTransaction.Types.cs. Performed file renames for consistency and reorganized EmbeddedWallet files under Thirdweb.EWS. Cleaned up obsolete interface and type files.
1 parent 03a824c commit 75c1f55

40 files changed

+132
-161
lines changed

Thirdweb.Tests/Thirdweb.RPC/Thirdweb.RPC.Tests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System.Numerics;
2-
using Thirdweb.RPC;
32

43
namespace Thirdweb.Tests.RPC;
54

Thirdweb.Tests/Thirdweb.Wallets/Thirdweb.Wallets.Tests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using Nethereum.Hex.HexTypes;
2-
using Thirdweb.RPC;
32

43
namespace Thirdweb.Tests.Wallets;
54

Thirdweb/Thirdweb.Bridge/ThirdwebBridge.Extensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System.Numerics;
22

3-
namespace Thirdweb.Bridge;
3+
namespace Thirdweb;
44

55
public static class ThirdwebBridgeExtensions
66
{

Thirdweb/Thirdweb.Bridge/ThirdwebBridge.Types.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System.Numerics;
22
using Newtonsoft.Json;
33

4-
namespace Thirdweb.Bridge;
4+
namespace Thirdweb;
55

66
/// <summary>
77
/// Represents the response model wrapping the result of an API call.

Thirdweb/Thirdweb.Bridge/ThirdwebBridge.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using System.Text;
33
using Newtonsoft.Json;
44

5-
namespace Thirdweb.Bridge;
5+
namespace Thirdweb;
66

77
public class ThirdwebBridge
88
{

Thirdweb/Thirdweb.Client/ITimeoutOptions.cs

Lines changed: 0 additions & 15 deletions
This file was deleted.

Thirdweb/Thirdweb.Client/TimeoutOptions.cs renamed to Thirdweb/Thirdweb.Client/ThirdwebClient.Types.cs

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
/// <param name="storage">The timeout for storage operations (optional).</param>
1010
/// <param name="rpc">The timeout for RPC operations (optional).</param>
1111
/// <param name="other">The timeout for other operations (optional).</param>
12-
public class TimeoutOptions(int? storage = null, int? rpc = null, int? other = null) : ITimeoutOptions
12+
public class TimeoutOptions(int? storage = null, int? rpc = null, int? other = null)
1313
{
1414
internal int? Storage { get; private set; } = storage;
1515
internal int? Rpc { get; private set; } = rpc;
@@ -32,3 +32,24 @@ public int GetTimeout(TimeoutType type, int fallback = Constants.DEFAULT_FETCH_T
3232
};
3333
}
3434
}
35+
36+
/// <summary>
37+
/// Specifies the type of timeout for various operations.
38+
/// </summary>
39+
public enum TimeoutType
40+
{
41+
/// <summary>
42+
/// Timeout for storage operations.
43+
/// </summary>
44+
Storage,
45+
46+
/// <summary>
47+
/// Timeout for RPC operations.
48+
/// </summary>
49+
Rpc,
50+
51+
/// <summary>
52+
/// Timeout for other types of operations.
53+
/// </summary>
54+
Other,
55+
}

Thirdweb/Thirdweb.Client/ThirdwebClient.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ public class ThirdwebClient
2828

2929
internal string SecretKey { get; }
3030
internal string BundleId { get; }
31-
internal ITimeoutOptions FetchTimeoutOptions { get; }
31+
internal TimeoutOptions FetchTimeoutOptions { get; }
3232
internal Dictionary<BigInteger, string> RpcOverrides { get; }
3333

3434
private ThirdwebClient(
3535
string clientId = null,
3636
string secretKey = null,
3737
string bundleId = null,
38-
ITimeoutOptions fetchTimeoutOptions = null,
38+
TimeoutOptions fetchTimeoutOptions = null,
3939
IThirdwebHttpClient httpClient = null,
4040
string sdkName = null,
4141
string sdkOs = null,
@@ -101,7 +101,7 @@ public static ThirdwebClient Create(
101101
string clientId = null,
102102
string secretKey = null,
103103
string bundleId = null,
104-
ITimeoutOptions fetchTimeoutOptions = null,
104+
TimeoutOptions fetchTimeoutOptions = null,
105105
IThirdwebHttpClient httpClient = null,
106106
string sdkName = null,
107107
string sdkOs = null,

Thirdweb/Thirdweb.Client/TimeoutType.cs

Lines changed: 0 additions & 22 deletions
This file was deleted.

Thirdweb/Thirdweb.Contracts/ThirdwebContract.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
using Nethereum.Contracts;
55
using Nethereum.Hex.HexTypes;
66
using Newtonsoft.Json;
7-
using Thirdweb.RPC;
87

98
namespace Thirdweb;
109

0 commit comments

Comments
 (0)