Skip to content

Commit 1763552

Browse files
author
github-actions
committed
[BUILD][TRANSFER][PUBLISH]
1 parent b7bb24a commit 1763552

File tree

6 files changed

+13
-47
lines changed

6 files changed

+13
-47
lines changed

README.md

Lines changed: 8 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,15 @@
1-
# bingx-python
2-
Python SDK (sync and async) for Bingx with Rest and WS capabilities.
1+
# about
32

4-
You can check Bingx's docs here: [Docs](https://ccxt.com)
3+
this is internal dev repo, not meant to be used by end users.
54

5+
# instructions
66

7-
You can check the SDK docs here: [SDK](https://docs.ccxt.com/#/exchanges/bingx)
7+
- At first, generate `Personal Access Token` under `CCXT` org, with the access to this current repository and also to all other repositories (there are around 20 repositories named like: `github.com/ccxt/{exchange}-python`) with the scopes `actions, commit statuses, contents, workflows` and set that value for action secret with the name `API_TOKEN_FOR_CCXT_SINGLE_EXCHANGES`.
88

9-
*This package derives from CCXT and allows you to call pretty much every endpoint by either using the unified CCXT API or calling the endpoints directly*
9+
- Then inside `.github/workflows/transfer-all.yml` set the desired array of exchanges in matrix. On `push` event, if commit message contains `[TRANSFER]`, this repo files will be distributed to those dozen exchange repositories.
1010

11-
## Installation
11+
- Immediately, as those repositories get `push` event (if commit message contains the phrase `[BUILD]`) the individual exchange repos start build with `.github/workflows/build-single-exchange.yml` flow, so the exchange-specific package is generated from raw skeleton repo & ccxt files.
1212

13-
```
14-
pip install bingx
15-
```
16-
17-
## Usage
18-
19-
### Async
20-
21-
```Python
22-
from bingx import BingxAsync
23-
24-
async def main():
25-
instance = BingxAsync({})
26-
order = await instance.create_order(__EXAMPLE_SYMBOL__, "limit", "buy", 1, 100000)
27-
```
28-
29-
### Sync
30-
31-
```Python
32-
from bingx import BingxSync
33-
34-
def main():
35-
instance = BingxSync({})
36-
order = instance.create_order(__EXAMPLE_SYMBOL__, "limit", "buy", 1, 100000)
37-
```
38-
39-
### Websockets
40-
41-
```Python
42-
from bingx import BingxWs
43-
44-
async def main():
45-
instance = BingxWs({})
46-
while True:
47-
orders = await instance.watch_orders(__EXAMPLE_SYMBOL__)
48-
```
13+
- If commit message also contained the phrase `[PUBLISH]` then they will push a package to pypi.org (you should set `PYPI_API_SECRET_SP` secret with pypi api key, under each repository). Versions are incremental by patch version at this moment.
4914

15+
- All other things are WIP and can be customized.

build/build.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ class build {
148148
const otherStrings = {
149149
'__LINK_TO_OFFICIAL_EXCHANGE_DOCS__': 'https://ccxt.com',
150150
'__PYTHON_PACKAGE_NAME__': undefined,
151-
'__TEST_SYMBOL__': 'BTC/USDC',
151+
'__EXAMPLE_SYMBOL__': 'BTC/USDC',
152152
};
153153
const exchangeConfig = this.globalConfigs['exchanges'][this.exchange];
154154
for (const key in otherStrings) {

build/global-configs.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
},
3737
"hyperliquid": {
3838
"__PYTHON_PACKAGE_NAME__": "hyperliquid",
39-
"__TEST_SYMBOL__": "BTC/USDC:USDC"
39+
"__EXAMPLE_SYMBOL__": "BTC/USDC:USDC"
4040
},
4141
"kucoin": {
4242
"__PYTHON_PACKAGE_NAME__": "kucoin-api"

build/templates/examples/async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
async def main():
1515
instance = __ExchangeName__Async({})
1616
await instance.load_markets()
17-
symbol = "__TEST_SYMBOL__"
17+
symbol = "__EXAMPLE_SYMBOL__"
1818

1919
# fetch ticker
2020
#

build/templates/examples/sync.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
def main():
1111
instance = __ExchangeName__Sync({})
1212
instance.load_markets()
13-
symbol = "__TEST_SYMBOL__"
13+
symbol = "__EXAMPLE_SYMBOL__"
1414

1515
# fetch ticker
1616
#

build/templates/examples/websockets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ async def my_watch_orderbook(exchange, symbol):
2929
async def main():
3030
instance = __ExchangeName__Ws({})
3131
await instance.load_markets()
32-
symbol = "__TEST_SYMBOL__"
32+
symbol = "__EXAMPLE_SYMBOL__"
3333

3434
# fetch ticker
3535
ticker = my_watch_ticker_my(instance, symbol)

0 commit comments

Comments
 (0)