@sudobility/components-rn 1.0.24 → 1.0.25

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/dist/index.esm.js CHANGED
@@ -936,2679 +936,439 @@ function requireJsxRuntime() {
936
936
  return jsxRuntime.exports;
937
937
  }
938
938
  var jsxRuntimeExports = requireJsxRuntime();
939
- var dist = {};
940
- var enums = {};
941
- var hasRequiredEnums;
942
- function requireEnums() {
943
- if (hasRequiredEnums) return enums;
944
- hasRequiredEnums = 1;
945
- Object.defineProperty(enums, "__esModule", { value: true });
946
- enums.Currency = enums.ErrorType = enums.FeatureFlag = enums.EmailValidationState = enums.PlatformType = enums.ConnectionState = enums.ConnectionType = enums.EmailSortCriteria = enums.SortOrder = enums.EmailAddressType = enums.InfoType = enums.NotificationType = enums.RequestStatus = enums.SubscriptionAction = enums.EmailAction = enums.MediumView = enums.MobileView = enums.EmailComposeType = enums.FontSize = enums.Theme = enums.Chain = enums.ChainType = enums.AuthStatus = void 0;
947
- var AuthStatus;
948
- (function(AuthStatus2) {
949
- AuthStatus2["CONNECTED"] = "connected";
950
- AuthStatus2["DISCONNECTED"] = "disconnected";
951
- AuthStatus2["VERIFIED"] = "verified";
952
- })(AuthStatus || (enums.AuthStatus = AuthStatus = {}));
953
- var ChainType;
954
- (function(ChainType2) {
955
- ChainType2["EVM"] = "evm";
956
- ChainType2["SOLANA"] = "solana";
957
- })(ChainType || (enums.ChainType = ChainType = {}));
958
- var Chain;
959
- (function(Chain2) {
960
- Chain2["ETH_MAINNET"] = "eth-mainnet";
961
- Chain2["ETH_SEPOLIA"] = "eth-sepolia";
962
- Chain2["ETH_GOERLI"] = "eth-goerli";
963
- Chain2["POLYGON_MAINNET"] = "polygon-mainnet";
964
- Chain2["POLYGON_MUMBAI"] = "polygon-mumbai";
965
- Chain2["POLYGON_AMOY"] = "polygon-amoy";
966
- Chain2["OPTIMISM_MAINNET"] = "optimism-mainnet";
967
- Chain2["OPTIMISM_SEPOLIA"] = "optimism-sepolia";
968
- Chain2["OPTIMISM_GOERLI"] = "optimism-goerli";
969
- Chain2["ARBITRUM_MAINNET"] = "arbitrum-mainnet";
970
- Chain2["ARBITRUM_SEPOLIA"] = "arbitrum-sepolia";
971
- Chain2["ARBITRUM_GOERLI"] = "arbitrum-goerli";
972
- Chain2["BASE_MAINNET"] = "base-mainnet";
973
- Chain2["BASE_SEPOLIA"] = "base-sepolia";
974
- Chain2["BASE_GOERLI"] = "base-goerli";
975
- Chain2["AVALANCHE_MAINNET"] = "avalanche-mainnet";
976
- Chain2["AVALANCHE_FUJI"] = "avalanche-fuji";
977
- Chain2["BNB_MAINNET"] = "bnb-mainnet";
978
- Chain2["BNB_TESTNET"] = "bnb-testnet";
979
- Chain2["GNOSIS_MAINNET"] = "gnosis-mainnet";
980
- Chain2["GNOSIS_CHIADO"] = "gnosis-chiado";
981
- Chain2["CELO_MAINNET"] = "celo-mainnet";
982
- Chain2["CELO_ALFAJORES"] = "celo-alfajores";
983
- Chain2["ZKSYNC_MAINNET"] = "zksync-mainnet";
984
- Chain2["ZKSYNC_SEPOLIA"] = "zksync-sepolia";
985
- Chain2["LINEA_MAINNET"] = "linea-mainnet";
986
- Chain2["LINEA_SEPOLIA"] = "linea-sepolia";
987
- Chain2["SCROLL_MAINNET"] = "scroll-mainnet";
988
- Chain2["SCROLL_SEPOLIA"] = "scroll-sepolia";
989
- Chain2["MONAD_MAINNET"] = "monad-mainnet";
990
- Chain2["MONAD_TESTNET"] = "monad-testnet";
991
- Chain2["STORY_MAINNET"] = "story-mainnet";
992
- Chain2["STORY_TESTNET"] = "story-testnet";
993
- Chain2["PLUME_MAINNET"] = "plume-mainnet";
994
- Chain2["PLUME_TESTNET"] = "plume-testnet";
995
- Chain2["NEXUS_MAINNET"] = "nexus-mainnet";
996
- Chain2["NEXUS_TESTNET"] = "nexus-testnet";
997
- Chain2["HYPEREVM_MAINNET"] = "hyperevm-mainnet";
998
- Chain2["HYPEREVM_TESTNET"] = "hyperevm-testnet";
999
- Chain2["SONIC_MAINNET"] = "sonic-mainnet";
1000
- Chain2["SONIC_TESTNET"] = "sonic-testnet";
1001
- Chain2["SONIC_BLAZE"] = "sonic-blaze";
1002
- Chain2["UNICHAIN_MAINNET"] = "unichain-mainnet";
1003
- Chain2["UNICHAIN_SEPOLIA"] = "unichain-sepolia";
1004
- Chain2["WORLD_MAINNET"] = "world-mainnet";
1005
- Chain2["XDC_MAINNET"] = "xdc-mainnet";
1006
- Chain2["INK_TESTNET"] = "ink-testnet";
1007
- Chain2["FETCH_MAINNET"] = "fetch-mainnet";
1008
- Chain2["FETCH_TESTNET"] = "fetch-testnet";
1009
- Chain2["GENSYN_MAINNET"] = "gensyn-mainnet";
1010
- Chain2["GENSYN_TESTNET"] = "gensyn-testnet";
1011
- Chain2["RITUAL_MAINNET"] = "ritual-mainnet";
1012
- Chain2["RITUAL_TESTNET"] = "ritual-testnet";
1013
- Chain2["SOLANA_MAINNET"] = "solana-mainnet";
1014
- Chain2["SOLANA_DEVNET"] = "solana-devnet";
1015
- Chain2["SOLANA_TESTNET"] = "solana-testnet";
1016
- Chain2["EVM_LOCAL"] = "evm-local";
1017
- Chain2["SOLANA_LOCAL"] = "solana-local";
1018
- })(Chain || (enums.Chain = Chain = {}));
1019
- var Theme;
1020
- (function(Theme2) {
1021
- Theme2["LIGHT"] = "light";
1022
- Theme2["DARK"] = "dark";
1023
- Theme2["SYSTEM"] = "system";
1024
- })(Theme || (enums.Theme = Theme = {}));
1025
- var FontSize;
1026
- (function(FontSize2) {
1027
- FontSize2["SMALL"] = "small";
1028
- FontSize2["MEDIUM"] = "medium";
1029
- FontSize2["LARGE"] = "large";
1030
- })(FontSize || (enums.FontSize = FontSize = {}));
1031
- var EmailComposeType;
1032
- (function(EmailComposeType2) {
1033
- EmailComposeType2["NEW"] = "new";
1034
- EmailComposeType2["REPLY"] = "reply";
1035
- EmailComposeType2["REPLY_ALL"] = "replyAll";
1036
- EmailComposeType2["FORWARD"] = "forward";
1037
- })(EmailComposeType || (enums.EmailComposeType = EmailComposeType = {}));
1038
- var MobileView;
1039
- (function(MobileView2) {
1040
- MobileView2["EMAIL_ADDRESSES"] = "emailAddresses";
1041
- MobileView2["FOLDERS"] = "folders";
1042
- MobileView2["EMAILS"] = "emails";
1043
- MobileView2["EMAIL_BODY"] = "emailBody";
1044
- })(MobileView || (enums.MobileView = MobileView = {}));
1045
- var MediumView;
1046
- (function(MediumView2) {
1047
- MediumView2["LEFT"] = "left";
1048
- MediumView2["RIGHT"] = "right";
1049
- })(MediumView || (enums.MediumView = MediumView = {}));
1050
- var EmailAction;
1051
- (function(EmailAction2) {
1052
- EmailAction2["OPEN"] = "open";
1053
- EmailAction2["REPLY"] = "reply";
1054
- EmailAction2["FORWARD"] = "forward";
1055
- EmailAction2["DELETE"] = "delete";
1056
- EmailAction2["STAR"] = "star";
1057
- EmailAction2["UNSTAR"] = "unstar";
1058
- EmailAction2["MARK_READ"] = "mark_read";
1059
- EmailAction2["MARK_UNREAD"] = "mark_unread";
1060
- })(EmailAction || (enums.EmailAction = EmailAction = {}));
1061
- var SubscriptionAction;
1062
- (function(SubscriptionAction2) {
1063
- SubscriptionAction2["VIEW"] = "view";
1064
- SubscriptionAction2["PURCHASE"] = "purchase";
1065
- SubscriptionAction2["CANCEL"] = "cancel";
1066
- SubscriptionAction2["RESTORE"] = "restore";
1067
- })(SubscriptionAction || (enums.SubscriptionAction = SubscriptionAction = {}));
1068
- var RequestStatus;
1069
- (function(RequestStatus2) {
1070
- RequestStatus2["IDLE"] = "idle";
1071
- RequestStatus2["LOADING"] = "loading";
1072
- RequestStatus2["SUCCESS"] = "success";
1073
- RequestStatus2["ERROR"] = "error";
1074
- })(RequestStatus || (enums.RequestStatus = RequestStatus = {}));
1075
- var NotificationType;
1076
- (function(NotificationType2) {
1077
- NotificationType2["INFO"] = "info";
1078
- NotificationType2["SUCCESS"] = "success";
1079
- NotificationType2["WARNING"] = "warning";
1080
- NotificationType2["ERROR"] = "error";
1081
- })(NotificationType || (enums.NotificationType = NotificationType = {}));
1082
- var InfoType;
1083
- (function(InfoType2) {
1084
- InfoType2["INFO"] = "info";
1085
- InfoType2["SUCCESS"] = "success";
1086
- InfoType2["WARNING"] = "warning";
1087
- InfoType2["ERROR"] = "error";
1088
- })(InfoType || (enums.InfoType = InfoType = {}));
1089
- var EmailAddressType;
1090
- (function(EmailAddressType2) {
1091
- EmailAddressType2["DIRECT"] = "direct";
1092
- EmailAddressType2["ENS"] = "ens";
1093
- EmailAddressType2["SNS"] = "sns";
1094
- EmailAddressType2["CUSTOM"] = "custom";
1095
- })(EmailAddressType || (enums.EmailAddressType = EmailAddressType = {}));
1096
- var SortOrder;
1097
- (function(SortOrder2) {
1098
- SortOrder2["ASC"] = "asc";
1099
- SortOrder2["DESC"] = "desc";
1100
- })(SortOrder || (enums.SortOrder = SortOrder = {}));
1101
- var EmailSortCriteria;
1102
- (function(EmailSortCriteria2) {
1103
- EmailSortCriteria2["DATE"] = "date";
1104
- EmailSortCriteria2["SUBJECT"] = "subject";
1105
- EmailSortCriteria2["FROM"] = "from";
1106
- EmailSortCriteria2["SIZE"] = "size";
1107
- })(EmailSortCriteria || (enums.EmailSortCriteria = EmailSortCriteria = {}));
1108
- var ConnectionType;
1109
- (function(ConnectionType2) {
1110
- ConnectionType2["UNKNOWN"] = "unknown";
1111
- ConnectionType2["NONE"] = "none";
1112
- ConnectionType2["WIFI"] = "wifi";
1113
- ConnectionType2["CELLULAR_2G"] = "2g";
1114
- ConnectionType2["CELLULAR_3G"] = "3g";
1115
- ConnectionType2["CELLULAR_4G"] = "4g";
1116
- ConnectionType2["CELLULAR_5G"] = "5g";
1117
- ConnectionType2["ETHERNET"] = "ethernet";
1118
- })(ConnectionType || (enums.ConnectionType = ConnectionType = {}));
1119
- var ConnectionState;
1120
- (function(ConnectionState2) {
1121
- ConnectionState2["UNKNOWN"] = "unknown";
1122
- ConnectionState2["DISCONNECTED"] = "disconnected";
1123
- ConnectionState2["CONNECTING"] = "connecting";
1124
- ConnectionState2["CONNECTED"] = "connected";
1125
- ConnectionState2["RECONNECTING"] = "reconnecting";
1126
- ConnectionState2["VERIFIED"] = "verified";
1127
- ConnectionState2["LIMITED"] = "limited";
1128
- ConnectionState2["ERROR"] = "error";
1129
- })(ConnectionState || (enums.ConnectionState = ConnectionState = {}));
1130
- var PlatformType;
1131
- (function(PlatformType2) {
1132
- PlatformType2["WEB"] = "web";
1133
- PlatformType2["REACT_NATIVE"] = "react_native";
1134
- PlatformType2["DESKTOP"] = "desktop";
1135
- })(PlatformType || (enums.PlatformType = PlatformType = {}));
1136
- var EmailValidationState;
1137
- (function(EmailValidationState2) {
1138
- EmailValidationState2["VALID"] = "valid";
1139
- EmailValidationState2["INVALID"] = "invalid";
1140
- EmailValidationState2["PENDING"] = "pending";
1141
- EmailValidationState2["UNKNOWN"] = "unknown";
1142
- })(EmailValidationState || (enums.EmailValidationState = EmailValidationState = {}));
1143
- var FeatureFlag;
1144
- (function(FeatureFlag2) {
1145
- FeatureFlag2["AI_SEARCH"] = "ai_search";
1146
- FeatureFlag2["SMART_COMPOSE"] = "smart_compose";
1147
- FeatureFlag2["ADVANCED_FILTERS"] = "advanced_filters";
1148
- FeatureFlag2["DARK_MODE"] = "dark_mode";
1149
- FeatureFlag2["NOTIFICATIONS"] = "notifications";
1150
- FeatureFlag2["ANALYTICS"] = "analytics";
1151
- })(FeatureFlag || (enums.FeatureFlag = FeatureFlag = {}));
1152
- var ErrorType;
1153
- (function(ErrorType2) {
1154
- ErrorType2["NETWORK"] = "network";
1155
- ErrorType2["AUTH"] = "auth";
1156
- ErrorType2["VALIDATION"] = "validation";
1157
- ErrorType2["PERMISSION"] = "permission";
1158
- ErrorType2["UNKNOWN"] = "unknown";
1159
- })(ErrorType || (enums.ErrorType = ErrorType = {}));
1160
- var Currency;
1161
- (function(Currency2) {
1162
- Currency2["USD"] = "USD";
1163
- Currency2["EUR"] = "EUR";
1164
- Currency2["GBP"] = "GBP";
1165
- Currency2["CAD"] = "CAD";
1166
- Currency2["AUD"] = "AUD";
1167
- })(Currency || (enums.Currency = Currency = {}));
1168
- return enums;
1169
- }
1170
- var walletStatus = {};
1171
- var hasRequiredWalletStatus;
1172
- function requireWalletStatus() {
1173
- if (hasRequiredWalletStatus) return walletStatus;
1174
- hasRequiredWalletStatus = 1;
1175
- (function(exports$1) {
1176
- Object.defineProperty(exports$1, "__esModule", { value: true });
1177
- exports$1.getWalletConnectionState = exports$1.isWalletVerified = exports$1.isWalletConnected = void 0;
1178
- const enums_1 = requireEnums();
1179
- const isWalletConnected = (status) => {
1180
- return status !== void 0 && status !== null && Boolean(status.walletAddress);
1181
- };
1182
- exports$1.isWalletConnected = isWalletConnected;
1183
- const isWalletVerified = (status) => {
1184
- return (0, exports$1.isWalletConnected)(status) && Boolean(status.message) && Boolean(status.signature);
1185
- };
1186
- exports$1.isWalletVerified = isWalletVerified;
1187
- const getWalletConnectionState = (status) => {
1188
- if (!(0, exports$1.isWalletConnected)(status)) {
1189
- return enums_1.ConnectionState.DISCONNECTED;
1190
- }
1191
- if ((0, exports$1.isWalletVerified)(status)) {
1192
- return enums_1.ConnectionState.VERIFIED;
1193
- }
1194
- return enums_1.ConnectionState.CONNECTED;
1195
- };
1196
- exports$1.getWalletConnectionState = getWalletConnectionState;
1197
- })(walletStatus);
1198
- return walletStatus;
1199
- }
1200
- var common = {};
1201
- var hasRequiredCommon;
1202
- function requireCommon() {
1203
- if (hasRequiredCommon) return common;
1204
- hasRequiredCommon = 1;
1205
- Object.defineProperty(common, "__esModule", { value: true });
1206
- common.PROTOCOL_CONSTANTS = common.TransactionStatus = common.MessageType = void 0;
1207
- common.isSolanaAddress = isSolanaAddress;
1208
- common.isEvmAddress = isEvmAddress;
1209
- common.isSolanaRecipient = isSolanaRecipient;
1210
- common.isEvmRecipient = isEvmRecipient;
1211
- var MessageType;
1212
- (function(MessageType2) {
1213
- MessageType2["STANDARD"] = "standard";
1214
- MessageType2["PRIORITY"] = "priority";
1215
- MessageType2["PREPARED_STANDARD"] = "prepared_standard";
1216
- MessageType2["PREPARED_PRIORITY"] = "prepared_priority";
1217
- })(MessageType || (common.MessageType = MessageType = {}));
1218
- var TransactionStatus;
1219
- (function(TransactionStatus2) {
1220
- TransactionStatus2["SUCCESS"] = "success";
1221
- TransactionStatus2["FAILED"] = "failed";
1222
- TransactionStatus2["PENDING"] = "pending";
1223
- })(TransactionStatus || (common.TransactionStatus = TransactionStatus = {}));
1224
- function isSolanaAddress(address2) {
1225
- try {
1226
- if (address2.length < 32 || address2.length > 44) {
1227
- return false;
1228
- }
1229
- const base58Regex = /^[1-9A-HJ-NP-Za-km-z]+$/;
1230
- if (!base58Regex.test(address2)) {
1231
- return false;
1232
- }
1233
- try {
1234
- const bs58 = require("bs58");
1235
- const decoded = bs58.decode(address2);
1236
- return decoded.length === 32;
1237
- } catch {
1238
- return true;
1239
- }
1240
- } catch {
1241
- return false;
1242
- }
1243
- }
1244
- function isEvmAddress(address2) {
1245
- return /^0x[a-fA-F0-9]{40}$/.test(address2);
939
+ var AuthStatus;
940
+ (function(AuthStatus2) {
941
+ AuthStatus2["CONNECTED"] = "connected";
942
+ AuthStatus2["DISCONNECTED"] = "disconnected";
943
+ AuthStatus2["VERIFIED"] = "verified";
944
+ })(AuthStatus || (AuthStatus = {}));
945
+ var ChainType;
946
+ (function(ChainType2) {
947
+ ChainType2["EVM"] = "evm";
948
+ ChainType2["SOLANA"] = "solana";
949
+ })(ChainType || (ChainType = {}));
950
+ var Chain;
951
+ (function(Chain2) {
952
+ Chain2["ETH_MAINNET"] = "eth-mainnet";
953
+ Chain2["ETH_SEPOLIA"] = "eth-sepolia";
954
+ Chain2["ETH_GOERLI"] = "eth-goerli";
955
+ Chain2["POLYGON_MAINNET"] = "polygon-mainnet";
956
+ Chain2["POLYGON_MUMBAI"] = "polygon-mumbai";
957
+ Chain2["POLYGON_AMOY"] = "polygon-amoy";
958
+ Chain2["OPTIMISM_MAINNET"] = "optimism-mainnet";
959
+ Chain2["OPTIMISM_SEPOLIA"] = "optimism-sepolia";
960
+ Chain2["OPTIMISM_GOERLI"] = "optimism-goerli";
961
+ Chain2["ARBITRUM_MAINNET"] = "arbitrum-mainnet";
962
+ Chain2["ARBITRUM_SEPOLIA"] = "arbitrum-sepolia";
963
+ Chain2["ARBITRUM_GOERLI"] = "arbitrum-goerli";
964
+ Chain2["BASE_MAINNET"] = "base-mainnet";
965
+ Chain2["BASE_SEPOLIA"] = "base-sepolia";
966
+ Chain2["BASE_GOERLI"] = "base-goerli";
967
+ Chain2["AVALANCHE_MAINNET"] = "avalanche-mainnet";
968
+ Chain2["AVALANCHE_FUJI"] = "avalanche-fuji";
969
+ Chain2["BNB_MAINNET"] = "bnb-mainnet";
970
+ Chain2["BNB_TESTNET"] = "bnb-testnet";
971
+ Chain2["GNOSIS_MAINNET"] = "gnosis-mainnet";
972
+ Chain2["GNOSIS_CHIADO"] = "gnosis-chiado";
973
+ Chain2["CELO_MAINNET"] = "celo-mainnet";
974
+ Chain2["CELO_ALFAJORES"] = "celo-alfajores";
975
+ Chain2["ZKSYNC_MAINNET"] = "zksync-mainnet";
976
+ Chain2["ZKSYNC_SEPOLIA"] = "zksync-sepolia";
977
+ Chain2["LINEA_MAINNET"] = "linea-mainnet";
978
+ Chain2["LINEA_SEPOLIA"] = "linea-sepolia";
979
+ Chain2["SCROLL_MAINNET"] = "scroll-mainnet";
980
+ Chain2["SCROLL_SEPOLIA"] = "scroll-sepolia";
981
+ Chain2["MONAD_MAINNET"] = "monad-mainnet";
982
+ Chain2["MONAD_TESTNET"] = "monad-testnet";
983
+ Chain2["STORY_MAINNET"] = "story-mainnet";
984
+ Chain2["STORY_TESTNET"] = "story-testnet";
985
+ Chain2["PLUME_MAINNET"] = "plume-mainnet";
986
+ Chain2["PLUME_TESTNET"] = "plume-testnet";
987
+ Chain2["NEXUS_MAINNET"] = "nexus-mainnet";
988
+ Chain2["NEXUS_TESTNET"] = "nexus-testnet";
989
+ Chain2["HYPEREVM_MAINNET"] = "hyperevm-mainnet";
990
+ Chain2["HYPEREVM_TESTNET"] = "hyperevm-testnet";
991
+ Chain2["SONIC_MAINNET"] = "sonic-mainnet";
992
+ Chain2["SONIC_TESTNET"] = "sonic-testnet";
993
+ Chain2["SONIC_BLAZE"] = "sonic-blaze";
994
+ Chain2["UNICHAIN_MAINNET"] = "unichain-mainnet";
995
+ Chain2["UNICHAIN_SEPOLIA"] = "unichain-sepolia";
996
+ Chain2["WORLD_MAINNET"] = "world-mainnet";
997
+ Chain2["XDC_MAINNET"] = "xdc-mainnet";
998
+ Chain2["INK_TESTNET"] = "ink-testnet";
999
+ Chain2["FETCH_MAINNET"] = "fetch-mainnet";
1000
+ Chain2["FETCH_TESTNET"] = "fetch-testnet";
1001
+ Chain2["GENSYN_MAINNET"] = "gensyn-mainnet";
1002
+ Chain2["GENSYN_TESTNET"] = "gensyn-testnet";
1003
+ Chain2["RITUAL_MAINNET"] = "ritual-mainnet";
1004
+ Chain2["RITUAL_TESTNET"] = "ritual-testnet";
1005
+ Chain2["SOLANA_MAINNET"] = "solana-mainnet";
1006
+ Chain2["SOLANA_DEVNET"] = "solana-devnet";
1007
+ Chain2["SOLANA_TESTNET"] = "solana-testnet";
1008
+ Chain2["EVM_LOCAL"] = "evm-local";
1009
+ Chain2["SOLANA_LOCAL"] = "solana-local";
1010
+ })(Chain || (Chain = {}));
1011
+ var Theme;
1012
+ (function(Theme2) {
1013
+ Theme2["LIGHT"] = "light";
1014
+ Theme2["DARK"] = "dark";
1015
+ Theme2["SYSTEM"] = "system";
1016
+ })(Theme || (Theme = {}));
1017
+ var FontSize;
1018
+ (function(FontSize2) {
1019
+ FontSize2["SMALL"] = "small";
1020
+ FontSize2["MEDIUM"] = "medium";
1021
+ FontSize2["LARGE"] = "large";
1022
+ })(FontSize || (FontSize = {}));
1023
+ var EmailComposeType;
1024
+ (function(EmailComposeType2) {
1025
+ EmailComposeType2["NEW"] = "new";
1026
+ EmailComposeType2["REPLY"] = "reply";
1027
+ EmailComposeType2["REPLY_ALL"] = "replyAll";
1028
+ EmailComposeType2["FORWARD"] = "forward";
1029
+ })(EmailComposeType || (EmailComposeType = {}));
1030
+ var MobileView;
1031
+ (function(MobileView2) {
1032
+ MobileView2["EMAIL_ADDRESSES"] = "emailAddresses";
1033
+ MobileView2["FOLDERS"] = "folders";
1034
+ MobileView2["EMAILS"] = "emails";
1035
+ MobileView2["EMAIL_BODY"] = "emailBody";
1036
+ })(MobileView || (MobileView = {}));
1037
+ var MediumView;
1038
+ (function(MediumView2) {
1039
+ MediumView2["LEFT"] = "left";
1040
+ MediumView2["RIGHT"] = "right";
1041
+ })(MediumView || (MediumView = {}));
1042
+ var EmailAction;
1043
+ (function(EmailAction2) {
1044
+ EmailAction2["OPEN"] = "open";
1045
+ EmailAction2["REPLY"] = "reply";
1046
+ EmailAction2["FORWARD"] = "forward";
1047
+ EmailAction2["DELETE"] = "delete";
1048
+ EmailAction2["STAR"] = "star";
1049
+ EmailAction2["UNSTAR"] = "unstar";
1050
+ EmailAction2["MARK_READ"] = "mark_read";
1051
+ EmailAction2["MARK_UNREAD"] = "mark_unread";
1052
+ })(EmailAction || (EmailAction = {}));
1053
+ var SubscriptionAction;
1054
+ (function(SubscriptionAction2) {
1055
+ SubscriptionAction2["VIEW"] = "view";
1056
+ SubscriptionAction2["PURCHASE"] = "purchase";
1057
+ SubscriptionAction2["CANCEL"] = "cancel";
1058
+ SubscriptionAction2["RESTORE"] = "restore";
1059
+ })(SubscriptionAction || (SubscriptionAction = {}));
1060
+ var RequestStatus;
1061
+ (function(RequestStatus2) {
1062
+ RequestStatus2["IDLE"] = "idle";
1063
+ RequestStatus2["LOADING"] = "loading";
1064
+ RequestStatus2["SUCCESS"] = "success";
1065
+ RequestStatus2["ERROR"] = "error";
1066
+ })(RequestStatus || (RequestStatus = {}));
1067
+ var NotificationType;
1068
+ (function(NotificationType2) {
1069
+ NotificationType2["INFO"] = "info";
1070
+ NotificationType2["SUCCESS"] = "success";
1071
+ NotificationType2["WARNING"] = "warning";
1072
+ NotificationType2["ERROR"] = "error";
1073
+ })(NotificationType || (NotificationType = {}));
1074
+ var InfoType;
1075
+ (function(InfoType2) {
1076
+ InfoType2["INFO"] = "info";
1077
+ InfoType2["SUCCESS"] = "success";
1078
+ InfoType2["WARNING"] = "warning";
1079
+ InfoType2["ERROR"] = "error";
1080
+ })(InfoType || (InfoType = {}));
1081
+ var EmailAddressType;
1082
+ (function(EmailAddressType2) {
1083
+ EmailAddressType2["DIRECT"] = "direct";
1084
+ EmailAddressType2["ENS"] = "ens";
1085
+ EmailAddressType2["SNS"] = "sns";
1086
+ EmailAddressType2["CUSTOM"] = "custom";
1087
+ })(EmailAddressType || (EmailAddressType = {}));
1088
+ var SortOrder;
1089
+ (function(SortOrder2) {
1090
+ SortOrder2["ASC"] = "asc";
1091
+ SortOrder2["DESC"] = "desc";
1092
+ })(SortOrder || (SortOrder = {}));
1093
+ var EmailSortCriteria;
1094
+ (function(EmailSortCriteria2) {
1095
+ EmailSortCriteria2["DATE"] = "date";
1096
+ EmailSortCriteria2["SUBJECT"] = "subject";
1097
+ EmailSortCriteria2["FROM"] = "from";
1098
+ EmailSortCriteria2["SIZE"] = "size";
1099
+ })(EmailSortCriteria || (EmailSortCriteria = {}));
1100
+ var ConnectionType;
1101
+ (function(ConnectionType2) {
1102
+ ConnectionType2["UNKNOWN"] = "unknown";
1103
+ ConnectionType2["NONE"] = "none";
1104
+ ConnectionType2["WIFI"] = "wifi";
1105
+ ConnectionType2["CELLULAR_2G"] = "2g";
1106
+ ConnectionType2["CELLULAR_3G"] = "3g";
1107
+ ConnectionType2["CELLULAR_4G"] = "4g";
1108
+ ConnectionType2["CELLULAR_5G"] = "5g";
1109
+ ConnectionType2["ETHERNET"] = "ethernet";
1110
+ })(ConnectionType || (ConnectionType = {}));
1111
+ var ConnectionState;
1112
+ (function(ConnectionState2) {
1113
+ ConnectionState2["UNKNOWN"] = "unknown";
1114
+ ConnectionState2["DISCONNECTED"] = "disconnected";
1115
+ ConnectionState2["CONNECTING"] = "connecting";
1116
+ ConnectionState2["CONNECTED"] = "connected";
1117
+ ConnectionState2["RECONNECTING"] = "reconnecting";
1118
+ ConnectionState2["VERIFIED"] = "verified";
1119
+ ConnectionState2["LIMITED"] = "limited";
1120
+ ConnectionState2["ERROR"] = "error";
1121
+ })(ConnectionState || (ConnectionState = {}));
1122
+ var PlatformType;
1123
+ (function(PlatformType2) {
1124
+ PlatformType2["WEB"] = "web";
1125
+ PlatformType2["REACT_NATIVE"] = "react_native";
1126
+ PlatformType2["DESKTOP"] = "desktop";
1127
+ })(PlatformType || (PlatformType = {}));
1128
+ var EmailValidationState;
1129
+ (function(EmailValidationState2) {
1130
+ EmailValidationState2["VALID"] = "valid";
1131
+ EmailValidationState2["INVALID"] = "invalid";
1132
+ EmailValidationState2["PENDING"] = "pending";
1133
+ EmailValidationState2["UNKNOWN"] = "unknown";
1134
+ })(EmailValidationState || (EmailValidationState = {}));
1135
+ var FeatureFlag;
1136
+ (function(FeatureFlag2) {
1137
+ FeatureFlag2["AI_SEARCH"] = "ai_search";
1138
+ FeatureFlag2["SMART_COMPOSE"] = "smart_compose";
1139
+ FeatureFlag2["ADVANCED_FILTERS"] = "advanced_filters";
1140
+ FeatureFlag2["DARK_MODE"] = "dark_mode";
1141
+ FeatureFlag2["NOTIFICATIONS"] = "notifications";
1142
+ FeatureFlag2["ANALYTICS"] = "analytics";
1143
+ })(FeatureFlag || (FeatureFlag = {}));
1144
+ var ErrorType;
1145
+ (function(ErrorType2) {
1146
+ ErrorType2["NETWORK"] = "network";
1147
+ ErrorType2["AUTH"] = "auth";
1148
+ ErrorType2["VALIDATION"] = "validation";
1149
+ ErrorType2["PERMISSION"] = "permission";
1150
+ ErrorType2["UNKNOWN"] = "unknown";
1151
+ })(ErrorType || (ErrorType = {}));
1152
+ var Currency;
1153
+ (function(Currency2) {
1154
+ Currency2["USD"] = "USD";
1155
+ Currency2["EUR"] = "EUR";
1156
+ Currency2["GBP"] = "GBP";
1157
+ Currency2["CAD"] = "CAD";
1158
+ Currency2["AUD"] = "AUD";
1159
+ })(Currency || (Currency = {}));
1160
+ var MessageType;
1161
+ (function(MessageType2) {
1162
+ MessageType2["STANDARD"] = "standard";
1163
+ MessageType2["PRIORITY"] = "priority";
1164
+ MessageType2["PREPARED_STANDARD"] = "prepared_standard";
1165
+ MessageType2["PREPARED_PRIORITY"] = "prepared_priority";
1166
+ })(MessageType || (MessageType = {}));
1167
+ var TransactionStatus;
1168
+ (function(TransactionStatus2) {
1169
+ TransactionStatus2["SUCCESS"] = "success";
1170
+ TransactionStatus2["FAILED"] = "failed";
1171
+ TransactionStatus2["PENDING"] = "pending";
1172
+ })(TransactionStatus || (TransactionStatus = {}));
1173
+ var AddressType;
1174
+ (function(AddressType2) {
1175
+ AddressType2["EVMAddress"] = "EVMAddress";
1176
+ AddressType2["SolanaAddress"] = "SolanaAddress";
1177
+ AddressType2["ENSName"] = "ENSName";
1178
+ AddressType2["SNSName"] = "SNSName";
1179
+ })(AddressType || (AddressType = {}));
1180
+ var StorageType;
1181
+ (function(StorageType2) {
1182
+ StorageType2["LOCAL_STORAGE"] = "localStorage";
1183
+ StorageType2["SESSION_STORAGE"] = "sessionStorage";
1184
+ StorageType2["ASYNC_STORAGE"] = "asyncStorage";
1185
+ StorageType2["MEMORY"] = "memory";
1186
+ })(StorageType || (StorageType = {}));
1187
+ var AnalyticsEvent;
1188
+ (function(AnalyticsEvent2) {
1189
+ AnalyticsEvent2["USER_LOGIN"] = "user_login";
1190
+ AnalyticsEvent2["USER_LOGOUT"] = "user_logout";
1191
+ AnalyticsEvent2["USER_SIGNUP"] = "user_signup";
1192
+ AnalyticsEvent2["EMAIL_SENT"] = "email_sent";
1193
+ AnalyticsEvent2["EMAIL_RECEIVED"] = "email_received";
1194
+ AnalyticsEvent2["EMAIL_OPENED"] = "email_opened";
1195
+ AnalyticsEvent2["EMAIL_REPLY"] = "email_reply";
1196
+ AnalyticsEvent2["EMAIL_FORWARD"] = "email_forward";
1197
+ AnalyticsEvent2["EMAIL_DELETE"] = "email_delete";
1198
+ AnalyticsEvent2["EMAIL_STAR"] = "email_star";
1199
+ AnalyticsEvent2["EMAIL_COMPOSE"] = "email_compose";
1200
+ AnalyticsEvent2["EMAIL_CLICKED"] = "email_clicked";
1201
+ AnalyticsEvent2["PAGE_VIEW"] = "page_view";
1202
+ AnalyticsEvent2["SCREEN_VIEW"] = "screen_view";
1203
+ AnalyticsEvent2["FOLDER_SWITCH"] = "folder_switch";
1204
+ AnalyticsEvent2["SUBSCRIPTION_VIEW"] = "subscription_view";
1205
+ AnalyticsEvent2["SUBSCRIPTION_PURCHASE"] = "subscription_purchase";
1206
+ AnalyticsEvent2["SUBSCRIPTION_CANCEL"] = "subscription_cancel";
1207
+ AnalyticsEvent2["SEARCH_PERFORMED"] = "search_performed";
1208
+ AnalyticsEvent2["SETTINGS_CHANGED"] = "settings_changed";
1209
+ AnalyticsEvent2["ERROR_OCCURRED"] = "error_occurred";
1210
+ AnalyticsEvent2["AB_TEST_VIEWED"] = "ab_test_viewed";
1211
+ AnalyticsEvent2["AB_TEST_CONVERTED"] = "ab_test_converted";
1212
+ AnalyticsEvent2["CUSTOM_EVENT"] = "custom_event";
1213
+ })(AnalyticsEvent || (AnalyticsEvent = {}));
1214
+ var ContractType;
1215
+ (function(ContractType2) {
1216
+ ContractType2["Mailer"] = "Mailer";
1217
+ ContractType2["MailService"] = "MailService";
1218
+ })(ContractType || (ContractType = {}));
1219
+ var ProcessedEventName;
1220
+ (function(ProcessedEventName2) {
1221
+ ProcessedEventName2["MailSent"] = "MailSent";
1222
+ ProcessedEventName2["PreparedMailSent"] = "PreparedMailSent";
1223
+ ProcessedEventName2["DelegationSet"] = "DelegationSet";
1224
+ ProcessedEventName2["DelegationCleared"] = "DelegationCleared";
1225
+ ProcessedEventName2["DomainRegistered"] = "DomainRegistered";
1226
+ ProcessedEventName2["DomainExtended"] = "DomainExtended";
1227
+ ProcessedEventName2["DomainReleased"] = "DomainReleased";
1228
+ ProcessedEventName2["FeeUpdated"] = "FeeUpdated";
1229
+ ProcessedEventName2["SharesRecorded"] = "SharesRecorded";
1230
+ ProcessedEventName2["RecipientClaimed"] = "RecipientClaimed";
1231
+ ProcessedEventName2["OwnerClaimed"] = "OwnerClaimed";
1232
+ ProcessedEventName2["ExpiredSharesClaimed"] = "ExpiredSharesClaimed";
1233
+ })(ProcessedEventName || (ProcessedEventName = {}));
1234
+ var WalletType;
1235
+ (function(WalletType2) {
1236
+ WalletType2["METAMASK"] = "metamask";
1237
+ WalletType2["PHANTOM"] = "phantom";
1238
+ WalletType2["COINBASE"] = "coinbase";
1239
+ WalletType2["WALLETCONNECT"] = "walletconnect";
1240
+ WalletType2["INJECTED"] = "injected";
1241
+ })(WalletType || (WalletType = {}));
1242
+ var RateLimitPeriodType;
1243
+ (function(RateLimitPeriodType2) {
1244
+ RateLimitPeriodType2["HOUR"] = "hour";
1245
+ RateLimitPeriodType2["DAY"] = "day";
1246
+ RateLimitPeriodType2["MONTH"] = "month";
1247
+ })(RateLimitPeriodType || (RateLimitPeriodType = {}));
1248
+ var EntityType;
1249
+ (function(EntityType2) {
1250
+ EntityType2["PERSONAL"] = "personal";
1251
+ EntityType2["ORGANIZATION"] = "organization";
1252
+ })(EntityType || (EntityType = {}));
1253
+ var EntityRole;
1254
+ (function(EntityRole2) {
1255
+ EntityRole2["OWNER"] = "owner";
1256
+ EntityRole2["MANAGER"] = "manager";
1257
+ EntityRole2["MEMBER"] = "member";
1258
+ })(EntityRole || (EntityRole = {}));
1259
+ var InvitationStatus;
1260
+ (function(InvitationStatus2) {
1261
+ InvitationStatus2["PENDING"] = "pending";
1262
+ InvitationStatus2["ACCEPTED"] = "accepted";
1263
+ InvitationStatus2["DECLINED"] = "declined";
1264
+ InvitationStatus2["EXPIRED"] = "expired";
1265
+ })(InvitationStatus || (InvitationStatus = {}));
1266
+ const OWNER_PERMISSIONS = {};
1267
+ const MANAGER_PERMISSIONS = {};
1268
+ const MEMBER_PERMISSIONS = {};
1269
+ ({
1270
+ [EntityRole.OWNER]: OWNER_PERMISSIONS,
1271
+ [EntityRole.MANAGER]: MANAGER_PERMISSIONS,
1272
+ [EntityRole.MEMBER]: MEMBER_PERMISSIONS
1273
+ });
1274
+ var LogLevel;
1275
+ (function(LogLevel2) {
1276
+ LogLevel2["ERROR"] = "error";
1277
+ LogLevel2["WARN"] = "warn";
1278
+ LogLevel2["INFO"] = "info";
1279
+ LogLevel2["DEBUG"] = "debug";
1280
+ })(LogLevel || (LogLevel = {}));
1281
+ class Logger {
1282
+ constructor() {
1283
+ this.isDevelopment = process.env.NODE_ENV === "development";
1246
1284
  }
1247
- function isSolanaRecipient(recipient) {
1248
- return isSolanaAddress(recipient);
1285
+ formatTimestamp() {
1286
+ return (/* @__PURE__ */ new Date()).toISOString();
1249
1287
  }
1250
- function isEvmRecipient(recipient) {
1251
- return isEvmAddress(recipient);
1288
+ formatMessage(_level, message, context) {
1289
+ const timestamp = this.formatTimestamp();
1290
+ const contextStr = context ? ` [${context}]` : "";
1291
+ return `[${timestamp}]${contextStr} ${message}`;
1252
1292
  }
1253
- common.PROTOCOL_CONSTANTS = {
1254
- /** Base send fee: 0.1 USDC (100,000 with 6 decimals) */
1255
- SEND_FEE: 100000n,
1256
- /** Claim period: 60 days in seconds */
1257
- CLAIM_PERIOD: 60 * 24 * 60 * 60,
1258
- /** Revenue share percentages */
1259
- REVENUE_SHARES: {
1260
- SENDER: 90,
1261
- OWNER: 10
1262
- },
1263
- /** USDC token decimals */
1264
- USDC_DECIMALS: 6,
1265
- /** Maximum message lengths */
1266
- MAX_LENGTHS: {
1267
- SUBJECT: 200,
1268
- BODY: 2e3,
1269
- MAIL_ID: 100
1270
- }
1271
- };
1272
- return common;
1273
- }
1274
- var validation = {};
1275
- var address = {};
1276
- var hasRequiredAddress;
1277
- function requireAddress() {
1278
- if (hasRequiredAddress) return address;
1279
- hasRequiredAddress = 1;
1280
- Object.defineProperty(address, "__esModule", { value: true });
1281
- address.AddressType = void 0;
1282
- address.isENSName = isENSName;
1283
- address.isSNSName = isSNSName;
1284
- address.getAddressType = getAddressType;
1285
- address.isValidWalletAddress = isValidWalletAddress;
1286
- address.isValidSignature = isValidSignature;
1287
- address.parseEmailAddress = parseEmailAddress;
1288
- address.formatWalletAddress = formatWalletAddress;
1289
- address.getChainDisplayName = getChainDisplayName;
1290
- const enums_1 = requireEnums();
1291
- const common_1 = requireCommon();
1292
- var AddressType;
1293
- (function(AddressType2) {
1294
- AddressType2["EVMAddress"] = "EVMAddress";
1295
- AddressType2["SolanaAddress"] = "SolanaAddress";
1296
- AddressType2["ENSName"] = "ENSName";
1297
- AddressType2["SNSName"] = "SNSName";
1298
- })(AddressType || (address.AddressType = AddressType = {}));
1299
- function isENSName(address2) {
1300
- const lowerAddress = address2.toLowerCase();
1301
- if (!lowerAddress.endsWith(".eth") && !lowerAddress.endsWith(".box")) {
1302
- return false;
1303
- }
1304
- const nameWithoutTLD = lowerAddress.endsWith(".eth") ? lowerAddress.slice(0, -4) : lowerAddress.slice(0, -4);
1305
- if (nameWithoutTLD.length === 0) {
1306
- return false;
1307
- }
1308
- const labels = nameWithoutTLD.split(".");
1309
- const validLabelRegex = /^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/;
1310
- for (const label of labels) {
1311
- if (label.length === 0 || !validLabelRegex.test(label)) {
1312
- return false;
1313
- }
1314
- if (label.includes("--")) {
1315
- return false;
1316
- }
1293
+ shouldLog(level) {
1294
+ if (!this.isDevelopment) {
1295
+ return level === LogLevel.ERROR || level === LogLevel.WARN;
1317
1296
  }
1318
1297
  return true;
1319
1298
  }
1320
- function isSNSName(address2) {
1321
- const lowerAddress = address2.toLowerCase();
1322
- const snsExtensions = [
1323
- ".sol",
1324
- ".abc",
1325
- ".bonk",
1326
- ".poor",
1327
- ".gm",
1328
- ".dao",
1329
- ".defi",
1330
- ".web3"
1331
- ];
1332
- const matchingExtension = snsExtensions.find((ext) => lowerAddress.endsWith(ext));
1333
- if (!matchingExtension) {
1334
- return false;
1335
- }
1336
- const nameWithoutTLD = lowerAddress.slice(0, -matchingExtension.length);
1337
- if (nameWithoutTLD.length === 0) {
1338
- return false;
1339
- }
1340
- const labels = nameWithoutTLD.split(".");
1341
- const validLabelRegex = /^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/;
1342
- for (const label of labels) {
1343
- if (label.length === 0 || !validLabelRegex.test(label)) {
1344
- return false;
1345
- }
1346
- if (label.includes("--")) {
1347
- return false;
1299
+ error(message, context, data) {
1300
+ if (this.shouldLog(LogLevel.ERROR)) {
1301
+ console.error(this.formatMessage(LogLevel.ERROR, message, context));
1302
+ if (data) {
1303
+ console.error(data);
1348
1304
  }
1349
1305
  }
1350
- return true;
1351
1306
  }
1352
- function getAddressType(address2, parentAddressType = void 0) {
1353
- if ((0, common_1.isEvmAddress)(address2)) {
1354
- return AddressType.EVMAddress;
1355
- }
1356
- if ((0, common_1.isSolanaAddress)(address2)) {
1357
- return AddressType.SolanaAddress;
1358
- }
1359
- if (parentAddressType && address2.includes(".")) {
1360
- if (parentAddressType === AddressType.EVMAddress) {
1361
- return AddressType.ENSName;
1362
- }
1363
- if (parentAddressType === AddressType.SolanaAddress) {
1364
- return AddressType.SNSName;
1307
+ warn(message, context, data) {
1308
+ if (this.shouldLog(LogLevel.WARN)) {
1309
+ console.warn(this.formatMessage(LogLevel.WARN, message, context));
1310
+ if (data) {
1311
+ console.warn(data);
1365
1312
  }
1366
1313
  }
1367
- return void 0;
1368
- }
1369
- function isValidWalletAddress(address2, chainType) {
1370
- if (!address2 || typeof address2 !== "string") {
1371
- return false;
1372
- }
1373
- const addressType = getAddressType(address2);
1374
- switch (chainType) {
1375
- case enums_1.ChainType.EVM:
1376
- return addressType === AddressType.EVMAddress || addressType === AddressType.ENSName;
1377
- case enums_1.ChainType.SOLANA:
1378
- return addressType === AddressType.SolanaAddress || addressType === AddressType.SNSName;
1379
- default:
1380
- return !!addressType;
1381
- }
1382
- }
1383
- function isValidSignature(signature, chainType) {
1384
- if (!signature || typeof signature !== "string") {
1385
- return false;
1386
- }
1387
- switch (chainType) {
1388
- case enums_1.ChainType.EVM:
1389
- return /^0x[a-fA-F0-9]{130}$/.test(signature);
1390
- case enums_1.ChainType.SOLANA:
1391
- return /^[1-9A-HJ-NP-Za-km-z]{87,88}$/.test(signature);
1392
- default:
1393
- return signature.length > 50;
1394
- }
1395
- }
1396
- function parseEmailAddress(email) {
1397
- if (!email || typeof email !== "string") {
1398
- return void 0;
1399
- }
1400
- const parts = email.split("@");
1401
- if (parts.length !== 2) {
1402
- return void 0;
1403
- }
1404
- const [address2, domain] = parts;
1405
- if (!address2 || !domain) {
1406
- return void 0;
1407
- }
1408
- const type = getAddressType(address2);
1409
- return {
1410
- address: address2,
1411
- domain,
1412
- type
1413
- };
1414
- }
1415
- function formatWalletAddress(address2) {
1416
- if (!address2 || address2.length < 10) {
1417
- return address2;
1418
- }
1419
- const addressType = getAddressType(address2);
1420
- if ((addressType === AddressType.ENSName || addressType === AddressType.SNSName) && address2.length <= 20) {
1421
- return address2;
1422
- }
1423
- return `${address2.slice(0, 6)}...${address2.slice(-4)}`;
1424
- }
1425
- function getChainDisplayName(chainType) {
1426
- if (!chainType) {
1427
- return "Unknown Chain";
1428
- }
1429
- switch (chainType) {
1430
- case enums_1.ChainType.EVM:
1431
- return "EVM Chain";
1432
- case enums_1.ChainType.SOLANA:
1433
- return "Solana";
1434
- default:
1435
- return "Blockchain";
1436
- }
1437
- }
1438
- return address;
1439
- }
1440
- var hasRequiredValidation;
1441
- function requireValidation() {
1442
- if (hasRequiredValidation) return validation;
1443
- hasRequiredValidation = 1;
1444
- Object.defineProperty(validation, "__esModule", { value: true });
1445
- validation.validateDomain = validateDomain;
1446
- validation.validateMessage = validateMessage;
1447
- validation.validateAddress = validateAddress;
1448
- validation.validateAmount = validateAmount;
1449
- const address_1 = requireAddress();
1450
- function validateDomain(domain) {
1451
- if (!domain || domain.length === 0) {
1452
- throw new Error("Domain cannot be empty");
1453
- }
1454
- if (domain.length > 100) {
1455
- throw new Error("Domain cannot exceed 100 characters");
1456
- }
1457
- const domainRegex = /^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
1458
- if (!domainRegex.test(domain)) {
1459
- throw new Error("Invalid domain format");
1460
- }
1461
- return true;
1462
- }
1463
- function validateMessage(subject, body) {
1464
- if (!subject || subject.length === 0) {
1465
- throw new Error("Message subject cannot be empty");
1466
- }
1467
- if (subject.length > 200) {
1468
- throw new Error("Message subject cannot exceed 200 characters");
1469
- }
1470
- if (!body || body.length === 0) {
1471
- throw new Error("Message body cannot be empty");
1472
- }
1473
- if (body.length > 1e4) {
1474
- throw new Error("Message body cannot exceed 10000 characters");
1475
- }
1476
- return true;
1477
1314
  }
1478
- function validateAddress(address2, chainType) {
1479
- if (!address2 || address2.length === 0) {
1480
- throw new Error("Address cannot be empty");
1481
- }
1482
- if (!(0, address_1.isValidWalletAddress)(address2, chainType)) {
1483
- throw new Error(`Invalid ${chainType} address format`);
1484
- }
1485
- return true;
1486
- }
1487
- function validateAmount(amount) {
1488
- if (amount === null || amount === void 0 || amount === "" || typeof amount === "string" && amount.trim() === "") {
1489
- throw new Error("Invalid amount format");
1490
- }
1491
- let amountBigInt;
1492
- try {
1493
- if (typeof amount === "string") {
1494
- if (!/^-?\d+$/.test(amount.trim())) {
1495
- throw new Error("Invalid amount format");
1496
- }
1497
- amountBigInt = BigInt(amount);
1498
- } else if (typeof amount === "number") {
1499
- if (!Number.isFinite(amount)) {
1500
- throw new Error("Invalid amount format");
1501
- }
1502
- amountBigInt = BigInt(Math.floor(amount));
1503
- } else if (typeof amount === "bigint") {
1504
- amountBigInt = amount;
1505
- } else {
1506
- throw new Error("Invalid amount format");
1315
+ info(message, context, data) {
1316
+ if (this.shouldLog(LogLevel.INFO)) {
1317
+ console.log(this.formatMessage(LogLevel.INFO, message, context));
1318
+ if (data) {
1319
+ console.log(data);
1507
1320
  }
1508
- } catch {
1509
- throw new Error("Invalid amount format");
1510
- }
1511
- if (amountBigInt < 0n) {
1512
- throw new Error("Amount cannot be negative");
1513
- }
1514
- return amountBigInt;
1515
- }
1516
- return validation;
1517
- }
1518
- var environment = {};
1519
- var hasRequiredEnvironment;
1520
- function requireEnvironment() {
1521
- if (hasRequiredEnvironment) return environment;
1522
- hasRequiredEnvironment = 1;
1523
- Object.defineProperty(environment, "__esModule", { value: true });
1524
- environment.StorageType = void 0;
1525
- var StorageType;
1526
- (function(StorageType2) {
1527
- StorageType2["LOCAL_STORAGE"] = "localStorage";
1528
- StorageType2["SESSION_STORAGE"] = "sessionStorage";
1529
- StorageType2["ASYNC_STORAGE"] = "asyncStorage";
1530
- StorageType2["MEMORY"] = "memory";
1531
- })(StorageType || (environment.StorageType = StorageType = {}));
1532
- return environment;
1533
- }
1534
- var analytics = {};
1535
- var hasRequiredAnalytics;
1536
- function requireAnalytics() {
1537
- if (hasRequiredAnalytics) return analytics;
1538
- hasRequiredAnalytics = 1;
1539
- Object.defineProperty(analytics, "__esModule", { value: true });
1540
- analytics.AnalyticsEventBuilder = analytics.AnalyticsEvent = void 0;
1541
- var AnalyticsEvent;
1542
- (function(AnalyticsEvent2) {
1543
- AnalyticsEvent2["USER_LOGIN"] = "user_login";
1544
- AnalyticsEvent2["USER_LOGOUT"] = "user_logout";
1545
- AnalyticsEvent2["USER_SIGNUP"] = "user_signup";
1546
- AnalyticsEvent2["EMAIL_SENT"] = "email_sent";
1547
- AnalyticsEvent2["EMAIL_RECEIVED"] = "email_received";
1548
- AnalyticsEvent2["EMAIL_OPENED"] = "email_opened";
1549
- AnalyticsEvent2["EMAIL_REPLY"] = "email_reply";
1550
- AnalyticsEvent2["EMAIL_FORWARD"] = "email_forward";
1551
- AnalyticsEvent2["EMAIL_DELETE"] = "email_delete";
1552
- AnalyticsEvent2["EMAIL_STAR"] = "email_star";
1553
- AnalyticsEvent2["EMAIL_COMPOSE"] = "email_compose";
1554
- AnalyticsEvent2["EMAIL_CLICKED"] = "email_clicked";
1555
- AnalyticsEvent2["PAGE_VIEW"] = "page_view";
1556
- AnalyticsEvent2["SCREEN_VIEW"] = "screen_view";
1557
- AnalyticsEvent2["FOLDER_SWITCH"] = "folder_switch";
1558
- AnalyticsEvent2["SUBSCRIPTION_VIEW"] = "subscription_view";
1559
- AnalyticsEvent2["SUBSCRIPTION_PURCHASE"] = "subscription_purchase";
1560
- AnalyticsEvent2["SUBSCRIPTION_CANCEL"] = "subscription_cancel";
1561
- AnalyticsEvent2["SEARCH_PERFORMED"] = "search_performed";
1562
- AnalyticsEvent2["SETTINGS_CHANGED"] = "settings_changed";
1563
- AnalyticsEvent2["ERROR_OCCURRED"] = "error_occurred";
1564
- AnalyticsEvent2["AB_TEST_VIEWED"] = "ab_test_viewed";
1565
- AnalyticsEvent2["AB_TEST_CONVERTED"] = "ab_test_converted";
1566
- AnalyticsEvent2["CUSTOM_EVENT"] = "custom_event";
1567
- })(AnalyticsEvent || (analytics.AnalyticsEvent = AnalyticsEvent = {}));
1568
- class AnalyticsEventBuilder {
1569
- /**
1570
- * Build properties for email action events.
1571
- *
1572
- * @param action Email action performed (read, sent, archived, etc.)
1573
- * @param emailId Unique identifier for the email
1574
- * @param folder Email folder context (inbox, sent, trash, etc.)
1575
- * @returns Standardized event properties object
1576
- *
1577
- * @ai-builder Email action properties
1578
- * @ai-standardization Consistent email event tracking
1579
- */
1580
- static emailAction(action, emailId, folder) {
1581
- return {
1582
- action,
1583
- email_id: emailId,
1584
- folder,
1585
- timestamp: Date.now()
1586
- };
1587
- }
1588
- /**
1589
- * Build properties for page/screen view events.
1590
- *
1591
- * @param pageName Human-readable page name
1592
- * @param pagePath URL path or screen identifier
1593
- * @returns Standardized page view properties
1594
- *
1595
- * @ai-builder Navigation tracking properties
1596
- * @ai-cross-platform Works for web pages and mobile screens
1597
- */
1598
- static pageView(pageName, pagePath) {
1599
- return {
1600
- page_name: pageName,
1601
- page_path: pagePath,
1602
- timestamp: Date.now()
1603
- };
1604
- }
1605
- /**
1606
- * Build properties for error tracking events.
1607
- *
1608
- * @param errorType Category of error (network, validation, runtime, etc.)
1609
- * @param errorMessage Error message or description
1610
- * @param pageName Page/screen where error occurred
1611
- * @returns Standardized error event properties
1612
- *
1613
- * @ai-builder Error tracking properties
1614
- * @ai-debugging Consistent error event structure
1615
- */
1616
- static error(errorType, errorMessage, pageName) {
1617
- return {
1618
- error_type: errorType,
1619
- error_message: errorMessage,
1620
- page_name: pageName,
1621
- timestamp: Date.now()
1622
- };
1623
- }
1624
- /**
1625
- * Build properties for subscription/revenue events.
1626
- *
1627
- * @param action Subscription action (subscribe, upgrade, cancel, etc.)
1628
- * @param planType Subscription plan type (free, premium, pro, etc.)
1629
- * @param amount Monetary amount (for revenue tracking)
1630
- * @param currency Currency code (USD, EUR, etc.)
1631
- * @returns Standardized subscription event properties
1632
- *
1633
- * @ai-builder Revenue tracking properties
1634
- * @ai-business-metrics Subscription and revenue analytics
1635
- */
1636
- static subscription(action, planType, amount, currency2) {
1637
- return {
1638
- action,
1639
- plan_type: planType,
1640
- amount,
1641
- currency: currency2,
1642
- timestamp: Date.now()
1643
- };
1644
- }
1645
- /**
1646
- * Build properties for user engagement events.
1647
- *
1648
- * @param feature Feature name or component identifier
1649
- * @param interaction Type of interaction (click, scroll, hover, etc.)
1650
- * @param duration Time spent on interaction (milliseconds)
1651
- * @returns Standardized engagement event properties
1652
- *
1653
- * @ai-builder User engagement properties
1654
- * @ai-ux-analytics User experience and interaction tracking
1655
- */
1656
- static engagement(feature, interaction, duration) {
1657
- return {
1658
- feature,
1659
- interaction,
1660
- duration,
1661
- timestamp: Date.now()
1662
- };
1663
- }
1664
- /**
1665
- * Build properties for performance monitoring events.
1666
- *
1667
- * @param metric Performance metric name (load_time, api_response, etc.)
1668
- * @param value Metric value (usually in milliseconds)
1669
- * @param context Additional context about the performance event
1670
- * @returns Standardized performance event properties
1671
- *
1672
- * @ai-builder Performance monitoring properties
1673
- * @ai-performance Application performance tracking
1674
- */
1675
- static performance(metric, value, context) {
1676
- return {
1677
- metric,
1678
- value,
1679
- context,
1680
- timestamp: Date.now()
1681
- };
1682
- }
1683
- }
1684
- analytics.AnalyticsEventBuilder = AnalyticsEventBuilder;
1685
- return analytics;
1686
- }
1687
- var api = {};
1688
- var hasRequiredApi;
1689
- function requireApi() {
1690
- if (hasRequiredApi) return api;
1691
- hasRequiredApi = 1;
1692
- (function(exports$1) {
1693
- Object.defineProperty(exports$1, "__esModule", { value: true });
1694
- exports$1.ProcessedEventName = exports$1.ContractType = exports$1.ChainType = void 0;
1695
- var enums_1 = requireEnums();
1696
- Object.defineProperty(exports$1, "ChainType", { enumerable: true, get: function() {
1697
- return enums_1.ChainType;
1698
- } });
1699
- var ContractType;
1700
- (function(ContractType2) {
1701
- ContractType2["Mailer"] = "Mailer";
1702
- ContractType2["MailService"] = "MailService";
1703
- })(ContractType || (exports$1.ContractType = ContractType = {}));
1704
- var ProcessedEventName;
1705
- (function(ProcessedEventName2) {
1706
- ProcessedEventName2["MailSent"] = "MailSent";
1707
- ProcessedEventName2["PreparedMailSent"] = "PreparedMailSent";
1708
- ProcessedEventName2["DelegationSet"] = "DelegationSet";
1709
- ProcessedEventName2["DelegationCleared"] = "DelegationCleared";
1710
- ProcessedEventName2["DomainRegistered"] = "DomainRegistered";
1711
- ProcessedEventName2["DomainExtended"] = "DomainExtended";
1712
- ProcessedEventName2["DomainReleased"] = "DomainReleased";
1713
- ProcessedEventName2["FeeUpdated"] = "FeeUpdated";
1714
- ProcessedEventName2["SharesRecorded"] = "SharesRecorded";
1715
- ProcessedEventName2["RecipientClaimed"] = "RecipientClaimed";
1716
- ProcessedEventName2["OwnerClaimed"] = "OwnerClaimed";
1717
- ProcessedEventName2["ExpiredSharesClaimed"] = "ExpiredSharesClaimed";
1718
- })(ProcessedEventName || (exports$1.ProcessedEventName = ProcessedEventName = {}));
1719
- })(api);
1720
- return api;
1721
- }
1722
- var network = {};
1723
- var hasRequiredNetwork;
1724
- function requireNetwork() {
1725
- if (hasRequiredNetwork) return network;
1726
- hasRequiredNetwork = 1;
1727
- Object.defineProperty(network, "__esModule", { value: true });
1728
- network.NetworkError = void 0;
1729
- class NetworkError extends Error {
1730
- constructor(message, status, statusText, response) {
1731
- super(message);
1732
- this.name = "NetworkError";
1733
- this.status = status;
1734
- this.statusText = statusText;
1735
- this.response = response;
1736
1321
  }
1737
1322
  }
1738
- network.NetworkError = NetworkError;
1739
- return network;
1740
- }
1741
- var wallet = {};
1742
- var hasRequiredWallet;
1743
- function requireWallet() {
1744
- if (hasRequiredWallet) return wallet;
1745
- hasRequiredWallet = 1;
1746
- Object.defineProperty(wallet, "__esModule", { value: true });
1747
- wallet.WalletType = void 0;
1748
- var WalletType;
1749
- (function(WalletType2) {
1750
- WalletType2["METAMASK"] = "metamask";
1751
- WalletType2["PHANTOM"] = "phantom";
1752
- WalletType2["COINBASE"] = "coinbase";
1753
- WalletType2["WALLETCONNECT"] = "walletconnect";
1754
- WalletType2["INJECTED"] = "injected";
1755
- })(WalletType || (wallet.WalletType = WalletType = {}));
1756
- return wallet;
1757
- }
1758
- var rateLimits = {};
1759
- var hasRequiredRateLimits;
1760
- function requireRateLimits() {
1761
- if (hasRequiredRateLimits) return rateLimits;
1762
- hasRequiredRateLimits = 1;
1763
- Object.defineProperty(rateLimits, "__esModule", { value: true });
1764
- rateLimits.RateLimitPeriodType = void 0;
1765
- var RateLimitPeriodType;
1766
- (function(RateLimitPeriodType2) {
1767
- RateLimitPeriodType2["HOUR"] = "hour";
1768
- RateLimitPeriodType2["DAY"] = "day";
1769
- RateLimitPeriodType2["MONTH"] = "month";
1770
- })(RateLimitPeriodType || (rateLimits.RateLimitPeriodType = RateLimitPeriodType = {}));
1771
- return rateLimits;
1772
- }
1773
- var period = {};
1774
- var hasRequiredPeriod;
1775
- function requirePeriod() {
1776
- if (hasRequiredPeriod) return period;
1777
- hasRequiredPeriod = 1;
1778
- Object.defineProperty(period, "__esModule", { value: true });
1779
- period.ALL_PERIODS = period.PERIOD_RANKS = void 0;
1780
- period.PERIOD_RANKS = {
1781
- weekly: 1,
1782
- monthly: 2,
1783
- quarterly: 3,
1784
- yearly: 4,
1785
- lifetime: 5
1786
- };
1787
- period.ALL_PERIODS = [
1788
- "weekly",
1789
- "monthly",
1790
- "quarterly",
1791
- "yearly",
1792
- "lifetime"
1793
- ];
1794
- return period;
1795
- }
1796
- var entitlements = {};
1797
- var hasRequiredEntitlements;
1798
- function requireEntitlements() {
1799
- if (hasRequiredEntitlements) return entitlements;
1800
- hasRequiredEntitlements = 1;
1801
- Object.defineProperty(entitlements, "__esModule", { value: true });
1802
- entitlements.NONE_ENTITLEMENT = void 0;
1803
- entitlements.NONE_ENTITLEMENT = "none";
1804
- return entitlements;
1805
- }
1806
- var entity = {};
1807
- var hasRequiredEntity;
1808
- function requireEntity() {
1809
- if (hasRequiredEntity) return entity;
1810
- hasRequiredEntity = 1;
1811
- Object.defineProperty(entity, "__esModule", { value: true });
1812
- entity.InvitationStatus = entity.EntityRole = entity.EntityType = void 0;
1813
- var EntityType;
1814
- (function(EntityType2) {
1815
- EntityType2["PERSONAL"] = "personal";
1816
- EntityType2["ORGANIZATION"] = "organization";
1817
- })(EntityType || (entity.EntityType = EntityType = {}));
1818
- var EntityRole;
1819
- (function(EntityRole2) {
1820
- EntityRole2["OWNER"] = "owner";
1821
- EntityRole2["MANAGER"] = "manager";
1822
- EntityRole2["MEMBER"] = "member";
1823
- })(EntityRole || (entity.EntityRole = EntityRole = {}));
1824
- var InvitationStatus;
1825
- (function(InvitationStatus2) {
1826
- InvitationStatus2["PENDING"] = "pending";
1827
- InvitationStatus2["ACCEPTED"] = "accepted";
1828
- InvitationStatus2["DECLINED"] = "declined";
1829
- InvitationStatus2["EXPIRED"] = "expired";
1830
- })(InvitationStatus || (entity.InvitationStatus = InvitationStatus = {}));
1831
- return entity;
1832
- }
1833
- var permissions = {};
1834
- var hasRequiredPermissions;
1835
- function requirePermissions() {
1836
- if (hasRequiredPermissions) return permissions;
1837
- hasRequiredPermissions = 1;
1838
- (function(exports$1) {
1839
- Object.defineProperty(exports$1, "__esModule", { value: true });
1840
- exports$1.ROLE_PERMISSIONS = exports$1.MEMBER_PERMISSIONS = exports$1.MANAGER_PERMISSIONS = exports$1.OWNER_PERMISSIONS = void 0;
1841
- exports$1.getPermissionsForRole = getPermissionsForRole;
1842
- exports$1.hasPermission = hasPermission;
1843
- const entity_1 = requireEntity();
1844
- exports$1.OWNER_PERMISSIONS = {
1845
- canViewEntity: true,
1846
- canEditEntity: true,
1847
- canDeleteEntity: true,
1848
- canManageMembers: true,
1849
- canInviteMembers: true,
1850
- canManageProjects: true,
1851
- canCreateProjects: true,
1852
- canViewProjects: true,
1853
- canManageApiKeys: true,
1854
- canViewApiKeys: true
1855
- };
1856
- exports$1.MANAGER_PERMISSIONS = {
1857
- canViewEntity: true,
1858
- canEditEntity: true,
1859
- canDeleteEntity: false,
1860
- canManageMembers: false,
1861
- canInviteMembers: false,
1862
- canManageProjects: true,
1863
- canCreateProjects: true,
1864
- canViewProjects: true,
1865
- canManageApiKeys: true,
1866
- canViewApiKeys: true
1867
- };
1868
- exports$1.MEMBER_PERMISSIONS = {
1869
- canViewEntity: true,
1870
- canEditEntity: false,
1871
- canDeleteEntity: false,
1872
- canManageMembers: false,
1873
- canInviteMembers: false,
1874
- canManageProjects: false,
1875
- canCreateProjects: false,
1876
- canViewProjects: true,
1877
- canManageApiKeys: false,
1878
- canViewApiKeys: true
1879
- };
1880
- exports$1.ROLE_PERMISSIONS = {
1881
- [entity_1.EntityRole.OWNER]: exports$1.OWNER_PERMISSIONS,
1882
- [entity_1.EntityRole.MANAGER]: exports$1.MANAGER_PERMISSIONS,
1883
- [entity_1.EntityRole.MEMBER]: exports$1.MEMBER_PERMISSIONS
1884
- };
1885
- function getPermissionsForRole(role) {
1886
- return exports$1.ROLE_PERMISSIONS[role];
1887
- }
1888
- function hasPermission(role, permission) {
1889
- return exports$1.ROLE_PERMISSIONS[role][permission];
1890
- }
1891
- })(permissions);
1892
- return permissions;
1893
- }
1894
- var web3UsernameValidator = {};
1895
- var hasRequiredWeb3UsernameValidator;
1896
- function requireWeb3UsernameValidator() {
1897
- if (hasRequiredWeb3UsernameValidator) return web3UsernameValidator;
1898
- hasRequiredWeb3UsernameValidator = 1;
1899
- Object.defineProperty(web3UsernameValidator, "__esModule", { value: true });
1900
- web3UsernameValidator.Web3UsernameValidator = void 0;
1901
- const enums_1 = requireEnums();
1902
- class Web3UsernameValidator {
1903
- /**
1904
- * Comprehensive address validation for API endpoint
1905
- * Returns AddressValidationResult for valid addresses, undefined for invalid ones
1906
- */
1907
- static validate(address2) {
1908
- if (!address2) {
1909
- return void 0;
1910
- }
1911
- if (this.EVM_REGEX.test(address2)) {
1912
- return {
1913
- name: null,
1914
- address: address2.toLowerCase(),
1915
- chainType: enums_1.ChainType.EVM
1916
- };
1917
- }
1918
- if (!address2.startsWith("0x") && address2.length >= 32 && address2.length <= 44 && this.BASE58_REGEX.test(address2)) {
1919
- return {
1920
- name: null,
1921
- address: address2,
1922
- // Keep case for Solana
1923
- chainType: enums_1.ChainType.SOLANA
1924
- };
1925
- }
1926
- if ((address2.toLowerCase().endsWith(".eth") || address2.toLowerCase().endsWith(".box")) && address2.length >= 5 && // minimum: "a.eth" = 5 chars
1927
- this.ENS_REGEX.test(address2)) {
1928
- return {
1929
- name: address2.toLowerCase(),
1930
- address: null,
1931
- chainType: enums_1.ChainType.EVM
1932
- // ENS resolves to EVM addresses
1933
- };
1934
- }
1935
- if (address2.toLowerCase().includes(".")) {
1936
- const parts = address2.toLowerCase().split(".");
1937
- if (parts.length === 2) {
1938
- const [name, tld] = parts;
1939
- if (this.VALID_SNS_TLDS.includes(tld) && this.SNS_NAME_REGEX.test(name) && name.length >= 1) {
1940
- return {
1941
- name: address2.toLowerCase(),
1942
- address: null,
1943
- chainType: enums_1.ChainType.SOLANA
1944
- // SNS resolves to Solana addresses
1945
- };
1946
- }
1947
- }
1323
+ debug(message, context, data) {
1324
+ if (this.shouldLog(LogLevel.DEBUG)) {
1325
+ console.log(this.formatMessage(LogLevel.DEBUG, message, context));
1326
+ if (data) {
1327
+ console.log(data);
1948
1328
  }
1949
- return void 0;
1950
- }
1951
- /**
1952
- * Quick EVM address validation
1953
- */
1954
- static isValidEVMAddress(address2) {
1955
- return this.EVM_REGEX.test(address2);
1956
- }
1957
- /**
1958
- * Quick Solana address validation
1959
- */
1960
- static isValidSolanaAddress(address2) {
1961
- return !address2.startsWith("0x") && address2.length >= 32 && address2.length <= 44 && this.BASE58_REGEX.test(address2);
1962
- }
1963
- /**
1964
- * Quick ENS name validation
1965
- */
1966
- static isValidENSName(address2) {
1967
- return (address2.toLowerCase().endsWith(".eth") || address2.toLowerCase().endsWith(".box")) && address2.length >= 5 && this.ENS_REGEX.test(address2);
1968
- }
1969
- /**
1970
- * Quick SNS name validation
1971
- */
1972
- static isValidSNSName(address2) {
1973
- if (!address2.toLowerCase().includes("."))
1974
- return false;
1975
- const parts = address2.toLowerCase().split(".");
1976
- if (parts.length !== 2)
1977
- return false;
1978
- const [name, tld] = parts;
1979
- return this.VALID_SNS_TLDS.includes(tld) && this.SNS_NAME_REGEX.test(name) && name.length >= 1;
1980
1329
  }
1981
1330
  }
1982
- web3UsernameValidator.Web3UsernameValidator = Web3UsernameValidator;
1983
- Web3UsernameValidator.EVM_REGEX = /^0x[a-fA-F0-9]{40}$/;
1984
- Web3UsernameValidator.BASE58_REGEX = /^[1-9A-HJ-NP-Za-km-z]+$/;
1985
- Web3UsernameValidator.ENS_REGEX = /^[a-zA-Z0-9]([a-zA-Z0-9]|(-[a-zA-Z0-9]))*\.(eth|box)$/i;
1986
- Web3UsernameValidator.SNS_NAME_REGEX = /^[a-zA-Z0-9]([a-zA-Z0-9]|(-[a-zA-Z0-9]))*$/;
1987
- Web3UsernameValidator.VALID_SNS_TLDS = [
1988
- "sol",
1989
- "abc",
1990
- "backpack",
1991
- "bonk",
1992
- "coin",
1993
- "dao",
1994
- "defi",
1995
- "gm",
1996
- "poor",
1997
- "pump",
1998
- "shdw",
1999
- "stepn",
2000
- "web3"
2001
- ];
2002
- return web3UsernameValidator;
2003
- }
2004
- var typeValidation = {};
2005
- var hasRequiredTypeValidation;
2006
- function requireTypeValidation() {
2007
- if (hasRequiredTypeValidation) return typeValidation;
2008
- hasRequiredTypeValidation = 1;
2009
- (function(exports$1) {
2010
- Object.defineProperty(exports$1, "__esModule", { value: true });
2011
- exports$1.parseJson = exports$1.createAssertion = exports$1.isUrl = exports$1.isEmail = exports$1.isValidDate = exports$1.isErrorResponse = exports$1.isSuccessResponse = exports$1.isApiResponse = exports$1.optional = exports$1.validateArray = exports$1.hasRequiredProperties = exports$1.isNullish = exports$1.isArray = exports$1.isObject = exports$1.isBoolean = exports$1.isNumber = exports$1.isString = exports$1.createValidator = void 0;
2012
- const createValidator = (validationFn, typeName) => {
2013
- return (data) => {
2014
- try {
2015
- if (validationFn(data)) {
2016
- return { isValid: true, data };
2017
- }
2018
- return { isValid: false, error: `Invalid ${typeName}`, data: null };
2019
- } catch (error) {
2020
- return {
2021
- isValid: false,
2022
- error: `Validation error for ${typeName}: ${error instanceof Error ? error.message : "Unknown error"}`,
2023
- data: null
2024
- };
2025
- }
2026
- };
2027
- };
2028
- exports$1.createValidator = createValidator;
2029
- const isString = (value) => typeof value === "string";
2030
- exports$1.isString = isString;
2031
- const isNumber = (value) => typeof value === "number" && !isNaN(value);
2032
- exports$1.isNumber = isNumber;
2033
- const isBoolean = (value) => typeof value === "boolean";
2034
- exports$1.isBoolean = isBoolean;
2035
- const isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
2036
- exports$1.isObject = isObject;
2037
- const isArray = (value) => Array.isArray(value);
2038
- exports$1.isArray = isArray;
2039
- const isNullish = (value) => value === null || value === void 0;
2040
- exports$1.isNullish = isNullish;
2041
- const hasRequiredProperties = (obj, requiredProps) => {
2042
- if (!(0, exports$1.isObject)(obj))
2043
- return false;
2044
- return requiredProps.every((prop) => prop in obj);
2045
- };
2046
- exports$1.hasRequiredProperties = hasRequiredProperties;
2047
- const validateArray = (data, itemValidator) => {
2048
- if (!(0, exports$1.isArray)(data))
2049
- return false;
2050
- return data.every(itemValidator);
2051
- };
2052
- exports$1.validateArray = validateArray;
2053
- const optional = (validator) => (value) => {
2054
- return value === void 0 || validator(value);
2055
- };
2056
- exports$1.optional = optional;
2057
- const isApiResponse = (data) => {
2058
- return (0, exports$1.isObject)(data) && (0, exports$1.isBoolean)(data.success);
2059
- };
2060
- exports$1.isApiResponse = isApiResponse;
2061
- const isSuccessResponse = (data, dataValidator) => {
2062
- if (!(0, exports$1.isApiResponse)(data) || !data.success)
2063
- return false;
2064
- if (dataValidator && "data" in data) {
2065
- return dataValidator(data.data);
2066
- }
2067
- return true;
2068
- };
2069
- exports$1.isSuccessResponse = isSuccessResponse;
2070
- const isErrorResponse = (data) => {
2071
- return (0, exports$1.isApiResponse)(data) && !data.success && "error" in data && (0, exports$1.isString)(data.error);
2072
- };
2073
- exports$1.isErrorResponse = isErrorResponse;
2074
- const isValidDate = (value) => {
2075
- if (!(0, exports$1.isString)(value))
2076
- return false;
2077
- const date2 = new Date(value);
2078
- return !isNaN(date2.getTime());
2079
- };
2080
- exports$1.isValidDate = isValidDate;
2081
- const isEmail = (value) => {
2082
- if (!(0, exports$1.isString)(value))
2083
- return false;
2084
- const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
2085
- return emailRegex.test(value);
2086
- };
2087
- exports$1.isEmail = isEmail;
2088
- const isUrl = (value) => {
2089
- if (!(0, exports$1.isString)(value))
2090
- return false;
2091
- try {
2092
- new URL(value);
2093
- return true;
2094
- } catch {
2095
- return false;
2096
- }
2097
- };
2098
- exports$1.isUrl = isUrl;
2099
- const createAssertion = (validator, typeName) => {
2100
- return (data, context = typeName) => {
2101
- if (!validator(data)) {
2102
- throw new TypeError(`Invalid ${context}: expected ${typeName}`);
2103
- }
2104
- };
2105
- };
2106
- exports$1.createAssertion = createAssertion;
2107
- const parseJson = (jsonString, validator) => {
2108
- try {
2109
- const parsed = JSON.parse(jsonString);
2110
- if (validator) {
2111
- if (validator(parsed)) {
2112
- return { isValid: true, data: parsed };
2113
- }
2114
- return {
2115
- isValid: false,
2116
- error: "Parsed JSON does not match expected type",
2117
- data: null
2118
- };
2119
- }
2120
- return { isValid: true, data: parsed };
2121
- } catch (error) {
2122
- return {
2123
- isValid: false,
2124
- error: `JSON parse error: ${error instanceof Error ? error.message : "Unknown error"}`,
2125
- data: null
2126
- };
2127
- }
2128
- };
2129
- exports$1.parseJson = parseJson;
2130
- })(typeValidation);
2131
- return typeValidation;
2132
- }
2133
- var eventHelpers = {};
2134
- var hasRequiredEventHelpers;
2135
- function requireEventHelpers() {
2136
- if (hasRequiredEventHelpers) return eventHelpers;
2137
- hasRequiredEventHelpers = 1;
2138
- Object.defineProperty(eventHelpers, "__esModule", { value: true });
2139
- eventHelpers.createMultiChainId = createMultiChainId;
2140
- eventHelpers.createUserMultiChainId = createUserMultiChainId;
2141
- eventHelpers.createChainStatsId = createChainStatsId;
2142
- eventHelpers.createDelegationId = createDelegationId;
2143
- eventHelpers.normalizeAddress = normalizeAddress;
2144
- eventHelpers.formatBigInt = formatBigInt;
2145
- eventHelpers.isZeroAddress = isZeroAddress;
2146
- eventHelpers.isTestNet = isTestNet;
2147
- eventHelpers.validateEventArgs = validateEventArgs;
2148
- function createMultiChainId(chainId, txHash, logIndex) {
2149
- return `${chainId}-${txHash}-${logIndex}`;
2150
- }
2151
- function createUserMultiChainId(chainId, address2) {
2152
- return `${chainId}-${address2.toLowerCase()}`;
2153
- }
2154
- function createChainStatsId(chainId) {
2155
- return `${chainId}-global`;
2156
- }
2157
- function createDelegationId(delegatorAddress, isTestNet2) {
2158
- return `${delegatorAddress.toLowerCase()}-${isTestNet2}`;
2159
- }
2160
- function normalizeAddress(address2) {
2161
- return address2.toLowerCase();
2162
- }
2163
- function formatBigInt(value, decimals = 18) {
2164
- const divisor = BigInt(10 ** decimals);
2165
- const whole = value / divisor;
2166
- const fraction = value % divisor;
2167
- if (fraction === 0n) {
2168
- return whole.toString();
2169
- }
2170
- return `${whole}.${fraction.toString().padStart(decimals, "0").replace(/0+$/, "")}`;
2171
- }
2172
- function isZeroAddress(address2) {
2173
- return address2.toLowerCase() === "0x0000000000000000000000000000000000000000";
2174
- }
2175
- function isTestNet(chainId) {
2176
- const evmTestnets = /* @__PURE__ */ new Set([
2177
- 31337,
2178
- // Hardhat (local development)
2179
- 11155111,
2180
- // Ethereum Sepolia
2181
- 80001,
2182
- // Polygon Mumbai (if configured)
2183
- 80002,
2184
- // Polygon Amoy (if configured)
2185
- 421614,
2186
- // Arbitrum Sepolia (if configured)
2187
- 11155420,
2188
- // OP Sepolia (if configured)
2189
- 84532,
2190
- // Base Sepolia (if configured)
2191
- 43113
2192
- // Avalanche Fuji (if configured)
2193
- ]);
2194
- const solanaTestnets = /* @__PURE__ */ new Set([
2195
- -102,
2196
- // Solana Devnet
2197
- -103,
2198
- // Solana Testnet
2199
- -104
2200
- // Solana Localnet
2201
- ]);
2202
- return evmTestnets.has(chainId) || solanaTestnets.has(chainId);
2203
- }
2204
- function validateEventArgs(args, requiredFields) {
2205
- for (const field of requiredFields) {
2206
- if (args[field] === void 0 || args[field] === null) {
2207
- console.error(`❌ Missing required field: ${String(field)}`);
2208
- return false;
2209
- }
2210
- }
2211
- return true;
2212
- }
2213
- return eventHelpers;
2214
- }
2215
- var auth = {};
2216
- var hasRequiredAuth;
2217
- function requireAuth() {
2218
- if (hasRequiredAuth) return auth;
2219
- hasRequiredAuth = 1;
2220
- Object.defineProperty(auth, "__esModule", { value: true });
2221
- auth.generateAuthMessage = generateAuthMessage;
2222
- auth.isAuthExpired = isAuthExpired;
2223
- auth.getAuthStatusText = getAuthStatusText;
2224
- auth.canAccessProtectedFeatures = canAccessProtectedFeatures;
2225
- auth.isAuthStatusConnected = isAuthStatusConnected;
2226
- auth.generateNonce = generateNonce;
2227
- auth.extractNonceFromMessage = extractNonceFromMessage;
2228
- auth.isValidNonce = isValidNonce;
2229
- const enums_1 = requireEnums();
2230
- function generateAuthMessage(emailDomain, nonce) {
2231
- const actualNonce = nonce || `${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
2232
- return `Authenticate with ${emailDomain}
2233
- Nonce: ${actualNonce}`;
2234
- }
2235
- function isAuthExpired(createdAt, expirationHours = 24) {
2236
- const expirationTime = new Date(createdAt.getTime() + expirationHours * 60 * 60 * 1e3);
2237
- return /* @__PURE__ */ new Date() > expirationTime;
2238
- }
2239
- function getAuthStatusText(status) {
2240
- switch (status) {
2241
- case enums_1.AuthStatus.DISCONNECTED:
2242
- return "Not connected";
2243
- case enums_1.AuthStatus.CONNECTED:
2244
- return "Connected - Please verify";
2245
- case enums_1.AuthStatus.VERIFIED:
2246
- return "Authenticated";
2247
- default:
2248
- return "Unknown status";
2249
- }
2250
- }
2251
- function canAccessProtectedFeatures(status) {
2252
- return status === enums_1.AuthStatus.VERIFIED;
2253
- }
2254
- function isAuthStatusConnected(status) {
2255
- return status === enums_1.AuthStatus.CONNECTED || status === enums_1.AuthStatus.VERIFIED;
2256
- }
2257
- function generateNonce() {
2258
- return `${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
2259
- }
2260
- function extractNonceFromMessage(message) {
2261
- const match = message.match(/Nonce:\s*(.+)$/m);
2262
- return match ? match[1].trim() : void 0;
2263
- }
2264
- function isValidNonce(nonce) {
2265
- if (!nonce || typeof nonce !== "string") {
2266
- return false;
2267
- }
2268
- if (nonce.length < 10) {
2269
- return false;
2270
- }
2271
- const parts = nonce.split("-");
2272
- if (parts.length >= 2) {
2273
- const timestamp = parseInt(parts[0], 10);
2274
- if (!isNaN(timestamp)) {
2275
- const oneDayAgo = Date.now() - 24 * 60 * 60 * 1e3;
2276
- if (timestamp < oneDayAgo) {
2277
- return false;
2278
- }
2279
- }
2280
- }
2281
- return true;
2282
- }
2283
- return auth;
2284
- }
2285
- var adminEmails = {};
2286
- var hasRequiredAdminEmails;
2287
- function requireAdminEmails() {
2288
- if (hasRequiredAdminEmails) return adminEmails;
2289
- hasRequiredAdminEmails = 1;
2290
- Object.defineProperty(adminEmails, "__esModule", { value: true });
2291
- adminEmails.parseAdminEmails = parseAdminEmails;
2292
- adminEmails.isAdminEmail = isAdminEmail;
2293
- adminEmails.createAdminChecker = createAdminChecker;
2294
- function parseAdminEmails(input) {
2295
- if (!input) {
2296
- return [];
2297
- }
2298
- return input.split(",").map((email) => email.trim().toLowerCase()).filter((email) => email.length > 0 && email.includes("@"));
2299
- }
2300
- function isAdminEmail(email, adminEmails2) {
2301
- if (!email) {
2302
- return false;
2303
- }
2304
- return adminEmails2.includes(email.toLowerCase());
2305
- }
2306
- function createAdminChecker(input) {
2307
- const adminEmails2 = parseAdminEmails(input);
2308
- return (email) => {
2309
- return isAdminEmail(email, adminEmails2);
2310
- };
2311
- }
2312
- return adminEmails;
2313
- }
2314
- var currency = {};
2315
- var hasRequiredCurrency;
2316
- function requireCurrency() {
2317
- if (hasRequiredCurrency) return currency;
2318
- hasRequiredCurrency = 1;
2319
- (function(exports$1) {
2320
- Object.defineProperty(exports$1, "__esModule", { value: true });
2321
- exports$1.CLAIM_PERIOD_DAYS = exports$1.USDC_DECIMALS = void 0;
2322
- exports$1.formatUSDC = formatUSDC;
2323
- exports$1.parseUSDC = parseUSDC;
2324
- exports$1.USDC_DECIMALS = 6;
2325
- exports$1.CLAIM_PERIOD_DAYS = 60;
2326
- function formatUSDC(amount) {
2327
- return (amount / Math.pow(10, exports$1.USDC_DECIMALS)).toFixed(2);
2328
- }
2329
- function parseUSDC(amount) {
2330
- return Math.floor(parseFloat(amount) * Math.pow(10, exports$1.USDC_DECIMALS));
2331
- }
2332
- })(currency);
2333
- return currency;
2334
- }
2335
- var date = {};
2336
- var hasRequiredDate;
2337
- function requireDate() {
2338
- if (hasRequiredDate) return date;
2339
- hasRequiredDate = 1;
2340
- Object.defineProperty(date, "__esModule", { value: true });
2341
- date.formatEmailDate = formatEmailDate;
2342
- date.formatTimestamp = formatTimestamp;
2343
- date.formatRelativeTime = formatRelativeTime;
2344
- date.parseDate = parseDate;
2345
- date.isDateInRange = isDateInRange;
2346
- date.addDays = addDays;
2347
- date.addHours = addHours;
2348
- function formatEmailDate(date2) {
2349
- const dateObj = typeof date2 === "string" ? new Date(date2) : date2;
2350
- if (isNaN(dateObj.getTime())) {
2351
- return "Invalid date";
2352
- }
2353
- const now = /* @__PURE__ */ new Date();
2354
- const diffMs = now.getTime() - dateObj.getTime();
2355
- const diffDays = Math.floor(diffMs / (1e3 * 60 * 60 * 24));
2356
- if (diffDays === 0) {
2357
- return dateObj.toLocaleTimeString("en-US", {
2358
- hour: "numeric",
2359
- minute: "2-digit",
2360
- hour12: true
2361
- });
2362
- }
2363
- if (diffDays === 1) {
2364
- return "Yesterday";
2365
- }
2366
- if (diffDays < 7) {
2367
- return dateObj.toLocaleDateString("en-US", {
2368
- weekday: "long"
2369
- });
2370
- }
2371
- if (dateObj.getFullYear() === now.getFullYear()) {
2372
- return dateObj.toLocaleDateString("en-US", {
2373
- month: "short",
2374
- day: "numeric"
2375
- });
2376
- }
2377
- return dateObj.toLocaleDateString("en-US", {
2378
- year: "numeric",
2379
- month: "short",
2380
- day: "numeric"
2381
- });
2382
- }
2383
- function formatTimestamp(timestamp) {
2384
- return new Date(timestamp).toISOString();
2385
- }
2386
- function formatRelativeTime(date2) {
2387
- const dateObj = typeof date2 === "string" || typeof date2 === "number" ? new Date(date2) : date2;
2388
- if (isNaN(dateObj.getTime())) {
2389
- return "Invalid date";
2390
- }
2391
- const now = /* @__PURE__ */ new Date();
2392
- const diffMs = now.getTime() - dateObj.getTime();
2393
- const diffSeconds = Math.floor(diffMs / 1e3);
2394
- const diffMinutes = Math.floor(diffSeconds / 60);
2395
- const diffHours = Math.floor(diffMinutes / 60);
2396
- const diffDays = Math.floor(diffHours / 24);
2397
- const diffWeeks = Math.floor(diffDays / 7);
2398
- const diffMonths = Math.floor(diffDays / 30);
2399
- const diffYears = Math.floor(diffDays / 365);
2400
- if (diffSeconds < 60) {
2401
- return "just now";
2402
- }
2403
- if (diffMinutes < 60) {
2404
- return diffMinutes === 1 ? "1 minute ago" : `${diffMinutes} minutes ago`;
2405
- }
2406
- if (diffHours < 24) {
2407
- return diffHours === 1 ? "1 hour ago" : `${diffHours} hours ago`;
2408
- }
2409
- if (diffDays < 7) {
2410
- return diffDays === 1 ? "1 day ago" : `${diffDays} days ago`;
2411
- }
2412
- if (diffWeeks < 4) {
2413
- return diffWeeks === 1 ? "1 week ago" : `${diffWeeks} weeks ago`;
2414
- }
2415
- if (diffMonths < 12) {
2416
- return diffMonths === 1 ? "1 month ago" : `${diffMonths} months ago`;
2417
- }
2418
- return diffYears === 1 ? "1 year ago" : `${diffYears} years ago`;
2419
- }
2420
- function parseDate(dateString) {
2421
- try {
2422
- const date2 = new Date(dateString);
2423
- if (isNaN(date2.getTime())) {
2424
- return null;
2425
- }
2426
- return date2;
2427
- } catch {
2428
- return null;
2429
- }
2430
- }
2431
- function isDateInRange(date2, startDate, endDate) {
2432
- return date2 >= startDate && date2 <= endDate;
2433
- }
2434
- function addDays(date2, days) {
2435
- const result = new Date(date2);
2436
- result.setDate(result.getDate() + days);
2437
- return result;
2438
- }
2439
- function addHours(date2, hours) {
2440
- const result = new Date(date2);
2441
- result.setHours(result.getHours() + hours);
2442
- return result;
2443
- }
2444
- return date;
2445
- }
2446
- var string = {};
2447
- var hasRequiredString;
2448
- function requireString() {
2449
- if (hasRequiredString) return string;
2450
- hasRequiredString = 1;
2451
- Object.defineProperty(string, "__esModule", { value: true });
2452
- string.truncate = truncate;
2453
- string.capitalize = capitalize;
2454
- string.toTitleCase = toTitleCase;
2455
- string.toKebabCase = toKebabCase;
2456
- string.toCamelCase = toCamelCase;
2457
- string.toSnakeCase = toSnakeCase;
2458
- string.normalizeWhitespace = normalizeWhitespace;
2459
- string.isBlank = isBlank;
2460
- string.isNotBlank = isNotBlank;
2461
- string.escapeHtml = escapeHtml;
2462
- string.stripHtml = stripHtml;
2463
- string.getInitials = getInitials;
2464
- string.formatBytes = formatBytes;
2465
- string.randomString = randomString;
2466
- string.pluralize = pluralize;
2467
- string.formatNumber = formatNumber;
2468
- function truncate(str, maxLength, suffix = "...") {
2469
- if (!str || str.length <= maxLength) {
2470
- return str;
2471
- }
2472
- return str.slice(0, maxLength - suffix.length) + suffix;
2473
- }
2474
- function capitalize(str) {
2475
- if (!str)
2476
- return str;
2477
- return str.charAt(0).toUpperCase() + str.slice(1);
2478
- }
2479
- function toTitleCase(str) {
2480
- if (!str)
2481
- return str;
2482
- return str.toLowerCase().split(" ").map((word) => capitalize(word)).join(" ");
2483
- }
2484
- function toKebabCase(str) {
2485
- if (!str)
2486
- return str;
2487
- return str.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase();
2488
- }
2489
- function toCamelCase(str) {
2490
- if (!str)
2491
- return str;
2492
- return str.replace(/[-_\s]+(.)?/g, (_, char) => char ? char.toUpperCase() : "").replace(/^./, (char) => char.toLowerCase());
2493
- }
2494
- function toSnakeCase(str) {
2495
- if (!str)
2496
- return str;
2497
- return str.replace(/([a-z])([A-Z])/g, "$1_$2").replace(/[\s-]+/g, "_").toLowerCase();
2498
- }
2499
- function normalizeWhitespace(str) {
2500
- if (!str)
2501
- return str;
2502
- return str.replace(/\s+/g, " ").trim();
2503
- }
2504
- function isBlank(str) {
2505
- return !str || str.trim().length === 0;
2506
- }
2507
- function isNotBlank(str) {
2508
- return !isBlank(str);
2509
- }
2510
- function escapeHtml(str) {
2511
- if (!str)
2512
- return str;
2513
- const htmlEscapes = {
2514
- "&": "&amp;",
2515
- "<": "&lt;",
2516
- ">": "&gt;",
2517
- '"': "&quot;",
2518
- "'": "&#39;"
1331
+ /**
1332
+ * Create a contextual logger that automatically includes context in all calls
1333
+ */
1334
+ withContext(context) {
1335
+ return {
1336
+ error: (message, data) => this.error(message, context, data),
1337
+ warn: (message, data) => this.warn(message, context, data),
1338
+ info: (message, data) => this.info(message, context, data),
1339
+ debug: (message, data) => this.debug(message, context, data)
2519
1340
  };
2520
- return str.replace(/[&<>"']/g, (char) => htmlEscapes[char]);
2521
- }
2522
- function stripHtml(str) {
2523
- if (!str)
2524
- return str;
2525
- return str.replace(/<[^>]*>/g, "");
2526
- }
2527
- function getInitials(name, maxInitials = 2) {
2528
- if (!name)
2529
- return "";
2530
- const words = name.trim().split(/\s+/);
2531
- const initials = words.slice(0, maxInitials).map((word) => word.charAt(0).toUpperCase()).join("");
2532
- return initials;
2533
1341
  }
2534
- function formatBytes(bytes, decimals = 2) {
2535
- if (bytes === 0)
2536
- return "0 Bytes";
2537
- const k = 1024;
2538
- const dm = decimals < 0 ? 0 : decimals;
2539
- const sizes = ["Bytes", "KB", "MB", "GB", "TB", "PB"];
2540
- const i = Math.floor(Math.log(bytes) / Math.log(k));
2541
- return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + " " + sizes[i];
2542
- }
2543
- function randomString(length, charset = "alphanumeric") {
2544
- let chars;
2545
- switch (charset) {
2546
- case "alpha":
2547
- chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
2548
- break;
2549
- case "numeric":
2550
- chars = "0123456789";
2551
- break;
2552
- case "alphanumeric":
2553
- chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
2554
- break;
2555
- case "hex":
2556
- chars = "0123456789abcdef";
2557
- break;
2558
- default:
2559
- chars = charset;
2560
- }
2561
- let result = "";
2562
- for (let i = 0; i < length; i++) {
2563
- result += chars.charAt(Math.floor(Math.random() * chars.length));
2564
- }
2565
- return result;
2566
- }
2567
- function pluralize(count, singular, plural) {
2568
- if (count === 1) {
2569
- return singular;
2570
- }
2571
- return plural || `${singular}s`;
2572
- }
2573
- function formatNumber(num) {
2574
- return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
2575
- }
2576
- return string;
2577
- }
2578
- var application = {};
2579
- var hasRequiredApplication;
2580
- function requireApplication() {
2581
- if (hasRequiredApplication) return application;
2582
- hasRequiredApplication = 1;
2583
- Object.defineProperty(application, "__esModule", { value: true });
2584
- application.Z_INDEX = application.ANIMATION = application.NETWORK_IDS = application.WALLET_NAMES = application.CONTACT_INFO = application.ROUTES = application.SUCCESS_MESSAGES = application.ERROR_MESSAGES = application.TIME_FORMAT = application.SUBSCRIPTION_TIERS = application.EMAIL_CONFIG = application.STORAGE_KEYS = application.CHAIN_TYPE = application.AUTH_STATUS = application.API_RETRY_DELAY = application.API_RETRY_ATTEMPTS = application.API_TIMEOUT = void 0;
2585
- const API_TIMEOUT = 3e4;
2586
- application.API_TIMEOUT = API_TIMEOUT;
2587
- const API_RETRY_ATTEMPTS = 3;
2588
- application.API_RETRY_ATTEMPTS = API_RETRY_ATTEMPTS;
2589
- const API_RETRY_DELAY = 1e3;
2590
- application.API_RETRY_DELAY = API_RETRY_DELAY;
2591
- const AUTH_STATUS = {
2592
- DISCONNECTED: "disconnected",
2593
- CONNECTED: "connected",
2594
- VERIFIED: "verified"
2595
- };
2596
- application.AUTH_STATUS = AUTH_STATUS;
2597
- const CHAIN_TYPE = {
2598
- EVM: "evm",
2599
- SOLANA: "solana",
2600
- UNKNOWN: "unknown"
2601
- };
2602
- application.CHAIN_TYPE = CHAIN_TYPE;
2603
- const STORAGE_KEYS = {
2604
- AUTH_TOKEN: "authToken",
2605
- USER_DATA: "userData",
2606
- THEME: "theme",
2607
- EMAIL_CACHE: "emailCache",
2608
- WALLET_ADDRESS: "walletAddress",
2609
- CHAIN_TYPE: "chainType"
2610
- };
2611
- application.STORAGE_KEYS = STORAGE_KEYS;
2612
- const EMAIL_CONFIG = {
2613
- MAX_ATTACHMENT_SIZE: 25 * 1024 * 1024,
2614
- // 25MB
2615
- MAX_RECIPIENTS: 100,
2616
- ITEMS_PER_PAGE: 50,
2617
- REFRESH_INTERVAL: 6e4,
2618
- // 1 minute
2619
- NOTIFICATION_COOLDOWN: 3e5
2620
- // 5 minutes
2621
- };
2622
- application.EMAIL_CONFIG = EMAIL_CONFIG;
2623
- const SUBSCRIPTION_TIERS = {
2624
- FREE: "free",
2625
- BASIC: "basic",
2626
- PRO: "pro",
2627
- ENTERPRISE: "enterprise"
2628
- };
2629
- application.SUBSCRIPTION_TIERS = SUBSCRIPTION_TIERS;
2630
- const TIME_FORMAT = {
2631
- SHORT_DATE: "MMM d",
2632
- FULL_DATE: "MMM d, yyyy",
2633
- DATE_TIME: "MMM d, yyyy h:mm a",
2634
- RELATIVE: "relative"
2635
- };
2636
- application.TIME_FORMAT = TIME_FORMAT;
2637
- const ERROR_MESSAGES = {
2638
- WALLET_NOT_CONNECTED: "Please connect your wallet first",
2639
- INVALID_ADDRESS: "Please enter a valid address",
2640
- NETWORK_ERROR: "Network error. Please try again.",
2641
- AUTHENTICATION_FAILED: "Authentication failed. Please sign in again.",
2642
- TRANSACTION_FAILED: "Transaction failed. Please try again.",
2643
- INSUFFICIENT_FUNDS: "Insufficient funds for this operation",
2644
- RATE_LIMITED: "Too many requests. Please wait a moment.",
2645
- SESSION_EXPIRED: "Your session has expired. Please sign in again.",
2646
- PERMISSION_DENIED: "You do not have permission to perform this action"
2647
- };
2648
- application.ERROR_MESSAGES = ERROR_MESSAGES;
2649
- const SUCCESS_MESSAGES = {
2650
- EMAIL_SENT: "Email sent successfully",
2651
- EMAIL_DELETED: "Email deleted successfully",
2652
- PREFERENCES_SAVED: "Preferences saved successfully",
2653
- WALLET_CONNECTED: "Wallet connected successfully",
2654
- AUTHENTICATION_SUCCESS: "Authentication successful",
2655
- DELEGATION_SUCCESS: "Delegation successful",
2656
- SUBSCRIPTION_ACTIVATED: "Subscription activated successfully"
2657
- };
2658
- application.SUCCESS_MESSAGES = SUCCESS_MESSAGES;
2659
- const ROUTES = {
2660
- HOME: "/",
2661
- ABOUT: "/about",
2662
- CONNECT: "/connect",
2663
- MAIL: "/mail",
2664
- COMPOSE: "/mail/compose",
2665
- PREFERENCES: "/preferences",
2666
- TERMS: "/terms",
2667
- PRIVACY: "/privacy",
2668
- DOCUMENTATION: "/document",
2669
- WEB3_USERS: "/web3-users",
2670
- WEB3_PROJECTS: "/web3-projects"
2671
- };
2672
- application.ROUTES = ROUTES;
2673
- const CONTACT_INFO = {
2674
- SUPPORT_EMAIL: "support@sudobility.com",
2675
- CONTACT_EMAIL: "info@sudobility.com"
2676
- };
2677
- application.CONTACT_INFO = CONTACT_INFO;
2678
- const WALLET_NAMES = {
2679
- METAMASK: "MetaMask",
2680
- WALLETCONNECT: "WalletConnect",
2681
- COINBASE: "Coinbase Wallet",
2682
- PHANTOM: "Phantom",
2683
- SAFE: "Safe",
2684
- ARGENT: "Argent",
2685
- RAINBOW: "Rainbow",
2686
- TRUST: "Trust Wallet",
2687
- LEDGER: "Ledger",
2688
- TREZOR: "Trezor"
2689
- };
2690
- application.WALLET_NAMES = WALLET_NAMES;
2691
- const NETWORK_IDS = {
2692
- ETHEREUM_MAINNET: 1,
2693
- POLYGON: 137,
2694
- ARBITRUM: 42161,
2695
- OPTIMISM: 10,
2696
- BASE: 8453,
2697
- SOLANA_MAINNET: "mainnet-beta",
2698
- SOLANA_DEVNET: "devnet"
2699
- };
2700
- application.NETWORK_IDS = NETWORK_IDS;
2701
- const ANIMATION = {
2702
- FAST: 150,
2703
- NORMAL: 300,
2704
- SLOW: 500,
2705
- VERY_SLOW: 1e3
2706
- };
2707
- application.ANIMATION = ANIMATION;
2708
- const Z_INDEX = {
2709
- DROPDOWN: 10,
2710
- OVERLAY: 20,
2711
- MODAL: 30,
2712
- POPOVER: 40,
2713
- TOOLTIP: 50,
2714
- TOAST: 60
2715
- };
2716
- application.Z_INDEX = Z_INDEX;
2717
- return application;
2718
- }
2719
- var statusValues = {};
2720
- var hasRequiredStatusValues;
2721
- function requireStatusValues() {
2722
- if (hasRequiredStatusValues) return statusValues;
2723
- hasRequiredStatusValues = 1;
2724
- Object.defineProperty(statusValues, "__esModule", { value: true });
2725
- statusValues.STATUS_VALUES = void 0;
2726
- statusValues.STATUS_VALUES = {
2727
- SUCCESS: "success",
2728
- PENDING: "pending",
2729
- FAILED: "failed",
2730
- ERROR: "error"
2731
- };
2732
- return statusValues;
2733
- }
2734
- var logger = {};
2735
- var hasRequiredLogger;
2736
- function requireLogger() {
2737
- if (hasRequiredLogger) return logger;
2738
- hasRequiredLogger = 1;
2739
- Object.defineProperty(logger, "__esModule", { value: true });
2740
- logger.storageLogger = logger.ensLogger = logger.contractLogger = logger.apiLogger = logger.authLogger = logger.logger = logger.LogLevel = void 0;
2741
- var LogLevel;
2742
- (function(LogLevel2) {
2743
- LogLevel2["ERROR"] = "error";
2744
- LogLevel2["WARN"] = "warn";
2745
- LogLevel2["INFO"] = "info";
2746
- LogLevel2["DEBUG"] = "debug";
2747
- })(LogLevel || (logger.LogLevel = LogLevel = {}));
2748
- class Logger {
2749
- constructor() {
2750
- this.isDevelopment = process.env.NODE_ENV === "development";
2751
- }
2752
- formatTimestamp() {
2753
- return (/* @__PURE__ */ new Date()).toISOString();
2754
- }
2755
- formatMessage(_level, message, context) {
2756
- const timestamp = this.formatTimestamp();
2757
- const contextStr = context ? ` [${context}]` : "";
2758
- return `[${timestamp}]${contextStr} ${message}`;
2759
- }
2760
- shouldLog(level) {
2761
- if (!this.isDevelopment) {
2762
- return level === LogLevel.ERROR || level === LogLevel.WARN;
2763
- }
2764
- return true;
2765
- }
2766
- error(message, context, data) {
2767
- if (this.shouldLog(LogLevel.ERROR)) {
2768
- console.error(this.formatMessage(LogLevel.ERROR, message, context));
2769
- if (data) {
2770
- console.error(data);
2771
- }
2772
- }
2773
- }
2774
- warn(message, context, data) {
2775
- if (this.shouldLog(LogLevel.WARN)) {
2776
- console.warn(this.formatMessage(LogLevel.WARN, message, context));
2777
- if (data) {
2778
- console.warn(data);
2779
- }
2780
- }
2781
- }
2782
- info(message, context, data) {
2783
- if (this.shouldLog(LogLevel.INFO)) {
2784
- console.log(this.formatMessage(LogLevel.INFO, message, context));
2785
- if (data) {
2786
- console.log(data);
2787
- }
2788
- }
2789
- }
2790
- debug(message, context, data) {
2791
- if (this.shouldLog(LogLevel.DEBUG)) {
2792
- console.log(this.formatMessage(LogLevel.DEBUG, message, context));
2793
- if (data) {
2794
- console.log(data);
2795
- }
2796
- }
2797
- }
2798
- /**
2799
- * Create a contextual logger that automatically includes context in all calls
2800
- */
2801
- withContext(context) {
2802
- return {
2803
- error: (message, data) => this.error(message, context, data),
2804
- warn: (message, data) => this.warn(message, context, data),
2805
- info: (message, data) => this.info(message, context, data),
2806
- debug: (message, data) => this.debug(message, context, data)
2807
- };
2808
- }
2809
- }
2810
- const logger$1 = new Logger();
2811
- logger.logger = logger$1;
2812
- const authLogger = logger$1.withContext("AUTH");
2813
- logger.authLogger = authLogger;
2814
- const apiLogger = logger$1.withContext("API");
2815
- logger.apiLogger = apiLogger;
2816
- const contractLogger = logger$1.withContext("CONTRACT");
2817
- logger.contractLogger = contractLogger;
2818
- const ensLogger = logger$1.withContext("ENS");
2819
- logger.ensLogger = ensLogger;
2820
- const storageLogger = logger$1.withContext("STORAGE");
2821
- logger.storageLogger = storageLogger;
2822
- return logger;
2823
- }
2824
- var urlParams = {};
2825
- var hasRequiredUrlParams;
2826
- function requireUrlParams() {
2827
- if (hasRequiredUrlParams) return urlParams;
2828
- hasRequiredUrlParams = 1;
2829
- Object.defineProperty(urlParams, "__esModule", { value: true });
2830
- urlParams.createURLSearchParams = createURLSearchParams;
2831
- urlParams.createSearchParams = createSearchParams;
2832
- urlParams.searchParamsToString = searchParamsToString;
2833
- urlParams.parseSearchParams = parseSearchParams;
2834
- class SimpleURLSearchParams {
2835
- constructor(init) {
2836
- this.params = /* @__PURE__ */ new Map();
2837
- if (init) {
2838
- if (typeof init === "string") {
2839
- this.parseString(init);
2840
- } else if (Array.isArray(init)) {
2841
- for (const [key, value] of init) {
2842
- this.append(key, value);
2843
- }
2844
- } else {
2845
- for (const [key, value] of Object.entries(init)) {
2846
- if (value !== void 0) {
2847
- this.append(key, value);
2848
- }
2849
- }
2850
- }
2851
- }
2852
- }
2853
- parseString(str) {
2854
- const params = str.startsWith("?") ? str.slice(1) : str;
2855
- if (!params)
2856
- return;
2857
- for (const pair of params.split("&")) {
2858
- const [key, value = ""] = pair.split("=");
2859
- if (key) {
2860
- this.append(decodeURIComponent(key), decodeURIComponent(value));
2861
- }
2862
- }
2863
- }
2864
- append(name, value) {
2865
- if (!this.params.has(name)) {
2866
- this.params.set(name, []);
2867
- }
2868
- const existingValues = this.params.get(name);
2869
- if (existingValues) {
2870
- existingValues.push(value);
2871
- }
2872
- }
2873
- delete(name) {
2874
- this.params.delete(name);
2875
- }
2876
- get(name) {
2877
- const values = this.params.get(name);
2878
- return values && values.length > 0 ? values[0] : null;
2879
- }
2880
- getAll(name) {
2881
- return this.params.get(name) || [];
2882
- }
2883
- has(name) {
2884
- return this.params.has(name);
2885
- }
2886
- set(name, value) {
2887
- this.params.set(name, [value]);
2888
- }
2889
- toString() {
2890
- const pairs = [];
2891
- this.params.forEach((values, key) => {
2892
- for (const value of values) {
2893
- pairs.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`);
2894
- }
2895
- });
2896
- return pairs.join("&");
2897
- }
2898
- forEach(callback) {
2899
- this.params.forEach((values, key) => {
2900
- for (const value of values) {
2901
- callback(value, key);
2902
- }
2903
- });
2904
- }
2905
- }
2906
- function createURLSearchParams(init) {
2907
- if (typeof URLSearchParams !== "undefined") {
2908
- return new URLSearchParams(init);
2909
- }
2910
- return new SimpleURLSearchParams(init);
2911
- }
2912
- function createSearchParams(params) {
2913
- const searchParams = createURLSearchParams(void 0);
2914
- for (const [key, value] of Object.entries(params)) {
2915
- if (value !== void 0 && value !== null) {
2916
- searchParams.append(key, String(value));
2917
- }
2918
- }
2919
- return searchParams;
2920
- }
2921
- function searchParamsToString(params) {
2922
- return params.toString();
2923
- }
2924
- function parseSearchParams(queryString) {
2925
- const params = createURLSearchParams(queryString);
2926
- const result = {};
2927
- params.forEach((value, key) => {
2928
- result[key] = value;
2929
- });
2930
- return result;
2931
- }
2932
- return urlParams;
2933
- }
2934
- var asyncHelpers = {};
2935
- var hasRequiredAsyncHelpers;
2936
- function requireAsyncHelpers() {
2937
- if (hasRequiredAsyncHelpers) return asyncHelpers;
2938
- hasRequiredAsyncHelpers = 1;
2939
- Object.defineProperty(asyncHelpers, "__esModule", { value: true });
2940
- asyncHelpers.debounceAsync = asyncHelpers.clearExpiredCache = asyncHelpers.withCache = asyncHelpers.withTimeout = asyncHelpers.safeParallel = asyncHelpers.withLoadingState = asyncHelpers.safeAsync = void 0;
2941
- const logger_1 = requireLogger();
2942
- const safeAsync = async (operation, context) => {
2943
- try {
2944
- const data = await operation();
2945
- return { data, success: true };
2946
- } catch (error) {
2947
- const errorObj = error instanceof Error ? error : new Error(String(error));
2948
- logger_1.logger.error(`Async operation failed: ${errorObj.message}`, context, error);
2949
- return { error: errorObj, success: false };
2950
- }
2951
- };
2952
- asyncHelpers.safeAsync = safeAsync;
2953
- const withLoadingState = async (operation, setLoading, setError, context) => {
2954
- setLoading(true);
2955
- setError(null);
2956
- try {
2957
- const result = await operation();
2958
- return result;
2959
- } catch (error) {
2960
- const errorMessage = error instanceof Error ? error.message : String(error);
2961
- setError(errorMessage);
2962
- logger_1.logger.error(`Operation failed: ${errorMessage}`, context, error);
2963
- return void 0;
2964
- } finally {
2965
- setLoading(false);
2966
- }
2967
- };
2968
- asyncHelpers.withLoadingState = withLoadingState;
2969
- const safeParallel = async (operations, context) => {
2970
- try {
2971
- const results = await Promise.all(operations.map((op) => op()));
2972
- return { data: results, success: true };
2973
- } catch (error) {
2974
- const errorObj = error instanceof Error ? error : new Error(String(error));
2975
- logger_1.logger.error(`Parallel operations failed: ${errorObj.message}`, context, error);
2976
- return { error: errorObj, success: false };
2977
- }
2978
- };
2979
- asyncHelpers.safeParallel = safeParallel;
2980
- const withTimeout = async (operation, timeoutMs, context) => {
2981
- const timeoutPromise = new Promise((_, reject) => setTimeout(() => reject(new Error(`Operation timed out after ${timeoutMs}ms`)), timeoutMs));
2982
- try {
2983
- return await Promise.race([operation(), timeoutPromise]);
2984
- } catch (error) {
2985
- logger_1.logger.error(`Timeout operation failed`, context, error);
2986
- throw error;
2987
- }
2988
- };
2989
- asyncHelpers.withTimeout = withTimeout;
2990
- const cache = /* @__PURE__ */ new Map();
2991
- const withCache = async (key, operation, ttlMs = 5 * 60 * 1e3) => {
2992
- const cached = cache.get(key);
2993
- const now = Date.now();
2994
- if (cached && now - cached.timestamp < cached.ttl) {
2995
- return cached.data;
2996
- }
2997
- const result = await operation();
2998
- cache.set(key, { data: result, timestamp: now, ttl: ttlMs });
2999
- return result;
3000
- };
3001
- asyncHelpers.withCache = withCache;
3002
- const clearExpiredCache = () => {
3003
- const now = Date.now();
3004
- for (const [key, entry] of cache.entries()) {
3005
- if (now - entry.timestamp >= entry.ttl) {
3006
- cache.delete(key);
3007
- }
3008
- }
3009
- };
3010
- asyncHelpers.clearExpiredCache = clearExpiredCache;
3011
- const debounceMap = /* @__PURE__ */ new Map();
3012
- const debounceAsync = (fn, delay, key) => {
3013
- return (...args) => {
3014
- return new Promise((resolve) => {
3015
- const existingTimeout = debounceMap.get(key);
3016
- if (existingTimeout) {
3017
- clearTimeout(existingTimeout);
3018
- }
3019
- const timeout = setTimeout(async () => {
3020
- debounceMap.delete(key);
3021
- try {
3022
- const result = await fn(...args);
3023
- resolve(result);
3024
- } catch (error) {
3025
- logger_1.logger.error(`Debounced operation failed`, key, error);
3026
- resolve(void 0);
3027
- }
3028
- }, delay);
3029
- debounceMap.set(key, timeout);
3030
- });
3031
- };
3032
- };
3033
- asyncHelpers.debounceAsync = debounceAsync;
3034
- return asyncHelpers;
3035
- }
3036
- var hasRequiredDist;
3037
- function requireDist() {
3038
- if (hasRequiredDist) return dist;
3039
- hasRequiredDist = 1;
3040
- (function(exports$1) {
3041
- /**
3042
- * @johnqh/types - Common TypeScript types for Web3 email projects
3043
- *
3044
- * This package contains all shared TypeScript definitions used across
3045
- * Web3 email applications including business logic types, blockchain
3046
- * types, configuration interfaces, infrastructure types, and utility functions.
3047
- *
3048
- * @version 1.0.0
3049
- * @license MIT
3050
- */
3051
- Object.defineProperty(exports$1, "__esModule", { value: true });
3052
- exports$1.EntityRole = exports$1.EntityType = exports$1.NONE_ENTITLEMENT = exports$1.ALL_PERIODS = exports$1.PERIOD_RANKS = exports$1.RateLimitPeriodType = exports$1.WalletType = exports$1.NetworkError = exports$1.ProcessedEventName = exports$1.ContractType = exports$1.AnalyticsEventBuilder = exports$1.AnalyticsEvent = exports$1.StorageType = exports$1.validateMessage = exports$1.validateDomain = exports$1.validateAmount = exports$1.validateAddress = exports$1.isSolanaRecipient = exports$1.isSolanaAddress = exports$1.isEvmRecipient = exports$1.isEvmAddress = exports$1.TransactionStatus = exports$1.PROTOCOL_CONSTANTS = exports$1.MessageType = exports$1.isWalletVerified = exports$1.isWalletConnected = exports$1.getWalletConnectionState = exports$1.Theme = exports$1.SubscriptionAction = exports$1.SortOrder = exports$1.RequestStatus = exports$1.PlatformType = exports$1.NotificationType = exports$1.MobileView = exports$1.MediumView = exports$1.InfoType = exports$1.FontSize = exports$1.FeatureFlag = exports$1.ErrorType = exports$1.EmailValidationState = exports$1.EmailSortCriteria = exports$1.EmailComposeType = exports$1.EmailAddressType = exports$1.EmailAction = exports$1.Currency = exports$1.ConnectionType = exports$1.ConnectionState = exports$1.ChainType = exports$1.Chain = exports$1.AuthStatus = void 0;
3053
- exports$1.isAuthStatusConnected = exports$1.isAuthExpired = exports$1.getAuthStatusText = exports$1.generateNonce = exports$1.generateAuthMessage = exports$1.extractNonceFromMessage = exports$1.canAccessProtectedFeatures = exports$1.validateEventArgs = exports$1.normalizeAddress = exports$1.isZeroAddress = exports$1.isTestNet = exports$1.formatBigInt = exports$1.createUserMultiChainId = exports$1.createMultiChainId = exports$1.createDelegationId = exports$1.createChainStatsId = exports$1.parseEmailAddress = exports$1.isValidWalletAddress = exports$1.isValidSignature = exports$1.isSNSName = exports$1.isENSName = exports$1.getChainDisplayName = exports$1.getAddressType = exports$1.formatWalletAddress = exports$1.AddressType = exports$1.validateArray = exports$1.parseJson = exports$1.optional = exports$1.isValidDate = exports$1.isUrl = exports$1.isSuccessResponse = exports$1.isString = exports$1.isObject = exports$1.isNumber = exports$1.isNullish = exports$1.isErrorResponse = exports$1.isEmail = exports$1.isBoolean = exports$1.isArray = exports$1.isApiResponse = exports$1.hasRequiredProperties = exports$1.createValidator = exports$1.createAssertion = exports$1.Web3UsernameValidator = exports$1.hasPermission = exports$1.getPermissionsForRole = exports$1.MEMBER_PERMISSIONS = exports$1.MANAGER_PERMISSIONS = exports$1.OWNER_PERMISSIONS = exports$1.InvitationStatus = void 0;
3054
- exports$1.LogLevel = exports$1.STATUS_VALUES = exports$1.Z_INDEX = exports$1.ANIMATION = exports$1.NETWORK_IDS = exports$1.WALLET_NAMES = exports$1.CONTACT_INFO = exports$1.ROUTES = exports$1.SUCCESS_MESSAGES = exports$1.ERROR_MESSAGES = exports$1.TIME_FORMAT = exports$1.SUBSCRIPTION_TIERS = exports$1.EMAIL_CONFIG = exports$1.STORAGE_KEYS = exports$1.CHAIN_TYPE = exports$1.AUTH_STATUS = exports$1.API_RETRY_DELAY = exports$1.API_RETRY_ATTEMPTS = exports$1.API_TIMEOUT = exports$1.truncate = exports$1.toTitleCase = exports$1.toSnakeCase = exports$1.toKebabCase = exports$1.toCamelCase = exports$1.stripHtml = exports$1.randomString = exports$1.pluralize = exports$1.normalizeWhitespace = exports$1.isNotBlank = exports$1.isBlank = exports$1.getInitials = exports$1.formatNumber = exports$1.formatBytes = exports$1.escapeHtml = exports$1.capitalize = exports$1.parseDate = exports$1.isDateInRange = exports$1.formatTimestamp = exports$1.formatRelativeTime = exports$1.formatEmailDate = exports$1.addHours = exports$1.addDays = exports$1.parseUSDC = exports$1.formatUSDC = exports$1.USDC_DECIMALS = exports$1.CLAIM_PERIOD_DAYS = exports$1.createAdminChecker = exports$1.isAdminEmail = exports$1.parseAdminEmails = exports$1.isValidNonce = void 0;
3055
- exports$1.debounceAsync = exports$1.clearExpiredCache = exports$1.withCache = exports$1.withTimeout = exports$1.safeParallel = exports$1.withLoadingState = exports$1.safeAsync = exports$1.parseSearchParams = exports$1.searchParamsToString = exports$1.createSearchParams = exports$1.createURLSearchParams = exports$1.storageLogger = exports$1.ensLogger = exports$1.contractLogger = exports$1.apiLogger = exports$1.authLogger = exports$1.logger = void 0;
3056
- var enums_1 = requireEnums();
3057
- Object.defineProperty(exports$1, "AuthStatus", { enumerable: true, get: function() {
3058
- return enums_1.AuthStatus;
3059
- } });
3060
- Object.defineProperty(exports$1, "Chain", { enumerable: true, get: function() {
3061
- return enums_1.Chain;
3062
- } });
3063
- Object.defineProperty(exports$1, "ChainType", { enumerable: true, get: function() {
3064
- return enums_1.ChainType;
3065
- } });
3066
- Object.defineProperty(exports$1, "ConnectionState", { enumerable: true, get: function() {
3067
- return enums_1.ConnectionState;
3068
- } });
3069
- Object.defineProperty(exports$1, "ConnectionType", { enumerable: true, get: function() {
3070
- return enums_1.ConnectionType;
3071
- } });
3072
- Object.defineProperty(exports$1, "Currency", { enumerable: true, get: function() {
3073
- return enums_1.Currency;
3074
- } });
3075
- Object.defineProperty(exports$1, "EmailAction", { enumerable: true, get: function() {
3076
- return enums_1.EmailAction;
3077
- } });
3078
- Object.defineProperty(exports$1, "EmailAddressType", { enumerable: true, get: function() {
3079
- return enums_1.EmailAddressType;
3080
- } });
3081
- Object.defineProperty(exports$1, "EmailComposeType", { enumerable: true, get: function() {
3082
- return enums_1.EmailComposeType;
3083
- } });
3084
- Object.defineProperty(exports$1, "EmailSortCriteria", { enumerable: true, get: function() {
3085
- return enums_1.EmailSortCriteria;
3086
- } });
3087
- Object.defineProperty(exports$1, "EmailValidationState", { enumerable: true, get: function() {
3088
- return enums_1.EmailValidationState;
3089
- } });
3090
- Object.defineProperty(exports$1, "ErrorType", { enumerable: true, get: function() {
3091
- return enums_1.ErrorType;
3092
- } });
3093
- Object.defineProperty(exports$1, "FeatureFlag", { enumerable: true, get: function() {
3094
- return enums_1.FeatureFlag;
3095
- } });
3096
- Object.defineProperty(exports$1, "FontSize", { enumerable: true, get: function() {
3097
- return enums_1.FontSize;
3098
- } });
3099
- Object.defineProperty(exports$1, "InfoType", { enumerable: true, get: function() {
3100
- return enums_1.InfoType;
3101
- } });
3102
- Object.defineProperty(exports$1, "MediumView", { enumerable: true, get: function() {
3103
- return enums_1.MediumView;
3104
- } });
3105
- Object.defineProperty(exports$1, "MobileView", { enumerable: true, get: function() {
3106
- return enums_1.MobileView;
3107
- } });
3108
- Object.defineProperty(exports$1, "NotificationType", { enumerable: true, get: function() {
3109
- return enums_1.NotificationType;
3110
- } });
3111
- Object.defineProperty(exports$1, "PlatformType", { enumerable: true, get: function() {
3112
- return enums_1.PlatformType;
3113
- } });
3114
- Object.defineProperty(exports$1, "RequestStatus", { enumerable: true, get: function() {
3115
- return enums_1.RequestStatus;
3116
- } });
3117
- Object.defineProperty(exports$1, "SortOrder", { enumerable: true, get: function() {
3118
- return enums_1.SortOrder;
3119
- } });
3120
- Object.defineProperty(exports$1, "SubscriptionAction", { enumerable: true, get: function() {
3121
- return enums_1.SubscriptionAction;
3122
- } });
3123
- Object.defineProperty(exports$1, "Theme", { enumerable: true, get: function() {
3124
- return enums_1.Theme;
3125
- } });
3126
- var wallet_status_1 = requireWalletStatus();
3127
- Object.defineProperty(exports$1, "getWalletConnectionState", { enumerable: true, get: function() {
3128
- return wallet_status_1.getWalletConnectionState;
3129
- } });
3130
- Object.defineProperty(exports$1, "isWalletConnected", { enumerable: true, get: function() {
3131
- return wallet_status_1.isWalletConnected;
3132
- } });
3133
- Object.defineProperty(exports$1, "isWalletVerified", { enumerable: true, get: function() {
3134
- return wallet_status_1.isWalletVerified;
3135
- } });
3136
- var common_1 = requireCommon();
3137
- Object.defineProperty(exports$1, "MessageType", { enumerable: true, get: function() {
3138
- return common_1.MessageType;
3139
- } });
3140
- Object.defineProperty(exports$1, "PROTOCOL_CONSTANTS", { enumerable: true, get: function() {
3141
- return common_1.PROTOCOL_CONSTANTS;
3142
- } });
3143
- Object.defineProperty(exports$1, "TransactionStatus", { enumerable: true, get: function() {
3144
- return common_1.TransactionStatus;
3145
- } });
3146
- Object.defineProperty(exports$1, "isEvmAddress", { enumerable: true, get: function() {
3147
- return common_1.isEvmAddress;
3148
- } });
3149
- Object.defineProperty(exports$1, "isEvmRecipient", { enumerable: true, get: function() {
3150
- return common_1.isEvmRecipient;
3151
- } });
3152
- Object.defineProperty(exports$1, "isSolanaAddress", { enumerable: true, get: function() {
3153
- return common_1.isSolanaAddress;
3154
- } });
3155
- Object.defineProperty(exports$1, "isSolanaRecipient", { enumerable: true, get: function() {
3156
- return common_1.isSolanaRecipient;
3157
- } });
3158
- var validation_1 = requireValidation();
3159
- Object.defineProperty(exports$1, "validateAddress", { enumerable: true, get: function() {
3160
- return validation_1.validateAddress;
3161
- } });
3162
- Object.defineProperty(exports$1, "validateAmount", { enumerable: true, get: function() {
3163
- return validation_1.validateAmount;
3164
- } });
3165
- Object.defineProperty(exports$1, "validateDomain", { enumerable: true, get: function() {
3166
- return validation_1.validateDomain;
3167
- } });
3168
- Object.defineProperty(exports$1, "validateMessage", { enumerable: true, get: function() {
3169
- return validation_1.validateMessage;
3170
- } });
3171
- var environment_1 = requireEnvironment();
3172
- Object.defineProperty(exports$1, "StorageType", { enumerable: true, get: function() {
3173
- return environment_1.StorageType;
3174
- } });
3175
- var analytics_1 = requireAnalytics();
3176
- Object.defineProperty(exports$1, "AnalyticsEvent", { enumerable: true, get: function() {
3177
- return analytics_1.AnalyticsEvent;
3178
- } });
3179
- Object.defineProperty(exports$1, "AnalyticsEventBuilder", { enumerable: true, get: function() {
3180
- return analytics_1.AnalyticsEventBuilder;
3181
- } });
3182
- var api_1 = requireApi();
3183
- Object.defineProperty(exports$1, "ContractType", { enumerable: true, get: function() {
3184
- return api_1.ContractType;
3185
- } });
3186
- Object.defineProperty(exports$1, "ProcessedEventName", { enumerable: true, get: function() {
3187
- return api_1.ProcessedEventName;
3188
- } });
3189
- var network_1 = requireNetwork();
3190
- Object.defineProperty(exports$1, "NetworkError", { enumerable: true, get: function() {
3191
- return network_1.NetworkError;
3192
- } });
3193
- var wallet_1 = requireWallet();
3194
- Object.defineProperty(exports$1, "WalletType", { enumerable: true, get: function() {
3195
- return wallet_1.WalletType;
3196
- } });
3197
- var rate_limits_1 = requireRateLimits();
3198
- Object.defineProperty(exports$1, "RateLimitPeriodType", { enumerable: true, get: function() {
3199
- return rate_limits_1.RateLimitPeriodType;
3200
- } });
3201
- var period_1 = requirePeriod();
3202
- Object.defineProperty(exports$1, "PERIOD_RANKS", { enumerable: true, get: function() {
3203
- return period_1.PERIOD_RANKS;
3204
- } });
3205
- Object.defineProperty(exports$1, "ALL_PERIODS", { enumerable: true, get: function() {
3206
- return period_1.ALL_PERIODS;
3207
- } });
3208
- var entitlements_1 = requireEntitlements();
3209
- Object.defineProperty(exports$1, "NONE_ENTITLEMENT", { enumerable: true, get: function() {
3210
- return entitlements_1.NONE_ENTITLEMENT;
3211
- } });
3212
- var entity_1 = requireEntity();
3213
- Object.defineProperty(exports$1, "EntityType", { enumerable: true, get: function() {
3214
- return entity_1.EntityType;
3215
- } });
3216
- Object.defineProperty(exports$1, "EntityRole", { enumerable: true, get: function() {
3217
- return entity_1.EntityRole;
3218
- } });
3219
- Object.defineProperty(exports$1, "InvitationStatus", { enumerable: true, get: function() {
3220
- return entity_1.InvitationStatus;
3221
- } });
3222
- var permissions_1 = requirePermissions();
3223
- Object.defineProperty(exports$1, "OWNER_PERMISSIONS", { enumerable: true, get: function() {
3224
- return permissions_1.OWNER_PERMISSIONS;
3225
- } });
3226
- Object.defineProperty(exports$1, "MANAGER_PERMISSIONS", { enumerable: true, get: function() {
3227
- return permissions_1.MANAGER_PERMISSIONS;
3228
- } });
3229
- Object.defineProperty(exports$1, "MEMBER_PERMISSIONS", { enumerable: true, get: function() {
3230
- return permissions_1.MEMBER_PERMISSIONS;
3231
- } });
3232
- Object.defineProperty(exports$1, "getPermissionsForRole", { enumerable: true, get: function() {
3233
- return permissions_1.getPermissionsForRole;
3234
- } });
3235
- Object.defineProperty(exports$1, "hasPermission", { enumerable: true, get: function() {
3236
- return permissions_1.hasPermission;
3237
- } });
3238
- var web3_username_validator_1 = requireWeb3UsernameValidator();
3239
- Object.defineProperty(exports$1, "Web3UsernameValidator", { enumerable: true, get: function() {
3240
- return web3_username_validator_1.Web3UsernameValidator;
3241
- } });
3242
- var type_validation_1 = requireTypeValidation();
3243
- Object.defineProperty(exports$1, "createAssertion", { enumerable: true, get: function() {
3244
- return type_validation_1.createAssertion;
3245
- } });
3246
- Object.defineProperty(exports$1, "createValidator", { enumerable: true, get: function() {
3247
- return type_validation_1.createValidator;
3248
- } });
3249
- Object.defineProperty(exports$1, "hasRequiredProperties", { enumerable: true, get: function() {
3250
- return type_validation_1.hasRequiredProperties;
3251
- } });
3252
- Object.defineProperty(exports$1, "isApiResponse", { enumerable: true, get: function() {
3253
- return type_validation_1.isApiResponse;
3254
- } });
3255
- Object.defineProperty(exports$1, "isArray", { enumerable: true, get: function() {
3256
- return type_validation_1.isArray;
3257
- } });
3258
- Object.defineProperty(exports$1, "isBoolean", { enumerable: true, get: function() {
3259
- return type_validation_1.isBoolean;
3260
- } });
3261
- Object.defineProperty(exports$1, "isEmail", { enumerable: true, get: function() {
3262
- return type_validation_1.isEmail;
3263
- } });
3264
- Object.defineProperty(exports$1, "isErrorResponse", { enumerable: true, get: function() {
3265
- return type_validation_1.isErrorResponse;
3266
- } });
3267
- Object.defineProperty(exports$1, "isNullish", { enumerable: true, get: function() {
3268
- return type_validation_1.isNullish;
3269
- } });
3270
- Object.defineProperty(exports$1, "isNumber", { enumerable: true, get: function() {
3271
- return type_validation_1.isNumber;
3272
- } });
3273
- Object.defineProperty(exports$1, "isObject", { enumerable: true, get: function() {
3274
- return type_validation_1.isObject;
3275
- } });
3276
- Object.defineProperty(exports$1, "isString", { enumerable: true, get: function() {
3277
- return type_validation_1.isString;
3278
- } });
3279
- Object.defineProperty(exports$1, "isSuccessResponse", { enumerable: true, get: function() {
3280
- return type_validation_1.isSuccessResponse;
3281
- } });
3282
- Object.defineProperty(exports$1, "isUrl", { enumerable: true, get: function() {
3283
- return type_validation_1.isUrl;
3284
- } });
3285
- Object.defineProperty(exports$1, "isValidDate", { enumerable: true, get: function() {
3286
- return type_validation_1.isValidDate;
3287
- } });
3288
- Object.defineProperty(exports$1, "optional", { enumerable: true, get: function() {
3289
- return type_validation_1.optional;
3290
- } });
3291
- Object.defineProperty(exports$1, "parseJson", { enumerable: true, get: function() {
3292
- return type_validation_1.parseJson;
3293
- } });
3294
- Object.defineProperty(exports$1, "validateArray", { enumerable: true, get: function() {
3295
- return type_validation_1.validateArray;
3296
- } });
3297
- var address_1 = requireAddress();
3298
- Object.defineProperty(exports$1, "AddressType", { enumerable: true, get: function() {
3299
- return address_1.AddressType;
3300
- } });
3301
- Object.defineProperty(exports$1, "formatWalletAddress", { enumerable: true, get: function() {
3302
- return address_1.formatWalletAddress;
3303
- } });
3304
- Object.defineProperty(exports$1, "getAddressType", { enumerable: true, get: function() {
3305
- return address_1.getAddressType;
3306
- } });
3307
- Object.defineProperty(exports$1, "getChainDisplayName", { enumerable: true, get: function() {
3308
- return address_1.getChainDisplayName;
3309
- } });
3310
- Object.defineProperty(exports$1, "isENSName", { enumerable: true, get: function() {
3311
- return address_1.isENSName;
3312
- } });
3313
- Object.defineProperty(exports$1, "isSNSName", { enumerable: true, get: function() {
3314
- return address_1.isSNSName;
3315
- } });
3316
- Object.defineProperty(exports$1, "isValidSignature", { enumerable: true, get: function() {
3317
- return address_1.isValidSignature;
3318
- } });
3319
- Object.defineProperty(exports$1, "isValidWalletAddress", { enumerable: true, get: function() {
3320
- return address_1.isValidWalletAddress;
3321
- } });
3322
- Object.defineProperty(exports$1, "parseEmailAddress", { enumerable: true, get: function() {
3323
- return address_1.parseEmailAddress;
3324
- } });
3325
- var event_helpers_1 = requireEventHelpers();
3326
- Object.defineProperty(exports$1, "createChainStatsId", { enumerable: true, get: function() {
3327
- return event_helpers_1.createChainStatsId;
3328
- } });
3329
- Object.defineProperty(exports$1, "createDelegationId", { enumerable: true, get: function() {
3330
- return event_helpers_1.createDelegationId;
3331
- } });
3332
- Object.defineProperty(exports$1, "createMultiChainId", { enumerable: true, get: function() {
3333
- return event_helpers_1.createMultiChainId;
3334
- } });
3335
- Object.defineProperty(exports$1, "createUserMultiChainId", { enumerable: true, get: function() {
3336
- return event_helpers_1.createUserMultiChainId;
3337
- } });
3338
- Object.defineProperty(exports$1, "formatBigInt", { enumerable: true, get: function() {
3339
- return event_helpers_1.formatBigInt;
3340
- } });
3341
- Object.defineProperty(exports$1, "isTestNet", { enumerable: true, get: function() {
3342
- return event_helpers_1.isTestNet;
3343
- } });
3344
- Object.defineProperty(exports$1, "isZeroAddress", { enumerable: true, get: function() {
3345
- return event_helpers_1.isZeroAddress;
3346
- } });
3347
- Object.defineProperty(exports$1, "normalizeAddress", { enumerable: true, get: function() {
3348
- return event_helpers_1.normalizeAddress;
3349
- } });
3350
- Object.defineProperty(exports$1, "validateEventArgs", { enumerable: true, get: function() {
3351
- return event_helpers_1.validateEventArgs;
3352
- } });
3353
- var auth_1 = requireAuth();
3354
- Object.defineProperty(exports$1, "canAccessProtectedFeatures", { enumerable: true, get: function() {
3355
- return auth_1.canAccessProtectedFeatures;
3356
- } });
3357
- Object.defineProperty(exports$1, "extractNonceFromMessage", { enumerable: true, get: function() {
3358
- return auth_1.extractNonceFromMessage;
3359
- } });
3360
- Object.defineProperty(exports$1, "generateAuthMessage", { enumerable: true, get: function() {
3361
- return auth_1.generateAuthMessage;
3362
- } });
3363
- Object.defineProperty(exports$1, "generateNonce", { enumerable: true, get: function() {
3364
- return auth_1.generateNonce;
3365
- } });
3366
- Object.defineProperty(exports$1, "getAuthStatusText", { enumerable: true, get: function() {
3367
- return auth_1.getAuthStatusText;
3368
- } });
3369
- Object.defineProperty(exports$1, "isAuthExpired", { enumerable: true, get: function() {
3370
- return auth_1.isAuthExpired;
3371
- } });
3372
- Object.defineProperty(exports$1, "isAuthStatusConnected", { enumerable: true, get: function() {
3373
- return auth_1.isAuthStatusConnected;
3374
- } });
3375
- Object.defineProperty(exports$1, "isValidNonce", { enumerable: true, get: function() {
3376
- return auth_1.isValidNonce;
3377
- } });
3378
- var admin_emails_1 = requireAdminEmails();
3379
- Object.defineProperty(exports$1, "parseAdminEmails", { enumerable: true, get: function() {
3380
- return admin_emails_1.parseAdminEmails;
3381
- } });
3382
- Object.defineProperty(exports$1, "isAdminEmail", { enumerable: true, get: function() {
3383
- return admin_emails_1.isAdminEmail;
3384
- } });
3385
- Object.defineProperty(exports$1, "createAdminChecker", { enumerable: true, get: function() {
3386
- return admin_emails_1.createAdminChecker;
3387
- } });
3388
- var currency_1 = requireCurrency();
3389
- Object.defineProperty(exports$1, "CLAIM_PERIOD_DAYS", { enumerable: true, get: function() {
3390
- return currency_1.CLAIM_PERIOD_DAYS;
3391
- } });
3392
- Object.defineProperty(exports$1, "USDC_DECIMALS", { enumerable: true, get: function() {
3393
- return currency_1.USDC_DECIMALS;
3394
- } });
3395
- Object.defineProperty(exports$1, "formatUSDC", { enumerable: true, get: function() {
3396
- return currency_1.formatUSDC;
3397
- } });
3398
- Object.defineProperty(exports$1, "parseUSDC", { enumerable: true, get: function() {
3399
- return currency_1.parseUSDC;
3400
- } });
3401
- var date_1 = requireDate();
3402
- Object.defineProperty(exports$1, "addDays", { enumerable: true, get: function() {
3403
- return date_1.addDays;
3404
- } });
3405
- Object.defineProperty(exports$1, "addHours", { enumerable: true, get: function() {
3406
- return date_1.addHours;
3407
- } });
3408
- Object.defineProperty(exports$1, "formatEmailDate", { enumerable: true, get: function() {
3409
- return date_1.formatEmailDate;
3410
- } });
3411
- Object.defineProperty(exports$1, "formatRelativeTime", { enumerable: true, get: function() {
3412
- return date_1.formatRelativeTime;
3413
- } });
3414
- Object.defineProperty(exports$1, "formatTimestamp", { enumerable: true, get: function() {
3415
- return date_1.formatTimestamp;
3416
- } });
3417
- Object.defineProperty(exports$1, "isDateInRange", { enumerable: true, get: function() {
3418
- return date_1.isDateInRange;
3419
- } });
3420
- Object.defineProperty(exports$1, "parseDate", { enumerable: true, get: function() {
3421
- return date_1.parseDate;
3422
- } });
3423
- var string_1 = requireString();
3424
- Object.defineProperty(exports$1, "capitalize", { enumerable: true, get: function() {
3425
- return string_1.capitalize;
3426
- } });
3427
- Object.defineProperty(exports$1, "escapeHtml", { enumerable: true, get: function() {
3428
- return string_1.escapeHtml;
3429
- } });
3430
- Object.defineProperty(exports$1, "formatBytes", { enumerable: true, get: function() {
3431
- return string_1.formatBytes;
3432
- } });
3433
- Object.defineProperty(exports$1, "formatNumber", { enumerable: true, get: function() {
3434
- return string_1.formatNumber;
3435
- } });
3436
- Object.defineProperty(exports$1, "getInitials", { enumerable: true, get: function() {
3437
- return string_1.getInitials;
3438
- } });
3439
- Object.defineProperty(exports$1, "isBlank", { enumerable: true, get: function() {
3440
- return string_1.isBlank;
3441
- } });
3442
- Object.defineProperty(exports$1, "isNotBlank", { enumerable: true, get: function() {
3443
- return string_1.isNotBlank;
3444
- } });
3445
- Object.defineProperty(exports$1, "normalizeWhitespace", { enumerable: true, get: function() {
3446
- return string_1.normalizeWhitespace;
3447
- } });
3448
- Object.defineProperty(exports$1, "pluralize", { enumerable: true, get: function() {
3449
- return string_1.pluralize;
3450
- } });
3451
- Object.defineProperty(exports$1, "randomString", { enumerable: true, get: function() {
3452
- return string_1.randomString;
3453
- } });
3454
- Object.defineProperty(exports$1, "stripHtml", { enumerable: true, get: function() {
3455
- return string_1.stripHtml;
3456
- } });
3457
- Object.defineProperty(exports$1, "toCamelCase", { enumerable: true, get: function() {
3458
- return string_1.toCamelCase;
3459
- } });
3460
- Object.defineProperty(exports$1, "toKebabCase", { enumerable: true, get: function() {
3461
- return string_1.toKebabCase;
3462
- } });
3463
- Object.defineProperty(exports$1, "toSnakeCase", { enumerable: true, get: function() {
3464
- return string_1.toSnakeCase;
3465
- } });
3466
- Object.defineProperty(exports$1, "toTitleCase", { enumerable: true, get: function() {
3467
- return string_1.toTitleCase;
3468
- } });
3469
- Object.defineProperty(exports$1, "truncate", { enumerable: true, get: function() {
3470
- return string_1.truncate;
3471
- } });
3472
- var application_1 = requireApplication();
3473
- Object.defineProperty(exports$1, "API_TIMEOUT", { enumerable: true, get: function() {
3474
- return application_1.API_TIMEOUT;
3475
- } });
3476
- Object.defineProperty(exports$1, "API_RETRY_ATTEMPTS", { enumerable: true, get: function() {
3477
- return application_1.API_RETRY_ATTEMPTS;
3478
- } });
3479
- Object.defineProperty(exports$1, "API_RETRY_DELAY", { enumerable: true, get: function() {
3480
- return application_1.API_RETRY_DELAY;
3481
- } });
3482
- Object.defineProperty(exports$1, "AUTH_STATUS", { enumerable: true, get: function() {
3483
- return application_1.AUTH_STATUS;
3484
- } });
3485
- Object.defineProperty(exports$1, "CHAIN_TYPE", { enumerable: true, get: function() {
3486
- return application_1.CHAIN_TYPE;
3487
- } });
3488
- Object.defineProperty(exports$1, "STORAGE_KEYS", { enumerable: true, get: function() {
3489
- return application_1.STORAGE_KEYS;
3490
- } });
3491
- Object.defineProperty(exports$1, "EMAIL_CONFIG", { enumerable: true, get: function() {
3492
- return application_1.EMAIL_CONFIG;
3493
- } });
3494
- Object.defineProperty(exports$1, "SUBSCRIPTION_TIERS", { enumerable: true, get: function() {
3495
- return application_1.SUBSCRIPTION_TIERS;
3496
- } });
3497
- Object.defineProperty(exports$1, "TIME_FORMAT", { enumerable: true, get: function() {
3498
- return application_1.TIME_FORMAT;
3499
- } });
3500
- Object.defineProperty(exports$1, "ERROR_MESSAGES", { enumerable: true, get: function() {
3501
- return application_1.ERROR_MESSAGES;
3502
- } });
3503
- Object.defineProperty(exports$1, "SUCCESS_MESSAGES", { enumerable: true, get: function() {
3504
- return application_1.SUCCESS_MESSAGES;
3505
- } });
3506
- Object.defineProperty(exports$1, "ROUTES", { enumerable: true, get: function() {
3507
- return application_1.ROUTES;
3508
- } });
3509
- Object.defineProperty(exports$1, "CONTACT_INFO", { enumerable: true, get: function() {
3510
- return application_1.CONTACT_INFO;
3511
- } });
3512
- Object.defineProperty(exports$1, "WALLET_NAMES", { enumerable: true, get: function() {
3513
- return application_1.WALLET_NAMES;
3514
- } });
3515
- Object.defineProperty(exports$1, "NETWORK_IDS", { enumerable: true, get: function() {
3516
- return application_1.NETWORK_IDS;
3517
- } });
3518
- Object.defineProperty(exports$1, "ANIMATION", { enumerable: true, get: function() {
3519
- return application_1.ANIMATION;
3520
- } });
3521
- Object.defineProperty(exports$1, "Z_INDEX", { enumerable: true, get: function() {
3522
- return application_1.Z_INDEX;
3523
- } });
3524
- var status_values_1 = requireStatusValues();
3525
- Object.defineProperty(exports$1, "STATUS_VALUES", { enumerable: true, get: function() {
3526
- return status_values_1.STATUS_VALUES;
3527
- } });
3528
- var logger_1 = requireLogger();
3529
- Object.defineProperty(exports$1, "LogLevel", { enumerable: true, get: function() {
3530
- return logger_1.LogLevel;
3531
- } });
3532
- Object.defineProperty(exports$1, "logger", { enumerable: true, get: function() {
3533
- return logger_1.logger;
3534
- } });
3535
- Object.defineProperty(exports$1, "authLogger", { enumerable: true, get: function() {
3536
- return logger_1.authLogger;
3537
- } });
3538
- Object.defineProperty(exports$1, "apiLogger", { enumerable: true, get: function() {
3539
- return logger_1.apiLogger;
3540
- } });
3541
- Object.defineProperty(exports$1, "contractLogger", { enumerable: true, get: function() {
3542
- return logger_1.contractLogger;
3543
- } });
3544
- Object.defineProperty(exports$1, "ensLogger", { enumerable: true, get: function() {
3545
- return logger_1.ensLogger;
3546
- } });
3547
- Object.defineProperty(exports$1, "storageLogger", { enumerable: true, get: function() {
3548
- return logger_1.storageLogger;
3549
- } });
3550
- var url_params_1 = requireUrlParams();
3551
- Object.defineProperty(exports$1, "createURLSearchParams", { enumerable: true, get: function() {
3552
- return url_params_1.createURLSearchParams;
3553
- } });
3554
- Object.defineProperty(exports$1, "createSearchParams", { enumerable: true, get: function() {
3555
- return url_params_1.createSearchParams;
3556
- } });
3557
- Object.defineProperty(exports$1, "searchParamsToString", { enumerable: true, get: function() {
3558
- return url_params_1.searchParamsToString;
3559
- } });
3560
- Object.defineProperty(exports$1, "parseSearchParams", { enumerable: true, get: function() {
3561
- return url_params_1.parseSearchParams;
3562
- } });
3563
- var async_helpers_1 = requireAsyncHelpers();
3564
- Object.defineProperty(exports$1, "safeAsync", { enumerable: true, get: function() {
3565
- return async_helpers_1.safeAsync;
3566
- } });
3567
- Object.defineProperty(exports$1, "withLoadingState", { enumerable: true, get: function() {
3568
- return async_helpers_1.withLoadingState;
3569
- } });
3570
- Object.defineProperty(exports$1, "safeParallel", { enumerable: true, get: function() {
3571
- return async_helpers_1.safeParallel;
3572
- } });
3573
- Object.defineProperty(exports$1, "withTimeout", { enumerable: true, get: function() {
3574
- return async_helpers_1.withTimeout;
3575
- } });
3576
- Object.defineProperty(exports$1, "withCache", { enumerable: true, get: function() {
3577
- return async_helpers_1.withCache;
3578
- } });
3579
- Object.defineProperty(exports$1, "clearExpiredCache", { enumerable: true, get: function() {
3580
- return async_helpers_1.clearExpiredCache;
3581
- } });
3582
- Object.defineProperty(exports$1, "debounceAsync", { enumerable: true, get: function() {
3583
- return async_helpers_1.debounceAsync;
3584
- } });
3585
- })(dist);
3586
- return dist;
3587
1342
  }
3588
- var distExports = requireDist();
1343
+ const logger = new Logger();
1344
+ logger.withContext("AUTH");
1345
+ logger.withContext("API");
1346
+ logger.withContext("CONTRACT");
1347
+ logger.withContext("ENS");
1348
+ logger.withContext("STORAGE");
3589
1349
  const variantConfig = {
3590
- [distExports.InfoType.INFO]: {
1350
+ [InfoType.INFO]: {
3591
1351
  icon: "ℹ",
3592
1352
  container: "bg-blue-50 dark:bg-blue-950 border-blue-200 dark:border-blue-800",
3593
1353
  iconColor: "text-blue-600 dark:text-blue-400",
3594
1354
  titleColor: "text-blue-900 dark:text-blue-100",
3595
1355
  descriptionColor: "text-blue-700 dark:text-blue-300"
3596
1356
  },
3597
- [distExports.InfoType.SUCCESS]: {
1357
+ [InfoType.SUCCESS]: {
3598
1358
  icon: "✓",
3599
1359
  container: "bg-green-50 dark:bg-green-950 border-green-200 dark:border-green-800",
3600
1360
  iconColor: "text-green-600 dark:text-green-400",
3601
1361
  titleColor: "text-green-900 dark:text-green-100",
3602
1362
  descriptionColor: "text-green-700 dark:text-green-300"
3603
1363
  },
3604
- [distExports.InfoType.WARNING]: {
1364
+ [InfoType.WARNING]: {
3605
1365
  icon: "⚠",
3606
1366
  container: "bg-yellow-50 dark:bg-amber-950 border-yellow-200 dark:border-amber-800",
3607
1367
  iconColor: "text-yellow-600 dark:text-amber-400",
3608
1368
  titleColor: "text-yellow-900 dark:text-amber-100",
3609
1369
  descriptionColor: "text-yellow-700 dark:text-amber-300"
3610
1370
  },
3611
- [distExports.InfoType.ERROR]: {
1371
+ [InfoType.ERROR]: {
3612
1372
  icon: "✗",
3613
1373
  container: "bg-red-50 dark:bg-red-950 border-red-200 dark:border-red-800",
3614
1374
  iconColor: "text-red-600 dark:text-red-400",
@@ -3621,7 +1381,7 @@ const Banner = ({
3621
1381
  onDismiss,
3622
1382
  title,
3623
1383
  description,
3624
- variant = distExports.InfoType.INFO,
1384
+ variant = InfoType.INFO,
3625
1385
  duration = 5e3,
3626
1386
  icon,
3627
1387
  className,
@@ -3737,7 +1497,7 @@ const useBanner = (options = {}) => {
3737
1497
  ({
3738
1498
  title,
3739
1499
  description,
3740
- variant = distExports.InfoType.INFO,
1500
+ variant = InfoType.INFO,
3741
1501
  duration = defaultDuration
3742
1502
  }) => {
3743
1503
  setBannerProps({ title, description, variant, duration });
@@ -6095,7 +3855,7 @@ const IconText = ({
6095
3855
  const FormattedNumber = ({
6096
3856
  value,
6097
3857
  style = "decimal",
6098
- currency: currency2 = "USD",
3858
+ currency = "USD",
6099
3859
  minimumFractionDigits,
6100
3860
  maximumFractionDigits,
6101
3861
  locale = "en-US",
@@ -6111,7 +3871,7 @@ const FormattedNumber = ({
6111
3871
  maximumFractionDigits
6112
3872
  };
6113
3873
  if (style === "currency") {
6114
- options.currency = currency2;
3874
+ options.currency = currency;
6115
3875
  }
6116
3876
  return new Intl.NumberFormat(locale, options).format(value);
6117
3877
  } catch (error) {
@@ -8095,23 +5855,23 @@ const Calendar = ({
8095
5855
  className
8096
5856
  }) => {
8097
5857
  const [currentMonth, setCurrentMonth] = useState(value || /* @__PURE__ */ new Date());
8098
- const getDaysInMonth = (date2) => {
8099
- const year = date2.getFullYear();
8100
- const month = date2.getMonth();
5858
+ const getDaysInMonth = (date) => {
5859
+ const year = date.getFullYear();
5860
+ const month = date.getMonth();
8101
5861
  return new Date(year, month + 1, 0).getDate();
8102
5862
  };
8103
- const getFirstDayOfMonth = (date2) => {
8104
- const year = date2.getFullYear();
8105
- const month = date2.getMonth();
5863
+ const getFirstDayOfMonth = (date) => {
5864
+ const year = date.getFullYear();
5865
+ const month = date.getMonth();
8106
5866
  return new Date(year, month, 1).getDay();
8107
5867
  };
8108
5868
  const isSameDay = (date1, date2) => {
8109
5869
  return date1.getFullYear() === date2.getFullYear() && date1.getMonth() === date2.getMonth() && date1.getDate() === date2.getDate();
8110
5870
  };
8111
- const isDateDisabled = (date2) => {
8112
- if (minDate && date2 < minDate) return true;
8113
- if (maxDate && date2 > maxDate) return true;
8114
- return disabledDates.some((disabledDate) => isSameDay(date2, disabledDate));
5871
+ const isDateDisabled = (date) => {
5872
+ if (minDate && date < minDate) return true;
5873
+ if (maxDate && date > maxDate) return true;
5874
+ return disabledDates.some((disabledDate) => isSameDay(date, disabledDate));
8115
5875
  };
8116
5876
  const goToPreviousMonth = () => {
8117
5877
  setCurrentMonth(
@@ -8152,9 +5912,9 @@ const Calendar = ({
8152
5912
  };
8153
5913
  const calendarDays = generateCalendarDays();
8154
5914
  const weekDays = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
8155
- const handleDayPress = (date2) => {
8156
- if (!date2 || isDateDisabled(date2)) return;
8157
- onChange(date2);
5915
+ const handleDayPress = (date) => {
5916
+ if (!date || isDateDisabled(date)) return;
5917
+ onChange(date);
8158
5918
  };
8159
5919
  const monthYear = currentMonth.toLocaleDateString("en-US", {
8160
5920
  month: "long",
@@ -8189,8 +5949,8 @@ const Calendar = ({
8189
5949
  )
8190
5950
  ] }),
8191
5951
  /* @__PURE__ */ jsxRuntimeExports.jsx(View, { className: "flex-row mb-2", children: weekDays.map((day) => /* @__PURE__ */ jsxRuntimeExports.jsx(View, { className: "flex-1 items-center py-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Text$1, { className: "text-xs font-medium text-gray-600 dark:text-gray-400", children: day }) }, day)) }),
8192
- weeks.map((week, weekIndex) => /* @__PURE__ */ jsxRuntimeExports.jsx(View, { className: "flex-row", children: week.map((date2, dayIndex) => {
8193
- if (!date2) {
5952
+ weeks.map((week, weekIndex) => /* @__PURE__ */ jsxRuntimeExports.jsx(View, { className: "flex-row", children: week.map((date, dayIndex) => {
5953
+ if (!date) {
8194
5954
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
8195
5955
  View,
8196
5956
  {
@@ -8199,14 +5959,14 @@ const Calendar = ({
8199
5959
  `empty-${dayIndex}`
8200
5960
  );
8201
5961
  }
8202
- const isCurrentMonth = date2.getMonth() === currentMonth.getMonth();
8203
- const isSelected = value && isSameDay(date2, value);
8204
- const isToday = isSameDay(date2, /* @__PURE__ */ new Date());
8205
- const isDisabled = isDateDisabled(date2);
5962
+ const isCurrentMonth = date.getMonth() === currentMonth.getMonth();
5963
+ const isSelected = value && isSameDay(date, value);
5964
+ const isToday = isSameDay(date, /* @__PURE__ */ new Date());
5965
+ const isDisabled = isDateDisabled(date);
8206
5966
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
8207
5967
  Pressable,
8208
5968
  {
8209
- onPress: () => handleDayPress(date2),
5969
+ onPress: () => handleDayPress(date),
8210
5970
  disabled: isDisabled,
8211
5971
  className: cn(
8212
5972
  "flex-1 aspect-square items-center justify-center rounded-md m-0.5",
@@ -8216,7 +5976,7 @@ const Calendar = ({
8216
5976
  isToday && !isSelected && "border-2 border-blue-600 dark:border-blue-400"
8217
5977
  ),
8218
5978
  accessibilityRole: "button",
8219
- accessibilityLabel: date2.toLocaleDateString(),
5979
+ accessibilityLabel: date.toLocaleDateString(),
8220
5980
  accessibilityState: {
8221
5981
  selected: isSelected,
8222
5982
  disabled: isDisabled
@@ -8229,11 +5989,11 @@ const Calendar = ({
8229
5989
  isCurrentMonth ? "text-gray-900 dark:text-white" : "text-gray-400 dark:text-gray-600",
8230
5990
  isSelected && "text-white font-semibold"
8231
5991
  ),
8232
- children: date2.getDate()
5992
+ children: date.getDate()
8233
5993
  }
8234
5994
  )
8235
5995
  },
8236
- `${date2.getTime()}-${dayIndex}`
5996
+ `${date.getTime()}-${dayIndex}`
8237
5997
  );
8238
5998
  }) }, weekIndex))
8239
5999
  ] });
@@ -8929,7 +6689,7 @@ const TimePicker = ({
8929
6689
  const [isOpen, setIsOpen] = useState(false);
8930
6690
  const [internalHour, setInternalHour] = useState("12");
8931
6691
  const [internalMinute, setInternalMinute] = useState("00");
8932
- const [period2, setPeriod] = useState("AM");
6692
+ const [period, setPeriod] = useState("AM");
8933
6693
  useEffect(() => {
8934
6694
  if (value) {
8935
6695
  const [hours, minutes] = value.split(":");
@@ -9023,7 +6783,7 @@ const TimePicker = ({
9023
6783
  handleTimeChange(
9024
6784
  hour,
9025
6785
  internalMinute,
9026
- use12Hour ? period2 : void 0
6786
+ use12Hour ? period : void 0
9027
6787
  );
9028
6788
  },
9029
6789
  className: cn(
@@ -9055,7 +6815,7 @@ const TimePicker = ({
9055
6815
  handleTimeChange(
9056
6816
  internalHour,
9057
6817
  minute,
9058
- use12Hour ? period2 : void 0
6818
+ use12Hour ? period : void 0
9059
6819
  );
9060
6820
  },
9061
6821
  className: cn(
@@ -9094,14 +6854,14 @@ const TimePicker = ({
9094
6854
  className: cn(
9095
6855
  "px-3 py-2 rounded",
9096
6856
  "active:bg-gray-100 dark:active:bg-gray-800",
9097
- period2 === "AM" && "bg-blue-100 dark:bg-blue-900/30"
6857
+ period === "AM" && "bg-blue-100 dark:bg-blue-900/30"
9098
6858
  ),
9099
6859
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
9100
6860
  Text$1,
9101
6861
  {
9102
6862
  className: cn(
9103
6863
  "text-sm text-center",
9104
- period2 === "AM" ? "text-blue-700 dark:text-blue-300 font-medium" : "text-gray-900 dark:text-white"
6864
+ period === "AM" ? "text-blue-700 dark:text-blue-300 font-medium" : "text-gray-900 dark:text-white"
9105
6865
  ),
9106
6866
  children: "AM"
9107
6867
  }
@@ -9122,14 +6882,14 @@ const TimePicker = ({
9122
6882
  className: cn(
9123
6883
  "px-3 py-2 rounded",
9124
6884
  "active:bg-gray-100 dark:active:bg-gray-800",
9125
- period2 === "PM" && "bg-blue-100 dark:bg-blue-900/30"
6885
+ period === "PM" && "bg-blue-100 dark:bg-blue-900/30"
9126
6886
  ),
9127
6887
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
9128
6888
  Text$1,
9129
6889
  {
9130
6890
  className: cn(
9131
6891
  "text-sm text-center",
9132
- period2 === "PM" ? "text-blue-700 dark:text-blue-300 font-medium" : "text-gray-900 dark:text-white"
6892
+ period === "PM" ? "text-blue-700 dark:text-blue-300 font-medium" : "text-gray-900 dark:text-white"
9133
6893
  ),
9134
6894
  children: "PM"
9135
6895
  }
@@ -9383,16 +7143,16 @@ const TreeView = ({
9383
7143
  };
9384
7144
  return /* @__PURE__ */ jsxRuntimeExports.jsx(View, { className: cn("w-full", className), children: data.map((node) => renderNode(node, 0)) });
9385
7145
  };
9386
- const getExplorerUrl = (address2, chainId, explorerUrl) => {
7146
+ const getExplorerUrl = (address, chainId, explorerUrl) => {
9387
7147
  if (explorerUrl) {
9388
- return `${explorerUrl}/address/${address2}`;
7148
+ return `${explorerUrl}/address/${address}`;
9389
7149
  }
9390
7150
  if (!chainId) {
9391
7151
  return null;
9392
7152
  }
9393
7153
  if (chainId < 0) {
9394
7154
  const cluster = chainId === -101 ? "" : chainId === -102 ? "?cluster=devnet" : "?cluster=testnet";
9395
- return `https://explorer.solana.com/address/${address2}${cluster}`;
7155
+ return `https://explorer.solana.com/address/${address}${cluster}`;
9396
7156
  }
9397
7157
  const explorerMap = {
9398
7158
  1: "https://etherscan.io",
@@ -9411,19 +7171,19 @@ const getExplorerUrl = (address2, chainId, explorerUrl) => {
9411
7171
  if (!baseUrl) {
9412
7172
  return null;
9413
7173
  }
9414
- return `${baseUrl}/address/${address2}`;
7174
+ return `${baseUrl}/address/${address}`;
9415
7175
  };
9416
- const formatAddress = (address2, format) => {
7176
+ const formatAddress = (address, format) => {
9417
7177
  if (format === "full") {
9418
- return address2;
7178
+ return address;
9419
7179
  }
9420
7180
  if (format === "medium") {
9421
- return `${address2.substring(0, 10)}...${address2.substring(address2.length - 8)}`;
7181
+ return `${address.substring(0, 10)}...${address.substring(address.length - 8)}`;
9422
7182
  }
9423
- return `${address2.substring(0, 6)}...${address2.substring(address2.length - 4)}`;
7183
+ return `${address.substring(0, 6)}...${address.substring(address.length - 4)}`;
9424
7184
  };
9425
7185
  const AddressLink = ({
9426
- address: address2,
7186
+ address,
9427
7187
  chainId,
9428
7188
  explorerUrl,
9429
7189
  label,
@@ -9434,17 +7194,17 @@ const AddressLink = ({
9434
7194
  className
9435
7195
  }) => {
9436
7196
  const [copied, setCopied] = useState(false);
9437
- const formattedAddress = formatAddress(address2, format);
9438
- const explorerLink = getExplorerUrl(address2, chainId, explorerUrl);
7197
+ const formattedAddress = formatAddress(address, format);
7198
+ const explorerLink = getExplorerUrl(address, chainId, explorerUrl);
9439
7199
  const handleCopy = useCallback(async () => {
9440
7200
  if (!onCopy) return;
9441
7201
  try {
9442
- await onCopy(address2);
7202
+ await onCopy(address);
9443
7203
  setCopied(true);
9444
7204
  setTimeout(() => setCopied(false), 2e3);
9445
7205
  } catch {
9446
7206
  }
9447
- }, [address2, onCopy]);
7207
+ }, [address, onCopy]);
9448
7208
  const handleOpenExplorer = useCallback(() => {
9449
7209
  if (explorerLink) {
9450
7210
  Linking.openURL(explorerLink);
@@ -9598,19 +7358,19 @@ const DateInput = ({
9598
7358
  lg: "py-3 px-4 text-lg"
9599
7359
  };
9600
7360
  const dateValue = value instanceof Date ? value : value ? new Date(value) : null;
9601
- const formatDisplay = (date2) => {
9602
- if (!date2) return "";
9603
- return date2.toLocaleDateString("en-US", {
7361
+ const formatDisplay = (date) => {
7362
+ if (!date) return "";
7363
+ return date.toLocaleDateString("en-US", {
9604
7364
  month: "short",
9605
7365
  day: "numeric",
9606
7366
  year: "numeric"
9607
7367
  });
9608
7368
  };
9609
7369
  const handleDateChange = useCallback(
9610
- (date2) => {
9611
- const year = date2.getFullYear();
9612
- const month = String(date2.getMonth() + 1).padStart(2, "0");
9613
- const day = String(date2.getDate()).padStart(2, "0");
7370
+ (date) => {
7371
+ const year = date.getFullYear();
7372
+ const month = String(date.getMonth() + 1).padStart(2, "0");
7373
+ const day = String(date.getDate()).padStart(2, "0");
9614
7374
  onChange(`${year}-${month}-${day}`);
9615
7375
  setIsOpen(false);
9616
7376
  },
@@ -9696,24 +7456,24 @@ const DateTimePicker = ({
9696
7456
  }) => {
9697
7457
  const [isOpen, setIsOpen] = useState(false);
9698
7458
  const [selectedDate, setSelectedDate] = useState(value);
9699
- const formatDisplay = (date2) => {
9700
- const dateStr = date2.toLocaleDateString("en-US", {
7459
+ const formatDisplay = (date) => {
7460
+ const dateStr = date.toLocaleDateString("en-US", {
9701
7461
  month: "short",
9702
7462
  day: "numeric",
9703
7463
  year: "numeric"
9704
7464
  });
9705
- const hours = date2.getHours();
9706
- const minutes = date2.getMinutes();
7465
+ const hours = date.getHours();
7466
+ const minutes = date.getMinutes();
9707
7467
  if (use12Hour) {
9708
7468
  const hour12 = hours === 0 ? 12 : hours > 12 ? hours - 12 : hours;
9709
- const period2 = hours >= 12 ? "PM" : "AM";
9710
- return `${dateStr}, ${hour12}:${minutes.toString().padStart(2, "0")} ${period2}`;
7469
+ const period = hours >= 12 ? "PM" : "AM";
7470
+ return `${dateStr}, ${hour12}:${minutes.toString().padStart(2, "0")} ${period}`;
9711
7471
  }
9712
7472
  return `${dateStr}, ${hours.toString().padStart(2, "0")}:${minutes.toString().padStart(2, "0")}`;
9713
7473
  };
9714
7474
  const handleDateChange = useCallback(
9715
- (date2) => {
9716
- const newDateTime = new Date(date2);
7475
+ (date) => {
7476
+ const newDateTime = new Date(date);
9717
7477
  newDateTime.setHours(selectedDate.getHours());
9718
7478
  newDateTime.setMinutes(selectedDate.getMinutes());
9719
7479
  setSelectedDate(newDateTime);
@@ -9730,9 +7490,9 @@ const DateTimePicker = ({
9730
7490
  },
9731
7491
  [selectedDate]
9732
7492
  );
9733
- const getTimeString = (date2) => {
9734
- const hours = date2.getHours();
9735
- const minutes = date2.getMinutes();
7493
+ const getTimeString = (date) => {
7494
+ const hours = date.getHours();
7495
+ const minutes = date.getMinutes();
9736
7496
  return `${hours.toString().padStart(2, "0")}:${minutes.toString().padStart(2, "0")}`;
9737
7497
  };
9738
7498
  const handleClose = useCallback(() => {