Crypto APIs 是一个复杂而创新的底层基础设施,极大地简化了任何区块链和加密相关应用程序的开发。围绕 REST 组织,Crypto APIs 2.0 可以为初学者和比特币/以太坊爱好者以及加密专家提供区块链应用程序的开发支持。Crypto APIs 提供统一的端点和数据、原始数据、自动代币和币种转发、回调功能等。

1.7.0 2022-09-12 15:52 UTC

This package is auto-updated.

Last update: 2024-09-12 20:19:09 UTC


README

Crypto APIs 是一个复杂而创新的底层基础设施,极大地简化了任何区块链和加密相关应用程序的开发。围绕 REST 组织,Crypto APIs 可以为初学者和比特币/以太坊爱好者以及加密专家提供区块链应用程序的开发支持。Crypto APIs 提供统一的端点和数据、原始数据、自动代币和币种转发、回调功能等。

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

安装与使用

要求

PHP 7.3 及以上。

Composer

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

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

然后运行 composer install

手动安装

下载文件并包含 autoload.php

<?php
require_once('/path/to/cryptoapis/sdk/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

模型

授权

API密钥

  • 类型: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