Skip to content

Commit

Permalink
Release v0.3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
alplabin committed Jan 24, 2024
1 parent 94c587c commit 1c0dfe9
Show file tree
Hide file tree
Showing 137 changed files with 1,963 additions and 1,382 deletions.
36 changes: 35 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,44 @@
# Changelog

## 0.3.6 - 2024-01-24

### Added
- `POST /sapi/v1/margin/borrow-repay`
- `POST /sapi/v1/margin/manual-liquidation`
- `POST /api/v3/sor/order`
- `POST /api/v3/sor/order/test`
- `GET /sapi/v1/margin/available-inventory`
- `GET /sapi/v1/margin/borrow-repay`
- `GET /sapi/v1/margin/leverageBracket`
- `GET /api/v3/account/commission`
- `GET /api/v3/myPreventedMatches`
- `GET /api/v3/myAllocations`
- `GET /api/v3/ticker/tradingDay`

### Changed
- `GET /api/v3/avgPrice`: response has a new field `closeTime`, indicating the last trade time.
- Upgrade dependencies

### Removed
- `POST /sapi/v1/margin/dust`
- `POST /sapi/v1/margin/isolated/transfer`
- `POST /sapi/v1/margin/loan`
- `POST /sapi/v1/margin/repay`
- `POST /sapi/v1/margin/transfer`
- `GET /sapi/v1/margin/asset`
- `GET /sapi/v1/margin/dribblet`
- `GET /sapi/v1/margin/dust`
- `GET /sapi/v1/margin/isolated/pair`
- `GET /sapi/v1/margin/isolated/transfer`
- `GET /sapi/v1/margin/loan`
- `GET /sapi/v1/margin/pair`
- `GET /sapi/v1/margin/repay`

## 0.3.5 - 2024-01-10
- Add new Enums
- Update Websocket types

## 0.3.4 - 2023-11-17
## 0.3.4 - 2023-11-18

- Upgrade dependencies
- Fix sentences grammar
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import dotenv from 'dotenv';
import { RestMarginTypes, Spot } from '../../../src/index';
import { MarginBorrowRepayType, RestMarginTypes, Spot } from '../../../src/index';

dotenv.config();

Expand All @@ -8,13 +8,10 @@ const apiSecret = process.env.BINANCE_API_SECRET || '';
const baseURL = process.env.BINANCE_BASE_URL || '';
const client = new Spot(apiKey, apiSecret, { baseURL: baseURL });

const options: RestMarginTypes.getRepayRecordOptions = {
txId: 2970933056,
current: 1,
size: 100,
const options: RestMarginTypes.getBorrowRepayRecordsOptions = {
recvWindow: 5000,
};

client.getRepayRecord('BTC', options).then((res: RestMarginTypes.getRepayRecordResponse) => {
client.getBorrowRepayRecords(MarginBorrowRepayType.BORROW, options).then((res: RestMarginTypes.getBorrowRepayRecordsResponse) => {
console.log(res);
}).catch(err => { console.log(err); });
}).catch(err => { console.log(err); });
12 changes: 0 additions & 12 deletions examples/restful/margin/getCrossMarginPair.ts

This file was deleted.

25 changes: 0 additions & 25 deletions examples/restful/margin/getIsolatedMarginTransferHistory.ts

This file was deleted.

13 changes: 13 additions & 0 deletions examples/restful/margin/getLeverageBracket.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import dotenv from 'dotenv';
import { RestMarginTypes, Spot } from '../../../src/index';

dotenv.config();

const apiKey = process.env.BINANCE_API_KEY || '';
const apiSecret = process.env.BINANCE_API_SECRET || '';
const baseURL = process.env.BINANCE_BASE_URL || '';
const client = new Spot(apiKey, apiSecret, { baseURL: baseURL });

client.getLeverageBracket().then((res: RestMarginTypes.getLeverageBracketResponse[]) => {
console.log(res);
}).catch(err => { console.log(err); });
12 changes: 0 additions & 12 deletions examples/restful/margin/getMarginAsset.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ const apiSecret = process.env.BINANCE_API_SECRET || '';
const baseURL = process.env.BINANCE_BASE_URL || '';
const client = new Spot(apiKey, apiSecret, { baseURL: baseURL });

const options: RestMarginTypes.getIsolatedMarginSymbolOptions = {
const options: RestMarginTypes.getIsolatedMarginTierDataOptions = {
recvWindow: 5000,
};

client.getIsolatedMarginSymbol('BNBUSDT', options).then((res: RestMarginTypes.getIsolatedMarginSymbolResponse) => {
client.getMarginAvailableInventory('MARGIN', options).then((res: RestMarginTypes.getMarginAvailableInventoryResponse) => {
console.log(res);
}).catch(err => { console.log(err); });
18 changes: 0 additions & 18 deletions examples/restful/margin/isolatedMarginAccountTransfer.ts

This file was deleted.

17 changes: 17 additions & 0 deletions examples/restful/margin/marginAccountBorrowRepay.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import dotenv from 'dotenv';
import { MarginBorrowRepayType, RestMarginTypes, Spot } from '../../../src/index';

dotenv.config();

const apiKey = process.env.BINANCE_API_KEY || '';
const apiSecret = process.env.BINANCE_API_SECRET || '';
const baseURL = process.env.BINANCE_BASE_URL || '';
const client = new Spot(apiKey, apiSecret, { baseURL: baseURL });

const options: RestMarginTypes.marginAccountBorrowRepayOptions = {
recvWindow: 5000,
};

client.marginAccountBorrowRepay('BNB', 'FALSE', 'BNBUSDT', '1.0', MarginBorrowRepayType.BORROW, options).then((res: RestMarginTypes.marginAccountBorrowRepayResponse) => {
console.log(res);
}).catch(err => { console.log(err); });
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ const apiSecret = process.env.BINANCE_API_SECRET || '';
const baseURL = process.env.BINANCE_BASE_URL || '';
const client = new Spot(apiKey, apiSecret, { baseURL: baseURL });

const options: RestMarginTypes.marginDustlogOptions = {
const options: RestMarginTypes.getIsolatedMarginTierDataOptions = {
recvWindow: 5000,
};

client.marginDustlog(options).then((res: RestMarginTypes.marginDustlogResponse) => {
client.marginManualLiquidation('MARGIN', options).then((res: RestMarginTypes.marginManualLiquidationResponse[]) => {
console.log(res);
}).catch(err => { console.log(err); });
15 changes: 15 additions & 0 deletions examples/restful/market/tradingDayTicker.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import dotenv from 'dotenv';
import { RestMarketTypes, Spot } from '../../../src/index';

dotenv.config();

const baseURL = process.env.BINANCE_BASE_URL || '';
const client = new Spot('', '', { baseURL: baseURL });

const options: RestMarketTypes.tradingDayTickerOptions = {
type: 'MINI',
};

client.tradingDayTicker('BNBUSDT', options).then((res: RestMarketTypes.tradingDayTickerResponse | RestMarketTypes.tradingDayTickerResponse[]) => {
console.log(res);
}).catch(err => { console.log(err); });
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import dotenv from 'dotenv';
import { RestMarginTypes, Spot } from '../../../src/index';
import { RestTradeTypes, Spot } from '../../../src/index';

dotenv.config();

Expand All @@ -8,11 +8,10 @@ const apiSecret = process.env.BINANCE_API_SECRET || '';
const baseURL = process.env.BINANCE_BASE_URL || '';
const client = new Spot(apiKey, apiSecret, { baseURL: baseURL });

const options: RestMarginTypes.marginAccountRepayOptions = {
symbol: 'BNBUSDT',
const options: RestTradeTypes.getAllocationsOptions = {
recvWindow: 5000,
};

client.marginAccountRepay('BTC', 1.01, options).then((res: RestMarginTypes.marginAccountRepayResponse) => {
client.getAllocations('BNBUSDT', options).then((res: RestTradeTypes.getAllocationsResponse[]) => {
console.log(res);
}).catch(err => { console.log(err); });
13 changes: 13 additions & 0 deletions examples/restful/trade/getCommissionRates.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import dotenv from 'dotenv';
import { RestTradeTypes, Spot } from '../../../src/index';

dotenv.config();

const apiKey = process.env.BINANCE_API_KEY || '';
const apiSecret = process.env.BINANCE_API_SECRET || '';
const baseURL = process.env.BINANCE_BASE_URL || '';
const client = new Spot(apiKey, apiSecret, { baseURL: baseURL });

client.getCommissionRates('BNBUSDT').then((res: RestTradeTypes.getCommissionRatesResponse) => {
console.log(res);
}).catch(err => { console.log(err); });
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import dotenv from 'dotenv';
import { RestMarginTypes, Spot } from '../../../src/index';
import { RestTradeTypes, Spot } from '../../../src/index';

dotenv.config();

Expand All @@ -8,11 +8,11 @@ const apiSecret = process.env.BINANCE_API_SECRET || '';
const baseURL = process.env.BINANCE_BASE_URL || '';
const client = new Spot(apiKey, apiSecret, { baseURL: baseURL });

const options: RestMarginTypes.marginAccountBorrowOptions = {
symbol: 'BNBUSDT',
const options: RestTradeTypes.getPreventedMatchesOptions = {
preventedMatchId: 1,
recvWindow: 5000,
};

client.marginAccountBorrow('BTC', 1.01, options).then((res: RestMarginTypes.marginAccountBorrowResponse) => {
client.getPreventedMatches('BNBUSDT', options).then((res: RestTradeTypes.getPreventedMatchesResponse[]) => {
console.log(res);
}).catch(err => { console.log(err); });
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import dotenv from 'dotenv';
import { RestMarginTypes, Spot } from '../../../src/index';
import { OrderType, RestTradeTypes, Side, Spot, TimeInForce } from '../../../src/index';

dotenv.config();

Expand All @@ -8,10 +8,12 @@ const apiSecret = process.env.BINANCE_API_SECRET || '';
const baseURL = process.env.BINANCE_BASE_URL || '';
const client = new Spot(apiKey, apiSecret, { baseURL: baseURL });

const options: RestMarginTypes.crossMarginAccountTransferOptions = {
const options: RestTradeTypes.newOrderSOROptions = {
timeInForce: TimeInForce.GTC,
price: 219,
recvWindow: 5000,
};

client.crossMarginAccountTransfer('BTC', 0.1, 1, options).then((res: RestMarginTypes.crossMarginAccountTransferResponse) => {
client.newOrderSOR('BNBUSDT', Side.SELL, OrderType.LIMIT, 1, options).then((res: RestTradeTypes.newOrderSORResponse) => {
console.log(res);
}).catch(err => { console.log(err); });
2 changes: 1 addition & 1 deletion examples/restful/trade/testNewOrder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ const options: RestTradeTypes.testNewOrderOptions = {
recvWindow: 5000,
};

client.testNewOrder('BNBUSDT', Side.SELL, OrderType.LIMIT, options).then((res: Record<string, never>) => {
client.testNewOrder('BNBUSDT', Side.SELL, OrderType.LIMIT, options).then((res: Record<string, never> | RestTradeTypes.testNewOrderResponse) => {
console.log(res);
}).catch(err => { console.log(err); });
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import dotenv from 'dotenv';
import { RestMarginTypes, Spot } from '../../../src/index';
import { OrderType, RestTradeTypes, Side, Spot, TimeInForce } from '../../../src/index';

dotenv.config();

Expand All @@ -8,13 +8,12 @@ const apiSecret = process.env.BINANCE_API_SECRET || '';
const baseURL = process.env.BINANCE_BASE_URL || '';
const client = new Spot(apiKey, apiSecret, { baseURL: baseURL });

const options: RestMarginTypes.getLoanRecordOptions = {
txId: 123456789,
current: 1,
size: 100,
const options: RestTradeTypes.testNewOrderSOROptions = {
timeInForce: TimeInForce.GTC,
price: 219,
recvWindow: 5000,
};

client.getLoanRecord('BTC', options).then((res: RestMarginTypes.getLoanRecordResponse) => {
client.testNewOrderSOR('BNBUSDT', Side.SELL, OrderType.LIMIT, 1, options).then((res: Record<string, never> | RestTradeTypes.testNewOrderResponse) => {
console.log(res);
}).catch(err => { console.log(err); });
Loading

0 comments on commit 1c0dfe9

Please sign in to comment.