3
0

types.ts 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. import { AccountId, AccountData } from "@polkadot/types/interfaces";
  2. import { GenericEventData } from "@polkadot/types/generic/Event";
  3. import { MemberId } from "@joystream/types/common";
  4. import { VotingResults } from "@joystream/types/augment/all";
  5. export interface AccountBalance {
  6. accountId: string;
  7. balance: AccountData;
  8. }
  9. export interface ElectionInfo {
  10. durations: number[];
  11. stage: any;
  12. round: number;
  13. stageEndsAt: number;
  14. termEndsAt: number;
  15. }
  16. export interface Vote {
  17. vote: string;
  18. handle: string;
  19. }
  20. export interface ProposalDetail {
  21. activatedAt: number;
  22. executedAt: number;
  23. message: { tg: string; discord: string };
  24. parameters: string; // ProposalParameters
  25. status: any;
  26. id: number;
  27. votes: VotingResults;
  28. type: string;
  29. votesByAccount?: Vote[];
  30. author?: string;
  31. authorId: number;
  32. }
  33. export interface SpendingProposal {
  34. id: number;
  35. title: string;
  36. amount: number;
  37. }
  38. export interface Round {
  39. round: number;
  40. start: number;
  41. end: number;
  42. }
  43. export class Bounty {
  44. constructor(
  45. public testnet: string,
  46. public proposalId: number,
  47. public title: string,
  48. public status: string,
  49. public amountAsked: number,
  50. public amountMinted: number
  51. ) {}
  52. }
  53. export class CacheEvent {
  54. constructor(
  55. public section: string,
  56. public method: string,
  57. public data: GenericEventData
  58. ) {}
  59. }
  60. export interface BlockEvent {
  61. blockId: number;
  62. section: string;
  63. method: string;
  64. data: string;
  65. }
  66. export interface WorkerReward {
  67. id: number;
  68. memberId: MemberId;
  69. account: AccountId;
  70. handle: string;
  71. stake?: any;
  72. reward?: any;
  73. status: string;
  74. }
  75. // status endpoint at https://status.joystream.org/status
  76. export interface StatusData {
  77. burns: Burn[];
  78. dollarPoolChanges: DollarPoolChange[];
  79. exchanges: Exchange[];
  80. extecutedBurnsAmount: number;
  81. price: string;
  82. totalIssuance: string;
  83. validators: { total_stake: string };
  84. }
  85. export interface DollarPoolChange {
  86. blockHeight: number;
  87. blockTime: string;
  88. change: number;
  89. reason: string;
  90. issuance: number;
  91. valueAfter: number;
  92. rateAfter: number;
  93. }
  94. export interface Burn {
  95. amount: number;
  96. blockHeight: number;
  97. date: string;
  98. logTime: string;
  99. }
  100. export interface Exchange {
  101. amount: number;
  102. amountUSD: number;
  103. blockHeight: number;
  104. date: string;
  105. logTime: string;
  106. price: number;
  107. recipient: string;
  108. sender: string;
  109. senderMemo: string;
  110. status: string;
  111. xmrAddress: string;
  112. }
  113. export class Media {
  114. constructor(public id: number, public title: string) {}
  115. }
  116. export class Channel {
  117. constructor(public id: number, public title: string) {}
  118. }