feat: Add tx count plugin and fixed dns error
This commit is contained in:
parent
40b4c42492
commit
45fdaa2de4
@ -305,6 +305,12 @@ def getDNS(domain: str):
|
|||||||
return {
|
return {
|
||||||
"error": response['error']['message']
|
"error": response['error']['message']
|
||||||
}
|
}
|
||||||
|
if 'result' not in response:
|
||||||
|
return {
|
||||||
|
"error": "No DNS records"
|
||||||
|
}
|
||||||
|
if 'records' not in response['result']:
|
||||||
|
return []
|
||||||
return response['result']['records']
|
return response['result']['records']
|
||||||
|
|
||||||
|
|
||||||
|
3
main.py
3
main.py
@ -101,9 +101,6 @@ def index():
|
|||||||
functionOutput = plugins_module.runPluginFunction(function["plugin"],function["function"],{},request.cookies.get("account"))
|
functionOutput = plugins_module.runPluginFunction(function["plugin"],function["function"],{},request.cookies.get("account"))
|
||||||
plugins += render.plugin_output_dash(functionOutput,plugins_module.getPluginFunctionReturns(function["plugin"],function["function"]))
|
plugins += render.plugin_output_dash(functionOutput,plugins_module.getPluginFunctionReturns(function["plugin"],function["function"]))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return render_template("index.html", account=account, available=available,
|
return render_template("index.html", account=account, available=available,
|
||||||
total=total, pending=pending, domains=domains,
|
total=total, pending=pending, domains=domains,
|
||||||
domainsMobile=domainsMobile, plugins=plugins,
|
domainsMobile=domainsMobile, plugins=plugins,
|
||||||
|
35
plugins/txcount.py
Normal file
35
plugins/txcount.py
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
import json
|
||||||
|
import account
|
||||||
|
import requests
|
||||||
|
|
||||||
|
# Plugin Data
|
||||||
|
info = {
|
||||||
|
"name": "TX Count",
|
||||||
|
"description": "Plugin for checking how many txs are in a wallet",
|
||||||
|
"version": "1.0",
|
||||||
|
"author": "Nathan.Woodburn/"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Functions
|
||||||
|
functions = {
|
||||||
|
"main":{
|
||||||
|
"name": "List TXs",
|
||||||
|
"type": "default",
|
||||||
|
"description": "Get TXs",
|
||||||
|
"params": {},
|
||||||
|
"returns": {
|
||||||
|
"txs":
|
||||||
|
{
|
||||||
|
"name": "Transactions",
|
||||||
|
"type": "text"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def main(params, authentication):
|
||||||
|
wallet = authentication.split(":")[0]
|
||||||
|
txs = account.getTransactions(wallet)
|
||||||
|
|
||||||
|
return {"txs": f'Total TXs: {len(txs)}'}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user