Binance implementation guide

How to Build a Decentralized App on Binance Smart Chain with Magic

Overview

Binance Smart Chain is a Layer 1 blockchain network that’s compatible with the Ethereum Virtual Machine (EVM), specifically designed to revolutionize the world of sports. Through the Magic SDK, users can easily create wallets and engage with Binance Smart Chain, enabling teams, fans, and developers to craft Web3 products and experiences that unite fans and brands like never before. As Binance Smart Chain is EVM compatible, you can follow the Ethereum documentation to send your first transaction and utilize all other features.

Configure Binance Smart Chain

Smart Chain

Mainnet Block Explorer URL: https://bscscan.com
JavaScript
const BSCOptions = {
  rpcUrl: "https://bsc-dataseed.binance.org/", // Smart Chain RPC URL
  chainId: 56, // Smart Chain chain id
};

// Setting network to Smart Chain
const magic = new Magic("YOUR_PUBLISHABLE_API_KEY", { network: BSCOptions });

Smart Chain - Testnet

Testnet Block Explorer URL: https://testnet.bscscan.com
JavaScript
const BSCOptions = {
  rpcUrl: "https://data-seed-prebsc-1-s1.binance.org:8545/", // Smart Chain - Testnet RPC URL
  chainId: 97, // Smart Chain - Testnet chain id
};

// Setting network to Smart Chain - Testnet
const magic = new Magic("YOUR_PUBLISHABLE_API_KEY", { network: BSCOptions });

Compatibility

  • All Auth, User and most Wallet module methods*
  • All EVM Provider functionality to respond to supported RPC methods
*Some features are not yet compatible such as NFT Viewer and Fiat On-ramps. Need a feature or see a problem? File an issue on our github repo.

Resources & Tools