定制 cobo/cobo_custody 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

cobo/cobo_custody

最新稳定版本:v0.2.30

Composer 安装命令:

composer require cobo/cobo_custody

包简介

Cobo Custody php sdk

README 文档

README

License: GPL v2 GitHub Release

About

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.

Documentation

To access the API documentation, navigate to the API references.

For more information on Cobo's PHP SDK, refer to the PHP SDK Guide.

Usage

Before You Begin

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.

Requirements

PHP 7.0 or newer.

Installation

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"
  }
}

Code Sample

Generate Key Pair

<?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'];

Initialize RestClient

<?php
require 'vendor/autoload.php';

use Cobo\Custody\Config;
use Cobo\Custody\LocalSigner;
use Cobo\Custody\Client;

$client = new Client($signer, Config::DEV, false);

Initialize ApiSigner

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:

Complete Code Sample

<?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();

?>

统计信息

  • 总下载量: 13.74k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 12
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2021-07-01