PHPackages                             sound/sound-sdk-php-demo - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. sound/sound-sdk-php-demo

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

sound/sound-sdk-php-demo
========================

sound-sdk-php

v1.0.0(3y ago)24MITPHP

Since Aug 9Pushed 3y ago1 watchersCompare

[ Source](https://github.com/crichain/sound-sdk-php-demo)[ Packagist](https://packagist.org/packages/sound/sound-sdk-php-demo)[ RSS](/packages/sound-sound-sdk-php-demo/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (7)Versions (4)Used By (0)

\#sound/sound-sdk-php-demo

Install
=======

[](#install)

```
composer require sound/sound-sdk-php-demo

```

Usage
=====

[](#usage)

### 生成秘钥对、地址

[](#生成秘钥对地址)

```
use crichain\Creator;

$keyPair = Creator::keyPair();
```

### 签名

[](#签名)

```
use crichain\Creator;

/**
 * 签名
 *
 * @param string $privateKey 私钥
 * @param string $msg
 * @return string
 * @throws Exception
 */
$sign = Creator::sign($keyPair['privateKey'], '123');
```

### 获取账户信息

[](#获取账户信息)

```
use crichain\Caller;

/**
 * 获取账号信息
 *
 * @param string $address 地址
 * @return array
 * @throws Exception
 */
$accountInfo = Caller::getAccountInfo($keyPair['address']);
```

### 转账CRIC

[](#转账cric)

```
use crichain\Transfer;

/**
 * construct
 *
 * @param string $privateKey 私钥
 * @throws Exception
 */
$transfer = new Transfer($keyPair['privateKey']);

/**
 * 转账
 *
 * @param string $to 转入地址
 * @param string $amount 转账金额
 * @return array|mixed
 * @throws Exception
 */
$res = $transfer->safeTransfer('转入地址', '0.01');
//$res = $transfer->safeTransfer('转入地址', '0.01', 10); // 手动传入 nonce
```

### 调用合约

[](#调用合约)

```
use crichain\Caller;
use crichain\utils\Functions;

/**
 * 实例化调用合约类
 *
 * @param string $privateKey 私钥
 * @param string $nftType NFT配置，默认为NFT_A
 */
$caller = new Caller($privateKey);

/**
 * 铸造
 *
 * @param string $contractAddress   合约地址
 * @param string $method  合约方法名:safeMint
 * @param array $params  合约参数数组:['转入地址','tokenId','token图片地址']
 * @param string $operateId  操作ID
 * @return array|mixed
 * @throws Exception
 */
$r = $caller->callContract($contractAddress, 'safeMint',['xxxx','123','https://gfanx.cn/1.jpg'], Functions::createOperateId());
var_dump($r); die;

/**
 * 转移token
 *
 * @param string $contractAddress   合约地址
 * @param string $method  合约方法名:safeTransfer
 * @param array $params  合约参数数组:['转出地址','转入地址','tokenId']
 * @param string $operateId  操作ID
 * @return array|mixed
 * @throws Exception
 */
$r = $caller->callContract($contractAddress, 'safeTransfer',['xxx','xxx','123'],  Functions::createOperateId());
var_dump($r); die;

/**
 * 销毁
 *
 * @param string $contractAddress   合约地址
 * @param string $method  合约方法名:burn
 * @param array $params  合约参数数组:['tokenId']
 * @param string $operateId 操作ID
 * @return array|mixed
 * @throws Exception
 */
$r = $caller->callContract($contractAddress, 'burn',['123'], Functions::createOperateId());
var_dump($r); die;

/**
 * 获取tokenURI
 *
 * @param string $contractAddress   合约地址
 * @param string $method  合约方法名:tokenURI
 * @param array $params  合约参数数组:['tokenId']
 * @return array|mixed
 * @throws Exception
 */
$r = $caller->callContract($contractAddress, 'tokenURI',['123']);
var_dump($r); die;

#注：其他合约方法，见config/NFT_A.json配置文件，调用方法同上。
```

### 获取交易详情

[](#获取交易详情)

```
/**
 * 获取交易详情
 *
 * @param string $hash 交易哈希
 * @return array
 * @throws Exception
 */
$r = crichain\Caller::transactionInfo('xxx');
var_dump($r);
```

### 注意事项

[](#注意事项)

```
1.sdk区分测试与正式环境，如需要使用测试环境，请增加环境变量：CRICHAIN_SDK_ENV=test

```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% 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

Every ~55 days

Total

3

Last Release

1259d ago

Major Versions

0.0.2 → v1.0.02022-11-28

### Community

Maintainers

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

---

Top Contributors

[![Matzoh](https://avatars.githubusercontent.com/u/19823952?v=4)](https://github.com/Matzoh "Matzoh (2 commits)")[![yaoxiangxi09](https://avatars.githubusercontent.com/u/110119884?v=4)](https://github.com/yaoxiangxi09 "yaoxiangxi09 (2 commits)")

### Embed Badge

![Health badge](/badges/sound-sound-sdk-php-demo/health.svg)

```
[![Health](https://phpackages.com/badges/sound-sound-sdk-php-demo/health.svg)](https://phpackages.com/packages/sound-sound-sdk-php-demo)
```

###  Alternatives

[web3p/ethereum-util

A collection of utility functions for Ethereum written in PHP.

30420.2k26](/packages/web3p-ethereum-util)

PHPackages © 2026

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