Please refer doc here: https://cbridge-docs.celer.network/developer/cbridge-transfer-web-widget
testnet: .env.test BAS testnet: .env.bas_testnet
using local env to run the project:
$cp .env.test .env
whitelisted the support chains and tokens into chains_${env}.ts file
for example, add USDC to BSC Testnet chain .
bscTest: {
name: "BSC Testnet",
chainId: 97,
rpcUrl: "https://bsc-testnet.nodereal.io/v1/bdc0906a6f534a4598cdb24425cc855a",
iconUrl: "./bnbchain.png",
symbol: "BNB",
blockExplorerUrl: "https://testnet.bscscan.com",
tokenSymbolList: ["USDC"], // USDC token to be whitelisted
lqMintTokenSymbolBlackList: ["USDC"], // add if the token doesn't support liquidity pool
}
After you put native token symbol into token symbol whitelist, you will also have to configure it as a native token. To implement this, modify the following files. If you have any questions, you can refer this: https://github.com/celer-network/cBridge-transfer-widget/commit/b47a6e85eee480f8bb4440f13949766a2744369c
if (targetChainId === CHAIN_ID && tokenSymbol === CHAIN_NATIVE_TOKEN_SYMBOL) {
return true;
}
if (srcChain.id === CHAIN_ID && tokenInfo.token.symbol === CHAIN_NATIVE_TOKEN_SYMBOL) {
nativeETHToken = true;
}
if (item?.dst_received_info.chain.id === CHAIN_ID && item?.src_send_info?.token.symbol === CHAIN_NATIVE_TOKEN_SYMBOL) {
shouldDisplayMetaMaskIcon = false;
}
specific support tab view in env configuration file.
for example, show both transfer and NFT Tabs in widget.
REACT_APP_FEATURES_SUPPORTED="Transfer|NFT"
Since the bridge widget supports terra wallet, you have to getChainOptions and populate WalletProvider
before render. Otherwise, you will face app crash. You can refer src/index.js for usage.
REACT_APP_NETWORK_ID
// 1: Production, 3: Testnet
REACT_APP_SERVER_URL
// Rest API endpoint url
REACT_APP_NFT_CONFIG_URL
// MCNNFT config
REACT_APP_CLAIM_ID=1
// 1: Production 5: Testnet
REACT_APP_ENV=MAINNET
// MAINNET: Production Environment Test: Test Environment
REACT_APP_ENV_TYPE=staging
// test, staging, mainnet
REACT_APP_USER_BLACKLIST
=[]// The above address should be blocked through cBridge functionality
REACT_APP_FEATURES_SUPPORTED
// "Transfer": Transfer supported only; "NFT": NFT supported only; "Transfer|NFT": Both Transfer and NFT are supported