GetAllCurrencyPairs
: Returns all of the currently supported asset pairsGetPrice
: Returns the price of a single asset pairGetPrices
: Returns the price of multiple asset pairspackages
folder found in the wasm-connect-query contract repository into your own project. This folder contains the necessary files and definitions to make the queries from your own contracts.
See here for an example contract that integrated the queries.
The way that you use each query and the response structure returned from each is then outlined below.
GetAllCurrencyPairsResponse
and is in the following form:
Example Response
base
and quote
, which represent the base and quote asset symbol strings of the asset pair you want to query. Note that the base
and quote
pair must be supported by Connect and be included in the GetAllCurrencyPairsResponse
. For example, “BTC” and “USD” is a valid pair, but “BTC” and “AAVE” is not.
Example Usage (Simplified)
GetPrice
, the pair IDs are not an object symbol, but instead a single string in the format {base}/{quote}
. For example, BTC/USD
or ETH/USD
.
Example Usage (Simplified)