瀏覽代碼

filterMethods.sudoSetBalance, StatusData type

Joystream Stats 2 年之前
父節點
當前提交
e3e2f0aca9
共有 2 個文件被更改,包括 44 次插入7 次删除
  1. 2 0
      rewards.ts
  2. 42 7
      types.ts

+ 2 - 0
rewards.ts

@@ -44,6 +44,8 @@ export const filterMethods = {
     section === "staking" && method === "Reward",
   finalizedSpendingProposals: ({ section, method }: CacheEvent) =>
     section === "proposalsEngine" && method === "ProposalStatusUpdated",
+  sudoSetBalance: ({ section, method }: CacheEvent) =>
+    section == "balances" && method == "BalanceSet",
 };
 
 export const getWorkerRewards = async (

+ 42 - 7
types.ts

@@ -53,13 +53,6 @@ export interface Round {
   end: number;
 }
 
-interface Vote {
-  voter: AccountId
-  commitment: Hash
-  stake: { new: number; transferred: number }
-  vote: AccountId
-}
-
 export class Bounty {
   constructor(
     public testnet: string,
@@ -88,3 +81,45 @@ export interface WorkerReward {
   reward: RewardRelationship;
   status: string;
 }
+
+// status endpoint at https://status.joystream.org/status
+export interface StatusData {
+  burns: Burn[];
+  dollarPoolChanges: DollarPoolChange[];
+  exchanges: Exchange[];
+  extecutedBurnsAmount: number;
+  price: string;
+  totalIssuance: string;
+  validators: { total_stake: string };
+}
+
+export interface DollarPoolChange {
+  blockHeight: number;
+  blockTime: string;
+  change: number;
+  reason: string;
+  issuance: number;
+  valueAfter: number;
+  rateAfter: number;
+}
+
+export interface Burn {
+  amount: number;
+  blockHeight: number;
+  date: string;
+  logTime: string;
+}
+
+export interface Exchange {
+  amount: number;
+  amountUSD: number;
+  blockHeight: number;
+  date: string;
+  logTime: string;
+  price: number;
+  recipient: string;
+  sender: string;
+  senderMemo: string;
+  status: string;
+  xmrAddress: string;
+}