newtonproject/hep-sdk

Implement of HEP sdk for PHP

v1.0.9 2019-11-07 02:44 UTC

This package is not auto-updated.

Last update: 2022-12-03 23:06:51 UTC


README

The REST API for HEP protocol

This PHP package is automatically generated by the Swagger Codegen project:

  • API version: v1
  • Build package: io.swagger.codegen.languages.PhpClientCodegen

Requirements

PHP 5.5 and later

Installation & Usage

Composer

To install the bindings via Composer, add the following to composer.json:

{
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git"
    }
  ],
  "require": {
    "GIT_USER_ID/GIT_REPO_ID": "*@dev"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

    require_once('/path/to/HepRestApi/vendor/autoload.php');

Tests

To run the unit tests:

composer install
./vendor/bin/phpunit

Getting Started

Please follow the installation procedure and then run the following:

<?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;
}

?>

Documentation for API Endpoints

All URIs are relative to http://localhost

Class Method HTTP request Description
RestApi restDappsRead GET /rest/v{api_version}/dapps/{dapp_id}/
RestApi restDappsRead_0 GET /rest/v{api_version}/dapps/{dapp_id}/{date}/
RestApi restHealthList GET /rest/v{api_version}/health/
RestApi restNewchainTxRead GET /rest/v{api_version}/newchain/tx/{txid}/
RestApi restNewforceRead GET /rest/v{api_version}/newforce/{date}/
RestApi restNewidsRead GET /rest/v{api_version}/newids/{newid}/
RestApi restNewnetCachesAuthCreate POST /rest/v{api_version}/newnet/caches/auth/
RestApi restNewnetCachesAuthRead GET /rest/v{api_version}/newnet/caches/auth/{auth_hash}/
RestApi restNewnetCachesPayCreate POST /rest/v{api_version}/newnet/caches/pay/
RestApi restNewnetCachesPayRead GET /rest/v{api_version}/newnet/caches/pay/{pay_hash}/
RestApi restOraclesRead GET /rest/v{api_version}/oracles/{oracle_id}/
RestApi restProofsCreate POST /rest/v{api_version}/proofs/
RestApi restProofsDelete DELETE /rest/v{api_version}/proofs/{proof_hash}/
RestApi restProofsRead GET /rest/v{api_version}/proofs/{proof_hash}/
RestApi restProofsReceiptsCreate POST /rest/v{api_version}/proofs/receipts/
RestApi restProofsRewardsCreate POST /rest/v{api_version}/proofs/rewards/

Documentation For Models

Documentation For Authorization

All endpoints do not require authorization.

Author

xiawu@zeuux.org