Skip to content

Commit

Permalink
feat: merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
stanleyyconsensys committed Nov 17, 2023
2 parents 101804d + 560751f commit 62f589e
Show file tree
Hide file tree
Showing 48 changed files with 4,085 additions and 1,720 deletions.
41 changes: 38 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@

The Starknet snap allows developers to **deploy Starknet accounts, make transactions on Starknet, and interact with Starknet smart contracts.** It can be connected with any dapp to access Starknet and developers can experiment integrating their dapp with this snap today.

[Starknet dapp](https://snaps.consensys.net/starknet)
[Starknet Snap](https://snaps.metamask.io/snap/npm/consensys/starknet-snap)

[Blog post](https://consensys.net/blog/metamask/metamask-integrates-starkware-into-first-of-its-kind-zk-rollup-snap/)
[Starknet Dapp](https://snaps.consensys.io/starknet)

[Blog Post](https://consensys.io/blog/metamask/metamask-integrates-starkware-into-first-of-its-kind-zk-rollup-snap/)

# Development
### Prerequisites
Expand Down Expand Up @@ -61,11 +62,45 @@ yarn workspace wallet-ui storybook
- Wallet UI dapp: http://localhost:3000/
- Storybook: http://localhost:6006/

# Dapp intergation Guide

### How to install
From the dApp, issue the following RPC request to install the Snap, make sure it is using the latest version
```javascript
provider.request({
method: 'wallet_requestSnaps',
params: {
["npm:@consensys/starknet-snap"]: { version: "2.2.0"}, //Snap's version
},
})
```

### Interact with Starknet Snap's Api
From the dApp, issue the following RPC request to interact with the Snap

e.g
```javascript
provider.request({
method: 'wallet_invokeSnap',
params: {
snapId: "npm:@consensys/starknet-snap",
request: {
method: 'starkNet_getStoredUserAccounts', //Snap method
params: {
chainId : "1", //Snap method's parameter
},
},
},
}))
```
### Starknet Snap's Api
The corresponding request payload and response for latest Starknet Snap's Api are documented in the [openrpc spec](https://github.com/Consensys/starknet-snap/blob/starknet-snap-v2.2.0/packages/starknet-snap/openrpc/starknet_snap_api_openrpc.json)

# Licenses

This project is dual-licensed under Apache 2.0 and MIT terms:

- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)

Copyright (c) 2022 ConsenSys Software Inc.
Copyright (c) 2023 ConsenSys Software Inc.
8 changes: 2 additions & 6 deletions packages/starknet-snap/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,13 @@ module.exports = {
browser: true,
es2021: true,
},
extends: [
'plugin:@typescript-eslint/recommended',
],
extends: ['plugin:@typescript-eslint/recommended'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
plugins: [
'@typescript-eslint',
],
plugins: ['@typescript-eslint'],
rules: {
},
};
1,871 changes: 892 additions & 979 deletions packages/starknet-snap/index.html

Large diffs are not rendered by default.

Loading

0 comments on commit 62f589e

Please sign in to comment.