Get Provider

Face Wallet offers a provider object for each blockchain. You can use the features of each blockchain through the Provider object. Blockchain features are performed via JSON-RPC, and a Provider receives JSON-RPC requests and returns responses.

Create a Face object to get a provider of each blockchain network. You can use the provider directly or inject it into another blockchain library.

import { Face, Network } from '@haechi-labs/face-sdk';
import { ethers } from 'ethers';

const face = new Face({
  network: Network.MUMBAI, 
  apiKey: 'YOUR_DAPP_API_KEY'
});
const provider = new ethers.providers.Web3Provider(face.getEthLikeProvider());