-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: hardware wallet support via frame signer (#17)
* feat: backport gnosis-py safe_tx_data safe-global/safe-eth-py#120 * feat: sign with frame * fix: no eip-155 support in ledger signatures * docs: add singing and useful links sections * chore: bump version and requirements * chore: bump gnosis-py min required version * refactor: remove backported eip712 code as * feat: submit signature * feat: reconstruct safe tx from api * fix: confirmations * feat: retrieve pending txs from tx service * docs: update signing docs * feat: add tx execution * docs: update detailed example
- Loading branch information
Showing
8 changed files
with
216 additions
and
44 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Changelog | ||
========= | ||
|
||
0.3.0 | ||
----- | ||
|
||
- hardware wallet support via frame | ||
- submit signatures to transaction service | ||
- retrieve pending transactions from transaction service | ||
- execute signed transactions | ||
- convert confirmations to signatures | ||
- expanded documentation about signing | ||
|
||
0.2.0 | ||
----- | ||
|
||
- add support for safe contracts 1.3.0 | ||
- switch to multicall 1.3.0 call only | ||
- support multiple networks | ||
- autodetect transaction service from chain id |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
Signing | ||
======= | ||
|
||
Several options for signing transactions are available in Ape Safe, including support for hardware wallets. | ||
|
||
Signatures are required, Gnosis `transaction service`_ will only accept a transaction with an owner signature or from `a delegate`_. | ||
|
||
Local accounts | ||
-------------- | ||
|
||
This is the default signing method when you send a transaction. | ||
|
||
Import a private key or a keystore into Brownie to use it with Ape Safe. | ||
Brownie accounts are encrypted at rest as .json keystores. | ||
See also Brownie's `Account management`_ documentation. | ||
|
||
.. code-block:: bash | ||
# Import a private key | ||
$ brownie accounts new ape | ||
Enter the private key you wish to add: | ||
# Import a .json keystore | ||
$ brownie accounts import ape keystore.json | ||
Ape Safe will prompt you for an account (unless supplied as an argument) and Brownie will prompt you for a password. | ||
|
||
.. code-block:: python | ||
>>> safe.sign_transaction(safe_tx) | ||
signer (ape, safe): ape | ||
Enter password for "ape": | ||
>>> safe.sign_transaction(safe_tx, 'ape') | ||
Enter password for "ape": | ||
If you prefer to manage accounts outside Brownie, e.g. use a seed phrase, you can pass a ``LocalAccount`` instance: | ||
.. code-block:: python | ||
>>> from eth_account import Account | ||
>>> key = Account.from_mnemonic('safe grape tape escape...') | ||
>>> safe.sign_transaction(safe_tx, key) | ||
Frame | ||
----- | ||
If you wish to use a hardware wallet, your best option is Frame_. It supports Ledger, Trezor, and Lattice. You can also use with with keystore accounts, they are called Ring Signers in Frame. | ||
To sign, select an account in Frame and do this: | ||
.. code-block:: python | ||
>>> safe.sign_with_frame(safe_tx) | ||
Frame exposes an RPC connection at ``http://127.0.0.1:1248`` and exposes the currently selected account as ``eth_accounts[0]``. Ape Safe sends the payload as ``eth_signTypedData_v4``, which must be supported by your signer device. | ||
|
||
|
||
.. _`transaction service`: https://safe-transaction.gnosis.io/ | ||
.. _`a delegate`: https://safe-transaction.gnosis.io/ | ||
.. _Account management: https://eth-brownie.readthedocs.io/en/latest/account-management.html | ||
.. _Frame: https://frame.sh/ |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Useful links | ||
============ | ||
|
||
- `Cowswap trades with Gnosis safe`_ by Poolpi Tako | ||
|
||
|
||
.. _`Cowswap trades with Gnosis safe`: https://hackmd.io/@2jvugD4TTLaxyG3oLkPg-g/H14TQ1Omt |
This file contains 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