luno/luno-php

Luno API 的 PHP SDK

0.0.14 2023-05-15 09:54 UTC

This package is not auto-updated.

Last update: 2024-09-16 16:13:53 UTC


README

Luno API 构建状态

此 PHP 包为 Luno API 提供了包装器。

安装

composer require "luno/luno-php"

身份验证

请访问 设置 页面以生成 API 密钥。

示例用法

$client = new Luno\Client();
$client->setAuth("api_key_id", "api_key_secret");

$req = new Luno\Request\GetOrderBook();
$req->setPair("XBTZAR");

try {
  $res = $client->getOrderBook($req);
  echo "Found " . count($res->getBids()) . " bid(s)";
} catch (Luno\Error $e) {
  echo $e->message();
}

许可协议

MIT