{"id":23272829,"url":"https://github.com/fenguoz/chia-php","last_synced_at":"2025-08-21T04:31:34.413Z","repository":{"id":62504091,"uuid":"365170730","full_name":"Fenguoz/chia-php","owner":"Fenguoz","description":"Supports functions such as obtaining current blockchain information, obtaining current altitude, obtaining current network information, creating a new wallet, generating mnemonic words, initiating transactions, and obtaining transaction records in Chia’s XCH.","archived":false,"fork":false,"pushed_at":"2022-01-23T20:34:18.000Z","size":43,"stargazers_count":11,"open_issues_count":1,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-29T17:18:10.655Z","etag":null,"topics":["chia","php","rpc","xch"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/Fenguoz.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-07T08:45:39.000Z","updated_at":"2023-10-28T00:39:47.000Z","dependencies_parsed_at":"2022-11-02T12:31:04.451Z","dependency_job_id":null,"html_url":"https://github.com/Fenguoz/chia-php","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Fenguoz/chia-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fenguoz%2Fchia-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fenguoz%2Fchia-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fenguoz%2Fchia-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fenguoz%2Fchia-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Fenguoz","download_url":"https://codeload.github.com/Fenguoz/chia-php/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fenguoz%2Fchia-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271425155,"owners_count":24757422,"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","status":"online","status_checked_at":"2025-08-21T02:00:08.990Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["chia","php","rpc","xch"],"created_at":"2024-12-19T19:19:42.820Z","updated_at":"2025-08-21T04:31:34.151Z","avatar_url":"https://github.com/Fenguoz.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eChia-PHP\u003c/h1\u003e\n\n## 概述\n\nChia-PHP 支持奇亚的 XCH 中获取当前区块链信息、获取当前高度、获取当前网络信息、创建新钱包、生成助记词、发起交易、获取交易记录等功能。\n\n## 支持方法\n\n### 节点\n\n#### 区块链\n\n- ✅当前区块链信息 `getBlockchainState()`\n- ✅通过 `header_hash` 获取完整区块 `getBlock()`\n- ✅获取完整区块列表 `getBlocks()`\n- ✅通过 `height` 获取块记录 `getBlockRecordByHeight()`\n- ✅通过 `header_hash` 获取块记录 `getBlockRecord()`\n- ✅获取块记录列表 `getBlockRecords()`\n- ✅获取未完成的头部块 `getUnfinishedBlockHeaders()`\n- ✅获取总绘制空间的估计值 `getNetworkSpace()`\n- ✅获取块的币种增删记录 `getAdditionsAndRemovals()`\n- ✅获取区块链的初始冻结期 `getInitialFreezePeriod()`\n- ✅获取当前网络信息 `getNetworkInfo()`\n\n#### 币种\n\n- ✅通过 `PuzzleHash` 获取币种记录 `getCoinRecordsByPuzzleHash()`\n- ✅通过数组 `PuzzleHash` 获取币种记录 `getCoinRecordsByPuzzleHashes()`\n- ✅通过 `币种名称/ID` 获取币种记录 `getCoinRecordByName()`\n- 🚧 推送交易包到内存池和区块链 `pushTx()`\n\n#### 内存池\n\n- ✅获取交易ID(花费捆绑哈希)列表`getAllMempoolTxIds()`\n- ✅获取内存池项目 `getAllMempoolItems()`\n- ✅通过 `交易ID` 获取内存池项目 `getMempoolItemByTxId()`\n\n### 钱包\n\n#### 密钥管理\n\n- ✅指定 `finger` 为激活状态 `logIn()`\n- ✅获取钱包公钥 `getPublicKeys()`\n- ✅获取钱包私钥 `getPrivateKey()`\n- ✅生成助记词 `generateMnemonic()`\n- ✅添加钥匙串 `addKey()`\n- ✅删除私钥 `deleteKey()`\n- ✅删除所有私钥 `deleteAllKeys()`\n\n#### 钱包节点\n\n- ✅获取钱包同步状态 `getSyncStatus()`\n- ✅获取当前高度 `getHeightInfo()`\n- ✅农场块`farmBlock()`\n- ✅获取区块链初始冻结期 `getInitialFreezePeriod()`\n- ✅获取当前网络信息 `getNetworkInfo()`\n\n#### 钱包管理\n\n- ✅获取钱包列表 `getWallets()`\n- 🚧 创建新钱包 `createNewWallet()`\n\n#### 钱包\n\n- ✅获取钱包余额 `getWalletBalance()`\n- ✅通过 `交易hash` 获取交易记录 `getTransaction()`\n- ✅获取交易记录 `getTransactions()`\n- ✅获取新地址 `getNextAddress()`\n- ✅发起交易 `sendTransaction()`\n- ✅创建备份 `createBackup()`\n- ✅获取钱包交易数量 `getTransactionCount()`\n- ✅获取农场奖励信息 `getFarmedAmount()`\n- 🚧 `createSignedTransaction()`\n\n#### 其他币种和交易 🚧 \n#### DID 钱包 🚧 \n#### RL 钱包 🚧 \n\n## 快速开始\n\n### 安装\n\n``` php\ncomposer require fenguoz/chia-php\n```\n\n### 接口调用\n\n``` php\n/* 节点(Full Node) */\n$fullNodeConfig = [\n    'base_uri' =\u003e 'https://localhost:8555',\n    'verify' =\u003e false,\n    'cert' =\u003e '/your/private_full_node.crt/path',// private_full_node.crt\n    'ssl_key' =\u003e '/your/private_full_node.key/path',// private_full_node.key\n];\n\n$api = new \\Chia\\Api(new \\GuzzleHttp\\Client($fullNodeConfig));\n$fullNode = new Chia\\FullNode($api);\n$info = $fullNode-\u003egetNetworkInfo();\n// $info-\u003enetwork_name      mainnet\n// $info-\u003enetwork_prefix    xch\n\n/* 钱包(Wallet) */\n$walletConfig = [\n    'base_uri' =\u003e 'https://localhost:9256',\n    'verify' =\u003e false,\n    'cert' =\u003e '/your/private_wallet.crt/path',// private_wallet.crt\n    'ssl_key' =\u003e '/your/private_wallet.key/path', // private_wallet.key\n];\n\n$api = new \\Chia\\Api(new \\GuzzleHttp\\Client($walletConfig));\n$wallet = new Chia\\Wallet($api);\n$info = $wallet-\u003egetNetworkInfo();\n```\n\n## 计划\n\n- 新增新接口\n- 新增参数和响应检验类\n- 完善文档\n- ...\n\n## 🌟🌟\n\n[![Stargazers over time](https://starchart.cc/Fenguoz/chia-php.svg)](https://starchart.cc/Fenguoz/chia-php)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffenguoz%2Fchia-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffenguoz%2Fchia-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffenguoz%2Fchia-php/lists"}