Skip to content

Commit

Permalink
Deprecation notice
Browse files Browse the repository at this point in the history
  • Loading branch information
skibitsky committed Sep 17, 2024
1 parent ec0743a commit d04c4d3
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 168 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<DefaultVersion>2.4.2</DefaultVersion>
<DefaultVersion>2.4.3</DefaultVersion>
<DefaultTargetFrameworks>net6.0;net7.0;net8.0;netstandard2.1;</DefaultTargetFrameworks>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
Expand Down
171 changes: 5 additions & 166 deletions README.md
Original file line number Diff line number Diff line change
@@ -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<SessionData> 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.
1 change: 1 addition & 0 deletions WalletConnectSharp.Auth/Interfaces/IAuthClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down
1 change: 1 addition & 0 deletions WalletConnectSharp.Auth/WalletConnectAuthClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion WalletConnectSharp.Core/Core.cs
Original file line number Diff line number Diff line change
@@ -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 { }
}
1 change: 1 addition & 0 deletions WalletConnectSharp.Core/Interfaces/ICore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ namespace WalletConnectSharp.Core.Interfaces
/// <summary>
/// Represents the Core module and all fields the Core module will have
/// </summary>
[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
{
/// <summary>
Expand Down
1 change: 1 addition & 0 deletions WalletConnectSharp.Core/WalletConnectCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
/// </summary>
[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
{
/// <summary>
Expand Down
1 change: 1 addition & 0 deletions WalletConnectSharp.Sign/Interfaces/ISignClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
/// </summary>
[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
{
/// <summary>
Expand Down
1 change: 1 addition & 0 deletions WalletConnectSharp.Sign/WalletConnectSignClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ namespace WalletConnectSharp.Sign
/// using the static <see cref="Init"/> function. You will first need to
/// create <see cref="SignClientOptions"/>
/// </summary>
[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
{
/// <summary>
Expand Down
1 change: 1 addition & 0 deletions WalletConnectSharp.Web3Wallet/Interfaces/IWeb3Wallet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down
1 change: 1 addition & 0 deletions WalletConnectSharp.Web3Wallet/Web3WalletClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down

0 comments on commit d04c4d3

Please sign in to comment.