Skip to content

nebulaai/nbai-wallet-v2

Repository files navigation

Wallet

A Vue.js project

Technology stack: vue2 + vuex + vue-router + webpack + sass + element-ui + web3

Installation dependency

Run npm install to generate component.

Development server

Run npm run dev for a dev server. Navigate to http://localhost:8080/. The app will automatically reload if you change any of the source files.

Build

Run npm run build to build the project. The build artifacts will be stored in the dist/ directory.

Node version

v12.14.1

Reference documents

  • vue:Vue is a progressive framework for building user interfaces.

  • vuex:Vuex is a state management pattern developed specifically for vue.js applications.

  • vue-router:Vue router is the official routing manager of vue.js.

  • webpack:Front end module packer.

  • element-ui:Element, a desktop component library based on Vue 2.0 for developers, designers and product managers.

  • web3.js:Web3.js is a set of JS libraries used to interact with local or remote Ethereum nodes.

Pre order preparation

Preparation before operation:

Since this project is based on nodejs, you need to make preparations for nodejs. Before running the project, please ensure that the following applications have been installed in the system:

(1)、Node (version 6.0 and above). Please refer to:Download and install node.

Further help

For a detailed explanation on how things work, check out the guide and docs for vue-loader.

how to fix the missing scss

npm i node-sass -save

billingual feature

In order to make the bilingual function run offline, we use the internationalization plug-in (vue-i18n) to replace the hard coded string of the whole website. Currently, we only support two languages, but in the future a new language can easily be added by adding another map in the translation service file and changing the isEn variable.

private key format

The address created by our wallet follows the ethereum web3 standard, thus our wallet is compatible with any ERC-20 wallets. The private key generated by the wallets created on our website will all be prefixed with "0x". This may not be the case with private key generated from an external wallet - for instance, the private key generated by a Metamask wallet omits the "0x" prefix. When using Import By Private Key feature, any private keys we enter that do not have "0x" as a prefix will be automatically recognized as an invalid format. This is because we use web3.js's privateKeyToAccount function which will produce two completely different result with input with and input without a prefix. If you want to import a wallet created on external website whose private key is not prefixed, just add "0x" so you can import successfully import it.

What's the deal with password?

The password the user enters when creating a new wallet is used both as (1) The password to encrypt the private key to a keystore file, and (2) the password to authorize certain features, notably the transfer fund feature, on our platform. When importing wallet by keystore file, the user enters password used to encrypt to that particular keystore file, and that password will then automatically functions as the password for our platform features. If the user chooses to import wallet by private key, he will need to import a new password in order to encrypt that private key to create a NEW keystore file, and that password will again automatically become the password for our platform features.

What's the deal with mnemonic?

Although we ask users to take down mnemonic when creating a wallet, we have not yet implemented an import by mnemonic feature in our wallet. This is due to the fact that the same mnemonic can correspond to multiple public address, while the same keystore file or the same private key can only correspond to one single public address. Therefore, it's hard to determine which wallet the user wants to import through mnemonic. The import by mnemonic feature may be added in future versions.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published