Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ r.create_deposit_address("BTCUSD", label="Main Bitcoin Address")
```python
r.withdraw_to_address("ETH", "0x0287b1B0032Dc42c16640F71BA06F1A87C3a7101", "20")
```
- [gas_fee_estimation](https://docs.gemini.com/rest-api/#gas-fee-estimation)
```python
r.gas_fee_estimation("ETH", "0x0287b1B0032Dc42c16640F71BA06F1A87C3a7101", "20")
```
- [revive_hearbeat](https://docs.gemini.com/rest-api/#ticker)
```python
r.revive_hearbeat()
Expand Down
19 changes: 19 additions & 0 deletions gemini/private_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,25 @@ def withdraw_to_address(self, currency, address, amount):
"amount": amount
}
return self.api_query('/v1/withdraw/{}'.format(currency), payload)

@typeassert(currency=str, address=str, amount=str)
def gas_fee_estimation (self, currency, address, amount):
"""
This will allow you to estimate gas fees given a currency, address, and amount

Args:
currency(str): ETH/AAVE etc see Symbols and Minimums Page: https://docs.gemini.com/rest-api/?python#symbols-and-minimums
address(str): The address you want the money to be sent to
amount(str): Amount you want to transfer

Results:
dict: A dict of the following fields: currency, fee, isOverride, monthlyLimit, monthlyRemaining
"""
payload = {
"address": address,
"amount": amount
}
return self.api_query('/v1/withdraw/{}/feeEstimate'.format(currency), payload)

# Transfers API
@typeassert(limit_transfers=int, show_completed_deposit_advances=bool)
Expand Down
7 changes: 6 additions & 1 deletion tests/test_private_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,12 @@ def test_withdraw_to_address(self):
r = PrivateClient("PUBLIC_KEY", "PRIVATE_CLIENT")
withdraw_to_address = r.withdraw_to_address("ETH", "200", "0x0287b1B0032Dc42c16640F71BA06F1A87C3a7101")
assert type(withdraw_to_address) is dict


def gas_fee_estimation(self):
r = PrivateClient("PUBLIC_KEY", "PRIVATE_CLIENT")
gas_fee_estimation = r.gas_fee_estimation("ETH", "200", "0x0287b1B0032Dc42c16640F71BA06F1A87C3a7101")
assert type(gas_fee_estimation) is dict

def test_revive_heartbeat(self):
r = client()
revive_hearbeat = r.revive_hearbeat()
Expand Down