CryptoScraper is a package for generalizing the retrieval of information from crypto block chains.
CryptoScraper supports the Swift Package Manager. To include CryptoScraper in your project add the following to your Package.swift file:
.package(url: "[email protected]:foscomputerservices/CryptoScraper.git", branch: "main"),
To begin, api keys need to be set in order to access various services. These keys are stored in environment variables as follows:
Service | Environment Variable | Required |
---|---|---|
Etherscan | ETHER_SCAN_KEY | No |
Fantom | FTM_SCAN_KEY | No |
BinanceSmartChain | BSC_SCAN_KEY | No |
Polygon | POLYGON_SCAN_KEY | No |
Optimism | OPTIMISTIC_ETHER_SCAN_KEY | No |
CoinGecko | COIN_GECKO_KEY | No |
CoinMarketCap | COIN_MARKETCAP_KEY | No |
To begin using the framework call the initialization method to initialize the block chains with their contract data.
try await CryptoScraper.initialize()
In order for testing to succeed, a test contract is needed for each chain. These contracts can be provided in the environment as follows:
Service | Environment Variable |
---|---|
Bitcoin | BTC_TEST_CONTRACT_ADDRESS |
Ethereum | ETH_TEST_CONTRACT_ADDRESS |
Fantom | FTM_TEST_CONTRACT_ADDRESS |
BNB | BSC_TEST_CONTRACT_ADDRESS |
Matic | POLYGON_TEST_CONTRACT_ADDRESS |
Optimism | OPTIMISTIC_TEST_CONTRACT_ADDRESS |
Tron | TRON_TEST_CONTRACT_ADDRESS |
For complete documentation, please refer to the DocC documentation in Xcode or here for an online version (see the documentation tab in the top-right).
All contributions are welcome! Please see CONTRIBUTING.md for more details.
This project is maintained by David Hunt owner of FOS Computer services, LLC.
CryptoScraper is under the MIT License. See the LICENSE file for more information.