cryptoapis/sdk-guzzle7

Crypto APIs是一个复杂且创新的架构层,极大地简化了任何区块链和加密相关应用程序的开发。围绕REST架构组织,Crypto APIs 2.0可以帮助初学者和加密专家开发他们的区块链应用程序。Crypto APIs提供统一的端点和数据,原始数据,自动令牌和硬币转发,回调功能等。

1.7.0 2022-09-12 15:56 UTC

This package is auto-updated.

Last update: 2024-09-12 20:18:51 UTC


README

Crypto APIs是一个复杂且创新的架构层,极大地简化了任何区块链和加密相关应用程序的开发。围绕REST架构组织,Crypto APIs可以帮助初学者和加密专家开发他们的区块链应用程序。Crypto APIs提供统一的端点和数据,原始数据,自动令牌和硬币转发,回调功能等。

更多信息,请访问 https://cryptoapis.io

安装与使用

需求

PHP 7.4及以上。

Composer

要通过Composer安装绑定,请将以下内容添加到composer.json

{
  "require": {
    "cryptoapis/sdk-guzzle7": "^1.7.0"
  }
}

然后运行composer install

手动安装

下载文件并包含autoload.php

<?php
require_once('/path/to/cryptoapis/sdk-guzzle7/vendor/autoload.php');

入门

请按照安装过程操作,然后运行以下命令

<?php
require_once(__DIR__ . '/vendor/autoload.php');



// Configure API key authorization: ApiKey
$config = CryptoAPIs\Configuration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = CryptoAPIs\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');


$apiInstance = new CryptoAPIs\Api\AssetsApi(
    // 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(),
    $config
);
$asset_id = 5b1ea92e584bf50020130612; // string | Defines the unique ID of the specific asset.
$context = yourExampleString; // string | In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. `context` is specified by the user.

try {
    $result = $apiInstance->getAssetDetailsByAssetID($asset_id, $context);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AssetsApi->getAssetDetailsByAssetID: ', $e->getMessage(), PHP_EOL;
}

API端点

所有URI都相对于https://rest.cryptoapis.io

模型

授权

ApiKey

  • 类型: API密钥
  • API密钥参数名称: x-api-key
  • 位置: HTTP头部

测试

要运行测试,请使用

composer install
vendor/bin/phpunit

作者

developers@cryptoapis.io

关于此包

此PHP包是由OpenAPI Generator项目自动生成的

  • API版本: 2021-03-20
    • 包版本: 1.7.0
  • 构建包: org.openapitools.codegen.languages.PhpClientCodegen