diff --git a/accounts/transactions-rest-api.js b/accounts/transactions-rest-api.js index 5277e1b..6d96778 100644 --- a/accounts/transactions-rest-api.js +++ b/accounts/transactions-rest-api.js @@ -83,8 +83,15 @@ class TransactionsRestApi { const active = apiHelper.parseEntities(req.query.active) const page = req.query.page != null ? parseInt(req.query.page) : 0 const count = req.query.count != null ? parseInt(req.query.count) : keys.multiaddr.transactions + const excludeNullXfer = req.query.excludeNullXfer != null const result = await walletService.getWalletTransactions(active, page, count) + if (excludeNullXfer) { + result.txs = result.txs.filter(tx => { + return tx['result'] != 0 + }) + } + const ret = JSON.stringify(result, null, 2) HttpServer.sendRawData(res, ret) @@ -141,7 +148,11 @@ class TransactionsRestApi { !req.query.count || validator.isInt(req.query.count) - if (!(isValidPage && isValidCount)) { + const isValidExcludeNull = + !req.query.excludeNullXfer + || validator.isAlphanumeric(req.query.excludeNullXfer) + + if (!(isValidPage && isValidCount && isValidExcludeNull)) { HttpServer.sendError(res, errors.body.INVDATA) Logger.error( req.query, diff --git a/doc/GET_txs.md b/doc/GET_txs.md index 8d1337b..adeabee 100644 --- a/doc/GET_txs.md +++ b/doc/GET_txs.md @@ -12,6 +12,7 @@ GET /txs?active=... * **active** - `string` - A pipe-separated list of extended public keys and/or loose addresses and/or pubkeys (`xpub1|address1|address2|pubkey1|...`) * **page** - `integer` - Index of the requested page (first page is index 0) * **count** - `integer` - Number of transactions returned per page +* **excludeNullXfer** - `boolean` - Boolean flag indicating if transactions that don't change the balance should be excluded from the result (default = false) * **at** - `string` (optional) - Access Token (json web token). Required if authentication is activated. Alternatively, the access token can be passed through the `Authorization` HTTP header (with the `Bearer` scheme). ### Examples diff --git a/static/admin/css/style.css b/static/admin/css/style.css index 536c8c0..b4ac1e5 100644 --- a/static/admin/css/style.css +++ b/static/admin/css/style.css @@ -551,6 +551,17 @@ button { display: inline-block; } +#xpubs-export-actions span { + display: inline; +} + +#xpubs-export-actions select { + width: 240px; + margin-left: 5px; + margin-right: 5px; + display: inline-block; +} + #xpubs-tool-details #xpub-value { overflow: hidden; } diff --git a/static/admin/dmt/xpubs-tools/xpubs-tools.html b/static/admin/dmt/xpubs-tools/xpubs-tools.html index fd7017e..8524c4d 100644 --- a/static/admin/dmt/xpubs-tools/xpubs-tools.html +++ b/static/admin/dmt/xpubs-tools/xpubs-tools.html @@ -59,16 +59,17 @@