diff --git a/ExampleETHDGB.py b/ExampleETHDGB.py new file mode 100644 index 0000000..ae81eea --- /dev/null +++ b/ExampleETHDGB.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python +# This program buys some Dgbcoins and sells them for a bigger price +from dovewallet import dovewallet + +# Get these from https://dovewallet.com/en/my-page/api +api = dovewallet('key', 'secret') + +# Market to trade at +fee = 0.001 +trade = 'ETH' +currency = 'DGB' +market = '{0}-{1}'.format(trade, currency) +# Amount of coins to buy +amount = 10 +# How big of a profit you want to make +your_profit = 1.03 +multiplier = your_profit + (2*fee) + +# Getting the ETH price for DGB +dgbsummary = api.getmarketsummary(market) +dgbprice_last = dgbsummary[0]['Last'] +print 'The price for {0} is {1:.8f} {2}.'.format(currency, dgbprice_last, trade) + +# Buying 10 DGB for ETH +dgbprice_buy = ( dgbprice * 0.995 ) +print 'Buying {0} {1} for {2:.8f} {3}.'.format(amount, currency, dgbprice_buy, trade) +api.buylimit(market, amount, dgbprice_buy) + +# Multiplying the price by the multiplier +dgbprice_sell = round(dgbprice_buy*multiplier, 8) + +# Selling 9.98 DGB for the new price +print 'Selling {0} {1} for {2:.8f} {3}.'.format(amount, currency, dgbprice_sell, trade) +api.selllimit(market, amount, dgbprice_sell) + +# Gets the DGB balance +dgbbalance = api.getbalance(currency) +print "Your balance is {0} {1}.".format(dgbbalance['Available'], currency) + +# For a full list of functions, check out dovewallet.py or https://developer.dovewallet.com/api/v1/ +# 2021/04/04 diff --git a/ExampleEthDash.py b/ExampleEthDash.py new file mode 100644 index 0000000..e144ccb --- /dev/null +++ b/ExampleEthDash.py @@ -0,0 +1,45 @@ + +#!/usr/bin/env python +# This program buys some Dash coins and sells them for a bigger price +from dovewallet import dovewallet + +# Get these from https://dovewallet.com/en/my-page/api +api = dovewallet('key', 'secret') + +# fee for trade +fee = 0.001 +# Market to trade at +trade = 'ETH' +currency = 'DASH' +market = '{0}-{1}'.format(trade, currency) +# Amount of coins to buy +amount = 0.005 + +# How big of a profit you want to make +your_profit = 1.03 +# (2*fee) = feeBuy + feeSell +multiplier = your_profit + (2*fee) + +# Getting the ETH price for DASH +currencysummary = api.getmarketsummary(market) +price_last = currencysummary[0]['Last'] +print 'The price for {0} is {1:.9f} {2}.'.format(currency, price_last, trade) + +# Buying 0.005 DASH for ETH +price_buy = ( price_last * 0.995 ) +print 'Buying {0} {1} for {2:.9f} {3}.'.format(amount, currency, price_buy, trade) +api.buylimit(market, amount*(1+fee) , price_buy) + +# Multiplying the price by the multiplier +price_sell = round( price_buy * multiplier, 9) + +# Selling 0.005 DASH for the new price +print 'Selling {0} {1} for {2:.9f} {3}.'.format(amount, currency, price_sell, trade) +api.selllimit(market, amount, price_sell) + +# Gets the DASH balance +balance = api.getbalance(currency) +print "Your balance is {0} {1}.".format(balance['Available'], currency) + +# For a full list of functions, check out dovewallet.py or https://developer.dovewallet.com/api/v1/ +# 2021/04/04 diff --git a/README.md b/README.md index 0dbad5b..d0e8a6f 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,22 @@ -python-bittrex +Python-BtxPro(Dovewallet) = -python-bittrex is a Python library for the Bittrex API v1.1. +Python-Dovewallet is a Python library for the Dovewallet API v1.1. -Use this to sell mined coins, write a trading bot or do whatever your heart desires. +Use this to sell mined coins, write 3 trading bots or do whatever your heart desires. Getting started = -Get your API keys from https://bittrex.com/Account/ManageApiKey, download bittrex.py and place it in the same directory as your script. +Get your API keys from https://dovewallet.com/en/my-page/api, download dovewallet.py and place it in the same directory as your script. #!/usr/bin/env python - from bittrex import bittrex + from dovewallet import dovewallet - api = bittrex('key', 'secret') + api = dovewallet('key', 'secret') - print api.getticker('BTC-DOGE') + print api.getticker('BTC-DASH') example.py @@ -24,4 +24,4 @@ example.py The example program buys 100 DOGE for the current price and sells them for a higher price. It also shows some other functions. -Check out https://bittrex.com/Home/Api or read the source code for a full list of functions. +Check out https://developer.dovewallet.com/api/v1/ or read the source code for a full list of functions. diff --git a/bittrex.py b/dovewallet.py similarity index 95% rename from bittrex.py rename to dovewallet.py index 63a0f6e..31b42da 100644 --- a/bittrex.py +++ b/dovewallet.py @@ -8,7 +8,7 @@ import hmac import hashlib -class bittrex(object): +class dovewallet(object): def __init__(self, key, secret): self.key = key @@ -20,11 +20,11 @@ def __init__(self, key, secret): def query(self, method, values={}): if method in self.public: - url = 'https://bittrex.com/api/v1.1/public/' + url = 'https://api.dovewallet.com/v1.1/public/' elif method in self.market: - url = 'https://bittrex.com/api/v1.1/market/' + url = 'https://api.dovewallet.com/v1.1/market/' elif method in self.account: - url = 'https://bittrex.com/api/v1.1/account/' + url = 'https://api.dovewallet.com/v1.1/account/' else: return 'Something went wrong, sorry.' diff --git a/example.py b/example.py index a51429a..8f41afe 100644 --- a/example.py +++ b/example.py @@ -1,9 +1,9 @@ #!/usr/bin/env python # This program buys some Dogecoins and sells them for a bigger price -from bittrex import bittrex +from dovewallet import dovewallet -# Get these from https://bittrex.com/Account/ManageApiKey -api = bittrex('key', 'secret') +# Get these from https://dovewallet.com/en/my-page/api +api = dovewallet('key', 'secret') # Market to trade at trade = 'BTC' @@ -34,4 +34,4 @@ dogebalance = api.getbalance(currency) print "Your balance is {0} {1}.".format(dogebalance['Available'], currency) -# For a full list of functions, check out bittrex.py or https://bittrex.com/Home/Api +# For a full list of functions, check out dovewallet.py or https://developer.dovewallet.com/api/v1/