diff --git a/.github/workflows/npmpublish.yml b/.github/workflows/npmpublish.yml index 543c3fee..6cab3487 100644 --- a/.github/workflows/npmpublish.yml +++ b/.github/workflows/npmpublish.yml @@ -8,19 +8,26 @@ on: branches: - master +permissions: + id-token: 'write' + contents: 'read' + jobs: build: + name: 'Publish NPM' runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 + - name: 'Checkout source code' + uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 with: - node-version: 12 - # - run: npm ci - # - run: npm test + node-version-file: '.nvmrc' + registry-url: 'https://registry.npmjs.org/' + cache: 'npm' publish-npm: - needs: build + name: 'Publish NPM' runs-on: ubuntu-latest steps: - name: Package Version Updated @@ -31,36 +38,28 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/checkout@v2 + - name: 'Checkout source code' if: steps.version-updated.outputs.has-updated + uses: actions/checkout@v4 - - uses: actions/setup-node@v1 + - uses: actions/setup-node@v4 if: steps.version-updated.outputs.has-updated with: - node-version: 12 - registry-url: https://registry.npmjs.org/ + node-version-file: '.nvmrc' + registry-url: 'https://registry.npmjs.org/' + cache: 'npm' - - run: npm ci --ignore-scripts + - name: Install + run: npm ci --ignore-scripts if: steps.version-updated.outputs.has-updated + - run: npm run clean if: steps.version-updated.outputs.has-updated + - run: npm run build if: steps.version-updated.outputs.has-updated - - run: npm publish --ignore-scripts + + - run: npm publish --ignore-scripts --provenance if: steps.version-updated.outputs.has-updated env: NODE_AUTH_TOKEN: ${{secrets.npm_token}} - - #publish-gpr: - #needs: build - #runs-on: ubuntu-latest - #steps: - #- uses: actions/checkout@v2 - #- uses: actions/setup-node@v1 - # with: - # node-version: 12 - # registry-url: https://npm.pkg.github.com/ - #- run: npm ci - #- run: npm publish - # env: - # NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..1b835fe3 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,35 @@ +name: 'Build & Test' + +on: [push] + +jobs: + build: + name: 'Build & Test' + runs-on: ubuntu-latest + + steps: + - name: 'Checkout source code' + uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + registry-url: 'https://registry.npmjs.org/' + cache: 'npm' + + - name: Install + run: npm ci --ignore-scripts + + - name: Build + run: npm run build + + - name: Test + run: npm run test + env: + API_KEY_COM: ${{ secrets.API_KEY_COM }} + API_SECRET_COM: ${{ secrets.API_SECRET_COM }} + PROXY_ENABLED: ${{ secrets.PROXY_ENABLED }} + PROXY_HOST: ${{ secrets.PROXY_HOST }} + PROXY_PASS: ${{ secrets.PROXY_PASS }} + PROXY_PORT: ${{ secrets.PROXY_PORT }} + PROXY_USER: ${{ secrets.PROXY_USER }} diff --git a/package.json b/package.json index 97774c03..42e0532c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "binance", - "version": "2.9.4", + "version": "2.9.5", "description": "Node.js & JavaScript SDK for Binance REST APIs & WebSockets, with TypeScript & end-to-end tests.", "main": "lib/index.js", "types": "lib/index.d.ts", diff --git a/src/types/websockets.ts b/src/types/websockets.ts index e718bed3..255819c4 100644 --- a/src/types/websockets.ts +++ b/src/types/websockets.ts @@ -311,7 +311,7 @@ export interface WsMessage24hrTickerFormatted extends WsSharedBase { closeQuantity: number; bestBid: number; bestBidQuantity: number; - bestAsk: number; + bestAskPrice: number; bestAskQuantity: number; open: number; high: number;