tiagosiebler / bitget-api Goto Github PK
View Code? Open in Web Editor NEWNode.js SDK for the Bitget APIs and WebSockets, with TypeScript & browser support.
License: MIT License
Node.js SDK for the Bitget APIs and WebSockets, with TypeScript & browser support.
License: MIT License
hello.
Thank you for developing great open source.
There is no Copy Trading endpoint in the V2 API.
Is it possible to add it?
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
Hi,
I'm tryng to get all account history trades which seems impossible to do?
Bitget's API docs says i can get the trades without having to select a symbol, but the type inside the lib forces it.
Whats the best way to get ALL trade history regardless of symbol and possibly date?
Thanks
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';
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.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.