Blockchain Bitcoin Developer APIs - C#
C#
Clone or download
assafY and pdpi Client cleanup (#26)
* moved all models to Models namespace

* moved all models to Models namespace

* began block explorer cleanup

* finished work on block explorer.

* completely finished with block explorer including tests and docs - multiple addresses still in question

* completely finished with block explorer including tests and docs - multiple addresses still in question

* added indentation

* fixed block explorer docs

* changed walletCreator namespace, updated readme

* updated more docs

* completed fix and documentation of wallet classes

* completed fix and documentation of wallet classes

* broken tests fixed and passing

* fixed some doc formatting

* started implementation of additional statistics methods

* implemetned chart methods and fixed unit and integration tests

* implemented getPools method and created unit and integration tests

* added new files and updated docs

* implemented receive payments v2 generate method and docs

* updated readme

* some readme and doc fixes

* bumped up version

* implemetned multi address method, including unit and integration tests

* added limit parameter to unspent outputs method

* finished work on the block explorer. Updated docs

* added from btc method, updated docs, added unit and integration tests

* finished work on the exchange rate explorer

* bug fix and implementation of get xpub

* added xpub model

* block explorer completely finished pre testing

* added get xpub tests

* implemented missing methods to receive payment calss

* updated documentation

* added filter type param to multi addr method

* fixed parameter typo in block explorer

* added comments for GetPools

* added rolling aerage param to get chart method

* updated get address limit defaults

* docs chart name correction

* fixed xpub object
Latest commit 00bde43 May 4, 2017
Permalink
Failed to load latest commit information.
docs Client cleanup (#26) May 4, 2017
src Client cleanup (#26) May 4, 2017
.gitignore Migrate/netcore (#24) Mar 27, 2017
LICENSE.txt Rename license to LICENSE.txt Oct 8, 2014
README.md Client cleanup (#26) May 4, 2017

README.md

Blockchain API library (C#, .NET Core, v1)

An official C# (.NET Core) library for interacting with the Blockchain.info API.

Latest changes

This library is a migration of the original .NET library to .NET Core. Some models and namespaces have been modified. Most notably:

  • Receive Payments v2 API functionality has been introduced
  • Additional chart functionality has been added to the StatisticsExplorer class
  • All documentation has been brought up to date
  • All models have been moved to Info.Blockchain.API.Models
  • The client, exception and helper classes under the root namespace have been moved to Info.Blockchain.API.Client
  • CreateWallet.cs, which previously contained the CreateWallet response and request models, was split into two separate models and moved to the Data namespace
  • The Info.Blockchain.API.CreateWallet namespace was removed, the WalletCreator.cs class moved to Info.Blockchain.API.Wallet

Getting started

The library requires .NET Core 1.1. It is possible to use this library with the .NET Framework by editing Info.Blockchain.Api.csproj

and changing

<TargetFramework>netcoreapp1.1</TargetFramework>

to your project's .NET version, e.g.

<TargetFramework>net46</TargetFramework>

The recommended way to install and use the library is via NuGet:

PM> Install-Package BlockchainAPI

The library consists of the following namespaces:

The following namespacse contain helpers and models used by the above:

  • Info.Blockchain.API.Client
  • Info.Blockchain.API.Data
  • Info.Blockchain.API.Json

In order to use the Wallet and CreateWallet functionality, you must provide a URL to an instance of service-my-wallet-v3 as first parameter to BlockchainApiHelper. If you don't intend to use these functionalities, this parameter can be null.

Error handling

All methods may throw exceptions caused by incorrectly passed parameters or other problems. If a call is rejected server-side, the APIException exception will be thrown. Other exceptions may also be thrown by the environment (e.g. no internet connection etc).

Connection timeouts

It is possible to set arbitrary connection timeouts.

// time out after 5 seconds
Info.Blockchain.API.HttpClient.TimeoutMs = 5000;

Request limits and API keys

In order to prevent abuse some API methods require an API key approved with some basic contact information and a description of its intended use. Please request an API key here. The API key can be passed to the constructor of the BlockchainHttpClient class, which can be passed to the constructor of all other classes in this library.

The same API key can be used to bypass the request limiter.