diff --git a/CHANGELOG.md b/CHANGELOG.md index 884cc7e67..9467ff398 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,11 +50,12 @@ Zenith](https://code4rena.com/zenith) Audit, running from 2024-10-07 until period. This section describes code changes that occured after that audit in preparation for a second audit starting in November 2024. -- [#2074](https://github.com/NibiruChain/nibiru/pull/2074) - fix(evm-keeper): better utilize ERC20 metadata during FunToken creation. The bank metadata for a new FunToken mapping ties a connection between the Bank Coin's `DenomUnit` and the ERC20 contract metadata like the name, decimals, and symbol. This change brings parity between EVM wallets, such as MetaMask, and Interchain wallets like Keplr and Leap. +- [#2068](https://github.com/NibiruChain/nibiru/pull/2068) - feat: enable wasm light clients on IBC (08-wasm) +- [#2074](https://github.com/NibiruChain/nibiru/pull/2074) - fix(evm-keeper): better utilize ERC20 metadata during FunToken creation. The bank metadata for a new FunToken mapping ties a connection between the Bank Coin's `DenomUnit` and the ERC20 contract metadata like the name, decimals, and symbol. This change brings parity between EVM wallets, such as MetaMask, and Interchain wallets like Keplr and Leap. - [#2076](https://github.com/NibiruChain/nibiru/pull/2076) - fix(evm-gas-fees): -Use effective gas price in RefundGas and make sure that units are properly -reflected on all occurences of "base fee" in the codebase. This fixes [#2059](https://github.com/NibiruChain/nibiru/issues/2059) -and the [related comments from @Unique-Divine and @berndartmueller](https://github.com/NibiruChain/nibiru/issues/2059#issuecomment-2408625724). + Use effective gas price in RefundGas and make sure that units are properly + reflected on all occurences of "base fee" in the codebase. This fixes [#2059](https://github.com/NibiruChain/nibiru/issues/2059) + and the [related comments from @Unique-Divine and @berndartmueller](https://github.com/NibiruChain/nibiru/issues/2059#issuecomment-2408625724). - [#2084](https://github.com/NibiruChain/nibiru/pull/2084) - feat(evm-forge): foundry support and template for Nibiru EVM develoment - [#2086](https://github.com/NibiruChain/nibiru/pull/2086) - fix(evm-precomples): Fix state consistency in precompile execution by ensuring proper journaling of @@ -92,11 +93,13 @@ balance changes in wei as journal changes automatically. This guarantees that commits and reversions of the `StateDB` do not misalign with the state of the Bank module. This code change uses the `NibiruBankKeeper` on all modules that depend on x/bank, such as the EVM and Wasm modules. +- [#2097](https://github.com/NibiruChain/nibiru/pull/2097) - feat(evm): Add new query to get dated price from the oracle precompile - [#2098](https://github.com/NibiruChain/nibiru/pull/2098) - test(evm): statedb tests for race conditions within funtoken precompile -- [#2068](https://github.com/NibiruChain/nibiru/pull/2068) - feat: enable wasm light clients on IBC (08-wasm) +- [#2100](https://github.com/NibiruChain/nibiru/pull/2100) - refactor: cleanup statedb and precompile sections - [#2101](https://github.com/NibiruChain/nibiru/pull/2101) - fix(evm): tx receipt proper marshalling + #### Nibiru EVM | Before Audit 1 - 2024-10-18 - [#1837](https://github.com/NibiruChain/nibiru/pull/1837) - feat(eth): protos, eth types, and evm module types @@ -175,7 +178,6 @@ tests for race conditions within funtoken precompile - [#2060](https://github.com/NibiruChain/nibiru/pull/2060) - fix(evm-precompiles): add assertNumArgs validation - [#2056](https://github.com/NibiruChain/nibiru/pull/2056) - feat(evm): add oracle precompile - [#2065](https://github.com/NibiruChain/nibiru/pull/2065) - refactor(evm)!: Refactor out dead code from the evm.Params -- [#2100](https://github.com/NibiruChain/nibiru/pull/2100) - refactor: cleanup statedb and precompile sections ### State Machine Breaking (Other) diff --git a/app/wasmext/stargate_query.go b/app/wasmext/stargate_query.go index 2d90b6d58..bd1567175 100644 --- a/app/wasmext/stargate_query.go +++ b/app/wasmext/stargate_query.go @@ -120,6 +120,7 @@ func WasmAcceptedStargateQueries() wasmkeeper.AcceptedStargateQueries { // nibiru oracle "/nibiru.oracle.v1.Query/ExchangeRate": new(oracle.QueryExchangeRateResponse), + "/nibiru.oracle.v1.Query/DatedExchangeRate": new(oracle.QueryDatedExchangeRateResponse), "/nibiru.oracle.v1.Query/ExchangeRateTwap": new(oracle.QueryExchangeRateResponse), "/nibiru.oracle.v1.Query/ExchangeRates": new(oracle.QueryExchangeRatesResponse), "/nibiru.oracle.v1.Query/Actives": new(oracle.QueryActivesResponse), diff --git a/proto/nibiru/oracle/v1/query.proto b/proto/nibiru/oracle/v1/query.proto index 62e1f40be..3be464a1a 100644 --- a/proto/nibiru/oracle/v1/query.proto +++ b/proto/nibiru/oracle/v1/query.proto @@ -22,6 +22,12 @@ service Query { option (google.api.http).get = "/nibiru/oracle/v1beta1/exchange_rate_twap"; } + // DatedExchangeRate returns latest price of a pair + rpc DatedExchangeRate(QueryExchangeRateRequest) + returns (QueryDatedExchangeRateResponse) { + option (google.api.http).get = "/nibiru/oracle/v1beta1/dated_exchange_rate"; + } + // ExchangeRates returns exchange rates of all pairs rpc ExchangeRates(QueryExchangeRatesRequest) returns (QueryExchangeRatesResponse) { @@ -112,7 +118,25 @@ message QueryExchangeRateResponse { // QueryExchangeRatesRequest is the request type for the Query/ExchangeRates RPC // method. -message QueryExchangeRatesRequest {} +message QueryExchangeRatesRequest { +} + +// QueryDatedExchangeRateResponse is the request type for the +// Query/DatedExchangeRate RPC method. +message QueryDatedExchangeRateResponse { + string price = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + + // Block timestamp for the block where the oracle came to consensus for this + // price. This timestamp is a conventional Unix millisecond time, i.e. the + // number of milliseconds elapsed since January 1, 1970 UTC. + int64 block_timestamp_ms = 2; + + // Block height when the oracle came to consensus for this price. + uint64 block_height = 3; +} // QueryExchangeRatesResponse is response type for the // Query/ExchangeRates RPC method. diff --git a/x/evm/embeds/artifacts/contracts/IOracle.sol/IOracle.json b/x/evm/embeds/artifacts/contracts/IOracle.sol/IOracle.json index 39638bdae..887d9433c 100644 --- a/x/evm/embeds/artifacts/contracts/IOracle.sol/IOracle.json +++ b/x/evm/embeds/artifacts/contracts/IOracle.sol/IOracle.json @@ -14,9 +14,19 @@ "name": "queryExchangeRate", "outputs": [ { - "internalType": "string", - "name": "", - "type": "string" + "internalType": "uint256", + "name": "price", + "type": "uint256" + }, + { + "internalType": "uint64", + "name": "blockTimeMs", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "blockHeight", + "type": "uint64" } ], "stateMutability": "view", diff --git a/x/evm/embeds/contracts/IOracle.sol b/x/evm/embeds/contracts/IOracle.sol index 7cb0a820a..393584f6f 100644 --- a/x/evm/embeds/contracts/IOracle.sol +++ b/x/evm/embeds/contracts/IOracle.sol @@ -3,12 +3,20 @@ pragma solidity >=0.8.19; /// @notice Oracle interface for querying exchange rates interface IOracle { - /// @notice Queries the exchange rate for a given pair - /// @param pair The asset pair to query. For example, "ubtc:uusd" is the - /// USD price of BTC and "unibi:uusd" is the USD price of NIBI. - /// @return The exchange rate (a decimal value) as a string. - /// @dev This function is view-only and does not modify state. - function queryExchangeRate(string memory pair) external view returns (string memory); + /// @notice Queries the dated exchange rate for a given pair + /// @param pair The asset pair to query. For example, "ubtc:uusd" is the + /// USD price of BTC and "unibi:uusd" is the USD price of NIBI. + /// @return price The exchange rate for the given pair + /// @return blockTimeMs The block time in milliseconds when the price was + /// last updated + /// @return blockHeight The block height when the price was last updated + /// @dev This function is view-only and does not modify state. + function queryExchangeRate( + string memory pair + ) + external + view + returns (uint256 price, uint64 blockTimeMs, uint64 blockHeight); } address constant ORACLE_PRECOMPILE_ADDRESS = 0x0000000000000000000000000000000000000801; diff --git a/x/evm/precompile/oracle.go b/x/evm/precompile/oracle.go index f59b93822..cf461a3c4 100644 --- a/x/evm/precompile/oracle.go +++ b/x/evm/precompile/oracle.go @@ -81,12 +81,12 @@ func (p precompileOracle) queryExchangeRate( return nil, err } - price, err := p.oracleKeeper.GetExchangeRate(ctx, assetPair) + price, blockTime, blockHeight, err := p.oracleKeeper.GetDatedExchangeRate(ctx, assetPair) if err != nil { return nil, err } - return method.Outputs.Pack(price.String()) + return method.Outputs.Pack(price.BigInt(), uint64(blockTime), blockHeight) } func (p precompileOracle) parseQueryExchangeRateArgs(args []any) ( diff --git a/x/evm/precompile/oracle_test.go b/x/evm/precompile/oracle_test.go index efab80118..fa07d72d6 100644 --- a/x/evm/precompile/oracle_test.go +++ b/x/evm/precompile/oracle_test.go @@ -1,7 +1,9 @@ package precompile_test import ( + "math/big" "testing" + "time" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/ethereum/go-ethereum/common" @@ -55,7 +57,9 @@ func (s *OracleSuite) TestOracle_HappyPath() { s.T().Log("Query exchange rate") { + deps.Ctx = deps.Ctx.WithBlockTime(time.Unix(69, 420)).WithBlockHeight(69) deps.App.OracleKeeper.SetPrice(deps.Ctx, "unibi:uusd", sdk.MustNewDecFromStr("0.067")) + input, err := embeds.SmartContract_Oracle.ABI.Pack("queryExchangeRate", "unibi:uusd") s.NoError(err) resp, _, err := deps.EvmKeeper.CallContractWithInput( @@ -68,7 +72,9 @@ func (s *OracleSuite) TestOracle_HappyPath() { s.NoError(err) // Check the response - s.Equal("0.067000000000000000", out[0].(string)) + s.Equal(out[0].(*big.Int), big.NewInt(67000000000000000)) + s.Equal(out[1].(uint64), uint64(69000)) + s.Equal(out[2].(uint64), uint64(69)) } } diff --git a/x/oracle/keeper/keeper.go b/x/oracle/keeper/keeper.go index 32d2b8b63..bbbf31ce9 100644 --- a/x/oracle/keeper/keeper.go +++ b/x/oracle/keeper/keeper.go @@ -187,6 +187,16 @@ func (k Keeper) GetExchangeRate(ctx sdk.Context, pair asset.Pair) (price sdk.Dec return } +func (k Keeper) GetDatedExchangeRate(ctx sdk.Context, pair asset.Pair) (price sdk.Dec, blockTimeMs int64, BlockHeight uint64, err error) { + exchangeRate, err := k.ExchangeRates.Get(ctx, pair) + if err != nil { + return + } + time := ctx.WithBlockHeight(int64(exchangeRate.CreatedBlock)).BlockTime() + + return exchangeRate.ExchangeRate, time.UnixMilli(), exchangeRate.CreatedBlock, nil +} + // SetPrice sets the price for a pair as well as the price snapshot. func (k Keeper) SetPrice(ctx sdk.Context, pair asset.Pair, price sdk.Dec) { k.ExchangeRates.Insert(ctx, pair, types.DatedPrice{ExchangeRate: price, CreatedBlock: uint64(ctx.BlockHeight())}) diff --git a/x/oracle/keeper/querier.go b/x/oracle/keeper/querier.go index 576c5c72b..6cc7fbd2b 100644 --- a/x/oracle/keeper/querier.go +++ b/x/oracle/keeper/querier.go @@ -79,6 +79,24 @@ func (q querier) ExchangeRateTwap(c context.Context, req *types.QueryExchangeRat return &types.QueryExchangeRateResponse{ExchangeRate: twap}, nil } +// get the latest price snapshot from the oracle for a pair +func (q querier) DatedExchangeRate(c context.Context, req *types.QueryExchangeRateRequest) (response *types.QueryDatedExchangeRateResponse, err error) { + if _, err = q.ExchangeRate(c, req); err != nil { + return + } + + ctx := sdk.UnwrapSDKContext(c) + price, blockTime, blockHeight, err := q.Keeper.GetDatedExchangeRate(ctx, req.Pair) + if err != nil { + return &types.QueryDatedExchangeRateResponse{}, err + } + return &types.QueryDatedExchangeRateResponse{ + Price: price, + BlockTimestampMs: blockTime, + BlockHeight: blockHeight, + }, nil +} + // ExchangeRates queries exchange rates of all pairs func (q querier) ExchangeRates(c context.Context, _ *types.QueryExchangeRatesRequest) (*types.QueryExchangeRatesResponse, error) { ctx := sdk.UnwrapSDKContext(c) diff --git a/x/oracle/keeper/querier_test.go b/x/oracle/keeper/querier_test.go index 8db8f2749..45e39ccdc 100644 --- a/x/oracle/keeper/querier_test.go +++ b/x/oracle/keeper/querier_test.go @@ -118,6 +118,111 @@ func TestQueryExchangeRateTwap(t *testing.T) { require.Equal(t, math.LegacyMustNewDecFromStr("1700"), res.ExchangeRate) } +func TestQueryDatedExchangeRate(t *testing.T) { + input := CreateTestFixture(t) + querier := NewQuerier(input.OracleKeeper) + + // Set initial block time and height + initialTime := input.Ctx.BlockTime() + initialHeight := input.Ctx.BlockHeight() + + // Pair 1: BTC/NUSD + pairBTC := asset.Registry.Pair(denoms.BTC, denoms.NUSD) + rateBTC1 := math.LegacyNewDec(1700) + rateBTC2 := math.LegacyNewDec(1800) + + // Pair 2: ETH/NUSD + pairETH := asset.Registry.Pair(denoms.ETH, denoms.NUSD) + rateETH1 := math.LegacyNewDec(100) + rateETH2 := math.LegacyNewDec(110) + + // --- Set first price for BTC/NUSD --- + input.OracleKeeper.SetPrice(input.Ctx, pairBTC, rateBTC1) + testutilevents.RequireContainsTypedEvent( + t, + input.Ctx, + &types.EventPriceUpdate{ + Pair: pairBTC.String(), + Price: rateBTC1, + TimestampMs: input.Ctx.BlockTime().UnixMilli(), + }, + ) + + // Advance time and block height + input.Ctx = input.Ctx.WithBlockTime(initialTime.Add(1 * time.Second)). + WithBlockHeight(initialHeight + 1) + + // --- Set first price for ETH/NUSD --- + input.OracleKeeper.SetPrice(input.Ctx, pairETH, rateETH1) + testutilevents.RequireContainsTypedEvent( + t, + input.Ctx, + &types.EventPriceUpdate{ + Pair: pairETH.String(), + Price: rateETH1, + TimestampMs: input.Ctx.BlockTime().UnixMilli(), + }, + ) + + // Advance time and block height + input.Ctx = input.Ctx.WithBlockTime(initialTime.Add(2 * time.Second)). + WithBlockHeight(initialHeight + 2) + + // --- Set second price for BTC/NUSD --- + input.OracleKeeper.SetPrice(input.Ctx, pairBTC, rateBTC2) + testutilevents.RequireContainsTypedEvent( + t, + input.Ctx, + &types.EventPriceUpdate{ + Pair: pairBTC.String(), + Price: rateBTC2, + TimestampMs: input.Ctx.BlockTime().UnixMilli(), + }, + ) + + // Advance time and block height + input.Ctx = input.Ctx.WithBlockTime(initialTime.Add(3 * time.Second)). + WithBlockHeight(initialHeight + 3) + + // --- Set second price for ETH/NUSD --- + input.OracleKeeper.SetPrice(input.Ctx, pairETH, rateETH2) + testutilevents.RequireContainsTypedEvent( + t, + input.Ctx, + &types.EventPriceUpdate{ + Pair: pairETH.String(), + Price: rateETH2, + TimestampMs: input.Ctx.BlockTime().UnixMilli(), + }, + ) + + // Wrap context for querying + ctx := sdk.WrapSDKContext(input.Ctx) + + // --- Query latest snapshot for BTC/NUSD --- + resBTC, err := querier.DatedExchangeRate( + ctx, + &types.QueryExchangeRateRequest{Pair: pairBTC}, + ) + require.NoError(t, err) + require.Equal(t, rateBTC2, resBTC.Price) + require.Equal(t, input.Ctx.BlockTime().UnixMilli(), resBTC.BlockTimestampMs) + + // --- Query latest snapshot for ETH/NUSD --- + resETH, err := querier.DatedExchangeRate( + ctx, + &types.QueryExchangeRateRequest{Pair: pairETH}, + ) + require.NoError(t, err) + require.Equal(t, rateETH2, resETH.Price) + require.Equal(t, input.Ctx.BlockTime().UnixMilli(), resETH.BlockTimestampMs) + + // --- Query a pair with no snapshots (should return an error) --- + pairATOM := asset.Registry.Pair(denoms.ATOM, denoms.NUSD) + _, err = querier.DatedExchangeRate(ctx, &types.QueryExchangeRateRequest{Pair: pairATOM}) + require.Error(t, err) +} + func TestCalcTwap(t *testing.T) { tests := []struct { name string diff --git a/x/oracle/types/query.pb.go b/x/oracle/types/query.pb.go index d1462c82e..4149e28c4 100644 --- a/x/oracle/types/query.pb.go +++ b/x/oracle/types/query.pb.go @@ -150,6 +150,65 @@ func (m *QueryExchangeRatesRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryExchangeRatesRequest proto.InternalMessageInfo +// QueryDatedExchangeRateResponse is the request type for the +// Query/DatedExchangeRate RPC method. +type QueryDatedExchangeRateResponse struct { + Price github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=price,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"price"` + // Block timestamp for the block where the oracle came to consensus for this + // price. This timestamp is a conventional Unix millisecond time, i.e. the + // number of milliseconds elapsed since January 1, 1970 UTC. + BlockTimestampMs int64 `protobuf:"varint,2,opt,name=block_timestamp_ms,json=blockTimestampMs,proto3" json:"block_timestamp_ms,omitempty"` + // Block height when the oracle came to consensus for this price. + BlockHeight uint64 `protobuf:"varint,3,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` +} + +func (m *QueryDatedExchangeRateResponse) Reset() { *m = QueryDatedExchangeRateResponse{} } +func (m *QueryDatedExchangeRateResponse) String() string { return proto.CompactTextString(m) } +func (*QueryDatedExchangeRateResponse) ProtoMessage() {} +func (*QueryDatedExchangeRateResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_16aef2382d1249a8, []int{3} +} +func (m *QueryDatedExchangeRateResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDatedExchangeRateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDatedExchangeRateResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryDatedExchangeRateResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDatedExchangeRateResponse.Merge(m, src) +} +func (m *QueryDatedExchangeRateResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryDatedExchangeRateResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDatedExchangeRateResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDatedExchangeRateResponse proto.InternalMessageInfo + +func (m *QueryDatedExchangeRateResponse) GetBlockTimestampMs() int64 { + if m != nil { + return m.BlockTimestampMs + } + return 0 +} + +func (m *QueryDatedExchangeRateResponse) GetBlockHeight() uint64 { + if m != nil { + return m.BlockHeight + } + return 0 +} + // QueryExchangeRatesResponse is response type for the // Query/ExchangeRates RPC method. type QueryExchangeRatesResponse struct { @@ -162,7 +221,7 @@ func (m *QueryExchangeRatesResponse) Reset() { *m = QueryExchangeRatesRe func (m *QueryExchangeRatesResponse) String() string { return proto.CompactTextString(m) } func (*QueryExchangeRatesResponse) ProtoMessage() {} func (*QueryExchangeRatesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_16aef2382d1249a8, []int{3} + return fileDescriptor_16aef2382d1249a8, []int{4} } func (m *QueryExchangeRatesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -206,7 +265,7 @@ func (m *QueryActivesRequest) Reset() { *m = QueryActivesRequest{} } func (m *QueryActivesRequest) String() string { return proto.CompactTextString(m) } func (*QueryActivesRequest) ProtoMessage() {} func (*QueryActivesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_16aef2382d1249a8, []int{4} + return fileDescriptor_16aef2382d1249a8, []int{5} } func (m *QueryActivesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -246,7 +305,7 @@ func (m *QueryActivesResponse) Reset() { *m = QueryActivesResponse{} } func (m *QueryActivesResponse) String() string { return proto.CompactTextString(m) } func (*QueryActivesResponse) ProtoMessage() {} func (*QueryActivesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_16aef2382d1249a8, []int{5} + return fileDescriptor_16aef2382d1249a8, []int{6} } func (m *QueryActivesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -284,7 +343,7 @@ func (m *QueryVoteTargetsRequest) Reset() { *m = QueryVoteTargetsRequest func (m *QueryVoteTargetsRequest) String() string { return proto.CompactTextString(m) } func (*QueryVoteTargetsRequest) ProtoMessage() {} func (*QueryVoteTargetsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_16aef2382d1249a8, []int{6} + return fileDescriptor_16aef2382d1249a8, []int{7} } func (m *QueryVoteTargetsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -325,7 +384,7 @@ func (m *QueryVoteTargetsResponse) Reset() { *m = QueryVoteTargetsRespon func (m *QueryVoteTargetsResponse) String() string { return proto.CompactTextString(m) } func (*QueryVoteTargetsResponse) ProtoMessage() {} func (*QueryVoteTargetsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_16aef2382d1249a8, []int{7} + return fileDescriptor_16aef2382d1249a8, []int{8} } func (m *QueryVoteTargetsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -365,7 +424,7 @@ func (m *QueryFeederDelegationRequest) Reset() { *m = QueryFeederDelegat func (m *QueryFeederDelegationRequest) String() string { return proto.CompactTextString(m) } func (*QueryFeederDelegationRequest) ProtoMessage() {} func (*QueryFeederDelegationRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_16aef2382d1249a8, []int{8} + return fileDescriptor_16aef2382d1249a8, []int{9} } func (m *QueryFeederDelegationRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -405,7 +464,7 @@ func (m *QueryFeederDelegationResponse) Reset() { *m = QueryFeederDelega func (m *QueryFeederDelegationResponse) String() string { return proto.CompactTextString(m) } func (*QueryFeederDelegationResponse) ProtoMessage() {} func (*QueryFeederDelegationResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_16aef2382d1249a8, []int{9} + return fileDescriptor_16aef2382d1249a8, []int{10} } func (m *QueryFeederDelegationResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -452,7 +511,7 @@ func (m *QueryMissCounterRequest) Reset() { *m = QueryMissCounterRequest func (m *QueryMissCounterRequest) String() string { return proto.CompactTextString(m) } func (*QueryMissCounterRequest) ProtoMessage() {} func (*QueryMissCounterRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_16aef2382d1249a8, []int{10} + return fileDescriptor_16aef2382d1249a8, []int{11} } func (m *QueryMissCounterRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -492,7 +551,7 @@ func (m *QueryMissCounterResponse) Reset() { *m = QueryMissCounterRespon func (m *QueryMissCounterResponse) String() string { return proto.CompactTextString(m) } func (*QueryMissCounterResponse) ProtoMessage() {} func (*QueryMissCounterResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_16aef2382d1249a8, []int{11} + return fileDescriptor_16aef2382d1249a8, []int{12} } func (m *QueryMissCounterResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -539,7 +598,7 @@ func (m *QueryAggregatePrevoteRequest) Reset() { *m = QueryAggregatePrev func (m *QueryAggregatePrevoteRequest) String() string { return proto.CompactTextString(m) } func (*QueryAggregatePrevoteRequest) ProtoMessage() {} func (*QueryAggregatePrevoteRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_16aef2382d1249a8, []int{12} + return fileDescriptor_16aef2382d1249a8, []int{13} } func (m *QueryAggregatePrevoteRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -580,7 +639,7 @@ func (m *QueryAggregatePrevoteResponse) Reset() { *m = QueryAggregatePre func (m *QueryAggregatePrevoteResponse) String() string { return proto.CompactTextString(m) } func (*QueryAggregatePrevoteResponse) ProtoMessage() {} func (*QueryAggregatePrevoteResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_16aef2382d1249a8, []int{13} + return fileDescriptor_16aef2382d1249a8, []int{14} } func (m *QueryAggregatePrevoteResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -625,7 +684,7 @@ func (m *QueryAggregatePrevotesRequest) Reset() { *m = QueryAggregatePre func (m *QueryAggregatePrevotesRequest) String() string { return proto.CompactTextString(m) } func (*QueryAggregatePrevotesRequest) ProtoMessage() {} func (*QueryAggregatePrevotesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_16aef2382d1249a8, []int{14} + return fileDescriptor_16aef2382d1249a8, []int{15} } func (m *QueryAggregatePrevotesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -666,7 +725,7 @@ func (m *QueryAggregatePrevotesResponse) Reset() { *m = QueryAggregatePr func (m *QueryAggregatePrevotesResponse) String() string { return proto.CompactTextString(m) } func (*QueryAggregatePrevotesResponse) ProtoMessage() {} func (*QueryAggregatePrevotesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_16aef2382d1249a8, []int{15} + return fileDescriptor_16aef2382d1249a8, []int{16} } func (m *QueryAggregatePrevotesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -713,7 +772,7 @@ func (m *QueryAggregateVoteRequest) Reset() { *m = QueryAggregateVoteReq func (m *QueryAggregateVoteRequest) String() string { return proto.CompactTextString(m) } func (*QueryAggregateVoteRequest) ProtoMessage() {} func (*QueryAggregateVoteRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_16aef2382d1249a8, []int{16} + return fileDescriptor_16aef2382d1249a8, []int{17} } func (m *QueryAggregateVoteRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -754,7 +813,7 @@ func (m *QueryAggregateVoteResponse) Reset() { *m = QueryAggregateVoteRe func (m *QueryAggregateVoteResponse) String() string { return proto.CompactTextString(m) } func (*QueryAggregateVoteResponse) ProtoMessage() {} func (*QueryAggregateVoteResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_16aef2382d1249a8, []int{17} + return fileDescriptor_16aef2382d1249a8, []int{18} } func (m *QueryAggregateVoteResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -799,7 +858,7 @@ func (m *QueryAggregateVotesRequest) Reset() { *m = QueryAggregateVotesR func (m *QueryAggregateVotesRequest) String() string { return proto.CompactTextString(m) } func (*QueryAggregateVotesRequest) ProtoMessage() {} func (*QueryAggregateVotesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_16aef2382d1249a8, []int{18} + return fileDescriptor_16aef2382d1249a8, []int{19} } func (m *QueryAggregateVotesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -840,7 +899,7 @@ func (m *QueryAggregateVotesResponse) Reset() { *m = QueryAggregateVotes func (m *QueryAggregateVotesResponse) String() string { return proto.CompactTextString(m) } func (*QueryAggregateVotesResponse) ProtoMessage() {} func (*QueryAggregateVotesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_16aef2382d1249a8, []int{19} + return fileDescriptor_16aef2382d1249a8, []int{20} } func (m *QueryAggregateVotesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -884,7 +943,7 @@ func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } func (*QueryParamsRequest) ProtoMessage() {} func (*QueryParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_16aef2382d1249a8, []int{20} + return fileDescriptor_16aef2382d1249a8, []int{21} } func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -923,7 +982,7 @@ func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } func (*QueryParamsResponse) ProtoMessage() {} func (*QueryParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_16aef2382d1249a8, []int{21} + return fileDescriptor_16aef2382d1249a8, []int{22} } func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -963,6 +1022,7 @@ func init() { proto.RegisterType((*QueryExchangeRateRequest)(nil), "nibiru.oracle.v1.QueryExchangeRateRequest") proto.RegisterType((*QueryExchangeRateResponse)(nil), "nibiru.oracle.v1.QueryExchangeRateResponse") proto.RegisterType((*QueryExchangeRatesRequest)(nil), "nibiru.oracle.v1.QueryExchangeRatesRequest") + proto.RegisterType((*QueryDatedExchangeRateResponse)(nil), "nibiru.oracle.v1.QueryDatedExchangeRateResponse") proto.RegisterType((*QueryExchangeRatesResponse)(nil), "nibiru.oracle.v1.QueryExchangeRatesResponse") proto.RegisterType((*QueryActivesRequest)(nil), "nibiru.oracle.v1.QueryActivesRequest") proto.RegisterType((*QueryActivesResponse)(nil), "nibiru.oracle.v1.QueryActivesResponse") @@ -987,77 +1047,84 @@ func init() { func init() { proto.RegisterFile("nibiru/oracle/v1/query.proto", fileDescriptor_16aef2382d1249a8) } var fileDescriptor_16aef2382d1249a8 = []byte{ - // 1108 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x97, 0xc1, 0x6f, 0x1b, 0x45, - 0x14, 0xc6, 0x3d, 0x10, 0x52, 0x78, 0x8e, 0xd3, 0x64, 0x08, 0x22, 0xdd, 0x26, 0x76, 0x59, 0x9a, - 0xa8, 0x6d, 0x9a, 0x5d, 0x9c, 0x54, 0x45, 0x81, 0x22, 0x70, 0x12, 0x2a, 0x15, 0xb5, 0x10, 0x4c, - 0x15, 0xa1, 0x5e, 0xac, 0xf1, 0x7a, 0xba, 0x59, 0x61, 0xef, 0x6c, 0x77, 0xd6, 0xa6, 0x51, 0xe1, - 0x52, 0x01, 0xe2, 0x88, 0x84, 0x10, 0x37, 0xe8, 0x05, 0x09, 0x71, 0x06, 0xee, 0x70, 0xea, 0xb1, - 0x12, 0x17, 0xc4, 0xa1, 0xa0, 0x84, 0x03, 0x7f, 0x06, 0xda, 0xd9, 0xf1, 0x7a, 0xd7, 0xeb, 0x51, - 0x16, 0x97, 0x9e, 0x12, 0xcd, 0x7b, 0xfb, 0xde, 0xef, 0x7d, 0x33, 0x3b, 0x9f, 0x17, 0x16, 0x5c, - 0xa7, 0xe9, 0xf8, 0x5d, 0x93, 0xf9, 0xc4, 0x6a, 0x53, 0xb3, 0x57, 0x35, 0x6f, 0x75, 0xa9, 0xbf, - 0x6f, 0x78, 0x3e, 0x0b, 0x18, 0x9e, 0x89, 0xa2, 0x46, 0x14, 0x35, 0x7a, 0x55, 0x6d, 0xce, 0x66, - 0x36, 0x13, 0x41, 0x33, 0xfc, 0x2f, 0xca, 0xd3, 0x16, 0x6c, 0xc6, 0xec, 0x36, 0x35, 0x89, 0xe7, - 0x98, 0xc4, 0x75, 0x59, 0x40, 0x02, 0x87, 0xb9, 0x5c, 0x46, 0x17, 0x33, 0x3d, 0x64, 0xbd, 0x28, - 0x5c, 0xb6, 0x18, 0xef, 0x30, 0x6e, 0x36, 0x09, 0x0f, 0x83, 0x4d, 0x1a, 0x90, 0xaa, 0x69, 0x31, - 0xc7, 0x8d, 0xe2, 0x7a, 0x0f, 0xe6, 0xdf, 0x0d, 0x99, 0xde, 0xbc, 0x6d, 0xed, 0x11, 0xd7, 0xa6, - 0x75, 0x12, 0xd0, 0x3a, 0xbd, 0xd5, 0xa5, 0x3c, 0xc0, 0x3b, 0x30, 0xe1, 0x11, 0xc7, 0x9f, 0x47, - 0xa7, 0xd0, 0x99, 0x67, 0x36, 0x2f, 0xdd, 0x7f, 0x58, 0x29, 0xfc, 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0xf1, 0x85, 0xa3, 0xc7, 0xc8, 0xda, 0x3e, 0xfe, 0x09, 0x41, - 0x29, 0xe5, 0x5f, 0xca, 0x0b, 0x6a, 0x94, 0x93, 0x2b, 0x2f, 0xa8, 0x91, 0x46, 0xad, 0x5f, 0x11, - 0xa8, 0x5b, 0xb8, 0xa6, 0x46, 0x6d, 0x39, 0x47, 0x2a, 0x2e, 0xe4, 0xfe, 0x1e, 0xc1, 0x74, 0xda, - 0x77, 0x71, 0x2e, 0x96, 0x58, 0xe8, 0xd5, 0x9c, 0xd9, 0x12, 0x7d, 0x43, 0xa0, 0xaf, 0xe3, 0xea, - 0x7f, 0x51, 0x39, 0x92, 0xf8, 0x23, 0x98, 0x8c, 0xec, 0x15, 0x9f, 0x56, 0xf4, 0x4c, 0xb9, 0xb8, - 0xb6, 0x74, 0x44, 0x96, 0x24, 0x5a, 0x12, 0x44, 0x15, 0xbc, 0xa8, 0xbc, 0xc8, 0x84, 0xa5, 0x5f, - 0xb9, 0x7f, 0x50, 0x46, 0x0f, 0x0e, 0xca, 0xe8, 0xaf, 0x83, 0x32, 0xfa, 0xe2, 0xb0, 0x5c, 0x78, - 0x70, 0x58, 0x2e, 0xfc, 0x7e, 0x58, 0x2e, 0xdc, 0x30, 0x73, 0x7c, 0x82, 0xc8, 0x9a, 0xe2, 0x2b, - 0xb2, 0x39, 0x29, 0x3e, 0x92, 0xd7, 0xff, 0x0d, 0x00, 0x00, 0xff, 0xff, 0xa4, 0xa3, 0x89, 0xf1, - 0xc9, 0x0f, 0x00, 0x00, + // 1218 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x98, 0xcf, 0x6f, 0x1b, 0x45, + 0x14, 0xc7, 0x3d, 0x4d, 0x9a, 0xc2, 0x73, 0x1c, 0x9c, 0x21, 0x08, 0xd7, 0x4d, 0xec, 0x74, 0x69, + 0xa2, 0x34, 0x3f, 0x76, 0x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e3, 0x8b, 0x8a, 0x2e, 0x49, 0xbb, 0x50, 0x9c, 0x4f, 0x93, 0x9a, 0xf2, 0xb0, 0x85, + 0x50, 0x51, 0x87, 0x81, 0x7f, 0x42, 0x90, 0xef, 0x9d, 0xdd, 0x58, 0x57, 0xf4, 0x54, 0xb8, 0x86, + 0xa2, 0x91, 0x3a, 0x5f, 0x82, 0xae, 0x0b, 0xd0, 0x57, 0xf0, 0x9a, 0x02, 0xb4, 0xfb, 0xa6, 0x33, + 0xe3, 0x6e, 0xfc, 0xd5, 0xff, 0xc8, 0x08, 0xad, 0x43, 0x70, 0x4b, 0xb2, 0x91, 0x31, 0xaf, 0x94, + 0x34, 0x69, 0x2b, 0x94, 0x92, 0xf6, 0x71, 0x0d, 0xda, 0x6b, 0x82, 0x74, 0x0d, 0xbf, 0x34, 0x00, + 0x69, 0x60, 0x2d, 0xf0, 0x2f, 0x08, 0xf2, 0xbd, 0x73, 0x55, 0x29, 0xb0, 0xc2, 0x78, 0x28, 0x05, + 0x56, 0xd9, 0x0a, 0xed, 0xba, 0xc0, 0xbe, 0x8a, 0xb7, 0x06, 0xc0, 0x4e, 0x0c, 0x7a, 0xfc, 0x03, + 0x82, 0xf1, 0x84, 0x37, 0xc0, 0x69, 0xa1, 0xd8, 0x49, 0xcf, 0x92, 0xd2, 0x76, 0x68, 0x57, 0xc4, + 0x36, 0x2e, 0xe3, 0x4b, 0x27, 0x6f, 0x23, 0x69, 0x4f, 0xf0, 0x8f, 0x08, 0x72, 0xb1, 0x39, 0xab, + 0x7c, 0xa0, 0xfa, 0x39, 0x0e, 0xe5, 0x03, 0xd5, 0xd7, 0x50, 0x68, 0xd7, 0x04, 0xea, 0x26, 0x5e, + 0x57, 0xa3, 0xd6, 0xed, 0x13, 0x15, 0x17, 0x72, 0x7f, 0x87, 0x60, 0x2c, 0xee, 0x0f, 0x70, 0x2a, + 0x96, 0xae, 0xd0, 0x4b, 0x29, 0xb3, 0x25, 0xfa, 0x9a, 0x40, 0x5f, 0xc5, 0xcb, 0x8f, 0xa3, 0x72, + 0x28, 0xf1, 0x87, 0x30, 0x12, 0xda, 0x00, 0x7c, 0x41, 0xd1, 0x33, 0xe6, 0x36, 0x8a, 0x33, 0x27, + 0x64, 0x49, 0xa2, 0x19, 0x41, 0x54, 0xc6, 0x53, 0xca, 0x87, 0x4c, 0x58, 0x8f, 0x6b, 0x0f, 0x0e, + 0x4b, 0xe8, 0xe1, 0x61, 0x09, 0xfd, 0x79, 0x58, 0x42, 0x9f, 0x1f, 0x95, 0x32, 0x0f, 0x8f, 0x4a, + 0x99, 0xdf, 0x8e, 0x4a, 0x99, 0x1b, 0x46, 0x8a, 0x9f, 0x4a, 0xb2, 0xa6, 0xf8, 0x69, 0x5c, 0x1b, + 0x11, 0x7f, 0x86, 0x58, 0xfd, 0x37, 0x00, 0x00, 0xff, 0xff, 0xb7, 0xc9, 0xcd, 0x87, 0x2b, 0x11, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1076,6 +1143,8 @@ type QueryClient interface { ExchangeRate(ctx context.Context, in *QueryExchangeRateRequest, opts ...grpc.CallOption) (*QueryExchangeRateResponse, error) // ExchangeRateTwap returns twap exchange rate of a pair ExchangeRateTwap(ctx context.Context, in *QueryExchangeRateRequest, opts ...grpc.CallOption) (*QueryExchangeRateResponse, error) + // DatedExchangeRate returns latest price of a pair + DatedExchangeRate(ctx context.Context, in *QueryExchangeRateRequest, opts ...grpc.CallOption) (*QueryDatedExchangeRateResponse, error) // ExchangeRates returns exchange rates of all pairs ExchangeRates(ctx context.Context, in *QueryExchangeRatesRequest, opts ...grpc.CallOption) (*QueryExchangeRatesResponse, error) // Actives returns all active pairs @@ -1124,6 +1193,15 @@ func (c *queryClient) ExchangeRateTwap(ctx context.Context, in *QueryExchangeRat return out, nil } +func (c *queryClient) DatedExchangeRate(ctx context.Context, in *QueryExchangeRateRequest, opts ...grpc.CallOption) (*QueryDatedExchangeRateResponse, error) { + out := new(QueryDatedExchangeRateResponse) + err := c.cc.Invoke(ctx, "/nibiru.oracle.v1.Query/DatedExchangeRate", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) ExchangeRates(ctx context.Context, in *QueryExchangeRatesRequest, opts ...grpc.CallOption) (*QueryExchangeRatesResponse, error) { out := new(QueryExchangeRatesResponse) err := c.cc.Invoke(ctx, "/nibiru.oracle.v1.Query/ExchangeRates", in, out, opts...) @@ -1220,6 +1298,8 @@ type QueryServer interface { ExchangeRate(context.Context, *QueryExchangeRateRequest) (*QueryExchangeRateResponse, error) // ExchangeRateTwap returns twap exchange rate of a pair ExchangeRateTwap(context.Context, *QueryExchangeRateRequest) (*QueryExchangeRateResponse, error) + // DatedExchangeRate returns latest price of a pair + DatedExchangeRate(context.Context, *QueryExchangeRateRequest) (*QueryDatedExchangeRateResponse, error) // ExchangeRates returns exchange rates of all pairs ExchangeRates(context.Context, *QueryExchangeRatesRequest) (*QueryExchangeRatesResponse, error) // Actives returns all active pairs @@ -1252,6 +1332,9 @@ func (*UnimplementedQueryServer) ExchangeRate(ctx context.Context, req *QueryExc func (*UnimplementedQueryServer) ExchangeRateTwap(ctx context.Context, req *QueryExchangeRateRequest) (*QueryExchangeRateResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ExchangeRateTwap not implemented") } +func (*UnimplementedQueryServer) DatedExchangeRate(ctx context.Context, req *QueryExchangeRateRequest) (*QueryDatedExchangeRateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DatedExchangeRate not implemented") +} func (*UnimplementedQueryServer) ExchangeRates(ctx context.Context, req *QueryExchangeRatesRequest) (*QueryExchangeRatesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ExchangeRates not implemented") } @@ -1323,6 +1406,24 @@ func _Query_ExchangeRateTwap_Handler(srv interface{}, ctx context.Context, dec f return interceptor(ctx, in, info, handler) } +func _Query_DatedExchangeRate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryExchangeRateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).DatedExchangeRate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/nibiru.oracle.v1.Query/DatedExchangeRate", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).DatedExchangeRate(ctx, req.(*QueryExchangeRateRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_ExchangeRates_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryExchangeRatesRequest) if err := dec(in); err != nil { @@ -1515,6 +1616,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "ExchangeRateTwap", Handler: _Query_ExchangeRateTwap_Handler, }, + { + MethodName: "DatedExchangeRate", + Handler: _Query_DatedExchangeRate_Handler, + }, { MethodName: "ExchangeRates", Handler: _Query_ExchangeRates_Handler, @@ -1649,6 +1754,49 @@ func (m *QueryExchangeRatesRequest) MarshalToSizedBuffer(dAtA []byte) (int, erro return len(dAtA) - i, nil } +func (m *QueryDatedExchangeRateResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryDatedExchangeRateResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDatedExchangeRateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.BlockHeight != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.BlockHeight)) + i-- + dAtA[i] = 0x18 + } + if m.BlockTimestampMs != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.BlockTimestampMs)) + i-- + dAtA[i] = 0x10 + } + { + size := m.Price.Size() + i -= size + if _, err := m.Price.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func (m *QueryExchangeRatesResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2268,6 +2416,23 @@ func (m *QueryExchangeRatesRequest) Size() (n int) { return n } +func (m *QueryDatedExchangeRateResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Price.Size() + n += 1 + l + sovQuery(uint64(l)) + if m.BlockTimestampMs != 0 { + n += 1 + sovQuery(uint64(m.BlockTimestampMs)) + } + if m.BlockHeight != 0 { + n += 1 + sovQuery(uint64(m.BlockHeight)) + } + return n +} + func (m *QueryExchangeRatesResponse) Size() (n int) { if m == nil { return 0 @@ -2722,6 +2887,128 @@ func (m *QueryExchangeRatesRequest) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryDatedExchangeRateResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryDatedExchangeRateResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDatedExchangeRateResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Price", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Price.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockTimestampMs", wireType) + } + m.BlockTimestampMs = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BlockTimestampMs |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockHeight", wireType) + } + m.BlockHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BlockHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *QueryExchangeRatesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/oracle/types/query.pb.gw.go b/x/oracle/types/query.pb.gw.go index f8af1a4f8..c9436368d 100644 --- a/x/oracle/types/query.pb.gw.go +++ b/x/oracle/types/query.pb.gw.go @@ -105,6 +105,42 @@ func local_request_Query_ExchangeRateTwap_0(ctx context.Context, marshaler runti } +var ( + filter_Query_DatedExchangeRate_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_DatedExchangeRate_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryExchangeRateRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_DatedExchangeRate_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.DatedExchangeRate(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_DatedExchangeRate_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryExchangeRateRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_DatedExchangeRate_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.DatedExchangeRate(ctx, &protoReq) + return msg, metadata, err + +} + func request_Query_ExchangeRates_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryExchangeRatesRequest var metadata runtime.ServerMetadata @@ -481,6 +517,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_DatedExchangeRate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_DatedExchangeRate_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_DatedExchangeRate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_ExchangeRates_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -792,6 +851,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_DatedExchangeRate_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_DatedExchangeRate_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_DatedExchangeRate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_ExchangeRates_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1000,6 +1079,8 @@ var ( pattern_Query_ExchangeRateTwap_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"nibiru", "oracle", "v1beta1", "exchange_rate_twap"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_DatedExchangeRate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"nibiru", "oracle", "v1beta1", "dated_exchange_rate"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_ExchangeRates_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"nibiru", "oracle", "v1beta1", "pairs", "exchange_rates"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_Actives_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"nibiru", "oracle", "v1beta1", "pairs", "actives"}, "", runtime.AssumeColonVerbOpt(false))) @@ -1026,6 +1107,8 @@ var ( forward_Query_ExchangeRateTwap_0 = runtime.ForwardResponseMessage + forward_Query_DatedExchangeRate_0 = runtime.ForwardResponseMessage + forward_Query_ExchangeRates_0 = runtime.ForwardResponseMessage forward_Query_Actives_0 = runtime.ForwardResponseMessage