Skip to content

Commit

Permalink
Merge pull request #28 from zmcNotafraid/rc/v0.1.0-alpha.4
Browse files Browse the repository at this point in the history
Rc/v0.1.0 alpha.4
  • Loading branch information
zmcNotafraid authored Dec 21, 2020
2 parents b17220c + bb4f2ab commit 2da2452
Show file tree
Hide file tree
Showing 13 changed files with 103 additions and 14 deletions.
24 changes: 23 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,30 @@
# Changelog
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [0.1.0-alpha.4](https://github.com/nervosnetwork/keypering/compare/v0.1.0-alpha.2...v0.1.0-alpha.4) (2020-12-21)


### Bug Fixes

* Add devnet support ([4177caa](https://github.com/nervosnetwork/keypering/commit/4177caa7bdde7fc5cc46324b6c1346538ec70eb8))
* Fix variable has already been declared ([99e8f53](https://github.com/nervosnetwork/keypering/commit/99e8f53c27ca3dfb185d20237983cf4ec248f671))
* remove cell deps leave null dialog ([bc4fc03](https://github.com/nervosnetwork/keypering/commit/bc4fc033855f98448f89b7ec8d257143f14fb165))
* update indexer_url const ([2124eee](https://github.com/nervosnetwork/keypering/commit/2124eee577c5a4562ceed05390bcd80edd91df7f))
* Use blake2b encrypt message ([1be4e29](https://github.com/nervosnetwork/keypering/commit/1be4e29e872a89d6782c702fcbb93ada45909077))


### Features

* add sign message rpc interface ([599d378](https://github.com/nervosnetwork/keypering/commit/599d378eec67c97475b8b31eba571139b43dc8b8))
* return networkId after auth ([f12ef9a](https://github.com/nervosnetwork/keypering/commit/f12ef9a90950acc97d8479070f36c30e3683e04d))
* support vscode debug ([e631353](https://github.com/nervosnetwork/keypering/commit/e6313535df81340e0dc8fad1d224efa8b109248e))





# [0.1.0-alpha.3](https://github.com/nervosnetwork/keypering/compare/v0.1.0-alpha.2...v0.1.0-alpha.3) (2020-12-11)


Expand Down
Binary file modified docs/_media/screenshots/11.dapp_request_auth.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_media/screenshots/24.sign_message_rpc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions docs/protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ QueryAddresses: query_addresses
SignTransaction: sign_transaction
SendTransaction: send_transaction
SignAndSendTransactoin: sign_and_send_transaction
signMessage: sign_message
```
## Error Code
Expand Down Expand Up @@ -59,6 +60,7 @@ id: 1,
jsonrpc: '2.0'
result:
token: token generated by keypering agency # token used in other requests
networkId: keypering connected network # ckb, ckb_test, ckb_dev
```
### Query Addresses
Expand Down Expand Up @@ -322,3 +324,25 @@ result:
- '0x5500000010000000550000005500000041000000dccc0b3ff641e85d5f5486b842cfe2b4cfd988d081ea5fa3fefec2deb639d9ee47b41fa55380738a1fd4507bc943bdded650f2c36a139b42dfe276e26c683a2e00'
hash: '0xbc5ab6928193f783051fd61df30652724d6e8bea9b6cd13d4ee4a4aeae15042e'
```
### Sign Message
- Request
```yml
id: 1
jsonrpc: '2.0'
method: sign_message
params:
message: 'HelloCKB'
address: 'ckt1qyqyeal9u0n9a0z54thrnqdthm0uy5l0lx9qejphk5'
```
- Response
```yml
id: 1
jsonrpc: '2.0'
result:
sig: "0x5ea1dcf9a8ea8efb613a897c8fb40375c44835fbf06562cf45c585f3cac38ef808d4a8fa722f0b48191db96acb09ae7e3c4b9ff0b106b725bdfdf9e561a4e89e00"
```
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.1.0-alpha.3"
"version": "0.1.0-alpha.4"
}
23 changes: 22 additions & 1 deletion packages/app/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,29 @@
# Changelog
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [0.1.0-alpha.4](https://github.com/nervosnetwork/keypering/compare/v0.1.0-alpha.2...v0.1.0-alpha.4) (2020-12-21)


### Bug Fixes

* Add devnet support ([4177caa](https://github.com/nervosnetwork/keypering/commit/4177caa7bdde7fc5cc46324b6c1346538ec70eb8))
* Fix variable has already been declared ([99e8f53](https://github.com/nervosnetwork/keypering/commit/99e8f53c27ca3dfb185d20237983cf4ec248f671))
* remove cell deps leave null dialog ([bc4fc03](https://github.com/nervosnetwork/keypering/commit/bc4fc033855f98448f89b7ec8d257143f14fb165))
* update indexer_url const ([2124eee](https://github.com/nervosnetwork/keypering/commit/2124eee577c5a4562ceed05390bcd80edd91df7f))
* Use blake2b encrypt message ([1be4e29](https://github.com/nervosnetwork/keypering/commit/1be4e29e872a89d6782c702fcbb93ada45909077))


### Features

* add sign message rpc interface ([599d378](https://github.com/nervosnetwork/keypering/commit/599d378eec67c97475b8b31eba571139b43dc8b8))
* return networkId after auth ([f12ef9a](https://github.com/nervosnetwork/keypering/commit/f12ef9a90950acc97d8479070f36c30e3683e04d))





# [0.1.0-alpha.3](https://github.com/nervosnetwork/keypering/compare/v0.1.0-alpha.2...v0.1.0-alpha.3) (2020-12-11)


Expand Down
4 changes: 2 additions & 2 deletions packages/app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@keypering/app",
"version": "0.1.0-alpha.3",
"version": "0.1.0-alpha.4",
"description": "",
"author": "Keith <[email protected]>",
"homepage": "https://nervosnetwork.github.io/keypering",
Expand Down Expand Up @@ -32,7 +32,7 @@
"url": "https://github.com/nervosnetwork/keypering/issues"
},
"devDependencies": {
"@keypering/specs": "0.1.0-alpha.3",
"@keypering/specs": "0.1.0-alpha.4",
"@types/elliptic": "6.4.12",
"@types/uuid": "8.0.1",
"electron": "9.2.0",
Expand Down
7 changes: 5 additions & 2 deletions packages/app/src/auth/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import PasswordWindow from '../wallet/PasswordWindow'
import simpleToken from './strategy/simple'
import { getDataPath } from '../utils'
import { broadcastAuthList as broadcast } from '../broadcast'
import { getSetting } from '../setting'
import {
ParamsRequiredException,
AuthNotFoundException,
Expand Down Expand Up @@ -96,7 +97,8 @@ export const deleteAuth = async (id: string, url: string): Promise<boolean> => {
return true
}

export const requestAuth = async (origin: string, url: string): Promise<string> => {
export const requestAuth = async (origin: string, url: string):
Promise<{ token: string, networkId: Channel.NetworkId }> => {
const { current } = getWalletIndex()
if (!current) {
throw new CurrentWalletNotSetException()
Expand Down Expand Up @@ -124,8 +126,9 @@ export const requestAuth = async (origin: string, url: string): Promise<string>
}

const token = addAuth(current, origin)
const { networkId } = getSetting()

return token
return { token, networkId }
}

export const isAuthedByCurrentWallet = (token: string) => {
Expand Down
4 changes: 2 additions & 2 deletions packages/app/src/server/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import { getSetting } from '../setting'
import { networksToRpcUrl } from '../utils/transformer'

export const handleAuth = async (_params: KeyperingAgency.Auth.Params['params'], origin: string, url: string) => {
const token = await requestAuth(origin, url)
return { token }
const { token, networkId } = await requestAuth(origin, url)
return { token, networkId }
}

export const handleSign = async (params: KeyperingAgency.SignTransaction.Params['params'], url: string) => {
Expand Down
13 changes: 12 additions & 1 deletion packages/specs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
# Changelog
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [0.1.0-alpha.4](https://github.com/nervosnetwork/keypering/compare/v0.1.0-alpha.2...v0.1.0-alpha.4) (2020-12-21)


### Features

* add sign message rpc interface ([599d378](https://github.com/nervosnetwork/keypering/commit/599d378eec67c97475b8b31eba571139b43dc8b8))





# [0.1.0-alpha.3](https://github.com/nervosnetwork/keypering/compare/v0.1.0-alpha.2...v0.1.0-alpha.3) (2020-12-11)


Expand Down
2 changes: 1 addition & 1 deletion packages/specs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@keypering/specs",
"version": "0.1.0-alpha.3",
"version": "0.1.0-alpha.4",
"description": "",
"author": "Keith <[email protected]>",
"homepage": "https://nervosnetwork.github.io/keypering/#/protocol",
Expand Down
10 changes: 9 additions & 1 deletion packages/ui/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
# Changelog
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [0.1.0-alpha.4](https://github.com/zmcNotafraid/keypering/compare/v0.1.0-alpha.2...v0.1.0-alpha.4) (2020-12-21)

**Note:** Version bump only for package @keypering/ui





# [0.1.0-alpha.3](https://github.com/nervosnetwork/keypering/compare/v0.1.0-alpha.2...v0.1.0-alpha.3) (2020-12-11)

**Note:** Version bump only for package @keypering/ui
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@keypering/ui",
"version": "0.1.0-alpha.3",
"version": "0.1.0-alpha.4",
"private": true,
"homepage": ".",
"scripts": {
Expand Down Expand Up @@ -29,7 +29,7 @@
"react-scripts": "3.4.1"
},
"devDependencies": {
"@keypering/specs": "0.1.0-alpha.3",
"@keypering/specs": "0.1.0-alpha.4",
"@nervosnetwork/ckb-types": "0.34.0",
"@types/react": "16.9.45",
"@types/react-dom": "16.9.0",
Expand Down

0 comments on commit 2da2452

Please sign in to comment.