@sudobility/types 1.9.55 → 1.9.56
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/README.md +44 -280
- package/dist/index.js +28 -201
- package/dist/index.js.map +1 -1
- package/dist/types/blockchain/common.js +9 -16
- package/dist/types/blockchain/common.js.map +1 -1
- package/dist/types/blockchain/index.js +3 -17
- package/dist/types/blockchain/index.js.map +1 -1
- package/dist/types/blockchain/validation.js +6 -12
- package/dist/types/blockchain/validation.js.map +1 -1
- package/dist/types/business/enums.js +46 -49
- package/dist/types/business/enums.js.map +1 -1
- package/dist/types/business/wallet-status.js +10 -16
- package/dist/types/business/wallet-status.js.map +1 -1
- package/dist/types/common.js +1 -2
- package/dist/types/common.js.map +1 -1
- package/dist/types/config/app-config.js +1 -2
- package/dist/types/config/app-config.js.map +1 -1
- package/dist/types/config/environment.js +2 -5
- package/dist/types/config/environment.js.map +1 -1
- package/dist/types/consumables/index.js +1 -2
- package/dist/types/consumables/index.js.map +1 -1
- package/dist/types/entity/entity.js +6 -9
- package/dist/types/entity/entity.js.map +1 -1
- package/dist/types/entity/permissions.js +12 -17
- package/dist/types/entity/permissions.js.map +1 -1
- package/dist/types/entity/requests.js +1 -2
- package/dist/types/entity/requests.js.map +1 -1
- package/dist/types/entity/responses.js +1 -2
- package/dist/types/entity/responses.js.map +1 -1
- package/dist/types/infrastructure/analytics.js +3 -7
- package/dist/types/infrastructure/analytics.js.map +1 -1
- package/dist/types/infrastructure/api.js +5 -9
- package/dist/types/infrastructure/api.js.map +1 -1
- package/dist/types/infrastructure/firebase-user.js +1 -2
- package/dist/types/infrastructure/firebase-user.js.map +1 -1
- package/dist/types/infrastructure/navigation.js +1 -2
- package/dist/types/infrastructure/network.js +1 -4
- package/dist/types/infrastructure/network.js.map +1 -1
- package/dist/types/infrastructure/wallet.js +2 -5
- package/dist/types/infrastructure/wallet.js.map +1 -1
- package/dist/types/subscription/entitlements.js +1 -4
- package/dist/types/subscription/entitlements.js.map +1 -1
- package/dist/types/subscription/period.js +2 -5
- package/dist/types/subscription/period.js.map +1 -1
- package/dist/types/subscription/rate-limits.js +2 -5
- package/dist/types/subscription/rate-limits.js.map +1 -1
- package/dist/utils/async-helpers.js +7 -16
- package/dist/utils/async-helpers.js.map +1 -1
- package/dist/utils/auth/admin-emails.js +3 -8
- package/dist/utils/auth/admin-emails.js.map +1 -1
- package/dist/utils/auth/auth.js +14 -24
- package/dist/utils/auth/auth.js.map +1 -1
- package/dist/utils/blockchain/address.js +20 -31
- package/dist/utils/blockchain/address.js.map +1 -1
- package/dist/utils/blockchain/event-helpers.js +9 -20
- package/dist/utils/blockchain/event-helpers.js.map +1 -1
- package/dist/utils/constants/application.js +2 -20
- package/dist/utils/constants/application.js.map +1 -1
- package/dist/utils/constants/status-values.js +1 -4
- package/dist/utils/constants/status-values.js.map +1 -1
- package/dist/utils/formatting/currency.js +6 -11
- package/dist/utils/formatting/currency.js.map +1 -1
- package/dist/utils/formatting/date.js +7 -16
- package/dist/utils/formatting/date.js.map +1 -1
- package/dist/utils/formatting/string.js +16 -34
- package/dist/utils/formatting/string.js.map +1 -1
- package/dist/utils/logging/logger.js +2 -10
- package/dist/utils/logging/logger.js.map +1 -1
- package/dist/utils/url/url-params.js +1 -6
- package/dist/utils/url/url-params.js.map +1 -1
- package/dist/utils/validation/type-validation.js +27 -48
- package/dist/utils/validation/type-validation.js.map +1 -1
- package/dist/utils/validation/web3-username-validator.js +6 -10
- package/dist/utils/validation/web3-username-validator.js.map +1 -1
- package/package.json +3 -11
- package/dist/index.cjs +0 -243
- package/dist/types/blockchain/common.cjs +0 -127
- package/dist/types/blockchain/index.cjs +0 -30
- package/dist/types/blockchain/validation.cjs +0 -144
- package/dist/types/business/enums.cjs +0 -367
- package/dist/types/business/wallet-status.cjs +0 -38
- package/dist/types/common.cjs +0 -12
- package/dist/types/config/app-config.cjs +0 -6
- package/dist/types/config/environment.cjs +0 -24
- package/dist/types/consumables/index.cjs +0 -8
- package/dist/types/entity/entity.cjs +0 -51
- package/dist/types/entity/permissions.cjs +0 -93
- package/dist/types/entity/requests.cjs +0 -7
- package/dist/types/entity/responses.cjs +0 -7
- package/dist/types/infrastructure/analytics.cjs +0 -212
- package/dist/types/infrastructure/api.cjs +0 -43
- package/dist/types/infrastructure/firebase-user.cjs +0 -10
- package/dist/types/infrastructure/navigation.cjs +0 -3
- package/dist/types/infrastructure/network.cjs +0 -18
- package/dist/types/infrastructure/wallet.cjs +0 -37
- package/dist/types/subscription/entitlements.cjs +0 -14
- package/dist/types/subscription/period.cjs +0 -29
- package/dist/types/subscription/rate-limits.cjs +0 -20
- package/dist/utils/async-helpers.cjs +0 -244
- package/dist/utils/auth/admin-emails.cjs +0 -79
- package/dist/utils/auth/auth.cjs +0 -99
- package/dist/utils/blockchain/address.cjs +0 -225
- package/dist/utils/blockchain/event-helpers.cjs +0 -143
- package/dist/utils/constants/application.cjs +0 -152
- package/dist/utils/constants/status-values.cjs +0 -14
- package/dist/utils/formatting/currency.cjs +0 -39
- package/dist/utils/formatting/date.cjs +0 -197
- package/dist/utils/formatting/string.cjs +0 -326
- package/dist/utils/logging/logger.cjs +0 -92
- package/dist/utils/url/url-params.cjs +0 -128
- package/dist/utils/validation/type-validation.cjs +0 -250
- package/dist/utils/validation/web3-username-validator.cjs +0 -132
package/dist/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* @johnqh/types - Common TypeScript types for Web3 email projects
|
|
4
3
|
*
|
|
@@ -9,235 +8,63 @@
|
|
|
9
8
|
* @version 1.0.0
|
|
10
9
|
* @license MIT
|
|
11
10
|
*/
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.EntityRole = exports.EntityType = exports.NONE_ENTITLEMENT = exports.ALL_PERIODS = exports.PERIOD_RANKS = exports.RateLimitPeriodType = exports.WalletType = exports.NetworkError = exports.ProcessedEventName = exports.ContractType = exports.AnalyticsEventBuilder = exports.AnalyticsEvent = exports.StorageType = exports.validateMessage = exports.validateDomain = exports.validateAmount = exports.validateAddress = exports.isSolanaRecipient = exports.isSolanaAddress = exports.isEvmRecipient = exports.isEvmAddress = exports.TransactionStatus = exports.PROTOCOL_CONSTANTS = exports.MessageType = exports.isWalletVerified = exports.isWalletConnected = exports.getWalletConnectionState = exports.Theme = exports.SubscriptionAction = exports.SortOrder = exports.RequestStatus = exports.PlatformType = exports.NotificationType = exports.MobileView = exports.MediumView = exports.InfoType = exports.FontSize = exports.FeatureFlag = exports.ErrorType = exports.EmailValidationState = exports.EmailSortCriteria = exports.EmailComposeType = exports.EmailAddressType = exports.EmailAction = exports.Currency = exports.ConnectionType = exports.ConnectionState = exports.ChainType = exports.Chain = exports.AuthStatus = void 0;
|
|
14
|
-
exports.isAuthStatusConnected = exports.isAuthExpired = exports.getAuthStatusText = exports.generateNonce = exports.generateAuthMessage = exports.extractNonceFromMessage = exports.canAccessProtectedFeatures = exports.validateEventArgs = exports.normalizeAddress = exports.isZeroAddress = exports.isTestNet = exports.formatBigInt = exports.createUserMultiChainId = exports.createMultiChainId = exports.createDelegationId = exports.createChainStatsId = exports.parseEmailAddress = exports.isValidWalletAddress = exports.isValidSignature = exports.isSNSName = exports.isENSName = exports.getChainDisplayName = exports.getAddressType = exports.formatWalletAddress = exports.AddressType = exports.validateArray = exports.parseJson = exports.optional = exports.isValidDate = exports.isUrl = exports.isSuccessResponse = exports.isString = exports.isObject = exports.isNumber = exports.isNullish = exports.isErrorResponse = exports.isEmail = exports.isBoolean = exports.isArray = exports.isApiResponse = exports.hasRequiredProperties = exports.createValidator = exports.createAssertion = exports.Web3UsernameValidator = exports.hasPermission = exports.getPermissionsForRole = exports.MEMBER_PERMISSIONS = exports.MANAGER_PERMISSIONS = exports.OWNER_PERMISSIONS = exports.InvitationStatus = void 0;
|
|
15
|
-
exports.LogLevel = exports.STATUS_VALUES = exports.Z_INDEX = exports.ANIMATION = exports.NETWORK_IDS = exports.WALLET_NAMES = exports.CONTACT_INFO = exports.ROUTES = exports.SUCCESS_MESSAGES = exports.ERROR_MESSAGES = exports.TIME_FORMAT = exports.SUBSCRIPTION_TIERS = exports.EMAIL_CONFIG = exports.STORAGE_KEYS = exports.CHAIN_TYPE = exports.AUTH_STATUS = exports.API_RETRY_DELAY = exports.API_RETRY_ATTEMPTS = exports.API_TIMEOUT = exports.truncate = exports.toTitleCase = exports.toSnakeCase = exports.toKebabCase = exports.toCamelCase = exports.stripHtml = exports.randomString = exports.pluralize = exports.normalizeWhitespace = exports.isNotBlank = exports.isBlank = exports.getInitials = exports.formatNumber = exports.formatBytes = exports.escapeHtml = exports.capitalize = exports.parseDate = exports.isDateInRange = exports.formatTimestamp = exports.formatRelativeTime = exports.formatEmailDate = exports.addHours = exports.addDays = exports.parseUSDC = exports.formatUSDC = exports.USDC_DECIMALS = exports.CLAIM_PERIOD_DAYS = exports.createAdminChecker = exports.isAdminEmail = exports.parseAdminEmails = exports.isValidNonce = void 0;
|
|
16
|
-
exports.debounceAsync = exports.clearExpiredCache = exports.withCache = exports.withTimeout = exports.safeParallel = exports.withLoadingState = exports.safeAsync = exports.parseSearchParams = exports.searchParamsToString = exports.createSearchParams = exports.createURLSearchParams = exports.storageLogger = exports.ensLogger = exports.contractLogger = exports.apiLogger = exports.authLogger = exports.logger = void 0;
|
|
17
11
|
// ============================================================================
|
|
18
12
|
// TYPES - Business
|
|
19
13
|
// ============================================================================
|
|
20
14
|
// Enums
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
Object.defineProperty(exports, "EmailAddressType", { enumerable: true, get: function () { return enums_1.EmailAddressType; } });
|
|
30
|
-
Object.defineProperty(exports, "EmailComposeType", { enumerable: true, get: function () { return enums_1.EmailComposeType; } });
|
|
31
|
-
Object.defineProperty(exports, "EmailSortCriteria", { enumerable: true, get: function () { return enums_1.EmailSortCriteria; } });
|
|
32
|
-
Object.defineProperty(exports, "EmailValidationState", { enumerable: true, get: function () { return enums_1.EmailValidationState; } });
|
|
33
|
-
Object.defineProperty(exports, "ErrorType", { enumerable: true, get: function () { return enums_1.ErrorType; } });
|
|
34
|
-
Object.defineProperty(exports, "FeatureFlag", { enumerable: true, get: function () { return enums_1.FeatureFlag; } });
|
|
35
|
-
Object.defineProperty(exports, "FontSize", { enumerable: true, get: function () { return enums_1.FontSize; } });
|
|
36
|
-
Object.defineProperty(exports, "InfoType", { enumerable: true, get: function () { return enums_1.InfoType; } });
|
|
37
|
-
Object.defineProperty(exports, "MediumView", { enumerable: true, get: function () { return enums_1.MediumView; } });
|
|
38
|
-
Object.defineProperty(exports, "MobileView", { enumerable: true, get: function () { return enums_1.MobileView; } });
|
|
39
|
-
Object.defineProperty(exports, "NotificationType", { enumerable: true, get: function () { return enums_1.NotificationType; } });
|
|
40
|
-
Object.defineProperty(exports, "PlatformType", { enumerable: true, get: function () { return enums_1.PlatformType; } });
|
|
41
|
-
Object.defineProperty(exports, "RequestStatus", { enumerable: true, get: function () { return enums_1.RequestStatus; } });
|
|
42
|
-
Object.defineProperty(exports, "SortOrder", { enumerable: true, get: function () { return enums_1.SortOrder; } });
|
|
43
|
-
Object.defineProperty(exports, "SubscriptionAction", { enumerable: true, get: function () { return enums_1.SubscriptionAction; } });
|
|
44
|
-
Object.defineProperty(exports, "Theme", { enumerable: true, get: function () { return enums_1.Theme; } });
|
|
45
|
-
var wallet_status_1 = require("./types/business/wallet-status");
|
|
46
|
-
Object.defineProperty(exports, "getWalletConnectionState", { enumerable: true, get: function () { return wallet_status_1.getWalletConnectionState; } });
|
|
47
|
-
Object.defineProperty(exports, "isWalletConnected", { enumerable: true, get: function () { return wallet_status_1.isWalletConnected; } });
|
|
48
|
-
Object.defineProperty(exports, "isWalletVerified", { enumerable: true, get: function () { return wallet_status_1.isWalletVerified; } });
|
|
49
|
-
var common_1 = require("./types/blockchain/common");
|
|
50
|
-
Object.defineProperty(exports, "MessageType", { enumerable: true, get: function () { return common_1.MessageType; } });
|
|
51
|
-
Object.defineProperty(exports, "PROTOCOL_CONSTANTS", { enumerable: true, get: function () { return common_1.PROTOCOL_CONSTANTS; } });
|
|
52
|
-
Object.defineProperty(exports, "TransactionStatus", { enumerable: true, get: function () { return common_1.TransactionStatus; } });
|
|
53
|
-
Object.defineProperty(exports, "isEvmAddress", { enumerable: true, get: function () { return common_1.isEvmAddress; } });
|
|
54
|
-
Object.defineProperty(exports, "isEvmRecipient", { enumerable: true, get: function () { return common_1.isEvmRecipient; } });
|
|
55
|
-
Object.defineProperty(exports, "isSolanaAddress", { enumerable: true, get: function () { return common_1.isSolanaAddress; } });
|
|
56
|
-
Object.defineProperty(exports, "isSolanaRecipient", { enumerable: true, get: function () { return common_1.isSolanaRecipient; } });
|
|
57
|
-
var validation_1 = require("./types/blockchain/validation");
|
|
58
|
-
Object.defineProperty(exports, "validateAddress", { enumerable: true, get: function () { return validation_1.validateAddress; } });
|
|
59
|
-
Object.defineProperty(exports, "validateAmount", { enumerable: true, get: function () { return validation_1.validateAmount; } });
|
|
60
|
-
Object.defineProperty(exports, "validateDomain", { enumerable: true, get: function () { return validation_1.validateDomain; } });
|
|
61
|
-
Object.defineProperty(exports, "validateMessage", { enumerable: true, get: function () { return validation_1.validateMessage; } });
|
|
62
|
-
var environment_1 = require("./types/config/environment");
|
|
63
|
-
Object.defineProperty(exports, "StorageType", { enumerable: true, get: function () { return environment_1.StorageType; } });
|
|
64
|
-
var analytics_1 = require("./types/infrastructure/analytics");
|
|
65
|
-
Object.defineProperty(exports, "AnalyticsEvent", { enumerable: true, get: function () { return analytics_1.AnalyticsEvent; } });
|
|
66
|
-
Object.defineProperty(exports, "AnalyticsEventBuilder", { enumerable: true, get: function () { return analytics_1.AnalyticsEventBuilder; } });
|
|
67
|
-
var api_1 = require("./types/infrastructure/api");
|
|
68
|
-
Object.defineProperty(exports, "ContractType", { enumerable: true, get: function () { return api_1.ContractType; } });
|
|
69
|
-
Object.defineProperty(exports, "ProcessedEventName", { enumerable: true, get: function () { return api_1.ProcessedEventName; } });
|
|
70
|
-
var network_1 = require("./types/infrastructure/network");
|
|
71
|
-
Object.defineProperty(exports, "NetworkError", { enumerable: true, get: function () { return network_1.NetworkError; } });
|
|
15
|
+
export { AuthStatus, Chain, ChainType, ConnectionState, ConnectionType, Currency, EmailAction, EmailAddressType, EmailComposeType, EmailSortCriteria, EmailValidationState, ErrorType, FeatureFlag, FontSize, InfoType, MediumView, MobileView, NotificationType, PlatformType, RequestStatus, SortOrder, SubscriptionAction, Theme, } from './types/business/enums';
|
|
16
|
+
export { getWalletConnectionState, isWalletConnected, isWalletVerified, } from './types/business/wallet-status';
|
|
17
|
+
export { MessageType, PROTOCOL_CONSTANTS, TransactionStatus, isEvmAddress, isEvmRecipient, isSolanaAddress, isSolanaRecipient, } from './types/blockchain/common';
|
|
18
|
+
export { validateAddress, validateAmount, validateDomain, validateMessage, } from './types/blockchain/validation';
|
|
19
|
+
export { StorageType } from './types/config/environment';
|
|
20
|
+
export { AnalyticsEvent, AnalyticsEventBuilder, } from './types/infrastructure/analytics';
|
|
21
|
+
export { ContractType, ProcessedEventName, } from './types/infrastructure/api';
|
|
22
|
+
export { NetworkError } from './types/infrastructure/network';
|
|
72
23
|
// Wallet
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
Object.defineProperty(exports, "RateLimitPeriodType", { enumerable: true, get: function () { return rate_limits_1.RateLimitPeriodType; } });
|
|
77
|
-
var period_1 = require("./types/subscription/period");
|
|
78
|
-
Object.defineProperty(exports, "PERIOD_RANKS", { enumerable: true, get: function () { return period_1.PERIOD_RANKS; } });
|
|
79
|
-
Object.defineProperty(exports, "ALL_PERIODS", { enumerable: true, get: function () { return period_1.ALL_PERIODS; } });
|
|
24
|
+
export { WalletType } from './types/infrastructure/wallet';
|
|
25
|
+
export { RateLimitPeriodType } from './types/subscription/rate-limits';
|
|
26
|
+
export { PERIOD_RANKS, ALL_PERIODS } from './types/subscription/period';
|
|
80
27
|
// Entitlements
|
|
81
|
-
|
|
82
|
-
Object.defineProperty(exports, "NONE_ENTITLEMENT", { enumerable: true, get: function () { return entitlements_1.NONE_ENTITLEMENT; } });
|
|
28
|
+
export { NONE_ENTITLEMENT } from './types/subscription/entitlements';
|
|
83
29
|
// ============================================================================
|
|
84
30
|
// TYPES - Entity
|
|
85
31
|
// ============================================================================
|
|
86
32
|
// Core entity types
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
Object.defineProperty(exports, "MANAGER_PERMISSIONS", { enumerable: true, get: function () { return permissions_1.MANAGER_PERMISSIONS; } });
|
|
94
|
-
Object.defineProperty(exports, "MEMBER_PERMISSIONS", { enumerable: true, get: function () { return permissions_1.MEMBER_PERMISSIONS; } });
|
|
95
|
-
Object.defineProperty(exports, "getPermissionsForRole", { enumerable: true, get: function () { return permissions_1.getPermissionsForRole; } });
|
|
96
|
-
Object.defineProperty(exports, "hasPermission", { enumerable: true, get: function () { return permissions_1.hasPermission; } });
|
|
97
|
-
var web3_username_validator_1 = require("./utils/validation/web3-username-validator");
|
|
98
|
-
Object.defineProperty(exports, "Web3UsernameValidator", { enumerable: true, get: function () { return web3_username_validator_1.Web3UsernameValidator; } });
|
|
99
|
-
var type_validation_1 = require("./utils/validation/type-validation");
|
|
100
|
-
Object.defineProperty(exports, "createAssertion", { enumerable: true, get: function () { return type_validation_1.createAssertion; } });
|
|
101
|
-
Object.defineProperty(exports, "createValidator", { enumerable: true, get: function () { return type_validation_1.createValidator; } });
|
|
102
|
-
Object.defineProperty(exports, "hasRequiredProperties", { enumerable: true, get: function () { return type_validation_1.hasRequiredProperties; } });
|
|
103
|
-
Object.defineProperty(exports, "isApiResponse", { enumerable: true, get: function () { return type_validation_1.isApiResponse; } });
|
|
104
|
-
Object.defineProperty(exports, "isArray", { enumerable: true, get: function () { return type_validation_1.isArray; } });
|
|
105
|
-
Object.defineProperty(exports, "isBoolean", { enumerable: true, get: function () { return type_validation_1.isBoolean; } });
|
|
106
|
-
Object.defineProperty(exports, "isEmail", { enumerable: true, get: function () { return type_validation_1.isEmail; } });
|
|
107
|
-
Object.defineProperty(exports, "isErrorResponse", { enumerable: true, get: function () { return type_validation_1.isErrorResponse; } });
|
|
108
|
-
Object.defineProperty(exports, "isNullish", { enumerable: true, get: function () { return type_validation_1.isNullish; } });
|
|
109
|
-
Object.defineProperty(exports, "isNumber", { enumerable: true, get: function () { return type_validation_1.isNumber; } });
|
|
110
|
-
Object.defineProperty(exports, "isObject", { enumerable: true, get: function () { return type_validation_1.isObject; } });
|
|
111
|
-
Object.defineProperty(exports, "isString", { enumerable: true, get: function () { return type_validation_1.isString; } });
|
|
112
|
-
Object.defineProperty(exports, "isSuccessResponse", { enumerable: true, get: function () { return type_validation_1.isSuccessResponse; } });
|
|
113
|
-
Object.defineProperty(exports, "isUrl", { enumerable: true, get: function () { return type_validation_1.isUrl; } });
|
|
114
|
-
Object.defineProperty(exports, "isValidDate", { enumerable: true, get: function () { return type_validation_1.isValidDate; } });
|
|
115
|
-
Object.defineProperty(exports, "optional", { enumerable: true, get: function () { return type_validation_1.optional; } });
|
|
116
|
-
Object.defineProperty(exports, "parseJson", { enumerable: true, get: function () { return type_validation_1.parseJson; } });
|
|
117
|
-
Object.defineProperty(exports, "validateArray", { enumerable: true, get: function () { return type_validation_1.validateArray; } });
|
|
118
|
-
var address_1 = require("./utils/blockchain/address");
|
|
119
|
-
Object.defineProperty(exports, "AddressType", { enumerable: true, get: function () { return address_1.AddressType; } });
|
|
120
|
-
Object.defineProperty(exports, "formatWalletAddress", { enumerable: true, get: function () { return address_1.formatWalletAddress; } });
|
|
121
|
-
Object.defineProperty(exports, "getAddressType", { enumerable: true, get: function () { return address_1.getAddressType; } });
|
|
122
|
-
Object.defineProperty(exports, "getChainDisplayName", { enumerable: true, get: function () { return address_1.getChainDisplayName; } });
|
|
123
|
-
Object.defineProperty(exports, "isENSName", { enumerable: true, get: function () { return address_1.isENSName; } });
|
|
124
|
-
Object.defineProperty(exports, "isSNSName", { enumerable: true, get: function () { return address_1.isSNSName; } });
|
|
125
|
-
Object.defineProperty(exports, "isValidSignature", { enumerable: true, get: function () { return address_1.isValidSignature; } });
|
|
126
|
-
Object.defineProperty(exports, "isValidWalletAddress", { enumerable: true, get: function () { return address_1.isValidWalletAddress; } });
|
|
127
|
-
Object.defineProperty(exports, "parseEmailAddress", { enumerable: true, get: function () { return address_1.parseEmailAddress; } });
|
|
128
|
-
var event_helpers_1 = require("./utils/blockchain/event-helpers");
|
|
129
|
-
Object.defineProperty(exports, "createChainStatsId", { enumerable: true, get: function () { return event_helpers_1.createChainStatsId; } });
|
|
130
|
-
Object.defineProperty(exports, "createDelegationId", { enumerable: true, get: function () { return event_helpers_1.createDelegationId; } });
|
|
131
|
-
Object.defineProperty(exports, "createMultiChainId", { enumerable: true, get: function () { return event_helpers_1.createMultiChainId; } });
|
|
132
|
-
Object.defineProperty(exports, "createUserMultiChainId", { enumerable: true, get: function () { return event_helpers_1.createUserMultiChainId; } });
|
|
133
|
-
Object.defineProperty(exports, "formatBigInt", { enumerable: true, get: function () { return event_helpers_1.formatBigInt; } });
|
|
134
|
-
Object.defineProperty(exports, "isTestNet", { enumerable: true, get: function () { return event_helpers_1.isTestNet; } });
|
|
135
|
-
Object.defineProperty(exports, "isZeroAddress", { enumerable: true, get: function () { return event_helpers_1.isZeroAddress; } });
|
|
136
|
-
Object.defineProperty(exports, "normalizeAddress", { enumerable: true, get: function () { return event_helpers_1.normalizeAddress; } });
|
|
137
|
-
Object.defineProperty(exports, "validateEventArgs", { enumerable: true, get: function () { return event_helpers_1.validateEventArgs; } });
|
|
33
|
+
export { EntityType, EntityRole, InvitationStatus, } from './types/entity/entity';
|
|
34
|
+
export { OWNER_PERMISSIONS, MANAGER_PERMISSIONS, MEMBER_PERMISSIONS, getPermissionsForRole, hasPermission, } from './types/entity/permissions';
|
|
35
|
+
export { Web3UsernameValidator } from './utils/validation/web3-username-validator';
|
|
36
|
+
export { createAssertion, createValidator, hasRequiredProperties, isApiResponse, isArray, isBoolean, isEmail, isErrorResponse, isNullish, isNumber, isObject, isString, isSuccessResponse, isUrl, isValidDate, optional, parseJson, validateArray, } from './utils/validation/type-validation';
|
|
37
|
+
export { AddressType, formatWalletAddress, getAddressType, getChainDisplayName, isENSName, isSNSName, isValidSignature, isValidWalletAddress, parseEmailAddress, } from './utils/blockchain/address';
|
|
38
|
+
export { createChainStatsId, createDelegationId, createMultiChainId, createUserMultiChainId, formatBigInt, isTestNet, isZeroAddress, normalizeAddress, validateEventArgs, } from './utils/blockchain/event-helpers';
|
|
138
39
|
// ============================================================================
|
|
139
40
|
// UTILS - Auth
|
|
140
41
|
// ============================================================================
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
Object.defineProperty(exports, "extractNonceFromMessage", { enumerable: true, get: function () { return auth_1.extractNonceFromMessage; } });
|
|
144
|
-
Object.defineProperty(exports, "generateAuthMessage", { enumerable: true, get: function () { return auth_1.generateAuthMessage; } });
|
|
145
|
-
Object.defineProperty(exports, "generateNonce", { enumerable: true, get: function () { return auth_1.generateNonce; } });
|
|
146
|
-
Object.defineProperty(exports, "getAuthStatusText", { enumerable: true, get: function () { return auth_1.getAuthStatusText; } });
|
|
147
|
-
Object.defineProperty(exports, "isAuthExpired", { enumerable: true, get: function () { return auth_1.isAuthExpired; } });
|
|
148
|
-
Object.defineProperty(exports, "isAuthStatusConnected", { enumerable: true, get: function () { return auth_1.isAuthStatusConnected; } });
|
|
149
|
-
Object.defineProperty(exports, "isValidNonce", { enumerable: true, get: function () { return auth_1.isValidNonce; } });
|
|
150
|
-
var admin_emails_1 = require("./utils/auth/admin-emails");
|
|
151
|
-
Object.defineProperty(exports, "parseAdminEmails", { enumerable: true, get: function () { return admin_emails_1.parseAdminEmails; } });
|
|
152
|
-
Object.defineProperty(exports, "isAdminEmail", { enumerable: true, get: function () { return admin_emails_1.isAdminEmail; } });
|
|
153
|
-
Object.defineProperty(exports, "createAdminChecker", { enumerable: true, get: function () { return admin_emails_1.createAdminChecker; } });
|
|
42
|
+
export { canAccessProtectedFeatures, extractNonceFromMessage, generateAuthMessage, generateNonce, getAuthStatusText, isAuthExpired, isAuthStatusConnected, isValidNonce, } from './utils/auth/auth';
|
|
43
|
+
export { parseAdminEmails, isAdminEmail, createAdminChecker, } from './utils/auth/admin-emails';
|
|
154
44
|
// ============================================================================
|
|
155
45
|
// UTILS - Formatting
|
|
156
46
|
// ============================================================================
|
|
157
47
|
// Currency
|
|
158
|
-
|
|
159
|
-
Object.defineProperty(exports, "CLAIM_PERIOD_DAYS", { enumerable: true, get: function () { return currency_1.CLAIM_PERIOD_DAYS; } });
|
|
160
|
-
Object.defineProperty(exports, "USDC_DECIMALS", { enumerable: true, get: function () { return currency_1.USDC_DECIMALS; } });
|
|
161
|
-
Object.defineProperty(exports, "formatUSDC", { enumerable: true, get: function () { return currency_1.formatUSDC; } });
|
|
162
|
-
Object.defineProperty(exports, "parseUSDC", { enumerable: true, get: function () { return currency_1.parseUSDC; } });
|
|
48
|
+
export { CLAIM_PERIOD_DAYS, USDC_DECIMALS, formatUSDC, parseUSDC, } from './utils/formatting/currency';
|
|
163
49
|
// Date
|
|
164
|
-
|
|
165
|
-
Object.defineProperty(exports, "addDays", { enumerable: true, get: function () { return date_1.addDays; } });
|
|
166
|
-
Object.defineProperty(exports, "addHours", { enumerable: true, get: function () { return date_1.addHours; } });
|
|
167
|
-
Object.defineProperty(exports, "formatEmailDate", { enumerable: true, get: function () { return date_1.formatEmailDate; } });
|
|
168
|
-
Object.defineProperty(exports, "formatRelativeTime", { enumerable: true, get: function () { return date_1.formatRelativeTime; } });
|
|
169
|
-
Object.defineProperty(exports, "formatTimestamp", { enumerable: true, get: function () { return date_1.formatTimestamp; } });
|
|
170
|
-
Object.defineProperty(exports, "isDateInRange", { enumerable: true, get: function () { return date_1.isDateInRange; } });
|
|
171
|
-
Object.defineProperty(exports, "parseDate", { enumerable: true, get: function () { return date_1.parseDate; } });
|
|
50
|
+
export { addDays, addHours, formatEmailDate, formatRelativeTime, formatTimestamp, isDateInRange, parseDate, } from './utils/formatting/date';
|
|
172
51
|
// String
|
|
173
|
-
|
|
174
|
-
Object.defineProperty(exports, "capitalize", { enumerable: true, get: function () { return string_1.capitalize; } });
|
|
175
|
-
Object.defineProperty(exports, "escapeHtml", { enumerable: true, get: function () { return string_1.escapeHtml; } });
|
|
176
|
-
Object.defineProperty(exports, "formatBytes", { enumerable: true, get: function () { return string_1.formatBytes; } });
|
|
177
|
-
Object.defineProperty(exports, "formatNumber", { enumerable: true, get: function () { return string_1.formatNumber; } });
|
|
178
|
-
Object.defineProperty(exports, "getInitials", { enumerable: true, get: function () { return string_1.getInitials; } });
|
|
179
|
-
Object.defineProperty(exports, "isBlank", { enumerable: true, get: function () { return string_1.isBlank; } });
|
|
180
|
-
Object.defineProperty(exports, "isNotBlank", { enumerable: true, get: function () { return string_1.isNotBlank; } });
|
|
181
|
-
Object.defineProperty(exports, "normalizeWhitespace", { enumerable: true, get: function () { return string_1.normalizeWhitespace; } });
|
|
182
|
-
Object.defineProperty(exports, "pluralize", { enumerable: true, get: function () { return string_1.pluralize; } });
|
|
183
|
-
Object.defineProperty(exports, "randomString", { enumerable: true, get: function () { return string_1.randomString; } });
|
|
184
|
-
Object.defineProperty(exports, "stripHtml", { enumerable: true, get: function () { return string_1.stripHtml; } });
|
|
185
|
-
Object.defineProperty(exports, "toCamelCase", { enumerable: true, get: function () { return string_1.toCamelCase; } });
|
|
186
|
-
Object.defineProperty(exports, "toKebabCase", { enumerable: true, get: function () { return string_1.toKebabCase; } });
|
|
187
|
-
Object.defineProperty(exports, "toSnakeCase", { enumerable: true, get: function () { return string_1.toSnakeCase; } });
|
|
188
|
-
Object.defineProperty(exports, "toTitleCase", { enumerable: true, get: function () { return string_1.toTitleCase; } });
|
|
189
|
-
Object.defineProperty(exports, "truncate", { enumerable: true, get: function () { return string_1.truncate; } });
|
|
52
|
+
export { capitalize, escapeHtml, formatBytes, formatNumber, getInitials, isBlank, isNotBlank, normalizeWhitespace, pluralize, randomString, stripHtml, toCamelCase, toKebabCase, toSnakeCase, toTitleCase, truncate, } from './utils/formatting/string';
|
|
190
53
|
// ============================================================================
|
|
191
54
|
// UTILS - Constants
|
|
192
55
|
// ============================================================================
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
Object.defineProperty(exports, "API_RETRY_ATTEMPTS", { enumerable: true, get: function () { return application_1.API_RETRY_ATTEMPTS; } });
|
|
196
|
-
Object.defineProperty(exports, "API_RETRY_DELAY", { enumerable: true, get: function () { return application_1.API_RETRY_DELAY; } });
|
|
197
|
-
Object.defineProperty(exports, "AUTH_STATUS", { enumerable: true, get: function () { return application_1.AUTH_STATUS; } });
|
|
198
|
-
Object.defineProperty(exports, "CHAIN_TYPE", { enumerable: true, get: function () { return application_1.CHAIN_TYPE; } });
|
|
199
|
-
Object.defineProperty(exports, "STORAGE_KEYS", { enumerable: true, get: function () { return application_1.STORAGE_KEYS; } });
|
|
200
|
-
Object.defineProperty(exports, "EMAIL_CONFIG", { enumerable: true, get: function () { return application_1.EMAIL_CONFIG; } });
|
|
201
|
-
Object.defineProperty(exports, "SUBSCRIPTION_TIERS", { enumerable: true, get: function () { return application_1.SUBSCRIPTION_TIERS; } });
|
|
202
|
-
Object.defineProperty(exports, "TIME_FORMAT", { enumerable: true, get: function () { return application_1.TIME_FORMAT; } });
|
|
203
|
-
Object.defineProperty(exports, "ERROR_MESSAGES", { enumerable: true, get: function () { return application_1.ERROR_MESSAGES; } });
|
|
204
|
-
Object.defineProperty(exports, "SUCCESS_MESSAGES", { enumerable: true, get: function () { return application_1.SUCCESS_MESSAGES; } });
|
|
205
|
-
Object.defineProperty(exports, "ROUTES", { enumerable: true, get: function () { return application_1.ROUTES; } });
|
|
206
|
-
Object.defineProperty(exports, "CONTACT_INFO", { enumerable: true, get: function () { return application_1.CONTACT_INFO; } });
|
|
207
|
-
Object.defineProperty(exports, "WALLET_NAMES", { enumerable: true, get: function () { return application_1.WALLET_NAMES; } });
|
|
208
|
-
Object.defineProperty(exports, "NETWORK_IDS", { enumerable: true, get: function () { return application_1.NETWORK_IDS; } });
|
|
209
|
-
Object.defineProperty(exports, "ANIMATION", { enumerable: true, get: function () { return application_1.ANIMATION; } });
|
|
210
|
-
Object.defineProperty(exports, "Z_INDEX", { enumerable: true, get: function () { return application_1.Z_INDEX; } });
|
|
211
|
-
var status_values_1 = require("./utils/constants/status-values");
|
|
212
|
-
Object.defineProperty(exports, "STATUS_VALUES", { enumerable: true, get: function () { return status_values_1.STATUS_VALUES; } });
|
|
56
|
+
export { API_TIMEOUT, API_RETRY_ATTEMPTS, API_RETRY_DELAY, AUTH_STATUS, CHAIN_TYPE, STORAGE_KEYS, EMAIL_CONFIG, SUBSCRIPTION_TIERS, TIME_FORMAT, ERROR_MESSAGES, SUCCESS_MESSAGES, ROUTES, CONTACT_INFO, WALLET_NAMES, NETWORK_IDS, ANIMATION, Z_INDEX, } from './utils/constants/application';
|
|
57
|
+
export { STATUS_VALUES } from './utils/constants/status-values';
|
|
213
58
|
// ============================================================================
|
|
214
59
|
// UTILS - Logging
|
|
215
60
|
// ============================================================================
|
|
216
|
-
|
|
217
|
-
Object.defineProperty(exports, "LogLevel", { enumerable: true, get: function () { return logger_1.LogLevel; } });
|
|
218
|
-
Object.defineProperty(exports, "logger", { enumerable: true, get: function () { return logger_1.logger; } });
|
|
219
|
-
Object.defineProperty(exports, "authLogger", { enumerable: true, get: function () { return logger_1.authLogger; } });
|
|
220
|
-
Object.defineProperty(exports, "apiLogger", { enumerable: true, get: function () { return logger_1.apiLogger; } });
|
|
221
|
-
Object.defineProperty(exports, "contractLogger", { enumerable: true, get: function () { return logger_1.contractLogger; } });
|
|
222
|
-
Object.defineProperty(exports, "ensLogger", { enumerable: true, get: function () { return logger_1.ensLogger; } });
|
|
223
|
-
Object.defineProperty(exports, "storageLogger", { enumerable: true, get: function () { return logger_1.storageLogger; } });
|
|
61
|
+
export { LogLevel, logger, authLogger, apiLogger, contractLogger, ensLogger, storageLogger, } from './utils/logging/logger';
|
|
224
62
|
// ============================================================================
|
|
225
63
|
// UTILS - URL
|
|
226
64
|
// ============================================================================
|
|
227
|
-
|
|
228
|
-
Object.defineProperty(exports, "createURLSearchParams", { enumerable: true, get: function () { return url_params_1.createURLSearchParams; } });
|
|
229
|
-
Object.defineProperty(exports, "createSearchParams", { enumerable: true, get: function () { return url_params_1.createSearchParams; } });
|
|
230
|
-
Object.defineProperty(exports, "searchParamsToString", { enumerable: true, get: function () { return url_params_1.searchParamsToString; } });
|
|
231
|
-
Object.defineProperty(exports, "parseSearchParams", { enumerable: true, get: function () { return url_params_1.parseSearchParams; } });
|
|
65
|
+
export { createURLSearchParams, createSearchParams, searchParamsToString, parseSearchParams, } from './utils/url/url-params';
|
|
232
66
|
// ============================================================================
|
|
233
67
|
// UTILS - Async Helpers
|
|
234
68
|
// ============================================================================
|
|
235
|
-
|
|
236
|
-
Object.defineProperty(exports, "safeAsync", { enumerable: true, get: function () { return async_helpers_1.safeAsync; } });
|
|
237
|
-
Object.defineProperty(exports, "withLoadingState", { enumerable: true, get: function () { return async_helpers_1.withLoadingState; } });
|
|
238
|
-
Object.defineProperty(exports, "safeParallel", { enumerable: true, get: function () { return async_helpers_1.safeParallel; } });
|
|
239
|
-
Object.defineProperty(exports, "withTimeout", { enumerable: true, get: function () { return async_helpers_1.withTimeout; } });
|
|
240
|
-
Object.defineProperty(exports, "withCache", { enumerable: true, get: function () { return async_helpers_1.withCache; } });
|
|
241
|
-
Object.defineProperty(exports, "clearExpiredCache", { enumerable: true, get: function () { return async_helpers_1.clearExpiredCache; } });
|
|
242
|
-
Object.defineProperty(exports, "debounceAsync", { enumerable: true, get: function () { return async_helpers_1.debounceAsync; } });
|
|
69
|
+
export { safeAsync, withLoadingState, safeParallel, withTimeout, withCache, clearExpiredCache, debounceAsync, } from './utils/async-helpers';
|
|
243
70
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAoBH,+EAA+E;AAC/E,mBAAmB;AACnB,+EAA+E;AAE/E,QAAQ;AACR,OAAO,EACL,UAAU,EACV,KAAK,EACL,SAAS,EACT,eAAe,EACf,cAAc,EACd,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,SAAS,EACT,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,SAAS,EACT,kBAAkB,EAClB,KAAK,GACN,MAAM,wBAAwB,CAAC;AAIhC,OAAO,EACL,wBAAwB,EACxB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,gCAAgC,CAAC;AAsBxC,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,eAAe,EACf,iBAAiB,GAClB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACL,eAAe,EACf,cAAc,EACd,cAAc,EACd,eAAe,GAChB,MAAM,+BAA+B,CAAC;AAUvC,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAezD,OAAO,EACL,cAAc,EACd,qBAAqB,GACtB,MAAM,kCAAkC,CAAC;AAmB1C,OAAO,EACL,YAAY,EACZ,kBAAkB,GACnB,MAAM,4BAA4B,CAAC;AAQpC,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAY9D,SAAS;AACT,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAqB3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;A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gB,EAChB,YAAY,EACZ,WAAW,EACX,SAAS,EACT,iBAAiB,EACjB,aAAa,GAEd,MAAM,uBAAuB,CAAC"}
|
|
@@ -1,21 +1,14 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* @fileoverview Common type definitions for multi-chain MailBox system
|
|
4
3
|
* @description Shared types and interfaces for EVM and Solana implementations
|
|
5
4
|
* @author MailBox Team
|
|
6
5
|
* @version 1.4.2
|
|
7
6
|
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.PROTOCOL_CONSTANTS = exports.TransactionStatus = exports.MessageType = void 0;
|
|
10
|
-
exports.isSolanaAddress = isSolanaAddress;
|
|
11
|
-
exports.isEvmAddress = isEvmAddress;
|
|
12
|
-
exports.isSolanaRecipient = isSolanaRecipient;
|
|
13
|
-
exports.isEvmRecipient = isEvmRecipient;
|
|
14
7
|
/**
|
|
15
8
|
* Message type enumeration
|
|
16
9
|
* @enum MessageType
|
|
17
10
|
*/
|
|
18
|
-
var MessageType;
|
|
11
|
+
export var MessageType;
|
|
19
12
|
(function (MessageType) {
|
|
20
13
|
/** Standard message with 10% fee */
|
|
21
14
|
MessageType["STANDARD"] = "standard";
|
|
@@ -25,12 +18,12 @@ var MessageType;
|
|
|
25
18
|
MessageType["PREPARED_STANDARD"] = "prepared_standard";
|
|
26
19
|
/** Pre-prepared priority message */
|
|
27
20
|
MessageType["PREPARED_PRIORITY"] = "prepared_priority";
|
|
28
|
-
})(MessageType || (
|
|
21
|
+
})(MessageType || (MessageType = {}));
|
|
29
22
|
/**
|
|
30
23
|
* Transaction status enumeration
|
|
31
24
|
* @enum TransactionStatus
|
|
32
25
|
*/
|
|
33
|
-
var TransactionStatus;
|
|
26
|
+
export var TransactionStatus;
|
|
34
27
|
(function (TransactionStatus) {
|
|
35
28
|
/** Transaction successful */
|
|
36
29
|
TransactionStatus["SUCCESS"] = "success";
|
|
@@ -38,7 +31,7 @@ var TransactionStatus;
|
|
|
38
31
|
TransactionStatus["FAILED"] = "failed";
|
|
39
32
|
/** Transaction pending confirmation */
|
|
40
33
|
TransactionStatus["PENDING"] = "pending";
|
|
41
|
-
})(TransactionStatus || (
|
|
34
|
+
})(TransactionStatus || (TransactionStatus = {}));
|
|
42
35
|
// ============================================================================
|
|
43
36
|
// TYPE GUARDS
|
|
44
37
|
// ============================================================================
|
|
@@ -47,7 +40,7 @@ var TransactionStatus;
|
|
|
47
40
|
* @param value - Value to check
|
|
48
41
|
* @returns True if value is a valid Solana address
|
|
49
42
|
*/
|
|
50
|
-
function isSolanaAddress(address) {
|
|
43
|
+
export function isSolanaAddress(address) {
|
|
51
44
|
try {
|
|
52
45
|
// Solana addresses are base58 encoded and typically 32-44 characters
|
|
53
46
|
if (address.length < 32 || address.length > 44) {
|
|
@@ -80,7 +73,7 @@ function isSolanaAddress(address) {
|
|
|
80
73
|
* @param value - Value to check
|
|
81
74
|
* @returns True if value is EVM address string
|
|
82
75
|
*/
|
|
83
|
-
function isEvmAddress(address) {
|
|
76
|
+
export function isEvmAddress(address) {
|
|
84
77
|
return /^0x[a-fA-F0-9]{40}$/.test(address);
|
|
85
78
|
}
|
|
86
79
|
/**
|
|
@@ -88,7 +81,7 @@ function isEvmAddress(address) {
|
|
|
88
81
|
* @param recipient - Message recipient
|
|
89
82
|
* @returns True if recipient is Solana address
|
|
90
83
|
*/
|
|
91
|
-
function isSolanaRecipient(recipient) {
|
|
84
|
+
export function isSolanaRecipient(recipient) {
|
|
92
85
|
return isSolanaAddress(recipient);
|
|
93
86
|
}
|
|
94
87
|
/**
|
|
@@ -96,7 +89,7 @@ function isSolanaRecipient(recipient) {
|
|
|
96
89
|
* @param recipient - Message recipient
|
|
97
90
|
* @returns True if recipient is EVM address
|
|
98
91
|
*/
|
|
99
|
-
function isEvmRecipient(recipient) {
|
|
92
|
+
export function isEvmRecipient(recipient) {
|
|
100
93
|
return isEvmAddress(recipient);
|
|
101
94
|
}
|
|
102
95
|
// ============================================================================
|
|
@@ -105,7 +98,7 @@ function isEvmRecipient(recipient) {
|
|
|
105
98
|
/**
|
|
106
99
|
* Protocol constants used across implementations
|
|
107
100
|
*/
|
|
108
|
-
|
|
101
|
+
export const PROTOCOL_CONSTANTS = {
|
|
109
102
|
/** Base send fee: 0.1 USDC (100,000 with 6 decimals) */
|
|
110
103
|
SEND_FEE: 100000n,
|
|
111
104
|
/** Claim period: 60 days in seconds */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/types/blockchain/common.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/types/blockchain/common.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA0EH;;;GAGG;AACH,MAAM,CAAN,IAAY,WASX;AATD,WAAY,WAAW;IACrB,oCAAoC;IACpC,oCAAqB,CAAA;IACrB,2DAA2D;IAC3D,oCAAqB,CAAA;IACrB,oCAAoC;IACpC,sDAAuC,CAAA;IACvC,oCAAoC;IACpC,sDAAuC,CAAA;AACzC,CAAC,EATW,WAAW,KAAX,WAAW,QAStB;AAiHD;;;GAGG;AACH,MAAM,CAAN,IAAY,iBAOX;AAPD,WAAY,iBAAiB;IAC3B,6BAA6B;IAC7B,wCAAmB,CAAA;IACnB,yBAAyB;IACzB,sCAAiB,CAAA;IACjB,uCAAuC;IACvC,wCAAmB,CAAA;AACrB,CAAC,EAPW,iBAAiB,KAAjB,iBAAiB,QAO5B;AAqDD,+EAA+E;AAC/E,cAAc;AACd,+EAA+E;AAE/E;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,OAAe;IAC7C,IAAI,CAAC;QACH,qEAAqE;QACrE,IAAI,OAAO,CAAC,MAAM,GAAG,EAAE,IAAI,OAAO,CAAC,MAAM,GAAG,EAAE,EAAE,CAAC;YAC/C,OAAO,KAAK,CAAC;QACf,CAAC;QAED,8EAA8E;QAC9E,+CAA+C;QAC/C,MAAM,WAAW,G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IAAI,EAAE,IAAI;QACV,OAAO,EAAE,GAAG;KACb;CACO,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Blockchain types entry point.
|
|
4
3
|
*
|
|
@@ -8,23 +7,10 @@
|
|
|
8
7
|
*
|
|
9
8
|
* @since 1.9.54
|
|
10
9
|
*/
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.validateMessage = exports.validateDomain = exports.validateAmount = exports.validateAddress = exports.isSolanaRecipient = exports.isSolanaAddress = exports.isEvmRecipient = exports.isEvmAddress = exports.TransactionStatus = exports.PROTOCOL_CONSTANTS = exports.MessageType = void 0;
|
|
13
10
|
// Enums and constants
|
|
14
|
-
|
|
15
|
-
Object.defineProperty(exports, "MessageType", { enumerable: true, get: function () { return common_1.MessageType; } });
|
|
16
|
-
Object.defineProperty(exports, "PROTOCOL_CONSTANTS", { enumerable: true, get: function () { return common_1.PROTOCOL_CONSTANTS; } });
|
|
17
|
-
Object.defineProperty(exports, "TransactionStatus", { enumerable: true, get: function () { return common_1.TransactionStatus; } });
|
|
11
|
+
export { MessageType, PROTOCOL_CONSTANTS, TransactionStatus, } from './common';
|
|
18
12
|
// Type guards
|
|
19
|
-
|
|
20
|
-
Object.defineProperty(exports, "isEvmAddress", { enumerable: true, get: function () { return common_2.isEvmAddress; } });
|
|
21
|
-
Object.defineProperty(exports, "isEvmRecipient", { enumerable: true, get: function () { return common_2.isEvmRecipient; } });
|
|
22
|
-
Object.defineProperty(exports, "isSolanaAddress", { enumerable: true, get: function () { return common_2.isSolanaAddress; } });
|
|
23
|
-
Object.defineProperty(exports, "isSolanaRecipient", { enumerable: true, get: function () { return common_2.isSolanaRecipient; } });
|
|
13
|
+
export { isEvmAddress, isEvmRecipient, isSolanaAddress, isSolanaRecipient, } from './common';
|
|
24
14
|
// Validators
|
|
25
|
-
|
|
26
|
-
Object.defineProperty(exports, "validateAddress", { enumerable: true, get: function () { return validation_1.validateAddress; } });
|
|
27
|
-
Object.defineProperty(exports, "validateAmount", { enumerable: true, get: function () { return validation_1.validateAmount; } });
|
|
28
|
-
Object.defineProperty(exports, "validateDomain", { enumerable: true, get: function () { return validation_1.validateDomain; } });
|
|
29
|
-
Object.defineProperty(exports, "validateMessage", { enumerable: true, get: function () { return validation_1.validateMessage; } });
|
|
15
|
+
export { validateAddress, validateAmount, validateDomain, validateMessage, } from './validation';
|
|
30
16
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/blockchain/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/blockchain/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAmBH,sBAAsB;AACtB,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,UAAU,CAAC;AAElB,cAAc;AACd,OAAO,EACL,YAAY,EACZ,cAAc,EACd,eAAe,EACf,iBAAiB,GAClB,MAAM,UAAU,CAAC;AAElB,aAAa;AACb,OAAO,EACL,eAAe,EACf,cAAc,EACd,cAAc,EACd,eAAe,GAChB,MAAM,cAAc,CAAC"}
|
|
@@ -1,16 +1,10 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Validation utilities for multi-chain operations.
|
|
4
3
|
* All validators throw on invalid input.
|
|
5
4
|
*
|
|
6
5
|
* @since 1.0.0
|
|
7
6
|
*/
|
|
8
|
-
|
|
9
|
-
exports.validateDomain = validateDomain;
|
|
10
|
-
exports.validateMessage = validateMessage;
|
|
11
|
-
exports.validateAddress = validateAddress;
|
|
12
|
-
exports.validateAmount = validateAmount;
|
|
13
|
-
const address_1 = require("../../utils/blockchain/address");
|
|
7
|
+
import { isValidWalletAddress } from '../../utils/blockchain/address';
|
|
14
8
|
/**
|
|
15
9
|
* Validate a domain name format.
|
|
16
10
|
*
|
|
@@ -25,7 +19,7 @@ const address_1 = require("../../utils/blockchain/address");
|
|
|
25
19
|
* validateDomain(''); // throws "Domain cannot be empty"
|
|
26
20
|
* ```
|
|
27
21
|
*/
|
|
28
|
-
function validateDomain(domain) {
|
|
22
|
+
export function validateDomain(domain) {
|
|
29
23
|
if (!domain || domain.length === 0) {
|
|
30
24
|
throw new Error('Domain cannot be empty');
|
|
31
25
|
}
|
|
@@ -48,7 +42,7 @@ function validateDomain(domain) {
|
|
|
48
42
|
* @throws Error if subject or body is empty or exceeds limits
|
|
49
43
|
* @since 1.0.0
|
|
50
44
|
*/
|
|
51
|
-
function validateMessage(subject, body) {
|
|
45
|
+
export function validateMessage(subject, body) {
|
|
52
46
|
if (!subject || subject.length === 0) {
|
|
53
47
|
throw new Error('Message subject cannot be empty');
|
|
54
48
|
}
|
|
@@ -77,11 +71,11 @@ function validateMessage(subject, body) {
|
|
|
77
71
|
* validateAddress('0x742d35Cc6634C0532925a3b844e2', ChainType.EVM);
|
|
78
72
|
* ```
|
|
79
73
|
*/
|
|
80
|
-
function validateAddress(address, chainType) {
|
|
74
|
+
export function validateAddress(address, chainType) {
|
|
81
75
|
if (!address || address.length === 0) {
|
|
82
76
|
throw new Error('Address cannot be empty');
|
|
83
77
|
}
|
|
84
|
-
if (!
|
|
78
|
+
if (!isValidWalletAddress(address, chainType)) {
|
|
85
79
|
throw new Error(`Invalid ${chainType} address format`);
|
|
86
80
|
}
|
|
87
81
|
return true;
|
|
@@ -102,7 +96,7 @@ function validateAddress(address, chainType) {
|
|
|
102
96
|
* validateAmount(-1); // throws "Amount cannot be negative"
|
|
103
97
|
* ```
|
|
104
98
|
*/
|
|
105
|
-
function validateAmount(amount) {
|
|
99
|
+
export function validateAmount(amount) {
|
|
106
100
|
// Check for null, undefined, or empty string
|
|
107
101
|
if (amount === null ||
|
|
108
102
|
amount === undefined ||
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../../src/types/blockchain/validation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../../src/types/blockchain/validation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAEtE;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,cAAc,CAAC,MAAc;IAC3C,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACnC,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAC5C,CAAC;IACD,IAAI,MAAM,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACzD,CAAC;IACD,4CAA4C;IAC5C,MAAM,WAAW,GACf,+FAA+F,CAAC;IAClG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;IAC3C,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,eAAe,CAAC,OAAe,EAAE,IAAY;IAC3D,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACrC,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;IACrD,CAAC;IACD,IAAI,OAAO,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;IAClE,CAAC;IACD,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;IAClD,CAAC;IACD,IAAI,IAAI,CAAC,MAAM,GAAG,KAAK,EAAE,CAA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