@widolabs/collateral-swap-sdk
Version:
TypeScript SDK for interacting with the Wido protocol to allow collateral swaps on Compound Comet.
44 lines (43 loc) • 1.34 kB
TypeScript
/**
* Implementation has been copied from
* https://github.com/samuraitruong/coingecko-api-v3/blob/main/src/CoinGeckoClient.ts
* and hugely simplified,
*
* because the current released version is hardcoded to only support "ethereum" chain,
* and that project takes forever to accept PRs.
*
* If eventually support for all chains is added, we can simply remove all the private function
* in this class and use `coingecko-api-v3`
*/
export interface TokenPriceResponse {
/**
* ETH contract address same with the input pair
*/
[contract_address: string]: {
/**
* price of coin for this currency
*/
[currency: string]: number;
};
}
export declare abstract class CoingeckoApiBaseClient {
private static readonly API_V3_URL;
protected getPlatform(chainId: number): string;
simpleTokenPrice(input: {
id: string;
contract_addresses: string;
vs_currencies: string;
include_market_cap?: boolean;
include_24hr_vol?: boolean;
include_24hr_change?: boolean;
include_last_updated_at?: boolean;
}): Promise<TokenPriceResponse>;
/**
* Generic function to make request use in internal function
* @param action
* @param params
* @returns
*/
private makeRequest;
private withPathParams;
}