types.ts 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. import { ApiPromise } from "@polkadot/api";
  2. import { MemberId } from "@joystream/types/members";
  3. import {
  4. ProposalParameters,
  5. ProposalStatus,
  6. VotingResults,
  7. } from "@joystream/types/proposals";
  8. import { AccountId, Nominations } from "@polkadot/types/interfaces";
  9. import { Option } from "@polkadot/types/codec";
  10. import { StorageKey } from "@polkadot/types/primitive";
  11. export interface Api {
  12. query: any;
  13. rpc: any;
  14. derive: any;
  15. }
  16. export interface IState {
  17. //gethandle: (account: AccountId | string) => string;
  18. connecting: boolean;
  19. now: number;
  20. block: number;
  21. blocks: Block[];
  22. nominators: string[];
  23. validators: string[];
  24. stashes: string[];
  25. loading: boolean;
  26. councils: Seat[][];
  27. councilElection?: { stage: any; round: number; termEndsAt: number };
  28. channels: Channel[];
  29. categories: Category[];
  30. proposals: ProposalDetail[];
  31. posts: Post[];
  32. threads: Thread[];
  33. domain: string;
  34. proposalCount: number;
  35. proposalPosts: any[];
  36. handles: Handles;
  37. members: Member[];
  38. tokenomics?: Tokenomics;
  39. reports: { [key: string]: string };
  40. [key: string]: any;
  41. stars: { [key: string]: boolean };
  42. stakes?: { [key: string]: Stakes };
  43. rewardPoints?: RewardPoints;
  44. lastReward: number;
  45. }
  46. export interface RewardPoints {
  47. total: number;
  48. individual: { [account: string]: number };
  49. }
  50. export interface Stake {
  51. who: string;
  52. value: number;
  53. }
  54. export interface Stakes {
  55. total: number;
  56. own: number;
  57. others: Stake[];
  58. commission: number;
  59. }
  60. export interface Seat {
  61. member: string;
  62. handle?: string;
  63. id?: number;
  64. stake: number;
  65. backers: Backer[];
  66. }
  67. export interface Backer {
  68. member: string;
  69. stake: number;
  70. }
  71. export interface CouncilType {
  72. round: number;
  73. last: string;
  74. }
  75. export interface CouncilModel {
  76. }
  77. export interface Options {
  78. verbose: number;
  79. channel: boolean;
  80. council: boolean;
  81. forum: boolean;
  82. proposals: boolean;
  83. }
  84. export interface ProposalDetail {
  85. createdAt: number;
  86. finalizedAt: number;
  87. message: string;
  88. parameters: string;
  89. stage: any;
  90. result: string;
  91. exec: any;
  92. id: number;
  93. title: string;
  94. description: any;
  95. votes: VotingResults;
  96. type: string;
  97. votesByAccount?: Vote[];
  98. author: string;
  99. authorId: number;
  100. }
  101. export interface Vote {
  102. vote: string;
  103. handle: string;
  104. }
  105. export type ProposalArray = number[];
  106. export interface ProposalPost {
  107. threadId: number;
  108. text: string;
  109. id: number;
  110. }
  111. export interface Proposals {
  112. current: number;
  113. last: number;
  114. active: ProposalArray;
  115. executing: ProposalArray;
  116. }
  117. export interface ChannelType {
  118. id: number;
  119. handle: string;
  120. title: string;
  121. description: string;
  122. avatar: string;
  123. banner: string;
  124. content: string;
  125. ownerId: number;
  126. accountId: string;
  127. publicationStatus: boolean;
  128. curation: string;
  129. createdAt: string;
  130. principal: number;
  131. }
  132. export interface CategoryType {
  133. id: number;
  134. threadId: number;
  135. title: string;
  136. description: string;
  137. createdAt: number;
  138. deleted: boolean;
  139. archived: boolean;
  140. subcategories: number;
  141. unmoderatedThreads: number;
  142. moderatedThreads: number;
  143. position: number;
  144. moderatorId: string;
  145. }
  146. export interface PostType {
  147. id: number;
  148. text: string;
  149. threadId: number;
  150. authorId: string;
  151. createdAt: { block: number; time: number };
  152. }
  153. export interface ThreadType {
  154. id: number;
  155. title: string;
  156. categoryId: number;
  157. nrInCategory: number;
  158. moderation: string;
  159. createdAt: string;
  160. authorId: string;
  161. }
  162. export interface MemberType {
  163. account: string;
  164. handle: string;
  165. id: number;
  166. registeredAt: number;
  167. about: string;
  168. }
  169. export interface Header {
  170. number: number;
  171. timestamp: number;
  172. author: string
  173. }
  174. export interface Summary {
  175. blocks: Block[];
  176. validators: number[];
  177. nominators: number[];
  178. }
  179. export type NominatorsEntries = [StorageKey, Option<Nominations>][];
  180. export interface ProviderStatus {
  181. [propName: string]: boolean;
  182. }
  183. export interface Handles {
  184. [key: string]: string;
  185. }
  186. export interface Tokenomics {
  187. price: string;
  188. totalIssuance: string;
  189. validators: { total_stake: string };
  190. burns: Burn[];
  191. exchanges: Exchange[];
  192. extecutedBurnsAmount: number;
  193. }
  194. export interface Burn {
  195. amount: number;
  196. blockHeight: number;
  197. date: string; // "2020-09-21T11:07:54.000Z"
  198. logTime: string; //"2020-09-21T11:08:54.091Z"
  199. }
  200. export interface Exchange {
  201. amount: number;
  202. amountUSD: number;
  203. blockHeight: number;
  204. date: string; // "2020-09-21T11:07:48.000Z"
  205. logTime: string; // "2020-09-21T11:08:48.552Z"
  206. price: number; // 0.000053676219442924057
  207. recipient: string; //"5D5PhZQNJzcJXVBxwJxZcsutjKPqUPydrvpu6HeiBfMaeKQu"
  208. sender: string; // "5DACzSg65taZ2NRktUtzBjhLZr8H5T8rwNoZUng9gQV6ayqT"
  209. senderMemo: string; //"4Testing1337SendToBurnerAddressHopingItWorksOfc5D5PhZQNJzcJXVBxwJxZcsutjKPqUPydrvpu6HeiBfMaeKQu"
  210. status: string; // FINALIZED | PENDING
  211. xmrAddress: string; //"No address found"
  212. }
  213. export interface Event {
  214. text: string;
  215. date: number;
  216. category: {
  217. tag: string;
  218. color: string;
  219. };
  220. link: {
  221. url: string;
  222. text: string;
  223. };
  224. }
  225. export interface CalendarItem {
  226. id: number;
  227. group: number;
  228. title: string;
  229. start_time: number;
  230. end_time: number;
  231. }
  232. export interface CalendarGroup {
  233. id: number;
  234. title: string;
  235. }
  236. export interface Status {
  237. }