PipedreamHQ / pipedream

Connect APIs, remarkably fast. Free for developers.
https://pipedream.com
Other
8.32k stars 5.27k forks source link

feat: BingX API interface complete :) #4381

Closed trendoscope-algorithms closed 1 year ago

trendoscope-algorithms commented 1 year ago

Initial action getBalance implemented and tested.

image

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
pipedream-docs ✅ Ready (Inspect) Visit Preview Oct 6, 2022 at 1:52PM (UTC)
pipedream-docs-redirect-do-not-edit ✅ Ready (Inspect) Visit Preview Oct 6, 2022 at 1:52PM (UTC)
dylburger commented 1 year ago

Thank you so much for submitting this! We've added it to our backlog to review, and our team has been notified.

dylburger commented 1 year ago

Thanks for submitting this PR! When we review PRs, we follow the Pipedream component guidelines. If you're not familiar, here's a quick checklist:

trendoscope-algorithms commented 1 year ago

Updated tests.

Get Balance: image

Get Positions: image

vellames commented 1 year ago

@trendoscope-algorithms Is this PR still in draft?

trendoscope-algorithms commented 1 year ago

@trendoscope-algorithms Is this PR still in draft?

Just one more round of test and will update it :) thanks @vellames for your help throughout. Really good suggestions on moving common block to app.

trendoscope-algorithms commented 1 year ago

Tests.

Account GetBalance: image

Account GetPositions: image

Market GetAllContracts image

Market GetCurrentFunding image

Market GetHistoricalFunding image

Market GetKLine image

Market GetLatestPrice image

Market GetMarketDepth image

Market GetMarketTrades image

I will not be testing trades one now as it will need money for trading. Will do that later. But, feel free to do it from your side :)

trendoscope-algorithms commented 1 year ago

Looks like there is one more issue. I am unable to typify numberical values. There is integer. But, I am unable to use float, double, number for floating point values. Any suggestions?

image

Also, is it possible to add a date picker type?

trendoscope-algorithms commented 1 year ago

Looks like there is one more issue. I am unable to typify numberical values. There is integer. But, I am unable to use float, double, number for floating point values. Any suggestions?

Solved. And ready to be merged :)

trendoscope-algorithms commented 1 year ago

Hi @trendoscope-algorithms, I was going to push to your repo but it seems that I won't be able to test all. Can you please follow this folder structure? And then let's merge this. Thank you very much.

Done.

trendoscope-algorithms commented 1 year ago

Hi @feyzullah , @vellames - the request is still showing changes required. Wonder if it is also expecting @vellames to approve as he requested changes earlier. Can you please check this?

trendoscope-algorithms commented 1 year ago

thanks @feyzullah :)

feyzullah commented 1 year ago

@trendoscope-algorithms it is done. Now QA team will review :)

vunguyenhung commented 1 year ago

Hello @trendoscope-algorithms, I have tested this PR and there're 2 test cases failed. Thank you so much for your contribution!

Please check the test report below for more information BingX_4381_2239.pdf

trendoscope-algorithms commented 1 year ago

Hello @trendoscope-algorithms, I have tested this PR and there're 2 test cases failed. Thank you so much for your contribution!

Hi @vunguyenhung ,

It is working fine for me.

The getbalance and other trade related operations are done on perpetual future account and not spot account. It may be possible that you have not enabled this type of account? Usually they are not enabled due to high risk nature.

image

image

Can you check once?

vunguyenhung commented 1 year ago

Hello @trendoscope-algorithms, thank you for replying! I understand that users having spot and future account enabled will not got the error. Though there might be other users that just like me, and showing them error is not really user friendly. Is it possible to catch the error and still show data in this case?

trendoscope-algorithms commented 1 year ago

Hello @trendoscope-algorithms, thank you for replying! I understand that users having spot and future account enabled will not got the error. Though there might be other users that just like me, and showing them error is not really user friendly. Is it possible to catch the error and still show data in this case?

Thanks @vunguyenhung I have updated code to show the error message received from the API.

image

It will be the same error for both as both issues came from getBalance() failure in case if there is no futures account.

vunguyenhung commented 1 year ago

Hi everyone, I have added some commits to improve this and confirm that all test cases are passed!

Test report BingX_4381.pdf

vunguyenhung commented 1 year ago

I will merge this on behave of @trendoscope-algorithms!

vunguyenhung commented 1 year ago

/approve

trendoscope-algorithms commented 1 year ago

Awesome. Thanks very much guys - @vellames , @feyzullah , @vunguyenhung

gilusgit commented 1 year ago

Hey, I suggested with other BingX events and created event for Spot but somethings is wrong with it. I'm not very good at coding. Can someone help?

import bingx from "../../bingx.app.mjs";

export default { name: "BingX Trade New Spot Order", version: "0.0.3", key: "bingx-trade-new-spot-order", description: "Place a New Spot Order .", props: { bingx, symbol: { propDefinition: [ bingx, "symbol", ], }, side: { propDefinition: [ bingx, "side", ], }, type: { propDefinition: [ bingx, "type", ], }, quoteOrderQty: { propDefinition: [ bingx, "quoteOrderQty", ], }, quantity: { propDefinition: [ bingx, "quantity", ], }, }, type: "action", async run({ $ }) { const API_METHOD = "POST"; const API_PATH = "/openApi/spot/v1/trade/order"; const parameters = { "symbol": this.symbol, "side": this.side, "quoteOrderQty": this.bingx.convertToFloat(this.quoteOrderQty), "quantity": this.bingx.convertToFloat(this.quantity), "type": this.type, }; const returnValue = await this.bingx.makeRequest(API_METHOD, API_PATH, parameters); $.export("$summary", New Spot Order for ${this.symbol}); return returnValue; }, };

gilusgit commented 1 year ago

it shows error like this:

Code Error Cannot find module '/tmp/bingx.app.mjs' Require stack: - /var/task/src/index.js - /var/runtime/UserFunction.js - /var/runtime/Runtime.js - /var/runtime/index.js

abbasazad commented 5 months ago

new address for bingx from 30/11/2023 from api-swap-rest.bingbon.pro to api-swap-rest.bingx.com