This repository contains the official PHP SDK for Cobo WaaS API, enabling developers to integrate with Cobo's Custodial and/or MPC services seamlessly using the PHP programming language.
To access the API documentation, navigate to the API references.
For more information on Cobo's PHP SDK, refer to the PHP SDK Guide.
Ensure that you have created an account and configured Cobo's Custodial and/or MPC services. For detailed instructions, please refer to the Quickstart guide.
PHP 7.0 or newer.
The cobo_custody library can be conveniently installed using Composer.
-
first you need to install Composer
-
then add dependency in composer.json
{
"require": {
"cobo/cobo_custody": "0.2.30"
}
}
<?php
require 'vendor/autoload.php';
use Cobo\Custody\Config;
use Cobo\Custody\LocalSigner;
use Cobo\Custody\Client;
$key = LocalSigner::generateKeyPair();
echo "apiSecret:", $key['apiSecret'],"\n";
echo "apiKey:", $key['apiKey'];
<?php
require 'vendor/autoload.php';
use Cobo\Custody\Config;
use Cobo\Custody\LocalSigner;
use Cobo\Custody\Client;
$client = new Client($signer, Config::DEV, false);
ApiSigner
can be instantiated through $signer = new LocalSigner($key['apiSecret']);
$signer = new LocalSigner($key['apiSecret']);
In certain scenarios, the private key may be restricted from export, such as when it is stored in AWS Key Management Service (KMS). In such cases, please pass in a custom implementation using the ApiSigner interface:
<?php
require 'vendor/autoload.php';
use Cobo\Custody\Config;
use Cobo\Custody\LocalSigner;
use Cobo\Custody\Client;
$key = LocalSigner::generateKeyPair();
echo "apiSecret:", $key['apiSecret'],"\n";
echo "apiKey:", $key['apiKey'];
$signer = new LocalSigner($key['apiSecret']);
$client = new Client($signer, Config::DEV, false);
$res = $client->getAccountInfo();
?>