Pascal.Wallet.Connector 1.0.1

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

// Install Pascal.Wallet.Connector as a Cake Tool
#tool nuget:?package=Pascal.Wallet.Connector&version=1.0.1

Send Pascals from one account to another account

In Pascal network, every account can send 1 free transaction per block. Other transactions in the same block costs minimum 0.0001 Pascals or 1 Molina. Pascals can be send only from the accounts you own (you need to have private keys in the Pascal Wallet and the Pascal Wallet should be kept open).

using var connector = new PascalConnector(address: "127.0.0.1", port: 4003);
var sendingPascResponse = await connector.SendToAsync(senderAccount: 1141769, receiverAccount: 834853,
    amount: 1.2345M, fee: 0, payload: "Thanks for good work!", payloadMethod: PayloadMethod.None);
if (sendingPascResponse.Result != null)
{
    var amount = sendingPascResponse.Result.Receivers[0].Amount;
    var description = sendingPascResponse.Result.Description;
    Console.WriteLine($"Successfully sent {amount} Pascals to a friend. Operation details: {description}");
}
else
{
    Console.WriteLine($"Transaction failed. Error details: {sendingPascResponse.Error.Message}");
}

Send data from one account to another account

Pascal network supports feature called 'Data Operations' which allows you to exchange data between accounts. Data is transmitted using payload field of the operation. Payload field can also be used in Pascal sending transactions (RPC API method SendToAsync). SendToAsync and SendDataAsync can be used for free (no operation fee for 1 operation per account per block). SendToAsync has minimum Pascals sending restriction set to 0.0001 Pasc or 1 Molina, but SendDataAsync does not have such restriction, therefore SendDataAsync can be used completely for free. SendDataAsync contains additional functionality useful to transmit data, more details in PIP-0033.

var identifier = new Guid("AAA19787-F847-4323-8987-2E652F593BCE");
var data = "This is a free chat message on Pascal blockchain! Find out more at https://www.pascalcoin.org";
var sendingDataResponse = await connector.SendDataAsync(senderAccount: 796500, receiverAccount: 834853, fee: 0,
    guid: identifier.ToString(), dataType: DataType.ChatMessage, payload: data);
if (sendingDataResponse.Result != null)
{
    var description = sendingDataResponse.Result.Description;
    Console.WriteLine($"Successfully sent important information to a friend. Operation details: {description}");
}
else
{
    Console.WriteLine($"Failed to chat with a friend, error details: {sendingDataResponse.Error.Message}");
}

Check the project repository for more use cases.

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net5.0

    • No dependencies.

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.0.4 352 5/20/2021
1.0.2 288 5/17/2021
1.0.1 413 4/13/2021
1.0.0 403 4/5/2021

Added AccountState Coin_Swap and Account_Swap.