diff --git a/Directory.Build.props b/Directory.Build.props index d80bbd2..5aca830 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,7 @@ - 2.4.2 + 2.4.3 net6.0;net7.0;net8.0;netstandard2.1; true diff --git a/README.md b/README.md index 1fdc180..dcc7ad4 100644 --- a/README.md +++ b/README.md @@ -1,170 +1,9 @@ -# WalletConnectSharp +# Deprecated - WalletConnectSharp -WalletConnectSharp is an implementation of the [WalletConnect](https://walletconnect.org/) protocol v2 using .NET. This library implements the [WalletConnect Technical Specification](https://docs.walletconnect.org/tech-spec) in .NET to allow C# dApps makers and wallet makers to add support for the open [WalletConnect](https://walletconnect.org/) protocol. - -## Installation - -install via Nuget - -```jsx -dotnet add package WalletConnect.Sign -``` - -## Usage - -### **Dapp Usage** - -First you must setup `SignClientOptions` which stores both the `ProjectId` and `Metadata`. You may also optionally specify the storage module to use. By default, the `FileSystemStorage` module is used if none is specified. - -```csharp -var dappOptions = new SignClientOptions() -{ - ProjectId = "39f3dc0a2c604ec9885799f9fc5feb7c", - Metadata = new Metadata() - { - Description = "An example dapp to showcase WalletConnectSharpv2", - Icons = new[] { "https://walletconnect.com/meta/favicon.ico" }, - Name = "WalletConnectSharpv2 Dapp Example", - Url = "https://walletconnect.com" - }, - // Uncomment to disable persistant storage - // Storage = new InMemoryStorage() -}; -``` - -Then, you must setup the `ConnectOptions` which define what blockchain, RPC methods and events your dapp will use. - -*C# Constructor* - -```csharp -var dappConnectOptions = new ConnectOptions() -{ - RequiredNamespaces = new RequiredNamespaces() - { - { - "eip155", new RequiredNamespace() - { - Methods = new[] - { - "eth_sendTransaction", - "eth_signTransaction", - "eth_sign", - "personal_sign", - "eth_signTypedData", - }, - Chains = new[] - { - "eip155:1" - }, - Events = new[] - { - "chainChanged", - "accountsChanged", - } - } - } - } -}; -``` - -*Builder Functions Style* - -```csharp -var dappConnectOptions1 = new ConnectOptions() - .RequireNamespace("eip155", new RequiredNamespace() - .WithMethod("eth_sendTransaction") - .WithMethod("eth_signTransaction") - .WithMethod("eth_sign") - .WithMethod("personal_sign") - .WithMethod("eth_signTypedData") - .WithChain("eip155:1") - .WithEvent("chainChanged") - .WithEvent("accountsChanged") - ); -``` - -With both options defined, you can initialize and connect the SDK - -```csharp -var dappClient = await WalletConnectSignClient.Init(dappOptions); -var connectData = await dappClient.Connect(dappConnectOptions); -``` - -You can grab the `Uri` for the connection request from `connectData` - -```csharp -ExampleShowQRCode(connectData.Uri); -``` - -and await for connection approval using the `Approval` Task object +WalletConnect Inc is now Reown. As part of this transition, we are deprecating a number of repositories/packages across our supported platforms, and transitioning to their equivalents published under the Reown organization. -```csharp -Task sessionConnectTask = connectData.Approval; -SessionData sessionData = await sessionConnectTask; +This repository is now considered deprecated and will reach End-of-Life on February 17th 2025. For more details, including migration guides please see: https://docs.reown.com/advanced/walletconnect-deprecations -// or -// SessionData sessionData = await connectData.Approval; -``` +--- -This `Task` will return the `SessionData` when the session was approved, or throw an exception when the session rquest has either - -* Timed out -* Been Rejected - -### **Wallet Usage** - -First you must setup `SignClientOptions` which stores both the `ProjectId` and `Metadata`. You may also optionally specify the storage module to use. By default, the `FileSystemStorage` module is used if none is specified. - -```csharp -var walletOptions = new SignClientOptions() -{ - ProjectId = "39f3dc0a2c604ec9885799f9fc5feb7c", - Metadata = new Metadata() - { - Description = "An example wallet to showcase WalletConnectSharpv2", - Icons = new[] { "https://walletconnect.com/meta/favicon.ico" }, - Name = "WalletConnectSharpv2 Wallet Example", - Url = "https://walletconnect.com" - }, - // Uncomment to disable persistant storage - // Storage = new InMemoryStorage() -}; -``` - -Once you have options defined, you can initialize the SDK - -```csharp -var walletClient = await WalletConnectSignClient.Init(walletOptions); -``` - -Wallets can pair an incoming session using the session's Uri. Pairing a session lets the Wallet obtain the connection proposal which can then be approved or denied. - -```csharp -ProposalStruct proposal = await walletClient.Pair(connectData.Uri); -``` - -The wallet can then approve or reject the proposal using either of the following - -```csharp -string addressToConnect = ...; -var approveData = await walletClient.Approve(proposal, addressToConnect); -await approveData.Acknowledged(); -``` - -```csharp -string[] addressesToConnect = ...; -var approveData = await walletClient.Approve(proposal, addressesToConnect); -await approveData.Acknowledged(); -``` - -```csharp -await walletClient.Reject(proposal, "User rejected"); -``` - - -## Examples - -There are examples and unit tests in the Tests directory. Some examples include - -* BiDirectional Communication -* Basic dApp Example +WalletConnectSharp is an implementation of the [WalletConnect](https://walletconnect.org/) protocol v2 using .NET. This library implements the [WalletConnect Technical Specification](https://docs.walletconnect.org/tech-spec) in .NET to allow C# dApps makers and wallet makers to add support for the open [WalletConnect](https://walletconnect.org/) protocol. diff --git a/WalletConnectSharp.Auth/Interfaces/IAuthClient.cs b/WalletConnectSharp.Auth/Interfaces/IAuthClient.cs index 011ea14..e9ceaac 100644 --- a/WalletConnectSharp.Auth/Interfaces/IAuthClient.cs +++ b/WalletConnectSharp.Auth/Interfaces/IAuthClient.cs @@ -5,6 +5,7 @@ namespace WalletConnectSharp.Auth.Interfaces; +[Obsolete("WalletConnectSharp is now considered deprecated and will reach End-of-Life on February 17th 2025. For more details, including migration guides please see: https://docs.reown.com")] public interface IAuthClient : IModule, IAuthClientEvents { string Protocol { get; } diff --git a/WalletConnectSharp.Auth/WalletConnectAuthClient.cs b/WalletConnectSharp.Auth/WalletConnectAuthClient.cs index f76d0b0..579b69c 100644 --- a/WalletConnectSharp.Auth/WalletConnectAuthClient.cs +++ b/WalletConnectSharp.Auth/WalletConnectAuthClient.cs @@ -7,6 +7,7 @@ namespace WalletConnectSharp.Auth; +[Obsolete("WalletConnectSharp is now considered deprecated and will reach End-of-Life on February 17th 2025. For more details, including migration guides please see: https://docs.reown.com")] public class WalletConnectAuthClient : IAuthClient { public const string AUTH_CLIENT_PROTOCOL = AuthEngine.AUTH_CLIENT_PROTOCOL; diff --git a/WalletConnectSharp.Core/Core.cs b/WalletConnectSharp.Core/Core.cs index d2dc296..b8baedd 100644 --- a/WalletConnectSharp.Core/Core.cs +++ b/WalletConnectSharp.Core/Core.cs @@ -1,5 +1,5 @@ namespace WalletConnectSharp.Core { - [Obsolete("This class has been renamed to WalletConnectCore, and will be removed in 2.1.x.", false)] + [Obsolete("WalletConnectSharp is now considered deprecated and will reach End-of-Life on February 17th 2025. For more details, including migration guides please see: https://docs.reown.com")] public class Core : WalletConnectCore { } } diff --git a/WalletConnectSharp.Core/Interfaces/ICore.cs b/WalletConnectSharp.Core/Interfaces/ICore.cs index e71f15c..935b51d 100644 --- a/WalletConnectSharp.Core/Interfaces/ICore.cs +++ b/WalletConnectSharp.Core/Interfaces/ICore.cs @@ -9,6 +9,7 @@ namespace WalletConnectSharp.Core.Interfaces /// /// Represents the Core module and all fields the Core module will have /// + [Obsolete("WalletConnectSharp is now considered deprecated and will reach End-of-Life on February 17th 2025. For more details, including migration guides please see: https://docs.reown.com")] public interface ICore : IModule { /// diff --git a/WalletConnectSharp.Core/WalletConnectCore.cs b/WalletConnectSharp.Core/WalletConnectCore.cs index a86845f..ca3cbba 100644 --- a/WalletConnectSharp.Core/WalletConnectCore.cs +++ b/WalletConnectSharp.Core/WalletConnectCore.cs @@ -16,6 +16,7 @@ namespace WalletConnectSharp.Core /// The Core module. This module holds all Core Modules and holds configuration data /// required by several Core Module. /// + [Obsolete("WalletConnectSharp is now considered deprecated and will reach End-of-Life on February 17th 2025. For more details, including migration guides please see: https://docs.reown.com")] public class WalletConnectCore : ICore { /// diff --git a/WalletConnectSharp.Sign/Interfaces/ISignClient.cs b/WalletConnectSharp.Sign/Interfaces/ISignClient.cs index 347fd00..f121013 100644 --- a/WalletConnectSharp.Sign/Interfaces/ISignClient.cs +++ b/WalletConnectSharp.Sign/Interfaces/ISignClient.cs @@ -9,6 +9,7 @@ namespace WalletConnectSharp.Sign.Interfaces /// An interface for the Sign Client. This includes modules the Sign Client will use, the ICore module /// this Sign Client is using, as well as public facing Engine functions and properties. /// + [Obsolete("WalletConnectSharp is now considered deprecated and will reach End-of-Life on February 17th 2025. For more details, including migration guides please see: https://docs.reown.com")] public interface ISignClient : IModule, IEngineAPI { /// diff --git a/WalletConnectSharp.Sign/WalletConnectSignClient.cs b/WalletConnectSharp.Sign/WalletConnectSignClient.cs index 2582443..a9bd088 100644 --- a/WalletConnectSharp.Sign/WalletConnectSignClient.cs +++ b/WalletConnectSharp.Sign/WalletConnectSignClient.cs @@ -23,6 +23,7 @@ namespace WalletConnectSharp.Sign /// using the static function. You will first need to /// create /// + [Obsolete("WalletConnectSharp is now considered deprecated and will reach End-of-Life on February 17th 2025. For more details, including migration guides please see: https://docs.reown.com")] public class WalletConnectSignClient : ISignClient { /// diff --git a/WalletConnectSharp.Web3Wallet/Interfaces/IWeb3Wallet.cs b/WalletConnectSharp.Web3Wallet/Interfaces/IWeb3Wallet.cs index fc1639d..1511409 100644 --- a/WalletConnectSharp.Web3Wallet/Interfaces/IWeb3Wallet.cs +++ b/WalletConnectSharp.Web3Wallet/Interfaces/IWeb3Wallet.cs @@ -4,6 +4,7 @@ namespace WalletConnectSharp.Web3Wallet.Interfaces; +[Obsolete("WalletConnectSharp is now considered deprecated and will reach End-of-Life on February 17th 2025. For more details, including migration guides please see: https://docs.reown.com")] public interface IWeb3Wallet : IModule, IWeb3WalletApi { IWeb3WalletEngine Engine { get; } diff --git a/WalletConnectSharp.Web3Wallet/Web3WalletClient.cs b/WalletConnectSharp.Web3Wallet/Web3WalletClient.cs index aee4356..634117a 100644 --- a/WalletConnectSharp.Web3Wallet/Web3WalletClient.cs +++ b/WalletConnectSharp.Web3Wallet/Web3WalletClient.cs @@ -10,6 +10,7 @@ namespace WalletConnectSharp.Web3Wallet; +[Obsolete("WalletConnectSharp is now considered deprecated and will reach End-of-Life on February 17th 2025. For more details, including migration guides please see: https://docs.reown.com")] public class Web3WalletClient : IWeb3Wallet { public string Name { get; }