safe-global / safe-wallet-web

Safe{Wallet} – smart contract wallet for Ethereum (ex-Gnosis Safe multisig)
https://app.safe.global
GNU General Public License v3.0
311 stars 360 forks source link

feat(): add staking feature via StakeKit #3875

Open petar-omni opened 1 week ago

petar-omni commented 1 week ago

What it solves

Adds staking functionality to Safe Wallet Web

How this PR fixes it

This PR introduces native staking capabilities to Safe, enabling a seamless staking experience directly within the platform. By tapping the "Stake" button from the dashboard sidebar menu, users are able to engage in self-custodial staking using their currently selected Safe account through the StakeKit widget. The widget is connected with Safe's walletProvider, supporting both transaction signing and message signing.

There are some minor changes to the existing code that had to be made to support Transaction and Message signing

Add operation type parameter to SafeAppsTxParams to correctly submit a DelegateCall transaction to the Multisend contract Return MessageHash on signMessage to determine whether the a message has been signed or not. (So the StakeKit widget can wait for all other owners to sign)

How to test it

Important: STAKE feature needs to be added to specific chains for this feature to appear on sidebar and work

Tap the "Stake" button from the dashboard sidebar menu and use the StakeKit widget to stake / unstake supported assets.

Make sure to add your STAKEKIT_API_KEY as environment variable.

Screenshots

321983691-a9a71c8e-5ee2-4e35-9be8-afcade6ad9e7 321983679-0fee6aa4-2b4b-4e11-9051-6a9b25cc3cc1

Checklist