{"id":13307201,"url":"https://github.com/neuenet/handshake-regex","last_synced_at":"2025-03-10T14:32:37.294Z","repository":{"id":57260626,"uuid":"368750006","full_name":"neuenet/handshake-regex","owner":"neuenet","description":"Regular expression for matching Handshake (HNS) wallet addresses","archived":true,"fork":false,"pushed_at":"2021-11-08T00:45:29.000Z","size":17,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"primary","last_synced_at":"2025-02-16T03:35:16.168Z","etag":null,"topics":["handshake","hns","regex"],"latest_commit_sha":null,"homepage":"https://npm.im/handshake-regex","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/neuenet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-19T05:05:54.000Z","updated_at":"2024-08-22T23:33:56.000Z","dependencies_parsed_at":"2022-08-25T02:11:01.087Z","dependency_job_id":null,"html_url":"https://github.com/neuenet/handshake-regex","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuenet%2Fhandshake-regex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuenet%2Fhandshake-regex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuenet%2Fhandshake-regex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuenet%2Fhandshake-regex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neuenet","download_url":"https://codeload.github.com/neuenet/handshake-regex/tar.gz/refs/heads/primary","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242868589,"owners_count":20198507,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["handshake","hns","regex"],"created_at":"2024-07-29T17:59:34.911Z","updated_at":"2025-03-10T14:32:37.017Z","avatar_url":"https://github.com/neuenet.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# handshake-regex\n\n\u003e Regular expression for matching Handshake (HNS) wallet addresses\n\n\n\n## Install\n\n```sh\n$ npm i handshake-regex\n```\n\n## Notes\n\n- Version 31 Handshake addresses are _technically_ valid but they are also unspendable. For the sake of this module, those addresses are deemed invalid.\n- This module does not fully validate a Handshake address (that involves hashing and more). It is intended to show fairly quickly if an obviously incorrect address is indeed incorrect. For validation, you will want to use something like [hsd](https://github.com/handshake-org/hsd/blob/master/lib/primitives/address.js).\n\n\n\n## Usage\n\n```js\n// Import the default export\nimport dap from \"handshake-regex\";\n\ndap(\"hs1q98ddwl2lcpnnzfvvrqad80qu97w0q72cyq2uy3\");\n// ^ Returns true\n\ndap(\"3MWvddmToBWnnPes3L45i1pRQDhPrLdznc\");\n// ^ Returns false\n```\n\n```js\n// Or, export the named function\nimport { handshakeRegex } from \"handshake-regex\";\n\nhandshakeRegex(\"hs1q98ddwl2lcpnnzfvvrqad80qu97w0q72cyq2uy3\");\n// ^ Returns true\n\nhandshakeRegex(\"3MWvddmToBWnnPes3L45i1pRQDhPrLdznc\");\n// ^ Returns false\n```\n\n\n\n## API\n\n### handshakeRegex(suppliedString)\n#### suppliedString\n\nType: `string` (required)\n\n- If nothing is supplied, an error is returned. Gotta love types.\n- If you supply a nonsense string or non-Handshake wallet address, the response is `false`.\n\n\n\n## Tests\n\n```sh\n# Run all tests, sequentially\n$ npm test\n\n# Test dependencies for latest versions\n$ npm run test:dependencies\n\n# Lint \"src\" directory\n$ npm run test:typescript\n\n# Test this module\n$ npm run test:assert\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneuenet%2Fhandshake-regex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneuenet%2Fhandshake-regex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneuenet%2Fhandshake-regex/lists"}