How to Integrate Magic with the Fantom Blockchain
How to Integrate Magic with the Fantom Blockchain
#Installation
Via Magic SDK, you can connect to the Fantom blockchain. Fantom is EVM compatible so you can directly follow the Ethereum installation.
note
You can skip straight to our Fantom Demo directly:
š Fantom Demo
#Configure Fantom
#Mainnet
Mainnet Block Explorer URL: https://ftmscan.com/
Javascript
01const customNodeOptions = {
02 rpcUrl: 'https://rpc.ftm.tools/',
03 chainId: 250,
04}
05
06// Setting network to Fantom
07const magic = new Magic('YOUR_PUBLISHABLE_API_KEY', { network: customNodeOptions });
#Testnet
Testnet Block Explorer URL: https://testnet.ftmscan.com/
Javascript
01const customNodeOptions = {
02 rpcUrl: 'https://rpc.testnet.fantom.network',
03 chainId: 4002,
04}
05
06// Setting network to Fantom - Testnet
07const magic = new Magic('YOUR_PUBLISHABLE_API_KEY', { network: customNodeOptions });