Skip to content

Commit

Permalink
feat(api): add spendable balance API
Browse files Browse the repository at this point in the history
  • Loading branch information
ezreal1997 committed Dec 17, 2024
1 parent b5c7589 commit 72d8125
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/server/bank.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func (s *Server) GetBalancesByAddressDenom(req *getBalancesByAddressDenomRequest
}

// GetSpendableBalancesByAddress queries the spendable balance of all coins for a single account.
func (s *Server) GetSpendableBalancesByAddress(req *getBalancesByAddressRequest, r *http.Request) (resp any, err error) {
func (s *Server) GetSpendableBalancesByAddress(req *getSpendableBalancesByAddressRequest, r *http.Request) (resp any, err error) {
queryContext, err := s.createQueryContextByHeader(r)
if err != nil {
return nil, err
Expand All @@ -151,7 +151,7 @@ func (s *Server) GetSpendableBalancesByAddress(req *getBalancesByAddressRequest,
}

// GetSpendableBalancesByAddressDenom queries the spendable balance of a single coin for a single account.
func (s *Server) GetSpendableBalancesByAddressDenom(req *getBalancesByAddressDenomRequest, r *http.Request) (resp any, err error) {
func (s *Server) GetSpendableBalancesByAddressDenom(req *getSpendableBalancesByAddressDenomRequest, r *http.Request) (resp any, err error) {
queryContext, err := s.createQueryContextByHeader(r)
if err != nil {
return nil, err
Expand Down
8 changes: 8 additions & 0 deletions client/server/payload.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ type getBalancesByAddressDenomRequest struct {
Denom string `mapstructure:"denom"`
}

type getSpendableBalancesByAddressRequest struct {
Pagination pagination `mapstructure:"pagination"`
}

type getSpendableBalancesByAddressDenomRequest struct {
Denom string `mapstructure:"denom"`
}

type getDenomOwnersRequest struct {
Pagination pagination `mapstructure:"pagination"`
}
Expand Down

0 comments on commit 72d8125

Please sign in to comment.