Bybit.P2P 1.1.0

Prefix Reserved
dotnet add package Bybit.P2P --version 1.1.0                
NuGet\Install-Package Bybit.P2P -Version 1.1.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Bybit.P2P" Version="1.1.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Bybit.P2P --version 1.1.0                
#r "nuget: Bybit.P2P, 1.1.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Bybit.P2P as a Cake Addin
#addin nuget:?package=Bybit.P2P&version=1.1.0

// Install Bybit.P2P as a Cake Tool
#tool nuget:?package=Bybit.P2P&version=1.1.0                

Bybit.P2P

An unofficial Bybit P2P API integration SDK written in C#.

NuGet Version

Bybit.P2P is the unofficial C# SDK for Bybit's P2P API, enabling seamless integration of your software solutions with Bybit's P2P trading platform.

  • No need to implement signature (HMAC, RSA) logic yourself
  • Easy & quick to work with
  • Actively developed and maintained

developed and maintained by kolya5544 at this point in time

Features

Bybit.P2P currently implements all methods available for P2P API. The library is in active development, so any newly released features will be added almost immediately. Here is a short list of what the library can do:

  • Create, edit, delete, activate advertisements
  • Get pending orders, mark orders as paid, release assets to the buyer
  • Get and send text messages, upload files and send files to the chat
  • Get all public advertisements for tokens
  • ...and so much else! 🌟

All features are usually one method call away and do not require advanced API understanding to interact with.

Tech

Bybit.P2P uses just one other package to work:

  • Newtonsoft.Json for JSON operations (serialization & deserialization)

Installation

Bybit.P2P should work with all modern .NET versions, since the library is developed in .NET Standard 2.1. Recommended version is .NET 8. You can install the package using NuGet:

nuget install Bybit.P2P

Usage

Upon installation, you can use bybit_p2p by importing it in your code:

using Bybit.P2P;

Here is a quickstart example to get some info from the exchange:

using Bybit.P2P;
using Newtonsoft.Json;

void Pretty(object obj) => Console.WriteLine(JsonConvert.SerializeObject(obj, Formatting.Indented));

var p2p = new APIClient(
    apiKey: "x",
    apiSecret: "x",
    testnet: true
    );

# 1. Get current balance
Pretty(await p2p.GetCurrentBalance(new { accountType = "FUND", coin = "USDC" }));

# 2. Get account information
Pretty(await p2p.GetAccountInformation());

# 3. Get ads list
Pretty(await p2p.GetAdsList());

APIClient() class is used for P2P API interactions. Here, testnet refers to environment. For Mainnet (https://bybit.com/), you shall use testnet = false. For Testnet (https://testnet.bybit.com/), use testnet = true instead.

RSA users should also set rsa = true in the constructor. TR/KZ/NL/etc. users can manipulate domain and tld parameters, like tld = "kz".

You can find the complete Quickstart example here: Bybit.P2P Quickstart.

Documentation

Bybit.P2P package currently consists of just one module, which is used for direct REST API requests to Bybit P2P API.

You can access P2P API documentation using this link: Official P2P docs

Here is a breakdown of how API methods correspond to appropriate Bybit.P2P methods:

Advertisements: | Bybit.P2P method name | P2P API method name | P2P API endpoint path | | --- | --- | --- | | GetOnlineAds() | Get Market Online Ads list | /v5/p2p/item/online | | PostNewAd() | Post New Ad | /v5/p2p/item/create | | RemoveAd() | Remove ad | /v5/p2p/item/cancel | | UpdateAd() | Update / Relist My Ad | /v5/p2p/item/update | | GetAdsList() | Get ads list | /v5/p2p/item/personal/list | | GetAdDetails() | Get ad detail | /v5/p2p/item/info |

Orders: | Bybit.P2P method name | P2P API method name | P2P API endpoint path | | --- | --- | --- | | GetOrders() | Get All Orders | /v5/p2p/order/simplifyList | | GetOrderDetails() | Get Order Details | /v5/p2p/order/info | | GetPendingOrders() | Get Pending Orders | /v5/p2p/order/pending/simplifyList | | MarkAsPaid() | Mark Order As Paid | /v5/p2p/order/pay | | ReleaseAssets() | Release Digital Asset | /v5/p2p/order/finish | | SendChatMessage() | Send chat message | /v5/p2p/order/message/send | | UploadChatFile() | Upload chat file | /v5/p2p/oss/upload_file | | GetChatMessages() | Get Chat Message | /v5/p2p/order/message/listpage |

User: | bybit_p2p method name | P2P API method name | P2P API endpoint path | | --- | --- | --- | | GetAccountInformation() | Get Account Information | /v5/p2p/user/personal/info | | GetCounterpartyInfo() | Get Counterparty User Info | /v5/p2p/user/order/personal/info | | GetUserPaymentTypes() | Get User Payment | /v5/p2p/user/payment/list |

Misc: | bybit_p2p method name | P2P API method name | P2P API endpoint path | | --- | --- | --- | | GetCurrentBalance() | Get Coin Balance | /v5/asset/transfer/query-account-coins-balance |

More methods will come soon, allowing for more advanced operations.

Development

All contributions are welcome.

License

MIT

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.0 419 6 days ago
1.0.0 422 6 days ago