types.ts 2.7 KB

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