diff --git a/CHANGELOG.md b/CHANGELOG.md index ff26234..35d7073 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/docs/_media/screenshots/11.dapp_request_auth.png b/docs/_media/screenshots/11.dapp_request_auth.png index 83913e0..8e513cb 100644 Binary files a/docs/_media/screenshots/11.dapp_request_auth.png and b/docs/_media/screenshots/11.dapp_request_auth.png differ diff --git a/docs/_media/screenshots/24.sign_message_rpc.png b/docs/_media/screenshots/24.sign_message_rpc.png index fb87c90..14b0a07 100644 Binary files a/docs/_media/screenshots/24.sign_message_rpc.png and b/docs/_media/screenshots/24.sign_message_rpc.png differ diff --git a/docs/protocol.md b/docs/protocol.md index bf3e5b8..8f07f99 100644 --- a/docs/protocol.md +++ b/docs/protocol.md @@ -8,6 +8,7 @@ QueryAddresses: query_addresses SignTransaction: sign_transaction SendTransaction: send_transaction SignAndSendTransactoin: sign_and_send_transaction +signMessage: sign_message ``` ## Error Code @@ -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 @@ -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" +``` diff --git a/lerna.json b/lerna.json index 56ba218..41b0fda 100644 --- a/lerna.json +++ b/lerna.json @@ -4,5 +4,5 @@ ], "npmClient": "yarn", "useWorkspaces": true, - "version": "0.1.0-alpha.3" + "version": "0.1.0-alpha.4" } diff --git a/packages/app/CHANGELOG.md b/packages/app/CHANGELOG.md index 2a0a231..7205f39 100644 --- a/packages/app/CHANGELOG.md +++ b/packages/app/CHANGELOG.md @@ -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) diff --git a/packages/app/package.json b/packages/app/package.json index 1b9773e..a745c87 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,6 +1,6 @@ { "name": "@keypering/app", - "version": "0.1.0-alpha.3", + "version": "0.1.0-alpha.4", "description": "", "author": "Keith ", "homepage": "https://nervosnetwork.github.io/keypering", @@ -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", diff --git a/packages/app/src/auth/service.ts b/packages/app/src/auth/service.ts index 5eb0f0c..af86e76 100644 --- a/packages/app/src/auth/service.ts +++ b/packages/app/src/auth/service.ts @@ -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, @@ -96,7 +97,8 @@ export const deleteAuth = async (id: string, url: string): Promise => { return true } -export const requestAuth = async (origin: string, url: string): Promise => { +export const requestAuth = async (origin: string, url: string): + Promise<{ token: string, networkId: Channel.NetworkId }> => { const { current } = getWalletIndex() if (!current) { throw new CurrentWalletNotSetException() @@ -124,8 +126,9 @@ export const requestAuth = async (origin: string, url: string): Promise } const token = addAuth(current, origin) + const { networkId } = getSetting() - return token + return { token, networkId } } export const isAuthedByCurrentWallet = (token: string) => { diff --git a/packages/app/src/server/controller.ts b/packages/app/src/server/controller.ts index b5e8d9b..a59d470 100644 --- a/packages/app/src/server/controller.ts +++ b/packages/app/src/server/controller.ts @@ -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) => { diff --git a/packages/specs/CHANGELOG.md b/packages/specs/CHANGELOG.md index c9f7738..48f7136 100644 --- a/packages/specs/CHANGELOG.md +++ b/packages/specs/CHANGELOG.md @@ -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) diff --git a/packages/specs/package.json b/packages/specs/package.json index 56a1e2c..969ca2a 100644 --- a/packages/specs/package.json +++ b/packages/specs/package.json @@ -1,6 +1,6 @@ { "name": "@keypering/specs", - "version": "0.1.0-alpha.3", + "version": "0.1.0-alpha.4", "description": "", "author": "Keith ", "homepage": "https://nervosnetwork.github.io/keypering/#/protocol", diff --git a/packages/ui/CHANGELOG.md b/packages/ui/CHANGELOG.md index d50d37c..7125099 100644 --- a/packages/ui/CHANGELOG.md +++ b/packages/ui/CHANGELOG.md @@ -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 diff --git a/packages/ui/package.json b/packages/ui/package.json index 4a41187..c3f76d8 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -1,6 +1,6 @@ { "name": "@keypering/ui", - "version": "0.1.0-alpha.3", + "version": "0.1.0-alpha.4", "private": true, "homepage": ".", "scripts": { @@ -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",