Explorar o código

filterMethods.sudoSetBalance, StatusData type

Joystream Stats %!s(int64=3) %!d(string=hai) anos
pai
achega
e3e2f0aca9
Modificáronse 2 ficheiros con 44 adicións e 7 borrados
  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;
+}