这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@ZIMkaRU
Copy link
Member

@ZIMkaRU ZIMkaRU commented Oct 27, 2023

This PR adds an endpoint to get the summary by asset (for 30 day period) for the new summary page of the framework mode

Screenshot from 2023-09-22 13-15-36


Basic changes:

  • Adds getSummaryByAsset endpoint
  • Adds test cases for getSummaryByAsset endpoint

Request example:

{
  "auth": {
    "token": "user-token"
  },
  "method": "getSummaryByAsset",
  "params": {
    "end": 1690464617000 // if not pass `end` param by default `end` = Date.now()
  }
}

Response example:

{
  "jsonrpc": "2.0",
  "result": {
    "summaryByAsset": [
      {
        "currency": "USD",
        "balance": 2396.33327987,
        "balanceUsd": 2396.33327987,
        "valueChange30dUsd": 0,
        "valueChange30dPerc": 0,
        "result30dUsd": 0,
        "result30dPerc": 0,
        "volume30dUsd": 0
      },
      {
        "currency": "BTC",
        "balance": 0.00134209,
        "balanceUsd": 39.2695534,
        "valueChange30dUsd": 0,
        "valueChange30dPerc": 0,
        "result30dUsd": 0,
        "result30dPerc": 0,
        "volume30dUsd": 0
      }
    ],
    "total": {
      "balanceUsd": 2435.60283327,
      "valueChange30dUsd": 0,
      "valueChange30dPerc": 0,
      "result30dUsd": 0,
      "result30dPerc": 0,
      "volume30dUsd": 0
    }
  },
  "id": null
}

Depends on these PRs:

Copy link
Contributor

@ezewer ezewer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants