Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: generated bindings from v1.12.10-testnet for injective-std #219

Merged
merged 3 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/injective-protobuf/src/proto/mod.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// @generated

pub mod account;
pub mod auth;
pub mod coin;
pub mod distribution;
pub mod exchange;
pub mod oracle;
pub mod tx;
pub mod oracle;
pub mod account;
2 changes: 1 addition & 1 deletion packages/injective-std/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ license = "MIT OR Apache-2.0"
name = "injective-std"
readme = "README.md"
repository = "https://github.com/InjectiveLabs/cw-injective/tree/dev/packages/injective-std"
version = "0.1.7"
version = "1.12.10-testnet"
maxrobot marked this conversation as resolved.
Show resolved Hide resolved

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
8 changes: 4 additions & 4 deletions packages/injective-std/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Injective's proto-generated types and helpers built using [Buf](https://github.c

## Supported Version

- Injective-Core@e38d508c746a9b90d6e8a261ec2b03f99cc49351
- Injective-Core@aa61552b5225f76f284811004925d83531e23311

## Build Instructions

Expand Down Expand Up @@ -46,7 +46,7 @@ Lets try to create the bindings for

First create a directory with the dependencies as below:

```
```bash
├── README.md
└── dependencies
   ├── cosmos-sdk
Expand All @@ -56,10 +56,10 @@ First create a directory with the dependencies as below:

Next generate the proto:

```
```shell
buf generate /Users/wandlitz/go/src/github.com/osmosis-labs/osmosis-rust/packages/proto-build-injective/../../dependencies/injective-core/proto --template /Users/wandlitz/go/src/github.com/osmosis-labs/osmosis-rust/packages/proto-build-injective/buf.gen.yaml --output ./tmp/tmp-protobuf/injective --path /Users/wandlitz/go/src/github.com/osmosis-labs/osmosis-rust/packages/proto-build-injective/../../dependencies/injective-core/proto/injective/auction
```

```
```shell
buf build /Users/wandlitz/go/src/github.com/osmosis-labs/osmosis-rust/packages/proto-build-injective/../../dependencies/injective-core/proto --path /Users/wandlitz/go/src/github.com/osmosis-labs/osmosis-rust/packages/proto-build-injective/../../dependencies/injective-core/proto/injective/auction
```
4 changes: 2 additions & 2 deletions packages/injective-std/src/types/cosmos/base/query/v1beta1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use osmosis_std_derive::CosmwasmExt;
/// }
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[proto_message(type_url = "/cosmos.base.query.v1beta1.PageRequestPageRequest")]
#[proto_message(type_url = "/cosmos.base.query.v1beta1.PageRequest")]
pub struct PageRequest {
/// key is a value returned in PageResponse.next_key to begin
/// querying the next page most efficiently. Only one of offset or key
Expand Down Expand Up @@ -53,7 +53,7 @@ pub struct PageRequest {
/// }
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[proto_message(type_url = "/cosmos.base.query.v1beta1.PageResponsePageResponse")]
#[proto_message(type_url = "/cosmos.base.query.v1beta1.PageResponse")]
pub struct PageResponse {
/// next_key is the key to be passed to PageRequest.key to
/// query the next page most efficiently. It will be empty if
Expand Down
8 changes: 4 additions & 4 deletions packages/injective-std/src/types/cosmos/base/v1beta1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use osmosis_std_derive::CosmwasmExt;
/// signatures required by gogoproto.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[proto_message(type_url = "/cosmos.base.v1beta1.CoinCoin")]
#[proto_message(type_url = "/cosmos.base.v1beta1.Coin")]
pub struct Coin {
#[prost(string, tag = "1")]
pub denom: ::prost::alloc::string::String,
Expand All @@ -18,7 +18,7 @@ pub struct Coin {
/// signatures required by gogoproto.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[proto_message(type_url = "/cosmos.base.v1beta1.DecCoinDecCoin")]
#[proto_message(type_url = "/cosmos.base.v1beta1.DecCoin")]
pub struct DecCoin {
#[prost(string, tag = "1")]
pub denom: ::prost::alloc::string::String,
Expand All @@ -28,15 +28,15 @@ pub struct DecCoin {
/// IntProto defines a Protobuf wrapper around an Int object.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[proto_message(type_url = "/cosmos.base.v1beta1.IntProtoIntProto")]
#[proto_message(type_url = "/cosmos.base.v1beta1.IntProto")]
pub struct IntProto {
#[prost(string, tag = "1")]
pub int: ::prost::alloc::string::String,
}
/// DecProto defines a Protobuf wrapper around a Dec object.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[proto_message(type_url = "/cosmos.base.v1beta1.DecProtoDecProto")]
#[proto_message(type_url = "/cosmos.base.v1beta1.DecProto")]
pub struct DecProto {
#[prost(string, tag = "1")]
pub dec: ::prost::alloc::string::String,
Expand Down
2 changes: 2 additions & 0 deletions packages/injective-std/src/types/cosmos/feegrant/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pub mod module;
pub mod v1beta1;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod v1;
6 changes: 6 additions & 0 deletions packages/injective-std/src/types/cosmos/feegrant/module/v1.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
use osmosis_std_derive::CosmwasmExt;
/// Module is the config object of the feegrant module.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[proto_message(type_url = "/cosmos.feegrant.module.v1.Module")]
pub struct Module {}
227 changes: 227 additions & 0 deletions packages/injective-std/src/types/cosmos/feegrant/v1beta1.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,227 @@
use osmosis_std_derive::CosmwasmExt;
/// BasicAllowance implements Allowance with a one-time grant of coins
/// that optionally expires. The grantee can use up to SpendLimit to cover fees.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[proto_message(type_url = "/cosmos.feegrant.v1beta1.BasicAllowance")]
pub struct BasicAllowance {
/// spend_limit specifies the maximum amount of coins that can be spent
/// by this allowance and will be updated as coins are spent. If it is
/// empty, there is no spend limit and any amount of coins can be spent.
#[prost(message, repeated, tag = "1")]
pub spend_limit: ::prost::alloc::vec::Vec<super::super::base::v1beta1::Coin>,
/// expiration specifies an optional time when this allowance expires
#[prost(message, optional, tag = "2")]
pub expiration: ::core::option::Option<crate::shim::Timestamp>,
}
/// PeriodicAllowance extends Allowance to allow for both a maximum cap,
/// as well as a limit per time period.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[proto_message(type_url = "/cosmos.feegrant.v1beta1.PeriodicAllowance")]
pub struct PeriodicAllowance {
/// basic specifies a struct of `BasicAllowance`
#[prost(message, optional, tag = "1")]
pub basic: ::core::option::Option<BasicAllowance>,
/// period specifies the time duration in which period_spend_limit coins can
/// be spent before that allowance is reset
#[prost(message, optional, tag = "2")]
pub period: ::core::option::Option<crate::shim::Duration>,
/// period_spend_limit specifies the maximum number of coins that can be spent
/// in the period
#[prost(message, repeated, tag = "3")]
pub period_spend_limit: ::prost::alloc::vec::Vec<super::super::base::v1beta1::Coin>,
/// period_can_spend is the number of coins left to be spent before the period_reset time
#[prost(message, repeated, tag = "4")]
pub period_can_spend: ::prost::alloc::vec::Vec<super::super::base::v1beta1::Coin>,
/// period_reset is the time at which this period resets and a new one begins,
/// it is calculated from the start time of the first transaction after the
/// last period ended
#[prost(message, optional, tag = "5")]
pub period_reset: ::core::option::Option<crate::shim::Timestamp>,
}
/// AllowedMsgAllowance creates allowance only for specified message types.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[proto_message(type_url = "/cosmos.feegrant.v1beta1.AllowedMsgAllowance")]
pub struct AllowedMsgAllowance {
/// allowance can be any of basic and periodic fee allowance.
#[prost(message, optional, tag = "1")]
pub allowance: ::core::option::Option<crate::shim::Any>,
/// allowed_messages are the messages for which the grantee has the access.
#[prost(string, repeated, tag = "2")]
pub allowed_messages: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Grant is stored in the KVStore to record a grant with full context
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[proto_message(type_url = "/cosmos.feegrant.v1beta1.Grant")]
pub struct Grant {
/// granter is the address of the user granting an allowance of their funds.
#[prost(string, tag = "1")]
pub granter: ::prost::alloc::string::String,
/// grantee is the address of the user being granted an allowance of another user's funds.
#[prost(string, tag = "2")]
pub grantee: ::prost::alloc::string::String,
/// allowance can be any of basic, periodic, allowed fee allowance.
#[prost(message, optional, tag = "3")]
pub allowance: ::core::option::Option<crate::shim::Any>,
}
/// GenesisState contains a set of fee allowances, persisted from the store
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[proto_message(type_url = "/cosmos.feegrant.v1beta1.GenesisState")]
pub struct GenesisState {
#[prost(message, repeated, tag = "1")]
pub allowances: ::prost::alloc::vec::Vec<Grant>,
}
/// QueryAllowanceRequest is the request type for the Query/Allowance RPC method.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[proto_message(type_url = "/cosmos.feegrant.v1beta1.QueryAllowanceRequest")]
#[proto_query(
path = "/cosmos.feegrant.v1beta1.Query/Allowance",
response_type = QueryAllowanceResponse
)]
pub struct QueryAllowanceRequest {
/// granter is the address of the user granting an allowance of their funds.
#[prost(string, tag = "1")]
pub granter: ::prost::alloc::string::String,
/// grantee is the address of the user being granted an allowance of another user's funds.
#[prost(string, tag = "2")]
pub grantee: ::prost::alloc::string::String,
}
/// QueryAllowanceResponse is the response type for the Query/Allowance RPC method.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[proto_message(type_url = "/cosmos.feegrant.v1beta1.QueryAllowanceResponse")]
pub struct QueryAllowanceResponse {
/// allowance is a allowance granted for grantee by granter.
#[prost(message, optional, tag = "1")]
pub allowance: ::core::option::Option<Grant>,
}
/// QueryAllowancesRequest is the request type for the Query/Allowances RPC method.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[proto_message(type_url = "/cosmos.feegrant.v1beta1.QueryAllowancesRequest")]
#[proto_query(
path = "/cosmos.feegrant.v1beta1.Query/Allowances",
response_type = QueryAllowancesResponse
)]
pub struct QueryAllowancesRequest {
#[prost(string, tag = "1")]
pub grantee: ::prost::alloc::string::String,
/// pagination defines an pagination for the request.
#[prost(message, optional, tag = "2")]
pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageRequest>,
}
/// QueryAllowancesResponse is the response type for the Query/Allowances RPC method.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[proto_message(type_url = "/cosmos.feegrant.v1beta1.QueryAllowancesResponse")]
pub struct QueryAllowancesResponse {
/// allowances are allowance's granted for grantee by granter.
#[prost(message, repeated, tag = "1")]
pub allowances: ::prost::alloc::vec::Vec<Grant>,
/// pagination defines an pagination for the response.
#[prost(message, optional, tag = "2")]
pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageResponse>,
}
/// QueryAllowancesByGranterRequest is the request type for the Query/AllowancesByGranter RPC method.
///
/// Since: cosmos-sdk 0.46
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[proto_message(type_url = "/cosmos.feegrant.v1beta1.QueryAllowancesByGranterRequest")]
#[proto_query(
path = "/cosmos.feegrant.v1beta1.Query/AllowancesByGranter",
response_type = QueryAllowancesByGranterResponse
)]
pub struct QueryAllowancesByGranterRequest {
#[prost(string, tag = "1")]
pub granter: ::prost::alloc::string::String,
/// pagination defines an pagination for the request.
#[prost(message, optional, tag = "2")]
pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageRequest>,
}
/// QueryAllowancesByGranterResponse is the response type for the Query/AllowancesByGranter RPC method.
///
/// Since: cosmos-sdk 0.46
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[proto_message(type_url = "/cosmos.feegrant.v1beta1.QueryAllowancesByGranterResponse")]
pub struct QueryAllowancesByGranterResponse {
/// allowances that have been issued by the granter.
#[prost(message, repeated, tag = "1")]
pub allowances: ::prost::alloc::vec::Vec<Grant>,
/// pagination defines an pagination for the response.
#[prost(message, optional, tag = "2")]
pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageResponse>,
}
/// MsgGrantAllowance adds permission for Grantee to spend up to Allowance
/// of fees from the account of Granter.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[proto_message(type_url = "/cosmos.feegrant.v1beta1.MsgGrantAllowance")]
pub struct MsgGrantAllowance {
/// granter is the address of the user granting an allowance of their funds.
#[prost(string, tag = "1")]
pub granter: ::prost::alloc::string::String,
/// grantee is the address of the user being granted an allowance of another user's funds.
#[prost(string, tag = "2")]
pub grantee: ::prost::alloc::string::String,
/// allowance can be any of basic, periodic, allowed fee allowance.
#[prost(message, optional, tag = "3")]
pub allowance: ::core::option::Option<crate::shim::Any>,
}
/// MsgGrantAllowanceResponse defines the Msg/GrantAllowanceResponse response type.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[proto_message(type_url = "/cosmos.feegrant.v1beta1.MsgGrantAllowanceResponse")]
pub struct MsgGrantAllowanceResponse {}
/// MsgRevokeAllowance removes any existing Allowance from Granter to Grantee.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[proto_message(type_url = "/cosmos.feegrant.v1beta1.MsgRevokeAllowance")]
pub struct MsgRevokeAllowance {
/// granter is the address of the user granting an allowance of their funds.
#[prost(string, tag = "1")]
pub granter: ::prost::alloc::string::String,
/// grantee is the address of the user being granted an allowance of another user's funds.
#[prost(string, tag = "2")]
pub grantee: ::prost::alloc::string::String,
}
/// MsgRevokeAllowanceResponse defines the Msg/RevokeAllowanceResponse response type.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[proto_message(type_url = "/cosmos.feegrant.v1beta1.MsgRevokeAllowanceResponse")]
pub struct MsgRevokeAllowanceResponse {}
pub struct FeegrantQuerier<'a, Q: cosmwasm_std::CustomQuery> {
querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>,
}
impl<'a, Q: cosmwasm_std::CustomQuery> FeegrantQuerier<'a, Q> {
pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self {
Self { querier }
}
pub fn allowance(
&self,
granter: ::prost::alloc::string::String,
grantee: ::prost::alloc::string::String,
) -> Result<QueryAllowanceResponse, cosmwasm_std::StdError> {
QueryAllowanceRequest { granter, grantee }.query(self.querier)
}
pub fn allowances(
&self,
grantee: ::prost::alloc::string::String,
pagination: ::core::option::Option<super::super::base::query::v1beta1::PageRequest>,
) -> Result<QueryAllowancesResponse, cosmwasm_std::StdError> {
QueryAllowancesRequest { grantee, pagination }.query(self.querier)
}
pub fn allowances_by_granter(
&self,
granter: ::prost::alloc::string::String,
pagination: ::core::option::Option<super::super::base::query::v1beta1::PageRequest>,
) -> Result<QueryAllowancesByGranterResponse, cosmwasm_std::StdError> {
QueryAllowancesByGranterRequest { granter, pagination }.query(self.querier)
}
}
1 change: 1 addition & 0 deletions packages/injective-std/src/types/cosmos/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ pub mod authz;
pub mod bank;
pub mod base;
pub mod distribution;
pub mod feegrant;
pub mod gov;
pub mod params;
pub mod staking;
12 changes: 0 additions & 12 deletions packages/injective-std/src/types/injective/insurance/v1beta1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,18 +130,6 @@ pub struct EventUnderwrite {
#[prost(message, optional, tag = "4")]
pub shares: ::core::option::Option<super::super::super::cosmos::base::v1beta1::Coin>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[proto_message(type_url = "/injective.insurance.v1beta1.EventInsuranceWithdraw")]
pub struct EventInsuranceWithdraw {
#[prost(string, tag = "1")]
#[serde(alias = "marketID")]
pub market_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub market_ticker: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub withdrawal: ::core::option::Option<super::super::super::cosmos::base::v1beta1::Coin>,
}
/// GenesisState defines the insurance module's genesis state.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
Expand Down
Loading