@binance/derivatives-trading-portfolio-margin-pro 6.0.3 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +83 -9
- package/dist/index.d.mts +277 -63
- package/dist/index.d.ts +277 -63
- package/dist/index.js +162 -20
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +151 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RestApiResponse, ConfigurationRestAPI } from '@binance/common';
|
|
2
|
-
export { BadRequestError, ConnectorClientError, DERIVATIVES_TRADING_PORTFOLIO_MARGIN_PRO_REST_API_PROD_URL, ForbiddenError, NetworkError, NotFoundError, RateLimitBanError, RequiredError, ServerError, TooManyRequestsError, UnauthorizedError } from '@binance/common';
|
|
1
|
+
import { RestApiResponse, ConfigurationRestAPI, WebsocketStreamsBase, WebsocketStream, ConfigurationWebsocketStreams } from '@binance/common';
|
|
2
|
+
export { BadRequestError, ConnectorClientError, DERIVATIVES_TRADING_PORTFOLIO_MARGIN_PRO_REST_API_PROD_URL, DERIVATIVES_TRADING_PORTFOLIO_MARGIN_PRO_WS_STREAMS_PROD_URL, ForbiddenError, NetworkError, NotFoundError, RateLimitBanError, RequiredError, ServerError, TooManyRequestsError, UnauthorizedError } from '@binance/common';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Binance Derivatives Trading Portfolio Margin Pro REST API
|
|
@@ -1484,7 +1484,7 @@ interface MintBfusdForPortfolioMarginRequest {
|
|
|
1484
1484
|
*/
|
|
1485
1485
|
readonly fromAsset: string;
|
|
1486
1486
|
/**
|
|
1487
|
-
* `USDT`
|
|
1487
|
+
* `USDT` `USDC`
|
|
1488
1488
|
* @type {string}
|
|
1489
1489
|
* @memberof AccountApiMintBfusdForPortfolioMargin
|
|
1490
1490
|
*/
|
|
@@ -1616,7 +1616,7 @@ interface RedeemBfusdForPortfolioMarginRequest {
|
|
|
1616
1616
|
*/
|
|
1617
1617
|
readonly fromAsset: string;
|
|
1618
1618
|
/**
|
|
1619
|
-
* `USDT`
|
|
1619
|
+
* `USDT` `USDC`
|
|
1620
1620
|
* @type {string}
|
|
1621
1621
|
* @memberof AccountApiRedeemBfusdForPortfolioMargin
|
|
1622
1622
|
*/
|
|
@@ -2393,73 +2393,287 @@ declare class RestAPI {
|
|
|
2393
2393
|
* Do not edit the class manually.
|
|
2394
2394
|
*/
|
|
2395
2395
|
|
|
2396
|
-
type
|
|
2397
|
-
declare const
|
|
2398
|
-
type
|
|
2399
|
-
type
|
|
2400
|
-
type
|
|
2401
|
-
type
|
|
2402
|
-
type
|
|
2403
|
-
type
|
|
2404
|
-
type
|
|
2405
|
-
type
|
|
2406
|
-
type
|
|
2407
|
-
type
|
|
2408
|
-
type
|
|
2409
|
-
type
|
|
2410
|
-
type
|
|
2411
|
-
type
|
|
2412
|
-
type
|
|
2413
|
-
type
|
|
2414
|
-
type
|
|
2415
|
-
type
|
|
2416
|
-
type
|
|
2417
|
-
type
|
|
2418
|
-
type
|
|
2419
|
-
type
|
|
2420
|
-
type
|
|
2421
|
-
type
|
|
2422
|
-
declare const
|
|
2423
|
-
type
|
|
2424
|
-
type
|
|
2425
|
-
type
|
|
2426
|
-
type
|
|
2427
|
-
type
|
|
2428
|
-
type
|
|
2429
|
-
type
|
|
2430
|
-
type
|
|
2431
|
-
type
|
|
2432
|
-
type
|
|
2433
|
-
type
|
|
2434
|
-
type
|
|
2435
|
-
type
|
|
2436
|
-
type
|
|
2437
|
-
type
|
|
2438
|
-
type
|
|
2439
|
-
type
|
|
2440
|
-
type
|
|
2441
|
-
type
|
|
2442
|
-
type
|
|
2443
|
-
type
|
|
2444
|
-
type
|
|
2445
|
-
type
|
|
2446
|
-
type
|
|
2447
|
-
type
|
|
2448
|
-
type
|
|
2449
|
-
type
|
|
2450
|
-
declare const
|
|
2451
|
-
type
|
|
2452
|
-
type
|
|
2396
|
+
type index$1_AccountApi = AccountApi;
|
|
2397
|
+
declare const index$1_AccountApi: typeof AccountApi;
|
|
2398
|
+
type index$1_AccountApiInterface = AccountApiInterface;
|
|
2399
|
+
type index$1_BnbTransferRequest = BnbTransferRequest;
|
|
2400
|
+
type index$1_BnbTransferResponse = BnbTransferResponse;
|
|
2401
|
+
type index$1_ChangeAutoRepayFuturesStatusRequest = ChangeAutoRepayFuturesStatusRequest;
|
|
2402
|
+
type index$1_ChangeAutoRepayFuturesStatusResponse = ChangeAutoRepayFuturesStatusResponse;
|
|
2403
|
+
type index$1_FundAutoCollectionRequest = FundAutoCollectionRequest;
|
|
2404
|
+
type index$1_FundAutoCollectionResponse = FundAutoCollectionResponse;
|
|
2405
|
+
type index$1_FundCollectionByAssetRequest = FundCollectionByAssetRequest;
|
|
2406
|
+
type index$1_FundCollectionByAssetResponse = FundCollectionByAssetResponse;
|
|
2407
|
+
type index$1_GetAutoRepayFuturesStatusRequest = GetAutoRepayFuturesStatusRequest;
|
|
2408
|
+
type index$1_GetAutoRepayFuturesStatusResponse = GetAutoRepayFuturesStatusResponse;
|
|
2409
|
+
type index$1_GetPortfolioMarginAssetLeverageResponse = GetPortfolioMarginAssetLeverageResponse;
|
|
2410
|
+
type index$1_GetPortfolioMarginAssetLeverageResponseInner = GetPortfolioMarginAssetLeverageResponseInner;
|
|
2411
|
+
type index$1_GetPortfolioMarginProAccountBalanceRequest = GetPortfolioMarginProAccountBalanceRequest;
|
|
2412
|
+
type index$1_GetPortfolioMarginProAccountBalanceResponse = GetPortfolioMarginProAccountBalanceResponse;
|
|
2413
|
+
type index$1_GetPortfolioMarginProAccountBalanceResponseInner = GetPortfolioMarginProAccountBalanceResponseInner;
|
|
2414
|
+
type index$1_GetPortfolioMarginProAccountInfoRequest = GetPortfolioMarginProAccountInfoRequest;
|
|
2415
|
+
type index$1_GetPortfolioMarginProAccountInfoResponse = GetPortfolioMarginProAccountInfoResponse;
|
|
2416
|
+
type index$1_GetPortfolioMarginProSpanAccountInfoRequest = GetPortfolioMarginProSpanAccountInfoRequest;
|
|
2417
|
+
type index$1_GetPortfolioMarginProSpanAccountInfoResponse = GetPortfolioMarginProSpanAccountInfoResponse;
|
|
2418
|
+
type index$1_GetPortfolioMarginProSpanAccountInfoResponseRiskUnitMMListInner = GetPortfolioMarginProSpanAccountInfoResponseRiskUnitMMListInner;
|
|
2419
|
+
type index$1_GetTransferableEarnAssetBalanceForPortfolioMarginRequest = GetTransferableEarnAssetBalanceForPortfolioMarginRequest;
|
|
2420
|
+
type index$1_GetTransferableEarnAssetBalanceForPortfolioMarginResponse = GetTransferableEarnAssetBalanceForPortfolioMarginResponse;
|
|
2421
|
+
type index$1_MarketDataApi = MarketDataApi;
|
|
2422
|
+
declare const index$1_MarketDataApi: typeof MarketDataApi;
|
|
2423
|
+
type index$1_MarketDataApiInterface = MarketDataApiInterface;
|
|
2424
|
+
type index$1_MintBfusdForPortfolioMarginRequest = MintBfusdForPortfolioMarginRequest;
|
|
2425
|
+
type index$1_MintBfusdForPortfolioMarginResponse = MintBfusdForPortfolioMarginResponse;
|
|
2426
|
+
type index$1_PortfolioMarginCollateralRateResponse = PortfolioMarginCollateralRateResponse;
|
|
2427
|
+
type index$1_PortfolioMarginCollateralRateResponseInner = PortfolioMarginCollateralRateResponseInner;
|
|
2428
|
+
type index$1_PortfolioMarginProBankruptcyLoanRepayRequest = PortfolioMarginProBankruptcyLoanRepayRequest;
|
|
2429
|
+
type index$1_PortfolioMarginProBankruptcyLoanRepayResponse = PortfolioMarginProBankruptcyLoanRepayResponse;
|
|
2430
|
+
type index$1_PortfolioMarginProTieredCollateralRateRequest = PortfolioMarginProTieredCollateralRateRequest;
|
|
2431
|
+
type index$1_PortfolioMarginProTieredCollateralRateResponse = PortfolioMarginProTieredCollateralRateResponse;
|
|
2432
|
+
type index$1_PortfolioMarginProTieredCollateralRateResponseInner = PortfolioMarginProTieredCollateralRateResponseInner;
|
|
2433
|
+
type index$1_PortfolioMarginProTieredCollateralRateResponseInnerCollateralInfoInner = PortfolioMarginProTieredCollateralRateResponseInnerCollateralInfoInner;
|
|
2434
|
+
type index$1_QueryPortfolioMarginAssetIndexPriceRequest = QueryPortfolioMarginAssetIndexPriceRequest;
|
|
2435
|
+
type index$1_QueryPortfolioMarginAssetIndexPriceResponse = QueryPortfolioMarginAssetIndexPriceResponse;
|
|
2436
|
+
type index$1_QueryPortfolioMarginAssetIndexPriceResponseInner = QueryPortfolioMarginAssetIndexPriceResponseInner;
|
|
2437
|
+
type index$1_QueryPortfolioMarginProBankruptcyLoanAmountRequest = QueryPortfolioMarginProBankruptcyLoanAmountRequest;
|
|
2438
|
+
type index$1_QueryPortfolioMarginProBankruptcyLoanAmountResponse = QueryPortfolioMarginProBankruptcyLoanAmountResponse;
|
|
2439
|
+
type index$1_QueryPortfolioMarginProBankruptcyLoanRepayHistoryRequest = QueryPortfolioMarginProBankruptcyLoanRepayHistoryRequest;
|
|
2440
|
+
type index$1_QueryPortfolioMarginProBankruptcyLoanRepayHistoryResponse = QueryPortfolioMarginProBankruptcyLoanRepayHistoryResponse;
|
|
2441
|
+
type index$1_QueryPortfolioMarginProBankruptcyLoanRepayHistoryResponseRowsInner = QueryPortfolioMarginProBankruptcyLoanRepayHistoryResponseRowsInner;
|
|
2442
|
+
type index$1_QueryPortfolioMarginProNegativeBalanceInterestHistoryRequest = QueryPortfolioMarginProNegativeBalanceInterestHistoryRequest;
|
|
2443
|
+
type index$1_QueryPortfolioMarginProNegativeBalanceInterestHistoryResponse = QueryPortfolioMarginProNegativeBalanceInterestHistoryResponse;
|
|
2444
|
+
type index$1_QueryPortfolioMarginProNegativeBalanceInterestHistoryResponseInner = QueryPortfolioMarginProNegativeBalanceInterestHistoryResponseInner;
|
|
2445
|
+
type index$1_RedeemBfusdForPortfolioMarginRequest = RedeemBfusdForPortfolioMarginRequest;
|
|
2446
|
+
type index$1_RedeemBfusdForPortfolioMarginResponse = RedeemBfusdForPortfolioMarginResponse;
|
|
2447
|
+
type index$1_RepayFuturesNegativeBalanceRequest = RepayFuturesNegativeBalanceRequest;
|
|
2448
|
+
type index$1_RepayFuturesNegativeBalanceResponse = RepayFuturesNegativeBalanceResponse;
|
|
2449
|
+
type index$1_RestAPI = RestAPI;
|
|
2450
|
+
declare const index$1_RestAPI: typeof RestAPI;
|
|
2451
|
+
type index$1_TransferLdusdtForPortfolioMarginRequest = TransferLdusdtForPortfolioMarginRequest;
|
|
2452
|
+
type index$1_TransferLdusdtForPortfolioMarginResponse = TransferLdusdtForPortfolioMarginResponse;
|
|
2453
|
+
declare namespace index$1 {
|
|
2454
|
+
export { index$1_AccountApi as AccountApi, type index$1_AccountApiInterface as AccountApiInterface, type index$1_BnbTransferRequest as BnbTransferRequest, type index$1_BnbTransferResponse as BnbTransferResponse, type index$1_ChangeAutoRepayFuturesStatusRequest as ChangeAutoRepayFuturesStatusRequest, type index$1_ChangeAutoRepayFuturesStatusResponse as ChangeAutoRepayFuturesStatusResponse, type index$1_FundAutoCollectionRequest as FundAutoCollectionRequest, type index$1_FundAutoCollectionResponse as FundAutoCollectionResponse, type index$1_FundCollectionByAssetRequest as FundCollectionByAssetRequest, type index$1_FundCollectionByAssetResponse as FundCollectionByAssetResponse, type index$1_GetAutoRepayFuturesStatusRequest as GetAutoRepayFuturesStatusRequest, type index$1_GetAutoRepayFuturesStatusResponse as GetAutoRepayFuturesStatusResponse, type index$1_GetPortfolioMarginAssetLeverageResponse as GetPortfolioMarginAssetLeverageResponse, type index$1_GetPortfolioMarginAssetLeverageResponseInner as GetPortfolioMarginAssetLeverageResponseInner, type index$1_GetPortfolioMarginProAccountBalanceRequest as GetPortfolioMarginProAccountBalanceRequest, type index$1_GetPortfolioMarginProAccountBalanceResponse as GetPortfolioMarginProAccountBalanceResponse, type index$1_GetPortfolioMarginProAccountBalanceResponseInner as GetPortfolioMarginProAccountBalanceResponseInner, type index$1_GetPortfolioMarginProAccountInfoRequest as GetPortfolioMarginProAccountInfoRequest, type index$1_GetPortfolioMarginProAccountInfoResponse as GetPortfolioMarginProAccountInfoResponse, type index$1_GetPortfolioMarginProSpanAccountInfoRequest as GetPortfolioMarginProSpanAccountInfoRequest, type index$1_GetPortfolioMarginProSpanAccountInfoResponse as GetPortfolioMarginProSpanAccountInfoResponse, type index$1_GetPortfolioMarginProSpanAccountInfoResponseRiskUnitMMListInner as GetPortfolioMarginProSpanAccountInfoResponseRiskUnitMMListInner, type index$1_GetTransferableEarnAssetBalanceForPortfolioMarginRequest as GetTransferableEarnAssetBalanceForPortfolioMarginRequest, type index$1_GetTransferableEarnAssetBalanceForPortfolioMarginResponse as GetTransferableEarnAssetBalanceForPortfolioMarginResponse, index$1_MarketDataApi as MarketDataApi, type index$1_MarketDataApiInterface as MarketDataApiInterface, type index$1_MintBfusdForPortfolioMarginRequest as MintBfusdForPortfolioMarginRequest, type index$1_MintBfusdForPortfolioMarginResponse as MintBfusdForPortfolioMarginResponse, type index$1_PortfolioMarginCollateralRateResponse as PortfolioMarginCollateralRateResponse, type index$1_PortfolioMarginCollateralRateResponseInner as PortfolioMarginCollateralRateResponseInner, type index$1_PortfolioMarginProBankruptcyLoanRepayRequest as PortfolioMarginProBankruptcyLoanRepayRequest, type index$1_PortfolioMarginProBankruptcyLoanRepayResponse as PortfolioMarginProBankruptcyLoanRepayResponse, type index$1_PortfolioMarginProTieredCollateralRateRequest as PortfolioMarginProTieredCollateralRateRequest, type index$1_PortfolioMarginProTieredCollateralRateResponse as PortfolioMarginProTieredCollateralRateResponse, type index$1_PortfolioMarginProTieredCollateralRateResponseInner as PortfolioMarginProTieredCollateralRateResponseInner, type index$1_PortfolioMarginProTieredCollateralRateResponseInnerCollateralInfoInner as PortfolioMarginProTieredCollateralRateResponseInnerCollateralInfoInner, type index$1_QueryPortfolioMarginAssetIndexPriceRequest as QueryPortfolioMarginAssetIndexPriceRequest, type index$1_QueryPortfolioMarginAssetIndexPriceResponse as QueryPortfolioMarginAssetIndexPriceResponse, type index$1_QueryPortfolioMarginAssetIndexPriceResponseInner as QueryPortfolioMarginAssetIndexPriceResponseInner, type index$1_QueryPortfolioMarginProBankruptcyLoanAmountRequest as QueryPortfolioMarginProBankruptcyLoanAmountRequest, type index$1_QueryPortfolioMarginProBankruptcyLoanAmountResponse as QueryPortfolioMarginProBankruptcyLoanAmountResponse, type index$1_QueryPortfolioMarginProBankruptcyLoanRepayHistoryRequest as QueryPortfolioMarginProBankruptcyLoanRepayHistoryRequest, type index$1_QueryPortfolioMarginProBankruptcyLoanRepayHistoryResponse as QueryPortfolioMarginProBankruptcyLoanRepayHistoryResponse, type index$1_QueryPortfolioMarginProBankruptcyLoanRepayHistoryResponseRowsInner as QueryPortfolioMarginProBankruptcyLoanRepayHistoryResponseRowsInner, type index$1_QueryPortfolioMarginProNegativeBalanceInterestHistoryRequest as QueryPortfolioMarginProNegativeBalanceInterestHistoryRequest, type index$1_QueryPortfolioMarginProNegativeBalanceInterestHistoryResponse as QueryPortfolioMarginProNegativeBalanceInterestHistoryResponse, type index$1_QueryPortfolioMarginProNegativeBalanceInterestHistoryResponseInner as QueryPortfolioMarginProNegativeBalanceInterestHistoryResponseInner, type index$1_RedeemBfusdForPortfolioMarginRequest as RedeemBfusdForPortfolioMarginRequest, type index$1_RedeemBfusdForPortfolioMarginResponse as RedeemBfusdForPortfolioMarginResponse, type index$1_RepayFuturesNegativeBalanceRequest as RepayFuturesNegativeBalanceRequest, type index$1_RepayFuturesNegativeBalanceResponse as RepayFuturesNegativeBalanceResponse, index$1_RestAPI as RestAPI, type index$1_TransferLdusdtForPortfolioMarginRequest as TransferLdusdtForPortfolioMarginRequest, type index$1_TransferLdusdtForPortfolioMarginResponse as TransferLdusdtForPortfolioMarginResponse };
|
|
2455
|
+
}
|
|
2456
|
+
|
|
2457
|
+
/**
|
|
2458
|
+
* Binance Derivatives Trading Portfolio Margin Pro WebSocket Market Streams
|
|
2459
|
+
*
|
|
2460
|
+
* OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin Pro WebSocket Market Streams
|
|
2461
|
+
*
|
|
2462
|
+
* The version of the OpenAPI document: 1.0.0
|
|
2463
|
+
*
|
|
2464
|
+
*
|
|
2465
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
2466
|
+
* https://openapi-generator.tech
|
|
2467
|
+
* Do not edit the class manually.
|
|
2468
|
+
*/
|
|
2469
|
+
/**
|
|
2470
|
+
*
|
|
2471
|
+
* @export
|
|
2472
|
+
* @interface Risklevelchange
|
|
2473
|
+
*/
|
|
2474
|
+
interface Risklevelchange {
|
|
2475
|
+
/**
|
|
2476
|
+
*
|
|
2477
|
+
* @type {number}
|
|
2478
|
+
* @memberof Risklevelchange
|
|
2479
|
+
*/
|
|
2480
|
+
E?: number;
|
|
2481
|
+
/**
|
|
2482
|
+
*
|
|
2483
|
+
* @type {string}
|
|
2484
|
+
* @memberof Risklevelchange
|
|
2485
|
+
*/
|
|
2486
|
+
u?: string;
|
|
2487
|
+
/**
|
|
2488
|
+
*
|
|
2489
|
+
* @type {string}
|
|
2490
|
+
* @memberof Risklevelchange
|
|
2491
|
+
*/
|
|
2492
|
+
s?: string;
|
|
2493
|
+
/**
|
|
2494
|
+
*
|
|
2495
|
+
* @type {string}
|
|
2496
|
+
* @memberof Risklevelchange
|
|
2497
|
+
*/
|
|
2498
|
+
eq?: string;
|
|
2499
|
+
/**
|
|
2500
|
+
*
|
|
2501
|
+
* @type {string}
|
|
2502
|
+
* @memberof Risklevelchange
|
|
2503
|
+
*/
|
|
2504
|
+
ae?: string;
|
|
2505
|
+
/**
|
|
2506
|
+
*
|
|
2507
|
+
* @type {string}
|
|
2508
|
+
* @memberof Risklevelchange
|
|
2509
|
+
*/
|
|
2510
|
+
m?: string;
|
|
2511
|
+
}
|
|
2512
|
+
|
|
2513
|
+
/**
|
|
2514
|
+
* Binance Derivatives Trading Portfolio Margin Pro WebSocket Market Streams
|
|
2515
|
+
*
|
|
2516
|
+
* OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin Pro WebSocket Market Streams
|
|
2517
|
+
*
|
|
2518
|
+
* The version of the OpenAPI document: 1.0.0
|
|
2519
|
+
*
|
|
2520
|
+
*
|
|
2521
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
2522
|
+
* https://openapi-generator.tech
|
|
2523
|
+
* Do not edit the class manually.
|
|
2524
|
+
*/
|
|
2525
|
+
|
|
2526
|
+
/**
|
|
2527
|
+
* @type UserDataStreamEventsResponse
|
|
2528
|
+
* @export
|
|
2529
|
+
*/
|
|
2530
|
+
type UserDataStreamEventsResponse = {
|
|
2531
|
+
e: 'riskLevelChange';
|
|
2532
|
+
} & Risklevelchange;
|
|
2533
|
+
|
|
2534
|
+
/**
|
|
2535
|
+
* Binance Derivatives Trading Portfolio Margin Pro WebSocket Market Streams
|
|
2536
|
+
*
|
|
2537
|
+
* OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin Pro WebSocket Market Streams
|
|
2538
|
+
*
|
|
2539
|
+
* The version of the OpenAPI document: 1.0.0
|
|
2540
|
+
*
|
|
2541
|
+
*
|
|
2542
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
2543
|
+
* https://openapi-generator.tech
|
|
2544
|
+
* Do not edit the class manually.
|
|
2545
|
+
*/
|
|
2546
|
+
|
|
2547
|
+
declare class WebsocketStreamsConnection {
|
|
2548
|
+
private websocketBase;
|
|
2549
|
+
constructor(websocketBase: WebsocketStreamsBase);
|
|
2550
|
+
/**
|
|
2551
|
+
* Adds an event listener for the specified WebSocket event.
|
|
2552
|
+
* @param event - The WebSocket event to listen for, such as 'open', 'message', 'error', 'close', 'ping', or 'pong'.
|
|
2553
|
+
* @param listener - The callback function to be executed when the event is triggered. The function can accept any number of arguments.
|
|
2554
|
+
*/
|
|
2555
|
+
on(event: 'open' | 'message' | 'error' | 'close' | 'ping' | 'pong', listener: (...args: any[]) => void): void;
|
|
2556
|
+
/**
|
|
2557
|
+
* Removes an event listener for the specified WebSocket event.
|
|
2558
|
+
* @param event - The WebSocket event to stop listening for, such as 'open', 'message', 'error', 'close', 'ping', or 'pong'.
|
|
2559
|
+
* @param listener - The callback function that was previously added as the event listener.
|
|
2560
|
+
*/
|
|
2561
|
+
off(event: 'open' | 'message' | 'error' | 'close' | 'ping' | 'pong', listener: (...args: any[]) => void): void;
|
|
2562
|
+
/**
|
|
2563
|
+
* Disconnects from the WebSocket server.
|
|
2564
|
+
* If there is no active connection, a warning is logged.
|
|
2565
|
+
* Otherwise, all connections in the connection pool are closed gracefully,
|
|
2566
|
+
* and a message is logged indicating that the connection has been disconnected.
|
|
2567
|
+
* @returns A Promise that resolves when all connections have been closed.
|
|
2568
|
+
* @throws Error if the WebSocket client is not set.
|
|
2569
|
+
*/
|
|
2570
|
+
disconnect(): Promise<void>;
|
|
2571
|
+
/**
|
|
2572
|
+
* Checks if the WebSocket connection is currently open.
|
|
2573
|
+
* @returns `true` if the connection is open, `false` otherwise.
|
|
2574
|
+
*/
|
|
2575
|
+
isConnected(): boolean;
|
|
2576
|
+
/**
|
|
2577
|
+
* Sends a ping message to all connected Websocket servers in the pool.
|
|
2578
|
+
* If no connections are ready, a warning is logged.
|
|
2579
|
+
* For each active connection, the ping message is sent, and debug logs provide details.
|
|
2580
|
+
* @throws Error if a Websocket client is not set for a connection.
|
|
2581
|
+
*/
|
|
2582
|
+
pingServer(): void;
|
|
2583
|
+
/**
|
|
2584
|
+
* Subscribes to one or multiple WebSocket streams
|
|
2585
|
+
* Handles both single and pool modes
|
|
2586
|
+
* @param stream Single stream name or array of stream names to subscribe to
|
|
2587
|
+
* @param id Optional subscription ID
|
|
2588
|
+
* @returns void
|
|
2589
|
+
*/
|
|
2590
|
+
subscribe(stream: string | string[], id?: string): void;
|
|
2591
|
+
/**
|
|
2592
|
+
* Unsubscribes from one or multiple WebSocket streams
|
|
2593
|
+
* Handles both single and pool modes
|
|
2594
|
+
* @param stream Single stream name or array of stream names to unsubscribe from
|
|
2595
|
+
* @param id Optional unsubscription ID
|
|
2596
|
+
* @returns void
|
|
2597
|
+
*/
|
|
2598
|
+
unsubscribe(stream: string | string[], id?: string): void;
|
|
2599
|
+
/**
|
|
2600
|
+
* Checks if the WebSocket connection is subscribed to the specified stream.
|
|
2601
|
+
* @param stream The name of the WebSocket stream to check.
|
|
2602
|
+
* @returns `true` if the connection is subscribed to the stream, `false` otherwise.
|
|
2603
|
+
*/
|
|
2604
|
+
isSubscribed(stream: string): boolean;
|
|
2605
|
+
/**
|
|
2606
|
+
* Subscribes to the user data WebSocket stream using the provided listen key.
|
|
2607
|
+
* @param listenKey - The listen key for the user data WebSocket stream.
|
|
2608
|
+
* @param id - Optional user data stream ID
|
|
2609
|
+
* @returns A WebSocket stream handler for the user data stream.
|
|
2610
|
+
*/
|
|
2611
|
+
userData(listenKey: string, id?: string): WebsocketStream<UserDataStreamEventsResponse>;
|
|
2612
|
+
}
|
|
2613
|
+
|
|
2614
|
+
/**
|
|
2615
|
+
* Binance Derivatives Trading Portfolio Margin Pro WebSocket Market Streams
|
|
2616
|
+
*
|
|
2617
|
+
* OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin Pro WebSocket Market Streams
|
|
2618
|
+
*
|
|
2619
|
+
* The version of the OpenAPI document: 1.0.0
|
|
2620
|
+
*
|
|
2621
|
+
*
|
|
2622
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
2623
|
+
* https://openapi-generator.tech
|
|
2624
|
+
* Do not edit the class manually.
|
|
2625
|
+
*/
|
|
2626
|
+
|
|
2627
|
+
declare class WebsocketStreams {
|
|
2628
|
+
private configuration;
|
|
2629
|
+
constructor(configuration: ConfigurationWebsocketStreams);
|
|
2630
|
+
/**
|
|
2631
|
+
* Connects to the Binance WebSocket streams and returns a `WebsocketStreamsConnection` instance.
|
|
2632
|
+
*
|
|
2633
|
+
* @param {object} [options] - Optional connection options.
|
|
2634
|
+
* @param {string|string[]} [options.stream] - The stream(s) to connect to.
|
|
2635
|
+
* @param {'single'|'pool'} [options.mode] - The connection mode, either 'single' or 'pool'. Overwrite the `mode` option in the configuration.
|
|
2636
|
+
* @param {number} [options.poolSize] - The number of connections to use in pool mode. Overwrite the `poolSize` option in the configuration.
|
|
2637
|
+
* @returns {Promise<WebsocketStreamsConnection>} - A promise that resolves to a `WebsocketStreamsConnection` instance.
|
|
2638
|
+
*/
|
|
2639
|
+
connect({ stream, mode, poolSize, }?: {
|
|
2640
|
+
stream?: string | string[];
|
|
2641
|
+
mode?: 'single' | 'pool';
|
|
2642
|
+
poolSize?: number;
|
|
2643
|
+
}): Promise<WebsocketStreamsConnection>;
|
|
2644
|
+
}
|
|
2645
|
+
|
|
2646
|
+
/**
|
|
2647
|
+
* Binance Derivatives Trading Portfolio Margin Pro WebSocket Market Streams
|
|
2648
|
+
*
|
|
2649
|
+
* OpenAPI Specification for the Binance Derivatives Trading Portfolio Margin Pro WebSocket Market Streams
|
|
2650
|
+
*
|
|
2651
|
+
* The version of the OpenAPI document: 1.0.0
|
|
2652
|
+
*
|
|
2653
|
+
*
|
|
2654
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
2655
|
+
* https://openapi-generator.tech
|
|
2656
|
+
* Do not edit the class manually.
|
|
2657
|
+
*/
|
|
2658
|
+
|
|
2659
|
+
type index_Risklevelchange = Risklevelchange;
|
|
2660
|
+
type index_UserDataStreamEventsResponse = UserDataStreamEventsResponse;
|
|
2661
|
+
type index_WebsocketStreams = WebsocketStreams;
|
|
2662
|
+
declare const index_WebsocketStreams: typeof WebsocketStreams;
|
|
2663
|
+
type index_WebsocketStreamsConnection = WebsocketStreamsConnection;
|
|
2664
|
+
declare const index_WebsocketStreamsConnection: typeof WebsocketStreamsConnection;
|
|
2453
2665
|
declare namespace index {
|
|
2454
|
-
export {
|
|
2666
|
+
export { type index_Risklevelchange as Risklevelchange, type index_UserDataStreamEventsResponse as UserDataStreamEventsResponse, index_WebsocketStreams as WebsocketStreams, index_WebsocketStreamsConnection as WebsocketStreamsConnection };
|
|
2455
2667
|
}
|
|
2456
2668
|
|
|
2457
2669
|
interface ConfigurationDerivativesTradingPortfolioMarginPro {
|
|
2458
2670
|
configurationRestAPI?: ConfigurationRestAPI;
|
|
2671
|
+
configurationWebsocketStreams?: ConfigurationWebsocketStreams;
|
|
2459
2672
|
}
|
|
2460
2673
|
declare class DerivativesTradingPortfolioMarginPro {
|
|
2461
2674
|
restAPI: RestAPI;
|
|
2675
|
+
websocketStreams: WebsocketStreams;
|
|
2462
2676
|
constructor(config: ConfigurationDerivativesTradingPortfolioMarginPro);
|
|
2463
2677
|
}
|
|
2464
2678
|
|
|
2465
|
-
export { type ConfigurationDerivativesTradingPortfolioMarginPro, DerivativesTradingPortfolioMarginPro, index as DerivativesTradingPortfolioMarginProRestAPI };
|
|
2679
|
+
export { type ConfigurationDerivativesTradingPortfolioMarginPro, DerivativesTradingPortfolioMarginPro, index$1 as DerivativesTradingPortfolioMarginProRestAPI, index as DerivativesTradingPortfolioMarginProWebsocketStreams };
|
package/dist/index.js
CHANGED
|
@@ -20,29 +20,30 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/index.ts
|
|
21
21
|
var index_exports = {};
|
|
22
22
|
__export(index_exports, {
|
|
23
|
-
BadRequestError: () =>
|
|
24
|
-
ConnectorClientError: () =>
|
|
25
|
-
DERIVATIVES_TRADING_PORTFOLIO_MARGIN_PRO_REST_API_PROD_URL: () =>
|
|
23
|
+
BadRequestError: () => import_common7.BadRequestError,
|
|
24
|
+
ConnectorClientError: () => import_common7.ConnectorClientError,
|
|
25
|
+
DERIVATIVES_TRADING_PORTFOLIO_MARGIN_PRO_REST_API_PROD_URL: () => import_common7.DERIVATIVES_TRADING_PORTFOLIO_MARGIN_PRO_REST_API_PROD_URL,
|
|
26
|
+
DERIVATIVES_TRADING_PORTFOLIO_MARGIN_PRO_WS_STREAMS_PROD_URL: () => import_common7.DERIVATIVES_TRADING_PORTFOLIO_MARGIN_PRO_WS_STREAMS_PROD_URL,
|
|
26
27
|
DerivativesTradingPortfolioMarginPro: () => DerivativesTradingPortfolioMarginPro,
|
|
27
28
|
DerivativesTradingPortfolioMarginProRestAPI: () => rest_api_exports,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
DerivativesTradingPortfolioMarginProWebsocketStreams: () => websocket_streams_exports,
|
|
30
|
+
ForbiddenError: () => import_common7.ForbiddenError,
|
|
31
|
+
NetworkError: () => import_common7.NetworkError,
|
|
32
|
+
NotFoundError: () => import_common7.NotFoundError,
|
|
33
|
+
RateLimitBanError: () => import_common7.RateLimitBanError,
|
|
34
|
+
RequiredError: () => import_common7.RequiredError,
|
|
35
|
+
ServerError: () => import_common7.ServerError,
|
|
36
|
+
TooManyRequestsError: () => import_common7.TooManyRequestsError,
|
|
37
|
+
UnauthorizedError: () => import_common7.UnauthorizedError
|
|
36
38
|
});
|
|
37
39
|
module.exports = __toCommonJS(index_exports);
|
|
38
40
|
|
|
39
41
|
// src/derivatives-trading-portfolio-margin-pro.ts
|
|
40
|
-
var
|
|
41
|
-
var import_common4 = require("@binance/common");
|
|
42
|
+
var import_common6 = require("@binance/common");
|
|
42
43
|
|
|
43
44
|
// package.json
|
|
44
45
|
var name = "@binance/derivatives-trading-portfolio-margin-pro";
|
|
45
|
-
var version = "
|
|
46
|
+
var version = "7.0.0";
|
|
46
47
|
|
|
47
48
|
// src/rest-api/index.ts
|
|
48
49
|
var rest_api_exports = {};
|
|
@@ -325,7 +326,7 @@ var AccountApiAxiosParamCreator = function(configuration) {
|
|
|
325
326
|
*
|
|
326
327
|
* @summary Mint BFUSD for Portfolio Margin(TRADE)
|
|
327
328
|
* @param {string} fromAsset `BFUSD` only
|
|
328
|
-
* @param {string} targetAsset `USDT`
|
|
329
|
+
* @param {string} targetAsset `USDT` `USDC`
|
|
329
330
|
* @param {number} amount
|
|
330
331
|
* @param {number} [recvWindow]
|
|
331
332
|
*
|
|
@@ -503,7 +504,7 @@ var AccountApiAxiosParamCreator = function(configuration) {
|
|
|
503
504
|
*
|
|
504
505
|
* @summary Redeem BFUSD for Portfolio Margin(TRADE)
|
|
505
506
|
* @param {string} fromAsset `BFUSD` only
|
|
506
|
-
* @param {string} targetAsset `USDT`
|
|
507
|
+
* @param {string} targetAsset `USDT` `USDC`
|
|
507
508
|
* @param {number} amount
|
|
508
509
|
* @param {number} [recvWindow]
|
|
509
510
|
*
|
|
@@ -1615,31 +1616,172 @@ var RestAPI = class {
|
|
|
1615
1616
|
}
|
|
1616
1617
|
};
|
|
1617
1618
|
|
|
1619
|
+
// src/websocket-streams/index.ts
|
|
1620
|
+
var websocket_streams_exports = {};
|
|
1621
|
+
__export(websocket_streams_exports, {
|
|
1622
|
+
WebsocketStreams: () => WebsocketStreams,
|
|
1623
|
+
WebsocketStreamsConnection: () => WebsocketStreamsConnection
|
|
1624
|
+
});
|
|
1625
|
+
|
|
1626
|
+
// src/websocket-streams/websocket-streams.ts
|
|
1627
|
+
var import_common5 = require("@binance/common");
|
|
1628
|
+
|
|
1629
|
+
// src/websocket-streams/websocket-streams-connection.ts
|
|
1630
|
+
var import_common4 = require("@binance/common");
|
|
1631
|
+
var WebsocketStreamsConnection = class {
|
|
1632
|
+
constructor(websocketBase) {
|
|
1633
|
+
this.websocketBase = websocketBase;
|
|
1634
|
+
}
|
|
1635
|
+
/**
|
|
1636
|
+
* Adds an event listener for the specified WebSocket event.
|
|
1637
|
+
* @param event - The WebSocket event to listen for, such as 'open', 'message', 'error', 'close', 'ping', or 'pong'.
|
|
1638
|
+
* @param listener - The callback function to be executed when the event is triggered. The function can accept any number of arguments.
|
|
1639
|
+
*/
|
|
1640
|
+
on(event, listener) {
|
|
1641
|
+
this.websocketBase.on(event, listener);
|
|
1642
|
+
}
|
|
1643
|
+
/**
|
|
1644
|
+
* Removes an event listener for the specified WebSocket event.
|
|
1645
|
+
* @param event - The WebSocket event to stop listening for, such as 'open', 'message', 'error', 'close', 'ping', or 'pong'.
|
|
1646
|
+
* @param listener - The callback function that was previously added as the event listener.
|
|
1647
|
+
*/
|
|
1648
|
+
off(event, listener) {
|
|
1649
|
+
this.websocketBase.off(event, listener);
|
|
1650
|
+
}
|
|
1651
|
+
/**
|
|
1652
|
+
* Disconnects from the WebSocket server.
|
|
1653
|
+
* If there is no active connection, a warning is logged.
|
|
1654
|
+
* Otherwise, all connections in the connection pool are closed gracefully,
|
|
1655
|
+
* and a message is logged indicating that the connection has been disconnected.
|
|
1656
|
+
* @returns A Promise that resolves when all connections have been closed.
|
|
1657
|
+
* @throws Error if the WebSocket client is not set.
|
|
1658
|
+
*/
|
|
1659
|
+
disconnect() {
|
|
1660
|
+
return this.websocketBase.disconnect();
|
|
1661
|
+
}
|
|
1662
|
+
/**
|
|
1663
|
+
* Checks if the WebSocket connection is currently open.
|
|
1664
|
+
* @returns `true` if the connection is open, `false` otherwise.
|
|
1665
|
+
*/
|
|
1666
|
+
isConnected() {
|
|
1667
|
+
return this.websocketBase.isConnected();
|
|
1668
|
+
}
|
|
1669
|
+
/**
|
|
1670
|
+
* Sends a ping message to all connected Websocket servers in the pool.
|
|
1671
|
+
* If no connections are ready, a warning is logged.
|
|
1672
|
+
* For each active connection, the ping message is sent, and debug logs provide details.
|
|
1673
|
+
* @throws Error if a Websocket client is not set for a connection.
|
|
1674
|
+
*/
|
|
1675
|
+
pingServer() {
|
|
1676
|
+
this.websocketBase.pingServer();
|
|
1677
|
+
}
|
|
1678
|
+
/**
|
|
1679
|
+
* Subscribes to one or multiple WebSocket streams
|
|
1680
|
+
* Handles both single and pool modes
|
|
1681
|
+
* @param stream Single stream name or array of stream names to subscribe to
|
|
1682
|
+
* @param id Optional subscription ID
|
|
1683
|
+
* @returns void
|
|
1684
|
+
*/
|
|
1685
|
+
subscribe(stream, id) {
|
|
1686
|
+
this.websocketBase.subscribe(stream, id);
|
|
1687
|
+
}
|
|
1688
|
+
/**
|
|
1689
|
+
* Unsubscribes from one or multiple WebSocket streams
|
|
1690
|
+
* Handles both single and pool modes
|
|
1691
|
+
* @param stream Single stream name or array of stream names to unsubscribe from
|
|
1692
|
+
* @param id Optional unsubscription ID
|
|
1693
|
+
* @returns void
|
|
1694
|
+
*/
|
|
1695
|
+
unsubscribe(stream, id) {
|
|
1696
|
+
this.websocketBase.unsubscribe(stream, id);
|
|
1697
|
+
}
|
|
1698
|
+
/**
|
|
1699
|
+
* Checks if the WebSocket connection is subscribed to the specified stream.
|
|
1700
|
+
* @param stream The name of the WebSocket stream to check.
|
|
1701
|
+
* @returns `true` if the connection is subscribed to the stream, `false` otherwise.
|
|
1702
|
+
*/
|
|
1703
|
+
isSubscribed(stream) {
|
|
1704
|
+
return this.websocketBase.isSubscribed(stream);
|
|
1705
|
+
}
|
|
1706
|
+
/**
|
|
1707
|
+
* Subscribes to the user data WebSocket stream using the provided listen key.
|
|
1708
|
+
* @param listenKey - The listen key for the user data WebSocket stream.
|
|
1709
|
+
* @param id - Optional user data stream ID
|
|
1710
|
+
* @returns A WebSocket stream handler for the user data stream.
|
|
1711
|
+
*/
|
|
1712
|
+
userData(listenKey, id) {
|
|
1713
|
+
return (0, import_common4.createStreamHandler)(this.websocketBase, listenKey, id);
|
|
1714
|
+
}
|
|
1715
|
+
};
|
|
1716
|
+
|
|
1717
|
+
// src/websocket-streams/websocket-streams.ts
|
|
1718
|
+
var WebsocketStreams = class {
|
|
1719
|
+
constructor(configuration) {
|
|
1720
|
+
this.configuration = configuration;
|
|
1721
|
+
}
|
|
1722
|
+
/**
|
|
1723
|
+
* Connects to the Binance WebSocket streams and returns a `WebsocketStreamsConnection` instance.
|
|
1724
|
+
*
|
|
1725
|
+
* @param {object} [options] - Optional connection options.
|
|
1726
|
+
* @param {string|string[]} [options.stream] - The stream(s) to connect to.
|
|
1727
|
+
* @param {'single'|'pool'} [options.mode] - The connection mode, either 'single' or 'pool'. Overwrite the `mode` option in the configuration.
|
|
1728
|
+
* @param {number} [options.poolSize] - The number of connections to use in pool mode. Overwrite the `poolSize` option in the configuration.
|
|
1729
|
+
* @returns {Promise<WebsocketStreamsConnection>} - A promise that resolves to a `WebsocketStreamsConnection` instance.
|
|
1730
|
+
*/
|
|
1731
|
+
async connect({
|
|
1732
|
+
stream,
|
|
1733
|
+
mode,
|
|
1734
|
+
poolSize
|
|
1735
|
+
} = {}) {
|
|
1736
|
+
const websocketBase = new import_common5.WebsocketStreamsBase({
|
|
1737
|
+
...this.configuration,
|
|
1738
|
+
...mode && { mode },
|
|
1739
|
+
...poolSize && { poolSize }
|
|
1740
|
+
});
|
|
1741
|
+
const websocketStreamsConnection = new WebsocketStreamsConnection(websocketBase);
|
|
1742
|
+
await websocketBase.connect(stream);
|
|
1743
|
+
return websocketStreamsConnection;
|
|
1744
|
+
}
|
|
1745
|
+
};
|
|
1746
|
+
|
|
1618
1747
|
// src/derivatives-trading-portfolio-margin-pro.ts
|
|
1619
1748
|
var DerivativesTradingPortfolioMarginPro = class {
|
|
1620
1749
|
constructor(config) {
|
|
1750
|
+
const userAgent = (0, import_common6.buildUserAgent)(name, version);
|
|
1621
1751
|
if (config?.configurationRestAPI) {
|
|
1622
|
-
const configRestAPI = new
|
|
1623
|
-
|
|
1752
|
+
const configRestAPI = new import_common6.ConfigurationRestAPI(
|
|
1753
|
+
config.configurationRestAPI
|
|
1754
|
+
);
|
|
1755
|
+
configRestAPI.basePath = configRestAPI.basePath || import_common6.DERIVATIVES_TRADING_PORTFOLIO_MARGIN_PRO_REST_API_PROD_URL;
|
|
1624
1756
|
configRestAPI.baseOptions = configRestAPI.baseOptions || {};
|
|
1625
1757
|
configRestAPI.baseOptions.headers = {
|
|
1626
1758
|
...configRestAPI.baseOptions.headers || {},
|
|
1627
|
-
"User-Agent":
|
|
1759
|
+
"User-Agent": userAgent
|
|
1628
1760
|
};
|
|
1629
1761
|
this.restAPI = new RestAPI(configRestAPI);
|
|
1630
1762
|
}
|
|
1763
|
+
if (config?.configurationWebsocketStreams) {
|
|
1764
|
+
const configWebsocketStreams = new import_common6.ConfigurationWebsocketStreams(
|
|
1765
|
+
config.configurationWebsocketStreams
|
|
1766
|
+
);
|
|
1767
|
+
configWebsocketStreams.wsURL = configWebsocketStreams.wsURL || import_common6.DERIVATIVES_TRADING_PORTFOLIO_MARGIN_PRO_WS_STREAMS_PROD_URL;
|
|
1768
|
+
configWebsocketStreams.userAgent = userAgent;
|
|
1769
|
+
this.websocketStreams = new WebsocketStreams(configWebsocketStreams);
|
|
1770
|
+
}
|
|
1631
1771
|
}
|
|
1632
1772
|
};
|
|
1633
1773
|
|
|
1634
1774
|
// src/index.ts
|
|
1635
|
-
var
|
|
1775
|
+
var import_common7 = require("@binance/common");
|
|
1636
1776
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1637
1777
|
0 && (module.exports = {
|
|
1638
1778
|
BadRequestError,
|
|
1639
1779
|
ConnectorClientError,
|
|
1640
1780
|
DERIVATIVES_TRADING_PORTFOLIO_MARGIN_PRO_REST_API_PROD_URL,
|
|
1781
|
+
DERIVATIVES_TRADING_PORTFOLIO_MARGIN_PRO_WS_STREAMS_PROD_URL,
|
|
1641
1782
|
DerivativesTradingPortfolioMarginPro,
|
|
1642
1783
|
DerivativesTradingPortfolioMarginProRestAPI,
|
|
1784
|
+
DerivativesTradingPortfolioMarginProWebsocketStreams,
|
|
1643
1785
|
ForbiddenError,
|
|
1644
1786
|
NetworkError,
|
|
1645
1787
|
NotFoundError,
|