Skip to content

Commit e2d313d

Browse files
authored
Merge pull request #61 from hhxsv5/master
Add innerTransferV2()
2 parents 39676ae + d5f7cd7 commit e2d313d

File tree

2 files changed

+30
-5
lines changed

2 files changed

+30
-5
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,8 @@ go(function () {
179179
| KuCoin\SDK\PrivateApi\Account::getDetail() | YES | https://docs.kucoin.com/#get-an-account |
180180
| KuCoin\SDK\PrivateApi\Account::getLedgers() | YES | https://docs.kucoin.com/#get-account-ledgers |
181181
| KuCoin\SDK\PrivateApi\Account::getHolds() | YES | https://docs.kucoin.com/#get-holds |
182-
| KuCoin\SDK\PrivateApi\Account::innerTransfer() | YES | https://docs.kucoin.com/#inner-transfer |
182+
| KuCoin\SDK\PrivateApi\Account::innerTransfer() | YES | `DEPRECATED` https://docs.kucoin.com/#inner-transfer |
183+
| KuCoin\SDK\PrivateApi\Account::innerTransferV2() | YES | https://docs.kucoin.com/#inner-transfer |
183184
| KuCoin\SDK\PrivateApi\Account::getSubAccountUsers() | YES | https://docs.kucoin.com/#get-user-info-of-all-sub-accounts |
184185
| KuCoin\SDK\PrivateApi\Account::getSubAccountDetail() | YES | https://docs.kucoin.com/#get-account-balance-of-a-sub-account |
185186
| KuCoin\SDK\PrivateApi\Account::getSubAccountList() | YES | https://docs.kucoin.com/#get-the-aggregated-balance-of-all-sub-accounts-of-the-current-user |

src/PrivateApi/Account.php

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,15 @@ public function getHolds($accountId, array $pagination = [])
8888

8989
/**
9090
* Inner transfer
91-
* @param string $clientOid
92-
* @param string $payAccountId
93-
* @param string $recAccountId
94-
* @param float $amount
91+
* @param string $clientOid Request ID
92+
* @param string $payAccountId Account ID of payer
93+
* @param string $recAccountId Account ID of receiver
94+
* @param string $amount Transfer amount, a quantity that exceeds the precision of the currency
9595
* @return array
9696
* @throws \KuCoin\SDK\Exceptions\BusinessException
9797
* @throws \KuCoin\SDK\Exceptions\HttpException
9898
* @throws \KuCoin\SDK\Exceptions\InvalidApiUriException
99+
* @deprecated This interface was discontinued on August 29, 2019. Please use the transfer v2 interface provided below.
99100
*/
100101
public function innerTransfer($clientOid, $payAccountId, $recAccountId, $amount)
101102
{
@@ -107,6 +108,29 @@ public function innerTransfer($clientOid, $payAccountId, $recAccountId, $amount)
107108
return $response->getApiData();
108109
}
109110

111+
/**
112+
* Inner transfer V2, recommended for use on June 5, 2019
113+
* @param string $clientOid Request ID
114+
* @param string $currency Currency
115+
* @param string $from The account type of payer main or trade
116+
* @param string $to The account type of payee main or trade
117+
* @param string $amount Transfer amount, a quantity that exceeds the precision of the currency
118+
* @return array
119+
* @throws \KuCoin\SDK\Exceptions\BusinessException
120+
* @throws \KuCoin\SDK\Exceptions\HttpException
121+
* @throws \KuCoin\SDK\Exceptions\InvalidApiUriException
122+
* @deprecated This interface was discontinued on August 29, 2019. Please use the transfer v2 interface provided below.
123+
*/
124+
public function innerTransferV2($clientOid, $currency, $from, $to, $amount)
125+
{
126+
$response = $this->call(
127+
Request::METHOD_POST,
128+
'/api/v2/accounts/inner-transfer',
129+
compact('clientOid', 'currency', 'from', 'to', 'amount')
130+
);
131+
return $response->getApiData();
132+
}
133+
110134
/**
111135
* Get user info of all sub-accounts
112136
* @return array

0 commit comments

Comments
 (0)