Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/node-binance-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4184,7 +4184,7 @@ export default class Binance {
async futuresLeverage(symbol: string, leverage: number, params: Dict = {}) {
params.symbol = symbol;
params.leverage = leverage;
return await this.privateFuturesRequest('v1/leverage', params);
return await this.privateFuturesRequest('v1/leverage', params, 'POST');
}

// ISOLATED, CROSSED
Expand All @@ -4198,15 +4198,15 @@ export default class Binance {
async futuresMarginType(symbol: string, marginType: string, params: Dict = {}) {
params.symbol = symbol;
params.marginType = marginType;
return await this.privateFuturesRequest('v1/marginType', params);
return await this.privateFuturesRequest('v1/marginType', params, 'POST');
}

// type: 1: Add postion margin,2: Reduce postion margin
async futuresPositionMargin(symbol: string, amount: number, type = 1, params: Dict = {}) {
params.symbol = symbol;
params.amount = amount;
params.type = type;
return await this.privateFuturesRequest('v1/positionMargin', params);
return await this.privateFuturesRequest('v1/positionMargin', params, 'POST');
}

async futuresPositionMarginHistory(symbol: string, params: Dict = {}) {
Expand Down
6 changes: 6 additions & 0 deletions tests/binance-class-static.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,12 @@ describe( 'Static tests', async function () {

})


it( 'futures ser leverage', async function ( ) {
await binance.futuresLeverage( 'BTCUSDT', 5 )
assert.isTrue( interceptedUrl.startsWith('https://fapi.binance.com/fapi/v1/leverage?symbol=BTCUSDT&leverage=5' ))
})

it( 'delivery MarketBuy', async function ( ) {
await binance.deliveryOrder( 'MARKET', 'BUY', 'BTCUSD_PERP', 0.1 )
assert.isTrue( interceptedUrl.startsWith('https://dapi.binance.com/dapi/v1/order' ))
Expand Down
Loading