Added "SEARCH_TRANSACTIONS" action.

This commit is contained in:
CalDescent
2023-01-19 20:22:29 +00:00
parent ca80fd5f9c
commit 86d6037af3
3 changed files with 42 additions and 0 deletions

View File

@@ -177,6 +177,19 @@ window.addEventListener("message", (event) => {
response = httpGet(url);
break;
case "SEARCH_TRANSACTIONS":
url = "/apps/transactions/search?";
if (data.startBlock != null) url = url.concat("&startBlock=" + data.startBlock);
if (data.blockLimit != null) url = url.concat("&blockLimit=" + data.blockLimit);
if (data.txGroupId != null) url = url.concat("&txGroupId=" + data.txGroupId);
if (data.txType != null) data.txType.forEach((x, i) => url = url.concat("&txType=" + x));
if (data.confirmationStatus != null) url = url.concat("&confirmationStatus=" + data.confirmationStatus);
if (data.limit != null) url = url.concat("&limit=" + data.limit);
if (data.offset != null) url = url.concat("&offset=" + data.offset);
if (data.reverse != null) url = url.concat("&reverse=" + new Boolean(data.reverse).toString());
response = httpGet(url);
break;
default:
// Pass to parent (UI), in case they can fulfil this request
event.data.requestedHandler = "UI";