Skip to content

Commit

Permalink
Add stake, unstake, and unlock stake txn construction endpoints (#524)
Browse files Browse the repository at this point in the history
* Add stake, unstake, and unlock stake txn construction endpoints

* Add stake, unstake, and unlock stake txn construction endpoints

---------

Co-authored-by: Lazy Nina <>
  • Loading branch information
lazynina authored Jan 23, 2024
1 parent 43493e3 commit c5f420c
Show file tree
Hide file tree
Showing 3 changed files with 444 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ local_scripts/*
backend

.idea
mem.log
26 changes: 26 additions & 0 deletions routes/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,11 @@ const (

// validators.go
RoutePathValidators = "/api/v0/validators"

// stake.go
RoutePathStake = "/api/v0/stake"
RoutePathUnstake = "/api/v0/unstake"
RoutePathUnlockStake = "/api/v0/unlock-stake"
)

// APIServer provides the interface between the blockchain and things like the
Expand Down Expand Up @@ -1304,6 +1309,27 @@ func (fes *APIServer) NewRouter() *muxtrace.Router {
fes.GetValidatorByPublicKeyBase58Check,
PublicAccess,
},
{
"CreateStakeTxn",
[]string{"POST", "OPTIONS"},
RoutePathStake,
fes.CreateStakeTxn,
PublicAccess,
},
{
"CreateUnstakeTxn",
[]string{"POST", "OPTIONS"},
RoutePathUnstake,
fes.CreateUnstakeTxn,
PublicAccess,
},
{
"CreateUnlockStakeTxn",
[]string{"POST", "OPTIONS"},
RoutePathUnlockStake,
fes.CreateUnlockStakeTxn,
PublicAccess,
},
// Jumio Routes
{
"JumioBegin",
Expand Down
Loading

0 comments on commit c5f420c

Please sign in to comment.