Python client for CoinPayments API

Overview

pyCoinPayments - Python API client for CoinPayments

Updates

This library has now been converted to work with python3

This is an unofficial client for CoinPayments, a website that exposes an API which allows you to accept over 75 cryptocurrencies.

The Absolute Basics

CoinPayments has the following API routes available to POST against. This is a POST only api where API calls are made using a 'cmd' parameter.

Their official API endpoint is https://www.coinpayments.net/api.php all calls are made against the same URL. Normally (without this client) you'd need to pass a 'cmd' parameter like below to the endpoint to distinguish between the API calls. This client simplifies things so calling each API method automatically does this for you.

{'cmd':'get_basic_info'}

is how you would call the 'Get Basic Account Information' API, this is handled automatically by the methods in this API so calling

CryptoPayments().getBasicInfo()

does this for you.

Basic Program

To show you a basic using of the program I'm going to be calling the create_transaction method on the CoinPaymentsAPI

## Parameters for your call, these are defined in the CoinPayments API Docs
## https://www.coinpayments.net/apidoc

create_transaction_params = {
    'amount' : 10,
    'currency1' : 'USD',
    'currency2' : 'BTC'
}

#Client instance
client = CryptoPayments(API_KEY, API_SECRET, IPN_URL)

#make the call to createTransaction crypto payments API
transaction = client.createTransaction(create_transaction_params)


if transaction['error'] == 'ok':  #check error status 'ok' means the API returned with desired result
    print (transaction['amount']) #print some values from the result
    print (transaction['address'])
else:
    print (transaction['error'])


#Use previous tx Id returned from the previous createTransaction method to test the getTransactionInfo call
post_params1 = {
    'txid' : transaction['txn_id'],
}


transactionInfo = client.getTransactionInfo(post_params1) #call coinpayments API using instance

if transactionInfo['error'] == 'ok': #check error status 'ok' means the API returned with desired result
    print (transactionInfo['amountf'])
    print (transactionInfo['payment_address'])
else:
    print (transactionInfo['error'])

You can reference any of their return fields within the json as a field on the variable. For example the transaction.amount would print out the amount of requested cryptocurrency, same with the address. Their documentation outlines what it returned for fields in each request. The rest of the API client is very similar. Parameters are passed into the API method using a python dictionary, order in this case does not matter because the HMAC and encoded URL are generated at the same time.

Owner
James
James
Resources for the AMLD 2022 workshop "DevOps on AWS"

MLOPS on AWS | AMLD 2022 This repository contains all the resources necessary to follow along and reproduce the workshop "MLOps on AWS: a Hands-On Tut

xtream 8 Jun 16, 2022
Mass Instagram Checker

Mass Instagram Checker

X - MrG3P5 5 Nov 09, 2022
Cedric Owens 16 Sep 27, 2022
A Powerful Discord Webhook spammer

RocketHook | The discord spammer Some links: Telegram | Github FEATURES ๐Ÿค– Hide your ass and be a good robot ! Full proxies support HTTP/S, SOCKS4/5 S

Or 2 Feb 27, 2022
A Django-style ORM idea for manipulating Google Datastore entities

No SeiQueLa ORM EM DESENVOLVIMENTO Uma ideia de ORM no estilo do Django para manipular entidades do Google Datastore. Montando seu modelo: from noseiq

Geraldo Castro 16 Nov 01, 2022
๐ŸŽต RythmReloaded ๐ŸŽต A bot that can play music on Telegram Group and Channel Voice Chats

๐ŸŽต RythmReloaded ๐ŸŽต A bot that can play music on Telegram Group and Channel Voice Chats POWERED BY MARSHALX TGCALLS Available on telegram as @OptimusP

0 Nov 03, 2021
A custom Discord Rich Presence to display when you're studying so you're stupid friends won't disturb you when you're studying.

Studying RPC Description A custom Discord Rich Presence to display when you're studying so you're stupid friends won't disturb you when you're studyin

John Edmerson Pizarra 4 Nov 19, 2022
Enumerate Microsoft 365 Groups in a tenant with their metadata

Enumerate Microsoft 365 Groups in a tenant with their metadata Description The all_groups.py script allows to enumerate all Microsoft 365 Groups in a

Clรฉment Notin 46 Dec 26, 2022
Use an air-gapped Raspberry Pi Zero to sign for Bitcoin transactions! (and do other cool stuff)

Hello World! Build your own offline, airgapped Bitcoin transaction signing device for less than $35! Also generate seed word 24 or generate a seed phr

371 Dec 31, 2022
Discord heximals: More colors for your bot

DISCORD-HEXIMALS More colors for your bot ! Support : okimii#0434 COLORS ( 742 )

4 Feb 04, 2022
Andrei 1.4k Dec 24, 2022
A code to match you with the perfect Taylor Swift song for your mood and relationship status.

taylorswift A package for matching your current mood and relationship status to a suitable Taylor Swift song. Requirements: Python 2 or 3, and the num

Megan Mansfield 82 Dec 09, 2022
Your custom slash commands Discord bot!

Slashy - Your custom slash-commands bot Hey, I'm Slashy - your friendly neighborhood custom-command bot! The code for this bot exists because I'm like

Omar Zunic 8 Dec 20, 2022
๐€ ๐ฆ๐จ๐๐ฎ๐ฅ๐š๐ซ ๐“๐ž๐ฅ๐ž๐ ๐ซ๐š๐ฆ ๐†๐ซ๐จ๐ฎ๐ฉ ๐ฆ๐š๐ง๐š๐ ๐ž๐ฆ๐ž๐ง๐ญ ๐›๐จ๐ญ ๐ฐ๐ข๐ญ๐ก ๐ฎ๐ฅ๐ญ๐ข๐ฆ๐š๐ญ๐ž ๐Ÿ๐ž๐š๐ญ๐ฎ๐ซ๐ž๐ฌ !!

๐‡๐จ๐ฐ ๐“๐จ ๐ƒ๐ž๐ฉ๐ฅ๐จ๐ฒ For easiest way to deploy this Bot click on the below button ๐Œ๐š๐๐ž ๐๐ฒ ๐’๐ฎ๐ฉ๐ฉ๐จ๐ซ๐ญ ๐†๐ซ๐จ๐ฎ๐ฉ ๐’๐จ๐ฎ๐ซ๐œ๐ž๐ฌ ๐†๐ž๐ง๐ž?

Mukesh Solanki 1 Dec 10, 2021
Auto-Approved-Bot - Auto Approved Invaite Link Request Telegram Bot

๐Ÿค– ๐—”๐˜‚๐˜๐—ผ-๐—”๐—ฝ๐—ฝ๐—ฟ๐—ผ๐˜ƒ๐—ฒ-๐—•๐—ผ๐˜ ๐Ÿค– โ„น๏ธ ๐—จ๐˜€๐—ฒ๐—ด๐—ฒ โ„น๏ธ When a join request invita

Muhammed 32 Dec 18, 2022
A library that revolutionizes the way people interact with NextDNS.

NextDNS-API An awesome way to interface with your NextDNS account - via Python! Explore the docs ยป Report Bug . Request Feature Table Of Contents Abou

34 Dec 07, 2022
A modular Telegram group management bot running with Python based on Pyrogram.

A modular Telegram group management bot running with Python based on Pyrogram.

Jefanya Efandchris 1 Nov 14, 2022
Code for paper "Adversarial score matching and improved sampling for image generation"

Adversarial score matching and improved sampling for image generation This repo contains the official implementation for the ICLR 2021 paper Adversari

Alexia Jolicoeur-Martineau 114 Dec 11, 2022
Free & open source API service for obtaining information about +9600 universities worldwide.

Free & open source API service for obtaining information about +9600 universities worldwide.

Yagiz Degirmenci 57 Nov 04, 2022
just a program i made cuz a friend got tokenlogged and spammed me with these scam/phishing links so i made a programm to spam these websides with fake logins

scam-webside-spammer just a program i made cuz a friend got tokenlogged and spammed me with these scam/phishing links so i made a programm to spam the

TerrificTable 3 Sep 23, 2022