Joystream Stats преди 3 години
родител
ревизия
8acef78c72
променени са 3 файла, в които са добавени 88 реда и са изтрити 2 реда
  1. 1 1
      index.ts
  2. 1 1
      rewards.ts
  3. 86 0
      types.ts

+ 1 - 1
index.ts

@@ -1,4 +1,4 @@
-import { CacheEvent } from "../types";
+import { CacheEvent } from "./types";
 import { Mint, MintId } from "@joystream/types/mint";
 import { Moment } from "@polkadot/types/interfaces";
 

+ 1 - 1
rewards.ts

@@ -5,7 +5,7 @@ import { Hash } from "@polkadot/types/interfaces";
 import { Mint, MintId } from "@joystream/types/mint";
 import { Stake } from "@joystream/types/stake";
 import { WorkerOf } from "@joystream/types/augment-codec/all";
-import { Bounty, CacheEvent, MintStatistics, WorkerReward } from "../types";
+import { Bounty, CacheEvent, MintStatistics, WorkerReward } from "./types";
 import {
   RewardRelationship,
   RewardRelationshipId,

+ 86 - 0
types.ts

@@ -0,0 +1,86 @@
+import { Accountdata } from '@polkadot/types/interfaces'
+
+export interface AccountBalance {
+  accountId: string
+  balance: AccountData
+}
+
+export interface ElectionInfo {
+  durations: number[]
+  stage: any
+  round: number
+  stageEndsAt: number
+  termEndsAt: number
+}
+
+export interface ProposalDetail {
+  created: number
+  finalizedAt: number
+  message: string
+  parameters: string
+  stage: any
+  result: string
+  exec: any
+  id: number
+  title: string
+  description: any
+  votes: VotingResults
+  type: string
+  votesByAccount?: Vote[]
+  author?: string
+  authorId: number
+}
+
+export interface Round {
+  round: number
+  start: number
+  end: number
+}
+
+export class Bounty {
+  constructor(
+    public testnet: string,
+    public proposalId: number,
+    public title: string,
+    public status: string,
+    public amountAsked: number,
+    public amountMinted: number
+  ) {}
+}
+
+export class CacheEvent {
+  constructor(
+    public section: string,
+    public method: string,
+    public data: GenericEventData
+  ) {}
+}
+
+export class MintStatistics {
+  startMinted: number;
+  endMinted: number;
+  diffMinted: number;
+  percMinted: number;
+
+  constructor(
+    startMinted: number = 0,
+    endMinted: number = 0,
+    diffMinted: number = 0,
+    percMinted: number = 0
+  ) {
+    this.startMinted = startMinted;
+    this.endMinted = endMinted;
+    this.diffMinted = diffMinted;
+    this.percMinted = percMinted;
+  }
+}
+
+export interface WorkerReward {
+  id: number;
+  memberId: MemberId;
+  account: AccountId;
+  handle: string;
+  stake: Stake;
+  reward: RewardRelationship;
+  status: string;
+}