Skip to content

micbakos-rdx/RadixWalletKit

 
 

Repository files navigation

Wallet Kit

codecov

Middleware that can power Radix Wallet clients (iOS/Android).

Status

LOGIC

[======--------------------------------------------]

Hierarchal Deterministic

  • BIP39
  • Derivation
    • Hierarchal Deterministic secp256k1
    • Hierarchal Deterministic Ed25519
  • Signing
    • Hierarchal Deterministic ECDSA (secp256k1)
    • Hierarchal Deterministic EdDSA (Ed25519)
  • CAP26
    • CAP26 AccountPath
    • CAP26 IdentityPath
    • CAP26 GetID

Profile Management

  • Create new Profile
  • Load active Profile
  • Import Profile

Account Management

  • Create new account
  • Update account

FactorSource Management

  • Create DeviceFactorSource
  • Save DeviceFactorSource
  • Create LedgerFactorSource
  • Save LedgerFactorSource (trivially done)

Dapp Interaction

  • Map AuthorizedPersonaSimple -> AuthorizedPersonaDetailed
  • Update AuthorizedPersonaSimple based on a Dapp request

MODELS

All models used by iOS/Android wallet is fully implemented in Sargon 🎉

All models have JSON support and Placeholder with which "recursively" I've crafted two valid example Profiles.

All models have Swift/Kotlin bindings using UniFFI generating immutable values types that are Equatable and Hashable!

Hierarchal Deterministic

  • Mnemonic
  • MnemonicWithPassphrase
  • HDPath (BIP32)
  • BIP44 Like
  • CAP26
    • CAP26 AccountPath
    • CAP26 IdentityPath
    • CAP26 GetID
  • DerivationPath
  • HierarchicalDeterministicPrivateKey
  • HierarchicalDeterministicPublicKey

Profile Snapshot

  • Header
    • ContentHint
    • DeviceInfo
  • Keys
    • PrivateKey
      • PrivateKey (enum)
      • Ed25519PrivateKey
      • Secp256k1PrivateKey
    • PublicKey
      • PublicKey (enum)
      • Ed25519PublicKey
      • Secp256k1PublicKey
  • FactorInstance
    • HierarchicalDeterministicFactorInstance
  • Addresses
    • AccountAddress
    • IdentityAddress
    • ResourceAddress
  • FactorSource
    • FactorSource
    • HierarchicalDeterministicFactorSource
    • PrivateHierarchicalDeterministicFactorSource
    • FactorSourceKind
    • FactorSourceID
    • DeviceFactorSource
    • LedgerFactorSource
  • FactorSources
  • Entity
    • EntityKind
    • SecurityState
      • UnsecuredEntityControl
    • EntityFlags
    • OnLedgerSettings
      • ThirdPartyDeposits
  • Account
    • AppearanceID
    • DisplayName
  • Networks
  • AppPreferences
    • Display
    • P2PLinks
      • P2PLink
    • Security
    • Transaction
    • Gateways
      • Gateway
      • RadixNetwork
  • Persona
    • Persona
    • PersonaData
      • Name
      • Email
      • Phone
      • Credit Card (not used by Radix Wallet yet)
      • URL (not used by Radix Wallet yet)
      • Company name (not used by Radix Wallet yet)
      • Postal Address (not used by Radix Wallet yet)
  • Authorized Dapp
    • Shared Accounts
    • Shared PersonaData
  • Network
    • NetworkID
    • Accounts
    • Personas
    • Authorized Dapps
  • Profile

Development

Setup

Swift

xcode-select — install

Or install Xcode from App Store

Kotlin

brew install kotlin

JNA

Important

To run tests in Kotlin you also need to download JNA (currently tested under version 5.13.0)

curl https://repo1.maven.org/maven2/net/java/dev/jna/jna/5.13.0/jna-5.13.0.jar

direnv

Install direnv in order to automatically load CLASSPATH and JAVA_OPTS in .envrc, so that you can run Kotlin bindgen tests from cli using the command in the bottom of this document - i.e. without having to export `CLASSPATH``.

pre-commit

Recommended to use pre-commit tool

brew install pre-commit

This repo contains a .pre-commit-config.yaml which uses the amazing typos tool, you MUST INSTALL the config, do it by:

pre-commit install

nextest

Nextest is a nice test runner for Rust!

cargo install cargo-nextest

Code coverage

Recommended to use tarpaulin tool for code coverage:

cargo install cargo-tarpaulin

And then run:

cargo tarpaulin --out Html

Run Tests

cargo nextest run --package profile --test uniffi && cargo nextest run

About

Adapt Sargon for Kotlin clients

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 95.9%
  • Swift 2.5%
  • Kotlin 1.6%