Skip to content

Commit

Permalink
Release v3.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
alplabin committed Oct 1, 2024
1 parent 83f9f46 commit 69bfea7
Show file tree
Hide file tree
Showing 70 changed files with 660 additions and 1,946 deletions.
37 changes: 35 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,43 @@
# Changelog

## 3.4.2 - 2024-09-24
## 3.5.0 - 2024-10-01
### Added
- Add GiftCard endpoint:
- `POST /sapi/v1/giftcard/buyCode` to create a dual-token gift card

### Changed
- Updated dependencies
- Updated endpoint `/sapi/v1/sub-account/subAccountApi/ipRestriction` to `/sapi/v2/sub-account/subAccountApi/ipRestriction`

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

- Deprecated Sub-Account endpoints:
- `POST /sapi/v1/sub-account/subAccountApi/ipRestriction/ipList`

- Deprecated Futures endpoints:
- `POST /sapi/v1/futures/transfer`
- `GET /sapi/v1/futures/transfer`

- BLVT endpoints:
- `GET /sapi/v1/blvt/tokenInfo`
- `POST /sapi/v1/blvt/subscribe`
- `GET /sapi/v1/blvt/subscribe/record`
- `POST /sapi/v1/blvt/redeem`
- `GET /sapi/v1/blvt/redeem/record`

## 3.4.1 - 2024-08-19
### Updated
- Updated dependencies
Expand Down
13 changes: 0 additions & 13 deletions __tests__/spot/blvt/blvtInfo.test.js

This file was deleted.

36 changes: 0 additions & 36 deletions __tests__/spot/blvt/blvtRedemptionRecord.test.js

This file was deleted.

36 changes: 0 additions & 36 deletions __tests__/spot/blvt/blvtSubscriptionRecord.test.js

This file was deleted.

32 changes: 0 additions & 32 deletions __tests__/spot/blvt/redeemBlvt.test.js

This file was deleted.

38 changes: 0 additions & 38 deletions __tests__/spot/blvt/subscribeBlvt.test.js

This file was deleted.

44 changes: 0 additions & 44 deletions __tests__/spot/futures/futuresTransfer.test.js

This file was deleted.

37 changes: 0 additions & 37 deletions __tests__/spot/futures/futuresTransferHistory.test.js

This file was deleted.

29 changes: 18 additions & 11 deletions __tests__/spot/gift_card/giftCardBuyCode.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,36 @@ const MissingParameterError = require('../../../src/error/missingParameterError'
const { nockPostMock, buildQueryString, SpotClient } = require('../../testUtils/testSetup')

const {
mockResponse,
amount
mockResponse
} = require('../../testUtils/mockData')

const baseToken = 'USDT'
const faceToken = 'BNB'
const baseTokenAmount = 10

describe('#giftCardBuyCode', () => {
it.each([
[undefined, undefined, undefined], ['', '', ''], [null, null, null],
[undefined, faceToken, undefined], ['', faceToken, ''], [null, faceToken, null],
[baseToken, undefined, undefined], [baseToken, '', ''], [baseToken, null, null],
[undefined, undefined, amount], ['', '', amount], [baseToken, faceToken, null]
])('should throw MissingParameterError given missing params', (baseToken, faceToken, amount) => {
it('missing baseToken', () => {
expect(() => {
SpotClient.giftCardBuyCode(baseToken, faceToken, amount)
SpotClient.giftCardBuyCode('', faceToken, baseTokenAmount)
}).toThrow(MissingParameterError)
})

it('missing faceToken', () => {
expect(() => {
SpotClient.giftCardBuyCode(baseToken, '', baseTokenAmount)
}).toThrow(MissingParameterError)
})

it('missing baseTokenAmount', () => {
expect(() => {
SpotClient.giftCardBuyCode(baseToken, faceToken, '')
}).toThrow(MissingParameterError)
})

it('should return binance code info', () => {
nockPostMock(`/sapi/v1/giftcard/buyCode?${buildQueryString({ baseToken, faceToken, baseTokenAmount: amount })}`)(mockResponse)
nockPostMock(`/sapi/v1/giftcard/buyCode?${buildQueryString({ baseToken, faceToken, baseTokenAmount })}`)(mockResponse)

return SpotClient.giftCardBuyCode(baseToken, faceToken, amount).then(response => {
return SpotClient.giftCardBuyCode(baseToken, faceToken, baseTokenAmount).then(response => {
expect(response).toBeDefined()
expect(response.data).toEqual(mockResponse)
})
Expand Down
23 changes: 0 additions & 23 deletions __tests__/spot/margin/isolatedMarginSymbol.test.js

This file was deleted.

Loading

0 comments on commit 69bfea7

Please sign in to comment.