spw 1.1.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package spw --version 1.1.1                
NuGet\Install-Package spw -Version 1.1.1                
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="spw" Version="1.1.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add spw --version 1.1.1                
#r "nuget: spw, 1.1.1"                
#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 spw as a Cake Addin
#addin nuget:?package=spw&version=1.1.1

// Install spw as a Cake Tool
#tool nuget:?package=spw&version=1.1.1                

SpWorldsApiForCS

Это библиотека C# для управлением API SpWorlds. Документация к API тут.

Как начать?

Подключение библиотеки происходит через nuget

nuget
dotnet add package spw --version 1.1.1

Команды

Примечание

Можно использовать асинхронные и синхронные функции

Директива подключения

using spw;

Создание класса

SpWorlds sp = new SpWorlds("id", "token");

Правильный token и id

await sp.IsSpWalletAsync();
//or
sp.IsSpwallet();

Возвращает bool

Получить баланс

await sp.GetBalanceAsync();
//or
sp.GetBalance();

Возвращает int

Получить никнейм по DiscordId

await sp.GetUserAsync("DiscordId");
//or
sp.GetUser("DiscordId");

Возвращает string

Отправить АРы

await sp.SendPaymentAsync(amount, "receiver", "message");
//or
sp.SendPayment(amount, "receiver", "message");

Возвращает bool

Создать ссылку на оплату

await sp.CreatePaymentAsync(amount, "redirectUrl", "webhookUrl", "data");
//or
sp.CreatePayment(amount, "redirectUrl", "webhookUrl", "data");

Возвращает string

Проверка оплаты

await sp.ValidatorAsync("webhook", "Xbody_hash");
//or
sp.Validator("webhook", "Xbody_hash");

Возвращает bool

Exceptions

BabRequestException

Неправильная форма запроса

UnathorizedException

Неверный token или id

BadGatewayException

Spworlds api отключен

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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. 
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
2.1.2 108 5/1/2024
2.1.1 105 4/20/2024
2.1.0 102 4/18/2024
2.0.0 209 1/7/2024
1.1.2 114 1/21/2024
1.1.1 126 1/7/2024
1.1.0 150 10/13/2023
1.0.2 137 9/9/2023
1.0.1 147 9/9/2023 1.0.1 is deprecated because it has critical bugs.
1.0.0 151 9/9/2023 1.0.0 is deprecated because it has critical bugs.