@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,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview Address Validation Utility
|
|
4
|
+
* @description Centralized address validation for EVM, Solana, ENS, and SNS addresses
|
|
5
|
+
* Eliminates code duplication across multiple files
|
|
6
|
+
*
|
|
7
|
+
* Pure TypeScript implementation with no external dependencies
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.Web3UsernameValidator = void 0;
|
|
11
|
+
// Import ChainType from business enums
|
|
12
|
+
const enums_1 = require("../../types/business/enums");
|
|
13
|
+
class Web3UsernameValidator {
|
|
14
|
+
/**
|
|
15
|
+
* Comprehensive address validation for API endpoint
|
|
16
|
+
* Returns AddressValidationResult for valid addresses, undefined for invalid ones
|
|
17
|
+
*/
|
|
18
|
+
static validate(address) {
|
|
19
|
+
if (!address) {
|
|
20
|
+
return undefined;
|
|
21
|
+
}
|
|
22
|
+
// 1. Check if it's a valid EVM address (0x + 40 hex characters)
|
|
23
|
+
if (this.EVM_REGEX.test(address)) {
|
|
24
|
+
return {
|
|
25
|
+
name: null,
|
|
26
|
+
address: address.toLowerCase(),
|
|
27
|
+
chainType: enums_1.ChainType.EVM,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
// 2. Check if it's a valid Solana address (Base58, 32-44 characters, no 0x prefix)
|
|
31
|
+
if (!address.startsWith('0x') &&
|
|
32
|
+
address.length >= 32 &&
|
|
33
|
+
address.length <= 44 &&
|
|
34
|
+
this.BASE58_REGEX.test(address)) {
|
|
35
|
+
return {
|
|
36
|
+
name: null,
|
|
37
|
+
address: address, // Keep case for Solana
|
|
38
|
+
chainType: enums_1.ChainType.SOLANA,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
// 3. Check if it's a valid ENS name (.eth or .box)
|
|
42
|
+
if ((address.toLowerCase().endsWith('.eth') ||
|
|
43
|
+
address.toLowerCase().endsWith('.box')) &&
|
|
44
|
+
address.length >= 5 && // minimum: "a.eth" = 5 chars
|
|
45
|
+
this.ENS_REGEX.test(address)) {
|
|
46
|
+
return {
|
|
47
|
+
name: address.toLowerCase(),
|
|
48
|
+
address: null,
|
|
49
|
+
chainType: enums_1.ChainType.EVM, // ENS resolves to EVM addresses
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
// 4. Check if it's a valid SNS name (Solana Name Service)
|
|
53
|
+
if (address.toLowerCase().includes('.')) {
|
|
54
|
+
const parts = address.toLowerCase().split('.');
|
|
55
|
+
if (parts.length === 2) {
|
|
56
|
+
const [name, tld] = parts;
|
|
57
|
+
if (this.VALID_SNS_TLDS.includes(tld) &&
|
|
58
|
+
this.SNS_NAME_REGEX.test(name) &&
|
|
59
|
+
name.length >= 1) {
|
|
60
|
+
return {
|
|
61
|
+
name: address.toLowerCase(),
|
|
62
|
+
address: null,
|
|
63
|
+
chainType: enums_1.ChainType.SOLANA, // SNS resolves to Solana addresses
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
// If no format matches, return undefined
|
|
69
|
+
return undefined;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Quick EVM address validation
|
|
73
|
+
*/
|
|
74
|
+
static isValidEVMAddress(address) {
|
|
75
|
+
return this.EVM_REGEX.test(address);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Quick Solana address validation
|
|
79
|
+
*/
|
|
80
|
+
static isValidSolanaAddress(address) {
|
|
81
|
+
return (!address.startsWith('0x') &&
|
|
82
|
+
address.length >= 32 &&
|
|
83
|
+
address.length <= 44 &&
|
|
84
|
+
this.BASE58_REGEX.test(address));
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Quick ENS name validation
|
|
88
|
+
*/
|
|
89
|
+
static isValidENSName(address) {
|
|
90
|
+
return ((address.toLowerCase().endsWith('.eth') ||
|
|
91
|
+
address.toLowerCase().endsWith('.box')) &&
|
|
92
|
+
address.length >= 5 &&
|
|
93
|
+
this.ENS_REGEX.test(address));
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Quick SNS name validation
|
|
97
|
+
*/
|
|
98
|
+
static isValidSNSName(address) {
|
|
99
|
+
if (!address.toLowerCase().includes('.'))
|
|
100
|
+
return false;
|
|
101
|
+
const parts = address.toLowerCase().split('.');
|
|
102
|
+
if (parts.length !== 2)
|
|
103
|
+
return false;
|
|
104
|
+
const [name, tld] = parts;
|
|
105
|
+
return (this.VALID_SNS_TLDS.includes(tld) &&
|
|
106
|
+
this.SNS_NAME_REGEX.test(name) &&
|
|
107
|
+
name.length >= 1);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
exports.Web3UsernameValidator = Web3UsernameValidator;
|
|
111
|
+
// Regex patterns for different address types
|
|
112
|
+
Web3UsernameValidator.EVM_REGEX = /^0x[a-fA-F0-9]{40}$/;
|
|
113
|
+
Web3UsernameValidator.BASE58_REGEX = /^[1-9A-HJ-NP-Za-km-z]+$/;
|
|
114
|
+
Web3UsernameValidator.ENS_REGEX = /^[a-zA-Z0-9]([a-zA-Z0-9]|(-[a-zA-Z0-9]))*\.(eth|box)$/i;
|
|
115
|
+
Web3UsernameValidator.SNS_NAME_REGEX = /^[a-zA-Z0-9]([a-zA-Z0-9]|(-[a-zA-Z0-9]))*$/;
|
|
116
|
+
// Valid SNS top-level domains
|
|
117
|
+
Web3UsernameValidator.VALID_SNS_TLDS = [
|
|
118
|
+
'sol',
|
|
119
|
+
'abc',
|
|
120
|
+
'backpack',
|
|
121
|
+
'bonk',
|
|
122
|
+
'coin',
|
|
123
|
+
'dao',
|
|
124
|
+
'defi',
|
|
125
|
+
'gm',
|
|
126
|
+
'poor',
|
|
127
|
+
'pump',
|
|
128
|
+
'shdw',
|
|
129
|
+
'stepn',
|
|
130
|
+
'web3',
|
|
131
|
+
];
|
|
132
|
+
//# sourceMappingURL=web3-username-validator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web3-username-validator.js","sourceRoot":"","sources":["../../../src/utils/validation/web3-username-validator.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,uCAAuC;AACvC,sDAAuD;AASvD,MAAa,qBAAqB;IA0BhC;;;OAGG;IACH,MAAM,CAAC,QAAQ,CAAC,OAAe;QAC7B,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,gEAAgE;QAChE,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;YACjC,OAAO;gBACL,IAAI,EAAE,IAAI;gBACV,OAAO,EAAE,OAAO,CAAC,WAAW,EAAE;gBAC9B,SAAS,EAAE,iBAAS,CAAC,GAAG;aACzB,CAAC;QACJ,CAAC;QAED,mFAAmF;QACnF,IACE,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC;YACzB,OAAO,CAAC,MAAM,IAAI,EAAE;YACpB,OAAO,CAAC,MAAM,IAAI,EAAE;YACpB,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,EAC/B,CAAC;YACD,OAAO;gBACL,IAAI,EAAE,IAAI;gBACV,OAAO,EAAE,OAAO,EAAE,uBAAuB;gBACzC,SAAS,EAAE,iBAAS,CAAC,MAAM;aAC5B,CAAC;QACJ,CAAC;QAED,mDAAmD;QACnD,IACE,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC;YACrC,OAAO,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YACzC,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,6BAA6B;YACpD,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,EAC5B,CAAC;YACD,OAAO;gBACL,IAAI,EAAE,OAAO,CAAC,WAAW,EAAE;gBAC3B,OAAO,EAAE,IAAI;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.21",
|
|
4
|
+
"description": "Comprehensive TypeScript types, interfaces, and utilities for the 0xmail.box Web3 email ecosystem - optimized for AI-assisted development",
|
|
5
|
+
"main": "./dist/index.cjs",
|
|
6
|
+
"module": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"require": "./dist/index.cjs",
|
|
12
|
+
"types": "./dist/index.d.ts"
|
|
13
|
+
},
|
|
14
|
+
"./api": {
|
|
15
|
+
"import": "./dist/types/api/indexer-responses.js",
|
|
16
|
+
"require": "./dist/types/api/indexer-responses.cjs",
|
|
17
|
+
"types": "./dist/types/api/indexer-responses.d.ts"
|
|
18
|
+
},
|
|
19
|
+
"./enums": {
|
|
20
|
+
"import": "./dist/types/business/enums.js",
|
|
21
|
+
"require": "./dist/types/business/enums.cjs",
|
|
22
|
+
"types": "./dist/types/business/enums.d.ts"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "npm run build:esm && npm run build:cjs",
|
|
27
|
+
"build:esm": "tsc -p tsconfig.esm.json",
|
|
28
|
+
"build:cjs": "tsc -p tsconfig.cjs.json && npm run build:cjs-rename",
|
|
29
|
+
"build:cjs-rename": "find dist -name '*.js' -not -name '*.cjs' -exec sh -c 'cp \"$1\" \"${1%.js}.cjs\"' _ {} \\;",
|
|
30
|
+
"clean": "rimraf dist",
|
|
31
|
+
"dev": "tsc --watch",
|
|
32
|
+
"test": "vitest",
|
|
33
|
+
"test:watch": "vitest --watch",
|
|
34
|
+
"test:coverage": "vitest --coverage",
|
|
35
|
+
"lint": "eslint src --ext .ts",
|
|
36
|
+
"lint:fix": "eslint src --ext .ts --fix",
|
|
37
|
+
"format": "prettier --write \"src/**/*.{ts,js,json,md}\"",
|
|
38
|
+
"format:check": "prettier --check \"src/**/*.{ts,js,json,md}\"",
|
|
39
|
+
"typecheck": "tsc --noEmit",
|
|
40
|
+
"verify": "npm run typecheck && npm run lint && npm run test && npm run build",
|
|
41
|
+
"ai:analyze": "node .ai/scripts/analyze-types.js",
|
|
42
|
+
"ai:validate-exports": "node .ai/scripts/validate-exports.js",
|
|
43
|
+
"ai:docs": "npm run ai:analyze && npm run ai:validate-exports",
|
|
44
|
+
"prepublishOnly": "npm run clean && npm run verify"
|
|
45
|
+
},
|
|
46
|
+
"files": [
|
|
47
|
+
"dist/**/*",
|
|
48
|
+
"README.md",
|
|
49
|
+
"CLAUDE.md"
|
|
50
|
+
],
|
|
51
|
+
"keywords": [
|
|
52
|
+
"typescript",
|
|
53
|
+
"types",
|
|
54
|
+
"interfaces",
|
|
55
|
+
"0xmail",
|
|
56
|
+
"web3",
|
|
57
|
+
"blockchain",
|
|
58
|
+
"email",
|
|
59
|
+
"ai-optimized",
|
|
60
|
+
"tree-shakeable",
|
|
61
|
+
"zero-dependencies"
|
|
62
|
+
],
|
|
63
|
+
"author": "0xmail.box",
|
|
64
|
+
"license": "MIT",
|
|
65
|
+
"devDependencies": {
|
|
66
|
+
"@eslint/js": "^9.36.0",
|
|
67
|
+
"@types/node": "^24.5.2",
|
|
68
|
+
"@typescript-eslint/eslint-plugin": "^8.44.0",
|
|
69
|
+
"@typescript-eslint/parser": "^8.44.0",
|
|
70
|
+
"eslint": "^9.36.0",
|
|
71
|
+
"globals": "^16.4.0",
|
|
72
|
+
"prettier": "^3.0.0",
|
|
73
|
+
"rimraf": "^6.0.1",
|
|
74
|
+
"typescript": "^5.0.0",
|
|
75
|
+
"vitest": "^3.2.4"
|
|
76
|
+
},
|
|
77
|
+
"publishConfig": {
|
|
78
|
+
"access": "restricted"
|
|
79
|
+
}
|
|
80
|
+
}
|