Skip to content

Commit

Permalink
Merge pull request #152 from gnoswap-labs/GSW-838-feat-add-query-meta…
Browse files Browse the repository at this point in the history
…data-in-every-api-function

GSW-838 feat add query metadata in every api function #3
  • Loading branch information
notJoon authored Feb 7, 2024
2 parents 94bb782 + 7176969 commit 9602d2b
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions staker/_RPC_api_incentive.gno
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,14 @@ import (

const INTERNAL_REWARD_TOKEN_PATH = "gno.land/r/demo/gns"

// type ResponseQueryBase struct {
// Height int64 `json:"height"`
// Timestamp int64 `json:"timestamp"`
// }

type RewardToken struct {
PoolPath string `json:"poolPath"`
RewardsTokenList []string `json:"rewardsTokenList"`
}

type ResponseRewardTokens struct {
Stat ResponseQueryBase `json:"stat"`
Response struct {
Data []RewardToken `json:"data"`
} `json:"response"`
Response []RewardToken `json:"response"`
}

func ApiGetRewardTokens() string {
Expand Down Expand Up @@ -58,12 +51,8 @@ func ApiGetRewardTokens() string {
}

r := ResponseRewardTokens{
Stat: qb,
Response: struct {
Data []RewardToken `json:"data"`
}{
Data: rewardTokens,
},
Stat: qb,
Response: rewardTokens,
}

rr, err := json.Marshal(r)
Expand Down

0 comments on commit 9602d2b

Please sign in to comment.