SDK Error Handling
Logging In
import Fortmatic from 'fortmatic';
import Web3 from 'web3';
const fm = new Fortmatic('YOUR_API_KEY');
window.web3 = new Web3(fm.getProvider());
try {
const accounts = await web3.eth.getAccounts();
// other functions for logging in:
// const accounts = await web3.currentProvider.enable();
// const accounts = await fm.user.login();
}
catch (err) { // if user closes the modal without logging in
console.log(err); // { message: 'Fortmatic: User denied account access.', code: '4001' }
}Sending a Transaction
Signing a Data
Last updated
Was this helpful?