Skip to content

💸 The web3 wallet that makes crypto self-custody ⚡ easy and 🛡️ secure via hybrid account abstraction. EIP-7702 ready.

License

Notifications You must be signed in to change notification settings

defi-wonderland/ambire-extension

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚠️ Experimental Wallet Warning ⚠️

This wallet is highly experimental and under active development. DO NOT USE IT FOR PRODUCTION PURPOSES OR TO STORE REAL FUNDS. Use only test funds for evaluation and feedback. The developers assume NO responsibility for any loss of funds.

The current SDK uses Across on testnet for demo purposes only. Performance may not reflect mainnet behavior and is not representative of the final production experience.


Hokaku Wallet

Environment Setup

Built in a hybrid approach (with React Native and React Native Web) so that in a single codebase we can support building cross-browser extensions, mobile apps and web apps.

This project is built with Expo's bare workflow, allowing us to extend the default Vanilla React Native with additional expo modules in the form of installable expo libraries.

More about the environment setup and prerequisites here.

Install

Install all dependencies:

yarn install

Install the common submodule, a common ground for the Ambire apps, run:

git submodule init
git submodule update

Environment Variables

Create ".env" file in the root directory and fill in all variables, see ".env-sample" for a reference.

Editor Config

Make sure your code editor has plugins that support the following configuration files: .editorconfig, .prettierrc, tsconfig.json, eslintrc.js, import-sorter.json.

Browser Extensions

Development-optimized Builds

  • Start the browser extension for webkit browsers (tested mostly on Chrome and Brave):

    yarn web:webkit

    Then follow the instructions to load an unpacked extension here.

  • Start the browser extension for gecko browsers (tested mostly on Firefox):

    yarn web:gecko

    Then follow the instructions to temporarily install an extension in Firefox here.

  • Start the browser extension for the Safari browser:

    yarn web:safari

    Two new folders will be created:

    • build/safari-dev (dev build folder)
    • safari-extension/wallet-dev (Xcode project)

    then in the Safari browser:

    • Developer -> Developer settings...
    • Check the “Allow unsigned extensions” option. (Note: This setting may not persist after Safari is restarted.)​
    • Then the extension should be automatically added and pinned in the browser.

    NOTE: You can manage the available extensions from: Safari -> Settings... -> Extensions

    NOTE: The development script for Safari relies on the fswatch tool to automatically reload the Safari build when the development server is reloaded. If fswatch is not already installed on your system, you can install it using Homebrew with the following command:

    brew install fswatch

Production-optimized Builds

  • For webkit browsers:

    yarn build:web:webkit

    And find the resulting build in the "build/webkit-prod" folder.

  • For gecko browsers:

    yarn build:web:gecko

    And find the resulting build in the "build/gecko-prod" folder.

  • For the Safari browser:

    yarn build:web:safari

    Two new folders will be created:

    • "build/safari-prod" (production build folder)
    • "safari-extension/wallet" (the Xcode project)

    Then, in xCode manually do (TODO: automate these steps, it turned out to be a huge challenge):

    • Delete "walletTests" and "walletUITests" targets.
    • For both targets (macOS and extension): Signing & Capabilities: Team: "Ambire Tech Ltd", Signing Certificate: Development
    • For both targets (macOS and extension): General - Identity - Version: X.X (should match the version in the app.json file, example: 4.36) and Build: X (integer, bump up on every next build submitted to the App Store Connect, example: 3)
    • For the macOS target: General - App Category: "Utilities"
    • For the extension target: General - Identity - Bundle Identifier: com.ambire.app.wallet.extension

Extract Source Maps

The production-optimized builds come with source maps files included. When preparing a production build for a browser store release, run the following commands to extract the source maps in separate directories:

  • For the webkit build:

    yarn export:web:webkit:sourcemaps

    As a result, build/webkit-prod will no longer include the source map files (as before). Instead, a new folder, build/webkit-prod-source-maps, will be created to hold only the source maps. This folder should also be included in the GitHub release tag we create.

  • For the gecko build:

    yarn export:web:gecko:sourcemaps

    Same as for the webkit build, but for the gecko build.

  • For the Safari build: not implemented yet.

For more details, including how to trace /deminify a production reported error, see #3191.

Store-prepared Builds

Automates the steps before every extension extension store release that could be otherwise done manually:

  • Makes webkit and gecko extension production builds
  • Exports source maps to "clean" the builds (and to prepare for upload those source maps in the GitHub release)
  • Zips the "clean" builds (stores accept zips only) and the source maps
yarn build:extensions

And find the resulting zips in the "build" folder as ambire-extension-<VERSION>-<TYPE>.zip

About

💸 The web3 wallet that makes crypto self-custody ⚡ easy and 🛡️ secure via hybrid account abstraction. EIP-7702 ready.

Resources

License

Stars

Watchers

Forks

Languages

  • TypeScript 88.9%
  • JavaScript 6.7%
  • SCSS 2.9%
  • Java 0.5%
  • HTML 0.2%
  • Shell 0.2%
  • Other 0.6%