diff --git a/README.md b/README.md index fb6f1f4..8ba3f1e 100644 --- a/README.md +++ b/README.md @@ -160,13 +160,43 @@ In rare situations, you may want to see the raw HTTP requets being built as well ## Browser Usage +### Import + +This is the "modern" way, allowing the package to be directly imported into frontend projects with full typescript support. + +1. Install these dependencies + ```sh + npm install crypto-browserify stream-browserify + ``` +2. Add this to your `tsconfig.json` + ```json + { + "compilerOptions": { + "paths": { + "crypto": [ + "./node_modules/crypto-browserify" + ], + "stream": [ + "./node_modules/stream-browserify" + ] + } + ``` +3. Declare this in the global context of your application (ex: in polyfills for angular) + ```js + (window as any).global = window; + ``` + +### Webpack + +This is the "old" way of using this package on webpages. This will build a minified js bundle that can be pulled in using a script tag on a website. + Build a bundle using webpack: - `npm install` - `npm build` - `npm pack` -The bundle can be found in `dist/`. Altough usage should be largely consistent, smaller differences will exist. Documentation is still TODO. +The bundle can be found in `dist/`. Altough usage should be largely consistent, smaller differences will exist. Documentation is still TODO - contributions welcome. --- @@ -184,11 +214,6 @@ Support my efforts to make algo trading accessible to all - register with my ref - [OKX](https://www.okx.com/join/18504944) - [FTX](https://ftx.com/referrals#a=ftxapigithub) -Or buy me a coffee using any of these: - -- BTC: `1C6GWZL1XW3jrjpPTS863XtZiXL1aTK7Jk` -- ETH (ERC20): `0xd773d8e6a50758e1ada699bb6c4f98bb4abf82da` - ### Contributions & Pull Requests Contributions are encouraged, I will review any incoming pull requests. See the issues tab for todo items. diff --git a/package-lock.json b/package-lock.json index 932f855..41daefd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "bitget-api", - "version": "1.0.3", + "version": "1.1.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "bitget-api", - "version": "1.0.3", + "version": "1.1.2", "license": "MIT", "dependencies": { "axios": "^0.27.2", diff --git a/package.json b/package.json index f9e0fa2..1846d47 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bitget-api", - "version": "1.1.1", + "version": "1.1.2", "description": "Node.js connector for Bitget REST APIs and WebSockets, with TypeScript & end-to-end tests.", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -42,8 +42,6 @@ "keywords": [ "bitget", "bitget api", - "okex", - "okex api", "api", "websocket", "rest", diff --git a/src/types/request/futures.ts b/src/types/request/futures.ts index d36d90f..07273c1 100644 --- a/src/types/request/futures.ts +++ b/src/types/request/futures.ts @@ -128,7 +128,14 @@ export interface ModifyFuturesPlanOrderTPSL { presetStopLossPrice?: string; } -export type FuturesPlanType = 'profit_plan' | 'loss_plan' | 'moving_plan'; +export type FuturesPlanType = + | 'profit_plan' + | 'loss_plan' + | 'normal_plan' + | 'pos_profit' + | 'pos_loss' + | 'moving_plan' + | 'track_plan'; export interface NewFuturesPlanStopOrder { symbol: string;