{"id":22756870,"url":"https://github.com/zororaka00/sol-type-check","last_synced_at":"2026-02-15T20:31:13.021Z","repository":{"id":264466840,"uuid":"893465562","full_name":"zororaka00/sol-type-check","owner":"zororaka00","description":"A lightweight JavaScript library to validate Solidity data types like int, uint, bytes, and Ethereum-specific types such as addresses and transaction hashes.","archived":false,"fork":false,"pushed_at":"2024-11-27T11:24:28.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-10T03:36:53.585Z","etag":null,"topics":["ethereum","javascript","library","smart-contract","solidity","type-check","typescript","web3"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/sol-type-check","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zororaka00.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"zororaka00","patreon":"zororaka"}},"created_at":"2024-11-24T14:20:27.000Z","updated_at":"2025-09-09T09:48:00.000Z","dependencies_parsed_at":"2025-04-14T16:44:47.312Z","dependency_job_id":"44523a9b-ea0c-4f7b-9be8-1c14c4716f41","html_url":"https://github.com/zororaka00/sol-type-check","commit_stats":null,"previous_names":["zororaka00/sol-type-check"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/zororaka00/sol-type-check","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zororaka00%2Fsol-type-check","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zororaka00%2Fsol-type-check/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zororaka00%2Fsol-type-check/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zororaka00%2Fsol-type-check/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zororaka00","download_url":"https://codeload.github.com/zororaka00/sol-type-check/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zororaka00%2Fsol-type-check/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29488536,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-15T19:29:10.908Z","status":"ssl_error","status_checked_at":"2026-02-15T19:29:10.419Z","response_time":118,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ethereum","javascript","library","smart-contract","solidity","type-check","typescript","web3"],"created_at":"2024-12-11T07:15:55.722Z","updated_at":"2026-02-15T20:31:13.005Z","avatar_url":"https://github.com/zororaka00.png","language":"TypeScript","funding_links":["https://github.com/sponsors/zororaka00","https://patreon.com/zororaka"],"categories":[],"sub_categories":[],"readme":"# sol-type-check\n\nA lightweight JavaScript library to validate Solidity data types like `int`, `uint`, `bytes`, and Ethereum-specific types such as addresses and transaction hashes.\n\n## Features\n\n- Validate signed and unsigned integers (`int`, `uint`) with customizable bit sizes.\n- Validate Solidity `bytes` types (1, 2, 4, 8, 16, 32).\n- Validate Ethereum addresses and transaction hashes.\n- Provides simple and easy-to-use functions.\n\n## Installation\n\nTo install the library, run the following command:\n\n```bash\nnpm install sol-type-check\n```\n\n## Usage\n\n### Importing the Library\n\nYou can import the library in your project like this:\n\n```javascript\nconst { isInt, isUint, isBytes, isAddress, isHash } = require('sol-type-check');\n```\n\n### Example Functions\n\n#### `isInt(bits, value)`\n\nChecks if a value is a signed integer within the range for a given bit size.\n\n```javascript\nisInt(32, 123); // true\nisInt(8, -130); // false\n```\n\n#### `isUint(bits, value)`\n\nChecks if a value is an unsigned integer within the range for a given bit size.\n\n```javascript\nisUint(32, 4294967295); // true\nisUint(8, -1); // false\n```\n\n#### `isBytes(bytes, value)`\n\nChecks if a value is a valid bytes array of the specified size.\n\n```javascript\nisBytes(4, \"0xabcdef\"); // true\nisBytes(2, \"0x12345\"); // false\n```\n\n#### `isAddress(value)`\n\nChecks if a value is a valid Ethereum address.\n\n```javascript\nisAddress(\"0x32Be343B94f860124dC4fEe278FDCBD38C102D88\"); // true\nisAddress(\"0xInvalidAddress\"); // false\n```\n\n#### `isHash(value)`\n\nChecks if a value is a valid Ethereum transaction hash.\n\n```javascript\nisHash(\"0x5c504ed7d413568f857eeb70f9f70e0d8b6b7469c9a7f325d9776de08e850635\"); // true\nisHash(\"0xInvalidHash\"); // false\n```\n\n## API\n\n- **`isInt(bits, value)`**  \n  Validates a signed integer for the specified bit size.  \n  - **`bits`**: An integer (8, 16, 32, 64, 128, or 256) representing the bit size.\n  - **`value`**: A number to check if it is within the valid range.\n\n- **`isUint(bits, value)`**  \n  Validates an unsigned integer for the specified bit size.  \n  - **`bits`**: An integer (8, 16, 32, 64, 128, or 256) representing the bit size.\n  - **`value`**: A number to check if it is within the valid range.\n\n- **`isBytes(bytes, value)`**  \n  Validates a bytes array of a specified size.  \n  - **`bytes`**: An integer (1, 2, 4, 8, 16, or 32) representing the expected byte size.\n  - **`value`**: A string representing the bytes in hexadecimal format (prefixed with `0x`).\n\n- **`isAddress(value)`**  \n  Validates an Ethereum address.  \n  - **`value`**: A string representing the Ethereum address (must start with `0x` and be 40 hexadecimal characters).\n\n- **`isHash(value)`**  \n  Validates an Ethereum transaction hash.  \n  - **`value`**: A string representing the Ethereum transaction hash (must start with `0x` and be 64 hexadecimal characters).\n\n## Contributing\n\nIf you would like to contribute to this project, feel free to fork the repository and create a pull request. We welcome bug reports, suggestions, and improvements.\n\n## 🛠 Support\n\nIf you encounter any issues or have questions, please open an issue in this repository or contact us at rakawidhiantoro@gmail.com.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzororaka00%2Fsol-type-check","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzororaka00%2Fsol-type-check","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzororaka00%2Fsol-type-check/lists"}