mahtab2003/faucetpay

一个用于与FaucetPay账户交互的API包装器。

1.0 2022-06-02 05:55 UTC

This package is auto-updated.

Last update: 2024-09-30 01:54:27 UTC


README

一个用于与FaucetPay交互的API包装器。

安装

此软件包最好通过Composer安装

composer require mahtab2003/faucetpay

使用方法

在开始之前,您需要从FaucetPay获取API密钥。登录到FaucetPay,转到水龙头所有者仪表板 -> 您的水龙头 -> 显示API密钥。使用此API密钥与FaucetPay交互。

FaucetPay API公开以下方法。以下列出可用参数。

  • listCurrencies: 获取所有支持货币的列表。
  • listFaucets: 获取所有可用水龙头的列表。
  • getBalance: 获取水龙头的余额。
  • checkAddress: 检查地址是否链接到任何FaucetPay账户。
  • getPayouts: 获取所有最近的水龙头列表。
  • send: 向另一个FaucetPay账户发送资金。

示例

use \Mahtab2003\FaucetPay\Api;

// Create a new Api class instance.
$api = new Api('API Key', 'BTC');

// Get the balance of the faucet.
$response = $api->getBalance();

// Check whether the request was successful.
if ($response->isSuccessful()) {
   $data = $response->getData();
   echo 'Your faucet balance is: ' . $data['balance'];
} else {
   echo 'Error: ' . $response->getMessage();
}

许可证

©️版权所有2022 NXTS开发者。代码在MPL-2.0许可证下发布。