Skip to content

Commit

Permalink
Merge pull request #479 from nervosnetwork/rc/v0.35.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Keith-CY authored Aug 24, 2020
2 parents 9b0ab2d + aa79ce8 commit 1e430b6
Show file tree
Hide file tree
Showing 38 changed files with 1,140 additions and 594 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/bundle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Bundle ckb.min.js

on:
workflow_run:
workflows: ['Unit Tests']
branches: [master, develop]
types: [completed]

jobs:
default:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install Node.js
uses: actions/setup-node@v2-beta
with:
node-version: 12

- name: Restore
uses: actions/cache@v2
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}

- name: Install Lerna
run: npm install -g lerna

- name: Install Deps
run: lerna bootstrap --mutex file:/tmp/.yarn-mutex --concurrency=1;

- name: Compile
run: |
lerna run tsc
echo "module.exports = require('@nervosnetwork/ckb-sdk-core').default;" > ./packages/ckb-sdk-core/ckb.js
npx browserify ./packages/ckb-sdk-core/ckb.js -o ./ckb-sdk.js
npx terser --compress --mangle -o ckb-sdk.min.js -- ckb-sdk.js
- name: Upload Files
uses: actions/upload-artifact@v2
with:
name: ckb-sdk-js
path: ./ckb-sdk.min.js
25 changes: 25 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Deploy Docs

on:
release:
types: [published]

jobs:
deploy:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
- name: Install and build
run: |
npm install -g lerna
lerna bootstrap
yarn run docs
- name: Deploy
uses: JamesIves/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: docs
CLEAN: true
17 changes: 17 additions & 0 deletions .github/workflows/snyk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: SNYK

on:
schedule:
- cron: '0 0 * * *'

jobs:
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run Snyk
uses: snyk/actions/node@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
command: monitor
42 changes: 42 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Unit Tests

on:
schedule:
- cron: '0 0 * * *'
push:
pull_request:

jobs:
default:
strategy:
matrix:
node: [12, 13, 14]
os: [macos-latest, ubuntu-18.04]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v2-beta
with:
node-version: ${{ matrix.node }}
- name: Restore
uses: actions/cache@v2
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: Install Lerna
run: npm install -g lerna
- name: Install Deps
run: lerna bootstrap --mutex file:/tmp/.yarn-mutex --concurrency=1;
- name: Compile
run: lerna run tsc
- name: Test
run: yarn run test
- name: Upload codecov
if: matrix.os == 'macos-latest' && matrix.node == '14'
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
36 changes: 0 additions & 36 deletions .travis.yml

This file was deleted.

38 changes: 38 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,44 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [0.35.0](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.34.0...v0.35.0) (2020-08-24)


### Bug Fixes

* **rpc:** fix init parameter type of batch request ([2b80f59](https://github.com/nervosnetwork/ckb-sdk-js/commit/2b80f59b728831c6d084ef35359309a397c814c6))


### Features

* **rpc:** remove an RPC ([98eb935](https://github.com/nervosnetwork/ckb-sdk-js/commit/98eb935781715202207c4fd070bfc30cb0a65378))
* **rpc:** update RPCs ([#477](https://github.com/nervosnetwork/ckb-sdk-js/pull/477))
- separate basic RPC by group
- update teh API of rpc#localNodeInfo, rpc#txPoolInfo, and rpc#getPeers
- add new RPCs: rpc#syncState, rpc#clearTxPool, rpc#setNetworkActive, rpc#addNode and rpc#removeNode
* **utils:** add epoch module ([8d6478a](https://github.com/nervosnetwork/ckb-sdk-js/commit/8d6478a24e13650037e2a29001fdf9fd2f50d40c))
* **utils:** set the default address prefix 'ckb' ([3134eda](https://github.com/nervosnetwork/ckb-sdk-js/commit/3134edae7a7d6806c60c9f1679473701c07a4579))
* **utils:** use strict validation on address ([bb23ce9](https://github.com/nervosnetwork/ckb-sdk-js/commit/bb23ce9ad5f4ef4e692a96662d5f7b49ad296784))
* **utils:** utils#calculateSerializedTxSizeInBlock is renamed to utils#getTransactionSize ([8fbc43a](https://github.com/nervosnetwork/ckb-sdk-js/commit/8fbc43a00499eb1e3e1fd1adadd4392c509d9dca))
* **utils:** remove utils#toHexInLittleEndian which is deprecated ([a028887](https://github.com/nervosnetwork/ckb-sdk-js/commit/a028887ab2fd46679941cbc5fca940e3d1410e64))
* **utils:** remove methods related to utf8 string ([f9cf9cc](https://github.com/nervosnetwork/ckb-sdk-js/pull/480/commits/f9cf9cced7ea518727eb50f4e471dbe0cba63c12))


### BREAKING CHANGES

* **rpc:** remove rpc#getPeersState
* **rpc:** rpc#getPeers returns connectedDuration, lastPingDuration, protocols, syncState
* **rpc:** rpc#localNodeInfo returns active, connections, protocols
* **utils:** utils#calculateSerializedTxSizeInBlock is renamed to utils#getTransactionSize
* **utils:** Set the default address prefix 'ckb' instead of 'ckt'
* **utils:** The arg field in params of utils#fullPayloadToAddress is renamed to args
* **utils:** Remove utils#toHexInLittleEndian which is deprecated
* **utils:** Remove methods related to utf8 string





# [0.34.0](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.33.0...v0.34.0) (2020-07-21)


Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@

| Service | Master | Develop |
| -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Travis | [![Build Status](https://travis-ci.com/nervosnetwork/ckb-sdk-js.svg?branch=master)](https://travis-ci.com/nervosnetwork/ckb-sdk-js) | [![Build Status](https://travis-ci.com/nervosnetwork/ckb-sdk-js.svg?branch=develop)](https://travis-ci.com/nervosnetwork/ckb-sdk-js) |
| Unit Tests | [![Unit Tests](https://github.com/nervosnetwork/ckb-sdk-js/workflows/Unit%20Tests/badge.svg?branch=master)](https://github.com/nervosnetwork/ckb-sdk-js/actions?query=branch%3Amaster+workflow%3A%22Unit+Tests%22) | [![Unit Tests](https://github.com/nervosnetwork/ckb-sdk-js/workflows/Unit%20Tests/badge.svg?branch=develop)](https://github.com/nervosnetwork/ckb-sdk-js/actions?query=branch%3Adevelop+workflow%3A%22Unit+Tests%22) |
| Coverage | [![Codecov](https://codecov.io/gh/nervosnetwork/ckb-sdk-js/branch/master/graph/badge.svg)](https://codecov.io/gh/nervosnetwork/ckb-sdk-js/branch/master) | [![Codecov](https://codecov.io/gh/nervosnetwork/ckb-sdk-js/branch/develop/graph/badge.svg)](https://codecov.io/gh/nervosnetwork/ckb-sdk-js/branch/develop) |

[![NPM](https://img.shields.io/npm/v/@nervosnetwork/ckb-sdk-core/latest.svg)](https://www.npmjs.com/package/@nervosnetwork/ckb-sdk-core)
[![Package Quality](https://npm.packagequality.com/shield/%40nervosnetwork%2Fckb-sdk-core.svg)](https://packagequality.com/#?package=@nervosnetwork/ckb-sdk-core)
[![License](https://img.shields.io/npm/l/@nervosnetwork/ckb-sdk-core.svg)](./LICENSE)
[![Telegram Group](https://cdn.rawgit.com/Patrolavia/telegram-badge/8fe3382b/chat.svg)](https://t.me/nervos_ckb_dev)
[![SNYK](https://github.com/nervosnetwork/ckb-sdk-js/workflows/SNYK/badge.svg)](https://github.com/nervosnetwork/ckb-sdk-js/actions?query=workflow%3ASNYK)
[![Deploy Docs](https://github.com/nervosnetwork/ckb-sdk-js/workflows/Deploy%20Docs/badge.svg)](https://nervosnetwork.github.io/ckb-sdk-js/classes/ckb.html)

JavaScript SDK for Nervos [CKB](https://github.com/nervosnetwork/ckb).

Expand Down Expand Up @@ -50,7 +52,7 @@ The ckb-sdk-js is still under development and NOT production ready. You should g
Due to safety concern, the SDK won’t generate private keys for you. You can use `openssl` to generate a private key:

```sh
$ openssl rand 32 -hex
$ openssl rand -hex 32
```

For other cases, say, you're going to generate it in a JavaScript Project(Please don't), [Elliptic](https://github.com/indutny/elliptic/) may be the one you can use.
Expand Down Expand Up @@ -224,7 +226,6 @@ The rpc module will throw an error when the result contains an error field, you
3. [Send Transaction with multiple private key](https://github.com/nervosnetwork/ckb-sdk-js/blob/develop/packages/ckb-sdk-core/examples/sendTransactionWithMultiplePrivateKey.js)
4. [Deposit to and withdraw from Nervos DAO](https://github.com/nervosnetwork/ckb-sdk-js/blob/develop/packages/ckb-sdk-core/examples/nervosDAO.js)
5. [Send Transaction with Lumos Collector](https://github.com/nervosnetwork/ckb-sdk-js/blob/develop/packages/ckb-sdk-core/examples/sendTransactionWithLumosCollector.js)
6. [Lumos Starter](https://github.com/Keith-CY/ckb-sdk-lumos-starter)

# Development Process

Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
],
"npmClient": "yarn",
"useWorkspaces": true,
"version": "0.34.0"
"version": "0.35.0"
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"prettier": "2.0.5",
"rimraf": "3.0.2",
"typedoc": "0.17.8",
"typescript": "3.9.6"
"typescript": "4.0.1-rc"
},
"config": {
"commitizen": {
Expand Down
8 changes: 8 additions & 0 deletions packages/ckb-sdk-core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [0.35.0](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.34.0...v0.35.0) (2020-08-24)

**Note:** Version bump only for package @nervosnetwork/ckb-sdk-core





# [0.34.0](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.33.0...v0.34.0) (2020-07-21)


Expand Down
10 changes: 5 additions & 5 deletions packages/ckb-sdk-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nervosnetwork/ckb-sdk-core",
"version": "0.34.0",
"version": "0.35.0",
"description": "JavaScript SDK for Nervos Network CKB Project",
"author": "Nervos <[email protected]>",
"homepage": "https://github.com/nervosnetwork/ckb-sdk-js#readme",
Expand Down Expand Up @@ -31,9 +31,9 @@
"url": "https://github.com/nervosnetwork/ckb-sdk-js/issues"
},
"dependencies": {
"@nervosnetwork/ckb-sdk-rpc": "0.34.0",
"@nervosnetwork/ckb-sdk-utils": "0.34.0",
"@nervosnetwork/ckb-types": "0.34.0"
"@nervosnetwork/ckb-sdk-rpc": "0.35.0",
"@nervosnetwork/ckb-sdk-utils": "0.35.0",
"@nervosnetwork/ckb-types": "0.35.0"
},
"gitHead": "42eda626fd2afdca1d4e2ef69199dd97c9b3763f"
"gitHead": "409da3a2e4a48a927a8ec884ed494b6bafbbfa5b"
}
27 changes: 27 additions & 0 deletions packages/ckb-sdk-rpc/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,33 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [0.35.0](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.34.0...v0.35.0) (2020-08-24)


### Bug Fixes

* **rpc:** fix init parameter type of batch request ([2b80f59](https://github.com/nervosnetwork/ckb-sdk-js/commit/2b80f59b728831c6d084ef35359309a397c814c6))


### Features

* **rpc:** remove an RPC ([98eb935](https://github.com/nervosnetwork/ckb-sdk-js/commit/98eb935781715202207c4fd070bfc30cb0a65378))
* **rpc:** update RPCs ([#477](https://github.com/nervosnetwork/ckb-sdk-js/pull/477))
- separate basic RPC by group
- update teh API of rpc#localNodeInfo, rpc#txPoolInfo, and rpc#getPeers
- add new RPCs: rpc#syncState, rpc#clearTxPool, rpc#setNetworkActive, rpc#addNode and rpc#removeNode


### BREAKING CHANGES

* **rpc:** remove rpc#getPeersState
* **rpc:** rpc#getPeers returns connectedDuration, lastPingDuration, protocols, syncState
* **rpc:** rpc#localNodeInfo returns active, connections, protocols





# [0.34.0](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.33.0...v0.34.0) (2020-07-21)


Expand Down
4 changes: 2 additions & 2 deletions packages/ckb-sdk-rpc/__tests__/ckb-rpc-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ describe('ckb-rpc settings and helpers', () => {
expect(rpc.node.httpsAgent).toBeDefined()
})

it('has 31 basic rpc', () => {
expect(Object.values(rpc)).toHaveLength(30)
it('has 34 basic rpc', () => {
expect(Object.values(rpc)).toHaveLength(34)
})

it('set node url to http://test.localhost:8114', () => {
Expand Down
Loading

0 comments on commit 1e430b6

Please sign in to comment.