{"id":22284947,"url":"https://github.com/cmeone/chia-utils","last_synced_at":"2025-07-28T22:31:02.702Z","repository":{"id":42186784,"uuid":"367089935","full_name":"CMEONE/chia-utils","owner":"CMEONE","description":"A set of JavaScript utilities to facilitate conversions for the Chia network","archived":false,"fork":false,"pushed_at":"2022-05-09T22:30:35.000Z","size":151,"stargazers_count":20,"open_issues_count":3,"forks_count":9,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-10T18:29:14.288Z","etag":null,"topics":["bech32","chia","chia-blockchain","chia-network","cryptocurrency","cryptography","hashing"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CMEONE.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-13T15:20:35.000Z","updated_at":"2022-10-22T11:38:20.000Z","dependencies_parsed_at":"2022-08-12T08:50:51.068Z","dependency_job_id":null,"html_url":"https://github.com/CMEONE/chia-utils","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CMEONE%2Fchia-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CMEONE%2Fchia-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CMEONE%2Fchia-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CMEONE%2Fchia-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CMEONE","download_url":"https://codeload.github.com/CMEONE/chia-utils/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227961891,"owners_count":17847836,"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":["bech32","chia","chia-blockchain","chia-network","cryptocurrency","cryptography","hashing"],"created_at":"2024-12-03T16:50:17.610Z","updated_at":"2024-12-03T16:50:18.301Z","avatar_url":"https://github.com/CMEONE.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- \u003cp align=\"center\"\u003e\n  \u003ca href=\"https://chia.togatech.org/\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\n    \u003cimg src=\"https://chia.togatech.org/favicon.ico\" width=\"50\" alt=\"Chia-Utils Logo\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e --\u003e\n\n\u003ch1 align=\"center\"\u003eUnofficial Library: Chia-Utils\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/CMEONE/chia-utils/actions\"\u003e\u003cimg src=\"https://img.shields.io/github/workflow/status/CMEONE/chia-utils/Node.js%20CI\" alt=\"Build Status\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/chia-utils\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/chia-utils.svg?sanitize=true\" alt=\"Version\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/chia-utils\"\u003e\u003cimg src=\"https://img.shields.io/npm/l/chia-utils.svg?sanitize=true\" alt=\"Version\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/chia-utils\"\u003e\u003cimg src=\"https://img.shields.io/npm/dm/chia-utils.svg?sanitize=true\" alt=\"Monthly Downloads\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/chia-utils\"\u003e\u003cimg src=\"https://img.shields.io/npm/dt/chia-utils.svg?sanitize=true\" alt=\"Total Downloads\"\u003e\u003c/a\u003e\n  \u003c!--\u003ca href=\"https://www.npmjs.com/package/chia-utils\"\u003e\u003cimg src=\"https://badgen.net/bundlephobia/min/chia-utils?color=green\u0026label=minified\" alt=\"Minified\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/chia-utils\"\u003e\u003cimg src=\"https://badgen.net/bundlephobia/minzip/chia-utils?color=green\u0026label=gzipped\" alt=\"Gzipped\"\u003e\u003c/a\u003e--\u003e\n\u003c/p\u003e\n\nA set of JavaScript utilities to facilitate conversions for the Chia network\n\n## Table of Contents\n- [Install](#install)\n- [Address to Puzzle Hash](#address-to-puzzle-hash)\n- [Puzzle Hash to Address](#puzzle-hash-to-address)\n- [Get Coin Info](#get-coin-info)\n- [Get Coin Info Mojo](#get-coin-info-mojo)\n- [Bytes to Hex](#bytes-to-hex)\n- [Hex to Bytes](#hex-to-bytes)\n\n## Install\nTo install from NPM:\n```bash\nnpm install chia-utils\n```\n\nTo install from GitHub:\n```bash\ngit clone https://github.com/CMEONE/chia-utils.git\n```\n\nTo test:\n```bash\nnpm install\nnpm test\n```\n\nTo include from NPM:\n```javascript\nconst { address_to_puzzle_hash, puzzle_hash_to_address, get_coin_info, get_coin_info_mojo, bytes_to_hex, hex_to_bytes } = require(\"chia-utils\");\n```\n\nTo include from file:\n```javascript\nconst { address_to_puzzle_hash, puzzle_hash_to_address, get_coin_info, get_coin_info_mojo, bytes_to_hex, hex_to_bytes } = require(\"./chia-utils.js\");\n```\n\nTo use in the browser:\n```html\n\u003cscript type=\"text/javascript\" src=\"chia-utils.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n  ChiaUtils.address_to_puzzle_hash( ... )\n  ChiaUtils.puzzle_hash_to_address( ... )\n  ChiaUtils.get_coin_info( ... )\n  ChiaUtils.get_coin_info_mojo( ... )\n  ChiaUtils.bytes_to_hex( ... )\n  ChiaUtils.hex_to_bytes( ... )\n\u003c/script\u003e\n```\n\n## Address to Puzzle Hash\n```javascript\nlet puzzle_hash = address_to_puzzle_hash(address);\n```\n**Parameters:**\n- address: string (\"xch1...\")\n\n**Return type:** string (\"0x...\")\n\n## Puzzle Hash to Address\n```javascript\nlet address = puzzle_hash_to_address(puzzle_hash, prefix = \"xch\");\n```\n**Parameters:**\n- puzzle_hash: string (\"0x...\")\n- prefix: string (\"xch\") - default: \"xch\"\n\n**Return type:** string (\"xch1...\")\n\n## Get Coin Info\n```javascript\nlet coin_info = get_coin_info(parent_coin_info, puzzle_hash, amount_decimal);\n```\n**Parameters:**\n- parent_coin_info: string (\"0x...\")\n- puzzle_hash: string (\"0x...\")\n- amount_decimal: number (0.01)\n\n**Return type:** string (\"0x...\")\n\n## Get Coin Info Mojo \n```javascript\nlet coin_info = get_coin_info_mojo(parent_coin_info, puzzle_hash, amount);\n```\n**Parameters:**\n- parent_coin_info: string (\"0x...\")\n- puzzle_hash: string (\"0x...\")\n- amount: number (1000000000000)\n\n**Return type:** string (\"0x...\")\n\n## Bytes to Hex\n```javascript\nlet hex = bytes_to_hex(bytes);\n```\n**Parameters:**\n- bytes: Array or Uint8Array ([0, 255, ...])\n\n**Return type:** string (\"fedcba9876543210...\")\n\n## Hex to Bytes\n```javascript\nlet bytes = hex_to_bytes(hex);\n```\n**Parameters:**\n- hex: string (\"fedcba9876543210...\")\n\n**Return type:** Uint8Array ([0, 255, ...])\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmeone%2Fchia-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcmeone%2Fchia-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmeone%2Fchia-utils/lists"}