Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

Commit e7de4be

Browse files
authored
Merge pull request #126 from Kucoin/dev
fix transfer params
2 parents 6bee30d + b71508e commit e7de4be

File tree

4 files changed

+82
-14
lines changed

4 files changed

+82
-14
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Upload Python SDK Package
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
publish:
7+
description: "Publish Python SDK to PyPI"
8+
required: false
9+
default: "false"
10+
11+
permissions:
12+
contents: read
13+
packages: write
14+
id-token: write
15+
16+
jobs:
17+
release-build:
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- uses: actions/setup-python@v5
24+
with:
25+
python-version: "3.x"
26+
27+
- name: Build release distributions
28+
working-directory: .
29+
run: |
30+
python -m pip install --upgrade pip build
31+
python -m build
32+
33+
- name: Upload distributions
34+
uses: actions/upload-artifact@v4
35+
with:
36+
name: release-dists
37+
path: dist/
38+
39+
pypi-publish:
40+
runs-on: ubuntu-latest
41+
needs: release-build
42+
permissions:
43+
contents: read
44+
packages: write
45+
id-token: write
46+
47+
steps:
48+
- name: Retrieve release distributions
49+
uses: actions/download-artifact@v4
50+
with:
51+
name: release-dists
52+
path: dist/
53+
54+
- name: Conditional Publish
55+
if: ${{ inputs.publish == 'true' }}
56+
uses: pypa/gh-action-pypi-publish@release/v1
57+
with:
58+
packages-dir: dist/
59+
env:
60+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
61+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}

README.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ The KuCoin Universal SDK offers:
1111
- Enhanced performance and stability.
1212
- Continued support and updates.
1313

14-
👉 **New SDK Repository**: [https://github.com/Kucoin/kucoin-universal-sdk](https://github.com/Kucoin/kucoin-universal-sdk)
15-
1614
We appreciate your understanding and encourage you to migrate to the new SDK for a better development experience. Should you have any questions or require assistance, feel free to reach out to us.
1715

1816

kucoin/user/user.py

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ def transfer_master_sub(self, currency, amount, direction, subUserId, clientOid=
376376
params['clientOid'] = clientOid
377377
return self._request('POST', '/api/v2/accounts/sub-transfer', params=params)
378378

379-
def inner_transfer(self, currency, from_payer, to_payee, amount, clientOid=''):
379+
def inner_transfer(self, currency, from_payer, to_payee, amount, clientOid='', from_tag=None, to_tag=None):
380380
"""
381381
https://docs.kucoin.com/#inner-transfer
382382
:param currency: currency (Mandatory)
@@ -389,6 +389,10 @@ def inner_transfer(self, currency, from_payer, to_payee, amount, clientOid=''):
389389
:type: str
390390
:param clientOid: Unique order id created by users to identify their orders, e.g. UUID. (Mandatory)
391391
:type: str
392+
:param from_tag: Trading pair, required when the payment account type is isolated, e.g.: BTC-USDT (optional)
393+
:type: str
394+
:param to_tag: Trading pair, required when the payment account type is isolated, e.g.: BTC-USDT (optional)
395+
:type: str
392396
:return:
393397
{
394398
"orderId": "5bd6e9286d99522a52e458de"
@@ -400,6 +404,12 @@ def inner_transfer(self, currency, from_payer, to_payee, amount, clientOid=''):
400404
'to': to_payee,
401405
'amount': amount
402406
}
407+
408+
if from_tag:
409+
params['fromTag'] = from_tag
410+
if to_tag:
411+
params['toTag'] = to_tag
412+
403413
if not clientOid:
404414
clientOid = self.return_unique_id
405415
params['clientOid'] = clientOid
@@ -427,22 +437,21 @@ def create_deposit_address(self, currency, chain=None):
427437
params['chain'] = chain
428438
return self._request('POST', '/api/v1/deposit-addresses', params=params)
429439

430-
def flex_transfer(self, clientOid,amount,fromAccountType,type,toAccountType,
431-
currency=None,fromUserId=None,fromAccountTag=None,toUserId=None,toAccountTag=None):
440+
def flex_transfer(self, clientOid, amount, fromAccountType, type, toAccountType,
441+
currency, fromUserId=None, fromAccountTag=None, toUserId=None, toAccountTag=None):
432442
"""
433443
FlexTransfer
434444
https://www.kucoin.com/docs/rest/funding/transfer/flextransfer
435445
"""
436446
params = {
437-
"clientOid": clientOid,
438-
"type": type,
439-
"amount": amount,
440-
"fromAccountType": fromAccountType,
441-
"toAccountType": toAccountType
442-
}
447+
"clientOid": clientOid,
448+
"type": type,
449+
"amount": amount,
450+
"fromAccountType": fromAccountType,
451+
"toAccountType": toAccountType,
452+
"currency": currency,
453+
}
443454

444-
if currency:
445-
params['currency'] = currency
446455
if fromUserId:
447456
params['fromUserId'] = fromUserId
448457
if fromAccountTag:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
setup(
88
name='kucoin-python',
9-
version='v1.0.25',
9+
version='v1.0.26',
1010
packages=['kucoin', 'kucoin/base_request', 'kucoin/margin', 'kucoin/market', 'kucoin/trade', 'kucoin/user','kucoin/lending','kucoin/earn',
1111
'kucoin/websocket', 'kucoin/ws_token'],
1212
license="MIT",

0 commit comments

Comments
 (0)