tokenly/substation-client

向 Substation API 发起请求

v0.7.3 2018-10-16 15:47 UTC

README

向 Substation API 发起请求

安装

通过 composer 添加包

composer require tokenly/substation-client

与 Laravel 的用法

服务提供器将自动在 Laravel 5.5+ 应用程序中注册。

设置环境变量

SUBSTATION_CONNECT=https://substation.tokenly.com

使用它

// init the client
$substation_client = app(\Tokenly\SubstationClient\SubstationClient::class);

// create a wallet
$response = $substation_client->createServerManagedWallet('bitcoin', 'My App Wallet');
$wallet_uuid = $response['uuid'];
echo "Wallet ID is " . $wallet_uuid . "\n";

// allocate an address
$response = $substation_client->allocateAddress($wallet_uuid);
$address_uuid = $response['uuid'];
$address_hash = $response['address']; // An address hash like 1AAAA1111xxxxxxxxxxxxxxxxxxy43CZ9j

客户端方法在 SubstationClient 类 中以行内文档的形式进行了说明。

有关 API 调用的详细信息,请参阅 https://app.swaggerhub.com/apis/tokenly/Substation/1.0.0