Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Add address ledger API #179

Open
22 tasks
ghost opened this issue Jul 20, 2021 · 0 comments
Open
22 tasks

Feature: Add address ledger API #179

ghost opened this issue Jul 20, 2021 · 0 comments
Labels
api Adding/updating an API enhancement New feature or request service functionality Improving functionality at the service level. May affect any area of the project

Comments

@ghost
Copy link

ghost commented Jul 20, 2021

Summary

Add an API set that returns a balance ledger for an address.

Problem Definition

Existing services are scraping the Tx API to pull ledger records (fees paid, credits/debits) for an address. It would be nice to give them that data already parsed out, in addition for future use for the UI.

Dependent on #115

Proposal

Using the event log db tables:

  • Add a function to collect ledger type records for an address, returning
    • tx timestamp
    • tx hash
    • status (success/failure)
    • fee amount/denom
    • fee payer
    • cumulative balance change (sum of applicable changes where the address is sender or receiver)
    • list of the following object structure
      • tx message type
      • denom
      • credit
      • debit
      • sender
      • receiver
  • Add an api at /api/v2/accounts/{address}/ledger to return the above object structure
    • Path param address
    • Query param begin date
    • Query param end date
      • These dates will be used to filter the tx set down
  • Given time, might be helpful to allow for a list of addresses vs a single address

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@ghost ghost added enhancement New feature or request api Adding/updating an API service functionality Improving functionality at the service level. May affect any area of the project labels Jul 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Adding/updating an API enhancement New feature or request service functionality Improving functionality at the service level. May affect any area of the project
Projects
Development

No branches or pull requests

0 participants