@sudobility/types 1.8.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (248) hide show
  1. package/CLAUDE.md +285 -0
  2. package/README.md +310 -0
  3. package/dist/index.cjs +62 -0
  4. package/dist/index.d.ts +18 -0
  5. package/dist/index.d.ts.map +1 -0
  6. package/dist/index.js +62 -0
  7. package/dist/index.js.map +1 -0
  8. package/dist/types/blockchain/common.cjs +102 -0
  9. package/dist/types/blockchain/common.d.ts +262 -0
  10. package/dist/types/blockchain/common.d.ts.map +1 -0
  11. package/dist/types/blockchain/common.js +102 -0
  12. package/dist/types/blockchain/common.js.map +1 -0
  13. package/dist/types/blockchain/index.cjs +18 -0
  14. package/dist/types/blockchain/index.d.ts +4 -0
  15. package/dist/types/blockchain/index.d.ts.map +1 -0
  16. package/dist/types/blockchain/index.js +18 -0
  17. package/dist/types/blockchain/index.js.map +1 -0
  18. package/dist/types/blockchain/validation.cjs +88 -0
  19. package/dist/types/blockchain/validation.d.ts +9 -0
  20. package/dist/types/blockchain/validation.d.ts.map +1 -0
  21. package/dist/types/blockchain/validation.js +88 -0
  22. package/dist/types/blockchain/validation.js.map +1 -0
  23. package/dist/types/business/enums.cjs +314 -0
  24. package/dist/types/business/enums.d.ts +227 -0
  25. package/dist/types/business/enums.d.ts.map +1 -0
  26. package/dist/types/business/enums.js +314 -0
  27. package/dist/types/business/enums.js.map +1 -0
  28. package/dist/types/business/index.cjs +33 -0
  29. package/dist/types/business/index.d.ts +5 -0
  30. package/dist/types/business/index.d.ts.map +1 -0
  31. package/dist/types/business/index.js +33 -0
  32. package/dist/types/business/index.js.map +1 -0
  33. package/dist/types/business/wallet-status.cjs +38 -0
  34. package/dist/types/business/wallet-status.d.ts +32 -0
  35. package/dist/types/business/wallet-status.d.ts.map +1 -0
  36. package/dist/types/business/wallet-status.js +38 -0
  37. package/dist/types/business/wallet-status.js.map +1 -0
  38. package/dist/types/common.cjs +6 -0
  39. package/dist/types/common.d.ts +142 -0
  40. package/dist/types/common.d.ts.map +1 -0
  41. package/dist/types/common.js +6 -0
  42. package/dist/types/common.js.map +1 -0
  43. package/dist/types/config/app-config.cjs +6 -0
  44. package/dist/types/config/app-config.d.ts +67 -0
  45. package/dist/types/config/app-config.d.ts.map +1 -0
  46. package/dist/types/config/app-config.js +6 -0
  47. package/dist/types/config/app-config.js.map +1 -0
  48. package/dist/types/config/environment.cjs +24 -0
  49. package/dist/types/config/environment.d.ts +68 -0
  50. package/dist/types/config/environment.d.ts.map +1 -0
  51. package/dist/types/config/environment.js +24 -0
  52. package/dist/types/config/environment.js.map +1 -0
  53. package/dist/types/config/index.cjs +6 -0
  54. package/dist/types/config/index.d.ts +4 -0
  55. package/dist/types/config/index.d.ts.map +1 -0
  56. package/dist/types/config/index.js +6 -0
  57. package/dist/types/config/index.js.map +1 -0
  58. package/dist/types/index.cjs +35 -0
  59. package/dist/types/index.d.ts +10 -0
  60. package/dist/types/index.d.ts.map +1 -0
  61. package/dist/types/index.js +35 -0
  62. package/dist/types/index.js.map +1 -0
  63. package/dist/types/indexer/index.cjs +19 -0
  64. package/dist/types/indexer/index.d.ts +3 -0
  65. package/dist/types/indexer/index.d.ts.map +1 -0
  66. package/dist/types/indexer/index.js +19 -0
  67. package/dist/types/indexer/index.js.map +1 -0
  68. package/dist/types/indexer/indexer-guards.cjs +145 -0
  69. package/dist/types/indexer/indexer-guards.d.ts +26 -0
  70. package/dist/types/indexer/indexer-guards.d.ts.map +1 -0
  71. package/dist/types/indexer/indexer-guards.js +145 -0
  72. package/dist/types/indexer/indexer-guards.js.map +1 -0
  73. package/dist/types/indexer/indexer-responses.cjs +8 -0
  74. package/dist/types/indexer/indexer-responses.d.ts +136 -0
  75. package/dist/types/indexer/indexer-responses.d.ts.map +1 -0
  76. package/dist/types/indexer/indexer-responses.js +8 -0
  77. package/dist/types/indexer/indexer-responses.js.map +1 -0
  78. package/dist/types/infrastructure/analytics.cjs +212 -0
  79. package/dist/types/infrastructure/analytics.d.ts +449 -0
  80. package/dist/types/infrastructure/analytics.d.ts.map +1 -0
  81. package/dist/types/infrastructure/analytics.js +212 -0
  82. package/dist/types/infrastructure/analytics.js.map +1 -0
  83. package/dist/types/infrastructure/api.cjs +17 -0
  84. package/dist/types/infrastructure/api.d.ts +152 -0
  85. package/dist/types/infrastructure/api.d.ts.map +1 -0
  86. package/dist/types/infrastructure/api.js +17 -0
  87. package/dist/types/infrastructure/api.js.map +1 -0
  88. package/dist/types/infrastructure/index.cjs +14 -0
  89. package/dist/types/infrastructure/index.d.ts +9 -0
  90. package/dist/types/infrastructure/index.d.ts.map +1 -0
  91. package/dist/types/infrastructure/index.js +14 -0
  92. package/dist/types/infrastructure/index.js.map +1 -0
  93. package/dist/types/infrastructure/navigation.cjs +3 -0
  94. package/dist/types/infrastructure/navigation.d.ts +56 -0
  95. package/dist/types/infrastructure/navigation.d.ts.map +1 -0
  96. package/dist/types/infrastructure/navigation.js +3 -0
  97. package/dist/types/infrastructure/navigation.js.map +1 -0
  98. package/dist/types/infrastructure/network.cjs +18 -0
  99. package/dist/types/infrastructure/network.d.ts +48 -0
  100. package/dist/types/infrastructure/network.d.ts.map +1 -0
  101. package/dist/types/infrastructure/network.js +18 -0
  102. package/dist/types/infrastructure/network.js.map +1 -0
  103. package/dist/types/infrastructure/wallet.cjs +37 -0
  104. package/dist/types/infrastructure/wallet.d.ts +33 -0
  105. package/dist/types/infrastructure/wallet.d.ts.map +1 -0
  106. package/dist/types/infrastructure/wallet.js +37 -0
  107. package/dist/types/infrastructure/wallet.js.map +1 -0
  108. package/dist/types/kyc/index.cjs +19 -0
  109. package/dist/types/kyc/index.d.ts +2 -0
  110. package/dist/types/kyc/index.d.ts.map +1 -0
  111. package/dist/types/kyc/index.js +19 -0
  112. package/dist/types/kyc/index.js.map +1 -0
  113. package/dist/types/kyc/kyc-types.cjs +12 -0
  114. package/dist/types/kyc/kyc-types.d.ts +260 -0
  115. package/dist/types/kyc/kyc-types.d.ts.map +1 -0
  116. package/dist/types/kyc/kyc-types.js +12 -0
  117. package/dist/types/kyc/kyc-types.js.map +1 -0
  118. package/dist/types/mailer/index.cjs +19 -0
  119. package/dist/types/mailer/index.d.ts +2 -0
  120. package/dist/types/mailer/index.d.ts.map +1 -0
  121. package/dist/types/mailer/index.js +19 -0
  122. package/dist/types/mailer/index.js.map +1 -0
  123. package/dist/types/mailer/mail-types.cjs +38 -0
  124. package/dist/types/mailer/mail-types.d.ts +296 -0
  125. package/dist/types/mailer/mail-types.d.ts.map +1 -0
  126. package/dist/types/mailer/mail-types.js +38 -0
  127. package/dist/types/mailer/mail-types.js.map +1 -0
  128. package/dist/types/wildduck/index.cjs +19 -0
  129. package/dist/types/wildduck/index.d.ts +2 -0
  130. package/dist/types/wildduck/index.d.ts.map +1 -0
  131. package/dist/types/wildduck/index.js +19 -0
  132. package/dist/types/wildduck/index.js.map +1 -0
  133. package/dist/types/wildduck/wildduck-types.cjs +48 -0
  134. package/dist/types/wildduck/wildduck-types.d.ts +1239 -0
  135. package/dist/types/wildduck/wildduck-types.d.ts.map +1 -0
  136. package/dist/types/wildduck/wildduck-types.js +48 -0
  137. package/dist/types/wildduck/wildduck-types.js.map +1 -0
  138. package/dist/utils/async-helpers.cjs +130 -0
  139. package/dist/utils/async-helpers.d.ts +35 -0
  140. package/dist/utils/async-helpers.d.ts.map +1 -0
  141. package/dist/utils/async-helpers.js +130 -0
  142. package/dist/utils/async-helpers.js.map +1 -0
  143. package/dist/utils/auth/auth.cjs +96 -0
  144. package/dist/utils/auth/auth.d.ts +40 -0
  145. package/dist/utils/auth/auth.d.ts.map +1 -0
  146. package/dist/utils/auth/auth.js +96 -0
  147. package/dist/utils/auth/auth.js.map +1 -0
  148. package/dist/utils/auth/index.cjs +14 -0
  149. package/dist/utils/auth/index.d.ts +2 -0
  150. package/dist/utils/auth/index.d.ts.map +1 -0
  151. package/dist/utils/auth/index.js +14 -0
  152. package/dist/utils/auth/index.js.map +1 -0
  153. package/dist/utils/blockchain/address.cjs +231 -0
  154. package/dist/utils/blockchain/address.d.ts +65 -0
  155. package/dist/utils/blockchain/address.d.ts.map +1 -0
  156. package/dist/utils/blockchain/address.js +231 -0
  157. package/dist/utils/blockchain/address.js.map +1 -0
  158. package/dist/utils/blockchain/event-helpers.cjs +143 -0
  159. package/dist/utils/blockchain/event-helpers.d.ts +87 -0
  160. package/dist/utils/blockchain/event-helpers.d.ts.map +1 -0
  161. package/dist/utils/blockchain/event-helpers.js +143 -0
  162. package/dist/utils/blockchain/event-helpers.js.map +1 -0
  163. package/dist/utils/blockchain/index.cjs +30 -0
  164. package/dist/utils/blockchain/index.d.ts +8 -0
  165. package/dist/utils/blockchain/index.d.ts.map +1 -0
  166. package/dist/utils/blockchain/index.js +30 -0
  167. package/dist/utils/blockchain/index.js.map +1 -0
  168. package/dist/utils/blockchain/rpc-helpers.cjs +865 -0
  169. package/dist/utils/blockchain/rpc-helpers.d.ts +251 -0
  170. package/dist/utils/blockchain/rpc-helpers.d.ts.map +1 -0
  171. package/dist/utils/blockchain/rpc-helpers.js +865 -0
  172. package/dist/utils/blockchain/rpc-helpers.js.map +1 -0
  173. package/dist/utils/constants/application.cjs +158 -0
  174. package/dist/utils/constants/application.d.ts +119 -0
  175. package/dist/utils/constants/application.d.ts.map +1 -0
  176. package/dist/utils/constants/application.js +158 -0
  177. package/dist/utils/constants/application.js.map +1 -0
  178. package/dist/utils/constants/index.cjs +30 -0
  179. package/dist/utils/constants/index.d.ts +7 -0
  180. package/dist/utils/constants/index.d.ts.map +1 -0
  181. package/dist/utils/constants/index.js +30 -0
  182. package/dist/utils/constants/index.js.map +1 -0
  183. package/dist/utils/constants/status-values.cjs +14 -0
  184. package/dist/utils/constants/status-values.d.ts +12 -0
  185. package/dist/utils/constants/status-values.d.ts.map +1 -0
  186. package/dist/utils/constants/status-values.js +14 -0
  187. package/dist/utils/constants/status-values.js.map +1 -0
  188. package/dist/utils/formatting/currency.cjs +36 -0
  189. package/dist/utils/formatting/currency.d.ts +26 -0
  190. package/dist/utils/formatting/currency.d.ts.map +1 -0
  191. package/dist/utils/formatting/currency.js +36 -0
  192. package/dist/utils/formatting/currency.js.map +1 -0
  193. package/dist/utils/formatting/date.cjs +138 -0
  194. package/dist/utils/formatting/date.d.ts +33 -0
  195. package/dist/utils/formatting/date.d.ts.map +1 -0
  196. package/dist/utils/formatting/date.js +138 -0
  197. package/dist/utils/formatting/date.js.map +1 -0
  198. package/dist/utils/formatting/index.cjs +37 -0
  199. package/dist/utils/formatting/index.d.ts +4 -0
  200. package/dist/utils/formatting/index.d.ts.map +1 -0
  201. package/dist/utils/formatting/index.js +37 -0
  202. package/dist/utils/formatting/index.js.map +1 -0
  203. package/dist/utils/formatting/string.cjs +193 -0
  204. package/dist/utils/formatting/string.d.ts +69 -0
  205. package/dist/utils/formatting/string.d.ts.map +1 -0
  206. package/dist/utils/formatting/string.js +193 -0
  207. package/dist/utils/formatting/string.js.map +1 -0
  208. package/dist/utils/index.cjs +28 -0
  209. package/dist/utils/index.d.ts +12 -0
  210. package/dist/utils/index.d.ts.map +1 -0
  211. package/dist/utils/index.js +28 -0
  212. package/dist/utils/index.js.map +1 -0
  213. package/dist/utils/logging/index.cjs +16 -0
  214. package/dist/utils/logging/index.d.ts +5 -0
  215. package/dist/utils/logging/index.d.ts.map +1 -0
  216. package/dist/utils/logging/index.js +16 -0
  217. package/dist/utils/logging/index.js.map +1 -0
  218. package/dist/utils/logging/logger.cjs +92 -0
  219. package/dist/utils/logging/logger.d.ts +70 -0
  220. package/dist/utils/logging/logger.d.ts.map +1 -0
  221. package/dist/utils/logging/logger.js +92 -0
  222. package/dist/utils/logging/logger.js.map +1 -0
  223. package/dist/utils/url/index.cjs +13 -0
  224. package/dist/utils/url/index.d.ts +5 -0
  225. package/dist/utils/url/index.d.ts.map +1 -0
  226. package/dist/utils/url/index.js +13 -0
  227. package/dist/utils/url/index.js.map +1 -0
  228. package/dist/utils/url/url-params.cjs +128 -0
  229. package/dist/utils/url/url-params.d.ts +36 -0
  230. package/dist/utils/url/url-params.d.ts.map +1 -0
  231. package/dist/utils/url/url-params.js +128 -0
  232. package/dist/utils/url/url-params.js.map +1 -0
  233. package/dist/utils/validation/index.cjs +25 -0
  234. package/dist/utils/validation/index.d.ts +5 -0
  235. package/dist/utils/validation/index.d.ts.map +1 -0
  236. package/dist/utils/validation/index.js +25 -0
  237. package/dist/utils/validation/index.js.map +1 -0
  238. package/dist/utils/validation/type-validation.cjs +167 -0
  239. package/dist/utils/validation/type-validation.d.ts +68 -0
  240. package/dist/utils/validation/type-validation.d.ts.map +1 -0
  241. package/dist/utils/validation/type-validation.js +167 -0
  242. package/dist/utils/validation/type-validation.js.map +1 -0
  243. package/dist/utils/validation/web3-username-validator.cjs +132 -0
  244. package/dist/utils/validation/web3-username-validator.d.ts +43 -0
  245. package/dist/utils/validation/web3-username-validator.d.ts.map +1 -0
  246. package/dist/utils/validation/web3-username-validator.js +132 -0
  247. package/dist/utils/validation/web3-username-validator.js.map +1 -0
  248. package/package.json +80 -0
@@ -0,0 +1,296 @@
1
+ /**
2
+ * @fileoverview Mailbox contract response types for multi-chain messaging system
3
+ *
4
+ * This module contains all structured response types for the MailBox protocol
5
+ * including EVM and Solana implementations. These types provide type safety
6
+ * and consistent structure for all client interactions.
7
+ *
8
+ * @version 1.0.0
9
+ * @author MailBox Protocol Team
10
+ */
11
+ import { Optional, BaseResponse, PaginatedResponse, MessageBase, UnifiedError } from '../common';
12
+ import { ChainType } from '../business/enums';
13
+ /**
14
+ * Base response structure for all blockchain operations
15
+ */
16
+ export interface BaseTransactionResponse {
17
+ /** Transaction hash/signature */
18
+ transactionHash: string;
19
+ /** Blockchain type where transaction occurred */
20
+ chainType: ChainType.EVM | ChainType.SOLANA;
21
+ /** Timestamp when transaction was created (Unix timestamp in ms) */
22
+ timestamp?: Optional<number>;
23
+ /** Whether the transaction was successful */
24
+ success: boolean;
25
+ /** Error message if transaction failed */
26
+ error?: Optional<string>;
27
+ }
28
+ /**
29
+ * Enhanced transaction response with block information
30
+ */
31
+ export interface TransactionReceipt extends BaseTransactionResponse {
32
+ /** Block number (EVM) or slot (Solana) */
33
+ blockNumber?: Optional<number>;
34
+ /** Solana slot number */
35
+ slot?: Optional<number>;
36
+ /** Gas used for EVM transactions */
37
+ gasUsed?: Optional<bigint>;
38
+ /** Transaction confirmation status */
39
+ confirmationStatus?: Optional<'processed' | 'confirmed' | 'finalized'>;
40
+ }
41
+ /**
42
+ * Response for message sending operations
43
+ */
44
+ export interface MessageSendResponse extends TransactionReceipt {
45
+ /** Message identifier (if available) */
46
+ messageId?: Optional<string>;
47
+ /** Fee paid for sending the message */
48
+ fee: bigint | number;
49
+ /** Recipient address */
50
+ recipient?: Optional<string>;
51
+ /** Message subject */
52
+ subject?: Optional<string>;
53
+ /** Message body */
54
+ body?: Optional<string>;
55
+ /** Whether this was a priority message */
56
+ isPriority: boolean;
57
+ /** Revenue share amount claimable by recipient (for priority messages) */
58
+ claimableRevenue?: Optional<bigint | number>;
59
+ /** Expiry timestamp for revenue claims */
60
+ claimExpiryTimestamp?: Optional<number>;
61
+ }
62
+ /**
63
+ * Response for pre-prepared message sending
64
+ */
65
+ export interface PreparedMessageSendResponse extends TransactionReceipt {
66
+ /** Pre-prepared message identifier */
67
+ mailId: string;
68
+ /** Fee paid for sending */
69
+ fee: bigint | number;
70
+ /** Recipient address */
71
+ recipient: string;
72
+ /** Whether this was a priority prepared message */
73
+ isPriority: boolean;
74
+ /** Revenue share amount claimable by recipient */
75
+ claimableRevenue?: Optional<bigint | number>;
76
+ }
77
+ /**
78
+ * Information about claimable revenue shares
79
+ */
80
+ export interface ClaimableInfo {
81
+ /** Amount available to claim */
82
+ amount: bigint | number;
83
+ /** Timestamp when claim expires (Unix timestamp in ms) */
84
+ expiryTimestamp: number;
85
+ /** Whether the claim has expired */
86
+ isExpired: boolean;
87
+ /** Whether claim is still valid */
88
+ isClaimable: boolean;
89
+ }
90
+ /**
91
+ * Response for revenue claim operations
92
+ */
93
+ export interface ClaimRevenueResponse extends TransactionReceipt {
94
+ /** Amount claimed */
95
+ claimedAmount: bigint | number;
96
+ /** Remaining claimable amount */
97
+ remainingAmount: bigint | number;
98
+ /** Type of claim */
99
+ claimType: 'recipient' | 'owner' | 'expired';
100
+ }
101
+ /**
102
+ * Response for checking claimable amounts
103
+ */
104
+ export interface ClaimableAmountResponse {
105
+ /** Recipient claimable information */
106
+ recipientClaimable: ClaimableInfo;
107
+ /** Owner claimable amount */
108
+ ownerClaimable: bigint | number;
109
+ /** Last updated timestamp */
110
+ lastUpdated: number;
111
+ }
112
+ /**
113
+ * Response for domain registration operations
114
+ */
115
+ export interface DomainRegistrationResponse extends TransactionReceipt {
116
+ /** Registered domain name */
117
+ domain: string;
118
+ /** Domain expiry timestamp */
119
+ expiryTimestamp: number;
120
+ /** Registration fee paid */
121
+ fee: bigint | number;
122
+ /** Whether this was an extension of existing domain */
123
+ isExtension: boolean;
124
+ }
125
+ /**
126
+ * Response for delegation operations
127
+ */
128
+ export interface MailboxDelegationResponse extends TransactionReceipt {
129
+ /** Address that created the delegation */
130
+ delegator: string;
131
+ /** Address that was delegated to */
132
+ delegate: string;
133
+ /** Delegation fee paid */
134
+ fee: bigint | number;
135
+ /** Whether this cleared an existing delegation */
136
+ isClearing: boolean;
137
+ }
138
+ /**
139
+ * Response for delegation rejection operations
140
+ */
141
+ export interface DelegationRejectionResponse extends TransactionReceipt {
142
+ /** Address that rejected the delegation */
143
+ rejector: string;
144
+ /** Address that was trying to delegate */
145
+ delegatingAddress: string;
146
+ }
147
+ /**
148
+ * Current fee information
149
+ */
150
+ export interface FeeInfo {
151
+ /** Current send fee (in micro-USDC) */
152
+ sendFee: bigint | number;
153
+ /** Current delegation fee (in micro-USDC) */
154
+ delegationFee: bigint | number;
155
+ /** Current domain registration fee (in micro-USDC) */
156
+ registrationFee?: Optional<bigint | number>;
157
+ /** Last updated timestamp */
158
+ lastUpdated: number;
159
+ }
160
+ /**
161
+ * Response for fee update operations
162
+ */
163
+ export interface FeeUpdateResponse extends TransactionReceipt {
164
+ /** Type of fee that was updated */
165
+ feeType: 'send' | 'delegation' | 'registration';
166
+ /** Previous fee amount */
167
+ oldFee: bigint | number;
168
+ /** New fee amount */
169
+ newFee: bigint | number;
170
+ }
171
+ /**
172
+ * Contract pause status information
173
+ */
174
+ export interface PauseInfo {
175
+ /** Whether the contract is currently paused */
176
+ isPaused: boolean;
177
+ /** Timestamp when pause was activated */
178
+ pausedAt?: Optional<number>;
179
+ /** Address that initiated the pause */
180
+ pausedBy?: Optional<string>;
181
+ }
182
+ /**
183
+ * Response for pause/unpause operations
184
+ */
185
+ export interface PauseResponse extends TransactionReceipt {
186
+ /** New pause status */
187
+ isPaused: boolean;
188
+ /** Whether this was an emergency pause */
189
+ isEmergency?: Optional<boolean>;
190
+ }
191
+ /**
192
+ * Emergency fund distribution response
193
+ */
194
+ export interface EmergencyDistributionResponse extends TransactionReceipt {
195
+ /** Amount distributed */
196
+ distributedAmount: bigint | number;
197
+ /** Recipients of the distribution */
198
+ recipients: string[];
199
+ }
200
+ /**
201
+ * EVM-specific response additions
202
+ */
203
+ export interface EVMTransactionResponse extends TransactionReceipt {
204
+ chainType: ChainType.EVM;
205
+ /** EVM block number */
206
+ blockNumber: number;
207
+ /** Gas used */
208
+ gasUsed: bigint;
209
+ /** Gas price */
210
+ gasPrice?: Optional<bigint>;
211
+ /** Contract address for deployment transactions */
212
+ contractAddress?: Optional<string>;
213
+ }
214
+ /**
215
+ * Solana-specific response additions
216
+ */
217
+ export interface SolanaTransactionResponse extends TransactionReceipt {
218
+ chainType: ChainType.SOLANA;
219
+ /** Solana slot number */
220
+ slot: number;
221
+ /** Compute units consumed */
222
+ computeUnitsConsumed?: Optional<number>;
223
+ /** Transaction fee in lamports */
224
+ transactionFee?: Optional<number>;
225
+ }
226
+ /**
227
+ * Unified client response for cross-chain operations
228
+ */
229
+ export interface UnifiedClientResponse<T = unknown> extends BaseResponse<T> {
230
+ /** Chain where operation occurred */
231
+ chainType: ChainType.EVM | ChainType.SOLANA;
232
+ /** Request metadata */
233
+ metadata?: Optional<{
234
+ requestId?: Optional<string>;
235
+ duration?: Optional<number>;
236
+ }>;
237
+ }
238
+ /**
239
+ * Batch operation response
240
+ */
241
+ export interface BatchOperationResponse extends BaseTransactionResponse {
242
+ /** Results for each operation in the batch */
243
+ results: Array<{
244
+ success: boolean;
245
+ data?: Optional<unknown>;
246
+ error?: Optional<string>;
247
+ }>;
248
+ /** Number of successful operations */
249
+ successCount: number;
250
+ /** Number of failed operations */
251
+ failureCount: number;
252
+ }
253
+ /**
254
+ * Message history item structure
255
+ */
256
+ export interface MessageHistoryItem extends MessageBase {
257
+ messageId: string;
258
+ transactionHash: string;
259
+ timestamp: number;
260
+ isPriority: boolean;
261
+ fee: bigint | number;
262
+ }
263
+ /**
264
+ * Response for querying message history
265
+ */
266
+ export interface MessageHistoryResponse extends PaginatedResponse<MessageHistoryItem> {
267
+ }
268
+ /**
269
+ * Response for querying delegation status
270
+ */
271
+ export interface DelegationStatusResponse {
272
+ /** Current delegation target (null if no delegation) */
273
+ currentDelegate?: Optional<string>;
274
+ /** Timestamp when delegation was set */
275
+ delegatedAt?: Optional<number>;
276
+ /** Addresses that have delegated to this address */
277
+ incomingDelegations: string[];
278
+ /** Total delegation fee paid */
279
+ totalDelegationFees: bigint | number;
280
+ }
281
+ export type ContractError = UnifiedError;
282
+ /**
283
+ * Type guard to check if response is EVM-specific
284
+ */
285
+ export declare function isEVMResponse(response: TransactionReceipt): response is EVMTransactionResponse;
286
+ /**
287
+ * Type guard to check if response is Solana-specific
288
+ */
289
+ export declare function isSolanaResponse(response: TransactionReceipt): response is SolanaTransactionResponse;
290
+ /**
291
+ * Type guard to check if response contains an error
292
+ */
293
+ export declare function isMailboxErrorResponse(response: UnifiedClientResponse): response is UnifiedClientResponse & {
294
+ error: NonNullable<UnifiedClientResponse['error']>;
295
+ };
296
+ //# sourceMappingURL=mail-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"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CAAC;IAC/B,oDAAoD;IACpD,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,gCAAgC;IAChC,mBAAmB,EAAE,MAAM,GAAG,MAAM,CAAC;CACtC;AAOD,MAAM,MAAM,aAAa,GAAG,YAAY,CAAC;AAMzC;;GAEG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,kBAAkB,GAC3B,QAAQ,IAAI,sBAAsB,CAEpC;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,kBAAkB,GAC3B,QAAQ,IAAI,yBAAyB,CAEvC;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,qBAAqB,GAC9B,QAAQ,IAAI,qBAAqB,GAAG;IACrC,KAAK,EAAE,WAAW,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC,CAAC;CACpD,CAEA"}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ /**
3
+ * @fileoverview Mailbox contract response types for multi-chain messaging system
4
+ *
5
+ * This module contains all structured response types for the MailBox protocol
6
+ * including EVM and Solana implementations. These types provide type safety
7
+ * and consistent structure for all client interactions.
8
+ *
9
+ * @version 1.0.0
10
+ * @author MailBox Protocol Team
11
+ */
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.isEVMResponse = isEVMResponse;
14
+ exports.isSolanaResponse = isSolanaResponse;
15
+ exports.isMailboxErrorResponse = isMailboxErrorResponse;
16
+ const enums_1 = require("../business/enums");
17
+ // =======================
18
+ // Type Guards
19
+ // =======================
20
+ /**
21
+ * Type guard to check if response is EVM-specific
22
+ */
23
+ function isEVMResponse(response) {
24
+ return response.chainType === enums_1.ChainType.EVM;
25
+ }
26
+ /**
27
+ * Type guard to check if response is Solana-specific
28
+ */
29
+ function isSolanaResponse(response) {
30
+ return response.chainType === enums_1.ChainType.SOLANA;
31
+ }
32
+ /**
33
+ * Type guard to check if response contains an error
34
+ */
35
+ function isMailboxErrorResponse(response) {
36
+ return !response.success && response.error !== undefined;
37
+ }
38
+ //# sourceMappingURL=mail-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mail-types.js","sourceRoot":"","sources":["../../../src/types/mailer/mail-types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;AA+VH,sCAIC;AAKD,4CAIC;AAKD,wDAMC;AA9WD,6CAA8C;AA+U9C,0BAA0B;AAC1B,cAAc;AACd,0BAA0B;AAE1B;;GAEG;AACH,SAAgB,aAAa,CAC3B,QAA4B;IAE5B,OAAO,QAAQ,CAAC,SAAS,KAAK,iBAAS,CAAC,GAAG,CAAC;AAC9C,CAAC;AAED;;GAEG;AACH,SAAgB,gBAAgB,CAC9B,QAA4B;IAE5B,OAAO,QAAQ,CAAC,SAAS,KAAK,iBAAS,CAAC,MAAM,CAAC;AACjD,CAAC;AAED;;GAEG;AACH,SAAgB,sBAAsB,CACpC,QAA+B;IAI/B,OAAO,CAAC,QAAQ,CAAC,OAAO,IAAI,QAAQ,CAAC,KAAK,KAAK,SAAS,CAAC;AAC3D,CAAC"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ // WildDuck Mail Server API types
18
+ __exportStar(require("./wildduck-types"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,2 @@
1
+ export * from './wildduck-types';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/wildduck/index.ts"],"names":[],"mappings":"AACA,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ // WildDuck Mail Server API types
18
+ __exportStar(require("./wildduck-types"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/wildduck/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iCAAiC;AACjC,mDAAiC"}
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ /**
3
+ * Comprehensive WildDuck API Type Definitions
4
+ * Generated based on WildDuck API specification
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.isWildduckMessage = exports.isWildduckAuthResponse = void 0;
8
+ exports.createPreAuthRequest = createPreAuthRequest;
9
+ exports.createAuthenticateRequest = createAuthenticateRequest;
10
+ // Request builder functions
11
+ function createPreAuthRequest(username, options) {
12
+ return {
13
+ username,
14
+ scope: "master",
15
+ ...options,
16
+ };
17
+ }
18
+ function createAuthenticateRequest(username, signature, message, options) {
19
+ return {
20
+ username,
21
+ ...(signature && { signature }),
22
+ ...(message && { message }),
23
+ protocol: "API",
24
+ scope: "master",
25
+ token: false,
26
+ ...options,
27
+ };
28
+ }
29
+ // ============================================================================
30
+ // Type Guards
31
+ // ============================================================================
32
+ const isWildduckAuthResponse = (obj) => {
33
+ return (typeof obj === "object" &&
34
+ obj !== null &&
35
+ "success" in obj &&
36
+ typeof obj.success === "boolean");
37
+ };
38
+ exports.isWildduckAuthResponse = isWildduckAuthResponse;
39
+ const isWildduckMessage = (obj) => {
40
+ return (typeof obj === "object" &&
41
+ obj !== null &&
42
+ "id" in obj &&
43
+ "subject" in obj &&
44
+ typeof obj.id === "string" &&
45
+ typeof obj.subject === "string");
46
+ };
47
+ exports.isWildduckMessage = isWildduckMessage;
48
+ //# sourceMappingURL=wildduck-types.js.map