Giter VIP home page Giter VIP logo

gateapi-nodejs's People

Contributors

revilwang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

gateapi-nodejs's Issues

Invalid time range

Hello, I tried to fetch my trade history by calling ”new GateApi.SpotApi(client).listMyTrades(currencyPair, options)" with specifying time range.

But I got an error response saying data: { label: 'INVALID_PARAM_VALUE', message: 'invalid time range' }.
I specified "from: 1648772732" and "to: 1652771175", which is from 4/1 to 5/17.

It works when I don't specify the "to" param but it only gives me trade history for one week since 4/1.

Is there any max time range we can specify?
How long can I specify the time range?

Thank you.

Response Data Get ?

Hi

I didn't use json parse. How take Currency and available ?

[ SpotAccount { currency: 'BTC', available: '0', locked: '0' } ]

No information where to put auth information for the user account

Could You please provide information where to put auth information for us developers? Where should i pass username and password to ApiCLient? How?

edit: I found that setApiKeySecret() function is missing from ApiClient.js!
it is present in ts version , please fix this

incorrect last price using listTickers for currency pair

Made  the following request using `listTickers` at  3:11:40 AM UTC 
 {
    currencyPair: 'MASK_USDT',
    last: '13.5',
    ...
  }

Using listCandlesticks with 10sec interval received the following historical for the same currency pair at at
3:11:40 AM UTC

 {
    currencyPair: 'MASK_USDT',
    close: '11.44',
    ...
  }

If i want to retrieve realtime price for currency pair is listTickers best suited for this?

The listCandlesticks historical snapshot seem to match the Gate.io Webapp graph , the listTickers seem way off. is this due to caching ?

Should i use the listOrderBook function instead ?

Any guidance will be much appreciated.

Get single currency balance

I want to get single currency balance like "SIN" balance.
But there is just "GET /wallet/total_balance" to get total balance,this endpoint returns an approximate sum of exchanged amount from all currencies to input currency for each account.
Is there any way to get it?
Thank You!

提现安全审核

每次我用gateapi进行提现操作,结果返回了请求成功,但是我每次的提现单号都会进入1~8小时的安全审核状态,让我人工处理。
我检查了平台apiv4的白名单和权限都没问题。
请问下有什么办法能够避免这种情况呢?

Optional attributes on the futures API

Hello. Is there a reason why there are some critical attributes on Futures API that are optional?

Example: https://github.com/gateio/gateapi-nodejs/blob/master/model/futuresOrderBookItem.ts

In the FuturesOrderBookItem, p for price and s for size are both optional, even tho they are both always present.

Another example is the FuturesOrderBook itself: https://github.com/gateio/gateapi-nodejs/blob/master/model/futuresOrderBook.ts

current and update - as I can see from the documentation - are always present.

Thanks in advance =)

trade price and amount has less precision than webapp value

Using this Lib when i query my account trades , i have noticed the trade amount and price retrieved value is less precise than the value viewable on the webapp. i.e

Using webapp at https://www.gate.io/myaccount/myhistory shows the following for a trade :

price: 0.000000022
amount: 16,132,646.41444999911

Using gateapi-nodejs lib and calling listMyTrades function i receive the following:

price: 0.00000002
amount: 16,132,646.41445

The Issue: Notice the gateapi-nodejs lib response has less digits after the decimal place

How can i receive a more precise values.

No way to create order

Hello, I want to create a spot order through this guide:
https://github.com/gateio/gateapi-nodejs/blob/master/docs/SpotApi.md#createOrder
But I am getting a error with the example code:

gateSpotOrders.js:8
const order = new Order(); // Order |
              ^

ReferenceError: Order is not defined

https://github.com/gateio/gateapi-nodejs/blob/master/docs/Order.md

Is there any fix for this or how do I create a order? In the API its simple json but no details on how to do it with the nodejs package

I got double order when calling createOrder

I got double order when calling the function createOrder

This is my code

const createOrder = (price, amount, side) => {
  const api = new GateApi.SpotApi(client);
  const order = new Order(); // Order |
  order.price = price; // string | Order price
  order.amount = amount; // string | Order amount
  order.side = side; // string | Order side
  order.currencyPair = currencyPair; // string | Currency pair
  api.createOrder(order).then(
    (value) =>
      console.log("API called successfully. Returned data: ", value.body),
    (error) => console.error(error)
  );
};

Screen Shot 2021-11-07 at 22 56 18

Thanks!

Futures order amount

I didn't fully understand futures order. For example, I will buy $5 dogecoin. I couldn't understand how to enter 5 dollars into the API. Can you help me? I think I need to set this $5 with another api request. But how and where do I do it?

By looking at the process on the web, I enter size as 1 and price as 0. In this case, it tries to do the same thing I did last time on the web.

Close method in futures dual postion mode

I would like to place an order to close a long position in futures dual position mode.
The API manual says "In dual position mode, to close one side position, you need to set auto_size side, reduce_only to true and size to 0",
so I coded and ran it as follows.

const params = { contract: symbol, size: 0, price: 0, auto_size:"close_long", reduce_only: true, tif: "ioc" };
createFuturesOrder("usdt", params);

If I run it, I see an 'invalid size with close-order' error message.

If I change that code to size: 1 and run it, a long position is created,
If I change size: -1, a short position is created.

How can I close my positions?

Future open order list (Size does not give decimal value)

This is the response i am getting by calling listFuturesOrders
where i place this order with size of 0.1 BTC
But i am getting Integer value
Note i am using future testnet

FuturesOrder {
  id: 730839938,
  user: 11867749,
  createTime: 1657354368.131,
  finishTime: undefined,
  finishAs: undefined,
  status: 'open',
  contract: 'BTC_USDT',
  size: 1000,
  iceberg: 0,
  price: '21486.5',
  close: undefined,
  isClose: false,
  reduceOnly: undefined,
  isReduceOnly: false,
  isLiq: false,
  tif: 'gtc',
  left: 1000,
  fillPrice: '21486.5',
  text: 'web',
  tkfr: '0.0005',
  mkfr: '0.00015',
  refu: 0,
  autoSize: undefined
}

listMyTrades call immediately after closed IOC order returns empty array

Scenario:

I place a IOC order using createOrder , status === closed in response, then immediately I call listMyTrades using the order crypto_pair and the order_id.

Expected: the listMyTrades request should return trades array.

Actual: Response is an empty array

If i wait few seconds and call the listMyTrades again using the order crypto_pair and the order_id I correctly recieve the trades in the response.

Is this the correct behavior?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.