Skip to content

ca-step 4: in-wallet chain abstracted sends - #19

Open
felimadu wants to merge 1 commit into
step-3/display-unified-balances-for-cafrom
step-4/inwallet-chain-abstracted-swaps-and-sends
Open

ca-step 4: in-wallet chain abstracted sends#19
felimadu wants to merge 1 commit into
step-3/display-unified-balances-for-cafrom
step-4/inwallet-chain-abstracted-swaps-and-sends

Conversation

@felimadu

@felimadu felimadu commented Jul 22, 2025

Copy link
Copy Markdown
Member

This PR is part of the steps to add Orby chain abstraction on the Zerion Chrome Extension. The same steps and similar code can be used on other Chrome Extension wallets.

[✅] Step 0 PR(#15): Setup feature flags

  • create a remotely configurable feature flag called chain_abstraction_enabled. we will use this feature flag to gate access to the chain abstraction as we do progressive rollout of the feature.
    Zerion uses firebase but you can feature flag system of your choice such as launch darkly

[✅] Step 1: Update Update OrbyConfig to include the other VM accounts and update signing of operations

  • get all the addresses and accounts that you want to include together. For this Zerion example, we want to include all the accounts that are part of the same wallet group. That means account that are derived from the same mnemonic are grouped together regardless of the VM that they are part of. Specifically, Zerion supports both EVM and SVM, so we will have chain abstraction and unified balances on the SVM and EVM
  • update the signing operations to fetch a signer based on the address that the operation is from
  • use the feature flag from step 0 to turn on chain abstraction on Orby. When the feature flag is on, turn on chain abstraction on Orby for the user

Testing: At this point, we should have chain abstraction enabled for the accounts we set in the OrbyConfig

[✅] Step 2 PR(#16): Introduce unified network and make it default
We want to separate the chain that the connected app is on from the chain / view that the user is on. To do that, we introduce the notion of selectedChain in the app preferences. This value can be updated/changed by the user and it is set to NetworkSelectValue.Unified by default. When an app ask for a chain switch, we update the selectedChain iff its current value is not NetworkSelectValue.Unified.

Not, we do not seek to remove all the chains and allow user to be able to select All Networks and separate networks because we want to allow the option for users to see a particular view they want. Here is now the wallet looks with these changes:
Screenshot 2025-07-22 at 11 57 52

Screenshot 2025-07-22 at 11 58 09 Screenshot 2025-07-22 at 11 58 27

[✅] Step 3 PR(#17): Displaying a unified Portfolio view
When selectedChain is NetworkSelectValue.Unified, we want to display a unified view and total assets. Specifically, we want to keep the data data models that the wallet was already using. So, we:

  1. fetch balances from wallet backend as we normally do
  2. fetch balances from Orby
  3. merge the 2 but prioritizing assets from the wallet backend. We only want orby balances for the total and breakdown but everything else stays the same.

This give us a view that looks like the following
Screenshot 2025-07-22 at 14 01 58

Screenshot 2025-07-22 at 14 02 38 Screenshot 2025-07-22 at 14 02 16

[👉] Step 4: In-wallet chain abstracted sends
When selectedChain is NetworkSelectValue.Unified, we want to have chain abstracted sends and swaps.

@felimadu felimadu changed the title in-wallet chain abstracted sends step 4: in-wallet chain abstracted sends Jul 22, 2025
@felimadu felimadu changed the title step 4: in-wallet chain abstracted sends ca-step 4: in-wallet chain abstracted sends Jul 22, 2025
@felimadu felimadu mentioned this pull request Jul 22, 2025
@felimadu
felimadu force-pushed the step-3/display-unified-balances-for-ca branch from 9f3016c to e1028c3 Compare July 23, 2025 05:34
@felimadu
felimadu force-pushed the step-4/inwallet-chain-abstracted-swaps-and-sends branch from 7a06107 to 936b3fd Compare July 23, 2025 05:52
@github-actions

github-actions Bot commented Jul 23, 2025

Copy link
Copy Markdown

📦 build.zip [updated at Aug 15, 7:37:08 PM UTC]

@felimadu
felimadu force-pushed the step-3/display-unified-balances-for-ca branch from e1028c3 to 8524a49 Compare August 15, 2025 19:35
@felimadu
felimadu force-pushed the step-4/inwallet-chain-abstracted-swaps-and-sends branch from 936b3fd to 9166b09 Compare August 15, 2025 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant