|
|
@ -1,3 +1,6 @@
|
|
|
|
|
|
|
|
# Twisted/Klein imports
|
|
|
|
|
|
|
|
from twisted.internet.defer import inlineCallbacks
|
|
|
|
|
|
|
|
|
|
|
|
# Other library imports
|
|
|
|
# Other library imports
|
|
|
|
from json import dumps
|
|
|
|
from json import dumps
|
|
|
|
from random import choices
|
|
|
|
from random import choices
|
|
|
@ -95,7 +98,7 @@ class Transactions(util.Base):
|
|
|
|
# Amount is reliable here as it is checked by find_trade, so no need for stored_trade["amount"]
|
|
|
|
# Amount is reliable here as it is checked by find_trade, so no need for stored_trade["amount"]
|
|
|
|
if float(amount_usd) > float(settings.Agora.AcceptableAltLookupUSD):
|
|
|
|
if float(amount_usd) > float(settings.Agora.AcceptableAltLookupUSD):
|
|
|
|
self.log.info("Not checking against amount and currency as amount exceeds MAX")
|
|
|
|
self.log.info("Not checking against amount and currency as amount exceeds MAX")
|
|
|
|
self.irc.sendmsg(f"Not checking against amount and currency as amount exceeds MAX")
|
|
|
|
self.irc.sendmsg("Not checking against amount and currency as amount exceeds MAX")
|
|
|
|
# Close here if the amount exceeds the allowable limit for no reference
|
|
|
|
# Close here if the amount exceeds the allowable limit for no reference
|
|
|
|
self.ux.notify.notify_tx_lookup_failed(currency, amount, reference, "EXCEEDS_MAX")
|
|
|
|
self.ux.notify.notify_tx_lookup_failed(currency, amount, reference, "EXCEEDS_MAX")
|
|
|
|
return False
|
|
|
|
return False
|
|
|
@ -166,6 +169,7 @@ class Transactions(util.Base):
|
|
|
|
return False
|
|
|
|
return False
|
|
|
|
return True
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@inlineCallbacks
|
|
|
|
def transaction(self, data):
|
|
|
|
def transaction(self, data):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
Store details of transaction and post notifications to IRC.
|
|
|
|
Store details of transaction and post notifications to IRC.
|
|
|
@ -252,8 +256,9 @@ class Transactions(util.Base):
|
|
|
|
# self.log.error(f"Cannot release trade {reference}.")
|
|
|
|
# self.log.error(f"Cannot release trade {reference}.")
|
|
|
|
# return
|
|
|
|
# return
|
|
|
|
|
|
|
|
|
|
|
|
self.release_funds(stored_trade["id"], stored_trade["reference"])
|
|
|
|
yield self.release_funds(stored_trade["id"], stored_trade["reference"])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@inlineCallbacks
|
|
|
|
def release_funds(self, trade_id, reference):
|
|
|
|
def release_funds(self, trade_id, reference):
|
|
|
|
stored_trade = db.get_ref(reference)
|
|
|
|
stored_trade = db.get_ref(reference)
|
|
|
|
platform = stored_trade["subclass"]
|
|
|
|
platform = stored_trade["subclass"]
|
|
|
@ -267,7 +272,7 @@ class Transactions(util.Base):
|
|
|
|
release = self.lbtc.release_funds
|
|
|
|
release = self.lbtc.release_funds
|
|
|
|
post_message = self.lbtc.api.contact_message_post
|
|
|
|
post_message = self.lbtc.api.contact_message_post
|
|
|
|
|
|
|
|
|
|
|
|
rtrn = release(trade_id)
|
|
|
|
rtrn = yield release(trade_id)
|
|
|
|
if rtrn["message"] == "OK":
|
|
|
|
if rtrn["message"] == "OK":
|
|
|
|
post_message(trade_id, "Thanks! Releasing now :)")
|
|
|
|
post_message(trade_id, "Thanks! Releasing now :)")
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|