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 } from '@haechi-labs/face-react-native-sdk';
import { ethers } from 'ethers';
const face = new Face({
network: Network.GOERLI,
apiKey: 'YOUR_DAPP_API_KEY',
scheme: 'CUSTOM_SCHEME'
});
const provider = new ethers.providers.Web3Provider(face.getEthLikeProvider());
Updated 12 months ago