
Research
Supply Chain Attack on Axios Pulls Malicious Dependency from npm
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.
@johnqh/types
Advanced tools
Comprehensive TypeScript types, interfaces, and utilities for the 0xmail.box Web3 email ecosystem - optimized for AI-assisted development
Comprehensive TypeScript type definitions and utilities for the 0xmail.box Web3 email ecosystem.
This package provides a complete type-safe foundation for 0xmail.box applications, featuring:
Optional<T>, Result<T, E>, ValidationResult<T>npm install @johnqh/types
import {
Email,
User,
WalletUserData,
AuthStatus,
ChainType,
Optional
} from '@johnqh/types';
// Email handling
const email: Email = {
from: 'sender@0xmail.box',
to: 'recipient@0xmail.box',
subject: 'Web3 Email',
body: 'Hello from the blockchain!',
id: 'msg_123',
timestamp: Date.now(),
read: false
};
// User management with optional fields
const user: WalletUserData = {
walletAddress: '0x742d35Cc6634C0532925a3b8D2C36B7f12345678',
chainType: ChainType.EVM,
emails: [email],
folders: []
};
// Optional type usage
const maybeUser: Optional<User> = null; // T | undefined | null
import {
Message,
TransactionResult,
MessageType,
isEvmAddress,
isSolanaAddress
} from '@johnqh/types';
// Multi-chain message
const message: Message = {
from: '0x742d35Cc6634C0532925a3b8D2C36B7f12345678',
to: '9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM',
subject: 'Cross-chain message',
body: 'EVM to Solana communication',
timestamp: Date.now(),
txHash: '0x123abc...',
messageType: MessageType.PRIORITY
};
// Address validation
const evmValid = isEvmAddress('0x742d35Cc6634C0532925a3b8D2C36B7f12345678'); // true
const solanaValid = isSolanaAddress('9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM'); // true
import {
ApiResponse,
ValidationResult,
IndexerApiResponse,
Result
} from '@johnqh/types';
// Type-safe API responses
const apiResponse: ApiResponse<User> = {
success: true,
data: user,
timestamp: new Date().toISOString()
};
// Result pattern for error handling
const validateUser = (data: unknown): Result<User> => {
// Validation logic...
return { success: true, data: user as User };
};
import {
formatWalletAddress,
parseEmailAddress,
createMultiChainId,
Web3UsernameValidator
} from '@johnqh/types';
// Address formatting
const formatted = formatWalletAddress('0x742d35Cc6634C0532925a3b8D2C36B7f12345678');
// Result: "0x742d...5678"
// Email parsing
const parsed = parseEmailAddress('user@domain.eth');
// Result: { address: 'user', domain: 'domain.eth', type: AddressType.ENSName }
// Multi-chain ID generation
const id = createMultiChainId(1, '0x123...', 0);
// Result: "1-0x123...-0"
// Web3 username validation
const validation = Web3UsernameValidator.validate('vitalik.eth');
// Result: { name: 'vitalik.eth', address: null, chainType: ChainType.EVM }
src/
├── types/ # Type definitions by domain
│ ├── indexer/ # Indexer API request/response types
│ ├── blockchain/ # Web3 and blockchain types
│ ├── business/ # Core business logic types
│ ├── common.ts # Shared utility types (Optional<T>, Result<T>)
│ ├── config/ # Configuration types
│ └── infrastructure/ # Infrastructure abstractions
├── utils/ # Pure utility functions
│ ├── auth/ # Authentication utilities
│ ├── blockchain/ # Blockchain utilities
│ ├── constants/ # Shared constants
│ ├── formatting/ # Formatting utilities
│ ├── logging/ # Logging utilities
│ ├── url/ # URL utilities
│ └── validation/ # Validation utilities
├── wildduck-requests.ts # WildDuck email server types
└── index.ts # Main exports
# Development
npm run build # Build both ESM and CommonJS
npm run dev # Watch mode development
npm test # Run all 267 tests
npm run test:watch # Watch mode testing
npm run test:coverage # Generate coverage report
# Quality Assurance
npm run lint # ESLint checking
npm run lint:fix # Fix linting issues
npm run format # Format with Prettier
npm run typecheck # TypeScript type checking
npm run verify # Complete verification pipeline
# AI Development Tools
npm run ai:analyze # Analyze type structure
npm run ai:validate # Validate exports
npm run ai:docs # Generate AI documentation
This project is optimized for AI-assisted development with:
Email, User, WalletUserData - Core application entitiesMailBox, Folder - Email organization structuresAuthStatus, ConnectionState - Authentication statesMessage, PreparedMessage - Multi-chain messagingTransactionResult, TransactionStatus - Transaction handlingNetworkConfig, DeploymentAddresses - Network configurationOptional<T> - Null/undefined safe typingResult<T, E> - Error handling patternsValidationResult<T> - Validation patternsPaginatedResponse<T> - API paginationAnalyticsService - Analytics abstractionNetworkClient - HTTP client interfaceUINavigationService - Navigation abstractionThe package is built with strict TypeScript settings:
{
"compilerOptions": {
"strict": true,
"noUncheckedIndexedAccess": true,
"exactOptionalPropertyTypes": true
}
}
// Main exports
import { Email, User, Optional } from '@johnqh/types';
// Specific modules (tree-shakeable)
import { ChainType } from '@johnqh/types/enums';
import { ValidationResponse } from '@johnqh/types/indexer';
// Utilities
import { formatWalletAddress } from '@johnqh/types/utils';
any with unknown throughoutThis project follows strict quality standards:
MIT © 0xmail.box
Built with ❤️ for the Web3 email revolution
This package powers the type-safe foundation of 0xmail.box, the first Web3-native email platform.
FAQs
Comprehensive TypeScript types, interfaces, and utilities for the 0xmail.box Web3 email ecosystem - optimized for AI-assisted development
We found that @johnqh/types demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.

Security News
TeamPCP is partnering with ransomware group Vect to turn open source supply chain attacks on tools like Trivy and LiteLLM into large-scale ransomware operations.