types.ts 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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: string;
  26. parameters: string;
  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 ProposalStatus {
  40. finalized: { proposalStatus: { approved: { pendingExecution: any } } };
  41. finalizedAt: number;
  42. encodedUnstakingErrorDueToBrokenRuntime?: any;
  43. stakeDataAfterUnstakingError?: any;
  44. }
  45. export interface SpendingProposal {
  46. id: number;
  47. title: string;
  48. amount: number;
  49. }
  50. export interface Round {
  51. round: number;
  52. start: number;
  53. end: number;
  54. }
  55. export class Bounty {
  56. constructor(
  57. public testnet: string,
  58. public proposalId: number,
  59. public title: string,
  60. public status: string,
  61. public amountAsked: number,
  62. public amountMinted: number
  63. ) {}
  64. }
  65. export class CacheEvent {
  66. constructor(
  67. public section: string,
  68. public method: string,
  69. public data: GenericEventData
  70. ) {}
  71. }
  72. export interface BlockEvent {
  73. blockId: number;
  74. section: string;
  75. method: string;
  76. data: string;
  77. }
  78. export interface WorkerReward {
  79. id: number;
  80. memberId: MemberId;
  81. account: AccountId;
  82. handle: string;
  83. stake: Stake;
  84. reward: RewardRelationship;
  85. status: string;
  86. }
  87. // status endpoint at https://status.joystream.org/status
  88. export interface StatusData {
  89. burns: Burn[];
  90. dollarPoolChanges: DollarPoolChange[];
  91. exchanges: Exchange[];
  92. extecutedBurnsAmount: number;
  93. price: string;
  94. totalIssuance: string;
  95. validators: { total_stake: string };
  96. }
  97. export interface DollarPoolChange {
  98. blockHeight: number;
  99. blockTime: string;
  100. change: number;
  101. reason: string;
  102. issuance: number;
  103. valueAfter: number;
  104. rateAfter: number;
  105. }
  106. export interface Burn {
  107. amount: number;
  108. blockHeight: number;
  109. date: string;
  110. logTime: string;
  111. }
  112. export interface Exchange {
  113. amount: number;
  114. amountUSD: number;
  115. blockHeight: number;
  116. date: string;
  117. logTime: string;
  118. price: number;
  119. recipient: string;
  120. sender: string;
  121. senderMemo: string;
  122. status: string;
  123. xmrAddress: string;
  124. }
  125. export class Media {
  126. constructor(public id: number, public title: string) {
  127. }
  128. }
  129. export class Channel {
  130. constructor(public id: number, public title: string) {
  131. }
  132. }