Skip to content

idriss-crypto/multiresolver

 
 

Repository files navigation

Multi Resolver

This submission showcases a multi-resolver MetaMask Snap. It enables dApps to send transactions to string-type handles that can take on a multitude of origins. Instead of integrating multiple domain services and resolvers individually, dApps can now simply call this snap and let MetaMask do the rest.

dApps can interact with the snap by calling

const resolveInput = async (identifier?: string) => {
  return await window.ethereum.request({
    method: 'wallet_invokeSnap',
    params: [
      defaultSnapOrigin,
      {
        method: 'resolve_send',
        identifier: identifier,
      },
    ],
  });
};

Which invokes the resolving process in MetaMask. The user is presented with the result of the resolver and can either accept or decline sending funds to the person defined through identifier.

UI Implementation Example

Usage

To install, run:

yarn
yarn install

To run the snap, run:

yarn build
yarn start

Snaps is pre-release software

To interact with this Snap, you will need to install the MetaMask Flask Bogota Build.

Notes

  • I will use this snap to continuously experiment with new functionalities. It should also provide a playground for other (open-source) developers to add more custom resolvers to MetaMask. This will improve the usability of web3 for both users who now can natively send transactions to Twitter usernames, emails, phone numbers, ens & UD domains, lens protocol handles and whatever else other people come up with, as well as for dApp builders, who don't have to worry about what resolvers they should integrate anymore.
  • When adding more resolvers, one should keep naming conflicts in mind. Even though I am not aware of any conflicts, a system for determining a resolver priority list should be developed. For the beginning, I am proposing a popularity ranking, which simply takes the size of an ecosystem into consideration .

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 97.3%
  • JavaScript 2.4%
  • Shell 0.3%