Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
PyFund
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
陈涛
PyFund
Commits
672ace5f
Commit
672ace5f
authored
Apr 03, 2023
by
confusion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加查询多个节点收益接口
parent
c35c5a76
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
node.py
api/node.py
+12
-2
No files found.
api/node.py
View file @
672ace5f
from
typing
import
List
from
motor.core
import
AgnosticCollection
from
pydantic
import
Field
import
dependencies
from
exception.api
import
APIError
from
exception.db
import
ExistDataError
,
NotFundError
from
exception.http
import
RequestInvalidParamsError
from
model
import
BaseResponse
,
Response
,
PageResponse
,
Page
from
fastapi
import
APIRouter
,
Depends
,
Query
...
...
@@ -125,6 +123,18 @@ async def get_node_blocks(
return
PageResponse
[
ValidatorBlock
](
data
=
validator_blocks
.
data
,
**
page
.
dict
(),
total
=
validator_blocks
.
total
)
@
router
.
get
(
"/validator/incomes/"
,
response_model
=
Response
[
List
[
ValidatorIncome
]],
summary
=
"查询多个节点收益"
,
description
=
""
)
async
def
get_all_node_income
(
pub_key
:
List
[
str
]
=
Query
(
...
,
description
=
'查询节点'
),
beacon_service
:
BeaconChaService
=
Depends
(
BeaconChaService
)
):
list_res
=
await
beacon_service
.
get_validator_income
(
index_or_pubkey
=
','
.
join
(
pub_key
))
return
Response
[
List
[
ValidatorIncome
]](
data
=
list_res
)
@
router
.
get
(
"/validator/income/{pub_key}/"
,
response_model
=
Response
[
ValidatorIncome
],
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment