From b485476a4221bcd526af89940165fa69b3607da2 Mon Sep 17 00:00:00 2001 From: kwt <4344285+kwtalley@users.noreply.github.com> Date: Tue, 9 Jul 2024 14:35:33 -0500 Subject: [PATCH 01/43] set provenance version to 1.19.0-rc2 --- dependencies/provenance | 2 +- packages/proto-build/src/main.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dependencies/provenance b/dependencies/provenance index dd0940e9..17b9b8c3 160000 --- a/dependencies/provenance +++ b/dependencies/provenance @@ -1 +1 @@ -Subproject commit dd0940e94575b4c8f22af51603d3703b39c9a3a9 +Subproject commit 17b9b8c3e655b6a56840841b83252b241d01ff14 diff --git a/packages/proto-build/src/main.rs b/packages/proto-build/src/main.rs index 2465251a..75ae7024 100644 --- a/packages/proto-build/src/main.rs +++ b/packages/proto-build/src/main.rs @@ -10,7 +10,7 @@ use proto_build::{ }; /// The provenance commit or tag to be cloned and used to build the proto files -const PROVENANCE_REV: &str = "v1.18.0"; +const PROVENANCE_REV: &str = "v1.19.0-rc2"; // All paths must end with a / and either be absolute or include a ./ to reference the current // working directory. From 8a652e78bc84d197340f0bf3c7948658b6189ffc Mon Sep 17 00:00:00 2001 From: kwt <4344285+kwtalley@users.noreply.github.com> Date: Tue, 9 Jul 2024 14:36:01 -0500 Subject: [PATCH 02/43] update list of provenance types to generate --- packages/proto-build/provenance.buf.gen.yaml | 410 ++++++++----------- 1 file changed, 178 insertions(+), 232 deletions(-) diff --git a/packages/proto-build/provenance.buf.gen.yaml b/packages/proto-build/provenance.buf.gen.yaml index fb02de17..078955b4 100644 --- a/packages/proto-build/provenance.buf.gen.yaml +++ b/packages/proto-build/provenance.buf.gen.yaml @@ -8,88 +8,40 @@ plugins: - extern_path=.google.protobuf.Any=crate::shim::Any types: include: - - provenance.attribute.v1.Attribute - - provenance.attribute.v1.AttributeType - - provenance.attribute.v1.EventAttributeAdd - - provenance.attribute.v1.EventAttributeUpdate - - provenance.attribute.v1.EventAttributeDelete - - provenance.attribute.v1.EventAttributeDistinctDelete - - provenance.attribute.v1.QueryParamsRequest - - provenance.attribute.v1.QueryParamsResponse - - provenance.attribute.v1.QueryAttributeRequest - - provenance.attribute.v1.QueryAttributeResponse - - provenance.attribute.v1.QueryAttributesRequest - - provenance.attribute.v1.QueryAttributesResponse - - provenance.attribute.v1.QueryScanRequest - - provenance.attribute.v1.QueryScanResponse - provenance.attribute.v1.MsgAddAttributeRequest - provenance.attribute.v1.MsgAddAttributeResponse - provenance.attribute.v1.MsgUpdateAttributeRequest - provenance.attribute.v1.MsgUpdateAttributeResponse + - provenance.attribute.v1.MsgUpdateAttributeExpirationRequest + - provenance.attribute.v1.MsgUpdateAttributeExpirationResponse - provenance.attribute.v1.MsgDeleteAttributeRequest - provenance.attribute.v1.MsgDeleteAttributeResponse - provenance.attribute.v1.MsgDeleteDistinctAttributeRequest - provenance.attribute.v1.MsgDeleteDistinctAttributeResponse - - provenance.exchange.v1.EventOrderCreated - - provenance.exchange.v1.EventOrderCancelled - - provenance.exchange.v1.EventOrderFilled - - provenance.exchange.v1.EventOrderPartiallyFilled - - provenance.exchange.v1.EventOrderExternalIDUpdated - - provenance.exchange.v1.EventMarketWithdraw - - provenance.exchange.v1.EventMarketDetailsUpdated - - provenance.exchange.v1.EventMarketEnabled - - provenance.exchange.v1.EventMarketDisabled - - provenance.exchange.v1.EventMarketUserSettleEnabled - - provenance.exchange.v1.EventMarketUserSettleDisabled - - provenance.exchange.v1.EventMarketPermissionsUpdated - - provenance.exchange.v1.EventMarketReqAttrUpdated - - provenance.exchange.v1.EventMarketCreated - - provenance.exchange.v1.EventMarketFeesUpdated - - provenance.exchange.v1.MarketAccount - - provenance.exchange.v1.MarketDetails - - provenance.exchange.v1.MarketBrief - - provenance.exchange.v1.Market - - provenance.exchange.v1.FeeRatio - - provenance.exchange.v1.AccessGrant - - provenance.exchange.v1.Permission - - provenance.exchange.v1.Order - - provenance.exchange.v1.AskOrder - - provenance.exchange.v1.BidOrder - - provenance.exchange.v1.DenomSplit - - provenance.exchange.v1.QueryOrderFeeCalcRequest - - provenance.exchange.v1.QueryOrderFeeCalcResponse - - provenance.exchange.v1.QueryGetOrderRequest - - provenance.exchange.v1.QueryGetOrderResponse - - provenance.exchange.v1.QueryGetOrderByExternalIDRequest - - provenance.exchange.v1.QueryGetOrderByExternalIDResponse - - provenance.exchange.v1.QueryGetMarketOrdersRequest - - provenance.exchange.v1.QueryGetMarketOrdersResponse - - provenance.exchange.v1.QueryGetOwnerOrdersRequest - - provenance.exchange.v1.QueryGetOwnerOrdersResponse - - provenance.exchange.v1.QueryGetAssetOrdersRequest - - provenance.exchange.v1.QueryGetAssetOrdersResponse - - provenance.exchange.v1.QueryGetAllOrdersRequest - - provenance.exchange.v1.QueryGetAllOrdersResponse - - provenance.exchange.v1.QueryGetMarketRequest - - provenance.exchange.v1.QueryGetMarketResponse - - provenance.exchange.v1.QueryGetAllMarketsRequest - - provenance.exchange.v1.QueryGetAllMarketsResponse - - provenance.exchange.v1.QueryParamsRequest - - provenance.exchange.v1.QueryParamsResponse - - provenance.exchange.v1.QueryValidateCreateMarketRequest - - provenance.exchange.v1.QueryValidateCreateMarketResponse - - provenance.exchange.v1.QueryValidateMarketRequest - - provenance.exchange.v1.QueryValidateMarketResponse - - provenance.exchange.v1.QueryValidateManageFeesRequest - - provenance.exchange.v1.QueryValidateManageFeesResponse + - provenance.attribute.v1.MsgSetAccountDataRequest + - provenance.attribute.v1.MsgSetAccountDataResponse + - provenance.attribute.v1.MsgUpdateParamsRequest + - provenance.attribute.v1.MsgUpdateParamsResponse + - provenance.attribute.v1.QueryParamsRequest + - provenance.attribute.v1.QueryParamsResponse + - provenance.attribute.v1.QueryAttributeRequest + - provenance.attribute.v1.QueryAttributeResponse + - provenance.attribute.v1.QueryAttributesRequest + - provenance.attribute.v1.QueryAttributesResponse + - provenance.attribute.v1.QueryScanRequest + - provenance.attribute.v1.QueryScanResponse + - provenance.attribute.v1.QueryAttributeAccountsRequest + - provenance.attribute.v1.QueryAttributeAccountsResponse + - provenance.attribute.v1.QueryAccountDataRequest + - provenance.attribute.v1.QueryAccountDataResponse - provenance.exchange.v1.MsgCreateAskRequest - provenance.exchange.v1.MsgCreateAskResponse - provenance.exchange.v1.MsgCreateBidRequest - provenance.exchange.v1.MsgCreateBidResponse - - provenance.exchange.v1.MsgCancelOrderRequest - - provenance.exchange.v1.MsgCancelOrderResponse - provenance.exchange.v1.MsgCommitFundsRequest - provenance.exchange.v1.MsgCommitFundsResponse + - provenance.exchange.v1.MsgCancelOrderRequest + - provenance.exchange.v1.MsgCancelOrderResponse - provenance.exchange.v1.MsgFillBidsRequest - provenance.exchange.v1.MsgFillBidsResponse - provenance.exchange.v1.MsgFillAsksRequest @@ -140,65 +92,70 @@ types: - provenance.exchange.v1.MsgGovCloseMarketResponse - provenance.exchange.v1.MsgGovUpdateParamsRequest - provenance.exchange.v1.MsgGovUpdateParamsResponse - - provenance.hold.v1.EventHoldAdded - - provenance.hold.v1.EventHoldReleased - - provenance.hold.v1.AccountHold + - provenance.exchange.v1.MsgUpdateParamsRequest + - provenance.exchange.v1.MsgUpdateParamsResponse + - provenance.exchange.v1.QueryOrderFeeCalcRequest + - provenance.exchange.v1.QueryOrderFeeCalcResponse + - provenance.exchange.v1.QueryGetOrderRequest + - provenance.exchange.v1.QueryGetOrderResponse + - provenance.exchange.v1.QueryGetOrderByExternalIDRequest + - provenance.exchange.v1.QueryGetOrderByExternalIDResponse + - provenance.exchange.v1.QueryGetMarketOrdersRequest + - provenance.exchange.v1.QueryGetMarketOrdersResponse + - provenance.exchange.v1.QueryGetOwnerOrdersRequest + - provenance.exchange.v1.QueryGetOwnerOrdersResponse + - provenance.exchange.v1.QueryGetAssetOrdersRequest + - provenance.exchange.v1.QueryGetAssetOrdersResponse + - provenance.exchange.v1.QueryGetAllOrdersRequest + - provenance.exchange.v1.QueryGetAllOrdersResponse + - provenance.exchange.v1.QueryGetCommitmentRequest + - provenance.exchange.v1.QueryGetCommitmentResponse + - provenance.exchange.v1.QueryGetAccountCommitmentsRequest + - provenance.exchange.v1.QueryGetAccountCommitmentsResponse + - provenance.exchange.v1.QueryGetMarketCommitmentsRequest + - provenance.exchange.v1.QueryGetMarketCommitmentsResponse + - provenance.exchange.v1.QueryGetAllCommitmentsRequest + - provenance.exchange.v1.QueryGetAllCommitmentsResponse + - provenance.exchange.v1.QueryGetMarketRequest + - provenance.exchange.v1.QueryGetMarketResponse + - provenance.exchange.v1.QueryGetAllMarketsRequest + - provenance.exchange.v1.QueryGetAllMarketsResponse + - provenance.exchange.v1.QueryParamsRequest + - provenance.exchange.v1.QueryParamsResponse + - provenance.exchange.v1.QueryCommitmentSettlementFeeCalcRequest + - provenance.exchange.v1.QueryCommitmentSettlementFeeCalcResponse + - provenance.exchange.v1.QueryValidateCreateMarketRequest + - provenance.exchange.v1.QueryValidateCreateMarketResponse + - provenance.exchange.v1.QueryValidateMarketRequest + - provenance.exchange.v1.QueryValidateMarketResponse + - provenance.exchange.v1.QueryValidateManageFeesRequest + - provenance.exchange.v1.QueryValidateManageFeesResponse + - provenance.exchange.v1.QueryGetPaymentRequest + - provenance.exchange.v1.QueryGetPaymentResponse + - provenance.exchange.v1.QueryGetPaymentsWithSourceRequest + - provenance.exchange.v1.QueryGetPaymentsWithSourceResponse + - provenance.exchange.v1.QueryGetPaymentsWithTargetRequest + - provenance.exchange.v1.QueryGetPaymentsWithTargetResponse + - provenance.exchange.v1.QueryGetAllPaymentsRequest + - provenance.exchange.v1.QueryGetAllPaymentsResponse + - provenance.exchange.v1.QueryPaymentFeeCalcRequest + - provenance.exchange.v1.QueryPaymentFeeCalcResponse - provenance.hold.v1.GetHoldsRequest - provenance.hold.v1.GetHoldsResponse - provenance.hold.v1.GetAllHoldsRequest - provenance.hold.v1.GetAllHoldsResponse - - provenance.marker.v1.AccessGrant - - provenance.marker.v1.Access - - provenance.marker.v1.MarkerTransferAuthorization - - provenance.marker.v1.MarkerAccount - - provenance.marker.v1.MarkerType - - provenance.marker.v1.MarkerStatus - - provenance.marker.v1.EventMarkerAdd - - provenance.marker.v1.EventMarkerAccess - - provenance.marker.v1.EventMarkerAddAccess - - provenance.marker.v1.EventMarkerAccess - - provenance.marker.v1.EventMarkerDeleteAccess - - provenance.marker.v1.EventMarkerFinalize - - provenance.marker.v1.EventMarkerActivate - - provenance.marker.v1.EventMarkerCancel - - provenance.marker.v1.EventMarkerDelete - - provenance.marker.v1.EventMarkerMint - - provenance.marker.v1.EventMarkerBurn - - provenance.marker.v1.EventMarkerWithdraw - - provenance.marker.v1.EventMarkerTransfer - - provenance.marker.v1.EventMarkerSetDenomMetadata - - provenance.marker.v1.EventDenomUnit - - provenance.marker.v1.SupplyIncreaseProposal - - provenance.marker.v1.SupplyDecreaseProposal - - provenance.marker.v1.SetAdministratorProposal - - provenance.marker.v1.RemoveAdministratorProposal - - provenance.marker.v1.ChangeStatusProposal - - provenance.marker.v1.WithdrawEscrowProposal - - provenance.marker.v1.SetDenomMetadataProposal - - provenance.marker.v1.QueryParamsRequest - - provenance.marker.v1.QueryParamsResponse - - provenance.marker.v1.QueryMarkerRequest - - provenance.marker.v1.QueryMarkerResponse - - provenance.marker.v1.QueryHoldingRequest - - provenance.marker.v1.QueryHoldingResponse - - provenance.marker.v1.QuerySupplyRequest - - provenance.marker.v1.QuerySupplyResponse - - provenance.marker.v1.QueryEscrowRequest - - provenance.marker.v1.QueryEscrowResponse - - provenance.marker.v1.QueryAccessRequest - - provenance.marker.v1.QueryAccessResponse - - provenance.marker.v1.QueryDenomMetadataRequest - - provenance.marker.v1.QueryDenomMetadataResponse - - provenance.marker.v1.Balance - - provenance.marker.v1.SIPrefix - - provenance.marker.v1.MsgGrantAllowanceRequest - - provenance.marker.v1.MsgGrantAllowanceResponse - - provenance.marker.v1.MsgAddMarkerRequest - - provenance.marker.v1.MsgAddMarkerResponse - - provenance.marker.v1.MsgAddAccessRequest - - provenance.marker.v1.MsgAddAccessResponse - - provenance.marker.v1.MsgDeleteAccessRequest - - provenance.marker.v1.MsgDeleteAccessResponse + - provenance.ibchooks.v1.MsgEmitIBCAck + - provenance.ibchooks.v1.MsgEmitIBCAckResponse + - provenance.ibchooks.v1.MsgUpdateParamsRequest + - provenance.ibchooks.v1.MsgUpdateParamsResponse + - provenance.ibchooks.v1.QueryParamsRequest + - provenance.ibchooks.v1.QueryParamsResponse + - provenance.ibcratelimit.v1.MsgGovUpdateParamsRequest + - provenance.ibcratelimit.v1.MsgGovUpdateParamsResponse + - provenance.ibcratelimit.v1.MsgUpdateParamsRequest + - provenance.ibcratelimit.v1.MsgUpdateParamsResponse + - provenance.ibcratelimit.v1.ParamsRequest + - provenance.ibcratelimit.v1.ParamsResponse - provenance.marker.v1.MsgFinalizeRequest - provenance.marker.v1.MsgFinalizeResponse - provenance.marker.v1.MsgActivateRequest @@ -211,65 +168,70 @@ types: - provenance.marker.v1.MsgMintResponse - provenance.marker.v1.MsgBurnRequest - provenance.marker.v1.MsgBurnResponse + - provenance.marker.v1.MsgAddAccessRequest + - provenance.marker.v1.MsgAddAccessResponse + - provenance.marker.v1.MsgDeleteAccessRequest + - provenance.marker.v1.MsgDeleteAccessResponse - provenance.marker.v1.MsgWithdrawRequest - provenance.marker.v1.MsgWithdrawResponse + - provenance.marker.v1.MsgAddMarkerRequest + - provenance.marker.v1.MsgAddMarkerResponse - provenance.marker.v1.MsgTransferRequest - provenance.marker.v1.MsgTransferResponse - provenance.marker.v1.MsgIbcTransferRequest - provenance.marker.v1.MsgIbcTransferResponse - provenance.marker.v1.MsgSetDenomMetadataRequest - provenance.marker.v1.MsgSetDenomMetadataResponse + - provenance.marker.v1.MsgGrantAllowanceRequest + - provenance.marker.v1.MsgGrantAllowanceResponse - provenance.marker.v1.MsgAddFinalizeActivateMarkerRequest - provenance.marker.v1.MsgAddFinalizeActivateMarkerResponse - provenance.marker.v1.MsgSupplyIncreaseProposalRequest - provenance.marker.v1.MsgSupplyIncreaseProposalResponse - - provenance.metadata.v1.EventTxCompleted - - provenance.metadata.v1.EventScopeCreated - - provenance.metadata.v1.EventScopeUpdated - - provenance.metadata.v1.EventScopeDeleted - - provenance.metadata.v1.EventSessionCreated - - provenance.metadata.v1.EventSessionUpdated - - provenance.metadata.v1.EventSessionDeleted - - provenance.metadata.v1.EventRecordCreated - - provenance.metadata.v1.EventRecordUpdated - - provenance.metadata.v1.EventRecordDeleted - - provenance.metadata.v1.EventScopeSpecificationCreated - - provenance.metadata.v1.EventScopeSpecificationUpdated - - provenance.metadata.v1.EventScopeSpecificationDeleted - - provenance.metadata.v1.EventContractSpecificationCreated - - provenance.metadata.v1.EventContractSpecificationUpdated - - provenance.metadata.v1.EventContractSpecificationDeleted - - provenance.metadata.v1.EventRecordSpecificationCreated - - provenance.metadata.v1.EventRecordSpecificationUpdated - - provenance.metadata.v1.EventRecordSpecificationDeleted - - provenance.metadata.v1.EventOSLocatorCreated - - provenance.metadata.v1.EventOSLocatorUpdated - - provenance.metadata.v1.EventOSLocatorDeleted - - provenance.metadata.v1.ScopeIdInfo - - provenance.metadata.v1.SessionIdInfo - - provenance.metadata.v1.RecordIdInfo - - provenance.metadata.v1.ScopeSpecIdInfo - - provenance.metadata.v1.ContractSpecIdInfo - - provenance.metadata.v1.RecordSpecIdInfo - - provenance.metadata.v1.ObjectStoreLocator - - provenance.metadata.v1.OSLocatorParams - - provenance.metadata.v1.Scope - - provenance.metadata.v1.Session - - provenance.metadata.v1.Record - - provenance.metadata.v1.Process - - provenance.metadata.v1.RecordInput - - provenance.metadata.v1.RecordInputStatus - - provenance.metadata.v1.RecordOutput - - provenance.metadata.v1.ResultStatus - - provenance.metadata.v1.Party - - provenance.metadata.v1.AuditFields - - provenance.metadata.v1.ScopeSpecification - - provenance.metadata.v1.ContractSpecification - - provenance.metadata.v1.RecordSpecification - - provenance.metadata.v1.InputSpecification - - provenance.metadata.v1.Description - - provenance.metadata.v1.DefinitionType - - provenance.metadata.v1.PartyType + - provenance.marker.v1.MsgSupplyDecreaseProposalRequest + - provenance.marker.v1.MsgSupplyDecreaseProposalResponse + - provenance.marker.v1.MsgUpdateRequiredAttributesRequest + - provenance.marker.v1.MsgUpdateRequiredAttributesResponse + - provenance.marker.v1.MsgUpdateForcedTransferRequest + - provenance.marker.v1.MsgUpdateForcedTransferResponse + - provenance.marker.v1.MsgSetAccountDataRequest + - provenance.marker.v1.MsgSetAccountDataResponse + - provenance.marker.v1.MsgUpdateSendDenyListRequest + - provenance.marker.v1.MsgUpdateSendDenyListResponse + - provenance.marker.v1.MsgAddNetAssetValuesRequest + - provenance.marker.v1.MsgAddNetAssetValuesResponse + - provenance.marker.v1.MsgSetAdministratorProposalRequest + - provenance.marker.v1.MsgSetAdministratorProposalResponse + - provenance.marker.v1.MsgRemoveAdministratorProposalRequest + - provenance.marker.v1.MsgRemoveAdministratorProposalResponse + - provenance.marker.v1.MsgChangeStatusProposalRequest + - provenance.marker.v1.MsgChangeStatusProposalResponse + - provenance.marker.v1.MsgWithdrawEscrowProposalRequest + - provenance.marker.v1.MsgWithdrawEscrowProposalResponse + - provenance.marker.v1.MsgSetDenomMetadataProposalRequest + - provenance.marker.v1.MsgSetDenomMetadataProposalResponse + - provenance.marker.v1.MsgUpdateParamsRequest + - provenance.marker.v1.MsgUpdateParamsResponse + - provenance.marker.v1.QueryParamsRequest + - provenance.marker.v1.QueryParamsResponse + - provenance.marker.v1.QueryAllMarkersRequest + - provenance.marker.v1.QueryAllMarkersResponse + - provenance.marker.v1.QueryMarkerRequest + - provenance.marker.v1.QueryMarkerResponse + - provenance.marker.v1.QueryHoldingRequest + - provenance.marker.v1.QueryHoldingResponse + - provenance.marker.v1.QuerySupplyRequest + - provenance.marker.v1.QuerySupplyResponse + - provenance.marker.v1.QueryEscrowRequest + - provenance.marker.v1.QueryEscrowResponse + - provenance.marker.v1.QueryAccessRequest + - provenance.marker.v1.QueryAccessResponse + - provenance.marker.v1.QueryDenomMetadataRequest + - provenance.marker.v1.QueryDenomMetadataResponse + - provenance.marker.v1.QueryAccountDataRequest + - provenance.marker.v1.QueryAccountDataResponse + - provenance.marker.v1.QueryNetAssetValuesRequest + - provenance.marker.v1.QueryNetAssetValuesResponse - provenance.metadata.v1.MsgWriteScopeRequest - provenance.metadata.v1.MsgWriteScopeResponse - provenance.metadata.v1.MsgDeleteScopeRequest @@ -287,7 +249,6 @@ types: - provenance.metadata.v1.MsgMigrateValueOwnerRequest - provenance.metadata.v1.MsgMigrateValueOwnerResponse - provenance.metadata.v1.MsgWriteSessionRequest - - provenance.metadata.v1.SessionIdComponents - provenance.metadata.v1.MsgWriteSessionResponse - provenance.metadata.v1.MsgWriteRecordRequest - provenance.metadata.v1.MsgWriteRecordResponse @@ -299,12 +260,12 @@ types: - provenance.metadata.v1.MsgDeleteScopeSpecificationResponse - provenance.metadata.v1.MsgWriteContractSpecificationRequest - provenance.metadata.v1.MsgWriteContractSpecificationResponse + - provenance.metadata.v1.MsgDeleteContractSpecificationRequest + - provenance.metadata.v1.MsgDeleteContractSpecificationResponse - provenance.metadata.v1.MsgAddContractSpecToScopeSpecRequest - provenance.metadata.v1.MsgAddContractSpecToScopeSpecResponse - provenance.metadata.v1.MsgDeleteContractSpecFromScopeSpecRequest - provenance.metadata.v1.MsgDeleteContractSpecFromScopeSpecResponse - - provenance.metadata.v1.MsgDeleteContractSpecificationRequest - - provenance.metadata.v1.MsgDeleteContractSpecificationResponse - provenance.metadata.v1.MsgWriteRecordSpecificationRequest - provenance.metadata.v1.MsgWriteRecordSpecificationResponse - provenance.metadata.v1.MsgDeleteRecordSpecificationRequest @@ -315,32 +276,44 @@ types: - provenance.metadata.v1.MsgDeleteOSLocatorResponse - provenance.metadata.v1.MsgModifyOSLocatorRequest - provenance.metadata.v1.MsgModifyOSLocatorResponse + - provenance.metadata.v1.MsgSetAccountDataRequest + - provenance.metadata.v1.MsgSetAccountDataResponse + - provenance.metadata.v1.MsgAddNetAssetValuesRequest + - provenance.metadata.v1.MsgAddNetAssetValuesResponse - provenance.metadata.v1.QueryParamsRequest - provenance.metadata.v1.QueryParamsResponse - provenance.metadata.v1.ScopeRequest - provenance.metadata.v1.ScopeResponse - - provenance.metadata.v1.ScopeWrapper + - provenance.metadata.v1.ScopesAllRequest + - provenance.metadata.v1.ScopesAllResponse - provenance.metadata.v1.SessionsRequest - provenance.metadata.v1.SessionsResponse - - provenance.metadata.v1.SessionWrapper + - provenance.metadata.v1.SessionsAllRequest + - provenance.metadata.v1.SessionsAllResponse - provenance.metadata.v1.RecordsRequest - provenance.metadata.v1.RecordsResponse - - provenance.metadata.v1.RecordWrapper + - provenance.metadata.v1.RecordsAllRequest + - provenance.metadata.v1.RecordsAllResponse - provenance.metadata.v1.OwnershipRequest - provenance.metadata.v1.OwnershipResponse - provenance.metadata.v1.ValueOwnershipRequest - provenance.metadata.v1.ValueOwnershipResponse - provenance.metadata.v1.ScopeSpecificationRequest - provenance.metadata.v1.ScopeSpecificationResponse - - provenance.metadata.v1.ScopeSpecificationWrapper + - provenance.metadata.v1.ScopeSpecificationsAllRequest + - provenance.metadata.v1.ScopeSpecificationsAllResponse - provenance.metadata.v1.ContractSpecificationRequest - provenance.metadata.v1.ContractSpecificationResponse - - provenance.metadata.v1.ContractSpecificationWrapper + - provenance.metadata.v1.ContractSpecificationsAllRequest + - provenance.metadata.v1.ContractSpecificationsAllResponse - provenance.metadata.v1.RecordSpecificationsForContractSpecificationRequest - provenance.metadata.v1.RecordSpecificationsForContractSpecificationResponse - provenance.metadata.v1.RecordSpecificationRequest - provenance.metadata.v1.RecordSpecificationResponse - - provenance.metadata.v1.RecordSpecificationWrapper + - provenance.metadata.v1.RecordSpecificationsAllRequest + - provenance.metadata.v1.RecordSpecificationsAllResponse + - provenance.metadata.v1.GetByAddrRequest + - provenance.metadata.v1.GetByAddrResponse - provenance.metadata.v1.OSLocatorParamsRequest - provenance.metadata.v1.OSLocatorParamsResponse - provenance.metadata.v1.OSLocatorRequest @@ -349,64 +322,42 @@ types: - provenance.metadata.v1.OSLocatorsByURIResponse - provenance.metadata.v1.OSLocatorsByScopeRequest - provenance.metadata.v1.OSLocatorsByScopeResponse - - provenance.msgfees.v1.EventMsgFee - - provenance.msgfees.v1.EventMsgFees - - provenance.msgfees.v1.MsgFee + - provenance.metadata.v1.OSAllLocatorsRequest + - provenance.metadata.v1.OSAllLocatorsResponse + - provenance.metadata.v1.QueryScopeNetAssetValuesRequest + - provenance.metadata.v1.QueryScopeNetAssetValuesResponse + - provenance.msgfees.v1.MsgAssessCustomMsgFeeRequest + - provenance.msgfees.v1.MsgAssessCustomMsgFeeResponse + - provenance.msgfees.v1.MsgAddMsgFeeProposalRequest + - provenance.msgfees.v1.MsgAddMsgFeeProposalResponse + - provenance.msgfees.v1.MsgUpdateMsgFeeProposalRequest + - provenance.msgfees.v1.MsgUpdateMsgFeeProposalResponse + - provenance.msgfees.v1.MsgRemoveMsgFeeProposalRequest + - provenance.msgfees.v1.MsgRemoveMsgFeeProposalResponse + - provenance.msgfees.v1.MsgUpdateNhashPerUsdMilProposalRequest + - provenance.msgfees.v1.MsgUpdateNhashPerUsdMilProposalResponse + - provenance.msgfees.v1.MsgUpdateConversionFeeDenomProposalRequest + - provenance.msgfees.v1.MsgUpdateConversionFeeDenomProposalResponse - provenance.msgfees.v1.QueryParamsRequest - provenance.msgfees.v1.QueryParamsResponse - provenance.msgfees.v1.QueryAllMsgFeesRequest - provenance.msgfees.v1.QueryAllMsgFeesResponse - - provenance.msgfees.v1.MsgAssessCustomMsgFeeRequest - - provenance.msgfees.v1.MsgAssessCustomMsgFeeResponse - - provenance.name.v1.NameRecord - - provenance.name.v1.CreateRootNameProposal - - provenance.name.v1.EventNameBound - - provenance.name.v1.EventNameUnbound - - provenance.name.v1.EventNameUpdate - - provenance.name.v1.QueryParamsRequest - - provenance.name.v1.QueryParamsResponse - - provenance.name.v1.QueryResolveRequest - - provenance.name.v1.QueryResolveResponse - - provenance.name.v1.QueryReverseLookupRequest - - provenance.name.v1.QueryReverseLookupResponse - provenance.name.v1.MsgBindNameRequest - provenance.name.v1.MsgBindNameResponse - provenance.name.v1.MsgDeleteNameRequest - provenance.name.v1.MsgDeleteNameResponse - - provenance.name.v1.MsgCreateRootNameRequest - - provenance.name.v1.MsgCreateRootNameResponse - provenance.name.v1.MsgModifyNameRequest - provenance.name.v1.MsgModifyNameResponse - - provenance.reward.v1.QueryRewardProgramByIDRequest - - provenance.reward.v1.QueryRewardProgramByIDResponse - - provenance.reward.v1.QueryRewardProgramsRequest - - provenance.reward.v1.QueryRewardProgramsResponse - - provenance.reward.v1.QueryClaimPeriodRewardDistributionsRequest - - provenance.reward.v1.QueryClaimPeriodRewardDistributionsResponse - - provenance.reward.v1.QueryClaimPeriodRewardDistributionsByIDRequest - - provenance.reward.v1.QueryClaimPeriodRewardDistributionsByIDResponse - - provenance.reward.v1.QueryRewardDistributionsByAddressRequest - - provenance.reward.v1.QueryRewardDistributionsByAddressResponse - - provenance.reward.v1.RewardAccountResponse - - provenance.reward.v1.RewardProgram - - provenance.reward.v1.ClaimPeriodRewardDistribution - - provenance.reward.v1.RewardAccountState - - provenance.reward.v1.QualifyingAction - - provenance.reward.v1.QualifyingActions - - provenance.reward.v1.ActionDelegate - - provenance.reward.v1.ActionTransfer - - provenance.reward.v1.ActionVote - - provenance.reward.v1.ActionCounter - - provenance.reward.v1.MsgCreateRewardProgramRequest - - provenance.reward.v1.MsgCreateRewardProgramResponse - - provenance.reward.v1.MsgEndRewardProgramRequest - - provenance.reward.v1.MsgEndRewardProgramResponse - - provenance.reward.v1.MsgClaimRewardsRequest - - provenance.reward.v1.MsgClaimRewardsResponse - - provenance.reward.v1.MsgClaimAllRewardsRequest - - provenance.reward.v1.MsgClaimAllRewardsResponse - - provenance.reward.v1.ClaimedRewardPeriodDetail - - provenance.reward.v1.RewardProgramClaimDetail + - provenance.name.v1.MsgCreateRootNameRequest + - provenance.name.v1.MsgCreateRootNameResponse + - provenance.name.v1.MsgUpdateParamsRequest + - provenance.name.v1.MsgUpdateParamsResponse + - provenance.name.v1.QueryParamsRequest + - provenance.name.v1.QueryParamsResponse + - provenance.name.v1.QueryResolveRequest + - provenance.name.v1.QueryResolveResponse + - provenance.name.v1.QueryReverseLookupRequest + - provenance.name.v1.QueryReverseLookupResponse - provenance.trigger.v1.MsgCreateTriggerRequest - provenance.trigger.v1.MsgCreateTriggerResponse - provenance.trigger.v1.MsgDestroyTriggerRequest @@ -415,8 +366,3 @@ types: - provenance.trigger.v1.QueryTriggerByIDResponse - provenance.trigger.v1.QueryTriggersRequest - provenance.trigger.v1.QueryTriggersResponse - - provenance.trigger.v1.Trigger - - provenance.trigger.v1.BlockHeightEvent - - provenance.trigger.v1.BlockTimeEvent - - provenance.trigger.v1.TransactionEvent - - provenance.trigger.v1.Attribute From c713f349dc96ee98d379076add9af617aef52a14 Mon Sep 17 00:00:00 2001 From: kwt <4344285+kwtalley@users.noreply.github.com> Date: Tue, 9 Jul 2024 14:37:34 -0500 Subject: [PATCH 03/43] add oracle message types to generator --- packages/proto-build/provenance.buf.gen.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/proto-build/provenance.buf.gen.yaml b/packages/proto-build/provenance.buf.gen.yaml index 078955b4..ebc538ef 100644 --- a/packages/proto-build/provenance.buf.gen.yaml +++ b/packages/proto-build/provenance.buf.gen.yaml @@ -358,6 +358,14 @@ types: - provenance.name.v1.QueryResolveResponse - provenance.name.v1.QueryReverseLookupRequest - provenance.name.v1.QueryReverseLookupResponse + - provenance.oracle.v1.MsgUpdateOracleRequest + - provenance.oracle.v1.MsgUpdateOracleResponse + - provenance.oracle.v1.MsgSendQueryOracleRequest + - provenance.oracle.v1.MsgSendQueryOracleResponse + - provenance.oracle.v1.QueryOracleAddressRequest + - provenance.oracle.v1.QueryOracleAddressResponse + - provenance.oracle.v1.QueryOracleRequest + - provenance.oracle.v1.QueryOracleResponse - provenance.trigger.v1.MsgCreateTriggerRequest - provenance.trigger.v1.MsgCreateTriggerResponse - provenance.trigger.v1.MsgDestroyTriggerRequest From 3359d49eb2722387073959d2729fede8faef442a Mon Sep 17 00:00:00 2001 From: kwt <4344285+kwtalley@users.noreply.github.com> Date: Tue, 9 Jul 2024 14:47:50 -0500 Subject: [PATCH 04/43] update provenance version in generate script and COMMIT file --- packages/provwasm-std/src/types/PROVENANCE_COMMIT | 2 +- scripts/update-and-rebuild.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/provwasm-std/src/types/PROVENANCE_COMMIT b/packages/provwasm-std/src/types/PROVENANCE_COMMIT index 13e94ce5..ce7306d7 100644 --- a/packages/provwasm-std/src/types/PROVENANCE_COMMIT +++ b/packages/provwasm-std/src/types/PROVENANCE_COMMIT @@ -1 +1 @@ -v1.18.0 \ No newline at end of file +v1.19.0-rc2 \ No newline at end of file diff --git a/scripts/update-and-rebuild.sh b/scripts/update-and-rebuild.sh index a1bfbb90..390a2757 100755 --- a/scripts/update-and-rebuild.sh +++ b/scripts/update-and-rebuild.sh @@ -3,7 +3,7 @@ set -euxo pipefail SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -LATEST_PROVENANCE_VERSION="v1.18.0" +LATEST_PROVENANCE_VERSION="v1.19.0-rc2" PROVENANCE_REV=${1:-$LATEST_PROVENANCE_VERSION} COMMIT=${2:-"skip"} From 312dfebe714a899d781a9f22b9da7259b8a79ea8 Mon Sep 17 00:00:00 2001 From: kwt <4344285+kwtalley@users.noreply.github.com> Date: Tue, 9 Jul 2024 14:48:19 -0500 Subject: [PATCH 05/43] add ibchooks types --- .../src/types/provenance/ibchooks/mod.rs | 1 + .../src/types/provenance/ibchooks/v1.rs | 134 ++++++++++++++++++ 2 files changed, 135 insertions(+) create mode 100644 packages/provwasm-std/src/types/provenance/ibchooks/mod.rs create mode 100644 packages/provwasm-std/src/types/provenance/ibchooks/v1.rs diff --git a/packages/provwasm-std/src/types/provenance/ibchooks/mod.rs b/packages/provwasm-std/src/types/provenance/ibchooks/mod.rs new file mode 100644 index 00000000..a3a6d96c --- /dev/null +++ b/packages/provwasm-std/src/types/provenance/ibchooks/mod.rs @@ -0,0 +1 @@ +pub mod v1; diff --git a/packages/provwasm-std/src/types/provenance/ibchooks/v1.rs b/packages/provwasm-std/src/types/provenance/ibchooks/v1.rs new file mode 100644 index 00000000..980ec42d --- /dev/null +++ b/packages/provwasm-std/src/types/provenance/ibchooks/v1.rs @@ -0,0 +1,134 @@ +use provwasm_proc_macro::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 = "/provenance.ibchooks.v1.Params")] +pub struct Params { + #[prost(string, repeated, tag = "1")] + pub allowed_async_ack_contracts: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.ibchooks.v1.QueryParamsRequest")] +#[proto_query( + path = "/provenance.ibchooks.v1.Query/Params", + response_type = QueryParamsResponse +)] +pub struct QueryParamsRequest {} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.ibchooks.v1.QueryParamsResponse")] +pub struct QueryParamsResponse { + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.ibchooks.v1.MsgEmitIBCAck")] +pub struct MsgEmitIbcAck { + #[prost(string, tag = "1")] + pub sender: ::prost::alloc::string::String, + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub packet_sequence: u64, + #[prost(string, tag = "3")] + pub channel: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.ibchooks.v1.MsgEmitIBCAckResponse")] +pub struct MsgEmitIbcAckResponse { + #[prost(string, tag = "1")] + pub contract_result: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub ibc_ack: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.ibchooks.v1.MsgUpdateParamsRequest")] +pub struct MsgUpdateParamsRequest { + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.ibchooks.v1.MsgUpdateParamsResponse")] +pub struct MsgUpdateParamsResponse {} +pub struct IbchooksQuerier<'a, Q: cosmwasm_std::CustomQuery> { + querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, +} +impl<'a, Q: cosmwasm_std::CustomQuery> IbchooksQuerier<'a, Q> { + pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self { + Self { querier } + } + pub fn params(&self) -> Result { + QueryParamsRequest {}.query(self.querier) + } +} From 00b8c1afb2b0f5e3e62de0f2e0ce25ae0aa42914 Mon Sep 17 00:00:00 2001 From: kwt <4344285+kwtalley@users.noreply.github.com> Date: Tue, 9 Jul 2024 14:48:30 -0500 Subject: [PATCH 06/43] add ibcratelimit types --- .../src/types/provenance/ibcratelimit/mod.rs | 1 + .../src/types/provenance/ibcratelimit/v1.rs | 125 ++++++++++++++++++ 2 files changed, 126 insertions(+) create mode 100644 packages/provwasm-std/src/types/provenance/ibcratelimit/mod.rs create mode 100644 packages/provwasm-std/src/types/provenance/ibcratelimit/v1.rs diff --git a/packages/provwasm-std/src/types/provenance/ibcratelimit/mod.rs b/packages/provwasm-std/src/types/provenance/ibcratelimit/mod.rs new file mode 100644 index 00000000..a3a6d96c --- /dev/null +++ b/packages/provwasm-std/src/types/provenance/ibcratelimit/mod.rs @@ -0,0 +1 @@ +pub mod v1; diff --git a/packages/provwasm-std/src/types/provenance/ibcratelimit/v1.rs b/packages/provwasm-std/src/types/provenance/ibcratelimit/v1.rs new file mode 100644 index 00000000..114882ff --- /dev/null +++ b/packages/provwasm-std/src/types/provenance/ibcratelimit/v1.rs @@ -0,0 +1,125 @@ +use provwasm_proc_macro::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 = "/provenance.ibcratelimit.v1.Params")] +pub struct Params { + #[prost(string, tag = "1")] + pub contract_address: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.ibcratelimit.v1.ParamsRequest")] +#[proto_query( + path = "/provenance.ibcratelimit.v1.Query/Params", + response_type = ParamsResponse +)] +pub struct ParamsRequest {} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.ibcratelimit.v1.ParamsResponse")] +pub struct ParamsResponse { + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.ibcratelimit.v1.MsgGovUpdateParamsRequest")] +#[deprecated] +pub struct MsgGovUpdateParamsRequest { + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.ibcratelimit.v1.MsgGovUpdateParamsResponse")] +#[deprecated] +pub struct MsgGovUpdateParamsResponse {} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.ibcratelimit.v1.MsgUpdateParamsRequest")] +pub struct MsgUpdateParamsRequest { + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.ibcratelimit.v1.MsgUpdateParamsResponse")] +pub struct MsgUpdateParamsResponse {} +pub struct IbcratelimitQuerier<'a, Q: cosmwasm_std::CustomQuery> { + querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, +} +impl<'a, Q: cosmwasm_std::CustomQuery> IbcratelimitQuerier<'a, Q> { + pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self { + Self { querier } + } + pub fn params(&self) -> Result { + ParamsRequest {}.query(self.querier) + } +} From d17f98431be0362284a8d1e4f624878fbebb2c37 Mon Sep 17 00:00:00 2001 From: kwt <4344285+kwtalley@users.noreply.github.com> Date: Tue, 9 Jul 2024 14:48:42 -0500 Subject: [PATCH 07/43] add oracle types --- .../src/types/provenance/oracle/mod.rs | 1 + .../src/types/provenance/oracle/v1.rs | 170 ++++++++++++++++++ 2 files changed, 171 insertions(+) create mode 100644 packages/provwasm-std/src/types/provenance/oracle/mod.rs create mode 100644 packages/provwasm-std/src/types/provenance/oracle/v1.rs diff --git a/packages/provwasm-std/src/types/provenance/oracle/mod.rs b/packages/provwasm-std/src/types/provenance/oracle/mod.rs new file mode 100644 index 00000000..a3a6d96c --- /dev/null +++ b/packages/provwasm-std/src/types/provenance/oracle/mod.rs @@ -0,0 +1 @@ +pub mod v1; diff --git a/packages/provwasm-std/src/types/provenance/oracle/v1.rs b/packages/provwasm-std/src/types/provenance/oracle/v1.rs new file mode 100644 index 00000000..2ac18a45 --- /dev/null +++ b/packages/provwasm-std/src/types/provenance/oracle/v1.rs @@ -0,0 +1,170 @@ +use provwasm_proc_macro::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 = "/provenance.oracle.v1.QueryOracleAddressRequest")] +#[proto_query( + path = "/provenance.oracle.v1.Query/OracleAddress", + response_type = QueryOracleAddressResponse +)] +pub struct QueryOracleAddressRequest {} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.oracle.v1.QueryOracleAddressResponse")] +pub struct QueryOracleAddressResponse { + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.oracle.v1.QueryOracleRequest")] +#[proto_query( + path = "/provenance.oracle.v1.Query/Oracle", + response_type = QueryOracleResponse +)] +pub struct QueryOracleRequest { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub query: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.oracle.v1.QueryOracleResponse")] +pub struct QueryOracleResponse { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.oracle.v1.MsgSendQueryOracleRequest")] +pub struct MsgSendQueryOracleRequest { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub query: ::prost::alloc::vec::Vec, + #[prost(string, tag = "3")] + pub channel: ::prost::alloc::string::String, + #[prost(string, tag = "4")] + pub authority: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.oracle.v1.MsgSendQueryOracleResponse")] +pub struct MsgSendQueryOracleResponse { + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub sequence: u64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.oracle.v1.MsgUpdateOracleRequest")] +pub struct MsgUpdateOracleRequest { + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub authority: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.oracle.v1.MsgUpdateOracleResponse")] +pub struct MsgUpdateOracleResponse {} +pub struct OracleQuerier<'a, Q: cosmwasm_std::CustomQuery> { + querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, +} +impl<'a, Q: cosmwasm_std::CustomQuery> OracleQuerier<'a, Q> { + pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self { + Self { querier } + } + pub fn oracle_address(&self) -> Result { + QueryOracleAddressRequest {}.query(self.querier) + } + pub fn oracle( + &self, + query: ::prost::alloc::vec::Vec, + ) -> Result { + QueryOracleRequest { query }.query(self.querier) + } +} From 69308574d31af47143f53b0750cce308a4981b71 Mon Sep 17 00:00:00 2001 From: kwt <4344285+kwtalley@users.noreply.github.com> Date: Tue, 9 Jul 2024 23:50:36 -0500 Subject: [PATCH 08/43] qualify TryFrom/Into Result in CosmwasmExt macro --- packages/provwasm-proc-macro/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/provwasm-proc-macro/src/lib.rs b/packages/provwasm-proc-macro/src/lib.rs index efcbdc37..dd00cb3c 100644 --- a/packages/provwasm-proc-macro/src/lib.rs +++ b/packages/provwasm-proc-macro/src/lib.rs @@ -149,7 +149,7 @@ pub fn derive_cosmwasm_ext(input: TokenStream) -> TokenStream { impl TryFrom for #ident { type Error = prost::DecodeError; - fn try_from(value: crate::shim::Any) -> Result { + fn try_from(value: crate::shim::Any) -> ::std::result::Result { prost::Message::decode(value.value.as_slice()) } } @@ -157,7 +157,7 @@ pub fn derive_cosmwasm_ext(input: TokenStream) -> TokenStream { impl TryInto for #ident { type Error = prost::EncodeError; - fn try_into(self) -> Result { + fn try_into(self) -> ::std::result::Result { let value = prost::Message::encode_to_vec(&self); Ok(crate::shim::Any { type_url: <#ident>::TYPE_URL.to_string(), From 4c884dab7bda2cd7a59c94e89084079c4530b415 Mon Sep 17 00:00:00 2001 From: kwt <4344285+kwtalley@users.noreply.github.com> Date: Tue, 9 Jul 2024 23:51:58 -0500 Subject: [PATCH 09/43] correct the mod path in exclusions for generation --- packages/proto-build/src/code_generator.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/proto-build/src/code_generator.rs b/packages/proto-build/src/code_generator.rs index f5630c2c..cb01eed1 100644 --- a/packages/proto-build/src/code_generator.rs +++ b/packages/proto-build/src/code_generator.rs @@ -159,8 +159,7 @@ impl CodeGenerator { if !project.exclude_mods.is_empty() { for excluded_mod in project.exclude_mods.clone() { - cmd.arg("--exclude-path") - .arg(proto_path.join(project.name.clone()).join(excluded_mod)); + cmd.arg("--exclude-path").arg(proto_path.join(excluded_mod)); } } @@ -187,8 +186,7 @@ impl CodeGenerator { if !project.exclude_mods.is_empty() { for include_mod in project.exclude_mods { - cmd.arg("--exclude-path") - .arg(proto_path.join(project.name.clone()).join(include_mod)); + cmd.arg("--exclude-path").arg(proto_path.join(include_mod)); } } From 36ac46159826d307be09d994c7d23602a7c4a7d0 Mon Sep 17 00:00:00 2001 From: kwt <4344285+kwtalley@users.noreply.github.com> Date: Tue, 9 Jul 2024 23:53:12 -0500 Subject: [PATCH 10/43] set excludes paths for generating types --- packages/proto-build/src/main.rs | 11 +++++++++-- packages/proto-build/src/transform.rs | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/proto-build/src/main.rs b/packages/proto-build/src/main.rs index 75ae7024..100e70de 100644 --- a/packages/proto-build/src/main.rs +++ b/packages/proto-build/src/main.rs @@ -19,7 +19,7 @@ const PROVENANCE_REV: &str = "v1.19.0-rc2"; const OUT_DIR: &str = "../provwasm-std/src/types/"; /// Directory where the provenance submodule is located const PROVENANCE_DIR: &str = "../../dependencies/provenance/"; -const THIRD_PARTY_DIR: &str = "../../dependencies/provenance/third_party/proto/"; +const THIRD_PARTY_DIR: &str = "../../dependencies/provenance/third_party/"; /// A temporary directory for proto building const TMP_BUILD_DIR: &str = "/tmp/provwasm-std/proto-build"; @@ -46,7 +46,14 @@ pub fn generate() { version: PROVENANCE_REV.to_string(), project_dir: THIRD_PARTY_DIR.to_string(), buf_gen_template: "third-party.buf.gen.yaml".to_string(), - exclude_mods: vec![], + exclude_mods: vec![ + "amino".to_string(), + "cosmos_proto".to_string(), + "cosmos/autocli".to_string(), + "cosmos/base/reflection".to_string(), + "cosmos/reflection".to_string(), + "gogoproto".to_string(), + ], }; let provenance_code_generator = CodeGenerator::new( diff --git a/packages/proto-build/src/transform.rs b/packages/proto-build/src/transform.rs index df644257..7decd379 100644 --- a/packages/proto-build/src/transform.rs +++ b/packages/proto-build/src/transform.rs @@ -14,7 +14,7 @@ use crate::transformers; /// Protos belonging to these Protobuf packages will be excluded /// (i.e. because they are sourced from `tendermint-proto`) -const EXCLUDED_PROTO_PACKAGES: &[&str] = &["cosmos_proto", "gogoproto", "google"]; +const EXCLUDED_PROTO_PACKAGES: &[&str] = &["amino", "cosmos_proto", "gogoproto", "google"]; pub fn copy_and_transform_all(from_dir: &Path, to_dir: &Path, descriptor: &FileDescriptorSet) { let root = PathBuf::from(env!("CARGO_MANIFEST_DIR")); From da45a8bb85d57792920955babffb8e747065a234 Mon Sep 17 00:00:00 2001 From: kwt <4344285+kwtalley@users.noreply.github.com> Date: Tue, 9 Jul 2024 23:54:16 -0500 Subject: [PATCH 11/43] generate all types instead of whitelisting types --- packages/proto-build/provenance.buf.gen.yaml | 370 +----------------- packages/proto-build/third-party.buf.gen.yaml | 103 +---- 2 files changed, 2 insertions(+), 471 deletions(-) diff --git a/packages/proto-build/provenance.buf.gen.yaml b/packages/proto-build/provenance.buf.gen.yaml index ebc538ef..a1da1cee 100644 --- a/packages/proto-build/provenance.buf.gen.yaml +++ b/packages/proto-build/provenance.buf.gen.yaml @@ -5,372 +5,4 @@ plugins: opt: - extern_path=.google.protobuf.Timestamp=crate::shim::Timestamp - extern_path=.google.protobuf.Duration=crate::shim::Duration - - extern_path=.google.protobuf.Any=crate::shim::Any -types: - include: - - provenance.attribute.v1.MsgAddAttributeRequest - - provenance.attribute.v1.MsgAddAttributeResponse - - provenance.attribute.v1.MsgUpdateAttributeRequest - - provenance.attribute.v1.MsgUpdateAttributeResponse - - provenance.attribute.v1.MsgUpdateAttributeExpirationRequest - - provenance.attribute.v1.MsgUpdateAttributeExpirationResponse - - provenance.attribute.v1.MsgDeleteAttributeRequest - - provenance.attribute.v1.MsgDeleteAttributeResponse - - provenance.attribute.v1.MsgDeleteDistinctAttributeRequest - - provenance.attribute.v1.MsgDeleteDistinctAttributeResponse - - provenance.attribute.v1.MsgSetAccountDataRequest - - provenance.attribute.v1.MsgSetAccountDataResponse - - provenance.attribute.v1.MsgUpdateParamsRequest - - provenance.attribute.v1.MsgUpdateParamsResponse - - provenance.attribute.v1.QueryParamsRequest - - provenance.attribute.v1.QueryParamsResponse - - provenance.attribute.v1.QueryAttributeRequest - - provenance.attribute.v1.QueryAttributeResponse - - provenance.attribute.v1.QueryAttributesRequest - - provenance.attribute.v1.QueryAttributesResponse - - provenance.attribute.v1.QueryScanRequest - - provenance.attribute.v1.QueryScanResponse - - provenance.attribute.v1.QueryAttributeAccountsRequest - - provenance.attribute.v1.QueryAttributeAccountsResponse - - provenance.attribute.v1.QueryAccountDataRequest - - provenance.attribute.v1.QueryAccountDataResponse - - provenance.exchange.v1.MsgCreateAskRequest - - provenance.exchange.v1.MsgCreateAskResponse - - provenance.exchange.v1.MsgCreateBidRequest - - provenance.exchange.v1.MsgCreateBidResponse - - provenance.exchange.v1.MsgCommitFundsRequest - - provenance.exchange.v1.MsgCommitFundsResponse - - provenance.exchange.v1.MsgCancelOrderRequest - - provenance.exchange.v1.MsgCancelOrderResponse - - provenance.exchange.v1.MsgFillBidsRequest - - provenance.exchange.v1.MsgFillBidsResponse - - provenance.exchange.v1.MsgFillAsksRequest - - provenance.exchange.v1.MsgFillAsksResponse - - provenance.exchange.v1.MsgMarketSettleRequest - - provenance.exchange.v1.MsgMarketSettleResponse - - provenance.exchange.v1.MsgMarketCommitmentSettleRequest - - provenance.exchange.v1.MsgMarketCommitmentSettleResponse - - provenance.exchange.v1.MsgMarketReleaseCommitmentsRequest - - provenance.exchange.v1.MsgMarketReleaseCommitmentsRequest - - provenance.exchange.v1.MsgMarketSetOrderExternalIDRequest - - provenance.exchange.v1.MsgMarketSetOrderExternalIDResponse - - provenance.exchange.v1.MsgMarketWithdrawRequest - - provenance.exchange.v1.MsgMarketWithdrawResponse - - provenance.exchange.v1.MsgMarketUpdateDetailsRequest - - provenance.exchange.v1.MsgMarketUpdateDetailsResponse - - provenance.exchange.v1.MsgMarketUpdateEnabledRequest - - provenance.exchange.v1.MsgMarketUpdateEnabledResponse - - provenance.exchange.v1.MsgMarketUpdateAcceptingOrdersRequest - - provenance.exchange.v1.MsgMarketUpdateAcceptingOrdersResponse - - provenance.exchange.v1.MsgMarketUpdateUserSettleRequest - - provenance.exchange.v1.MsgMarketUpdateUserSettleResponse - - provenance.exchange.v1.MsgMarketUpdateAcceptingCommitmentsRequest - - provenance.exchange.v1.MsgMarketUpdateAcceptingCommitmentsResponse - - provenance.exchange.v1.MsgMarketUpdateIntermediaryDenomRequest - - provenance.exchange.v1.MsgMarketUpdateIntermediaryDenomResponse - - provenance.exchange.v1.MsgMarketManagePermissionsRequest - - provenance.exchange.v1.MsgMarketManagePermissionsResponse - - provenance.exchange.v1.MsgMarketManageReqAttrsRequest - - provenance.exchange.v1.MsgMarketManageReqAttrsResponse - - provenance.exchange.v1.MsgCreatePaymentRequest - - provenance.exchange.v1.MsgCreatePaymentResponse - - provenance.exchange.v1.MsgAcceptPaymentRequest - - provenance.exchange.v1.MsgAcceptPaymentResponse - - provenance.exchange.v1.MsgRejectPaymentRequest - - provenance.exchange.v1.MsgRejectPaymentResponse - - provenance.exchange.v1.MsgRejectPaymentsRequest - - provenance.exchange.v1.MsgRejectPaymentsResponse - - provenance.exchange.v1.MsgCancelPaymentsRequest - - provenance.exchange.v1.MsgCancelPaymentsResponse - - provenance.exchange.v1.MsgChangePaymentTargetRequest - - provenance.exchange.v1.MsgChangePaymentTargetResponse - - provenance.exchange.v1.MsgGovCreateMarketRequest - - provenance.exchange.v1.MsgGovCreateMarketResponse - - provenance.exchange.v1.MsgGovManageFeesRequest - - provenance.exchange.v1.MsgGovManageFeesResponse - - provenance.exchange.v1.MsgGovCloseMarketRequest - - provenance.exchange.v1.MsgGovCloseMarketResponse - - provenance.exchange.v1.MsgGovUpdateParamsRequest - - provenance.exchange.v1.MsgGovUpdateParamsResponse - - provenance.exchange.v1.MsgUpdateParamsRequest - - provenance.exchange.v1.MsgUpdateParamsResponse - - provenance.exchange.v1.QueryOrderFeeCalcRequest - - provenance.exchange.v1.QueryOrderFeeCalcResponse - - provenance.exchange.v1.QueryGetOrderRequest - - provenance.exchange.v1.QueryGetOrderResponse - - provenance.exchange.v1.QueryGetOrderByExternalIDRequest - - provenance.exchange.v1.QueryGetOrderByExternalIDResponse - - provenance.exchange.v1.QueryGetMarketOrdersRequest - - provenance.exchange.v1.QueryGetMarketOrdersResponse - - provenance.exchange.v1.QueryGetOwnerOrdersRequest - - provenance.exchange.v1.QueryGetOwnerOrdersResponse - - provenance.exchange.v1.QueryGetAssetOrdersRequest - - provenance.exchange.v1.QueryGetAssetOrdersResponse - - provenance.exchange.v1.QueryGetAllOrdersRequest - - provenance.exchange.v1.QueryGetAllOrdersResponse - - provenance.exchange.v1.QueryGetCommitmentRequest - - provenance.exchange.v1.QueryGetCommitmentResponse - - provenance.exchange.v1.QueryGetAccountCommitmentsRequest - - provenance.exchange.v1.QueryGetAccountCommitmentsResponse - - provenance.exchange.v1.QueryGetMarketCommitmentsRequest - - provenance.exchange.v1.QueryGetMarketCommitmentsResponse - - provenance.exchange.v1.QueryGetAllCommitmentsRequest - - provenance.exchange.v1.QueryGetAllCommitmentsResponse - - provenance.exchange.v1.QueryGetMarketRequest - - provenance.exchange.v1.QueryGetMarketResponse - - provenance.exchange.v1.QueryGetAllMarketsRequest - - provenance.exchange.v1.QueryGetAllMarketsResponse - - provenance.exchange.v1.QueryParamsRequest - - provenance.exchange.v1.QueryParamsResponse - - provenance.exchange.v1.QueryCommitmentSettlementFeeCalcRequest - - provenance.exchange.v1.QueryCommitmentSettlementFeeCalcResponse - - provenance.exchange.v1.QueryValidateCreateMarketRequest - - provenance.exchange.v1.QueryValidateCreateMarketResponse - - provenance.exchange.v1.QueryValidateMarketRequest - - provenance.exchange.v1.QueryValidateMarketResponse - - provenance.exchange.v1.QueryValidateManageFeesRequest - - provenance.exchange.v1.QueryValidateManageFeesResponse - - provenance.exchange.v1.QueryGetPaymentRequest - - provenance.exchange.v1.QueryGetPaymentResponse - - provenance.exchange.v1.QueryGetPaymentsWithSourceRequest - - provenance.exchange.v1.QueryGetPaymentsWithSourceResponse - - provenance.exchange.v1.QueryGetPaymentsWithTargetRequest - - provenance.exchange.v1.QueryGetPaymentsWithTargetResponse - - provenance.exchange.v1.QueryGetAllPaymentsRequest - - provenance.exchange.v1.QueryGetAllPaymentsResponse - - provenance.exchange.v1.QueryPaymentFeeCalcRequest - - provenance.exchange.v1.QueryPaymentFeeCalcResponse - - provenance.hold.v1.GetHoldsRequest - - provenance.hold.v1.GetHoldsResponse - - provenance.hold.v1.GetAllHoldsRequest - - provenance.hold.v1.GetAllHoldsResponse - - provenance.ibchooks.v1.MsgEmitIBCAck - - provenance.ibchooks.v1.MsgEmitIBCAckResponse - - provenance.ibchooks.v1.MsgUpdateParamsRequest - - provenance.ibchooks.v1.MsgUpdateParamsResponse - - provenance.ibchooks.v1.QueryParamsRequest - - provenance.ibchooks.v1.QueryParamsResponse - - provenance.ibcratelimit.v1.MsgGovUpdateParamsRequest - - provenance.ibcratelimit.v1.MsgGovUpdateParamsResponse - - provenance.ibcratelimit.v1.MsgUpdateParamsRequest - - provenance.ibcratelimit.v1.MsgUpdateParamsResponse - - provenance.ibcratelimit.v1.ParamsRequest - - provenance.ibcratelimit.v1.ParamsResponse - - provenance.marker.v1.MsgFinalizeRequest - - provenance.marker.v1.MsgFinalizeResponse - - provenance.marker.v1.MsgActivateRequest - - provenance.marker.v1.MsgActivateResponse - - provenance.marker.v1.MsgCancelRequest - - provenance.marker.v1.MsgCancelResponse - - provenance.marker.v1.MsgDeleteRequest - - provenance.marker.v1.MsgDeleteResponse - - provenance.marker.v1.MsgMintRequest - - provenance.marker.v1.MsgMintResponse - - provenance.marker.v1.MsgBurnRequest - - provenance.marker.v1.MsgBurnResponse - - provenance.marker.v1.MsgAddAccessRequest - - provenance.marker.v1.MsgAddAccessResponse - - provenance.marker.v1.MsgDeleteAccessRequest - - provenance.marker.v1.MsgDeleteAccessResponse - - provenance.marker.v1.MsgWithdrawRequest - - provenance.marker.v1.MsgWithdrawResponse - - provenance.marker.v1.MsgAddMarkerRequest - - provenance.marker.v1.MsgAddMarkerResponse - - provenance.marker.v1.MsgTransferRequest - - provenance.marker.v1.MsgTransferResponse - - provenance.marker.v1.MsgIbcTransferRequest - - provenance.marker.v1.MsgIbcTransferResponse - - provenance.marker.v1.MsgSetDenomMetadataRequest - - provenance.marker.v1.MsgSetDenomMetadataResponse - - provenance.marker.v1.MsgGrantAllowanceRequest - - provenance.marker.v1.MsgGrantAllowanceResponse - - provenance.marker.v1.MsgAddFinalizeActivateMarkerRequest - - provenance.marker.v1.MsgAddFinalizeActivateMarkerResponse - - provenance.marker.v1.MsgSupplyIncreaseProposalRequest - - provenance.marker.v1.MsgSupplyIncreaseProposalResponse - - provenance.marker.v1.MsgSupplyDecreaseProposalRequest - - provenance.marker.v1.MsgSupplyDecreaseProposalResponse - - provenance.marker.v1.MsgUpdateRequiredAttributesRequest - - provenance.marker.v1.MsgUpdateRequiredAttributesResponse - - provenance.marker.v1.MsgUpdateForcedTransferRequest - - provenance.marker.v1.MsgUpdateForcedTransferResponse - - provenance.marker.v1.MsgSetAccountDataRequest - - provenance.marker.v1.MsgSetAccountDataResponse - - provenance.marker.v1.MsgUpdateSendDenyListRequest - - provenance.marker.v1.MsgUpdateSendDenyListResponse - - provenance.marker.v1.MsgAddNetAssetValuesRequest - - provenance.marker.v1.MsgAddNetAssetValuesResponse - - provenance.marker.v1.MsgSetAdministratorProposalRequest - - provenance.marker.v1.MsgSetAdministratorProposalResponse - - provenance.marker.v1.MsgRemoveAdministratorProposalRequest - - provenance.marker.v1.MsgRemoveAdministratorProposalResponse - - provenance.marker.v1.MsgChangeStatusProposalRequest - - provenance.marker.v1.MsgChangeStatusProposalResponse - - provenance.marker.v1.MsgWithdrawEscrowProposalRequest - - provenance.marker.v1.MsgWithdrawEscrowProposalResponse - - provenance.marker.v1.MsgSetDenomMetadataProposalRequest - - provenance.marker.v1.MsgSetDenomMetadataProposalResponse - - provenance.marker.v1.MsgUpdateParamsRequest - - provenance.marker.v1.MsgUpdateParamsResponse - - provenance.marker.v1.QueryParamsRequest - - provenance.marker.v1.QueryParamsResponse - - provenance.marker.v1.QueryAllMarkersRequest - - provenance.marker.v1.QueryAllMarkersResponse - - provenance.marker.v1.QueryMarkerRequest - - provenance.marker.v1.QueryMarkerResponse - - provenance.marker.v1.QueryHoldingRequest - - provenance.marker.v1.QueryHoldingResponse - - provenance.marker.v1.QuerySupplyRequest - - provenance.marker.v1.QuerySupplyResponse - - provenance.marker.v1.QueryEscrowRequest - - provenance.marker.v1.QueryEscrowResponse - - provenance.marker.v1.QueryAccessRequest - - provenance.marker.v1.QueryAccessResponse - - provenance.marker.v1.QueryDenomMetadataRequest - - provenance.marker.v1.QueryDenomMetadataResponse - - provenance.marker.v1.QueryAccountDataRequest - - provenance.marker.v1.QueryAccountDataResponse - - provenance.marker.v1.QueryNetAssetValuesRequest - - provenance.marker.v1.QueryNetAssetValuesResponse - - provenance.metadata.v1.MsgWriteScopeRequest - - provenance.metadata.v1.MsgWriteScopeResponse - - provenance.metadata.v1.MsgDeleteScopeRequest - - provenance.metadata.v1.MsgDeleteScopeResponse - - provenance.metadata.v1.MsgAddScopeDataAccessRequest - - provenance.metadata.v1.MsgAddScopeDataAccessResponse - - provenance.metadata.v1.MsgDeleteScopeDataAccessRequest - - provenance.metadata.v1.MsgDeleteScopeDataAccessResponse - - provenance.metadata.v1.MsgAddScopeOwnerRequest - - provenance.metadata.v1.MsgAddScopeOwnerResponse - - provenance.metadata.v1.MsgDeleteScopeOwnerRequest - - provenance.metadata.v1.MsgDeleteScopeOwnerResponse - - provenance.metadata.v1.MsgUpdateValueOwnersRequest - - provenance.metadata.v1.MsgUpdateValueOwnersResponse - - provenance.metadata.v1.MsgMigrateValueOwnerRequest - - provenance.metadata.v1.MsgMigrateValueOwnerResponse - - provenance.metadata.v1.MsgWriteSessionRequest - - provenance.metadata.v1.MsgWriteSessionResponse - - provenance.metadata.v1.MsgWriteRecordRequest - - provenance.metadata.v1.MsgWriteRecordResponse - - provenance.metadata.v1.MsgDeleteRecordRequest - - provenance.metadata.v1.MsgDeleteRecordResponse - - provenance.metadata.v1.MsgWriteScopeSpecificationRequest - - provenance.metadata.v1.MsgWriteScopeSpecificationResponse - - provenance.metadata.v1.MsgDeleteScopeSpecificationRequest - - provenance.metadata.v1.MsgDeleteScopeSpecificationResponse - - provenance.metadata.v1.MsgWriteContractSpecificationRequest - - provenance.metadata.v1.MsgWriteContractSpecificationResponse - - provenance.metadata.v1.MsgDeleteContractSpecificationRequest - - provenance.metadata.v1.MsgDeleteContractSpecificationResponse - - provenance.metadata.v1.MsgAddContractSpecToScopeSpecRequest - - provenance.metadata.v1.MsgAddContractSpecToScopeSpecResponse - - provenance.metadata.v1.MsgDeleteContractSpecFromScopeSpecRequest - - provenance.metadata.v1.MsgDeleteContractSpecFromScopeSpecResponse - - provenance.metadata.v1.MsgWriteRecordSpecificationRequest - - provenance.metadata.v1.MsgWriteRecordSpecificationResponse - - provenance.metadata.v1.MsgDeleteRecordSpecificationRequest - - provenance.metadata.v1.MsgDeleteRecordSpecificationResponse - - provenance.metadata.v1.MsgBindOSLocatorRequest - - provenance.metadata.v1.MsgBindOSLocatorResponse - - provenance.metadata.v1.MsgDeleteOSLocatorRequest - - provenance.metadata.v1.MsgDeleteOSLocatorResponse - - provenance.metadata.v1.MsgModifyOSLocatorRequest - - provenance.metadata.v1.MsgModifyOSLocatorResponse - - provenance.metadata.v1.MsgSetAccountDataRequest - - provenance.metadata.v1.MsgSetAccountDataResponse - - provenance.metadata.v1.MsgAddNetAssetValuesRequest - - provenance.metadata.v1.MsgAddNetAssetValuesResponse - - provenance.metadata.v1.QueryParamsRequest - - provenance.metadata.v1.QueryParamsResponse - - provenance.metadata.v1.ScopeRequest - - provenance.metadata.v1.ScopeResponse - - provenance.metadata.v1.ScopesAllRequest - - provenance.metadata.v1.ScopesAllResponse - - provenance.metadata.v1.SessionsRequest - - provenance.metadata.v1.SessionsResponse - - provenance.metadata.v1.SessionsAllRequest - - provenance.metadata.v1.SessionsAllResponse - - provenance.metadata.v1.RecordsRequest - - provenance.metadata.v1.RecordsResponse - - provenance.metadata.v1.RecordsAllRequest - - provenance.metadata.v1.RecordsAllResponse - - provenance.metadata.v1.OwnershipRequest - - provenance.metadata.v1.OwnershipResponse - - provenance.metadata.v1.ValueOwnershipRequest - - provenance.metadata.v1.ValueOwnershipResponse - - provenance.metadata.v1.ScopeSpecificationRequest - - provenance.metadata.v1.ScopeSpecificationResponse - - provenance.metadata.v1.ScopeSpecificationsAllRequest - - provenance.metadata.v1.ScopeSpecificationsAllResponse - - provenance.metadata.v1.ContractSpecificationRequest - - provenance.metadata.v1.ContractSpecificationResponse - - provenance.metadata.v1.ContractSpecificationsAllRequest - - provenance.metadata.v1.ContractSpecificationsAllResponse - - provenance.metadata.v1.RecordSpecificationsForContractSpecificationRequest - - provenance.metadata.v1.RecordSpecificationsForContractSpecificationResponse - - provenance.metadata.v1.RecordSpecificationRequest - - provenance.metadata.v1.RecordSpecificationResponse - - provenance.metadata.v1.RecordSpecificationsAllRequest - - provenance.metadata.v1.RecordSpecificationsAllResponse - - provenance.metadata.v1.GetByAddrRequest - - provenance.metadata.v1.GetByAddrResponse - - provenance.metadata.v1.OSLocatorParamsRequest - - provenance.metadata.v1.OSLocatorParamsResponse - - provenance.metadata.v1.OSLocatorRequest - - provenance.metadata.v1.OSLocatorResponse - - provenance.metadata.v1.OSLocatorsByURIRequest - - provenance.metadata.v1.OSLocatorsByURIResponse - - provenance.metadata.v1.OSLocatorsByScopeRequest - - provenance.metadata.v1.OSLocatorsByScopeResponse - - provenance.metadata.v1.OSAllLocatorsRequest - - provenance.metadata.v1.OSAllLocatorsResponse - - provenance.metadata.v1.QueryScopeNetAssetValuesRequest - - provenance.metadata.v1.QueryScopeNetAssetValuesResponse - - provenance.msgfees.v1.MsgAssessCustomMsgFeeRequest - - provenance.msgfees.v1.MsgAssessCustomMsgFeeResponse - - provenance.msgfees.v1.MsgAddMsgFeeProposalRequest - - provenance.msgfees.v1.MsgAddMsgFeeProposalResponse - - provenance.msgfees.v1.MsgUpdateMsgFeeProposalRequest - - provenance.msgfees.v1.MsgUpdateMsgFeeProposalResponse - - provenance.msgfees.v1.MsgRemoveMsgFeeProposalRequest - - provenance.msgfees.v1.MsgRemoveMsgFeeProposalResponse - - provenance.msgfees.v1.MsgUpdateNhashPerUsdMilProposalRequest - - provenance.msgfees.v1.MsgUpdateNhashPerUsdMilProposalResponse - - provenance.msgfees.v1.MsgUpdateConversionFeeDenomProposalRequest - - provenance.msgfees.v1.MsgUpdateConversionFeeDenomProposalResponse - - provenance.msgfees.v1.QueryParamsRequest - - provenance.msgfees.v1.QueryParamsResponse - - provenance.msgfees.v1.QueryAllMsgFeesRequest - - provenance.msgfees.v1.QueryAllMsgFeesResponse - - provenance.name.v1.MsgBindNameRequest - - provenance.name.v1.MsgBindNameResponse - - provenance.name.v1.MsgDeleteNameRequest - - provenance.name.v1.MsgDeleteNameResponse - - provenance.name.v1.MsgModifyNameRequest - - provenance.name.v1.MsgModifyNameResponse - - provenance.name.v1.MsgCreateRootNameRequest - - provenance.name.v1.MsgCreateRootNameResponse - - provenance.name.v1.MsgUpdateParamsRequest - - provenance.name.v1.MsgUpdateParamsResponse - - provenance.name.v1.QueryParamsRequest - - provenance.name.v1.QueryParamsResponse - - provenance.name.v1.QueryResolveRequest - - provenance.name.v1.QueryResolveResponse - - provenance.name.v1.QueryReverseLookupRequest - - provenance.name.v1.QueryReverseLookupResponse - - provenance.oracle.v1.MsgUpdateOracleRequest - - provenance.oracle.v1.MsgUpdateOracleResponse - - provenance.oracle.v1.MsgSendQueryOracleRequest - - provenance.oracle.v1.MsgSendQueryOracleResponse - - provenance.oracle.v1.QueryOracleAddressRequest - - provenance.oracle.v1.QueryOracleAddressResponse - - provenance.oracle.v1.QueryOracleRequest - - provenance.oracle.v1.QueryOracleResponse - - provenance.trigger.v1.MsgCreateTriggerRequest - - provenance.trigger.v1.MsgCreateTriggerResponse - - provenance.trigger.v1.MsgDestroyTriggerRequest - - provenance.trigger.v1.MsgDestroyTriggerResponse - - provenance.trigger.v1.QueryTriggerByIDRequest - - provenance.trigger.v1.QueryTriggerByIDResponse - - provenance.trigger.v1.QueryTriggersRequest - - provenance.trigger.v1.QueryTriggersResponse + - extern_path=.google.protobuf.Any=crate::shim::Any \ No newline at end of file diff --git a/packages/proto-build/third-party.buf.gen.yaml b/packages/proto-build/third-party.buf.gen.yaml index 50d2eb43..a1da1cee 100644 --- a/packages/proto-build/third-party.buf.gen.yaml +++ b/packages/proto-build/third-party.buf.gen.yaml @@ -5,105 +5,4 @@ plugins: opt: - extern_path=.google.protobuf.Timestamp=crate::shim::Timestamp - extern_path=.google.protobuf.Duration=crate::shim::Duration - - extern_path=.google.protobuf.Any=crate::shim::Any -types: - include: - - cosmos.auth.v1beta1.BaseAccount - - cosmos.auth.v1beta1.QueryAccountRequest - - cosmos.auth.v1beta1.QueryAccountResponse - - cosmos.auth.v1beta1.QueryParamsRequest - - cosmos.auth.v1beta1.QueryParamsResponse - - cosmos.authz.v1beta1.GenericAuthorization - - cosmos.authz.v1beta1.Grant - - cosmos.authz.v1beta1.GrantAuthorization - - cosmos.authz.v1beta1.GrantQueueItem - - cosmos.authz.v1beta1.MsgExec - - cosmos.authz.v1beta1.MsgExecResponse - - cosmos.authz.v1beta1.MsgGrant - - cosmos.authz.v1beta1.MsgGrantResponse - - cosmos.authz.v1beta1.MsgRevoke - - cosmos.authz.v1beta1.MsgRevokeResponse - - cosmos.authz.v1beta1.QueryGrantsRequest - - cosmos.authz.v1beta1.QueryGrantsResponse - - cosmos.authz.v1beta1.QueryGranterGrantsRequest - - cosmos.authz.v1beta1.QueryGranterGrantsResponse - - cosmos.authz.v1beta1.QueryGranteeGrantsRequest - - cosmos.authz.v1beta1.QueryGranteeGrantsResponse - - cosmos.base.query.v1beta1.PageRequest - - cosmos.base.query.v1beta1.PageResponse - - cosmos.base.v1beta1.Coin - - cosmos.base.v1beta1.DecCoin - - cosmos.base.v1beta1.IntProto - - cosmos.base.v1beta1.DecProto - - cosmos.bank.v1beta1.MsgSend - - cosmos.bank.v1beta1.MsgSendResponse - - cosmos.bank.v1beta1.MsgMultiSend - - cosmos.bank.v1beta1.MsgMultiSendResponse - - cosmos.bank.v1beta1.QueryBalanceRequest - - cosmos.bank.v1beta1.QueryBalanceResponse - - cosmos.bank.v1beta1.QueryDenomMetadataRequest - - cosmos.bank.v1beta1.QueryDenomMetadataResponse - - cosmos.bank.v1beta1.QueryParamsRequest - - cosmos.bank.v1beta1.QueryParamsResponse - - cosmos.bank.v1beta1.QuerySupplyOfRequest - - cosmos.bank.v1beta1.QuerySupplyOfResponse - - cosmos.crypto.ed25519.PubKey - - cosmos.crypto.ed25519.PrivKey - - cosmos.crypto.multisig.v1beta1.MultiSignature - - cosmos.crypto.multisig.v1beta1.CompactBitArray - - cosmos.crypto.secp256k1.PubKey - - cosmos.crypto.secp256k1.PrivKey - - cosmos.crypto.secp256r1.PubKey - - cosmos.crypto.secp256r1.PrivKey - - cosmos.distribution.v1beta1.QueryParamsRequest - - cosmos.distribution.v1beta1.QueryParamsResponse - - cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressRequest - - cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse - - cosmos.distribution.v1beta1.QueryValidatorCommissionRequest - - cosmos.distribution.v1beta1.QueryValidatorCommissionResponse - - cosmos.gov.v1beta1.MsgSubmitProposal - - cosmos.gov.v1beta1.MsgSubmitProposalResponse - - cosmos.gov.v1beta1.MsgVote - - cosmos.gov.v1beta1.MsgVoteResponse - - cosmos.gov.v1beta1.QueryDepositRequest - - cosmos.gov.v1beta1.QueryDepositResponse - - cosmos.gov.v1beta1.QueryParamsRequest - - cosmos.gov.v1beta1.QueryParamsResponse - - cosmos.gov.v1beta1.QueryVoteRequest - - cosmos.gov.v1beta1.QueryVoteResponse - - cosmos.slashing.v1beta1.QueryParamsRequest - - cosmos.slashing.v1beta1.QueryParamsResponse - - cosmos.slashing.v1beta1.QuerySigningInfoRequest - - cosmos.slashing.v1beta1.QuerySigningInfoResponse - - cosmos.staking.v1beta1.QueryDelegationRequest - - cosmos.staking.v1beta1.QueryDelegationResponse - - cosmos.staking.v1beta1.QueryParamsRequest - - cosmos.staking.v1beta1.QueryParamsResponse - - cosmos.staking.v1beta1.QueryValidatorRequest - - cosmos.staking.v1beta1.QueryValidatorResponse - - cosmos.tx.signing.v1beta1.SignatureDescriptors - - cosmos.tx.signing.v1beta1.SignatureDescriptor - - cosmos.tx.signing.v1beta1.SignatureDescriptor.Data - - cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single - - cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi - - cosmos.upgrade.v1beta1.Plan - - cosmos.upgrade.v1beta1.SoftwareUpgradeProposal - - cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal - - cosmos.upgrade.v1beta1.ModuleVersion - - cosmwasm.wasm.v1 - - ibc.applications.fee.v1.MsgRegisterPayee - - ibc.applications.fee.v1.MsgRegisterPayeeResponse - - ibc.applications.fee.v1.MsgRegisterCounterpartyPayee - - ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse - - ibc.applications.fee.v1.MsgPayPacketFee - - ibc.applications.fee.v1.MsgPayPacketFeeResponse - - ibc.applications.fee.v1.MsgPayPacketFeeAsync - - ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse - - ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccount - - ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccountResponse - - ibc.applications.interchain_accounts.controller.v1.MsgSendTx - - ibc.applications.interchain_accounts.controller.v1.MsgSendTxResponse - - ibc.applications.transfer.v1.MsgTransfer - - ibc.applications.transfer.v1.MsgTransferResponse - - ibc.applications.transfer.v1.QueryDenomTraceRequest - - ibc.applications.transfer.v1.QueryDenomTraceResponse \ No newline at end of file + - extern_path=.google.protobuf.Any=crate::shim::Any \ No newline at end of file From 41bd41c22e14f2d8dfd903bfae7b9762ebd825ec Mon Sep 17 00:00:00 2001 From: kwt <4344285+kwtalley@users.noreply.github.com> Date: Thu, 11 Jul 2024 19:33:12 -0500 Subject: [PATCH 12/43] remove serde alias transform and add custom as_str_bytes transform for specific metadata field types --- packages/proto-build/src/transform.rs | 4 +- packages/proto-build/src/transformers.rs | 114 ++++++++++++++++------- 2 files changed, 80 insertions(+), 38 deletions(-) diff --git a/packages/proto-build/src/transform.rs b/packages/proto-build/src/transform.rs index 7decd379..eddaf7e9 100644 --- a/packages/proto-build/src/transform.rs +++ b/packages/proto-build/src/transform.rs @@ -137,12 +137,12 @@ fn transform_items( Item::Struct(s) => Item::Struct({ let s = transformers::add_derive_eq_struct(&s); let s = transformers::append_attrs_struct(src, &s, descriptor); - let s = transformers::serde_alias_id_with_uppercased(s); + // let s = transformers::serde_alias_id_with_uppercased(s); // A hack to make Pagination::next_key optional. // Remove if [this PR](https://github.com/cosmos/cosmos-sdk/pull/20246) is merged and released let s = transformers::make_next_key_optional(s); let s = transformers::allow_serde_option_vec_u8_as_base64_encoded_string(s); - let s = transformers::allow_serde_vec_u8_as_base64_encoded_string(s); + let s = transformers::allow_serde_vec_u8_as_base64_encoded_string_or_bytes(s); let s = transformers::allow_serde_int_as_str(s); transformers::allow_serde_vec_int_as_vec_str(s) diff --git a/packages/proto-build/src/transformers.rs b/packages/proto-build/src/transformers.rs index f1410701..8fb586c8 100644 --- a/packages/proto-build/src/transformers.rs +++ b/packages/proto-build/src/transformers.rs @@ -146,26 +146,26 @@ pub fn append_attrs_enum(src: &Path, e: &ItemEnum, descriptor: &FileDescriptorSe } pub fn allow_serde_int_as_str(s: ItemStruct) -> ItemStruct { + let int_types = vec![ + parse_quote!(i8), + parse_quote!(i16), + parse_quote!(i32), + parse_quote!(i64), + parse_quote!(i128), + parse_quote!(isize), + parse_quote!(u8), + parse_quote!(u16), + parse_quote!(u32), + parse_quote!(u64), + parse_quote!(u128), + parse_quote!(usize), + ]; + let fields_vec = s .fields .clone() .into_iter() .map(|mut field| { - let int_types = vec![ - parse_quote!(i8), - parse_quote!(i16), - parse_quote!(i32), - parse_quote!(i64), - parse_quote!(i128), - parse_quote!(isize), - parse_quote!(u8), - parse_quote!(u16), - parse_quote!(u32), - parse_quote!(u64), - parse_quote!(u128), - parse_quote!(usize), - ]; - if int_types.contains(&field.ty) { let from_str: syn::Attribute = parse_quote! { #[serde( @@ -190,26 +190,26 @@ pub fn allow_serde_int_as_str(s: ItemStruct) -> ItemStruct { } pub fn allow_serde_vec_int_as_vec_str(s: ItemStruct) -> ItemStruct { + let vec_int_types = vec![ + parse_quote!(::prost::alloc::vec::Vec), + parse_quote!(::prost::alloc::vec::Vec), + parse_quote!(::prost::alloc::vec::Vec), + parse_quote!(::prost::alloc::vec::Vec), + parse_quote!(::prost::alloc::vec::Vec), + parse_quote!(::prost::alloc::vec::Vec), + // parse_quote!(::prost::alloc::vec::Vec), -- this is not included because it is used for bytes and has it's own rule + parse_quote!(::prost::alloc::vec::Vec), + parse_quote!(::prost::alloc::vec::Vec), + parse_quote!(::prost::alloc::vec::Vec), + parse_quote!(::prost::alloc::vec::Vec), + parse_quote!(::prost::alloc::vec::Vec), + ]; + let fields_vec = s .fields .clone() .into_iter() .map(|mut field| { - let vec_int_types = vec![ - parse_quote!(::prost::alloc::vec::Vec), - parse_quote!(::prost::alloc::vec::Vec), - parse_quote!(::prost::alloc::vec::Vec), - parse_quote!(::prost::alloc::vec::Vec), - parse_quote!(::prost::alloc::vec::Vec), - parse_quote!(::prost::alloc::vec::Vec), - // parse_quote!(::prost::alloc::vec::Vec), -- this is not included because it is used for bytes and has it's own rule - parse_quote!(::prost::alloc::vec::Vec), - parse_quote!(::prost::alloc::vec::Vec), - parse_quote!(::prost::alloc::vec::Vec), - parse_quote!(::prost::alloc::vec::Vec), - parse_quote!(::prost::alloc::vec::Vec), - ]; - if vec_int_types.contains(&field.ty) { let from_str: syn::Attribute = parse_quote! { #[serde( @@ -233,19 +233,61 @@ pub fn allow_serde_vec_int_as_vec_str(s: ItemStruct) -> ItemStruct { syn::ItemStruct { fields, ..s } } -pub fn allow_serde_vec_u8_as_base64_encoded_string(s: ItemStruct) -> ItemStruct { +pub fn allow_serde_vec_u8_as_base64_encoded_string_or_bytes(s: ItemStruct) -> ItemStruct { + // These fields are string of bytes (MetadataAddress type), not base64 strings + let str_as_byte_fields = [ + "context", + "contract_spec_id", + "contract_spec_id_prefix", + "contract_spec_id_contract_spec_uuid", + "contract_specification_id", + "record_id", + "record_id_hashed_name", + "record_id_prefix", + "record_id_scope_uuid", + "record_spec_id", + "record_spec_id_contract_spec_uuid", + "record_spec_id_hashed_name", + "record_spec_id_prefix", + "scope_spec_id", + "scope_spec_id_prefix", + "scope_spec_id_scope_spec_uuid", + "scope_specification_id", + "scope_id", + "scope_id_prefix", + "scope_id_scope_uuid", + "session_id", + "session_id_prefix", + "session_id_scope_uuid", + "specification_id", + ]; + let fields_vec = s .fields .clone() .into_iter() .map(|mut field| { if field.ty == parse_quote!(::prost::alloc::vec::Vec) { - let from_str: syn::Attribute = parse_quote! { - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] + let from_str: syn::Attribute = if field + .clone() + .ident + .is_some_and(|x| str_as_byte_fields.contains(&&***&&x.to_string())) + { + parse_quote! { + #[serde( + serialize_with = "crate::serde::as_str_bytes::serialize", + deserialize_with = "crate::serde::as_str_bytes::deserialize" + )] + } + } else { + parse_quote! { + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + } }; + field.attrs.append(&mut vec![from_str]); field } else { From f2603e3754ed78ca6838784434208908dcb1420f Mon Sep 17 00:00:00 2001 From: kwt <4344285+kwtalley@users.noreply.github.com> Date: Thu, 11 Jul 2024 20:23:25 -0500 Subject: [PATCH 13/43] remove dead code and add custom as_str_bytes_vec transform for specific metadata field types --- packages/proto-build/src/transform.rs | 5 +- packages/proto-build/src/transformers.rs | 99 ++++++------------------ 2 files changed, 27 insertions(+), 77 deletions(-) diff --git a/packages/proto-build/src/transform.rs b/packages/proto-build/src/transform.rs index eddaf7e9..81f2daea 100644 --- a/packages/proto-build/src/transform.rs +++ b/packages/proto-build/src/transform.rs @@ -137,12 +137,13 @@ fn transform_items( Item::Struct(s) => Item::Struct({ let s = transformers::add_derive_eq_struct(&s); let s = transformers::append_attrs_struct(src, &s, descriptor); - // let s = transformers::serde_alias_id_with_uppercased(s); // A hack to make Pagination::next_key optional. // Remove if [this PR](https://github.com/cosmos/cosmos-sdk/pull/20246) is merged and released let s = transformers::make_next_key_optional(s); let s = transformers::allow_serde_option_vec_u8_as_base64_encoded_string(s); - let s = transformers::allow_serde_vec_u8_as_base64_encoded_string_or_bytes(s); + let s = + transformers::allow_serde_vec_u8_as_base64_encoded_string_or_string_bytes(s); + let s = transformers::allow_serde_vec_vec_u8_as_vec_string_bytes(s); let s = transformers::allow_serde_int_as_str(s); transformers::allow_serde_vec_int_as_vec_str(s) diff --git a/packages/proto-build/src/transformers.rs b/packages/proto-build/src/transformers.rs index 8fb586c8..6c852d84 100644 --- a/packages/proto-build/src/transformers.rs +++ b/packages/proto-build/src/transformers.rs @@ -233,7 +233,9 @@ pub fn allow_serde_vec_int_as_vec_str(s: ItemStruct) -> ItemStruct { syn::ItemStruct { fields, ..s } } -pub fn allow_serde_vec_u8_as_base64_encoded_string_or_bytes(s: ItemStruct) -> ItemStruct { +/// Adds `crate::serde::as_str_bytes` serde attribute to specific Metadata fields which are a Metadata Address +/// or adds `crate::serde::as_base64_encoded_string` serde attribute to `::prost::alloc::vec::Vec` field types +pub fn allow_serde_vec_u8_as_base64_encoded_string_or_string_bytes(s: ItemStruct) -> ItemStruct { // These fields are string of bytes (MetadataAddress type), not base64 strings let str_as_byte_fields = [ "context", @@ -304,34 +306,32 @@ pub fn allow_serde_vec_u8_as_base64_encoded_string_or_bytes(s: ItemStruct) -> It syn::ItemStruct { fields, ..s } } -/// some of proto's fields in osmosis' modules are named `ID` but prost generates `id` field -/// this function adds `#[serde(alias = "ID")]` to the `id` field -/// so that serde can deserialize `ID` field to `id` field. -/// This is required because the `ID` field is used in the query response and is serialized as json. -pub fn serde_alias_id_with_uppercased(s: ItemStruct) -> ItemStruct { +/// Adds `crate::serde::as_str_bytes_vec` serde attribute to specific Metadata fields which +/// are a vector of Metadata Addresses +pub fn allow_serde_vec_vec_u8_as_vec_string_bytes(s: ItemStruct) -> ItemStruct { + // These fields are string of bytes (MetadataAddress type), not base64 strings + let str_as_byte_fields = ["contract_spec_ids", "scope_ids"]; + let fields_vec = s .fields .clone() .into_iter() .map(|mut field| { - if let Some(ident) = &field.ident { - let ident_str = ident.to_string(); - if ident_str == "id" { - let serde_alias_id: syn::Attribute = parse_quote! { - #[serde(alias = "ID")] - }; - field.attrs.append(&mut vec![serde_alias_id]); - field - } else if ident_str.contains("_id") { - let ident_str = ident_str.replace("_id", "ID"); - let serde_alias_id: syn::Attribute = parse_quote! { - #[serde(alias = #ident_str)] - }; - field.attrs.append(&mut vec![serde_alias_id]); - field - } else { - field - } + if field.ty == parse_quote!(::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>) { + if field + .clone() + .ident + .is_some_and(|x| str_as_byte_fields.contains(&&***&&x.to_string())) + { + field.attrs.append(&mut vec![parse_quote! { + #[serde( + serialize_with = "crate::serde::as_str_bytes_vec::serialize", + deserialize_with = "crate::serde::as_str_bytes_vec::deserialize" + )] + }]); + }; + + field } else { field } @@ -789,57 +789,6 @@ mod tests { assert_ast_eq!(result, expected); } - #[test] - #[allow(non_snake_case)] - fn test_alias_id_with_ID_if_there_id_a_field_named_id() { - let item_struct: ItemStruct = syn::parse_quote! { - #[derive(PartialEq, Eq, Debug)] - struct PeriodLock { - id: u64, - duration: Duration, - } - }; - - let result = serde_alias_id_with_uppercased(item_struct); - - let expected: ItemStruct = syn::parse_quote! { - #[derive(PartialEq, Eq, Debug)] - struct PeriodLock { - #[serde(alias = "ID")] - id: u64, - duration: Duration, - } - }; - - assert_ast_eq!(result, expected); - } - - #[test] - #[allow(non_snake_case)] - fn test_alias_partial_id_with_ID() { - let item_struct: ItemStruct = syn::parse_quote! { - #[derive(PartialEq, Eq, Debug)] - pub struct FeeToken { - pub denom: ::prost::alloc::string::String, - - pub pool_id: u64, - } - }; - - let result = serde_alias_id_with_uppercased(item_struct); - - let expected: ItemStruct = syn::parse_quote! { - #[derive(PartialEq, Eq, Debug)] - pub struct FeeToken { - pub denom: ::prost::alloc::string::String, - #[serde(alias = "poolID")] - pub pool_id: u64, - } - }; - - assert_ast_eq!(result, expected); - } - #[test] fn test_make_next_key_optional() { let input: ItemStruct = parse_quote! { From b5554b35c42676eacce5ef33f4729f84575e98ee Mon Sep 17 00:00:00 2001 From: kwt <4344285+kwtalley@users.noreply.github.com> Date: Thu, 11 Jul 2024 20:49:10 -0500 Subject: [PATCH 14/43] add serde vec as base64 encoded str or str bytes --- packages/proto-build/src/transformers.rs | 33 ++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/packages/proto-build/src/transformers.rs b/packages/proto-build/src/transformers.rs index 6c852d84..1a0bbb1d 100644 --- a/packages/proto-build/src/transformers.rs +++ b/packages/proto-build/src/transformers.rs @@ -834,4 +834,37 @@ mod tests { assert_ast_eq!(result, expected); } + + #[test] + fn test_allow_serde_vec_u8_as_base64_encoded_string_or_string_bytes() { + let input: ItemStruct = parse_quote! { + pub struct PageResponse { + #[prost(bytes = "vec", optional, tag = "1")] + pub next_key: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "2")] + pub specification_id: ::prost::alloc::vec::Vec, + } + }; + + let result = allow_serde_vec_u8_as_base64_encoded_string_or_string_bytes(input); + + let expected: ItemStruct = parse_quote! { + pub struct PageResponse { + #[prost(bytes = "vec", optional, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub next_key: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str_bytes::serialize", + deserialize_with = "crate::serde::as_str_bytes::deserialize" + )] + pub specification_id: ::prost::alloc::vec::Vec, + } + }; + + assert_ast_eq!(result, expected); + } } From 19757be8f7df6a0b2a664e03bf5a0b9005dde761 Mon Sep 17 00:00:00 2001 From: kwt <4344285+kwtalley@users.noreply.github.com> Date: Thu, 11 Jul 2024 22:50:42 -0500 Subject: [PATCH 15/43] add transformer that adds serde emun_as_i32 to enumerated types --- packages/proto-build/src/transform.rs | 1 + packages/proto-build/src/transformers.rs | 90 +++++++++++++++++++++++- 2 files changed, 90 insertions(+), 1 deletion(-) diff --git a/packages/proto-build/src/transform.rs b/packages/proto-build/src/transform.rs index 81f2daea..973747e9 100644 --- a/packages/proto-build/src/transform.rs +++ b/packages/proto-build/src/transform.rs @@ -145,6 +145,7 @@ fn transform_items( transformers::allow_serde_vec_u8_as_base64_encoded_string_or_string_bytes(s); let s = transformers::allow_serde_vec_vec_u8_as_vec_string_bytes(s); let s = transformers::allow_serde_int_as_str(s); + let s = transformers::allow_serde_int_as_str_or_enum_as_i32(s); transformers::allow_serde_vec_int_as_vec_str(s) }), diff --git a/packages/proto-build/src/transformers.rs b/packages/proto-build/src/transformers.rs index 1a0bbb1d..bf91091a 100644 --- a/packages/proto-build/src/transformers.rs +++ b/packages/proto-build/src/transformers.rs @@ -149,7 +149,7 @@ pub fn allow_serde_int_as_str(s: ItemStruct) -> ItemStruct { let int_types = vec![ parse_quote!(i8), parse_quote!(i16), - parse_quote!(i32), + // parse_quote!(i32), -- this is not included since it could be either str or enum type parse_quote!(i64), parse_quote!(i128), parse_quote!(isize), @@ -412,6 +412,61 @@ pub fn allow_serde_option_vec_u8_as_base64_encoded_string(s: syn::ItemStruct) -> syn::ItemStruct { fields, ..s } } +/// Adds `crate::serde::enum_as_i32` serde attribute to specific Metadata fields which +/// are an enumerated type as an i32, or adds `crate::serde::as_str` serde attribute like `allow_serde_int_as_str` +pub fn allow_serde_int_as_str_or_enum_as_i32(s: syn::ItemStruct) -> syn::ItemStruct { + let fields_vec = s + .fields + .into_iter() + .map(|mut field| { + let mut add_serde_attrs = false; + for attr in &field.attrs { + if attr.path.is_ident("prost") { + if let Ok(meta) = attr.parse_meta() { + if let syn::Meta::List(meta_list) = meta { + for nested_meta in meta_list.nested.iter() { + if let syn::NestedMeta::Meta(syn::Meta::NameValue(name_value)) = + nested_meta + { + if name_value.path.is_ident("enumeration") { + add_serde_attrs = true; + break; + } + } + } + } + } + } + } + + if add_serde_attrs { + field.attrs.push(parse_quote! { + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + }); + } else { + field.attrs.push(parse_quote! { + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + }); + } + + field + }) + .collect::>(); + + let fields_named: syn::FieldsNamed = parse_quote! { + { #(#fields_vec,)* } + }; + let fields = syn::Fields::Named(fields_named); + + syn::ItemStruct { fields, ..s } +} + // ====== helpers ====== fn get_query_attr( @@ -867,4 +922,37 @@ mod tests { assert_ast_eq!(result, expected); } + + #[test] + fn test_allow_serde_enum_as_i32() { + let input: ItemStruct = parse_quote! { + pub struct Party { + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + #[prost(enumeration = "PartyType", tag = "2")] + pub role: i32, + #[prost(bool, tag = "3")] + pub optional: bool, + } + }; + + let result = allow_serde_int_as_str_or_enum_as_i32(input); + + let expected: ItemStruct = parse_quote! { + pub struct Party { + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + #[prost(enumeration = "PartyType", tag = "2")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub role: i32, + #[prost(bool, tag = "3")] + pub optional: bool, + } + }; + + assert_ast_eq!(result, expected); + } } From e6388861c902793c011065c8fc860eb0e67de971 Mon Sep 17 00:00:00 2001 From: kwt <4344285+kwtalley@users.noreply.github.com> Date: Fri, 12 Jul 2024 01:14:24 -0500 Subject: [PATCH 16/43] fix enum_as_i32 transformer and add implementation --- packages/proto-build/src/transformers.rs | 56 ++++++++++++------------ packages/provwasm-std/src/serde/mod.rs | 21 +++++++++ 2 files changed, 50 insertions(+), 27 deletions(-) diff --git a/packages/proto-build/src/transformers.rs b/packages/proto-build/src/transformers.rs index bf91091a..d8f0ba74 100644 --- a/packages/proto-build/src/transformers.rs +++ b/packages/proto-build/src/transformers.rs @@ -419,40 +419,42 @@ pub fn allow_serde_int_as_str_or_enum_as_i32(s: syn::ItemStruct) -> syn::ItemStr .fields .into_iter() .map(|mut field| { - let mut add_serde_attrs = false; - for attr in &field.attrs { - if attr.path.is_ident("prost") { - if let Ok(meta) = attr.parse_meta() { - if let syn::Meta::List(meta_list) = meta { - for nested_meta in meta_list.nested.iter() { - if let syn::NestedMeta::Meta(syn::Meta::NameValue(name_value)) = - nested_meta - { - if name_value.path.is_ident("enumeration") { - add_serde_attrs = true; - break; + if field.ty == parse_quote!(i32) { + let mut add_serde_attrs = false; + for attr in &field.attrs { + if attr.path.is_ident("prost") { + if let Ok(meta) = attr.parse_meta() { + if let syn::Meta::List(meta_list) = meta { + for nested_meta in meta_list.nested.iter() { + if let syn::NestedMeta::Meta(syn::Meta::NameValue(name_value)) = + nested_meta + { + if name_value.path.is_ident("enumeration") { + add_serde_attrs = true; + break; + } } } } } } } - } - if add_serde_attrs { - field.attrs.push(parse_quote! { - #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" - )] - }); - } else { - field.attrs.push(parse_quote! { - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - }); + if add_serde_attrs { + field.attrs.push(parse_quote! { + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + }); + } else { + field.attrs.push(parse_quote! { + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + }); + } } field diff --git a/packages/provwasm-std/src/serde/mod.rs b/packages/provwasm-std/src/serde/mod.rs index 731ea6ad..a7c52888 100644 --- a/packages/provwasm-std/src/serde/mod.rs +++ b/packages/provwasm-std/src/serde/mod.rs @@ -153,3 +153,24 @@ pub mod as_option_base64_encoded_string { } } } + +pub mod enum_as_i32 { + use serde::{Deserialize, Deserializer, Serializer}; + + // Serialize the enum as i32 + pub fn serialize(value: &i32, serializer: S) -> Result + where + S: Serializer, + { + serializer.serialize_i32(*value) + } + + // Deserialize i32 as enum + pub fn deserialize<'de, D>(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let value = i32::deserialize(deserializer)?; + Ok(value) + } +} From db2f2f3524c145ddd95c29054e91b913e16c7756 Mon Sep 17 00:00:00 2001 From: kwt <4344285+kwtalley@users.noreply.github.com> Date: Fri, 12 Jul 2024 01:17:44 -0500 Subject: [PATCH 17/43] allow clippy::large_enum_variant on generated types --- packages/provwasm-std/src/lib.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/provwasm-std/src/lib.rs b/packages/provwasm-std/src/lib.rs index 3a7ebb34..c9bbc904 100644 --- a/packages/provwasm-std/src/lib.rs +++ b/packages/provwasm-std/src/lib.rs @@ -3,7 +3,12 @@ pub const PROVENANCE_VERSION: &str = include_str!("types/PROVENANCE_COMMIT"); mod serde; pub mod shim; -#[allow(clippy::too_many_arguments, dead_code, deprecated, unused_imports)] +#[allow( + deprecated, + unused_imports, + clippy::large_enum_variant, + clippy::too_many_arguments +)] pub mod types; // Indicate that smart contracts that use this lib can only be run on the Provenance Blockchain. From 047a272bb9deaf70b87c89f1fc05457b123b58fa Mon Sep 17 00:00:00 2001 From: kwt <4344285+kwtalley@users.noreply.github.com> Date: Fri, 12 Jul 2024 01:18:32 -0500 Subject: [PATCH 18/43] add generated capability types --- .../provwasm-std/src/types/capability/mod.rs | 1 + .../provwasm-std/src/types/capability/v1.rs | 112 ++++++++++++++++++ 2 files changed, 113 insertions(+) create mode 100644 packages/provwasm-std/src/types/capability/mod.rs create mode 100644 packages/provwasm-std/src/types/capability/v1.rs diff --git a/packages/provwasm-std/src/types/capability/mod.rs b/packages/provwasm-std/src/types/capability/mod.rs new file mode 100644 index 00000000..a3a6d96c --- /dev/null +++ b/packages/provwasm-std/src/types/capability/mod.rs @@ -0,0 +1 @@ +pub mod v1; diff --git a/packages/provwasm-std/src/types/capability/v1.rs b/packages/provwasm-std/src/types/capability/v1.rs new file mode 100644 index 00000000..e7863260 --- /dev/null +++ b/packages/provwasm-std/src/types/capability/v1.rs @@ -0,0 +1,112 @@ +use provwasm_proc_macro::CosmwasmExt; +/// Capability defines an implementation of an object capability. The index +/// provided to a Capability must be globally unique. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/capability.v1.Capability")] +pub struct Capability { + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub index: u64, +} +/// Owner defines a single capability owner. An owner is defined by the name of +/// capability and the module name. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/capability.v1.Owner")] +pub struct Owner { + #[prost(string, tag = "1")] + pub module: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub name: ::prost::alloc::string::String, +} +/// CapabilityOwners defines a set of owners of a single Capability. The set of +/// owners must be unique. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/capability.v1.CapabilityOwners")] +pub struct CapabilityOwners { + #[prost(message, repeated, tag = "1")] + pub owners: ::prost::alloc::vec::Vec, +} +/// GenesisOwners defines the capability owners with their corresponding index. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/capability.v1.GenesisOwners")] +pub struct GenesisOwners { + /// index is the index of the capability owner. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub index: u64, + /// index_owners are the owners at the given index. + #[prost(message, optional, tag = "2")] + pub index_owners: ::core::option::Option, +} +/// GenesisState defines the capability module's genesis state. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/capability.v1.GenesisState")] +pub struct GenesisState { + /// index is the capability global index. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub index: u64, + /// owners represents a map from index to owners of the capability index + /// index key is string to allow amino marshalling. + #[prost(message, repeated, tag = "2")] + pub owners: ::prost::alloc::vec::Vec, +} From ae3788c5a7a59833fa443a23e8160e78c24baa72 Mon Sep 17 00:00:00 2001 From: kwt <4344285+kwtalley@users.noreply.github.com> Date: Fri, 12 Jul 2024 01:18:45 -0500 Subject: [PATCH 19/43] add generated cosmos types --- .../provwasm-std/src/types/cosmos/app/mod.rs | 2 + .../src/types/cosmos/app/runtime/mod.rs | 1 + .../src/types/cosmos/app/runtime/v1alpha1.rs | 80 + .../src/types/cosmos/app/v1alpha1.rs | 248 ++ .../provwasm-std/src/types/cosmos/auth/mod.rs | 1 + .../src/types/cosmos/auth/module/mod.rs | 1 + .../src/types/cosmos/auth/module/v1.rs | 47 + .../src/types/cosmos/auth/v1beta1.rs | 542 ++++ .../src/types/cosmos/authz/mod.rs | 1 + .../src/types/cosmos/authz/module/mod.rs | 1 + .../src/types/cosmos/authz/module/v1.rs | 15 + .../src/types/cosmos/authz/v1beta1.rs | 146 +- .../provwasm-std/src/types/cosmos/bank/mod.rs | 1 + .../src/types/cosmos/bank/module/mod.rs | 1 + .../src/types/cosmos/bank/module/v1.rs | 30 + .../src/types/cosmos/bank/v1beta1.rs | 825 ++++++ .../src/types/cosmos/base/abci/mod.rs | 1 + .../src/types/cosmos/base/abci/v1beta1.rs | 390 +++ .../provwasm-std/src/types/cosmos/base/mod.rs | 3 + .../src/types/cosmos/base/node/mod.rs | 1 + .../src/types/cosmos/base/node/v1beta1.rs | 102 + .../src/types/cosmos/base/query/v1beta1.rs | 34 + .../src/types/cosmos/base/tendermint/mod.rs | 1 + .../types/cosmos/base/tendermint/v1beta1.rs | 595 +++++ .../src/types/cosmos/base/v1beta1.rs | 12 + .../src/types/cosmos/circuit/mod.rs | 2 + .../src/types/cosmos/circuit/module/mod.rs | 1 + .../src/types/cosmos/circuit/module/v1.rs | 19 + .../src/types/cosmos/circuit/v1.rs | 379 +++ .../src/types/cosmos/consensus/mod.rs | 2 + .../src/types/cosmos/consensus/module/mod.rs | 1 + .../src/types/cosmos/consensus/module/v1.rs | 19 + .../src/types/cosmos/consensus/v1.rs | 97 + .../src/types/cosmos/crisis/mod.rs | 2 + .../src/types/cosmos/crisis/module/mod.rs | 1 + .../src/types/cosmos/crisis/module/v1.rs | 22 + .../src/types/cosmos/crisis/v1beta1.rs | 98 + .../src/types/cosmos/crypto/ed25519.rs | 7 + .../src/types/cosmos/crypto/hd/mod.rs | 1 + .../src/types/cosmos/crypto/hd/v1.rs | 48 + .../src/types/cosmos/crypto/keyring/mod.rs | 1 + .../src/types/cosmos/crypto/keyring/v1.rs | 117 + .../src/types/cosmos/crypto/mod.rs | 2 + .../src/types/cosmos/crypto/multisig/mod.rs | 26 + .../types/cosmos/crypto/multisig/v1beta1.rs | 7 + .../src/types/cosmos/crypto/secp256k1.rs | 6 + .../src/types/cosmos/crypto/secp256r1.rs | 5 + .../src/types/cosmos/distribution/mod.rs | 1 + .../types/cosmos/distribution/module/mod.rs | 1 + .../types/cosmos/distribution/module/v1.rs | 21 + .../src/types/cosmos/distribution/v1beta1.rs | 1172 ++++++++- .../src/types/cosmos/evidence/mod.rs | 2 + .../src/types/cosmos/evidence/module/mod.rs | 1 + .../src/types/cosmos/evidence/module/v1.rs | 15 + .../src/types/cosmos/evidence/v1beta1.rs | 220 ++ .../src/types/cosmos/feegrant/mod.rs | 2 + .../src/types/cosmos/feegrant/module/mod.rs | 1 + .../src/types/cosmos/feegrant/module/v1.rs | 15 + .../src/types/cosmos/feegrant/v1beta1.rs | 406 +++ .../src/types/cosmos/genutil/mod.rs | 2 + .../src/types/cosmos/genutil/module/mod.rs | 1 + .../src/types/cosmos/genutil/module/v1.rs | 15 + .../src/types/cosmos/genutil/v1beta1.rs | 19 + .../provwasm-std/src/types/cosmos/gov/mod.rs | 2 + .../src/types/cosmos/gov/module/mod.rs | 1 + .../src/types/cosmos/gov/module/v1.rs | 27 + .../provwasm-std/src/types/cosmos/gov/v1.rs | 1347 ++++++++++ .../src/types/cosmos/gov/v1beta1.rs | 673 ++++- .../src/types/cosmos/group/mod.rs | 2 + .../src/types/cosmos/group/module/mod.rs | 1 + .../src/types/cosmos/group/module/v1.rs | 28 + .../provwasm-std/src/types/cosmos/group/v1.rs | 2288 +++++++++++++++++ .../src/types/cosmos/ics23/mod.rs | 1 + .../provwasm-std/src/types/cosmos/ics23/v1.rs | 621 +++++ .../provwasm-std/src/types/cosmos/mint/mod.rs | 2 + .../src/types/cosmos/mint/module/mod.rs | 1 + .../src/types/cosmos/mint/module/v1.rs | 21 + .../src/types/cosmos/mint/v1beta1.rs | 260 ++ packages/provwasm-std/src/types/cosmos/mod.rs | 18 + .../provwasm-std/src/types/cosmos/msg/mod.rs | 1 + .../src/types/cosmos/msg/textual/mod.rs | 1 + .../src/types/cosmos/msg/textual/v1.rs | 1 + .../provwasm-std/src/types/cosmos/nft/mod.rs | 2 + .../src/types/cosmos/nft/module/mod.rs | 1 + .../src/types/cosmos/nft/module/v1.rs | 15 + .../src/types/cosmos/nft/v1beta1.rs | 591 +++++ .../provwasm-std/src/types/cosmos/orm/mod.rs | 4 + .../src/types/cosmos/orm/module/mod.rs | 1 + .../src/types/cosmos/orm/module/v1alpha1.rs | 17 + .../src/types/cosmos/orm/query/mod.rs | 1 + .../src/types/cosmos/orm/query/v1alpha1.rs | 274 ++ .../provwasm-std/src/types/cosmos/orm/v1.rs | 148 ++ .../src/types/cosmos/orm/v1alpha1.rs | 108 + .../src/types/cosmos/params/mod.rs | 2 + .../src/types/cosmos/params/module/mod.rs | 1 + .../src/types/cosmos/params/module/v1.rs | 15 + .../src/types/cosmos/params/v1beta1.rs | 168 ++ .../src/types/cosmos/quarantine/mod.rs | 1 + .../src/types/cosmos/quarantine/v1beta1.rs | 619 +++++ .../src/types/cosmos/query/mod.rs | 1 + .../provwasm-std/src/types/cosmos/query/v1.rs | 1 + .../src/types/cosmos/sanction/mod.rs | 1 + .../src/types/cosmos/sanction/v1beta1.rs | 506 ++++ .../src/types/cosmos/slashing/mod.rs | 1 + .../src/types/cosmos/slashing/module/mod.rs | 1 + .../src/types/cosmos/slashing/module/v1.rs | 19 + .../src/types/cosmos/slashing/v1beta1.rs | 253 ++ .../src/types/cosmos/staking/mod.rs | 1 + .../src/types/cosmos/staking/module/mod.rs | 1 + .../src/types/cosmos/staking/module/v1.rs | 30 + .../src/types/cosmos/staking/v1beta1.rs | 1789 ++++++++++++- .../src/types/cosmos/store/internal/kv/mod.rs | 1 + .../types/cosmos/store/internal/kv/v1beta1.rs | 45 + .../src/types/cosmos/store/internal/mod.rs | 1 + .../src/types/cosmos/store/mod.rs | 4 + .../src/types/cosmos/store/snapshots/mod.rs | 1 + .../src/types/cosmos/store/snapshots/v1.rs | 215 ++ .../src/types/cosmos/store/streaming/abci.rs | 76 + .../src/types/cosmos/store/streaming/mod.rs | 1 + .../src/types/cosmos/store/v1beta1.rs | 138 + .../src/types/cosmos/tx/config/mod.rs | 1 + .../src/types/cosmos/tx/config/v1.rs | 24 + .../provwasm-std/src/types/cosmos/tx/mod.rs | 2 + .../src/types/cosmos/tx/signing/v1beta1.rs | 82 +- .../src/types/cosmos/tx/v1beta1.rs | 1019 ++++++++ .../src/types/cosmos/upgrade/mod.rs | 1 + .../src/types/cosmos/upgrade/module/mod.rs | 1 + .../src/types/cosmos/upgrade/module/v1.rs | 19 + .../src/types/cosmos/upgrade/v1beta1.rs | 359 +++ .../src/types/cosmos/vesting/mod.rs | 2 + .../src/types/cosmos/vesting/module/mod.rs | 1 + .../src/types/cosmos/vesting/module/v1.rs | 15 + .../src/types/cosmos/vesting/v1beta1.rs | 280 ++ 133 files changed, 17795 insertions(+), 199 deletions(-) create mode 100644 packages/provwasm-std/src/types/cosmos/app/mod.rs create mode 100644 packages/provwasm-std/src/types/cosmos/app/runtime/mod.rs create mode 100644 packages/provwasm-std/src/types/cosmos/app/runtime/v1alpha1.rs create mode 100644 packages/provwasm-std/src/types/cosmos/app/v1alpha1.rs create mode 100644 packages/provwasm-std/src/types/cosmos/auth/module/mod.rs create mode 100644 packages/provwasm-std/src/types/cosmos/auth/module/v1.rs create mode 100644 packages/provwasm-std/src/types/cosmos/authz/module/mod.rs create mode 100644 packages/provwasm-std/src/types/cosmos/authz/module/v1.rs create mode 100644 packages/provwasm-std/src/types/cosmos/bank/module/mod.rs create mode 100644 packages/provwasm-std/src/types/cosmos/bank/module/v1.rs create mode 100644 packages/provwasm-std/src/types/cosmos/base/abci/mod.rs create mode 100644 packages/provwasm-std/src/types/cosmos/base/abci/v1beta1.rs create mode 100644 packages/provwasm-std/src/types/cosmos/base/node/mod.rs create mode 100644 packages/provwasm-std/src/types/cosmos/base/node/v1beta1.rs create mode 100644 packages/provwasm-std/src/types/cosmos/base/tendermint/mod.rs create mode 100644 packages/provwasm-std/src/types/cosmos/base/tendermint/v1beta1.rs create mode 100644 packages/provwasm-std/src/types/cosmos/circuit/mod.rs create mode 100644 packages/provwasm-std/src/types/cosmos/circuit/module/mod.rs create mode 100644 packages/provwasm-std/src/types/cosmos/circuit/module/v1.rs create mode 100644 packages/provwasm-std/src/types/cosmos/circuit/v1.rs create mode 100644 packages/provwasm-std/src/types/cosmos/consensus/mod.rs create mode 100644 packages/provwasm-std/src/types/cosmos/consensus/module/mod.rs create mode 100644 packages/provwasm-std/src/types/cosmos/consensus/module/v1.rs create mode 100644 packages/provwasm-std/src/types/cosmos/consensus/v1.rs create mode 100644 packages/provwasm-std/src/types/cosmos/crisis/mod.rs create mode 100644 packages/provwasm-std/src/types/cosmos/crisis/module/mod.rs create mode 100644 packages/provwasm-std/src/types/cosmos/crisis/module/v1.rs create mode 100644 packages/provwasm-std/src/types/cosmos/crisis/v1beta1.rs create mode 100644 packages/provwasm-std/src/types/cosmos/crypto/hd/mod.rs create mode 100644 packages/provwasm-std/src/types/cosmos/crypto/hd/v1.rs create mode 100644 packages/provwasm-std/src/types/cosmos/crypto/keyring/mod.rs create mode 100644 packages/provwasm-std/src/types/cosmos/crypto/keyring/v1.rs create mode 100644 packages/provwasm-std/src/types/cosmos/distribution/module/mod.rs create mode 100644 packages/provwasm-std/src/types/cosmos/distribution/module/v1.rs create mode 100644 packages/provwasm-std/src/types/cosmos/evidence/mod.rs create mode 100644 packages/provwasm-std/src/types/cosmos/evidence/module/mod.rs create mode 100644 packages/provwasm-std/src/types/cosmos/evidence/module/v1.rs create mode 100644 packages/provwasm-std/src/types/cosmos/evidence/v1beta1.rs create mode 100644 packages/provwasm-std/src/types/cosmos/feegrant/mod.rs create mode 100644 packages/provwasm-std/src/types/cosmos/feegrant/module/mod.rs create mode 100644 packages/provwasm-std/src/types/cosmos/feegrant/module/v1.rs create mode 100644 packages/provwasm-std/src/types/cosmos/feegrant/v1beta1.rs create mode 100644 packages/provwasm-std/src/types/cosmos/genutil/mod.rs create mode 100644 packages/provwasm-std/src/types/cosmos/genutil/module/mod.rs create mode 100644 packages/provwasm-std/src/types/cosmos/genutil/module/v1.rs create mode 100644 packages/provwasm-std/src/types/cosmos/genutil/v1beta1.rs create mode 100644 packages/provwasm-std/src/types/cosmos/gov/module/mod.rs create mode 100644 packages/provwasm-std/src/types/cosmos/gov/module/v1.rs create mode 100644 packages/provwasm-std/src/types/cosmos/gov/v1.rs create mode 100644 packages/provwasm-std/src/types/cosmos/group/mod.rs create mode 100644 packages/provwasm-std/src/types/cosmos/group/module/mod.rs create mode 100644 packages/provwasm-std/src/types/cosmos/group/module/v1.rs create mode 100644 packages/provwasm-std/src/types/cosmos/group/v1.rs create mode 100644 packages/provwasm-std/src/types/cosmos/ics23/mod.rs create mode 100644 packages/provwasm-std/src/types/cosmos/ics23/v1.rs create mode 100644 packages/provwasm-std/src/types/cosmos/mint/mod.rs create mode 100644 packages/provwasm-std/src/types/cosmos/mint/module/mod.rs create mode 100644 packages/provwasm-std/src/types/cosmos/mint/module/v1.rs create mode 100644 packages/provwasm-std/src/types/cosmos/mint/v1beta1.rs create mode 100644 packages/provwasm-std/src/types/cosmos/msg/textual/mod.rs create mode 100644 packages/provwasm-std/src/types/cosmos/msg/textual/v1.rs create mode 100644 packages/provwasm-std/src/types/cosmos/nft/mod.rs create mode 100644 packages/provwasm-std/src/types/cosmos/nft/module/mod.rs create mode 100644 packages/provwasm-std/src/types/cosmos/nft/module/v1.rs create mode 100644 packages/provwasm-std/src/types/cosmos/nft/v1beta1.rs create mode 100644 packages/provwasm-std/src/types/cosmos/orm/mod.rs create mode 100644 packages/provwasm-std/src/types/cosmos/orm/module/mod.rs create mode 100644 packages/provwasm-std/src/types/cosmos/orm/module/v1alpha1.rs create mode 100644 packages/provwasm-std/src/types/cosmos/orm/query/mod.rs create mode 100644 packages/provwasm-std/src/types/cosmos/orm/query/v1alpha1.rs create mode 100644 packages/provwasm-std/src/types/cosmos/orm/v1.rs create mode 100644 packages/provwasm-std/src/types/cosmos/orm/v1alpha1.rs create mode 100644 packages/provwasm-std/src/types/cosmos/params/mod.rs create mode 100644 packages/provwasm-std/src/types/cosmos/params/module/mod.rs create mode 100644 packages/provwasm-std/src/types/cosmos/params/module/v1.rs create mode 100644 packages/provwasm-std/src/types/cosmos/params/v1beta1.rs create mode 100644 packages/provwasm-std/src/types/cosmos/quarantine/mod.rs create mode 100644 packages/provwasm-std/src/types/cosmos/quarantine/v1beta1.rs create mode 100644 packages/provwasm-std/src/types/cosmos/query/mod.rs create mode 100644 packages/provwasm-std/src/types/cosmos/query/v1.rs create mode 100644 packages/provwasm-std/src/types/cosmos/sanction/mod.rs create mode 100644 packages/provwasm-std/src/types/cosmos/sanction/v1beta1.rs create mode 100644 packages/provwasm-std/src/types/cosmos/slashing/module/mod.rs create mode 100644 packages/provwasm-std/src/types/cosmos/slashing/module/v1.rs create mode 100644 packages/provwasm-std/src/types/cosmos/staking/module/mod.rs create mode 100644 packages/provwasm-std/src/types/cosmos/staking/module/v1.rs create mode 100644 packages/provwasm-std/src/types/cosmos/store/internal/kv/mod.rs create mode 100644 packages/provwasm-std/src/types/cosmos/store/internal/kv/v1beta1.rs create mode 100644 packages/provwasm-std/src/types/cosmos/store/internal/mod.rs create mode 100644 packages/provwasm-std/src/types/cosmos/store/mod.rs create mode 100644 packages/provwasm-std/src/types/cosmos/store/snapshots/mod.rs create mode 100644 packages/provwasm-std/src/types/cosmos/store/snapshots/v1.rs create mode 100644 packages/provwasm-std/src/types/cosmos/store/streaming/abci.rs create mode 100644 packages/provwasm-std/src/types/cosmos/store/streaming/mod.rs create mode 100644 packages/provwasm-std/src/types/cosmos/store/v1beta1.rs create mode 100644 packages/provwasm-std/src/types/cosmos/tx/config/mod.rs create mode 100644 packages/provwasm-std/src/types/cosmos/tx/config/v1.rs create mode 100644 packages/provwasm-std/src/types/cosmos/tx/v1beta1.rs create mode 100644 packages/provwasm-std/src/types/cosmos/upgrade/module/mod.rs create mode 100644 packages/provwasm-std/src/types/cosmos/upgrade/module/v1.rs create mode 100644 packages/provwasm-std/src/types/cosmos/vesting/mod.rs create mode 100644 packages/provwasm-std/src/types/cosmos/vesting/module/mod.rs create mode 100644 packages/provwasm-std/src/types/cosmos/vesting/module/v1.rs create mode 100644 packages/provwasm-std/src/types/cosmos/vesting/v1beta1.rs diff --git a/packages/provwasm-std/src/types/cosmos/app/mod.rs b/packages/provwasm-std/src/types/cosmos/app/mod.rs new file mode 100644 index 00000000..6e347e34 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/app/mod.rs @@ -0,0 +1,2 @@ +pub mod runtime; +pub mod v1alpha1; diff --git a/packages/provwasm-std/src/types/cosmos/app/runtime/mod.rs b/packages/provwasm-std/src/types/cosmos/app/runtime/mod.rs new file mode 100644 index 00000000..32a5a9d4 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/app/runtime/mod.rs @@ -0,0 +1 @@ +pub mod v1alpha1; diff --git a/packages/provwasm-std/src/types/cosmos/app/runtime/v1alpha1.rs b/packages/provwasm-std/src/types/cosmos/app/runtime/v1alpha1.rs new file mode 100644 index 00000000..9ac68f9d --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/app/runtime/v1alpha1.rs @@ -0,0 +1,80 @@ +use provwasm_proc_macro::CosmwasmExt; +/// Module is the config object for the runtime 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.app.runtime.v1alpha1.Module")] +pub struct Module { + /// app_name is the name of the app. + #[prost(string, tag = "1")] + pub app_name: ::prost::alloc::string::String, + /// begin_blockers specifies the module names of begin blockers + /// to call in the order in which they should be called. If this is left empty + /// no begin blocker will be registered. + #[prost(string, repeated, tag = "2")] + pub begin_blockers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// end_blockers specifies the module names of the end blockers + /// to call in the order in which they should be called. If this is left empty + /// no end blocker will be registered. + #[prost(string, repeated, tag = "3")] + pub end_blockers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// init_genesis specifies the module names of init genesis functions + /// to call in the order in which they should be called. If this is left empty + /// no init genesis function will be registered. + #[prost(string, repeated, tag = "4")] + pub init_genesis: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// export_genesis specifies the order in which to export module genesis data. + /// If this is left empty, the init_genesis order will be used for export genesis + /// if it is specified. + #[prost(string, repeated, tag = "5")] + pub export_genesis: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// override_store_keys is an optional list of overrides for the module store keys + /// to be used in keeper construction. + #[prost(message, repeated, tag = "6")] + pub override_store_keys: ::prost::alloc::vec::Vec, + /// order_migrations defines the order in which module migrations are performed. + /// If this is left empty, it uses the default migration order. + /// + #[prost(string, repeated, tag = "7")] + pub order_migrations: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// precommiters specifies the module names of the precommiters + /// to call in the order in which they should be called. If this is left empty + /// no precommit function will be registered. + #[prost(string, repeated, tag = "8")] + pub precommiters: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// prepare_check_staters specifies the module names of the prepare_check_staters + /// to call in the order in which they should be called. If this is left empty + /// no preparecheckstate function will be registered. + #[prost(string, repeated, tag = "9")] + pub prepare_check_staters: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// StoreKeyConfig may be supplied to override the default module store key, which +/// is the module name. +#[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.app.runtime.v1alpha1.StoreKeyConfig")] +pub struct StoreKeyConfig { + /// name of the module to override the store key of + #[prost(string, tag = "1")] + pub module_name: ::prost::alloc::string::String, + /// the kv store key to use instead of the module name. + #[prost(string, tag = "2")] + pub kv_store_key: ::prost::alloc::string::String, +} diff --git a/packages/provwasm-std/src/types/cosmos/app/v1alpha1.rs b/packages/provwasm-std/src/types/cosmos/app/v1alpha1.rs new file mode 100644 index 00000000..c618c2f4 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/app/v1alpha1.rs @@ -0,0 +1,248 @@ +use provwasm_proc_macro::CosmwasmExt; +/// ModuleDescriptor describes an app 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.app.v1alpha1.ModuleDescriptor")] +pub struct ModuleDescriptor { + /// go_import names the package that should be imported by an app to load the + /// module in the runtime module registry. It is required to make debugging + /// of configuration errors easier for users. + #[prost(string, tag = "1")] + pub go_import: ::prost::alloc::string::String, + /// use_package refers to a protobuf package that this module + /// uses and exposes to the world. In an app, only one module should "use" + /// or own a single protobuf package. It is assumed that the module uses + /// all of the .proto files in a single package. + #[prost(message, repeated, tag = "2")] + pub use_package: ::prost::alloc::vec::Vec, + /// can_migrate_from defines which module versions this module can migrate + /// state from. The framework will check that one module version is able to + /// migrate from a previous module version before attempting to update its + /// config. It is assumed that modules can transitively migrate from earlier + /// versions. For instance if v3 declares it can migrate from v2, and v2 + /// declares it can migrate from v1, the framework knows how to migrate + /// from v1 to v3, assuming all 3 module versions are registered at runtime. + #[prost(message, repeated, tag = "3")] + pub can_migrate_from: ::prost::alloc::vec::Vec, +} +/// PackageReference is a reference to a protobuf package used by a 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.app.v1alpha1.PackageReference")] +pub struct PackageReference { + /// name is the fully-qualified name of the package. + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + /// revision is the optional revision of the package that is being used. + /// Protobuf packages used in Cosmos should generally have a major version + /// as the last part of the package name, ex. foo.bar.baz.v1. + /// The revision of a package can be thought of as the minor version of a + /// package which has additional backwards compatible definitions that weren't + /// present in a previous version. + /// + /// A package should indicate its revision with a source code comment + /// above the package declaration in one of its files containing the + /// text "Revision N" where N is an integer revision. All packages start + /// at revision 0 the first time they are released in a module. + /// + /// When a new version of a module is released and items are added to existing + /// .proto files, these definitions should contain comments of the form + /// "Since: Revision N" where N is an integer revision. + /// + /// When the module runtime starts up, it will check the pinned proto + /// image and panic if there are runtime protobuf definitions that are not + /// in the pinned descriptor which do not have + /// a "Since Revision N" comment or have a "Since Revision N" comment where + /// N is <= to the revision specified here. This indicates that the protobuf + /// files have been updated, but the pinned file descriptor hasn't. + /// + /// If there are items in the pinned file descriptor with a revision + /// greater than the value indicated here, this will also cause a panic + /// as it may mean that the pinned descriptor for a legacy module has been + /// improperly updated or that there is some other versioning discrepancy. + /// Runtime protobuf definitions will also be checked for compatibility + /// with pinned file descriptors to make sure there are no incompatible changes. + /// + /// This behavior ensures that: + /// * pinned proto images are up-to-date + /// * protobuf files are carefully annotated with revision comments which + /// are important good client UX + /// * protobuf files are changed in backwards and forwards compatible ways + #[prost(uint32, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub revision: u32, +} +/// MigrateFromInfo is information on a module version that a newer module +/// can migrate from. +#[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.app.v1alpha1.MigrateFromInfo")] +pub struct MigrateFromInfo { + /// module is the fully-qualified protobuf name of the module config object + /// for the previous module version, ex: "cosmos.group.module.v1.Module". + #[prost(string, tag = "1")] + pub module: ::prost::alloc::string::String, +} +/// Config represents the configuration for a Cosmos SDK ABCI app. +/// It is intended that all state machine logic including the version of +/// baseapp and tx handlers (and possibly even Tendermint) that an app needs +/// can be described in a config object. For compatibility, the framework should +/// allow a mixture of declarative and imperative app wiring, however, apps +/// that strive for the maximum ease of maintainability should be able to describe +/// their state machine with a config object alone. +#[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.app.v1alpha1.Config")] +pub struct Config { + /// modules are the module configurations for the app. + #[prost(message, repeated, tag = "1")] + pub modules: ::prost::alloc::vec::Vec, + /// golang_bindings specifies explicit interface to implementation type bindings which + /// depinject uses to resolve interface inputs to provider functions. The scope of this + /// field's configuration is global (not module specific). + #[prost(message, repeated, tag = "2")] + pub golang_bindings: ::prost::alloc::vec::Vec, +} +/// ModuleConfig is a module configuration for an app. +#[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.app.v1alpha1.ModuleConfig")] +pub struct ModuleConfig { + /// name is the unique name of the module within the app. It should be a name + /// that persists between different versions of a module so that modules + /// can be smoothly upgraded to new versions. + /// + /// For example, for the module cosmos.bank.module.v1.Module, we may chose + /// to simply name the module "bank" in the app. When we upgrade to + /// cosmos.bank.module.v2.Module, the app-specific name "bank" stays the same + /// and the framework knows that the v2 module should receive all the same state + /// that the v1 module had. Note: modules should provide info on which versions + /// they can migrate from in the ModuleDescriptor.can_migration_from field. + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + /// config is the config object for the module. Module config messages should + /// define a ModuleDescriptor using the cosmos.app.v1alpha1.is_module extension. + #[prost(message, optional, tag = "2")] + pub config: ::core::option::Option, + /// golang_bindings specifies explicit interface to implementation type bindings which + /// depinject uses to resolve interface inputs to provider functions. The scope of this + /// field's configuration is module specific. + #[prost(message, repeated, tag = "3")] + pub golang_bindings: ::prost::alloc::vec::Vec, +} +/// GolangBinding is an explicit interface type to implementing type binding for dependency injection. +#[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.app.v1alpha1.GolangBinding")] +pub struct GolangBinding { + /// interface_type is the interface type which will be bound to a specific implementation type + #[prost(string, tag = "1")] + pub interface_type: ::prost::alloc::string::String, + /// implementation is the implementing type which will be supplied when an input of type interface is requested + #[prost(string, tag = "2")] + pub implementation: ::prost::alloc::string::String, +} +/// QueryConfigRequest is the Query/Config request 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.app.v1alpha1.QueryConfigRequest")] +#[proto_query( + path = "/cosmos.app.v1alpha1.Query/Config", + response_type = QueryConfigResponse +)] +pub struct QueryConfigRequest {} +/// QueryConfigRequest is the Query/Config 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.app.v1alpha1.QueryConfigResponse")] +pub struct QueryConfigResponse { + /// config is the current app config. + #[prost(message, optional, tag = "1")] + pub config: ::core::option::Option, +} +pub struct V1alpha1Querier<'a, Q: cosmwasm_std::CustomQuery> { + querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, +} +impl<'a, Q: cosmwasm_std::CustomQuery> V1alpha1Querier<'a, Q> { + pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self { + Self { querier } + } + pub fn config(&self) -> Result { + QueryConfigRequest {}.query(self.querier) + } +} diff --git a/packages/provwasm-std/src/types/cosmos/auth/mod.rs b/packages/provwasm-std/src/types/cosmos/auth/mod.rs index 9f64fc82..537a3360 100644 --- a/packages/provwasm-std/src/types/cosmos/auth/mod.rs +++ b/packages/provwasm-std/src/types/cosmos/auth/mod.rs @@ -1 +1,2 @@ +pub mod module; pub mod v1beta1; diff --git a/packages/provwasm-std/src/types/cosmos/auth/module/mod.rs b/packages/provwasm-std/src/types/cosmos/auth/module/mod.rs new file mode 100644 index 00000000..a3a6d96c --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/auth/module/mod.rs @@ -0,0 +1 @@ +pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/auth/module/v1.rs b/packages/provwasm-std/src/types/cosmos/auth/module/v1.rs new file mode 100644 index 00000000..2496f5ed --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/auth/module/v1.rs @@ -0,0 +1,47 @@ +use provwasm_proc_macro::CosmwasmExt; +/// Module is the config object for the auth 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.auth.module.v1.Module")] +pub struct Module { + /// bech32_prefix is the bech32 account prefix for the app. + #[prost(string, tag = "1")] + pub bech32_prefix: ::prost::alloc::string::String, + /// module_account_permissions are module account permissions. + #[prost(message, repeated, tag = "2")] + pub module_account_permissions: ::prost::alloc::vec::Vec, + /// authority defines the custom module authority. If not set, defaults to the governance module. + #[prost(string, tag = "3")] + pub authority: ::prost::alloc::string::String, +} +/// ModuleAccountPermission represents permissions for a module account. +#[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.auth.module.v1.ModuleAccountPermission")] +pub struct ModuleAccountPermission { + /// account is the name of the module. + #[prost(string, tag = "1")] + pub account: ::prost::alloc::string::String, + /// permissions are the permissions this module has. Currently recognized + /// values are minter, burner and staking. + #[prost(string, repeated, tag = "2")] + pub permissions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} diff --git a/packages/provwasm-std/src/types/cosmos/auth/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/auth/v1beta1.rs index e58527de..d1aed1a3 100644 --- a/packages/provwasm-std/src/types/cosmos/auth/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/auth/v1beta1.rs @@ -1,4 +1,7 @@ use provwasm_proc_macro::CosmwasmExt; +/// BaseAccount defines a base account type. It contains all the necessary fields +/// for basic account functionality. Any custom account type should extend this +/// type for additional functionality (e.g. vesting). #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -29,6 +32,52 @@ pub struct BaseAccount { )] pub sequence: u64, } +/// ModuleAccount defines an account for modules that holds coins on a pool. +#[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.auth.v1beta1.ModuleAccount")] +pub struct ModuleAccount { + #[prost(message, optional, tag = "1")] + pub base_account: ::core::option::Option, + #[prost(string, tag = "2")] + pub name: ::prost::alloc::string::String, + #[prost(string, repeated, tag = "3")] + pub permissions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// ModuleCredential represents a unclaimable pubkey for base accounts controlled by modules. +/// +/// Since: cosmos-sdk 0.47 +#[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.auth.v1beta1.ModuleCredential")] +pub struct ModuleCredential { + /// module_name is the name of the module used for address derivation (passed into address.Module). + #[prost(string, tag = "1")] + pub module_name: ::prost::alloc::string::String, + /// derivation_keys is for deriving a module account address (passed into address.Module) + /// adding more keys creates sub-account addresses (passed into address.Derive) + #[prost(bytes = "vec", repeated, tag = "2")] + pub derivation_keys: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, +} +/// Params defines the parameters for the auth module. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -43,16 +92,105 @@ pub struct BaseAccount { #[proto_message(type_url = "/cosmos.auth.v1beta1.Params")] pub struct Params { #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] pub max_memo_characters: u64, #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] pub tx_sig_limit: u64, #[prost(uint64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] pub tx_size_cost_per_byte: u64, #[prost(uint64, tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] pub sig_verify_cost_ed25519: u64, #[prost(uint64, tag = "5")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] pub sig_verify_cost_secp256k1: u64, } +/// GenesisState defines the auth module's genesis state. +#[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.auth.v1beta1.GenesisState")] +pub struct GenesisState { + /// params defines all the parameters of the module. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, + /// accounts are the accounts present at genesis. + #[prost(message, repeated, tag = "2")] + pub accounts: ::prost::alloc::vec::Vec, +} +/// QueryAccountsRequest is the request type for the Query/Accounts RPC method. +/// +/// Since: cosmos-sdk 0.43 +#[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.auth.v1beta1.QueryAccountsRequest")] +#[proto_query( + path = "/cosmos.auth.v1beta1.Query/Accounts", + response_type = QueryAccountsResponse +)] +pub struct QueryAccountsRequest { + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "1")] + pub pagination: ::core::option::Option, +} +/// QueryAccountsResponse is the response type for the Query/Accounts RPC method. +/// +/// Since: cosmos-sdk 0.43 +#[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.auth.v1beta1.QueryAccountsResponse")] +pub struct QueryAccountsResponse { + /// accounts are the existing accounts + #[prost(message, repeated, tag = "1")] + pub accounts: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryAccountRequest is the request type for the Query/Account RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -70,9 +208,11 @@ pub struct Params { response_type = QueryAccountResponse )] pub struct QueryAccountRequest { + /// address defines the address to query for. #[prost(string, tag = "1")] pub address: ::prost::alloc::string::String, } +/// QueryAccountResponse is the response type for the Query/Account RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -86,9 +226,11 @@ pub struct QueryAccountRequest { )] #[proto_message(type_url = "/cosmos.auth.v1beta1.QueryAccountResponse")] pub struct QueryAccountResponse { + /// account defines the account of the corresponding address. #[prost(message, optional, tag = "1")] pub account: ::core::option::Option, } +/// QueryParamsRequest is the request type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -106,6 +248,7 @@ pub struct QueryAccountResponse { response_type = QueryParamsResponse )] pub struct QueryParamsRequest {} +/// QueryParamsResponse is the response type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -119,9 +262,365 @@ pub struct QueryParamsRequest {} )] #[proto_message(type_url = "/cosmos.auth.v1beta1.QueryParamsResponse")] pub struct QueryParamsResponse { + /// params defines the parameters of the module. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} +/// QueryModuleAccountsRequest is the request type for the Query/ModuleAccounts 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.auth.v1beta1.QueryModuleAccountsRequest")] +#[proto_query( + path = "/cosmos.auth.v1beta1.Query/ModuleAccounts", + response_type = QueryModuleAccountsResponse +)] +pub struct QueryModuleAccountsRequest {} +/// QueryModuleAccountsResponse is the response type for the Query/ModuleAccounts 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.auth.v1beta1.QueryModuleAccountsResponse")] +pub struct QueryModuleAccountsResponse { + #[prost(message, repeated, tag = "1")] + pub accounts: ::prost::alloc::vec::Vec, +} +/// QueryModuleAccountByNameRequest is the request type for the Query/ModuleAccountByName 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.auth.v1beta1.QueryModuleAccountByNameRequest")] +#[proto_query( + path = "/cosmos.auth.v1beta1.Query/ModuleAccountByName", + response_type = QueryModuleAccountByNameResponse +)] +pub struct QueryModuleAccountByNameRequest { + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, +} +/// QueryModuleAccountByNameResponse is the response type for the Query/ModuleAccountByName 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.auth.v1beta1.QueryModuleAccountByNameResponse")] +pub struct QueryModuleAccountByNameResponse { + #[prost(message, optional, tag = "1")] + pub account: ::core::option::Option, +} +/// Bech32PrefixRequest is the request type for Bech32Prefix 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.auth.v1beta1.Bech32PrefixRequest")] +#[proto_query( + path = "/cosmos.auth.v1beta1.Query/Bech32Prefix", + response_type = Bech32PrefixResponse +)] +pub struct Bech32PrefixRequest {} +/// Bech32PrefixResponse is the response type for Bech32Prefix 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.auth.v1beta1.Bech32PrefixResponse")] +pub struct Bech32PrefixResponse { + #[prost(string, tag = "1")] + pub bech32_prefix: ::prost::alloc::string::String, +} +/// AddressBytesToStringRequest is the request type for AddressString 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.auth.v1beta1.AddressBytesToStringRequest")] +#[proto_query( + path = "/cosmos.auth.v1beta1.Query/AddressBytesToString", + response_type = AddressBytesToStringResponse +)] +pub struct AddressBytesToStringRequest { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub address_bytes: ::prost::alloc::vec::Vec, +} +/// AddressBytesToStringResponse is the response type for AddressString 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.auth.v1beta1.AddressBytesToStringResponse")] +pub struct AddressBytesToStringResponse { + #[prost(string, tag = "1")] + pub address_string: ::prost::alloc::string::String, +} +/// AddressStringToBytesRequest is the request type for AccountBytes 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.auth.v1beta1.AddressStringToBytesRequest")] +#[proto_query( + path = "/cosmos.auth.v1beta1.Query/AddressStringToBytes", + response_type = AddressStringToBytesResponse +)] +pub struct AddressStringToBytesRequest { + #[prost(string, tag = "1")] + pub address_string: ::prost::alloc::string::String, +} +/// AddressStringToBytesResponse is the response type for AddressBytes 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.auth.v1beta1.AddressStringToBytesResponse")] +pub struct AddressStringToBytesResponse { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub address_bytes: ::prost::alloc::vec::Vec, +} +/// QueryAccountAddressByIDRequest is the request type for AccountAddressByID rpc method +/// +/// Since: cosmos-sdk 0.46.2 +#[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.auth.v1beta1.QueryAccountAddressByIDRequest")] +#[proto_query( + path = "/cosmos.auth.v1beta1.Query/AccountAddressByID", + response_type = QueryAccountAddressByIdResponse +)] +pub struct QueryAccountAddressByIdRequest { + /// Deprecated, use account_id instead + /// + /// id is the account number of the address to be queried. This field + /// should have been an uint64 (like all account numbers), and will be + /// updated to uint64 in a future version of the auth query. + #[deprecated] + #[prost(int64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub id: i64, + /// account_id is the account number of the address to be queried. + /// + /// Since: cosmos-sdk 0.47 + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub account_id: u64, +} +/// QueryAccountAddressByIDResponse is the response type for AccountAddressByID rpc method +/// +/// Since: cosmos-sdk 0.46.2 +#[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.auth.v1beta1.QueryAccountAddressByIDResponse")] +pub struct QueryAccountAddressByIdResponse { + #[prost(string, tag = "1")] + pub account_address: ::prost::alloc::string::String, +} +/// QueryAccountInfoRequest is the Query/AccountInfo request type. +/// +/// Since: cosmos-sdk 0.47 +#[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.auth.v1beta1.QueryAccountInfoRequest")] +#[proto_query( + path = "/cosmos.auth.v1beta1.Query/AccountInfo", + response_type = QueryAccountInfoResponse +)] +pub struct QueryAccountInfoRequest { + /// address is the account address string. + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, +} +/// QueryAccountInfoResponse is the Query/AccountInfo response type. +/// +/// Since: cosmos-sdk 0.47 +#[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.auth.v1beta1.QueryAccountInfoResponse")] +pub struct QueryAccountInfoResponse { + /// info is the account info which is represented by BaseAccount. #[prost(message, optional, tag = "1")] + pub info: ::core::option::Option, +} +/// MsgUpdateParams is the Msg/UpdateParams request type. +/// +/// Since: cosmos-sdk 0.47 +#[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.auth.v1beta1.MsgUpdateParams")] +pub struct MsgUpdateParams { + /// authority is the address that controls the module (defaults to x/gov unless overwritten). + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// params defines the x/auth parameters to update. + /// + /// NOTE: All parameters must be supplied. + #[prost(message, optional, tag = "2")] pub params: ::core::option::Option, } +/// MsgUpdateParamsResponse defines the response structure for executing a +/// MsgUpdateParams message. +/// +/// Since: cosmos-sdk 0.47 +#[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.auth.v1beta1.MsgUpdateParamsResponse")] +pub struct MsgUpdateParamsResponse {} pub struct AuthQuerier<'a, Q: cosmwasm_std::CustomQuery> { querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, } @@ -129,13 +628,56 @@ impl<'a, Q: cosmwasm_std::CustomQuery> AuthQuerier<'a, Q> { pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self { Self { querier } } + pub fn accounts( + &self, + pagination: ::core::option::Option, + ) -> Result { + QueryAccountsRequest { pagination }.query(self.querier) + } pub fn account( &self, address: ::prost::alloc::string::String, ) -> Result { QueryAccountRequest { address }.query(self.querier) } + pub fn account_address_by_id( + &self, + id: i64, + account_id: u64, + ) -> Result { + QueryAccountAddressByIdRequest { id, account_id }.query(self.querier) + } pub fn params(&self) -> Result { QueryParamsRequest {}.query(self.querier) } + pub fn module_accounts(&self) -> Result { + QueryModuleAccountsRequest {}.query(self.querier) + } + pub fn module_account_by_name( + &self, + name: ::prost::alloc::string::String, + ) -> Result { + QueryModuleAccountByNameRequest { name }.query(self.querier) + } + pub fn bech32_prefix(&self) -> Result { + Bech32PrefixRequest {}.query(self.querier) + } + pub fn address_bytes_to_string( + &self, + address_bytes: ::prost::alloc::vec::Vec, + ) -> Result { + AddressBytesToStringRequest { address_bytes }.query(self.querier) + } + pub fn address_string_to_bytes( + &self, + address_string: ::prost::alloc::string::String, + ) -> Result { + AddressStringToBytesRequest { address_string }.query(self.querier) + } + pub fn account_info( + &self, + address: ::prost::alloc::string::String, + ) -> Result { + QueryAccountInfoRequest { address }.query(self.querier) + } } diff --git a/packages/provwasm-std/src/types/cosmos/authz/mod.rs b/packages/provwasm-std/src/types/cosmos/authz/mod.rs index 9f64fc82..537a3360 100644 --- a/packages/provwasm-std/src/types/cosmos/authz/mod.rs +++ b/packages/provwasm-std/src/types/cosmos/authz/mod.rs @@ -1 +1,2 @@ +pub mod module; pub mod v1beta1; diff --git a/packages/provwasm-std/src/types/cosmos/authz/module/mod.rs b/packages/provwasm-std/src/types/cosmos/authz/module/mod.rs new file mode 100644 index 00000000..a3a6d96c --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/authz/module/mod.rs @@ -0,0 +1 @@ +pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/authz/module/v1.rs b/packages/provwasm-std/src/types/cosmos/authz/module/v1.rs new file mode 100644 index 00000000..edb32762 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/authz/module/v1.rs @@ -0,0 +1,15 @@ +use provwasm_proc_macro::CosmwasmExt; +/// Module is the config object of the authz 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.authz.module.v1.Module")] +pub struct Module {} diff --git a/packages/provwasm-std/src/types/cosmos/authz/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/authz/v1beta1.rs index 67f4bf26..ebbd25a9 100644 --- a/packages/provwasm-std/src/types/cosmos/authz/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/authz/v1beta1.rs @@ -1,4 +1,6 @@ use provwasm_proc_macro::CosmwasmExt; +/// GenericAuthorization gives the grantee unrestricted permissions to execute +/// the provided method on behalf of the granter's account. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -12,9 +14,38 @@ use provwasm_proc_macro::CosmwasmExt; )] #[proto_message(type_url = "/cosmos.authz.v1beta1.GenericAuthorization")] pub struct GenericAuthorization { + /// Msg, identified by it's type URL, to grant unrestricted permissions to execute #[prost(string, tag = "1")] pub msg: ::prost::alloc::string::String, } +/// CountAuthorization gives the grantee unrestricted permissions to execute +/// the provided method on behalf of the granter's account up to the allowed authorizations count. +#[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.authz.v1beta1.CountAuthorization")] +pub struct CountAuthorization { + /// Msg, identified by it's type URL, to grant unrestricted permissions to execute + #[prost(string, tag = "1")] + pub msg: ::prost::alloc::string::String, + /// Allowed number of authorizations assigned to grantee + #[prost(int32, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub allowed_authorizations: i32, +} +/// Grant gives permissions to execute +/// the provide method with expiration time. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -30,9 +61,14 @@ pub struct GenericAuthorization { pub struct Grant { #[prost(message, optional, tag = "1")] pub authorization: ::core::option::Option, + /// time when the grant will expire and will be pruned. If null, then the grant + /// doesn't have a time expiration (other conditions in `authorization` + /// may apply to invalidate the grant) #[prost(message, optional, tag = "2")] pub expiration: ::core::option::Option, } +/// GrantAuthorization extends a grant with both the addresses of the grantee and granter. +/// It is used in genesis.proto and query.proto #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -55,6 +91,7 @@ pub struct GrantAuthorization { #[prost(message, optional, tag = "4")] pub expiration: ::core::option::Option, } +/// GrantQueueItem contains the list of TypeURL of a sdk.Msg. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -68,9 +105,76 @@ pub struct GrantAuthorization { )] #[proto_message(type_url = "/cosmos.authz.v1beta1.GrantQueueItem")] pub struct GrantQueueItem { + /// msg_type_urls contains the list of TypeURL of a sdk.Msg. #[prost(string, repeated, tag = "1")] pub msg_type_urls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +/// EventGrant is emitted on Msg/Grant +#[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.authz.v1beta1.EventGrant")] +pub struct EventGrant { + /// Msg type URL for which an autorization is granted + #[prost(string, tag = "2")] + pub msg_type_url: ::prost::alloc::string::String, + /// Granter account address + #[prost(string, tag = "3")] + pub granter: ::prost::alloc::string::String, + /// Grantee account address + #[prost(string, tag = "4")] + pub grantee: ::prost::alloc::string::String, +} +/// EventRevoke is emitted on Msg/Revoke +#[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.authz.v1beta1.EventRevoke")] +pub struct EventRevoke { + /// Msg type URL for which an autorization is revoked + #[prost(string, tag = "2")] + pub msg_type_url: ::prost::alloc::string::String, + /// Granter account address + #[prost(string, tag = "3")] + pub granter: ::prost::alloc::string::String, + /// Grantee account address + #[prost(string, tag = "4")] + pub grantee: ::prost::alloc::string::String, +} +/// GenesisState defines the authz module's genesis state. +#[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.authz.v1beta1.GenesisState")] +pub struct GenesisState { + #[prost(message, repeated, tag = "1")] + pub authorization: ::prost::alloc::vec::Vec, +} +/// QueryGrantsRequest is the request type for the Query/Grants RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -92,11 +196,14 @@ pub struct QueryGrantsRequest { pub granter: ::prost::alloc::string::String, #[prost(string, tag = "2")] pub grantee: ::prost::alloc::string::String, + /// Optional, msg_type_url, when set, will query only grants matching given msg type. #[prost(string, tag = "3")] pub msg_type_url: ::prost::alloc::string::String, + /// pagination defines an pagination for the request. #[prost(message, optional, tag = "4")] pub pagination: ::core::option::Option, } +/// QueryGrantsResponse is the response type for the Query/Authorizations RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -110,11 +217,14 @@ pub struct QueryGrantsRequest { )] #[proto_message(type_url = "/cosmos.authz.v1beta1.QueryGrantsResponse")] pub struct QueryGrantsResponse { + /// authorizations is a list of grants granted for grantee by granter. #[prost(message, repeated, tag = "1")] pub grants: ::prost::alloc::vec::Vec, + /// pagination defines an pagination for the response. #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } +/// QueryGranterGrantsRequest is the request type for the Query/GranterGrants RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -134,9 +244,11 @@ pub struct QueryGrantsResponse { pub struct QueryGranterGrantsRequest { #[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, } +/// QueryGranterGrantsResponse is the response type for the Query/GranterGrants RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -150,11 +262,14 @@ pub struct QueryGranterGrantsRequest { )] #[proto_message(type_url = "/cosmos.authz.v1beta1.QueryGranterGrantsResponse")] pub struct QueryGranterGrantsResponse { + /// grants is a list of grants granted by the granter. #[prost(message, repeated, tag = "1")] pub grants: ::prost::alloc::vec::Vec, + /// pagination defines an pagination for the response. #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } +/// QueryGranteeGrantsRequest is the request type for the Query/GranteeGrants RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -174,9 +289,11 @@ pub struct QueryGranterGrantsResponse { pub struct QueryGranteeGrantsRequest { #[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, } +/// QueryGranteeGrantsResponse is the response type for the Query/GranteeGrants RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -190,11 +307,15 @@ pub struct QueryGranteeGrantsRequest { )] #[proto_message(type_url = "/cosmos.authz.v1beta1.QueryGranteeGrantsResponse")] pub struct QueryGranteeGrantsResponse { + /// grants is a list of grants granted to the grantee. #[prost(message, repeated, tag = "1")] pub grants: ::prost::alloc::vec::Vec, + /// pagination defines an pagination for the response. #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } +/// MsgGrant is a request type for Grant method. It declares authorization to the grantee +/// on behalf of the granter with the provided expiration time. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -215,6 +336,7 @@ pub struct MsgGrant { #[prost(message, optional, tag = "3")] pub grant: ::core::option::Option, } +/// MsgGrantResponse defines the Msg/MsgGrant response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -226,11 +348,11 @@ pub struct MsgGrant { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmos.authz.v1beta1.MsgExecResponse")] -pub struct MsgExecResponse { - #[prost(bytes = "vec", repeated, tag = "1")] - pub results: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, -} +#[proto_message(type_url = "/cosmos.authz.v1beta1.MsgGrantResponse")] +pub struct MsgGrantResponse {} +/// MsgExec attempts to execute the provided messages using +/// authorizations granted to the grantee. Each message should have only +/// one signer corresponding to the granter of the authorization. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -246,9 +368,13 @@ pub struct MsgExecResponse { pub struct MsgExec { #[prost(string, tag = "1")] pub grantee: ::prost::alloc::string::String, + /// Execute Msg. + /// The x/authz will try to find a grant matching (msg.signers\[0\], grantee, MsgTypeURL(msg)) + /// triple and validate it. #[prost(message, repeated, tag = "2")] pub msgs: ::prost::alloc::vec::Vec, } +/// MsgExecResponse defines the Msg/MsgExecResponse response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -260,8 +386,13 @@ pub struct MsgExec { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmos.authz.v1beta1.MsgGrantResponse")] -pub struct MsgGrantResponse {} +#[proto_message(type_url = "/cosmos.authz.v1beta1.MsgExecResponse")] +pub struct MsgExecResponse { + #[prost(bytes = "vec", repeated, tag = "1")] + pub results: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, +} +/// MsgRevoke revokes any authorization with the provided sdk.Msg type on the +/// granter's account with that has been granted to the grantee. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -282,6 +413,7 @@ pub struct MsgRevoke { #[prost(string, tag = "3")] pub msg_type_url: ::prost::alloc::string::String, } +/// MsgRevokeResponse defines the Msg/MsgRevokeResponse response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, diff --git a/packages/provwasm-std/src/types/cosmos/bank/mod.rs b/packages/provwasm-std/src/types/cosmos/bank/mod.rs index 9f64fc82..537a3360 100644 --- a/packages/provwasm-std/src/types/cosmos/bank/mod.rs +++ b/packages/provwasm-std/src/types/cosmos/bank/mod.rs @@ -1 +1,2 @@ +pub mod module; pub mod v1beta1; diff --git a/packages/provwasm-std/src/types/cosmos/bank/module/mod.rs b/packages/provwasm-std/src/types/cosmos/bank/module/mod.rs new file mode 100644 index 00000000..a3a6d96c --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/bank/module/mod.rs @@ -0,0 +1 @@ +pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/bank/module/v1.rs b/packages/provwasm-std/src/types/cosmos/bank/module/v1.rs new file mode 100644 index 00000000..c2c29ec4 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/bank/module/v1.rs @@ -0,0 +1,30 @@ +use provwasm_proc_macro::CosmwasmExt; +/// Module is the config object of the bank 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.bank.module.v1.Module")] +pub struct Module { + /// blocked_module_accounts_override configures exceptional module accounts which should be blocked from receiving + /// funds. If left empty it defaults to the list of account names supplied in the auth module configuration as + /// module_account_permissions + #[prost(string, repeated, tag = "1")] + pub blocked_module_accounts_override: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// authority defines the custom module authority. If not set, defaults to the governance module. + #[prost(string, tag = "2")] + pub authority: ::prost::alloc::string::String, + /// restrictions_order specifies the order of send restrictions and should be + /// a list of module names which provide a send restriction instance. If no + /// order is provided, then restrictions will be applied in alphabetical order + /// of module names. + #[prost(string, repeated, tag = "3")] + pub restrictions_order: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} diff --git a/packages/provwasm-std/src/types/cosmos/bank/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/bank/v1beta1.rs index 4ce31eb1..8f5719a0 100644 --- a/packages/provwasm-std/src/types/cosmos/bank/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/bank/v1beta1.rs @@ -1,4 +1,31 @@ use provwasm_proc_macro::CosmwasmExt; +/// SendAuthorization allows the grantee to spend up to spend_limit coins from +/// the granter's account. +/// +/// Since: cosmos-sdk 0.43 +#[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.bank.v1beta1.SendAuthorization")] +pub struct SendAuthorization { + #[prost(message, repeated, tag = "1")] + pub spend_limit: ::prost::alloc::vec::Vec, + /// allow_list specifies an optional list of addresses to whom the grantee can send tokens on behalf of the + /// granter. If omitted, any recipient is allowed. + /// + /// Since: cosmos-sdk 0.47 + #[prost(string, repeated, tag = "2")] + pub allow_list: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// Params defines the parameters for the bank module. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -12,12 +39,19 @@ use provwasm_proc_macro::CosmwasmExt; )] #[proto_message(type_url = "/cosmos.bank.v1beta1.Params")] pub struct Params { + /// Deprecated: Use of SendEnabled in params is deprecated. + /// For genesis, use the newly added send_enabled field in the genesis object. + /// Storage, lookup, and manipulation of this information is now in the keeper. + /// + /// As of cosmos-sdk 0.47, this only exists for backwards compatibility of genesis files. #[deprecated] #[prost(message, repeated, tag = "1")] pub send_enabled: ::prost::alloc::vec::Vec, #[prost(bool, tag = "2")] pub default_send_enabled: bool, } +/// SendEnabled maps coin denom to a send_enabled status (whether a denom is +/// sendable). #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -36,6 +70,7 @@ pub struct SendEnabled { #[prost(bool, tag = "2")] pub enabled: bool, } +/// Input models transaction input. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -54,6 +89,7 @@ pub struct Input { #[prost(message, repeated, tag = "2")] pub coins: ::prost::alloc::vec::Vec, } +/// Output models transaction outputs. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -72,6 +108,28 @@ pub struct Output { #[prost(message, repeated, tag = "2")] pub coins: ::prost::alloc::vec::Vec, } +/// Supply represents a struct that passively keeps track of the total supply +/// amounts in the network. +/// This message is deprecated now that supply is indexed by denom. +#[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.bank.v1beta1.Supply")] +#[deprecated] +pub struct Supply { + #[prost(message, repeated, tag = "1")] + pub total: ::prost::alloc::vec::Vec, +} +/// DenomUnit represents a struct that describes a given +/// denomination unit of the basic token. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -85,17 +143,26 @@ pub struct Output { )] #[proto_message(type_url = "/cosmos.bank.v1beta1.DenomUnit")] pub struct DenomUnit { + /// denom represents the string name of the given denom unit (e.g uatom). #[prost(string, tag = "1")] pub denom: ::prost::alloc::string::String, + /// exponent represents power of 10 exponent that one must + /// raise the base_denom to in order to equal the given DenomUnit's denom + /// 1 denom = 10^exponent base_denom + /// (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with + /// exponent = 6, thus: 1 atom = 10^6 uatom). #[prost(uint32, tag = "2")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub exponent: u32, + /// aliases is a list of string aliases for the given denom #[prost(string, repeated, tag = "3")] pub aliases: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +/// Metadata represents a struct that describes +/// a basic token. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -111,21 +178,95 @@ pub struct DenomUnit { pub struct Metadata { #[prost(string, tag = "1")] pub description: ::prost::alloc::string::String, + /// denom_units represents the list of DenomUnit's for a given coin #[prost(message, repeated, tag = "2")] pub denom_units: ::prost::alloc::vec::Vec, + /// base represents the base denom (should be the DenomUnit with exponent = 0). #[prost(string, tag = "3")] pub base: ::prost::alloc::string::String, + /// display indicates the suggested denom that should be + /// displayed in clients. #[prost(string, tag = "4")] pub display: ::prost::alloc::string::String, + /// name defines the name of the token (eg: Cosmos Atom) + /// + /// Since: cosmos-sdk 0.43 #[prost(string, tag = "5")] pub name: ::prost::alloc::string::String, + /// symbol is the token symbol usually shown on exchanges (eg: ATOM). This can + /// be the same as the display. + /// + /// Since: cosmos-sdk 0.43 #[prost(string, tag = "6")] pub symbol: ::prost::alloc::string::String, + /// URI to a document (on or off-chain) that contains additional information. Optional. + /// + /// Since: cosmos-sdk 0.46 #[prost(string, tag = "7")] pub uri: ::prost::alloc::string::String, + /// URIHash is a sha256 hash of a document pointed by URI. It's used to verify that + /// the document didn't change. Optional. + /// + /// Since: cosmos-sdk 0.46 #[prost(string, tag = "8")] pub uri_hash: ::prost::alloc::string::String, } +/// GenesisState defines the bank module's genesis state. +#[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.bank.v1beta1.GenesisState")] +pub struct GenesisState { + /// params defines all the parameters of the module. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, + /// balances is an array containing the balances of all the accounts. + #[prost(message, repeated, tag = "2")] + pub balances: ::prost::alloc::vec::Vec, + /// supply represents the total supply. If it is left empty, then supply will be calculated based on the provided + /// balances. Otherwise, it will be used to validate that the sum of the balances equals this amount. + #[prost(message, repeated, tag = "3")] + pub supply: ::prost::alloc::vec::Vec, + /// denom_metadata defines the metadata of the different coins. + #[prost(message, repeated, tag = "4")] + pub denom_metadata: ::prost::alloc::vec::Vec, + /// send_enabled defines the denoms where send is enabled or disabled. + /// + /// Since: cosmos-sdk 0.47 + #[prost(message, repeated, tag = "5")] + pub send_enabled: ::prost::alloc::vec::Vec, +} +/// Balance defines an account address and balance pair used in the bank module's +/// genesis state. +#[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.bank.v1beta1.Balance")] +pub struct Balance { + /// address is the address of the balance holder. + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// coins defines the different coins this balance holds. + #[prost(message, repeated, tag = "2")] + pub coins: ::prost::alloc::vec::Vec, +} +/// QueryBalanceRequest is the request type for the Query/Balance RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -143,11 +284,14 @@ pub struct Metadata { response_type = QueryBalanceResponse )] pub struct QueryBalanceRequest { + /// address is the address to query balances for. #[prost(string, tag = "1")] pub address: ::prost::alloc::string::String, + /// denom is the coin denom to query balances for. #[prost(string, tag = "2")] pub denom: ::prost::alloc::string::String, } +/// QueryBalanceResponse is the response type for the Query/Balance RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -161,9 +305,213 @@ pub struct QueryBalanceRequest { )] #[proto_message(type_url = "/cosmos.bank.v1beta1.QueryBalanceResponse")] pub struct QueryBalanceResponse { + /// balance is the balance of the coin. #[prost(message, optional, tag = "1")] pub balance: ::core::option::Option, } +/// QueryBalanceRequest is the request type for the Query/AllBalances 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.bank.v1beta1.QueryAllBalancesRequest")] +#[proto_query( + path = "/cosmos.bank.v1beta1.Query/AllBalances", + response_type = QueryAllBalancesResponse +)] +pub struct QueryAllBalancesRequest { + /// address is the address to query balances for. + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, + /// resolve_denom is the flag to resolve the denom into a human-readable form from the metadata. + /// + /// Since: cosmos-sdk 0.50 + #[prost(bool, tag = "3")] + pub resolve_denom: bool, +} +/// QueryAllBalancesResponse is the response type for the Query/AllBalances 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.bank.v1beta1.QueryAllBalancesResponse")] +pub struct QueryAllBalancesResponse { + /// balances is the balances of all the coins. + #[prost(message, repeated, tag = "1")] + pub balances: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QuerySpendableBalancesRequest defines the gRPC request structure for querying +/// an account's spendable balances. +/// +/// 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.bank.v1beta1.QuerySpendableBalancesRequest")] +#[proto_query( + path = "/cosmos.bank.v1beta1.Query/SpendableBalances", + response_type = QuerySpendableBalancesResponse +)] +pub struct QuerySpendableBalancesRequest { + /// address is the address to query spendable balances for. + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QuerySpendableBalancesResponse defines the gRPC response structure for querying +/// an account's spendable balances. +/// +/// 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.bank.v1beta1.QuerySpendableBalancesResponse")] +pub struct QuerySpendableBalancesResponse { + /// balances is the spendable balances of all the coins. + #[prost(message, repeated, tag = "1")] + pub balances: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QuerySpendableBalanceByDenomRequest defines the gRPC request structure for +/// querying an account's spendable balance for a specific denom. +/// +/// Since: cosmos-sdk 0.47 +#[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.bank.v1beta1.QuerySpendableBalanceByDenomRequest")] +#[proto_query( + path = "/cosmos.bank.v1beta1.Query/SpendableBalanceByDenom", + response_type = QuerySpendableBalanceByDenomResponse +)] +pub struct QuerySpendableBalanceByDenomRequest { + /// address is the address to query balances for. + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// denom is the coin denom to query balances for. + #[prost(string, tag = "2")] + pub denom: ::prost::alloc::string::String, +} +/// QuerySpendableBalanceByDenomResponse defines the gRPC response structure for +/// querying an account's spendable balance for a specific denom. +/// +/// Since: cosmos-sdk 0.47 +#[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.bank.v1beta1.QuerySpendableBalanceByDenomResponse")] +pub struct QuerySpendableBalanceByDenomResponse { + /// balance is the balance of the coin. + #[prost(message, optional, tag = "1")] + pub balance: ::core::option::Option, +} +/// QueryTotalSupplyRequest is the request type for the Query/TotalSupply 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.bank.v1beta1.QueryTotalSupplyRequest")] +#[proto_query( + path = "/cosmos.bank.v1beta1.Query/TotalSupply", + response_type = QueryTotalSupplyResponse +)] +pub struct QueryTotalSupplyRequest { + /// pagination defines an optional pagination for the request. + /// + /// Since: cosmos-sdk 0.43 + #[prost(message, optional, tag = "1")] + pub pagination: ::core::option::Option, +} +/// QueryTotalSupplyResponse is the response type for the Query/TotalSupply 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.bank.v1beta1.QueryTotalSupplyResponse")] +pub struct QueryTotalSupplyResponse { + /// supply is the supply of the coins + #[prost(message, repeated, tag = "1")] + pub supply: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + /// + /// Since: cosmos-sdk 0.43 + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -181,9 +529,11 @@ pub struct QueryBalanceResponse { response_type = QuerySupplyOfResponse )] pub struct QuerySupplyOfRequest { + /// denom is the coin denom to query balances for. #[prost(string, tag = "1")] pub denom: ::prost::alloc::string::String, } +/// QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -197,9 +547,11 @@ pub struct QuerySupplyOfRequest { )] #[proto_message(type_url = "/cosmos.bank.v1beta1.QuerySupplyOfResponse")] pub struct QuerySupplyOfResponse { + /// amount is the supply of the coin. #[prost(message, optional, tag = "1")] pub amount: ::core::option::Option, } +/// QueryParamsRequest defines the request type for querying x/bank parameters. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -217,6 +569,7 @@ pub struct QuerySupplyOfResponse { response_type = QueryParamsResponse )] pub struct QueryParamsRequest {} +/// QueryParamsResponse defines the response type for querying x/bank parameters. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -230,9 +583,55 @@ pub struct QueryParamsRequest {} )] #[proto_message(type_url = "/cosmos.bank.v1beta1.QueryParamsResponse")] pub struct QueryParamsResponse { + /// params provides the parameters of the bank module. #[prost(message, optional, tag = "1")] pub params: ::core::option::Option, } +/// QueryDenomsMetadataRequest is the request type for the Query/DenomsMetadata 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.bank.v1beta1.QueryDenomsMetadataRequest")] +#[proto_query( + path = "/cosmos.bank.v1beta1.Query/DenomsMetadata", + response_type = QueryDenomsMetadataResponse +)] +pub struct QueryDenomsMetadataRequest { + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "1")] + pub pagination: ::core::option::Option, +} +/// QueryDenomsMetadataResponse is the response type for the Query/DenomsMetadata 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.bank.v1beta1.QueryDenomsMetadataResponse")] +pub struct QueryDenomsMetadataResponse { + /// metadata provides the client information for all the registered tokens. + #[prost(message, repeated, tag = "1")] + pub metadatas: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryDenomMetadataRequest is the request type for the Query/DenomMetadata RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -250,9 +649,12 @@ pub struct QueryParamsResponse { response_type = QueryDenomMetadataResponse )] pub struct QueryDenomMetadataRequest { + /// denom is the coin denom to query the metadata for. #[prost(string, tag = "1")] pub denom: ::prost::alloc::string::String, } +/// QueryDenomMetadataResponse is the response type for the Query/DenomMetadata RPC +/// method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -266,9 +668,229 @@ pub struct QueryDenomMetadataRequest { )] #[proto_message(type_url = "/cosmos.bank.v1beta1.QueryDenomMetadataResponse")] pub struct QueryDenomMetadataResponse { + /// metadata describes and provides all the client information for the requested token. + #[prost(message, optional, tag = "1")] + pub metadata: ::core::option::Option, +} +/// QueryDenomMetadataByQueryStringRequest is the request type for the Query/DenomMetadata RPC method. +/// Identical with QueryDenomMetadataRequest but receives denom as query string. +#[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.bank.v1beta1.QueryDenomMetadataByQueryStringRequest")] +#[proto_query( + path = "/cosmos.bank.v1beta1.Query/DenomMetadataByQueryString", + response_type = QueryDenomMetadataByQueryStringResponse +)] +pub struct QueryDenomMetadataByQueryStringRequest { + /// denom is the coin denom to query the metadata for. + #[prost(string, tag = "1")] + pub denom: ::prost::alloc::string::String, +} +/// QueryDenomMetadataByQueryStringResponse is the response type for the Query/DenomMetadata RPC +/// method. Identical with QueryDenomMetadataResponse but receives denom as query string in request. +#[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.bank.v1beta1.QueryDenomMetadataByQueryStringResponse")] +pub struct QueryDenomMetadataByQueryStringResponse { + /// metadata describes and provides all the client information for the requested token. #[prost(message, optional, tag = "1")] pub metadata: ::core::option::Option, } +/// QueryDenomOwnersRequest defines the request type for the DenomOwners RPC query, +/// which queries for a paginated set of all account holders of a particular +/// denomination. +#[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.bank.v1beta1.QueryDenomOwnersRequest")] +#[proto_query( + path = "/cosmos.bank.v1beta1.Query/DenomOwners", + response_type = QueryDenomOwnersResponse +)] +pub struct QueryDenomOwnersRequest { + /// denom defines the coin denomination to query all account holders for. + #[prost(string, tag = "1")] + pub denom: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// DenomOwner defines structure representing an account that owns or holds a +/// particular denominated token. It contains the account address and account +/// balance of the denominated token. +/// +/// 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.bank.v1beta1.DenomOwner")] +pub struct DenomOwner { + /// address defines the address that owns a particular denomination. + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// balance is the balance of the denominated coin for an account. + #[prost(message, optional, tag = "2")] + pub balance: ::core::option::Option, +} +/// QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC query. +/// +/// 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.bank.v1beta1.QueryDenomOwnersResponse")] +pub struct QueryDenomOwnersResponse { + #[prost(message, repeated, tag = "1")] + pub denom_owners: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryDenomOwnersByQueryRequest defines the request type for the DenomOwnersByQuery RPC query, +/// which queries for a paginated set of all account holders of a particular +/// denomination. +/// +/// Since: cosmos-sdk 0.50.3 +#[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.bank.v1beta1.QueryDenomOwnersByQueryRequest")] +#[proto_query( + path = "/cosmos.bank.v1beta1.Query/DenomOwnersByQuery", + response_type = QueryDenomOwnersByQueryResponse +)] +pub struct QueryDenomOwnersByQueryRequest { + /// denom defines the coin denomination to query all account holders for. + #[prost(string, tag = "1")] + pub denom: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryDenomOwnersByQueryResponse defines the RPC response of a DenomOwnersByQuery RPC query. +/// +/// Since: cosmos-sdk 0.50.3 +#[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.bank.v1beta1.QueryDenomOwnersByQueryResponse")] +pub struct QueryDenomOwnersByQueryResponse { + #[prost(message, repeated, tag = "1")] + pub denom_owners: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QuerySendEnabledRequest defines the RPC request for looking up SendEnabled entries. +/// +/// Since: cosmos-sdk 0.47 +#[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.bank.v1beta1.QuerySendEnabledRequest")] +#[proto_query( + path = "/cosmos.bank.v1beta1.Query/SendEnabled", + response_type = QuerySendEnabledResponse +)] +pub struct QuerySendEnabledRequest { + /// denoms is the specific denoms you want look up. Leave empty to get all entries. + #[prost(string, repeated, tag = "1")] + pub denoms: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// pagination defines an optional pagination for the request. This field is + /// only read if the denoms field is empty. + #[prost(message, optional, tag = "99")] + pub pagination: ::core::option::Option, +} +/// QuerySendEnabledResponse defines the RPC response of a SendEnable query. +/// +/// Since: cosmos-sdk 0.47 +#[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.bank.v1beta1.QuerySendEnabledResponse")] +pub struct QuerySendEnabledResponse { + #[prost(message, repeated, tag = "1")] + pub send_enabled: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. This field is only + /// populated if the denoms field in the request is empty. + #[prost(message, optional, tag = "99")] + pub pagination: ::core::option::Option, +} +/// MsgSend represents a message to send coins from one account to another. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -289,6 +911,7 @@ pub struct MsgSend { #[prost(message, repeated, tag = "3")] pub amount: ::prost::alloc::vec::Vec, } +/// MsgSendResponse defines the Msg/Send response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -302,6 +925,7 @@ pub struct MsgSend { )] #[proto_message(type_url = "/cosmos.bank.v1beta1.MsgSendResponse")] pub struct MsgSendResponse {} +/// MsgMultiSend represents an arbitrary multi-in, multi-out send message. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -315,11 +939,14 @@ pub struct MsgSendResponse {} )] #[proto_message(type_url = "/cosmos.bank.v1beta1.MsgMultiSend")] pub struct MsgMultiSend { + /// Inputs, despite being `repeated`, only allows one sender input. This is + /// checked in MsgMultiSend's ValidateBasic. #[prost(message, repeated, tag = "1")] pub inputs: ::prost::alloc::vec::Vec, #[prost(message, repeated, tag = "2")] pub outputs: ::prost::alloc::vec::Vec, } +/// MsgMultiSendResponse defines the Msg/MultiSend response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -333,6 +960,134 @@ pub struct MsgMultiSend { )] #[proto_message(type_url = "/cosmos.bank.v1beta1.MsgMultiSendResponse")] pub struct MsgMultiSendResponse {} +/// MsgUpdateParams is the Msg/UpdateParams request type. +/// +/// Since: cosmos-sdk 0.47 +#[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.bank.v1beta1.MsgUpdateParams")] +pub struct MsgUpdateParams { + /// authority is the address that controls the module (defaults to x/gov unless overwritten). + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// params defines the x/bank parameters to update. + /// + /// NOTE: All parameters must be supplied. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +/// MsgUpdateParamsResponse defines the response structure for executing a +/// MsgUpdateParams message. +/// +/// Since: cosmos-sdk 0.47 +#[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.bank.v1beta1.MsgUpdateParamsResponse")] +pub struct MsgUpdateParamsResponse {} +/// MsgSetSendEnabled is the Msg/SetSendEnabled request type. +/// +/// Only entries to add/update/delete need to be included. +/// Existing SendEnabled entries that are not included in this +/// message are left unchanged. +/// +/// Since: cosmos-sdk 0.47 +#[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.bank.v1beta1.MsgSetSendEnabled")] +pub struct MsgSetSendEnabled { + /// authority is the address that controls the module. + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// send_enabled is the list of entries to add or update. + #[prost(message, repeated, tag = "2")] + pub send_enabled: ::prost::alloc::vec::Vec, + /// use_default_for is a list of denoms that should use the params.default_send_enabled value. + /// Denoms listed here will have their SendEnabled entries deleted. + /// If a denom is included that doesn't have a SendEnabled entry, + /// it will be ignored. + #[prost(string, repeated, tag = "3")] + pub use_default_for: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type. +/// +/// Since: cosmos-sdk 0.47 +#[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.bank.v1beta1.MsgSetSendEnabledResponse")] +pub struct MsgSetSendEnabledResponse {} +/// MsgUpdateDenomMetadata defines the Msg/UpdateDenomMetadata request 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.bank.v1beta1.MsgUpdateDenomMetadata")] +pub struct MsgUpdateDenomMetadata { + #[prost(string, tag = "1")] + pub from_address: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub title: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub description: ::prost::alloc::string::String, + #[prost(message, optional, tag = "4")] + pub metadata: ::core::option::Option, +} +/// MsgUpdateDenomMetadataResponse defines the Msg/UpdateDenomMetadata 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.bank.v1beta1.MsgUpdateDenomMetadataResponse")] +pub struct MsgUpdateDenomMetadataResponse {} pub struct BankQuerier<'a, Q: cosmwasm_std::CustomQuery> { querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, } @@ -347,6 +1102,43 @@ impl<'a, Q: cosmwasm_std::CustomQuery> BankQuerier<'a, Q> { ) -> Result { QueryBalanceRequest { address, denom }.query(self.querier) } + pub fn all_balances( + &self, + address: ::prost::alloc::string::String, + pagination: ::core::option::Option, + resolve_denom: bool, + ) -> Result { + QueryAllBalancesRequest { + address, + pagination, + resolve_denom, + } + .query(self.querier) + } + pub fn spendable_balances( + &self, + address: ::prost::alloc::string::String, + pagination: ::core::option::Option, + ) -> Result { + QuerySpendableBalancesRequest { + address, + pagination, + } + .query(self.querier) + } + pub fn spendable_balance_by_denom( + &self, + address: ::prost::alloc::string::String, + denom: ::prost::alloc::string::String, + ) -> Result { + QuerySpendableBalanceByDenomRequest { address, denom }.query(self.querier) + } + pub fn total_supply( + &self, + pagination: ::core::option::Option, + ) -> Result { + QueryTotalSupplyRequest { pagination }.query(self.querier) + } pub fn supply_of( &self, denom: ::prost::alloc::string::String, @@ -362,4 +1154,37 @@ impl<'a, Q: cosmwasm_std::CustomQuery> BankQuerier<'a, Q> { ) -> Result { QueryDenomMetadataRequest { denom }.query(self.querier) } + pub fn denom_metadata_by_query_string( + &self, + denom: ::prost::alloc::string::String, + ) -> Result { + QueryDenomMetadataByQueryStringRequest { denom }.query(self.querier) + } + pub fn denoms_metadata( + &self, + pagination: ::core::option::Option, + ) -> Result { + QueryDenomsMetadataRequest { pagination }.query(self.querier) + } + pub fn denom_owners( + &self, + denom: ::prost::alloc::string::String, + pagination: ::core::option::Option, + ) -> Result { + QueryDenomOwnersRequest { denom, pagination }.query(self.querier) + } + pub fn denom_owners_by_query( + &self, + denom: ::prost::alloc::string::String, + pagination: ::core::option::Option, + ) -> Result { + QueryDenomOwnersByQueryRequest { denom, pagination }.query(self.querier) + } + pub fn send_enabled( + &self, + denoms: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + pagination: ::core::option::Option, + ) -> Result { + QuerySendEnabledRequest { denoms, pagination }.query(self.querier) + } } diff --git a/packages/provwasm-std/src/types/cosmos/base/abci/mod.rs b/packages/provwasm-std/src/types/cosmos/base/abci/mod.rs new file mode 100644 index 00000000..9f64fc82 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/base/abci/mod.rs @@ -0,0 +1 @@ +pub mod v1beta1; diff --git a/packages/provwasm-std/src/types/cosmos/base/abci/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/base/abci/v1beta1.rs new file mode 100644 index 00000000..6960f4db --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/base/abci/v1beta1.rs @@ -0,0 +1,390 @@ +use provwasm_proc_macro::CosmwasmExt; +/// TxResponse defines a structure containing relevant tx data and metadata. The +/// tags are stringified and the log is JSON decoded. +#[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.abci.v1beta1.TxResponse")] +pub struct TxResponse { + /// The block height + #[prost(int64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: i64, + /// The transaction hash. + #[prost(string, tag = "2")] + pub txhash: ::prost::alloc::string::String, + /// Namespace for the Code + #[prost(string, tag = "3")] + pub codespace: ::prost::alloc::string::String, + /// Response code. + #[prost(uint32, tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub code: u32, + /// Result bytes, if any. + #[prost(string, tag = "5")] + pub data: ::prost::alloc::string::String, + /// The output of the application's logger (raw string). May be + /// non-deterministic. + #[prost(string, tag = "6")] + pub raw_log: ::prost::alloc::string::String, + /// The output of the application's logger (typed). May be non-deterministic. + #[prost(message, repeated, tag = "7")] + pub logs: ::prost::alloc::vec::Vec, + /// Additional information. May be non-deterministic. + #[prost(string, tag = "8")] + pub info: ::prost::alloc::string::String, + /// Amount of gas requested for transaction. + #[prost(int64, tag = "9")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub gas_wanted: i64, + /// Amount of gas consumed by transaction. + #[prost(int64, tag = "10")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub gas_used: i64, + /// The request transaction bytes. + #[prost(message, optional, tag = "11")] + pub tx: ::core::option::Option, + /// Time of the previous block. For heights > 1, it's the weighted median of + /// the timestamps of the valid votes in the block.LastCommit. For height == 1, + /// it's genesis time. + #[prost(string, tag = "12")] + pub timestamp: ::prost::alloc::string::String, + /// Events defines all the events emitted by processing a transaction. Note, + /// these events include those emitted by processing all the messages and those + /// emitted from the ante. Whereas Logs contains the events, with + /// additional metadata, emitted only by processing the messages. + /// + /// Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 + #[prost(message, repeated, tag = "13")] + pub events: ::prost::alloc::vec::Vec, +} +/// ABCIMessageLog defines a structure containing an indexed tx ABCI message log. +#[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.abci.v1beta1.ABCIMessageLog")] +pub struct AbciMessageLog { + #[prost(uint32, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub msg_index: u32, + #[prost(string, tag = "2")] + pub log: ::prost::alloc::string::String, + /// Events contains a slice of Event objects that were emitted during some + /// execution. + #[prost(message, repeated, tag = "3")] + pub events: ::prost::alloc::vec::Vec, +} +/// StringEvent defines en Event object wrapper where all the attributes +/// contain key/value pairs that are strings instead of raw bytes. +#[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.abci.v1beta1.StringEvent")] +pub struct StringEvent { + #[prost(string, tag = "1")] + pub r#type: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] + pub attributes: ::prost::alloc::vec::Vec, +} +/// Attribute defines an attribute wrapper where the key and value are +/// strings instead of raw bytes. +#[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.abci.v1beta1.Attribute")] +pub struct Attribute { + #[prost(string, tag = "1")] + pub key: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub value: ::prost::alloc::string::String, +} +/// GasInfo defines tx execution gas 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.base.abci.v1beta1.GasInfo")] +pub struct GasInfo { + /// GasWanted is the maximum units of work we allow this tx to perform. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub gas_wanted: u64, + /// GasUsed is the amount of gas actually consumed. + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub gas_used: u64, +} +/// Result is the union of ResponseFormat and ResponseCheckTx. +#[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.abci.v1beta1.Result")] +pub struct Result { + /// Data is any data returned from message or handler execution. It MUST be + /// length prefixed in order to separate data from multiple message executions. + /// Deprecated. This field is still populated, but prefer msg_response instead + /// because it also contains the Msg response typeURL. + #[deprecated] + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, + /// Log contains the log information from message or handler execution. + #[prost(string, tag = "2")] + pub log: ::prost::alloc::string::String, + /// Events contains a slice of Event objects that were emitted during message + /// or handler execution. + #[prost(message, repeated, tag = "3")] + pub events: ::prost::alloc::vec::Vec, + /// msg_responses contains the Msg handler responses type packed in Anys. + /// + /// Since: cosmos-sdk 0.46 + #[prost(message, repeated, tag = "4")] + pub msg_responses: ::prost::alloc::vec::Vec, +} +/// SimulationResponse defines the response generated when a transaction is +/// successfully simulated. +#[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.abci.v1beta1.SimulationResponse")] +pub struct SimulationResponse { + #[prost(message, optional, tag = "1")] + pub gas_info: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub result: ::core::option::Option, +} +/// MsgData defines the data returned in a Result object during message +/// execution. +#[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.abci.v1beta1.MsgData")] +#[deprecated] +pub struct MsgData { + #[prost(string, tag = "1")] + pub msg_type: ::prost::alloc::string::String, + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, +} +/// TxMsgData defines a list of MsgData. A transaction will have a MsgData object +/// for each message. +#[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.abci.v1beta1.TxMsgData")] +pub struct TxMsgData { + /// data field is deprecated and not populated. + #[deprecated] + #[prost(message, repeated, tag = "1")] + pub data: ::prost::alloc::vec::Vec, + /// msg_responses contains the Msg handler responses packed into Anys. + /// + /// Since: cosmos-sdk 0.46 + #[prost(message, repeated, tag = "2")] + pub msg_responses: ::prost::alloc::vec::Vec, +} +/// SearchTxsResult defines a structure for querying txs pageable +#[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.abci.v1beta1.SearchTxsResult")] +pub struct SearchTxsResult { + /// Count of all txs + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub total_count: u64, + /// Count of txs in current page + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub count: u64, + /// Index of current page, start from 1 + #[prost(uint64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub page_number: u64, + /// Count of total pages + #[prost(uint64, tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub page_total: u64, + /// Max count txs per page + #[prost(uint64, tag = "5")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub limit: u64, + /// List of txs in current page + #[prost(message, repeated, tag = "6")] + pub txs: ::prost::alloc::vec::Vec, +} +/// SearchBlocksResult defines a structure for querying blocks pageable +#[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.abci.v1beta1.SearchBlocksResult")] +pub struct SearchBlocksResult { + /// Count of all blocks + #[prost(int64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub total_count: i64, + /// Count of blocks in current page + #[prost(int64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub count: i64, + /// Index of current page, start from 1 + #[prost(int64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub page_number: i64, + /// Count of total pages + #[prost(int64, tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub page_total: i64, + /// Max count blocks per page + #[prost(int64, tag = "5")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub limit: i64, + /// List of blocks in current page + #[prost(message, repeated, tag = "6")] + pub blocks: ::prost::alloc::vec::Vec, +} diff --git a/packages/provwasm-std/src/types/cosmos/base/mod.rs b/packages/provwasm-std/src/types/cosmos/base/mod.rs index 00d32dc4..ff4a21a7 100644 --- a/packages/provwasm-std/src/types/cosmos/base/mod.rs +++ b/packages/provwasm-std/src/types/cosmos/base/mod.rs @@ -1,2 +1,5 @@ +pub mod abci; +pub mod node; pub mod query; +pub mod tendermint; pub mod v1beta1; diff --git a/packages/provwasm-std/src/types/cosmos/base/node/mod.rs b/packages/provwasm-std/src/types/cosmos/base/node/mod.rs new file mode 100644 index 00000000..9f64fc82 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/base/node/mod.rs @@ -0,0 +1 @@ +pub mod v1beta1; diff --git a/packages/provwasm-std/src/types/cosmos/base/node/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/base/node/v1beta1.rs new file mode 100644 index 00000000..b56c31b2 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/base/node/v1beta1.rs @@ -0,0 +1,102 @@ +use provwasm_proc_macro::CosmwasmExt; +/// ConfigRequest defines the request structure for the Config gRPC query. +#[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.node.v1beta1.ConfigRequest")] +pub struct ConfigRequest {} +/// ConfigResponse defines the response structure for the Config gRPC query. +#[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.node.v1beta1.ConfigResponse")] +pub struct ConfigResponse { + #[prost(string, tag = "1")] + pub minimum_gas_price: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub pruning_keep_recent: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub pruning_interval: ::prost::alloc::string::String, + #[prost(uint64, tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub halt_height: u64, +} +/// StateRequest defines the request structure for the status of a node. +#[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.node.v1beta1.StatusRequest")] +pub struct StatusRequest {} +/// StateResponse defines the response structure for the status of a node. +#[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.node.v1beta1.StatusResponse")] +pub struct StatusResponse { + /// earliest block height available in the store + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub earliest_store_height: u64, + /// current block height + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: u64, + /// block height timestamp + #[prost(message, optional, tag = "3")] + pub timestamp: ::core::option::Option, + /// app hash of the current block + #[prost(bytes = "vec", tag = "4")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub app_hash: ::prost::alloc::vec::Vec, + /// validator hash provided by the consensus header + #[prost(bytes = "vec", tag = "5")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub validator_hash: ::prost::alloc::vec::Vec, +} diff --git a/packages/provwasm-std/src/types/cosmos/base/query/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/base/query/v1beta1.rs index 8c7f6aca..0c2adc34 100644 --- a/packages/provwasm-std/src/types/cosmos/base/query/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/base/query/v1beta1.rs @@ -1,4 +1,11 @@ use provwasm_proc_macro::CosmwasmExt; +/// PageRequest is to be embedded in gRPC request messages for efficient +/// pagination. Ex: +/// +/// message SomeRequest { +/// Foo some_parameter = 1; +/// PageRequest pagination = 2; +/// } #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -12,29 +19,51 @@ use provwasm_proc_macro::CosmwasmExt; )] #[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 + /// should be set. #[prost(bytes = "vec", tag = "1")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" )] pub key: ::prost::alloc::vec::Vec, + /// offset is a numeric offset that can be used when key is unavailable. + /// It is less efficient than using key. Only one of offset or key should + /// be set. #[prost(uint64, tag = "2")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub offset: u64, + /// limit is the total number of results to be returned in the result page. + /// If left empty it will default to a value to be set by each app. #[prost(uint64, tag = "3")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub limit: u64, + /// count_total is set to true to indicate that the result set should include + /// a count of the total number of items available for pagination in UIs. + /// count_total is only respected when offset is used. It is ignored when key + /// is set. #[prost(bool, tag = "4")] pub count_total: bool, + /// reverse is set to true if results are to be returned in the descending order. + /// + /// Since: cosmos-sdk 0.43 #[prost(bool, tag = "5")] pub reverse: bool, } +/// PageResponse is to be embedded in gRPC response messages where the +/// corresponding request message has used PageRequest. +/// +/// message SomeResponse { +/// repeated Bar results = 1; +/// PageResponse page = 2; +/// } #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -48,12 +77,17 @@ pub struct PageRequest { )] #[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 + /// there are no more results. #[prost(bytes = "vec", optional, tag = "1")] #[serde( serialize_with = "crate::serde::as_option_base64_encoded_string::serialize", deserialize_with = "crate::serde::as_option_base64_encoded_string::deserialize" )] pub next_key: ::core::option::Option<::prost::alloc::vec::Vec>, + /// total is total number of results available if PageRequest.count_total + /// was set, its value is undefined otherwise #[prost(uint64, tag = "2")] #[serde( serialize_with = "crate::serde::as_str::serialize", diff --git a/packages/provwasm-std/src/types/cosmos/base/tendermint/mod.rs b/packages/provwasm-std/src/types/cosmos/base/tendermint/mod.rs new file mode 100644 index 00000000..9f64fc82 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/base/tendermint/mod.rs @@ -0,0 +1 @@ +pub mod v1beta1; diff --git a/packages/provwasm-std/src/types/cosmos/base/tendermint/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/base/tendermint/v1beta1.rs new file mode 100644 index 00000000..687e31a3 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/base/tendermint/v1beta1.rs @@ -0,0 +1,595 @@ +use provwasm_proc_macro::CosmwasmExt; +/// Block is tendermint type Block, with the Header proposer address +/// field converted to bech32 string. +#[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.tendermint.v1beta1.Block")] +pub struct Block { + #[prost(message, optional, tag = "1")] + pub header: ::core::option::Option
, + #[prost(message, optional, tag = "2")] + pub data: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub evidence: + ::core::option::Option, + #[prost(message, optional, tag = "4")] + pub last_commit: ::core::option::Option, +} +/// Header defines the structure of a Tendermint block header. +#[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.tendermint.v1beta1.Header")] +pub struct Header { + /// basic block info + #[prost(message, optional, tag = "1")] + pub version: ::core::option::Option, + #[prost(string, tag = "2")] + pub chain_id: ::prost::alloc::string::String, + #[prost(int64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: i64, + #[prost(message, optional, tag = "4")] + pub time: ::core::option::Option, + /// prev block info + #[prost(message, optional, tag = "5")] + pub last_block_id: + ::core::option::Option, + /// hashes of block data + /// + /// commit from validators from the last block + #[prost(bytes = "vec", tag = "6")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub last_commit_hash: ::prost::alloc::vec::Vec, + /// transactions + #[prost(bytes = "vec", tag = "7")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub data_hash: ::prost::alloc::vec::Vec, + /// hashes from the app output from the prev block + /// + /// validators for the current block + #[prost(bytes = "vec", tag = "8")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub validators_hash: ::prost::alloc::vec::Vec, + /// validators for the next block + #[prost(bytes = "vec", tag = "9")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub next_validators_hash: ::prost::alloc::vec::Vec, + /// consensus params for current block + #[prost(bytes = "vec", tag = "10")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub consensus_hash: ::prost::alloc::vec::Vec, + /// state after txs from the previous block + #[prost(bytes = "vec", tag = "11")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub app_hash: ::prost::alloc::vec::Vec, + /// root hash of all results from the txs from the previous block + #[prost(bytes = "vec", tag = "12")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub last_results_hash: ::prost::alloc::vec::Vec, + /// consensus info + /// + /// evidence included in the block + #[prost(bytes = "vec", tag = "13")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub evidence_hash: ::prost::alloc::vec::Vec, + /// proposer_address is the original block proposer address, formatted as a Bech32 string. + /// In Tendermint, this type is `bytes`, but in the SDK, we convert it to a Bech32 string + /// for better UX. + /// + /// original proposer of the block + #[prost(string, tag = "14")] + pub proposer_address: ::prost::alloc::string::String, +} +/// GetValidatorSetByHeightRequest is the request type for the Query/GetValidatorSetByHeight 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.base.tendermint.v1beta1.GetValidatorSetByHeightRequest")] +pub struct GetValidatorSetByHeightRequest { + #[prost(int64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: i64, + /// pagination defines an pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// GetValidatorSetByHeightResponse is the response type for the Query/GetValidatorSetByHeight 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.base.tendermint.v1beta1.GetValidatorSetByHeightResponse")] +pub struct GetValidatorSetByHeightResponse { + #[prost(int64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub block_height: i64, + #[prost(message, repeated, tag = "2")] + pub validators: ::prost::alloc::vec::Vec, + /// pagination defines an pagination for the response. + #[prost(message, optional, tag = "3")] + pub pagination: ::core::option::Option, +} +/// GetLatestValidatorSetRequest is the request type for the Query/GetValidatorSetByHeight 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.base.tendermint.v1beta1.GetLatestValidatorSetRequest")] +pub struct GetLatestValidatorSetRequest { + /// pagination defines an pagination for the request. + #[prost(message, optional, tag = "1")] + pub pagination: ::core::option::Option, +} +/// GetLatestValidatorSetResponse is the response type for the Query/GetValidatorSetByHeight 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.base.tendermint.v1beta1.GetLatestValidatorSetResponse")] +pub struct GetLatestValidatorSetResponse { + #[prost(int64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub block_height: i64, + #[prost(message, repeated, tag = "2")] + pub validators: ::prost::alloc::vec::Vec, + /// pagination defines an pagination for the response. + #[prost(message, optional, tag = "3")] + pub pagination: ::core::option::Option, +} +/// Validator is the type for the validator-set. +#[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.tendermint.v1beta1.Validator")] +pub struct Validator { + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub pub_key: ::core::option::Option, + #[prost(int64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub voting_power: i64, + #[prost(int64, tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub proposer_priority: i64, +} +/// GetBlockByHeightRequest is the request type for the Query/GetBlockByHeight 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.base.tendermint.v1beta1.GetBlockByHeightRequest")] +pub struct GetBlockByHeightRequest { + #[prost(int64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: i64, +} +/// GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight 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.base.tendermint.v1beta1.GetBlockByHeightResponse")] +pub struct GetBlockByHeightResponse { + #[prost(message, optional, tag = "1")] + pub block_id: ::core::option::Option, + /// Deprecated: please use `sdk_block` instead + #[prost(message, optional, tag = "2")] + pub block: ::core::option::Option, + /// Since: cosmos-sdk 0.47 + #[prost(message, optional, tag = "3")] + pub sdk_block: ::core::option::Option, +} +/// GetLatestBlockRequest is the request type for the Query/GetLatestBlock 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.base.tendermint.v1beta1.GetLatestBlockRequest")] +pub struct GetLatestBlockRequest {} +/// GetLatestBlockResponse is the response type for the Query/GetLatestBlock 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.base.tendermint.v1beta1.GetLatestBlockResponse")] +pub struct GetLatestBlockResponse { + #[prost(message, optional, tag = "1")] + pub block_id: ::core::option::Option, + /// Deprecated: please use `sdk_block` instead + #[prost(message, optional, tag = "2")] + pub block: ::core::option::Option, + /// Since: cosmos-sdk 0.47 + #[prost(message, optional, tag = "3")] + pub sdk_block: ::core::option::Option, +} +/// GetSyncingRequest is the request type for the Query/GetSyncing 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.base.tendermint.v1beta1.GetSyncingRequest")] +pub struct GetSyncingRequest {} +/// GetSyncingResponse is the response type for the Query/GetSyncing 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.base.tendermint.v1beta1.GetSyncingResponse")] +pub struct GetSyncingResponse { + #[prost(bool, tag = "1")] + pub syncing: bool, +} +/// GetNodeInfoRequest is the request type for the Query/GetNodeInfo 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.base.tendermint.v1beta1.GetNodeInfoRequest")] +pub struct GetNodeInfoRequest {} +/// GetNodeInfoResponse is the response type for the Query/GetNodeInfo 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.base.tendermint.v1beta1.GetNodeInfoResponse")] +pub struct GetNodeInfoResponse { + #[prost(message, optional, tag = "1")] + pub default_node_info: + ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub application_version: ::core::option::Option, +} +/// VersionInfo is the type for the GetNodeInfoResponse message. +#[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.tendermint.v1beta1.VersionInfo")] +pub struct VersionInfo { + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub app_name: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub version: ::prost::alloc::string::String, + #[prost(string, tag = "4")] + pub git_commit: ::prost::alloc::string::String, + #[prost(string, tag = "5")] + pub build_tags: ::prost::alloc::string::String, + #[prost(string, tag = "6")] + pub go_version: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "7")] + pub build_deps: ::prost::alloc::vec::Vec, + /// Since: cosmos-sdk 0.43 + #[prost(string, tag = "8")] + pub cosmos_sdk_version: ::prost::alloc::string::String, +} +/// Module is the type for VersionInfo +#[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.tendermint.v1beta1.Module")] +pub struct Module { + /// module path + #[prost(string, tag = "1")] + pub path: ::prost::alloc::string::String, + /// module version + #[prost(string, tag = "2")] + pub version: ::prost::alloc::string::String, + /// checksum + #[prost(string, tag = "3")] + pub sum: ::prost::alloc::string::String, +} +/// ABCIQueryRequest defines the request structure for the ABCIQuery gRPC query. +#[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.tendermint.v1beta1.ABCIQueryRequest")] +pub struct AbciQueryRequest { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, + #[prost(string, tag = "2")] + pub path: ::prost::alloc::string::String, + #[prost(int64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: i64, + #[prost(bool, tag = "4")] + pub prove: bool, +} +/// ABCIQueryResponse defines the response structure for the ABCIQuery gRPC query. +/// +/// Note: This type is a duplicate of the ResponseQuery proto type defined in +/// Tendermint. +#[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.tendermint.v1beta1.ABCIQueryResponse")] +pub struct AbciQueryResponse { + #[prost(uint32, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub code: u32, + /// nondeterministic + #[prost(string, tag = "3")] + pub log: ::prost::alloc::string::String, + /// nondeterministic + #[prost(string, tag = "4")] + pub info: ::prost::alloc::string::String, + #[prost(int64, tag = "5")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub index: i64, + #[prost(bytes = "vec", tag = "6")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub key: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "7")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub value: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "8")] + pub proof_ops: ::core::option::Option, + #[prost(int64, tag = "9")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: i64, + #[prost(string, tag = "10")] + pub codespace: ::prost::alloc::string::String, +} +/// ProofOp defines an operation used for calculating Merkle root. The data could +/// be arbitrary format, providing necessary data for example neighbouring node +/// hash. +/// +/// Note: This type is a duplicate of the ProofOp proto type defined in Tendermint. +#[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.tendermint.v1beta1.ProofOp")] +pub struct ProofOp { + #[prost(string, tag = "1")] + pub r#type: ::prost::alloc::string::String, + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub key: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "3")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, +} +/// ProofOps is Merkle proof defined by the list of ProofOps. +/// +/// Note: This type is a duplicate of the ProofOps proto type defined in Tendermint. +#[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.tendermint.v1beta1.ProofOps")] +pub struct ProofOps { + #[prost(message, repeated, tag = "1")] + pub ops: ::prost::alloc::vec::Vec, +} diff --git a/packages/provwasm-std/src/types/cosmos/base/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/base/v1beta1.rs index 03c32968..d15a2f09 100644 --- a/packages/provwasm-std/src/types/cosmos/base/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/base/v1beta1.rs @@ -1,4 +1,8 @@ use provwasm_proc_macro::CosmwasmExt; +/// Coin defines a token with a denomination and an amount. +/// +/// NOTE: The amount field is an Int which implements the custom method +/// signatures required by gogoproto. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -17,6 +21,10 @@ pub struct Coin { #[prost(string, tag = "2")] pub amount: ::prost::alloc::string::String, } +/// DecCoin defines a token with a denomination and a decimal amount. +/// +/// NOTE: The amount field is an Dec which implements the custom method +/// signatures required by gogoproto. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -35,6 +43,8 @@ pub struct DecCoin { #[prost(string, tag = "2")] pub amount: ::prost::alloc::string::String, } +/// IntProto defines a Protobuf wrapper around an Int object. +/// Deprecated: Prefer to use math.Int directly. It supports binary Marshal and Unmarshal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -51,6 +61,8 @@ pub struct IntProto { #[prost(string, tag = "1")] pub int: ::prost::alloc::string::String, } +/// DecProto defines a Protobuf wrapper around a Dec object. +/// Deprecated: Prefer to use math.LegacyDec directly. It supports binary Marshal and Unmarshal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, diff --git a/packages/provwasm-std/src/types/cosmos/circuit/mod.rs b/packages/provwasm-std/src/types/cosmos/circuit/mod.rs new file mode 100644 index 00000000..a8429e39 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/circuit/mod.rs @@ -0,0 +1,2 @@ +pub mod module; +pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/circuit/module/mod.rs b/packages/provwasm-std/src/types/cosmos/circuit/module/mod.rs new file mode 100644 index 00000000..a3a6d96c --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/circuit/module/mod.rs @@ -0,0 +1 @@ +pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/circuit/module/v1.rs b/packages/provwasm-std/src/types/cosmos/circuit/module/v1.rs new file mode 100644 index 00000000..00ad8a09 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/circuit/module/v1.rs @@ -0,0 +1,19 @@ +use provwasm_proc_macro::CosmwasmExt; +/// Module is the config object of the circuit 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.circuit.module.v1.Module")] +pub struct Module { + /// authority defines the custom module authority. If not set, defaults to the governance module. + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, +} diff --git a/packages/provwasm-std/src/types/cosmos/circuit/v1.rs b/packages/provwasm-std/src/types/cosmos/circuit/v1.rs new file mode 100644 index 00000000..b7350ef3 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/circuit/v1.rs @@ -0,0 +1,379 @@ +use provwasm_proc_macro::CosmwasmExt; +/// Permissions are the permissions that an account has to trip +/// or reset the circuit breaker. +#[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.circuit.v1.Permissions")] +pub struct Permissions { + /// level is the level of permissions granted to this account. + #[prost(enumeration = "permissions::Level", tag = "1")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub level: i32, + /// limit_type_urls is used with LEVEL_SOME_MSGS to limit the lists of Msg type + /// URLs that the account can trip. It is an error to use limit_type_urls with + /// a level other than LEVEL_SOME_MSGS. + #[prost(string, repeated, tag = "2")] + pub limit_type_urls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// Nested message and enum types in `Permissions`. +pub mod permissions { + use provwasm_proc_macro::CosmwasmExt; + /// Level is the permission level. + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] + #[repr(i32)] + #[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] + pub enum Level { + /// LEVEL_NONE_UNSPECIFIED indicates that the account will have no circuit + /// breaker permissions. + NoneUnspecified = 0, + /// LEVEL_SOME_MSGS indicates that the account will have permission to + /// trip or reset the circuit breaker for some Msg type URLs. If this level + /// is chosen, a non-empty list of Msg type URLs must be provided in + /// limit_type_urls. + SomeMsgs = 1, + /// LEVEL_ALL_MSGS indicates that the account can trip or reset the circuit + /// breaker for Msg's of all type URLs. + AllMsgs = 2, + /// LEVEL_SUPER_ADMIN indicates that the account can take all circuit breaker + /// actions and can grant permissions to other accounts. + SuperAdmin = 3, + } + impl Level { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Level::NoneUnspecified => "LEVEL_NONE_UNSPECIFIED", + Level::SomeMsgs => "LEVEL_SOME_MSGS", + Level::AllMsgs => "LEVEL_ALL_MSGS", + Level::SuperAdmin => "LEVEL_SUPER_ADMIN", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "LEVEL_NONE_UNSPECIFIED" => Some(Self::NoneUnspecified), + "LEVEL_SOME_MSGS" => Some(Self::SomeMsgs), + "LEVEL_ALL_MSGS" => Some(Self::AllMsgs), + "LEVEL_SUPER_ADMIN" => Some(Self::SuperAdmin), + _ => None, + } + } + } +} +/// GenesisAccountPermissions is the account permissions for the circuit breaker in genesis +#[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.circuit.v1.GenesisAccountPermissions")] +pub struct GenesisAccountPermissions { + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub permissions: ::core::option::Option, +} +/// GenesisState is the state that must be provided at genesis. +#[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.circuit.v1.GenesisState")] +pub struct GenesisState { + #[prost(message, repeated, tag = "1")] + pub account_permissions: ::prost::alloc::vec::Vec, + #[prost(string, repeated, tag = "2")] + pub disabled_type_urls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// QueryAccountRequest is the request type for the Query/Account 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.circuit.v1.QueryAccountRequest")] +#[proto_query( + path = "/cosmos.circuit.v1.Query/Account", + response_type = AccountResponse +)] +pub struct QueryAccountRequest { + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, +} +/// AccountResponse is the response type for the Query/Account 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.circuit.v1.AccountResponse")] +pub struct AccountResponse { + #[prost(message, optional, tag = "1")] + pub permission: ::core::option::Option, +} +/// QueryAccountsRequest is the request type for the Query/Accounts 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.circuit.v1.QueryAccountsRequest")] +#[proto_query( + path = "/cosmos.circuit.v1.Query/Accounts", + response_type = AccountsResponse +)] +pub struct QueryAccountsRequest { + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "1")] + pub pagination: ::core::option::Option, +} +/// AccountsResponse is the response type for the Query/Accounts 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.circuit.v1.AccountsResponse")] +pub struct AccountsResponse { + #[prost(message, repeated, tag = "1")] + pub accounts: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryDisableListRequest is the request type for the Query/DisabledList 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.circuit.v1.QueryDisabledListRequest")] +#[proto_query( + path = "/cosmos.circuit.v1.Query/DisabledList", + response_type = DisabledListResponse +)] +pub struct QueryDisabledListRequest {} +/// DisabledListResponse is the response type for the Query/DisabledList 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.circuit.v1.DisabledListResponse")] +pub struct DisabledListResponse { + #[prost(string, repeated, tag = "1")] + pub disabled_list: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// MsgAuthorizeCircuitBreaker defines the Msg/AuthorizeCircuitBreaker request 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.circuit.v1.MsgAuthorizeCircuitBreaker")] +pub struct MsgAuthorizeCircuitBreaker { + /// granter is the granter of the circuit breaker permissions and must have + /// LEVEL_SUPER_ADMIN. + #[prost(string, tag = "1")] + pub granter: ::prost::alloc::string::String, + /// grantee is the account authorized with the provided permissions. + #[prost(string, tag = "2")] + pub grantee: ::prost::alloc::string::String, + /// permissions are the circuit breaker permissions that the grantee receives. + /// These will overwrite any existing permissions. LEVEL_NONE_UNSPECIFIED can + /// be specified to revoke all permissions. + #[prost(message, optional, tag = "3")] + pub permissions: ::core::option::Option, +} +/// MsgAuthorizeCircuitBreakerResponse defines the Msg/AuthorizeCircuitBreaker 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.circuit.v1.MsgAuthorizeCircuitBreakerResponse")] +pub struct MsgAuthorizeCircuitBreakerResponse { + #[prost(bool, tag = "1")] + pub success: bool, +} +/// MsgTripCircuitBreaker defines the Msg/TripCircuitBreaker request 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.circuit.v1.MsgTripCircuitBreaker")] +pub struct MsgTripCircuitBreaker { + /// authority is the account authorized to trip the circuit breaker. + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// msg_type_urls specifies a list of type URLs to immediately stop processing. + /// IF IT IS LEFT EMPTY, ALL MSG PROCESSING WILL STOP IMMEDIATELY. + /// This value is validated against the authority's permissions and if the + /// authority does not have permissions to trip the specified msg type URLs + /// (or all URLs), the operation will fail. + #[prost(string, repeated, tag = "2")] + pub msg_type_urls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// MsgTripCircuitBreakerResponse defines the Msg/TripCircuitBreaker 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.circuit.v1.MsgTripCircuitBreakerResponse")] +pub struct MsgTripCircuitBreakerResponse { + #[prost(bool, tag = "1")] + pub success: bool, +} +/// MsgResetCircuitBreaker defines the Msg/ResetCircuitBreaker request 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.circuit.v1.MsgResetCircuitBreaker")] +pub struct MsgResetCircuitBreaker { + /// authority is the account authorized to trip or reset the circuit breaker. + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// msg_type_urls specifies a list of Msg type URLs to resume processing. If + /// it is left empty all Msg processing for type URLs that the account is + /// authorized to trip will resume. + #[prost(string, repeated, tag = "3")] + pub msg_type_urls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// MsgResetCircuitBreakerResponse defines the Msg/ResetCircuitBreaker 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.circuit.v1.MsgResetCircuitBreakerResponse")] +pub struct MsgResetCircuitBreakerResponse { + #[prost(bool, tag = "1")] + pub success: bool, +} +pub struct CircuitQuerier<'a, Q: cosmwasm_std::CustomQuery> { + querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, +} +impl<'a, Q: cosmwasm_std::CustomQuery> CircuitQuerier<'a, Q> { + pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self { + Self { querier } + } + pub fn account( + &self, + address: ::prost::alloc::string::String, + ) -> Result { + QueryAccountRequest { address }.query(self.querier) + } + pub fn accounts( + &self, + pagination: ::core::option::Option, + ) -> Result { + QueryAccountsRequest { pagination }.query(self.querier) + } + pub fn disabled_list(&self) -> Result { + QueryDisabledListRequest {}.query(self.querier) + } +} diff --git a/packages/provwasm-std/src/types/cosmos/consensus/mod.rs b/packages/provwasm-std/src/types/cosmos/consensus/mod.rs new file mode 100644 index 00000000..a8429e39 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/consensus/mod.rs @@ -0,0 +1,2 @@ +pub mod module; +pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/consensus/module/mod.rs b/packages/provwasm-std/src/types/cosmos/consensus/module/mod.rs new file mode 100644 index 00000000..a3a6d96c --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/consensus/module/mod.rs @@ -0,0 +1 @@ +pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/consensus/module/v1.rs b/packages/provwasm-std/src/types/cosmos/consensus/module/v1.rs new file mode 100644 index 00000000..89f83540 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/consensus/module/v1.rs @@ -0,0 +1,19 @@ +use provwasm_proc_macro::CosmwasmExt; +/// Module is the config object of the consensus 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.consensus.module.v1.Module")] +pub struct Module { + /// authority defines the custom module authority. If not set, defaults to the governance module. + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, +} diff --git a/packages/provwasm-std/src/types/cosmos/consensus/v1.rs b/packages/provwasm-std/src/types/cosmos/consensus/v1.rs new file mode 100644 index 00000000..1f582d29 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/consensus/v1.rs @@ -0,0 +1,97 @@ +use provwasm_proc_macro::CosmwasmExt; +/// QueryParamsRequest defines the request type for querying x/consensus parameters. +#[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.consensus.v1.QueryParamsRequest")] +#[proto_query( + path = "/cosmos.consensus.v1.Query/Params", + response_type = QueryParamsResponse +)] +pub struct QueryParamsRequest {} +/// QueryParamsResponse defines the response type for querying x/consensus parameters. +#[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.consensus.v1.QueryParamsResponse")] +pub struct QueryParamsResponse { + /// params are the tendermint consensus params stored in the consensus module. + /// Please note that `params.version` is not populated in this response, it is + /// tracked separately in the x/upgrade module. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} +/// MsgUpdateParams is the Msg/UpdateParams request 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.consensus.v1.MsgUpdateParams")] +pub struct MsgUpdateParams { + /// authority is the address that controls the module (defaults to x/gov unless overwritten). + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// params defines the x/consensus parameters to update. + /// VersionsParams is not included in this Msg because it is tracked + /// separarately in x/upgrade. + /// + /// NOTE: All parameters must be supplied. + #[prost(message, optional, tag = "2")] + pub block: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub evidence: ::core::option::Option, + #[prost(message, optional, tag = "4")] + pub validator: ::core::option::Option, + /// Since: cosmos-sdk 0.50 + #[prost(message, optional, tag = "5")] + pub abci: ::core::option::Option, +} +/// MsgUpdateParamsResponse defines the response structure for executing a +/// MsgUpdateParams message. +#[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.consensus.v1.MsgUpdateParamsResponse")] +pub struct MsgUpdateParamsResponse {} +pub struct ConsensusQuerier<'a, Q: cosmwasm_std::CustomQuery> { + querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, +} +impl<'a, Q: cosmwasm_std::CustomQuery> ConsensusQuerier<'a, Q> { + pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self { + Self { querier } + } + pub fn params(&self) -> Result { + QueryParamsRequest {}.query(self.querier) + } +} diff --git a/packages/provwasm-std/src/types/cosmos/crisis/mod.rs b/packages/provwasm-std/src/types/cosmos/crisis/mod.rs new file mode 100644 index 00000000..537a3360 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/crisis/mod.rs @@ -0,0 +1,2 @@ +pub mod module; +pub mod v1beta1; diff --git a/packages/provwasm-std/src/types/cosmos/crisis/module/mod.rs b/packages/provwasm-std/src/types/cosmos/crisis/module/mod.rs new file mode 100644 index 00000000..a3a6d96c --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/crisis/module/mod.rs @@ -0,0 +1 @@ +pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/crisis/module/v1.rs b/packages/provwasm-std/src/types/cosmos/crisis/module/v1.rs new file mode 100644 index 00000000..08140687 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/crisis/module/v1.rs @@ -0,0 +1,22 @@ +use provwasm_proc_macro::CosmwasmExt; +/// Module is the config object of the crisis 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.crisis.module.v1.Module")] +pub struct Module { + /// fee_collector_name is the name of the FeeCollector ModuleAccount. + #[prost(string, tag = "1")] + pub fee_collector_name: ::prost::alloc::string::String, + /// authority defines the custom module authority. If not set, defaults to the governance module. + #[prost(string, tag = "2")] + pub authority: ::prost::alloc::string::String, +} diff --git a/packages/provwasm-std/src/types/cosmos/crisis/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/crisis/v1beta1.rs new file mode 100644 index 00000000..bce1f55b --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/crisis/v1beta1.rs @@ -0,0 +1,98 @@ +use provwasm_proc_macro::CosmwasmExt; +/// GenesisState defines the crisis module's genesis state. +#[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.crisis.v1beta1.GenesisState")] +pub struct GenesisState { + /// constant_fee is the fee used to verify the invariant in the crisis + /// module. + #[prost(message, optional, tag = "3")] + pub constant_fee: ::core::option::Option, +} +/// MsgVerifyInvariant represents a message to verify a particular invariance. +#[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.crisis.v1beta1.MsgVerifyInvariant")] +pub struct MsgVerifyInvariant { + /// sender is the account address of private key to send coins to fee collector account. + #[prost(string, tag = "1")] + pub sender: ::prost::alloc::string::String, + /// name of the invariant module. + #[prost(string, tag = "2")] + pub invariant_module_name: ::prost::alloc::string::String, + /// invariant_route is the msg's invariant route. + #[prost(string, tag = "3")] + pub invariant_route: ::prost::alloc::string::String, +} +/// MsgVerifyInvariantResponse defines the Msg/VerifyInvariant 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.crisis.v1beta1.MsgVerifyInvariantResponse")] +pub struct MsgVerifyInvariantResponse {} +/// MsgUpdateParams is the Msg/UpdateParams request type. +/// +/// Since: cosmos-sdk 0.47 +#[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.crisis.v1beta1.MsgUpdateParams")] +pub struct MsgUpdateParams { + /// authority is the address that controls the module (defaults to x/gov unless overwritten). + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// constant_fee defines the x/crisis parameter. + #[prost(message, optional, tag = "2")] + pub constant_fee: ::core::option::Option, +} +/// MsgUpdateParamsResponse defines the response structure for executing a +/// MsgUpdateParams message. +/// +/// Since: cosmos-sdk 0.47 +#[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.crisis.v1beta1.MsgUpdateParamsResponse")] +pub struct MsgUpdateParamsResponse {} diff --git a/packages/provwasm-std/src/types/cosmos/crypto/ed25519.rs b/packages/provwasm-std/src/types/cosmos/crypto/ed25519.rs index 8459af8f..92643288 100644 --- a/packages/provwasm-std/src/types/cosmos/crypto/ed25519.rs +++ b/packages/provwasm-std/src/types/cosmos/crypto/ed25519.rs @@ -1,4 +1,9 @@ use provwasm_proc_macro::CosmwasmExt; +/// PubKey is an ed25519 public key for handling Tendermint keys in SDK. +/// It's needed for Any serialization and SDK compatibility. +/// It must not be used in a non Tendermint key context because it doesn't implement +/// ADR-28. Nevertheless, you will like to use ed25519 in app user level +/// then you must create a new proto message and follow ADR-28 for Address construction. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -19,6 +24,8 @@ pub struct PubKey { )] pub key: ::prost::alloc::vec::Vec, } +/// PrivKey defines a ed25519 private key. +/// NOTE: ed25519 keys must not be used in SDK apps except in a tendermint validator context. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, diff --git a/packages/provwasm-std/src/types/cosmos/crypto/hd/mod.rs b/packages/provwasm-std/src/types/cosmos/crypto/hd/mod.rs new file mode 100644 index 00000000..a3a6d96c --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/crypto/hd/mod.rs @@ -0,0 +1 @@ +pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/crypto/hd/v1.rs b/packages/provwasm-std/src/types/cosmos/crypto/hd/v1.rs new file mode 100644 index 00000000..d3067525 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/crypto/hd/v1.rs @@ -0,0 +1,48 @@ +use provwasm_proc_macro::CosmwasmExt; +/// BIP44Params is used as path field in ledger item in Record. +#[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.crypto.hd.v1.BIP44Params")] +pub struct Bip44Params { + /// purpose is a constant set to 44' (or 0x8000002C) following the BIP43 recommendation + #[prost(uint32, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub purpose: u32, + /// coin_type is a constant that improves privacy + #[prost(uint32, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub coin_type: u32, + /// account splits the key space into independent user identities + #[prost(uint32, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub account: u32, + /// change is a constant used for public derivation. Constant 0 is used for external chain and constant 1 for internal + /// chain. + #[prost(bool, tag = "4")] + pub change: bool, + /// address_index is used as child index in BIP32 derivation + #[prost(uint32, tag = "5")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub address_index: u32, +} diff --git a/packages/provwasm-std/src/types/cosmos/crypto/keyring/mod.rs b/packages/provwasm-std/src/types/cosmos/crypto/keyring/mod.rs new file mode 100644 index 00000000..a3a6d96c --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/crypto/keyring/mod.rs @@ -0,0 +1 @@ +pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/crypto/keyring/v1.rs b/packages/provwasm-std/src/types/cosmos/crypto/keyring/v1.rs new file mode 100644 index 00000000..0b3eed28 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/crypto/keyring/v1.rs @@ -0,0 +1,117 @@ +use provwasm_proc_macro::CosmwasmExt; +/// Record is used for representing a key in the keyring. +#[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.crypto.keyring.v1.Record")] +pub struct Record { + /// name represents a name of Record + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + /// pub_key represents a public key in any format + #[prost(message, optional, tag = "2")] + pub pub_key: ::core::option::Option, + /// Record contains one of the following items + #[prost(oneof = "record::Item", tags = "3, 4, 5, 6")] + pub item: ::core::option::Option, +} +/// Nested message and enum types in `Record`. +pub mod record { + use provwasm_proc_macro::CosmwasmExt; + /// Item is a keyring item stored in a keyring backend. + /// Local item + #[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.crypto.keyring.v1.Record.Local")] + pub struct Local { + #[prost(message, optional, tag = "1")] + pub priv_key: ::core::option::Option, + } + /// Ledger item + #[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.crypto.keyring.v1.Record.Ledger")] + pub struct Ledger { + #[prost(message, optional, tag = "1")] + pub path: ::core::option::Option, + } + /// Multi item + #[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.crypto.keyring.v1.Record.Multi")] + pub struct Multi {} + /// Offline item + #[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.crypto.keyring.v1.Record.Offline")] + pub struct Offline {} + /// Record contains one of the following items + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive( + Clone, + PartialEq, + Eq, + ::prost::Oneof, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + )] + pub enum Item { + /// local stores the private key locally. + #[prost(message, tag = "3")] + Local(Local), + /// ledger stores the information about a Ledger key. + #[prost(message, tag = "4")] + Ledger(Ledger), + /// Multi does not store any other information. + #[prost(message, tag = "5")] + Multi(Multi), + /// Offline does not store any other information. + #[prost(message, tag = "6")] + Offline(Offline), + } +} diff --git a/packages/provwasm-std/src/types/cosmos/crypto/mod.rs b/packages/provwasm-std/src/types/cosmos/crypto/mod.rs index 2087b7c9..a243ceb7 100644 --- a/packages/provwasm-std/src/types/cosmos/crypto/mod.rs +++ b/packages/provwasm-std/src/types/cosmos/crypto/mod.rs @@ -1,4 +1,6 @@ pub mod ed25519; +pub mod hd; +pub mod keyring; pub mod multisig; pub mod secp256k1; pub mod secp256r1; diff --git a/packages/provwasm-std/src/types/cosmos/crypto/multisig/mod.rs b/packages/provwasm-std/src/types/cosmos/crypto/multisig/mod.rs index 9f64fc82..39d1a62c 100644 --- a/packages/provwasm-std/src/types/cosmos/crypto/multisig/mod.rs +++ b/packages/provwasm-std/src/types/cosmos/crypto/multisig/mod.rs @@ -1 +1,27 @@ pub mod v1beta1; +use provwasm_proc_macro::CosmwasmExt; +/// LegacyAminoPubKey specifies a public key type +/// which nests multiple public keys and a threshold, +/// it uses legacy amino address rules. +#[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.crypto.multisig.LegacyAminoPubKey")] +pub struct LegacyAminoPubKey { + #[prost(uint32, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub threshold: u32, + #[prost(message, repeated, tag = "2")] + pub public_keys: ::prost::alloc::vec::Vec, +} diff --git a/packages/provwasm-std/src/types/cosmos/crypto/multisig/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/crypto/multisig/v1beta1.rs index f2f01a1b..70626b4e 100644 --- a/packages/provwasm-std/src/types/cosmos/crypto/multisig/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/crypto/multisig/v1beta1.rs @@ -1,4 +1,7 @@ use provwasm_proc_macro::CosmwasmExt; +/// MultiSignature wraps the signatures from a multisig.LegacyAminoPubKey. +/// See cosmos.tx.v1betata1.ModeInfo.Multi for how to specify which signers +/// signed and with which modes. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -15,6 +18,10 @@ pub struct MultiSignature { #[prost(bytes = "vec", repeated, tag = "1")] pub signatures: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, } +/// CompactBitArray is an implementation of a space efficient bit array. +/// This is used to ensure that the encoded data takes up a minimal amount of +/// space after proto encoding. +/// This is not thread safe, and is not intended for concurrent usage. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, diff --git a/packages/provwasm-std/src/types/cosmos/crypto/secp256k1.rs b/packages/provwasm-std/src/types/cosmos/crypto/secp256k1.rs index 12deb826..6f462712 100644 --- a/packages/provwasm-std/src/types/cosmos/crypto/secp256k1.rs +++ b/packages/provwasm-std/src/types/cosmos/crypto/secp256k1.rs @@ -1,4 +1,9 @@ use provwasm_proc_macro::CosmwasmExt; +/// PubKey defines a secp256k1 public key +/// Key is the compressed form of the pubkey. The first byte depends is a 0x02 byte +/// if the y-coordinate is the lexicographically largest of the two associated with +/// the x-coordinate. Otherwise the first byte is a 0x03. +/// This prefix is followed with the x-coordinate. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -19,6 +24,7 @@ pub struct PubKey { )] pub key: ::prost::alloc::vec::Vec, } +/// PrivKey defines a secp256k1 private key. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, diff --git a/packages/provwasm-std/src/types/cosmos/crypto/secp256r1.rs b/packages/provwasm-std/src/types/cosmos/crypto/secp256r1.rs index eca8037c..ddd5dc35 100644 --- a/packages/provwasm-std/src/types/cosmos/crypto/secp256r1.rs +++ b/packages/provwasm-std/src/types/cosmos/crypto/secp256r1.rs @@ -1,4 +1,5 @@ use provwasm_proc_macro::CosmwasmExt; +/// PubKey defines a secp256r1 ECDSA public key. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -12,6 +13,8 @@ use provwasm_proc_macro::CosmwasmExt; )] #[proto_message(type_url = "/cosmos.crypto.secp256r1.PubKey")] pub struct PubKey { + /// Point on secp256r1 curve in a compressed representation as specified in section + /// 4.3.6 of ANSI X9.62: #[prost(bytes = "vec", tag = "1")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", @@ -19,6 +22,7 @@ pub struct PubKey { )] pub key: ::prost::alloc::vec::Vec, } +/// PrivKey defines a secp256r1 ECDSA private key. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -32,6 +36,7 @@ pub struct PubKey { )] #[proto_message(type_url = "/cosmos.crypto.secp256r1.PrivKey")] pub struct PrivKey { + /// secret number serialized using big-endian encoding #[prost(bytes = "vec", tag = "1")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", diff --git a/packages/provwasm-std/src/types/cosmos/distribution/mod.rs b/packages/provwasm-std/src/types/cosmos/distribution/mod.rs index 9f64fc82..537a3360 100644 --- a/packages/provwasm-std/src/types/cosmos/distribution/mod.rs +++ b/packages/provwasm-std/src/types/cosmos/distribution/mod.rs @@ -1 +1,2 @@ +pub mod module; pub mod v1beta1; diff --git a/packages/provwasm-std/src/types/cosmos/distribution/module/mod.rs b/packages/provwasm-std/src/types/cosmos/distribution/module/mod.rs new file mode 100644 index 00000000..a3a6d96c --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/distribution/module/mod.rs @@ -0,0 +1 @@ +pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/distribution/module/v1.rs b/packages/provwasm-std/src/types/cosmos/distribution/module/v1.rs new file mode 100644 index 00000000..70f1cf29 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/distribution/module/v1.rs @@ -0,0 +1,21 @@ +use provwasm_proc_macro::CosmwasmExt; +/// Module is the config object of the distribution 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.distribution.module.v1.Module")] +pub struct Module { + #[prost(string, tag = "1")] + pub fee_collector_name: ::prost::alloc::string::String, + /// authority defines the custom module authority. If not set, defaults to the governance module. + #[prost(string, tag = "2")] + pub authority: ::prost::alloc::string::String, +} diff --git a/packages/provwasm-std/src/types/cosmos/distribution/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/distribution/v1beta1.rs index 1d6d830f..29fdedd9 100644 --- a/packages/provwasm-std/src/types/cosmos/distribution/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/distribution/v1beta1.rs @@ -1,4 +1,5 @@ use provwasm_proc_macro::CosmwasmExt; +/// Params defines the set of params for the distribution module. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -14,13 +15,80 @@ use provwasm_proc_macro::CosmwasmExt; pub struct Params { #[prost(string, tag = "1")] pub community_tax: ::prost::alloc::string::String, + /// Deprecated: The base_proposer_reward field is deprecated and is no longer used + /// in the x/distribution module's reward mechanism. + #[deprecated] #[prost(string, tag = "2")] pub base_proposer_reward: ::prost::alloc::string::String, + /// Deprecated: The bonus_proposer_reward field is deprecated and is no longer used + /// in the x/distribution module's reward mechanism. + #[deprecated] #[prost(string, tag = "3")] pub bonus_proposer_reward: ::prost::alloc::string::String, #[prost(bool, tag = "4")] pub withdraw_addr_enabled: bool, } +/// ValidatorHistoricalRewards represents historical rewards for a validator. +/// Height is implicit within the store key. +/// Cumulative reward ratio is the sum from the zeroeth period +/// until this period of rewards / tokens, per the spec. +/// The reference count indicates the number of objects +/// which might need to reference this historical entry at any point. +/// ReferenceCount = +/// number of outstanding delegations which ended the associated period (and +/// might need to read that record) +/// + number of slashes which ended the associated period (and might need to +/// read that record) +/// + one per validator for the zeroeth period, set on initialization +#[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.distribution.v1beta1.ValidatorHistoricalRewards")] +pub struct ValidatorHistoricalRewards { + #[prost(message, repeated, tag = "1")] + pub cumulative_reward_ratio: ::prost::alloc::vec::Vec, + #[prost(uint32, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub reference_count: u32, +} +/// ValidatorCurrentRewards represents current rewards and current +/// period for a validator kept as a running counter and incremented +/// each block as long as the validator's tokens remain constant. +#[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.distribution.v1beta1.ValidatorCurrentRewards")] +pub struct ValidatorCurrentRewards { + #[prost(message, repeated, tag = "1")] + pub rewards: ::prost::alloc::vec::Vec, + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub period: u64, +} +/// ValidatorAccumulatedCommission represents accumulated commission +/// for a validator kept as a running counter, can be withdrawn at any time. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -35,8 +103,692 @@ pub struct Params { #[proto_message(type_url = "/cosmos.distribution.v1beta1.ValidatorAccumulatedCommission")] pub struct ValidatorAccumulatedCommission { #[prost(message, repeated, tag = "1")] - pub commission: ::prost::alloc::vec::Vec, + pub commission: ::prost::alloc::vec::Vec, +} +/// ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards +/// for a validator inexpensive to track, allows simple sanity checks. +#[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.distribution.v1beta1.ValidatorOutstandingRewards")] +pub struct ValidatorOutstandingRewards { + #[prost(message, repeated, tag = "1")] + pub rewards: ::prost::alloc::vec::Vec, +} +/// ValidatorSlashEvent represents a validator slash event. +/// Height is implicit within the store key. +/// This is needed to calculate appropriate amount of staking tokens +/// for delegations which are withdrawn after a slash has occurred. +#[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.distribution.v1beta1.ValidatorSlashEvent")] +pub struct ValidatorSlashEvent { + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub validator_period: u64, + #[prost(string, tag = "2")] + pub fraction: ::prost::alloc::string::String, +} +/// ValidatorSlashEvents is a collection of ValidatorSlashEvent messages. +#[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.distribution.v1beta1.ValidatorSlashEvents")] +pub struct ValidatorSlashEvents { + #[prost(message, repeated, tag = "1")] + pub validator_slash_events: ::prost::alloc::vec::Vec, +} +/// FeePool is the global fee pool for distribution. +#[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.distribution.v1beta1.FeePool")] +pub struct FeePool { + #[prost(message, repeated, tag = "1")] + pub community_pool: ::prost::alloc::vec::Vec, +} +/// CommunityPoolSpendProposal details a proposal for use of community funds, +/// together with how many coins are proposed to be spent, and to which +/// recipient account. +/// +/// Deprecated: Do not use. As of the Cosmos SDK release v0.47.x, there is no +/// longer a need for an explicit CommunityPoolSpendProposal. To spend community +/// pool funds, a simple MsgCommunityPoolSpend can be invoked from the x/gov +/// module via a v1 governance proposal. +#[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.distribution.v1beta1.CommunityPoolSpendProposal")] +#[deprecated] +pub struct CommunityPoolSpendProposal { + #[prost(string, tag = "1")] + pub title: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub recipient: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "4")] + pub amount: ::prost::alloc::vec::Vec, +} +/// DelegatorStartingInfo represents the starting info for a delegator reward +/// period. It tracks the previous validator period, the delegation's amount of +/// staking token, and the creation height (to check later on if any slashes have +/// occurred). NOTE: Even though validators are slashed to whole staking tokens, +/// the delegators within the validator may be left with less than a full token, +/// thus sdk.Dec is used. +#[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.distribution.v1beta1.DelegatorStartingInfo")] +pub struct DelegatorStartingInfo { + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub previous_period: u64, + #[prost(string, tag = "2")] + pub stake: ::prost::alloc::string::String, + #[prost(uint64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: u64, +} +/// DelegationDelegatorReward represents the properties +/// of a delegator's delegation reward. +#[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.distribution.v1beta1.DelegationDelegatorReward")] +pub struct DelegationDelegatorReward { + #[prost(string, tag = "1")] + pub validator_address: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] + pub reward: ::prost::alloc::vec::Vec, +} +/// CommunityPoolSpendProposalWithDeposit defines a CommunityPoolSpendProposal +/// with a deposit +#[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.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit")] +pub struct CommunityPoolSpendProposalWithDeposit { + #[prost(string, tag = "1")] + pub title: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub recipient: ::prost::alloc::string::String, + #[prost(string, tag = "4")] + pub amount: ::prost::alloc::string::String, + #[prost(string, tag = "5")] + pub deposit: ::prost::alloc::string::String, +} +/// DelegatorWithdrawInfo is the address for where distributions rewards are +/// withdrawn to by default this struct is only used at genesis to feed in +/// default withdraw addresses. +#[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.distribution.v1beta1.DelegatorWithdrawInfo")] +pub struct DelegatorWithdrawInfo { + /// delegator_address is the address of the delegator. + #[prost(string, tag = "1")] + pub delegator_address: ::prost::alloc::string::String, + /// withdraw_address is the address to withdraw the delegation rewards to. + #[prost(string, tag = "2")] + pub withdraw_address: ::prost::alloc::string::String, +} +/// ValidatorOutstandingRewardsRecord is used for import/export via genesis json. +#[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.distribution.v1beta1.ValidatorOutstandingRewardsRecord")] +pub struct ValidatorOutstandingRewardsRecord { + /// validator_address is the address of the validator. + #[prost(string, tag = "1")] + pub validator_address: ::prost::alloc::string::String, + /// outstanding_rewards represents the outstanding rewards of a validator. + #[prost(message, repeated, tag = "2")] + pub outstanding_rewards: ::prost::alloc::vec::Vec, +} +/// ValidatorAccumulatedCommissionRecord is used for import / export via genesis +/// json. +#[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.distribution.v1beta1.ValidatorAccumulatedCommissionRecord")] +pub struct ValidatorAccumulatedCommissionRecord { + /// validator_address is the address of the validator. + #[prost(string, tag = "1")] + pub validator_address: ::prost::alloc::string::String, + /// accumulated is the accumulated commission of a validator. + #[prost(message, optional, tag = "2")] + pub accumulated: ::core::option::Option, +} +/// ValidatorHistoricalRewardsRecord is used for import / export via genesis +/// json. +#[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.distribution.v1beta1.ValidatorHistoricalRewardsRecord")] +pub struct ValidatorHistoricalRewardsRecord { + /// validator_address is the address of the validator. + #[prost(string, tag = "1")] + pub validator_address: ::prost::alloc::string::String, + /// period defines the period the historical rewards apply to. + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub period: u64, + /// rewards defines the historical rewards of a validator. + #[prost(message, optional, tag = "3")] + pub rewards: ::core::option::Option, +} +/// ValidatorCurrentRewardsRecord is used for import / export via genesis json. +#[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.distribution.v1beta1.ValidatorCurrentRewardsRecord")] +pub struct ValidatorCurrentRewardsRecord { + /// validator_address is the address of the validator. + #[prost(string, tag = "1")] + pub validator_address: ::prost::alloc::string::String, + /// rewards defines the current rewards of a validator. + #[prost(message, optional, tag = "2")] + pub rewards: ::core::option::Option, +} +/// DelegatorStartingInfoRecord used for import / export via genesis json. +#[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.distribution.v1beta1.DelegatorStartingInfoRecord")] +pub struct DelegatorStartingInfoRecord { + /// delegator_address is the address of the delegator. + #[prost(string, tag = "1")] + pub delegator_address: ::prost::alloc::string::String, + /// validator_address is the address of the validator. + #[prost(string, tag = "2")] + pub validator_address: ::prost::alloc::string::String, + /// starting_info defines the starting info of a delegator. + #[prost(message, optional, tag = "3")] + pub starting_info: ::core::option::Option, +} +/// ValidatorSlashEventRecord is used for import / export via genesis json. +#[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.distribution.v1beta1.ValidatorSlashEventRecord")] +pub struct ValidatorSlashEventRecord { + /// validator_address is the address of the validator. + #[prost(string, tag = "1")] + pub validator_address: ::prost::alloc::string::String, + /// height defines the block height at which the slash event occurred. + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: u64, + /// period is the period of the slash event. + #[prost(uint64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub period: u64, + /// validator_slash_event describes the slash event. + #[prost(message, optional, tag = "4")] + pub validator_slash_event: ::core::option::Option, +} +/// GenesisState defines the distribution module's genesis state. +#[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.distribution.v1beta1.GenesisState")] +pub struct GenesisState { + /// params defines all the parameters of the module. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, + /// fee_pool defines the fee pool at genesis. + #[prost(message, optional, tag = "2")] + pub fee_pool: ::core::option::Option, + /// fee_pool defines the delegator withdraw infos at genesis. + #[prost(message, repeated, tag = "3")] + pub delegator_withdraw_infos: ::prost::alloc::vec::Vec, + /// fee_pool defines the previous proposer at genesis. + #[prost(string, tag = "4")] + pub previous_proposer: ::prost::alloc::string::String, + /// fee_pool defines the outstanding rewards of all validators at genesis. + #[prost(message, repeated, tag = "5")] + pub outstanding_rewards: ::prost::alloc::vec::Vec, + /// fee_pool defines the accumulated commissions of all validators at genesis. + #[prost(message, repeated, tag = "6")] + pub validator_accumulated_commissions: + ::prost::alloc::vec::Vec, + /// fee_pool defines the historical rewards of all validators at genesis. + #[prost(message, repeated, tag = "7")] + pub validator_historical_rewards: ::prost::alloc::vec::Vec, + /// fee_pool defines the current rewards of all validators at genesis. + #[prost(message, repeated, tag = "8")] + pub validator_current_rewards: ::prost::alloc::vec::Vec, + /// fee_pool defines the delegator starting infos at genesis. + #[prost(message, repeated, tag = "9")] + pub delegator_starting_infos: ::prost::alloc::vec::Vec, + /// fee_pool defines the validator slash events at genesis. + #[prost(message, repeated, tag = "10")] + pub validator_slash_events: ::prost::alloc::vec::Vec, +} +/// QueryParamsRequest is the request type for the Query/Params 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.distribution.v1beta1.QueryParamsRequest")] +#[proto_query( + path = "/cosmos.distribution.v1beta1.Query/Params", + response_type = QueryParamsResponse +)] +pub struct QueryParamsRequest {} +/// QueryParamsResponse is the response type for the Query/Params 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.distribution.v1beta1.QueryParamsResponse")] +pub struct QueryParamsResponse { + /// params defines the parameters of the module. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} +/// QueryValidatorDistributionInfoRequest is the request type for the Query/ValidatorDistributionInfo 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.distribution.v1beta1.QueryValidatorDistributionInfoRequest")] +#[proto_query( + path = "/cosmos.distribution.v1beta1.Query/ValidatorDistributionInfo", + response_type = QueryValidatorDistributionInfoResponse +)] +pub struct QueryValidatorDistributionInfoRequest { + /// validator_address defines the validator address to query for. + #[prost(string, tag = "1")] + pub validator_address: ::prost::alloc::string::String, +} +/// QueryValidatorDistributionInfoResponse is the response type for the Query/ValidatorDistributionInfo 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.distribution.v1beta1.QueryValidatorDistributionInfoResponse")] +pub struct QueryValidatorDistributionInfoResponse { + /// operator_address defines the validator operator address. + #[prost(string, tag = "1")] + pub operator_address: ::prost::alloc::string::String, + /// self_bond_rewards defines the self delegations rewards. + #[prost(message, repeated, tag = "2")] + pub self_bond_rewards: ::prost::alloc::vec::Vec, + /// commission defines the commission the validator received. + #[prost(message, repeated, tag = "3")] + pub commission: ::prost::alloc::vec::Vec, +} +/// QueryValidatorOutstandingRewardsRequest is the request type for the +/// Query/ValidatorOutstandingRewards 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.distribution.v1beta1.QueryValidatorOutstandingRewardsRequest")] +#[proto_query( + path = "/cosmos.distribution.v1beta1.Query/ValidatorOutstandingRewards", + response_type = QueryValidatorOutstandingRewardsResponse +)] +pub struct QueryValidatorOutstandingRewardsRequest { + /// validator_address defines the validator address to query for. + #[prost(string, tag = "1")] + pub validator_address: ::prost::alloc::string::String, +} +/// QueryValidatorOutstandingRewardsResponse is the response type for the +/// Query/ValidatorOutstandingRewards 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.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse")] +pub struct QueryValidatorOutstandingRewardsResponse { + #[prost(message, optional, tag = "1")] + pub rewards: ::core::option::Option, +} +/// QueryValidatorCommissionRequest is the request type for the +/// Query/ValidatorCommission 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.distribution.v1beta1.QueryValidatorCommissionRequest")] +#[proto_query( + path = "/cosmos.distribution.v1beta1.Query/ValidatorCommission", + response_type = QueryValidatorCommissionResponse +)] +pub struct QueryValidatorCommissionRequest { + /// validator_address defines the validator address to query for. + #[prost(string, tag = "1")] + pub validator_address: ::prost::alloc::string::String, +} +/// QueryValidatorCommissionResponse is the response type for the +/// Query/ValidatorCommission 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.distribution.v1beta1.QueryValidatorCommissionResponse")] +pub struct QueryValidatorCommissionResponse { + /// commission defines the commission the validator received. + #[prost(message, optional, tag = "1")] + pub commission: ::core::option::Option, +} +/// QueryValidatorSlashesRequest is the request type for the +/// Query/ValidatorSlashes 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.distribution.v1beta1.QueryValidatorSlashesRequest")] +#[proto_query( + path = "/cosmos.distribution.v1beta1.Query/ValidatorSlashes", + response_type = QueryValidatorSlashesResponse +)] +pub struct QueryValidatorSlashesRequest { + /// validator_address defines the validator address to query for. + #[prost(string, tag = "1")] + pub validator_address: ::prost::alloc::string::String, + /// starting_height defines the optional starting height to query the slashes. + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub starting_height: u64, + /// starting_height defines the optional ending height to query the slashes. + #[prost(uint64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub ending_height: u64, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "4")] + pub pagination: ::core::option::Option, +} +/// QueryValidatorSlashesResponse is the response type for the +/// Query/ValidatorSlashes 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.distribution.v1beta1.QueryValidatorSlashesResponse")] +pub struct QueryValidatorSlashesResponse { + /// slashes defines the slashes the validator received. + #[prost(message, repeated, tag = "1")] + pub slashes: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryDelegationRewardsRequest is the request type for the +/// Query/DelegationRewards 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.distribution.v1beta1.QueryDelegationRewardsRequest")] +#[proto_query( + path = "/cosmos.distribution.v1beta1.Query/DelegationRewards", + response_type = QueryDelegationRewardsResponse +)] +pub struct QueryDelegationRewardsRequest { + /// delegator_address defines the delegator address to query for. + #[prost(string, tag = "1")] + pub delegator_address: ::prost::alloc::string::String, + /// validator_address defines the validator address to query for. + #[prost(string, tag = "2")] + pub validator_address: ::prost::alloc::string::String, +} +/// QueryDelegationRewardsResponse is the response type for the +/// Query/DelegationRewards 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.distribution.v1beta1.QueryDelegationRewardsResponse")] +pub struct QueryDelegationRewardsResponse { + /// rewards defines the rewards accrued by a delegation. + #[prost(message, repeated, tag = "1")] + pub rewards: ::prost::alloc::vec::Vec, } +/// QueryDelegationTotalRewardsRequest is the request type for the +/// Query/DelegationTotalRewards RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -48,12 +800,18 @@ pub struct ValidatorAccumulatedCommission { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmos.distribution.v1beta1.QueryParamsRequest")] +#[proto_message(type_url = "/cosmos.distribution.v1beta1.QueryDelegationTotalRewardsRequest")] #[proto_query( - path = "/cosmos.distribution.v1beta1.Query/Params", - response_type = QueryParamsResponse + path = "/cosmos.distribution.v1beta1.Query/DelegationTotalRewards", + response_type = QueryDelegationTotalRewardsResponse )] -pub struct QueryParamsRequest {} +pub struct QueryDelegationTotalRewardsRequest { + /// delegator_address defines the delegator address to query for. + #[prost(string, tag = "1")] + pub delegator_address: ::prost::alloc::string::String, +} +/// QueryDelegationTotalRewardsResponse is the response type for the +/// Query/DelegationTotalRewards RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -65,11 +823,17 @@ pub struct QueryParamsRequest {} ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmos.distribution.v1beta1.QueryParamsResponse")] -pub struct QueryParamsResponse { - #[prost(message, optional, tag = "1")] - pub params: ::core::option::Option, +#[proto_message(type_url = "/cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse")] +pub struct QueryDelegationTotalRewardsResponse { + /// rewards defines all the rewards accrued by a delegator. + #[prost(message, repeated, tag = "1")] + pub rewards: ::prost::alloc::vec::Vec, + /// total defines the sum of all the rewards. + #[prost(message, repeated, tag = "2")] + pub total: ::prost::alloc::vec::Vec, } +/// QueryDelegatorValidatorsRequest is the request type for the +/// Query/DelegatorValidators RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -81,15 +845,18 @@ pub struct QueryParamsResponse { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmos.distribution.v1beta1.QueryValidatorCommissionRequest")] +#[proto_message(type_url = "/cosmos.distribution.v1beta1.QueryDelegatorValidatorsRequest")] #[proto_query( - path = "/cosmos.distribution.v1beta1.Query/ValidatorCommission", - response_type = QueryValidatorCommissionResponse + path = "/cosmos.distribution.v1beta1.Query/DelegatorValidators", + response_type = QueryDelegatorValidatorsResponse )] -pub struct QueryValidatorCommissionRequest { +pub struct QueryDelegatorValidatorsRequest { + /// delegator_address defines the delegator address to query for. #[prost(string, tag = "1")] - pub validator_address: ::prost::alloc::string::String, + pub delegator_address: ::prost::alloc::string::String, } +/// QueryDelegatorValidatorsResponse is the response type for the +/// Query/DelegatorValidators RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -101,11 +868,14 @@ pub struct QueryValidatorCommissionRequest { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmos.distribution.v1beta1.QueryValidatorCommissionResponse")] -pub struct QueryValidatorCommissionResponse { - #[prost(message, optional, tag = "1")] - pub commission: ::core::option::Option, +#[proto_message(type_url = "/cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse")] +pub struct QueryDelegatorValidatorsResponse { + /// validators defines the validators a delegator is delegating for. + #[prost(string, repeated, tag = "1")] + pub validators: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +/// QueryDelegatorWithdrawAddressRequest is the request type for the +/// Query/DelegatorWithdrawAddress RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -123,9 +893,12 @@ pub struct QueryValidatorCommissionResponse { response_type = QueryDelegatorWithdrawAddressResponse )] pub struct QueryDelegatorWithdrawAddressRequest { + /// delegator_address defines the delegator address to query for. #[prost(string, tag = "1")] pub delegator_address: ::prost::alloc::string::String, } +/// QueryDelegatorWithdrawAddressResponse is the response type for the +/// Query/DelegatorWithdrawAddress RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -139,9 +912,319 @@ pub struct QueryDelegatorWithdrawAddressRequest { )] #[proto_message(type_url = "/cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse")] pub struct QueryDelegatorWithdrawAddressResponse { + /// withdraw_address defines the delegator address to query for. + #[prost(string, tag = "1")] + pub withdraw_address: ::prost::alloc::string::String, +} +/// QueryCommunityPoolRequest is the request type for the Query/CommunityPool 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.distribution.v1beta1.QueryCommunityPoolRequest")] +#[proto_query( + path = "/cosmos.distribution.v1beta1.Query/CommunityPool", + response_type = QueryCommunityPoolResponse +)] +pub struct QueryCommunityPoolRequest {} +/// QueryCommunityPoolResponse is the response type for the Query/CommunityPool +/// 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.distribution.v1beta1.QueryCommunityPoolResponse")] +pub struct QueryCommunityPoolResponse { + /// pool defines community pool's coins. + #[prost(message, repeated, tag = "1")] + pub pool: ::prost::alloc::vec::Vec, +} +/// MsgSetWithdrawAddress sets the withdraw address for +/// a delegator (or validator self-delegation). +#[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.distribution.v1beta1.MsgSetWithdrawAddress")] +pub struct MsgSetWithdrawAddress { #[prost(string, tag = "1")] + pub delegator_address: ::prost::alloc::string::String, + #[prost(string, tag = "2")] pub withdraw_address: ::prost::alloc::string::String, } +/// MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress 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.distribution.v1beta1.MsgSetWithdrawAddressResponse")] +pub struct MsgSetWithdrawAddressResponse {} +/// MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator +/// from a single validator. +#[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.distribution.v1beta1.MsgWithdrawDelegatorReward")] +pub struct MsgWithdrawDelegatorReward { + #[prost(string, tag = "1")] + pub delegator_address: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub validator_address: ::prost::alloc::string::String, +} +/// MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward +/// 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.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse")] +pub struct MsgWithdrawDelegatorRewardResponse { + /// Since: cosmos-sdk 0.46 + #[prost(message, repeated, tag = "1")] + pub amount: ::prost::alloc::vec::Vec, +} +/// MsgWithdrawValidatorCommission withdraws the full commission to the validator +/// address. +#[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.distribution.v1beta1.MsgWithdrawValidatorCommission")] +pub struct MsgWithdrawValidatorCommission { + #[prost(string, tag = "1")] + pub validator_address: ::prost::alloc::string::String, +} +/// MsgWithdrawValidatorCommissionResponse defines the +/// Msg/WithdrawValidatorCommission 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.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse")] +pub struct MsgWithdrawValidatorCommissionResponse { + /// Since: cosmos-sdk 0.46 + #[prost(message, repeated, tag = "1")] + pub amount: ::prost::alloc::vec::Vec, +} +/// MsgFundCommunityPool allows an account to directly +/// fund the community pool. +#[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.distribution.v1beta1.MsgFundCommunityPool")] +pub struct MsgFundCommunityPool { + #[prost(message, repeated, tag = "1")] + pub amount: ::prost::alloc::vec::Vec, + #[prost(string, tag = "2")] + pub depositor: ::prost::alloc::string::String, +} +/// MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool 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.distribution.v1beta1.MsgFundCommunityPoolResponse")] +pub struct MsgFundCommunityPoolResponse {} +/// MsgUpdateParams is the Msg/UpdateParams request type. +/// +/// Since: cosmos-sdk 0.47 +#[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.distribution.v1beta1.MsgUpdateParams")] +pub struct MsgUpdateParams { + /// authority is the address that controls the module (defaults to x/gov unless overwritten). + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// params defines the x/distribution parameters to update. + /// + /// NOTE: All parameters must be supplied. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +/// MsgUpdateParamsResponse defines the response structure for executing a +/// MsgUpdateParams message. +/// +/// Since: cosmos-sdk 0.47 +#[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.distribution.v1beta1.MsgUpdateParamsResponse")] +pub struct MsgUpdateParamsResponse {} +/// MsgCommunityPoolSpend defines a message for sending tokens from the community +/// pool to another account. This message is typically executed via a governance +/// proposal with the governance module being the executing authority. +/// +/// Since: cosmos-sdk 0.47 +#[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.distribution.v1beta1.MsgCommunityPoolSpend")] +pub struct MsgCommunityPoolSpend { + /// authority is the address that controls the module (defaults to x/gov unless overwritten). + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub recipient: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "3")] + pub amount: ::prost::alloc::vec::Vec, +} +/// MsgCommunityPoolSpendResponse defines the response to executing a +/// MsgCommunityPoolSpend message. +/// +/// Since: cosmos-sdk 0.47 +#[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.distribution.v1beta1.MsgCommunityPoolSpendResponse")] +pub struct MsgCommunityPoolSpendResponse {} +/// DepositValidatorRewardsPool defines the request structure to provide +/// additional rewards to delegators from a specific validator. +/// +/// Since: cosmos-sdk 0.50 +#[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.distribution.v1beta1.MsgDepositValidatorRewardsPool")] +pub struct MsgDepositValidatorRewardsPool { + #[prost(string, tag = "1")] + pub depositor: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub validator_address: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "3")] + pub amount: ::prost::alloc::vec::Vec, +} +/// MsgDepositValidatorRewardsPoolResponse defines the response to executing a +/// MsgDepositValidatorRewardsPool message. +/// +/// Since: cosmos-sdk 0.50 +#[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.distribution.v1beta1.MsgDepositValidatorRewardsPoolResponse")] +pub struct MsgDepositValidatorRewardsPoolResponse {} pub struct DistributionQuerier<'a, Q: cosmwasm_std::CustomQuery> { querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, } @@ -152,16 +1235,69 @@ impl<'a, Q: cosmwasm_std::CustomQuery> DistributionQuerier<'a, Q> { pub fn params(&self) -> Result { QueryParamsRequest {}.query(self.querier) } + pub fn validator_distribution_info( + &self, + validator_address: ::prost::alloc::string::String, + ) -> Result { + QueryValidatorDistributionInfoRequest { validator_address }.query(self.querier) + } + pub fn validator_outstanding_rewards( + &self, + validator_address: ::prost::alloc::string::String, + ) -> Result { + QueryValidatorOutstandingRewardsRequest { validator_address }.query(self.querier) + } pub fn validator_commission( &self, validator_address: ::prost::alloc::string::String, ) -> Result { QueryValidatorCommissionRequest { validator_address }.query(self.querier) } + pub fn validator_slashes( + &self, + validator_address: ::prost::alloc::string::String, + starting_height: u64, + ending_height: u64, + pagination: ::core::option::Option, + ) -> Result { + QueryValidatorSlashesRequest { + validator_address, + starting_height, + ending_height, + pagination, + } + .query(self.querier) + } + pub fn delegation_rewards( + &self, + delegator_address: ::prost::alloc::string::String, + validator_address: ::prost::alloc::string::String, + ) -> Result { + QueryDelegationRewardsRequest { + delegator_address, + validator_address, + } + .query(self.querier) + } + pub fn delegation_total_rewards( + &self, + delegator_address: ::prost::alloc::string::String, + ) -> Result { + QueryDelegationTotalRewardsRequest { delegator_address }.query(self.querier) + } + pub fn delegator_validators( + &self, + delegator_address: ::prost::alloc::string::String, + ) -> Result { + QueryDelegatorValidatorsRequest { delegator_address }.query(self.querier) + } pub fn delegator_withdraw_address( &self, delegator_address: ::prost::alloc::string::String, ) -> Result { QueryDelegatorWithdrawAddressRequest { delegator_address }.query(self.querier) } + pub fn community_pool(&self) -> Result { + QueryCommunityPoolRequest {}.query(self.querier) + } } diff --git a/packages/provwasm-std/src/types/cosmos/evidence/mod.rs b/packages/provwasm-std/src/types/cosmos/evidence/mod.rs new file mode 100644 index 00000000..537a3360 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/evidence/mod.rs @@ -0,0 +1,2 @@ +pub mod module; +pub mod v1beta1; diff --git a/packages/provwasm-std/src/types/cosmos/evidence/module/mod.rs b/packages/provwasm-std/src/types/cosmos/evidence/module/mod.rs new file mode 100644 index 00000000..a3a6d96c --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/evidence/module/mod.rs @@ -0,0 +1 @@ +pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/evidence/module/v1.rs b/packages/provwasm-std/src/types/cosmos/evidence/module/v1.rs new file mode 100644 index 00000000..7094094a --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/evidence/module/v1.rs @@ -0,0 +1,15 @@ +use provwasm_proc_macro::CosmwasmExt; +/// Module is the config object of the evidence 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.evidence.module.v1.Module")] +pub struct Module {} diff --git a/packages/provwasm-std/src/types/cosmos/evidence/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/evidence/v1beta1.rs new file mode 100644 index 00000000..3f040a3f --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/evidence/v1beta1.rs @@ -0,0 +1,220 @@ +use provwasm_proc_macro::CosmwasmExt; +/// Equivocation implements the Evidence interface and defines evidence of double +/// signing misbehavior. +#[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.evidence.v1beta1.Equivocation")] +pub struct Equivocation { + /// height is the equivocation height. + #[prost(int64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: i64, + /// time is the equivocation time. + #[prost(message, optional, tag = "2")] + pub time: ::core::option::Option, + /// power is the equivocation validator power. + #[prost(int64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub power: i64, + /// consensus_address is the equivocation validator consensus address. + #[prost(string, tag = "4")] + pub consensus_address: ::prost::alloc::string::String, +} +/// GenesisState defines the evidence module's genesis state. +#[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.evidence.v1beta1.GenesisState")] +pub struct GenesisState { + /// evidence defines all the evidence at genesis. + #[prost(message, repeated, tag = "1")] + pub evidence: ::prost::alloc::vec::Vec, +} +/// QueryEvidenceRequest is the request type for the Query/Evidence 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.evidence.v1beta1.QueryEvidenceRequest")] +#[proto_query( + path = "/cosmos.evidence.v1beta1.Query/Evidence", + response_type = QueryEvidenceResponse +)] +pub struct QueryEvidenceRequest { + /// evidence_hash defines the hash of the requested evidence. + /// Deprecated: Use hash, a HEX encoded string, instead. + #[deprecated] + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub evidence_hash: ::prost::alloc::vec::Vec, + /// hash defines the evidence hash of the requested evidence. + /// + /// Since: cosmos-sdk 0.47 + #[prost(string, tag = "2")] + pub hash: ::prost::alloc::string::String, +} +/// QueryEvidenceResponse is the response type for the Query/Evidence 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.evidence.v1beta1.QueryEvidenceResponse")] +pub struct QueryEvidenceResponse { + /// evidence returns the requested evidence. + #[prost(message, optional, tag = "1")] + pub evidence: ::core::option::Option, +} +/// QueryEvidenceRequest is the request type for the Query/AllEvidence 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.evidence.v1beta1.QueryAllEvidenceRequest")] +#[proto_query( + path = "/cosmos.evidence.v1beta1.Query/AllEvidence", + response_type = QueryAllEvidenceResponse +)] +pub struct QueryAllEvidenceRequest { + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "1")] + pub pagination: ::core::option::Option, +} +/// QueryAllEvidenceResponse is the response type for the Query/AllEvidence 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.evidence.v1beta1.QueryAllEvidenceResponse")] +pub struct QueryAllEvidenceResponse { + /// evidence returns all evidences. + #[prost(message, repeated, tag = "1")] + pub evidence: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// MsgSubmitEvidence represents a message that supports submitting arbitrary +/// Evidence of misbehavior such as equivocation or counterfactual signing. +#[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.evidence.v1beta1.MsgSubmitEvidence")] +pub struct MsgSubmitEvidence { + /// submitter is the signer account address of evidence. + #[prost(string, tag = "1")] + pub submitter: ::prost::alloc::string::String, + /// evidence defines the evidence of misbehavior. + #[prost(message, optional, tag = "2")] + pub evidence: ::core::option::Option, +} +/// MsgSubmitEvidenceResponse defines the Msg/SubmitEvidence 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.evidence.v1beta1.MsgSubmitEvidenceResponse")] +pub struct MsgSubmitEvidenceResponse { + /// hash defines the hash of the evidence. + #[prost(bytes = "vec", tag = "4")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub hash: ::prost::alloc::vec::Vec, +} +pub struct EvidenceQuerier<'a, Q: cosmwasm_std::CustomQuery> { + querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, +} +impl<'a, Q: cosmwasm_std::CustomQuery> EvidenceQuerier<'a, Q> { + pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self { + Self { querier } + } + pub fn evidence( + &self, + evidence_hash: ::prost::alloc::vec::Vec, + hash: ::prost::alloc::string::String, + ) -> Result { + QueryEvidenceRequest { + evidence_hash, + hash, + } + .query(self.querier) + } + pub fn all_evidence( + &self, + pagination: ::core::option::Option, + ) -> Result { + QueryAllEvidenceRequest { pagination }.query(self.querier) + } +} diff --git a/packages/provwasm-std/src/types/cosmos/feegrant/mod.rs b/packages/provwasm-std/src/types/cosmos/feegrant/mod.rs new file mode 100644 index 00000000..537a3360 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/feegrant/mod.rs @@ -0,0 +1,2 @@ +pub mod module; +pub mod v1beta1; diff --git a/packages/provwasm-std/src/types/cosmos/feegrant/module/mod.rs b/packages/provwasm-std/src/types/cosmos/feegrant/module/mod.rs new file mode 100644 index 00000000..a3a6d96c --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/feegrant/module/mod.rs @@ -0,0 +1 @@ +pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/feegrant/module/v1.rs b/packages/provwasm-std/src/types/cosmos/feegrant/module/v1.rs new file mode 100644 index 00000000..953a001f --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/feegrant/module/v1.rs @@ -0,0 +1,15 @@ +use provwasm_proc_macro::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 {} diff --git a/packages/provwasm-std/src/types/cosmos/feegrant/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/feegrant/v1beta1.rs new file mode 100644 index 00000000..e3abc771 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/feegrant/v1beta1.rs @@ -0,0 +1,406 @@ +use provwasm_proc_macro::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, + /// expiration specifies an optional time when this allowance expires + #[prost(message, optional, tag = "2")] + pub expiration: ::core::option::Option, +} +/// 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, + /// 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, + /// 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, + /// 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, + /// 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, +} +/// 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, + /// 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, +} +/// 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, +} +/// 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, +} +/// 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, +} +/// 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, + /// pagination defines an pagination for the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// 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, +} +/// 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, + /// pagination defines an pagination for the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// 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, +} +/// 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 {} +/// MsgPruneAllowances prunes expired fee allowances. +/// +/// Since cosmos-sdk 0.50 +#[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.MsgPruneAllowances")] +pub struct MsgPruneAllowances { + /// pruner is the address of the user pruning expired allowances. + #[prost(string, tag = "1")] + pub pruner: ::prost::alloc::string::String, +} +/// MsgPruneAllowancesResponse defines the Msg/PruneAllowancesResponse response type. +/// +/// Since cosmos-sdk 0.50 +#[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.MsgPruneAllowancesResponse")] +pub struct MsgPruneAllowancesResponse {} +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 { + QueryAllowanceRequest { granter, grantee }.query(self.querier) + } + pub fn allowances( + &self, + grantee: ::prost::alloc::string::String, + pagination: ::core::option::Option, + ) -> Result { + QueryAllowancesRequest { + grantee, + pagination, + } + .query(self.querier) + } + pub fn allowances_by_granter( + &self, + granter: ::prost::alloc::string::String, + pagination: ::core::option::Option, + ) -> Result { + QueryAllowancesByGranterRequest { + granter, + pagination, + } + .query(self.querier) + } +} diff --git a/packages/provwasm-std/src/types/cosmos/genutil/mod.rs b/packages/provwasm-std/src/types/cosmos/genutil/mod.rs new file mode 100644 index 00000000..537a3360 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/genutil/mod.rs @@ -0,0 +1,2 @@ +pub mod module; +pub mod v1beta1; diff --git a/packages/provwasm-std/src/types/cosmos/genutil/module/mod.rs b/packages/provwasm-std/src/types/cosmos/genutil/module/mod.rs new file mode 100644 index 00000000..a3a6d96c --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/genutil/module/mod.rs @@ -0,0 +1 @@ +pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/genutil/module/v1.rs b/packages/provwasm-std/src/types/cosmos/genutil/module/v1.rs new file mode 100644 index 00000000..b56e936d --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/genutil/module/v1.rs @@ -0,0 +1,15 @@ +use provwasm_proc_macro::CosmwasmExt; +/// Module is the config object for the genutil 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.genutil.module.v1.Module")] +pub struct Module {} diff --git a/packages/provwasm-std/src/types/cosmos/genutil/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/genutil/v1beta1.rs new file mode 100644 index 00000000..c289572b --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/genutil/v1beta1.rs @@ -0,0 +1,19 @@ +use provwasm_proc_macro::CosmwasmExt; +/// GenesisState defines the raw genesis transaction in JSON. +#[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.genutil.v1beta1.GenesisState")] +pub struct GenesisState { + /// gen_txs defines the genesis transactions. + #[prost(bytes = "vec", repeated, tag = "1")] + pub gen_txs: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, +} diff --git a/packages/provwasm-std/src/types/cosmos/gov/mod.rs b/packages/provwasm-std/src/types/cosmos/gov/mod.rs index 9f64fc82..316ad46f 100644 --- a/packages/provwasm-std/src/types/cosmos/gov/mod.rs +++ b/packages/provwasm-std/src/types/cosmos/gov/mod.rs @@ -1 +1,3 @@ +pub mod module; +pub mod v1; pub mod v1beta1; diff --git a/packages/provwasm-std/src/types/cosmos/gov/module/mod.rs b/packages/provwasm-std/src/types/cosmos/gov/module/mod.rs new file mode 100644 index 00000000..a3a6d96c --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/gov/module/mod.rs @@ -0,0 +1 @@ +pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/gov/module/v1.rs b/packages/provwasm-std/src/types/cosmos/gov/module/v1.rs new file mode 100644 index 00000000..ef36cfc1 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/gov/module/v1.rs @@ -0,0 +1,27 @@ +use provwasm_proc_macro::CosmwasmExt; +/// Module is the config object of the gov 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.gov.module.v1.Module")] +pub struct Module { + /// max_metadata_len defines the maximum proposal metadata length. + /// Defaults to 255 if not explicitly set. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub max_metadata_len: u64, + /// authority defines the custom module authority. If not set, defaults to the governance module. + #[prost(string, tag = "2")] + pub authority: ::prost::alloc::string::String, +} diff --git a/packages/provwasm-std/src/types/cosmos/gov/v1.rs b/packages/provwasm-std/src/types/cosmos/gov/v1.rs new file mode 100644 index 00000000..f3a19fcf --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/gov/v1.rs @@ -0,0 +1,1347 @@ +use provwasm_proc_macro::CosmwasmExt; +/// WeightedVoteOption defines a unit of vote for vote split. +#[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.gov.v1.WeightedVoteOption")] +pub struct WeightedVoteOption { + /// option defines the valid vote options, it must not contain duplicate vote options. + #[prost(enumeration = "VoteOption", tag = "1")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub option: i32, + /// weight is the vote weight associated with the vote option. + #[prost(string, tag = "2")] + pub weight: ::prost::alloc::string::String, +} +/// Deposit defines an amount deposited by an account address to an active +/// proposal. +#[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.gov.v1.Deposit")] +pub struct Deposit { + /// proposal_id defines the unique id of the proposal. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub proposal_id: u64, + /// depositor defines the deposit addresses from the proposals. + #[prost(string, tag = "2")] + pub depositor: ::prost::alloc::string::String, + /// amount to be deposited by depositor. + #[prost(message, repeated, tag = "3")] + pub amount: ::prost::alloc::vec::Vec, +} +/// Proposal defines the core field members of a governance proposal. +#[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.gov.v1.Proposal")] +pub struct Proposal { + /// id defines the unique id of the proposal. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub id: u64, + /// messages are the arbitrary messages to be executed if the proposal passes. + #[prost(message, repeated, tag = "2")] + pub messages: ::prost::alloc::vec::Vec, + /// status defines the proposal status. + #[prost(enumeration = "ProposalStatus", tag = "3")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub status: i32, + /// final_tally_result is the final tally result of the proposal. When + /// querying a proposal via gRPC, this field is not populated until the + /// proposal's voting period has ended. + #[prost(message, optional, tag = "4")] + pub final_tally_result: ::core::option::Option, + /// submit_time is the time of proposal submission. + #[prost(message, optional, tag = "5")] + pub submit_time: ::core::option::Option, + /// deposit_end_time is the end time for deposition. + #[prost(message, optional, tag = "6")] + pub deposit_end_time: ::core::option::Option, + /// total_deposit is the total deposit on the proposal. + #[prost(message, repeated, tag = "7")] + pub total_deposit: ::prost::alloc::vec::Vec, + /// voting_start_time is the starting time to vote on a proposal. + #[prost(message, optional, tag = "8")] + pub voting_start_time: ::core::option::Option, + /// voting_end_time is the end time of voting on a proposal. + #[prost(message, optional, tag = "9")] + pub voting_end_time: ::core::option::Option, + /// metadata is any arbitrary metadata attached to the proposal. + /// the recommended format of the metadata is to be found here: + /// + #[prost(string, tag = "10")] + pub metadata: ::prost::alloc::string::String, + /// title is the title of the proposal + /// + /// Since: cosmos-sdk 0.47 + #[prost(string, tag = "11")] + pub title: ::prost::alloc::string::String, + /// summary is a short summary of the proposal + /// + /// Since: cosmos-sdk 0.47 + #[prost(string, tag = "12")] + pub summary: ::prost::alloc::string::String, + /// proposer is the address of the proposal sumbitter + /// + /// Since: cosmos-sdk 0.47 + #[prost(string, tag = "13")] + pub proposer: ::prost::alloc::string::String, + /// expedited defines if the proposal is expedited + /// + /// Since: cosmos-sdk 0.50 + #[prost(bool, tag = "14")] + pub expedited: bool, + /// failed_reason defines the reason why the proposal failed + /// + /// Since: cosmos-sdk 0.50 + #[prost(string, tag = "15")] + pub failed_reason: ::prost::alloc::string::String, +} +/// TallyResult defines a standard tally for a governance proposal. +#[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.gov.v1.TallyResult")] +pub struct TallyResult { + /// yes_count is the number of yes votes on a proposal. + #[prost(string, tag = "1")] + pub yes_count: ::prost::alloc::string::String, + /// abstain_count is the number of abstain votes on a proposal. + #[prost(string, tag = "2")] + pub abstain_count: ::prost::alloc::string::String, + /// no_count is the number of no votes on a proposal. + #[prost(string, tag = "3")] + pub no_count: ::prost::alloc::string::String, + /// no_with_veto_count is the number of no with veto votes on a proposal. + #[prost(string, tag = "4")] + pub no_with_veto_count: ::prost::alloc::string::String, +} +/// Vote defines a vote on a governance proposal. +/// A Vote consists of a proposal ID, the voter, and the vote option. +#[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.gov.v1.Vote")] +pub struct Vote { + /// proposal_id defines the unique id of the proposal. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub proposal_id: u64, + /// voter is the voter address of the proposal. + #[prost(string, tag = "2")] + pub voter: ::prost::alloc::string::String, + /// options is the weighted vote options. + #[prost(message, repeated, tag = "4")] + pub options: ::prost::alloc::vec::Vec, + /// metadata is any arbitrary metadata attached to the vote. + /// the recommended format of the metadata is to be found here: + #[prost(string, tag = "5")] + pub metadata: ::prost::alloc::string::String, +} +/// DepositParams defines the params for deposits on governance proposals. +#[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.gov.v1.DepositParams")] +#[deprecated] +pub struct DepositParams { + /// Minimum deposit for a proposal to enter voting period. + #[prost(message, repeated, tag = "1")] + pub min_deposit: ::prost::alloc::vec::Vec, + /// Maximum period for Atom holders to deposit on a proposal. Initial value: 2 + /// months. + #[prost(message, optional, tag = "2")] + pub max_deposit_period: ::core::option::Option, +} +/// VotingParams defines the params for voting on governance proposals. +#[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.gov.v1.VotingParams")] +#[deprecated] +pub struct VotingParams { + /// Duration of the voting period. + #[prost(message, optional, tag = "1")] + pub voting_period: ::core::option::Option, +} +/// TallyParams defines the params for tallying votes on governance proposals. +#[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.gov.v1.TallyParams")] +#[deprecated] +pub struct TallyParams { + /// Minimum percentage of total stake needed to vote for a result to be + /// considered valid. + #[prost(string, tag = "1")] + pub quorum: ::prost::alloc::string::String, + /// Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. + #[prost(string, tag = "2")] + pub threshold: ::prost::alloc::string::String, + /// Minimum value of Veto votes to Total votes ratio for proposal to be + /// vetoed. Default value: 1/3. + #[prost(string, tag = "3")] + pub veto_threshold: ::prost::alloc::string::String, +} +/// Params defines the parameters for the x/gov module. +/// +/// Since: cosmos-sdk 0.47 +#[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.gov.v1.Params")] +pub struct Params { + /// Minimum deposit for a proposal to enter voting period. + #[prost(message, repeated, tag = "1")] + pub min_deposit: ::prost::alloc::vec::Vec, + /// Maximum period for Atom holders to deposit on a proposal. Initial value: 2 + /// months. + #[prost(message, optional, tag = "2")] + pub max_deposit_period: ::core::option::Option, + /// Duration of the voting period. + #[prost(message, optional, tag = "3")] + pub voting_period: ::core::option::Option, + /// Minimum percentage of total stake needed to vote for a result to be + /// considered valid. + #[prost(string, tag = "4")] + pub quorum: ::prost::alloc::string::String, + /// Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. + #[prost(string, tag = "5")] + pub threshold: ::prost::alloc::string::String, + /// Minimum value of Veto votes to Total votes ratio for proposal to be + /// vetoed. Default value: 1/3. + #[prost(string, tag = "6")] + pub veto_threshold: ::prost::alloc::string::String, + /// The ratio representing the proportion of the deposit value that must be paid at proposal submission. + #[prost(string, tag = "7")] + pub min_initial_deposit_ratio: ::prost::alloc::string::String, + /// The cancel ratio which will not be returned back to the depositors when a proposal is cancelled. + /// + /// Since: cosmos-sdk 0.50 + #[prost(string, tag = "8")] + pub proposal_cancel_ratio: ::prost::alloc::string::String, + /// The address which will receive (proposal_cancel_ratio * deposit) proposal deposits. + /// If empty, the (proposal_cancel_ratio * deposit) proposal deposits will be burned. + /// + /// Since: cosmos-sdk 0.50 + #[prost(string, tag = "9")] + pub proposal_cancel_dest: ::prost::alloc::string::String, + /// Duration of the voting period of an expedited proposal. + /// + /// Since: cosmos-sdk 0.50 + #[prost(message, optional, tag = "10")] + pub expedited_voting_period: ::core::option::Option, + /// Minimum proportion of Yes votes for proposal to pass. Default value: 0.67. + /// + /// Since: cosmos-sdk 0.50 + #[prost(string, tag = "11")] + pub expedited_threshold: ::prost::alloc::string::String, + /// Minimum expedited deposit for a proposal to enter voting period. + #[prost(message, repeated, tag = "12")] + pub expedited_min_deposit: ::prost::alloc::vec::Vec, + /// burn deposits if a proposal does not meet quorum + #[prost(bool, tag = "13")] + pub burn_vote_quorum: bool, + /// burn deposits if the proposal does not enter voting period + #[prost(bool, tag = "14")] + pub burn_proposal_deposit_prevote: bool, + /// burn deposits if quorum with vote type no_veto is met + #[prost(bool, tag = "15")] + pub burn_vote_veto: bool, + /// The ratio representing the proportion of the deposit value minimum that must be met when making a deposit. + /// Default value: 0.01. Meaning that for a chain with a min_deposit of 100stake, a deposit of 1stake would be + /// required. + /// + /// Since: cosmos-sdk 0.50 + #[prost(string, tag = "16")] + pub min_deposit_ratio: ::prost::alloc::string::String, +} +/// VoteOption enumerates the valid vote options for a given governance proposal. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +pub enum VoteOption { + /// VOTE_OPTION_UNSPECIFIED defines a no-op vote option. + Unspecified = 0, + /// VOTE_OPTION_YES defines a yes vote option. + Yes = 1, + /// VOTE_OPTION_ABSTAIN defines an abstain vote option. + Abstain = 2, + /// VOTE_OPTION_NO defines a no vote option. + No = 3, + /// VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. + NoWithVeto = 4, +} +impl VoteOption { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + VoteOption::Unspecified => "VOTE_OPTION_UNSPECIFIED", + VoteOption::Yes => "VOTE_OPTION_YES", + VoteOption::Abstain => "VOTE_OPTION_ABSTAIN", + VoteOption::No => "VOTE_OPTION_NO", + VoteOption::NoWithVeto => "VOTE_OPTION_NO_WITH_VETO", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "VOTE_OPTION_UNSPECIFIED" => Some(Self::Unspecified), + "VOTE_OPTION_YES" => Some(Self::Yes), + "VOTE_OPTION_ABSTAIN" => Some(Self::Abstain), + "VOTE_OPTION_NO" => Some(Self::No), + "VOTE_OPTION_NO_WITH_VETO" => Some(Self::NoWithVeto), + _ => None, + } + } +} +/// ProposalStatus enumerates the valid statuses of a proposal. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +pub enum ProposalStatus { + /// PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. + Unspecified = 0, + /// PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit + /// period. + DepositPeriod = 1, + /// PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting + /// period. + VotingPeriod = 2, + /// PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has + /// passed. + Passed = 3, + /// PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has + /// been rejected. + Rejected = 4, + /// PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has + /// failed. + Failed = 5, +} +impl ProposalStatus { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + ProposalStatus::Unspecified => "PROPOSAL_STATUS_UNSPECIFIED", + ProposalStatus::DepositPeriod => "PROPOSAL_STATUS_DEPOSIT_PERIOD", + ProposalStatus::VotingPeriod => "PROPOSAL_STATUS_VOTING_PERIOD", + ProposalStatus::Passed => "PROPOSAL_STATUS_PASSED", + ProposalStatus::Rejected => "PROPOSAL_STATUS_REJECTED", + ProposalStatus::Failed => "PROPOSAL_STATUS_FAILED", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "PROPOSAL_STATUS_UNSPECIFIED" => Some(Self::Unspecified), + "PROPOSAL_STATUS_DEPOSIT_PERIOD" => Some(Self::DepositPeriod), + "PROPOSAL_STATUS_VOTING_PERIOD" => Some(Self::VotingPeriod), + "PROPOSAL_STATUS_PASSED" => Some(Self::Passed), + "PROPOSAL_STATUS_REJECTED" => Some(Self::Rejected), + "PROPOSAL_STATUS_FAILED" => Some(Self::Failed), + _ => None, + } + } +} +/// GenesisState defines the gov module's genesis state. +#[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.gov.v1.GenesisState")] +pub struct GenesisState { + /// starting_proposal_id is the ID of the starting proposal. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub starting_proposal_id: u64, + /// deposits defines all the deposits present at genesis. + #[prost(message, repeated, tag = "2")] + pub deposits: ::prost::alloc::vec::Vec, + /// votes defines all the votes present at genesis. + #[prost(message, repeated, tag = "3")] + pub votes: ::prost::alloc::vec::Vec, + /// proposals defines all the proposals present at genesis. + #[prost(message, repeated, tag = "4")] + pub proposals: ::prost::alloc::vec::Vec, + /// Deprecated: Prefer to use `params` instead. + /// deposit_params defines all the paramaters of related to deposit. + #[deprecated] + #[prost(message, optional, tag = "5")] + pub deposit_params: ::core::option::Option, + /// Deprecated: Prefer to use `params` instead. + /// voting_params defines all the paramaters of related to voting. + #[deprecated] + #[prost(message, optional, tag = "6")] + pub voting_params: ::core::option::Option, + /// Deprecated: Prefer to use `params` instead. + /// tally_params defines all the paramaters of related to tally. + #[deprecated] + #[prost(message, optional, tag = "7")] + pub tally_params: ::core::option::Option, + /// params defines all the paramaters of x/gov module. + /// + /// Since: cosmos-sdk 0.47 + #[prost(message, optional, tag = "8")] + pub params: ::core::option::Option, + /// The constitution allows builders to lay a foundation and define purpose. + /// This is an immutable string set in genesis. + /// There are no amendments, to go outside of scope, just fork. + /// constitution is an immutable string in genesis for a chain builder to lay out their vision, ideas and ideals. + /// + /// Since: cosmos-sdk 0.50 + #[prost(string, tag = "9")] + pub constitution: ::prost::alloc::string::String, +} +/// QueryConstitutionRequest is the request type for the Query/Constitution 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.gov.v1.QueryConstitutionRequest")] +#[proto_query( + path = "/cosmos.gov.v1.Query/Constitution", + response_type = QueryConstitutionResponse +)] +pub struct QueryConstitutionRequest {} +/// QueryConstitutionResponse is the response type for the Query/Constitution 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.gov.v1.QueryConstitutionResponse")] +pub struct QueryConstitutionResponse { + #[prost(string, tag = "1")] + pub constitution: ::prost::alloc::string::String, +} +/// QueryProposalRequest is the request type for the Query/Proposal 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.gov.v1.QueryProposalRequest")] +#[proto_query( + path = "/cosmos.gov.v1.Query/Proposal", + response_type = QueryProposalResponse +)] +pub struct QueryProposalRequest { + /// proposal_id defines the unique id of the proposal. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub proposal_id: u64, +} +/// QueryProposalResponse is the response type for the Query/Proposal 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.gov.v1.QueryProposalResponse")] +pub struct QueryProposalResponse { + /// proposal is the requested governance proposal. + #[prost(message, optional, tag = "1")] + pub proposal: ::core::option::Option, +} +/// QueryProposalsRequest is the request type for the Query/Proposals 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.gov.v1.QueryProposalsRequest")] +#[proto_query( + path = "/cosmos.gov.v1.Query/Proposals", + response_type = QueryProposalsResponse +)] +pub struct QueryProposalsRequest { + /// proposal_status defines the status of the proposals. + #[prost(enumeration = "ProposalStatus", tag = "1")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub proposal_status: i32, + /// voter defines the voter address for the proposals. + #[prost(string, tag = "2")] + pub voter: ::prost::alloc::string::String, + /// depositor defines the deposit addresses from the proposals. + #[prost(string, tag = "3")] + pub depositor: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "4")] + pub pagination: ::core::option::Option, +} +/// QueryProposalsResponse is the response type for the Query/Proposals 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.gov.v1.QueryProposalsResponse")] +pub struct QueryProposalsResponse { + /// proposals defines all the requested governance proposals. + #[prost(message, repeated, tag = "1")] + pub proposals: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryVoteRequest is the request type for the Query/Vote 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.gov.v1.QueryVoteRequest")] +#[proto_query(path = "/cosmos.gov.v1.Query/Vote", response_type = QueryVoteResponse)] +pub struct QueryVoteRequest { + /// proposal_id defines the unique id of the proposal. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub proposal_id: u64, + /// voter defines the voter address for the proposals. + #[prost(string, tag = "2")] + pub voter: ::prost::alloc::string::String, +} +/// QueryVoteResponse is the response type for the Query/Vote 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.gov.v1.QueryVoteResponse")] +pub struct QueryVoteResponse { + /// vote defines the queried vote. + #[prost(message, optional, tag = "1")] + pub vote: ::core::option::Option, +} +/// QueryVotesRequest is the request type for the Query/Votes 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.gov.v1.QueryVotesRequest")] +#[proto_query(path = "/cosmos.gov.v1.Query/Votes", response_type = QueryVotesResponse)] +pub struct QueryVotesRequest { + /// proposal_id defines the unique id of the proposal. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub proposal_id: u64, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryVotesResponse is the response type for the Query/Votes 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.gov.v1.QueryVotesResponse")] +pub struct QueryVotesResponse { + /// votes defines the queried votes. + #[prost(message, repeated, tag = "1")] + pub votes: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryParamsRequest is the request type for the Query/Params 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.gov.v1.QueryParamsRequest")] +#[proto_query(path = "/cosmos.gov.v1.Query/Params", response_type = QueryParamsResponse)] +pub struct QueryParamsRequest { + /// params_type defines which parameters to query for, can be one of "voting", + /// "tallying" or "deposit". + #[prost(string, tag = "1")] + pub params_type: ::prost::alloc::string::String, +} +/// QueryParamsResponse is the response type for the Query/Params 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.gov.v1.QueryParamsResponse")] +pub struct QueryParamsResponse { + /// Deprecated: Prefer to use `params` instead. + /// voting_params defines the parameters related to voting. + #[deprecated] + #[prost(message, optional, tag = "1")] + pub voting_params: ::core::option::Option, + /// Deprecated: Prefer to use `params` instead. + /// deposit_params defines the parameters related to deposit. + #[deprecated] + #[prost(message, optional, tag = "2")] + pub deposit_params: ::core::option::Option, + /// Deprecated: Prefer to use `params` instead. + /// tally_params defines the parameters related to tally. + #[deprecated] + #[prost(message, optional, tag = "3")] + pub tally_params: ::core::option::Option, + /// params defines all the paramaters of x/gov module. + /// + /// Since: cosmos-sdk 0.47 + #[prost(message, optional, tag = "4")] + pub params: ::core::option::Option, +} +/// QueryDepositRequest is the request type for the Query/Deposit 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.gov.v1.QueryDepositRequest")] +#[proto_query( + path = "/cosmos.gov.v1.Query/Deposit", + response_type = QueryDepositResponse +)] +pub struct QueryDepositRequest { + /// proposal_id defines the unique id of the proposal. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub proposal_id: u64, + /// depositor defines the deposit addresses from the proposals. + #[prost(string, tag = "2")] + pub depositor: ::prost::alloc::string::String, +} +/// QueryDepositResponse is the response type for the Query/Deposit 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.gov.v1.QueryDepositResponse")] +pub struct QueryDepositResponse { + /// deposit defines the requested deposit. + #[prost(message, optional, tag = "1")] + pub deposit: ::core::option::Option, +} +/// QueryDepositsRequest is the request type for the Query/Deposits 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.gov.v1.QueryDepositsRequest")] +#[proto_query( + path = "/cosmos.gov.v1.Query/Deposits", + response_type = QueryDepositsResponse +)] +pub struct QueryDepositsRequest { + /// proposal_id defines the unique id of the proposal. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub proposal_id: u64, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryDepositsResponse is the response type for the Query/Deposits 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.gov.v1.QueryDepositsResponse")] +pub struct QueryDepositsResponse { + /// deposits defines the requested deposits. + #[prost(message, repeated, tag = "1")] + pub deposits: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryTallyResultRequest is the request type for the Query/Tally 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.gov.v1.QueryTallyResultRequest")] +#[proto_query( + path = "/cosmos.gov.v1.Query/TallyResult", + response_type = QueryTallyResultResponse +)] +pub struct QueryTallyResultRequest { + /// proposal_id defines the unique id of the proposal. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub proposal_id: u64, +} +/// QueryTallyResultResponse is the response type for the Query/Tally 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.gov.v1.QueryTallyResultResponse")] +pub struct QueryTallyResultResponse { + /// tally defines the requested tally. + #[prost(message, optional, tag = "1")] + pub tally: ::core::option::Option, +} +/// MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary +/// proposal Content. +#[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.gov.v1.MsgSubmitProposal")] +pub struct MsgSubmitProposal { + /// messages are the arbitrary messages to be executed if proposal passes. + #[prost(message, repeated, tag = "1")] + pub messages: ::prost::alloc::vec::Vec, + /// initial_deposit is the deposit value that must be paid at proposal submission. + #[prost(message, repeated, tag = "2")] + pub initial_deposit: ::prost::alloc::vec::Vec, + /// proposer is the account address of the proposer. + #[prost(string, tag = "3")] + pub proposer: ::prost::alloc::string::String, + /// metadata is any arbitrary metadata attached to the proposal. + #[prost(string, tag = "4")] + pub metadata: ::prost::alloc::string::String, + /// title is the title of the proposal. + /// + /// Since: cosmos-sdk 0.47 + #[prost(string, tag = "5")] + pub title: ::prost::alloc::string::String, + /// summary is the summary of the proposal + /// + /// Since: cosmos-sdk 0.47 + #[prost(string, tag = "6")] + pub summary: ::prost::alloc::string::String, + /// expedited defines if the proposal is expedited or not + /// + /// Since: cosmos-sdk 0.50 + #[prost(bool, tag = "7")] + pub expedited: bool, +} +/// MsgSubmitProposalResponse defines the Msg/SubmitProposal 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.gov.v1.MsgSubmitProposalResponse")] +pub struct MsgSubmitProposalResponse { + /// proposal_id defines the unique id of the proposal. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub proposal_id: u64, +} +/// MsgExecLegacyContent is used to wrap the legacy content field into a message. +/// This ensures backwards compatibility with v1beta1.MsgSubmitProposal. +#[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.gov.v1.MsgExecLegacyContent")] +pub struct MsgExecLegacyContent { + /// content is the proposal's content. + #[prost(message, optional, tag = "1")] + pub content: ::core::option::Option, + /// authority must be the gov module address. + #[prost(string, tag = "2")] + pub authority: ::prost::alloc::string::String, +} +/// MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent 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.gov.v1.MsgExecLegacyContentResponse")] +pub struct MsgExecLegacyContentResponse {} +/// MsgVote defines a message to cast a vote. +#[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.gov.v1.MsgVote")] +pub struct MsgVote { + /// proposal_id defines the unique id of the proposal. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub proposal_id: u64, + /// voter is the voter address for the proposal. + #[prost(string, tag = "2")] + pub voter: ::prost::alloc::string::String, + /// option defines the vote option. + #[prost(enumeration = "VoteOption", tag = "3")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub option: i32, + /// metadata is any arbitrary metadata attached to the Vote. + #[prost(string, tag = "4")] + pub metadata: ::prost::alloc::string::String, +} +/// MsgVoteResponse defines the Msg/Vote 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.gov.v1.MsgVoteResponse")] +pub struct MsgVoteResponse {} +/// MsgVoteWeighted defines a message to cast a vote. +#[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.gov.v1.MsgVoteWeighted")] +pub struct MsgVoteWeighted { + /// proposal_id defines the unique id of the proposal. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub proposal_id: u64, + /// voter is the voter address for the proposal. + #[prost(string, tag = "2")] + pub voter: ::prost::alloc::string::String, + /// options defines the weighted vote options. + #[prost(message, repeated, tag = "3")] + pub options: ::prost::alloc::vec::Vec, + /// metadata is any arbitrary metadata attached to the VoteWeighted. + #[prost(string, tag = "4")] + pub metadata: ::prost::alloc::string::String, +} +/// MsgVoteWeightedResponse defines the Msg/VoteWeighted 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.gov.v1.MsgVoteWeightedResponse")] +pub struct MsgVoteWeightedResponse {} +/// MsgDeposit defines a message to submit a deposit to an existing proposal. +#[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.gov.v1.MsgDeposit")] +pub struct MsgDeposit { + /// proposal_id defines the unique id of the proposal. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub proposal_id: u64, + /// depositor defines the deposit addresses from the proposals. + #[prost(string, tag = "2")] + pub depositor: ::prost::alloc::string::String, + /// amount to be deposited by depositor. + #[prost(message, repeated, tag = "3")] + pub amount: ::prost::alloc::vec::Vec, +} +/// MsgDepositResponse defines the Msg/Deposit 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.gov.v1.MsgDepositResponse")] +pub struct MsgDepositResponse {} +/// MsgUpdateParams is the Msg/UpdateParams request type. +/// +/// Since: cosmos-sdk 0.47 +#[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.gov.v1.MsgUpdateParams")] +pub struct MsgUpdateParams { + /// authority is the address that controls the module (defaults to x/gov unless overwritten). + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// params defines the x/gov parameters to update. + /// + /// NOTE: All parameters must be supplied. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +/// MsgUpdateParamsResponse defines the response structure for executing a +/// MsgUpdateParams message. +/// +/// Since: cosmos-sdk 0.47 +#[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.gov.v1.MsgUpdateParamsResponse")] +pub struct MsgUpdateParamsResponse {} +/// MsgCancelProposal is the Msg/CancelProposal request type. +/// +/// Since: cosmos-sdk 0.50 +#[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.gov.v1.MsgCancelProposal")] +pub struct MsgCancelProposal { + /// proposal_id defines the unique id of the proposal. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub proposal_id: u64, + /// proposer is the account address of the proposer. + #[prost(string, tag = "2")] + pub proposer: ::prost::alloc::string::String, +} +/// MsgCancelProposalResponse defines the response structure for executing a +/// MsgCancelProposal message. +/// +/// Since: cosmos-sdk 0.50 +#[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.gov.v1.MsgCancelProposalResponse")] +pub struct MsgCancelProposalResponse { + /// proposal_id defines the unique id of the proposal. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub proposal_id: u64, + /// canceled_time is the time when proposal is canceled. + #[prost(message, optional, tag = "2")] + pub canceled_time: ::core::option::Option, + /// canceled_height defines the block height at which the proposal is canceled. + #[prost(uint64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub canceled_height: u64, +} +pub struct GovQuerier<'a, Q: cosmwasm_std::CustomQuery> { + querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, +} +impl<'a, Q: cosmwasm_std::CustomQuery> GovQuerier<'a, Q> { + pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self { + Self { querier } + } + pub fn constitution(&self) -> Result { + QueryConstitutionRequest {}.query(self.querier) + } + pub fn proposal( + &self, + proposal_id: u64, + ) -> Result { + QueryProposalRequest { proposal_id }.query(self.querier) + } + pub fn proposals( + &self, + proposal_status: i32, + voter: ::prost::alloc::string::String, + depositor: ::prost::alloc::string::String, + pagination: ::core::option::Option, + ) -> Result { + QueryProposalsRequest { + proposal_status, + voter, + depositor, + pagination, + } + .query(self.querier) + } + pub fn vote( + &self, + proposal_id: u64, + voter: ::prost::alloc::string::String, + ) -> Result { + QueryVoteRequest { proposal_id, voter }.query(self.querier) + } + pub fn votes( + &self, + proposal_id: u64, + pagination: ::core::option::Option, + ) -> Result { + QueryVotesRequest { + proposal_id, + pagination, + } + .query(self.querier) + } + pub fn params( + &self, + params_type: ::prost::alloc::string::String, + ) -> Result { + QueryParamsRequest { params_type }.query(self.querier) + } + pub fn deposit( + &self, + proposal_id: u64, + depositor: ::prost::alloc::string::String, + ) -> Result { + QueryDepositRequest { + proposal_id, + depositor, + } + .query(self.querier) + } + pub fn deposits( + &self, + proposal_id: u64, + pagination: ::core::option::Option, + ) -> Result { + QueryDepositsRequest { + proposal_id, + pagination, + } + .query(self.querier) + } + pub fn tally_result( + &self, + proposal_id: u64, + ) -> Result { + QueryTallyResultRequest { proposal_id }.query(self.querier) + } +} diff --git a/packages/provwasm-std/src/types/cosmos/gov/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/gov/v1beta1.rs index 1494ea4e..3200b0fe 100644 --- a/packages/provwasm-std/src/types/cosmos/gov/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/gov/v1beta1.rs @@ -1,4 +1,7 @@ use provwasm_proc_macro::CosmwasmExt; +/// WeightedVoteOption defines a unit of vote for vote split. +/// +/// Since: cosmos-sdk 0.43 #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -12,15 +15,41 @@ use provwasm_proc_macro::CosmwasmExt; )] #[proto_message(type_url = "/cosmos.gov.v1beta1.WeightedVoteOption")] pub struct WeightedVoteOption { + /// option defines the valid vote options, it must not contain duplicate vote options. #[prost(enumeration = "VoteOption", tag = "1")] #[serde( - serialize_with = "VoteOption::serialize", - deserialize_with = "VoteOption::deserialize" + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" )] pub option: i32, + /// weight is the vote weight associated with the vote option. #[prost(string, tag = "2")] pub weight: ::prost::alloc::string::String, } +/// TextProposal defines a standard text proposal whose changes need to be +/// manually updated in case of approval. +#[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.gov.v1beta1.TextProposal")] +pub struct TextProposal { + /// title of the proposal. + #[prost(string, tag = "1")] + pub title: ::prost::alloc::string::String, + /// description associated with the proposal. + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, +} +/// Deposit defines an amount deposited by an account address to an active +/// proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -34,18 +63,101 @@ pub struct WeightedVoteOption { )] #[proto_message(type_url = "/cosmos.gov.v1beta1.Deposit")] pub struct Deposit { + /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] - #[serde(alias = "proposalID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub proposal_id: u64, + /// depositor defines the deposit addresses from the proposals. #[prost(string, tag = "2")] pub depositor: ::prost::alloc::string::String, + /// amount to be deposited by depositor. #[prost(message, repeated, tag = "3")] pub amount: ::prost::alloc::vec::Vec, } +/// Proposal defines the core field members of a governance proposal. +#[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.gov.v1beta1.Proposal")] +pub struct Proposal { + /// proposal_id defines the unique id of the proposal. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub proposal_id: u64, + /// content is the proposal's content. + #[prost(message, optional, tag = "2")] + pub content: ::core::option::Option, + /// status defines the proposal status. + #[prost(enumeration = "ProposalStatus", tag = "3")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub status: i32, + /// final_tally_result is the final tally result of the proposal. When + /// querying a proposal via gRPC, this field is not populated until the + /// proposal's voting period has ended. + #[prost(message, optional, tag = "4")] + pub final_tally_result: ::core::option::Option, + /// submit_time is the time of proposal submission. + #[prost(message, optional, tag = "5")] + pub submit_time: ::core::option::Option, + /// deposit_end_time is the end time for deposition. + #[prost(message, optional, tag = "6")] + pub deposit_end_time: ::core::option::Option, + /// total_deposit is the total deposit on the proposal. + #[prost(message, repeated, tag = "7")] + pub total_deposit: ::prost::alloc::vec::Vec, + /// voting_start_time is the starting time to vote on a proposal. + #[prost(message, optional, tag = "8")] + pub voting_start_time: ::core::option::Option, + /// voting_end_time is the end time of voting on a proposal. + #[prost(message, optional, tag = "9")] + pub voting_end_time: ::core::option::Option, +} +/// TallyResult defines a standard tally for a governance proposal. +#[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.gov.v1beta1.TallyResult")] +pub struct TallyResult { + /// yes is the number of yes votes on a proposal. + #[prost(string, tag = "1")] + pub yes: ::prost::alloc::string::String, + /// abstain is the number of abstain votes on a proposal. + #[prost(string, tag = "2")] + pub abstain: ::prost::alloc::string::String, + /// no is the number of no votes on a proposal. + #[prost(string, tag = "3")] + pub no: ::prost::alloc::string::String, + /// no_with_veto is the number of no with veto votes on a proposal. + #[prost(string, tag = "4")] + pub no_with_veto: ::prost::alloc::string::String, +} +/// Vote defines a vote on a governance proposal. +/// A Vote consists of a proposal ID, the voter, and the vote option. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -59,25 +171,33 @@ pub struct Deposit { )] #[proto_message(type_url = "/cosmos.gov.v1beta1.Vote")] pub struct Vote { + /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] - #[serde(alias = "proposalID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub proposal_id: u64, + /// voter is the voter address of the proposal. #[prost(string, tag = "2")] pub voter: ::prost::alloc::string::String, + /// Deprecated: Prefer to use `options` instead. This field is set in queries + /// if and only if `len(options) == 1` and that option has weight 1. In all + /// other cases, this field will default to VOTE_OPTION_UNSPECIFIED. #[deprecated] #[prost(enumeration = "VoteOption", tag = "3")] #[serde( - serialize_with = "VoteOption::serialize", - deserialize_with = "VoteOption::deserialize" + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" )] pub option: i32, + /// options is the weighted vote options. + /// + /// Since: cosmos-sdk 0.43 #[prost(message, repeated, tag = "4")] pub options: ::prost::alloc::vec::Vec, } +/// DepositParams defines the params for deposits on governance proposals. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -91,11 +211,15 @@ pub struct Vote { )] #[proto_message(type_url = "/cosmos.gov.v1beta1.DepositParams")] pub struct DepositParams { + /// Minimum deposit for a proposal to enter voting period. #[prost(message, repeated, tag = "1")] pub min_deposit: ::prost::alloc::vec::Vec, + /// Maximum period for Atom holders to deposit on a proposal. Initial value: 2 + /// months. #[prost(message, optional, tag = "2")] pub max_deposit_period: ::core::option::Option, } +/// VotingParams defines the params for voting on governance proposals. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -109,9 +233,11 @@ pub struct DepositParams { )] #[proto_message(type_url = "/cosmos.gov.v1beta1.VotingParams")] pub struct VotingParams { + /// Duration of the voting period. #[prost(message, optional, tag = "1")] pub voting_period: ::core::option::Option, } +/// TallyParams defines the params for tallying votes on governance proposals. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -125,18 +251,23 @@ pub struct VotingParams { )] #[proto_message(type_url = "/cosmos.gov.v1beta1.TallyParams")] pub struct TallyParams { + /// Minimum percentage of total stake needed to vote for a result to be + /// considered valid. #[prost(bytes = "vec", tag = "1")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" )] pub quorum: ::prost::alloc::vec::Vec, + /// Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. #[prost(bytes = "vec", tag = "2")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" )] pub threshold: ::prost::alloc::vec::Vec, + /// Minimum value of Veto votes to Total votes ratio for proposal to be + /// vetoed. Default value: 1/3. #[prost(bytes = "vec", tag = "3")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", @@ -144,14 +275,20 @@ pub struct TallyParams { )] pub veto_threshold: ::prost::alloc::vec::Vec, } +/// VoteOption enumerates the valid vote options for a given governance proposal. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] #[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] pub enum VoteOption { + /// VOTE_OPTION_UNSPECIFIED defines a no-op vote option. Unspecified = 0, + /// VOTE_OPTION_YES defines a yes vote option. Yes = 1, + /// VOTE_OPTION_ABSTAIN defines an abstain vote option. Abstain = 2, + /// VOTE_OPTION_NO defines a no vote option. No = 3, + /// VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. NoWithVeto = 4, } impl VoteOption { @@ -179,30 +316,199 @@ impl VoteOption { _ => None, } } - - pub fn serialize(v: &i32, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - let enum_value = Self::try_from(*v); - match enum_value { - Ok(v) => serializer.serialize_str(v.as_str_name()), - Err(e) => Err(serde::ser::Error::custom(e)), +} +/// ProposalStatus enumerates the valid statuses of a proposal. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +pub enum ProposalStatus { + /// PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. + Unspecified = 0, + /// PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit + /// period. + DepositPeriod = 1, + /// PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting + /// period. + VotingPeriod = 2, + /// PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has + /// passed. + Passed = 3, + /// PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has + /// been rejected. + Rejected = 4, + /// PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has + /// failed. + Failed = 5, +} +impl ProposalStatus { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + ProposalStatus::Unspecified => "PROPOSAL_STATUS_UNSPECIFIED", + ProposalStatus::DepositPeriod => "PROPOSAL_STATUS_DEPOSIT_PERIOD", + ProposalStatus::VotingPeriod => "PROPOSAL_STATUS_VOTING_PERIOD", + ProposalStatus::Passed => "PROPOSAL_STATUS_PASSED", + ProposalStatus::Rejected => "PROPOSAL_STATUS_REJECTED", + ProposalStatus::Failed => "PROPOSAL_STATUS_FAILED", } } - - pub fn deserialize<'de, D>(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - use serde::de::Deserialize; - let s = String::deserialize(deserializer)?; - match Self::from_str_name(&s) { - Some(v) => Ok(v.into()), - None => Err(serde::de::Error::custom("unknown value")), + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "PROPOSAL_STATUS_UNSPECIFIED" => Some(Self::Unspecified), + "PROPOSAL_STATUS_DEPOSIT_PERIOD" => Some(Self::DepositPeriod), + "PROPOSAL_STATUS_VOTING_PERIOD" => Some(Self::VotingPeriod), + "PROPOSAL_STATUS_PASSED" => Some(Self::Passed), + "PROPOSAL_STATUS_REJECTED" => Some(Self::Rejected), + "PROPOSAL_STATUS_FAILED" => Some(Self::Failed), + _ => None, } } } +/// GenesisState defines the gov module's genesis state. +#[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.gov.v1beta1.GenesisState")] +pub struct GenesisState { + /// starting_proposal_id is the ID of the starting proposal. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub starting_proposal_id: u64, + /// deposits defines all the deposits present at genesis. + #[prost(message, repeated, tag = "2")] + pub deposits: ::prost::alloc::vec::Vec, + /// votes defines all the votes present at genesis. + #[prost(message, repeated, tag = "3")] + pub votes: ::prost::alloc::vec::Vec, + /// proposals defines all the proposals present at genesis. + #[prost(message, repeated, tag = "4")] + pub proposals: ::prost::alloc::vec::Vec, + /// deposit_params defines all the parameters related to deposit. + #[prost(message, optional, tag = "5")] + pub deposit_params: ::core::option::Option, + /// voting_params defines all the parameters related to voting. + #[prost(message, optional, tag = "6")] + pub voting_params: ::core::option::Option, + /// tally_params defines all the parameters related to tally. + #[prost(message, optional, tag = "7")] + pub tally_params: ::core::option::Option, +} +/// QueryProposalRequest is the request type for the Query/Proposal 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.gov.v1beta1.QueryProposalRequest")] +#[proto_query( + path = "/cosmos.gov.v1beta1.Query/Proposal", + response_type = QueryProposalResponse +)] +pub struct QueryProposalRequest { + /// proposal_id defines the unique id of the proposal. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub proposal_id: u64, +} +/// QueryProposalResponse is the response type for the Query/Proposal 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.gov.v1beta1.QueryProposalResponse")] +pub struct QueryProposalResponse { + #[prost(message, optional, tag = "1")] + pub proposal: ::core::option::Option, +} +/// QueryProposalsRequest is the request type for the Query/Proposals 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.gov.v1beta1.QueryProposalsRequest")] +#[proto_query( + path = "/cosmos.gov.v1beta1.Query/Proposals", + response_type = QueryProposalsResponse +)] +pub struct QueryProposalsRequest { + /// proposal_status defines the status of the proposals. + #[prost(enumeration = "ProposalStatus", tag = "1")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub proposal_status: i32, + /// voter defines the voter address for the proposals. + #[prost(string, tag = "2")] + pub voter: ::prost::alloc::string::String, + /// depositor defines the deposit addresses from the proposals. + #[prost(string, tag = "3")] + pub depositor: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "4")] + pub pagination: ::core::option::Option, +} +/// QueryProposalsResponse is the response type for the Query/Proposals 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.gov.v1beta1.QueryProposalsResponse")] +pub struct QueryProposalsResponse { + /// proposals defines all the requested governance proposals. + #[prost(message, repeated, tag = "1")] + pub proposals: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryVoteRequest is the request type for the Query/Vote RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -220,16 +526,18 @@ impl VoteOption { response_type = QueryVoteResponse )] pub struct QueryVoteRequest { + /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] - #[serde(alias = "proposalID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub proposal_id: u64, + /// voter defines the voter address for the proposals. #[prost(string, tag = "2")] pub voter: ::prost::alloc::string::String, } +/// QueryVoteResponse is the response type for the Query/Vote RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -243,9 +551,61 @@ pub struct QueryVoteRequest { )] #[proto_message(type_url = "/cosmos.gov.v1beta1.QueryVoteResponse")] pub struct QueryVoteResponse { + /// vote defines the queried vote. #[prost(message, optional, tag = "1")] pub vote: ::core::option::Option, } +/// QueryVotesRequest is the request type for the Query/Votes 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.gov.v1beta1.QueryVotesRequest")] +#[proto_query( + path = "/cosmos.gov.v1beta1.Query/Votes", + response_type = QueryVotesResponse +)] +pub struct QueryVotesRequest { + /// proposal_id defines the unique id of the proposal. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub proposal_id: u64, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryVotesResponse is the response type for the Query/Votes 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.gov.v1beta1.QueryVotesResponse")] +pub struct QueryVotesResponse { + /// votes defines the queried votes. + #[prost(message, repeated, tag = "1")] + pub votes: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryParamsRequest is the request type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -263,9 +623,12 @@ pub struct QueryVoteResponse { response_type = QueryParamsResponse )] pub struct QueryParamsRequest { + /// params_type defines which parameters to query for, can be one of "voting", + /// "tallying" or "deposit". #[prost(string, tag = "1")] pub params_type: ::prost::alloc::string::String, } +/// QueryParamsResponse is the response type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -279,13 +642,17 @@ pub struct QueryParamsRequest { )] #[proto_message(type_url = "/cosmos.gov.v1beta1.QueryParamsResponse")] pub struct QueryParamsResponse { + /// voting_params defines the parameters related to voting. #[prost(message, optional, tag = "1")] pub voting_params: ::core::option::Option, + /// deposit_params defines the parameters related to deposit. #[prost(message, optional, tag = "2")] pub deposit_params: ::core::option::Option, + /// tally_params defines the parameters related to tally. #[prost(message, optional, tag = "3")] pub tally_params: ::core::option::Option, } +/// QueryDepositRequest is the request type for the Query/Deposit RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -303,16 +670,18 @@ pub struct QueryParamsResponse { response_type = QueryDepositResponse )] pub struct QueryDepositRequest { + /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] - #[serde(alias = "proposalID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub proposal_id: u64, + /// depositor defines the deposit addresses from the proposals. #[prost(string, tag = "2")] pub depositor: ::prost::alloc::string::String, } +/// QueryDepositResponse is the response type for the Query/Deposit RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -326,9 +695,106 @@ pub struct QueryDepositRequest { )] #[proto_message(type_url = "/cosmos.gov.v1beta1.QueryDepositResponse")] pub struct QueryDepositResponse { + /// deposit defines the requested deposit. #[prost(message, optional, tag = "1")] pub deposit: ::core::option::Option, } +/// QueryDepositsRequest is the request type for the Query/Deposits 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.gov.v1beta1.QueryDepositsRequest")] +#[proto_query( + path = "/cosmos.gov.v1beta1.Query/Deposits", + response_type = QueryDepositsResponse +)] +pub struct QueryDepositsRequest { + /// proposal_id defines the unique id of the proposal. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub proposal_id: u64, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryDepositsResponse is the response type for the Query/Deposits 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.gov.v1beta1.QueryDepositsResponse")] +pub struct QueryDepositsResponse { + /// deposits defines the requested deposits. + #[prost(message, repeated, tag = "1")] + pub deposits: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryTallyResultRequest is the request type for the Query/Tally 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.gov.v1beta1.QueryTallyResultRequest")] +#[proto_query( + path = "/cosmos.gov.v1beta1.Query/TallyResult", + response_type = QueryTallyResultResponse +)] +pub struct QueryTallyResultRequest { + /// proposal_id defines the unique id of the proposal. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub proposal_id: u64, +} +/// QueryTallyResultResponse is the response type for the Query/Tally 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.gov.v1beta1.QueryTallyResultResponse")] +pub struct QueryTallyResultResponse { + /// tally defines the requested tally. + #[prost(message, optional, tag = "1")] + pub tally: ::core::option::Option, +} +/// MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary +/// proposal Content. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -342,13 +808,17 @@ pub struct QueryDepositResponse { )] #[proto_message(type_url = "/cosmos.gov.v1beta1.MsgSubmitProposal")] pub struct MsgSubmitProposal { + /// content is the proposal's content. #[prost(message, optional, tag = "1")] pub content: ::core::option::Option, + /// initial_deposit is the deposit value that must be paid at proposal submission. #[prost(message, repeated, tag = "2")] pub initial_deposit: ::prost::alloc::vec::Vec, + /// proposer is the account address of the proposer. #[prost(string, tag = "3")] pub proposer: ::prost::alloc::string::String, } +/// MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -362,14 +832,15 @@ pub struct MsgSubmitProposal { )] #[proto_message(type_url = "/cosmos.gov.v1beta1.MsgSubmitProposalResponse")] pub struct MsgSubmitProposalResponse { + /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] - #[serde(alias = "proposalID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub proposal_id: u64, } +/// MsgVote defines a message to cast a vote. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -383,22 +854,25 @@ pub struct MsgSubmitProposalResponse { )] #[proto_message(type_url = "/cosmos.gov.v1beta1.MsgVote")] pub struct MsgVote { + /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] - #[serde(alias = "proposalID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub proposal_id: u64, + /// voter is the voter address for the proposal. #[prost(string, tag = "2")] pub voter: ::prost::alloc::string::String, + /// option defines the vote option. #[prost(enumeration = "VoteOption", tag = "3")] #[serde( - serialize_with = "VoteOption::serialize", - deserialize_with = "VoteOption::deserialize" + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" )] pub option: i32, } +/// MsgVoteResponse defines the Msg/Vote response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -412,6 +886,94 @@ pub struct MsgVote { )] #[proto_message(type_url = "/cosmos.gov.v1beta1.MsgVoteResponse")] pub struct MsgVoteResponse {} +/// MsgVoteWeighted defines a message to cast a vote. +/// +/// Since: cosmos-sdk 0.43 +#[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.gov.v1beta1.MsgVoteWeighted")] +pub struct MsgVoteWeighted { + /// proposal_id defines the unique id of the proposal. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub proposal_id: u64, + /// voter is the voter address for the proposal. + #[prost(string, tag = "2")] + pub voter: ::prost::alloc::string::String, + /// options defines the weighted vote options. + #[prost(message, repeated, tag = "3")] + pub options: ::prost::alloc::vec::Vec, +} +/// MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. +/// +/// Since: cosmos-sdk 0.43 +#[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.gov.v1beta1.MsgVoteWeightedResponse")] +pub struct MsgVoteWeightedResponse {} +/// MsgDeposit defines a message to submit a deposit to an existing proposal. +#[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.gov.v1beta1.MsgDeposit")] +pub struct MsgDeposit { + /// proposal_id defines the unique id of the proposal. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub proposal_id: u64, + /// depositor defines the deposit addresses from the proposals. + #[prost(string, tag = "2")] + pub depositor: ::prost::alloc::string::String, + /// amount to be deposited by depositor. + #[prost(message, repeated, tag = "3")] + pub amount: ::prost::alloc::vec::Vec, +} +/// MsgDepositResponse defines the Msg/Deposit 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.gov.v1beta1.MsgDepositResponse")] +pub struct MsgDepositResponse {} pub struct GovQuerier<'a, Q: cosmwasm_std::CustomQuery> { querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, } @@ -419,6 +981,27 @@ impl<'a, Q: cosmwasm_std::CustomQuery> GovQuerier<'a, Q> { pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self { Self { querier } } + pub fn proposal( + &self, + proposal_id: u64, + ) -> Result { + QueryProposalRequest { proposal_id }.query(self.querier) + } + pub fn proposals( + &self, + proposal_status: i32, + voter: ::prost::alloc::string::String, + depositor: ::prost::alloc::string::String, + pagination: ::core::option::Option, + ) -> Result { + QueryProposalsRequest { + proposal_status, + voter, + depositor, + pagination, + } + .query(self.querier) + } pub fn vote( &self, proposal_id: u64, @@ -426,6 +1009,17 @@ impl<'a, Q: cosmwasm_std::CustomQuery> GovQuerier<'a, Q> { ) -> Result { QueryVoteRequest { proposal_id, voter }.query(self.querier) } + pub fn votes( + &self, + proposal_id: u64, + pagination: ::core::option::Option, + ) -> Result { + QueryVotesRequest { + proposal_id, + pagination, + } + .query(self.querier) + } pub fn params( &self, params_type: ::prost::alloc::string::String, @@ -443,4 +1037,21 @@ impl<'a, Q: cosmwasm_std::CustomQuery> GovQuerier<'a, Q> { } .query(self.querier) } + pub fn deposits( + &self, + proposal_id: u64, + pagination: ::core::option::Option, + ) -> Result { + QueryDepositsRequest { + proposal_id, + pagination, + } + .query(self.querier) + } + pub fn tally_result( + &self, + proposal_id: u64, + ) -> Result { + QueryTallyResultRequest { proposal_id }.query(self.querier) + } } diff --git a/packages/provwasm-std/src/types/cosmos/group/mod.rs b/packages/provwasm-std/src/types/cosmos/group/mod.rs new file mode 100644 index 00000000..a8429e39 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/group/mod.rs @@ -0,0 +1,2 @@ +pub mod module; +pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/group/module/mod.rs b/packages/provwasm-std/src/types/cosmos/group/module/mod.rs new file mode 100644 index 00000000..a3a6d96c --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/group/module/mod.rs @@ -0,0 +1 @@ +pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/group/module/v1.rs b/packages/provwasm-std/src/types/cosmos/group/module/v1.rs new file mode 100644 index 00000000..2a9168c5 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/group/module/v1.rs @@ -0,0 +1,28 @@ +use provwasm_proc_macro::CosmwasmExt; +/// Module is the config object of the group 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.group.module.v1.Module")] +pub struct Module { + /// max_execution_period defines the max duration after a proposal's voting period ends that members can send a MsgExec + /// to execute the proposal. + #[prost(message, optional, tag = "1")] + pub max_execution_period: ::core::option::Option, + /// max_metadata_len defines the max length of the metadata bytes field for various entities within the group module. + /// Defaults to 255 if not explicitly set. + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub max_metadata_len: u64, +} diff --git a/packages/provwasm-std/src/types/cosmos/group/v1.rs b/packages/provwasm-std/src/types/cosmos/group/v1.rs new file mode 100644 index 00000000..87ff48a8 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/group/v1.rs @@ -0,0 +1,2288 @@ +use provwasm_proc_macro::CosmwasmExt; +/// Member represents a group member with an account address, +/// non-zero weight, metadata and added_at timestamp. +#[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.group.v1.Member")] +pub struct Member { + /// address is the member's account address. + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// weight is the member's voting weight that should be greater than 0. + #[prost(string, tag = "2")] + pub weight: ::prost::alloc::string::String, + /// metadata is any arbitrary metadata attached to the member. + #[prost(string, tag = "3")] + pub metadata: ::prost::alloc::string::String, + /// added_at is a timestamp specifying when a member was added. + #[prost(message, optional, tag = "4")] + pub added_at: ::core::option::Option, +} +/// MemberRequest represents a group member to be used in Msg server requests. +/// Contrary to `Member`, it doesn't have any `added_at` field +/// since this field cannot be set as part of requests. +#[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.group.v1.MemberRequest")] +pub struct MemberRequest { + /// address is the member's account address. + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// weight is the member's voting weight that should be greater than 0. + #[prost(string, tag = "2")] + pub weight: ::prost::alloc::string::String, + /// metadata is any arbitrary metadata attached to the member. + #[prost(string, tag = "3")] + pub metadata: ::prost::alloc::string::String, +} +/// ThresholdDecisionPolicy is a decision policy where a proposal passes when it +/// satisfies the two following conditions: +/// 1. The sum of all `YES` voter's weights is greater or equal than the defined +/// `threshold`. +/// 2. The voting and execution periods of the proposal respect the parameters +/// given by `windows`. +#[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.group.v1.ThresholdDecisionPolicy")] +pub struct ThresholdDecisionPolicy { + /// threshold is the minimum weighted sum of `YES` votes that must be met or + /// exceeded for a proposal to succeed. + #[prost(string, tag = "1")] + pub threshold: ::prost::alloc::string::String, + /// windows defines the different windows for voting and execution. + #[prost(message, optional, tag = "2")] + pub windows: ::core::option::Option, +} +/// PercentageDecisionPolicy is a decision policy where a proposal passes when +/// it satisfies the two following conditions: +/// 1. The percentage of all `YES` voters' weights out of the total group weight +/// is greater or equal than the given `percentage`. +/// 2. The voting and execution periods of the proposal respect the parameters +/// given by `windows`. +#[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.group.v1.PercentageDecisionPolicy")] +pub struct PercentageDecisionPolicy { + /// percentage is the minimum percentage of the weighted sum of `YES` votes must + /// meet for a proposal to succeed. + #[prost(string, tag = "1")] + pub percentage: ::prost::alloc::string::String, + /// windows defines the different windows for voting and execution. + #[prost(message, optional, tag = "2")] + pub windows: ::core::option::Option, +} +/// DecisionPolicyWindows defines the different windows for voting and execution. +#[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.group.v1.DecisionPolicyWindows")] +pub struct DecisionPolicyWindows { + /// voting_period is the duration from submission of a proposal to the end of voting period + /// Within this times votes can be submitted with MsgVote. + #[prost(message, optional, tag = "1")] + pub voting_period: ::core::option::Option, + /// min_execution_period is the minimum duration after the proposal submission + /// where members can start sending MsgExec. This means that the window for + /// sending a MsgExec transaction is: + /// `\[ submission + min_execution_period ; submission + voting_period + max_execution_period\]` + /// where max_execution_period is a app-specific config, defined in the keeper. + /// If not set, min_execution_period will default to 0. + /// + /// Please make sure to set a `min_execution_period` that is smaller than + /// `voting_period + max_execution_period`, or else the above execution window + /// is empty, meaning that all proposals created with this decision policy + /// won't be able to be executed. + #[prost(message, optional, tag = "2")] + pub min_execution_period: ::core::option::Option, +} +/// GroupInfo represents the high-level on-chain information for a group. +#[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.group.v1.GroupInfo")] +pub struct GroupInfo { + /// id is the unique ID of the group. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub id: u64, + /// admin is the account address of the group's admin. + #[prost(string, tag = "2")] + pub admin: ::prost::alloc::string::String, + /// metadata is any arbitrary metadata to attached to the group. + /// the recommended format of the metadata is to be found here: + #[prost(string, tag = "3")] + pub metadata: ::prost::alloc::string::String, + /// version is used to track changes to a group's membership structure that + /// would break existing proposals. Whenever any members weight is changed, + /// or any member is added or removed this version is incremented and will + /// cause proposals based on older versions of this group to fail + #[prost(uint64, tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub version: u64, + /// total_weight is the sum of the group members' weights. + #[prost(string, tag = "5")] + pub total_weight: ::prost::alloc::string::String, + /// created_at is a timestamp specifying when a group was created. + #[prost(message, optional, tag = "6")] + pub created_at: ::core::option::Option, +} +/// GroupMember represents the relationship between a group and a member. +#[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.group.v1.GroupMember")] +pub struct GroupMember { + /// group_id is the unique ID of the group. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub group_id: u64, + /// member is the member data. + #[prost(message, optional, tag = "2")] + pub member: ::core::option::Option, +} +/// GroupPolicyInfo represents the high-level on-chain information for a group policy. +#[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.group.v1.GroupPolicyInfo")] +pub struct GroupPolicyInfo { + /// address is the account address of group policy. + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// group_id is the unique ID of the group. + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub group_id: u64, + /// admin is the account address of the group admin. + #[prost(string, tag = "3")] + pub admin: ::prost::alloc::string::String, + /// metadata is any arbitrary metadata attached to the group policy. + /// the recommended format of the metadata is to be found here: + /// + #[prost(string, tag = "4")] + pub metadata: ::prost::alloc::string::String, + /// version is used to track changes to a group's GroupPolicyInfo structure that + /// would create a different result on a running proposal. + #[prost(uint64, tag = "5")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub version: u64, + /// decision_policy specifies the group policy's decision policy. + #[prost(message, optional, tag = "6")] + pub decision_policy: ::core::option::Option, + /// created_at is a timestamp specifying when a group policy was created. + #[prost(message, optional, tag = "7")] + pub created_at: ::core::option::Option, +} +/// Proposal defines a group proposal. Any member of a group can submit a proposal +/// for a group policy to decide upon. +/// A proposal consists of a set of `sdk.Msg`s that will be executed if the proposal +/// passes as well as some optional metadata associated with the proposal. +#[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.group.v1.Proposal")] +pub struct Proposal { + /// id is the unique id of the proposal. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub id: u64, + /// group_policy_address is the account address of group policy. + #[prost(string, tag = "2")] + pub group_policy_address: ::prost::alloc::string::String, + /// metadata is any arbitrary metadata attached to the proposal. + /// the recommended format of the metadata is to be found here: + /// + #[prost(string, tag = "3")] + pub metadata: ::prost::alloc::string::String, + /// proposers are the account addresses of the proposers. + #[prost(string, repeated, tag = "4")] + pub proposers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// submit_time is a timestamp specifying when a proposal was submitted. + #[prost(message, optional, tag = "5")] + pub submit_time: ::core::option::Option, + /// group_version tracks the version of the group at proposal submission. + /// This field is here for informational purposes only. + #[prost(uint64, tag = "6")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub group_version: u64, + /// group_policy_version tracks the version of the group policy at proposal submission. + /// When a decision policy is changed, existing proposals from previous policy + /// versions will become invalid with the `ABORTED` status. + /// This field is here for informational purposes only. + #[prost(uint64, tag = "7")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub group_policy_version: u64, + /// status represents the high level position in the life cycle of the proposal. Initial value is Submitted. + #[prost(enumeration = "ProposalStatus", tag = "8")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub status: i32, + /// final_tally_result contains the sums of all weighted votes for this + /// proposal for each vote option. It is empty at submission, and only + /// populated after tallying, at voting period end or at proposal execution, + /// whichever happens first. + #[prost(message, optional, tag = "9")] + pub final_tally_result: ::core::option::Option, + /// voting_period_end is the timestamp before which voting must be done. + /// Unless a successful MsgExec is called before (to execute a proposal whose + /// tally is successful before the voting period ends), tallying will be done + /// at this point, and the `final_tally_result`and `status` fields will be + /// accordingly updated. + #[prost(message, optional, tag = "10")] + pub voting_period_end: ::core::option::Option, + /// executor_result is the final result of the proposal execution. Initial value is NotRun. + #[prost(enumeration = "ProposalExecutorResult", tag = "11")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub executor_result: i32, + /// messages is a list of `sdk.Msg`s that will be executed if the proposal passes. + #[prost(message, repeated, tag = "12")] + pub messages: ::prost::alloc::vec::Vec, + /// title is the title of the proposal + /// + /// Since: cosmos-sdk 0.47 + #[prost(string, tag = "13")] + pub title: ::prost::alloc::string::String, + /// summary is a short summary of the proposal + /// + /// Since: cosmos-sdk 0.47 + #[prost(string, tag = "14")] + pub summary: ::prost::alloc::string::String, +} +/// TallyResult represents the sum of weighted votes for each vote option. +#[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.group.v1.TallyResult")] +pub struct TallyResult { + /// yes_count is the weighted sum of yes votes. + #[prost(string, tag = "1")] + pub yes_count: ::prost::alloc::string::String, + /// abstain_count is the weighted sum of abstainers. + #[prost(string, tag = "2")] + pub abstain_count: ::prost::alloc::string::String, + /// no_count is the weighted sum of no votes. + #[prost(string, tag = "3")] + pub no_count: ::prost::alloc::string::String, + /// no_with_veto_count is the weighted sum of veto. + #[prost(string, tag = "4")] + pub no_with_veto_count: ::prost::alloc::string::String, +} +/// Vote represents a vote for a proposal.string metadata +#[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.group.v1.Vote")] +pub struct Vote { + /// proposal is the unique ID of the proposal. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub proposal_id: u64, + /// voter is the account address of the voter. + #[prost(string, tag = "2")] + pub voter: ::prost::alloc::string::String, + /// option is the voter's choice on the proposal. + #[prost(enumeration = "VoteOption", tag = "3")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub option: i32, + /// metadata is any arbitrary metadata attached to the vote. + /// the recommended format of the metadata is to be found here: + #[prost(string, tag = "4")] + pub metadata: ::prost::alloc::string::String, + /// submit_time is the timestamp when the vote was submitted. + #[prost(message, optional, tag = "5")] + pub submit_time: ::core::option::Option, +} +/// VoteOption enumerates the valid vote options for a given proposal. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +pub enum VoteOption { + /// VOTE_OPTION_UNSPECIFIED defines an unspecified vote option which will + /// return an error. + Unspecified = 0, + /// VOTE_OPTION_YES defines a yes vote option. + Yes = 1, + /// VOTE_OPTION_ABSTAIN defines an abstain vote option. + Abstain = 2, + /// VOTE_OPTION_NO defines a no vote option. + No = 3, + /// VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. + NoWithVeto = 4, +} +impl VoteOption { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + VoteOption::Unspecified => "VOTE_OPTION_UNSPECIFIED", + VoteOption::Yes => "VOTE_OPTION_YES", + VoteOption::Abstain => "VOTE_OPTION_ABSTAIN", + VoteOption::No => "VOTE_OPTION_NO", + VoteOption::NoWithVeto => "VOTE_OPTION_NO_WITH_VETO", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "VOTE_OPTION_UNSPECIFIED" => Some(Self::Unspecified), + "VOTE_OPTION_YES" => Some(Self::Yes), + "VOTE_OPTION_ABSTAIN" => Some(Self::Abstain), + "VOTE_OPTION_NO" => Some(Self::No), + "VOTE_OPTION_NO_WITH_VETO" => Some(Self::NoWithVeto), + _ => None, + } + } +} +/// ProposalStatus defines proposal statuses. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +pub enum ProposalStatus { + /// An empty value is invalid and not allowed. + Unspecified = 0, + /// Initial status of a proposal when submitted. + Submitted = 1, + /// Final status of a proposal when the final tally is done and the outcome + /// passes the group policy's decision policy. + Accepted = 2, + /// Final status of a proposal when the final tally is done and the outcome + /// is rejected by the group policy's decision policy. + Rejected = 3, + /// Final status of a proposal when the group policy is modified before the + /// final tally. + Aborted = 4, + /// A proposal can be withdrawn before the voting start time by the owner. + /// When this happens the final status is Withdrawn. + Withdrawn = 5, +} +impl ProposalStatus { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + ProposalStatus::Unspecified => "PROPOSAL_STATUS_UNSPECIFIED", + ProposalStatus::Submitted => "PROPOSAL_STATUS_SUBMITTED", + ProposalStatus::Accepted => "PROPOSAL_STATUS_ACCEPTED", + ProposalStatus::Rejected => "PROPOSAL_STATUS_REJECTED", + ProposalStatus::Aborted => "PROPOSAL_STATUS_ABORTED", + ProposalStatus::Withdrawn => "PROPOSAL_STATUS_WITHDRAWN", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "PROPOSAL_STATUS_UNSPECIFIED" => Some(Self::Unspecified), + "PROPOSAL_STATUS_SUBMITTED" => Some(Self::Submitted), + "PROPOSAL_STATUS_ACCEPTED" => Some(Self::Accepted), + "PROPOSAL_STATUS_REJECTED" => Some(Self::Rejected), + "PROPOSAL_STATUS_ABORTED" => Some(Self::Aborted), + "PROPOSAL_STATUS_WITHDRAWN" => Some(Self::Withdrawn), + _ => None, + } + } +} +/// ProposalExecutorResult defines types of proposal executor results. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +pub enum ProposalExecutorResult { + /// An empty value is not allowed. + Unspecified = 0, + /// We have not yet run the executor. + NotRun = 1, + /// The executor was successful and proposed action updated state. + Success = 2, + /// The executor returned an error and proposed action didn't update state. + Failure = 3, +} +impl ProposalExecutorResult { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + ProposalExecutorResult::Unspecified => "PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED", + ProposalExecutorResult::NotRun => "PROPOSAL_EXECUTOR_RESULT_NOT_RUN", + ProposalExecutorResult::Success => "PROPOSAL_EXECUTOR_RESULT_SUCCESS", + ProposalExecutorResult::Failure => "PROPOSAL_EXECUTOR_RESULT_FAILURE", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED" => Some(Self::Unspecified), + "PROPOSAL_EXECUTOR_RESULT_NOT_RUN" => Some(Self::NotRun), + "PROPOSAL_EXECUTOR_RESULT_SUCCESS" => Some(Self::Success), + "PROPOSAL_EXECUTOR_RESULT_FAILURE" => Some(Self::Failure), + _ => None, + } + } +} +/// EventCreateGroup is an event emitted when a group is created. +#[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.group.v1.EventCreateGroup")] +pub struct EventCreateGroup { + /// group_id is the unique ID of the group. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub group_id: u64, +} +/// EventUpdateGroup is an event emitted when a group is updated. +#[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.group.v1.EventUpdateGroup")] +pub struct EventUpdateGroup { + /// group_id is the unique ID of the group. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub group_id: u64, +} +/// EventCreateGroupPolicy is an event emitted when a group policy is created. +#[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.group.v1.EventCreateGroupPolicy")] +pub struct EventCreateGroupPolicy { + /// address is the account address of the group policy. + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, +} +/// EventUpdateGroupPolicy is an event emitted when a group policy is updated. +#[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.group.v1.EventUpdateGroupPolicy")] +pub struct EventUpdateGroupPolicy { + /// address is the account address of the group policy. + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, +} +/// EventSubmitProposal is an event emitted when a proposal is created. +#[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.group.v1.EventSubmitProposal")] +pub struct EventSubmitProposal { + /// proposal_id is the unique ID of the proposal. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub proposal_id: u64, +} +/// EventWithdrawProposal is an event emitted when a proposal is withdrawn. +#[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.group.v1.EventWithdrawProposal")] +pub struct EventWithdrawProposal { + /// proposal_id is the unique ID of the proposal. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub proposal_id: u64, +} +/// EventVote is an event emitted when a voter votes on a proposal. +#[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.group.v1.EventVote")] +pub struct EventVote { + /// proposal_id is the unique ID of the proposal. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub proposal_id: u64, +} +/// EventExec is an event emitted when a proposal is executed. +#[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.group.v1.EventExec")] +pub struct EventExec { + /// proposal_id is the unique ID of the proposal. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub proposal_id: u64, + /// result is the proposal execution result. + #[prost(enumeration = "ProposalExecutorResult", tag = "2")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub result: i32, + /// logs contains error logs in case the execution result is FAILURE. + #[prost(string, tag = "3")] + pub logs: ::prost::alloc::string::String, +} +/// EventLeaveGroup is an event emitted when group member leaves the group. +#[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.group.v1.EventLeaveGroup")] +pub struct EventLeaveGroup { + /// group_id is the unique ID of the group. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub group_id: u64, + /// address is the account address of the group member. + #[prost(string, tag = "2")] + pub address: ::prost::alloc::string::String, +} +/// EventProposalPruned is an event emitted when a proposal is pruned. +#[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.group.v1.EventProposalPruned")] +pub struct EventProposalPruned { + /// proposal_id is the unique ID of the proposal. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub proposal_id: u64, + /// status is the proposal status (UNSPECIFIED, SUBMITTED, ACCEPTED, REJECTED, ABORTED, WITHDRAWN). + #[prost(enumeration = "ProposalStatus", tag = "2")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub status: i32, + /// tally_result is the proposal tally result (when applicable). + #[prost(message, optional, tag = "3")] + pub tally_result: ::core::option::Option, +} +/// GenesisState defines the group module's genesis state. +#[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.group.v1.GenesisState")] +pub struct GenesisState { + /// group_seq is the group table orm.Sequence, + /// it is used to get the next group ID. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub group_seq: u64, + /// groups is the list of groups info. + #[prost(message, repeated, tag = "2")] + pub groups: ::prost::alloc::vec::Vec, + /// group_members is the list of groups members. + #[prost(message, repeated, tag = "3")] + pub group_members: ::prost::alloc::vec::Vec, + /// group_policy_seq is the group policy table orm.Sequence, + /// it is used to generate the next group policy account address. + #[prost(uint64, tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub group_policy_seq: u64, + /// group_policies is the list of group policies info. + #[prost(message, repeated, tag = "5")] + pub group_policies: ::prost::alloc::vec::Vec, + /// proposal_seq is the proposal table orm.Sequence, + /// it is used to get the next proposal ID. + #[prost(uint64, tag = "6")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub proposal_seq: u64, + /// proposals is the list of proposals. + #[prost(message, repeated, tag = "7")] + pub proposals: ::prost::alloc::vec::Vec, + /// votes is the list of votes. + #[prost(message, repeated, tag = "8")] + pub votes: ::prost::alloc::vec::Vec, +} +/// QueryGroupInfoRequest is the Query/GroupInfo request 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.group.v1.QueryGroupInfoRequest")] +#[proto_query( + path = "/cosmos.group.v1.Query/GroupInfo", + response_type = QueryGroupInfoResponse +)] +pub struct QueryGroupInfoRequest { + /// group_id is the unique ID of the group. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub group_id: u64, +} +/// QueryGroupInfoResponse is the Query/GroupInfo 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.group.v1.QueryGroupInfoResponse")] +pub struct QueryGroupInfoResponse { + /// info is the GroupInfo of the group. + #[prost(message, optional, tag = "1")] + pub info: ::core::option::Option, +} +/// QueryGroupPolicyInfoRequest is the Query/GroupPolicyInfo request 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.group.v1.QueryGroupPolicyInfoRequest")] +#[proto_query( + path = "/cosmos.group.v1.Query/GroupPolicyInfo", + response_type = QueryGroupPolicyInfoResponse +)] +pub struct QueryGroupPolicyInfoRequest { + /// address is the account address of the group policy. + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, +} +/// QueryGroupPolicyInfoResponse is the Query/GroupPolicyInfo 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.group.v1.QueryGroupPolicyInfoResponse")] +pub struct QueryGroupPolicyInfoResponse { + /// info is the GroupPolicyInfo of the group policy. + #[prost(message, optional, tag = "1")] + pub info: ::core::option::Option, +} +/// QueryGroupMembersRequest is the Query/GroupMembers request 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.group.v1.QueryGroupMembersRequest")] +#[proto_query( + path = "/cosmos.group.v1.Query/GroupMembers", + response_type = QueryGroupMembersResponse +)] +pub struct QueryGroupMembersRequest { + /// group_id is the unique ID of the group. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub group_id: u64, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryGroupMembersResponse is the Query/GroupMembersResponse 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.group.v1.QueryGroupMembersResponse")] +pub struct QueryGroupMembersResponse { + /// members are the members of the group with given group_id. + #[prost(message, repeated, tag = "1")] + pub members: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryGroupsByAdminRequest is the Query/GroupsByAdmin request 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.group.v1.QueryGroupsByAdminRequest")] +#[proto_query( + path = "/cosmos.group.v1.Query/GroupsByAdmin", + response_type = QueryGroupsByAdminResponse +)] +pub struct QueryGroupsByAdminRequest { + /// admin is the account address of a group's admin. + #[prost(string, tag = "1")] + pub admin: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryGroupsByAdminResponse is the Query/GroupsByAdminResponse 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.group.v1.QueryGroupsByAdminResponse")] +pub struct QueryGroupsByAdminResponse { + /// groups are the groups info with the provided admin. + #[prost(message, repeated, tag = "1")] + pub groups: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryGroupPoliciesByGroupRequest is the Query/GroupPoliciesByGroup request 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.group.v1.QueryGroupPoliciesByGroupRequest")] +#[proto_query( + path = "/cosmos.group.v1.Query/GroupPoliciesByGroup", + response_type = QueryGroupPoliciesByGroupResponse +)] +pub struct QueryGroupPoliciesByGroupRequest { + /// group_id is the unique ID of the group policy's group. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub group_id: u64, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryGroupPoliciesByGroupResponse is the Query/GroupPoliciesByGroup 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.group.v1.QueryGroupPoliciesByGroupResponse")] +pub struct QueryGroupPoliciesByGroupResponse { + /// group_policies are the group policies info associated with the provided group. + #[prost(message, repeated, tag = "1")] + pub group_policies: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryGroupPoliciesByAdminRequest is the Query/GroupPoliciesByAdmin request 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.group.v1.QueryGroupPoliciesByAdminRequest")] +#[proto_query( + path = "/cosmos.group.v1.Query/GroupPoliciesByAdmin", + response_type = QueryGroupPoliciesByAdminResponse +)] +pub struct QueryGroupPoliciesByAdminRequest { + /// admin is the admin address of the group policy. + #[prost(string, tag = "1")] + pub admin: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryGroupPoliciesByAdminResponse is the Query/GroupPoliciesByAdmin 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.group.v1.QueryGroupPoliciesByAdminResponse")] +pub struct QueryGroupPoliciesByAdminResponse { + /// group_policies are the group policies info with provided admin. + #[prost(message, repeated, tag = "1")] + pub group_policies: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryProposalRequest is the Query/Proposal request 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.group.v1.QueryProposalRequest")] +#[proto_query( + path = "/cosmos.group.v1.Query/Proposal", + response_type = QueryProposalResponse +)] +pub struct QueryProposalRequest { + /// proposal_id is the unique ID of a proposal. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub proposal_id: u64, +} +/// QueryProposalResponse is the Query/Proposal 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.group.v1.QueryProposalResponse")] +pub struct QueryProposalResponse { + /// proposal is the proposal info. + #[prost(message, optional, tag = "1")] + pub proposal: ::core::option::Option, +} +/// QueryProposalsByGroupPolicyRequest is the Query/ProposalByGroupPolicy request 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.group.v1.QueryProposalsByGroupPolicyRequest")] +#[proto_query( + path = "/cosmos.group.v1.Query/ProposalsByGroupPolicy", + response_type = QueryProposalsByGroupPolicyResponse +)] +pub struct QueryProposalsByGroupPolicyRequest { + /// address is the account address of the group policy related to proposals. + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryProposalsByGroupPolicyResponse is the Query/ProposalByGroupPolicy 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.group.v1.QueryProposalsByGroupPolicyResponse")] +pub struct QueryProposalsByGroupPolicyResponse { + /// proposals are the proposals with given group policy. + #[prost(message, repeated, tag = "1")] + pub proposals: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryVoteByProposalVoterRequest is the Query/VoteByProposalVoter request 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.group.v1.QueryVoteByProposalVoterRequest")] +#[proto_query( + path = "/cosmos.group.v1.Query/VoteByProposalVoter", + response_type = QueryVoteByProposalVoterResponse +)] +pub struct QueryVoteByProposalVoterRequest { + /// proposal_id is the unique ID of a proposal. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub proposal_id: u64, + /// voter is a proposal voter account address. + #[prost(string, tag = "2")] + pub voter: ::prost::alloc::string::String, +} +/// QueryVoteByProposalVoterResponse is the Query/VoteByProposalVoter 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.group.v1.QueryVoteByProposalVoterResponse")] +pub struct QueryVoteByProposalVoterResponse { + /// vote is the vote with given proposal_id and voter. + #[prost(message, optional, tag = "1")] + pub vote: ::core::option::Option, +} +/// QueryVotesByProposalRequest is the Query/VotesByProposal request 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.group.v1.QueryVotesByProposalRequest")] +#[proto_query( + path = "/cosmos.group.v1.Query/VotesByProposal", + response_type = QueryVotesByProposalResponse +)] +pub struct QueryVotesByProposalRequest { + /// proposal_id is the unique ID of a proposal. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub proposal_id: u64, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryVotesByProposalResponse is the Query/VotesByProposal 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.group.v1.QueryVotesByProposalResponse")] +pub struct QueryVotesByProposalResponse { + /// votes are the list of votes for given proposal_id. + #[prost(message, repeated, tag = "1")] + pub votes: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryVotesByVoterRequest is the Query/VotesByVoter request 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.group.v1.QueryVotesByVoterRequest")] +#[proto_query( + path = "/cosmos.group.v1.Query/VotesByVoter", + response_type = QueryVotesByVoterResponse +)] +pub struct QueryVotesByVoterRequest { + /// voter is a proposal voter account address. + #[prost(string, tag = "1")] + pub voter: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryVotesByVoterResponse is the Query/VotesByVoter 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.group.v1.QueryVotesByVoterResponse")] +pub struct QueryVotesByVoterResponse { + /// votes are the list of votes by given voter. + #[prost(message, repeated, tag = "1")] + pub votes: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryGroupsByMemberRequest is the Query/GroupsByMember request 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.group.v1.QueryGroupsByMemberRequest")] +#[proto_query( + path = "/cosmos.group.v1.Query/GroupsByMember", + response_type = QueryGroupsByMemberResponse +)] +pub struct QueryGroupsByMemberRequest { + /// address is the group member address. + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryGroupsByMemberResponse is the Query/GroupsByMember 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.group.v1.QueryGroupsByMemberResponse")] +pub struct QueryGroupsByMemberResponse { + /// groups are the groups info with the provided group member. + #[prost(message, repeated, tag = "1")] + pub groups: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryTallyResultRequest is the Query/TallyResult request 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.group.v1.QueryTallyResultRequest")] +#[proto_query( + path = "/cosmos.group.v1.Query/TallyResult", + response_type = QueryTallyResultResponse +)] +pub struct QueryTallyResultRequest { + /// proposal_id is the unique id of a proposal. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub proposal_id: u64, +} +/// QueryTallyResultResponse is the Query/TallyResult 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.group.v1.QueryTallyResultResponse")] +pub struct QueryTallyResultResponse { + /// tally defines the requested tally. + #[prost(message, optional, tag = "1")] + pub tally: ::core::option::Option, +} +/// QueryGroupsRequest is the Query/Groups request type. +/// +/// Since: cosmos-sdk 0.47.1 +#[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.group.v1.QueryGroupsRequest")] +#[proto_query( + path = "/cosmos.group.v1.Query/Groups", + response_type = QueryGroupsResponse +)] +pub struct QueryGroupsRequest { + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryGroupsResponse is the Query/Groups response type. +/// +/// Since: cosmos-sdk 0.47.1 +#[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.group.v1.QueryGroupsResponse")] +pub struct QueryGroupsResponse { + /// `groups` is all the groups present in state. + #[prost(message, repeated, tag = "1")] + pub groups: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// MsgCreateGroup is the Msg/CreateGroup request 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.group.v1.MsgCreateGroup")] +pub struct MsgCreateGroup { + /// admin is the account address of the group admin. + #[prost(string, tag = "1")] + pub admin: ::prost::alloc::string::String, + /// members defines the group members. + #[prost(message, repeated, tag = "2")] + pub members: ::prost::alloc::vec::Vec, + /// metadata is any arbitrary metadata to attached to the group. + #[prost(string, tag = "3")] + pub metadata: ::prost::alloc::string::String, +} +/// MsgCreateGroupResponse is the Msg/CreateGroup 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.group.v1.MsgCreateGroupResponse")] +pub struct MsgCreateGroupResponse { + /// group_id is the unique ID of the newly created group. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub group_id: u64, +} +/// MsgUpdateGroupMembers is the Msg/UpdateGroupMembers request 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.group.v1.MsgUpdateGroupMembers")] +pub struct MsgUpdateGroupMembers { + /// admin is the account address of the group admin. + #[prost(string, tag = "1")] + pub admin: ::prost::alloc::string::String, + /// group_id is the unique ID of the group. + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub group_id: u64, + /// member_updates is the list of members to update, + /// set weight to 0 to remove a member. + #[prost(message, repeated, tag = "3")] + pub member_updates: ::prost::alloc::vec::Vec, +} +/// MsgUpdateGroupMembersResponse is the Msg/UpdateGroupMembers 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.group.v1.MsgUpdateGroupMembersResponse")] +pub struct MsgUpdateGroupMembersResponse {} +/// MsgUpdateGroupAdmin is the Msg/UpdateGroupAdmin request 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.group.v1.MsgUpdateGroupAdmin")] +pub struct MsgUpdateGroupAdmin { + /// admin is the current account address of the group admin. + #[prost(string, tag = "1")] + pub admin: ::prost::alloc::string::String, + /// group_id is the unique ID of the group. + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub group_id: u64, + /// new_admin is the group new admin account address. + #[prost(string, tag = "3")] + pub new_admin: ::prost::alloc::string::String, +} +/// MsgUpdateGroupAdminResponse is the Msg/UpdateGroupAdmin 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.group.v1.MsgUpdateGroupAdminResponse")] +pub struct MsgUpdateGroupAdminResponse {} +/// MsgUpdateGroupMetadata is the Msg/UpdateGroupMetadata request 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.group.v1.MsgUpdateGroupMetadata")] +pub struct MsgUpdateGroupMetadata { + /// admin is the account address of the group admin. + #[prost(string, tag = "1")] + pub admin: ::prost::alloc::string::String, + /// group_id is the unique ID of the group. + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub group_id: u64, + /// metadata is the updated group's metadata. + #[prost(string, tag = "3")] + pub metadata: ::prost::alloc::string::String, +} +/// MsgUpdateGroupMetadataResponse is the Msg/UpdateGroupMetadata 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.group.v1.MsgUpdateGroupMetadataResponse")] +pub struct MsgUpdateGroupMetadataResponse {} +/// MsgCreateGroupPolicy is the Msg/CreateGroupPolicy request 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.group.v1.MsgCreateGroupPolicy")] +pub struct MsgCreateGroupPolicy { + /// admin is the account address of the group admin. + #[prost(string, tag = "1")] + pub admin: ::prost::alloc::string::String, + /// group_id is the unique ID of the group. + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub group_id: u64, + /// metadata is any arbitrary metadata attached to the group policy. + #[prost(string, tag = "3")] + pub metadata: ::prost::alloc::string::String, + /// decision_policy specifies the group policy's decision policy. + #[prost(message, optional, tag = "4")] + pub decision_policy: ::core::option::Option, +} +/// MsgCreateGroupPolicyResponse is the Msg/CreateGroupPolicy 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.group.v1.MsgCreateGroupPolicyResponse")] +pub struct MsgCreateGroupPolicyResponse { + /// address is the account address of the newly created group policy. + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, +} +/// MsgUpdateGroupPolicyAdmin is the Msg/UpdateGroupPolicyAdmin request 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.group.v1.MsgUpdateGroupPolicyAdmin")] +pub struct MsgUpdateGroupPolicyAdmin { + /// admin is the account address of the group admin. + #[prost(string, tag = "1")] + pub admin: ::prost::alloc::string::String, + /// group_policy_address is the account address of the group policy. + #[prost(string, tag = "2")] + pub group_policy_address: ::prost::alloc::string::String, + /// new_admin is the new group policy admin. + #[prost(string, tag = "3")] + pub new_admin: ::prost::alloc::string::String, +} +/// MsgUpdateGroupPolicyAdminResponse is the Msg/UpdateGroupPolicyAdmin 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.group.v1.MsgUpdateGroupPolicyAdminResponse")] +pub struct MsgUpdateGroupPolicyAdminResponse {} +/// MsgCreateGroupWithPolicy is the Msg/CreateGroupWithPolicy request 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.group.v1.MsgCreateGroupWithPolicy")] +pub struct MsgCreateGroupWithPolicy { + /// admin is the account address of the group and group policy admin. + #[prost(string, tag = "1")] + pub admin: ::prost::alloc::string::String, + /// members defines the group members. + #[prost(message, repeated, tag = "2")] + pub members: ::prost::alloc::vec::Vec, + /// group_metadata is any arbitrary metadata attached to the group. + #[prost(string, tag = "3")] + pub group_metadata: ::prost::alloc::string::String, + /// group_policy_metadata is any arbitrary metadata attached to the group policy. + #[prost(string, tag = "4")] + pub group_policy_metadata: ::prost::alloc::string::String, + /// group_policy_as_admin is a boolean field, if set to true, the group policy account address will be used as group + /// and group policy admin. + #[prost(bool, tag = "5")] + pub group_policy_as_admin: bool, + /// decision_policy specifies the group policy's decision policy. + #[prost(message, optional, tag = "6")] + pub decision_policy: ::core::option::Option, +} +/// MsgCreateGroupWithPolicyResponse is the Msg/CreateGroupWithPolicy 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.group.v1.MsgCreateGroupWithPolicyResponse")] +pub struct MsgCreateGroupWithPolicyResponse { + /// group_id is the unique ID of the newly created group with policy. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub group_id: u64, + /// group_policy_address is the account address of the newly created group policy. + #[prost(string, tag = "2")] + pub group_policy_address: ::prost::alloc::string::String, +} +/// MsgUpdateGroupPolicyDecisionPolicy is the Msg/UpdateGroupPolicyDecisionPolicy request 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.group.v1.MsgUpdateGroupPolicyDecisionPolicy")] +pub struct MsgUpdateGroupPolicyDecisionPolicy { + /// admin is the account address of the group admin. + #[prost(string, tag = "1")] + pub admin: ::prost::alloc::string::String, + /// group_policy_address is the account address of group policy. + #[prost(string, tag = "2")] + pub group_policy_address: ::prost::alloc::string::String, + /// decision_policy is the updated group policy's decision policy. + #[prost(message, optional, tag = "3")] + pub decision_policy: ::core::option::Option, +} +/// MsgUpdateGroupPolicyDecisionPolicyResponse is the Msg/UpdateGroupPolicyDecisionPolicy 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.group.v1.MsgUpdateGroupPolicyDecisionPolicyResponse")] +pub struct MsgUpdateGroupPolicyDecisionPolicyResponse {} +/// MsgUpdateGroupPolicyMetadata is the Msg/UpdateGroupPolicyMetadata request 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.group.v1.MsgUpdateGroupPolicyMetadata")] +pub struct MsgUpdateGroupPolicyMetadata { + /// admin is the account address of the group admin. + #[prost(string, tag = "1")] + pub admin: ::prost::alloc::string::String, + /// group_policy_address is the account address of group policy. + #[prost(string, tag = "2")] + pub group_policy_address: ::prost::alloc::string::String, + /// metadata is the group policy metadata to be updated. + #[prost(string, tag = "3")] + pub metadata: ::prost::alloc::string::String, +} +/// MsgUpdateGroupPolicyMetadataResponse is the Msg/UpdateGroupPolicyMetadata 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.group.v1.MsgUpdateGroupPolicyMetadataResponse")] +pub struct MsgUpdateGroupPolicyMetadataResponse {} +/// MsgSubmitProposal is the Msg/SubmitProposal request 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.group.v1.MsgSubmitProposal")] +pub struct MsgSubmitProposal { + /// group_policy_address is the account address of group policy. + #[prost(string, tag = "1")] + pub group_policy_address: ::prost::alloc::string::String, + /// proposers are the account addresses of the proposers. + /// Proposers signatures will be counted as yes votes. + #[prost(string, repeated, tag = "2")] + pub proposers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// metadata is any arbitrary metadata attached to the proposal. + #[prost(string, tag = "3")] + pub metadata: ::prost::alloc::string::String, + /// messages is a list of `sdk.Msg`s that will be executed if the proposal passes. + #[prost(message, repeated, tag = "4")] + pub messages: ::prost::alloc::vec::Vec, + /// exec defines the mode of execution of the proposal, + /// whether it should be executed immediately on creation or not. + /// If so, proposers signatures are considered as Yes votes. + #[prost(enumeration = "Exec", tag = "5")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub exec: i32, + /// title is the title of the proposal. + /// + /// Since: cosmos-sdk 0.47 + #[prost(string, tag = "6")] + pub title: ::prost::alloc::string::String, + /// summary is the summary of the proposal. + /// + /// Since: cosmos-sdk 0.47 + #[prost(string, tag = "7")] + pub summary: ::prost::alloc::string::String, +} +/// MsgSubmitProposalResponse is the Msg/SubmitProposal 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.group.v1.MsgSubmitProposalResponse")] +pub struct MsgSubmitProposalResponse { + /// proposal is the unique ID of the proposal. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub proposal_id: u64, +} +/// MsgWithdrawProposal is the Msg/WithdrawProposal request 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.group.v1.MsgWithdrawProposal")] +pub struct MsgWithdrawProposal { + /// proposal is the unique ID of the proposal. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub proposal_id: u64, + /// address is the admin of the group policy or one of the proposer of the proposal. + #[prost(string, tag = "2")] + pub address: ::prost::alloc::string::String, +} +/// MsgWithdrawProposalResponse is the Msg/WithdrawProposal 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.group.v1.MsgWithdrawProposalResponse")] +pub struct MsgWithdrawProposalResponse {} +/// MsgVote is the Msg/Vote request 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.group.v1.MsgVote")] +pub struct MsgVote { + /// proposal is the unique ID of the proposal. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub proposal_id: u64, + /// voter is the voter account address. + #[prost(string, tag = "2")] + pub voter: ::prost::alloc::string::String, + /// option is the voter's choice on the proposal. + #[prost(enumeration = "VoteOption", tag = "3")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub option: i32, + /// metadata is any arbitrary metadata attached to the vote. + #[prost(string, tag = "4")] + pub metadata: ::prost::alloc::string::String, + /// exec defines whether the proposal should be executed + /// immediately after voting or not. + #[prost(enumeration = "Exec", tag = "5")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub exec: i32, +} +/// MsgVoteResponse is the Msg/Vote 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.group.v1.MsgVoteResponse")] +pub struct MsgVoteResponse {} +/// MsgExec is the Msg/Exec request 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.group.v1.MsgExec")] +pub struct MsgExec { + /// proposal is the unique ID of the proposal. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub proposal_id: u64, + /// executor is the account address used to execute the proposal. + #[prost(string, tag = "2")] + pub executor: ::prost::alloc::string::String, +} +/// MsgExecResponse is the Msg/Exec request 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.group.v1.MsgExecResponse")] +pub struct MsgExecResponse { + /// result is the final result of the proposal execution. + #[prost(enumeration = "ProposalExecutorResult", tag = "2")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub result: i32, +} +/// MsgLeaveGroup is the Msg/LeaveGroup request 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.group.v1.MsgLeaveGroup")] +pub struct MsgLeaveGroup { + /// address is the account address of the group member. + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// group_id is the unique ID of the group. + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub group_id: u64, +} +/// MsgLeaveGroupResponse is the Msg/LeaveGroup 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.group.v1.MsgLeaveGroupResponse")] +pub struct MsgLeaveGroupResponse {} +/// Exec defines modes of execution of a proposal on creation or on new vote. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +pub enum Exec { + /// An empty value means that there should be a separate + /// MsgExec request for the proposal to execute. + Unspecified = 0, + /// Try to execute the proposal immediately. + /// If the proposal is not allowed per the DecisionPolicy, + /// the proposal will still be open and could + /// be executed at a later point. + Try = 1, +} +impl Exec { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Exec::Unspecified => "EXEC_UNSPECIFIED", + Exec::Try => "EXEC_TRY", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "EXEC_UNSPECIFIED" => Some(Self::Unspecified), + "EXEC_TRY" => Some(Self::Try), + _ => None, + } + } +} +pub struct GroupQuerier<'a, Q: cosmwasm_std::CustomQuery> { + querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, +} +impl<'a, Q: cosmwasm_std::CustomQuery> GroupQuerier<'a, Q> { + pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self { + Self { querier } + } + pub fn group_info( + &self, + group_id: u64, + ) -> Result { + QueryGroupInfoRequest { group_id }.query(self.querier) + } + pub fn group_policy_info( + &self, + address: ::prost::alloc::string::String, + ) -> Result { + QueryGroupPolicyInfoRequest { address }.query(self.querier) + } + pub fn group_members( + &self, + group_id: u64, + pagination: ::core::option::Option, + ) -> Result { + QueryGroupMembersRequest { + group_id, + pagination, + } + .query(self.querier) + } + pub fn groups_by_admin( + &self, + admin: ::prost::alloc::string::String, + pagination: ::core::option::Option, + ) -> Result { + QueryGroupsByAdminRequest { admin, pagination }.query(self.querier) + } + pub fn group_policies_by_group( + &self, + group_id: u64, + pagination: ::core::option::Option, + ) -> Result { + QueryGroupPoliciesByGroupRequest { + group_id, + pagination, + } + .query(self.querier) + } + pub fn group_policies_by_admin( + &self, + admin: ::prost::alloc::string::String, + pagination: ::core::option::Option, + ) -> Result { + QueryGroupPoliciesByAdminRequest { admin, pagination }.query(self.querier) + } + pub fn proposal( + &self, + proposal_id: u64, + ) -> Result { + QueryProposalRequest { proposal_id }.query(self.querier) + } + pub fn proposals_by_group_policy( + &self, + address: ::prost::alloc::string::String, + pagination: ::core::option::Option, + ) -> Result { + QueryProposalsByGroupPolicyRequest { + address, + pagination, + } + .query(self.querier) + } + pub fn vote_by_proposal_voter( + &self, + proposal_id: u64, + voter: ::prost::alloc::string::String, + ) -> Result { + QueryVoteByProposalVoterRequest { proposal_id, voter }.query(self.querier) + } + pub fn votes_by_proposal( + &self, + proposal_id: u64, + pagination: ::core::option::Option, + ) -> Result { + QueryVotesByProposalRequest { + proposal_id, + pagination, + } + .query(self.querier) + } + pub fn votes_by_voter( + &self, + voter: ::prost::alloc::string::String, + pagination: ::core::option::Option, + ) -> Result { + QueryVotesByVoterRequest { voter, pagination }.query(self.querier) + } + pub fn groups_by_member( + &self, + address: ::prost::alloc::string::String, + pagination: ::core::option::Option, + ) -> Result { + QueryGroupsByMemberRequest { + address, + pagination, + } + .query(self.querier) + } + pub fn tally_result( + &self, + proposal_id: u64, + ) -> Result { + QueryTallyResultRequest { proposal_id }.query(self.querier) + } + pub fn groups( + &self, + pagination: ::core::option::Option, + ) -> Result { + QueryGroupsRequest { pagination }.query(self.querier) + } +} diff --git a/packages/provwasm-std/src/types/cosmos/ics23/mod.rs b/packages/provwasm-std/src/types/cosmos/ics23/mod.rs new file mode 100644 index 00000000..a3a6d96c --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/ics23/mod.rs @@ -0,0 +1 @@ +pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/ics23/v1.rs b/packages/provwasm-std/src/types/cosmos/ics23/v1.rs new file mode 100644 index 00000000..78660406 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/ics23/v1.rs @@ -0,0 +1,621 @@ +use provwasm_proc_macro::CosmwasmExt; +/// * +/// ExistenceProof takes a key and a value and a set of steps to perform on it. +/// The result of peforming all these steps will provide a "root hash", which can +/// be compared to the value in a header. +/// +/// Since it is computationally infeasible to produce a hash collission for any of the used +/// cryptographic hash functions, if someone can provide a series of operations to transform +/// a given key and value into a root hash that matches some trusted root, these key and values +/// must be in the referenced merkle tree. +/// +/// The only possible issue is maliablity in LeafOp, such as providing extra prefix data, +/// which should be controlled by a spec. Eg. with lengthOp as NONE, +/// prefix = FOO, key = BAR, value = CHOICE +/// and +/// prefix = F, key = OOBAR, value = CHOICE +/// would produce the same value. +/// +/// With LengthOp this is tricker but not impossible. Which is why the "leafPrefixEqual" field +/// in the ProofSpec is valuable to prevent this mutability. And why all trees should +/// length-prefix the data before hashing it. +#[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.ics23.v1.ExistenceProof")] +pub struct ExistenceProof { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub key: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub value: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "3")] + pub leaf: ::core::option::Option, + #[prost(message, repeated, tag = "4")] + pub path: ::prost::alloc::vec::Vec, +} +/// +/// NonExistenceProof takes a proof of two neighbors, one left of the desired key, +/// one right of the desired key. If both proofs are valid AND they are neighbors, +/// then there is no valid proof for the given key. +#[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.ics23.v1.NonExistenceProof")] +pub struct NonExistenceProof { + /// TODO: remove this as unnecessary??? we prove a range + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub key: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "2")] + pub left: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub right: ::core::option::Option, +} +/// +/// CommitmentProof is either an ExistenceProof or a NonExistenceProof, or a Batch of such messages +#[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.ics23.v1.CommitmentProof")] +pub struct CommitmentProof { + #[prost(oneof = "commitment_proof::Proof", tags = "1, 2, 3, 4")] + pub proof: ::core::option::Option, +} +/// Nested message and enum types in `CommitmentProof`. +pub mod commitment_proof { + use provwasm_proc_macro::CosmwasmExt; + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive( + Clone, + PartialEq, + Eq, + ::prost::Oneof, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + )] + pub enum Proof { + #[prost(message, tag = "1")] + Exist(super::ExistenceProof), + #[prost(message, tag = "2")] + Nonexist(super::NonExistenceProof), + #[prost(message, tag = "3")] + Batch(super::BatchProof), + #[prost(message, tag = "4")] + Compressed(super::CompressedBatchProof), + } +} +/// * +/// LeafOp represents the raw key-value data we wish to prove, and +/// must be flexible to represent the internal transformation from +/// the original key-value pairs into the basis hash, for many existing +/// merkle trees. +/// +/// key and value are passed in. So that the signature of this operation is: +/// leafOp(key, value) -> output +/// +/// To process this, first prehash the keys and values if needed (ANY means no hash in this case): +/// hkey = prehashKey(key) +/// hvalue = prehashValue(value) +/// +/// Then combine the bytes, and hash it +/// output = hash(prefix || length(hkey) || hkey || length(hvalue) || hvalue) +#[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.ics23.v1.LeafOp")] +pub struct LeafOp { + #[prost(enumeration = "HashOp", tag = "1")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub hash: i32, + #[prost(enumeration = "HashOp", tag = "2")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub prehash_key: i32, + #[prost(enumeration = "HashOp", tag = "3")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub prehash_value: i32, + #[prost(enumeration = "LengthOp", tag = "4")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub length: i32, + /// prefix is a fixed bytes that may optionally be included at the beginning to differentiate + /// a leaf node from an inner node. + #[prost(bytes = "vec", tag = "5")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub prefix: ::prost::alloc::vec::Vec, +} +/// * +/// InnerOp represents a merkle-proof step that is not a leaf. +/// It represents concatenating two children and hashing them to provide the next result. +/// +/// The result of the previous step is passed in, so the signature of this op is: +/// innerOp(child) -> output +/// +/// The result of applying InnerOp should be: +/// output = op.hash(op.prefix || child || op.suffix) +/// +/// where the || operator is concatenation of binary data, +/// and child is the result of hashing all the tree below this step. +/// +/// Any special data, like prepending child with the length, or prepending the entire operation with +/// some value to differentiate from leaf nodes, should be included in prefix and suffix. +/// If either of prefix or suffix is empty, we just treat it as an empty string +#[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.ics23.v1.InnerOp")] +pub struct InnerOp { + #[prost(enumeration = "HashOp", tag = "1")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub hash: i32, + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub prefix: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "3")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub suffix: ::prost::alloc::vec::Vec, +} +/// * +/// ProofSpec defines what the expected parameters are for a given proof type. +/// This can be stored in the client and used to validate any incoming proofs. +/// +/// verify(ProofSpec, Proof) -> Proof | Error +/// +/// As demonstrated in tests, if we don't fix the algorithm used to calculate the +/// LeafHash for a given tree, there are many possible key-value pairs that can +/// generate a given hash (by interpretting the preimage differently). +/// We need this for proper security, requires client knows a priori what +/// tree format server uses. But not in code, rather a configuration 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.ics23.v1.ProofSpec")] +pub struct ProofSpec { + /// any field in the ExistenceProof must be the same as in this spec. + /// except Prefix, which is just the first bytes of prefix (spec can be longer) + #[prost(message, optional, tag = "1")] + pub leaf_spec: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub inner_spec: ::core::option::Option, + /// max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries) + #[prost(int32, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub max_depth: i32, + /// min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries) + #[prost(int32, tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub min_depth: i32, + /// prehash_key_before_comparison is a flag that indicates whether to use the + /// prehash_key specified by LeafOp to compare lexical ordering of keys for + /// non-existence proofs. + #[prost(bool, tag = "5")] + pub prehash_key_before_comparison: bool, +} +/// +/// InnerSpec contains all store-specific structure info to determine if two proofs from a +/// given store are neighbors. +/// +/// This enables: +/// +/// isLeftMost(spec: InnerSpec, op: InnerOp) +/// isRightMost(spec: InnerSpec, op: InnerOp) +/// isLeftNeighbor(spec: InnerSpec, left: InnerOp, right: InnerOp) +#[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.ics23.v1.InnerSpec")] +pub struct InnerSpec { + /// Child order is the ordering of the children node, must count from 0 + /// iavl tree is \[0, 1\] (left then right) + /// merk is \[0, 2, 1\] (left, right, here) + #[prost(int32, repeated, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub child_order: ::prost::alloc::vec::Vec, + #[prost(int32, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub child_size: i32, + #[prost(int32, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub min_prefix_length: i32, + #[prost(int32, tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub max_prefix_length: i32, + /// empty child is the prehash image that is used when one child is nil (eg. 20 bytes of 0) + #[prost(bytes = "vec", tag = "5")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub empty_child: ::prost::alloc::vec::Vec, + /// hash is the algorithm that must be used for each InnerOp + #[prost(enumeration = "HashOp", tag = "6")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub hash: i32, +} +/// +/// BatchProof is a group of multiple proof types than can be compressed +#[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.ics23.v1.BatchProof")] +pub struct BatchProof { + #[prost(message, repeated, tag = "1")] + pub entries: ::prost::alloc::vec::Vec, +} +/// Use BatchEntry not CommitmentProof, to avoid recursion +#[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.ics23.v1.BatchEntry")] +pub struct BatchEntry { + #[prost(oneof = "batch_entry::Proof", tags = "1, 2")] + pub proof: ::core::option::Option, +} +/// Nested message and enum types in `BatchEntry`. +pub mod batch_entry { + use provwasm_proc_macro::CosmwasmExt; + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive( + Clone, + PartialEq, + Eq, + ::prost::Oneof, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + )] + pub enum Proof { + #[prost(message, tag = "1")] + Exist(super::ExistenceProof), + #[prost(message, tag = "2")] + Nonexist(super::NonExistenceProof), + } +} +#[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.ics23.v1.CompressedBatchProof")] +pub struct CompressedBatchProof { + #[prost(message, repeated, tag = "1")] + pub entries: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "2")] + pub lookup_inners: ::prost::alloc::vec::Vec, +} +/// Use BatchEntry not CommitmentProof, to avoid recursion +#[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.ics23.v1.CompressedBatchEntry")] +pub struct CompressedBatchEntry { + #[prost(oneof = "compressed_batch_entry::Proof", tags = "1, 2")] + pub proof: ::core::option::Option, +} +/// Nested message and enum types in `CompressedBatchEntry`. +pub mod compressed_batch_entry { + use provwasm_proc_macro::CosmwasmExt; + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive( + Clone, + PartialEq, + Eq, + ::prost::Oneof, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + )] + pub enum Proof { + #[prost(message, tag = "1")] + Exist(super::CompressedExistenceProof), + #[prost(message, tag = "2")] + Nonexist(super::CompressedNonExistenceProof), + } +} +#[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.ics23.v1.CompressedExistenceProof")] +pub struct CompressedExistenceProof { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub key: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub value: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "3")] + pub leaf: ::core::option::Option, + /// these are indexes into the lookup_inners table in CompressedBatchProof + #[prost(int32, repeated, tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub path: ::prost::alloc::vec::Vec, +} +#[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.ics23.v1.CompressedNonExistenceProof")] +pub struct CompressedNonExistenceProof { + /// TODO: remove this as unnecessary??? we prove a range + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub key: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "2")] + pub left: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub right: ::core::option::Option, +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +pub enum HashOp { + /// NO_HASH is the default if no data passed. Note this is an illegal argument some places. + NoHash = 0, + Sha256 = 1, + Sha512 = 2, + Keccak = 3, + Ripemd160 = 4, + /// ripemd160(sha256(x)) + Bitcoin = 5, + Sha512256 = 6, +} +impl HashOp { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + HashOp::NoHash => "NO_HASH", + HashOp::Sha256 => "SHA256", + HashOp::Sha512 => "SHA512", + HashOp::Keccak => "KECCAK", + HashOp::Ripemd160 => "RIPEMD160", + HashOp::Bitcoin => "BITCOIN", + HashOp::Sha512256 => "SHA512_256", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "NO_HASH" => Some(Self::NoHash), + "SHA256" => Some(Self::Sha256), + "SHA512" => Some(Self::Sha512), + "KECCAK" => Some(Self::Keccak), + "RIPEMD160" => Some(Self::Ripemd160), + "BITCOIN" => Some(Self::Bitcoin), + "SHA512_256" => Some(Self::Sha512256), + _ => None, + } + } +} +/// * +/// LengthOp defines how to process the key and value of the LeafOp +/// to include length information. After encoding the length with the given +/// algorithm, the length will be prepended to the key and value bytes. +/// (Each one with it's own encoded length) +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +pub enum LengthOp { + /// NO_PREFIX don't include any length info + NoPrefix = 0, + /// VAR_PROTO uses protobuf (and go-amino) varint encoding of the length + VarProto = 1, + /// VAR_RLP uses rlp int encoding of the length + VarRlp = 2, + /// FIXED32_BIG uses big-endian encoding of the length as a 32 bit integer + Fixed32Big = 3, + /// FIXED32_LITTLE uses little-endian encoding of the length as a 32 bit integer + Fixed32Little = 4, + /// FIXED64_BIG uses big-endian encoding of the length as a 64 bit integer + Fixed64Big = 5, + /// FIXED64_LITTLE uses little-endian encoding of the length as a 64 bit integer + Fixed64Little = 6, + /// REQUIRE_32_BYTES is like NONE, but will fail if the input is not exactly 32 bytes (sha256 output) + Require32Bytes = 7, + /// REQUIRE_64_BYTES is like NONE, but will fail if the input is not exactly 64 bytes (sha512 output) + Require64Bytes = 8, +} +impl LengthOp { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + LengthOp::NoPrefix => "NO_PREFIX", + LengthOp::VarProto => "VAR_PROTO", + LengthOp::VarRlp => "VAR_RLP", + LengthOp::Fixed32Big => "FIXED32_BIG", + LengthOp::Fixed32Little => "FIXED32_LITTLE", + LengthOp::Fixed64Big => "FIXED64_BIG", + LengthOp::Fixed64Little => "FIXED64_LITTLE", + LengthOp::Require32Bytes => "REQUIRE_32_BYTES", + LengthOp::Require64Bytes => "REQUIRE_64_BYTES", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "NO_PREFIX" => Some(Self::NoPrefix), + "VAR_PROTO" => Some(Self::VarProto), + "VAR_RLP" => Some(Self::VarRlp), + "FIXED32_BIG" => Some(Self::Fixed32Big), + "FIXED32_LITTLE" => Some(Self::Fixed32Little), + "FIXED64_BIG" => Some(Self::Fixed64Big), + "FIXED64_LITTLE" => Some(Self::Fixed64Little), + "REQUIRE_32_BYTES" => Some(Self::Require32Bytes), + "REQUIRE_64_BYTES" => Some(Self::Require64Bytes), + _ => None, + } + } +} diff --git a/packages/provwasm-std/src/types/cosmos/mint/mod.rs b/packages/provwasm-std/src/types/cosmos/mint/mod.rs new file mode 100644 index 00000000..537a3360 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/mint/mod.rs @@ -0,0 +1,2 @@ +pub mod module; +pub mod v1beta1; diff --git a/packages/provwasm-std/src/types/cosmos/mint/module/mod.rs b/packages/provwasm-std/src/types/cosmos/mint/module/mod.rs new file mode 100644 index 00000000..a3a6d96c --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/mint/module/mod.rs @@ -0,0 +1 @@ +pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/mint/module/v1.rs b/packages/provwasm-std/src/types/cosmos/mint/module/v1.rs new file mode 100644 index 00000000..5abf4a93 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/mint/module/v1.rs @@ -0,0 +1,21 @@ +use provwasm_proc_macro::CosmwasmExt; +/// Module is the config object of the mint 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.mint.module.v1.Module")] +pub struct Module { + #[prost(string, tag = "1")] + pub fee_collector_name: ::prost::alloc::string::String, + /// authority defines the custom module authority. If not set, defaults to the governance module. + #[prost(string, tag = "2")] + pub authority: ::prost::alloc::string::String, +} diff --git a/packages/provwasm-std/src/types/cosmos/mint/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/mint/v1beta1.rs new file mode 100644 index 00000000..2285712d --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/mint/v1beta1.rs @@ -0,0 +1,260 @@ +use provwasm_proc_macro::CosmwasmExt; +/// Minter represents the minting state. +#[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.mint.v1beta1.Minter")] +pub struct Minter { + /// current annual inflation rate + #[prost(string, tag = "1")] + pub inflation: ::prost::alloc::string::String, + /// current annual expected provisions + #[prost(string, tag = "2")] + pub annual_provisions: ::prost::alloc::string::String, +} +/// Params defines the parameters for the x/mint 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.mint.v1beta1.Params")] +pub struct Params { + /// type of coin to mint + #[prost(string, tag = "1")] + pub mint_denom: ::prost::alloc::string::String, + /// maximum annual change in inflation rate + #[prost(string, tag = "2")] + pub inflation_rate_change: ::prost::alloc::string::String, + /// maximum inflation rate + #[prost(string, tag = "3")] + pub inflation_max: ::prost::alloc::string::String, + /// minimum inflation rate + #[prost(string, tag = "4")] + pub inflation_min: ::prost::alloc::string::String, + /// goal of percent bonded atoms + #[prost(string, tag = "5")] + pub goal_bonded: ::prost::alloc::string::String, + /// expected blocks per year + #[prost(uint64, tag = "6")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub blocks_per_year: u64, +} +/// GenesisState defines the mint module's genesis state. +#[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.mint.v1beta1.GenesisState")] +pub struct GenesisState { + /// minter is a space for holding current inflation information. + #[prost(message, optional, tag = "1")] + pub minter: ::core::option::Option, + /// params defines all the parameters of the module. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +/// QueryParamsRequest is the request type for the Query/Params 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.mint.v1beta1.QueryParamsRequest")] +#[proto_query( + path = "/cosmos.mint.v1beta1.Query/Params", + response_type = QueryParamsResponse +)] +pub struct QueryParamsRequest {} +/// QueryParamsResponse is the response type for the Query/Params 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.mint.v1beta1.QueryParamsResponse")] +pub struct QueryParamsResponse { + /// params defines the parameters of the module. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} +/// QueryInflationRequest is the request type for the Query/Inflation 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.mint.v1beta1.QueryInflationRequest")] +#[proto_query( + path = "/cosmos.mint.v1beta1.Query/Inflation", + response_type = QueryInflationResponse +)] +pub struct QueryInflationRequest {} +/// QueryInflationResponse is the response type for the Query/Inflation 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.mint.v1beta1.QueryInflationResponse")] +pub struct QueryInflationResponse { + /// inflation is the current minting inflation value. + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub inflation: ::prost::alloc::vec::Vec, +} +/// QueryAnnualProvisionsRequest is the request type for the +/// Query/AnnualProvisions 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.mint.v1beta1.QueryAnnualProvisionsRequest")] +#[proto_query( + path = "/cosmos.mint.v1beta1.Query/AnnualProvisions", + response_type = QueryAnnualProvisionsResponse +)] +pub struct QueryAnnualProvisionsRequest {} +/// QueryAnnualProvisionsResponse is the response type for the +/// Query/AnnualProvisions 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.mint.v1beta1.QueryAnnualProvisionsResponse")] +pub struct QueryAnnualProvisionsResponse { + /// annual_provisions is the current minting annual provisions value. + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub annual_provisions: ::prost::alloc::vec::Vec, +} +/// MsgUpdateParams is the Msg/UpdateParams request type. +/// +/// Since: cosmos-sdk 0.47 +#[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.mint.v1beta1.MsgUpdateParams")] +pub struct MsgUpdateParams { + /// authority is the address that controls the module (defaults to x/gov unless overwritten). + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// params defines the x/mint parameters to update. + /// + /// NOTE: All parameters must be supplied. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +/// MsgUpdateParamsResponse defines the response structure for executing a +/// MsgUpdateParams message. +/// +/// Since: cosmos-sdk 0.47 +#[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.mint.v1beta1.MsgUpdateParamsResponse")] +pub struct MsgUpdateParamsResponse {} +pub struct MintQuerier<'a, Q: cosmwasm_std::CustomQuery> { + querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, +} +impl<'a, Q: cosmwasm_std::CustomQuery> MintQuerier<'a, Q> { + pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self { + Self { querier } + } + pub fn params(&self) -> Result { + QueryParamsRequest {}.query(self.querier) + } + pub fn inflation(&self) -> Result { + QueryInflationRequest {}.query(self.querier) + } + pub fn annual_provisions( + &self, + ) -> Result { + QueryAnnualProvisionsRequest {}.query(self.querier) + } +} diff --git a/packages/provwasm-std/src/types/cosmos/mod.rs b/packages/provwasm-std/src/types/cosmos/mod.rs index 79f070fc..17e6eee6 100644 --- a/packages/provwasm-std/src/types/cosmos/mod.rs +++ b/packages/provwasm-std/src/types/cosmos/mod.rs @@ -1,12 +1,30 @@ +pub mod app; pub mod auth; pub mod authz; pub mod bank; pub mod base; +pub mod circuit; +pub mod consensus; +pub mod crisis; pub mod crypto; pub mod distribution; +pub mod evidence; +pub mod feegrant; +pub mod genutil; pub mod gov; +pub mod group; +pub mod ics23; +pub mod mint; pub mod msg; +pub mod nft; +pub mod orm; +pub mod params; +pub mod quarantine; +pub mod query; +pub mod sanction; pub mod slashing; pub mod staking; +pub mod store; pub mod tx; pub mod upgrade; +pub mod vesting; diff --git a/packages/provwasm-std/src/types/cosmos/msg/mod.rs b/packages/provwasm-std/src/types/cosmos/msg/mod.rs index a3a6d96c..1ceda4f7 100644 --- a/packages/provwasm-std/src/types/cosmos/msg/mod.rs +++ b/packages/provwasm-std/src/types/cosmos/msg/mod.rs @@ -1 +1,2 @@ +pub mod textual; pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/msg/textual/mod.rs b/packages/provwasm-std/src/types/cosmos/msg/textual/mod.rs new file mode 100644 index 00000000..a3a6d96c --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/msg/textual/mod.rs @@ -0,0 +1 @@ +pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/msg/textual/v1.rs b/packages/provwasm-std/src/types/cosmos/msg/textual/v1.rs new file mode 100644 index 00000000..97897b43 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/msg/textual/v1.rs @@ -0,0 +1 @@ +use provwasm_proc_macro::CosmwasmExt; diff --git a/packages/provwasm-std/src/types/cosmos/nft/mod.rs b/packages/provwasm-std/src/types/cosmos/nft/mod.rs new file mode 100644 index 00000000..537a3360 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/nft/mod.rs @@ -0,0 +1,2 @@ +pub mod module; +pub mod v1beta1; diff --git a/packages/provwasm-std/src/types/cosmos/nft/module/mod.rs b/packages/provwasm-std/src/types/cosmos/nft/module/mod.rs new file mode 100644 index 00000000..a3a6d96c --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/nft/module/mod.rs @@ -0,0 +1 @@ +pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/nft/module/v1.rs b/packages/provwasm-std/src/types/cosmos/nft/module/v1.rs new file mode 100644 index 00000000..90f85556 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/nft/module/v1.rs @@ -0,0 +1,15 @@ +use provwasm_proc_macro::CosmwasmExt; +/// Module is the config object of the nft 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.nft.module.v1.Module")] +pub struct Module {} diff --git a/packages/provwasm-std/src/types/cosmos/nft/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/nft/v1beta1.rs new file mode 100644 index 00000000..72948707 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/nft/v1beta1.rs @@ -0,0 +1,591 @@ +use provwasm_proc_macro::CosmwasmExt; +/// EventSend is emitted on Msg/Send +#[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.nft.v1beta1.EventSend")] +pub struct EventSend { + /// class_id associated with the nft + #[prost(string, tag = "1")] + pub class_id: ::prost::alloc::string::String, + /// id is a unique identifier of the nft + #[prost(string, tag = "2")] + pub id: ::prost::alloc::string::String, + /// sender is the address of the owner of nft + #[prost(string, tag = "3")] + pub sender: ::prost::alloc::string::String, + /// receiver is the receiver address of nft + #[prost(string, tag = "4")] + pub receiver: ::prost::alloc::string::String, +} +/// EventMint is emitted on Mint +#[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.nft.v1beta1.EventMint")] +pub struct EventMint { + /// class_id associated with the nft + #[prost(string, tag = "1")] + pub class_id: ::prost::alloc::string::String, + /// id is a unique identifier of the nft + #[prost(string, tag = "2")] + pub id: ::prost::alloc::string::String, + /// owner is the owner address of the nft + #[prost(string, tag = "3")] + pub owner: ::prost::alloc::string::String, +} +/// EventBurn is emitted on Burn +#[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.nft.v1beta1.EventBurn")] +pub struct EventBurn { + /// class_id associated with the nft + #[prost(string, tag = "1")] + pub class_id: ::prost::alloc::string::String, + /// id is a unique identifier of the nft + #[prost(string, tag = "2")] + pub id: ::prost::alloc::string::String, + /// owner is the owner address of the nft + #[prost(string, tag = "3")] + pub owner: ::prost::alloc::string::String, +} +/// Class defines the class of the nft 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.nft.v1beta1.Class")] +pub struct Class { + /// id defines the unique identifier of the NFT classification, similar to the contract address of ERC721 + #[prost(string, tag = "1")] + pub id: ::prost::alloc::string::String, + /// name defines the human-readable name of the NFT classification. Optional + #[prost(string, tag = "2")] + pub name: ::prost::alloc::string::String, + /// symbol is an abbreviated name for nft classification. Optional + #[prost(string, tag = "3")] + pub symbol: ::prost::alloc::string::String, + /// description is a brief description of nft classification. Optional + #[prost(string, tag = "4")] + pub description: ::prost::alloc::string::String, + /// uri for the class metadata stored off chain. It can define schema for Class and NFT `Data` attributes. Optional + #[prost(string, tag = "5")] + pub uri: ::prost::alloc::string::String, + /// uri_hash is a hash of the document pointed by uri. Optional + #[prost(string, tag = "6")] + pub uri_hash: ::prost::alloc::string::String, + /// data is the app specific metadata of the NFT class. Optional + #[prost(message, optional, tag = "7")] + pub data: ::core::option::Option, +} +/// NFT defines the NFT. +#[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.nft.v1beta1.NFT")] +pub struct Nft { + /// class_id associated with the NFT, similar to the contract address of ERC721 + #[prost(string, tag = "1")] + pub class_id: ::prost::alloc::string::String, + /// id is a unique identifier of the NFT + #[prost(string, tag = "2")] + pub id: ::prost::alloc::string::String, + /// uri for the NFT metadata stored off chain + #[prost(string, tag = "3")] + pub uri: ::prost::alloc::string::String, + /// uri_hash is a hash of the document pointed by uri + #[prost(string, tag = "4")] + pub uri_hash: ::prost::alloc::string::String, + /// data is an app specific data of the NFT. Optional + #[prost(message, optional, tag = "10")] + pub data: ::core::option::Option, +} +/// GenesisState defines the nft module's genesis state. +#[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.nft.v1beta1.GenesisState")] +pub struct GenesisState { + /// class defines the class of the nft type. + #[prost(message, repeated, tag = "1")] + pub classes: ::prost::alloc::vec::Vec, + /// entry defines all nft owned by a person. + #[prost(message, repeated, tag = "2")] + pub entries: ::prost::alloc::vec::Vec, +} +/// Entry Defines all nft owned by a person +#[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.nft.v1beta1.Entry")] +pub struct Entry { + /// owner is the owner address of the following nft + #[prost(string, tag = "1")] + pub owner: ::prost::alloc::string::String, + /// nfts is a group of nfts of the same owner + #[prost(message, repeated, tag = "2")] + pub nfts: ::prost::alloc::vec::Vec, +} +/// QueryBalanceRequest is the request type for the Query/Balance 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.nft.v1beta1.QueryBalanceRequest")] +#[proto_query( + path = "/cosmos.nft.v1beta1.Query/Balance", + response_type = QueryBalanceResponse +)] +pub struct QueryBalanceRequest { + /// class_id associated with the nft + #[prost(string, tag = "1")] + pub class_id: ::prost::alloc::string::String, + /// owner is the owner address of the nft + #[prost(string, tag = "2")] + pub owner: ::prost::alloc::string::String, +} +/// QueryBalanceResponse is the response type for the Query/Balance 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.nft.v1beta1.QueryBalanceResponse")] +pub struct QueryBalanceResponse { + /// amount is the number of all NFTs of a given class owned by the owner + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub amount: u64, +} +/// QueryOwnerRequest is the request type for the Query/Owner 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.nft.v1beta1.QueryOwnerRequest")] +#[proto_query( + path = "/cosmos.nft.v1beta1.Query/Owner", + response_type = QueryOwnerResponse +)] +pub struct QueryOwnerRequest { + /// class_id associated with the nft + #[prost(string, tag = "1")] + pub class_id: ::prost::alloc::string::String, + /// id is a unique identifier of the NFT + #[prost(string, tag = "2")] + pub id: ::prost::alloc::string::String, +} +/// QueryOwnerResponse is the response type for the Query/Owner 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.nft.v1beta1.QueryOwnerResponse")] +pub struct QueryOwnerResponse { + /// owner is the owner address of the nft + #[prost(string, tag = "1")] + pub owner: ::prost::alloc::string::String, +} +/// QuerySupplyRequest is the request type for the Query/Supply 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.nft.v1beta1.QuerySupplyRequest")] +#[proto_query( + path = "/cosmos.nft.v1beta1.Query/Supply", + response_type = QuerySupplyResponse +)] +pub struct QuerySupplyRequest { + /// class_id associated with the nft + #[prost(string, tag = "1")] + pub class_id: ::prost::alloc::string::String, +} +/// QuerySupplyResponse is the response type for the Query/Supply 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.nft.v1beta1.QuerySupplyResponse")] +pub struct QuerySupplyResponse { + /// amount is the number of all NFTs from the given class + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub amount: u64, +} +/// QueryNFTstRequest is the request type for the Query/NFTs 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.nft.v1beta1.QueryNFTsRequest")] +#[proto_query( + path = "/cosmos.nft.v1beta1.Query/NFTs", + response_type = QueryNfTsResponse +)] +pub struct QueryNfTsRequest { + /// class_id associated with the nft + #[prost(string, tag = "1")] + pub class_id: ::prost::alloc::string::String, + /// owner is the owner address of the nft + #[prost(string, tag = "2")] + pub owner: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "3")] + pub pagination: ::core::option::Option, +} +/// QueryNFTsResponse is the response type for the Query/NFTs RPC methods +#[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.nft.v1beta1.QueryNFTsResponse")] +pub struct QueryNfTsResponse { + /// NFT defines the NFT + #[prost(message, repeated, tag = "1")] + pub nfts: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryNFTRequest is the request type for the Query/NFT 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.nft.v1beta1.QueryNFTRequest")] +#[proto_query(path = "/cosmos.nft.v1beta1.Query/NFT", response_type = QueryNftResponse)] +pub struct QueryNftRequest { + /// class_id associated with the nft + #[prost(string, tag = "1")] + pub class_id: ::prost::alloc::string::String, + /// id is a unique identifier of the NFT + #[prost(string, tag = "2")] + pub id: ::prost::alloc::string::String, +} +/// QueryNFTResponse is the response type for the Query/NFT 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.nft.v1beta1.QueryNFTResponse")] +pub struct QueryNftResponse { + /// owner is the owner address of the nft + #[prost(message, optional, tag = "1")] + pub nft: ::core::option::Option, +} +/// QueryClassRequest is the request type for the Query/Class 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.nft.v1beta1.QueryClassRequest")] +#[proto_query( + path = "/cosmos.nft.v1beta1.Query/Class", + response_type = QueryClassResponse +)] +pub struct QueryClassRequest { + /// class_id associated with the nft + #[prost(string, tag = "1")] + pub class_id: ::prost::alloc::string::String, +} +/// QueryClassResponse is the response type for the Query/Class 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.nft.v1beta1.QueryClassResponse")] +pub struct QueryClassResponse { + /// class defines the class of the nft type. + #[prost(message, optional, tag = "1")] + pub class: ::core::option::Option, +} +/// QueryClassesRequest is the request type for the Query/Classes 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.nft.v1beta1.QueryClassesRequest")] +#[proto_query( + path = "/cosmos.nft.v1beta1.Query/Classes", + response_type = QueryClassesResponse +)] +pub struct QueryClassesRequest { + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "1")] + pub pagination: ::core::option::Option, +} +/// QueryClassesResponse is the response type for the Query/Classes 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.nft.v1beta1.QueryClassesResponse")] +pub struct QueryClassesResponse { + /// class defines the class of the nft type. + #[prost(message, repeated, tag = "1")] + pub classes: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// MsgSend represents a message to send a nft from one account to another account. +#[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.nft.v1beta1.MsgSend")] +pub struct MsgSend { + /// class_id defines the unique identifier of the nft classification, similar to the contract address of ERC721 + #[prost(string, tag = "1")] + pub class_id: ::prost::alloc::string::String, + /// id defines the unique identification of nft + #[prost(string, tag = "2")] + pub id: ::prost::alloc::string::String, + /// sender is the address of the owner of nft + #[prost(string, tag = "3")] + pub sender: ::prost::alloc::string::String, + /// receiver is the receiver address of nft + #[prost(string, tag = "4")] + pub receiver: ::prost::alloc::string::String, +} +/// MsgSendResponse defines the Msg/Send 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.nft.v1beta1.MsgSendResponse")] +pub struct MsgSendResponse {} +pub struct NftQuerier<'a, Q: cosmwasm_std::CustomQuery> { + querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, +} +impl<'a, Q: cosmwasm_std::CustomQuery> NftQuerier<'a, Q> { + pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self { + Self { querier } + } + pub fn balance( + &self, + class_id: ::prost::alloc::string::String, + owner: ::prost::alloc::string::String, + ) -> Result { + QueryBalanceRequest { class_id, owner }.query(self.querier) + } + pub fn owner( + &self, + class_id: ::prost::alloc::string::String, + id: ::prost::alloc::string::String, + ) -> Result { + QueryOwnerRequest { class_id, id }.query(self.querier) + } + pub fn supply( + &self, + class_id: ::prost::alloc::string::String, + ) -> Result { + QuerySupplyRequest { class_id }.query(self.querier) + } + pub fn nf_ts( + &self, + class_id: ::prost::alloc::string::String, + owner: ::prost::alloc::string::String, + pagination: ::core::option::Option, + ) -> Result { + QueryNfTsRequest { + class_id, + owner, + pagination, + } + .query(self.querier) + } + pub fn nft( + &self, + class_id: ::prost::alloc::string::String, + id: ::prost::alloc::string::String, + ) -> Result { + QueryNftRequest { class_id, id }.query(self.querier) + } + pub fn class( + &self, + class_id: ::prost::alloc::string::String, + ) -> Result { + QueryClassRequest { class_id }.query(self.querier) + } + pub fn classes( + &self, + pagination: ::core::option::Option, + ) -> Result { + QueryClassesRequest { pagination }.query(self.querier) + } +} diff --git a/packages/provwasm-std/src/types/cosmos/orm/mod.rs b/packages/provwasm-std/src/types/cosmos/orm/mod.rs new file mode 100644 index 00000000..381cd4d2 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/orm/mod.rs @@ -0,0 +1,4 @@ +pub mod module; +pub mod query; +pub mod v1; +pub mod v1alpha1; diff --git a/packages/provwasm-std/src/types/cosmos/orm/module/mod.rs b/packages/provwasm-std/src/types/cosmos/orm/module/mod.rs new file mode 100644 index 00000000..32a5a9d4 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/orm/module/mod.rs @@ -0,0 +1 @@ +pub mod v1alpha1; diff --git a/packages/provwasm-std/src/types/cosmos/orm/module/v1alpha1.rs b/packages/provwasm-std/src/types/cosmos/orm/module/v1alpha1.rs new file mode 100644 index 00000000..a9a0bb59 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/orm/module/v1alpha1.rs @@ -0,0 +1,17 @@ +use provwasm_proc_macro::CosmwasmExt; +/// Module defines the ORM module which adds providers to the app container for +/// ORM ModuleDB's and in the future will automatically register query +/// services for modules that use the ORM. +#[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.orm.module.v1alpha1.Module")] +pub struct Module {} diff --git a/packages/provwasm-std/src/types/cosmos/orm/query/mod.rs b/packages/provwasm-std/src/types/cosmos/orm/query/mod.rs new file mode 100644 index 00000000..32a5a9d4 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/orm/query/mod.rs @@ -0,0 +1 @@ +pub mod v1alpha1; diff --git a/packages/provwasm-std/src/types/cosmos/orm/query/v1alpha1.rs b/packages/provwasm-std/src/types/cosmos/orm/query/v1alpha1.rs new file mode 100644 index 00000000..0780f073 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/orm/query/v1alpha1.rs @@ -0,0 +1,274 @@ +use provwasm_proc_macro::CosmwasmExt; +/// GetRequest is the Query/Get request 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.orm.query.v1alpha1.GetRequest")] +#[proto_query( + path = "/cosmos.orm.query.v1alpha1.Query/Get", + response_type = GetResponse +)] +pub struct GetRequest { + /// message_name is the fully-qualified message name of the ORM table being queried. + #[prost(string, tag = "1")] + pub message_name: ::prost::alloc::string::String, + /// index is the index fields expression used in orm definitions. If it + /// is empty, the table's primary key is assumed. If it is non-empty, it must + /// refer to an unique index. + #[prost(string, tag = "2")] + pub index: ::prost::alloc::string::String, + /// values are the values of the fields corresponding to the requested index. + /// There must be as many values provided as there are fields in the index and + /// these values must correspond to the index field types. + #[prost(message, repeated, tag = "3")] + pub values: ::prost::alloc::vec::Vec, +} +/// GetResponse is the Query/Get 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.orm.query.v1alpha1.GetResponse")] +pub struct GetResponse { + /// result is the result of the get query. If no value is found, the gRPC + /// status code NOT_FOUND will be returned. + #[prost(message, optional, tag = "1")] + pub result: ::core::option::Option, +} +/// ListRequest is the Query/List request 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.orm.query.v1alpha1.ListRequest")] +#[proto_query( + path = "/cosmos.orm.query.v1alpha1.Query/List", + response_type = ListResponse +)] +pub struct ListRequest { + /// message_name is the fully-qualified message name of the ORM table being queried. + #[prost(string, tag = "1")] + pub message_name: ::prost::alloc::string::String, + /// index is the index fields expression used in orm definitions. If it + /// is empty, the table's primary key is assumed. + #[prost(string, tag = "2")] + pub index: ::prost::alloc::string::String, + /// pagination is the pagination request. + #[prost(message, optional, tag = "5")] + pub pagination: ::core::option::Option, + /// query is the query expression corresponding to the provided index. If + /// neither prefix nor range is specified, the query will list all the fields + /// in the index. + #[prost(oneof = "list_request::Query", tags = "3, 4")] + pub query: ::core::option::Option, +} +/// Nested message and enum types in `ListRequest`. +pub mod list_request { + use provwasm_proc_macro::CosmwasmExt; + /// Prefix specifies the arguments to a prefix query. + #[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.orm.query.v1alpha1.ListRequest.Prefix")] + pub struct Prefix { + /// values specifies the index values for the prefix query. + /// It is valid to special a partial prefix with fewer values than + /// the number of fields in the index. + #[prost(message, repeated, tag = "1")] + pub values: ::prost::alloc::vec::Vec, + } + /// Range specifies the arguments to a range query. + #[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.orm.query.v1alpha1.ListRequest.Range")] + pub struct Range { + /// start specifies the starting index values for the range query. + /// It is valid to provide fewer values than the number of fields in the + /// index. + #[prost(message, repeated, tag = "1")] + pub start: ::prost::alloc::vec::Vec, + /// end specifies the inclusive ending index values for the range query. + /// It is valid to provide fewer values than the number of fields in the + /// index. + #[prost(message, repeated, tag = "2")] + pub end: ::prost::alloc::vec::Vec, + } + /// query is the query expression corresponding to the provided index. If + /// neither prefix nor range is specified, the query will list all the fields + /// in the index. + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive( + Clone, + PartialEq, + Eq, + ::prost::Oneof, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + )] + pub enum Query { + /// prefix defines a prefix query. + #[prost(message, tag = "3")] + Prefix(Prefix), + /// range defines a range query. + #[prost(message, tag = "4")] + Range(Range), + } +} +/// ListResponse is the Query/List 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.orm.query.v1alpha1.ListResponse")] +pub struct ListResponse { + /// results are the results of the query. + #[prost(message, repeated, tag = "1")] + pub results: ::prost::alloc::vec::Vec, + /// pagination is the pagination response. + #[prost(message, optional, tag = "5")] + pub pagination: ::core::option::Option, +} +/// IndexValue represents the value of a field in an ORM index expression. +#[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.orm.query.v1alpha1.IndexValue")] +pub struct IndexValue { + /// value specifies the index value + #[prost(oneof = "index_value::Value", tags = "1, 2, 3, 4, 5, 6, 7, 8")] + pub value: ::core::option::Option, +} +/// Nested message and enum types in `IndexValue`. +pub mod index_value { + use provwasm_proc_macro::CosmwasmExt; + /// value specifies the index value + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive( + Clone, + PartialEq, + Eq, + ::prost::Oneof, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + )] + pub enum Value { + /// uint specifies a value for an uint32, fixed32, uint64, or fixed64 + /// index field. + #[prost(uint64, tag = "1")] + Uint(u64), + /// int64 specifies a value for an int32, sfixed32, int64, or sfixed64 + /// index field. + #[prost(int64, tag = "2")] + Int(i64), + /// str specifies a value for a string index field. + #[prost(string, tag = "3")] + Str(::prost::alloc::string::String), + /// bytes specifies a value for a bytes index field. + #[prost(bytes, tag = "4")] + Bytes(::prost::alloc::vec::Vec), + /// enum specifies a value for an enum index field. + #[prost(string, tag = "5")] + Enum(::prost::alloc::string::String), + /// bool specifies a value for a bool index field. + #[prost(bool, tag = "6")] + Bool(bool), + /// timestamp specifies a value for a timestamp index field. + #[prost(message, tag = "7")] + Timestamp(crate::shim::Timestamp), + /// duration specifies a value for a duration index field. + #[prost(message, tag = "8")] + Duration(crate::shim::Duration), + } +} +pub struct V1alpha1Querier<'a, Q: cosmwasm_std::CustomQuery> { + querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, +} +impl<'a, Q: cosmwasm_std::CustomQuery> V1alpha1Querier<'a, Q> { + pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self { + Self { querier } + } + pub fn get( + &self, + message_name: ::prost::alloc::string::String, + index: ::prost::alloc::string::String, + values: ::prost::alloc::vec::Vec, + ) -> Result { + GetRequest { + message_name, + index, + values, + } + .query(self.querier) + } + pub fn list( + &self, + message_name: ::prost::alloc::string::String, + index: ::prost::alloc::string::String, + pagination: ::core::option::Option, + query: ::core::option::Option, + ) -> Result { + ListRequest { + message_name, + index, + pagination, + query, + } + .query(self.querier) + } +} diff --git a/packages/provwasm-std/src/types/cosmos/orm/v1.rs b/packages/provwasm-std/src/types/cosmos/orm/v1.rs new file mode 100644 index 00000000..27fba007 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/orm/v1.rs @@ -0,0 +1,148 @@ +use provwasm_proc_macro::CosmwasmExt; +/// TableDescriptor describes an ORM table. +#[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.orm.v1.TableDescriptor")] +pub struct TableDescriptor { + /// primary_key defines the primary key for the table. + #[prost(message, optional, tag = "1")] + pub primary_key: ::core::option::Option, + /// index defines one or more secondary indexes. + #[prost(message, repeated, tag = "2")] + pub index: ::prost::alloc::vec::Vec, + /// id is a non-zero integer ID that must be unique within the + /// tables and singletons in this file. It may be deprecated in the future when this + /// can be auto-generated. + #[prost(uint32, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub id: u32, +} +/// PrimaryKeyDescriptor describes a table primary key. +#[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.orm.v1.PrimaryKeyDescriptor")] +pub struct PrimaryKeyDescriptor { + /// fields is a comma-separated list of fields in the primary key. Spaces are + /// not allowed. Supported field types, their encodings, and any applicable constraints + /// are described below. + /// - uint32 are encoded as 2,3,4 or 5 bytes using a compact encoding that + /// is suitable for sorted iteration (not varint encoding). This type is + /// well-suited for small integers. + /// - uint64 are encoded as 2,4,6 or 9 bytes using a compact encoding that + /// is suitable for sorted iteration (not varint encoding). This type is + /// well-suited for small integers such as auto-incrementing sequences. + /// - fixed32, fixed64 are encoded as big-endian fixed width bytes and support + /// sorted iteration. These types are well-suited for encoding fixed with + /// decimals as integers. + /// - string's are encoded as raw bytes in terminal key segments and null-terminated + /// in non-terminal segments. Null characters are thus forbidden in strings. + /// string fields support sorted iteration. + /// - bytes are encoded as raw bytes in terminal segments and length-prefixed + /// with a 32-bit unsigned varint in non-terminal segments. + /// - int32, sint32, int64, sint64, sfixed32, sfixed64 are encoded as fixed width bytes with + /// an encoding that enables sorted iteration. + /// - google.protobuf.Timestamp is encoded such that values with only seconds occupy 6 bytes, + /// values including nanos occupy 9 bytes, and nil values occupy 1 byte. When iterating, nil + /// values will always be ordered last. Seconds and nanos values must conform to the officially + /// specified ranges of 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z and 0 to 999,999,999 respectively. + /// - google.protobuf.Duration is encoded as 12 bytes using an encoding that enables sorted iteration. + /// - enum fields are encoded using varint encoding and do not support sorted + /// iteration. + /// - bool fields are encoded as a single byte 0 or 1. + /// + /// All other fields types are unsupported in keys including repeated and + /// oneof fields. + /// + /// Primary keys are prefixed by the varint encoded table id and the byte 0x0 + /// plus any additional prefix specified by the schema. + #[prost(string, tag = "1")] + pub fields: ::prost::alloc::string::String, + /// auto_increment specifies that the primary key is generated by an + /// auto-incrementing integer. If this is set to true fields must only + /// contain one field of that is of type uint64. + #[prost(bool, tag = "2")] + pub auto_increment: bool, +} +/// PrimaryKeyDescriptor describes a table secondary index. +#[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.orm.v1.SecondaryIndexDescriptor")] +pub struct SecondaryIndexDescriptor { + /// fields is a comma-separated list of fields in the index. The supported + /// field types are the same as those for PrimaryKeyDescriptor.fields. + /// Index keys are prefixed by the varint encoded table id and the varint + /// encoded index id plus any additional prefix specified by the schema. + /// + /// In addition the field segments, non-unique index keys are suffixed with + /// any additional primary key fields not present in the index fields so that the + /// primary key can be reconstructed. Unique indexes instead of being suffixed + /// store the remaining primary key fields in the value.. + #[prost(string, tag = "1")] + pub fields: ::prost::alloc::string::String, + /// id is a non-zero integer ID that must be unique within the indexes for this + /// table and less than 32768. It may be deprecated in the future when this can + /// be auto-generated. + #[prost(uint32, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub id: u32, + /// unique specifies that this an unique index. + #[prost(bool, tag = "3")] + pub unique: bool, +} +/// TableDescriptor describes an ORM singleton table which has at most one instance. +#[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.orm.v1.SingletonDescriptor")] +pub struct SingletonDescriptor { + /// id is a non-zero integer ID that must be unique within the + /// tables and singletons in this file. It may be deprecated in the future when this + /// can be auto-generated. + #[prost(uint32, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub id: u32, +} diff --git a/packages/provwasm-std/src/types/cosmos/orm/v1alpha1.rs b/packages/provwasm-std/src/types/cosmos/orm/v1alpha1.rs new file mode 100644 index 00000000..7e9ed712 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/orm/v1alpha1.rs @@ -0,0 +1,108 @@ +use provwasm_proc_macro::CosmwasmExt; +/// ModuleSchemaDescriptor describe's a module's ORM schema. +#[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.orm.v1alpha1.ModuleSchemaDescriptor")] +pub struct ModuleSchemaDescriptor { + #[prost(message, repeated, tag = "1")] + pub schema_file: ::prost::alloc::vec::Vec, + /// prefix is an optional prefix that precedes all keys in this module's + /// store. + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub prefix: ::prost::alloc::vec::Vec, +} +/// Nested message and enum types in `ModuleSchemaDescriptor`. +pub mod module_schema_descriptor { + use provwasm_proc_macro::CosmwasmExt; + /// FileEntry describes an ORM file used in a 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.orm.v1alpha1.ModuleSchemaDescriptor.FileEntry")] + pub struct FileEntry { + /// id is a prefix that will be varint encoded and prepended to all the + /// table keys specified in the file's tables. + #[prost(uint32, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub id: u32, + /// proto_file_name is the name of a file .proto in that contains + /// table definitions. The .proto file must be in a package that the + /// module has referenced using cosmos.app.v1.ModuleDescriptor.use_package. + #[prost(string, tag = "2")] + pub proto_file_name: ::prost::alloc::string::String, + /// storage_type optionally indicates the type of storage this file's + /// tables should used. If it is left unspecified, the default KV-storage + /// of the app will be used. + #[prost(enumeration = "super::StorageType", tag = "3")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub storage_type: i32, + } +} +/// StorageType +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +pub enum StorageType { + /// STORAGE_TYPE_DEFAULT_UNSPECIFIED indicates the persistent storage where all + /// data is stored in the regular Merkle-tree backed KV-store. + DefaultUnspecified = 0, + /// STORAGE_TYPE_MEMORY indicates in-memory storage that will be + /// reloaded every time an app restarts. Tables with this type of storage + /// will by default be ignored when importing and exporting a module's + /// state from JSON. + Memory = 1, + /// STORAGE_TYPE_TRANSIENT indicates transient storage that is reset + /// at the end of every block. Tables with this type of storage + /// will by default be ignored when importing and exporting a module's + /// state from JSON. + Transient = 2, +} +impl StorageType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + StorageType::DefaultUnspecified => "STORAGE_TYPE_DEFAULT_UNSPECIFIED", + StorageType::Memory => "STORAGE_TYPE_MEMORY", + StorageType::Transient => "STORAGE_TYPE_TRANSIENT", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "STORAGE_TYPE_DEFAULT_UNSPECIFIED" => Some(Self::DefaultUnspecified), + "STORAGE_TYPE_MEMORY" => Some(Self::Memory), + "STORAGE_TYPE_TRANSIENT" => Some(Self::Transient), + _ => None, + } + } +} diff --git a/packages/provwasm-std/src/types/cosmos/params/mod.rs b/packages/provwasm-std/src/types/cosmos/params/mod.rs new file mode 100644 index 00000000..537a3360 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/params/mod.rs @@ -0,0 +1,2 @@ +pub mod module; +pub mod v1beta1; diff --git a/packages/provwasm-std/src/types/cosmos/params/module/mod.rs b/packages/provwasm-std/src/types/cosmos/params/module/mod.rs new file mode 100644 index 00000000..a3a6d96c --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/params/module/mod.rs @@ -0,0 +1 @@ +pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/params/module/v1.rs b/packages/provwasm-std/src/types/cosmos/params/module/v1.rs new file mode 100644 index 00000000..a304e1e7 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/params/module/v1.rs @@ -0,0 +1,15 @@ +use provwasm_proc_macro::CosmwasmExt; +/// Module is the config object of the params 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.params.module.v1.Module")] +pub struct Module {} diff --git a/packages/provwasm-std/src/types/cosmos/params/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/params/v1beta1.rs new file mode 100644 index 00000000..f1c27c00 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/params/v1beta1.rs @@ -0,0 +1,168 @@ +use provwasm_proc_macro::CosmwasmExt; +/// ParameterChangeProposal defines a proposal to change one or more parameters. +#[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.params.v1beta1.ParameterChangeProposal")] +pub struct ParameterChangeProposal { + #[prost(string, tag = "1")] + pub title: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "3")] + pub changes: ::prost::alloc::vec::Vec, +} +/// ParamChange defines an individual parameter change, for use in +/// ParameterChangeProposal. +#[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.params.v1beta1.ParamChange")] +pub struct ParamChange { + #[prost(string, tag = "1")] + pub subspace: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub key: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub value: ::prost::alloc::string::String, +} +/// QueryParamsRequest is request type for the Query/Params 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.params.v1beta1.QueryParamsRequest")] +#[proto_query( + path = "/cosmos.params.v1beta1.Query/Params", + response_type = QueryParamsResponse +)] +pub struct QueryParamsRequest { + /// subspace defines the module to query the parameter for. + #[prost(string, tag = "1")] + pub subspace: ::prost::alloc::string::String, + /// key defines the key of the parameter in the subspace. + #[prost(string, tag = "2")] + pub key: ::prost::alloc::string::String, +} +/// QueryParamsResponse is response type for the Query/Params 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.params.v1beta1.QueryParamsResponse")] +pub struct QueryParamsResponse { + /// param defines the queried parameter. + #[prost(message, optional, tag = "1")] + pub param: ::core::option::Option, +} +/// QuerySubspacesRequest defines a request type for querying for all registered +/// subspaces and all keys for a subspace. +/// +/// 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.params.v1beta1.QuerySubspacesRequest")] +#[proto_query( + path = "/cosmos.params.v1beta1.Query/Subspaces", + response_type = QuerySubspacesResponse +)] +pub struct QuerySubspacesRequest {} +/// QuerySubspacesResponse defines the response types for querying for all +/// registered subspaces and all keys for a subspace. +/// +/// 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.params.v1beta1.QuerySubspacesResponse")] +pub struct QuerySubspacesResponse { + #[prost(message, repeated, tag = "1")] + pub subspaces: ::prost::alloc::vec::Vec, +} +/// Subspace defines a parameter subspace name and all the keys that exist for +/// the subspace. +/// +/// 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.params.v1beta1.Subspace")] +pub struct Subspace { + #[prost(string, tag = "1")] + pub subspace: ::prost::alloc::string::String, + #[prost(string, repeated, tag = "2")] + pub keys: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +pub struct ParamsQuerier<'a, Q: cosmwasm_std::CustomQuery> { + querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, +} +impl<'a, Q: cosmwasm_std::CustomQuery> ParamsQuerier<'a, Q> { + pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self { + Self { querier } + } + pub fn params( + &self, + subspace: ::prost::alloc::string::String, + key: ::prost::alloc::string::String, + ) -> Result { + QueryParamsRequest { subspace, key }.query(self.querier) + } + pub fn subspaces(&self) -> Result { + QuerySubspacesRequest {}.query(self.querier) + } +} diff --git a/packages/provwasm-std/src/types/cosmos/quarantine/mod.rs b/packages/provwasm-std/src/types/cosmos/quarantine/mod.rs new file mode 100644 index 00000000..9f64fc82 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/quarantine/mod.rs @@ -0,0 +1 @@ +pub mod v1beta1; diff --git a/packages/provwasm-std/src/types/cosmos/quarantine/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/quarantine/v1beta1.rs new file mode 100644 index 00000000..9d5b02f0 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/quarantine/v1beta1.rs @@ -0,0 +1,619 @@ +use provwasm_proc_macro::CosmwasmExt; +/// EventOptIn is an event emitted when an address opts into quarantine. +#[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.quarantine.v1beta1.EventOptIn")] +pub struct EventOptIn { + #[prost(string, tag = "1")] + pub to_address: ::prost::alloc::string::String, +} +/// EventOptOut is an event emitted when an address opts out of quarantine. +#[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.quarantine.v1beta1.EventOptOut")] +pub struct EventOptOut { + #[prost(string, tag = "1")] + pub to_address: ::prost::alloc::string::String, +} +/// EventFundsQuarantined is an event emitted when funds are quarantined. +#[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.quarantine.v1beta1.EventFundsQuarantined")] +pub struct EventFundsQuarantined { + #[prost(string, tag = "1")] + pub to_address: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] + pub coins: ::prost::alloc::vec::Vec, +} +/// EventFundsReleased is an event emitted when quarantined funds are accepted and released. +#[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.quarantine.v1beta1.EventFundsReleased")] +pub struct EventFundsReleased { + #[prost(string, tag = "1")] + pub to_address: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] + pub coins: ::prost::alloc::vec::Vec, +} +/// QuarantinedFunds defines structure that represents coins that have been quarantined. +#[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.quarantine.v1beta1.QuarantinedFunds")] +pub struct QuarantinedFunds { + /// to_address is the intended recipient of the coins that have been quarantined. + #[prost(string, tag = "1")] + pub to_address: ::prost::alloc::string::String, + /// unaccepted_from_addresses are the senders that have not been part of an accept yet for these coins. + #[prost(string, repeated, tag = "2")] + pub unaccepted_from_addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// coins is the amount currently in quarantined for the two addresses. + #[prost(message, repeated, tag = "3")] + pub coins: ::prost::alloc::vec::Vec, + /// declined is true if these funds were previously declined. + #[prost(bool, tag = "4")] + pub declined: bool, +} +/// AutoResponseEntry defines the auto response to one address from another. +#[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.quarantine.v1beta1.AutoResponseEntry")] +pub struct AutoResponseEntry { + /// to_address is the receiving address. + #[prost(string, tag = "1")] + pub to_address: ::prost::alloc::string::String, + /// from_address is the sending address. + #[prost(string, tag = "2")] + pub from_address: ::prost::alloc::string::String, + /// response is the auto-response setting for these two addresses. + #[prost(enumeration = "AutoResponse", tag = "3")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub response: i32, +} +/// AutoResponseUpdate defines a quarantine auto response update that should be applied. +#[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.quarantine.v1beta1.AutoResponseUpdate")] +pub struct AutoResponseUpdate { + /// from_address is the address that funds would be coming from. + #[prost(string, tag = "1")] + pub from_address: ::prost::alloc::string::String, + /// response is the automatic action to take on funds sent from from_address. + /// Provide AUTO_RESPONSE_UNSPECIFIED to turn off an auto-response. + #[prost(enumeration = "AutoResponse", tag = "2")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub response: i32, +} +/// QuarantineRecord defines information regarding quarantined funds that is stored in state. +#[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.quarantine.v1beta1.QuarantineRecord")] +pub struct QuarantineRecord { + /// unaccepted_from_addresses are the senders that have not been part of an accept yet for these coins. + #[prost(bytes = "vec", repeated, tag = "1")] + pub unaccepted_from_addresses: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, + /// accepted_from_addresses are the senders that have already been part of an accept for these coins. + #[prost(bytes = "vec", repeated, tag = "2")] + pub accepted_from_addresses: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, + /// coins is the amount that has been quarantined. + #[prost(message, repeated, tag = "3")] + pub coins: ::prost::alloc::vec::Vec, + /// declined is whether these funds have been declined. + #[prost(bool, tag = "4")] + pub declined: bool, +} +/// QuarantineRecordSuffixIndex defines a list of record suffixes that can be stored in state and used as an index. +#[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.quarantine.v1beta1.QuarantineRecordSuffixIndex")] +pub struct QuarantineRecordSuffixIndex { + #[prost(bytes = "vec", repeated, tag = "1")] + pub record_suffixes: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, +} +/// AutoResponse enumerates the quarantine auto-response options. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +pub enum AutoResponse { + /// AUTO_RESPONSE_UNSPECIFIED defines that an automatic response has not been specified. + /// This means that no automatic action should be taken, i.e. this auto-response is off, + /// and default quarantine behavior is used. + Unspecified = 0, + /// AUTO_RESPONSE_ACCEPT defines that sends should be automatically accepted, bypassing quarantine. + Accept = 1, + /// AUTO_RESPONSE_DECLINE defines that sends should be automatically declined. + Decline = 2, +} +impl AutoResponse { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + AutoResponse::Unspecified => "AUTO_RESPONSE_UNSPECIFIED", + AutoResponse::Accept => "AUTO_RESPONSE_ACCEPT", + AutoResponse::Decline => "AUTO_RESPONSE_DECLINE", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "AUTO_RESPONSE_UNSPECIFIED" => Some(Self::Unspecified), + "AUTO_RESPONSE_ACCEPT" => Some(Self::Accept), + "AUTO_RESPONSE_DECLINE" => Some(Self::Decline), + _ => None, + } + } +} +/// GenesisState defines the quarantine module's genesis state. +#[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.quarantine.v1beta1.GenesisState")] +pub struct GenesisState { + /// quarantined_addresses defines account addresses that are opted into quarantine. + #[prost(string, repeated, tag = "1")] + pub quarantined_addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// auto_responses defines the quarantine auto-responses for addresses. + #[prost(message, repeated, tag = "2")] + pub auto_responses: ::prost::alloc::vec::Vec, + /// quarantined_funds defines funds that are quarantined. + #[prost(message, repeated, tag = "3")] + pub quarantined_funds: ::prost::alloc::vec::Vec, +} +/// QueryIsQuarantinedRequest defines the RPC request for checking if an account has opted into quarantine. +#[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.quarantine.v1beta1.QueryIsQuarantinedRequest")] +#[proto_query( + path = "/cosmos.quarantine.v1beta1.Query/IsQuarantined", + response_type = QueryIsQuarantinedResponse +)] +pub struct QueryIsQuarantinedRequest { + /// to_address is the address to check. + #[prost(string, tag = "1")] + pub to_address: ::prost::alloc::string::String, +} +/// QueryIsQuarantinedResponse defines the RPC response of an IsQuarantined query. +#[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.quarantine.v1beta1.QueryIsQuarantinedResponse")] +pub struct QueryIsQuarantinedResponse { + /// is_quarantined is true if the to_address has opted into quarantine. + #[prost(bool, tag = "1")] + pub is_quarantined: bool, +} +/// QueryQuarantinedFundsRequest defines the RPC request for looking up quarantined funds. +#[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.quarantine.v1beta1.QueryQuarantinedFundsRequest")] +#[proto_query( + path = "/cosmos.quarantine.v1beta1.Query/QuarantinedFunds", + response_type = QueryQuarantinedFundsResponse +)] +pub struct QueryQuarantinedFundsRequest { + /// to_address is the intended recipient of the coins that have been quarantined. + #[prost(string, tag = "1")] + pub to_address: ::prost::alloc::string::String, + /// from_address is the sender of the coins. If provided, a to_address must also be provided. + #[prost(string, tag = "2")] + pub from_address: ::prost::alloc::string::String, + /// pagination defines optional pagination parameters for the request. + #[prost(message, optional, tag = "99")] + pub pagination: ::core::option::Option, +} +/// QueryQuarantinedFundsResponse defines the RPC response of a QuarantinedFunds query. +#[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.quarantine.v1beta1.QueryQuarantinedFundsResponse")] +pub struct QueryQuarantinedFundsResponse { + /// quarantinedFunds is info about coins sitting in quarantine. + #[prost(message, repeated, tag = "1")] + pub quarantined_funds: ::prost::alloc::vec::Vec, + /// pagination defines the pagination parameters of the response. + #[prost(message, optional, tag = "99")] + pub pagination: ::core::option::Option, +} +/// QueryAutoResponsesRequest defines the RPC request for getting auto-response settings for an address. +#[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.quarantine.v1beta1.QueryAutoResponsesRequest")] +#[proto_query( + path = "/cosmos.quarantine.v1beta1.Query/AutoResponses", + response_type = QueryAutoResponsesResponse +)] +pub struct QueryAutoResponsesRequest { + /// to_address is the quarantined account to get info on. + #[prost(string, tag = "1")] + pub to_address: ::prost::alloc::string::String, + /// from_address is an optional sender address to limit results. + #[prost(string, tag = "2")] + pub from_address: ::prost::alloc::string::String, + /// pagination defines optional pagination parameters for the request. + #[prost(message, optional, tag = "99")] + pub pagination: ::core::option::Option, +} +/// QueryAutoResponsesResponse defines the RPC response of a AutoResponses query. +#[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.quarantine.v1beta1.QueryAutoResponsesResponse")] +pub struct QueryAutoResponsesResponse { + /// auto_responses are the auto-response entries from the provided query. + #[prost(message, repeated, tag = "1")] + pub auto_responses: ::prost::alloc::vec::Vec, + /// pagination defines the pagination parameters of the response. + #[prost(message, optional, tag = "99")] + pub pagination: ::core::option::Option, +} +/// MsgOptIn represents a message for opting in to account quarantine. +#[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.quarantine.v1beta1.MsgOptIn")] +pub struct MsgOptIn { + #[prost(string, tag = "1")] + pub to_address: ::prost::alloc::string::String, +} +/// MsgOptInResponse defines the Msg/OptIn 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.quarantine.v1beta1.MsgOptInResponse")] +pub struct MsgOptInResponse {} +/// MsgOptOut represents a message for opting in to account quarantine. +#[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.quarantine.v1beta1.MsgOptOut")] +pub struct MsgOptOut { + #[prost(string, tag = "1")] + pub to_address: ::prost::alloc::string::String, +} +/// MsgOptOutResponse defines the Msg/OptOut 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.quarantine.v1beta1.MsgOptOutResponse")] +pub struct MsgOptOutResponse {} +/// MsgAccept represents a message for accepting quarantined funds. +#[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.quarantine.v1beta1.MsgAccept")] +pub struct MsgAccept { + /// to_address is the address of the quarantined account that is accepting funds. + #[prost(string, tag = "1")] + pub to_address: ::prost::alloc::string::String, + /// from_addresses is one or more addresses that have sent funds to the quarantined account. + /// All funds quarantined for to_address from any from_addresses are marked as accepted and released if appropriate. + /// At least one is required. + #[prost(string, repeated, tag = "2")] + pub from_addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// permanent, if true, sets up auto-accept for the to_address from each from_address. + /// If false (default), only the currently quarantined funds will be accepted. + #[prost(bool, tag = "3")] + pub permanent: bool, +} +/// MsgAcceptResponse defines the Msg/Accept 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.quarantine.v1beta1.MsgAcceptResponse")] +pub struct MsgAcceptResponse { + /// funds_released is the amount that was quarantined but has now been released and sent to the requester. + #[prost(message, repeated, tag = "1")] + pub funds_released: ::prost::alloc::vec::Vec, +} +/// MsgDecline represents a message for declining quarantined funds. +#[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.quarantine.v1beta1.MsgDecline")] +pub struct MsgDecline { + /// to_address is the address of the quarantined account that is accepting funds. + #[prost(string, tag = "1")] + pub to_address: ::prost::alloc::string::String, + /// from_addresses is one or more addresses that have sent funds to the quarantined account. + /// All funds quarantined for to_address from any from_addresses are marked as declined. + /// At least one is required. + #[prost(string, repeated, tag = "2")] + pub from_addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// permanent, if true, sets up auto-decline for the to_address from each from_address. + /// If false (default), only the currently quarantined funds will be declined. + #[prost(bool, tag = "3")] + pub permanent: bool, +} +/// MsgDeclineResponse defines the Msg/Decline 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.quarantine.v1beta1.MsgDeclineResponse")] +pub struct MsgDeclineResponse {} +/// MsgUpdateAutoResponses represents a message for updating quarantine auto-responses for a receiving address. +#[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.quarantine.v1beta1.MsgUpdateAutoResponses")] +pub struct MsgUpdateAutoResponses { + /// to_address is the quarantined address that would be accepting or declining funds. + #[prost(string, tag = "1")] + pub to_address: ::prost::alloc::string::String, + /// updates is the list of addresses and auto-responses that should be updated for the to_address. + #[prost(message, repeated, tag = "2")] + pub updates: ::prost::alloc::vec::Vec, +} +/// MsgUpdateAutoResponsesResponse defines the Msg/UpdateAutoResponse 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.quarantine.v1beta1.MsgUpdateAutoResponsesResponse")] +pub struct MsgUpdateAutoResponsesResponse {} +pub struct QuarantineQuerier<'a, Q: cosmwasm_std::CustomQuery> { + querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, +} +impl<'a, Q: cosmwasm_std::CustomQuery> QuarantineQuerier<'a, Q> { + pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self { + Self { querier } + } + pub fn is_quarantined( + &self, + to_address: ::prost::alloc::string::String, + ) -> Result { + QueryIsQuarantinedRequest { to_address }.query(self.querier) + } + pub fn quarantined_funds( + &self, + to_address: ::prost::alloc::string::String, + from_address: ::prost::alloc::string::String, + pagination: ::core::option::Option, + ) -> Result { + QueryQuarantinedFundsRequest { + to_address, + from_address, + pagination, + } + .query(self.querier) + } + pub fn auto_responses( + &self, + to_address: ::prost::alloc::string::String, + from_address: ::prost::alloc::string::String, + pagination: ::core::option::Option, + ) -> Result { + QueryAutoResponsesRequest { + to_address, + from_address, + pagination, + } + .query(self.querier) + } +} diff --git a/packages/provwasm-std/src/types/cosmos/query/mod.rs b/packages/provwasm-std/src/types/cosmos/query/mod.rs new file mode 100644 index 00000000..a3a6d96c --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/query/mod.rs @@ -0,0 +1 @@ +pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/query/v1.rs b/packages/provwasm-std/src/types/cosmos/query/v1.rs new file mode 100644 index 00000000..97897b43 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/query/v1.rs @@ -0,0 +1 @@ +use provwasm_proc_macro::CosmwasmExt; diff --git a/packages/provwasm-std/src/types/cosmos/sanction/mod.rs b/packages/provwasm-std/src/types/cosmos/sanction/mod.rs new file mode 100644 index 00000000..9f64fc82 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/sanction/mod.rs @@ -0,0 +1 @@ +pub mod v1beta1; diff --git a/packages/provwasm-std/src/types/cosmos/sanction/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/sanction/v1beta1.rs new file mode 100644 index 00000000..3ff6bf02 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/sanction/v1beta1.rs @@ -0,0 +1,506 @@ +use provwasm_proc_macro::CosmwasmExt; +/// EventAddressSanctioned is an event emitted when an address is sanctioned. +#[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.sanction.v1beta1.EventAddressSanctioned")] +pub struct EventAddressSanctioned { + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, +} +/// EventAddressUnsanctioned is an event emitted when an address is unsanctioned. +#[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.sanction.v1beta1.EventAddressUnsanctioned")] +pub struct EventAddressUnsanctioned { + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, +} +/// EventTempAddressSanctioned is an event emitted when an address is temporarily sanctioned. +#[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.sanction.v1beta1.EventTempAddressSanctioned")] +pub struct EventTempAddressSanctioned { + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, +} +/// EventTempAddressUnsanctioned is an event emitted when an address is temporarily unsanctioned. +#[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.sanction.v1beta1.EventTempAddressUnsanctioned")] +pub struct EventTempAddressUnsanctioned { + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, +} +/// EventParamsUpdated is an event emitted when the sanction module params are updated. +#[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.sanction.v1beta1.EventParamsUpdated")] +pub struct EventParamsUpdated {} +/// Params defines the configurable parameters of the sanction 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.sanction.v1beta1.Params")] +pub struct Params { + /// immediate_sanction_min_deposit is the minimum deposit for a sanction to happen immediately. + /// If this is zero, immediate sanctioning is not available. + /// Otherwise, if a sanction governance proposal is issued with a deposit at least this large, a temporary sanction + /// will be immediately issued that will expire when voting ends on the governance proposal. + #[prost(message, repeated, tag = "1")] + pub immediate_sanction_min_deposit: ::prost::alloc::vec::Vec, + /// immediate_unsanction_min_deposit is the minimum deposit for an unsanction to happen immediately. + /// If this is zero, immediate unsanctioning is not available. + /// Otherwise, if an unsanction governance proposal is issued with a deposit at least this large, a temporary + /// unsanction will be immediately issued that will expire when voting ends on the governance proposal. + #[prost(message, repeated, tag = "2")] + pub immediate_unsanction_min_deposit: + ::prost::alloc::vec::Vec, +} +/// TemporaryEntry defines the information involved in a temporary sanction or unsanction. +#[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.sanction.v1beta1.TemporaryEntry")] +pub struct TemporaryEntry { + /// address is the address of this temporary entry. + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// proposal_id is the governance proposal id associated with this temporary entry. + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub proposal_id: u64, + /// status is whether the entry is a sanction or unsanction. + #[prost(enumeration = "TempStatus", tag = "3")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub status: i32, +} +/// TempStatus is whether a temporary entry is a sanction or unsanction. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +pub enum TempStatus { + /// TEMP_STATUS_UNSPECIFIED represents and unspecified status value. + Unspecified = 0, + /// TEMP_STATUS_SANCTIONED indicates a sanction is in place. + Sanctioned = 1, + /// TEMP_STATUS_UNSANCTIONED indicates an unsanctioned is in place. + Unsanctioned = 2, +} +impl TempStatus { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + TempStatus::Unspecified => "TEMP_STATUS_UNSPECIFIED", + TempStatus::Sanctioned => "TEMP_STATUS_SANCTIONED", + TempStatus::Unsanctioned => "TEMP_STATUS_UNSANCTIONED", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "TEMP_STATUS_UNSPECIFIED" => Some(Self::Unspecified), + "TEMP_STATUS_SANCTIONED" => Some(Self::Sanctioned), + "TEMP_STATUS_UNSANCTIONED" => Some(Self::Unsanctioned), + _ => None, + } + } +} +/// GenesisState defines the sanction module's genesis state. +#[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.sanction.v1beta1.GenesisState")] +pub struct GenesisState { + /// params are the sanction module parameters. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, + /// sanctioned_addresses defines account addresses that are sanctioned. + #[prost(string, repeated, tag = "2")] + pub sanctioned_addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// temporary_entries defines the temporary entries associated with on-going governance proposals. + #[prost(message, repeated, tag = "3")] + pub temporary_entries: ::prost::alloc::vec::Vec, +} +/// QueryIsSanctionedRequest defines the RPC request for checking if an account is sanctioned. +#[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.sanction.v1beta1.QueryIsSanctionedRequest")] +#[proto_query( + path = "/cosmos.sanction.v1beta1.Query/IsSanctioned", + response_type = QueryIsSanctionedResponse +)] +pub struct QueryIsSanctionedRequest { + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, +} +/// QueryIsSanctionedResponse defines the RPC response of an IsSanctioned query. +#[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.sanction.v1beta1.QueryIsSanctionedResponse")] +pub struct QueryIsSanctionedResponse { + /// is_sanctioned is true if the address is sanctioned. + #[prost(bool, tag = "1")] + pub is_sanctioned: bool, +} +/// QuerySanctionedAddressesRequest defines the RPC request for listing sanctioned accounts. +#[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.sanction.v1beta1.QuerySanctionedAddressesRequest")] +#[proto_query( + path = "/cosmos.sanction.v1beta1.Query/SanctionedAddresses", + response_type = QuerySanctionedAddressesResponse +)] +pub struct QuerySanctionedAddressesRequest { + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "99")] + pub pagination: ::core::option::Option, +} +/// QuerySanctionedAddressesResponse defines the RPC response of a SanctionedAddresses query. +#[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.sanction.v1beta1.QuerySanctionedAddressesResponse")] +pub struct QuerySanctionedAddressesResponse { + /// addresses is the list of sanctioned account addresses. + #[prost(string, repeated, tag = "1")] + pub addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "99")] + pub pagination: ::core::option::Option, +} +/// QueryTemporaryEntriesRequest defines the RPC request for listing temporary sanction/unsanction entries. +#[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.sanction.v1beta1.QueryTemporaryEntriesRequest")] +#[proto_query( + path = "/cosmos.sanction.v1beta1.Query/TemporaryEntries", + response_type = QueryTemporaryEntriesResponse +)] +pub struct QueryTemporaryEntriesRequest { + /// address is an optional address to restrict results to. + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "99")] + pub pagination: ::core::option::Option, +} +/// QueryTemporaryEntriesResponse defines the RPC response of a TemporaryEntries query. +#[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.sanction.v1beta1.QueryTemporaryEntriesResponse")] +pub struct QueryTemporaryEntriesResponse { + #[prost(message, repeated, tag = "1")] + pub entries: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "99")] + pub pagination: ::core::option::Option, +} +/// QueryParamsRequest defines the RPC request for getting the sanction module params. +#[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.sanction.v1beta1.QueryParamsRequest")] +#[proto_query( + path = "/cosmos.sanction.v1beta1.Query/Params", + response_type = QueryParamsResponse +)] +pub struct QueryParamsRequest {} +/// QueryParamsResponse defines the RPC response of a Params query. +#[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.sanction.v1beta1.QueryParamsResponse")] +pub struct QueryParamsResponse { + /// params are the sanction module parameters. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} +/// MsgSanction represents a message for the governance operation of sanctioning addresses. +#[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.sanction.v1beta1.MsgSanction")] +pub struct MsgSanction { + /// addresses are the addresses to sanction. + #[prost(string, repeated, tag = "1")] + pub addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// authority is the address of the account with the authority to enact sanctions (most likely the governance module + /// account). + #[prost(string, tag = "2")] + pub authority: ::prost::alloc::string::String, +} +/// MsgOptInResponse defines the Msg/Sanction 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.sanction.v1beta1.MsgSanctionResponse")] +pub struct MsgSanctionResponse {} +/// MsgSanction represents a message for the governance operation of unsanctioning addresses. +#[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.sanction.v1beta1.MsgUnsanction")] +pub struct MsgUnsanction { + /// addresses are the addresses to unsanction. + #[prost(string, repeated, tag = "1")] + pub addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// authority is the address of the account with the authority to retract sanctions (most likely the governance module + /// account). + #[prost(string, tag = "2")] + pub authority: ::prost::alloc::string::String, +} +/// MsgOptInResponse defines the Msg/Unsanction 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.sanction.v1beta1.MsgUnsanctionResponse")] +pub struct MsgUnsanctionResponse {} +/// MsgUpdateParams represents a message for the governance operation of updating the sanction module params. +#[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.sanction.v1beta1.MsgUpdateParams")] +pub struct MsgUpdateParams { + /// params are the sanction module parameters. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, + /// authority is the address of the account with the authority to update params (most likely the governance module + /// account). + #[prost(string, tag = "2")] + pub authority: ::prost::alloc::string::String, +} +/// MsgUpdateParamsResponse defined the Msg/UpdateParams 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.sanction.v1beta1.MsgUpdateParamsResponse")] +pub struct MsgUpdateParamsResponse {} +pub struct SanctionQuerier<'a, Q: cosmwasm_std::CustomQuery> { + querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, +} +impl<'a, Q: cosmwasm_std::CustomQuery> SanctionQuerier<'a, Q> { + pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self { + Self { querier } + } + pub fn is_sanctioned( + &self, + address: ::prost::alloc::string::String, + ) -> Result { + QueryIsSanctionedRequest { address }.query(self.querier) + } + pub fn sanctioned_addresses( + &self, + pagination: ::core::option::Option, + ) -> Result { + QuerySanctionedAddressesRequest { pagination }.query(self.querier) + } + pub fn temporary_entries( + &self, + address: ::prost::alloc::string::String, + pagination: ::core::option::Option, + ) -> Result { + QueryTemporaryEntriesRequest { + address, + pagination, + } + .query(self.querier) + } + pub fn params(&self) -> Result { + QueryParamsRequest {}.query(self.querier) + } +} diff --git a/packages/provwasm-std/src/types/cosmos/slashing/mod.rs b/packages/provwasm-std/src/types/cosmos/slashing/mod.rs index 9f64fc82..537a3360 100644 --- a/packages/provwasm-std/src/types/cosmos/slashing/mod.rs +++ b/packages/provwasm-std/src/types/cosmos/slashing/mod.rs @@ -1 +1,2 @@ +pub mod module; pub mod v1beta1; diff --git a/packages/provwasm-std/src/types/cosmos/slashing/module/mod.rs b/packages/provwasm-std/src/types/cosmos/slashing/module/mod.rs new file mode 100644 index 00000000..a3a6d96c --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/slashing/module/mod.rs @@ -0,0 +1 @@ +pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/slashing/module/v1.rs b/packages/provwasm-std/src/types/cosmos/slashing/module/v1.rs new file mode 100644 index 00000000..ea89c163 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/slashing/module/v1.rs @@ -0,0 +1,19 @@ +use provwasm_proc_macro::CosmwasmExt; +/// Module is the config object of the slashing 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.slashing.module.v1.Module")] +pub struct Module { + /// authority defines the custom module authority. If not set, defaults to the governance module. + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, +} diff --git a/packages/provwasm-std/src/types/cosmos/slashing/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/slashing/v1beta1.rs index 41414eb8..ca9553f3 100644 --- a/packages/provwasm-std/src/types/cosmos/slashing/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/slashing/v1beta1.rs @@ -1,4 +1,6 @@ use provwasm_proc_macro::CosmwasmExt; +/// ValidatorSigningInfo defines a validator's signing info for monitoring their +/// liveness activity. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -14,22 +16,32 @@ use provwasm_proc_macro::CosmwasmExt; pub struct ValidatorSigningInfo { #[prost(string, tag = "1")] pub address: ::prost::alloc::string::String, + /// Height at which validator was first a candidate OR was un-jailed #[prost(int64, tag = "2")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub start_height: i64, + /// Index which is incremented every time a validator is bonded in a block and + /// _may_ have signed a pre-commit or not. This in conjunction with the + /// signed_blocks_window param determines the index in the missed block bitmap. #[prost(int64, tag = "3")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub index_offset: i64, + /// Timestamp until which the validator is jailed due to liveness downtime. #[prost(message, optional, tag = "4")] pub jailed_until: ::core::option::Option, + /// Whether or not a validator has been tombstoned (killed out of validator + /// set). It is set once the validator commits an equivocation or for any other + /// configured misbehavior. #[prost(bool, tag = "5")] pub tombstoned: bool, + /// A counter of missed (unsigned) blocks. It is used to avoid unnecessary + /// reads in the missed block bitmap. #[prost(int64, tag = "6")] #[serde( serialize_with = "crate::serde::as_str::serialize", @@ -37,6 +49,7 @@ pub struct ValidatorSigningInfo { )] pub missed_blocks_counter: i64, } +/// Params represents the parameters used for by the slashing module. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -51,16 +64,127 @@ pub struct ValidatorSigningInfo { #[proto_message(type_url = "/cosmos.slashing.v1beta1.Params")] pub struct Params { #[prost(int64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] pub signed_blocks_window: i64, #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] pub min_signed_per_window: ::prost::alloc::vec::Vec, #[prost(message, optional, tag = "3")] pub downtime_jail_duration: ::core::option::Option, #[prost(bytes = "vec", tag = "4")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] pub slash_fraction_double_sign: ::prost::alloc::vec::Vec, #[prost(bytes = "vec", tag = "5")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] pub slash_fraction_downtime: ::prost::alloc::vec::Vec, } +/// GenesisState defines the slashing module's genesis state. +#[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.slashing.v1beta1.GenesisState")] +pub struct GenesisState { + /// params defines all the parameters of the module. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, + /// signing_infos represents a map between validator addresses and their + /// signing infos. + #[prost(message, repeated, tag = "2")] + pub signing_infos: ::prost::alloc::vec::Vec, + /// missed_blocks represents a map between validator addresses and their + /// missed blocks. + #[prost(message, repeated, tag = "3")] + pub missed_blocks: ::prost::alloc::vec::Vec, +} +/// SigningInfo stores validator signing info of corresponding address. +#[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.slashing.v1beta1.SigningInfo")] +pub struct SigningInfo { + /// address is the validator address. + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// validator_signing_info represents the signing info of this validator. + #[prost(message, optional, tag = "2")] + pub validator_signing_info: ::core::option::Option, +} +/// ValidatorMissedBlocks contains array of missed blocks of corresponding +/// address. +#[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.slashing.v1beta1.ValidatorMissedBlocks")] +pub struct ValidatorMissedBlocks { + /// address is the validator address. + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// missed_blocks is an array of missed blocks by the validator. + #[prost(message, repeated, tag = "2")] + pub missed_blocks: ::prost::alloc::vec::Vec, +} +/// MissedBlock contains height and missed status as boolean. +#[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.slashing.v1beta1.MissedBlock")] +pub struct MissedBlock { + /// index is the height at which the block was missed. + #[prost(int64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub index: i64, + /// missed is the missed status. + #[prost(bool, tag = "2")] + pub missed: bool, +} +/// QueryParamsRequest is the request type for the Query/Params RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -78,6 +202,7 @@ pub struct Params { response_type = QueryParamsResponse )] pub struct QueryParamsRequest {} +/// QueryParamsResponse is the response type for the Query/Params RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -94,6 +219,8 @@ pub struct QueryParamsResponse { #[prost(message, optional, tag = "1")] pub params: ::core::option::Option, } +/// QuerySigningInfoRequest is the request type for the Query/SigningInfo RPC +/// method #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -111,9 +238,12 @@ pub struct QueryParamsResponse { response_type = QuerySigningInfoResponse )] pub struct QuerySigningInfoRequest { + /// cons_address is the address to query signing info of #[prost(string, tag = "1")] pub cons_address: ::prost::alloc::string::String, } +/// QuerySigningInfoResponse is the response type for the Query/SigningInfo RPC +/// method #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -127,9 +257,126 @@ pub struct QuerySigningInfoRequest { )] #[proto_message(type_url = "/cosmos.slashing.v1beta1.QuerySigningInfoResponse")] pub struct QuerySigningInfoResponse { + /// val_signing_info is the signing info of requested val cons address #[prost(message, optional, tag = "1")] pub val_signing_info: ::core::option::Option, } +/// QuerySigningInfosRequest is the request type for the Query/SigningInfos 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.slashing.v1beta1.QuerySigningInfosRequest")] +#[proto_query( + path = "/cosmos.slashing.v1beta1.Query/SigningInfos", + response_type = QuerySigningInfosResponse +)] +pub struct QuerySigningInfosRequest { + #[prost(message, optional, tag = "1")] + pub pagination: ::core::option::Option, +} +/// QuerySigningInfosResponse is the response type for the Query/SigningInfos 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.slashing.v1beta1.QuerySigningInfosResponse")] +pub struct QuerySigningInfosResponse { + /// info is the signing info of all validators + #[prost(message, repeated, tag = "1")] + pub info: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// MsgUnjail defines the Msg/Unjail request 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.slashing.v1beta1.MsgUnjail")] +pub struct MsgUnjail { + #[prost(string, tag = "1")] + pub validator_addr: ::prost::alloc::string::String, +} +/// MsgUnjailResponse defines the Msg/Unjail 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.slashing.v1beta1.MsgUnjailResponse")] +pub struct MsgUnjailResponse {} +/// MsgUpdateParams is the Msg/UpdateParams request type. +/// +/// Since: cosmos-sdk 0.47 +#[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.slashing.v1beta1.MsgUpdateParams")] +pub struct MsgUpdateParams { + /// authority is the address that controls the module (defaults to x/gov unless overwritten). + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// params defines the x/slashing parameters to update. + /// + /// NOTE: All parameters must be supplied. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +/// MsgUpdateParamsResponse defines the response structure for executing a +/// MsgUpdateParams message. +/// +/// Since: cosmos-sdk 0.47 +#[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.slashing.v1beta1.MsgUpdateParamsResponse")] +pub struct MsgUpdateParamsResponse {} pub struct SlashingQuerier<'a, Q: cosmwasm_std::CustomQuery> { querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, } @@ -146,4 +393,10 @@ impl<'a, Q: cosmwasm_std::CustomQuery> SlashingQuerier<'a, Q> { ) -> Result { QuerySigningInfoRequest { cons_address }.query(self.querier) } + pub fn signing_infos( + &self, + pagination: ::core::option::Option, + ) -> Result { + QuerySigningInfosRequest { pagination }.query(self.querier) + } } diff --git a/packages/provwasm-std/src/types/cosmos/staking/mod.rs b/packages/provwasm-std/src/types/cosmos/staking/mod.rs index 9f64fc82..537a3360 100644 --- a/packages/provwasm-std/src/types/cosmos/staking/mod.rs +++ b/packages/provwasm-std/src/types/cosmos/staking/mod.rs @@ -1 +1,2 @@ +pub mod module; pub mod v1beta1; diff --git a/packages/provwasm-std/src/types/cosmos/staking/module/mod.rs b/packages/provwasm-std/src/types/cosmos/staking/module/mod.rs new file mode 100644 index 00000000..a3a6d96c --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/staking/module/mod.rs @@ -0,0 +1 @@ +pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/staking/module/v1.rs b/packages/provwasm-std/src/types/cosmos/staking/module/v1.rs new file mode 100644 index 00000000..f3f26619 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/staking/module/v1.rs @@ -0,0 +1,30 @@ +use provwasm_proc_macro::CosmwasmExt; +/// Module is the config object of the staking 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.staking.module.v1.Module")] +pub struct Module { + /// hooks_order specifies the order of staking hooks and should be a list + /// of module names which provide a staking hooks instance. If no order is + /// provided, then hooks will be applied in alphabetical order of module names. + #[prost(string, repeated, tag = "1")] + pub hooks_order: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// authority defines the custom module authority. If not set, defaults to the governance module. + #[prost(string, tag = "2")] + pub authority: ::prost::alloc::string::String, + /// bech32_prefix_validator is the bech32 validator prefix for the app. + #[prost(string, tag = "3")] + pub bech32_prefix_validator: ::prost::alloc::string::String, + /// bech32_prefix_consensus is the bech32 consensus node prefix for the app. + #[prost(string, tag = "4")] + pub bech32_prefix_consensus: ::prost::alloc::string::String, +} diff --git a/packages/provwasm-std/src/types/cosmos/staking/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/staking/v1beta1.rs index c010cf26..cd562435 100644 --- a/packages/provwasm-std/src/types/cosmos/staking/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/staking/v1beta1.rs @@ -1,4 +1,148 @@ use provwasm_proc_macro::CosmwasmExt; +/// StakeAuthorization defines authorization for delegate/undelegate/redelegate. +/// +/// Since: cosmos-sdk 0.43 +#[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.staking.v1beta1.StakeAuthorization")] +pub struct StakeAuthorization { + /// max_tokens specifies the maximum amount of tokens can be delegate to a validator. If it is + /// empty, there is no spend limit and any amount of coins can be delegated. + #[prost(message, optional, tag = "1")] + pub max_tokens: ::core::option::Option, + /// authorization_type defines one of AuthorizationType. + #[prost(enumeration = "AuthorizationType", tag = "4")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub authorization_type: i32, + /// validators is the oneof that represents either allow_list or deny_list + #[prost(oneof = "stake_authorization::Validators", tags = "2, 3")] + pub validators: ::core::option::Option, +} +/// Nested message and enum types in `StakeAuthorization`. +pub mod stake_authorization { + use provwasm_proc_macro::CosmwasmExt; + /// Validators defines list of validator addresses. + #[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.staking.v1beta1.")] + pub struct Validators_ { + #[prost(string, repeated, tag = "1")] + pub address: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + } + /// validators is the oneof that represents either allow_list or deny_list + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive( + Clone, + PartialEq, + Eq, + ::prost::Oneof, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + )] + pub enum Validators { + /// allow_list specifies list of validator addresses to whom grantee can delegate tokens on behalf of granter's + /// account. + #[prost(message, tag = "2")] + AllowList(Validators_), + /// deny_list specifies list of validator addresses to whom grantee can not delegate tokens. + #[prost(message, tag = "3")] + DenyList(Validators_), + } +} +/// AuthorizationType defines the type of staking module authorization type +/// +/// Since: cosmos-sdk 0.43 +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +pub enum AuthorizationType { + /// AUTHORIZATION_TYPE_UNSPECIFIED specifies an unknown authorization type + Unspecified = 0, + /// AUTHORIZATION_TYPE_DELEGATE defines an authorization type for Msg/Delegate + Delegate = 1, + /// AUTHORIZATION_TYPE_UNDELEGATE defines an authorization type for Msg/Undelegate + Undelegate = 2, + /// AUTHORIZATION_TYPE_REDELEGATE defines an authorization type for Msg/BeginRedelegate + Redelegate = 3, + /// AUTHORIZATION_TYPE_CANCEL_UNBONDING_DELEGATION defines an authorization type for Msg/MsgCancelUnbondingDelegation + CancelUnbondingDelegation = 4, +} +impl AuthorizationType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + AuthorizationType::Unspecified => "AUTHORIZATION_TYPE_UNSPECIFIED", + AuthorizationType::Delegate => "AUTHORIZATION_TYPE_DELEGATE", + AuthorizationType::Undelegate => "AUTHORIZATION_TYPE_UNDELEGATE", + AuthorizationType::Redelegate => "AUTHORIZATION_TYPE_REDELEGATE", + AuthorizationType::CancelUnbondingDelegation => { + "AUTHORIZATION_TYPE_CANCEL_UNBONDING_DELEGATION" + } + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "AUTHORIZATION_TYPE_UNSPECIFIED" => Some(Self::Unspecified), + "AUTHORIZATION_TYPE_DELEGATE" => Some(Self::Delegate), + "AUTHORIZATION_TYPE_UNDELEGATE" => Some(Self::Undelegate), + "AUTHORIZATION_TYPE_REDELEGATE" => Some(Self::Redelegate), + "AUTHORIZATION_TYPE_CANCEL_UNBONDING_DELEGATION" => { + Some(Self::CancelUnbondingDelegation) + } + _ => None, + } + } +} +/// HistoricalInfo contains header and validator information for a given block. +/// It is stored as part of staking module's state, which persists the `n` most +/// recent HistoricalInfo +/// (`n` is set by the staking module's `historical_entries` parameter). +#[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.staking.v1beta1.HistoricalInfo")] +pub struct HistoricalInfo { + #[prost(message, optional, tag = "1")] + pub header: ::core::option::Option, + #[prost(message, repeated, tag = "2")] + pub valset: ::prost::alloc::vec::Vec, +} +/// CommissionRates defines the initial commission rates to be used for creating +/// a validator. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -12,13 +156,17 @@ use provwasm_proc_macro::CosmwasmExt; )] #[proto_message(type_url = "/cosmos.staking.v1beta1.CommissionRates")] pub struct CommissionRates { + /// rate is the commission rate charged to delegators, as a fraction. #[prost(string, tag = "1")] pub rate: ::prost::alloc::string::String, + /// max_rate defines the maximum commission rate which validator can ever charge, as a fraction. #[prost(string, tag = "2")] pub max_rate: ::prost::alloc::string::String, + /// max_change_rate defines the maximum daily increase of the validator commission, as a fraction. #[prost(string, tag = "3")] pub max_change_rate: ::prost::alloc::string::String, } +/// Commission defines commission parameters for a given validator. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -32,11 +180,14 @@ pub struct CommissionRates { )] #[proto_message(type_url = "/cosmos.staking.v1beta1.Commission")] pub struct Commission { + /// commission_rates defines the initial commission rates to be used for creating a validator. #[prost(message, optional, tag = "1")] pub commission_rates: ::core::option::Option, + /// update_time is the last time the commission rate was changed. #[prost(message, optional, tag = "2")] pub update_time: ::core::option::Option, } +/// Description defines a validator description. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -50,17 +201,30 @@ pub struct Commission { )] #[proto_message(type_url = "/cosmos.staking.v1beta1.Description")] pub struct Description { + /// moniker defines a human-readable name for the validator. #[prost(string, tag = "1")] pub moniker: ::prost::alloc::string::String, + /// identity defines an optional identity signature (ex. UPort or Keybase). #[prost(string, tag = "2")] pub identity: ::prost::alloc::string::String, + /// website defines an optional website link. #[prost(string, tag = "3")] pub website: ::prost::alloc::string::String, + /// security_contact defines an optional email for security contact. #[prost(string, tag = "4")] pub security_contact: ::prost::alloc::string::String, + /// details define other optional details. #[prost(string, tag = "5")] pub details: ::prost::alloc::string::String, } +/// Validator defines a validator, together with the total amount of the +/// Validator's bond shares and their exchange rate to coins. Slashing results in +/// a decrease in the exchange rate, allowing correct calculation of future +/// undelegations without iterating over delegators. When coins are delegated to +/// this validator, the validator is credited with a delegation whose number of +/// bond shares is based on the amount of coins delegated divided by the current +/// exchange rate. Voting power can be calculated as total bonded shares +/// multiplied by exchange rate. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -74,37 +238,65 @@ pub struct Description { )] #[proto_message(type_url = "/cosmos.staking.v1beta1.Validator")] pub struct Validator { + /// operator_address defines the address of the validator's operator; bech encoded in JSON. #[prost(string, tag = "1")] pub operator_address: ::prost::alloc::string::String, + /// consensus_pubkey is the consensus public key of the validator, as a Protobuf Any. #[prost(message, optional, tag = "2")] pub consensus_pubkey: ::core::option::Option, + /// jailed defined whether the validator has been jailed from bonded status or not. #[prost(bool, tag = "3")] pub jailed: bool, + /// status is the validator status (bonded/unbonding/unbonded). #[prost(enumeration = "BondStatus", tag = "4")] #[serde( - serialize_with = "BondStatus::serialize", - deserialize_with = "BondStatus::deserialize" + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" )] pub status: i32, + /// tokens define the delegated tokens (incl. self-delegation). #[prost(string, tag = "5")] pub tokens: ::prost::alloc::string::String, + /// delegator_shares defines total shares issued to a validator's delegators. #[prost(string, tag = "6")] pub delegator_shares: ::prost::alloc::string::String, + /// description defines the description terms for the validator. #[prost(message, optional, tag = "7")] pub description: ::core::option::Option, + /// unbonding_height defines, if unbonding, the height at which this validator has begun unbonding. #[prost(int64, tag = "8")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub unbonding_height: i64, + /// unbonding_time defines, if unbonding, the min time for the validator to complete unbonding. #[prost(message, optional, tag = "9")] pub unbonding_time: ::core::option::Option, + /// commission defines the commission parameters. #[prost(message, optional, tag = "10")] pub commission: ::core::option::Option, + /// min_self_delegation is the validator's self declared minimum self delegation. + /// + /// Since: cosmos-sdk 0.46 #[prost(string, tag = "11")] pub min_self_delegation: ::prost::alloc::string::String, + /// strictly positive if this validator's unbonding has been stopped by external modules + #[prost(int64, tag = "12")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub unbonding_on_hold_ref_count: i64, + /// list of unbonding ids, each uniquely identifing an unbonding of this validator + #[prost(uint64, repeated, tag = "13")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub unbonding_ids: ::prost::alloc::vec::Vec, } +/// ValAddresses defines a repeated set of validator addresses. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -116,15 +308,33 @@ pub struct Validator { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmos.staking.v1beta1.Delegation")] -pub struct Delegation { +#[proto_message(type_url = "/cosmos.staking.v1beta1.ValAddresses")] +pub struct ValAddresses { + #[prost(string, repeated, tag = "1")] + pub addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// DVPair is struct that just has a delegator-validator pair with no other data. +/// It is intended to be used as a marshalable pointer. For example, a DVPair can +/// be used to construct the key to getting an UnbondingDelegation from state. +#[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.staking.v1beta1.DVPair")] +pub struct DvPair { #[prost(string, tag = "1")] pub delegator_address: ::prost::alloc::string::String, #[prost(string, tag = "2")] pub validator_address: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub shares: ::prost::alloc::string::String, } +/// DVPairs defines an array of DVPair objects. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -136,21 +346,15 @@ pub struct Delegation { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmos.staking.v1beta1.Params")] -pub struct Params { - #[prost(message, optional, tag = "1")] - pub unbonding_time: ::core::option::Option, - #[prost(uint32, tag = "2")] - pub max_validators: u32, - #[prost(uint32, tag = "3")] - pub max_entries: u32, - #[prost(uint32, tag = "4")] - pub historical_entries: u32, - #[prost(string, tag = "5")] - pub bond_denom: ::prost::alloc::string::String, - #[prost(string, tag = "6")] - pub min_commission_rate: ::prost::alloc::string::String, +#[proto_message(type_url = "/cosmos.staking.v1beta1.DVPairs")] +pub struct DvPairs { + #[prost(message, repeated, tag = "1")] + pub pairs: ::prost::alloc::vec::Vec, } +/// DVVTriplet is struct that just has a delegator-validator-validator triplet +/// with no other data. It is intended to be used as a marshalable pointer. For +/// example, a DVVTriplet can be used to construct the key to getting a +/// Redelegation from state. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -162,69 +366,16 @@ pub struct Params { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmos.staking.v1beta1.DelegationResponse")] -pub struct DelegationResponse { - #[prost(message, optional, tag = "1")] - pub delegation: ::core::option::Option, - #[prost(message, optional, tag = "2")] - pub balance: ::core::option::Option, -} -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] -pub enum BondStatus { - Unspecified = 0, - Unbonded = 1, - Unbonding = 2, - Bonded = 3, -} -impl BondStatus { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - BondStatus::Unspecified => "BOND_STATUS_UNSPECIFIED", - BondStatus::Unbonded => "BOND_STATUS_UNBONDED", - BondStatus::Unbonding => "BOND_STATUS_UNBONDING", - BondStatus::Bonded => "BOND_STATUS_BONDED", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "BOND_STATUS_UNSPECIFIED" => Some(Self::Unspecified), - "BOND_STATUS_UNBONDED" => Some(Self::Unbonded), - "BOND_STATUS_UNBONDING" => Some(Self::Unbonding), - "BOND_STATUS_BONDED" => Some(Self::Bonded), - _ => None, - } - } - - pub fn serialize(v: &i32, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - let enum_value = Self::try_from(*v); - match enum_value { - Ok(v) => serializer.serialize_str(v.as_str_name()), - Err(e) => Err(serde::ser::Error::custom(e)), - } - } - - pub fn deserialize<'de, D>(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - use serde::de::Deserialize; - let s = String::deserialize(deserializer)?; - match Self::from_str_name(&s) { - Some(v) => Ok(v.into()), - None => Err(serde::de::Error::custom("unknown value")), - } - } +#[proto_message(type_url = "/cosmos.staking.v1beta1.DVVTriplet")] +pub struct DvvTriplet { + #[prost(string, tag = "1")] + pub delegator_address: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub validator_src_address: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub validator_dst_address: ::prost::alloc::string::String, } +/// DVVTriplets defines an array of DVVTriplet objects. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -236,15 +387,14 @@ impl BondStatus { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmos.staking.v1beta1.QueryValidatorRequest")] -#[proto_query( - path = "/cosmos.staking.v1beta1.Query/Validator", - response_type = QueryValidatorResponse -)] -pub struct QueryValidatorRequest { - #[prost(string, tag = "1")] - pub validator_addr: ::prost::alloc::string::String, +#[proto_message(type_url = "/cosmos.staking.v1beta1.DVVTriplets")] +pub struct DvvTriplets { + #[prost(message, repeated, tag = "1")] + pub triplets: ::prost::alloc::vec::Vec, } +/// Delegation represents the bond with tokens held by an account. It is +/// owned by one delegator, and is associated with the voting power of one +/// validator. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -256,11 +406,20 @@ pub struct QueryValidatorRequest { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmos.staking.v1beta1.QueryValidatorResponse")] -pub struct QueryValidatorResponse { - #[prost(message, optional, tag = "1")] - pub validator: ::core::option::Option, +#[proto_message(type_url = "/cosmos.staking.v1beta1.Delegation")] +pub struct Delegation { + /// delegator_address is the encoded address of the delegator. + #[prost(string, tag = "1")] + pub delegator_address: ::prost::alloc::string::String, + /// validator_address is the encoded address of the validator. + #[prost(string, tag = "2")] + pub validator_address: ::prost::alloc::string::String, + /// shares define the delegation shares received. + #[prost(string, tag = "3")] + pub shares: ::prost::alloc::string::String, } +/// UnbondingDelegation stores all of a single delegator's unbonding bonds +/// for a single validator in an time-ordered list. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -272,17 +431,21 @@ pub struct QueryValidatorResponse { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmos.staking.v1beta1.QueryDelegationRequest")] -#[proto_query( - path = "/cosmos.staking.v1beta1.Query/Delegation", - response_type = QueryDelegationResponse -)] -pub struct QueryDelegationRequest { +#[proto_message(type_url = "/cosmos.staking.v1beta1.UnbondingDelegation")] +pub struct UnbondingDelegation { + /// delegator_address is the encoded address of the delegator. #[prost(string, tag = "1")] - pub delegator_addr: ::prost::alloc::string::String, + pub delegator_address: ::prost::alloc::string::String, + /// validator_address is the encoded address of the validator. #[prost(string, tag = "2")] - pub validator_addr: ::prost::alloc::string::String, + pub validator_address: ::prost::alloc::string::String, + /// entries are the unbonding delegation entries. + /// + /// unbonding delegation entries + #[prost(message, repeated, tag = "3")] + pub entries: ::prost::alloc::vec::Vec, } +/// UnbondingDelegationEntry defines an unbonding object with relevant metadata. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -294,11 +457,40 @@ pub struct QueryDelegationRequest { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmos.staking.v1beta1.QueryDelegationResponse")] -pub struct QueryDelegationResponse { - #[prost(message, optional, tag = "1")] - pub delegation_response: ::core::option::Option, +#[proto_message(type_url = "/cosmos.staking.v1beta1.UnbondingDelegationEntry")] +pub struct UnbondingDelegationEntry { + /// creation_height is the height which the unbonding took place. + #[prost(int64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub creation_height: i64, + /// completion_time is the unix time for unbonding completion. + #[prost(message, optional, tag = "2")] + pub completion_time: ::core::option::Option, + /// initial_balance defines the tokens initially scheduled to receive at completion. + #[prost(string, tag = "3")] + pub initial_balance: ::prost::alloc::string::String, + /// balance defines the tokens to receive at completion. + #[prost(string, tag = "4")] + pub balance: ::prost::alloc::string::String, + /// Incrementing id that uniquely identifies this entry + #[prost(uint64, tag = "5")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub unbonding_id: u64, + /// Strictly positive if this entry's unbonding has been stopped by external modules + #[prost(int64, tag = "6")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub unbonding_on_hold_ref_count: i64, } +/// RedelegationEntry defines a redelegation object with relevant metadata. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -310,12 +502,70 @@ pub struct QueryDelegationResponse { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmos.staking.v1beta1.QueryParamsRequest")] -#[proto_query( - path = "/cosmos.staking.v1beta1.Query/Params", - response_type = QueryParamsResponse +#[proto_message(type_url = "/cosmos.staking.v1beta1.RedelegationEntry")] +pub struct RedelegationEntry { + /// creation_height defines the height which the redelegation took place. + #[prost(int64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub creation_height: i64, + /// completion_time defines the unix time for redelegation completion. + #[prost(message, optional, tag = "2")] + pub completion_time: ::core::option::Option, + /// initial_balance defines the initial balance when redelegation started. + #[prost(string, tag = "3")] + pub initial_balance: ::prost::alloc::string::String, + /// shares_dst is the amount of destination-validator shares created by redelegation. + #[prost(string, tag = "4")] + pub shares_dst: ::prost::alloc::string::String, + /// Incrementing id that uniquely identifies this entry + #[prost(uint64, tag = "5")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub unbonding_id: u64, + /// Strictly positive if this entry's unbonding has been stopped by external modules + #[prost(int64, tag = "6")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub unbonding_on_hold_ref_count: i64, +} +/// Redelegation contains the list of a particular delegator's redelegating bonds +/// from a particular source validator to a particular destination validator. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, )] -pub struct QueryParamsRequest {} +#[proto_message(type_url = "/cosmos.staking.v1beta1.Redelegation")] +pub struct Redelegation { + /// delegator_address is the bech32-encoded address of the delegator. + #[prost(string, tag = "1")] + pub delegator_address: ::prost::alloc::string::String, + /// validator_src_address is the validator redelegation source operator address. + #[prost(string, tag = "2")] + pub validator_src_address: ::prost::alloc::string::String, + /// validator_dst_address is the validator redelegation destination operator address. + #[prost(string, tag = "3")] + pub validator_dst_address: ::prost::alloc::string::String, + /// entries are the redelegation entries. + /// + /// redelegation entries + #[prost(message, repeated, tag = "4")] + pub entries: ::prost::alloc::vec::Vec, +} +/// Params defines the parameters for the x/staking module. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -327,24 +577,1248 @@ pub struct QueryParamsRequest {} ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmos.staking.v1beta1.QueryParamsResponse")] -pub struct QueryParamsResponse { +#[proto_message(type_url = "/cosmos.staking.v1beta1.Params")] +pub struct Params { + /// unbonding_time is the time duration of unbonding. #[prost(message, optional, tag = "1")] - pub params: ::core::option::Option, -} -pub struct StakingQuerier<'a, Q: cosmwasm_std::CustomQuery> { - querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, + pub unbonding_time: ::core::option::Option, + /// max_validators is the maximum number of validators. + #[prost(uint32, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub max_validators: u32, + /// max_entries is the max entries for either unbonding delegation or redelegation (per pair/trio). + #[prost(uint32, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub max_entries: u32, + /// historical_entries is the number of historical entries to persist. + #[prost(uint32, tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub historical_entries: u32, + /// bond_denom defines the bondable coin denomination. + #[prost(string, tag = "5")] + pub bond_denom: ::prost::alloc::string::String, + /// min_commission_rate is the chain-wide minimum commission rate that a validator can charge their delegators + #[prost(string, tag = "6")] + pub min_commission_rate: ::prost::alloc::string::String, } -impl<'a, Q: cosmwasm_std::CustomQuery> StakingQuerier<'a, Q> { +/// DelegationResponse is equivalent to Delegation except that it contains a +/// balance in addition to shares which is more suitable for client responses. +#[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.staking.v1beta1.DelegationResponse")] +pub struct DelegationResponse { + #[prost(message, optional, tag = "1")] + pub delegation: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub balance: ::core::option::Option, +} +/// RedelegationEntryResponse is equivalent to a RedelegationEntry except that it +/// contains a balance in addition to shares which is more suitable for client +/// responses. +#[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.staking.v1beta1.RedelegationEntryResponse")] +pub struct RedelegationEntryResponse { + #[prost(message, optional, tag = "1")] + pub redelegation_entry: ::core::option::Option, + #[prost(string, tag = "4")] + pub balance: ::prost::alloc::string::String, +} +/// RedelegationResponse is equivalent to a Redelegation except that its entries +/// contain a balance in addition to shares which is more suitable for client +/// responses. +#[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.staking.v1beta1.RedelegationResponse")] +pub struct RedelegationResponse { + #[prost(message, optional, tag = "1")] + pub redelegation: ::core::option::Option, + #[prost(message, repeated, tag = "2")] + pub entries: ::prost::alloc::vec::Vec, +} +/// Pool is used for tracking bonded and not-bonded token supply of the bond +/// denomination. +#[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.staking.v1beta1.Pool")] +pub struct Pool { + #[prost(string, tag = "1")] + pub not_bonded_tokens: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub bonded_tokens: ::prost::alloc::string::String, +} +/// ValidatorUpdates defines an array of abci.ValidatorUpdate objects. +/// TODO: explore moving this to proto/cosmos/base to separate modules from tendermint dependence +#[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.staking.v1beta1.ValidatorUpdates")] +pub struct ValidatorUpdates { + #[prost(message, repeated, tag = "1")] + pub updates: ::prost::alloc::vec::Vec, +} +/// BondStatus is the status of a validator. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +pub enum BondStatus { + /// UNSPECIFIED defines an invalid validator status. + Unspecified = 0, + /// UNBONDED defines a validator that is not bonded. + Unbonded = 1, + /// UNBONDING defines a validator that is unbonding. + Unbonding = 2, + /// BONDED defines a validator that is bonded. + Bonded = 3, +} +impl BondStatus { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + BondStatus::Unspecified => "BOND_STATUS_UNSPECIFIED", + BondStatus::Unbonded => "BOND_STATUS_UNBONDED", + BondStatus::Unbonding => "BOND_STATUS_UNBONDING", + BondStatus::Bonded => "BOND_STATUS_BONDED", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "BOND_STATUS_UNSPECIFIED" => Some(Self::Unspecified), + "BOND_STATUS_UNBONDED" => Some(Self::Unbonded), + "BOND_STATUS_UNBONDING" => Some(Self::Unbonding), + "BOND_STATUS_BONDED" => Some(Self::Bonded), + _ => None, + } + } +} +/// Infraction indicates the infraction a validator commited. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +pub enum Infraction { + /// UNSPECIFIED defines an empty infraction. + Unspecified = 0, + /// DOUBLE_SIGN defines a validator that double-signs a block. + DoubleSign = 1, + /// DOWNTIME defines a validator that missed signing too many blocks. + Downtime = 2, +} +impl Infraction { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Infraction::Unspecified => "INFRACTION_UNSPECIFIED", + Infraction::DoubleSign => "INFRACTION_DOUBLE_SIGN", + Infraction::Downtime => "INFRACTION_DOWNTIME", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "INFRACTION_UNSPECIFIED" => Some(Self::Unspecified), + "INFRACTION_DOUBLE_SIGN" => Some(Self::DoubleSign), + "INFRACTION_DOWNTIME" => Some(Self::Downtime), + _ => None, + } + } +} +/// GenesisState defines the staking module's genesis state. +#[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.staking.v1beta1.GenesisState")] +pub struct GenesisState { + /// params defines all the parameters of related to deposit. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, + /// last_total_power tracks the total amounts of bonded tokens recorded during + /// the previous end block. + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub last_total_power: ::prost::alloc::vec::Vec, + /// last_validator_powers is a special index that provides a historical list + /// of the last-block's bonded validators. + #[prost(message, repeated, tag = "3")] + pub last_validator_powers: ::prost::alloc::vec::Vec, + /// validators defines the validator set at genesis. + #[prost(message, repeated, tag = "4")] + pub validators: ::prost::alloc::vec::Vec, + /// delegations defines the delegations active at genesis. + #[prost(message, repeated, tag = "5")] + pub delegations: ::prost::alloc::vec::Vec, + /// unbonding_delegations defines the unbonding delegations active at genesis. + #[prost(message, repeated, tag = "6")] + pub unbonding_delegations: ::prost::alloc::vec::Vec, + /// redelegations defines the redelegations active at genesis. + #[prost(message, repeated, tag = "7")] + pub redelegations: ::prost::alloc::vec::Vec, + /// exported defines a bool to identify whether the chain dealing with exported or initialized genesis. + #[prost(bool, tag = "8")] + pub exported: bool, +} +/// LastValidatorPower required for validator set update logic. +#[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.staking.v1beta1.LastValidatorPower")] +pub struct LastValidatorPower { + /// address is the address of the validator. + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// power defines the power of the validator. + #[prost(int64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub power: i64, +} +/// QueryValidatorsRequest is request type for Query/Validators 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.staking.v1beta1.QueryValidatorsRequest")] +#[proto_query( + path = "/cosmos.staking.v1beta1.Query/Validators", + response_type = QueryValidatorsResponse +)] +pub struct QueryValidatorsRequest { + /// status enables to query for validators matching a given status. + #[prost(string, tag = "1")] + pub status: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryValidatorsResponse is response type for the Query/Validators 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.staking.v1beta1.QueryValidatorsResponse")] +pub struct QueryValidatorsResponse { + /// validators contains all the queried validators. + #[prost(message, repeated, tag = "1")] + pub validators: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryValidatorRequest is response type for the Query/Validator 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.staking.v1beta1.QueryValidatorRequest")] +#[proto_query( + path = "/cosmos.staking.v1beta1.Query/Validator", + response_type = QueryValidatorResponse +)] +pub struct QueryValidatorRequest { + /// validator_addr defines the validator address to query for. + #[prost(string, tag = "1")] + pub validator_addr: ::prost::alloc::string::String, +} +/// QueryValidatorResponse is response type for the Query/Validator 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.staking.v1beta1.QueryValidatorResponse")] +pub struct QueryValidatorResponse { + /// validator defines the validator info. + #[prost(message, optional, tag = "1")] + pub validator: ::core::option::Option, +} +/// QueryValidatorDelegationsRequest is request type for the +/// Query/ValidatorDelegations 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.staking.v1beta1.QueryValidatorDelegationsRequest")] +#[proto_query( + path = "/cosmos.staking.v1beta1.Query/ValidatorDelegations", + response_type = QueryValidatorDelegationsResponse +)] +pub struct QueryValidatorDelegationsRequest { + /// validator_addr defines the validator address to query for. + #[prost(string, tag = "1")] + pub validator_addr: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryValidatorDelegationsResponse is response type for the +/// Query/ValidatorDelegations 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.staking.v1beta1.QueryValidatorDelegationsResponse")] +pub struct QueryValidatorDelegationsResponse { + #[prost(message, repeated, tag = "1")] + pub delegation_responses: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryValidatorUnbondingDelegationsRequest is required type for the +/// Query/ValidatorUnbondingDelegations 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.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest")] +#[proto_query( + path = "/cosmos.staking.v1beta1.Query/ValidatorUnbondingDelegations", + response_type = QueryValidatorUnbondingDelegationsResponse +)] +pub struct QueryValidatorUnbondingDelegationsRequest { + /// validator_addr defines the validator address to query for. + #[prost(string, tag = "1")] + pub validator_addr: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryValidatorUnbondingDelegationsResponse is response type for the +/// Query/ValidatorUnbondingDelegations 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.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse")] +pub struct QueryValidatorUnbondingDelegationsResponse { + #[prost(message, repeated, tag = "1")] + pub unbonding_responses: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryDelegationRequest is request type for the Query/Delegation 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.staking.v1beta1.QueryDelegationRequest")] +#[proto_query( + path = "/cosmos.staking.v1beta1.Query/Delegation", + response_type = QueryDelegationResponse +)] +pub struct QueryDelegationRequest { + /// delegator_addr defines the delegator address to query for. + #[prost(string, tag = "1")] + pub delegator_addr: ::prost::alloc::string::String, + /// validator_addr defines the validator address to query for. + #[prost(string, tag = "2")] + pub validator_addr: ::prost::alloc::string::String, +} +/// QueryDelegationResponse is response type for the Query/Delegation 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.staking.v1beta1.QueryDelegationResponse")] +pub struct QueryDelegationResponse { + /// delegation_responses defines the delegation info of a delegation. + #[prost(message, optional, tag = "1")] + pub delegation_response: ::core::option::Option, +} +/// QueryUnbondingDelegationRequest is request type for the +/// Query/UnbondingDelegation 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.staking.v1beta1.QueryUnbondingDelegationRequest")] +#[proto_query( + path = "/cosmos.staking.v1beta1.Query/UnbondingDelegation", + response_type = QueryUnbondingDelegationResponse +)] +pub struct QueryUnbondingDelegationRequest { + /// delegator_addr defines the delegator address to query for. + #[prost(string, tag = "1")] + pub delegator_addr: ::prost::alloc::string::String, + /// validator_addr defines the validator address to query for. + #[prost(string, tag = "2")] + pub validator_addr: ::prost::alloc::string::String, +} +/// QueryDelegationResponse is response type for the Query/UnbondingDelegation +/// 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.staking.v1beta1.QueryUnbondingDelegationResponse")] +pub struct QueryUnbondingDelegationResponse { + /// unbond defines the unbonding information of a delegation. + #[prost(message, optional, tag = "1")] + pub unbond: ::core::option::Option, +} +/// QueryDelegatorDelegationsRequest is request type for the +/// Query/DelegatorDelegations 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.staking.v1beta1.QueryDelegatorDelegationsRequest")] +#[proto_query( + path = "/cosmos.staking.v1beta1.Query/DelegatorDelegations", + response_type = QueryDelegatorDelegationsResponse +)] +pub struct QueryDelegatorDelegationsRequest { + /// delegator_addr defines the delegator address to query for. + #[prost(string, tag = "1")] + pub delegator_addr: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryDelegatorDelegationsResponse is response type for the +/// Query/DelegatorDelegations 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.staking.v1beta1.QueryDelegatorDelegationsResponse")] +pub struct QueryDelegatorDelegationsResponse { + /// delegation_responses defines all the delegations' info of a delegator. + #[prost(message, repeated, tag = "1")] + pub delegation_responses: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryDelegatorUnbondingDelegationsRequest is request type for the +/// Query/DelegatorUnbondingDelegations 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.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest")] +#[proto_query( + path = "/cosmos.staking.v1beta1.Query/DelegatorUnbondingDelegations", + response_type = QueryDelegatorUnbondingDelegationsResponse +)] +pub struct QueryDelegatorUnbondingDelegationsRequest { + /// delegator_addr defines the delegator address to query for. + #[prost(string, tag = "1")] + pub delegator_addr: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryUnbondingDelegatorDelegationsResponse is response type for the +/// Query/UnbondingDelegatorDelegations 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.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse")] +pub struct QueryDelegatorUnbondingDelegationsResponse { + #[prost(message, repeated, tag = "1")] + pub unbonding_responses: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryRedelegationsRequest is request type for the Query/Redelegations 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.staking.v1beta1.QueryRedelegationsRequest")] +#[proto_query( + path = "/cosmos.staking.v1beta1.Query/Redelegations", + response_type = QueryRedelegationsResponse +)] +pub struct QueryRedelegationsRequest { + /// delegator_addr defines the delegator address to query for. + #[prost(string, tag = "1")] + pub delegator_addr: ::prost::alloc::string::String, + /// src_validator_addr defines the validator address to redelegate from. + #[prost(string, tag = "2")] + pub src_validator_addr: ::prost::alloc::string::String, + /// dst_validator_addr defines the validator address to redelegate to. + #[prost(string, tag = "3")] + pub dst_validator_addr: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "4")] + pub pagination: ::core::option::Option, +} +/// QueryRedelegationsResponse is response type for the Query/Redelegations 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.staking.v1beta1.QueryRedelegationsResponse")] +pub struct QueryRedelegationsResponse { + #[prost(message, repeated, tag = "1")] + pub redelegation_responses: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryDelegatorValidatorsRequest is request type for the +/// Query/DelegatorValidators 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.staking.v1beta1.QueryDelegatorValidatorsRequest")] +#[proto_query( + path = "/cosmos.staking.v1beta1.Query/DelegatorValidators", + response_type = QueryDelegatorValidatorsResponse +)] +pub struct QueryDelegatorValidatorsRequest { + /// delegator_addr defines the delegator address to query for. + #[prost(string, tag = "1")] + pub delegator_addr: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryDelegatorValidatorsResponse is response type for the +/// Query/DelegatorValidators 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.staking.v1beta1.QueryDelegatorValidatorsResponse")] +pub struct QueryDelegatorValidatorsResponse { + /// validators defines the validators' info of a delegator. + #[prost(message, repeated, tag = "1")] + pub validators: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryDelegatorValidatorRequest is request type for the +/// Query/DelegatorValidator 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.staking.v1beta1.QueryDelegatorValidatorRequest")] +#[proto_query( + path = "/cosmos.staking.v1beta1.Query/DelegatorValidator", + response_type = QueryDelegatorValidatorResponse +)] +pub struct QueryDelegatorValidatorRequest { + /// delegator_addr defines the delegator address to query for. + #[prost(string, tag = "1")] + pub delegator_addr: ::prost::alloc::string::String, + /// validator_addr defines the validator address to query for. + #[prost(string, tag = "2")] + pub validator_addr: ::prost::alloc::string::String, +} +/// QueryDelegatorValidatorResponse response type for the +/// Query/DelegatorValidator 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.staking.v1beta1.QueryDelegatorValidatorResponse")] +pub struct QueryDelegatorValidatorResponse { + /// validator defines the validator info. + #[prost(message, optional, tag = "1")] + pub validator: ::core::option::Option, +} +/// QueryHistoricalInfoRequest is request type for the Query/HistoricalInfo 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.staking.v1beta1.QueryHistoricalInfoRequest")] +#[proto_query( + path = "/cosmos.staking.v1beta1.Query/HistoricalInfo", + response_type = QueryHistoricalInfoResponse +)] +pub struct QueryHistoricalInfoRequest { + /// height defines at which height to query the historical info. + #[prost(int64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: i64, +} +/// QueryHistoricalInfoResponse is response type for the Query/HistoricalInfo 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.staking.v1beta1.QueryHistoricalInfoResponse")] +pub struct QueryHistoricalInfoResponse { + /// hist defines the historical info at the given height. + #[prost(message, optional, tag = "1")] + pub hist: ::core::option::Option, +} +/// QueryPoolRequest is request type for the Query/Pool 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.staking.v1beta1.QueryPoolRequest")] +#[proto_query( + path = "/cosmos.staking.v1beta1.Query/Pool", + response_type = QueryPoolResponse +)] +pub struct QueryPoolRequest {} +/// QueryPoolResponse is response type for the Query/Pool 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.staking.v1beta1.QueryPoolResponse")] +pub struct QueryPoolResponse { + /// pool defines the pool info. + #[prost(message, optional, tag = "1")] + pub pool: ::core::option::Option, +} +/// QueryParamsRequest is request type for the Query/Params 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.staking.v1beta1.QueryParamsRequest")] +#[proto_query( + path = "/cosmos.staking.v1beta1.Query/Params", + response_type = QueryParamsResponse +)] +pub struct QueryParamsRequest {} +/// QueryParamsResponse is response type for the Query/Params 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.staking.v1beta1.QueryParamsResponse")] +pub struct QueryParamsResponse { + /// params holds all the parameters of this module. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} +/// MsgCreateValidator defines a SDK message for creating a new validator. +#[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.staking.v1beta1.MsgCreateValidator")] +pub struct MsgCreateValidator { + #[prost(message, optional, tag = "1")] + pub description: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub commission: ::core::option::Option, + #[prost(string, tag = "3")] + pub min_self_delegation: ::prost::alloc::string::String, + /// Deprecated: Use of Delegator Address in MsgCreateValidator is deprecated. + /// The validator address bytes and delegator address bytes refer to the same account while creating validator (defer + /// only in bech32 notation). + #[deprecated] + #[prost(string, tag = "4")] + pub delegator_address: ::prost::alloc::string::String, + #[prost(string, tag = "5")] + pub validator_address: ::prost::alloc::string::String, + #[prost(message, optional, tag = "6")] + pub pubkey: ::core::option::Option, + #[prost(message, optional, tag = "7")] + pub value: ::core::option::Option, +} +/// MsgCreateValidatorResponse defines the Msg/CreateValidator 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.staking.v1beta1.MsgCreateValidatorResponse")] +pub struct MsgCreateValidatorResponse {} +/// MsgEditValidator defines a SDK message for editing an existing validator. +#[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.staking.v1beta1.MsgEditValidator")] +pub struct MsgEditValidator { + #[prost(message, optional, tag = "1")] + pub description: ::core::option::Option, + #[prost(string, tag = "2")] + pub validator_address: ::prost::alloc::string::String, + /// We pass a reference to the new commission rate and min self delegation as + /// it's not mandatory to update. If not updated, the deserialized rate will be + /// zero with no way to distinguish if an update was intended. + /// REF: #2373 + #[prost(string, tag = "3")] + pub commission_rate: ::prost::alloc::string::String, + #[prost(string, tag = "4")] + pub min_self_delegation: ::prost::alloc::string::String, +} +/// MsgEditValidatorResponse defines the Msg/EditValidator 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.staking.v1beta1.MsgEditValidatorResponse")] +pub struct MsgEditValidatorResponse {} +/// MsgDelegate defines a SDK message for performing a delegation of coins +/// from a delegator to a validator. +#[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.staking.v1beta1.MsgDelegate")] +pub struct MsgDelegate { + #[prost(string, tag = "1")] + pub delegator_address: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub validator_address: ::prost::alloc::string::String, + #[prost(message, optional, tag = "3")] + pub amount: ::core::option::Option, +} +/// MsgDelegateResponse defines the Msg/Delegate 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.staking.v1beta1.MsgDelegateResponse")] +pub struct MsgDelegateResponse {} +/// MsgBeginRedelegate defines a SDK message for performing a redelegation +/// of coins from a delegator and source validator to a destination validator. +#[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.staking.v1beta1.MsgBeginRedelegate")] +pub struct MsgBeginRedelegate { + #[prost(string, tag = "1")] + pub delegator_address: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub validator_src_address: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub validator_dst_address: ::prost::alloc::string::String, + #[prost(message, optional, tag = "4")] + pub amount: ::core::option::Option, +} +/// MsgBeginRedelegateResponse defines the Msg/BeginRedelegate 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.staking.v1beta1.MsgBeginRedelegateResponse")] +pub struct MsgBeginRedelegateResponse { + #[prost(message, optional, tag = "1")] + pub completion_time: ::core::option::Option, +} +/// MsgUndelegate defines a SDK message for performing an undelegation from a +/// delegate and a validator. +#[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.staking.v1beta1.MsgUndelegate")] +pub struct MsgUndelegate { + #[prost(string, tag = "1")] + pub delegator_address: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub validator_address: ::prost::alloc::string::String, + #[prost(message, optional, tag = "3")] + pub amount: ::core::option::Option, +} +/// MsgUndelegateResponse defines the Msg/Undelegate 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.staking.v1beta1.MsgUndelegateResponse")] +pub struct MsgUndelegateResponse { + #[prost(message, optional, tag = "1")] + pub completion_time: ::core::option::Option, + /// amount returns the amount of undelegated coins + /// + /// Since: cosmos-sdk 0.50 + #[prost(message, optional, tag = "2")] + pub amount: ::core::option::Option, +} +/// MsgCancelUnbondingDelegation defines the SDK message for performing a cancel unbonding delegation for delegator +/// +/// 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.staking.v1beta1.MsgCancelUnbondingDelegation")] +pub struct MsgCancelUnbondingDelegation { + #[prost(string, tag = "1")] + pub delegator_address: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub validator_address: ::prost::alloc::string::String, + /// amount is always less than or equal to unbonding delegation entry balance + #[prost(message, optional, tag = "3")] + pub amount: ::core::option::Option, + /// creation_height is the height which the unbonding took place. + #[prost(int64, tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub creation_height: i64, +} +/// MsgCancelUnbondingDelegationResponse +/// +/// 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.staking.v1beta1.MsgCancelUnbondingDelegationResponse")] +pub struct MsgCancelUnbondingDelegationResponse {} +/// MsgUpdateParams is the Msg/UpdateParams request type. +/// +/// Since: cosmos-sdk 0.47 +#[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.staking.v1beta1.MsgUpdateParams")] +pub struct MsgUpdateParams { + /// authority is the address that controls the module (defaults to x/gov unless overwritten). + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// params defines the x/staking parameters to update. + /// + /// NOTE: All parameters must be supplied. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +/// MsgUpdateParamsResponse defines the response structure for executing a +/// MsgUpdateParams message. +/// +/// Since: cosmos-sdk 0.47 +#[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.staking.v1beta1.MsgUpdateParamsResponse")] +pub struct MsgUpdateParamsResponse {} +pub struct StakingQuerier<'a, Q: cosmwasm_std::CustomQuery> { + querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, +} +impl<'a, Q: cosmwasm_std::CustomQuery> StakingQuerier<'a, Q> { pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self { Self { querier } } + pub fn validators( + &self, + status: ::prost::alloc::string::String, + pagination: ::core::option::Option, + ) -> Result { + QueryValidatorsRequest { status, pagination }.query(self.querier) + } pub fn validator( &self, validator_addr: ::prost::alloc::string::String, ) -> Result { QueryValidatorRequest { validator_addr }.query(self.querier) } + pub fn validator_delegations( + &self, + validator_addr: ::prost::alloc::string::String, + pagination: ::core::option::Option, + ) -> Result { + QueryValidatorDelegationsRequest { + validator_addr, + pagination, + } + .query(self.querier) + } + pub fn validator_unbonding_delegations( + &self, + validator_addr: ::prost::alloc::string::String, + pagination: ::core::option::Option, + ) -> Result { + QueryValidatorUnbondingDelegationsRequest { + validator_addr, + pagination, + } + .query(self.querier) + } pub fn delegation( &self, delegator_addr: ::prost::alloc::string::String, @@ -356,6 +1830,85 @@ impl<'a, Q: cosmwasm_std::CustomQuery> StakingQuerier<'a, Q> { } .query(self.querier) } + pub fn unbonding_delegation( + &self, + delegator_addr: ::prost::alloc::string::String, + validator_addr: ::prost::alloc::string::String, + ) -> Result { + QueryUnbondingDelegationRequest { + delegator_addr, + validator_addr, + } + .query(self.querier) + } + pub fn delegator_delegations( + &self, + delegator_addr: ::prost::alloc::string::String, + pagination: ::core::option::Option, + ) -> Result { + QueryDelegatorDelegationsRequest { + delegator_addr, + pagination, + } + .query(self.querier) + } + pub fn delegator_unbonding_delegations( + &self, + delegator_addr: ::prost::alloc::string::String, + pagination: ::core::option::Option, + ) -> Result { + QueryDelegatorUnbondingDelegationsRequest { + delegator_addr, + pagination, + } + .query(self.querier) + } + pub fn redelegations( + &self, + delegator_addr: ::prost::alloc::string::String, + src_validator_addr: ::prost::alloc::string::String, + dst_validator_addr: ::prost::alloc::string::String, + pagination: ::core::option::Option, + ) -> Result { + QueryRedelegationsRequest { + delegator_addr, + src_validator_addr, + dst_validator_addr, + pagination, + } + .query(self.querier) + } + pub fn delegator_validators( + &self, + delegator_addr: ::prost::alloc::string::String, + pagination: ::core::option::Option, + ) -> Result { + QueryDelegatorValidatorsRequest { + delegator_addr, + pagination, + } + .query(self.querier) + } + pub fn delegator_validator( + &self, + delegator_addr: ::prost::alloc::string::String, + validator_addr: ::prost::alloc::string::String, + ) -> Result { + QueryDelegatorValidatorRequest { + delegator_addr, + validator_addr, + } + .query(self.querier) + } + pub fn historical_info( + &self, + height: i64, + ) -> Result { + QueryHistoricalInfoRequest { height }.query(self.querier) + } + pub fn pool(&self) -> Result { + QueryPoolRequest {}.query(self.querier) + } pub fn params(&self) -> Result { QueryParamsRequest {}.query(self.querier) } diff --git a/packages/provwasm-std/src/types/cosmos/store/internal/kv/mod.rs b/packages/provwasm-std/src/types/cosmos/store/internal/kv/mod.rs new file mode 100644 index 00000000..9f64fc82 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/store/internal/kv/mod.rs @@ -0,0 +1 @@ +pub mod v1beta1; diff --git a/packages/provwasm-std/src/types/cosmos/store/internal/kv/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/store/internal/kv/v1beta1.rs new file mode 100644 index 00000000..1e91fd09 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/store/internal/kv/v1beta1.rs @@ -0,0 +1,45 @@ +use provwasm_proc_macro::CosmwasmExt; +/// Pairs defines a repeated slice of Pair objects. +#[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.store.internal.kv.v1beta1.Pairs")] +pub struct Pairs { + #[prost(message, repeated, tag = "1")] + pub pairs: ::prost::alloc::vec::Vec, +} +/// Pair defines a key/value bytes tuple. +#[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.store.internal.kv.v1beta1.Pair")] +pub struct Pair { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub key: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub value: ::prost::alloc::vec::Vec, +} diff --git a/packages/provwasm-std/src/types/cosmos/store/internal/mod.rs b/packages/provwasm-std/src/types/cosmos/store/internal/mod.rs new file mode 100644 index 00000000..05c6d5b9 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/store/internal/mod.rs @@ -0,0 +1 @@ +pub mod kv; diff --git a/packages/provwasm-std/src/types/cosmos/store/mod.rs b/packages/provwasm-std/src/types/cosmos/store/mod.rs new file mode 100644 index 00000000..b772b151 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/store/mod.rs @@ -0,0 +1,4 @@ +pub mod internal; +pub mod snapshots; +pub mod streaming; +pub mod v1beta1; diff --git a/packages/provwasm-std/src/types/cosmos/store/snapshots/mod.rs b/packages/provwasm-std/src/types/cosmos/store/snapshots/mod.rs new file mode 100644 index 00000000..a3a6d96c --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/store/snapshots/mod.rs @@ -0,0 +1 @@ +pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/store/snapshots/v1.rs b/packages/provwasm-std/src/types/cosmos/store/snapshots/v1.rs new file mode 100644 index 00000000..db6d4f64 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/store/snapshots/v1.rs @@ -0,0 +1,215 @@ +use provwasm_proc_macro::CosmwasmExt; +/// Snapshot contains Tendermint state sync snapshot info. +#[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.store.snapshots.v1.Snapshot")] +pub struct Snapshot { + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: u64, + #[prost(uint32, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub format: u32, + #[prost(uint32, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub chunks: u32, + #[prost(bytes = "vec", tag = "4")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub hash: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "5")] + pub metadata: ::core::option::Option, +} +/// Metadata contains SDK-specific snapshot metadata. +#[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.store.snapshots.v1.Metadata")] +pub struct Metadata { + /// SHA-256 chunk hashes + #[prost(bytes = "vec", repeated, tag = "1")] + pub chunk_hashes: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, +} +/// SnapshotItem is an item contained in a rootmulti.Store snapshot. +/// +/// 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.store.snapshots.v1.SnapshotItem")] +pub struct SnapshotItem { + /// item is the specific type of snapshot item. + #[prost(oneof = "snapshot_item::Item", tags = "1, 2, 3, 4")] + pub item: ::core::option::Option, +} +/// Nested message and enum types in `SnapshotItem`. +pub mod snapshot_item { + use provwasm_proc_macro::CosmwasmExt; + /// item is the specific type of snapshot item. + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive( + Clone, + PartialEq, + Eq, + ::prost::Oneof, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + )] + pub enum Item { + #[prost(message, tag = "1")] + Store(super::SnapshotStoreItem), + #[prost(message, tag = "2")] + Iavl(super::SnapshotIavlItem), + #[prost(message, tag = "3")] + Extension(super::SnapshotExtensionMeta), + #[prost(message, tag = "4")] + ExtensionPayload(super::SnapshotExtensionPayload), + } +} +/// SnapshotStoreItem contains metadata about a snapshotted store. +/// +/// 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.store.snapshots.v1.SnapshotStoreItem")] +pub struct SnapshotStoreItem { + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, +} +/// SnapshotIAVLItem is an exported IAVL node. +/// +/// 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.store.snapshots.v1.SnapshotIAVLItem")] +pub struct SnapshotIavlItem { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub key: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub value: ::prost::alloc::vec::Vec, + /// version is block height + #[prost(int64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub version: i64, + /// height is depth of the tree. + #[prost(int32, tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: i32, +} +/// SnapshotExtensionMeta contains metadata about an external snapshotter. +/// +/// 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.store.snapshots.v1.SnapshotExtensionMeta")] +pub struct SnapshotExtensionMeta { + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + #[prost(uint32, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub format: u32, +} +/// SnapshotExtensionPayload contains payloads of an external snapshotter. +/// +/// 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.store.snapshots.v1.SnapshotExtensionPayload")] +pub struct SnapshotExtensionPayload { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub payload: ::prost::alloc::vec::Vec, +} diff --git a/packages/provwasm-std/src/types/cosmos/store/streaming/abci.rs b/packages/provwasm-std/src/types/cosmos/store/streaming/abci.rs new file mode 100644 index 00000000..650dbc40 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/store/streaming/abci.rs @@ -0,0 +1,76 @@ +use provwasm_proc_macro::CosmwasmExt; +/// ListenEndBlockRequest is the request type for the ListenEndBlock 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.store.streaming.abci.ListenFinalizeBlockRequest")] +pub struct ListenFinalizeBlockRequest { + #[prost(message, optional, tag = "1")] + pub req: + ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub res: + ::core::option::Option, +} +/// ListenEndBlockResponse is the response type for the ListenEndBlock 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.store.streaming.abci.ListenFinalizeBlockResponse")] +pub struct ListenFinalizeBlockResponse {} +/// ListenCommitRequest is the request type for the ListenCommit 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.store.streaming.abci.ListenCommitRequest")] +pub struct ListenCommitRequest { + /// explicitly pass in block height as ResponseCommit does not contain this info + #[prost(int64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub block_height: i64, + #[prost(message, optional, tag = "2")] + pub res: ::core::option::Option, + #[prost(message, repeated, tag = "3")] + pub change_set: ::prost::alloc::vec::Vec, +} +/// ListenCommitResponse is the response type for the ListenCommit 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.store.streaming.abci.ListenCommitResponse")] +pub struct ListenCommitResponse {} diff --git a/packages/provwasm-std/src/types/cosmos/store/streaming/mod.rs b/packages/provwasm-std/src/types/cosmos/store/streaming/mod.rs new file mode 100644 index 00000000..c52eb0a4 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/store/streaming/mod.rs @@ -0,0 +1 @@ +pub mod abci; diff --git a/packages/provwasm-std/src/types/cosmos/store/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/store/v1beta1.rs new file mode 100644 index 00000000..98fe6e14 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/store/v1beta1.rs @@ -0,0 +1,138 @@ +use provwasm_proc_macro::CosmwasmExt; +/// StoreKVPair is a KVStore KVPair used for listening to state changes (Sets and Deletes) +/// It optionally includes the StoreKey for the originating KVStore and a Boolean flag to distinguish between Sets and +/// Deletes +/// +/// Since: cosmos-sdk 0.43 +#[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.store.v1beta1.StoreKVPair")] +pub struct StoreKvPair { + /// the store key for the KVStore this pair originates from + #[prost(string, tag = "1")] + pub store_key: ::prost::alloc::string::String, + /// true indicates a delete operation, false indicates a set operation + #[prost(bool, tag = "2")] + pub delete: bool, + #[prost(bytes = "vec", tag = "3")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub key: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "4")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub value: ::prost::alloc::vec::Vec, +} +/// BlockMetadata contains all the abci event data of a block +/// the file streamer dump them into files together with the state changes. +#[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.store.v1beta1.BlockMetadata")] +pub struct BlockMetadata { + #[prost(message, optional, tag = "6")] + pub response_commit: + ::core::option::Option, + #[prost(message, optional, tag = "7")] + pub request_finalize_block: + ::core::option::Option, + /// TODO: should we renumber this? + #[prost(message, optional, tag = "8")] + pub response_finalize_block: + ::core::option::Option, +} +/// CommitInfo defines commit information used by the multi-store when committing +/// a version/height. +#[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.store.v1beta1.CommitInfo")] +pub struct CommitInfo { + #[prost(int64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub version: i64, + #[prost(message, repeated, tag = "2")] + pub store_infos: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "3")] + pub timestamp: ::core::option::Option, +} +/// StoreInfo defines store-specific commit information. It contains a reference +/// between a store name and the commit ID. +#[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.store.v1beta1.StoreInfo")] +pub struct StoreInfo { + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub commit_id: ::core::option::Option, +} +/// CommitID defines the commitment information when a specific store is +/// committed. +#[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.store.v1beta1.CommitID")] +pub struct CommitId { + #[prost(int64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub version: i64, + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub hash: ::prost::alloc::vec::Vec, +} diff --git a/packages/provwasm-std/src/types/cosmos/tx/config/mod.rs b/packages/provwasm-std/src/types/cosmos/tx/config/mod.rs new file mode 100644 index 00000000..a3a6d96c --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/tx/config/mod.rs @@ -0,0 +1 @@ +pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/tx/config/v1.rs b/packages/provwasm-std/src/types/cosmos/tx/config/v1.rs new file mode 100644 index 00000000..71c0e497 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/tx/config/v1.rs @@ -0,0 +1,24 @@ +use provwasm_proc_macro::CosmwasmExt; +/// Config is the config object of the x/auth/tx package. +#[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.tx.config.v1.Config")] +pub struct Config { + /// skip_ante_handler defines whether the ante handler registration should be skipped in case an app wants to override + /// this functionality. + #[prost(bool, tag = "1")] + pub skip_ante_handler: bool, + /// skip_post_handler defines whether the post handler registration should be skipped in case an app wants to override + /// this functionality. + #[prost(bool, tag = "2")] + pub skip_post_handler: bool, +} diff --git a/packages/provwasm-std/src/types/cosmos/tx/mod.rs b/packages/provwasm-std/src/types/cosmos/tx/mod.rs index 431b5eab..404cbb51 100644 --- a/packages/provwasm-std/src/types/cosmos/tx/mod.rs +++ b/packages/provwasm-std/src/types/cosmos/tx/mod.rs @@ -1 +1,3 @@ +pub mod config; pub mod signing; +pub mod v1beta1; diff --git a/packages/provwasm-std/src/types/cosmos/tx/signing/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/tx/signing/v1beta1.rs index 76ba80a0..c4bbac2c 100644 --- a/packages/provwasm-std/src/types/cosmos/tx/signing/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/tx/signing/v1beta1.rs @@ -1,4 +1,5 @@ use provwasm_proc_macro::CosmwasmExt; +/// SignatureDescriptors wraps multiple SignatureDescriptor's. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -12,9 +13,14 @@ use provwasm_proc_macro::CosmwasmExt; )] #[proto_message(type_url = "/cosmos.tx.signing.v1beta1.SignatureDescriptors")] pub struct SignatureDescriptors { + /// signatures are the signature descriptors #[prost(message, repeated, tag = "1")] pub signatures: ::prost::alloc::vec::Vec, } +/// SignatureDescriptor is a convenience type which represents the full data for +/// a signature including the public key of the signer, signing modes and the +/// signature itself. It is primarily used for coordinating signatures between +/// clients. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -28,10 +34,14 @@ pub struct SignatureDescriptors { )] #[proto_message(type_url = "/cosmos.tx.signing.v1beta1.SignatureDescriptor")] pub struct SignatureDescriptor { + /// public_key is the public key of the signer #[prost(message, optional, tag = "1")] pub public_key: ::core::option::Option, #[prost(message, optional, tag = "2")] pub data: ::core::option::Option, + /// sequence is the sequence of the account, which describes the + /// number of committed transactions signed by a given address. It is used to prevent + /// replay attacks. #[prost(uint64, tag = "3")] #[serde( serialize_with = "crate::serde::as_str::serialize", @@ -42,6 +52,7 @@ pub struct SignatureDescriptor { /// Nested message and enum types in `SignatureDescriptor`. pub mod signature_descriptor { use provwasm_proc_macro::CosmwasmExt; + /// Data represents signature data #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -55,12 +66,14 @@ pub mod signature_descriptor { )] #[proto_message(type_url = "/cosmos.tx.signing.v1beta1.SignatureDescriptor.Data")] pub struct Data { + /// sum is the oneof that specifies whether this represents single or multi-signature data #[prost(oneof = "data::Sum", tags = "1, 2")] pub sum: ::core::option::Option, } /// Nested message and enum types in `Data`. pub mod data { use provwasm_proc_macro::CosmwasmExt; + /// Single is the signature data for a single signer #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -74,12 +87,14 @@ pub mod signature_descriptor { )] #[proto_message(type_url = "/cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single")] pub struct Single { + /// mode is the signing mode of the single signer #[prost(enumeration = "super::super::SignMode", tag = "1")] #[serde( - serialize_with = "super::super::SignMode::serialize", - deserialize_with = "super::super::SignMode::deserialize" + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" )] pub mode: i32, + /// signature is the raw signature bytes #[prost(bytes = "vec", tag = "2")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", @@ -87,6 +102,7 @@ pub mod signature_descriptor { )] pub signature: ::prost::alloc::vec::Vec, } + /// Multi is the signature data for a multisig public key #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -100,13 +116,16 @@ pub mod signature_descriptor { )] #[proto_message(type_url = "/cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi")] pub struct Multi { + /// bitarray specifies which keys within the multisig are signing #[prost(message, optional, tag = "1")] pub bitarray: ::core::option::Option< super::super::super::super::super::crypto::multisig::v1beta1::CompactBitArray, >, + /// signatures is the signatures of the multi-signature #[prost(message, repeated, tag = "2")] pub signatures: ::prost::alloc::vec::Vec, } + /// sum is the oneof that specifies whether this represents single or multi-signature data #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -118,22 +137,58 @@ pub mod signature_descriptor { ::schemars::JsonSchema, )] pub enum Sum { + /// single represents a single signer #[prost(message, tag = "1")] Single(Single), + /// multi represents a multisig signer #[prost(message, tag = "2")] Multi(Multi), } } } +/// SignMode represents a signing mode with its own security guarantees. +/// +/// This enum should be considered a registry of all known sign modes +/// in the Cosmos ecosystem. Apps are not expected to support all known +/// sign modes. Apps that would like to support custom sign modes are +/// encouraged to open a small PR against this file to add a new case +/// to this SignMode enum describing their sign mode so that different +/// apps have a consistent version of this enum. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] #[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] pub enum SignMode { + /// SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be + /// rejected. Unspecified = 0, + /// SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is + /// verified with raw bytes from Tx. Direct = 1, + /// SIGN_MODE_TEXTUAL is a future signing mode that will verify some + /// human-readable textual representation on top of the binary representation + /// from SIGN_MODE_DIRECT. + /// + /// Since: cosmos-sdk 0.50 Textual = 2, + /// SIGN_MODE_DIRECT_AUX specifies a signing mode which uses + /// SignDocDirectAux. As opposed to SIGN_MODE_DIRECT, this sign mode does not + /// require signers signing over other signers' `signer_info`. + /// + /// Since: cosmos-sdk 0.46 DirectAux = 3, + /// SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses + /// Amino JSON and will be removed in the future. LegacyAminoJson = 127, + /// SIGN_MODE_EIP_191 specifies the sign mode for EIP 191 signing on the Cosmos + /// SDK. Ref: + /// + /// Currently, SIGN_MODE_EIP_191 is registered as a SignMode enum variant, + /// but is not implemented on the SDK by default. To enable EIP-191, you need + /// to pass a custom `TxConfig` that has an implementation of + /// `SignModeHandler` for EIP-191. The SDK may decide to fully support + /// EIP-191 in the future. + /// + /// Since: cosmos-sdk 0.45.2 Eip191 = 191, } impl SignMode { @@ -163,27 +218,4 @@ impl SignMode { _ => None, } } - - pub fn serialize(v: &i32, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - let enum_value = Self::try_from(*v); - match enum_value { - Ok(v) => serializer.serialize_str(v.as_str_name()), - Err(e) => Err(serde::ser::Error::custom(e)), - } - } - - pub fn deserialize<'de, D>(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - use serde::de::Deserialize; - let s = String::deserialize(deserializer)?; - match Self::from_str_name(&s) { - Some(v) => Ok(v.into()), - None => Err(serde::de::Error::custom("unknown value")), - } - } } diff --git a/packages/provwasm-std/src/types/cosmos/tx/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/tx/v1beta1.rs new file mode 100644 index 00000000..f65762cc --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/tx/v1beta1.rs @@ -0,0 +1,1019 @@ +use provwasm_proc_macro::CosmwasmExt; +/// Tx is the standard type used for broadcasting transactions. +#[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.tx.v1beta1.Tx")] +pub struct Tx { + /// body is the processable content of the transaction + #[prost(message, optional, tag = "1")] + pub body: ::core::option::Option, + /// auth_info is the authorization related content of the transaction, + /// specifically signers, signer modes and fee + #[prost(message, optional, tag = "2")] + pub auth_info: ::core::option::Option, + /// signatures is a list of signatures that matches the length and order of + /// AuthInfo's signer_infos to allow connecting signature meta information like + /// public key and signing mode by position. + #[prost(bytes = "vec", repeated, tag = "3")] + pub signatures: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, +} +/// TxRaw is a variant of Tx that pins the signer's exact binary representation +/// of body and auth_info. This is used for signing, broadcasting and +/// verification. The binary `serialize(tx: TxRaw)` is stored in Tendermint and +/// the hash `sha256(serialize(tx: TxRaw))` becomes the "txhash", commonly used +/// as the transaction ID. +#[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.tx.v1beta1.TxRaw")] +pub struct TxRaw { + /// body_bytes is a protobuf serialization of a TxBody that matches the + /// representation in SignDoc. + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub body_bytes: ::prost::alloc::vec::Vec, + /// auth_info_bytes is a protobuf serialization of an AuthInfo that matches the + /// representation in SignDoc. + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub auth_info_bytes: ::prost::alloc::vec::Vec, + /// signatures is a list of signatures that matches the length and order of + /// AuthInfo's signer_infos to allow connecting signature meta information like + /// public key and signing mode by position. + #[prost(bytes = "vec", repeated, tag = "3")] + pub signatures: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, +} +/// SignDoc is the type used for generating sign bytes for SIGN_MODE_DIRECT. +#[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.tx.v1beta1.SignDoc")] +pub struct SignDoc { + /// body_bytes is protobuf serialization of a TxBody that matches the + /// representation in TxRaw. + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub body_bytes: ::prost::alloc::vec::Vec, + /// auth_info_bytes is a protobuf serialization of an AuthInfo that matches the + /// representation in TxRaw. + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub auth_info_bytes: ::prost::alloc::vec::Vec, + /// chain_id is the unique identifier of the chain this transaction targets. + /// It prevents signed transactions from being used on another chain by an + /// attacker + #[prost(string, tag = "3")] + pub chain_id: ::prost::alloc::string::String, + /// account_number is the account number of the account in state + #[prost(uint64, tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub account_number: u64, +} +/// SignDocDirectAux is the type used for generating sign bytes for +/// SIGN_MODE_DIRECT_AUX. +/// +/// 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.tx.v1beta1.SignDocDirectAux")] +pub struct SignDocDirectAux { + /// body_bytes is protobuf serialization of a TxBody that matches the + /// representation in TxRaw. + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub body_bytes: ::prost::alloc::vec::Vec, + /// public_key is the public key of the signing account. + #[prost(message, optional, tag = "2")] + pub public_key: ::core::option::Option, + /// chain_id is the identifier of the chain this transaction targets. + /// It prevents signed transactions from being used on another chain by an + /// attacker. + #[prost(string, tag = "3")] + pub chain_id: ::prost::alloc::string::String, + /// account_number is the account number of the account in state. + #[prost(uint64, tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub account_number: u64, + /// sequence is the sequence number of the signing account. + #[prost(uint64, tag = "5")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub sequence: u64, + /// tips have been depreacted and should not be used + #[deprecated] + #[prost(message, optional, tag = "6")] + pub tip: ::core::option::Option, +} +/// TxBody is the body of a transaction that all signers sign over. +#[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.tx.v1beta1.TxBody")] +pub struct TxBody { + /// messages is a list of messages to be executed. The required signers of + /// those messages define the number and order of elements in AuthInfo's + /// signer_infos and Tx's signatures. Each required signer address is added to + /// the list only the first time it occurs. + /// By convention, the first required signer (usually from the first message) + /// is referred to as the primary signer and pays the fee for the whole + /// transaction. + #[prost(message, repeated, tag = "1")] + pub messages: ::prost::alloc::vec::Vec, + /// memo is any arbitrary note/comment to be added to the transaction. + /// WARNING: in clients, any publicly exposed text should not be called memo, + /// but should be called `note` instead (see ). + #[prost(string, tag = "2")] + pub memo: ::prost::alloc::string::String, + /// timeout is the block height after which this transaction will not + /// be processed by the chain + #[prost(uint64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub timeout_height: u64, + /// extension_options are arbitrary options that can be added by chains + /// when the default options are not sufficient. If any of these are present + /// and can't be handled, the transaction will be rejected + #[prost(message, repeated, tag = "1023")] + pub extension_options: ::prost::alloc::vec::Vec, + /// extension_options are arbitrary options that can be added by chains + /// when the default options are not sufficient. If any of these are present + /// and can't be handled, they will be ignored + #[prost(message, repeated, tag = "2047")] + pub non_critical_extension_options: ::prost::alloc::vec::Vec, +} +/// AuthInfo describes the fee and signer modes that are used to sign a +/// transaction. +#[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.tx.v1beta1.AuthInfo")] +pub struct AuthInfo { + /// signer_infos defines the signing modes for the required signers. The number + /// and order of elements must match the required signers from TxBody's + /// messages. The first element is the primary signer and the one which pays + /// the fee. + #[prost(message, repeated, tag = "1")] + pub signer_infos: ::prost::alloc::vec::Vec, + /// Fee is the fee and gas limit for the transaction. The first signer is the + /// primary signer and the one which pays the fee. The fee can be calculated + /// based on the cost of evaluating the body and doing signature verification + /// of the signers. This can be estimated via simulation. + #[prost(message, optional, tag = "2")] + pub fee: ::core::option::Option, + /// Tip is the optional tip used for transactions fees paid in another denom. + /// + /// This field is ignored if the chain didn't enable tips, i.e. didn't add the + /// `TipDecorator` in its posthandler. + /// + /// Since: cosmos-sdk 0.46 + #[deprecated] + #[prost(message, optional, tag = "3")] + pub tip: ::core::option::Option, +} +/// SignerInfo describes the public key and signing mode of a single top-level +/// signer. +#[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.tx.v1beta1.SignerInfo")] +pub struct SignerInfo { + /// public_key is the public key of the signer. It is optional for accounts + /// that already exist in state. If unset, the verifier can use the required \ + /// signer address for this position and lookup the public key. + #[prost(message, optional, tag = "1")] + pub public_key: ::core::option::Option, + /// mode_info describes the signing mode of the signer and is a nested + /// structure to support nested multisig pubkey's + #[prost(message, optional, tag = "2")] + pub mode_info: ::core::option::Option, + /// sequence is the sequence of the account, which describes the + /// number of committed transactions signed by a given address. It is used to + /// prevent replay attacks. + #[prost(uint64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub sequence: u64, +} +/// ModeInfo describes the signing mode of a single or nested multisig signer. +#[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.tx.v1beta1.ModeInfo")] +pub struct ModeInfo { + /// sum is the oneof that specifies whether this represents a single or nested + /// multisig signer + #[prost(oneof = "mode_info::Sum", tags = "1, 2")] + pub sum: ::core::option::Option, +} +/// Nested message and enum types in `ModeInfo`. +pub mod mode_info { + use provwasm_proc_macro::CosmwasmExt; + /// Single is the mode info for a single signer. It is structured as a message + /// to allow for additional fields such as locale for SIGN_MODE_TEXTUAL in the + /// future + #[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.tx.v1beta1.ModeInfo.Single")] + pub struct Single { + /// mode is the signing mode of the single signer + #[prost(enumeration = "super::super::signing::v1beta1::SignMode", tag = "1")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub mode: i32, + } + /// Multi is the mode info for a multisig public key + #[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.tx.v1beta1.ModeInfo.Multi")] + pub struct Multi { + /// bitarray specifies which keys within the multisig are signing + #[prost(message, optional, tag = "1")] + pub bitarray: + ::core::option::Option, + /// mode_infos is the corresponding modes of the signers of the multisig + /// which could include nested multisig public keys + #[prost(message, repeated, tag = "2")] + pub mode_infos: ::prost::alloc::vec::Vec, + } + /// sum is the oneof that specifies whether this represents a single or nested + /// multisig signer + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive( + Clone, + PartialEq, + Eq, + ::prost::Oneof, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + )] + pub enum Sum { + /// single represents a single signer + #[prost(message, tag = "1")] + Single(Single), + /// multi represents a nested multisig signer + #[prost(message, tag = "2")] + Multi(Multi), + } +} +/// Fee includes the amount of coins paid in fees and the maximum +/// gas to be used by the transaction. The ratio yields an effective "gasprice", +/// which must be above some miminum to be accepted into the mempool. +#[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.tx.v1beta1.Fee")] +pub struct Fee { + /// amount is the amount of coins to be paid as a fee + #[prost(message, repeated, tag = "1")] + pub amount: ::prost::alloc::vec::Vec, + /// gas_limit is the maximum gas that can be used in transaction processing + /// before an out of gas error occurs + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub gas_limit: u64, + /// if unset, the first signer is responsible for paying the fees. If set, the specified account must pay the fees. + /// the payer must be a tx signer (and thus have signed this field in AuthInfo). + /// setting this field does *not* change the ordering of required signers for the transaction. + #[prost(string, tag = "3")] + pub payer: ::prost::alloc::string::String, + /// if set, the fee payer (either the first signer or the value of the payer field) requests that a fee grant be used + /// to pay fees instead of the fee payer's own balance. If an appropriate fee grant does not exist or the chain does + /// not support fee grants, this will fail + #[prost(string, tag = "4")] + pub granter: ::prost::alloc::string::String, +} +/// Tip is the tip used for meta-transactions. +/// +/// 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.tx.v1beta1.Tip")] +#[deprecated] +pub struct Tip { + /// amount is the amount of the tip + #[prost(message, repeated, tag = "1")] + pub amount: ::prost::alloc::vec::Vec, + /// tipper is the address of the account paying for the tip + #[prost(string, tag = "2")] + pub tipper: ::prost::alloc::string::String, +} +/// AuxSignerData is the intermediary format that an auxiliary signer (e.g. a +/// tipper) builds and sends to the fee payer (who will build and broadcast the +/// actual tx). AuxSignerData is not a valid tx in itself, and will be rejected +/// by the node if sent directly as-is. +/// +/// 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.tx.v1beta1.AuxSignerData")] +pub struct AuxSignerData { + /// address is the bech32-encoded address of the auxiliary signer. If using + /// AuxSignerData across different chains, the bech32 prefix of the target + /// chain (where the final transaction is broadcasted) should be used. + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// sign_doc is the SIGN_MODE_DIRECT_AUX sign doc that the auxiliary signer + /// signs. Note: we use the same sign doc even if we're signing with + /// LEGACY_AMINO_JSON. + #[prost(message, optional, tag = "2")] + pub sign_doc: ::core::option::Option, + /// mode is the signing mode of the single signer. + #[prost(enumeration = "super::signing::v1beta1::SignMode", tag = "3")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub mode: i32, + /// sig is the signature of the sign doc. + #[prost(bytes = "vec", tag = "4")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub sig: ::prost::alloc::vec::Vec, +} +/// GetTxsEventRequest is the request type for the Service.TxsByEvents +/// 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.tx.v1beta1.GetTxsEventRequest")] +pub struct GetTxsEventRequest { + /// events is the list of transaction event type. + /// Deprecated post v0.47.x: use query instead, which should contain a valid + /// events query. + #[deprecated] + #[prost(string, repeated, tag = "1")] + pub events: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// pagination defines a pagination for the request. + /// Deprecated post v0.46.x: use page and limit instead. + #[deprecated] + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, + #[prost(enumeration = "OrderBy", tag = "3")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub order_by: i32, + /// page is the page number to query, starts at 1. If not provided, will + /// default to first page. + #[prost(uint64, tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub page: u64, + /// limit is the total number of results to be returned in the result page. + /// If left empty it will default to a value to be set by each app. + #[prost(uint64, tag = "5")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub limit: u64, + /// query defines the transaction event query that is proxied to Tendermint's + /// TxSearch RPC method. The query must be valid. + /// + /// Since cosmos-sdk 0.50 + #[prost(string, tag = "6")] + pub query: ::prost::alloc::string::String, +} +/// GetTxsEventResponse is the response type for the Service.TxsByEvents +/// 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.tx.v1beta1.GetTxsEventResponse")] +pub struct GetTxsEventResponse { + /// txs is the list of queried transactions. + #[prost(message, repeated, tag = "1")] + pub txs: ::prost::alloc::vec::Vec, + /// tx_responses is the list of queried TxResponses. + #[prost(message, repeated, tag = "2")] + pub tx_responses: ::prost::alloc::vec::Vec, + /// pagination defines a pagination for the response. + /// Deprecated post v0.46.x: use total instead. + #[deprecated] + #[prost(message, optional, tag = "3")] + pub pagination: ::core::option::Option, + /// total is total number of results available + #[prost(uint64, tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub total: u64, +} +/// BroadcastTxRequest is the request type for the Service.BroadcastTxRequest +/// 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.tx.v1beta1.BroadcastTxRequest")] +pub struct BroadcastTxRequest { + /// tx_bytes is the raw transaction. + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub tx_bytes: ::prost::alloc::vec::Vec, + #[prost(enumeration = "BroadcastMode", tag = "2")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub mode: i32, +} +/// BroadcastTxResponse is the response type for the +/// Service.BroadcastTx 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.tx.v1beta1.BroadcastTxResponse")] +pub struct BroadcastTxResponse { + /// tx_response is the queried TxResponses. + #[prost(message, optional, tag = "1")] + pub tx_response: ::core::option::Option, +} +/// SimulateRequest is the request type for the Service.Simulate +/// 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.tx.v1beta1.SimulateRequest")] +pub struct SimulateRequest { + /// tx is the transaction to simulate. + /// Deprecated. Send raw tx bytes instead. + #[deprecated] + #[prost(message, optional, tag = "1")] + pub tx: ::core::option::Option, + /// tx_bytes is the raw transaction. + /// + /// Since: cosmos-sdk 0.43 + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub tx_bytes: ::prost::alloc::vec::Vec, +} +/// SimulateResponse is the response type for the +/// Service.SimulateRPC 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.tx.v1beta1.SimulateResponse")] +pub struct SimulateResponse { + /// gas_info is the information about gas used in the simulation. + #[prost(message, optional, tag = "1")] + pub gas_info: ::core::option::Option, + /// result is the result of the simulation. + #[prost(message, optional, tag = "2")] + pub result: ::core::option::Option, +} +/// GetTxRequest is the request type for the Service.GetTx +/// 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.tx.v1beta1.GetTxRequest")] +pub struct GetTxRequest { + /// hash is the tx hash to query, encoded as a hex string. + #[prost(string, tag = "1")] + pub hash: ::prost::alloc::string::String, +} +/// GetTxResponse is the response type for the Service.GetTx 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.tx.v1beta1.GetTxResponse")] +pub struct GetTxResponse { + /// tx is the queried transaction. + #[prost(message, optional, tag = "1")] + pub tx: ::core::option::Option, + /// tx_response is the queried TxResponses. + #[prost(message, optional, tag = "2")] + pub tx_response: ::core::option::Option, +} +/// GetBlockWithTxsRequest is the request type for the Service.GetBlockWithTxs +/// RPC method. +/// +/// Since: cosmos-sdk 0.45.2 +#[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.tx.v1beta1.GetBlockWithTxsRequest")] +pub struct GetBlockWithTxsRequest { + /// height is the height of the block to query. + #[prost(int64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: i64, + /// pagination defines a pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs +/// method. +/// +/// Since: cosmos-sdk 0.45.2 +#[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.tx.v1beta1.GetBlockWithTxsResponse")] +pub struct GetBlockWithTxsResponse { + /// txs are the transactions in the block. + #[prost(message, repeated, tag = "1")] + pub txs: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "2")] + pub block_id: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub block: ::core::option::Option, + /// pagination defines a pagination for the response. + #[prost(message, optional, tag = "4")] + pub pagination: ::core::option::Option, +} +/// TxDecodeRequest is the request type for the Service.TxDecode +/// RPC method. +/// +/// Since: cosmos-sdk 0.47 +#[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.tx.v1beta1.TxDecodeRequest")] +pub struct TxDecodeRequest { + /// tx_bytes is the raw transaction. + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub tx_bytes: ::prost::alloc::vec::Vec, +} +/// TxDecodeResponse is the response type for the +/// Service.TxDecode method. +/// +/// Since: cosmos-sdk 0.47 +#[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.tx.v1beta1.TxDecodeResponse")] +pub struct TxDecodeResponse { + /// tx is the decoded transaction. + #[prost(message, optional, tag = "1")] + pub tx: ::core::option::Option, +} +/// TxEncodeRequest is the request type for the Service.TxEncode +/// RPC method. +/// +/// Since: cosmos-sdk 0.47 +#[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.tx.v1beta1.TxEncodeRequest")] +pub struct TxEncodeRequest { + /// tx is the transaction to encode. + #[prost(message, optional, tag = "1")] + pub tx: ::core::option::Option, +} +/// TxEncodeResponse is the response type for the +/// Service.TxEncode method. +/// +/// Since: cosmos-sdk 0.47 +#[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.tx.v1beta1.TxEncodeResponse")] +pub struct TxEncodeResponse { + /// tx_bytes is the encoded transaction bytes. + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub tx_bytes: ::prost::alloc::vec::Vec, +} +/// TxEncodeAminoRequest is the request type for the Service.TxEncodeAmino +/// RPC method. +/// +/// Since: cosmos-sdk 0.47 +#[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.tx.v1beta1.TxEncodeAminoRequest")] +pub struct TxEncodeAminoRequest { + #[prost(string, tag = "1")] + pub amino_json: ::prost::alloc::string::String, +} +/// TxEncodeAminoResponse is the response type for the Service.TxEncodeAmino +/// RPC method. +/// +/// Since: cosmos-sdk 0.47 +#[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.tx.v1beta1.TxEncodeAminoResponse")] +pub struct TxEncodeAminoResponse { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub amino_binary: ::prost::alloc::vec::Vec, +} +/// TxDecodeAminoRequest is the request type for the Service.TxDecodeAmino +/// RPC method. +/// +/// Since: cosmos-sdk 0.47 +#[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.tx.v1beta1.TxDecodeAminoRequest")] +pub struct TxDecodeAminoRequest { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub amino_binary: ::prost::alloc::vec::Vec, +} +/// TxDecodeAminoResponse is the response type for the Service.TxDecodeAmino +/// RPC method. +/// +/// Since: cosmos-sdk 0.47 +#[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.tx.v1beta1.TxDecodeAminoResponse")] +pub struct TxDecodeAminoResponse { + #[prost(string, tag = "1")] + pub amino_json: ::prost::alloc::string::String, +} +/// OrderBy defines the sorting order +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +pub enum OrderBy { + /// ORDER_BY_UNSPECIFIED specifies an unknown sorting order. OrderBy defaults + /// to ASC in this case. + Unspecified = 0, + /// ORDER_BY_ASC defines ascending order + Asc = 1, + /// ORDER_BY_DESC defines descending order + Desc = 2, +} +impl OrderBy { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + OrderBy::Unspecified => "ORDER_BY_UNSPECIFIED", + OrderBy::Asc => "ORDER_BY_ASC", + OrderBy::Desc => "ORDER_BY_DESC", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "ORDER_BY_UNSPECIFIED" => Some(Self::Unspecified), + "ORDER_BY_ASC" => Some(Self::Asc), + "ORDER_BY_DESC" => Some(Self::Desc), + _ => None, + } + } +} +/// BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC +/// method. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +pub enum BroadcastMode { + /// zero-value for mode ordering + Unspecified = 0, + /// DEPRECATED: use BROADCAST_MODE_SYNC instead, + /// BROADCAST_MODE_BLOCK is not supported by the SDK from v0.47.x onwards. + Block = 1, + /// BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits + /// for a CheckTx execution response only. + Sync = 2, + /// BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client + /// returns immediately. + Async = 3, +} +impl BroadcastMode { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + BroadcastMode::Unspecified => "BROADCAST_MODE_UNSPECIFIED", + BroadcastMode::Block => "BROADCAST_MODE_BLOCK", + BroadcastMode::Sync => "BROADCAST_MODE_SYNC", + BroadcastMode::Async => "BROADCAST_MODE_ASYNC", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "BROADCAST_MODE_UNSPECIFIED" => Some(Self::Unspecified), + "BROADCAST_MODE_BLOCK" => Some(Self::Block), + "BROADCAST_MODE_SYNC" => Some(Self::Sync), + "BROADCAST_MODE_ASYNC" => Some(Self::Async), + _ => None, + } + } +} diff --git a/packages/provwasm-std/src/types/cosmos/upgrade/mod.rs b/packages/provwasm-std/src/types/cosmos/upgrade/mod.rs index 9f64fc82..537a3360 100644 --- a/packages/provwasm-std/src/types/cosmos/upgrade/mod.rs +++ b/packages/provwasm-std/src/types/cosmos/upgrade/mod.rs @@ -1 +1,2 @@ +pub mod module; pub mod v1beta1; diff --git a/packages/provwasm-std/src/types/cosmos/upgrade/module/mod.rs b/packages/provwasm-std/src/types/cosmos/upgrade/module/mod.rs new file mode 100644 index 00000000..a3a6d96c --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/upgrade/module/mod.rs @@ -0,0 +1 @@ +pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/upgrade/module/v1.rs b/packages/provwasm-std/src/types/cosmos/upgrade/module/v1.rs new file mode 100644 index 00000000..32d49c9f --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/upgrade/module/v1.rs @@ -0,0 +1,19 @@ +use provwasm_proc_macro::CosmwasmExt; +/// Module is the config object of the upgrade 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.upgrade.module.v1.Module")] +pub struct Module { + /// authority defines the custom module authority. If not set, defaults to the governance module. + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, +} diff --git a/packages/provwasm-std/src/types/cosmos/upgrade/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/upgrade/v1beta1.rs index a662d026..501c3b78 100644 --- a/packages/provwasm-std/src/types/cosmos/upgrade/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/upgrade/v1beta1.rs @@ -1,4 +1,5 @@ use provwasm_proc_macro::CosmwasmExt; +/// Plan specifies information about a planned upgrade and when it should occur. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -12,23 +13,43 @@ use provwasm_proc_macro::CosmwasmExt; )] #[proto_message(type_url = "/cosmos.upgrade.v1beta1.Plan")] pub struct Plan { + /// Sets the name for the upgrade. This name will be used by the upgraded + /// version of the software to apply any special "on-upgrade" commands during + /// the first BeginBlock method after the upgrade is applied. It is also used + /// to detect whether a software version can handle a given upgrade. If no + /// upgrade handler with this name has been set in the software, it will be + /// assumed that the software is out-of-date when the upgrade Time or Height is + /// reached and the software will exit. #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, + /// Deprecated: Time based upgrades have been deprecated. Time based upgrade logic + /// has been removed from the SDK. + /// If this field is not empty, an error will be thrown. #[deprecated] #[prost(message, optional, tag = "2")] pub time: ::core::option::Option, + /// The height at which the upgrade must be performed. #[prost(int64, tag = "3")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub height: i64, + /// Any application specific upgrade info to be included on-chain + /// such as a git commit that validators could automatically upgrade to #[prost(string, tag = "4")] pub info: ::prost::alloc::string::String, + /// Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been + /// moved to the IBC module in the sub module 02-client. + /// If this field is not empty, an error will be thrown. #[deprecated] #[prost(message, optional, tag = "5")] pub upgraded_client_state: ::core::option::Option, } +/// SoftwareUpgradeProposal is a gov Content type for initiating a software +/// upgrade. +/// Deprecated: This legacy proposal is deprecated in favor of Msg-based gov +/// proposals, see MsgSoftwareUpgrade. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -43,13 +64,20 @@ pub struct Plan { #[proto_message(type_url = "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal")] #[deprecated] pub struct SoftwareUpgradeProposal { + /// title of the proposal #[prost(string, tag = "1")] pub title: ::prost::alloc::string::String, + /// description of the proposal #[prost(string, tag = "2")] pub description: ::prost::alloc::string::String, + /// plan of the proposal #[prost(message, optional, tag = "3")] pub plan: ::core::option::Option, } +/// CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software +/// upgrade. +/// Deprecated: This legacy proposal is deprecated in favor of Msg-based gov +/// proposals, see MsgCancelUpgrade. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -64,11 +92,16 @@ pub struct SoftwareUpgradeProposal { #[proto_message(type_url = "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal")] #[deprecated] pub struct CancelSoftwareUpgradeProposal { + /// title of the proposal #[prost(string, tag = "1")] pub title: ::prost::alloc::string::String, + /// description of the proposal #[prost(string, tag = "2")] pub description: ::prost::alloc::string::String, } +/// ModuleVersion specifies a module and its consensus version. +/// +/// Since: cosmos-sdk 0.43 #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -82,8 +115,10 @@ pub struct CancelSoftwareUpgradeProposal { )] #[proto_message(type_url = "/cosmos.upgrade.v1beta1.ModuleVersion")] pub struct ModuleVersion { + /// name of the app module #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, + /// consensus version of the app module #[prost(uint64, tag = "2")] #[serde( serialize_with = "crate::serde::as_str::serialize", @@ -91,6 +126,305 @@ pub struct ModuleVersion { )] pub version: u64, } +/// QueryCurrentPlanRequest is the request type for the Query/CurrentPlan 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.upgrade.v1beta1.QueryCurrentPlanRequest")] +#[proto_query( + path = "/cosmos.upgrade.v1beta1.Query/CurrentPlan", + response_type = QueryCurrentPlanResponse +)] +pub struct QueryCurrentPlanRequest {} +/// QueryCurrentPlanResponse is the response type for the Query/CurrentPlan 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.upgrade.v1beta1.QueryCurrentPlanResponse")] +pub struct QueryCurrentPlanResponse { + /// plan is the current upgrade plan. + #[prost(message, optional, tag = "1")] + pub plan: ::core::option::Option, +} +/// QueryCurrentPlanRequest is the request type for the Query/AppliedPlan 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.upgrade.v1beta1.QueryAppliedPlanRequest")] +#[proto_query( + path = "/cosmos.upgrade.v1beta1.Query/AppliedPlan", + response_type = QueryAppliedPlanResponse +)] +pub struct QueryAppliedPlanRequest { + /// name is the name of the applied plan to query for. + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, +} +/// QueryAppliedPlanResponse is the response type for the Query/AppliedPlan 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.upgrade.v1beta1.QueryAppliedPlanResponse")] +pub struct QueryAppliedPlanResponse { + /// height is the block height at which the plan was applied. + #[prost(int64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: i64, +} +/// QueryUpgradedConsensusStateRequest is the request type for the Query/UpgradedConsensusState +/// 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.upgrade.v1beta1.QueryUpgradedConsensusStateRequest")] +#[proto_query( + path = "/cosmos.upgrade.v1beta1.Query/UpgradedConsensusState", + response_type = QueryUpgradedConsensusStateResponse +)] +#[deprecated] +pub struct QueryUpgradedConsensusStateRequest { + /// last height of the current chain must be sent in request + /// as this is the height under which next consensus state is stored + #[prost(int64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub last_height: i64, +} +/// QueryUpgradedConsensusStateResponse is the response type for the Query/UpgradedConsensusState +/// 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.upgrade.v1beta1.QueryUpgradedConsensusStateResponse")] +#[deprecated] +pub struct QueryUpgradedConsensusStateResponse { + /// Since: cosmos-sdk 0.43 + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub upgraded_consensus_state: ::prost::alloc::vec::Vec, +} +/// QueryModuleVersionsRequest is the request type for the Query/ModuleVersions +/// RPC method. +/// +/// Since: cosmos-sdk 0.43 +#[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.upgrade.v1beta1.QueryModuleVersionsRequest")] +#[proto_query( + path = "/cosmos.upgrade.v1beta1.Query/ModuleVersions", + response_type = QueryModuleVersionsResponse +)] +pub struct QueryModuleVersionsRequest { + /// module_name is a field to query a specific module + /// consensus version from state. Leaving this empty will + /// fetch the full list of module versions from state + #[prost(string, tag = "1")] + pub module_name: ::prost::alloc::string::String, +} +/// QueryModuleVersionsResponse is the response type for the Query/ModuleVersions +/// RPC method. +/// +/// Since: cosmos-sdk 0.43 +#[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.upgrade.v1beta1.QueryModuleVersionsResponse")] +pub struct QueryModuleVersionsResponse { + /// module_versions is a list of module names with their consensus versions. + #[prost(message, repeated, tag = "1")] + pub module_versions: ::prost::alloc::vec::Vec, +} +/// QueryAuthorityRequest is the request type for Query/Authority +/// +/// 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.upgrade.v1beta1.QueryAuthorityRequest")] +#[proto_query( + path = "/cosmos.upgrade.v1beta1.Query/Authority", + response_type = QueryAuthorityResponse +)] +pub struct QueryAuthorityRequest {} +/// QueryAuthorityResponse is the response type for Query/Authority +/// +/// 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.upgrade.v1beta1.QueryAuthorityResponse")] +pub struct QueryAuthorityResponse { + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, +} +/// MsgSoftwareUpgrade is the Msg/SoftwareUpgrade request type. +/// +/// 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.upgrade.v1beta1.MsgSoftwareUpgrade")] +pub struct MsgSoftwareUpgrade { + /// authority is the address that controls the module (defaults to x/gov unless overwritten). + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// plan is the upgrade plan. + #[prost(message, optional, tag = "2")] + pub plan: ::core::option::Option, +} +/// MsgSoftwareUpgradeResponse is the Msg/SoftwareUpgrade response type. +/// +/// 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.upgrade.v1beta1.MsgSoftwareUpgradeResponse")] +pub struct MsgSoftwareUpgradeResponse {} +/// MsgCancelUpgrade is the Msg/CancelUpgrade request type. +/// +/// 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.upgrade.v1beta1.MsgCancelUpgrade")] +pub struct MsgCancelUpgrade { + /// authority is the address that controls the module (defaults to x/gov unless overwritten). + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, +} +/// MsgCancelUpgradeResponse is the Msg/CancelUpgrade response type. +/// +/// 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.upgrade.v1beta1.MsgCancelUpgradeResponse")] +pub struct MsgCancelUpgradeResponse {} pub struct UpgradeQuerier<'a, Q: cosmwasm_std::CustomQuery> { querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, } @@ -98,4 +432,29 @@ impl<'a, Q: cosmwasm_std::CustomQuery> UpgradeQuerier<'a, Q> { pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self { Self { querier } } + pub fn current_plan(&self) -> Result { + QueryCurrentPlanRequest {}.query(self.querier) + } + pub fn applied_plan( + &self, + name: ::prost::alloc::string::String, + ) -> Result { + QueryAppliedPlanRequest { name }.query(self.querier) + } + #[deprecated] + pub fn upgraded_consensus_state( + &self, + last_height: i64, + ) -> Result { + QueryUpgradedConsensusStateRequest { last_height }.query(self.querier) + } + pub fn module_versions( + &self, + module_name: ::prost::alloc::string::String, + ) -> Result { + QueryModuleVersionsRequest { module_name }.query(self.querier) + } + pub fn authority(&self) -> Result { + QueryAuthorityRequest {}.query(self.querier) + } } diff --git a/packages/provwasm-std/src/types/cosmos/vesting/mod.rs b/packages/provwasm-std/src/types/cosmos/vesting/mod.rs new file mode 100644 index 00000000..537a3360 --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/vesting/mod.rs @@ -0,0 +1,2 @@ +pub mod module; +pub mod v1beta1; diff --git a/packages/provwasm-std/src/types/cosmos/vesting/module/mod.rs b/packages/provwasm-std/src/types/cosmos/vesting/module/mod.rs new file mode 100644 index 00000000..a3a6d96c --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/vesting/module/mod.rs @@ -0,0 +1 @@ +pub mod v1; diff --git a/packages/provwasm-std/src/types/cosmos/vesting/module/v1.rs b/packages/provwasm-std/src/types/cosmos/vesting/module/v1.rs new file mode 100644 index 00000000..5f7f504e --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/vesting/module/v1.rs @@ -0,0 +1,15 @@ +use provwasm_proc_macro::CosmwasmExt; +/// Module is the config object of the vesting 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.vesting.module.v1.Module")] +pub struct Module {} diff --git a/packages/provwasm-std/src/types/cosmos/vesting/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/vesting/v1beta1.rs new file mode 100644 index 00000000..f17aac4e --- /dev/null +++ b/packages/provwasm-std/src/types/cosmos/vesting/v1beta1.rs @@ -0,0 +1,280 @@ +use provwasm_proc_macro::CosmwasmExt; +/// BaseVestingAccount implements the VestingAccount interface. It contains all +/// the necessary fields needed for any vesting account implementation. +#[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.vesting.v1beta1.BaseVestingAccount")] +pub struct BaseVestingAccount { + #[prost(message, optional, tag = "1")] + pub base_account: ::core::option::Option, + #[prost(message, repeated, tag = "2")] + pub original_vesting: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "3")] + pub delegated_free: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "4")] + pub delegated_vesting: ::prost::alloc::vec::Vec, + /// Vesting end time, as unix timestamp (in seconds). + #[prost(int64, tag = "5")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub end_time: i64, +} +/// ContinuousVestingAccount implements the VestingAccount interface. It +/// continuously vests by unlocking coins linearly with respect to time. +#[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.vesting.v1beta1.ContinuousVestingAccount")] +pub struct ContinuousVestingAccount { + #[prost(message, optional, tag = "1")] + pub base_vesting_account: ::core::option::Option, + /// Vesting start time, as unix timestamp (in seconds). + #[prost(int64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub start_time: i64, +} +/// DelayedVestingAccount implements the VestingAccount interface. It vests all +/// coins after a specific time, but non prior. In other words, it keeps them +/// locked until a specified time. +#[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.vesting.v1beta1.DelayedVestingAccount")] +pub struct DelayedVestingAccount { + #[prost(message, optional, tag = "1")] + pub base_vesting_account: ::core::option::Option, +} +/// Period defines a length of time and amount of coins that will vest. +#[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.vesting.v1beta1.Period")] +pub struct Period { + /// Period duration in seconds. + #[prost(int64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub length: i64, + #[prost(message, repeated, tag = "2")] + pub amount: ::prost::alloc::vec::Vec, +} +/// PeriodicVestingAccount implements the VestingAccount interface. It +/// periodically vests by unlocking coins during each specified 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.vesting.v1beta1.PeriodicVestingAccount")] +pub struct PeriodicVestingAccount { + #[prost(message, optional, tag = "1")] + pub base_vesting_account: ::core::option::Option, + #[prost(int64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub start_time: i64, + #[prost(message, repeated, tag = "3")] + pub vesting_periods: ::prost::alloc::vec::Vec, +} +/// PermanentLockedAccount implements the VestingAccount interface. It does +/// not ever release coins, locking them indefinitely. Coins in this account can +/// still be used for delegating and for governance votes even while locked. +/// +/// Since: cosmos-sdk 0.43 +#[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.vesting.v1beta1.PermanentLockedAccount")] +pub struct PermanentLockedAccount { + #[prost(message, optional, tag = "1")] + pub base_vesting_account: ::core::option::Option, +} +/// MsgCreateVestingAccount defines a message that enables creating a vesting +/// account. +#[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.vesting.v1beta1.MsgCreateVestingAccount")] +pub struct MsgCreateVestingAccount { + #[prost(string, tag = "1")] + pub from_address: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub to_address: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "3")] + pub amount: ::prost::alloc::vec::Vec, + /// end of vesting as unix time (in seconds). + #[prost(int64, tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub end_time: i64, + #[prost(bool, tag = "5")] + pub delayed: bool, +} +/// MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount 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.vesting.v1beta1.MsgCreateVestingAccountResponse")] +pub struct MsgCreateVestingAccountResponse {} +/// MsgCreatePermanentLockedAccount defines a message that enables creating a permanent +/// locked account. +/// +/// 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.vesting.v1beta1.MsgCreatePermanentLockedAccount")] +pub struct MsgCreatePermanentLockedAccount { + #[prost(string, tag = "1")] + pub from_address: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub to_address: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "3")] + pub amount: ::prost::alloc::vec::Vec, +} +/// MsgCreatePermanentLockedAccountResponse defines the Msg/CreatePermanentLockedAccount response type. +/// +/// 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.vesting.v1beta1.MsgCreatePermanentLockedAccountResponse")] +pub struct MsgCreatePermanentLockedAccountResponse {} +/// MsgCreateVestingAccount defines a message that enables creating a vesting +/// account. +/// +/// 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.vesting.v1beta1.MsgCreatePeriodicVestingAccount")] +pub struct MsgCreatePeriodicVestingAccount { + #[prost(string, tag = "1")] + pub from_address: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub to_address: ::prost::alloc::string::String, + /// start of vesting as unix time (in seconds). + #[prost(int64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub start_time: i64, + #[prost(message, repeated, tag = "4")] + pub vesting_periods: ::prost::alloc::vec::Vec, +} +/// MsgCreateVestingAccountResponse defines the Msg/CreatePeriodicVestingAccount +/// response type. +/// +/// 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.vesting.v1beta1.MsgCreatePeriodicVestingAccountResponse")] +pub struct MsgCreatePeriodicVestingAccountResponse {} From 97cc1d63da911dc249885381a88640474efdee30 Mon Sep 17 00:00:00 2001 From: kwt <4344285+kwtalley@users.noreply.github.com> Date: Fri, 12 Jul 2024 01:19:09 -0500 Subject: [PATCH 20/43] add generated cosmwasm types --- .../src/types/cosmwasm/wasm/mod.rs | 1 + .../src/types/cosmwasm/wasm/v1.rs | 2142 ++++++++++++----- .../src/types/cosmwasm/wasm/v1beta1.rs | 1602 ++++++++++++ 3 files changed, 3161 insertions(+), 584 deletions(-) create mode 100644 packages/provwasm-std/src/types/cosmwasm/wasm/v1beta1.rs diff --git a/packages/provwasm-std/src/types/cosmwasm/wasm/mod.rs b/packages/provwasm-std/src/types/cosmwasm/wasm/mod.rs index a3a6d96c..517ec853 100644 --- a/packages/provwasm-std/src/types/cosmwasm/wasm/mod.rs +++ b/packages/provwasm-std/src/types/cosmwasm/wasm/mod.rs @@ -1 +1,2 @@ pub mod v1; +pub mod v1beta1; diff --git a/packages/provwasm-std/src/types/cosmwasm/wasm/v1.rs b/packages/provwasm-std/src/types/cosmwasm/wasm/v1.rs index 98971aab..140d7565 100644 --- a/packages/provwasm-std/src/types/cosmwasm/wasm/v1.rs +++ b/packages/provwasm-std/src/types/cosmwasm/wasm/v1.rs @@ -1,159 +1,5 @@ use provwasm_proc_macro::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 = "/cosmwasm.wasm.v1.ContractExecutionAuthorization")] -pub struct ContractExecutionAuthorization { - #[prost(message, repeated, tag = "1")] - pub grants: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmwasm.wasm.v1.ContractMigrationAuthorization")] -pub struct ContractMigrationAuthorization { - #[prost(message, repeated, tag = "1")] - pub grants: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmwasm.wasm.v1.ContractGrant")] -pub struct ContractGrant { - #[prost(string, tag = "1")] - pub contract: ::prost::alloc::string::String, - #[prost(message, optional, tag = "2")] - pub limit: ::core::option::Option, - #[prost(message, optional, tag = "3")] - pub filter: ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MaxCallsLimit")] -pub struct MaxCallsLimit { - #[prost(uint64, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub remaining: u64, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MaxFundsLimit")] -pub struct MaxFundsLimit { - #[prost(message, repeated, tag = "1")] - pub amounts: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmwasm.wasm.v1.CombinedLimit")] -pub struct CombinedLimit { - #[prost(uint64, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub calls_remaining: u64, - #[prost(message, repeated, tag = "2")] - pub amounts: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmwasm.wasm.v1.AllowAllMessagesFilter")] -pub struct AllowAllMessagesFilter {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmwasm.wasm.v1.AcceptedMessageKeysFilter")] -pub struct AcceptedMessageKeysFilter { - #[prost(string, repeated, tag = "1")] - pub keys: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmwasm.wasm.v1.AcceptedMessagesFilter")] -pub struct AcceptedMessagesFilter { - #[prost(bytes = "vec", repeated, tag = "1")] - pub messages: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, -} +/// AccessTypeParam #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -169,11 +15,12 @@ pub struct AcceptedMessagesFilter { pub struct AccessTypeParam { #[prost(enumeration = "AccessType", tag = "1")] #[serde( - serialize_with = "AccessType::serialize", - deserialize_with = "AccessType::deserialize" + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" )] pub value: i32, } +/// AccessConfig access control type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -188,12 +35,15 @@ pub struct AccessTypeParam { #[proto_message(type_url = "/cosmwasm.wasm.v1.AccessConfig")] pub struct AccessConfig { #[prost(enumeration = "AccessType", tag = "1")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] pub permission: i32, - #[prost(string, tag = "2")] - pub address: ::prost::alloc::string::String, #[prost(string, repeated, tag = "3")] pub addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +/// Params defines the set of wasm parameters. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -210,8 +60,13 @@ pub struct Params { #[prost(message, optional, tag = "1")] pub code_upload_access: ::core::option::Option, #[prost(enumeration = "AccessType", tag = "2")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] pub instantiate_default_permission: i32, } +/// CodeInfo is data for the uploaded contract WASM code #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -225,17 +80,21 @@ pub struct Params { )] #[proto_message(type_url = "/cosmwasm.wasm.v1.CodeInfo")] pub struct CodeInfo { + /// CodeHash is the unique identifier created by wasmvm #[prost(bytes = "vec", tag = "1")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" )] pub code_hash: ::prost::alloc::vec::Vec, + /// Creator address who initially stored the code #[prost(string, tag = "2")] pub creator: ::prost::alloc::string::String, + /// InstantiateConfig access control to apply on contract creation, optional #[prost(message, optional, tag = "5")] pub instantiate_config: ::core::option::Option, } +/// ContractInfo stores a WASM contract instance #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -249,27 +108,33 @@ pub struct CodeInfo { )] #[proto_message(type_url = "/cosmwasm.wasm.v1.ContractInfo")] pub struct ContractInfo { + /// CodeID is the reference to the stored Wasm code #[prost(uint64, tag = "1")] - #[serde(alias = "codeID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub code_id: u64, + /// Creator address who initially instantiated the contract #[prost(string, tag = "2")] pub creator: ::prost::alloc::string::String, + /// Admin is an optional address that can execute migrations #[prost(string, tag = "3")] pub admin: ::prost::alloc::string::String, + /// Label is optional metadata to be stored with a contract instance. #[prost(string, tag = "4")] pub label: ::prost::alloc::string::String, + /// Created Tx position when the contract was instantiated. #[prost(message, optional, tag = "5")] pub created: ::core::option::Option, #[prost(string, tag = "6")] - #[serde(alias = "ibc_portID")] pub ibc_port_id: ::prost::alloc::string::String, + /// Extension is an extension point to store custom metadata within the + /// persistence model. #[prost(message, optional, tag = "7")] pub extension: ::core::option::Option, } +/// ContractCodeHistoryEntry metadata to a contract. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -284,14 +149,19 @@ pub struct ContractInfo { #[proto_message(type_url = "/cosmwasm.wasm.v1.ContractCodeHistoryEntry")] pub struct ContractCodeHistoryEntry { #[prost(enumeration = "ContractCodeHistoryOperationType", tag = "1")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] pub operation: i32, + /// CodeID is the reference to the stored WASM code #[prost(uint64, tag = "2")] - #[serde(alias = "codeID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub code_id: u64, + /// Updated Tx position when the operation was executed. #[prost(message, optional, tag = "3")] pub updated: ::core::option::Option, #[prost(bytes = "vec", tag = "4")] @@ -301,6 +171,8 @@ pub struct ContractCodeHistoryEntry { )] pub msg: ::prost::alloc::vec::Vec, } +/// AbsoluteTxPosition is a unique transaction position that allows for global +/// ordering of transactions. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -314,12 +186,15 @@ pub struct ContractCodeHistoryEntry { )] #[proto_message(type_url = "/cosmwasm.wasm.v1.AbsoluteTxPosition")] pub struct AbsoluteTxPosition { + /// BlockHeight is the block the contract was created at #[prost(uint64, tag = "1")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub block_height: u64, + /// TxIndex is a monotonic counter within the block (actual transaction index, + /// or gas consumed) #[prost(uint64, tag = "2")] #[serde( serialize_with = "crate::serde::as_str::serialize", @@ -327,6 +202,7 @@ pub struct AbsoluteTxPosition { )] pub tx_index: u64, } +/// Model is a struct that holds a KV pair #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -340,12 +216,14 @@ pub struct AbsoluteTxPosition { )] #[proto_message(type_url = "/cosmwasm.wasm.v1.Model")] pub struct Model { + /// hex-encode key to read it better (this is often ascii) #[prost(bytes = "vec", tag = "1")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" )] pub key: ::prost::alloc::vec::Vec, + /// base64-encode raw value #[prost(bytes = "vec", tag = "2")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", @@ -353,14 +231,18 @@ pub struct Model { )] pub value: ::prost::alloc::vec::Vec, } +/// AccessType permission types #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] #[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] pub enum AccessType { + /// AccessTypeUnspecified placeholder for empty value Unspecified = 0, + /// AccessTypeNobody forbidden Nobody = 1, - OnlyAddress = 2, + /// AccessTypeEverybody unrestricted Everybody = 3, + /// AccessTypeAnyOfAddresses allow any of the addresses AnyOfAddresses = 4, } impl AccessType { @@ -372,7 +254,6 @@ impl AccessType { match self { AccessType::Unspecified => "ACCESS_TYPE_UNSPECIFIED", AccessType::Nobody => "ACCESS_TYPE_NOBODY", - AccessType::OnlyAddress => "ACCESS_TYPE_ONLY_ADDRESS", AccessType::Everybody => "ACCESS_TYPE_EVERYBODY", AccessType::AnyOfAddresses => "ACCESS_TYPE_ANY_OF_ADDRESSES", } @@ -382,43 +263,24 @@ impl AccessType { match value { "ACCESS_TYPE_UNSPECIFIED" => Some(Self::Unspecified), "ACCESS_TYPE_NOBODY" => Some(Self::Nobody), - "ACCESS_TYPE_ONLY_ADDRESS" => Some(Self::OnlyAddress), "ACCESS_TYPE_EVERYBODY" => Some(Self::Everybody), "ACCESS_TYPE_ANY_OF_ADDRESSES" => Some(Self::AnyOfAddresses), _ => None, } } - - pub fn serialize(v: &i32, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - let enum_value = Self::try_from(*v); - match enum_value { - Ok(v) => serializer.serialize_str(v.as_str_name()), - Err(e) => Err(serde::ser::Error::custom(e)), - } - } - - pub fn deserialize<'de, D>(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - use serde::de::Deserialize; - let s = String::deserialize(deserializer)?; - match Self::from_str_name(&s) { - Some(v) => Ok(v.into()), - None => Err(serde::de::Error::custom("unknown value")), - } - } } +/// ContractCodeHistoryOperationType actions that caused a code change #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] #[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] pub enum ContractCodeHistoryOperationType { + /// ContractCodeHistoryOperationTypeUnspecified placeholder for empty value Unspecified = 0, + /// ContractCodeHistoryOperationTypeInit on chain contract instantiation Init = 1, + /// ContractCodeHistoryOperationTypeMigrate code migration Migrate = 2, + /// ContractCodeHistoryOperationTypeGenesis based on genesis data Genesis = 3, } impl ContractCodeHistoryOperationType { @@ -451,6 +313,8 @@ impl ContractCodeHistoryOperationType { } } } +/// StoreCodeAuthorization defines authorization for wasm code upload. +/// Since: wasmd 0.42 #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -462,19 +326,14 @@ impl ContractCodeHistoryOperationType { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgStoreCode")] -pub struct MsgStoreCode { - #[prost(string, tag = "1")] - pub sender: ::prost::alloc::string::String, - #[prost(bytes = "vec", tag = "2")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub wasm_byte_code: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "5")] - pub instantiate_permission: ::core::option::Option, +#[proto_message(type_url = "/cosmwasm.wasm.v1.StoreCodeAuthorization")] +pub struct StoreCodeAuthorization { + /// Grants for code upload + #[prost(message, repeated, tag = "1")] + pub grants: ::prost::alloc::vec::Vec, } +/// ContractExecutionAuthorization defines authorization for wasm execute. +/// Since: wasmd 0.30 #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -486,22 +345,14 @@ pub struct MsgStoreCode { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgStoreCodeResponse")] -pub struct MsgStoreCodeResponse { - #[prost(uint64, tag = "1")] - #[serde(alias = "codeID")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub code_id: u64, - #[prost(bytes = "vec", tag = "2")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub checksum: ::prost::alloc::vec::Vec, +#[proto_message(type_url = "/cosmwasm.wasm.v1.ContractExecutionAuthorization")] +pub struct ContractExecutionAuthorization { + /// Grants for contract executions + #[prost(message, repeated, tag = "1")] + pub grants: ::prost::alloc::vec::Vec, } +/// ContractMigrationAuthorization defines authorization for wasm contract +/// migration. Since: wasmd 0.30 #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -513,30 +364,13 @@ pub struct MsgStoreCodeResponse { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgInstantiateContract")] -pub struct MsgInstantiateContract { - #[prost(string, tag = "1")] - pub sender: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub admin: ::prost::alloc::string::String, - #[prost(uint64, tag = "3")] - #[serde(alias = "codeID")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub code_id: u64, - #[prost(string, tag = "4")] - pub label: ::prost::alloc::string::String, - #[prost(bytes = "vec", tag = "5")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub msg: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "6")] - pub funds: ::prost::alloc::vec::Vec, +#[proto_message(type_url = "/cosmwasm.wasm.v1.ContractMigrationAuthorization")] +pub struct ContractMigrationAuthorization { + /// Grants for contract migrations + #[prost(message, repeated, tag = "1")] + pub grants: ::prost::alloc::vec::Vec, } +/// CodeGrant a granted permission for a single code #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -548,38 +382,24 @@ pub struct MsgInstantiateContract { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgInstantiateContract2")] -pub struct MsgInstantiateContract2 { - #[prost(string, tag = "1")] - pub sender: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub admin: ::prost::alloc::string::String, - #[prost(uint64, tag = "3")] - #[serde(alias = "codeID")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub code_id: u64, - #[prost(string, tag = "4")] - pub label: ::prost::alloc::string::String, - #[prost(bytes = "vec", tag = "5")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub msg: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "6")] - pub funds: ::prost::alloc::vec::Vec, - #[prost(bytes = "vec", tag = "7")] +#[proto_message(type_url = "/cosmwasm.wasm.v1.CodeGrant")] +pub struct CodeGrant { + /// CodeHash is the unique identifier created by wasmvm + /// Wildcard "*" is used to specify any kind of grant. + #[prost(bytes = "vec", tag = "1")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" )] - pub salt: ::prost::alloc::vec::Vec, - #[prost(bool, tag = "8")] - pub fix_msg: bool, + pub code_hash: ::prost::alloc::vec::Vec, + /// InstantiatePermission is the superset access control to apply + /// on contract creation. + /// Optional + #[prost(message, optional, tag = "2")] + pub instantiate_permission: ::core::option::Option, } +/// ContractGrant a granted permission for a single contract +/// Since: wasmd 0.30 #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -591,39 +411,23 @@ pub struct MsgInstantiateContract2 { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgInstantiateContractResponse")] -pub struct MsgInstantiateContractResponse { - #[prost(string, tag = "1")] - pub address: ::prost::alloc::string::String, - #[prost(bytes = "vec", tag = "2")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub data: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgInstantiateContract2Response")] -pub struct MsgInstantiateContract2Response { +#[proto_message(type_url = "/cosmwasm.wasm.v1.ContractGrant")] +pub struct ContractGrant { + /// Contract is the bech32 address of the smart contract #[prost(string, tag = "1")] - pub address: ::prost::alloc::string::String, - #[prost(bytes = "vec", tag = "2")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub data: ::prost::alloc::vec::Vec, + pub contract: ::prost::alloc::string::String, + /// Limit defines execution limits that are enforced and updated when the grant + /// is applied. When the limit lapsed the grant is removed. + #[prost(message, optional, tag = "2")] + pub limit: ::core::option::Option, + /// Filter define more fine-grained control on the message payload passed + /// to the contract in the operation. When no filter applies on execution, the + /// operation is prohibited. + #[prost(message, optional, tag = "3")] + pub filter: ::core::option::Option, } +/// MaxCallsLimit limited number of calls to the contract. No funds transferable. +/// Since: wasmd 0.30 #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -635,21 +439,18 @@ pub struct MsgInstantiateContract2Response { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgExecuteContract")] -pub struct MsgExecuteContract { - #[prost(string, tag = "1")] - pub sender: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub contract: ::prost::alloc::string::String, - #[prost(bytes = "vec", tag = "3")] +#[proto_message(type_url = "/cosmwasm.wasm.v1.MaxCallsLimit")] +pub struct MaxCallsLimit { + /// Remaining number that is decremented on each execution + #[prost(uint64, tag = "1")] #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" )] - pub msg: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "5")] - pub funds: ::prost::alloc::vec::Vec, + pub remaining: u64, } +/// MaxFundsLimit defines the maximal amounts that can be sent to the contract. +/// Since: wasmd 0.30 #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -661,15 +462,15 @@ pub struct MsgExecuteContract { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgExecuteContractResponse")] -pub struct MsgExecuteContractResponse { - #[prost(bytes = "vec", tag = "1")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub data: ::prost::alloc::vec::Vec, +#[proto_message(type_url = "/cosmwasm.wasm.v1.MaxFundsLimit")] +pub struct MaxFundsLimit { + /// Amounts is the maximal amount of tokens transferable to the contract. + #[prost(message, repeated, tag = "1")] + pub amounts: ::prost::alloc::vec::Vec, } +/// CombinedLimit defines the maximal amounts that can be sent to a contract and +/// the maximal number of calls executable. Both need to remain >0 to be valid. +/// Since: wasmd 0.30 #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -681,26 +482,22 @@ pub struct MsgExecuteContractResponse { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgMigrateContract")] -pub struct MsgMigrateContract { - #[prost(string, tag = "1")] - pub sender: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub contract: ::prost::alloc::string::String, - #[prost(uint64, tag = "3")] - #[serde(alias = "codeID")] +#[proto_message(type_url = "/cosmwasm.wasm.v1.CombinedLimit")] +pub struct CombinedLimit { + /// Remaining number that is decremented on each execution + #[prost(uint64, tag = "1")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] - pub code_id: u64, - #[prost(bytes = "vec", tag = "4")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub msg: ::prost::alloc::vec::Vec, + pub calls_remaining: u64, + /// Amounts is the maximal amount of tokens transferable to the contract. + #[prost(message, repeated, tag = "2")] + pub amounts: ::prost::alloc::vec::Vec, } +/// AllowAllMessagesFilter is a wildcard to allow any type of contract payload +/// message. +/// Since: wasmd 0.30 #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -712,15 +509,11 @@ pub struct MsgMigrateContract { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgMigrateContractResponse")] -pub struct MsgMigrateContractResponse { - #[prost(bytes = "vec", tag = "1")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub data: ::prost::alloc::vec::Vec, -} +#[proto_message(type_url = "/cosmwasm.wasm.v1.AllowAllMessagesFilter")] +pub struct AllowAllMessagesFilter {} +/// AcceptedMessageKeysFilter accept only the specific contract message keys in +/// the json object to be executed. +/// Since: wasmd 0.30 #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -732,15 +525,15 @@ pub struct MsgMigrateContractResponse { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgUpdateAdmin")] -pub struct MsgUpdateAdmin { - #[prost(string, tag = "1")] - pub sender: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub new_admin: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub contract: ::prost::alloc::string::String, +#[proto_message(type_url = "/cosmwasm.wasm.v1.AcceptedMessageKeysFilter")] +pub struct AcceptedMessageKeysFilter { + /// Messages is the list of unique keys + #[prost(string, repeated, tag = "1")] + pub keys: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +/// AcceptedMessagesFilter accept only the specific raw contract messages to be +/// executed. +/// Since: wasmd 0.30 #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -752,39 +545,13 @@ pub struct MsgUpdateAdmin { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgUpdateAdminResponse")] -pub struct MsgUpdateAdminResponse {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgClearAdmin")] -pub struct MsgClearAdmin { - #[prost(string, tag = "1")] - pub sender: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub contract: ::prost::alloc::string::String, +#[proto_message(type_url = "/cosmwasm.wasm.v1.AcceptedMessagesFilter")] +pub struct AcceptedMessagesFilter { + /// Messages is the list of raw contract messages + #[prost(bytes = "vec", repeated, tag = "1")] + pub messages: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgClearAdminResponse")] -pub struct MsgClearAdminResponse {} +/// GenesisState - genesis state of x/wasm #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -806,51 +573,8 @@ pub struct GenesisState { pub contracts: ::prost::alloc::vec::Vec, #[prost(message, repeated, tag = "4")] pub sequences: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "5")] - pub gen_msgs: ::prost::alloc::vec::Vec, -} -/// Nested message and enum types in `GenesisState`. -pub mod genesis_state { - use provwasm_proc_macro::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 = "/cosmwasm.wasm.v1.GenesisState.GenMsgs")] - pub struct GenMsgs { - #[prost(oneof = "gen_msgs::Sum", tags = "1, 2, 3")] - pub sum: ::core::option::Option, - } - /// Nested message and enum types in `GenMsgs`. - pub mod gen_msgs { - use provwasm_proc_macro::CosmwasmExt; - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive( - Clone, - PartialEq, - Eq, - ::prost::Oneof, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - )] - pub enum Sum { - #[prost(message, tag = "1")] - StoreCode(super::super::MsgStoreCode), - #[prost(message, tag = "2")] - InstantiateContract(super::super::MsgInstantiateContract), - #[prost(message, tag = "3")] - ExecuteContract(super::super::MsgExecuteContract), - } - } } +/// Code struct encompasses CodeInfo and CodeBytes #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -865,7 +589,6 @@ pub mod genesis_state { #[proto_message(type_url = "/cosmwasm.wasm.v1.Code")] pub struct Code { #[prost(uint64, tag = "1")] - #[serde(alias = "codeID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" @@ -879,9 +602,11 @@ pub struct Code { deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" )] pub code_bytes: ::prost::alloc::vec::Vec, + /// Pinned to wasmvm cache #[prost(bool, tag = "4")] pub pinned: bool, } +/// Contract struct encompasses ContractAddress, ContractInfo, and ContractState #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -904,6 +629,7 @@ pub struct Contract { #[prost(message, repeated, tag = "4")] pub contract_code_history: ::prost::alloc::vec::Vec, } +/// Sequence key and value of an id generation counter #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -930,6 +656,7 @@ pub struct Sequence { )] pub value: u64, } +/// MsgIBCSend #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -943,20 +670,27 @@ pub struct Sequence { )] #[proto_message(type_url = "/cosmwasm.wasm.v1.MsgIBCSend")] pub struct MsgIbcSend { + /// the channel by which the packet will be sent #[prost(string, tag = "2")] pub channel: ::prost::alloc::string::String, + /// Timeout height relative to the current block height. + /// The timeout is disabled when set to 0. #[prost(uint64, tag = "4")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub timeout_height: u64, + /// Timeout timestamp (in nanoseconds) relative to the current block timestamp. + /// The timeout is disabled when set to 0. #[prost(uint64, tag = "5")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub timeout_timestamp: u64, + /// Data is the payload to transfer. We must not make assumption what format or + /// content is in here. #[prost(bytes = "vec", tag = "6")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", @@ -964,6 +698,29 @@ pub struct MsgIbcSend { )] pub data: ::prost::alloc::vec::Vec, } +/// MsgIBCSendResponse +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgIBCSendResponse")] +pub struct MsgIbcSendResponse { + /// Sequence number of the IBC packet sent + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub sequence: u64, +} +/// MsgIBCCloseChannel port and channel need to be owned by the contract #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -980,6 +737,10 @@ pub struct MsgIbcCloseChannel { #[prost(string, tag = "2")] pub channel: ::prost::alloc::string::String, } +/// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +/// an explicit StoreCodeProposal. To submit WASM code to the system, +/// a simple MsgStoreCode can be invoked from the x/gov module via +/// a v1 governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -992,27 +753,39 @@ pub struct MsgIbcCloseChannel { CosmwasmExt, )] #[proto_message(type_url = "/cosmwasm.wasm.v1.StoreCodeProposal")] +#[deprecated] pub struct StoreCodeProposal { + /// Title is a short summary #[prost(string, tag = "1")] pub title: ::prost::alloc::string::String, + /// Description is a human readable text #[prost(string, tag = "2")] pub description: ::prost::alloc::string::String, + /// RunAs is the address that is passed to the contract's environment as sender #[prost(string, tag = "3")] pub run_as: ::prost::alloc::string::String, + /// WASMByteCode can be raw or gzip compressed #[prost(bytes = "vec", tag = "4")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" )] pub wasm_byte_code: ::prost::alloc::vec::Vec, + /// InstantiatePermission to apply on contract creation, optional #[prost(message, optional, tag = "7")] pub instantiate_permission: ::core::option::Option, + /// UnpinCode code on upload, optional #[prost(bool, tag = "8")] pub unpin_code: bool, + /// Source is the URL where the code is hosted #[prost(string, tag = "9")] pub source: ::prost::alloc::string::String, + /// Builder is the docker image used to build the code deterministically, used + /// for smart contract verification #[prost(string, tag = "10")] pub builder: ::prost::alloc::string::String, + /// CodeHash is the SHA256 sum of the code outputted by builder, used for smart + /// contract verification #[prost(bytes = "vec", tag = "11")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", @@ -1020,6 +793,10 @@ pub struct StoreCodeProposal { )] pub code_hash: ::prost::alloc::vec::Vec, } +/// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +/// an explicit InstantiateContractProposal. To instantiate a contract, +/// a simple MsgInstantiateContract can be invoked from the x/gov module via +/// a v1 governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1032,33 +809,107 @@ pub struct StoreCodeProposal { CosmwasmExt, )] #[proto_message(type_url = "/cosmwasm.wasm.v1.InstantiateContractProposal")] +#[deprecated] pub struct InstantiateContractProposal { + /// Title is a short summary + #[prost(string, tag = "1")] + pub title: ::prost::alloc::string::String, + /// Description is a human readable text + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + /// RunAs is the address that is passed to the contract's environment as sender + #[prost(string, tag = "3")] + pub run_as: ::prost::alloc::string::String, + /// Admin is an optional address that can execute migrations + #[prost(string, tag = "4")] + pub admin: ::prost::alloc::string::String, + /// CodeID is the reference to the stored WASM code + #[prost(uint64, tag = "5")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub code_id: u64, + /// Label is optional metadata to be stored with a constract instance. + #[prost(string, tag = "6")] + pub label: ::prost::alloc::string::String, + /// Msg json encoded message to be passed to the contract on instantiation + #[prost(bytes = "vec", tag = "7")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub msg: ::prost::alloc::vec::Vec, + /// Funds coins that are transferred to the contract on instantiation + #[prost(message, repeated, tag = "8")] + pub funds: ::prost::alloc::vec::Vec, +} +/// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +/// an explicit InstantiateContract2Proposal. To instantiate contract 2, +/// a simple MsgInstantiateContract2 can be invoked from the x/gov module via +/// a v1 governance proposal. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1.InstantiateContract2Proposal")] +#[deprecated] +pub struct InstantiateContract2Proposal { + /// Title is a short summary #[prost(string, tag = "1")] pub title: ::prost::alloc::string::String, + /// Description is a human readable text #[prost(string, tag = "2")] pub description: ::prost::alloc::string::String, + /// RunAs is the address that is passed to the contract's enviroment as sender #[prost(string, tag = "3")] pub run_as: ::prost::alloc::string::String, + /// Admin is an optional address that can execute migrations #[prost(string, tag = "4")] pub admin: ::prost::alloc::string::String, + /// CodeID is the reference to the stored WASM code #[prost(uint64, tag = "5")] - #[serde(alias = "codeID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub code_id: u64, + /// Label is optional metadata to be stored with a constract instance. #[prost(string, tag = "6")] pub label: ::prost::alloc::string::String, + /// Msg json encode message to be passed to the contract on instantiation #[prost(bytes = "vec", tag = "7")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" )] pub msg: ::prost::alloc::vec::Vec, + /// Funds coins that are transferred to the contract on instantiation #[prost(message, repeated, tag = "8")] pub funds: ::prost::alloc::vec::Vec, + /// Salt is an arbitrary value provided by the sender. Size can be 1 to 64. + #[prost(bytes = "vec", tag = "9")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub salt: ::prost::alloc::vec::Vec, + /// FixMsg include the msg value into the hash for the predictable address. + /// Default is false + #[prost(bool, tag = "10")] + pub fix_msg: bool, } +/// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +/// an explicit MigrateContractProposal. To migrate a contract, +/// a simple MsgMigrateContract can be invoked from the x/gov module via +/// a v1 governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1071,20 +922,27 @@ pub struct InstantiateContractProposal { CosmwasmExt, )] #[proto_message(type_url = "/cosmwasm.wasm.v1.MigrateContractProposal")] +#[deprecated] pub struct MigrateContractProposal { + /// Title is a short summary #[prost(string, tag = "1")] pub title: ::prost::alloc::string::String, + /// Description is a human readable text + /// + /// Note: skipping 3 as this was previously used for unneeded run_as #[prost(string, tag = "2")] pub description: ::prost::alloc::string::String, + /// Contract is the address of the smart contract #[prost(string, tag = "4")] pub contract: ::prost::alloc::string::String, + /// CodeID references the new WASM code #[prost(uint64, tag = "5")] - #[serde(alias = "codeID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub code_id: u64, + /// Msg json encoded message to be passed to the contract on migration #[prost(bytes = "vec", tag = "6")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", @@ -1092,6 +950,10 @@ pub struct MigrateContractProposal { )] pub msg: ::prost::alloc::vec::Vec, } +/// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +/// an explicit SudoContractProposal. To call sudo on a contract, +/// a simple MsgSudoContract can be invoked from the x/gov module via +/// a v1 governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1104,13 +966,18 @@ pub struct MigrateContractProposal { CosmwasmExt, )] #[proto_message(type_url = "/cosmwasm.wasm.v1.SudoContractProposal")] +#[deprecated] pub struct SudoContractProposal { + /// Title is a short summary #[prost(string, tag = "1")] pub title: ::prost::alloc::string::String, + /// Description is a human readable text #[prost(string, tag = "2")] pub description: ::prost::alloc::string::String, + /// Contract is the address of the smart contract #[prost(string, tag = "3")] pub contract: ::prost::alloc::string::String, + /// Msg json encoded message to be passed to the contract as sudo #[prost(bytes = "vec", tag = "4")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", @@ -1118,6 +985,10 @@ pub struct SudoContractProposal { )] pub msg: ::prost::alloc::vec::Vec, } +/// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +/// an explicit ExecuteContractProposal. To call execute on a contract, +/// a simple MsgExecuteContract can be invoked from the x/gov module via +/// a v1 governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1130,24 +1001,35 @@ pub struct SudoContractProposal { CosmwasmExt, )] #[proto_message(type_url = "/cosmwasm.wasm.v1.ExecuteContractProposal")] +#[deprecated] pub struct ExecuteContractProposal { + /// Title is a short summary #[prost(string, tag = "1")] pub title: ::prost::alloc::string::String, + /// Description is a human readable text #[prost(string, tag = "2")] pub description: ::prost::alloc::string::String, + /// RunAs is the address that is passed to the contract's environment as sender #[prost(string, tag = "3")] pub run_as: ::prost::alloc::string::String, + /// Contract is the address of the smart contract #[prost(string, tag = "4")] pub contract: ::prost::alloc::string::String, + /// Msg json encoded message to be passed to the contract as execute #[prost(bytes = "vec", tag = "5")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" )] pub msg: ::prost::alloc::vec::Vec, + /// Funds coins that are transferred to the contract on instantiation #[prost(message, repeated, tag = "6")] pub funds: ::prost::alloc::vec::Vec, } +/// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +/// an explicit UpdateAdminProposal. To set an admin for a contract, +/// a simple MsgUpdateAdmin can be invoked from the x/gov module via +/// a v1 governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1160,16 +1042,25 @@ pub struct ExecuteContractProposal { CosmwasmExt, )] #[proto_message(type_url = "/cosmwasm.wasm.v1.UpdateAdminProposal")] +#[deprecated] pub struct UpdateAdminProposal { + /// Title is a short summary #[prost(string, tag = "1")] pub title: ::prost::alloc::string::String, + /// Description is a human readable text #[prost(string, tag = "2")] pub description: ::prost::alloc::string::String, + /// NewAdmin address to be set #[prost(string, tag = "3")] pub new_admin: ::prost::alloc::string::String, + /// Contract is the address of the smart contract #[prost(string, tag = "4")] pub contract: ::prost::alloc::string::String, } +/// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +/// an explicit ClearAdminProposal. To clear the admin of a contract, +/// a simple MsgClearAdmin can be invoked from the x/gov module via +/// a v1 governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1182,14 +1073,22 @@ pub struct UpdateAdminProposal { CosmwasmExt, )] #[proto_message(type_url = "/cosmwasm.wasm.v1.ClearAdminProposal")] +#[deprecated] pub struct ClearAdminProposal { + /// Title is a short summary #[prost(string, tag = "1")] pub title: ::prost::alloc::string::String, + /// Description is a human readable text #[prost(string, tag = "2")] pub description: ::prost::alloc::string::String, + /// Contract is the address of the smart contract #[prost(string, tag = "3")] pub contract: ::prost::alloc::string::String, } +/// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +/// an explicit PinCodesProposal. To pin a set of code ids in the wasmvm +/// cache, a simple MsgPinCodes can be invoked from the x/gov module via +/// a v1 governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1202,19 +1101,26 @@ pub struct ClearAdminProposal { CosmwasmExt, )] #[proto_message(type_url = "/cosmwasm.wasm.v1.PinCodesProposal")] +#[deprecated] pub struct PinCodesProposal { + /// Title is a short summary #[prost(string, tag = "1")] pub title: ::prost::alloc::string::String, + /// Description is a human readable text #[prost(string, tag = "2")] pub description: ::prost::alloc::string::String, + /// CodeIDs references the new WASM codes #[prost(uint64, repeated, packed = "false", tag = "3")] - #[serde(alias = "codeIDs")] #[serde( serialize_with = "crate::serde::as_str_vec::serialize", deserialize_with = "crate::serde::as_str_vec::deserialize" )] pub code_ids: ::prost::alloc::vec::Vec, } +/// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +/// an explicit UnpinCodesProposal. To unpin a set of code ids in the wasmvm +/// cache, a simple MsgUnpinCodes can be invoked from the x/gov module via +/// a v1 governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1227,19 +1133,24 @@ pub struct PinCodesProposal { CosmwasmExt, )] #[proto_message(type_url = "/cosmwasm.wasm.v1.UnpinCodesProposal")] +#[deprecated] pub struct UnpinCodesProposal { + /// Title is a short summary #[prost(string, tag = "1")] pub title: ::prost::alloc::string::String, + /// Description is a human readable text #[prost(string, tag = "2")] pub description: ::prost::alloc::string::String, + /// CodeIDs references the WASM codes #[prost(uint64, repeated, packed = "false", tag = "3")] - #[serde(alias = "codeIDs")] #[serde( serialize_with = "crate::serde::as_str_vec::serialize", deserialize_with = "crate::serde::as_str_vec::deserialize" )] pub code_ids: ::prost::alloc::vec::Vec, } +/// AccessConfigUpdate contains the code id and the access config to be +/// applied. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1253,16 +1164,21 @@ pub struct UnpinCodesProposal { )] #[proto_message(type_url = "/cosmwasm.wasm.v1.AccessConfigUpdate")] pub struct AccessConfigUpdate { + /// CodeID is the reference to the stored WASM code to be updated #[prost(uint64, tag = "1")] - #[serde(alias = "codeID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub code_id: u64, + /// InstantiatePermission to apply to the set of code ids #[prost(message, optional, tag = "2")] pub instantiate_permission: ::core::option::Option, } +/// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +/// an explicit UpdateInstantiateConfigProposal. To update instantiate config +/// to a set of code ids, a simple MsgUpdateInstantiateConfig can be invoked from +/// the x/gov module via a v1 governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1275,14 +1191,23 @@ pub struct AccessConfigUpdate { CosmwasmExt, )] #[proto_message(type_url = "/cosmwasm.wasm.v1.UpdateInstantiateConfigProposal")] +#[deprecated] pub struct UpdateInstantiateConfigProposal { + /// Title is a short summary #[prost(string, tag = "1")] pub title: ::prost::alloc::string::String, + /// Description is a human readable text #[prost(string, tag = "2")] pub description: ::prost::alloc::string::String, + /// AccessConfigUpdate contains the list of code ids and the access config + /// to be applied. #[prost(message, repeated, tag = "3")] pub access_config_updates: ::prost::alloc::vec::Vec, } +/// Deprecated: Do not use. Since wasmd v0.40, there is no longer a need for +/// an explicit StoreAndInstantiateContractProposal. To store and instantiate +/// the contract, a simple MsgStoreAndInstantiateContract can be invoked from +/// the x/gov module via a v1 governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1295,39 +1220,55 @@ pub struct UpdateInstantiateConfigProposal { CosmwasmExt, )] #[proto_message(type_url = "/cosmwasm.wasm.v1.StoreAndInstantiateContractProposal")] +#[deprecated] pub struct StoreAndInstantiateContractProposal { + /// Title is a short summary #[prost(string, tag = "1")] pub title: ::prost::alloc::string::String, + /// Description is a human readable text #[prost(string, tag = "2")] pub description: ::prost::alloc::string::String, + /// RunAs is the address that is passed to the contract's environment as sender #[prost(string, tag = "3")] pub run_as: ::prost::alloc::string::String, + /// WASMByteCode can be raw or gzip compressed #[prost(bytes = "vec", tag = "4")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" )] pub wasm_byte_code: ::prost::alloc::vec::Vec, + /// InstantiatePermission to apply on contract creation, optional #[prost(message, optional, tag = "5")] pub instantiate_permission: ::core::option::Option, + /// UnpinCode code on upload, optional #[prost(bool, tag = "6")] pub unpin_code: bool, + /// Admin is an optional address that can execute migrations #[prost(string, tag = "7")] pub admin: ::prost::alloc::string::String, + /// Label is optional metadata to be stored with a constract instance. #[prost(string, tag = "8")] pub label: ::prost::alloc::string::String, + /// Msg json encoded message to be passed to the contract on instantiation #[prost(bytes = "vec", tag = "9")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" )] pub msg: ::prost::alloc::vec::Vec, + /// Funds coins that are transferred to the contract on instantiation #[prost(message, repeated, tag = "10")] pub funds: ::prost::alloc::vec::Vec, + /// Source is the URL where the code is hosted #[prost(string, tag = "11")] pub source: ::prost::alloc::string::String, + /// Builder is the docker image used to build the code deterministically, used + /// for smart contract verification #[prost(string, tag = "12")] pub builder: ::prost::alloc::string::String, + /// CodeHash is the SHA256 sum of the code outputted by builder, used for smart + /// contract verification #[prost(bytes = "vec", tag = "13")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", @@ -1335,6 +1276,8 @@ pub struct StoreAndInstantiateContractProposal { )] pub code_hash: ::prost::alloc::vec::Vec, } +/// QueryContractInfoRequest is the request type for the Query/ContractInfo RPC +/// method #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1352,9 +1295,12 @@ pub struct StoreAndInstantiateContractProposal { response_type = QueryContractInfoResponse )] pub struct QueryContractInfoRequest { + /// address is the address of the contract to query #[prost(string, tag = "1")] pub address: ::prost::alloc::string::String, } +/// QueryContractInfoResponse is the response type for the Query/ContractInfo RPC +/// method #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1368,11 +1314,14 @@ pub struct QueryContractInfoRequest { )] #[proto_message(type_url = "/cosmwasm.wasm.v1.QueryContractInfoResponse")] pub struct QueryContractInfoResponse { + /// address is the address of the contract #[prost(string, tag = "1")] pub address: ::prost::alloc::string::String, #[prost(message, optional, tag = "2")] pub contract_info: ::core::option::Option, } +/// QueryContractHistoryRequest is the request type for the Query/ContractHistory +/// RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1390,12 +1339,16 @@ pub struct QueryContractInfoResponse { response_type = QueryContractHistoryResponse )] pub struct QueryContractHistoryRequest { + /// address is the address of the contract to query #[prost(string, tag = "1")] pub address: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } +/// QueryContractHistoryResponse is the response type for the +/// Query/ContractHistory RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1411,10 +1364,13 @@ pub struct QueryContractHistoryRequest { pub struct QueryContractHistoryResponse { #[prost(message, repeated, tag = "1")] pub entries: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } +/// QueryContractsByCodeRequest is the request type for the Query/ContractsByCode +/// RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1431,18 +1387,926 @@ pub struct QueryContractHistoryResponse { path = "/cosmwasm.wasm.v1.Query/ContractsByCode", response_type = QueryContractsByCodeResponse )] -pub struct QueryContractsByCodeRequest { - #[prost(uint64, tag = "1")] - #[serde(alias = "codeID")] +pub struct QueryContractsByCodeRequest { + /// grpc-gateway_out does not support Go style CodID + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub code_id: u64, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: + ::core::option::Option, +} +/// QueryContractsByCodeResponse is the response type for the +/// Query/ContractsByCode 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 = "/cosmwasm.wasm.v1.QueryContractsByCodeResponse")] +pub struct QueryContractsByCodeResponse { + /// contracts are a set of contract addresses + #[prost(string, repeated, tag = "1")] + pub contracts: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: + ::core::option::Option, +} +/// QueryAllContractStateRequest is the request type for the +/// Query/AllContractState 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 = "/cosmwasm.wasm.v1.QueryAllContractStateRequest")] +#[proto_query( + path = "/cosmwasm.wasm.v1.Query/AllContractState", + response_type = QueryAllContractStateResponse +)] +pub struct QueryAllContractStateRequest { + /// address is the address of the contract + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: + ::core::option::Option, +} +/// QueryAllContractStateResponse is the response type for the +/// Query/AllContractState 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 = "/cosmwasm.wasm.v1.QueryAllContractStateResponse")] +pub struct QueryAllContractStateResponse { + #[prost(message, repeated, tag = "1")] + pub models: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: + ::core::option::Option, +} +/// QueryRawContractStateRequest is the request type for the +/// Query/RawContractState 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 = "/cosmwasm.wasm.v1.QueryRawContractStateRequest")] +#[proto_query( + path = "/cosmwasm.wasm.v1.Query/RawContractState", + response_type = QueryRawContractStateResponse +)] +pub struct QueryRawContractStateRequest { + /// address is the address of the contract + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub query_data: ::prost::alloc::vec::Vec, +} +/// QueryRawContractStateResponse is the response type for the +/// Query/RawContractState 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 = "/cosmwasm.wasm.v1.QueryRawContractStateResponse")] +pub struct QueryRawContractStateResponse { + /// Data contains the raw store data + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, +} +/// QuerySmartContractStateRequest is the request type for the +/// Query/SmartContractState 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 = "/cosmwasm.wasm.v1.QuerySmartContractStateRequest")] +#[proto_query( + path = "/cosmwasm.wasm.v1.Query/SmartContractState", + response_type = QuerySmartContractStateResponse +)] +pub struct QuerySmartContractStateRequest { + /// address is the address of the contract + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// QueryData contains the query data passed to the contract + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub query_data: ::prost::alloc::vec::Vec, +} +/// QuerySmartContractStateResponse is the response type for the +/// Query/SmartContractState 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 = "/cosmwasm.wasm.v1.QuerySmartContractStateResponse")] +pub struct QuerySmartContractStateResponse { + /// Data contains the json data returned from the smart contract + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, +} +/// QueryCodeRequest is the request type for the Query/Code 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 = "/cosmwasm.wasm.v1.QueryCodeRequest")] +#[proto_query(path = "/cosmwasm.wasm.v1.Query/Code", response_type = QueryCodeResponse)] +pub struct QueryCodeRequest { + /// grpc-gateway_out does not support Go style CodID + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub code_id: u64, +} +/// CodeInfoResponse contains code meta data from CodeInfo +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1.CodeInfoResponse")] +pub struct CodeInfoResponse { + /// id for legacy support + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub code_id: u64, + #[prost(string, tag = "2")] + pub creator: ::prost::alloc::string::String, + #[prost(bytes = "vec", tag = "3")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub data_hash: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "6")] + pub instantiate_permission: ::core::option::Option, +} +/// QueryCodeResponse is the response type for the Query/Code 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 = "/cosmwasm.wasm.v1.QueryCodeResponse")] +pub struct QueryCodeResponse { + #[prost(message, optional, tag = "1")] + pub code_info: ::core::option::Option, + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, +} +/// QueryCodesRequest is the request type for the Query/Codes 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 = "/cosmwasm.wasm.v1.QueryCodesRequest")] +#[proto_query( + path = "/cosmwasm.wasm.v1.Query/Codes", + response_type = QueryCodesResponse +)] +pub struct QueryCodesRequest { + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "1")] + pub pagination: + ::core::option::Option, +} +/// QueryCodesResponse is the response type for the Query/Codes 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 = "/cosmwasm.wasm.v1.QueryCodesResponse")] +pub struct QueryCodesResponse { + #[prost(message, repeated, tag = "1")] + pub code_infos: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: + ::core::option::Option, +} +/// QueryPinnedCodesRequest is the request type for the Query/PinnedCodes +/// 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 = "/cosmwasm.wasm.v1.QueryPinnedCodesRequest")] +#[proto_query( + path = "/cosmwasm.wasm.v1.Query/PinnedCodes", + response_type = QueryPinnedCodesResponse +)] +pub struct QueryPinnedCodesRequest { + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: + ::core::option::Option, +} +/// QueryPinnedCodesResponse is the response type for the +/// Query/PinnedCodes 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 = "/cosmwasm.wasm.v1.QueryPinnedCodesResponse")] +pub struct QueryPinnedCodesResponse { + #[prost(uint64, repeated, packed = "false", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub code_ids: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: + ::core::option::Option, +} +/// QueryParamsRequest is the request type for the Query/Params 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 = "/cosmwasm.wasm.v1.QueryParamsRequest")] +#[proto_query( + path = "/cosmwasm.wasm.v1.Query/Params", + response_type = QueryParamsResponse +)] +pub struct QueryParamsRequest {} +/// QueryParamsResponse is the response type for the Query/Params 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 = "/cosmwasm.wasm.v1.QueryParamsResponse")] +pub struct QueryParamsResponse { + /// params defines the parameters of the module. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} +/// QueryContractsByCreatorRequest is the request type for the +/// Query/ContractsByCreator 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 = "/cosmwasm.wasm.v1.QueryContractsByCreatorRequest")] +#[proto_query( + path = "/cosmwasm.wasm.v1.Query/ContractsByCreator", + response_type = QueryContractsByCreatorResponse +)] +pub struct QueryContractsByCreatorRequest { + /// CreatorAddress is the address of contract creator + #[prost(string, tag = "1")] + pub creator_address: ::prost::alloc::string::String, + /// Pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: + ::core::option::Option, +} +/// QueryContractsByCreatorResponse is the response type for the +/// Query/ContractsByCreator 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 = "/cosmwasm.wasm.v1.QueryContractsByCreatorResponse")] +pub struct QueryContractsByCreatorResponse { + /// ContractAddresses result set + #[prost(string, repeated, tag = "1")] + pub contract_addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// Pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: + ::core::option::Option, +} +/// QueryBuildAddressRequest is the request type for the Query/BuildAddress 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 = "/cosmwasm.wasm.v1.QueryBuildAddressRequest")] +#[proto_query( + path = "/cosmwasm.wasm.v1.Query/BuildAddress", + response_type = QueryBuildAddressResponse +)] +pub struct QueryBuildAddressRequest { + /// CodeHash is the hash of the code + #[prost(string, tag = "1")] + pub code_hash: ::prost::alloc::string::String, + /// CreatorAddress is the address of the contract instantiator + #[prost(string, tag = "2")] + pub creator_address: ::prost::alloc::string::String, + /// Salt is a hex encoded salt + #[prost(string, tag = "3")] + pub salt: ::prost::alloc::string::String, + /// InitArgs are optional json encoded init args to be used in contract address + /// building if provided + #[prost(bytes = "vec", tag = "4")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub init_args: ::prost::alloc::vec::Vec, +} +/// QueryBuildAddressResponse is the response type for the Query/BuildAddress 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 = "/cosmwasm.wasm.v1.QueryBuildAddressResponse")] +pub struct QueryBuildAddressResponse { + /// Address is the contract address + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, +} +/// MsgStoreCode submit Wasm code to the system +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgStoreCode")] +pub struct MsgStoreCode { + /// Sender is the actor that signed the messages + #[prost(string, tag = "1")] + pub sender: ::prost::alloc::string::String, + /// WASMByteCode can be raw or gzip compressed + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub wasm_byte_code: ::prost::alloc::vec::Vec, + /// InstantiatePermission access control to apply on contract creation, + /// optional + #[prost(message, optional, tag = "5")] + pub instantiate_permission: ::core::option::Option, +} +/// MsgStoreCodeResponse returns store result data. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgStoreCodeResponse")] +pub struct MsgStoreCodeResponse { + /// CodeID is the reference to the stored WASM code + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub code_id: u64, + /// Checksum is the sha256 hash of the stored code + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub checksum: ::prost::alloc::vec::Vec, +} +/// MsgInstantiateContract create a new smart contract instance for the given +/// code id. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgInstantiateContract")] +pub struct MsgInstantiateContract { + /// Sender is the that actor that signed the messages + #[prost(string, tag = "1")] + pub sender: ::prost::alloc::string::String, + /// Admin is an optional address that can execute migrations + #[prost(string, tag = "2")] + pub admin: ::prost::alloc::string::String, + /// CodeID is the reference to the stored WASM code + #[prost(uint64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub code_id: u64, + /// Label is optional metadata to be stored with a contract instance. + #[prost(string, tag = "4")] + pub label: ::prost::alloc::string::String, + /// Msg json encoded message to be passed to the contract on instantiation + #[prost(bytes = "vec", tag = "5")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub msg: ::prost::alloc::vec::Vec, + /// Funds coins that are transferred to the contract on instantiation + #[prost(message, repeated, tag = "6")] + pub funds: ::prost::alloc::vec::Vec, +} +/// MsgInstantiateContractResponse return instantiation result data +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgInstantiateContractResponse")] +pub struct MsgInstantiateContractResponse { + /// Address is the bech32 address of the new contract instance. + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// Data contains bytes to returned from the contract + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, +} +/// MsgInstantiateContract2 create a new smart contract instance for the given +/// code id with a predicable address. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgInstantiateContract2")] +pub struct MsgInstantiateContract2 { + /// Sender is the that actor that signed the messages + #[prost(string, tag = "1")] + pub sender: ::prost::alloc::string::String, + /// Admin is an optional address that can execute migrations + #[prost(string, tag = "2")] + pub admin: ::prost::alloc::string::String, + /// CodeID is the reference to the stored WASM code + #[prost(uint64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub code_id: u64, + /// Label is optional metadata to be stored with a contract instance. + #[prost(string, tag = "4")] + pub label: ::prost::alloc::string::String, + /// Msg json encoded message to be passed to the contract on instantiation + #[prost(bytes = "vec", tag = "5")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub msg: ::prost::alloc::vec::Vec, + /// Funds coins that are transferred to the contract on instantiation + #[prost(message, repeated, tag = "6")] + pub funds: ::prost::alloc::vec::Vec, + /// Salt is an arbitrary value provided by the sender. Size can be 1 to 64. + #[prost(bytes = "vec", tag = "7")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub salt: ::prost::alloc::vec::Vec, + /// FixMsg include the msg value into the hash for the predictable address. + /// Default is false + #[prost(bool, tag = "8")] + pub fix_msg: bool, +} +/// MsgInstantiateContract2Response return instantiation result data +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgInstantiateContract2Response")] +pub struct MsgInstantiateContract2Response { + /// Address is the bech32 address of the new contract instance. + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// Data contains bytes to returned from the contract + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, +} +/// MsgExecuteContract submits the given message data to a smart contract +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgExecuteContract")] +pub struct MsgExecuteContract { + /// Sender is the that actor that signed the messages + #[prost(string, tag = "1")] + pub sender: ::prost::alloc::string::String, + /// Contract is the address of the smart contract + #[prost(string, tag = "2")] + pub contract: ::prost::alloc::string::String, + /// Msg json encoded message to be passed to the contract + #[prost(bytes = "vec", tag = "3")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub msg: ::prost::alloc::vec::Vec, + /// Funds coins that are transferred to the contract on execution + #[prost(message, repeated, tag = "5")] + pub funds: ::prost::alloc::vec::Vec, +} +/// MsgExecuteContractResponse returns execution result data. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgExecuteContractResponse")] +pub struct MsgExecuteContractResponse { + /// Data contains bytes to returned from the contract + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, +} +/// MsgMigrateContract runs a code upgrade/ downgrade for a smart contract +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgMigrateContract")] +pub struct MsgMigrateContract { + /// Sender is the that actor that signed the messages + #[prost(string, tag = "1")] + pub sender: ::prost::alloc::string::String, + /// Contract is the address of the smart contract + #[prost(string, tag = "2")] + pub contract: ::prost::alloc::string::String, + /// CodeID references the new WASM code + #[prost(uint64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub code_id: u64, + /// Msg json encoded message to be passed to the contract on migration + #[prost(bytes = "vec", tag = "4")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub msg: ::prost::alloc::vec::Vec, +} +/// MsgMigrateContractResponse returns contract migration result data. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgMigrateContractResponse")] +pub struct MsgMigrateContractResponse { + /// Data contains same raw bytes returned as data from the wasm contract. + /// (May be empty) + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, +} +/// MsgUpdateAdmin sets a new admin for a smart contract +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgUpdateAdmin")] +pub struct MsgUpdateAdmin { + /// Sender is the that actor that signed the messages + #[prost(string, tag = "1")] + pub sender: ::prost::alloc::string::String, + /// NewAdmin address to be set + #[prost(string, tag = "2")] + pub new_admin: ::prost::alloc::string::String, + /// Contract is the address of the smart contract + #[prost(string, tag = "3")] + pub contract: ::prost::alloc::string::String, +} +/// MsgUpdateAdminResponse returns empty data +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgUpdateAdminResponse")] +pub struct MsgUpdateAdminResponse {} +/// MsgClearAdmin removes any admin stored for a smart contract +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgClearAdmin")] +pub struct MsgClearAdmin { + /// Sender is the actor that signed the messages + #[prost(string, tag = "1")] + pub sender: ::prost::alloc::string::String, + /// Contract is the address of the smart contract + #[prost(string, tag = "3")] + pub contract: ::prost::alloc::string::String, +} +/// MsgClearAdminResponse returns empty data +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgClearAdminResponse")] +pub struct MsgClearAdminResponse {} +/// MsgUpdateInstantiateConfig updates instantiate config for a smart contract +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfig")] +pub struct MsgUpdateInstantiateConfig { + /// Sender is the that actor that signed the messages + #[prost(string, tag = "1")] + pub sender: ::prost::alloc::string::String, + /// CodeID references the stored WASM code + #[prost(uint64, tag = "2")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub code_id: u64, - #[prost(message, optional, tag = "2")] - pub pagination: - ::core::option::Option, + /// NewInstantiatePermission is the new access control + #[prost(message, optional, tag = "3")] + pub new_instantiate_permission: ::core::option::Option, } +/// MsgUpdateInstantiateConfigResponse returns empty data #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1454,14 +2318,11 @@ pub struct QueryContractsByCodeRequest { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryContractsByCodeResponse")] -pub struct QueryContractsByCodeResponse { - #[prost(string, repeated, tag = "1")] - pub contracts: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(message, optional, tag = "2")] - pub pagination: - ::core::option::Option, -} +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgUpdateInstantiateConfigResponse")] +pub struct MsgUpdateInstantiateConfigResponse {} +/// MsgUpdateParams is the MsgUpdateParams request type. +/// +/// Since: 0.40 #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1473,18 +2334,21 @@ pub struct QueryContractsByCodeResponse { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryAllContractStateRequest")] -#[proto_query( - path = "/cosmwasm.wasm.v1.Query/AllContractState", - response_type = QueryAllContractStateResponse -)] -pub struct QueryAllContractStateRequest { +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgUpdateParams")] +pub struct MsgUpdateParams { + /// Authority is the address of the governance account. #[prost(string, tag = "1")] - pub address: ::prost::alloc::string::String, + pub authority: ::prost::alloc::string::String, + /// params defines the x/wasm parameters to update. + /// + /// NOTE: All parameters must be supplied. #[prost(message, optional, tag = "2")] - pub pagination: - ::core::option::Option, + pub params: ::core::option::Option, } +/// MsgUpdateParamsResponse defines the response structure for executing a +/// MsgUpdateParams message. +/// +/// Since: 0.40 #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1496,14 +2360,11 @@ pub struct QueryAllContractStateRequest { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryAllContractStateResponse")] -pub struct QueryAllContractStateResponse { - #[prost(message, repeated, tag = "1")] - pub models: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "2")] - pub pagination: - ::core::option::Option, -} +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgUpdateParamsResponse")] +pub struct MsgUpdateParamsResponse {} +/// MsgSudoContract is the MsgSudoContract request type. +/// +/// Since: 0.40 #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1515,21 +2376,26 @@ pub struct QueryAllContractStateResponse { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryRawContractStateRequest")] -#[proto_query( - path = "/cosmwasm.wasm.v1.Query/RawContractState", - response_type = QueryRawContractStateResponse -)] -pub struct QueryRawContractStateRequest { +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgSudoContract")] +pub struct MsgSudoContract { + /// Authority is the address of the governance account. #[prost(string, tag = "1")] - pub address: ::prost::alloc::string::String, - #[prost(bytes = "vec", tag = "2")] + pub authority: ::prost::alloc::string::String, + /// Contract is the address of the smart contract + #[prost(string, tag = "2")] + pub contract: ::prost::alloc::string::String, + /// Msg json encoded message to be passed to the contract as sudo + #[prost(bytes = "vec", tag = "3")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" )] - pub query_data: ::prost::alloc::vec::Vec, + pub msg: ::prost::alloc::vec::Vec, } +/// MsgSudoContractResponse defines the response structure for executing a +/// MsgSudoContract message. +/// +/// Since: 0.40 #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1541,8 +2407,9 @@ pub struct QueryRawContractStateRequest { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryRawContractStateResponse")] -pub struct QueryRawContractStateResponse { +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgSudoContractResponse")] +pub struct MsgSudoContractResponse { + /// Data contains bytes to returned from the contract #[prost(bytes = "vec", tag = "1")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", @@ -1550,6 +2417,9 @@ pub struct QueryRawContractStateResponse { )] pub data: ::prost::alloc::vec::Vec, } +/// MsgPinCodes is the MsgPinCodes request type. +/// +/// Since: 0.40 #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1561,21 +2431,23 @@ pub struct QueryRawContractStateResponse { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.QuerySmartContractStateRequest")] -#[proto_query( - path = "/cosmwasm.wasm.v1.Query/SmartContractState", - response_type = QuerySmartContractStateResponse -)] -pub struct QuerySmartContractStateRequest { +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgPinCodes")] +pub struct MsgPinCodes { + /// Authority is the address of the governance account. #[prost(string, tag = "1")] - pub address: ::prost::alloc::string::String, - #[prost(bytes = "vec", tag = "2")] + pub authority: ::prost::alloc::string::String, + /// CodeIDs references the new WASM codes + #[prost(uint64, repeated, packed = "false", tag = "2")] #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" )] - pub query_data: ::prost::alloc::vec::Vec, + pub code_ids: ::prost::alloc::vec::Vec, } +/// MsgPinCodesResponse defines the response structure for executing a +/// MsgPinCodes message. +/// +/// Since: 0.40 #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1587,15 +2459,11 @@ pub struct QuerySmartContractStateRequest { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.QuerySmartContractStateResponse")] -pub struct QuerySmartContractStateResponse { - #[prost(bytes = "vec", tag = "1")] - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - pub data: ::prost::alloc::vec::Vec, -} +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgPinCodesResponse")] +pub struct MsgPinCodesResponse {} +/// MsgUnpinCodes is the MsgUnpinCodes request type. +/// +/// Since: 0.40 #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1607,17 +2475,23 @@ pub struct QuerySmartContractStateResponse { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryCodeRequest")] -#[proto_query(path = "/cosmwasm.wasm.v1.Query/Code", response_type = QueryCodeResponse)] -pub struct QueryCodeRequest { - #[prost(uint64, tag = "1")] - #[serde(alias = "codeID")] +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgUnpinCodes")] +pub struct MsgUnpinCodes { + /// Authority is the address of the governance account. + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// CodeIDs references the WASM codes + #[prost(uint64, repeated, packed = "false", tag = "2")] #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" )] - pub code_id: u64, + pub code_ids: ::prost::alloc::vec::Vec, } +/// MsgUnpinCodesResponse defines the response structure for executing a +/// MsgUnpinCodes message. +/// +/// Since: 0.40 #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1629,26 +2503,79 @@ pub struct QueryCodeRequest { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.CodeInfoResponse")] -pub struct CodeInfoResponse { - #[prost(uint64, tag = "1")] - #[serde(alias = "codeID")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub code_id: u64, - #[prost(string, tag = "2")] - pub creator: ::prost::alloc::string::String, +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgUnpinCodesResponse")] +pub struct MsgUnpinCodesResponse {} +/// MsgStoreAndInstantiateContract is the MsgStoreAndInstantiateContract +/// request type. +/// +/// Since: 0.40 +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContract")] +pub struct MsgStoreAndInstantiateContract { + /// Authority is the address of the governance account. + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// WASMByteCode can be raw or gzip compressed #[prost(bytes = "vec", tag = "3")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" )] - pub data_hash: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "6")] + pub wasm_byte_code: ::prost::alloc::vec::Vec, + /// InstantiatePermission to apply on contract creation, optional + #[prost(message, optional, tag = "4")] pub instantiate_permission: ::core::option::Option, + /// UnpinCode code on upload, optional. As default the uploaded contract is + /// pinned to cache. + #[prost(bool, tag = "5")] + pub unpin_code: bool, + /// Admin is an optional address that can execute migrations + #[prost(string, tag = "6")] + pub admin: ::prost::alloc::string::String, + /// Label is optional metadata to be stored with a constract instance. + #[prost(string, tag = "7")] + pub label: ::prost::alloc::string::String, + /// Msg json encoded message to be passed to the contract on instantiation + #[prost(bytes = "vec", tag = "8")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub msg: ::prost::alloc::vec::Vec, + /// Funds coins that are transferred from the authority account to the contract + /// on instantiation + #[prost(message, repeated, tag = "9")] + pub funds: ::prost::alloc::vec::Vec, + /// Source is the URL where the code is hosted + #[prost(string, tag = "10")] + pub source: ::prost::alloc::string::String, + /// Builder is the docker image used to build the code deterministically, used + /// for smart contract verification + #[prost(string, tag = "11")] + pub builder: ::prost::alloc::string::String, + /// CodeHash is the SHA256 sum of the code outputted by builder, used for smart + /// contract verification + #[prost(bytes = "vec", tag = "12")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub code_hash: ::prost::alloc::vec::Vec, } +/// MsgStoreAndInstantiateContractResponse defines the response structure +/// for executing a MsgStoreAndInstantiateContract message. +/// +/// Since: 0.40 #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1660,10 +2587,12 @@ pub struct CodeInfoResponse { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryCodeResponse")] -pub struct QueryCodeResponse { - #[prost(message, optional, tag = "1")] - pub code_info: ::core::option::Option, +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgStoreAndInstantiateContractResponse")] +pub struct MsgStoreAndInstantiateContractResponse { + /// Address is the bech32 address of the new contract instance. + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// Data contains bytes to returned from the contract #[prost(bytes = "vec", tag = "2")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", @@ -1671,6 +2600,8 @@ pub struct QueryCodeResponse { )] pub data: ::prost::alloc::vec::Vec, } +/// MsgAddCodeUploadParamsAddresses is the +/// MsgAddCodeUploadParamsAddresses request type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1682,16 +2613,16 @@ pub struct QueryCodeResponse { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryCodesRequest")] -#[proto_query( - path = "/cosmwasm.wasm.v1.Query/Codes", - response_type = QueryCodesResponse -)] -pub struct QueryCodesRequest { - #[prost(message, optional, tag = "1")] - pub pagination: - ::core::option::Option, +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddresses")] +pub struct MsgAddCodeUploadParamsAddresses { + /// Authority is the address of the governance account. + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + #[prost(string, repeated, tag = "2")] + pub addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +/// MsgAddCodeUploadParamsAddressesResponse defines the response +/// structure for executing a MsgAddCodeUploadParamsAddresses message. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1703,14 +2634,10 @@ pub struct QueryCodesRequest { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryCodesResponse")] -pub struct QueryCodesResponse { - #[prost(message, repeated, tag = "1")] - pub code_infos: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "2")] - pub pagination: - ::core::option::Option, -} +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgAddCodeUploadParamsAddressesResponse")] +pub struct MsgAddCodeUploadParamsAddressesResponse {} +/// MsgRemoveCodeUploadParamsAddresses is the +/// MsgRemoveCodeUploadParamsAddresses request type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1722,16 +2649,16 @@ pub struct QueryCodesResponse { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryPinnedCodesRequest")] -#[proto_query( - path = "/cosmwasm.wasm.v1.Query/PinnedCodes", - response_type = QueryPinnedCodesResponse -)] -pub struct QueryPinnedCodesRequest { - #[prost(message, optional, tag = "2")] - pub pagination: - ::core::option::Option, +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddresses")] +pub struct MsgRemoveCodeUploadParamsAddresses { + /// Authority is the address of the governance account. + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + #[prost(string, repeated, tag = "2")] + pub addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +/// MsgRemoveCodeUploadParamsAddressesResponse defines the response +/// structure for executing a MsgRemoveCodeUploadParamsAddresses message. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1743,19 +2670,12 @@ pub struct QueryPinnedCodesRequest { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryPinnedCodesResponse")] -pub struct QueryPinnedCodesResponse { - #[prost(uint64, repeated, packed = "false", tag = "1")] - #[serde(alias = "codeIDs")] - #[serde( - serialize_with = "crate::serde::as_str_vec::serialize", - deserialize_with = "crate::serde::as_str_vec::deserialize" - )] - pub code_ids: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "2")] - pub pagination: - ::core::option::Option, -} +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgRemoveCodeUploadParamsAddressesResponse")] +pub struct MsgRemoveCodeUploadParamsAddressesResponse {} +/// MsgStoreAndMigrateContract is the MsgStoreAndMigrateContract +/// request type. +/// +/// Since: 0.42 #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1767,12 +2687,36 @@ pub struct QueryPinnedCodesResponse { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryParamsRequest")] -#[proto_query( - path = "/cosmwasm.wasm.v1.Query/Params", - response_type = QueryParamsResponse -)] -pub struct QueryParamsRequest {} +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgStoreAndMigrateContract")] +pub struct MsgStoreAndMigrateContract { + /// Authority is the address of the governance account. + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// WASMByteCode can be raw or gzip compressed + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub wasm_byte_code: ::prost::alloc::vec::Vec, + /// InstantiatePermission to apply on contract creation, optional + #[prost(message, optional, tag = "3")] + pub instantiate_permission: ::core::option::Option, + /// Contract is the address of the smart contract + #[prost(string, tag = "4")] + pub contract: ::prost::alloc::string::String, + /// Msg json encoded message to be passed to the contract on migration + #[prost(bytes = "vec", tag = "5")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub msg: ::prost::alloc::vec::Vec, +} +/// MsgStoreAndMigrateContractResponse defines the response structure +/// for executing a MsgStoreAndMigrateContract message. +/// +/// Since: 0.42 #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1784,11 +2728,31 @@ pub struct QueryParamsRequest {} ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryParamsResponse")] -pub struct QueryParamsResponse { - #[prost(message, optional, tag = "1")] - pub params: ::core::option::Option, +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgStoreAndMigrateContractResponse")] +pub struct MsgStoreAndMigrateContractResponse { + /// CodeID is the reference to the stored WASM code + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub code_id: u64, + /// Checksum is the sha256 hash of the stored code + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub checksum: ::prost::alloc::vec::Vec, + /// Data contains bytes to returned from the contract + #[prost(bytes = "vec", tag = "3")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, } +/// MsgUpdateContractLabel sets a new label for a smart contract #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1800,18 +2764,19 @@ pub struct QueryParamsResponse { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryContractsByCreatorRequest")] -#[proto_query( - path = "/cosmwasm.wasm.v1.Query/ContractsByCreator", - response_type = QueryContractsByCreatorResponse -)] -pub struct QueryContractsByCreatorRequest { +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgUpdateContractLabel")] +pub struct MsgUpdateContractLabel { + /// Sender is the that actor that signed the messages #[prost(string, tag = "1")] - pub creator_address: ::prost::alloc::string::String, - #[prost(message, optional, tag = "2")] - pub pagination: - ::core::option::Option, + pub sender: ::prost::alloc::string::String, + /// NewLabel string to be set + #[prost(string, tag = "2")] + pub new_label: ::prost::alloc::string::String, + /// Contract is the address of the smart contract + #[prost(string, tag = "3")] + pub contract: ::prost::alloc::string::String, } +/// MsgUpdateContractLabelResponse returns empty data #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1823,14 +2788,8 @@ pub struct QueryContractsByCreatorRequest { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/cosmwasm.wasm.v1.QueryContractsByCreatorResponse")] -pub struct QueryContractsByCreatorResponse { - #[prost(string, repeated, tag = "1")] - pub contract_addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(message, optional, tag = "2")] - pub pagination: - ::core::option::Option, -} +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgUpdateContractLabelResponse")] +pub struct MsgUpdateContractLabelResponse {} pub struct WasmQuerier<'a, Q: cosmwasm_std::CustomQuery> { querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, } @@ -1940,4 +2899,19 @@ impl<'a, Q: cosmwasm_std::CustomQuery> WasmQuerier<'a, Q> { } .query(self.querier) } + pub fn build_address( + &self, + code_hash: ::prost::alloc::string::String, + creator_address: ::prost::alloc::string::String, + salt: ::prost::alloc::string::String, + init_args: ::prost::alloc::vec::Vec, + ) -> Result { + QueryBuildAddressRequest { + code_hash, + creator_address, + salt, + init_args, + } + .query(self.querier) + } } diff --git a/packages/provwasm-std/src/types/cosmwasm/wasm/v1beta1.rs b/packages/provwasm-std/src/types/cosmwasm/wasm/v1beta1.rs new file mode 100644 index 00000000..c2b84b9d --- /dev/null +++ b/packages/provwasm-std/src/types/cosmwasm/wasm/v1beta1.rs @@ -0,0 +1,1602 @@ +use provwasm_proc_macro::CosmwasmExt; +/// AccessTypeParam +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1beta1.AccessTypeParam")] +pub struct AccessTypeParam { + #[prost(enumeration = "AccessType", tag = "1")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub value: i32, +} +/// AccessConfig access control 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 = "/cosmwasm.wasm.v1beta1.AccessConfig")] +pub struct AccessConfig { + #[prost(enumeration = "AccessType", tag = "1")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub permission: i32, + #[prost(string, tag = "2")] + pub address: ::prost::alloc::string::String, +} +/// Params defines the set of wasm parameters. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1beta1.Params")] +pub struct Params { + #[prost(message, optional, tag = "1")] + pub code_upload_access: ::core::option::Option, + #[prost(enumeration = "AccessType", tag = "2")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub instantiate_default_permission: i32, + #[prost(uint64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub max_wasm_code_size: u64, +} +/// CodeInfo is data for the uploaded contract WASM code +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1beta1.CodeInfo")] +pub struct CodeInfo { + /// CodeHash is the unique identifier created by wasmvm + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub code_hash: ::prost::alloc::vec::Vec, + /// Creator address who initially stored the code + #[prost(string, tag = "2")] + pub creator: ::prost::alloc::string::String, + /// Source is a valid absolute HTTPS URI to the contract's source code, + /// optional + #[prost(string, tag = "3")] + pub source: ::prost::alloc::string::String, + /// Builder is a valid docker image name with tag, optional + #[prost(string, tag = "4")] + pub builder: ::prost::alloc::string::String, + /// InstantiateConfig access control to apply on contract creation, optional + #[prost(message, optional, tag = "5")] + pub instantiate_config: ::core::option::Option, +} +/// ContractInfo stores a WASM contract instance +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1beta1.ContractInfo")] +pub struct ContractInfo { + /// CodeID is the reference to the stored Wasm code + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub code_id: u64, + /// Creator address who initially instantiated the contract + #[prost(string, tag = "2")] + pub creator: ::prost::alloc::string::String, + /// Admin is an optional address that can execute migrations + #[prost(string, tag = "3")] + pub admin: ::prost::alloc::string::String, + /// Label is optional metadata to be stored with a contract instance. + #[prost(string, tag = "4")] + pub label: ::prost::alloc::string::String, + /// Created Tx position when the contract was instantiated. + /// This data should kept internal and not be exposed via query results. Just + /// use for sorting + #[prost(message, optional, tag = "5")] + pub created: ::core::option::Option, + #[prost(string, tag = "6")] + pub ibc_port_id: ::prost::alloc::string::String, + /// Extension is an extension point to store custom metadata within the + /// persistence model. + #[prost(message, optional, tag = "7")] + pub extension: ::core::option::Option, +} +/// ContractCodeHistoryEntry metadata to a contract. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1beta1.ContractCodeHistoryEntry")] +pub struct ContractCodeHistoryEntry { + #[prost(enumeration = "ContractCodeHistoryOperationType", tag = "1")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub operation: i32, + /// CodeID is the reference to the stored WASM code + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub code_id: u64, + /// Updated Tx position when the operation was executed. + #[prost(message, optional, tag = "3")] + pub updated: ::core::option::Option, + #[prost(bytes = "vec", tag = "4")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub msg: ::prost::alloc::vec::Vec, +} +/// AbsoluteTxPosition is a unique transaction position that allows for global +/// ordering of transactions. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1beta1.AbsoluteTxPosition")] +pub struct AbsoluteTxPosition { + /// BlockHeight is the block the contract was created at + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub block_height: u64, + /// TxIndex is a monotonic counter within the block (actual transaction index, + /// or gas consumed) + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub tx_index: u64, +} +/// Model is a struct that holds a KV pair +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1beta1.Model")] +pub struct Model { + /// hex-encode key to read it better (this is often ascii) + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub key: ::prost::alloc::vec::Vec, + /// base64-encode raw value + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub value: ::prost::alloc::vec::Vec, +} +/// AccessType permission types +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +pub enum AccessType { + /// AccessTypeUnspecified placeholder for empty value + Unspecified = 0, + /// AccessTypeNobody forbidden + Nobody = 1, + /// AccessTypeOnlyAddress restricted to an address + OnlyAddress = 2, + /// AccessTypeEverybody unrestricted + Everybody = 3, +} +impl AccessType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + AccessType::Unspecified => "ACCESS_TYPE_UNSPECIFIED", + AccessType::Nobody => "ACCESS_TYPE_NOBODY", + AccessType::OnlyAddress => "ACCESS_TYPE_ONLY_ADDRESS", + AccessType::Everybody => "ACCESS_TYPE_EVERYBODY", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "ACCESS_TYPE_UNSPECIFIED" => Some(Self::Unspecified), + "ACCESS_TYPE_NOBODY" => Some(Self::Nobody), + "ACCESS_TYPE_ONLY_ADDRESS" => Some(Self::OnlyAddress), + "ACCESS_TYPE_EVERYBODY" => Some(Self::Everybody), + _ => None, + } + } +} +/// ContractCodeHistoryOperationType actions that caused a code change +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +pub enum ContractCodeHistoryOperationType { + /// ContractCodeHistoryOperationTypeUnspecified placeholder for empty value + Unspecified = 0, + /// ContractCodeHistoryOperationTypeInit on chain contract instantiation + Init = 1, + /// ContractCodeHistoryOperationTypeMigrate code migration + Migrate = 2, + /// ContractCodeHistoryOperationTypeGenesis based on genesis data + Genesis = 3, +} +impl ContractCodeHistoryOperationType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + ContractCodeHistoryOperationType::Unspecified => { + "CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED" + } + ContractCodeHistoryOperationType::Init => "CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT", + ContractCodeHistoryOperationType::Migrate => { + "CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE" + } + ContractCodeHistoryOperationType::Genesis => { + "CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS" + } + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED" => Some(Self::Unspecified), + "CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT" => Some(Self::Init), + "CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE" => Some(Self::Migrate), + "CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS" => Some(Self::Genesis), + _ => None, + } + } +} +/// MsgStoreCode submit Wasm code to the system +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1beta1.MsgStoreCode")] +pub struct MsgStoreCode { + /// Sender is the that actor that signed the messages + #[prost(string, tag = "1")] + pub sender: ::prost::alloc::string::String, + /// WASMByteCode can be raw or gzip compressed + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub wasm_byte_code: ::prost::alloc::vec::Vec, + /// Source is a valid absolute HTTPS URI to the contract's source code, + /// optional + #[prost(string, tag = "3")] + pub source: ::prost::alloc::string::String, + /// Builder is a valid docker image name with tag, optional + #[prost(string, tag = "4")] + pub builder: ::prost::alloc::string::String, + /// InstantiatePermission access control to apply on contract creation, + /// optional + #[prost(message, optional, tag = "5")] + pub instantiate_permission: ::core::option::Option, +} +/// MsgStoreCodeResponse returns store result data. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1beta1.MsgStoreCodeResponse")] +pub struct MsgStoreCodeResponse { + /// CodeID is the reference to the stored WASM code + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub code_id: u64, +} +/// MsgInstantiateContract create a new smart contract instance for the given +/// code id. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1beta1.MsgInstantiateContract")] +pub struct MsgInstantiateContract { + /// Sender is the that actor that signed the messages + #[prost(string, tag = "1")] + pub sender: ::prost::alloc::string::String, + /// Admin is an optional address that can execute migrations + #[prost(string, tag = "2")] + pub admin: ::prost::alloc::string::String, + /// CodeID is the reference to the stored WASM code + #[prost(uint64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub code_id: u64, + /// Label is optional metadata to be stored with a contract instance. + #[prost(string, tag = "4")] + pub label: ::prost::alloc::string::String, + /// InitMsg json encoded message to be passed to the contract on instantiation + #[prost(bytes = "vec", tag = "5")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub init_msg: ::prost::alloc::vec::Vec, + /// Funds coins that are transferred to the contract on instantiation + #[prost(message, repeated, tag = "6")] + pub funds: ::prost::alloc::vec::Vec, +} +/// MsgInstantiateContractResponse return instantiation result data +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1beta1.MsgInstantiateContractResponse")] +pub struct MsgInstantiateContractResponse { + /// Address is the bech32 address of the new contract instance. + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// Data contains base64-encoded bytes to returned from the contract + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, +} +/// MsgExecuteContract submits the given message data to a smart contract +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1beta1.MsgExecuteContract")] +pub struct MsgExecuteContract { + /// Sender is the that actor that signed the messages + #[prost(string, tag = "1")] + pub sender: ::prost::alloc::string::String, + /// Contract is the address of the smart contract + #[prost(string, tag = "2")] + pub contract: ::prost::alloc::string::String, + /// Msg json encoded message to be passed to the contract + #[prost(bytes = "vec", tag = "3")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub msg: ::prost::alloc::vec::Vec, + /// Funds coins that are transferred to the contract on execution + #[prost(message, repeated, tag = "5")] + pub funds: ::prost::alloc::vec::Vec, +} +/// MsgExecuteContractResponse returns execution result data. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1beta1.MsgExecuteContractResponse")] +pub struct MsgExecuteContractResponse { + /// Data contains base64-encoded bytes to returned from the contract + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, +} +/// MsgMigrateContract runs a code upgrade/ downgrade for a smart contract +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1beta1.MsgMigrateContract")] +pub struct MsgMigrateContract { + /// Sender is the that actor that signed the messages + #[prost(string, tag = "1")] + pub sender: ::prost::alloc::string::String, + /// Contract is the address of the smart contract + #[prost(string, tag = "2")] + pub contract: ::prost::alloc::string::String, + /// CodeID references the new WASM code + #[prost(uint64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub code_id: u64, + /// MigrateMsg json encoded message to be passed to the contract on migration + #[prost(bytes = "vec", tag = "4")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub migrate_msg: ::prost::alloc::vec::Vec, +} +/// MsgMigrateContractResponse returns contract migration result data. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1beta1.MsgMigrateContractResponse")] +pub struct MsgMigrateContractResponse { + /// Data contains same raw bytes returned as data from the wasm contract. + /// (May be empty) + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, +} +/// MsgUpdateAdmin sets a new admin for a smart contract +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1beta1.MsgUpdateAdmin")] +pub struct MsgUpdateAdmin { + /// Sender is the that actor that signed the messages + #[prost(string, tag = "1")] + pub sender: ::prost::alloc::string::String, + /// NewAdmin address to be set + #[prost(string, tag = "2")] + pub new_admin: ::prost::alloc::string::String, + /// Contract is the address of the smart contract + #[prost(string, tag = "3")] + pub contract: ::prost::alloc::string::String, +} +/// MsgUpdateAdminResponse returns empty data +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1beta1.MsgUpdateAdminResponse")] +pub struct MsgUpdateAdminResponse {} +/// MsgClearAdmin removes any admin stored for a smart contract +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1beta1.MsgClearAdmin")] +pub struct MsgClearAdmin { + /// Sender is the that actor that signed the messages + #[prost(string, tag = "1")] + pub sender: ::prost::alloc::string::String, + /// Contract is the address of the smart contract + #[prost(string, tag = "3")] + pub contract: ::prost::alloc::string::String, +} +/// MsgClearAdminResponse returns empty data +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1beta1.MsgClearAdminResponse")] +pub struct MsgClearAdminResponse {} +/// GenesisState - genesis state of x/wasm +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1beta1.GenesisState")] +pub struct GenesisState { + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, + #[prost(message, repeated, tag = "2")] + pub codes: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "3")] + pub contracts: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "4")] + pub sequences: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "5")] + pub gen_msgs: ::prost::alloc::vec::Vec, +} +/// Nested message and enum types in `GenesisState`. +pub mod genesis_state { + use provwasm_proc_macro::CosmwasmExt; + /// GenMsgs define the messages that can be executed during genesis phase in + /// order. The intention is to have more human readable data that is auditable. + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, + )] + #[proto_message(type_url = "/cosmwasm.wasm.v1beta1.GenesisState.GenMsgs")] + pub struct GenMsgs { + /// sum is a single message + #[prost(oneof = "gen_msgs::Sum", tags = "1, 2, 3")] + pub sum: ::core::option::Option, + } + /// Nested message and enum types in `GenMsgs`. + pub mod gen_msgs { + use provwasm_proc_macro::CosmwasmExt; + /// sum is a single message + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive( + Clone, + PartialEq, + Eq, + ::prost::Oneof, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + )] + pub enum Sum { + #[prost(message, tag = "1")] + StoreCode(super::super::MsgStoreCode), + #[prost(message, tag = "2")] + InstantiateContract(super::super::MsgInstantiateContract), + #[prost(message, tag = "3")] + ExecuteContract(super::super::MsgExecuteContract), + } + } +} +/// Code struct encompasses CodeInfo and CodeBytes +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1beta1.Code")] +pub struct Code { + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub code_id: u64, + #[prost(message, optional, tag = "2")] + pub code_info: ::core::option::Option, + #[prost(bytes = "vec", tag = "3")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub code_bytes: ::prost::alloc::vec::Vec, + /// Pinned to wasmvm cache + #[prost(bool, tag = "4")] + pub pinned: bool, +} +/// Contract struct encompasses ContractAddress, ContractInfo, and ContractState +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1beta1.Contract")] +pub struct Contract { + #[prost(string, tag = "1")] + pub contract_address: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub contract_info: ::core::option::Option, + #[prost(message, repeated, tag = "3")] + pub contract_state: ::prost::alloc::vec::Vec, +} +/// Sequence key and value of an id generation counter +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1beta1.Sequence")] +pub struct Sequence { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub id_key: ::prost::alloc::vec::Vec, + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub value: u64, +} +/// MsgIBCSend +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1beta1.MsgIBCSend")] +pub struct MsgIbcSend { + /// the channel by which the packet will be sent + #[prost(string, tag = "2")] + pub channel: ::prost::alloc::string::String, + /// Timeout height relative to the current block height. + /// The timeout is disabled when set to 0. + #[prost(uint64, tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub timeout_height: u64, + /// Timeout timestamp (in nanoseconds) relative to the current block timestamp. + /// The timeout is disabled when set to 0. + #[prost(uint64, tag = "5")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub timeout_timestamp: u64, + /// data is the payload to transfer + #[prost(bytes = "vec", tag = "6")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, +} +/// MsgIBCCloseChannel port and channel need to be owned by the contract +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1beta1.MsgIBCCloseChannel")] +pub struct MsgIbcCloseChannel { + #[prost(string, tag = "2")] + pub channel: ::prost::alloc::string::String, +} +/// StoreCodeProposal gov proposal content type to submit WASM code to the system +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1beta1.StoreCodeProposal")] +pub struct StoreCodeProposal { + /// Title is a short summary + #[prost(string, tag = "1")] + pub title: ::prost::alloc::string::String, + /// Description is a human readable text + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + /// RunAs is the address that is passed to the contract's environment as sender + #[prost(string, tag = "3")] + pub run_as: ::prost::alloc::string::String, + /// WASMByteCode can be raw or gzip compressed + #[prost(bytes = "vec", tag = "4")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub wasm_byte_code: ::prost::alloc::vec::Vec, + /// Source is a valid absolute HTTPS URI to the contract's source code, + /// optional + #[prost(string, tag = "5")] + pub source: ::prost::alloc::string::String, + /// Builder is a valid docker image name with tag, optional + #[prost(string, tag = "6")] + pub builder: ::prost::alloc::string::String, + /// InstantiatePermission to apply on contract creation, optional + #[prost(message, optional, tag = "7")] + pub instantiate_permission: ::core::option::Option, +} +/// InstantiateContractProposal gov proposal content type to instantiate a +/// contract. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1beta1.InstantiateContractProposal")] +pub struct InstantiateContractProposal { + /// Title is a short summary + #[prost(string, tag = "1")] + pub title: ::prost::alloc::string::String, + /// Description is a human readable text + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + /// RunAs is the address that is passed to the contract's environment as sender + #[prost(string, tag = "3")] + pub run_as: ::prost::alloc::string::String, + /// Admin is an optional address that can execute migrations + #[prost(string, tag = "4")] + pub admin: ::prost::alloc::string::String, + /// CodeID is the reference to the stored WASM code + #[prost(uint64, tag = "5")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub code_id: u64, + /// Label is optional metadata to be stored with a constract instance. + #[prost(string, tag = "6")] + pub label: ::prost::alloc::string::String, + /// InitMsg json encoded message to be passed to the contract on instantiation + #[prost(bytes = "vec", tag = "7")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub init_msg: ::prost::alloc::vec::Vec, + /// Funds coins that are transferred to the contract on instantiation + #[prost(message, repeated, tag = "8")] + pub funds: ::prost::alloc::vec::Vec, +} +/// MigrateContractProposal gov proposal content type to migrate a contract. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1beta1.MigrateContractProposal")] +pub struct MigrateContractProposal { + /// Title is a short summary + #[prost(string, tag = "1")] + pub title: ::prost::alloc::string::String, + /// Description is a human readable text + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + /// RunAs is the address that is passed to the contract's environment as sender + #[prost(string, tag = "3")] + pub run_as: ::prost::alloc::string::String, + /// Contract is the address of the smart contract + #[prost(string, tag = "4")] + pub contract: ::prost::alloc::string::String, + /// CodeID references the new WASM code + #[prost(uint64, tag = "5")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub code_id: u64, + /// MigrateMsg json encoded message to be passed to the contract on migration + #[prost(bytes = "vec", tag = "6")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub migrate_msg: ::prost::alloc::vec::Vec, +} +/// UpdateAdminProposal gov proposal content type to set an admin for a contract. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1beta1.UpdateAdminProposal")] +pub struct UpdateAdminProposal { + /// Title is a short summary + #[prost(string, tag = "1")] + pub title: ::prost::alloc::string::String, + /// Description is a human readable text + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + /// NewAdmin address to be set + #[prost(string, tag = "3")] + pub new_admin: ::prost::alloc::string::String, + /// Contract is the address of the smart contract + #[prost(string, tag = "4")] + pub contract: ::prost::alloc::string::String, +} +/// ClearAdminProposal gov proposal content type to clear the admin of a +/// contract. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1beta1.ClearAdminProposal")] +pub struct ClearAdminProposal { + /// Title is a short summary + #[prost(string, tag = "1")] + pub title: ::prost::alloc::string::String, + /// Description is a human readable text + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + /// Contract is the address of the smart contract + #[prost(string, tag = "3")] + pub contract: ::prost::alloc::string::String, +} +/// PinCodesProposal gov proposal content type to pin a set of code ids in the +/// wasmvm cache. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1beta1.PinCodesProposal")] +pub struct PinCodesProposal { + /// Title is a short summary + #[prost(string, tag = "1")] + pub title: ::prost::alloc::string::String, + /// Description is a human readable text + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + /// CodeIDs references the new WASM codes + #[prost(uint64, repeated, packed = "false", tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub code_ids: ::prost::alloc::vec::Vec, +} +/// UnpinCodesProposal gov proposal content type to unpin a set of code ids in +/// the wasmvm cache. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1beta1.UnpinCodesProposal")] +pub struct UnpinCodesProposal { + /// Title is a short summary + #[prost(string, tag = "1")] + pub title: ::prost::alloc::string::String, + /// Description is a human readable text + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + /// CodeIDs references the WASM codes + #[prost(uint64, repeated, packed = "false", tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub code_ids: ::prost::alloc::vec::Vec, +} +/// QueryContractInfoRequest is the request type for the Query/ContractInfo 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 = "/cosmwasm.wasm.v1beta1.QueryContractInfoRequest")] +#[proto_query( + path = "/cosmwasm.wasm.v1beta1.Query/ContractInfo", + response_type = QueryContractInfoResponse +)] +pub struct QueryContractInfoRequest { + /// address is the address of the contract to query + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, +} +/// QueryContractInfoResponse is the response type for the Query/ContractInfo 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 = "/cosmwasm.wasm.v1beta1.QueryContractInfoResponse")] +pub struct QueryContractInfoResponse { + /// address is the address of the contract + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub contract_info: ::core::option::Option, +} +/// QueryContractHistoryRequest is the request type for the Query/ContractHistory +/// 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 = "/cosmwasm.wasm.v1beta1.QueryContractHistoryRequest")] +#[proto_query( + path = "/cosmwasm.wasm.v1beta1.Query/ContractHistory", + response_type = QueryContractHistoryResponse +)] +pub struct QueryContractHistoryRequest { + /// address is the address of the contract to query + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: + ::core::option::Option, +} +/// QueryContractHistoryResponse is the response type for the +/// Query/ContractHistory 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 = "/cosmwasm.wasm.v1beta1.QueryContractHistoryResponse")] +pub struct QueryContractHistoryResponse { + #[prost(message, repeated, tag = "1")] + pub entries: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: + ::core::option::Option, +} +/// QueryContractsByCodeRequest is the request type for the Query/ContractsByCode +/// 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 = "/cosmwasm.wasm.v1beta1.QueryContractsByCodeRequest")] +#[proto_query( + path = "/cosmwasm.wasm.v1beta1.Query/ContractsByCode", + response_type = QueryContractsByCodeResponse +)] +pub struct QueryContractsByCodeRequest { + /// grpc-gateway_out does not support Go style CodID + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub code_id: u64, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: + ::core::option::Option, +} +/// QueryContractsByCodeResponse is the response type for the +/// Query/ContractsByCode 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 = "/cosmwasm.wasm.v1beta1.QueryContractsByCodeResponse")] +pub struct QueryContractsByCodeResponse { + /// contracts are a set of contract addresses + #[prost(string, repeated, tag = "1")] + pub contracts: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: + ::core::option::Option, +} +/// QueryAllContractStateRequest is the request type for the +/// Query/AllContractState 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 = "/cosmwasm.wasm.v1beta1.QueryAllContractStateRequest")] +#[proto_query( + path = "/cosmwasm.wasm.v1beta1.Query/AllContractState", + response_type = QueryAllContractStateResponse +)] +pub struct QueryAllContractStateRequest { + /// address is the address of the contract + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: + ::core::option::Option, +} +/// QueryAllContractStateResponse is the response type for the +/// Query/AllContractState 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 = "/cosmwasm.wasm.v1beta1.QueryAllContractStateResponse")] +pub struct QueryAllContractStateResponse { + #[prost(message, repeated, tag = "1")] + pub models: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: + ::core::option::Option, +} +/// QueryRawContractStateRequest is the request type for the +/// Query/RawContractState 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 = "/cosmwasm.wasm.v1beta1.QueryRawContractStateRequest")] +#[proto_query( + path = "/cosmwasm.wasm.v1beta1.Query/RawContractState", + response_type = QueryRawContractStateResponse +)] +pub struct QueryRawContractStateRequest { + /// address is the address of the contract + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub query_data: ::prost::alloc::vec::Vec, +} +/// QueryRawContractStateResponse is the response type for the +/// Query/RawContractState 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 = "/cosmwasm.wasm.v1beta1.QueryRawContractStateResponse")] +pub struct QueryRawContractStateResponse { + /// Data contains the raw store data + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, +} +/// QuerySmartContractStateRequest is the request type for the +/// Query/SmartContractState 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 = "/cosmwasm.wasm.v1beta1.QuerySmartContractStateRequest")] +#[proto_query( + path = "/cosmwasm.wasm.v1beta1.Query/SmartContractState", + response_type = QuerySmartContractStateResponse +)] +pub struct QuerySmartContractStateRequest { + /// address is the address of the contract + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// QueryData contains the query data passed to the contract + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub query_data: ::prost::alloc::vec::Vec, +} +/// QuerySmartContractStateResponse is the response type for the +/// Query/SmartContractState 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 = "/cosmwasm.wasm.v1beta1.QuerySmartContractStateResponse")] +pub struct QuerySmartContractStateResponse { + /// Data contains the json data returned from the smart contract + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, +} +/// QueryCodeRequest is the request type for the Query/Code 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 = "/cosmwasm.wasm.v1beta1.QueryCodeRequest")] +#[proto_query( + path = "/cosmwasm.wasm.v1beta1.Query/Code", + response_type = QueryCodeResponse +)] +pub struct QueryCodeRequest { + /// grpc-gateway_out does not support Go style CodID + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub code_id: u64, +} +/// CodeInfoResponse contains code meta data from CodeInfo +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1beta1.CodeInfoResponse")] +pub struct CodeInfoResponse { + /// id for legacy support + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub code_id: u64, + #[prost(string, tag = "2")] + pub creator: ::prost::alloc::string::String, + #[prost(bytes = "vec", tag = "3")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub data_hash: ::prost::alloc::vec::Vec, + #[prost(string, tag = "4")] + pub source: ::prost::alloc::string::String, + #[prost(string, tag = "5")] + pub builder: ::prost::alloc::string::String, +} +/// QueryCodeResponse is the response type for the Query/Code 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 = "/cosmwasm.wasm.v1beta1.QueryCodeResponse")] +pub struct QueryCodeResponse { + #[prost(message, optional, tag = "1")] + pub code_info: ::core::option::Option, + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, +} +/// QueryCodesRequest is the request type for the Query/Codes 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 = "/cosmwasm.wasm.v1beta1.QueryCodesRequest")] +#[proto_query( + path = "/cosmwasm.wasm.v1beta1.Query/Codes", + response_type = QueryCodesResponse +)] +pub struct QueryCodesRequest { + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "1")] + pub pagination: + ::core::option::Option, +} +/// QueryCodesResponse is the response type for the Query/Codes 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 = "/cosmwasm.wasm.v1beta1.QueryCodesResponse")] +pub struct QueryCodesResponse { + #[prost(message, repeated, tag = "1")] + pub code_infos: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: + ::core::option::Option, +} +pub struct WasmQuerier<'a, Q: cosmwasm_std::CustomQuery> { + querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, +} +impl<'a, Q: cosmwasm_std::CustomQuery> WasmQuerier<'a, Q> { + pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self { + Self { querier } + } + pub fn contract_info( + &self, + address: ::prost::alloc::string::String, + ) -> Result { + QueryContractInfoRequest { address }.query(self.querier) + } + pub fn contract_history( + &self, + address: ::prost::alloc::string::String, + pagination: ::core::option::Option< + super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + ) -> Result { + QueryContractHistoryRequest { + address, + pagination, + } + .query(self.querier) + } + pub fn contracts_by_code( + &self, + code_id: u64, + pagination: ::core::option::Option< + super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + ) -> Result { + QueryContractsByCodeRequest { + code_id, + pagination, + } + .query(self.querier) + } + pub fn all_contract_state( + &self, + address: ::prost::alloc::string::String, + pagination: ::core::option::Option< + super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + ) -> Result { + QueryAllContractStateRequest { + address, + pagination, + } + .query(self.querier) + } + pub fn raw_contract_state( + &self, + address: ::prost::alloc::string::String, + query_data: ::prost::alloc::vec::Vec, + ) -> Result { + QueryRawContractStateRequest { + address, + query_data, + } + .query(self.querier) + } + pub fn smart_contract_state( + &self, + address: ::prost::alloc::string::String, + query_data: ::prost::alloc::vec::Vec, + ) -> Result { + QuerySmartContractStateRequest { + address, + query_data, + } + .query(self.querier) + } + pub fn code(&self, code_id: u64) -> Result { + QueryCodeRequest { code_id }.query(self.querier) + } + pub fn codes( + &self, + pagination: ::core::option::Option< + super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + ) -> Result { + QueryCodesRequest { pagination }.query(self.querier) + } +} From e2f0254cd4a2704a0a76ba238948524ad906eea6 Mon Sep 17 00:00:00 2001 From: kwt <4344285+kwtalley@users.noreply.github.com> Date: Fri, 12 Jul 2024 01:19:25 -0500 Subject: [PATCH 21/43] add generated ibc types --- .../src/types/ibc/applications/fee/v1.rs | 821 ++++- .../interchain_accounts/controller/v1.rs | 176 +- .../interchain_accounts/genesis/mod.rs | 1 + .../interchain_accounts/genesis/v1.rs | 115 + .../interchain_accounts/host/mod.rs | 1 + .../interchain_accounts/host/v1.rs | 183 ++ .../applications/interchain_accounts/mod.rs | 2 + .../applications/interchain_accounts/v1.rs | 104 +- .../types/ibc/applications/transfer/mod.rs | 1 + .../src/types/ibc/applications/transfer/v1.rs | 409 +++ .../src/types/ibc/applications/transfer/v2.rs | 33 + .../src/types/ibc/core/channel/v1.rs | 2752 ++++++++++++++++- .../src/types/ibc/core/client/v1.rs | 1161 ++++++- .../src/types/ibc/core/commitment/mod.rs | 1 + .../src/types/ibc/core/commitment/v1.rs | 87 + .../src/types/ibc/core/connection/mod.rs | 1 + .../src/types/ibc/core/connection/v1.rs | 913 ++++++ .../provwasm-std/src/types/ibc/core/mod.rs | 4 + .../src/types/ibc/core/port/mod.rs | 1 + .../src/types/ibc/core/port/v1.rs | 85 + .../src/types/ibc/core/types/mod.rs | 1 + .../src/types/ibc/core/types/v1.rs | 25 + .../types/ibc/lightclients/localhost/mod.rs | 1 + .../types/ibc/lightclients/localhost/v2.rs | 19 + .../src/types/ibc/lightclients/mod.rs | 4 + .../types/ibc/lightclients/solomachine/mod.rs | 2 + .../types/ibc/lightclients/solomachine/v2.rs | 527 ++++ .../types/ibc/lightclients/solomachine/v3.rs | 252 ++ .../types/ibc/lightclients/tendermint/mod.rs | 1 + .../types/ibc/lightclients/tendermint/v1.rs | 175 ++ .../src/types/ibc/lightclients/wasm/mod.rs | 1 + .../src/types/ibc/lightclients/wasm/v1.rs | 384 +++ packages/provwasm-std/src/types/ibc/mod.rs | 1 + 33 files changed, 8201 insertions(+), 43 deletions(-) create mode 100644 packages/provwasm-std/src/types/ibc/applications/interchain_accounts/genesis/mod.rs create mode 100644 packages/provwasm-std/src/types/ibc/applications/interchain_accounts/genesis/v1.rs create mode 100644 packages/provwasm-std/src/types/ibc/applications/interchain_accounts/host/mod.rs create mode 100644 packages/provwasm-std/src/types/ibc/applications/interchain_accounts/host/v1.rs create mode 100644 packages/provwasm-std/src/types/ibc/applications/transfer/v2.rs create mode 100644 packages/provwasm-std/src/types/ibc/core/commitment/mod.rs create mode 100644 packages/provwasm-std/src/types/ibc/core/commitment/v1.rs create mode 100644 packages/provwasm-std/src/types/ibc/core/connection/mod.rs create mode 100644 packages/provwasm-std/src/types/ibc/core/connection/v1.rs create mode 100644 packages/provwasm-std/src/types/ibc/core/port/mod.rs create mode 100644 packages/provwasm-std/src/types/ibc/core/port/v1.rs create mode 100644 packages/provwasm-std/src/types/ibc/core/types/mod.rs create mode 100644 packages/provwasm-std/src/types/ibc/core/types/v1.rs create mode 100644 packages/provwasm-std/src/types/ibc/lightclients/localhost/mod.rs create mode 100644 packages/provwasm-std/src/types/ibc/lightclients/localhost/v2.rs create mode 100644 packages/provwasm-std/src/types/ibc/lightclients/mod.rs create mode 100644 packages/provwasm-std/src/types/ibc/lightclients/solomachine/mod.rs create mode 100644 packages/provwasm-std/src/types/ibc/lightclients/solomachine/v2.rs create mode 100644 packages/provwasm-std/src/types/ibc/lightclients/solomachine/v3.rs create mode 100644 packages/provwasm-std/src/types/ibc/lightclients/tendermint/mod.rs create mode 100644 packages/provwasm-std/src/types/ibc/lightclients/tendermint/v1.rs create mode 100644 packages/provwasm-std/src/types/ibc/lightclients/wasm/mod.rs create mode 100644 packages/provwasm-std/src/types/ibc/lightclients/wasm/v1.rs diff --git a/packages/provwasm-std/src/types/ibc/applications/fee/v1.rs b/packages/provwasm-std/src/types/ibc/applications/fee/v1.rs index 7019c832..18efb4ac 100644 --- a/packages/provwasm-std/src/types/ibc/applications/fee/v1.rs +++ b/packages/provwasm-std/src/types/ibc/applications/fee/v1.rs @@ -1,4 +1,33 @@ use provwasm_proc_macro::CosmwasmExt; +/// IncentivizedAcknowledgement is the acknowledgement format to be used by applications wrapped in the fee middleware +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.IncentivizedAcknowledgement")] +pub struct IncentivizedAcknowledgement { + /// the underlying app acknowledgement bytes + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub app_acknowledgement: ::prost::alloc::vec::Vec, + /// the relayer address which submits the recv packet message + #[prost(string, tag = "2")] + pub forward_relayer_address: ::prost::alloc::string::String, + /// success flag of the base application callback + #[prost(bool, tag = "3")] + pub underlying_app_success: bool, +} +/// Fee defines the ICS29 receive, acknowledgement and timeout fees #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -12,14 +41,18 @@ use provwasm_proc_macro::CosmwasmExt; )] #[proto_message(type_url = "/ibc.applications.fee.v1.Fee")] pub struct Fee { + /// the packet receive fee #[prost(message, repeated, tag = "1")] pub recv_fee: ::prost::alloc::vec::Vec, + /// the packet acknowledgement fee #[prost(message, repeated, tag = "2")] pub ack_fee: ::prost::alloc::vec::Vec, + /// the packet timeout fee #[prost(message, repeated, tag = "3")] pub timeout_fee: ::prost::alloc::vec::Vec, } +/// PacketFee contains ICS29 relayer fees, refund address and optional list of permitted relayers #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -33,13 +66,664 @@ pub struct Fee { )] #[proto_message(type_url = "/ibc.applications.fee.v1.PacketFee")] pub struct PacketFee { + /// fee encapsulates the recv, ack and timeout fees associated with an IBC packet #[prost(message, optional, tag = "1")] pub fee: ::core::option::Option, + /// the refund address for unspent fees #[prost(string, tag = "2")] pub refund_address: ::prost::alloc::string::String, + /// optional list of relayers permitted to receive fees #[prost(string, repeated, tag = "3")] pub relayers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +/// PacketFees contains a list of type PacketFee +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.PacketFees")] +pub struct PacketFees { + /// list of packet fees + #[prost(message, repeated, tag = "1")] + pub packet_fees: ::prost::alloc::vec::Vec, +} +/// IdentifiedPacketFees contains a list of type PacketFee and associated PacketId +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.IdentifiedPacketFees")] +pub struct IdentifiedPacketFees { + /// unique packet identifier comprised of the channel ID, port ID and sequence + #[prost(message, optional, tag = "1")] + pub packet_id: ::core::option::Option, + /// list of packet fees + #[prost(message, repeated, tag = "2")] + pub packet_fees: ::prost::alloc::vec::Vec, +} +/// GenesisState defines the ICS29 fee middleware genesis state +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.GenesisState")] +pub struct GenesisState { + /// list of identified packet fees + #[prost(message, repeated, tag = "1")] + pub identified_fees: ::prost::alloc::vec::Vec, + /// list of fee enabled channels + #[prost(message, repeated, tag = "2")] + pub fee_enabled_channels: ::prost::alloc::vec::Vec, + /// list of registered payees + #[prost(message, repeated, tag = "3")] + pub registered_payees: ::prost::alloc::vec::Vec, + /// list of registered counterparty payees + #[prost(message, repeated, tag = "4")] + pub registered_counterparty_payees: ::prost::alloc::vec::Vec, + /// list of forward relayer addresses + #[prost(message, repeated, tag = "5")] + pub forward_relayers: ::prost::alloc::vec::Vec, +} +/// FeeEnabledChannel contains the PortID & ChannelID for a fee enabled channel +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.FeeEnabledChannel")] +pub struct FeeEnabledChannel { + /// unique port identifier + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + /// unique channel identifier + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, +} +/// RegisteredPayee contains the relayer address and payee address for a specific channel +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.RegisteredPayee")] +pub struct RegisteredPayee { + /// unique channel identifier + #[prost(string, tag = "1")] + pub channel_id: ::prost::alloc::string::String, + /// the relayer address + #[prost(string, tag = "2")] + pub relayer: ::prost::alloc::string::String, + /// the payee address + #[prost(string, tag = "3")] + pub payee: ::prost::alloc::string::String, +} +/// RegisteredCounterpartyPayee contains the relayer address and counterparty payee address for a specific channel (used +/// for recv fee distribution) +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.RegisteredCounterpartyPayee")] +pub struct RegisteredCounterpartyPayee { + /// unique channel identifier + #[prost(string, tag = "1")] + pub channel_id: ::prost::alloc::string::String, + /// the relayer address + #[prost(string, tag = "2")] + pub relayer: ::prost::alloc::string::String, + /// the counterparty payee address + #[prost(string, tag = "3")] + pub counterparty_payee: ::prost::alloc::string::String, +} +/// ForwardRelayerAddress contains the forward relayer address and PacketId used for async acknowledgements +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.ForwardRelayerAddress")] +pub struct ForwardRelayerAddress { + /// the forward relayer address + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// unique packet identifer comprised of the channel ID, port ID and sequence + #[prost(message, optional, tag = "2")] + pub packet_id: ::core::option::Option, +} +/// Metadata defines the ICS29 channel specific metadata encoded into the channel version bytestring +/// See ICS004: +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.Metadata")] +pub struct Metadata { + /// fee_version defines the ICS29 fee version + #[prost(string, tag = "1")] + pub fee_version: ::prost::alloc::string::String, + /// app_version defines the underlying application version, which may or may not be a JSON encoded bytestring + #[prost(string, tag = "2")] + pub app_version: ::prost::alloc::string::String, +} +/// QueryIncentivizedPacketsRequest defines the request type for the IncentivizedPackets rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.QueryIncentivizedPacketsRequest")] +#[proto_query( + path = "/ibc.applications.fee.v1.Query/IncentivizedPackets", + response_type = QueryIncentivizedPacketsResponse +)] +pub struct QueryIncentivizedPacketsRequest { + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "1")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + /// block height at which to query + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub query_height: u64, +} +/// QueryIncentivizedPacketsResponse defines the response type for the IncentivizedPackets rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.QueryIncentivizedPacketsResponse")] +pub struct QueryIncentivizedPacketsResponse { + /// list of identified fees for incentivized packets + #[prost(message, repeated, tag = "1")] + pub incentivized_packets: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageResponse, + >, +} +/// QueryIncentivizedPacketRequest defines the request type for the IncentivizedPacket rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.QueryIncentivizedPacketRequest")] +#[proto_query( + path = "/ibc.applications.fee.v1.Query/IncentivizedPacket", + response_type = QueryIncentivizedPacketResponse +)] +pub struct QueryIncentivizedPacketRequest { + /// unique packet identifier comprised of channel ID, port ID and sequence + #[prost(message, optional, tag = "1")] + pub packet_id: ::core::option::Option, + /// block height at which to query + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub query_height: u64, +} +/// QueryIncentivizedPacketsResponse defines the response type for the IncentivizedPacket rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.QueryIncentivizedPacketResponse")] +pub struct QueryIncentivizedPacketResponse { + /// the identified fees for the incentivized packet + #[prost(message, optional, tag = "1")] + pub incentivized_packet: ::core::option::Option, +} +/// QueryIncentivizedPacketsForChannelRequest defines the request type for querying for all incentivized packets +/// for a specific channel +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest")] +#[proto_query( + path = "/ibc.applications.fee.v1.Query/IncentivizedPacketsForChannel", + response_type = QueryIncentivizedPacketsForChannelResponse +)] +pub struct QueryIncentivizedPacketsForChannelRequest { + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "1")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + #[prost(string, tag = "2")] + pub port_id: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub channel_id: ::prost::alloc::string::String, + /// Height to query at + #[prost(uint64, tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub query_height: u64, +} +/// QueryIncentivizedPacketsResponse defines the response type for the incentivized packets RPC +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse")] +pub struct QueryIncentivizedPacketsForChannelResponse { + /// Map of all incentivized_packets + #[prost(message, repeated, tag = "1")] + pub incentivized_packets: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageResponse, + >, +} +/// QueryTotalRecvFeesRequest defines the request type for the TotalRecvFees rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.QueryTotalRecvFeesRequest")] +#[proto_query( + path = "/ibc.applications.fee.v1.Query/TotalRecvFees", + response_type = QueryTotalRecvFeesResponse +)] +pub struct QueryTotalRecvFeesRequest { + /// the packet identifier for the associated fees + #[prost(message, optional, tag = "1")] + pub packet_id: ::core::option::Option, +} +/// QueryTotalRecvFeesResponse defines the response type for the TotalRecvFees rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.QueryTotalRecvFeesResponse")] +pub struct QueryTotalRecvFeesResponse { + /// the total packet receive fees + #[prost(message, repeated, tag = "1")] + pub recv_fees: + ::prost::alloc::vec::Vec, +} +/// QueryTotalAckFeesRequest defines the request type for the TotalAckFees rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.QueryTotalAckFeesRequest")] +#[proto_query( + path = "/ibc.applications.fee.v1.Query/TotalAckFees", + response_type = QueryTotalAckFeesResponse +)] +pub struct QueryTotalAckFeesRequest { + /// the packet identifier for the associated fees + #[prost(message, optional, tag = "1")] + pub packet_id: ::core::option::Option, +} +/// QueryTotalAckFeesResponse defines the response type for the TotalAckFees rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.QueryTotalAckFeesResponse")] +pub struct QueryTotalAckFeesResponse { + /// the total packet acknowledgement fees + #[prost(message, repeated, tag = "1")] + pub ack_fees: ::prost::alloc::vec::Vec, +} +/// QueryTotalTimeoutFeesRequest defines the request type for the TotalTimeoutFees rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest")] +#[proto_query( + path = "/ibc.applications.fee.v1.Query/TotalTimeoutFees", + response_type = QueryTotalTimeoutFeesResponse +)] +pub struct QueryTotalTimeoutFeesRequest { + /// the packet identifier for the associated fees + #[prost(message, optional, tag = "1")] + pub packet_id: ::core::option::Option, +} +/// QueryTotalTimeoutFeesResponse defines the response type for the TotalTimeoutFees rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse")] +pub struct QueryTotalTimeoutFeesResponse { + /// the total packet timeout fees + #[prost(message, repeated, tag = "1")] + pub timeout_fees: + ::prost::alloc::vec::Vec, +} +/// QueryPayeeRequest defines the request type for the Payee rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.QueryPayeeRequest")] +#[proto_query( + path = "/ibc.applications.fee.v1.Query/Payee", + response_type = QueryPayeeResponse +)] +pub struct QueryPayeeRequest { + /// unique channel identifier + #[prost(string, tag = "1")] + pub channel_id: ::prost::alloc::string::String, + /// the relayer address to which the distribution address is registered + #[prost(string, tag = "2")] + pub relayer: ::prost::alloc::string::String, +} +/// QueryPayeeResponse defines the response type for the Payee rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.QueryPayeeResponse")] +pub struct QueryPayeeResponse { + /// the payee address to which packet fees are paid out + #[prost(string, tag = "1")] + pub payee_address: ::prost::alloc::string::String, +} +/// QueryCounterpartyPayeeRequest defines the request type for the CounterpartyPayee rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.QueryCounterpartyPayeeRequest")] +#[proto_query( + path = "/ibc.applications.fee.v1.Query/CounterpartyPayee", + response_type = QueryCounterpartyPayeeResponse +)] +pub struct QueryCounterpartyPayeeRequest { + /// unique channel identifier + #[prost(string, tag = "1")] + pub channel_id: ::prost::alloc::string::String, + /// the relayer address to which the counterparty is registered + #[prost(string, tag = "2")] + pub relayer: ::prost::alloc::string::String, +} +/// QueryCounterpartyPayeeResponse defines the response type for the CounterpartyPayee rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.QueryCounterpartyPayeeResponse")] +pub struct QueryCounterpartyPayeeResponse { + /// the counterparty payee address used to compensate forward relaying + #[prost(string, tag = "1")] + pub counterparty_payee: ::prost::alloc::string::String, +} +/// QueryFeeEnabledChannelsRequest defines the request type for the FeeEnabledChannels rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest")] +#[proto_query( + path = "/ibc.applications.fee.v1.Query/FeeEnabledChannels", + response_type = QueryFeeEnabledChannelsResponse +)] +pub struct QueryFeeEnabledChannelsRequest { + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "1")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + /// block height at which to query + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub query_height: u64, +} +/// QueryFeeEnabledChannelsResponse defines the response type for the FeeEnabledChannels rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse")] +pub struct QueryFeeEnabledChannelsResponse { + /// list of fee enabled channels + #[prost(message, repeated, tag = "1")] + pub fee_enabled_channels: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageResponse, + >, +} +/// QueryFeeEnabledChannelRequest defines the request type for the FeeEnabledChannel rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.QueryFeeEnabledChannelRequest")] +#[proto_query( + path = "/ibc.applications.fee.v1.Query/FeeEnabledChannel", + response_type = QueryFeeEnabledChannelResponse +)] +pub struct QueryFeeEnabledChannelRequest { + /// unique port identifier + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + /// unique channel identifier + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, +} +/// QueryFeeEnabledChannelResponse defines the response type for the FeeEnabledChannel rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.fee.v1.QueryFeeEnabledChannelResponse")] +pub struct QueryFeeEnabledChannelResponse { + /// boolean flag representing the fee enabled channel status + #[prost(bool, tag = "1")] + pub fee_enabled: bool, +} +/// MsgRegisterPayee defines the request type for the RegisterPayee rpc #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -53,17 +737,20 @@ pub struct PacketFee { )] #[proto_message(type_url = "/ibc.applications.fee.v1.MsgRegisterPayee")] pub struct MsgRegisterPayee { + /// unique port identifier #[prost(string, tag = "1")] - #[serde(alias = "portID")] pub port_id: ::prost::alloc::string::String, + /// unique channel identifier #[prost(string, tag = "2")] - #[serde(alias = "channelID")] pub channel_id: ::prost::alloc::string::String, + /// the relayer address #[prost(string, tag = "3")] pub relayer: ::prost::alloc::string::String, + /// the payee address #[prost(string, tag = "4")] pub payee: ::prost::alloc::string::String, } +/// MsgRegisterPayeeResponse defines the response type for the RegisterPayee rpc #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -77,6 +764,7 @@ pub struct MsgRegisterPayee { )] #[proto_message(type_url = "/ibc.applications.fee.v1.MsgRegisterPayeeResponse")] pub struct MsgRegisterPayeeResponse {} +/// MsgRegisterCounterpartyPayee defines the request type for the RegisterCounterpartyPayee rpc #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -90,17 +778,20 @@ pub struct MsgRegisterPayeeResponse {} )] #[proto_message(type_url = "/ibc.applications.fee.v1.MsgRegisterCounterpartyPayee")] pub struct MsgRegisterCounterpartyPayee { + /// unique port identifier #[prost(string, tag = "1")] - #[serde(alias = "portID")] pub port_id: ::prost::alloc::string::String, + /// unique channel identifier #[prost(string, tag = "2")] - #[serde(alias = "channelID")] pub channel_id: ::prost::alloc::string::String, + /// the relayer address #[prost(string, tag = "3")] pub relayer: ::prost::alloc::string::String, + /// the counterparty payee address #[prost(string, tag = "4")] pub counterparty_payee: ::prost::alloc::string::String, } +/// MsgRegisterCounterpartyPayeeResponse defines the response type for the RegisterCounterpartyPayee rpc #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -114,6 +805,9 @@ pub struct MsgRegisterCounterpartyPayee { )] #[proto_message(type_url = "/ibc.applications.fee.v1.MsgRegisterCounterpartyPayeeResponse")] pub struct MsgRegisterCounterpartyPayeeResponse {} +/// MsgPayPacketFee defines the request type for the PayPacketFee rpc +/// This Msg can be used to pay for a packet at the next sequence send & should be combined with the Msg that will be +/// paid for #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -127,19 +821,23 @@ pub struct MsgRegisterCounterpartyPayeeResponse {} )] #[proto_message(type_url = "/ibc.applications.fee.v1.MsgPayPacketFee")] pub struct MsgPayPacketFee { + /// fee encapsulates the recv, ack and timeout fees associated with an IBC packet #[prost(message, optional, tag = "1")] pub fee: ::core::option::Option, + /// the source port unique identifier #[prost(string, tag = "2")] - #[serde(alias = "source_portID")] pub source_port_id: ::prost::alloc::string::String, + /// the source channel unique identifer #[prost(string, tag = "3")] - #[serde(alias = "source_channelID")] pub source_channel_id: ::prost::alloc::string::String, + /// account address to refund fee if necessary #[prost(string, tag = "4")] pub signer: ::prost::alloc::string::String, + /// optional list of relayers permitted to the receive packet fees #[prost(string, repeated, tag = "5")] pub relayers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +/// MsgPayPacketFeeResponse defines the response type for the PayPacketFee rpc #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -153,6 +851,8 @@ pub struct MsgPayPacketFee { )] #[proto_message(type_url = "/ibc.applications.fee.v1.MsgPayPacketFeeResponse")] pub struct MsgPayPacketFeeResponse {} +/// MsgPayPacketFeeAsync defines the request type for the PayPacketFeeAsync rpc +/// This Msg can be used to pay for a packet at a specified sequence (instead of the next sequence send) #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -166,12 +866,14 @@ pub struct MsgPayPacketFeeResponse {} )] #[proto_message(type_url = "/ibc.applications.fee.v1.MsgPayPacketFeeAsync")] pub struct MsgPayPacketFeeAsync { + /// unique packet identifier comprised of the channel ID, port ID and sequence #[prost(message, optional, tag = "1")] - #[serde(alias = "packetID")] pub packet_id: ::core::option::Option, + /// the packet fee associated with a particular IBC packet #[prost(message, optional, tag = "2")] pub packet_fee: ::core::option::Option, } +/// MsgPayPacketFeeAsyncResponse defines the response type for the PayPacketFeeAsync rpc #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -192,4 +894,109 @@ impl<'a, Q: cosmwasm_std::CustomQuery> FeeQuerier<'a, Q> { pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self { Self { querier } } + pub fn incentivized_packets( + &self, + pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + query_height: u64, + ) -> Result { + QueryIncentivizedPacketsRequest { + pagination, + query_height, + } + .query(self.querier) + } + pub fn incentivized_packet( + &self, + packet_id: ::core::option::Option, + query_height: u64, + ) -> Result { + QueryIncentivizedPacketRequest { + packet_id, + query_height, + } + .query(self.querier) + } + pub fn incentivized_packets_for_channel( + &self, + pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + port_id: ::prost::alloc::string::String, + channel_id: ::prost::alloc::string::String, + query_height: u64, + ) -> Result { + QueryIncentivizedPacketsForChannelRequest { + pagination, + port_id, + channel_id, + query_height, + } + .query(self.querier) + } + pub fn total_recv_fees( + &self, + packet_id: ::core::option::Option, + ) -> Result { + QueryTotalRecvFeesRequest { packet_id }.query(self.querier) + } + pub fn total_ack_fees( + &self, + packet_id: ::core::option::Option, + ) -> Result { + QueryTotalAckFeesRequest { packet_id }.query(self.querier) + } + pub fn total_timeout_fees( + &self, + packet_id: ::core::option::Option, + ) -> Result { + QueryTotalTimeoutFeesRequest { packet_id }.query(self.querier) + } + pub fn payee( + &self, + channel_id: ::prost::alloc::string::String, + relayer: ::prost::alloc::string::String, + ) -> Result { + QueryPayeeRequest { + channel_id, + relayer, + } + .query(self.querier) + } + pub fn counterparty_payee( + &self, + channel_id: ::prost::alloc::string::String, + relayer: ::prost::alloc::string::String, + ) -> Result { + QueryCounterpartyPayeeRequest { + channel_id, + relayer, + } + .query(self.querier) + } + pub fn fee_enabled_channels( + &self, + pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + query_height: u64, + ) -> Result { + QueryFeeEnabledChannelsRequest { + pagination, + query_height, + } + .query(self.querier) + } + pub fn fee_enabled_channel( + &self, + port_id: ::prost::alloc::string::String, + channel_id: ::prost::alloc::string::String, + ) -> Result { + QueryFeeEnabledChannelRequest { + port_id, + channel_id, + } + .query(self.querier) + } } diff --git a/packages/provwasm-std/src/types/ibc/applications/interchain_accounts/controller/v1.rs b/packages/provwasm-std/src/types/ibc/applications/interchain_accounts/controller/v1.rs index 86dbb14b..9c27c056 100644 --- a/packages/provwasm-std/src/types/ibc/applications/interchain_accounts/controller/v1.rs +++ b/packages/provwasm-std/src/types/ibc/applications/interchain_accounts/controller/v1.rs @@ -1,4 +1,108 @@ use provwasm_proc_macro::CosmwasmExt; +/// Params defines the set of on-chain interchain accounts parameters. +/// The following parameters may be used to disable the controller submodule. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.interchain_accounts.controller.v1.Params")] +pub struct Params { + /// controller_enabled enables or disables the controller submodule. + #[prost(bool, tag = "1")] + pub controller_enabled: bool, +} +/// QueryInterchainAccountRequest is the request type for the Query/InterchainAccount 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 = "/ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountRequest" +)] +#[proto_query( + path = "/ibc.applications.interchain_accounts.controller.v1.Query/InterchainAccount", + response_type = QueryInterchainAccountResponse +)] +pub struct QueryInterchainAccountRequest { + #[prost(string, tag = "1")] + pub owner: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub connection_id: ::prost::alloc::string::String, +} +/// QueryInterchainAccountResponse the response type for the Query/InterchainAccount 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 = "/ibc.applications.interchain_accounts.controller.v1.QueryInterchainAccountResponse" +)] +pub struct QueryInterchainAccountResponse { + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, +} +/// QueryParamsRequest is the request type for the Query/Params 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 = "/ibc.applications.interchain_accounts.controller.v1.QueryParamsRequest" +)] +#[proto_query( + path = "/ibc.applications.interchain_accounts.controller.v1.Query/Params", + response_type = QueryParamsResponse +)] +pub struct QueryParamsRequest {} +/// QueryParamsResponse is the response type for the Query/Params 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 = "/ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse" +)] +pub struct QueryParamsResponse { + /// params defines the parameters of the module. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} +/// MsgRegisterInterchainAccount defines the payload for Msg/RegisterAccount #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -17,11 +121,20 @@ pub struct MsgRegisterInterchainAccount { #[prost(string, tag = "1")] pub owner: ::prost::alloc::string::String, #[prost(string, tag = "2")] - #[serde(alias = "connectionID")] pub connection_id: ::prost::alloc::string::String, #[prost(string, tag = "3")] pub version: ::prost::alloc::string::String, + #[prost( + enumeration = "super::super::super::super::core::channel::v1::Order", + tag = "4" + )] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub ordering: i32, } +/// MsgRegisterInterchainAccountResponse defines the response for Msg/RegisterAccount #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -38,9 +151,11 @@ pub struct MsgRegisterInterchainAccount { )] pub struct MsgRegisterInterchainAccountResponse { #[prost(string, tag = "1")] - #[serde(alias = "channelID")] pub channel_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub port_id: ::prost::alloc::string::String, } +/// MsgSendTx defines the payload for Msg/SendTx #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -57,10 +172,11 @@ pub struct MsgSendTx { #[prost(string, tag = "1")] pub owner: ::prost::alloc::string::String, #[prost(string, tag = "2")] - #[serde(alias = "connectionID")] pub connection_id: ::prost::alloc::string::String, #[prost(message, optional, tag = "3")] pub packet_data: ::core::option::Option, + /// Relative timeout timestamp provided will be added to the current block time during transaction execution. + /// The timeout timestamp must be non-zero. #[prost(uint64, tag = "4")] #[serde( serialize_with = "crate::serde::as_str::serialize", @@ -68,6 +184,7 @@ pub struct MsgSendTx { )] pub relative_timeout: u64, } +/// MsgSendTxResponse defines the response for MsgSendTx #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -88,6 +205,45 @@ pub struct MsgSendTxResponse { )] pub sequence: u64, } +/// MsgUpdateParams defines the payload for Msg/UpdateParams +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.interchain_accounts.controller.v1.MsgUpdateParams")] +pub struct MsgUpdateParams { + /// signer address + #[prost(string, tag = "1")] + pub signer: ::prost::alloc::string::String, + /// params defines the 27-interchain-accounts/controller parameters to update. + /// + /// NOTE: All parameters must be supplied. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +/// MsgUpdateParamsResponse defines the response for Msg/UpdateParams +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message( + type_url = "/ibc.applications.interchain_accounts.controller.v1.MsgUpdateParamsResponse" +)] +pub struct MsgUpdateParamsResponse {} pub struct ControllerQuerier<'a, Q: cosmwasm_std::CustomQuery> { querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, } @@ -95,4 +251,18 @@ impl<'a, Q: cosmwasm_std::CustomQuery> ControllerQuerier<'a, Q> { pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self { Self { querier } } + pub fn interchain_account( + &self, + owner: ::prost::alloc::string::String, + connection_id: ::prost::alloc::string::String, + ) -> Result { + QueryInterchainAccountRequest { + owner, + connection_id, + } + .query(self.querier) + } + pub fn params(&self) -> Result { + QueryParamsRequest {}.query(self.querier) + } } diff --git a/packages/provwasm-std/src/types/ibc/applications/interchain_accounts/genesis/mod.rs b/packages/provwasm-std/src/types/ibc/applications/interchain_accounts/genesis/mod.rs new file mode 100644 index 00000000..a3a6d96c --- /dev/null +++ b/packages/provwasm-std/src/types/ibc/applications/interchain_accounts/genesis/mod.rs @@ -0,0 +1 @@ +pub mod v1; diff --git a/packages/provwasm-std/src/types/ibc/applications/interchain_accounts/genesis/v1.rs b/packages/provwasm-std/src/types/ibc/applications/interchain_accounts/genesis/v1.rs new file mode 100644 index 00000000..be3d671b --- /dev/null +++ b/packages/provwasm-std/src/types/ibc/applications/interchain_accounts/genesis/v1.rs @@ -0,0 +1,115 @@ +use provwasm_proc_macro::CosmwasmExt; +/// GenesisState defines the interchain accounts genesis state +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.interchain_accounts.genesis.v1.GenesisState")] +pub struct GenesisState { + #[prost(message, optional, tag = "1")] + pub controller_genesis_state: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub host_genesis_state: ::core::option::Option, +} +/// ControllerGenesisState defines the interchain accounts controller genesis state +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message( + type_url = "/ibc.applications.interchain_accounts.genesis.v1.ControllerGenesisState" +)] +pub struct ControllerGenesisState { + #[prost(message, repeated, tag = "1")] + pub active_channels: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "2")] + pub interchain_accounts: ::prost::alloc::vec::Vec, + #[prost(string, repeated, tag = "3")] + pub ports: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[prost(message, optional, tag = "4")] + pub params: ::core::option::Option, +} +/// HostGenesisState defines the interchain accounts host genesis state +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.interchain_accounts.genesis.v1.HostGenesisState")] +pub struct HostGenesisState { + #[prost(message, repeated, tag = "1")] + pub active_channels: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "2")] + pub interchain_accounts: ::prost::alloc::vec::Vec, + #[prost(string, tag = "3")] + pub port: ::prost::alloc::string::String, + #[prost(message, optional, tag = "4")] + pub params: ::core::option::Option, +} +/// ActiveChannel contains a connection ID, port ID and associated active channel ID, as well as a boolean flag to +/// indicate if the channel is middleware enabled +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.interchain_accounts.genesis.v1.ActiveChannel")] +pub struct ActiveChannel { + #[prost(string, tag = "1")] + pub connection_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub port_id: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub channel_id: ::prost::alloc::string::String, + #[prost(bool, tag = "4")] + pub is_middleware_enabled: bool, +} +/// RegisteredInterchainAccount contains a connection ID, port ID and associated interchain account address +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message( + type_url = "/ibc.applications.interchain_accounts.genesis.v1.RegisteredInterchainAccount" +)] +pub struct RegisteredInterchainAccount { + #[prost(string, tag = "1")] + pub connection_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub port_id: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub account_address: ::prost::alloc::string::String, +} diff --git a/packages/provwasm-std/src/types/ibc/applications/interchain_accounts/host/mod.rs b/packages/provwasm-std/src/types/ibc/applications/interchain_accounts/host/mod.rs new file mode 100644 index 00000000..a3a6d96c --- /dev/null +++ b/packages/provwasm-std/src/types/ibc/applications/interchain_accounts/host/mod.rs @@ -0,0 +1 @@ +pub mod v1; diff --git a/packages/provwasm-std/src/types/ibc/applications/interchain_accounts/host/v1.rs b/packages/provwasm-std/src/types/ibc/applications/interchain_accounts/host/v1.rs new file mode 100644 index 00000000..34cc978e --- /dev/null +++ b/packages/provwasm-std/src/types/ibc/applications/interchain_accounts/host/v1.rs @@ -0,0 +1,183 @@ +use provwasm_proc_macro::CosmwasmExt; +/// Params defines the set of on-chain interchain accounts parameters. +/// The following parameters may be used to disable the host submodule. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.interchain_accounts.host.v1.Params")] +pub struct Params { + /// host_enabled enables or disables the host submodule. + #[prost(bool, tag = "1")] + pub host_enabled: bool, + /// allow_messages defines a list of sdk message typeURLs allowed to be executed on a host chain. + #[prost(string, repeated, tag = "2")] + pub allow_messages: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// QueryRequest defines the parameters for a particular query request +/// by an interchain account. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.interchain_accounts.host.v1.QueryRequest")] +pub struct QueryRequest { + /// path defines the path of the query request as defined by ADR-021. + /// + #[prost(string, tag = "1")] + pub path: ::prost::alloc::string::String, + /// data defines the payload of the query request as defined by ADR-021. + /// + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, +} +/// QueryParamsRequest is the request type for the Query/Params 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 = "/ibc.applications.interchain_accounts.host.v1.QueryParamsRequest")] +#[proto_query( + path = "/ibc.applications.interchain_accounts.host.v1.Query/Params", + response_type = QueryParamsResponse +)] +pub struct QueryParamsRequest {} +/// QueryParamsResponse is the response type for the Query/Params 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 = "/ibc.applications.interchain_accounts.host.v1.QueryParamsResponse")] +pub struct QueryParamsResponse { + /// params defines the parameters of the module. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} +/// MsgUpdateParams defines the payload for Msg/UpdateParams +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.interchain_accounts.host.v1.MsgUpdateParams")] +pub struct MsgUpdateParams { + /// signer address + #[prost(string, tag = "1")] + pub signer: ::prost::alloc::string::String, + /// params defines the 27-interchain-accounts/host parameters to update. + /// + /// NOTE: All parameters must be supplied. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +/// MsgUpdateParamsResponse defines the response for Msg/UpdateParams +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.interchain_accounts.host.v1.MsgUpdateParamsResponse")] +pub struct MsgUpdateParamsResponse {} +/// MsgModuleQuerySafe defines the payload for Msg/ModuleQuerySafe +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.interchain_accounts.host.v1.MsgModuleQuerySafe")] +pub struct MsgModuleQuerySafe { + /// signer address + #[prost(string, tag = "1")] + pub signer: ::prost::alloc::string::String, + /// requests defines the module safe queries to execute. + #[prost(message, repeated, tag = "2")] + pub requests: ::prost::alloc::vec::Vec, +} +/// MsgModuleQuerySafeResponse defines the response for Msg/ModuleQuerySafe +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message( + type_url = "/ibc.applications.interchain_accounts.host.v1.MsgModuleQuerySafeResponse" +)] +pub struct MsgModuleQuerySafeResponse { + /// height at which the responses were queried + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: u64, + /// protobuf encoded responses for each query + #[prost(bytes = "vec", repeated, tag = "2")] + pub responses: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, +} +pub struct HostQuerier<'a, Q: cosmwasm_std::CustomQuery> { + querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, +} +impl<'a, Q: cosmwasm_std::CustomQuery> HostQuerier<'a, Q> { + pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self { + Self { querier } + } + pub fn params(&self) -> Result { + QueryParamsRequest {}.query(self.querier) + } +} diff --git a/packages/provwasm-std/src/types/ibc/applications/interchain_accounts/mod.rs b/packages/provwasm-std/src/types/ibc/applications/interchain_accounts/mod.rs index dd3c16f9..c91312e3 100644 --- a/packages/provwasm-std/src/types/ibc/applications/interchain_accounts/mod.rs +++ b/packages/provwasm-std/src/types/ibc/applications/interchain_accounts/mod.rs @@ -1,2 +1,4 @@ pub mod controller; +pub mod genesis; +pub mod host; pub mod v1; diff --git a/packages/provwasm-std/src/types/ibc/applications/interchain_accounts/v1.rs b/packages/provwasm-std/src/types/ibc/applications/interchain_accounts/v1.rs index 7ac7c11d..a78f2de2 100644 --- a/packages/provwasm-std/src/types/ibc/applications/interchain_accounts/v1.rs +++ b/packages/provwasm-std/src/types/ibc/applications/interchain_accounts/v1.rs @@ -1,4 +1,5 @@ use provwasm_proc_macro::CosmwasmExt; +/// InterchainAccountPacketData is comprised of a raw transaction, type of transaction and optional memo field. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -14,8 +15,8 @@ use provwasm_proc_macro::CosmwasmExt; pub struct InterchainAccountPacketData { #[prost(enumeration = "Type", tag = "1")] #[serde( - serialize_with = "Type::serialize", - deserialize_with = "Type::deserialize" + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" )] pub r#type: i32, #[prost(bytes = "vec", tag = "2")] @@ -27,11 +28,32 @@ pub struct InterchainAccountPacketData { #[prost(string, tag = "3")] pub memo: ::prost::alloc::string::String, } +/// CosmosTx contains a list of sdk.Msg's. It should be used when sending transactions to an SDK host chain. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.interchain_accounts.v1.CosmosTx")] +pub struct CosmosTx { + #[prost(message, repeated, tag = "1")] + pub messages: ::prost::alloc::vec::Vec, +} +/// Type defines a classification of message issued from a controller chain to its associated interchain accounts +/// host #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] #[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] pub enum Type { + /// Default zero value enumeration Unspecified = 0, + /// Execute a transaction on an interchain accounts host chain ExecuteTx = 1, } impl Type { @@ -53,27 +75,59 @@ impl Type { _ => None, } } - - pub fn serialize(v: &i32, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - let enum_value = Self::try_from(*v); - match enum_value { - Ok(v) => serializer.serialize_str(v.as_str_name()), - Err(e) => Err(serde::ser::Error::custom(e)), - } - } - - pub fn deserialize<'de, D>(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - use serde::de::Deserialize; - let s = String::deserialize(deserializer)?; - match Self::from_str_name(&s) { - Some(v) => Ok(v.into()), - None => Err(serde::de::Error::custom("unknown value")), - } - } +} +/// An InterchainAccount is defined as a BaseAccount & the address of the account owner on the controller chain +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.interchain_accounts.v1.InterchainAccount")] +pub struct InterchainAccount { + #[prost(message, optional, tag = "1")] + pub base_account: + ::core::option::Option, + #[prost(string, tag = "2")] + pub account_owner: ::prost::alloc::string::String, +} +/// Metadata defines a set of protocol specific data encoded into the ICS27 channel version bytestring +/// See ICS004: +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.interchain_accounts.v1.Metadata")] +pub struct Metadata { + /// version defines the ICS27 protocol version + #[prost(string, tag = "1")] + pub version: ::prost::alloc::string::String, + /// controller_connection_id is the connection identifier associated with the controller chain + #[prost(string, tag = "2")] + pub controller_connection_id: ::prost::alloc::string::String, + /// host_connection_id is the connection identifier associated with the host chain + #[prost(string, tag = "3")] + pub host_connection_id: ::prost::alloc::string::String, + /// address defines the interchain account address to be fulfilled upon the OnChanOpenTry handshake step + /// NOTE: the address field is empty on the OnChanOpenInit handshake step + #[prost(string, tag = "4")] + pub address: ::prost::alloc::string::String, + /// encoding defines the supported codec format + #[prost(string, tag = "5")] + pub encoding: ::prost::alloc::string::String, + /// tx_type defines the type of transactions the interchain account can execute + #[prost(string, tag = "6")] + pub tx_type: ::prost::alloc::string::String, } diff --git a/packages/provwasm-std/src/types/ibc/applications/transfer/mod.rs b/packages/provwasm-std/src/types/ibc/applications/transfer/mod.rs index a3a6d96c..ae6adc7c 100644 --- a/packages/provwasm-std/src/types/ibc/applications/transfer/mod.rs +++ b/packages/provwasm-std/src/types/ibc/applications/transfer/mod.rs @@ -1 +1,2 @@ pub mod v1; +pub mod v2; diff --git a/packages/provwasm-std/src/types/ibc/applications/transfer/v1.rs b/packages/provwasm-std/src/types/ibc/applications/transfer/v1.rs index 980f3fad..19f94115 100644 --- a/packages/provwasm-std/src/types/ibc/applications/transfer/v1.rs +++ b/packages/provwasm-std/src/types/ibc/applications/transfer/v1.rs @@ -1,4 +1,57 @@ use provwasm_proc_macro::CosmwasmExt; +/// Allocation defines the spend limit for a particular port and channel +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.transfer.v1.Allocation")] +pub struct Allocation { + /// the port on which the packet will be sent + #[prost(string, tag = "1")] + pub source_port: ::prost::alloc::string::String, + /// the channel by which the packet will be sent + #[prost(string, tag = "2")] + pub source_channel: ::prost::alloc::string::String, + /// spend limitation on the channel + #[prost(message, repeated, tag = "3")] + pub spend_limit: + ::prost::alloc::vec::Vec, + /// allow list of receivers, an empty allow list permits any receiver address + #[prost(string, repeated, tag = "4")] + pub allow_list: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// allow list of memo strings, an empty list prohibits all memo strings; + /// a list only with "*" permits any memo string + #[prost(string, repeated, tag = "5")] + pub allowed_packet_data: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// TransferAuthorization allows the grantee to spend up to spend_limit coins from +/// the granter's account for ibc transfer on a specific channel +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.transfer.v1.TransferAuthorization")] +pub struct TransferAuthorization { + /// port and channel amounts + #[prost(message, repeated, tag = "1")] + pub allocations: ::prost::alloc::vec::Vec, +} +/// DenomTrace contains the base denomination for ICS20 fungible tokens and the +/// source tracing information path. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -12,11 +65,68 @@ use provwasm_proc_macro::CosmwasmExt; )] #[proto_message(type_url = "/ibc.applications.transfer.v1.DenomTrace")] pub struct DenomTrace { + /// path defines the chain of port/channel identifiers used for tracing the + /// source of the fungible token. #[prost(string, tag = "1")] pub path: ::prost::alloc::string::String, + /// base denomination of the relayed fungible token. #[prost(string, tag = "2")] pub base_denom: ::prost::alloc::string::String, } +/// Params defines the set of IBC transfer parameters. +/// NOTE: To prevent a single token from being transferred, set the +/// TransfersEnabled parameter to true and then set the bank module's SendEnabled +/// parameter for the denomination to false. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.transfer.v1.Params")] +pub struct Params { + /// send_enabled enables or disables all cross-chain token transfers from this + /// chain. + #[prost(bool, tag = "1")] + pub send_enabled: bool, + /// receive_enabled enables or disables all cross-chain token transfers to this + /// chain. + #[prost(bool, tag = "2")] + pub receive_enabled: bool, +} +/// GenesisState defines the ibc-transfer genesis state +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.transfer.v1.GenesisState")] +pub struct GenesisState { + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] + pub denom_traces: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "3")] + pub params: ::core::option::Option, + /// total_escrowed contains the total amount of tokens escrowed + /// by the transfer module + #[prost(message, repeated, tag = "4")] + pub total_escrowed: + ::prost::alloc::vec::Vec, +} +/// QueryDenomTraceRequest is the request type for the Query/DenomTrace RPC +/// method #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -34,9 +144,12 @@ pub struct DenomTrace { response_type = QueryDenomTraceResponse )] pub struct QueryDenomTraceRequest { + /// hash (in hex format) or denom (full denom with ibc prefix) of the denomination trace information. #[prost(string, tag = "1")] pub hash: ::prost::alloc::string::String, } +/// QueryDenomTraceResponse is the response type for the Query/DenomTrace RPC +/// method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -50,9 +163,221 @@ pub struct QueryDenomTraceRequest { )] #[proto_message(type_url = "/ibc.applications.transfer.v1.QueryDenomTraceResponse")] pub struct QueryDenomTraceResponse { + /// denom_trace returns the requested denomination trace information. #[prost(message, optional, tag = "1")] pub denom_trace: ::core::option::Option, } +/// QueryConnectionsRequest is the request type for the Query/DenomTraces 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 = "/ibc.applications.transfer.v1.QueryDenomTracesRequest")] +#[proto_query( + path = "/ibc.applications.transfer.v1.Query/DenomTraces", + response_type = QueryDenomTracesResponse +)] +pub struct QueryDenomTracesRequest { + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "1")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, +} +/// QueryConnectionsResponse is the response type for the Query/DenomTraces 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 = "/ibc.applications.transfer.v1.QueryDenomTracesResponse")] +pub struct QueryDenomTracesResponse { + /// denom_traces returns all denominations trace information. + #[prost(message, repeated, tag = "1")] + pub denom_traces: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageResponse, + >, +} +/// QueryParamsRequest is the request type for the Query/Params 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 = "/ibc.applications.transfer.v1.QueryParamsRequest")] +#[proto_query( + path = "/ibc.applications.transfer.v1.Query/Params", + response_type = QueryParamsResponse +)] +pub struct QueryParamsRequest {} +/// QueryParamsResponse is the response type for the Query/Params 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 = "/ibc.applications.transfer.v1.QueryParamsResponse")] +pub struct QueryParamsResponse { + /// params defines the parameters of the module. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} +/// QueryDenomHashRequest is the request type for the Query/DenomHash 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 = "/ibc.applications.transfer.v1.QueryDenomHashRequest")] +#[proto_query( + path = "/ibc.applications.transfer.v1.Query/DenomHash", + response_type = QueryDenomHashResponse +)] +pub struct QueryDenomHashRequest { + /// The denomination trace (\[port_id\]/[channel_id])+/\[denom\] + #[prost(string, tag = "1")] + pub trace: ::prost::alloc::string::String, +} +/// QueryDenomHashResponse is the response type for the Query/DenomHash 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 = "/ibc.applications.transfer.v1.QueryDenomHashResponse")] +pub struct QueryDenomHashResponse { + /// hash (in hex format) of the denomination trace information. + #[prost(string, tag = "1")] + pub hash: ::prost::alloc::string::String, +} +/// QueryEscrowAddressRequest is the request type for the EscrowAddress 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 = "/ibc.applications.transfer.v1.QueryEscrowAddressRequest")] +#[proto_query( + path = "/ibc.applications.transfer.v1.Query/EscrowAddress", + response_type = QueryEscrowAddressResponse +)] +pub struct QueryEscrowAddressRequest { + /// unique port identifier + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + /// unique channel identifier + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, +} +/// QueryEscrowAddressResponse is the response type of the EscrowAddress 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 = "/ibc.applications.transfer.v1.QueryEscrowAddressResponse")] +pub struct QueryEscrowAddressResponse { + /// the escrow account address + #[prost(string, tag = "1")] + pub escrow_address: ::prost::alloc::string::String, +} +/// QueryTotalEscrowForDenomRequest is the request type for TotalEscrowForDenom 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 = "/ibc.applications.transfer.v1.QueryTotalEscrowForDenomRequest")] +#[proto_query( + path = "/ibc.applications.transfer.v1.Query/TotalEscrowForDenom", + response_type = QueryTotalEscrowForDenomResponse +)] +pub struct QueryTotalEscrowForDenomRequest { + #[prost(string, tag = "1")] + pub denom: ::prost::alloc::string::String, +} +/// QueryTotalEscrowForDenomResponse is the response type for TotalEscrowForDenom 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 = "/ibc.applications.transfer.v1.QueryTotalEscrowForDenomResponse")] +pub struct QueryTotalEscrowForDenomResponse { + #[prost(message, optional, tag = "1")] + pub amount: ::core::option::Option, +} +/// MsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between +/// ICS20 enabled chains. See ICS Spec here: +/// #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -66,27 +391,38 @@ pub struct QueryDenomTraceResponse { )] #[proto_message(type_url = "/ibc.applications.transfer.v1.MsgTransfer")] pub struct MsgTransfer { + /// the port on which the packet will be sent #[prost(string, tag = "1")] pub source_port: ::prost::alloc::string::String, + /// the channel by which the packet will be sent #[prost(string, tag = "2")] pub source_channel: ::prost::alloc::string::String, + /// the tokens to be transferred #[prost(message, optional, tag = "3")] pub token: ::core::option::Option, + /// the sender address #[prost(string, tag = "4")] pub sender: ::prost::alloc::string::String, + /// the recipient address on the destination chain #[prost(string, tag = "5")] pub receiver: ::prost::alloc::string::String, + /// Timeout height relative to the current block height. + /// The timeout is disabled when set to 0. #[prost(message, optional, tag = "6")] pub timeout_height: ::core::option::Option, + /// Timeout timestamp in absolute nanoseconds since unix epoch. + /// The timeout is disabled when set to 0. #[prost(uint64, tag = "7")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub timeout_timestamp: u64, + /// optional memo #[prost(string, tag = "8")] pub memo: ::prost::alloc::string::String, } +/// MsgTransferResponse defines the Msg/Transfer response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -100,6 +436,7 @@ pub struct MsgTransfer { )] #[proto_message(type_url = "/ibc.applications.transfer.v1.MsgTransferResponse")] pub struct MsgTransferResponse { + /// sequence number of the transfer packet sent #[prost(uint64, tag = "1")] #[serde( serialize_with = "crate::serde::as_str::serialize", @@ -107,6 +444,44 @@ pub struct MsgTransferResponse { )] pub sequence: u64, } +/// MsgUpdateParams is the Msg/UpdateParams request 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 = "/ibc.applications.transfer.v1.MsgUpdateParams")] +pub struct MsgUpdateParams { + /// signer address + #[prost(string, tag = "1")] + pub signer: ::prost::alloc::string::String, + /// params defines the transfer parameters to update. + /// + /// NOTE: All parameters must be supplied. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +/// MsgUpdateParamsResponse defines the response structure for executing a +/// MsgUpdateParams message. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.transfer.v1.MsgUpdateParamsResponse")] +pub struct MsgUpdateParamsResponse {} pub struct TransferQuerier<'a, Q: cosmwasm_std::CustomQuery> { querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, } @@ -114,10 +489,44 @@ impl<'a, Q: cosmwasm_std::CustomQuery> TransferQuerier<'a, Q> { pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self { Self { querier } } + pub fn denom_traces( + &self, + pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + ) -> Result { + QueryDenomTracesRequest { pagination }.query(self.querier) + } pub fn denom_trace( &self, hash: ::prost::alloc::string::String, ) -> Result { QueryDenomTraceRequest { hash }.query(self.querier) } + pub fn params(&self) -> Result { + QueryParamsRequest {}.query(self.querier) + } + pub fn denom_hash( + &self, + trace: ::prost::alloc::string::String, + ) -> Result { + QueryDenomHashRequest { trace }.query(self.querier) + } + pub fn escrow_address( + &self, + port_id: ::prost::alloc::string::String, + channel_id: ::prost::alloc::string::String, + ) -> Result { + QueryEscrowAddressRequest { + port_id, + channel_id, + } + .query(self.querier) + } + pub fn total_escrow_for_denom( + &self, + denom: ::prost::alloc::string::String, + ) -> Result { + QueryTotalEscrowForDenomRequest { denom }.query(self.querier) + } } diff --git a/packages/provwasm-std/src/types/ibc/applications/transfer/v2.rs b/packages/provwasm-std/src/types/ibc/applications/transfer/v2.rs new file mode 100644 index 00000000..622cd1ac --- /dev/null +++ b/packages/provwasm-std/src/types/ibc/applications/transfer/v2.rs @@ -0,0 +1,33 @@ +use provwasm_proc_macro::CosmwasmExt; +/// FungibleTokenPacketData defines a struct for the packet payload +/// See FungibleTokenPacketData spec: +/// +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.applications.transfer.v2.FungibleTokenPacketData")] +pub struct FungibleTokenPacketData { + /// the token denomination to be transferred + #[prost(string, tag = "1")] + pub denom: ::prost::alloc::string::String, + /// the token amount to be transferred + #[prost(string, tag = "2")] + pub amount: ::prost::alloc::string::String, + /// the sender address + #[prost(string, tag = "3")] + pub sender: ::prost::alloc::string::String, + /// the recipient address on the destination chain + #[prost(string, tag = "4")] + pub receiver: ::prost::alloc::string::String, + /// optional memo + #[prost(string, tag = "5")] + pub memo: ::prost::alloc::string::String, +} diff --git a/packages/provwasm-std/src/types/ibc/core/channel/v1.rs b/packages/provwasm-std/src/types/ibc/core/channel/v1.rs index d1f27268..c66e8447 100644 --- a/packages/provwasm-std/src/types/ibc/core/channel/v1.rs +++ b/packages/provwasm-std/src/types/ibc/core/channel/v1.rs @@ -1,4 +1,222 @@ use provwasm_proc_macro::CosmwasmExt; +/// Channel defines pipeline for exactly-once packet delivery between specific +/// modules on separate blockchains, which has at least one end capable of +/// sending packets and one end capable of receiving packets. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.Channel")] +pub struct Channel { + /// current state of the channel end + #[prost(enumeration = "State", tag = "1")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub state: i32, + /// whether the channel is ordered or unordered + #[prost(enumeration = "Order", tag = "2")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub ordering: i32, + /// counterparty channel end + #[prost(message, optional, tag = "3")] + pub counterparty: ::core::option::Option, + /// list of connection identifiers, in order, along which packets sent on + /// this channel will travel + #[prost(string, repeated, tag = "4")] + pub connection_hops: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// opaque channel version, which is agreed upon during the handshake + #[prost(string, tag = "5")] + pub version: ::prost::alloc::string::String, + /// upgrade sequence indicates the latest upgrade attempt performed by this channel + /// the value of 0 indicates the channel has never been upgraded + #[prost(uint64, tag = "6")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub upgrade_sequence: u64, +} +/// IdentifiedChannel defines a channel with additional port and channel +/// identifier fields. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.IdentifiedChannel")] +pub struct IdentifiedChannel { + /// current state of the channel end + #[prost(enumeration = "State", tag = "1")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub state: i32, + /// whether the channel is ordered or unordered + #[prost(enumeration = "Order", tag = "2")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub ordering: i32, + /// counterparty channel end + #[prost(message, optional, tag = "3")] + pub counterparty: ::core::option::Option, + /// list of connection identifiers, in order, along which packets sent on + /// this channel will travel + #[prost(string, repeated, tag = "4")] + pub connection_hops: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// opaque channel version, which is agreed upon during the handshake + #[prost(string, tag = "5")] + pub version: ::prost::alloc::string::String, + /// port identifier + #[prost(string, tag = "6")] + pub port_id: ::prost::alloc::string::String, + /// channel identifier + #[prost(string, tag = "7")] + pub channel_id: ::prost::alloc::string::String, + /// upgrade sequence indicates the latest upgrade attempt performed by this channel + /// the value of 0 indicates the channel has never been upgraded + #[prost(uint64, tag = "8")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub upgrade_sequence: u64, +} +/// Counterparty defines a channel end counterparty +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.Counterparty")] +pub struct Counterparty { + /// port on the counterparty chain which owns the other end of the channel. + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + /// channel end on the counterparty chain + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, +} +/// Packet defines a type that carries data across different chains through IBC +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.Packet")] +pub struct Packet { + /// number corresponds to the order of sends and receives, where a Packet + /// with an earlier sequence number must be sent and received before a Packet + /// with a later sequence number. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub sequence: u64, + /// identifies the port on the sending chain. + #[prost(string, tag = "2")] + pub source_port: ::prost::alloc::string::String, + /// identifies the channel end on the sending chain. + #[prost(string, tag = "3")] + pub source_channel: ::prost::alloc::string::String, + /// identifies the port on the receiving chain. + #[prost(string, tag = "4")] + pub destination_port: ::prost::alloc::string::String, + /// identifies the channel end on the receiving chain. + #[prost(string, tag = "5")] + pub destination_channel: ::prost::alloc::string::String, + /// actual opaque bytes transferred directly to the application module + #[prost(bytes = "vec", tag = "6")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, + /// block height after which the packet times out + #[prost(message, optional, tag = "7")] + pub timeout_height: ::core::option::Option, + /// block timestamp (in nanoseconds) after which the packet times out + #[prost(uint64, tag = "8")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub timeout_timestamp: u64, +} +/// PacketState defines the generic type necessary to retrieve and store +/// packet commitments, acknowledgements, and receipts. +/// Caller is responsible for knowing the context necessary to interpret this +/// state as a commitment, acknowledgement, or a receipt. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.PacketState")] +pub struct PacketState { + /// channel port identifier. + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + /// channel unique identifier. + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, + /// packet sequence. + #[prost(uint64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub sequence: u64, + /// embedded data that represents packet state. + #[prost(bytes = "vec", tag = "4")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, +} +/// PacketId is an identifer for a unique Packet +/// Source chains refer to packets by source port/channel +/// Destination chains refer to packets by destination port/channel #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -12,18 +230,2344 @@ use provwasm_proc_macro::CosmwasmExt; )] #[proto_message(type_url = "/ibc.core.channel.v1.PacketId")] pub struct PacketId { + /// channel port identifier + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + /// channel unique identifier + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, + /// packet sequence + #[prost(uint64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub sequence: u64, +} +/// Acknowledgement is the recommended acknowledgement format to be used by +/// app-specific protocols. +/// NOTE: The field numbers 21 and 22 were explicitly chosen to avoid accidental +/// conflicts with other protobuf message formats used for acknowledgements. +/// The first byte of any message with this format will be the non-ASCII values +/// `0xaa` (result) or `0xb2` (error). Implemented as defined by ICS: +/// +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.Acknowledgement")] +pub struct Acknowledgement { + /// response contains either a result or an error and must be non-empty + #[prost(oneof = "acknowledgement::Response", tags = "21, 22")] + pub response: ::core::option::Option, +} +/// Nested message and enum types in `Acknowledgement`. +pub mod acknowledgement { + use provwasm_proc_macro::CosmwasmExt; + /// response contains either a result or an error and must be non-empty + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive( + Clone, + PartialEq, + Eq, + ::prost::Oneof, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + )] + pub enum Response { + #[prost(bytes, tag = "21")] + Result(::prost::alloc::vec::Vec), + #[prost(string, tag = "22")] + Error(::prost::alloc::string::String), + } +} +/// Timeout defines an execution deadline structure for 04-channel handlers. +/// This includes packet lifecycle handlers as well as the upgrade handshake handlers. +/// A valid Timeout contains either one or both of a timestamp and block height (sequence). +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.Timeout")] +pub struct Timeout { + /// block height after which the packet or upgrade times out + #[prost(message, optional, tag = "1")] + pub height: ::core::option::Option, + /// block timestamp (in nanoseconds) after which the packet or upgrade times out + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub timestamp: u64, +} +/// Params defines the set of IBC channel parameters. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.Params")] +pub struct Params { + /// the relative timeout after which channel upgrades will time out. + #[prost(message, optional, tag = "1")] + pub upgrade_timeout: ::core::option::Option, +} +/// State defines if a channel is in one of the following states: +/// CLOSED, INIT, TRYOPEN, OPEN, FLUSHING, FLUSHCOMPLETE or UNINITIALIZED. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +pub enum State { + /// Default State + UninitializedUnspecified = 0, + /// A channel has just started the opening handshake. + Init = 1, + /// A channel has acknowledged the handshake step on the counterparty chain. + Tryopen = 2, + /// A channel has completed the handshake. Open channels are + /// ready to send and receive packets. + Open = 3, + /// A channel has been closed and can no longer be used to send or receive + /// packets. + Closed = 4, + /// A channel has just accepted the upgrade handshake attempt and is flushing in-flight packets. + Flushing = 5, + /// A channel has just completed flushing any in-flight packets. + Flushcomplete = 6, +} +impl State { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + State::UninitializedUnspecified => "STATE_UNINITIALIZED_UNSPECIFIED", + State::Init => "STATE_INIT", + State::Tryopen => "STATE_TRYOPEN", + State::Open => "STATE_OPEN", + State::Closed => "STATE_CLOSED", + State::Flushing => "STATE_FLUSHING", + State::Flushcomplete => "STATE_FLUSHCOMPLETE", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "STATE_UNINITIALIZED_UNSPECIFIED" => Some(Self::UninitializedUnspecified), + "STATE_INIT" => Some(Self::Init), + "STATE_TRYOPEN" => Some(Self::Tryopen), + "STATE_OPEN" => Some(Self::Open), + "STATE_CLOSED" => Some(Self::Closed), + "STATE_FLUSHING" => Some(Self::Flushing), + "STATE_FLUSHCOMPLETE" => Some(Self::Flushcomplete), + _ => None, + } + } +} +/// Order defines if a channel is ORDERED or UNORDERED +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +pub enum Order { + /// zero-value for channel ordering + NoneUnspecified = 0, + /// packets can be delivered in any order, which may differ from the order in + /// which they were sent. + Unordered = 1, + /// packets are delivered exactly in the order which they were sent + Ordered = 2, +} +impl Order { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Order::NoneUnspecified => "ORDER_NONE_UNSPECIFIED", + Order::Unordered => "ORDER_UNORDERED", + Order::Ordered => "ORDER_ORDERED", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "ORDER_NONE_UNSPECIFIED" => Some(Self::NoneUnspecified), + "ORDER_UNORDERED" => Some(Self::Unordered), + "ORDER_ORDERED" => Some(Self::Ordered), + _ => None, + } + } +} +/// GenesisState defines the ibc channel submodule's genesis state. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.GenesisState")] +pub struct GenesisState { + #[prost(message, repeated, tag = "1")] + pub channels: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "2")] + pub acknowledgements: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "3")] + pub commitments: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "4")] + pub receipts: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "5")] + pub send_sequences: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "6")] + pub recv_sequences: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "7")] + pub ack_sequences: ::prost::alloc::vec::Vec, + /// the sequence for the next generated channel identifier + #[prost(uint64, tag = "8")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub next_channel_sequence: u64, + #[prost(message, optional, tag = "9")] + pub params: ::core::option::Option, +} +/// PacketSequence defines the genesis type necessary to retrieve and store +/// next send and receive sequences. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.PacketSequence")] +pub struct PacketSequence { + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, + #[prost(uint64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub sequence: u64, +} +/// Upgrade is a verifiable type which contains the relevant information +/// for an attempted upgrade. It provides the proposed changes to the channel +/// end, the timeout for this upgrade attempt and the next packet sequence +/// which allows the counterparty to efficiently know the highest sequence it has received. +/// The next sequence send is used for pruning and upgrading from unordered to ordered channels. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.Upgrade")] +pub struct Upgrade { + #[prost(message, optional, tag = "1")] + pub fields: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub timeout: ::core::option::Option, + #[prost(uint64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub next_sequence_send: u64, +} +/// UpgradeFields are the fields in a channel end which may be changed +/// during a channel upgrade. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.UpgradeFields")] +pub struct UpgradeFields { + #[prost(enumeration = "Order", tag = "1")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub ordering: i32, + #[prost(string, repeated, tag = "2")] + pub connection_hops: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[prost(string, tag = "3")] + pub version: ::prost::alloc::string::String, +} +/// ErrorReceipt defines a type which encapsulates the upgrade sequence and error associated with the +/// upgrade handshake failure. When a channel upgrade handshake is aborted both chains are expected to increment to the +/// next sequence. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.ErrorReceipt")] +pub struct ErrorReceipt { + /// the channel upgrade sequence + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub sequence: u64, + /// the error message detailing the cause of failure + #[prost(string, tag = "2")] + pub message: ::prost::alloc::string::String, +} +/// QueryChannelRequest is the request type for the Query/Channel 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 = "/ibc.core.channel.v1.QueryChannelRequest")] +#[proto_query( + path = "/ibc.core.channel.v1.Query/Channel", + response_type = QueryChannelResponse +)] +pub struct QueryChannelRequest { + /// port unique identifier + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + /// channel unique identifier + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, +} +/// QueryChannelResponse is the response type for the Query/Channel RPC method. +/// Besides the Channel end, it includes a proof and the height from which the +/// proof was retrieved. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.QueryChannelResponse")] +pub struct QueryChannelResponse { + /// channel associated with the request identifiers + #[prost(message, optional, tag = "1")] + pub channel: ::core::option::Option, + /// merkle proof of existence + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub proof: ::prost::alloc::vec::Vec, + /// height at which the proof was retrieved + #[prost(message, optional, tag = "3")] + pub proof_height: ::core::option::Option, +} +/// QueryChannelsRequest is the request type for the Query/Channels 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 = "/ibc.core.channel.v1.QueryChannelsRequest")] +#[proto_query( + path = "/ibc.core.channel.v1.Query/Channels", + response_type = QueryChannelsResponse +)] +pub struct QueryChannelsRequest { + /// pagination request + #[prost(message, optional, tag = "1")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, +} +/// QueryChannelsResponse is the response type for the Query/Channels 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 = "/ibc.core.channel.v1.QueryChannelsResponse")] +pub struct QueryChannelsResponse { + /// list of stored channels of the chain. + #[prost(message, repeated, tag = "1")] + pub channels: ::prost::alloc::vec::Vec, + /// pagination response + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageResponse, + >, + /// query block height + #[prost(message, optional, tag = "3")] + pub height: ::core::option::Option, +} +/// QueryConnectionChannelsRequest is the request type for the +/// Query/QueryConnectionChannels 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 = "/ibc.core.channel.v1.QueryConnectionChannelsRequest")] +#[proto_query( + path = "/ibc.core.channel.v1.Query/ConnectionChannels", + response_type = QueryConnectionChannelsResponse +)] +pub struct QueryConnectionChannelsRequest { + /// connection unique identifier + #[prost(string, tag = "1")] + pub connection: ::prost::alloc::string::String, + /// pagination request + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, +} +/// QueryConnectionChannelsResponse is the Response type for the +/// Query/QueryConnectionChannels 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 = "/ibc.core.channel.v1.QueryConnectionChannelsResponse")] +pub struct QueryConnectionChannelsResponse { + /// list of channels associated with a connection. + #[prost(message, repeated, tag = "1")] + pub channels: ::prost::alloc::vec::Vec, + /// pagination response + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageResponse, + >, + /// query block height + #[prost(message, optional, tag = "3")] + pub height: ::core::option::Option, +} +/// QueryChannelClientStateRequest is the request type for the Query/ClientState +/// 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 = "/ibc.core.channel.v1.QueryChannelClientStateRequest")] +#[proto_query( + path = "/ibc.core.channel.v1.Query/ChannelClientState", + response_type = QueryChannelClientStateResponse +)] +pub struct QueryChannelClientStateRequest { + /// port unique identifier + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + /// channel unique identifier + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, +} +/// QueryChannelClientStateResponse is the Response type for the +/// Query/QueryChannelClientState 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 = "/ibc.core.channel.v1.QueryChannelClientStateResponse")] +pub struct QueryChannelClientStateResponse { + /// client state associated with the channel + #[prost(message, optional, tag = "1")] + pub identified_client_state: + ::core::option::Option, + /// merkle proof of existence + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub proof: ::prost::alloc::vec::Vec, + /// height at which the proof was retrieved + #[prost(message, optional, tag = "3")] + pub proof_height: ::core::option::Option, +} +/// QueryChannelConsensusStateRequest is the request type for the +/// Query/ConsensusState 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 = "/ibc.core.channel.v1.QueryChannelConsensusStateRequest")] +#[proto_query( + path = "/ibc.core.channel.v1.Query/ChannelConsensusState", + response_type = QueryChannelConsensusStateResponse +)] +pub struct QueryChannelConsensusStateRequest { + /// port unique identifier + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + /// channel unique identifier + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, + /// revision number of the consensus state + #[prost(uint64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub revision_number: u64, + /// revision height of the consensus state + #[prost(uint64, tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub revision_height: u64, +} +/// QueryChannelClientStateResponse is the Response type for the +/// Query/QueryChannelClientState 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 = "/ibc.core.channel.v1.QueryChannelConsensusStateResponse")] +pub struct QueryChannelConsensusStateResponse { + /// consensus state associated with the channel + #[prost(message, optional, tag = "1")] + pub consensus_state: ::core::option::Option, + /// client ID associated with the consensus state + #[prost(string, tag = "2")] + pub client_id: ::prost::alloc::string::String, + /// merkle proof of existence + #[prost(bytes = "vec", tag = "3")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub proof: ::prost::alloc::vec::Vec, + /// height at which the proof was retrieved + #[prost(message, optional, tag = "4")] + pub proof_height: ::core::option::Option, +} +/// QueryPacketCommitmentRequest is the request type for the +/// Query/PacketCommitment 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 = "/ibc.core.channel.v1.QueryPacketCommitmentRequest")] +#[proto_query( + path = "/ibc.core.channel.v1.Query/PacketCommitment", + response_type = QueryPacketCommitmentResponse +)] +pub struct QueryPacketCommitmentRequest { + /// port unique identifier + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + /// channel unique identifier + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, + /// packet sequence + #[prost(uint64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub sequence: u64, +} +/// QueryPacketCommitmentResponse defines the client query response for a packet +/// which also includes a proof and the height from which the proof was +/// retrieved +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.QueryPacketCommitmentResponse")] +pub struct QueryPacketCommitmentResponse { + /// packet associated with the request fields + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub commitment: ::prost::alloc::vec::Vec, + /// merkle proof of existence + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub proof: ::prost::alloc::vec::Vec, + /// height at which the proof was retrieved + #[prost(message, optional, tag = "3")] + pub proof_height: ::core::option::Option, +} +/// QueryPacketCommitmentsRequest is the request type for the +/// Query/QueryPacketCommitments 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 = "/ibc.core.channel.v1.QueryPacketCommitmentsRequest")] +#[proto_query( + path = "/ibc.core.channel.v1.Query/PacketCommitments", + response_type = QueryPacketCommitmentsResponse +)] +pub struct QueryPacketCommitmentsRequest { + /// port unique identifier + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + /// channel unique identifier + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, + /// pagination request + #[prost(message, optional, tag = "3")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, +} +/// QueryPacketCommitmentsResponse is the request type for the +/// Query/QueryPacketCommitments 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 = "/ibc.core.channel.v1.QueryPacketCommitmentsResponse")] +pub struct QueryPacketCommitmentsResponse { + #[prost(message, repeated, tag = "1")] + pub commitments: ::prost::alloc::vec::Vec, + /// pagination response + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageResponse, + >, + /// query block height + #[prost(message, optional, tag = "3")] + pub height: ::core::option::Option, +} +/// QueryPacketReceiptRequest is the request type for the +/// Query/PacketReceipt 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 = "/ibc.core.channel.v1.QueryPacketReceiptRequest")] +#[proto_query( + path = "/ibc.core.channel.v1.Query/PacketReceipt", + response_type = QueryPacketReceiptResponse +)] +pub struct QueryPacketReceiptRequest { + /// port unique identifier + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + /// channel unique identifier + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, + /// packet sequence + #[prost(uint64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub sequence: u64, +} +/// QueryPacketReceiptResponse defines the client query response for a packet +/// receipt which also includes a proof, and the height from which the proof was +/// retrieved +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.QueryPacketReceiptResponse")] +pub struct QueryPacketReceiptResponse { + /// success flag for if receipt exists + #[prost(bool, tag = "2")] + pub received: bool, + /// merkle proof of existence + #[prost(bytes = "vec", tag = "3")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub proof: ::prost::alloc::vec::Vec, + /// height at which the proof was retrieved + #[prost(message, optional, tag = "4")] + pub proof_height: ::core::option::Option, +} +/// QueryPacketAcknowledgementRequest is the request type for the +/// Query/PacketAcknowledgement 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 = "/ibc.core.channel.v1.QueryPacketAcknowledgementRequest")] +#[proto_query( + path = "/ibc.core.channel.v1.Query/PacketAcknowledgement", + response_type = QueryPacketAcknowledgementResponse +)] +pub struct QueryPacketAcknowledgementRequest { + /// port unique identifier + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + /// channel unique identifier + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, + /// packet sequence + #[prost(uint64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub sequence: u64, +} +/// QueryPacketAcknowledgementResponse defines the client query response for a +/// packet which also includes a proof and the height from which the +/// proof was retrieved +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.QueryPacketAcknowledgementResponse")] +pub struct QueryPacketAcknowledgementResponse { + /// packet associated with the request fields + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub acknowledgement: ::prost::alloc::vec::Vec, + /// merkle proof of existence + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub proof: ::prost::alloc::vec::Vec, + /// height at which the proof was retrieved + #[prost(message, optional, tag = "3")] + pub proof_height: ::core::option::Option, +} +/// QueryPacketAcknowledgementsRequest is the request type for the +/// Query/QueryPacketCommitments 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 = "/ibc.core.channel.v1.QueryPacketAcknowledgementsRequest")] +#[proto_query( + path = "/ibc.core.channel.v1.Query/PacketAcknowledgements", + response_type = QueryPacketAcknowledgementsResponse +)] +pub struct QueryPacketAcknowledgementsRequest { + /// port unique identifier + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + /// channel unique identifier + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, + /// pagination request + #[prost(message, optional, tag = "3")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + /// list of packet sequences + #[prost(uint64, repeated, tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub packet_commitment_sequences: ::prost::alloc::vec::Vec, +} +/// QueryPacketAcknowledgemetsResponse is the request type for the +/// Query/QueryPacketAcknowledgements 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 = "/ibc.core.channel.v1.QueryPacketAcknowledgementsResponse")] +pub struct QueryPacketAcknowledgementsResponse { + #[prost(message, repeated, tag = "1")] + pub acknowledgements: ::prost::alloc::vec::Vec, + /// pagination response + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageResponse, + >, + /// query block height + #[prost(message, optional, tag = "3")] + pub height: ::core::option::Option, +} +/// QueryUnreceivedPacketsRequest is the request type for the +/// Query/UnreceivedPackets 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 = "/ibc.core.channel.v1.QueryUnreceivedPacketsRequest")] +#[proto_query( + path = "/ibc.core.channel.v1.Query/UnreceivedPackets", + response_type = QueryUnreceivedPacketsResponse +)] +pub struct QueryUnreceivedPacketsRequest { + /// port unique identifier + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + /// channel unique identifier + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, + /// list of packet sequences + #[prost(uint64, repeated, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub packet_commitment_sequences: ::prost::alloc::vec::Vec, +} +/// QueryUnreceivedPacketsResponse is the response type for the +/// Query/UnreceivedPacketCommitments 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 = "/ibc.core.channel.v1.QueryUnreceivedPacketsResponse")] +pub struct QueryUnreceivedPacketsResponse { + /// list of unreceived packet sequences + #[prost(uint64, repeated, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub sequences: ::prost::alloc::vec::Vec, + /// query block height + #[prost(message, optional, tag = "2")] + pub height: ::core::option::Option, +} +/// QueryUnreceivedAcks is the request type for the +/// Query/UnreceivedAcks 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 = "/ibc.core.channel.v1.QueryUnreceivedAcksRequest")] +#[proto_query( + path = "/ibc.core.channel.v1.Query/UnreceivedAcks", + response_type = QueryUnreceivedAcksResponse +)] +pub struct QueryUnreceivedAcksRequest { + /// port unique identifier + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + /// channel unique identifier + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, + /// list of acknowledgement sequences + #[prost(uint64, repeated, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub packet_ack_sequences: ::prost::alloc::vec::Vec, +} +/// QueryUnreceivedAcksResponse is the response type for the +/// Query/UnreceivedAcks 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 = "/ibc.core.channel.v1.QueryUnreceivedAcksResponse")] +pub struct QueryUnreceivedAcksResponse { + /// list of unreceived acknowledgement sequences + #[prost(uint64, repeated, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub sequences: ::prost::alloc::vec::Vec, + /// query block height + #[prost(message, optional, tag = "2")] + pub height: ::core::option::Option, +} +/// QueryNextSequenceReceiveRequest is the request type for the +/// Query/QueryNextSequenceReceiveRequest 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 = "/ibc.core.channel.v1.QueryNextSequenceReceiveRequest")] +#[proto_query( + path = "/ibc.core.channel.v1.Query/NextSequenceReceive", + response_type = QueryNextSequenceReceiveResponse +)] +pub struct QueryNextSequenceReceiveRequest { + /// port unique identifier + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + /// channel unique identifier + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, +} +/// QuerySequenceResponse is the response type for the +/// Query/QueryNextSequenceReceiveResponse 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 = "/ibc.core.channel.v1.QueryNextSequenceReceiveResponse")] +pub struct QueryNextSequenceReceiveResponse { + /// next sequence receive number + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub next_sequence_receive: u64, + /// merkle proof of existence + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub proof: ::prost::alloc::vec::Vec, + /// height at which the proof was retrieved + #[prost(message, optional, tag = "3")] + pub proof_height: ::core::option::Option, +} +/// QueryNextSequenceSendRequest is the request type for the +/// Query/QueryNextSequenceSend 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 = "/ibc.core.channel.v1.QueryNextSequenceSendRequest")] +#[proto_query( + path = "/ibc.core.channel.v1.Query/NextSequenceSend", + response_type = QueryNextSequenceSendResponse +)] +pub struct QueryNextSequenceSendRequest { + /// port unique identifier + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + /// channel unique identifier + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, +} +/// QueryNextSequenceSendResponse is the request type for the +/// Query/QueryNextSequenceSend 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 = "/ibc.core.channel.v1.QueryNextSequenceSendResponse")] +pub struct QueryNextSequenceSendResponse { + /// next sequence send number + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub next_sequence_send: u64, + /// merkle proof of existence + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub proof: ::prost::alloc::vec::Vec, + /// height at which the proof was retrieved + #[prost(message, optional, tag = "3")] + pub proof_height: ::core::option::Option, +} +/// QueryUpgradeErrorRequest is the request type for the Query/QueryUpgradeError 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 = "/ibc.core.channel.v1.QueryUpgradeErrorRequest")] +#[proto_query( + path = "/ibc.core.channel.v1.Query/UpgradeError", + response_type = QueryUpgradeErrorResponse +)] +pub struct QueryUpgradeErrorRequest { + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, +} +/// QueryUpgradeErrorResponse is the response type for the Query/QueryUpgradeError 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 = "/ibc.core.channel.v1.QueryUpgradeErrorResponse")] +pub struct QueryUpgradeErrorResponse { + #[prost(message, optional, tag = "1")] + pub error_receipt: ::core::option::Option, + /// merkle proof of existence + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub proof: ::prost::alloc::vec::Vec, + /// height at which the proof was retrieved + #[prost(message, optional, tag = "3")] + pub proof_height: ::core::option::Option, +} +/// QueryUpgradeRequest is the request type for the QueryUpgradeRequest 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 = "/ibc.core.channel.v1.QueryUpgradeRequest")] +#[proto_query( + path = "/ibc.core.channel.v1.Query/Upgrade", + response_type = QueryUpgradeResponse +)] +pub struct QueryUpgradeRequest { + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, +} +/// QueryUpgradeResponse is the response type for the QueryUpgradeResponse 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 = "/ibc.core.channel.v1.QueryUpgradeResponse")] +pub struct QueryUpgradeResponse { + #[prost(message, optional, tag = "1")] + pub upgrade: ::core::option::Option, + /// merkle proof of existence + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub proof: ::prost::alloc::vec::Vec, + /// height at which the proof was retrieved + #[prost(message, optional, tag = "3")] + pub proof_height: ::core::option::Option, +} +/// QueryChannelParamsRequest is the request type for the Query/ChannelParams 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 = "/ibc.core.channel.v1.QueryChannelParamsRequest")] +#[proto_query( + path = "/ibc.core.channel.v1.Query/ChannelParams", + response_type = QueryChannelParamsResponse +)] +pub struct QueryChannelParamsRequest {} +/// QueryChannelParamsResponse is the response type for the Query/ChannelParams 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 = "/ibc.core.channel.v1.QueryChannelParamsResponse")] +pub struct QueryChannelParamsResponse { + /// params defines the parameters of the module. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} +/// MsgChannelOpenInit defines an sdk.Msg to initialize a channel handshake. It +/// is called by a relayer on Chain A. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.MsgChannelOpenInit")] +pub struct MsgChannelOpenInit { + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub channel: ::core::option::Option, + #[prost(string, tag = "3")] + pub signer: ::prost::alloc::string::String, +} +/// MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit 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 = "/ibc.core.channel.v1.MsgChannelOpenInitResponse")] +pub struct MsgChannelOpenInitResponse { + #[prost(string, tag = "1")] + pub channel_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub version: ::prost::alloc::string::String, +} +/// MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel +/// on Chain B. The version field within the Channel field has been deprecated. Its +/// value will be ignored by core IBC. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.MsgChannelOpenTry")] +pub struct MsgChannelOpenTry { + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + /// Deprecated: this field is unused. Crossing hello's are no longer supported in core IBC. + #[deprecated] + #[prost(string, tag = "2")] + pub previous_channel_id: ::prost::alloc::string::String, + /// NOTE: the version field within the channel has been deprecated. Its value will be ignored by core IBC. + #[prost(message, optional, tag = "3")] + pub channel: ::core::option::Option, + #[prost(string, tag = "4")] + pub counterparty_version: ::prost::alloc::string::String, + #[prost(bytes = "vec", tag = "5")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub proof_init: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "6")] + pub proof_height: ::core::option::Option, + #[prost(string, tag = "7")] + pub signer: ::prost::alloc::string::String, +} +/// MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry 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 = "/ibc.core.channel.v1.MsgChannelOpenTryResponse")] +pub struct MsgChannelOpenTryResponse { + #[prost(string, tag = "1")] + pub version: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, +} +/// MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge +/// the change of channel state to TRYOPEN on Chain B. +/// WARNING: a channel upgrade MUST NOT initialize an upgrade for this channel +/// in the same block as executing this message otherwise the counterparty will +/// be incapable of opening. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.MsgChannelOpenAck")] +pub struct MsgChannelOpenAck { + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub counterparty_channel_id: ::prost::alloc::string::String, + #[prost(string, tag = "4")] + pub counterparty_version: ::prost::alloc::string::String, + #[prost(bytes = "vec", tag = "5")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub proof_try: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "6")] + pub proof_height: ::core::option::Option, + #[prost(string, tag = "7")] + pub signer: ::prost::alloc::string::String, +} +/// MsgChannelOpenAckResponse defines the Msg/ChannelOpenAck 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 = "/ibc.core.channel.v1.MsgChannelOpenAckResponse")] +pub struct MsgChannelOpenAckResponse {} +/// MsgChannelOpenConfirm defines a msg sent by a Relayer to Chain B to +/// acknowledge the change of channel state to OPEN on Chain A. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.MsgChannelOpenConfirm")] +pub struct MsgChannelOpenConfirm { + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, + #[prost(bytes = "vec", tag = "3")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub proof_ack: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "4")] + pub proof_height: ::core::option::Option, + #[prost(string, tag = "5")] + pub signer: ::prost::alloc::string::String, +} +/// MsgChannelOpenConfirmResponse defines the Msg/ChannelOpenConfirm 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 = "/ibc.core.channel.v1.MsgChannelOpenConfirmResponse")] +pub struct MsgChannelOpenConfirmResponse {} +/// MsgChannelCloseInit defines a msg sent by a Relayer to Chain A +/// to close a channel with Chain B. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.MsgChannelCloseInit")] +pub struct MsgChannelCloseInit { + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub signer: ::prost::alloc::string::String, +} +/// MsgChannelCloseInitResponse defines the Msg/ChannelCloseInit 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 = "/ibc.core.channel.v1.MsgChannelCloseInitResponse")] +pub struct MsgChannelCloseInitResponse {} +/// MsgChannelCloseConfirm defines a msg sent by a Relayer to Chain B +/// to acknowledge the change of channel state to CLOSED on Chain A. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.MsgChannelCloseConfirm")] +pub struct MsgChannelCloseConfirm { + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, + #[prost(bytes = "vec", tag = "3")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub proof_init: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "4")] + pub proof_height: ::core::option::Option, + #[prost(string, tag = "5")] + pub signer: ::prost::alloc::string::String, + #[prost(uint64, tag = "6")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub counterparty_upgrade_sequence: u64, +} +/// MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm 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 = "/ibc.core.channel.v1.MsgChannelCloseConfirmResponse")] +pub struct MsgChannelCloseConfirmResponse {} +/// MsgRecvPacket receives incoming IBC packet +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.MsgRecvPacket")] +pub struct MsgRecvPacket { + #[prost(message, optional, tag = "1")] + pub packet: ::core::option::Option, + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub proof_commitment: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "3")] + pub proof_height: ::core::option::Option, + #[prost(string, tag = "4")] + pub signer: ::prost::alloc::string::String, +} +/// MsgRecvPacketResponse defines the Msg/RecvPacket 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 = "/ibc.core.channel.v1.MsgRecvPacketResponse")] +pub struct MsgRecvPacketResponse { + #[prost(enumeration = "ResponseResultType", tag = "1")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub result: i32, +} +/// MsgTimeout receives timed-out packet +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.MsgTimeout")] +pub struct MsgTimeout { + #[prost(message, optional, tag = "1")] + pub packet: ::core::option::Option, + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub proof_unreceived: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "3")] + pub proof_height: ::core::option::Option, + #[prost(uint64, tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub next_sequence_recv: u64, + #[prost(string, tag = "5")] + pub signer: ::prost::alloc::string::String, +} +/// MsgTimeoutResponse defines the Msg/Timeout 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 = "/ibc.core.channel.v1.MsgTimeoutResponse")] +pub struct MsgTimeoutResponse { + #[prost(enumeration = "ResponseResultType", tag = "1")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub result: i32, +} +/// MsgTimeoutOnClose timed-out packet upon counterparty channel closure. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.MsgTimeoutOnClose")] +pub struct MsgTimeoutOnClose { + #[prost(message, optional, tag = "1")] + pub packet: ::core::option::Option, + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub proof_unreceived: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "3")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub proof_close: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "4")] + pub proof_height: ::core::option::Option, + #[prost(uint64, tag = "5")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub next_sequence_recv: u64, + #[prost(string, tag = "6")] + pub signer: ::prost::alloc::string::String, + #[prost(uint64, tag = "7")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub counterparty_upgrade_sequence: u64, +} +/// MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose 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 = "/ibc.core.channel.v1.MsgTimeoutOnCloseResponse")] +pub struct MsgTimeoutOnCloseResponse { + #[prost(enumeration = "ResponseResultType", tag = "1")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub result: i32, +} +/// MsgAcknowledgement receives incoming IBC acknowledgement +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.MsgAcknowledgement")] +pub struct MsgAcknowledgement { + #[prost(message, optional, tag = "1")] + pub packet: ::core::option::Option, + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub acknowledgement: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "3")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub proof_acked: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "4")] + pub proof_height: ::core::option::Option, + #[prost(string, tag = "5")] + pub signer: ::prost::alloc::string::String, +} +/// MsgAcknowledgementResponse defines the Msg/Acknowledgement 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 = "/ibc.core.channel.v1.MsgAcknowledgementResponse")] +pub struct MsgAcknowledgementResponse { + #[prost(enumeration = "ResponseResultType", tag = "1")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub result: i32, +} +/// MsgChannelUpgradeInit defines the request type for the ChannelUpgradeInit rpc +/// WARNING: Initializing a channel upgrade in the same block as opening the channel +/// may result in the counterparty being incapable of opening. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.MsgChannelUpgradeInit")] +pub struct MsgChannelUpgradeInit { + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, + #[prost(message, optional, tag = "3")] + pub fields: ::core::option::Option, + #[prost(string, tag = "4")] + pub signer: ::prost::alloc::string::String, +} +/// MsgChannelUpgradeInitResponse defines the MsgChannelUpgradeInit 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 = "/ibc.core.channel.v1.MsgChannelUpgradeInitResponse")] +pub struct MsgChannelUpgradeInitResponse { + #[prost(message, optional, tag = "1")] + pub upgrade: ::core::option::Option, + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub upgrade_sequence: u64, +} +/// MsgChannelUpgradeTry defines the request type for the ChannelUpgradeTry rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.MsgChannelUpgradeTry")] +pub struct MsgChannelUpgradeTry { + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, + #[prost(string, repeated, tag = "3")] + pub proposed_upgrade_connection_hops: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[prost(message, optional, tag = "4")] + pub counterparty_upgrade_fields: ::core::option::Option, + #[prost(uint64, tag = "5")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub counterparty_upgrade_sequence: u64, + #[prost(bytes = "vec", tag = "6")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub proof_channel: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "7")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub proof_upgrade: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "8")] + pub proof_height: ::core::option::Option, + #[prost(string, tag = "9")] + pub signer: ::prost::alloc::string::String, +} +/// MsgChannelUpgradeTryResponse defines the MsgChannelUpgradeTry 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 = "/ibc.core.channel.v1.MsgChannelUpgradeTryResponse")] +pub struct MsgChannelUpgradeTryResponse { + #[prost(message, optional, tag = "1")] + pub upgrade: ::core::option::Option, + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub upgrade_sequence: u64, + #[prost(enumeration = "ResponseResultType", tag = "3")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub result: i32, +} +/// MsgChannelUpgradeAck defines the request type for the ChannelUpgradeAck rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.MsgChannelUpgradeAck")] +pub struct MsgChannelUpgradeAck { + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, + #[prost(message, optional, tag = "3")] + pub counterparty_upgrade: ::core::option::Option, + #[prost(bytes = "vec", tag = "4")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub proof_channel: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "5")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub proof_upgrade: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "6")] + pub proof_height: ::core::option::Option, + #[prost(string, tag = "7")] + pub signer: ::prost::alloc::string::String, +} +/// MsgChannelUpgradeAckResponse defines MsgChannelUpgradeAck 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 = "/ibc.core.channel.v1.MsgChannelUpgradeAckResponse")] +pub struct MsgChannelUpgradeAckResponse { + #[prost(enumeration = "ResponseResultType", tag = "1")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub result: i32, +} +/// MsgChannelUpgradeConfirm defines the request type for the ChannelUpgradeConfirm rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.MsgChannelUpgradeConfirm")] +pub struct MsgChannelUpgradeConfirm { + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, + #[prost(enumeration = "State", tag = "3")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub counterparty_channel_state: i32, + #[prost(message, optional, tag = "4")] + pub counterparty_upgrade: ::core::option::Option, + #[prost(bytes = "vec", tag = "5")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub proof_channel: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "6")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub proof_upgrade: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "7")] + pub proof_height: ::core::option::Option, + #[prost(string, tag = "8")] + pub signer: ::prost::alloc::string::String, +} +/// MsgChannelUpgradeConfirmResponse defines MsgChannelUpgradeConfirm 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 = "/ibc.core.channel.v1.MsgChannelUpgradeConfirmResponse")] +pub struct MsgChannelUpgradeConfirmResponse { + #[prost(enumeration = "ResponseResultType", tag = "1")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub result: i32, +} +/// MsgChannelUpgradeOpen defines the request type for the ChannelUpgradeOpen rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.MsgChannelUpgradeOpen")] +pub struct MsgChannelUpgradeOpen { + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, + #[prost(enumeration = "State", tag = "3")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub counterparty_channel_state: i32, + #[prost(uint64, tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub counterparty_upgrade_sequence: u64, + #[prost(bytes = "vec", tag = "5")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub proof_channel: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "6")] + pub proof_height: ::core::option::Option, + #[prost(string, tag = "7")] + pub signer: ::prost::alloc::string::String, +} +/// MsgChannelUpgradeOpenResponse defines the MsgChannelUpgradeOpen 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 = "/ibc.core.channel.v1.MsgChannelUpgradeOpenResponse")] +pub struct MsgChannelUpgradeOpenResponse {} +/// MsgChannelUpgradeTimeout defines the request type for the ChannelUpgradeTimeout rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.MsgChannelUpgradeTimeout")] +pub struct MsgChannelUpgradeTimeout { + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, + #[prost(message, optional, tag = "3")] + pub counterparty_channel: ::core::option::Option, + #[prost(bytes = "vec", tag = "4")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub proof_channel: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "5")] + pub proof_height: ::core::option::Option, + #[prost(string, tag = "6")] + pub signer: ::prost::alloc::string::String, +} +/// MsgChannelUpgradeTimeoutRepsonse defines the MsgChannelUpgradeTimeout 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 = "/ibc.core.channel.v1.MsgChannelUpgradeTimeoutResponse")] +pub struct MsgChannelUpgradeTimeoutResponse {} +/// MsgChannelUpgradeCancel defines the request type for the ChannelUpgradeCancel rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.MsgChannelUpgradeCancel")] +pub struct MsgChannelUpgradeCancel { + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, + #[prost(message, optional, tag = "3")] + pub error_receipt: ::core::option::Option, + #[prost(bytes = "vec", tag = "4")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub proof_error_receipt: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "5")] + pub proof_height: ::core::option::Option, + #[prost(string, tag = "6")] + pub signer: ::prost::alloc::string::String, +} +/// MsgChannelUpgradeCancelResponse defines the MsgChannelUpgradeCancel 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 = "/ibc.core.channel.v1.MsgChannelUpgradeCancelResponse")] +pub struct MsgChannelUpgradeCancelResponse {} +/// MsgUpdateParams is the MsgUpdateParams request 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 = "/ibc.core.channel.v1.MsgUpdateParams")] +pub struct MsgUpdateParams { + /// authority is the address that controls the module (defaults to x/gov unless overwritten). + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// params defines the channel parameters to update. + /// + /// NOTE: All parameters must be supplied. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +/// MsgUpdateParamsResponse defines the MsgUpdateParams 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 = "/ibc.core.channel.v1.MsgUpdateParamsResponse")] +pub struct MsgUpdateParamsResponse {} +/// MsgPruneAcknowledgements defines the request type for the PruneAcknowledgements rpc. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.MsgPruneAcknowledgements")] +pub struct MsgPruneAcknowledgements { #[prost(string, tag = "1")] - #[serde(alias = "portID")] pub port_id: ::prost::alloc::string::String, #[prost(string, tag = "2")] - #[serde(alias = "channelID")] pub channel_id: ::prost::alloc::string::String, #[prost(uint64, tag = "3")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] - pub sequence: u64, + pub limit: u64, + #[prost(string, tag = "4")] + pub signer: ::prost::alloc::string::String, +} +/// MsgPruneAcknowledgementsResponse defines the response type for the PruneAcknowledgements rpc. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.channel.v1.MsgPruneAcknowledgementsResponse")] +pub struct MsgPruneAcknowledgementsResponse { + /// Number of sequences pruned (includes both packet acknowledgements and packet receipts where appropriate). + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub total_pruned_sequences: u64, + /// Number of sequences left after pruning. + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub total_remaining_sequences: u64, +} +/// ResponseResultType defines the possible outcomes of the execution of a message +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +pub enum ResponseResultType { + /// Default zero value enumeration + Unspecified = 0, + /// The message did not call the IBC application callbacks (because, for example, the packet had already been relayed) + Noop = 1, + /// The message was executed successfully + Success = 2, + /// The message was executed unsuccessfully + Failure = 3, +} +impl ResponseResultType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + ResponseResultType::Unspecified => "RESPONSE_RESULT_TYPE_UNSPECIFIED", + ResponseResultType::Noop => "RESPONSE_RESULT_TYPE_NOOP", + ResponseResultType::Success => "RESPONSE_RESULT_TYPE_SUCCESS", + ResponseResultType::Failure => "RESPONSE_RESULT_TYPE_FAILURE", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "RESPONSE_RESULT_TYPE_UNSPECIFIED" => Some(Self::Unspecified), + "RESPONSE_RESULT_TYPE_NOOP" => Some(Self::Noop), + "RESPONSE_RESULT_TYPE_SUCCESS" => Some(Self::Success), + "RESPONSE_RESULT_TYPE_FAILURE" => Some(Self::Failure), + _ => None, + } + } } pub struct ChannelQuerier<'a, Q: cosmwasm_std::CustomQuery> { querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, @@ -32,4 +2576,206 @@ impl<'a, Q: cosmwasm_std::CustomQuery> ChannelQuerier<'a, Q> { pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self { Self { querier } } + pub fn channel( + &self, + port_id: ::prost::alloc::string::String, + channel_id: ::prost::alloc::string::String, + ) -> Result { + QueryChannelRequest { + port_id, + channel_id, + } + .query(self.querier) + } + pub fn channels( + &self, + pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + ) -> Result { + QueryChannelsRequest { pagination }.query(self.querier) + } + pub fn connection_channels( + &self, + connection: ::prost::alloc::string::String, + pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + ) -> Result { + QueryConnectionChannelsRequest { + connection, + pagination, + } + .query(self.querier) + } + pub fn channel_client_state( + &self, + port_id: ::prost::alloc::string::String, + channel_id: ::prost::alloc::string::String, + ) -> Result { + QueryChannelClientStateRequest { + port_id, + channel_id, + } + .query(self.querier) + } + pub fn channel_consensus_state( + &self, + port_id: ::prost::alloc::string::String, + channel_id: ::prost::alloc::string::String, + revision_number: u64, + revision_height: u64, + ) -> Result { + QueryChannelConsensusStateRequest { + port_id, + channel_id, + revision_number, + revision_height, + } + .query(self.querier) + } + pub fn packet_commitment( + &self, + port_id: ::prost::alloc::string::String, + channel_id: ::prost::alloc::string::String, + sequence: u64, + ) -> Result { + QueryPacketCommitmentRequest { + port_id, + channel_id, + sequence, + } + .query(self.querier) + } + pub fn packet_commitments( + &self, + port_id: ::prost::alloc::string::String, + channel_id: ::prost::alloc::string::String, + pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + ) -> Result { + QueryPacketCommitmentsRequest { + port_id, + channel_id, + pagination, + } + .query(self.querier) + } + pub fn packet_receipt( + &self, + port_id: ::prost::alloc::string::String, + channel_id: ::prost::alloc::string::String, + sequence: u64, + ) -> Result { + QueryPacketReceiptRequest { + port_id, + channel_id, + sequence, + } + .query(self.querier) + } + pub fn packet_acknowledgement( + &self, + port_id: ::prost::alloc::string::String, + channel_id: ::prost::alloc::string::String, + sequence: u64, + ) -> Result { + QueryPacketAcknowledgementRequest { + port_id, + channel_id, + sequence, + } + .query(self.querier) + } + pub fn packet_acknowledgements( + &self, + port_id: ::prost::alloc::string::String, + channel_id: ::prost::alloc::string::String, + pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + packet_commitment_sequences: ::prost::alloc::vec::Vec, + ) -> Result { + QueryPacketAcknowledgementsRequest { + port_id, + channel_id, + pagination, + packet_commitment_sequences, + } + .query(self.querier) + } + pub fn unreceived_packets( + &self, + port_id: ::prost::alloc::string::String, + channel_id: ::prost::alloc::string::String, + packet_commitment_sequences: ::prost::alloc::vec::Vec, + ) -> Result { + QueryUnreceivedPacketsRequest { + port_id, + channel_id, + packet_commitment_sequences, + } + .query(self.querier) + } + pub fn unreceived_acks( + &self, + port_id: ::prost::alloc::string::String, + channel_id: ::prost::alloc::string::String, + packet_ack_sequences: ::prost::alloc::vec::Vec, + ) -> Result { + QueryUnreceivedAcksRequest { + port_id, + channel_id, + packet_ack_sequences, + } + .query(self.querier) + } + pub fn next_sequence_receive( + &self, + port_id: ::prost::alloc::string::String, + channel_id: ::prost::alloc::string::String, + ) -> Result { + QueryNextSequenceReceiveRequest { + port_id, + channel_id, + } + .query(self.querier) + } + pub fn next_sequence_send( + &self, + port_id: ::prost::alloc::string::String, + channel_id: ::prost::alloc::string::String, + ) -> Result { + QueryNextSequenceSendRequest { + port_id, + channel_id, + } + .query(self.querier) + } + pub fn upgrade_error( + &self, + port_id: ::prost::alloc::string::String, + channel_id: ::prost::alloc::string::String, + ) -> Result { + QueryUpgradeErrorRequest { + port_id, + channel_id, + } + .query(self.querier) + } + pub fn upgrade( + &self, + port_id: ::prost::alloc::string::String, + channel_id: ::prost::alloc::string::String, + ) -> Result { + QueryUpgradeRequest { + port_id, + channel_id, + } + .query(self.querier) + } + pub fn channel_params(&self) -> Result { + QueryChannelParamsRequest {}.query(self.querier) + } } diff --git a/packages/provwasm-std/src/types/ibc/core/client/v1.rs b/packages/provwasm-std/src/types/ibc/core/client/v1.rs index 0297c774..556e2f2b 100644 --- a/packages/provwasm-std/src/types/ibc/core/client/v1.rs +++ b/packages/provwasm-std/src/types/ibc/core/client/v1.rs @@ -1,4 +1,80 @@ use provwasm_proc_macro::CosmwasmExt; +/// IdentifiedClientState defines a client state with an additional client +/// identifier field. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.IdentifiedClientState")] +pub struct IdentifiedClientState { + /// client identifier + #[prost(string, tag = "1")] + pub client_id: ::prost::alloc::string::String, + /// client state + #[prost(message, optional, tag = "2")] + pub client_state: ::core::option::Option, +} +/// ConsensusStateWithHeight defines a consensus state with an additional height +/// field. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.ConsensusStateWithHeight")] +pub struct ConsensusStateWithHeight { + /// consensus state height + #[prost(message, optional, tag = "1")] + pub height: ::core::option::Option, + /// consensus state + #[prost(message, optional, tag = "2")] + pub consensus_state: ::core::option::Option, +} +/// ClientConsensusStates defines all the stored consensus states for a given +/// client. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.ClientConsensusStates")] +pub struct ClientConsensusStates { + /// client identifier + #[prost(string, tag = "1")] + pub client_id: ::prost::alloc::string::String, + /// consensus states and their heights associated with the client + #[prost(message, repeated, tag = "2")] + pub consensus_states: ::prost::alloc::vec::Vec, +} +/// Height is a monotonically increasing data type +/// that can be compared against another Height for the purposes of updating and +/// freezing clients +/// +/// Normally the RevisionHeight is incremented at each height while keeping +/// RevisionNumber the same. However some consensus algorithms may choose to +/// reset the height in certain conditions e.g. hard forks, state-machine +/// breaking changes In these cases, the RevisionNumber is incremented so that +/// height continues to be monitonically increasing even as the RevisionHeight +/// gets reset #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -12,12 +88,14 @@ use provwasm_proc_macro::CosmwasmExt; )] #[proto_message(type_url = "/ibc.core.client.v1.Height")] pub struct Height { + /// the revision that the client is currently on #[prost(uint64, tag = "1")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub revision_number: u64, + /// the height within the given revision #[prost(uint64, tag = "2")] #[serde( serialize_with = "crate::serde::as_str::serialize", @@ -25,11 +103,1084 @@ pub struct Height { )] pub revision_height: u64, } -pub struct ClientQuerier<'a, Q: cosmwasm_std::CustomQuery> { - querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, +/// Params defines the set of IBC light client parameters. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.Params")] +pub struct Params { + /// allowed_clients defines the list of allowed client state types which can be created + /// and interacted with. If a client type is removed from the allowed clients list, usage + /// of this client will be disabled until it is added again to the list. + #[prost(string, repeated, tag = "1")] + pub allowed_clients: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } -impl<'a, Q: cosmwasm_std::CustomQuery> ClientQuerier<'a, Q> { - pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self { - Self { querier } +/// ClientUpdateProposal is a legacy governance proposal. If it passes, the substitute +/// client's latest consensus state is copied over to the subject client. The proposal +/// handler may fail if the subject and the substitute do not match in client and +/// chain parameters (with exception to latest height, frozen height, and chain-id). +/// +/// Deprecated: Please use MsgRecoverClient in favour of this message 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 = "/ibc.core.client.v1.ClientUpdateProposal")] +#[deprecated] +pub struct ClientUpdateProposal { + /// the title of the update proposal + #[prost(string, tag = "1")] + pub title: ::prost::alloc::string::String, + /// the description of the proposal + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + /// the client identifier for the client to be updated if the proposal passes + #[prost(string, tag = "3")] + pub subject_client_id: ::prost::alloc::string::String, + /// the substitute client identifier for the client standing in for the subject + /// client + #[prost(string, tag = "4")] + pub substitute_client_id: ::prost::alloc::string::String, +} +/// UpgradeProposal is a gov Content type for initiating an IBC breaking +/// upgrade. +/// +/// Deprecated: Please use MsgIBCSoftwareUpgrade in favour of this message 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 = "/ibc.core.client.v1.UpgradeProposal")] +#[deprecated] +pub struct UpgradeProposal { + #[prost(string, tag = "1")] + pub title: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + #[prost(message, optional, tag = "3")] + pub plan: ::core::option::Option, + /// An UpgradedClientState must be provided to perform an IBC breaking upgrade. + /// This will make the chain commit to the correct upgraded (self) client state + /// before the upgrade occurs, so that connecting chains can verify that the + /// new upgraded client is valid by verifying a proof on the previous version + /// of the chain. This will allow IBC connections to persist smoothly across + /// planned chain upgrades + #[prost(message, optional, tag = "4")] + pub upgraded_client_state: ::core::option::Option, +} +/// GenesisState defines the ibc client submodule's genesis state. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.GenesisState")] +pub struct GenesisState { + /// client states with their corresponding identifiers + #[prost(message, repeated, tag = "1")] + pub clients: ::prost::alloc::vec::Vec, + /// consensus states from each client + #[prost(message, repeated, tag = "2")] + pub clients_consensus: ::prost::alloc::vec::Vec, + /// metadata from each client + #[prost(message, repeated, tag = "3")] + pub clients_metadata: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "4")] + pub params: ::core::option::Option, + /// Deprecated: create_localhost has been deprecated. + /// The localhost client is automatically created at genesis. + #[deprecated] + #[prost(bool, tag = "5")] + pub create_localhost: bool, + /// the sequence for the next generated client identifier + #[prost(uint64, tag = "6")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub next_client_sequence: u64, +} +/// GenesisMetadata defines the genesis type for metadata that clients may return +/// with ExportMetadata +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.GenesisMetadata")] +pub struct GenesisMetadata { + /// store key of metadata without clientID-prefix + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub key: ::prost::alloc::vec::Vec, + /// metadata value + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub value: ::prost::alloc::vec::Vec, +} +/// IdentifiedGenesisMetadata has the client metadata with the corresponding +/// client id. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.IdentifiedGenesisMetadata")] +pub struct IdentifiedGenesisMetadata { + #[prost(string, tag = "1")] + pub client_id: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] + pub client_metadata: ::prost::alloc::vec::Vec, +} +/// QueryClientStateRequest is the request type for the Query/ClientState 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 = "/ibc.core.client.v1.QueryClientStateRequest")] +#[proto_query( + path = "/ibc.core.client.v1.Query/ClientState", + response_type = QueryClientStateResponse +)] +pub struct QueryClientStateRequest { + /// client state unique identifier + #[prost(string, tag = "1")] + pub client_id: ::prost::alloc::string::String, +} +/// QueryClientStateResponse is the response type for the Query/ClientState RPC +/// method. Besides the client state, it includes a proof and the height from +/// which the proof was retrieved. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.QueryClientStateResponse")] +pub struct QueryClientStateResponse { + /// client state associated with the request identifier + #[prost(message, optional, tag = "1")] + pub client_state: ::core::option::Option, + /// merkle proof of existence + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub proof: ::prost::alloc::vec::Vec, + /// height at which the proof was retrieved + #[prost(message, optional, tag = "3")] + pub proof_height: ::core::option::Option, +} +/// QueryClientStatesRequest is the request type for the Query/ClientStates 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 = "/ibc.core.client.v1.QueryClientStatesRequest")] +#[proto_query( + path = "/ibc.core.client.v1.Query/ClientStates", + response_type = QueryClientStatesResponse +)] +pub struct QueryClientStatesRequest { + /// pagination request + #[prost(message, optional, tag = "1")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, +} +/// QueryClientStatesResponse is the response type for the Query/ClientStates 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 = "/ibc.core.client.v1.QueryClientStatesResponse")] +pub struct QueryClientStatesResponse { + /// list of stored ClientStates of the chain. + #[prost(message, repeated, tag = "1")] + pub client_states: ::prost::alloc::vec::Vec, + /// pagination response + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageResponse, + >, +} +/// QueryConsensusStateRequest is the request type for the Query/ConsensusState +/// RPC method. Besides the consensus state, it includes a proof and the height +/// from which the proof was retrieved. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.QueryConsensusStateRequest")] +#[proto_query( + path = "/ibc.core.client.v1.Query/ConsensusState", + response_type = QueryConsensusStateResponse +)] +pub struct QueryConsensusStateRequest { + /// client identifier + #[prost(string, tag = "1")] + pub client_id: ::prost::alloc::string::String, + /// consensus state revision number + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub revision_number: u64, + /// consensus state revision height + #[prost(uint64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub revision_height: u64, + /// latest_height overrrides the height field and queries the latest stored + /// ConsensusState + #[prost(bool, tag = "4")] + pub latest_height: bool, +} +/// QueryConsensusStateResponse is the response type for the Query/ConsensusState +/// 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 = "/ibc.core.client.v1.QueryConsensusStateResponse")] +pub struct QueryConsensusStateResponse { + /// consensus state associated with the client identifier at the given height + #[prost(message, optional, tag = "1")] + pub consensus_state: ::core::option::Option, + /// merkle proof of existence + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub proof: ::prost::alloc::vec::Vec, + /// height at which the proof was retrieved + #[prost(message, optional, tag = "3")] + pub proof_height: ::core::option::Option, +} +/// QueryConsensusStatesRequest is the request type for the Query/ConsensusStates +/// 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 = "/ibc.core.client.v1.QueryConsensusStatesRequest")] +#[proto_query( + path = "/ibc.core.client.v1.Query/ConsensusStates", + response_type = QueryConsensusStatesResponse +)] +pub struct QueryConsensusStatesRequest { + /// client identifier + #[prost(string, tag = "1")] + pub client_id: ::prost::alloc::string::String, + /// pagination request + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, +} +/// QueryConsensusStatesResponse is the response type for the +/// Query/ConsensusStates 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 = "/ibc.core.client.v1.QueryConsensusStatesResponse")] +pub struct QueryConsensusStatesResponse { + /// consensus states associated with the identifier + #[prost(message, repeated, tag = "1")] + pub consensus_states: ::prost::alloc::vec::Vec, + /// pagination response + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageResponse, + >, +} +/// QueryConsensusStateHeightsRequest is the request type for Query/ConsensusStateHeights +/// 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 = "/ibc.core.client.v1.QueryConsensusStateHeightsRequest")] +#[proto_query( + path = "/ibc.core.client.v1.Query/ConsensusStateHeights", + response_type = QueryConsensusStateHeightsResponse +)] +pub struct QueryConsensusStateHeightsRequest { + /// client identifier + #[prost(string, tag = "1")] + pub client_id: ::prost::alloc::string::String, + /// pagination request + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, +} +/// QueryConsensusStateHeightsResponse is the response type for the +/// Query/ConsensusStateHeights 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 = "/ibc.core.client.v1.QueryConsensusStateHeightsResponse")] +pub struct QueryConsensusStateHeightsResponse { + /// consensus state heights + #[prost(message, repeated, tag = "1")] + pub consensus_state_heights: ::prost::alloc::vec::Vec, + /// pagination response + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageResponse, + >, +} +/// QueryClientStatusRequest is the request type for the Query/ClientStatus 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 = "/ibc.core.client.v1.QueryClientStatusRequest")] +#[proto_query( + path = "/ibc.core.client.v1.Query/ClientStatus", + response_type = QueryClientStatusResponse +)] +pub struct QueryClientStatusRequest { + /// client unique identifier + #[prost(string, tag = "1")] + pub client_id: ::prost::alloc::string::String, +} +/// QueryClientStatusResponse is the response type for the Query/ClientStatus RPC +/// method. It returns the current status of the IBC client. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.QueryClientStatusResponse")] +pub struct QueryClientStatusResponse { + #[prost(string, tag = "1")] + pub status: ::prost::alloc::string::String, +} +/// QueryClientParamsRequest is the request type for the Query/ClientParams 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 = "/ibc.core.client.v1.QueryClientParamsRequest")] +#[proto_query( + path = "/ibc.core.client.v1.Query/ClientParams", + response_type = QueryClientParamsResponse +)] +pub struct QueryClientParamsRequest {} +/// QueryClientParamsResponse is the response type for the Query/ClientParams 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 = "/ibc.core.client.v1.QueryClientParamsResponse")] +pub struct QueryClientParamsResponse { + /// params defines the parameters of the module. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} +/// QueryUpgradedClientStateRequest is the request type for the +/// Query/UpgradedClientState 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 = "/ibc.core.client.v1.QueryUpgradedClientStateRequest")] +#[proto_query( + path = "/ibc.core.client.v1.Query/UpgradedClientState", + response_type = QueryUpgradedClientStateResponse +)] +pub struct QueryUpgradedClientStateRequest {} +/// QueryUpgradedClientStateResponse is the response type for the +/// Query/UpgradedClientState 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 = "/ibc.core.client.v1.QueryUpgradedClientStateResponse")] +pub struct QueryUpgradedClientStateResponse { + /// client state associated with the request identifier + #[prost(message, optional, tag = "1")] + pub upgraded_client_state: ::core::option::Option, +} +/// QueryUpgradedConsensusStateRequest is the request type for the +/// Query/UpgradedConsensusState 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 = "/ibc.core.client.v1.QueryUpgradedConsensusStateRequest")] +#[proto_query( + path = "/ibc.core.client.v1.Query/UpgradedConsensusState", + response_type = QueryUpgradedConsensusStateResponse +)] +pub struct QueryUpgradedConsensusStateRequest {} +/// QueryUpgradedConsensusStateResponse is the response type for the +/// Query/UpgradedConsensusState 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 = "/ibc.core.client.v1.QueryUpgradedConsensusStateResponse")] +pub struct QueryUpgradedConsensusStateResponse { + /// Consensus state associated with the request identifier + #[prost(message, optional, tag = "1")] + pub upgraded_consensus_state: ::core::option::Option, +} +/// QueryVerifyMembershipRequest is the request type for the Query/VerifyMembership 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 = "/ibc.core.client.v1.QueryVerifyMembershipRequest")] +#[proto_query( + path = "/ibc.core.client.v1.Query/VerifyMembership", + response_type = QueryVerifyMembershipResponse +)] +pub struct QueryVerifyMembershipRequest { + /// client unique identifier. + #[prost(string, tag = "1")] + pub client_id: ::prost::alloc::string::String, + /// the proof to be verified by the client. + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub proof: ::prost::alloc::vec::Vec, + /// the height of the commitment root at which the proof is verified. + #[prost(message, optional, tag = "3")] + pub proof_height: ::core::option::Option, + /// the commitment key path. + #[prost(message, optional, tag = "4")] + pub merkle_path: ::core::option::Option, + /// the value which is proven. + #[prost(bytes = "vec", tag = "5")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub value: ::prost::alloc::vec::Vec, + /// optional time delay + #[prost(uint64, tag = "6")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub time_delay: u64, + /// optional block delay + #[prost(uint64, tag = "7")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub block_delay: u64, +} +/// QueryVerifyMembershipResponse is the response type for the Query/VerifyMembership 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 = "/ibc.core.client.v1.QueryVerifyMembershipResponse")] +pub struct QueryVerifyMembershipResponse { + /// boolean indicating success or failure of proof verification. + #[prost(bool, tag = "1")] + pub success: bool, +} +/// MsgCreateClient defines a message to create an IBC client +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.MsgCreateClient")] +pub struct MsgCreateClient { + /// light client state + #[prost(message, optional, tag = "1")] + pub client_state: ::core::option::Option, + /// consensus state associated with the client that corresponds to a given + /// height. + #[prost(message, optional, tag = "2")] + pub consensus_state: ::core::option::Option, + /// signer address + #[prost(string, tag = "3")] + pub signer: ::prost::alloc::string::String, +} +/// MsgCreateClientResponse defines the Msg/CreateClient 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 = "/ibc.core.client.v1.MsgCreateClientResponse")] +pub struct MsgCreateClientResponse {} +/// MsgUpdateClient defines an sdk.Msg to update a IBC client state using +/// the given client message. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.MsgUpdateClient")] +pub struct MsgUpdateClient { + /// client unique identifier + #[prost(string, tag = "1")] + pub client_id: ::prost::alloc::string::String, + /// client message to update the light client + #[prost(message, optional, tag = "2")] + pub client_message: ::core::option::Option, + /// signer address + #[prost(string, tag = "3")] + pub signer: ::prost::alloc::string::String, +} +/// MsgUpdateClientResponse defines the Msg/UpdateClient 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 = "/ibc.core.client.v1.MsgUpdateClientResponse")] +pub struct MsgUpdateClientResponse {} +/// MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client +/// state +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.MsgUpgradeClient")] +pub struct MsgUpgradeClient { + /// client unique identifier + #[prost(string, tag = "1")] + pub client_id: ::prost::alloc::string::String, + /// upgraded client state + #[prost(message, optional, tag = "2")] + pub client_state: ::core::option::Option, + /// upgraded consensus state, only contains enough information to serve as a + /// basis of trust in update logic + #[prost(message, optional, tag = "3")] + pub consensus_state: ::core::option::Option, + /// proof that old chain committed to new client + #[prost(bytes = "vec", tag = "4")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub proof_upgrade_client: ::prost::alloc::vec::Vec, + /// proof that old chain committed to new consensus state + #[prost(bytes = "vec", tag = "5")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub proof_upgrade_consensus_state: ::prost::alloc::vec::Vec, + /// signer address + #[prost(string, tag = "6")] + pub signer: ::prost::alloc::string::String, +} +/// MsgUpgradeClientResponse defines the Msg/UpgradeClient 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 = "/ibc.core.client.v1.MsgUpgradeClientResponse")] +pub struct MsgUpgradeClientResponse {} +/// MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for +/// light client misbehaviour. +/// This message has been deprecated. Use MsgUpdateClient instead. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.MsgSubmitMisbehaviour")] +#[deprecated] +pub struct MsgSubmitMisbehaviour { + /// client unique identifier + #[prost(string, tag = "1")] + pub client_id: ::prost::alloc::string::String, + /// misbehaviour used for freezing the light client + #[prost(message, optional, tag = "2")] + pub misbehaviour: ::core::option::Option, + /// signer address + #[prost(string, tag = "3")] + pub signer: ::prost::alloc::string::String, +} +/// MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour 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 = "/ibc.core.client.v1.MsgSubmitMisbehaviourResponse")] +pub struct MsgSubmitMisbehaviourResponse {} +/// MsgRecoverClient defines the message used to recover a frozen or expired client. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.MsgRecoverClient")] +pub struct MsgRecoverClient { + /// the client identifier for the client to be updated if the proposal passes + #[prost(string, tag = "1")] + pub subject_client_id: ::prost::alloc::string::String, + /// the substitute client identifier for the client which will replace the subject + /// client + #[prost(string, tag = "2")] + pub substitute_client_id: ::prost::alloc::string::String, + /// signer address + #[prost(string, tag = "3")] + pub signer: ::prost::alloc::string::String, +} +/// MsgRecoverClientResponse defines the Msg/RecoverClient 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 = "/ibc.core.client.v1.MsgRecoverClientResponse")] +pub struct MsgRecoverClientResponse {} +/// MsgIBCSoftwareUpgrade defines the message used to schedule an upgrade of an IBC client using a v1 governance proposal +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.MsgIBCSoftwareUpgrade")] +pub struct MsgIbcSoftwareUpgrade { + #[prost(message, optional, tag = "1")] + pub plan: ::core::option::Option, + /// An UpgradedClientState must be provided to perform an IBC breaking upgrade. + /// This will make the chain commit to the correct upgraded (self) client state + /// before the upgrade occurs, so that connecting chains can verify that the + /// new upgraded client is valid by verifying a proof on the previous version + /// of the chain. This will allow IBC connections to persist smoothly across + /// planned chain upgrades. Correspondingly, the UpgradedClientState field has been + /// deprecated in the Cosmos SDK to allow for this logic to exist solely in + /// the 02-client module. + #[prost(message, optional, tag = "2")] + pub upgraded_client_state: ::core::option::Option, + /// signer address + #[prost(string, tag = "3")] + pub signer: ::prost::alloc::string::String, +} +/// MsgIBCSoftwareUpgradeResponse defines the Msg/IBCSoftwareUpgrade 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 = "/ibc.core.client.v1.MsgIBCSoftwareUpgradeResponse")] +pub struct MsgIbcSoftwareUpgradeResponse {} +/// MsgUpdateParams defines the sdk.Msg type to update the client parameters. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.client.v1.MsgUpdateParams")] +pub struct MsgUpdateParams { + /// signer address + #[prost(string, tag = "1")] + pub signer: ::prost::alloc::string::String, + /// params defines the client parameters to update. + /// + /// NOTE: All parameters must be supplied. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +/// MsgUpdateParamsResponse defines the MsgUpdateParams 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 = "/ibc.core.client.v1.MsgUpdateParamsResponse")] +pub struct MsgUpdateParamsResponse {} +pub struct ClientQuerier<'a, Q: cosmwasm_std::CustomQuery> { + querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, +} +impl<'a, Q: cosmwasm_std::CustomQuery> ClientQuerier<'a, Q> { + pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self { + Self { querier } + } + pub fn client_state( + &self, + client_id: ::prost::alloc::string::String, + ) -> Result { + QueryClientStateRequest { client_id }.query(self.querier) + } + pub fn client_states( + &self, + pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + ) -> Result { + QueryClientStatesRequest { pagination }.query(self.querier) + } + pub fn consensus_state( + &self, + client_id: ::prost::alloc::string::String, + revision_number: u64, + revision_height: u64, + latest_height: bool, + ) -> Result { + QueryConsensusStateRequest { + client_id, + revision_number, + revision_height, + latest_height, + } + .query(self.querier) + } + pub fn consensus_states( + &self, + client_id: ::prost::alloc::string::String, + pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + ) -> Result { + QueryConsensusStatesRequest { + client_id, + pagination, + } + .query(self.querier) + } + pub fn consensus_state_heights( + &self, + client_id: ::prost::alloc::string::String, + pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + ) -> Result { + QueryConsensusStateHeightsRequest { + client_id, + pagination, + } + .query(self.querier) + } + pub fn client_status( + &self, + client_id: ::prost::alloc::string::String, + ) -> Result { + QueryClientStatusRequest { client_id }.query(self.querier) + } + pub fn client_params(&self) -> Result { + QueryClientParamsRequest {}.query(self.querier) + } + pub fn upgraded_client_state( + &self, + ) -> Result { + QueryUpgradedClientStateRequest {}.query(self.querier) + } + pub fn upgraded_consensus_state( + &self, + ) -> Result { + QueryUpgradedConsensusStateRequest {}.query(self.querier) + } + pub fn verify_membership( + &self, + client_id: ::prost::alloc::string::String, + proof: ::prost::alloc::vec::Vec, + proof_height: ::core::option::Option, + merkle_path: ::core::option::Option, + value: ::prost::alloc::vec::Vec, + time_delay: u64, + block_delay: u64, + ) -> Result { + QueryVerifyMembershipRequest { + client_id, + proof, + proof_height, + merkle_path, + value, + time_delay, + block_delay, + } + .query(self.querier) } } diff --git a/packages/provwasm-std/src/types/ibc/core/commitment/mod.rs b/packages/provwasm-std/src/types/ibc/core/commitment/mod.rs new file mode 100644 index 00000000..a3a6d96c --- /dev/null +++ b/packages/provwasm-std/src/types/ibc/core/commitment/mod.rs @@ -0,0 +1 @@ +pub mod v1; diff --git a/packages/provwasm-std/src/types/ibc/core/commitment/v1.rs b/packages/provwasm-std/src/types/ibc/core/commitment/v1.rs new file mode 100644 index 00000000..531b1bcc --- /dev/null +++ b/packages/provwasm-std/src/types/ibc/core/commitment/v1.rs @@ -0,0 +1,87 @@ +use provwasm_proc_macro::CosmwasmExt; +/// MerkleRoot defines a merkle root hash. +/// In the Cosmos SDK, the AppHash of a block header becomes the root. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.commitment.v1.MerkleRoot")] +pub struct MerkleRoot { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub hash: ::prost::alloc::vec::Vec, +} +/// MerklePrefix is merkle path prefixed to the key. +/// The constructed key from the Path and the key will be append(Path.KeyPath, +/// append(Path.KeyPrefix, key...)) +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.commitment.v1.MerklePrefix")] +pub struct MerklePrefix { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub key_prefix: ::prost::alloc::vec::Vec, +} +/// MerklePath is the path used to verify commitment proofs, which can be an +/// arbitrary structured object (defined by a commitment type). +/// MerklePath is represented from root-to-leaf +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.commitment.v1.MerklePath")] +pub struct MerklePath { + #[prost(string, repeated, tag = "1")] + pub key_path: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// MerkleProof is a wrapper type over a chain of CommitmentProofs. +/// It demonstrates membership or non-membership for an element or set of +/// elements, verifiable in conjunction with a known commitment root. Proofs +/// should be succinct. +/// MerkleProofs are ordered from leaf-to-root +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.commitment.v1.MerkleProof")] +pub struct MerkleProof { + #[prost(message, repeated, tag = "1")] + pub proofs: + ::prost::alloc::vec::Vec, +} diff --git a/packages/provwasm-std/src/types/ibc/core/connection/mod.rs b/packages/provwasm-std/src/types/ibc/core/connection/mod.rs new file mode 100644 index 00000000..a3a6d96c --- /dev/null +++ b/packages/provwasm-std/src/types/ibc/core/connection/mod.rs @@ -0,0 +1 @@ +pub mod v1; diff --git a/packages/provwasm-std/src/types/ibc/core/connection/v1.rs b/packages/provwasm-std/src/types/ibc/core/connection/v1.rs new file mode 100644 index 00000000..2e39cfed --- /dev/null +++ b/packages/provwasm-std/src/types/ibc/core/connection/v1.rs @@ -0,0 +1,913 @@ +use provwasm_proc_macro::CosmwasmExt; +/// ConnectionEnd defines a stateful object on a chain connected to another +/// separate one. +/// NOTE: there must only be 2 defined ConnectionEnds to establish +/// a connection between two chains. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.connection.v1.ConnectionEnd")] +pub struct ConnectionEnd { + /// client associated with this connection. + #[prost(string, tag = "1")] + pub client_id: ::prost::alloc::string::String, + /// IBC version which can be utilised to determine encodings or protocols for + /// channels or packets utilising this connection. + #[prost(message, repeated, tag = "2")] + pub versions: ::prost::alloc::vec::Vec, + /// current state of the connection end. + #[prost(enumeration = "State", tag = "3")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub state: i32, + /// counterparty chain associated with this connection. + #[prost(message, optional, tag = "4")] + pub counterparty: ::core::option::Option, + /// delay period that must pass before a consensus state can be used for + /// packet-verification NOTE: delay period logic is only implemented by some + /// clients. + #[prost(uint64, tag = "5")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub delay_period: u64, +} +/// IdentifiedConnection defines a connection with additional connection +/// identifier field. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.connection.v1.IdentifiedConnection")] +pub struct IdentifiedConnection { + /// connection identifier. + #[prost(string, tag = "1")] + pub id: ::prost::alloc::string::String, + /// client associated with this connection. + #[prost(string, tag = "2")] + pub client_id: ::prost::alloc::string::String, + /// IBC version which can be utilised to determine encodings or protocols for + /// channels or packets utilising this connection + #[prost(message, repeated, tag = "3")] + pub versions: ::prost::alloc::vec::Vec, + /// current state of the connection end. + #[prost(enumeration = "State", tag = "4")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub state: i32, + /// counterparty chain associated with this connection. + #[prost(message, optional, tag = "5")] + pub counterparty: ::core::option::Option, + /// delay period associated with this connection. + #[prost(uint64, tag = "6")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub delay_period: u64, +} +/// Counterparty defines the counterparty chain associated with a connection end. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.connection.v1.Counterparty")] +pub struct Counterparty { + /// identifies the client on the counterparty chain associated with a given + /// connection. + #[prost(string, tag = "1")] + pub client_id: ::prost::alloc::string::String, + /// identifies the connection end on the counterparty chain associated with a + /// given connection. + #[prost(string, tag = "2")] + pub connection_id: ::prost::alloc::string::String, + /// commitment merkle prefix of the counterparty chain. + #[prost(message, optional, tag = "3")] + pub prefix: ::core::option::Option, +} +/// ClientPaths define all the connection paths for a client state. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.connection.v1.ClientPaths")] +pub struct ClientPaths { + /// list of connection paths + #[prost(string, repeated, tag = "1")] + pub paths: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// ConnectionPaths define all the connection paths for a given client state. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.connection.v1.ConnectionPaths")] +pub struct ConnectionPaths { + /// client state unique identifier + #[prost(string, tag = "1")] + pub client_id: ::prost::alloc::string::String, + /// list of connection paths + #[prost(string, repeated, tag = "2")] + pub paths: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// Version defines the versioning scheme used to negotiate the IBC verison in +/// the connection handshake. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.connection.v1.Version")] +pub struct Version { + /// unique version identifier + #[prost(string, tag = "1")] + pub identifier: ::prost::alloc::string::String, + /// list of features compatible with the specified identifier + #[prost(string, repeated, tag = "2")] + pub features: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// Params defines the set of Connection parameters. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.connection.v1.Params")] +pub struct Params { + /// maximum expected time per block (in nanoseconds), used to enforce block delay. This parameter should reflect the + /// largest amount of time that the chain might reasonably take to produce the next block under normal operating + /// conditions. A safe choice is 3-5x the expected time per block. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub max_expected_time_per_block: u64, +} +/// State defines if a connection is in one of the following states: +/// INIT, TRYOPEN, OPEN or UNINITIALIZED. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +pub enum State { + /// Default State + UninitializedUnspecified = 0, + /// A connection end has just started the opening handshake. + Init = 1, + /// A connection end has acknowledged the handshake step on the counterparty + /// chain. + Tryopen = 2, + /// A connection end has completed the handshake. + Open = 3, +} +impl State { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + State::UninitializedUnspecified => "STATE_UNINITIALIZED_UNSPECIFIED", + State::Init => "STATE_INIT", + State::Tryopen => "STATE_TRYOPEN", + State::Open => "STATE_OPEN", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "STATE_UNINITIALIZED_UNSPECIFIED" => Some(Self::UninitializedUnspecified), + "STATE_INIT" => Some(Self::Init), + "STATE_TRYOPEN" => Some(Self::Tryopen), + "STATE_OPEN" => Some(Self::Open), + _ => None, + } + } +} +/// GenesisState defines the ibc connection submodule's genesis state. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.connection.v1.GenesisState")] +pub struct GenesisState { + #[prost(message, repeated, tag = "1")] + pub connections: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "2")] + pub client_connection_paths: ::prost::alloc::vec::Vec, + /// the sequence for the next generated connection identifier + #[prost(uint64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub next_connection_sequence: u64, + #[prost(message, optional, tag = "4")] + pub params: ::core::option::Option, +} +/// QueryConnectionRequest is the request type for the Query/Connection 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 = "/ibc.core.connection.v1.QueryConnectionRequest")] +#[proto_query( + path = "/ibc.core.connection.v1.Query/Connection", + response_type = QueryConnectionResponse +)] +pub struct QueryConnectionRequest { + /// connection unique identifier + #[prost(string, tag = "1")] + pub connection_id: ::prost::alloc::string::String, +} +/// QueryConnectionResponse is the response type for the Query/Connection RPC +/// method. Besides the connection end, it includes a proof and the height from +/// which the proof was retrieved. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.connection.v1.QueryConnectionResponse")] +pub struct QueryConnectionResponse { + /// connection associated with the request identifier + #[prost(message, optional, tag = "1")] + pub connection: ::core::option::Option, + /// merkle proof of existence + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub proof: ::prost::alloc::vec::Vec, + /// height at which the proof was retrieved + #[prost(message, optional, tag = "3")] + pub proof_height: ::core::option::Option, +} +/// QueryConnectionsRequest is the request type for the Query/Connections 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 = "/ibc.core.connection.v1.QueryConnectionsRequest")] +#[proto_query( + path = "/ibc.core.connection.v1.Query/Connections", + response_type = QueryConnectionsResponse +)] +pub struct QueryConnectionsRequest { + #[prost(message, optional, tag = "1")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, +} +/// QueryConnectionsResponse is the response type for the Query/Connections 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 = "/ibc.core.connection.v1.QueryConnectionsResponse")] +pub struct QueryConnectionsResponse { + /// list of stored connections of the chain. + #[prost(message, repeated, tag = "1")] + pub connections: ::prost::alloc::vec::Vec, + /// pagination response + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageResponse, + >, + /// query block height + #[prost(message, optional, tag = "3")] + pub height: ::core::option::Option, +} +/// QueryClientConnectionsRequest is the request type for the +/// Query/ClientConnections 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 = "/ibc.core.connection.v1.QueryClientConnectionsRequest")] +#[proto_query( + path = "/ibc.core.connection.v1.Query/ClientConnections", + response_type = QueryClientConnectionsResponse +)] +pub struct QueryClientConnectionsRequest { + /// client identifier associated with a connection + #[prost(string, tag = "1")] + pub client_id: ::prost::alloc::string::String, +} +/// QueryClientConnectionsResponse is the response type for the +/// Query/ClientConnections 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 = "/ibc.core.connection.v1.QueryClientConnectionsResponse")] +pub struct QueryClientConnectionsResponse { + /// slice of all the connection paths associated with a client. + #[prost(string, repeated, tag = "1")] + pub connection_paths: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// merkle proof of existence + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub proof: ::prost::alloc::vec::Vec, + /// height at which the proof was generated + #[prost(message, optional, tag = "3")] + pub proof_height: ::core::option::Option, +} +/// QueryConnectionClientStateRequest is the request type for the +/// Query/ConnectionClientState 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 = "/ibc.core.connection.v1.QueryConnectionClientStateRequest")] +#[proto_query( + path = "/ibc.core.connection.v1.Query/ConnectionClientState", + response_type = QueryConnectionClientStateResponse +)] +pub struct QueryConnectionClientStateRequest { + /// connection identifier + #[prost(string, tag = "1")] + pub connection_id: ::prost::alloc::string::String, +} +/// QueryConnectionClientStateResponse is the response type for the +/// Query/ConnectionClientState 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 = "/ibc.core.connection.v1.QueryConnectionClientStateResponse")] +pub struct QueryConnectionClientStateResponse { + /// client state associated with the channel + #[prost(message, optional, tag = "1")] + pub identified_client_state: + ::core::option::Option, + /// merkle proof of existence + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub proof: ::prost::alloc::vec::Vec, + /// height at which the proof was retrieved + #[prost(message, optional, tag = "3")] + pub proof_height: ::core::option::Option, +} +/// QueryConnectionConsensusStateRequest is the request type for the +/// Query/ConnectionConsensusState 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 = "/ibc.core.connection.v1.QueryConnectionConsensusStateRequest")] +#[proto_query( + path = "/ibc.core.connection.v1.Query/ConnectionConsensusState", + response_type = QueryConnectionConsensusStateResponse +)] +pub struct QueryConnectionConsensusStateRequest { + /// connection identifier + #[prost(string, tag = "1")] + pub connection_id: ::prost::alloc::string::String, + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub revision_number: u64, + #[prost(uint64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub revision_height: u64, +} +/// QueryConnectionConsensusStateResponse is the response type for the +/// Query/ConnectionConsensusState 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 = "/ibc.core.connection.v1.QueryConnectionConsensusStateResponse")] +pub struct QueryConnectionConsensusStateResponse { + /// consensus state associated with the channel + #[prost(message, optional, tag = "1")] + pub consensus_state: ::core::option::Option, + /// client ID associated with the consensus state + #[prost(string, tag = "2")] + pub client_id: ::prost::alloc::string::String, + /// merkle proof of existence + #[prost(bytes = "vec", tag = "3")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub proof: ::prost::alloc::vec::Vec, + /// height at which the proof was retrieved + #[prost(message, optional, tag = "4")] + pub proof_height: ::core::option::Option, +} +/// QueryConnectionParamsRequest is the request type for the Query/ConnectionParams 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 = "/ibc.core.connection.v1.QueryConnectionParamsRequest")] +#[proto_query( + path = "/ibc.core.connection.v1.Query/ConnectionParams", + response_type = QueryConnectionParamsResponse +)] +pub struct QueryConnectionParamsRequest {} +/// QueryConnectionParamsResponse is the response type for the Query/ConnectionParams 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 = "/ibc.core.connection.v1.QueryConnectionParamsResponse")] +pub struct QueryConnectionParamsResponse { + /// params defines the parameters of the module. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} +/// MsgConnectionOpenInit defines the msg sent by an account on Chain A to +/// initialize a connection with Chain B. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.connection.v1.MsgConnectionOpenInit")] +pub struct MsgConnectionOpenInit { + #[prost(string, tag = "1")] + pub client_id: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub counterparty: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub version: ::core::option::Option, + #[prost(uint64, tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub delay_period: u64, + #[prost(string, tag = "5")] + pub signer: ::prost::alloc::string::String, +} +/// MsgConnectionOpenInitResponse defines the Msg/ConnectionOpenInit 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 = "/ibc.core.connection.v1.MsgConnectionOpenInitResponse")] +pub struct MsgConnectionOpenInitResponse {} +/// MsgConnectionOpenTry defines a msg sent by a Relayer to try to open a +/// connection on Chain B. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.connection.v1.MsgConnectionOpenTry")] +pub struct MsgConnectionOpenTry { + #[prost(string, tag = "1")] + pub client_id: ::prost::alloc::string::String, + /// Deprecated: this field is unused. Crossing hellos are no longer supported in core IBC. + #[deprecated] + #[prost(string, tag = "2")] + pub previous_connection_id: ::prost::alloc::string::String, + #[prost(message, optional, tag = "3")] + pub client_state: ::core::option::Option, + #[prost(message, optional, tag = "4")] + pub counterparty: ::core::option::Option, + #[prost(uint64, tag = "5")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub delay_period: u64, + #[prost(message, repeated, tag = "6")] + pub counterparty_versions: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "7")] + pub proof_height: ::core::option::Option, + /// proof of the initialization the connection on Chain A: `UNITIALIZED -> + /// INIT` + #[prost(bytes = "vec", tag = "8")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub proof_init: ::prost::alloc::vec::Vec, + /// proof of client state included in message + #[prost(bytes = "vec", tag = "9")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub proof_client: ::prost::alloc::vec::Vec, + /// proof of client consensus state + #[prost(bytes = "vec", tag = "10")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub proof_consensus: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "11")] + pub consensus_height: ::core::option::Option, + #[prost(string, tag = "12")] + pub signer: ::prost::alloc::string::String, + /// optional proof data for host state machines that are unable to introspect their own consensus state + #[prost(bytes = "vec", tag = "13")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub host_consensus_state_proof: ::prost::alloc::vec::Vec, +} +/// MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry 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 = "/ibc.core.connection.v1.MsgConnectionOpenTryResponse")] +pub struct MsgConnectionOpenTryResponse {} +/// MsgConnectionOpenAck defines a msg sent by a Relayer to Chain A to +/// acknowledge the change of connection state to TRYOPEN on Chain B. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.connection.v1.MsgConnectionOpenAck")] +pub struct MsgConnectionOpenAck { + #[prost(string, tag = "1")] + pub connection_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub counterparty_connection_id: ::prost::alloc::string::String, + #[prost(message, optional, tag = "3")] + pub version: ::core::option::Option, + #[prost(message, optional, tag = "4")] + pub client_state: ::core::option::Option, + #[prost(message, optional, tag = "5")] + pub proof_height: ::core::option::Option, + /// proof of the initialization the connection on Chain B: `UNITIALIZED -> + /// TRYOPEN` + #[prost(bytes = "vec", tag = "6")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub proof_try: ::prost::alloc::vec::Vec, + /// proof of client state included in message + #[prost(bytes = "vec", tag = "7")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub proof_client: ::prost::alloc::vec::Vec, + /// proof of client consensus state + #[prost(bytes = "vec", tag = "8")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub proof_consensus: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "9")] + pub consensus_height: ::core::option::Option, + #[prost(string, tag = "10")] + pub signer: ::prost::alloc::string::String, + /// optional proof data for host state machines that are unable to introspect their own consensus state + #[prost(bytes = "vec", tag = "11")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub host_consensus_state_proof: ::prost::alloc::vec::Vec, +} +/// MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck 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 = "/ibc.core.connection.v1.MsgConnectionOpenAckResponse")] +pub struct MsgConnectionOpenAckResponse {} +/// MsgConnectionOpenConfirm defines a msg sent by a Relayer to Chain B to +/// acknowledge the change of connection state to OPEN on Chain A. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.connection.v1.MsgConnectionOpenConfirm")] +pub struct MsgConnectionOpenConfirm { + #[prost(string, tag = "1")] + pub connection_id: ::prost::alloc::string::String, + /// proof for the change of the connection state on Chain A: `INIT -> OPEN` + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub proof_ack: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "3")] + pub proof_height: ::core::option::Option, + #[prost(string, tag = "4")] + pub signer: ::prost::alloc::string::String, +} +/// MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm +/// 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 = "/ibc.core.connection.v1.MsgConnectionOpenConfirmResponse")] +pub struct MsgConnectionOpenConfirmResponse {} +/// MsgUpdateParams defines the sdk.Msg type to update the connection parameters. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.connection.v1.MsgUpdateParams")] +pub struct MsgUpdateParams { + /// signer address + #[prost(string, tag = "1")] + pub signer: ::prost::alloc::string::String, + /// params defines the connection parameters to update. + /// + /// NOTE: All parameters must be supplied. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +/// MsgUpdateParamsResponse defines the MsgUpdateParams 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 = "/ibc.core.connection.v1.MsgUpdateParamsResponse")] +pub struct MsgUpdateParamsResponse {} +pub struct ConnectionQuerier<'a, Q: cosmwasm_std::CustomQuery> { + querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, +} +impl<'a, Q: cosmwasm_std::CustomQuery> ConnectionQuerier<'a, Q> { + pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self { + Self { querier } + } + pub fn connection( + &self, + connection_id: ::prost::alloc::string::String, + ) -> Result { + QueryConnectionRequest { connection_id }.query(self.querier) + } + pub fn connections( + &self, + pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + ) -> Result { + QueryConnectionsRequest { pagination }.query(self.querier) + } + pub fn client_connections( + &self, + client_id: ::prost::alloc::string::String, + ) -> Result { + QueryClientConnectionsRequest { client_id }.query(self.querier) + } + pub fn connection_client_state( + &self, + connection_id: ::prost::alloc::string::String, + ) -> Result { + QueryConnectionClientStateRequest { connection_id }.query(self.querier) + } + pub fn connection_consensus_state( + &self, + connection_id: ::prost::alloc::string::String, + revision_number: u64, + revision_height: u64, + ) -> Result { + QueryConnectionConsensusStateRequest { + connection_id, + revision_number, + revision_height, + } + .query(self.querier) + } + pub fn connection_params( + &self, + ) -> Result { + QueryConnectionParamsRequest {}.query(self.querier) + } +} diff --git a/packages/provwasm-std/src/types/ibc/core/mod.rs b/packages/provwasm-std/src/types/ibc/core/mod.rs index 3100491c..f87e72ba 100644 --- a/packages/provwasm-std/src/types/ibc/core/mod.rs +++ b/packages/provwasm-std/src/types/ibc/core/mod.rs @@ -1,2 +1,6 @@ pub mod channel; pub mod client; +pub mod commitment; +pub mod connection; +pub mod port; +pub mod types; diff --git a/packages/provwasm-std/src/types/ibc/core/port/mod.rs b/packages/provwasm-std/src/types/ibc/core/port/mod.rs new file mode 100644 index 00000000..a3a6d96c --- /dev/null +++ b/packages/provwasm-std/src/types/ibc/core/port/mod.rs @@ -0,0 +1 @@ +pub mod v1; diff --git a/packages/provwasm-std/src/types/ibc/core/port/v1.rs b/packages/provwasm-std/src/types/ibc/core/port/v1.rs new file mode 100644 index 00000000..7c65b218 --- /dev/null +++ b/packages/provwasm-std/src/types/ibc/core/port/v1.rs @@ -0,0 +1,85 @@ +use provwasm_proc_macro::CosmwasmExt; +/// QueryAppVersionRequest is the request type for the Query/AppVersion 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 = "/ibc.core.port.v1.QueryAppVersionRequest")] +#[proto_query( + path = "/ibc.core.port.v1.Query/AppVersion", + response_type = QueryAppVersionResponse +)] +pub struct QueryAppVersionRequest { + /// port unique identifier + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + /// connection unique identifier + #[prost(string, tag = "2")] + pub connection_id: ::prost::alloc::string::String, + /// whether the channel is ordered or unordered + #[prost(enumeration = "super::super::channel::v1::Order", tag = "3")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub ordering: i32, + /// counterparty channel end + #[prost(message, optional, tag = "4")] + pub counterparty: ::core::option::Option, + /// proposed version + #[prost(string, tag = "5")] + pub proposed_version: ::prost::alloc::string::String, +} +/// QueryAppVersionResponse is the response type for the Query/AppVersion 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 = "/ibc.core.port.v1.QueryAppVersionResponse")] +pub struct QueryAppVersionResponse { + /// port id associated with the request identifiers + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + /// supported app version + #[prost(string, tag = "2")] + pub version: ::prost::alloc::string::String, +} +pub struct PortQuerier<'a, Q: cosmwasm_std::CustomQuery> { + querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, +} +impl<'a, Q: cosmwasm_std::CustomQuery> PortQuerier<'a, Q> { + pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self { + Self { querier } + } + pub fn app_version( + &self, + port_id: ::prost::alloc::string::String, + connection_id: ::prost::alloc::string::String, + ordering: i32, + counterparty: ::core::option::Option, + proposed_version: ::prost::alloc::string::String, + ) -> Result { + QueryAppVersionRequest { + port_id, + connection_id, + ordering, + counterparty, + proposed_version, + } + .query(self.querier) + } +} diff --git a/packages/provwasm-std/src/types/ibc/core/types/mod.rs b/packages/provwasm-std/src/types/ibc/core/types/mod.rs new file mode 100644 index 00000000..a3a6d96c --- /dev/null +++ b/packages/provwasm-std/src/types/ibc/core/types/mod.rs @@ -0,0 +1 @@ +pub mod v1; diff --git a/packages/provwasm-std/src/types/ibc/core/types/v1.rs b/packages/provwasm-std/src/types/ibc/core/types/v1.rs new file mode 100644 index 00000000..0ccc3b86 --- /dev/null +++ b/packages/provwasm-std/src/types/ibc/core/types/v1.rs @@ -0,0 +1,25 @@ +use provwasm_proc_macro::CosmwasmExt; +/// GenesisState defines the ibc module's genesis state. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.core.types.v1.GenesisState")] +pub struct GenesisState { + /// ICS002 - Clients genesis state + #[prost(message, optional, tag = "1")] + pub client_genesis: ::core::option::Option, + /// ICS003 - Connections genesis state + #[prost(message, optional, tag = "2")] + pub connection_genesis: ::core::option::Option, + /// ICS004 - Channel genesis state + #[prost(message, optional, tag = "3")] + pub channel_genesis: ::core::option::Option, +} diff --git a/packages/provwasm-std/src/types/ibc/lightclients/localhost/mod.rs b/packages/provwasm-std/src/types/ibc/lightclients/localhost/mod.rs new file mode 100644 index 00000000..7083bd82 --- /dev/null +++ b/packages/provwasm-std/src/types/ibc/lightclients/localhost/mod.rs @@ -0,0 +1 @@ +pub mod v2; diff --git a/packages/provwasm-std/src/types/ibc/lightclients/localhost/v2.rs b/packages/provwasm-std/src/types/ibc/lightclients/localhost/v2.rs new file mode 100644 index 00000000..ed8fa748 --- /dev/null +++ b/packages/provwasm-std/src/types/ibc/lightclients/localhost/v2.rs @@ -0,0 +1,19 @@ +use provwasm_proc_macro::CosmwasmExt; +/// ClientState defines the 09-localhost client state +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.localhost.v2.ClientState")] +pub struct ClientState { + /// the latest block height + #[prost(message, optional, tag = "1")] + pub latest_height: ::core::option::Option, +} diff --git a/packages/provwasm-std/src/types/ibc/lightclients/mod.rs b/packages/provwasm-std/src/types/ibc/lightclients/mod.rs new file mode 100644 index 00000000..c8725b46 --- /dev/null +++ b/packages/provwasm-std/src/types/ibc/lightclients/mod.rs @@ -0,0 +1,4 @@ +pub mod localhost; +pub mod solomachine; +pub mod tendermint; +pub mod wasm; diff --git a/packages/provwasm-std/src/types/ibc/lightclients/solomachine/mod.rs b/packages/provwasm-std/src/types/ibc/lightclients/solomachine/mod.rs new file mode 100644 index 00000000..e55f7d1f --- /dev/null +++ b/packages/provwasm-std/src/types/ibc/lightclients/solomachine/mod.rs @@ -0,0 +1,2 @@ +pub mod v2; +pub mod v3; diff --git a/packages/provwasm-std/src/types/ibc/lightclients/solomachine/v2.rs b/packages/provwasm-std/src/types/ibc/lightclients/solomachine/v2.rs new file mode 100644 index 00000000..f4be2063 --- /dev/null +++ b/packages/provwasm-std/src/types/ibc/lightclients/solomachine/v2.rs @@ -0,0 +1,527 @@ +use provwasm_proc_macro::CosmwasmExt; +/// ClientState defines a solo machine client that tracks the current consensus +/// state and if the client is frozen. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v2.ClientState")] +pub struct ClientState { + /// latest sequence of the client state + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub sequence: u64, + /// frozen sequence of the solo machine + #[prost(bool, tag = "2")] + pub is_frozen: bool, + #[prost(message, optional, tag = "3")] + pub consensus_state: ::core::option::Option, + /// when set to true, will allow governance to update a solo machine client. + /// The client will be unfrozen if it is frozen. + #[prost(bool, tag = "4")] + pub allow_update_after_proposal: bool, +} +/// ConsensusState defines a solo machine consensus state. The sequence of a +/// consensus state is contained in the "height" key used in storing the +/// consensus state. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v2.ConsensusState")] +pub struct ConsensusState { + /// public key of the solo machine + #[prost(message, optional, tag = "1")] + pub public_key: ::core::option::Option, + /// diversifier allows the same public key to be re-used across different solo + /// machine clients (potentially on different chains) without being considered + /// misbehaviour. + #[prost(string, tag = "2")] + pub diversifier: ::prost::alloc::string::String, + #[prost(uint64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub timestamp: u64, +} +/// Header defines a solo machine consensus header +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v2.Header")] +pub struct Header { + /// sequence to update solo machine public key at + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub sequence: u64, + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub timestamp: u64, + #[prost(bytes = "vec", tag = "3")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub signature: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "4")] + pub new_public_key: ::core::option::Option, + #[prost(string, tag = "5")] + pub new_diversifier: ::prost::alloc::string::String, +} +/// Misbehaviour defines misbehaviour for a solo machine which consists +/// of a sequence and two signatures over different messages at that sequence. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v2.Misbehaviour")] +pub struct Misbehaviour { + #[prost(string, tag = "1")] + pub client_id: ::prost::alloc::string::String, + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub sequence: u64, + #[prost(message, optional, tag = "3")] + pub signature_one: ::core::option::Option, + #[prost(message, optional, tag = "4")] + pub signature_two: ::core::option::Option, +} +/// SignatureAndData contains a signature and the data signed over to create that +/// signature. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v2.SignatureAndData")] +pub struct SignatureAndData { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub signature: ::prost::alloc::vec::Vec, + #[prost(enumeration = "DataType", tag = "2")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub data_type: i32, + #[prost(bytes = "vec", tag = "3")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, + #[prost(uint64, tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub timestamp: u64, +} +/// TimestampedSignatureData contains the signature data and the timestamp of the +/// signature. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v2.TimestampedSignatureData")] +pub struct TimestampedSignatureData { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub signature_data: ::prost::alloc::vec::Vec, + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub timestamp: u64, +} +/// SignBytes defines the signed bytes used for signature verification. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v2.SignBytes")] +pub struct SignBytes { + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub sequence: u64, + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub timestamp: u64, + #[prost(string, tag = "3")] + pub diversifier: ::prost::alloc::string::String, + /// type of the data used + #[prost(enumeration = "DataType", tag = "4")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub data_type: i32, + /// marshaled data + #[prost(bytes = "vec", tag = "5")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, +} +/// HeaderData returns the SignBytes data for update verification. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v2.HeaderData")] +pub struct HeaderData { + /// header public key + #[prost(message, optional, tag = "1")] + pub new_pub_key: ::core::option::Option, + /// header diversifier + #[prost(string, tag = "2")] + pub new_diversifier: ::prost::alloc::string::String, +} +/// ClientStateData returns the SignBytes data for client state verification. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v2.ClientStateData")] +pub struct ClientStateData { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub path: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "2")] + pub client_state: ::core::option::Option, +} +/// ConsensusStateData returns the SignBytes data for consensus state +/// verification. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v2.ConsensusStateData")] +pub struct ConsensusStateData { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub path: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "2")] + pub consensus_state: ::core::option::Option, +} +/// ConnectionStateData returns the SignBytes data for connection state +/// verification. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v2.ConnectionStateData")] +pub struct ConnectionStateData { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub path: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "2")] + pub connection: + ::core::option::Option, +} +/// ChannelStateData returns the SignBytes data for channel state +/// verification. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v2.ChannelStateData")] +pub struct ChannelStateData { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub path: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "2")] + pub channel: ::core::option::Option, +} +/// PacketCommitmentData returns the SignBytes data for packet commitment +/// verification. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v2.PacketCommitmentData")] +pub struct PacketCommitmentData { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub path: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub commitment: ::prost::alloc::vec::Vec, +} +/// PacketAcknowledgementData returns the SignBytes data for acknowledgement +/// verification. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v2.PacketAcknowledgementData")] +pub struct PacketAcknowledgementData { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub path: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub acknowledgement: ::prost::alloc::vec::Vec, +} +/// PacketReceiptAbsenceData returns the SignBytes data for +/// packet receipt absence verification. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData")] +pub struct PacketReceiptAbsenceData { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub path: ::prost::alloc::vec::Vec, +} +/// NextSequenceRecvData returns the SignBytes data for verification of the next +/// sequence to be received. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v2.NextSequenceRecvData")] +pub struct NextSequenceRecvData { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub path: ::prost::alloc::vec::Vec, + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub next_seq_recv: u64, +} +/// DataType defines the type of solo machine proof being created. This is done +/// to preserve uniqueness of different data sign byte encodings. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +pub enum DataType { + /// Default State + UninitializedUnspecified = 0, + /// Data type for client state verification + ClientState = 1, + /// Data type for consensus state verification + ConsensusState = 2, + /// Data type for connection state verification + ConnectionState = 3, + /// Data type for channel state verification + ChannelState = 4, + /// Data type for packet commitment verification + PacketCommitment = 5, + /// Data type for packet acknowledgement verification + PacketAcknowledgement = 6, + /// Data type for packet receipt absence verification + PacketReceiptAbsence = 7, + /// Data type for next sequence recv verification + NextSequenceRecv = 8, + /// Data type for header verification + Header = 9, +} +impl DataType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + DataType::UninitializedUnspecified => "DATA_TYPE_UNINITIALIZED_UNSPECIFIED", + DataType::ClientState => "DATA_TYPE_CLIENT_STATE", + DataType::ConsensusState => "DATA_TYPE_CONSENSUS_STATE", + DataType::ConnectionState => "DATA_TYPE_CONNECTION_STATE", + DataType::ChannelState => "DATA_TYPE_CHANNEL_STATE", + DataType::PacketCommitment => "DATA_TYPE_PACKET_COMMITMENT", + DataType::PacketAcknowledgement => "DATA_TYPE_PACKET_ACKNOWLEDGEMENT", + DataType::PacketReceiptAbsence => "DATA_TYPE_PACKET_RECEIPT_ABSENCE", + DataType::NextSequenceRecv => "DATA_TYPE_NEXT_SEQUENCE_RECV", + DataType::Header => "DATA_TYPE_HEADER", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "DATA_TYPE_UNINITIALIZED_UNSPECIFIED" => Some(Self::UninitializedUnspecified), + "DATA_TYPE_CLIENT_STATE" => Some(Self::ClientState), + "DATA_TYPE_CONSENSUS_STATE" => Some(Self::ConsensusState), + "DATA_TYPE_CONNECTION_STATE" => Some(Self::ConnectionState), + "DATA_TYPE_CHANNEL_STATE" => Some(Self::ChannelState), + "DATA_TYPE_PACKET_COMMITMENT" => Some(Self::PacketCommitment), + "DATA_TYPE_PACKET_ACKNOWLEDGEMENT" => Some(Self::PacketAcknowledgement), + "DATA_TYPE_PACKET_RECEIPT_ABSENCE" => Some(Self::PacketReceiptAbsence), + "DATA_TYPE_NEXT_SEQUENCE_RECV" => Some(Self::NextSequenceRecv), + "DATA_TYPE_HEADER" => Some(Self::Header), + _ => None, + } + } +} diff --git a/packages/provwasm-std/src/types/ibc/lightclients/solomachine/v3.rs b/packages/provwasm-std/src/types/ibc/lightclients/solomachine/v3.rs new file mode 100644 index 00000000..99ce8e87 --- /dev/null +++ b/packages/provwasm-std/src/types/ibc/lightclients/solomachine/v3.rs @@ -0,0 +1,252 @@ +use provwasm_proc_macro::CosmwasmExt; +/// ClientState defines a solo machine client that tracks the current consensus +/// state and if the client is frozen. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v3.ClientState")] +pub struct ClientState { + /// latest sequence of the client state + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub sequence: u64, + /// frozen sequence of the solo machine + #[prost(bool, tag = "2")] + pub is_frozen: bool, + #[prost(message, optional, tag = "3")] + pub consensus_state: ::core::option::Option, +} +/// ConsensusState defines a solo machine consensus state. The sequence of a +/// consensus state is contained in the "height" key used in storing the +/// consensus state. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v3.ConsensusState")] +pub struct ConsensusState { + /// public key of the solo machine + #[prost(message, optional, tag = "1")] + pub public_key: ::core::option::Option, + /// diversifier allows the same public key to be re-used across different solo + /// machine clients (potentially on different chains) without being considered + /// misbehaviour. + #[prost(string, tag = "2")] + pub diversifier: ::prost::alloc::string::String, + #[prost(uint64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub timestamp: u64, +} +/// Header defines a solo machine consensus header +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v3.Header")] +pub struct Header { + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub timestamp: u64, + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub signature: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "3")] + pub new_public_key: ::core::option::Option, + #[prost(string, tag = "4")] + pub new_diversifier: ::prost::alloc::string::String, +} +/// Misbehaviour defines misbehaviour for a solo machine which consists +/// of a sequence and two signatures over different messages at that sequence. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v3.Misbehaviour")] +pub struct Misbehaviour { + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub sequence: u64, + #[prost(message, optional, tag = "2")] + pub signature_one: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub signature_two: ::core::option::Option, +} +/// SignatureAndData contains a signature and the data signed over to create that +/// signature. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v3.SignatureAndData")] +pub struct SignatureAndData { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub signature: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub path: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "3")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, + #[prost(uint64, tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub timestamp: u64, +} +/// TimestampedSignatureData contains the signature data and the timestamp of the +/// signature. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v3.TimestampedSignatureData")] +pub struct TimestampedSignatureData { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub signature_data: ::prost::alloc::vec::Vec, + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub timestamp: u64, +} +/// SignBytes defines the signed bytes used for signature verification. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v3.SignBytes")] +pub struct SignBytes { + /// the sequence number + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub sequence: u64, + /// the proof timestamp + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub timestamp: u64, + /// the public key diversifier + #[prost(string, tag = "3")] + pub diversifier: ::prost::alloc::string::String, + /// the standardised path bytes + #[prost(bytes = "vec", tag = "4")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub path: ::prost::alloc::vec::Vec, + /// the marshaled data bytes + #[prost(bytes = "vec", tag = "5")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, +} +/// HeaderData returns the SignBytes data for update verification. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.solomachine.v3.HeaderData")] +pub struct HeaderData { + /// header public key + #[prost(message, optional, tag = "1")] + pub new_pub_key: ::core::option::Option, + /// header diversifier + #[prost(string, tag = "2")] + pub new_diversifier: ::prost::alloc::string::String, +} diff --git a/packages/provwasm-std/src/types/ibc/lightclients/tendermint/mod.rs b/packages/provwasm-std/src/types/ibc/lightclients/tendermint/mod.rs new file mode 100644 index 00000000..a3a6d96c --- /dev/null +++ b/packages/provwasm-std/src/types/ibc/lightclients/tendermint/mod.rs @@ -0,0 +1 @@ +pub mod v1; diff --git a/packages/provwasm-std/src/types/ibc/lightclients/tendermint/v1.rs b/packages/provwasm-std/src/types/ibc/lightclients/tendermint/v1.rs new file mode 100644 index 00000000..60368c83 --- /dev/null +++ b/packages/provwasm-std/src/types/ibc/lightclients/tendermint/v1.rs @@ -0,0 +1,175 @@ +use provwasm_proc_macro::CosmwasmExt; +/// ClientState from Tendermint tracks the current validator set, latest height, +/// and a possible frozen height. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.tendermint.v1.ClientState")] +pub struct ClientState { + #[prost(string, tag = "1")] + pub chain_id: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub trust_level: ::core::option::Option, + /// duration of the period since the LastestTimestamp during which the + /// submitted headers are valid for upgrade + #[prost(message, optional, tag = "3")] + pub trusting_period: ::core::option::Option, + /// duration of the staking unbonding period + #[prost(message, optional, tag = "4")] + pub unbonding_period: ::core::option::Option, + /// defines how much new (untrusted) header's Time can drift into the future. + #[prost(message, optional, tag = "5")] + pub max_clock_drift: ::core::option::Option, + /// Block height when the client was frozen due to a misbehaviour + #[prost(message, optional, tag = "6")] + pub frozen_height: ::core::option::Option, + /// Latest height the client was updated to + #[prost(message, optional, tag = "7")] + pub latest_height: ::core::option::Option, + /// Proof specifications used in verifying counterparty state + #[prost(message, repeated, tag = "8")] + pub proof_specs: + ::prost::alloc::vec::Vec, + /// Path at which next upgraded client will be committed. + /// Each element corresponds to the key for a single CommitmentProof in the + /// chained proof. NOTE: ClientState must stored under + /// `{upgradePath}/{upgradeHeight}/clientState` ConsensusState must be stored + /// under `{upgradepath}/{upgradeHeight}/consensusState` For SDK chains using + /// the default upgrade module, upgrade_path should be \[\]string{"upgrade", + /// "upgradedIBCState"}` + #[prost(string, repeated, tag = "9")] + pub upgrade_path: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// allow_update_after_expiry is deprecated + #[deprecated] + #[prost(bool, tag = "10")] + pub allow_update_after_expiry: bool, + /// allow_update_after_misbehaviour is deprecated + #[deprecated] + #[prost(bool, tag = "11")] + pub allow_update_after_misbehaviour: bool, +} +/// ConsensusState defines the consensus state from Tendermint. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.tendermint.v1.ConsensusState")] +pub struct ConsensusState { + /// timestamp that corresponds to the block height in which the ConsensusState + /// was stored. + #[prost(message, optional, tag = "1")] + pub timestamp: ::core::option::Option, + /// commitment root (i.e app hash) + #[prost(message, optional, tag = "2")] + pub root: ::core::option::Option, + #[prost(bytes = "vec", tag = "3")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub next_validators_hash: ::prost::alloc::vec::Vec, +} +/// Misbehaviour is a wrapper over two conflicting Headers +/// that implements Misbehaviour interface expected by ICS-02 +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.tendermint.v1.Misbehaviour")] +pub struct Misbehaviour { + /// ClientID is deprecated + #[deprecated] + #[prost(string, tag = "1")] + pub client_id: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub header_1: ::core::option::Option
, + #[prost(message, optional, tag = "3")] + pub header_2: ::core::option::Option
, +} +/// Header defines the Tendermint client consensus Header. +/// It encapsulates all the information necessary to update from a trusted +/// Tendermint ConsensusState. The inclusion of TrustedHeight and +/// TrustedValidators allows this update to process correctly, so long as the +/// ConsensusState for the TrustedHeight exists, this removes race conditions +/// among relayers The SignedHeader and ValidatorSet are the new untrusted update +/// fields for the client. The TrustedHeight is the height of a stored +/// ConsensusState on the client that will be used to verify the new untrusted +/// header. The Trusted ConsensusState must be within the unbonding period of +/// current time in order to correctly verify, and the TrustedValidators must +/// hash to TrustedConsensusState.NextValidatorsHash since that is the last +/// trusted validator set at the TrustedHeight. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.tendermint.v1.Header")] +pub struct Header { + #[prost(message, optional, tag = "1")] + pub signed_header: + ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub validator_set: + ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub trusted_height: ::core::option::Option, + #[prost(message, optional, tag = "4")] + pub trusted_validators: + ::core::option::Option, +} +/// Fraction defines the protobuf message type for tmmath.Fraction that only +/// supports positive values. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.tendermint.v1.Fraction")] +pub struct Fraction { + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub numerator: u64, + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub denominator: u64, +} diff --git a/packages/provwasm-std/src/types/ibc/lightclients/wasm/mod.rs b/packages/provwasm-std/src/types/ibc/lightclients/wasm/mod.rs new file mode 100644 index 00000000..a3a6d96c --- /dev/null +++ b/packages/provwasm-std/src/types/ibc/lightclients/wasm/mod.rs @@ -0,0 +1 @@ +pub mod v1; diff --git a/packages/provwasm-std/src/types/ibc/lightclients/wasm/v1.rs b/packages/provwasm-std/src/types/ibc/lightclients/wasm/v1.rs new file mode 100644 index 00000000..b6ec853a --- /dev/null +++ b/packages/provwasm-std/src/types/ibc/lightclients/wasm/v1.rs @@ -0,0 +1,384 @@ +use provwasm_proc_macro::CosmwasmExt; +/// GenesisState defines 08-wasm's keeper genesis state +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.wasm.v1.GenesisState")] +pub struct GenesisState { + /// uploaded light client wasm contracts + #[prost(message, repeated, tag = "1")] + pub contracts: ::prost::alloc::vec::Vec, +} +/// Contract stores contract code +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.wasm.v1.Contract")] +pub struct Contract { + /// contract byte code + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub code_bytes: ::prost::alloc::vec::Vec, +} +/// QueryChecksumsRequest is the request type for the Query/Checksums 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 = "/ibc.lightclients.wasm.v1.QueryChecksumsRequest")] +#[proto_query( + path = "/ibc.lightclients.wasm.v1.Query/Checksums", + response_type = QueryChecksumsResponse +)] +pub struct QueryChecksumsRequest { + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "1")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, +} +/// QueryChecksumsResponse is the response type for the Query/Checksums 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 = "/ibc.lightclients.wasm.v1.QueryChecksumsResponse")] +pub struct QueryChecksumsResponse { + /// checksums is a list of the hex encoded checksums of all wasm codes stored. + #[prost(string, repeated, tag = "1")] + pub checksums: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageResponse, + >, +} +/// QueryCodeRequest is the request type for the Query/Code 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 = "/ibc.lightclients.wasm.v1.QueryCodeRequest")] +#[proto_query( + path = "/ibc.lightclients.wasm.v1.Query/Code", + response_type = QueryCodeResponse +)] +pub struct QueryCodeRequest { + /// checksum is a hex encoded string of the code stored. + #[prost(string, tag = "1")] + pub checksum: ::prost::alloc::string::String, +} +/// QueryCodeResponse is the response type for the Query/Code 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 = "/ibc.lightclients.wasm.v1.QueryCodeResponse")] +pub struct QueryCodeResponse { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, +} +/// MsgStoreCode defines the request type for the StoreCode rpc. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.wasm.v1.MsgStoreCode")] +pub struct MsgStoreCode { + /// signer address + #[prost(string, tag = "1")] + pub signer: ::prost::alloc::string::String, + /// wasm byte code of light client contract. It can be raw or gzip compressed + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub wasm_byte_code: ::prost::alloc::vec::Vec, +} +/// MsgStoreCodeResponse defines the response type for the StoreCode rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.wasm.v1.MsgStoreCodeResponse")] +pub struct MsgStoreCodeResponse { + /// checksum is the sha256 hash of the stored code + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub checksum: ::prost::alloc::vec::Vec, +} +/// MsgRemoveChecksum defines the request type for the MsgRemoveChecksum rpc. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.wasm.v1.MsgRemoveChecksum")] +pub struct MsgRemoveChecksum { + /// signer address + #[prost(string, tag = "1")] + pub signer: ::prost::alloc::string::String, + /// checksum is the sha256 hash to be removed from the store + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub checksum: ::prost::alloc::vec::Vec, +} +/// MsgStoreChecksumResponse defines the response type for the StoreCode rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.wasm.v1.MsgRemoveChecksumResponse")] +pub struct MsgRemoveChecksumResponse {} +/// MsgMigrateContract defines the request type for the MigrateContract rpc. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.wasm.v1.MsgMigrateContract")] +pub struct MsgMigrateContract { + /// signer address + #[prost(string, tag = "1")] + pub signer: ::prost::alloc::string::String, + /// the client id of the contract + #[prost(string, tag = "2")] + pub client_id: ::prost::alloc::string::String, + /// checksum is the sha256 hash of the new wasm byte code for the contract + #[prost(bytes = "vec", tag = "3")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub checksum: ::prost::alloc::vec::Vec, + /// the json encoded message to be passed to the contract on migration + #[prost(bytes = "vec", tag = "4")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub msg: ::prost::alloc::vec::Vec, +} +/// MsgMigrateContractResponse defines the response type for the MigrateContract rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.wasm.v1.MsgMigrateContractResponse")] +pub struct MsgMigrateContractResponse {} +/// Wasm light client's Client state +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.wasm.v1.ClientState")] +pub struct ClientState { + /// bytes encoding the client state of the underlying light client + /// implemented as a Wasm contract. + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub checksum: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "3")] + pub latest_height: ::core::option::Option, +} +/// Wasm light client's ConsensusState +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.wasm.v1.ConsensusState")] +pub struct ConsensusState { + /// bytes encoding the consensus state of the underlying light client + /// implemented as a Wasm contract. + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, +} +/// Wasm light client message (either header(s) or misbehaviour) +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.wasm.v1.ClientMessage")] +pub struct ClientMessage { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, +} +/// Checksums defines a list of all checksums that are stored +/// +/// Deprecated: This message is deprecated in favor of storing the checksums +/// using a Collections.KeySet. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/ibc.lightclients.wasm.v1.Checksums")] +#[deprecated] +pub struct Checksums { + #[prost(bytes = "vec", repeated, tag = "1")] + pub checksums: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, +} +pub struct WasmQuerier<'a, Q: cosmwasm_std::CustomQuery> { + querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, +} +impl<'a, Q: cosmwasm_std::CustomQuery> WasmQuerier<'a, Q> { + pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self { + Self { querier } + } + pub fn checksums( + &self, + pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + ) -> Result { + QueryChecksumsRequest { pagination }.query(self.querier) + } + pub fn code( + &self, + checksum: ::prost::alloc::string::String, + ) -> Result { + QueryCodeRequest { checksum }.query(self.querier) + } +} diff --git a/packages/provwasm-std/src/types/ibc/mod.rs b/packages/provwasm-std/src/types/ibc/mod.rs index 36991fc0..c37ae57d 100644 --- a/packages/provwasm-std/src/types/ibc/mod.rs +++ b/packages/provwasm-std/src/types/ibc/mod.rs @@ -1,2 +1,3 @@ pub mod applications; pub mod core; +pub mod lightclients; From 5b6ba2f6beaf2c80586b0f53d61f47930f2643b9 Mon Sep 17 00:00:00 2001 From: kwt <4344285+kwtalley@users.noreply.github.com> Date: Fri, 12 Jul 2024 01:19:41 -0500 Subject: [PATCH 22/43] add generated provenance types --- .../src/types/provenance/attribute/v1.rs | 455 +++- .../src/types/provenance/exchange/v1.rs | 1917 +++++++++++++++-- .../src/types/provenance/hold/v1.rs | 37 + .../src/types/provenance/ibchooks/v1.rs | 44 + .../src/types/provenance/ibcratelimit/v1.rs | 92 + .../src/types/provenance/marker/v1.rs | 1126 +++++++++- .../provenance/metadata/{v1.rs => v1/mod.rs} | 1743 ++++++++++++--- .../src/types/provenance/metadata/v1/p8e.rs | 727 +++++++ .../provwasm-std/src/types/provenance/mod.rs | 4 +- .../src/types/provenance/msgfees/v1.rs | 430 ++++ .../src/types/provenance/name/v1.rs | 149 ++ .../src/types/provenance/oracle/v1.rs | 107 + .../src/types/provenance/reward/mod.rs | 1 - .../src/types/provenance/reward/v1.rs | 1105 ---------- .../src/types/provenance/trigger/v1.rs | 211 +- 15 files changed, 6427 insertions(+), 1721 deletions(-) rename packages/provwasm-std/src/types/provenance/metadata/{v1.rs => v1/mod.rs} (54%) create mode 100644 packages/provwasm-std/src/types/provenance/metadata/v1/p8e.rs delete mode 100644 packages/provwasm-std/src/types/provenance/reward/mod.rs delete mode 100644 packages/provwasm-std/src/types/provenance/reward/v1.rs diff --git a/packages/provwasm-std/src/types/provenance/attribute/v1.rs b/packages/provwasm-std/src/types/provenance/attribute/v1.rs index 8c2101bc..ce19065d 100644 --- a/packages/provwasm-std/src/types/provenance/attribute/v1.rs +++ b/packages/provwasm-std/src/types/provenance/attribute/v1.rs @@ -1,5 +1,5 @@ use provwasm_proc_macro::CosmwasmExt; -use serde::Deserialize; +/// Params defines the set of params for the attribute module. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -13,9 +13,15 @@ use serde::Deserialize; )] #[proto_message(type_url = "/provenance.attribute.v1.Params")] pub struct Params { + /// maximum length of data to allow in an attribute value #[prost(uint32, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] pub max_value_length: u32, } +/// Attribute holds a typed key/value structure for data associated with an account #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -29,25 +35,31 @@ pub struct Params { )] #[proto_message(type_url = "/provenance.attribute.v1.Attribute")] pub struct Attribute { + /// The attribute name. #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, + /// The attribute value. #[prost(bytes = "vec", tag = "2")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" )] pub value: ::prost::alloc::vec::Vec, + /// The attribute value type. #[prost(enumeration = "AttributeType", tag = "3")] #[serde( - serialize_with = "AttributeType::serialize", - deserialize_with = "AttributeType::deserialize" + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" )] pub attribute_type: i32, + /// The address the attribute is bound to #[prost(string, tag = "4")] pub address: ::prost::alloc::string::String, + /// Time that an attribute will expire. #[prost(message, optional, tag = "5")] pub expiration_date: ::core::option::Option, } +/// EventAttributeAdd event emitted when attribute is added #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -74,6 +86,7 @@ pub struct EventAttributeAdd { #[prost(string, tag = "6")] pub expiration: ::prost::alloc::string::String, } +/// EventAttributeUpdate event emitted when attribute is updated #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -102,6 +115,34 @@ pub struct EventAttributeUpdate { #[prost(string, tag = "7")] pub owner: ::prost::alloc::string::String, } +/// EventAttributeExpirationUpdate event emitted when attribute expiration is updated +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.attribute.v1.EventAttributeExpirationUpdate")] +pub struct EventAttributeExpirationUpdate { + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub value: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub account: ::prost::alloc::string::String, + #[prost(string, tag = "4")] + pub owner: ::prost::alloc::string::String, + #[prost(string, tag = "5")] + pub original_expiration: ::prost::alloc::string::String, + #[prost(string, tag = "6")] + pub updated_expiration: ::prost::alloc::string::String, +} +/// EventAttributeDelete event emitted when attribute is deleted #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -122,6 +163,7 @@ pub struct EventAttributeDelete { #[prost(string, tag = "3")] pub owner: ::prost::alloc::string::String, } +/// EventAttributeDistinctDelete event emitted when attribute is deleted with matching value #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -146,18 +188,87 @@ pub struct EventAttributeDistinctDelete { #[prost(string, tag = "5")] pub owner: ::prost::alloc::string::String, } +/// EventAttributeExpired event emitted when attribute has expired and been deleted in BeginBlocker +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.attribute.v1.EventAttributeExpired")] +pub struct EventAttributeExpired { + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub value_hash: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub attribute_type: ::prost::alloc::string::String, + #[prost(string, tag = "4")] + pub account: ::prost::alloc::string::String, + #[prost(string, tag = "5")] + pub expiration: ::prost::alloc::string::String, +} +/// EventAccountDataUpdated event emitted when accountdata is set, updated, or deleted. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.attribute.v1.EventAccountDataUpdated")] +pub struct EventAccountDataUpdated { + #[prost(string, tag = "1")] + pub account: ::prost::alloc::string::String, +} +/// EventAttributeParamsUpdated event emitted when attribute params are updated. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.attribute.v1.EventAttributeParamsUpdated")] +pub struct EventAttributeParamsUpdated { + #[prost(string, tag = "1")] + pub max_value_length: ::prost::alloc::string::String, +} +/// AttributeType defines the type of the data stored in the attribute value #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] #[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] pub enum AttributeType { + /// ATTRIBUTE_TYPE_UNSPECIFIED defines an unknown/invalid type Unspecified = 0, + /// ATTRIBUTE_TYPE_UUID defines an attribute value that contains a string value representation of a V4 uuid Uuid = 1, + /// ATTRIBUTE_TYPE_JSON defines an attribute value that contains a byte string containing json data Json = 2, + /// ATTRIBUTE_TYPE_STRING defines an attribute value that contains a generic string value String = 3, + /// ATTRIBUTE_TYPE_URI defines an attribute value that contains a URI Uri = 4, + /// ATTRIBUTE_TYPE_INT defines an attribute value that contains an integer (cast as int64) Int = 5, + /// ATTRIBUTE_TYPE_FLOAT defines an attribute value that contains a float Float = 6, + /// ATTRIBUTE_TYPE_PROTO defines an attribute value that contains a serialized proto value in bytes Proto = 7, + /// ATTRIBUTE_TYPE_BYTES defines an attribute value that contains an untyped array of bytes Bytes = 8, } impl AttributeType { @@ -193,30 +304,29 @@ impl AttributeType { _ => None, } } - - pub fn serialize(v: &i32, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - let enum_value = Self::try_from(*v); - match enum_value { - Ok(v) => serializer.serialize_str(v.as_str_name()), - Err(e) => Err(serde::ser::Error::custom(e)), - } - } - - pub fn deserialize<'de, D>(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - use serde::de::Deserialize; - let s = String::deserialize(deserializer)?; - match Self::from_str_name(&s) { - Some(v) => Ok(v.into()), - None => Err(serde::de::Error::custom("unknown value")), - } - } } +/// GenesisState defines the attribute module's genesis state. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.attribute.v1.GenesisState")] +pub struct GenesisState { + /// params defines all the parameters of the module. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, + /// deposits defines all the deposits present at genesis. + #[prost(message, repeated, tag = "2")] + pub attributes: ::prost::alloc::vec::Vec, +} +/// QueryParamsRequest is the request type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -234,6 +344,7 @@ impl AttributeType { response_type = QueryParamsResponse )] pub struct QueryParamsRequest {} +/// QueryParamsResponse is the response type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -247,9 +358,11 @@ pub struct QueryParamsRequest {} )] #[proto_message(type_url = "/provenance.attribute.v1.QueryParamsResponse")] pub struct QueryParamsResponse { + /// params defines the parameters of the module. #[prost(message, optional, tag = "1")] pub params: ::core::option::Option, } +/// QueryAttributeRequest is the request type for the Query/Attribute method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -267,14 +380,18 @@ pub struct QueryParamsResponse { response_type = QueryAttributeResponse )] pub struct QueryAttributeRequest { + /// account defines the address to query for. #[prost(string, tag = "1")] pub account: ::prost::alloc::string::String, + /// name is the attribute name to query for #[prost(string, tag = "2")] pub name: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. #[prost(message, optional, tag = "3")] pub pagination: ::core::option::Option, } +/// QueryAttributeResponse is the response type for the Query/Attribute method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -288,14 +405,18 @@ pub struct QueryAttributeRequest { )] #[proto_message(type_url = "/provenance.attribute.v1.QueryAttributeResponse")] pub struct QueryAttributeResponse { + /// a string containing the address of the account the attributes are assigned to. #[prost(string, tag = "1")] pub account: ::prost::alloc::string::String, + /// a list of attribute values #[prost(message, repeated, tag = "2")] pub attributes: ::prost::alloc::vec::Vec, + /// pagination defines an optional pagination for the request. #[prost(message, optional, tag = "3")] pub pagination: ::core::option::Option, } +/// QueryAttributesRequest is the request type for the Query/Attributes method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -313,12 +434,15 @@ pub struct QueryAttributeResponse { response_type = QueryAttributesResponse )] pub struct QueryAttributesRequest { + /// account defines the address to query for. #[prost(string, tag = "1")] pub account: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } +/// QueryAttributesResponse is the response type for the Query/Attributes method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -332,14 +456,18 @@ pub struct QueryAttributesRequest { )] #[proto_message(type_url = "/provenance.attribute.v1.QueryAttributesResponse")] pub struct QueryAttributesResponse { + /// a string containing the address of the account the attributes are assigned to= #[prost(string, tag = "1")] pub account: ::prost::alloc::string::String, + /// a list of attribute values #[prost(message, repeated, tag = "2")] pub attributes: ::prost::alloc::vec::Vec, + /// pagination defines an optional pagination for the request. #[prost(message, optional, tag = "3")] pub pagination: ::core::option::Option, } +/// QueryScanRequest is the request type for the Query/Scan method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -357,14 +485,18 @@ pub struct QueryAttributesResponse { response_type = QueryScanResponse )] pub struct QueryScanRequest { + /// account defines the address to query for. #[prost(string, tag = "1")] pub account: ::prost::alloc::string::String, + /// name defines the partial attribute name to search for base on names being in RDNS format. #[prost(string, tag = "2")] pub suffix: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. #[prost(message, optional, tag = "3")] pub pagination: ::core::option::Option, } +/// QueryScanResponse is the response type for the Query/Scan method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -378,14 +510,107 @@ pub struct QueryScanRequest { )] #[proto_message(type_url = "/provenance.attribute.v1.QueryScanResponse")] pub struct QueryScanResponse { + /// a string containing the address of the account the attributes are assigned to= #[prost(string, tag = "1")] pub account: ::prost::alloc::string::String, + /// a list of attribute values #[prost(message, repeated, tag = "2")] pub attributes: ::prost::alloc::vec::Vec, + /// pagination defines an optional pagination for the request. #[prost(message, optional, tag = "3")] pub pagination: ::core::option::Option, } +/// QueryAttributeAccountsRequest is the request type for the Query/AttributeAccounts 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 = "/provenance.attribute.v1.QueryAttributeAccountsRequest")] +#[proto_query( + path = "/provenance.attribute.v1.Query/AttributeAccounts", + response_type = QueryAttributeAccountsResponse +)] +pub struct QueryAttributeAccountsRequest { + /// name is the attribute name to query for + #[prost(string, tag = "1")] + pub attribute_name: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "99")] + pub pagination: + ::core::option::Option, +} +/// QueryAttributeAccountsResponse is the response type for the Query/AttributeAccounts 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 = "/provenance.attribute.v1.QueryAttributeAccountsResponse")] +pub struct QueryAttributeAccountsResponse { + /// list of account addresses that have attributes of request name + #[prost(string, repeated, tag = "1")] + pub accounts: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "99")] + pub pagination: + ::core::option::Option, +} +/// QueryAccountDataRequest is the request type for the Query/AccountData 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 = "/provenance.attribute.v1.QueryAccountDataRequest")] +#[proto_query( + path = "/provenance.attribute.v1.Query/AccountData", + response_type = QueryAccountDataResponse +)] +pub struct QueryAccountDataRequest { + /// account is the bech32 address of the account to get the data for + #[prost(string, tag = "1")] + pub account: ::prost::alloc::string::String, +} +/// QueryAccountDataResponse is the response type for the Query/AccountData 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 = "/provenance.attribute.v1.QueryAccountDataResponse")] +pub struct QueryAccountDataResponse { + /// value is the accountdata attribute value for the requested account. + #[prost(string, tag = "1")] + pub value: ::prost::alloc::string::String, +} +/// MsgAddAttributeRequest defines an sdk.Msg type that is used to add a new attribute to an account. +/// Attributes may only be set in an account by the account that the attribute name resolves to. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -399,27 +624,34 @@ pub struct QueryScanResponse { )] #[proto_message(type_url = "/provenance.attribute.v1.MsgAddAttributeRequest")] pub struct MsgAddAttributeRequest { + /// The attribute name. #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, + /// The attribute value. #[prost(bytes = "vec", tag = "2")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" )] pub value: ::prost::alloc::vec::Vec, + /// The attribute value type. #[prost(enumeration = "AttributeType", tag = "3")] #[serde( - serialize_with = "AttributeType::serialize", - deserialize_with = "AttributeType::deserialize" + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" )] pub attribute_type: i32, + /// The account to add the attribute to. #[prost(string, tag = "4")] pub account: ::prost::alloc::string::String, + /// The address that the name must resolve to. #[prost(string, tag = "5")] pub owner: ::prost::alloc::string::String, + /// Time that an attribute will expire. #[prost(message, optional, tag = "6")] pub expiration_date: ::core::option::Option, } +/// MsgAddAttributeResponse defines the Msg/AddAttribute response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -433,6 +665,8 @@ pub struct MsgAddAttributeRequest { )] #[proto_message(type_url = "/provenance.attribute.v1.MsgAddAttributeResponse")] pub struct MsgAddAttributeResponse {} +/// MsgUpdateAttributeRequest defines an sdk.Msg type that is used to update an existing attribute to an account. +/// Attributes may only be set in an account by the account that the attribute name resolves to. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -446,37 +680,45 @@ pub struct MsgAddAttributeResponse {} )] #[proto_message(type_url = "/provenance.attribute.v1.MsgUpdateAttributeRequest")] pub struct MsgUpdateAttributeRequest { + /// The attribute name. #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, + /// The original attribute value. #[prost(bytes = "vec", tag = "2")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" )] pub original_value: ::prost::alloc::vec::Vec, + /// The update attribute value. #[prost(bytes = "vec", tag = "3")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" )] pub update_value: ::prost::alloc::vec::Vec, + /// The original attribute value type. #[prost(enumeration = "AttributeType", tag = "4")] #[serde( - serialize_with = "AttributeType::serialize", - deserialize_with = "AttributeType::deserialize" + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" )] pub original_attribute_type: i32, + /// The update attribute value type. #[prost(enumeration = "AttributeType", tag = "5")] #[serde( - serialize_with = "AttributeType::serialize", - deserialize_with = "AttributeType::deserialize" + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" )] pub update_attribute_type: i32, + /// The account to add the attribute to. #[prost(string, tag = "6")] pub account: ::prost::alloc::string::String, + /// The address that the name must resolve to. #[prost(string, tag = "7")] pub owner: ::prost::alloc::string::String, } +/// MsgUpdateAttributeResponse defines the Msg/UpdateAttribute response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -490,6 +732,57 @@ pub struct MsgUpdateAttributeRequest { )] #[proto_message(type_url = "/provenance.attribute.v1.MsgUpdateAttributeResponse")] pub struct MsgUpdateAttributeResponse {} +/// MsgUpdateAttributeExpirationRequest defines an sdk.Msg type that is used to update an existing attribute's expiration +/// date +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.attribute.v1.MsgUpdateAttributeExpirationRequest")] +pub struct MsgUpdateAttributeExpirationRequest { + /// The attribute name. + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + /// The original attribute value. + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub value: ::prost::alloc::vec::Vec, + /// Time that an attribute will expire. + #[prost(message, optional, tag = "3")] + pub expiration_date: ::core::option::Option, + /// The account to add the attribute to. + #[prost(string, tag = "4")] + pub account: ::prost::alloc::string::String, + /// The address that the name must resolve to. + #[prost(string, tag = "5")] + pub owner: ::prost::alloc::string::String, +} +/// MsgUpdateAttributeExpirationResponse defines the Msg/Vote 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 = "/provenance.attribute.v1.MsgUpdateAttributeExpirationResponse")] +pub struct MsgUpdateAttributeExpirationResponse {} +/// MsgDeleteAttributeRequest defines a message to delete an attribute from an account +/// Attributes may only be removed from an account by the account that the attribute name resolves to. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -503,13 +796,17 @@ pub struct MsgUpdateAttributeResponse {} )] #[proto_message(type_url = "/provenance.attribute.v1.MsgDeleteAttributeRequest")] pub struct MsgDeleteAttributeRequest { + /// The attribute name. #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, + /// The account to add the attribute to. #[prost(string, tag = "2")] pub account: ::prost::alloc::string::String, + /// The address that the name must resolve to. #[prost(string, tag = "3")] pub owner: ::prost::alloc::string::String, } +/// MsgDeleteAttributeResponse defines the Msg/DeleteAttribute response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -523,6 +820,8 @@ pub struct MsgDeleteAttributeRequest { )] #[proto_message(type_url = "/provenance.attribute.v1.MsgDeleteAttributeResponse")] pub struct MsgDeleteAttributeResponse {} +/// MsgDeleteDistinctAttributeRequest defines a message to delete an attribute with matching name, value, and type from +/// an account. Attributes may only be removed from an account by the account that the attribute name resolves to. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -536,19 +835,24 @@ pub struct MsgDeleteAttributeResponse {} )] #[proto_message(type_url = "/provenance.attribute.v1.MsgDeleteDistinctAttributeRequest")] pub struct MsgDeleteDistinctAttributeRequest { + /// The attribute name. #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, + /// The attribute value. #[prost(bytes = "vec", tag = "2")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" )] pub value: ::prost::alloc::vec::Vec, + /// The account to add the attribute to. #[prost(string, tag = "3")] pub account: ::prost::alloc::string::String, + /// The address that the name must resolve to. #[prost(string, tag = "4")] pub owner: ::prost::alloc::string::String, } +/// MsgDeleteDistinctAttributeResponse defines the Msg/DeleteDistinctAttribute response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -562,6 +866,74 @@ pub struct MsgDeleteDistinctAttributeRequest { )] #[proto_message(type_url = "/provenance.attribute.v1.MsgDeleteDistinctAttributeResponse")] pub struct MsgDeleteDistinctAttributeResponse {} +/// MsgSetAccountDataRequest defines a message to set an account's accountdata attribute. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.attribute.v1.MsgSetAccountDataRequest")] +pub struct MsgSetAccountDataRequest { + #[prost(string, tag = "1")] + pub value: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub account: ::prost::alloc::string::String, +} +/// MsgSetAccountDataResponse defines the Msg/SetAccountData 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 = "/provenance.attribute.v1.MsgSetAccountDataResponse")] +pub struct MsgSetAccountDataResponse {} +/// MsgUpdateParamsRequest is a request message for the UpdateParams endpoint. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.attribute.v1.MsgUpdateParamsRequest")] +pub struct MsgUpdateParamsRequest { + /// authority should be the governance module account address. + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// params are the new param values to set. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +/// MsgUpdateParamsResponse is a response message for the UpdateParams endpoint. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.attribute.v1.MsgUpdateParamsResponse")] +pub struct MsgUpdateParamsResponse {} pub struct AttributeQuerier<'a, Q: cosmwasm_std::CustomQuery> { querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, } @@ -615,4 +987,23 @@ impl<'a, Q: cosmwasm_std::CustomQuery> AttributeQuerier<'a, Q> { } .query(self.querier) } + pub fn attribute_accounts( + &self, + attribute_name: ::prost::alloc::string::String, + pagination: ::core::option::Option< + super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + ) -> Result { + QueryAttributeAccountsRequest { + attribute_name, + pagination, + } + .query(self.querier) + } + pub fn account_data( + &self, + account: ::prost::alloc::string::String, + ) -> Result { + QueryAccountDataRequest { account }.query(self.querier) + } } diff --git a/packages/provwasm-std/src/types/provenance/exchange/v1.rs b/packages/provwasm-std/src/types/provenance/exchange/v1.rs index 08cd60b3..ba93e317 100644 --- a/packages/provwasm-std/src/types/provenance/exchange/v1.rs +++ b/packages/provwasm-std/src/types/provenance/exchange/v1.rs @@ -1,4 +1,33 @@ use provwasm_proc_macro::CosmwasmExt; +/// Commitment contains information on committed funds. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.exchange.v1.Commitment")] +pub struct Commitment { + /// account is the bech32 address string with the committed funds. + #[prost(string, tag = "1")] + pub account: ::prost::alloc::string::String, + /// market_id is the numeric identifier of the market the funds are committed to. + #[prost(uint32, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub market_id: u32, + /// amount is the funds that have been committed by the account to the market. + #[prost(message, repeated, tag = "3")] + pub amount: ::prost::alloc::vec::Vec, +} +/// AccountAmount associates an account with a coins amount. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -12,11 +41,40 @@ use provwasm_proc_macro::CosmwasmExt; )] #[proto_message(type_url = "/provenance.exchange.v1.AccountAmount")] pub struct AccountAmount { + /// account is the bech32 address string of the account associated with the amount. #[prost(string, tag = "1")] pub account: ::prost::alloc::string::String, + /// amount is the funds associated with the address. + #[prost(message, repeated, tag = "2")] + pub amount: ::prost::alloc::vec::Vec, +} +/// MarketAmount associates a market with a coins amount. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.exchange.v1.MarketAmount")] +pub struct MarketAmount { + /// market_id is the numeric identifier the amount has been committed to. + #[prost(uint32, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub market_id: u32, + /// amount is the funds associated with the address. #[prost(message, repeated, tag = "2")] pub amount: ::prost::alloc::vec::Vec, } +/// NetAssetPrice is an association of assets and price used to record the value of things. +/// It is related to the NetAssetValue message from the x/marker module, and is therefore often referred to as "a NAV". #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -30,11 +88,14 @@ pub struct AccountAmount { )] #[proto_message(type_url = "/provenance.exchange.v1.NetAssetPrice")] pub struct NetAssetPrice { + /// assets is the volume and denom that has been bought or sold. #[prost(message, optional, tag = "1")] pub assets: ::core::option::Option, + /// price is what was paid for the assets. #[prost(message, optional, tag = "2")] pub price: ::core::option::Option, } +/// EventOrderCreated is an event emitted when an order is created. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -48,26 +109,28 @@ pub struct NetAssetPrice { )] #[proto_message(type_url = "/provenance.exchange.v1.EventOrderCreated")] pub struct EventOrderCreated { + /// order_id is the numerical identifier of the order created. #[prost(uint64, tag = "1")] - #[serde(alias = "orderID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub order_id: u64, + /// order_type is the type of order, e.g. "ask" or "bid". #[prost(string, tag = "2")] pub order_type: ::prost::alloc::string::String, + /// market_id is the numerical identifier of the market. #[prost(uint32, tag = "3")] - #[serde(alias = "marketID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub market_id: u32, + /// external_id is the order's external id. #[prost(string, tag = "4")] - #[serde(alias = "externalID")] pub external_id: ::prost::alloc::string::String, } +/// EventOrderCancelled is an event emitted when an order is cancelled. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -81,26 +144,29 @@ pub struct EventOrderCreated { )] #[proto_message(type_url = "/provenance.exchange.v1.EventOrderCancelled")] pub struct EventOrderCancelled { + /// order_id is the numerical identifier of the order cancelled. #[prost(uint64, tag = "1")] - #[serde(alias = "orderID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub order_id: u64, + /// cancelled_by is the account that triggered the cancellation of the order. #[prost(string, tag = "2")] pub cancelled_by: ::prost::alloc::string::String, + /// market_id is the numerical identifier of the market. #[prost(uint32, tag = "3")] - #[serde(alias = "marketID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub market_id: u32, + /// external_id is the order's external id. #[prost(string, tag = "4")] - #[serde(alias = "externalID")] pub external_id: ::prost::alloc::string::String, } +/// EventOrderFilled is an event emitted when an order has been filled in full. +/// This event is also used for orders that were previously partially filled, but have now been filled in full. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -114,30 +180,34 @@ pub struct EventOrderCancelled { )] #[proto_message(type_url = "/provenance.exchange.v1.EventOrderFilled")] pub struct EventOrderFilled { + /// order_id is the numerical identifier of the order filled. #[prost(uint64, tag = "1")] - #[serde(alias = "orderID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub order_id: u64, + /// assets is the coins amount string of assets bought/sold for this order. #[prost(string, tag = "2")] pub assets: ::prost::alloc::string::String, + /// price is the coins amount string of the price payed/received for this order. #[prost(string, tag = "3")] pub price: ::prost::alloc::string::String, + /// fees is the coins amount string of settlement fees paid with this order. #[prost(string, tag = "4")] pub fees: ::prost::alloc::string::String, + /// market_id is the numerical identifier of the market. #[prost(uint32, tag = "5")] - #[serde(alias = "marketID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub market_id: u32, + /// external_id is the order's external id. #[prost(string, tag = "6")] - #[serde(alias = "externalID")] pub external_id: ::prost::alloc::string::String, } +/// EventOrderPartiallyFilled is an event emitted when an order filled in part and still has more left to fill. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -151,30 +221,36 @@ pub struct EventOrderFilled { )] #[proto_message(type_url = "/provenance.exchange.v1.EventOrderPartiallyFilled")] pub struct EventOrderPartiallyFilled { + /// order_id is the numerical identifier of the order partially filled. #[prost(uint64, tag = "1")] - #[serde(alias = "orderID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub order_id: u64, + /// assets is the coins amount string of assets that were filled and removed from the order. #[prost(string, tag = "2")] pub assets: ::prost::alloc::string::String, + /// price is the coins amount string of the price payed/received for this order. + /// For ask orders, this might be more than the amount that was removed from the order's price. #[prost(string, tag = "3")] pub price: ::prost::alloc::string::String, + /// fees is the coins amount string of settlement fees paid with this partial order. + /// For ask orders, this might be more than the amount that was removed from the order's settlement fees. #[prost(string, tag = "4")] pub fees: ::prost::alloc::string::String, + /// market_id is the numerical identifier of the market. #[prost(uint32, tag = "5")] - #[serde(alias = "marketID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub market_id: u32, + /// external_id is the order's external id. #[prost(string, tag = "6")] - #[serde(alias = "externalID")] pub external_id: ::prost::alloc::string::String, } +/// EventOrderExternalIDUpdated is an event emitted when an order's external id is updated. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -188,24 +264,87 @@ pub struct EventOrderPartiallyFilled { )] #[proto_message(type_url = "/provenance.exchange.v1.EventOrderExternalIDUpdated")] pub struct EventOrderExternalIdUpdated { + /// order_id is the numerical identifier of the order partially filled. #[prost(uint64, tag = "1")] - #[serde(alias = "orderID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub order_id: u64, + /// market_id is the numerical identifier of the market. #[prost(uint32, tag = "2")] - #[serde(alias = "marketID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub market_id: u32, + /// external_id is the order's new external id. #[prost(string, tag = "3")] - #[serde(alias = "externalID")] pub external_id: ::prost::alloc::string::String, } +/// EventFundsCommitted is an event emitted when funds are committed to a market. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.exchange.v1.EventFundsCommitted")] +pub struct EventFundsCommitted { + /// account is the bech32 address string of the account. + #[prost(string, tag = "1")] + pub account: ::prost::alloc::string::String, + /// market_id is the numerical identifier of the market. + #[prost(uint32, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub market_id: u32, + /// amount is the coins string of the newly committed funds. + #[prost(string, tag = "3")] + pub amount: ::prost::alloc::string::String, + /// tag is the string provided in the message causing this event. + #[prost(string, tag = "4")] + pub tag: ::prost::alloc::string::String, +} +/// EventCommitmentReleased is an event emitted when funds are released from their commitment. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.exchange.v1.EventCommitmentReleased")] +pub struct EventCommitmentReleased { + /// account is the bech32 address string of the account. + #[prost(string, tag = "1")] + pub account: ::prost::alloc::string::String, + /// market_id is the numerical identifier of the market. + #[prost(uint32, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub market_id: u32, + /// amount is the coins string of the funds that were released from commitment. + #[prost(string, tag = "3")] + pub amount: ::prost::alloc::string::String, + /// tag is the string provided in the message causing this event. + #[prost(string, tag = "4")] + pub tag: ::prost::alloc::string::String, +} +/// EventMarketWithdraw is an event emitted when a withdrawal of a market's collected fees is made. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -219,20 +358,24 @@ pub struct EventOrderExternalIdUpdated { )] #[proto_message(type_url = "/provenance.exchange.v1.EventMarketWithdraw")] pub struct EventMarketWithdraw { + /// market_id is the numerical identifier of the market. #[prost(uint32, tag = "1")] - #[serde(alias = "marketID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub market_id: u32, + /// amount is the coins amount string of funds withdrawn from the market account. #[prost(string, tag = "2")] pub amount: ::prost::alloc::string::String, + /// destination is the account that received the funds. #[prost(string, tag = "3")] pub destination: ::prost::alloc::string::String, + /// withdrawn_by is the account that requested the withdrawal. #[prost(string, tag = "4")] pub withdrawn_by: ::prost::alloc::string::String, } +/// EventMarketDetailsUpdated is an event emitted when a market's details are updated. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -246,16 +389,19 @@ pub struct EventMarketWithdraw { )] #[proto_message(type_url = "/provenance.exchange.v1.EventMarketDetailsUpdated")] pub struct EventMarketDetailsUpdated { + /// market_id is the numerical identifier of the market. #[prost(uint32, tag = "1")] - #[serde(alias = "marketID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub market_id: u32, + /// updated_by is the account that updated the details. #[prost(string, tag = "2")] pub updated_by: ::prost::alloc::string::String, } +/// EventMarketEnabled is an event emitted when a market is enabled. +/// Deprecated: This event is no longer used. It is replaced with EventMarketOrdersEnabled. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -270,16 +416,19 @@ pub struct EventMarketDetailsUpdated { #[proto_message(type_url = "/provenance.exchange.v1.EventMarketEnabled")] #[deprecated] pub struct EventMarketEnabled { + /// market_id is the numerical identifier of the market. #[prost(uint32, tag = "1")] - #[serde(alias = "marketID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub market_id: u32, + /// updated_by is the account that enabled the market. #[prost(string, tag = "2")] pub updated_by: ::prost::alloc::string::String, } +/// EventMarketDisabled is an event emitted when a market is disabled. +/// Deprecated: This event is no longer used. It is replaced with EventMarketOrdersDisabled. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -294,16 +443,18 @@ pub struct EventMarketEnabled { #[proto_message(type_url = "/provenance.exchange.v1.EventMarketDisabled")] #[deprecated] pub struct EventMarketDisabled { + /// market_id is the numerical identifier of the market. #[prost(uint32, tag = "1")] - #[serde(alias = "marketID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub market_id: u32, + /// updated_by is the account that disabled the market. #[prost(string, tag = "2")] pub updated_by: ::prost::alloc::string::String, } +/// EventMarketOrdersEnabled is an event emitted when a market enables order creation. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -315,18 +466,20 @@ pub struct EventMarketDisabled { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/provenance.exchange.v1.EventMarketUserSettleEnabled")] -pub struct EventMarketUserSettleEnabled { +#[proto_message(type_url = "/provenance.exchange.v1.EventMarketOrdersEnabled")] +pub struct EventMarketOrdersEnabled { + /// market_id is the numerical identifier of the market. #[prost(uint32, tag = "1")] - #[serde(alias = "marketID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub market_id: u32, + /// updated_by is the account that updated the accepting_orders option. #[prost(string, tag = "2")] pub updated_by: ::prost::alloc::string::String, } +/// EventMarketOrdersEnabled is an event emitted when a market disables order creation. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -338,18 +491,20 @@ pub struct EventMarketUserSettleEnabled { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/provenance.exchange.v1.EventMarketUserSettleDisabled")] -pub struct EventMarketUserSettleDisabled { +#[proto_message(type_url = "/provenance.exchange.v1.EventMarketOrdersDisabled")] +pub struct EventMarketOrdersDisabled { + /// market_id is the numerical identifier of the market. #[prost(uint32, tag = "1")] - #[serde(alias = "marketID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub market_id: u32, + /// updated_by is the account that updated the accepting_orders option. #[prost(string, tag = "2")] pub updated_by: ::prost::alloc::string::String, } +/// EventMarketUserSettleEnabled is an event emitted when a market's user_settle option is enabled. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -361,18 +516,20 @@ pub struct EventMarketUserSettleDisabled { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/provenance.exchange.v1.EventMarketPermissionsUpdated")] -pub struct EventMarketPermissionsUpdated { +#[proto_message(type_url = "/provenance.exchange.v1.EventMarketUserSettleEnabled")] +pub struct EventMarketUserSettleEnabled { + /// market_id is the numerical identifier of the market. #[prost(uint32, tag = "1")] - #[serde(alias = "marketID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub market_id: u32, + /// updated_by is the account that updated the user_settle option. #[prost(string, tag = "2")] pub updated_by: ::prost::alloc::string::String, } +/// EventMarketUserSettleDisabled is an event emitted when a market's user_settle option is disabled. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -384,18 +541,20 @@ pub struct EventMarketPermissionsUpdated { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/provenance.exchange.v1.EventMarketReqAttrUpdated")] -pub struct EventMarketReqAttrUpdated { +#[proto_message(type_url = "/provenance.exchange.v1.EventMarketUserSettleDisabled")] +pub struct EventMarketUserSettleDisabled { + /// market_id is the numerical identifier of the market. #[prost(uint32, tag = "1")] - #[serde(alias = "marketID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub market_id: u32, + /// updated_by is the account that updated the user_settle option. #[prost(string, tag = "2")] pub updated_by: ::prost::alloc::string::String, } +/// EventMarketCommitmentsEnabled is an event emitted when a market's accepting_commitments option is enabled. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -407,16 +566,20 @@ pub struct EventMarketReqAttrUpdated { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/provenance.exchange.v1.EventMarketCreated")] -pub struct EventMarketCreated { +#[proto_message(type_url = "/provenance.exchange.v1.EventMarketCommitmentsEnabled")] +pub struct EventMarketCommitmentsEnabled { + /// market_id is the numerical identifier of the market. #[prost(uint32, tag = "1")] - #[serde(alias = "marketID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub market_id: u32, + /// updated_by is the account that updated the accepting_commitments option. + #[prost(string, tag = "2")] + pub updated_by: ::prost::alloc::string::String, } +/// EventMarketCommitmentsDisabled is an event emitted when a market's accepting_commitments option is disabled. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -428,16 +591,21 @@ pub struct EventMarketCreated { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/provenance.exchange.v1.EventMarketFeesUpdated")] -pub struct EventMarketFeesUpdated { +#[proto_message(type_url = "/provenance.exchange.v1.EventMarketCommitmentsDisabled")] +pub struct EventMarketCommitmentsDisabled { + /// market_id is the numerical identifier of the market. #[prost(uint32, tag = "1")] - #[serde(alias = "marketID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub market_id: u32, + /// updated_by is the account that updated the accepting_commitments option. + #[prost(string, tag = "2")] + pub updated_by: ::prost::alloc::string::String, } +/// EventMarketIntermediaryDenomUpdated is an event emitted when a market updates its +/// commitment_settlement_intermediary_denom field. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -449,21 +617,20 @@ pub struct EventMarketFeesUpdated { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/provenance.exchange.v1.MarketAccount")] -pub struct MarketAccount { - #[prost(message, optional, tag = "1")] - pub base_account: - ::core::option::Option, - #[prost(uint32, tag = "2")] - #[serde(alias = "marketID")] +#[proto_message(type_url = "/provenance.exchange.v1.EventMarketIntermediaryDenomUpdated")] +pub struct EventMarketIntermediaryDenomUpdated { + /// market_id is the numerical identifier of the market. + #[prost(uint32, tag = "1")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub market_id: u32, - #[prost(message, optional, tag = "3")] - pub market_details: ::core::option::Option, + /// updated_by is the account that updated the intermediary denom. + #[prost(string, tag = "2")] + pub updated_by: ::prost::alloc::string::String, } +/// EventMarketPermissionsUpdated is an event emitted when a market's permissions are updated. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -475,17 +642,20 @@ pub struct MarketAccount { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/provenance.exchange.v1.MarketDetails")] -pub struct MarketDetails { - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, +#[proto_message(type_url = "/provenance.exchange.v1.EventMarketPermissionsUpdated")] +pub struct EventMarketPermissionsUpdated { + /// market_id is the numerical identifier of the market. + #[prost(uint32, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub market_id: u32, + /// updated_by is the account that updated the permissions. #[prost(string, tag = "2")] - pub description: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub website_url: ::prost::alloc::string::String, - #[prost(string, tag = "4")] - pub icon_uri: ::prost::alloc::string::String, + pub updated_by: ::prost::alloc::string::String, } +/// EventMarketReqAttrUpdated is an event emitted when a market's required attributes are updated. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -497,20 +667,20 @@ pub struct MarketDetails { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/provenance.exchange.v1.MarketBrief")] -pub struct MarketBrief { +#[proto_message(type_url = "/provenance.exchange.v1.EventMarketReqAttrUpdated")] +pub struct EventMarketReqAttrUpdated { + /// market_id is the numerical identifier of the market. #[prost(uint32, tag = "1")] - #[serde(alias = "marketID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub market_id: u32, + /// updated_by is the account that updated the required attributes. #[prost(string, tag = "2")] - pub market_address: ::prost::alloc::string::String, - #[prost(message, optional, tag = "3")] - pub market_details: ::core::option::Option, + pub updated_by: ::prost::alloc::string::String, } +/// EventMarketCreated is an event emitted when a market has been created. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -522,59 +692,39 @@ pub struct MarketBrief { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/provenance.exchange.v1.Market")] -pub struct Market { +#[proto_message(type_url = "/provenance.exchange.v1.EventMarketCreated")] +pub struct EventMarketCreated { + /// market_id is the numerical identifier of the market. #[prost(uint32, tag = "1")] - #[serde(alias = "marketID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub market_id: u32, - #[prost(message, optional, tag = "2")] - pub market_details: ::core::option::Option, - #[prost(message, repeated, tag = "3")] - pub fee_create_ask_flat: - ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "4")] - pub fee_create_bid_flat: - ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "5")] - pub fee_seller_settlement_flat: - ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "6")] - pub fee_seller_settlement_ratios: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "7")] - pub fee_buyer_settlement_flat: - ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "8")] - pub fee_buyer_settlement_ratios: ::prost::alloc::vec::Vec, - #[prost(bool, tag = "9")] - pub accepting_orders: bool, - #[prost(bool, tag = "10")] - pub allow_user_settlement: bool, - #[prost(message, repeated, tag = "11")] - pub access_grants: ::prost::alloc::vec::Vec, - #[prost(string, repeated, tag = "12")] - pub req_attr_create_ask: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(string, repeated, tag = "13")] - pub req_attr_create_bid: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(bool, tag = "14")] - pub accepting_commitments: bool, - #[prost(message, repeated, tag = "15")] - pub fee_create_commitment_flat: - ::prost::alloc::vec::Vec, - #[prost(uint32, tag = "16")] +} +/// EventMarketFeesUpdated is an event emitted when a market's fees have been updated. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.exchange.v1.EventMarketFeesUpdated")] +pub struct EventMarketFeesUpdated { + /// market_id is the numerical identifier of the market. + #[prost(uint32, tag = "1")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] - pub commitment_settlement_bips: u32, - #[prost(string, tag = "17")] - pub intermediary_denom: ::prost::alloc::string::String, - #[prost(string, repeated, tag = "18")] - pub req_attr_create_commitment: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + pub market_id: u32, } +/// EventParamsUpdated is an event emitted when the exchange module's params have been updated. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -586,13 +736,39 @@ pub struct Market { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/provenance.exchange.v1.FeeRatio")] -pub struct FeeRatio { - #[prost(message, optional, tag = "1")] - pub price: ::core::option::Option, - #[prost(message, optional, tag = "2")] - pub fee: ::core::option::Option, +#[proto_message(type_url = "/provenance.exchange.v1.EventParamsUpdated")] +pub struct EventParamsUpdated {} +/// EventPaymentCreated is an event emitted when a payment is created. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.exchange.v1.EventPaymentCreated")] +pub struct EventPaymentCreated { + /// source is the account that created the Payment. + #[prost(string, tag = "1")] + pub source: ::prost::alloc::string::String, + /// source_amount is the coins amount string of the funds that the source will pay (to the target). + #[prost(string, tag = "2")] + pub source_amount: ::prost::alloc::string::String, + /// target is the account that can accept the Payment. + #[prost(string, tag = "3")] + pub target: ::prost::alloc::string::String, + /// target_amount is the coins amount string of the funds that the target will pay (to the source). + #[prost(string, tag = "4")] + pub target_amount: ::prost::alloc::string::String, + /// external_id is used along with the source to uniquely identify this Payment. + #[prost(string, tag = "5")] + pub external_id: ::prost::alloc::string::String, } +/// EventPaymentUpdated is an event emitted when a payment is updated. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -604,29 +780,381 @@ pub struct FeeRatio { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/provenance.exchange.v1.AccessGrant")] -pub struct AccessGrant { +#[proto_message(type_url = "/provenance.exchange.v1.EventPaymentUpdated")] +pub struct EventPaymentUpdated { + /// source is the account that updated (and previously created) the Payment. #[prost(string, tag = "1")] - pub address: ::prost::alloc::string::String, - #[prost(enumeration = "Permission", repeated, tag = "2")] - #[serde( - serialize_with = "Permission::serialize_vec", - deserialize_with = "Permission::deserialize_vec" - )] - pub permissions: ::prost::alloc::vec::Vec, + pub source: ::prost::alloc::string::String, + /// source_amount is the coins amount string of the funds that the source will pay (to the target). + #[prost(string, tag = "2")] + pub source_amount: ::prost::alloc::string::String, + /// old_target is the account that used to be able to accept the Payment (but not any more). + #[prost(string, tag = "3")] + pub old_target: ::prost::alloc::string::String, + /// new_target is the account that is now able to accept the Payment. + #[prost(string, tag = "4")] + pub new_target: ::prost::alloc::string::String, + /// target_amount is the coins amount string of the funds that the target will pay (to the source). + #[prost(string, tag = "5")] + pub target_amount: ::prost::alloc::string::String, + /// external_id is used along with the source to uniquely identify this Payment. + #[prost(string, tag = "6")] + pub external_id: ::prost::alloc::string::String, } -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] -pub enum Permission { - Unspecified = 0, - Settle = 1, - SetIds = 2, - Cancel = 3, - Withdraw = 4, - Update = 5, - Permissions = 6, - Attributes = 7, +/// EventPaymentAccepted is an event emitted when a payment is accepted. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.exchange.v1.EventPaymentAccepted")] +pub struct EventPaymentAccepted { + /// source is the account that created the Payment. + #[prost(string, tag = "1")] + pub source: ::prost::alloc::string::String, + /// source_amount is the coins amount string of the funds that the source will pay (to the target). + #[prost(string, tag = "2")] + pub source_amount: ::prost::alloc::string::String, + /// target is the account that accepted the Payment. + #[prost(string, tag = "3")] + pub target: ::prost::alloc::string::String, + /// target_amount is the coins amount string of the funds that the target will pay (to the source). + #[prost(string, tag = "4")] + pub target_amount: ::prost::alloc::string::String, + /// external_id is used along with the source to uniquely identify this Payment. + #[prost(string, tag = "5")] + pub external_id: ::prost::alloc::string::String, +} +/// EventPaymentRejected is an event emitted when a payment is rejected (by the target). +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.exchange.v1.EventPaymentRejected")] +pub struct EventPaymentRejected { + /// source is the account that created the Payment. + #[prost(string, tag = "1")] + pub source: ::prost::alloc::string::String, + /// target is the account that rejected the Payment. + #[prost(string, tag = "2")] + pub target: ::prost::alloc::string::String, + /// external_id is used along with the source to uniquely identify this Payment. + #[prost(string, tag = "3")] + pub external_id: ::prost::alloc::string::String, +} +/// EventPaymentCancelled is an event emitted when a payment is cancelled (by the source). +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.exchange.v1.EventPaymentCancelled")] +pub struct EventPaymentCancelled { + /// source is the account that cancelled (and created) the Payment. + #[prost(string, tag = "1")] + pub source: ::prost::alloc::string::String, + /// target is the account that could have accepted the Payment. + #[prost(string, tag = "2")] + pub target: ::prost::alloc::string::String, + /// external_id is used along with the source to uniquely identify this Payment. + #[prost(string, tag = "3")] + pub external_id: ::prost::alloc::string::String, +} +/// MarketAccount is an account type for use with the accounts module to hold some basic information about a market. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.exchange.v1.MarketAccount")] +pub struct MarketAccount { + /// base_account is the base cosmos account information. + #[prost(message, optional, tag = "1")] + pub base_account: + ::core::option::Option, + /// market_id is the numerical identifier for this market. + #[prost(uint32, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub market_id: u32, + /// market_details is some human-consumable information about this market. + #[prost(message, optional, tag = "3")] + pub market_details: ::core::option::Option, +} +/// MarketDetails contains information about a market. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.exchange.v1.MarketDetails")] +pub struct MarketDetails { + /// name is a moniker that people can use to refer to this market. + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + /// description extra information about this market. The field is meant to be human-readable. + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + /// website_url is a url people can use to get to this market, or at least get more information about this market. + #[prost(string, tag = "3")] + pub website_url: ::prost::alloc::string::String, + /// icon_uri is a uri for an icon to associate with this market. + #[prost(string, tag = "4")] + pub icon_uri: ::prost::alloc::string::String, +} +/// MarketBrief is a message containing brief, superficial information about a market. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.exchange.v1.MarketBrief")] +pub struct MarketBrief { + /// market_id is the numerical identifier for this market. + #[prost(uint32, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub market_id: u32, + /// market_address is the bech32 address string of this market's account. + #[prost(string, tag = "2")] + pub market_address: ::prost::alloc::string::String, + /// market_details is some information about this market. + #[prost(message, optional, tag = "3")] + pub market_details: ::core::option::Option, +} +/// Market contains all information about a market. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.exchange.v1.Market")] +pub struct Market { + /// market_id is the numerical identifier for this market. + #[prost(uint32, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub market_id: u32, + /// market_details is some information about this market. + #[prost(message, optional, tag = "2")] + pub market_details: ::core::option::Option, + /// fee_create_ask_flat is the flat fee charged for creating an ask order. + /// Each coin entry is a separate option. When an ask is created, one of these must be paid. + /// If empty, no fee is required to create an ask order. + #[prost(message, repeated, tag = "3")] + pub fee_create_ask_flat: + ::prost::alloc::vec::Vec, + /// fee_create_bid_flat is the flat fee charged for creating a bid order. + /// Each coin entry is a separate option. When a bid is created, one of these must be paid. + /// If empty, no fee is required to create a bid order. + #[prost(message, repeated, tag = "4")] + pub fee_create_bid_flat: + ::prost::alloc::vec::Vec, + /// fee_seller_settlement_flat is the flat fee charged to the seller during settlement. + /// Each coin entry is a separate option. + /// When an ask is settled, the seller will pay the amount in the denom that matches the price they received. + #[prost(message, repeated, tag = "5")] + pub fee_seller_settlement_flat: + ::prost::alloc::vec::Vec, + /// fee_seller_settlement_ratios is the fee to charge a seller during settlement based on the price they are receiving. + /// The price and fee denoms must be equal for each entry, and only one entry for any given denom is allowed. + #[prost(message, repeated, tag = "6")] + pub fee_seller_settlement_ratios: ::prost::alloc::vec::Vec, + /// fee_buyer_settlement_flat is the flat fee charged to the buyer during settlement. + /// Each coin entry is a separate option. + /// When a bid is created, the settlement fees provided must contain one of these. + #[prost(message, repeated, tag = "7")] + pub fee_buyer_settlement_flat: + ::prost::alloc::vec::Vec, + /// fee_buyer_settlement_ratios is the fee to charge a buyer during settlement based on the price they are spending. + /// The price and fee denoms do not have to equal. Multiple entries for any given price or fee denom are allowed, but + /// each price denom to fee denom pair can only have one entry. + #[prost(message, repeated, tag = "8")] + pub fee_buyer_settlement_ratios: ::prost::alloc::vec::Vec, + /// accepting_orders is whether this market is allowing orders to be created for it. + #[prost(bool, tag = "9")] + pub accepting_orders: bool, + /// allow_user_settlement is whether this market allows users to initiate their own settlements. + /// For example, the FillBids and FillAsks endpoints are available if and only if this is true. + /// The MarketSettle endpoint is only available to market actors regardless of the value of this field. + #[prost(bool, tag = "10")] + pub allow_user_settlement: bool, + /// access_grants is the list of addresses and permissions granted for this market. + #[prost(message, repeated, tag = "11")] + pub access_grants: ::prost::alloc::vec::Vec, + /// req_attr_create_ask is a list of attributes required on an account for it to be allowed to create an ask order. + /// An account must have all of these attributes in order to create an ask order in this market. + /// If the list is empty, any account can create ask orders in this market. + /// + /// An entry that starts with "*." will match any attributes that end with the rest of it. + /// E.g. "*.b.a" will match all of "c.b.a", "x.b.a", and "e.d.c.b.a"; but not "b.a", "xb.a", "b.x.a", or "c.b.a.x". + #[prost(string, repeated, tag = "12")] + pub req_attr_create_ask: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// req_attr_create_ask is a list of attributes required on an account for it to be allowed to create a bid order. + /// An account must have all of these attributes in order to create a bid order in this market. + /// If the list is empty, any account can create bid orders in this market. + /// + /// An entry that starts with "*." will match any attributes that end with the rest of it. + /// E.g. "*.b.a" will match all of "c.b.a", "x.b.a", and "e.d.c.b.a"; but not "b.a", "xb.a", "c.b.x.a", or "c.b.a.x". + #[prost(string, repeated, tag = "13")] + pub req_attr_create_bid: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// accepting_commitments is whether the market is allowing users to commit funds to it. + #[prost(bool, tag = "14")] + pub accepting_commitments: bool, + /// fee_create_commitment_flat is the flat fee charged for creating a commitment. + /// Each coin entry is a separate option. When a commitment is created, one of these must be paid. + /// If empty, no fee is required to create a commitment. + #[prost(message, repeated, tag = "15")] + pub fee_create_commitment_flat: + ::prost::alloc::vec::Vec, + /// commitment_settlement_bips is the fraction of a commitment settlement that will be paid to the exchange. + /// It is represented in basis points (1/100th of 1%, e.g. 0.0001) and is limited to 0 to 10,000 inclusive. + /// During a commitment settlement, the inputs are summed and NAVs are used to convert that total to the + /// intermediary denom, then to the fee denom. That is then multiplied by this value to get the fee amount + /// that will be transferred out of the market's account into the exchange for that settlement. + /// + /// Summing the inputs effectively doubles the value of the settlement from what what is usually thought of + /// as the value of a trade. That should be taken into account when setting this value. + /// E.g. if two accounts are trading 10apples for 100grapes, the inputs total will be 10apples,100grapes + /// (which might then be converted to USD then nhash before applying this ratio); Usually, though, the value + /// of that trade would be viewed as either just 10apples or just 100grapes. + #[prost(uint32, tag = "16")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub commitment_settlement_bips: u32, + /// intermediary_denom is the denom that funds get converted to (before being converted to the chain's fee denom) + /// when calculating the fees that are paid to the exchange. NAVs are used for this conversion and actions will fail + /// if a NAV is needed but not available. + #[prost(string, tag = "17")] + pub intermediary_denom: ::prost::alloc::string::String, + /// req_attr_create_commitment is a list of attributes required on an account for it to be allowed to create a + /// commitment. An account must have all of these attributes in order to create a commitment in this market. + /// If the list is empty, any account can create commitments in this market. + /// + /// An entry that starts with "*." will match any attributes that end with the rest of it. + /// E.g. "*.b.a" will match all of "c.b.a", "x.b.a", and "e.d.c.b.a"; but not "b.a", "xb.a", "c.b.x.a", or "c.b.a.x". + #[prost(string, repeated, tag = "18")] + pub req_attr_create_commitment: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// FeeRatio defines a ratio of price amount to fee amount. +/// For an order to be valid, its price must be evenly divisible by a FeeRatio's price. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.exchange.v1.FeeRatio")] +pub struct FeeRatio { + /// price is the unit the order price is divided by to get how much of the fee should apply. + #[prost(message, optional, tag = "1")] + pub price: ::core::option::Option, + /// fee is the amount to charge per price unit. + #[prost(message, optional, tag = "2")] + pub fee: ::core::option::Option, +} +/// AddrPermissions associates an address with a list of permissions available for that address. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.exchange.v1.AccessGrant")] +pub struct AccessGrant { + /// address is the address that these permissions apply to. + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// allowed is the list of permissions available for the address. + #[prost(enumeration = "Permission", repeated, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub permissions: ::prost::alloc::vec::Vec, +} +/// Permission defines the different types of permission that can be given to an account for a market. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +pub enum Permission { + /// PERMISSION_UNSPECIFIED is the zero-value Permission; it is an error to use it. + Unspecified = 0, + /// PERMISSION_SETTLE is the ability to use the Settle Tx endpoint on behalf of a market. + Settle = 1, + /// PERMISSION_SET_IDS is the ability to use the SetOrderExternalID Tx endpoint on behalf of a market. + SetIds = 2, + /// PERMISSION_CANCEL is the ability to use the Cancel Tx endpoint on behalf of a market. + Cancel = 3, + /// PERMISSION_WITHDRAW is the ability to use the MarketWithdraw Tx endpoint. + Withdraw = 4, + /// PERMISSION_UPDATE is the ability to use the MarketUpdate* Tx endpoints. + Update = 5, + /// PERMISSION_PERMISSIONS is the ability to use the MarketManagePermissions Tx endpoint. + Permissions = 6, + /// PERMISSION_ATTRIBUTES is the ability to use the MarketManageReqAttrs Tx endpoint. + Attributes = 7, } impl Permission { /// String value of the enum field names used in the ProtoBuf definition. @@ -659,46 +1187,8 @@ impl Permission { _ => None, } } - - pub fn serialize_vec(v: &Vec, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeTuple; - - let mut enum_strs: Vec<&str> = Vec::new(); - for ord in v { - let enum_value = Self::try_from(*ord); - match enum_value { - Ok(v) => { - enum_strs.push(v.as_str_name()); - } - Err(e) => return Err(serde::ser::Error::custom(e)), - } - } - let mut seq = serializer.serialize_tuple(enum_strs.len())?; - for item in enum_strs { - seq.serialize_element(item)?; - } - seq.end() - } - - fn deserialize_vec<'de, D>(deserializer: D) -> Result, D::Error> - where - D: serde::Deserializer<'de>, - { - use serde::de::{Deserialize, Error}; - - let strs: Vec = Vec::deserialize(deserializer)?; - let mut ords: Vec = Vec::new(); - for str_name in strs { - let enum_value = Self::from_str_name(&str_name) - .ok_or_else(|| Error::custom(format!("unknown enum string: {}", str_name)))?; - ords.push(enum_value as i32); - } - Ok(ords) - } } +/// Order associates an order id with one of the order types. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -712,19 +1202,21 @@ impl Permission { )] #[proto_message(type_url = "/provenance.exchange.v1.Order")] pub struct Order { + /// order_id is the numerical identifier for this order. #[prost(uint64, tag = "1")] - #[serde(alias = "orderID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub order_id: u64, + /// order is the specifics of this order. #[prost(oneof = "order::Order", tags = "2, 3")] pub order: ::core::option::Option, } /// Nested message and enum types in `Order`. pub mod order { use provwasm_proc_macro::CosmwasmExt; + /// order is the specifics of this order. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -736,12 +1228,15 @@ pub mod order { ::schemars::JsonSchema, )] pub enum Order { + /// ask_order is the information about this order if it represents an ask order. #[prost(message, tag = "2")] AskOrder(super::AskOrder), + /// bid_order is the information about this order if it represents a bid order. #[prost(message, tag = "3")] BidOrder(super::BidOrder), } } +/// AskOrder represents someone's desire to sell something at a minimum price. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -755,28 +1250,41 @@ pub mod order { )] #[proto_message(type_url = "/provenance.exchange.v1.AskOrder")] pub struct AskOrder { + /// market_id identifies the market that this order belongs to. #[prost(uint32, tag = "1")] - #[serde(alias = "marketID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub market_id: u32, + /// seller is the address of the account that owns this order and has the assets to sell. #[prost(string, tag = "2")] pub seller: ::prost::alloc::string::String, + /// assets are the things that the seller wishes to sell. + /// A hold is placed on this until the order is filled or cancelled. #[prost(message, optional, tag = "3")] pub assets: ::core::option::Option, + /// price is the minimum amount that the seller is willing to accept for the assets. The seller's settlement + /// proportional fee (and possibly the settlement flat fee) is taken out of the amount the seller receives, + /// so it's possible that the seller will still receive less than this price. #[prost(message, optional, tag = "4")] pub price: ::core::option::Option, + /// seller_settlement_flat_fee is the flat fee for sellers that will be charged during settlement. If this denom is the + /// same denom as the price, it will come out of the actual price received. If this denom is different, the amount must + /// be in the seller's account and a hold is placed on it until the order is filled or cancelled. #[prost(message, optional, tag = "5")] pub seller_settlement_flat_fee: ::core::option::Option, + /// allow_partial should be true if partial fulfillment of this order should be allowed, and should be false if the + /// order must be either filled in full or not filled at all. #[prost(bool, tag = "6")] pub allow_partial: bool, + /// external_id is an optional string used to externally identify this order. Max length is 100 characters. + /// If an order in this market with this external id already exists, this order will be rejected. #[prost(string, tag = "7")] - #[serde(alias = "externalID")] pub external_id: ::prost::alloc::string::String, } +/// BidOrder represents someone's desire to buy something at a specific price. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -790,28 +1298,38 @@ pub struct AskOrder { )] #[proto_message(type_url = "/provenance.exchange.v1.BidOrder")] pub struct BidOrder { + /// market_id identifies the market that this order belongs to. #[prost(uint32, tag = "1")] - #[serde(alias = "marketID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub market_id: u32, + /// buyer is the address of the account that owns this order and has the price to spend. #[prost(string, tag = "2")] pub buyer: ::prost::alloc::string::String, + /// assets are the things that the buyer wishes to buy. #[prost(message, optional, tag = "3")] pub assets: ::core::option::Option, + /// price is the amount that the buyer will pay for the assets. + /// A hold is placed on this until the order is filled or cancelled. #[prost(message, optional, tag = "4")] pub price: ::core::option::Option, + /// buyer_settlement_fees are the fees (both flat and proportional) that the buyer will pay (in addition to the price) + /// when the order is settled. A hold is placed on this until the order is filled or cancelled. #[prost(message, repeated, tag = "5")] pub buyer_settlement_fees: ::prost::alloc::vec::Vec, + /// allow_partial should be true if partial fulfillment of this order should be allowed, and should be false if the + /// order must be either filled in full or not filled at all. #[prost(bool, tag = "6")] pub allow_partial: bool, + /// external_id is an optional string used to externally identify this order. Max length is 100 characters. + /// If an order in this market with this external id already exists, this order will be rejected. #[prost(string, tag = "7")] - #[serde(alias = "externalID")] pub external_id: ::prost::alloc::string::String, } +/// Params is a representation of the exchange module parameters. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -825,17 +1343,32 @@ pub struct BidOrder { )] #[proto_message(type_url = "/provenance.exchange.v1.Params")] pub struct Params { + /// default_split is the default proportion of fees the exchange receives in basis points. + /// It is used if there isn't an applicable denom-specific split defined. + /// E.g. 100 = 1%. Min = 0, Max = 10000. #[prost(uint32, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] pub default_split: u32, + /// denom_splits are the denom-specific amounts the exchange receives. #[prost(message, repeated, tag = "2")] pub denom_splits: ::prost::alloc::vec::Vec, + /// fee_create_payment_flat is the flat fee options for creating a payment. + /// If the source amount is not zero then one of these fee entries is required to create the payment. + /// This field is currently limited to zero or one entries. #[prost(message, repeated, tag = "3")] pub fee_create_payment_flat: ::prost::alloc::vec::Vec, + /// fee_accept_payment_flat is the flat fee options for accepting a payment. + /// If the target amount is not zero then one of these fee entries is required to accept the payment. + /// This field is currently limited to zero or one entries. #[prost(message, repeated, tag = "4")] pub fee_accept_payment_flat: ::prost::alloc::vec::Vec, } +/// DenomSplit associates a coin denomination with an amount the exchange receives for that denom. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -849,8 +1382,11 @@ pub struct Params { )] #[proto_message(type_url = "/provenance.exchange.v1.DenomSplit")] pub struct DenomSplit { + /// denom is the coin denomination this split applies to. #[prost(string, tag = "1")] pub denom: ::prost::alloc::string::String, + /// split is the proportion of fees the exchange receives for this denom in basis points. + /// E.g. 100 = 1%. Min = 0, Max = 10000. #[prost(uint32, tag = "2")] #[serde( serialize_with = "crate::serde::as_str::serialize", @@ -858,6 +1394,7 @@ pub struct DenomSplit { )] pub split: u32, } +/// Payment represents one account's desire to trade funds with another account. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -871,18 +1408,81 @@ pub struct DenomSplit { )] #[proto_message(type_url = "/provenance.exchange.v1.Payment")] pub struct Payment { + /// source is the account that created this Payment. It is considered the owner of the payment. #[prost(string, tag = "1")] pub source: ::prost::alloc::string::String, + /// source_amount is the funds that the source is will pay the target in exchange for the target_amount. + /// A hold will be placed on this amount in the source account until this Payment is accepted, rejected or cancelled. + /// If the source_amount is zero, this Payment can be considered a "payment request." #[prost(message, repeated, tag = "2")] pub source_amount: ::prost::alloc::vec::Vec, + /// target is the account that can accept this Payment. + /// The target is the only thing allowed to change in a payment. + /// I.e. it can be empty initially and updated later as needed. #[prost(string, tag = "3")] pub target: ::prost::alloc::string::String, + /// target_amount is the funds that the target will pay the source in exchange for the source_amount. + /// If the target_amount is zero, this Payment can be considered a "peer-to-peer (P2P) payment." #[prost(message, repeated, tag = "4")] pub target_amount: ::prost::alloc::vec::Vec, + /// external_id is used along with the source to uniquely identify this Payment. + /// + /// A source can only have one Payment with any given external id. + /// A source can have two payments with two different external ids. + /// Two different sources can each have a payment with the same external id. + /// But a source cannot have two different payments each with the same external id. + /// + /// An external id can be reused by a source once the payment is accepted, rejected, or cancelled. + /// + /// The external id is limited to 100 bytes. An empty string is a valid external id. #[prost(string, tag = "5")] - #[serde(alias = "externalID")] pub external_id: ::prost::alloc::string::String, } +/// GenesisState is the data that should be loaded into the exchange module during genesis. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.exchange.v1.GenesisState")] +pub struct GenesisState { + /// params defines all the parameters of the exchange module. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, + /// markets are all of the markets to create at genesis. + #[prost(message, repeated, tag = "2")] + pub markets: ::prost::alloc::vec::Vec, + /// orders are all the orders to create at genesis. + #[prost(message, repeated, tag = "3")] + pub orders: ::prost::alloc::vec::Vec, + /// last_market_id is the value of the last auto-selected market id. + #[prost(uint32, tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub last_market_id: u32, + /// last_order_id is the value of the last order id created. + #[prost(uint64, tag = "5")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub last_order_id: u64, + /// commitments are all of the commitments to create at genesis. + #[prost(message, repeated, tag = "6")] + pub commitments: ::prost::alloc::vec::Vec, + /// payments are all the payments to create at genesis. + #[prost(message, repeated, tag = "7")] + pub payments: ::prost::alloc::vec::Vec, +} +/// MsgCreateAskRequest is a request message for the CreateAsk endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -896,12 +1496,15 @@ pub struct Payment { )] #[proto_message(type_url = "/provenance.exchange.v1.MsgCreateAskRequest")] pub struct MsgCreateAskRequest { + /// ask_order is the details of the order being created. #[prost(message, optional, tag = "1")] pub ask_order: ::core::option::Option, + /// order_creation_fee is the fee that is being paid to create this order. #[prost(message, optional, tag = "2")] pub order_creation_fee: ::core::option::Option, } +/// MsgCreateAskResponse is a response message for the CreateAsk endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -915,14 +1518,15 @@ pub struct MsgCreateAskRequest { )] #[proto_message(type_url = "/provenance.exchange.v1.MsgCreateAskResponse")] pub struct MsgCreateAskResponse { + /// order_id is the id of the order created. #[prost(uint64, tag = "1")] - #[serde(alias = "orderID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub order_id: u64, } +/// MsgCreateBidRequest is a request message for the CreateBid endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -936,12 +1540,15 @@ pub struct MsgCreateAskResponse { )] #[proto_message(type_url = "/provenance.exchange.v1.MsgCreateBidRequest")] pub struct MsgCreateBidRequest { + /// bid_order is the details of the order being created. #[prost(message, optional, tag = "1")] pub bid_order: ::core::option::Option, + /// order_creation_fee is the fee that is being paid to create this order. #[prost(message, optional, tag = "2")] pub order_creation_fee: ::core::option::Option, } +/// MsgCreateBidResponse is a response message for the CreateBid endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -955,14 +1562,15 @@ pub struct MsgCreateBidRequest { )] #[proto_message(type_url = "/provenance.exchange.v1.MsgCreateBidResponse")] pub struct MsgCreateBidResponse { + /// order_id is the id of the order created. #[prost(uint64, tag = "1")] - #[serde(alias = "orderID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub order_id: u64, } +/// MsgCommitFundsRequest is a request message for the CommitFunds endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -976,22 +1584,27 @@ pub struct MsgCreateBidResponse { )] #[proto_message(type_url = "/provenance.exchange.v1.MsgCommitFundsRequest")] pub struct MsgCommitFundsRequest { + /// account is the address of the account with the funds being committed. #[prost(string, tag = "1")] pub account: ::prost::alloc::string::String, + /// market_id is the numerical identifier of the market the funds will be committed to. #[prost(uint32, tag = "2")] - #[serde(alias = "marketID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub market_id: u32, + /// amount is the funds being committed to the market. #[prost(message, repeated, tag = "3")] pub amount: ::prost::alloc::vec::Vec, + /// creation_fee is the fee that is being paid to create this commitment. #[prost(message, optional, tag = "4")] pub creation_fee: ::core::option::Option, + /// event_tag is a string that is included in the funds-committed event. Max length is 100 characters. #[prost(string, tag = "5")] pub event_tag: ::prost::alloc::string::String, } +/// MsgCommitFundsResponse is a response message for the CommitFunds endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1005,6 +1618,7 @@ pub struct MsgCommitFundsRequest { )] #[proto_message(type_url = "/provenance.exchange.v1.MsgCommitFundsResponse")] pub struct MsgCommitFundsResponse {} +/// MsgCancelOrderRequest is a request message for the CancelOrder endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1018,16 +1632,20 @@ pub struct MsgCommitFundsResponse {} )] #[proto_message(type_url = "/provenance.exchange.v1.MsgCancelOrderRequest")] pub struct MsgCancelOrderRequest { + /// signer is the account requesting the order cancellation. + /// It must be either the order owner (e.g. the buyer or seller), the governance module account address, or an account + /// with cancel permission with the market that the order is in. #[prost(string, tag = "1")] pub signer: ::prost::alloc::string::String, + /// order_id is the id of the order to cancel. #[prost(uint64, tag = "2")] - #[serde(alias = "orderID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub order_id: u64, } +/// MsgCancelOrderResponse is a response message for the CancelOrder endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1041,6 +1659,7 @@ pub struct MsgCancelOrderRequest { )] #[proto_message(type_url = "/provenance.exchange.v1.MsgCancelOrderResponse")] pub struct MsgCancelOrderResponse {} +/// MsgFillBidsRequest is a request message for the FillBids endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1054,31 +1673,39 @@ pub struct MsgCancelOrderResponse {} )] #[proto_message(type_url = "/provenance.exchange.v1.MsgFillBidsRequest")] pub struct MsgFillBidsRequest { + /// seller is the address of the account with the assets to sell. #[prost(string, tag = "1")] pub seller: ::prost::alloc::string::String, + /// market_id is the numerical identifier of the market with the bids to fill. + /// All bid orders being filled must be in this market. #[prost(uint32, tag = "2")] - #[serde(alias = "marketID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub market_id: u32, + /// total_assets are the things that the seller wishes to sell. + /// It must be the sum of all bid order assets. #[prost(message, repeated, tag = "3")] pub total_assets: ::prost::alloc::vec::Vec, + /// bid_order_ids are the ids of the bid orders that you are trying to fill. + /// All ids must be for bid orders, and must be in the same market as the market_id. #[prost(uint64, repeated, tag = "4")] - #[serde(alias = "bid_orderIDs")] #[serde( serialize_with = "crate::serde::as_str_vec::serialize", deserialize_with = "crate::serde::as_str_vec::deserialize" )] pub bid_order_ids: ::prost::alloc::vec::Vec, + /// seller_settlement_flat_fee is the flat fee for sellers that will be charged for this settlement. #[prost(message, optional, tag = "5")] pub seller_settlement_flat_fee: ::core::option::Option, + /// ask_order_creation_fee is the fee that is being paid to create this order (which is immediately then settled). #[prost(message, optional, tag = "6")] pub ask_order_creation_fee: ::core::option::Option, } +/// MsgFillBidsResponse is a response message for the FillBids endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1092,6 +1719,7 @@ pub struct MsgFillBidsRequest { )] #[proto_message(type_url = "/provenance.exchange.v1.MsgFillBidsResponse")] pub struct MsgFillBidsResponse {} +/// MsgFillAsksRequest is a request message for the FillAsks endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1105,31 +1733,40 @@ pub struct MsgFillBidsResponse {} )] #[proto_message(type_url = "/provenance.exchange.v1.MsgFillAsksRequest")] pub struct MsgFillAsksRequest { + /// buyer is the address of the account attempting to buy some assets. #[prost(string, tag = "1")] pub buyer: ::prost::alloc::string::String, + /// market_id is the numerical identifier of the market with the asks to fill. + /// All ask orders being filled must be in this market. #[prost(uint32, tag = "2")] - #[serde(alias = "marketID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub market_id: u32, + /// total_price is the total amount being spent on some assets. + /// It must be the sum of all ask order prices. #[prost(message, optional, tag = "3")] pub total_price: ::core::option::Option, + /// ask_order_ids are the ids of the ask orders that you are trying to fill. + /// All ids must be for ask orders, and must be in the same market as the market_id. #[prost(uint64, repeated, tag = "4")] - #[serde(alias = "ask_orderIDs")] #[serde( serialize_with = "crate::serde::as_str_vec::serialize", deserialize_with = "crate::serde::as_str_vec::deserialize" )] pub ask_order_ids: ::prost::alloc::vec::Vec, + /// buyer_settlement_fees are the fees (both flat and proportional) that the buyer will pay (in addition to the price) + /// for this settlement. #[prost(message, repeated, tag = "5")] pub buyer_settlement_fees: ::prost::alloc::vec::Vec, + /// bid_order_creation_fee is the fee that is being paid to create this order (which is immediately then settled). #[prost(message, optional, tag = "6")] pub bid_order_creation_fee: ::core::option::Option, } +/// MsgFillAsksResponse is a response message for the FillAsks endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1143,6 +1780,7 @@ pub struct MsgFillAsksRequest { )] #[proto_message(type_url = "/provenance.exchange.v1.MsgFillAsksResponse")] pub struct MsgFillAsksResponse {} +/// MsgMarketSettleRequest is a request message for the MarketSettle endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1156,32 +1794,37 @@ pub struct MsgFillAsksResponse {} )] #[proto_message(type_url = "/provenance.exchange.v1.MsgMarketSettleRequest")] pub struct MsgMarketSettleRequest { + /// admin is the account with "settle" permission requesting this settlement. #[prost(string, tag = "1")] pub admin: ::prost::alloc::string::String, + /// market_id is the numerical identifier of the market requesting this settlement. #[prost(uint32, tag = "2")] - #[serde(alias = "marketID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub market_id: u32, + /// ask_order_ids are the ask orders being filled. #[prost(uint64, repeated, tag = "3")] - #[serde(alias = "ask_orderIDs")] #[serde( serialize_with = "crate::serde::as_str_vec::serialize", deserialize_with = "crate::serde::as_str_vec::deserialize" )] pub ask_order_ids: ::prost::alloc::vec::Vec, + /// bid_order_ids are the bid orders being filled. #[prost(uint64, repeated, tag = "4")] - #[serde(alias = "bid_orderIDs")] #[serde( serialize_with = "crate::serde::as_str_vec::serialize", deserialize_with = "crate::serde::as_str_vec::deserialize" )] pub bid_order_ids: ::prost::alloc::vec::Vec, + /// expect_partial is whether to expect an order to only be partially filled. Set to true to indicate that either + /// the last ask order, or last bid order will be partially filled by this settlement. Set to false to indicate + /// that all provided orders will be filled in full during this settlement. #[prost(bool, tag = "5")] pub expect_partial: bool, } +/// MsgMarketSettleResponse is a response message for the MarketSettle endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1195,6 +1838,7 @@ pub struct MsgMarketSettleRequest { )] #[proto_message(type_url = "/provenance.exchange.v1.MsgMarketSettleResponse")] pub struct MsgMarketSettleResponse {} +/// MsgMarketCommitmentSettleRequest is a request message for the MarketCommitmentSettle endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1208,26 +1852,34 @@ pub struct MsgMarketSettleResponse {} )] #[proto_message(type_url = "/provenance.exchange.v1.MsgMarketCommitmentSettleRequest")] pub struct MsgMarketCommitmentSettleRequest { + /// admin is the account with "settle" permission requesting this settlement. #[prost(string, tag = "1")] pub admin: ::prost::alloc::string::String, + /// market_id is the numerical identifier of the market requesting this settlement. #[prost(uint32, tag = "2")] - #[serde(alias = "marketID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub market_id: u32, + /// inputs defines where the funds are coming from. All of these funds must be already committed to the market. #[prost(message, repeated, tag = "3")] pub inputs: ::prost::alloc::vec::Vec, + /// outputs defines how the funds are to be distributed. These funds will be re-committed in the destination accounts. #[prost(message, repeated, tag = "4")] pub outputs: ::prost::alloc::vec::Vec, + /// fees is the funds that the market is collecting as part of this settlement. + /// All of these funds must be already committed to the market. #[prost(message, repeated, tag = "5")] pub fees: ::prost::alloc::vec::Vec, + /// navs are any NAV info that should be updated at the beginning of this settlement. #[prost(message, repeated, tag = "6")] pub navs: ::prost::alloc::vec::Vec, + /// event_tag is a string that is included in the funds-committed/released events. Max length is 100 characters. #[prost(string, tag = "7")] pub event_tag: ::prost::alloc::string::String, } +/// MsgMarketCommitmentSettleResponse is a response message for the MarketCommitmentSettle endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1241,6 +1893,7 @@ pub struct MsgMarketCommitmentSettleRequest { )] #[proto_message(type_url = "/provenance.exchange.v1.MsgMarketCommitmentSettleResponse")] pub struct MsgMarketCommitmentSettleResponse {} +/// MsgMarketReleaseCommitmentsRequest is a request message for the MarketReleaseCommitments endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1254,20 +1907,39 @@ pub struct MsgMarketCommitmentSettleResponse {} )] #[proto_message(type_url = "/provenance.exchange.v1.MsgMarketReleaseCommitmentsRequest")] pub struct MsgMarketReleaseCommitmentsRequest { + /// admin is the account with "cancel" permission requesting this release. #[prost(string, tag = "1")] pub admin: ::prost::alloc::string::String, + /// market_id is the numerical identifier of the market releasing these funds. #[prost(uint32, tag = "2")] - #[serde(alias = "marketID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub market_id: u32, + /// to_release is the funds that are to be released. + /// An entry with a zero amount indicates that all committed funds for that account should be released. #[prost(message, repeated, tag = "3")] pub to_release: ::prost::alloc::vec::Vec, + /// event_tag is a string that is included in the funds-released events. Max length is 100 characters. #[prost(string, tag = "4")] pub event_tag: ::prost::alloc::string::String, } +/// MsgMarketReleaseCommitmentsResponse is a response message for the MarketReleaseCommitments endpoint. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.exchange.v1.MsgMarketReleaseCommitmentsResponse")] +pub struct MsgMarketReleaseCommitmentsResponse {} +/// MsgMarketSetOrderExternalIDRequest is a request message for the MarketSetOrderExternalID endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1281,26 +1953,29 @@ pub struct MsgMarketReleaseCommitmentsRequest { )] #[proto_message(type_url = "/provenance.exchange.v1.MsgMarketSetOrderExternalIDRequest")] pub struct MsgMarketSetOrderExternalIdRequest { + /// admin is the account with "set_ids" permission requesting this settlement. #[prost(string, tag = "1")] pub admin: ::prost::alloc::string::String, + /// market_id is the numerical identifier of the market with the orders to update. #[prost(uint32, tag = "2")] - #[serde(alias = "marketID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub market_id: u32, + /// order_id is the numerical identifier of the order to update. #[prost(uint64, tag = "3")] - #[serde(alias = "orderID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub order_id: u64, + /// external_id is the new external id to associate with the order. Max length is 100 characters. + /// If the external id is already associated with another order in this market, this update will fail. #[prost(string, tag = "4")] - #[serde(alias = "externalID")] pub external_id: ::prost::alloc::string::String, } +/// MsgMarketSetOrderExternalIDResponse is a response message for the MarketSetOrderExternalID endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1314,6 +1989,7 @@ pub struct MsgMarketSetOrderExternalIdRequest { )] #[proto_message(type_url = "/provenance.exchange.v1.MsgMarketSetOrderExternalIDResponse")] pub struct MsgMarketSetOrderExternalIdResponse {} +/// MsgMarketWithdrawRequest is a request message for the MarketWithdraw endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1327,20 +2003,24 @@ pub struct MsgMarketSetOrderExternalIdResponse {} )] #[proto_message(type_url = "/provenance.exchange.v1.MsgMarketWithdrawRequest")] pub struct MsgMarketWithdrawRequest { + /// admin is the account with withdraw permission requesting the withdrawal. #[prost(string, tag = "1")] pub admin: ::prost::alloc::string::String, + /// market_id is the numerical identifier of the market to withdraw from. #[prost(uint32, tag = "2")] - #[serde(alias = "marketID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub market_id: u32, + /// to_address is the address that will receive the funds. #[prost(string, tag = "3")] pub to_address: ::prost::alloc::string::String, + /// amount is the funds to withdraw. #[prost(message, repeated, tag = "4")] pub amount: ::prost::alloc::vec::Vec, } +/// MsgMarketWithdrawResponse is a response message for the MarketWithdraw endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1354,6 +2034,7 @@ pub struct MsgMarketWithdrawRequest { )] #[proto_message(type_url = "/provenance.exchange.v1.MsgMarketWithdrawResponse")] pub struct MsgMarketWithdrawResponse {} +/// MsgMarketUpdateDetailsRequest is a request message for the MarketUpdateDetails endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1367,18 +2048,21 @@ pub struct MsgMarketWithdrawResponse {} )] #[proto_message(type_url = "/provenance.exchange.v1.MsgMarketUpdateDetailsRequest")] pub struct MsgMarketUpdateDetailsRequest { + /// admin is the account with "update" permission requesting this change. #[prost(string, tag = "1")] pub admin: ::prost::alloc::string::String, + /// market_id is the numerical identifier of the market to update details for. #[prost(uint32, tag = "2")] - #[serde(alias = "marketID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub market_id: u32, + /// market_details is some information about this market. #[prost(message, optional, tag = "3")] pub market_details: ::core::option::Option, } +/// MsgMarketUpdateDetailsResponse is a response message for the MarketUpdateDetails endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1392,6 +2076,8 @@ pub struct MsgMarketUpdateDetailsRequest { )] #[proto_message(type_url = "/provenance.exchange.v1.MsgMarketUpdateDetailsResponse")] pub struct MsgMarketUpdateDetailsResponse {} +/// MsgMarketUpdateEnabledRequest is a request message for the MarketUpdateEnabled endpoint. +/// Deprecated: This endpoint is no longer usable. It is replaced by MarketUpdateAcceptingOrders. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1406,21 +2092,28 @@ pub struct MsgMarketUpdateDetailsResponse {} #[proto_message(type_url = "/provenance.exchange.v1.MsgMarketUpdateEnabledRequest")] #[deprecated] pub struct MsgMarketUpdateEnabledRequest { + /// admin is the account with "update" permission requesting this change. + /// Deprecated: This endpoint is no longer usable. It is replaced by MarketUpdateAcceptingOrders. #[deprecated] #[prost(string, tag = "1")] pub admin: ::prost::alloc::string::String, + /// market_id is the numerical identifier of the market to enable or disable. + /// Deprecated: This endpoint is no longer usable. It is replaced by MarketUpdateAcceptingOrders. #[deprecated] #[prost(uint32, tag = "2")] - #[serde(alias = "marketID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub market_id: u32, + /// accepting_orders is whether this market is allowing orders to be created for it. + /// Deprecated: This endpoint is no longer usable. It is replaced by MarketUpdateAcceptingOrders. #[deprecated] #[prost(bool, tag = "3")] pub accepting_orders: bool, } +/// MsgMarketUpdateEnabledResponse is a response message for the MarketUpdateEnabled endpoint. +/// Deprecated: This endpoint is no longer usable. It is replaced by MarketUpdateAcceptingOrders. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1435,6 +2128,7 @@ pub struct MsgMarketUpdateEnabledRequest { #[proto_message(type_url = "/provenance.exchange.v1.MsgMarketUpdateEnabledResponse")] #[deprecated] pub struct MsgMarketUpdateEnabledResponse {} +/// MsgMarketUpdateAcceptingOrdersRequest is a request message for the MarketUpdateAcceptingOrders endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1448,18 +2142,21 @@ pub struct MsgMarketUpdateEnabledResponse {} )] #[proto_message(type_url = "/provenance.exchange.v1.MsgMarketUpdateAcceptingOrdersRequest")] pub struct MsgMarketUpdateAcceptingOrdersRequest { + /// admin is the account with "update" permission requesting this change. #[prost(string, tag = "1")] pub admin: ::prost::alloc::string::String, + /// market_id is the numerical identifier of the market to enable or disable. #[prost(uint32, tag = "2")] - #[serde(alias = "marketID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub market_id: u32, + /// accepting_orders is whether this market is allowing orders to be created for it. #[prost(bool, tag = "3")] pub accepting_orders: bool, } +/// MsgMarketUpdateAcceptingOrdersResponse is a response message for the MarketUpdateAcceptingOrders endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1473,6 +2170,7 @@ pub struct MsgMarketUpdateAcceptingOrdersRequest { )] #[proto_message(type_url = "/provenance.exchange.v1.MsgMarketUpdateAcceptingOrdersResponse")] pub struct MsgMarketUpdateAcceptingOrdersResponse {} +/// MsgMarketUpdateUserSettleRequest is a request message for the MarketUpdateUserSettle endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1486,18 +2184,23 @@ pub struct MsgMarketUpdateAcceptingOrdersResponse {} )] #[proto_message(type_url = "/provenance.exchange.v1.MsgMarketUpdateUserSettleRequest")] pub struct MsgMarketUpdateUserSettleRequest { + /// admin is the account with "update" permission requesting this change. #[prost(string, tag = "1")] pub admin: ::prost::alloc::string::String, + /// market_id is the numerical identifier of the market to enable or disable user-settlement for. #[prost(uint32, tag = "2")] - #[serde(alias = "marketID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub market_id: u32, + /// allow_user_settlement is whether this market allows users to initiate their own settlements. + /// For example, the FillBids and FillAsks endpoints are available if and only if this is true. + /// The MarketSettle endpoint is available (only to market actors) regardless of the value of this field. #[prost(bool, tag = "3")] pub allow_user_settlement: bool, } +/// MsgMarketUpdateUserSettleResponse is a response message for the MarketUpdateUserSettle endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1511,6 +2214,7 @@ pub struct MsgMarketUpdateUserSettleRequest { )] #[proto_message(type_url = "/provenance.exchange.v1.MsgMarketUpdateUserSettleResponse")] pub struct MsgMarketUpdateUserSettleResponse {} +/// MsgMarketUpdateAcceptingCommitmentsRequest is a request message for the MarketUpdateAcceptingCommitments endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1524,18 +2228,23 @@ pub struct MsgMarketUpdateUserSettleResponse {} )] #[proto_message(type_url = "/provenance.exchange.v1.MsgMarketUpdateAcceptingCommitmentsRequest")] pub struct MsgMarketUpdateAcceptingCommitmentsRequest { + /// admin is the account with "update" permission requesting this change. #[prost(string, tag = "1")] pub admin: ::prost::alloc::string::String, + /// market_id is the numerical identifier of the market to enable or disable commitments for. #[prost(uint32, tag = "2")] - #[serde(alias = "marketID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub market_id: u32, + /// accepting_commitments is whether this market allows users to commit funds to it. + /// For example, the CommitFunds endpoint is available if and only if this is true. + /// The MarketCommitmentSettle endpoint is available (only to market actors) regardless of the value of this field. #[prost(bool, tag = "3")] pub accepting_commitments: bool, } +/// MsgMarketUpdateAcceptingCommitmentsResponse is a response message for the MarketUpdateAcceptingCommitments endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1549,6 +2258,7 @@ pub struct MsgMarketUpdateAcceptingCommitmentsRequest { )] #[proto_message(type_url = "/provenance.exchange.v1.MsgMarketUpdateAcceptingCommitmentsResponse")] pub struct MsgMarketUpdateAcceptingCommitmentsResponse {} +/// MsgMarketUpdateIntermediaryDenomRequest is a request message for the MarketUpdateIntermediaryDenom endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1562,18 +2272,21 @@ pub struct MsgMarketUpdateAcceptingCommitmentsResponse {} )] #[proto_message(type_url = "/provenance.exchange.v1.MsgMarketUpdateIntermediaryDenomRequest")] pub struct MsgMarketUpdateIntermediaryDenomRequest { + /// admin is the account with "update" permission requesting this change. #[prost(string, tag = "1")] pub admin: ::prost::alloc::string::String, + /// market_id is the numerical identifier of the market changing the intermediary denom. #[prost(uint32, tag = "2")] - #[serde(alias = "marketID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub market_id: u32, + /// intermediary_denom is the new intermediary denom for this market to use. #[prost(string, tag = "3")] pub intermediary_denom: ::prost::alloc::string::String, } +/// MsgMarketUpdateIntermediaryDenomResponse is a response message for the MarketUpdateIntermediaryDenom endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1587,6 +2300,7 @@ pub struct MsgMarketUpdateIntermediaryDenomRequest { )] #[proto_message(type_url = "/provenance.exchange.v1.MsgMarketUpdateIntermediaryDenomResponse")] pub struct MsgMarketUpdateIntermediaryDenomResponse {} +/// MsgMarketManagePermissionsRequest is a request message for the MarketManagePermissions endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1600,22 +2314,27 @@ pub struct MsgMarketUpdateIntermediaryDenomResponse {} )] #[proto_message(type_url = "/provenance.exchange.v1.MsgMarketManagePermissionsRequest")] pub struct MsgMarketManagePermissionsRequest { + /// admin is the account with "permissions" permission requesting this change. #[prost(string, tag = "1")] pub admin: ::prost::alloc::string::String, + /// market_id is the numerical identifier of the market to manage permissions for. #[prost(uint32, tag = "2")] - #[serde(alias = "marketID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub market_id: u32, + /// revoke_all are addresses that should have all their permissions revoked. #[prost(string, repeated, tag = "3")] pub revoke_all: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// to_revoke are the specific permissions to remove for addresses. #[prost(message, repeated, tag = "4")] pub to_revoke: ::prost::alloc::vec::Vec, + /// to_grant are the permissions to grant to addresses. #[prost(message, repeated, tag = "5")] pub to_grant: ::prost::alloc::vec::Vec, } +/// MsgMarketManagePermissionsResponse is a response message for the MarketManagePermissions endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1629,6 +2348,7 @@ pub struct MsgMarketManagePermissionsRequest { )] #[proto_message(type_url = "/provenance.exchange.v1.MsgMarketManagePermissionsResponse")] pub struct MsgMarketManagePermissionsResponse {} +/// MsgMarketManageReqAttrsRequest is a request message for the MarketManageReqAttrs endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1642,28 +2362,36 @@ pub struct MsgMarketManagePermissionsResponse {} )] #[proto_message(type_url = "/provenance.exchange.v1.MsgMarketManageReqAttrsRequest")] pub struct MsgMarketManageReqAttrsRequest { + /// admin is the account with "attributes" permission requesting this change. #[prost(string, tag = "1")] pub admin: ::prost::alloc::string::String, + /// market_id is the numerical identifier of the market to update required attributes for. #[prost(uint32, tag = "2")] - #[serde(alias = "marketID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub market_id: u32, + /// create_ask_to_add are the attributes that should now also be required to create an ask order. #[prost(string, repeated, tag = "3")] pub create_ask_to_add: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// create_ask_to_remove are the attributes that should no longer be required to create an ask order. #[prost(string, repeated, tag = "4")] pub create_ask_to_remove: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// create_bid_to_add are the attributes that should now also be required to create a bid order. #[prost(string, repeated, tag = "5")] pub create_bid_to_add: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// create_bid_to_remove are the attributes that should no longer be required to create a bid order. #[prost(string, repeated, tag = "6")] pub create_bid_to_remove: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// create_commitment_to_add are the attributes that should now also be required to create a commitment. #[prost(string, repeated, tag = "7")] pub create_commitment_to_add: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// create_commitment_to_remove are the attributes that should no longer be required to create a commitment. #[prost(string, repeated, tag = "8")] pub create_commitment_to_remove: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +/// MsgMarketManageReqAttrsResponse is a response message for the MarketManageReqAttrs endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1677,6 +2405,10 @@ pub struct MsgMarketManageReqAttrsRequest { )] #[proto_message(type_url = "/provenance.exchange.v1.MsgMarketManageReqAttrsResponse")] pub struct MsgMarketManageReqAttrsResponse {} +/// MsgCreatePaymentRequest is a request message for the CreatePayment endpoint. +/// +/// The signer is the payment.source, but we can't define that using the cosmos.msg.v1.signer option. +/// So signers for this msg are defined in code using a custom get-signers function. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1690,9 +2422,11 @@ pub struct MsgMarketManageReqAttrsResponse {} )] #[proto_message(type_url = "/provenance.exchange.v1.MsgCreatePaymentRequest")] pub struct MsgCreatePaymentRequest { + /// payment is the details of the payment to create. #[prost(message, optional, tag = "1")] pub payment: ::core::option::Option, } +/// MsgCreatePaymentResponse is a response message for the CreatePayment endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1706,6 +2440,10 @@ pub struct MsgCreatePaymentRequest { )] #[proto_message(type_url = "/provenance.exchange.v1.MsgCreatePaymentResponse")] pub struct MsgCreatePaymentResponse {} +/// MsgAcceptPaymentRequest is a request message for the AcceptPayment endpoint. +/// +/// The signer is the payment.target, but we can't define that using the cosmos.msg.v1.signer option. +/// So signers for this msg are defined in code using a custom get-signers function. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1719,9 +2457,11 @@ pub struct MsgCreatePaymentResponse {} )] #[proto_message(type_url = "/provenance.exchange.v1.MsgAcceptPaymentRequest")] pub struct MsgAcceptPaymentRequest { + /// payment is the details of the payment to accept. #[prost(message, optional, tag = "1")] pub payment: ::core::option::Option, } +/// MsgAcceptPaymentResponse is a response message for the AcceptPayment endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1735,6 +2475,7 @@ pub struct MsgAcceptPaymentRequest { )] #[proto_message(type_url = "/provenance.exchange.v1.MsgAcceptPaymentResponse")] pub struct MsgAcceptPaymentResponse {} +/// MsgRejectPaymentRequest is a request message for the RejectPayment endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1748,14 +2489,17 @@ pub struct MsgAcceptPaymentResponse {} )] #[proto_message(type_url = "/provenance.exchange.v1.MsgRejectPaymentRequest")] pub struct MsgRejectPaymentRequest { + /// target is the target account of the payment to reject. #[prost(string, tag = "1")] pub target: ::prost::alloc::string::String, + /// source is the source account of the payment to reject. #[prost(string, tag = "2")] pub source: ::prost::alloc::string::String, + /// external_id is the external id of the payment to reject. #[prost(string, tag = "3")] - #[serde(alias = "externalID")] pub external_id: ::prost::alloc::string::String, } +/// MsgRejectPaymentResponse is a response message for the RejectPayment endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1769,6 +2513,7 @@ pub struct MsgRejectPaymentRequest { )] #[proto_message(type_url = "/provenance.exchange.v1.MsgRejectPaymentResponse")] pub struct MsgRejectPaymentResponse {} +/// MsgRejectPaymentsRequest is a request message for the RejectPayments endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1782,11 +2527,14 @@ pub struct MsgRejectPaymentResponse {} )] #[proto_message(type_url = "/provenance.exchange.v1.MsgRejectPaymentsRequest")] pub struct MsgRejectPaymentsRequest { + /// target is the account that wishes to reject some payments. #[prost(string, tag = "1")] pub target: ::prost::alloc::string::String, + /// sources is the source accounts of the payments to reject. #[prost(string, repeated, tag = "2")] pub sources: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +/// MsgRejectPaymentsResponse is a response message for the RejectPayments endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1800,6 +2548,7 @@ pub struct MsgRejectPaymentsRequest { )] #[proto_message(type_url = "/provenance.exchange.v1.MsgRejectPaymentsResponse")] pub struct MsgRejectPaymentsResponse {} +/// MsgCancelPaymentsRequest is a request message for the CancelPayments endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1813,12 +2562,14 @@ pub struct MsgRejectPaymentsResponse {} )] #[proto_message(type_url = "/provenance.exchange.v1.MsgCancelPaymentsRequest")] pub struct MsgCancelPaymentsRequest { + /// source is the account that wishes to cancel some of their payments. #[prost(string, tag = "1")] pub source: ::prost::alloc::string::String, + /// external_ids is all of the external ids of the payments to cancel. #[prost(string, repeated, tag = "2")] - #[serde(alias = "externalIDs")] pub external_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +/// MsgCancelPaymentsResponse is a response message for the CancelPayments endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1832,6 +2583,7 @@ pub struct MsgCancelPaymentsRequest { )] #[proto_message(type_url = "/provenance.exchange.v1.MsgCancelPaymentsResponse")] pub struct MsgCancelPaymentsResponse {} +/// MsgChangePaymentTargetRequest is a request message for the ChangePaymentTarget endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1845,14 +2597,17 @@ pub struct MsgCancelPaymentsResponse {} )] #[proto_message(type_url = "/provenance.exchange.v1.MsgChangePaymentTargetRequest")] pub struct MsgChangePaymentTargetRequest { + /// source is the account that wishes to update the target of one of their payments. #[prost(string, tag = "1")] pub source: ::prost::alloc::string::String, + /// external_id is the external id of the payment to update. #[prost(string, tag = "2")] - #[serde(alias = "externalID")] pub external_id: ::prost::alloc::string::String, + /// new_target is the new target account of the payment. #[prost(string, tag = "3")] pub new_target: ::prost::alloc::string::String, } +/// MsgChangePaymentTargetResponse is a response message for the ChangePaymentTarget endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1866,6 +2621,7 @@ pub struct MsgChangePaymentTargetRequest { )] #[proto_message(type_url = "/provenance.exchange.v1.MsgChangePaymentTargetResponse")] pub struct MsgChangePaymentTargetResponse {} +/// MsgGovCreateMarketRequest is a request message for the GovCreateMarket endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1879,11 +2635,16 @@ pub struct MsgChangePaymentTargetResponse {} )] #[proto_message(type_url = "/provenance.exchange.v1.MsgGovCreateMarketRequest")] pub struct MsgGovCreateMarketRequest { + /// authority should be the governance module account address. #[prost(string, tag = "1")] pub authority: ::prost::alloc::string::String, + /// market is the initial market configuration. + /// If the market_id is 0, the next available market_id will be used (once voting ends). + /// If it is not zero, it must not yet be in use when the voting period ends. #[prost(message, optional, tag = "2")] pub market: ::core::option::Option, } +/// MsgGovCreateMarketResponse is a response message for the GovCreateMarket endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1897,6 +2658,7 @@ pub struct MsgGovCreateMarketRequest { )] #[proto_message(type_url = "/provenance.exchange.v1.MsgGovCreateMarketResponse")] pub struct MsgGovCreateMarketResponse {} +/// MsgGovManageFeesRequest is a request message for the GovManageFees endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1910,62 +2672,82 @@ pub struct MsgGovCreateMarketResponse {} )] #[proto_message(type_url = "/provenance.exchange.v1.MsgGovManageFeesRequest")] pub struct MsgGovManageFeesRequest { + /// authority should be the governance module account address. #[prost(string, tag = "1")] pub authority: ::prost::alloc::string::String, + /// market_id is the market id that will get these fee updates. #[prost(uint32, tag = "2")] - #[serde(alias = "marketID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub market_id: u32, + /// add_fee_create_ask_flat are the create-ask flat fee options to add. #[prost(message, repeated, tag = "3")] pub add_fee_create_ask_flat: ::prost::alloc::vec::Vec, + /// remove_fee_create_ask_flat are the create-ask flat fee options to remove. #[prost(message, repeated, tag = "4")] pub remove_fee_create_ask_flat: ::prost::alloc::vec::Vec, + /// add_fee_create_bid_flat are the create-bid flat fee options to add. #[prost(message, repeated, tag = "5")] pub add_fee_create_bid_flat: ::prost::alloc::vec::Vec, + /// remove_fee_create_bid_flat are the create-bid flat fee options to remove. #[prost(message, repeated, tag = "6")] pub remove_fee_create_bid_flat: ::prost::alloc::vec::Vec, + /// add_fee_seller_settlement_flat are the seller settlement flat fee options to add. #[prost(message, repeated, tag = "7")] pub add_fee_seller_settlement_flat: ::prost::alloc::vec::Vec, + /// remove_fee_seller_settlement_flat are the seller settlement flat fee options to remove. #[prost(message, repeated, tag = "8")] pub remove_fee_seller_settlement_flat: ::prost::alloc::vec::Vec, + /// add_fee_seller_settlement_ratios are the seller settlement fee ratios to add. #[prost(message, repeated, tag = "9")] pub add_fee_seller_settlement_ratios: ::prost::alloc::vec::Vec, + /// remove_fee_seller_settlement_ratios are the seller settlement fee ratios to remove. #[prost(message, repeated, tag = "10")] pub remove_fee_seller_settlement_ratios: ::prost::alloc::vec::Vec, + /// add_fee_buyer_settlement_flat are the buyer settlement flat fee options to add. #[prost(message, repeated, tag = "11")] pub add_fee_buyer_settlement_flat: ::prost::alloc::vec::Vec, + /// remove_fee_buyer_settlement_flat are the buyer settlement flat fee options to remove. #[prost(message, repeated, tag = "12")] pub remove_fee_buyer_settlement_flat: ::prost::alloc::vec::Vec, + /// add_fee_buyer_settlement_ratios are the buyer settlement fee ratios to add. #[prost(message, repeated, tag = "13")] pub add_fee_buyer_settlement_ratios: ::prost::alloc::vec::Vec, + /// remove_fee_buyer_settlement_ratios are the buyer settlement fee ratios to remove. #[prost(message, repeated, tag = "14")] pub remove_fee_buyer_settlement_ratios: ::prost::alloc::vec::Vec, + /// add_fee_create_commitment_flat are the create-commitment flat fee options to add. #[prost(message, repeated, tag = "15")] pub add_fee_create_commitment_flat: ::prost::alloc::vec::Vec, + /// remove_fee_create_commitment_flat are the create-commitment flat fee options to remove. #[prost(message, repeated, tag = "16")] pub remove_fee_create_commitment_flat: ::prost::alloc::vec::Vec, + /// set_fee_commitment_settlement_bips is the new fee_commitment_settlement_bips for the market. + /// It is ignored if it is zero. To set it to zero set unset_fee_commitment_settlement_bips to true. #[prost(uint32, tag = "17")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub set_fee_commitment_settlement_bips: u32, + /// unset_fee_commitment_settlement_bips, if true, sets the fee_commitment_settlement_bips to zero. + /// If false, it is ignored. #[prost(bool, tag = "18")] pub unset_fee_commitment_settlement_bips: bool, } +/// MsgGovManageFeesResponse is a response message for the GovManageFees endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1979,6 +2761,7 @@ pub struct MsgGovManageFeesRequest { )] #[proto_message(type_url = "/provenance.exchange.v1.MsgGovManageFeesResponse")] pub struct MsgGovManageFeesResponse {} +/// MsgGovCloseMarketRequest is a request message for the GovCloseMarket endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1992,16 +2775,18 @@ pub struct MsgGovManageFeesResponse {} )] #[proto_message(type_url = "/provenance.exchange.v1.MsgGovCloseMarketRequest")] pub struct MsgGovCloseMarketRequest { + /// authority must be the governance module account. #[prost(string, tag = "1")] pub authority: ::prost::alloc::string::String, + /// market_id is the numerical identifier of the market to close. #[prost(uint32, tag = "2")] - #[serde(alias = "marketID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub market_id: u32, } +/// MsgGovCloseMarketResponse is a response message for the GovCloseMarket endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2015,6 +2800,8 @@ pub struct MsgGovCloseMarketRequest { )] #[proto_message(type_url = "/provenance.exchange.v1.MsgGovCloseMarketResponse")] pub struct MsgGovCloseMarketResponse {} +/// MsgGovUpdateParamsRequest is a request message for the GovUpdateParams endpoint. +/// Deprecated: Use MsgUpdateParamsRequest instead. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2027,12 +2814,17 @@ pub struct MsgGovCloseMarketResponse {} CosmwasmExt, )] #[proto_message(type_url = "/provenance.exchange.v1.MsgGovUpdateParamsRequest")] +#[deprecated] pub struct MsgGovUpdateParamsRequest { + /// authority should be the governance module account address. #[prost(string, tag = "1")] pub authority: ::prost::alloc::string::String, + /// params are the new param values to set #[prost(message, optional, tag = "2")] pub params: ::core::option::Option, } +/// MsgGovUpdateParamsResponse is a response message for the GovUpdateParams endpoint. +/// Deprecated: Use MsgUpdateParamsResponse instead. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2045,7 +2837,45 @@ pub struct MsgGovUpdateParamsRequest { CosmwasmExt, )] #[proto_message(type_url = "/provenance.exchange.v1.MsgGovUpdateParamsResponse")] +#[deprecated] pub struct MsgGovUpdateParamsResponse {} +/// MsgGovUpdateParamsRequest is a request message for the GovUpdateParams endpoint. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.exchange.v1.MsgUpdateParamsRequest")] +pub struct MsgUpdateParamsRequest { + /// authority should be the governance module account address. + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// params are the new param values to set + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +/// MsgUpdateParamsResponse is a response message for the GovUpdateParams endpoint. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.exchange.v1.MsgUpdateParamsResponse")] +pub struct MsgUpdateParamsResponse {} +/// QueryOrderFeeCalcRequest is a request message for the OrderFeeCalc query. +/// Exactly one of ask_order or bid_order must be provided. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2063,11 +2893,14 @@ pub struct MsgGovUpdateParamsResponse {} response_type = QueryOrderFeeCalcResponse )] pub struct QueryOrderFeeCalcRequest { + /// ask_order is the ask order to calculate the fees for. #[prost(message, optional, tag = "2")] pub ask_order: ::core::option::Option, + /// bid_order is the bid order to calculate the fees for. #[prost(message, optional, tag = "3")] pub bid_order: ::core::option::Option, } +/// QueryOrderFeeCalcResponse is a response message for the OrderFeeCalc query. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2081,16 +2914,31 @@ pub struct QueryOrderFeeCalcRequest { )] #[proto_message(type_url = "/provenance.exchange.v1.QueryOrderFeeCalcResponse")] pub struct QueryOrderFeeCalcResponse { + /// creation_fee_options are the order creation flat fee options available for creating the provided order. + /// If it's empty, no order creation fee is required. + /// When creating the order, you should include exactly one of these. #[prost(message, repeated, tag = "1")] pub creation_fee_options: ::prost::alloc::vec::Vec, + /// settlement_flat_fee_options are the settlement flat fee options available for the provided order. + /// If it's empty, no settlement flat fee is required. + /// When creating an order, you should include exactly one of these in the settlement fees field. #[prost(message, repeated, tag = "2")] pub settlement_flat_fee_options: ::prost::alloc::vec::Vec, + /// settlement_ratio_fee_options are the settlement ratio fee options available for the provided order. + /// If it's empty, no settlement ratio fee is required. + /// + /// If the provided order was a bid order, you should include exactly one of these in the settlement fees field. + /// If the flat and ratio options you've chose have the same denom, a single entry should be included with their sum. + /// + /// If the provided order was an ask order, these are purely informational and represent how much will be removed + /// from your price if it settles at that price. If it settles for more, the actual amount will probably be larger. #[prost(message, repeated, tag = "3")] pub settlement_ratio_fee_options: ::prost::alloc::vec::Vec, } +/// QueryGetOrderRequest is a request message for the GetOrder query. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2108,14 +2956,15 @@ pub struct QueryOrderFeeCalcResponse { response_type = QueryGetOrderResponse )] pub struct QueryGetOrderRequest { + /// order_id is the id of the order to look up. #[prost(uint64, tag = "1")] - #[serde(alias = "orderID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub order_id: u64, } +/// QueryGetOrderResponse is a response message for the GetOrder query. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2129,9 +2978,11 @@ pub struct QueryGetOrderRequest { )] #[proto_message(type_url = "/provenance.exchange.v1.QueryGetOrderResponse")] pub struct QueryGetOrderResponse { + /// order is the requested order. #[prost(message, optional, tag = "1")] pub order: ::core::option::Option, } +/// QueryGetOrderByExternalIDRequest is a request message for the GetOrderByExternalID query. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2149,17 +3000,18 @@ pub struct QueryGetOrderResponse { response_type = QueryGetOrderByExternalIdResponse )] pub struct QueryGetOrderByExternalIdRequest { + /// market_id is the id of the market that's expected to have the order. #[prost(uint32, tag = "1")] - #[serde(alias = "marketID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub market_id: u32, + /// external_id the external id to look up. #[prost(string, tag = "2")] - #[serde(alias = "externalID")] pub external_id: ::prost::alloc::string::String, } +/// QueryGetOrderByExternalIDResponse is a response message for the GetOrderByExternalID query. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2173,9 +3025,11 @@ pub struct QueryGetOrderByExternalIdRequest { )] #[proto_message(type_url = "/provenance.exchange.v1.QueryGetOrderByExternalIDResponse")] pub struct QueryGetOrderByExternalIdResponse { + /// order is the requested order. #[prost(message, optional, tag = "1")] pub order: ::core::option::Option, } +/// QueryGetMarketOrdersRequest is a request message for the GetMarketOrders query. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2193,26 +3047,29 @@ pub struct QueryGetOrderByExternalIdResponse { response_type = QueryGetMarketOrdersResponse )] pub struct QueryGetMarketOrdersRequest { + /// market_id is the id of the market to get all the orders for. #[prost(uint32, tag = "1")] - #[serde(alias = "marketID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub market_id: u32, + /// order_type is optional and can limit orders to only "ask" or "bid" orders. #[prost(string, tag = "2")] pub order_type: ::prost::alloc::string::String, + /// after_order_id is a minimum (exclusive) order id. All results will be strictly greater than this. #[prost(uint64, tag = "3")] - #[serde(alias = "after_orderID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub after_order_id: u64, + /// pagination defines an optional pagination for the request. #[prost(message, optional, tag = "99")] pub pagination: ::core::option::Option, } +/// QueryGetMarketOrdersResponse is a response message for the GetMarketOrders query. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2226,12 +3083,15 @@ pub struct QueryGetMarketOrdersRequest { )] #[proto_message(type_url = "/provenance.exchange.v1.QueryGetMarketOrdersResponse")] pub struct QueryGetMarketOrdersResponse { + /// orders are a page of the orders in the provided market. #[prost(message, repeated, tag = "1")] pub orders: ::prost::alloc::vec::Vec, + /// pagination is the resulting pagination parameters. #[prost(message, optional, tag = "99")] pub pagination: ::core::option::Option, } +/// QueryGetOwnerOrdersRequest is a request message for the GetOwnerOrders query. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2249,21 +3109,25 @@ pub struct QueryGetMarketOrdersResponse { response_type = QueryGetOwnerOrdersResponse )] pub struct QueryGetOwnerOrdersRequest { + /// owner is the bech32 address string of the owner to get the orders for. #[prost(string, tag = "1")] pub owner: ::prost::alloc::string::String, + /// order_type is optional and can limit orders to only "ask" or "bid" orders. #[prost(string, tag = "2")] pub order_type: ::prost::alloc::string::String, + /// after_order_id is a minimum (exclusive) order id. All results will be strictly greater than this. #[prost(uint64, tag = "3")] - #[serde(alias = "after_orderID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub after_order_id: u64, + /// pagination defines an optional pagination for the request. #[prost(message, optional, tag = "99")] pub pagination: ::core::option::Option, } +/// QueryGetOwnerOrdersResponse is a response message for the GetOwnerOrders query. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2277,12 +3141,15 @@ pub struct QueryGetOwnerOrdersRequest { )] #[proto_message(type_url = "/provenance.exchange.v1.QueryGetOwnerOrdersResponse")] pub struct QueryGetOwnerOrdersResponse { + /// orders are a page of the orders for the provided address. #[prost(message, repeated, tag = "1")] pub orders: ::prost::alloc::vec::Vec, + /// pagination is the resulting pagination parameters. #[prost(message, optional, tag = "99")] pub pagination: ::core::option::Option, } +/// QueryGetAssetOrdersRequest is a request message for the GetAssetOrders query. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2300,21 +3167,209 @@ pub struct QueryGetOwnerOrdersResponse { response_type = QueryGetAssetOrdersResponse )] pub struct QueryGetAssetOrdersRequest { + /// asset is the denom of assets to get orders for. #[prost(string, tag = "1")] pub asset: ::prost::alloc::string::String, + /// order_type is optional and can limit orders to only "ask" or "bid" orders. #[prost(string, tag = "2")] pub order_type: ::prost::alloc::string::String, + /// after_order_id is a minimum (exclusive) order id. All results will be strictly greater than this. #[prost(uint64, tag = "3")] - #[serde(alias = "after_orderID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub after_order_id: u64, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "99")] + pub pagination: + ::core::option::Option, +} +/// QueryGetAssetOrdersResponse is a response message for the GetAssetOrders query. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.exchange.v1.QueryGetAssetOrdersResponse")] +pub struct QueryGetAssetOrdersResponse { + /// orders are a page of the orders for the provided asset. + #[prost(message, repeated, tag = "1")] + pub orders: ::prost::alloc::vec::Vec, + /// pagination is the resulting pagination parameters. + #[prost(message, optional, tag = "99")] + pub pagination: + ::core::option::Option, +} +/// QueryGetAllOrdersRequest is a request message for the GetAllOrders query. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.exchange.v1.QueryGetAllOrdersRequest")] +#[proto_query( + path = "/provenance.exchange.v1.Query/GetAllOrders", + response_type = QueryGetAllOrdersResponse +)] +pub struct QueryGetAllOrdersRequest { + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "99")] + pub pagination: + ::core::option::Option, +} +/// QueryGetAllOrdersResponse is a response message for the GetAllOrders query. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.exchange.v1.QueryGetAllOrdersResponse")] +pub struct QueryGetAllOrdersResponse { + /// orders are a page of the all orders. + #[prost(message, repeated, tag = "1")] + pub orders: ::prost::alloc::vec::Vec, + /// pagination is the resulting pagination parameters. + #[prost(message, optional, tag = "99")] + pub pagination: + ::core::option::Option, +} +/// QueryGetCommitmentRequest is a request message for the GetCommitment query. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.exchange.v1.QueryGetCommitmentRequest")] +#[proto_query( + path = "/provenance.exchange.v1.Query/GetCommitment", + response_type = QueryGetCommitmentResponse +)] +pub struct QueryGetCommitmentRequest { + /// account is the bech32 address string of the account in the commitment. + #[prost(string, tag = "1")] + pub account: ::prost::alloc::string::String, + /// market_id is the numeric identifier of the market in the commitment. + #[prost(uint32, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub market_id: u32, +} +/// QueryGetCommitmentResponse is a response message for the GetCommitment query. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.exchange.v1.QueryGetCommitmentResponse")] +pub struct QueryGetCommitmentResponse { + /// amount is the total funds committed to the market by the account. + #[prost(message, repeated, tag = "1")] + pub amount: ::prost::alloc::vec::Vec, +} +/// QueryGetAccountCommitmentsRequest is a request message for the GetAccountCommitments query. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.exchange.v1.QueryGetAccountCommitmentsRequest")] +#[proto_query( + path = "/provenance.exchange.v1.Query/GetAccountCommitments", + response_type = QueryGetAccountCommitmentsResponse +)] +pub struct QueryGetAccountCommitmentsRequest { + /// account is the bech32 address string of the account with the commitments. + #[prost(string, tag = "1")] + pub account: ::prost::alloc::string::String, +} +/// QueryGetAccountCommitmentsResponse is a response message for the GetAccountCommitments query. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.exchange.v1.QueryGetAccountCommitmentsResponse")] +pub struct QueryGetAccountCommitmentsResponse { + /// commitments is the amounts committed from the account to the any market. + #[prost(message, repeated, tag = "1")] + pub commitments: ::prost::alloc::vec::Vec, +} +/// QueryGetMarketCommitmentsRequest is a request message for the GetMarketCommitments query. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.exchange.v1.QueryGetMarketCommitmentsRequest")] +#[proto_query( + path = "/provenance.exchange.v1.Query/GetMarketCommitments", + response_type = QueryGetMarketCommitmentsResponse +)] +pub struct QueryGetMarketCommitmentsRequest { + /// market_id is the numeric identifier of the market with the commitment. + #[prost(uint32, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub market_id: u32, + /// pagination defines an optional pagination for the request. #[prost(message, optional, tag = "99")] pub pagination: ::core::option::Option, } +/// QueryGetMarketCommitmentsResponse is a response message for the GetMarketCommitments query. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2326,14 +3381,17 @@ pub struct QueryGetAssetOrdersRequest { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/provenance.exchange.v1.QueryGetAssetOrdersResponse")] -pub struct QueryGetAssetOrdersResponse { +#[proto_message(type_url = "/provenance.exchange.v1.QueryGetMarketCommitmentsResponse")] +pub struct QueryGetMarketCommitmentsResponse { + /// commitments is the amounts committed to the market from any account. #[prost(message, repeated, tag = "1")] - pub orders: ::prost::alloc::vec::Vec, + pub commitments: ::prost::alloc::vec::Vec, + /// pagination is the resulting pagination parameters. #[prost(message, optional, tag = "99")] pub pagination: ::core::option::Option, } +/// QueryGetAllCommitmentsRequest is a request message for the GetAllCommitments query. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2345,16 +3403,18 @@ pub struct QueryGetAssetOrdersResponse { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/provenance.exchange.v1.QueryGetAllOrdersRequest")] +#[proto_message(type_url = "/provenance.exchange.v1.QueryGetAllCommitmentsRequest")] #[proto_query( - path = "/provenance.exchange.v1.Query/GetAllOrders", - response_type = QueryGetAllOrdersResponse + path = "/provenance.exchange.v1.Query/GetAllCommitments", + response_type = QueryGetAllCommitmentsResponse )] -pub struct QueryGetAllOrdersRequest { +pub struct QueryGetAllCommitmentsRequest { + /// pagination defines an optional pagination for the request. #[prost(message, optional, tag = "99")] pub pagination: ::core::option::Option, } +/// QueryGetAllCommitmentsResponse is a response message for the GetAllCommitments query. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2366,14 +3426,17 @@ pub struct QueryGetAllOrdersRequest { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message(type_url = "/provenance.exchange.v1.QueryGetAllOrdersResponse")] -pub struct QueryGetAllOrdersResponse { +#[proto_message(type_url = "/provenance.exchange.v1.QueryGetAllCommitmentsResponse")] +pub struct QueryGetAllCommitmentsResponse { + /// commitments is the requested commitment information. #[prost(message, repeated, tag = "1")] - pub orders: ::prost::alloc::vec::Vec, + pub commitments: ::prost::alloc::vec::Vec, + /// pagination is the resulting pagination parameters. #[prost(message, optional, tag = "99")] pub pagination: ::core::option::Option, } +/// QueryGetMarketRequest is a request message for the GetMarket query. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2391,14 +3454,15 @@ pub struct QueryGetAllOrdersResponse { response_type = QueryGetMarketResponse )] pub struct QueryGetMarketRequest { + /// market_id is the id of the market to look up. #[prost(uint32, tag = "1")] - #[serde(alias = "marketID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub market_id: u32, } +/// QueryGetMarketResponse is a response message for the GetMarket query. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2412,11 +3476,14 @@ pub struct QueryGetMarketRequest { )] #[proto_message(type_url = "/provenance.exchange.v1.QueryGetMarketResponse")] pub struct QueryGetMarketResponse { + /// address is the bech32 address string of this market's account. #[prost(string, tag = "1")] pub address: ::prost::alloc::string::String, + /// market is all information and details of the market. #[prost(message, optional, tag = "2")] pub market: ::core::option::Option, } +/// QueryGetAllMarketsRequest is a request message for the GetAllMarkets query. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2434,10 +3501,12 @@ pub struct QueryGetMarketResponse { response_type = QueryGetAllMarketsResponse )] pub struct QueryGetAllMarketsRequest { + /// pagination defines an optional pagination for the request. #[prost(message, optional, tag = "99")] pub pagination: ::core::option::Option, } +/// QueryGetAllMarketsResponse is a response message for the GetAllMarkets query. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2451,12 +3520,15 @@ pub struct QueryGetAllMarketsRequest { )] #[proto_message(type_url = "/provenance.exchange.v1.QueryGetAllMarketsResponse")] pub struct QueryGetAllMarketsResponse { + /// markets are a page of the briefs for all markets. #[prost(message, repeated, tag = "1")] pub markets: ::prost::alloc::vec::Vec, + /// pagination is the resulting pagination parameters. #[prost(message, optional, tag = "99")] pub pagination: ::core::option::Option, } +/// QueryParamsRequest is a request message for the Params query. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2474,6 +3546,7 @@ pub struct QueryGetAllMarketsResponse { response_type = QueryParamsResponse )] pub struct QueryParamsRequest {} +/// QueryParamsResponse is a response message for the Params query. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2487,9 +3560,70 @@ pub struct QueryParamsRequest {} )] #[proto_message(type_url = "/provenance.exchange.v1.QueryParamsResponse")] pub struct QueryParamsResponse { + /// params are the exchange module parameter values. #[prost(message, optional, tag = "1")] pub params: ::core::option::Option, } +/// QueryCommitmentSettlementFeeCalcRequest is a request message for the CommitmentSettlementFeeCalc query. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.exchange.v1.QueryCommitmentSettlementFeeCalcRequest")] +#[proto_query( + path = "/provenance.exchange.v1.Query/CommitmentSettlementFeeCalc", + response_type = QueryCommitmentSettlementFeeCalcResponse +)] +pub struct QueryCommitmentSettlementFeeCalcRequest { + /// settlement is a market's commitment settlement request message. + /// If no inputs are provided, only the to_fee_nav field will be populated in the response. + #[prost(message, optional, tag = "1")] + pub settlement: ::core::option::Option, + /// include_breakdown_fields controls the fields that are populated in the response. + /// If false, only the exchange_fees field is populated. + /// If true, all of the fields are populated as possible. + /// If the settlement does not have any inputs, this field defaults to true. + #[prost(bool, tag = "2")] + pub include_breakdown_fields: bool, +} +/// QueryCommitmentSettlementFeeCalcResponse is a response message for the CommitmentSettlementFeeCalc query. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.exchange.v1.QueryCommitmentSettlementFeeCalcResponse")] +pub struct QueryCommitmentSettlementFeeCalcResponse { + /// exchange_fees is the total that the exchange would currently pay for the provided settlement. + #[prost(message, repeated, tag = "1")] + pub exchange_fees: ::prost::alloc::vec::Vec, + /// input_total is the sum of all the inputs in the provided settlement. + #[prost(message, repeated, tag = "2")] + pub input_total: ::prost::alloc::vec::Vec, + /// converted_total is the input_total converted to a single intermediary denom or left as the fee denom. + #[prost(message, repeated, tag = "3")] + pub converted_total: ::prost::alloc::vec::Vec, + /// conversion_navs are the NAVs used to convert the input_total to the converted_total. + #[prost(message, repeated, tag = "4")] + pub conversion_navs: ::prost::alloc::vec::Vec, + /// to_fee_nav is the NAV used to convert the converted_total into the fee denom. + #[prost(message, optional, tag = "5")] + pub to_fee_nav: ::core::option::Option, +} +/// QueryValidateCreateMarketRequest is a request message for the ValidateCreateMarket query. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2507,9 +3641,11 @@ pub struct QueryParamsResponse { response_type = QueryValidateCreateMarketResponse )] pub struct QueryValidateCreateMarketRequest { + /// create_market_request is the request to run validation on. #[prost(message, optional, tag = "1")] pub create_market_request: ::core::option::Option, } +/// QueryValidateCreateMarketResponse is a response message for the ValidateCreateMarket query. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2523,11 +3659,18 @@ pub struct QueryValidateCreateMarketRequest { )] #[proto_message(type_url = "/provenance.exchange.v1.QueryValidateCreateMarketResponse")] pub struct QueryValidateCreateMarketResponse { + /// error is any problems or inconsistencies in the provided gov prop msg. + /// This goes above and beyond the validation done when actually processing the governance proposal. + /// If an error is returned, and gov_prop_will_pass is true, it means the error is more of an + /// inconsistency that might cause certain aspects of the market to behave unexpectedly. #[prost(string, tag = "1")] pub error: ::prost::alloc::string::String, + /// gov_prop_will_pass will be true if the the provided msg will be successfully processed at the end of it's voting + /// period (assuming it passes). #[prost(bool, tag = "2")] pub gov_prop_will_pass: bool, } +/// QueryValidateMarketRequest is a request message for the ValidateMarket query. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2545,14 +3688,15 @@ pub struct QueryValidateCreateMarketResponse { response_type = QueryValidateMarketResponse )] pub struct QueryValidateMarketRequest { + /// market_id is the id of the market to check. #[prost(uint32, tag = "1")] - #[serde(alias = "marketID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub market_id: u32, } +/// QueryValidateMarketResponse is a response message for the ValidateMarket query. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2566,9 +3710,11 @@ pub struct QueryValidateMarketRequest { )] #[proto_message(type_url = "/provenance.exchange.v1.QueryValidateMarketResponse")] pub struct QueryValidateMarketResponse { + /// error is any problems or inconsistencies in the provided market. #[prost(string, tag = "1")] pub error: ::prost::alloc::string::String, } +/// QueryValidateManageFeesRequest is a request message for the ValidateManageFees query. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2586,9 +3732,11 @@ pub struct QueryValidateMarketResponse { response_type = QueryValidateManageFeesResponse )] pub struct QueryValidateManageFeesRequest { + /// manage_fees_request is the request to run validation on. #[prost(message, optional, tag = "1")] pub manage_fees_request: ::core::option::Option, } +/// QueryValidateManageFeesResponse is a response message for the ValidateManageFees query. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2602,11 +3750,244 @@ pub struct QueryValidateManageFeesRequest { )] #[proto_message(type_url = "/provenance.exchange.v1.QueryValidateManageFeesResponse")] pub struct QueryValidateManageFeesResponse { + /// error is any problems or inconsistencies in the provided gov prop msg. + /// This goes above and beyond the validation done when actually processing the governance proposal. + /// If an error is returned, and gov_prop_will_pass is true, it means the error is more of an + /// inconsistency that might cause certain aspects of the market to behave unexpectedly. #[prost(string, tag = "1")] pub error: ::prost::alloc::string::String, + /// gov_prop_will_pass will be true if the the provided msg will be successfully processed at the end of it's voting + /// period (assuming it passes). #[prost(bool, tag = "2")] pub gov_prop_will_pass: bool, } +/// QueryGetPaymentRequest is a request message for the GetPayment query. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.exchange.v1.QueryGetPaymentRequest")] +#[proto_query( + path = "/provenance.exchange.v1.Query/GetPayment", + response_type = QueryGetPaymentResponse +)] +pub struct QueryGetPaymentRequest { + /// source is the source account of the payment to get. + #[prost(string, tag = "1")] + pub source: ::prost::alloc::string::String, + /// external_id is the external id of the payment to get. + #[prost(string, tag = "2")] + pub external_id: ::prost::alloc::string::String, +} +/// QueryGetPaymentResponse is a response message for the GetPayment query. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.exchange.v1.QueryGetPaymentResponse")] +pub struct QueryGetPaymentResponse { + /// payment is the info on the requested payment. + #[prost(message, optional, tag = "1")] + pub payment: ::core::option::Option, +} +/// QueryGetPaymentsWithSourceRequest is a request message for the GetPaymentsWithSource query. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.exchange.v1.QueryGetPaymentsWithSourceRequest")] +#[proto_query( + path = "/provenance.exchange.v1.Query/GetPaymentsWithSource", + response_type = QueryGetPaymentsWithSourceResponse +)] +pub struct QueryGetPaymentsWithSourceRequest { + /// source is the source account of the payments to get. + #[prost(string, tag = "1")] + pub source: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "99")] + pub pagination: + ::core::option::Option, +} +/// QueryGetPaymentsWithSourceResponse is a response message for the GetPaymentsWithSource query. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.exchange.v1.QueryGetPaymentsWithSourceResponse")] +pub struct QueryGetPaymentsWithSourceResponse { + /// payments is all the payments with the requested source. + #[prost(message, repeated, tag = "1")] + pub payments: ::prost::alloc::vec::Vec, + /// pagination is the resulting pagination parameters. + #[prost(message, optional, tag = "99")] + pub pagination: + ::core::option::Option, +} +/// QueryGetPaymentsWithTargetRequest is a request message for the GetPaymentsWithTarget query. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.exchange.v1.QueryGetPaymentsWithTargetRequest")] +#[proto_query( + path = "/provenance.exchange.v1.Query/GetPaymentsWithTarget", + response_type = QueryGetPaymentsWithTargetResponse +)] +pub struct QueryGetPaymentsWithTargetRequest { + /// target is the target account of the payments to get. + #[prost(string, tag = "1")] + pub target: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "99")] + pub pagination: + ::core::option::Option, +} +/// QueryGetPaymentsWithTargetResponse is a response message for the GetPaymentsWithTarget query. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.exchange.v1.QueryGetPaymentsWithTargetResponse")] +pub struct QueryGetPaymentsWithTargetResponse { + /// payments is all the payments with the requested target. + #[prost(message, repeated, tag = "1")] + pub payments: ::prost::alloc::vec::Vec, + /// pagination is the resulting pagination parameters. + #[prost(message, optional, tag = "99")] + pub pagination: + ::core::option::Option, +} +/// QueryGetAllPaymentsRequest is a request message for the GetAllPayments query. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.exchange.v1.QueryGetAllPaymentsRequest")] +#[proto_query( + path = "/provenance.exchange.v1.Query/GetAllPayments", + response_type = QueryGetAllPaymentsResponse +)] +pub struct QueryGetAllPaymentsRequest { + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "99")] + pub pagination: + ::core::option::Option, +} +/// QueryGetAllPaymentsResponse is a response message for the GetAllPayments query. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.exchange.v1.QueryGetAllPaymentsResponse")] +pub struct QueryGetAllPaymentsResponse { + /// payments is all the payments on this page of results. + #[prost(message, repeated, tag = "1")] + pub payments: ::prost::alloc::vec::Vec, + /// pagination is the resulting pagination parameters. + #[prost(message, optional, tag = "99")] + pub pagination: + ::core::option::Option, +} +/// QueryPaymentFeeCalcRequest is a request message for the PaymentFeeCalc query. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.exchange.v1.QueryPaymentFeeCalcRequest")] +#[proto_query( + path = "/provenance.exchange.v1.Query/PaymentFeeCalc", + response_type = QueryPaymentFeeCalcResponse +)] +pub struct QueryPaymentFeeCalcRequest { + /// payment is the details of the payment to create or accept. + #[prost(message, optional, tag = "1")] + pub payment: ::core::option::Option, +} +/// QueryPaymentFeeCalcResponse is a response message for the PaymentFeeCalc query. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.exchange.v1.QueryPaymentFeeCalcResponse")] +pub struct QueryPaymentFeeCalcResponse { + /// fee_create is the fee required to create the provided payment. + #[prost(message, repeated, tag = "1")] + pub fee_create: ::prost::alloc::vec::Vec, + /// fee_accept is the fee required to accept the provided payment. + #[prost(message, repeated, tag = "2")] + pub fee_accept: ::prost::alloc::vec::Vec, +} pub struct ExchangeQuerier<'a, Q: cosmwasm_std::CustomQuery> { querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, } @@ -2701,6 +4082,40 @@ impl<'a, Q: cosmwasm_std::CustomQuery> ExchangeQuerier<'a, Q> { ) -> Result { QueryGetAllOrdersRequest { pagination }.query(self.querier) } + pub fn get_commitment( + &self, + account: ::prost::alloc::string::String, + market_id: u32, + ) -> Result { + QueryGetCommitmentRequest { account, market_id }.query(self.querier) + } + pub fn get_account_commitments( + &self, + account: ::prost::alloc::string::String, + ) -> Result { + QueryGetAccountCommitmentsRequest { account }.query(self.querier) + } + pub fn get_market_commitments( + &self, + market_id: u32, + pagination: ::core::option::Option< + super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + ) -> Result { + QueryGetMarketCommitmentsRequest { + market_id, + pagination, + } + .query(self.querier) + } + pub fn get_all_commitments( + &self, + pagination: ::core::option::Option< + super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + ) -> Result { + QueryGetAllCommitmentsRequest { pagination }.query(self.querier) + } pub fn get_market( &self, market_id: u32, @@ -2718,6 +4133,17 @@ impl<'a, Q: cosmwasm_std::CustomQuery> ExchangeQuerier<'a, Q> { pub fn params(&self) -> Result { QueryParamsRequest {}.query(self.querier) } + pub fn commitment_settlement_fee_calc( + &self, + settlement: ::core::option::Option, + include_breakdown_fields: bool, + ) -> Result { + QueryCommitmentSettlementFeeCalcRequest { + settlement, + include_breakdown_fields, + } + .query(self.querier) + } pub fn validate_create_market( &self, create_market_request: ::core::option::Option, @@ -2742,4 +4168,47 @@ impl<'a, Q: cosmwasm_std::CustomQuery> ExchangeQuerier<'a, Q> { } .query(self.querier) } + pub fn get_payment( + &self, + source: ::prost::alloc::string::String, + external_id: ::prost::alloc::string::String, + ) -> Result { + QueryGetPaymentRequest { + source, + external_id, + } + .query(self.querier) + } + pub fn get_payments_with_source( + &self, + source: ::prost::alloc::string::String, + pagination: ::core::option::Option< + super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + ) -> Result { + QueryGetPaymentsWithSourceRequest { source, pagination }.query(self.querier) + } + pub fn get_payments_with_target( + &self, + target: ::prost::alloc::string::String, + pagination: ::core::option::Option< + super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + ) -> Result { + QueryGetPaymentsWithTargetRequest { target, pagination }.query(self.querier) + } + pub fn get_all_payments( + &self, + pagination: ::core::option::Option< + super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + ) -> Result { + QueryGetAllPaymentsRequest { pagination }.query(self.querier) + } + pub fn payment_fee_calc( + &self, + payment: ::core::option::Option, + ) -> Result { + QueryPaymentFeeCalcRequest { payment }.query(self.querier) + } } diff --git a/packages/provwasm-std/src/types/provenance/hold/v1.rs b/packages/provwasm-std/src/types/provenance/hold/v1.rs index 96b0e202..80d957ba 100644 --- a/packages/provwasm-std/src/types/provenance/hold/v1.rs +++ b/packages/provwasm-std/src/types/provenance/hold/v1.rs @@ -1,4 +1,5 @@ use provwasm_proc_macro::CosmwasmExt; +/// EventHoldAdded is an event indicating that some funds were placed on hold in an account. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -12,13 +13,17 @@ use provwasm_proc_macro::CosmwasmExt; )] #[proto_message(type_url = "/provenance.hold.v1.EventHoldAdded")] pub struct EventHoldAdded { + /// address is the bech32 address string of the account with the funds. #[prost(string, tag = "1")] pub address: ::prost::alloc::string::String, + /// amount is a Coins string of the funds placed on hold. #[prost(string, tag = "2")] pub amount: ::prost::alloc::string::String, + /// reason is a human-readable indicator of why this hold was added. #[prost(string, tag = "3")] pub reason: ::prost::alloc::string::String, } +/// EventHoldReleased is an event indicating that some funds were released from hold for an account. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -32,11 +37,14 @@ pub struct EventHoldAdded { )] #[proto_message(type_url = "/provenance.hold.v1.EventHoldReleased")] pub struct EventHoldReleased { + /// address is the bech32 address string of the account with the funds. #[prost(string, tag = "1")] pub address: ::prost::alloc::string::String, + /// amount is a Coins string of the funds released from hold. #[prost(string, tag = "2")] pub amount: ::prost::alloc::string::String, } +/// AccountHold associates an address with an amount on hold for that address. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -50,11 +58,32 @@ pub struct EventHoldReleased { )] #[proto_message(type_url = "/provenance.hold.v1.AccountHold")] pub struct AccountHold { + /// address is the account address that holds the funds on hold. #[prost(string, tag = "1")] pub address: ::prost::alloc::string::String, + /// amount is the balances that are on hold for the address. #[prost(message, repeated, tag = "2")] pub amount: ::prost::alloc::vec::Vec, } +/// GenesisState defines the attribute module's genesis state. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.hold.v1.GenesisState")] +pub struct GenesisState { + /// holds defines the funds on hold at genesis. + #[prost(message, repeated, tag = "1")] + pub holds: ::prost::alloc::vec::Vec, +} +/// GetHoldsRequest is the request type for the Query/GetHolds query. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -72,9 +101,11 @@ pub struct AccountHold { response_type = GetHoldsResponse )] pub struct GetHoldsRequest { + /// address is the account address to get on-hold balances for. #[prost(string, tag = "1")] pub address: ::prost::alloc::string::String, } +/// GetHoldsResponse is the response type for the Query/GetHolds query. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -88,9 +119,11 @@ pub struct GetHoldsRequest { )] #[proto_message(type_url = "/provenance.hold.v1.GetHoldsResponse")] pub struct GetHoldsResponse { + /// amount is the total on hold for the requested address. #[prost(message, repeated, tag = "1")] pub amount: ::prost::alloc::vec::Vec, } +/// GetAllHoldsRequest is the request type for the Query/GetAllHolds query. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -108,10 +141,12 @@ pub struct GetHoldsResponse { response_type = GetAllHoldsResponse )] pub struct GetAllHoldsRequest { + /// pagination defines an optional pagination for the request. #[prost(message, optional, tag = "99")] pub pagination: ::core::option::Option, } +/// GetAllHoldsResponse is the response type for the Query/GetAllHolds query. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -125,8 +160,10 @@ pub struct GetAllHoldsRequest { )] #[proto_message(type_url = "/provenance.hold.v1.GetAllHoldsResponse")] pub struct GetAllHoldsResponse { + /// holds is a list of addresses with funds on hold and the amounts being held. #[prost(message, repeated, tag = "1")] pub holds: ::prost::alloc::vec::Vec, + /// pagination defines an optional pagination for the request. #[prost(message, optional, tag = "99")] pub pagination: ::core::option::Option, diff --git a/packages/provwasm-std/src/types/provenance/ibchooks/v1.rs b/packages/provwasm-std/src/types/provenance/ibchooks/v1.rs index 980ec42d..a4359649 100644 --- a/packages/provwasm-std/src/types/provenance/ibchooks/v1.rs +++ b/packages/provwasm-std/src/types/provenance/ibchooks/v1.rs @@ -1,4 +1,22 @@ use provwasm_proc_macro::CosmwasmExt; +/// EventIBCHooksParamsUpdated defines the event emitted after updating ibchooks parameters. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.ibchooks.v1.EventIBCHooksParamsUpdated")] +pub struct EventIbcHooksParamsUpdated { + #[prost(string, repeated, tag = "1")] + pub allowed_async_ack_contracts: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// Params defines the allowed async ack contracts #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -15,6 +33,24 @@ pub struct Params { #[prost(string, repeated, tag = "1")] pub allowed_async_ack_contracts: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +/// GenesisState is the IBC Hooks genesis state (params) +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.ibchooks.v1.GenesisState")] +pub struct GenesisState { + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} +/// QueryParamsRequest is the request type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -32,6 +68,7 @@ pub struct Params { response_type = QueryParamsResponse )] pub struct QueryParamsRequest {} +/// QueryParamsResponse is the response type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -45,9 +82,11 @@ pub struct QueryParamsRequest {} )] #[proto_message(type_url = "/provenance.ibchooks.v1.QueryParamsResponse")] pub struct QueryParamsResponse { + /// params defines the parameters of the module. #[prost(message, optional, tag = "1")] pub params: ::core::option::Option, } +/// MsgEmitIBCAck is the IBC Acknowledgement #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -72,6 +111,7 @@ pub struct MsgEmitIbcAck { #[prost(string, tag = "3")] pub channel: ::prost::alloc::string::String, } +/// MsgEmitIBCAckResponse is the IBC Acknowledgement response #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -90,6 +130,7 @@ pub struct MsgEmitIbcAckResponse { #[prost(string, tag = "2")] pub ibc_ack: ::prost::alloc::string::String, } +/// MsgUpdateParamsRequest is a request message for the UpdateParams endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -103,11 +144,14 @@ pub struct MsgEmitIbcAckResponse { )] #[proto_message(type_url = "/provenance.ibchooks.v1.MsgUpdateParamsRequest")] pub struct MsgUpdateParamsRequest { + /// authority should be the governance module account address. #[prost(string, tag = "1")] pub authority: ::prost::alloc::string::String, + /// params are the new param values to set. #[prost(message, optional, tag = "2")] pub params: ::core::option::Option, } +/// MsgUpdateParamsResponse is a response message for the UpdateParams endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, diff --git a/packages/provwasm-std/src/types/provenance/ibcratelimit/v1.rs b/packages/provwasm-std/src/types/provenance/ibcratelimit/v1.rs index 114882ff..99e7065c 100644 --- a/packages/provwasm-std/src/types/provenance/ibcratelimit/v1.rs +++ b/packages/provwasm-std/src/types/provenance/ibcratelimit/v1.rs @@ -1,4 +1,64 @@ use provwasm_proc_macro::CosmwasmExt; +/// EventAckRevertFailure is emitted when an Ack revert fails +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.ibcratelimit.v1.EventAckRevertFailure")] +pub struct EventAckRevertFailure { + /// module is the name of the module that emitted it. + #[prost(string, tag = "1")] + pub module: ::prost::alloc::string::String, + /// packet is the packet received on acknowledgement. + #[prost(string, tag = "2")] + pub packet: ::prost::alloc::string::String, + /// ack is the packet's inner acknowledgement message. + #[prost(string, tag = "3")] + pub ack: ::prost::alloc::string::String, +} +/// EventTimeoutRevertFailure is emitted when a Timeout revert fails +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.ibcratelimit.v1.EventTimeoutRevertFailure")] +pub struct EventTimeoutRevertFailure { + /// module is the name of the module that emitted it. + #[prost(string, tag = "1")] + pub module: ::prost::alloc::string::String, + /// packet is the packet received on timeout. + #[prost(string, tag = "2")] + pub packet: ::prost::alloc::string::String, +} +/// EventParamsUpdated is an event emitted when the ibcratelimit module's params have been updated. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.ibcratelimit.v1.EventParamsUpdated")] +pub struct EventParamsUpdated {} +/// Params defines the parameters for the ibcratelimit module. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -12,9 +72,29 @@ use provwasm_proc_macro::CosmwasmExt; )] #[proto_message(type_url = "/provenance.ibcratelimit.v1.Params")] pub struct Params { + /// contract_address is the address of the rate limiter contract. #[prost(string, tag = "1")] pub contract_address: ::prost::alloc::string::String, } +/// GenesisState defines the ibcratelimit module's genesis state. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.ibcratelimit.v1.GenesisState")] +pub struct GenesisState { + /// params are all the parameters of the module. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} +/// ParamsRequest is the request type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -32,6 +112,7 @@ pub struct Params { response_type = ParamsResponse )] pub struct ParamsRequest {} +/// ParamsResponse is the response type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -45,9 +126,12 @@ pub struct ParamsRequest {} )] #[proto_message(type_url = "/provenance.ibcratelimit.v1.ParamsResponse")] pub struct ParamsResponse { + /// params defines the parameters of the module. #[prost(message, optional, tag = "1")] pub params: ::core::option::Option, } +/// MsgGovUpdateParamsRequest is a request message for the GovUpdateParams endpoint. +/// Deprecated: Use MsgUpdateParamsRequest instead. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -62,11 +146,15 @@ pub struct ParamsResponse { #[proto_message(type_url = "/provenance.ibcratelimit.v1.MsgGovUpdateParamsRequest")] #[deprecated] pub struct MsgGovUpdateParamsRequest { + /// authority should be the governance module account address. #[prost(string, tag = "1")] pub authority: ::prost::alloc::string::String, + /// params are the new param values to set. #[prost(message, optional, tag = "2")] pub params: ::core::option::Option, } +/// MsgGovUpdateParamsResponse is a response message for the GovUpdateParams endpoint. +/// Deprecated: Use MsgUpdateParamsResponse instead. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -81,6 +169,7 @@ pub struct MsgGovUpdateParamsRequest { #[proto_message(type_url = "/provenance.ibcratelimit.v1.MsgGovUpdateParamsResponse")] #[deprecated] pub struct MsgGovUpdateParamsResponse {} +/// MsgUpdateParamsRequest is a request message for the UpdateParams endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -94,11 +183,14 @@ pub struct MsgGovUpdateParamsResponse {} )] #[proto_message(type_url = "/provenance.ibcratelimit.v1.MsgUpdateParamsRequest")] pub struct MsgUpdateParamsRequest { + /// authority should be the governance module account address. #[prost(string, tag = "1")] pub authority: ::prost::alloc::string::String, + /// params are the new param values to set. #[prost(message, optional, tag = "2")] pub params: ::core::option::Option, } +/// MsgUpdateParamsResponse is a response message for the UpdateParams endpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, diff --git a/packages/provwasm-std/src/types/provenance/marker/v1.rs b/packages/provwasm-std/src/types/provenance/marker/v1.rs index cb36c88b..1ed4e4fa 100644 --- a/packages/provwasm-std/src/types/provenance/marker/v1.rs +++ b/packages/provwasm-std/src/types/provenance/marker/v1.rs @@ -1,4 +1,5 @@ use provwasm_proc_macro::CosmwasmExt; +/// AccessGrant associates a collection of permissions with an address for delegated marker account control. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -21,18 +22,38 @@ pub struct AccessGrant { )] pub permissions: ::prost::alloc::vec::Vec, } +/// Access defines the different types of permissions that a marker supports granting to an address. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] #[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] pub enum Access { + /// ACCESS_UNSPECIFIED defines a no-op vote option. Unspecified = 0, + /// ACCESS_MINT is the ability to increase the supply of a marker. Mint = 1, + /// ACCESS_BURN is the ability to decrease the supply of the marker using coin held by the marker. Burn = 2, + /// ACCESS_DEPOSIT is the ability to transfer funds from another account to this marker account + /// or to set a reference to this marker in the metadata/scopes module. Deposit = 3, + /// ACCESS_WITHDRAW is the ability to transfer funds from this marker account to another account + /// or to remove a reference to this marker in the metadata/scopes module. Withdraw = 4, + /// ACCESS_DELETE is the ability to move a proposed, finalized or active marker into the cancelled state. + /// This access also allows cancelled markers to be marked for deletion. Delete = 5, + /// ACCESS_ADMIN is the ability to add access grants for accounts to the list of marker permissions. + /// This access also gives the ability to update the marker's denom metadata. Admin = 6, + /// ACCESS_TRANSFER is the ability to manage transfer settings and broker transfers of the marker. + /// Accounts with this access can: + /// - Update the marker's required attributes. + /// - Update the send-deny list. + /// - Use the transfer or bank send endpoints to move marker funds out of their own account. + /// This access right is only supported on RESTRICTED markers. Transfer = 7, + /// ACCESS_FORCE_TRANSFER is the ability to transfer restricted coins from a 3rd-party account without their signature. + /// This access right is only supported on RESTRICTED markers and only has meaning when allow_forced_transfer is true. ForceTransfer = 8, } impl Access { @@ -68,30 +89,9 @@ impl Access { _ => None, } } - - pub fn serialize(v: &i32, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - let enum_value = Self::try_from(*v); - match enum_value { - Ok(v) => serializer.serialize_str(v.as_str_name()), - Err(e) => Err(serde::ser::Error::custom(e)), - } - } - - pub fn deserialize<'de, D>(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - use serde::de::Deserialize; - let s = String::deserialize(deserializer)?; - match Self::from_str_name(&s) { - Some(v) => Ok(v.into()), - None => Err(serde::de::Error::custom("unknown value")), - } - } } +/// MarkerTransferAuthorization gives the grantee permissions to execute +/// a marker transfer on behalf of the granter's account. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -105,11 +105,15 @@ impl Access { )] #[proto_message(type_url = "/provenance.marker.v1.MarkerTransferAuthorization")] pub struct MarkerTransferAuthorization { + /// transfer_limit is the total amount the grantee can transfer #[prost(message, repeated, tag = "1")] pub transfer_limit: ::prost::alloc::vec::Vec, + /// allow_list specifies an optional list of addresses to whom the grantee can send restricted coins on behalf of the + /// granter. If omitted, any recipient is allowed. #[prost(string, repeated, tag = "2")] pub allow_list: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +/// Params defines the set of params for the account module. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -123,16 +127,26 @@ pub struct MarkerTransferAuthorization { )] #[proto_message(type_url = "/provenance.marker.v1.Params")] pub struct Params { + /// Deprecated: Prefer to use `max_supply` instead. Maximum amount of supply to allow a marker to be created with #[deprecated] #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] pub max_total_supply: u64, + /// indicates if governance based controls of markers is allowed. #[prost(bool, tag = "2")] pub enable_governance: bool, + /// a regular expression used to validate marker denom values from normal create requests (governance + /// requests are only subject to platform coin validation denom expression) #[prost(string, tag = "3")] pub unrestricted_denom_regex: ::prost::alloc::string::String, + /// maximum amount of supply to allow a marker to be created with #[prost(string, tag = "4")] pub max_supply: ::prost::alloc::string::String, } +/// MarkerAccount holds the marker configuration information in addition to a base account structure. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -146,38 +160,85 @@ pub struct Params { )] #[proto_message(type_url = "/provenance.marker.v1.MarkerAccount")] pub struct MarkerAccount { + /// base cosmos account information including address and coin holdings. #[prost(message, optional, tag = "1")] pub base_account: ::core::option::Option, + /// Address that owns the marker configuration. This account must sign any requests + /// to change marker config (only valid for statuses prior to finalization) #[prost(string, tag = "2")] pub manager: ::prost::alloc::string::String, + /// Access control lists #[prost(message, repeated, tag = "3")] pub access_control: ::prost::alloc::vec::Vec, + /// Indicates the current status of this marker record. #[prost(enumeration = "MarkerStatus", tag = "4")] #[serde( - serialize_with = "MarkerStatus::serialize", - deserialize_with = "MarkerStatus::deserialize" + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" )] pub status: i32, + /// value denomination and total supply for the token. #[prost(string, tag = "5")] pub denom: ::prost::alloc::string::String, + /// the total supply expected for a marker. This is the amount that is minted when a marker is created. #[prost(string, tag = "6")] pub supply: ::prost::alloc::string::String, + /// Marker type information #[prost(enumeration = "MarkerType", tag = "7")] #[serde( - serialize_with = "MarkerType::serialize", - deserialize_with = "MarkerType::deserialize" + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" )] pub marker_type: i32, + /// A fixed supply will mint additional coin automatically if the total supply decreases below a set value. This + /// may occur if the coin is burned or an account holding the coin is slashed. (default: true) #[prost(bool, tag = "8")] pub supply_fixed: bool, + /// indicates that governance based control is allowed for this marker #[prost(bool, tag = "9")] pub allow_governance_control: bool, + /// Whether an admin can transfer restricted coins from a 3rd-party account without their signature. #[prost(bool, tag = "10")] pub allow_forced_transfer: bool, + /// list of required attributes on restricted marker in order to send and receive transfers if sender does not have + /// transfer authority #[prost(string, repeated, tag = "11")] pub required_attributes: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +/// NetAssetValue defines a marker's net asset value +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.marker.v1.NetAssetValue")] +pub struct NetAssetValue { + /// price is the complete value of the asset's volume + #[prost(message, optional, tag = "1")] + pub price: ::core::option::Option, + /// volume is the number of tokens of the marker that were purchased for the price + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub volume: u64, + /// updated_block_height is the block height of last update + #[prost(uint64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub updated_block_height: u64, +} +/// EventMarkerAdd event emitted when marker is added #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -204,6 +265,7 @@ pub struct EventMarkerAdd { #[prost(string, tag = "6")] pub address: ::prost::alloc::string::String, } +/// EventMarkerAddAccess event emitted when marker access is added #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -224,6 +286,7 @@ pub struct EventMarkerAddAccess { #[prost(string, tag = "3")] pub administrator: ::prost::alloc::string::String, } +/// EventMarkerAccess event access permissions for address #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -242,6 +305,7 @@ pub struct EventMarkerAccess { #[prost(string, repeated, tag = "2")] pub permissions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +/// EventMarkerDeleteAccess event emitted when marker access is revoked #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -262,6 +326,7 @@ pub struct EventMarkerDeleteAccess { #[prost(string, tag = "3")] pub administrator: ::prost::alloc::string::String, } +/// EventMarkerFinalize event emitted when marker is finalized #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -280,6 +345,7 @@ pub struct EventMarkerFinalize { #[prost(string, tag = "2")] pub administrator: ::prost::alloc::string::String, } +/// EventMarkerActivate event emitted when marker is activated #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -298,6 +364,7 @@ pub struct EventMarkerActivate { #[prost(string, tag = "2")] pub administrator: ::prost::alloc::string::String, } +/// EventMarkerCancel event emitted when marker is cancelled #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -316,6 +383,7 @@ pub struct EventMarkerCancel { #[prost(string, tag = "2")] pub administrator: ::prost::alloc::string::String, } +/// EventMarkerDelete event emitted when marker is deleted #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -334,6 +402,7 @@ pub struct EventMarkerDelete { #[prost(string, tag = "2")] pub administrator: ::prost::alloc::string::String, } +/// EventMarkerMint event emitted when additional marker supply is minted #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -354,6 +423,7 @@ pub struct EventMarkerMint { #[prost(string, tag = "3")] pub administrator: ::prost::alloc::string::String, } +/// EventMarkerBurn event emitted when coin is burned from marker #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -374,6 +444,7 @@ pub struct EventMarkerBurn { #[prost(string, tag = "3")] pub administrator: ::prost::alloc::string::String, } +/// EventMarkerWithdraw event emitted when coins are withdrew from marker #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -396,6 +467,7 @@ pub struct EventMarkerWithdraw { #[prost(string, tag = "4")] pub to_address: ::prost::alloc::string::String, } +/// EventMarkerTransfer event emitted when coins are transfered to from account to another #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -420,6 +492,7 @@ pub struct EventMarkerTransfer { #[prost(string, tag = "5")] pub from_address: ::prost::alloc::string::String, } +/// EventMarkerSetDenomMetadata event emitted when metadata is set on marker with denom #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -448,6 +521,7 @@ pub struct EventMarkerSetDenomMetadata { #[prost(string, tag = "7")] pub metadata_symbol: ::prost::alloc::string::String, } +/// EventDenomUnit denom units for set denom metadata event #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -468,12 +542,60 @@ pub struct EventDenomUnit { #[prost(string, repeated, tag = "3")] pub aliases: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +/// EventSetNetAssetValue event emitted when Net Asset Value for marker is update or added +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.marker.v1.EventSetNetAssetValue")] +pub struct EventSetNetAssetValue { + #[prost(string, tag = "1")] + pub denom: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub price: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub volume: ::prost::alloc::string::String, + #[prost(string, tag = "4")] + pub source: ::prost::alloc::string::String, +} +/// EventMarkerParamsUpdated event emitted when marker params are updated. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.marker.v1.EventMarkerParamsUpdated")] +pub struct EventMarkerParamsUpdated { + #[prost(string, tag = "1")] + pub enable_governance: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub unrestricted_denom_regex: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub max_supply: ::prost::alloc::string::String, +} +/// MarkerType defines the types of marker #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] #[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] pub enum MarkerType { + /// MARKER_TYPE_UNSPECIFIED is an invalid/unknown marker type. Unspecified = 0, + /// MARKER_TYPE_COIN is a marker that represents a standard fungible coin (default). Coin = 1, + /// MARKER_TYPE_RESTRICTED is a marker that represents a denom with send_enabled = false. Restricted = 2, } impl MarkerType { @@ -497,39 +619,24 @@ impl MarkerType { _ => None, } } - - pub fn serialize(v: &i32, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - let enum_value = Self::try_from(*v); - match enum_value { - Ok(v) => serializer.serialize_str(v.as_str_name()), - Err(e) => Err(serde::ser::Error::custom(e)), - } - } - - pub fn deserialize<'de, D>(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - use serde::de::Deserialize; - let s = String::deserialize(deserializer)?; - match Self::from_str_name(&s) { - Some(v) => Ok(v.into()), - None => Err(serde::de::Error::custom("unknown value")), - } - } } +/// MarkerStatus defines the various states a marker account can be in. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] #[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] pub enum MarkerStatus { + /// MARKER_STATUS_UNSPECIFIED - Unknown/Invalid Marker Status Unspecified = 0, + /// MARKER_STATUS_PROPOSED - Initial configuration period, updates allowed, token supply not created. Proposed = 1, + /// MARKER_STATUS_FINALIZED - Configuration finalized, ready for supply creation Finalized = 2, + /// MARKER_STATUS_ACTIVE - Supply is created, rules are in force. Active = 3, + /// MARKER_STATUS_CANCELLED - Marker has been cancelled, pending destroy Cancelled = 4, + /// MARKER_STATUS_DESTROYED - Marker supply has all been recalled, marker is considered destroyed and no further + /// actions allowed. Destroyed = 5, } impl MarkerStatus { @@ -559,30 +666,126 @@ impl MarkerStatus { _ => None, } } - - pub fn serialize(v: &i32, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - let enum_value = Self::try_from(*v); - match enum_value { - Ok(v) => serializer.serialize_str(v.as_str_name()), - Err(e) => Err(serde::ser::Error::custom(e)), - } - } - - pub fn deserialize<'de, D>(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - use serde::de::Deserialize; - let s = String::deserialize(deserializer)?; - match Self::from_str_name(&s) { - Some(v) => Ok(v.into()), - None => Err(serde::de::Error::custom("unknown value")), - } - } } +/// GenesisState defines the account module's genesis state. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.marker.v1.GenesisState")] +pub struct GenesisState { + /// params defines all the parameters of the module. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, + /// A collection of marker accounts to create on start + #[prost(message, repeated, tag = "2")] + pub markers: ::prost::alloc::vec::Vec, + /// list of marker net asset values + #[prost(message, repeated, tag = "3")] + pub net_asset_values: ::prost::alloc::vec::Vec, + /// list of denom based denied send addresses + #[prost(message, repeated, tag = "4")] + pub deny_send_addresses: ::prost::alloc::vec::Vec, +} +/// DenySendAddress defines addresses that are denied sends for marker denom +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.marker.v1.DenySendAddress")] +pub struct DenySendAddress { + /// marker_address is the marker's address for denied address + #[prost(string, tag = "1")] + pub marker_address: ::prost::alloc::string::String, + /// deny_address defines all wallet addresses that are denied sends for the marker + #[prost(string, tag = "2")] + pub deny_address: ::prost::alloc::string::String, +} +/// MarkerNetAssetValues defines the net asset values for a marker +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.marker.v1.MarkerNetAssetValues")] +pub struct MarkerNetAssetValues { + /// address defines the marker address + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// net_asset_values that are assigned to marker + #[prost(message, repeated, tag = "2")] + pub net_asset_values: ::prost::alloc::vec::Vec, +} +/// AddMarkerProposal is deprecated and can no longer be used. +/// Deprecated: This message is no longer usable. It is only still included for +/// backwards compatibility (e.g. looking up old governance proposals). +/// It is replaced by providing a MsgAddMarkerRequest in a governance proposal. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.marker.v1.AddMarkerProposal")] +#[deprecated] +pub struct AddMarkerProposal { + #[prost(string, tag = "1")] + pub title: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + #[prost(message, optional, tag = "3")] + pub amount: ::core::option::Option, + #[prost(string, tag = "4")] + pub manager: ::prost::alloc::string::String, + #[prost(enumeration = "MarkerStatus", tag = "5")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub status: i32, + #[prost(enumeration = "MarkerType", tag = "6")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub marker_type: i32, + #[prost(message, repeated, tag = "7")] + pub access_list: ::prost::alloc::vec::Vec, + #[prost(bool, tag = "8")] + pub supply_fixed: bool, + #[prost(bool, tag = "9")] + pub allow_governance_control: bool, +} +/// SupplyIncreaseProposal defines a governance proposal to administer a marker and increase total supply of the marker +/// through minting coin and placing it within the marker or assigning it directly to an account +/// Deprecated: This message is no longer usable. It is only still included for +/// backwards compatibility (e.g. looking up old governance proposals). +/// It is replaced by providing a MsgSupplyIncreaseProposalRequest in a governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -595,6 +798,7 @@ impl MarkerStatus { CosmwasmExt, )] #[proto_message(type_url = "/provenance.marker.v1.SupplyIncreaseProposal")] +#[deprecated] pub struct SupplyIncreaseProposal { #[prost(string, tag = "1")] pub title: ::prost::alloc::string::String, @@ -602,9 +806,15 @@ pub struct SupplyIncreaseProposal { pub description: ::prost::alloc::string::String, #[prost(message, optional, tag = "3")] pub amount: ::core::option::Option, + /// an optional target address for the minted coin from this request #[prost(string, tag = "4")] pub target_address: ::prost::alloc::string::String, } +/// SupplyDecreaseProposal defines a governance proposal to administer a marker and decrease the total supply through +/// burning coin held within the marker +/// Deprecated: This message is no longer usable. It is only still included for +/// backwards compatibility (e.g. looking up old governance proposals). +/// It is replaced by providing a MsgSupplyDecreaseProposalRequest in a governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -617,6 +827,7 @@ pub struct SupplyIncreaseProposal { CosmwasmExt, )] #[proto_message(type_url = "/provenance.marker.v1.SupplyDecreaseProposal")] +#[deprecated] pub struct SupplyDecreaseProposal { #[prost(string, tag = "1")] pub title: ::prost::alloc::string::String, @@ -625,6 +836,11 @@ pub struct SupplyDecreaseProposal { #[prost(message, optional, tag = "3")] pub amount: ::core::option::Option, } +/// SetAdministratorProposal defines a governance proposal to administer a marker and set administrators with specific +/// access on the marker +/// Deprecated: This message is no longer usable. It is only still included for +/// backwards compatibility (e.g. looking up old governance proposals). +/// It is replaced by providing a MsgSetAdministratorProposalRequest in a governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -637,6 +853,7 @@ pub struct SupplyDecreaseProposal { CosmwasmExt, )] #[proto_message(type_url = "/provenance.marker.v1.SetAdministratorProposal")] +#[deprecated] pub struct SetAdministratorProposal { #[prost(string, tag = "1")] pub title: ::prost::alloc::string::String, @@ -647,6 +864,11 @@ pub struct SetAdministratorProposal { #[prost(message, repeated, tag = "4")] pub access: ::prost::alloc::vec::Vec, } +/// RemoveAdministratorProposal defines a governance proposal to administer a marker and remove all permissions for a +/// given address +/// Deprecated: This message is no longer usable. It is only still included for +/// backwards compatibility (e.g. looking up old governance proposals). +/// It is replaced by providing a MsgRemoveAdministratorProposalRequest in a governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -659,6 +881,7 @@ pub struct SetAdministratorProposal { CosmwasmExt, )] #[proto_message(type_url = "/provenance.marker.v1.RemoveAdministratorProposal")] +#[deprecated] pub struct RemoveAdministratorProposal { #[prost(string, tag = "1")] pub title: ::prost::alloc::string::String, @@ -669,6 +892,10 @@ pub struct RemoveAdministratorProposal { #[prost(string, repeated, tag = "4")] pub removed_address: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +/// ChangeStatusProposal defines a governance proposal to administer a marker to change its status +/// Deprecated: This message is no longer usable. It is only still included for +/// backwards compatibility (e.g. looking up old governance proposals). +/// It is replaced by providing a MsgChangeStatusProposalRequest in a governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -681,6 +908,7 @@ pub struct RemoveAdministratorProposal { CosmwasmExt, )] #[proto_message(type_url = "/provenance.marker.v1.ChangeStatusProposal")] +#[deprecated] pub struct ChangeStatusProposal { #[prost(string, tag = "1")] pub title: ::prost::alloc::string::String, @@ -690,11 +918,15 @@ pub struct ChangeStatusProposal { pub denom: ::prost::alloc::string::String, #[prost(enumeration = "MarkerStatus", tag = "4")] #[serde( - serialize_with = "MarkerStatus::serialize", - deserialize_with = "MarkerStatus::deserialize" + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" )] pub new_status: i32, } +/// WithdrawEscrowProposal defines a governance proposal to withdraw escrow coins from a marker +/// Deprecated: This message is no longer usable. It is only still included for +/// backwards compatibility (e.g. looking up old governance proposals). +/// It is replaced by providing a MsgWithdrawEscrowProposalRequest in a governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -707,6 +939,7 @@ pub struct ChangeStatusProposal { CosmwasmExt, )] #[proto_message(type_url = "/provenance.marker.v1.WithdrawEscrowProposal")] +#[deprecated] pub struct WithdrawEscrowProposal { #[prost(string, tag = "1")] pub title: ::prost::alloc::string::String, @@ -719,6 +952,10 @@ pub struct WithdrawEscrowProposal { #[prost(string, tag = "5")] pub target_address: ::prost::alloc::string::String, } +/// SetDenomMetadataProposal defines a governance proposal to set the metadata for a denom +/// Deprecated: This message is no longer usable. It is only still included for +/// backwards compatibility (e.g. looking up old governance proposals). +/// It is replaced by providing a MsgSetDenomMetadataProposalRequest in a governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -731,6 +968,7 @@ pub struct WithdrawEscrowProposal { CosmwasmExt, )] #[proto_message(type_url = "/provenance.marker.v1.SetDenomMetadataProposal")] +#[deprecated] pub struct SetDenomMetadataProposal { #[prost(string, tag = "1")] pub title: ::prost::alloc::string::String, @@ -739,6 +977,7 @@ pub struct SetDenomMetadataProposal { #[prost(message, optional, tag = "3")] pub metadata: ::core::option::Option, } +/// QueryParamsRequest is the request type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -756,6 +995,7 @@ pub struct SetDenomMetadataProposal { response_type = QueryParamsResponse )] pub struct QueryParamsRequest {} +/// QueryParamsResponse is the response type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -769,9 +1009,62 @@ pub struct QueryParamsRequest {} )] #[proto_message(type_url = "/provenance.marker.v1.QueryParamsResponse")] pub struct QueryParamsResponse { + /// params defines the parameters of the module. #[prost(message, optional, tag = "1")] pub params: ::core::option::Option, } +/// QueryAllMarkersRequest is the request type for the Query/AllMarkers 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 = "/provenance.marker.v1.QueryAllMarkersRequest")] +#[proto_query( + path = "/provenance.marker.v1.Query/AllMarkers", + response_type = QueryAllMarkersResponse +)] +pub struct QueryAllMarkersRequest { + /// Optional status to filter request + #[prost(enumeration = "MarkerStatus", tag = "1")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub status: i32, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: + ::core::option::Option, +} +/// QueryAllMarkersResponse is the response type for the Query/AllMarkers 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 = "/provenance.marker.v1.QueryAllMarkersResponse")] +pub struct QueryAllMarkersResponse { + #[prost(message, repeated, tag = "1")] + pub markers: ::prost::alloc::vec::Vec, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: + ::core::option::Option, +} +/// QueryMarkerRequest is the request type for the Query/Marker method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -789,10 +1082,11 @@ pub struct QueryParamsResponse { response_type = QueryMarkerResponse )] pub struct QueryMarkerRequest { + /// the address or denom of the marker #[prost(string, tag = "1")] - #[serde(alias = "ID")] pub id: ::prost::alloc::string::String, } +/// QueryMarkerResponse is the response type for the Query/Marker method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -809,6 +1103,7 @@ pub struct QueryMarkerResponse { #[prost(message, optional, tag = "1")] pub marker: ::core::option::Option, } +/// QueryHoldingRequest is the request type for the Query/MarkerHolders method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -826,13 +1121,15 @@ pub struct QueryMarkerResponse { response_type = QueryHoldingResponse )] pub struct QueryHoldingRequest { + /// the address or denom of the marker #[prost(string, tag = "1")] - #[serde(alias = "ID")] pub id: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } +/// QueryHoldingResponse is the response type for the Query/MarkerHolders method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -848,10 +1145,12 @@ pub struct QueryHoldingRequest { pub struct QueryHoldingResponse { #[prost(message, repeated, tag = "1")] pub balances: ::prost::alloc::vec::Vec, + /// pagination defines an optional pagination for the request. #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } +/// QuerySupplyRequest is the request type for the Query/MarkerSupply method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -869,10 +1168,11 @@ pub struct QueryHoldingResponse { response_type = QuerySupplyResponse )] pub struct QuerySupplyRequest { + /// address or denom for the marker #[prost(string, tag = "1")] - #[serde(alias = "ID")] pub id: ::prost::alloc::string::String, } +/// QuerySupplyResponse is the response type for the Query/MarkerSupply method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -886,9 +1186,11 @@ pub struct QuerySupplyRequest { )] #[proto_message(type_url = "/provenance.marker.v1.QuerySupplyResponse")] pub struct QuerySupplyResponse { + /// amount is the supply of the marker. #[prost(message, optional, tag = "1")] pub amount: ::core::option::Option, } +/// QueryEscrowRequest is the request type for the Query/MarkerEscrow method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -906,10 +1208,11 @@ pub struct QuerySupplyResponse { response_type = QueryEscrowResponse )] pub struct QueryEscrowRequest { + /// address or denom for the marker #[prost(string, tag = "1")] - #[serde(alias = "ID")] pub id: ::prost::alloc::string::String, } +/// QueryEscrowResponse is the response type for the Query/MarkerEscrow method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -926,6 +1229,7 @@ pub struct QueryEscrowResponse { #[prost(message, repeated, tag = "1")] pub escrow: ::prost::alloc::vec::Vec, } +/// QueryAccessRequest is the request type for the Query/MarkerAccess method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -943,10 +1247,11 @@ pub struct QueryEscrowResponse { response_type = QueryAccessResponse )] pub struct QueryAccessRequest { + /// address or denom for the marker #[prost(string, tag = "1")] - #[serde(alias = "ID")] pub id: ::prost::alloc::string::String, } +/// QueryAccessResponse is the response type for the Query/MarkerAccess method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -963,6 +1268,7 @@ pub struct QueryAccessResponse { #[prost(message, repeated, tag = "1")] pub accounts: ::prost::alloc::vec::Vec, } +/// QueryDenomMetadataRequest is the request type for Query/DenomMetadata #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -983,6 +1289,7 @@ pub struct QueryDenomMetadataRequest { #[prost(string, tag = "1")] pub denom: ::prost::alloc::string::String, } +/// QueryDenomMetadataResponse is the response type for the Query/DenomMetadata #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -999,6 +1306,47 @@ pub struct QueryDenomMetadataResponse { #[prost(message, optional, tag = "1")] pub metadata: ::core::option::Option, } +/// QueryAccountDataRequest is the request type for the Query/AccountData +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.marker.v1.QueryAccountDataRequest")] +#[proto_query( + path = "/provenance.marker.v1.Query/AccountData", + response_type = QueryAccountDataResponse +)] +pub struct QueryAccountDataRequest { + /// The denomination to look up. + #[prost(string, tag = "1")] + pub denom: ::prost::alloc::string::String, +} +/// QueryAccountDataResponse is the response type for the Query/AccountData +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.marker.v1.QueryAccountDataResponse")] +pub struct QueryAccountDataResponse { + /// The accountdata for the requested denom. + #[prost(string, tag = "1")] + pub value: ::prost::alloc::string::String, +} +/// Balance defines an account address and balance pair used in queries for accounts holding a marker #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1012,35 +1360,99 @@ pub struct QueryDenomMetadataResponse { )] #[proto_message(type_url = "/provenance.marker.v1.Balance")] pub struct Balance { + /// address is the address of the balance holder. #[prost(string, tag = "1")] pub address: ::prost::alloc::string::String, + /// coins defines the different coins this balance holds. #[prost(message, repeated, tag = "2")] pub coins: ::prost::alloc::vec::Vec, } +/// QueryNetAssetValuesRequest is the request type for the Query/NetAssetValues 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 = "/provenance.marker.v1.QueryNetAssetValuesRequest")] +#[proto_query( + path = "/provenance.marker.v1.Query/NetAssetValues", + response_type = QueryNetAssetValuesResponse +)] +pub struct QueryNetAssetValuesRequest { + /// address or denom for the marker + #[prost(string, tag = "1")] + pub id: ::prost::alloc::string::String, +} +/// QueryNetAssetValuesRequest is the response type for the Query/NetAssetValues 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 = "/provenance.marker.v1.QueryNetAssetValuesResponse")] +pub struct QueryNetAssetValuesResponse { + /// net asset values for marker denom + #[prost(message, repeated, tag = "1")] + pub net_asset_values: ::prost::alloc::vec::Vec, +} +/// SIPrefix represents an International System of Units (SI) Prefix. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] #[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] pub enum SiPrefix { + /// 10^0 (none) None = 0, + /// 10^1 deka da Deka = 1, + /// 10^2 hecto h Hecto = 2, + /// 10^3 kilo k Kilo = 3, + /// 10^6 mega M Mega = 6, + /// 10^9 giga G Giga = 9, + /// 10^12 tera T Tera = 12, + /// 10^15 peta P Peta = 15, + /// 10^18 exa E Exa = 18, + /// 10^21 zetta Z Zetta = 21, + /// 10^24 yotta Y Yotta = 24, + /// 10^-1 deci d Deci = -1, + /// 10^-2 centi c Centi = -2, + /// 10^-3 milli m Milli = -3, + /// 10^-6 micro µ Micro = -6, + /// 10^-9 nano n Nano = -9, + /// 10^-12 pico p Pico = -12, + /// 10^-15 femto f Femto = -15, + /// 10^-18 atto a Atto = -18, + /// 10^-21 zepto z Zepto = -21, + /// 10^-24 yocto y Yocto = -24, } impl SiPrefix { @@ -1100,30 +1512,9 @@ impl SiPrefix { _ => None, } } - - pub fn serialize(v: &i32, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - let enum_value = Self::try_from(*v); - match enum_value { - Ok(v) => serializer.serialize_str(v.as_str_name()), - Err(e) => Err(serde::ser::Error::custom(e)), - } - } - - pub fn deserialize<'de, D>(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - use serde::de::Deserialize; - let s = String::deserialize(deserializer)?; - match Self::from_str_name(&s) { - Some(v) => Ok(v.into()), - None => Err(serde::de::Error::custom("unknown value")), - } - } } +/// MsgGrantAllowanceRequest validates permission to create a fee grant based on marker admin access. If +/// successful a feegrant is recorded where the marker account itself is the grantor #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1141,11 +1532,14 @@ pub struct MsgGrantAllowanceRequest { pub denom: ::prost::alloc::string::String, #[prost(string, tag = "2")] pub administrator: ::prost::alloc::string::String, + /// grantee is the address of the user being granted an allowance of another user's funds. #[prost(string, tag = "3")] pub grantee: ::prost::alloc::string::String, + /// allowance can be any of basic and filtered fee allowance (fee FeeGrant module). #[prost(message, optional, tag = "4")] pub allowance: ::core::option::Option, } +/// MsgGrantAllowanceResponse defines the Msg/GrantAllowanceResponse response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1159,6 +1553,8 @@ pub struct MsgGrantAllowanceRequest { )] #[proto_message(type_url = "/provenance.marker.v1.MsgGrantAllowanceResponse")] pub struct MsgGrantAllowanceResponse {} +/// MsgAddMarkerRequest defines the Msg/AddMarker request type. +/// If being provided as a governance proposal, set the from_address to the gov module's account address. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1180,11 +1576,15 @@ pub struct MsgAddMarkerRequest { pub from_address: ::prost::alloc::string::String, #[prost(enumeration = "MarkerStatus", tag = "5")] #[serde( - serialize_with = "MarkerStatus::serialize", - deserialize_with = "MarkerStatus::deserialize" + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" )] pub status: i32, #[prost(enumeration = "MarkerType", tag = "6")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] pub marker_type: i32, #[prost(message, repeated, tag = "7")] pub access_list: ::prost::alloc::vec::Vec, @@ -1216,6 +1616,7 @@ pub struct MsgAddMarkerRequest { )] pub usd_mills: u64, } +/// MsgAddMarkerResponse defines the Msg/AddMarker response type #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1229,6 +1630,7 @@ pub struct MsgAddMarkerRequest { )] #[proto_message(type_url = "/provenance.marker.v1.MsgAddMarkerResponse")] pub struct MsgAddMarkerResponse {} +/// MsgAddAccessRequest defines the Msg/AddAccess request type #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1249,6 +1651,7 @@ pub struct MsgAddAccessRequest { #[prost(message, repeated, tag = "3")] pub access: ::prost::alloc::vec::Vec, } +/// MsgAddAccessResponse defines the Msg/AddAccess response type #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1262,6 +1665,7 @@ pub struct MsgAddAccessRequest { )] #[proto_message(type_url = "/provenance.marker.v1.MsgAddAccessResponse")] pub struct MsgAddAccessResponse {} +/// MsgDeleteAccessRequest defines the Msg/DeleteAccess request type #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1282,6 +1686,7 @@ pub struct MsgDeleteAccessRequest { #[prost(string, tag = "3")] pub removed_address: ::prost::alloc::string::String, } +/// MsgDeleteAccessResponse defines the Msg/DeleteAccess response type #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1295,6 +1700,7 @@ pub struct MsgDeleteAccessRequest { )] #[proto_message(type_url = "/provenance.marker.v1.MsgDeleteAccessResponse")] pub struct MsgDeleteAccessResponse {} +/// MsgFinalizeRequest defines the Msg/Finalize request type #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1313,6 +1719,7 @@ pub struct MsgFinalizeRequest { #[prost(string, tag = "2")] pub administrator: ::prost::alloc::string::String, } +/// MsgFinalizeResponse defines the Msg/Finalize response type #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1326,6 +1733,7 @@ pub struct MsgFinalizeRequest { )] #[proto_message(type_url = "/provenance.marker.v1.MsgFinalizeResponse")] pub struct MsgFinalizeResponse {} +/// MsgActivateRequest defines the Msg/Activate request type #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1344,6 +1752,7 @@ pub struct MsgActivateRequest { #[prost(string, tag = "2")] pub administrator: ::prost::alloc::string::String, } +/// MsgActivateResponse defines the Msg/Activate response type #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1357,6 +1766,7 @@ pub struct MsgActivateRequest { )] #[proto_message(type_url = "/provenance.marker.v1.MsgActivateResponse")] pub struct MsgActivateResponse {} +/// MsgCancelRequest defines the Msg/Cancel request type #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1375,6 +1785,7 @@ pub struct MsgCancelRequest { #[prost(string, tag = "2")] pub administrator: ::prost::alloc::string::String, } +/// MsgCancelResponse defines the Msg/Cancel response type #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1388,6 +1799,7 @@ pub struct MsgCancelRequest { )] #[proto_message(type_url = "/provenance.marker.v1.MsgCancelResponse")] pub struct MsgCancelResponse {} +/// MsgDeleteRequest defines the Msg/Delete request type #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1406,6 +1818,7 @@ pub struct MsgDeleteRequest { #[prost(string, tag = "2")] pub administrator: ::prost::alloc::string::String, } +/// MsgDeleteResponse defines the Msg/Delete response type #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1419,6 +1832,7 @@ pub struct MsgDeleteRequest { )] #[proto_message(type_url = "/provenance.marker.v1.MsgDeleteResponse")] pub struct MsgDeleteResponse {} +/// MsgMintRequest defines the Msg/Mint request type #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1437,6 +1851,7 @@ pub struct MsgMintRequest { #[prost(string, tag = "2")] pub administrator: ::prost::alloc::string::String, } +/// MsgMintResponse defines the Msg/Mint response type #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1450,6 +1865,7 @@ pub struct MsgMintRequest { )] #[proto_message(type_url = "/provenance.marker.v1.MsgMintResponse")] pub struct MsgMintResponse {} +/// MsgBurnRequest defines the Msg/Burn request type #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1468,6 +1884,7 @@ pub struct MsgBurnRequest { #[prost(string, tag = "2")] pub administrator: ::prost::alloc::string::String, } +/// MsgBurnResponse defines the Msg/Burn response type #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1481,6 +1898,7 @@ pub struct MsgBurnRequest { )] #[proto_message(type_url = "/provenance.marker.v1.MsgBurnResponse")] pub struct MsgBurnResponse {} +/// MsgWithdrawRequest defines the Msg/Withdraw request type #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1503,6 +1921,7 @@ pub struct MsgWithdrawRequest { #[prost(message, repeated, tag = "4")] pub amount: ::prost::alloc::vec::Vec, } +/// MsgWithdrawResponse defines the Msg/Withdraw response type #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1516,6 +1935,7 @@ pub struct MsgWithdrawRequest { )] #[proto_message(type_url = "/provenance.marker.v1.MsgWithdrawResponse")] pub struct MsgWithdrawResponse {} +/// MsgTransferRequest defines the Msg/Transfer request type #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1538,6 +1958,7 @@ pub struct MsgTransferRequest { #[prost(string, tag = "5")] pub to_address: ::prost::alloc::string::String, } +/// MsgTransferResponse defines the Msg/Transfer response type #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1551,6 +1972,7 @@ pub struct MsgTransferRequest { )] #[proto_message(type_url = "/provenance.marker.v1.MsgTransferResponse")] pub struct MsgTransferResponse {} +/// MsgIbcTransferRequest defines the Msg/IbcTransfer request type for markers. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1570,6 +1992,7 @@ pub struct MsgIbcTransferRequest { #[prost(string, tag = "2")] pub administrator: ::prost::alloc::string::String, } +/// MsgIbcTransferResponse defines the Msg/IbcTransfer response type #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1583,6 +2006,7 @@ pub struct MsgIbcTransferRequest { )] #[proto_message(type_url = "/provenance.marker.v1.MsgIbcTransferResponse")] pub struct MsgIbcTransferResponse {} +/// MsgSetDenomMetadataRequest defines the Msg/SetDenomMetadata request type #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1601,6 +2025,7 @@ pub struct MsgSetDenomMetadataRequest { #[prost(string, tag = "2")] pub administrator: ::prost::alloc::string::String, } +/// MsgSetDenomMetadataResponse defines the Msg/SetDenomMetadata response type #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1614,6 +2039,7 @@ pub struct MsgSetDenomMetadataRequest { )] #[proto_message(type_url = "/provenance.marker.v1.MsgSetDenomMetadataResponse")] pub struct MsgSetDenomMetadataResponse {} +/// MsgAddFinalizeActivateMarkerRequest defines the Msg/AddFinalizeActivateMarker request type #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1635,8 +2061,8 @@ pub struct MsgAddFinalizeActivateMarkerRequest { pub from_address: ::prost::alloc::string::String, #[prost(enumeration = "MarkerType", tag = "5")] #[serde( - serialize_with = "MarkerType::serialize", - deserialize_with = "MarkerType::deserialize" + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" )] pub marker_type: i32, #[prost(message, repeated, tag = "6")] @@ -1669,6 +2095,7 @@ pub struct MsgAddFinalizeActivateMarkerRequest { )] pub usd_mills: u64, } +/// MsgAddFinalizeActivateMarkerResponse defines the Msg/AddFinalizeActivateMarker response type #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1682,6 +2109,8 @@ pub struct MsgAddFinalizeActivateMarkerRequest { )] #[proto_message(type_url = "/provenance.marker.v1.MsgAddFinalizeActivateMarkerResponse")] pub struct MsgAddFinalizeActivateMarkerResponse {} +/// MsgSupplyIncreaseProposalRequest defines a governance proposal to administer a marker and increase total supply of +/// the marker through minting coin and placing it within the marker or assigning it directly to an account #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1697,11 +2126,14 @@ pub struct MsgAddFinalizeActivateMarkerResponse {} pub struct MsgSupplyIncreaseProposalRequest { #[prost(message, optional, tag = "1")] pub amount: ::core::option::Option, + /// an optional target address for the minted coin from this request #[prost(string, tag = "2")] pub target_address: ::prost::alloc::string::String, + /// signer of the proposal #[prost(string, tag = "3")] pub authority: ::prost::alloc::string::String, } +/// MsgSupplyIncreaseProposalResponse defines the Msg/SupplyIncreaseProposal response type #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1715,16 +2147,476 @@ pub struct MsgSupplyIncreaseProposalRequest { )] #[proto_message(type_url = "/provenance.marker.v1.MsgSupplyIncreaseProposalResponse")] pub struct MsgSupplyIncreaseProposalResponse {} -pub struct MarkerQuerier<'a, Q: cosmwasm_std::CustomQuery> { - querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, -} -impl<'a, Q: cosmwasm_std::CustomQuery> MarkerQuerier<'a, Q> { +/// MsgSupplyDecreaseProposalRequest defines a governance proposal to decrease total supply of the marker +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.marker.v1.MsgSupplyDecreaseProposalRequest")] +pub struct MsgSupplyDecreaseProposalRequest { + #[prost(message, optional, tag = "1")] + pub amount: ::core::option::Option, + /// signer of the proposal + #[prost(string, tag = "2")] + pub authority: ::prost::alloc::string::String, +} +/// MsgSupplyIncreaseProposalResponse defines the Msg/SupplyDecreaseProposal 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 = "/provenance.marker.v1.MsgSupplyDecreaseProposalResponse")] +pub struct MsgSupplyDecreaseProposalResponse {} +/// MsgUpdateRequiredAttributesRequest defines a msg to update/add/remove required attributes from a resticted marker +/// signer must have transfer authority to change attributes, to update attribute add current to remove list and new to +/// add list +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.marker.v1.MsgUpdateRequiredAttributesRequest")] +pub struct MsgUpdateRequiredAttributesRequest { + /// The denomination of the marker to update. + #[prost(string, tag = "1")] + pub denom: ::prost::alloc::string::String, + /// List of required attributes to remove from marker. + #[prost(string, repeated, tag = "2")] + pub remove_required_attributes: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// List of required attributes to add to marker. + #[prost(string, repeated, tag = "3")] + pub add_required_attributes: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// The signer of the message. Must have transfer authority to marker or be governance module account address. + #[prost(string, tag = "4")] + pub transfer_authority: ::prost::alloc::string::String, +} +/// MsgUpdateRequiredAttributesResponse defines the Msg/UpdateRequiredAttributes 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 = "/provenance.marker.v1.MsgUpdateRequiredAttributesResponse")] +pub struct MsgUpdateRequiredAttributesResponse {} +/// MsgUpdateForcedTransferRequest defines a msg to update the allow_forced_transfer field of a marker. +/// It is only usable via governance proposal. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.marker.v1.MsgUpdateForcedTransferRequest")] +pub struct MsgUpdateForcedTransferRequest { + /// The denomination of the marker to update. + #[prost(string, tag = "1")] + pub denom: ::prost::alloc::string::String, + /// Whether an admin can transfer restricted coins from a 3rd-party account without their signature. + #[prost(bool, tag = "2")] + pub allow_forced_transfer: bool, + /// The signer of this message. Must be the governance module account address. + #[prost(string, tag = "3")] + pub authority: ::prost::alloc::string::String, +} +/// MsgUpdateForcedTransferResponse defines the Msg/UpdateForcedTransfer 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 = "/provenance.marker.v1.MsgUpdateForcedTransferResponse")] +pub struct MsgUpdateForcedTransferResponse {} +/// MsgSetAccountDataRequest defines a msg to set/update/delete the account data for a marker. +/// Signer must have deposit authority or be a gov proposal. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.marker.v1.MsgSetAccountDataRequest")] +pub struct MsgSetAccountDataRequest { + /// The denomination of the marker to update. + #[prost(string, tag = "1")] + pub denom: ::prost::alloc::string::String, + /// The desired accountdata value. + #[prost(string, tag = "2")] + pub value: ::prost::alloc::string::String, + /// The signer of this message. Must have deposit authority or be the governance module account address. + #[prost(string, tag = "3")] + pub signer: ::prost::alloc::string::String, +} +/// MsgSetAccountDataResponse defines the Msg/SetAccountData 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 = "/provenance.marker.v1.MsgSetAccountDataResponse")] +pub struct MsgSetAccountDataResponse {} +/// MsgUpdateSendDenyListRequest defines a msg to add/remove addresses to send deny list for a resticted marker +/// signer must have transfer authority +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.marker.v1.MsgUpdateSendDenyListRequest")] +pub struct MsgUpdateSendDenyListRequest { + /// The denomination of the marker to update. + #[prost(string, tag = "1")] + pub denom: ::prost::alloc::string::String, + /// List of bech32 addresses to remove from the deny send list. + #[prost(string, repeated, tag = "2")] + pub remove_denied_addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// List of bech32 addresses to add to the deny send list. + #[prost(string, repeated, tag = "3")] + pub add_denied_addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// The signer of the message. Must have admin authority to marker or be governance module account address. + #[prost(string, tag = "4")] + pub authority: ::prost::alloc::string::String, +} +/// MsgUpdateSendDenyListResponse defines the Msg/UpdateSendDenyList 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 = "/provenance.marker.v1.MsgUpdateSendDenyListResponse")] +pub struct MsgUpdateSendDenyListResponse {} +/// MsgAddNetAssetValuesRequest defines the Msg/AddNetAssetValues request 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 = "/provenance.marker.v1.MsgAddNetAssetValuesRequest")] +pub struct MsgAddNetAssetValuesRequest { + #[prost(string, tag = "1")] + pub denom: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub administrator: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "3")] + pub net_asset_values: ::prost::alloc::vec::Vec, +} +/// MsgAddNetAssetValuesResponse defines the Msg/AddNetAssetValue 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 = "/provenance.marker.v1.MsgAddNetAssetValuesResponse")] +pub struct MsgAddNetAssetValuesResponse {} +/// MsgSetAdministratorProposalRequest defines the Msg/SetAdministratorProposal request 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 = "/provenance.marker.v1.MsgSetAdministratorProposalRequest")] +pub struct MsgSetAdministratorProposalRequest { + #[prost(string, tag = "1")] + pub denom: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] + pub access: ::prost::alloc::vec::Vec, + /// The signer of the message. Must have admin authority to marker or be governance module account address. + #[prost(string, tag = "3")] + pub authority: ::prost::alloc::string::String, +} +/// MsgSetAdministratorProposalResponse defines the Msg/SetAdministratorProposal 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 = "/provenance.marker.v1.MsgSetAdministratorProposalResponse")] +pub struct MsgSetAdministratorProposalResponse {} +/// MsgRemoveAdministratorProposalRequest defines the Msg/RemoveAdministratorProposal request 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 = "/provenance.marker.v1.MsgRemoveAdministratorProposalRequest")] +pub struct MsgRemoveAdministratorProposalRequest { + #[prost(string, tag = "1")] + pub denom: ::prost::alloc::string::String, + #[prost(string, repeated, tag = "2")] + pub removed_address: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// The signer of the message. Must have admin authority to marker or be governance module account address. + #[prost(string, tag = "3")] + pub authority: ::prost::alloc::string::String, +} +/// MsgRemoveAdministratorProposalResponse defines the Msg/RemoveAdministratorProposal 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 = "/provenance.marker.v1.MsgRemoveAdministratorProposalResponse")] +pub struct MsgRemoveAdministratorProposalResponse {} +/// MsgChangeStatusProposalRequest defines the Msg/ChangeStatusProposal request 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 = "/provenance.marker.v1.MsgChangeStatusProposalRequest")] +pub struct MsgChangeStatusProposalRequest { + #[prost(string, tag = "1")] + pub denom: ::prost::alloc::string::String, + #[prost(enumeration = "MarkerStatus", tag = "2")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub new_status: i32, + /// The signer of the message. Must have admin authority to marker or be governance module account address. + #[prost(string, tag = "3")] + pub authority: ::prost::alloc::string::String, +} +/// MsgChangeStatusProposalResponse defines the Msg/ChangeStatusProposal 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 = "/provenance.marker.v1.MsgChangeStatusProposalResponse")] +pub struct MsgChangeStatusProposalResponse {} +/// MsgWithdrawEscrowProposalRequest defines the Msg/WithdrawEscrowProposal request 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 = "/provenance.marker.v1.MsgWithdrawEscrowProposalRequest")] +pub struct MsgWithdrawEscrowProposalRequest { + #[prost(string, tag = "1")] + pub denom: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] + pub amount: ::prost::alloc::vec::Vec, + #[prost(string, tag = "3")] + pub target_address: ::prost::alloc::string::String, + /// The signer of the message. Must have admin authority to marker or be governance module account address. + #[prost(string, tag = "4")] + pub authority: ::prost::alloc::string::String, +} +/// MsgWithdrawEscrowProposalResponse defines the Msg/WithdrawEscrowProposal 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 = "/provenance.marker.v1.MsgWithdrawEscrowProposalResponse")] +pub struct MsgWithdrawEscrowProposalResponse {} +/// MsgSetDenomMetadataProposalRequest defines the Msg/SetDenomMetadataProposal request 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 = "/provenance.marker.v1.MsgSetDenomMetadataProposalRequest")] +pub struct MsgSetDenomMetadataProposalRequest { + #[prost(message, optional, tag = "1")] + pub metadata: ::core::option::Option, + /// The signer of the message. Must have admin authority to marker or be governance module account address. + #[prost(string, tag = "2")] + pub authority: ::prost::alloc::string::String, +} +/// MsgSetDenomMetadataProposalResponse defines the Msg/SetDenomMetadataProposal 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 = "/provenance.marker.v1.MsgSetDenomMetadataProposalResponse")] +pub struct MsgSetDenomMetadataProposalResponse {} +/// MsgUpdateParamsRequest is a request message for the UpdateParams endpoint. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.marker.v1.MsgUpdateParamsRequest")] +pub struct MsgUpdateParamsRequest { + /// authority should be the governance module account address. + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// params are the new param values to set. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +/// MsgUpdateParamsResponse is a response message for the UpdateParams endpoint. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.marker.v1.MsgUpdateParamsResponse")] +pub struct MsgUpdateParamsResponse {} +pub struct MarkerQuerier<'a, Q: cosmwasm_std::CustomQuery> { + querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, +} +impl<'a, Q: cosmwasm_std::CustomQuery> MarkerQuerier<'a, Q> { pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self { Self { querier } } pub fn params(&self) -> Result { QueryParamsRequest {}.query(self.querier) } + pub fn all_markers( + &self, + status: i32, + pagination: ::core::option::Option< + super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + ) -> Result { + QueryAllMarkersRequest { status, pagination }.query(self.querier) + } pub fn marker( &self, id: ::prost::alloc::string::String, @@ -1764,4 +2656,16 @@ impl<'a, Q: cosmwasm_std::CustomQuery> MarkerQuerier<'a, Q> { ) -> Result { QueryDenomMetadataRequest { denom }.query(self.querier) } + pub fn account_data( + &self, + denom: ::prost::alloc::string::String, + ) -> Result { + QueryAccountDataRequest { denom }.query(self.querier) + } + pub fn net_asset_values( + &self, + id: ::prost::alloc::string::String, + ) -> Result { + QueryNetAssetValuesRequest { id }.query(self.querier) + } } diff --git a/packages/provwasm-std/src/types/provenance/metadata/v1.rs b/packages/provwasm-std/src/types/provenance/metadata/v1/mod.rs similarity index 54% rename from packages/provwasm-std/src/types/provenance/metadata/v1.rs rename to packages/provwasm-std/src/types/provenance/metadata/v1/mod.rs index 62efe27f..754e9d5b 100644 --- a/packages/provwasm-std/src/types/provenance/metadata/v1.rs +++ b/packages/provwasm-std/src/types/provenance/metadata/v1/mod.rs @@ -1,4 +1,6 @@ +pub mod p8e; use provwasm_proc_macro::CosmwasmExt; +/// EventTxCompleted is an event message indicating that a TX has completed. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -12,13 +14,17 @@ use provwasm_proc_macro::CosmwasmExt; )] #[proto_message(type_url = "/provenance.metadata.v1.EventTxCompleted")] pub struct EventTxCompleted { + /// module is the module the TX belongs to. #[prost(string, tag = "1")] pub module: ::prost::alloc::string::String, + /// endpoint is the rpc endpoint that was just completed. #[prost(string, tag = "2")] pub endpoint: ::prost::alloc::string::String, + /// signers are the bech32 address strings of the signers of this TX. #[prost(string, repeated, tag = "3")] pub signers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +/// EventScopeCreated is an event message indicating a scope has been created. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -32,9 +38,11 @@ pub struct EventTxCompleted { )] #[proto_message(type_url = "/provenance.metadata.v1.EventScopeCreated")] pub struct EventScopeCreated { + /// scope_addr is the bech32 address string of the scope id that was created. #[prost(string, tag = "1")] pub scope_addr: ::prost::alloc::string::String, } +/// EventScopeUpdated is an event message indicating a scope has been updated. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -48,9 +56,11 @@ pub struct EventScopeCreated { )] #[proto_message(type_url = "/provenance.metadata.v1.EventScopeUpdated")] pub struct EventScopeUpdated { + /// scope_addr is the bech32 address string of the scope id that was updated. #[prost(string, tag = "1")] pub scope_addr: ::prost::alloc::string::String, } +/// EventScopeDeleted is an event message indicating a scope has been deleted. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -64,9 +74,11 @@ pub struct EventScopeUpdated { )] #[proto_message(type_url = "/provenance.metadata.v1.EventScopeDeleted")] pub struct EventScopeDeleted { + /// scope_addr is the bech32 address string of the scope id that was deleted. #[prost(string, tag = "1")] pub scope_addr: ::prost::alloc::string::String, } +/// EventSessionCreated is an event message indicating a session has been created. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -80,11 +92,14 @@ pub struct EventScopeDeleted { )] #[proto_message(type_url = "/provenance.metadata.v1.EventSessionCreated")] pub struct EventSessionCreated { + /// session_addr is the bech32 address string of the session id that was created. #[prost(string, tag = "1")] pub session_addr: ::prost::alloc::string::String, + /// scope_addr is the bech32 address string of the scope id this session belongs to. #[prost(string, tag = "2")] pub scope_addr: ::prost::alloc::string::String, } +/// EventSessionUpdated is an event message indicating a session has been updated. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -98,11 +113,14 @@ pub struct EventSessionCreated { )] #[proto_message(type_url = "/provenance.metadata.v1.EventSessionUpdated")] pub struct EventSessionUpdated { + /// session_addr is the bech32 address string of the session id that was updated. #[prost(string, tag = "1")] pub session_addr: ::prost::alloc::string::String, + /// scope_addr is the bech32 address string of the scope id this session belongs to. #[prost(string, tag = "2")] pub scope_addr: ::prost::alloc::string::String, } +/// EventSessionDeleted is an event message indicating a session has been deleted. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -116,11 +134,14 @@ pub struct EventSessionUpdated { )] #[proto_message(type_url = "/provenance.metadata.v1.EventSessionDeleted")] pub struct EventSessionDeleted { + /// session_addr is the bech32 address string of the session id that was deleted. #[prost(string, tag = "1")] pub session_addr: ::prost::alloc::string::String, + /// scope_addr is the bech32 address string of the scope id this session belongs to. #[prost(string, tag = "2")] pub scope_addr: ::prost::alloc::string::String, } +/// EventRecordCreated is an event message indicating a record has been created. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -134,13 +155,17 @@ pub struct EventSessionDeleted { )] #[proto_message(type_url = "/provenance.metadata.v1.EventRecordCreated")] pub struct EventRecordCreated { + /// record_addr is the bech32 address string of the record id that was created. #[prost(string, tag = "1")] pub record_addr: ::prost::alloc::string::String, + /// session_addr is the bech32 address string of the session id this record belongs to. #[prost(string, tag = "2")] pub session_addr: ::prost::alloc::string::String, + /// scope_addr is the bech32 address string of the scope id this record belongs to. #[prost(string, tag = "3")] pub scope_addr: ::prost::alloc::string::String, } +/// EventRecordUpdated is an event message indicating a record has been updated. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -154,13 +179,17 @@ pub struct EventRecordCreated { )] #[proto_message(type_url = "/provenance.metadata.v1.EventRecordUpdated")] pub struct EventRecordUpdated { + /// record_addr is the bech32 address string of the record id that was updated. #[prost(string, tag = "1")] pub record_addr: ::prost::alloc::string::String, + /// session_addr is the bech32 address string of the session id this record belongs to. #[prost(string, tag = "2")] pub session_addr: ::prost::alloc::string::String, + /// scope_addr is the bech32 address string of the scope id this record belongs to. #[prost(string, tag = "3")] pub scope_addr: ::prost::alloc::string::String, } +/// EventRecordDeleted is an event message indicating a record has been deleted. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -174,11 +203,14 @@ pub struct EventRecordUpdated { )] #[proto_message(type_url = "/provenance.metadata.v1.EventRecordDeleted")] pub struct EventRecordDeleted { + /// record is the bech32 address string of the record id that was deleted. #[prost(string, tag = "1")] pub record_addr: ::prost::alloc::string::String, + /// scope_addr is the bech32 address string of the scope id this record belonged to. #[prost(string, tag = "3")] pub scope_addr: ::prost::alloc::string::String, } +/// EventScopeSpecificationCreated is an event message indicating a scope specification has been created. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -192,9 +224,12 @@ pub struct EventRecordDeleted { )] #[proto_message(type_url = "/provenance.metadata.v1.EventScopeSpecificationCreated")] pub struct EventScopeSpecificationCreated { + /// scope_specification_addr is the bech32 address string of the specification id of the scope specification that was + /// created. #[prost(string, tag = "1")] pub scope_specification_addr: ::prost::alloc::string::String, } +/// EventScopeSpecificationUpdated is an event message indicating a scope specification has been updated. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -208,9 +243,12 @@ pub struct EventScopeSpecificationCreated { )] #[proto_message(type_url = "/provenance.metadata.v1.EventScopeSpecificationUpdated")] pub struct EventScopeSpecificationUpdated { + /// scope_specification_addr is the bech32 address string of the specification id of the scope specification that was + /// updated. #[prost(string, tag = "1")] pub scope_specification_addr: ::prost::alloc::string::String, } +/// EventScopeSpecificationDeleted is an event message indicating a scope specification has been deleted. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -224,9 +262,12 @@ pub struct EventScopeSpecificationUpdated { )] #[proto_message(type_url = "/provenance.metadata.v1.EventScopeSpecificationDeleted")] pub struct EventScopeSpecificationDeleted { + /// scope_specification_addr is the bech32 address string of the specification id of the scope specification that was + /// deleted. #[prost(string, tag = "1")] pub scope_specification_addr: ::prost::alloc::string::String, } +/// EventContractSpecificationCreated is an event message indicating a contract specification has been created. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -240,9 +281,12 @@ pub struct EventScopeSpecificationDeleted { )] #[proto_message(type_url = "/provenance.metadata.v1.EventContractSpecificationCreated")] pub struct EventContractSpecificationCreated { + /// contract_specification_addr is the bech32 address string of the specification id of the contract specification that + /// was created. #[prost(string, tag = "1")] pub contract_specification_addr: ::prost::alloc::string::String, } +/// EventContractSpecificationUpdated is an event message indicating a contract specification has been updated. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -256,9 +300,12 @@ pub struct EventContractSpecificationCreated { )] #[proto_message(type_url = "/provenance.metadata.v1.EventContractSpecificationUpdated")] pub struct EventContractSpecificationUpdated { + /// contract_specification_addr is the bech32 address string of the specification id of the contract specification that + /// was updated. #[prost(string, tag = "1")] pub contract_specification_addr: ::prost::alloc::string::String, } +/// EventContractSpecificationDeleted is an event message indicating a contract specification has been deleted. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -272,9 +319,12 @@ pub struct EventContractSpecificationUpdated { )] #[proto_message(type_url = "/provenance.metadata.v1.EventContractSpecificationDeleted")] pub struct EventContractSpecificationDeleted { + /// contract_specification_addr is the bech32 address string of the specification id of the contract specification that + /// was deleted. #[prost(string, tag = "1")] pub contract_specification_addr: ::prost::alloc::string::String, } +/// EventRecordSpecificationCreated is an event message indicating a record specification has been created. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -288,11 +338,16 @@ pub struct EventContractSpecificationDeleted { )] #[proto_message(type_url = "/provenance.metadata.v1.EventRecordSpecificationCreated")] pub struct EventRecordSpecificationCreated { + /// record_specification_addr is the bech32 address string of the specification id of the record specification that was + /// created. #[prost(string, tag = "1")] pub record_specification_addr: ::prost::alloc::string::String, + /// contract_specification_addr is the bech32 address string of the contract specification id this record specification + /// belongs to. #[prost(string, tag = "2")] pub contract_specification_addr: ::prost::alloc::string::String, } +/// EventRecordSpecificationUpdated is an event message indicating a record specification has been updated. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -306,11 +361,16 @@ pub struct EventRecordSpecificationCreated { )] #[proto_message(type_url = "/provenance.metadata.v1.EventRecordSpecificationUpdated")] pub struct EventRecordSpecificationUpdated { + /// record_specification_addr is the bech32 address string of the specification id of the record specification that was + /// updated. #[prost(string, tag = "1")] pub record_specification_addr: ::prost::alloc::string::String, + /// contract_specification_addr is the bech32 address string of the contract specification id this record specification + /// belongs to. #[prost(string, tag = "2")] pub contract_specification_addr: ::prost::alloc::string::String, } +/// EventRecordSpecificationDeleted is an event message indicating a record specification has been deleted. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -324,11 +384,16 @@ pub struct EventRecordSpecificationUpdated { )] #[proto_message(type_url = "/provenance.metadata.v1.EventRecordSpecificationDeleted")] pub struct EventRecordSpecificationDeleted { + /// record_specification_addr is the bech32 address string of the specification id of the record specification that was + /// deleted. #[prost(string, tag = "1")] pub record_specification_addr: ::prost::alloc::string::String, + /// contract_specification_addr is the bech32 address string of the contract specification id this record specification + /// belongs to. #[prost(string, tag = "2")] pub contract_specification_addr: ::prost::alloc::string::String, } +/// EventOSLocatorCreated is an event message indicating an object store locator has been created. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -342,9 +407,11 @@ pub struct EventRecordSpecificationDeleted { )] #[proto_message(type_url = "/provenance.metadata.v1.EventOSLocatorCreated")] pub struct EventOsLocatorCreated { + /// owner is the owner in the object store locator that was created. #[prost(string, tag = "1")] pub owner: ::prost::alloc::string::String, } +/// EventOSLocatorUpdated is an event message indicating an object store locator has been updated. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -358,9 +425,11 @@ pub struct EventOsLocatorCreated { )] #[proto_message(type_url = "/provenance.metadata.v1.EventOSLocatorUpdated")] pub struct EventOsLocatorUpdated { + /// owner is the owner in the object store locator that was updated. #[prost(string, tag = "1")] pub owner: ::prost::alloc::string::String, } +/// EventOSLocatorDeleted is an event message indicating an object store locator has been deleted. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -374,9 +443,32 @@ pub struct EventOsLocatorUpdated { )] #[proto_message(type_url = "/provenance.metadata.v1.EventOSLocatorDeleted")] pub struct EventOsLocatorDeleted { + /// owner is the owner in the object store locator that was deleted. #[prost(string, tag = "1")] pub owner: ::prost::alloc::string::String, } +/// EventSetNetAssetValue event emitted when Net Asset Value for a scope is update or added +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.metadata.v1.EventSetNetAssetValue")] +pub struct EventSetNetAssetValue { + #[prost(string, tag = "1")] + pub scope_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub price: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub source: ::prost::alloc::string::String, +} +/// Params defines the set of params for the metadata module. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -390,6 +482,7 @@ pub struct EventOsLocatorDeleted { )] #[proto_message(type_url = "/provenance.metadata.v1.Params")] pub struct Params {} +/// ScopeIdInfo contains various info regarding a scope id. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -403,32 +496,35 @@ pub struct Params {} )] #[proto_message(type_url = "/provenance.metadata.v1.ScopeIdInfo")] pub struct ScopeIdInfo { + /// scope_id is the raw bytes of the scope address. #[prost(bytes = "vec", tag = "1")] - #[serde(alias = "scopeID")] #[serde( serialize_with = "crate::serde::as_str_bytes::serialize", deserialize_with = "crate::serde::as_str_bytes::deserialize" )] pub scope_id: ::prost::alloc::vec::Vec, + /// scope_id_prefix is the prefix portion of the scope_id. #[prost(bytes = "vec", tag = "2")] - #[serde(alias = "scopeID_prefix")] #[serde( serialize_with = "crate::serde::as_str_bytes::serialize", deserialize_with = "crate::serde::as_str_bytes::deserialize" )] pub scope_id_prefix: ::prost::alloc::vec::Vec, + /// scope_id_scope_uuid is the scope_uuid portion of the scope_id. #[prost(bytes = "vec", tag = "3")] - #[serde(alias = "scopeID_scope_uuid")] #[serde( serialize_with = "crate::serde::as_str_bytes::serialize", deserialize_with = "crate::serde::as_str_bytes::deserialize" )] pub scope_id_scope_uuid: ::prost::alloc::vec::Vec, + /// scope_addr is the bech32 string version of the scope_id. #[prost(string, tag = "4")] pub scope_addr: ::prost::alloc::string::String, + /// scope_uuid is the uuid hex string of the scope_id_scope_uuid. #[prost(string, tag = "5")] pub scope_uuid: ::prost::alloc::string::String, } +/// SessionIdInfo contains various info regarding a session id. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -442,42 +538,45 @@ pub struct ScopeIdInfo { )] #[proto_message(type_url = "/provenance.metadata.v1.SessionIdInfo")] pub struct SessionIdInfo { + /// session_id is the raw bytes of the session address. #[prost(bytes = "vec", tag = "1")] - #[serde(alias = "sessionID")] #[serde( serialize_with = "crate::serde::as_str_bytes::serialize", deserialize_with = "crate::serde::as_str_bytes::deserialize" )] pub session_id: ::prost::alloc::vec::Vec, + /// session_id_prefix is the prefix portion of the session_id. #[prost(bytes = "vec", tag = "2")] - #[serde(alias = "sessionID_prefix")] #[serde( serialize_with = "crate::serde::as_str_bytes::serialize", deserialize_with = "crate::serde::as_str_bytes::deserialize" )] pub session_id_prefix: ::prost::alloc::vec::Vec, + /// session_id_scope_uuid is the scope_uuid portion of the session_id. #[prost(bytes = "vec", tag = "3")] - #[serde(alias = "sessionID_scope_uuid")] #[serde( serialize_with = "crate::serde::as_str_bytes::serialize", deserialize_with = "crate::serde::as_str_bytes::deserialize" )] pub session_id_scope_uuid: ::prost::alloc::vec::Vec, + /// session_id_session_uuid is the session_uuid portion of the session_id. #[prost(bytes = "vec", tag = "4")] - #[serde(alias = "sessionID_session_uuid")] #[serde( - serialize_with = "crate::serde::as_str_bytes::serialize", - deserialize_with = "crate::serde::as_str_bytes::deserialize" + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" )] pub session_id_session_uuid: ::prost::alloc::vec::Vec, + /// session_addr is the bech32 string version of the session_id. #[prost(string, tag = "5")] pub session_addr: ::prost::alloc::string::String, + /// session_uuid is the uuid hex string of the session_id_session_uuid. #[prost(string, tag = "6")] pub session_uuid: ::prost::alloc::string::String, + /// scope_id_info is information about the scope id referenced in the session_id. #[prost(message, optional, tag = "7")] - #[serde(alias = "scopeID_info")] pub scope_id_info: ::core::option::Option, } +/// RecordIdInfo contains various info regarding a record id. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -491,40 +590,42 @@ pub struct SessionIdInfo { )] #[proto_message(type_url = "/provenance.metadata.v1.RecordIdInfo")] pub struct RecordIdInfo { + /// record_id is the raw bytes of the record address. #[prost(bytes = "vec", tag = "1")] - #[serde(alias = "recordID")] #[serde( serialize_with = "crate::serde::as_str_bytes::serialize", deserialize_with = "crate::serde::as_str_bytes::deserialize" )] pub record_id: ::prost::alloc::vec::Vec, + /// record_id_prefix is the prefix portion of the record_id. #[prost(bytes = "vec", tag = "2")] - #[serde(alias = "recordID_prefix")] #[serde( serialize_with = "crate::serde::as_str_bytes::serialize", deserialize_with = "crate::serde::as_str_bytes::deserialize" )] pub record_id_prefix: ::prost::alloc::vec::Vec, + /// record_id_scope_uuid is the scope_uuid portion of the record_id. #[prost(bytes = "vec", tag = "3")] - #[serde(alias = "recordID_scope_uuid")] #[serde( serialize_with = "crate::serde::as_str_bytes::serialize", deserialize_with = "crate::serde::as_str_bytes::deserialize" )] pub record_id_scope_uuid: ::prost::alloc::vec::Vec, + /// record_id_hashed_name is the hashed name portion of the record_id. #[prost(bytes = "vec", tag = "4")] - #[serde(alias = "recordID_hashed_name")] #[serde( serialize_with = "crate::serde::as_str_bytes::serialize", deserialize_with = "crate::serde::as_str_bytes::deserialize" )] pub record_id_hashed_name: ::prost::alloc::vec::Vec, + /// record_addr is the bech32 string version of the record_id. #[prost(string, tag = "5")] pub record_addr: ::prost::alloc::string::String, + /// scope_id_info is information about the scope id referenced in the record_id. #[prost(message, optional, tag = "6")] - #[serde(alias = "scopeID_info")] pub scope_id_info: ::core::option::Option, } +/// ScopeSpecIdInfo contains various info regarding a scope specification id. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -538,32 +639,35 @@ pub struct RecordIdInfo { )] #[proto_message(type_url = "/provenance.metadata.v1.ScopeSpecIdInfo")] pub struct ScopeSpecIdInfo { + /// scope_spec_id is the raw bytes of the scope specification address. #[prost(bytes = "vec", tag = "1")] - #[serde(alias = "scope_specID")] #[serde( serialize_with = "crate::serde::as_str_bytes::serialize", deserialize_with = "crate::serde::as_str_bytes::deserialize" )] pub scope_spec_id: ::prost::alloc::vec::Vec, + /// scope_spec_id_prefix is the prefix portion of the scope_spec_id. #[prost(bytes = "vec", tag = "2")] - #[serde(alias = "scope_specID_prefix")] #[serde( serialize_with = "crate::serde::as_str_bytes::serialize", deserialize_with = "crate::serde::as_str_bytes::deserialize" )] pub scope_spec_id_prefix: ::prost::alloc::vec::Vec, + /// scope_spec_id_scope_spec_uuid is the scope_spec_uuid portion of the scope_spec_id. #[prost(bytes = "vec", tag = "3")] - #[serde(alias = "scope_specID_scope_spec_uuid")] #[serde( serialize_with = "crate::serde::as_str_bytes::serialize", deserialize_with = "crate::serde::as_str_bytes::deserialize" )] pub scope_spec_id_scope_spec_uuid: ::prost::alloc::vec::Vec, + /// scope_spec_addr is the bech32 string version of the scope_spec_id. #[prost(string, tag = "4")] pub scope_spec_addr: ::prost::alloc::string::String, + /// scope_spec_uuid is the uuid hex string of the scope_spec_id_scope_spec_uuid. #[prost(string, tag = "5")] pub scope_spec_uuid: ::prost::alloc::string::String, } +/// ContractSpecIdInfo contains various info regarding a contract specification id. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -577,32 +681,35 @@ pub struct ScopeSpecIdInfo { )] #[proto_message(type_url = "/provenance.metadata.v1.ContractSpecIdInfo")] pub struct ContractSpecIdInfo { + /// contract_spec_id is the raw bytes of the contract specification address. #[prost(bytes = "vec", tag = "1")] - #[serde(alias = "contract_specID")] #[serde( serialize_with = "crate::serde::as_str_bytes::serialize", deserialize_with = "crate::serde::as_str_bytes::deserialize" )] pub contract_spec_id: ::prost::alloc::vec::Vec, + /// contract_spec_id_prefix is the prefix portion of the contract_spec_id. #[prost(bytes = "vec", tag = "2")] - #[serde(alias = "contract_specID_prefix")] #[serde( serialize_with = "crate::serde::as_str_bytes::serialize", deserialize_with = "crate::serde::as_str_bytes::deserialize" )] pub contract_spec_id_prefix: ::prost::alloc::vec::Vec, + /// contract_spec_id_contract_spec_uuid is the contract_spec_uuid portion of the contract_spec_id. #[prost(bytes = "vec", tag = "3")] - #[serde(alias = "contract_specID_contract_spec_uuid")] #[serde( serialize_with = "crate::serde::as_str_bytes::serialize", deserialize_with = "crate::serde::as_str_bytes::deserialize" )] pub contract_spec_id_contract_spec_uuid: ::prost::alloc::vec::Vec, + /// contract_spec_addr is the bech32 string version of the contract_spec_id. #[prost(string, tag = "4")] pub contract_spec_addr: ::prost::alloc::string::String, + /// contract_spec_uuid is the uuid hex string of the contract_spec_id_contract_spec_uuid. #[prost(string, tag = "5")] pub contract_spec_uuid: ::prost::alloc::string::String, } +/// RecordSpecIdInfo contains various info regarding a record specification id. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -616,40 +723,42 @@ pub struct ContractSpecIdInfo { )] #[proto_message(type_url = "/provenance.metadata.v1.RecordSpecIdInfo")] pub struct RecordSpecIdInfo { + /// record_spec_id is the raw bytes of the record specification address. #[prost(bytes = "vec", tag = "1")] - #[serde(alias = "record_specID")] #[serde( serialize_with = "crate::serde::as_str_bytes::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + deserialize_with = "crate::serde::as_str_bytes::deserialize" )] pub record_spec_id: ::prost::alloc::vec::Vec, + /// record_spec_id_prefix is the prefix portion of the record_spec_id. #[prost(bytes = "vec", tag = "2")] - #[serde(alias = "record_specID_prefix")] #[serde( serialize_with = "crate::serde::as_str_bytes::serialize", deserialize_with = "crate::serde::as_str_bytes::deserialize" )] pub record_spec_id_prefix: ::prost::alloc::vec::Vec, + /// record_spec_id_contract_spec_uuid is the contract_spec_uuid portion of the record_spec_id. #[prost(bytes = "vec", tag = "3")] - #[serde(alias = "record_specID_contract_spec_uuid")] #[serde( serialize_with = "crate::serde::as_str_bytes::serialize", deserialize_with = "crate::serde::as_str_bytes::deserialize" )] pub record_spec_id_contract_spec_uuid: ::prost::alloc::vec::Vec, + /// record_spec_id_hashed_name is the hashed name portion of the record_spec_id. #[prost(bytes = "vec", tag = "4")] - #[serde(alias = "record_specID_hashed_name")] #[serde( serialize_with = "crate::serde::as_str_bytes::serialize", deserialize_with = "crate::serde::as_str_bytes::deserialize" )] pub record_spec_id_hashed_name: ::prost::alloc::vec::Vec, + /// record_spec_addr is the bech32 string version of the record_spec_id. #[prost(string, tag = "5")] pub record_spec_addr: ::prost::alloc::string::String, + /// contract_spec_id_info is information about the contract spec id referenced in the record_spec_id. #[prost(message, optional, tag = "6")] - #[serde(alias = "contract_specID_info")] pub contract_spec_id_info: ::core::option::Option, } +/// ScopeSpecification defines the required parties, resources, conditions, and consideration outputs for a contract #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -663,31 +772,35 @@ pub struct RecordSpecIdInfo { )] #[proto_message(type_url = "/provenance.metadata.v1.ScopeSpecification")] pub struct ScopeSpecification { + /// unique identifier for this specification on chain #[prost(bytes = "vec", tag = "1")] - #[serde(alias = "specificationID")] #[serde( serialize_with = "crate::serde::as_str_bytes::serialize", deserialize_with = "crate::serde::as_str_bytes::deserialize" )] pub specification_id: ::prost::alloc::vec::Vec, + /// General information about this scope specification. #[prost(message, optional, tag = "2")] pub description: ::core::option::Option, + /// Addresses of the owners of this scope specification. #[prost(string, repeated, tag = "3")] pub owner_addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(enumeration = "PartyType", repeated, packed = "false", tag = "4")] + /// A list of parties that must be present on a scope (and their associated roles) + #[prost(enumeration = "PartyType", repeated, tag = "4")] #[serde( - serialize_with = "PartyType::serialize_vec", - deserialize_with = "PartyType::deserialize_vec" + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" )] pub parties_involved: ::prost::alloc::vec::Vec, + /// A list of contract specification ids allowed for a scope based on this specification. #[prost(bytes = "vec", repeated, tag = "5")] - #[serde(alias = "contract_specIDs")] #[serde( serialize_with = "crate::serde::as_str_bytes_vec::serialize", deserialize_with = "crate::serde::as_str_bytes_vec::deserialize" )] pub contract_spec_ids: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, } +/// ContractSpecification defines the required parties, resources, conditions, and consideration outputs for a contract #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -701,31 +814,39 @@ pub struct ScopeSpecification { )] #[proto_message(type_url = "/provenance.metadata.v1.ContractSpecification")] pub struct ContractSpecification { + /// unique identifier for this specification on chain #[prost(bytes = "vec", tag = "1")] - #[serde(alias = "specificationID")] #[serde( serialize_with = "crate::serde::as_str_bytes::serialize", deserialize_with = "crate::serde::as_str_bytes::deserialize" )] pub specification_id: ::prost::alloc::vec::Vec, + /// Description information for this contract specification #[prost(message, optional, tag = "2")] pub description: ::core::option::Option, + /// Address of the account that owns this specificaiton #[prost(string, repeated, tag = "3")] pub owner_addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(enumeration = "PartyType", repeated, packed = "false", tag = "4")] + /// a list of party roles that must be fullfilled when signing a transaction for this contract specification + #[prost(enumeration = "PartyType", repeated, tag = "4")] #[serde( - serialize_with = "PartyType::serialize_vec", - deserialize_with = "PartyType::deserialize_vec" + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" )] pub parties_involved: ::prost::alloc::vec::Vec, + /// name of the class/type of this contract executable #[prost(string, tag = "7")] pub class_name: ::prost::alloc::string::String, + /// Reference to a metadata record with a hash and type information for the instance of code that will process this + /// contract #[prost(oneof = "contract_specification::Source", tags = "5, 6")] pub source: ::core::option::Option, } /// Nested message and enum types in `ContractSpecification`. pub mod contract_specification { use provwasm_proc_macro::CosmwasmExt; + /// Reference to a metadata record with a hash and type information for the instance of code that will process this + /// contract #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -737,12 +858,15 @@ pub mod contract_specification { ::schemars::JsonSchema, )] pub enum Source { + /// the address of a record on chain that represents this contract #[prost(bytes, tag = "5")] ResourceId(::prost::alloc::vec::Vec), + /// the hash of contract binary (off-chain instance) #[prost(string, tag = "6")] Hash(::prost::alloc::string::String), } } +/// RecordSpecification defines the specification for a Record including allowed/required inputs/outputs #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -756,32 +880,39 @@ pub mod contract_specification { )] #[proto_message(type_url = "/provenance.metadata.v1.RecordSpecification")] pub struct RecordSpecification { + /// unique identifier for this specification on chain #[prost(bytes = "vec", tag = "1")] - #[serde(alias = "specificationID")] #[serde( serialize_with = "crate::serde::as_str_bytes::serialize", deserialize_with = "crate::serde::as_str_bytes::deserialize" )] pub specification_id: ::prost::alloc::vec::Vec, + /// Name of Record that will be created when this specification is used #[prost(string, tag = "2")] pub name: ::prost::alloc::string::String, + /// A set of inputs that must be satisified to apply this RecordSpecification and create a Record #[prost(message, repeated, tag = "3")] pub inputs: ::prost::alloc::vec::Vec, + /// A type name for data associated with this record (typically a class or proto name) #[prost(string, tag = "4")] pub type_name: ::prost::alloc::string::String, + /// Type of result for this record specification (must be RECORD or RECORD_LIST) #[prost(enumeration = "DefinitionType", tag = "5")] #[serde( - serialize_with = "DefinitionType::serialize", - deserialize_with = "DefinitionType::deserialize" + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" )] pub result_type: i32, - #[prost(enumeration = "PartyType", repeated, packed = "false", tag = "6")] + /// Type of party responsible for this record + #[prost(enumeration = "PartyType", repeated, tag = "6")] #[serde( - serialize_with = "PartyType::serialize_vec", - deserialize_with = "PartyType::deserialize_vec" + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" )] pub responsible_parties: ::prost::alloc::vec::Vec, } +/// InputSpecification defines a name, type_name, and source reference (either on or off chain) to define an input +/// parameter #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -795,16 +926,20 @@ pub struct RecordSpecification { )] #[proto_message(type_url = "/provenance.metadata.v1.InputSpecification")] pub struct InputSpecification { + /// name for this input #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, + /// a type_name (typically a proto name or class_name) #[prost(string, tag = "2")] pub type_name: ::prost::alloc::string::String, + /// source is either on chain (record_id) or off-chain (hash) #[prost(oneof = "input_specification::Source", tags = "3, 4")] pub source: ::core::option::Option, } /// Nested message and enum types in `InputSpecification`. pub mod input_specification { use provwasm_proc_macro::CosmwasmExt; + /// source is either on chain (record_id) or off-chain (hash) #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -816,12 +951,15 @@ pub mod input_specification { ::schemars::JsonSchema, )] pub enum Source { + /// the address of a record on chain (For Established Records) #[prost(bytes, tag = "3")] RecordId(::prost::alloc::vec::Vec), + /// the hash of an off-chain piece of information (For Proposed Records) #[prost(string, tag = "4")] Hash(::prost::alloc::string::String), } } +/// Description holds general information that is handy to associate with a structure. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -835,22 +973,32 @@ pub mod input_specification { )] #[proto_message(type_url = "/provenance.metadata.v1.Description")] pub struct Description { + /// A Name for this thing. #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, + /// A description of this thing. #[prost(string, tag = "3")] pub description: ::prost::alloc::string::String, + /// URL to find even more info. #[prost(string, tag = "4")] pub website_url: ::prost::alloc::string::String, + /// URL of an icon. #[prost(string, tag = "5")] pub icon_url: ::prost::alloc::string::String, } +/// DefinitionType indicates the required definition type for this value #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] #[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] pub enum DefinitionType { + /// DEFINITION_TYPE_UNSPECIFIED indicates an unknown/invalid value Unspecified = 0, + /// DEFINITION_TYPE_PROPOSED indicates a proposed value is used here (a record that is not on-chain) Proposed = 1, + /// DEFINITION_TYPE_RECORD indicates the value must be a reference to a record on chain Record = 2, + /// DEFINITION_TYPE_RECORD_LIST indicates the value maybe a reference to a collection of values on chain having + /// the same name RecordList = 3, } impl DefinitionType { @@ -876,44 +1024,33 @@ impl DefinitionType { _ => None, } } - - pub fn serialize(v: &i32, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - let enum_value = Self::try_from(*v); - match enum_value { - Ok(v) => serializer.serialize_str(v.as_str_name()), - Err(e) => Err(serde::ser::Error::custom(e)), - } - } - - pub fn deserialize<'de, D>(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - use serde::de::Deserialize; - let s = String::deserialize(deserializer)?; - match Self::from_str_name(&s) { - Some(v) => Ok(v.into()), - None => Err(serde::de::Error::custom("unknown value")), - } - } } +/// PartyType are the different roles parties on a contract may use #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] #[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] pub enum PartyType { + /// PARTY_TYPE_UNSPECIFIED is an error condition Unspecified = 0, + /// PARTY_TYPE_ORIGINATOR is an asset originator Originator = 1, + /// PARTY_TYPE_SERVICER provides debt servicing functions Servicer = 2, + /// PARTY_TYPE_INVESTOR is a generic investor Investor = 3, + /// PARTY_TYPE_CUSTODIAN is an entity that provides custodian services for assets Custodian = 4, + /// PARTY_TYPE_OWNER indicates this party is an owner of the item Owner = 5, + /// PARTY_TYPE_AFFILIATE is a party with an affiliate agreement Affiliate = 6, + /// PARTY_TYPE_OMNIBUS is a special type of party that controls an omnibus bank account Omnibus = 7, + /// PARTY_TYPE_PROVENANCE is used to indicate this party represents the blockchain or a smart contract action Provenance = 8, + /// PARTY_TYPE_CONTROLLER is an entity which controls a specific asset on chain (ie enote) Controller = 10, + /// PARTY_TYPE_VALIDATOR is an entity which validates given assets on chain Validator = 11, } impl PartyType { @@ -953,70 +1090,8 @@ impl PartyType { _ => None, } } - - pub fn serialize(v: &i32, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - let enum_value = Self::try_from(*v); - match enum_value { - Ok(v) => serializer.serialize_str(v.as_str_name()), - Err(e) => Err(serde::ser::Error::custom(e)), - } - } - - pub fn deserialize<'de, D>(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - use serde::de::Deserialize; - let s = String::deserialize(deserializer)?; - match Self::from_str_name(&s) { - Some(v) => Ok(v.into()), - None => Err(serde::de::Error::custom("unknown value")), - } - } - - pub fn serialize_vec(v: &Vec, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeTuple; - - let mut enum_strs: Vec<&str> = Vec::new(); - for ord in v { - // let enum_value = Self::try_from(*ord); - let enum_value = Self::try_from(*ord); - match enum_value { - Ok(v) => { - enum_strs.push(v.as_str_name()); - } - Err(e) => return Err(serde::ser::Error::custom(e)), - } - } - let mut seq = serializer.serialize_tuple(enum_strs.len())?; - for item in enum_strs { - seq.serialize_element(item)?; - } - seq.end() - } - - fn deserialize_vec<'de, D>(deserializer: D) -> Result, D::Error> - where - D: serde::Deserializer<'de>, - { - use serde::de::{Deserialize, Error}; - - let strs: Vec = Vec::deserialize(deserializer)?; - let mut ords: Vec = Vec::new(); - for str_name in strs { - let enum_value = Self::from_str_name(&str_name) - .ok_or_else(|| Error::custom(format!("unknown enum string: {}", str_name)))?; - ords.push(enum_value as i32); - } - Ok(ords) - } } +/// Scope defines a root reference for a collection of records owned by one or more parties. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1030,29 +1105,40 @@ impl PartyType { )] #[proto_message(type_url = "/provenance.metadata.v1.Scope")] pub struct Scope { + /// Unique ID for this scope. Implements sdk.Address interface for use where addresses are required in Cosmos #[prost(bytes = "vec", tag = "1")] - #[serde(alias = "scopeID")] #[serde( serialize_with = "crate::serde::as_str_bytes::serialize", deserialize_with = "crate::serde::as_str_bytes::deserialize" )] pub scope_id: ::prost::alloc::vec::Vec, + /// the scope specification that contains the specifications for data elements allowed within this scope #[prost(bytes = "vec", tag = "2")] - #[serde(alias = "specificationID")] #[serde( serialize_with = "crate::serde::as_str_bytes::serialize", deserialize_with = "crate::serde::as_str_bytes::deserialize" )] pub specification_id: ::prost::alloc::vec::Vec, + /// These parties represent top level owners of the records within. These parties must sign any requests that modify + /// the data within the scope. These addresses are in union with parties listed on the sessions. #[prost(message, repeated, tag = "3")] pub owners: ::prost::alloc::vec::Vec, + /// Addresses in this list are authorized to receive off-chain data associated with this scope. #[prost(string, repeated, tag = "4")] pub data_access: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// An address that controls the value associated with this scope. Standard blockchain accounts and marker accounts + /// are supported for this value. This attribute may only be changed by the entity indicated once it is set. #[prost(string, tag = "5")] pub value_owner_address: ::prost::alloc::string::String, + /// Whether all parties in this scope and its sessions must be present in this scope's owners field. + /// This also enables use of optional=true scope owners and session parties. #[prost(bool, tag = "6")] pub require_party_rollup: bool, } +/// Session defines an execution context against a specific specification instance. +/// The context will have a specification and set of parties involved. +/// +/// NOTE: When there are no more Records within a Scope that reference a Session, the Session is removed. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1067,32 +1153,36 @@ pub struct Scope { #[proto_message(type_url = "/provenance.metadata.v1.Session")] pub struct Session { #[prost(bytes = "vec", tag = "1")] - #[serde(alias = "sessionID")] #[serde( serialize_with = "crate::serde::as_str_bytes::serialize", deserialize_with = "crate::serde::as_str_bytes::deserialize" )] pub session_id: ::prost::alloc::vec::Vec, + /// unique id of the contract specification that was used to create this session. #[prost(bytes = "vec", tag = "2")] - #[serde(alias = "specificationID")] #[serde( serialize_with = "crate::serde::as_str_bytes::serialize", deserialize_with = "crate::serde::as_str_bytes::deserialize" )] pub specification_id: ::prost::alloc::vec::Vec, + /// parties is the set of identities that signed this contract #[prost(message, repeated, tag = "3")] pub parties: ::prost::alloc::vec::Vec, + /// name to associate with this session execution context, typically classname #[prost(string, tag = "4")] pub name: ::prost::alloc::string::String, + /// context is a field for storing client specific data associated with a session. #[prost(bytes = "vec", tag = "5")] #[serde( serialize_with = "crate::serde::as_str_bytes::serialize", deserialize_with = "crate::serde::as_str_bytes::deserialize" )] pub context: ::prost::alloc::vec::Vec, + /// Created by, updated by, timestamps, version number, and related info. #[prost(message, optional, tag = "99")] pub audit: ::core::option::Option, } +/// A record (of fact) is attached to a session or each consideration output from a contract #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1106,29 +1196,34 @@ pub struct Session { )] #[proto_message(type_url = "/provenance.metadata.v1.Record")] pub struct Record { + /// name/identifier for this record. Value must be unique within the scope. Also known as a Fact name #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, + /// id of the session context that was used to create this record (use with filtered kvprefix iterator) #[prost(bytes = "vec", tag = "2")] - #[serde(alias = "sessionID")] #[serde( serialize_with = "crate::serde::as_str_bytes::serialize", deserialize_with = "crate::serde::as_str_bytes::deserialize" )] pub session_id: ::prost::alloc::vec::Vec, + /// process contain information used to uniquely identify an execution on or off chain that generated this record #[prost(message, optional, tag = "3")] pub process: ::core::option::Option, + /// inputs used with the process to achieve the output on this record #[prost(message, repeated, tag = "4")] pub inputs: ::prost::alloc::vec::Vec, + /// output(s) is the results of executing the process on the given process indicated in this record #[prost(message, repeated, tag = "5")] pub outputs: ::prost::alloc::vec::Vec, + /// specification_id is the id of the record specification that was used to create this record. #[prost(bytes = "vec", tag = "6")] - #[serde(alias = "specificationID")] #[serde( serialize_with = "crate::serde::as_str_bytes::serialize", deserialize_with = "crate::serde::as_str_bytes::deserialize" )] pub specification_id: ::prost::alloc::vec::Vec, } +/// Process contains information used to uniquely identify what was used to generate this record #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1142,17 +1237,20 @@ pub struct Record { )] #[proto_message(type_url = "/provenance.metadata.v1.Process")] pub struct Process { + /// a name associated with the process (type_name, classname or smart contract common name) #[prost(string, tag = "3")] pub name: ::prost::alloc::string::String, + /// method is a name or reference to a specific operation (method) within a class/contract that was invoked #[prost(string, tag = "4")] pub method: ::prost::alloc::string::String, + /// unique identifier for this process #[prost(oneof = "process::ProcessId", tags = "1, 2")] - #[serde(alias = "processID")] pub process_id: ::core::option::Option, } /// Nested message and enum types in `Process`. pub mod process { use provwasm_proc_macro::CosmwasmExt; + /// unique identifier for this process #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1164,12 +1262,15 @@ pub mod process { ::schemars::JsonSchema, )] pub enum ProcessId { + /// the address of a smart contract used for this process #[prost(string, tag = "1")] Address(::prost::alloc::string::String), + /// the hash of an off-chain process used #[prost(string, tag = "2")] Hash(::prost::alloc::string::String), } } +/// Tracks the inputs used to establish this record #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1183,22 +1284,27 @@ pub mod process { )] #[proto_message(type_url = "/provenance.metadata.v1.RecordInput")] pub struct RecordInput { + /// Name value included to link back to the definition spec. #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, + /// from proposed fact structure to unmarshal #[prost(string, tag = "4")] pub type_name: ::prost::alloc::string::String, + /// Indicates if this input was a recorded fact on chain or just a given hashed input #[prost(enumeration = "RecordInputStatus", tag = "5")] #[serde( - serialize_with = "RecordInputStatus::serialize", - deserialize_with = "RecordInputStatus::deserialize" + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" )] pub status: i32, + /// data source #[prost(oneof = "record_input::Source", tags = "2, 3")] pub source: ::core::option::Option, } /// Nested message and enum types in `RecordInput`. pub mod record_input { use provwasm_proc_macro::CosmwasmExt; + /// data source #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1210,12 +1316,15 @@ pub mod record_input { ::schemars::JsonSchema, )] pub enum Source { + /// the address of a record on chain (For Established Records) #[prost(bytes, tag = "2")] RecordId(::prost::alloc::vec::Vec), + /// the hash of an off-chain piece of information (For Proposed Records) #[prost(string, tag = "3")] Hash(::prost::alloc::string::String), } } +/// RecordOutput encapsulates the output of a process recorded on chain #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1229,15 +1338,18 @@ pub mod record_input { )] #[proto_message(type_url = "/provenance.metadata.v1.RecordOutput")] pub struct RecordOutput { + /// Hash of the data output that was output/generated for this record #[prost(string, tag = "1")] pub hash: ::prost::alloc::string::String, + /// Status of the process execution associated with this output indicating success,failure, or pending #[prost(enumeration = "ResultStatus", tag = "2")] #[serde( - serialize_with = "ResultStatus::serialize", - deserialize_with = "ResultStatus::deserialize" + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" )] pub status: i32, } +/// A Party is an address with/in a given role associated with a contract #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1251,17 +1363,21 @@ pub struct RecordOutput { )] #[proto_message(type_url = "/provenance.metadata.v1.Party")] pub struct Party { + /// address of the account (on chain) #[prost(string, tag = "1")] pub address: ::prost::alloc::string::String, + /// a role for this account within the context of the processes used #[prost(enumeration = "PartyType", tag = "2")] #[serde( - serialize_with = "PartyType::serialize", - deserialize_with = "PartyType::deserialize" + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" )] pub role: i32, + /// whether this party's signature is optional #[prost(bool, tag = "3")] pub optional: bool, } +/// AuditFields capture information about the last account to make modifications and when they were made #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1275,29 +1391,64 @@ pub struct Party { )] #[proto_message(type_url = "/provenance.metadata.v1.AuditFields")] pub struct AuditFields { + /// the date/time when this entry was created #[prost(message, optional, tag = "1")] pub created_date: ::core::option::Option, + /// the address of the account that created this record #[prost(string, tag = "2")] pub created_by: ::prost::alloc::string::String, + /// the date/time when this entry was last updated #[prost(message, optional, tag = "3")] pub updated_date: ::core::option::Option, + /// the address of the account that modified this record #[prost(string, tag = "4")] pub updated_by: ::prost::alloc::string::String, + /// an optional version number that is incremented with each update #[prost(uint32, tag = "5")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub version: u32, + /// an optional message associated with the creation/update event #[prost(string, tag = "6")] pub message: ::prost::alloc::string::String, } +/// NetAssetValue defines a scope's net asset value +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.metadata.v1.NetAssetValue")] +pub struct NetAssetValue { + /// price is the complete value of the asset's volume + #[prost(message, optional, tag = "1")] + pub price: ::core::option::Option, + /// updated_block_height is the block height of last update + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub updated_block_height: u64, +} +/// A set of types for inputs on a record (of fact) #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] #[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] pub enum RecordInputStatus { + /// RECORD_INPUT_STATUS_UNSPECIFIED indicates an invalid/unknown input type Unspecified = 0, + /// RECORD_INPUT_STATUS_PROPOSED indicates this input was an arbitrary piece of data that was hashed Proposed = 1, + /// RECORD_INPUT_STATUS_RECORD indicates this input is a reference to a previously recorded fact on blockchain Record = 2, } impl RecordInputStatus { @@ -1321,37 +1472,19 @@ impl RecordInputStatus { _ => None, } } - - pub fn serialize(v: &i32, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - let enum_value = Self::try_from(*v); - match enum_value { - Ok(v) => serializer.serialize_str(v.as_str_name()), - Err(e) => Err(serde::ser::Error::custom(e)), - } - } - - pub fn deserialize<'de, D>(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - use serde::de::Deserialize; - let s = String::deserialize(deserializer)?; - match Self::from_str_name(&s) { - Some(v) => Ok(v.into()), - None => Err(serde::de::Error::custom("unknown value")), - } - } } +/// ResultStatus indicates the various states of execution of a record #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] #[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] pub enum ResultStatus { + /// RESULT_STATUS_UNSPECIFIED indicates an unset condition Unspecified = 0, + /// RESULT_STATUS_PASS indicates the execution was successful Pass = 1, + /// RESULT_STATUS_SKIP indicates condition/consideration was skipped due to missing inputs or delayed execution Skip = 2, + /// RESULT_STATUS_FAIL indicates the execution of the condition/consideration failed. Fail = 3, } impl ResultStatus { @@ -1377,30 +1510,9 @@ impl ResultStatus { _ => None, } } - - pub fn serialize(v: &i32, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - let enum_value = Self::try_from(*v); - match enum_value { - Ok(v) => serializer.serialize_str(v.as_str_name()), - Err(e) => Err(serde::ser::Error::custom(e)), - } - } - - pub fn deserialize<'de, D>(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - use serde::de::Deserialize; - let s = String::deserialize(deserializer)?; - match Self::from_str_name(&s) { - Some(v) => Ok(v.into()), - None => Err(serde::de::Error::custom("unknown value")), - } - } } +/// Defines an Locator object stored on chain, which represents a owner( blockchain address) associated with a endpoint +/// uri for it's associated object store. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1414,13 +1526,17 @@ impl ResultStatus { )] #[proto_message(type_url = "/provenance.metadata.v1.ObjectStoreLocator")] pub struct ObjectStoreLocator { + /// account address the endpoint is owned by #[prost(string, tag = "1")] pub owner: ::prost::alloc::string::String, + /// locator endpoint uri #[prost(string, tag = "2")] pub locator_uri: ::prost::alloc::string::String, + /// owners encryption key address #[prost(string, tag = "3")] pub encryption_key: ::prost::alloc::string::String, } +/// Params defines the parameters for the metadata-locator module methods. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1435,8 +1551,72 @@ pub struct ObjectStoreLocator { #[proto_message(type_url = "/provenance.metadata.v1.OSLocatorParams")] pub struct OsLocatorParams { #[prost(uint32, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] pub max_uri_length: u32, } +/// GenesisState defines the account module's genesis state. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.metadata.v1.GenesisState")] +pub struct GenesisState { + /// params defines all the parameters of the module. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, + /// A collection of metadata scopes and specs to create on start + #[prost(message, repeated, tag = "2")] + pub scopes: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "3")] + pub sessions: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "4")] + pub records: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "5")] + pub scope_specifications: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "6")] + pub contract_specifications: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "7")] + pub record_specifications: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "8")] + pub o_s_locator_params: ::core::option::Option, + #[prost(message, repeated, tag = "9")] + pub object_store_locators: ::prost::alloc::vec::Vec, + /// Net asset values assigned to scopes + #[prost(message, repeated, tag = "10")] + pub net_asset_values: ::prost::alloc::vec::Vec, +} +/// MarkerNetAssetValues defines the net asset values for a scope +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.metadata.v1.MarkerNetAssetValues")] +pub struct MarkerNetAssetValues { + /// address defines the scope address + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// net_asset_values that are assigned to scope + #[prost(message, repeated, tag = "2")] + pub net_asset_values: ::prost::alloc::vec::Vec, +} +/// QueryParamsRequest is the request type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1454,9 +1634,11 @@ pub struct OsLocatorParams { response_type = QueryParamsResponse )] pub struct QueryParamsRequest { + /// include_request is a flag for whether to include this request in your result. #[prost(bool, tag = "98")] pub include_request: bool, } +/// QueryParamsResponse is the response type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1470,11 +1652,14 @@ pub struct QueryParamsRequest { )] #[proto_message(type_url = "/provenance.metadata.v1.QueryParamsResponse")] pub struct QueryParamsResponse { + /// params defines the parameters of the module. #[prost(message, optional, tag = "1")] pub params: ::core::option::Option, + /// request is a copy of the request that generated these results. #[prost(message, optional, tag = "98")] pub request: ::core::option::Option, } +/// ScopeRequest is the request type for the Query/Scope RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1492,23 +1677,31 @@ pub struct QueryParamsResponse { response_type = ScopeResponse )] pub struct ScopeRequest { + /// scope_id can either be a uuid, e.g. 91978ba2-5f35-459a-86a7-feca1b0512e0 or a bech32 scope address, e.g. + /// scope1qzge0zaztu65tx5x5llv5xc9ztsqxlkwel. #[prost(string, tag = "1")] - #[serde(alias = "scopeID")] pub scope_id: ::prost::alloc::string::String, + /// session_addr is a bech32 session address, e.g. + /// session1qxge0zaztu65tx5x5llv5xc9zts9sqlch3sxwn44j50jzgt8rshvqyfrjcr. #[prost(string, tag = "2")] pub session_addr: ::prost::alloc::string::String, + /// record_addr is a bech32 record address, e.g. record1q2ge0zaztu65tx5x5llv5xc9ztsw42dq2jdvmdazuwzcaddhh8gmu3mcze3. #[prost(string, tag = "3")] pub record_addr: ::prost::alloc::string::String, + /// include_sessions is a flag for whether to include the sessions of the scope in the response. #[prost(bool, tag = "10")] pub include_sessions: bool, + /// include_records is a flag for whether to include the records of the scope in the response. #[prost(bool, tag = "11")] pub include_records: bool, + /// exclude_id_info is a flag for whether to exclude the id info from the response. #[prost(bool, tag = "12")] - #[serde(alias = "excludeID_info")] pub exclude_id_info: bool, + /// include_request is a flag for whether to include this request in your result. #[prost(bool, tag = "98")] pub include_request: bool, } +/// ScopeResponse is the response type for the Query/Scope RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1522,15 +1715,20 @@ pub struct ScopeRequest { )] #[proto_message(type_url = "/provenance.metadata.v1.ScopeResponse")] pub struct ScopeResponse { + /// scope is the wrapped scope result. #[prost(message, optional, tag = "1")] pub scope: ::core::option::Option, + /// sessions is any number of wrapped sessions in this scope (if requested). #[prost(message, repeated, tag = "2")] pub sessions: ::prost::alloc::vec::Vec, + /// records is any number of wrapped records in this scope (if requested). #[prost(message, repeated, tag = "3")] pub records: ::prost::alloc::vec::Vec, + /// request is a copy of the request that generated these results. #[prost(message, optional, tag = "98")] pub request: ::core::option::Option, } +/// SessionWrapper contains a single scope and its uuid. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1544,15 +1742,71 @@ pub struct ScopeResponse { )] #[proto_message(type_url = "/provenance.metadata.v1.ScopeWrapper")] pub struct ScopeWrapper { + /// scope is the on-chain scope message. #[prost(message, optional, tag = "1")] pub scope: ::core::option::Option, + /// scope_id_info contains information about the id/address of the scope. #[prost(message, optional, tag = "2")] - #[serde(alias = "scopeID_info")] pub scope_id_info: ::core::option::Option, + /// scope_spec_id_info contains information about the id/address of the scope specification. #[prost(message, optional, tag = "3")] - #[serde(alias = "scope_specID_info")] pub scope_spec_id_info: ::core::option::Option, } +/// ScopesAllRequest is the request type for the Query/ScopesAll 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 = "/provenance.metadata.v1.ScopesAllRequest")] +#[proto_query( + path = "/provenance.metadata.v1.Query/ScopesAll", + response_type = ScopesAllResponse +)] +pub struct ScopesAllRequest { + /// exclude_id_info is a flag for whether to exclude the id info from the response. + #[prost(bool, tag = "12")] + pub exclude_id_info: bool, + /// include_request is a flag for whether to include this request in your result. + #[prost(bool, tag = "98")] + pub include_request: bool, + /// pagination defines optional pagination parameters for the request. + #[prost(message, optional, tag = "99")] + pub pagination: + ::core::option::Option, +} +/// ScopesAllResponse is the response type for the Query/ScopesAll 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 = "/provenance.metadata.v1.ScopesAllResponse")] +pub struct ScopesAllResponse { + /// scopes are the wrapped scopes. + #[prost(message, repeated, tag = "1")] + pub scopes: ::prost::alloc::vec::Vec, + /// request is a copy of the request that generated these results. + #[prost(message, optional, tag = "98")] + pub request: ::core::option::Option, + /// pagination provides the pagination information of this response. + #[prost(message, optional, tag = "99")] + pub pagination: + ::core::option::Option, +} +/// SessionsRequest is the request type for the Query/Sessions RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1570,26 +1824,35 @@ pub struct ScopeWrapper { response_type = SessionsResponse )] pub struct SessionsRequest { + /// scope_id can either be a uuid, e.g. 91978ba2-5f35-459a-86a7-feca1b0512e0 or a bech32 scope address, e.g. + /// scope1qzge0zaztu65tx5x5llv5xc9ztsqxlkwel. #[prost(string, tag = "1")] - #[serde(alias = "scopeID")] pub scope_id: ::prost::alloc::string::String, + /// session_id can either be a uuid, e.g. 5803f8bc-6067-4eb5-951f-2121671c2ec0 or a bech32 session address, e.g. + /// session1qxge0zaztu65tx5x5llv5xc9zts9sqlch3sxwn44j50jzgt8rshvqyfrjcr. This can only be a uuid if a scope_id is also + /// provided. #[prost(string, tag = "2")] - #[serde(alias = "sessionID")] pub session_id: ::prost::alloc::string::String, + /// record_addr is a bech32 record address, e.g. record1q2ge0zaztu65tx5x5llv5xc9ztsw42dq2jdvmdazuwzcaddhh8gmu3mcze3. #[prost(string, tag = "3")] pub record_addr: ::prost::alloc::string::String, + /// record_name is the name of the record to find the session for in the provided scope. #[prost(string, tag = "4")] pub record_name: ::prost::alloc::string::String, + /// include_scope is a flag for whether to include the scope containing these sessions in the response. #[prost(bool, tag = "10")] pub include_scope: bool, + /// include_records is a flag for whether to include the records of these sessions in the response. #[prost(bool, tag = "11")] pub include_records: bool, + /// exclude_id_info is a flag for whether to exclude the id info from the response. #[prost(bool, tag = "12")] - #[serde(alias = "excludeID_info")] pub exclude_id_info: bool, + /// include_request is a flag for whether to include this request in your result. #[prost(bool, tag = "98")] pub include_request: bool, } +/// SessionsResponse is the response type for the Query/Sessions RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1603,15 +1866,20 @@ pub struct SessionsRequest { )] #[proto_message(type_url = "/provenance.metadata.v1.SessionsResponse")] pub struct SessionsResponse { + /// scope is the wrapped scope that holds these sessions (if requested). #[prost(message, optional, tag = "1")] pub scope: ::core::option::Option, + /// sessions is any number of wrapped session results. #[prost(message, repeated, tag = "2")] pub sessions: ::prost::alloc::vec::Vec, + /// records is any number of wrapped records contained in these sessions (if requested). #[prost(message, repeated, tag = "3")] pub records: ::prost::alloc::vec::Vec, + /// request is a copy of the request that generated these results. #[prost(message, optional, tag = "98")] pub request: ::core::option::Option, } +/// SessionWrapper contains a single session and some extra identifiers for it. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1625,15 +1893,71 @@ pub struct SessionsResponse { )] #[proto_message(type_url = "/provenance.metadata.v1.SessionWrapper")] pub struct SessionWrapper { + /// session is the on-chain session message. #[prost(message, optional, tag = "1")] pub session: ::core::option::Option, + /// session_id_info contains information about the id/address of the session. #[prost(message, optional, tag = "2")] - #[serde(alias = "sessionID_info")] pub session_id_info: ::core::option::Option, + /// contract_spec_id_info contains information about the id/address of the contract specification. #[prost(message, optional, tag = "3")] - #[serde(alias = "contract_specID_info")] pub contract_spec_id_info: ::core::option::Option, } +/// SessionsAllRequest is the request type for the Query/SessionsAll 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 = "/provenance.metadata.v1.SessionsAllRequest")] +#[proto_query( + path = "/provenance.metadata.v1.Query/SessionsAll", + response_type = SessionsAllResponse +)] +pub struct SessionsAllRequest { + /// exclude_id_info is a flag for whether to exclude the id info from the response. + #[prost(bool, tag = "12")] + pub exclude_id_info: bool, + /// include_request is a flag for whether to include this request in your result. + #[prost(bool, tag = "98")] + pub include_request: bool, + /// pagination defines optional pagination parameters for the request. + #[prost(message, optional, tag = "99")] + pub pagination: + ::core::option::Option, +} +/// SessionsAllResponse is the response type for the Query/SessionsAll 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 = "/provenance.metadata.v1.SessionsAllResponse")] +pub struct SessionsAllResponse { + /// sessions are the wrapped sessions. + #[prost(message, repeated, tag = "1")] + pub sessions: ::prost::alloc::vec::Vec, + /// request is a copy of the request that generated these results. + #[prost(message, optional, tag = "98")] + pub request: ::core::option::Option, + /// pagination provides the pagination information of this response. + #[prost(message, optional, tag = "99")] + pub pagination: + ::core::option::Option, +} +/// RecordsRequest is the request type for the Query/Records RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1651,26 +1975,35 @@ pub struct SessionWrapper { response_type = RecordsResponse )] pub struct RecordsRequest { + /// record_addr is a bech32 record address, e.g. record1q2ge0zaztu65tx5x5llv5xc9ztsw42dq2jdvmdazuwzcaddhh8gmu3mcze3. #[prost(string, tag = "1")] pub record_addr: ::prost::alloc::string::String, + /// scope_id can either be a uuid, e.g. 91978ba2-5f35-459a-86a7-feca1b0512e0 or a bech32 scope address, e.g. + /// scope1qzge0zaztu65tx5x5llv5xc9ztsqxlkwel. #[prost(string, tag = "2")] - #[serde(alias = "scopeID")] pub scope_id: ::prost::alloc::string::String, + /// session_id can either be a uuid, e.g. 5803f8bc-6067-4eb5-951f-2121671c2ec0 or a bech32 session address, e.g. + /// session1qxge0zaztu65tx5x5llv5xc9zts9sqlch3sxwn44j50jzgt8rshvqyfrjcr. This can only be a uuid if a scope_id is also + /// provided. #[prost(string, tag = "3")] - #[serde(alias = "sessionID")] pub session_id: ::prost::alloc::string::String, + /// name is the name of the record to look for #[prost(string, tag = "4")] pub name: ::prost::alloc::string::String, + /// include_scope is a flag for whether to include the the scope containing these records in the response. #[prost(bool, tag = "10")] pub include_scope: bool, + /// include_sessions is a flag for whether to include the sessions containing these records in the response. #[prost(bool, tag = "11")] pub include_sessions: bool, + /// exclude_id_info is a flag for whether to exclude the id info from the response. #[prost(bool, tag = "12")] - #[serde(alias = "excludeID_info")] pub exclude_id_info: bool, + /// include_request is a flag for whether to include this request in your result. #[prost(bool, tag = "98")] pub include_request: bool, } +/// RecordsResponse is the response type for the Query/Records RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1684,15 +2017,20 @@ pub struct RecordsRequest { )] #[proto_message(type_url = "/provenance.metadata.v1.RecordsResponse")] pub struct RecordsResponse { + /// scope is the wrapped scope that holds these records (if requested). #[prost(message, optional, tag = "1")] pub scope: ::core::option::Option, + /// sessions is any number of wrapped sessions that hold these records (if requested). #[prost(message, repeated, tag = "2")] pub sessions: ::prost::alloc::vec::Vec, + /// records is any number of wrapped record results. #[prost(message, repeated, tag = "3")] pub records: ::prost::alloc::vec::Vec, + /// request is a copy of the request that generated these results. #[prost(message, optional, tag = "98")] pub request: ::core::option::Option, } +/// RecordWrapper contains a single record and some extra identifiers for it. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1706,15 +2044,71 @@ pub struct RecordsResponse { )] #[proto_message(type_url = "/provenance.metadata.v1.RecordWrapper")] pub struct RecordWrapper { + /// record is the on-chain record message. #[prost(message, optional, tag = "1")] pub record: ::core::option::Option, + /// record_id_info contains information about the id/address of the record. #[prost(message, optional, tag = "2")] - #[serde(alias = "recordID_info")] pub record_id_info: ::core::option::Option, + /// record_spec_id_info contains information about the id/address of the record specification. #[prost(message, optional, tag = "3")] - #[serde(alias = "record_specID_info")] pub record_spec_id_info: ::core::option::Option, } +/// RecordsAllRequest is the request type for the Query/RecordsAll 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 = "/provenance.metadata.v1.RecordsAllRequest")] +#[proto_query( + path = "/provenance.metadata.v1.Query/RecordsAll", + response_type = RecordsAllResponse +)] +pub struct RecordsAllRequest { + /// exclude_id_info is a flag for whether to exclude the id info from the response. + #[prost(bool, tag = "12")] + pub exclude_id_info: bool, + /// include_request is a flag for whether to include this request in your result. + #[prost(bool, tag = "98")] + pub include_request: bool, + /// pagination defines optional pagination parameters for the request. + #[prost(message, optional, tag = "99")] + pub pagination: + ::core::option::Option, +} +/// RecordsAllResponse is the response type for the Query/RecordsAll 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 = "/provenance.metadata.v1.RecordsAllResponse")] +pub struct RecordsAllResponse { + /// records are the wrapped records. + #[prost(message, repeated, tag = "1")] + pub records: ::prost::alloc::vec::Vec, + /// request is a copy of the request that generated these results. + #[prost(message, optional, tag = "98")] + pub request: ::core::option::Option, + /// pagination provides the pagination information of this response. + #[prost(message, optional, tag = "99")] + pub pagination: + ::core::option::Option, +} +/// OwnershipRequest is the request type for the Query/Ownership RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1734,12 +2128,15 @@ pub struct RecordWrapper { pub struct OwnershipRequest { #[prost(string, tag = "1")] pub address: ::prost::alloc::string::String, + /// include_request is a flag for whether to include this request in your result. #[prost(bool, tag = "98")] pub include_request: bool, + /// pagination defines optional pagination parameters for the request. #[prost(message, optional, tag = "99")] pub pagination: ::core::option::Option, } +/// OwnershipResponse is the response type for the Query/Ownership RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1753,14 +2150,18 @@ pub struct OwnershipRequest { )] #[proto_message(type_url = "/provenance.metadata.v1.OwnershipResponse")] pub struct OwnershipResponse { + /// A list of scope ids (uuid) associated with the given address. #[prost(string, repeated, tag = "1")] pub scope_uuids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// request is a copy of the request that generated these results. #[prost(message, optional, tag = "98")] pub request: ::core::option::Option, + /// pagination provides the pagination information of this response. #[prost(message, optional, tag = "99")] pub pagination: ::core::option::Option, } +/// ValueOwnershipRequest is the request type for the Query/ValueOwnership RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1780,12 +2181,15 @@ pub struct OwnershipResponse { pub struct ValueOwnershipRequest { #[prost(string, tag = "1")] pub address: ::prost::alloc::string::String, + /// include_request is a flag for whether to include this request in your result. #[prost(bool, tag = "98")] pub include_request: bool, + /// pagination defines optional pagination parameters for the request. #[prost(message, optional, tag = "99")] pub pagination: ::core::option::Option, } +/// ValueOwnershipResponse is the response type for the Query/ValueOwnership RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1799,14 +2203,18 @@ pub struct ValueOwnershipRequest { )] #[proto_message(type_url = "/provenance.metadata.v1.ValueOwnershipResponse")] pub struct ValueOwnershipResponse { + /// A list of scope ids (uuid) associated with the given address. #[prost(string, repeated, tag = "1")] pub scope_uuids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// request is a copy of the request that generated these results. #[prost(message, optional, tag = "98")] pub request: ::core::option::Option, + /// pagination provides the pagination information of this response. #[prost(message, optional, tag = "99")] pub pagination: ::core::option::Option, } +/// ScopeSpecificationRequest is the request type for the Query/ScopeSpecification RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1824,19 +2232,26 @@ pub struct ValueOwnershipResponse { response_type = ScopeSpecificationResponse )] pub struct ScopeSpecificationRequest { + /// specification_id can either be a uuid, e.g. dc83ea70-eacd-40fe-9adf-1cf6148bf8a2 or a bech32 scope specification + /// address, e.g. scopespec1qnwg86nsatx5pl56muw0v9ytlz3qu3jx6m. #[prost(string, tag = "1")] - #[serde(alias = "specificationID")] pub specification_id: ::prost::alloc::string::String, + /// include_contract_specs is a flag for whether to include the contract specifications of the scope specification in + /// the response. #[prost(bool, tag = "10")] pub include_contract_specs: bool, + /// include_record_specs is a flag for whether to include the record specifications of the scope specification in the + /// response. #[prost(bool, tag = "11")] pub include_record_specs: bool, + /// exclude_id_info is a flag for whether to exclude the id info from the response. #[prost(bool, tag = "12")] - #[serde(alias = "excludeID_info")] pub exclude_id_info: bool, + /// include_request is a flag for whether to include this request in your result. #[prost(bool, tag = "98")] pub include_request: bool, } +/// ScopeSpecificationResponse is the response type for the Query/ScopeSpecification RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1850,15 +2265,20 @@ pub struct ScopeSpecificationRequest { )] #[proto_message(type_url = "/provenance.metadata.v1.ScopeSpecificationResponse")] pub struct ScopeSpecificationResponse { + /// scope_specification is the wrapped scope specification. #[prost(message, optional, tag = "1")] pub scope_specification: ::core::option::Option, + /// contract_specs is any number of wrapped contract specifications in this scope specification (if requested). #[prost(message, repeated, tag = "2")] pub contract_specs: ::prost::alloc::vec::Vec, + /// record_specs is any number of wrapped record specifications in this scope specification (if requested). #[prost(message, repeated, tag = "3")] pub record_specs: ::prost::alloc::vec::Vec, + /// request is a copy of the request that generated these results. #[prost(message, optional, tag = "98")] pub request: ::core::option::Option, } +/// ScopeSpecificationWrapper contains a single scope specification and some extra identifiers for it. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1872,12 +2292,68 @@ pub struct ScopeSpecificationResponse { )] #[proto_message(type_url = "/provenance.metadata.v1.ScopeSpecificationWrapper")] pub struct ScopeSpecificationWrapper { + /// specification is the on-chain scope specification message. #[prost(message, optional, tag = "1")] pub specification: ::core::option::Option, + /// scope_spec_id_info contains information about the id/address of the scope specification. #[prost(message, optional, tag = "2")] - #[serde(alias = "scope_specID_info")] pub scope_spec_id_info: ::core::option::Option, } +/// ScopeSpecificationsAllRequest is the request type for the Query/ScopeSpecificationsAll 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 = "/provenance.metadata.v1.ScopeSpecificationsAllRequest")] +#[proto_query( + path = "/provenance.metadata.v1.Query/ScopeSpecificationsAll", + response_type = ScopeSpecificationsAllResponse +)] +pub struct ScopeSpecificationsAllRequest { + /// exclude_id_info is a flag for whether to exclude the id info from the response. + #[prost(bool, tag = "12")] + pub exclude_id_info: bool, + /// include_request is a flag for whether to include this request in your result. + #[prost(bool, tag = "98")] + pub include_request: bool, + /// pagination defines optional pagination parameters for the request. + #[prost(message, optional, tag = "99")] + pub pagination: + ::core::option::Option, +} +/// ScopeSpecificationsAllResponse is the response type for the Query/ScopeSpecificationsAll 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 = "/provenance.metadata.v1.ScopeSpecificationsAllResponse")] +pub struct ScopeSpecificationsAllResponse { + /// scope_specifications are the wrapped scope specifications. + #[prost(message, repeated, tag = "1")] + pub scope_specifications: ::prost::alloc::vec::Vec, + /// request is a copy of the request that generated these results. + #[prost(message, optional, tag = "98")] + pub request: ::core::option::Option, + /// pagination provides the pagination information of this response. + #[prost(message, optional, tag = "99")] + pub pagination: + ::core::option::Option, +} +/// ContractSpecificationRequest is the request type for the Query/ContractSpecification RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1895,17 +2371,24 @@ pub struct ScopeSpecificationWrapper { response_type = ContractSpecificationResponse )] pub struct ContractSpecificationRequest { + /// specification_id can either be a uuid, e.g. def6bc0a-c9dd-4874-948f-5206e6060a84 or a bech32 contract specification + /// address, e.g. contractspec1q000d0q2e8w5say53afqdesxp2zqzkr4fn. + /// It can also be a record specification address, e.g. + /// recspec1qh00d0q2e8w5say53afqdesxp2zw42dq2jdvmdazuwzcaddhh8gmuqhez44. #[prost(string, tag = "1")] - #[serde(alias = "specificationID")] pub specification_id: ::prost::alloc::string::String, + /// include_record_specs is a flag for whether to include the the record specifications of this contract specification + /// in the response. #[prost(bool, tag = "10")] pub include_record_specs: bool, + /// exclude_id_info is a flag for whether to exclude the id info from the response. #[prost(bool, tag = "12")] - #[serde(alias = "excludeID_info")] pub exclude_id_info: bool, + /// include_request is a flag for whether to include this request in your result. #[prost(bool, tag = "98")] pub include_request: bool, } +/// ContractSpecificationResponse is the response type for the Query/ContractSpecification RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1919,14 +2402,18 @@ pub struct ContractSpecificationRequest { )] #[proto_message(type_url = "/provenance.metadata.v1.ContractSpecificationResponse")] pub struct ContractSpecificationResponse { + /// contract_specification is the wrapped contract specification. #[prost(message, optional, tag = "1")] pub contract_specification: ::core::option::Option, + /// record_specifications is any number or wrapped record specifications associated with this contract_specification + /// (if requested). #[prost(message, repeated, tag = "3")] pub record_specifications: ::prost::alloc::vec::Vec, + /// request is a copy of the request that generated these results. #[prost(message, optional, tag = "98")] pub request: ::core::option::Option, } - +/// ContractSpecificationWrapper contains a single contract specification and some extra identifiers for it. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1940,12 +2427,14 @@ pub struct ContractSpecificationResponse { )] #[proto_message(type_url = "/provenance.metadata.v1.ContractSpecificationWrapper")] pub struct ContractSpecificationWrapper { + /// specification is the on-chain contract specification message. #[prost(message, optional, tag = "1")] pub specification: ::core::option::Option, + /// contract_spec_id_info contains information about the id/address of the contract specification. #[prost(message, optional, tag = "2")] - #[serde(alias = "contract_specID_info")] pub contract_spec_id_info: ::core::option::Option, } +/// ContractSpecificationsAllRequest is the request type for the Query/ContractSpecificationsAll RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1957,23 +2446,84 @@ pub struct ContractSpecificationWrapper { ::schemars::JsonSchema, CosmwasmExt, )] -#[proto_message( - type_url = "/provenance.metadata.v1.RecordSpecificationsForContractSpecificationRequest" -)] +#[proto_message(type_url = "/provenance.metadata.v1.ContractSpecificationsAllRequest")] #[proto_query( - path = "/provenance.metadata.v1.Query/RecordSpecificationsForContractSpecification", - response_type = RecordSpecificationsForContractSpecificationResponse + path = "/provenance.metadata.v1.Query/ContractSpecificationsAll", + response_type = ContractSpecificationsAllResponse )] -pub struct RecordSpecificationsForContractSpecificationRequest { +pub struct ContractSpecificationsAllRequest { + /// exclude_id_info is a flag for whether to exclude the id info from the response. + #[prost(bool, tag = "12")] + pub exclude_id_info: bool, + /// include_request is a flag for whether to include this request in your result. + #[prost(bool, tag = "98")] + pub include_request: bool, + /// pagination defines optional pagination parameters for the request. + #[prost(message, optional, tag = "99")] + pub pagination: + ::core::option::Option, +} +/// ContractSpecificationsAllResponse is the response type for the Query/ContractSpecificationsAll 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 = "/provenance.metadata.v1.ContractSpecificationsAllResponse")] +pub struct ContractSpecificationsAllResponse { + /// contract_specifications are the wrapped contract specifications. + #[prost(message, repeated, tag = "1")] + pub contract_specifications: ::prost::alloc::vec::Vec, + /// request is a copy of the request that generated these results. + #[prost(message, optional, tag = "98")] + pub request: ::core::option::Option, + /// pagination provides the pagination information of this response. + #[prost(message, optional, tag = "99")] + pub pagination: + ::core::option::Option, +} +/// RecordSpecificationsForContractSpecificationRequest is the request type for the +/// Query/RecordSpecificationsForContractSpecification 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 = "/provenance.metadata.v1.RecordSpecificationsForContractSpecificationRequest" +)] +#[proto_query( + path = "/provenance.metadata.v1.Query/RecordSpecificationsForContractSpecification", + response_type = RecordSpecificationsForContractSpecificationResponse +)] +pub struct RecordSpecificationsForContractSpecificationRequest { + /// specification_id can either be a uuid, e.g. def6bc0a-c9dd-4874-948f-5206e6060a84 or a bech32 contract specification + /// address, e.g. contractspec1q000d0q2e8w5say53afqdesxp2zqzkr4fn. + /// It can also be a record specification address, e.g. + /// recspec1qh00d0q2e8w5say53afqdesxp2zw42dq2jdvmdazuwzcaddhh8gmuqhez44. #[prost(string, tag = "1")] - #[serde(alias = "specificationID")] pub specification_id: ::prost::alloc::string::String, + /// exclude_id_info is a flag for whether to exclude the id info from the response. #[prost(bool, tag = "12")] - #[serde(alias = "excludeID_info")] pub exclude_id_info: bool, + /// include_request is a flag for whether to include this request in your result. #[prost(bool, tag = "98")] pub include_request: bool, } +/// RecordSpecificationsForContractSpecificationResponse is the response type for the +/// Query/RecordSpecificationsForContractSpecification RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1989,15 +2539,20 @@ pub struct RecordSpecificationsForContractSpecificationRequest { type_url = "/provenance.metadata.v1.RecordSpecificationsForContractSpecificationResponse" )] pub struct RecordSpecificationsForContractSpecificationResponse { + /// record_specifications is any number of wrapped record specifications associated with this contract_specification. #[prost(message, repeated, tag = "1")] pub record_specifications: ::prost::alloc::vec::Vec, + /// contract_specification_uuid is the uuid of this contract specification. #[prost(string, tag = "2")] pub contract_specification_uuid: ::prost::alloc::string::String, + /// contract_specification_addr is the contract specification address as a bech32 encoded string. #[prost(string, tag = "3")] pub contract_specification_addr: ::prost::alloc::string::String, + /// request is a copy of the request that generated these results. #[prost(message, optional, tag = "98")] pub request: ::core::option::Option, } +/// RecordSpecificationRequest is the request type for the Query/RecordSpecification RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2015,17 +2570,25 @@ pub struct RecordSpecificationsForContractSpecificationResponse { response_type = RecordSpecificationResponse )] pub struct RecordSpecificationRequest { + /// specification_id can either be a uuid, e.g. def6bc0a-c9dd-4874-948f-5206e6060a84 or a bech32 contract specification + /// address, e.g. contractspec1q000d0q2e8w5say53afqdesxp2zqzkr4fn. + /// It can also be a record specification address, e.g. + /// recspec1qh00d0q2e8w5say53afqdesxp2zw42dq2jdvmdazuwzcaddhh8gmuqhez44. #[prost(string, tag = "1")] - #[serde(alias = "specificationID")] pub specification_id: ::prost::alloc::string::String, + /// name is the name of the record to look up. + /// It is required if the specification_id is a uuid or contract specification address. + /// It is ignored if the specification_id is a record specification address. #[prost(string, tag = "2")] pub name: ::prost::alloc::string::String, + /// exclude_id_info is a flag for whether to exclude the id info from the response. #[prost(bool, tag = "12")] - #[serde(alias = "excludeID_info")] pub exclude_id_info: bool, + /// include_request is a flag for whether to include this request in your result. #[prost(bool, tag = "98")] pub include_request: bool, } +/// RecordSpecificationResponse is the response type for the Query/RecordSpecification RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2039,11 +2602,14 @@ pub struct RecordSpecificationRequest { )] #[proto_message(type_url = "/provenance.metadata.v1.RecordSpecificationResponse")] pub struct RecordSpecificationResponse { + /// record_specification is the wrapped record specification. #[prost(message, optional, tag = "1")] pub record_specification: ::core::option::Option, + /// request is a copy of the request that generated these results. #[prost(message, optional, tag = "98")] pub request: ::core::option::Option, } +/// RecordSpecificationWrapper contains a single record specification and some extra identifiers for it. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2057,12 +2623,126 @@ pub struct RecordSpecificationResponse { )] #[proto_message(type_url = "/provenance.metadata.v1.RecordSpecificationWrapper")] pub struct RecordSpecificationWrapper { + /// specification is the on-chain record specification message. #[prost(message, optional, tag = "1")] pub specification: ::core::option::Option, + /// record_spec_id_info contains information about the id/address of the record specification. #[prost(message, optional, tag = "2")] - #[serde(alias = "record_specID_info")] pub record_spec_id_info: ::core::option::Option, } +/// RecordSpecificationsAllRequest is the request type for the Query/RecordSpecificationsAll 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 = "/provenance.metadata.v1.RecordSpecificationsAllRequest")] +#[proto_query( + path = "/provenance.metadata.v1.Query/RecordSpecificationsAll", + response_type = RecordSpecificationsAllResponse +)] +pub struct RecordSpecificationsAllRequest { + /// exclude_id_info is a flag for whether to exclude the id info from the response. + #[prost(bool, tag = "12")] + pub exclude_id_info: bool, + /// include_request is a flag for whether to include this request in your result. + #[prost(bool, tag = "98")] + pub include_request: bool, + /// pagination defines optional pagination parameters for the request. + #[prost(message, optional, tag = "99")] + pub pagination: + ::core::option::Option, +} +/// RecordSpecificationsAllResponse is the response type for the Query/RecordSpecificationsAll 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 = "/provenance.metadata.v1.RecordSpecificationsAllResponse")] +pub struct RecordSpecificationsAllResponse { + /// record_specifications are the wrapped record specifications. + #[prost(message, repeated, tag = "1")] + pub record_specifications: ::prost::alloc::vec::Vec, + /// request is a copy of the request that generated these results. + #[prost(message, optional, tag = "98")] + pub request: ::core::option::Option, + /// pagination provides the pagination information of this response. + #[prost(message, optional, tag = "99")] + pub pagination: + ::core::option::Option, +} +/// GetByAddrRequest is the request type for the Query/GetByAddr 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 = "/provenance.metadata.v1.GetByAddrRequest")] +#[proto_query( + path = "/provenance.metadata.v1.Query/GetByAddr", + response_type = GetByAddrResponse +)] +pub struct GetByAddrRequest { + /// ids are the metadata addresses of the things to look up. + #[prost(string, repeated, tag = "1")] + pub addrs: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// GetByAddrResponse is the response type for the Query/GetByAddr 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 = "/provenance.metadata.v1.GetByAddrResponse")] +pub struct GetByAddrResponse { + /// scopes contains any scopes that were requested and found. + #[prost(message, repeated, tag = "1")] + pub scopes: ::prost::alloc::vec::Vec, + /// sessions contains any sessions that were requested and found. + #[prost(message, repeated, tag = "2")] + pub sessions: ::prost::alloc::vec::Vec, + /// records contains any records that were requested and found. + #[prost(message, repeated, tag = "3")] + pub records: ::prost::alloc::vec::Vec, + /// scope_specs contains any scope specifications that were requested and found. + #[prost(message, repeated, tag = "4")] + pub scope_specs: ::prost::alloc::vec::Vec, + /// contract_specs contains any contract specifications that were requested and found. + #[prost(message, repeated, tag = "5")] + pub contract_specs: ::prost::alloc::vec::Vec, + /// record_specs contains any record specifications that were requested and found. + #[prost(message, repeated, tag = "6")] + pub record_specs: ::prost::alloc::vec::Vec, + /// not_found contains any addrs requested but not found. + #[prost(string, repeated, tag = "7")] + pub not_found: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// OSLocatorParamsRequest is the request type for the Query/OSLocatorParams RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2080,9 +2760,11 @@ pub struct RecordSpecificationWrapper { response_type = OsLocatorParamsResponse )] pub struct OsLocatorParamsRequest { + /// include_request is a flag for whether to include this request in your result. #[prost(bool, tag = "98")] pub include_request: bool, } +/// OSLocatorParamsResponse is the response type for the Query/OSLocatorParams RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2096,11 +2778,14 @@ pub struct OsLocatorParamsRequest { )] #[proto_message(type_url = "/provenance.metadata.v1.OSLocatorParamsResponse")] pub struct OsLocatorParamsResponse { + /// params defines the parameters of the module. #[prost(message, optional, tag = "1")] pub params: ::core::option::Option, + /// request is a copy of the request that generated these results. #[prost(message, optional, tag = "98")] pub request: ::core::option::Option, } +/// OSLocatorRequest is the request type for the Query/OSLocator RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2120,9 +2805,11 @@ pub struct OsLocatorParamsResponse { pub struct OsLocatorRequest { #[prost(string, tag = "1")] pub owner: ::prost::alloc::string::String, + /// include_request is a flag for whether to include this request in your result. #[prost(bool, tag = "98")] pub include_request: bool, } +/// OSLocatorResponse is the response type for the Query/OSLocator RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2138,9 +2825,11 @@ pub struct OsLocatorRequest { pub struct OsLocatorResponse { #[prost(message, optional, tag = "1")] pub locator: ::core::option::Option, + /// request is a copy of the request that generated these results. #[prost(message, optional, tag = "98")] pub request: ::core::option::Option, } +/// OSLocatorsByURIRequest is the request type for the Query/OSLocatorsByURI RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2160,12 +2849,15 @@ pub struct OsLocatorResponse { pub struct OsLocatorsByUriRequest { #[prost(string, tag = "1")] pub uri: ::prost::alloc::string::String, + /// include_request is a flag for whether to include this request in your result. #[prost(bool, tag = "98")] pub include_request: bool, + /// pagination defines optional pagination parameters for the request. #[prost(message, optional, tag = "99")] pub pagination: ::core::option::Option, } +/// OSLocatorsByURIResponse is the response type for the Query/OSLocatorsByURI RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2181,12 +2873,15 @@ pub struct OsLocatorsByUriRequest { pub struct OsLocatorsByUriResponse { #[prost(message, repeated, tag = "1")] pub locators: ::prost::alloc::vec::Vec, + /// request is a copy of the request that generated these results. #[prost(message, optional, tag = "98")] pub request: ::core::option::Option, + /// pagination provides the pagination information of this response. #[prost(message, optional, tag = "99")] pub pagination: ::core::option::Option, } +/// OSLocatorsByScopeRequest is the request type for the Query/OSLocatorsByScope RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2205,11 +2900,12 @@ pub struct OsLocatorsByUriResponse { )] pub struct OsLocatorsByScopeRequest { #[prost(string, tag = "1")] - #[serde(alias = "scopeID")] pub scope_id: ::prost::alloc::string::String, + /// include_request is a flag for whether to include this request in your result. #[prost(bool, tag = "98")] pub include_request: bool, } +/// OSLocatorsByScopeResponse is the response type for the Query/OSLocatorsByScope RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2225,9 +2921,146 @@ pub struct OsLocatorsByScopeRequest { pub struct OsLocatorsByScopeResponse { #[prost(message, repeated, tag = "1")] pub locators: ::prost::alloc::vec::Vec, + /// request is a copy of the request that generated these results. #[prost(message, optional, tag = "98")] pub request: ::core::option::Option, } +/// OSAllLocatorsRequest is the request type for the Query/OSAllLocators 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 = "/provenance.metadata.v1.OSAllLocatorsRequest")] +#[proto_query( + path = "/provenance.metadata.v1.Query/OSAllLocators", + response_type = OsAllLocatorsResponse +)] +pub struct OsAllLocatorsRequest { + /// include_request is a flag for whether to include this request in your result. + #[prost(bool, tag = "98")] + pub include_request: bool, + /// pagination defines optional pagination parameters for the request. + #[prost(message, optional, tag = "99")] + pub pagination: + ::core::option::Option, +} +/// OSAllLocatorsResponse is the response type for the Query/OSAllLocators 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 = "/provenance.metadata.v1.OSAllLocatorsResponse")] +pub struct OsAllLocatorsResponse { + #[prost(message, repeated, tag = "1")] + pub locators: ::prost::alloc::vec::Vec, + /// request is a copy of the request that generated these results. + #[prost(message, optional, tag = "98")] + pub request: ::core::option::Option, + /// pagination provides the pagination information of this response. + #[prost(message, optional, tag = "99")] + pub pagination: + ::core::option::Option, +} +/// AccountDataRequest is the request type for the Query/AccountData 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 = "/provenance.metadata.v1.AccountDataRequest")] +#[proto_query( + path = "/provenance.metadata.v1.Query/AccountData", + response_type = AccountDataResponse +)] +pub struct AccountDataRequest { + /// The metadata address to look up. + /// Currently, only scope ids are supported. + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub metadata_addr: ::prost::alloc::vec::Vec, +} +/// AccountDataResponse is the response type for the Query/AccountData 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 = "/provenance.metadata.v1.AccountDataResponse")] +pub struct AccountDataResponse { + /// The accountdata for the requested metadata address. + #[prost(string, tag = "1")] + pub value: ::prost::alloc::string::String, +} +/// QueryNetAssetValuesRequest is the request type for the Query/NetAssetValues 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 = "/provenance.metadata.v1.QueryScopeNetAssetValuesRequest")] +#[proto_query( + path = "/provenance.metadata.v1.Query/ScopeNetAssetValues", + response_type = QueryScopeNetAssetValuesResponse +)] +pub struct QueryScopeNetAssetValuesRequest { + /// scopeid metadata address + #[prost(string, tag = "1")] + pub id: ::prost::alloc::string::String, +} +/// QueryNetAssetValuesRequest is the response type for the Query/NetAssetValues 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 = "/provenance.metadata.v1.QueryScopeNetAssetValuesResponse")] +pub struct QueryScopeNetAssetValuesResponse { + /// net asset values for scope + #[prost(message, repeated, tag = "1")] + pub net_asset_values: ::prost::alloc::vec::Vec, +} +/// MsgWriteScopeRequest is the request type for the Msg/WriteScope RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2241,14 +3074,26 @@ pub struct OsLocatorsByScopeResponse { )] #[proto_message(type_url = "/provenance.metadata.v1.MsgWriteScopeRequest")] pub struct MsgWriteScopeRequest { + /// scope is the Scope you want added or updated. #[prost(message, optional, tag = "1")] pub scope: ::core::option::Option, + /// signers is the list of address of those signing this request. #[prost(string, repeated, tag = "2")] pub signers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// scope_uuid is an optional uuid string, e.g. "91978ba2-5f35-459a-86a7-feca1b0512e0" + /// If provided, it will be used to generate the MetadataAddress for the scope which will override the scope_id in the + /// provided scope. If not provided (or it is an empty string), nothing special happens. + /// If there is a value in scope.scope_id that is different from the one created from this uuid, an error is returned. #[prost(string, tag = "3")] pub scope_uuid: ::prost::alloc::string::String, + /// spec_uuid is an optional scope specification uuid string, e.g. "dc83ea70-eacd-40fe-9adf-1cf6148bf8a2" + /// If provided, it will be used to generate the MetadataAddress for the scope specification which will override the + /// specification_id in the provided scope. If not provided (or it is an empty string), nothing special happens. + /// If there is a value in scope.specification_id that is different from the one created from this uuid, an error is + /// returned. #[prost(string, tag = "4")] pub spec_uuid: ::prost::alloc::string::String, + /// usd_mills value of scope in usd mills (1234 = $1.234) used for net asset value #[prost(uint64, tag = "5")] #[serde( serialize_with = "crate::serde::as_str::serialize", @@ -2256,6 +3101,7 @@ pub struct MsgWriteScopeRequest { )] pub usd_mills: u64, } +/// MsgWriteScopeResponse is the response type for the Msg/WriteScope RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2269,10 +3115,11 @@ pub struct MsgWriteScopeRequest { )] #[proto_message(type_url = "/provenance.metadata.v1.MsgWriteScopeResponse")] pub struct MsgWriteScopeResponse { + /// scope_id_info contains information about the id/address of the scope that was added or updated. #[prost(message, optional, tag = "1")] - #[serde(alias = "scopeID_info")] pub scope_id_info: ::core::option::Option, } +/// MsgDeleteScopeRequest is the request type for the Msg/DeleteScope RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2286,8 +3133,8 @@ pub struct MsgWriteScopeResponse { )] #[proto_message(type_url = "/provenance.metadata.v1.MsgDeleteScopeRequest")] pub struct MsgDeleteScopeRequest { + /// Unique ID for the scope to delete #[prost(bytes = "vec", tag = "1")] - #[serde(alias = "scopeID")] #[serde( serialize_with = "crate::serde::as_str_bytes::serialize", deserialize_with = "crate::serde::as_str_bytes::deserialize" @@ -2296,6 +3143,7 @@ pub struct MsgDeleteScopeRequest { #[prost(string, repeated, tag = "2")] pub signers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +/// MsgDeleteScopeResponse is the response type for the Msg/DeleteScope RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2309,6 +3157,7 @@ pub struct MsgDeleteScopeRequest { )] #[proto_message(type_url = "/provenance.metadata.v1.MsgDeleteScopeResponse")] pub struct MsgDeleteScopeResponse {} +/// MsgAddScopeDataAccessRequest is the request to add data access AccAddress to scope #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2322,18 +3171,21 @@ pub struct MsgDeleteScopeResponse {} )] #[proto_message(type_url = "/provenance.metadata.v1.MsgAddScopeDataAccessRequest")] pub struct MsgAddScopeDataAccessRequest { + /// scope MetadataAddress for updating data access #[prost(bytes = "vec", tag = "1")] - #[serde(alias = "scopeID")] #[serde( serialize_with = "crate::serde::as_str_bytes::serialize", deserialize_with = "crate::serde::as_str_bytes::deserialize" )] pub scope_id: ::prost::alloc::vec::Vec, + /// AccAddress addresses to be added to scope #[prost(string, repeated, tag = "2")] pub data_access: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// signers is the list of address of those signing this request. #[prost(string, repeated, tag = "3")] pub signers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +/// MsgAddScopeDataAccessResponse is the response for adding data access AccAddress to scope #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2347,6 +3199,7 @@ pub struct MsgAddScopeDataAccessRequest { )] #[proto_message(type_url = "/provenance.metadata.v1.MsgAddScopeDataAccessResponse")] pub struct MsgAddScopeDataAccessResponse {} +/// MsgDeleteScopeDataAccessRequest is the request to remove data access AccAddress to scope #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2360,18 +3213,21 @@ pub struct MsgAddScopeDataAccessResponse {} )] #[proto_message(type_url = "/provenance.metadata.v1.MsgDeleteScopeDataAccessRequest")] pub struct MsgDeleteScopeDataAccessRequest { + /// scope MetadataAddress for removing data access #[prost(bytes = "vec", tag = "1")] - #[serde(alias = "scopeID")] #[serde( serialize_with = "crate::serde::as_str_bytes::serialize", deserialize_with = "crate::serde::as_str_bytes::deserialize" )] pub scope_id: ::prost::alloc::vec::Vec, + /// AccAddress address to be removed from scope #[prost(string, repeated, tag = "2")] pub data_access: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// signers is the list of address of those signing this request. #[prost(string, repeated, tag = "3")] pub signers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +/// MsgDeleteScopeDataAccessResponse is the response from removing data access AccAddress to scope #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2385,6 +3241,7 @@ pub struct MsgDeleteScopeDataAccessRequest { )] #[proto_message(type_url = "/provenance.metadata.v1.MsgDeleteScopeDataAccessResponse")] pub struct MsgDeleteScopeDataAccessResponse {} +/// MsgAddScopeOwnerRequest is the request to add owner AccAddress to scope #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2398,18 +3255,21 @@ pub struct MsgDeleteScopeDataAccessResponse {} )] #[proto_message(type_url = "/provenance.metadata.v1.MsgAddScopeOwnerRequest")] pub struct MsgAddScopeOwnerRequest { + /// scope MetadataAddress for updating data access #[prost(bytes = "vec", tag = "1")] - #[serde(alias = "scopeID")] #[serde( serialize_with = "crate::serde::as_str_bytes::serialize", deserialize_with = "crate::serde::as_str_bytes::deserialize" )] pub scope_id: ::prost::alloc::vec::Vec, + /// owner parties to add to the scope #[prost(message, repeated, tag = "2")] pub owners: ::prost::alloc::vec::Vec, + /// signers is the list of address of those signing this request. #[prost(string, repeated, tag = "3")] pub signers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +/// MsgAddScopeOwnerResponse is the response for adding owner AccAddresses to scope #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2423,6 +3283,7 @@ pub struct MsgAddScopeOwnerRequest { )] #[proto_message(type_url = "/provenance.metadata.v1.MsgAddScopeOwnerResponse")] pub struct MsgAddScopeOwnerResponse {} +/// MsgDeleteScopeOwnerRequest is the request to remove owner AccAddresses to scope #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2436,18 +3297,21 @@ pub struct MsgAddScopeOwnerResponse {} )] #[proto_message(type_url = "/provenance.metadata.v1.MsgDeleteScopeOwnerRequest")] pub struct MsgDeleteScopeOwnerRequest { + /// scope MetadataAddress for removing data access #[prost(bytes = "vec", tag = "1")] - #[serde(alias = "scopeID")] #[serde( serialize_with = "crate::serde::as_str_bytes::serialize", deserialize_with = "crate::serde::as_str_bytes::deserialize" )] pub scope_id: ::prost::alloc::vec::Vec, + /// AccAddress owner addresses to be removed from scope #[prost(string, repeated, tag = "2")] pub owners: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// signers is the list of address of those signing this request. #[prost(string, repeated, tag = "3")] pub signers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +/// MsgDeleteScopeOwnerResponse is the response from removing owner AccAddress to scope #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2461,6 +3325,7 @@ pub struct MsgDeleteScopeOwnerRequest { )] #[proto_message(type_url = "/provenance.metadata.v1.MsgDeleteScopeOwnerResponse")] pub struct MsgDeleteScopeOwnerResponse {} +/// MsgUpdateValueOwnersRequest is the request to update the value owner addresses in one or more scopes. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2474,18 +3339,21 @@ pub struct MsgDeleteScopeOwnerResponse {} )] #[proto_message(type_url = "/provenance.metadata.v1.MsgUpdateValueOwnersRequest")] pub struct MsgUpdateValueOwnersRequest { + /// scope_ids are the scope metadata addresses of all scopes to be updated. #[prost(bytes = "vec", repeated, tag = "1")] - #[serde(alias = "scopeIDs")] #[serde( serialize_with = "crate::serde::as_str_bytes_vec::serialize", deserialize_with = "crate::serde::as_str_bytes_vec::deserialize" )] pub scope_ids: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, + /// value_owner_address is the address of the new value owner for the provided scopes. #[prost(string, tag = "2")] pub value_owner_address: ::prost::alloc::string::String, + /// signers is the list of addresses of those signing this request. #[prost(string, repeated, tag = "3")] pub signers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +/// MsgUpdateValueOwnersResponse is the response from updating value owner addresses in one or more scopes. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2499,6 +3367,7 @@ pub struct MsgUpdateValueOwnersRequest { )] #[proto_message(type_url = "/provenance.metadata.v1.MsgUpdateValueOwnersResponse")] pub struct MsgUpdateValueOwnersResponse {} +/// MsgMigrateValueOwnerRequest is the request to migrate all scopes with one value owner to another value owner. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2512,13 +3381,17 @@ pub struct MsgUpdateValueOwnersResponse {} )] #[proto_message(type_url = "/provenance.metadata.v1.MsgMigrateValueOwnerRequest")] pub struct MsgMigrateValueOwnerRequest { + /// existing is the value owner address that is being migrated. #[prost(string, tag = "1")] pub existing: ::prost::alloc::string::String, + /// proposed is the new value owner address for all of existing's scopes. #[prost(string, tag = "2")] pub proposed: ::prost::alloc::string::String, + /// signers is the list of addresses of those signing this request. #[prost(string, repeated, tag = "3")] pub signers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +/// MsgMigrateValueOwnerResponse is the response from migrating a value owner address. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2532,6 +3405,7 @@ pub struct MsgMigrateValueOwnerRequest { )] #[proto_message(type_url = "/provenance.metadata.v1.MsgMigrateValueOwnerResponse")] pub struct MsgMigrateValueOwnerResponse {} +/// MsgWriteSessionRequest is the request type for the Msg/WriteSession RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2545,16 +3419,29 @@ pub struct MsgMigrateValueOwnerResponse {} )] #[proto_message(type_url = "/provenance.metadata.v1.MsgWriteSessionRequest")] pub struct MsgWriteSessionRequest { + /// session is the Session you want added or updated. #[prost(message, optional, tag = "1")] pub session: ::core::option::Option, + /// signers is the list of address of those signing this request. #[prost(string, repeated, tag = "2")] pub signers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// SessionIDComponents is an optional (alternate) way of defining what the session_id should be in the provided + /// session. If provided, it must have both a scope and session_uuid. Those components will be used to create the + /// MetadataAddress for the session which will override the session_id in the provided session. If not provided (or + /// all empty), nothing special happens. + /// If there is a value in session.session_id that is different from the one created from these components, an error is + /// returned. #[prost(message, optional, tag = "3")] - #[serde(alias = "sessionID_components")] pub session_id_components: ::core::option::Option, + /// spec_uuid is an optional contract specification uuid string, e.g. "def6bc0a-c9dd-4874-948f-5206e6060a84" + /// If provided, it will be used to generate the MetadataAddress for the contract specification which will override the + /// specification_id in the provided session. If not provided (or it is an empty string), nothing special happens. + /// If there is a value in session.specification_id that is different from the one created from this uuid, an error is + /// returned. #[prost(string, tag = "4")] pub spec_uuid: ::prost::alloc::string::String, } +/// SessionIDComponents contains fields for the components that make up a session id. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2568,15 +3455,17 @@ pub struct MsgWriteSessionRequest { )] #[proto_message(type_url = "/provenance.metadata.v1.SessionIdComponents")] pub struct SessionIdComponents { + /// session_uuid is a uuid string for identifying this session, e.g. "5803f8bc-6067-4eb5-951f-2121671c2ec0" #[prost(string, tag = "3")] pub session_uuid: ::prost::alloc::string::String, + /// scope is used to define the scope this session belongs to. #[prost(oneof = "session_id_components::ScopeIdentifier", tags = "1, 2")] - #[serde(alias = "scopeIDentifier")] pub scope_identifier: ::core::option::Option, } /// Nested message and enum types in `SessionIdComponents`. pub mod session_id_components { use provwasm_proc_macro::CosmwasmExt; + /// scope is used to define the scope this session belongs to. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2588,12 +3477,15 @@ pub mod session_id_components { ::schemars::JsonSchema, )] pub enum ScopeIdentifier { + /// scope_uuid is the uuid string for the scope, e.g. "91978ba2-5f35-459a-86a7-feca1b0512e0" #[prost(string, tag = "1")] ScopeUuid(::prost::alloc::string::String), + /// scope_addr is the bech32 address string for the scope, g.g. "scope1qzge0zaztu65tx5x5llv5xc9ztsqxlkwel" #[prost(string, tag = "2")] ScopeAddr(::prost::alloc::string::String), } } +/// MsgWriteSessionResponse is the response type for the Msg/WriteSession RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2607,10 +3499,11 @@ pub mod session_id_components { )] #[proto_message(type_url = "/provenance.metadata.v1.MsgWriteSessionResponse")] pub struct MsgWriteSessionResponse { + /// session_id_info contains information about the id/address of the session that was added or updated. #[prost(message, optional, tag = "1")] - #[serde(alias = "sessionID_info")] pub session_id_info: ::core::option::Option, } +/// MsgWriteRecordRequest is the request type for the Msg/WriteRecord RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2624,18 +3517,34 @@ pub struct MsgWriteSessionResponse { )] #[proto_message(type_url = "/provenance.metadata.v1.MsgWriteRecordRequest")] pub struct MsgWriteRecordRequest { + /// record is the Record you want added or updated. #[prost(message, optional, tag = "1")] pub record: ::core::option::Option, + /// signers is the list of address of those signing this request. #[prost(string, repeated, tag = "2")] pub signers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// SessionIDComponents is an optional (alternate) way of defining what the session_id should be in the provided + /// record. If provided, it must have both a scope and session_uuid. Those components will be used to create the + /// MetadataAddress for the session which will override the session_id in the provided record. If not provided (or + /// all empty), nothing special happens. + /// If there is a value in record.session_id that is different from the one created from these components, an error is + /// returned. #[prost(message, optional, tag = "3")] - #[serde(alias = "sessionID_components")] pub session_id_components: ::core::option::Option, + /// contract_spec_uuid is an optional contract specification uuid string, e.g. "def6bc0a-c9dd-4874-948f-5206e6060a84" + /// If provided, it will be combined with the record name to generate the MetadataAddress for the record specification + /// which will override the specification_id in the provided record. If not provided (or it is an empty string), + /// nothing special happens. + /// If there is a value in record.specification_id that is different from the one created from this uuid and + /// record.name, an error is returned. #[prost(string, tag = "4")] pub contract_spec_uuid: ::prost::alloc::string::String, + /// parties is the list of parties involved with this record. + /// Deprecated: This field is ignored. The parties are identified in the session and as signers. #[prost(message, repeated, tag = "5")] pub parties: ::prost::alloc::vec::Vec, } +/// MsgWriteRecordResponse is the response type for the Msg/WriteRecord RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2649,10 +3558,11 @@ pub struct MsgWriteRecordRequest { )] #[proto_message(type_url = "/provenance.metadata.v1.MsgWriteRecordResponse")] pub struct MsgWriteRecordResponse { + /// record_id_info contains information about the id/address of the record that was added or updated. #[prost(message, optional, tag = "1")] - #[serde(alias = "recordID_info")] pub record_id_info: ::core::option::Option, } +/// MsgDeleteRecordRequest is the request type for the Msg/DeleteRecord RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2667,7 +3577,6 @@ pub struct MsgWriteRecordResponse { #[proto_message(type_url = "/provenance.metadata.v1.MsgDeleteRecordRequest")] pub struct MsgDeleteRecordRequest { #[prost(bytes = "vec", tag = "1")] - #[serde(alias = "recordID")] #[serde( serialize_with = "crate::serde::as_str_bytes::serialize", deserialize_with = "crate::serde::as_str_bytes::deserialize" @@ -2676,6 +3585,7 @@ pub struct MsgDeleteRecordRequest { #[prost(string, repeated, tag = "2")] pub signers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +/// MsgDeleteRecordResponse is the response type for the Msg/DeleteRecord RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2689,6 +3599,7 @@ pub struct MsgDeleteRecordRequest { )] #[proto_message(type_url = "/provenance.metadata.v1.MsgDeleteRecordResponse")] pub struct MsgDeleteRecordResponse {} +/// MsgWriteScopeSpecificationRequest is the request type for the Msg/WriteScopeSpecification RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2702,13 +3613,22 @@ pub struct MsgDeleteRecordResponse {} )] #[proto_message(type_url = "/provenance.metadata.v1.MsgWriteScopeSpecificationRequest")] pub struct MsgWriteScopeSpecificationRequest { + /// specification is the ScopeSpecification you want added or updated. #[prost(message, optional, tag = "1")] pub specification: ::core::option::Option, + /// signers is the list of address of those signing this request. #[prost(string, repeated, tag = "2")] pub signers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// spec_uuid is an optional scope specification uuid string, e.g. "dc83ea70-eacd-40fe-9adf-1cf6148bf8a2" + /// If provided, it will be used to generate the MetadataAddress for the scope specification which will override the + /// specification_id in the provided specification. If not provided (or it is an empty string), nothing special + /// happens. + /// If there is a value in specification.specification_id that is different from the one created from this uuid, an + /// error is returned. #[prost(string, tag = "3")] pub spec_uuid: ::prost::alloc::string::String, } +/// MsgWriteScopeSpecificationResponse is the response type for the Msg/WriteScopeSpecification RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2722,10 +3642,11 @@ pub struct MsgWriteScopeSpecificationRequest { )] #[proto_message(type_url = "/provenance.metadata.v1.MsgWriteScopeSpecificationResponse")] pub struct MsgWriteScopeSpecificationResponse { + /// scope_spec_id_info contains information about the id/address of the scope specification that was added or updated. #[prost(message, optional, tag = "1")] - #[serde(alias = "scope_specID_info")] pub scope_spec_id_info: ::core::option::Option, } +/// MsgDeleteScopeSpecificationRequest is the request type for the Msg/DeleteScopeSpecification RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2739,8 +3660,8 @@ pub struct MsgWriteScopeSpecificationResponse { )] #[proto_message(type_url = "/provenance.metadata.v1.MsgDeleteScopeSpecificationRequest")] pub struct MsgDeleteScopeSpecificationRequest { + /// MetadataAddress for the scope specification to delete. #[prost(bytes = "vec", tag = "1")] - #[serde(alias = "specificationID")] #[serde( serialize_with = "crate::serde::as_str_bytes::serialize", deserialize_with = "crate::serde::as_str_bytes::deserialize" @@ -2749,6 +3670,7 @@ pub struct MsgDeleteScopeSpecificationRequest { #[prost(string, repeated, tag = "2")] pub signers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +/// MsgDeleteScopeSpecificationResponse is the response type for the Msg/DeleteScopeSpecification RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2762,6 +3684,7 @@ pub struct MsgDeleteScopeSpecificationRequest { )] #[proto_message(type_url = "/provenance.metadata.v1.MsgDeleteScopeSpecificationResponse")] pub struct MsgDeleteScopeSpecificationResponse {} +/// MsgWriteContractSpecificationRequest is the request type for the Msg/WriteContractSpecification RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2775,13 +3698,22 @@ pub struct MsgDeleteScopeSpecificationResponse {} )] #[proto_message(type_url = "/provenance.metadata.v1.MsgWriteContractSpecificationRequest")] pub struct MsgWriteContractSpecificationRequest { + /// specification is the ContractSpecification you want added or updated. #[prost(message, optional, tag = "1")] pub specification: ::core::option::Option, + /// signers is the list of address of those signing this request. #[prost(string, repeated, tag = "2")] pub signers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// spec_uuid is an optional contract specification uuid string, e.g. "def6bc0a-c9dd-4874-948f-5206e6060a84" + /// If provided, it will be used to generate the MetadataAddress for the contract specification which will override the + /// specification_id in the provided specification. If not provided (or it is an empty string), nothing special + /// happens. + /// If there is a value in specification.specification_id that is different from the one created from this uuid, an + /// error is returned. #[prost(string, tag = "3")] pub spec_uuid: ::prost::alloc::string::String, } +/// MsgWriteContractSpecificationResponse is the response type for the Msg/WriteContractSpecification RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2795,10 +3727,12 @@ pub struct MsgWriteContractSpecificationRequest { )] #[proto_message(type_url = "/provenance.metadata.v1.MsgWriteContractSpecificationResponse")] pub struct MsgWriteContractSpecificationResponse { + /// contract_spec_id_info contains information about the id/address of the contract specification that was added or + /// updated. #[prost(message, optional, tag = "1")] - #[serde(alias = "contract_specID_info")] pub contract_spec_id_info: ::core::option::Option, } +/// MsgAddContractSpecToScopeSpecRequest is the request type for the Msg/AddContractSpecToScopeSpec RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2812,15 +3746,15 @@ pub struct MsgWriteContractSpecificationResponse { )] #[proto_message(type_url = "/provenance.metadata.v1.MsgAddContractSpecToScopeSpecRequest")] pub struct MsgAddContractSpecToScopeSpecRequest { + /// MetadataAddress for the contract specification to add. #[prost(bytes = "vec", tag = "1")] - #[serde(alias = "contract_specificationID")] #[serde( serialize_with = "crate::serde::as_str_bytes::serialize", deserialize_with = "crate::serde::as_str_bytes::deserialize" )] pub contract_specification_id: ::prost::alloc::vec::Vec, + /// MetadataAddress for the scope specification to add contract specification to. #[prost(bytes = "vec", tag = "2")] - #[serde(alias = "scope_specificationID")] #[serde( serialize_with = "crate::serde::as_str_bytes::serialize", deserialize_with = "crate::serde::as_str_bytes::deserialize" @@ -2829,6 +3763,7 @@ pub struct MsgAddContractSpecToScopeSpecRequest { #[prost(string, repeated, tag = "3")] pub signers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +/// MsgAddContractSpecToScopeSpecResponse is the response type for the Msg/AddContractSpecToScopeSpec RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2842,6 +3777,7 @@ pub struct MsgAddContractSpecToScopeSpecRequest { )] #[proto_message(type_url = "/provenance.metadata.v1.MsgAddContractSpecToScopeSpecResponse")] pub struct MsgAddContractSpecToScopeSpecResponse {} +/// MsgDeleteContractSpecFromScopeSpecRequest is the request type for the Msg/DeleteContractSpecFromScopeSpec RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2855,15 +3791,15 @@ pub struct MsgAddContractSpecToScopeSpecResponse {} )] #[proto_message(type_url = "/provenance.metadata.v1.MsgDeleteContractSpecFromScopeSpecRequest")] pub struct MsgDeleteContractSpecFromScopeSpecRequest { + /// MetadataAddress for the contract specification to add. #[prost(bytes = "vec", tag = "1")] - #[serde(alias = "contract_specificationID")] #[serde( serialize_with = "crate::serde::as_str_bytes::serialize", deserialize_with = "crate::serde::as_str_bytes::deserialize" )] pub contract_specification_id: ::prost::alloc::vec::Vec, + /// MetadataAddress for the scope specification to add contract specification to. #[prost(bytes = "vec", tag = "2")] - #[serde(alias = "scope_specificationID")] #[serde( serialize_with = "crate::serde::as_str_bytes::serialize", deserialize_with = "crate::serde::as_str_bytes::deserialize" @@ -2872,6 +3808,8 @@ pub struct MsgDeleteContractSpecFromScopeSpecRequest { #[prost(string, repeated, tag = "3")] pub signers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +/// MsgDeleteContractSpecFromScopeSpecResponse is the response type for the Msg/DeleteContractSpecFromScopeSpec RPC +/// method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2885,6 +3823,7 @@ pub struct MsgDeleteContractSpecFromScopeSpecRequest { )] #[proto_message(type_url = "/provenance.metadata.v1.MsgDeleteContractSpecFromScopeSpecResponse")] pub struct MsgDeleteContractSpecFromScopeSpecResponse {} +/// MsgDeleteContractSpecificationRequest is the request type for the Msg/DeleteContractSpecification RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2898,8 +3837,8 @@ pub struct MsgDeleteContractSpecFromScopeSpecResponse {} )] #[proto_message(type_url = "/provenance.metadata.v1.MsgDeleteContractSpecificationRequest")] pub struct MsgDeleteContractSpecificationRequest { + /// MetadataAddress for the contract specification to delete. #[prost(bytes = "vec", tag = "1")] - #[serde(alias = "specificationID")] #[serde( serialize_with = "crate::serde::as_str_bytes::serialize", deserialize_with = "crate::serde::as_str_bytes::deserialize" @@ -2908,6 +3847,7 @@ pub struct MsgDeleteContractSpecificationRequest { #[prost(string, repeated, tag = "2")] pub signers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +/// MsgDeleteContractSpecificationResponse is the response type for the Msg/DeleteContractSpecification RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2921,6 +3861,7 @@ pub struct MsgDeleteContractSpecificationRequest { )] #[proto_message(type_url = "/provenance.metadata.v1.MsgDeleteContractSpecificationResponse")] pub struct MsgDeleteContractSpecificationResponse {} +/// MsgWriteRecordSpecificationRequest is the request type for the Msg/WriteRecordSpecification RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2934,13 +3875,22 @@ pub struct MsgDeleteContractSpecificationResponse {} )] #[proto_message(type_url = "/provenance.metadata.v1.MsgWriteRecordSpecificationRequest")] pub struct MsgWriteRecordSpecificationRequest { + /// specification is the RecordSpecification you want added or updated. #[prost(message, optional, tag = "1")] pub specification: ::core::option::Option, + /// signers is the list of address of those signing this request. #[prost(string, repeated, tag = "2")] pub signers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// contract_spec_uuid is an optional contract specification uuid string, e.g. "def6bc0a-c9dd-4874-948f-5206e6060a84" + /// If provided, it will be combined with the record specification name to generate the MetadataAddress for the record + /// specification which will override the specification_id in the provided specification. If not provided (or it is an + /// empty string), nothing special happens. + /// If there is a value in specification.specification_id that is different from the one created from this uuid and + /// specification.name, an error is returned. #[prost(string, tag = "3")] pub contract_spec_uuid: ::prost::alloc::string::String, } +/// MsgWriteRecordSpecificationResponse is the response type for the Msg/WriteRecordSpecification RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2954,10 +3904,12 @@ pub struct MsgWriteRecordSpecificationRequest { )] #[proto_message(type_url = "/provenance.metadata.v1.MsgWriteRecordSpecificationResponse")] pub struct MsgWriteRecordSpecificationResponse { + /// record_spec_id_info contains information about the id/address of the record specification that was added or + /// updated. #[prost(message, optional, tag = "1")] - #[serde(alias = "record_specID_info")] pub record_spec_id_info: ::core::option::Option, } +/// MsgDeleteRecordSpecificationRequest is the request type for the Msg/DeleteRecordSpecification RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2971,8 +3923,8 @@ pub struct MsgWriteRecordSpecificationResponse { )] #[proto_message(type_url = "/provenance.metadata.v1.MsgDeleteRecordSpecificationRequest")] pub struct MsgDeleteRecordSpecificationRequest { + /// MetadataAddress for the record specification to delete. #[prost(bytes = "vec", tag = "1")] - #[serde(alias = "specificationID")] #[serde( serialize_with = "crate::serde::as_str_bytes::serialize", deserialize_with = "crate::serde::as_str_bytes::deserialize" @@ -2981,6 +3933,7 @@ pub struct MsgDeleteRecordSpecificationRequest { #[prost(string, repeated, tag = "2")] pub signers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +/// MsgDeleteRecordSpecificationResponse is the response type for the Msg/DeleteRecordSpecification RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -2994,6 +3947,7 @@ pub struct MsgDeleteRecordSpecificationRequest { )] #[proto_message(type_url = "/provenance.metadata.v1.MsgDeleteRecordSpecificationResponse")] pub struct MsgDeleteRecordSpecificationResponse {} +/// MsgBindOSLocatorRequest is the request type for the Msg/BindOSLocator RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -3007,9 +3961,11 @@ pub struct MsgDeleteRecordSpecificationResponse {} )] #[proto_message(type_url = "/provenance.metadata.v1.MsgBindOSLocatorRequest")] pub struct MsgBindOsLocatorRequest { + /// The object locator to bind the address to bind to the URI. #[prost(message, optional, tag = "1")] pub locator: ::core::option::Option, } +/// MsgBindOSLocatorResponse is the response type for the Msg/BindOSLocator RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -3026,6 +3982,7 @@ pub struct MsgBindOsLocatorResponse { #[prost(message, optional, tag = "1")] pub locator: ::core::option::Option, } +/// MsgDeleteOSLocatorRequest is the request type for the Msg/DeleteOSLocator RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -3039,9 +3996,11 @@ pub struct MsgBindOsLocatorResponse { )] #[proto_message(type_url = "/provenance.metadata.v1.MsgDeleteOSLocatorRequest")] pub struct MsgDeleteOsLocatorRequest { + /// The record being removed #[prost(message, optional, tag = "1")] pub locator: ::core::option::Option, } +/// MsgDeleteOSLocatorResponse is the response type for the Msg/DeleteOSLocator RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -3058,6 +4017,7 @@ pub struct MsgDeleteOsLocatorResponse { #[prost(message, optional, tag = "1")] pub locator: ::core::option::Option, } +/// MsgModifyOSLocatorRequest is the request type for the Msg/ModifyOSLocator RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -3071,9 +4031,11 @@ pub struct MsgDeleteOsLocatorResponse { )] #[proto_message(type_url = "/provenance.metadata.v1.MsgModifyOSLocatorRequest")] pub struct MsgModifyOsLocatorRequest { + /// The object locator to bind the address to bind to the URI. #[prost(message, optional, tag = "1")] pub locator: ::core::option::Option, } +/// MsgModifyOSLocatorResponse is the response type for the Msg/ModifyOSLocator RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -3090,6 +4052,180 @@ pub struct MsgModifyOsLocatorResponse { #[prost(message, optional, tag = "1")] pub locator: ::core::option::Option, } +/// MsgSetAccountDataRequest is the request to set/update/delete a scope's account data. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.metadata.v1.MsgSetAccountDataRequest")] +pub struct MsgSetAccountDataRequest { + /// The identifier to associate the data with. + /// Currently, only scope ids are supported. + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub metadata_addr: ::prost::alloc::vec::Vec, + /// The desired accountdata value. + #[prost(string, tag = "2")] + pub value: ::prost::alloc::string::String, + /// The signers of this message. Must fulfill owner requirements of the scope. + #[prost(string, repeated, tag = "3")] + pub signers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// MsgSetAccountDataResponse is the response from setting/updating/deleting a scope's account data. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.metadata.v1.MsgSetAccountDataResponse")] +pub struct MsgSetAccountDataResponse {} +/// MsgWriteP8eContractSpecRequest has been deprecated and is no longer usable. +/// Deprecated: This message is no longer part of any endpoint and cannot be used for anything. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.metadata.v1.MsgWriteP8eContractSpecRequest")] +#[deprecated] +pub struct MsgWriteP8eContractSpecRequest { + #[prost(message, optional, tag = "1")] + pub contractspec: ::core::option::Option, + #[prost(string, repeated, tag = "2")] + pub signers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// MsgWriteP8eContractSpecResponse has been deprecated and is no longer usable. +/// Deprecated: This message is no longer part of any endpoint and cannot be used for anything. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.metadata.v1.MsgWriteP8eContractSpecResponse")] +#[deprecated] +pub struct MsgWriteP8eContractSpecResponse { + #[prost(message, optional, tag = "1")] + pub contract_spec_id_info: ::core::option::Option, + #[prost(message, repeated, tag = "2")] + pub record_spec_id_infos: ::prost::alloc::vec::Vec, +} +/// MsgP8eMemorializeContractRequest has been deprecated and is no longer usable. +/// Deprecated: This message is no longer part of any endpoint and cannot be used for anything. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.metadata.v1.MsgP8eMemorializeContractRequest")] +#[deprecated] +pub struct MsgP8eMemorializeContractRequest { + #[prost(string, tag = "1")] + pub scope_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub group_id: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub scope_specification_id: ::prost::alloc::string::String, + #[prost(message, optional, tag = "4")] + pub recitals: ::core::option::Option, + #[prost(message, optional, tag = "5")] + pub contract: ::core::option::Option, + #[prost(message, optional, tag = "6")] + pub signatures: ::core::option::Option, + #[prost(string, tag = "7")] + pub invoker: ::prost::alloc::string::String, +} +/// MsgP8eMemorializeContractResponse has been deprecated and is no longer usable. +/// Deprecated: This message is no longer part of any endpoint and cannot be used for anything. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.metadata.v1.MsgP8eMemorializeContractResponse")] +#[deprecated] +pub struct MsgP8eMemorializeContractResponse { + #[prost(message, optional, tag = "1")] + pub scope_id_info: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub session_id_info: ::core::option::Option, + #[prost(message, repeated, tag = "3")] + pub record_id_infos: ::prost::alloc::vec::Vec, +} +/// MsgAddNetAssetValuesRequest defines the Msg/AddNetAssetValues request 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 = "/provenance.metadata.v1.MsgAddNetAssetValuesRequest")] +pub struct MsgAddNetAssetValuesRequest { + #[prost(string, tag = "1")] + pub scope_id: ::prost::alloc::string::String, + #[prost(string, repeated, tag = "2")] + pub signers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[prost(message, repeated, tag = "3")] + pub net_asset_values: ::prost::alloc::vec::Vec, +} +/// MsgAddNetAssetValuesResponse defines the Msg/AddNetAssetValue 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 = "/provenance.metadata.v1.MsgAddNetAssetValuesResponse")] +pub struct MsgAddNetAssetValuesResponse {} pub struct MetadataQuerier<'a, Q: cosmwasm_std::CustomQuery> { querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, } @@ -3124,6 +4260,21 @@ impl<'a, Q: cosmwasm_std::CustomQuery> MetadataQuerier<'a, Q> { } .query(self.querier) } + pub fn scopes_all( + &self, + exclude_id_info: bool, + include_request: bool, + pagination: ::core::option::Option< + super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + ) -> Result { + ScopesAllRequest { + exclude_id_info, + include_request, + pagination, + } + .query(self.querier) + } pub fn sessions( &self, scope_id: ::prost::alloc::string::String, @@ -3147,6 +4298,21 @@ impl<'a, Q: cosmwasm_std::CustomQuery> MetadataQuerier<'a, Q> { } .query(self.querier) } + pub fn sessions_all( + &self, + exclude_id_info: bool, + include_request: bool, + pagination: ::core::option::Option< + super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + ) -> Result { + SessionsAllRequest { + exclude_id_info, + include_request, + pagination, + } + .query(self.querier) + } pub fn records( &self, record_addr: ::prost::alloc::string::String, @@ -3170,6 +4336,21 @@ impl<'a, Q: cosmwasm_std::CustomQuery> MetadataQuerier<'a, Q> { } .query(self.querier) } + pub fn records_all( + &self, + exclude_id_info: bool, + include_request: bool, + pagination: ::core::option::Option< + super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + ) -> Result { + RecordsAllRequest { + exclude_id_info, + include_request, + pagination, + } + .query(self.querier) + } pub fn ownership( &self, address: ::prost::alloc::string::String, @@ -3217,6 +4398,21 @@ impl<'a, Q: cosmwasm_std::CustomQuery> MetadataQuerier<'a, Q> { } .query(self.querier) } + pub fn scope_specifications_all( + &self, + exclude_id_info: bool, + include_request: bool, + pagination: ::core::option::Option< + super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + ) -> Result { + ScopeSpecificationsAllRequest { + exclude_id_info, + include_request, + pagination, + } + .query(self.querier) + } pub fn contract_specification( &self, specification_id: ::prost::alloc::string::String, @@ -3232,6 +4428,21 @@ impl<'a, Q: cosmwasm_std::CustomQuery> MetadataQuerier<'a, Q> { } .query(self.querier) } + pub fn contract_specifications_all( + &self, + exclude_id_info: bool, + include_request: bool, + pagination: ::core::option::Option< + super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + ) -> Result { + ContractSpecificationsAllRequest { + exclude_id_info, + include_request, + pagination, + } + .query(self.querier) + } pub fn record_specifications_for_contract_specification( &self, specification_id: ::prost::alloc::string::String, @@ -3260,6 +4471,27 @@ impl<'a, Q: cosmwasm_std::CustomQuery> MetadataQuerier<'a, Q> { } .query(self.querier) } + pub fn record_specifications_all( + &self, + exclude_id_info: bool, + include_request: bool, + pagination: ::core::option::Option< + super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + ) -> Result { + RecordSpecificationsAllRequest { + exclude_id_info, + include_request, + pagination, + } + .query(self.querier) + } + pub fn get_by_addr( + &self, + addrs: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + ) -> Result { + GetByAddrRequest { addrs }.query(self.querier) + } pub fn os_locator_params( &self, include_request: bool, @@ -3303,4 +4535,29 @@ impl<'a, Q: cosmwasm_std::CustomQuery> MetadataQuerier<'a, Q> { } .query(self.querier) } + pub fn os_all_locators( + &self, + include_request: bool, + pagination: ::core::option::Option< + super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + ) -> Result { + OsAllLocatorsRequest { + include_request, + pagination, + } + .query(self.querier) + } + pub fn account_data( + &self, + metadata_addr: ::prost::alloc::vec::Vec, + ) -> Result { + AccountDataRequest { metadata_addr }.query(self.querier) + } + pub fn scope_net_asset_values( + &self, + id: ::prost::alloc::string::String, + ) -> Result { + QueryScopeNetAssetValuesRequest { id }.query(self.querier) + } } diff --git a/packages/provwasm-std/src/types/provenance/metadata/v1/p8e.rs b/packages/provwasm-std/src/types/provenance/metadata/v1/p8e.rs new file mode 100644 index 00000000..cc989009 --- /dev/null +++ b/packages/provwasm-std/src/types/provenance/metadata/v1/p8e.rs @@ -0,0 +1,727 @@ +use provwasm_proc_macro::CosmwasmExt; +/// Deprecated: Do not use. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.metadata.v1.p8e.Contract")] +#[deprecated] +pub struct Contract { + #[prost(message, optional, tag = "1")] + pub definition: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub spec: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub invoker: ::core::option::Option, + #[prost(message, repeated, tag = "4")] + pub inputs: ::prost::alloc::vec::Vec, + #[deprecated] + #[prost(message, repeated, tag = "5")] + pub conditions: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "6")] + pub considerations: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "7")] + pub recitals: ::prost::alloc::vec::Vec, + #[prost(int32, tag = "8")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub times_executed: i32, + #[prost(message, optional, tag = "9")] + pub start_time: ::core::option::Option, + #[prost(bytes = "vec", tag = "10")] + #[serde( + serialize_with = "crate::serde::as_str_bytes::serialize", + deserialize_with = "crate::serde::as_str_bytes::deserialize" + )] + pub context: ::prost::alloc::vec::Vec, +} +/// Deprecated: Do not use. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.metadata.v1.p8e.DefinitionSpec")] +#[deprecated] +pub struct DefinitionSpec { + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub resource_location: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub signature: ::core::option::Option, + #[prost(enumeration = "DefinitionSpecType", tag = "4")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub r#type: i32, +} +/// Deprecated: Do not use. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.metadata.v1.p8e.Fact")] +#[deprecated] +pub struct Fact { + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub data_location: ::core::option::Option, +} +/// Deprecated: Do not use. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.metadata.v1.p8e.Condition")] +#[deprecated] +pub struct Condition { + #[prost(string, tag = "1")] + pub condition_name: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub result: ::core::option::Option, +} +/// Deprecated: Do not use. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.metadata.v1.p8e.Consideration")] +#[deprecated] +pub struct Consideration { + #[prost(string, tag = "1")] + pub consideration_name: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] + pub inputs: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "3")] + pub result: ::core::option::Option, +} +/// Deprecated: Do not use. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.metadata.v1.p8e.ProposedFact")] +#[deprecated] +pub struct ProposedFact { + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub hash: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub classname: ::prost::alloc::string::String, + #[prost(message, optional, tag = "4")] + pub ancestor: ::core::option::Option, +} +/// Deprecated: Do not use. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.metadata.v1.p8e.ExecutionResult")] +#[deprecated] +pub struct ExecutionResult { + #[prost(message, optional, tag = "1")] + pub output: ::core::option::Option, + #[prost(enumeration = "ExecutionResultType", tag = "2")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub result: i32, + #[prost(message, optional, tag = "3")] + pub recorded_at: ::core::option::Option, + #[prost(string, tag = "4")] + pub error_message: ::prost::alloc::string::String, +} +/// Deprecated: Do not use. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.metadata.v1.p8e.Recitals")] +#[deprecated] +pub struct Recitals { + #[prost(message, repeated, tag = "1")] + pub parties: ::prost::alloc::vec::Vec, +} +/// Deprecated: Do not use. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.metadata.v1.p8e.Recital")] +#[deprecated] +pub struct Recital { + #[prost(enumeration = "PartyType", tag = "1")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub signer_role: i32, + #[prost(message, optional, tag = "2")] + pub signer: ::core::option::Option, + #[prost(bytes = "vec", tag = "3")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub address: ::prost::alloc::vec::Vec, +} +/// Deprecated: Do not use. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.metadata.v1.p8e.Location")] +#[deprecated] +pub struct Location { + #[prost(message, optional, tag = "1")] + pub r#ref: ::core::option::Option, + #[prost(string, tag = "2")] + pub classname: ::prost::alloc::string::String, +} +/// Deprecated: Do not use. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.metadata.v1.p8e.ProvenanceReference")] +#[deprecated] +pub struct ProvenanceReference { + #[prost(message, optional, tag = "1")] + pub scope_uuid: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub group_uuid: ::core::option::Option, + #[prost(string, tag = "3")] + pub hash: ::prost::alloc::string::String, + #[prost(string, tag = "4")] + pub name: ::prost::alloc::string::String, +} +/// Deprecated: Do not use. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.metadata.v1.p8e.SignatureSet")] +#[deprecated] +pub struct SignatureSet { + #[prost(message, repeated, tag = "1")] + pub signatures: ::prost::alloc::vec::Vec, +} +/// Deprecated: Do not use. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.metadata.v1.p8e.Signature")] +#[deprecated] +pub struct Signature { + #[prost(string, tag = "1")] + pub algo: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub provider: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub signature: ::prost::alloc::string::String, + #[prost(message, optional, tag = "4")] + pub signer: ::core::option::Option, +} +/// Deprecated: Do not use. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.metadata.v1.p8e.SigningAndEncryptionPublicKeys")] +#[deprecated] +pub struct SigningAndEncryptionPublicKeys { + #[prost(message, optional, tag = "1")] + pub signing_public_key: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub encryption_public_key: ::core::option::Option, +} +/// Deprecated: Do not use. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.metadata.v1.p8e.PublicKey")] +#[deprecated] +pub struct PublicKey { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub public_key_bytes: ::prost::alloc::vec::Vec, + #[prost(enumeration = "PublicKeyType", tag = "2")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub r#type: i32, + #[prost(enumeration = "PublicKeyCurve", tag = "3")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub curve: i32, +} +/// Deprecated: Do not use. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.metadata.v1.p8e.UUID")] +#[deprecated] +pub struct Uuid { + #[prost(string, tag = "1")] + pub value: ::prost::alloc::string::String, +} +/// Deprecated: Do not use. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.metadata.v1.p8e.Timestamp")] +#[deprecated] +pub struct Timestamp { + #[prost(int64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub seconds: i64, + #[prost(int32, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub nanos: i32, +} +/// Deprecated: Do not use. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.metadata.v1.p8e.ContractSpec")] +#[deprecated] +pub struct ContractSpec { + #[prost(message, optional, tag = "1")] + pub definition: ::core::option::Option, + #[prost(message, repeated, tag = "2")] + pub input_specs: ::prost::alloc::vec::Vec, + #[prost(enumeration = "PartyType", repeated, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub parties_involved: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "4")] + pub condition_specs: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "5")] + pub consideration_specs: ::prost::alloc::vec::Vec, +} +/// Deprecated: Do not use. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.metadata.v1.p8e.ConditionSpec")] +#[deprecated] +pub struct ConditionSpec { + #[prost(string, tag = "1")] + pub func_name: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] + pub input_specs: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "3")] + pub output_spec: ::core::option::Option, +} +/// Deprecated: Do not use. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.metadata.v1.p8e.ConsiderationSpec")] +#[deprecated] +pub struct ConsiderationSpec { + #[prost(string, tag = "1")] + pub func_name: ::prost::alloc::string::String, + #[prost(enumeration = "PartyType", tag = "2")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub responsible_party: i32, + #[prost(message, repeated, tag = "3")] + pub input_specs: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "4")] + pub output_spec: ::core::option::Option, +} +/// Deprecated: Do not use. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.metadata.v1.p8e.OutputSpec")] +#[deprecated] +pub struct OutputSpec { + #[prost(message, optional, tag = "1")] + pub spec: ::core::option::Option, +} +/// Deprecated: Do not use. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[deprecated] +pub enum DefinitionSpecType { + /// Deprecated: Do not use. + Unknown = 0, + /// Deprecated: Do not use. + Proposed = 1, + /// Deprecated: Do not use. + Fact = 2, + /// Deprecated: Do not use. + FactList = 3, +} +impl DefinitionSpecType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + DefinitionSpecType::Unknown => "DEFINITION_SPEC_TYPE_UNKNOWN", + DefinitionSpecType::Proposed => "DEFINITION_SPEC_TYPE_PROPOSED", + DefinitionSpecType::Fact => "DEFINITION_SPEC_TYPE_FACT", + DefinitionSpecType::FactList => "DEFINITION_SPEC_TYPE_FACT_LIST", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "DEFINITION_SPEC_TYPE_UNKNOWN" => Some(Self::Unknown), + "DEFINITION_SPEC_TYPE_PROPOSED" => Some(Self::Proposed), + "DEFINITION_SPEC_TYPE_FACT" => Some(Self::Fact), + "DEFINITION_SPEC_TYPE_FACT_LIST" => Some(Self::FactList), + _ => None, + } + } +} +/// Deprecated: Do not use. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[deprecated] +pub enum PublicKeyCurve { + /// Deprecated: Do not use. + Secp256k1 = 0, + /// Deprecated: Do not use. + P256 = 1, +} +impl PublicKeyCurve { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + PublicKeyCurve::Secp256k1 => "SECP256K1", + PublicKeyCurve::P256 => "P256", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "SECP256K1" => Some(Self::Secp256k1), + "P256" => Some(Self::P256), + _ => None, + } + } +} +/// Deprecated: Do not use. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[deprecated] +pub enum PublicKeyType { + /// Deprecated: Do not use. + Elliptic = 0, +} +impl PublicKeyType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + PublicKeyType::Elliptic => "ELLIPTIC", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "ELLIPTIC" => Some(Self::Elliptic), + _ => None, + } + } +} +/// Deprecated: Do not use. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[deprecated] +pub enum ExecutionResultType { + /// Deprecated: Do not use. + ResultTypeUnknown = 0, + /// Deprecated: Do not use. + ResultTypePass = 1, + /// Deprecated: Do not use. + ResultTypeSkip = 2, + /// Deprecated: Do not use. + ResultTypeFail = 3, +} +impl ExecutionResultType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + ExecutionResultType::ResultTypeUnknown => "RESULT_TYPE_UNKNOWN", + ExecutionResultType::ResultTypePass => "RESULT_TYPE_PASS", + ExecutionResultType::ResultTypeSkip => "RESULT_TYPE_SKIP", + ExecutionResultType::ResultTypeFail => "RESULT_TYPE_FAIL", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "RESULT_TYPE_UNKNOWN" => Some(Self::ResultTypeUnknown), + "RESULT_TYPE_PASS" => Some(Self::ResultTypePass), + "RESULT_TYPE_SKIP" => Some(Self::ResultTypeSkip), + "RESULT_TYPE_FAIL" => Some(Self::ResultTypeFail), + _ => None, + } + } +} +/// Deprecated: Do not use. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[deprecated] +pub enum PartyType { + /// Deprecated: Do not use. + Unknown = 0, + /// Deprecated: Do not use. + Originator = 1, + /// Deprecated: Do not use. + Servicer = 2, + /// Deprecated: Do not use. + Investor = 3, + /// Deprecated: Do not use. + Custodian = 4, + /// Deprecated: Do not use. + Owner = 5, + /// Deprecated: Do not use. + Affiliate = 6, + /// Deprecated: Do not use. + Omnibus = 7, + /// Deprecated: Do not use. + Provenance = 8, + /// Deprecated: Do not use. + Marker = 9, + /// Deprecated: Do not use. + Controller = 10, + /// Deprecated: Do not use. + Validator = 11, +} +impl PartyType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + PartyType::Unknown => "PARTY_TYPE_UNKNOWN", + PartyType::Originator => "PARTY_TYPE_ORIGINATOR", + PartyType::Servicer => "PARTY_TYPE_SERVICER", + PartyType::Investor => "PARTY_TYPE_INVESTOR", + PartyType::Custodian => "PARTY_TYPE_CUSTODIAN", + PartyType::Owner => "PARTY_TYPE_OWNER", + PartyType::Affiliate => "PARTY_TYPE_AFFILIATE", + PartyType::Omnibus => "PARTY_TYPE_OMNIBUS", + PartyType::Provenance => "PARTY_TYPE_PROVENANCE", + PartyType::Marker => "PARTY_TYPE_MARKER", + PartyType::Controller => "PARTY_TYPE_CONTROLLER", + PartyType::Validator => "PARTY_TYPE_VALIDATOR", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "PARTY_TYPE_UNKNOWN" => Some(Self::Unknown), + "PARTY_TYPE_ORIGINATOR" => Some(Self::Originator), + "PARTY_TYPE_SERVICER" => Some(Self::Servicer), + "PARTY_TYPE_INVESTOR" => Some(Self::Investor), + "PARTY_TYPE_CUSTODIAN" => Some(Self::Custodian), + "PARTY_TYPE_OWNER" => Some(Self::Owner), + "PARTY_TYPE_AFFILIATE" => Some(Self::Affiliate), + "PARTY_TYPE_OMNIBUS" => Some(Self::Omnibus), + "PARTY_TYPE_PROVENANCE" => Some(Self::Provenance), + "PARTY_TYPE_MARKER" => Some(Self::Marker), + "PARTY_TYPE_CONTROLLER" => Some(Self::Controller), + "PARTY_TYPE_VALIDATOR" => Some(Self::Validator), + _ => None, + } + } +} diff --git a/packages/provwasm-std/src/types/provenance/mod.rs b/packages/provwasm-std/src/types/provenance/mod.rs index 357b640d..8ee0d80e 100644 --- a/packages/provwasm-std/src/types/provenance/mod.rs +++ b/packages/provwasm-std/src/types/provenance/mod.rs @@ -1,9 +1,11 @@ pub mod attribute; pub mod exchange; pub mod hold; +pub mod ibchooks; +pub mod ibcratelimit; pub mod marker; pub mod metadata; pub mod msgfees; pub mod name; -pub mod reward; +pub mod oracle; pub mod trigger; diff --git a/packages/provwasm-std/src/types/provenance/msgfees/v1.rs b/packages/provwasm-std/src/types/provenance/msgfees/v1.rs index 1ec633c2..254919e0 100644 --- a/packages/provwasm-std/src/types/provenance/msgfees/v1.rs +++ b/packages/provwasm-std/src/types/provenance/msgfees/v1.rs @@ -1,4 +1,5 @@ use provwasm_proc_macro::CosmwasmExt; +/// Params defines the set of params for the msgfees module. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -12,13 +13,29 @@ use provwasm_proc_macro::CosmwasmExt; )] #[proto_message(type_url = "/provenance.msgfees.v1.Params")] pub struct Params { + /// floor_gas_price is the constant used to calculate fees when gas fees shares denom with msg fee. + /// + /// Conversions: + /// - x nhash/usd-mil = 1,000,000/x usd/hash + /// - y usd/hash = 1,000,000/y nhash/usd-mil + /// + /// Examples: + /// - 40,000,000 nhash/usd-mil = 1,000,000/40,000,000 usd/hash = $0.025/hash, + /// - $0.040/hash = 1,000,000/0.040 nhash/usd-mil = 25,000,000 nhash/usd-mil #[prost(message, optional, tag = "2")] pub floor_gas_price: ::core::option::Option, + /// nhash_per_usd_mil is the total nhash per usd mil for converting usd to nhash. #[prost(uint64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] pub nhash_per_usd_mil: u64, + /// conversion_fee_denom is the denom usd is converted to. #[prost(string, tag = "4")] pub conversion_fee_denom: ::prost::alloc::string::String, } +/// MsgFee is the core of what gets stored on the blockchain to define a msg-based fee. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -32,12 +49,23 @@ pub struct Params { )] #[proto_message(type_url = "/provenance.msgfees.v1.MsgFee")] pub struct MsgFee { + /// msg_type_url is the type-url of the message with the added fee, e.g. "/cosmos.bank.v1beta1.MsgSend". #[prost(string, tag = "1")] pub msg_type_url: ::prost::alloc::string::String, + /// additional_fee is the extra fee that is required for the given message type (can be in any denom). #[prost(message, optional, tag = "2")] pub additional_fee: ::core::option::Option, + /// recipient is an option address that will receive a portion of the additional fee. + /// There can only be a recipient if the recipient_basis_points is not zero. #[prost(string, tag = "3")] pub recipient: ::prost::alloc::string::String, + /// recipient_basis_points is an optional portion of the additional fee to be sent to the recipient. + /// Must be between 0 and 10,000 (inclusive). + /// + /// If there is a recipient, this must not be zero. If there is not a recipient, this must be zero. + /// + /// The recipient will receive additional_fee * recipient_basis_points / 10,000. + /// The fee collector will receive the rest, i.e. additional_fee * (10,000 - recipient_basis_points) / 10,000. #[prost(uint32, tag = "4")] #[serde( serialize_with = "crate::serde::as_str::serialize", @@ -45,6 +73,7 @@ pub struct MsgFee { )] pub recipient_basis_points: u32, } +/// EventMsgFee final event property for msg fee on type #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -67,6 +96,7 @@ pub struct EventMsgFee { #[prost(string, tag = "4")] pub recipient: ::prost::alloc::string::String, } +/// EventMsgFees event emitted with summary of msg fees #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -83,6 +113,190 @@ pub struct EventMsgFees { #[prost(message, repeated, tag = "1")] pub msg_fees: ::prost::alloc::vec::Vec, } +/// GenesisState contains a set of msg fees, 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 = "/provenance.msgfees.v1.GenesisState")] +pub struct GenesisState { + /// params defines all the parameters of the module. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, + /// msg_based_fees are the additional fees on specific tx msgs + #[prost(message, repeated, tag = "2")] + pub msg_fees: ::prost::alloc::vec::Vec, +} +/// AddMsgFeeProposal defines a governance proposal to add additional msg based fee +/// Deprecated: This message is no longer usable. It is only still included for +/// backwards compatibility (e.g. looking up old governance proposals). +/// It is replaced by providing a MsgAddMsgFeeProposalRequest in a governance proposal. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.msgfees.v1.AddMsgFeeProposal")] +#[deprecated] +pub struct AddMsgFeeProposal { + /// propsal title + #[prost(string, tag = "1")] + pub title: ::prost::alloc::string::String, + /// propsal description + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + /// type url of msg to add fee + #[prost(string, tag = "3")] + pub msg_type_url: ::prost::alloc::string::String, + /// additional fee for msg type + #[prost(message, optional, tag = "4")] + pub additional_fee: ::core::option::Option, + /// optional recipient to recieve basis points + #[prost(string, tag = "5")] + pub recipient: ::prost::alloc::string::String, + /// basis points to use when recipient is present (1 - 10,000) + #[prost(string, tag = "6")] + pub recipient_basis_points: ::prost::alloc::string::String, +} +/// UpdateMsgFeeProposal defines a governance proposal to update a current msg based fee +/// Deprecated: This message is no longer usable. It is only still included for +/// backwards compatibility (e.g. looking up old governance proposals). +/// It is replaced by providing a MsgUpdateMsgFeeProposalRequest in a governance proposal. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.msgfees.v1.UpdateMsgFeeProposal")] +#[deprecated] +pub struct UpdateMsgFeeProposal { + /// propsal title + #[prost(string, tag = "1")] + pub title: ::prost::alloc::string::String, + /// propsal description + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + /// type url of msg to update fee + #[prost(string, tag = "3")] + pub msg_type_url: ::prost::alloc::string::String, + /// additional fee for msg type + #[prost(message, optional, tag = "4")] + pub additional_fee: ::core::option::Option, + /// optional recipient to recieve basis points + #[prost(string, tag = "5")] + pub recipient: ::prost::alloc::string::String, + /// basis points to use when recipient is present (1 - 10,000) + #[prost(string, tag = "6")] + pub recipient_basis_points: ::prost::alloc::string::String, +} +/// RemoveMsgFeeProposal defines a governance proposal to delete a current msg based fee +/// Deprecated: This message is no longer usable. It is only still included for +/// backwards compatibility (e.g. looking up old governance proposals). +/// It is replaced by providing a MsgRemoveMsgFeeProposalRequest in a governance proposal. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.msgfees.v1.RemoveMsgFeeProposal")] +#[deprecated] +pub struct RemoveMsgFeeProposal { + /// propsal title + #[prost(string, tag = "1")] + pub title: ::prost::alloc::string::String, + /// propsal description + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + /// type url of msg fee to remove + #[prost(string, tag = "3")] + pub msg_type_url: ::prost::alloc::string::String, +} +/// UpdateNhashPerUsdMilProposal defines a governance proposal to update the nhash per usd mil param +/// Deprecated: This message is no longer usable. It is only still included for +/// backwards compatibility (e.g. looking up old governance proposals). +/// It is replaced by providing a MsgUpdateNhashPerUsdMilProposalRequest in a governance proposal. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.msgfees.v1.UpdateNhashPerUsdMilProposal")] +#[deprecated] +pub struct UpdateNhashPerUsdMilProposal { + /// proposal title + #[prost(string, tag = "1")] + pub title: ::prost::alloc::string::String, + /// proposal description + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + /// nhash_per_usd_mil is number of nhash per usd mil + #[prost(uint64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub nhash_per_usd_mil: u64, +} +/// UpdateConversionFeeDenomProposal defines a governance proposal to update the msg fee conversion denom +/// Deprecated: This message is no longer usable. It is only still included for +/// backwards compatibility (e.g. looking up old governance proposals). +/// It is replaced by providing a MsgUpdateConversionFeeDenomProposalRequest in a governance proposal. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.msgfees.v1.UpdateConversionFeeDenomProposal")] +#[deprecated] +pub struct UpdateConversionFeeDenomProposal { + /// proposal title + #[prost(string, tag = "1")] + pub title: ::prost::alloc::string::String, + /// proposal description + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + /// conversion_fee_denom is the denom that usd will be converted to + #[prost(string, tag = "4")] + pub conversion_fee_denom: ::prost::alloc::string::String, +} +/// QueryParamsRequest is the request type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -100,6 +314,7 @@ pub struct EventMsgFees { response_type = QueryParamsResponse )] pub struct QueryParamsRequest {} +/// QueryParamsResponse is the response type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -113,9 +328,11 @@ pub struct QueryParamsRequest {} )] #[proto_message(type_url = "/provenance.msgfees.v1.QueryParamsResponse")] pub struct QueryParamsResponse { + /// params defines the parameters of the module. #[prost(message, optional, tag = "1")] pub params: ::core::option::Option, } +/// QueryAllMsgFeesRequest queries all Msg which have fees associated with them. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -133,10 +350,12 @@ pub struct QueryParamsResponse { response_type = QueryAllMsgFeesResponse )] pub struct QueryAllMsgFeesRequest { + /// pagination defines an optional pagination for the request. #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } +/// response for querying all msg's with fees associated with them #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -152,10 +371,12 @@ pub struct QueryAllMsgFeesRequest { pub struct QueryAllMsgFeesResponse { #[prost(message, repeated, tag = "1")] pub msg_fees: ::prost::alloc::vec::Vec, + /// pagination defines an optional pagination for the request. #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } +/// MsgAssessCustomMsgFeeRequest defines an sdk.Msg type #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -169,17 +390,23 @@ pub struct QueryAllMsgFeesResponse { )] #[proto_message(type_url = "/provenance.msgfees.v1.MsgAssessCustomMsgFeeRequest")] pub struct MsgAssessCustomMsgFeeRequest { + /// optional short name for custom msg fee, this will be emitted as a property of the event #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, + /// amount of additional fee that must be paid #[prost(message, optional, tag = "2")] pub amount: ::core::option::Option, + /// optional recipient address, the basis points amount is sent to the recipient #[prost(string, tag = "3")] pub recipient: ::prost::alloc::string::String, + /// the signer of the msg #[prost(string, tag = "4")] pub from: ::prost::alloc::string::String, + /// optional basis points 0 - 10,000 for recipient defaults to 10,000 #[prost(string, tag = "5")] pub recipient_basis_points: ::prost::alloc::string::String, } +/// MsgAssessCustomMsgFeeResponse defines the Msg/AssessCustomMsgFeee response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -193,6 +420,209 @@ pub struct MsgAssessCustomMsgFeeRequest { )] #[proto_message(type_url = "/provenance.msgfees.v1.MsgAssessCustomMsgFeeResponse")] pub struct MsgAssessCustomMsgFeeResponse {} +/// AddMsgFeeProposal defines a governance proposal to add additional msg based fee +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.msgfees.v1.MsgAddMsgFeeProposalRequest")] +pub struct MsgAddMsgFeeProposalRequest { + /// type url of msg to add fee + #[prost(string, tag = "1")] + pub msg_type_url: ::prost::alloc::string::String, + /// additional fee for msg type + #[prost(message, optional, tag = "2")] + pub additional_fee: ::core::option::Option, + /// optional recipient to receive basis points + #[prost(string, tag = "3")] + pub recipient: ::prost::alloc::string::String, + /// basis points to use when recipient is present (1 - 10,000) + #[prost(string, tag = "4")] + pub recipient_basis_points: ::prost::alloc::string::String, + /// the signing authority for the proposal + #[prost(string, tag = "5")] + pub authority: ::prost::alloc::string::String, +} +/// MsgAddMsgFeeProposalResponse defines the Msg/AddMsgFeeProposal 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 = "/provenance.msgfees.v1.MsgAddMsgFeeProposalResponse")] +pub struct MsgAddMsgFeeProposalResponse {} +/// UpdateMsgFeeProposal defines a governance proposal to update a current msg based fee +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.msgfees.v1.MsgUpdateMsgFeeProposalRequest")] +pub struct MsgUpdateMsgFeeProposalRequest { + /// type url of msg to update fee + #[prost(string, tag = "1")] + pub msg_type_url: ::prost::alloc::string::String, + /// additional fee for msg type + #[prost(message, optional, tag = "2")] + pub additional_fee: ::core::option::Option, + /// optional recipient to receive basis points + #[prost(string, tag = "3")] + pub recipient: ::prost::alloc::string::String, + /// basis points to use when recipient is present (1 - 10,000) + #[prost(string, tag = "4")] + pub recipient_basis_points: ::prost::alloc::string::String, + /// the signing authority for the proposal + #[prost(string, tag = "5")] + pub authority: ::prost::alloc::string::String, +} +/// MsgUpdateMsgFeeProposalResponse defines the Msg/RemoveMsgFeeProposal 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 = "/provenance.msgfees.v1.MsgUpdateMsgFeeProposalResponse")] +pub struct MsgUpdateMsgFeeProposalResponse {} +/// RemoveMsgFeeProposal defines a governance proposal to delete a current msg based fee +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.msgfees.v1.MsgRemoveMsgFeeProposalRequest")] +pub struct MsgRemoveMsgFeeProposalRequest { + /// type url of msg fee to remove + #[prost(string, tag = "1")] + pub msg_type_url: ::prost::alloc::string::String, + /// the signing authority for the proposal + /// + /// + #[prost(string, tag = "2")] + pub authority: ::prost::alloc::string::String, +} +/// MsgRemoveMsgFeeProposalResponse defines the Msg/RemoveMsgFeeProposal 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 = "/provenance.msgfees.v1.MsgRemoveMsgFeeProposalResponse")] +pub struct MsgRemoveMsgFeeProposalResponse {} +/// UpdateNhashPerUsdMilProposal defines a governance proposal to update the nhash per usd mil param +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.msgfees.v1.MsgUpdateNhashPerUsdMilProposalRequest")] +pub struct MsgUpdateNhashPerUsdMilProposalRequest { + /// nhash_per_usd_mil is number of nhash per usd mil + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub nhash_per_usd_mil: u64, + /// the signing authority for the proposal + /// + /// + #[prost(string, tag = "2")] + pub authority: ::prost::alloc::string::String, +} +/// MsgUpdateNhashPerUsdMilProposalResponse defines the Msg/UpdateNhashPerUsdMilProposal 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 = "/provenance.msgfees.v1.MsgUpdateNhashPerUsdMilProposalResponse")] +pub struct MsgUpdateNhashPerUsdMilProposalResponse {} +/// UpdateConversionFeeDenomProposal defines a governance proposal to update the msg fee conversion denom +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.msgfees.v1.MsgUpdateConversionFeeDenomProposalRequest")] +pub struct MsgUpdateConversionFeeDenomProposalRequest { + /// conversion_fee_denom is the denom that usd will be converted to + #[prost(string, tag = "1")] + pub conversion_fee_denom: ::prost::alloc::string::String, + /// the signing authority for the proposal + /// + /// + #[prost(string, tag = "2")] + pub authority: ::prost::alloc::string::String, +} +/// MsgUpdateConversionFeeDenomProposalResponse defines the Msg/UpdateConversionFeeDenomProposal 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 = "/provenance.msgfees.v1.MsgUpdateConversionFeeDenomProposalResponse")] +pub struct MsgUpdateConversionFeeDenomProposalResponse {} pub struct MsgfeesQuerier<'a, Q: cosmwasm_std::CustomQuery> { querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, } diff --git a/packages/provwasm-std/src/types/provenance/name/v1.rs b/packages/provwasm-std/src/types/provenance/name/v1.rs index 04f5699a..ae0ba559 100644 --- a/packages/provwasm-std/src/types/provenance/name/v1.rs +++ b/packages/provwasm-std/src/types/provenance/name/v1.rs @@ -1,4 +1,5 @@ use provwasm_proc_macro::CosmwasmExt; +/// Params defines the set of params for the name module. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -12,15 +13,32 @@ use provwasm_proc_macro::CosmwasmExt; )] #[proto_message(type_url = "/provenance.name.v1.Params")] pub struct Params { + /// maximum length of name segment to allow #[prost(uint32, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] pub max_segment_length: u32, + /// minimum length of name segment to allow #[prost(uint32, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] pub min_segment_length: u32, + /// maximum number of name segments to allow. Example: `foo.bar.baz` would be 3 #[prost(uint32, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] pub max_name_levels: u32, + /// determines if unrestricted name keys are allowed or not #[prost(bool, tag = "4")] pub allow_unrestricted_names: bool, } +/// NameRecord is a structure used to bind ownership of a name hierarchy to a collection of addresses #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -34,13 +52,21 @@ pub struct Params { )] #[proto_message(type_url = "/provenance.name.v1.NameRecord")] pub struct NameRecord { + /// the bound name #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, + /// the address the name resolved to #[prost(string, tag = "2")] pub address: ::prost::alloc::string::String, + /// whether owner signature is required to add sub-names #[prost(bool, tag = "3")] pub restricted: bool, } +/// CreateRootNameProposal details a proposal to create a new root name +/// that is controlled by a given owner and optionally restricted to the owner +/// for the sole creation of sub names. +/// Deprecated: This legacy proposal is deprecated in favor of Msg-based gov +/// proposals, see MsgCreateRootNameRequest. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -53,18 +79,25 @@ pub struct NameRecord { CosmwasmExt, )] #[proto_message(type_url = "/provenance.name.v1.CreateRootNameProposal")] +#[deprecated] pub struct CreateRootNameProposal { + /// proposal title #[prost(string, tag = "1")] pub title: ::prost::alloc::string::String, + /// proposal description #[prost(string, tag = "2")] pub description: ::prost::alloc::string::String, + /// the bound name #[prost(string, tag = "3")] pub name: ::prost::alloc::string::String, + /// the address the name will resolve to #[prost(string, tag = "4")] pub owner: ::prost::alloc::string::String, + /// a flag that indicates if an owner signature is required to add sub-names #[prost(bool, tag = "5")] pub restricted: bool, } +/// Event emitted when name is bound. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -85,6 +118,7 @@ pub struct EventNameBound { #[prost(bool, tag = "3")] pub restricted: bool, } +/// Event emitted when name is unbound. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -105,6 +139,7 @@ pub struct EventNameUnbound { #[prost(bool, tag = "3")] pub restricted: bool, } +/// Event emitted when name is updated. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -125,6 +160,51 @@ pub struct EventNameUpdate { #[prost(bool, tag = "3")] pub restricted: bool, } +/// EventNameParamsUpdated event emitted when name params are updated. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.name.v1.EventNameParamsUpdated")] +pub struct EventNameParamsUpdated { + #[prost(string, tag = "1")] + pub allow_unrestricted_names: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub max_name_levels: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub min_segment_length: ::prost::alloc::string::String, + #[prost(string, tag = "4")] + pub max_segment_length: ::prost::alloc::string::String, +} +/// GenesisState defines the name module's genesis state. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.name.v1.GenesisState")] +pub struct GenesisState { + /// params defines all the parameters of the module. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, + /// bindings defines all the name records present at genesis + #[prost(message, repeated, tag = "2")] + pub bindings: ::prost::alloc::vec::Vec, +} +/// QueryParamsRequest is the request type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -142,6 +222,7 @@ pub struct EventNameUpdate { response_type = QueryParamsResponse )] pub struct QueryParamsRequest {} +/// QueryParamsResponse is the response type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -155,9 +236,11 @@ pub struct QueryParamsRequest {} )] #[proto_message(type_url = "/provenance.name.v1.QueryParamsResponse")] pub struct QueryParamsResponse { + /// params defines the parameters of the module. #[prost(message, optional, tag = "1")] pub params: ::core::option::Option, } +/// QueryResolveRequest is the request type for the Query/Resolve method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -175,9 +258,11 @@ pub struct QueryParamsResponse { response_type = QueryResolveResponse )] pub struct QueryResolveRequest { + /// name to resolve the address for #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, } +/// QueryResolveResponse is the response type for the Query/Resolve method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -191,11 +276,14 @@ pub struct QueryResolveRequest { )] #[proto_message(type_url = "/provenance.name.v1.QueryResolveResponse")] pub struct QueryResolveResponse { + /// a string containing the address the name resolves to #[prost(string, tag = "1")] pub address: ::prost::alloc::string::String, + /// Whether owner signature is required to add sub-names. #[prost(bool, tag = "2")] pub restricted: bool, } +/// QueryReverseLookupRequest is the request type for the Query/ReverseLookup method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -213,12 +301,15 @@ pub struct QueryResolveResponse { response_type = QueryReverseLookupResponse )] pub struct QueryReverseLookupRequest { + /// address to find name records for #[prost(string, tag = "1")] pub address: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } +/// QueryReverseLookupResponse is the response type for the Query/Resolve method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -232,12 +323,17 @@ pub struct QueryReverseLookupRequest { )] #[proto_message(type_url = "/provenance.name.v1.QueryReverseLookupResponse")] pub struct QueryReverseLookupResponse { + /// an array of names bound against a given address #[prost(string, repeated, tag = "1")] pub name: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// pagination defines an optional pagination for the request. #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } +/// MsgBindNameRequest defines an sdk.Msg type that is used to add an address/name binding under an optional parent name. +/// The record may optionally be restricted to prevent additional names from being added under this one without the +/// owner signing the request. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -251,11 +347,14 @@ pub struct QueryReverseLookupResponse { )] #[proto_message(type_url = "/provenance.name.v1.MsgBindNameRequest")] pub struct MsgBindNameRequest { + /// The parent record to bind this name under. #[prost(message, optional, tag = "1")] pub parent: ::core::option::Option, + /// The name record to bind under the parent #[prost(message, optional, tag = "2")] pub record: ::core::option::Option, } +/// MsgBindNameResponse defines the Msg/BindName response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -269,6 +368,9 @@ pub struct MsgBindNameRequest { )] #[proto_message(type_url = "/provenance.name.v1.MsgBindNameResponse")] pub struct MsgBindNameResponse {} +/// MsgDeleteNameRequest defines an sdk.Msg type that is used to remove an existing address/name binding. The binding +/// may not have any child names currently bound for this request to be successful. All associated attributes on account +/// addresses will be deleted. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -282,9 +384,11 @@ pub struct MsgBindNameResponse {} )] #[proto_message(type_url = "/provenance.name.v1.MsgDeleteNameRequest")] pub struct MsgDeleteNameRequest { + /// The record being removed #[prost(message, optional, tag = "1")] pub record: ::core::option::Option, } +/// MsgDeleteNameResponse defines the Msg/DeleteName response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -298,6 +402,9 @@ pub struct MsgDeleteNameRequest { )] #[proto_message(type_url = "/provenance.name.v1.MsgDeleteNameResponse")] pub struct MsgDeleteNameResponse {} +/// MsgCreateRootNameRequest defines an sdk.Msg type to create a new root name +/// that is controlled by a given owner and optionally restricted to the owner +/// for the sole creation of sub names. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -311,11 +418,14 @@ pub struct MsgDeleteNameResponse {} )] #[proto_message(type_url = "/provenance.name.v1.MsgCreateRootNameRequest")] pub struct MsgCreateRootNameRequest { + /// The signing authority for the request #[prost(string, tag = "1")] pub authority: ::prost::alloc::string::String, + /// NameRecord is a structure used to bind ownership of a name hierarchy to a collection of addresses #[prost(message, optional, tag = "2")] pub record: ::core::option::Option, } +/// MsgCreateRootNameResponse defines Msg/CreateRootName response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -329,6 +439,7 @@ pub struct MsgCreateRootNameRequest { )] #[proto_message(type_url = "/provenance.name.v1.MsgCreateRootNameResponse")] pub struct MsgCreateRootNameResponse {} +/// MsgModifyNameRequest defines a governance method that is used to update an existing address/name binding. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -342,11 +453,14 @@ pub struct MsgCreateRootNameResponse {} )] #[proto_message(type_url = "/provenance.name.v1.MsgModifyNameRequest")] pub struct MsgModifyNameRequest { + /// The address signing the message #[prost(string, tag = "1")] pub authority: ::prost::alloc::string::String, + /// The record being updated #[prost(message, optional, tag = "2")] pub record: ::core::option::Option, } +/// MsgModifyNameResponse defines the Msg/ModifyName response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -360,6 +474,41 @@ pub struct MsgModifyNameRequest { )] #[proto_message(type_url = "/provenance.name.v1.MsgModifyNameResponse")] pub struct MsgModifyNameResponse {} +/// MsgUpdateParamsRequest is a request message for the UpdateParams endpoint. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.name.v1.MsgUpdateParamsRequest")] +pub struct MsgUpdateParamsRequest { + /// authority should be the governance module account address. + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// params are the new param values to set. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +/// MsgUpdateParamsResponse is a response message for the UpdateParams endpoint. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.name.v1.MsgUpdateParamsResponse")] +pub struct MsgUpdateParamsResponse {} pub struct NameQuerier<'a, Q: cosmwasm_std::CustomQuery> { querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, } diff --git a/packages/provwasm-std/src/types/provenance/oracle/v1.rs b/packages/provwasm-std/src/types/provenance/oracle/v1.rs index 2ac18a45..aa664364 100644 --- a/packages/provwasm-std/src/types/provenance/oracle/v1.rs +++ b/packages/provwasm-std/src/types/provenance/oracle/v1.rs @@ -1,4 +1,95 @@ use provwasm_proc_macro::CosmwasmExt; +/// EventOracleQuerySuccess is an event for when the chain receives a successful response from an oracle query +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.oracle.v1.EventOracleQuerySuccess")] +pub struct EventOracleQuerySuccess { + /// channel is the local channel that the oracle query response was received from + #[prost(string, tag = "1")] + pub channel: ::prost::alloc::string::String, + /// sequence_id is a unique identifier of the query + #[prost(string, tag = "2")] + pub sequence_id: ::prost::alloc::string::String, + /// result is the data received from the query + #[prost(string, tag = "3")] + pub result: ::prost::alloc::string::String, +} +/// EventOracleQueryError is an event for when the chain receives an error response from an oracle query +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.oracle.v1.EventOracleQueryError")] +pub struct EventOracleQueryError { + /// channel is the local channel that the oracle query response was received from + #[prost(string, tag = "1")] + pub channel: ::prost::alloc::string::String, + /// sequence_id is a unique identifier of the query + #[prost(string, tag = "2")] + pub sequence_id: ::prost::alloc::string::String, + /// error is the error message received from the query + #[prost(string, tag = "3")] + pub error: ::prost::alloc::string::String, +} +/// EventOracleQueryTimeout is an event for when the chain receives a timeout from an oracle query +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.oracle.v1.EventOracleQueryTimeout")] +pub struct EventOracleQueryTimeout { + /// channel is the local channel that the oracle timeout was received from + #[prost(string, tag = "1")] + pub channel: ::prost::alloc::string::String, + /// sequence_id is a unique identifier of the query + #[prost(string, tag = "2")] + pub sequence_id: ::prost::alloc::string::String, +} +/// GenesisState defines the oracle module's genesis state. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.oracle.v1.GenesisState")] +pub struct GenesisState { + /// The port to assign to the module + #[prost(string, tag = "2")] + pub port_id: ::prost::alloc::string::String, + /// The address of the oracle + #[prost(string, tag = "3")] + pub oracle: ::prost::alloc::string::String, +} +/// QueryOracleAddressRequest queries for the address of the oracle. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -16,6 +107,7 @@ use provwasm_proc_macro::CosmwasmExt; response_type = QueryOracleAddressResponse )] pub struct QueryOracleAddressRequest {} +/// QueryOracleAddressResponse contains the address of the oracle. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -29,9 +121,11 @@ pub struct QueryOracleAddressRequest {} )] #[proto_message(type_url = "/provenance.oracle.v1.QueryOracleAddressResponse")] pub struct QueryOracleAddressResponse { + /// The address of the oracle #[prost(string, tag = "1")] pub address: ::prost::alloc::string::String, } +/// QueryOracleRequest queries the module's oracle. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -49,6 +143,7 @@ pub struct QueryOracleAddressResponse { response_type = QueryOracleResponse )] pub struct QueryOracleRequest { + /// Query contains the query data passed to the oracle. #[prost(bytes = "vec", tag = "1")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", @@ -56,6 +151,7 @@ pub struct QueryOracleRequest { )] pub query: ::prost::alloc::vec::Vec, } +/// QueryOracleResponse contains the result of the query sent to the oracle. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -69,6 +165,7 @@ pub struct QueryOracleRequest { )] #[proto_message(type_url = "/provenance.oracle.v1.QueryOracleResponse")] pub struct QueryOracleResponse { + /// Data contains the json data returned from the oracle. #[prost(bytes = "vec", tag = "1")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", @@ -76,6 +173,7 @@ pub struct QueryOracleResponse { )] pub data: ::prost::alloc::vec::Vec, } +/// MsgSendQueryOracleRequest queries an oracle on another chain #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -89,17 +187,21 @@ pub struct QueryOracleResponse { )] #[proto_message(type_url = "/provenance.oracle.v1.MsgSendQueryOracleRequest")] pub struct MsgSendQueryOracleRequest { + /// Query contains the query data passed to the oracle. #[prost(bytes = "vec", tag = "1")] #[serde( serialize_with = "crate::serde::as_base64_encoded_string::serialize", deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" )] pub query: ::prost::alloc::vec::Vec, + /// Channel is the channel to the oracle. #[prost(string, tag = "3")] pub channel: ::prost::alloc::string::String, + /// The signing authority for the request #[prost(string, tag = "4")] pub authority: ::prost::alloc::string::String, } +/// MsgSendQueryOracleResponse contains the id of the oracle query. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -113,6 +215,7 @@ pub struct MsgSendQueryOracleRequest { )] #[proto_message(type_url = "/provenance.oracle.v1.MsgSendQueryOracleResponse")] pub struct MsgSendQueryOracleResponse { + /// The sequence number that uniquely identifies the query. #[prost(uint64, tag = "1")] #[serde( serialize_with = "crate::serde::as_str::serialize", @@ -120,6 +223,7 @@ pub struct MsgSendQueryOracleResponse { )] pub sequence: u64, } +/// MsgUpdateOracleRequest is the request type for updating an oracle's contract address #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -133,11 +237,14 @@ pub struct MsgSendQueryOracleResponse { )] #[proto_message(type_url = "/provenance.oracle.v1.MsgUpdateOracleRequest")] pub struct MsgUpdateOracleRequest { + /// The address of the oracle's contract #[prost(string, tag = "1")] pub address: ::prost::alloc::string::String, + /// The signing authorities for the request #[prost(string, tag = "2")] pub authority: ::prost::alloc::string::String, } +/// MsgUpdateOracleResponse is the response type for updating the oracle. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, diff --git a/packages/provwasm-std/src/types/provenance/reward/mod.rs b/packages/provwasm-std/src/types/provenance/reward/mod.rs deleted file mode 100644 index a3a6d96c..00000000 --- a/packages/provwasm-std/src/types/provenance/reward/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod v1; diff --git a/packages/provwasm-std/src/types/provenance/reward/v1.rs b/packages/provwasm-std/src/types/provenance/reward/v1.rs deleted file mode 100644 index dca63fe5..00000000 --- a/packages/provwasm-std/src/types/provenance/reward/v1.rs +++ /dev/null @@ -1,1105 +0,0 @@ -use provwasm_proc_macro::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 = "/provenance.reward.v1.RewardProgram")] -pub struct RewardProgram { - #[prost(uint64, tag = "1")] - #[serde(alias = "ID")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub id: u64, - #[prost(string, tag = "2")] - pub title: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub description: ::prost::alloc::string::String, - #[prost(string, tag = "4")] - pub distribute_from_address: ::prost::alloc::string::String, - #[prost(message, optional, tag = "5")] - pub total_reward_pool: ::core::option::Option, - #[prost(message, optional, tag = "6")] - pub remaining_pool_balance: - ::core::option::Option, - #[prost(message, optional, tag = "7")] - pub claimed_amount: ::core::option::Option, - #[prost(message, optional, tag = "8")] - pub max_reward_by_address: - ::core::option::Option, - #[prost(message, optional, tag = "9")] - pub minimum_rollover_amount: - ::core::option::Option, - #[prost(uint64, tag = "10")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub claim_period_seconds: u64, - #[prost(message, optional, tag = "11")] - pub program_start_time: ::core::option::Option, - #[prost(message, optional, tag = "12")] - pub expected_program_end_time: ::core::option::Option, - #[prost(message, optional, tag = "13")] - pub program_end_time_max: ::core::option::Option, - #[prost(message, optional, tag = "14")] - pub claim_period_end_time: ::core::option::Option, - #[prost(message, optional, tag = "15")] - pub actual_program_end_time: ::core::option::Option, - #[prost(uint64, tag = "16")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub claim_periods: u64, - #[prost(uint64, tag = "17")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub current_claim_period: u64, - #[prost(uint64, tag = "18")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub max_rollover_claim_periods: u64, - #[prost(enumeration = "reward_program::State", tag = "19")] - #[serde( - serialize_with = "reward_program::State::serialize", - deserialize_with = "reward_program::State::deserialize" - )] - pub state: i32, - #[prost(uint64, tag = "20")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub expiration_offset: u64, - #[prost(message, repeated, tag = "21")] - pub qualifying_actions: ::prost::alloc::vec::Vec, -} -/// Nested message and enum types in `RewardProgram`. -pub mod reward_program { - use provwasm_proc_macro::CosmwasmExt; - #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] - #[repr(i32)] - #[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] - pub enum State { - Unspecified = 0, - Pending = 1, - Started = 2, - Finished = 3, - Expired = 4, - } - impl State { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - State::Unspecified => "STATE_UNSPECIFIED", - State::Pending => "STATE_PENDING", - State::Started => "STATE_STARTED", - State::Finished => "STATE_FINISHED", - State::Expired => "STATE_EXPIRED", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "STATE_UNSPECIFIED" => Some(Self::Unspecified), - "STATE_PENDING" => Some(Self::Pending), - "STATE_STARTED" => Some(Self::Started), - "STATE_FINISHED" => Some(Self::Finished), - "STATE_EXPIRED" => Some(Self::Expired), - _ => None, - } - } - - pub fn serialize(v: &i32, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - let enum_value = Self::try_from(*v); - match enum_value { - Ok(v) => serializer.serialize_str(v.as_str_name()), - Err(e) => Err(serde::ser::Error::custom(e)), - } - } - - pub fn deserialize<'de, D>(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - use serde::de::Deserialize; - let s = String::deserialize(deserializer)?; - match Self::from_str_name(&s) { - Some(v) => Ok(v.into()), - None => Err(serde::de::Error::custom("unknown value")), - } - } - } -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.reward.v1.ClaimPeriodRewardDistribution")] -pub struct ClaimPeriodRewardDistribution { - #[prost(uint64, tag = "1")] - #[serde(alias = "claim_periodID")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub claim_period_id: u64, - #[prost(uint64, tag = "2")] - #[serde(alias = "reward_programID")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub reward_program_id: u64, - #[prost(message, optional, tag = "3")] - pub total_rewards_pool_for_claim_period: - ::core::option::Option, - #[prost(message, optional, tag = "4")] - pub rewards_pool: ::core::option::Option, - #[prost(int64, tag = "5")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub total_shares: i64, - #[prost(bool, tag = "6")] - pub claim_period_ended: bool, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.reward.v1.RewardAccountState")] -pub struct RewardAccountState { - #[prost(uint64, tag = "1")] - #[serde(alias = "reward_programID")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub reward_program_id: u64, - #[prost(uint64, tag = "2")] - #[serde(alias = "claim_periodID")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub claim_period_id: u64, - #[prost(string, tag = "3")] - pub address: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "4")] - pub action_counter: ::prost::alloc::vec::Vec, - #[prost(uint64, tag = "5")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub shares_earned: u64, - #[prost(enumeration = "reward_account_state::ClaimStatus", tag = "6")] - #[serde( - serialize_with = "reward_account_state::ClaimStatus::serialize", - deserialize_with = "reward_account_state::ClaimStatus::deserialize" - )] - pub claim_status: i32, -} -/// Nested message and enum types in `RewardAccountState`. -pub mod reward_account_state { - use provwasm_proc_macro::CosmwasmExt; - #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] - #[repr(i32)] - #[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] - pub enum ClaimStatus { - Unspecified = 0, - Unclaimable = 1, - Claimable = 2, - Claimed = 3, - Expired = 4, - } - impl ClaimStatus { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - ClaimStatus::Unspecified => "CLAIM_STATUS_UNSPECIFIED", - ClaimStatus::Unclaimable => "CLAIM_STATUS_UNCLAIMABLE", - ClaimStatus::Claimable => "CLAIM_STATUS_CLAIMABLE", - ClaimStatus::Claimed => "CLAIM_STATUS_CLAIMED", - ClaimStatus::Expired => "CLAIM_STATUS_EXPIRED", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "CLAIM_STATUS_UNSPECIFIED" => Some(Self::Unspecified), - "CLAIM_STATUS_UNCLAIMABLE" => Some(Self::Unclaimable), - "CLAIM_STATUS_CLAIMABLE" => Some(Self::Claimable), - "CLAIM_STATUS_CLAIMED" => Some(Self::Claimed), - "CLAIM_STATUS_EXPIRED" => Some(Self::Expired), - _ => None, - } - } - - pub fn serialize(v: &i32, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - let enum_value = Self::try_from(*v); - match enum_value { - Ok(v) => serializer.serialize_str(v.as_str_name()), - Err(e) => Err(serde::ser::Error::custom(e)), - } - } - - pub fn deserialize<'de, D>(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - use serde::de::Deserialize; - let s = String::deserialize(deserializer)?; - match Self::from_str_name(&s) { - Some(v) => Ok(v.into()), - None => Err(serde::de::Error::custom("unknown value")), - } - } - } -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.reward.v1.QualifyingAction")] -pub struct QualifyingAction { - #[prost(oneof = "qualifying_action::Type", tags = "1, 2, 3")] - pub r#type: ::core::option::Option, -} -/// Nested message and enum types in `QualifyingAction`. -pub mod qualifying_action { - use provwasm_proc_macro::CosmwasmExt; - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive( - Clone, - PartialEq, - Eq, - ::prost::Oneof, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - )] - pub enum Type { - #[prost(message, tag = "1")] - Delegate(super::ActionDelegate), - #[prost(message, tag = "2")] - Transfer(super::ActionTransfer), - #[prost(message, tag = "3")] - Vote(super::ActionVote), - } -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.reward.v1.QualifyingActions")] -pub struct QualifyingActions { - #[prost(message, repeated, tag = "1")] - pub qualifying_actions: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.reward.v1.ActionDelegate")] -pub struct ActionDelegate { - #[prost(uint64, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub minimum_actions: u64, - #[prost(uint64, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub maximum_actions: u64, - #[prost(message, optional, tag = "3")] - pub minimum_delegation_amount: - ::core::option::Option, - #[prost(message, optional, tag = "4")] - pub maximum_delegation_amount: - ::core::option::Option, - #[prost(string, tag = "5")] - pub minimum_active_stake_percentile: ::prost::alloc::string::String, - #[prost(string, tag = "6")] - pub maximum_active_stake_percentile: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.reward.v1.ActionTransfer")] -pub struct ActionTransfer { - #[prost(uint64, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub minimum_actions: u64, - #[prost(uint64, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub maximum_actions: u64, - #[prost(message, optional, tag = "3")] - pub minimum_delegation_amount: - ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.reward.v1.ActionVote")] -pub struct ActionVote { - #[prost(uint64, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub minimum_actions: u64, - #[prost(uint64, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub maximum_actions: u64, - #[prost(message, optional, tag = "3")] - pub minimum_delegation_amount: - ::core::option::Option, - #[prost(uint64, tag = "4")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub validator_multiplier: u64, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.reward.v1.ActionCounter")] -pub struct ActionCounter { - #[prost(string, tag = "1")] - pub action_type: ::prost::alloc::string::String, - #[prost(uint64, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub number_of_actions: u64, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.reward.v1.QueryRewardProgramByIDRequest")] -#[proto_query( - path = "/provenance.reward.v1.Query/RewardProgramByID", - response_type = QueryRewardProgramByIdResponse -)] -pub struct QueryRewardProgramByIdRequest { - #[prost(uint64, tag = "1")] - #[serde(alias = "ID")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub id: u64, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.reward.v1.QueryRewardProgramByIDResponse")] -pub struct QueryRewardProgramByIdResponse { - #[prost(message, optional, tag = "1")] - pub reward_program: ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.reward.v1.QueryRewardProgramsRequest")] -#[proto_query( - path = "/provenance.reward.v1.Query/RewardPrograms", - response_type = QueryRewardProgramsResponse -)] -pub struct QueryRewardProgramsRequest { - #[prost(enumeration = "query_reward_programs_request::QueryType", tag = "1")] - #[serde( - serialize_with = "query_reward_programs_request::QueryType::serialize", - deserialize_with = "query_reward_programs_request::QueryType::deserialize" - )] - pub query_type: i32, - #[prost(message, optional, tag = "99")] - pub pagination: - ::core::option::Option, -} -/// Nested message and enum types in `QueryRewardProgramsRequest`. -pub mod query_reward_programs_request { - use provwasm_proc_macro::CosmwasmExt; - #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] - #[repr(i32)] - #[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] - pub enum QueryType { - Unspecified = 0, - All = 1, - Pending = 2, - Active = 3, - Outstanding = 4, - Finished = 5, - } - impl QueryType { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - QueryType::Unspecified => "QUERY_TYPE_UNSPECIFIED", - QueryType::All => "QUERY_TYPE_ALL", - QueryType::Pending => "QUERY_TYPE_PENDING", - QueryType::Active => "QUERY_TYPE_ACTIVE", - QueryType::Outstanding => "QUERY_TYPE_OUTSTANDING", - QueryType::Finished => "QUERY_TYPE_FINISHED", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "QUERY_TYPE_UNSPECIFIED" => Some(Self::Unspecified), - "QUERY_TYPE_ALL" => Some(Self::All), - "QUERY_TYPE_PENDING" => Some(Self::Pending), - "QUERY_TYPE_ACTIVE" => Some(Self::Active), - "QUERY_TYPE_OUTSTANDING" => Some(Self::Outstanding), - "QUERY_TYPE_FINISHED" => Some(Self::Finished), - _ => None, - } - } - - pub fn serialize(v: &i32, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - let enum_value = Self::try_from(*v); - match enum_value { - Ok(v) => serializer.serialize_str(v.as_str_name()), - Err(e) => Err(serde::ser::Error::custom(e)), - } - } - - pub fn deserialize<'de, D>(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - use serde::de::Deserialize; - let s = String::deserialize(deserializer)?; - match Self::from_str_name(&s) { - Some(v) => Ok(v.into()), - None => Err(serde::de::Error::custom("unknown value")), - } - } - } -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.reward.v1.QueryRewardProgramsResponse")] -pub struct QueryRewardProgramsResponse { - #[prost(message, repeated, tag = "1")] - pub reward_programs: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "99")] - pub pagination: - ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.reward.v1.QueryClaimPeriodRewardDistributionsRequest")] -#[proto_query( - path = "/provenance.reward.v1.Query/ClaimPeriodRewardDistributions", - response_type = QueryClaimPeriodRewardDistributionsResponse -)] -pub struct QueryClaimPeriodRewardDistributionsRequest { - #[prost(message, optional, tag = "99")] - pub pagination: - ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.reward.v1.QueryClaimPeriodRewardDistributionsResponse")] -pub struct QueryClaimPeriodRewardDistributionsResponse { - #[prost(message, repeated, tag = "1")] - pub claim_period_reward_distributions: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "99")] - pub pagination: - ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.reward.v1.QueryClaimPeriodRewardDistributionsByIDRequest")] -#[proto_query( - path = "/provenance.reward.v1.Query/ClaimPeriodRewardDistributionsByID", - response_type = QueryClaimPeriodRewardDistributionsByIdResponse -)] -pub struct QueryClaimPeriodRewardDistributionsByIdRequest { - #[prost(uint64, tag = "1")] - #[serde(alias = "rewardID")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub reward_id: u64, - #[prost(uint64, tag = "2")] - #[serde(alias = "claim_periodID")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub claim_period_id: u64, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.reward.v1.QueryClaimPeriodRewardDistributionsByIDResponse")] -pub struct QueryClaimPeriodRewardDistributionsByIdResponse { - #[prost(message, optional, tag = "1")] - pub claim_period_reward_distribution: ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.reward.v1.QueryRewardDistributionsByAddressRequest")] -#[proto_query( - path = "/provenance.reward.v1.Query/RewardDistributionsByAddress", - response_type = QueryRewardDistributionsByAddressResponse -)] -pub struct QueryRewardDistributionsByAddressRequest { - #[prost(string, tag = "1")] - pub address: ::prost::alloc::string::String, - #[prost(enumeration = "reward_account_state::ClaimStatus", tag = "2")] - #[serde( - serialize_with = "reward_account_state::ClaimStatus::serialize", - deserialize_with = "reward_account_state::ClaimStatus::deserialize" - )] - pub claim_status: i32, - #[prost(message, optional, tag = "99")] - pub pagination: - ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.reward.v1.QueryRewardDistributionsByAddressResponse")] -pub struct QueryRewardDistributionsByAddressResponse { - #[prost(string, tag = "1")] - pub address: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "2")] - pub reward_account_state: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "99")] - pub pagination: - ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.reward.v1.RewardAccountResponse")] -pub struct RewardAccountResponse { - #[prost(uint64, tag = "1")] - #[serde(alias = "reward_programID")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub reward_program_id: u64, - #[prost(message, optional, tag = "2")] - pub total_reward_claim: - ::core::option::Option, - #[prost(enumeration = "reward_account_state::ClaimStatus", tag = "3")] - #[serde( - serialize_with = "reward_account_state::ClaimStatus::serialize", - deserialize_with = "reward_account_state::ClaimStatus::deserialize" - )] - pub claim_status: i32, - #[prost(uint64, tag = "4")] - #[serde(alias = "claimID")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub claim_id: u64, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.reward.v1.MsgCreateRewardProgramRequest")] -pub struct MsgCreateRewardProgramRequest { - #[prost(string, tag = "1")] - pub title: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub description: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub distribute_from_address: ::prost::alloc::string::String, - #[prost(message, optional, tag = "4")] - pub total_reward_pool: ::core::option::Option, - #[prost(message, optional, tag = "5")] - pub max_reward_per_claim_address: - ::core::option::Option, - #[prost(message, optional, tag = "6")] - pub program_start_time: ::core::option::Option, - #[prost(uint64, tag = "7")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub claim_periods: u64, - #[prost(uint64, tag = "8")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub claim_period_days: u64, - #[prost(uint64, tag = "9")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub max_rollover_claim_periods: u64, - #[prost(uint64, tag = "10")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub expire_days: u64, - #[prost(message, repeated, tag = "11")] - pub qualifying_actions: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.reward.v1.MsgCreateRewardProgramResponse")] -pub struct MsgCreateRewardProgramResponse { - #[prost(uint64, tag = "1")] - #[serde(alias = "ID")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub id: u64, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.reward.v1.MsgEndRewardProgramRequest")] -pub struct MsgEndRewardProgramRequest { - #[prost(uint64, tag = "1")] - #[serde(alias = "reward_programID")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub reward_program_id: u64, - #[prost(string, tag = "2")] - pub program_owner_address: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.reward.v1.MsgEndRewardProgramResponse")] -pub struct MsgEndRewardProgramResponse {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.reward.v1.MsgClaimRewardsRequest")] -pub struct MsgClaimRewardsRequest { - #[prost(uint64, tag = "1")] - #[serde(alias = "reward_programID")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub reward_program_id: u64, - #[prost(string, tag = "2")] - pub reward_address: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.reward.v1.MsgClaimRewardsResponse")] -pub struct MsgClaimRewardsResponse { - #[prost(message, optional, tag = "1")] - pub claim_details: ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.reward.v1.MsgClaimAllRewardsRequest")] -pub struct MsgClaimAllRewardsRequest { - #[prost(string, tag = "1")] - pub reward_address: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.reward.v1.MsgClaimAllRewardsResponse")] -pub struct MsgClaimAllRewardsResponse { - #[prost(message, repeated, tag = "1")] - pub total_reward_claim: - ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "2")] - pub claim_details: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.reward.v1.ClaimedRewardPeriodDetail")] -pub struct ClaimedRewardPeriodDetail { - #[prost(uint64, tag = "1")] - #[serde(alias = "claim_periodID")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub claim_period_id: u64, - #[prost(uint64, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub total_shares: u64, - #[prost(message, optional, tag = "3")] - pub claim_period_reward: - ::core::option::Option, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive( - Clone, - PartialEq, - Eq, - ::prost::Message, - ::serde::Serialize, - ::serde::Deserialize, - ::schemars::JsonSchema, - CosmwasmExt, -)] -#[proto_message(type_url = "/provenance.reward.v1.RewardProgramClaimDetail")] -pub struct RewardProgramClaimDetail { - #[prost(uint64, tag = "1")] - #[serde(alias = "reward_programID")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - pub reward_program_id: u64, - #[prost(message, optional, tag = "2")] - pub total_reward_claim: - ::core::option::Option, - #[prost(message, repeated, tag = "3")] - pub claimed_reward_period_details: ::prost::alloc::vec::Vec, -} -pub struct RewardQuerier<'a, Q: cosmwasm_std::CustomQuery> { - querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>, -} -impl<'a, Q: cosmwasm_std::CustomQuery> RewardQuerier<'a, Q> { - pub fn new(querier: &'a cosmwasm_std::QuerierWrapper<'a, Q>) -> Self { - Self { querier } - } - pub fn reward_program_by_id( - &self, - id: u64, - ) -> Result { - QueryRewardProgramByIdRequest { id }.query(self.querier) - } - pub fn reward_programs( - &self, - query_type: i32, - pagination: ::core::option::Option< - super::super::super::cosmos::base::query::v1beta1::PageRequest, - >, - ) -> Result { - QueryRewardProgramsRequest { - query_type, - pagination, - } - .query(self.querier) - } - pub fn claim_period_reward_distributions( - &self, - pagination: ::core::option::Option< - super::super::super::cosmos::base::query::v1beta1::PageRequest, - >, - ) -> Result { - QueryClaimPeriodRewardDistributionsRequest { pagination }.query(self.querier) - } - pub fn claim_period_reward_distributions_by_id( - &self, - reward_id: u64, - claim_period_id: u64, - ) -> Result { - QueryClaimPeriodRewardDistributionsByIdRequest { - reward_id, - claim_period_id, - } - .query(self.querier) - } - pub fn reward_distributions_by_address( - &self, - address: ::prost::alloc::string::String, - claim_status: i32, - pagination: ::core::option::Option< - super::super::super::cosmos::base::query::v1beta1::PageRequest, - >, - ) -> Result { - QueryRewardDistributionsByAddressRequest { - address, - claim_status, - pagination, - } - .query(self.querier) - } -} diff --git a/packages/provwasm-std/src/types/provenance/trigger/v1.rs b/packages/provwasm-std/src/types/provenance/trigger/v1.rs index 1a6e8f40..2ec7ba6c 100644 --- a/packages/provwasm-std/src/types/provenance/trigger/v1.rs +++ b/packages/provwasm-std/src/types/provenance/trigger/v1.rs @@ -1,4 +1,83 @@ use provwasm_proc_macro::CosmwasmExt; +/// EventTriggerCreated is an event for when a trigger is created +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.trigger.v1.EventTriggerCreated")] +pub struct EventTriggerCreated { + /// trigger_id is a unique identifier of the trigger. + #[prost(string, tag = "1")] + pub trigger_id: ::prost::alloc::string::String, +} +/// EventTriggerDestroyed is an event for when a trigger is destroyed +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.trigger.v1.EventTriggerDestroyed")] +pub struct EventTriggerDestroyed { + /// trigger_id is a unique identifier of the trigger. + #[prost(string, tag = "1")] + pub trigger_id: ::prost::alloc::string::String, +} +/// EventTriggerDetected is an event for when a trigger's event is detected +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.trigger.v1.EventTriggerDetected")] +pub struct EventTriggerDetected { + /// trigger_id is a unique identifier of the trigger. + #[prost(string, tag = "1")] + pub trigger_id: ::prost::alloc::string::String, +} +/// EventTriggerExecuted is an event for when a trigger is executed. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.trigger.v1.EventTriggerExecuted")] +pub struct EventTriggerExecuted { + /// trigger_id is a unique identifier of the trigger. + #[prost(string, tag = "1")] + pub trigger_id: ::prost::alloc::string::String, + /// owner is the creator of the trigger. + #[prost(string, tag = "2")] + pub owner: ::prost::alloc::string::String, + /// success indicates if all executed actions were successful. + #[prost(bool, tag = "3")] + pub success: bool, +} +/// Trigger #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -12,20 +91,52 @@ use provwasm_proc_macro::CosmwasmExt; )] #[proto_message(type_url = "/provenance.trigger.v1.Trigger")] pub struct Trigger { + /// An integer to uniquely identify the trigger. #[prost(uint64, tag = "1")] - #[serde(alias = "ID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub id: u64, + /// The owner of the trigger. #[prost(string, tag = "2")] pub owner: ::prost::alloc::string::String, + /// The event that must be detected for the trigger to fire. #[prost(message, optional, tag = "3")] pub event: ::core::option::Option, + /// The messages to run when the trigger fires. #[prost(message, repeated, tag = "4")] pub actions: ::prost::alloc::vec::Vec, } +/// QueuedTrigger +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.trigger.v1.QueuedTrigger")] +pub struct QueuedTrigger { + /// The block height the trigger was detected and queued. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub block_height: u64, + /// The time the trigger was detected and queued. + #[prost(message, optional, tag = "2")] + pub time: ::core::option::Option, + /// The trigger that was detected. + #[prost(message, optional, tag = "3")] + pub trigger: ::core::option::Option, +} +/// BlockHeightEvent #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -39,6 +150,7 @@ pub struct Trigger { )] #[proto_message(type_url = "/provenance.trigger.v1.BlockHeightEvent")] pub struct BlockHeightEvent { + /// The height that the trigger should fire at. #[prost(uint64, tag = "1")] #[serde( serialize_with = "crate::serde::as_str::serialize", @@ -46,6 +158,7 @@ pub struct BlockHeightEvent { )] pub block_height: u64, } +/// BlockTimeEvent #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -59,9 +172,11 @@ pub struct BlockHeightEvent { )] #[proto_message(type_url = "/provenance.trigger.v1.BlockTimeEvent")] pub struct BlockTimeEvent { + /// The time the trigger should fire at. #[prost(message, optional, tag = "1")] pub time: ::core::option::Option, } +/// TransactionEvent #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -75,11 +190,14 @@ pub struct BlockTimeEvent { )] #[proto_message(type_url = "/provenance.trigger.v1.TransactionEvent")] pub struct TransactionEvent { + /// The name of the event for a match. #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, + /// The attributes that must be present for a match. #[prost(message, repeated, tag = "2")] pub attributes: ::prost::alloc::vec::Vec, } +/// Attribute #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -93,11 +211,81 @@ pub struct TransactionEvent { )] #[proto_message(type_url = "/provenance.trigger.v1.Attribute")] pub struct Attribute { + /// The name of the attribute that the event must have to be considered a match. #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, + /// The value of the attribute that the event must have to be considered a match. #[prost(string, tag = "2")] pub value: ::prost::alloc::string::String, } +/// GenesisState defines the trigger module's genesis state. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.trigger.v1.GenesisState")] +pub struct GenesisState { + /// Trigger id is the next auto incremented id to be assigned to the next created trigger + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub trigger_id: u64, + /// Queue start is the starting index of the queue. + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub queue_start: u64, + /// Triggers to initially start with. + #[prost(message, repeated, tag = "3")] + pub triggers: ::prost::alloc::vec::Vec, + /// Maximum amount of gas that the triggers can use. + #[prost(message, repeated, tag = "4")] + pub gas_limits: ::prost::alloc::vec::Vec, + /// Triggers to initially start with in the queue. + #[prost(message, repeated, tag = "5")] + pub queued_triggers: ::prost::alloc::vec::Vec, +} +/// GasLimit defines the trigger module's grouping of a trigger and a gas limit +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/provenance.trigger.v1.GasLimit")] +pub struct GasLimit { + /// The identifier of the trigger this GasLimit belongs to. + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub trigger_id: u64, + /// The maximum amount of gas that the trigger can use. + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub amount: u64, +} +/// QueryTriggerByIDRequest queries for the Trigger with an identifier of id. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -115,14 +303,15 @@ pub struct Attribute { response_type = QueryTriggerByIdResponse )] pub struct QueryTriggerByIdRequest { + /// The id of the trigger to query. #[prost(uint64, tag = "1")] - #[serde(alias = "ID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub id: u64, } +/// QueryTriggerByIDResponse contains the requested Trigger. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -136,9 +325,11 @@ pub struct QueryTriggerByIdRequest { )] #[proto_message(type_url = "/provenance.trigger.v1.QueryTriggerByIDResponse")] pub struct QueryTriggerByIdResponse { + /// The trigger object that was queried for. #[prost(message, optional, tag = "1")] pub trigger: ::core::option::Option, } +/// QueryTriggersRequest queries for all triggers. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -156,10 +347,12 @@ pub struct QueryTriggerByIdResponse { response_type = QueryTriggersResponse )] pub struct QueryTriggersRequest { + /// pagination defines an optional pagination for the request. #[prost(message, optional, tag = "99")] pub pagination: ::core::option::Option, } +/// QueryTriggersResponse contains the list of Triggers. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -173,12 +366,15 @@ pub struct QueryTriggersRequest { )] #[proto_message(type_url = "/provenance.trigger.v1.QueryTriggersResponse")] pub struct QueryTriggersResponse { + /// List of Trigger objects. #[prost(message, repeated, tag = "1")] pub triggers: ::prost::alloc::vec::Vec, + /// pagination defines an optional pagination for the response. #[prost(message, optional, tag = "99")] pub pagination: ::core::option::Option, } +/// MsgCreateTriggerRequest is the request type for creating a trigger RPC #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -192,13 +388,17 @@ pub struct QueryTriggersResponse { )] #[proto_message(type_url = "/provenance.trigger.v1.MsgCreateTriggerRequest")] pub struct MsgCreateTriggerRequest { + /// The signing authorities for the request #[prost(string, repeated, tag = "1")] pub authorities: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// The event that must be detected for the trigger to fire. #[prost(message, optional, tag = "2")] pub event: ::core::option::Option, + /// The messages to run when the trigger fires. #[prost(message, repeated, tag = "3")] pub actions: ::prost::alloc::vec::Vec, } +/// MsgCreateTriggerResponse is the response type for creating a trigger RPC #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -212,14 +412,15 @@ pub struct MsgCreateTriggerRequest { )] #[proto_message(type_url = "/provenance.trigger.v1.MsgCreateTriggerResponse")] pub struct MsgCreateTriggerResponse { + /// trigger id that is generated on creation. #[prost(uint64, tag = "1")] - #[serde(alias = "ID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub id: u64, } +/// MsgDestroyTriggerRequest is the request type for creating a trigger RPC #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -233,16 +434,18 @@ pub struct MsgCreateTriggerResponse { )] #[proto_message(type_url = "/provenance.trigger.v1.MsgDestroyTriggerRequest")] pub struct MsgDestroyTriggerRequest { + /// the id of the trigger to destroy. #[prost(uint64, tag = "1")] - #[serde(alias = "ID")] #[serde( serialize_with = "crate::serde::as_str::serialize", deserialize_with = "crate::serde::as_str::deserialize" )] pub id: u64, + /// The signing authority for the request #[prost(string, tag = "2")] pub authority: ::prost::alloc::string::String, } +/// MsgDestroyTriggerResponse is the response type for creating a trigger RPC #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, From ceba81c40feaf2fd9669f3a23628c5433acd6c09 Mon Sep 17 00:00:00 2001 From: kwt <4344285+kwtalley@users.noreply.github.com> Date: Fri, 12 Jul 2024 01:20:00 -0500 Subject: [PATCH 23/43] add generated tendermint types --- .../provwasm-std/src/types/tendermint/abci.rs | 1680 +++++++++++++++++ .../src/types/tendermint/blocksync.rs | 145 ++ .../src/types/tendermint/consensus.rs | 470 +++++ .../src/types/tendermint/crypto.rs | 164 ++ .../src/types/tendermint/libs/bits.rs | 27 + .../src/types/tendermint/libs/mod.rs | 1 + .../src/types/tendermint/mempool.rs | 51 + .../provwasm-std/src/types/tendermint/mod.rs | 14 + .../provwasm-std/src/types/tendermint/p2p.rs | 288 +++ .../src/types/tendermint/privval.rs | 250 +++ .../src/types/tendermint/rpc/grpc.rs | 65 + .../src/types/tendermint/rpc/mod.rs | 1 + .../src/types/tendermint/state.rs | 229 +++ .../src/types/tendermint/statesync.rs | 170 ++ .../src/types/tendermint/store.rs | 27 + .../src/types/tendermint/types.rs | 1255 ++++++++++++ .../src/types/tendermint/version.rs | 55 + 17 files changed, 4892 insertions(+) create mode 100644 packages/provwasm-std/src/types/tendermint/abci.rs create mode 100644 packages/provwasm-std/src/types/tendermint/blocksync.rs create mode 100644 packages/provwasm-std/src/types/tendermint/consensus.rs create mode 100644 packages/provwasm-std/src/types/tendermint/crypto.rs create mode 100644 packages/provwasm-std/src/types/tendermint/libs/bits.rs create mode 100644 packages/provwasm-std/src/types/tendermint/libs/mod.rs create mode 100644 packages/provwasm-std/src/types/tendermint/mempool.rs create mode 100644 packages/provwasm-std/src/types/tendermint/mod.rs create mode 100644 packages/provwasm-std/src/types/tendermint/p2p.rs create mode 100644 packages/provwasm-std/src/types/tendermint/privval.rs create mode 100644 packages/provwasm-std/src/types/tendermint/rpc/grpc.rs create mode 100644 packages/provwasm-std/src/types/tendermint/rpc/mod.rs create mode 100644 packages/provwasm-std/src/types/tendermint/state.rs create mode 100644 packages/provwasm-std/src/types/tendermint/statesync.rs create mode 100644 packages/provwasm-std/src/types/tendermint/store.rs create mode 100644 packages/provwasm-std/src/types/tendermint/types.rs create mode 100644 packages/provwasm-std/src/types/tendermint/version.rs diff --git a/packages/provwasm-std/src/types/tendermint/abci.rs b/packages/provwasm-std/src/types/tendermint/abci.rs new file mode 100644 index 00000000..03db2dc4 --- /dev/null +++ b/packages/provwasm-std/src/types/tendermint/abci.rs @@ -0,0 +1,1680 @@ +use provwasm_proc_macro::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 = "/tendermint.abci.Request")] +pub struct Request { + #[prost( + oneof = "request::Value", + tags = "1, 2, 3, 5, 6, 8, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20" + )] + pub value: ::core::option::Option, +} +/// Nested message and enum types in `Request`. +pub mod request { + use provwasm_proc_macro::CosmwasmExt; + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive( + Clone, + PartialEq, + Eq, + ::prost::Oneof, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + )] + pub enum Value { + #[prost(message, tag = "1")] + Echo(super::RequestEcho), + #[prost(message, tag = "2")] + Flush(super::RequestFlush), + #[prost(message, tag = "3")] + Info(super::RequestInfo), + #[prost(message, tag = "5")] + InitChain(super::RequestInitChain), + #[prost(message, tag = "6")] + Query(super::RequestQuery), + #[prost(message, tag = "8")] + CheckTx(super::RequestCheckTx), + #[prost(message, tag = "11")] + Commit(super::RequestCommit), + #[prost(message, tag = "12")] + ListSnapshots(super::RequestListSnapshots), + #[prost(message, tag = "13")] + OfferSnapshot(super::RequestOfferSnapshot), + #[prost(message, tag = "14")] + LoadSnapshotChunk(super::RequestLoadSnapshotChunk), + #[prost(message, tag = "15")] + ApplySnapshotChunk(super::RequestApplySnapshotChunk), + #[prost(message, tag = "16")] + PrepareProposal(super::RequestPrepareProposal), + #[prost(message, tag = "17")] + ProcessProposal(super::RequestProcessProposal), + #[prost(message, tag = "18")] + ExtendVote(super::RequestExtendVote), + #[prost(message, tag = "19")] + VerifyVoteExtension(super::RequestVerifyVoteExtension), + #[prost(message, tag = "20")] + FinalizeBlock(super::RequestFinalizeBlock), + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.abci.RequestEcho")] +pub struct RequestEcho { + #[prost(string, tag = "1")] + pub message: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.abci.RequestFlush")] +pub struct RequestFlush {} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.abci.RequestInfo")] +pub struct RequestInfo { + #[prost(string, tag = "1")] + pub version: ::prost::alloc::string::String, + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub block_version: u64, + #[prost(uint64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub p2p_version: u64, + #[prost(string, tag = "4")] + pub abci_version: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.abci.RequestInitChain")] +pub struct RequestInitChain { + #[prost(message, optional, tag = "1")] + pub time: ::core::option::Option, + #[prost(string, tag = "2")] + pub chain_id: ::prost::alloc::string::String, + #[prost(message, optional, tag = "3")] + pub consensus_params: ::core::option::Option, + #[prost(message, repeated, tag = "4")] + pub validators: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "5")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub app_state_bytes: ::prost::alloc::vec::Vec, + #[prost(int64, tag = "6")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub initial_height: i64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.abci.RequestQuery")] +pub struct RequestQuery { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, + #[prost(string, tag = "2")] + pub path: ::prost::alloc::string::String, + #[prost(int64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: i64, + #[prost(bool, tag = "4")] + pub prove: bool, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.abci.RequestCheckTx")] +pub struct RequestCheckTx { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub tx: ::prost::alloc::vec::Vec, + #[prost(enumeration = "CheckTxType", tag = "2")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub r#type: i32, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.abci.RequestCommit")] +pub struct RequestCommit {} +/// lists available snapshots +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.abci.RequestListSnapshots")] +pub struct RequestListSnapshots {} +/// offers a snapshot to the application +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.abci.RequestOfferSnapshot")] +pub struct RequestOfferSnapshot { + /// snapshot offered by peers + #[prost(message, optional, tag = "1")] + pub snapshot: ::core::option::Option, + /// light client-verified app hash for snapshot height + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub app_hash: ::prost::alloc::vec::Vec, +} +/// loads a snapshot chunk +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.abci.RequestLoadSnapshotChunk")] +pub struct RequestLoadSnapshotChunk { + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: u64, + #[prost(uint32, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub format: u32, + #[prost(uint32, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub chunk: u32, +} +/// Applies a snapshot chunk +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.abci.RequestApplySnapshotChunk")] +pub struct RequestApplySnapshotChunk { + #[prost(uint32, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub index: u32, + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub chunk: ::prost::alloc::vec::Vec, + #[prost(string, tag = "3")] + pub sender: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.abci.RequestPrepareProposal")] +pub struct RequestPrepareProposal { + /// the modified transactions cannot exceed this size. + #[prost(int64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub max_tx_bytes: i64, + /// txs is an array of transactions that will be included in a block, + /// sent to the app for possible modifications. + #[prost(bytes = "vec", repeated, tag = "2")] + pub txs: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, + #[prost(message, optional, tag = "3")] + pub local_last_commit: ::core::option::Option, + #[prost(message, repeated, tag = "4")] + pub misbehavior: ::prost::alloc::vec::Vec, + #[prost(int64, tag = "5")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: i64, + #[prost(message, optional, tag = "6")] + pub time: ::core::option::Option, + #[prost(bytes = "vec", tag = "7")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub next_validators_hash: ::prost::alloc::vec::Vec, + /// address of the public key of the validator proposing the block. + #[prost(bytes = "vec", tag = "8")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub proposer_address: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.abci.RequestProcessProposal")] +pub struct RequestProcessProposal { + #[prost(bytes = "vec", repeated, tag = "1")] + pub txs: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, + #[prost(message, optional, tag = "2")] + pub proposed_last_commit: ::core::option::Option, + #[prost(message, repeated, tag = "3")] + pub misbehavior: ::prost::alloc::vec::Vec, + /// hash is the merkle root hash of the fields of the proposed block. + #[prost(bytes = "vec", tag = "4")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub hash: ::prost::alloc::vec::Vec, + #[prost(int64, tag = "5")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: i64, + #[prost(message, optional, tag = "6")] + pub time: ::core::option::Option, + #[prost(bytes = "vec", tag = "7")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub next_validators_hash: ::prost::alloc::vec::Vec, + /// address of the public key of the original proposer of the block. + #[prost(bytes = "vec", tag = "8")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub proposer_address: ::prost::alloc::vec::Vec, +} +/// Extends a vote with application-injected data +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.abci.RequestExtendVote")] +pub struct RequestExtendVote { + /// the hash of the block that this vote may be referring to + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub hash: ::prost::alloc::vec::Vec, + /// the height of the extended vote + #[prost(int64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: i64, + /// info of the block that this vote may be referring to + #[prost(message, optional, tag = "3")] + pub time: ::core::option::Option, + #[prost(bytes = "vec", repeated, tag = "4")] + pub txs: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, + #[prost(message, optional, tag = "5")] + pub proposed_last_commit: ::core::option::Option, + #[prost(message, repeated, tag = "6")] + pub misbehavior: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "7")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub next_validators_hash: ::prost::alloc::vec::Vec, + /// address of the public key of the original proposer of the block. + #[prost(bytes = "vec", tag = "8")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub proposer_address: ::prost::alloc::vec::Vec, +} +/// Verify the vote extension +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.abci.RequestVerifyVoteExtension")] +pub struct RequestVerifyVoteExtension { + /// the hash of the block that this received vote corresponds to + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub hash: ::prost::alloc::vec::Vec, + /// the validator that signed the vote extension + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub validator_address: ::prost::alloc::vec::Vec, + #[prost(int64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: i64, + #[prost(bytes = "vec", tag = "4")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub vote_extension: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.abci.RequestFinalizeBlock")] +pub struct RequestFinalizeBlock { + #[prost(bytes = "vec", repeated, tag = "1")] + pub txs: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, + #[prost(message, optional, tag = "2")] + pub decided_last_commit: ::core::option::Option, + #[prost(message, repeated, tag = "3")] + pub misbehavior: ::prost::alloc::vec::Vec, + /// hash is the merkle root hash of the fields of the decided block. + #[prost(bytes = "vec", tag = "4")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub hash: ::prost::alloc::vec::Vec, + #[prost(int64, tag = "5")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: i64, + #[prost(message, optional, tag = "6")] + pub time: ::core::option::Option, + #[prost(bytes = "vec", tag = "7")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub next_validators_hash: ::prost::alloc::vec::Vec, + /// proposer_address is the address of the public key of the original proposer of the block. + #[prost(bytes = "vec", tag = "8")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub proposer_address: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.abci.Response")] +pub struct Response { + #[prost( + oneof = "response::Value", + tags = "1, 2, 3, 4, 6, 7, 9, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21" + )] + pub value: ::core::option::Option, +} +/// Nested message and enum types in `Response`. +pub mod response { + use provwasm_proc_macro::CosmwasmExt; + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive( + Clone, + PartialEq, + Eq, + ::prost::Oneof, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + )] + pub enum Value { + #[prost(message, tag = "1")] + Exception(super::ResponseException), + #[prost(message, tag = "2")] + Echo(super::ResponseEcho), + #[prost(message, tag = "3")] + Flush(super::ResponseFlush), + #[prost(message, tag = "4")] + Info(super::ResponseInfo), + #[prost(message, tag = "6")] + InitChain(super::ResponseInitChain), + #[prost(message, tag = "7")] + Query(super::ResponseQuery), + #[prost(message, tag = "9")] + CheckTx(super::ResponseCheckTx), + #[prost(message, tag = "12")] + Commit(super::ResponseCommit), + #[prost(message, tag = "13")] + ListSnapshots(super::ResponseListSnapshots), + #[prost(message, tag = "14")] + OfferSnapshot(super::ResponseOfferSnapshot), + #[prost(message, tag = "15")] + LoadSnapshotChunk(super::ResponseLoadSnapshotChunk), + #[prost(message, tag = "16")] + ApplySnapshotChunk(super::ResponseApplySnapshotChunk), + #[prost(message, tag = "17")] + PrepareProposal(super::ResponsePrepareProposal), + #[prost(message, tag = "18")] + ProcessProposal(super::ResponseProcessProposal), + #[prost(message, tag = "19")] + ExtendVote(super::ResponseExtendVote), + #[prost(message, tag = "20")] + VerifyVoteExtension(super::ResponseVerifyVoteExtension), + #[prost(message, tag = "21")] + FinalizeBlock(super::ResponseFinalizeBlock), + } +} +/// nondeterministic +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.abci.ResponseException")] +pub struct ResponseException { + #[prost(string, tag = "1")] + pub error: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.abci.ResponseEcho")] +pub struct ResponseEcho { + #[prost(string, tag = "1")] + pub message: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.abci.ResponseFlush")] +pub struct ResponseFlush {} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.abci.ResponseInfo")] +pub struct ResponseInfo { + #[prost(string, tag = "1")] + pub data: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub version: ::prost::alloc::string::String, + #[prost(uint64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub app_version: u64, + #[prost(int64, tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub last_block_height: i64, + #[prost(bytes = "vec", tag = "5")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub last_block_app_hash: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.abci.ResponseInitChain")] +pub struct ResponseInitChain { + #[prost(message, optional, tag = "1")] + pub consensus_params: ::core::option::Option, + #[prost(message, repeated, tag = "2")] + pub validators: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "3")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub app_hash: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.abci.ResponseQuery")] +pub struct ResponseQuery { + #[prost(uint32, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub code: u32, + /// bytes data = 2; // use "value" instead. + /// + /// nondeterministic + #[prost(string, tag = "3")] + pub log: ::prost::alloc::string::String, + /// nondeterministic + #[prost(string, tag = "4")] + pub info: ::prost::alloc::string::String, + #[prost(int64, tag = "5")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub index: i64, + #[prost(bytes = "vec", tag = "6")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub key: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "7")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub value: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "8")] + pub proof_ops: ::core::option::Option, + #[prost(int64, tag = "9")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: i64, + #[prost(string, tag = "10")] + pub codespace: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.abci.ResponseCheckTx")] +pub struct ResponseCheckTx { + #[prost(uint32, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub code: u32, + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, + /// nondeterministic + #[prost(string, tag = "3")] + pub log: ::prost::alloc::string::String, + /// nondeterministic + #[prost(string, tag = "4")] + pub info: ::prost::alloc::string::String, + #[prost(int64, tag = "5")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub gas_wanted: i64, + #[prost(int64, tag = "6")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub gas_used: i64, + #[prost(message, repeated, tag = "7")] + pub events: ::prost::alloc::vec::Vec, + #[prost(string, tag = "8")] + pub codespace: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.abci.ResponseCommit")] +pub struct ResponseCommit { + #[prost(int64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub retain_height: i64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.abci.ResponseListSnapshots")] +pub struct ResponseListSnapshots { + #[prost(message, repeated, tag = "1")] + pub snapshots: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.abci.ResponseOfferSnapshot")] +pub struct ResponseOfferSnapshot { + #[prost(enumeration = "response_offer_snapshot::Result", tag = "1")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub result: i32, +} +/// Nested message and enum types in `ResponseOfferSnapshot`. +pub mod response_offer_snapshot { + use provwasm_proc_macro::CosmwasmExt; + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] + #[repr(i32)] + #[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] + pub enum Result { + /// Unknown result, abort all snapshot restoration + Unknown = 0, + /// Snapshot accepted, apply chunks + Accept = 1, + /// Abort all snapshot restoration + Abort = 2, + /// Reject this specific snapshot, try others + Reject = 3, + /// Reject all snapshots of this format, try others + RejectFormat = 4, + /// Reject all snapshots from the sender(s), try others + RejectSender = 5, + } + impl Result { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Result::Unknown => "UNKNOWN", + Result::Accept => "ACCEPT", + Result::Abort => "ABORT", + Result::Reject => "REJECT", + Result::RejectFormat => "REJECT_FORMAT", + Result::RejectSender => "REJECT_SENDER", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "UNKNOWN" => Some(Self::Unknown), + "ACCEPT" => Some(Self::Accept), + "ABORT" => Some(Self::Abort), + "REJECT" => Some(Self::Reject), + "REJECT_FORMAT" => Some(Self::RejectFormat), + "REJECT_SENDER" => Some(Self::RejectSender), + _ => None, + } + } + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.abci.ResponseLoadSnapshotChunk")] +pub struct ResponseLoadSnapshotChunk { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub chunk: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.abci.ResponseApplySnapshotChunk")] +pub struct ResponseApplySnapshotChunk { + #[prost(enumeration = "response_apply_snapshot_chunk::Result", tag = "1")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub result: i32, + /// Chunks to refetch and reapply + #[prost(uint32, repeated, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub refetch_chunks: ::prost::alloc::vec::Vec, + /// Chunk senders to reject and ban + #[prost(string, repeated, tag = "3")] + pub reject_senders: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// Nested message and enum types in `ResponseApplySnapshotChunk`. +pub mod response_apply_snapshot_chunk { + use provwasm_proc_macro::CosmwasmExt; + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] + #[repr(i32)] + #[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] + pub enum Result { + /// Unknown result, abort all snapshot restoration + Unknown = 0, + /// Chunk successfully accepted + Accept = 1, + /// Abort all snapshot restoration + Abort = 2, + /// Retry chunk (combine with refetch and reject) + Retry = 3, + /// Retry snapshot (combine with refetch and reject) + RetrySnapshot = 4, + /// Reject this snapshot, try others + RejectSnapshot = 5, + } + impl Result { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Result::Unknown => "UNKNOWN", + Result::Accept => "ACCEPT", + Result::Abort => "ABORT", + Result::Retry => "RETRY", + Result::RetrySnapshot => "RETRY_SNAPSHOT", + Result::RejectSnapshot => "REJECT_SNAPSHOT", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "UNKNOWN" => Some(Self::Unknown), + "ACCEPT" => Some(Self::Accept), + "ABORT" => Some(Self::Abort), + "RETRY" => Some(Self::Retry), + "RETRY_SNAPSHOT" => Some(Self::RetrySnapshot), + "REJECT_SNAPSHOT" => Some(Self::RejectSnapshot), + _ => None, + } + } + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.abci.ResponsePrepareProposal")] +pub struct ResponsePrepareProposal { + #[prost(bytes = "vec", repeated, tag = "1")] + pub txs: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.abci.ResponseProcessProposal")] +pub struct ResponseProcessProposal { + #[prost(enumeration = "response_process_proposal::ProposalStatus", tag = "1")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub status: i32, +} +/// Nested message and enum types in `ResponseProcessProposal`. +pub mod response_process_proposal { + use provwasm_proc_macro::CosmwasmExt; + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] + #[repr(i32)] + #[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] + pub enum ProposalStatus { + Unknown = 0, + Accept = 1, + Reject = 2, + } + impl ProposalStatus { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + ProposalStatus::Unknown => "UNKNOWN", + ProposalStatus::Accept => "ACCEPT", + ProposalStatus::Reject => "REJECT", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "UNKNOWN" => Some(Self::Unknown), + "ACCEPT" => Some(Self::Accept), + "REJECT" => Some(Self::Reject), + _ => None, + } + } + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.abci.ResponseExtendVote")] +pub struct ResponseExtendVote { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub vote_extension: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.abci.ResponseVerifyVoteExtension")] +pub struct ResponseVerifyVoteExtension { + #[prost( + enumeration = "response_verify_vote_extension::VerifyStatus", + tag = "1" + )] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub status: i32, +} +/// Nested message and enum types in `ResponseVerifyVoteExtension`. +pub mod response_verify_vote_extension { + use provwasm_proc_macro::CosmwasmExt; + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] + #[repr(i32)] + #[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] + pub enum VerifyStatus { + Unknown = 0, + Accept = 1, + /// Rejecting the vote extension will reject the entire precommit by the sender. + /// Incorrectly implementing this thus has liveness implications as it may affect + /// CometBFT's ability to receive 2/3+ valid votes to finalize the block. + /// Honest nodes should never be rejected. + Reject = 2, + } + impl VerifyStatus { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + VerifyStatus::Unknown => "UNKNOWN", + VerifyStatus::Accept => "ACCEPT", + VerifyStatus::Reject => "REJECT", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "UNKNOWN" => Some(Self::Unknown), + "ACCEPT" => Some(Self::Accept), + "REJECT" => Some(Self::Reject), + _ => None, + } + } + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.abci.ResponseFinalizeBlock")] +pub struct ResponseFinalizeBlock { + /// set of block events emmitted as part of executing the block + #[prost(message, repeated, tag = "1")] + pub events: ::prost::alloc::vec::Vec, + /// the result of executing each transaction including the events + /// the particular transction emitted. This should match the order + /// of the transactions delivered in the block itself + #[prost(message, repeated, tag = "2")] + pub tx_results: ::prost::alloc::vec::Vec, + /// a list of updates to the validator set. These will reflect the validator set at current height + 2. + #[prost(message, repeated, tag = "3")] + pub validator_updates: ::prost::alloc::vec::Vec, + /// updates to the consensus params, if any. + #[prost(message, optional, tag = "4")] + pub consensus_param_updates: ::core::option::Option, + /// app_hash is the hash of the applications' state which is used to confirm that execution of the transactions was deterministic. It is up to the application to decide which algorithm to use. + #[prost(bytes = "vec", tag = "5")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub app_hash: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.abci.CommitInfo")] +pub struct CommitInfo { + #[prost(int32, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub round: i32, + #[prost(message, repeated, tag = "2")] + pub votes: ::prost::alloc::vec::Vec, +} +/// ExtendedCommitInfo is similar to CommitInfo except that it is only used in +/// the PrepareProposal request such that CometBFT can provide vote extensions +/// to the application. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.abci.ExtendedCommitInfo")] +pub struct ExtendedCommitInfo { + /// The round at which the block proposer decided in the previous height. + #[prost(int32, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub round: i32, + /// List of validators' addresses in the last validator set with their voting + /// information, including vote extensions. + #[prost(message, repeated, tag = "2")] + pub votes: ::prost::alloc::vec::Vec, +} +/// Event allows application developers to attach additional information to +/// ResponseFinalizeBlock and ResponseCheckTx. +/// Later, transactions may be queried using these events. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.abci.Event")] +pub struct Event { + #[prost(string, tag = "1")] + pub r#type: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] + pub attributes: ::prost::alloc::vec::Vec, +} +/// EventAttribute is a single key-value pair, associated with an event. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.abci.EventAttribute")] +pub struct EventAttribute { + #[prost(string, tag = "1")] + pub key: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub value: ::prost::alloc::string::String, + /// nondeterministic + #[prost(bool, tag = "3")] + pub index: bool, +} +/// ExecTxResult contains results of executing one individual transaction. +/// +/// * Its structure is equivalent to #ResponseDeliverTx which will be deprecated/deleted +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.abci.ExecTxResult")] +pub struct ExecTxResult { + #[prost(uint32, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub code: u32, + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, + /// nondeterministic + #[prost(string, tag = "3")] + pub log: ::prost::alloc::string::String, + /// nondeterministic + #[prost(string, tag = "4")] + pub info: ::prost::alloc::string::String, + #[prost(int64, tag = "5")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub gas_wanted: i64, + #[prost(int64, tag = "6")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub gas_used: i64, + /// nondeterministic + #[prost(message, repeated, tag = "7")] + pub events: ::prost::alloc::vec::Vec, + #[prost(string, tag = "8")] + pub codespace: ::prost::alloc::string::String, +} +/// TxResult contains results of executing the transaction. +/// +/// One usage is indexing transaction results. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.abci.TxResult")] +pub struct TxResult { + #[prost(int64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: i64, + #[prost(uint32, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub index: u32, + #[prost(bytes = "vec", tag = "3")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub tx: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "4")] + pub result: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.abci.Validator")] +pub struct Validator { + /// The first 20 bytes of SHA256(public key) + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub address: ::prost::alloc::vec::Vec, + /// PubKey pub_key = 2 \[(gogoproto.nullable)=false\]; + /// + /// The voting power + #[prost(int64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub power: i64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.abci.ValidatorUpdate")] +pub struct ValidatorUpdate { + #[prost(message, optional, tag = "1")] + pub pub_key: ::core::option::Option, + #[prost(int64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub power: i64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.abci.VoteInfo")] +pub struct VoteInfo { + #[prost(message, optional, tag = "1")] + pub validator: ::core::option::Option, + #[prost(enumeration = "super::types::BlockIdFlag", tag = "3")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub block_id_flag: i32, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.abci.ExtendedVoteInfo")] +pub struct ExtendedVoteInfo { + /// The validator that sent the vote. + #[prost(message, optional, tag = "1")] + pub validator: ::core::option::Option, + /// Non-deterministic extension provided by the sending validator's application. + #[prost(bytes = "vec", tag = "3")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub vote_extension: ::prost::alloc::vec::Vec, + /// Vote extension signature created by CometBFT + #[prost(bytes = "vec", tag = "4")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub extension_signature: ::prost::alloc::vec::Vec, + /// block_id_flag indicates whether the validator voted for a block, nil, or did not vote at all + #[prost(enumeration = "super::types::BlockIdFlag", tag = "5")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub block_id_flag: i32, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.abci.Misbehavior")] +pub struct Misbehavior { + #[prost(enumeration = "MisbehaviorType", tag = "1")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub r#type: i32, + /// The offending validator + #[prost(message, optional, tag = "2")] + pub validator: ::core::option::Option, + /// The height when the offense occurred + #[prost(int64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: i64, + /// The corresponding time where the offense occurred + #[prost(message, optional, tag = "4")] + pub time: ::core::option::Option, + /// Total voting power of the validator set in case the ABCI application does + /// not store historical validators. + /// + #[prost(int64, tag = "5")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub total_voting_power: i64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.abci.Snapshot")] +pub struct Snapshot { + /// The height at which the snapshot was taken + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: u64, + /// The application-specific snapshot format + #[prost(uint32, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub format: u32, + /// Number of chunks in the snapshot + #[prost(uint32, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub chunks: u32, + /// Arbitrary snapshot hash, equal only if identical + #[prost(bytes = "vec", tag = "4")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub hash: ::prost::alloc::vec::Vec, + /// Arbitrary application metadata + #[prost(bytes = "vec", tag = "5")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub metadata: ::prost::alloc::vec::Vec, +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +pub enum CheckTxType { + New = 0, + Recheck = 1, +} +impl CheckTxType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + CheckTxType::New => "NEW", + CheckTxType::Recheck => "RECHECK", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "NEW" => Some(Self::New), + "RECHECK" => Some(Self::Recheck), + _ => None, + } + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +pub enum MisbehaviorType { + Unknown = 0, + DuplicateVote = 1, + LightClientAttack = 2, +} +impl MisbehaviorType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + MisbehaviorType::Unknown => "UNKNOWN", + MisbehaviorType::DuplicateVote => "DUPLICATE_VOTE", + MisbehaviorType::LightClientAttack => "LIGHT_CLIENT_ATTACK", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "UNKNOWN" => Some(Self::Unknown), + "DUPLICATE_VOTE" => Some(Self::DuplicateVote), + "LIGHT_CLIENT_ATTACK" => Some(Self::LightClientAttack), + _ => None, + } + } +} diff --git a/packages/provwasm-std/src/types/tendermint/blocksync.rs b/packages/provwasm-std/src/types/tendermint/blocksync.rs new file mode 100644 index 00000000..a69cae9e --- /dev/null +++ b/packages/provwasm-std/src/types/tendermint/blocksync.rs @@ -0,0 +1,145 @@ +use provwasm_proc_macro::CosmwasmExt; +/// BlockRequest requests a block for a specific height +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.blocksync.BlockRequest")] +pub struct BlockRequest { + #[prost(int64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: i64, +} +/// NoBlockResponse informs the node that the peer does not have block at the requested height +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.blocksync.NoBlockResponse")] +pub struct NoBlockResponse { + #[prost(int64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: i64, +} +/// BlockResponse returns block to the requested +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.blocksync.BlockResponse")] +pub struct BlockResponse { + #[prost(message, optional, tag = "1")] + pub block: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub ext_commit: ::core::option::Option, +} +/// StatusRequest requests the status of a peer. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.blocksync.StatusRequest")] +pub struct StatusRequest {} +/// StatusResponse is a peer response to inform their status. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.blocksync.StatusResponse")] +pub struct StatusResponse { + #[prost(int64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: i64, + #[prost(int64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub base: i64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.blocksync.Message")] +pub struct Message { + #[prost(oneof = "message::Sum", tags = "1, 2, 3, 4, 5")] + pub sum: ::core::option::Option, +} +/// Nested message and enum types in `Message`. +pub mod message { + use provwasm_proc_macro::CosmwasmExt; + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive( + Clone, + PartialEq, + Eq, + ::prost::Oneof, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + )] + pub enum Sum { + #[prost(message, tag = "1")] + BlockRequest(super::BlockRequest), + #[prost(message, tag = "2")] + NoBlockResponse(super::NoBlockResponse), + #[prost(message, tag = "3")] + BlockResponse(super::BlockResponse), + #[prost(message, tag = "4")] + StatusRequest(super::StatusRequest), + #[prost(message, tag = "5")] + StatusResponse(super::StatusResponse), + } +} diff --git a/packages/provwasm-std/src/types/tendermint/consensus.rs b/packages/provwasm-std/src/types/tendermint/consensus.rs new file mode 100644 index 00000000..d2368bf4 --- /dev/null +++ b/packages/provwasm-std/src/types/tendermint/consensus.rs @@ -0,0 +1,470 @@ +use provwasm_proc_macro::CosmwasmExt; +/// NewRoundStep is sent for every step taken in the ConsensusState. +/// For every height/round/step transition +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.consensus.NewRoundStep")] +pub struct NewRoundStep { + #[prost(int64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: i64, + #[prost(int32, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub round: i32, + #[prost(uint32, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub step: u32, + #[prost(int64, tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub seconds_since_start_time: i64, + #[prost(int32, tag = "5")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub last_commit_round: i32, +} +/// NewValidBlock is sent when a validator observes a valid block B in some round r, +/// i.e., there is a Proposal for block B and 2/3+ prevotes for the block B in the round r. +/// In case the block is also committed, then IsCommit flag is set to true. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.consensus.NewValidBlock")] +pub struct NewValidBlock { + #[prost(int64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: i64, + #[prost(int32, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub round: i32, + #[prost(message, optional, tag = "3")] + pub block_part_set_header: ::core::option::Option, + #[prost(message, optional, tag = "4")] + pub block_parts: ::core::option::Option, + #[prost(bool, tag = "5")] + pub is_commit: bool, +} +/// Proposal is sent when a new block is proposed. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.consensus.Proposal")] +pub struct Proposal { + #[prost(message, optional, tag = "1")] + pub proposal: ::core::option::Option, +} +/// ProposalPOL is sent when a previous proposal is re-proposed. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.consensus.ProposalPOL")] +pub struct ProposalPol { + #[prost(int64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: i64, + #[prost(int32, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub proposal_pol_round: i32, + #[prost(message, optional, tag = "3")] + pub proposal_pol: ::core::option::Option, +} +/// BlockPart is sent when gossipping a piece of the proposed block. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.consensus.BlockPart")] +pub struct BlockPart { + #[prost(int64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: i64, + #[prost(int32, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub round: i32, + #[prost(message, optional, tag = "3")] + pub part: ::core::option::Option, +} +/// Vote is sent when voting for a proposal (or lack thereof). +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.consensus.Vote")] +pub struct Vote { + #[prost(message, optional, tag = "1")] + pub vote: ::core::option::Option, +} +/// HasVote is sent to indicate that a particular vote has been received. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.consensus.HasVote")] +pub struct HasVote { + #[prost(int64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: i64, + #[prost(int32, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub round: i32, + #[prost(enumeration = "super::types::SignedMsgType", tag = "3")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub r#type: i32, + #[prost(int32, tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub index: i32, +} +/// VoteSetMaj23 is sent to indicate that a given BlockID has seen +2/3 votes. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.consensus.VoteSetMaj23")] +pub struct VoteSetMaj23 { + #[prost(int64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: i64, + #[prost(int32, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub round: i32, + #[prost(enumeration = "super::types::SignedMsgType", tag = "3")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub r#type: i32, + #[prost(message, optional, tag = "4")] + pub block_id: ::core::option::Option, +} +/// VoteSetBits is sent to communicate the bit-array of votes seen for the BlockID. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.consensus.VoteSetBits")] +pub struct VoteSetBits { + #[prost(int64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: i64, + #[prost(int32, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub round: i32, + #[prost(enumeration = "super::types::SignedMsgType", tag = "3")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub r#type: i32, + #[prost(message, optional, tag = "4")] + pub block_id: ::core::option::Option, + #[prost(message, optional, tag = "5")] + pub votes: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.consensus.Message")] +pub struct Message { + #[prost(oneof = "message::Sum", tags = "1, 2, 3, 4, 5, 6, 7, 8, 9")] + pub sum: ::core::option::Option, +} +/// Nested message and enum types in `Message`. +pub mod message { + use provwasm_proc_macro::CosmwasmExt; + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive( + Clone, + PartialEq, + Eq, + ::prost::Oneof, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + )] + pub enum Sum { + #[prost(message, tag = "1")] + NewRoundStep(super::NewRoundStep), + #[prost(message, tag = "2")] + NewValidBlock(super::NewValidBlock), + #[prost(message, tag = "3")] + Proposal(super::Proposal), + #[prost(message, tag = "4")] + ProposalPol(super::ProposalPol), + #[prost(message, tag = "5")] + BlockPart(super::BlockPart), + #[prost(message, tag = "6")] + Vote(super::Vote), + #[prost(message, tag = "7")] + HasVote(super::HasVote), + #[prost(message, tag = "8")] + VoteSetMaj23(super::VoteSetMaj23), + #[prost(message, tag = "9")] + VoteSetBits(super::VoteSetBits), + } +} +/// MsgInfo are msgs from the reactor which may update the state +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.consensus.MsgInfo")] +pub struct MsgInfo { + #[prost(message, optional, tag = "1")] + pub msg: ::core::option::Option, + #[prost(string, tag = "2")] + pub peer_id: ::prost::alloc::string::String, +} +/// TimeoutInfo internally generated messages which may update the state +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.consensus.TimeoutInfo")] +pub struct TimeoutInfo { + #[prost(message, optional, tag = "1")] + pub duration: ::core::option::Option, + #[prost(int64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: i64, + #[prost(int32, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub round: i32, + #[prost(uint32, tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub step: u32, +} +/// EndHeight marks the end of the given height inside WAL. +/// @internal used by scripts/wal2json util. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.consensus.EndHeight")] +pub struct EndHeight { + #[prost(int64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: i64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.consensus.WALMessage")] +pub struct WalMessage { + #[prost(oneof = "wal_message::Sum", tags = "1, 2, 3, 4")] + pub sum: ::core::option::Option, +} +/// Nested message and enum types in `WALMessage`. +pub mod wal_message { + use provwasm_proc_macro::CosmwasmExt; + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive( + Clone, + PartialEq, + Eq, + ::prost::Oneof, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + )] + pub enum Sum { + #[prost(message, tag = "1")] + EventDataRoundState(super::super::types::EventDataRoundState), + #[prost(message, tag = "2")] + MsgInfo(super::MsgInfo), + #[prost(message, tag = "3")] + TimeoutInfo(super::TimeoutInfo), + #[prost(message, tag = "4")] + EndHeight(super::EndHeight), + } +} +/// TimedWALMessage wraps WALMessage and adds Time for debugging purposes. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.consensus.TimedWALMessage")] +pub struct TimedWalMessage { + #[prost(message, optional, tag = "1")] + pub time: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub msg: ::core::option::Option, +} diff --git a/packages/provwasm-std/src/types/tendermint/crypto.rs b/packages/provwasm-std/src/types/tendermint/crypto.rs new file mode 100644 index 00000000..beb1f0ff --- /dev/null +++ b/packages/provwasm-std/src/types/tendermint/crypto.rs @@ -0,0 +1,164 @@ +use provwasm_proc_macro::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 = "/tendermint.crypto.Proof")] +pub struct Proof { + #[prost(int64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub total: i64, + #[prost(int64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub index: i64, + #[prost(bytes = "vec", tag = "3")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub leaf_hash: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", repeated, tag = "4")] + pub aunts: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.crypto.ValueOp")] +pub struct ValueOp { + /// Encoded in ProofOp.Key. + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub key: ::prost::alloc::vec::Vec, + /// To encode in ProofOp.Data + #[prost(message, optional, tag = "2")] + pub proof: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.crypto.DominoOp")] +pub struct DominoOp { + #[prost(string, tag = "1")] + pub key: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub input: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub output: ::prost::alloc::string::String, +} +/// ProofOp defines an operation used for calculating Merkle root +/// The data could be arbitrary format, providing nessecary data +/// for example neighbouring node hash +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.crypto.ProofOp")] +pub struct ProofOp { + #[prost(string, tag = "1")] + pub r#type: ::prost::alloc::string::String, + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub key: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "3")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, +} +/// ProofOps is Merkle proof defined by the list of ProofOps +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.crypto.ProofOps")] +pub struct ProofOps { + #[prost(message, repeated, tag = "1")] + pub ops: ::prost::alloc::vec::Vec, +} +/// PublicKey defines the keys available for use with Validators +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.crypto.PublicKey")] +pub struct PublicKey { + #[prost(oneof = "public_key::Sum", tags = "1, 2")] + pub sum: ::core::option::Option, +} +/// Nested message and enum types in `PublicKey`. +pub mod public_key { + use provwasm_proc_macro::CosmwasmExt; + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive( + Clone, + PartialEq, + Eq, + ::prost::Oneof, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + )] + pub enum Sum { + #[prost(bytes, tag = "1")] + Ed25519(::prost::alloc::vec::Vec), + #[prost(bytes, tag = "2")] + Secp256k1(::prost::alloc::vec::Vec), + } +} diff --git a/packages/provwasm-std/src/types/tendermint/libs/bits.rs b/packages/provwasm-std/src/types/tendermint/libs/bits.rs new file mode 100644 index 00000000..778e319e --- /dev/null +++ b/packages/provwasm-std/src/types/tendermint/libs/bits.rs @@ -0,0 +1,27 @@ +use provwasm_proc_macro::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 = "/tendermint.libs.bits.BitArray")] +pub struct BitArray { + #[prost(int64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub bits: i64, + #[prost(uint64, repeated, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + pub elems: ::prost::alloc::vec::Vec, +} diff --git a/packages/provwasm-std/src/types/tendermint/libs/mod.rs b/packages/provwasm-std/src/types/tendermint/libs/mod.rs new file mode 100644 index 00000000..e79b623c --- /dev/null +++ b/packages/provwasm-std/src/types/tendermint/libs/mod.rs @@ -0,0 +1 @@ +pub mod bits; diff --git a/packages/provwasm-std/src/types/tendermint/mempool.rs b/packages/provwasm-std/src/types/tendermint/mempool.rs new file mode 100644 index 00000000..db52561f --- /dev/null +++ b/packages/provwasm-std/src/types/tendermint/mempool.rs @@ -0,0 +1,51 @@ +use provwasm_proc_macro::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 = "/tendermint.mempool.Txs")] +pub struct Txs { + #[prost(bytes = "vec", repeated, tag = "1")] + pub txs: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.mempool.Message")] +pub struct Message { + #[prost(oneof = "message::Sum", tags = "1")] + pub sum: ::core::option::Option, +} +/// Nested message and enum types in `Message`. +pub mod message { + use provwasm_proc_macro::CosmwasmExt; + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive( + Clone, + PartialEq, + Eq, + ::prost::Oneof, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + )] + pub enum Sum { + #[prost(message, tag = "1")] + Txs(super::Txs), + } +} diff --git a/packages/provwasm-std/src/types/tendermint/mod.rs b/packages/provwasm-std/src/types/tendermint/mod.rs new file mode 100644 index 00000000..09b25428 --- /dev/null +++ b/packages/provwasm-std/src/types/tendermint/mod.rs @@ -0,0 +1,14 @@ +pub mod abci; +pub mod blocksync; +pub mod consensus; +pub mod crypto; +pub mod libs; +pub mod mempool; +pub mod p2p; +pub mod privval; +pub mod rpc; +pub mod state; +pub mod statesync; +pub mod store; +pub mod types; +pub mod version; diff --git a/packages/provwasm-std/src/types/tendermint/p2p.rs b/packages/provwasm-std/src/types/tendermint/p2p.rs new file mode 100644 index 00000000..f471b7ee --- /dev/null +++ b/packages/provwasm-std/src/types/tendermint/p2p.rs @@ -0,0 +1,288 @@ +use provwasm_proc_macro::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 = "/tendermint.p2p.NetAddress")] +pub struct NetAddress { + #[prost(string, tag = "1")] + pub id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub ip: ::prost::alloc::string::String, + #[prost(uint32, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub port: u32, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.p2p.ProtocolVersion")] +pub struct ProtocolVersion { + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub p2p: u64, + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub block: u64, + #[prost(uint64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub app: u64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.p2p.DefaultNodeInfo")] +pub struct DefaultNodeInfo { + #[prost(message, optional, tag = "1")] + pub protocol_version: ::core::option::Option, + #[prost(string, tag = "2")] + pub default_node_id: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub listen_addr: ::prost::alloc::string::String, + #[prost(string, tag = "4")] + pub network: ::prost::alloc::string::String, + #[prost(string, tag = "5")] + pub version: ::prost::alloc::string::String, + #[prost(bytes = "vec", tag = "6")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub channels: ::prost::alloc::vec::Vec, + #[prost(string, tag = "7")] + pub moniker: ::prost::alloc::string::String, + #[prost(message, optional, tag = "8")] + pub other: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.p2p.DefaultNodeInfoOther")] +pub struct DefaultNodeInfoOther { + #[prost(string, tag = "1")] + pub tx_index: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub rpc_address: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.p2p.PacketPing")] +pub struct PacketPing {} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.p2p.PacketPong")] +pub struct PacketPong {} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.p2p.PacketMsg")] +pub struct PacketMsg { + #[prost(int32, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub channel_id: i32, + #[prost(bool, tag = "2")] + pub eof: bool, + #[prost(bytes = "vec", tag = "3")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.p2p.Packet")] +pub struct Packet { + #[prost(oneof = "packet::Sum", tags = "1, 2, 3")] + pub sum: ::core::option::Option, +} +/// Nested message and enum types in `Packet`. +pub mod packet { + use provwasm_proc_macro::CosmwasmExt; + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive( + Clone, + PartialEq, + Eq, + ::prost::Oneof, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + )] + pub enum Sum { + #[prost(message, tag = "1")] + PacketPing(super::PacketPing), + #[prost(message, tag = "2")] + PacketPong(super::PacketPong), + #[prost(message, tag = "3")] + PacketMsg(super::PacketMsg), + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.p2p.AuthSigMessage")] +pub struct AuthSigMessage { + #[prost(message, optional, tag = "1")] + pub pub_key: ::core::option::Option, + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub sig: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.p2p.PexRequest")] +pub struct PexRequest {} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.p2p.PexAddrs")] +pub struct PexAddrs { + #[prost(message, repeated, tag = "1")] + pub addrs: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.p2p.Message")] +pub struct Message { + #[prost(oneof = "message::Sum", tags = "1, 2")] + pub sum: ::core::option::Option, +} +/// Nested message and enum types in `Message`. +pub mod message { + use provwasm_proc_macro::CosmwasmExt; + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive( + Clone, + PartialEq, + Eq, + ::prost::Oneof, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + )] + pub enum Sum { + #[prost(message, tag = "1")] + PexRequest(super::PexRequest), + #[prost(message, tag = "2")] + PexAddrs(super::PexAddrs), + } +} diff --git a/packages/provwasm-std/src/types/tendermint/privval.rs b/packages/provwasm-std/src/types/tendermint/privval.rs new file mode 100644 index 00000000..465109fc --- /dev/null +++ b/packages/provwasm-std/src/types/tendermint/privval.rs @@ -0,0 +1,250 @@ +use provwasm_proc_macro::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 = "/tendermint.privval.RemoteSignerError")] +pub struct RemoteSignerError { + #[prost(int32, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub code: i32, + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, +} +/// PubKeyRequest requests the consensus public key from the remote signer. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.privval.PubKeyRequest")] +pub struct PubKeyRequest { + #[prost(string, tag = "1")] + pub chain_id: ::prost::alloc::string::String, +} +/// PubKeyResponse is a response message containing the public key. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.privval.PubKeyResponse")] +pub struct PubKeyResponse { + #[prost(message, optional, tag = "1")] + pub pub_key: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub error: ::core::option::Option, +} +/// SignVoteRequest is a request to sign a vote +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.privval.SignVoteRequest")] +pub struct SignVoteRequest { + #[prost(message, optional, tag = "1")] + pub vote: ::core::option::Option, + #[prost(string, tag = "2")] + pub chain_id: ::prost::alloc::string::String, +} +/// SignedVoteResponse is a response containing a signed vote or an error +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.privval.SignedVoteResponse")] +pub struct SignedVoteResponse { + #[prost(message, optional, tag = "1")] + pub vote: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub error: ::core::option::Option, +} +/// SignProposalRequest is a request to sign a proposal +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.privval.SignProposalRequest")] +pub struct SignProposalRequest { + #[prost(message, optional, tag = "1")] + pub proposal: ::core::option::Option, + #[prost(string, tag = "2")] + pub chain_id: ::prost::alloc::string::String, +} +/// SignedProposalResponse is response containing a signed proposal or an error +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.privval.SignedProposalResponse")] +pub struct SignedProposalResponse { + #[prost(message, optional, tag = "1")] + pub proposal: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub error: ::core::option::Option, +} +/// PingRequest is a request to confirm that the connection is alive. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.privval.PingRequest")] +pub struct PingRequest {} +/// PingResponse is a response to confirm that the connection is alive. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.privval.PingResponse")] +pub struct PingResponse {} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.privval.Message")] +pub struct Message { + #[prost(oneof = "message::Sum", tags = "1, 2, 3, 4, 5, 6, 7, 8")] + pub sum: ::core::option::Option, +} +/// Nested message and enum types in `Message`. +pub mod message { + use provwasm_proc_macro::CosmwasmExt; + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive( + Clone, + PartialEq, + Eq, + ::prost::Oneof, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + )] + pub enum Sum { + #[prost(message, tag = "1")] + PubKeyRequest(super::PubKeyRequest), + #[prost(message, tag = "2")] + PubKeyResponse(super::PubKeyResponse), + #[prost(message, tag = "3")] + SignVoteRequest(super::SignVoteRequest), + #[prost(message, tag = "4")] + SignedVoteResponse(super::SignedVoteResponse), + #[prost(message, tag = "5")] + SignProposalRequest(super::SignProposalRequest), + #[prost(message, tag = "6")] + SignedProposalResponse(super::SignedProposalResponse), + #[prost(message, tag = "7")] + PingRequest(super::PingRequest), + #[prost(message, tag = "8")] + PingResponse(super::PingResponse), + } +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +pub enum Errors { + Unknown = 0, + UnexpectedResponse = 1, + NoConnection = 2, + ConnectionTimeout = 3, + ReadTimeout = 4, + WriteTimeout = 5, +} +impl Errors { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Errors::Unknown => "ERRORS_UNKNOWN", + Errors::UnexpectedResponse => "ERRORS_UNEXPECTED_RESPONSE", + Errors::NoConnection => "ERRORS_NO_CONNECTION", + Errors::ConnectionTimeout => "ERRORS_CONNECTION_TIMEOUT", + Errors::ReadTimeout => "ERRORS_READ_TIMEOUT", + Errors::WriteTimeout => "ERRORS_WRITE_TIMEOUT", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "ERRORS_UNKNOWN" => Some(Self::Unknown), + "ERRORS_UNEXPECTED_RESPONSE" => Some(Self::UnexpectedResponse), + "ERRORS_NO_CONNECTION" => Some(Self::NoConnection), + "ERRORS_CONNECTION_TIMEOUT" => Some(Self::ConnectionTimeout), + "ERRORS_READ_TIMEOUT" => Some(Self::ReadTimeout), + "ERRORS_WRITE_TIMEOUT" => Some(Self::WriteTimeout), + _ => None, + } + } +} diff --git a/packages/provwasm-std/src/types/tendermint/rpc/grpc.rs b/packages/provwasm-std/src/types/tendermint/rpc/grpc.rs new file mode 100644 index 00000000..f666b4ec --- /dev/null +++ b/packages/provwasm-std/src/types/tendermint/rpc/grpc.rs @@ -0,0 +1,65 @@ +use provwasm_proc_macro::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 = "/tendermint.rpc.grpc.RequestPing")] +pub struct RequestPing {} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.rpc.grpc.RequestBroadcastTx")] +pub struct RequestBroadcastTx { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub tx: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.rpc.grpc.ResponsePing")] +pub struct ResponsePing {} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.rpc.grpc.ResponseBroadcastTx")] +pub struct ResponseBroadcastTx { + #[prost(message, optional, tag = "1")] + pub check_tx: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub tx_result: ::core::option::Option, +} diff --git a/packages/provwasm-std/src/types/tendermint/rpc/mod.rs b/packages/provwasm-std/src/types/tendermint/rpc/mod.rs new file mode 100644 index 00000000..773d491c --- /dev/null +++ b/packages/provwasm-std/src/types/tendermint/rpc/mod.rs @@ -0,0 +1 @@ +pub mod grpc; diff --git a/packages/provwasm-std/src/types/tendermint/state.rs b/packages/provwasm-std/src/types/tendermint/state.rs new file mode 100644 index 00000000..b7b341ff --- /dev/null +++ b/packages/provwasm-std/src/types/tendermint/state.rs @@ -0,0 +1,229 @@ +use provwasm_proc_macro::CosmwasmExt; +/// LegacyABCIResponses retains the responses +/// of the legacy ABCI calls during block processing. +/// Note ReponseDeliverTx is renamed to ExecTxResult but they are semantically the same +/// Kept for backwards compatibility for versions prior to v0.38 +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.state.LegacyABCIResponses")] +pub struct LegacyAbciResponses { + #[prost(message, repeated, tag = "1")] + pub deliver_txs: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "2")] + pub end_block: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub begin_block: ::core::option::Option, +} +/// ResponseBeginBlock is kept for backwards compatibility for versions prior to v0.38 +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.state.ResponseBeginBlock")] +pub struct ResponseBeginBlock { + #[prost(message, repeated, tag = "1")] + pub events: ::prost::alloc::vec::Vec, +} +/// ResponseEndBlock is kept for backwards compatibility for versions prior to v0.38 +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.state.ResponseEndBlock")] +pub struct ResponseEndBlock { + #[prost(message, repeated, tag = "1")] + pub validator_updates: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "2")] + pub consensus_param_updates: ::core::option::Option, + #[prost(message, repeated, tag = "3")] + pub events: ::prost::alloc::vec::Vec, +} +/// ValidatorsInfo represents the latest validator set, or the last height it changed +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.state.ValidatorsInfo")] +pub struct ValidatorsInfo { + #[prost(message, optional, tag = "1")] + pub validator_set: ::core::option::Option, + #[prost(int64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub last_height_changed: i64, +} +/// ConsensusParamsInfo represents the latest consensus params, or the last height it changed +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.state.ConsensusParamsInfo")] +pub struct ConsensusParamsInfo { + #[prost(message, optional, tag = "1")] + pub consensus_params: ::core::option::Option, + #[prost(int64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub last_height_changed: i64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.state.ABCIResponsesInfo")] +pub struct AbciResponsesInfo { + #[prost(message, optional, tag = "1")] + pub legacy_abci_responses: ::core::option::Option, + #[prost(int64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: i64, + #[prost(message, optional, tag = "3")] + pub response_finalize_block: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.state.Version")] +pub struct Version { + #[prost(message, optional, tag = "1")] + pub consensus: ::core::option::Option, + #[prost(string, tag = "2")] + pub software: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.state.State")] +pub struct State { + #[prost(message, optional, tag = "1")] + pub version: ::core::option::Option, + /// immutable + #[prost(string, tag = "2")] + pub chain_id: ::prost::alloc::string::String, + #[prost(int64, tag = "14")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub initial_height: i64, + /// LastBlockHeight=0 at genesis (ie. block(H=0) does not exist) + #[prost(int64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub last_block_height: i64, + #[prost(message, optional, tag = "4")] + pub last_block_id: ::core::option::Option, + #[prost(message, optional, tag = "5")] + pub last_block_time: ::core::option::Option, + /// LastValidators is used to validate block.LastCommit. + /// Validators are persisted to the database separately every time they change, + /// so we can query for historical validator sets. + /// Note that if s.LastBlockHeight causes a valset change, + /// we set s.LastHeightValidatorsChanged = s.LastBlockHeight + 1 + 1 + /// Extra +1 due to nextValSet delay. + #[prost(message, optional, tag = "6")] + pub next_validators: ::core::option::Option, + #[prost(message, optional, tag = "7")] + pub validators: ::core::option::Option, + #[prost(message, optional, tag = "8")] + pub last_validators: ::core::option::Option, + #[prost(int64, tag = "9")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub last_height_validators_changed: i64, + /// Consensus parameters used for validating blocks. + /// Changes returned by EndBlock and updated after Commit. + #[prost(message, optional, tag = "10")] + pub consensus_params: ::core::option::Option, + #[prost(int64, tag = "11")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub last_height_consensus_params_changed: i64, + /// Merkle root of the results from executing prev block + #[prost(bytes = "vec", tag = "12")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub last_results_hash: ::prost::alloc::vec::Vec, + /// the latest AppHash we've received from calling abci.Commit() + #[prost(bytes = "vec", tag = "13")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub app_hash: ::prost::alloc::vec::Vec, +} diff --git a/packages/provwasm-std/src/types/tendermint/statesync.rs b/packages/provwasm-std/src/types/tendermint/statesync.rs new file mode 100644 index 00000000..42a69a9a --- /dev/null +++ b/packages/provwasm-std/src/types/tendermint/statesync.rs @@ -0,0 +1,170 @@ +use provwasm_proc_macro::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 = "/tendermint.statesync.Message")] +pub struct Message { + #[prost(oneof = "message::Sum", tags = "1, 2, 3, 4")] + pub sum: ::core::option::Option, +} +/// Nested message and enum types in `Message`. +pub mod message { + use provwasm_proc_macro::CosmwasmExt; + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive( + Clone, + PartialEq, + Eq, + ::prost::Oneof, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + )] + pub enum Sum { + #[prost(message, tag = "1")] + SnapshotsRequest(super::SnapshotsRequest), + #[prost(message, tag = "2")] + SnapshotsResponse(super::SnapshotsResponse), + #[prost(message, tag = "3")] + ChunkRequest(super::ChunkRequest), + #[prost(message, tag = "4")] + ChunkResponse(super::ChunkResponse), + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.statesync.SnapshotsRequest")] +pub struct SnapshotsRequest {} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.statesync.SnapshotsResponse")] +pub struct SnapshotsResponse { + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: u64, + #[prost(uint32, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub format: u32, + #[prost(uint32, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub chunks: u32, + #[prost(bytes = "vec", tag = "4")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub hash: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "5")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub metadata: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.statesync.ChunkRequest")] +pub struct ChunkRequest { + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: u64, + #[prost(uint32, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub format: u32, + #[prost(uint32, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub index: u32, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.statesync.ChunkResponse")] +pub struct ChunkResponse { + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: u64, + #[prost(uint32, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub format: u32, + #[prost(uint32, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub index: u32, + #[prost(bytes = "vec", tag = "4")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub chunk: ::prost::alloc::vec::Vec, + #[prost(bool, tag = "5")] + pub missing: bool, +} diff --git a/packages/provwasm-std/src/types/tendermint/store.rs b/packages/provwasm-std/src/types/tendermint/store.rs new file mode 100644 index 00000000..35a0ae59 --- /dev/null +++ b/packages/provwasm-std/src/types/tendermint/store.rs @@ -0,0 +1,27 @@ +use provwasm_proc_macro::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 = "/tendermint.store.BlockStoreState")] +pub struct BlockStoreState { + #[prost(int64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub base: i64, + #[prost(int64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: i64, +} diff --git a/packages/provwasm-std/src/types/tendermint/types.rs b/packages/provwasm-std/src/types/tendermint/types.rs new file mode 100644 index 00000000..5fc0d7c9 --- /dev/null +++ b/packages/provwasm-std/src/types/tendermint/types.rs @@ -0,0 +1,1255 @@ +use provwasm_proc_macro::CosmwasmExt; +/// ConsensusParams contains consensus critical parameters that determine the +/// validity of blocks. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.types.ConsensusParams")] +pub struct ConsensusParams { + #[prost(message, optional, tag = "1")] + pub block: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub evidence: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub validator: ::core::option::Option, + #[prost(message, optional, tag = "4")] + pub version: ::core::option::Option, + #[prost(message, optional, tag = "5")] + pub abci: ::core::option::Option, +} +/// BlockParams contains limits on the block size. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.types.BlockParams")] +pub struct BlockParams { + /// Max block size, in bytes. + /// Note: must be greater than 0 + #[prost(int64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub max_bytes: i64, + /// Max gas per block. + /// Note: must be greater or equal to -1 + #[prost(int64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub max_gas: i64, +} +/// EvidenceParams determine how we handle evidence of malfeasance. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.types.EvidenceParams")] +pub struct EvidenceParams { + /// Max age of evidence, in blocks. + /// + /// The basic formula for calculating this is: MaxAgeDuration / {average block + /// time}. + #[prost(int64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub max_age_num_blocks: i64, + /// Max age of evidence, in time. + /// + /// It should correspond with an app's "unbonding period" or other similar + /// mechanism for handling [Nothing-At-Stake + /// attacks](). + #[prost(message, optional, tag = "2")] + pub max_age_duration: ::core::option::Option, + /// This sets the maximum size of total evidence in bytes that can be committed in a single block. + /// and should fall comfortably under the max block bytes. + /// Default is 1048576 or 1MB + #[prost(int64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub max_bytes: i64, +} +/// ValidatorParams restrict the public key types validators can use. +/// NOTE: uses ABCI pubkey naming, not Amino names. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.types.ValidatorParams")] +pub struct ValidatorParams { + #[prost(string, repeated, tag = "1")] + pub pub_key_types: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// VersionParams contains the ABCI application version. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.types.VersionParams")] +pub struct VersionParams { + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub app: u64, +} +/// HashedParams is a subset of ConsensusParams. +/// +/// It is hashed into the Header.ConsensusHash. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.types.HashedParams")] +pub struct HashedParams { + #[prost(int64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub block_max_bytes: i64, + #[prost(int64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub block_max_gas: i64, +} +/// ABCIParams configure functionality specific to the Application Blockchain Interface. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.types.ABCIParams")] +pub struct AbciParams { + /// vote_extensions_enable_height configures the first height during which + /// vote extensions will be enabled. During this specified height, and for all + /// subsequent heights, precommit messages that do not contain valid extension data + /// will be considered invalid. Prior to this height, vote extensions will not + /// be used or accepted by validators on the network. + /// + /// Once enabled, vote extensions will be created by the application in ExtendVote, + /// passed to the application for validation in VerifyVoteExtension and given + /// to the application to use when proposing a block during PrepareProposal. + #[prost(int64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub vote_extensions_enable_height: i64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.types.ValidatorSet")] +pub struct ValidatorSet { + #[prost(message, repeated, tag = "1")] + pub validators: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "2")] + pub proposer: ::core::option::Option, + #[prost(int64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub total_voting_power: i64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.types.Validator")] +pub struct Validator { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub address: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "2")] + pub pub_key: ::core::option::Option, + #[prost(int64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub voting_power: i64, + #[prost(int64, tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub proposer_priority: i64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.types.SimpleValidator")] +pub struct SimpleValidator { + #[prost(message, optional, tag = "1")] + pub pub_key: ::core::option::Option, + #[prost(int64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub voting_power: i64, +} +/// BlockIdFlag indicates which BlockID the signature is for +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +pub enum BlockIdFlag { + /// indicates an error condition + Unknown = 0, + /// the vote was not received + Absent = 1, + /// voted for the block that received the majority + Commit = 2, + /// voted for nil + Nil = 3, +} +impl BlockIdFlag { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + BlockIdFlag::Unknown => "BLOCK_ID_FLAG_UNKNOWN", + BlockIdFlag::Absent => "BLOCK_ID_FLAG_ABSENT", + BlockIdFlag::Commit => "BLOCK_ID_FLAG_COMMIT", + BlockIdFlag::Nil => "BLOCK_ID_FLAG_NIL", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "BLOCK_ID_FLAG_UNKNOWN" => Some(Self::Unknown), + "BLOCK_ID_FLAG_ABSENT" => Some(Self::Absent), + "BLOCK_ID_FLAG_COMMIT" => Some(Self::Commit), + "BLOCK_ID_FLAG_NIL" => Some(Self::Nil), + _ => None, + } + } +} +/// PartsetHeader +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.types.PartSetHeader")] +pub struct PartSetHeader { + #[prost(uint32, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub total: u32, + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub hash: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.types.Part")] +pub struct Part { + #[prost(uint32, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub index: u32, + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub bytes: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "3")] + pub proof: ::core::option::Option, +} +/// BlockID +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.types.BlockID")] +pub struct BlockId { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub hash: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "2")] + pub part_set_header: ::core::option::Option, +} +/// Header defines the structure of a block header. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.types.Header")] +pub struct Header { + /// basic block info + #[prost(message, optional, tag = "1")] + pub version: ::core::option::Option, + #[prost(string, tag = "2")] + pub chain_id: ::prost::alloc::string::String, + #[prost(int64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: i64, + #[prost(message, optional, tag = "4")] + pub time: ::core::option::Option, + /// prev block info + #[prost(message, optional, tag = "5")] + pub last_block_id: ::core::option::Option, + /// hashes of block data + /// + /// commit from validators from the last block + #[prost(bytes = "vec", tag = "6")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub last_commit_hash: ::prost::alloc::vec::Vec, + /// transactions + #[prost(bytes = "vec", tag = "7")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub data_hash: ::prost::alloc::vec::Vec, + /// hashes from the app output from the prev block + /// + /// validators for the current block + #[prost(bytes = "vec", tag = "8")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub validators_hash: ::prost::alloc::vec::Vec, + /// validators for the next block + #[prost(bytes = "vec", tag = "9")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub next_validators_hash: ::prost::alloc::vec::Vec, + /// consensus params for current block + #[prost(bytes = "vec", tag = "10")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub consensus_hash: ::prost::alloc::vec::Vec, + /// state after txs from the previous block + #[prost(bytes = "vec", tag = "11")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub app_hash: ::prost::alloc::vec::Vec, + /// root hash of all results from the txs from the previous block + #[prost(bytes = "vec", tag = "12")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub last_results_hash: ::prost::alloc::vec::Vec, + /// consensus info + /// + /// evidence included in the block + #[prost(bytes = "vec", tag = "13")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub evidence_hash: ::prost::alloc::vec::Vec, + /// original proposer of the block + #[prost(bytes = "vec", tag = "14")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub proposer_address: ::prost::alloc::vec::Vec, +} +/// Data contains the set of transactions included in the block +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.types.Data")] +pub struct Data { + /// Txs that will be applied by state @ block.Height+1. + /// NOTE: not all txs here are valid. We're just agreeing on the order first. + /// This means that block.AppHash does not include these txs. + #[prost(bytes = "vec", repeated, tag = "1")] + pub txs: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, +} +/// Vote represents a prevote or precommit vote from validators for +/// consensus. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.types.Vote")] +pub struct Vote { + #[prost(enumeration = "SignedMsgType", tag = "1")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub r#type: i32, + #[prost(int64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: i64, + #[prost(int32, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub round: i32, + /// zero if vote is nil. + #[prost(message, optional, tag = "4")] + pub block_id: ::core::option::Option, + #[prost(message, optional, tag = "5")] + pub timestamp: ::core::option::Option, + #[prost(bytes = "vec", tag = "6")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub validator_address: ::prost::alloc::vec::Vec, + #[prost(int32, tag = "7")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub validator_index: i32, + /// Vote signature by the validator if they participated in consensus for the + /// associated block. + #[prost(bytes = "vec", tag = "8")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub signature: ::prost::alloc::vec::Vec, + /// Vote extension provided by the application. Only valid for precommit + /// messages. + #[prost(bytes = "vec", tag = "9")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub extension: ::prost::alloc::vec::Vec, + /// Vote extension signature by the validator if they participated in + /// consensus for the associated block. + /// Only valid for precommit messages. + #[prost(bytes = "vec", tag = "10")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub extension_signature: ::prost::alloc::vec::Vec, +} +/// Commit contains the evidence that a block was committed by a set of validators. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.types.Commit")] +pub struct Commit { + #[prost(int64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: i64, + #[prost(int32, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub round: i32, + #[prost(message, optional, tag = "3")] + pub block_id: ::core::option::Option, + #[prost(message, repeated, tag = "4")] + pub signatures: ::prost::alloc::vec::Vec, +} +/// CommitSig is a part of the Vote included in a Commit. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.types.CommitSig")] +pub struct CommitSig { + #[prost(enumeration = "BlockIdFlag", tag = "1")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub block_id_flag: i32, + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub validator_address: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "3")] + pub timestamp: ::core::option::Option, + #[prost(bytes = "vec", tag = "4")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub signature: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.types.ExtendedCommit")] +pub struct ExtendedCommit { + #[prost(int64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: i64, + #[prost(int32, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub round: i32, + #[prost(message, optional, tag = "3")] + pub block_id: ::core::option::Option, + #[prost(message, repeated, tag = "4")] + pub extended_signatures: ::prost::alloc::vec::Vec, +} +/// ExtendedCommitSig retains all the same fields as CommitSig but adds vote +/// extension-related fields. We use two signatures to ensure backwards compatibility. +/// That is the digest of the original signature is still the same in prior versions +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.types.ExtendedCommitSig")] +pub struct ExtendedCommitSig { + #[prost(enumeration = "BlockIdFlag", tag = "1")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub block_id_flag: i32, + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub validator_address: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "3")] + pub timestamp: ::core::option::Option, + #[prost(bytes = "vec", tag = "4")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub signature: ::prost::alloc::vec::Vec, + /// Vote extension data + #[prost(bytes = "vec", tag = "5")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub extension: ::prost::alloc::vec::Vec, + /// Vote extension signature + #[prost(bytes = "vec", tag = "6")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub extension_signature: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.types.Proposal")] +pub struct Proposal { + #[prost(enumeration = "SignedMsgType", tag = "1")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub r#type: i32, + #[prost(int64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: i64, + #[prost(int32, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub round: i32, + #[prost(int32, tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub pol_round: i32, + #[prost(message, optional, tag = "5")] + pub block_id: ::core::option::Option, + #[prost(message, optional, tag = "6")] + pub timestamp: ::core::option::Option, + #[prost(bytes = "vec", tag = "7")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub signature: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.types.SignedHeader")] +pub struct SignedHeader { + #[prost(message, optional, tag = "1")] + pub header: ::core::option::Option
, + #[prost(message, optional, tag = "2")] + pub commit: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.types.LightBlock")] +pub struct LightBlock { + #[prost(message, optional, tag = "1")] + pub signed_header: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub validator_set: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.types.BlockMeta")] +pub struct BlockMeta { + #[prost(message, optional, tag = "1")] + pub block_id: ::core::option::Option, + #[prost(int64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub block_size: i64, + #[prost(message, optional, tag = "3")] + pub header: ::core::option::Option
, + #[prost(int64, tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub num_txs: i64, +} +/// TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.types.TxProof")] +pub struct TxProof { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub root_hash: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub data: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "3")] + pub proof: ::core::option::Option, +} +/// SignedMsgType is a type of signed message in the consensus. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +pub enum SignedMsgType { + Unknown = 0, + /// Votes + Prevote = 1, + Precommit = 2, + /// Proposals + Proposal = 32, +} +impl SignedMsgType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + SignedMsgType::Unknown => "SIGNED_MSG_TYPE_UNKNOWN", + SignedMsgType::Prevote => "SIGNED_MSG_TYPE_PREVOTE", + SignedMsgType::Precommit => "SIGNED_MSG_TYPE_PRECOMMIT", + SignedMsgType::Proposal => "SIGNED_MSG_TYPE_PROPOSAL", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "SIGNED_MSG_TYPE_UNKNOWN" => Some(Self::Unknown), + "SIGNED_MSG_TYPE_PREVOTE" => Some(Self::Prevote), + "SIGNED_MSG_TYPE_PRECOMMIT" => Some(Self::Precommit), + "SIGNED_MSG_TYPE_PROPOSAL" => Some(Self::Proposal), + _ => None, + } + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.types.Evidence")] +pub struct Evidence { + #[prost(oneof = "evidence::Sum", tags = "1, 2")] + pub sum: ::core::option::Option, +} +/// Nested message and enum types in `Evidence`. +pub mod evidence { + use provwasm_proc_macro::CosmwasmExt; + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive( + Clone, + PartialEq, + Eq, + ::prost::Oneof, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + )] + pub enum Sum { + #[prost(message, tag = "1")] + DuplicateVoteEvidence(super::DuplicateVoteEvidence), + #[prost(message, tag = "2")] + LightClientAttackEvidence(super::LightClientAttackEvidence), + } +} +/// DuplicateVoteEvidence contains evidence of a validator signed two conflicting votes. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.types.DuplicateVoteEvidence")] +pub struct DuplicateVoteEvidence { + #[prost(message, optional, tag = "1")] + pub vote_a: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub vote_b: ::core::option::Option, + #[prost(int64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub total_voting_power: i64, + #[prost(int64, tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub validator_power: i64, + #[prost(message, optional, tag = "5")] + pub timestamp: ::core::option::Option, +} +/// LightClientAttackEvidence contains evidence of a set of validators attempting to mislead a light client. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.types.LightClientAttackEvidence")] +pub struct LightClientAttackEvidence { + #[prost(message, optional, tag = "1")] + pub conflicting_block: ::core::option::Option, + #[prost(int64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub common_height: i64, + #[prost(message, repeated, tag = "3")] + pub byzantine_validators: ::prost::alloc::vec::Vec, + #[prost(int64, tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub total_voting_power: i64, + #[prost(message, optional, tag = "5")] + pub timestamp: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.types.EvidenceList")] +pub struct EvidenceList { + #[prost(message, repeated, tag = "1")] + pub evidence: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.types.Block")] +pub struct Block { + #[prost(message, optional, tag = "1")] + pub header: ::core::option::Option
, + #[prost(message, optional, tag = "2")] + pub data: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub evidence: ::core::option::Option, + #[prost(message, optional, tag = "4")] + pub last_commit: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.types.EventDataRoundState")] +pub struct EventDataRoundState { + #[prost(int64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: i64, + #[prost(int32, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub round: i32, + #[prost(string, tag = "3")] + pub step: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.types.CanonicalBlockID")] +pub struct CanonicalBlockId { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub hash: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "2")] + pub part_set_header: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.types.CanonicalPartSetHeader")] +pub struct CanonicalPartSetHeader { + #[prost(uint32, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub total: u32, + #[prost(bytes = "vec", tag = "2")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub hash: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.types.CanonicalProposal")] +pub struct CanonicalProposal { + /// type alias for byte + #[prost(enumeration = "SignedMsgType", tag = "1")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub r#type: i32, + /// canonicalization requires fixed size encoding here + #[prost(sfixed64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: i64, + /// canonicalization requires fixed size encoding here + #[prost(sfixed64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub round: i64, + #[prost(int64, tag = "4")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub pol_round: i64, + #[prost(message, optional, tag = "5")] + pub block_id: ::core::option::Option, + #[prost(message, optional, tag = "6")] + pub timestamp: ::core::option::Option, + #[prost(string, tag = "7")] + pub chain_id: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.types.CanonicalVote")] +pub struct CanonicalVote { + /// type alias for byte + #[prost(enumeration = "SignedMsgType", tag = "1")] + #[serde( + serialize_with = "crate::serde::enum_as_i32::serialize", + deserialize_with = "crate::serde::enum_as_i32::deserialize" + )] + pub r#type: i32, + /// canonicalization requires fixed size encoding here + #[prost(sfixed64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: i64, + /// canonicalization requires fixed size encoding here + #[prost(sfixed64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub round: i64, + #[prost(message, optional, tag = "4")] + pub block_id: ::core::option::Option, + #[prost(message, optional, tag = "5")] + pub timestamp: ::core::option::Option, + #[prost(string, tag = "6")] + pub chain_id: ::prost::alloc::string::String, +} +/// CanonicalVoteExtension provides us a way to serialize a vote extension from +/// a particular validator such that we can sign over those serialized bytes. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.types.CanonicalVoteExtension")] +pub struct CanonicalVoteExtension { + #[prost(bytes = "vec", tag = "1")] + #[serde( + serialize_with = "crate::serde::as_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" + )] + pub extension: ::prost::alloc::vec::Vec, + #[prost(sfixed64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub height: i64, + #[prost(sfixed64, tag = "3")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub round: i64, + #[prost(string, tag = "4")] + pub chain_id: ::prost::alloc::string::String, +} diff --git a/packages/provwasm-std/src/types/tendermint/version.rs b/packages/provwasm-std/src/types/tendermint/version.rs new file mode 100644 index 00000000..b08f00ac --- /dev/null +++ b/packages/provwasm-std/src/types/tendermint/version.rs @@ -0,0 +1,55 @@ +use provwasm_proc_macro::CosmwasmExt; +/// App includes the protocol and software version for the application. +/// This information is included in ResponseInfo. The App.Protocol can be +/// updated in ResponseEndBlock. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.version.App")] +pub struct App { + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub protocol: u64, + #[prost(string, tag = "2")] + pub software: ::prost::alloc::string::String, +} +/// Consensus captures the consensus rules for processing a block in the blockchain, +/// including all blockchain data structures and the rules of the application's +/// state transition machine. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/tendermint.version.Consensus")] +pub struct Consensus { + #[prost(uint64, tag = "1")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub block: u64, + #[prost(uint64, tag = "2")] + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + pub app: u64, +} From ecd0585e2b596f18d3b37513b79831a1107e4501 Mon Sep 17 00:00:00 2001 From: kwt <4344285+kwtalley@users.noreply.github.com> Date: Fri, 12 Jul 2024 01:20:13 -0500 Subject: [PATCH 24/43] add types mod --- packages/provwasm-std/src/types/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/provwasm-std/src/types/mod.rs b/packages/provwasm-std/src/types/mod.rs index 31a5fc73..a5c401b9 100644 --- a/packages/provwasm-std/src/types/mod.rs +++ b/packages/provwasm-std/src/types/mod.rs @@ -1,4 +1,6 @@ +pub mod capability; pub mod cosmos; pub mod cosmwasm; pub mod ibc; pub mod provenance; +pub mod tendermint; From 1edee5571e82af579e2a924922d017230949c740 Mon Sep 17 00:00:00 2001 From: kwt <4344285+kwtalley@users.noreply.github.com> Date: Fri, 12 Jul 2024 01:23:35 -0500 Subject: [PATCH 25/43] update to cosmwasm 2.1 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 18c40561..8571eb39 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,7 +27,7 @@ license = "Apache-2.0" ### CosmWasm cosmwasm-schema = { version = "2.0.4" } -cosmwasm-std = { version = "2.0.4", default-features = false, features = ["cosmwasm_2_0", "stargate", "std"] } +cosmwasm-std = { version = "2.1.0", default-features = false, features = ["cosmwasm_2_1", "stargate", "std"] } cw-storage-plus = { version = "2.0.0" } ### ProvWasm From 55799cf2168ed2f20afedc68067c34d0385611e5 Mon Sep 17 00:00:00 2001 From: kwt <4344285+kwtalley@users.noreply.github.com> Date: Fri, 12 Jul 2024 06:29:48 -0500 Subject: [PATCH 26/43] cleanup transformers --- packages/proto-build/src/transformers.rs | 135 +++++++++++------------ 1 file changed, 62 insertions(+), 73 deletions(-) diff --git a/packages/proto-build/src/transformers.rs b/packages/proto-build/src/transformers.rs index d8f0ba74..8e0ee732 100644 --- a/packages/proto-build/src/transformers.rs +++ b/packages/proto-build/src/transformers.rs @@ -190,7 +190,7 @@ pub fn allow_serde_int_as_str(s: ItemStruct) -> ItemStruct { } pub fn allow_serde_vec_int_as_vec_str(s: ItemStruct) -> ItemStruct { - let vec_int_types = vec![ + let vec_int_types: Vec = vec![ parse_quote!(::prost::alloc::vec::Vec), parse_quote!(::prost::alloc::vec::Vec), parse_quote!(::prost::alloc::vec::Vec), @@ -207,21 +207,18 @@ pub fn allow_serde_vec_int_as_vec_str(s: ItemStruct) -> ItemStruct { let fields_vec = s .fields - .clone() .into_iter() .map(|mut field| { - if vec_int_types.contains(&field.ty) { + if let Some(_) = vec_int_types.iter().position(|ty| ty.eq(&field.ty)) { let from_str: syn::Attribute = parse_quote! { #[serde( serialize_with = "crate::serde::as_str_vec::serialize", deserialize_with = "crate::serde::as_str_vec::deserialize" )] }; - field.attrs.append(&mut vec![from_str]); - field - } else { - field + field.attrs.push(from_str); } + field }) .collect::>(); @@ -266,35 +263,36 @@ pub fn allow_serde_vec_u8_as_base64_encoded_string_or_string_bytes(s: ItemStruct let fields_vec = s .fields - .clone() .into_iter() .map(|mut field| { if field.ty == parse_quote!(::prost::alloc::vec::Vec) { - let from_str: syn::Attribute = if field - .clone() - .ident - .is_some_and(|x| str_as_byte_fields.contains(&&***&&x.to_string())) - { - parse_quote! { - #[serde( - serialize_with = "crate::serde::as_str_bytes::serialize", - deserialize_with = "crate::serde::as_str_bytes::deserialize" - )] - } + let should_serialize_as_str = field.ident.as_ref().map_or(false, |x| { + str_as_byte_fields.contains(&x.to_string().as_str()) + }); + + let serialize_with = if should_serialize_as_str { + "crate::serde::as_str_bytes::serialize" } else { - parse_quote! { - #[serde( - serialize_with = "crate::serde::as_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_base64_encoded_string::deserialize" - )] - } + "crate::serde::as_base64_encoded_string::serialize" }; - field.attrs.append(&mut vec![from_str]); - field - } else { - field + let deserialize_with = if should_serialize_as_str { + "crate::serde::as_str_bytes::deserialize" + } else { + "crate::serde::as_base64_encoded_string::deserialize" + }; + + let from_str: syn::Attribute = parse_quote! { + #[serde( + serialize_with = #serialize_with, + deserialize_with = #deserialize_with + )] + }; + + field.attrs.push(from_str); } + + field }) .collect::>(); @@ -318,23 +316,18 @@ pub fn allow_serde_vec_vec_u8_as_vec_string_bytes(s: ItemStruct) -> ItemStruct { .into_iter() .map(|mut field| { if field.ty == parse_quote!(::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>) { - if field - .clone() - .ident - .is_some_and(|x| str_as_byte_fields.contains(&&***&&x.to_string())) - { - field.attrs.append(&mut vec![parse_quote! { + if field.ident.as_ref().map_or(false, |ident| { + str_as_byte_fields.contains(&ident.to_string().as_str()) + }) { + field.attrs.push(parse_quote! { #[serde( serialize_with = "crate::serde::as_str_bytes_vec::serialize", deserialize_with = "crate::serde::as_str_bytes_vec::deserialize" )] - }]); - }; - - field - } else { - field + }); + } } + field }) .collect::>(); @@ -371,33 +364,33 @@ pub fn make_next_key_optional(mut s: ItemStruct) -> ItemStruct { } pub fn allow_serde_option_vec_u8_as_base64_encoded_string(s: syn::ItemStruct) -> syn::ItemStruct { - let fields_vec = s.fields + let fields_vec = s + .fields .clone() .into_iter() .map(|mut field| { if let syn::Type::Path(type_path) = &field.ty { - if let Some(segment) = type_path.path.segments.last() { + if type_path.path.segments.iter().any(|segment| { if segment.ident == "Option" { if let syn::PathArguments::AngleBracketed(args) = &segment.arguments { - if let Some(arg) = args.args.first() { - if let syn::GenericArgument::Type(inner_ty) = arg { - if let syn::Type::Path(inner_path) = inner_ty { - if let Some(inner_segment) = inner_path.path.segments.last() { - if inner_segment.ident == "Vec" { - let from_str: syn::Attribute = parse_quote! { - #[serde( - serialize_with = "crate::serde::as_option_base64_encoded_string::serialize", - deserialize_with = "crate::serde::as_option_base64_encoded_string::deserialize" - )] - }; - field.attrs.push(from_str); - } - } - } + if let Some(syn::GenericArgument::Type(inner_ty)) = args.args.first() { + if let syn::Type::Path(inner_path) = inner_ty { + return inner_path.path.segments.iter().any(|inner_segment| { + inner_segment.ident == "Vec" + }); } } } } + false + }) { + let from_str: syn::Attribute = parse_quote! { + #[serde( + serialize_with = "crate::serde::as_option_base64_encoded_string::serialize", + deserialize_with = "crate::serde::as_option_base64_encoded_string::deserialize" + )] + }; + field.attrs.push(from_str); } } field @@ -420,25 +413,21 @@ pub fn allow_serde_int_as_str_or_enum_as_i32(s: syn::ItemStruct) -> syn::ItemStr .into_iter() .map(|mut field| { if field.ty == parse_quote!(i32) { - let mut add_serde_attrs = false; - for attr in &field.attrs { + let add_serde_attrs = field.attrs.iter().any(|attr| { if attr.path.is_ident("prost") { - if let Ok(meta) = attr.parse_meta() { - if let syn::Meta::List(meta_list) = meta { - for nested_meta in meta_list.nested.iter() { - if let syn::NestedMeta::Meta(syn::Meta::NameValue(name_value)) = - nested_meta - { - if name_value.path.is_ident("enumeration") { - add_serde_attrs = true; - break; - } - } + if let Ok(syn::Meta::List(meta_list)) = attr.parse_meta() { + return meta_list.nested.iter().any(|nested_meta| { + if let syn::NestedMeta::Meta(syn::Meta::NameValue(name_value)) = + nested_meta + { + return name_value.path.is_ident("enumeration"); } - } + false + }); } } - } + false + }); if add_serde_attrs { field.attrs.push(parse_quote! { From 5481fc628f93f75e40fd4c17a943b0ad0f2b8415 Mon Sep 17 00:00:00 2001 From: kwt <4344285+kwtalley@users.noreply.github.com> Date: Fri, 12 Jul 2024 06:31:52 -0500 Subject: [PATCH 27/43] add ability to exclude specific structure types from generation --- packages/proto-build/src/transform.rs | 80 ++++++++++++++++++--------- 1 file changed, 53 insertions(+), 27 deletions(-) diff --git a/packages/proto-build/src/transform.rs b/packages/proto-build/src/transform.rs index 973747e9..1982af4b 100644 --- a/packages/proto-build/src/transform.rs +++ b/packages/proto-build/src/transform.rs @@ -16,13 +16,19 @@ use crate::transformers; /// (i.e. because they are sourced from `tendermint-proto`) const EXCLUDED_PROTO_PACKAGES: &[&str] = &["amino", "cosmos_proto", "gogoproto", "google"]; +/// These structures are excluded from the final module +const EXCLUDED_STRUCTURES: &[&str] = &[ + "provenance::msgfees::v1::CalculateTxFeesRequest", + "provenance::msgfees::v1::CalculateTxFeesResponse", +]; + pub fn copy_and_transform_all(from_dir: &Path, to_dir: &Path, descriptor: &FileDescriptorSet) { let root = PathBuf::from(env!("CARGO_MANIFEST_DIR")); let to_dir = root.join(to_dir); debug!("Copying generated files into '{}'...", to_dir.display()); // Remove old compiled files - remove_dir_all(&to_dir).unwrap_or_default(); + remove_dir_all(&to_dir).unwrap_or(()); create_dir_all(&to_dir).unwrap(); let mut filenames = Vec::new(); @@ -133,32 +139,52 @@ fn transform_items( ) -> Vec { items .into_iter() - .map(|i| match i { - Item::Struct(s) => Item::Struct({ - let s = transformers::add_derive_eq_struct(&s); - let s = transformers::append_attrs_struct(src, &s, descriptor); - // A hack to make Pagination::next_key optional. - // Remove if [this PR](https://github.com/cosmos/cosmos-sdk/pull/20246) is merged and released - let s = transformers::make_next_key_optional(s); - let s = transformers::allow_serde_option_vec_u8_as_base64_encoded_string(s); - let s = - transformers::allow_serde_vec_u8_as_base64_encoded_string_or_string_bytes(s); - let s = transformers::allow_serde_vec_vec_u8_as_vec_string_bytes(s); - let s = transformers::allow_serde_int_as_str(s); - let s = transformers::allow_serde_int_as_str_or_enum_as_i32(s); - - transformers::allow_serde_vec_int_as_vec_str(s) - }), - - Item::Enum(e) => Item::Enum({ - let e = transformers::add_derive_eq_enum(&e); - transformers::append_attrs_enum(src, &e, descriptor) - }), - - // This is a temporary hack to fix the issue with clashing stake authorization validators - Item::Mod(m) => Item::Mod(transformers::fix_clashing_stake_authorization_validators(m)), - - i => i, + .filter_map(|i| { + match i { + Item::Struct(s) => Some(Item::Struct({ + let full_path = match src.file_stem() { + Some(file_stem) => { + format!( + "{}::{}", + file_stem.to_str().unwrap().replace(".", "::"), + s.ident.to_string() + ) + } + _ => s.ident.to_string(), + }; + + if EXCLUDED_STRUCTURES.contains(&full_path.as_str()) { + return None; + } + let s = transformers::add_derive_eq_struct(&s); + let s = transformers::append_attrs_struct(src, &s, descriptor); + // A hack to make Pagination::next_key optional. + // Remove if [this PR](https://github.com/cosmos/cosmos-sdk/pull/20246) is merged and released + let s = transformers::make_next_key_optional(s); + let s = transformers::allow_serde_option_vec_u8_as_base64_encoded_string(s); + let s = + transformers::allow_serde_vec_u8_as_base64_encoded_string_or_string_bytes( + s, + ); + let s = transformers::allow_serde_vec_vec_u8_as_vec_string_bytes(s); + let s = transformers::allow_serde_int_as_str(s); + let s = transformers::allow_serde_int_as_str_or_enum_as_i32(s); + + transformers::allow_serde_vec_int_as_vec_str(s) + })), + + Item::Enum(e) => Some(Item::Enum({ + let e = transformers::add_derive_eq_enum(&e); + transformers::append_attrs_enum(src, &e, descriptor) + })), + + // This is a temporary hack to fix the issue with clashing stake authorization validators + Item::Mod(m) => Some(Item::Mod( + transformers::fix_clashing_stake_authorization_validators(m), + )), + + i => Some(i), + } }) .map(|i: Item| transform_nested_mod(i, src, ancestors, descriptor)) .collect::>() From 31b3575b0eb76dd14d3a7b7fbf01bfb13de8c280 Mon Sep 17 00:00:00 2001 From: kwt <4344285+kwtalley@users.noreply.github.com> Date: Fri, 12 Jul 2024 06:34:00 -0500 Subject: [PATCH 28/43] add code generator for root modules as feature flags --- packages/proto-build/src/code_generator.rs | 1 + packages/proto-build/src/mod_gen.rs | 43 ++++++++++++++++++++-- 2 files changed, 41 insertions(+), 3 deletions(-) diff --git a/packages/proto-build/src/code_generator.rs b/packages/proto-build/src/code_generator.rs index cb01eed1..e1729f50 100644 --- a/packages/proto-build/src/code_generator.rs +++ b/packages/proto-build/src/code_generator.rs @@ -78,6 +78,7 @@ impl CodeGenerator { fn generate_mod_file(&self) { mod_gen::generate_mod_file(&self.absolute_out_dir()); + mod_gen::add_root_features(&self.absolute_out_dir()); } fn transform(&self) { diff --git a/packages/proto-build/src/mod_gen.rs b/packages/proto-build/src/mod_gen.rs index f6487dcc..2bec3736 100644 --- a/packages/proto-build/src/mod_gen.rs +++ b/packages/proto-build/src/mod_gen.rs @@ -1,11 +1,13 @@ -use itertools::Itertools; -use proc_macro2::TokenStream as TokenStream2; -use quote::{format_ident, quote}; use std::ffi::OsStr; use std::fs; use std::fs::create_dir_all; use std::path::{Path, PathBuf}; +use itertools::Itertools; +use proc_macro2::TokenStream as TokenStream2; +use quote::{format_ident, quote, ToTokens}; +use syn::{self, File, Item}; + pub fn generate_mod_file(for_dir: &Path) { let root = PathBuf::from(env!("CARGO_MANIFEST_DIR")); let types_dir = root.join(for_dir); @@ -113,3 +115,38 @@ fn create_mod_rs(ts: TokenStream2, path: &Path) { panic!("[error] Error while generating mod.rs: {}", e); } } + +pub fn add_root_features(root: &PathBuf) { + // Read mod.rs + let mod_rs_path = root.join("mod.rs"); + let contents = fs::read_to_string(&mod_rs_path).expect("Unable to read mod.rs file"); + + // Parse mod.rs into a syntax tree + let mut syntax_tree: File = syn::parse_file(&contents).expect("Unable to parse mod.rs file"); + + // Update items + for item in syntax_tree.items.iter_mut() { + if let Item::Mod(module) = item { + // Create the feature flag attribute + let feature_name = format!("feature = \"{}\"", module.ident); + let feature_meta: syn::Meta = + syn::parse_str(&feature_name).expect("Failed to parse feature attribute"); + let feature_attr = syn::Attribute { + pound_token: syn::token::Pound::default(), + style: syn::AttrStyle::Outer, + bracket_token: syn::token::Bracket::default(), + path: syn::Path::from(syn::Ident::new("cfg", module.ident.span())), + tokens: quote::quote!( ( #feature_meta ) ).into(), + }; + + // Add the feature attribute to the module's attributes + module.attrs.push(feature_attr); + } + } + + // Generate the updated file contents + let updated_file = syntax_tree.to_token_stream().to_string(); + + // Write the updated contents back to mod.rs + fs::write(mod_rs_path, updated_file).expect("Unable to write to mod.rs file"); +} From 4d8946d3e6c52d54c036295e354a2ec1f1d1b2c0 Mon Sep 17 00:00:00 2001 From: kwt <4344285+kwtalley@users.noreply.github.com> Date: Fri, 12 Jul 2024 06:34:50 -0500 Subject: [PATCH 29/43] generated feature flags and update cargo.toml --- packages/provwasm-std/Cargo.toml | 9 +++++++++ packages/provwasm-std/src/lib.rs | 2 +- packages/provwasm-std/src/types/mod.rs | 6 ++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/packages/provwasm-std/Cargo.toml b/packages/provwasm-std/Cargo.toml index d9512878..2268cc56 100644 --- a/packages/provwasm-std/Cargo.toml +++ b/packages/provwasm-std/Cargo.toml @@ -22,3 +22,12 @@ serde = { workspace = true, default-features = false, features = ["derive"] } serde-cw-value = "0.7.0" base64 = "0.21.0" strum_macros = "0.25.3" + +[features] +default = ["cosmos", "provenance"] +capability = [] +cosmos = ["tendermint"] +cosmwasm = [] +ibc = [] +provenance = ["ibc"] +tendermint = [] \ No newline at end of file diff --git a/packages/provwasm-std/src/lib.rs b/packages/provwasm-std/src/lib.rs index c9bbc904..462685f9 100644 --- a/packages/provwasm-std/src/lib.rs +++ b/packages/provwasm-std/src/lib.rs @@ -10,9 +10,9 @@ pub mod shim; clippy::too_many_arguments )] pub mod types; -// Indicate that smart contracts that use this lib can only be run on the Provenance Blockchain. pub use shim::{cosmwasm_to_proto_coins, try_proto_to_cosmwasm_coins}; +// Indicate that smart contracts that use this lib can only be run on the Provenance Blockchain. #[no_mangle] extern "C" fn requires_provenance() {} diff --git a/packages/provwasm-std/src/types/mod.rs b/packages/provwasm-std/src/types/mod.rs index a5c401b9..27f93290 100644 --- a/packages/provwasm-std/src/types/mod.rs +++ b/packages/provwasm-std/src/types/mod.rs @@ -1,6 +1,12 @@ +#[cfg(feature = "capability")] pub mod capability; +#[cfg(feature = "cosmos")] pub mod cosmos; +#[cfg(feature = "cosmwasm")] pub mod cosmwasm; +#[cfg(feature = "ibc")] pub mod ibc; +#[cfg(feature = "provenance")] pub mod provenance; +#[cfg(feature = "tendermint")] pub mod tendermint; From 3db2ed054c8e129abbe979800a878173271efe37 Mon Sep 17 00:00:00 2001 From: kwt <4344285+kwtalley@users.noreply.github.com> Date: Fri, 12 Jul 2024 06:42:07 -0500 Subject: [PATCH 30/43] update contract schemas --- contracts/marker/schema/marker.json | 30 ++ contracts/name/schema/name.json | 16 + contracts/scope/schema/scope.json | 527 ++++++++++++++++++++++++++++ 3 files changed, 573 insertions(+) diff --git a/contracts/marker/schema/marker.json b/contracts/marker/schema/marker.json index b1488622..3fda29f3 100644 --- a/contracts/marker/schema/marker.json +++ b/contracts/marker/schema/marker.json @@ -339,6 +339,7 @@ "additionalProperties": false, "definitions": { "AccessGrant": { + "description": "AccessGrant associates a collection of permissions with an address for delegated marker account control.", "type": "object", "required": [ "address", @@ -380,6 +381,7 @@ } }, "BaseAccount": { + "description": "BaseAccount defines a base account type. It contains all the necessary fields for basic account functionality. Any custom account type should extend this type for additional functionality (e.g. vesting).", "type": "object", "required": [ "account_number", @@ -413,6 +415,7 @@ } }, "Coin": { + "description": "Coin defines a token with a denomination and an amount.\n\nNOTE: The amount field is an Int which implements the custom method signatures required by gogoproto.", "type": "object", "required": [ "amount", @@ -428,6 +431,7 @@ } }, "MarkerAccount": { + "description": "MarkerAccount holds the marker configuration information in addition to a base account structure.", "type": "object", "required": [ "access_control", @@ -443,18 +447,22 @@ ], "properties": { "access_control": { + "description": "Access control lists", "type": "array", "items": { "$ref": "#/definitions/AccessGrant" } }, "allow_forced_transfer": { + "description": "Whether an admin can transfer restricted coins from a 3rd-party account without their signature.", "type": "boolean" }, "allow_governance_control": { + "description": "indicates that governance based control is allowed for this marker", "type": "boolean" }, "base_account": { + "description": "base cosmos account information including address and coin holdings.", "anyOf": [ { "$ref": "#/definitions/BaseAccount" @@ -465,29 +473,36 @@ ] }, "denom": { + "description": "value denomination and total supply for the token.", "type": "string" }, "manager": { + "description": "Address that owns the marker configuration. This account must sign any requests to change marker config (only valid for statuses prior to finalization)", "type": "string" }, "marker_type": { + "description": "Marker type information", "type": "integer", "format": "int32" }, "required_attributes": { + "description": "list of required attributes on restricted marker in order to send and receive transfers if sender does not have transfer authority", "type": "array", "items": { "type": "string" } }, "status": { + "description": "Indicates the current status of this marker record.", "type": "integer", "format": "int32" }, "supply": { + "description": "the total supply expected for a marker. This is the amount that is minted when a marker is created.", "type": "string" }, "supply_fixed": { + "description": "A fixed supply will mint additional coin automatically if the total supply decreases below a set value. This may occur if the coin is burned or an account holding the coin is slashed. (default: true)", "type": "boolean" } } @@ -516,6 +531,7 @@ "additionalProperties": false, "definitions": { "AccessGrant": { + "description": "AccessGrant associates a collection of permissions with an address for delegated marker account control.", "type": "object", "required": [ "address", @@ -557,6 +573,7 @@ } }, "BaseAccount": { + "description": "BaseAccount defines a base account type. It contains all the necessary fields for basic account functionality. Any custom account type should extend this type for additional functionality (e.g. vesting).", "type": "object", "required": [ "account_number", @@ -590,6 +607,7 @@ } }, "Coin": { + "description": "Coin defines a token with a denomination and an amount.\n\nNOTE: The amount field is an Int which implements the custom method signatures required by gogoproto.", "type": "object", "required": [ "amount", @@ -605,6 +623,7 @@ } }, "MarkerAccount": { + "description": "MarkerAccount holds the marker configuration information in addition to a base account structure.", "type": "object", "required": [ "access_control", @@ -620,18 +639,22 @@ ], "properties": { "access_control": { + "description": "Access control lists", "type": "array", "items": { "$ref": "#/definitions/AccessGrant" } }, "allow_forced_transfer": { + "description": "Whether an admin can transfer restricted coins from a 3rd-party account without their signature.", "type": "boolean" }, "allow_governance_control": { + "description": "indicates that governance based control is allowed for this marker", "type": "boolean" }, "base_account": { + "description": "base cosmos account information including address and coin holdings.", "anyOf": [ { "$ref": "#/definitions/BaseAccount" @@ -642,29 +665,36 @@ ] }, "denom": { + "description": "value denomination and total supply for the token.", "type": "string" }, "manager": { + "description": "Address that owns the marker configuration. This account must sign any requests to change marker config (only valid for statuses prior to finalization)", "type": "string" }, "marker_type": { + "description": "Marker type information", "type": "integer", "format": "int32" }, "required_attributes": { + "description": "list of required attributes on restricted marker in order to send and receive transfers if sender does not have transfer authority", "type": "array", "items": { "type": "string" } }, "status": { + "description": "Indicates the current status of this marker record.", "type": "integer", "format": "int32" }, "supply": { + "description": "the total supply expected for a marker. This is the amount that is minted when a marker is created.", "type": "string" }, "supply_fixed": { + "description": "A fixed supply will mint additional coin automatically if the total supply decreases below a set value. This may occur if the coin is burned or an account holding the coin is slashed. (default: true)", "type": "boolean" } } diff --git a/contracts/name/schema/name.json b/contracts/name/schema/name.json index 987d2a53..c3f8d247 100644 --- a/contracts/name/schema/name.json +++ b/contracts/name/schema/name.json @@ -131,18 +131,21 @@ "lookup": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "QueryReverseLookupResponse", + "description": "QueryReverseLookupResponse is the response type for the Query/Resolve method.", "type": "object", "required": [ "name" ], "properties": { "name": { + "description": "an array of names bound against a given address", "type": "array", "items": { "type": "string" } }, "pagination": { + "description": "pagination defines an optional pagination for the request.", "anyOf": [ { "$ref": "#/definitions/PageResponse" @@ -155,12 +158,14 @@ }, "definitions": { "PageResponse": { + "description": "PageResponse is to be embedded in gRPC response messages where the corresponding request message has used PageRequest.\n\nmessage SomeResponse { repeated Bar results = 1; PageResponse page = 2; }", "type": "object", "required": [ "total" ], "properties": { "next_key": { + "description": "next_key is the key to be passed to PageRequest.key to query the next page most efficiently. It will be empty if there are no more results.", "type": [ "array", "null" @@ -172,6 +177,7 @@ } }, "total": { + "description": "total is total number of results available if PageRequest.count_total was set, its value is undefined otherwise", "type": "integer", "format": "uint64", "minimum": 0.0 @@ -183,9 +189,11 @@ "params": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "QueryParamsResponse", + "description": "QueryParamsResponse is the response type for the Query/Params RPC method.", "type": "object", "properties": { "params": { + "description": "params defines the parameters of the module.", "anyOf": [ { "$ref": "#/definitions/Params" @@ -198,6 +206,7 @@ }, "definitions": { "Params": { + "description": "Params defines the set of params for the name module.", "type": "object", "required": [ "allow_unrestricted_names", @@ -207,19 +216,23 @@ ], "properties": { "allow_unrestricted_names": { + "description": "determines if unrestricted name keys are allowed or not", "type": "boolean" }, "max_name_levels": { + "description": "maximum number of name segments to allow. Example: `foo.bar.baz` would be 3", "type": "integer", "format": "uint32", "minimum": 0.0 }, "max_segment_length": { + "description": "maximum length of name segment to allow", "type": "integer", "format": "uint32", "minimum": 0.0 }, "min_segment_length": { + "description": "minimum length of name segment to allow", "type": "integer", "format": "uint32", "minimum": 0.0 @@ -231,6 +244,7 @@ "resolve": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "QueryResolveResponse", + "description": "QueryResolveResponse is the response type for the Query/Resolve method.", "type": "object", "required": [ "address", @@ -238,9 +252,11 @@ ], "properties": { "address": { + "description": "a string containing the address the name resolves to", "type": "string" }, "restricted": { + "description": "Whether owner signature is required to add sub-names.", "type": "boolean" } } diff --git a/contracts/scope/schema/scope.json b/contracts/scope/schema/scope.json index 4363d67b..0dfe4b12 100644 --- a/contracts/scope/schema/scope.json +++ b/contracts/scope/schema/scope.json @@ -51,6 +51,7 @@ ], "definitions": { "Party": { + "description": "A Party is an address with/in a given role associated with a contract", "type": "object", "required": [ "address", @@ -59,18 +60,22 @@ ], "properties": { "address": { + "description": "address of the account (on chain)", "type": "string" }, "optional": { + "description": "whether this party's signature is optional", "type": "boolean" }, "role": { + "description": "a role for this account within the context of the processes used", "type": "integer", "format": "int32" } } }, "Scope": { + "description": "Scope defines a root reference for a collection of records owned by one or more parties.", "type": "object", "required": [ "data_access", @@ -82,21 +87,25 @@ ], "properties": { "data_access": { + "description": "Addresses in this list are authorized to receive off-chain data associated with this scope.", "type": "array", "items": { "type": "string" } }, "owners": { + "description": "These parties represent top level owners of the records within. These parties must sign any requests that modify the data within the scope. These addresses are in union with parties listed on the sessions.", "type": "array", "items": { "$ref": "#/definitions/Party" } }, "require_party_rollup": { + "description": "Whether all parties in this scope and its sessions must be present in this scope's owners field. This also enables use of optional=true scope owners and session parties.", "type": "boolean" }, "scope_id": { + "description": "Unique ID for this scope. Implements sdk.Address interface for use where addresses are required in Cosmos", "type": "array", "items": { "type": "integer", @@ -105,6 +114,7 @@ } }, "specification_id": { + "description": "the scope specification that contains the specifications for data elements allowed within this scope", "type": "array", "items": { "type": "integer", @@ -113,6 +123,7 @@ } }, "value_owner_address": { + "description": "An address that controls the value associated with this scope. Standard blockchain accounts and marker accounts are supported for this value. This attribute may only be changed by the entity indicated once it is set.", "type": "string" } } @@ -240,12 +251,14 @@ "get_contract_spec": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "ContractSpecificationResponse", + "description": "ContractSpecificationResponse is the response type for the Query/ContractSpecification RPC method.", "type": "object", "required": [ "record_specifications" ], "properties": { "contract_specification": { + "description": "contract_specification is the wrapped contract specification.", "anyOf": [ { "$ref": "#/definitions/ContractSpecificationWrapper" @@ -256,12 +269,14 @@ ] }, "record_specifications": { + "description": "record_specifications is any number or wrapped record specifications associated with this contract_specification (if requested).", "type": "array", "items": { "$ref": "#/definitions/RecordSpecificationWrapper" } }, "request": { + "description": "request is a copy of the request that generated these results.", "anyOf": [ { "$ref": "#/definitions/ContractSpecificationRequest" @@ -274,6 +289,7 @@ }, "definitions": { "ContractSpecIdInfo": { + "description": "ContractSpecIdInfo contains various info regarding a contract specification id.", "type": "object", "required": [ "contract_spec_addr", @@ -284,9 +300,11 @@ ], "properties": { "contract_spec_addr": { + "description": "contract_spec_addr is the bech32 string version of the contract_spec_id.", "type": "string" }, "contract_spec_id": { + "description": "contract_spec_id is the raw bytes of the contract specification address.", "type": "array", "items": { "type": "integer", @@ -295,6 +313,7 @@ } }, "contract_spec_id_contract_spec_uuid": { + "description": "contract_spec_id_contract_spec_uuid is the contract_spec_uuid portion of the contract_spec_id.", "type": "array", "items": { "type": "integer", @@ -303,6 +322,7 @@ } }, "contract_spec_id_prefix": { + "description": "contract_spec_id_prefix is the prefix portion of the contract_spec_id.", "type": "array", "items": { "type": "integer", @@ -311,11 +331,13 @@ } }, "contract_spec_uuid": { + "description": "contract_spec_uuid is the uuid hex string of the contract_spec_id_contract_spec_uuid.", "type": "string" } } }, "ContractSpecification": { + "description": "ContractSpecification defines the required parties, resources, conditions, and consideration outputs for a contract", "type": "object", "required": [ "class_name", @@ -325,9 +347,11 @@ ], "properties": { "class_name": { + "description": "name of the class/type of this contract executable", "type": "string" }, "description": { + "description": "Description information for this contract specification", "anyOf": [ { "$ref": "#/definitions/Description" @@ -338,12 +362,14 @@ ] }, "owner_addresses": { + "description": "Address of the account that owns this specificaiton", "type": "array", "items": { "type": "string" } }, "parties_involved": { + "description": "a list of party roles that must be fullfilled when signing a transaction for this contract specification", "type": "array", "items": { "type": "integer", @@ -351,6 +377,7 @@ } }, "source": { + "description": "Reference to a metadata record with a hash and type information for the instance of code that will process this contract", "anyOf": [ { "$ref": "#/definitions/Source" @@ -361,6 +388,7 @@ ] }, "specification_id": { + "description": "unique identifier for this specification on chain", "type": "array", "items": { "type": "integer", @@ -371,6 +399,7 @@ } }, "ContractSpecificationRequest": { + "description": "ContractSpecificationRequest is the request type for the Query/ContractSpecification RPC method.", "type": "object", "required": [ "exclude_id_info", @@ -380,23 +409,29 @@ ], "properties": { "exclude_id_info": { + "description": "exclude_id_info is a flag for whether to exclude the id info from the response.", "type": "boolean" }, "include_record_specs": { + "description": "include_record_specs is a flag for whether to include the the record specifications of this contract specification in the response.", "type": "boolean" }, "include_request": { + "description": "include_request is a flag for whether to include this request in your result.", "type": "boolean" }, "specification_id": { + "description": "specification_id can either be a uuid, e.g. def6bc0a-c9dd-4874-948f-5206e6060a84 or a bech32 contract specification address, e.g. contractspec1q000d0q2e8w5say53afqdesxp2zqzkr4fn. It can also be a record specification address, e.g. recspec1qh00d0q2e8w5say53afqdesxp2zw42dq2jdvmdazuwzcaddhh8gmuqhez44.", "type": "string" } } }, "ContractSpecificationWrapper": { + "description": "ContractSpecificationWrapper contains a single contract specification and some extra identifiers for it.", "type": "object", "properties": { "contract_spec_id_info": { + "description": "contract_spec_id_info contains information about the id/address of the contract specification.", "anyOf": [ { "$ref": "#/definitions/ContractSpecIdInfo" @@ -407,6 +442,7 @@ ] }, "specification": { + "description": "specification is the on-chain contract specification message.", "anyOf": [ { "$ref": "#/definitions/ContractSpecification" @@ -419,6 +455,7 @@ } }, "Description": { + "description": "Description holds general information that is handy to associate with a structure.", "type": "object", "required": [ "description", @@ -428,20 +465,25 @@ ], "properties": { "description": { + "description": "A description of this thing.", "type": "string" }, "icon_url": { + "description": "URL of an icon.", "type": "string" }, "name": { + "description": "A Name for this thing.", "type": "string" }, "website_url": { + "description": "URL to find even more info.", "type": "string" } } }, "InputSpecification": { + "description": "InputSpecification defines a name, type_name, and source reference (either on or off chain) to define an input parameter", "type": "object", "required": [ "name", @@ -449,9 +491,11 @@ ], "properties": { "name": { + "description": "name for this input", "type": "string" }, "source": { + "description": "source is either on chain (record_id) or off-chain (hash)", "anyOf": [ { "$ref": "#/definitions/Source2" @@ -462,11 +506,13 @@ ] }, "type_name": { + "description": "a type_name (typically a proto name or class_name)", "type": "string" } } }, "RecordSpecIdInfo": { + "description": "RecordSpecIdInfo contains various info regarding a record specification id.", "type": "object", "required": [ "record_spec_addr", @@ -477,6 +523,7 @@ ], "properties": { "contract_spec_id_info": { + "description": "contract_spec_id_info is information about the contract spec id referenced in the record_spec_id.", "anyOf": [ { "$ref": "#/definitions/ContractSpecIdInfo" @@ -487,9 +534,11 @@ ] }, "record_spec_addr": { + "description": "record_spec_addr is the bech32 string version of the record_spec_id.", "type": "string" }, "record_spec_id": { + "description": "record_spec_id is the raw bytes of the record specification address.", "type": "array", "items": { "type": "integer", @@ -498,6 +547,7 @@ } }, "record_spec_id_contract_spec_uuid": { + "description": "record_spec_id_contract_spec_uuid is the contract_spec_uuid portion of the record_spec_id.", "type": "array", "items": { "type": "integer", @@ -506,6 +556,7 @@ } }, "record_spec_id_hashed_name": { + "description": "record_spec_id_hashed_name is the hashed name portion of the record_spec_id.", "type": "array", "items": { "type": "integer", @@ -514,6 +565,7 @@ } }, "record_spec_id_prefix": { + "description": "record_spec_id_prefix is the prefix portion of the record_spec_id.", "type": "array", "items": { "type": "integer", @@ -524,6 +576,7 @@ } }, "RecordSpecification": { + "description": "RecordSpecification defines the specification for a Record including allowed/required inputs/outputs", "type": "object", "required": [ "inputs", @@ -535,15 +588,18 @@ ], "properties": { "inputs": { + "description": "A set of inputs that must be satisified to apply this RecordSpecification and create a Record", "type": "array", "items": { "$ref": "#/definitions/InputSpecification" } }, "name": { + "description": "Name of Record that will be created when this specification is used", "type": "string" }, "responsible_parties": { + "description": "Type of party responsible for this record", "type": "array", "items": { "type": "integer", @@ -551,10 +607,12 @@ } }, "result_type": { + "description": "Type of result for this record specification (must be RECORD or RECORD_LIST)", "type": "integer", "format": "int32" }, "specification_id": { + "description": "unique identifier for this specification on chain", "type": "array", "items": { "type": "integer", @@ -563,14 +621,17 @@ } }, "type_name": { + "description": "A type name for data associated with this record (typically a class or proto name)", "type": "string" } } }, "RecordSpecificationWrapper": { + "description": "RecordSpecificationWrapper contains a single record specification and some extra identifiers for it.", "type": "object", "properties": { "record_spec_id_info": { + "description": "record_spec_id_info contains information about the id/address of the record specification.", "anyOf": [ { "$ref": "#/definitions/RecordSpecIdInfo" @@ -581,6 +642,7 @@ ] }, "specification": { + "description": "specification is the on-chain record specification message.", "anyOf": [ { "$ref": "#/definitions/RecordSpecification" @@ -593,8 +655,10 @@ } }, "Source": { + "description": "Reference to a metadata record with a hash and type information for the instance of code that will process this contract", "oneOf": [ { + "description": "the address of a record on chain that represents this contract", "type": "object", "required": [ "ResourceId" @@ -612,6 +676,7 @@ "additionalProperties": false }, { + "description": "the hash of contract binary (off-chain instance)", "type": "object", "required": [ "Hash" @@ -626,8 +691,10 @@ ] }, "Source2": { + "description": "source is either on chain (record_id) or off-chain (hash)", "oneOf": [ { + "description": "the address of a record on chain (For Established Records)", "type": "object", "required": [ "RecordId" @@ -645,6 +712,7 @@ "additionalProperties": false }, { + "description": "the hash of an off-chain piece of information (For Proposed Records)", "type": "object", "required": [ "Hash" @@ -663,6 +731,7 @@ "get_record_by_name": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "RecordsResponse", + "description": "RecordsResponse is the response type for the Query/Records RPC method.", "type": "object", "required": [ "records", @@ -670,12 +739,14 @@ ], "properties": { "records": { + "description": "records is any number of wrapped record results.", "type": "array", "items": { "$ref": "#/definitions/RecordWrapper" } }, "request": { + "description": "request is a copy of the request that generated these results.", "anyOf": [ { "$ref": "#/definitions/RecordsRequest" @@ -686,6 +757,7 @@ ] }, "scope": { + "description": "scope is the wrapped scope that holds these records (if requested).", "anyOf": [ { "$ref": "#/definitions/ScopeWrapper" @@ -696,6 +768,7 @@ ] }, "sessions": { + "description": "sessions is any number of wrapped sessions that hold these records (if requested).", "type": "array", "items": { "$ref": "#/definitions/SessionWrapper" @@ -704,6 +777,7 @@ }, "definitions": { "AuditFields": { + "description": "AuditFields capture information about the last account to make modifications and when they were made", "type": "object", "required": [ "created_by", @@ -713,9 +787,11 @@ ], "properties": { "created_by": { + "description": "the address of the account that created this record", "type": "string" }, "created_date": { + "description": "the date/time when this entry was created", "anyOf": [ { "$ref": "#/definitions/Timestamp" @@ -726,12 +802,15 @@ ] }, "message": { + "description": "an optional message associated with the creation/update event", "type": "string" }, "updated_by": { + "description": "the address of the account that modified this record", "type": "string" }, "updated_date": { + "description": "the date/time when this entry was last updated", "anyOf": [ { "$ref": "#/definitions/Timestamp" @@ -742,6 +821,7 @@ ] }, "version": { + "description": "an optional version number that is incremented with each update", "type": "integer", "format": "uint32", "minimum": 0.0 @@ -749,6 +829,7 @@ } }, "ContractSpecIdInfo": { + "description": "ContractSpecIdInfo contains various info regarding a contract specification id.", "type": "object", "required": [ "contract_spec_addr", @@ -759,9 +840,11 @@ ], "properties": { "contract_spec_addr": { + "description": "contract_spec_addr is the bech32 string version of the contract_spec_id.", "type": "string" }, "contract_spec_id": { + "description": "contract_spec_id is the raw bytes of the contract specification address.", "type": "array", "items": { "type": "integer", @@ -770,6 +853,7 @@ } }, "contract_spec_id_contract_spec_uuid": { + "description": "contract_spec_id_contract_spec_uuid is the contract_spec_uuid portion of the contract_spec_id.", "type": "array", "items": { "type": "integer", @@ -778,6 +862,7 @@ } }, "contract_spec_id_prefix": { + "description": "contract_spec_id_prefix is the prefix portion of the contract_spec_id.", "type": "array", "items": { "type": "integer", @@ -786,11 +871,13 @@ } }, "contract_spec_uuid": { + "description": "contract_spec_uuid is the uuid hex string of the contract_spec_id_contract_spec_uuid.", "type": "string" } } }, "Party": { + "description": "A Party is an address with/in a given role associated with a contract", "type": "object", "required": [ "address", @@ -799,18 +886,22 @@ ], "properties": { "address": { + "description": "address of the account (on chain)", "type": "string" }, "optional": { + "description": "whether this party's signature is optional", "type": "boolean" }, "role": { + "description": "a role for this account within the context of the processes used", "type": "integer", "format": "int32" } } }, "Process": { + "description": "Process contains information used to uniquely identify what was used to generate this record", "type": "object", "required": [ "method", @@ -818,12 +909,15 @@ ], "properties": { "method": { + "description": "method is a name or reference to a specific operation (method) within a class/contract that was invoked", "type": "string" }, "name": { + "description": "a name associated with the process (type_name, classname or smart contract common name)", "type": "string" }, "process_id": { + "description": "unique identifier for this process", "anyOf": [ { "$ref": "#/definitions/ProcessId" @@ -836,8 +930,10 @@ } }, "ProcessId": { + "description": "unique identifier for this process", "oneOf": [ { + "description": "the address of a smart contract used for this process", "type": "object", "required": [ "Address" @@ -850,6 +946,7 @@ "additionalProperties": false }, { + "description": "the hash of an off-chain process used", "type": "object", "required": [ "Hash" @@ -864,6 +961,7 @@ ] }, "Record": { + "description": "A record (of fact) is attached to a session or each consideration output from a contract", "type": "object", "required": [ "inputs", @@ -874,21 +972,25 @@ ], "properties": { "inputs": { + "description": "inputs used with the process to achieve the output on this record", "type": "array", "items": { "$ref": "#/definitions/RecordInput" } }, "name": { + "description": "name/identifier for this record. Value must be unique within the scope. Also known as a Fact name", "type": "string" }, "outputs": { + "description": "output(s) is the results of executing the process on the given process indicated in this record", "type": "array", "items": { "$ref": "#/definitions/RecordOutput" } }, "process": { + "description": "process contain information used to uniquely identify an execution on or off chain that generated this record", "anyOf": [ { "$ref": "#/definitions/Process" @@ -899,6 +1001,7 @@ ] }, "session_id": { + "description": "id of the session context that was used to create this record (use with filtered kvprefix iterator)", "type": "array", "items": { "type": "integer", @@ -907,6 +1010,7 @@ } }, "specification_id": { + "description": "specification_id is the id of the record specification that was used to create this record.", "type": "array", "items": { "type": "integer", @@ -917,6 +1021,7 @@ } }, "RecordIdInfo": { + "description": "RecordIdInfo contains various info regarding a record id.", "type": "object", "required": [ "record_addr", @@ -927,9 +1032,11 @@ ], "properties": { "record_addr": { + "description": "record_addr is the bech32 string version of the record_id.", "type": "string" }, "record_id": { + "description": "record_id is the raw bytes of the record address.", "type": "array", "items": { "type": "integer", @@ -938,6 +1045,7 @@ } }, "record_id_hashed_name": { + "description": "record_id_hashed_name is the hashed name portion of the record_id.", "type": "array", "items": { "type": "integer", @@ -946,6 +1054,7 @@ } }, "record_id_prefix": { + "description": "record_id_prefix is the prefix portion of the record_id.", "type": "array", "items": { "type": "integer", @@ -954,6 +1063,7 @@ } }, "record_id_scope_uuid": { + "description": "record_id_scope_uuid is the scope_uuid portion of the record_id.", "type": "array", "items": { "type": "integer", @@ -962,6 +1072,7 @@ } }, "scope_id_info": { + "description": "scope_id_info is information about the scope id referenced in the record_id.", "anyOf": [ { "$ref": "#/definitions/ScopeIdInfo" @@ -974,6 +1085,7 @@ } }, "RecordInput": { + "description": "Tracks the inputs used to establish this record", "type": "object", "required": [ "name", @@ -982,9 +1094,11 @@ ], "properties": { "name": { + "description": "Name value included to link back to the definition spec.", "type": "string" }, "source": { + "description": "data source", "anyOf": [ { "$ref": "#/definitions/Source" @@ -995,15 +1109,18 @@ ] }, "status": { + "description": "Indicates if this input was a recorded fact on chain or just a given hashed input", "type": "integer", "format": "int32" }, "type_name": { + "description": "from proposed fact structure to unmarshal", "type": "string" } } }, "RecordOutput": { + "description": "RecordOutput encapsulates the output of a process recorded on chain", "type": "object", "required": [ "hash", @@ -1011,15 +1128,18 @@ ], "properties": { "hash": { + "description": "Hash of the data output that was output/generated for this record", "type": "string" }, "status": { + "description": "Status of the process execution associated with this output indicating success,failure, or pending", "type": "integer", "format": "int32" } } }, "RecordSpecIdInfo": { + "description": "RecordSpecIdInfo contains various info regarding a record specification id.", "type": "object", "required": [ "record_spec_addr", @@ -1030,6 +1150,7 @@ ], "properties": { "contract_spec_id_info": { + "description": "contract_spec_id_info is information about the contract spec id referenced in the record_spec_id.", "anyOf": [ { "$ref": "#/definitions/ContractSpecIdInfo" @@ -1040,9 +1161,11 @@ ] }, "record_spec_addr": { + "description": "record_spec_addr is the bech32 string version of the record_spec_id.", "type": "string" }, "record_spec_id": { + "description": "record_spec_id is the raw bytes of the record specification address.", "type": "array", "items": { "type": "integer", @@ -1051,6 +1174,7 @@ } }, "record_spec_id_contract_spec_uuid": { + "description": "record_spec_id_contract_spec_uuid is the contract_spec_uuid portion of the record_spec_id.", "type": "array", "items": { "type": "integer", @@ -1059,6 +1183,7 @@ } }, "record_spec_id_hashed_name": { + "description": "record_spec_id_hashed_name is the hashed name portion of the record_spec_id.", "type": "array", "items": { "type": "integer", @@ -1067,6 +1192,7 @@ } }, "record_spec_id_prefix": { + "description": "record_spec_id_prefix is the prefix portion of the record_spec_id.", "type": "array", "items": { "type": "integer", @@ -1077,9 +1203,11 @@ } }, "RecordWrapper": { + "description": "RecordWrapper contains a single record and some extra identifiers for it.", "type": "object", "properties": { "record": { + "description": "record is the on-chain record message.", "anyOf": [ { "$ref": "#/definitions/Record" @@ -1090,6 +1218,7 @@ ] }, "record_id_info": { + "description": "record_id_info contains information about the id/address of the record.", "anyOf": [ { "$ref": "#/definitions/RecordIdInfo" @@ -1100,6 +1229,7 @@ ] }, "record_spec_id_info": { + "description": "record_spec_id_info contains information about the id/address of the record specification.", "anyOf": [ { "$ref": "#/definitions/RecordSpecIdInfo" @@ -1112,6 +1242,7 @@ } }, "RecordsRequest": { + "description": "RecordsRequest is the request type for the Query/Records RPC method.", "type": "object", "required": [ "exclude_id_info", @@ -1125,32 +1256,41 @@ ], "properties": { "exclude_id_info": { + "description": "exclude_id_info is a flag for whether to exclude the id info from the response.", "type": "boolean" }, "include_request": { + "description": "include_request is a flag for whether to include this request in your result.", "type": "boolean" }, "include_scope": { + "description": "include_scope is a flag for whether to include the the scope containing these records in the response.", "type": "boolean" }, "include_sessions": { + "description": "include_sessions is a flag for whether to include the sessions containing these records in the response.", "type": "boolean" }, "name": { + "description": "name is the name of the record to look for", "type": "string" }, "record_addr": { + "description": "record_addr is a bech32 record address, e.g. record1q2ge0zaztu65tx5x5llv5xc9ztsw42dq2jdvmdazuwzcaddhh8gmu3mcze3.", "type": "string" }, "scope_id": { + "description": "scope_id can either be a uuid, e.g. 91978ba2-5f35-459a-86a7-feca1b0512e0 or a bech32 scope address, e.g. scope1qzge0zaztu65tx5x5llv5xc9ztsqxlkwel.", "type": "string" }, "session_id": { + "description": "session_id can either be a uuid, e.g. 5803f8bc-6067-4eb5-951f-2121671c2ec0 or a bech32 session address, e.g. session1qxge0zaztu65tx5x5llv5xc9zts9sqlch3sxwn44j50jzgt8rshvqyfrjcr. This can only be a uuid if a scope_id is also provided.", "type": "string" } } }, "Scope": { + "description": "Scope defines a root reference for a collection of records owned by one or more parties.", "type": "object", "required": [ "data_access", @@ -1162,21 +1302,25 @@ ], "properties": { "data_access": { + "description": "Addresses in this list are authorized to receive off-chain data associated with this scope.", "type": "array", "items": { "type": "string" } }, "owners": { + "description": "These parties represent top level owners of the records within. These parties must sign any requests that modify the data within the scope. These addresses are in union with parties listed on the sessions.", "type": "array", "items": { "$ref": "#/definitions/Party" } }, "require_party_rollup": { + "description": "Whether all parties in this scope and its sessions must be present in this scope's owners field. This also enables use of optional=true scope owners and session parties.", "type": "boolean" }, "scope_id": { + "description": "Unique ID for this scope. Implements sdk.Address interface for use where addresses are required in Cosmos", "type": "array", "items": { "type": "integer", @@ -1185,6 +1329,7 @@ } }, "specification_id": { + "description": "the scope specification that contains the specifications for data elements allowed within this scope", "type": "array", "items": { "type": "integer", @@ -1193,11 +1338,13 @@ } }, "value_owner_address": { + "description": "An address that controls the value associated with this scope. Standard blockchain accounts and marker accounts are supported for this value. This attribute may only be changed by the entity indicated once it is set.", "type": "string" } } }, "ScopeIdInfo": { + "description": "ScopeIdInfo contains various info regarding a scope id.", "type": "object", "required": [ "scope_addr", @@ -1208,9 +1355,11 @@ ], "properties": { "scope_addr": { + "description": "scope_addr is the bech32 string version of the scope_id.", "type": "string" }, "scope_id": { + "description": "scope_id is the raw bytes of the scope address.", "type": "array", "items": { "type": "integer", @@ -1219,6 +1368,7 @@ } }, "scope_id_prefix": { + "description": "scope_id_prefix is the prefix portion of the scope_id.", "type": "array", "items": { "type": "integer", @@ -1227,6 +1377,7 @@ } }, "scope_id_scope_uuid": { + "description": "scope_id_scope_uuid is the scope_uuid portion of the scope_id.", "type": "array", "items": { "type": "integer", @@ -1235,11 +1386,13 @@ } }, "scope_uuid": { + "description": "scope_uuid is the uuid hex string of the scope_id_scope_uuid.", "type": "string" } } }, "ScopeSpecIdInfo": { + "description": "ScopeSpecIdInfo contains various info regarding a scope specification id.", "type": "object", "required": [ "scope_spec_addr", @@ -1250,9 +1403,11 @@ ], "properties": { "scope_spec_addr": { + "description": "scope_spec_addr is the bech32 string version of the scope_spec_id.", "type": "string" }, "scope_spec_id": { + "description": "scope_spec_id is the raw bytes of the scope specification address.", "type": "array", "items": { "type": "integer", @@ -1261,6 +1416,7 @@ } }, "scope_spec_id_prefix": { + "description": "scope_spec_id_prefix is the prefix portion of the scope_spec_id.", "type": "array", "items": { "type": "integer", @@ -1269,6 +1425,7 @@ } }, "scope_spec_id_scope_spec_uuid": { + "description": "scope_spec_id_scope_spec_uuid is the scope_spec_uuid portion of the scope_spec_id.", "type": "array", "items": { "type": "integer", @@ -1277,14 +1434,17 @@ } }, "scope_spec_uuid": { + "description": "scope_spec_uuid is the uuid hex string of the scope_spec_id_scope_spec_uuid.", "type": "string" } } }, "ScopeWrapper": { + "description": "SessionWrapper contains a single scope and its uuid.", "type": "object", "properties": { "scope": { + "description": "scope is the on-chain scope message.", "anyOf": [ { "$ref": "#/definitions/Scope" @@ -1295,6 +1455,7 @@ ] }, "scope_id_info": { + "description": "scope_id_info contains information about the id/address of the scope.", "anyOf": [ { "$ref": "#/definitions/ScopeIdInfo" @@ -1305,6 +1466,7 @@ ] }, "scope_spec_id_info": { + "description": "scope_spec_id_info contains information about the id/address of the scope specification.", "anyOf": [ { "$ref": "#/definitions/ScopeSpecIdInfo" @@ -1317,6 +1479,7 @@ } }, "Session": { + "description": "Session defines an execution context against a specific specification instance. The context will have a specification and set of parties involved.\n\nNOTE: When there are no more Records within a Scope that reference a Session, the Session is removed.", "type": "object", "required": [ "context", @@ -1327,6 +1490,7 @@ ], "properties": { "audit": { + "description": "Created by, updated by, timestamps, version number, and related info.", "anyOf": [ { "$ref": "#/definitions/AuditFields" @@ -1337,6 +1501,7 @@ ] }, "context": { + "description": "context is a field for storing client specific data associated with a session.", "type": "array", "items": { "type": "integer", @@ -1345,9 +1510,11 @@ } }, "name": { + "description": "name to associate with this session execution context, typically classname", "type": "string" }, "parties": { + "description": "parties is the set of identities that signed this contract", "type": "array", "items": { "$ref": "#/definitions/Party" @@ -1362,6 +1529,7 @@ } }, "specification_id": { + "description": "unique id of the contract specification that was used to create this session.", "type": "array", "items": { "type": "integer", @@ -1372,6 +1540,7 @@ } }, "SessionIdInfo": { + "description": "SessionIdInfo contains various info regarding a session id.", "type": "object", "required": [ "session_addr", @@ -1383,6 +1552,7 @@ ], "properties": { "scope_id_info": { + "description": "scope_id_info is information about the scope id referenced in the session_id.", "anyOf": [ { "$ref": "#/definitions/ScopeIdInfo" @@ -1393,9 +1563,11 @@ ] }, "session_addr": { + "description": "session_addr is the bech32 string version of the session_id.", "type": "string" }, "session_id": { + "description": "session_id is the raw bytes of the session address.", "type": "array", "items": { "type": "integer", @@ -1404,6 +1576,7 @@ } }, "session_id_prefix": { + "description": "session_id_prefix is the prefix portion of the session_id.", "type": "array", "items": { "type": "integer", @@ -1412,6 +1585,7 @@ } }, "session_id_scope_uuid": { + "description": "session_id_scope_uuid is the scope_uuid portion of the session_id.", "type": "array", "items": { "type": "integer", @@ -1420,6 +1594,7 @@ } }, "session_id_session_uuid": { + "description": "session_id_session_uuid is the session_uuid portion of the session_id.", "type": "array", "items": { "type": "integer", @@ -1428,14 +1603,17 @@ } }, "session_uuid": { + "description": "session_uuid is the uuid hex string of the session_id_session_uuid.", "type": "string" } } }, "SessionWrapper": { + "description": "SessionWrapper contains a single session and some extra identifiers for it.", "type": "object", "properties": { "contract_spec_id_info": { + "description": "contract_spec_id_info contains information about the id/address of the contract specification.", "anyOf": [ { "$ref": "#/definitions/ContractSpecIdInfo" @@ -1446,6 +1624,7 @@ ] }, "session": { + "description": "session is the on-chain session message.", "anyOf": [ { "$ref": "#/definitions/Session" @@ -1456,6 +1635,7 @@ ] }, "session_id_info": { + "description": "session_id_info contains information about the id/address of the session.", "anyOf": [ { "$ref": "#/definitions/SessionIdInfo" @@ -1468,8 +1648,10 @@ } }, "Source": { + "description": "data source", "oneOf": [ { + "description": "the address of a record on chain (For Established Records)", "type": "object", "required": [ "RecordId" @@ -1487,6 +1669,7 @@ "additionalProperties": false }, { + "description": "the hash of an off-chain piece of information (For Proposed Records)", "type": "object", "required": [ "Hash" @@ -1530,6 +1713,7 @@ }, "definitions": { "AuditFields": { + "description": "AuditFields capture information about the last account to make modifications and when they were made", "type": "object", "required": [ "created_by", @@ -1539,9 +1723,11 @@ ], "properties": { "created_by": { + "description": "the address of the account that created this record", "type": "string" }, "created_date": { + "description": "the date/time when this entry was created", "anyOf": [ { "$ref": "#/definitions/Timestamp" @@ -1552,12 +1738,15 @@ ] }, "message": { + "description": "an optional message associated with the creation/update event", "type": "string" }, "updated_by": { + "description": "the address of the account that modified this record", "type": "string" }, "updated_date": { + "description": "the date/time when this entry was last updated", "anyOf": [ { "$ref": "#/definitions/Timestamp" @@ -1568,6 +1757,7 @@ ] }, "version": { + "description": "an optional version number that is incremented with each update", "type": "integer", "format": "uint32", "minimum": 0.0 @@ -1575,6 +1765,7 @@ } }, "ContractSpecIdInfo": { + "description": "ContractSpecIdInfo contains various info regarding a contract specification id.", "type": "object", "required": [ "contract_spec_addr", @@ -1585,9 +1776,11 @@ ], "properties": { "contract_spec_addr": { + "description": "contract_spec_addr is the bech32 string version of the contract_spec_id.", "type": "string" }, "contract_spec_id": { + "description": "contract_spec_id is the raw bytes of the contract specification address.", "type": "array", "items": { "type": "integer", @@ -1596,6 +1789,7 @@ } }, "contract_spec_id_contract_spec_uuid": { + "description": "contract_spec_id_contract_spec_uuid is the contract_spec_uuid portion of the contract_spec_id.", "type": "array", "items": { "type": "integer", @@ -1604,6 +1798,7 @@ } }, "contract_spec_id_prefix": { + "description": "contract_spec_id_prefix is the prefix portion of the contract_spec_id.", "type": "array", "items": { "type": "integer", @@ -1612,11 +1807,13 @@ } }, "contract_spec_uuid": { + "description": "contract_spec_uuid is the uuid hex string of the contract_spec_id_contract_spec_uuid.", "type": "string" } } }, "Party": { + "description": "A Party is an address with/in a given role associated with a contract", "type": "object", "required": [ "address", @@ -1625,18 +1822,22 @@ ], "properties": { "address": { + "description": "address of the account (on chain)", "type": "string" }, "optional": { + "description": "whether this party's signature is optional", "type": "boolean" }, "role": { + "description": "a role for this account within the context of the processes used", "type": "integer", "format": "int32" } } }, "Process": { + "description": "Process contains information used to uniquely identify what was used to generate this record", "type": "object", "required": [ "method", @@ -1644,12 +1845,15 @@ ], "properties": { "method": { + "description": "method is a name or reference to a specific operation (method) within a class/contract that was invoked", "type": "string" }, "name": { + "description": "a name associated with the process (type_name, classname or smart contract common name)", "type": "string" }, "process_id": { + "description": "unique identifier for this process", "anyOf": [ { "$ref": "#/definitions/ProcessId" @@ -1662,8 +1866,10 @@ } }, "ProcessId": { + "description": "unique identifier for this process", "oneOf": [ { + "description": "the address of a smart contract used for this process", "type": "object", "required": [ "Address" @@ -1676,6 +1882,7 @@ "additionalProperties": false }, { + "description": "the hash of an off-chain process used", "type": "object", "required": [ "Hash" @@ -1690,6 +1897,7 @@ ] }, "Record": { + "description": "A record (of fact) is attached to a session or each consideration output from a contract", "type": "object", "required": [ "inputs", @@ -1700,21 +1908,25 @@ ], "properties": { "inputs": { + "description": "inputs used with the process to achieve the output on this record", "type": "array", "items": { "$ref": "#/definitions/RecordInput" } }, "name": { + "description": "name/identifier for this record. Value must be unique within the scope. Also known as a Fact name", "type": "string" }, "outputs": { + "description": "output(s) is the results of executing the process on the given process indicated in this record", "type": "array", "items": { "$ref": "#/definitions/RecordOutput" } }, "process": { + "description": "process contain information used to uniquely identify an execution on or off chain that generated this record", "anyOf": [ { "$ref": "#/definitions/Process" @@ -1725,6 +1937,7 @@ ] }, "session_id": { + "description": "id of the session context that was used to create this record (use with filtered kvprefix iterator)", "type": "array", "items": { "type": "integer", @@ -1733,6 +1946,7 @@ } }, "specification_id": { + "description": "specification_id is the id of the record specification that was used to create this record.", "type": "array", "items": { "type": "integer", @@ -1743,6 +1957,7 @@ } }, "RecordIdInfo": { + "description": "RecordIdInfo contains various info regarding a record id.", "type": "object", "required": [ "record_addr", @@ -1753,9 +1968,11 @@ ], "properties": { "record_addr": { + "description": "record_addr is the bech32 string version of the record_id.", "type": "string" }, "record_id": { + "description": "record_id is the raw bytes of the record address.", "type": "array", "items": { "type": "integer", @@ -1764,6 +1981,7 @@ } }, "record_id_hashed_name": { + "description": "record_id_hashed_name is the hashed name portion of the record_id.", "type": "array", "items": { "type": "integer", @@ -1772,6 +1990,7 @@ } }, "record_id_prefix": { + "description": "record_id_prefix is the prefix portion of the record_id.", "type": "array", "items": { "type": "integer", @@ -1780,6 +1999,7 @@ } }, "record_id_scope_uuid": { + "description": "record_id_scope_uuid is the scope_uuid portion of the record_id.", "type": "array", "items": { "type": "integer", @@ -1788,6 +2008,7 @@ } }, "scope_id_info": { + "description": "scope_id_info is information about the scope id referenced in the record_id.", "anyOf": [ { "$ref": "#/definitions/ScopeIdInfo" @@ -1800,6 +2021,7 @@ } }, "RecordInput": { + "description": "Tracks the inputs used to establish this record", "type": "object", "required": [ "name", @@ -1808,9 +2030,11 @@ ], "properties": { "name": { + "description": "Name value included to link back to the definition spec.", "type": "string" }, "source": { + "description": "data source", "anyOf": [ { "$ref": "#/definitions/Source" @@ -1821,15 +2045,18 @@ ] }, "status": { + "description": "Indicates if this input was a recorded fact on chain or just a given hashed input", "type": "integer", "format": "int32" }, "type_name": { + "description": "from proposed fact structure to unmarshal", "type": "string" } } }, "RecordOutput": { + "description": "RecordOutput encapsulates the output of a process recorded on chain", "type": "object", "required": [ "hash", @@ -1837,15 +2064,18 @@ ], "properties": { "hash": { + "description": "Hash of the data output that was output/generated for this record", "type": "string" }, "status": { + "description": "Status of the process execution associated with this output indicating success,failure, or pending", "type": "integer", "format": "int32" } } }, "RecordSpecIdInfo": { + "description": "RecordSpecIdInfo contains various info regarding a record specification id.", "type": "object", "required": [ "record_spec_addr", @@ -1856,6 +2086,7 @@ ], "properties": { "contract_spec_id_info": { + "description": "contract_spec_id_info is information about the contract spec id referenced in the record_spec_id.", "anyOf": [ { "$ref": "#/definitions/ContractSpecIdInfo" @@ -1866,9 +2097,11 @@ ] }, "record_spec_addr": { + "description": "record_spec_addr is the bech32 string version of the record_spec_id.", "type": "string" }, "record_spec_id": { + "description": "record_spec_id is the raw bytes of the record specification address.", "type": "array", "items": { "type": "integer", @@ -1877,6 +2110,7 @@ } }, "record_spec_id_contract_spec_uuid": { + "description": "record_spec_id_contract_spec_uuid is the contract_spec_uuid portion of the record_spec_id.", "type": "array", "items": { "type": "integer", @@ -1885,6 +2119,7 @@ } }, "record_spec_id_hashed_name": { + "description": "record_spec_id_hashed_name is the hashed name portion of the record_spec_id.", "type": "array", "items": { "type": "integer", @@ -1893,6 +2128,7 @@ } }, "record_spec_id_prefix": { + "description": "record_spec_id_prefix is the prefix portion of the record_spec_id.", "type": "array", "items": { "type": "integer", @@ -1903,9 +2139,11 @@ } }, "RecordWrapper": { + "description": "RecordWrapper contains a single record and some extra identifiers for it.", "type": "object", "properties": { "record": { + "description": "record is the on-chain record message.", "anyOf": [ { "$ref": "#/definitions/Record" @@ -1916,6 +2154,7 @@ ] }, "record_id_info": { + "description": "record_id_info contains information about the id/address of the record.", "anyOf": [ { "$ref": "#/definitions/RecordIdInfo" @@ -1926,6 +2165,7 @@ ] }, "record_spec_id_info": { + "description": "record_spec_id_info contains information about the id/address of the record specification.", "anyOf": [ { "$ref": "#/definitions/RecordSpecIdInfo" @@ -1938,6 +2178,7 @@ } }, "RecordsRequest": { + "description": "RecordsRequest is the request type for the Query/Records RPC method.", "type": "object", "required": [ "exclude_id_info", @@ -1951,32 +2192,41 @@ ], "properties": { "exclude_id_info": { + "description": "exclude_id_info is a flag for whether to exclude the id info from the response.", "type": "boolean" }, "include_request": { + "description": "include_request is a flag for whether to include this request in your result.", "type": "boolean" }, "include_scope": { + "description": "include_scope is a flag for whether to include the the scope containing these records in the response.", "type": "boolean" }, "include_sessions": { + "description": "include_sessions is a flag for whether to include the sessions containing these records in the response.", "type": "boolean" }, "name": { + "description": "name is the name of the record to look for", "type": "string" }, "record_addr": { + "description": "record_addr is a bech32 record address, e.g. record1q2ge0zaztu65tx5x5llv5xc9ztsw42dq2jdvmdazuwzcaddhh8gmu3mcze3.", "type": "string" }, "scope_id": { + "description": "scope_id can either be a uuid, e.g. 91978ba2-5f35-459a-86a7-feca1b0512e0 or a bech32 scope address, e.g. scope1qzge0zaztu65tx5x5llv5xc9ztsqxlkwel.", "type": "string" }, "session_id": { + "description": "session_id can either be a uuid, e.g. 5803f8bc-6067-4eb5-951f-2121671c2ec0 or a bech32 session address, e.g. session1qxge0zaztu65tx5x5llv5xc9zts9sqlch3sxwn44j50jzgt8rshvqyfrjcr. This can only be a uuid if a scope_id is also provided.", "type": "string" } } }, "RecordsResponse": { + "description": "RecordsResponse is the response type for the Query/Records RPC method.", "type": "object", "required": [ "records", @@ -1984,12 +2234,14 @@ ], "properties": { "records": { + "description": "records is any number of wrapped record results.", "type": "array", "items": { "$ref": "#/definitions/RecordWrapper" } }, "request": { + "description": "request is a copy of the request that generated these results.", "anyOf": [ { "$ref": "#/definitions/RecordsRequest" @@ -2000,6 +2252,7 @@ ] }, "scope": { + "description": "scope is the wrapped scope that holds these records (if requested).", "anyOf": [ { "$ref": "#/definitions/ScopeWrapper" @@ -2010,6 +2263,7 @@ ] }, "sessions": { + "description": "sessions is any number of wrapped sessions that hold these records (if requested).", "type": "array", "items": { "$ref": "#/definitions/SessionWrapper" @@ -2018,6 +2272,7 @@ } }, "Scope": { + "description": "Scope defines a root reference for a collection of records owned by one or more parties.", "type": "object", "required": [ "data_access", @@ -2029,21 +2284,25 @@ ], "properties": { "data_access": { + "description": "Addresses in this list are authorized to receive off-chain data associated with this scope.", "type": "array", "items": { "type": "string" } }, "owners": { + "description": "These parties represent top level owners of the records within. These parties must sign any requests that modify the data within the scope. These addresses are in union with parties listed on the sessions.", "type": "array", "items": { "$ref": "#/definitions/Party" } }, "require_party_rollup": { + "description": "Whether all parties in this scope and its sessions must be present in this scope's owners field. This also enables use of optional=true scope owners and session parties.", "type": "boolean" }, "scope_id": { + "description": "Unique ID for this scope. Implements sdk.Address interface for use where addresses are required in Cosmos", "type": "array", "items": { "type": "integer", @@ -2052,6 +2311,7 @@ } }, "specification_id": { + "description": "the scope specification that contains the specifications for data elements allowed within this scope", "type": "array", "items": { "type": "integer", @@ -2060,11 +2320,13 @@ } }, "value_owner_address": { + "description": "An address that controls the value associated with this scope. Standard blockchain accounts and marker accounts are supported for this value. This attribute may only be changed by the entity indicated once it is set.", "type": "string" } } }, "ScopeIdInfo": { + "description": "ScopeIdInfo contains various info regarding a scope id.", "type": "object", "required": [ "scope_addr", @@ -2075,9 +2337,11 @@ ], "properties": { "scope_addr": { + "description": "scope_addr is the bech32 string version of the scope_id.", "type": "string" }, "scope_id": { + "description": "scope_id is the raw bytes of the scope address.", "type": "array", "items": { "type": "integer", @@ -2086,6 +2350,7 @@ } }, "scope_id_prefix": { + "description": "scope_id_prefix is the prefix portion of the scope_id.", "type": "array", "items": { "type": "integer", @@ -2094,6 +2359,7 @@ } }, "scope_id_scope_uuid": { + "description": "scope_id_scope_uuid is the scope_uuid portion of the scope_id.", "type": "array", "items": { "type": "integer", @@ -2102,11 +2368,13 @@ } }, "scope_uuid": { + "description": "scope_uuid is the uuid hex string of the scope_id_scope_uuid.", "type": "string" } } }, "ScopeSpecIdInfo": { + "description": "ScopeSpecIdInfo contains various info regarding a scope specification id.", "type": "object", "required": [ "scope_spec_addr", @@ -2117,9 +2385,11 @@ ], "properties": { "scope_spec_addr": { + "description": "scope_spec_addr is the bech32 string version of the scope_spec_id.", "type": "string" }, "scope_spec_id": { + "description": "scope_spec_id is the raw bytes of the scope specification address.", "type": "array", "items": { "type": "integer", @@ -2128,6 +2398,7 @@ } }, "scope_spec_id_prefix": { + "description": "scope_spec_id_prefix is the prefix portion of the scope_spec_id.", "type": "array", "items": { "type": "integer", @@ -2136,6 +2407,7 @@ } }, "scope_spec_id_scope_spec_uuid": { + "description": "scope_spec_id_scope_spec_uuid is the scope_spec_uuid portion of the scope_spec_id.", "type": "array", "items": { "type": "integer", @@ -2144,14 +2416,17 @@ } }, "scope_spec_uuid": { + "description": "scope_spec_uuid is the uuid hex string of the scope_spec_id_scope_spec_uuid.", "type": "string" } } }, "ScopeWrapper": { + "description": "SessionWrapper contains a single scope and its uuid.", "type": "object", "properties": { "scope": { + "description": "scope is the on-chain scope message.", "anyOf": [ { "$ref": "#/definitions/Scope" @@ -2162,6 +2437,7 @@ ] }, "scope_id_info": { + "description": "scope_id_info contains information about the id/address of the scope.", "anyOf": [ { "$ref": "#/definitions/ScopeIdInfo" @@ -2172,6 +2448,7 @@ ] }, "scope_spec_id_info": { + "description": "scope_spec_id_info contains information about the id/address of the scope specification.", "anyOf": [ { "$ref": "#/definitions/ScopeSpecIdInfo" @@ -2184,6 +2461,7 @@ } }, "Session": { + "description": "Session defines an execution context against a specific specification instance. The context will have a specification and set of parties involved.\n\nNOTE: When there are no more Records within a Scope that reference a Session, the Session is removed.", "type": "object", "required": [ "context", @@ -2194,6 +2472,7 @@ ], "properties": { "audit": { + "description": "Created by, updated by, timestamps, version number, and related info.", "anyOf": [ { "$ref": "#/definitions/AuditFields" @@ -2204,6 +2483,7 @@ ] }, "context": { + "description": "context is a field for storing client specific data associated with a session.", "type": "array", "items": { "type": "integer", @@ -2212,9 +2492,11 @@ } }, "name": { + "description": "name to associate with this session execution context, typically classname", "type": "string" }, "parties": { + "description": "parties is the set of identities that signed this contract", "type": "array", "items": { "$ref": "#/definitions/Party" @@ -2229,6 +2511,7 @@ } }, "specification_id": { + "description": "unique id of the contract specification that was used to create this session.", "type": "array", "items": { "type": "integer", @@ -2239,6 +2522,7 @@ } }, "SessionIdInfo": { + "description": "SessionIdInfo contains various info regarding a session id.", "type": "object", "required": [ "session_addr", @@ -2250,6 +2534,7 @@ ], "properties": { "scope_id_info": { + "description": "scope_id_info is information about the scope id referenced in the session_id.", "anyOf": [ { "$ref": "#/definitions/ScopeIdInfo" @@ -2260,9 +2545,11 @@ ] }, "session_addr": { + "description": "session_addr is the bech32 string version of the session_id.", "type": "string" }, "session_id": { + "description": "session_id is the raw bytes of the session address.", "type": "array", "items": { "type": "integer", @@ -2271,6 +2558,7 @@ } }, "session_id_prefix": { + "description": "session_id_prefix is the prefix portion of the session_id.", "type": "array", "items": { "type": "integer", @@ -2279,6 +2567,7 @@ } }, "session_id_scope_uuid": { + "description": "session_id_scope_uuid is the scope_uuid portion of the session_id.", "type": "array", "items": { "type": "integer", @@ -2287,6 +2576,7 @@ } }, "session_id_session_uuid": { + "description": "session_id_session_uuid is the session_uuid portion of the session_id.", "type": "array", "items": { "type": "integer", @@ -2295,14 +2585,17 @@ } }, "session_uuid": { + "description": "session_uuid is the uuid hex string of the session_id_session_uuid.", "type": "string" } } }, "SessionWrapper": { + "description": "SessionWrapper contains a single session and some extra identifiers for it.", "type": "object", "properties": { "contract_spec_id_info": { + "description": "contract_spec_id_info contains information about the id/address of the contract specification.", "anyOf": [ { "$ref": "#/definitions/ContractSpecIdInfo" @@ -2313,6 +2606,7 @@ ] }, "session": { + "description": "session is the on-chain session message.", "anyOf": [ { "$ref": "#/definitions/Session" @@ -2323,6 +2617,7 @@ ] }, "session_id_info": { + "description": "session_id_info contains information about the id/address of the session.", "anyOf": [ { "$ref": "#/definitions/SessionIdInfo" @@ -2335,8 +2630,10 @@ } }, "Source": { + "description": "data source", "oneOf": [ { + "description": "the address of a record on chain (For Established Records)", "type": "object", "required": [ "RecordId" @@ -2354,6 +2651,7 @@ "additionalProperties": false }, { + "description": "the hash of an off-chain piece of information (For Proposed Records)", "type": "object", "required": [ "Hash" @@ -2391,6 +2689,7 @@ "get_scope": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "ScopeResponse", + "description": "ScopeResponse is the response type for the Query/Scope RPC method.", "type": "object", "required": [ "records", @@ -2398,12 +2697,14 @@ ], "properties": { "records": { + "description": "records is any number of wrapped records in this scope (if requested).", "type": "array", "items": { "$ref": "#/definitions/RecordWrapper" } }, "request": { + "description": "request is a copy of the request that generated these results.", "anyOf": [ { "$ref": "#/definitions/ScopeRequest" @@ -2414,6 +2715,7 @@ ] }, "scope": { + "description": "scope is the wrapped scope result.", "anyOf": [ { "$ref": "#/definitions/ScopeWrapper" @@ -2424,6 +2726,7 @@ ] }, "sessions": { + "description": "sessions is any number of wrapped sessions in this scope (if requested).", "type": "array", "items": { "$ref": "#/definitions/SessionWrapper" @@ -2432,6 +2735,7 @@ }, "definitions": { "AuditFields": { + "description": "AuditFields capture information about the last account to make modifications and when they were made", "type": "object", "required": [ "created_by", @@ -2441,9 +2745,11 @@ ], "properties": { "created_by": { + "description": "the address of the account that created this record", "type": "string" }, "created_date": { + "description": "the date/time when this entry was created", "anyOf": [ { "$ref": "#/definitions/Timestamp" @@ -2454,12 +2760,15 @@ ] }, "message": { + "description": "an optional message associated with the creation/update event", "type": "string" }, "updated_by": { + "description": "the address of the account that modified this record", "type": "string" }, "updated_date": { + "description": "the date/time when this entry was last updated", "anyOf": [ { "$ref": "#/definitions/Timestamp" @@ -2470,6 +2779,7 @@ ] }, "version": { + "description": "an optional version number that is incremented with each update", "type": "integer", "format": "uint32", "minimum": 0.0 @@ -2477,6 +2787,7 @@ } }, "ContractSpecIdInfo": { + "description": "ContractSpecIdInfo contains various info regarding a contract specification id.", "type": "object", "required": [ "contract_spec_addr", @@ -2487,9 +2798,11 @@ ], "properties": { "contract_spec_addr": { + "description": "contract_spec_addr is the bech32 string version of the contract_spec_id.", "type": "string" }, "contract_spec_id": { + "description": "contract_spec_id is the raw bytes of the contract specification address.", "type": "array", "items": { "type": "integer", @@ -2498,6 +2811,7 @@ } }, "contract_spec_id_contract_spec_uuid": { + "description": "contract_spec_id_contract_spec_uuid is the contract_spec_uuid portion of the contract_spec_id.", "type": "array", "items": { "type": "integer", @@ -2506,6 +2820,7 @@ } }, "contract_spec_id_prefix": { + "description": "contract_spec_id_prefix is the prefix portion of the contract_spec_id.", "type": "array", "items": { "type": "integer", @@ -2514,11 +2829,13 @@ } }, "contract_spec_uuid": { + "description": "contract_spec_uuid is the uuid hex string of the contract_spec_id_contract_spec_uuid.", "type": "string" } } }, "Party": { + "description": "A Party is an address with/in a given role associated with a contract", "type": "object", "required": [ "address", @@ -2527,18 +2844,22 @@ ], "properties": { "address": { + "description": "address of the account (on chain)", "type": "string" }, "optional": { + "description": "whether this party's signature is optional", "type": "boolean" }, "role": { + "description": "a role for this account within the context of the processes used", "type": "integer", "format": "int32" } } }, "Process": { + "description": "Process contains information used to uniquely identify what was used to generate this record", "type": "object", "required": [ "method", @@ -2546,12 +2867,15 @@ ], "properties": { "method": { + "description": "method is a name or reference to a specific operation (method) within a class/contract that was invoked", "type": "string" }, "name": { + "description": "a name associated with the process (type_name, classname or smart contract common name)", "type": "string" }, "process_id": { + "description": "unique identifier for this process", "anyOf": [ { "$ref": "#/definitions/ProcessId" @@ -2564,8 +2888,10 @@ } }, "ProcessId": { + "description": "unique identifier for this process", "oneOf": [ { + "description": "the address of a smart contract used for this process", "type": "object", "required": [ "Address" @@ -2578,6 +2904,7 @@ "additionalProperties": false }, { + "description": "the hash of an off-chain process used", "type": "object", "required": [ "Hash" @@ -2592,6 +2919,7 @@ ] }, "Record": { + "description": "A record (of fact) is attached to a session or each consideration output from a contract", "type": "object", "required": [ "inputs", @@ -2602,21 +2930,25 @@ ], "properties": { "inputs": { + "description": "inputs used with the process to achieve the output on this record", "type": "array", "items": { "$ref": "#/definitions/RecordInput" } }, "name": { + "description": "name/identifier for this record. Value must be unique within the scope. Also known as a Fact name", "type": "string" }, "outputs": { + "description": "output(s) is the results of executing the process on the given process indicated in this record", "type": "array", "items": { "$ref": "#/definitions/RecordOutput" } }, "process": { + "description": "process contain information used to uniquely identify an execution on or off chain that generated this record", "anyOf": [ { "$ref": "#/definitions/Process" @@ -2627,6 +2959,7 @@ ] }, "session_id": { + "description": "id of the session context that was used to create this record (use with filtered kvprefix iterator)", "type": "array", "items": { "type": "integer", @@ -2635,6 +2968,7 @@ } }, "specification_id": { + "description": "specification_id is the id of the record specification that was used to create this record.", "type": "array", "items": { "type": "integer", @@ -2645,6 +2979,7 @@ } }, "RecordIdInfo": { + "description": "RecordIdInfo contains various info regarding a record id.", "type": "object", "required": [ "record_addr", @@ -2655,9 +2990,11 @@ ], "properties": { "record_addr": { + "description": "record_addr is the bech32 string version of the record_id.", "type": "string" }, "record_id": { + "description": "record_id is the raw bytes of the record address.", "type": "array", "items": { "type": "integer", @@ -2666,6 +3003,7 @@ } }, "record_id_hashed_name": { + "description": "record_id_hashed_name is the hashed name portion of the record_id.", "type": "array", "items": { "type": "integer", @@ -2674,6 +3012,7 @@ } }, "record_id_prefix": { + "description": "record_id_prefix is the prefix portion of the record_id.", "type": "array", "items": { "type": "integer", @@ -2682,6 +3021,7 @@ } }, "record_id_scope_uuid": { + "description": "record_id_scope_uuid is the scope_uuid portion of the record_id.", "type": "array", "items": { "type": "integer", @@ -2690,6 +3030,7 @@ } }, "scope_id_info": { + "description": "scope_id_info is information about the scope id referenced in the record_id.", "anyOf": [ { "$ref": "#/definitions/ScopeIdInfo" @@ -2702,6 +3043,7 @@ } }, "RecordInput": { + "description": "Tracks the inputs used to establish this record", "type": "object", "required": [ "name", @@ -2710,9 +3052,11 @@ ], "properties": { "name": { + "description": "Name value included to link back to the definition spec.", "type": "string" }, "source": { + "description": "data source", "anyOf": [ { "$ref": "#/definitions/Source" @@ -2723,15 +3067,18 @@ ] }, "status": { + "description": "Indicates if this input was a recorded fact on chain or just a given hashed input", "type": "integer", "format": "int32" }, "type_name": { + "description": "from proposed fact structure to unmarshal", "type": "string" } } }, "RecordOutput": { + "description": "RecordOutput encapsulates the output of a process recorded on chain", "type": "object", "required": [ "hash", @@ -2739,15 +3086,18 @@ ], "properties": { "hash": { + "description": "Hash of the data output that was output/generated for this record", "type": "string" }, "status": { + "description": "Status of the process execution associated with this output indicating success,failure, or pending", "type": "integer", "format": "int32" } } }, "RecordSpecIdInfo": { + "description": "RecordSpecIdInfo contains various info regarding a record specification id.", "type": "object", "required": [ "record_spec_addr", @@ -2758,6 +3108,7 @@ ], "properties": { "contract_spec_id_info": { + "description": "contract_spec_id_info is information about the contract spec id referenced in the record_spec_id.", "anyOf": [ { "$ref": "#/definitions/ContractSpecIdInfo" @@ -2768,9 +3119,11 @@ ] }, "record_spec_addr": { + "description": "record_spec_addr is the bech32 string version of the record_spec_id.", "type": "string" }, "record_spec_id": { + "description": "record_spec_id is the raw bytes of the record specification address.", "type": "array", "items": { "type": "integer", @@ -2779,6 +3132,7 @@ } }, "record_spec_id_contract_spec_uuid": { + "description": "record_spec_id_contract_spec_uuid is the contract_spec_uuid portion of the record_spec_id.", "type": "array", "items": { "type": "integer", @@ -2787,6 +3141,7 @@ } }, "record_spec_id_hashed_name": { + "description": "record_spec_id_hashed_name is the hashed name portion of the record_spec_id.", "type": "array", "items": { "type": "integer", @@ -2795,6 +3150,7 @@ } }, "record_spec_id_prefix": { + "description": "record_spec_id_prefix is the prefix portion of the record_spec_id.", "type": "array", "items": { "type": "integer", @@ -2805,9 +3161,11 @@ } }, "RecordWrapper": { + "description": "RecordWrapper contains a single record and some extra identifiers for it.", "type": "object", "properties": { "record": { + "description": "record is the on-chain record message.", "anyOf": [ { "$ref": "#/definitions/Record" @@ -2818,6 +3176,7 @@ ] }, "record_id_info": { + "description": "record_id_info contains information about the id/address of the record.", "anyOf": [ { "$ref": "#/definitions/RecordIdInfo" @@ -2828,6 +3187,7 @@ ] }, "record_spec_id_info": { + "description": "record_spec_id_info contains information about the id/address of the record specification.", "anyOf": [ { "$ref": "#/definitions/RecordSpecIdInfo" @@ -2840,6 +3200,7 @@ } }, "Scope": { + "description": "Scope defines a root reference for a collection of records owned by one or more parties.", "type": "object", "required": [ "data_access", @@ -2851,21 +3212,25 @@ ], "properties": { "data_access": { + "description": "Addresses in this list are authorized to receive off-chain data associated with this scope.", "type": "array", "items": { "type": "string" } }, "owners": { + "description": "These parties represent top level owners of the records within. These parties must sign any requests that modify the data within the scope. These addresses are in union with parties listed on the sessions.", "type": "array", "items": { "$ref": "#/definitions/Party" } }, "require_party_rollup": { + "description": "Whether all parties in this scope and its sessions must be present in this scope's owners field. This also enables use of optional=true scope owners and session parties.", "type": "boolean" }, "scope_id": { + "description": "Unique ID for this scope. Implements sdk.Address interface for use where addresses are required in Cosmos", "type": "array", "items": { "type": "integer", @@ -2874,6 +3239,7 @@ } }, "specification_id": { + "description": "the scope specification that contains the specifications for data elements allowed within this scope", "type": "array", "items": { "type": "integer", @@ -2882,11 +3248,13 @@ } }, "value_owner_address": { + "description": "An address that controls the value associated with this scope. Standard blockchain accounts and marker accounts are supported for this value. This attribute may only be changed by the entity indicated once it is set.", "type": "string" } } }, "ScopeIdInfo": { + "description": "ScopeIdInfo contains various info regarding a scope id.", "type": "object", "required": [ "scope_addr", @@ -2897,9 +3265,11 @@ ], "properties": { "scope_addr": { + "description": "scope_addr is the bech32 string version of the scope_id.", "type": "string" }, "scope_id": { + "description": "scope_id is the raw bytes of the scope address.", "type": "array", "items": { "type": "integer", @@ -2908,6 +3278,7 @@ } }, "scope_id_prefix": { + "description": "scope_id_prefix is the prefix portion of the scope_id.", "type": "array", "items": { "type": "integer", @@ -2916,6 +3287,7 @@ } }, "scope_id_scope_uuid": { + "description": "scope_id_scope_uuid is the scope_uuid portion of the scope_id.", "type": "array", "items": { "type": "integer", @@ -2924,11 +3296,13 @@ } }, "scope_uuid": { + "description": "scope_uuid is the uuid hex string of the scope_id_scope_uuid.", "type": "string" } } }, "ScopeRequest": { + "description": "ScopeRequest is the request type for the Query/Scope RPC method.", "type": "object", "required": [ "exclude_id_info", @@ -2941,29 +3315,37 @@ ], "properties": { "exclude_id_info": { + "description": "exclude_id_info is a flag for whether to exclude the id info from the response.", "type": "boolean" }, "include_records": { + "description": "include_records is a flag for whether to include the records of the scope in the response.", "type": "boolean" }, "include_request": { + "description": "include_request is a flag for whether to include this request in your result.", "type": "boolean" }, "include_sessions": { + "description": "include_sessions is a flag for whether to include the sessions of the scope in the response.", "type": "boolean" }, "record_addr": { + "description": "record_addr is a bech32 record address, e.g. record1q2ge0zaztu65tx5x5llv5xc9ztsw42dq2jdvmdazuwzcaddhh8gmu3mcze3.", "type": "string" }, "scope_id": { + "description": "scope_id can either be a uuid, e.g. 91978ba2-5f35-459a-86a7-feca1b0512e0 or a bech32 scope address, e.g. scope1qzge0zaztu65tx5x5llv5xc9ztsqxlkwel.", "type": "string" }, "session_addr": { + "description": "session_addr is a bech32 session address, e.g. session1qxge0zaztu65tx5x5llv5xc9zts9sqlch3sxwn44j50jzgt8rshvqyfrjcr.", "type": "string" } } }, "ScopeSpecIdInfo": { + "description": "ScopeSpecIdInfo contains various info regarding a scope specification id.", "type": "object", "required": [ "scope_spec_addr", @@ -2974,9 +3356,11 @@ ], "properties": { "scope_spec_addr": { + "description": "scope_spec_addr is the bech32 string version of the scope_spec_id.", "type": "string" }, "scope_spec_id": { + "description": "scope_spec_id is the raw bytes of the scope specification address.", "type": "array", "items": { "type": "integer", @@ -2985,6 +3369,7 @@ } }, "scope_spec_id_prefix": { + "description": "scope_spec_id_prefix is the prefix portion of the scope_spec_id.", "type": "array", "items": { "type": "integer", @@ -2993,6 +3378,7 @@ } }, "scope_spec_id_scope_spec_uuid": { + "description": "scope_spec_id_scope_spec_uuid is the scope_spec_uuid portion of the scope_spec_id.", "type": "array", "items": { "type": "integer", @@ -3001,14 +3387,17 @@ } }, "scope_spec_uuid": { + "description": "scope_spec_uuid is the uuid hex string of the scope_spec_id_scope_spec_uuid.", "type": "string" } } }, "ScopeWrapper": { + "description": "SessionWrapper contains a single scope and its uuid.", "type": "object", "properties": { "scope": { + "description": "scope is the on-chain scope message.", "anyOf": [ { "$ref": "#/definitions/Scope" @@ -3019,6 +3408,7 @@ ] }, "scope_id_info": { + "description": "scope_id_info contains information about the id/address of the scope.", "anyOf": [ { "$ref": "#/definitions/ScopeIdInfo" @@ -3029,6 +3419,7 @@ ] }, "scope_spec_id_info": { + "description": "scope_spec_id_info contains information about the id/address of the scope specification.", "anyOf": [ { "$ref": "#/definitions/ScopeSpecIdInfo" @@ -3041,6 +3432,7 @@ } }, "Session": { + "description": "Session defines an execution context against a specific specification instance. The context will have a specification and set of parties involved.\n\nNOTE: When there are no more Records within a Scope that reference a Session, the Session is removed.", "type": "object", "required": [ "context", @@ -3051,6 +3443,7 @@ ], "properties": { "audit": { + "description": "Created by, updated by, timestamps, version number, and related info.", "anyOf": [ { "$ref": "#/definitions/AuditFields" @@ -3061,6 +3454,7 @@ ] }, "context": { + "description": "context is a field for storing client specific data associated with a session.", "type": "array", "items": { "type": "integer", @@ -3069,9 +3463,11 @@ } }, "name": { + "description": "name to associate with this session execution context, typically classname", "type": "string" }, "parties": { + "description": "parties is the set of identities that signed this contract", "type": "array", "items": { "$ref": "#/definitions/Party" @@ -3086,6 +3482,7 @@ } }, "specification_id": { + "description": "unique id of the contract specification that was used to create this session.", "type": "array", "items": { "type": "integer", @@ -3096,6 +3493,7 @@ } }, "SessionIdInfo": { + "description": "SessionIdInfo contains various info regarding a session id.", "type": "object", "required": [ "session_addr", @@ -3107,6 +3505,7 @@ ], "properties": { "scope_id_info": { + "description": "scope_id_info is information about the scope id referenced in the session_id.", "anyOf": [ { "$ref": "#/definitions/ScopeIdInfo" @@ -3117,9 +3516,11 @@ ] }, "session_addr": { + "description": "session_addr is the bech32 string version of the session_id.", "type": "string" }, "session_id": { + "description": "session_id is the raw bytes of the session address.", "type": "array", "items": { "type": "integer", @@ -3128,6 +3529,7 @@ } }, "session_id_prefix": { + "description": "session_id_prefix is the prefix portion of the session_id.", "type": "array", "items": { "type": "integer", @@ -3136,6 +3538,7 @@ } }, "session_id_scope_uuid": { + "description": "session_id_scope_uuid is the scope_uuid portion of the session_id.", "type": "array", "items": { "type": "integer", @@ -3144,6 +3547,7 @@ } }, "session_id_session_uuid": { + "description": "session_id_session_uuid is the session_uuid portion of the session_id.", "type": "array", "items": { "type": "integer", @@ -3152,14 +3556,17 @@ } }, "session_uuid": { + "description": "session_uuid is the uuid hex string of the session_id_session_uuid.", "type": "string" } } }, "SessionWrapper": { + "description": "SessionWrapper contains a single session and some extra identifiers for it.", "type": "object", "properties": { "contract_spec_id_info": { + "description": "contract_spec_id_info contains information about the id/address of the contract specification.", "anyOf": [ { "$ref": "#/definitions/ContractSpecIdInfo" @@ -3170,6 +3577,7 @@ ] }, "session": { + "description": "session is the on-chain session message.", "anyOf": [ { "$ref": "#/definitions/Session" @@ -3180,6 +3588,7 @@ ] }, "session_id_info": { + "description": "session_id_info contains information about the id/address of the session.", "anyOf": [ { "$ref": "#/definitions/SessionIdInfo" @@ -3192,8 +3601,10 @@ } }, "Source": { + "description": "data source", "oneOf": [ { + "description": "the address of a record on chain (For Established Records)", "type": "object", "required": [ "RecordId" @@ -3211,6 +3622,7 @@ "additionalProperties": false }, { + "description": "the hash of an off-chain piece of information (For Proposed Records)", "type": "object", "required": [ "Hash" @@ -3248,6 +3660,7 @@ "get_sessions": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "SessionsResponse", + "description": "SessionsResponse is the response type for the Query/Sessions RPC method.", "type": "object", "required": [ "records", @@ -3255,12 +3668,14 @@ ], "properties": { "records": { + "description": "records is any number of wrapped records contained in these sessions (if requested).", "type": "array", "items": { "$ref": "#/definitions/RecordWrapper" } }, "request": { + "description": "request is a copy of the request that generated these results.", "anyOf": [ { "$ref": "#/definitions/SessionsRequest" @@ -3271,6 +3686,7 @@ ] }, "scope": { + "description": "scope is the wrapped scope that holds these sessions (if requested).", "anyOf": [ { "$ref": "#/definitions/ScopeWrapper" @@ -3281,6 +3697,7 @@ ] }, "sessions": { + "description": "sessions is any number of wrapped session results.", "type": "array", "items": { "$ref": "#/definitions/SessionWrapper" @@ -3289,6 +3706,7 @@ }, "definitions": { "AuditFields": { + "description": "AuditFields capture information about the last account to make modifications and when they were made", "type": "object", "required": [ "created_by", @@ -3298,9 +3716,11 @@ ], "properties": { "created_by": { + "description": "the address of the account that created this record", "type": "string" }, "created_date": { + "description": "the date/time when this entry was created", "anyOf": [ { "$ref": "#/definitions/Timestamp" @@ -3311,12 +3731,15 @@ ] }, "message": { + "description": "an optional message associated with the creation/update event", "type": "string" }, "updated_by": { + "description": "the address of the account that modified this record", "type": "string" }, "updated_date": { + "description": "the date/time when this entry was last updated", "anyOf": [ { "$ref": "#/definitions/Timestamp" @@ -3327,6 +3750,7 @@ ] }, "version": { + "description": "an optional version number that is incremented with each update", "type": "integer", "format": "uint32", "minimum": 0.0 @@ -3334,6 +3758,7 @@ } }, "ContractSpecIdInfo": { + "description": "ContractSpecIdInfo contains various info regarding a contract specification id.", "type": "object", "required": [ "contract_spec_addr", @@ -3344,9 +3769,11 @@ ], "properties": { "contract_spec_addr": { + "description": "contract_spec_addr is the bech32 string version of the contract_spec_id.", "type": "string" }, "contract_spec_id": { + "description": "contract_spec_id is the raw bytes of the contract specification address.", "type": "array", "items": { "type": "integer", @@ -3355,6 +3782,7 @@ } }, "contract_spec_id_contract_spec_uuid": { + "description": "contract_spec_id_contract_spec_uuid is the contract_spec_uuid portion of the contract_spec_id.", "type": "array", "items": { "type": "integer", @@ -3363,6 +3791,7 @@ } }, "contract_spec_id_prefix": { + "description": "contract_spec_id_prefix is the prefix portion of the contract_spec_id.", "type": "array", "items": { "type": "integer", @@ -3371,11 +3800,13 @@ } }, "contract_spec_uuid": { + "description": "contract_spec_uuid is the uuid hex string of the contract_spec_id_contract_spec_uuid.", "type": "string" } } }, "Party": { + "description": "A Party is an address with/in a given role associated with a contract", "type": "object", "required": [ "address", @@ -3384,18 +3815,22 @@ ], "properties": { "address": { + "description": "address of the account (on chain)", "type": "string" }, "optional": { + "description": "whether this party's signature is optional", "type": "boolean" }, "role": { + "description": "a role for this account within the context of the processes used", "type": "integer", "format": "int32" } } }, "Process": { + "description": "Process contains information used to uniquely identify what was used to generate this record", "type": "object", "required": [ "method", @@ -3403,12 +3838,15 @@ ], "properties": { "method": { + "description": "method is a name or reference to a specific operation (method) within a class/contract that was invoked", "type": "string" }, "name": { + "description": "a name associated with the process (type_name, classname or smart contract common name)", "type": "string" }, "process_id": { + "description": "unique identifier for this process", "anyOf": [ { "$ref": "#/definitions/ProcessId" @@ -3421,8 +3859,10 @@ } }, "ProcessId": { + "description": "unique identifier for this process", "oneOf": [ { + "description": "the address of a smart contract used for this process", "type": "object", "required": [ "Address" @@ -3435,6 +3875,7 @@ "additionalProperties": false }, { + "description": "the hash of an off-chain process used", "type": "object", "required": [ "Hash" @@ -3449,6 +3890,7 @@ ] }, "Record": { + "description": "A record (of fact) is attached to a session or each consideration output from a contract", "type": "object", "required": [ "inputs", @@ -3459,21 +3901,25 @@ ], "properties": { "inputs": { + "description": "inputs used with the process to achieve the output on this record", "type": "array", "items": { "$ref": "#/definitions/RecordInput" } }, "name": { + "description": "name/identifier for this record. Value must be unique within the scope. Also known as a Fact name", "type": "string" }, "outputs": { + "description": "output(s) is the results of executing the process on the given process indicated in this record", "type": "array", "items": { "$ref": "#/definitions/RecordOutput" } }, "process": { + "description": "process contain information used to uniquely identify an execution on or off chain that generated this record", "anyOf": [ { "$ref": "#/definitions/Process" @@ -3484,6 +3930,7 @@ ] }, "session_id": { + "description": "id of the session context that was used to create this record (use with filtered kvprefix iterator)", "type": "array", "items": { "type": "integer", @@ -3492,6 +3939,7 @@ } }, "specification_id": { + "description": "specification_id is the id of the record specification that was used to create this record.", "type": "array", "items": { "type": "integer", @@ -3502,6 +3950,7 @@ } }, "RecordIdInfo": { + "description": "RecordIdInfo contains various info regarding a record id.", "type": "object", "required": [ "record_addr", @@ -3512,9 +3961,11 @@ ], "properties": { "record_addr": { + "description": "record_addr is the bech32 string version of the record_id.", "type": "string" }, "record_id": { + "description": "record_id is the raw bytes of the record address.", "type": "array", "items": { "type": "integer", @@ -3523,6 +3974,7 @@ } }, "record_id_hashed_name": { + "description": "record_id_hashed_name is the hashed name portion of the record_id.", "type": "array", "items": { "type": "integer", @@ -3531,6 +3983,7 @@ } }, "record_id_prefix": { + "description": "record_id_prefix is the prefix portion of the record_id.", "type": "array", "items": { "type": "integer", @@ -3539,6 +3992,7 @@ } }, "record_id_scope_uuid": { + "description": "record_id_scope_uuid is the scope_uuid portion of the record_id.", "type": "array", "items": { "type": "integer", @@ -3547,6 +4001,7 @@ } }, "scope_id_info": { + "description": "scope_id_info is information about the scope id referenced in the record_id.", "anyOf": [ { "$ref": "#/definitions/ScopeIdInfo" @@ -3559,6 +4014,7 @@ } }, "RecordInput": { + "description": "Tracks the inputs used to establish this record", "type": "object", "required": [ "name", @@ -3567,9 +4023,11 @@ ], "properties": { "name": { + "description": "Name value included to link back to the definition spec.", "type": "string" }, "source": { + "description": "data source", "anyOf": [ { "$ref": "#/definitions/Source" @@ -3580,15 +4038,18 @@ ] }, "status": { + "description": "Indicates if this input was a recorded fact on chain or just a given hashed input", "type": "integer", "format": "int32" }, "type_name": { + "description": "from proposed fact structure to unmarshal", "type": "string" } } }, "RecordOutput": { + "description": "RecordOutput encapsulates the output of a process recorded on chain", "type": "object", "required": [ "hash", @@ -3596,15 +4057,18 @@ ], "properties": { "hash": { + "description": "Hash of the data output that was output/generated for this record", "type": "string" }, "status": { + "description": "Status of the process execution associated with this output indicating success,failure, or pending", "type": "integer", "format": "int32" } } }, "RecordSpecIdInfo": { + "description": "RecordSpecIdInfo contains various info regarding a record specification id.", "type": "object", "required": [ "record_spec_addr", @@ -3615,6 +4079,7 @@ ], "properties": { "contract_spec_id_info": { + "description": "contract_spec_id_info is information about the contract spec id referenced in the record_spec_id.", "anyOf": [ { "$ref": "#/definitions/ContractSpecIdInfo" @@ -3625,9 +4090,11 @@ ] }, "record_spec_addr": { + "description": "record_spec_addr is the bech32 string version of the record_spec_id.", "type": "string" }, "record_spec_id": { + "description": "record_spec_id is the raw bytes of the record specification address.", "type": "array", "items": { "type": "integer", @@ -3636,6 +4103,7 @@ } }, "record_spec_id_contract_spec_uuid": { + "description": "record_spec_id_contract_spec_uuid is the contract_spec_uuid portion of the record_spec_id.", "type": "array", "items": { "type": "integer", @@ -3644,6 +4112,7 @@ } }, "record_spec_id_hashed_name": { + "description": "record_spec_id_hashed_name is the hashed name portion of the record_spec_id.", "type": "array", "items": { "type": "integer", @@ -3652,6 +4121,7 @@ } }, "record_spec_id_prefix": { + "description": "record_spec_id_prefix is the prefix portion of the record_spec_id.", "type": "array", "items": { "type": "integer", @@ -3662,9 +4132,11 @@ } }, "RecordWrapper": { + "description": "RecordWrapper contains a single record and some extra identifiers for it.", "type": "object", "properties": { "record": { + "description": "record is the on-chain record message.", "anyOf": [ { "$ref": "#/definitions/Record" @@ -3675,6 +4147,7 @@ ] }, "record_id_info": { + "description": "record_id_info contains information about the id/address of the record.", "anyOf": [ { "$ref": "#/definitions/RecordIdInfo" @@ -3685,6 +4158,7 @@ ] }, "record_spec_id_info": { + "description": "record_spec_id_info contains information about the id/address of the record specification.", "anyOf": [ { "$ref": "#/definitions/RecordSpecIdInfo" @@ -3697,6 +4171,7 @@ } }, "Scope": { + "description": "Scope defines a root reference for a collection of records owned by one or more parties.", "type": "object", "required": [ "data_access", @@ -3708,21 +4183,25 @@ ], "properties": { "data_access": { + "description": "Addresses in this list are authorized to receive off-chain data associated with this scope.", "type": "array", "items": { "type": "string" } }, "owners": { + "description": "These parties represent top level owners of the records within. These parties must sign any requests that modify the data within the scope. These addresses are in union with parties listed on the sessions.", "type": "array", "items": { "$ref": "#/definitions/Party" } }, "require_party_rollup": { + "description": "Whether all parties in this scope and its sessions must be present in this scope's owners field. This also enables use of optional=true scope owners and session parties.", "type": "boolean" }, "scope_id": { + "description": "Unique ID for this scope. Implements sdk.Address interface for use where addresses are required in Cosmos", "type": "array", "items": { "type": "integer", @@ -3731,6 +4210,7 @@ } }, "specification_id": { + "description": "the scope specification that contains the specifications for data elements allowed within this scope", "type": "array", "items": { "type": "integer", @@ -3739,11 +4219,13 @@ } }, "value_owner_address": { + "description": "An address that controls the value associated with this scope. Standard blockchain accounts and marker accounts are supported for this value. This attribute may only be changed by the entity indicated once it is set.", "type": "string" } } }, "ScopeIdInfo": { + "description": "ScopeIdInfo contains various info regarding a scope id.", "type": "object", "required": [ "scope_addr", @@ -3754,9 +4236,11 @@ ], "properties": { "scope_addr": { + "description": "scope_addr is the bech32 string version of the scope_id.", "type": "string" }, "scope_id": { + "description": "scope_id is the raw bytes of the scope address.", "type": "array", "items": { "type": "integer", @@ -3765,6 +4249,7 @@ } }, "scope_id_prefix": { + "description": "scope_id_prefix is the prefix portion of the scope_id.", "type": "array", "items": { "type": "integer", @@ -3773,6 +4258,7 @@ } }, "scope_id_scope_uuid": { + "description": "scope_id_scope_uuid is the scope_uuid portion of the scope_id.", "type": "array", "items": { "type": "integer", @@ -3781,11 +4267,13 @@ } }, "scope_uuid": { + "description": "scope_uuid is the uuid hex string of the scope_id_scope_uuid.", "type": "string" } } }, "ScopeSpecIdInfo": { + "description": "ScopeSpecIdInfo contains various info regarding a scope specification id.", "type": "object", "required": [ "scope_spec_addr", @@ -3796,9 +4284,11 @@ ], "properties": { "scope_spec_addr": { + "description": "scope_spec_addr is the bech32 string version of the scope_spec_id.", "type": "string" }, "scope_spec_id": { + "description": "scope_spec_id is the raw bytes of the scope specification address.", "type": "array", "items": { "type": "integer", @@ -3807,6 +4297,7 @@ } }, "scope_spec_id_prefix": { + "description": "scope_spec_id_prefix is the prefix portion of the scope_spec_id.", "type": "array", "items": { "type": "integer", @@ -3815,6 +4306,7 @@ } }, "scope_spec_id_scope_spec_uuid": { + "description": "scope_spec_id_scope_spec_uuid is the scope_spec_uuid portion of the scope_spec_id.", "type": "array", "items": { "type": "integer", @@ -3823,14 +4315,17 @@ } }, "scope_spec_uuid": { + "description": "scope_spec_uuid is the uuid hex string of the scope_spec_id_scope_spec_uuid.", "type": "string" } } }, "ScopeWrapper": { + "description": "SessionWrapper contains a single scope and its uuid.", "type": "object", "properties": { "scope": { + "description": "scope is the on-chain scope message.", "anyOf": [ { "$ref": "#/definitions/Scope" @@ -3841,6 +4336,7 @@ ] }, "scope_id_info": { + "description": "scope_id_info contains information about the id/address of the scope.", "anyOf": [ { "$ref": "#/definitions/ScopeIdInfo" @@ -3851,6 +4347,7 @@ ] }, "scope_spec_id_info": { + "description": "scope_spec_id_info contains information about the id/address of the scope specification.", "anyOf": [ { "$ref": "#/definitions/ScopeSpecIdInfo" @@ -3863,6 +4360,7 @@ } }, "Session": { + "description": "Session defines an execution context against a specific specification instance. The context will have a specification and set of parties involved.\n\nNOTE: When there are no more Records within a Scope that reference a Session, the Session is removed.", "type": "object", "required": [ "context", @@ -3873,6 +4371,7 @@ ], "properties": { "audit": { + "description": "Created by, updated by, timestamps, version number, and related info.", "anyOf": [ { "$ref": "#/definitions/AuditFields" @@ -3883,6 +4382,7 @@ ] }, "context": { + "description": "context is a field for storing client specific data associated with a session.", "type": "array", "items": { "type": "integer", @@ -3891,9 +4391,11 @@ } }, "name": { + "description": "name to associate with this session execution context, typically classname", "type": "string" }, "parties": { + "description": "parties is the set of identities that signed this contract", "type": "array", "items": { "$ref": "#/definitions/Party" @@ -3908,6 +4410,7 @@ } }, "specification_id": { + "description": "unique id of the contract specification that was used to create this session.", "type": "array", "items": { "type": "integer", @@ -3918,6 +4421,7 @@ } }, "SessionIdInfo": { + "description": "SessionIdInfo contains various info regarding a session id.", "type": "object", "required": [ "session_addr", @@ -3929,6 +4433,7 @@ ], "properties": { "scope_id_info": { + "description": "scope_id_info is information about the scope id referenced in the session_id.", "anyOf": [ { "$ref": "#/definitions/ScopeIdInfo" @@ -3939,9 +4444,11 @@ ] }, "session_addr": { + "description": "session_addr is the bech32 string version of the session_id.", "type": "string" }, "session_id": { + "description": "session_id is the raw bytes of the session address.", "type": "array", "items": { "type": "integer", @@ -3950,6 +4457,7 @@ } }, "session_id_prefix": { + "description": "session_id_prefix is the prefix portion of the session_id.", "type": "array", "items": { "type": "integer", @@ -3958,6 +4466,7 @@ } }, "session_id_scope_uuid": { + "description": "session_id_scope_uuid is the scope_uuid portion of the session_id.", "type": "array", "items": { "type": "integer", @@ -3966,6 +4475,7 @@ } }, "session_id_session_uuid": { + "description": "session_id_session_uuid is the session_uuid portion of the session_id.", "type": "array", "items": { "type": "integer", @@ -3974,14 +4484,17 @@ } }, "session_uuid": { + "description": "session_uuid is the uuid hex string of the session_id_session_uuid.", "type": "string" } } }, "SessionWrapper": { + "description": "SessionWrapper contains a single session and some extra identifiers for it.", "type": "object", "properties": { "contract_spec_id_info": { + "description": "contract_spec_id_info contains information about the id/address of the contract specification.", "anyOf": [ { "$ref": "#/definitions/ContractSpecIdInfo" @@ -3992,6 +4505,7 @@ ] }, "session": { + "description": "session is the on-chain session message.", "anyOf": [ { "$ref": "#/definitions/Session" @@ -4002,6 +4516,7 @@ ] }, "session_id_info": { + "description": "session_id_info contains information about the id/address of the session.", "anyOf": [ { "$ref": "#/definitions/SessionIdInfo" @@ -4014,6 +4529,7 @@ } }, "SessionsRequest": { + "description": "SessionsRequest is the request type for the Query/Sessions RPC method.", "type": "object", "required": [ "exclude_id_info", @@ -4027,34 +4543,44 @@ ], "properties": { "exclude_id_info": { + "description": "exclude_id_info is a flag for whether to exclude the id info from the response.", "type": "boolean" }, "include_records": { + "description": "include_records is a flag for whether to include the records of these sessions in the response.", "type": "boolean" }, "include_request": { + "description": "include_request is a flag for whether to include this request in your result.", "type": "boolean" }, "include_scope": { + "description": "include_scope is a flag for whether to include the scope containing these sessions in the response.", "type": "boolean" }, "record_addr": { + "description": "record_addr is a bech32 record address, e.g. record1q2ge0zaztu65tx5x5llv5xc9ztsw42dq2jdvmdazuwzcaddhh8gmu3mcze3.", "type": "string" }, "record_name": { + "description": "record_name is the name of the record to find the session for in the provided scope.", "type": "string" }, "scope_id": { + "description": "scope_id can either be a uuid, e.g. 91978ba2-5f35-459a-86a7-feca1b0512e0 or a bech32 scope address, e.g. scope1qzge0zaztu65tx5x5llv5xc9ztsqxlkwel.", "type": "string" }, "session_id": { + "description": "session_id can either be a uuid, e.g. 5803f8bc-6067-4eb5-951f-2121671c2ec0 or a bech32 session address, e.g. session1qxge0zaztu65tx5x5llv5xc9zts9sqlch3sxwn44j50jzgt8rshvqyfrjcr. This can only be a uuid if a scope_id is also provided.", "type": "string" } } }, "Source": { + "description": "data source", "oneOf": [ { + "description": "the address of a record on chain (For Established Records)", "type": "object", "required": [ "RecordId" @@ -4072,6 +4598,7 @@ "additionalProperties": false }, { + "description": "the hash of an off-chain piece of information (For Proposed Records)", "type": "object", "required": [ "Hash" From 244e6309fe4d6e1664c3dcad5c394c5ba1e6ae9d Mon Sep 17 00:00:00 2001 From: kwt <4344285+kwtalley@users.noreply.github.com> Date: Fri, 12 Jul 2024 07:08:02 -0500 Subject: [PATCH 31/43] update changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c98e87e9..a114e021 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ * fix code generation ([#150](https://github.com/provenance-io/provwasm/issues/150)) * refactor `Any` to support Trigger messages ([#123](https://github.com/provenance-io/provwasm/issues/123)) * Update to cosmwasm 2.x ([#141](https://github.com/provenance-io/provwasm/issues/141)) +* add module features to provwasm-std ([#142](https://github.com/provenance-io/provwasm/issues/142)) +* minimize generated types ([#152](https://github.com/provenance-io/provwasm/issues/152)) +* update to provenance 1.19.0 ([#155](https://github.com/provenance-io/provwasm/issues/155)) ## Releases From 46429344bacb17fe001d80e0434d259cc706c2fe Mon Sep 17 00:00:00 2001 From: kwt <4344285+kwtalley@users.noreply.github.com> Date: Fri, 12 Jul 2024 07:20:01 -0500 Subject: [PATCH 32/43] update migration doc --- MIGRATION.md | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/MIGRATION.md b/MIGRATION.md index 67bd5188..a40208b6 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -1,16 +1,25 @@ # Migrating Contracts -This guide provides information to assist in migrating contracts over major releases. +This guide provides information to assist in migrating contracts over major releases. ___There are also example [contracts](./contracts) that provide concrete examples using the current release.___ +## v2.1.0/v2.2.0 -> 2.3.0 + +Cosmwasm is upgraded to 2.0.4 and Provenance to 1.19.0. These major upgrades are mostly handled within the library: + +- The encoding for `Any` types has changed. This means if your contract has a query that expects a `MarkerAccount` in + its response, it will fail as of `Provenance 1.19.0`. This is an internal change and only requires bumping the + provwasm-std dependency. +- Follow the common [Cosmwasm migration path](https://github.com/cosmos/cosmos-rust). It is likely that your contract + will not require many changes. `QueryRequest::Grpc` is not supported (yet) ## v1.x.x -> 2.0.0 This major upgrade changes the message base type from `CosmosMsg::Custom` to `CosmosMsg::Stargate`. This -allows all message types to be generated from the actual proto definitions in Provenance, making it much easier to add -and deprecate types. It will require updating all `provwasm` messages and queries. You will notice a `Deprecated` warning until -you replace the older types. +allows all message types to be generated from the actual proto definitions in Provenance, making it much easier to add +and deprecate types. It will require updating all `provwasm` messages and queries. You will notice a `Deprecated` +warning until you replace the older types. --- @@ -65,7 +74,7 @@ you replace the older types. required_attributes: vec![], } ``` - + --- - Message: @@ -103,10 +112,10 @@ you replace the older types. return MarkerAccount::try_from(marker) } ``` - - ***`MarkerAccount` is the only special type that requires `::try_from()` since it is of type `Any`. Normally query + + ***`MarkerAccount` is the only special type that requires `::try_from()` since it is of type `Any`. Normally query responses are typed like the following:*** - + ```rust let querier = NameQuerier::new(&deps.querier); let query_response = querier.resolve(name)?; // query_response is of type QueryResolveResponse From 5bc7620fd43e3c2322ea0de74bb4164e430d077c Mon Sep 17 00:00:00 2001 From: kwt <4344285+kwtalley@users.noreply.github.com> Date: Fri, 12 Jul 2024 08:02:33 -0500 Subject: [PATCH 33/43] update to optimizer 0.16.0 --- contracts/attrs/Makefile | 2 +- contracts/ibc/local/Makefile | 2 +- contracts/ibc/remote/Makefile | 2 +- contracts/marker/Makefile | 2 +- contracts/msgfees/Makefile | 2 +- contracts/name/Makefile | 2 +- contracts/scope/Makefile | 2 +- contracts/trigger/Makefile | 2 +- contracts/tutorial/Makefile | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/contracts/attrs/Makefile b/contracts/attrs/Makefile index 61143ef6..aa53bc75 100644 --- a/contracts/attrs/Makefile +++ b/contracts/attrs/Makefile @@ -42,7 +42,7 @@ optimize: docker run --rm -v $(CURDIR)/../../:/code:Z --workdir /code/contracts/attrs \ --mount type=volume,source=attrs_cache,target=/code/target \ --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ - $$image:0.15.0 + $$image:0.16.0 .PHONY: install install: diff --git a/contracts/ibc/local/Makefile b/contracts/ibc/local/Makefile index f72d1186..9f2d5c8f 100644 --- a/contracts/ibc/local/Makefile +++ b/contracts/ibc/local/Makefile @@ -42,7 +42,7 @@ optimize: docker run --rm -v $(CURDIR)/../../../:/code:Z --workdir /code/contracts/ibc/local \ --mount type=volume,source=ibc_local_cache,target=/code/target \ --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ - $$image:0.15.0 + $$image:0.16.0 .PHONY: install install: diff --git a/contracts/ibc/remote/Makefile b/contracts/ibc/remote/Makefile index 45594c54..01f2d5ff 100644 --- a/contracts/ibc/remote/Makefile +++ b/contracts/ibc/remote/Makefile @@ -42,7 +42,7 @@ optimize: docker run --rm -v $(CURDIR)/../../../:/code:Z --workdir /code/contracts/ibc/remote \ --mount type=volume,source=ibc_remote_cache,target=/code/target \ --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ - $$image:0.15.0 + $$image:0.16.0 .PHONY: install install: diff --git a/contracts/marker/Makefile b/contracts/marker/Makefile index 61ae11a4..7eb12fbf 100644 --- a/contracts/marker/Makefile +++ b/contracts/marker/Makefile @@ -42,7 +42,7 @@ optimize: docker run --rm -v $(CURDIR)/../../:/code:Z --workdir /code/contracts/marker \ --mount type=volume,source=marker_cache,target=/code/target \ --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ - $$image:0.15.0 + $$image:0.16.0 .PHONY: install install: diff --git a/contracts/msgfees/Makefile b/contracts/msgfees/Makefile index 97c81cee..cc7528a7 100644 --- a/contracts/msgfees/Makefile +++ b/contracts/msgfees/Makefile @@ -42,7 +42,7 @@ optimize: docker run --rm -v $(CURDIR)/../../:/code:Z --workdir /code/contracts/msgfees \ --mount type=volume,source=msgfees_cache,target=/code/target \ --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ - $$image:0.15.0 + $$image:0.16.0 .PHONY: install install: diff --git a/contracts/name/Makefile b/contracts/name/Makefile index 3ab30071..a00c2e93 100644 --- a/contracts/name/Makefile +++ b/contracts/name/Makefile @@ -42,7 +42,7 @@ optimize: docker run --rm -v $(CURDIR)/../../:/code:Z --workdir /code/contracts/name \ --mount type=volume,source=name_cache,target=/code/target \ --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ - $$image:0.15.0 + $$image:0.16.0 .PHONY: install install: diff --git a/contracts/scope/Makefile b/contracts/scope/Makefile index f5afb162..fe0f84da 100644 --- a/contracts/scope/Makefile +++ b/contracts/scope/Makefile @@ -42,7 +42,7 @@ optimize: docker run --rm -v $(CURDIR)/../../:/code:Z --workdir /code/contracts/scope \ --mount type=volume,source=scope_cache,target=/code/target \ --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ - $$image:0.15.0 + $$image:0.16.0 .PHONY: install install: diff --git a/contracts/trigger/Makefile b/contracts/trigger/Makefile index 93b73816..5158c4fe 100644 --- a/contracts/trigger/Makefile +++ b/contracts/trigger/Makefile @@ -42,7 +42,7 @@ optimize: docker run --rm -v $(CURDIR)/../../:/code:Z --workdir /code/contracts/trigger \ --mount type=volume,source=trigger_cache,target=/code/target \ --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ - $$image:0.15.0 + $$image:0.16.0 .PHONY: install install: diff --git a/contracts/tutorial/Makefile b/contracts/tutorial/Makefile index 5d648a4f..69509390 100644 --- a/contracts/tutorial/Makefile +++ b/contracts/tutorial/Makefile @@ -41,4 +41,4 @@ optimize: docker run --rm -v $(CURDIR)/../../:/code:Z --workdir /code/contracts/tutorial \ --mount type=volume,source=tutorial_cache,target=/code/target \ --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ - $$image:0.15.0 + $$image:0.16.0 From 0d3631d9978e4b460078d9eb0d5b5848df13f415 Mon Sep 17 00:00:00 2001 From: kwt <4344285+kwtalley@users.noreply.github.com> Date: Fri, 12 Jul 2024 08:54:23 -0500 Subject: [PATCH 34/43] update to provenance v1.19.0-rc3 --- .github/workflows/test.yml | 14 +++++++------- dependencies/provenance | 2 +- packages/proto-build/src/main.rs | 2 +- packages/provwasm-std/src/types/PROVENANCE_COMMIT | 2 +- .../provwasm-std/src/types/cosmwasm/wasm/v1.rs | 14 ++++++++++++++ scripts/update-and-rebuild.sh | 2 +- 6 files changed, 25 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 34ef668b..f9300ce2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,7 +35,7 @@ jobs: uses: provenance-io/provenance-testing-action@v1.3.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} - provenance_version: "v1.19.0-rc2" + provenance_version: "v1.19.0-rc3" test_script: "./scripts/gh-action-test/tutorial_test.sh" test_attrs_smart_contract: @@ -55,7 +55,7 @@ jobs: uses: provenance-io/provenance-testing-action@v1.3.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} - provenance_version: "v1.19.0-rc2" + provenance_version: "v1.19.0-rc3" smart_contract_action_version: "latest" test_script: "./scripts/gh-action-test/attrs_test.sh" @@ -76,7 +76,7 @@ jobs: uses: provenance-io/provenance-testing-action@v1.3.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} - provenance_version: "v1.19.0-rc2" + provenance_version: "v1.19.0-rc3" smart_contract_action_version: "latest" test_script: "./scripts/gh-action-test/marker_test.sh" @@ -97,7 +97,7 @@ jobs: uses: provenance-io/provenance-testing-action@v1.3.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} - provenance_version: "v1.19.0-rc2" + provenance_version: "v1.19.0-rc3" smart_contract_action_version: "latest" test_script: "./scripts/gh-action-test/msgfees_test.sh" @@ -118,7 +118,7 @@ jobs: uses: provenance-io/provenance-testing-action@v1.3.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} - provenance_version: "v1.19.0-rc2" + provenance_version: "v1.19.0-rc3" smart_contract_action_version: "latest" test_script: "./scripts/gh-action-test/name_test.sh" @@ -139,7 +139,7 @@ jobs: # uses: provenance-io/provenance-testing-action@v1.3.0 # with: # github_token: ${{ secrets.GITHUB_TOKEN }} - # provenance_version: "v1.19.0-rc2" + # provenance_version: "v1.19.0-rc3" # smart_contract_action_version: "latest" # test_script: "./scripts/gh-action-test/scope_test.sh" @@ -160,6 +160,6 @@ jobs: uses: provenance-io/provenance-testing-action@v1.3.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} - provenance_version: "v1.19.0-rc2" + provenance_version: "v1.19.0-rc3" smart_contract_action_version: "latest" test_script: "./scripts/gh-action-test/trigger_test.sh" diff --git a/dependencies/provenance b/dependencies/provenance index 17b9b8c3..3e3a135f 160000 --- a/dependencies/provenance +++ b/dependencies/provenance @@ -1 +1 @@ -Subproject commit 17b9b8c3e655b6a56840841b83252b241d01ff14 +Subproject commit 3e3a135fb0d90f940fd41c5adbffbbfffb2341fd diff --git a/packages/proto-build/src/main.rs b/packages/proto-build/src/main.rs index 100e70de..f9f16dd4 100644 --- a/packages/proto-build/src/main.rs +++ b/packages/proto-build/src/main.rs @@ -10,7 +10,7 @@ use proto_build::{ }; /// The provenance commit or tag to be cloned and used to build the proto files -const PROVENANCE_REV: &str = "v1.19.0-rc2"; +const PROVENANCE_REV: &str = "v1.19.0-rc3"; // All paths must end with a / and either be absolute or include a ./ to reference the current // working directory. diff --git a/packages/provwasm-std/src/types/PROVENANCE_COMMIT b/packages/provwasm-std/src/types/PROVENANCE_COMMIT index ce7306d7..a434f8ba 100644 --- a/packages/provwasm-std/src/types/PROVENANCE_COMMIT +++ b/packages/provwasm-std/src/types/PROVENANCE_COMMIT @@ -1 +1 @@ -v1.19.0-rc2 \ No newline at end of file +v1.19.0-rc3 \ No newline at end of file diff --git a/packages/provwasm-std/src/types/cosmwasm/wasm/v1.rs b/packages/provwasm-std/src/types/cosmwasm/wasm/v1.rs index 140d7565..0ec6f18d 100644 --- a/packages/provwasm-std/src/types/cosmwasm/wasm/v1.rs +++ b/packages/provwasm-std/src/types/cosmwasm/wasm/v1.rs @@ -720,6 +720,20 @@ pub struct MsgIbcSendResponse { )] pub sequence: u64, } +/// MsgIBCWriteAcknowledgementResponse +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive( + Clone, + PartialEq, + Eq, + ::prost::Message, + ::serde::Serialize, + ::serde::Deserialize, + ::schemars::JsonSchema, + CosmwasmExt, +)] +#[proto_message(type_url = "/cosmwasm.wasm.v1.MsgIBCWriteAcknowledgementResponse")] +pub struct MsgIbcWriteAcknowledgementResponse {} /// MsgIBCCloseChannel port and channel need to be owned by the contract #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/scripts/update-and-rebuild.sh b/scripts/update-and-rebuild.sh index 390a2757..fb65ea3c 100755 --- a/scripts/update-and-rebuild.sh +++ b/scripts/update-and-rebuild.sh @@ -3,7 +3,7 @@ set -euxo pipefail SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -LATEST_PROVENANCE_VERSION="v1.19.0-rc2" +LATEST_PROVENANCE_VERSION="v1.19.0-rc3" PROVENANCE_REV=${1:-$LATEST_PROVENANCE_VERSION} COMMIT=${2:-"skip"} From 8e591bed3d636763d67becb7b13b3840552c0367 Mon Sep 17 00:00:00 2001 From: kwt <4344285+kwtalley@users.noreply.github.com> Date: Fri, 12 Jul 2024 19:09:06 -0500 Subject: [PATCH 35/43] fix serde of i32 or vec as str or enum string --- packages/proto-build/src/transform.rs | 8 +- packages/proto-build/src/transformers.rs | 136 ++++++++++++++++------- packages/provwasm-proc-macro/src/lib.rs | 73 ++++++++++++ packages/provwasm-std/src/serde/mod.rs | 21 ---- 4 files changed, 174 insertions(+), 64 deletions(-) diff --git a/packages/proto-build/src/transform.rs b/packages/proto-build/src/transform.rs index 1982af4b..95c9f219 100644 --- a/packages/proto-build/src/transform.rs +++ b/packages/proto-build/src/transform.rs @@ -115,7 +115,7 @@ fn prepend(items: Vec) -> Vec { let mut items = items; let mut prepending_items = vec![syn::parse_quote! { - use provwasm_proc_macro::CosmwasmExt; + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; }]; items.splice(0..0, prepending_items.drain(..)); @@ -146,8 +146,8 @@ fn transform_items( Some(file_stem) => { format!( "{}::{}", - file_stem.to_str().unwrap().replace(".", "::"), - s.ident.to_string() + file_stem.to_str().unwrap().replace('.', "::"), + s.ident ) } _ => s.ident.to_string(), @@ -168,7 +168,7 @@ fn transform_items( ); let s = transformers::allow_serde_vec_vec_u8_as_vec_string_bytes(s); let s = transformers::allow_serde_int_as_str(s); - let s = transformers::allow_serde_int_as_str_or_enum_as_i32(s); + let s = transformers::allow_serde_i32_or_vec_i32(s); transformers::allow_serde_vec_int_as_vec_str(s) })), diff --git a/packages/proto-build/src/transformers.rs b/packages/proto-build/src/transformers.rs index 8e0ee732..24884184 100644 --- a/packages/proto-build/src/transformers.rs +++ b/packages/proto-build/src/transformers.rs @@ -9,9 +9,9 @@ use prost_types::{ }; use quote::{format_ident, quote}; use regex::Regex; -use syn::ItemEnum; use syn::ItemMod; use syn::{parse_quote, Attribute, Fields, Ident, Item, ItemStruct, Type}; +use syn::{ItemEnum, Lit}; /// Regex substitutions to apply to the prost-generated output pub const REPLACEMENTS: &[(&str, &str)] = &[ @@ -132,10 +132,27 @@ pub fn append_attrs_struct( pub fn append_attrs_enum(src: &Path, e: &ItemEnum, descriptor: &FileDescriptorSet) -> ItemEnum { let mut e = e.clone(); let deprecated = get_deprecation(src, &e.ident, descriptor); + let is_repr_i32 = e.attrs.iter().any(|attr| { + attr.path.is_ident("repr") && attr.parse_meta().ok().map_or(false, |meta| { + if let syn::Meta::List(meta_list) = meta { + meta_list.nested.iter().any(|nested_meta| { + matches!(nested_meta, syn::NestedMeta::Meta(syn::Meta::Path(path)) if path.is_ident("i32")) + }) + } else { + false + } + }) + }); - e.attrs.append(&mut vec![ - syn::parse_quote! { #[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] }, - ]); + if is_repr_i32 { + e.attrs.append(&mut vec![ + syn::parse_quote! { #[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] }, + ]); + } else { + e.attrs.append(&mut vec![ + syn::parse_quote! { #[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] }, + ]); + } if deprecated { e.attrs @@ -193,7 +210,7 @@ pub fn allow_serde_vec_int_as_vec_str(s: ItemStruct) -> ItemStruct { let vec_int_types: Vec = vec![ parse_quote!(::prost::alloc::vec::Vec), parse_quote!(::prost::alloc::vec::Vec), - parse_quote!(::prost::alloc::vec::Vec), + //parse_quote!(::prost::alloc::vec::Vec), -- this is not included since it could be either vec or vec type parse_quote!(::prost::alloc::vec::Vec), parse_quote!(::prost::alloc::vec::Vec), parse_quote!(::prost::alloc::vec::Vec), @@ -405,47 +422,88 @@ pub fn allow_serde_option_vec_u8_as_base64_encoded_string(s: syn::ItemStruct) -> syn::ItemStruct { fields, ..s } } -/// Adds `crate::serde::enum_as_i32` serde attribute to specific Metadata fields which -/// are an enumerated type as an i32, or adds `crate::serde::as_str` serde attribute like `allow_serde_int_as_str` -pub fn allow_serde_int_as_str_or_enum_as_i32(s: syn::ItemStruct) -> syn::ItemStruct { +/// Adds type specific serde derived from `SerdeEnumAsInt` proc macro for enumerated type as i32 or +/// Vec, or adds `crate::serde::as_str` serde attribute like `allow_serde_int_as_str` +pub fn allow_serde_i32_or_vec_i32(s: syn::ItemStruct) -> syn::ItemStruct { + let vec_int_types: Vec = vec![ + parse_quote!(i32), + parse_quote!(::prost::alloc::vec::Vec), + ]; + let fields_vec = s .fields .into_iter() .map(|mut field| { - if field.ty == parse_quote!(i32) { - let add_serde_attrs = field.attrs.iter().any(|attr| { - if attr.path.is_ident("prost") { - if let Ok(syn::Meta::List(meta_list)) = attr.parse_meta() { - return meta_list.nested.iter().any(|nested_meta| { - if let syn::NestedMeta::Meta(syn::Meta::NameValue(name_value)) = - nested_meta - { - return name_value.path.is_ident("enumeration"); - } - false - }); + if let Some(vec_int_types_index) = vec_int_types.iter().position(|ty| ty.eq(&field.ty)) + { + { + let prost_enum_literal_value = field.attrs.iter().find_map(|attr| { + if attr.path.is_ident("prost") { + if let Ok(syn::Meta::List(meta_list)) = attr.parse_meta() { + return meta_list.nested.iter().find_map(|nested_meta| { + if let syn::NestedMeta::Meta(syn::Meta::NameValue(name_value)) = + nested_meta + { + if name_value.path.is_ident("enumeration") { + if let Lit::Str(literal) = &name_value.lit { + return Some(literal.value()); + } + } + } + None + }); + } } - } - false - }); - - if add_serde_attrs { - field.attrs.push(parse_quote! { - #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" - )] - }); - } else { - field.attrs.push(parse_quote! { - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] + None }); + + // determine if enum and type + match (vec_int_types_index, prost_enum_literal_value) { + // i32 + (0, None) => { + field.attrs.push(parse_quote! { + #[serde( + serialize_with = "crate::serde::as_str::serialize", + deserialize_with = "crate::serde::as_str::deserialize" + )] + }); + } + // Vec + (1, None) => { + field.attrs.push(parse_quote! { + #[serde( + serialize_with = "crate::serde::as_str_vec::serialize", + deserialize_with = "crate::serde::as_str_vec::deserialize" + )] + }); + } + // i32 enum + (0, Some(enum_type)) => { + let serialize_with = format!("{}::serialize", enum_type); + let deserialize_with = format!("{}::deserialize", enum_type); + field.attrs.push(parse_quote! { + #[serde( + serialize_with = #serialize_with, + deserialize_with = #deserialize_with + )] + }); + } + // Vec enum + (1, Some(enum_type)) => { + let serialize_with = format!("{}::serialize_vec", enum_type); + let deserialize_with = format!("{}::deserialize_vec", enum_type); + field.attrs.push(parse_quote! { + #[serde( + serialize_with = #serialize_with, + deserialize_with = #deserialize_with + )] + }); + } + // none of these + _ => (), + }; } } - field }) .collect::>(); @@ -927,7 +985,7 @@ mod tests { } }; - let result = allow_serde_int_as_str_or_enum_as_i32(input); + let result = allow_serde_i32_or_vec_i32(input); let expected: ItemStruct = parse_quote! { pub struct Party { diff --git a/packages/provwasm-proc-macro/src/lib.rs b/packages/provwasm-proc-macro/src/lib.rs index dd00cb3c..d6a11180 100644 --- a/packages/provwasm-proc-macro/src/lib.rs +++ b/packages/provwasm-proc-macro/src/lib.rs @@ -169,6 +169,79 @@ pub fn derive_cosmwasm_ext(input: TokenStream) -> TokenStream { .into() } +#[proc_macro_derive(SerdeEnumAsInt)] +pub fn derive_serde_enum_as_int(input: TokenStream) -> TokenStream { + let input = parse_macro_input!(input as DeriveInput); + let ident = input.ident; + (quote! { + impl #ident { + pub fn serialize(v: &i32, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + let enum_value = Self::try_from(*v); + match enum_value { + Ok(v) => serializer.serialize_str(v.as_str_name()), + Err(e) => Err(serde::ser::Error::custom(e)), + } + } + + pub fn deserialize<'de, D>(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + use serde::de::Deserialize; + let s = String::deserialize(deserializer)?; + match Self::from_str_name(&s) { + Some(v) => Ok(v.into()), + None => Err(serde::de::Error::custom("unknown value")), + } + } + + pub fn serialize_vec(v: &Vec, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeTuple; + + let mut enum_strs: Vec<&str> = Vec::new(); + for ord in v { + // let enum_value = Self::try_from(*ord); + let enum_value = Self::try_from(*ord); + match enum_value { + Ok(v) => { + enum_strs.push(v.as_str_name()); + } + Err(e) => return Err(serde::ser::Error::custom(e)), + } + } + let mut seq = serializer.serialize_tuple(enum_strs.len())?; + for item in enum_strs { + seq.serialize_element(item)?; + } + seq.end() + } + + fn deserialize_vec<'de, D>(deserializer: D) -> std::result::Result, D::Error> + where + D: serde::Deserializer<'de>, + { + use serde::de::{Deserialize, Error}; + + let strs: Vec = Vec::deserialize(deserializer)?; + let mut ords: Vec = Vec::new(); + for str_name in strs { + let enum_value = Self::from_str_name(&str_name) + .ok_or_else(|| Error::custom(format!("unknown enum string: {}", str_name)))?; + ords.push(enum_value as i32); + } + Ok(ords) + } + } + }) + .into() +} + fn get_type_url(attrs: &[syn::Attribute]) -> proc_macro2::TokenStream { let proto_message = get_attr("proto_message", attrs).and_then(|a| a.parse_meta().ok()); diff --git a/packages/provwasm-std/src/serde/mod.rs b/packages/provwasm-std/src/serde/mod.rs index a7c52888..731ea6ad 100644 --- a/packages/provwasm-std/src/serde/mod.rs +++ b/packages/provwasm-std/src/serde/mod.rs @@ -153,24 +153,3 @@ pub mod as_option_base64_encoded_string { } } } - -pub mod enum_as_i32 { - use serde::{Deserialize, Deserializer, Serializer}; - - // Serialize the enum as i32 - pub fn serialize(value: &i32, serializer: S) -> Result - where - S: Serializer, - { - serializer.serialize_i32(*value) - } - - // Deserialize i32 as enum - pub fn deserialize<'de, D>(deserializer: D) -> Result - where - D: Deserializer<'de>, - { - let value = i32::deserialize(deserializer)?; - Ok(value) - } -} From 61fc94bfe059f4fb0b924791023cfb12f94fdbaf Mon Sep 17 00:00:00 2001 From: kwt <4344285+kwtalley@users.noreply.github.com> Date: Fri, 12 Jul 2024 19:53:20 -0500 Subject: [PATCH 36/43] fix format --- packages/provwasm-proc-macro/src/lib.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/provwasm-proc-macro/src/lib.rs b/packages/provwasm-proc-macro/src/lib.rs index d6a11180..010c0e02 100644 --- a/packages/provwasm-proc-macro/src/lib.rs +++ b/packages/provwasm-proc-macro/src/lib.rs @@ -185,7 +185,7 @@ pub fn derive_serde_enum_as_int(input: TokenStream) -> TokenStream { Err(e) => Err(serde::ser::Error::custom(e)), } } - + pub fn deserialize<'de, D>(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, @@ -197,13 +197,13 @@ pub fn derive_serde_enum_as_int(input: TokenStream) -> TokenStream { None => Err(serde::de::Error::custom("unknown value")), } } - + pub fn serialize_vec(v: &Vec, serializer: S) -> std::result::Result where S: serde::Serializer, { use serde::ser::SerializeTuple; - + let mut enum_strs: Vec<&str> = Vec::new(); for ord in v { // let enum_value = Self::try_from(*ord); @@ -221,13 +221,13 @@ pub fn derive_serde_enum_as_int(input: TokenStream) -> TokenStream { } seq.end() } - + fn deserialize_vec<'de, D>(deserializer: D) -> std::result::Result, D::Error> where D: serde::Deserializer<'de>, { use serde::de::{Deserialize, Error}; - + let strs: Vec = Vec::deserialize(deserializer)?; let mut ords: Vec = Vec::new(); for str_name in strs { From ad9d18b1800f7a980e32c90d2e24b674173310a6 Mon Sep 17 00:00:00 2001 From: kwt <4344285+kwtalley@users.noreply.github.com> Date: Fri, 12 Jul 2024 20:01:54 -0500 Subject: [PATCH 37/43] regenerate types with latest fix --- .../provwasm-std/src/types/capability/v1.rs | 2 +- .../src/types/cosmos/app/runtime/v1alpha1.rs | 2 +- .../src/types/cosmos/app/v1alpha1.rs | 2 +- .../src/types/cosmos/auth/module/v1.rs | 2 +- .../src/types/cosmos/auth/v1beta1.rs | 2 +- .../src/types/cosmos/authz/module/v1.rs | 2 +- .../src/types/cosmos/authz/v1beta1.rs | 2 +- .../src/types/cosmos/bank/module/v1.rs | 2 +- .../src/types/cosmos/bank/v1beta1.rs | 2 +- .../src/types/cosmos/base/abci/v1beta1.rs | 2 +- .../src/types/cosmos/base/node/v1beta1.rs | 2 +- .../src/types/cosmos/base/query/v1beta1.rs | 2 +- .../types/cosmos/base/tendermint/v1beta1.rs | 2 +- .../src/types/cosmos/base/v1beta1.rs | 2 +- .../src/types/cosmos/circuit/module/v1.rs | 2 +- .../src/types/cosmos/circuit/v1.rs | 10 +-- .../src/types/cosmos/consensus/module/v1.rs | 2 +- .../src/types/cosmos/consensus/v1.rs | 2 +- .../src/types/cosmos/crisis/module/v1.rs | 2 +- .../src/types/cosmos/crisis/v1beta1.rs | 2 +- .../src/types/cosmos/crypto/ed25519.rs | 2 +- .../src/types/cosmos/crypto/hd/v1.rs | 2 +- .../src/types/cosmos/crypto/keyring/v1.rs | 4 +- .../src/types/cosmos/crypto/multisig/mod.rs | 2 +- .../types/cosmos/crypto/multisig/v1beta1.rs | 2 +- .../src/types/cosmos/crypto/secp256k1.rs | 2 +- .../src/types/cosmos/crypto/secp256r1.rs | 2 +- .../types/cosmos/distribution/module/v1.rs | 2 +- .../src/types/cosmos/distribution/v1beta1.rs | 2 +- .../src/types/cosmos/evidence/module/v1.rs | 2 +- .../src/types/cosmos/evidence/v1beta1.rs | 2 +- .../src/types/cosmos/feegrant/module/v1.rs | 2 +- .../src/types/cosmos/feegrant/v1beta1.rs | 2 +- .../src/types/cosmos/genutil/module/v1.rs | 2 +- .../src/types/cosmos/genutil/v1beta1.rs | 2 +- .../src/types/cosmos/gov/module/v1.rs | 2 +- .../provwasm-std/src/types/cosmos/gov/v1.rs | 22 +++---- .../src/types/cosmos/gov/v1beta1.rs | 26 ++++---- .../src/types/cosmos/group/module/v1.rs | 2 +- .../provwasm-std/src/types/cosmos/group/v1.rs | 46 ++++++------- .../provwasm-std/src/types/cosmos/ics23/v1.rs | 44 +++++-------- .../src/types/cosmos/mint/module/v1.rs | 2 +- .../src/types/cosmos/mint/v1beta1.rs | 2 +- .../src/types/cosmos/msg/textual/v1.rs | 2 +- .../provwasm-std/src/types/cosmos/msg/v1.rs | 2 +- .../src/types/cosmos/nft/module/v1.rs | 2 +- .../src/types/cosmos/nft/v1beta1.rs | 2 +- .../src/types/cosmos/orm/module/v1alpha1.rs | 2 +- .../src/types/cosmos/orm/query/v1alpha1.rs | 6 +- .../provwasm-std/src/types/cosmos/orm/v1.rs | 2 +- .../src/types/cosmos/orm/v1alpha1.rs | 10 +-- .../src/types/cosmos/params/module/v1.rs | 2 +- .../src/types/cosmos/params/v1beta1.rs | 2 +- .../src/types/cosmos/quarantine/v1beta1.rs | 12 ++-- .../provwasm-std/src/types/cosmos/query/v1.rs | 2 +- .../src/types/cosmos/sanction/v1beta1.rs | 8 +-- .../src/types/cosmos/slashing/module/v1.rs | 2 +- .../src/types/cosmos/slashing/v1beta1.rs | 2 +- .../src/types/cosmos/staking/module/v1.rs | 2 +- .../src/types/cosmos/staking/v1beta1.rs | 18 ++--- .../types/cosmos/store/internal/kv/v1beta1.rs | 2 +- .../src/types/cosmos/store/snapshots/v1.rs | 4 +- .../src/types/cosmos/store/streaming/abci.rs | 2 +- .../src/types/cosmos/store/v1beta1.rs | 2 +- .../src/types/cosmos/tx/config/v1.rs | 2 +- .../src/types/cosmos/tx/signing/v1beta1.rs | 12 ++-- .../src/types/cosmos/tx/v1beta1.rs | 24 +++---- .../src/types/cosmos/upgrade/module/v1.rs | 2 +- .../src/types/cosmos/upgrade/v1beta1.rs | 2 +- .../src/types/cosmos/vesting/module/v1.rs | 2 +- .../src/types/cosmos/vesting/v1beta1.rs | 2 +- .../src/types/cosmwasm/wasm/v1.rs | 22 +++---- .../src/types/cosmwasm/wasm/v1beta1.rs | 26 ++++---- .../src/types/ibc/applications/fee/v1.rs | 2 +- .../interchain_accounts/controller/v1.rs | 6 +- .../interchain_accounts/genesis/v1.rs | 2 +- .../interchain_accounts/host/v1.rs | 2 +- .../applications/interchain_accounts/v1.rs | 8 +-- .../src/types/ibc/applications/transfer/v1.rs | 2 +- .../src/types/ibc/applications/transfer/v2.rs | 2 +- .../src/types/ibc/core/channel/v1.rs | 66 +++++++++---------- .../src/types/ibc/core/client/v1.rs | 2 +- .../src/types/ibc/core/commitment/v1.rs | 2 +- .../src/types/ibc/core/connection/v1.rs | 12 ++-- .../src/types/ibc/core/port/v1.rs | 6 +- .../src/types/ibc/core/types/v1.rs | 2 +- .../types/ibc/lightclients/localhost/v2.rs | 2 +- .../types/ibc/lightclients/solomachine/v2.rs | 12 ++-- .../types/ibc/lightclients/solomachine/v3.rs | 2 +- .../types/ibc/lightclients/tendermint/v1.rs | 2 +- .../src/types/ibc/lightclients/wasm/v1.rs | 2 +- .../src/types/provenance/attribute/v1.rs | 20 +++--- .../src/types/provenance/exchange/v1.rs | 10 +-- .../src/types/provenance/hold/v1.rs | 2 +- .../src/types/provenance/ibchooks/v1.rs | 2 +- .../src/types/provenance/ibcratelimit/v1.rs | 2 +- .../src/types/provenance/marker/v1.rs | 54 +++++++-------- .../src/types/provenance/metadata/v1/mod.rs | 48 +++++--------- .../src/types/provenance/metadata/v1/p8e.rs | 40 +++++------ .../src/types/provenance/msgfees/v1.rs | 2 +- .../src/types/provenance/name/v1.rs | 2 +- .../src/types/provenance/oracle/v1.rs | 2 +- .../src/types/provenance/trigger/v1.rs | 2 +- .../provwasm-std/src/types/tendermint/abci.rs | 58 ++++++++-------- .../src/types/tendermint/blocksync.rs | 4 +- .../src/types/tendermint/consensus.rs | 18 ++--- .../src/types/tendermint/crypto.rs | 4 +- .../src/types/tendermint/libs/bits.rs | 2 +- .../src/types/tendermint/mempool.rs | 4 +- .../provwasm-std/src/types/tendermint/p2p.rs | 6 +- .../src/types/tendermint/privval.rs | 6 +- .../src/types/tendermint/rpc/grpc.rs | 2 +- .../src/types/tendermint/state.rs | 2 +- .../src/types/tendermint/statesync.rs | 4 +- .../src/types/tendermint/store.rs | 2 +- .../src/types/tendermint/types.rs | 32 ++++----- .../src/types/tendermint/version.rs | 2 +- 117 files changed, 421 insertions(+), 453 deletions(-) diff --git a/packages/provwasm-std/src/types/capability/v1.rs b/packages/provwasm-std/src/types/capability/v1.rs index e7863260..fd7410e0 100644 --- a/packages/provwasm-std/src/types/capability/v1.rs +++ b/packages/provwasm-std/src/types/capability/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Capability defines an implementation of an object capability. The index /// provided to a Capability must be globally unique. #[allow(clippy::derive_partial_eq_without_eq)] diff --git a/packages/provwasm-std/src/types/cosmos/app/runtime/v1alpha1.rs b/packages/provwasm-std/src/types/cosmos/app/runtime/v1alpha1.rs index 9ac68f9d..e96f7dbf 100644 --- a/packages/provwasm-std/src/types/cosmos/app/runtime/v1alpha1.rs +++ b/packages/provwasm-std/src/types/cosmos/app/runtime/v1alpha1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Module is the config object for the runtime module. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/cosmos/app/v1alpha1.rs b/packages/provwasm-std/src/types/cosmos/app/v1alpha1.rs index c618c2f4..c00e0da5 100644 --- a/packages/provwasm-std/src/types/cosmos/app/v1alpha1.rs +++ b/packages/provwasm-std/src/types/cosmos/app/v1alpha1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// ModuleDescriptor describes an app module. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/cosmos/auth/module/v1.rs b/packages/provwasm-std/src/types/cosmos/auth/module/v1.rs index 2496f5ed..ca50684a 100644 --- a/packages/provwasm-std/src/types/cosmos/auth/module/v1.rs +++ b/packages/provwasm-std/src/types/cosmos/auth/module/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Module is the config object for the auth module. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/cosmos/auth/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/auth/v1beta1.rs index d1aed1a3..686a76f4 100644 --- a/packages/provwasm-std/src/types/cosmos/auth/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/auth/v1beta1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// BaseAccount defines a base account type. It contains all the necessary fields /// for basic account functionality. Any custom account type should extend this /// type for additional functionality (e.g. vesting). diff --git a/packages/provwasm-std/src/types/cosmos/authz/module/v1.rs b/packages/provwasm-std/src/types/cosmos/authz/module/v1.rs index edb32762..689d49e1 100644 --- a/packages/provwasm-std/src/types/cosmos/authz/module/v1.rs +++ b/packages/provwasm-std/src/types/cosmos/authz/module/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Module is the config object of the authz module. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/cosmos/authz/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/authz/v1beta1.rs index ebbd25a9..d15fed58 100644 --- a/packages/provwasm-std/src/types/cosmos/authz/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/authz/v1beta1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// GenericAuthorization gives the grantee unrestricted permissions to execute /// the provided method on behalf of the granter's account. #[allow(clippy::derive_partial_eq_without_eq)] diff --git a/packages/provwasm-std/src/types/cosmos/bank/module/v1.rs b/packages/provwasm-std/src/types/cosmos/bank/module/v1.rs index c2c29ec4..6e8a4fc0 100644 --- a/packages/provwasm-std/src/types/cosmos/bank/module/v1.rs +++ b/packages/provwasm-std/src/types/cosmos/bank/module/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Module is the config object of the bank module. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/cosmos/bank/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/bank/v1beta1.rs index 8f5719a0..281439aa 100644 --- a/packages/provwasm-std/src/types/cosmos/bank/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/bank/v1beta1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// SendAuthorization allows the grantee to spend up to spend_limit coins from /// the granter's account. /// diff --git a/packages/provwasm-std/src/types/cosmos/base/abci/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/base/abci/v1beta1.rs index 6960f4db..cc5e1350 100644 --- a/packages/provwasm-std/src/types/cosmos/base/abci/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/base/abci/v1beta1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// TxResponse defines a structure containing relevant tx data and metadata. The /// tags are stringified and the log is JSON decoded. #[allow(clippy::derive_partial_eq_without_eq)] diff --git a/packages/provwasm-std/src/types/cosmos/base/node/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/base/node/v1beta1.rs index b56c31b2..3a771ea1 100644 --- a/packages/provwasm-std/src/types/cosmos/base/node/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/base/node/v1beta1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// ConfigRequest defines the request structure for the Config gRPC query. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/cosmos/base/query/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/base/query/v1beta1.rs index 0c2adc34..6da6c65d 100644 --- a/packages/provwasm-std/src/types/cosmos/base/query/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/base/query/v1beta1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// PageRequest is to be embedded in gRPC request messages for efficient /// pagination. Ex: /// diff --git a/packages/provwasm-std/src/types/cosmos/base/tendermint/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/base/tendermint/v1beta1.rs index 687e31a3..e35c2ec5 100644 --- a/packages/provwasm-std/src/types/cosmos/base/tendermint/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/base/tendermint/v1beta1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Block is tendermint type Block, with the Header proposer address /// field converted to bech32 string. #[allow(clippy::derive_partial_eq_without_eq)] diff --git a/packages/provwasm-std/src/types/cosmos/base/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/base/v1beta1.rs index d15a2f09..e55eb27e 100644 --- a/packages/provwasm-std/src/types/cosmos/base/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/base/v1beta1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Coin defines a token with a denomination and an amount. /// /// NOTE: The amount field is an Int which implements the custom method diff --git a/packages/provwasm-std/src/types/cosmos/circuit/module/v1.rs b/packages/provwasm-std/src/types/cosmos/circuit/module/v1.rs index 00ad8a09..a83115c6 100644 --- a/packages/provwasm-std/src/types/cosmos/circuit/module/v1.rs +++ b/packages/provwasm-std/src/types/cosmos/circuit/module/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Module is the config object of the circuit module. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/cosmos/circuit/v1.rs b/packages/provwasm-std/src/types/cosmos/circuit/v1.rs index b7350ef3..6a4614ef 100644 --- a/packages/provwasm-std/src/types/cosmos/circuit/v1.rs +++ b/packages/provwasm-std/src/types/cosmos/circuit/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Permissions are the permissions that an account has to trip /// or reset the circuit breaker. #[allow(clippy::derive_partial_eq_without_eq)] @@ -17,8 +17,8 @@ pub struct Permissions { /// level is the level of permissions granted to this account. #[prost(enumeration = "permissions::Level", tag = "1")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "permissions::Level::serialize", + deserialize_with = "permissions::Level::deserialize" )] pub level: i32, /// limit_type_urls is used with LEVEL_SOME_MSGS to limit the lists of Msg type @@ -29,11 +29,11 @@ pub struct Permissions { } /// Nested message and enum types in `Permissions`. pub mod permissions { - use provwasm_proc_macro::CosmwasmExt; + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Level is the permission level. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] - #[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] + #[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum Level { /// LEVEL_NONE_UNSPECIFIED indicates that the account will have no circuit /// breaker permissions. diff --git a/packages/provwasm-std/src/types/cosmos/consensus/module/v1.rs b/packages/provwasm-std/src/types/cosmos/consensus/module/v1.rs index 89f83540..8f11ca53 100644 --- a/packages/provwasm-std/src/types/cosmos/consensus/module/v1.rs +++ b/packages/provwasm-std/src/types/cosmos/consensus/module/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Module is the config object of the consensus module. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/cosmos/consensus/v1.rs b/packages/provwasm-std/src/types/cosmos/consensus/v1.rs index 1f582d29..e2a5aec1 100644 --- a/packages/provwasm-std/src/types/cosmos/consensus/v1.rs +++ b/packages/provwasm-std/src/types/cosmos/consensus/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// QueryParamsRequest defines the request type for querying x/consensus parameters. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/cosmos/crisis/module/v1.rs b/packages/provwasm-std/src/types/cosmos/crisis/module/v1.rs index 08140687..fbbe3290 100644 --- a/packages/provwasm-std/src/types/cosmos/crisis/module/v1.rs +++ b/packages/provwasm-std/src/types/cosmos/crisis/module/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Module is the config object of the crisis module. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/cosmos/crisis/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/crisis/v1beta1.rs index bce1f55b..1b1c8504 100644 --- a/packages/provwasm-std/src/types/cosmos/crisis/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/crisis/v1beta1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// GenesisState defines the crisis module's genesis state. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/cosmos/crypto/ed25519.rs b/packages/provwasm-std/src/types/cosmos/crypto/ed25519.rs index 92643288..704d14ff 100644 --- a/packages/provwasm-std/src/types/cosmos/crypto/ed25519.rs +++ b/packages/provwasm-std/src/types/cosmos/crypto/ed25519.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// PubKey is an ed25519 public key for handling Tendermint keys in SDK. /// It's needed for Any serialization and SDK compatibility. /// It must not be used in a non Tendermint key context because it doesn't implement diff --git a/packages/provwasm-std/src/types/cosmos/crypto/hd/v1.rs b/packages/provwasm-std/src/types/cosmos/crypto/hd/v1.rs index d3067525..169a726d 100644 --- a/packages/provwasm-std/src/types/cosmos/crypto/hd/v1.rs +++ b/packages/provwasm-std/src/types/cosmos/crypto/hd/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// BIP44Params is used as path field in ledger item in Record. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/cosmos/crypto/keyring/v1.rs b/packages/provwasm-std/src/types/cosmos/crypto/keyring/v1.rs index 0b3eed28..9f517f78 100644 --- a/packages/provwasm-std/src/types/cosmos/crypto/keyring/v1.rs +++ b/packages/provwasm-std/src/types/cosmos/crypto/keyring/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Record is used for representing a key in the keyring. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -25,7 +25,7 @@ pub struct Record { } /// Nested message and enum types in `Record`. pub mod record { - use provwasm_proc_macro::CosmwasmExt; + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Item is a keyring item stored in a keyring backend. /// Local item #[allow(clippy::derive_partial_eq_without_eq)] diff --git a/packages/provwasm-std/src/types/cosmos/crypto/multisig/mod.rs b/packages/provwasm-std/src/types/cosmos/crypto/multisig/mod.rs index 39d1a62c..dc2bdec8 100644 --- a/packages/provwasm-std/src/types/cosmos/crypto/multisig/mod.rs +++ b/packages/provwasm-std/src/types/cosmos/crypto/multisig/mod.rs @@ -1,5 +1,5 @@ pub mod v1beta1; -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// LegacyAminoPubKey specifies a public key type /// which nests multiple public keys and a threshold, /// it uses legacy amino address rules. diff --git a/packages/provwasm-std/src/types/cosmos/crypto/multisig/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/crypto/multisig/v1beta1.rs index 70626b4e..6a73ae52 100644 --- a/packages/provwasm-std/src/types/cosmos/crypto/multisig/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/crypto/multisig/v1beta1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// MultiSignature wraps the signatures from a multisig.LegacyAminoPubKey. /// See cosmos.tx.v1betata1.ModeInfo.Multi for how to specify which signers /// signed and with which modes. diff --git a/packages/provwasm-std/src/types/cosmos/crypto/secp256k1.rs b/packages/provwasm-std/src/types/cosmos/crypto/secp256k1.rs index 6f462712..aed16901 100644 --- a/packages/provwasm-std/src/types/cosmos/crypto/secp256k1.rs +++ b/packages/provwasm-std/src/types/cosmos/crypto/secp256k1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// PubKey defines a secp256k1 public key /// Key is the compressed form of the pubkey. The first byte depends is a 0x02 byte /// if the y-coordinate is the lexicographically largest of the two associated with diff --git a/packages/provwasm-std/src/types/cosmos/crypto/secp256r1.rs b/packages/provwasm-std/src/types/cosmos/crypto/secp256r1.rs index ddd5dc35..c4d76cef 100644 --- a/packages/provwasm-std/src/types/cosmos/crypto/secp256r1.rs +++ b/packages/provwasm-std/src/types/cosmos/crypto/secp256r1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// PubKey defines a secp256r1 ECDSA public key. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/cosmos/distribution/module/v1.rs b/packages/provwasm-std/src/types/cosmos/distribution/module/v1.rs index 70f1cf29..e179336a 100644 --- a/packages/provwasm-std/src/types/cosmos/distribution/module/v1.rs +++ b/packages/provwasm-std/src/types/cosmos/distribution/module/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Module is the config object of the distribution module. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/cosmos/distribution/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/distribution/v1beta1.rs index 29fdedd9..c56bfb69 100644 --- a/packages/provwasm-std/src/types/cosmos/distribution/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/distribution/v1beta1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Params defines the set of params for the distribution module. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/cosmos/evidence/module/v1.rs b/packages/provwasm-std/src/types/cosmos/evidence/module/v1.rs index 7094094a..63a4006c 100644 --- a/packages/provwasm-std/src/types/cosmos/evidence/module/v1.rs +++ b/packages/provwasm-std/src/types/cosmos/evidence/module/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Module is the config object of the evidence module. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/cosmos/evidence/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/evidence/v1beta1.rs index 3f040a3f..88e3f797 100644 --- a/packages/provwasm-std/src/types/cosmos/evidence/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/evidence/v1beta1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Equivocation implements the Evidence interface and defines evidence of double /// signing misbehavior. #[allow(clippy::derive_partial_eq_without_eq)] diff --git a/packages/provwasm-std/src/types/cosmos/feegrant/module/v1.rs b/packages/provwasm-std/src/types/cosmos/feegrant/module/v1.rs index 953a001f..0e2e39ed 100644 --- a/packages/provwasm-std/src/types/cosmos/feegrant/module/v1.rs +++ b/packages/provwasm-std/src/types/cosmos/feegrant/module/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Module is the config object of the feegrant module. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/cosmos/feegrant/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/feegrant/v1beta1.rs index e3abc771..98904b86 100644 --- a/packages/provwasm-std/src/types/cosmos/feegrant/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/feegrant/v1beta1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// 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)] diff --git a/packages/provwasm-std/src/types/cosmos/genutil/module/v1.rs b/packages/provwasm-std/src/types/cosmos/genutil/module/v1.rs index b56e936d..79f46a49 100644 --- a/packages/provwasm-std/src/types/cosmos/genutil/module/v1.rs +++ b/packages/provwasm-std/src/types/cosmos/genutil/module/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Module is the config object for the genutil module. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/cosmos/genutil/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/genutil/v1beta1.rs index c289572b..8d3712c1 100644 --- a/packages/provwasm-std/src/types/cosmos/genutil/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/genutil/v1beta1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// GenesisState defines the raw genesis transaction in JSON. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/cosmos/gov/module/v1.rs b/packages/provwasm-std/src/types/cosmos/gov/module/v1.rs index ef36cfc1..eb66e780 100644 --- a/packages/provwasm-std/src/types/cosmos/gov/module/v1.rs +++ b/packages/provwasm-std/src/types/cosmos/gov/module/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Module is the config object of the gov module. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/cosmos/gov/v1.rs b/packages/provwasm-std/src/types/cosmos/gov/v1.rs index f3a19fcf..6608e054 100644 --- a/packages/provwasm-std/src/types/cosmos/gov/v1.rs +++ b/packages/provwasm-std/src/types/cosmos/gov/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// WeightedVoteOption defines a unit of vote for vote split. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -16,8 +16,8 @@ pub struct WeightedVoteOption { /// option defines the valid vote options, it must not contain duplicate vote options. #[prost(enumeration = "VoteOption", tag = "1")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "VoteOption::serialize", + deserialize_with = "VoteOption::deserialize" )] pub option: i32, /// weight is the vote weight associated with the vote option. @@ -80,8 +80,8 @@ pub struct Proposal { /// status defines the proposal status. #[prost(enumeration = "ProposalStatus", tag = "3")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "ProposalStatus::serialize", + deserialize_with = "ProposalStatus::deserialize" )] pub status: i32, /// final_tally_result is the final tally result of the proposal. When @@ -348,7 +348,7 @@ pub struct Params { /// VoteOption enumerates the valid vote options for a given governance proposal. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum VoteOption { /// VOTE_OPTION_UNSPECIFIED defines a no-op vote option. Unspecified = 0, @@ -390,7 +390,7 @@ impl VoteOption { /// ProposalStatus enumerates the valid statuses of a proposal. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum ProposalStatus { /// PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. Unspecified = 0, @@ -597,8 +597,8 @@ pub struct QueryProposalsRequest { /// proposal_status defines the status of the proposals. #[prost(enumeration = "ProposalStatus", tag = "1")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "ProposalStatus::serialize", + deserialize_with = "ProposalStatus::deserialize" )] pub proposal_status: i32, /// voter defines the voter address for the proposals. @@ -1048,8 +1048,8 @@ pub struct MsgVote { /// option defines the vote option. #[prost(enumeration = "VoteOption", tag = "3")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "VoteOption::serialize", + deserialize_with = "VoteOption::deserialize" )] pub option: i32, /// metadata is any arbitrary metadata attached to the Vote. diff --git a/packages/provwasm-std/src/types/cosmos/gov/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/gov/v1beta1.rs index 3200b0fe..2bbe9b02 100644 --- a/packages/provwasm-std/src/types/cosmos/gov/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/gov/v1beta1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// WeightedVoteOption defines a unit of vote for vote split. /// /// Since: cosmos-sdk 0.43 @@ -18,8 +18,8 @@ pub struct WeightedVoteOption { /// option defines the valid vote options, it must not contain duplicate vote options. #[prost(enumeration = "VoteOption", tag = "1")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "VoteOption::serialize", + deserialize_with = "VoteOption::deserialize" )] pub option: i32, /// weight is the vote weight associated with the vote option. @@ -104,8 +104,8 @@ pub struct Proposal { /// status defines the proposal status. #[prost(enumeration = "ProposalStatus", tag = "3")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "ProposalStatus::serialize", + deserialize_with = "ProposalStatus::deserialize" )] pub status: i32, /// final_tally_result is the final tally result of the proposal. When @@ -187,8 +187,8 @@ pub struct Vote { #[deprecated] #[prost(enumeration = "VoteOption", tag = "3")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "VoteOption::serialize", + deserialize_with = "VoteOption::deserialize" )] pub option: i32, /// options is the weighted vote options. @@ -278,7 +278,7 @@ pub struct TallyParams { /// VoteOption enumerates the valid vote options for a given governance proposal. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum VoteOption { /// VOTE_OPTION_UNSPECIFIED defines a no-op vote option. Unspecified = 0, @@ -320,7 +320,7 @@ impl VoteOption { /// ProposalStatus enumerates the valid statuses of a proposal. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum ProposalStatus { /// PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. Unspecified = 0, @@ -472,8 +472,8 @@ pub struct QueryProposalsRequest { /// proposal_status defines the status of the proposals. #[prost(enumeration = "ProposalStatus", tag = "1")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "ProposalStatus::serialize", + deserialize_with = "ProposalStatus::deserialize" )] pub proposal_status: i32, /// voter defines the voter address for the proposals. @@ -867,8 +867,8 @@ pub struct MsgVote { /// option defines the vote option. #[prost(enumeration = "VoteOption", tag = "3")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "VoteOption::serialize", + deserialize_with = "VoteOption::deserialize" )] pub option: i32, } diff --git a/packages/provwasm-std/src/types/cosmos/group/module/v1.rs b/packages/provwasm-std/src/types/cosmos/group/module/v1.rs index 2a9168c5..684d9ecf 100644 --- a/packages/provwasm-std/src/types/cosmos/group/module/v1.rs +++ b/packages/provwasm-std/src/types/cosmos/group/module/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Module is the config object of the group module. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/cosmos/group/v1.rs b/packages/provwasm-std/src/types/cosmos/group/v1.rs index 87ff48a8..b3db1b91 100644 --- a/packages/provwasm-std/src/types/cosmos/group/v1.rs +++ b/packages/provwasm-std/src/types/cosmos/group/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Member represents a group member with an account address, /// non-zero weight, metadata and added_at timestamp. #[allow(clippy::derive_partial_eq_without_eq)] @@ -315,8 +315,8 @@ pub struct Proposal { /// status represents the high level position in the life cycle of the proposal. Initial value is Submitted. #[prost(enumeration = "ProposalStatus", tag = "8")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "ProposalStatus::serialize", + deserialize_with = "ProposalStatus::deserialize" )] pub status: i32, /// final_tally_result contains the sums of all weighted votes for this @@ -335,8 +335,8 @@ pub struct Proposal { /// executor_result is the final result of the proposal execution. Initial value is NotRun. #[prost(enumeration = "ProposalExecutorResult", tag = "11")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "ProposalExecutorResult::serialize", + deserialize_with = "ProposalExecutorResult::deserialize" )] pub executor_result: i32, /// messages is a list of `sdk.Msg`s that will be executed if the proposal passes. @@ -407,8 +407,8 @@ pub struct Vote { /// option is the voter's choice on the proposal. #[prost(enumeration = "VoteOption", tag = "3")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "VoteOption::serialize", + deserialize_with = "VoteOption::deserialize" )] pub option: i32, /// metadata is any arbitrary metadata attached to the vote. @@ -422,7 +422,7 @@ pub struct Vote { /// VoteOption enumerates the valid vote options for a given proposal. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum VoteOption { /// VOTE_OPTION_UNSPECIFIED defines an unspecified vote option which will /// return an error. @@ -465,7 +465,7 @@ impl VoteOption { /// ProposalStatus defines proposal statuses. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum ProposalStatus { /// An empty value is invalid and not allowed. Unspecified = 0, @@ -515,7 +515,7 @@ impl ProposalStatus { /// ProposalExecutorResult defines types of proposal executor results. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum ProposalExecutorResult { /// An empty value is not allowed. Unspecified = 0, @@ -720,8 +720,8 @@ pub struct EventExec { /// result is the proposal execution result. #[prost(enumeration = "ProposalExecutorResult", tag = "2")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "ProposalExecutorResult::serialize", + deserialize_with = "ProposalExecutorResult::deserialize" )] pub result: i32, /// logs contains error logs in case the execution result is FAILURE. @@ -777,8 +777,8 @@ pub struct EventProposalPruned { /// status is the proposal status (UNSPECIFIED, SUBMITTED, ACCEPTED, REJECTED, ABORTED, WITHDRAWN). #[prost(enumeration = "ProposalStatus", tag = "2")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "ProposalStatus::serialize", + deserialize_with = "ProposalStatus::deserialize" )] pub status: i32, /// tally_result is the proposal tally result (when applicable). @@ -1912,8 +1912,8 @@ pub struct MsgSubmitProposal { /// If so, proposers signatures are considered as Yes votes. #[prost(enumeration = "Exec", tag = "5")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "Exec::serialize", + deserialize_with = "Exec::deserialize" )] pub exec: i32, /// title is the title of the proposal. @@ -2015,8 +2015,8 @@ pub struct MsgVote { /// option is the voter's choice on the proposal. #[prost(enumeration = "VoteOption", tag = "3")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "VoteOption::serialize", + deserialize_with = "VoteOption::deserialize" )] pub option: i32, /// metadata is any arbitrary metadata attached to the vote. @@ -2026,8 +2026,8 @@ pub struct MsgVote { /// immediately after voting or not. #[prost(enumeration = "Exec", tag = "5")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "Exec::serialize", + deserialize_with = "Exec::deserialize" )] pub exec: i32, } @@ -2087,8 +2087,8 @@ pub struct MsgExecResponse { /// result is the final result of the proposal execution. #[prost(enumeration = "ProposalExecutorResult", tag = "2")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "ProposalExecutorResult::serialize", + deserialize_with = "ProposalExecutorResult::deserialize" )] pub result: i32, } @@ -2134,7 +2134,7 @@ pub struct MsgLeaveGroupResponse {} /// Exec defines modes of execution of a proposal on creation or on new vote. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum Exec { /// An empty value means that there should be a separate /// MsgExec request for the proposal to execute. diff --git a/packages/provwasm-std/src/types/cosmos/ics23/v1.rs b/packages/provwasm-std/src/types/cosmos/ics23/v1.rs index 78660406..008822f5 100644 --- a/packages/provwasm-std/src/types/cosmos/ics23/v1.rs +++ b/packages/provwasm-std/src/types/cosmos/ics23/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// * /// ExistenceProof takes a key and a value and a set of steps to perform on it. /// The result of peforming all these steps will provide a "root hash", which can @@ -98,7 +98,7 @@ pub struct CommitmentProof { } /// Nested message and enum types in `CommitmentProof`. pub mod commitment_proof { - use provwasm_proc_macro::CosmwasmExt; + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -150,26 +150,26 @@ pub mod commitment_proof { pub struct LeafOp { #[prost(enumeration = "HashOp", tag = "1")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "HashOp::serialize", + deserialize_with = "HashOp::deserialize" )] pub hash: i32, #[prost(enumeration = "HashOp", tag = "2")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "HashOp::serialize", + deserialize_with = "HashOp::deserialize" )] pub prehash_key: i32, #[prost(enumeration = "HashOp", tag = "3")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "HashOp::serialize", + deserialize_with = "HashOp::deserialize" )] pub prehash_value: i32, #[prost(enumeration = "LengthOp", tag = "4")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "LengthOp::serialize", + deserialize_with = "LengthOp::deserialize" )] pub length: i32, /// prefix is a fixed bytes that may optionally be included at the beginning to differentiate @@ -212,8 +212,8 @@ pub struct LeafOp { pub struct InnerOp { #[prost(enumeration = "HashOp", tag = "1")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "HashOp::serialize", + deserialize_with = "HashOp::deserialize" )] pub hash: i32, #[prost(bytes = "vec", tag = "2")] @@ -305,10 +305,6 @@ pub struct InnerSpec { /// iavl tree is \[0, 1\] (left then right) /// merk is \[0, 2, 1\] (left, right, here) #[prost(int32, repeated, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str_vec::serialize", - deserialize_with = "crate::serde::as_str_vec::deserialize" - )] pub child_order: ::prost::alloc::vec::Vec, #[prost(int32, tag = "2")] #[serde( @@ -338,8 +334,8 @@ pub struct InnerSpec { /// hash is the algorithm that must be used for each InnerOp #[prost(enumeration = "HashOp", tag = "6")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "HashOp::serialize", + deserialize_with = "HashOp::deserialize" )] pub hash: i32, } @@ -380,7 +376,7 @@ pub struct BatchEntry { } /// Nested message and enum types in `BatchEntry`. pub mod batch_entry { - use provwasm_proc_macro::CosmwasmExt; + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -435,7 +431,7 @@ pub struct CompressedBatchEntry { } /// Nested message and enum types in `CompressedBatchEntry`. pub mod compressed_batch_entry { - use provwasm_proc_macro::CosmwasmExt; + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -482,10 +478,6 @@ pub struct CompressedExistenceProof { pub leaf: ::core::option::Option, /// these are indexes into the lookup_inners table in CompressedBatchProof #[prost(int32, repeated, tag = "4")] - #[serde( - serialize_with = "crate::serde::as_str_vec::serialize", - deserialize_with = "crate::serde::as_str_vec::deserialize" - )] pub path: ::prost::alloc::vec::Vec, } #[allow(clippy::derive_partial_eq_without_eq)] @@ -515,7 +507,7 @@ pub struct CompressedNonExistenceProof { } #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum HashOp { /// NO_HASH is the default if no data passed. Note this is an illegal argument some places. NoHash = 0, @@ -564,7 +556,7 @@ impl HashOp { /// (Each one with it's own encoded length) #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum LengthOp { /// NO_PREFIX don't include any length info NoPrefix = 0, diff --git a/packages/provwasm-std/src/types/cosmos/mint/module/v1.rs b/packages/provwasm-std/src/types/cosmos/mint/module/v1.rs index 5abf4a93..7c6ab88e 100644 --- a/packages/provwasm-std/src/types/cosmos/mint/module/v1.rs +++ b/packages/provwasm-std/src/types/cosmos/mint/module/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Module is the config object of the mint module. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/cosmos/mint/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/mint/v1beta1.rs index 2285712d..3ad6ca1a 100644 --- a/packages/provwasm-std/src/types/cosmos/mint/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/mint/v1beta1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Minter represents the minting state. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/cosmos/msg/textual/v1.rs b/packages/provwasm-std/src/types/cosmos/msg/textual/v1.rs index 97897b43..9b108c8e 100644 --- a/packages/provwasm-std/src/types/cosmos/msg/textual/v1.rs +++ b/packages/provwasm-std/src/types/cosmos/msg/textual/v1.rs @@ -1 +1 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; diff --git a/packages/provwasm-std/src/types/cosmos/msg/v1.rs b/packages/provwasm-std/src/types/cosmos/msg/v1.rs index 97897b43..9b108c8e 100644 --- a/packages/provwasm-std/src/types/cosmos/msg/v1.rs +++ b/packages/provwasm-std/src/types/cosmos/msg/v1.rs @@ -1 +1 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; diff --git a/packages/provwasm-std/src/types/cosmos/nft/module/v1.rs b/packages/provwasm-std/src/types/cosmos/nft/module/v1.rs index 90f85556..7466efbb 100644 --- a/packages/provwasm-std/src/types/cosmos/nft/module/v1.rs +++ b/packages/provwasm-std/src/types/cosmos/nft/module/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Module is the config object of the nft module. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/cosmos/nft/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/nft/v1beta1.rs index 72948707..92fba6fc 100644 --- a/packages/provwasm-std/src/types/cosmos/nft/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/nft/v1beta1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// EventSend is emitted on Msg/Send #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/cosmos/orm/module/v1alpha1.rs b/packages/provwasm-std/src/types/cosmos/orm/module/v1alpha1.rs index a9a0bb59..ae1942b0 100644 --- a/packages/provwasm-std/src/types/cosmos/orm/module/v1alpha1.rs +++ b/packages/provwasm-std/src/types/cosmos/orm/module/v1alpha1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Module defines the ORM module which adds providers to the app container for /// ORM ModuleDB's and in the future will automatically register query /// services for modules that use the ORM. diff --git a/packages/provwasm-std/src/types/cosmos/orm/query/v1alpha1.rs b/packages/provwasm-std/src/types/cosmos/orm/query/v1alpha1.rs index 0780f073..42b803b1 100644 --- a/packages/provwasm-std/src/types/cosmos/orm/query/v1alpha1.rs +++ b/packages/provwasm-std/src/types/cosmos/orm/query/v1alpha1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// GetRequest is the Query/Get request type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -86,7 +86,7 @@ pub struct ListRequest { } /// Nested message and enum types in `ListRequest`. pub mod list_request { - use provwasm_proc_macro::CosmwasmExt; + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Prefix specifies the arguments to a prefix query. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -195,7 +195,7 @@ pub struct IndexValue { } /// Nested message and enum types in `IndexValue`. pub mod index_value { - use provwasm_proc_macro::CosmwasmExt; + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// value specifies the index value #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/cosmos/orm/v1.rs b/packages/provwasm-std/src/types/cosmos/orm/v1.rs index 27fba007..f6282c24 100644 --- a/packages/provwasm-std/src/types/cosmos/orm/v1.rs +++ b/packages/provwasm-std/src/types/cosmos/orm/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// TableDescriptor describes an ORM table. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/cosmos/orm/v1alpha1.rs b/packages/provwasm-std/src/types/cosmos/orm/v1alpha1.rs index 7e9ed712..771f24d6 100644 --- a/packages/provwasm-std/src/types/cosmos/orm/v1alpha1.rs +++ b/packages/provwasm-std/src/types/cosmos/orm/v1alpha1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// ModuleSchemaDescriptor describe's a module's ORM schema. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -26,7 +26,7 @@ pub struct ModuleSchemaDescriptor { } /// Nested message and enum types in `ModuleSchemaDescriptor`. pub mod module_schema_descriptor { - use provwasm_proc_macro::CosmwasmExt; + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// FileEntry describes an ORM file used in a module. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -59,8 +59,8 @@ pub mod module_schema_descriptor { /// of the app will be used. #[prost(enumeration = "super::StorageType", tag = "3")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "super::StorageType::serialize", + deserialize_with = "super::StorageType::deserialize" )] pub storage_type: i32, } @@ -68,7 +68,7 @@ pub mod module_schema_descriptor { /// StorageType #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum StorageType { /// STORAGE_TYPE_DEFAULT_UNSPECIFIED indicates the persistent storage where all /// data is stored in the regular Merkle-tree backed KV-store. diff --git a/packages/provwasm-std/src/types/cosmos/params/module/v1.rs b/packages/provwasm-std/src/types/cosmos/params/module/v1.rs index a304e1e7..755b3601 100644 --- a/packages/provwasm-std/src/types/cosmos/params/module/v1.rs +++ b/packages/provwasm-std/src/types/cosmos/params/module/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Module is the config object of the params module. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/cosmos/params/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/params/v1beta1.rs index f1c27c00..36690bc1 100644 --- a/packages/provwasm-std/src/types/cosmos/params/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/params/v1beta1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// ParameterChangeProposal defines a proposal to change one or more parameters. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/cosmos/quarantine/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/quarantine/v1beta1.rs index 9d5b02f0..bf22c7b1 100644 --- a/packages/provwasm-std/src/types/cosmos/quarantine/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/quarantine/v1beta1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// EventOptIn is an event emitted when an address opts into quarantine. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -121,8 +121,8 @@ pub struct AutoResponseEntry { /// response is the auto-response setting for these two addresses. #[prost(enumeration = "AutoResponse", tag = "3")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "AutoResponse::serialize", + deserialize_with = "AutoResponse::deserialize" )] pub response: i32, } @@ -147,8 +147,8 @@ pub struct AutoResponseUpdate { /// Provide AUTO_RESPONSE_UNSPECIFIED to turn off an auto-response. #[prost(enumeration = "AutoResponse", tag = "2")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "AutoResponse::serialize", + deserialize_with = "AutoResponse::deserialize" )] pub response: i32, } @@ -199,7 +199,7 @@ pub struct QuarantineRecordSuffixIndex { /// AutoResponse enumerates the quarantine auto-response options. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum AutoResponse { /// AUTO_RESPONSE_UNSPECIFIED defines that an automatic response has not been specified. /// This means that no automatic action should be taken, i.e. this auto-response is off, diff --git a/packages/provwasm-std/src/types/cosmos/query/v1.rs b/packages/provwasm-std/src/types/cosmos/query/v1.rs index 97897b43..9b108c8e 100644 --- a/packages/provwasm-std/src/types/cosmos/query/v1.rs +++ b/packages/provwasm-std/src/types/cosmos/query/v1.rs @@ -1 +1 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; diff --git a/packages/provwasm-std/src/types/cosmos/sanction/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/sanction/v1beta1.rs index 3ff6bf02..fecef186 100644 --- a/packages/provwasm-std/src/types/cosmos/sanction/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/sanction/v1beta1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// EventAddressSanctioned is an event emitted when an address is sanctioned. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -136,15 +136,15 @@ pub struct TemporaryEntry { /// status is whether the entry is a sanction or unsanction. #[prost(enumeration = "TempStatus", tag = "3")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "TempStatus::serialize", + deserialize_with = "TempStatus::deserialize" )] pub status: i32, } /// TempStatus is whether a temporary entry is a sanction or unsanction. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum TempStatus { /// TEMP_STATUS_UNSPECIFIED represents and unspecified status value. Unspecified = 0, diff --git a/packages/provwasm-std/src/types/cosmos/slashing/module/v1.rs b/packages/provwasm-std/src/types/cosmos/slashing/module/v1.rs index ea89c163..30607605 100644 --- a/packages/provwasm-std/src/types/cosmos/slashing/module/v1.rs +++ b/packages/provwasm-std/src/types/cosmos/slashing/module/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Module is the config object of the slashing module. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/cosmos/slashing/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/slashing/v1beta1.rs index ca9553f3..b191bc46 100644 --- a/packages/provwasm-std/src/types/cosmos/slashing/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/slashing/v1beta1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// ValidatorSigningInfo defines a validator's signing info for monitoring their /// liveness activity. #[allow(clippy::derive_partial_eq_without_eq)] diff --git a/packages/provwasm-std/src/types/cosmos/staking/module/v1.rs b/packages/provwasm-std/src/types/cosmos/staking/module/v1.rs index f3f26619..fb352590 100644 --- a/packages/provwasm-std/src/types/cosmos/staking/module/v1.rs +++ b/packages/provwasm-std/src/types/cosmos/staking/module/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Module is the config object of the staking module. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/cosmos/staking/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/staking/v1beta1.rs index cd562435..f2ceef4b 100644 --- a/packages/provwasm-std/src/types/cosmos/staking/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/staking/v1beta1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// StakeAuthorization defines authorization for delegate/undelegate/redelegate. /// /// Since: cosmos-sdk 0.43 @@ -22,8 +22,8 @@ pub struct StakeAuthorization { /// authorization_type defines one of AuthorizationType. #[prost(enumeration = "AuthorizationType", tag = "4")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "AuthorizationType::serialize", + deserialize_with = "AuthorizationType::deserialize" )] pub authorization_type: i32, /// validators is the oneof that represents either allow_list or deny_list @@ -32,7 +32,7 @@ pub struct StakeAuthorization { } /// Nested message and enum types in `StakeAuthorization`. pub mod stake_authorization { - use provwasm_proc_macro::CosmwasmExt; + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Validators defines list of validator addresses. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -76,7 +76,7 @@ pub mod stake_authorization { /// Since: cosmos-sdk 0.43 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum AuthorizationType { /// AUTHORIZATION_TYPE_UNSPECIFIED specifies an unknown authorization type Unspecified = 0, @@ -250,8 +250,8 @@ pub struct Validator { /// status is the validator status (bonded/unbonding/unbonded). #[prost(enumeration = "BondStatus", tag = "4")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "BondStatus::serialize", + deserialize_with = "BondStatus::deserialize" )] pub status: i32, /// tokens define the delegated tokens (incl. self-delegation). @@ -713,7 +713,7 @@ pub struct ValidatorUpdates { /// BondStatus is the status of a validator. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum BondStatus { /// UNSPECIFIED defines an invalid validator status. Unspecified = 0, @@ -751,7 +751,7 @@ impl BondStatus { /// Infraction indicates the infraction a validator commited. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum Infraction { /// UNSPECIFIED defines an empty infraction. Unspecified = 0, diff --git a/packages/provwasm-std/src/types/cosmos/store/internal/kv/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/store/internal/kv/v1beta1.rs index 1e91fd09..0d4c20e2 100644 --- a/packages/provwasm-std/src/types/cosmos/store/internal/kv/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/store/internal/kv/v1beta1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Pairs defines a repeated slice of Pair objects. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/cosmos/store/snapshots/v1.rs b/packages/provwasm-std/src/types/cosmos/store/snapshots/v1.rs index db6d4f64..88e71408 100644 --- a/packages/provwasm-std/src/types/cosmos/store/snapshots/v1.rs +++ b/packages/provwasm-std/src/types/cosmos/store/snapshots/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Snapshot contains Tendermint state sync snapshot info. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -80,7 +80,7 @@ pub struct SnapshotItem { } /// Nested message and enum types in `SnapshotItem`. pub mod snapshot_item { - use provwasm_proc_macro::CosmwasmExt; + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// item is the specific type of snapshot item. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/cosmos/store/streaming/abci.rs b/packages/provwasm-std/src/types/cosmos/store/streaming/abci.rs index 650dbc40..bb89c387 100644 --- a/packages/provwasm-std/src/types/cosmos/store/streaming/abci.rs +++ b/packages/provwasm-std/src/types/cosmos/store/streaming/abci.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// ListenEndBlockRequest is the request type for the ListenEndBlock RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/cosmos/store/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/store/v1beta1.rs index 98fe6e14..c014842b 100644 --- a/packages/provwasm-std/src/types/cosmos/store/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/store/v1beta1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// StoreKVPair is a KVStore KVPair used for listening to state changes (Sets and Deletes) /// It optionally includes the StoreKey for the originating KVStore and a Boolean flag to distinguish between Sets and /// Deletes diff --git a/packages/provwasm-std/src/types/cosmos/tx/config/v1.rs b/packages/provwasm-std/src/types/cosmos/tx/config/v1.rs index 71c0e497..3c3099c7 100644 --- a/packages/provwasm-std/src/types/cosmos/tx/config/v1.rs +++ b/packages/provwasm-std/src/types/cosmos/tx/config/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Config is the config object of the x/auth/tx package. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/cosmos/tx/signing/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/tx/signing/v1beta1.rs index c4bbac2c..c8c0b48f 100644 --- a/packages/provwasm-std/src/types/cosmos/tx/signing/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/tx/signing/v1beta1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// SignatureDescriptors wraps multiple SignatureDescriptor's. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -51,7 +51,7 @@ pub struct SignatureDescriptor { } /// Nested message and enum types in `SignatureDescriptor`. pub mod signature_descriptor { - use provwasm_proc_macro::CosmwasmExt; + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Data represents signature data #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -72,7 +72,7 @@ pub mod signature_descriptor { } /// Nested message and enum types in `Data`. pub mod data { - use provwasm_proc_macro::CosmwasmExt; + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Single is the signature data for a single signer #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -90,8 +90,8 @@ pub mod signature_descriptor { /// mode is the signing mode of the single signer #[prost(enumeration = "super::super::SignMode", tag = "1")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "super::super::SignMode::serialize", + deserialize_with = "super::super::SignMode::deserialize" )] pub mode: i32, /// signature is the raw signature bytes @@ -156,7 +156,7 @@ pub mod signature_descriptor { /// apps have a consistent version of this enum. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum SignMode { /// SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be /// rejected. diff --git a/packages/provwasm-std/src/types/cosmos/tx/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/tx/v1beta1.rs index f65762cc..a47f1893 100644 --- a/packages/provwasm-std/src/types/cosmos/tx/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/tx/v1beta1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Tx is the standard type used for broadcasting transactions. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -300,7 +300,7 @@ pub struct ModeInfo { } /// Nested message and enum types in `ModeInfo`. pub mod mode_info { - use provwasm_proc_macro::CosmwasmExt; + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Single is the mode info for a single signer. It is structured as a message /// to allow for additional fields such as locale for SIGN_MODE_TEXTUAL in the /// future @@ -320,8 +320,8 @@ pub mod mode_info { /// mode is the signing mode of the single signer #[prost(enumeration = "super::super::signing::v1beta1::SignMode", tag = "1")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "super::super::signing::v1beta1::SignMode::serialize", + deserialize_with = "super::super::signing::v1beta1::SignMode::deserialize" )] pub mode: i32, } @@ -463,8 +463,8 @@ pub struct AuxSignerData { /// mode is the signing mode of the single signer. #[prost(enumeration = "super::signing::v1beta1::SignMode", tag = "3")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "super::signing::v1beta1::SignMode::serialize", + deserialize_with = "super::signing::v1beta1::SignMode::deserialize" )] pub mode: i32, /// sig is the signature of the sign doc. @@ -503,8 +503,8 @@ pub struct GetTxsEventRequest { pub pagination: ::core::option::Option, #[prost(enumeration = "OrderBy", tag = "3")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "OrderBy::serialize", + deserialize_with = "OrderBy::deserialize" )] pub order_by: i32, /// page is the page number to query, starts at 1. If not provided, will @@ -588,8 +588,8 @@ pub struct BroadcastTxRequest { pub tx_bytes: ::prost::alloc::vec::Vec, #[prost(enumeration = "BroadcastMode", tag = "2")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "BroadcastMode::serialize", + deserialize_with = "BroadcastMode::deserialize" )] pub mode: i32, } @@ -943,7 +943,7 @@ pub struct TxDecodeAminoResponse { /// OrderBy defines the sorting order #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum OrderBy { /// ORDER_BY_UNSPECIFIED specifies an unknown sorting order. OrderBy defaults /// to ASC in this case. @@ -979,7 +979,7 @@ impl OrderBy { /// method. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum BroadcastMode { /// zero-value for mode ordering Unspecified = 0, diff --git a/packages/provwasm-std/src/types/cosmos/upgrade/module/v1.rs b/packages/provwasm-std/src/types/cosmos/upgrade/module/v1.rs index 32d49c9f..952929ee 100644 --- a/packages/provwasm-std/src/types/cosmos/upgrade/module/v1.rs +++ b/packages/provwasm-std/src/types/cosmos/upgrade/module/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Module is the config object of the upgrade module. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/cosmos/upgrade/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/upgrade/v1beta1.rs index 501c3b78..1c1c149a 100644 --- a/packages/provwasm-std/src/types/cosmos/upgrade/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/upgrade/v1beta1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Plan specifies information about a planned upgrade and when it should occur. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/cosmos/vesting/module/v1.rs b/packages/provwasm-std/src/types/cosmos/vesting/module/v1.rs index 5f7f504e..d478608d 100644 --- a/packages/provwasm-std/src/types/cosmos/vesting/module/v1.rs +++ b/packages/provwasm-std/src/types/cosmos/vesting/module/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Module is the config object of the vesting module. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/cosmos/vesting/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/vesting/v1beta1.rs index f17aac4e..ef4199b3 100644 --- a/packages/provwasm-std/src/types/cosmos/vesting/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/vesting/v1beta1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// BaseVestingAccount implements the VestingAccount interface. It contains all /// the necessary fields needed for any vesting account implementation. #[allow(clippy::derive_partial_eq_without_eq)] diff --git a/packages/provwasm-std/src/types/cosmwasm/wasm/v1.rs b/packages/provwasm-std/src/types/cosmwasm/wasm/v1.rs index 0ec6f18d..a17725c0 100644 --- a/packages/provwasm-std/src/types/cosmwasm/wasm/v1.rs +++ b/packages/provwasm-std/src/types/cosmwasm/wasm/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// AccessTypeParam #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -15,8 +15,8 @@ use provwasm_proc_macro::CosmwasmExt; pub struct AccessTypeParam { #[prost(enumeration = "AccessType", tag = "1")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "AccessType::serialize", + deserialize_with = "AccessType::deserialize" )] pub value: i32, } @@ -36,8 +36,8 @@ pub struct AccessTypeParam { pub struct AccessConfig { #[prost(enumeration = "AccessType", tag = "1")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "AccessType::serialize", + deserialize_with = "AccessType::deserialize" )] pub permission: i32, #[prost(string, repeated, tag = "3")] @@ -61,8 +61,8 @@ pub struct Params { pub code_upload_access: ::core::option::Option, #[prost(enumeration = "AccessType", tag = "2")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "AccessType::serialize", + deserialize_with = "AccessType::deserialize" )] pub instantiate_default_permission: i32, } @@ -150,8 +150,8 @@ pub struct ContractInfo { pub struct ContractCodeHistoryEntry { #[prost(enumeration = "ContractCodeHistoryOperationType", tag = "1")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "ContractCodeHistoryOperationType::serialize", + deserialize_with = "ContractCodeHistoryOperationType::deserialize" )] pub operation: i32, /// CodeID is the reference to the stored WASM code @@ -234,7 +234,7 @@ pub struct Model { /// AccessType permission types #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum AccessType { /// AccessTypeUnspecified placeholder for empty value Unspecified = 0, @@ -272,7 +272,7 @@ impl AccessType { /// ContractCodeHistoryOperationType actions that caused a code change #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum ContractCodeHistoryOperationType { /// ContractCodeHistoryOperationTypeUnspecified placeholder for empty value Unspecified = 0, diff --git a/packages/provwasm-std/src/types/cosmwasm/wasm/v1beta1.rs b/packages/provwasm-std/src/types/cosmwasm/wasm/v1beta1.rs index c2b84b9d..32361a96 100644 --- a/packages/provwasm-std/src/types/cosmwasm/wasm/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmwasm/wasm/v1beta1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// AccessTypeParam #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -15,8 +15,8 @@ use provwasm_proc_macro::CosmwasmExt; pub struct AccessTypeParam { #[prost(enumeration = "AccessType", tag = "1")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "AccessType::serialize", + deserialize_with = "AccessType::deserialize" )] pub value: i32, } @@ -36,8 +36,8 @@ pub struct AccessTypeParam { pub struct AccessConfig { #[prost(enumeration = "AccessType", tag = "1")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "AccessType::serialize", + deserialize_with = "AccessType::deserialize" )] pub permission: i32, #[prost(string, tag = "2")] @@ -61,8 +61,8 @@ pub struct Params { pub code_upload_access: ::core::option::Option, #[prost(enumeration = "AccessType", tag = "2")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "AccessType::serialize", + deserialize_with = "AccessType::deserialize" )] pub instantiate_default_permission: i32, #[prost(uint64, tag = "3")] @@ -165,8 +165,8 @@ pub struct ContractInfo { pub struct ContractCodeHistoryEntry { #[prost(enumeration = "ContractCodeHistoryOperationType", tag = "1")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "ContractCodeHistoryOperationType::serialize", + deserialize_with = "ContractCodeHistoryOperationType::deserialize" )] pub operation: i32, /// CodeID is the reference to the stored WASM code @@ -249,7 +249,7 @@ pub struct Model { /// AccessType permission types #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum AccessType { /// AccessTypeUnspecified placeholder for empty value Unspecified = 0, @@ -287,7 +287,7 @@ impl AccessType { /// ContractCodeHistoryOperationType actions that caused a code change #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum ContractCodeHistoryOperationType { /// ContractCodeHistoryOperationTypeUnspecified placeholder for empty value Unspecified = 0, @@ -664,7 +664,7 @@ pub struct GenesisState { } /// Nested message and enum types in `GenesisState`. pub mod genesis_state { - use provwasm_proc_macro::CosmwasmExt; + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// GenMsgs define the messages that can be executed during genesis phase in /// order. The intention is to have more human readable data that is auditable. #[allow(clippy::derive_partial_eq_without_eq)] @@ -686,7 +686,7 @@ pub mod genesis_state { } /// Nested message and enum types in `GenMsgs`. pub mod gen_msgs { - use provwasm_proc_macro::CosmwasmExt; + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// sum is a single message #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/ibc/applications/fee/v1.rs b/packages/provwasm-std/src/types/ibc/applications/fee/v1.rs index 18efb4ac..1fbb26b5 100644 --- a/packages/provwasm-std/src/types/ibc/applications/fee/v1.rs +++ b/packages/provwasm-std/src/types/ibc/applications/fee/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// IncentivizedAcknowledgement is the acknowledgement format to be used by applications wrapped in the fee middleware #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/ibc/applications/interchain_accounts/controller/v1.rs b/packages/provwasm-std/src/types/ibc/applications/interchain_accounts/controller/v1.rs index 9c27c056..3a7d4c8c 100644 --- a/packages/provwasm-std/src/types/ibc/applications/interchain_accounts/controller/v1.rs +++ b/packages/provwasm-std/src/types/ibc/applications/interchain_accounts/controller/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Params defines the set of on-chain interchain accounts parameters. /// The following parameters may be used to disable the controller submodule. #[allow(clippy::derive_partial_eq_without_eq)] @@ -129,8 +129,8 @@ pub struct MsgRegisterInterchainAccount { tag = "4" )] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "super::super::super::super::core::channel::v1::Order::serialize", + deserialize_with = "super::super::super::super::core::channel::v1::Order::deserialize" )] pub ordering: i32, } diff --git a/packages/provwasm-std/src/types/ibc/applications/interchain_accounts/genesis/v1.rs b/packages/provwasm-std/src/types/ibc/applications/interchain_accounts/genesis/v1.rs index be3d671b..9e3babf2 100644 --- a/packages/provwasm-std/src/types/ibc/applications/interchain_accounts/genesis/v1.rs +++ b/packages/provwasm-std/src/types/ibc/applications/interchain_accounts/genesis/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// GenesisState defines the interchain accounts genesis state #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/ibc/applications/interchain_accounts/host/v1.rs b/packages/provwasm-std/src/types/ibc/applications/interchain_accounts/host/v1.rs index 34cc978e..505dbe45 100644 --- a/packages/provwasm-std/src/types/ibc/applications/interchain_accounts/host/v1.rs +++ b/packages/provwasm-std/src/types/ibc/applications/interchain_accounts/host/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Params defines the set of on-chain interchain accounts parameters. /// The following parameters may be used to disable the host submodule. #[allow(clippy::derive_partial_eq_without_eq)] diff --git a/packages/provwasm-std/src/types/ibc/applications/interchain_accounts/v1.rs b/packages/provwasm-std/src/types/ibc/applications/interchain_accounts/v1.rs index a78f2de2..581e59c7 100644 --- a/packages/provwasm-std/src/types/ibc/applications/interchain_accounts/v1.rs +++ b/packages/provwasm-std/src/types/ibc/applications/interchain_accounts/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// InterchainAccountPacketData is comprised of a raw transaction, type of transaction and optional memo field. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -15,8 +15,8 @@ use provwasm_proc_macro::CosmwasmExt; pub struct InterchainAccountPacketData { #[prost(enumeration = "Type", tag = "1")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "Type::serialize", + deserialize_with = "Type::deserialize" )] pub r#type: i32, #[prost(bytes = "vec", tag = "2")] @@ -49,7 +49,7 @@ pub struct CosmosTx { /// host #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum Type { /// Default zero value enumeration Unspecified = 0, diff --git a/packages/provwasm-std/src/types/ibc/applications/transfer/v1.rs b/packages/provwasm-std/src/types/ibc/applications/transfer/v1.rs index 19f94115..30403ae4 100644 --- a/packages/provwasm-std/src/types/ibc/applications/transfer/v1.rs +++ b/packages/provwasm-std/src/types/ibc/applications/transfer/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Allocation defines the spend limit for a particular port and channel #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/ibc/applications/transfer/v2.rs b/packages/provwasm-std/src/types/ibc/applications/transfer/v2.rs index 622cd1ac..caa6591d 100644 --- a/packages/provwasm-std/src/types/ibc/applications/transfer/v2.rs +++ b/packages/provwasm-std/src/types/ibc/applications/transfer/v2.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// FungibleTokenPacketData defines a struct for the packet payload /// See FungibleTokenPacketData spec: /// diff --git a/packages/provwasm-std/src/types/ibc/core/channel/v1.rs b/packages/provwasm-std/src/types/ibc/core/channel/v1.rs index c66e8447..23b21a0e 100644 --- a/packages/provwasm-std/src/types/ibc/core/channel/v1.rs +++ b/packages/provwasm-std/src/types/ibc/core/channel/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Channel defines pipeline for exactly-once packet delivery between specific /// modules on separate blockchains, which has at least one end capable of /// sending packets and one end capable of receiving packets. @@ -18,15 +18,15 @@ pub struct Channel { /// current state of the channel end #[prost(enumeration = "State", tag = "1")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "State::serialize", + deserialize_with = "State::deserialize" )] pub state: i32, /// whether the channel is ordered or unordered #[prost(enumeration = "Order", tag = "2")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "Order::serialize", + deserialize_with = "Order::deserialize" )] pub ordering: i32, /// counterparty channel end @@ -66,15 +66,15 @@ pub struct IdentifiedChannel { /// current state of the channel end #[prost(enumeration = "State", tag = "1")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "State::serialize", + deserialize_with = "State::deserialize" )] pub state: i32, /// whether the channel is ordered or unordered #[prost(enumeration = "Order", tag = "2")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "Order::serialize", + deserialize_with = "Order::deserialize" )] pub ordering: i32, /// counterparty channel end @@ -270,7 +270,7 @@ pub struct Acknowledgement { } /// Nested message and enum types in `Acknowledgement`. pub mod acknowledgement { - use provwasm_proc_macro::CosmwasmExt; + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// response contains either a result or an error and must be non-empty #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -338,7 +338,7 @@ pub struct Params { /// CLOSED, INIT, TRYOPEN, OPEN, FLUSHING, FLUSHCOMPLETE or UNINITIALIZED. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum State { /// Default State UninitializedUnspecified = 0, @@ -390,7 +390,7 @@ impl State { /// Order defines if a channel is ORDERED or UNORDERED #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum Order { /// zero-value for channel ordering NoneUnspecified = 0, @@ -532,8 +532,8 @@ pub struct Upgrade { pub struct UpgradeFields { #[prost(enumeration = "Order", tag = "1")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "Order::serialize", + deserialize_with = "Order::deserialize" )] pub ordering: i32, #[prost(string, repeated, tag = "2")] @@ -1870,8 +1870,8 @@ pub struct MsgRecvPacket { pub struct MsgRecvPacketResponse { #[prost(enumeration = "ResponseResultType", tag = "1")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "ResponseResultType::serialize", + deserialize_with = "ResponseResultType::deserialize" )] pub result: i32, } @@ -1924,8 +1924,8 @@ pub struct MsgTimeout { pub struct MsgTimeoutResponse { #[prost(enumeration = "ResponseResultType", tag = "1")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "ResponseResultType::serialize", + deserialize_with = "ResponseResultType::deserialize" )] pub result: i32, } @@ -1990,8 +1990,8 @@ pub struct MsgTimeoutOnClose { pub struct MsgTimeoutOnCloseResponse { #[prost(enumeration = "ResponseResultType", tag = "1")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "ResponseResultType::serialize", + deserialize_with = "ResponseResultType::deserialize" )] pub result: i32, } @@ -2044,8 +2044,8 @@ pub struct MsgAcknowledgement { pub struct MsgAcknowledgementResponse { #[prost(enumeration = "ResponseResultType", tag = "1")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "ResponseResultType::serialize", + deserialize_with = "ResponseResultType::deserialize" )] pub result: i32, } @@ -2166,8 +2166,8 @@ pub struct MsgChannelUpgradeTryResponse { pub upgrade_sequence: u64, #[prost(enumeration = "ResponseResultType", tag = "3")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "ResponseResultType::serialize", + deserialize_with = "ResponseResultType::deserialize" )] pub result: i32, } @@ -2224,8 +2224,8 @@ pub struct MsgChannelUpgradeAck { pub struct MsgChannelUpgradeAckResponse { #[prost(enumeration = "ResponseResultType", tag = "1")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "ResponseResultType::serialize", + deserialize_with = "ResponseResultType::deserialize" )] pub result: i32, } @@ -2249,8 +2249,8 @@ pub struct MsgChannelUpgradeConfirm { pub channel_id: ::prost::alloc::string::String, #[prost(enumeration = "State", tag = "3")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "State::serialize", + deserialize_with = "State::deserialize" )] pub counterparty_channel_state: i32, #[prost(message, optional, tag = "4")] @@ -2288,8 +2288,8 @@ pub struct MsgChannelUpgradeConfirm { pub struct MsgChannelUpgradeConfirmResponse { #[prost(enumeration = "ResponseResultType", tag = "1")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "ResponseResultType::serialize", + deserialize_with = "ResponseResultType::deserialize" )] pub result: i32, } @@ -2313,8 +2313,8 @@ pub struct MsgChannelUpgradeOpen { pub channel_id: ::prost::alloc::string::String, #[prost(enumeration = "State", tag = "3")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "State::serialize", + deserialize_with = "State::deserialize" )] pub counterparty_channel_state: i32, #[prost(uint64, tag = "4")] @@ -2534,7 +2534,7 @@ pub struct MsgPruneAcknowledgementsResponse { /// ResponseResultType defines the possible outcomes of the execution of a message #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum ResponseResultType { /// Default zero value enumeration Unspecified = 0, diff --git a/packages/provwasm-std/src/types/ibc/core/client/v1.rs b/packages/provwasm-std/src/types/ibc/core/client/v1.rs index 556e2f2b..1f3d398a 100644 --- a/packages/provwasm-std/src/types/ibc/core/client/v1.rs +++ b/packages/provwasm-std/src/types/ibc/core/client/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// IdentifiedClientState defines a client state with an additional client /// identifier field. #[allow(clippy::derive_partial_eq_without_eq)] diff --git a/packages/provwasm-std/src/types/ibc/core/commitment/v1.rs b/packages/provwasm-std/src/types/ibc/core/commitment/v1.rs index 531b1bcc..fcd03f8c 100644 --- a/packages/provwasm-std/src/types/ibc/core/commitment/v1.rs +++ b/packages/provwasm-std/src/types/ibc/core/commitment/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// MerkleRoot defines a merkle root hash. /// In the Cosmos SDK, the AppHash of a block header becomes the root. #[allow(clippy::derive_partial_eq_without_eq)] diff --git a/packages/provwasm-std/src/types/ibc/core/connection/v1.rs b/packages/provwasm-std/src/types/ibc/core/connection/v1.rs index 2e39cfed..1bd832a4 100644 --- a/packages/provwasm-std/src/types/ibc/core/connection/v1.rs +++ b/packages/provwasm-std/src/types/ibc/core/connection/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// ConnectionEnd defines a stateful object on a chain connected to another /// separate one. /// NOTE: there must only be 2 defined ConnectionEnds to establish @@ -26,8 +26,8 @@ pub struct ConnectionEnd { /// current state of the connection end. #[prost(enumeration = "State", tag = "3")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "State::serialize", + deserialize_with = "State::deserialize" )] pub state: i32, /// counterparty chain associated with this connection. @@ -71,8 +71,8 @@ pub struct IdentifiedConnection { /// current state of the connection end. #[prost(enumeration = "State", tag = "4")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "State::serialize", + deserialize_with = "State::deserialize" )] pub state: i32, /// counterparty chain associated with this connection. @@ -201,7 +201,7 @@ pub struct Params { /// INIT, TRYOPEN, OPEN or UNINITIALIZED. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum State { /// Default State UninitializedUnspecified = 0, diff --git a/packages/provwasm-std/src/types/ibc/core/port/v1.rs b/packages/provwasm-std/src/types/ibc/core/port/v1.rs index 7c65b218..7480e4a4 100644 --- a/packages/provwasm-std/src/types/ibc/core/port/v1.rs +++ b/packages/provwasm-std/src/types/ibc/core/port/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// QueryAppVersionRequest is the request type for the Query/AppVersion RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -26,8 +26,8 @@ pub struct QueryAppVersionRequest { /// whether the channel is ordered or unordered #[prost(enumeration = "super::super::channel::v1::Order", tag = "3")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "super::super::channel::v1::Order::serialize", + deserialize_with = "super::super::channel::v1::Order::deserialize" )] pub ordering: i32, /// counterparty channel end diff --git a/packages/provwasm-std/src/types/ibc/core/types/v1.rs b/packages/provwasm-std/src/types/ibc/core/types/v1.rs index 0ccc3b86..f5bafe35 100644 --- a/packages/provwasm-std/src/types/ibc/core/types/v1.rs +++ b/packages/provwasm-std/src/types/ibc/core/types/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// GenesisState defines the ibc module's genesis state. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/ibc/lightclients/localhost/v2.rs b/packages/provwasm-std/src/types/ibc/lightclients/localhost/v2.rs index ed8fa748..69dcbe98 100644 --- a/packages/provwasm-std/src/types/ibc/lightclients/localhost/v2.rs +++ b/packages/provwasm-std/src/types/ibc/lightclients/localhost/v2.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// ClientState defines the 09-localhost client state #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/ibc/lightclients/solomachine/v2.rs b/packages/provwasm-std/src/types/ibc/lightclients/solomachine/v2.rs index f4be2063..1f25841d 100644 --- a/packages/provwasm-std/src/types/ibc/lightclients/solomachine/v2.rs +++ b/packages/provwasm-std/src/types/ibc/lightclients/solomachine/v2.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// ClientState defines a solo machine client that tracks the current consensus /// state and if the client is frozen. #[allow(clippy::derive_partial_eq_without_eq)] @@ -151,8 +151,8 @@ pub struct SignatureAndData { pub signature: ::prost::alloc::vec::Vec, #[prost(enumeration = "DataType", tag = "2")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "DataType::serialize", + deserialize_with = "DataType::deserialize" )] pub data_type: i32, #[prost(bytes = "vec", tag = "3")] @@ -227,8 +227,8 @@ pub struct SignBytes { /// type of the data used #[prost(enumeration = "DataType", tag = "4")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "DataType::serialize", + deserialize_with = "DataType::deserialize" )] pub data_type: i32, /// marshaled data @@ -466,7 +466,7 @@ pub struct NextSequenceRecvData { /// to preserve uniqueness of different data sign byte encodings. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum DataType { /// Default State UninitializedUnspecified = 0, diff --git a/packages/provwasm-std/src/types/ibc/lightclients/solomachine/v3.rs b/packages/provwasm-std/src/types/ibc/lightclients/solomachine/v3.rs index 99ce8e87..8e244294 100644 --- a/packages/provwasm-std/src/types/ibc/lightclients/solomachine/v3.rs +++ b/packages/provwasm-std/src/types/ibc/lightclients/solomachine/v3.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// ClientState defines a solo machine client that tracks the current consensus /// state and if the client is frozen. #[allow(clippy::derive_partial_eq_without_eq)] diff --git a/packages/provwasm-std/src/types/ibc/lightclients/tendermint/v1.rs b/packages/provwasm-std/src/types/ibc/lightclients/tendermint/v1.rs index 60368c83..e2a36145 100644 --- a/packages/provwasm-std/src/types/ibc/lightclients/tendermint/v1.rs +++ b/packages/provwasm-std/src/types/ibc/lightclients/tendermint/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// ClientState from Tendermint tracks the current validator set, latest height, /// and a possible frozen height. #[allow(clippy::derive_partial_eq_without_eq)] diff --git a/packages/provwasm-std/src/types/ibc/lightclients/wasm/v1.rs b/packages/provwasm-std/src/types/ibc/lightclients/wasm/v1.rs index b6ec853a..2c69dc7c 100644 --- a/packages/provwasm-std/src/types/ibc/lightclients/wasm/v1.rs +++ b/packages/provwasm-std/src/types/ibc/lightclients/wasm/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// GenesisState defines 08-wasm's keeper genesis state #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/provenance/attribute/v1.rs b/packages/provwasm-std/src/types/provenance/attribute/v1.rs index ce19065d..67532437 100644 --- a/packages/provwasm-std/src/types/provenance/attribute/v1.rs +++ b/packages/provwasm-std/src/types/provenance/attribute/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Params defines the set of params for the attribute module. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -48,8 +48,8 @@ pub struct Attribute { /// The attribute value type. #[prost(enumeration = "AttributeType", tag = "3")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "AttributeType::serialize", + deserialize_with = "AttributeType::deserialize" )] pub attribute_type: i32, /// The address the attribute is bound to @@ -250,7 +250,7 @@ pub struct EventAttributeParamsUpdated { /// AttributeType defines the type of the data stored in the attribute value #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum AttributeType { /// ATTRIBUTE_TYPE_UNSPECIFIED defines an unknown/invalid type Unspecified = 0, @@ -637,8 +637,8 @@ pub struct MsgAddAttributeRequest { /// The attribute value type. #[prost(enumeration = "AttributeType", tag = "3")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "AttributeType::serialize", + deserialize_with = "AttributeType::deserialize" )] pub attribute_type: i32, /// The account to add the attribute to. @@ -700,15 +700,15 @@ pub struct MsgUpdateAttributeRequest { /// The original attribute value type. #[prost(enumeration = "AttributeType", tag = "4")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "AttributeType::serialize", + deserialize_with = "AttributeType::deserialize" )] pub original_attribute_type: i32, /// The update attribute value type. #[prost(enumeration = "AttributeType", tag = "5")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "AttributeType::serialize", + deserialize_with = "AttributeType::deserialize" )] pub update_attribute_type: i32, /// The account to add the attribute to. diff --git a/packages/provwasm-std/src/types/provenance/exchange/v1.rs b/packages/provwasm-std/src/types/provenance/exchange/v1.rs index ba93e317..876df196 100644 --- a/packages/provwasm-std/src/types/provenance/exchange/v1.rs +++ b/packages/provwasm-std/src/types/provenance/exchange/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Commitment contains information on committed funds. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -1128,16 +1128,12 @@ pub struct AccessGrant { pub address: ::prost::alloc::string::String, /// allowed is the list of permissions available for the address. #[prost(enumeration = "Permission", repeated, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str_vec::serialize", - deserialize_with = "crate::serde::as_str_vec::deserialize" - )] pub permissions: ::prost::alloc::vec::Vec, } /// Permission defines the different types of permission that can be given to an account for a market. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum Permission { /// PERMISSION_UNSPECIFIED is the zero-value Permission; it is an error to use it. Unspecified = 0, @@ -1215,7 +1211,7 @@ pub struct Order { } /// Nested message and enum types in `Order`. pub mod order { - use provwasm_proc_macro::CosmwasmExt; + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// order is the specifics of this order. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/provenance/hold/v1.rs b/packages/provwasm-std/src/types/provenance/hold/v1.rs index 80d957ba..e6103c74 100644 --- a/packages/provwasm-std/src/types/provenance/hold/v1.rs +++ b/packages/provwasm-std/src/types/provenance/hold/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// EventHoldAdded is an event indicating that some funds were placed on hold in an account. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/provenance/ibchooks/v1.rs b/packages/provwasm-std/src/types/provenance/ibchooks/v1.rs index a4359649..5954ec30 100644 --- a/packages/provwasm-std/src/types/provenance/ibchooks/v1.rs +++ b/packages/provwasm-std/src/types/provenance/ibchooks/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// EventIBCHooksParamsUpdated defines the event emitted after updating ibchooks parameters. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/provenance/ibcratelimit/v1.rs b/packages/provwasm-std/src/types/provenance/ibcratelimit/v1.rs index 99e7065c..e7132a42 100644 --- a/packages/provwasm-std/src/types/provenance/ibcratelimit/v1.rs +++ b/packages/provwasm-std/src/types/provenance/ibcratelimit/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// EventAckRevertFailure is emitted when an Ack revert fails #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/provenance/marker/v1.rs b/packages/provwasm-std/src/types/provenance/marker/v1.rs index 1ed4e4fa..c69a112f 100644 --- a/packages/provwasm-std/src/types/provenance/marker/v1.rs +++ b/packages/provwasm-std/src/types/provenance/marker/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// AccessGrant associates a collection of permissions with an address for delegated marker account control. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -16,16 +16,12 @@ pub struct AccessGrant { #[prost(string, tag = "1")] pub address: ::prost::alloc::string::String, #[prost(enumeration = "Access", repeated, packed = "false", tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str_vec::serialize", - deserialize_with = "crate::serde::as_str_vec::deserialize" - )] pub permissions: ::prost::alloc::vec::Vec, } /// Access defines the different types of permissions that a marker supports granting to an address. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum Access { /// ACCESS_UNSPECIFIED defines a no-op vote option. Unspecified = 0, @@ -174,8 +170,8 @@ pub struct MarkerAccount { /// Indicates the current status of this marker record. #[prost(enumeration = "MarkerStatus", tag = "4")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "MarkerStatus::serialize", + deserialize_with = "MarkerStatus::deserialize" )] pub status: i32, /// value denomination and total supply for the token. @@ -187,8 +183,8 @@ pub struct MarkerAccount { /// Marker type information #[prost(enumeration = "MarkerType", tag = "7")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "MarkerType::serialize", + deserialize_with = "MarkerType::deserialize" )] pub marker_type: i32, /// A fixed supply will mint additional coin automatically if the total supply decreases below a set value. This @@ -589,7 +585,7 @@ pub struct EventMarkerParamsUpdated { /// MarkerType defines the types of marker #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum MarkerType { /// MARKER_TYPE_UNSPECIFIED is an invalid/unknown marker type. Unspecified = 0, @@ -623,7 +619,7 @@ impl MarkerType { /// MarkerStatus defines the various states a marker account can be in. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum MarkerStatus { /// MARKER_STATUS_UNSPECIFIED - Unknown/Invalid Marker Status Unspecified = 0, @@ -764,14 +760,14 @@ pub struct AddMarkerProposal { pub manager: ::prost::alloc::string::String, #[prost(enumeration = "MarkerStatus", tag = "5")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "MarkerStatus::serialize", + deserialize_with = "MarkerStatus::deserialize" )] pub status: i32, #[prost(enumeration = "MarkerType", tag = "6")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "MarkerType::serialize", + deserialize_with = "MarkerType::deserialize" )] pub marker_type: i32, #[prost(message, repeated, tag = "7")] @@ -918,8 +914,8 @@ pub struct ChangeStatusProposal { pub denom: ::prost::alloc::string::String, #[prost(enumeration = "MarkerStatus", tag = "4")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "MarkerStatus::serialize", + deserialize_with = "MarkerStatus::deserialize" )] pub new_status: i32, } @@ -1034,8 +1030,8 @@ pub struct QueryAllMarkersRequest { /// Optional status to filter request #[prost(enumeration = "MarkerStatus", tag = "1")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "MarkerStatus::serialize", + deserialize_with = "MarkerStatus::deserialize" )] pub status: i32, /// pagination defines an optional pagination for the request. @@ -1410,7 +1406,7 @@ pub struct QueryNetAssetValuesResponse { /// SIPrefix represents an International System of Units (SI) Prefix. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum SiPrefix { /// 10^0 (none) None = 0, @@ -1576,14 +1572,14 @@ pub struct MsgAddMarkerRequest { pub from_address: ::prost::alloc::string::String, #[prost(enumeration = "MarkerStatus", tag = "5")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "MarkerStatus::serialize", + deserialize_with = "MarkerStatus::deserialize" )] pub status: i32, #[prost(enumeration = "MarkerType", tag = "6")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "MarkerType::serialize", + deserialize_with = "MarkerType::deserialize" )] pub marker_type: i32, #[prost(message, repeated, tag = "7")] @@ -2061,8 +2057,8 @@ pub struct MsgAddFinalizeActivateMarkerRequest { pub from_address: ::prost::alloc::string::String, #[prost(enumeration = "MarkerType", tag = "5")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "MarkerType::serialize", + deserialize_with = "MarkerType::deserialize" )] pub marker_type: i32, #[prost(message, repeated, tag = "6")] @@ -2469,8 +2465,8 @@ pub struct MsgChangeStatusProposalRequest { pub denom: ::prost::alloc::string::String, #[prost(enumeration = "MarkerStatus", tag = "2")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "MarkerStatus::serialize", + deserialize_with = "MarkerStatus::deserialize" )] pub new_status: i32, /// The signer of the message. Must have admin authority to marker or be governance module account address. diff --git a/packages/provwasm-std/src/types/provenance/metadata/v1/mod.rs b/packages/provwasm-std/src/types/provenance/metadata/v1/mod.rs index 754e9d5b..db6823c8 100644 --- a/packages/provwasm-std/src/types/provenance/metadata/v1/mod.rs +++ b/packages/provwasm-std/src/types/provenance/metadata/v1/mod.rs @@ -1,5 +1,5 @@ pub mod p8e; -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// EventTxCompleted is an event message indicating that a TX has completed. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -787,10 +787,6 @@ pub struct ScopeSpecification { pub owner_addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, /// A list of parties that must be present on a scope (and their associated roles) #[prost(enumeration = "PartyType", repeated, tag = "4")] - #[serde( - serialize_with = "crate::serde::as_str_vec::serialize", - deserialize_with = "crate::serde::as_str_vec::deserialize" - )] pub parties_involved: ::prost::alloc::vec::Vec, /// A list of contract specification ids allowed for a scope based on this specification. #[prost(bytes = "vec", repeated, tag = "5")] @@ -829,10 +825,6 @@ pub struct ContractSpecification { pub owner_addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, /// a list of party roles that must be fullfilled when signing a transaction for this contract specification #[prost(enumeration = "PartyType", repeated, tag = "4")] - #[serde( - serialize_with = "crate::serde::as_str_vec::serialize", - deserialize_with = "crate::serde::as_str_vec::deserialize" - )] pub parties_involved: ::prost::alloc::vec::Vec, /// name of the class/type of this contract executable #[prost(string, tag = "7")] @@ -844,7 +836,7 @@ pub struct ContractSpecification { } /// Nested message and enum types in `ContractSpecification`. pub mod contract_specification { - use provwasm_proc_macro::CosmwasmExt; + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Reference to a metadata record with a hash and type information for the instance of code that will process this /// contract #[allow(clippy::derive_partial_eq_without_eq)] @@ -899,16 +891,12 @@ pub struct RecordSpecification { /// Type of result for this record specification (must be RECORD or RECORD_LIST) #[prost(enumeration = "DefinitionType", tag = "5")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "DefinitionType::serialize", + deserialize_with = "DefinitionType::deserialize" )] pub result_type: i32, /// Type of party responsible for this record #[prost(enumeration = "PartyType", repeated, tag = "6")] - #[serde( - serialize_with = "crate::serde::as_str_vec::serialize", - deserialize_with = "crate::serde::as_str_vec::deserialize" - )] pub responsible_parties: ::prost::alloc::vec::Vec, } /// InputSpecification defines a name, type_name, and source reference (either on or off chain) to define an input @@ -938,7 +926,7 @@ pub struct InputSpecification { } /// Nested message and enum types in `InputSpecification`. pub mod input_specification { - use provwasm_proc_macro::CosmwasmExt; + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// source is either on chain (record_id) or off-chain (hash) #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -989,7 +977,7 @@ pub struct Description { /// DefinitionType indicates the required definition type for this value #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum DefinitionType { /// DEFINITION_TYPE_UNSPECIFIED indicates an unknown/invalid value Unspecified = 0, @@ -1028,7 +1016,7 @@ impl DefinitionType { /// PartyType are the different roles parties on a contract may use #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum PartyType { /// PARTY_TYPE_UNSPECIFIED is an error condition Unspecified = 0, @@ -1249,7 +1237,7 @@ pub struct Process { } /// Nested message and enum types in `Process`. pub mod process { - use provwasm_proc_macro::CosmwasmExt; + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// unique identifier for this process #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -1293,8 +1281,8 @@ pub struct RecordInput { /// Indicates if this input was a recorded fact on chain or just a given hashed input #[prost(enumeration = "RecordInputStatus", tag = "5")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "RecordInputStatus::serialize", + deserialize_with = "RecordInputStatus::deserialize" )] pub status: i32, /// data source @@ -1303,7 +1291,7 @@ pub struct RecordInput { } /// Nested message and enum types in `RecordInput`. pub mod record_input { - use provwasm_proc_macro::CosmwasmExt; + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// data source #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -1344,8 +1332,8 @@ pub struct RecordOutput { /// Status of the process execution associated with this output indicating success,failure, or pending #[prost(enumeration = "ResultStatus", tag = "2")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "ResultStatus::serialize", + deserialize_with = "ResultStatus::deserialize" )] pub status: i32, } @@ -1369,8 +1357,8 @@ pub struct Party { /// a role for this account within the context of the processes used #[prost(enumeration = "PartyType", tag = "2")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "PartyType::serialize", + deserialize_with = "PartyType::deserialize" )] pub role: i32, /// whether this party's signature is optional @@ -1442,7 +1430,7 @@ pub struct NetAssetValue { /// A set of types for inputs on a record (of fact) #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum RecordInputStatus { /// RECORD_INPUT_STATUS_UNSPECIFIED indicates an invalid/unknown input type Unspecified = 0, @@ -1476,7 +1464,7 @@ impl RecordInputStatus { /// ResultStatus indicates the various states of execution of a record #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum ResultStatus { /// RESULT_STATUS_UNSPECIFIED indicates an unset condition Unspecified = 0, @@ -3464,7 +3452,7 @@ pub struct SessionIdComponents { } /// Nested message and enum types in `SessionIdComponents`. pub mod session_id_components { - use provwasm_proc_macro::CosmwasmExt; + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// scope is used to define the scope this session belongs to. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/provenance/metadata/v1/p8e.rs b/packages/provwasm-std/src/types/provenance/metadata/v1/p8e.rs index cc989009..c86d0d0c 100644 --- a/packages/provwasm-std/src/types/provenance/metadata/v1/p8e.rs +++ b/packages/provwasm-std/src/types/provenance/metadata/v1/p8e.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Deprecated: Do not use. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -67,8 +67,8 @@ pub struct DefinitionSpec { pub signature: ::core::option::Option, #[prost(enumeration = "DefinitionSpecType", tag = "4")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "DefinitionSpecType::serialize", + deserialize_with = "DefinitionSpecType::deserialize" )] pub r#type: i32, } @@ -177,8 +177,8 @@ pub struct ExecutionResult { pub output: ::core::option::Option, #[prost(enumeration = "ExecutionResultType", tag = "2")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "ExecutionResultType::serialize", + deserialize_with = "ExecutionResultType::deserialize" )] pub result: i32, #[prost(message, optional, tag = "3")] @@ -221,8 +221,8 @@ pub struct Recitals { pub struct Recital { #[prost(enumeration = "PartyType", tag = "1")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "PartyType::serialize", + deserialize_with = "PartyType::deserialize" )] pub signer_role: i32, #[prost(message, optional, tag = "2")] @@ -363,14 +363,14 @@ pub struct PublicKey { pub public_key_bytes: ::prost::alloc::vec::Vec, #[prost(enumeration = "PublicKeyType", tag = "2")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "PublicKeyType::serialize", + deserialize_with = "PublicKeyType::deserialize" )] pub r#type: i32, #[prost(enumeration = "PublicKeyCurve", tag = "3")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "PublicKeyCurve::serialize", + deserialize_with = "PublicKeyCurve::deserialize" )] pub curve: i32, } @@ -440,10 +440,6 @@ pub struct ContractSpec { #[prost(message, repeated, tag = "2")] pub input_specs: ::prost::alloc::vec::Vec, #[prost(enumeration = "PartyType", repeated, tag = "3")] - #[serde( - serialize_with = "crate::serde::as_str_vec::serialize", - deserialize_with = "crate::serde::as_str_vec::deserialize" - )] pub parties_involved: ::prost::alloc::vec::Vec, #[prost(message, repeated, tag = "4")] pub condition_specs: ::prost::alloc::vec::Vec, @@ -491,8 +487,8 @@ pub struct ConsiderationSpec { pub func_name: ::prost::alloc::string::String, #[prost(enumeration = "PartyType", tag = "2")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "PartyType::serialize", + deserialize_with = "PartyType::deserialize" )] pub responsible_party: i32, #[prost(message, repeated, tag = "3")] @@ -521,7 +517,7 @@ pub struct OutputSpec { /// Deprecated: Do not use. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] #[deprecated] pub enum DefinitionSpecType { /// Deprecated: Do not use. @@ -560,7 +556,7 @@ impl DefinitionSpecType { /// Deprecated: Do not use. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] #[deprecated] pub enum PublicKeyCurve { /// Deprecated: Do not use. @@ -591,7 +587,7 @@ impl PublicKeyCurve { /// Deprecated: Do not use. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] #[deprecated] pub enum PublicKeyType { /// Deprecated: Do not use. @@ -618,7 +614,7 @@ impl PublicKeyType { /// Deprecated: Do not use. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] #[deprecated] pub enum ExecutionResultType { /// Deprecated: Do not use. @@ -657,7 +653,7 @@ impl ExecutionResultType { /// Deprecated: Do not use. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] #[deprecated] pub enum PartyType { /// Deprecated: Do not use. diff --git a/packages/provwasm-std/src/types/provenance/msgfees/v1.rs b/packages/provwasm-std/src/types/provenance/msgfees/v1.rs index 254919e0..f89f57ab 100644 --- a/packages/provwasm-std/src/types/provenance/msgfees/v1.rs +++ b/packages/provwasm-std/src/types/provenance/msgfees/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Params defines the set of params for the msgfees module. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/provenance/name/v1.rs b/packages/provwasm-std/src/types/provenance/name/v1.rs index ae0ba559..06414951 100644 --- a/packages/provwasm-std/src/types/provenance/name/v1.rs +++ b/packages/provwasm-std/src/types/provenance/name/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// Params defines the set of params for the name module. #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/provenance/oracle/v1.rs b/packages/provwasm-std/src/types/provenance/oracle/v1.rs index aa664364..f245bd78 100644 --- a/packages/provwasm-std/src/types/provenance/oracle/v1.rs +++ b/packages/provwasm-std/src/types/provenance/oracle/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// EventOracleQuerySuccess is an event for when the chain receives a successful response from an oracle query #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/provenance/trigger/v1.rs b/packages/provwasm-std/src/types/provenance/trigger/v1.rs index 2ec7ba6c..d8ddcd03 100644 --- a/packages/provwasm-std/src/types/provenance/trigger/v1.rs +++ b/packages/provwasm-std/src/types/provenance/trigger/v1.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// EventTriggerCreated is an event for when a trigger is created #[allow(clippy::derive_partial_eq_without_eq)] #[derive( diff --git a/packages/provwasm-std/src/types/tendermint/abci.rs b/packages/provwasm-std/src/types/tendermint/abci.rs index 03db2dc4..14baf8eb 100644 --- a/packages/provwasm-std/src/types/tendermint/abci.rs +++ b/packages/provwasm-std/src/types/tendermint/abci.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -20,7 +20,7 @@ pub struct Request { } /// Nested message and enum types in `Request`. pub mod request { - use provwasm_proc_macro::CosmwasmExt; + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -210,8 +210,8 @@ pub struct RequestCheckTx { pub tx: ::prost::alloc::vec::Vec, #[prost(enumeration = "CheckTxType", tag = "2")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "CheckTxType::serialize", + deserialize_with = "CheckTxType::deserialize" )] pub r#type: i32, } @@ -588,7 +588,7 @@ pub struct Response { } /// Nested message and enum types in `Response`. pub mod response { - use provwasm_proc_macro::CosmwasmExt; + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -897,17 +897,17 @@ pub struct ResponseListSnapshots { pub struct ResponseOfferSnapshot { #[prost(enumeration = "response_offer_snapshot::Result", tag = "1")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "response_offer_snapshot::Result::serialize", + deserialize_with = "response_offer_snapshot::Result::deserialize" )] pub result: i32, } /// Nested message and enum types in `ResponseOfferSnapshot`. pub mod response_offer_snapshot { - use provwasm_proc_macro::CosmwasmExt; + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] - #[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] + #[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum Result { /// Unknown result, abort all snapshot restoration Unknown = 0, @@ -986,8 +986,8 @@ pub struct ResponseLoadSnapshotChunk { pub struct ResponseApplySnapshotChunk { #[prost(enumeration = "response_apply_snapshot_chunk::Result", tag = "1")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "response_apply_snapshot_chunk::Result::serialize", + deserialize_with = "response_apply_snapshot_chunk::Result::deserialize" )] pub result: i32, /// Chunks to refetch and reapply @@ -1003,10 +1003,10 @@ pub struct ResponseApplySnapshotChunk { } /// Nested message and enum types in `ResponseApplySnapshotChunk`. pub mod response_apply_snapshot_chunk { - use provwasm_proc_macro::CosmwasmExt; + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] - #[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] + #[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum Result { /// Unknown result, abort all snapshot restoration Unknown = 0, @@ -1081,17 +1081,17 @@ pub struct ResponsePrepareProposal { pub struct ResponseProcessProposal { #[prost(enumeration = "response_process_proposal::ProposalStatus", tag = "1")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "response_process_proposal::ProposalStatus::serialize", + deserialize_with = "response_process_proposal::ProposalStatus::deserialize" )] pub status: i32, } /// Nested message and enum types in `ResponseProcessProposal`. pub mod response_process_proposal { - use provwasm_proc_macro::CosmwasmExt; + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] - #[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] + #[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum ProposalStatus { Unknown = 0, Accept = 1, @@ -1158,17 +1158,17 @@ pub struct ResponseVerifyVoteExtension { tag = "1" )] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "response_verify_vote_extension::VerifyStatus::serialize", + deserialize_with = "response_verify_vote_extension::VerifyStatus::deserialize" )] pub status: i32, } /// Nested message and enum types in `ResponseVerifyVoteExtension`. pub mod response_verify_vote_extension { - use provwasm_proc_macro::CosmwasmExt; + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] - #[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] + #[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum VerifyStatus { Unknown = 0, Accept = 1, @@ -1487,8 +1487,8 @@ pub struct VoteInfo { pub validator: ::core::option::Option, #[prost(enumeration = "super::types::BlockIdFlag", tag = "3")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "super::types::BlockIdFlag::serialize", + deserialize_with = "super::types::BlockIdFlag::deserialize" )] pub block_id_flag: i32, } @@ -1525,8 +1525,8 @@ pub struct ExtendedVoteInfo { /// block_id_flag indicates whether the validator voted for a block, nil, or did not vote at all #[prost(enumeration = "super::types::BlockIdFlag", tag = "5")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "super::types::BlockIdFlag::serialize", + deserialize_with = "super::types::BlockIdFlag::deserialize" )] pub block_id_flag: i32, } @@ -1545,8 +1545,8 @@ pub struct ExtendedVoteInfo { pub struct Misbehavior { #[prost(enumeration = "MisbehaviorType", tag = "1")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "MisbehaviorType::serialize", + deserialize_with = "MisbehaviorType::deserialize" )] pub r#type: i32, /// The offending validator @@ -1623,7 +1623,7 @@ pub struct Snapshot { } #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum CheckTxType { New = 0, Recheck = 1, @@ -1650,7 +1650,7 @@ impl CheckTxType { } #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum MisbehaviorType { Unknown = 0, DuplicateVote = 1, diff --git a/packages/provwasm-std/src/types/tendermint/blocksync.rs b/packages/provwasm-std/src/types/tendermint/blocksync.rs index a69cae9e..059e30d3 100644 --- a/packages/provwasm-std/src/types/tendermint/blocksync.rs +++ b/packages/provwasm-std/src/types/tendermint/blocksync.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// BlockRequest requests a block for a specific height #[allow(clippy::derive_partial_eq_without_eq)] #[derive( @@ -119,7 +119,7 @@ pub struct Message { } /// Nested message and enum types in `Message`. pub mod message { - use provwasm_proc_macro::CosmwasmExt; + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, diff --git a/packages/provwasm-std/src/types/tendermint/consensus.rs b/packages/provwasm-std/src/types/tendermint/consensus.rs index d2368bf4..83769c22 100644 --- a/packages/provwasm-std/src/types/tendermint/consensus.rs +++ b/packages/provwasm-std/src/types/tendermint/consensus.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// NewRoundStep is sent for every step taken in the ConsensusState. /// For every height/round/step transition #[allow(clippy::derive_partial_eq_without_eq)] @@ -200,8 +200,8 @@ pub struct HasVote { pub round: i32, #[prost(enumeration = "super::types::SignedMsgType", tag = "3")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "super::types::SignedMsgType::serialize", + deserialize_with = "super::types::SignedMsgType::deserialize" )] pub r#type: i32, #[prost(int32, tag = "4")] @@ -239,8 +239,8 @@ pub struct VoteSetMaj23 { pub round: i32, #[prost(enumeration = "super::types::SignedMsgType", tag = "3")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "super::types::SignedMsgType::serialize", + deserialize_with = "super::types::SignedMsgType::deserialize" )] pub r#type: i32, #[prost(message, optional, tag = "4")] @@ -274,8 +274,8 @@ pub struct VoteSetBits { pub round: i32, #[prost(enumeration = "super::types::SignedMsgType", tag = "3")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "super::types::SignedMsgType::serialize", + deserialize_with = "super::types::SignedMsgType::deserialize" )] pub r#type: i32, #[prost(message, optional, tag = "4")] @@ -301,7 +301,7 @@ pub struct Message { } /// Nested message and enum types in `Message`. pub mod message { - use provwasm_proc_macro::CosmwasmExt; + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -427,7 +427,7 @@ pub struct WalMessage { } /// Nested message and enum types in `WALMessage`. pub mod wal_message { - use provwasm_proc_macro::CosmwasmExt; + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, diff --git a/packages/provwasm-std/src/types/tendermint/crypto.rs b/packages/provwasm-std/src/types/tendermint/crypto.rs index beb1f0ff..737cfc57 100644 --- a/packages/provwasm-std/src/types/tendermint/crypto.rs +++ b/packages/provwasm-std/src/types/tendermint/crypto.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -144,7 +144,7 @@ pub struct PublicKey { } /// Nested message and enum types in `PublicKey`. pub mod public_key { - use provwasm_proc_macro::CosmwasmExt; + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, diff --git a/packages/provwasm-std/src/types/tendermint/libs/bits.rs b/packages/provwasm-std/src/types/tendermint/libs/bits.rs index 778e319e..375eb86d 100644 --- a/packages/provwasm-std/src/types/tendermint/libs/bits.rs +++ b/packages/provwasm-std/src/types/tendermint/libs/bits.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, diff --git a/packages/provwasm-std/src/types/tendermint/mempool.rs b/packages/provwasm-std/src/types/tendermint/mempool.rs index db52561f..bca7d9cf 100644 --- a/packages/provwasm-std/src/types/tendermint/mempool.rs +++ b/packages/provwasm-std/src/types/tendermint/mempool.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -33,7 +33,7 @@ pub struct Message { } /// Nested message and enum types in `Message`. pub mod message { - use provwasm_proc_macro::CosmwasmExt; + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, diff --git a/packages/provwasm-std/src/types/tendermint/p2p.rs b/packages/provwasm-std/src/types/tendermint/p2p.rs index f471b7ee..8c3fa8c5 100644 --- a/packages/provwasm-std/src/types/tendermint/p2p.rs +++ b/packages/provwasm-std/src/types/tendermint/p2p.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -179,7 +179,7 @@ pub struct Packet { } /// Nested message and enum types in `Packet`. pub mod packet { - use provwasm_proc_macro::CosmwasmExt; + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -268,7 +268,7 @@ pub struct Message { } /// Nested message and enum types in `Message`. pub mod message { - use provwasm_proc_macro::CosmwasmExt; + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, diff --git a/packages/provwasm-std/src/types/tendermint/privval.rs b/packages/provwasm-std/src/types/tendermint/privval.rs index 465109fc..41bc6608 100644 --- a/packages/provwasm-std/src/types/tendermint/privval.rs +++ b/packages/provwasm-std/src/types/tendermint/privval.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -179,7 +179,7 @@ pub struct Message { } /// Nested message and enum types in `Message`. pub mod message { - use provwasm_proc_macro::CosmwasmExt; + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -211,7 +211,7 @@ pub mod message { } #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum Errors { Unknown = 0, UnexpectedResponse = 1, diff --git a/packages/provwasm-std/src/types/tendermint/rpc/grpc.rs b/packages/provwasm-std/src/types/tendermint/rpc/grpc.rs index f666b4ec..2a567370 100644 --- a/packages/provwasm-std/src/types/tendermint/rpc/grpc.rs +++ b/packages/provwasm-std/src/types/tendermint/rpc/grpc.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, diff --git a/packages/provwasm-std/src/types/tendermint/state.rs b/packages/provwasm-std/src/types/tendermint/state.rs index b7b341ff..49c60857 100644 --- a/packages/provwasm-std/src/types/tendermint/state.rs +++ b/packages/provwasm-std/src/types/tendermint/state.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// LegacyABCIResponses retains the responses /// of the legacy ABCI calls during block processing. /// Note ReponseDeliverTx is renamed to ExecTxResult but they are semantically the same diff --git a/packages/provwasm-std/src/types/tendermint/statesync.rs b/packages/provwasm-std/src/types/tendermint/statesync.rs index 42a69a9a..0743b4c6 100644 --- a/packages/provwasm-std/src/types/tendermint/statesync.rs +++ b/packages/provwasm-std/src/types/tendermint/statesync.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -17,7 +17,7 @@ pub struct Message { } /// Nested message and enum types in `Message`. pub mod message { - use provwasm_proc_macro::CosmwasmExt; + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, diff --git a/packages/provwasm-std/src/types/tendermint/store.rs b/packages/provwasm-std/src/types/tendermint/store.rs index 35a0ae59..2b098316 100644 --- a/packages/provwasm-std/src/types/tendermint/store.rs +++ b/packages/provwasm-std/src/types/tendermint/store.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, diff --git a/packages/provwasm-std/src/types/tendermint/types.rs b/packages/provwasm-std/src/types/tendermint/types.rs index 5fc0d7c9..8f6bb04f 100644 --- a/packages/provwasm-std/src/types/tendermint/types.rs +++ b/packages/provwasm-std/src/types/tendermint/types.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// ConsensusParams contains consensus critical parameters that determine the /// validity of blocks. #[allow(clippy::derive_partial_eq_without_eq)] @@ -278,7 +278,7 @@ pub struct SimpleValidator { /// BlockIdFlag indicates which BlockID the signature is for #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum BlockIdFlag { /// indicates an error condition Unknown = 0, @@ -528,8 +528,8 @@ pub struct Data { pub struct Vote { #[prost(enumeration = "SignedMsgType", tag = "1")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "SignedMsgType::serialize", + deserialize_with = "SignedMsgType::deserialize" )] pub r#type: i32, #[prost(int64, tag = "2")] @@ -634,8 +634,8 @@ pub struct Commit { pub struct CommitSig { #[prost(enumeration = "BlockIdFlag", tag = "1")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "BlockIdFlag::serialize", + deserialize_with = "BlockIdFlag::deserialize" )] pub block_id_flag: i32, #[prost(bytes = "vec", tag = "2")] @@ -701,8 +701,8 @@ pub struct ExtendedCommit { pub struct ExtendedCommitSig { #[prost(enumeration = "BlockIdFlag", tag = "1")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "BlockIdFlag::serialize", + deserialize_with = "BlockIdFlag::deserialize" )] pub block_id_flag: i32, #[prost(bytes = "vec", tag = "2")] @@ -749,8 +749,8 @@ pub struct ExtendedCommitSig { pub struct Proposal { #[prost(enumeration = "SignedMsgType", tag = "1")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "SignedMsgType::serialize", + deserialize_with = "SignedMsgType::deserialize" )] pub r#type: i32, #[prost(int64, tag = "2")] @@ -880,7 +880,7 @@ pub struct TxProof { /// SignedMsgType is a type of signed message in the consensus. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema)] +#[derive(::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, SerdeEnumAsInt)] pub enum SignedMsgType { Unknown = 0, /// Votes @@ -931,7 +931,7 @@ pub struct Evidence { } /// Nested message and enum types in `Evidence`. pub mod evidence { - use provwasm_proc_macro::CosmwasmExt; + use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; #[allow(clippy::derive_partial_eq_without_eq)] #[derive( Clone, @@ -1145,8 +1145,8 @@ pub struct CanonicalProposal { /// type alias for byte #[prost(enumeration = "SignedMsgType", tag = "1")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "SignedMsgType::serialize", + deserialize_with = "SignedMsgType::deserialize" )] pub r#type: i32, /// canonicalization requires fixed size encoding here @@ -1192,8 +1192,8 @@ pub struct CanonicalVote { /// type alias for byte #[prost(enumeration = "SignedMsgType", tag = "1")] #[serde( - serialize_with = "crate::serde::enum_as_i32::serialize", - deserialize_with = "crate::serde::enum_as_i32::deserialize" + serialize_with = "SignedMsgType::serialize", + deserialize_with = "SignedMsgType::deserialize" )] pub r#type: i32, /// canonicalization requires fixed size encoding here diff --git a/packages/provwasm-std/src/types/tendermint/version.rs b/packages/provwasm-std/src/types/tendermint/version.rs index b08f00ac..4caec0c8 100644 --- a/packages/provwasm-std/src/types/tendermint/version.rs +++ b/packages/provwasm-std/src/types/tendermint/version.rs @@ -1,4 +1,4 @@ -use provwasm_proc_macro::CosmwasmExt; +use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; /// App includes the protocol and software version for the application. /// This information is included in ResponseInfo. The App.Protocol can be /// updated in ResponseEndBlock. From 2f9c3aeb6dc7c63a1e60bc8e462589c4c2a92004 Mon Sep 17 00:00:00 2001 From: kwt <4344285+kwtalley@users.noreply.github.com> Date: Fri, 12 Jul 2024 20:21:00 -0500 Subject: [PATCH 38/43] set 64 & 128 bit int types to string serialization --- packages/proto-build/src/transformers.rs | 38 ++++-------------------- 1 file changed, 6 insertions(+), 32 deletions(-) diff --git a/packages/proto-build/src/transformers.rs b/packages/proto-build/src/transformers.rs index 24884184..203cda2d 100644 --- a/packages/proto-build/src/transformers.rs +++ b/packages/proto-build/src/transformers.rs @@ -163,19 +163,13 @@ pub fn append_attrs_enum(src: &Path, e: &ItemEnum, descriptor: &FileDescriptorSe } pub fn allow_serde_int_as_str(s: ItemStruct) -> ItemStruct { + // note: + // >= 64-bit is a string. see https://protobuf.dev/programming-guides/proto3/#json let int_types = vec![ - parse_quote!(i8), - parse_quote!(i16), - // parse_quote!(i32), -- this is not included since it could be either str or enum type parse_quote!(i64), parse_quote!(i128), - parse_quote!(isize), - parse_quote!(u8), - parse_quote!(u16), - parse_quote!(u32), parse_quote!(u64), parse_quote!(u128), - parse_quote!(usize), ]; let fields_vec = s @@ -207,19 +201,13 @@ pub fn allow_serde_int_as_str(s: ItemStruct) -> ItemStruct { } pub fn allow_serde_vec_int_as_vec_str(s: ItemStruct) -> ItemStruct { + // note: + // >= 64-bit is a string. see https://protobuf.dev/programming-guides/proto3/#json let vec_int_types: Vec = vec![ - parse_quote!(::prost::alloc::vec::Vec), - parse_quote!(::prost::alloc::vec::Vec), - //parse_quote!(::prost::alloc::vec::Vec), -- this is not included since it could be either vec or vec type parse_quote!(::prost::alloc::vec::Vec), parse_quote!(::prost::alloc::vec::Vec), - parse_quote!(::prost::alloc::vec::Vec), - // parse_quote!(::prost::alloc::vec::Vec), -- this is not included because it is used for bytes and has it's own rule - parse_quote!(::prost::alloc::vec::Vec), - parse_quote!(::prost::alloc::vec::Vec), parse_quote!(::prost::alloc::vec::Vec), parse_quote!(::prost::alloc::vec::Vec), - parse_quote!(::prost::alloc::vec::Vec), ]; let fields_vec = s @@ -460,23 +448,9 @@ pub fn allow_serde_i32_or_vec_i32(s: syn::ItemStruct) -> syn::ItemStruct { // determine if enum and type match (vec_int_types_index, prost_enum_literal_value) { // i32 - (0, None) => { - field.attrs.push(parse_quote! { - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] - }); - } + (0, None) => (), // Vec - (1, None) => { - field.attrs.push(parse_quote! { - #[serde( - serialize_with = "crate::serde::as_str_vec::serialize", - deserialize_with = "crate::serde::as_str_vec::deserialize" - )] - }); - } + (1, None) => (), // i32 enum (0, Some(enum_type)) => { let serialize_with = format!("{}::serialize", enum_type); From 56f4f787c3d522859e8a36bbc4eb59209483ee9b Mon Sep 17 00:00:00 2001 From: kwt <4344285+kwtalley@users.noreply.github.com> Date: Fri, 12 Jul 2024 20:30:04 -0500 Subject: [PATCH 39/43] regenerate types with latest fix --- .../src/types/cosmos/app/v1alpha1.rs | 4 - .../src/types/cosmos/authz/v1beta1.rs | 4 - .../src/types/cosmos/bank/v1beta1.rs | 4 - .../src/types/cosmos/base/abci/v1beta1.rs | 8 - .../types/cosmos/base/tendermint/v1beta1.rs | 4 - .../src/types/cosmos/crypto/hd/v1.rs | 16 -- .../src/types/cosmos/crypto/multisig/mod.rs | 4 - .../types/cosmos/crypto/multisig/v1beta1.rs | 4 - .../src/types/cosmos/distribution/v1beta1.rs | 4 - .../provwasm-std/src/types/cosmos/ics23/v1.rs | 20 -- .../provwasm-std/src/types/cosmos/orm/v1.rs | 12 - .../src/types/cosmos/orm/v1alpha1.rs | 4 - .../src/types/cosmos/staking/v1beta1.rs | 12 - .../src/types/cosmos/store/snapshots/v1.rs | 16 -- .../src/types/provenance/attribute/v1.rs | 4 - .../src/types/provenance/exchange/v1.rs | 232 ------------------ .../src/types/provenance/metadata/v1/mod.rs | 8 - .../src/types/provenance/metadata/v1/p8e.rs | 8 - .../src/types/provenance/msgfees/v1.rs | 4 - .../src/types/provenance/name/v1.rs | 12 - .../provwasm-std/src/types/tendermint/abci.rs | 48 ---- .../src/types/tendermint/consensus.rs | 48 ---- .../provwasm-std/src/types/tendermint/p2p.rs | 8 - .../src/types/tendermint/privval.rs | 4 - .../src/types/tendermint/statesync.rs | 24 -- .../src/types/tendermint/types.rs | 40 --- 26 files changed, 556 deletions(-) diff --git a/packages/provwasm-std/src/types/cosmos/app/v1alpha1.rs b/packages/provwasm-std/src/types/cosmos/app/v1alpha1.rs index c00e0da5..1fbbb423 100644 --- a/packages/provwasm-std/src/types/cosmos/app/v1alpha1.rs +++ b/packages/provwasm-std/src/types/cosmos/app/v1alpha1.rs @@ -87,10 +87,6 @@ pub struct PackageReference { /// are important good client UX /// * protobuf files are changed in backwards and forwards compatible ways #[prost(uint32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub revision: u32, } /// MigrateFromInfo is information on a module version that a newer module diff --git a/packages/provwasm-std/src/types/cosmos/authz/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/authz/v1beta1.rs index d15fed58..6b58501f 100644 --- a/packages/provwasm-std/src/types/cosmos/authz/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/authz/v1beta1.rs @@ -38,10 +38,6 @@ pub struct CountAuthorization { pub msg: ::prost::alloc::string::String, /// Allowed number of authorizations assigned to grantee #[prost(int32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub allowed_authorizations: i32, } /// Grant gives permissions to execute diff --git a/packages/provwasm-std/src/types/cosmos/bank/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/bank/v1beta1.rs index 281439aa..49956985 100644 --- a/packages/provwasm-std/src/types/cosmos/bank/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/bank/v1beta1.rs @@ -152,10 +152,6 @@ pub struct DenomUnit { /// (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with /// exponent = 6, thus: 1 atom = 10^6 uatom). #[prost(uint32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub exponent: u32, /// aliases is a list of string aliases for the given denom #[prost(string, repeated, tag = "3")] diff --git a/packages/provwasm-std/src/types/cosmos/base/abci/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/base/abci/v1beta1.rs index cc5e1350..ee944c2e 100644 --- a/packages/provwasm-std/src/types/cosmos/base/abci/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/base/abci/v1beta1.rs @@ -29,10 +29,6 @@ pub struct TxResponse { pub codespace: ::prost::alloc::string::String, /// Response code. #[prost(uint32, tag = "4")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub code: u32, /// Result bytes, if any. #[prost(string, tag = "5")] @@ -93,10 +89,6 @@ pub struct TxResponse { #[proto_message(type_url = "/cosmos.base.abci.v1beta1.ABCIMessageLog")] pub struct AbciMessageLog { #[prost(uint32, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub msg_index: u32, #[prost(string, tag = "2")] pub log: ::prost::alloc::string::String, diff --git a/packages/provwasm-std/src/types/cosmos/base/tendermint/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/base/tendermint/v1beta1.rs index e35c2ec5..f83ad479 100644 --- a/packages/provwasm-std/src/types/cosmos/base/tendermint/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/base/tendermint/v1beta1.rs @@ -501,10 +501,6 @@ pub struct AbciQueryRequest { #[proto_message(type_url = "/cosmos.base.tendermint.v1beta1.ABCIQueryResponse")] pub struct AbciQueryResponse { #[prost(uint32, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub code: u32, /// nondeterministic #[prost(string, tag = "3")] diff --git a/packages/provwasm-std/src/types/cosmos/crypto/hd/v1.rs b/packages/provwasm-std/src/types/cosmos/crypto/hd/v1.rs index 169a726d..1e335155 100644 --- a/packages/provwasm-std/src/types/cosmos/crypto/hd/v1.rs +++ b/packages/provwasm-std/src/types/cosmos/crypto/hd/v1.rs @@ -15,24 +15,12 @@ use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; pub struct Bip44Params { /// purpose is a constant set to 44' (or 0x8000002C) following the BIP43 recommendation #[prost(uint32, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub purpose: u32, /// coin_type is a constant that improves privacy #[prost(uint32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub coin_type: u32, /// account splits the key space into independent user identities #[prost(uint32, tag = "3")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub account: u32, /// change is a constant used for public derivation. Constant 0 is used for external chain and constant 1 for internal /// chain. @@ -40,9 +28,5 @@ pub struct Bip44Params { pub change: bool, /// address_index is used as child index in BIP32 derivation #[prost(uint32, tag = "5")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub address_index: u32, } diff --git a/packages/provwasm-std/src/types/cosmos/crypto/multisig/mod.rs b/packages/provwasm-std/src/types/cosmos/crypto/multisig/mod.rs index dc2bdec8..2df09874 100644 --- a/packages/provwasm-std/src/types/cosmos/crypto/multisig/mod.rs +++ b/packages/provwasm-std/src/types/cosmos/crypto/multisig/mod.rs @@ -17,10 +17,6 @@ use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; #[proto_message(type_url = "/cosmos.crypto.multisig.LegacyAminoPubKey")] pub struct LegacyAminoPubKey { #[prost(uint32, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub threshold: u32, #[prost(message, repeated, tag = "2")] pub public_keys: ::prost::alloc::vec::Vec, diff --git a/packages/provwasm-std/src/types/cosmos/crypto/multisig/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/crypto/multisig/v1beta1.rs index 6a73ae52..52d3d62c 100644 --- a/packages/provwasm-std/src/types/cosmos/crypto/multisig/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/crypto/multisig/v1beta1.rs @@ -36,10 +36,6 @@ pub struct MultiSignature { #[proto_message(type_url = "/cosmos.crypto.multisig.v1beta1.CompactBitArray")] pub struct CompactBitArray { #[prost(uint32, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub extra_bits_stored: u32, #[prost(bytes = "vec", tag = "2")] #[serde( diff --git a/packages/provwasm-std/src/types/cosmos/distribution/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/distribution/v1beta1.rs index c56bfb69..143c5d95 100644 --- a/packages/provwasm-std/src/types/cosmos/distribution/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/distribution/v1beta1.rs @@ -56,10 +56,6 @@ pub struct ValidatorHistoricalRewards { #[prost(message, repeated, tag = "1")] pub cumulative_reward_ratio: ::prost::alloc::vec::Vec, #[prost(uint32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub reference_count: u32, } /// ValidatorCurrentRewards represents current rewards and current diff --git a/packages/provwasm-std/src/types/cosmos/ics23/v1.rs b/packages/provwasm-std/src/types/cosmos/ics23/v1.rs index 008822f5..63a9497b 100644 --- a/packages/provwasm-std/src/types/cosmos/ics23/v1.rs +++ b/packages/provwasm-std/src/types/cosmos/ics23/v1.rs @@ -261,17 +261,9 @@ pub struct ProofSpec { pub inner_spec: ::core::option::Option, /// max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries) #[prost(int32, tag = "3")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub max_depth: i32, /// min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries) #[prost(int32, tag = "4")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub min_depth: i32, /// prehash_key_before_comparison is a flag that indicates whether to use the /// prehash_key specified by LeafOp to compare lexical ordering of keys for @@ -307,22 +299,10 @@ pub struct InnerSpec { #[prost(int32, repeated, tag = "1")] pub child_order: ::prost::alloc::vec::Vec, #[prost(int32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub child_size: i32, #[prost(int32, tag = "3")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub min_prefix_length: i32, #[prost(int32, tag = "4")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub max_prefix_length: i32, /// empty child is the prehash image that is used when one child is nil (eg. 20 bytes of 0) #[prost(bytes = "vec", tag = "5")] diff --git a/packages/provwasm-std/src/types/cosmos/orm/v1.rs b/packages/provwasm-std/src/types/cosmos/orm/v1.rs index f6282c24..b99d8bbd 100644 --- a/packages/provwasm-std/src/types/cosmos/orm/v1.rs +++ b/packages/provwasm-std/src/types/cosmos/orm/v1.rs @@ -23,10 +23,6 @@ pub struct TableDescriptor { /// tables and singletons in this file. It may be deprecated in the future when this /// can be auto-generated. #[prost(uint32, tag = "3")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub id: u32, } /// PrimaryKeyDescriptor describes a table primary key. @@ -113,10 +109,6 @@ pub struct SecondaryIndexDescriptor { /// table and less than 32768. It may be deprecated in the future when this can /// be auto-generated. #[prost(uint32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub id: u32, /// unique specifies that this an unique index. #[prost(bool, tag = "3")] @@ -140,9 +132,5 @@ pub struct SingletonDescriptor { /// tables and singletons in this file. It may be deprecated in the future when this /// can be auto-generated. #[prost(uint32, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub id: u32, } diff --git a/packages/provwasm-std/src/types/cosmos/orm/v1alpha1.rs b/packages/provwasm-std/src/types/cosmos/orm/v1alpha1.rs index 771f24d6..7bf7c506 100644 --- a/packages/provwasm-std/src/types/cosmos/orm/v1alpha1.rs +++ b/packages/provwasm-std/src/types/cosmos/orm/v1alpha1.rs @@ -44,10 +44,6 @@ pub mod module_schema_descriptor { /// id is a prefix that will be varint encoded and prepended to all the /// table keys specified in the file's tables. #[prost(uint32, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub id: u32, /// proto_file_name is the name of a file .proto in that contains /// table definitions. The .proto file must be in a package that the diff --git a/packages/provwasm-std/src/types/cosmos/staking/v1beta1.rs b/packages/provwasm-std/src/types/cosmos/staking/v1beta1.rs index f2ceef4b..065fde68 100644 --- a/packages/provwasm-std/src/types/cosmos/staking/v1beta1.rs +++ b/packages/provwasm-std/src/types/cosmos/staking/v1beta1.rs @@ -584,24 +584,12 @@ pub struct Params { pub unbonding_time: ::core::option::Option, /// max_validators is the maximum number of validators. #[prost(uint32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub max_validators: u32, /// max_entries is the max entries for either unbonding delegation or redelegation (per pair/trio). #[prost(uint32, tag = "3")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub max_entries: u32, /// historical_entries is the number of historical entries to persist. #[prost(uint32, tag = "4")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub historical_entries: u32, /// bond_denom defines the bondable coin denomination. #[prost(string, tag = "5")] diff --git a/packages/provwasm-std/src/types/cosmos/store/snapshots/v1.rs b/packages/provwasm-std/src/types/cosmos/store/snapshots/v1.rs index 88e71408..998e61e7 100644 --- a/packages/provwasm-std/src/types/cosmos/store/snapshots/v1.rs +++ b/packages/provwasm-std/src/types/cosmos/store/snapshots/v1.rs @@ -20,16 +20,8 @@ pub struct Snapshot { )] pub height: u64, #[prost(uint32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub format: u32, #[prost(uint32, tag = "3")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub chunks: u32, #[prost(bytes = "vec", tag = "4")] #[serde( @@ -159,10 +151,6 @@ pub struct SnapshotIavlItem { pub version: i64, /// height is depth of the tree. #[prost(int32, tag = "4")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub height: i32, } /// SnapshotExtensionMeta contains metadata about an external snapshotter. @@ -184,10 +172,6 @@ pub struct SnapshotExtensionMeta { #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, #[prost(uint32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub format: u32, } /// SnapshotExtensionPayload contains payloads of an external snapshotter. diff --git a/packages/provwasm-std/src/types/provenance/attribute/v1.rs b/packages/provwasm-std/src/types/provenance/attribute/v1.rs index 67532437..b43ceea9 100644 --- a/packages/provwasm-std/src/types/provenance/attribute/v1.rs +++ b/packages/provwasm-std/src/types/provenance/attribute/v1.rs @@ -15,10 +15,6 @@ use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; pub struct Params { /// maximum length of data to allow in an attribute value #[prost(uint32, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub max_value_length: u32, } /// Attribute holds a typed key/value structure for data associated with an account diff --git a/packages/provwasm-std/src/types/provenance/exchange/v1.rs b/packages/provwasm-std/src/types/provenance/exchange/v1.rs index 876df196..3e0298ab 100644 --- a/packages/provwasm-std/src/types/provenance/exchange/v1.rs +++ b/packages/provwasm-std/src/types/provenance/exchange/v1.rs @@ -18,10 +18,6 @@ pub struct Commitment { pub account: ::prost::alloc::string::String, /// market_id is the numeric identifier of the market the funds are committed to. #[prost(uint32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, /// amount is the funds that have been committed by the account to the market. #[prost(message, repeated, tag = "3")] @@ -64,10 +60,6 @@ pub struct AccountAmount { pub struct MarketAmount { /// market_id is the numeric identifier the amount has been committed to. #[prost(uint32, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, /// amount is the funds associated with the address. #[prost(message, repeated, tag = "2")] @@ -121,10 +113,6 @@ pub struct EventOrderCreated { pub order_type: ::prost::alloc::string::String, /// market_id is the numerical identifier of the market. #[prost(uint32, tag = "3")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, /// external_id is the order's external id. #[prost(string, tag = "4")] @@ -156,10 +144,6 @@ pub struct EventOrderCancelled { pub cancelled_by: ::prost::alloc::string::String, /// market_id is the numerical identifier of the market. #[prost(uint32, tag = "3")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, /// external_id is the order's external id. #[prost(string, tag = "4")] @@ -198,10 +182,6 @@ pub struct EventOrderFilled { pub fees: ::prost::alloc::string::String, /// market_id is the numerical identifier of the market. #[prost(uint32, tag = "5")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, /// external_id is the order's external id. #[prost(string, tag = "6")] @@ -241,10 +221,6 @@ pub struct EventOrderPartiallyFilled { pub fees: ::prost::alloc::string::String, /// market_id is the numerical identifier of the market. #[prost(uint32, tag = "5")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, /// external_id is the order's external id. #[prost(string, tag = "6")] @@ -273,10 +249,6 @@ pub struct EventOrderExternalIdUpdated { pub order_id: u64, /// market_id is the numerical identifier of the market. #[prost(uint32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, /// external_id is the order's new external id. #[prost(string, tag = "3")] @@ -301,10 +273,6 @@ pub struct EventFundsCommitted { pub account: ::prost::alloc::string::String, /// market_id is the numerical identifier of the market. #[prost(uint32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, /// amount is the coins string of the newly committed funds. #[prost(string, tag = "3")] @@ -332,10 +300,6 @@ pub struct EventCommitmentReleased { pub account: ::prost::alloc::string::String, /// market_id is the numerical identifier of the market. #[prost(uint32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, /// amount is the coins string of the funds that were released from commitment. #[prost(string, tag = "3")] @@ -360,10 +324,6 @@ pub struct EventCommitmentReleased { pub struct EventMarketWithdraw { /// market_id is the numerical identifier of the market. #[prost(uint32, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, /// amount is the coins amount string of funds withdrawn from the market account. #[prost(string, tag = "2")] @@ -391,10 +351,6 @@ pub struct EventMarketWithdraw { pub struct EventMarketDetailsUpdated { /// market_id is the numerical identifier of the market. #[prost(uint32, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, /// updated_by is the account that updated the details. #[prost(string, tag = "2")] @@ -418,10 +374,6 @@ pub struct EventMarketDetailsUpdated { pub struct EventMarketEnabled { /// market_id is the numerical identifier of the market. #[prost(uint32, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, /// updated_by is the account that enabled the market. #[prost(string, tag = "2")] @@ -445,10 +397,6 @@ pub struct EventMarketEnabled { pub struct EventMarketDisabled { /// market_id is the numerical identifier of the market. #[prost(uint32, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, /// updated_by is the account that disabled the market. #[prost(string, tag = "2")] @@ -470,10 +418,6 @@ pub struct EventMarketDisabled { pub struct EventMarketOrdersEnabled { /// market_id is the numerical identifier of the market. #[prost(uint32, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, /// updated_by is the account that updated the accepting_orders option. #[prost(string, tag = "2")] @@ -495,10 +439,6 @@ pub struct EventMarketOrdersEnabled { pub struct EventMarketOrdersDisabled { /// market_id is the numerical identifier of the market. #[prost(uint32, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, /// updated_by is the account that updated the accepting_orders option. #[prost(string, tag = "2")] @@ -520,10 +460,6 @@ pub struct EventMarketOrdersDisabled { pub struct EventMarketUserSettleEnabled { /// market_id is the numerical identifier of the market. #[prost(uint32, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, /// updated_by is the account that updated the user_settle option. #[prost(string, tag = "2")] @@ -545,10 +481,6 @@ pub struct EventMarketUserSettleEnabled { pub struct EventMarketUserSettleDisabled { /// market_id is the numerical identifier of the market. #[prost(uint32, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, /// updated_by is the account that updated the user_settle option. #[prost(string, tag = "2")] @@ -570,10 +502,6 @@ pub struct EventMarketUserSettleDisabled { pub struct EventMarketCommitmentsEnabled { /// market_id is the numerical identifier of the market. #[prost(uint32, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, /// updated_by is the account that updated the accepting_commitments option. #[prost(string, tag = "2")] @@ -595,10 +523,6 @@ pub struct EventMarketCommitmentsEnabled { pub struct EventMarketCommitmentsDisabled { /// market_id is the numerical identifier of the market. #[prost(uint32, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, /// updated_by is the account that updated the accepting_commitments option. #[prost(string, tag = "2")] @@ -621,10 +545,6 @@ pub struct EventMarketCommitmentsDisabled { pub struct EventMarketIntermediaryDenomUpdated { /// market_id is the numerical identifier of the market. #[prost(uint32, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, /// updated_by is the account that updated the intermediary denom. #[prost(string, tag = "2")] @@ -646,10 +566,6 @@ pub struct EventMarketIntermediaryDenomUpdated { pub struct EventMarketPermissionsUpdated { /// market_id is the numerical identifier of the market. #[prost(uint32, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, /// updated_by is the account that updated the permissions. #[prost(string, tag = "2")] @@ -671,10 +587,6 @@ pub struct EventMarketPermissionsUpdated { pub struct EventMarketReqAttrUpdated { /// market_id is the numerical identifier of the market. #[prost(uint32, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, /// updated_by is the account that updated the required attributes. #[prost(string, tag = "2")] @@ -696,10 +608,6 @@ pub struct EventMarketReqAttrUpdated { pub struct EventMarketCreated { /// market_id is the numerical identifier of the market. #[prost(uint32, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, } /// EventMarketFeesUpdated is an event emitted when a market's fees have been updated. @@ -718,10 +626,6 @@ pub struct EventMarketCreated { pub struct EventMarketFeesUpdated { /// market_id is the numerical identifier of the market. #[prost(uint32, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, } /// EventParamsUpdated is an event emitted when the exchange module's params have been updated. @@ -899,10 +803,6 @@ pub struct MarketAccount { ::core::option::Option, /// market_id is the numerical identifier for this market. #[prost(uint32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, /// market_details is some human-consumable information about this market. #[prost(message, optional, tag = "3")] @@ -951,10 +851,6 @@ pub struct MarketDetails { pub struct MarketBrief { /// market_id is the numerical identifier for this market. #[prost(uint32, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, /// market_address is the bech32 address string of this market's account. #[prost(string, tag = "2")] @@ -979,10 +875,6 @@ pub struct MarketBrief { pub struct Market { /// market_id is the numerical identifier for this market. #[prost(uint32, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, /// market_details is some information about this market. #[prost(message, optional, tag = "2")] @@ -1068,10 +960,6 @@ pub struct Market { /// (which might then be converted to USD then nhash before applying this ratio); Usually, though, the value /// of that trade would be viewed as either just 10apples or just 100grapes. #[prost(uint32, tag = "16")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub commitment_settlement_bips: u32, /// intermediary_denom is the denom that funds get converted to (before being converted to the chain's fee denom) /// when calculating the fees that are paid to the exchange. NAVs are used for this conversion and actions will fail @@ -1248,10 +1136,6 @@ pub mod order { pub struct AskOrder { /// market_id identifies the market that this order belongs to. #[prost(uint32, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, /// seller is the address of the account that owns this order and has the assets to sell. #[prost(string, tag = "2")] @@ -1296,10 +1180,6 @@ pub struct AskOrder { pub struct BidOrder { /// market_id identifies the market that this order belongs to. #[prost(uint32, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, /// buyer is the address of the account that owns this order and has the price to spend. #[prost(string, tag = "2")] @@ -1343,10 +1223,6 @@ pub struct Params { /// It is used if there isn't an applicable denom-specific split defined. /// E.g. 100 = 1%. Min = 0, Max = 10000. #[prost(uint32, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub default_split: u32, /// denom_splits are the denom-specific amounts the exchange receives. #[prost(message, repeated, tag = "2")] @@ -1384,10 +1260,6 @@ pub struct DenomSplit { /// split is the proportion of fees the exchange receives for this denom in basis points. /// E.g. 100 = 1%. Min = 0, Max = 10000. #[prost(uint32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub split: u32, } /// Payment represents one account's desire to trade funds with another account. @@ -1459,10 +1331,6 @@ pub struct GenesisState { pub orders: ::prost::alloc::vec::Vec, /// last_market_id is the value of the last auto-selected market id. #[prost(uint32, tag = "4")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub last_market_id: u32, /// last_order_id is the value of the last order id created. #[prost(uint64, tag = "5")] @@ -1585,10 +1453,6 @@ pub struct MsgCommitFundsRequest { pub account: ::prost::alloc::string::String, /// market_id is the numerical identifier of the market the funds will be committed to. #[prost(uint32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, /// amount is the funds being committed to the market. #[prost(message, repeated, tag = "3")] @@ -1675,10 +1539,6 @@ pub struct MsgFillBidsRequest { /// market_id is the numerical identifier of the market with the bids to fill. /// All bid orders being filled must be in this market. #[prost(uint32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, /// total_assets are the things that the seller wishes to sell. /// It must be the sum of all bid order assets. @@ -1735,10 +1595,6 @@ pub struct MsgFillAsksRequest { /// market_id is the numerical identifier of the market with the asks to fill. /// All ask orders being filled must be in this market. #[prost(uint32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, /// total_price is the total amount being spent on some assets. /// It must be the sum of all ask order prices. @@ -1795,10 +1651,6 @@ pub struct MsgMarketSettleRequest { pub admin: ::prost::alloc::string::String, /// market_id is the numerical identifier of the market requesting this settlement. #[prost(uint32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, /// ask_order_ids are the ask orders being filled. #[prost(uint64, repeated, tag = "3")] @@ -1853,10 +1705,6 @@ pub struct MsgMarketCommitmentSettleRequest { pub admin: ::prost::alloc::string::String, /// market_id is the numerical identifier of the market requesting this settlement. #[prost(uint32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, /// inputs defines where the funds are coming from. All of these funds must be already committed to the market. #[prost(message, repeated, tag = "3")] @@ -1908,10 +1756,6 @@ pub struct MsgMarketReleaseCommitmentsRequest { pub admin: ::prost::alloc::string::String, /// market_id is the numerical identifier of the market releasing these funds. #[prost(uint32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, /// to_release is the funds that are to be released. /// An entry with a zero amount indicates that all committed funds for that account should be released. @@ -1954,10 +1798,6 @@ pub struct MsgMarketSetOrderExternalIdRequest { pub admin: ::prost::alloc::string::String, /// market_id is the numerical identifier of the market with the orders to update. #[prost(uint32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, /// order_id is the numerical identifier of the order to update. #[prost(uint64, tag = "3")] @@ -2004,10 +1844,6 @@ pub struct MsgMarketWithdrawRequest { pub admin: ::prost::alloc::string::String, /// market_id is the numerical identifier of the market to withdraw from. #[prost(uint32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, /// to_address is the address that will receive the funds. #[prost(string, tag = "3")] @@ -2049,10 +1885,6 @@ pub struct MsgMarketUpdateDetailsRequest { pub admin: ::prost::alloc::string::String, /// market_id is the numerical identifier of the market to update details for. #[prost(uint32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, /// market_details is some information about this market. #[prost(message, optional, tag = "3")] @@ -2097,10 +1929,6 @@ pub struct MsgMarketUpdateEnabledRequest { /// Deprecated: This endpoint is no longer usable. It is replaced by MarketUpdateAcceptingOrders. #[deprecated] #[prost(uint32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, /// accepting_orders is whether this market is allowing orders to be created for it. /// Deprecated: This endpoint is no longer usable. It is replaced by MarketUpdateAcceptingOrders. @@ -2143,10 +1971,6 @@ pub struct MsgMarketUpdateAcceptingOrdersRequest { pub admin: ::prost::alloc::string::String, /// market_id is the numerical identifier of the market to enable or disable. #[prost(uint32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, /// accepting_orders is whether this market is allowing orders to be created for it. #[prost(bool, tag = "3")] @@ -2185,10 +2009,6 @@ pub struct MsgMarketUpdateUserSettleRequest { pub admin: ::prost::alloc::string::String, /// market_id is the numerical identifier of the market to enable or disable user-settlement for. #[prost(uint32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, /// allow_user_settlement is whether this market allows users to initiate their own settlements. /// For example, the FillBids and FillAsks endpoints are available if and only if this is true. @@ -2229,10 +2049,6 @@ pub struct MsgMarketUpdateAcceptingCommitmentsRequest { pub admin: ::prost::alloc::string::String, /// market_id is the numerical identifier of the market to enable or disable commitments for. #[prost(uint32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, /// accepting_commitments is whether this market allows users to commit funds to it. /// For example, the CommitFunds endpoint is available if and only if this is true. @@ -2273,10 +2089,6 @@ pub struct MsgMarketUpdateIntermediaryDenomRequest { pub admin: ::prost::alloc::string::String, /// market_id is the numerical identifier of the market changing the intermediary denom. #[prost(uint32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, /// intermediary_denom is the new intermediary denom for this market to use. #[prost(string, tag = "3")] @@ -2315,10 +2127,6 @@ pub struct MsgMarketManagePermissionsRequest { pub admin: ::prost::alloc::string::String, /// market_id is the numerical identifier of the market to manage permissions for. #[prost(uint32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, /// revoke_all are addresses that should have all their permissions revoked. #[prost(string, repeated, tag = "3")] @@ -2363,10 +2171,6 @@ pub struct MsgMarketManageReqAttrsRequest { pub admin: ::prost::alloc::string::String, /// market_id is the numerical identifier of the market to update required attributes for. #[prost(uint32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, /// create_ask_to_add are the attributes that should now also be required to create an ask order. #[prost(string, repeated, tag = "3")] @@ -2673,10 +2477,6 @@ pub struct MsgGovManageFeesRequest { pub authority: ::prost::alloc::string::String, /// market_id is the market id that will get these fee updates. #[prost(uint32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, /// add_fee_create_ask_flat are the create-ask flat fee options to add. #[prost(message, repeated, tag = "3")] @@ -2733,10 +2533,6 @@ pub struct MsgGovManageFeesRequest { /// set_fee_commitment_settlement_bips is the new fee_commitment_settlement_bips for the market. /// It is ignored if it is zero. To set it to zero set unset_fee_commitment_settlement_bips to true. #[prost(uint32, tag = "17")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub set_fee_commitment_settlement_bips: u32, /// unset_fee_commitment_settlement_bips, if true, sets the fee_commitment_settlement_bips to zero. /// If false, it is ignored. @@ -2776,10 +2572,6 @@ pub struct MsgGovCloseMarketRequest { pub authority: ::prost::alloc::string::String, /// market_id is the numerical identifier of the market to close. #[prost(uint32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, } /// MsgGovCloseMarketResponse is a response message for the GovCloseMarket endpoint. @@ -2998,10 +2790,6 @@ pub struct QueryGetOrderResponse { pub struct QueryGetOrderByExternalIdRequest { /// market_id is the id of the market that's expected to have the order. #[prost(uint32, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, /// external_id the external id to look up. #[prost(string, tag = "2")] @@ -3045,10 +2833,6 @@ pub struct QueryGetOrderByExternalIdResponse { pub struct QueryGetMarketOrdersRequest { /// market_id is the id of the market to get all the orders for. #[prost(uint32, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, /// order_type is optional and can limit orders to only "ask" or "bid" orders. #[prost(string, tag = "2")] @@ -3271,10 +3055,6 @@ pub struct QueryGetCommitmentRequest { pub account: ::prost::alloc::string::String, /// market_id is the numeric identifier of the market in the commitment. #[prost(uint32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, } /// QueryGetCommitmentResponse is a response message for the GetCommitment query. @@ -3355,10 +3135,6 @@ pub struct QueryGetAccountCommitmentsResponse { pub struct QueryGetMarketCommitmentsRequest { /// market_id is the numeric identifier of the market with the commitment. #[prost(uint32, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, /// pagination defines an optional pagination for the request. #[prost(message, optional, tag = "99")] @@ -3452,10 +3228,6 @@ pub struct QueryGetAllCommitmentsResponse { pub struct QueryGetMarketRequest { /// market_id is the id of the market to look up. #[prost(uint32, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, } /// QueryGetMarketResponse is a response message for the GetMarket query. @@ -3686,10 +3458,6 @@ pub struct QueryValidateCreateMarketResponse { pub struct QueryValidateMarketRequest { /// market_id is the id of the market to check. #[prost(uint32, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub market_id: u32, } /// QueryValidateMarketResponse is a response message for the ValidateMarket query. diff --git a/packages/provwasm-std/src/types/provenance/metadata/v1/mod.rs b/packages/provwasm-std/src/types/provenance/metadata/v1/mod.rs index db6823c8..14be3770 100644 --- a/packages/provwasm-std/src/types/provenance/metadata/v1/mod.rs +++ b/packages/provwasm-std/src/types/provenance/metadata/v1/mod.rs @@ -1393,10 +1393,6 @@ pub struct AuditFields { pub updated_by: ::prost::alloc::string::String, /// an optional version number that is incremented with each update #[prost(uint32, tag = "5")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub version: u32, /// an optional message associated with the creation/update event #[prost(string, tag = "6")] @@ -1539,10 +1535,6 @@ pub struct ObjectStoreLocator { #[proto_message(type_url = "/provenance.metadata.v1.OSLocatorParams")] pub struct OsLocatorParams { #[prost(uint32, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub max_uri_length: u32, } /// GenesisState defines the account module's genesis state. diff --git a/packages/provwasm-std/src/types/provenance/metadata/v1/p8e.rs b/packages/provwasm-std/src/types/provenance/metadata/v1/p8e.rs index c86d0d0c..cc373a1f 100644 --- a/packages/provwasm-std/src/types/provenance/metadata/v1/p8e.rs +++ b/packages/provwasm-std/src/types/provenance/metadata/v1/p8e.rs @@ -30,10 +30,6 @@ pub struct Contract { #[prost(message, repeated, tag = "7")] pub recitals: ::prost::alloc::vec::Vec, #[prost(int32, tag = "8")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub times_executed: i32, #[prost(message, optional, tag = "9")] pub start_time: ::core::option::Option, @@ -414,10 +410,6 @@ pub struct Timestamp { )] pub seconds: i64, #[prost(int32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub nanos: i32, } /// Deprecated: Do not use. diff --git a/packages/provwasm-std/src/types/provenance/msgfees/v1.rs b/packages/provwasm-std/src/types/provenance/msgfees/v1.rs index f89f57ab..2056dd14 100644 --- a/packages/provwasm-std/src/types/provenance/msgfees/v1.rs +++ b/packages/provwasm-std/src/types/provenance/msgfees/v1.rs @@ -67,10 +67,6 @@ pub struct MsgFee { /// The recipient will receive additional_fee * recipient_basis_points / 10,000. /// The fee collector will receive the rest, i.e. additional_fee * (10,000 - recipient_basis_points) / 10,000. #[prost(uint32, tag = "4")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub recipient_basis_points: u32, } /// EventMsgFee final event property for msg fee on type diff --git a/packages/provwasm-std/src/types/provenance/name/v1.rs b/packages/provwasm-std/src/types/provenance/name/v1.rs index 06414951..66bc347e 100644 --- a/packages/provwasm-std/src/types/provenance/name/v1.rs +++ b/packages/provwasm-std/src/types/provenance/name/v1.rs @@ -15,24 +15,12 @@ use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; pub struct Params { /// maximum length of name segment to allow #[prost(uint32, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub max_segment_length: u32, /// minimum length of name segment to allow #[prost(uint32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub min_segment_length: u32, /// maximum number of name segments to allow. Example: `foo.bar.baz` would be 3 #[prost(uint32, tag = "3")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub max_name_levels: u32, /// determines if unrestricted name keys are allowed or not #[prost(bool, tag = "4")] diff --git a/packages/provwasm-std/src/types/tendermint/abci.rs b/packages/provwasm-std/src/types/tendermint/abci.rs index 14baf8eb..3540ff93 100644 --- a/packages/provwasm-std/src/types/tendermint/abci.rs +++ b/packages/provwasm-std/src/types/tendermint/abci.rs @@ -288,16 +288,8 @@ pub struct RequestLoadSnapshotChunk { )] pub height: u64, #[prost(uint32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub format: u32, #[prost(uint32, tag = "3")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub chunk: u32, } /// Applies a snapshot chunk @@ -315,10 +307,6 @@ pub struct RequestLoadSnapshotChunk { #[proto_message(type_url = "/tendermint.abci.RequestApplySnapshotChunk")] pub struct RequestApplySnapshotChunk { #[prost(uint32, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub index: u32, #[prost(bytes = "vec", tag = "2")] #[serde( @@ -756,10 +744,6 @@ pub struct ResponseInitChain { #[proto_message(type_url = "/tendermint.abci.ResponseQuery")] pub struct ResponseQuery { #[prost(uint32, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub code: u32, /// bytes data = 2; // use "value" instead. /// @@ -812,10 +796,6 @@ pub struct ResponseQuery { #[proto_message(type_url = "/tendermint.abci.ResponseCheckTx")] pub struct ResponseCheckTx { #[prost(uint32, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub code: u32, #[prost(bytes = "vec", tag = "2")] #[serde( @@ -992,10 +972,6 @@ pub struct ResponseApplySnapshotChunk { pub result: i32, /// Chunks to refetch and reapply #[prost(uint32, repeated, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str_vec::serialize", - deserialize_with = "crate::serde::as_str_vec::deserialize" - )] pub refetch_chunks: ::prost::alloc::vec::Vec, /// Chunk senders to reject and ban #[prost(string, repeated, tag = "3")] @@ -1250,10 +1226,6 @@ pub struct ResponseFinalizeBlock { #[proto_message(type_url = "/tendermint.abci.CommitInfo")] pub struct CommitInfo { #[prost(int32, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub round: i32, #[prost(message, repeated, tag = "2")] pub votes: ::prost::alloc::vec::Vec, @@ -1276,10 +1248,6 @@ pub struct CommitInfo { pub struct ExtendedCommitInfo { /// The round at which the block proposer decided in the previous height. #[prost(int32, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub round: i32, /// List of validators' addresses in the last validator set with their voting /// information, including vote extensions. @@ -1346,10 +1314,6 @@ pub struct EventAttribute { #[proto_message(type_url = "/tendermint.abci.ExecTxResult")] pub struct ExecTxResult { #[prost(uint32, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub code: u32, #[prost(bytes = "vec", tag = "2")] #[serde( @@ -1404,10 +1368,6 @@ pub struct TxResult { )] pub height: i64, #[prost(uint32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub index: u32, #[prost(bytes = "vec", tag = "3")] #[serde( @@ -1594,17 +1554,9 @@ pub struct Snapshot { pub height: u64, /// The application-specific snapshot format #[prost(uint32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub format: u32, /// Number of chunks in the snapshot #[prost(uint32, tag = "3")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub chunks: u32, /// Arbitrary snapshot hash, equal only if identical #[prost(bytes = "vec", tag = "4")] diff --git a/packages/provwasm-std/src/types/tendermint/consensus.rs b/packages/provwasm-std/src/types/tendermint/consensus.rs index 83769c22..9e948221 100644 --- a/packages/provwasm-std/src/types/tendermint/consensus.rs +++ b/packages/provwasm-std/src/types/tendermint/consensus.rs @@ -21,16 +21,8 @@ pub struct NewRoundStep { )] pub height: i64, #[prost(int32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub round: i32, #[prost(uint32, tag = "3")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub step: u32, #[prost(int64, tag = "4")] #[serde( @@ -39,10 +31,6 @@ pub struct NewRoundStep { )] pub seconds_since_start_time: i64, #[prost(int32, tag = "5")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub last_commit_round: i32, } /// NewValidBlock is sent when a validator observes a valid block B in some round r, @@ -68,10 +56,6 @@ pub struct NewValidBlock { )] pub height: i64, #[prost(int32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub round: i32, #[prost(message, optional, tag = "3")] pub block_part_set_header: ::core::option::Option, @@ -118,10 +102,6 @@ pub struct ProposalPol { )] pub height: i64, #[prost(int32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub proposal_pol_round: i32, #[prost(message, optional, tag = "3")] pub proposal_pol: ::core::option::Option, @@ -147,10 +127,6 @@ pub struct BlockPart { )] pub height: i64, #[prost(int32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub round: i32, #[prost(message, optional, tag = "3")] pub part: ::core::option::Option, @@ -193,10 +169,6 @@ pub struct HasVote { )] pub height: i64, #[prost(int32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub round: i32, #[prost(enumeration = "super::types::SignedMsgType", tag = "3")] #[serde( @@ -205,10 +177,6 @@ pub struct HasVote { )] pub r#type: i32, #[prost(int32, tag = "4")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub index: i32, } /// VoteSetMaj23 is sent to indicate that a given BlockID has seen +2/3 votes. @@ -232,10 +200,6 @@ pub struct VoteSetMaj23 { )] pub height: i64, #[prost(int32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub round: i32, #[prost(enumeration = "super::types::SignedMsgType", tag = "3")] #[serde( @@ -267,10 +231,6 @@ pub struct VoteSetBits { )] pub height: i64, #[prost(int32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub round: i32, #[prost(enumeration = "super::types::SignedMsgType", tag = "3")] #[serde( @@ -375,16 +335,8 @@ pub struct TimeoutInfo { )] pub height: i64, #[prost(int32, tag = "3")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub round: i32, #[prost(uint32, tag = "4")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub step: u32, } /// EndHeight marks the end of the given height inside WAL. diff --git a/packages/provwasm-std/src/types/tendermint/p2p.rs b/packages/provwasm-std/src/types/tendermint/p2p.rs index 8c3fa8c5..1a4874da 100644 --- a/packages/provwasm-std/src/types/tendermint/p2p.rs +++ b/packages/provwasm-std/src/types/tendermint/p2p.rs @@ -17,10 +17,6 @@ pub struct NetAddress { #[prost(string, tag = "2")] pub ip: ::prost::alloc::string::String, #[prost(uint32, tag = "3")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub port: u32, } #[allow(clippy::derive_partial_eq_without_eq)] @@ -147,10 +143,6 @@ pub struct PacketPong {} #[proto_message(type_url = "/tendermint.p2p.PacketMsg")] pub struct PacketMsg { #[prost(int32, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub channel_id: i32, #[prost(bool, tag = "2")] pub eof: bool, diff --git a/packages/provwasm-std/src/types/tendermint/privval.rs b/packages/provwasm-std/src/types/tendermint/privval.rs index 41bc6608..d6002477 100644 --- a/packages/provwasm-std/src/types/tendermint/privval.rs +++ b/packages/provwasm-std/src/types/tendermint/privval.rs @@ -13,10 +13,6 @@ use provwasm_proc_macro::{CosmwasmExt, SerdeEnumAsInt}; #[proto_message(type_url = "/tendermint.privval.RemoteSignerError")] pub struct RemoteSignerError { #[prost(int32, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub code: i32, #[prost(string, tag = "2")] pub description: ::prost::alloc::string::String, diff --git a/packages/provwasm-std/src/types/tendermint/statesync.rs b/packages/provwasm-std/src/types/tendermint/statesync.rs index 0743b4c6..c5af72a7 100644 --- a/packages/provwasm-std/src/types/tendermint/statesync.rs +++ b/packages/provwasm-std/src/types/tendermint/statesync.rs @@ -72,16 +72,8 @@ pub struct SnapshotsResponse { )] pub height: u64, #[prost(uint32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub format: u32, #[prost(uint32, tag = "3")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub chunks: u32, #[prost(bytes = "vec", tag = "4")] #[serde( @@ -116,16 +108,8 @@ pub struct ChunkRequest { )] pub height: u64, #[prost(uint32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub format: u32, #[prost(uint32, tag = "3")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub index: u32, } #[allow(clippy::derive_partial_eq_without_eq)] @@ -148,16 +132,8 @@ pub struct ChunkResponse { )] pub height: u64, #[prost(uint32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub format: u32, #[prost(uint32, tag = "3")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub index: u32, #[prost(bytes = "vec", tag = "4")] #[serde( diff --git a/packages/provwasm-std/src/types/tendermint/types.rs b/packages/provwasm-std/src/types/tendermint/types.rs index 8f6bb04f..4580259c 100644 --- a/packages/provwasm-std/src/types/tendermint/types.rs +++ b/packages/provwasm-std/src/types/tendermint/types.rs @@ -328,10 +328,6 @@ impl BlockIdFlag { #[proto_message(type_url = "/tendermint.types.PartSetHeader")] pub struct PartSetHeader { #[prost(uint32, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub total: u32, #[prost(bytes = "vec", tag = "2")] #[serde( @@ -354,10 +350,6 @@ pub struct PartSetHeader { #[proto_message(type_url = "/tendermint.types.Part")] pub struct Part { #[prost(uint32, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub index: u32, #[prost(bytes = "vec", tag = "2")] #[serde( @@ -539,10 +531,6 @@ pub struct Vote { )] pub height: i64, #[prost(int32, tag = "3")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub round: i32, /// zero if vote is nil. #[prost(message, optional, tag = "4")] @@ -556,10 +544,6 @@ pub struct Vote { )] pub validator_address: ::prost::alloc::vec::Vec, #[prost(int32, tag = "7")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub validator_index: i32, /// Vote signature by the validator if they participated in consensus for the /// associated block. @@ -608,10 +592,6 @@ pub struct Commit { )] pub height: i64, #[prost(int32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub round: i32, #[prost(message, optional, tag = "3")] pub block_id: ::core::option::Option, @@ -673,10 +653,6 @@ pub struct ExtendedCommit { )] pub height: i64, #[prost(int32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub round: i32, #[prost(message, optional, tag = "3")] pub block_id: ::core::option::Option, @@ -760,16 +736,8 @@ pub struct Proposal { )] pub height: i64, #[prost(int32, tag = "3")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub round: i32, #[prost(int32, tag = "4")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub pol_round: i32, #[prost(message, optional, tag = "5")] pub block_id: ::core::option::Option, @@ -1073,10 +1041,6 @@ pub struct EventDataRoundState { )] pub height: i64, #[prost(int32, tag = "2")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub round: i32, #[prost(string, tag = "3")] pub step: ::prost::alloc::string::String, @@ -1117,10 +1081,6 @@ pub struct CanonicalBlockId { #[proto_message(type_url = "/tendermint.types.CanonicalPartSetHeader")] pub struct CanonicalPartSetHeader { #[prost(uint32, tag = "1")] - #[serde( - serialize_with = "crate::serde::as_str::serialize", - deserialize_with = "crate::serde::as_str::deserialize" - )] pub total: u32, #[prost(bytes = "vec", tag = "2")] #[serde( From 288fe60c078461855c3c59f1c496dbcdc9e9fcb4 Mon Sep 17 00:00:00 2001 From: kwt <4344285+kwtalley@users.noreply.github.com> Date: Fri, 12 Jul 2024 22:12:12 -0500 Subject: [PATCH 40/43] update changelog, readme, migration docs --- CHANGELOG.md | 3 +- MIGRATION.md | 6 ++- README.md | 105 +++++++++++---------------------------------------- 3 files changed, 29 insertions(+), 85 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a114e021..53f42b59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,9 +6,8 @@ * fix code generation ([#150](https://github.com/provenance-io/provwasm/issues/150)) * refactor `Any` to support Trigger messages ([#123](https://github.com/provenance-io/provwasm/issues/123)) * Update to cosmwasm 2.x ([#141](https://github.com/provenance-io/provwasm/issues/141)) -* add module features to provwasm-std ([#142](https://github.com/provenance-io/provwasm/issues/142)) * minimize generated types ([#152](https://github.com/provenance-io/provwasm/issues/152)) -* update to provenance 1.19.0 ([#155](https://github.com/provenance-io/provwasm/issues/155)) +* update to provenance 1.19.0-rc5 ([#155](https://github.com/provenance-io/provwasm/issues/155)) ## Releases diff --git a/MIGRATION.md b/MIGRATION.md index a40208b6..93b58966 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -11,8 +11,12 @@ Cosmwasm is upgraded to 2.0.4 and Provenance to 1.19.0. These major upgrades are - The encoding for `Any` types has changed. This means if your contract has a query that expects a `MarkerAccount` in its response, it will fail as of `Provenance 1.19.0`. This is an internal change and only requires bumping the provwasm-std dependency. +- Provwasm now provides all provenance messages and queries. + **There are 2 caveats**: not all queries will return valid responses ( + see [allowed queries](https://github.com/provenance-io/provenance/blob/7d6c507cab780bb6f0bdeef1e895c870cf4c7465/internal/provwasm/stargate_whitelist.go#L56)), + and `provwasm-std` takes longer to build than before. This will improve with Grpc support. - Follow the common [Cosmwasm migration path](https://github.com/cosmos/cosmos-rust). It is likely that your contract - will not require many changes. `QueryRequest::Grpc` is not supported (yet) + will not require many changes. `QueryRequest::Grpc` is not supported. ## v1.x.x -> 2.0.0 diff --git a/README.md b/README.md index d171bffc..8bacd299 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ The following table shows provwasm version compatibility for smart contract deve | provwasm | wasmd | cosmos | provenance | module support | |----------|---------|---------|-------------------|---------------------------------------------------------------------| +| v2.3.0 | v0.51.X | v0.50.X | v1.19.X | all Provenance and most built-in third-party | | v2.2.0 | v0.30.X | v0.46.X | v1.18.X | attribute,exchange,hold,marker,metadata,msgfees,name,reward,trigger | | v2.1.0 | v0.30.X | v0.46.X | v1.17.X | attribute,exchange,hold,marker,metadata,msgfees,name,reward,trigger | | v2.0.0 | v0.30.X | v0.46.X | v1.15.X | attribute,marker,metadata,msgfees,name,reward | @@ -36,94 +37,34 @@ IBC project. ## Contents -In addition to the core CosmWasm functionality, the provenance bindings include +In addition to the core CosmWasm functionality, the Provenance bindings include: ### Query Support -Queries are available for these Provenance modules: - -- [Attribute](./packages/provwasm-std/src/types/provenance/attribute) - - provenance.attribute.v1.QueryParamsRequest - - provenance.attribute.v1.QueryAttributeRequest - - provenance.attribute.v1.QueryAttributesRequest - - provenance.attribute.v1.QueryScanRequest -- [Exchange](./packages/provwasm-std/src/types/provenance/exchange) - - provenance.exchange.v1.QueryOrderFeeCalcRequest - - provenance.exchange.v1.QueryGetOrderRequest - - provenance.exchange.v1.QueryGetOrderByExternalIDRequest - - provenance.exchange.v1.QueryGetMarketOrdersRequest - - provenance.exchange.v1.QueryGetOwnerOrdersRequest - - provenance.exchange.v1.QueryGetAssetOrdersRequest - - provenance.exchange.v1.QueryGetAllOrdersRequest - - provenance.exchange.v1.QueryGetMarketRequest - - provenance.exchange.v1.QueryGetAllMarketsRequest - - provenance.exchange.v1.QueryParamsRequest - - provenance.exchange.v1.QueryValidateCreateMarketRequest - - provenance.exchange.v1.QueryValidateMarketRequest - - provenance.exchange.v1.QueryValidateManageFeesRequest -- [Hold](./packages/provwasm-std/src/types/provenance/hold) - - provenance.hold.v1.GetHoldsRequest - - provenance.hold.v1.GetAllHoldsRequest -- [Marker](./packages/provwasm-std/src/types/provenance/marker) - - provenance.marker.v1.QueryParamsRequest - - provenance.marker.v1.QueryMarkerRequest - - provenance.marker.v1.QueryHoldingRequest - - provenance.marker.v1.QuerySupplyRequest - - provenance.marker.v1.QueryEscrowRequest - - provenance.marker.v1.QueryAccessRequest - - provenance.marker.v1.QueryDenomMetadataRequest -- [Metadata](./packages/provwasm-std/src/types/provenance/metadata) - - provenance.metadata.v1.QueryParamsRequest - - provenance.metadata.v1.ScopeRequest - - provenance.metadata.v1.SessionsRequest - - provenance.metadata.v1.RecordsRequest - - provenance.metadata.v1.OwnershipRequest - - provenance.metadata.v1.ValueOwnershipRequest - - provenance.metadata.v1.ScopeSpecificationRequest - - provenance.metadata.v1.ContractSpecificationRequest - - provenance.metadata.v1.RecordSpecificationsForContractSpecificationRequest - - provenance.metadata.v1.RecordSpecificationRequest - - provenance.metadata.v1.OSLocatorParamsRequest - - provenance.metadata.v1.OSLocatorRequest - - provenance.metadata.v1.OSLocatorsByURIRequest - - provenance.metadata.v1.OSLocatorsByScopeRequest - - The following has deserialization issues and will be `None` until fixed ( - see [this issue](https://github.com/provenance-io/provwasm/issues/132): - - `ContractSpecification.source` - - `InputSpecification.source` - - `Process.process_id` - - `SessionIdComponents.scope_identifier` -- [MsgFees](./packages/provwasm-std/src/types/provenance/msgfees) - - provenance.msgfees.v1.QueryParamsRequest -- [Name](./packages/provwasm-std/src/types/provenance/name) - - provenance.name.v1.QueryParamsRequest - - provenance.name.v1.QueryResolveRequest - - provenance.name.v1.QueryReverseLookupRequest -- [Reward](./packages/provwasm-std/src/types/provenance/reward) - - provenance.reward.v1.QueryRewardProgramByIDRequest - - provenance.reward.v1.QueryRewardProgramsRequest - - provenance.reward.v1.QueryClaimPeriodRewardDistributionsRequest - - provenance.reward.v1.QueryClaimPeriodRewardDistributionsByIDRequest - - provenance.reward.v1.QueryRewardDistributionsByAddressRequest - - The following has deserialization issues and will be `None` until fixed ( - see [this issue](https://github.com/provenance-io/provwasm/issues/132): - - `QualifyingAction.type` -- [Trigger](./packages/provwasm-std/src/types/provenance/trigger) - - Query support unavailable until [#123](https://github.com/provenance-io/provwasm/issues/123) is resolved +Since migrating to Stargate queries, only a subset of queries are responded to. +The [list](https://github.com/provenance-io/provenance/blob/7d6c507cab780bb6f0bdeef1e895c870cf4c7465/internal/provwasm/stargate_whitelist.go#L56) +is maintained +in [Provenance](https://github.com/provenance-io/provenance/). + +__The following are known to have deserialization issues and will be `None` until upstream is fixed__ ( +see [this issue](https://github.com/provenance-io/provwasm/issues/132)): + +- `ContractSpecification.source` +- `InputSpecification.source` +- `Process.process_id` +- `SessionIdComponents.scope_identifier` +- `QualifyingAction.type` ### Message Encoding -All messages are available for these Provenance modules: - -- [Attribute](./packages/provwasm-std/src/types/provenance/attribute) -- [Exchange](./packages/provwasm-std/src/types/provenance/exchange) -- [Hold](./packages/provwasm-std/src/types/provenance/hold) -- [Marker](./packages/provwasm-std/src/types/provenance/marker) -- [Metadata](./packages/provwasm-std/src/types/provenance/metadata) -- [MsgFees](./packages/provwasm-std/src/types/provenance/msgfees) -- [Name](./packages/provwasm-std/src/types/provenance/name) -- [Reward](./packages/provwasm-std/src/types/provenance/reward) -- [Trigger](./packages/provwasm-std/src/types/provenance/trigger) +_Provenance includes third-party protobuf definitions to maintain compatibility_ + +- [provenance](packages/provwasm-std/src/types/provenance) +- [capability](packages/provwasm-std/src/types/capability) +- [cosmos](packages/provwasm-std/src/types/cosmos) +- [cosmwasm](packages/provwasm-std/src/types/cosmwasm) +- [ibc](packages/provwasm-std/src/types/ibc) +- [tendermint](packages/provwasm-std/src/types/tendermint) ## Migration From 74a576e5f1b44837e5c44fd29bce2ccd0cd3a002 Mon Sep 17 00:00:00 2001 From: kwt <4344285+kwtalley@users.noreply.github.com> Date: Fri, 12 Jul 2024 22:12:29 -0500 Subject: [PATCH 41/43] remove module feature. will wait for grpc --- packages/proto-build/src/code_generator.rs | 2 +- packages/provwasm-std/Cargo.toml | 9 --------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/packages/proto-build/src/code_generator.rs b/packages/proto-build/src/code_generator.rs index e1729f50..6bf43e54 100644 --- a/packages/proto-build/src/code_generator.rs +++ b/packages/proto-build/src/code_generator.rs @@ -78,7 +78,7 @@ impl CodeGenerator { fn generate_mod_file(&self) { mod_gen::generate_mod_file(&self.absolute_out_dir()); - mod_gen::add_root_features(&self.absolute_out_dir()); + // mod_gen::add_root_features(&self.absolute_out_dir()); // disable until grpc enabled } fn transform(&self) { diff --git a/packages/provwasm-std/Cargo.toml b/packages/provwasm-std/Cargo.toml index 2268cc56..d9512878 100644 --- a/packages/provwasm-std/Cargo.toml +++ b/packages/provwasm-std/Cargo.toml @@ -22,12 +22,3 @@ serde = { workspace = true, default-features = false, features = ["derive"] } serde-cw-value = "0.7.0" base64 = "0.21.0" strum_macros = "0.25.3" - -[features] -default = ["cosmos", "provenance"] -capability = [] -cosmos = ["tendermint"] -cosmwasm = [] -ibc = [] -provenance = ["ibc"] -tendermint = [] \ No newline at end of file From 3074eb91b0406ed8306d8a4989f81caf8af561a7 Mon Sep 17 00:00:00 2001 From: kwt <4344285+kwtalley@users.noreply.github.com> Date: Sat, 13 Jul 2024 00:39:52 -0500 Subject: [PATCH 42/43] update to provenance v1.19.0-rc5 --- dependencies/provenance | 2 +- packages/proto-build/src/main.rs | 2 +- packages/provwasm-std/src/types/PROVENANCE_COMMIT | 2 +- scripts/update-and-rebuild.sh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dependencies/provenance b/dependencies/provenance index 3e3a135f..7d6c507c 160000 --- a/dependencies/provenance +++ b/dependencies/provenance @@ -1 +1 @@ -Subproject commit 3e3a135fb0d90f940fd41c5adbffbbfffb2341fd +Subproject commit 7d6c507cab780bb6f0bdeef1e895c870cf4c7465 diff --git a/packages/proto-build/src/main.rs b/packages/proto-build/src/main.rs index f9f16dd4..60f0aefb 100644 --- a/packages/proto-build/src/main.rs +++ b/packages/proto-build/src/main.rs @@ -10,7 +10,7 @@ use proto_build::{ }; /// The provenance commit or tag to be cloned and used to build the proto files -const PROVENANCE_REV: &str = "v1.19.0-rc3"; +const PROVENANCE_REV: &str = "v1.19.0-rc5"; // All paths must end with a / and either be absolute or include a ./ to reference the current // working directory. diff --git a/packages/provwasm-std/src/types/PROVENANCE_COMMIT b/packages/provwasm-std/src/types/PROVENANCE_COMMIT index a434f8ba..002b2dc7 100644 --- a/packages/provwasm-std/src/types/PROVENANCE_COMMIT +++ b/packages/provwasm-std/src/types/PROVENANCE_COMMIT @@ -1 +1 @@ -v1.19.0-rc3 \ No newline at end of file +v1.19.0-rc5 \ No newline at end of file diff --git a/scripts/update-and-rebuild.sh b/scripts/update-and-rebuild.sh index fb65ea3c..5c0fdf01 100755 --- a/scripts/update-and-rebuild.sh +++ b/scripts/update-and-rebuild.sh @@ -3,7 +3,7 @@ set -euxo pipefail SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -LATEST_PROVENANCE_VERSION="v1.19.0-rc3" +LATEST_PROVENANCE_VERSION="v1.19.0-rc5" PROVENANCE_REV=${1:-$LATEST_PROVENANCE_VERSION} COMMIT=${2:-"skip"} From a17354904908eb970ef31c20c1b5167b41dec760 Mon Sep 17 00:00:00 2001 From: Stephen Cirner Date: Mon, 15 Jul 2024 13:30:41 -0400 Subject: [PATCH 43/43] add default features since they are still used internally to the code --- .github/workflows/test.yml | 14 +++++++------- dependencies/provenance | 2 +- packages/provwasm-std/Cargo.toml | 9 +++++++++ 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f9300ce2..66153358 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,7 +35,7 @@ jobs: uses: provenance-io/provenance-testing-action@v1.3.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} - provenance_version: "v1.19.0-rc3" + provenance_version: "v1.19.0-rc5" test_script: "./scripts/gh-action-test/tutorial_test.sh" test_attrs_smart_contract: @@ -55,7 +55,7 @@ jobs: uses: provenance-io/provenance-testing-action@v1.3.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} - provenance_version: "v1.19.0-rc3" + provenance_version: "v1.19.0-rc5" smart_contract_action_version: "latest" test_script: "./scripts/gh-action-test/attrs_test.sh" @@ -76,7 +76,7 @@ jobs: uses: provenance-io/provenance-testing-action@v1.3.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} - provenance_version: "v1.19.0-rc3" + provenance_version: "v1.19.0-rc5" smart_contract_action_version: "latest" test_script: "./scripts/gh-action-test/marker_test.sh" @@ -97,7 +97,7 @@ jobs: uses: provenance-io/provenance-testing-action@v1.3.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} - provenance_version: "v1.19.0-rc3" + provenance_version: "v1.19.0-rc5" smart_contract_action_version: "latest" test_script: "./scripts/gh-action-test/msgfees_test.sh" @@ -118,7 +118,7 @@ jobs: uses: provenance-io/provenance-testing-action@v1.3.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} - provenance_version: "v1.19.0-rc3" + provenance_version: "v1.19.0-rc5" smart_contract_action_version: "latest" test_script: "./scripts/gh-action-test/name_test.sh" @@ -139,7 +139,7 @@ jobs: # uses: provenance-io/provenance-testing-action@v1.3.0 # with: # github_token: ${{ secrets.GITHUB_TOKEN }} - # provenance_version: "v1.19.0-rc3" + # provenance_version: "v1.19.0-rc5" # smart_contract_action_version: "latest" # test_script: "./scripts/gh-action-test/scope_test.sh" @@ -160,6 +160,6 @@ jobs: uses: provenance-io/provenance-testing-action@v1.3.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} - provenance_version: "v1.19.0-rc3" + provenance_version: "v1.19.0-rc5" smart_contract_action_version: "latest" test_script: "./scripts/gh-action-test/trigger_test.sh" diff --git a/dependencies/provenance b/dependencies/provenance index 7d6c507c..dd0940e9 160000 --- a/dependencies/provenance +++ b/dependencies/provenance @@ -1 +1 @@ -Subproject commit 7d6c507cab780bb6f0bdeef1e895c870cf4c7465 +Subproject commit dd0940e94575b4c8f22af51603d3703b39c9a3a9 diff --git a/packages/provwasm-std/Cargo.toml b/packages/provwasm-std/Cargo.toml index d9512878..f8d69439 100644 --- a/packages/provwasm-std/Cargo.toml +++ b/packages/provwasm-std/Cargo.toml @@ -9,6 +9,15 @@ description = "Rust bindings that enable CosmWasm smart contracts to interact wi keywords = ["provenance", "blockchain", "smart-contracts", "defi", "finance"] categories = ["api-bindings", "cryptography::cryptocurrencies", "wasm"] +[features] +default = ["capability", "cosmos", "cosmwasm", "ibc", "provenance", "tendermint"] +capability = [] +cosmos = [] +cosmwasm = [] +ibc = [] +provenance = [] +tendermint = [] + [dependencies] chrono = { version = "0.4.24", default-features = false } cosmwasm-std = { workspace = true }