1-click+gas-step 4: configure Orby to handle communication with app frontends - #7
Open
felimadu wants to merge 3 commits into
Open
1-click+gas-step 4: configure Orby to handle communication with app frontends#7felimadu wants to merge 3 commits into
felimadu wants to merge 3 commits into
Conversation
|
📦 build.zip [updated at Aug 15, 7:06:02 PM UTC] |
This was referenced Jul 15, 2025
felimadu
force-pushed
the
step-3/add-orby-provider
branch
from
July 22, 2025 21:14
10bfc3e to
33e90f3
Compare
felimadu
force-pushed
the
step-4/add-communication-with-dapps
branch
from
July 22, 2025 21:17
027a81a to
799bd5f
Compare
felimadu
force-pushed
the
step-3/add-orby-provider
branch
from
August 15, 2025 18:54
20d7106 to
5d0de8e
Compare
felimadu
force-pushed
the
step-4/add-communication-with-dapps
branch
from
August 15, 2025 18:54
799bd5f to
53d3d39
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is step 3 of the steps to add Orby and support 1-click transactions and gas abstraction on the Zerion Chrome Extension. The same steps and similar code can be used on other Chrome Extension wallets.
[✅] Step 0 PR (#4) : Setup feature flags
one_click_transactions_and_gas_abstraction[✅] Step 1 [(No PR needed)]: Get EVM and SVM testing accounts and set them up.
[✅] Step 2 PR (#5): Get the Orby API keys for an instance and add them to your environment variables.
The team will give you keys and urls that look like:
Note: the private and public keys correspond to a particular instance with specific features enabled on that instance. Given that we're working on 1-click transactions and gas abstraction, make sure that only those 2 features are be enabled.
[✅] Step 3 PR (#6): Add OrbyProvider to the root of your app
OrbyProvidereasilyOrbyProvider: Adding OrbyProvider to the root of the app setups all the context and variables that will be used in hooks and function calls to communicate with Orby.[👉] Step 4: Configure Orby to handle communication with app frontends
eth_call) that are routed to the apps from the wallet (some apps do this)."activeTab","scripting", andunlimitedStoragepermissions in thesrc/manifest.jsonfile./src/content-script/before building, and meaning the files are build together with the other content script files.unifyBalancesOnAppsfunction your background script with the first argument being the location of the files from step 4 above relative to the root of the build output directoryuseBulkConnectAppSessionsto register them to the background script. Similarly, call thegetVirtualNodeRpcUrlsForSupportedChainsfunction to get virtual nodes, and add them to your RPC state as the primary way to forward RPC requests from apps the orby. This is necessary because some apps still call wallets for balances, and even genericeth_calls. For the Zerion Extension, this is done in the newRegisterSessionscomponent, which is conditionally rendered if the feature flag is set.Testing: At this point, we want to test that the wallet is function as expected.
Control:Using the Zerion wallet on App store, connect to uniswap with an account that does not have native funds on a chain like BNB Chain, ETH Mainnet, Arbitrum, Base or Optimism. You should be blocked with a "Insufficient funds for gas" error when you attempt a swap.Orby Enabled:Now, switch to this Orby enabled Zerion wallet but with the same account. You should not be blocked with a "Insufficient funds for gas" any error when you attempt a swap, and instead you should be able to send the transaction to the wallet for signing.Control:Using the Zerion wallet on App store, connect to uniswap with an account with sufficient funds on a chain like BNB Chain, ETH Mainnet, Arbitrum, Base or Optimism, and attempt a swap with an ERC20 token (e.g. USDC) that has not been approved on uniswap. You should see an "Approve and Swap" CTA when you attempt to swap. Clicking the button sends an ERC20 approval request to the wallet.Orby Enabled:Now, switch to this Orby enabled Zerion wallet but with the same account. You should see "Swap" with no approvals needed. Clicking the CTA sends a permit2 typedData to the wallet and not an approval transaction.