Code Monkey home page Code Monkey logo

my-wit-wallet's Introduction

myWitWallet

Build Status GPLv3 Licensed GitHub contributors Github last commit

myWitWallet is a non-custodial Witnet compatible wallet that allows you to send and receive Wit immediately.

Installation

From Github Releases

Go to the releases section and download the binary suitable for your system.

myWitWallet Development

This application is built using the Flutter framework.

Dependencies

You need to install Flutter to run the app in development mode. Depending on your operating system, you will be requested to comply with some requirements.

Running myWitWallet

# clone the repository
git clone [email protected]:witnet/my-wit-wallet.git

# cd into the cloned repository
cd my-wit-wallet

# install application dependencies
flutter pub get

# launch development application
flutter run

Formatter

Repair lint errors with (this operation modifies your files!) dart format .

Test

We use Flutter for testing.

# run unit tests
flutter test

Build

Production

flutter pub get
System Build commands Destination path
iOS flutter build ios --release --no-codesign ./build/ios/ipa/myWitWallet.ipa
android flutter build apk ./build/app/outputs/flutter-apk/myWitWallet.apk
macOS flutter build macos --release ./build/macos/Build/Products/Release/myWitWallet.app
windows flutter build windows .\build\windows\runner\Release
linux bash sudo apt-get update -y && sudo apt-get install -y ninja-build libgtk-3-dev flutter build linux --release ./build/linux/x64/release/bundle

Github Actions (continuous integration)

Release

Creating a tag in my-wit-wallet repo triggers a Github Actions workflow and generates a new release for linux, windows, macOS, android and iOs.

Troubleshooting

  • Use flutter doctor to check if you miss any dependencies to complete the Flutter configuration.
  • Use flutter clean to clean the generated build and the Flutter cache.
  • Use dart pub cache repair to reinstall all packages in the system cache.

License

GPL-3

my-wit-wallet's People

Contributors

aeweda avatar drcpu-github avatar gabaldon avatar parodybit avatar tommytrg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

my-wit-wallet's Issues

Make import / export xprv compatible with Sheikah

The light wallet and Sheikah use a different way to import and export a wallet from an xprv.

According to @parodyBit, we check against the hash and not the password itself, so:

  • if a wallet already exists, the password needs to be the same and with the same hash
  • if it is a new install and no wallet exists, the XPRV needs to have been exported from the light wallet
  • if it was exported from Sheikah, it will not work

Example of what's happening, also provided by @parodyBit:

import 'dart:typed_data';

import 'package:pointycastle/digests/sha256.dart';
import 'package:pointycastle/digests/sha512.dart';
import 'package:witnet/crypto.dart';
import 'package:witnet/src/crypto/hd_wallet/extended_private_key.dart';
import 'package:witnet/utils.dart';

void main() async {
  testEncryptedXprv();
}

void testEncryptedXprv() {
  String mnemonic =
      'abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about';
  String password = 'password';

  Xprv xprv = Xprv.fromMnemonic(mnemonic: mnemonic);

  /// Sheikah Compatible XPRV
  print(xprv.toEncryptedXprv(password: password));

  /// Light Wallet Compatible XPRV
  print(xprv.toEncryptedXprv(password: hash(password)));
}

/// we store the hash of the password in the local database.
String hash(String password,) {
  final pbkdf2 = new PBKDF2(
    blockLength: 128,
    iterationCount: 2048,
    desiredKeyLength: 64,
    digestAlgorithm: new SHA512Digest(),
  );
  String digest = bytesToHex(SHA256Digest()
      .process(pbkdf2.process(data: Uint8List(0), passphrase: password)));
  return digest;
}

To fix this incompatibility, we just need to:

  • To export, the user needs to enter the password because we are only storing the hash of the password
  • To import, we need to decrypt with the password provided in Sheikah when the user exported the wallet.

Update copies

Review current copies and update placeholders.

The copies that need to be updated can be found here: #45

Set correct font

Currently, there is a mismatch between the font specified in the design and the one we use in the code. Our reference should be what is in the Figma design.

Show sending tx info

  • Show sending transaction in transaction list. Currently the information is not shown until it is accepted.
  • Update mined transaction status to confirmed. Currently the status does not change.

Close wallet selector when clicking outside or swiping down

Right now, the only way to close the wallet selector is by clicking again in the Identicon. The expected behavior to close it's swiping down the selector and clicking outside it.

image

Tasks

  • Close the wallet selector clicking outside
  • Close the wallet selector swiping down

Fix mobile size responsive

  • Fix mobile margins
  • Fix main layout to fit mobile height (avoid scroll in welcome view)
  • Fix transaction info in transaction list to fit mobile width

Update branding

  • [ ] Discuss current logo
  • Discuss naming
  • [ ] Implement New logo
  • Replace logo in the UI

Add nightly builds in the repository

To be able to facilitate the testing of the the latest changes we have to add a GitHub action that triggers a daily build and generates:

  • APK for android
  • ? for iOS
  • Desktop

Give Internet permission to the app

When we build the Light Wallet for Android and execute the .apk, the import wallet is stuck while connecting the Block Explorer. The error that appears in the logs is: "Failed host lookup: 'witnet.network'".

image

The solution for this is to add the following line to the AndroidManifest.xml:

  <uses-permission android:name="android.permission.INTERNET" />

Regarding the iOS build, I don't know if we have the same problem. In case we experience the same problem the solution could be the one provided Flutter docs:

  <key>com.apple.security.network.client</key>
  <true/>

Can't retry unlocking once you enter a wrong password

Unexpected behavior

  1. Unlock your wallet using a wrong password
  2. The confirmation button will be disabled
  3. Enter a different password
  4. The confirmation button is still disabled, with no chance for retry

Expected behavior

The confirmation button should be re-enabled as soon as the password is edited.

Or maybe it should never be disabled at all. I think that's common practice. Let's double check what other apps do and follow that.

Add validation in send VTT fields

In the send VTT form, the amount and fee fields should have the following validation rules:

Amount

  • Required
  • Format. It should be a valid number. Right now, accepts .1 and 1. as valid
  • Length. Max number of decimals is 9
  • Length. Max whole-number is 10

Fee

  • Required
  • Format. It should be a valid number. Right now, accepts .1 and 1. as valid
  • Length. Max number of decimals is 9
  • Length. Max whole-number is 10

Error importing wallet from `xprv`

When I try to import a wallet using an xprv, the app stops working in this view:

image

And I get the following error:

E/flutter (19095): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: FormatException: Invalid number (at character 1)
E/flutter (19095): 
E/flutter (19095): ^
E/flutter (19095): 
E/flutter (19095): #0      int._handleFormatError (dart:core-patch/integers_patch.dart:124:7)
E/flutter (19095): #1      int.parse (dart:core-patch/integers_patch.dart:50:14)
E/flutter (19095): #2      ApiPreferences.setCurrentWallet (package:witnet_wallet/util/preferences.dart:26:21)
E/flutter (19095): <asynchronous suspension>
E/flutter (19095): #3      CryptoBloc._cryptoInitializeWalletEvent (package:witnet_wallet/bloc/crypto/crypto_bloc.dart:161:5)
E/flutter (19095): <asynchronous suspension>
E/flutter (19095): #4      Bloc.on.<anonymous closure>.handleEvent (package:bloc/src/bloc.dart:226:13)
E/flutter (19095): <asynchronous suspension>
E/flutter (19095): 

Release 0.0.1

We have to release 0.0.1 to distribute mainly between the team members and get feedback. After fixing these errors, we can release a new version for the community.

  • web
  • android
  • iOS

Keyboard is covering input texts

When we select an input to add some text, the keyboard slides up and coverts the input text:

image

image

The expected behavior is to scroll down to show the input while writing.

This problem occurs in:

  • Welcome view
  • Send view

Update "to several addresses" copy

Update "to several addresses" copy in transaction card info:

"The “To” thing is not very helpful right now, because it will show “several addresses” for every transaction that used a change address. Given the BIP-32 nature of all Witnet wallets, we can safely assume that the first output is the actual send, so we should use that address here.

(As a matter of fact, we are doing exactly the same to derive the true value of the transaction — we’re substracting the value of the outputs that point to our own internal addresses)"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.