Created
January 11, 2022 01:51
-
-
Save adamwhitakerwilson/ab534e847e0521c960c0e1e6895e7b66 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.covalenthq.scout.utils; | |
import java.io.IOException; | |
/* | |
** Markdown Version of API v1 docs converted | |
to a string for OpenApi Swaggar Documentation Description. | |
*/ | |
public class OpenAPIData { | |
// pagination, | |
public final String intro, changelog; | |
private final static String _SIGNED_AT = "The signed time of the block."; | |
public static class UseCases { | |
public static final String WALLET = "wallet", | |
TAX = "tax", DASHBOARD = "dashboard"; | |
} | |
public static class Tags { | |
public static final String CLASS_A_ENDPOINTS = "Class A", | |
CLASS_B_ENDPOINTS = "Class B", | |
BY_PRICE = "Pricing endpoints"; | |
public static final String UNISWAP_ENDPOINTS = "uniswap", | |
UNISWAP_ENDPOINTS_DESC = "Uniswap is a fully decentralized protocol for automated liquidity provision on Ethereum. Uniswap is now accessible on XY=K.", | |
SUSHISWAP_ENDPOINTS = "sushiswap", | |
SUSHISWAP_ENDPOINTS_DESC = "Sushi is the home of DeFi. Our community is building a comprehensive, decentralized trading platform for the future of finance.", | |
PANCAKESWAP_ENDPOINTS = "pancakeswap", | |
PANCAKESWAP_ENDPOINTS_DESC = "Trade, earn, and win crypto on the most popular decentralized platform in the galaxy. PancakeSwap is now accessible on XY=K.", | |
XYK_ENDPOINTS = "xy=k", | |
XYK_ENDPOINTS_DESC = "xy=k is a generalized Uniswap-like endpoints for exchanges on various chains.", | |
AAVE_ENDPOINTS = "aave", | |
AAVE_ENDPOINTS_DESC = "Aave is an Open Source and Non-Custodial protocol to earn interest on deposits and borrow assets.", | |
COMPOUND_ENDPOINTS = "compound", | |
COMPOUND_ENDPOINTS_DESC = "Compound is an algorithmic, autonomous interest rate protocol built for developers, to unlock a universe of open financial applications.", | |
CURVE_ENDPOINTS = "curve", | |
CURVE_ENDPOINTS_DESC = "Curve is an exchange liquidity pool on Ethereum designed for: extremely efficient stablecoin trading, low risk, supplemental fee income for liquidity providers.", | |
BALANCER_ENDPOINTS = "balancer", | |
BALANCER_ENDPOINTS_DESC = "Balancer is an automated portfolio manager and trading platform."; | |
} | |
public static class ErrorMessages { | |
public static final String PAGINATION_NEG_BOUNDS = "is negative. Please check your parameters and try again.", | |
TOO_LARGE_INDICES = "Something's wrong with your pagination. Please check your page number\" +\n" + | |
" \"or your page size.", | |
CHAIN_ID_MISSING = "Missing/Unavailable chain ID. Please check your path parameter.", | |
INVALID_QUERY_STRING = "Invalid query: "; | |
} | |
public static class Descriptions { | |
public static final String PAGE_NUMBER = "The specific page to be returned.", | |
PAGE_SIZE = "The number of results per page.", | |
STARTING_BLOCK = "Starting block to define a block range.", | |
ENDING_BLOCK = "Ending block to define a block range.", | |
ENDING_BLOCK_LATEST = "Ending block to define a block range. Passing in `latest` uses the latest block height.", | |
CHAIN_NAME = "The name of the Blockchain", | |
CHAIN_ID = "Chain ID of the Blockchain being queried. Currently supports `1` for Ethereum Mainnet, `137` for Polygon/Matic Mainnet, `80001` for Polygon/Matic Mumbai Testnet, `56` for Binance Smart Chain, `43114` for Avalanche C-Chain Mainnet, `43113` for Fuji C-Chain Testnet, and `250` for Fantom Opera Mainnet.", | |
CHAIN_ID_2 = "Chain ID of the Blockchain being queried. Supports `56` for BSC Mainnet and `137` for Polygon/Matic Mainnet, `43114` for Avalanche C-Chain Mainnet, `43113` for Fuji C-Chain Testnet, and `250` for Fantom Opera Mainnet.", | |
CONTRACT_DECIMALS = "Smart contract decimals.", | |
CONTRACT_NAME = "Smart contract name.", | |
CONTRACT_TICKER_SYMBOL = "Smart contract ticker symbol.", | |
CONTRACT_ADDRESS = "Smart contract address.", | |
CONTRACT_ADDRESSES = "Smart contract address(es).", | |
CONTRACT_LOGO_URL = "Smart contract URL.", | |
QUOTE = "The current balance converted to fiat in `quote-currency`.", | |
QUOTE_24 = "The current balance converted to fiat in `quote-currency` as of 24 hours ago.", | |
QUOTE_RATE = "The current spot exchange rate in `quote-currency`.", | |
QUOTE_RATE_24 = "The spot exchange rate in `quote-currency` as of 24 hours ago.", | |
ENS_RESOLVES = "Passing in an `ENS` resolves automatically.", | |
DAYS = "The range of the historical portfolio in days, defaults to 30 days (max days = 2000).", | |
DEXNAMES = "One of `sushiswap`, `pancakeswap`, `quickswap`, `pangolin`, `spiritswap`, `spookyswap`.", | |
RESPONSE_FORMAT = "If `format=csv`, return a flat CSV instead of JSON responses.", | |
REFRESH_REAL_TIME = "<span id=\"refresh-rate\" class=\"label label-primary label-xsmall\" style=\"vertical-align:super; font-size:x-small; background-color:#0098db;\">real-time</span>", | |
REFRESH_BATCH = "<span id=\"refresh-rate\" class=\"label label-primary label-xsmall\" style=\"vertical-align:super; font-size:x-small; background-color:#0098db;\">batch</span>", | |
CONTRACT_BALANCE = "Current balance.", | |
TOTAL_SUPPLY = "Total supply of this pool token.", | |
BLOCK_SIGNED_AT = _SIGNED_AT, | |
BLOCK_HEIGHT = "The height of the block.", | |
TX_HASH = "The transaction hash.", | |
TOPIC_HASH = "Topic hash value from log records.", | |
TX_OFFSET = "The transaction offset.", | |
STATUS = "The transaction status.", | |
FROM_ADDRESS_LABEL = "The label of `from` address.", | |
TO_ADDRESS_LABEL = "The label of `to` address.", | |
TYPE = "One of `cryptocurrency`, `stablecoin`, `nft` or `dust`.", example = "dust", | |
BALANCE = "The asset balance. Use `contract_decimals` to scale this balance for display purposes.", | |
BALANCE_24 = "The asset balance 24 hours ago.", | |
SUPPORTS_ERC = "The standard interface(s) supported for this token, eg: `ERC-20`.", | |
ITEMS = "", | |
GEN_ITEMS = "", | |
PAGINATION = "", | |
NFT_DATA = "Array of NFTs that are held under this contract.", | |
SWAPS = "Get additional insight on swap event data related to this address, default: `false`", | |
SECONDARY_TOPICS = "Additional topic hash(es) to filter on -- padded & unpadded address fields are supported.", | |
FACTORY_ADDRESS = "The address of the deployed UniswapV2 like factory contract for this DEX.", | |
ROUTER_ADDRESS = "The address of the deployed UniswapV2 like router contract for this DEX.", | |
SWAP_FEE = "The swapping fee for this UniswapV2 like DEX.", | |
DEX_NAME = "The name of this UniswapV2 like DEX."; | |
} | |
public static class TransferDescription { | |
public static final String TRANSFER_FROM_ADDRESS = "The address where the transfer is from.", | |
TRANSFER_TO_ADDRESS = "The address where the transfer is to.", | |
DELTA = "The delta attached to this transfer.", | |
TRANSFER_BALANCE = "The transfer balance. Use `contract_decimals` to scale this balance for display purposes.", | |
TRANSFER_TYPE = "IN/OUT.", | |
DELTA_QUOTE = "The current delta converted to fiat in `quote-currency`.", | |
BALANCE_QUOTE = "The current balance converted to fiat in `quote-currency`.", | |
TRANSFERS = "Transfer items.", | |
METHOD = "Type of ", | |
METHOD_CALL = "Additional details on which transfer events were invoked. Defaults to `true`.", | |
LAST_TRANSFERRED_AT = "Last transferred date for a wallet"; | |
} | |
public static class TxnDescription { | |
public static final String TXN_FROM_ADDRESS = "The address where the transaction is from.", | |
TXN_TO_ADDRESS = "The address where the transaction is to.", | |
VALUE = "The value attached to this tx.", | |
VALUE_QUOTE = "The value attached in `quote-currency` to this tx.", | |
TXN_ITEMS = "The transactions.", | |
GAS_OFFER = "The gas offered for this tx.", | |
GAS_SPENT = "The gas spent for this tx.", | |
GAS_PRICE = "The gas price at the time of this tx.", | |
GAS_QUOTE = "The gas spent in `quote-currency` denomination.", | |
GAS_QUOTE_RATE = "Historical ETH price at the time of tx."; | |
} | |
public static class LogDescription { | |
public static final String LOG_OFFSET = "The log offset.", | |
RAW_LOG_TOPICS = "The log topics in raw data.", | |
SENDER_ADDRESS = "The address of the sender.", | |
SENDER_ADDRESS_LABEL = "The label of the sender address.", | |
RAW_LOG_DATA = "The log events in raw.", | |
LOG_EVENTS = "The log events.", | |
DECODED = "The decoded item.", | |
DECODED_NAME = "The name of the decoded item.", | |
DECODED_SIGNATURE = "The signature of the decoded item.", | |
PARAMETER = "The parameters of the decoded item.", | |
PARAMETER_NAME = "The name of the parameter.", | |
PARAMETER_TYPE = "The type of the parameter.", | |
PARAMETER_INDEX = "The index of the parameter.", | |
PARAMETER_DECODED = "The decoded value of the parameter.", | |
PARAMETER_VALUE = "The value of the parameter."; | |
} | |
public static class balanceDescription { | |
public static final String ADDRESS = "The requested wallet address.", | |
UPDATED_AT = "The updated time.", | |
NEXT_UPDATED_AT = "The next updated time.", | |
QUOTE_CURRENCY = "The requested fiat currency.", | |
CHAIN_ID = "The requested chain ID."; | |
} | |
public static class blockDescription { | |
public static final String SIGNED_AT = _SIGNED_AT, | |
HEIGHT = "The height of the block."; | |
} | |
public static class registerDescription { | |
public static final String ADDRESS_REGISTERED = "The registered address.", | |
ADDRESS_RESOLVED = "The resolved address."; | |
} | |
public static class tokenDescription { | |
public static final String ADDRESS = "The address of token holder.", | |
BALANCE = "The balance of token holder.", | |
SUPPLY = "The total supply of the token.", | |
TOKEN_HOLDER = "The token holder.", | |
PREV_BALANCE = "The starting block balance.", | |
PREV_BLOCK_HEIGHT = "The starting block height.", | |
NEXT_BALANCE = "The ending block balance.", | |
NEXT_BLOCK_HEIGHT = "The ending block height.", | |
DIFF = "The difference of the balance."; | |
} | |
public static class primerDescription { | |
public static final String PRIMER = "Records enter a multi-stage pipeline that transforms the records into aggregated results. Supports $group and Aggregation operators.", | |
MATCH = "Filters the records to pass only the documents that match the specified condition(s).", | |
GROUP = "Groups input elements by the specified id expression and for each distinct grouping, outputs an element. Grouping by _date operators is also possible.", | |
SORT = "Sorts all input records and returns them in ascending or descending sorted order.", | |
SKIP = "Skips over the specified number of records.", | |
LIMIT = "Limits the number of records."; | |
} | |
public static class genericChainInfoDescription { | |
public static final String IS_ENABLED = "Status of the chain", | |
NAME = "Name of chain", | |
_CHAIN_ID = Descriptions.CHAIN_ID, | |
METRIC_LABEL = "Label name of metric"; | |
} | |
public static class NFTMarketCapDescription { | |
public static final String VOLUME_ETH_24H = "Volume of sales within the last 24H in ETH.", | |
VOLUME_WEI_24H = "Volume of sales within the last 24H in WEI.", | |
VOLUME_QUOTE_24H = "Volume of sales within the last 24H in quote currency.", | |
AVERAGE_VOLUME_ETH_24H = "Average volume of sales within last 24H in ETH.", | |
AVERAGE_VOLUME_WEI_24H = "Average volume of sales within last 24H in WEI.", | |
AVERAGE_VOLUME_QUOTE_24H = "Average volume of sales within last 24H in quote currency.", | |
DT = "Recorded date of sale.", | |
VOLUME_ETH_DAY = "Volume of sale within that day in ETH.", | |
VOLUME_WEI_DAY = "Volume of sale within that day in WEI.", | |
VOLUME_QUOTE_DAY = "Volume of sale within that day in quote currency.", | |
AVERAGE_VOLUME_ETH_DAY = "Average volume of sale within that day in ETH.", | |
AVERAGE_VOLUME_WEI_DAY = "Average volume of sale within that day in WEI.", | |
AVERAGE_VOLUME_QUOTE_DAY = "Average volume of sale within that day in quote currency.", | |
TOKEN_IDS_SOLD = "Amount of distinct token ids sold.", | |
CONTRACT_DEPLOYMENT_AT = "Contract deployment date.", | |
MARKET_CAP_ETH = "Market Cap in ETH.", | |
MARKET_CAP_WEI = "Market Cap in WEI.", | |
MARKET_CAP_QUOTE = "Market Cap in quote currency.", | |
FLOOR_PRICE_ETH = "The minimum average sale within the last 7 days defined as floor price in ETH.", | |
FLOOR_PRICE_WEI = "The minimum average sale within the last 7 days defined as floor price in WEI.", | |
FLOOR_PRICE_QUOTE = "The minimum average sale within the last 7 days defined as floor price in quote currency.", | |
MAX_PRICE_ETH = "The max price recorded as a sale in ETH.", | |
MAX_PRICE_WEI = "The max price recorded as a sale in WEI.", | |
MAX_PRICE_QUOTE = "The max price recorded as a sale in quote currency.", | |
NUMBER_OF_TRANSACTIONS = "Number of transactions for this collection.", | |
NUMBER_OF_WALLETS = "Number of wallets for this collection.", | |
DATE = "Date recorded for Market Cap."; | |
} | |
public OpenAPIData() throws IOException { | |
this.intro = StaticResource.getRaw("/docs/intro.md"); | |
//this.pagination = StaticResource.getAsString("/docs/pagination.md"); | |
this.changelog = StaticResource.getRaw("/docs/changelog.md"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment