From 6e174e2cc994c970763ee009ccc9589171587fcf Mon Sep 17 00:00:00 2001 From: JJ-Cro Date: Wed, 9 Apr 2025 10:48:08 +0200 Subject: [PATCH] feat(v4.1.3): full support for demo endpoints --- package-lock.json | 4 ++-- package.json | 2 +- src/rest-client-v5.ts | 23 +++++++++++++++++++++-- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2409492..87243da 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "bybit-api", - "version": "4.1.2", + "version": "4.1.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "bybit-api", - "version": "4.1.2", + "version": "4.1.3", "license": "MIT", "dependencies": { "axios": "^1.7.9", diff --git a/package.json b/package.json index 105f867..d0b6d56 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bybit-api", - "version": "4.1.2", + "version": "4.1.3", "description": "Complete & robust Node.js SDK for Bybit's REST APIs and WebSockets, with TypeScript & strong end to end tests.", "main": "lib/index.js", "types": "lib/index.d.ts", diff --git a/src/rest-client-v5.ts b/src/rest-client-v5.ts index b572edb..695ef6c 100644 --- a/src/rest-client-v5.ts +++ b/src/rest-client-v5.ts @@ -313,8 +313,27 @@ export class RestClientV5 extends BaseRestClient { return this.get('/v5/market/time'); } - requestDemoTradingFunds(): Promise<{}> { - return this.postPrivate('/v5/account/demo-apply-money'); + /** + * + ****** Demo Account APIs + * + */ + + requestDemoTradingFunds(params?: { + adjustType?: 0 | 1; + utaDemoApplyMoney?: Array<{ + coin: string; + amountStr: string; + }>; + }): Promise> { + return this.postPrivate('/v5/account/demo-apply-money', params); + } + + /** + * Create a demo trading account. + */ + createDemoAccount(): Promise> { + return this.postPrivate('/v5/user/create-demo-member'); } /**