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

Commit

Permalink
Merge pull request #126 from Kucoin/dev
Browse files Browse the repository at this point in the history
fix transfer params
  • Loading branch information
ISAAC-XXYYZZ authored Jan 23, 2025
2 parents 6bee30d + b71508e commit e7de4be
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 14 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/upload-python-sdk-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Upload Python SDK Package

on:
workflow_dispatch:
inputs:
publish:
description: "Publish Python SDK to PyPI"
required: false
default: "false"

permissions:
contents: read
packages: write
id-token: write

jobs:
release-build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.x"

- name: Build release distributions
working-directory: .
run: |
python -m pip install --upgrade pip build
python -m build
- name: Upload distributions
uses: actions/upload-artifact@v4
with:
name: release-dists
path: dist/

pypi-publish:
runs-on: ubuntu-latest
needs: release-build
permissions:
contents: read
packages: write
id-token: write

steps:
- name: Retrieve release distributions
uses: actions/download-artifact@v4
with:
name: release-dists
path: dist/

- name: Conditional Publish
if: ${{ inputs.publish == 'true' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
2 changes: 0 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ The KuCoin Universal SDK offers:
- Enhanced performance and stability.
- Continued support and updates.

👉 **New SDK Repository**: [https://github.com/Kucoin/kucoin-universal-sdk](https://github.com/Kucoin/kucoin-universal-sdk)

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.


Expand Down
31 changes: 20 additions & 11 deletions kucoin/user/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ def transfer_master_sub(self, currency, amount, direction, subUserId, clientOid=
params['clientOid'] = clientOid
return self._request('POST', '/api/v2/accounts/sub-transfer', params=params)

def inner_transfer(self, currency, from_payer, to_payee, amount, clientOid=''):
def inner_transfer(self, currency, from_payer, to_payee, amount, clientOid='', from_tag=None, to_tag=None):
"""
https://docs.kucoin.com/#inner-transfer
:param currency: currency (Mandatory)
Expand All @@ -389,6 +389,10 @@ def inner_transfer(self, currency, from_payer, to_payee, amount, clientOid=''):
:type: str
:param clientOid: Unique order id created by users to identify their orders, e.g. UUID. (Mandatory)
:type: str
:param from_tag: Trading pair, required when the payment account type is isolated, e.g.: BTC-USDT (optional)
:type: str
:param to_tag: Trading pair, required when the payment account type is isolated, e.g.: BTC-USDT (optional)
:type: str
:return:
{
"orderId": "5bd6e9286d99522a52e458de"
Expand All @@ -400,6 +404,12 @@ def inner_transfer(self, currency, from_payer, to_payee, amount, clientOid=''):
'to': to_payee,
'amount': amount
}

if from_tag:
params['fromTag'] = from_tag
if to_tag:
params['toTag'] = to_tag

if not clientOid:
clientOid = self.return_unique_id
params['clientOid'] = clientOid
Expand Down Expand Up @@ -427,22 +437,21 @@ def create_deposit_address(self, currency, chain=None):
params['chain'] = chain
return self._request('POST', '/api/v1/deposit-addresses', params=params)

def flex_transfer(self, clientOid,amount,fromAccountType,type,toAccountType,
currency=None,fromUserId=None,fromAccountTag=None,toUserId=None,toAccountTag=None):
def flex_transfer(self, clientOid, amount, fromAccountType, type, toAccountType,
currency, fromUserId=None, fromAccountTag=None, toUserId=None, toAccountTag=None):
"""
FlexTransfer
https://www.kucoin.com/docs/rest/funding/transfer/flextransfer
"""
params = {
"clientOid": clientOid,
"type": type,
"amount": amount,
"fromAccountType": fromAccountType,
"toAccountType": toAccountType
}
"clientOid": clientOid,
"type": type,
"amount": amount,
"fromAccountType": fromAccountType,
"toAccountType": toAccountType,
"currency": currency,
}

if currency:
params['currency'] = currency
if fromUserId:
params['fromUserId'] = fromUserId
if fromAccountTag:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name='kucoin-python',
version='v1.0.25',
version='v1.0.26',
packages=['kucoin', 'kucoin/base_request', 'kucoin/margin', 'kucoin/market', 'kucoin/trade', 'kucoin/user','kucoin/lending','kucoin/earn',
'kucoin/websocket', 'kucoin/ws_token'],
license="MIT",
Expand Down

0 comments on commit e7de4be

Please # to comment.