Skip to content

Commit

Permalink
feat: initial MetaMask Snap version (#83)
Browse files Browse the repository at this point in the history
* feat(snap): initial version

* chore: cleanup unused files

* docs(snap): add little page explaining how to build

* fix(wardenkms): use the correct V value for ecdsa signatures

* fix(spaceward): disable WalletConnect debug logs

* feat(spaceward): add Sepolia addresses to MetaMask snap
  • Loading branch information
Pitasi authored Mar 13, 2024
1 parent c04bb16 commit 3ac3997
Show file tree
Hide file tree
Showing 38 changed files with 14,410 additions and 19,136 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ ENV VITE_WARDEN_REST_URL=%WARDEN_REST_URL%
ENV VITE_WARDEN_CHAIN_NAME=%WARDEN_CHAIN_NAME%
ENV VITE_WARDEN_CHAIN_ID=%WARDEN_CHAIN_ID%
ENV VITE_WARDEN_MAINTENANCE=%WARDEN_MAINTENANCE%
ENV VITE_WARDEN_SNAP_ORIGIN=%WARDEN_SNAP_ORIGIN%

RUN cd spaceward && pnpm run build

Expand Down
5 changes: 0 additions & 5 deletions cmd/wardenkms/bip44.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,6 @@ func generateECDSASignature(seed, message []byte, recoveryID bool) ([]byte, erro
if !recoveryID {
// Remove the recovery ID [v] from the signature
sigBytes = sigBytes[0:64]
} else {
// ensure that the recoveryID is either 0x1b or 0x1c
if sigBytes[64] < 27 {
sigBytes[64] += 27
}
}

return sigBytes, nil
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 40 additions & 0 deletions docs/docs/developers/metamask-snap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# MetaMask Snap

Warden Protocol maintains a [MetaMask Snap](https://metamask.io/snaps/) to
bring your Warden Protocol Ethereum addresses to any dApp that already supports
MetaMask.

![MetaMask accounts list with a Warden Protocol controlled address](./metamask-snap-accounts-preview.jpg)


## Build

Clone the Warden Protocol repo:

```sh
git clone https://github.com/warden-protocol/wardenprotocol

cd wardenprotocol/snap
```

Install the required dependencies:

```sh
npm install
```

Run the server (it will monitor changes and rebuild automatically):

```sh
npm start
```

Now SpaceWard can load the MetaMask Snap using the origin
`local:http://localhost:8123`.


## Publish

MetaMask Snaps are published as npm packages. At this time, the Warden Protocol
MetaMask Snap is not published to npm, but you can build and test it
locally.
Loading

0 comments on commit 3ac3997

Please sign in to comment.