From ef527bb12c51da47066f63858004d73d8b87ce92 Mon Sep 17 00:00:00 2001 From: AJ Webb Date: Tue, 14 Nov 2023 06:43:32 -1000 Subject: [PATCH] feat(protos and package.json): Update protos to v1.17.0 --- package.json | 2 +- .../ibc/applications/transfer/v1/authz.proto | 31 ++ .../proto/provenance/exchange/v1/events.proto | 161 ++++++++ .../provenance/exchange/v1/genesis.proto | 33 ++ .../proto/provenance/exchange/v1/market.proto | 141 +++++++ .../proto/provenance/exchange/v1/orders.proto | 78 ++++ .../proto/provenance/exchange/v1/params.proto | 28 ++ .../proto/provenance/exchange/v1/query.proto | 317 ++++++++++++++ .../proto/provenance/exchange/v1/tx.proto | 389 ++++++++++++++++++ .../proto/provenance/hold/v1/events.proto | 27 ++ .../proto/provenance/hold/v1/genesis.proto | 19 + .../proto/provenance/hold/v1/hold.proto | 19 + .../proto/provenance/hold/v1/query.proto | 62 +++ .../provenance/ibchooks/v1/genesis.proto | 15 + .../proto/provenance/ibchooks/v1/params.proto | 14 + .../proto/provenance/ibchooks/v1/tx.proto | 29 ++ .../proto/provenance/marker/v1/genesis.proto | 29 ++ .../proto/provenance/marker/v1/marker.proto | 29 +- .../proto/provenance/marker/v1/query.proto | 17 + .../proto/provenance/marker/v1/tx.proto | 49 ++- .../proto/provenance/metadata/v1/query.proto | 144 ++++++- .../metadata/v1/specification.proto | 5 +- .../proto/provenance/msgfees/v1/tx.proto | 111 ++++- .../proto/provenance/oracle/v1/event.proto | 35 ++ .../proto/provenance/oracle/v1/genesis.proto | 19 + .../proto/provenance/oracle/v1/query.proto | 44 ++ .../proto/provenance/oracle/v1/tx.proto | 47 +++ .../proto/provenance/trigger/v1/event.proto | 20 +- 28 files changed, 1889 insertions(+), 25 deletions(-) create mode 100644 third_party/proto/ibc/applications/transfer/v1/authz.proto create mode 100644 third_party/proto/provenance/exchange/v1/events.proto create mode 100644 third_party/proto/provenance/exchange/v1/genesis.proto create mode 100644 third_party/proto/provenance/exchange/v1/market.proto create mode 100644 third_party/proto/provenance/exchange/v1/orders.proto create mode 100644 third_party/proto/provenance/exchange/v1/params.proto create mode 100644 third_party/proto/provenance/exchange/v1/query.proto create mode 100644 third_party/proto/provenance/exchange/v1/tx.proto create mode 100644 third_party/proto/provenance/hold/v1/events.proto create mode 100644 third_party/proto/provenance/hold/v1/genesis.proto create mode 100644 third_party/proto/provenance/hold/v1/hold.proto create mode 100644 third_party/proto/provenance/hold/v1/query.proto create mode 100644 third_party/proto/provenance/ibchooks/v1/genesis.proto create mode 100644 third_party/proto/provenance/ibchooks/v1/params.proto create mode 100644 third_party/proto/provenance/ibchooks/v1/tx.proto create mode 100644 third_party/proto/provenance/oracle/v1/event.proto create mode 100644 third_party/proto/provenance/oracle/v1/genesis.proto create mode 100644 third_party/proto/provenance/oracle/v1/query.proto create mode 100644 third_party/proto/provenance/oracle/v1/tx.proto diff --git a/package.json b/package.json index 804cca9..1263a84 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "clean": "rm -rf ./lib ./esm", "commit": "npx cz", "postbuild": "npm test && node ./scripts/checkCircularDeps.js", - "pull:protos": "bash ./scripts/pull_protos.sh v1.16.0", + "pull:protos": "bash ./scripts/pull_protos.sh v1.17.0", "clean:protos": "rm -rf third_party/proto && rm -rf src/proto", "prepare": "npm run build && husky install", "tsc:esm": "tsc --module es2015 --outDir esm", diff --git a/third_party/proto/ibc/applications/transfer/v1/authz.proto b/third_party/proto/ibc/applications/transfer/v1/authz.proto new file mode 100644 index 0000000..db3e0bb --- /dev/null +++ b/third_party/proto/ibc/applications/transfer/v1/authz.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; + +package ibc.applications.transfer.v1; + +option go_package = "github.com/cosmos/ibc-go/v6/modules/apps/transfer/types"; + +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +// Allocation defines the spend limit for a particular port and channel +message Allocation { + // the port on which the packet will be sent + string source_port = 1 [(gogoproto.moretags) = "yaml:\"source_port\""]; + // the channel by which the packet will be sent + string source_channel = 2 [(gogoproto.moretags) = "yaml:\"source_channel\""]; + // spend limitation on the channel + repeated cosmos.base.v1beta1.Coin spend_limit = 3 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + // allow list of receivers, an empty allow list permits any receiver address + repeated string allow_list = 4; +} + +// TransferAuthorization allows the grantee to spend up to spend_limit coins from +// the granter's account for ibc transfer on a specific channel +message TransferAuthorization { + option (cosmos_proto.implements_interface) = "Authorization"; + + // port and channel amounts + repeated Allocation allocations = 1 [(gogoproto.nullable) = false]; +} diff --git a/third_party/proto/provenance/exchange/v1/events.proto b/third_party/proto/provenance/exchange/v1/events.proto new file mode 100644 index 0000000..3839b76 --- /dev/null +++ b/third_party/proto/provenance/exchange/v1/events.proto @@ -0,0 +1,161 @@ +syntax = "proto3"; +package provenance.exchange.v1; + +option go_package = "github.com/provenance-io/provenance/x/exchange"; + +option java_package = "io.provenance.exchange.v1"; +option java_multiple_files = true; + +import "cosmos_proto/cosmos.proto"; + +// EventOrderCreated is an event emitted when an order is created. +message EventOrderCreated { + // order_id is the numerical identifier of the order created. + uint64 order_id = 1; + // order_type is the type of order, e.g. "ask" or "bid". + string order_type = 2; + // market_id is the numerical identifier of the market. + uint32 market_id = 3; + // external_id is the order's external id. + string external_id = 4; +} + +// EventOrderCancelled is an event emitted when an order is cancelled. +message EventOrderCancelled { + // order_id is the numerical identifier of the order cancelled. + uint64 order_id = 1; + // cancelled_by is the account that triggered the cancellation of the order. + string cancelled_by = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // market_id is the numerical identifier of the market. + uint32 market_id = 3; + // external_id is the order's external id. + string external_id = 4; +} + +// 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. +message EventOrderFilled { + // order_id is the numerical identifier of the order filled. + uint64 order_id = 1; + // assets is the coins amount string of assets bought/sold for this order. + string assets = 2; + // price is the coins amount string of the price payed/received for this order. + string price = 3; + // fees is the coins amount string of settlement fees paid with this order. + string fees = 4; + // market_id is the numerical identifier of the market. + uint32 market_id = 5; + // external_id is the order's external id. + string external_id = 6; +} + +// EventOrderPartiallyFilled is an event emitted when an order filled in part and still has more left to fill. +message EventOrderPartiallyFilled { + // order_id is the numerical identifier of the order partially filled. + uint64 order_id = 1; + // assets is the coins amount string of assets that were filled and removed from the order. + string assets = 2; + // 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. + string price = 3; + // 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. + string fees = 4; + // market_id is the numerical identifier of the market. + uint32 market_id = 5; + // external_id is the order's external id. + string external_id = 6; +} + +// EventOrderExternalIDUpdated is an event emitted when an order's external id is updated. +message EventOrderExternalIDUpdated { + // order_id is the numerical identifier of the order partially filled. + uint64 order_id = 1; + // market_id is the numerical identifier of the market. + uint32 market_id = 2; + // external_id is the order's new external id. + string external_id = 3; +} + +// EventMarketWithdraw is an event emitted when a withdrawal of a market's collected fees is made. +message EventMarketWithdraw { + // market_id is the numerical identifier of the market. + uint32 market_id = 1; + // amount is the coins amount string of funds withdrawn from the market account. + string amount = 2; + // destination is the account that received the funds. + string destination = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // withdrawn_by is the account that requested the withdrawal. + string withdrawn_by = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// EventMarketDetailsUpdated is an event emitted when a market's details are updated. +message EventMarketDetailsUpdated { + // market_id is the numerical identifier of the market. + uint32 market_id = 1; + // updated_by is the account that updated the details. + string updated_by = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// EventMarketEnabled is an event emitted when a market is enabled. +message EventMarketEnabled { + // market_id is the numerical identifier of the market. + uint32 market_id = 1; + // updated_by is the account that enabled the market. + string updated_by = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// EventMarketDisabled is an event emitted when a market is disabled. +message EventMarketDisabled { + // market_id is the numerical identifier of the market. + uint32 market_id = 1; + // updated_by is the account that disabled the market. + string updated_by = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// EventMarketUserSettleEnabled is an event emitted when a market's user_settle option is enabled. +message EventMarketUserSettleEnabled { + // market_id is the numerical identifier of the market. + uint32 market_id = 1; + // updated_by is the account that updated the user_settle option. + string updated_by = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// EventMarketUserSettleDisabled is an event emitted when a market's user_settle option is disabled. +message EventMarketUserSettleDisabled { + // market_id is the numerical identifier of the market. + uint32 market_id = 1; + // updated_by is the account that updated the user_settle option. + string updated_by = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// EventMarketPermissionsUpdated is an event emitted when a market's permissions are updated. +message EventMarketPermissionsUpdated { + // market_id is the numerical identifier of the market. + uint32 market_id = 1; + // updated_by is the account that updated the permissions. + string updated_by = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// EventMarketReqAttrUpdated is an event emitted when a market's required attributes are updated. +message EventMarketReqAttrUpdated { + // market_id is the numerical identifier of the market. + uint32 market_id = 1; + // updated_by is the account that updated the required attributes. + string updated_by = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// EventMarketCreated is an event emitted when a market has been created. +message EventMarketCreated { + // market_id is the numerical identifier of the market. + uint32 market_id = 1; +} + +// EventMarketFeesUpdated is an event emitted when a market's fees have been updated. +message EventMarketFeesUpdated { + // market_id is the numerical identifier of the market. + uint32 market_id = 1; +} + +// EventParamsUpdated is an event emitted when the exchange module's params have been updated. +message EventParamsUpdated {} \ No newline at end of file diff --git a/third_party/proto/provenance/exchange/v1/genesis.proto b/third_party/proto/provenance/exchange/v1/genesis.proto new file mode 100644 index 0000000..3ccf87d --- /dev/null +++ b/third_party/proto/provenance/exchange/v1/genesis.proto @@ -0,0 +1,33 @@ +syntax = "proto3"; +package provenance.exchange.v1; + +option go_package = "github.com/provenance-io/provenance/x/exchange"; + +option java_package = "io.provenance.exchange.v1"; +option java_multiple_files = true; + +import "gogoproto/gogo.proto"; +import "provenance/exchange/v1/market.proto"; +import "provenance/exchange/v1/orders.proto"; +import "provenance/exchange/v1/params.proto"; + +// GenesisState is the data that should be loaded into the exchange module during genesis. +message GenesisState { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // params defines all the parameters of the exchange module. + Params params = 1; + + // markets are all of the markets to create at genesis. + repeated Market markets = 2 [(gogoproto.nullable) = false]; + + // orders are all the orders to create at genesis. + repeated Order orders = 3 [(gogoproto.nullable) = false]; + + // last_market_id is the value of the last auto-selected market id. + uint32 last_market_id = 4; + + // last_order_id is the value of the last order id created. + uint64 last_order_id = 5; +} \ No newline at end of file diff --git a/third_party/proto/provenance/exchange/v1/market.proto b/third_party/proto/provenance/exchange/v1/market.proto new file mode 100644 index 0000000..7628526 --- /dev/null +++ b/third_party/proto/provenance/exchange/v1/market.proto @@ -0,0 +1,141 @@ +syntax = "proto3"; +package provenance.exchange.v1; + +option go_package = "github.com/provenance-io/provenance/x/exchange"; + +option java_package = "io.provenance.exchange.v1"; +option java_multiple_files = true; + +import "cosmos/auth/v1beta1/auth.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; + +// MarketAccount is an account type for use with the accounts module to hold some basic information about a market. +message MarketAccount { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + // base_account is the base cosmos account information. + cosmos.auth.v1beta1.BaseAccount base_account = 1 [(gogoproto.embed) = true]; + + // market_id is the numerical identifier for this market. + uint32 market_id = 2; + // market_details is some human-consumable information about this market. + MarketDetails market_details = 3 [(gogoproto.nullable) = false]; +} + +// MarketDetails contains information about a market. +message MarketDetails { + option (gogoproto.equal) = true; + + // name is a moniker that people can use to refer to this market. + string name = 1; + // description extra information about this market. The field is meant to be human-readable. + string description = 2; + // website_url is a url people can use to get to this market, or at least get more information about this market. + string website_url = 3; + // icon_uri is a uri for an icon to associate with this market. + string icon_uri = 4; +} + +// MarketBrief is a message containing brief, superficial information about a market. +message MarketBrief { + // market_id is the numerical identifier for this market. + uint32 market_id = 1; + // market_address is the bech32 address string of this market's account. + string market_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // market_details is some information about this market. + MarketDetails market_details = 3 [(gogoproto.nullable) = false]; +} + +// Market contains all information about a market. +message Market { + // market_id is the numerical identifier for this market. + uint32 market_id = 1; + // market_details is some information about this market. + MarketDetails market_details = 2 [(gogoproto.nullable) = false]; + // 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. + repeated cosmos.base.v1beta1.Coin fee_create_ask_flat = 3 [(gogoproto.nullable) = false]; + // 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. + repeated cosmos.base.v1beta1.Coin fee_create_bid_flat = 4 [(gogoproto.nullable) = false]; + // 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. + repeated cosmos.base.v1beta1.Coin fee_seller_settlement_flat = 5 [(gogoproto.nullable) = false]; + // 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. + repeated FeeRatio fee_seller_settlement_ratios = 6 [(gogoproto.nullable) = false]; + // 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. + repeated cosmos.base.v1beta1.Coin fee_buyer_settlement_flat = 7 [(gogoproto.nullable) = false]; + // 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. + repeated FeeRatio fee_buyer_settlement_ratios = 8 [(gogoproto.nullable) = false]; + // accepting_orders is whether this market is allowing orders to be created for it. + bool accepting_orders = 9; + // 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. + bool allow_user_settlement = 10; + // access_grants is the list of addresses and permissions granted for this market. + repeated AccessGrant access_grants = 11 [(gogoproto.nullable) = false]; + // 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". + repeated string req_attr_create_ask = 12; + // 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". + repeated string req_attr_create_bid = 13; +} + +// 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. +message FeeRatio { + option (gogoproto.goproto_stringer) = false; + // price is the unit the order price is divided by to get how much of the fee should apply. + cosmos.base.v1beta1.Coin price = 1 [(gogoproto.nullable) = false]; + // fee is the amount to charge per price unit. + cosmos.base.v1beta1.Coin fee = 2 [(gogoproto.nullable) = false]; +} + +// AddrPermissions associates an address with a list of permissions available for that address. +message AccessGrant { + // address is the address that these permissions apply to. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // allowed is the list of permissions available for the address. + repeated Permission permissions = 2; +} + +// Permission defines the different types of permission that can be given to an account for a market. +enum Permission { + // PERMISSION_UNSPECIFIED is the zero-value Permission; it is an error to use it. + PERMISSION_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "unspecified"]; + // PERMISSION_SETTLE is the ability to use the Settle Tx endpoint on behalf of a market. + PERMISSION_SETTLE = 1 [(gogoproto.enumvalue_customname) = "settle"]; + // PERMISSION_SET_IDS is the ability to use the SetOrderExternalID Tx endpoint on behalf of a market. + PERMISSION_SET_IDS = 2 [(gogoproto.enumvalue_customname) = "set_ids"]; + // PERMISSION_CANCEL is the ability to use the Cancel Tx endpoint on behalf of a market. + PERMISSION_CANCEL = 3 [(gogoproto.enumvalue_customname) = "cancel"]; + // PERMISSION_WITHDRAW is the ability to use the MarketWithdraw Tx endpoint. + PERMISSION_WITHDRAW = 4 [(gogoproto.enumvalue_customname) = "withdraw"]; + // PERMISSION_UPDATE is the ability to use the MarketUpdate* Tx endpoints. + PERMISSION_UPDATE = 5 [(gogoproto.enumvalue_customname) = "update"]; + // PERMISSION_PERMISSIONS is the ability to use the MarketManagePermissions Tx endpoint. + PERMISSION_PERMISSIONS = 6 [(gogoproto.enumvalue_customname) = "permissions"]; + // PERMISSION_ATTRIBUTES is the ability to use the MarketManageReqAttrs Tx endpoint. + PERMISSION_ATTRIBUTES = 7 [(gogoproto.enumvalue_customname) = "attributes"]; +} \ No newline at end of file diff --git a/third_party/proto/provenance/exchange/v1/orders.proto b/third_party/proto/provenance/exchange/v1/orders.proto new file mode 100644 index 0000000..538dbdc --- /dev/null +++ b/third_party/proto/provenance/exchange/v1/orders.proto @@ -0,0 +1,78 @@ +syntax = "proto3"; +package provenance.exchange.v1; + +option go_package = "github.com/provenance-io/provenance/x/exchange"; + +option java_package = "io.provenance.exchange.v1"; +option java_multiple_files = true; + +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; + +// Order associates an order id with one of the order types. +message Order { + option (gogoproto.goproto_getters) = false; + + // order_id is the numerical identifier for this order. + uint64 order_id = 1; + // order is the specifics of this order. + oneof order { + // ask_order is the information about this order if it represents an ask order. + AskOrder ask_order = 2; + // bid_order is the information about this order if it represents a bid order. + BidOrder bid_order = 3; + } +} + +// AskOrder represents someone's desire to sell something at a minimum price. +message AskOrder { + option (gogoproto.goproto_getters) = false; + + // market_id identifies the market that this order belongs to. + uint32 market_id = 1; + // seller is the address of the account that owns this order and has the assets to sell. + string seller = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // assets are the things that the seller wishes to sell. + // A hold is placed on this until the order is filled or cancelled. + cosmos.base.v1beta1.Coin assets = 3 [(gogoproto.nullable) = false]; + // 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. + cosmos.base.v1beta1.Coin price = 4 [(gogoproto.nullable) = false]; + // 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. + cosmos.base.v1beta1.Coin seller_settlement_flat_fee = 5; + // 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. + bool allow_partial = 6; + // 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. + string external_id = 7; +} + +// BidOrder represents someone's desire to buy something at a specific price. +message BidOrder { + option (gogoproto.goproto_getters) = false; + + // market_id identifies the market that this order belongs to. + uint32 market_id = 1; + // buyer is the address of the account that owns this order and has the price to spend. + string buyer = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // assets are the things that the buyer wishes to buy. + cosmos.base.v1beta1.Coin assets = 3 [(gogoproto.nullable) = false]; + // 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. + cosmos.base.v1beta1.Coin price = 4 [(gogoproto.nullable) = false]; + // 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. + repeated cosmos.base.v1beta1.Coin buyer_settlement_fees = 5 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + // 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. + bool allow_partial = 6; + // 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. + string external_id = 7; +} \ No newline at end of file diff --git a/third_party/proto/provenance/exchange/v1/params.proto b/third_party/proto/provenance/exchange/v1/params.proto new file mode 100644 index 0000000..73fb396 --- /dev/null +++ b/third_party/proto/provenance/exchange/v1/params.proto @@ -0,0 +1,28 @@ +syntax = "proto3"; +package provenance.exchange.v1; + +option go_package = "github.com/provenance-io/provenance/x/exchange"; + +option java_package = "io.provenance.exchange.v1"; +option java_multiple_files = true; + +import "gogoproto/gogo.proto"; + +// Params is a representation of the exchange module parameters. +message 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. + uint32 default_split = 1; + // denom_splits are the denom-specific amounts the exchange receives. + repeated DenomSplit denom_splits = 2 [(gogoproto.nullable) = false]; +} + +// DenomSplit associates a coin denomination with an amount the exchange receives for that denom. +message DenomSplit { + // denom is the coin denomination this split applies to. + string denom = 1; + // split is the proportion of fees the exchange receives for this denom in basis points. + // E.g. 100 = 1%. Min = 0, Max = 10000. + uint32 split = 2; +} \ No newline at end of file diff --git a/third_party/proto/provenance/exchange/v1/query.proto b/third_party/proto/provenance/exchange/v1/query.proto new file mode 100644 index 0000000..22eeb4b --- /dev/null +++ b/third_party/proto/provenance/exchange/v1/query.proto @@ -0,0 +1,317 @@ +syntax = "proto3"; +package provenance.exchange.v1; + +option go_package = "github.com/provenance-io/provenance/x/exchange"; + +option java_package = "io.provenance.exchange.v1"; +option java_multiple_files = true; + +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "google/api/annotations.proto"; +import "gogoproto/gogo.proto"; +import "provenance/exchange/v1/market.proto"; +import "provenance/exchange/v1/orders.proto"; +import "provenance/exchange/v1/params.proto"; +import "provenance/exchange/v1/tx.proto"; + +// Query is the service for exchange module's query endpoints. +service Query { + // OrderFeeCalc calculates the fees that will be associated with the provided order. + rpc OrderFeeCalc(QueryOrderFeeCalcRequest) returns (QueryOrderFeeCalcResponse) { + option (google.api.http).get = "/provenance/exchange/v1/fees/order"; + } + + // GetOrder looks up an order by id. + rpc GetOrder(QueryGetOrderRequest) returns (QueryGetOrderResponse) { + option (google.api.http).get = "/provenance/exchange/v1/order/{order_id}"; + } + + // GetOrderByExternalID looks up an order by market id and external id. + rpc GetOrderByExternalID(QueryGetOrderByExternalIDRequest) returns (QueryGetOrderByExternalIDResponse) { + option (google.api.http) = { + get: "/provenance/exchange/v1/orders/market/{market_id}/{external_id}" + additional_bindings: {get: "/provenance/exchange/v1/market/{market_id}/order/{external_id}"} + }; + } + + // GetMarketOrders looks up the orders in a market. + rpc GetMarketOrders(QueryGetMarketOrdersRequest) returns (QueryGetMarketOrdersResponse) { + option (google.api.http) = { + get: "/provenance/exchange/v1/orders/market/{market_id}" + additional_bindings: {get: "/provenance/exchange/v1/market/{market_id}/orders"} + }; + } + + // GetOwnerOrders looks up the orders from the provided owner address. + rpc GetOwnerOrders(QueryGetOwnerOrdersRequest) returns (QueryGetOwnerOrdersResponse) { + option (google.api.http).get = "/provenance/exchange/v1/orders/owner/{owner}"; + } + + // GetAssetOrders looks up the orders for a specific asset denom. + rpc GetAssetOrders(QueryGetAssetOrdersRequest) returns (QueryGetAssetOrdersResponse) { + option (google.api.http).get = "/provenance/exchange/v1/orders/asset/{asset}"; + } + + // GetAllOrders gets all orders in the exchange module. + rpc GetAllOrders(QueryGetAllOrdersRequest) returns (QueryGetAllOrdersResponse) { + option (google.api.http).get = "/provenance/exchange/v1/orders"; + } + + // GetMarket returns all the information and details about a market. + rpc GetMarket(QueryGetMarketRequest) returns (QueryGetMarketResponse) { + option (google.api.http).get = "/provenance/exchange/v1/market/{market_id}"; + } + + // GetAllMarkets returns brief information about each market. + rpc GetAllMarkets(QueryGetAllMarketsRequest) returns (QueryGetAllMarketsResponse) { + option (google.api.http).get = "/provenance/exchange/v1/markets"; + } + + // Params returns the exchange module parameters. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/provenance/exchange/v1/params"; + } + + // ValidateCreateMarket checks the provided MsgGovCreateMarketResponse and returns any errors it might have. + rpc ValidateCreateMarket(QueryValidateCreateMarketRequest) returns (QueryValidateCreateMarketResponse) { + option (google.api.http).get = "/provenance/exchange/v1/validate/create_market"; + } + + // ValidateMarket checks for any problems with a market's setup. + rpc ValidateMarket(QueryValidateMarketRequest) returns (QueryValidateMarketResponse) { + option (google.api.http) = { + get: "/provenance/exchange/v1/validate/market/{market_id}" + additional_bindings: {get: "/provenance/exchange/v1/market/{market_id}/validate"} + }; + } + + // ValidateManageFees checks the provided MsgGovManageFeesRequest and returns any errors that it might have. + rpc ValidateManageFees(QueryValidateManageFeesRequest) returns (QueryValidateManageFeesResponse) { + option (google.api.http).get = "/provenance/exchange/v1/validate/manage_fees"; + } +} + +// QueryOrderFeeCalcRequest is a request message for the OrderFeeCalc query. +// Exactly one of ask_order or bid_order must be provided. +message QueryOrderFeeCalcRequest { + // ask_order is the ask order to calculate the fees for. + AskOrder ask_order = 2; + // bid_order is the bid order to calculate the fees for. + BidOrder bid_order = 3; +} + +// QueryOrderFeeCalcResponse is a response message for the OrderFeeCalc query. +message 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. + repeated cosmos.base.v1beta1.Coin creation_fee_options = 1 [(gogoproto.nullable) = false]; + // 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. + repeated cosmos.base.v1beta1.Coin settlement_flat_fee_options = 2 [(gogoproto.nullable) = false]; + // 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. + repeated cosmos.base.v1beta1.Coin settlement_ratio_fee_options = 3 [(gogoproto.nullable) = false]; +} + +// QueryGetOrderRequest is a request message for the GetOrder query. +message QueryGetOrderRequest { + // order_id is the id of the order to look up. + uint64 order_id = 1; +} + +// QueryGetOrderResponse is a response message for the GetOrder query. +message QueryGetOrderResponse { + // order is the requested order. + Order order = 1; +} + +// QueryGetOrderByExternalIDRequest is a request message for the GetOrderByExternalID query. +message QueryGetOrderByExternalIDRequest { + // market_id is the id of the market that's expected to have the order. + uint32 market_id = 1; + // external_id the external id to look up. + string external_id = 2; +} + +// QueryGetOrderByExternalIDResponse is a response message for the GetOrderByExternalID query. +message QueryGetOrderByExternalIDResponse { + // order is the requested order. + Order order = 1; +} + +// QueryGetMarketOrdersRequest is a request message for the GetMarketOrders query. +message QueryGetMarketOrdersRequest { + // market_id is the id of the market to get all the orders for. + uint32 market_id = 1; + // order_type is optional and can limit orders to only "ask" or "bid" orders. + string order_type = 2; + // after_order_id is a minimum (exclusive) order id. All results will be strictly greater than this. + uint64 after_order_id = 3; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 99; +} + +// QueryGetMarketOrdersResponse is a response message for the GetMarketOrders query. +message QueryGetMarketOrdersResponse { + // orders are a page of the orders in the provided market. + repeated Order orders = 1; + + // pagination is the resulting pagination parameters. + cosmos.base.query.v1beta1.PageResponse pagination = 99; +} + +// QueryGetOwnerOrdersRequest is a request message for the GetOwnerOrders query. +message QueryGetOwnerOrdersRequest { + // owner is the bech32 address string of the owner to get the orders for. + string owner = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // order_type is optional and can limit orders to only "ask" or "bid" orders. + string order_type = 2; + // after_order_id is a minimum (exclusive) order id. All results will be strictly greater than this. + uint64 after_order_id = 3; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 99; +} + +// QueryGetOwnerOrdersResponse is a response message for the GetOwnerOrders query. +message QueryGetOwnerOrdersResponse { + // orders are a page of the orders for the provided address. + repeated Order orders = 1; + + // pagination is the resulting pagination parameters. + cosmos.base.query.v1beta1.PageResponse pagination = 99; +} + +// QueryGetAssetOrdersRequest is a request message for the GetAssetOrders query. +message QueryGetAssetOrdersRequest { + // asset is the denom of assets to get orders for. + string asset = 1; + // order_type is optional and can limit orders to only "ask" or "bid" orders. + string order_type = 2; + // after_order_id is a minimum (exclusive) order id. All results will be strictly greater than this. + uint64 after_order_id = 3; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 99; +} + +// QueryGetAssetOrdersResponse is a response message for the GetAssetOrders query. +message QueryGetAssetOrdersResponse { + // orders are a page of the orders for the provided asset. + repeated Order orders = 1; + + // pagination is the resulting pagination parameters. + cosmos.base.query.v1beta1.PageResponse pagination = 99; +} + +// QueryGetAllOrdersRequest is a request message for the GetAllOrders query. +message QueryGetAllOrdersRequest { + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 99; +} + +// QueryGetAllOrdersResponse is a response message for the GetAllOrders query. +message QueryGetAllOrdersResponse { + // orders are a page of the all orders. + repeated Order orders = 1; + + // pagination is the resulting pagination parameters. + cosmos.base.query.v1beta1.PageResponse pagination = 99; +} + +// QueryGetMarketRequest is a request message for the GetMarket query. +message QueryGetMarketRequest { + // market_id is the id of the market to look up. + uint32 market_id = 1; +} + +// QueryGetMarketResponse is a response message for the GetMarket query. +message QueryGetMarketResponse { + // address is the bech32 address string of this market's account. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // market is all information and details of the market. + Market market = 2; +} + +// QueryGetAllMarketsRequest is a request message for the GetAllMarkets query. +message QueryGetAllMarketsRequest { + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 99; +} + +// QueryGetAllMarketsResponse is a response message for the GetAllMarkets query. +message QueryGetAllMarketsResponse { + // markets are a page of the briefs for all markets. + repeated MarketBrief markets = 1; + + // pagination is the resulting pagination parameters. + cosmos.base.query.v1beta1.PageResponse pagination = 99; +} + +// QueryParamsRequest is a request message for the Params query. +message QueryParamsRequest {} + +// QueryParamsResponse is a response message for the Params query. +message QueryParamsResponse { + // params are the exchange module parameter values. + Params params = 1; +} + +// QueryValidateCreateMarketRequest is a request message for the ValidateCreateMarket query. +message QueryValidateCreateMarketRequest { + // create_market_request is the request to run validation on. + MsgGovCreateMarketRequest create_market_request = 1; +} + +// QueryValidateCreateMarketResponse is a response message for the ValidateCreateMarket query. +message 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. + string error = 1; + // 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). + bool gov_prop_will_pass = 2; +} + +// QueryValidateMarketRequest is a request message for the ValidateMarket query. +message QueryValidateMarketRequest { + // market_id is the id of the market to check. + uint32 market_id = 1; +} + +// QueryValidateMarketResponse is a response message for the ValidateMarket query. +message QueryValidateMarketResponse { + // error is any problems or inconsistencies in the provided market. + string error = 1; +} + +// QueryValidateManageFeesRequest is a request message for the ValidateManageFees query. +message QueryValidateManageFeesRequest { + // manage_fees_request is the request to run validation on. + MsgGovManageFeesRequest manage_fees_request = 1; +} + +// QueryValidateManageFeesResponse is a response message for the ValidateManageFees query. +message 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. + string error = 1; + // 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). + bool gov_prop_will_pass = 2; +} diff --git a/third_party/proto/provenance/exchange/v1/tx.proto b/third_party/proto/provenance/exchange/v1/tx.proto new file mode 100644 index 0000000..d5a18ba --- /dev/null +++ b/third_party/proto/provenance/exchange/v1/tx.proto @@ -0,0 +1,389 @@ +syntax = "proto3"; +package provenance.exchange.v1; + +option go_package = "github.com/provenance-io/provenance/x/exchange"; + +option java_package = "io.provenance.exchange.v1"; +option java_multiple_files = true; + +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/msg/v1/msg.proto"; +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "provenance/exchange/v1/market.proto"; +import "provenance/exchange/v1/orders.proto"; +import "provenance/exchange/v1/params.proto"; + +// Msg is the service for exchange module's tx endpoints. +service Msg { + // CreateAsk creates an ask order (to sell something you own). + rpc CreateAsk(MsgCreateAskRequest) returns (MsgCreateAskResponse); + + // CreateBid creates a bid order (to buy something you want). + rpc CreateBid(MsgCreateBidRequest) returns (MsgCreateBidResponse); + + // CancelOrder cancels an order. + rpc CancelOrder(MsgCancelOrderRequest) returns (MsgCancelOrderResponse); + + // FillBids uses the assets in your account to fulfill one or more bids (similar to a fill-or-cancel ask). + rpc FillBids(MsgFillBidsRequest) returns (MsgFillBidsResponse); + + // FillAsks uses the funds in your account to fulfill one or more asks (similar to a fill-or-cancel bid). + rpc FillAsks(MsgFillAsksRequest) returns (MsgFillAsksResponse); + + // MarketSettle is a market endpoint to trigger the settlement of orders. + rpc MarketSettle(MsgMarketSettleRequest) returns (MsgMarketSettleResponse); + + // MarketSetOrderExternalID updates an order's external id field. + rpc MarketSetOrderExternalID(MsgMarketSetOrderExternalIDRequest) returns (MsgMarketSetOrderExternalIDResponse); + + // MarketWithdraw is a market endpoint to withdraw fees that have been collected. + rpc MarketWithdraw(MsgMarketWithdrawRequest) returns (MsgMarketWithdrawResponse); + + // MarketUpdateDetails is a market endpoint to update its details. + rpc MarketUpdateDetails(MsgMarketUpdateDetailsRequest) returns (MsgMarketUpdateDetailsResponse); + + // MarketUpdateEnabled is a market endpoint to update whether its accepting orders. + rpc MarketUpdateEnabled(MsgMarketUpdateEnabledRequest) returns (MsgMarketUpdateEnabledResponse); + + // MarketUpdateUserSettle is a market endpoint to update whether it allows user-initiated settlement. + rpc MarketUpdateUserSettle(MsgMarketUpdateUserSettleRequest) returns (MsgMarketUpdateUserSettleResponse); + + // MarketManagePermissions is a market endpoint to manage a market's user permissions. + rpc MarketManagePermissions(MsgMarketManagePermissionsRequest) returns (MsgMarketManagePermissionsResponse); + + // MarketManageReqAttrs is a market endpoint to manage the attributes required to interact with it. + rpc MarketManageReqAttrs(MsgMarketManageReqAttrsRequest) returns (MsgMarketManageReqAttrsResponse); + + // GovCreateMarket is a governance proposal endpoint for creating a market. + rpc GovCreateMarket(MsgGovCreateMarketRequest) returns (MsgGovCreateMarketResponse); + + // GovManageFees is a governance proposal endpoint for updating a market's fees. + rpc GovManageFees(MsgGovManageFeesRequest) returns (MsgGovManageFeesResponse); + + // GovUpdateParams is a governance proposal endpoint for updating the exchange module's params. + rpc GovUpdateParams(MsgGovUpdateParamsRequest) returns (MsgGovUpdateParamsResponse); +} + +// MsgCreateAskRequest is a request message for the CreateAsk endpoint. +message MsgCreateAskRequest { + option (cosmos.msg.v1.signer) = "ask_order.seller"; + + // ask_order is the details of the order being created. + AskOrder ask_order = 1 [(gogoproto.nullable) = false]; + // order_creation_fee is the fee that is being paid to create this order. + cosmos.base.v1beta1.Coin order_creation_fee = 2; +} + +// MsgCreateAskResponse is a response message for the CreateAsk endpoint. +message MsgCreateAskResponse { + // order_id is the id of the order created. + uint64 order_id = 1; +} + +// MsgCreateBidRequest is a request message for the CreateBid endpoint. +message MsgCreateBidRequest { + option (cosmos.msg.v1.signer) = "bid_order.buyer"; + + // bid_order is the details of the order being created. + BidOrder bid_order = 1 [(gogoproto.nullable) = false]; + // order_creation_fee is the fee that is being paid to create this order. + cosmos.base.v1beta1.Coin order_creation_fee = 2; +} + +// MsgCreateBidResponse is a response message for the CreateBid endpoint. +message MsgCreateBidResponse { + // order_id is the id of the order created. + uint64 order_id = 1; +} + +// MsgCancelOrderRequest is a request message for the CancelOrder endpoint. +message MsgCancelOrderRequest { + option (cosmos.msg.v1.signer) = "signer"; + + // signer is the account requesting the order cancelation. + // 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. + string signer = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // order_id is the id of the order to cancel. + uint64 order_id = 2; +} + +// MsgCancelOrderResponse is a response message for the CancelOrder endpoint. +message MsgCancelOrderResponse {} + +// MsgFillBidsRequest is a request message for the FillBids endpoint. +message MsgFillBidsRequest { + option (cosmos.msg.v1.signer) = "seller"; + + // seller is the address of the account with the assets to sell. + string seller = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // market_id is the numerical identifier of the market with the bids to fill. + // All bid orders being filled must be in this market. + uint32 market_id = 2; + // total_assets are the things that the seller wishes to sell. + // It must be the sum of all bid order assets. + repeated cosmos.base.v1beta1.Coin total_assets = 3 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + // 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. + repeated uint64 bid_order_ids = 4; + // seller_settlement_flat_fee is the flat fee for sellers that will be charged for this settlement. + cosmos.base.v1beta1.Coin seller_settlement_flat_fee = 5; + // ask_order_creation_fee is the fee that is being paid to create this order (which is immediately then settled). + cosmos.base.v1beta1.Coin ask_order_creation_fee = 6; +} + +// MsgFillBidsResponse is a response message for the FillBids endpoint. +message MsgFillBidsResponse {} + +// MsgFillAsksRequest is a request message for the FillAsks endpoint. +message MsgFillAsksRequest { + option (cosmos.msg.v1.signer) = "buyer"; + + // buyer is the address of the account attempting to buy some assets. + string buyer = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // market_id is the numerical identifier of the market with the asks to fill. + // All ask orders being filled must be in this market. + uint32 market_id = 2; + // total_price is the total amount being spent on some assets. + // It must be the sum of all ask order prices. + cosmos.base.v1beta1.Coin total_price = 3 [(gogoproto.nullable) = false]; + // 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. + repeated uint64 ask_order_ids = 4; + // buyer_settlement_fees are the fees (both flat and proportional) that the buyer will pay (in addition to the price) + // for this settlement. + repeated cosmos.base.v1beta1.Coin buyer_settlement_fees = 5 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + // bid_order_creation_fee is the fee that is being paid to create this order (which is immediately then settled). + cosmos.base.v1beta1.Coin bid_order_creation_fee = 6; +} + +// MsgFillAsksResponse is a response message for the FillAsks endpoint. +message MsgFillAsksResponse {} + +// MsgMarketSettleRequest is a request message for the MarketSettle endpoint. +message MsgMarketSettleRequest { + option (cosmos.msg.v1.signer) = "admin"; + + // admin is the account with "settle" permission requesting this settlement. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // market_id is the numerical identifier of the market to update required attributes for. + uint32 market_id = 2; + + // ask_order_ids are the ask orders being filled. + repeated uint64 ask_order_ids = 3; + // bid_order_ids are the bid orders being filled. + repeated uint64 bid_order_ids = 4; + // 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. + bool expect_partial = 5; +} + +// MsgMarketSettleResponse is a response message for the MarketSettle endpoint. +message MsgMarketSettleResponse {} + +// MsgMarketSetOrderExternalIDRequest is a request message for the MarketSetOrderExternalID endpoint. +message MsgMarketSetOrderExternalIDRequest { + option (cosmos.msg.v1.signer) = "admin"; + + // admin is the account with "set_ids" permission requesting this settlement. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // market_id is the numerical identifier of the market to update required attributes for. + uint32 market_id = 2; + + // order_id is the numerical identifier of the order to update. + uint64 order_id = 3; + // 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. + string external_id = 4; +} + +// MsgMarketSetOrderExternalIDResponse is a response message for the MarketSetOrderExternalID endpoint. +message MsgMarketSetOrderExternalIDResponse {} + +// MsgMarketWithdrawRequest is a request message for the MarketWithdraw endpoint. +message MsgMarketWithdrawRequest { + option (cosmos.msg.v1.signer) = "admin"; + + // admin is the account with withdraw permission requesting the withdrawal. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // market_id is the numerical identifier of the market to withdraw from. + uint32 market_id = 2; + + // to_address is the address that will receive the funds. + string to_address = 3; + // amount is the funds to withdraw. + repeated cosmos.base.v1beta1.Coin amount = 4 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; +} + +// MsgMarketWithdrawResponse is a response message for the MarketWithdraw endpoint. +message MsgMarketWithdrawResponse {} + +// MsgMarketUpdateDetailsRequest is a request message for the MarketUpdateDetails endpoint. +message MsgMarketUpdateDetailsRequest { + option (cosmos.msg.v1.signer) = "admin"; + + // admin is the account with "update" permission requesting this change. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // market_id is the numerical identifier of the market to update required attributes for. + uint32 market_id = 2; + + // market_details is some information about this market. + MarketDetails market_details = 3 [(gogoproto.nullable) = false]; +} + +// MsgMarketUpdateDetailsResponse is a response message for the MarketUpdateDetails endpoint. +message MsgMarketUpdateDetailsResponse {} + +// MsgMarketUpdateEnabledRequest is a request message for the MarketUpdateEnabled endpoint. +message MsgMarketUpdateEnabledRequest { + option (cosmos.msg.v1.signer) = "admin"; + + // admin is the account with "update" permission requesting this change. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // market_id is the numerical identifier of the market to update required attributes for. + uint32 market_id = 2; + + // accepting_orders is whether this market is allowing orders to be created for it. + bool accepting_orders = 3; +} + +// MsgMarketUpdateEnabledResponse is a response message for the MarketUpdateEnabled endpoint. +message MsgMarketUpdateEnabledResponse {} + +// MsgMarketUpdateUserSettleRequest is a request message for the MarketUpdateUserSettle endpoint. +message MsgMarketUpdateUserSettleRequest { + option (cosmos.msg.v1.signer) = "admin"; + + // admin is the account with "update" permission requesting this change. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // market_id is the numerical identifier of the market to update required attributes for. + uint32 market_id = 2; + + // 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. + bool allow_user_settlement = 3; +} + +// MsgMarketUpdateUserSettleResponse is a response message for the MarketUpdateUserSettle endpoint. +message MsgMarketUpdateUserSettleResponse {} + +// MsgMarketManagePermissionsRequest is a request message for the MarketManagePermissions endpoint. +message MsgMarketManagePermissionsRequest { + option (cosmos.msg.v1.signer) = "admin"; + + // admin is the account with "permissions" permission requesting this change. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // market_id is the numerical identifier of the market to update required attributes for. + uint32 market_id = 2; + + // revoke_all are addresses that should have all their permissions revoked. + repeated string revoke_all = 3; + // to_revoke are the specific permissions to remove for addresses. + repeated AccessGrant to_revoke = 4 [(gogoproto.nullable) = false]; + // to_grant are the permissions to grant to addresses. + repeated AccessGrant to_grant = 5 [(gogoproto.nullable) = false]; +} + +// MsgMarketManagePermissionsResponse is a response message for the MarketManagePermissions endpoint. +message MsgMarketManagePermissionsResponse {} + +// MsgMarketManageReqAttrsRequest is a request message for the MarketManageReqAttrs endpoint. +message MsgMarketManageReqAttrsRequest { + option (cosmos.msg.v1.signer) = "admin"; + + // admin is the account with "attributes" permission requesting this change. + string admin = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // market_id is the numerical identifier of the market to update required attributes for. + uint32 market_id = 2; + + // create_ask_to_add are the attributes that should now also be required to create an ask order. + repeated string create_ask_to_add = 3; + // create_ask_to_remove are the attributes that should no longer be required to create an ask order. + repeated string create_ask_to_remove = 4; + // create_bid_to_add are the attributes that should now also be required to create a bid order. + repeated string create_bid_to_add = 5; + // create_bid_to_remove are the attributes that should no longer be required to create a bid order. + repeated string create_bid_to_remove = 6; +} + +// MsgMarketManageReqAttrsResponse is a response message for the MarketManageReqAttrs endpoint. +message MsgMarketManageReqAttrsResponse {} + +// MsgGovCreateMarketRequest is a request message for the GovCreateMarket endpoint. +message MsgGovCreateMarketRequest { + option (cosmos.msg.v1.signer) = "authority"; + + // authority should be the governance module account address. + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // 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. + Market market = 2 [(gogoproto.nullable) = false]; +} + +// MsgGovCreateMarketResponse is a response message for the GovCreateMarket endpoint. +message MsgGovCreateMarketResponse {} + +// MsgGovManageFeesRequest is a request message for the GovManageFees endpoint. +message MsgGovManageFeesRequest { + option (cosmos.msg.v1.signer) = "authority"; + + // authority should be the governance module account address. + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // market_id is the market id that will get these fee updates. + uint32 market_id = 2; + + // add_fee_create_ask_flat are the create-ask flat fee options to add. + repeated cosmos.base.v1beta1.Coin add_fee_create_ask_flat = 3 [(gogoproto.nullable) = false]; + // remove_fee_create_ask_flat are the create-ask flat fee options to remove. + repeated cosmos.base.v1beta1.Coin remove_fee_create_ask_flat = 4 [(gogoproto.nullable) = false]; + + // add_fee_create_bid_flat are the create-bid flat fee options to add. + repeated cosmos.base.v1beta1.Coin add_fee_create_bid_flat = 5 [(gogoproto.nullable) = false]; + // remove_fee_create_bid_flat are the create-bid flat fee options to remove. + repeated cosmos.base.v1beta1.Coin remove_fee_create_bid_flat = 6 [(gogoproto.nullable) = false]; + + // add_fee_seller_settlement_flat are the seller settlement flat fee options to add. + repeated cosmos.base.v1beta1.Coin add_fee_seller_settlement_flat = 7 [(gogoproto.nullable) = false]; + // remove_fee_seller_settlement_flat are the seller settlement flat fee options to remove. + repeated cosmos.base.v1beta1.Coin remove_fee_seller_settlement_flat = 8 [(gogoproto.nullable) = false]; + + // add_fee_seller_settlement_ratios are the seller settlement fee ratios to add. + repeated FeeRatio add_fee_seller_settlement_ratios = 9 [(gogoproto.nullable) = false]; + // remove_fee_seller_settlement_ratios are the seller settlement fee ratios to remove. + repeated FeeRatio remove_fee_seller_settlement_ratios = 10 [(gogoproto.nullable) = false]; + + // add_fee_buyer_settlement_flat are the buyer settlement flat fee options to add. + repeated cosmos.base.v1beta1.Coin add_fee_buyer_settlement_flat = 11 [(gogoproto.nullable) = false]; + // remove_fee_buyer_settlement_flat are the buyer settlement flat fee options to remove. + repeated cosmos.base.v1beta1.Coin remove_fee_buyer_settlement_flat = 12 [(gogoproto.nullable) = false]; + + // add_fee_buyer_settlement_ratios are the buyer settlement fee ratios to add. + repeated FeeRatio add_fee_buyer_settlement_ratios = 13 [(gogoproto.nullable) = false]; + // remove_fee_buyer_settlement_ratios are the buyer settlement fee ratios to remove. + repeated FeeRatio remove_fee_buyer_settlement_ratios = 14 [(gogoproto.nullable) = false]; +} + +// MsgGovManageFeesResponse is a response message for the GovManageFees endpoint. +message MsgGovManageFeesResponse {} + +// MsgGovUpdateParamsRequest is a request message for the GovUpdateParams endpoint. +message MsgGovUpdateParamsRequest { + option (cosmos.msg.v1.signer) = "authority"; + + // authority should be the governance module account address. + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params are the new param values to set + Params params = 2 [(gogoproto.nullable) = false]; +} + +// MsgGovUpdateParamsResponse is a response message for the GovUpdateParams endpoint. +message MsgGovUpdateParamsResponse {} diff --git a/third_party/proto/provenance/hold/v1/events.proto b/third_party/proto/provenance/hold/v1/events.proto new file mode 100644 index 0000000..726bc54 --- /dev/null +++ b/third_party/proto/provenance/hold/v1/events.proto @@ -0,0 +1,27 @@ +syntax = "proto3"; +package provenance.hold.v1; + +option go_package = "github.com/provenance-io/provenance/x/hold"; + +option java_package = "io.provenance.hold.v1"; +option java_multiple_files = true; + +import "cosmos_proto/cosmos.proto"; + +// EventHoldAdded is an event indicating that some funds were placed on hold in an account. +message EventHoldAdded { + // address is the bech32 address string of the account with the funds. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // amount is a Coins string of the funds placed on hold. + string amount = 2; + // reason is a human-readable indicator of why this hold was added. + string reason = 3; +} + +// EventHoldReleased is an event indicating that some funds were released from hold for an account. +message EventHoldReleased { + // address is the bech32 address string of the account with the funds. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // amount is a Coins string of the funds released from hold. + string amount = 2; +} \ No newline at end of file diff --git a/third_party/proto/provenance/hold/v1/genesis.proto b/third_party/proto/provenance/hold/v1/genesis.proto new file mode 100644 index 0000000..3a02feb --- /dev/null +++ b/third_party/proto/provenance/hold/v1/genesis.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; +package provenance.hold.v1; + +option go_package = "github.com/provenance-io/provenance/x/hold"; + +option java_package = "io.provenance.hold.v1"; +option java_multiple_files = true; + +import "gogoproto/gogo.proto"; +import "provenance/hold/v1/hold.proto"; + +// GenesisState defines the attribute module's genesis state. +message GenesisState { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // holds defines the funds on hold at genesis. + repeated AccountHold holds = 1; +} diff --git a/third_party/proto/provenance/hold/v1/hold.proto b/third_party/proto/provenance/hold/v1/hold.proto new file mode 100644 index 0000000..1522d04 --- /dev/null +++ b/third_party/proto/provenance/hold/v1/hold.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; +package provenance.hold.v1; + +option go_package = "github.com/provenance-io/provenance/x/hold"; + +option java_package = "io.provenance.hold.v1"; +option java_multiple_files = true; + +import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; + +// AccountHold associates an address with an amount on hold for that address. +message AccountHold { + // address is the account address that holds the funds on hold. + string address = 1; + // amount is the balances that are on hold for the address. + repeated cosmos.base.v1beta1.Coin amount = 2 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; +} \ No newline at end of file diff --git a/third_party/proto/provenance/hold/v1/query.proto b/third_party/proto/provenance/hold/v1/query.proto new file mode 100644 index 0000000..af07a53 --- /dev/null +++ b/third_party/proto/provenance/hold/v1/query.proto @@ -0,0 +1,62 @@ +syntax = "proto3"; +package provenance.hold.v1; + +option go_package = "github.com/provenance-io/provenance/x/hold"; + +option java_package = "io.provenance.hold.v1"; +option java_multiple_files = true; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "provenance/hold/v1/hold.proto"; + +// Query defines the gRPC querier service for attribute module. +service Query { + // GetHolds looks up the funds that are on hold for an address. + rpc GetHolds(GetHoldsRequest) returns (GetHoldsResponse) { + option (google.api.http).get = "/provenance/hold/v1/funds/{address}"; + }; + + // GetAllHolds returns all addresses with funds on hold, and the amount held. + rpc GetAllHolds(GetAllHoldsRequest) returns (GetAllHoldsResponse) { + option (google.api.http).get = "/provenance/hold/v1/funds"; + }; +} + +// GetHoldsRequest is the request type for the Query/GetHolds query. +message GetHoldsRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // address is the account address to get on-hold balances for. + string address = 1; +} + +// GetHoldsResponse is the response type for the Query/GetHolds query. +message GetHoldsResponse { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // amount is the total on hold for the requested address. + repeated cosmos.base.v1beta1.Coin amount = 1 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; +} + +// GetAllHoldsRequest is the request type for the Query/GetAllHolds query. +message GetAllHoldsRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 99; +} + +// GetAllHoldsResponse is the response type for the Query/GetAllHolds query. +message GetAllHoldsResponse { + // holds is a list of addresses with funds on hold and the amounts being held. + repeated AccountHold holds = 1; + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageResponse pagination = 99; +} \ No newline at end of file diff --git a/third_party/proto/provenance/ibchooks/v1/genesis.proto b/third_party/proto/provenance/ibchooks/v1/genesis.proto new file mode 100644 index 0000000..57b51ed --- /dev/null +++ b/third_party/proto/provenance/ibchooks/v1/genesis.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; +package provenance.ibchooks.v1; + +import "gogoproto/gogo.proto"; +import "provenance/ibchooks/v1/params.proto"; + +option go_package = "github.com/provenance-io/provenance/x/ibchooks/types"; + +option java_package = "io.provenance.ibchooks.v1"; +option java_multiple_files = true; + +// GenesisState is the IBC Hooks genesis state (params) +message GenesisState { + Params params = 1 [(gogoproto.nullable) = false]; +} diff --git a/third_party/proto/provenance/ibchooks/v1/params.proto b/third_party/proto/provenance/ibchooks/v1/params.proto new file mode 100644 index 0000000..58e3fbc --- /dev/null +++ b/third_party/proto/provenance/ibchooks/v1/params.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; +package provenance.ibchooks.v1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/provenance-io/provenance/x/ibchooks/types"; + +option java_package = "io.provenance.ibchooks.v1"; +option java_multiple_files = true; + +// Params defines the allowed async ack contracts +message Params { + repeated string allowed_async_ack_contracts = 1 [(gogoproto.moretags) = "yaml:\"allowed_async_ack_contracts\""]; +} diff --git a/third_party/proto/provenance/ibchooks/v1/tx.proto b/third_party/proto/provenance/ibchooks/v1/tx.proto new file mode 100644 index 0000000..9f721be --- /dev/null +++ b/third_party/proto/provenance/ibchooks/v1/tx.proto @@ -0,0 +1,29 @@ +syntax = "proto3"; +package provenance.ibchooks.v1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/provenance-io/provenance/x/ibchooks/types"; + +option java_package = "io.provenance.ibchooks.v1"; +option java_multiple_files = true; + +// Msg defines the Msg service. +service Msg { + // EmitIBCAck checks the sender can emit the ack and writes the IBC + // acknowledgement + rpc EmitIBCAck(MsgEmitIBCAck) returns (MsgEmitIBCAckResponse); +} + +// MsgEmitIBCAck is the IBC Acknowledgement +message MsgEmitIBCAck { + string sender = 1 [(gogoproto.moretags) = "yaml:\"sender\""]; + uint64 packet_sequence = 2 [(gogoproto.moretags) = "yaml:\"packet_sequence\""]; + string channel = 3 [(gogoproto.moretags) = "yaml:\"channel\""]; +} + +// MsgEmitIBCAckResponse is the IBC Acknowledgement response +message MsgEmitIBCAckResponse { + string contract_result = 1 [(gogoproto.moretags) = "yaml:\"contract_result\""]; + string ibc_ack = 2 [(gogoproto.moretags) = "yaml:\"ibc_ack\""]; +} diff --git a/third_party/proto/provenance/marker/v1/genesis.proto b/third_party/proto/provenance/marker/v1/genesis.proto index 6445c28..787b680 100644 --- a/third_party/proto/provenance/marker/v1/genesis.proto +++ b/third_party/proto/provenance/marker/v1/genesis.proto @@ -19,4 +19,33 @@ message GenesisState { // A collection of marker accounts to create on start repeated MarkerAccount markers = 2 [(gogoproto.nullable) = false]; + + // list of marker net asset values + repeated MarkerNetAssetValues net_asset_values = 3 [(gogoproto.nullable) = false]; + + // list of denom based denied send addresses + repeated DenySendAddress deny_send_addresses = 4 [(gogoproto.nullable) = false]; +} + +// DenySendAddress defines addresses that are denied sends for marker denom +message DenySendAddress { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // marker_address is the marker's address for denied address + string marker_address = 1; + // deny_address defines all wallet addresses that are denied sends for the marker + string deny_address = 2; } + +// MarkerNetAssetValues defines the net asset values for a marker +message MarkerNetAssetValues { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // address defines the marker address + string address = 1; + + // net_asset_values that are assigned to marker + repeated NetAssetValue net_asset_values = 2 [(gogoproto.nullable) = false]; +} \ No newline at end of file diff --git a/third_party/proto/provenance/marker/v1/marker.proto b/third_party/proto/provenance/marker/v1/marker.proto index 9aa363d..ee96e0e 100644 --- a/third_party/proto/provenance/marker/v1/marker.proto +++ b/third_party/proto/provenance/marker/v1/marker.proto @@ -4,6 +4,7 @@ package provenance.marker.v1; import "gogoproto/gogo.proto"; import "cosmos/auth/v1beta1/auth.proto"; import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; import "provenance/marker/v1/accessgrant.proto"; option go_package = "github.com/provenance-io/provenance/x/marker/types"; @@ -15,13 +16,19 @@ message Params { option (gogoproto.equal) = false; option (gogoproto.goproto_stringer) = false; - // maximum amount of supply to allow a marker to be created with - uint64 max_total_supply = 1 [(gogoproto.customtype) = "uint64", (gogoproto.nullable) = false]; + // Deprecated: Prefer to use `max_supply` instead. Maximum amount of supply to allow a marker to be created with + uint64 max_total_supply = 1 [(gogoproto.customtype) = "uint64", (gogoproto.nullable) = false, deprecated = true]; // indicates if governance based controls of markers is allowed. bool enable_governance = 2; // a regular expression used to validate marker denom values from normal create requests (governance // requests are only subject to platform coin validation denom expression) string unrestricted_denom_regex = 3; + // maximum amount of supply to allow a marker to be created with + string max_supply = 4 [ + (gogoproto.customtype) = "cosmossdk.io/math.Int", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"max_supply\" yaml:\"max_supply\"" + ]; } // MarkerAccount holds the marker configuration information in addition to a base account structure. @@ -92,6 +99,16 @@ enum MarkerStatus { MARKER_STATUS_DESTROYED = 5 [(gogoproto.enumvalue_customname) = "StatusDestroyed"]; } +// NetAssetValue defines a marker's net asset value +message NetAssetValue { + // price is the complete value of the asset's volume + cosmos.base.v1beta1.Coin price = 1 [(gogoproto.nullable) = false]; + // volume is the number of tokens of the marker that were purchased for the price + uint64 volume = 2; + // updated_block_height is the block height of last update + uint64 updated_block_height = 3; +} + // EventMarkerAdd event emitted when marker is added message EventMarkerAdd { string denom = 1; @@ -194,3 +211,11 @@ message EventDenomUnit { string exponent = 2; repeated string aliases = 3; } + +// EventSetNetAssetValue event emitted when Net Asset Value for marker is update or added +message EventSetNetAssetValue { + string denom = 1; + string price = 2; + string volume = 3; + string source = 4; +} diff --git a/third_party/proto/provenance/marker/v1/query.proto b/third_party/proto/provenance/marker/v1/query.proto index 9946d4e..0e425c4 100644 --- a/third_party/proto/provenance/marker/v1/query.proto +++ b/third_party/proto/provenance/marker/v1/query.proto @@ -61,6 +61,11 @@ service Query { rpc AccountData(QueryAccountDataRequest) returns (QueryAccountDataResponse) { option (google.api.http).get = "/provenance/marker/v1/accountdata/{denom}"; } + + // NetAssetValues returns net asset values for marker + rpc NetAssetValues(QueryNetAssetValuesRequest) returns (QueryNetAssetValuesResponse) { + option (google.api.http).get = "/provenance/marker/v1/netassetvalues/{id}"; + } } // QueryParamsRequest is the request type for the Query/Params RPC method. @@ -173,4 +178,16 @@ message Balance { // coins defines the different coins this balance holds. repeated cosmos.base.v1beta1.Coin coins = 2 [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; +} + +// QueryNetAssetValuesRequest is the request type for the Query/NetAssetValues method. +message QueryNetAssetValuesRequest { + // address or denom for the marker + string id = 1; +} + +// QueryNetAssetValuesRequest is the response type for the Query/NetAssetValues method. +message QueryNetAssetValuesResponse { + // net asset values for marker denom + repeated NetAssetValue net_asset_values = 1 [(gogoproto.nullable) = false]; } \ No newline at end of file diff --git a/third_party/proto/provenance/marker/v1/tx.proto b/third_party/proto/provenance/marker/v1/tx.proto index 1e7f399..cad727b 100644 --- a/third_party/proto/provenance/marker/v1/tx.proto +++ b/third_party/proto/provenance/marker/v1/tx.proto @@ -58,6 +58,10 @@ service Msg { rpc UpdateForcedTransfer(MsgUpdateForcedTransferRequest) returns (MsgUpdateForcedTransferResponse); // SetAccountData sets the accountdata for a denom. Signer must have deposit authority. rpc SetAccountData(MsgSetAccountDataRequest) returns (MsgSetAccountDataResponse); + // UpdateSendDenyList will only succeed if signer has admin authority + rpc UpdateSendDenyList(MsgUpdateSendDenyListRequest) returns (MsgUpdateSendDenyListResponse); + // AddNetAssetValues set the net asset value for a marker + rpc AddNetAssetValues(MsgAddNetAssetValuesRequest) returns (MsgAddNetAssetValuesResponse); } // MsgGrantAllowanceRequest validates permission to create a fee grant based on marker admin access. If @@ -92,6 +96,8 @@ message MsgAddMarkerRequest { bool allow_governance_control = 9; bool allow_forced_transfer = 10; repeated string required_attributes = 11; + uint64 usd_cents = 12; + uint64 volume = 13; } // MsgAddMarkerResponse defines the Msg/AddMarker response type @@ -223,6 +229,8 @@ message MsgAddFinalizeActivateMarkerRequest { bool allow_governance_control = 8; bool allow_forced_transfer = 9; repeated string required_attributes = 10; + uint64 usd_cents = 11; + uint64 volume = 12; } // MsgAddFinalizeActivateMarkerResponse defines the Msg/AddFinalizeActivateMarker response type @@ -250,10 +258,14 @@ message MsgUpdateRequiredAttributesRequest { option (gogoproto.equal) = true; option (cosmos.msg.v1.signer) = "transfer_authority"; - string denom = 1; + // The denomination of the marker to update. + string denom = 1; + // List of required attributes to remove from marker. repeated string remove_required_attributes = 2; - repeated string add_required_attributes = 3; - string transfer_authority = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // signer of the proposal + // List of required attributes to add to marker. + repeated string add_required_attributes = 3; + // The signer of the message. Must have transfer authority to marker or be governance module account address. + string transfer_authority = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } // MsgUpdateRequiredAttributesResponse defines the Msg/UpdateRequiredAttributes response type @@ -291,4 +303,33 @@ message MsgSetAccountDataRequest { } // MsgSetAccountDataResponse defines the Msg/SetAccountData response type -message MsgSetAccountDataResponse {} \ No newline at end of file +message MsgSetAccountDataResponse {} + +// MsgUpdateSendDenyListRequest defines a msg to add/remove addresses to send deny list for a resticted marker +// signer must have transfer authority +message MsgUpdateSendDenyListRequest { + option (gogoproto.equal) = true; + option (cosmos.msg.v1.signer) = "authority"; + + // The denomination of the marker to update. + string denom = 1; + // List of bech32 addresses to remove from the deny send list. + repeated string remove_denied_addresses = 2; + // List of bech32 addresses to add to the deny send list. + repeated string add_denied_addresses = 3; + // The signer of the message. Must have admin authority to marker or be governance module account address. + string authority = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgUpdateSendDenyListResponse defines the Msg/UpdateSendDenyList response type +message MsgUpdateSendDenyListResponse {} + +// MsgAddNetAssetValuesRequest defines the Msg/AddNetAssetValues request type +message MsgAddNetAssetValuesRequest { + string denom = 1; + string administrator = 2; + repeated NetAssetValue net_asset_values = 3 [(gogoproto.nullable) = false]; +} + +// MsgAddNetAssetValuesResponse defines the Msg/AddNetAssetValue response type +message MsgAddNetAssetValuesResponse {} diff --git a/third_party/proto/provenance/metadata/v1/query.proto b/third_party/proto/provenance/metadata/v1/query.proto index b7fbc2c..e39a44d 100644 --- a/third_party/proto/provenance/metadata/v1/query.proto +++ b/third_party/proto/provenance/metadata/v1/query.proto @@ -205,6 +205,11 @@ service Query { option (google.api.http).get = "/provenance/metadata/v1/recordspecs/all"; } + // GetByAddr retrieves metadata given any address(es). + rpc GetByAddr(GetByAddrRequest) returns (GetByAddrResponse) { + option (google.api.http).get = "/provenance/metadata/v1/addr/{addrs}"; + } + // ---- Object Store Locator Queries ----- // OSLocatorParams returns all parameters for the object store locator sub module. @@ -240,7 +245,10 @@ service Query { } // QueryParamsRequest is the request type for the Query/Params RPC method. -message QueryParamsRequest {} +message QueryParamsRequest { + // include_request is a flag for whether to include this request in your result. + bool include_request = 98 [(gogoproto.moretags) = "yaml:\"include_request\""]; +} // QueryParamsResponse is the response type for the Query/Params RPC method. message QueryParamsResponse { @@ -262,10 +270,15 @@ message ScopeRequest { // record_addr is a bech32 record address, e.g. record1q2ge0zaztu65tx5x5llv5xc9ztsw42dq2jdvmdazuwzcaddhh8gmu3mcze3. string record_addr = 3 [(gogoproto.moretags) = "yaml:\"record_addr\""]; - // include_sessions is a flag for whether or not the sessions in the scope should be included. + // include_sessions is a flag for whether to include the sessions of the scope in the response. bool include_sessions = 10 [(gogoproto.moretags) = "yaml:\"include_sessions\""]; - // include_records is a flag for whether or not the records in the scope should be included. + // include_records is a flag for whether to include the records of the scope in the response. bool include_records = 11 [(gogoproto.moretags) = "yaml:\"include_records\""]; + // exclude_id_info is a flag for whether to exclude the id info from the response. + bool exclude_id_info = 12 [(gogoproto.moretags) = "yaml:\"exclude_id_info\""]; + + // include_request is a flag for whether to include this request in your result. + bool include_request = 98 [(gogoproto.moretags) = "yaml:\"include_request\""]; } // ScopeResponse is the response type for the Query/Scope RPC method. @@ -293,6 +306,11 @@ message ScopeWrapper { // ScopesAllRequest is the request type for the Query/ScopesAll RPC method. message ScopesAllRequest { + // exclude_id_info is a flag for whether to exclude the id info from the response. + bool exclude_id_info = 12 [(gogoproto.moretags) = "yaml:\"exclude_id_info\""]; + + // include_request is a flag for whether to include this request in your result. + bool include_request = 98 [(gogoproto.moretags) = "yaml:\"include_request\""]; // pagination defines optional pagination parameters for the request. cosmos.base.query.v1beta1.PageRequest pagination = 99; } @@ -322,10 +340,15 @@ message SessionsRequest { // record_name is the name of the record to find the session for in the provided scope. string record_name = 4 [(gogoproto.moretags) = "yaml:\"record_name\""]; - // include_scope is a flag for whether or not the scope containing these sessions should be included. + // include_scope is a flag for whether to include the scope containing these sessions in the response. bool include_scope = 10 [(gogoproto.moretags) = "yaml:\"include_scope\""]; - // include_records is a flag for whether or not the records in these sessions should be included. + // include_records is a flag for whether to include the records of these sessions in the response. bool include_records = 11 [(gogoproto.moretags) = "yaml:\"include_records\""]; + // exclude_id_info is a flag for whether to exclude the id info from the response. + bool exclude_id_info = 12 [(gogoproto.moretags) = "yaml:\"exclude_id_info\""]; + + // include_request is a flag for whether to include this request in your result. + bool include_request = 98 [(gogoproto.moretags) = "yaml:\"include_request\""]; } // SessionsResponse is the response type for the Query/Sessions RPC method. @@ -353,6 +376,11 @@ message SessionWrapper { // SessionsAllRequest is the request type for the Query/SessionsAll RPC method. message SessionsAllRequest { + // exclude_id_info is a flag for whether to exclude the id info from the response. + bool exclude_id_info = 12 [(gogoproto.moretags) = "yaml:\"exclude_id_info\""]; + + // include_request is a flag for whether to include this request in your result. + bool include_request = 98 [(gogoproto.moretags) = "yaml:\"include_request\""]; // pagination defines optional pagination parameters for the request. cosmos.base.query.v1beta1.PageRequest pagination = 99; } @@ -382,10 +410,15 @@ message RecordsRequest { // name is the name of the record to look for string name = 4; - // include_scope is a flag for whether or not the scope containing these records should be included. + // include_scope is a flag for whether to include the the scope containing these records in the response. bool include_scope = 10 [(gogoproto.moretags) = "yaml:\"include_scope\""]; - // include_sessions is a flag for whether or not the sessions containing these records should be included. + // include_sessions is a flag for whether to include the sessions containing these records in the response. bool include_sessions = 11 [(gogoproto.moretags) = "yaml:\"include_sessions\""]; + // exclude_id_info is a flag for whether to exclude the id info from the response. + bool exclude_id_info = 12 [(gogoproto.moretags) = "yaml:\"exclude_id_info\""]; + + // include_request is a flag for whether to include this request in your result. + bool include_request = 98 [(gogoproto.moretags) = "yaml:\"include_request\""]; } // RecordsResponse is the response type for the Query/Records RPC method. @@ -413,6 +446,11 @@ message RecordWrapper { // RecordsAllRequest is the request type for the Query/RecordsAll RPC method. message RecordsAllRequest { + // exclude_id_info is a flag for whether to exclude the id info from the response. + bool exclude_id_info = 12 [(gogoproto.moretags) = "yaml:\"exclude_id_info\""]; + + // include_request is a flag for whether to include this request in your result. + bool include_request = 98 [(gogoproto.moretags) = "yaml:\"include_request\""]; // pagination defines optional pagination parameters for the request. cosmos.base.query.v1beta1.PageRequest pagination = 99; } @@ -432,6 +470,8 @@ message RecordsAllResponse { message OwnershipRequest { string address = 1; + // include_request is a flag for whether to include this request in your result. + bool include_request = 98 [(gogoproto.moretags) = "yaml:\"include_request\""]; // pagination defines optional pagination parameters for the request. cosmos.base.query.v1beta1.PageRequest pagination = 99; } @@ -451,6 +491,8 @@ message OwnershipResponse { message ValueOwnershipRequest { string address = 1; + // include_request is a flag for whether to include this request in your result. + bool include_request = 98 [(gogoproto.moretags) = "yaml:\"include_request\""]; // pagination defines optional pagination parameters for the request. cosmos.base.query.v1beta1.PageRequest pagination = 99; } @@ -472,12 +514,17 @@ message ScopeSpecificationRequest { // address, e.g. scopespec1qnwg86nsatx5pl56muw0v9ytlz3qu3jx6m. string specification_id = 1 [(gogoproto.moretags) = "yaml:\"specification_id\""]; - // include_contract_specs is a flag for whether or not the contract specifications in the scope specification should - // be included. + // include_contract_specs is a flag for whether to include the contract specifications of the scope specification in + // the response. bool include_contract_specs = 10 [(gogoproto.moretags) = "yaml:\"include_contract_specs\""]; - // include_record_specs is a flag for whether or not the record specifications in the scope specification should be - // included. + // include_record_specs is a flag for whether to include the record specifications of the scope specification in the + // response. bool include_record_specs = 11 [(gogoproto.moretags) = "yaml:\"include_record_specs\""]; + // exclude_id_info is a flag for whether to exclude the id info from the response. + bool exclude_id_info = 12 [(gogoproto.moretags) = "yaml:\"exclude_id_info\""]; + + // include_request is a flag for whether to include this request in your result. + bool include_request = 98 [(gogoproto.moretags) = "yaml:\"include_request\""]; } // ScopeSpecificationResponse is the response type for the Query/ScopeSpecification RPC method. @@ -503,6 +550,11 @@ message ScopeSpecificationWrapper { // ScopeSpecificationsAllRequest is the request type for the Query/ScopeSpecificationsAll RPC method. message ScopeSpecificationsAllRequest { + // exclude_id_info is a flag for whether to exclude the id info from the response. + bool exclude_id_info = 12 [(gogoproto.moretags) = "yaml:\"exclude_id_info\""]; + + // include_request is a flag for whether to include this request in your result. + bool include_request = 98 [(gogoproto.moretags) = "yaml:\"include_request\""]; // pagination defines optional pagination parameters for the request. cosmos.base.query.v1beta1.PageRequest pagination = 99; } @@ -526,9 +578,14 @@ message ContractSpecificationRequest { // recspec1qh00d0q2e8w5say53afqdesxp2zw42dq2jdvmdazuwzcaddhh8gmuqhez44. string specification_id = 1 [(gogoproto.moretags) = "yaml:\"specification_id\""]; - // include_record_specs is a flag for whether or not the record specifications in this contract specification should - // be included in the result. + // include_record_specs is a flag for whether to include the the record specifications of this contract specification + // in the response. bool include_record_specs = 10 [(gogoproto.moretags) = "yaml:\"include_record_specs\""]; + // exclude_id_info is a flag for whether to exclude the id info from the response. + bool exclude_id_info = 12 [(gogoproto.moretags) = "yaml:\"exclude_id_info\""]; + + // include_request is a flag for whether to include this request in your result. + bool include_request = 98 [(gogoproto.moretags) = "yaml:\"include_request\""]; } // ContractSpecificationResponse is the response type for the Query/ContractSpecification RPC method. @@ -554,6 +611,11 @@ message ContractSpecificationWrapper { // ContractSpecificationsAllRequest is the request type for the Query/ContractSpecificationsAll RPC method. message ContractSpecificationsAllRequest { + // exclude_id_info is a flag for whether to exclude the id info from the response. + bool exclude_id_info = 12 [(gogoproto.moretags) = "yaml:\"exclude_id_info\""]; + + // include_request is a flag for whether to include this request in your result. + bool include_request = 98 [(gogoproto.moretags) = "yaml:\"include_request\""]; // pagination defines optional pagination parameters for the request. cosmos.base.query.v1beta1.PageRequest pagination = 99; } @@ -578,6 +640,12 @@ message RecordSpecificationsForContractSpecificationRequest { // It can also be a record specification address, e.g. // recspec1qh00d0q2e8w5say53afqdesxp2zw42dq2jdvmdazuwzcaddhh8gmuqhez44. string specification_id = 1 [(gogoproto.moretags) = "yaml:\"specification_id\""]; + + // exclude_id_info is a flag for whether to exclude the id info from the response. + bool exclude_id_info = 12 [(gogoproto.moretags) = "yaml:\"exclude_id_info\""]; + + // include_request is a flag for whether to include this request in your result. + bool include_request = 98 [(gogoproto.moretags) = "yaml:\"include_request\""]; } // RecordSpecificationsForContractSpecificationResponse is the response type for the @@ -606,6 +674,12 @@ message RecordSpecificationRequest { // 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. string name = 2; + + // exclude_id_info is a flag for whether to exclude the id info from the response. + bool exclude_id_info = 12 [(gogoproto.moretags) = "yaml:\"exclude_id_info\""]; + + // include_request is a flag for whether to include this request in your result. + bool include_request = 98 [(gogoproto.moretags) = "yaml:\"include_request\""]; } // RecordSpecificationResponse is the response type for the Query/RecordSpecification RPC method. @@ -627,6 +701,11 @@ message RecordSpecificationWrapper { // RecordSpecificationsAllRequest is the request type for the Query/RecordSpecificationsAll RPC method. message RecordSpecificationsAllRequest { + // exclude_id_info is a flag for whether to exclude the id info from the response. + bool exclude_id_info = 12 [(gogoproto.moretags) = "yaml:\"exclude_id_info\""]; + + // include_request is a flag for whether to include this request in your result. + bool include_request = 98 [(gogoproto.moretags) = "yaml:\"include_request\""]; // pagination defines optional pagination parameters for the request. cosmos.base.query.v1beta1.PageRequest pagination = 99; } @@ -643,8 +722,35 @@ message RecordSpecificationsAllResponse { cosmos.base.query.v1beta1.PageResponse pagination = 99; } +// GetByAddrRequest is the request type for the Query/GetByAddr RPC method. +message GetByAddrRequest { + // ids are the metadata addresses of the things to look up. + repeated string addrs = 1; +} + +// GetByAddrResponse is the response type for the Query/GetByAddr RPC method. +message GetByAddrResponse { + // scopes contains any scopes that were requested and found. + repeated Scope scopes = 1 [(gogoproto.moretags) = "yaml:\"scopes,omitempty\""]; + // sessions contains any sessions that were requested and found. + repeated Session sessions = 2 [(gogoproto.moretags) = "yaml:\"sessions,omitempty\""]; + // records contains any records that were requested and found. + repeated Record records = 3 [(gogoproto.moretags) = "yaml:\"records,omitempty\""]; + // scope_specs contains any scope specifications that were requested and found. + repeated ScopeSpecification scope_specs = 4 [(gogoproto.moretags) = "yaml:\"scope_specs,omitempty\""]; + // contract_specs contains any contract specifications that were requested and found. + repeated ContractSpecification contract_specs = 5 [(gogoproto.moretags) = "yaml:\"contract_specs,omitempty\""]; + // record_specs contains any record specifications that were requested and found. + repeated RecordSpecification record_specs = 6 [(gogoproto.moretags) = "yaml:\"record_specs,omitempty\""]; + // not_found contains any addrs requested but not found. + repeated string not_found = 7 [(gogoproto.moretags) = "yaml:\"not_found,omitempty\""]; +} + // OSLocatorParamsRequest is the request type for the Query/OSLocatorParams RPC method. -message OSLocatorParamsRequest {} +message OSLocatorParamsRequest { + // include_request is a flag for whether to include this request in your result. + bool include_request = 98 [(gogoproto.moretags) = "yaml:\"include_request\""]; +} // OSLocatorParamsResponse is the response type for the Query/OSLocatorParams RPC method. message OSLocatorParamsResponse { @@ -658,6 +764,9 @@ message OSLocatorParamsResponse { // OSLocatorRequest is the request type for the Query/OSLocator RPC method. message OSLocatorRequest { string owner = 1; + + // include_request is a flag for whether to include this request in your result. + bool include_request = 98 [(gogoproto.moretags) = "yaml:\"include_request\""]; } // OSLocatorResponse is the response type for the Query/OSLocator RPC method. @@ -672,6 +781,8 @@ message OSLocatorResponse { message OSLocatorsByURIRequest { string uri = 1; + // include_request is a flag for whether to include this request in your result. + bool include_request = 98 [(gogoproto.moretags) = "yaml:\"include_request\""]; // pagination defines optional pagination parameters for the request. cosmos.base.query.v1beta1.PageRequest pagination = 99; } @@ -689,6 +800,9 @@ message OSLocatorsByURIResponse { // OSLocatorsByScopeRequest is the request type for the Query/OSLocatorsByScope RPC method. message OSLocatorsByScopeRequest { string scope_id = 1 [(gogoproto.moretags) = "yaml:\"scope_id\""]; + + // include_request is a flag for whether to include this request in your result. + bool include_request = 98 [(gogoproto.moretags) = "yaml:\"include_request\""]; } // OSLocatorsByScopeResponse is the response type for the Query/OSLocatorsByScope RPC method. @@ -701,6 +815,8 @@ message OSLocatorsByScopeResponse { // OSAllLocatorsRequest is the request type for the Query/OSAllLocators RPC method. message OSAllLocatorsRequest { + // include_request is a flag for whether to include this request in your result. + bool include_request = 98 [(gogoproto.moretags) = "yaml:\"include_request\""]; // pagination defines optional pagination parameters for the request. cosmos.base.query.v1beta1.PageRequest pagination = 99; } diff --git a/third_party/proto/provenance/metadata/v1/specification.proto b/third_party/proto/provenance/metadata/v1/specification.proto index 58571f9..374b95b 100644 --- a/third_party/proto/provenance/metadata/v1/specification.proto +++ b/third_party/proto/provenance/metadata/v1/specification.proto @@ -77,7 +77,10 @@ message ContractSpecification { // contract oneof source { // the address of a record on chain that represents this contract - bytes resource_id = 5 [(gogoproto.customtype) = "MetadataAddress", (gogoproto.moretags) = "yaml:\"resource_id\""]; + bytes resource_id = 5 [ + (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress", + (gogoproto.moretags) = "yaml:\"resource_id\"" + ]; // the hash of contract binary (off-chain instance) string hash = 6; } diff --git a/third_party/proto/provenance/msgfees/v1/tx.proto b/third_party/proto/provenance/msgfees/v1/tx.proto index 0de1a66..860e298 100644 --- a/third_party/proto/provenance/msgfees/v1/tx.proto +++ b/third_party/proto/provenance/msgfees/v1/tx.proto @@ -2,7 +2,9 @@ syntax = "proto3"; package provenance.msgfees.v1; import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/msg/v1/msg.proto"; option go_package = "github.com/provenance-io/provenance/x/msgfees/types"; @@ -16,6 +18,23 @@ service Msg { // Use Case: smart contracts will be able to charge additional fees and direct partial funds to specified recipient // for executing contracts rpc AssessCustomMsgFee(MsgAssessCustomMsgFeeRequest) returns (MsgAssessCustomMsgFeeResponse); + + // AddMsgFeeProposal defines a governance proposal to add additional msg based fee + rpc AddMsgFeeProposal(MsgAddMsgFeeProposalRequest) returns (MsgAddMsgFeeProposalResponse); + + // UpdateMsgFeeProposal defines a governance proposal to update a current msg based fee + rpc UpdateMsgFeeProposal(MsgUpdateMsgFeeProposalRequest) returns (MsgUpdateMsgFeeProposalResponse); + + // RemoveMsgFeeProposal defines a governance proposal to delete a current msg based fee + rpc RemoveMsgFeeProposal(MsgRemoveMsgFeeProposalRequest) returns (MsgRemoveMsgFeeProposalResponse); + + // UpdateNhashPerUsdMilProposal defines a governance proposal to update the nhash per usd mil param + rpc UpdateNhashPerUsdMilProposal(MsgUpdateNhashPerUsdMilProposalRequest) + returns (MsgUpdateNhashPerUsdMilProposalResponse); + + // UpdateConversionFeeDenomProposal defines a governance proposal to update the msg fee conversion denom + rpc UpdateConversionFeeDenomProposal(MsgUpdateConversionFeeDenomProposalRequest) + returns (MsgUpdateConversionFeeDenomProposalResponse); } // MsgAssessCustomMsgFeeRequest defines an sdk.Msg type @@ -32,4 +51,94 @@ message MsgAssessCustomMsgFeeRequest { } // MsgAssessCustomMsgFeeResponse defines the Msg/AssessCustomMsgFeee response type. -message MsgAssessCustomMsgFeeResponse {} \ No newline at end of file +message MsgAssessCustomMsgFeeResponse {} + +// AddMsgFeeProposal defines a governance proposal to add additional msg based fee +message MsgAddMsgFeeProposalRequest { + option (gogoproto.goproto_stringer) = true; + option (cosmos.msg.v1.signer) = "authority"; + + // type url of msg to add fee + string msg_type_url = 1; + + // additional fee for msg type + cosmos.base.v1beta1.Coin additional_fee = 2 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.moretags) = "yaml:\"additional_fee\"" + ]; + + // optional recipient to receive basis points + string recipient = 3; + // basis points to use when recipient is present (1 - 10,000) + string recipient_basis_points = 4; + // the signing authority for the proposal + string authority = 5 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgAddMsgFeeProposalResponse defines the Msg/AddMsgFeeProposal response type +message MsgAddMsgFeeProposalResponse {} + +// UpdateMsgFeeProposal defines a governance proposal to update a current msg based fee +message MsgUpdateMsgFeeProposalRequest { + option (gogoproto.goproto_stringer) = true; + option (cosmos.msg.v1.signer) = "authority"; + + // type url of msg to update fee + string msg_type_url = 1; + + // additional fee for msg type + cosmos.base.v1beta1.Coin additional_fee = 2 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + // optional recipient to recieve basis points + string recipient = 3; + // basis points to use when recipient is present (1 - 10,000) + string recipient_basis_points = 4; + // the signing authority for the proposal + string authority = 5 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgUpdateMsgFeeProposalResponse defines the Msg/RemoveMsgFeeProposal response type +message MsgUpdateMsgFeeProposalResponse {} + +// RemoveMsgFeeProposal defines a governance proposal to delete a current msg based fee +message MsgRemoveMsgFeeProposalRequest { + option (gogoproto.goproto_stringer) = true; + option (cosmos.msg.v1.signer) = "authority"; + + // type url of msg fee to remove + string msg_type_url = 1; + // the signing authority for the proposal + string authority = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // +} + +// MsgRemoveMsgFeeProposalResponse defines the Msg/RemoveMsgFeeProposal response type +message MsgRemoveMsgFeeProposalResponse {} + +// UpdateNhashPerUsdMilProposal defines a governance proposal to update the nhash per usd mil param +message MsgUpdateNhashPerUsdMilProposalRequest { + option (gogoproto.goproto_stringer) = true; + option (cosmos.msg.v1.signer) = "authority"; + + // nhash_per_usd_mil is number of nhash per usd mil + uint64 nhash_per_usd_mil = 1; + // the signing authority for the proposal + string authority = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // +} + +// MsgUpdateNhashPerUsdMilProposalResponse defines the Msg/UpdateNhashPerUsdMilProposal response type +message MsgUpdateNhashPerUsdMilProposalResponse {} + +// UpdateConversionFeeDenomProposal defines a governance proposal to update the msg fee conversion denom +message MsgUpdateConversionFeeDenomProposalRequest { + option (gogoproto.goproto_stringer) = true; + option (cosmos.msg.v1.signer) = "authority"; + + // conversion_fee_denom is the denom that usd will be converted to + string conversion_fee_denom = 1; + // the signing authority for the proposal + string authority = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // +} + +// MsgUpdateConversionFeeDenomProposalResponse defines the Msg/UpdateConversionFeeDenomProposal response type +message MsgUpdateConversionFeeDenomProposalResponse {} \ No newline at end of file diff --git a/third_party/proto/provenance/oracle/v1/event.proto b/third_party/proto/provenance/oracle/v1/event.proto new file mode 100644 index 0000000..3327a19 --- /dev/null +++ b/third_party/proto/provenance/oracle/v1/event.proto @@ -0,0 +1,35 @@ +syntax = "proto3"; +package provenance.oracle.v1; + +option go_package = "github.com/provenance-io/provenance/x/oracle/types"; + +option java_package = "io.provenance.oracle.v1"; +option java_multiple_files = true; + +// EventOracleQuerySuccess is an event for when the chain receives a successful response from an oracle query +message EventOracleQuerySuccess { + // channel is the local channel that the oracle query response was received from + string channel = 1; + // sequence_id is a unique identifier of the query + string sequence_id = 2; + // result is the data received from the query + string result = 3; +} + +// EventOracleQueryError is an event for when the chain receives an error response from an oracle query +message EventOracleQueryError { + // channel is the local channel that the oracle query response was received from + string channel = 1; + // sequence_id is a unique identifier of the query + string sequence_id = 2; + // error is the error message received from the query + string error = 3; +} + +// EventOracleQueryTimeout is an event for when the chain receives a timeout from an oracle query +message EventOracleQueryTimeout { + // channel is the local channel that the oracle timeout was received from + string channel = 1; + // sequence_id is a unique identifier of the query + string sequence_id = 2; +} \ No newline at end of file diff --git a/third_party/proto/provenance/oracle/v1/genesis.proto b/third_party/proto/provenance/oracle/v1/genesis.proto new file mode 100644 index 0000000..596b05d --- /dev/null +++ b/third_party/proto/provenance/oracle/v1/genesis.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; +package provenance.oracle.v1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/provenance-io/provenance/x/oracle/types"; +option java_package = "io.provenance.oracle.v1"; +option java_multiple_files = true; + +// GenesisState defines the oracle module's genesis state. +message GenesisState { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // The port to assign to the module + string port_id = 2; + // The address of the oracle + string oracle = 3; +} \ No newline at end of file diff --git a/third_party/proto/provenance/oracle/v1/query.proto b/third_party/proto/provenance/oracle/v1/query.proto new file mode 100644 index 0000000..d922616 --- /dev/null +++ b/third_party/proto/provenance/oracle/v1/query.proto @@ -0,0 +1,44 @@ +syntax = "proto3"; +package provenance.oracle.v1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/provenance-io/provenance/x/oracle/types"; +option java_package = "io.provenance.oracle.v1"; +option java_multiple_files = true; + +// Query defines the gRPC querier service for oracle module. +service Query { + // OracleAddress returns the address of the oracle + rpc OracleAddress(QueryOracleAddressRequest) returns (QueryOracleAddressResponse) { + option (google.api.http).get = "/provenance/oracle/v1/oracle_address"; + } + + // Oracle forwards a query to the module's oracle + rpc Oracle(QueryOracleRequest) returns (QueryOracleResponse) { + option (google.api.http).get = "/provenance/oracle/v1/oracle"; + } +} + +// QueryOracleAddressRequest queries for the address of the oracle. +message QueryOracleAddressRequest {} + +// QueryOracleAddressResponse contains the address of the oracle. +message QueryOracleAddressResponse { + // The address of the oracle + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// QueryOracleRequest queries the module's oracle. +message QueryOracleRequest { + // Query contains the query data passed to the oracle. + bytes query = 1 [(gogoproto.casttype) = "github.com/CosmWasm/wasmd/x/wasm/types.RawContractMessage"]; +} + +// QueryOracleResponse contains the result of the query sent to the oracle. +message QueryOracleResponse { + // Data contains the json data returned from the oracle. + bytes data = 1 [(gogoproto.casttype) = "github.com/CosmWasm/wasmd/x/wasm/types.RawContractMessage"]; +} \ No newline at end of file diff --git a/third_party/proto/provenance/oracle/v1/tx.proto b/third_party/proto/provenance/oracle/v1/tx.proto new file mode 100644 index 0000000..ff1a03d --- /dev/null +++ b/third_party/proto/provenance/oracle/v1/tx.proto @@ -0,0 +1,47 @@ +syntax = "proto3"; +package provenance.oracle.v1; + +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/provenance-io/provenance/x/oracle/types"; +option java_package = "io.provenance.oracle.v1"; +option java_multiple_files = true; + +// Msg +service Msg { + // UpdateOracle is the RPC endpoint for updating the oracle + rpc UpdateOracle(MsgUpdateOracleRequest) returns (MsgUpdateOracleResponse); + // SendQueryOracle sends a query to an oracle on another chain + rpc SendQueryOracle(MsgSendQueryOracleRequest) returns (MsgSendQueryOracleResponse); +} + +// MsgSendQueryOracleRequest queries an oracle on another chain +message MsgSendQueryOracleRequest { + // Query contains the query data passed to the oracle. + bytes query = 1 [(gogoproto.casttype) = "github.com/CosmWasm/wasmd/x/wasm/types.RawContractMessage"]; + // Channel is the channel to the oracle. + string channel = 3; + // The signing authority for the request + string authority = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgSendQueryOracleResponse contains the id of the oracle query. +message MsgSendQueryOracleResponse { + // The sequence number that uniquely identifies the query. + uint64 sequence = 1; +} + +// MsgUpdateOracleRequest is the request type for updating an oracle's contract address +message MsgUpdateOracleRequest { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = true; + + // The address of the oracle's contract + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // The signing authorities for the request + string authority = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgUpdateOracleResponse is the response type for updating the oracle. +message MsgUpdateOracleResponse {} \ No newline at end of file diff --git a/third_party/proto/provenance/trigger/v1/event.proto b/third_party/proto/provenance/trigger/v1/event.proto index 2aee294..0b64273 100644 --- a/third_party/proto/provenance/trigger/v1/event.proto +++ b/third_party/proto/provenance/trigger/v1/event.proto @@ -8,12 +8,28 @@ option java_multiple_files = true; // EventTriggerCreated is an event for when a trigger is created message EventTriggerCreated { - // trigger_id is a unique identifier of the trigger + // trigger_id is a unique identifier of the trigger. string trigger_id = 1; } // EventTriggerDestroyed is an event for when a trigger is destroyed message EventTriggerDestroyed { - // trigger_id is a unique identifier of the trigger + // trigger_id is a unique identifier of the trigger. string trigger_id = 1; +} + +// EventTriggerDetected is an event for when a trigger's event is detected +message EventTriggerDetected { + // trigger_id is a unique identifier of the trigger. + string trigger_id = 1; +} + +// EventTriggerExecuted is an event for when a trigger is executed. +message EventTriggerExecuted { + // trigger_id is a unique identifier of the trigger. + string trigger_id = 1; + // owner is the creator of the trigger. + string owner = 2; + // success indicates if all executed actions were successful. + bool success = 3; } \ No newline at end of file