Skip to content

CoinPayments crypto payment gateway API Client for Python

License

Notifications You must be signed in to change notification settings

OnGridSystems/coinpayments-py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CoinPayments API Client

Build Status PyPI version License PyPI - Python Version PRs Welcome

Use this library to easily interact with CoinPayments crypto/coin payment gateway API directly from your Python 3 application.

Documentation

Installation

Use pip to install coinpayments-py:

pip install coinpayments-py

Basic Usage

Initialize api object

>>> from coinpayments import CoinPaymentsAPI

>>> api = CoinPaymentsAPI(public_key='your_api_public_key',
                          private_key='your_api_private_key')

Call any CoinPayments API method as api object method with corresponding arguments

>>> api.rates()
{'error': 'ok', 'result': 'LTCT': {'balance': 839700000, 'balancef': '8.39700000', 'status': 'available', 'coin_status': 'online'}}}

>>> api.get_callback_address(currency='BTC', ipn_url='http://example.com')
{'error': 'ok', 'result': {'address': '36v6r1XuaWPtrTuhF8iq8AfBzPS8D4eios'}}

Also, you can check IPN HMAC signature using check_signature method

>>> from coinpayments import CoinPaymentsAPI
>>> api = CoinPaymentsAPI(public_key=None,
                          private_key='your_ipn_secret_key')
>>> api.check_signature('ipn_message', 'ipn signautre')
False

Contributing

Contributions are welcome. You can learn how from this free series How to Contribute to an Open Source Project on GitHub.

Releases

No releases published

Packages

No packages published

Languages