# XendBridge .NET SDK

Xendbridge provides a .NET SDK which can be integrated by downloading from the Nugget Package Manager on [Visual Studio](https://visualstudio.microsoft.com/downloads/) or from the [website](https://www.nuget.org/).

#### Installation

The .NET SDK can be integrated by downloading from the Nugget Package Manager on [Visual Studio](https://visualstudio.microsoft.com/downloads/) or from the [website](https://www.nuget.org/).

#### Setup

Firstly, in your ***appsettings.json*** file, you'd need to add the following JSON object and properties and populate them with the necessary values considering the environments of your choice. See [#keys](https://doc.xendbridge.com/get-started#keys "mention") and [#environments](https://doc.xendbridge.com/get-started#environments "mention") to get your keys and urls.

<pre class="language-json"><code class="lang-json"><strong>"XendBridgeSDKConfig": {
</strong>    "BaseUrl": "https://canary.xendbridge.com",
    "PublicKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "SecretKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXX"
  }
</code></pre>

Secondly, add or bind the config settings to your project by injecting it into your **services** using the following code snippet;

```csharp
public static IServiceCollection ConfigureAppSettingsBinding(this IServiceCollection services, IConfiguration Configuration)
{
  //Your other registered services can be here
  services.RegisterXendBridgeSDKConfig(Configuration);
  
  return services;
}
```

Lastly, you'd need to register the SDK as a service in the **services** using the code snippet below;

```csharp
public static IServiceCollection RegisterServices(this IServiceCollection services)
{
  services.AddXendBridgeSDK();
}
```

#### Method Calls <a href="#method-calls" id="method-calls"></a>

After adding the [setup](#setup) above, the following functions, objects, and params are provided for the following method calls below.&#x20;

* [**Rate**](https://doc.xendbridge.com/xendbridge-sdks/xendbridge-.net-sdk/rate)
* [**Buy Order**](https://doc.xendbridge.com/xendbridge-sdks/xendbridge-.net-sdk/buy-order)
* [**Sell Order**](https://doc.xendbridge.com/xendbridge-sdks/xendbridge-.net-sdk/sell-order)
* [**Swap Order**](https://doc.xendbridge.com/xendbridge-sdks/xendbridge-.net-sdk/swap-order)
* [**Pending Order**](https://doc.xendbridge.com/xendbridge-sdks/xendbridge-.net-sdk/pending-order)
* [**Pay For Order Confirmation**](https://doc.xendbridge.com/xendbridge-sdks/xendbridge-.net-sdk/pay-for-order-confirmation)
* [**Cancel Order**](https://doc.xendbridge.com/xendbridge-sdks/xendbridge-.net-sdk/cancel-order)
* [**Raise Dispute**](https://doc.xendbridge.com/xendbridge-sdks/xendbridge-.net-sdk/raise-a-dispute)
