diff --git a/src/Validators/TransactionIdValidator.php b/src/Validators/TransactionIdValidator.php new file mode 100644 index 0000000..d7486c6 --- /dev/null +++ b/src/Validators/TransactionIdValidator.php @@ -0,0 +1,26 @@ + + * @license MIT + */ + +namespace Web3\Validators; + +class TransactionIdValidator +{ + /** + * validate + * + * @param string $value + * @return bool + */ + public static function validate($value) + { + if (!is_string($value)) { + return false; + } + + return (preg_match('/^0x[a-fA-F0-9]{66}$/', $value) >= 1); + } +} \ No newline at end of file