Skip to content

[BOUNTY: 15 RTC] Implement /wallet/history endpoint (fixes #775, #886) #908

@Scottcjn

Description

@Scottcjn

Implement the /wallet/history Endpoint

Reward: 15 RTC

Background

The /wallet/history endpoint is documented in the API spec but returns 404. Multiple bug reports have been filed (#775, #886). Time to fix it.

Task

Add a /wallet/history endpoint to rustchain_v2_integrated_v2.2.1_rip200.py that returns transaction history for a given wallet/miner ID.

Expected Behavior

GET /wallet/history?miner_id=dual-g4-125&limit=50

Response:
{
  "ok": true,
  "miner_id": "dual-g4-125",
  "transactions": [
    {"type": "reward", "amount": 0.297, "epoch": 424, "timestamp": 1733..., "tx_hash": "..."},
    {"type": "transfer_in", "from": "founder_community", "amount": 10.0, "timestamp": ..., "tx_hash": "..."},
    ...
  ],
  "total": 42
}

Data Sources

  • ledger table: all transfers
  • epoch_rewards table: mining rewards
  • balances table: current balance

Requirements

  • Query both ledger and epoch_rewards tables
  • Return unified, sorted-by-time response
  • Support limit and offset pagination
  • Handle unknown miner_id gracefully (empty list, not error)

Tags: api, bug-fix, flask, sqlite

Metadata

Metadata

Assignees

No one assigned

    Labels

    bountyRTC bounty rewardbugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions