Source

types/UserTypes.ts

  1. import { SplitSignature } from './OrderTypes';
  2. /**
  3. * @description User data information
  4. * @typedef {Object} UserData
  5. * @property {string} ethAddress wallet address of user
  6. * @property {string} starkKey stark key of user
  7. * @property {number} createdAt The time that user is created with millidseconds
  8. */
  9. export interface UserDataResponse {
  10. ethAddress: string;
  11. starkKey: string;
  12. createdAt?: number;
  13. emailNotifications?: SettingNotificationParam[];
  14. registerOnChainTxHash?: string,
  15. signature?: SplitSignature,
  16. }
  17. /**
  18. * @description UserType
  19. * @typedef {string} UserType Enum (UserType.PARTNER / UserType.CUSTOMER)
  20. */
  21. /**
  22. * @enum {UserType} Type of users onboarding to Myria system (PARTNER/CUSTOMER)
  23. * UserType.Partner : Track all of registered user come to Myria through Partner/Game Studios
  24. * UserType.Customer: Track all of user come to Myria directly on the Website
  25. */
  26. export enum UserType {
  27. PARTNER = 'PARTNER',
  28. CUSTOMER = 'CUSTOMER'
  29. }
  30. /**
  31. * @description User data's response
  32. * @typedef {Object} RegisteredUserData
  33. * @property {string} walletAddress metamask's wallet address of user
  34. * @property {string} starkKey stark key of user
  35. * @property {codeInfo} codeInfo the information about the status of account
  36. * (USER_REGISTERED / USER_NOT_REGISTERED / GET_USER_INFO_ERROR)
  37. */
  38. export interface RegisteredUserData {
  39. walletAddress: string;
  40. starkKey: string;
  41. codeInfo: string;
  42. }
  43. export interface UserApiInput {
  44. ethAddress: string;
  45. starkKey: string;
  46. signature: SplitSignature;
  47. userType?: UserType;
  48. referrerId?: string
  49. }
  50. export interface UserAssetETH {
  51. amount: string;
  52. quantizedAmount: string;
  53. assetId: string;
  54. assetType: string;
  55. quantum: string;
  56. }
  57. export interface UserAssetERC20 {
  58. tokenName: string;
  59. tokenAddress: string;
  60. tokenSymbol: string;
  61. avatarUrl: string;
  62. amount: string;
  63. tokenType: string;
  64. }
  65. export interface UserWalletApi {
  66. wallet_id: string;
  67. signature: string;
  68. message: string;
  69. userType?: string;
  70. referrerId?: string;
  71. }
  72. /**
  73. * @description User Reference Last Evaluated Key
  74. * @typedef {Object} UserLastEvaluatedKey
  75. * @property {string} referrerId The project ID/ referrerID (starkKey) of referrer who introduced new users to onboard Myria
  76. * @property {string} ethAddress The wallet address of referrer
  77. */
  78. export interface UserLastEvaluatedKey {
  79. referrerId: string;
  80. ethAddress: string;
  81. }
  82. /**
  83. * @enum {KeyNotification} Type of Key Config Email (ALL, SettlementRequest, DepositRequest, WithdrawalRequest, TransferRequest, MintRequest, FullWithdrawalRequest, FalseFullWithdrawalRequest, BulkTransferTransactionsResult, MultiTransactionRequest, RoyaltyTransferRequest, TokenBurnRequest )
  84. * KeyNotification.All: Config All option notification email
  85. * KeyNotification.SettlementRequest: Config SettlementRequest
  86. * KeyNotification.DepositRequest: Config DepositRequest
  87. * KeyNotification.WithdrawalRequest: Config WithdrawalRequest
  88. * KeyNotification.TransferRequest: Config TransferRequest
  89. * KeyNotification.MintRequest: Config MintRequest
  90. * KeyNotification.FullWithdrawalRequest: Config FullWithdrawalRequest
  91. * KeyNotification.FalseFullWithdrawalRequest: Config FalseFullWithdrawalRequest
  92. * KeyNotification.BulkTransferTransactionsResult: Config BulkTransferTransactionsResult
  93. * KeyNotification.MultiTransactionRequest: Config MultiTransactionRequest
  94. * KeyNotification.RoyaltyTransferRequest: Config RoyaltyTransferRequest
  95. * KeyNotification.TokenBurnRequest: Config TokenBurnRequest
  96. */
  97. export enum KeyNotification {
  98. All = "ALL",
  99. SettlementRequest = "SettlementRequest",
  100. DepositRequest = "DepositRequest",
  101. WithdrawalRequest = "WithdrawalRequest",
  102. TransferRequest = "TransferRequest",
  103. MintRequest = "MintRequest",
  104. FullWithdrawalRequest = "FullWithdrawalRequest",
  105. FalseFullWithdrawalRequest = "FalseFullWithdrawalRequest",
  106. BulkTransferTransactionsResult = "BulkTransferTransactionsResult",
  107. MultiTransactionRequest = "MultiTransactionRequest",
  108. RoyaltyTransferRequest = "RoyaltyTransferRequest",
  109. TokenBurnRequest = "TokenBurnRequest",
  110. }
  111. /**
  112. * @description Email notification config param
  113. * @typedef {Object} SettingNotificationConfigParam
  114. * @property {KeyNotification} key Key config notification email
  115. * @property {boolean} value value of key notification email
  116. */
  117. export interface SettingNotificationParam {
  118. key: KeyNotification;
  119. value: boolean;
  120. }
  121. /**
  122. * @description Email notification information of user
  123. * @typedef {Object} SettingNotificationResponse
  124. * @property {SettingNotificationParam[]} emailNotifications Array information config email notification of user after trigger
  125. */
  126. export interface SettingNotificationResponse {
  127. emailNotifications: SettingNotificationParam[]
  128. }