@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.
- package/CLAUDE.md +285 -0
- package/README.md +310 -0
- package/dist/index.cjs +62 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +62 -0
- package/dist/index.js.map +1 -0
- package/dist/types/blockchain/common.cjs +102 -0
- package/dist/types/blockchain/common.d.ts +262 -0
- package/dist/types/blockchain/common.d.ts.map +1 -0
- package/dist/types/blockchain/common.js +102 -0
- package/dist/types/blockchain/common.js.map +1 -0
- package/dist/types/blockchain/index.cjs +18 -0
- package/dist/types/blockchain/index.d.ts +4 -0
- package/dist/types/blockchain/index.d.ts.map +1 -0
- package/dist/types/blockchain/index.js +18 -0
- package/dist/types/blockchain/index.js.map +1 -0
- package/dist/types/blockchain/validation.cjs +88 -0
- package/dist/types/blockchain/validation.d.ts +9 -0
- package/dist/types/blockchain/validation.d.ts.map +1 -0
- package/dist/types/blockchain/validation.js +88 -0
- package/dist/types/blockchain/validation.js.map +1 -0
- package/dist/types/business/enums.cjs +314 -0
- package/dist/types/business/enums.d.ts +227 -0
- package/dist/types/business/enums.d.ts.map +1 -0
- package/dist/types/business/enums.js +314 -0
- package/dist/types/business/enums.js.map +1 -0
- package/dist/types/business/index.cjs +33 -0
- package/dist/types/business/index.d.ts +5 -0
- package/dist/types/business/index.d.ts.map +1 -0
- package/dist/types/business/index.js +33 -0
- package/dist/types/business/index.js.map +1 -0
- package/dist/types/business/wallet-status.cjs +38 -0
- package/dist/types/business/wallet-status.d.ts +32 -0
- package/dist/types/business/wallet-status.d.ts.map +1 -0
- package/dist/types/business/wallet-status.js +38 -0
- package/dist/types/business/wallet-status.js.map +1 -0
- package/dist/types/common.cjs +6 -0
- package/dist/types/common.d.ts +142 -0
- package/dist/types/common.d.ts.map +1 -0
- package/dist/types/common.js +6 -0
- package/dist/types/common.js.map +1 -0
- package/dist/types/config/app-config.cjs +6 -0
- package/dist/types/config/app-config.d.ts +67 -0
- package/dist/types/config/app-config.d.ts.map +1 -0
- package/dist/types/config/app-config.js +6 -0
- package/dist/types/config/app-config.js.map +1 -0
- package/dist/types/config/environment.cjs +24 -0
- package/dist/types/config/environment.d.ts +68 -0
- package/dist/types/config/environment.d.ts.map +1 -0
- package/dist/types/config/environment.js +24 -0
- package/dist/types/config/environment.js.map +1 -0
- package/dist/types/config/index.cjs +6 -0
- package/dist/types/config/index.d.ts +4 -0
- package/dist/types/config/index.d.ts.map +1 -0
- package/dist/types/config/index.js +6 -0
- package/dist/types/config/index.js.map +1 -0
- package/dist/types/index.cjs +35 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +35 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/indexer/index.cjs +19 -0
- package/dist/types/indexer/index.d.ts +3 -0
- package/dist/types/indexer/index.d.ts.map +1 -0
- package/dist/types/indexer/index.js +19 -0
- package/dist/types/indexer/index.js.map +1 -0
- package/dist/types/indexer/indexer-guards.cjs +145 -0
- package/dist/types/indexer/indexer-guards.d.ts +26 -0
- package/dist/types/indexer/indexer-guards.d.ts.map +1 -0
- package/dist/types/indexer/indexer-guards.js +145 -0
- package/dist/types/indexer/indexer-guards.js.map +1 -0
- package/dist/types/indexer/indexer-responses.cjs +8 -0
- package/dist/types/indexer/indexer-responses.d.ts +136 -0
- package/dist/types/indexer/indexer-responses.d.ts.map +1 -0
- package/dist/types/indexer/indexer-responses.js +8 -0
- package/dist/types/indexer/indexer-responses.js.map +1 -0
- package/dist/types/infrastructure/analytics.cjs +212 -0
- package/dist/types/infrastructure/analytics.d.ts +449 -0
- package/dist/types/infrastructure/analytics.d.ts.map +1 -0
- package/dist/types/infrastructure/analytics.js +212 -0
- package/dist/types/infrastructure/analytics.js.map +1 -0
- package/dist/types/infrastructure/api.cjs +17 -0
- package/dist/types/infrastructure/api.d.ts +152 -0
- package/dist/types/infrastructure/api.d.ts.map +1 -0
- package/dist/types/infrastructure/api.js +17 -0
- package/dist/types/infrastructure/api.js.map +1 -0
- package/dist/types/infrastructure/index.cjs +14 -0
- package/dist/types/infrastructure/index.d.ts +9 -0
- package/dist/types/infrastructure/index.d.ts.map +1 -0
- package/dist/types/infrastructure/index.js +14 -0
- package/dist/types/infrastructure/index.js.map +1 -0
- package/dist/types/infrastructure/navigation.cjs +3 -0
- package/dist/types/infrastructure/navigation.d.ts +56 -0
- package/dist/types/infrastructure/navigation.d.ts.map +1 -0
- package/dist/types/infrastructure/navigation.js +3 -0
- package/dist/types/infrastructure/navigation.js.map +1 -0
- package/dist/types/infrastructure/network.cjs +18 -0
- package/dist/types/infrastructure/network.d.ts +48 -0
- package/dist/types/infrastructure/network.d.ts.map +1 -0
- package/dist/types/infrastructure/network.js +18 -0
- package/dist/types/infrastructure/network.js.map +1 -0
- package/dist/types/infrastructure/wallet.cjs +37 -0
- package/dist/types/infrastructure/wallet.d.ts +33 -0
- package/dist/types/infrastructure/wallet.d.ts.map +1 -0
- package/dist/types/infrastructure/wallet.js +37 -0
- package/dist/types/infrastructure/wallet.js.map +1 -0
- package/dist/types/kyc/index.cjs +19 -0
- package/dist/types/kyc/index.d.ts +2 -0
- package/dist/types/kyc/index.d.ts.map +1 -0
- package/dist/types/kyc/index.js +19 -0
- package/dist/types/kyc/index.js.map +1 -0
- package/dist/types/kyc/kyc-types.cjs +12 -0
- package/dist/types/kyc/kyc-types.d.ts +260 -0
- package/dist/types/kyc/kyc-types.d.ts.map +1 -0
- package/dist/types/kyc/kyc-types.js +12 -0
- package/dist/types/kyc/kyc-types.js.map +1 -0
- package/dist/types/mailer/index.cjs +19 -0
- package/dist/types/mailer/index.d.ts +2 -0
- package/dist/types/mailer/index.d.ts.map +1 -0
- package/dist/types/mailer/index.js +19 -0
- package/dist/types/mailer/index.js.map +1 -0
- package/dist/types/mailer/mail-types.cjs +38 -0
- package/dist/types/mailer/mail-types.d.ts +296 -0
- package/dist/types/mailer/mail-types.d.ts.map +1 -0
- package/dist/types/mailer/mail-types.js +38 -0
- package/dist/types/mailer/mail-types.js.map +1 -0
- package/dist/types/wildduck/index.cjs +19 -0
- package/dist/types/wildduck/index.d.ts +2 -0
- package/dist/types/wildduck/index.d.ts.map +1 -0
- package/dist/types/wildduck/index.js +19 -0
- package/dist/types/wildduck/index.js.map +1 -0
- package/dist/types/wildduck/wildduck-types.cjs +48 -0
- package/dist/types/wildduck/wildduck-types.d.ts +1239 -0
- package/dist/types/wildduck/wildduck-types.d.ts.map +1 -0
- package/dist/types/wildduck/wildduck-types.js +48 -0
- package/dist/types/wildduck/wildduck-types.js.map +1 -0
- package/dist/utils/async-helpers.cjs +130 -0
- package/dist/utils/async-helpers.d.ts +35 -0
- package/dist/utils/async-helpers.d.ts.map +1 -0
- package/dist/utils/async-helpers.js +130 -0
- package/dist/utils/async-helpers.js.map +1 -0
- package/dist/utils/auth/auth.cjs +96 -0
- package/dist/utils/auth/auth.d.ts +40 -0
- package/dist/utils/auth/auth.d.ts.map +1 -0
- package/dist/utils/auth/auth.js +96 -0
- package/dist/utils/auth/auth.js.map +1 -0
- package/dist/utils/auth/index.cjs +14 -0
- package/dist/utils/auth/index.d.ts +2 -0
- package/dist/utils/auth/index.d.ts.map +1 -0
- package/dist/utils/auth/index.js +14 -0
- package/dist/utils/auth/index.js.map +1 -0
- package/dist/utils/blockchain/address.cjs +231 -0
- package/dist/utils/blockchain/address.d.ts +65 -0
- package/dist/utils/blockchain/address.d.ts.map +1 -0
- package/dist/utils/blockchain/address.js +231 -0
- package/dist/utils/blockchain/address.js.map +1 -0
- package/dist/utils/blockchain/event-helpers.cjs +143 -0
- package/dist/utils/blockchain/event-helpers.d.ts +87 -0
- package/dist/utils/blockchain/event-helpers.d.ts.map +1 -0
- package/dist/utils/blockchain/event-helpers.js +143 -0
- package/dist/utils/blockchain/event-helpers.js.map +1 -0
- package/dist/utils/blockchain/index.cjs +30 -0
- package/dist/utils/blockchain/index.d.ts +8 -0
- package/dist/utils/blockchain/index.d.ts.map +1 -0
- package/dist/utils/blockchain/index.js +30 -0
- package/dist/utils/blockchain/index.js.map +1 -0
- package/dist/utils/blockchain/rpc-helpers.cjs +865 -0
- package/dist/utils/blockchain/rpc-helpers.d.ts +251 -0
- package/dist/utils/blockchain/rpc-helpers.d.ts.map +1 -0
- package/dist/utils/blockchain/rpc-helpers.js +865 -0
- package/dist/utils/blockchain/rpc-helpers.js.map +1 -0
- package/dist/utils/constants/application.cjs +158 -0
- package/dist/utils/constants/application.d.ts +119 -0
- package/dist/utils/constants/application.d.ts.map +1 -0
- package/dist/utils/constants/application.js +158 -0
- package/dist/utils/constants/application.js.map +1 -0
- package/dist/utils/constants/index.cjs +30 -0
- package/dist/utils/constants/index.d.ts +7 -0
- package/dist/utils/constants/index.d.ts.map +1 -0
- package/dist/utils/constants/index.js +30 -0
- package/dist/utils/constants/index.js.map +1 -0
- package/dist/utils/constants/status-values.cjs +14 -0
- package/dist/utils/constants/status-values.d.ts +12 -0
- package/dist/utils/constants/status-values.d.ts.map +1 -0
- package/dist/utils/constants/status-values.js +14 -0
- package/dist/utils/constants/status-values.js.map +1 -0
- package/dist/utils/formatting/currency.cjs +36 -0
- package/dist/utils/formatting/currency.d.ts +26 -0
- package/dist/utils/formatting/currency.d.ts.map +1 -0
- package/dist/utils/formatting/currency.js +36 -0
- package/dist/utils/formatting/currency.js.map +1 -0
- package/dist/utils/formatting/date.cjs +138 -0
- package/dist/utils/formatting/date.d.ts +33 -0
- package/dist/utils/formatting/date.d.ts.map +1 -0
- package/dist/utils/formatting/date.js +138 -0
- package/dist/utils/formatting/date.js.map +1 -0
- package/dist/utils/formatting/index.cjs +37 -0
- package/dist/utils/formatting/index.d.ts +4 -0
- package/dist/utils/formatting/index.d.ts.map +1 -0
- package/dist/utils/formatting/index.js +37 -0
- package/dist/utils/formatting/index.js.map +1 -0
- package/dist/utils/formatting/string.cjs +193 -0
- package/dist/utils/formatting/string.d.ts +69 -0
- package/dist/utils/formatting/string.d.ts.map +1 -0
- package/dist/utils/formatting/string.js +193 -0
- package/dist/utils/formatting/string.js.map +1 -0
- package/dist/utils/index.cjs +28 -0
- package/dist/utils/index.d.ts +12 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +28 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/logging/index.cjs +16 -0
- package/dist/utils/logging/index.d.ts +5 -0
- package/dist/utils/logging/index.d.ts.map +1 -0
- package/dist/utils/logging/index.js +16 -0
- package/dist/utils/logging/index.js.map +1 -0
- package/dist/utils/logging/logger.cjs +92 -0
- package/dist/utils/logging/logger.d.ts +70 -0
- package/dist/utils/logging/logger.d.ts.map +1 -0
- package/dist/utils/logging/logger.js +92 -0
- package/dist/utils/logging/logger.js.map +1 -0
- package/dist/utils/url/index.cjs +13 -0
- package/dist/utils/url/index.d.ts +5 -0
- package/dist/utils/url/index.d.ts.map +1 -0
- package/dist/utils/url/index.js +13 -0
- package/dist/utils/url/index.js.map +1 -0
- package/dist/utils/url/url-params.cjs +128 -0
- package/dist/utils/url/url-params.d.ts +36 -0
- package/dist/utils/url/url-params.d.ts.map +1 -0
- package/dist/utils/url/url-params.js +128 -0
- package/dist/utils/url/url-params.js.map +1 -0
- package/dist/utils/validation/index.cjs +25 -0
- package/dist/utils/validation/index.d.ts +5 -0
- package/dist/utils/validation/index.d.ts.map +1 -0
- package/dist/utils/validation/index.js +25 -0
- package/dist/utils/validation/index.js.map +1 -0
- package/dist/utils/validation/type-validation.cjs +167 -0
- package/dist/utils/validation/type-validation.d.ts +68 -0
- package/dist/utils/validation/type-validation.d.ts.map +1 -0
- package/dist/utils/validation/type-validation.js +167 -0
- package/dist/utils/validation/type-validation.js.map +1 -0
- package/dist/utils/validation/web3-username-validator.cjs +132 -0
- package/dist/utils/validation/web3-username-validator.d.ts +43 -0
- package/dist/utils/validation/web3-username-validator.d.ts.map +1 -0
- package/dist/utils/validation/web3-username-validator.js +132 -0
- package/dist/utils/validation/web3-username-validator.js.map +1 -0
- 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
|
+
{"version":3,"file":"mail-types.d.ts","sourceRoot":"","sources":["../../../src/types/mailer/mail-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,iBAAiB,EACjB,WAAW,EACX,YAAY,EACb,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAM9C;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,iCAAiC;IACjC,eAAe,EAAE,MAAM,CAAC;IACxB,iDAAiD;IACjD,SAAS,EAAE,SAAS,CAAC,GAAG,GAAG,SAAS,CAAC,MAAM,CAAC;IAC5C,oEAAoE;IACpE,SAAS,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC7B,6CAA6C;IAC7C,OAAO,EAAE,OAAO,CAAC;IACjB,0CAA0C;IAC1C,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,uBAAuB;IACjE,0CAA0C;IAC1C,WAAW,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC/B,yBAAyB;IACzB,IAAI,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IACxB,oCAAoC;IACpC,OAAO,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC3B,sCAAsC;IACtC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EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,sBACf,SAAQ,iBAAiB,CAAC,kBAAkB,CAAC;CAAG;AAElD;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,wDAAwD;IACxD,eAAe,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IACnC,wCAAwC;IACxC,WAAW,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,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 @@
|
|
|
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
|