Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/melbournedeveloper/cryptocurrency.net
CryptoCurrency.Net
https://github.com/melbournedeveloper/cryptocurrency.net
api-client bitcoin bitcoin-api bitcoin-cash bitcoin-exchange bitcoin-price blockchain cryptocurrency ethereum
Last synced: 15 days ago
JSON representation
CryptoCurrency.Net
- Host: GitHub
- URL: https://github.com/melbournedeveloper/cryptocurrency.net
- Owner: MelbourneDeveloper
- License: mit
- Created: 2018-04-28T06:53:02.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T05:25:55.000Z (almost 2 years ago)
- Last Synced: 2024-10-12T01:25:44.409Z (about 1 month ago)
- Topics: api-client, bitcoin, bitcoin-api, bitcoin-cash, bitcoin-exchange, bitcoin-price, blockchain, cryptocurrency, ethereum
- Language: C#
- Size: 365 KB
- Stars: 19
- Watchers: 4
- Forks: 6
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Funding: FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# CryptoCurrency.Net
[![Build Status](https://dev.azure.com/christianfindlay0657/christian_findlay/_apis/build/status/MelbourneDeveloper.CryptoCurrency.Net?branchName=master)](https://dev.azure.com/christianfindlay0657/christian_findlay/_build/latest?definitionId=3&branchName=master)
Cross platform C# library for general Crypto Currency functionality, communicating with Cryptocurrency exchanges, and Blockchain APIs.
This library is designed for any project that works with cryptocurrency in any way. It attempts to put a layer over several aspects of querying the blockchain such as getting address balances, transactions and so on.
Join us on Slack:
https://hardwarewallets.slack.comTwitter:
https://twitter.com/HardfolioAppBlog:
https://christianfindlay.wordpress.comCurrently supports:
* .NET Framework
* .NET Core
* Android
* UWP
* Linux*
* MacOS*
* iOS**these platforms should work, but remain untested
## Quick Start
- Clone the repo and open the solution
- Compile and run one of the unit testsOr...
Install the NuGet and use the example code.
```cs
//Output: Address:
//qzl8jth497mtckku404cadsylwanm3rfxsx0g38nwlqzl8jth497mtckku404cadsylwanm3rfxsx0g38nwl Balance: 0
public async Task GetBitcoinCashAddresses()
{
var blockchainClientManager = new BlockchainClientManager(new RESTClientFactory());
var addresses = await blockchainClientManager.GetAddresses(
CurrencySymbol.BitcoinCash,new List
{
"qzl8jth497mtckku404cadsylwanm3rfxsx0g38nwlqzl8jth497mtckku404cadsylwanm3rfxsx0g38nwl",
"bitcoincash:qrcuqadqrzp2uztjl9wn5sthepkg22majyxw4gmv6p"
});
var address = addresses[CurrencySymbol.BitcoinCash].First();
Console.WriteLine
(
$"Address: {address.Address} Balance: { address.Balance }"
);
}
``````cs
//Output: Token: RHOC Balance: 0.49048
public async Task GetERC20Tokens()
{
var result = await _BlockchainClientManager.GetAddresses(CurrencySymbol.Ethereum,
new List { "0xA3079895DD50D9dFE631e8f09F3e3127cB9a4970" });
var nonEthereumResult = result.FirstOrDefault(a => !a.Key.Equals(CurrencySymbol.Ethereum));
Console.WriteLine(
$"Token: {nonEthereumResult.Key} Balance: {nonEthereumResult.Value.First().Balance}");
}
``````cs
//Output:
//Currency: ETH Balance: 0.????????
//Currency: BNB Balance: 0.????????
//Currency: EOS Balance: 0.????????
//public async Task GetBinanceAddresses()
{
var binanceClient = new BinanceClient(ApiKey, ApiSecret, new RESTClientFactory());
var holdings = await binanceClient.GetHoldings(binanceClient);
foreach(var holding in holdings.Result)
{
Console.WriteLine($"Currency: {holding.Symbol} Balance: {holding.HoldingAmount}");
}
}
```## NuGet
Install-Package CryptoCurrency.Net
## Contribution
I welcome feedback, and pull requests. If there's something that you need to change in the library, please log an issue, and explain the problem. If you have a proposed solution, please write it up and explain why you think it is the answer to the problem. The best way to highlight a bug is to submit a pull request with a unit test that fails so I can clearly see what the problem is in the first place.
### Pull Requests
Please break pull requests up in to their smallest possible parts. If you have a small feature of refactor that other code depends on, try submitting that first. Please try to reference an issue so that I understand the context of the pull request. If there is no issue, I don't know what the code is about. If you need help, please jump on Slack here: https://hardwarewallets.slack.com
## Donate
All my libraries are open source and free. Your donations will contribute to making sure that these libraries keep up with the latest blockahin APIs, hardwarewallet firmware, and functions are implemented, and the quality is maintained.
Bitcoin: 33LrG1p81kdzNUHoCnsYGj6EHRprTKWu3U
Ethereum: 0x7ba0ea9975ac0efb5319886a287dcf5eecd3038e
Litecoin: MVAbLaNPq7meGXvZMU4TwypUsDEuU6stpY
## Store App Production Usage
This app currently only Supports Trezor (https://github.com/MelbourneDeveloper/Trezor.Net) but it will soon support Ledger with this library.
https://play.google.com/store/apps/details?id=com.Hardfolio (Android)
https://www.microsoft.com/en-au/p/hardfolio/9p8xx70n5d2j (UWP)
## See Also
[Trezor.Net](https://github.com/MelbourneDeveloper/Trezor.Net) - Trezor Hardwarewallet Library
[Ledger.Net](https://github.com/MelbourneDeveloper/Ledger.Net) - Ledger Hardwarewallet Library
[KeepKey.Net](https://github.com/MelbourneDeveloper/KeepKey.Net) - KeepKey Hardwarewallet Library