ランキングに戻る

RabbyHub/Rabby

TypeScriptrabby.io

The game-changing wallet for Ethereum and all EVM chains

defiethereumdappchrome-extensionethereum-walletblockchain
スター成長
スター
1.9k
フォーク
578
週間成長
Issue
126
5001k1.5k
2023年1月2024年3月2025年5月2026年7月
成果物npmnpm install rabby
README

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 22 or later.
  2. Enable Corepack: corepack enable
  3. Run yarn install 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

関連リポジトリ
smartcontractkit/full-blockchain-solidity-course-js

Learn Blockchain, Solidity, and Full Stack Web3 Development with Javascript

blockchainchainlink
14k3.3k
OffcierCia/DeFi-Developer-Road-Map

DeFi Developer roadmap is a curated Developer handbook which includes a list of the best tools for DApps development, resources and references!

JavaScriptnpmOtherblockchainethereum
officercia.mirror.xyz/Uc1sf64yUCb0uo1DxR_nuif5EmMPs-RAshDyoAGEZZY
10.8k1.3k
SunWeb3Sec/DeFiHackLabs

Reproduce DeFi hacked incidents using Foundry.

SolidityApache License 2.0defiethereum
6.6k1.5k
sea-protocol/seaprotocol

Sea protocol is the ultimate DEX base on order-book & AMM on Aptos & Sui.Anybody has the right to trade any asset anywhere, anytime!

MoveOthercryptocurrencydefi
gridtrade.xyz
5k52
rainbow-me/rainbow

🌈‒ the Ethereum wallet that lives in your pocket

TypeScriptnpmGNU General Public License v3.0react-nativeethereum
rainbow.me
4.4k753
OneKeyHQ/app-monorepo

Secure, open source and community driven crypto wallet runs on all platforms and trusted by millions.

TypeScriptnpmOtherblockchainelectron
onekey.so
2.4k521
OffcierCia/ultimate-defi-research-base

Here we collect and discuss the best DeFI & Blockchain researches and tools. Feel free to DM me on Twitter or open pool request.

Othercryptocurrencyethereum
twitter.com/officer_cia
2.2k250
ccyanxyz/uniswap-arbitrage-analysis

Uniswap arbitrage problem analysis

PythonPyPIuniswaparbitrage
2.1k602
SunWeb3Sec/DeFiVulnLabs

To learn common smart contract vulnerabilities using Foundry!

Soliditydefiethereum
2k347
OffcierCia/Crypto-OpSec-SelfGuard-RoadMap

Here we collect and discuss the best DeFi, Blockchain and crypto-related OpSec researches and data terminals - contributions are welcome.

The Unlicenseopseccryptocurrency
t.me/officer_cia
1.8k168
rango-exchange/rango-sdk

Rango Exchange Typescript SDK

TypeScriptnpmApache License 2.0bitcoinbridge
rango.exchange/apis
1.7k40
ong/awesome-decentralized-finance

A curated list of awesome decentralized finance projects

blockchaindecentralized
1.7k354