Class: PricerCache

lib/cache_management/pricer_cache~ PricerCache


new PricerCache(chainId, contractAddress)

constructor
Parameters:
Name Type Description
chainId string Chain id
contractAddress string address of pricer/airdrop contract

Methods


clearAcceptedMargins(currency)

reset accepted margin cache
Parameters:
Name Type Description
currency string currency
Returns:
Type
promise.<result>

clearBrandedTokenAddress(brandedTokenAddress)

clear branded token address cache
Parameters:
Name Type Description
brandedTokenAddress string branded token address
Returns:
Type
promise.<result>

clearCache(key)

Clear cache for given key
Parameters:
Name Type Description
key string cache key
Returns:
Type
promise.<result>

clearConversionRate()

Clear conversion rate from cache
Returns:
Type
promise.<result>

clearConversionRateDecimals()

Clear conversion rate decimals from cache
Returns:
Type
promise.<result>

clearDecimals()

clear decimals from cache
Returns:
Type
promise.<result>

clearPriceOracles(currency, address)

Clear price oracle address for given currency in cache
Parameters:
Name Type Description
currency string currency
address string price oracle address
Returns:
Type
promise.<result>

clearPricePoint(address)

Clear price point of price oracle from cache
Parameters:
Name Type Description
address string price oracle address
Returns:
Type
promise.<result>

getAcceptedMargins(currency)

Get accepted margin
Parameters:
Name Type Description
currency string currency
Returns:
Type
promise.<result>

getBrandedTokenAddress()

Get branded token address for pricer
Returns:
Type
promise.<result>

getCacheKey(owner)

Get conversion rate for pricer
Parameters:
Name Type Description
owner string address of user whose balance is to be found
Returns:
Type
promise.<result>

getCacheValue(key)

Get cached value
Parameters:
Name Type Description
key string key
Returns:
Type
promise.<result>

getConversionRate()

Get conversion rate for pricer
Returns:
Type
promise.<result>

getConversionRateDecimals()

Get conversion rate decimals for pricer
Returns:
Type
promise.<result>

getDecimals()

Get decimals for pricer
Returns:
Type
promise.<result>

getPriceOracles(currency)

Get price oracle address for given currency from cache
Parameters:
Name Type Description
currency string currency
Returns:
Type
promise.<result>

getPricePoint(address)

Get price point of price oracle from cache
Parameters:
Name Type Description
address string price oracle address
Returns:
Type
promise.<result>

setAcceptedMargins(currency, margin)

Set accepted margin
Parameters:
Name Type Description
currency string currency
margin BigNumber accepted margin value
Returns:
Type
promise.<result>

setBrandedTokenAddress(brandedTokenAddress)

Set branded token address for pricer
Parameters:
Name Type Description
brandedTokenAddress string branded token address
Returns:
Type
promise.<result>

setCacheValue(key, value)

Set value in cache
Parameters:
Name Type Description
key string key
value string value
Returns:
Type
promise.<result>

setConversionRate(conversionRate)

Set conversion rate to cache
Parameters:
Name Type Description
conversionRate BigNumber conversion rate of pricer/airdrop
Returns:
Type
promise.<result>

setConversionRateDecimals(conversionRateDecimals)

Set conversion rate decimals to cache
Parameters:
Name Type Description
conversionRateDecimals BigNumber conversion rate of pricer/airdrop
Returns:
Type
promise.<result>

setDecimals(conversionRateDecimals)

Set decimals to cache
Parameters:
Name Type Description
conversionRateDecimals BigNumber conversion rate of pricer/airdrop
Returns:
Type
promise.<result>

setPriceOracles(currency, address)

Set price oracle address for given currency in cache
Parameters:
Name Type Description
currency string currency
address string price oracle address
Returns:
Type
promise.<result>

setPricePoint(pricePoint, address)

Set price point of price oracle from cache
Parameters:
Name Type Description
pricePoint string price oracle price point
address string price oracle address
Returns:
Type
promise.<result>