Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added reward type to the Reward model #292

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/http/src/models/Reward.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Client from '../Client'
export type RewardData = Omit<Reward, 'client'>

export interface HTTPReward {
type: string
account: string
amount: number
block: number
Expand All @@ -20,6 +21,8 @@ function integerToBalance(integerValue: number): Balance<NetworkTokens> {
export default class Reward extends DataModel {
private client: Client

public type: string

public account: string

public amount: Balance<NetworkTokens>
Expand All @@ -35,6 +38,7 @@ export default class Reward extends DataModel {
constructor(client: Client, rewards: HTTPReward) {
super()
this.client = client
this.type = rewards.type
this.account = rewards.account
this.amount = integerToBalance(rewards.amount)
this.block = rewards.block
Expand Down