alexfrapo/apidaemon

Crypto APIs 是一个复杂且创新的底层基础设施,极大地简化了任何区块链和加密相关应用的开发。Crypto APIs 围绕 REST 进行组织,可以帮助初学者和加密专家开发其区块链应用。Crypto APIs 提供统一的端点和数据、原始数据、自动代币和币种转发、回调功能等。

1.0 2024-04-09 07:53 UTC

This package is not auto-updated.

Last update: 2024-09-25 08:25:35 UTC


README

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

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

安装与使用

需求

PHP 7.4 及以上版本。也应该与 PHP 8.0 兼容。

Composer

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

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

然后运行 composer install

手动安装

下载文件并包含 autoload.php

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

入门指南

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

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



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


$apiInstance = new com.cryptoapis.rest_apis.sdk\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定义的认证方案

ApiKey

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

测试

要运行测试,使用

composer install
vendor/bin/phpunit

作者

developers@cryptoapis.io

关于此包

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

  • API版本: 2023-04-25
    • 包版本: 1.0
    • 生成器版本: 7.4.0
  • 构建包: org.openapitools.codegen.languages.PhpClientCodegen