diff --git a/.github/workflows/update_wallet_env.yml b/.github/workflows/update_wallet_env.yml index f02a69b70b..5f3d7f090e 100644 --- a/.github/workflows/update_wallet_env.yml +++ b/.github/workflows/update_wallet_env.yml @@ -19,7 +19,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: branch: 'chore-update-wallet-env/${{github.ref_name}}' - sha: '${{ github.event.create.head.sha }}' + sha: '${{ github.sha }}' - name: Checkout uses: actions/checkout@v4 diff --git a/CHANGELOG.md b/CHANGELOG.md index a35aea95a9..14a324aac9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,77 @@ +# 0.116.2 (2024-05-29) + +### CKB Node & Light Client + +- [CKB@v0.116.1](https://github.com/nervosnetwork/ckb/releases/tag/v0.116.1) was released on May. 11st, 2024. This version of CKB node is now bundled and preconfigured in Neuron. +- [CKB Light Client@v0.3.7](https://github.com/nervosnetwork/ckb-light-client/releases/tag/v0.3.7) was released on Apr. 13th, 2024. This version of CKB Light Client is now bundled and preconfigured in Neuron + +### Assumed valid target + +Block before `0x6dd077b407d019a0bce0cbad8c34e69a524ae4b2599b9feda2c7491f3559d32c`(at height `13,007,704`) will be skipped in validation.(https://github.com/nervosnetwork/neuron/pull/3157) + +--- + +## Bug fixes + +- 3179: Remove the display of the ledger firmware version because it causes the Nervos app to crash on the ledger device.(@yanguoyu) + +**Full Changelog**: https://github.com/nervosnetwork/neuron/compare/v0.116.1...v0.116.2 + +# 0.116.1 (2024-05-28) + +### CKB Node & Light Client + +- [CKB@v0.116.1](https://github.com/nervosnetwork/ckb/releases/tag/v0.116.1) was released on May. 11st, 2024. This version of CKB node is now bundled and preconfigured in Neuron. +- [CKB Light Client@v0.3.7](https://github.com/nervosnetwork/ckb-light-client/releases/tag/v0.3.7) was released on Apr. 13th, 2024. This version of CKB Light Client is now bundled and preconfigured in Neuron + +### Assumed valid target + +Block before `0x6dd077b407d019a0bce0cbad8c34e69a524ae4b2599b9feda2c7491f3559d32c`(at height `13,007,704`) will be skipped in validation.(https://github.com/nervosnetwork/neuron/pull/3157) + +--- + +## Bug fixes + +- 3173: Fix importing an account from a hardware wallet.(@yanguoyu) + +**Full Changelog**: https://github.com/nervosnetwork/neuron/compare/v0.116.0...v0.116.1 + +# 0.116.0 (2024-05-24) + +### CKB Node & Light Client + +- [CKB@v0.116.1](https://github.com/nervosnetwork/ckb/releases/tag/v0.116.1) was released on May. 11st, 2024. This version of CKB node is now bundled and preconfigured in Neuron. +- [CKB Light Client@v0.3.7](https://github.com/nervosnetwork/ckb-light-client/releases/tag/v0.3.7) was released on Apr. 13th, 2024. This version of CKB Light Client is now bundled and preconfigured in Neuron + +### Assumed valid target + +Block before `0x6dd077b407d019a0bce0cbad8c34e69a524ae4b2599b9feda2c7491f3559d32c`(at height `13,007,704`) will be skipped in validation.(https://github.com/nervosnetwork/neuron/pull/3157) + +--- + +[![Neuron@v0.116.0](https://github.com/Magickbase/neuron-public-issues/assets/7271329/ec10aa01-47fe-47a3-9636-3d4e86fc6c9b)](https://youtu.be/QXv8by2C8zU) + +YouTube: https://youtu.be/QXv8by2C8zU + +--- + +## New features + +- 3134: Support 'replace-by-fee' nervos dao transactions and sudt transactions.(@devchenyan) +- 3144: Reduce size of light client log in debug information and reveal start-block-number in log.(@yanguoyu) +- 3064: Support locking window by pin code.(@yanguoyu) +- 3131: Add detailed result for nervos dao transaction.(@devchenyan) + +## Bug fixes + +- 3121: Locate the first transaction on Explorer directly when users want to set the start-block-number for light client.(@yanguoyu) +- 3101: Show migration instruction properly.(@devchenyan) +- 3062: Migrate legacy ACP to active ACP account(@yanguoyu) +- 3141: Fix some issues about light client synchronizaiton.(@yanguoyu) +- 3120: Remove all sync data when start-block-number is set less than before.(@yanguoyu) + +**Full Changelog**: https://github.com/nervosnetwork/neuron/compare/v0.114.3...v0.116.0 + # 0.114.3 (2024-04-16) ### CKB Node & Light Client diff --git a/compatible.json b/compatible.json index 028ff3cb04..b2865b7a18 100644 --- a/compatible.json +++ b/compatible.json @@ -99,6 +99,22 @@ "0.3", "0.2" ] + }, + "0.116": { + "full": [ + "0.116", + "0.115", + "0.114", + "0.113", + "0.112", + "0.111", + "0.110", + "0.109" + ], + "light": [ + "0.3", + "0.2" + ] } } } diff --git a/lerna.json b/lerna.json index 0e77734cb4..42a9f9ef22 100644 --- a/lerna.json +++ b/lerna.json @@ -1,6 +1,6 @@ { "packages": ["packages/*"], - "version": "0.114.3", + "version": "0.116.2", "npmClient": "yarn", "$schema": "node_modules/lerna/schemas/lerna-schema.json" } diff --git a/package.json b/package.json index 62c7a5ad1b..4a5cc5abac 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "neuron", "productName": "Neuron", "description": "CKB Neuron Wallet", - "version": "0.114.3", + "version": "0.116.2", "private": true, "author": { "name": "Nervos Core Dev", diff --git a/packages/neuron-ui/package.json b/packages/neuron-ui/package.json index 5c6ce190e1..1319e32973 100644 --- a/packages/neuron-ui/package.json +++ b/packages/neuron-ui/package.json @@ -1,6 +1,6 @@ { "name": "neuron-ui", - "version": "0.114.3", + "version": "0.116.2", "private": true, "author": { "name": "Nervos Core Dev", diff --git a/packages/neuron-ui/src/components/AmendSUDTSend/index.tsx b/packages/neuron-ui/src/components/AmendSUDTSend/index.tsx index 5cdbc79812..66250d03b6 100644 --- a/packages/neuron-ui/src/components/AmendSUDTSend/index.tsx +++ b/packages/neuron-ui/src/components/AmendSUDTSend/index.tsx @@ -198,7 +198,7 @@ const AmendSUDTSend = () => {
-
diff --git a/packages/neuron-ui/src/components/AmendSend/index.tsx b/packages/neuron-ui/src/components/AmendSend/index.tsx index 92eb75675d..453eef097b 100644 --- a/packages/neuron-ui/src/components/AmendSend/index.tsx +++ b/packages/neuron-ui/src/components/AmendSend/index.tsx @@ -96,6 +96,15 @@ const AmendSend = () => { return '' } + const inputsCapacity = useMemo(() => { + if (transaction) { + return transaction.inputs.reduce((total, cur) => { + return total + BigInt(cur.capacity || '0') + }, BigInt(0)) + } + return undefined + }, [transaction]) + const items: { address: string amount: string @@ -103,21 +112,25 @@ const AmendSend = () => { isLastOutput: boolean output: State.DetailedOutput }[] = useMemo(() => { - if (transaction && transaction.outputs.length) { + if (transaction && transaction.outputs.length && inputsCapacity) { const lastOutputAddress = getLastOutputAddress(transaction.outputs) return transaction.outputs.map(output => { const address = scriptToAddress(output.lock, { isMainnet }) + const capacity = + transaction.outputs.length === 1 && address === lastOutputAddress + ? (inputsCapacity - fee).toString() + : output.capacity return { - capacity: output.capacity, + capacity, address, output, - amount: shannonToCKBFormatter(output.capacity || '0'), + amount: shannonToCKBFormatter(capacity || '0'), isLastOutput: address === lastOutputAddress, } }) } return [] - }, [transaction?.outputs]) + }, [transaction?.outputs, inputsCapacity, fee]) const outputsCapacity = useMemo(() => { const outputList = items.length === 1 ? items : items.filter(item => !item.isLastOutput) @@ -129,15 +142,15 @@ const AmendSend = () => { const totalAmount = shannonToCKBFormatter(outputsCapacity.toString()) const lastOutputsCapacity = useMemo(() => { - if (transaction) { - const inputsCapacity = transaction.inputs.reduce((total, cur) => { - return total + BigInt(cur.capacity || '0') - }, BigInt(0)) + if (inputsCapacity) { + if (items.length === 1) { + return BigInt(items[0].capacity || '0') + } return inputsCapacity - outputsCapacity - fee } return undefined - }, [transaction, fee, outputsCapacity]) + }, [inputsCapacity, fee, outputsCapacity, items]) useEffect(() => { if (transaction && lastOutputsCapacity !== undefined) { @@ -237,7 +250,7 @@ const AmendSend = () => { {t('send.allow-use-sent-cell')}
-
diff --git a/packages/neuron-ui/src/components/FormattedTokenAmount/index.tsx b/packages/neuron-ui/src/components/FormattedTokenAmount/index.tsx index 4a180ba15f..b31da32d3c 100644 --- a/packages/neuron-ui/src/components/FormattedTokenAmount/index.tsx +++ b/packages/neuron-ui/src/components/FormattedTokenAmount/index.tsx @@ -12,7 +12,7 @@ type FormattedTokenAmountProps = { item: State.Transaction; show: boolean; symbo type AmountProps = Omit & { sudtAmount?: string isReceive: boolean - amount: string + amount?: string symbolClassName?: string } @@ -30,18 +30,18 @@ const Amount = ({ sudtAmount, show, item, isReceive, amount, symbolClassName, sy
) : (
- - {amount} + + {amount ?? '--'} -  {symbol} +  {amount ? symbol : ''}
) } export const FormattedTokenAmount = ({ item, show, symbolClassName }: FormattedTokenAmountProps) => { - let amount = '--' + let amount: string | undefined let sudtAmount = '' - let copyText = amount + let copyText: string | undefined = amount let isReceive = false let symbol = '' @@ -61,16 +61,22 @@ export const FormattedTokenAmount = ({ item, show, symbolClassName }: FormattedT isReceive = !sudtAmount.includes('-') } } else { - amount = show ? `${shannonToCKBFormatter(item.value, true)}` : `${HIDE_BALANCE}` - isReceive = !amount.includes('-') + amount = show + ? `${shannonToCKBFormatter(item.nervosDao ? item.daoCapacity ?? '--' : item.value, true)}` + : `${HIDE_BALANCE}` + isReceive = !amount?.includes('-') copyText = `${amount} CKB` symbol = 'CKB' + if (item.nervosDao && item.daoCapacity === undefined) { + amount = undefined + copyText = undefined + } } } const props = { sudtAmount, show, item, isReceive, amount, symbolClassName, symbol } - return show ? ( + return show && copyText ? ( diff --git a/packages/neuron-ui/src/components/History/index.tsx b/packages/neuron-ui/src/components/History/index.tsx index 6e1f19c2d3..f012415c87 100644 --- a/packages/neuron-ui/src/components/History/index.tsx +++ b/packages/neuron-ui/src/components/History/index.tsx @@ -126,7 +126,7 @@ const History = () => { sortable: true, }, { - title: t('history.table.amount'), + title: t('history.table.asset'), dataIndex: 'amount', align: 'left', isBalance: true, diff --git a/packages/neuron-ui/src/components/ImportHardware/detect-device.tsx b/packages/neuron-ui/src/components/ImportHardware/detect-device.tsx index 008b1ba8cf..c48ddda7f3 100644 --- a/packages/neuron-ui/src/components/ImportHardware/detect-device.tsx +++ b/packages/neuron-ui/src/components/ImportHardware/detect-device.tsx @@ -1,7 +1,7 @@ import React, { useCallback, useState } from 'react' import { useTranslation } from 'react-i18next' import Button from 'widgets/Button' -import { getDevices, getDeviceFirmwareVersion, getDeviceCkbAppVersion, connectDevice } from 'services/remote' +import { getDevices, getDeviceCkbAppVersion, connectDevice } from 'services/remote' import { isSuccessResponse, errorFormatter, useDidMount } from 'utils' import { ReactComponent as SuccessInfo } from 'widgets/Icons/SuccessInfo.svg' import { Error as ErrorIcon } from 'widgets/Icons/icon' @@ -50,7 +50,6 @@ const DetectDevice = ({ dispatch, model }: { dispatch: React.Dispatch { setError('') @@ -76,10 +75,6 @@ const DetectDevice = ({ dispatch, model }: { dispatch: React.Dispatch{productName} {errorMsg ? : null} {scanning ? : null} - {firmwareVersion && !errorMsg && !scanning ? ( - - ) : null} {appVersion ? : null}