|
|
@ -12,7 +12,7 @@ class IRCCommands(object):
|
|
|
|
helptext = "Get all open trades."
|
|
|
|
helptext = "Get all open trades."
|
|
|
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
@staticmethod
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, revolut, tx):
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, revolut, tx, notify):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
Get details of open trades and post on IRC.
|
|
|
|
Get details of open trades and post on IRC.
|
|
|
|
"""
|
|
|
|
"""
|
|
|
@ -32,7 +32,7 @@ class IRCCommands(object):
|
|
|
|
helptext = "Create an ad. Usage: create <XMR/BTC> <country> <currency>"
|
|
|
|
helptext = "Create an ad. Usage: create <XMR/BTC> <country> <currency>"
|
|
|
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
@staticmethod
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, revolut, tx):
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, revolut, tx, notify):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
Post an ad on AgoraDesk with the given country and currency code.
|
|
|
|
Post an ad on AgoraDesk with the given country and currency code.
|
|
|
|
"""
|
|
|
|
"""
|
|
|
@ -52,7 +52,7 @@ class IRCCommands(object):
|
|
|
|
helptext = "Get messages. Usage: messages [<reference>]"
|
|
|
|
helptext = "Get messages. Usage: messages [<reference>]"
|
|
|
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
@staticmethod
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, revolut, tx):
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, revolut, tx, notify):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
Get all messages for all open trades or a given trade.
|
|
|
|
Get all messages for all open trades or a given trade.
|
|
|
|
"""
|
|
|
|
"""
|
|
|
@ -86,7 +86,7 @@ class IRCCommands(object):
|
|
|
|
helptext = "Distribute all our chosen currency and country ad pairs."
|
|
|
|
helptext = "Distribute all our chosen currency and country ad pairs."
|
|
|
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
@staticmethod
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, revolut, tx):
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, revolut, tx, notify):
|
|
|
|
# Distribute out our ad to all countries in the config
|
|
|
|
# Distribute out our ad to all countries in the config
|
|
|
|
for x in agora.dist_countries():
|
|
|
|
for x in agora.dist_countries():
|
|
|
|
if x["success"]:
|
|
|
|
if x["success"]:
|
|
|
@ -100,7 +100,7 @@ class IRCCommands(object):
|
|
|
|
# helptext = "Use a bruteforce algorithm to create all possible currency and country pairs."
|
|
|
|
# helptext = "Use a bruteforce algorithm to create all possible currency and country pairs."
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# @staticmethod
|
|
|
|
# @staticmethod
|
|
|
|
# def run(cmd, spl, length, authed, msg, agora, revolut, tx):
|
|
|
|
# def run(cmd, spl, length, authed, msg, agora, revolut, tx, notify):
|
|
|
|
# for x in agora.dist_bruteforce():
|
|
|
|
# for x in agora.dist_bruteforce():
|
|
|
|
# if x["success"]:
|
|
|
|
# if x["success"]:
|
|
|
|
# msg(f"{x['response']['data']['message']}: {x['response']['data']['ad_id']}")
|
|
|
|
# msg(f"{x['response']['data']['message']}: {x['response']['data']['ad_id']}")
|
|
|
@ -113,7 +113,7 @@ class IRCCommands(object):
|
|
|
|
# helptext = "Resume a run of brute by getting all our adverts then filling the blanks."
|
|
|
|
# helptext = "Resume a run of brute by getting all our adverts then filling the blanks."
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# @staticmethod
|
|
|
|
# @staticmethod
|
|
|
|
# def run(cmd, spl, length, authed, msg, agora, revolut, tx):
|
|
|
|
# def run(cmd, spl, length, authed, msg, agora, revolut, tx, notify):
|
|
|
|
# for x in agora.bruteforce_fill_blanks():
|
|
|
|
# for x in agora.bruteforce_fill_blanks():
|
|
|
|
# if x["success"]:
|
|
|
|
# if x["success"]:
|
|
|
|
# msg(f"{x['response']['data']['message']}: {x['response']['data']['ad_id']}")
|
|
|
|
# msg(f"{x['response']['data']['message']}: {x['response']['data']['ad_id']}")
|
|
|
@ -126,7 +126,7 @@ class IRCCommands(object):
|
|
|
|
helptext = "Remove all duplicate adverts."
|
|
|
|
helptext = "Remove all duplicate adverts."
|
|
|
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
@staticmethod
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, revolut, tx):
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, revolut, tx, notify):
|
|
|
|
rtrn = agora.strip_duplicate_ads()
|
|
|
|
rtrn = agora.strip_duplicate_ads()
|
|
|
|
msg(dumps(rtrn))
|
|
|
|
msg(dumps(rtrn))
|
|
|
|
|
|
|
|
|
|
|
@ -136,7 +136,7 @@ class IRCCommands(object):
|
|
|
|
helptext = "Find a transaction. Usage: find <currency> <amount>"
|
|
|
|
helptext = "Find a transaction. Usage: find <currency> <amount>"
|
|
|
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
@staticmethod
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, revolut, tx):
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, revolut, tx, notify):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
Find a transaction received by Revolut with the given reference and amount.
|
|
|
|
Find a transaction received by Revolut with the given reference and amount.
|
|
|
|
"""
|
|
|
|
"""
|
|
|
@ -158,7 +158,7 @@ class IRCCommands(object):
|
|
|
|
helptext = "Get all account information from Revolut."
|
|
|
|
helptext = "Get all account information from Revolut."
|
|
|
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
@staticmethod
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, revolut, tx):
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, revolut, tx, notify):
|
|
|
|
accounts = revolut.accounts()
|
|
|
|
accounts = revolut.accounts()
|
|
|
|
accounts_posted = 0
|
|
|
|
accounts_posted = 0
|
|
|
|
if accounts is None:
|
|
|
|
if accounts is None:
|
|
|
@ -180,7 +180,7 @@ class IRCCommands(object):
|
|
|
|
helptext = "Get total account balance from Revolut in USD."
|
|
|
|
helptext = "Get total account balance from Revolut in USD."
|
|
|
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
@staticmethod
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, revolut, tx):
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, revolut, tx, notify):
|
|
|
|
total_usd = revolut.get_total_usd()
|
|
|
|
total_usd = revolut.get_total_usd()
|
|
|
|
if total_usd is False:
|
|
|
|
if total_usd is False:
|
|
|
|
msg("Error getting total balance.")
|
|
|
|
msg("Error getting total balance.")
|
|
|
@ -192,7 +192,7 @@ class IRCCommands(object):
|
|
|
|
helptext = "Get total account balance from Revolut and Agora."
|
|
|
|
helptext = "Get total account balance from Revolut and Agora."
|
|
|
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
@staticmethod
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, revolut, tx):
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, revolut, tx, notify):
|
|
|
|
totals_all = tx.get_total()
|
|
|
|
totals_all = tx.get_total()
|
|
|
|
totals = totals_all[0]
|
|
|
|
totals = totals_all[0]
|
|
|
|
wallets = totals_all[1]
|
|
|
|
wallets = totals_all[1]
|
|
|
@ -208,13 +208,22 @@ class IRCCommands(object):
|
|
|
|
def run(cmd, spl, length, authed, msg):
|
|
|
|
def run(cmd, spl, length, authed, msg):
|
|
|
|
msg("Pong!")
|
|
|
|
msg("Pong!")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class summon(object):
|
|
|
|
|
|
|
|
name = "summon"
|
|
|
|
|
|
|
|
authed = True
|
|
|
|
|
|
|
|
helptext = "Summon all operators."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, revolut, tx, notify):
|
|
|
|
|
|
|
|
notify.sendmsg("You have been summoned!")
|
|
|
|
|
|
|
|
|
|
|
|
class release_url(object):
|
|
|
|
class release_url(object):
|
|
|
|
name = "release_url"
|
|
|
|
name = "release_url"
|
|
|
|
authed = True
|
|
|
|
authed = True
|
|
|
|
helptext = "Get release URL for all open trades."
|
|
|
|
helptext = "Get release URL for all open trades."
|
|
|
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
@staticmethod
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, revolut, tx):
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, revolut, tx, notify):
|
|
|
|
trades = agora.dashboard_release_urls()
|
|
|
|
trades = agora.dashboard_release_urls()
|
|
|
|
if not trades:
|
|
|
|
if not trades:
|
|
|
|
msg("No trades.")
|
|
|
|
msg("No trades.")
|
|
|
@ -227,7 +236,7 @@ class IRCCommands(object):
|
|
|
|
helptext = "Send a message on a trade. Usage: msg <reference> <message...>"
|
|
|
|
helptext = "Send a message on a trade. Usage: msg <reference> <message...>"
|
|
|
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
@staticmethod
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, revolut, tx):
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, revolut, tx, notify):
|
|
|
|
if length > 2:
|
|
|
|
if length > 2:
|
|
|
|
full_msg = " ".join(spl[2:])
|
|
|
|
full_msg = " ".join(spl[2:])
|
|
|
|
reference = tx.ref_to_tx(spl[1])
|
|
|
|
reference = tx.ref_to_tx(spl[1])
|
|
|
@ -243,7 +252,7 @@ class IRCCommands(object):
|
|
|
|
helptext = "List all references"
|
|
|
|
helptext = "List all references"
|
|
|
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
@staticmethod
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, revolut, tx):
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, revolut, tx, notify):
|
|
|
|
msg(f"References: {', '.join(tx.get_refs())}")
|
|
|
|
msg(f"References: {', '.join(tx.get_refs())}")
|
|
|
|
|
|
|
|
|
|
|
|
class ref(object):
|
|
|
|
class ref(object):
|
|
|
@ -252,7 +261,7 @@ class IRCCommands(object):
|
|
|
|
helptext = "Get more information about a reference. Usage: ref <reference>"
|
|
|
|
helptext = "Get more information about a reference. Usage: ref <reference>"
|
|
|
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
@staticmethod
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, revolut, tx):
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, revolut, tx, notify):
|
|
|
|
if length == 2:
|
|
|
|
if length == 2:
|
|
|
|
ref_data = tx.get_ref(spl[1])
|
|
|
|
ref_data = tx.get_ref(spl[1])
|
|
|
|
if not ref_data:
|
|
|
|
if not ref_data:
|
|
|
@ -266,7 +275,7 @@ class IRCCommands(object):
|
|
|
|
helptext = "Delete a reference. Usage: del <reference>"
|
|
|
|
helptext = "Delete a reference. Usage: del <reference>"
|
|
|
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
@staticmethod
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, revolut, tx):
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, revolut, tx, notify):
|
|
|
|
if length == 2:
|
|
|
|
if length == 2:
|
|
|
|
ref_data = tx.get_ref(spl[1])
|
|
|
|
ref_data = tx.get_ref(spl[1])
|
|
|
|
if not ref_data:
|
|
|
|
if not ref_data:
|
|
|
@ -281,7 +290,7 @@ class IRCCommands(object):
|
|
|
|
helptext = "Release funds for a trade. Usage: release <reference>"
|
|
|
|
helptext = "Release funds for a trade. Usage: release <reference>"
|
|
|
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
@staticmethod
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, revolut, tx):
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, revolut, tx, notify):
|
|
|
|
if length == 2:
|
|
|
|
if length == 2:
|
|
|
|
tx = tx.ref_to_tx(spl[1])
|
|
|
|
tx = tx.ref_to_tx(spl[1])
|
|
|
|
if not tx:
|
|
|
|
if not tx:
|
|
|
@ -298,7 +307,7 @@ class IRCCommands(object):
|
|
|
|
helptext = "Delete all our adverts."
|
|
|
|
helptext = "Delete all our adverts."
|
|
|
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
@staticmethod
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, revolut, tx):
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, revolut, tx, notify):
|
|
|
|
rtrn = agora.nuke_ads()
|
|
|
|
rtrn = agora.nuke_ads()
|
|
|
|
msg(dumps(rtrn))
|
|
|
|
msg(dumps(rtrn))
|
|
|
|
|
|
|
|
|
|
|
@ -308,7 +317,7 @@ class IRCCommands(object):
|
|
|
|
helptext = "Get Agora wallet balances."
|
|
|
|
helptext = "Get Agora wallet balances."
|
|
|
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
@staticmethod
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, revolut, tx):
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, revolut, tx, notify):
|
|
|
|
rtrn_xmr = agora.agora.wallet_balance_xmr()
|
|
|
|
rtrn_xmr = agora.agora.wallet_balance_xmr()
|
|
|
|
if not rtrn_xmr["success"]:
|
|
|
|
if not rtrn_xmr["success"]:
|
|
|
|
msg("Error getting XMR wallet details.")
|
|
|
|
msg("Error getting XMR wallet details.")
|
|
|
@ -328,7 +337,7 @@ class IRCCommands(object):
|
|
|
|
helptext = "View public adverts. Usage: pubads <XMR/BTC> <currency>"
|
|
|
|
helptext = "View public adverts. Usage: pubads <XMR/BTC> <currency>"
|
|
|
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
@staticmethod
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, revolut, tx):
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, revolut, tx, notify):
|
|
|
|
if length == 3:
|
|
|
|
if length == 3:
|
|
|
|
asset = spl[1]
|
|
|
|
asset = spl[1]
|
|
|
|
if asset not in loads(settings.Agora.AssetList):
|
|
|
|
if asset not in loads(settings.Agora.AssetList):
|
|
|
@ -345,7 +354,7 @@ class IRCCommands(object):
|
|
|
|
helptext = "Cheat the markets by manipulating our prices to exploit people. Usage: cheat [<XMR/BTC>]"
|
|
|
|
helptext = "Cheat the markets by manipulating our prices to exploit people. Usage: cheat [<XMR/BTC>]"
|
|
|
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
@staticmethod
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, revolut, tx):
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, revolut, tx, notify):
|
|
|
|
if length == 1:
|
|
|
|
if length == 1:
|
|
|
|
agora._update_prices()
|
|
|
|
agora._update_prices()
|
|
|
|
msg("Running cheat in thread.")
|
|
|
|
msg("Running cheat in thread.")
|
|
|
@ -369,7 +378,7 @@ class IRCCommands(object):
|
|
|
|
helptext = "Run the next currency for cheat."
|
|
|
|
helptext = "Run the next currency for cheat."
|
|
|
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
@staticmethod
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, revolut, tx):
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, revolut, tx, notify):
|
|
|
|
if length == 1:
|
|
|
|
if length == 1:
|
|
|
|
asset = agora._update_prices(None, None)
|
|
|
|
asset = agora._update_prices(None, None)
|
|
|
|
msg(f"Running next asset for cheat in thread: {asset}")
|
|
|
|
msg(f"Running next asset for cheat in thread: {asset}")
|
|
|
@ -380,7 +389,7 @@ class IRCCommands(object):
|
|
|
|
helptext = "Get all our ad regions"
|
|
|
|
helptext = "Get all our ad regions"
|
|
|
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
@staticmethod
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, revolut, tx):
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, revolut, tx, notify):
|
|
|
|
ads = agora.enum_ads()
|
|
|
|
ads = agora.enum_ads()
|
|
|
|
for ad in ads:
|
|
|
|
for ad in ads:
|
|
|
|
msg(f"({ad[0]}) {ad[1]} {ad[2]} {ad[3]}")
|
|
|
|
msg(f"({ad[0]}) {ad[1]} {ad[2]} {ad[3]}")
|
|
|
@ -391,7 +400,7 @@ class IRCCommands(object):
|
|
|
|
helptext = "Get current XMR price."
|
|
|
|
helptext = "Get current XMR price."
|
|
|
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
@staticmethod
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, revolut, tx):
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, revolut, tx, notify):
|
|
|
|
xmr_prices = agora.cg.get_price(ids="monero", vs_currencies=["sek", "usd", "gbp"])
|
|
|
|
xmr_prices = agora.cg.get_price(ids="monero", vs_currencies=["sek", "usd", "gbp"])
|
|
|
|
price_sek = xmr_prices["monero"]["sek"]
|
|
|
|
price_sek = xmr_prices["monero"]["sek"]
|
|
|
|
price_usd = xmr_prices["monero"]["usd"]
|
|
|
|
price_usd = xmr_prices["monero"]["usd"]
|
|
|
@ -404,7 +413,7 @@ class IRCCommands(object):
|
|
|
|
helptext = "Get current BTC price."
|
|
|
|
helptext = "Get current BTC price."
|
|
|
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
@staticmethod
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, revolut, tx):
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, revolut, tx, notify):
|
|
|
|
xmr_prices = agora.cg.get_price(ids="bitcoin", vs_currencies=["sek", "usd", "gbp"])
|
|
|
|
xmr_prices = agora.cg.get_price(ids="bitcoin", vs_currencies=["sek", "usd", "gbp"])
|
|
|
|
price_sek = xmr_prices["bitcoin"]["sek"]
|
|
|
|
price_sek = xmr_prices["bitcoin"]["sek"]
|
|
|
|
price_usd = xmr_prices["bitcoin"]["usd"]
|
|
|
|
price_usd = xmr_prices["bitcoin"]["usd"]
|
|
|
@ -417,7 +426,7 @@ class IRCCommands(object):
|
|
|
|
helptext = "Take profit."
|
|
|
|
helptext = "Take profit."
|
|
|
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
@staticmethod
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, revolut, tx):
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, revolut, tx, notify):
|
|
|
|
agora.withdraw_funds()
|
|
|
|
agora.withdraw_funds()
|
|
|
|
|
|
|
|
|
|
|
|
class shuffle(object):
|
|
|
|
class shuffle(object):
|
|
|
@ -426,7 +435,7 @@ class IRCCommands(object):
|
|
|
|
helptext = "Convert all currencies in Revolut to supplied one. Usage: shuffle <currency>"
|
|
|
|
helptext = "Convert all currencies in Revolut to supplied one. Usage: shuffle <currency>"
|
|
|
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
@staticmethod
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, revolut, tx):
|
|
|
|
def run(cmd, spl, length, authed, msg, agora, revolut, tx, notify):
|
|
|
|
if length == 2:
|
|
|
|
if length == 2:
|
|
|
|
currency = spl[1]
|
|
|
|
currency = spl[1]
|
|
|
|
rtrn = revolut.shuffle(currency)
|
|
|
|
rtrn = revolut.shuffle(currency)
|
|
|
|