forked from Manny27nyc/CryptAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simple API wrapper in .NET for CryptAPI (unofficial)
- Loading branch information
Biitez
committed
Apr 30, 2021
1 parent
5d1cbfd
commit a39f754
Showing
21 changed files
with
231 additions
and
466 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>netcoreapp3.1</TargetFramework> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Reference Include="CryptAPI"> | ||
<HintPath>..\CryptAPI\bin\Debug\netstandard2.1\CryptAPI.dll</HintPath> | ||
</Reference> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
using System; | ||
using CryptAPI.Enums; | ||
using CryptAPI.Models; | ||
|
||
namespace CryptAPI.Test | ||
{ | ||
class Program | ||
{ | ||
static void Main(string[] args) | ||
{ | ||
|
||
try | ||
{ | ||
var CryptApi = new CryptAPI(CryptoCurrency.BTC); | ||
|
||
var address_in = CryptApi.CreateCharge("13YWjVEctF8DcdtyW1cEpkXPnGMwbznevW", CallBack: "https://biitez.dev/"); | ||
|
||
var callbacklogs = CryptApi.CallBackLogs("https://biitez.dev/"); | ||
|
||
Console.WriteLine(address_in + Environment.NewLine); | ||
|
||
foreach (var i in callbacklogs.callbacks) | ||
{ | ||
Console.WriteLine(i.last_update); | ||
Console.WriteLine(i.txid_in); | ||
Console.WriteLine(i.confirmations); | ||
|
||
foreach (var e in i.logs) | ||
{ | ||
Console.WriteLine(e.request_url); | ||
Console.WriteLine(e.timestamp); | ||
Console.WriteLine(e.next_try); | ||
Console.WriteLine(e.request_url); | ||
} | ||
} | ||
|
||
} | ||
catch (Exception ex) | ||
{ | ||
Console.WriteLine(ex.Message); | ||
//Console.WriteLine(ex.InnerException.Message); | ||
} | ||
|
||
Console.ReadLine(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace CryptAPI.Enums | ||
{ | ||
public enum CryptoCurrency | ||
{ | ||
BTC, // Bitcoin | ||
BCH, // Bitcoin Cash | ||
LTC, // Litecoin | ||
ETH, // Ethereum | ||
XMR, // Monero | ||
TRX, // Tron | ||
IOTA // Iota | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace CryptAPI.Models | ||
{ | ||
public class Log | ||
{ | ||
public string request_url { get; set; } | ||
public string response { get; set; } | ||
public string response_status { get; set; } | ||
public string timestamp { get; set; } | ||
public string next_try { get; set; } | ||
public bool pending { get; set; } | ||
public bool success { get; set; } | ||
} | ||
|
||
public class Callback | ||
{ | ||
public string last_update { get; set; } | ||
public string result { get; set; } | ||
public int confirmations { get; set; } | ||
public string fee_percent { get; set; } | ||
public int fee { get; set; } | ||
public int value { get; set; } | ||
public string value_coin { get; set; } | ||
public int value_forwarded { get; set; } | ||
public string value_forwarded_coin { get; set; } | ||
public string txid_in { get; set; } | ||
public string txid_out { get; set; } | ||
public List<Log> logs { get; set; } | ||
} | ||
|
||
public class CallbackLogs | ||
{ | ||
public string status { get; set; } | ||
public string callback_url { get; set; } | ||
public string address_in { get; set; } | ||
public string address_out { get; set; } | ||
public bool notify_pending { get; set; } | ||
public int notify_confirmations { get; set; } | ||
public string priority { get; set; } | ||
public List<Callback> callbacks { get; set; } | ||
} | ||
|
||
} |
Oops, something went wrong.