Giter VIP home page Giter VIP logo

bitget-api's People

Contributors

dependabot[bot] avatar footcoderr avatar jj-cro avatar maythasit avatar t0chk avatar tiagosiebler avatar tim142857 avatar tyranthosaurus 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

Watchers

 avatar  avatar  avatar

bitget-api's Issues

Add V2 copy trading endpoints

hello.
Thank you for developing great open source.
There is no Copy Trading endpoint in the V2 API.
Is it possible to add it?

Add new rest and ws updates

  • Added new interface RestAPI -> trade -> added "Get sub Account Assets";
  • Future -> RestAPI -> Public -> added "Get Coin List" rateLimit updated to 3/s(IP);
  • RestAPI -> Public -> added bidSz', 'askSz' to interface ticker" and "tickers"
  • WebsocketAPI -> Private Channel -> Order Channel -> Push data parameters -> 'status' supplement enum: 'init'
  • WebsocketAPI -> Public Channel -> Ticker Channel -> Push data parameters -> added 'bidSz', 'askSz'
  • [ ]
    Details please refer to the instruction: https://bitgetlimited.github.io/apidoc/en/mix/

Uncaught TypeError: class heritage events_1.EventEmitter is not an object or null

Hi, im getting this error and its crashing my react app.

I wrapped the client inside a hook:

import {FuturesClient} from "bitget-api";
import {supabase} from "../supabase-client";
import {useAuth} from "../providers/user-provider";

export const useBitgetClient = (): FuturesClient => {
    const {user} = useAuth();
    const {data, error} = supabase
        .from("bitget_api")
        .select(`api_secret, api_phrase, api_key`)
        .eq("user_id", user?.id)
        .single();

    if (!data) {
        throw new Error("BitgetClient data not available");
    }

    const clientOptions = {
        apiKey: data.api_key,
        apiSecret: data.api_secret,
        apiPass: data.api_phrase
    };

    const bitgetClient = new FuturesClient(clientOptions);

    return bitgetClient;
};

And using it inside components like this:

 const history = useBitgetClient()
        .getRecentTrades("BTCUSDT_UMCBL")
        .then((r) => console.log("getHistoricTrades", r));

    console.log("history", history);

When I start the app the app now crashes. After doing some research it turns out there's an issue with Vite which does automatically polyfill node.js modules.

From the vite website:

Module externalized for browser compatibility

When you use a Node.js module in the browser, Vite will output the following warning.

Module "fs" has been externalized for browser compatibility. Cannot access "fs.readFile" in client code.

This is because Vite does not automatically polyfill Node.js modules.

We recommend avoiding Node.js modules for browser code to reduce the bundle size, although you can add polyfills manually. If the module is imported from a third-party library (that's meant to be used in the browser), it's advised to report the issue to the respective library.


Is there something else I can do until this has been improved? I'm kinda stuck for now not being able to access Bitget data.

Thanks

Screenshot 2023-08-25 at 22 26 29

Error in Typinng WsPublicTopicV2

File : client.d.ts
Error : WsPublicTopicV2 type have 'candle15' and should be 'candle15m'

export declare type WsPublicTopicV2 = 'index-price' | 'ticker' | 'candle1m' | 'candle5m' | 'candle15' | 'candle30m' | 'candle1H' | 'candle4H' | 'candle6H' | 'candle12H' | 'candle1D' | 'candle3D' | 'candle1W' | 'candle1M' | 'candle6Hutc' | 'candle12Hutc' | 'candle1Dutc' | 'candle3Dutc' | 'candle1Wutc' | 'candle1Mutc' | 'trade' | 'books' | 'books1' | 'books5' | 'books15';

Need add a type in FuturesPlanType

I found out while using the API below.
cancelAllPlanOrders(productType: FuturesProductType, planType: FuturesPlanType): Promise<APIResponse<any>>;

need to add 'normal_plan' to the FuturesPlanType type.

Error INVALID_ACCESS_KEY

Hi, just trying to use this library but i don't understand what this error means:

{
  code: 400,
  message: 'Bad Request',
  body: {
    code: '40006',
    msg: 'Invalid ACCESS_KEY',
    requestTime: 1707473926922,
    data: null
  },
}

I was reviewed all the keys and are equal from bitget.

My peace of code:

const { RestClientV2 } = require('bitget-api');

const client = new RestClientV2(process.env.APIKEY, process.env.SECRET, process.env.PASSPHRASE);
console.log(await client.getSpotAccount());

Thanks

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.