Skip to content

Commit a241996

Browse files
author
arianoangelo
committed
v1.1.0
* Added Payouts * Minor bugfixes
1 parent 0151cc4 commit a241996

File tree

4 files changed

+49
-2
lines changed

4 files changed

+49
-2
lines changed

README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,25 @@ Where:
127127

128128
> Response is an array with all supported coins.
129129
130+
### Request Payout
131+
132+
```python
133+
from blockbee import BlockBeeHelper
134+
135+
payout = BlockBeeHelper.create_payout(coin, address, value, apiKey)
136+
```
137+
138+
This function can be used by you to request payouts (withdrawals in your platform).
139+
140+
Where:
141+
* ``coin`` The cryptocurrency you want to request the Payout in (e.g `btc`, `eth`, `erc20_usdt`, ...).
142+
* ``address`` Address where the Payout must be sent to.
143+
* ``value`` Amount to send to the ``address``.
144+
* ``api_key`` is the API Key provided by BlockBee's [dashboard](https://dash.blockbee.io/).
145+
146+
> The response will be only a ``success`` to confirm the Payout Request was successfully created. To fulfill it you will need to go to BlockBee Dashboard.
147+
148+
130149
## Help
131150

132151
Need help?
@@ -146,4 +165,8 @@ Contact us @ https://blockbee.io/contacts/
146165

147166
#### 1.0.3
148167
* Fix import
149-
* Minor fixes
168+
* Minor fixes
169+
170+
#### 1.1.0
171+
* Added Payouts
172+
* Minor bugfixes

blockbee/BlockBee.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,24 @@ def get_estimate(coin, addresses=1, priority='default', api_key=''):
168168

169169
return None
170170

171+
@staticmethod
172+
def create_payout(coin, address, value, api_key=''):
173+
if api_key is None:
174+
raise Exception("API Key Missing")
175+
176+
params = {
177+
'value': value,
178+
'address': address,
179+
'apikey': api_key
180+
}
181+
182+
_payout = BlockBeeHelper.process_request(coin, endpoint='payout', params=params)
183+
184+
if _payout:
185+
return _payout
186+
187+
return None
188+
171189
@staticmethod
172190
def process_request(coin='', endpoint='', params=None):
173191
if coin != '':

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
name='python-blockbee',
1212

13-
version='1.0.3',
13+
version='1.1.0',
1414

1515
packages=find_packages(),
1616

test.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,9 @@
5151
"""
5252
print('Get Estimate')
5353
print(bb.get_estimate('ltc', api_key=apikey))
54+
55+
"""
56+
Create Payout
57+
"""
58+
print('Create Payout')
59+
print(bb.create_payout('bep20_usdt', '0xA6B78B56ee062185E405a1DDDD18cE8fcBC4395d', 1, api_key=apikey))

0 commit comments

Comments
 (0)