Develop Ethereum based dApps
Integrate Ethereum dApps with XDEFI
window.xfi.ethereum
XDEFI injects window.xfi.ethereum
as an EIP-1193 compatible provider;
As a dApp developer, you can check if window.xfi && window.xfi.ethereum
is defined.
If it is, XDEFI is injected.
You can use it with regular ethereum libraries such as web3 or ethersjs.
window.ethereum
If Pretend to be MetaMask option is enabled in the dApps Settings Providers page, this would make XDEFI overrides window.ethereum
and pretend to be MetaMask by having window.ethereum.isMetaMask
and window.ethereum._metamask
set to true
Using onboard.js
Follow the getting started tutorial: https://docs.blocknative.com/onboard
And add the entry of xdefi
to the wallets
option.
{
walletName: "xdefi"
}
Example of integration with onboard.js: https://github.com/blocknative/react-demo/blob/master/src/services.js#L71 ( live demo https://reactdemo.blocknative.com/ )