Giter Club home page Giter Club logo

definexus's Introduction

DeFiNexus

DeFiNexus is next generation wallet for DeFi

Contribution

Install dependency

  1. Install Node.js version 14.5 or later
  2. Install Yarn npm install -g yarn
  3. Run yarn to install dependency

Development

Run yarn build:dev to develop with file watching and development log(you can see request sent by dapp in website console in this mode and notification will not close when focus lost)

Run yarn build:pro to build a production package, it's in dist folder

Language

  1. Copy _raw/_locales/en/messages.json to _raw/_locales/${localCode}/messages.json (Find your locale code in https://en.wikipedia.org/wiki/Language_localisation#Language_tags_and_codes)
  2. Replace content in message property to your locale language

Architecture

architecture

Extension's scripts

below 4 scripts all live in different context!

- background.js

for all async request and encrypt things.

user's keyrings, password and wallet personal preference data all stored in chrome local storage.

it has 2 main controllers:

  1. walletController

    it expose methods to background window, so other scripts can access these methods with runtime.getBackgroundPage, e.g. ui.js.

  2. providerController

    it handles request from pages(dapp request).

- content-script

the main purpose is inject pageProvider.js and pass messages between pageProvider.js and background.js.

- pageProvider.js

this script is injected into dapp's context through content-script. it mounts ethereum to window.

when dapp use window.ethereum to request, it will send message to content-script with broadcastChannel and wait for it's response.

then the content-script will send message to background with runtime.connect.

after background receive the message, it will use providerController to handle the request. and keep the message channel in sessionSevice for later communicate.

- ui

it's used by 3 pages which share the same js code, but the template html is different for respective purpose.

  1. notification.html

    triggered by dapp to request user's permission.

  2. index.html

    opened in browser tab for better user interaction experience.

  3. popup.html

    user click the extension icon on the right of address bar, the popup will show.

Thanks

  1. Install Node.js version 14.5 or later
  2. Install Yarn npm install -g yarn
  3. Run yarn to install dependency

definexus's People

Contributors

cryptowhizard avatar

Watchers

 avatar

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.