Files
aitbc/dev/env/node_modules/@nomicfoundation/hardhat-utils/dist/src/eth.js
aitbc 816e258d4c refactor: move brother_node development artifact to dev/test-nodes subdirectory
Development Artifact Cleanup:
 BROTHER_NODE REORGANIZATION: Moved development test node to appropriate location
- dev/test-nodes/brother_node/: Moved from root directory for better organization
- Contains development configuration, test logs, and test chain data
- No impact on production systems - purely development/testing artifact

 DEVELOPMENT ARTIFACTS IDENTIFIED:
- Chain ID: aitbc-brother-chain (test/development chain)
- Ports: 8010 (P2P) and 8011 (RPC) - different from production
- Environment: .env file with test configuration
- Logs: rpc.log and node.log from development testing session (March 15, 2026)

 ROOT DIRECTORY CLEANUP: Removed development clutter from production directory
- brother_node/ moved to dev/test-nodes/brother_node/
- Root directory now contains only production-ready components
- Development artifacts properly organized in dev/ subdirectory

DIRECTORY STRUCTURE IMPROVEMENT:
📁 dev/test-nodes/: Development and testing node configurations
🏗️ Root Directory: Clean production structure with only essential components
🧪 Development Isolation: Test environments separated from production

BENEFITS:
 Clean Production Directory: No development artifacts in root
 Better Organization: Development nodes grouped in dev/ subdirectory
 Clear Separation: Production vs development environments clearly distinguished
 Maintainability: Easier to identify and manage development components

RESULT: Successfully moved brother_node development artifact to dev/test-nodes/ subdirectory, cleaning up the root directory while preserving development testing environment for future use.
2026-03-30 17:09:06 +02:00

78 lines
2.4 KiB
JavaScript
Executable File

import { bytesToHexString, numberToHexString, setLengthLeft } from "./hex.js";
import { getAddressGenerator, getHashGenerator, isValidChecksum, } from "./internal/eth.js";
/**
* Checks if a value is an Ethereum address.
*
* @param value The value to check.
* @returns True if the value is an Ethereum address, false otherwise.
*/
export function isAddress(value) {
return typeof value === "string" && /^0x[0-9a-f]{40}$/i.test(value);
}
/**
* Checks if a value is an Ethereum address and if the checksum is valid.
*
* @param value The value to check.
* @returns True if the value is an Ethereum address with a valid checksum, false otherwise.
*/
export async function isValidChecksumAddress(value) {
return isAddress(value) && isValidChecksum(value);
}
/**
* Checks if a value is an Ethereum hash.
*
* @param value The value to check.
* @returns True if the value is an Ethereum hash, false otherwise.
*/
export function isHash(value) {
return typeof value === "string" && /^0x[0-9a-f]{64}$/i.test(value);
}
/**
* Converts a number to a hexadecimal string with a length of 32 bytes.
*
* @param value The number to convert.
* @returns The hexadecimal representation of the number padded to 32 bytes.
* @throws InvalidParameterError If the input is not a safe integer or is negative.
*/
export function toEvmWord(value) {
return setLengthLeft(numberToHexString(value), 64);
}
/**
* Generates a pseudo-random sequence of hash bytes.
*
* @returns A pseudo-random sequence of hash bytes.
*/
export async function generateHashBytes() {
const hashGenerator = await getHashGenerator();
return hashGenerator.next();
}
/**
* Generates a pseudo-random hash.
*
* @returns A pseudo-random hash.
*/
export async function randomHash() {
const hashBytes = await generateHashBytes();
return bytesToHexString(hashBytes);
}
/**
* Generates a pseudo-random sequence of hash bytes that can be used as an
* address.
*
* @returns A pseudo-random sequence of hash bytes.
*/
export async function generateAddressBytes() {
const addressGenerator = await getAddressGenerator();
const hashBytes = await addressGenerator.next();
return hashBytes.slice(0, 20);
}
/**
* Generates a pseudo-random address.
*
* @returns A pseudo-random address.
*/
export async function randomAddress() {
const addressBytes = await generateAddressBytes();
return bytesToHexString(addressBytes);
}
//# sourceMappingURL=eth.js.map