From e47fd242cf65ca90fc5a6a24f522e8055424c9c5 Mon Sep 17 00:00:00 2001 From: Martin Boehm Date: Wed, 4 Mar 2020 10:45:10 +0100 Subject: [PATCH] Add option for lightweight tx details (txslight) to address API #381 --- docs/api.md | 1 + server/public.go | 2 ++ server/websocket.go | 2 ++ 3 files changed, 5 insertions(+) diff --git a/docs/api.md b/docs/api.md index 579a7ac1..7f6a9f46 100644 --- a/docs/api.md +++ b/docs/api.md @@ -302,6 +302,7 @@ The optional query parameters: - *tokens*: *basic* + tokens belonging to the address (applicable only to some coins) - *tokenBalances*: *basic* + tokens with balances + belonging to the address (applicable only to some coins) - *txids*: *tokenBalances* + list of txids, subject to *from*, *to* filter and paging + - *txslight*: *tokenBalances* + list of transaction with limited details (only data from index), subject to *from*, *to* filter and paging - *txs*: *tokenBalances* + list of transaction with details, subject to *from*, *to* filter and paging - *contract*: return only transactions which affect specified contract (applicable only to coins which support contracts) diff --git a/server/public.go b/server/public.go index 1c3de30b..af26c764 100644 --- a/server/public.go +++ b/server/public.go @@ -625,6 +625,8 @@ func (s *PublicServer) getAddressQueryParams(r *http.Request, accountDetails api accountDetails = api.AccountDetailsTokenBalances case "txids": accountDetails = api.AccountDetailsTxidHistory + case "txslight": + accountDetails = api.AccountDetailsTxHistoryLight case "txs": accountDetails = api.AccountDetailsTxHistory } diff --git a/server/websocket.go b/server/websocket.go index f193abb4..aa338b2c 100644 --- a/server/websocket.go +++ b/server/websocket.go @@ -461,6 +461,8 @@ func (s *WebsocketServer) getAccountInfo(req *accountInfoReq) (res *api.Address, opt = api.AccountDetailsTokenBalances case "txids": opt = api.AccountDetailsTxidHistory + case "txslight": + opt = api.AccountDetailsTxHistoryLight case "txs": opt = api.AccountDetailsTxHistory default: