Skip to content

Commit fccb12d

Browse files
authored
chore: add readme to evm-connector (#155)
1 parent 6f2a61a commit fccb12d

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

packages/evm-connector/README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
## 📗 Description
2+
3+
To enable the use of a MetaMask wallet on Fuel we use [Predicates](https://docs.fuel.network/docs/intro/glossary/#predicate) on Fuel Network, that allow transactions to be validated using a script.
4+
5+
Below we share a model that explains how our EVM Connector works.
6+
7+
```mermaid
8+
sequenceDiagram
9+
participant A as Dapp
10+
participant B as EVM Wallet Connector
11+
participant C as MetaMask (EVM Wallet)
12+
13+
note over A,C: List Accounts
14+
A->>B: fuel.accounts()
15+
B->>C: ethProvider.request({ "method": "eth_accounts" })
16+
C-->>B: ["0xa202E75a467726Ad49F76e8914c42433c1Ad821F"]
17+
B->>B: Create a predicate for each ETH account address
18+
B-->>A: ['fuel1s6cswzjfunkarjh9rlr7fdug4r04le2zec9agtudj3gkjwarlwnsw8859m']
19+
20+
note over A,C: Send Transaction
21+
A->>B: fuel.sendTransaction("<address>", { <transaction> })
22+
B->>B: Hash transaction Id
23+
B->>C: ethProvider.request({ "method": "personal_sign" })
24+
C-->>B: "0xa202..<sign hash>..222"
25+
B->>B: Send transaction using predicate validation to Fuel Nework
26+
B-->>A: "0x111..<transaction ID>..222"
27+
```

0 commit comments

Comments
 (0)