Oracle

API

class terra_sdk.client.lcd.api.oracle.OracleAPI(c)[source]
active_denoms()[source]

Fetches current active denoms.

Returns

active denoms

Return type

List[str]

aggregate_prevote(validator)[source]

Fetches active aggregate prevote for a validator.

Parameters

validator (ValAddress) – validator operator address

Returns

current aggegate prevote (if any).

Return type

Optional[AggregateExchangeRatePrevote]

aggregate_vote(validator)[source]

Fetches active aggregate vote for a validator.

Parameters

validator (ValAddress) – validator operator address

Returns

current aggegate vote (if any).

Return type

Optional[AggregateExchangeRatePrevote]

exchange_rate(denom)[source]

Fetches registered exchange rate of Luna in a specific denom.

Parameters

denom (str) – denom

Returns

exchange rate of Luna

Return type

Coin

exchange_rates()[source]

Fetches registered exchange rates of Luna in all available denoms.

Returns

exchange rates of Luna

Return type

Coins

feeder_address(validator)[source]

Fetches current active denoms.

Returns

active denoms

Return type

List[str]

misses(validator)[source]

Fetches current value of miss counter for a validator.

Parameters

validator (ValAddress) – validator operator address

Returns

current number of misses

Return type

int

parameters()[source]

Fetches Oracle module parameters.

Returns

Oracle module parameters

Return type

dict

Data

Oracle module data objects.

class terra_sdk.core.oracle.data.AggregateExchangeRatePrevote(hash, voter, submit_block)[source]

Contains information about a validator’s aggregate prevote.

hash: str

Aggregate vote hash for the upcoming aggregate vote.

submit_block: int

Block height at which the aggregate prevote was submitted.

to_data()[source]

Converts the object to its JSON-serializable Python data representation.

Return type

dict

voter: ValAddress

Validator that submitted the aggregate prevote.

class terra_sdk.core.oracle.data.AggregateExchangeRateVote(exchange_rate_tuples, voter)[source]

Contains information about a validator’s aggregate vote.

exchange_rate_tuples: terra_sdk.core.coins.Coins

Reported exchange rates by validator.

to_data()[source]

Converts the object to its JSON-serializable Python data representation.

Return type

dict

voter: ValAddress

Validator that sent the aggregate vote.

Functions

terra_sdk.core.oracle.msgs.vote_hash(denom, exchange_rate, salt, validator)[source]

Calculates vote hash for submitting MsgExchangeRatePrevote.

Parameters
  • denom (str) – denom to vote for

  • exchange_rate (Dec) – exchange rate of LUNA

  • salt (str) – salt

  • validator (str) – validator operator address

Returns

vote hash

Return type

str

terra_sdk.core.oracle.msgs.aggregate_vote_hash(salt, exchange_rates, validator)[source]

Calculates aggregate vote hash for submitting MsgAggregateExchangeRatePrevote.

Parameters
  • salt (str) – salt

  • exchange_rates (Coins.Input) – exchange rates in various denominations

  • validator (str) – validator operator address

Returns

aggregate vote hash

Return type

str

Messages

Oracle module messages.

class terra_sdk.core.oracle.msgs.MsgAggregateExchangeRatePrevote(hash, feeder, validator)[source]

Submit an aggregate vote for the current vote period.

Parameters
  • hash (str) – aggregate vote hash

  • feeder (NewType()(AccAddress, str)) – account submitting the aggregate prevote

  • validator (NewType()(ValAddress, str)) – validator to which the aggregate prevote corresponds

type_amino = 'oracle/MsgAggregateExchangeRatePrevote'
type_url: str = '/terra.oracle.v1beta1.MsgAggregateExchangeRatePrevote'
class terra_sdk.core.oracle.msgs.MsgAggregateExchangeRateVote(exchange_rates, salt, feeder, validator)[source]

Submit an aggregate prevote for the current vote.

Parameters
  • exchange_rates (Coins.Input) – exchange rates to use

  • salt (str) – aggregate vote salt

  • feeder (AccAddress) – feeder account submitting aggregate prevote

  • validator (ValAddress) – validator vote corresponds to

get_aggregate_prevote()[source]

Generates the associated MsgAggregateExchangeRatePrevote object with the correct prepopulated fields.

Returns

associated aggregate prevote

Return type

MsgAggregateExchangeRatePrevote

get_aggregate_vote_hash()[source]

Vote hash required for message’s associated prevote.

Returns

aggregate vote hash

Return type

str

to_data()[source]

Converts the object to its JSON-serializable Python data representation.

Return type

dict

type_amino = 'oracle/MsgAggregateExchangeRateVote'
type_url: str = '/terra.oracle.v1beta1.MsgAggregateExchangeRateVote'
class terra_sdk.core.oracle.msgs.MsgDelegateFeedConsent(operator, delegate)[source]

Re-assign oracle feeder account for a validator.

Parameters
  • operator (NewType()(ValAddress, str)) – validator to change feeder for

  • delegate (NewType()(AccAddress, str)) – new feeder address

action = 'delegatefeeder'
type_amino = 'oracle/MsgDelegateFeedConsent'
type_url: str = '/terra.oracle.v1beta1.MsgDelegateFeedConsent'