Skip to content

Commit 33ddea6

Browse files
author
Lazy Nina
committed
Add GET endpoints for stake and locked stake entries
1 parent fbc6243 commit 33ddea6

File tree

2 files changed

+309
-21
lines changed

2 files changed

+309
-21
lines changed

routes/server.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ const (
321321
RoutePathStake = "/api/v0/stake"
322322
RoutePathUnstake = "/api/v0/unstake"
323323
RoutePathUnlockStake = "/api/v0/unlock-stake"
324+
RoutePathLockedStake = "/api/v0/locked-stake"
324325
)
325326

326327
// APIServer provides the interface between the blockchain and things like the
@@ -1316,6 +1317,20 @@ func (fes *APIServer) NewRouter() *muxtrace.Router {
13161317
fes.Stake,
13171318
PublicAccess,
13181319
},
1320+
{
1321+
"GetStakeForValidatorAndStaker",
1322+
[]string{"GET"},
1323+
RoutePathStake + "/{validatorPublicKeyBase58Check:t?BC[1-9A-HJ-NP-Za-km-z]{51,53}}/{stakerPublicKeyBase58Check:t?BC[1-9A-HJ-NP-Za-km-z]{51,53}}",
1324+
fes.GetStakeForValidatorAndStaker,
1325+
PublicAccess,
1326+
},
1327+
{
1328+
"GetStakesForValidator",
1329+
[]string{"GET"},
1330+
RoutePathStake + "/validator/{validatorPublicKeyBase58Check:t?BC[1-9A-HJ-NP-Za-km-z]{51,53}}",
1331+
fes.GetStakesForValidator,
1332+
PublicAccess,
1333+
},
13191334
{
13201335
"Unstake",
13211336
[]string{"POST", "OPTIONS"},
@@ -1330,6 +1345,13 @@ func (fes *APIServer) NewRouter() *muxtrace.Router {
13301345
fes.UnlockStake,
13311346
PublicAccess,
13321347
},
1348+
{
1349+
"GetLockedStakeForValidatorAndStaker",
1350+
[]string{"GET"},
1351+
RoutePathLockedStake + "/{validatorPublicKeyBase58Check:t?BC[1-9A-HJ-NP-Za-km-z]{51,53}}/{stakerPublicKeyBase58Check:t?BC[1-9A-HJ-NP-Za-km-z]{51,53}}",
1352+
fes.GetLockedStakesForValidatorAndStaker,
1353+
PublicAccess,
1354+
},
13331355
// Jumio Routes
13341356
{
13351357
"JumioBegin",

0 commit comments

Comments
 (0)