-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(api): adding endpoint for new stake data (#553)
* feat(api): adding endpoint for new stake data * feat(api,indexer): adding lock_duration to stake events * feat(api): addnig admin api for new stake models * feat(api): lock_duration --> lock_time, moving new endpoint to /stake/ --------- Co-authored-by: Gerald Iakobinyi-Pich <nutrina9@gmail.com>
- Loading branch information
1 parent
6f53e8a
commit d1b06d8
Showing
26 changed files
with
598 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
api/registry/migrations/0032_delete_stake_delete_stakeevent.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Generated by Django 4.2.6 on 2024-03-15 16:20 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("registry", "0031_stakeevent_stake"), | ||
] | ||
|
||
operations = [ | ||
migrations.DeleteModel( | ||
name="Stake", | ||
), | ||
migrations.DeleteModel( | ||
name="StakeEvent", | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
from django.contrib import admin | ||
from scorer.scorer_admin import ScorerModelAdmin | ||
from stake.models import Stake, StakeEvent | ||
|
||
|
||
@admin.register(Stake) | ||
class StakeAdmin(ScorerModelAdmin): | ||
list_display = [ | ||
"id", | ||
"chain", | ||
"staker", | ||
"stakee", | ||
"lock_time", | ||
"unlock_time", | ||
"current_amount", | ||
] | ||
|
||
list_filter = [ | ||
"chain", | ||
] | ||
|
||
search_fields = [ | ||
"staker", | ||
"stakee", | ||
] | ||
search_help_text = "Search by: " + ", ".join(search_fields) | ||
|
||
|
||
@admin.register(StakeEvent) | ||
class StakeEventAdmin(ScorerModelAdmin): | ||
list_display = [ | ||
"id", | ||
"event_type", | ||
"staker", | ||
"stakee", | ||
"amount", | ||
"block_number", | ||
"tx_hash", | ||
"unlock_time", | ||
] | ||
|
||
list_filter = [ | ||
"chain", | ||
"event_type", | ||
] | ||
|
||
search_fields = [ | ||
"staker", | ||
"stakee", | ||
"block_number", | ||
"tx_hash", | ||
] | ||
search_help_text = "Search by: " + ", ".join(search_fields) |
Oops, something went wrong.