From baa8e727cd12f51526e9e5d4145374f62b541439 Mon Sep 17 00:00:00 2001 From: Tiago Siebler Date: Tue, 1 Oct 2024 16:15:06 +0100 Subject: [PATCH 1/2] v2.0.11: chore() bump dependencies, feat() update logo, feat() add spot bills type --- README.md | 18 ++- docs/images/logoBrightMode1.svg | 189 ++++++++++++++++++++++++++++++++ docs/images/logoBrightMode2.svg | 168 ++++++++++++++++++++++++++++ docs/images/logoDarkMode1.svg | 189 ++++++++++++++++++++++++++++++++ docs/images/logoDarkMode2.svg | 168 ++++++++++++++++++++++++++++ package-lock.json | 20 ++-- package.json | 2 +- src/rest-client-v2.ts | 11 +- src/types/response/spot.ts | 25 +++++ 9 files changed, 775 insertions(+), 15 deletions(-) create mode 100644 docs/images/logoBrightMode1.svg create mode 100644 docs/images/logoBrightMode2.svg create mode 100644 docs/images/logoDarkMode1.svg create mode 100644 docs/images/logoDarkMode2.svg diff --git a/README.md b/README.md index b989c58..4326fd6 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,25 @@ # Node.js & Typescript Bitget API SDK -[![Build & Test](https://github.com/tiagosiebler/bitget-api/actions/workflows/e2etests.yml/badge.svg?branch=master)](https://github.com/tiagosiebler/bitget-api/actions/workflows/e2etests.yml) [![npm version](https://img.shields.io/npm/v/bitget-api)][1] [![npm size](https://img.shields.io/bundlephobia/min/bitget-api/latest)][1] [![npm downloads](https://img.shields.io/npm/dt/bitget-api)][1] +[![Build & Test](https://github.com/tiagosiebler/bitget-api/actions/workflows/e2etests.yml/badge.svg?branch=master)](https://github.com/tiagosiebler/bitget-api/actions/workflows/e2etests.yml) +[![npm version](https://img.shields.io/npm/v/bitget-api)][1] +[![npm size](https://img.shields.io/bundlephobia/min/bitget-api/latest)][1] +[![npm downloads](https://img.shields.io/npm/dt/bitget-api)][1] [![last commit](https://img.shields.io/github/last-commit/tiagosiebler/bitget-api)][1] -[![CodeFactor](https://www.codefactor.io/repository/github/tiagosiebler/bitget-api/badge)](https://www.codefactor.io/repository/github/tiagosiebler/bitget-api) [![Telegram](https://img.shields.io/badge/chat-on%20telegram-blue.svg)](https://t.me/nodetraders) +[![CodeFactor](https://www.codefactor.io/repository/github/tiagosiebler/bitget-api/badge)](https://www.codefactor.io/repository/github/tiagosiebler/bitget-api) +[![Telegram](https://img.shields.io/badge/chat-on%20telegram-blue.svg)](https://t.me/nodetraders) -[![connector logo](https://github.com/tiagosiebler/bitget-api/blob/master/docs/images/logo1.png?raw=true)][1] +

+ + + + SDK Logo + + +

[1]: https://www.npmjs.com/package/bitget-api + Updated & performant JavaScript & Node.js SDK for the Bitget V2 REST APIs and WebSockets: - Complete integration with all Bitget APIs. diff --git a/docs/images/logoBrightMode1.svg b/docs/images/logoBrightMode1.svg new file mode 100644 index 0000000..375ae36 --- /dev/null +++ b/docs/images/logoBrightMode1.svg @@ -0,0 +1,189 @@ + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/images/logoBrightMode2.svg b/docs/images/logoBrightMode2.svg new file mode 100644 index 0000000..6425ad6 --- /dev/null +++ b/docs/images/logoBrightMode2.svg @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/images/logoDarkMode1.svg b/docs/images/logoDarkMode1.svg new file mode 100644 index 0000000..c8c6090 --- /dev/null +++ b/docs/images/logoDarkMode1.svg @@ -0,0 +1,189 @@ + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/images/logoDarkMode2.svg b/docs/images/logoDarkMode2.svg new file mode 100644 index 0000000..7878eac --- /dev/null +++ b/docs/images/logoDarkMode2.svg @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/package-lock.json b/package-lock.json index e3b31b0..0303bb1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "bitget-api", - "version": "2.0.10", + "version": "2.0.11", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "bitget-api", - "version": "2.0.10", + "version": "2.0.11", "license": "MIT", "dependencies": { "axios": "^1.6.1", @@ -3980,12 +3980,12 @@ } }, "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, "dependencies": { - "braces": "^3.0.2", + "braces": "^3.0.3", "picomatch": "^2.3.1" }, "engines": { @@ -8649,12 +8649,12 @@ "dev": true }, "micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, "requires": { - "braces": "^3.0.2", + "braces": "^3.0.3", "picomatch": "^2.3.1" } }, diff --git a/package.json b/package.json index de60418..699a4b2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bitget-api", - "version": "2.0.10", + "version": "2.0.11", "description": "Node.js & JavaScript SDK for Bitget REST APIs & WebSockets, with TypeScript & end-to-end tests.", "main": "lib/index.js", "types": "lib/index.d.ts", diff --git a/src/rest-client-v2.ts b/src/rest-client-v2.ts index 08fb3bb..d9dd29f 100644 --- a/src/rest-client-v2.ts +++ b/src/rest-client-v2.ts @@ -4,6 +4,7 @@ import { FuturesAccountBillRequestV2, FuturesCandlesRequestV2, SpotCandlesRequestV2, + SpotAccountBill, } from './types'; import { REST_CLIENT_TYPE_ENUM, assertMarginType } from './util'; import BaseRestClient from './util/BaseRestClient'; @@ -417,7 +418,15 @@ export class RestClientV2 extends BaseRestClient { ); } - getSpotAccountBills(params?: object): Promise> { + getSpotAccountBills(params?: { + coin?: string; + groupType?: string; + businessType?: string; + startTime?: string; + endTime?: string; + limit?: string; + idLessThan?: string; + }): Promise> { return this.getPrivate(`/api/v2/spot/account/bills`, params); } diff --git a/src/types/response/spot.ts b/src/types/response/spot.ts index 4cde265..4c7a81d 100644 --- a/src/types/response/spot.ts +++ b/src/types/response/spot.ts @@ -48,3 +48,28 @@ export interface SpotMarketTrade { fillQuantity: string; fillTime: string; } + +export interface SpotAccountAsset { + coin: string; + available: string; + frozen: string; + locked: string; + limitAvailable: string; + uTime: string; +} + +export interface SpotAccountBill { + cTime: string; + coino: string; + groupType: string; + businessType: + | 'SMALL_EXCHANGE_USER_IN' + | 'SMALL_EXCHANGE_USER_OUT' + | 'AIRDROP_REWARD' + | 'WITHDRAW' + | string; // TODO: complete list of possible values here? + size: string; + balance: string; + fees: string; + billd: string; +} From 5020cf52a00c1a9e9e02209c87dd22aa7929da66 Mon Sep 17 00:00:00 2001 From: Tiago Siebler Date: Tue, 1 Oct 2024 16:19:47 +0100 Subject: [PATCH 2/2] chore(): add test logs --- test/spot/private.write.test.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/spot/private.write.test.ts b/test/spot/private.write.test.ts index 7adc0df..f348451 100644 --- a/test/spot/private.write.test.ts +++ b/test/spot/private.write.test.ts @@ -116,6 +116,11 @@ describe('Private Spot REST API POST Endpoints', () => { data: expect.any(Array), }); } catch (e) { + console.log( + `"${expect.getState().currentTestName}"`, + JSON.stringify(e.body), + ); + expect(e.body).toMatchObject({ code: API_ERROR_CODE.INCORRECT_PERMISSIONS, }); @@ -142,6 +147,11 @@ describe('Private Spot REST API POST Endpoints', () => { data: expect.any(Array), }); } catch (e) { + console.log( + `"${expect.getState().currentTestName}"`, + JSON.stringify(e.body), + ); + expect(e.body).toMatchObject({ code: API_ERROR_CODE.INCORRECT_PERMISSIONS, });