newtonproject / hep-sdk
PHP的HEP SDK实现
v1.0.9
2019-11-07 02:44 UTC
Requires
- php: >=7.0
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^6.2
- kornrunner/keccak: ^1.0
- ramsey/uuid: ^3.8
- simplito/elliptic-php: 1.0.4
- sop/crypto-encoding: ^0.2.0
- sop/crypto-types: ^0.2.1
- stephenhill/base58: ~1.0
Requires (Dev)
- phpunit/phpunit: ^4.8
- squizlabs/php_codesniffer: ~2.6
README
HEP协议的REST API
此PHP软件包由Swagger Codegen项目自动生成
- API版本:v1
- 构建包:io.swagger.codegen.languages.PhpClientCodegen
需求
PHP 5.5及更高版本
安装与使用
Composer
要使用Composer安装绑定,请将以下内容添加到composer.json
{
"repositories": [
{
"type": "git",
"url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git"
}
],
"require": {
"GIT_USER_ID/GIT_REPO_ID": "*@dev"
}
}
然后运行composer install
手动安装
下载文件并包含autoload.php
require_once('/path/to/HepRestApi/vendor/autoload.php');
测试
要运行单元测试
composer install
./vendor/bin/phpunit
入门指南
请遵循安装过程,然后运行以下命令
<?php require_once(__DIR__ . '/vendor/autoload.php'); $apiInstance = new HepRestApi\Api\RestApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); $api_version = "api_version_example"; // string | $dapp_id = "dapp_id_example"; // string | $dapp_key = "dapp_key_example"; // string | The decentralized application access key $protocol = "protocol_example"; // string | The protocol name. default is 'HEP'. $version = "version_example"; // string | The protocol version such as '1.0' $ts = 56; // int | The current timestamp $nonce = "nonce_example"; // string | The random string or auto-increment sequence $os = "os_example"; // string | The operating system of client such as ios, android, dweb,etc. $language = "language_example"; // string | The i18n language code such as zh, en, etc. $dapp_signature_method = "dapp_signature_method_example"; // string | The signature method used by dapp. $dapp_signature = "dapp_signature_example"; // string | The signature generated by dapp. try { $result = $apiInstance->restDappsRead($api_version, $dapp_id, $dapp_key, $protocol, $version, $ts, $nonce, $os, $language, $dapp_signature_method, $dapp_signature); print_r($result); } catch (Exception $e) { echo 'Exception when calling RestApi->restDappsRead: ', $e->getMessage(), PHP_EOL; } ?>
API端点文档
所有URI都是相对于https://
模型文档
- AuthCacheRequest
- AuthCacheResponse
- CancelProofRequest
- CancelProofResponse
- CreateAuthCacheResponse
- CreatePayCacheResponse
- CreateProofRequest
- CreateProofResponse
- Dapp
- NewchainTransactionResponse
- NewforceDailyStatsResponse
- NewidResponse
- Order
- OrderItem
- PayCacheRequest
- PayCacheResponse
- Proof
- ProofData
- ProofResponse
- ProofReward
- ReceiptField
- RetrieveDappDailyStatsResponse
- RetrieveOracleResponse
- RetrieveProofReceiptsRequest
- RetrieveProofReceiptsResponse
- RetrieveProofRewardsRequest
- RetrieveProofRewardsResponse
- Thing
授权文档
所有端点都不需要授权。