Giter VIP home page Giter VIP logo

rabby's Introduction

Rabby Wallet

Rabby Wallet is an open-source browser plugin for the DeFi ecosystem, providing users with a better-to-use and more secure multi-chain experience.

Install

You can download the latest Rabby here.

Guideline for Integrating Rabby Wallet

To help dapp developers support and integrate Rabby Wallet more easily, we recommend using our integration solution that has almost NO development cost and does not introduce any uncertainty:

Problem

When a dapp connects to an extension wallet, it usually works in this way:

  1. The extension wallet will integrate an "Ethereum" object into the dapp page while it's loading.
  2. The dapp will look for this "Ethereum" object to determine if an extension wallet is installed.
  3. If the "Ethereum" object is detected, all following interactions between the dapp and the extension wallet are realized by this "Ethereum" object.
  4. If the "Ethereum" object is not detected, the dapp will ask users to download a new extension wallet.

The problem is that many dapps will wrongly display this detected "Ethereum" object as "MetaMask" and display a "connect to MetaMask" button by default, which brings a lot of confusion to the users since any Web3 wallet can inject this "Ethereum" object.

Solution

We recommend solving the above problem with simple modifications as follows:

  1. On your connection page, display both connection buttons for "MetaMask" and "Rabby Wallet" when the "Ethereum" object is detected. These two buttons basically have the same function. Users can click either of them to interact with the "Ethereum" object and perform the connection operation. These two buttons are only used to display both brands' logos to help users understand their operation path.
  2. If the "Ethereum" object is not detected, then suggest that users download the extension wallet and provide download links for both "MetaMask" and "Rabby Wallet."

This solution does not involve any changes to your actual business logic and is just simple UI adjustments. It does not introduce any uncertainty and is rather low cost.

You can refer to debank.com for the final display effect.

Potential Issues

According to the above solution, if a user is using the "Rabby Wallet" and clicks the "connect to MetaMask" button, they will still interact with the "Rabby Wallet" and vice versa, which might be a bit weird.

However, this issue is a very rare scenario and very unlikely to happen because users are not likely to click and interact with an extension wallet they haven't installed. Even if it happens, it's not a real problem from the user's perspective.

Please don't hesitate to reach out if you have any doubts.

Contribution

Install Dependency

  1. Install Node.js version 14 or later.
  2. Install Yarn: npm install -g yarn
  3. Run yarn to install dependencies.

Development

Run yarn build:dev to develop with file watching and development logging (you can see requests sent by the dapp in the website console in this mode, and notifications will not close when focus is lost).

Run yarn build:pro to build a production package, which will be in the dist folder.

Architecture

architecture

Extension's Scripts

Below 4 scripts all live in different contexts!

background.js

Handles all async requests and encryption tasks.

User's keyrings, passwords, and wallet personal preference data are all stored in Chrome local storage.

It has 2 main controllers:

  1. walletController

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

  2. providerController

    Handles requests from pages (dapp requests).

content-script

Injected at document_start, shares the same DOM with the dapp, and uses broadcastChannel to tap pageProvider.

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

pageProvider.js

This script is injected into the dapp's context through content-script. It mounts ethereum to window.

When the dapp uses window.ethereum to request, it will send a message to content-script with broadcastChannel and wait for its response.

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

After background receives the message, it will use providerController to handle the request and keep the message channel in sessionService for later communication.

ui

Used by 3 pages which share the same JS code, but the HTML template is different for each respective purpose.

  1. notification.html

    Triggered by the dapp to request the user's permission.

  2. index.html

    Opened in a browser tab for a better user interaction experience.

  3. popup.html

    Shown when the user clicks the extension icon to the right of the address bar.

Thanks

Thanks to contributions from the MetaMask team to the browser extension wallet community, Rabby uses (or forks) them to make Rabby better.

Other Docs

rabby's People

Contributors

amalia20220301 avatar anonployed avatar battmdpkq avatar benma avatar boldkoala4615 avatar charon-fan avatar chengehe avatar cs1707 avatar dependabot[bot] avatar dmy147 avatar enjoyooor avatar everdimension avatar fhasghrge avatar galenyuan avatar he1m4n6a avatar heisenberg-2077 avatar hell0men avatar jo2077 avatar qingwei-li avatar rabbyonthemars avatar residenthiago2011 avatar richardo2016x avatar rpgmax avatar see2ever avatar thanhlmm avatar tnkshuuhei avatar tomasvrba avatar vvvvvv1vvvvvv avatar xardass avatar xuyong2022 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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  avatar  avatar  avatar  avatar  avatar  avatar

rabby's Issues

before build check script

build a before build check script to run checklist below:

  • check if i18n json file has duplicate case-insensitive key (for firefox)
  • check if i18n json file missed any key for all locales
  • run eslint

Add BitBox02 hardware wallet support

Hi

BitBox02 is a popular hardware wallet with existing integration into third party wallets such as MyEtherWallet.

Would Rabby be willing to accept a pull request to enable support for the BitBox02?

Rabby seems to be a fork of Metamask. See our pull request to Metamask for reference: MetaMask/metamask-extension#12097

The diff is quite minimal to add support in a similar way as Trezor. If you are open to it, we will open a pull request to add support and send you a device to test the integration.

Rabby override suggested gas settings

I'm getting a remove funds tx stuck on BSC ApeSwap pool that was assigned to use 1 gwei.

[as seen in a beefy issue somewhere earlier]

I sent a new tx with 5.2 gwei and cancelled the previous one you can see the time difference 38 minutes...

The new tx was instant when the previous was cancelled.
Also curious how Rabby processes pending tx MM could have one stuck holding up many waiting "pending" tx that should /could be ran parallel instead of serial so we can assign priority for
-dynamic or user per type set gas for some tx types.
(a user on ETH chain preferring low for overnight tx, (* TIP: limit orders do not pay gas on ETH)

Screen Shot 2021-12-08 at 02 08 45AM
Screen Shot 2021-12-08 at 02 22 11AM

Same on deposit tokens:
manually adjusting this takes too much of my time.[=money]
Screen Shot 2021-12-08 at 02 39 39AM
Screen Shot 2021-12-08 at 02 42 19AM

Data doesn't populate on GMX / Arbitrum

At https://gmx.io/earn on Arbitrum, when using Rabby + a Trezor, none of the data loads - fields show ($...). I have tried disconnecting / reconnecting GMX, switching networks to something else, then switching back to Arbitrum, and removing / reinstalling Rabby. Did not resolve the issue.

However, using Metamask instead immediately resolves the issue.

BitBox02: Change icon to official logo

I notice the icon used for the BitBox02 hardware wallet is the twitter logo. This is not actually the official logo, it's just used for social media :D

image

Here are different sizes of the official logo you can use:

bitbox02-160
bitbox02-48
bitbox02-24

Thanks

Add ability to name wallet addresses

When we choose from the Set Current Address list there might be many wallet which associated with different protocols.
As a user i want to rename / add name to them so i can differentiate by name and not the wallet address.

One example, i have 2 wallet address attached to the rabby wallet, 0xA and 0xB.
One is hot, the other is cold storage. I would like to name 0xA to hot and 0xB to cold.

Imagine having 5-10 wallets and choose between them by wallet address.

Cannot create wallet if seed has duplicate words

My seed generated by Rabby contained the word "physical" twice, one after the other.

When trying to verify the seed phrase, it doesn't work, since it will only append the word once to the top container and then not let you choose the same one from the list again:

duplicate.mov

From dissonance to synergy_ultimate dApp helper wallet interface? A workflow challenge, perhaps better off in stages before merging two different challenges: Portfolio user customization / Wallet has potential for innovation + improvements.

Example:

On deBank a token like $GNANA will not be included due to no (official LP (the little one on pcs is a very odd fluke and its existence makes zero sense..)

All my GNANA and yield in various token emissions are not listed so would need a custom add token, is this saved on debank servers or locally? (will tedious repetitive tasks like MM custom token contracts be erased on clearing browser cache??)

OK I'll try to emphasize the huge "pandoras hellbox of an unattainable universal all protocol perfect"
Portfolio vs the lesser evil id say benign challenge of a Wallet:

-# THIS GNANA shit can be skipped to next comment but is a valid issue in itself #--

Golden Banana $GNANA does not have an official LP pairing. It is a much used part of the ecosystem
A 'Banana 'purified' with a 28% burn fee and a 2% reflect fee which is distributed as free GNANA airdropped to all (un-staked) GNANA in wallet holders, used for:
-governance
-stake to earn exclusive tokens in higher APR 'syrup' pools.
-participate and pay in IAO's

It's value differs across boards [using the PCS LP is most definitely going to show erroneous values]
There is an official calculation based on BANANA price.. somewhere...in ape swap docs..

If my GNANA is ~ 50% of holdings it better show up on my dash ..;)
##found it after comparing between several asset tracking products NONE of them do all of the few things im in but reference more than 4 portfolios, ape-boards and what not.. to get a few parts together. ##

from ape swap docs:

The GNANA does not have a price nor will we open up a trading pair or farm for it. Its core utility will be the functions outlined above.

GNANA's makeshift "price" is referenced in two places:
1 - Initial Ape Offerings, where GNANA would be valued at 1.389x the current BANANA price.
2 - GNANA Staking pools, where the $ value staked of GNANA is based on the amount x 1.389 the BANANA price.
Please note this factors into the APRs!

Not really 'the point' here at all but to illustrate. the following down below____________

Bug on Rabby ; no connection from Pancakeswap

Hello. As a journalist, I test as many applications as possible and this morning I have been testing Rabby.io.
I transfered BNBs in it and then swapped some BNB to CAKEs.
Then I created a Pool on Pancakeswap. At first, Rabby.io waq recognised immediately. I created a pool.
Then 2 hours later I went back to Pancakeswap. Rabby.io was not connected and so Pancakeswap did not connect it. I connected Rabby with its password). But Pancakeswap still did not connect it.
And there is no option in Pancakeswap to connect Rabby.io. Even when I click on the Pancakswap icon from Rabby.io, no connection happens.
Could you please correct this ?
Daniel

Default Floor gwei for some chain (e.g. BSC)

I found the auto selected gwei for BSC sometimes is off and used 1 gwei instead of 5gwei (recommended by BSC?)
If I hit confirm then I would have a stuck tx until I check back.
Is there way to adjust the floor gwei for some of the chains?

Ability to toggle advanced gas control to edit gas directly.

The ability to put change gas directly off the interface instead of having to go into the gas menu settings would be a QoL implementation going forward.

An example of this would be
image
Where 15 would be the custom number entered for that transaction.

Below is how Metamask implement it.
chrome_iype0znCgB

BitBox02: Address selection bug

When selecting an address from the BitBox02, there is a bug where if you select an address in the list, it will select the one above. For example if you select the second address, it will select the first address. In addition, the numbering of the addresses starts with the second address, not with the first. Please see the image below:

image

BitBox02: -6203 invalid input on master

Hi there,

I was using a test build of Rabby from ShiftCrypto with initial BitBox02 integration and was unable to complete a transaction on OpenSea or Rarible. I therefore built the current master branch (using cimg/node:15.1 docker image as per your ci config) to see if it was still a problem but unfortunately I get the same issue.

Steps (using latest Chrome, no other extensions installed):

  • Connect BitBox02 wallet to Rabby (0.16.2 built from current master). All latest BB02 software/firmware applied.
  • Attempt to buy something on OpenSea
  • Click confirm checkout
  • Rabby sign transaction popup appears - click Sign
  • No prompt appears on BitBox02 to complete the signing. An error appears in the browser console log:

image

The same happens on Rarible, with the following in the console log:

image

Please let me know if there is anything else I can provide to help in getting this resolved.

PS - the only assets on the hardware wallet is a little ETH and a few ENS tokens.

Edit - attempting to send ETH to another wallet seems to work (brings up the approval on the hardware device).

Rabby stuck transaction on ftm when gas raised rapidly

image
Recently ftm gas has been raising a lot ( for the past couple days. ) and it seems the rpc are also raising the lower limit. (Normally 50 will do it. But this afternoon amy tx with lower than 180 gwei will stuck on Rabby, or receive the reject msg on Metamask, during Asian night it is now 300gwei)
It seems if Rabby had sent out a tx with gas value rejected by the rpc as Metamask returned, Rabby did not know and it will stuck on the queue waiting/doing nothing. (checking with ftmscan will see no pending tx on my address, only debank history will show a tx pending)
This happens even ftmscan shows no pending tx on the chain . (probably because it had reject all the tx with lower than "safe limit", but Rabby/Rabby rpc's)

Since Rabby has no alternative rpc user can change (it can be changed, but propably proprietary api service https://openapi.debank.com ) so I can't verify if it is the api/rpc/Raby's issue

Unable to connect to Rabby extension in Vivaldi browser

Vivaldi (vivaldi.com) is a Chromium-based browser. The vast majority of extensions designed for Google Chrome work with Vivaldi (as it uses the WebExtensions API). I've read on their website that some extensions that do UI customizations will not function properly because of visual changes to the source code.

I am experiencing the issue that I can setup Rabby properly and import a crypto wallet but when trying to connect any defi (or other crypto) app, Rabby does not pop up. In Chrome, Rabby will pop up in place of MetaMask when clicking on those same links (assuming MM is disabled).

Hoping someone has a workaround or any ideas. I am fearful that even when the extension is made officially available for other browsers, it may still not work with Vivaldi. Thanks for any help!

Ledger signing transactions

On certain websites interacting with Ledgers closes the transaction screen before it is finished resulting in breaking off the actual transaction.

image

Websites that this occurs on are sites like
https://www.tokemak.xyz/

EDIT: Thought I fixed it, but it just keeps tossing me a failed tx screen before it is even able to send it to my ledger.

Loopring exchange unable to unlock layer2 wallet

image
image
I had been using metamask with same address on loopring, however I am unable to "unlock" the same wallet when using the same address with Rabby

I don't think I need to Reset layer-2 keypair as I can unlock the layer2 wallet fine with other wallet (e.g. imtoken on android) with the same wallet address fine.

https://exchange.loopring.io/

Can not sign transaction via Ledger Live Bridge

Error message: Cannot read property 'r' of undefined

Workaround: Choose directly option when import Ledger address, if already imported, just import a new address directly, then the old address can sign without Ledger Live Bridge

image

Polygonscan not connecting

Cannot connect to polygonscan.com with my Rabby wallet. Can something be done? I realize this is something that probably should be resolved by the Etherscan team since other websites work as expected.
image
(no popup happens after the alert shows up)

Allow adding custom RPC endpoints

Having just tried Rabby, coming from MM, it's a significant upgrade in terms of speed and ease of use. Unfortunately one thing that I use heavily on MM are custom RPC endpoints, since I tend to run infrastructure for some chains and prefer to use my own private nodes.

I would like to request the option of adding our own custom (preferably multiple) chain endpoints to Rabby.

EIP-2612 Causes Rabby to get stuck on message signing

Bug discovered on Abracadabra borrowing. On Metamask it should open a signing popup if not already, then the actual transaction. On Rabby it get stuck on the message signing indefinitely, which causes the next transaction to never be shown.

Ledger disconnected, no user message

When the app is running and using with a Ledger, it doesn't catch when the Ledger is disconnected. And more importantly for the UX, when the user makes a transaction, there is not a single message anywhere explaining the need for a Ledger.
The Rabby panel appears, displaying the tx info, and once the user confirms the transaction, nothings popup, nothing proceeds. Rabby, at best is silently waiting for a Ledger. At worst it's silently throw an exception because of the missing Ledger.
The user has to lock its Rabby and connect again with a Ledger.

At least add a dedicated clear message asking the user to reconnect hes Ledger. also it can lock itself when it detect there is no more a Ledger connected.

Default gaslimit for "Send" token feature on Rabby wallet.

It seems currently when doing token transfer on Rabby, there is no gas limit preset on it (as there is no dapp to set one )
Is it possible to put a preset on it ( at least for the popular chains)
(I have not check but should the EVM chains share simiar gaslimit for simple operation like token transfer?)

The language is chinese

I installed the extension on chrome (not yet available on other browsers, right?) but I can't understand anything because the welcome screen, the buttons and everything else is in chinese.

Is there a way to switch the language to english?

Transactions stuck in pending on Polygon

I've encountered several times where transactions got stuck in pending on Rabby with Polygon. The transactions themselves were confirmed in Polygon. Only Rabby thought they were pending. The only way to clear them was to uninstall the extension. An example below

image

I think of the times were when gas prices were fluctuating quite a bit on Polygon.

EIP1559

All transactions are still sending using legacy transactions. Please look into adding #160 and EIP1559 support at the same time. Thanks.

Gas settings

Hey, I've been having issues with some gas settings

*Gas limit custom set - looks like the custom gas limits I set never get sent through properly. This could be a critical bug, I've ran out of gas today because of it - Rabby showed it set the correct gas, but when the tx was sent to the mempool it did not apply the gas limit specified.

*Can't change gas when network is overloaded - need a way to always be able to customize this, I've had this screen for multiple minutes while the network is clogged up.
chrome_NMyx09styS

*Unable to set custom gas below suggested price, this should not be something that Rabby prevents in the first case - just accept the users input instead of checking it against the system. Would be nice if we could set it in the first screen like suggested in #160

`WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).`

When running yarn build:pro, there are warning about size limit, that is actually default for webpack, and maybe has no sense for browser plugin

WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets: 
  background.js (2.25 MiB)
  ui.js (1.52 MiB)
  835.js (569 KiB)

WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints:
  background (2.26 MiB)
      webextension-polyfill.js
      background.js
  ui (1.53 MiB)
      webextension-polyfill.js
      ui.js

it can be solved via
https://stackoverflow.com/questions/49348365/webpack-4-size-exceeds-the-recommended-limit-244-kib

performance: {
        hints: false,
        maxEntrypointSize: 512000,
        maxAssetSize: 512000
    }

Ape.tax not accessible

When you try to access the https://ape.tax/ site, the experimental pools for funding won't load.
image

This is what it's supposed to look like (using Metamask to load and connect)

chrome_RCuoAAdRvZ

Ability to send coins between wallets

Currently, I need to add my connected wallets in my addresses for sending tokens to them. I feel like connected addresses need to be in my contacts by default.

Popup disappears when chrome is full screen

When I'm using Chrome in full screen on OS X, and I go to send a transaction, there is a popup that opens, but immediately closes. I'm unable to send transactions full-screen, and must change Chrome to a window to send transactions.

Repeated (3) failed transactions on Beefy Finance on Fantom

This morning, I have run into an insurmountable (for me anyway ...) problem executing a transaction on Beefy Finance on Fantom:

Screenshot of Rabby

Even if I click the "I'm sure I want to proceed anyway" checkbox, it still fails - costing me FTM in the process, each time ... The problem (at least 1 of them) is the gas limit is 0. Rabby is not autopopulating that value. With no value, the transaction automatically fails. The 3 failures are due to my own attempt to populate this "Advanced" field. Obviously with no success ...

I am a new user and have been very impressed with Rabby, hoping it will fully replace my use of Metamask. In this instance (after successfully using it for over a day on a number of transactions), I had to deactivate Rabby and reactivate Metamask, which successfully completed the transaction.

Edit, 23 Oct 2021: Here is the Beefy Finance Contract which generated the above issue - USDC Contract on Fantom.

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.