bitcoinvn/bitcoinvn-php 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

bitcoinvn/bitcoinvn-php

Composer 安装命令:

composer require bitcoinvn/bitcoinvn-php

包简介

Multi cryptocurrency instant exchange

README 文档

README

The BitcoinVN SDK helps you to integrate with the BitcoinVN API.

Installation

Run composer install bitcoinvn/bitcoinvn-php

Usage

Generate an API key at https://bitcoinvn.io/api-keys

Examples

Get info

Object containing all sorts of information about assets and transfer methods supported on the exchange.

You can use this to check fees for example.

$bitcoinVn = new \BitcoinVN\BitcoinVN('YOUR_API_KEY');
$info = $bitcoinVn->info();

Get balances

Check your balances on the exchange.

$bitcoinVn = new \BitcoinVN\BitcoinVN('YOUR_API_KEY');
$balances = $bitcoinVn->balances();
foreach ($balances as $asset => $balance) {
    echo "My {$asset} balance: {$balance}\n";
}

#### Buy 0.1 BTC

```php
$bitcoinVn = new \BitcoinVN\BitcoinVN('YOUR_API_KEY');
$quote = $bitcoinVn->quote('vnd', 'btc', null, 0.1);
$order = $bitcoinVn->fixedSwap($quote->getId(), '12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX');
echo "Send {$order->getDepositAmount()} VND in order to receive 0.1 BTC.";

Buy BTC for 1,000,000 VND

$bitcoinVn = new \BitcoinVN\BitcoinVN('YOUR_API_KEY');
$quote = $bitcoinVn->quote('vnd', 'btc', 1_000_000);
$order = $bitcoinVn->fixedSwap($quote->getId(), '12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX');
echo "Send 1,000,000 VND in order to receive {$order->getSettleAmount()} BTC.";

Sell any amount of BTC for VND

You don't necessarily need a quote to create an order. With a variable order the final settle amount will be determined upon confirmation of your payment.

$bitcoinVn = new \BitcoinVN\BitcoinVN('YOUR_API_KEY');
$order = $bitcoinVn->variableSwap('btc', 'vnd', [
    'bank' => 'vietcombank',
    'accountNumber' => '0123456789',
    'accountHolder' => 'Satoshi Nakamoto'
]);
echo "Send any amount of BTC to {$order->getSettleData()['address']} in order to receive VND.";

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-12-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固