PHPackages                             fenguoz/chia-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. fenguoz/chia-php

ActiveLibrary[API Development](/categories/api)

fenguoz/chia-php
================

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.

0.1.0(5y ago)126096[1 issues](https://github.com/Fenguoz/chia-php/issues)MITPHP

Since Jul 1Pushed 4y ago3 watchersCompare

[ Source](https://github.com/Fenguoz/chia-php)[ Packagist](https://packagist.org/packages/fenguoz/chia-php)[ Docs](https://github.com/Fenguoz/chia-php)[ RSS](/packages/fenguoz-chia-php/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

Chia-PHP
========

[](#chia-php)

概述
--

[](#概述)

Chia-PHP 支持奇亚的 XCH 中获取当前区块链信息、获取当前高度、获取当前网络信息、创建新钱包、生成助记词、发起交易、获取交易记录等功能。

支持方法
----

[](#支持方法)

### 节点

[](#节点)

#### 区块链

[](#区块链)

- ✅当前区块链信息 `getBlockchainState()`
- ✅通过 `header_hash` 获取完整区块 `getBlock()`
- ✅获取完整区块列表 `getBlocks()`
- ✅通过 `height` 获取块记录 `getBlockRecordByHeight()`
- ✅通过 `header_hash` 获取块记录 `getBlockRecord()`
- ✅获取块记录列表 `getBlockRecords()`
- ✅获取未完成的头部块 `getUnfinishedBlockHeaders()`
- ✅获取总绘制空间的估计值 `getNetworkSpace()`
- ✅获取块的币种增删记录 `getAdditionsAndRemovals()`
- ✅获取区块链的初始冻结期 `getInitialFreezePeriod()`
- ✅获取当前网络信息 `getNetworkInfo()`

#### 币种

[](#币种)

- ✅通过 `PuzzleHash` 获取币种记录 `getCoinRecordsByPuzzleHash()`
- ✅通过数组 `PuzzleHash` 获取币种记录 `getCoinRecordsByPuzzleHashes()`
- ✅通过 `币种名称/ID` 获取币种记录 `getCoinRecordByName()`
- 🚧 推送交易包到内存池和区块链 `pushTx()`

#### 内存池

[](#内存池)

- ✅获取交易ID(花费捆绑哈希)列表`getAllMempoolTxIds()`
- ✅获取内存池项目 `getAllMempoolItems()`
- ✅通过 `交易ID` 获取内存池项目 `getMempoolItemByTxId()`

### 钱包

[](#钱包)

#### 密钥管理

[](#密钥管理)

- ✅指定 `finger` 为激活状态 `logIn()`
- ✅获取钱包公钥 `getPublicKeys()`
- ✅获取钱包私钥 `getPrivateKey()`
- ✅生成助记词 `generateMnemonic()`
- ✅添加钥匙串 `addKey()`
- ✅删除私钥 `deleteKey()`
- ✅删除所有私钥 `deleteAllKeys()`

#### 钱包节点

[](#钱包节点)

- ✅获取钱包同步状态 `getSyncStatus()`
- ✅获取当前高度 `getHeightInfo()`
- ✅农场块`farmBlock()`
- ✅获取区块链初始冻结期 `getInitialFreezePeriod()`
- ✅获取当前网络信息 `getNetworkInfo()`

#### 钱包管理

[](#钱包管理)

- ✅获取钱包列表 `getWallets()`
- 🚧 创建新钱包 `createNewWallet()`

#### 钱包

[](#钱包-1)

- ✅获取钱包余额 `getWalletBalance()`
- ✅通过 `交易hash` 获取交易记录 `getTransaction()`
- ✅获取交易记录 `getTransactions()`
- ✅获取新地址 `getNextAddress()`
- ✅发起交易 `sendTransaction()`
- ✅创建备份 `createBackup()`
- ✅获取钱包交易数量 `getTransactionCount()`
- ✅获取农场奖励信息 `getFarmedAmount()`
- 🚧 `createSignedTransaction()`

#### 其他币种和交易 🚧

[](#其他币种和交易-)

#### DID 钱包 🚧

[](#did-钱包-)

#### RL 钱包 🚧

[](#rl-钱包-)

快速开始
----

[](#快速开始)

### 安装

[](#安装)

```
composer require fenguoz/chia-php
```

### 接口调用

[](#接口调用)

```
/* 节点(Full Node) */
$fullNodeConfig = [
    'base_uri' => 'https://localhost:8555',
    'verify' => false,
    'cert' => '/your/private_full_node.crt/path',// private_full_node.crt
    'ssl_key' => '/your/private_full_node.key/path',// private_full_node.key
];

$api = new \Chia\Api(new \GuzzleHttp\Client($fullNodeConfig));
$fullNode = new Chia\FullNode($api);
$info = $fullNode->getNetworkInfo();
// $info->network_name      mainnet
// $info->network_prefix    xch

/* 钱包(Wallet) */
$walletConfig = [
    'base_uri' => 'https://localhost:9256',
    'verify' => false,
    'cert' => '/your/private_wallet.crt/path',// private_wallet.crt
    'ssl_key' => '/your/private_wallet.key/path', // private_wallet.key
];

$api = new \Chia\Api(new \GuzzleHttp\Client($walletConfig));
$wallet = new Chia\Wallet($api);
$info = $wallet->getNetworkInfo();
```

计划
--

[](#计划)

- 新增新接口
- 新增参数和响应检验类
- 完善文档
- ...

🌟🌟
--

[](#)

[![Stargazers over time](https://camo.githubusercontent.com/e6be66ebe33a01a620f4e95a73f560eb3983546e148fb23c90af0fd1c655cef9/68747470733a2f2f7374617263686172742e63632f46656e67756f7a2f636869612d7068702e737667)](https://starchart.cc/Fenguoz/chia-php)

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1829d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b1a4edd9ce705e6ea4c191715ec70228e641722feacc44a8fd634088e4287c1f?d=identicon)[243944672](/maintainers/243944672)

---

Top Contributors

[![Fenguoz](https://avatars.githubusercontent.com/u/28383092?v=4)](https://github.com/Fenguoz "Fenguoz (21 commits)")

---

Tags

chiaphprpcxchphprpcchiaxch

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/fenguoz-chia-php/health.svg)

```
[![Health](https://phpackages.com/badges/fenguoz-chia-php/health.svg)](https://phpackages.com/packages/fenguoz-chia-php)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M47](/packages/tencentcloud-tencentcloud-sdk-php)[resend/resend-php

Resend PHP library.

617.2M43](/packages/resend-resend-php)[checkout/checkout-sdk-php

Checkout.com SDK for PHP

563.6M13](/packages/checkout-checkout-sdk-php)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)[files.com/files-php-sdk

Files.com PHP SDK

2481.1k](/packages/filescom-files-php-sdk)[aimeos/prisma

A powerful PHP package for integrating media related Large Language Models (LLMs) into your applications

1943.1k5](/packages/aimeos-prisma)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
