Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
# 0.119.0 (2024-12-02)

### CKB Node & Light Client

- [CKB@v0.119.0](https://github.com/nervosnetwork/ckb/releases/tag/v0.119.0) was released on Oct. 25th, 2024. This version of CKB node is now bundled and preconfigured in Neuron.
- [CKB Light Client@v0.4.1](https://github.com/nervosnetwork/ckb-light-client/releases/tag/v0.4.1) was released on Nov. 13th, 2024. This version of CKB Light Client is now bundled and preconfigured in Neuron

### Assumed valid target

Block before `0x7488acf2280ebf5b83c805a517f766eab77f45cd51f61476811d1ce96a60ea71`(at height `14,687,217`) will be skipped in validation.(https://github.com/nervosnetwork/neuron/pull/3268)

---

## Bug fixes

- #3239: Fix abnormal display of remaining time of Nervos DAO.(@devchenyan)
- #3246: Use the median fee rate instead of the average as a more appropriate reference for fee rate.(@yanguoyu)


**Full Changelog**: https://github.com/nervosnetwork/neuron/compare/v0.117.0...v0.119.0


# 0.117.0 (2024-08-12)

### CKB Node & Light Client
Expand Down
20 changes: 20 additions & 0 deletions compatible.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,26 @@
"0.3",
"0.2"
]
},
"0.119": {
"full": [
"0.119",
"0.118",
"0.117",
"0.116",
"0.115",
"0.114",
"0.113",
"0.112",
"0.111",
"0.110",
"0.109"
],
"light": [
"0.4",
"0.3",
"0.2"
]
}
}
}
6 changes: 4 additions & 2 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"packages": ["packages/*"],
"version": "0.117.0",
"packages": [
"packages/*"
],
"version": "0.119.0",
"npmClient": "yarn",
"$schema": "node_modules/lerna/schemas/lerna-schema.json"
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "neuron",
"productName": "Neuron",
"description": "CKB Neuron Wallet",
"version": "0.117.0",
"version": "0.119.0",
"private": true,
"author": {
"name": "Nervos Core Dev",
Expand Down
12 changes: 6 additions & 6 deletions packages/neuron-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "neuron-ui",
"version": "0.117.0",
"version": "0.119.0",
"private": true,
"author": {
"name": "Nervos Core Dev",
Expand Down Expand Up @@ -47,15 +47,15 @@
"displayName": "UI Tests"
},
"dependencies": {
"@ckb-lumos/lumos": "0.23.0",
"@ckb-lumos/bi": "0.23.0",
"@ckb-lumos/rpc": "0.23.0",
"@ckb-lumos/base": "0.23.0",
"@ckb-lumos/bi": "0.23.0",
"@ckb-lumos/codec": "0.23.0",
"@ckb-lumos/common-scripts": "0.23.0",
"@ckb-lumos/config-manager": "0.23.0",
"@ckb-lumos/hd": "0.23.0",
"@ckb-lumos/helpers": "0.23.0",
"@ckb-lumos/config-manager": "0.23.0",
"@ckb-lumos/common-scripts": "0.23.0",
"@ckb-lumos/lumos": "0.23.0",
"@ckb-lumos/rpc": "0.23.0",
"canvg": "2.0.0",
"i18next": "23.7.11",
"immer": "9.0.21",
Expand Down
5 changes: 3 additions & 2 deletions packages/neuron-ui/src/components/Receive/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,9 @@ export const AddressQrCodeWithCopyZone = ({
const Receive = ({ onClose, address }: { onClose?: () => void; address?: string }) => {
const [t] = useTranslation()
const { wallet } = useGlobalState()
const { addresses } = wallet
const { addresses, isHD } = wallet
const isSingleAddress = addresses.length === 1
const isHardwareWallet = !isHD && isSingleAddress

const accountAddress = useMemo(() => {
if (isSingleAddress) {
Expand Down Expand Up @@ -128,7 +129,7 @@ const Receive = ({ onClose, address }: { onClose?: () => void; address?: string
onClick={() => setIsInShortFormat(is => !is)}
/>

{isSingleAddress && <VerifyHardwareAddress address={accountAddress} wallet={wallet} onClose={onClose} />}
{isHardwareWallet && <VerifyHardwareAddress address={accountAddress} wallet={wallet} onClose={onClose} />}
</div>
</Dialog>
)
Expand Down
9 changes: 6 additions & 3 deletions packages/neuron-ui/src/components/WalletWizard/hooks.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { useState, useCallback } from 'react'
import { useState, useCallback, useEffect } from 'react'

const MNEMONIC_SENTENCE_WORDS = 12

export const useInputWords = () => {
const [inputsWords, setInputsWords] = useState<string[]>(new Array(MNEMONIC_SENTENCE_WORDS).fill(''))
export const useInputWords = (wordsCount: number = MNEMONIC_SENTENCE_WORDS) => {
const [inputsWords, setInputsWords] = useState<string[]>(new Array(wordsCount).fill(''))
const onChangeInput = useCallback(
(
e:
Expand Down Expand Up @@ -37,6 +37,9 @@ export const useInputWords = () => {
},
[setInputsWords]
)
useEffect(() => {
setInputsWords(new Array(wordsCount).fill(''))
}, [wordsCount])
return {
inputsWords,
onChangeInput,
Expand Down
18 changes: 16 additions & 2 deletions packages/neuron-ui/src/components/WalletWizard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ const initState: WithWizardState = {
password: '',
confirmPassword: '',
name: '',
isHardware: false,
}

const submissionInputs = [
Expand Down Expand Up @@ -182,6 +183,8 @@ const Welcome = ({ rootPath = '/wizard/', wallets = [], dispatch }: WizardElemen

Welcome.displayName = 'Welcome'

const LEDGER_WORDS_COUNT = 24

const Mnemonic = ({ state = initState, rootPath = '/wizard/', dispatch }: WizardElementProps) => {
const { generated, imported } = state
const navigate = useNavigate()
Expand All @@ -193,8 +196,9 @@ const Mnemonic = ({ state = initState, rootPath = '/wizard/', dispatch }: Wizard
[MnemonicAction.Verify]: 'wizard.replenish-your-seed',
[MnemonicAction.Import]: 'wizard.input-your-seed',
}[type]
const { inputsWords, onChangeInput, setInputsWords } = useInputWords()
const [searchParams] = useSearchParams()
const isHardware = searchParams.get('isHardware') === 'true'
const { inputsWords, onChangeInput, setInputsWords } = useInputWords(isHardware ? LEDGER_WORDS_COUNT : undefined)
const disableNext =
(type === MnemonicAction.Import && inputsWords.some(v => !v)) ||
(type === MnemonicAction.Verify && generated !== inputsWords.join(' '))
Expand Down Expand Up @@ -228,6 +232,14 @@ const Mnemonic = ({ state = initState, rootPath = '/wizard/', dispatch }: Wizard
})
}
}, [dispatch, type, navigate, setBlankIndexes])
useEffect(() => {
if (isHardware) {
dispatch({
type: 'isHardware',
payload: true,
})
}
}, [dispatch, isHardware])

const globalDispatch = useDispatch()

Expand Down Expand Up @@ -317,6 +329,7 @@ const Mnemonic = ({ state = initState, rootPath = '/wizard/', dispatch }: Wizard
inputsWords={inputsWords}
onChangeInputWord={onChangeInput}
blankIndexes={MnemonicAction.Import ? undefined : blankIndexes}
wordsCount={isHardware ? LEDGER_WORDS_COUNT : undefined}
/>
{type === MnemonicAction.Import && <div className={styles.tips}>{t('wizard.input-seed-first-empty-space')}</div>}
<div className={styles.actions}>
Expand All @@ -337,7 +350,7 @@ export const getAlertStatus = (fieldInit: boolean, success: boolean) => {
}

const Submission = ({ state = initState, wallets = [], dispatch }: WizardElementProps) => {
const { name, password, confirmPassword, imported } = state
const { name, password, confirmPassword, imported, isHardware } = state
const navigate = useNavigate()
const { type = MnemonicAction.Create } = useParams<{ type: MnemonicAction }>()
const [t] = useTranslation()
Expand Down Expand Up @@ -396,6 +409,7 @@ const Submission = ({ state = initState, wallets = [], dispatch }: WizardElement
name,
password,
mnemonic: imported,
isHardware,
}
openDialog()
setTimeout(() => {
Expand Down
12 changes: 9 additions & 3 deletions packages/neuron-ui/src/components/withWizard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,14 @@ export interface Element {
comp: React.FC<any>
}

export interface WithWizardState {
[key: string]: string
export type WithWizardState = {
generated: string
imported: string
password: string
confirmPassword: string
name: string
isHardware: boolean
[propName: string]: any
}

export interface WizardProps {
Expand All @@ -27,7 +33,7 @@ export interface WizardElementProps {
}

const reducer = (
state: { [key: string]: string },
state: WithWizardState,
{
type,
payload,
Expand Down
1 change: 1 addition & 0 deletions packages/neuron-ui/src/types/Controller/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ declare namespace Controller {
name: string
mnemonic: string
password: string
isHardware?: boolean
}

interface ImportKeystoreParams {
Expand Down
8 changes: 6 additions & 2 deletions packages/neuron-ui/src/widgets/MnemonicInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const MnemonicInput = ({
inputsWords,
onChangeInputWord,
blankIndexes,
wordsCount,
}: {
disabled?: boolean
words: string
Expand All @@ -23,10 +24,13 @@ const MnemonicInput = ({
}
}
) => void

wordsCount?: number
blankIndexes?: number[]
}) => {
const wordList = useMemo(() => Object.assign(new Array(12).fill(''), words?.split(' ')), [words])
const wordList = useMemo(
() => Object.assign(new Array(wordsCount ?? 12).fill(''), words?.split(' ')),
[words, wordsCount]
)
const [focusIndex, setFocusIndex] = useState(-1)
const mounted = useRef(true)
const root = useRef<HTMLDivElement>(null)
Expand Down
6 changes: 3 additions & 3 deletions packages/neuron-wallet/.env
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,6 @@ DAO_CODE_HASH=0x82d76d1b75fe2fd9a27dfbaa65a039221a380d76c926f378d3f81cf3e7e13f2e
MULTISIG_CODE_HASH=0x5c5069eb0857efc65e1bca0c07df34c31663b3622fd3876c876320fc9634e2a8

# CKB NODE OPTIONS
CKB_NODE_ASSUME_VALID_TARGET='0xca44ae8f7bc12ba8eab3224cbe3156c913e2284693e36dc1d01e4d30f362f3c2'
CKB_NODE_ASSUME_VALID_TARGET_BLOCK_NUMBER=13705152
CKB_NODE_DATA_SIZE=58
CKB_NODE_ASSUME_VALID_TARGET='0x7488acf2280ebf5b83c805a517f766eab77f45cd51f61476811d1ce96a60ea71'
CKB_NODE_ASSUME_VALID_TARGET_BLOCK_NUMBER=14687217
CKB_NODE_DATA_SIZE=116
6 changes: 3 additions & 3 deletions packages/neuron-wallet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"productName": "Neuron",
"description": "CKB Neuron Wallet",
"homepage": "https://www.nervos.org/",
"version": "0.117.0",
"version": "0.119.0",
"private": true,
"author": {
"name": "Nervos Core Dev",
Expand Down Expand Up @@ -45,8 +45,8 @@
"@ckb-lumos/base": "0.23.0",
"@ckb-lumos/ckb-indexer": "0.23.0",
"@ckb-lumos/helpers": "0.23.0",
"@ckb-lumos/rpc": "0.23.0",
"@ckb-lumos/lumos": "0.23.0",
"@ckb-lumos/rpc": "0.23.0",
"@iarna/toml": "2.2.5",
"@ledgerhq/hw-transport-node-hid": "6.27.22",
"@spore-sdk/core": "0.1.0",
Expand Down Expand Up @@ -92,7 +92,7 @@
"electron-builder": "24.9.1",
"electron-devtools-installer": "3.2.0",
"jest-when": "3.6.0",
"neuron-ui": "0.117.0",
"neuron-ui": "0.119.0",
"typescript": "5.3.3"
}
}
9 changes: 6 additions & 3 deletions packages/neuron-wallet/src/controllers/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,9 +368,12 @@ export default class ApiController {
return this.#walletsController.activate(id)
})

handle('import-mnemonic', async (_, params: { name: string; password: string; mnemonic: string }) => {
return this.#walletsController.importMnemonic(params)
})
handle(
'import-mnemonic',
async (_, params: { name: string; password: string; mnemonic: string; isHardware?: boolean }) => {
return this.#walletsController.importMnemonic(params)
}
)

handle('import-keystore', async (_, params: { name: string; password: string; keystorePath: string }) => {
return this.#walletsController.importKeystore(params)
Expand Down
7 changes: 7 additions & 0 deletions packages/neuron-wallet/src/controllers/app/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,13 @@ const updateApplicationMenu = (mainWindow: BrowserWindow | null) => {
importHardware(URL.ImportHardware)
},
},
{
id: 'import-hardware-seed',
label: t('application-menu.wallet.import-hardware-mnemonic'),
click: () => {
importHardware(`${URL.ImportMnemonic}?isHardware=true`)
},
},
],
},
separator,
Expand Down
7 changes: 6 additions & 1 deletion packages/neuron-wallet/src/controllers/wallets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,14 @@ export default class WalletsController {
name,
password,
mnemonic,
isHardware,
}: {
name: string
password: string
mnemonic: string
isHardware?: boolean
}): Promise<Controller.Response<Omit<WalletProperties, 'extendedKey'>>> {
return await this.createByMnemonic({ name, password, mnemonic, isImporting: true })
return await this.createByMnemonic({ name, password, mnemonic, isImporting: true, isHardware })
}

public async create({
Expand All @@ -95,11 +97,13 @@ export default class WalletsController {
password,
mnemonic,
isImporting,
isHardware,
}: {
name: string
password: string
mnemonic: string
isImporting: boolean
isHardware?: boolean
}): Promise<Controller.Response<Omit<WalletProperties, 'extendedKey'>>> {
if (!validateMnemonic(mnemonic)) {
throw new InvalidMnemonic()
Expand Down Expand Up @@ -139,6 +143,7 @@ export default class WalletsController {
extendedKey: accountExtendedPublicKey.serialize(),
keystore,
startBlockNumber: startBlockNumber,
hardwareFromSeed: isHardware,
})

wallet.checkAndGenerateAddresses(isImporting)
Expand Down
1 change: 1 addition & 0 deletions packages/neuron-wallet/src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export default {
'import-keystore': 'Import from Keystore',
'import-xpubkey': 'Import Extended Public Key',
'import-hardware': 'Import Hardware Wallet',
'import-hardware-mnemonic': 'Import Hardware Wallet Seed',
},
edit: {
label: 'Edit',
Expand Down
1 change: 1 addition & 0 deletions packages/neuron-wallet/src/locales/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export default {
'import-keystore': 'Importar desde Keystore',
'import-xpubkey': 'Importar Clave Pública Extendida',
'import-hardware': 'Importar Billetera de Hardware',
'import-hardware-mnemonic': 'Importar semilla de billetera de hardware',
},
edit: {
label: 'Editar',
Expand Down
Loading
Loading