From 032426fa380f961fa333250dc0eddf915069e888 Mon Sep 17 00:00:00 2001 From: jamisliao Date: Fri, 30 Dec 2022 10:56:07 +0800 Subject: [PATCH] feat: add chain information --- .gitignore | 8 ---- Assets/Script/Model/EvmChain.cs | 79 +++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+), 8 deletions(-) create mode 100644 Assets/Script/Model/EvmChain.cs diff --git a/.gitignore b/.gitignore index ab0e7e1..5f9a2c6 100644 --- a/.gitignore +++ b/.gitignore @@ -71,13 +71,5 @@ flow-unity-sdk/Logs flow-unity-sdk/obj flow-unity-sdk/Temp UserSettings -Assets/Plugins/Flow/*/obj -ios project -ios project_BurstDebugInformation_DoNotShip -android project_BurstDebugInformation_DoNotShip release -andorid project_BurstDebugInformation_DoNotShip -andorid project_BackUpThisFolder_ButDontShipItWithYourGame -com.blocto.flow.unityapp ProjectSettings/ProjectSettings.asset -Assets/Script/Model/EvmChain.cs diff --git a/Assets/Script/Model/EvmChain.cs b/Assets/Script/Model/EvmChain.cs new file mode 100644 index 0000000..79c821e --- /dev/null +++ b/Assets/Script/Model/EvmChain.cs @@ -0,0 +1,79 @@ +namespace Script.Model +{ + public static class EvmChain + { + static EvmChain() + { + ETHEREUM = new ChainInformation + { + Title = "Ethereum", + Symbol = "ETH", + MainnetContractAddress = "your smart contract address", + TestnetContractAddress = "your smart contract address", + MainnetRpcUrl = "your rpc url", + TestnetRpcUrl = "your rpc url", + MainnetExplorerDomain = "etherscan.io", + TestnetExplorerDomain = "rinkeby.etherscan.io", + MainnetExplorerApiUrl = "https://api-rinkeby.etherscan.io", + TestnetExplorerApiUrl = "https://api-rinkeby.etherscan.io", + }; + + BNB_CHAIN = new ChainInformation + { + Title = "BNB Chain", + Symbol = "BNB", + MainnetContractAddress = "your smart contract address", + TestnetContractAddress = "your smart contract address", + MainnetRpcUrl = "https://bsc-dataseed.binance.org", + TestnetRpcUrl = "https://data-seed-prebsc-1-s1.binance.org:8545", + MainnetExplorerDomain = "bscscan.com", + TestnetExplorerDomain = "testnet.bscscan.com", + MainnetExplorerApiUrl = "https://api.bscscan.com", + TestnetExplorerApiUrl = "https://api-testnet.bscscan.com" + }; + + POLYGON = new ChainInformation + { + Title = "Polygon", + Symbol = "MATIC", + MainnetContractAddress = "your smart contract address", + TestnetContractAddress = "your smart contract address", + MainnetRpcUrl = "your rpc url", + TestnetRpcUrl = "your rpc url", + MainnetExplorerDomain = "polygonscan.com", + TestnetExplorerDomain = "mumbai.polygonscan.com", + MainnetExplorerApiUrl = "https://api.polygonscan.com", + TestnetExplorerApiUrl= "https://api-testnet.polygonscan.com", + }; + + AVALANCHE = new ChainInformation + { + Title = "Avalanche", + Symbol = "AVAX", + MainnetContractAddress = "your smart contract address", + TestnetContractAddress = "your smart contract address", + MainnetRpcUrl = "https://api.avax.network/ext/bc/C/rpc", + TestnetRpcUrl = "https://api.avax-test.network/ext/bc/C/rpc", + MainnetExplorerDomain = "snowtrace.io", + TestnetExplorerDomain = "testnet.snowtrace.io", + MainnetExplorerApiUrl = "https://api.snowtrace.io/", + TestnetExplorerApiUrl = "https://api-testnet.snowtrace.io/" + }; + BLT = new ContractInformation + { + MainnetContractAddress = "0xfB0727386DB1A630344a08467b45541bEC9bCf17", + TestnetContractAddress = "0xfB0727386DB1A630344a08467b45541bEC9bCf17", + }; + } + + public static ChainInformation ETHEREUM { get; set; } + + public static ChainInformation BNB_CHAIN { get; set; } + + public static ChainInformation POLYGON { get; set; } + + public static ChainInformation AVALANCHE { get; set; } + + public static ContractInformation BLT { get; set; } + } +} \ No newline at end of file