MetaMask Snap
Table of Contents
- 1 Table of Contents
- 2 High-level Specification
- 2.1 FIO App Account Types
- 2.2 Alternative Account
- 2.3 Sign-in
- 2.4 Sign Transaction
- 3 Metamask SNAP
- 3.1 Overview
- 3.2 Sign-in Flow
- 3.3 Sign Transaction Flow
- 3.4 Inside SNAP Functionality
- 3.5 Inside FIO App Functionality
- 3.5.1 Authenticate
- 3.5.2 Sign Transaction
- 3.5.3 Decrypt Content
- 3.5.4 Sign out
High-level Specification
Functionality | Details |
---|---|
FIO App Account Types |
|
Alternative Account |
|
Sign-in |
|
Sign Transaction |
|
Metamask SNAP
Overview
Metamask Snap is an extension of Metamask browser plug-in, which allows for new functionality, e.g. ability to sign transactions on a non-EVM chain.
The FIO Snap allows Metamask users to gain access to the FIO App and execute transactions without having to create an account, which requires email and password.
Sign-in Flow
Sign Transaction Flow
Inside SNAP Functionality
Visual | Functionality |
---|---|
FIO Handle Resolution |
"endowment:name-lookup": {
"chains": [
"eip155:1",
"eip155:10",
"eip155:56",
"eip155:61",
"eip155:137",
"eip155:324",
"eip155:1101",
"eip155:5000",
"eip155:8453",
"eip155:42161",
"eip155:42220",
"eip155:43114",
"eip155:59144",
"eip155:7777777"
]
}
export const onNameLookup: OnNameLookupHandler = async (request) => {
const { chainId, address, domain } = request;
if (domain) {
const resolvedAddress = '0xc0ffee254729296a45a3885639AC7E10F9d54979';
return {
resolvedAddresses: [{
protocol: 'FIO Handle',
resolvedAddress: resolvedAddress,
domainName: domain,
}]
};
}
return null;
}; DEV NOTE: specification: https://metamask.github.io/SIPs/SIPS/sip-12 |
SNAP Home PageNo FIO Handle and No FIO Tokens and No Pending FIO Requests1+ FIO Handles and >0 FIO Tokens and 1+ FIO Requests |
|
Inside FIO App Functionality
Visual | Functionality |
---|---|
Authenticate
|
|
Sign Transaction
|
|
Decrypt Content |
|
Sign out
|
|