Code Monkey home page Code Monkey logo

svalinn-kotlin's Introduction

Svalinn Android

Jitpack Build Status codecov

🛡️❄️️ Kotlin libraries for Ethereum based Android development

WARNING: Under development. Libraries right now target the Rinkeby test network. Switching to mainnet (or any other ethereum network) can be done by the user but it's its responsibility in doing so.

Goal

This is a collection of libraries that should make development of apps that interact with Ethereum easier. Some functionality should be moved to Kethereum

Download

Follow instructions on https://jitpack.io/#gnosis/svalinn-kotlin

In your Gradle file:

Accounts Module

Main repository to create an account and load active accounts and to sign data with those accounts.

Two main implementations are available:

accounts-kethereum - which uses some of the utilities of the Kethereum project to manage accounts.

implementation 'com.github.gnosis:svalinn-kotlin:accounts-kethereum:<version>'

accounts-geth - which uses go-ethereum to manage/create/sign transactions.

implementation 'com.github.gnosis:svalinn-kotlin:accounts-geth:<version>'

Android Common Module

This module has Android specific utilities that we use in our mobile applications. We are in the process of refactoring and abstracting this module even more.

implementation 'com.github.gnosis:svalinn-kotlin:android-common:<version>'

Blockies Module

Provides the Ethereum Blockies implementation. Also contains an Android ImageView so it can be used easily in Android applications.

implementation 'com.github.gnosis:svalinn-kotlin:blockies:<version>'

Crypto Module

Crypto specific module for key generation, signing and hashing.

implementation 'com.github.gnosis:svalinn-kotlin:crypto:<version>'

Ethereum Modules

Modules for easy interaction with the Ethereum blockchain

More info

implementation 'com.github.gnosis:svalinn-kotlin:ethereum:<version>'
implementation 'com.github.gnosis:svalinn-kotlin:ethereum-rpc:<version>'
implementation 'com.github.gnosis:svalinn-kotlin:ethereum-rpc-retrofit:<version>'

Mnemonic Module

Implementation of BIP39 for mnemonic phrase generation. Words need to be provided by the user in the core module by implementing the WordListProvider interface.

implementation 'com.github.gnosis:svalinn-kotlin:mnemonic:<version>'

If you wish to use BIP39 on Android you only need to include the mnemonic-android module which already provides the English and Chinese word lists via Resources.raw.

implementation 'com.github.gnosis:svalinn-kotlin:mnemonic-android:<version>'

Models Module

Our internal model for representing entities in Ethereum and Android.

implementation 'com.github.gnosis:svalinn-kotlin:models:<version>'

Security Module

Android utils to encrypt/decrypt data and manage app security features such as unlocked status.

implementation 'com.github.gnosis:svalinn-kotlin:security:<version>'

Ticker Module

Our fiat conversion module.

implementation 'com.github.gnosis:svalinn-kotlin:ticker:<version>'

Utils Module

General utilities that we use across our apps.

implementation 'com.github.gnosis:svalinn-kotlin:utils:<version>'

Utils Testing Module

General utilities for testing our apps.

implementation 'com.github.gnosis:svalinn-kotlin:utils-testing:<version>'

svalinn-kotlin's People

Contributors

biafra23 avatar elgatovital avatar fmrsabino avatar jpalvarezl avatar rmeissner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

svalinn-kotlin's Issues

BigDecimal moshi adapter

We have now for balances a moshi type adapter that would better be pushed down to svalinn.

The class in question is in io.gnosis.data.db.TypeConverters.kt>class BigDecimalNumberAdapter

Consider moving to MIT license

As just discussed with @rmeissner:

I think it would be great if this lib could move to MIT license. IANAL but for me it seems that it is currently it is not easy to move code from this library to Kethereum - even though this is even a mission statement in the README. It would be great if both libraries could use the same license - and now it is still easy as there are just 2 contributors that even sit in the same office. It get's more complex the more contributors there are. Also a reason why it is more complicated in KEthereum as there are 7 contributors that would need to agree on a change.

Remove app specific libs

  • Move android specific stuff to app
    e. g.: Libs that handles formatting and string representation that is bound to the app
  • Add lib content to app ui module (utils package / class)
  • Identify logic that can be moved to Kethereum

Migrate to GitHub actions

Currently the build process relies on Travis. As Gnosis has moved to GitHub action this project should also be migrated.

Notes:

  • Remove GITHUB_API_KEY usage as it will be deleted beginning of July
  • Same has to be done for Bivrost: 5afe/bivrost-kotlin#63

Migrate android libs to java libs where possible

Expected behavior

Releases should supply jar files where possible. Also, wherever Rx is used it should be optional and there should be a coroutine based alternative.

Actual behavior

Currently, every release supplies aar files. Libraries that are not required as "Android libraries" should be exposed as "Java libraries" (thusly generating jar files instead) so we can consume them in a wider variety of projects.

Steps to reproduce the behavior

Add any implementation call in gradle to any artifact from a pure kotlin project. The dependency fetched is an aar file which is not usable by a project that is not android related.

Progress:

  • utils-testing split into:

    • utils-testing-rx
    • utils-testing (if it makes sense to write the coroutine counterpart)
    • utils-testing-android
  • utils split into:

    • utils-rx
    • utils (if it makes sense to write the coroutine counterpart)
    • utils-android

How to test it

How to test it, this is my error log:
Class not found: "pm.gnosis.crypto.HDNodeTest" Empty test suite.

Cannot recover using signature with chain_id

Using a signature containing a chain_id in the v cannot be used for recovery.

When we see that the v of the signature is > 35 we should adjust it, for this it is necessary that we know the chain id.

This is only used when recovering a sender from a transaction hash with the signatures (not sure if we ever do that)

Support EIP712 v4

Hello,

thanks for your work. It is works well but doesn't support arrays in EIP712. Could you please add it or provide some info how to add it correctly?

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.