diff --git a/__fixtures__/chain1/cosmos/gov/v1/tx.proto b/__fixtures__/chain1/cosmos/gov/v1/tx.proto index 9306c51e8c..b19a1ed73f 100644 --- a/__fixtures__/chain1/cosmos/gov/v1/tx.proto +++ b/__fixtures__/chain1/cosmos/gov/v1/tx.proto @@ -35,7 +35,7 @@ service Msg { message MsgSubmitProposal { option (cosmos.msg.v1.signer) = "proposer"; - repeated google.protobuf.Any messages = 1; + repeated google.protobuf.Any messages = 1 [(cosmos_proto.accepts_interface) = "ProposalContentI"]; repeated cosmos.base.v1beta1.Coin initial_deposit = 2 [(gogoproto.nullable) = false]; string proposer = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // metadata is any arbitrary metadata attached to the proposal. @@ -53,7 +53,7 @@ message MsgExecLegacyContent { option (cosmos.msg.v1.signer) = "authority"; // content is the proposal's content. - google.protobuf.Any content = 1 [(cosmos_proto.accepts_interface) = "Content"]; + google.protobuf.Any content = 1 [(cosmos_proto.accepts_interface) = "ProposalContentI"]; // authority must be the gov module address. string authority = 2; } diff --git a/__fixtures__/chain1/cosmos/gov/v1beta1/gov.proto b/__fixtures__/chain1/cosmos/gov/v1beta1/gov.proto index f1487fe4b5..9cee620171 100644 --- a/__fixtures__/chain1/cosmos/gov/v1beta1/gov.proto +++ b/__fixtures__/chain1/cosmos/gov/v1beta1/gov.proto @@ -45,7 +45,7 @@ message WeightedVoteOption { // TextProposal defines a standard text proposal whose changes need to be // manually updated in case of approval. message TextProposal { - option (cosmos_proto.implements_interface) = "Content"; + option (cosmos_proto.implements_interface) = "ProposalContentI"; option (gogoproto.equal) = true; @@ -70,7 +70,7 @@ message Proposal { option (gogoproto.equal) = true; uint64 proposal_id = 1; - google.protobuf.Any content = 2 [(cosmos_proto.accepts_interface) = "Content"]; + google.protobuf.Any content = 2 [(cosmos_proto.accepts_interface) = "ProposalContentI"]; ProposalStatus status = 3; // final_tally_result is the final tally result of the proposal. When // querying a proposal via gRPC, this field is not populated until the diff --git a/__fixtures__/chain1/cosmos/gov/v1beta1/tx.proto b/__fixtures__/chain1/cosmos/gov/v1beta1/tx.proto index 00ce2253ef..4bc2a4fd3b 100644 --- a/__fixtures__/chain1/cosmos/gov/v1beta1/tx.proto +++ b/__fixtures__/chain1/cosmos/gov/v1beta1/tx.proto @@ -38,7 +38,7 @@ message MsgSubmitProposal { option (gogoproto.stringer) = false; option (gogoproto.goproto_getters) = false; - google.protobuf.Any content = 1 [(cosmos_proto.accepts_interface) = "Content"]; + google.protobuf.Any content = 1 [(cosmos_proto.accepts_interface) = "ProposalContentI"]; repeated cosmos.base.v1beta1.Coin initial_deposit = 2 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; string proposer = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; diff --git a/__fixtures__/chain1/evmos/incentives/v1/incentives.proto b/__fixtures__/chain1/evmos/incentives/v1/incentives.proto index 2fdbd37d41..cc8d49fffa 100644 --- a/__fixtures__/chain1/evmos/incentives/v1/incentives.proto +++ b/__fixtures__/chain1/evmos/incentives/v1/incentives.proto @@ -39,6 +39,8 @@ message GasMeter { // RegisterIncentiveProposal is a gov Content type to register an incentive message RegisterIncentiveProposal { option (gogoproto.equal) = false; + option (cosmos_proto.implements_interface) = "ProposalContentI"; + // title of the proposal string title = 1; // proposal description diff --git a/__fixtures__/chain1/ibc/core/client/v1/client.proto b/__fixtures__/chain1/ibc/core/client/v1/client.proto index 0733770201..c69b90fccf 100644 --- a/__fixtures__/chain1/ibc/core/client/v1/client.proto +++ b/__fixtures__/chain1/ibc/core/client/v1/client.proto @@ -2,11 +2,12 @@ syntax = "proto3"; package ibc.core.client.v1; -option go_package = "github.com/cosmos/ibc-go/v2/modules/core/02-client/types"; +option go_package = "github.com/cosmos/ibc-go/v6/modules/core/02-client/types"; import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; import "cosmos/upgrade/v1beta1/upgrade.proto"; +import "cosmos_proto/cosmos.proto"; // IdentifiedClientState defines a client state with an additional client // identifier field. @@ -23,7 +24,7 @@ message ConsensusStateWithHeight { // consensus state height Height height = 1 [(gogoproto.nullable) = false]; // consensus state - google.protobuf.Any consensus_state = 2 [(gogoproto.moretags) = "yaml\"consensus_state\""]; + google.protobuf.Any consensus_state = 2 [(gogoproto.moretags) = "yaml:\"consensus_state\""]; } // ClientConsensusStates defines all the stored consensus states for a given @@ -41,7 +42,8 @@ message ClientConsensusStates { // handler may fail if the subject and the substitute do not match in client and // chain parameters (with exception to latest height, frozen height, and chain-id). message ClientUpdateProposal { - option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_getters) = false; + option (cosmos_proto.implements_interface) = "ProposalContentI"; // the title of the update proposal string title = 1; // the description of the proposal @@ -56,9 +58,10 @@ message ClientUpdateProposal { // UpgradeProposal is a gov Content type for initiating an IBC breaking // upgrade. message UpgradeProposal { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.equal) = true; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + option (gogoproto.equal) = true; + option (cosmos_proto.implements_interface) = "ProposalContentI"; string title = 1; string description = 2; diff --git a/__fixtures__/chain1/osmosis/epochs/genesis.proto b/__fixtures__/chain1/osmosis/epochs/genesis.proto index f68ed38471..f8a2754bf3 100644 --- a/__fixtures__/chain1/osmosis/epochs/genesis.proto +++ b/__fixtures__/chain1/osmosis/epochs/genesis.proto @@ -5,7 +5,7 @@ import "gogoproto/gogo.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/timestamp.proto"; -option go_package = "github.com/osmosis-labs/osmosis/v12/x/epochs/types"; +option go_package = "github.com/osmosis-labs/osmosis/v13/x/epochs/types"; // EpochInfo is a struct that describes the data going into // a timer defined by the x/epochs module. diff --git a/__fixtures__/chain1/osmosis/epochs/query.proto b/__fixtures__/chain1/osmosis/epochs/query.proto index 7c0daac62e..9fde25db08 100644 --- a/__fixtures__/chain1/osmosis/epochs/query.proto +++ b/__fixtures__/chain1/osmosis/epochs/query.proto @@ -6,7 +6,7 @@ import "google/api/annotations.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; import "osmosis/epochs/genesis.proto"; -option go_package = "github.com/osmosis-labs/osmosis/v12/x/epochs/types"; +option go_package = "github.com/osmosis-labs/osmosis/v13/x/epochs/types"; // Query defines the gRPC querier service. service Query { diff --git a/__fixtures__/chain1/osmosis/gamm/pool-models/balancer/balancerPool.proto b/__fixtures__/chain1/osmosis/gamm/pool-models/balancer/balancerPool.proto index b51af412e7..6ee8f13314 100644 --- a/__fixtures__/chain1/osmosis/gamm/pool-models/balancer/balancerPool.proto +++ b/__fixtures__/chain1/osmosis/gamm/pool-models/balancer/balancerPool.proto @@ -14,7 +14,7 @@ import "google/protobuf/timestamp.proto"; import "cosmos/auth/v1beta1/auth.proto"; import "cosmos/base/v1beta1/coin.proto"; -option go_package = "github.com/osmosis-labs/osmosis/v12/x/gamm/pool-models/balancer"; +option go_package = "github.com/osmosis-labs/osmosis/v13/x/gamm/pool-models/balancer"; // Parameters for changing the weights in a balancer pool smoothly from // a start weight and end weight over a period of time. diff --git a/__fixtures__/chain1/osmosis/gamm/pool-models/balancer/tx/tx.proto b/__fixtures__/chain1/osmosis/gamm/pool-models/balancer/tx/tx.proto index 20f7209e64..5ed0fdc070 100644 --- a/__fixtures__/chain1/osmosis/gamm/pool-models/balancer/tx/tx.proto +++ b/__fixtures__/chain1/osmosis/gamm/pool-models/balancer/tx/tx.proto @@ -4,7 +4,7 @@ package osmosis.gamm.poolmodels.balancer.v1beta1; import "gogoproto/gogo.proto"; import "osmosis/gamm/pool-models/balancer/balancerPool.proto"; -option go_package = "github.com/osmosis-labs/osmosis/v12/x/gamm/pool-models/balancer"; +option go_package = "github.com/osmosis-labs/osmosis/v13/x/gamm/pool-models/balancer"; service Msg { rpc CreateBalancerPool(MsgCreateBalancerPool) diff --git a/__fixtures__/chain1/osmosis/gamm/pool-models/stableswap/stableswap_pool.proto b/__fixtures__/chain1/osmosis/gamm/pool-models/stableswap/stableswap_pool.proto index d57e19d3b0..582a37b3ec 100644 --- a/__fixtures__/chain1/osmosis/gamm/pool-models/stableswap/stableswap_pool.proto +++ b/__fixtures__/chain1/osmosis/gamm/pool-models/stableswap/stableswap_pool.proto @@ -10,7 +10,7 @@ import "google/protobuf/timestamp.proto"; import "cosmos/auth/v1beta1/auth.proto"; import "cosmos/base/v1beta1/coin.proto"; -option go_package = "github.com/osmosis-labs/osmosis/v12/x/gamm/pool-models/stableswap"; +option go_package = "github.com/osmosis-labs/osmosis/v13/x/gamm/pool-models/stableswap"; // PoolParams defined the parameters that will be managed by the pool // governance in the future. This params are not managed by the chain @@ -63,10 +63,11 @@ message Pool { (gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" ]; + // for calculation amognst assets with different precisions - repeated uint64 scaling_factor = 7 - [ (gogoproto.moretags) = "yaml:\"stableswap_scaling_factor\"" ]; - // scaling_factor_governor is the address can adjust pool scaling factors - string scaling_factor_governor = 8 - [ (gogoproto.moretags) = "yaml:\"scaling_factor_governor\"" ]; + repeated uint64 scaling_factors = 7 + [ (gogoproto.moretags) = "yaml:\"stableswap_scaling_factors\"" ]; + // scaling_factor_controller is the address can adjust pool scaling factors + string scaling_factor_controller = 8 + [ (gogoproto.moretags) = "yaml:\"scaling_factor_controller\"" ]; } diff --git a/__fixtures__/chain1/osmosis/gamm/pool-models/stableswap/tx.proto b/__fixtures__/chain1/osmosis/gamm/pool-models/stableswap/tx.proto index 5c2fae4fa3..73a74b0625 100644 --- a/__fixtures__/chain1/osmosis/gamm/pool-models/stableswap/tx.proto +++ b/__fixtures__/chain1/osmosis/gamm/pool-models/stableswap/tx.proto @@ -5,7 +5,7 @@ import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; import "osmosis/gamm/pool-models/stableswap/stableswap_pool.proto"; -option go_package = "github.com/osmosis-labs/osmosis/v12/x/gamm/pool-models/stableswap"; +option go_package = "github.com/osmosis-labs/osmosis/v13/x/gamm/pool-models/stableswap"; service Msg { rpc CreateStableswapPool(MsgCreateStableswapPool) @@ -30,6 +30,9 @@ message MsgCreateStableswapPool { string future_pool_governor = 5 [ (gogoproto.moretags) = "yaml:\"future_pool_governor\"" ]; + + string scaling_factor_controller = 6 + [ (gogoproto.moretags) = "yaml:\"scaling_factor_controller\"" ]; } // Returns a poolID with custom poolName. diff --git a/__fixtures__/chain1/osmosis/gamm/v1beta1/genesis.proto b/__fixtures__/chain1/osmosis/gamm/v1beta1/genesis.proto index 4727db4d65..d2d71c0ee6 100644 --- a/__fixtures__/chain1/osmosis/gamm/v1beta1/genesis.proto +++ b/__fixtures__/chain1/osmosis/gamm/v1beta1/genesis.proto @@ -15,7 +15,7 @@ message Params { ]; } -option go_package = "github.com/osmosis-labs/osmosis/v12/x/gamm/types"; +option go_package = "github.com/osmosis-labs/osmosis/v13/x/gamm/types"; // GenesisState defines the gamm module's genesis state. message GenesisState { diff --git a/__fixtures__/chain1/osmosis/gamm/v1beta1/query.proto b/__fixtures__/chain1/osmosis/gamm/v1beta1/query.proto index 33600aa550..9d6a521c09 100644 --- a/__fixtures__/chain1/osmosis/gamm/v1beta1/query.proto +++ b/__fixtures__/chain1/osmosis/gamm/v1beta1/query.proto @@ -10,7 +10,7 @@ import "google/api/annotations.proto"; import "google/protobuf/any.proto"; import "cosmos_proto/cosmos.proto"; -option go_package = "github.com/osmosis-labs/osmosis/v12/x/gamm/types"; +option go_package = "github.com/osmosis-labs/osmosis/v13/x/gamm/types"; service Query { rpc Pools(QueryPoolsRequest) returns (QueryPoolsResponse) { @@ -26,6 +26,13 @@ service Query { option (google.api.http).get = "/osmosis/gamm/v1beta1/total_liquidity"; } + // PoolsWithFilter allows you to query specific pools with requested + // parameters + rpc PoolsWithFilter(QueryPoolsWithFilterRequest) + returns (QueryPoolsWithFilterResponse) { + option (google.api.http).get = "/osmosis/gamm/v1beta1/filtered_pools"; + } + // Per Pool gRPC Endpoints rpc Pool(QueryPoolRequest) returns (QueryPoolResponse) { option (google.api.http).get = "/osmosis/gamm/v1beta1/pools/{pool_id}"; @@ -38,6 +45,22 @@ service Query { option (google.api.http).get = "/osmosis/gamm/v1beta1/pool_type/{pool_id}"; } + // Simulates joining pool without a swap. Returns the amount of shares you'd + // get and tokens needed to provide + rpc CalcJoinPoolNoSwapShares(QueryCalcJoinPoolNoSwapSharesRequest) + returns (QueryCalcJoinPoolNoSwapSharesResponse) {} + + rpc CalcJoinPoolShares(QueryCalcJoinPoolSharesRequest) + returns (QueryCalcJoinPoolSharesResponse) { + option (google.api.http).get = + "/osmosis/gamm/v1beta1/pools/{pool_id}/join_swap_exact_in"; + } + rpc CalcExitPoolCoinsFromShares(QueryCalcExitPoolCoinsFromSharesRequest) + returns (QueryCalcExitPoolCoinsFromSharesResponse) { + option (google.api.http).get = + "/osmosis/gamm/v1beta1/pools/{pool_id}/exit_swap_share_amount_in"; + } + rpc PoolParams(QueryPoolParamsRequest) returns (QueryPoolParamsResponse) { option (google.api.http).get = "/osmosis/gamm/v1beta1/pools/{pool_id}/params"; @@ -57,6 +80,7 @@ service Query { // SpotPrice defines a gRPC query handler that returns the spot price given // a base denomination and a quote denomination. rpc SpotPrice(QuerySpotPriceRequest) returns (QuerySpotPriceResponse) { + option deprecated = true; option (google.api.http).get = "/osmosis/gamm/v1beta1/pools/{pool_id}/prices"; } @@ -110,6 +134,41 @@ message QueryPoolTypeResponse { string pool_type = 1 [ (gogoproto.moretags) = "yaml:\"pool_type\"" ]; } +//=============================== CalcJoinPoolShares +message QueryCalcJoinPoolSharesRequest { + uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; + repeated cosmos.base.v1beta1.Coin tokens_in = 2 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.nullable) = false + ]; +} +message QueryCalcJoinPoolSharesResponse { + string share_out_amount = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"share_out_amount\"", + (gogoproto.nullable) = false + ]; + repeated cosmos.base.v1beta1.Coin tokens_out = 2 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.nullable) = false + ]; +} + +//=============================== CalcExitPoolCoinsFromShares +message QueryCalcExitPoolCoinsFromSharesRequest { + uint64 pool_id = 1; + string share_in_amount = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; +} +message QueryCalcExitPoolCoinsFromSharesResponse { + repeated cosmos.base.v1beta1.Coin tokens_out = 1 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.nullable) = false + ]; +} + //=============================== PoolParams message QueryPoolParamsRequest { uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; @@ -139,10 +198,29 @@ message QueryTotalSharesResponse { (gogoproto.nullable) = false ]; } - +//=============================== CalcJoinPoolNoSwapShares +message QueryCalcJoinPoolNoSwapSharesRequest { + uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; + repeated cosmos.base.v1beta1.Coin tokens_in = 2 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.nullable) = false + ]; +} +message QueryCalcJoinPoolNoSwapSharesResponse { + repeated cosmos.base.v1beta1.Coin tokens_out = 1 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.moretags) = "yaml:\"tokens_out\"", + (gogoproto.nullable) = false + ]; + string shares_out = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; +} // QuerySpotPriceRequest defines the gRPC request structure for a SpotPrice // query. message QuerySpotPriceRequest { + option deprecated = true; uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; string base_asset_denom = 2 [ (gogoproto.moretags) = "yaml:\"base_asset_denom\"" ]; @@ -152,15 +230,36 @@ message QuerySpotPriceRequest { reserved "withSwapFee"; } +//=============================== PoolsWithFilter + +message QueryPoolsWithFilterRequest { + repeated cosmos.base.v1beta1.Coin min_liquidity = 1 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.moretags) = "yaml:\"min_liquidity\"", + (gogoproto.nullable) = false + ]; + string pool_type = 2; + cosmos.base.query.v1beta1.PageRequest pagination = 3; +} + +message QueryPoolsWithFilterResponse { + repeated google.protobuf.Any pools = 1 + [ (cosmos_proto.accepts_interface) = "PoolI" ]; + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + // QuerySpotPriceResponse defines the gRPC response structure for a SpotPrice // query. message QuerySpotPriceResponse { + option deprecated = true; // String of the Dec. Ex) 10.203uatom string spot_price = 1 [ (gogoproto.moretags) = "yaml:\"spot_price\"" ]; } //=============================== EstimateSwapExactAmountIn message QuerySwapExactAmountInRequest { + // TODO: CHANGE THIS TO RESERVED IN A PATCH RELEASE string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; uint64 pool_id = 2 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; string token_in = 3 [ (gogoproto.moretags) = "yaml:\"token_in\"" ]; @@ -180,6 +279,7 @@ message QuerySwapExactAmountInResponse { //=============================== EstimateSwapExactAmountOut message QuerySwapExactAmountOutRequest { + // TODO: CHANGE THIS TO RESERVED IN A PATCH RELEASE string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; uint64 pool_id = 2 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; repeated SwapAmountOutRoute routes = 3 [ diff --git a/__fixtures__/chain1/osmosis/gamm/v1beta1/tx.proto b/__fixtures__/chain1/osmosis/gamm/v1beta1/tx.proto index acaa7b8cb1..1421e624bc 100644 --- a/__fixtures__/chain1/osmosis/gamm/v1beta1/tx.proto +++ b/__fixtures__/chain1/osmosis/gamm/v1beta1/tx.proto @@ -4,7 +4,7 @@ package osmosis.gamm.v1beta1; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; -option go_package = "github.com/osmosis-labs/osmosis/v12/x/gamm/types"; +option go_package = "github.com/osmosis-labs/osmosis/v13/x/gamm/types"; service Msg { rpc JoinPool(MsgJoinPool) returns (MsgJoinPoolResponse); @@ -26,6 +26,7 @@ service Msg { // ===================== MsgJoinPool // This is really MsgJoinPoolNoSwap message MsgJoinPool { + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; uint64 pool_id = 2 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; string share_out_amount = 3 [ diff --git a/__fixtures__/chain1/osmosis/gamm/v2/query.proto b/__fixtures__/chain1/osmosis/gamm/v2/query.proto new file mode 100644 index 0000000000..02ec334c9c --- /dev/null +++ b/__fixtures__/chain1/osmosis/gamm/v2/query.proto @@ -0,0 +1,38 @@ +syntax = "proto3"; +package osmosis.gamm.v2; + +import "gogoproto/gogo.proto"; +import "osmosis/gamm/v1beta1/tx.proto"; + +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "google/api/annotations.proto"; +import "google/protobuf/any.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v13/x/gamm/v2types"; + +service Query { + // SpotPrice defines a gRPC query handler that returns the spot price given + // a base denomination and a quote denomination. + rpc SpotPrice(QuerySpotPriceRequest) returns (QuerySpotPriceResponse) { + option (google.api.http).get = "/osmosis/gamm/v2/pools/{pool_id}/prices"; + } +} + +// QuerySpotPriceRequest defines the gRPC request structure for a SpotPrice +// query. +message QuerySpotPriceRequest { + uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; + string base_asset_denom = 2 + [ (gogoproto.moretags) = "yaml:\"base_asset_denom\"" ]; + string quote_asset_denom = 3 + [ (gogoproto.moretags) = "yaml:\"quote_asset_denom\"" ]; +} + +// QuerySpotPriceResponse defines the gRPC response structure for a SpotPrice +// query. +message QuerySpotPriceResponse { + // String of the Dec. Ex) 10.203uatom + string spot_price = 1 [ (gogoproto.moretags) = "yaml:\"spot_price\"" ]; +} diff --git a/__fixtures__/chain1/osmosis/ibc-rate-limit/v1beta1/params.proto b/__fixtures__/chain1/osmosis/ibc-rate-limit/v1beta1/params.proto new file mode 100644 index 0000000000..5f66b2b3d1 --- /dev/null +++ b/__fixtures__/chain1/osmosis/ibc-rate-limit/v1beta1/params.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +package osmosis.ibcratelimit.v1beta1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v13/x/ibc-rate-limit/types"; + +// Params defines the parameters for the ibc-rate-limit module. +message Params { + string contract_address = 1 + [ (gogoproto.moretags) = "yaml:\"contract_address\"" ]; +} diff --git a/__fixtures__/chain1/osmosis/ibc-rate-limit/v1beta1/query.proto b/__fixtures__/chain1/osmosis/ibc-rate-limit/v1beta1/query.proto new file mode 100644 index 0000000000..01d2eb2ddf --- /dev/null +++ b/__fixtures__/chain1/osmosis/ibc-rate-limit/v1beta1/query.proto @@ -0,0 +1,27 @@ +syntax = "proto3"; +package osmosis.ibcratelimit.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "osmosis/ibc-rate-limit/v1beta1/params.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v13/x/ibc-rate-limit/types"; + +// Query defines the gRPC querier service. +service Query { + // Params defines a gRPC query method that returns the ibc-rate-limit module's + // parameters. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/osmosis/ibc-rate-limit/v1beta1/params"; + } +} + +// QueryParamsRequest is the request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is the response type for the Query/Params RPC method. +message QueryParamsResponse { + // params defines the parameters of the module. + Params params = 1 [ (gogoproto.nullable) = false ]; +} diff --git a/__fixtures__/chain1/osmosis/incentives/gauge.proto b/__fixtures__/chain1/osmosis/incentives/gauge.proto index 63219eb01a..39fc45deb0 100644 --- a/__fixtures__/chain1/osmosis/incentives/gauge.proto +++ b/__fixtures__/chain1/osmosis/incentives/gauge.proto @@ -7,7 +7,7 @@ import "google/protobuf/timestamp.proto"; import "cosmos/base/v1beta1/coin.proto"; import "osmosis/lockup/lock.proto"; -option go_package = "github.com/osmosis-labs/osmosis/v12/x/incentives/types"; +option go_package = "github.com/osmosis-labs/osmosis/v13/x/incentives/types"; // Gauge is an object that stores and distributes yields to recipients who // satisfy certain conditions. Currently gauges support conditions around the diff --git a/__fixtures__/chain1/osmosis/incentives/genesis.proto b/__fixtures__/chain1/osmosis/incentives/genesis.proto index 7914fa2cf6..402970b0ab 100644 --- a/__fixtures__/chain1/osmosis/incentives/genesis.proto +++ b/__fixtures__/chain1/osmosis/incentives/genesis.proto @@ -6,7 +6,7 @@ import "google/protobuf/duration.proto"; import "osmosis/incentives/params.proto"; import "osmosis/incentives/gauge.proto"; -option go_package = "github.com/osmosis-labs/osmosis/v12/x/incentives/types"; +option go_package = "github.com/osmosis-labs/osmosis/v13/x/incentives/types"; // GenesisState defines the incentives module's various parameters when first // initialized diff --git a/__fixtures__/chain1/osmosis/incentives/params.proto b/__fixtures__/chain1/osmosis/incentives/params.proto index 49bc9ca531..9056bb3646 100644 --- a/__fixtures__/chain1/osmosis/incentives/params.proto +++ b/__fixtures__/chain1/osmosis/incentives/params.proto @@ -3,7 +3,7 @@ package osmosis.incentives; import "gogoproto/gogo.proto"; -option go_package = "github.com/osmosis-labs/osmosis/v12/x/incentives/types"; +option go_package = "github.com/osmosis-labs/osmosis/v13/x/incentives/types"; // Params holds parameters for the incentives module message Params { diff --git a/__fixtures__/chain1/osmosis/incentives/query.proto b/__fixtures__/chain1/osmosis/incentives/query.proto index 525ae22842..d2d0e64fcc 100644 --- a/__fixtures__/chain1/osmosis/incentives/query.proto +++ b/__fixtures__/chain1/osmosis/incentives/query.proto @@ -9,7 +9,7 @@ import "cosmos/base/query/v1beta1/pagination.proto"; import "osmosis/incentives/gauge.proto"; import "osmosis/lockup/lock.proto"; -option go_package = "github.com/osmosis-labs/osmosis/v12/x/incentives/types"; +option go_package = "github.com/osmosis-labs/osmosis/v13/x/incentives/types"; // Query defines the gRPC querier service service Query { @@ -19,13 +19,6 @@ service Query { option (google.api.http).get = "/osmosis/incentives/v1beta1/module_to_distribute_coins"; } - // ModuleDistributedCoins returns coins that are distributed by the module so - // far - rpc ModuleDistributedCoins(ModuleDistributedCoinsRequest) - returns (ModuleDistributedCoinsResponse) { - option (google.api.http).get = - "/osmosis/incentives/v1beta1/module_distributed_coins"; - } // GaugeByID returns gauges by their respective ID rpc GaugeByID(GaugeByIDRequest) returns (GaugeByIDResponse) { @@ -84,15 +77,6 @@ message ModuleToDistributeCoinsResponse { ]; } -message ModuleDistributedCoinsRequest {} -message ModuleDistributedCoinsResponse { - // Coins that have been distributed already - repeated cosmos.base.v1beta1.Coin coins = 1 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; -} - message GaugeByIDRequest { // Gague ID being queried uint64 id = 1; diff --git a/__fixtures__/chain1/osmosis/incentives/tx.proto b/__fixtures__/chain1/osmosis/incentives/tx.proto index fcdfd9e060..b088165076 100644 --- a/__fixtures__/chain1/osmosis/incentives/tx.proto +++ b/__fixtures__/chain1/osmosis/incentives/tx.proto @@ -7,7 +7,7 @@ import "cosmos/base/v1beta1/coin.proto"; import "osmosis/incentives/gauge.proto"; import "osmosis/lockup/lock.proto"; -option go_package = "github.com/osmosis-labs/osmosis/v12/x/incentives/types"; +option go_package = "github.com/osmosis-labs/osmosis/v13/x/incentives/types"; service Msg { rpc CreateGauge(MsgCreateGauge) returns (MsgCreateGaugeResponse); diff --git a/__fixtures__/chain1/osmosis/lockup/genesis.proto b/__fixtures__/chain1/osmosis/lockup/genesis.proto index 917e4042de..ff486713c4 100644 --- a/__fixtures__/chain1/osmosis/lockup/genesis.proto +++ b/__fixtures__/chain1/osmosis/lockup/genesis.proto @@ -4,7 +4,7 @@ package osmosis.lockup; import "gogoproto/gogo.proto"; import "osmosis/lockup/lock.proto"; -option go_package = "github.com/osmosis-labs/osmosis/v12/x/lockup/types"; +option go_package = "github.com/osmosis-labs/osmosis/v13/x/lockup/types"; // GenesisState defines the lockup module's genesis state. message GenesisState { diff --git a/__fixtures__/chain1/osmosis/lockup/lock.proto b/__fixtures__/chain1/osmosis/lockup/lock.proto index 87bb792e1c..577a8d2b32 100644 --- a/__fixtures__/chain1/osmosis/lockup/lock.proto +++ b/__fixtures__/chain1/osmosis/lockup/lock.proto @@ -6,7 +6,7 @@ import "google/protobuf/duration.proto"; import "google/protobuf/timestamp.proto"; import "cosmos/base/v1beta1/coin.proto"; -option go_package = "github.com/osmosis-labs/osmosis/v12/x/lockup/types"; +option go_package = "github.com/osmosis-labs/osmosis/v13/x/lockup/types"; // PeriodLock is a single lock unit by period defined by the x/lockup module. // It's a record of a locked coin at a specific time. It stores owner, duration, diff --git a/__fixtures__/chain1/osmosis/lockup/params.proto b/__fixtures__/chain1/osmosis/lockup/params.proto new file mode 100644 index 0000000000..1c66228f3f --- /dev/null +++ b/__fixtures__/chain1/osmosis/lockup/params.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; +package osmosis.lockup; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v13/x/lockup/types"; + +message Params { + repeated string force_unlock_allowed_addresses = 1 + [ (gogoproto.moretags) = "yaml:\"force_unlock_allowed_address\"" ]; +} diff --git a/__fixtures__/chain1/osmosis/lockup/query.proto b/__fixtures__/chain1/osmosis/lockup/query.proto index 53221e0516..8e69afbf17 100644 --- a/__fixtures__/chain1/osmosis/lockup/query.proto +++ b/__fixtures__/chain1/osmosis/lockup/query.proto @@ -7,8 +7,9 @@ import "google/api/annotations.proto"; import "google/protobuf/timestamp.proto"; import "google/protobuf/duration.proto"; import "osmosis/lockup/lock.proto"; +import "osmosis/lockup/params.proto"; -option go_package = "github.com/osmosis-labs/osmosis/v12/x/lockup/types"; +option go_package = "github.com/osmosis-labs/osmosis/v13/x/lockup/types"; // Query defines the gRPC querier service. service Query { @@ -118,6 +119,10 @@ service Query { option (google.api.http).get = "/osmosis/lockup/v1beta1/account_locked_longer_duration_denom/{owner}"; } + // Params returns lockup params. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/osmosis/lockup/v1beta1/params"; + } } message ModuleBalanceRequest {}; @@ -287,3 +292,8 @@ message AccountLockedLongerDurationDenomRequest { message AccountLockedLongerDurationDenomResponse { repeated PeriodLock locks = 1 [ (gogoproto.nullable) = false ]; }; + +message QueryParamsRequest {} +message QueryParamsResponse { + Params params = 1 [ (gogoproto.nullable) = false ]; +} diff --git a/__fixtures__/chain1/osmosis/lockup/tx.proto b/__fixtures__/chain1/osmosis/lockup/tx.proto index 147317d26f..9d5c064253 100644 --- a/__fixtures__/chain1/osmosis/lockup/tx.proto +++ b/__fixtures__/chain1/osmosis/lockup/tx.proto @@ -6,7 +6,7 @@ import "google/protobuf/duration.proto"; import "cosmos/base/v1beta1/coin.proto"; import "osmosis/lockup/lock.proto"; -option go_package = "github.com/osmosis-labs/osmosis/v12/x/lockup/types"; +option go_package = "github.com/osmosis-labs/osmosis/v13/x/lockup/types"; // Msg defines the Msg service. service Msg { @@ -19,6 +19,7 @@ service Msg { rpc BeginUnlocking(MsgBeginUnlocking) returns (MsgBeginUnlockingResponse); // MsgEditLockup edits the existing lockups by lock ID rpc ExtendLockup(MsgExtendLockup) returns (MsgExtendLockupResponse); + rpc ForceUnlock(MsgForceUnlock) returns (MsgForceUnlockResponse); } message MsgLockTokens { @@ -71,3 +72,17 @@ message MsgExtendLockup { } message MsgExtendLockupResponse { bool success = 1; } + +// MsgForceUnlock unlocks locks immediately for +// addresses registered via governance. +message MsgForceUnlock { + string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ]; + uint64 ID = 2; + // Amount of unlocking coins. Unlock all if not set. + repeated cosmos.base.v1beta1.Coin coins = 3 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +message MsgForceUnlockResponse { bool success = 1; } \ No newline at end of file diff --git a/__fixtures__/chain1/osmosis/mint/v1beta1/genesis.proto b/__fixtures__/chain1/osmosis/mint/v1beta1/genesis.proto index ebd40fbc88..67534debf9 100644 --- a/__fixtures__/chain1/osmosis/mint/v1beta1/genesis.proto +++ b/__fixtures__/chain1/osmosis/mint/v1beta1/genesis.proto @@ -4,7 +4,7 @@ package osmosis.mint.v1beta1; import "gogoproto/gogo.proto"; import "osmosis/mint/v1beta1/mint.proto"; -option go_package = "github.com/osmosis-labs/osmosis/v12/x/mint/types"; +option go_package = "github.com/osmosis-labs/osmosis/v13/x/mint/types"; // GenesisState defines the mint module's genesis state. message GenesisState { diff --git a/__fixtures__/chain1/osmosis/mint/v1beta1/mint.proto b/__fixtures__/chain1/osmosis/mint/v1beta1/mint.proto index 2fec07c864..d0a8223f4d 100644 --- a/__fixtures__/chain1/osmosis/mint/v1beta1/mint.proto +++ b/__fixtures__/chain1/osmosis/mint/v1beta1/mint.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package osmosis.mint.v1beta1; -option go_package = "github.com/osmosis-labs/osmosis/v12/x/mint/types"; +option go_package = "github.com/osmosis-labs/osmosis/v13/x/mint/types"; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; diff --git a/__fixtures__/chain1/osmosis/mint/v1beta1/query.proto b/__fixtures__/chain1/osmosis/mint/v1beta1/query.proto index 5697b7b145..9960e6efb4 100644 --- a/__fixtures__/chain1/osmosis/mint/v1beta1/query.proto +++ b/__fixtures__/chain1/osmosis/mint/v1beta1/query.proto @@ -5,7 +5,7 @@ import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "osmosis/mint/v1beta1/mint.proto"; -option go_package = "github.com/osmosis-labs/osmosis/v12/x/mint/types"; +option go_package = "github.com/osmosis-labs/osmosis/v13/x/mint/types"; // Query provides defines the gRPC querier service. service Query { diff --git a/__fixtures__/chain1/osmosis/pool-incentives/v1beta1/genesis.proto b/__fixtures__/chain1/osmosis/pool-incentives/v1beta1/genesis.proto index e041047357..5130202917 100644 --- a/__fixtures__/chain1/osmosis/pool-incentives/v1beta1/genesis.proto +++ b/__fixtures__/chain1/osmosis/pool-incentives/v1beta1/genesis.proto @@ -5,7 +5,7 @@ import "gogoproto/gogo.proto"; import "google/protobuf/duration.proto"; import "osmosis/pool-incentives/v1beta1/incentives.proto"; -option go_package = "github.com/osmosis-labs/osmosis/v12/x/pool-incentives/types"; +option go_package = "github.com/osmosis-labs/osmosis/v13/x/pool-incentives/types"; // GenesisState defines the pool incentives module's genesis state. message GenesisState { diff --git a/__fixtures__/chain1/osmosis/pool-incentives/v1beta1/gov.proto b/__fixtures__/chain1/osmosis/pool-incentives/v1beta1/gov.proto index c69ab2a117..d0a48bca00 100644 --- a/__fixtures__/chain1/osmosis/pool-incentives/v1beta1/gov.proto +++ b/__fixtures__/chain1/osmosis/pool-incentives/v1beta1/gov.proto @@ -4,7 +4,7 @@ package osmosis.poolincentives.v1beta1; import "gogoproto/gogo.proto"; import "osmosis/pool-incentives/v1beta1/incentives.proto"; -option go_package = "github.com/osmosis-labs/osmosis/v12/x/pool-incentives/types"; +option go_package = "github.com/osmosis-labs/osmosis/v13/x/pool-incentives/types"; // ReplacePoolIncentivesProposal is a gov Content type for updating the pool // incentives. If a ReplacePoolIncentivesProposal passes, the proposal’s records @@ -17,6 +17,7 @@ message ReplacePoolIncentivesProposal { option (gogoproto.equal) = true; option (gogoproto.goproto_getters) = false; option (gogoproto.goproto_stringer) = false; + option (cosmos_proto.implements_interface) = "ProposalContentI"; string title = 1; string description = 2; @@ -43,6 +44,8 @@ message UpdatePoolIncentivesProposal { option (gogoproto.goproto_getters) = false; option (gogoproto.goproto_stringer) = false; + option (cosmos_proto.implements_interface) = "ProposalContentI"; + string title = 1; string description = 2; repeated DistrRecord records = 3 [ (gogoproto.nullable) = false ]; diff --git a/__fixtures__/chain1/osmosis/pool-incentives/v1beta1/incentives.proto b/__fixtures__/chain1/osmosis/pool-incentives/v1beta1/incentives.proto index 7693add19c..f26183a404 100644 --- a/__fixtures__/chain1/osmosis/pool-incentives/v1beta1/incentives.proto +++ b/__fixtures__/chain1/osmosis/pool-incentives/v1beta1/incentives.proto @@ -4,7 +4,7 @@ package osmosis.poolincentives.v1beta1; import "gogoproto/gogo.proto"; import "google/protobuf/duration.proto"; -option go_package = "github.com/osmosis-labs/osmosis/v12/x/pool-incentives/types"; +option go_package = "github.com/osmosis-labs/osmosis/v13/x/pool-incentives/types"; message Params { option (gogoproto.goproto_stringer) = false; diff --git a/__fixtures__/chain1/osmosis/pool-incentives/v1beta1/query.proto b/__fixtures__/chain1/osmosis/pool-incentives/v1beta1/query.proto index 50b046314c..3af16e93a7 100644 --- a/__fixtures__/chain1/osmosis/pool-incentives/v1beta1/query.proto +++ b/__fixtures__/chain1/osmosis/pool-incentives/v1beta1/query.proto @@ -7,7 +7,7 @@ import "google/protobuf/duration.proto"; import "osmosis/incentives/gauge.proto"; import "osmosis/pool-incentives/v1beta1/incentives.proto"; -option go_package = "github.com/osmosis-labs/osmosis/v12/x/pool-incentives/types"; +option go_package = "github.com/osmosis-labs/osmosis/v13/x/pool-incentives/types"; service Query { // GaugeIds takes the pool id and returns the matching gauge ids and durations diff --git a/__fixtures__/chain1/osmosis/streamswap/v1/event.proto b/__fixtures__/chain1/osmosis/streamswap/v1/event.proto deleted file mode 100644 index 1769d18bbb..0000000000 --- a/__fixtures__/chain1/osmosis/streamswap/v1/event.proto +++ /dev/null @@ -1,42 +0,0 @@ -syntax = "proto3"; -package osmosis.streamswap.v1; - -import "cosmos/base/v1beta1/coin.proto"; -import "cosmos_proto/cosmos.proto"; -import "gogoproto/gogo.proto"; - -option go_package = "github.com/osmosis-labs/osmosis/v12/x/streamswap/types"; -option (gogoproto.goproto_getters_all) = false; - -message EventCreateSale { - uint64 id = 1; - string creator = 2; - string token_in = 3; - cosmos.base.v1beta1.Coin token_out = 4 [ (gogoproto.nullable) = false ]; -} - -message EventSubscribe { - string sender = 1; - uint64 sale_id = 2; - string amount = 3; -} - -message EventWithdraw { - string sender = 1; - uint64 sale_id = 2; - // amount of staked token_in withdrawn by user. - string amount = 3; -} - -message EventExit { - string sender = 1; - uint64 sale_id = 2; - // amount of purchased token_out sent to the user - string purchased = 3; -} - -message EventFinalizeSale { - uint64 sale_id = 1; - // amount of earned tokens_in - string income = 3; -} diff --git a/__fixtures__/chain1/osmosis/streamswap/v1/genesis.proto b/__fixtures__/chain1/osmosis/streamswap/v1/genesis.proto deleted file mode 100644 index b9f7922c90..0000000000 --- a/__fixtures__/chain1/osmosis/streamswap/v1/genesis.proto +++ /dev/null @@ -1,27 +0,0 @@ -syntax = "proto3"; -package osmosis.streamswap.v1; - -import "gogoproto/gogo.proto"; -import "cosmos_proto/cosmos.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "osmosis/streamswap/v1/state.proto"; -import "osmosis/streamswap/v1/params.proto"; - -option go_package = "github.com/osmosis-labs/osmosis/v12/x/streamswap/types"; - -// GenesisState defines the streamswap module's genesis state. -message GenesisState { - repeated Sale sales = 1 [ (gogoproto.nullable) = false ]; - repeated UserPositionKV user_positions = 2 [ (gogoproto.nullable) = false ]; - uint64 next_sale_id = 3; - Params params = 4 [ (gogoproto.nullable) = false ]; -} - -// UserPositionKV is a record in genesis representing acc_address user position -// of a sale_id sale. -message UserPositionKV { - // user account address - string acc_address = 1; - uint64 sale_id = 2; - UserPosition user_position = 3 [ (gogoproto.nullable) = false ]; -} diff --git a/__fixtures__/chain1/osmosis/streamswap/v1/params.proto b/__fixtures__/chain1/osmosis/streamswap/v1/params.proto deleted file mode 100644 index ec2d04dbf7..0000000000 --- a/__fixtures__/chain1/osmosis/streamswap/v1/params.proto +++ /dev/null @@ -1,34 +0,0 @@ -syntax = "proto3"; -package osmosis.streamswap.v1; - -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; -import "cosmos_proto/cosmos.proto"; -import "cosmos/base/v1beta1/coin.proto"; - -import "google/protobuf/duration.proto"; - -option go_package = "github.com/osmosis-labs/osmosis/v12/x/streamswap/types"; - -// Params holds parameters for the streamswap module -message Params { - // fee charged when creating a new sale. The fee will go to the - // sale_fee_recipient unless it is not defined (empty). - repeated cosmos.base.v1beta1.Coin sale_creation_fee = 1 [ - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", - (gogoproto.moretags) = "yaml:\"sale_creation_fee\"", - (gogoproto.nullable) = false - ]; - - // bech32 address of the fee recipient - string sale_creation_fee_recipient = 2; - - // minimum amount duration of time between the sale creation and the sale - // start time. - google.protobuf.Duration min_duration_until_start_time = 3 - [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; - - // minimum duration for every new sale. - google.protobuf.Duration min_sale_duration = 4 - [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; -} diff --git a/__fixtures__/chain1/osmosis/streamswap/v1/query.proto b/__fixtures__/chain1/osmosis/streamswap/v1/query.proto deleted file mode 100644 index 1a522a9e82..0000000000 --- a/__fixtures__/chain1/osmosis/streamswap/v1/query.proto +++ /dev/null @@ -1,63 +0,0 @@ -syntax = "proto3"; -package osmosis.streamswap.v1; - -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; - -import "osmosis/streamswap/v1/state.proto"; - -option go_package = "github.com/osmosis-labs/osmosis/v12/x/streamswap/types"; -option (gogoproto.goproto_getters_all) = false; - -// Query defines the gRPC querier service. -service Query { - // Returns list of Sales ordered by the creation time - rpc Sales(QuerySales) returns (QuerySalesResponse) { - option (google.api.http).get = "/cosmos/streamswap/v1/sales"; - } - - // Returns the specific Sale object - rpc Sale(QuerySale) returns (QuerySaleResponse) { - option (google.api.http).get = "/cosmos/streamswap/v1/sales/{sale_id}"; - } - - rpc UserPosition(QueryUserPosition) returns (QueryUserPositionResponse) { - option (google.api.http).get = - "/cosmos/streamswap/v1/sales/{sale_id}/{user}"; - } -} - -message QuerySales { - // pagination defines an pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -message QuerySalesResponse { - repeated osmosis.streamswap.v1.Sale sales = 1 - [ (gogoproto.nullable) = false ]; - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// Request type for Query/Sale -message QuerySale { - // Sale ID - uint64 sale_id = 1; -} - -message QuerySaleResponse { - osmosis.streamswap.v1.Sale sale = 1 [ (gogoproto.nullable) = false ]; -} - -// Request type for Query/Sale -message QueryUserPosition { - // ID of the Sale - uint64 sale_id = 1; - // user account address - string user = 2; -} - -message QueryUserPositionResponse { - osmosis.streamswap.v1.UserPosition user_position = 1 - [ (gogoproto.nullable) = false ]; -} diff --git a/__fixtures__/chain1/osmosis/streamswap/v1/state.proto b/__fixtures__/chain1/osmosis/streamswap/v1/state.proto deleted file mode 100644 index 9e1f85be7b..0000000000 --- a/__fixtures__/chain1/osmosis/streamswap/v1/state.proto +++ /dev/null @@ -1,114 +0,0 @@ -syntax = "proto3"; -package osmosis.streamswap.v1; - -import "google/protobuf/timestamp.proto"; -import "cosmos_proto/cosmos.proto"; -import "gogoproto/gogo.proto"; - -option go_package = "github.com/osmosis-labs/osmosis/v12/x/streamswap/types"; -option (gogoproto.goproto_getters_all) = false; - -message Sale { - // Destination for the earned token_in - string treasury = 1; - uint64 id = 2; - - // token_out is a token denom to be bootstraped. May be referred as base - // currency, or a sale token. - string token_out = 3; - // token_in is a token denom used to buy sale tokens (`token_out`). May be - // referred as quote_currency or payment token. - string token_in = 4; - - // total number of `tokens_out` to be sold during the continuous sale. - string token_out_supply = 5 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false - ]; - - // start time when the token emission starts. - google.protobuf.Timestamp start_time = 6 - [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; - // end time when the token emission ends. Can't be bigger than start + - // 139years (to avoid round overflow) - google.protobuf.Timestamp end_time = 7 - [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; - - // Round number when the sale was last time updated. - int64 round = 8; - - // Last round of the Sale; - int64 end_round = 9; - - // amout of remaining token_out to sell - string out_remaining = 10 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false - ]; - - // amount of token_out sold - string out_sold = 11 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false - ]; - - // out token per share - string out_per_share = 12 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false - ]; - - // total amount of currently staked coins (token_in) but not spent coins. - string staked = 13 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false - ]; - // total amount of earned coins (token_in) - string income = 14 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false - ]; - - // total amount of shares - string shares = 15 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false - ]; - - // Name for the sale. - string name = 20; - // URL with sale and project details. - string url = 21; -} - -// UserPosition represents user account in a sale -message UserPosition { - - string shares = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false - ]; - // total number of currently staked tokens - string staked = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false - ]; - - // last token/share ratio - string out_per_share = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false - ]; - - // amount of token_in spent - string spent = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false - ]; - - // Amount of accumulated, not withdrawn, purchased tokens (token_out) - string purchased = 5 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false - ]; -} diff --git a/__fixtures__/chain1/osmosis/streamswap/v1/tx.proto b/__fixtures__/chain1/osmosis/streamswap/v1/tx.proto deleted file mode 100644 index 32029e3c51..0000000000 --- a/__fixtures__/chain1/osmosis/streamswap/v1/tx.proto +++ /dev/null @@ -1,141 +0,0 @@ -syntax = "proto3"; -package osmosis.streamswap.v1; - -import "gogoproto/gogo.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "google/protobuf/empty.proto"; - -import "cosmos/base/v1beta1/coin.proto"; -import "cosmos_proto/cosmos.proto"; - -option go_package = "github.com/osmosis-labs/osmosis/v12/x/streamswap/types"; -option (gogoproto.goproto_getters_all) = false; - -service Msg { - // CreateSale creates new token sale. Anyone can create a new sale. - // params.SaleBond OSMO will be charged as a bond (returned in FinalizeSale) - // to avoid spams. - // The sale follows the streamswap functionality explained in the - // x/launchapd/spec - rpc CreateSale(MsgCreateSale) returns (MsgCreateSaleResponse); - - // Subscribe to a token sale. Any use at any time before the sale end can join - // the sale by sending `token_in` to the Sale through the Subscribe msg. - // During the sale, user `token_in` will be automatically charged every - // epoch to purchase `token_out`. - rpc Subscribe(MsgSubscribe) returns (google.protobuf.Empty); - - // Withdraw sends back `amount` of unspent tokens_in to the user. - // If `amount` is empty, it will default to all unspent tokens. - // User can do it any time unless his deposit is empty. - rpc Withdraw(MsgWithdraw) returns (google.protobuf.Empty); - - // ExitSale withdraws (by a user who subscribed to the sale) purchased - // tokens_out from the pool and remained tokens_in. Must be called before - // the sale end. - rpc ExitSale(MsgExitSale) returns (MsgExitSaleResponse); - - // FinalizeSale clean ups the sale and sends income (earned tokens_in) to the - // Sale recipient. Returns error if called before the Sale end. Anyone can - // call this method. - rpc FinalizeSale(MsgFinalizeSale) returns (MsgFinalizeSaleResponse); -} - -message MsgCreateSale { - // Sale creator and the account which provides token (token_out) to the sale. - // When processing this message, token_out - string creator = 1; - // token_in is a denom used to buy `token_out`. May be referred as a - // "quote currency". - string token_in = 2; - // token_out is a coin supply (denom + amount) to sell. May be referred as - // "base currency". The whole supply will be transferred from the creator - // to the module and will be sold during the sale. - cosmos.base.v1beta1.Coin token_out = 3 [ (gogoproto.nullable) = false ]; - - // Maximum fee the creator is going to pay for creating a sale. The creator - // will be charged params.SaleCreationFee. Transaction will fail if - // max_fee is smaller than params.SaleCreationFee. If empty, the creator - // doesn't accept any fee. - repeated cosmos.base.v1beta1.Coin max_fee = 4 - [ (gogoproto.nullable) = false ]; - - // start time when the token sale starts. - google.protobuf.Timestamp start_time = 5 - [ (gogoproto.nullable) = false, (gogoproto.stdtime) = true ]; - // duration time that the sale takes place over - google.protobuf.Duration duration = 6 - [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; - - // Recipient is the account which receives earned `token_in` from when the - // sale is finalized. If not defined (empty) the creator - // account will be used. - string recipient = 7; - - // Name for the sale, max 40 characters, min 4. Required. - string name = 8; - // URL with sale and project details. Can be a link a link to IPFS, - // hackmd, project page, blog post... Max 120 characters. Must be - // valid agains Go url.ParseRequestURI. Required. - string url = 9; -} - -message MsgCreateSaleResponse { - uint64 sale_id = 1 [ (gogoproto.moretags) = "yaml:\"sale_id\"" ]; -} - -message MsgSubscribe { - // sender is an account address adding a deposit - string sender = 1; - // ID of an existing sale. - uint64 sale_id = 2 [ (gogoproto.moretags) = "yaml:\"sale_id\"" ]; - // number of sale.token_in staked by a user. - string amount = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false - ]; -} - -message MsgWithdraw { - // sender is an account address subscribed to the sale_id - string sender = 1; - // ID of a sale. - uint64 sale_id = 2 [ (gogoproto.moretags) = "yaml:\"sale_id\"" ]; - // amount of tokens_in to withdraw. Must be at most the amount of not spent - // tokens, unless set to null - then all remaining balance will be withdrawn. - string amount = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = true - ]; -} - -message MsgExitSale { - // sender is an account address exiting a sale - string sender = 1; - // ID of an existing sale. - uint64 sale_id = 2 [ (gogoproto.moretags) = "yaml:\"sale_id\"" ]; -} - -message MsgExitSaleResponse { - // Purchased amount of "out" tokens withdrawn to the user. - string purchased = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false - ]; -} - -message MsgFinalizeSale { - // sender is an account signing the message and triggering the finalization. - string sender = 1; - // ID of an existing sale. - uint64 sale_id = 2 [ (gogoproto.moretags) = "yaml:\"sale_id\"" ]; -} - -message MsgFinalizeSaleResponse { - // Income amount of token_in sent to the sale recipient. - string income = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false - ]; -} diff --git a/__fixtures__/chain1/osmosis/store/v1beta1/tree.proto b/__fixtures__/chain1/osmosis/sumtree/v1beta1/tree.proto similarity index 83% rename from __fixtures__/chain1/osmosis/store/v1beta1/tree.proto rename to __fixtures__/chain1/osmosis/sumtree/v1beta1/tree.proto index 3373406fe4..ff9a1f327c 100644 --- a/__fixtures__/chain1/osmosis/store/v1beta1/tree.proto +++ b/__fixtures__/chain1/osmosis/sumtree/v1beta1/tree.proto @@ -4,7 +4,7 @@ package osmosis.store.v1beta1; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; -option go_package = "github.com/osmosis-labs/osmosis/v12/store"; +option go_package = "github.com/osmosis-labs/osmosis/v13/osmoutils/sumtree"; message Node { repeated Child children = 1; } diff --git a/__fixtures__/chain1/osmosis/superfluid/genesis.proto b/__fixtures__/chain1/osmosis/superfluid/genesis.proto index 6444092171..a068d0ff91 100644 --- a/__fixtures__/chain1/osmosis/superfluid/genesis.proto +++ b/__fixtures__/chain1/osmosis/superfluid/genesis.proto @@ -5,7 +5,7 @@ import "gogoproto/gogo.proto"; import "osmosis/superfluid/superfluid.proto"; import "osmosis/superfluid/params.proto"; -option go_package = "github.com/osmosis-labs/osmosis/v12/x/superfluid/types"; +option go_package = "github.com/osmosis-labs/osmosis/v13/x/superfluid/types"; // GenesisState defines the module's genesis state. message GenesisState { diff --git a/__fixtures__/chain1/osmosis/superfluid/params.proto b/__fixtures__/chain1/osmosis/superfluid/params.proto index 07d40a5641..754f6a7e8f 100644 --- a/__fixtures__/chain1/osmosis/superfluid/params.proto +++ b/__fixtures__/chain1/osmosis/superfluid/params.proto @@ -4,7 +4,7 @@ package osmosis.superfluid; import "gogoproto/gogo.proto"; import "google/protobuf/duration.proto"; -option go_package = "github.com/osmosis-labs/osmosis/v12/x/superfluid/types"; +option go_package = "github.com/osmosis-labs/osmosis/v13/x/superfluid/types"; // Params holds parameters for the superfluid module message Params { diff --git a/__fixtures__/chain1/osmosis/superfluid/query.proto b/__fixtures__/chain1/osmosis/superfluid/query.proto index 5470eba885..71f80d6296 100644 --- a/__fixtures__/chain1/osmosis/superfluid/query.proto +++ b/__fixtures__/chain1/osmosis/superfluid/query.proto @@ -12,7 +12,7 @@ import "osmosis/lockup/lock.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; import "cosmos/staking/v1beta1/staking.proto"; -option go_package = "github.com/osmosis-labs/osmosis/v12/x/superfluid/types"; +option go_package = "github.com/osmosis-labs/osmosis/v13/x/superfluid/types"; // Query defines the gRPC querier service. service Query { @@ -53,6 +53,11 @@ service Query { "/osmosis/superfluid/v1beta1/connected_intermediary_account/{lock_id}"; } + // Returns the amount of delegations of specific denom for all validators + rpc TotalDelegationByValidatorForDenom( + QueryTotalDelegationByValidatorForDenomRequest) + returns (QueryTotalDelegationByValidatorForDenomResponse) {} + // Returns the total amount of osmo superfluidly staked. // Response is denominated in uosmo. rpc TotalSuperfluidDelegations(TotalSuperfluidDelegationsRequest) @@ -112,6 +117,13 @@ service Query { "/osmosis/superfluid/v1beta1/" "total_delegation_by_delegator/{delegator_address}"; } + + // Returns a list of whitelisted pool ids to unpool. + rpc UnpoolWhitelist(QueryUnpoolWhitelistRequest) + returns (QueryUnpoolWhitelistResponse) { + option (google.api.http).get = "/osmosis/superfluid/v1beta1/" + "unpool_whitelist"; + } } message QueryParamsRequest {} @@ -153,6 +165,24 @@ message ConnectedIntermediaryAccountResponse { SuperfluidIntermediaryAccountInfo account = 1; } +message QueryTotalDelegationByValidatorForDenomRequest { string denom = 1; } +message QueryTotalDelegationByValidatorForDenomResponse { + repeated Delegations assets = 1 [ (gogoproto.nullable) = false ]; +} + +message Delegations { + string val_addr = 1; + string amount_sfsd = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"amount_sfsd\"", + (gogoproto.nullable) = false + ]; + string osmo_equivalent = 3 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"osmo_equivalent\"", + (gogoproto.nullable) = false + ]; +} message TotalSuperfluidDelegationsRequest {} message TotalSuperfluidDelegationsResponse { @@ -247,4 +277,8 @@ message QueryTotalDelegationByDelegatorResponse { (gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin" ]; -} \ No newline at end of file +} + +message QueryUnpoolWhitelistRequest {} + +message QueryUnpoolWhitelistResponse { repeated uint64 pool_ids = 1; } diff --git a/__fixtures__/chain1/osmosis/superfluid/superfluid.proto b/__fixtures__/chain1/osmosis/superfluid/superfluid.proto index d1562942e9..fdf8d5a197 100644 --- a/__fixtures__/chain1/osmosis/superfluid/superfluid.proto +++ b/__fixtures__/chain1/osmosis/superfluid/superfluid.proto @@ -6,7 +6,7 @@ import "google/protobuf/duration.proto"; import "google/protobuf/timestamp.proto"; import "cosmos/base/v1beta1/coin.proto"; -option go_package = "github.com/osmosis-labs/osmosis/v12/x/superfluid/types"; +option go_package = "github.com/osmosis-labs/osmosis/v13/x/superfluid/types"; // SuperfluidAssetType indicates whether the superfluid asset is // a native token itself or the lp share of a pool. diff --git a/__fixtures__/chain1/osmosis/superfluid/tx.proto b/__fixtures__/chain1/osmosis/superfluid/tx.proto index 88ad3da015..67b4a91515 100644 --- a/__fixtures__/chain1/osmosis/superfluid/tx.proto +++ b/__fixtures__/chain1/osmosis/superfluid/tx.proto @@ -6,7 +6,7 @@ import "google/protobuf/duration.proto"; import "cosmos/base/v1beta1/coin.proto"; import "osmosis/superfluid/superfluid.proto"; -option go_package = "github.com/osmosis-labs/osmosis/v12/x/superfluid/types"; +option go_package = "github.com/osmosis-labs/osmosis/v13/x/superfluid/types"; // Msg defines the Msg service. service Msg { diff --git a/__fixtures__/chain1/osmosis/superfluid/v1beta1/gov.proto b/__fixtures__/chain1/osmosis/superfluid/v1beta1/gov.proto index 7dd8df1dbc..787a45c658 100644 --- a/__fixtures__/chain1/osmosis/superfluid/v1beta1/gov.proto +++ b/__fixtures__/chain1/osmosis/superfluid/v1beta1/gov.proto @@ -4,7 +4,7 @@ package osmosis.superfluid.v1beta1; import "gogoproto/gogo.proto"; import "osmosis/superfluid/superfluid.proto"; -option go_package = "github.com/osmosis-labs/osmosis/v12/x/superfluid/types"; +option go_package = "github.com/osmosis-labs/osmosis/v13/x/superfluid/types"; // SetSuperfluidAssetsProposal is a gov Content type to update the superfluid // assets @@ -13,6 +13,8 @@ message SetSuperfluidAssetsProposal { option (gogoproto.goproto_getters) = false; option (gogoproto.goproto_stringer) = false; + option (cosmos_proto.implements_interface) = "ProposalContentI"; + string title = 1; string description = 2; repeated SuperfluidAsset assets = 3 [ (gogoproto.nullable) = false ]; @@ -25,7 +27,24 @@ message RemoveSuperfluidAssetsProposal { option (gogoproto.goproto_getters) = false; option (gogoproto.goproto_stringer) = false; + option (cosmos_proto.implements_interface) = "ProposalContentI"; + string title = 1; string description = 2; repeated string superfluid_asset_denoms = 3; } + +// UpdateUnpoolWhiteListProposal is a gov Content type to update the +// allowed list of pool ids. +message UpdateUnpoolWhiteListProposal { + option (gogoproto.equal) = true; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + + option (cosmos_proto.implements_interface) = "ProposalContentI"; + + string title = 1; + string description = 2; + repeated uint64 ids = 3; + bool is_overwrite = 4; +} diff --git a/__fixtures__/chain1/osmosis/tokenfactory/v1beta1/authorityMetadata.proto b/__fixtures__/chain1/osmosis/tokenfactory/v1beta1/authorityMetadata.proto index c73590b342..cc58a6d535 100644 --- a/__fixtures__/chain1/osmosis/tokenfactory/v1beta1/authorityMetadata.proto +++ b/__fixtures__/chain1/osmosis/tokenfactory/v1beta1/authorityMetadata.proto @@ -4,7 +4,7 @@ package osmosis.tokenfactory.v1beta1; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; -option go_package = "github.com/osmosis-labs/osmosis/v12/x/tokenfactory/types"; +option go_package = "github.com/osmosis-labs/osmosis/v13/x/tokenfactory/types"; // DenomAuthorityMetadata specifies metadata for addresses that have specific // capabilities over a token factory denom. Right now there is only one Admin diff --git a/__fixtures__/chain1/osmosis/tokenfactory/v1beta1/genesis.proto b/__fixtures__/chain1/osmosis/tokenfactory/v1beta1/genesis.proto index 2c594cc1d2..e8c2c7c208 100644 --- a/__fixtures__/chain1/osmosis/tokenfactory/v1beta1/genesis.proto +++ b/__fixtures__/chain1/osmosis/tokenfactory/v1beta1/genesis.proto @@ -5,7 +5,7 @@ import "gogoproto/gogo.proto"; import "osmosis/tokenfactory/v1beta1/authorityMetadata.proto"; import "osmosis/tokenfactory/v1beta1/params.proto"; -option go_package = "github.com/osmosis-labs/osmosis/v12/x/tokenfactory/types"; +option go_package = "github.com/osmosis-labs/osmosis/v13/x/tokenfactory/types"; // GenesisState defines the tokenfactory module's genesis state. message GenesisState { diff --git a/__fixtures__/chain1/osmosis/tokenfactory/v1beta1/params.proto b/__fixtures__/chain1/osmosis/tokenfactory/v1beta1/params.proto index 47e0441280..7e14273d99 100644 --- a/__fixtures__/chain1/osmosis/tokenfactory/v1beta1/params.proto +++ b/__fixtures__/chain1/osmosis/tokenfactory/v1beta1/params.proto @@ -6,7 +6,7 @@ import "osmosis/tokenfactory/v1beta1/authorityMetadata.proto"; import "cosmos_proto/cosmos.proto"; import "cosmos/base/v1beta1/coin.proto"; -option go_package = "github.com/osmosis-labs/osmosis/v12/x/tokenfactory/types"; +option go_package = "github.com/osmosis-labs/osmosis/v13/x/tokenfactory/types"; // Params defines the parameters for the tokenfactory module. message Params { diff --git a/__fixtures__/chain1/osmosis/tokenfactory/v1beta1/query.proto b/__fixtures__/chain1/osmosis/tokenfactory/v1beta1/query.proto index ffa7f55013..7b347161fa 100644 --- a/__fixtures__/chain1/osmosis/tokenfactory/v1beta1/query.proto +++ b/__fixtures__/chain1/osmosis/tokenfactory/v1beta1/query.proto @@ -7,7 +7,7 @@ import "cosmos/base/query/v1beta1/pagination.proto"; import "osmosis/tokenfactory/v1beta1/authorityMetadata.proto"; import "osmosis/tokenfactory/v1beta1/params.proto"; -option go_package = "github.com/osmosis-labs/osmosis/v12/x/tokenfactory/types"; +option go_package = "github.com/osmosis-labs/osmosis/v13/x/tokenfactory/types"; // Query defines the gRPC querier service. service Query { diff --git a/__fixtures__/chain1/osmosis/tokenfactory/v1beta1/tx.proto b/__fixtures__/chain1/osmosis/tokenfactory/v1beta1/tx.proto index bc7d753bbd..938b1fa9e7 100644 --- a/__fixtures__/chain1/osmosis/tokenfactory/v1beta1/tx.proto +++ b/__fixtures__/chain1/osmosis/tokenfactory/v1beta1/tx.proto @@ -5,7 +5,7 @@ import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; import "cosmos/bank/v1beta1/bank.proto"; -option go_package = "github.com/osmosis-labs/osmosis/v12/x/tokenfactory/types"; +option go_package = "github.com/osmosis-labs/osmosis/v13/x/tokenfactory/types"; // Msg defines the tokefactory module's gRPC message service. service Msg { diff --git a/__fixtures__/chain1/osmosis/twap/v1beta1/genesis.proto b/__fixtures__/chain1/osmosis/twap/v1beta1/genesis.proto index d1833ad60e..e9c377b0e8 100644 --- a/__fixtures__/chain1/osmosis/twap/v1beta1/genesis.proto +++ b/__fixtures__/chain1/osmosis/twap/v1beta1/genesis.proto @@ -7,7 +7,7 @@ import "google/protobuf/any.proto"; import "cosmos_proto/cosmos.proto"; import "google/protobuf/duration.proto"; -option go_package = "github.com/osmosis-labs/osmosis/v12/x/twap/types"; +option go_package = "github.com/osmosis-labs/osmosis/v13/x/twap/types"; // Params holds parameters for the twap module message Params { diff --git a/__fixtures__/chain1/osmosis/twap/v1beta1/query.proto b/__fixtures__/chain1/osmosis/twap/v1beta1/query.proto index bf1f79ac42..95374ece07 100644 --- a/__fixtures__/chain1/osmosis/twap/v1beta1/query.proto +++ b/__fixtures__/chain1/osmosis/twap/v1beta1/query.proto @@ -12,7 +12,7 @@ import "google/protobuf/any.proto"; import "cosmos_proto/cosmos.proto"; import "google/protobuf/timestamp.proto"; -option go_package = "github.com/osmosis-labs/osmosis/v12/x/twap/client/queryproto"; +option go_package = "github.com/osmosis-labs/osmosis/v13/x/twap/client/queryproto"; service Query { rpc Params(ParamsRequest) returns (ParamsResponse) { @@ -23,6 +23,7 @@ service Query { } rpc ArithmeticTwapToNow(ArithmeticTwapToNowRequest) returns (ArithmeticTwapToNowResponse) { + option deprecated = true; option (google.api.http).get = "/osmosis/twap/v1beta1/ArithmeticTwapToNow"; } } diff --git a/__fixtures__/chain1/osmosis/twap/v1beta1/query.yml b/__fixtures__/chain1/osmosis/twap/v1beta1/query.yml new file mode 100644 index 0000000000..6763392aaa --- /dev/null +++ b/__fixtures__/chain1/osmosis/twap/v1beta1/query.yml @@ -0,0 +1,22 @@ +keeper: + path: "github.com/osmosis-labs/osmosis/v13/x/twap" + struct: "Keeper" +client_path: "github.com/osmosis-labs/osmosis/v13/x/twap/client" +queries: + ArithmeticTwap: + proto_wrapper: + default_values: + Req.end_time: "ctx.BlockTime()" + query_func: "k.GetArithmeticTwap" + cli: + cmd: "ArithmeticTwap" + ArithmeticTwapToNow: + proto_wrapper: + query_func: "k.GetArithmeticTwapToNow" + cli: + cmd: "ArithmeticTwapToNow" + Params: + proto_wrapper: + query_func: "k.GetParams" + cli: + cmd: "GetArithmeticTwapToNow" \ No newline at end of file diff --git a/__fixtures__/chain1/osmosis/twap/v1beta1/twap_record.proto b/__fixtures__/chain1/osmosis/twap/v1beta1/twap_record.proto index d8f1998302..d040b318eb 100644 --- a/__fixtures__/chain1/osmosis/twap/v1beta1/twap_record.proto +++ b/__fixtures__/chain1/osmosis/twap/v1beta1/twap_record.proto @@ -7,7 +7,7 @@ import "cosmos_proto/cosmos.proto"; import "cosmos/base/v1beta1/coin.proto"; import "google/protobuf/timestamp.proto"; -option go_package = "github.com/osmosis-labs/osmosis/v12/x/twap/types"; +option go_package = "github.com/osmosis-labs/osmosis/v13/x/twap/types"; // A TWAP record should be indexed in state by pool_id, (asset pair), timestamp // The asset pair assets should be lexicographically sorted. diff --git a/__fixtures__/chain1/osmosis/txfees/v1beta1/feetoken.proto b/__fixtures__/chain1/osmosis/txfees/v1beta1/feetoken.proto index da948a9418..3b18f58fab 100644 --- a/__fixtures__/chain1/osmosis/txfees/v1beta1/feetoken.proto +++ b/__fixtures__/chain1/osmosis/txfees/v1beta1/feetoken.proto @@ -3,7 +3,7 @@ package osmosis.txfees.v1beta1; import "gogoproto/gogo.proto"; -option go_package = "github.com/osmosis-labs/osmosis/v12/x/txfees/types"; +option go_package = "github.com/osmosis-labs/osmosis/v13/x/txfees/types"; // FeeToken is a struct that specifies a coin denom, and pool ID pair. // This marks the token as eligible for use as a tx fee asset in Osmosis. diff --git a/__fixtures__/chain1/osmosis/txfees/v1beta1/genesis.proto b/__fixtures__/chain1/osmosis/txfees/v1beta1/genesis.proto index 820fb872ee..4ac7a282da 100644 --- a/__fixtures__/chain1/osmosis/txfees/v1beta1/genesis.proto +++ b/__fixtures__/chain1/osmosis/txfees/v1beta1/genesis.proto @@ -4,7 +4,7 @@ package osmosis.txfees.v1beta1; import "gogoproto/gogo.proto"; import "osmosis/txfees/v1beta1/feetoken.proto"; -option go_package = "github.com/osmosis-labs/osmosis/v12/x/txfees/types"; +option go_package = "github.com/osmosis-labs/osmosis/v13/x/txfees/types"; // GenesisState defines the txfees module's genesis state. message GenesisState { diff --git a/__fixtures__/chain1/osmosis/txfees/v1beta1/gov.proto b/__fixtures__/chain1/osmosis/txfees/v1beta1/gov.proto index 69cbbb06c6..a87a2afa66 100644 --- a/__fixtures__/chain1/osmosis/txfees/v1beta1/gov.proto +++ b/__fixtures__/chain1/osmosis/txfees/v1beta1/gov.proto @@ -4,7 +4,7 @@ package osmosis.txfees.v1beta1; import "gogoproto/gogo.proto"; import "osmosis/txfees/v1beta1/feetoken.proto"; -option go_package = "github.com/osmosis-labs/osmosis/v12/x/txfees/types"; +option go_package = "github.com/osmosis-labs/osmosis/v13/x/txfees/types"; // UpdateFeeTokenProposal is a gov Content type for adding a new whitelisted fee // token. It must specify a denom along with gamm pool ID to use as a spot price @@ -16,6 +16,8 @@ message UpdateFeeTokenProposal { option (gogoproto.goproto_getters) = false; option (gogoproto.goproto_stringer) = false; + option (cosmos_proto.implements_interface) = "ProposalContentI"; + string title = 1 [ (gogoproto.moretags) = "yaml:\"title\"" ]; string description = 2 [ (gogoproto.moretags) = "yaml:\"description\"" ]; FeeToken feetoken = 3 [ diff --git a/__fixtures__/chain1/osmosis/txfees/v1beta1/query.proto b/__fixtures__/chain1/osmosis/txfees/v1beta1/query.proto index 4a887abc27..395eb113dc 100644 --- a/__fixtures__/chain1/osmosis/txfees/v1beta1/query.proto +++ b/__fixtures__/chain1/osmosis/txfees/v1beta1/query.proto @@ -7,7 +7,7 @@ import "google/protobuf/duration.proto"; import "osmosis/txfees/v1beta1/feetoken.proto"; -option go_package = "github.com/osmosis-labs/osmosis/v12/x/txfees/types"; +option go_package = "github.com/osmosis-labs/osmosis/v13/x/txfees/types"; service Query { // FeeTokens returns a list of all the whitelisted fee tokens and their diff --git a/__fixtures__/chain2/cosmos/distribution/v1beta1/distribution.proto b/__fixtures__/chain2/cosmos/distribution/v1beta1/distribution.proto index ae98ec0b98..f25c8c3c39 100644 --- a/__fixtures__/chain2/cosmos/distribution/v1beta1/distribution.proto +++ b/__fixtures__/chain2/cosmos/distribution/v1beta1/distribution.proto @@ -108,6 +108,8 @@ message CommunityPoolSpendProposal { option (gogoproto.goproto_getters) = false; option (gogoproto.goproto_stringer) = false; + option (cosmos_proto.implements_interface) = "ProposalContentI"; + string title = 1; string description = 2; string recipient = 3; diff --git a/__fixtures__/chain2/cosmos/gov/v1beta1/gov.proto b/__fixtures__/chain2/cosmos/gov/v1beta1/gov.proto index 01aebf950c..06b71e2a84 100644 --- a/__fixtures__/chain2/cosmos/gov/v1beta1/gov.proto +++ b/__fixtures__/chain2/cosmos/gov/v1beta1/gov.proto @@ -44,7 +44,7 @@ message WeightedVoteOption { // TextProposal defines a standard text proposal whose changes need to be // manually updated in case of approval. message TextProposal { - option (cosmos_proto.implements_interface) = "Content"; + option (cosmos_proto.implements_interface) = "ProposalContentI"; option (gogoproto.equal) = true; @@ -69,7 +69,7 @@ message Proposal { option (gogoproto.equal) = true; uint64 proposal_id = 1 [(gogoproto.jsontag) = "id", (gogoproto.moretags) = "yaml:\"id\""]; - google.protobuf.Any content = 2 [(cosmos_proto.accepts_interface) = "Content"]; + google.protobuf.Any content = 2 [(cosmos_proto.accepts_interface) = "ProposalContentI"]; ProposalStatus status = 3 [(gogoproto.moretags) = "yaml:\"proposal_status\""]; TallyResult final_tally_result = 4 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"final_tally_result\""]; diff --git a/__fixtures__/chain2/cosmos/gov/v1beta1/tx.proto b/__fixtures__/chain2/cosmos/gov/v1beta1/tx.proto index 36c0a95d27..af99c6b965 100644 --- a/__fixtures__/chain2/cosmos/gov/v1beta1/tx.proto +++ b/__fixtures__/chain2/cosmos/gov/v1beta1/tx.proto @@ -34,7 +34,7 @@ message MsgSubmitProposal { option (gogoproto.stringer) = false; option (gogoproto.goproto_getters) = false; - google.protobuf.Any content = 1 [(cosmos_proto.accepts_interface) = "Content"]; + google.protobuf.Any content = 1 [(cosmos_proto.accepts_interface) = "ProposalContentI"]; repeated cosmos.base.v1beta1.Coin initial_deposit = 2 [ (gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", diff --git a/__fixtures__/output1/akash/base/v1beta1/attribute.ts b/__fixtures__/output1/akash/base/v1beta1/attribute.ts index 18839ea6a8..21db77909e 100644 --- a/__fixtures__/output1/akash/base/v1beta1/attribute.ts +++ b/__fixtures__/output1/akash/base/v1beta1/attribute.ts @@ -35,10 +35,7 @@ export interface SignedBy { * this behaviour to be discussed */ export interface SignedBySDKType { - /** all_of all keys in this list must have signed attributes */ all_of: string[]; - - /** any_of at least of of the keys from the list must have signed attributes */ any_of: string[]; } @@ -53,10 +50,7 @@ export interface PlacementRequirements { /** PlacementRequirements */ export interface PlacementRequirementsSDKType { - /** SignedBy list of keys that tenants expect to have signatures from */ signed_by?: SignedBySDKType; - - /** Attribute list of attributes tenant expects from the provider */ attributes: AttributeSDKType[]; } diff --git a/__fixtures__/output1/akash/base/v1beta2/attribute.ts b/__fixtures__/output1/akash/base/v1beta2/attribute.ts index 2488912415..72abdc3022 100644 --- a/__fixtures__/output1/akash/base/v1beta2/attribute.ts +++ b/__fixtures__/output1/akash/base/v1beta2/attribute.ts @@ -35,10 +35,7 @@ export interface SignedBy { * this behaviour to be discussed */ export interface SignedBySDKType { - /** all_of all keys in this list must have signed attributes */ all_of: string[]; - - /** any_of at least of of the keys from the list must have signed attributes */ any_of: string[]; } @@ -53,10 +50,7 @@ export interface PlacementRequirements { /** PlacementRequirements */ export interface PlacementRequirementsSDKType { - /** SignedBy list of keys that tenants expect to have signatures from */ signed_by?: SignedBySDKType; - - /** Attribute list of attributes tenant expects from the provider */ attributes: AttributeSDKType[]; } diff --git a/__fixtures__/output1/akash/bundle.ts b/__fixtures__/output1/akash/bundle.ts index ae6c7fce0c..9e37352e55 100644 --- a/__fixtures__/output1/akash/bundle.ts +++ b/__fixtures__/output1/akash/bundle.ts @@ -51,60 +51,60 @@ import * as _49 from "./provider/v1beta1/provider"; import * as _50 from "./provider/v1beta2/genesis"; import * as _51 from "./provider/v1beta2/provider"; import * as _52 from "./provider/v1beta2/query"; -import * as _318 from "./audit/v1beta1/audit.amino"; -import * as _319 from "./audit/v1beta2/audit.amino"; -import * as _320 from "./cert/v1beta2/cert.amino"; -import * as _321 from "./deployment/v1beta2/service.amino"; -import * as _322 from "./market/v1beta2/service.amino"; -import * as _323 from "./provider/v1beta1/provider.amino"; -import * as _324 from "./provider/v1beta2/provider.amino"; -import * as _325 from "./audit/v1beta1/audit.registry"; -import * as _326 from "./audit/v1beta2/audit.registry"; -import * as _327 from "./cert/v1beta2/cert.registry"; -import * as _328 from "./deployment/v1beta2/service.registry"; -import * as _329 from "./market/v1beta2/service.registry"; -import * as _330 from "./provider/v1beta1/provider.registry"; -import * as _331 from "./provider/v1beta2/provider.registry"; -import * as _332 from "./audit/v1beta2/query.lcd"; -import * as _333 from "./cert/v1beta2/query.lcd"; -import * as _334 from "./deployment/v1beta1/query.lcd"; -import * as _335 from "./deployment/v1beta2/query.lcd"; -import * as _336 from "./escrow/v1beta1/query.lcd"; -import * as _337 from "./escrow/v1beta2/query.lcd"; -import * as _338 from "./market/v1beta2/query.lcd"; -import * as _339 from "./provider/v1beta2/query.lcd"; -import * as _340 from "./audit/v1beta2/query.rpc.Query"; -import * as _341 from "./cert/v1beta2/query.rpc.Query"; -import * as _342 from "./deployment/v1beta2/query.rpc.Query"; -import * as _343 from "./escrow/v1beta1/query.rpc.Query"; -import * as _344 from "./escrow/v1beta2/query.rpc.Query"; -import * as _345 from "./market/v1beta2/query.rpc.Query"; -import * as _346 from "./provider/v1beta2/query.rpc.Query"; -import * as _347 from "./audit/v1beta1/audit.rpc.msg"; -import * as _348 from "./audit/v1beta2/audit.rpc.msg"; -import * as _349 from "./cert/v1beta2/cert.rpc.msg"; -import * as _350 from "./deployment/v1beta2/service.rpc.msg"; -import * as _351 from "./market/v1beta2/service.rpc.msg"; -import * as _352 from "./provider/v1beta1/provider.rpc.msg"; -import * as _353 from "./provider/v1beta2/provider.rpc.msg"; -import * as _535 from "./lcd"; -import * as _536 from "./rpc.query"; -import * as _537 from "./rpc.tx"; +import * as _316 from "./audit/v1beta1/audit.amino"; +import * as _317 from "./audit/v1beta2/audit.amino"; +import * as _318 from "./cert/v1beta2/cert.amino"; +import * as _319 from "./deployment/v1beta2/service.amino"; +import * as _320 from "./market/v1beta2/service.amino"; +import * as _321 from "./provider/v1beta1/provider.amino"; +import * as _322 from "./provider/v1beta2/provider.amino"; +import * as _323 from "./audit/v1beta1/audit.registry"; +import * as _324 from "./audit/v1beta2/audit.registry"; +import * as _325 from "./cert/v1beta2/cert.registry"; +import * as _326 from "./deployment/v1beta2/service.registry"; +import * as _327 from "./market/v1beta2/service.registry"; +import * as _328 from "./provider/v1beta1/provider.registry"; +import * as _329 from "./provider/v1beta2/provider.registry"; +import * as _330 from "./audit/v1beta2/query.lcd"; +import * as _331 from "./cert/v1beta2/query.lcd"; +import * as _332 from "./deployment/v1beta1/query.lcd"; +import * as _333 from "./deployment/v1beta2/query.lcd"; +import * as _334 from "./escrow/v1beta1/query.lcd"; +import * as _335 from "./escrow/v1beta2/query.lcd"; +import * as _336 from "./market/v1beta2/query.lcd"; +import * as _337 from "./provider/v1beta2/query.lcd"; +import * as _338 from "./audit/v1beta2/query.rpc.Query"; +import * as _339 from "./cert/v1beta2/query.rpc.Query"; +import * as _340 from "./deployment/v1beta2/query.rpc.Query"; +import * as _341 from "./escrow/v1beta1/query.rpc.Query"; +import * as _342 from "./escrow/v1beta2/query.rpc.Query"; +import * as _343 from "./market/v1beta2/query.rpc.Query"; +import * as _344 from "./provider/v1beta2/query.rpc.Query"; +import * as _345 from "./audit/v1beta1/audit.rpc.msg"; +import * as _346 from "./audit/v1beta2/audit.rpc.msg"; +import * as _347 from "./cert/v1beta2/cert.rpc.msg"; +import * as _348 from "./deployment/v1beta2/service.rpc.msg"; +import * as _349 from "./market/v1beta2/service.rpc.msg"; +import * as _350 from "./provider/v1beta1/provider.rpc.msg"; +import * as _351 from "./provider/v1beta2/provider.rpc.msg"; +import * as _532 from "./lcd"; +import * as _533 from "./rpc.query"; +import * as _534 from "./rpc.tx"; export namespace akash { export namespace audit { export const v1beta1 = { ..._0, - ..._318, - ..._325, - ..._347 + ..._316, + ..._323, + ..._345 }; export const v1beta2 = { ..._1, ..._2, ..._3, - ..._319, - ..._326, - ..._332, - ..._340, - ..._348 + ..._317, + ..._324, + ..._330, + ..._338, + ..._346 }; } export namespace base { @@ -124,11 +124,11 @@ export namespace akash { export const v1beta2 = { ..._13, ..._14, ..._15, - ..._320, - ..._327, - ..._333, - ..._341, - ..._349 + ..._318, + ..._325, + ..._331, + ..._339, + ..._347 }; } export namespace deployment { @@ -138,7 +138,7 @@ export namespace akash { ..._19, ..._20, ..._21, - ..._334 + ..._332 }; export const v1beta2 = { ..._22, ..._23, @@ -152,25 +152,25 @@ export namespace akash { ..._31, ..._32, ..._33, - ..._321, - ..._328, - ..._335, - ..._342, - ..._350 + ..._319, + ..._326, + ..._333, + ..._340, + ..._348 }; } export namespace escrow { export const v1beta1 = { ..._34, ..._35, ..._36, - ..._336, - ..._343 + ..._334, + ..._341 }; export const v1beta2 = { ..._37, ..._38, ..._39, - ..._337, - ..._344 + ..._335, + ..._342 }; } export namespace inflation { @@ -186,31 +186,31 @@ export namespace akash { ..._46, ..._47, ..._48, - ..._322, - ..._329, - ..._338, - ..._345, - ..._351 + ..._320, + ..._327, + ..._336, + ..._343, + ..._349 }; } export namespace provider { export const v1beta1 = { ..._49, - ..._323, - ..._330, - ..._352 + ..._321, + ..._328, + ..._350 }; export const v1beta2 = { ..._50, ..._51, ..._52, - ..._324, - ..._331, - ..._339, - ..._346, - ..._353 + ..._322, + ..._329, + ..._337, + ..._344, + ..._351 }; } - export const ClientFactory = { ..._535, - ..._536, - ..._537 + export const ClientFactory = { ..._532, + ..._533, + ..._534 }; } \ No newline at end of file diff --git a/__fixtures__/output1/akash/deployment/v1beta1/authz.ts b/__fixtures__/output1/akash/deployment/v1beta1/authz.ts index d871ac0bbe..9b2fc14041 100644 --- a/__fixtures__/output1/akash/deployment/v1beta1/authz.ts +++ b/__fixtures__/output1/akash/deployment/v1beta1/authz.ts @@ -20,10 +20,6 @@ export interface DepositDeploymentAuthorization { * the granter's account for a deployment. */ export interface DepositDeploymentAuthorizationSDKType { - /** - * SpendLimit is the amount the grantee is authorized to spend from the granter's account for - * the purpose of deployment. - */ spend_limit?: CoinSDKType | undefined; } diff --git a/__fixtures__/output1/akash/deployment/v1beta2/authz.ts b/__fixtures__/output1/akash/deployment/v1beta2/authz.ts index f946e306a8..1eddbdecdc 100644 --- a/__fixtures__/output1/akash/deployment/v1beta2/authz.ts +++ b/__fixtures__/output1/akash/deployment/v1beta2/authz.ts @@ -20,10 +20,6 @@ export interface DepositDeploymentAuthorization { * the granter's account for a deployment. */ export interface DepositDeploymentAuthorizationSDKType { - /** - * SpendLimit is the amount the grantee is authorized to spend from the granter's account for - * the purpose of deployment. - */ spend_limit?: CoinSDKType; } diff --git a/__fixtures__/output1/akash/deployment/v1beta2/deploymentmsg.ts b/__fixtures__/output1/akash/deployment/v1beta2/deploymentmsg.ts index f3374d4a2c..5efe1833d1 100644 --- a/__fixtures__/output1/akash/deployment/v1beta2/deploymentmsg.ts +++ b/__fixtures__/output1/akash/deployment/v1beta2/deploymentmsg.ts @@ -22,8 +22,6 @@ export interface MsgCreateDeploymentSDKType { groups: GroupSpecSDKType[]; version: Uint8Array; deposit?: CoinSDKType; - - /** Depositor pays for the deposit */ depositor: string; } @@ -46,8 +44,6 @@ export interface MsgDepositDeployment { export interface MsgDepositDeploymentSDKType { id?: DeploymentIDSDKType; amount?: CoinSDKType; - - /** Depositor pays for the deposit */ depositor: string; } diff --git a/__fixtures__/output1/akash/escrow/v1beta1/types.ts b/__fixtures__/output1/akash/escrow/v1beta1/types.ts index 1b90a15a94..0cf7b68927 100644 --- a/__fixtures__/output1/akash/escrow/v1beta1/types.ts +++ b/__fixtures__/output1/akash/escrow/v1beta1/types.ts @@ -158,22 +158,11 @@ export interface Account { /** Account stores state for an escrow account */ export interface AccountSDKType { - /** unique identifier for this escrow account */ id?: AccountIDSDKType; - - /** bech32 encoded account address of the owner of this escrow account */ owner: string; - - /** current state of this escrow account */ state: Account_State; - - /** unspent coins received from the owner's wallet */ balance?: CoinSDKType; - - /** total coins spent by this account */ transferred?: CoinSDKType; - - /** block height at which this account was last settled */ settled_at: Long; } diff --git a/__fixtures__/output1/akash/escrow/v1beta2/types.ts b/__fixtures__/output1/akash/escrow/v1beta2/types.ts index 79e88a95b1..34f0a35613 100644 --- a/__fixtures__/output1/akash/escrow/v1beta2/types.ts +++ b/__fixtures__/output1/akash/escrow/v1beta2/types.ts @@ -171,35 +171,13 @@ export interface Account { /** Account stores state for an escrow account */ export interface AccountSDKType { - /** unique identifier for this escrow account */ id?: AccountIDSDKType; - - /** bech32 encoded account address of the owner of this escrow account */ owner: string; - - /** current state of this escrow account */ state: Account_State; - - /** unspent coins received from the owner's wallet */ balance?: DecCoinSDKType; - - /** total coins spent by this account */ transferred?: DecCoinSDKType; - - /** block height at which this account was last settled */ settled_at: Long; - - /** - * bech32 encoded account address of the depositor. - * If depositor is same as the owner, then any incoming coins are added to the Balance. - * If depositor isn't same as the owner, then any incoming coins are added to the Funds. - */ depositor: string; - - /** - * Funds are unspent coins received from the (non-Owner) Depositor's wallet. - * If there are any funds, they should be spent before spending the Balance. - */ funds?: DecCoinSDKType; } diff --git a/__fixtures__/output1/akash/inflation/v1beta2/params.ts b/__fixtures__/output1/akash/inflation/v1beta2/params.ts index 1b7d7fab44..4d14ed2bbf 100644 --- a/__fixtures__/output1/akash/inflation/v1beta2/params.ts +++ b/__fixtures__/output1/akash/inflation/v1beta2/params.ts @@ -22,19 +22,8 @@ export interface Params { /** Params defines the parameters for the x/deployment package */ export interface ParamsSDKType { - /** InflationDecayFactor is the number of years it takes inflation to halve. */ inflation_decay_factor: string; - - /** - * InitialInflation is the rate at which inflation starts at genesis. - * It is a decimal value in the range [0.0, 100.0]. - */ initial_inflation: string; - - /** - * Variance defines the fraction by which inflation can vary from ideal inflation in a block. - * It is a decimal value in the range [0.0, 1.0]. - */ variance: string; } diff --git a/__fixtures__/output1/confio/proofs.ts b/__fixtures__/output1/confio/proofs.ts index 969dd8846c..7fa7b77d6d 100644 --- a/__fixtures__/output1/confio/proofs.ts +++ b/__fixtures__/output1/confio/proofs.ts @@ -261,7 +261,6 @@ export interface NonExistenceProof { * then there is no valid proof for the given key. */ export interface NonExistenceProofSDKType { - /** TODO: remove this as unnecessary??? we prove a range */ key: Uint8Array; left?: ExistenceProofSDKType; right?: ExistenceProofSDKType; @@ -333,11 +332,6 @@ export interface LeafOpSDKType { prehash_key: HashOp; prehash_value: HashOp; length: LengthOp; - - /** - * prefix is a fixed bytes that may optionally be included at the beginning to differentiate - * a leaf node from an inner node. - */ prefix: Uint8Array; } @@ -427,17 +421,9 @@ export interface ProofSpec { * tree format server uses. But not in code, rather a configuration object. */ export interface ProofSpecSDKType { - /** - * any field in the ExistenceProof must be the same as in this spec. - * except Prefix, which is just the first bytes of prefix (spec can be longer) - */ leaf_spec?: LeafOpSDKType; inner_spec?: InnerSpecSDKType; - - /** max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries) */ max_depth: number; - - /** min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries) */ min_depth: number; } @@ -480,20 +466,11 @@ export interface InnerSpec { * isLeftNeighbor(spec: InnerSpec, left: InnerOp, right: InnerOp) */ export interface InnerSpecSDKType { - /** - * Child order is the ordering of the children node, must count from 0 - * iavl tree is [0, 1] (left then right) - * merk is [0, 2, 1] (left, right, here) - */ child_order: number[]; child_size: number; min_prefix_length: number; max_prefix_length: number; - - /** empty child is the prehash image that is used when one child is nil (eg. 20 bytes of 0) */ empty_child: Uint8Array; - - /** hash is the algorithm that must be used for each InnerOp */ hash: HashOp; } @@ -550,8 +527,6 @@ export interface CompressedExistenceProofSDKType { key: Uint8Array; value: Uint8Array; leaf?: LeafOpSDKType; - - /** these are indexes into the lookup_inners table in CompressedBatchProof */ path: number[]; } export interface CompressedNonExistenceProof { @@ -561,7 +536,6 @@ export interface CompressedNonExistenceProof { right?: CompressedExistenceProof; } export interface CompressedNonExistenceProofSDKType { - /** TODO: remove this as unnecessary??? we prove a range */ key: Uint8Array; left?: CompressedExistenceProofSDKType; right?: CompressedExistenceProofSDKType; diff --git a/__fixtures__/output1/cosmos/app/v1alpha1/config.ts b/__fixtures__/output1/cosmos/app/v1alpha1/config.ts index 4f8180d88d..a0a3f23922 100644 --- a/__fixtures__/output1/cosmos/app/v1alpha1/config.ts +++ b/__fixtures__/output1/cosmos/app/v1alpha1/config.ts @@ -27,7 +27,6 @@ export interface Config { * their state machine with a config object alone. */ export interface ConfigSDKType { - /** modules are the module configurations for the app. */ modules: ModuleConfigSDKType[]; } @@ -56,24 +55,7 @@ export interface ModuleConfig { /** ModuleConfig is a module configuration for an app. */ export interface ModuleConfigSDKType { - /** - * name is the unique name of the module within the app. It should be a name - * that persists between different versions of a module so that modules - * can be smoothly upgraded to new versions. - * - * For example, for the module cosmos.bank.module.v1.Module, we may chose - * to simply name the module "bank" in the app. When we upgrade to - * cosmos.bank.module.v2.Module, the app-specific name "bank" stays the same - * and the framework knows that the v2 module should receive all the same state - * that the v1 module had. Note: modules should provide info on which versions - * they can migrate from in the ModuleDescriptor.can_migration_from field. - */ name: string; - - /** - * config is the config object for the module. Module config messages should - * define a ModuleDescriptor using the cosmos.app.v1alpha1.is_module extension. - */ config?: AnySDKType; } diff --git a/__fixtures__/output1/cosmos/app/v1alpha1/module.ts b/__fixtures__/output1/cosmos/app/v1alpha1/module.ts index d17bbfbb4f..a93f92a3d8 100644 --- a/__fixtures__/output1/cosmos/app/v1alpha1/module.ts +++ b/__fixtures__/output1/cosmos/app/v1alpha1/module.ts @@ -35,32 +35,8 @@ export interface ModuleDescriptor { /** ModuleDescriptor describes an app module. */ export interface ModuleDescriptorSDKType { - /** - * go_import names the package that should be imported by an app to load the - * module in the runtime module registry. Either go_import must be defined here - * or the go_package option must be defined at the file level to indicate - * to users where to location the module implementation. go_import takes - * precedence over go_package when both are defined. - */ go_import: string; - - /** - * use_package refers to a protobuf package that this module - * uses and exposes to the world. In an app, only one module should "use" - * or own a single protobuf package. It is assumed that the module uses - * all of the .proto files in a single package. - */ use_package: PackageReferenceSDKType[]; - - /** - * can_migrate_from defines which module versions this module can migrate - * state from. The framework will check that one module version is able to - * migrate from a previous module version before attempting to update its - * config. It is assumed that modules can transitively migrate from earlier - * versions. For instance if v3 declares it can migrate from v2, and v2 - * declares it can migrate from v1, the framework knows how to migrate - * from v1 to v3, assuming all 3 module versions are registered at runtime. - */ can_migrate_from: MigrateFromInfoSDKType[]; } @@ -111,46 +87,7 @@ export interface PackageReference { /** PackageReference is a reference to a protobuf package used by a module. */ export interface PackageReferenceSDKType { - /** name is the fully-qualified name of the package. */ name: string; - - /** - * revision is the optional revision of the package that is being used. - * Protobuf packages used in Cosmos should generally have a major version - * as the last part of the package name, ex. foo.bar.baz.v1. - * The revision of a package can be thought of as the minor version of a - * package which has additional backwards compatible definitions that weren't - * present in a previous version. - * - * A package should indicate its revision with a source code comment - * above the package declaration in one of its fields containing the - * test "Revision N" where N is an integer revision. All packages start - * at revision 0 the first time they are released in a module. - * - * When a new version of a module is released and items are added to existing - * .proto files, these definitions should contain comments of the form - * "Since Revision N" where N is an integer revision. - * - * When the module runtime starts up, it will check the pinned proto - * image and panic if there are runtime protobuf definitions that are not - * in the pinned descriptor which do not have - * a "Since Revision N" comment or have a "Since Revision N" comment where - * N is <= to the revision specified here. This indicates that the protobuf - * files have been updated, but the pinned file descriptor hasn't. - * - * If there are items in the pinned file descriptor with a revision - * greater than the value indicated here, this will also cause a panic - * as it may mean that the pinned descriptor for a legacy module has been - * improperly updated or that there is some other versioning discrepancy. - * Runtime protobuf definitions will also be checked for compatibility - * with pinned file descriptors to make sure there are no incompatible changes. - * - * This behavior ensures that: - * * pinned proto images are up-to-date - * * protobuf files are carefully annotated with revision comments which - * are important good client UX - * * protobuf files are changed in backwards and forwards compatible ways - */ revision: number; } @@ -171,10 +108,6 @@ export interface MigrateFromInfo { * can migrate from. */ export interface MigrateFromInfoSDKType { - /** - * module is the fully-qualified protobuf name of the module config object - * for the previous module version, ex: "cosmos.group.module.v1.Module". - */ module: string; } diff --git a/__fixtures__/output1/cosmos/app/v1alpha1/query.ts b/__fixtures__/output1/cosmos/app/v1alpha1/query.ts index e89fa0d27b..b1926e8401 100644 --- a/__fixtures__/output1/cosmos/app/v1alpha1/query.ts +++ b/__fixtures__/output1/cosmos/app/v1alpha1/query.ts @@ -17,7 +17,6 @@ export interface QueryConfigResponse { /** QueryConfigRequest is the Query/Config response type. */ export interface QueryConfigResponseSDKType { - /** config is the current app config. */ config?: ConfigSDKType; } diff --git a/__fixtures__/output1/cosmos/auth/v1beta1/genesis.ts b/__fixtures__/output1/cosmos/auth/v1beta1/genesis.ts index 54cf90f7f2..f646348f77 100644 --- a/__fixtures__/output1/cosmos/auth/v1beta1/genesis.ts +++ b/__fixtures__/output1/cosmos/auth/v1beta1/genesis.ts @@ -15,10 +15,7 @@ export interface GenesisState { /** GenesisState defines the auth module's genesis state. */ export interface GenesisStateSDKType { - /** params defines all the paramaters of the module. */ params?: ParamsSDKType; - - /** accounts are the accounts present at genesis. */ accounts: AnySDKType[]; } diff --git a/__fixtures__/output1/cosmos/auth/v1beta1/query.ts b/__fixtures__/output1/cosmos/auth/v1beta1/query.ts index f74f1a81af..319a523085 100644 --- a/__fixtures__/output1/cosmos/auth/v1beta1/query.ts +++ b/__fixtures__/output1/cosmos/auth/v1beta1/query.ts @@ -21,7 +21,6 @@ export interface QueryAccountsRequest { * Since: cosmos-sdk 0.43 */ export interface QueryAccountsRequestSDKType { - /** pagination defines an optional pagination for the request. */ pagination?: PageRequestSDKType; } @@ -44,10 +43,7 @@ export interface QueryAccountsResponse { * Since: cosmos-sdk 0.43 */ export interface QueryAccountsResponseSDKType { - /** accounts are the existing accounts */ accounts: AnySDKType[]; - - /** pagination defines the pagination in the response. */ pagination?: PageResponseSDKType; } @@ -59,7 +55,6 @@ export interface QueryAccountRequest { /** QueryAccountRequest is the request type for the Query/Account RPC method. */ export interface QueryAccountRequestSDKType { - /** address defines the address to query for. */ address: string; } @@ -77,7 +72,6 @@ export interface QueryParamsResponse { /** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponseSDKType { - /** params defines the parameters of the module. */ params?: ParamsSDKType; } @@ -89,7 +83,6 @@ export interface QueryAccountResponse { /** QueryAccountResponse is the response type for the Query/Account RPC method. */ export interface QueryAccountResponseSDKType { - /** account defines the account of the corresponding address. */ account?: AnySDKType; } diff --git a/__fixtures__/output1/cosmos/authz/v1beta1/authz.ts b/__fixtures__/output1/cosmos/authz/v1beta1/authz.ts index e94f0fa45b..7038a28977 100644 --- a/__fixtures__/output1/cosmos/authz/v1beta1/authz.ts +++ b/__fixtures__/output1/cosmos/authz/v1beta1/authz.ts @@ -18,7 +18,6 @@ export interface GenericAuthorization { * the provided method on behalf of the granter's account. */ export interface GenericAuthorizationSDKType { - /** Msg, identified by it's type URL, to grant unrestricted permissions to execute */ msg: string; } @@ -43,12 +42,6 @@ export interface Grant { */ export interface GrantSDKType { authorization?: AnySDKType; - - /** - * time when the grant will expire and will be pruned. If null, then the grant - * doesn't have a time expiration (other conditions in `authorization` - * may apply to invalidate the grant) - */ expiration?: Date; } @@ -82,7 +75,6 @@ export interface GrantQueueItem { /** GrantQueueItem contains the list of TypeURL of a sdk.Msg. */ export interface GrantQueueItemSDKType { - /** msg_type_urls contains the list of TypeURL of a sdk.Msg. */ msg_type_urls: string[]; } diff --git a/__fixtures__/output1/cosmos/authz/v1beta1/query.ts b/__fixtures__/output1/cosmos/authz/v1beta1/query.ts index b5c373e617..a4e64a967f 100644 --- a/__fixtures__/output1/cosmos/authz/v1beta1/query.ts +++ b/__fixtures__/output1/cosmos/authz/v1beta1/query.ts @@ -20,11 +20,7 @@ export interface QueryGrantsRequest { export interface QueryGrantsRequestSDKType { granter: string; grantee: string; - - /** Optional, msg_type_url, when set, will query only grants matching given msg type. */ msg_type_url: string; - - /** pagination defines an pagination for the request. */ pagination?: PageRequestSDKType; } @@ -39,10 +35,7 @@ export interface QueryGrantsResponse { /** QueryGrantsResponse is the response type for the Query/Authorizations RPC method. */ export interface QueryGrantsResponseSDKType { - /** authorizations is a list of grants granted for grantee by granter. */ grants: GrantSDKType[]; - - /** pagination defines an pagination for the response. */ pagination?: PageResponseSDKType; } @@ -57,8 +50,6 @@ export interface QueryGranterGrantsRequest { /** QueryGranterGrantsRequest is the request type for the Query/GranterGrants RPC method. */ export interface QueryGranterGrantsRequestSDKType { granter: string; - - /** pagination defines an pagination for the request. */ pagination?: PageRequestSDKType; } @@ -73,10 +64,7 @@ export interface QueryGranterGrantsResponse { /** QueryGranterGrantsResponse is the response type for the Query/GranterGrants RPC method. */ export interface QueryGranterGrantsResponseSDKType { - /** grants is a list of grants granted by the granter. */ grants: GrantAuthorizationSDKType[]; - - /** pagination defines an pagination for the response. */ pagination?: PageResponseSDKType; } @@ -91,8 +79,6 @@ export interface QueryGranteeGrantsRequest { /** QueryGranteeGrantsRequest is the request type for the Query/IssuedGrants RPC method. */ export interface QueryGranteeGrantsRequestSDKType { grantee: string; - - /** pagination defines an pagination for the request. */ pagination?: PageRequestSDKType; } @@ -107,10 +93,7 @@ export interface QueryGranteeGrantsResponse { /** QueryGranteeGrantsResponse is the response type for the Query/GranteeGrants RPC method. */ export interface QueryGranteeGrantsResponseSDKType { - /** grants is a list of grants granted to the grantee. */ grants: GrantAuthorizationSDKType[]; - - /** pagination defines an pagination for the response. */ pagination?: PageResponseSDKType; } diff --git a/__fixtures__/output1/cosmos/authz/v1beta1/tx.ts b/__fixtures__/output1/cosmos/authz/v1beta1/tx.ts index ac20713dd5..511a27229a 100644 --- a/__fixtures__/output1/cosmos/authz/v1beta1/tx.ts +++ b/__fixtures__/output1/cosmos/authz/v1beta1/tx.ts @@ -57,12 +57,6 @@ export interface MsgExec { */ export interface MsgExecSDKType { grantee: string; - - /** - * Authorization Msg requests to execute. Each msg must implement Authorization interface - * The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg)) - * triple and validate it. - */ msgs: AnySDKType[]; } diff --git a/__fixtures__/output1/cosmos/bank/v1beta1/bank.ts b/__fixtures__/output1/cosmos/bank/v1beta1/bank.ts index fa93270098..7861bff836 100644 --- a/__fixtures__/output1/cosmos/bank/v1beta1/bank.ts +++ b/__fixtures__/output1/cosmos/bank/v1beta1/bank.ts @@ -105,19 +105,8 @@ export interface DenomUnit { * denomination unit of the basic token. */ export interface DenomUnitSDKType { - /** denom represents the string name of the given denom unit (e.g uatom). */ denom: string; - - /** - * exponent represents power of 10 exponent that one must - * raise the base_denom to in order to equal the given DenomUnit's denom - * 1 denom = 10^exponent base_denom - * (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with - * exponent = 6, thus: 1 atom = 10^6 uatom). - */ exponent: number; - - /** aliases is a list of string aliases for the given denom */ aliases: string[]; } @@ -177,47 +166,12 @@ export interface Metadata { */ export interface MetadataSDKType { description: string; - - /** denom_units represents the list of DenomUnit's for a given coin */ denom_units: DenomUnitSDKType[]; - - /** base represents the base denom (should be the DenomUnit with exponent = 0). */ base: string; - - /** - * display indicates the suggested denom that should be - * displayed in clients. - */ display: string; - - /** - * name defines the name of the token (eg: Cosmos Atom) - * - * Since: cosmos-sdk 0.43 - */ name: string; - - /** - * symbol is the token symbol usually shown on exchanges (eg: ATOM). This can - * be the same as the display. - * - * Since: cosmos-sdk 0.43 - */ symbol: string; - - /** - * URI to a document (on or off-chain) that contains additional information. Optional. - * - * Since: cosmos-sdk 0.46 - */ uri: string; - - /** - * URIHash is a sha256 hash of a document pointed by URI. It's used to verify that - * the document didn't change. Optional. - * - * Since: cosmos-sdk 0.46 - */ uri_hash: string; } diff --git a/__fixtures__/output1/cosmos/bank/v1beta1/genesis.ts b/__fixtures__/output1/cosmos/bank/v1beta1/genesis.ts index ee5c7641b4..9e03e3eb66 100644 --- a/__fixtures__/output1/cosmos/bank/v1beta1/genesis.ts +++ b/__fixtures__/output1/cosmos/bank/v1beta1/genesis.ts @@ -24,19 +24,9 @@ export interface GenesisState { /** GenesisState defines the bank module's genesis state. */ export interface GenesisStateSDKType { - /** params defines all the paramaters of the module. */ params?: ParamsSDKType; - - /** balances is an array containing the balances of all the accounts. */ balances: BalanceSDKType[]; - - /** - * supply represents the total supply. If it is left empty, then supply will be calculated based on the provided - * balances. Otherwise, it will be used to validate that the sum of the balances equals this amount. - */ supply: CoinSDKType[]; - - /** denom_metadata defines the metadata of the differents coins. */ denom_metadata: MetadataSDKType[]; } @@ -57,10 +47,7 @@ export interface Balance { * genesis state. */ export interface BalanceSDKType { - /** address is the address of the balance holder. */ address: string; - - /** coins defines the different coins this balance holds. */ coins: CoinSDKType[]; } diff --git a/__fixtures__/output1/cosmos/bank/v1beta1/query.ts b/__fixtures__/output1/cosmos/bank/v1beta1/query.ts index 262e5682a4..f1bedceb0d 100644 --- a/__fixtures__/output1/cosmos/bank/v1beta1/query.ts +++ b/__fixtures__/output1/cosmos/bank/v1beta1/query.ts @@ -16,10 +16,7 @@ export interface QueryBalanceRequest { /** QueryBalanceRequest is the request type for the Query/Balance RPC method. */ export interface QueryBalanceRequestSDKType { - /** address is the address to query balances for. */ address: string; - - /** denom is the coin denom to query balances for. */ denom: string; } @@ -31,7 +28,6 @@ export interface QueryBalanceResponse { /** QueryBalanceResponse is the response type for the Query/Balance RPC method. */ export interface QueryBalanceResponseSDKType { - /** balance is the balance of the coin. */ balance?: CoinSDKType; } @@ -46,10 +42,7 @@ export interface QueryAllBalancesRequest { /** QueryBalanceRequest is the request type for the Query/AllBalances RPC method. */ export interface QueryAllBalancesRequestSDKType { - /** address is the address to query balances for. */ address: string; - - /** pagination defines an optional pagination for the request. */ pagination?: PageRequestSDKType; } @@ -70,10 +63,7 @@ export interface QueryAllBalancesResponse { * method. */ export interface QueryAllBalancesResponseSDKType { - /** balances is the balances of all the coins. */ balances: CoinSDKType[]; - - /** pagination defines the pagination in the response. */ pagination?: PageResponseSDKType; } @@ -94,10 +84,7 @@ export interface QuerySpendableBalancesRequest { * an account's spendable balances. */ export interface QuerySpendableBalancesRequestSDKType { - /** address is the address to query spendable balances for. */ address: string; - - /** pagination defines an optional pagination for the request. */ pagination?: PageRequestSDKType; } @@ -118,10 +105,7 @@ export interface QuerySpendableBalancesResponse { * an account's spendable balances. */ export interface QuerySpendableBalancesResponseSDKType { - /** balances is the spendable balances of all the coins. */ balances: CoinSDKType[]; - - /** pagination defines the pagination in the response. */ pagination?: PageResponseSDKType; } @@ -143,11 +127,6 @@ export interface QueryTotalSupplyRequest { * method. */ export interface QueryTotalSupplyRequestSDKType { - /** - * pagination defines an optional pagination for the request. - * - * Since: cosmos-sdk 0.43 - */ pagination?: PageRequestSDKType; } @@ -172,14 +151,7 @@ export interface QueryTotalSupplyResponse { * method */ export interface QueryTotalSupplyResponseSDKType { - /** supply is the supply of the coins */ supply: CoinSDKType[]; - - /** - * pagination defines the pagination in the response. - * - * Since: cosmos-sdk 0.43 - */ pagination?: PageResponseSDKType; } @@ -191,7 +163,6 @@ export interface QuerySupplyOfRequest { /** QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method. */ export interface QuerySupplyOfRequestSDKType { - /** denom is the coin denom to query balances for. */ denom: string; } @@ -203,7 +174,6 @@ export interface QuerySupplyOfResponse { /** QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method. */ export interface QuerySupplyOfResponseSDKType { - /** amount is the supply of the coin. */ amount?: CoinSDKType; } @@ -231,7 +201,6 @@ export interface QueryDenomsMetadataRequest { /** QueryDenomsMetadataRequest is the request type for the Query/DenomsMetadata RPC method. */ export interface QueryDenomsMetadataRequestSDKType { - /** pagination defines an optional pagination for the request. */ pagination?: PageRequestSDKType; } @@ -252,10 +221,7 @@ export interface QueryDenomsMetadataResponse { * method. */ export interface QueryDenomsMetadataResponseSDKType { - /** metadata provides the client information for all the registered tokens. */ metadatas: MetadataSDKType[]; - - /** pagination defines the pagination in the response. */ pagination?: PageResponseSDKType; } @@ -267,7 +233,6 @@ export interface QueryDenomMetadataRequest { /** QueryDenomMetadataRequest is the request type for the Query/DenomMetadata RPC method. */ export interface QueryDenomMetadataRequestSDKType { - /** denom is the coin denom to query the metadata for. */ denom: string; } @@ -285,7 +250,6 @@ export interface QueryDenomMetadataResponse { * method. */ export interface QueryDenomMetadataResponseSDKType { - /** metadata describes and provides all the client information for the requested token. */ metadata?: MetadataSDKType; } @@ -308,10 +272,7 @@ export interface QueryDenomOwnersRequest { * denomination. */ export interface QueryDenomOwnersRequestSDKType { - /** denom defines the coin denomination to query all account holders for. */ denom: string; - - /** pagination defines an optional pagination for the request. */ pagination?: PageRequestSDKType; } @@ -334,10 +295,7 @@ export interface DenomOwner { * balance of the denominated token. */ export interface DenomOwnerSDKType { - /** address defines the address that owns a particular denomination. */ address: string; - - /** balance is the balance of the denominated coin for an account. */ balance?: CoinSDKType; } @@ -352,8 +310,6 @@ export interface QueryDenomOwnersResponse { /** QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC query. */ export interface QueryDenomOwnersResponseSDKType { denom_owners: DenomOwnerSDKType[]; - - /** pagination defines the pagination in the response. */ pagination?: PageResponseSDKType; } diff --git a/__fixtures__/output1/cosmos/base/abci/v1beta1/abci.ts b/__fixtures__/output1/cosmos/base/abci/v1beta1/abci.ts index c0e2071522..5159d416ea 100644 --- a/__fixtures__/output1/cosmos/base/abci/v1beta1/abci.ts +++ b/__fixtures__/output1/cosmos/base/abci/v1beta1/abci.ts @@ -68,57 +68,18 @@ export interface TxResponse { * tags are stringified and the log is JSON decoded. */ export interface TxResponseSDKType { - /** The block height */ height: Long; - - /** The transaction hash. */ txhash: string; - - /** Namespace for the Code */ codespace: string; - - /** Response code. */ code: number; - - /** Result bytes, if any. */ data: string; - - /** - * The output of the application's logger (raw string). May be - * non-deterministic. - */ raw_log: string; - - /** The output of the application's logger (typed). May be non-deterministic. */ logs: ABCIMessageLogSDKType[]; - - /** Additional information. May be non-deterministic. */ info: string; - - /** Amount of gas requested for transaction. */ gas_wanted: Long; - - /** Amount of gas consumed by transaction. */ gas_used: Long; - - /** The request transaction bytes. */ tx?: AnySDKType; - - /** - * Time of the previous block. For heights > 1, it's the weighted median of - * the timestamps of the valid votes in the block.LastCommit. For height == 1, - * it's genesis time. - */ timestamp: string; - - /** - * Events defines all the events emitted by processing a transaction. Note, - * these events include those emitted by processing all the messages and those - * emitted from the ante handler. Whereas Logs contains the events, with - * additional metadata, emitted only by processing the messages. - * - * Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 - */ events: EventSDKType[]; } @@ -138,11 +99,6 @@ export interface ABCIMessageLog { export interface ABCIMessageLogSDKType { msg_index: number; log: string; - - /** - * Events contains a slice of Event objects that were emitted during some - * execution. - */ events: StringEventSDKType[]; } @@ -193,10 +149,7 @@ export interface GasInfo { /** GasInfo defines tx execution gas context. */ export interface GasInfoSDKType { - /** GasWanted is the maximum units of work we allow this tx to perform. */ gas_wanted: Long; - - /** GasUsed is the amount of gas actually consumed. */ gas_used: Long; } @@ -231,30 +184,10 @@ export interface Result { /** Result is the union of ResponseFormat and ResponseCheckTx. */ export interface ResultSDKType { - /** - * Data is any data returned from message or handler execution. It MUST be - * length prefixed in order to separate data from multiple message executions. - * Deprecated. This field is still populated, but prefer msg_response instead - * because it also contains the Msg response typeURL. - */ - /** @deprecated */ data: Uint8Array; - - /** Log contains the log information from message or handler execution. */ log: string; - - /** - * Events contains a slice of Event objects that were emitted during message - * or handler execution. - */ events: EventSDKType[]; - - /** - * msg_responses contains the Msg handler responses type packed in Anys. - * - * Since: cosmos-sdk 0.46 - */ msg_responses: AnySDKType[]; } @@ -321,16 +254,8 @@ export interface TxMsgData { * for each message. */ export interface TxMsgDataSDKType { - /** data field is deprecated and not populated. */ - /** @deprecated */ data: MsgDataSDKType[]; - - /** - * msg_responses contains the Msg handler responses packed into Anys. - * - * Since: cosmos-sdk 0.46 - */ msg_responses: AnySDKType[]; } @@ -357,22 +282,11 @@ export interface SearchTxsResult { /** SearchTxsResult defines a structure for querying txs pageable */ export interface SearchTxsResultSDKType { - /** Count of all txs */ total_count: Long; - - /** Count of txs in current page */ count: Long; - - /** Index of current page, start from 1 */ page_number: Long; - - /** Count of total pages */ page_total: Long; - - /** Max count txs per page */ limit: Long; - - /** List of txs in current page */ txs: TxResponseSDKType[]; } diff --git a/__fixtures__/output1/cosmos/base/query/v1beta1/pagination.ts b/__fixtures__/output1/cosmos/base/query/v1beta1/pagination.ts index fd0008c3e2..21a33c4d56 100644 --- a/__fixtures__/output1/cosmos/base/query/v1beta1/pagination.ts +++ b/__fixtures__/output1/cosmos/base/query/v1beta1/pagination.ts @@ -58,39 +58,10 @@ export interface PageRequest { * } */ export interface PageRequestSDKType { - /** - * key is a value returned in PageResponse.next_key to begin - * querying the next page most efficiently. Only one of offset or key - * should be set. - */ key: Uint8Array; - - /** - * offset is a numeric offset that can be used when key is unavailable. - * It is less efficient than using key. Only one of offset or key should - * be set. - */ offset: Long; - - /** - * limit is the total number of results to be returned in the result page. - * If left empty it will default to a value to be set by each app. - */ limit: Long; - - /** - * count_total is set to true to indicate that the result set should include - * a count of the total number of items available for pagination in UIs. - * count_total is only respected when offset is used. It is ignored when key - * is set. - */ count_total: boolean; - - /** - * reverse is set to true if results are to be returned in the descending order. - * - * Since: cosmos-sdk 0.43 - */ reverse: boolean; } @@ -128,17 +99,7 @@ export interface PageResponse { * } */ export interface PageResponseSDKType { - /** - * next_key is the key to be passed to PageRequest.key to - * query the next page most efficiently. It will be empty if - * there are no more results. - */ next_key: Uint8Array; - - /** - * total is total number of results available if PageRequest.count_total - * was set, its value is undefined otherwise - */ total: Long; } diff --git a/__fixtures__/output1/cosmos/base/reflection/v1beta1/reflection.ts b/__fixtures__/output1/cosmos/base/reflection/v1beta1/reflection.ts index 7d0eb76b26..654e605968 100644 --- a/__fixtures__/output1/cosmos/base/reflection/v1beta1/reflection.ts +++ b/__fixtures__/output1/cosmos/base/reflection/v1beta1/reflection.ts @@ -16,7 +16,6 @@ export interface ListAllInterfacesResponse { /** ListAllInterfacesResponse is the response type of the ListAllInterfaces RPC. */ export interface ListAllInterfacesResponseSDKType { - /** interface_names is an array of all the registered interfaces. */ interface_names: string[]; } @@ -34,7 +33,6 @@ export interface ListImplementationsRequest { * RPC. */ export interface ListImplementationsRequestSDKType { - /** interface_name defines the interface to query the implementations for. */ interface_name: string; } diff --git a/__fixtures__/output1/cosmos/base/reflection/v2alpha1/reflection.ts b/__fixtures__/output1/cosmos/base/reflection/v2alpha1/reflection.ts index cd64e8adfe..169808b3b8 100644 --- a/__fixtures__/output1/cosmos/base/reflection/v2alpha1/reflection.ts +++ b/__fixtures__/output1/cosmos/base/reflection/v2alpha1/reflection.ts @@ -28,25 +28,11 @@ export interface AppDescriptor { /** AppDescriptor describes a cosmos-sdk based application */ export interface AppDescriptorSDKType { - /** - * AuthnDescriptor provides information on how to authenticate transactions on the application - * NOTE: experimental and subject to change in future releases. - */ authn?: AuthnDescriptorSDKType; - - /** chain provides the chain descriptor */ chain?: ChainDescriptorSDKType; - - /** codec provides metadata information regarding codec related types */ codec?: CodecDescriptorSDKType; - - /** configuration provides metadata information regarding the sdk.Config type */ configuration?: ConfigurationDescriptorSDKType; - - /** query_services provides metadata information regarding the available queriable endpoints */ query_services?: QueryServicesDescriptorSDKType; - - /** tx provides metadata information regarding how to send transactions to the given application */ tx?: TxDescriptorSDKType; } @@ -65,14 +51,7 @@ export interface TxDescriptor { /** TxDescriptor describes the accepted transaction type */ export interface TxDescriptorSDKType { - /** - * fullname is the protobuf fullname of the raw transaction type (for instance the tx.Tx type) - * it is not meant to support polymorphism of transaction types, it is supposed to be used by - * reflection clients to understand if they can handle a specific transaction type in an application. - */ fullname: string; - - /** msgs lists the accepted application messages (sdk.Msg) */ msgs: MsgDescriptorSDKType[]; } @@ -90,7 +69,6 @@ export interface AuthnDescriptor { * on the online RPCs GetTxMetadata and CombineUnsignedTxAndSignatures */ export interface AuthnDescriptorSDKType { - /** sign_modes defines the supported signature algorithm */ sign_modes: SigningModeDescriptorSDKType[]; } @@ -121,16 +99,8 @@ export interface SigningModeDescriptor { * this another time */ export interface SigningModeDescriptorSDKType { - /** name defines the unique name of the signing mode */ name: string; - - /** number is the unique int32 identifier for the sign_mode enum */ number: number; - - /** - * authn_info_provider_method_fullname defines the fullname of the method to call to get - * the metadata required to authenticate using the provided sign_modes - */ authn_info_provider_method_fullname: string; } @@ -142,7 +112,6 @@ export interface ChainDescriptor { /** ChainDescriptor describes chain information of the application */ export interface ChainDescriptorSDKType { - /** id is the chain id */ id: string; } @@ -154,7 +123,6 @@ export interface CodecDescriptor { /** CodecDescriptor describes the registered interfaces and provides metadata information on the types */ export interface CodecDescriptorSDKType { - /** interfaces is a list of the registerted interfaces descriptors */ interfaces: InterfaceDescriptorSDKType[]; } @@ -175,16 +143,8 @@ export interface InterfaceDescriptor { /** InterfaceDescriptor describes the implementation of an interface */ export interface InterfaceDescriptorSDKType { - /** fullname is the name of the interface */ fullname: string; - - /** - * interface_accepting_messages contains information regarding the proto messages which contain the interface as - * google.protobuf.Any field - */ interface_accepting_messages: InterfaceAcceptingMessageDescriptorSDKType[]; - - /** interface_implementers is a list of the descriptors of the interface implementers */ interface_implementers: InterfaceImplementerDescriptorSDKType[]; } @@ -204,15 +164,7 @@ export interface InterfaceImplementerDescriptor { /** InterfaceImplementerDescriptor describes an interface implementer */ export interface InterfaceImplementerDescriptorSDKType { - /** fullname is the protobuf queryable name of the interface implementer */ fullname: string; - - /** - * type_url defines the type URL used when marshalling the type as any - * this is required so we can provide type safe google.protobuf.Any marshalling and - * unmarshalling, making sure that we don't accept just 'any' type - * in our interface fields - */ type_url: string; } @@ -237,14 +189,7 @@ export interface InterfaceAcceptingMessageDescriptor { * an interface represented as a google.protobuf.Any */ export interface InterfaceAcceptingMessageDescriptorSDKType { - /** fullname is the protobuf fullname of the type containing the interface */ fullname: string; - - /** - * field_descriptor_names is a list of the protobuf name (not fullname) of the field - * which contains the interface as google.protobuf.Any (the interface is the same, but - * it can be in multiple fields of the same proto message) - */ field_descriptor_names: string[]; } @@ -256,7 +201,6 @@ export interface ConfigurationDescriptor { /** ConfigurationDescriptor contains metadata information on the sdk.Config */ export interface ConfigurationDescriptorSDKType { - /** bech32_account_address_prefix is the account address prefix */ bech32_account_address_prefix: string; } @@ -268,7 +212,6 @@ export interface MsgDescriptor { /** MsgDescriptor describes a cosmos-sdk message that can be delivered with a transaction */ export interface MsgDescriptorSDKType { - /** msg_type_url contains the TypeURL of a sdk.Msg. */ msg_type_url: string; } @@ -286,7 +229,6 @@ export interface GetAuthnDescriptorResponse { /** GetAuthnDescriptorResponse is the response returned by the GetAuthnDescriptor RPC */ export interface GetAuthnDescriptorResponseSDKType { - /** authn describes how to authenticate to the application when sending transactions */ authn?: AuthnDescriptorSDKType; } @@ -304,7 +246,6 @@ export interface GetChainDescriptorResponse { /** GetChainDescriptorResponse is the response returned by the GetChainDescriptor RPC */ export interface GetChainDescriptorResponseSDKType { - /** chain describes application chain information */ chain?: ChainDescriptorSDKType; } @@ -322,7 +263,6 @@ export interface GetCodecDescriptorResponse { /** GetCodecDescriptorResponse is the response returned by the GetCodecDescriptor RPC */ export interface GetCodecDescriptorResponseSDKType { - /** codec describes the application codec such as registered interfaces and implementations */ codec?: CodecDescriptorSDKType; } @@ -340,7 +280,6 @@ export interface GetConfigurationDescriptorResponse { /** GetConfigurationDescriptorResponse is the response returned by the GetConfigurationDescriptor RPC */ export interface GetConfigurationDescriptorResponseSDKType { - /** config describes the application's sdk.Config */ config?: ConfigurationDescriptorSDKType; } @@ -358,7 +297,6 @@ export interface GetQueryServicesDescriptorResponse { /** GetQueryServicesDescriptorResponse is the response returned by the GetQueryServicesDescriptor RPC */ export interface GetQueryServicesDescriptorResponseSDKType { - /** queries provides information on the available queryable services */ queries?: QueryServicesDescriptorSDKType; } @@ -379,10 +317,6 @@ export interface GetTxDescriptorResponse { /** GetTxDescriptorResponse is the response returned by the GetTxDescriptor RPC */ export interface GetTxDescriptorResponseSDKType { - /** - * tx provides information on msgs that can be forwarded to the application - * alongside the accepted transaction protobuf type - */ tx?: TxDescriptorSDKType; } @@ -394,7 +328,6 @@ export interface QueryServicesDescriptor { /** QueryServicesDescriptor contains the list of cosmos-sdk queriable services */ export interface QueryServicesDescriptorSDKType { - /** query_services is a list of cosmos-sdk QueryServiceDescriptor */ query_services: QueryServiceDescriptorSDKType[]; } @@ -412,13 +345,8 @@ export interface QueryServiceDescriptor { /** QueryServiceDescriptor describes a cosmos-sdk queryable service */ export interface QueryServiceDescriptorSDKType { - /** fullname is the protobuf fullname of the service descriptor */ fullname: string; - - /** is_module describes if this service is actually exposed by an application's module */ is_module: boolean; - - /** methods provides a list of query service methods */ methods: QueryMethodDescriptorSDKType[]; } @@ -444,13 +372,7 @@ export interface QueryMethodDescriptor { * because it would be redundant with the grpc reflection service */ export interface QueryMethodDescriptorSDKType { - /** name is the protobuf name (not fullname) of the method */ name: string; - - /** - * full_query_path is the path that can be used to query - * this method via tendermint abci.Query - */ full_query_path: string; } diff --git a/__fixtures__/output1/cosmos/base/snapshots/v1beta1/snapshot.ts b/__fixtures__/output1/cosmos/base/snapshots/v1beta1/snapshot.ts index 0b088670f8..2df90bfa9f 100644 --- a/__fixtures__/output1/cosmos/base/snapshots/v1beta1/snapshot.ts +++ b/__fixtures__/output1/cosmos/base/snapshots/v1beta1/snapshot.ts @@ -28,7 +28,6 @@ export interface Metadata { /** Metadata contains SDK-specific snapshot metadata. */ export interface MetadataSDKType { - /** SHA-256 chunk hashes */ chunk_hashes: Uint8Array[]; } @@ -78,11 +77,7 @@ export interface SnapshotIAVLItem { export interface SnapshotIAVLItemSDKType { key: Uint8Array; value: Uint8Array; - - /** version is block height */ version: Long; - - /** height is depth of the tree. */ height: number; } diff --git a/__fixtures__/output1/cosmos/base/store/v1beta1/listening.ts b/__fixtures__/output1/cosmos/base/store/v1beta1/listening.ts index dc5fc369a2..ad53997d06 100644 --- a/__fixtures__/output1/cosmos/base/store/v1beta1/listening.ts +++ b/__fixtures__/output1/cosmos/base/store/v1beta1/listening.ts @@ -27,10 +27,7 @@ export interface StoreKVPair { * Since: cosmos-sdk 0.43 */ export interface StoreKVPairSDKType { - /** the store key for the KVStore this pair originates from */ store_key: string; - - /** true indicates a delete operation, false indicates a set operation */ delete: boolean; key: Uint8Array; value: Uint8Array; diff --git a/__fixtures__/output1/cosmos/base/tendermint/v1beta1/query.ts b/__fixtures__/output1/cosmos/base/tendermint/v1beta1/query.ts index 206b96261e..74b186c738 100644 --- a/__fixtures__/output1/cosmos/base/tendermint/v1beta1/query.ts +++ b/__fixtures__/output1/cosmos/base/tendermint/v1beta1/query.ts @@ -18,8 +18,6 @@ export interface GetValidatorSetByHeightRequest { /** GetValidatorSetByHeightRequest is the request type for the Query/GetValidatorSetByHeight RPC method. */ export interface GetValidatorSetByHeightRequestSDKType { height: Long; - - /** pagination defines an pagination for the request. */ pagination?: PageRequestSDKType; } @@ -36,8 +34,6 @@ export interface GetValidatorSetByHeightResponse { export interface GetValidatorSetByHeightResponseSDKType { block_height: Long; validators: ValidatorSDKType[]; - - /** pagination defines an pagination for the response. */ pagination?: PageResponseSDKType; } @@ -49,7 +45,6 @@ export interface GetLatestValidatorSetRequest { /** GetLatestValidatorSetRequest is the request type for the Query/GetValidatorSetByHeight RPC method. */ export interface GetLatestValidatorSetRequestSDKType { - /** pagination defines an pagination for the request. */ pagination?: PageRequestSDKType; } @@ -66,8 +61,6 @@ export interface GetLatestValidatorSetResponse { export interface GetLatestValidatorSetResponseSDKType { block_height: Long; validators: ValidatorSDKType[]; - - /** pagination defines an pagination for the response. */ pagination?: PageResponseSDKType; } @@ -184,8 +177,6 @@ export interface VersionInfoSDKType { build_tags: string; go_version: string; build_deps: ModuleSDKType[]; - - /** Since: cosmos-sdk 0.43 */ cosmos_sdk_version: string; } @@ -203,13 +194,8 @@ export interface Module { /** Module is the type for VersionInfo */ export interface ModuleSDKType { - /** module path */ path: string; - - /** module version */ version: string; - - /** checksum */ sum: string; } diff --git a/__fixtures__/output1/cosmos/bundle.ts b/__fixtures__/output1/cosmos/bundle.ts index 9bac5d996e..da40e3ce77 100644 --- a/__fixtures__/output1/cosmos/bundle.ts +++ b/__fixtures__/output1/cosmos/bundle.ts @@ -90,106 +90,106 @@ import * as _143 from "./upgrade/v1beta1/tx"; import * as _144 from "./upgrade/v1beta1/upgrade"; import * as _145 from "./vesting/v1beta1/tx"; import * as _146 from "./vesting/v1beta1/vesting"; -import * as _354 from "./authz/v1beta1/tx.amino"; -import * as _355 from "./bank/v1beta1/tx.amino"; -import * as _356 from "./crisis/v1beta1/tx.amino"; -import * as _357 from "./distribution/v1beta1/tx.amino"; -import * as _358 from "./evidence/v1beta1/tx.amino"; -import * as _359 from "./feegrant/v1beta1/tx.amino"; -import * as _360 from "./gov/v1/tx.amino"; -import * as _361 from "./gov/v1beta1/tx.amino"; -import * as _362 from "./group/v1/tx.amino"; -import * as _363 from "./nft/v1beta1/tx.amino"; -import * as _364 from "./slashing/v1beta1/tx.amino"; -import * as _365 from "./staking/v1beta1/tx.amino"; -import * as _366 from "./upgrade/v1beta1/tx.amino"; -import * as _367 from "./vesting/v1beta1/tx.amino"; -import * as _368 from "./authz/v1beta1/tx.registry"; -import * as _369 from "./bank/v1beta1/tx.registry"; -import * as _370 from "./crisis/v1beta1/tx.registry"; -import * as _371 from "./distribution/v1beta1/tx.registry"; -import * as _372 from "./evidence/v1beta1/tx.registry"; -import * as _373 from "./feegrant/v1beta1/tx.registry"; -import * as _374 from "./gov/v1/tx.registry"; -import * as _375 from "./gov/v1beta1/tx.registry"; -import * as _376 from "./group/v1/tx.registry"; -import * as _377 from "./nft/v1beta1/tx.registry"; -import * as _378 from "./slashing/v1beta1/tx.registry"; -import * as _379 from "./staking/v1beta1/tx.registry"; -import * as _380 from "./upgrade/v1beta1/tx.registry"; -import * as _381 from "./vesting/v1beta1/tx.registry"; -import * as _382 from "./auth/v1beta1/query.lcd"; -import * as _383 from "./authz/v1beta1/query.lcd"; -import * as _384 from "./bank/v1beta1/query.lcd"; -import * as _385 from "./base/reflection/v1beta1/reflection.lcd"; -import * as _386 from "./base/reflection/v2alpha1/reflection.lcd"; -import * as _387 from "./base/tendermint/v1beta1/query.lcd"; -import * as _388 from "./distribution/v1beta1/query.lcd"; -import * as _389 from "./evidence/v1beta1/query.lcd"; -import * as _390 from "./feegrant/v1beta1/query.lcd"; -import * as _391 from "./gov/v1/query.lcd"; -import * as _392 from "./gov/v1beta1/query.lcd"; -import * as _393 from "./group/v1/query.lcd"; -import * as _394 from "./mint/v1beta1/query.lcd"; -import * as _395 from "./nft/v1beta1/query.lcd"; -import * as _396 from "./params/v1beta1/query.lcd"; -import * as _397 from "./slashing/v1beta1/query.lcd"; -import * as _398 from "./staking/v1beta1/query.lcd"; -import * as _399 from "./tx/v1beta1/service.lcd"; -import * as _400 from "./upgrade/v1beta1/query.lcd"; -import * as _401 from "./app/v1alpha1/query.rpc.Query"; -import * as _402 from "./auth/v1beta1/query.rpc.Query"; -import * as _403 from "./authz/v1beta1/query.rpc.Query"; -import * as _404 from "./bank/v1beta1/query.rpc.Query"; -import * as _405 from "./base/reflection/v1beta1/reflection.rpc.ReflectionService"; -import * as _406 from "./base/reflection/v2alpha1/reflection.rpc.ReflectionService"; -import * as _407 from "./base/tendermint/v1beta1/query.rpc.Service"; -import * as _408 from "./distribution/v1beta1/query.rpc.Query"; -import * as _409 from "./evidence/v1beta1/query.rpc.Query"; -import * as _410 from "./feegrant/v1beta1/query.rpc.Query"; -import * as _411 from "./gov/v1/query.rpc.Query"; -import * as _412 from "./gov/v1beta1/query.rpc.Query"; -import * as _413 from "./group/v1/query.rpc.Query"; -import * as _414 from "./mint/v1beta1/query.rpc.Query"; -import * as _415 from "./nft/v1beta1/query.rpc.Query"; -import * as _416 from "./params/v1beta1/query.rpc.Query"; -import * as _417 from "./slashing/v1beta1/query.rpc.Query"; -import * as _418 from "./staking/v1beta1/query.rpc.Query"; -import * as _419 from "./tx/v1beta1/service.rpc.Service"; -import * as _420 from "./upgrade/v1beta1/query.rpc.Query"; -import * as _421 from "./authz/v1beta1/tx.rpc.msg"; -import * as _422 from "./bank/v1beta1/tx.rpc.msg"; -import * as _423 from "./crisis/v1beta1/tx.rpc.msg"; -import * as _424 from "./distribution/v1beta1/tx.rpc.msg"; -import * as _425 from "./evidence/v1beta1/tx.rpc.msg"; -import * as _426 from "./feegrant/v1beta1/tx.rpc.msg"; -import * as _427 from "./gov/v1/tx.rpc.msg"; -import * as _428 from "./gov/v1beta1/tx.rpc.msg"; -import * as _429 from "./group/v1/tx.rpc.msg"; -import * as _430 from "./nft/v1beta1/tx.rpc.msg"; -import * as _431 from "./slashing/v1beta1/tx.rpc.msg"; -import * as _432 from "./staking/v1beta1/tx.rpc.msg"; -import * as _433 from "./upgrade/v1beta1/tx.rpc.msg"; -import * as _434 from "./vesting/v1beta1/tx.rpc.msg"; -import * as _538 from "./lcd"; -import * as _539 from "./rpc.query"; -import * as _540 from "./cosmos-rpc-client.query"; -import * as _541 from "./rpc.tx"; -import * as _542 from "./cosmos-rpc-client.tx"; +import * as _352 from "./authz/v1beta1/tx.amino"; +import * as _353 from "./bank/v1beta1/tx.amino"; +import * as _354 from "./crisis/v1beta1/tx.amino"; +import * as _355 from "./distribution/v1beta1/tx.amino"; +import * as _356 from "./evidence/v1beta1/tx.amino"; +import * as _357 from "./feegrant/v1beta1/tx.amino"; +import * as _358 from "./gov/v1/tx.amino"; +import * as _359 from "./gov/v1beta1/tx.amino"; +import * as _360 from "./group/v1/tx.amino"; +import * as _361 from "./nft/v1beta1/tx.amino"; +import * as _362 from "./slashing/v1beta1/tx.amino"; +import * as _363 from "./staking/v1beta1/tx.amino"; +import * as _364 from "./upgrade/v1beta1/tx.amino"; +import * as _365 from "./vesting/v1beta1/tx.amino"; +import * as _366 from "./authz/v1beta1/tx.registry"; +import * as _367 from "./bank/v1beta1/tx.registry"; +import * as _368 from "./crisis/v1beta1/tx.registry"; +import * as _369 from "./distribution/v1beta1/tx.registry"; +import * as _370 from "./evidence/v1beta1/tx.registry"; +import * as _371 from "./feegrant/v1beta1/tx.registry"; +import * as _372 from "./gov/v1/tx.registry"; +import * as _373 from "./gov/v1beta1/tx.registry"; +import * as _374 from "./group/v1/tx.registry"; +import * as _375 from "./nft/v1beta1/tx.registry"; +import * as _376 from "./slashing/v1beta1/tx.registry"; +import * as _377 from "./staking/v1beta1/tx.registry"; +import * as _378 from "./upgrade/v1beta1/tx.registry"; +import * as _379 from "./vesting/v1beta1/tx.registry"; +import * as _380 from "./auth/v1beta1/query.lcd"; +import * as _381 from "./authz/v1beta1/query.lcd"; +import * as _382 from "./bank/v1beta1/query.lcd"; +import * as _383 from "./base/reflection/v1beta1/reflection.lcd"; +import * as _384 from "./base/reflection/v2alpha1/reflection.lcd"; +import * as _385 from "./base/tendermint/v1beta1/query.lcd"; +import * as _386 from "./distribution/v1beta1/query.lcd"; +import * as _387 from "./evidence/v1beta1/query.lcd"; +import * as _388 from "./feegrant/v1beta1/query.lcd"; +import * as _389 from "./gov/v1/query.lcd"; +import * as _390 from "./gov/v1beta1/query.lcd"; +import * as _391 from "./group/v1/query.lcd"; +import * as _392 from "./mint/v1beta1/query.lcd"; +import * as _393 from "./nft/v1beta1/query.lcd"; +import * as _394 from "./params/v1beta1/query.lcd"; +import * as _395 from "./slashing/v1beta1/query.lcd"; +import * as _396 from "./staking/v1beta1/query.lcd"; +import * as _397 from "./tx/v1beta1/service.lcd"; +import * as _398 from "./upgrade/v1beta1/query.lcd"; +import * as _399 from "./app/v1alpha1/query.rpc.Query"; +import * as _400 from "./auth/v1beta1/query.rpc.Query"; +import * as _401 from "./authz/v1beta1/query.rpc.Query"; +import * as _402 from "./bank/v1beta1/query.rpc.Query"; +import * as _403 from "./base/reflection/v1beta1/reflection.rpc.ReflectionService"; +import * as _404 from "./base/reflection/v2alpha1/reflection.rpc.ReflectionService"; +import * as _405 from "./base/tendermint/v1beta1/query.rpc.Service"; +import * as _406 from "./distribution/v1beta1/query.rpc.Query"; +import * as _407 from "./evidence/v1beta1/query.rpc.Query"; +import * as _408 from "./feegrant/v1beta1/query.rpc.Query"; +import * as _409 from "./gov/v1/query.rpc.Query"; +import * as _410 from "./gov/v1beta1/query.rpc.Query"; +import * as _411 from "./group/v1/query.rpc.Query"; +import * as _412 from "./mint/v1beta1/query.rpc.Query"; +import * as _413 from "./nft/v1beta1/query.rpc.Query"; +import * as _414 from "./params/v1beta1/query.rpc.Query"; +import * as _415 from "./slashing/v1beta1/query.rpc.Query"; +import * as _416 from "./staking/v1beta1/query.rpc.Query"; +import * as _417 from "./tx/v1beta1/service.rpc.Service"; +import * as _418 from "./upgrade/v1beta1/query.rpc.Query"; +import * as _419 from "./authz/v1beta1/tx.rpc.msg"; +import * as _420 from "./bank/v1beta1/tx.rpc.msg"; +import * as _421 from "./crisis/v1beta1/tx.rpc.msg"; +import * as _422 from "./distribution/v1beta1/tx.rpc.msg"; +import * as _423 from "./evidence/v1beta1/tx.rpc.msg"; +import * as _424 from "./feegrant/v1beta1/tx.rpc.msg"; +import * as _425 from "./gov/v1/tx.rpc.msg"; +import * as _426 from "./gov/v1beta1/tx.rpc.msg"; +import * as _427 from "./group/v1/tx.rpc.msg"; +import * as _428 from "./nft/v1beta1/tx.rpc.msg"; +import * as _429 from "./slashing/v1beta1/tx.rpc.msg"; +import * as _430 from "./staking/v1beta1/tx.rpc.msg"; +import * as _431 from "./upgrade/v1beta1/tx.rpc.msg"; +import * as _432 from "./vesting/v1beta1/tx.rpc.msg"; +import * as _535 from "./lcd"; +import * as _536 from "./rpc.query"; +import * as _537 from "./cosmos-rpc-client.query"; +import * as _538 from "./rpc.tx"; +import * as _539 from "./cosmos-rpc-client.tx"; export namespace cosmos { export namespace app { export const v1alpha1 = { ..._55, ..._56, ..._57, - ..._401 + ..._399 }; } export namespace auth { export const v1beta1 = { ..._58, ..._59, ..._60, - ..._382, - ..._402 + ..._380, + ..._400 }; } export namespace authz { @@ -197,11 +197,11 @@ export namespace cosmos { ..._62, ..._63, ..._64, - ..._354, - ..._368, - ..._383, - ..._403, - ..._421 + ..._352, + ..._366, + ..._381, + ..._401, + ..._419 }; } export namespace bank { @@ -210,11 +210,11 @@ export namespace cosmos { ..._67, ..._68, ..._69, - ..._355, - ..._369, - ..._384, - ..._404, - ..._422 + ..._353, + ..._367, + ..._382, + ..._402, + ..._420 }; } export namespace base { @@ -232,12 +232,12 @@ export namespace cosmos { } export namespace reflection { export const v1beta1 = { ..._73, - ..._385, - ..._405 + ..._383, + ..._403 }; export const v2alpha1 = { ..._74, - ..._386, - ..._406 + ..._384, + ..._404 }; } export namespace snapshots { @@ -251,8 +251,8 @@ export namespace cosmos { } export namespace tendermint { export const v1beta1 = { ..._78, - ..._387, - ..._407 + ..._385, + ..._405 }; } export const v1beta1 = { ..._79 @@ -266,9 +266,9 @@ export namespace cosmos { export namespace crisis { export const v1beta1 = { ..._82, ..._83, - ..._356, - ..._370, - ..._423 + ..._354, + ..._368, + ..._421 }; } export namespace crypto { @@ -294,11 +294,11 @@ export namespace cosmos { ..._91, ..._92, ..._93, - ..._357, - ..._371, - ..._388, - ..._408, - ..._424 + ..._355, + ..._369, + ..._386, + ..._406, + ..._422 }; } export namespace evidence { @@ -306,11 +306,11 @@ export namespace cosmos { ..._95, ..._96, ..._97, - ..._358, - ..._372, - ..._389, - ..._409, - ..._425 + ..._356, + ..._370, + ..._387, + ..._407, + ..._423 }; } export namespace feegrant { @@ -318,11 +318,11 @@ export namespace cosmos { ..._99, ..._100, ..._101, - ..._359, - ..._373, - ..._390, - ..._410, - ..._426 + ..._357, + ..._371, + ..._388, + ..._408, + ..._424 }; } export namespace genutil { @@ -334,21 +334,21 @@ export namespace cosmos { ..._104, ..._105, ..._106, - ..._360, - ..._374, - ..._391, - ..._411, - ..._427 + ..._358, + ..._372, + ..._389, + ..._409, + ..._425 }; export const v1beta1 = { ..._107, ..._108, ..._109, ..._110, - ..._361, - ..._375, - ..._392, - ..._412, - ..._428 + ..._359, + ..._373, + ..._390, + ..._410, + ..._426 }; } export namespace group { @@ -357,19 +357,19 @@ export namespace cosmos { ..._113, ..._114, ..._115, - ..._362, - ..._376, - ..._393, - ..._413, - ..._429 + ..._360, + ..._374, + ..._391, + ..._411, + ..._427 }; } export namespace mint { export const v1beta1 = { ..._116, ..._117, ..._118, - ..._394, - ..._414 + ..._392, + ..._412 }; } export namespace msg { @@ -382,11 +382,11 @@ export namespace cosmos { ..._122, ..._123, ..._124, - ..._363, - ..._377, - ..._395, - ..._415, - ..._430 + ..._361, + ..._375, + ..._393, + ..._413, + ..._428 }; } export namespace orm { @@ -402,8 +402,8 @@ export namespace cosmos { export namespace params { export const v1beta1 = { ..._128, ..._129, - ..._396, - ..._416 + ..._394, + ..._414 }; } export namespace slashing { @@ -411,11 +411,11 @@ export namespace cosmos { ..._131, ..._132, ..._133, - ..._364, - ..._378, - ..._397, - ..._417, - ..._431 + ..._362, + ..._376, + ..._395, + ..._415, + ..._429 }; } export namespace staking { @@ -424,11 +424,11 @@ export namespace cosmos { ..._136, ..._137, ..._138, - ..._365, - ..._379, - ..._398, - ..._418, - ..._432 + ..._363, + ..._377, + ..._396, + ..._416, + ..._430 }; } export namespace tx { @@ -438,33 +438,33 @@ export namespace cosmos { } export const v1beta1 = { ..._140, ..._141, - ..._399, - ..._419 + ..._397, + ..._417 }; } export namespace upgrade { export const v1beta1 = { ..._142, ..._143, ..._144, - ..._366, - ..._380, - ..._400, - ..._420, - ..._433 + ..._364, + ..._378, + ..._398, + ..._418, + ..._431 }; } export namespace vesting { export const v1beta1 = { ..._145, ..._146, - ..._367, - ..._381, - ..._434 + ..._365, + ..._379, + ..._432 }; } - export const ClientFactory = { ..._538, - ..._539, - ..._540, - ..._541, - ..._542 + export const ClientFactory = { ..._535, + ..._536, + ..._537, + ..._538, + ..._539 }; } \ No newline at end of file diff --git a/__fixtures__/output1/cosmos/capability/v1beta1/genesis.ts b/__fixtures__/output1/cosmos/capability/v1beta1/genesis.ts index 663ce144f3..26688b9df2 100644 --- a/__fixtures__/output1/cosmos/capability/v1beta1/genesis.ts +++ b/__fixtures__/output1/cosmos/capability/v1beta1/genesis.ts @@ -14,10 +14,7 @@ export interface GenesisOwners { /** GenesisOwners defines the capability owners with their corresponding index. */ export interface GenesisOwnersSDKType { - /** index is the index of the capability owner. */ index: Long; - - /** index_owners are the owners at the given index. */ index_owners?: CapabilityOwnersSDKType; } @@ -35,13 +32,7 @@ export interface GenesisState { /** GenesisState defines the capability module's genesis state. */ export interface GenesisStateSDKType { - /** index is the capability global index. */ index: Long; - - /** - * owners represents a map from index to owners of the capability index - * index key is string to allow amino marshalling. - */ owners: GenesisOwnersSDKType[]; } diff --git a/__fixtures__/output1/cosmos/crisis/v1beta1/genesis.ts b/__fixtures__/output1/cosmos/crisis/v1beta1/genesis.ts index 8537be7c72..a3e0a74071 100644 --- a/__fixtures__/output1/cosmos/crisis/v1beta1/genesis.ts +++ b/__fixtures__/output1/cosmos/crisis/v1beta1/genesis.ts @@ -14,10 +14,6 @@ export interface GenesisState { /** GenesisState defines the crisis module's genesis state. */ export interface GenesisStateSDKType { - /** - * constant_fee is the fee used to verify the invariant in the crisis - * module. - */ constant_fee?: CoinSDKType; } diff --git a/__fixtures__/output1/cosmos/crypto/hd/v1/hd.ts b/__fixtures__/output1/cosmos/crypto/hd/v1/hd.ts index 7f4236aad2..f2663ad7f6 100644 --- a/__fixtures__/output1/cosmos/crypto/hd/v1/hd.ts +++ b/__fixtures__/output1/cosmos/crypto/hd/v1/hd.ts @@ -25,22 +25,10 @@ export interface BIP44Params { /** BIP44Params is used as path field in ledger item in Record. */ export interface BIP44ParamsSDKType { - /** purpose is a constant set to 44' (or 0x8000002C) following the BIP43 recommendation */ purpose: number; - - /** coin_type is a constant that improves privacy */ coin_type: number; - - /** account splits the key space into independent user identities */ account: number; - - /** - * change is a constant used for public derivation. Constant 0 is used for external chain and constant 1 for internal - * chain. - */ change: boolean; - - /** address_index is used as child index in BIP32 derivation */ address_index: number; } diff --git a/__fixtures__/output1/cosmos/crypto/keyring/v1/record.ts b/__fixtures__/output1/cosmos/crypto/keyring/v1/record.ts index 6491eabe6e..68af248603 100644 --- a/__fixtures__/output1/cosmos/crypto/keyring/v1/record.ts +++ b/__fixtures__/output1/cosmos/crypto/keyring/v1/record.ts @@ -27,22 +27,11 @@ export interface Record { /** Record is used for representing a key in the keyring. */ export interface RecordSDKType { - /** name represents a name of Record */ name: string; - - /** pub_key represents a public key in any format */ pub_key?: AnySDKType; - - /** local stores the public information about a locally stored key */ local?: Record_LocalSDKType; - - /** ledger stores the public information about a Ledger key */ ledger?: Record_LedgerSDKType; - - /** Multi does not store any information. */ multi?: Record_MultiSDKType; - - /** Offline does not store any information. */ offline?: Record_OfflineSDKType; } diff --git a/__fixtures__/output1/cosmos/crypto/secp256r1/keys.ts b/__fixtures__/output1/cosmos/crypto/secp256r1/keys.ts index 8573977d71..e8fe04afa1 100644 --- a/__fixtures__/output1/cosmos/crypto/secp256r1/keys.ts +++ b/__fixtures__/output1/cosmos/crypto/secp256r1/keys.ts @@ -13,10 +13,6 @@ export interface PubKey { /** PubKey defines a secp256r1 ECDSA public key. */ export interface PubKeySDKType { - /** - * Point on secp256r1 curve in a compressed representation as specified in section - * 4.3.6 of ANSI X9.62: https://webstore.ansi.org/standards/ascx9/ansix9621998 - */ key: Uint8Array; } @@ -28,7 +24,6 @@ export interface PrivKey { /** PrivKey defines a secp256r1 ECDSA private key. */ export interface PrivKeySDKType { - /** secret number serialized using big-endian encoding */ secret: Uint8Array; } diff --git a/__fixtures__/output1/cosmos/distribution/v1beta1/genesis.ts b/__fixtures__/output1/cosmos/distribution/v1beta1/genesis.ts index a60fa0eeaa..8f23da4d41 100644 --- a/__fixtures__/output1/cosmos/distribution/v1beta1/genesis.ts +++ b/__fixtures__/output1/cosmos/distribution/v1beta1/genesis.ts @@ -23,10 +23,7 @@ export interface DelegatorWithdrawInfo { * default withdraw addresses. */ export interface DelegatorWithdrawInfoSDKType { - /** delegator_address is the address of the delegator. */ delegator_address: string; - - /** withdraw_address is the address to withdraw the delegation rewards to. */ withdraw_address: string; } @@ -41,10 +38,7 @@ export interface ValidatorOutstandingRewardsRecord { /** ValidatorOutstandingRewardsRecord is used for import/export via genesis json. */ export interface ValidatorOutstandingRewardsRecordSDKType { - /** validator_address is the address of the validator. */ validator_address: string; - - /** outstanding_rewards represents the oustanding rewards of a validator. */ outstanding_rewards: DecCoinSDKType[]; } @@ -65,10 +59,7 @@ export interface ValidatorAccumulatedCommissionRecord { * json. */ export interface ValidatorAccumulatedCommissionRecordSDKType { - /** validator_address is the address of the validator. */ validator_address: string; - - /** accumulated is the accumulated commission of a validator. */ accumulated?: ValidatorAccumulatedCommissionSDKType; } @@ -92,13 +83,8 @@ export interface ValidatorHistoricalRewardsRecord { * json. */ export interface ValidatorHistoricalRewardsRecordSDKType { - /** validator_address is the address of the validator. */ validator_address: string; - - /** period defines the period the historical rewards apply to. */ period: Long; - - /** rewards defines the historical rewards of a validator. */ rewards?: ValidatorHistoricalRewardsSDKType; } @@ -113,10 +99,7 @@ export interface ValidatorCurrentRewardsRecord { /** ValidatorCurrentRewardsRecord is used for import / export via genesis json. */ export interface ValidatorCurrentRewardsRecordSDKType { - /** validator_address is the address of the validator. */ validator_address: string; - - /** rewards defines the current rewards of a validator. */ rewards?: ValidatorCurrentRewardsSDKType; } @@ -134,13 +117,8 @@ export interface DelegatorStartingInfoRecord { /** DelegatorStartingInfoRecord used for import / export via genesis json. */ export interface DelegatorStartingInfoRecordSDKType { - /** delegator_address is the address of the delegator. */ delegator_address: string; - - /** validator_address is the address of the validator. */ validator_address: string; - - /** starting_info defines the starting info of a delegator. */ starting_info?: DelegatorStartingInfoSDKType; } @@ -161,16 +139,9 @@ export interface ValidatorSlashEventRecord { /** ValidatorSlashEventRecord is used for import / export via genesis json. */ export interface ValidatorSlashEventRecordSDKType { - /** validator_address is the address of the validator. */ validator_address: string; - - /** height defines the block height at which the slash event occured. */ height: Long; - - /** period is the period of the slash event. */ period: Long; - - /** validator_slash_event describes the slash event. */ validator_slash_event?: ValidatorSlashEventSDKType; } @@ -209,34 +180,15 @@ export interface GenesisState { /** GenesisState defines the distribution module's genesis state. */ export interface GenesisStateSDKType { - /** params defines all the paramaters of the module. */ params?: ParamsSDKType; - - /** fee_pool defines the fee pool at genesis. */ fee_pool?: FeePoolSDKType; - - /** fee_pool defines the delegator withdraw infos at genesis. */ delegator_withdraw_infos: DelegatorWithdrawInfoSDKType[]; - - /** fee_pool defines the previous proposer at genesis. */ previous_proposer: string; - - /** fee_pool defines the outstanding rewards of all validators at genesis. */ outstanding_rewards: ValidatorOutstandingRewardsRecordSDKType[]; - - /** fee_pool defines the accumulated commisions of all validators at genesis. */ validator_accumulated_commissions: ValidatorAccumulatedCommissionRecordSDKType[]; - - /** fee_pool defines the historical rewards of all validators at genesis. */ validator_historical_rewards: ValidatorHistoricalRewardsRecordSDKType[]; - - /** fee_pool defines the current rewards of all validators at genesis. */ validator_current_rewards: ValidatorCurrentRewardsRecordSDKType[]; - - /** fee_pool defines the delegator starting infos at genesis. */ delegator_starting_infos: DelegatorStartingInfoRecordSDKType[]; - - /** fee_pool defines the validator slash events at genesis. */ validator_slash_events: ValidatorSlashEventRecordSDKType[]; } diff --git a/__fixtures__/output1/cosmos/distribution/v1beta1/query.ts b/__fixtures__/output1/cosmos/distribution/v1beta1/query.ts index a7f727fe84..9a033b9fb5 100644 --- a/__fixtures__/output1/cosmos/distribution/v1beta1/query.ts +++ b/__fixtures__/output1/cosmos/distribution/v1beta1/query.ts @@ -19,7 +19,6 @@ export interface QueryParamsResponse { /** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponseSDKType { - /** params defines the parameters of the module. */ params?: ParamsSDKType; } @@ -37,7 +36,6 @@ export interface QueryValidatorOutstandingRewardsRequest { * Query/ValidatorOutstandingRewards RPC method. */ export interface QueryValidatorOutstandingRewardsRequestSDKType { - /** validator_address defines the validator address to query for. */ validator_address: string; } @@ -71,7 +69,6 @@ export interface QueryValidatorCommissionRequest { * Query/ValidatorCommission RPC method */ export interface QueryValidatorCommissionRequestSDKType { - /** validator_address defines the validator address to query for. */ validator_address: string; } @@ -89,7 +86,6 @@ export interface QueryValidatorCommissionResponse { * Query/ValidatorCommission RPC method */ export interface QueryValidatorCommissionResponseSDKType { - /** commission defines the commision the validator received. */ commission?: ValidatorAccumulatedCommissionSDKType; } @@ -116,16 +112,9 @@ export interface QueryValidatorSlashesRequest { * Query/ValidatorSlashes RPC method */ export interface QueryValidatorSlashesRequestSDKType { - /** validator_address defines the validator address to query for. */ validator_address: string; - - /** starting_height defines the optional starting height to query the slashes. */ starting_height: Long; - - /** starting_height defines the optional ending height to query the slashes. */ ending_height: Long; - - /** pagination defines an optional pagination for the request. */ pagination?: PageRequestSDKType; } @@ -146,10 +135,7 @@ export interface QueryValidatorSlashesResponse { * Query/ValidatorSlashes RPC method. */ export interface QueryValidatorSlashesResponseSDKType { - /** slashes defines the slashes the validator received. */ slashes: ValidatorSlashEventSDKType[]; - - /** pagination defines the pagination in the response. */ pagination?: PageResponseSDKType; } @@ -170,10 +156,7 @@ export interface QueryDelegationRewardsRequest { * Query/DelegationRewards RPC method. */ export interface QueryDelegationRewardsRequestSDKType { - /** delegator_address defines the delegator address to query for. */ delegator_address: string; - - /** validator_address defines the validator address to query for. */ validator_address: string; } @@ -191,7 +174,6 @@ export interface QueryDelegationRewardsResponse { * Query/DelegationRewards RPC method. */ export interface QueryDelegationRewardsResponseSDKType { - /** rewards defines the rewards accrued by a delegation. */ rewards: DecCoinSDKType[]; } @@ -209,7 +191,6 @@ export interface QueryDelegationTotalRewardsRequest { * Query/DelegationTotalRewards RPC method. */ export interface QueryDelegationTotalRewardsRequestSDKType { - /** delegator_address defines the delegator address to query for. */ delegator_address: string; } @@ -230,10 +211,7 @@ export interface QueryDelegationTotalRewardsResponse { * Query/DelegationTotalRewards RPC method. */ export interface QueryDelegationTotalRewardsResponseSDKType { - /** rewards defines all the rewards accrued by a delegator. */ rewards: DelegationDelegatorRewardSDKType[]; - - /** total defines the sum of all the rewards. */ total: DecCoinSDKType[]; } @@ -251,7 +229,6 @@ export interface QueryDelegatorValidatorsRequest { * Query/DelegatorValidators RPC method. */ export interface QueryDelegatorValidatorsRequestSDKType { - /** delegator_address defines the delegator address to query for. */ delegator_address: string; } @@ -269,7 +246,6 @@ export interface QueryDelegatorValidatorsResponse { * Query/DelegatorValidators RPC method. */ export interface QueryDelegatorValidatorsResponseSDKType { - /** validators defines the validators a delegator is delegating for. */ validators: string[]; } @@ -287,7 +263,6 @@ export interface QueryDelegatorWithdrawAddressRequest { * Query/DelegatorWithdrawAddress RPC method. */ export interface QueryDelegatorWithdrawAddressRequestSDKType { - /** delegator_address defines the delegator address to query for. */ delegator_address: string; } @@ -305,7 +280,6 @@ export interface QueryDelegatorWithdrawAddressResponse { * Query/DelegatorWithdrawAddress RPC method. */ export interface QueryDelegatorWithdrawAddressResponseSDKType { - /** withdraw_address defines the delegator address to query for. */ withdraw_address: string; } @@ -335,7 +309,6 @@ export interface QueryCommunityPoolResponse { * RPC method. */ export interface QueryCommunityPoolResponseSDKType { - /** pool defines community pool's coins. */ pool: DecCoinSDKType[]; } diff --git a/__fixtures__/output1/cosmos/evidence/v1beta1/genesis.ts b/__fixtures__/output1/cosmos/evidence/v1beta1/genesis.ts index d6d61214a8..c0bf7f8fd3 100644 --- a/__fixtures__/output1/cosmos/evidence/v1beta1/genesis.ts +++ b/__fixtures__/output1/cosmos/evidence/v1beta1/genesis.ts @@ -11,7 +11,6 @@ export interface GenesisState { /** GenesisState defines the evidence module's genesis state. */ export interface GenesisStateSDKType { - /** evidence defines all the evidence at genesis. */ evidence: AnySDKType[]; } diff --git a/__fixtures__/output1/cosmos/evidence/v1beta1/query.ts b/__fixtures__/output1/cosmos/evidence/v1beta1/query.ts index c2eb7c1e97..886897c7ae 100644 --- a/__fixtures__/output1/cosmos/evidence/v1beta1/query.ts +++ b/__fixtures__/output1/cosmos/evidence/v1beta1/query.ts @@ -12,7 +12,6 @@ export interface QueryEvidenceRequest { /** QueryEvidenceRequest is the request type for the Query/Evidence RPC method. */ export interface QueryEvidenceRequestSDKType { - /** evidence_hash defines the hash of the requested evidence. */ evidence_hash: Uint8Array; } @@ -24,7 +23,6 @@ export interface QueryEvidenceResponse { /** QueryEvidenceResponse is the response type for the Query/Evidence RPC method. */ export interface QueryEvidenceResponseSDKType { - /** evidence returns the requested evidence. */ evidence?: AnySDKType; } @@ -42,7 +40,6 @@ export interface QueryAllEvidenceRequest { * method. */ export interface QueryAllEvidenceRequestSDKType { - /** pagination defines an optional pagination for the request. */ pagination?: PageRequestSDKType; } @@ -63,10 +60,7 @@ export interface QueryAllEvidenceResponse { * method. */ export interface QueryAllEvidenceResponseSDKType { - /** evidence returns all evidences. */ evidence: AnySDKType[]; - - /** pagination defines the pagination in the response. */ pagination?: PageResponseSDKType; } diff --git a/__fixtures__/output1/cosmos/evidence/v1beta1/tx.ts b/__fixtures__/output1/cosmos/evidence/v1beta1/tx.ts index 338427cc79..af8bc9fb68 100644 --- a/__fixtures__/output1/cosmos/evidence/v1beta1/tx.ts +++ b/__fixtures__/output1/cosmos/evidence/v1beta1/tx.ts @@ -29,7 +29,6 @@ export interface MsgSubmitEvidenceResponse { /** MsgSubmitEvidenceResponse defines the Msg/SubmitEvidence response type. */ export interface MsgSubmitEvidenceResponseSDKType { - /** hash defines the hash of the evidence. */ hash: Uint8Array; } diff --git a/__fixtures__/output1/cosmos/feegrant/v1beta1/feegrant.ts b/__fixtures__/output1/cosmos/feegrant/v1beta1/feegrant.ts index 23819f818c..f953adcca1 100644 --- a/__fixtures__/output1/cosmos/feegrant/v1beta1/feegrant.ts +++ b/__fixtures__/output1/cosmos/feegrant/v1beta1/feegrant.ts @@ -27,14 +27,7 @@ export interface BasicAllowance { * that optionally expires. The grantee can use up to SpendLimit to cover fees. */ export interface BasicAllowanceSDKType { - /** - * spend_limit specifies the maximum amount of tokens that can be spent - * by this allowance and will be updated as tokens are spent. If it is - * empty, there is no spend limit and any amount of coins can be spent. - */ spend_limit: CoinSDKType[]; - - /** expiration specifies an optional time when this allowance expires */ expiration?: Date; } @@ -74,29 +67,10 @@ export interface PeriodicAllowance { * as well as a limit per time period. */ export interface PeriodicAllowanceSDKType { - /** basic specifies a struct of `BasicAllowance` */ basic?: BasicAllowanceSDKType; - - /** - * period specifies the time duration in which period_spend_limit coins can - * be spent before that allowance is reset - */ period?: DurationSDKType; - - /** - * period_spend_limit specifies the maximum number of coins that can be spent - * in the period - */ period_spend_limit: CoinSDKType[]; - - /** period_can_spend is the number of coins left to be spent before the period_reset time */ period_can_spend: CoinSDKType[]; - - /** - * period_reset is the time at which this period resets and a new one begins, - * it is calculated from the start time of the first transaction after the - * last period ended - */ period_reset?: Date; } @@ -111,10 +85,7 @@ export interface AllowedMsgAllowance { /** AllowedMsgAllowance creates allowance only for specified message types. */ export interface AllowedMsgAllowanceSDKType { - /** allowance can be any of basic and periodic fee allowance. */ allowance?: AnySDKType; - - /** allowed_messages are the messages for which the grantee has the access. */ allowed_messages: string[]; } @@ -132,13 +103,8 @@ export interface Grant { /** Grant is stored in the KVStore to record a grant with full context */ export interface GrantSDKType { - /** granter is the address of the user granting an allowance of their funds. */ granter: string; - - /** grantee is the address of the user being granted an allowance of another user's funds. */ grantee: string; - - /** allowance can be any of basic, periodic, allowed fee allowance. */ allowance?: AnySDKType; } diff --git a/__fixtures__/output1/cosmos/feegrant/v1beta1/query.ts b/__fixtures__/output1/cosmos/feegrant/v1beta1/query.ts index f6e46ffc17..cd0a7c25c7 100644 --- a/__fixtures__/output1/cosmos/feegrant/v1beta1/query.ts +++ b/__fixtures__/output1/cosmos/feegrant/v1beta1/query.ts @@ -15,10 +15,7 @@ export interface QueryAllowanceRequest { /** QueryAllowanceRequest is the request type for the Query/Allowance RPC method. */ export interface QueryAllowanceRequestSDKType { - /** granter is the address of the user granting an allowance of their funds. */ granter: string; - - /** grantee is the address of the user being granted an allowance of another user's funds. */ grantee: string; } @@ -30,7 +27,6 @@ export interface QueryAllowanceResponse { /** QueryAllowanceResponse is the response type for the Query/Allowance RPC method. */ export interface QueryAllowanceResponseSDKType { - /** allowance is a allowance granted for grantee by granter. */ allowance?: GrantSDKType; } @@ -45,8 +41,6 @@ export interface QueryAllowancesRequest { /** QueryAllowancesRequest is the request type for the Query/Allowances RPC method. */ export interface QueryAllowancesRequestSDKType { grantee: string; - - /** pagination defines an pagination for the request. */ pagination?: PageRequestSDKType; } @@ -61,10 +55,7 @@ export interface QueryAllowancesResponse { /** QueryAllowancesResponse is the response type for the Query/Allowances RPC method. */ export interface QueryAllowancesResponseSDKType { - /** allowances are allowance's granted for grantee by granter. */ allowances: GrantSDKType[]; - - /** pagination defines an pagination for the response. */ pagination?: PageResponseSDKType; } @@ -79,8 +70,6 @@ export interface QueryAllowancesByGranterRequest { /** QueryAllowancesByGranterRequest is the request type for the Query/AllowancesByGranter RPC method. */ export interface QueryAllowancesByGranterRequestSDKType { granter: string; - - /** pagination defines an pagination for the request. */ pagination?: PageRequestSDKType; } @@ -95,10 +84,7 @@ export interface QueryAllowancesByGranterResponse { /** QueryAllowancesByGranterResponse is the response type for the Query/AllowancesByGranter RPC method. */ export interface QueryAllowancesByGranterResponseSDKType { - /** allowances that have been issued by the granter. */ allowances: GrantSDKType[]; - - /** pagination defines an pagination for the response. */ pagination?: PageResponseSDKType; } diff --git a/__fixtures__/output1/cosmos/feegrant/v1beta1/tx.ts b/__fixtures__/output1/cosmos/feegrant/v1beta1/tx.ts index 6bb910c390..165c4497b9 100644 --- a/__fixtures__/output1/cosmos/feegrant/v1beta1/tx.ts +++ b/__fixtures__/output1/cosmos/feegrant/v1beta1/tx.ts @@ -23,13 +23,8 @@ export interface MsgGrantAllowance { * of fees from the account of Granter. */ export interface MsgGrantAllowanceSDKType { - /** granter is the address of the user granting an allowance of their funds. */ granter: string; - - /** grantee is the address of the user being granted an allowance of another user's funds. */ grantee: string; - - /** allowance can be any of basic, periodic, allowed fee allowance. */ allowance?: AnySDKType; } @@ -50,10 +45,7 @@ export interface MsgRevokeAllowance { /** MsgRevokeAllowance removes any existing Allowance from Granter to Grantee. */ export interface MsgRevokeAllowanceSDKType { - /** granter is the address of the user granting an allowance of their funds. */ granter: string; - - /** grantee is the address of the user being granted an allowance of another user's funds. */ grantee: string; } diff --git a/__fixtures__/output1/cosmos/genutil/v1beta1/genesis.ts b/__fixtures__/output1/cosmos/genutil/v1beta1/genesis.ts index 5c8769b556..eb0fb697a8 100644 --- a/__fixtures__/output1/cosmos/genutil/v1beta1/genesis.ts +++ b/__fixtures__/output1/cosmos/genutil/v1beta1/genesis.ts @@ -10,7 +10,6 @@ export interface GenesisState { /** GenesisState defines the raw genesis transaction in JSON. */ export interface GenesisStateSDKType { - /** gen_txs defines the genesis transactions. */ gen_txs: Uint8Array[]; } diff --git a/__fixtures__/output1/cosmos/gov/v1/genesis.ts b/__fixtures__/output1/cosmos/gov/v1/genesis.ts index 3724f42c5d..691b8bee07 100644 --- a/__fixtures__/output1/cosmos/gov/v1/genesis.ts +++ b/__fixtures__/output1/cosmos/gov/v1/genesis.ts @@ -29,25 +29,12 @@ export interface GenesisState { /** GenesisState defines the gov module's genesis state. */ export interface GenesisStateSDKType { - /** starting_proposal_id is the ID of the starting proposal. */ starting_proposal_id: Long; - - /** deposits defines all the deposits present at genesis. */ deposits: DepositSDKType[]; - - /** votes defines all the votes present at genesis. */ votes: VoteSDKType[]; - - /** proposals defines all the proposals present at genesis. */ proposals: ProposalSDKType[]; - - /** params defines all the paramaters of related to deposit. */ deposit_params?: DepositParamsSDKType; - - /** params defines all the paramaters of related to voting. */ voting_params?: VotingParamsSDKType; - - /** params defines all the paramaters of related to tally. */ tally_params?: TallyParamsSDKType; } diff --git a/__fixtures__/output1/cosmos/gov/v1/gov.ts b/__fixtures__/output1/cosmos/gov/v1/gov.ts index 15a52b2656..1650851df0 100644 --- a/__fixtures__/output1/cosmos/gov/v1/gov.ts +++ b/__fixtures__/output1/cosmos/gov/v1/gov.ts @@ -230,20 +230,12 @@ export interface ProposalSDKType { id: Long; messages: AnySDKType[]; status: ProposalStatus; - - /** - * final_tally_result is the final tally result of the proposal. When - * querying a proposal via gRPC, this field is not populated until the - * proposal's voting period has ended. - */ final_tally_result?: TallyResultSDKType; submit_time?: Date; deposit_end_time?: Date; total_deposit: CoinSDKType[]; voting_start_time?: Date; voting_end_time?: Date; - - /** metadata is any arbitrary metadata attached to the proposal. */ metadata: string; } @@ -284,8 +276,6 @@ export interface VoteSDKType { proposal_id: Long; voter: string; options: WeightedVoteOptionSDKType[]; - - /** metadata is any arbitrary metadata to attached to the vote. */ metadata: string; } @@ -303,13 +293,7 @@ export interface DepositParams { /** DepositParams defines the params for deposits on governance proposals. */ export interface DepositParamsSDKType { - /** Minimum deposit for a proposal to enter voting period. */ min_deposit: CoinSDKType[]; - - /** - * Maximum period for Atom holders to deposit on a proposal. Initial value: 2 - * months. - */ max_deposit_period?: DurationSDKType; } @@ -321,7 +305,6 @@ export interface VotingParams { /** VotingParams defines the params for voting on governance proposals. */ export interface VotingParamsSDKType { - /** Length of the voting period. */ voting_period?: DurationSDKType; } @@ -345,19 +328,8 @@ export interface TallyParams { /** TallyParams defines the params for tallying votes on governance proposals. */ export interface TallyParamsSDKType { - /** - * Minimum percentage of total stake needed to vote for a result to be - * considered valid. - */ quorum: string; - - /** Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. */ threshold: string; - - /** - * Minimum value of Veto votes to Total votes ratio for proposal to be - * vetoed. Default value: 1/3. - */ veto_threshold: string; } diff --git a/__fixtures__/output1/cosmos/gov/v1/query.ts b/__fixtures__/output1/cosmos/gov/v1/query.ts index d206f77578..be27676543 100644 --- a/__fixtures__/output1/cosmos/gov/v1/query.ts +++ b/__fixtures__/output1/cosmos/gov/v1/query.ts @@ -12,7 +12,6 @@ export interface QueryProposalRequest { /** QueryProposalRequest is the request type for the Query/Proposal RPC method. */ export interface QueryProposalRequestSDKType { - /** proposal_id defines the unique id of the proposal. */ proposal_id: Long; } @@ -43,16 +42,9 @@ export interface QueryProposalsRequest { /** QueryProposalsRequest is the request type for the Query/Proposals RPC method. */ export interface QueryProposalsRequestSDKType { - /** proposal_status defines the status of the proposals. */ proposal_status: ProposalStatus; - - /** voter defines the voter address for the proposals. */ voter: string; - - /** depositor defines the deposit addresses from the proposals. */ depositor: string; - - /** pagination defines an optional pagination for the request. */ pagination?: PageRequestSDKType; } @@ -73,8 +65,6 @@ export interface QueryProposalsResponse { */ export interface QueryProposalsResponseSDKType { proposals: ProposalSDKType[]; - - /** pagination defines the pagination in the response. */ pagination?: PageResponseSDKType; } @@ -89,10 +79,7 @@ export interface QueryVoteRequest { /** QueryVoteRequest is the request type for the Query/Vote RPC method. */ export interface QueryVoteRequestSDKType { - /** proposal_id defines the unique id of the proposal. */ proposal_id: Long; - - /** voter defines the oter address for the proposals. */ voter: string; } @@ -104,7 +91,6 @@ export interface QueryVoteResponse { /** QueryVoteResponse is the response type for the Query/Vote RPC method. */ export interface QueryVoteResponseSDKType { - /** vote defined the queried vote. */ vote?: VoteSDKType; } @@ -119,10 +105,7 @@ export interface QueryVotesRequest { /** QueryVotesRequest is the request type for the Query/Votes RPC method. */ export interface QueryVotesRequestSDKType { - /** proposal_id defines the unique id of the proposal. */ proposal_id: Long; - - /** pagination defines an optional pagination for the request. */ pagination?: PageRequestSDKType; } @@ -137,10 +120,7 @@ export interface QueryVotesResponse { /** QueryVotesResponse is the response type for the Query/Votes RPC method. */ export interface QueryVotesResponseSDKType { - /** votes defined the queried votes. */ votes: VoteSDKType[]; - - /** pagination defines the pagination in the response. */ pagination?: PageResponseSDKType; } @@ -155,10 +135,6 @@ export interface QueryParamsRequest { /** QueryParamsRequest is the request type for the Query/Params RPC method. */ export interface QueryParamsRequestSDKType { - /** - * params_type defines which parameters to query for, can be one of "voting", - * "tallying" or "deposit". - */ params_type: string; } @@ -176,13 +152,8 @@ export interface QueryParamsResponse { /** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponseSDKType { - /** voting_params defines the parameters related to voting. */ voting_params?: VotingParamsSDKType; - - /** deposit_params defines the parameters related to deposit. */ deposit_params?: DepositParamsSDKType; - - /** tally_params defines the parameters related to tally. */ tally_params?: TallyParamsSDKType; } @@ -197,10 +168,7 @@ export interface QueryDepositRequest { /** QueryDepositRequest is the request type for the Query/Deposit RPC method. */ export interface QueryDepositRequestSDKType { - /** proposal_id defines the unique id of the proposal. */ proposal_id: Long; - - /** depositor defines the deposit addresses from the proposals. */ depositor: string; } @@ -212,7 +180,6 @@ export interface QueryDepositResponse { /** QueryDepositResponse is the response type for the Query/Deposit RPC method. */ export interface QueryDepositResponseSDKType { - /** deposit defines the requested deposit. */ deposit?: DepositSDKType; } @@ -227,10 +194,7 @@ export interface QueryDepositsRequest { /** QueryDepositsRequest is the request type for the Query/Deposits RPC method. */ export interface QueryDepositsRequestSDKType { - /** proposal_id defines the unique id of the proposal. */ proposal_id: Long; - - /** pagination defines an optional pagination for the request. */ pagination?: PageRequestSDKType; } @@ -245,8 +209,6 @@ export interface QueryDepositsResponse { /** QueryDepositsResponse is the response type for the Query/Deposits RPC method. */ export interface QueryDepositsResponseSDKType { deposits: DepositSDKType[]; - - /** pagination defines the pagination in the response. */ pagination?: PageResponseSDKType; } @@ -258,7 +220,6 @@ export interface QueryTallyResultRequest { /** QueryTallyResultRequest is the request type for the Query/Tally RPC method. */ export interface QueryTallyResultRequestSDKType { - /** proposal_id defines the unique id of the proposal. */ proposal_id: Long; } @@ -270,7 +231,6 @@ export interface QueryTallyResultResponse { /** QueryTallyResultResponse is the response type for the Query/Tally RPC method. */ export interface QueryTallyResultResponseSDKType { - /** tally defines the requested tally. */ tally?: TallyResultSDKType; } diff --git a/__fixtures__/output1/cosmos/gov/v1/tx.ts b/__fixtures__/output1/cosmos/gov/v1/tx.ts index d242742c37..71aea97bc3 100644 --- a/__fixtures__/output1/cosmos/gov/v1/tx.ts +++ b/__fixtures__/output1/cosmos/gov/v1/tx.ts @@ -26,8 +26,6 @@ export interface MsgSubmitProposalSDKType { messages: AnySDKType[]; initial_deposit: CoinSDKType[]; proposer: string; - - /** metadata is any arbitrary metadata attached to the proposal. */ metadata: string; } @@ -58,10 +56,7 @@ export interface MsgExecLegacyContent { * This ensures backwards compatibility with v1beta1.MsgSubmitProposal. */ export interface MsgExecLegacyContentSDKType { - /** content is the proposal's content. */ content?: AnySDKType; - - /** authority must be the gov module address. */ authority: string; } diff --git a/__fixtures__/output1/cosmos/gov/v1beta1/genesis.ts b/__fixtures__/output1/cosmos/gov/v1beta1/genesis.ts index bf9815697b..4e9ef16a8d 100644 --- a/__fixtures__/output1/cosmos/gov/v1beta1/genesis.ts +++ b/__fixtures__/output1/cosmos/gov/v1beta1/genesis.ts @@ -29,25 +29,12 @@ export interface GenesisState { /** GenesisState defines the gov module's genesis state. */ export interface GenesisStateSDKType { - /** starting_proposal_id is the ID of the starting proposal. */ starting_proposal_id: Long; - - /** deposits defines all the deposits present at genesis. */ deposits: DepositSDKType[]; - - /** votes defines all the votes present at genesis. */ votes: VoteSDKType[]; - - /** proposals defines all the proposals present at genesis. */ proposals: ProposalSDKType[]; - - /** params defines all the paramaters of related to deposit. */ deposit_params?: DepositParamsSDKType; - - /** params defines all the paramaters of related to voting. */ voting_params?: VotingParamsSDKType; - - /** params defines all the paramaters of related to tally. */ tally_params?: TallyParamsSDKType; } diff --git a/__fixtures__/output1/cosmos/gov/v1beta1/gov.ts b/__fixtures__/output1/cosmos/gov/v1beta1/gov.ts index 2f4f980bad..000f4eb654 100644 --- a/__fixtures__/output1/cosmos/gov/v1beta1/gov.ts +++ b/__fixtures__/output1/cosmos/gov/v1beta1/gov.ts @@ -253,12 +253,6 @@ export interface ProposalSDKType { proposal_id: Long; content?: AnySDKType; status: ProposalStatus; - - /** - * final_tally_result is the final tally result of the proposal. When - * querying a proposal via gRPC, this field is not populated until the - * proposal's voting period has ended. - */ final_tally_result?: TallyResultSDKType; submit_time?: Date; deposit_end_time?: Date; @@ -312,16 +306,8 @@ export interface VoteSDKType { proposal_id: Long; voter: string; - /** - * Deprecated: Prefer to use `options` instead. This field is set in queries - * if and only if `len(options) == 1` and that option has weight 1. In all - * other cases, this field will default to VOTE_OPTION_UNSPECIFIED. - */ - /** @deprecated */ option: VoteOption; - - /** Since: cosmos-sdk 0.43 */ options: WeightedVoteOptionSDKType[]; } @@ -339,13 +325,7 @@ export interface DepositParams { /** DepositParams defines the params for deposits on governance proposals. */ export interface DepositParamsSDKType { - /** Minimum deposit for a proposal to enter voting period. */ min_deposit: CoinSDKType[]; - - /** - * Maximum period for Atom holders to deposit on a proposal. Initial value: 2 - * months. - */ max_deposit_period?: DurationSDKType; } @@ -357,7 +337,6 @@ export interface VotingParams { /** VotingParams defines the params for voting on governance proposals. */ export interface VotingParamsSDKType { - /** Length of the voting period. */ voting_period?: DurationSDKType; } @@ -381,19 +360,8 @@ export interface TallyParams { /** TallyParams defines the params for tallying votes on governance proposals. */ export interface TallyParamsSDKType { - /** - * Minimum percentage of total stake needed to vote for a result to be - * considered valid. - */ quorum: Uint8Array; - - /** Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. */ threshold: Uint8Array; - - /** - * Minimum value of Veto votes to Total votes ratio for proposal to be - * vetoed. Default value: 1/3. - */ veto_threshold: Uint8Array; } diff --git a/__fixtures__/output1/cosmos/gov/v1beta1/query.ts b/__fixtures__/output1/cosmos/gov/v1beta1/query.ts index 72149ff704..96e92fb202 100644 --- a/__fixtures__/output1/cosmos/gov/v1beta1/query.ts +++ b/__fixtures__/output1/cosmos/gov/v1beta1/query.ts @@ -12,7 +12,6 @@ export interface QueryProposalRequest { /** QueryProposalRequest is the request type for the Query/Proposal RPC method. */ export interface QueryProposalRequestSDKType { - /** proposal_id defines the unique id of the proposal. */ proposal_id: Long; } @@ -43,16 +42,9 @@ export interface QueryProposalsRequest { /** QueryProposalsRequest is the request type for the Query/Proposals RPC method. */ export interface QueryProposalsRequestSDKType { - /** proposal_status defines the status of the proposals. */ proposal_status: ProposalStatus; - - /** voter defines the voter address for the proposals. */ voter: string; - - /** depositor defines the deposit addresses from the proposals. */ depositor: string; - - /** pagination defines an optional pagination for the request. */ pagination?: PageRequestSDKType; } @@ -73,8 +65,6 @@ export interface QueryProposalsResponse { */ export interface QueryProposalsResponseSDKType { proposals: ProposalSDKType[]; - - /** pagination defines the pagination in the response. */ pagination?: PageResponseSDKType; } @@ -89,10 +79,7 @@ export interface QueryVoteRequest { /** QueryVoteRequest is the request type for the Query/Vote RPC method. */ export interface QueryVoteRequestSDKType { - /** proposal_id defines the unique id of the proposal. */ proposal_id: Long; - - /** voter defines the oter address for the proposals. */ voter: string; } @@ -104,7 +91,6 @@ export interface QueryVoteResponse { /** QueryVoteResponse is the response type for the Query/Vote RPC method. */ export interface QueryVoteResponseSDKType { - /** vote defined the queried vote. */ vote?: VoteSDKType; } @@ -119,10 +105,7 @@ export interface QueryVotesRequest { /** QueryVotesRequest is the request type for the Query/Votes RPC method. */ export interface QueryVotesRequestSDKType { - /** proposal_id defines the unique id of the proposal. */ proposal_id: Long; - - /** pagination defines an optional pagination for the request. */ pagination?: PageRequestSDKType; } @@ -137,10 +120,7 @@ export interface QueryVotesResponse { /** QueryVotesResponse is the response type for the Query/Votes RPC method. */ export interface QueryVotesResponseSDKType { - /** votes defined the queried votes. */ votes: VoteSDKType[]; - - /** pagination defines the pagination in the response. */ pagination?: PageResponseSDKType; } @@ -155,10 +135,6 @@ export interface QueryParamsRequest { /** QueryParamsRequest is the request type for the Query/Params RPC method. */ export interface QueryParamsRequestSDKType { - /** - * params_type defines which parameters to query for, can be one of "voting", - * "tallying" or "deposit". - */ params_type: string; } @@ -176,13 +152,8 @@ export interface QueryParamsResponse { /** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponseSDKType { - /** voting_params defines the parameters related to voting. */ voting_params?: VotingParamsSDKType; - - /** deposit_params defines the parameters related to deposit. */ deposit_params?: DepositParamsSDKType; - - /** tally_params defines the parameters related to tally. */ tally_params?: TallyParamsSDKType; } @@ -197,10 +168,7 @@ export interface QueryDepositRequest { /** QueryDepositRequest is the request type for the Query/Deposit RPC method. */ export interface QueryDepositRequestSDKType { - /** proposal_id defines the unique id of the proposal. */ proposal_id: Long; - - /** depositor defines the deposit addresses from the proposals. */ depositor: string; } @@ -212,7 +180,6 @@ export interface QueryDepositResponse { /** QueryDepositResponse is the response type for the Query/Deposit RPC method. */ export interface QueryDepositResponseSDKType { - /** deposit defines the requested deposit. */ deposit?: DepositSDKType; } @@ -227,10 +194,7 @@ export interface QueryDepositsRequest { /** QueryDepositsRequest is the request type for the Query/Deposits RPC method. */ export interface QueryDepositsRequestSDKType { - /** proposal_id defines the unique id of the proposal. */ proposal_id: Long; - - /** pagination defines an optional pagination for the request. */ pagination?: PageRequestSDKType; } @@ -245,8 +209,6 @@ export interface QueryDepositsResponse { /** QueryDepositsResponse is the response type for the Query/Deposits RPC method. */ export interface QueryDepositsResponseSDKType { deposits: DepositSDKType[]; - - /** pagination defines the pagination in the response. */ pagination?: PageResponseSDKType; } @@ -258,7 +220,6 @@ export interface QueryTallyResultRequest { /** QueryTallyResultRequest is the request type for the Query/Tally RPC method. */ export interface QueryTallyResultRequestSDKType { - /** proposal_id defines the unique id of the proposal. */ proposal_id: Long; } @@ -270,7 +231,6 @@ export interface QueryTallyResultResponse { /** QueryTallyResultResponse is the response type for the Query/Tally RPC method. */ export interface QueryTallyResultResponseSDKType { - /** tally defines the requested tally. */ tally?: TallyResultSDKType; } diff --git a/__fixtures__/output1/cosmos/group/v1/events.ts b/__fixtures__/output1/cosmos/group/v1/events.ts index ab18cb7785..bd7204e29f 100644 --- a/__fixtures__/output1/cosmos/group/v1/events.ts +++ b/__fixtures__/output1/cosmos/group/v1/events.ts @@ -11,7 +11,6 @@ export interface EventCreateGroup { /** EventCreateGroup is an event emitted when a group is created. */ export interface EventCreateGroupSDKType { - /** group_id is the unique ID of the group. */ group_id: Long; } @@ -23,7 +22,6 @@ export interface EventUpdateGroup { /** EventUpdateGroup is an event emitted when a group is updated. */ export interface EventUpdateGroupSDKType { - /** group_id is the unique ID of the group. */ group_id: Long; } @@ -35,7 +33,6 @@ export interface EventCreateGroupPolicy { /** EventCreateGroupPolicy is an event emitted when a group policy is created. */ export interface EventCreateGroupPolicySDKType { - /** address is the account address of the group policy. */ address: string; } @@ -47,7 +44,6 @@ export interface EventUpdateGroupPolicy { /** EventUpdateGroupPolicy is an event emitted when a group policy is updated. */ export interface EventUpdateGroupPolicySDKType { - /** address is the account address of the group policy. */ address: string; } @@ -59,7 +55,6 @@ export interface EventSubmitProposal { /** EventSubmitProposal is an event emitted when a proposal is created. */ export interface EventSubmitProposalSDKType { - /** proposal_id is the unique ID of the proposal. */ proposal_id: Long; } @@ -71,7 +66,6 @@ export interface EventWithdrawProposal { /** EventWithdrawProposal is an event emitted when a proposal is withdrawn. */ export interface EventWithdrawProposalSDKType { - /** proposal_id is the unique ID of the proposal. */ proposal_id: Long; } @@ -83,7 +77,6 @@ export interface EventVote { /** EventVote is an event emitted when a voter votes on a proposal. */ export interface EventVoteSDKType { - /** proposal_id is the unique ID of the proposal. */ proposal_id: Long; } @@ -98,10 +91,7 @@ export interface EventExec { /** EventExec is an event emitted when a proposal is executed. */ export interface EventExecSDKType { - /** proposal_id is the unique ID of the proposal. */ proposal_id: Long; - - /** result is the proposal execution result. */ result: ProposalExecutorResult; } @@ -116,10 +106,7 @@ export interface EventLeaveGroup { /** EventLeaveGroup is an event emitted when group member leaves the group. */ export interface EventLeaveGroupSDKType { - /** group_id is the unique ID of the group. */ group_id: Long; - - /** address is the account address of the group member. */ address: string; } diff --git a/__fixtures__/output1/cosmos/group/v1/genesis.ts b/__fixtures__/output1/cosmos/group/v1/genesis.ts index 6eba008ff0..2341ceb50e 100644 --- a/__fixtures__/output1/cosmos/group/v1/genesis.ts +++ b/__fixtures__/output1/cosmos/group/v1/genesis.ts @@ -41,37 +41,13 @@ export interface GenesisState { /** GenesisState defines the group module's genesis state. */ export interface GenesisStateSDKType { - /** - * group_seq is the group table orm.Sequence, - * it is used to get the next group ID. - */ group_seq: Long; - - /** groups is the list of groups info. */ groups: GroupInfoSDKType[]; - - /** group_members is the list of groups members. */ group_members: GroupMemberSDKType[]; - - /** - * group_policy_seq is the group policy table orm.Sequence, - * it is used to generate the next group policy account address. - */ group_policy_seq: Long; - - /** group_policies is the list of group policies info. */ group_policies: GroupPolicyInfoSDKType[]; - - /** - * proposal_seq is the proposal table orm.Sequence, - * it is used to get the next proposal ID. - */ proposal_seq: Long; - - /** proposals is the list of proposals. */ proposals: ProposalSDKType[]; - - /** votes is the list of votes. */ votes: VoteSDKType[]; } diff --git a/__fixtures__/output1/cosmos/group/v1/query.ts b/__fixtures__/output1/cosmos/group/v1/query.ts index 8eaf94cb23..620c28fa7d 100644 --- a/__fixtures__/output1/cosmos/group/v1/query.ts +++ b/__fixtures__/output1/cosmos/group/v1/query.ts @@ -12,7 +12,6 @@ export interface QueryGroupInfoRequest { /** QueryGroupInfoRequest is the Query/GroupInfo request type. */ export interface QueryGroupInfoRequestSDKType { - /** group_id is the unique ID of the group. */ group_id: Long; } @@ -24,7 +23,6 @@ export interface QueryGroupInfoResponse { /** QueryGroupInfoResponse is the Query/GroupInfo response type. */ export interface QueryGroupInfoResponseSDKType { - /** info is the GroupInfo for the group. */ info?: GroupInfoSDKType; } @@ -36,7 +34,6 @@ export interface QueryGroupPolicyInfoRequest { /** QueryGroupPolicyInfoRequest is the Query/GroupPolicyInfo request type. */ export interface QueryGroupPolicyInfoRequestSDKType { - /** address is the account address of the group policy. */ address: string; } @@ -48,7 +45,6 @@ export interface QueryGroupPolicyInfoResponse { /** QueryGroupPolicyInfoResponse is the Query/GroupPolicyInfo response type. */ export interface QueryGroupPolicyInfoResponseSDKType { - /** info is the GroupPolicyInfo for the group policy. */ info?: GroupPolicyInfoSDKType; } @@ -63,10 +59,7 @@ export interface QueryGroupMembersRequest { /** QueryGroupMembersRequest is the Query/GroupMembers request type. */ export interface QueryGroupMembersRequestSDKType { - /** group_id is the unique ID of the group. */ group_id: Long; - - /** pagination defines an optional pagination for the request. */ pagination?: PageRequestSDKType; } @@ -81,10 +74,7 @@ export interface QueryGroupMembersResponse { /** QueryGroupMembersResponse is the Query/GroupMembersResponse response type. */ export interface QueryGroupMembersResponseSDKType { - /** members are the members of the group with given group_id. */ members: GroupMemberSDKType[]; - - /** pagination defines the pagination in the response. */ pagination?: PageResponseSDKType; } @@ -99,10 +89,7 @@ export interface QueryGroupsByAdminRequest { /** QueryGroupsByAdminRequest is the Query/GroupsByAdmin request type. */ export interface QueryGroupsByAdminRequestSDKType { - /** admin is the account address of a group's admin. */ admin: string; - - /** pagination defines an optional pagination for the request. */ pagination?: PageRequestSDKType; } @@ -117,10 +104,7 @@ export interface QueryGroupsByAdminResponse { /** QueryGroupsByAdminResponse is the Query/GroupsByAdminResponse response type. */ export interface QueryGroupsByAdminResponseSDKType { - /** groups are the groups info with the provided admin. */ groups: GroupInfoSDKType[]; - - /** pagination defines the pagination in the response. */ pagination?: PageResponseSDKType; } @@ -135,10 +119,7 @@ export interface QueryGroupPoliciesByGroupRequest { /** QueryGroupPoliciesByGroupRequest is the Query/GroupPoliciesByGroup request type. */ export interface QueryGroupPoliciesByGroupRequestSDKType { - /** group_id is the unique ID of the group policy's group. */ group_id: Long; - - /** pagination defines an optional pagination for the request. */ pagination?: PageRequestSDKType; } @@ -153,10 +134,7 @@ export interface QueryGroupPoliciesByGroupResponse { /** QueryGroupPoliciesByGroupResponse is the Query/GroupPoliciesByGroup response type. */ export interface QueryGroupPoliciesByGroupResponseSDKType { - /** group_policies are the group policies info associated with the provided group. */ group_policies: GroupPolicyInfoSDKType[]; - - /** pagination defines the pagination in the response. */ pagination?: PageResponseSDKType; } @@ -171,10 +149,7 @@ export interface QueryGroupPoliciesByAdminRequest { /** QueryGroupPoliciesByAdminRequest is the Query/GroupPoliciesByAdmin request type. */ export interface QueryGroupPoliciesByAdminRequestSDKType { - /** admin is the admin address of the group policy. */ admin: string; - - /** pagination defines an optional pagination for the request. */ pagination?: PageRequestSDKType; } @@ -189,10 +164,7 @@ export interface QueryGroupPoliciesByAdminResponse { /** QueryGroupPoliciesByAdminResponse is the Query/GroupPoliciesByAdmin response type. */ export interface QueryGroupPoliciesByAdminResponseSDKType { - /** group_policies are the group policies info with provided admin. */ group_policies: GroupPolicyInfoSDKType[]; - - /** pagination defines the pagination in the response. */ pagination?: PageResponseSDKType; } @@ -204,7 +176,6 @@ export interface QueryProposalRequest { /** QueryProposalRequest is the Query/Proposal request type. */ export interface QueryProposalRequestSDKType { - /** proposal_id is the unique ID of a proposal. */ proposal_id: Long; } @@ -216,7 +187,6 @@ export interface QueryProposalResponse { /** QueryProposalResponse is the Query/Proposal response type. */ export interface QueryProposalResponseSDKType { - /** proposal is the proposal info. */ proposal?: ProposalSDKType; } @@ -231,10 +201,7 @@ export interface QueryProposalsByGroupPolicyRequest { /** QueryProposalsByGroupPolicyRequest is the Query/ProposalByGroupPolicy request type. */ export interface QueryProposalsByGroupPolicyRequestSDKType { - /** address is the account address of the group policy related to proposals. */ address: string; - - /** pagination defines an optional pagination for the request. */ pagination?: PageRequestSDKType; } @@ -249,10 +216,7 @@ export interface QueryProposalsByGroupPolicyResponse { /** QueryProposalsByGroupPolicyResponse is the Query/ProposalByGroupPolicy response type. */ export interface QueryProposalsByGroupPolicyResponseSDKType { - /** proposals are the proposals with given group policy. */ proposals: ProposalSDKType[]; - - /** pagination defines the pagination in the response. */ pagination?: PageResponseSDKType; } @@ -267,10 +231,7 @@ export interface QueryVoteByProposalVoterRequest { /** QueryVoteByProposalVoterRequest is the Query/VoteByProposalVoter request type. */ export interface QueryVoteByProposalVoterRequestSDKType { - /** proposal_id is the unique ID of a proposal. */ proposal_id: Long; - - /** voter is a proposal voter account address. */ voter: string; } @@ -282,7 +243,6 @@ export interface QueryVoteByProposalVoterResponse { /** QueryVoteByProposalVoterResponse is the Query/VoteByProposalVoter response type. */ export interface QueryVoteByProposalVoterResponseSDKType { - /** vote is the vote with given proposal_id and voter. */ vote?: VoteSDKType; } @@ -297,10 +257,7 @@ export interface QueryVotesByProposalRequest { /** QueryVotesByProposalRequest is the Query/VotesByProposal request type. */ export interface QueryVotesByProposalRequestSDKType { - /** proposal_id is the unique ID of a proposal. */ proposal_id: Long; - - /** pagination defines an optional pagination for the request. */ pagination?: PageRequestSDKType; } @@ -315,10 +272,7 @@ export interface QueryVotesByProposalResponse { /** QueryVotesByProposalResponse is the Query/VotesByProposal response type. */ export interface QueryVotesByProposalResponseSDKType { - /** votes are the list of votes for given proposal_id. */ votes: VoteSDKType[]; - - /** pagination defines the pagination in the response. */ pagination?: PageResponseSDKType; } @@ -333,10 +287,7 @@ export interface QueryVotesByVoterRequest { /** QueryVotesByVoterRequest is the Query/VotesByVoter request type. */ export interface QueryVotesByVoterRequestSDKType { - /** voter is a proposal voter account address. */ voter: string; - - /** pagination defines an optional pagination for the request. */ pagination?: PageRequestSDKType; } @@ -351,10 +302,7 @@ export interface QueryVotesByVoterResponse { /** QueryVotesByVoterResponse is the Query/VotesByVoter response type. */ export interface QueryVotesByVoterResponseSDKType { - /** votes are the list of votes by given voter. */ votes: VoteSDKType[]; - - /** pagination defines the pagination in the response. */ pagination?: PageResponseSDKType; } @@ -369,10 +317,7 @@ export interface QueryGroupsByMemberRequest { /** QueryGroupsByMemberRequest is the Query/GroupsByMember request type. */ export interface QueryGroupsByMemberRequestSDKType { - /** address is the group member address. */ address: string; - - /** pagination defines an optional pagination for the request. */ pagination?: PageRequestSDKType; } @@ -387,10 +332,7 @@ export interface QueryGroupsByMemberResponse { /** QueryGroupsByMemberResponse is the Query/GroupsByMember response type. */ export interface QueryGroupsByMemberResponseSDKType { - /** groups are the groups info with the provided group member. */ groups: GroupInfoSDKType[]; - - /** pagination defines the pagination in the response. */ pagination?: PageResponseSDKType; } @@ -402,7 +344,6 @@ export interface QueryTallyResultRequest { /** QueryTallyResultRequest is the Query/TallyResult request type. */ export interface QueryTallyResultRequestSDKType { - /** proposal_id is the unique id of a proposal. */ proposal_id: Long; } @@ -414,7 +355,6 @@ export interface QueryTallyResultResponse { /** QueryTallyResultResponse is the Query/TallyResult response type. */ export interface QueryTallyResultResponseSDKType { - /** tally defines the requested tally. */ tally?: TallyResultSDKType; } diff --git a/__fixtures__/output1/cosmos/group/v1/tx.ts b/__fixtures__/output1/cosmos/group/v1/tx.ts index 355b98daed..8d66c52c61 100644 --- a/__fixtures__/output1/cosmos/group/v1/tx.ts +++ b/__fixtures__/output1/cosmos/group/v1/tx.ts @@ -66,13 +66,8 @@ export interface MsgCreateGroup { /** MsgCreateGroup is the Msg/CreateGroup request type. */ export interface MsgCreateGroupSDKType { - /** admin is the account address of the group admin. */ admin: string; - - /** members defines the group members. */ members: MemberSDKType[]; - - /** metadata is any arbitrary metadata to attached to the group. */ metadata: string; } @@ -84,7 +79,6 @@ export interface MsgCreateGroupResponse { /** MsgCreateGroupResponse is the Msg/CreateGroup response type. */ export interface MsgCreateGroupResponseSDKType { - /** group_id is the unique ID of the newly created group. */ group_id: Long; } @@ -105,16 +99,8 @@ export interface MsgUpdateGroupMembers { /** MsgUpdateGroupMembers is the Msg/UpdateGroupMembers request type. */ export interface MsgUpdateGroupMembersSDKType { - /** admin is the account address of the group admin. */ admin: string; - - /** group_id is the unique ID of the group. */ group_id: Long; - - /** - * member_updates is the list of members to update, - * set weight to 0 to remove a member. - */ member_updates: MemberSDKType[]; } @@ -138,13 +124,8 @@ export interface MsgUpdateGroupAdmin { /** MsgUpdateGroupAdmin is the Msg/UpdateGroupAdmin request type. */ export interface MsgUpdateGroupAdminSDKType { - /** admin is the current account address of the group admin. */ admin: string; - - /** group_id is the unique ID of the group. */ group_id: Long; - - /** new_admin is the group new admin account address. */ new_admin: string; } @@ -168,13 +149,8 @@ export interface MsgUpdateGroupMetadata { /** MsgUpdateGroupMetadata is the Msg/UpdateGroupMetadata request type. */ export interface MsgUpdateGroupMetadataSDKType { - /** admin is the account address of the group admin. */ admin: string; - - /** group_id is the unique ID of the group. */ group_id: Long; - - /** metadata is the updated group's metadata. */ metadata: string; } @@ -201,16 +177,9 @@ export interface MsgCreateGroupPolicy { /** MsgCreateGroupPolicy is the Msg/CreateGroupPolicy request type. */ export interface MsgCreateGroupPolicySDKType { - /** admin is the account address of the group admin. */ admin: string; - - /** group_id is the unique ID of the group. */ group_id: Long; - - /** metadata is any arbitrary metadata attached to the group policy. */ metadata: string; - - /** decision_policy specifies the group policy's decision policy. */ decision_policy?: AnySDKType; } @@ -222,7 +191,6 @@ export interface MsgCreateGroupPolicyResponse { /** MsgCreateGroupPolicyResponse is the Msg/CreateGroupPolicy response type. */ export interface MsgCreateGroupPolicyResponseSDKType { - /** address is the account address of the newly created group policy. */ address: string; } @@ -240,13 +208,8 @@ export interface MsgUpdateGroupPolicyAdmin { /** MsgUpdateGroupPolicyAdmin is the Msg/UpdateGroupPolicyAdmin request type. */ export interface MsgUpdateGroupPolicyAdminSDKType { - /** admin is the account address of the group admin. */ admin: string; - - /** address is the account address of the group policy. */ address: string; - - /** new_admin is the new group policy admin. */ new_admin: string; } @@ -273,22 +236,11 @@ export interface MsgCreateGroupWithPolicy { /** MsgCreateGroupWithPolicy is the Msg/CreateGroupWithPolicy request type. */ export interface MsgCreateGroupWithPolicySDKType { - /** admin is the account address of the group and group policy admin. */ admin: string; - - /** members defines the group members. */ members: MemberSDKType[]; - - /** group_metadata is any arbitrary metadata attached to the group. */ group_metadata: string; - - /** group_policy_metadata is any arbitrary metadata attached to the group policy. */ group_policy_metadata: string; - - /** group_policy_as_admin is a boolean field, if set to true, the group policy account address will be used as group and group policy admin. */ group_policy_as_admin: boolean; - - /** decision_policy specifies the group policy's decision policy. */ decision_policy?: AnySDKType; } @@ -303,10 +255,7 @@ export interface MsgCreateGroupWithPolicyResponse { /** MsgCreateGroupWithPolicyResponse is the Msg/CreateGroupWithPolicy response type. */ export interface MsgCreateGroupWithPolicyResponseSDKType { - /** group_id is the unique ID of the newly created group with policy. */ group_id: Long; - - /** group_policy_address is the account address of the newly created group policy. */ group_policy_address: string; } @@ -330,13 +279,8 @@ export interface MsgUpdateGroupPolicyDecisionPolicy { /** MsgUpdateGroupPolicyDecisionPolicy is the Msg/UpdateGroupPolicyDecisionPolicy request type. */ export interface MsgUpdateGroupPolicyDecisionPolicySDKType { - /** admin is the account address of the group admin. */ admin: string; - - /** address is the account address of group policy. */ address: string; - - /** decision_policy is the updated group policy's decision policy. */ decision_policy?: AnySDKType; } @@ -360,13 +304,8 @@ export interface MsgUpdateGroupPolicyMetadata { /** MsgUpdateGroupPolicyMetadata is the Msg/UpdateGroupPolicyMetadata request type. */ export interface MsgUpdateGroupPolicyMetadataSDKType { - /** admin is the account address of the group admin. */ admin: string; - - /** address is the account address of group policy. */ address: string; - - /** metadata is the updated group policy metadata. */ metadata: string; } @@ -403,26 +342,10 @@ export interface MsgSubmitProposal { /** MsgSubmitProposal is the Msg/SubmitProposal request type. */ export interface MsgSubmitProposalSDKType { - /** address is the account address of group policy. */ address: string; - - /** - * proposers are the account addresses of the proposers. - * Proposers signatures will be counted as yes votes. - */ proposers: string[]; - - /** metadata is any arbitrary metadata to attached to the proposal. */ metadata: string; - - /** messages is a list of `sdk.Msg`s that will be executed if the proposal passes. */ messages: AnySDKType[]; - - /** - * exec defines the mode of execution of the proposal, - * whether it should be executed immediately on creation or not. - * If so, proposers signatures are considered as Yes votes. - */ exec: Exec; } @@ -434,7 +357,6 @@ export interface MsgSubmitProposalResponse { /** MsgSubmitProposalResponse is the Msg/SubmitProposal response type. */ export interface MsgSubmitProposalResponseSDKType { - /** proposal is the unique ID of the proposal. */ proposal_id: Long; } @@ -449,10 +371,7 @@ export interface MsgWithdrawProposal { /** MsgWithdrawProposal is the Msg/WithdrawProposal request type. */ export interface MsgWithdrawProposalSDKType { - /** proposal is the unique ID of the proposal. */ proposal_id: Long; - - /** address is the admin of the group policy or one of the proposer of the proposal. */ address: string; } @@ -485,22 +404,10 @@ export interface MsgVote { /** MsgVote is the Msg/Vote request type. */ export interface MsgVoteSDKType { - /** proposal is the unique ID of the proposal. */ proposal_id: Long; - - /** voter is the voter account address. */ voter: string; - - /** option is the voter's choice on the proposal. */ option: VoteOption; - - /** metadata is any arbitrary metadata to attached to the vote. */ metadata: string; - - /** - * exec defines whether the proposal should be executed - * immediately after voting or not. - */ exec: Exec; } @@ -521,10 +428,7 @@ export interface MsgExec { /** MsgExec is the Msg/Exec request type. */ export interface MsgExecSDKType { - /** proposal is the unique ID of the proposal. */ proposal_id: Long; - - /** signer is the account address used to execute the proposal. */ signer: string; } @@ -545,10 +449,7 @@ export interface MsgLeaveGroup { /** MsgLeaveGroup is the Msg/LeaveGroup request type. */ export interface MsgLeaveGroupSDKType { - /** address is the account address of the group member. */ address: string; - - /** group_id is the unique ID of the group. */ group_id: Long; } diff --git a/__fixtures__/output1/cosmos/group/v1/types.ts b/__fixtures__/output1/cosmos/group/v1/types.ts index 46e1aae12d..beda59a61f 100644 --- a/__fixtures__/output1/cosmos/group/v1/types.ts +++ b/__fixtures__/output1/cosmos/group/v1/types.ts @@ -291,16 +291,9 @@ export interface Member { * non-zero weight and metadata. */ export interface MemberSDKType { - /** address is the member's account address. */ address: string; - - /** weight is the member's voting weight that should be greater than 0. */ weight: string; - - /** metadata is any arbitrary metadata to attached to the member. */ metadata: string; - - /** added_at is a timestamp specifying when a member was added. */ added_at?: Date; } @@ -312,7 +305,6 @@ export interface Members { /** Members defines a repeated slice of Member objects. */ export interface MembersSDKType { - /** members is the list of members. */ members: MemberSDKType[]; } @@ -327,10 +319,7 @@ export interface ThresholdDecisionPolicy { /** ThresholdDecisionPolicy implements the DecisionPolicy interface */ export interface ThresholdDecisionPolicySDKType { - /** threshold is the minimum weighted sum of yes votes that must be met or exceeded for a proposal to succeed. */ threshold: string; - - /** windows defines the different windows for voting and execution. */ windows?: DecisionPolicyWindowsSDKType; } @@ -345,10 +334,7 @@ export interface PercentageDecisionPolicy { /** PercentageDecisionPolicy implements the DecisionPolicy interface */ export interface PercentageDecisionPolicySDKType { - /** percentage is the minimum percentage the weighted sum of yes votes must meet for a proposal to succeed. */ percentage: string; - - /** windows defines the different windows for voting and execution. */ windows?: DecisionPolicyWindowsSDKType; } @@ -378,25 +364,7 @@ export interface DecisionPolicyWindows { /** DecisionPolicyWindows defines the different windows for voting and execution. */ export interface DecisionPolicyWindowsSDKType { - /** - * voting_period is the duration from submission of a proposal to the end of voting period - * Within this times votes can be submitted with MsgVote. - */ voting_period?: DurationSDKType; - - /** - * min_execution_period is the minimum duration after the proposal submission - * where members can start sending MsgExec. This means that the window for - * sending a MsgExec transaction is: - * `[ submission + min_execution_period ; submission + voting_period + max_execution_period]` - * where max_execution_period is a app-specific config, defined in the keeper. - * If not set, min_execution_period will default to 0. - * - * Please make sure to set a `min_execution_period` that is smaller than - * `voting_period + max_execution_period`, or else the above execution window - * is empty, meaning that all proposals created with this decision policy - * won't be able to be executed. - */ min_execution_period?: DurationSDKType; } @@ -428,27 +396,11 @@ export interface GroupInfo { /** GroupInfo represents the high-level on-chain information for a group. */ export interface GroupInfoSDKType { - /** id is the unique ID of the group. */ id: Long; - - /** admin is the account address of the group's admin. */ admin: string; - - /** metadata is any arbitrary metadata to attached to the group. */ metadata: string; - - /** - * version is used to track changes to a group's membership structure that - * would break existing proposals. Whenever any members weight is changed, - * or any member is added or removed this version is incremented and will - * cause proposals based on older versions of this group to fail - */ version: Long; - - /** total_weight is the sum of the group members' weights. */ total_weight: string; - - /** created_at is a timestamp specifying when a group was created. */ created_at?: Date; } @@ -463,10 +415,7 @@ export interface GroupMember { /** GroupMember represents the relationship between a group and a member. */ export interface GroupMemberSDKType { - /** group_id is the unique ID of the group. */ group_id: Long; - - /** member is the member data. */ member?: MemberSDKType; } @@ -499,28 +448,12 @@ export interface GroupPolicyInfo { /** GroupPolicyInfo represents the high-level on-chain information for a group policy. */ export interface GroupPolicyInfoSDKType { - /** address is the account address of group policy. */ address: string; - - /** group_id is the unique ID of the group. */ group_id: Long; - - /** admin is the account address of the group admin. */ admin: string; - - /** metadata is any arbitrary metadata to attached to the group policy. */ metadata: string; - - /** - * version is used to track changes to a group's GroupPolicyInfo structure that - * would create a different result on a running proposal. - */ version: Long; - - /** decision_policy specifies the group policy's decision policy. */ decision_policy?: AnySDKType; - - /** created_at is a timestamp specifying when a group policy was created. */ created_at?: Date; } @@ -598,63 +531,18 @@ export interface Proposal { * passes as well as some optional metadata associated with the proposal. */ export interface ProposalSDKType { - /** id is the unique id of the proposal. */ id: Long; - - /** address is the account address of group policy. */ address: string; - - /** metadata is any arbitrary metadata to attached to the proposal. */ metadata: string; - - /** proposers are the account addresses of the proposers. */ proposers: string[]; - - /** submit_time is a timestamp specifying when a proposal was submitted. */ submit_time?: Date; - - /** - * group_version tracks the version of the group that this proposal corresponds to. - * When group membership is changed, existing proposals from previous group versions will become invalid. - */ group_version: Long; - - /** - * group_policy_version tracks the version of the group policy that this proposal corresponds to. - * When a decision policy is changed, existing proposals from previous policy versions will become invalid. - */ group_policy_version: Long; - - /** status represents the high level position in the life cycle of the proposal. Initial value is Submitted. */ status: ProposalStatus; - - /** - * result is the final result based on the votes and election rule. Initial value is unfinalized. - * The result is persisted so that clients can always rely on this state and not have to replicate the logic. - */ result: ProposalResult; - - /** - * final_tally_result contains the sums of all weighted votes for this - * proposal for each vote option, after tallying. When querying a proposal - * via gRPC, this field is not populated until the proposal's voting period - * has ended. - */ final_tally_result?: TallyResultSDKType; - - /** - * voting_period_end is the timestamp before which voting must be done. - * Unless a successfull MsgExec is called before (to execute a proposal whose - * tally is successful before the voting period ends), tallying will be done - * at this point, and the `final_tally_result`, as well - * as `status` and `result` fields will be accordingly updated. - */ voting_period_end?: Date; - - /** executor_result is the final result based on the votes and election rule. Initial value is NotRun. */ executor_result: ProposalExecutorResult; - - /** messages is a list of Msgs that will be executed if the proposal passes. */ messages: AnySDKType[]; } @@ -675,16 +563,9 @@ export interface TallyResult { /** TallyResult represents the sum of weighted votes for each vote option. */ export interface TallyResultSDKType { - /** yes_count is the weighted sum of yes votes. */ yes_count: string; - - /** abstain_count is the weighted sum of abstainers. */ abstain_count: string; - - /** no is the weighted sum of no votes. */ no_count: string; - - /** no_with_veto_count is the weighted sum of veto. */ no_with_veto_count: string; } @@ -708,19 +589,10 @@ export interface Vote { /** Vote represents a vote for a proposal. */ export interface VoteSDKType { - /** proposal is the unique ID of the proposal. */ proposal_id: Long; - - /** voter is the account address of the voter. */ voter: string; - - /** option is the voter's choice on the proposal. */ option: VoteOption; - - /** metadata is any arbitrary metadata to attached to the vote. */ metadata: string; - - /** submit_time is the timestamp when the vote was submitted. */ submit_time?: Date; } diff --git a/__fixtures__/output1/cosmos/mint/v1beta1/genesis.ts b/__fixtures__/output1/cosmos/mint/v1beta1/genesis.ts index 3851b33f4d..4ed7c19ffa 100644 --- a/__fixtures__/output1/cosmos/mint/v1beta1/genesis.ts +++ b/__fixtures__/output1/cosmos/mint/v1beta1/genesis.ts @@ -14,10 +14,7 @@ export interface GenesisState { /** GenesisState defines the mint module's genesis state. */ export interface GenesisStateSDKType { - /** minter is a space for holding current inflation information. */ minter?: MinterSDKType; - - /** params defines all the paramaters of the module. */ params?: ParamsSDKType; } diff --git a/__fixtures__/output1/cosmos/mint/v1beta1/mint.ts b/__fixtures__/output1/cosmos/mint/v1beta1/mint.ts index 3df5928cc1..7146c5d9be 100644 --- a/__fixtures__/output1/cosmos/mint/v1beta1/mint.ts +++ b/__fixtures__/output1/cosmos/mint/v1beta1/mint.ts @@ -13,10 +13,7 @@ export interface Minter { /** Minter represents the minting state. */ export interface MinterSDKType { - /** current annual inflation rate */ inflation: string; - - /** current annual expected provisions */ annual_provisions: string; } @@ -43,22 +40,11 @@ export interface Params { /** Params holds parameters for the mint module. */ export interface ParamsSDKType { - /** type of coin to mint */ mint_denom: string; - - /** maximum annual change in inflation rate */ inflation_rate_change: string; - - /** maximum inflation rate */ inflation_max: string; - - /** minimum inflation rate */ inflation_min: string; - - /** goal of percent bonded atoms */ goal_bonded: string; - - /** expected blocks per year */ blocks_per_year: Long; } diff --git a/__fixtures__/output1/cosmos/mint/v1beta1/query.ts b/__fixtures__/output1/cosmos/mint/v1beta1/query.ts index f743b78a2b..19589e59e9 100644 --- a/__fixtures__/output1/cosmos/mint/v1beta1/query.ts +++ b/__fixtures__/output1/cosmos/mint/v1beta1/query.ts @@ -17,7 +17,6 @@ export interface QueryParamsResponse { /** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponseSDKType { - /** params defines the parameters of the module. */ params?: ParamsSDKType; } @@ -41,7 +40,6 @@ export interface QueryInflationResponse { * method. */ export interface QueryInflationResponseSDKType { - /** inflation is the current minting inflation value. */ inflation: Uint8Array; } @@ -71,7 +69,6 @@ export interface QueryAnnualProvisionsResponse { * Query/AnnualProvisions RPC method. */ export interface QueryAnnualProvisionsResponseSDKType { - /** annual_provisions is the current minting annual provisions value. */ annual_provisions: Uint8Array; } diff --git a/__fixtures__/output1/cosmos/nft/v1beta1/genesis.ts b/__fixtures__/output1/cosmos/nft/v1beta1/genesis.ts index 2476a4cd2b..5b8363fa24 100644 --- a/__fixtures__/output1/cosmos/nft/v1beta1/genesis.ts +++ b/__fixtures__/output1/cosmos/nft/v1beta1/genesis.ts @@ -12,7 +12,6 @@ export interface GenesisState { /** GenesisState defines the nft module's genesis state. */ export interface GenesisStateSDKType { - /** class defines the class of the nft type. */ classes: ClassSDKType[]; entries: EntrySDKType[]; } @@ -28,10 +27,7 @@ export interface Entry { /** Entry Defines all nft owned by a person */ export interface EntrySDKType { - /** owner is the owner address of the following nft */ owner: string; - - /** nfts is a group of nfts of the same owner */ nfts: NFTSDKType[]; } diff --git a/__fixtures__/output1/cosmos/nft/v1beta1/nft.ts b/__fixtures__/output1/cosmos/nft/v1beta1/nft.ts index ae7576128d..c9b0ff5154 100644 --- a/__fixtures__/output1/cosmos/nft/v1beta1/nft.ts +++ b/__fixtures__/output1/cosmos/nft/v1beta1/nft.ts @@ -29,25 +29,12 @@ export interface Class { /** Class defines the class of the nft type. */ export interface ClassSDKType { - /** id defines the unique identifier of the NFT classification, similar to the contract address of ERC721 */ id: string; - - /** name defines the human-readable name of the NFT classification. Optional */ name: string; - - /** symbol is an abbreviated name for nft classification. Optional */ symbol: string; - - /** description is a brief description of nft classification. Optional */ description: string; - - /** uri for the class metadata stored off chain. It can define schema for Class and NFT `Data` attributes. Optional */ uri: string; - - /** uri_hash is a hash of the document pointed by uri. Optional */ uri_hash: string; - - /** data is the app specific metadata of the NFT class. Optional */ data?: AnySDKType; } @@ -71,19 +58,10 @@ export interface NFT { /** NFT defines the NFT. */ export interface NFTSDKType { - /** class_id associated with the NFT, similar to the contract address of ERC721 */ class_id: string; - - /** id is a unique identifier of the NFT */ id: string; - - /** uri for the NFT metadata stored off chain */ uri: string; - - /** uri_hash is a hash of the document pointed by uri */ uri_hash: string; - - /** data is an app specific data of the NFT. Optional */ data?: AnySDKType; } diff --git a/__fixtures__/output1/cosmos/nft/v1beta1/query.ts b/__fixtures__/output1/cosmos/nft/v1beta1/query.ts index e929f4a547..e35623cc12 100644 --- a/__fixtures__/output1/cosmos/nft/v1beta1/query.ts +++ b/__fixtures__/output1/cosmos/nft/v1beta1/query.ts @@ -144,7 +144,6 @@ export interface QueryClassesRequest { /** QueryClassesRequest is the request type for the Query/Classes RPC method */ export interface QueryClassesRequestSDKType { - /** pagination defines an optional pagination for the request. */ pagination?: PageRequestSDKType; } diff --git a/__fixtures__/output1/cosmos/nft/v1beta1/tx.ts b/__fixtures__/output1/cosmos/nft/v1beta1/tx.ts index 6a9d1151cb..8d22585a78 100644 --- a/__fixtures__/output1/cosmos/nft/v1beta1/tx.ts +++ b/__fixtures__/output1/cosmos/nft/v1beta1/tx.ts @@ -19,16 +19,9 @@ export interface MsgSend { /** MsgSend represents a message to send a nft from one account to another account. */ export interface MsgSendSDKType { - /** class_id defines the unique identifier of the nft classification, similar to the contract address of ERC721 */ class_id: string; - - /** id defines the unique identification of nft */ id: string; - - /** sender is the address of the owner of nft */ sender: string; - - /** receiver is the receiver address of nft */ receiver: string; } diff --git a/__fixtures__/output1/cosmos/orm/v1/orm.ts b/__fixtures__/output1/cosmos/orm/v1/orm.ts index 7c9fd967f1..69eb269bc7 100644 --- a/__fixtures__/output1/cosmos/orm/v1/orm.ts +++ b/__fixtures__/output1/cosmos/orm/v1/orm.ts @@ -20,17 +20,8 @@ export interface TableDescriptor { /** TableDescriptor describes an ORM table. */ export interface TableDescriptorSDKType { - /** primary_key defines the primary key for the table. */ primary_key?: PrimaryKeyDescriptorSDKType; - - /** index defines one or more secondary indexes. */ index: SecondaryIndexDescriptorSDKType[]; - - /** - * id is a non-zero integer ID that must be unique within the - * tables and singletons in this file. It may be deprecated in the future when this - * can be auto-generated. - */ id: number; } @@ -80,45 +71,7 @@ export interface PrimaryKeyDescriptor { /** PrimaryKeyDescriptor describes a table primary key. */ export interface PrimaryKeyDescriptorSDKType { - /** - * fields is a comma-separated list of fields in the primary key. Spaces are - * not allowed. Supported field types, their encodings, and any applicable constraints - * are described below. - * - uint32 are encoded as 2,3,4 or 5 bytes using a compact encoding that - * is suitable for sorted iteration (not varint encoding). This type is - * well-suited for small integers. - * - uint64 are encoded as 2,4,6 or 9 bytes using a compact encoding that - * is suitable for sorted iteration (not varint encoding). This type is - * well-suited for small integers such as auto-incrementing sequences. - * - fixed32, fixed64 are encoded as big-endian fixed width bytes and support - * sorted iteration. These types are well-suited for encoding fixed with - * decimals as integers. - * - string's are encoded as raw bytes in terminal key segments and null-terminated - * in non-terminal segments. Null characters are thus forbidden in strings. - * string fields support sorted iteration. - * - bytes are encoded as raw bytes in terminal segments and length-prefixed - * with a 32-bit unsigned varint in non-terminal segments. - * - int32, sint32, int64, sint64, sfixed32, sfixed64 are encoded as fixed width bytes with - * an encoding that enables sorted iteration. - * - google.protobuf.Timestamp and google.protobuf.Duration are encoded - * as 12 bytes using an encoding that enables sorted iteration. - * - enum fields are encoded using varint encoding and do not support sorted - * iteration. - * - bool fields are encoded as a single byte 0 or 1. - * - * All other fields types are unsupported in keys including repeated and - * oneof fields. - * - * Primary keys are prefixed by the varint encoded table id and the byte 0x0 - * plus any additional prefix specified by the schema. - */ fields: string; - - /** - * auto_increment specifies that the primary key is generated by an - * auto-incrementing integer. If this is set to true fields must only - * contain one field of that is of type uint64. - */ auto_increment: boolean; } @@ -150,27 +103,8 @@ export interface SecondaryIndexDescriptor { /** PrimaryKeyDescriptor describes a table secondary index. */ export interface SecondaryIndexDescriptorSDKType { - /** - * fields is a comma-separated list of fields in the index. The supported - * field types are the same as those for PrimaryKeyDescriptor.fields. - * Index keys are prefixed by the varint encoded table id and the varint - * encoded index id plus any additional prefix specified by the schema. - * - * In addition the field segments, non-unique index keys are suffixed with - * any additional primary key fields not present in the index fields so that the - * primary key can be reconstructed. Unique indexes instead of being suffixed - * store the remaining primary key fields in the value.. - */ fields: string; - - /** - * id is a non-zero integer ID that must be unique within the indexes for this - * table and less than 32768. It may be deprecated in the future when this can - * be auto-generated. - */ id: number; - - /** unique specifies that this an unique index. */ unique: boolean; } @@ -186,11 +120,6 @@ export interface SingletonDescriptor { /** TableDescriptor describes an ORM singleton table which has at most one instance. */ export interface SingletonDescriptorSDKType { - /** - * id is a non-zero integer ID that must be unique within the - * tables and singletons in this file. It may be deprecated in the future when this - * can be auto-generated. - */ id: number; } diff --git a/__fixtures__/output1/cosmos/orm/v1alpha1/schema.ts b/__fixtures__/output1/cosmos/orm/v1alpha1/schema.ts index 9baeba8012..ab1b1668e4 100644 --- a/__fixtures__/output1/cosmos/orm/v1alpha1/schema.ts +++ b/__fixtures__/output1/cosmos/orm/v1alpha1/schema.ts @@ -115,11 +115,6 @@ export interface ModuleSchemaDescriptor { /** ModuleSchemaDescriptor describe's a module's ORM schema. */ export interface ModuleSchemaDescriptorSDKType { schema_file: ModuleSchemaDescriptor_FileEntrySDKType[]; - - /** - * prefix is an optional prefix that precedes all keys in this module's - * store. - */ prefix: Uint8Array; } @@ -148,24 +143,8 @@ export interface ModuleSchemaDescriptor_FileEntry { /** FileEntry describes an ORM file used in a module. */ export interface ModuleSchemaDescriptor_FileEntrySDKType { - /** - * id is a prefix that will be varint encoded and prepended to all the - * table keys specified in the file's tables. - */ id: number; - - /** - * proto_file_name is the name of a file .proto in that contains - * table definitions. The .proto file must be in a package that the - * module has referenced using cosmos.app.v1.ModuleDescriptor.use_package. - */ proto_file_name: string; - - /** - * storage_type optionally indicates the type of storage this file's - * tables should used. If it is left unspecified, the default KV-storage - * of the app will be used. - */ storage_type: StorageType; } diff --git a/__fixtures__/output1/cosmos/params/v1beta1/query.ts b/__fixtures__/output1/cosmos/params/v1beta1/query.ts index 3d803bf3a4..5da93621c8 100644 --- a/__fixtures__/output1/cosmos/params/v1beta1/query.ts +++ b/__fixtures__/output1/cosmos/params/v1beta1/query.ts @@ -14,10 +14,7 @@ export interface QueryParamsRequest { /** QueryParamsRequest is request type for the Query/Params RPC method. */ export interface QueryParamsRequestSDKType { - /** subspace defines the module to query the parameter for. */ subspace: string; - - /** key defines the key of the parameter in the subspace. */ key: string; } @@ -29,7 +26,6 @@ export interface QueryParamsResponse { /** QueryParamsResponse is response type for the Query/Params RPC method. */ export interface QueryParamsResponseSDKType { - /** param defines the queried parameter. */ param?: ParamChangeSDKType; } diff --git a/__fixtures__/output1/cosmos/slashing/v1beta1/genesis.ts b/__fixtures__/output1/cosmos/slashing/v1beta1/genesis.ts index d179bd7458..6dfb7cd7cf 100644 --- a/__fixtures__/output1/cosmos/slashing/v1beta1/genesis.ts +++ b/__fixtures__/output1/cosmos/slashing/v1beta1/genesis.ts @@ -23,19 +23,8 @@ export interface GenesisState { /** GenesisState defines the slashing module's genesis state. */ export interface GenesisStateSDKType { - /** params defines all the paramaters of related to deposit. */ params?: ParamsSDKType; - - /** - * signing_infos represents a map between validator addresses and their - * signing infos. - */ signing_infos: SigningInfoSDKType[]; - - /** - * missed_blocks represents a map between validator addresses and their - * missed blocks. - */ missed_blocks: ValidatorMissedBlocksSDKType[]; } @@ -50,10 +39,7 @@ export interface SigningInfo { /** SigningInfo stores validator signing info of corresponding address. */ export interface SigningInfoSDKType { - /** address is the validator address. */ address: string; - - /** validator_signing_info represents the signing info of this validator. */ validator_signing_info?: ValidatorSigningInfoSDKType; } @@ -74,10 +60,7 @@ export interface ValidatorMissedBlocks { * address. */ export interface ValidatorMissedBlocksSDKType { - /** address is the validator address. */ address: string; - - /** missed_blocks is an array of missed blocks by the validator. */ missed_blocks: MissedBlockSDKType[]; } @@ -92,10 +75,7 @@ export interface MissedBlock { /** MissedBlock contains height and missed status as boolean. */ export interface MissedBlockSDKType { - /** index is the height at which the block was missed. */ index: Long; - - /** missed is the missed status. */ missed: boolean; } diff --git a/__fixtures__/output1/cosmos/slashing/v1beta1/query.ts b/__fixtures__/output1/cosmos/slashing/v1beta1/query.ts index bf4c1da676..074b04f1f4 100644 --- a/__fixtures__/output1/cosmos/slashing/v1beta1/query.ts +++ b/__fixtures__/output1/cosmos/slashing/v1beta1/query.ts @@ -34,7 +34,6 @@ export interface QuerySigningInfoRequest { * method */ export interface QuerySigningInfoRequestSDKType { - /** cons_address is the address to query signing info of */ cons_address: string; } @@ -52,7 +51,6 @@ export interface QuerySigningInfoResponse { * method */ export interface QuerySigningInfoResponseSDKType { - /** val_signing_info is the signing info of requested val cons address */ val_signing_info?: ValidatorSigningInfoSDKType; } @@ -87,7 +85,6 @@ export interface QuerySigningInfosResponse { * method */ export interface QuerySigningInfosResponseSDKType { - /** info is the signing info of all validators */ info: ValidatorSigningInfoSDKType[]; pagination?: PageResponseSDKType; } diff --git a/__fixtures__/output1/cosmos/slashing/v1beta1/slashing.ts b/__fixtures__/output1/cosmos/slashing/v1beta1/slashing.ts index 98bc02b48b..4f95e876f7 100644 --- a/__fixtures__/output1/cosmos/slashing/v1beta1/slashing.ts +++ b/__fixtures__/output1/cosmos/slashing/v1beta1/slashing.ts @@ -43,30 +43,10 @@ export interface ValidatorSigningInfo { */ export interface ValidatorSigningInfoSDKType { address: string; - - /** Height at which validator was first a candidate OR was unjailed */ start_height: Long; - - /** - * Index which is incremented each time the validator was a bonded - * in a block and may have signed a precommit or not. This in conjunction with the - * `SignedBlocksWindow` param determines the index in the `MissedBlocksBitArray`. - */ index_offset: Long; - - /** Timestamp until which the validator is jailed due to liveness downtime. */ jailed_until?: Date; - - /** - * Whether or not a validator has been tombstoned (killed out of validator set). It is set - * once the validator commits an equivocation or for any other configured misbehiavor. - */ tombstoned: boolean; - - /** - * A counter kept to avoid unnecessary array reads. - * Note that `Sum(MissedBlocksBitArray)` always equals `MissedBlocksCounter`. - */ missed_blocks_counter: Long; } diff --git a/__fixtures__/output1/cosmos/staking/v1beta1/authz.ts b/__fixtures__/output1/cosmos/staking/v1beta1/authz.ts index 4b501ca872..248ae43fec 100644 --- a/__fixtures__/output1/cosmos/staking/v1beta1/authz.ts +++ b/__fixtures__/output1/cosmos/staking/v1beta1/authz.ts @@ -98,22 +98,9 @@ export interface StakeAuthorization { * Since: cosmos-sdk 0.43 */ export interface StakeAuthorizationSDKType { - /** - * max_tokens specifies the maximum amount of tokens can be delegate to a validator. If it is - * empty, there is no spend limit and any amount of coins can be delegated. - */ max_tokens?: CoinSDKType; - - /** - * allow_list specifies list of validator addresses to whom grantee can delegate tokens on behalf of granter's - * account. - */ allow_list?: StakeAuthorization_ValidatorsSDKType; - - /** deny_list specifies list of validator addresses to whom grantee can not delegate tokens. */ deny_list?: StakeAuthorization_ValidatorsSDKType; - - /** authorization_type defines one of AuthorizationType. */ authorization_type: AuthorizationType; } diff --git a/__fixtures__/output1/cosmos/staking/v1beta1/genesis.ts b/__fixtures__/output1/cosmos/staking/v1beta1/genesis.ts index ee95f24e7b..9d908c23d1 100644 --- a/__fixtures__/output1/cosmos/staking/v1beta1/genesis.ts +++ b/__fixtures__/output1/cosmos/staking/v1beta1/genesis.ts @@ -36,31 +36,12 @@ export interface GenesisState { /** GenesisState defines the staking module's genesis state. */ export interface GenesisStateSDKType { - /** params defines all the paramaters of related to deposit. */ params?: ParamsSDKType; - - /** - * last_total_power tracks the total amounts of bonded tokens recorded during - * the previous end block. - */ last_total_power: Uint8Array; - - /** - * last_validator_powers is a special index that provides a historical list - * of the last-block's bonded validators. - */ last_validator_powers: LastValidatorPowerSDKType[]; - - /** delegations defines the validator set at genesis. */ validators: ValidatorSDKType[]; - - /** delegations defines the delegations active at genesis. */ delegations: DelegationSDKType[]; - - /** unbonding_delegations defines the unbonding delegations active at genesis. */ unbonding_delegations: UnbondingDelegationSDKType[]; - - /** redelegations defines the redelegations active at genesis. */ redelegations: RedelegationSDKType[]; exported: boolean; } @@ -76,10 +57,7 @@ export interface LastValidatorPower { /** LastValidatorPower required for validator set update logic. */ export interface LastValidatorPowerSDKType { - /** address is the address of the validator. */ address: string; - - /** power defines the power of the validator. */ power: Long; } diff --git a/__fixtures__/output1/cosmos/staking/v1beta1/query.ts b/__fixtures__/output1/cosmos/staking/v1beta1/query.ts index 2c615a3e60..d76861b5bf 100644 --- a/__fixtures__/output1/cosmos/staking/v1beta1/query.ts +++ b/__fixtures__/output1/cosmos/staking/v1beta1/query.ts @@ -15,10 +15,7 @@ export interface QueryValidatorsRequest { /** QueryValidatorsRequest is request type for Query/Validators RPC method. */ export interface QueryValidatorsRequestSDKType { - /** status enables to query for validators matching a given status. */ status: string; - - /** pagination defines an optional pagination for the request. */ pagination?: PageRequestSDKType; } @@ -33,10 +30,7 @@ export interface QueryValidatorsResponse { /** QueryValidatorsResponse is response type for the Query/Validators RPC method */ export interface QueryValidatorsResponseSDKType { - /** validators contains all the queried validators. */ validators: ValidatorSDKType[]; - - /** pagination defines the pagination in the response. */ pagination?: PageResponseSDKType; } @@ -48,7 +42,6 @@ export interface QueryValidatorRequest { /** QueryValidatorRequest is response type for the Query/Validator RPC method */ export interface QueryValidatorRequestSDKType { - /** validator_addr defines the validator address to query for. */ validator_addr: string; } @@ -60,7 +53,6 @@ export interface QueryValidatorResponse { /** QueryValidatorResponse is response type for the Query/Validator RPC method */ export interface QueryValidatorResponseSDKType { - /** validator defines the the validator info. */ validator?: ValidatorSDKType; } @@ -81,10 +73,7 @@ export interface QueryValidatorDelegationsRequest { * Query/ValidatorDelegations RPC method */ export interface QueryValidatorDelegationsRequestSDKType { - /** validator_addr defines the validator address to query for. */ validator_addr: string; - - /** pagination defines an optional pagination for the request. */ pagination?: PageRequestSDKType; } @@ -105,8 +94,6 @@ export interface QueryValidatorDelegationsResponse { */ export interface QueryValidatorDelegationsResponseSDKType { delegation_responses: DelegationResponseSDKType[]; - - /** pagination defines the pagination in the response. */ pagination?: PageResponseSDKType; } @@ -127,10 +114,7 @@ export interface QueryValidatorUnbondingDelegationsRequest { * Query/ValidatorUnbondingDelegations RPC method */ export interface QueryValidatorUnbondingDelegationsRequestSDKType { - /** validator_addr defines the validator address to query for. */ validator_addr: string; - - /** pagination defines an optional pagination for the request. */ pagination?: PageRequestSDKType; } @@ -151,8 +135,6 @@ export interface QueryValidatorUnbondingDelegationsResponse { */ export interface QueryValidatorUnbondingDelegationsResponseSDKType { unbonding_responses: UnbondingDelegationSDKType[]; - - /** pagination defines the pagination in the response. */ pagination?: PageResponseSDKType; } @@ -167,10 +149,7 @@ export interface QueryDelegationRequest { /** QueryDelegationRequest is request type for the Query/Delegation RPC method. */ export interface QueryDelegationRequestSDKType { - /** delegator_addr defines the delegator address to query for. */ delegator_addr: string; - - /** validator_addr defines the validator address to query for. */ validator_addr: string; } @@ -182,7 +161,6 @@ export interface QueryDelegationResponse { /** QueryDelegationResponse is response type for the Query/Delegation RPC method. */ export interface QueryDelegationResponseSDKType { - /** delegation_responses defines the delegation info of a delegation. */ delegation_response?: DelegationResponseSDKType; } @@ -203,10 +181,7 @@ export interface QueryUnbondingDelegationRequest { * Query/UnbondingDelegation RPC method. */ export interface QueryUnbondingDelegationRequestSDKType { - /** delegator_addr defines the delegator address to query for. */ delegator_addr: string; - - /** validator_addr defines the validator address to query for. */ validator_addr: string; } @@ -224,7 +199,6 @@ export interface QueryUnbondingDelegationResponse { * RPC method. */ export interface QueryUnbondingDelegationResponseSDKType { - /** unbond defines the unbonding information of a delegation. */ unbond?: UnbondingDelegationSDKType; } @@ -245,10 +219,7 @@ export interface QueryDelegatorDelegationsRequest { * Query/DelegatorDelegations RPC method. */ export interface QueryDelegatorDelegationsRequestSDKType { - /** delegator_addr defines the delegator address to query for. */ delegator_addr: string; - - /** pagination defines an optional pagination for the request. */ pagination?: PageRequestSDKType; } @@ -269,10 +240,7 @@ export interface QueryDelegatorDelegationsResponse { * Query/DelegatorDelegations RPC method. */ export interface QueryDelegatorDelegationsResponseSDKType { - /** delegation_responses defines all the delegations' info of a delegator. */ delegation_responses: DelegationResponseSDKType[]; - - /** pagination defines the pagination in the response. */ pagination?: PageResponseSDKType; } @@ -293,10 +261,7 @@ export interface QueryDelegatorUnbondingDelegationsRequest { * Query/DelegatorUnbondingDelegations RPC method. */ export interface QueryDelegatorUnbondingDelegationsRequestSDKType { - /** delegator_addr defines the delegator address to query for. */ delegator_addr: string; - - /** pagination defines an optional pagination for the request. */ pagination?: PageRequestSDKType; } @@ -317,8 +282,6 @@ export interface QueryDelegatorUnbondingDelegationsResponse { */ export interface QueryDelegatorUnbondingDelegationsResponseSDKType { unbonding_responses: UnbondingDelegationSDKType[]; - - /** pagination defines the pagination in the response. */ pagination?: PageResponseSDKType; } @@ -345,16 +308,9 @@ export interface QueryRedelegationsRequest { * method. */ export interface QueryRedelegationsRequestSDKType { - /** delegator_addr defines the delegator address to query for. */ delegator_addr: string; - - /** src_validator_addr defines the validator address to redelegate from. */ src_validator_addr: string; - - /** dst_validator_addr defines the validator address to redelegate to. */ dst_validator_addr: string; - - /** pagination defines an optional pagination for the request. */ pagination?: PageRequestSDKType; } @@ -375,8 +331,6 @@ export interface QueryRedelegationsResponse { */ export interface QueryRedelegationsResponseSDKType { redelegation_responses: RedelegationResponseSDKType[]; - - /** pagination defines the pagination in the response. */ pagination?: PageResponseSDKType; } @@ -397,10 +351,7 @@ export interface QueryDelegatorValidatorsRequest { * Query/DelegatorValidators RPC method. */ export interface QueryDelegatorValidatorsRequestSDKType { - /** delegator_addr defines the delegator address to query for. */ delegator_addr: string; - - /** pagination defines an optional pagination for the request. */ pagination?: PageRequestSDKType; } @@ -421,10 +372,7 @@ export interface QueryDelegatorValidatorsResponse { * Query/DelegatorValidators RPC method. */ export interface QueryDelegatorValidatorsResponseSDKType { - /** validators defines the the validators' info of a delegator. */ validators: ValidatorSDKType[]; - - /** pagination defines the pagination in the response. */ pagination?: PageResponseSDKType; } @@ -445,10 +393,7 @@ export interface QueryDelegatorValidatorRequest { * Query/DelegatorValidator RPC method. */ export interface QueryDelegatorValidatorRequestSDKType { - /** delegator_addr defines the delegator address to query for. */ delegator_addr: string; - - /** validator_addr defines the validator address to query for. */ validator_addr: string; } @@ -466,7 +411,6 @@ export interface QueryDelegatorValidatorResponse { * Query/DelegatorValidator RPC method. */ export interface QueryDelegatorValidatorResponseSDKType { - /** validator defines the the validator info. */ validator?: ValidatorSDKType; } @@ -484,7 +428,6 @@ export interface QueryHistoricalInfoRequest { * method. */ export interface QueryHistoricalInfoRequestSDKType { - /** height defines at which height to query the historical info. */ height: Long; } @@ -502,7 +445,6 @@ export interface QueryHistoricalInfoResponse { * method. */ export interface QueryHistoricalInfoResponseSDKType { - /** hist defines the historical info at the given height. */ hist?: HistoricalInfoSDKType; } @@ -520,7 +462,6 @@ export interface QueryPoolResponse { /** QueryPoolResponse is response type for the Query/Pool RPC method. */ export interface QueryPoolResponseSDKType { - /** pool defines the pool info. */ pool?: PoolSDKType; } @@ -538,7 +479,6 @@ export interface QueryParamsResponse { /** QueryParamsResponse is response type for the Query/Params RPC method. */ export interface QueryParamsResponseSDKType { - /** params holds all the parameters of this module. */ params?: ParamsSDKType; } diff --git a/__fixtures__/output1/cosmos/staking/v1beta1/staking.ts b/__fixtures__/output1/cosmos/staking/v1beta1/staking.ts index f5fbf544e3..3491d1519b 100644 --- a/__fixtures__/output1/cosmos/staking/v1beta1/staking.ts +++ b/__fixtures__/output1/cosmos/staking/v1beta1/staking.ts @@ -109,13 +109,8 @@ export interface CommissionRates { * a validator. */ export interface CommissionRatesSDKType { - /** rate is the commission rate charged to delegators, as a fraction. */ rate: string; - - /** max_rate defines the maximum commission rate which validator can ever charge, as a fraction. */ max_rate: string; - - /** max_change_rate defines the maximum daily increase of the validator commission, as a fraction. */ max_change_rate: string; } @@ -130,10 +125,7 @@ export interface Commission { /** Commission defines commission parameters for a given validator. */ export interface CommissionSDKType { - /** commission_rates defines the initial commission rates to be used for creating a validator. */ commission_rates?: CommissionRatesSDKType; - - /** update_time is the last time the commission rate was changed. */ update_time?: Date; } @@ -157,19 +149,10 @@ export interface Description { /** Description defines a validator description. */ export interface DescriptionSDKType { - /** moniker defines a human-readable name for the validator. */ moniker: string; - - /** identity defines an optional identity signature (ex. UPort or Keybase). */ identity: string; - - /** website defines an optional website link. */ website: string; - - /** security_contact defines an optional email for security contact. */ security_contact: string; - - /** details define other optional details. */ details: string; } @@ -229,37 +212,16 @@ export interface Validator { * multiplied by exchange rate. */ export interface ValidatorSDKType { - /** operator_address defines the address of the validator's operator; bech encoded in JSON. */ operator_address: string; - - /** consensus_pubkey is the consensus public key of the validator, as a Protobuf Any. */ consensus_pubkey?: AnySDKType; - - /** jailed defined whether the validator has been jailed from bonded status or not. */ jailed: boolean; - - /** status is the validator status (bonded/unbonding/unbonded). */ status: BondStatus; - - /** tokens define the delegated tokens (incl. self-delegation). */ tokens: string; - - /** delegator_shares defines total shares issued to a validator's delegators. */ delegator_shares: string; - - /** description defines the description terms for the validator. */ description?: DescriptionSDKType; - - /** unbonding_height defines, if unbonding, the height at which this validator has begun unbonding. */ unbonding_height: Long; - - /** unbonding_time defines, if unbonding, the min time for the validator to complete unbonding. */ unbonding_time?: Date; - - /** commission defines the commission parameters. */ commission?: CommissionSDKType; - - /** min_self_delegation is the validator's self declared minimum self delegation. */ min_self_delegation: string; } @@ -359,13 +321,8 @@ export interface Delegation { * validator. */ export interface DelegationSDKType { - /** delegator_address is the bech32-encoded address of the delegator. */ delegator_address: string; - - /** validator_address is the bech32-encoded address of the validator. */ validator_address: string; - - /** shares define the delegation shares received. */ shares: string; } @@ -389,13 +346,8 @@ export interface UnbondingDelegation { * for a single validator in an time-ordered list. */ export interface UnbondingDelegationSDKType { - /** delegator_address is the bech32-encoded address of the delegator. */ delegator_address: string; - - /** validator_address is the bech32-encoded address of the validator. */ validator_address: string; - - /** entries are the unbonding delegation entries. */ entries: UnbondingDelegationEntrySDKType[]; } @@ -416,16 +368,9 @@ export interface UnbondingDelegationEntry { /** UnbondingDelegationEntry defines an unbonding object with relevant metadata. */ export interface UnbondingDelegationEntrySDKType { - /** creation_height is the height which the unbonding took place. */ creation_height: Long; - - /** completion_time is the unix time for unbonding completion. */ completion_time?: Date; - - /** initial_balance defines the tokens initially scheduled to receive at completion. */ initial_balance: string; - - /** balance defines the tokens to receive at completion. */ balance: string; } @@ -446,16 +391,9 @@ export interface RedelegationEntry { /** RedelegationEntry defines a redelegation object with relevant metadata. */ export interface RedelegationEntrySDKType { - /** creation_height defines the height which the redelegation took place. */ creation_height: Long; - - /** completion_time defines the unix time for redelegation completion. */ completion_time?: Date; - - /** initial_balance defines the initial balance when redelegation started. */ initial_balance: string; - - /** shares_dst is the amount of destination-validator shares created by redelegation. */ shares_dst: string; } @@ -482,16 +420,9 @@ export interface Redelegation { * from a particular source validator to a particular destination validator. */ export interface RedelegationSDKType { - /** delegator_address is the bech32-encoded address of the delegator. */ delegator_address: string; - - /** validator_src_address is the validator redelegation source operator address. */ validator_src_address: string; - - /** validator_dst_address is the validator redelegation destination operator address. */ validator_dst_address: string; - - /** entries are the redelegation entries. */ entries: RedelegationEntrySDKType[]; } @@ -518,22 +449,11 @@ export interface Params { /** Params defines the parameters for the staking module. */ export interface ParamsSDKType { - /** unbonding_time is the time duration of unbonding. */ unbonding_time?: DurationSDKType; - - /** max_validators is the maximum number of validators. */ max_validators: number; - - /** max_entries is the max entries for either unbonding delegation or redelegation (per pair/trio). */ max_entries: number; - - /** historical_entries is the number of historical entries to persist. */ historical_entries: number; - - /** bond_denom defines the bondable coin denomination. */ bond_denom: string; - - /** min_commission_rate is the chain-wide minimum commission rate that a validator can charge their delegators */ min_commission_rate: string; } diff --git a/__fixtures__/output1/cosmos/staking/v1beta1/tx.ts b/__fixtures__/output1/cosmos/staking/v1beta1/tx.ts index 56ce936be9..60af489b9e 100644 --- a/__fixtures__/output1/cosmos/staking/v1beta1/tx.ts +++ b/__fixtures__/output1/cosmos/staking/v1beta1/tx.ts @@ -53,13 +53,6 @@ export interface MsgEditValidator { export interface MsgEditValidatorSDKType { description?: DescriptionSDKType; validator_address: string; - - /** - * We pass a reference to the new commission rate and min self delegation as - * it's not mandatory to update. If not updated, the deserialized rate will be - * zero with no way to distinguish if an update was intended. - * REF: #2373 - */ commission_rate: string; min_self_delegation: string; } diff --git a/__fixtures__/output1/cosmos/tx/signing/v1beta1/signing.ts b/__fixtures__/output1/cosmos/tx/signing/v1beta1/signing.ts index 8059dc5b8f..329dfb2477 100644 --- a/__fixtures__/output1/cosmos/tx/signing/v1beta1/signing.ts +++ b/__fixtures__/output1/cosmos/tx/signing/v1beta1/signing.ts @@ -111,7 +111,6 @@ export interface SignatureDescriptors { /** SignatureDescriptors wraps multiple SignatureDescriptor's. */ export interface SignatureDescriptorsSDKType { - /** signatures are the signature descriptors */ signatures: SignatureDescriptorSDKType[]; } @@ -141,15 +140,8 @@ export interface SignatureDescriptor { * clients. */ export interface SignatureDescriptorSDKType { - /** public_key is the public key of the signer */ public_key?: AnySDKType; data?: SignatureDescriptor_DataSDKType; - - /** - * sequence is the sequence of the account, which describes the - * number of committed transactions signed by a given address. It is used to prevent - * replay attacks. - */ sequence: Long; } @@ -164,10 +156,7 @@ export interface SignatureDescriptor_Data { /** Data represents signature data */ export interface SignatureDescriptor_DataSDKType { - /** single represents a single signer */ single?: SignatureDescriptor_Data_SingleSDKType; - - /** multi represents a multisig signer */ multi?: SignatureDescriptor_Data_MultiSDKType; } @@ -182,10 +171,7 @@ export interface SignatureDescriptor_Data_Single { /** Single is the signature data for a single signer */ export interface SignatureDescriptor_Data_SingleSDKType { - /** mode is the signing mode of the single signer */ mode: SignMode; - - /** signature is the raw signature bytes */ signature: Uint8Array; } @@ -200,10 +186,7 @@ export interface SignatureDescriptor_Data_Multi { /** Multi is the signature data for a multisig public key */ export interface SignatureDescriptor_Data_MultiSDKType { - /** bitarray specifies which keys within the multisig are signing */ bitarray?: CompactBitArraySDKType; - - /** signatures is the signatures of the multi-signature */ signatures: SignatureDescriptor_DataSDKType[]; } diff --git a/__fixtures__/output1/cosmos/tx/v1beta1/service.ts b/__fixtures__/output1/cosmos/tx/v1beta1/service.ts index 3e16f5b6d8..e8765f1c31 100644 --- a/__fixtures__/output1/cosmos/tx/v1beta1/service.ts +++ b/__fixtures__/output1/cosmos/tx/v1beta1/service.ts @@ -144,10 +144,7 @@ export interface GetTxsEventRequest { * RPC method. */ export interface GetTxsEventRequestSDKType { - /** events is the list of transaction event type. */ events: string[]; - - /** pagination defines a pagination for the request. */ pagination?: PageRequestSDKType; order_by: OrderBy; } @@ -172,13 +169,8 @@ export interface GetTxsEventResponse { * RPC method. */ export interface GetTxsEventResponseSDKType { - /** txs is the list of queried transactions. */ txs: TxSDKType[]; - - /** tx_responses is the list of queried TxResponses. */ tx_responses: TxResponseSDKType[]; - - /** pagination defines a pagination for the response. */ pagination?: PageResponseSDKType; } @@ -197,7 +189,6 @@ export interface BroadcastTxRequest { * RPC method. */ export interface BroadcastTxRequestSDKType { - /** tx_bytes is the raw transaction. */ tx_bytes: Uint8Array; mode: BroadcastMode; } @@ -216,7 +207,6 @@ export interface BroadcastTxResponse { * Service.BroadcastTx method. */ export interface BroadcastTxResponseSDKType { - /** tx_response is the queried TxResponses. */ tx_response?: TxResponseSDKType; } @@ -246,19 +236,8 @@ export interface SimulateRequest { * RPC method. */ export interface SimulateRequestSDKType { - /** - * tx is the transaction to simulate. - * Deprecated. Send raw tx bytes instead. - */ - /** @deprecated */ tx?: TxSDKType; - - /** - * tx_bytes is the raw transaction. - * - * Since: cosmos-sdk 0.43 - */ tx_bytes: Uint8Array; } @@ -279,10 +258,7 @@ export interface SimulateResponse { * Service.SimulateRPC method. */ export interface SimulateResponseSDKType { - /** gas_info is the information about gas used in the simulation. */ gas_info?: GasInfoSDKType; - - /** result is the result of the simulation. */ result?: ResultSDKType; } @@ -300,7 +276,6 @@ export interface GetTxRequest { * RPC method. */ export interface GetTxRequestSDKType { - /** hash is the tx hash to query, encoded as a hex string. */ hash: string; } @@ -315,10 +290,7 @@ export interface GetTxResponse { /** GetTxResponse is the response type for the Service.GetTx method. */ export interface GetTxResponseSDKType { - /** tx is the queried transaction. */ tx?: TxSDKType; - - /** tx_response is the queried TxResponses. */ tx_response?: TxResponseSDKType; } @@ -343,10 +315,7 @@ export interface GetBlockWithTxsRequest { * Since: cosmos-sdk 0.45.2 */ export interface GetBlockWithTxsRequestSDKType { - /** height is the height of the block to query. */ height: Long; - - /** pagination defines a pagination for the request. */ pagination?: PageRequestSDKType; } @@ -371,12 +340,9 @@ export interface GetBlockWithTxsResponse { * Since: cosmos-sdk 0.45.2 */ export interface GetBlockWithTxsResponseSDKType { - /** txs are the transactions in the block. */ txs: TxSDKType[]; block_id?: BlockIDSDKType; block?: BlockSDKType; - - /** pagination defines a pagination for the response. */ pagination?: PageResponseSDKType; } diff --git a/__fixtures__/output1/cosmos/tx/v1beta1/tx.ts b/__fixtures__/output1/cosmos/tx/v1beta1/tx.ts index 8d5a663b4b..e9ff46ef6e 100644 --- a/__fixtures__/output1/cosmos/tx/v1beta1/tx.ts +++ b/__fixtures__/output1/cosmos/tx/v1beta1/tx.ts @@ -27,20 +27,8 @@ export interface Tx { /** Tx is the standard type used for broadcasting transactions. */ export interface TxSDKType { - /** body is the processable content of the transaction */ body?: TxBodySDKType; - - /** - * auth_info is the authorization related content of the transaction, - * specifically signers, signer modes and fee - */ auth_info?: AuthInfoSDKType; - - /** - * signatures is a list of signatures that matches the length and order of - * AuthInfo's signer_infos to allow connecting signature meta information like - * public key and signing mode by position. - */ signatures: Uint8Array[]; } @@ -80,23 +68,8 @@ export interface TxRaw { * as the transaction ID. */ export interface TxRawSDKType { - /** - * body_bytes is a protobuf serialization of a TxBody that matches the - * representation in SignDoc. - */ body_bytes: Uint8Array; - - /** - * auth_info_bytes is a protobuf serialization of an AuthInfo that matches the - * representation in SignDoc. - */ auth_info_bytes: Uint8Array; - - /** - * signatures is a list of signatures that matches the length and order of - * AuthInfo's signer_infos to allow connecting signature meta information like - * public key and signing mode by position. - */ signatures: Uint8Array[]; } @@ -127,26 +100,9 @@ export interface SignDoc { /** SignDoc is the type used for generating sign bytes for SIGN_MODE_DIRECT. */ export interface SignDocSDKType { - /** - * body_bytes is protobuf serialization of a TxBody that matches the - * representation in TxRaw. - */ body_bytes: Uint8Array; - - /** - * auth_info_bytes is a protobuf serialization of an AuthInfo that matches the - * representation in TxRaw. - */ auth_info_bytes: Uint8Array; - - /** - * chain_id is the unique identifier of the chain this transaction targets. - * It prevents signed transactions from being used on another chain by an - * attacker - */ chain_id: string; - - /** account_number is the account number of the account in state */ account_number: Long; } @@ -193,32 +149,11 @@ export interface SignDocDirectAux { * Since: cosmos-sdk 0.46 */ export interface SignDocDirectAuxSDKType { - /** - * body_bytes is protobuf serialization of a TxBody that matches the - * representation in TxRaw. - */ body_bytes: Uint8Array; - - /** public_key is the public key of the signing account. */ public_key?: AnySDKType; - - /** - * chain_id is the identifier of the chain this transaction targets. - * It prevents signed transactions from being used on another chain by an - * attacker. - */ chain_id: string; - - /** account_number is the account number of the account in state. */ account_number: Long; - - /** sequence is the sequence number of the signing account. */ sequence: Long; - - /** - * Tip is the optional tip used for meta-transactions. It should be left - * empty if the signer is not the tipper for this transaction. - */ tip?: TipSDKType; } @@ -265,42 +200,10 @@ export interface TxBody { /** TxBody is the body of a transaction that all signers sign over. */ export interface TxBodySDKType { - /** - * messages is a list of messages to be executed. The required signers of - * those messages define the number and order of elements in AuthInfo's - * signer_infos and Tx's signatures. Each required signer address is added to - * the list only the first time it occurs. - * By convention, the first required signer (usually from the first message) - * is referred to as the primary signer and pays the fee for the whole - * transaction. - */ messages: AnySDKType[]; - - /** - * memo is any arbitrary note/comment to be added to the transaction. - * WARNING: in clients, any publicly exposed text should not be called memo, - * but should be called `note` instead (see https://github.com/cosmos/cosmos-sdk/issues/9122). - */ memo: string; - - /** - * timeout is the block height after which this transaction will not - * be processed by the chain - */ timeout_height: Long; - - /** - * extension_options are arbitrary options that can be added by chains - * when the default options are not sufficient. If any of these are present - * and can't be handled, the transaction will be rejected - */ extension_options: AnySDKType[]; - - /** - * extension_options are arbitrary options that can be added by chains - * when the default options are not sufficient. If any of these are present - * and can't be handled, they will be ignored - */ non_critical_extension_options: AnySDKType[]; } @@ -338,27 +241,8 @@ export interface AuthInfo { * transaction. */ export interface AuthInfoSDKType { - /** - * signer_infos defines the signing modes for the required signers. The number - * and order of elements must match the required signers from TxBody's - * messages. The first element is the primary signer and the one which pays - * the fee. - */ signer_infos: SignerInfoSDKType[]; - - /** - * Fee is the fee and gas limit for the transaction. The first signer is the - * primary signer and the one which pays the fee. The fee can be calculated - * based on the cost of evaluating the body and doing signature verification - * of the signers. This can be estimated via simulation. - */ fee?: FeeSDKType; - - /** - * Tip is the optional tip used for meta-transactions. - * - * Since: cosmos-sdk 0.46 - */ tip?: TipSDKType; } @@ -393,24 +277,8 @@ export interface SignerInfo { * signer. */ export interface SignerInfoSDKType { - /** - * public_key is the public key of the signer. It is optional for accounts - * that already exist in state. If unset, the verifier can use the required \ - * signer address for this position and lookup the public key. - */ public_key?: AnySDKType; - - /** - * mode_info describes the signing mode of the signer and is a nested - * structure to support nested multisig pubkey's - */ mode_info?: ModeInfoSDKType; - - /** - * sequence is the sequence of the account, which describes the - * number of committed transactions signed by a given address. It is used to - * prevent replay attacks. - */ sequence: Long; } @@ -425,10 +293,7 @@ export interface ModeInfo { /** ModeInfo describes the signing mode of a single or nested multisig signer. */ export interface ModeInfoSDKType { - /** single represents a single signer */ single?: ModeInfo_SingleSDKType; - - /** multi represents a nested multisig signer */ multi?: ModeInfo_MultiSDKType; } @@ -448,7 +313,6 @@ export interface ModeInfo_Single { * future */ export interface ModeInfo_SingleSDKType { - /** mode is the signing mode of the single signer */ mode: SignMode; } @@ -466,13 +330,7 @@ export interface ModeInfo_Multi { /** Multi is the mode info for a multisig public key */ export interface ModeInfo_MultiSDKType { - /** bitarray specifies which keys within the multisig are signing */ bitarray?: CompactBitArraySDKType; - - /** - * mode_infos is the corresponding modes of the signers of the multisig - * which could include nested multisig public keys - */ mode_infos: ModeInfoSDKType[]; } @@ -512,27 +370,9 @@ export interface Fee { * which must be above some miminum to be accepted into the mempool. */ export interface FeeSDKType { - /** amount is the amount of coins to be paid as a fee */ amount: CoinSDKType[]; - - /** - * gas_limit is the maximum gas that can be used in transaction processing - * before an out of gas error occurs - */ gas_limit: Long; - - /** - * if unset, the first signer is responsible for paying the fees. If set, the specified account must pay the fees. - * the payer must be a tx signer (and thus have signed this field in AuthInfo). - * setting this field does *not* change the ordering of required signers for the transaction. - */ payer: string; - - /** - * if set, the fee payer (either the first signer or the value of the payer field) requests that a fee grant be used - * to pay fees instead of the fee payer's own balance. If an appropriate fee grant does not exist or the chain does - * not support fee grants, this will fail - */ granter: string; } @@ -555,10 +395,7 @@ export interface Tip { * Since: cosmos-sdk 0.46 */ export interface TipSDKType { - /** amount is the amount of the tip */ amount: CoinSDKType[]; - - /** tipper is the address of the account paying for the tip */ tipper: string; } @@ -601,24 +438,9 @@ export interface AuxSignerData { * Since: cosmos-sdk 0.46 */ export interface AuxSignerDataSDKType { - /** - * address is the bech32-encoded address of the auxiliary signer. If using - * AuxSignerData across different chains, the bech32 prefix of the target - * chain (where the final transaction is broadcasted) should be used. - */ address: string; - - /** - * sign_doc is the SIGN_MOD_DIRECT_AUX sign doc that the auxiliary signer - * signs. Note: we use the same sign doc even if we're signing with - * LEGACY_AMINO_JSON. - */ sign_doc?: SignDocDirectAuxSDKType; - - /** mode is the signing mode of the single signer */ mode: SignMode; - - /** sig is the signature of the sign doc. */ sig: Uint8Array; } diff --git a/__fixtures__/output1/cosmos/upgrade/v1beta1/query.ts b/__fixtures__/output1/cosmos/upgrade/v1beta1/query.ts index 4f94676eb9..c7f231762f 100644 --- a/__fixtures__/output1/cosmos/upgrade/v1beta1/query.ts +++ b/__fixtures__/output1/cosmos/upgrade/v1beta1/query.ts @@ -29,7 +29,6 @@ export interface QueryCurrentPlanResponse { * method. */ export interface QueryCurrentPlanResponseSDKType { - /** plan is the current upgrade plan. */ plan?: PlanSDKType; } @@ -47,7 +46,6 @@ export interface QueryAppliedPlanRequest { * method. */ export interface QueryAppliedPlanRequestSDKType { - /** name is the name of the applied plan to query for. */ name: string; } @@ -65,7 +63,6 @@ export interface QueryAppliedPlanResponse { * method. */ export interface QueryAppliedPlanResponseSDKType { - /** height is the block height at which the plan was applied. */ height: Long; } @@ -90,10 +87,6 @@ export interface QueryUpgradedConsensusStateRequest { /** @deprecated */ export interface QueryUpgradedConsensusStateRequestSDKType { - /** - * last height of the current chain must be sent in request - * as this is the height under which next consensus state is stored - */ last_height: Long; } @@ -115,7 +108,6 @@ export interface QueryUpgradedConsensusStateResponse { /** @deprecated */ export interface QueryUpgradedConsensusStateResponseSDKType { - /** Since: cosmos-sdk 0.43 */ upgraded_consensus_state: Uint8Array; } @@ -141,11 +133,6 @@ export interface QueryModuleVersionsRequest { * Since: cosmos-sdk 0.43 */ export interface QueryModuleVersionsRequestSDKType { - /** - * module_name is a field to query a specific module - * consensus version from state. Leaving this empty will - * fetch the full list of module versions from state - */ module_name: string; } @@ -167,7 +154,6 @@ export interface QueryModuleVersionsResponse { * Since: cosmos-sdk 0.43 */ export interface QueryModuleVersionsResponseSDKType { - /** module_versions is a list of module names with their consensus versions. */ module_versions: ModuleVersionSDKType[]; } diff --git a/__fixtures__/output1/cosmos/upgrade/v1beta1/tx.ts b/__fixtures__/output1/cosmos/upgrade/v1beta1/tx.ts index 323181355d..3a0d285f09 100644 --- a/__fixtures__/output1/cosmos/upgrade/v1beta1/tx.ts +++ b/__fixtures__/output1/cosmos/upgrade/v1beta1/tx.ts @@ -22,10 +22,7 @@ export interface MsgSoftwareUpgrade { * Since: cosmos-sdk 0.46 */ export interface MsgSoftwareUpgradeSDKType { - /** authority is the address of the governance account. */ authority: string; - - /** plan is the upgrade plan. */ plan?: PlanSDKType; } @@ -59,7 +56,6 @@ export interface MsgCancelUpgrade { * Since: cosmos-sdk 0.46 */ export interface MsgCancelUpgradeSDKType { - /** authority is the address of the governance account. */ authority: string; } diff --git a/__fixtures__/output1/cosmos/upgrade/v1beta1/upgrade.ts b/__fixtures__/output1/cosmos/upgrade/v1beta1/upgrade.ts index b77f34a9df..37c2cd02aa 100644 --- a/__fixtures__/output1/cosmos/upgrade/v1beta1/upgrade.ts +++ b/__fixtures__/output1/cosmos/upgrade/v1beta1/upgrade.ts @@ -50,44 +50,13 @@ export interface Plan { /** Plan specifies information about a planned upgrade and when it should occur. */ export interface PlanSDKType { - /** - * Sets the name for the upgrade. This name will be used by the upgraded - * version of the software to apply any special "on-upgrade" commands during - * the first BeginBlock method after the upgrade is applied. It is also used - * to detect whether a software version can handle a given upgrade. If no - * upgrade handler with this name has been set in the software, it will be - * assumed that the software is out-of-date when the upgrade Time or Height is - * reached and the software will exit. - */ name: string; - /** - * Deprecated: Time based upgrades have been deprecated. Time based upgrade logic - * has been removed from the SDK. - * If this field is not empty, an error will be thrown. - */ - /** @deprecated */ time?: Date; - - /** - * The height at which the upgrade must be performed. - * Only used if Time is not set. - */ height: Long; - - /** - * Any application specific upgrade info to be included on-chain - * such as a git commit that validators could automatically upgrade to - */ info: string; - /** - * Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been - * moved to the IBC module in the sub module 02-client. - * If this field is not empty, an error will be thrown. - */ - /** @deprecated */ upgraded_client_state?: AnySDKType; } @@ -165,10 +134,7 @@ export interface ModuleVersion { * Since: cosmos-sdk 0.43 */ export interface ModuleVersionSDKType { - /** name of the app module */ name: string; - - /** consensus version of the app module */ version: Long; } diff --git a/__fixtures__/output1/cosmos_proto/cosmos.ts b/__fixtures__/output1/cosmos_proto/cosmos.ts index df176ba8f3..b89841cf92 100644 --- a/__fixtures__/output1/cosmos_proto/cosmos.ts +++ b/__fixtures__/output1/cosmos_proto/cosmos.ts @@ -70,18 +70,7 @@ export interface InterfaceDescriptor { * accepts_interface and implements_interface and declared by declare_interface. */ export interface InterfaceDescriptorSDKType { - /** - * name is the name of the interface. It should be a short-name (without - * a period) such that the fully qualified name of the interface will be - * package.name, ex. for the package a.b and interface named C, the - * fully-qualified name will be a.b.C. - */ name: string; - - /** - * description is a human-readable description of the interface and its - * purpose. - */ description: string; } @@ -129,27 +118,8 @@ export interface ScalarDescriptor { * i.e. the encoding should be deterministic. */ export interface ScalarDescriptorSDKType { - /** - * name is the name of the scalar. It should be a short-name (without - * a period) such that the fully qualified name of the scalar will be - * package.name, ex. for the package a.b and scalar named C, the - * fully-qualified name will be a.b.C. - */ name: string; - - /** - * description is a human-readable description of the scalar and its - * encoding format. For instance a big integer or decimal scalar should - * specify precisely the expected encoding format. - */ description: string; - - /** - * field_type is the type of field with which this scalar can be used. - * Scalars can be used with one and only one type of field so that - * encoding standards and simple and clear. Currently only string and - * bytes fields are supported for scalars. - */ field_type: ScalarType[]; } diff --git a/__fixtures__/output1/cosmwasm/bundle.ts b/__fixtures__/output1/cosmwasm/bundle.ts index 757781e8a8..155050199a 100644 --- a/__fixtures__/output1/cosmwasm/bundle.ts +++ b/__fixtures__/output1/cosmwasm/bundle.ts @@ -4,14 +4,14 @@ import * as _149 from "./wasm/v1/proposal"; import * as _150 from "./wasm/v1/query"; import * as _151 from "./wasm/v1/tx"; import * as _152 from "./wasm/v1/types"; -import * as _435 from "./wasm/v1/tx.amino"; -import * as _436 from "./wasm/v1/tx.registry"; -import * as _437 from "./wasm/v1/query.lcd"; -import * as _438 from "./wasm/v1/query.rpc.Query"; -import * as _439 from "./wasm/v1/tx.rpc.msg"; -import * as _543 from "./lcd"; -import * as _544 from "./rpc.query"; -import * as _545 from "./rpc.tx"; +import * as _433 from "./wasm/v1/tx.amino"; +import * as _434 from "./wasm/v1/tx.registry"; +import * as _435 from "./wasm/v1/query.lcd"; +import * as _436 from "./wasm/v1/query.rpc.Query"; +import * as _437 from "./wasm/v1/tx.rpc.msg"; +import * as _540 from "./lcd"; +import * as _541 from "./rpc.query"; +import * as _542 from "./rpc.tx"; export namespace cosmwasm { export namespace wasm { export const v1 = { ..._147, @@ -20,15 +20,15 @@ export namespace cosmwasm { ..._150, ..._151, ..._152, + ..._433, + ..._434, ..._435, ..._436, - ..._437, - ..._438, - ..._439 + ..._437 }; } - export const ClientFactory = { ..._543, - ..._544, - ..._545 + export const ClientFactory = { ..._540, + ..._541, + ..._542 }; } \ No newline at end of file diff --git a/__fixtures__/output1/cosmwasm/wasm/v1/genesis.ts b/__fixtures__/output1/cosmwasm/wasm/v1/genesis.ts index c0bedbf1c3..25bfad3cc3 100644 --- a/__fixtures__/output1/cosmwasm/wasm/v1/genesis.ts +++ b/__fixtures__/output1/cosmwasm/wasm/v1/genesis.ts @@ -57,8 +57,6 @@ export interface CodeSDKType { code_id: Long; code_info?: CodeInfoSDKType; code_bytes: Uint8Array; - - /** Pinned to wasmvm cache */ pinned: boolean; } diff --git a/__fixtures__/output1/cosmwasm/wasm/v1/ibc.ts b/__fixtures__/output1/cosmwasm/wasm/v1/ibc.ts index 33c98e85c1..374ab1bfab 100644 --- a/__fixtures__/output1/cosmwasm/wasm/v1/ibc.ts +++ b/__fixtures__/output1/cosmwasm/wasm/v1/ibc.ts @@ -28,25 +28,9 @@ export interface MsgIBCSend { /** MsgIBCSend */ export interface MsgIBCSendSDKType { - /** the channel by which the packet will be sent */ channel: string; - - /** - * Timeout height relative to the current block height. - * The timeout is disabled when set to 0. - */ timeout_height: Long; - - /** - * Timeout timestamp (in nanoseconds) relative to the current block timestamp. - * The timeout is disabled when set to 0. - */ timeout_timestamp: Long; - - /** - * Data is the payload to transfer. We must not make assumption what format or - * content is in here. - */ data: Uint8Array; } diff --git a/__fixtures__/output1/cosmwasm/wasm/v1/proposal.ts b/__fixtures__/output1/cosmwasm/wasm/v1/proposal.ts index 28136a4b8f..90ae62d88e 100644 --- a/__fixtures__/output1/cosmwasm/wasm/v1/proposal.ts +++ b/__fixtures__/output1/cosmwasm/wasm/v1/proposal.ts @@ -24,19 +24,10 @@ export interface StoreCodeProposal { /** StoreCodeProposal gov proposal content type to submit WASM code to the system */ export interface StoreCodeProposalSDKType { - /** Title is a short summary */ title: string; - - /** Description is a human readable text */ description: string; - - /** RunAs is the address that is passed to the contract's environment as sender */ run_as: string; - - /** WASMByteCode can be raw or gzip compressed */ wasm_byte_code: Uint8Array; - - /** InstantiatePermission to apply on contract creation, optional */ instantiate_permission?: AccessConfigSDKType; } @@ -75,28 +66,13 @@ export interface InstantiateContractProposal { * contract. */ export interface InstantiateContractProposalSDKType { - /** Title is a short summary */ title: string; - - /** Description is a human readable text */ description: string; - - /** RunAs is the address that is passed to the contract's environment as sender */ run_as: string; - - /** Admin is an optional address that can execute migrations */ admin: string; - - /** CodeID is the reference to the stored WASM code */ code_id: Long; - - /** Label is optional metadata to be stored with a constract instance. */ label: string; - - /** Msg json encoded message to be passed to the contract on instantiation */ msg: Uint8Array; - - /** Funds coins that are transferred to the contract on instantiation */ funds: CoinSDKType[]; } @@ -120,19 +96,10 @@ export interface MigrateContractProposal { /** MigrateContractProposal gov proposal content type to migrate a contract. */ export interface MigrateContractProposalSDKType { - /** Title is a short summary */ title: string; - - /** Description is a human readable text */ description: string; - - /** Contract is the address of the smart contract */ contract: string; - - /** CodeID references the new WASM codesudo */ code_id: Long; - - /** Msg json encoded message to be passed to the contract on migration */ msg: Uint8Array; } @@ -153,16 +120,9 @@ export interface SudoContractProposal { /** SudoContractProposal gov proposal content type to call sudo on a contract. */ export interface SudoContractProposalSDKType { - /** Title is a short summary */ title: string; - - /** Description is a human readable text */ description: string; - - /** Contract is the address of the smart contract */ contract: string; - - /** Msg json encoded message to be passed to the contract as sudo */ msg: Uint8Array; } @@ -195,22 +155,11 @@ export interface ExecuteContractProposal { * contract. */ export interface ExecuteContractProposalSDKType { - /** Title is a short summary */ title: string; - - /** Description is a human readable text */ description: string; - - /** RunAs is the address that is passed to the contract's environment as sender */ run_as: string; - - /** Contract is the address of the smart contract */ contract: string; - - /** Msg json encoded message to be passed to the contract as execute */ msg: Uint8Array; - - /** Funds coins that are transferred to the contract on instantiation */ funds: CoinSDKType[]; } @@ -231,16 +180,9 @@ export interface UpdateAdminProposal { /** UpdateAdminProposal gov proposal content type to set an admin for a contract. */ export interface UpdateAdminProposalSDKType { - /** Title is a short summary */ title: string; - - /** Description is a human readable text */ description: string; - - /** NewAdmin address to be set */ new_admin: string; - - /** Contract is the address of the smart contract */ contract: string; } @@ -264,13 +206,8 @@ export interface ClearAdminProposal { * contract. */ export interface ClearAdminProposalSDKType { - /** Title is a short summary */ title: string; - - /** Description is a human readable text */ description: string; - - /** Contract is the address of the smart contract */ contract: string; } @@ -294,13 +231,8 @@ export interface PinCodesProposal { * wasmvm cache. */ export interface PinCodesProposalSDKType { - /** Title is a short summary */ title: string; - - /** Description is a human readable text */ description: string; - - /** CodeIDs references the new WASM codes */ code_ids: Long[]; } @@ -324,13 +256,8 @@ export interface UnpinCodesProposal { * the wasmvm cache. */ export interface UnpinCodesProposalSDKType { - /** Title is a short summary */ title: string; - - /** Description is a human readable text */ description: string; - - /** CodeIDs references the WASM codes */ code_ids: Long[]; } diff --git a/__fixtures__/output1/cosmwasm/wasm/v1/query.ts b/__fixtures__/output1/cosmwasm/wasm/v1/query.ts index ad8d7293d2..9431a62f4c 100644 --- a/__fixtures__/output1/cosmwasm/wasm/v1/query.ts +++ b/__fixtures__/output1/cosmwasm/wasm/v1/query.ts @@ -18,7 +18,6 @@ export interface QueryContractInfoRequest { * method */ export interface QueryContractInfoRequestSDKType { - /** address is the address of the contract to query */ address: string; } @@ -37,7 +36,6 @@ export interface QueryContractInfoResponse { * method */ export interface QueryContractInfoResponseSDKType { - /** address is the address of the contract */ address: string; contract_info?: ContractInfoSDKType; } @@ -59,10 +57,7 @@ export interface QueryContractHistoryRequest { * RPC method */ export interface QueryContractHistoryRequestSDKType { - /** address is the address of the contract to query */ address: string; - - /** pagination defines an optional pagination for the request. */ pagination?: PageRequestSDKType; } @@ -83,8 +78,6 @@ export interface QueryContractHistoryResponse { */ export interface QueryContractHistoryResponseSDKType { entries: ContractCodeHistoryEntrySDKType[]; - - /** pagination defines the pagination in the response. */ pagination?: PageResponseSDKType; } @@ -106,10 +99,6 @@ export interface QueryContractsByCodeRequest { * RPC method */ export interface QueryContractsByCodeRequestSDKType { - /** - * grpc-gateway_out does not support Go style CodID - * pagination defines an optional pagination for the request. - */ code_id: Long; pagination?: PageRequestSDKType; } @@ -131,10 +120,7 @@ export interface QueryContractsByCodeResponse { * Query/ContractsByCode RPC method */ export interface QueryContractsByCodeResponseSDKType { - /** contracts are a set of contract addresses */ contracts: string[]; - - /** pagination defines the pagination in the response. */ pagination?: PageResponseSDKType; } @@ -155,10 +141,7 @@ export interface QueryAllContractStateRequest { * Query/AllContractState RPC method */ export interface QueryAllContractStateRequestSDKType { - /** address is the address of the contract */ address: string; - - /** pagination defines an optional pagination for the request. */ pagination?: PageRequestSDKType; } @@ -179,8 +162,6 @@ export interface QueryAllContractStateResponse { */ export interface QueryAllContractStateResponseSDKType { models: ModelSDKType[]; - - /** pagination defines the pagination in the response. */ pagination?: PageResponseSDKType; } @@ -199,7 +180,6 @@ export interface QueryRawContractStateRequest { * Query/RawContractState RPC method */ export interface QueryRawContractStateRequestSDKType { - /** address is the address of the contract */ address: string; query_data: Uint8Array; } @@ -218,7 +198,6 @@ export interface QueryRawContractStateResponse { * Query/RawContractState RPC method */ export interface QueryRawContractStateResponseSDKType { - /** Data contains the raw store data */ data: Uint8Array; } @@ -239,10 +218,7 @@ export interface QuerySmartContractStateRequest { * Query/SmartContractState RPC method */ export interface QuerySmartContractStateRequestSDKType { - /** address is the address of the contract */ address: string; - - /** QueryData contains the query data passed to the contract */ query_data: Uint8Array; } @@ -260,7 +236,6 @@ export interface QuerySmartContractStateResponse { * Query/SmartContractState RPC method */ export interface QuerySmartContractStateResponseSDKType { - /** Data contains the json data returned from the smart contract */ data: Uint8Array; } @@ -272,7 +247,6 @@ export interface QueryCodeRequest { /** QueryCodeRequest is the request type for the Query/Code RPC method */ export interface QueryCodeRequestSDKType { - /** grpc-gateway_out does not support Go style CodID */ code_id: Long; } @@ -310,7 +284,6 @@ export interface QueryCodesRequest { /** QueryCodesRequest is the request type for the Query/Codes RPC method */ export interface QueryCodesRequestSDKType { - /** pagination defines an optional pagination for the request. */ pagination?: PageRequestSDKType; } @@ -325,8 +298,6 @@ export interface QueryCodesResponse { /** QueryCodesResponse is the response type for the Query/Codes RPC method */ export interface QueryCodesResponseSDKType { code_infos: CodeInfoResponseSDKType[]; - - /** pagination defines the pagination in the response. */ pagination?: PageResponseSDKType; } @@ -344,7 +315,6 @@ export interface QueryPinnedCodesRequest { * RPC method */ export interface QueryPinnedCodesRequestSDKType { - /** pagination defines an optional pagination for the request. */ pagination?: PageRequestSDKType; } @@ -365,8 +335,6 @@ export interface QueryPinnedCodesResponse { */ export interface QueryPinnedCodesResponseSDKType { code_ids: Long[]; - - /** pagination defines the pagination in the response. */ pagination?: PageResponseSDKType; } diff --git a/__fixtures__/output1/cosmwasm/wasm/v1/tx.ts b/__fixtures__/output1/cosmwasm/wasm/v1/tx.ts index c45533ee07..c014d36a9a 100644 --- a/__fixtures__/output1/cosmwasm/wasm/v1/tx.ts +++ b/__fixtures__/output1/cosmwasm/wasm/v1/tx.ts @@ -21,16 +21,8 @@ export interface MsgStoreCode { /** MsgStoreCode submit Wasm code to the system */ export interface MsgStoreCodeSDKType { - /** Sender is the that actor that signed the messages */ sender: string; - - /** WASMByteCode can be raw or gzip compressed */ wasm_byte_code: Uint8Array; - - /** - * InstantiatePermission access control to apply on contract creation, - * optional - */ instantiate_permission?: AccessConfigSDKType; } @@ -42,7 +34,6 @@ export interface MsgStoreCodeResponse { /** MsgStoreCodeResponse returns store result data. */ export interface MsgStoreCodeResponseSDKType { - /** CodeID is the reference to the stored WASM code */ code_id: Long; } @@ -75,22 +66,11 @@ export interface MsgInstantiateContract { * code id. */ export interface MsgInstantiateContractSDKType { - /** Sender is the that actor that signed the messages */ sender: string; - - /** Admin is an optional address that can execute migrations */ admin: string; - - /** CodeID is the reference to the stored WASM code */ code_id: Long; - - /** Label is optional metadata to be stored with a contract instance. */ label: string; - - /** Msg json encoded message to be passed to the contract on instantiation */ msg: Uint8Array; - - /** Funds coins that are transferred to the contract on instantiation */ funds: CoinSDKType[]; } @@ -105,10 +85,7 @@ export interface MsgInstantiateContractResponse { /** MsgInstantiateContractResponse return instantiation result data */ export interface MsgInstantiateContractResponseSDKType { - /** Address is the bech32 address of the new contract instance. */ address: string; - - /** Data contains base64-encoded bytes to returned from the contract */ data: Uint8Array; } @@ -129,16 +106,9 @@ export interface MsgExecuteContract { /** MsgExecuteContract submits the given message data to a smart contract */ export interface MsgExecuteContractSDKType { - /** Sender is the that actor that signed the messages */ sender: string; - - /** Contract is the address of the smart contract */ contract: string; - - /** Msg json encoded message to be passed to the contract */ msg: Uint8Array; - - /** Funds coins that are transferred to the contract on execution */ funds: CoinSDKType[]; } @@ -150,7 +120,6 @@ export interface MsgExecuteContractResponse { /** MsgExecuteContractResponse returns execution result data. */ export interface MsgExecuteContractResponseSDKType { - /** Data contains base64-encoded bytes to returned from the contract */ data: Uint8Array; } @@ -171,16 +140,9 @@ export interface MsgMigrateContract { /** MsgMigrateContract runs a code upgrade/ downgrade for a smart contract */ export interface MsgMigrateContractSDKType { - /** Sender is the that actor that signed the messages */ sender: string; - - /** Contract is the address of the smart contract */ contract: string; - - /** CodeID references the new WASM code */ code_id: Long; - - /** Msg json encoded message to be passed to the contract on migration */ msg: Uint8Array; } @@ -195,10 +157,6 @@ export interface MsgMigrateContractResponse { /** MsgMigrateContractResponse returns contract migration result data. */ export interface MsgMigrateContractResponseSDKType { - /** - * Data contains same raw bytes returned as data from the wasm contract. - * (May be empty) - */ data: Uint8Array; } @@ -216,13 +174,8 @@ export interface MsgUpdateAdmin { /** MsgUpdateAdmin sets a new admin for a smart contract */ export interface MsgUpdateAdminSDKType { - /** Sender is the that actor that signed the messages */ sender: string; - - /** NewAdmin address to be set */ new_admin: string; - - /** Contract is the address of the smart contract */ contract: string; } @@ -243,10 +196,7 @@ export interface MsgClearAdmin { /** MsgClearAdmin removes any admin stored for a smart contract */ export interface MsgClearAdminSDKType { - /** Sender is the that actor that signed the messages */ sender: string; - - /** Contract is the address of the smart contract */ contract: string; } diff --git a/__fixtures__/output1/cosmwasm/wasm/v1/types.ts b/__fixtures__/output1/cosmwasm/wasm/v1/types.ts index 06dd6868c5..497a218a9d 100644 --- a/__fixtures__/output1/cosmwasm/wasm/v1/types.ts +++ b/__fixtures__/output1/cosmwasm/wasm/v1/types.ts @@ -173,13 +173,8 @@ export interface CodeInfo { /** CodeInfo is data for the uploaded contract WASM code */ export interface CodeInfoSDKType { - /** CodeHash is the unique identifier created by wasmvm */ code_hash: Uint8Array; - - /** Creator address who initially stored the code */ creator: string; - - /** InstantiateConfig access control to apply on contract creation, optional */ instantiate_config?: AccessConfigSDKType; } @@ -214,30 +209,12 @@ export interface ContractInfo { /** ContractInfo stores a WASM contract instance */ export interface ContractInfoSDKType { - /** CodeID is the reference to the stored Wasm code */ code_id: Long; - - /** Creator address who initially instantiated the contract */ creator: string; - - /** Admin is an optional address that can execute migrations */ admin: string; - - /** Label is optional metadata to be stored with a contract instance. */ label: string; - - /** - * Created Tx position when the contract was instantiated. - * This data should kept internal and not be exposed via query results. Just - * use for sorting - */ created?: AbsoluteTxPositionSDKType; ibc_port_id: string; - - /** - * Extension is an extension point to store custom metadata within the - * persistence model. - */ extension?: AnySDKType; } @@ -256,11 +233,7 @@ export interface ContractCodeHistoryEntry { /** ContractCodeHistoryEntry metadata to a contract. */ export interface ContractCodeHistoryEntrySDKType { operation: ContractCodeHistoryOperationType; - - /** CodeID is the reference to the stored WASM code */ code_id: Long; - - /** Updated Tx position when the operation was executed. */ updated?: AbsoluteTxPositionSDKType; msg: Uint8Array; } @@ -285,13 +258,7 @@ export interface AbsoluteTxPosition { * ordering of transactions. */ export interface AbsoluteTxPositionSDKType { - /** BlockHeight is the block the contract was created at */ block_height: Long; - - /** - * TxIndex is a monotonic counter within the block (actual transaction index, - * or gas consumed) - */ tx_index: Long; } @@ -306,10 +273,7 @@ export interface Model { /** Model is a struct that holds a KV pair */ export interface ModelSDKType { - /** hex-encode key to read it better (this is often ascii) */ key: Uint8Array; - - /** base64-encode raw value */ value: Uint8Array; } diff --git a/__fixtures__/output1/evmos/bundle.ts b/__fixtures__/output1/evmos/bundle.ts index c16bc757e3..ee7dc24451 100644 --- a/__fixtures__/output1/evmos/bundle.ts +++ b/__fixtures__/output1/evmos/bundle.ts @@ -22,51 +22,51 @@ import * as _173 from "./recovery/v1/query"; import * as _174 from "./vesting/v1/query"; import * as _175 from "./vesting/v1/tx"; import * as _176 from "./vesting/v1/vesting"; -import * as _440 from "./erc20/v1/tx.amino"; -import * as _441 from "./fees/v1/tx.amino"; -import * as _442 from "./vesting/v1/tx.amino"; -import * as _443 from "./erc20/v1/tx.registry"; -import * as _444 from "./fees/v1/tx.registry"; -import * as _445 from "./vesting/v1/tx.registry"; -import * as _446 from "./claims/v1/query.lcd"; -import * as _447 from "./epochs/v1/query.lcd"; -import * as _448 from "./erc20/v1/query.lcd"; -import * as _449 from "./fees/v1/query.lcd"; -import * as _450 from "./incentives/v1/query.lcd"; -import * as _451 from "./inflation/v1/query.lcd"; -import * as _452 from "./recovery/v1/query.lcd"; -import * as _453 from "./vesting/v1/query.lcd"; -import * as _454 from "./claims/v1/query.rpc.Query"; -import * as _455 from "./epochs/v1/query.rpc.Query"; -import * as _456 from "./erc20/v1/query.rpc.Query"; -import * as _457 from "./fees/v1/query.rpc.Query"; -import * as _458 from "./incentives/v1/query.rpc.Query"; -import * as _459 from "./inflation/v1/query.rpc.Query"; -import * as _460 from "./recovery/v1/query.rpc.Query"; -import * as _461 from "./vesting/v1/query.rpc.Query"; -import * as _462 from "./erc20/v1/tx.rpc.msg"; -import * as _463 from "./fees/v1/tx.rpc.msg"; -import * as _464 from "./vesting/v1/tx.rpc.msg"; -import * as _546 from "./lcd"; -import * as _547 from "./custom-lcd-client"; -import * as _548 from "./rpc.query"; -import * as _549 from "./evmos-rpc-client.query"; -import * as _550 from "./rpc.tx"; -import * as _551 from "./evmos-rpc-client.tx"; +import * as _438 from "./erc20/v1/tx.amino"; +import * as _439 from "./fees/v1/tx.amino"; +import * as _440 from "./vesting/v1/tx.amino"; +import * as _441 from "./erc20/v1/tx.registry"; +import * as _442 from "./fees/v1/tx.registry"; +import * as _443 from "./vesting/v1/tx.registry"; +import * as _444 from "./claims/v1/query.lcd"; +import * as _445 from "./epochs/v1/query.lcd"; +import * as _446 from "./erc20/v1/query.lcd"; +import * as _447 from "./fees/v1/query.lcd"; +import * as _448 from "./incentives/v1/query.lcd"; +import * as _449 from "./inflation/v1/query.lcd"; +import * as _450 from "./recovery/v1/query.lcd"; +import * as _451 from "./vesting/v1/query.lcd"; +import * as _452 from "./claims/v1/query.rpc.Query"; +import * as _453 from "./epochs/v1/query.rpc.Query"; +import * as _454 from "./erc20/v1/query.rpc.Query"; +import * as _455 from "./fees/v1/query.rpc.Query"; +import * as _456 from "./incentives/v1/query.rpc.Query"; +import * as _457 from "./inflation/v1/query.rpc.Query"; +import * as _458 from "./recovery/v1/query.rpc.Query"; +import * as _459 from "./vesting/v1/query.rpc.Query"; +import * as _460 from "./erc20/v1/tx.rpc.msg"; +import * as _461 from "./fees/v1/tx.rpc.msg"; +import * as _462 from "./vesting/v1/tx.rpc.msg"; +import * as _543 from "./lcd"; +import * as _544 from "./custom-lcd-client"; +import * as _545 from "./rpc.query"; +import * as _546 from "./evmos-rpc-client.query"; +import * as _547 from "./rpc.tx"; +import * as _548 from "./evmos-rpc-client.tx"; export namespace evmos { export namespace claims { export const v1 = { ..._153, ..._154, ..._155, - ..._446, - ..._454 + ..._444, + ..._452 }; } export namespace epochs { export const v1 = { ..._156, ..._157, - ..._447, - ..._455 + ..._445, + ..._453 }; } export namespace erc20 { @@ -74,11 +74,11 @@ export namespace evmos { ..._159, ..._160, ..._161, - ..._440, - ..._443, - ..._448, - ..._456, - ..._462 + ..._438, + ..._441, + ..._446, + ..._454, + ..._460 }; } export namespace fees { @@ -86,52 +86,52 @@ export namespace evmos { ..._163, ..._164, ..._165, - ..._441, - ..._444, - ..._449, - ..._457, - ..._463 + ..._439, + ..._442, + ..._447, + ..._455, + ..._461 }; } export namespace incentives { export const v1 = { ..._166, ..._167, ..._168, - ..._450, - ..._458 + ..._448, + ..._456 }; } export namespace inflation { export const v1 = { ..._169, ..._170, ..._171, - ..._451, - ..._459 + ..._449, + ..._457 }; } export namespace recovery { export const v1 = { ..._172, ..._173, - ..._452, - ..._460 + ..._450, + ..._458 }; } export namespace vesting { export const v1 = { ..._174, ..._175, ..._176, - ..._442, - ..._445, - ..._453, - ..._461, - ..._464 + ..._440, + ..._443, + ..._451, + ..._459, + ..._462 }; } - export const ClientFactory = { ..._546, + export const ClientFactory = { ..._543, + ..._544, + ..._545, + ..._546, ..._547, - ..._548, - ..._549, - ..._550, - ..._551 + ..._548 }; } \ No newline at end of file diff --git a/__fixtures__/output1/evmos/claims/v1/claims.ts b/__fixtures__/output1/evmos/claims/v1/claims.ts index d4f08938d7..7a795aab05 100644 --- a/__fixtures__/output1/evmos/claims/v1/claims.ts +++ b/__fixtures__/output1/evmos/claims/v1/claims.ts @@ -92,13 +92,8 @@ export interface Claim { * for a given user. This is only used during client queries. */ export interface ClaimSDKType { - /** action enum */ action: Action; - - /** true if the action has been completed */ completed: boolean; - - /** claimable token amount for the action. Zero if completed */ claimable_amount: string; } @@ -116,13 +111,8 @@ export interface ClaimsRecordAddress { /** ClaimsRecordAddress is the claims metadata per address that is used at Genesis. */ export interface ClaimsRecordAddressSDKType { - /** bech32 or hex address of claim user */ address: string; - - /** total initial claimable amount for the user */ initial_claimable_amount: string; - - /** slice of the available actions completed */ actions_completed: boolean[]; } @@ -143,10 +133,7 @@ export interface ClaimsRecord { * completed actions to claim the tokens. */ export interface ClaimsRecordSDKType { - /** total initial claimable amount for the user */ initial_claimable_amount: string; - - /** slice of the available actions completed */ actions_completed: boolean[]; } diff --git a/__fixtures__/output1/evmos/claims/v1/genesis.ts b/__fixtures__/output1/evmos/claims/v1/genesis.ts index c099ead3b1..d946c8a411 100644 --- a/__fixtures__/output1/evmos/claims/v1/genesis.ts +++ b/__fixtures__/output1/evmos/claims/v1/genesis.ts @@ -16,10 +16,7 @@ export interface GenesisState { /** GenesisState define the claims module's genesis state. */ export interface GenesisStateSDKType { - /** params defines all the parameters of the module. */ params?: ParamsSDKType; - - /** list of claim records with the corresponding airdrop recipient */ claims_records: ClaimsRecordAddressSDKType[]; } @@ -52,28 +49,12 @@ export interface Params { /** Params defines the claims module's parameters. */ export interface ParamsSDKType { - /** enable claiming process */ enable_claims: boolean; - - /** timestamp of the airdrop start */ airdrop_start_time?: Date; - - /** duration until decay of claimable tokens begin */ duration_until_decay?: DurationSDKType; - - /** duration of the token claim decay period */ duration_of_decay?: DurationSDKType; - - /** denom of claimable coin */ claims_denom: string; - - /** - * list of authorized channel identifiers that can perform address - * attestations via IBC. - */ authorized_channels: string[]; - - /** list of channel identifiers from EVM compatible chains */ evm_channels: string[]; } diff --git a/__fixtures__/output1/evmos/claims/v1/query.ts b/__fixtures__/output1/evmos/claims/v1/query.ts index 16e0c4573e..f21e68c2c6 100644 --- a/__fixtures__/output1/evmos/claims/v1/query.ts +++ b/__fixtures__/output1/evmos/claims/v1/query.ts @@ -32,7 +32,6 @@ export interface QueryTotalUnclaimedResponse { * RPC method. */ export interface QueryTotalUnclaimedResponseSDKType { - /** coins defines the unclaimed coins */ coins: CoinSDKType[]; } @@ -50,7 +49,6 @@ export interface QueryParamsResponse { /** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponseSDKType { - /** params defines the parameters of the module. */ params?: ParamsSDKType; } @@ -68,7 +66,6 @@ export interface QueryClaimsRecordsRequest { * method. */ export interface QueryClaimsRecordsRequestSDKType { - /** pagination defines an optional pagination for the request. */ pagination?: PageRequestSDKType; } @@ -89,10 +86,7 @@ export interface QueryClaimsRecordsResponse { * RPC method. */ export interface QueryClaimsRecordsResponseSDKType { - /** claims defines all claims records */ claims: ClaimsRecordAddressSDKType[]; - - /** pagination defines the pagination in the response. */ pagination?: PageResponseSDKType; } @@ -110,7 +104,6 @@ export interface QueryClaimsRecordRequest { * method. */ export interface QueryClaimsRecordRequestSDKType { - /** address defines the user to query claims record for */ address: string; } @@ -131,10 +124,7 @@ export interface QueryClaimsRecordResponse { * method. */ export interface QueryClaimsRecordResponseSDKType { - /** total initial claimable amount for the user */ initial_claimable_amount: string; - - /** the claims of the user */ claims: ClaimSDKType[]; } diff --git a/__fixtures__/output1/evmos/erc20/v1/erc20.ts b/__fixtures__/output1/evmos/erc20/v1/erc20.ts index b6a4e3e1f3..2e55d39c65 100644 --- a/__fixtures__/output1/evmos/erc20/v1/erc20.ts +++ b/__fixtures__/output1/evmos/erc20/v1/erc20.ts @@ -76,16 +76,9 @@ export interface TokenPair { * Cosmos Coin and an ERC20 token address. */ export interface TokenPairSDKType { - /** address of ERC20 contract token */ erc20_address: string; - - /** cosmos base denomination to be mapped to */ denom: string; - - /** shows token mapping enable status */ enabled: boolean; - - /** ERC20 owner address ENUM (0 invalid, 1 ModuleAccount, 2 external address) */ contract_owner: Owner; } @@ -109,13 +102,8 @@ export interface RegisterCoinProposal { * native Cosmos coin. */ export interface RegisterCoinProposalSDKType { - /** title of the proposal */ title: string; - - /** proposal description */ description: string; - - /** metadata of the native Cosmos coin */ metadata?: MetadataSDKType; } @@ -139,13 +127,8 @@ export interface RegisterERC20Proposal { * ERC20 token */ export interface RegisterERC20ProposalSDKType { - /** title of the proposal */ title: string; - - /** proposal description */ description: string; - - /** contract address of ERC20 token */ erc20address: string; } @@ -172,16 +155,8 @@ export interface ToggleTokenConversionProposal { * of a token pair. */ export interface ToggleTokenConversionProposalSDKType { - /** title of the proposal */ title: string; - - /** proposal description */ description: string; - - /** - * token identifier can be either the hex contract address of the ERC20 or the - * Cosmos base denomination - */ token: string; } diff --git a/__fixtures__/output1/evmos/erc20/v1/genesis.ts b/__fixtures__/output1/evmos/erc20/v1/genesis.ts index 494065bbc9..c5565ddad4 100644 --- a/__fixtures__/output1/evmos/erc20/v1/genesis.ts +++ b/__fixtures__/output1/evmos/erc20/v1/genesis.ts @@ -14,10 +14,7 @@ export interface GenesisState { /** GenesisState defines the module's genesis state. */ export interface GenesisStateSDKType { - /** module parameters */ params?: ParamsSDKType; - - /** registered token pairs */ token_pairs: TokenPairSDKType[]; } @@ -36,14 +33,7 @@ export interface Params { /** Params defines the erc20 module params */ export interface ParamsSDKType { - /** parameter to enable the conversion of Cosmos coins <--> ERC20 tokens. */ enable_erc20: boolean; - - /** - * parameter to enable the EVM hook that converts an ERC20 token to a Cosmos - * Coin by transferring the Tokens through a MsgEthereumTx to the - * ModuleAddress Ethereum address. - */ enable_evm_hook: boolean; } diff --git a/__fixtures__/output1/evmos/erc20/v1/query.ts b/__fixtures__/output1/evmos/erc20/v1/query.ts index 2137609da0..ab518e1648 100644 --- a/__fixtures__/output1/evmos/erc20/v1/query.ts +++ b/__fixtures__/output1/evmos/erc20/v1/query.ts @@ -19,7 +19,6 @@ export interface QueryTokenPairsRequest { * method. */ export interface QueryTokenPairsRequestSDKType { - /** pagination defines an optional pagination for the request. */ pagination?: PageRequestSDKType; } @@ -40,8 +39,6 @@ export interface QueryTokenPairsResponse { */ export interface QueryTokenPairsResponseSDKType { token_pairs: TokenPairSDKType[]; - - /** pagination defines the pagination in the response. */ pagination?: PageResponseSDKType; } @@ -56,10 +53,6 @@ export interface QueryTokenPairRequest { /** QueryTokenPairRequest is the request type for the Query/TokenPair RPC method. */ export interface QueryTokenPairRequestSDKType { - /** - * token identifier can be either the hex contract address of the ERC20 or the - * Cosmos base denomination - */ token: string; } diff --git a/__fixtures__/output1/evmos/erc20/v1/tx.ts b/__fixtures__/output1/evmos/erc20/v1/tx.ts index 57def97e9b..2520599277 100644 --- a/__fixtures__/output1/evmos/erc20/v1/tx.ts +++ b/__fixtures__/output1/evmos/erc20/v1/tx.ts @@ -20,16 +20,8 @@ export interface MsgConvertCoin { /** MsgConvertCoin defines a Msg to convert a native Cosmos coin to a ERC20 token */ export interface MsgConvertCoinSDKType { - /** - * Cosmos coin which denomination is registered in a token pair. The coin - * amount defines the amount of coins to convert. - */ coin?: CoinSDKType; - - /** recipient hex address to receive ERC20 token */ receiver: string; - - /** cosmos bech32 address from the owner of the given Cosmos coins */ sender: string; } @@ -62,16 +54,9 @@ export interface MsgConvertERC20 { * coin. */ export interface MsgConvertERC20SDKType { - /** ERC20 token contract address registered in a token pair */ contract_address: string; - - /** amount of ERC20 tokens to convert */ amount: string; - - /** bech32 address to receive native Cosmos coins */ receiver: string; - - /** sender hex address from the owner of the given ERC20 tokens */ sender: string; } diff --git a/__fixtures__/output1/evmos/fees/v1/fees.ts b/__fixtures__/output1/evmos/fees/v1/fees.ts index e331989f34..2bb16c4a5b 100644 --- a/__fixtures__/output1/evmos/fees/v1/fees.ts +++ b/__fixtures__/output1/evmos/fees/v1/fees.ts @@ -25,16 +25,8 @@ export interface DevFeeInfo { * for the owner of a given smart contract */ export interface DevFeeInfoSDKType { - /** hex address of registered contract */ contract_address: string; - - /** bech32 address of contract deployer */ deployer_address: string; - - /** - * bech32 address of account receiving the transaction fees - * it defaults to deployer_address - */ withdraw_address: string; } diff --git a/__fixtures__/output1/evmos/fees/v1/genesis.ts b/__fixtures__/output1/evmos/fees/v1/genesis.ts index 89ce253563..734007f42a 100644 --- a/__fixtures__/output1/evmos/fees/v1/genesis.ts +++ b/__fixtures__/output1/evmos/fees/v1/genesis.ts @@ -14,10 +14,7 @@ export interface GenesisState { /** GenesisState defines the module's genesis state. */ export interface GenesisStateSDKType { - /** module parameters */ params?: ParamsSDKType; - - /** active registered contracts */ dev_fee_infos: DevFeeInfoSDKType[]; } @@ -50,28 +47,10 @@ export interface Params { /** Params defines the fees module params */ export interface ParamsSDKType { - /** parameter to enable fees */ enable_fees: boolean; - - /** - * developer_shares defines the proportion of the transaction fees to be - * distributed to the registered contract owner - */ developer_shares: string; - - /** - * developer_shares defines the proportion of the transaction fees to be - * distributed to validators - */ validator_shares: string; - - /** - * addr_derivation_cost_create defines the cost of address derivation for - * verifying the contract deployer at fee registration - */ addr_derivation_cost_create: Long; - - /** min_gas_price defines the minimum gas price value for cosmos and eth transactions */ min_gas_price: string; } diff --git a/__fixtures__/output1/evmos/fees/v1/query.ts b/__fixtures__/output1/evmos/fees/v1/query.ts index 89e725e46d..7d0f2d8e87 100644 --- a/__fixtures__/output1/evmos/fees/v1/query.ts +++ b/__fixtures__/output1/evmos/fees/v1/query.ts @@ -19,7 +19,6 @@ export interface QueryDevFeeInfosRequest { * method. */ export interface QueryDevFeeInfosRequestSDKType { - /** pagination defines an optional pagination for the request. */ pagination?: PageRequestSDKType; } @@ -40,8 +39,6 @@ export interface QueryDevFeeInfosResponse { */ export interface QueryDevFeeInfosResponseSDKType { fees: DevFeeInfoSDKType[]; - - /** pagination defines the pagination in the response. */ pagination?: PageResponseSDKType; } @@ -59,7 +56,6 @@ export interface QueryDevFeeInfoRequest { * method. */ export interface QueryDevFeeInfoRequestSDKType { - /** contract identifier is the hex contract address of a contract */ contract_address: string; } @@ -118,10 +114,7 @@ export interface QueryDevFeeInfosPerDeployerRequest { * Query/DevFeeInfosPerDeployer RPC method. */ export interface QueryDevFeeInfosPerDeployerRequestSDKType { - /** deployer bech32 address */ deployer_address: string; - - /** pagination defines an optional pagination for the request. */ pagination?: PageRequestSDKType; } @@ -142,8 +135,6 @@ export interface QueryDevFeeInfosPerDeployerResponse { */ export interface QueryDevFeeInfosPerDeployerResponseSDKType { fees: DevFeeInfoSDKType[]; - - /** pagination defines the pagination in the response. */ pagination?: PageResponseSDKType; } diff --git a/__fixtures__/output1/evmos/fees/v1/tx.ts b/__fixtures__/output1/evmos/fees/v1/tx.ts index 31aa40595c..bbcc54d683 100644 --- a/__fixtures__/output1/evmos/fees/v1/tx.ts +++ b/__fixtures__/output1/evmos/fees/v1/tx.ts @@ -26,23 +26,9 @@ export interface MsgRegisterDevFeeInfo { /** MsgRegisterFeesContract defines a message that registers a DevFeeInfo */ export interface MsgRegisterDevFeeInfoSDKType { - /** contract hex address */ contract_address: string; - - /** - * bech32 address of message sender, must be the same as the origin EOA - * sending the transaction which deploys the contract - */ deployer_address: string; - - /** bech32 address of account receiving the transaction fees */ withdraw_address: string; - - /** - * array of nonces from the address path, where the last nonce is - * the nonce that determines the contract's address - it can be an EOA nonce - * or a factory contract nonce - */ nonces: Long[]; } @@ -75,10 +61,7 @@ export interface MsgCancelDevFeeInfo { * DevFeeInfo */ export interface MsgCancelDevFeeInfoSDKType { - /** contract hex address */ contract_address: string; - - /** deployer bech32 address */ deployer_address: string; } @@ -108,13 +91,8 @@ export interface MsgUpdateDevFeeInfo { * a registered DevFeeInfo */ export interface MsgUpdateDevFeeInfoSDKType { - /** contract hex address */ contract_address: string; - - /** deployer bech32 address */ deployer_address: string; - - /** new withdraw bech32 address for receiving the transaction fees */ withdraw_address: string; } diff --git a/__fixtures__/output1/evmos/incentives/v1/genesis.ts b/__fixtures__/output1/evmos/incentives/v1/genesis.ts index 9ad8a9c3d2..80fe12e63e 100644 --- a/__fixtures__/output1/evmos/incentives/v1/genesis.ts +++ b/__fixtures__/output1/evmos/incentives/v1/genesis.ts @@ -17,13 +17,8 @@ export interface GenesisState { /** GenesisState defines the module's genesis state. */ export interface GenesisStateSDKType { - /** module parameters */ params?: ParamsSDKType; - - /** active incentives */ incentives: IncentiveSDKType[]; - - /** active Gasmeters */ gas_meters: GasMeterSDKType[]; } @@ -44,16 +39,9 @@ export interface Params { /** Params defines the incentives module params */ export interface ParamsSDKType { - /** parameter to enable incentives */ enable_incentives: boolean; - - /** maximum percentage an incentive can allocate per denomination */ allocation_limit: string; - - /** identifier for the epochs module hooks */ incentives_epoch_identifier: string; - - /** scaling factor for capping rewards */ reward_scaler: string; } diff --git a/__fixtures__/output1/evmos/incentives/v1/incentives.ts b/__fixtures__/output1/evmos/incentives/v1/incentives.ts index 08376b7113..00693531dc 100644 --- a/__fixtures__/output1/evmos/incentives/v1/incentives.ts +++ b/__fixtures__/output1/evmos/incentives/v1/incentives.ts @@ -30,19 +30,10 @@ export interface Incentive { * given smart contract */ export interface IncentiveSDKType { - /** contract address */ contract: string; - - /** denoms and percentage of rewards to be allocated */ allocations: DecCoinSDKType[]; - - /** number of remaining epochs */ epochs: number; - - /** distribution start time */ start_time?: Date; - - /** cumulative gas spent by all gasmeters of the incentive during the epoch */ total_gas: Long; } @@ -60,13 +51,8 @@ export interface GasMeter { /** GasMeter tracks the cumulative gas spent per participant in one epoch */ export interface GasMeterSDKType { - /** hex address of the incentivized contract */ contract: string; - - /** participant address that interacts with the incentive */ participant: string; - - /** cumulative gas spent during the epoch */ cumulative_gas: Long; } @@ -90,19 +76,10 @@ export interface RegisterIncentiveProposal { /** RegisterIncentiveProposal is a gov Content type to register an incentive */ export interface RegisterIncentiveProposalSDKType { - /** title of the proposal */ title: string; - - /** proposal description */ description: string; - - /** contract address */ contract: string; - - /** denoms and percentage of rewards to be allocated */ allocations: DecCoinSDKType[]; - - /** number of remaining epochs */ epochs: number; } @@ -120,13 +97,8 @@ export interface CancelIncentiveProposal { /** CancelIncentiveProposal is a gov Content type to cancel an incentive */ export interface CancelIncentiveProposalSDKType { - /** title of the proposal */ title: string; - - /** proposal description */ description: string; - - /** contract address */ contract: string; } diff --git a/__fixtures__/output1/evmos/incentives/v1/query.ts b/__fixtures__/output1/evmos/incentives/v1/query.ts index 10ed364efd..1065075a2c 100644 --- a/__fixtures__/output1/evmos/incentives/v1/query.ts +++ b/__fixtures__/output1/evmos/incentives/v1/query.ts @@ -20,7 +20,6 @@ export interface QueryIncentivesRequest { * method. */ export interface QueryIncentivesRequestSDKType { - /** pagination defines an optional pagination for the request. */ pagination?: PageRequestSDKType; } @@ -41,8 +40,6 @@ export interface QueryIncentivesResponse { */ export interface QueryIncentivesResponseSDKType { incentives: IncentiveSDKType[]; - - /** pagination defines the pagination in the response. */ pagination?: PageResponseSDKType; } @@ -54,7 +51,6 @@ export interface QueryIncentiveRequest { /** QueryIncentiveRequest is the request type for the Query/Incentive RPC method. */ export interface QueryIncentiveRequestSDKType { - /** contract identifier is the hex contract address of a contract */ contract: string; } @@ -91,10 +87,7 @@ export interface QueryGasMetersRequest { * method. */ export interface QueryGasMetersRequestSDKType { - /** contract is the hex contract address of a incentivized smart contract */ contract: string; - - /** pagination defines an optional pagination for the request. */ pagination?: PageRequestSDKType; } @@ -115,8 +108,6 @@ export interface QueryGasMetersResponse { */ export interface QueryGasMetersResponseSDKType { gas_meters: GasMeterSDKType[]; - - /** pagination defines the pagination in the response. */ pagination?: PageResponseSDKType; } @@ -131,10 +122,7 @@ export interface QueryGasMeterRequest { /** QueryGasMeterRequest is the request type for the Query/Incentive RPC method. */ export interface QueryGasMeterRequestSDKType { - /** contract identifier is the hex contract address of a contract */ contract: string; - - /** participant identifier is the hex address of a user */ participant: string; } @@ -155,10 +143,6 @@ export interface QueryGasMeterResponse { * method. */ export interface QueryGasMeterResponseSDKType { - /** - * QueryGasMeterResponse is the response type for the Query/Incentive RPC - * method. - */ gas_meter: Long; } @@ -176,7 +160,6 @@ export interface QueryAllocationMetersRequest { * Query/AllocationMeters RPC method. */ export interface QueryAllocationMetersRequestSDKType { - /** pagination defines an optional pagination for the request. */ pagination?: PageRequestSDKType; } @@ -197,8 +180,6 @@ export interface QueryAllocationMetersResponse { */ export interface QueryAllocationMetersResponseSDKType { allocation_meters: DecCoinSDKType[]; - - /** pagination defines the pagination in the response. */ pagination?: PageResponseSDKType; } @@ -216,7 +197,6 @@ export interface QueryAllocationMeterRequest { * RPC method. */ export interface QueryAllocationMeterRequestSDKType { - /** denom is the coin denom to query an allocation meter for. */ denom: string; } diff --git a/__fixtures__/output1/evmos/inflation/v1/genesis.ts b/__fixtures__/output1/evmos/inflation/v1/genesis.ts index 1a9d397d07..4c9ad2f64c 100644 --- a/__fixtures__/output1/evmos/inflation/v1/genesis.ts +++ b/__fixtures__/output1/evmos/inflation/v1/genesis.ts @@ -23,19 +23,10 @@ export interface GenesisState { /** GenesisState defines the inflation module's genesis state. */ export interface GenesisStateSDKType { - /** params defines all the paramaters of the module. */ params?: ParamsSDKType; - - /** amount of past periods, based on the epochs per period param */ period: Long; - - /** inflation epoch identifier */ epoch_identifier: string; - - /** number of epochs after which inflation is recalculated */ epochs_per_period: Long; - - /** number of epochs that have passed while inflation is disabled */ skipped_epochs: Long; } @@ -56,16 +47,9 @@ export interface Params { /** Params holds parameters for the inflation module. */ export interface ParamsSDKType { - /** type of coin to mint */ mint_denom: string; - - /** variables to calculate exponential inflation */ exponential_calculation?: ExponentialCalculationSDKType; - - /** inflation distribution of the minted denom */ inflation_distribution?: InflationDistributionSDKType; - - /** parameter to enable inflation and halt increasing the skipped_epochs */ enable_inflation: boolean; } diff --git a/__fixtures__/output1/evmos/inflation/v1/inflation.ts b/__fixtures__/output1/evmos/inflation/v1/inflation.ts index 3ffed18106..c28610385c 100644 --- a/__fixtures__/output1/evmos/inflation/v1/inflation.ts +++ b/__fixtures__/output1/evmos/inflation/v1/inflation.ts @@ -41,22 +41,8 @@ export interface InflationDistribution { * 0.5333333 = 40% / (1 - 25%) */ export interface InflationDistributionSDKType { - /** - * staking_rewards defines the proportion of the minted minted_denom that is - * to be allocated as staking rewards - */ staking_rewards: string; - - /** - * usage_incentives defines the proportion of the minted minted_denom that is - * to be allocated to the incentives module address - */ usage_incentives: string; - - /** - * community_pool defines the proportion of the minted minted_denom that is to - * be allocated to the community pool - */ community_pool: string; } @@ -92,19 +78,10 @@ export interface ExponentialCalculation { * (max_variance / bonding_target)) */ export interface ExponentialCalculationSDKType { - /** initial value */ a: string; - - /** reduction factor */ r: string; - - /** long term inflation */ c: string; - - /** bonding target */ bonding_target: string; - - /** max variance */ max_variance: string; } diff --git a/__fixtures__/output1/evmos/inflation/v1/query.ts b/__fixtures__/output1/evmos/inflation/v1/query.ts index ce3d7ba06f..04aa9cee7c 100644 --- a/__fixtures__/output1/evmos/inflation/v1/query.ts +++ b/__fixtures__/output1/evmos/inflation/v1/query.ts @@ -18,7 +18,6 @@ export interface QueryPeriodResponse { /** QueryPeriodResponse is the response type for the Query/Period RPC method. */ export interface QueryPeriodResponseSDKType { - /** period is the current minting per epoch provision value. */ period: Long; } @@ -48,7 +47,6 @@ export interface QueryEpochMintProvisionResponse { * Query/EpochMintProvision RPC method. */ export interface QueryEpochMintProvisionResponseSDKType { - /** epoch_mint_provision is the current minting per epoch provision value. */ epoch_mint_provision?: DecCoinSDKType; } @@ -78,7 +76,6 @@ export interface QuerySkippedEpochsResponse { * RPC method. */ export interface QuerySkippedEpochsResponseSDKType { - /** number of epochs that the inflation module has been disabled. */ skipped_epochs: Long; } @@ -108,7 +105,6 @@ export interface QueryCirculatingSupplyResponse { * Query/CirculatingSupply RPC method. */ export interface QueryCirculatingSupplyResponseSDKType { - /** total amount of coins in circulation */ circulating_supply?: DecCoinSDKType; } @@ -138,7 +134,6 @@ export interface QueryInflationRateResponse { * RPC method. */ export interface QueryInflationRateResponseSDKType { - /** rate by which the total supply increases within one period */ inflation_rate: string; } @@ -156,7 +151,6 @@ export interface QueryParamsResponse { /** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponseSDKType { - /** params defines the parameters of the module. */ params?: ParamsSDKType; } diff --git a/__fixtures__/output1/evmos/recovery/v1/genesis.ts b/__fixtures__/output1/evmos/recovery/v1/genesis.ts index f4f481c2a4..44ebf3aeb5 100644 --- a/__fixtures__/output1/evmos/recovery/v1/genesis.ts +++ b/__fixtures__/output1/evmos/recovery/v1/genesis.ts @@ -11,7 +11,6 @@ export interface GenesisState { /** GenesisState defines the recovery module's genesis state. */ export interface GenesisStateSDKType { - /** params defines all the paramaters of the module. */ params?: ParamsSDKType; } @@ -26,10 +25,7 @@ export interface Params { /** Params holds parameters for the recovery module */ export interface ParamsSDKType { - /** enable recovery IBC middleware */ enable_recovery: boolean; - - /** duration added to timeout timestamp for balances recovered via IBC packets */ packet_timeout_duration?: DurationSDKType; } diff --git a/__fixtures__/output1/evmos/recovery/v1/query.ts b/__fixtures__/output1/evmos/recovery/v1/query.ts index c1da13272c..41eb3d443a 100644 --- a/__fixtures__/output1/evmos/recovery/v1/query.ts +++ b/__fixtures__/output1/evmos/recovery/v1/query.ts @@ -17,7 +17,6 @@ export interface QueryParamsResponse { /** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponseSDKType { - /** params defines the parameters of the module. */ params?: ParamsSDKType; } diff --git a/__fixtures__/output1/evmos/vesting/v1/query.ts b/__fixtures__/output1/evmos/vesting/v1/query.ts index 41b7c0177a..68c177e1d0 100644 --- a/__fixtures__/output1/evmos/vesting/v1/query.ts +++ b/__fixtures__/output1/evmos/vesting/v1/query.ts @@ -11,7 +11,6 @@ export interface QueryBalancesRequest { /** QueryBalancesRequest is the request type for the Query/Balances RPC method. */ export interface QueryBalancesRequestSDKType { - /** address of the clawback vesting account */ address: string; } @@ -35,13 +34,8 @@ export interface QueryBalancesResponse { * method. */ export interface QueryBalancesResponseSDKType { - /** current amount of locked tokens */ locked: CoinSDKType[]; - - /** current amount of unvested tokens */ unvested: CoinSDKType[]; - - /** current amount of vested tokens */ vested: CoinSDKType[]; } diff --git a/__fixtures__/output1/evmos/vesting/v1/tx.ts b/__fixtures__/output1/evmos/vesting/v1/tx.ts index e427a8b7ed..24cd09fb3d 100644 --- a/__fixtures__/output1/evmos/vesting/v1/tx.ts +++ b/__fixtures__/output1/evmos/vesting/v1/tx.ts @@ -36,31 +36,11 @@ export interface MsgCreateClawbackVestingAccount { /** MsgCreateClawbackVestingAccount defines a message that enables creating a ClawbackVestingAccount. */ export interface MsgCreateClawbackVestingAccountSDKType { - /** - * from_address specifies the account to provide the funds and sign the - * clawback request - */ from_address: string; - - /** to_address specifies the account to receive the funds */ to_address: string; - - /** start_time defines the time at which the vesting period begins */ start_time?: Date; - - /** lockup_periods defines the unlocking schedule relative to the start_time */ lockup_periods: PeriodSDKType[]; - - /** vesting_periods defines thevesting schedule relative to the start_time */ vesting_periods: PeriodSDKType[]; - - /** - * merge specifies a the creation mechanism for existing - * ClawbackVestingAccounts. If true, merge this new grant into an existing - * ClawbackVestingAccount, or create it if it does not exist. If false, - * creates a new account. New grants to an existing account must be from the - * same from_address. - */ merge: boolean; } @@ -100,17 +80,8 @@ export interface MsgClawback { * ClawbackVestingAccount. */ export interface MsgClawbackSDKType { - /** funder_address is the address which funded the account */ funder_address: string; - - /** account_address is the address of the ClawbackVestingAccount to claw back from. */ account_address: string; - - /** - * dest_address specifies where the clawed-back tokens should be transferred - * to. If empty, the tokens will be transferred back to the original funder of - * the account. - */ dest_address: string; } diff --git a/__fixtures__/output1/evmos/vesting/v1/vesting.ts b/__fixtures__/output1/evmos/vesting/v1/vesting.ts index 512f4097ab..dc26292b54 100644 --- a/__fixtures__/output1/evmos/vesting/v1/vesting.ts +++ b/__fixtures__/output1/evmos/vesting/v1/vesting.ts @@ -37,22 +37,10 @@ export interface ClawbackVestingAccount { * of unvested tokens, or a combination (tokens vest, but are still locked). */ export interface ClawbackVestingAccountSDKType { - /** - * base_vesting_account implements the VestingAccount interface. It contains - * all the necessary fields needed for any vesting account implementation - */ base_vesting_account?: BaseVestingAccountSDKType; - - /** funder_address specifies the account which can perform clawback */ funder_address: string; - - /** start_time defines the time at which the vesting period begins */ start_time?: Date; - - /** lockup_periods defines the unlocking schedule relative to the start_time */ lockup_periods: PeriodSDKType[]; - - /** vesting_periods defines the vesting schedule relative to the start_time */ vesting_periods: PeriodSDKType[]; } diff --git a/__fixtures__/output1/google/api/auth.ts b/__fixtures__/output1/google/api/auth.ts index d87f6f08cd..756b30cb66 100644 --- a/__fixtures__/output1/google/api/auth.ts +++ b/__fixtures__/output1/google/api/auth.ts @@ -55,14 +55,7 @@ export interface Authentication { * canonical_scopes: https://www.googleapis.com/auth/calendar.read */ export interface AuthenticationSDKType { - /** - * A list of authentication rules that apply to individual API methods. - * - * **NOTE:** All service configuration rules follow "last one wins" order. - */ rules: AuthenticationRuleSDKType[]; - - /** Defines a set of authentication providers that a service supports. */ providers: AuthProviderSDKType[]; } @@ -110,23 +103,9 @@ export interface AuthenticationRule { * ignored. */ export interface AuthenticationRuleSDKType { - /** - * Selects the methods to which this rule applies. - * - * Refer to [selector][google.api.DocumentationRule.selector] for syntax details. - */ selector: string; - - /** The requirements for OAuth credentials. */ oauth?: OAuthRequirementsSDKType; - - /** - * If true, the service accepts API keys without any other credential. - * This flag only applies to HTTP and gRPC requests. - */ allow_without_credential: boolean; - - /** Requirements for additional authentication providers. */ requirements: AuthRequirementSDKType[]; } @@ -153,22 +132,8 @@ export interface JwtLocation { /** Specifies a location to extract JWT from an API request. */ export interface JwtLocationSDKType { - /** Specifies HTTP header name to extract JWT token. */ header?: string; - - /** Specifies URL query parameter name to extract JWT token. */ query?: string; - - /** - * The value prefix. The value format is "value_prefix{token}" - * Only applies to "in" header type. Must be empty for "in" query type. - * If not empty, the header value has to match (case sensitive) this prefix. - * If not matched, JWT will not be extracted. If matched, JWT will be - * extracted after the prefix is removed. - * - * For example, for "Authorization: Bearer {JWT}", - * value_prefix="Bearer " with a space at the end. - */ value_prefix: string; } @@ -267,86 +232,11 @@ export interface AuthProvider { * (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32). */ export interface AuthProviderSDKType { - /** - * The unique identifier of the auth provider. It will be referred to by - * `AuthRequirement.provider_id`. - * - * Example: "bookstore_auth". - */ id: string; - - /** - * Identifies the principal that issued the JWT. See - * https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.1 - * Usually a URL or an email address. - * - * Example: https://securetoken.google.com - * Example: 1234567-compute@developer.gserviceaccount.com - */ issuer: string; - - /** - * URL of the provider's public key set to validate signature of the JWT. See - * [OpenID - * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata). - * Optional if the key set document: - * - can be retrieved from - * [OpenID - * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html) - * of the issuer. - * - can be inferred from the email domain of the issuer (e.g. a Google - * service account). - * - * Example: https://www.googleapis.com/oauth2/v1/certs - */ jwks_uri: string; - - /** - * The list of JWT - * [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). - * that are allowed to access. A JWT containing any of these audiences will - * be accepted. When this setting is absent, JWTs with audiences: - * - "https://[service.name]/[google.protobuf.Api.name]" - * - "https://[service.name]/" - * will be accepted. - * For example, if no audiences are in the setting, LibraryService API will - * accept JWTs with the following audiences: - * - - * https://library-example.googleapis.com/google.example.library.v1.LibraryService - * - https://library-example.googleapis.com/ - * - * Example: - * - * audiences: bookstore_android.apps.googleusercontent.com, - * bookstore_web.apps.googleusercontent.com - */ audiences: string; - - /** - * Redirect URL if JWT token is required but not present or is expired. - * Implement authorizationUrl of securityDefinitions in OpenAPI spec. - */ authorization_url: string; - - /** - * Defines the locations to extract the JWT. - * - * JWT locations can be either from HTTP headers or URL query parameters. - * The rule is that the first match wins. The checking order is: checking - * all headers first, then URL query parameters. - * - * If not specified, default to use following 3 locations: - * 1) Authorization: Bearer - * 2) x-goog-iap-jwt-assertion - * 3) access_token query parameter - * - * Default locations can be specified as followings: - * jwt_locations: - * - header: Authorization - * value_prefix: "Bearer " - * - header: x-goog-iap-jwt-assertion - * - query: access_token - */ jwt_locations: JwtLocationSDKType[]; } @@ -404,15 +294,6 @@ export interface OAuthRequirements { * due to the backend requiring additional scopes or permissions. */ export interface OAuthRequirementsSDKType { - /** - * The list of publicly documented OAuth scopes that are allowed access. An - * OAuth token containing any of these scopes will be accepted. - * - * Example: - * - * canonical_scopes: https://www.googleapis.com/auth/calendar, - * https://www.googleapis.com/auth/calendar.read - */ canonical_scopes: string; } @@ -458,33 +339,7 @@ export interface AuthRequirement { * (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32). */ export interface AuthRequirementSDKType { - /** - * [id][google.api.AuthProvider.id] from authentication provider. - * - * Example: - * - * provider_id: bookstore_auth - */ provider_id: string; - - /** - * NOTE: This will be deprecated soon, once AuthProvider.audiences is - * implemented and accepted in all the runtime components. - * - * The list of JWT - * [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). - * that are allowed to access. A JWT containing any of these audiences will - * be accepted. When this setting is absent, only JWTs with audience - * "https://[Service_name][google.api.Service.name]/[API_name][google.protobuf.Api.name]" - * will be accepted. For example, if no audiences are in the setting, - * LibraryService API will only accept JWTs with the following audience - * "https://library-example.googleapis.com/google.example.library.v1.LibraryService". - * - * Example: - * - * audiences: bookstore_android.apps.googleusercontent.com, - * bookstore_web.apps.googleusercontent.com - */ audiences: string; } diff --git a/__fixtures__/output1/google/api/backend.ts b/__fixtures__/output1/google/api/backend.ts index 4416bde370..f88c5aa48e 100644 --- a/__fixtures__/output1/google/api/backend.ts +++ b/__fixtures__/output1/google/api/backend.ts @@ -115,11 +115,6 @@ export interface Backend { /** `Backend` defines the backend configuration for a service. */ export interface BackendSDKType { - /** - * A list of API backend rules that apply to individual API methods. - * - * **NOTE:** All service configuration rules follow "last one wins" order. - */ rules: BackendRuleSDKType[]; } @@ -218,94 +213,14 @@ export interface BackendRule { /** A backend rule provides configuration for an individual API element. */ export interface BackendRuleSDKType { - /** - * Selects the methods to which this rule applies. - * - * Refer to [selector][google.api.DocumentationRule.selector] for syntax details. - */ selector: string; - - /** - * The address of the API backend. - * - * The scheme is used to determine the backend protocol and security. - * The following schemes are accepted: - * - * SCHEME PROTOCOL SECURITY - * http:// HTTP None - * https:// HTTP TLS - * grpc:// gRPC None - * grpcs:// gRPC TLS - * - * It is recommended to explicitly include a scheme. Leaving out the scheme - * may cause constrasting behaviors across platforms. - * - * If the port is unspecified, the default is: - * - 80 for schemes without TLS - * - 443 for schemes with TLS - * - * For HTTP backends, use [protocol][google.api.BackendRule.protocol] - * to specify the protocol version. - */ address: string; - - /** - * The number of seconds to wait for a response from a request. The default - * varies based on the request protocol and deployment environment. - */ deadline: number; - - /** - * Minimum deadline in seconds needed for this method. Calls having deadline - * value lower than this will be rejected. - */ min_deadline: number; - - /** - * The number of seconds to wait for the completion of a long running - * operation. The default is no deadline. - */ operation_deadline: number; path_translation: BackendRule_PathTranslation; - - /** - * The JWT audience is used when generating a JWT ID token for the backend. - * This ID token will be added in the HTTP "authorization" header, and sent - * to the backend. - */ jwt_audience?: string; - - /** - * When disable_auth is true, a JWT ID token won't be generated and the - * original "Authorization" HTTP header will be preserved. If the header is - * used to carry the original token and is expected by the backend, this - * field must be set to true to preserve the header. - */ disable_auth?: boolean; - - /** - * The protocol used for sending a request to the backend. - * The supported values are "http/1.1" and "h2". - * - * The default value is inferred from the scheme in the - * [address][google.api.BackendRule.address] field: - * - * SCHEME PROTOCOL - * http:// http/1.1 - * https:// http/1.1 - * grpc:// h2 - * grpcs:// h2 - * - * For secure HTTP backends (https://) that support HTTP/2, set this field - * to "h2" for improved performance. - * - * Configuring this field to non-default values is only supported for secure - * HTTP backends. This field will be ignored for all other backends. - * - * See - * https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids - * for more details on the supported values. - */ protocol: string; } diff --git a/__fixtures__/output1/google/api/billing.ts b/__fixtures__/output1/google/api/billing.ts index c7eb34e00b..fccd272fed 100644 --- a/__fixtures__/output1/google/api/billing.ts +++ b/__fixtures__/output1/google/api/billing.ts @@ -81,12 +81,6 @@ export interface Billing { * - library.googleapis.com/book/borrowed_count */ export interface BillingSDKType { - /** - * Billing configurations for sending metrics to the consumer project. - * There can be multiple consumer destinations per service, each one must have - * a different monitored resource type. A metric can be used in at most - * one consumer destination. - */ consumer_destinations: Billing_BillingDestinationSDKType[]; } @@ -113,16 +107,7 @@ export interface Billing_BillingDestination { * bill against consumer project). */ export interface Billing_BillingDestinationSDKType { - /** - * The monitored resource type. The type must be defined in - * [Service.monitored_resources][google.api.Service.monitored_resources] section. - */ monitored_resource: string; - - /** - * Names of the metrics to report to this billing destination. - * Each name must be defined in [Service.metrics][google.api.Service.metrics] section. - */ metrics: string[]; } diff --git a/__fixtures__/output1/google/api/config_change.ts b/__fixtures__/output1/google/api/config_change.ts index 3a9cfdd603..0368df67c8 100644 --- a/__fixtures__/output1/google/api/config_change.ts +++ b/__fixtures__/output1/google/api/config_change.ts @@ -127,38 +127,10 @@ export interface ConfigChange { * backwards-incompatibility. */ export interface ConfigChangeSDKType { - /** - * Object hierarchy path to the change, with levels separated by a '.' - * character. For repeated fields, an applicable unique identifier field is - * used for the index (usually selector, name, or id). For maps, the term - * 'key' is used. If the field has no unique identifier, the numeric index - * is used. - * Examples: - * - visibility.rules[selector=="google.LibraryService.ListBooks"].restriction - * - quota.metric_rules[selector=="google"].metric_costs[key=="reads"].value - * - logging.producer_destinations[0] - */ element: string; - - /** - * Value of the changed object in the old Service configuration, - * in JSON format. This field will not be populated if ChangeType == ADDED. - */ old_value: string; - - /** - * Value of the changed object in the new Service configuration, - * in JSON format. This field will not be populated if ChangeType == REMOVED. - */ new_value: string; - - /** The type for this change, either ADDED, REMOVED, or MODIFIED. */ change_type: ChangeType; - - /** - * Collection of advice provided for this change, useful for determining the - * possible impact of this change. - */ advices: AdviceSDKType[]; } @@ -179,10 +151,6 @@ export interface Advice { * information about how a change will affect the existing service. */ export interface AdviceSDKType { - /** - * Useful description for why this advice was applied and what actions should - * be taken to mitigate any implied risks. - */ description: string; } diff --git a/__fixtures__/output1/google/api/consumer.ts b/__fixtures__/output1/google/api/consumer.ts index 974b34e097..787e38bafe 100644 --- a/__fixtures__/output1/google/api/consumer.ts +++ b/__fixtures__/output1/google/api/consumer.ts @@ -114,7 +114,6 @@ export interface ProjectProperties { * type: INT64 */ export interface ProjectPropertiesSDKType { - /** List of per consumer project-specific properties. */ properties: PropertySDKType[]; } @@ -154,13 +153,8 @@ export interface Property { * define and set these properties. */ export interface PropertySDKType { - /** The name of the property (a.k.a key). */ name: string; - - /** The type of this property. */ type: Property_PropertyType; - - /** The description of the property */ description: string; } diff --git a/__fixtures__/output1/google/api/context.ts b/__fixtures__/output1/google/api/context.ts index 139ee790a6..f47d7ae602 100644 --- a/__fixtures__/output1/google/api/context.ts +++ b/__fixtures__/output1/google/api/context.ts @@ -88,11 +88,6 @@ export interface Context { * here. */ export interface ContextSDKType { - /** - * A list of RPC context rules that apply to individual API methods. - * - * **NOTE:** All service configuration rules follow "last one wins" order. - */ rules: ContextRuleSDKType[]; } @@ -132,29 +127,10 @@ export interface ContextRule { * element. */ export interface ContextRuleSDKType { - /** - * Selects the methods to which this rule applies. - * - * Refer to [selector][google.api.DocumentationRule.selector] for syntax details. - */ selector: string; - - /** A list of full type names of requested contexts. */ requested: string[]; - - /** A list of full type names of provided contexts. */ provided: string[]; - - /** - * A list of full type names or extension IDs of extensions allowed in grpc - * side channel from client to backend. - */ allowed_request_extensions: string[]; - - /** - * A list of full type names or extension IDs of extensions allowed in grpc - * side channel from backend to client. - */ allowed_response_extensions: string[]; } diff --git a/__fixtures__/output1/google/api/control.ts b/__fixtures__/output1/google/api/control.ts index 0ea506f42f..25b0244003 100644 --- a/__fixtures__/output1/google/api/control.ts +++ b/__fixtures__/output1/google/api/control.ts @@ -21,10 +21,6 @@ export interface Control { * monitoring, etc. */ export interface ControlSDKType { - /** - * The service control environment to use. If empty, no control plane - * feature (like quota and billing) will be enabled. - */ environment: string; } diff --git a/__fixtures__/output1/google/api/distribution.ts b/__fixtures__/output1/google/api/distribution.ts index 7856c7b962..d0130c1d7f 100644 --- a/__fixtures__/output1/google/api/distribution.ts +++ b/__fixtures__/output1/google/api/distribution.ts @@ -99,64 +99,12 @@ export interface Distribution { * will render the `mean` and `sum_of_squared_deviation` fields meaningless. */ export interface DistributionSDKType { - /** - * The number of values in the population. Must be non-negative. This value - * must equal the sum of the values in `bucket_counts` if a histogram is - * provided. - */ count: Long; - - /** - * The arithmetic mean of the values in the population. If `count` is zero - * then this field must be zero. - */ mean: number; - - /** - * The sum of squared deviations from the mean of the values in the - * population. For values x_i this is: - * - * Sum[i=1..n]((x_i - mean)^2) - * - * Knuth, "The Art of Computer Programming", Vol. 2, page 232, 3rd edition - * describes Welford's method for accumulating this sum in one pass. - * - * If `count` is zero then this field must be zero. - */ sum_of_squared_deviation: number; - - /** - * If specified, contains the range of the population values. The field - * must not be present if the `count` is zero. - */ range?: Distribution_RangeSDKType; - - /** - * Defines the histogram bucket boundaries. If the distribution does not - * contain a histogram, then omit this field. - */ bucket_options?: Distribution_BucketOptionsSDKType; - - /** - * The number of values in each bucket of the histogram, as described in - * `bucket_options`. If the distribution does not have a histogram, then omit - * this field. If there is a histogram, then the sum of the values in - * `bucket_counts` must equal the value in the `count` field of the - * distribution. - * - * If present, `bucket_counts` should contain N values, where N is the number - * of buckets specified in `bucket_options`. If you supply fewer than N - * values, the remaining values are assumed to be 0. - * - * The order of the values in `bucket_counts` follows the bucket numbering - * schemes described for the three bucket types. The first value must be the - * count for the underflow bucket (number 0). The next N-2 values are the - * counts for the finite buckets (number 1 through N-2). The N'th value in - * `bucket_counts` is the count for the overflow bucket (number N-1). - */ bucket_counts: Long[]; - - /** Must be in increasing order of `value` field. */ exemplars: Distribution_ExemplarSDKType[]; } @@ -171,10 +119,7 @@ export interface Distribution_Range { /** The range of the population values. */ export interface Distribution_RangeSDKType { - /** The minimum of the population values. */ min: number; - - /** The maximum of the population values. */ max: number; } @@ -224,13 +169,8 @@ export interface Distribution_BucketOptions { * so-called because both bounds are finite. */ export interface Distribution_BucketOptionsSDKType { - /** The linear bucket. */ linear_buckets?: Distribution_BucketOptions_LinearSDKType; - - /** The exponential buckets. */ exponential_buckets?: Distribution_BucketOptions_ExponentialSDKType; - - /** The explicit buckets. */ explicit_buckets?: Distribution_BucketOptions_ExplicitSDKType; } @@ -268,13 +208,8 @@ export interface Distribution_BucketOptions_Linear { * Lower bound (1 <= i < N): offset + (width * (i - 1)). */ export interface Distribution_BucketOptions_LinearSDKType { - /** Must be greater than 0. */ num_finite_buckets: number; - - /** Must be greater than 0. */ width: number; - - /** Lower bound of the first bucket. */ offset: number; } @@ -312,13 +247,8 @@ export interface Distribution_BucketOptions_Exponential { * Lower bound (1 <= i < N): scale * (growth_factor ^ (i - 1)). */ export interface Distribution_BucketOptions_ExponentialSDKType { - /** Must be greater than 0. */ num_finite_buckets: number; - - /** Must be greater than 1. */ growth_factor: number; - - /** Must be greater than 0. */ scale: number; } @@ -354,7 +284,6 @@ export interface Distribution_BucketOptions_Explicit { * element is the common boundary of the overflow and underflow buckets. */ export interface Distribution_BucketOptions_ExplicitSDKType { - /** The values must be monotonically increasing. */ bounds: number[]; } @@ -399,28 +328,8 @@ export interface Distribution_Exemplar { * such as a example values and timestamps, origin, etc. */ export interface Distribution_ExemplarSDKType { - /** - * Value of the exemplar point. This value determines to which bucket the - * exemplar belongs. - */ value: number; - - /** The observation (sampling) time of the above value. */ timestamp?: Date; - - /** - * Contextual information about the example value. Examples are: - * - * Trace: type.googleapis.com/google.monitoring.v3.SpanContext - * - * Literal string: type.googleapis.com/google.protobuf.StringValue - * - * Labels dropped during aggregation: - * type.googleapis.com/google.monitoring.v3.DroppedLabels - * - * There may be only a single attachment of any given message type in a - * single exemplar, and this is enforced by the system. - */ attachments: AnySDKType[]; } diff --git a/__fixtures__/output1/google/api/documentation.ts b/__fixtures__/output1/google/api/documentation.ts index fec82e1325..6a8dff0189 100644 --- a/__fixtures__/output1/google/api/documentation.ts +++ b/__fixtures__/output1/google/api/documentation.ts @@ -163,48 +163,11 @@ export interface Documentation { * and is documented together with service config validation. */ export interface DocumentationSDKType { - /** - * A short summary of what the service does. Can only be provided by - * plain text. - */ summary: string; - - /** The top level pages for the documentation set. */ pages: PageSDKType[]; - - /** - * A list of documentation rules that apply to individual API elements. - * - * **NOTE:** All service configuration rules follow "last one wins" order. - */ rules: DocumentationRuleSDKType[]; - - /** The URL to the root of documentation. */ documentation_root_url: string; - - /** - * Specifies the service root url if the default one (the service name - * from the yaml file) is not suitable. This can be seen in any fully - * specified service urls as well as sections that show a base that other - * urls are relative to. - */ service_root_url: string; - - /** - * Declares a single overview page. For example: - *
documentation:
-   *   summary: ...
-   *   overview: (== include overview.md ==)
-   * 
- * This is a shortcut for the following declaration (using pages style): - *
documentation:
-   *   summary: ...
-   *   pages:
-   *   - name: Overview
-   *     content: (== include overview.md ==)
-   * 
- * Note: you cannot specify both `overview` field and `pages` field. - */ overview: string; } @@ -232,23 +195,8 @@ export interface DocumentationRule { /** A documentation rule provides information about individual API elements. */ export interface DocumentationRuleSDKType { - /** - * The selector is a comma-separated list of patterns. Each pattern is a - * qualified name of the element which may end in "*", indicating a wildcard. - * Wildcards are only allowed at the end and for a whole component of the - * qualified name, i.e. "foo.*" is ok, but not "foo.b*" or "foo.*.bar". A - * wildcard will match one or more components. To specify a default for all - * applicable elements, the whole pattern "*" is used. - */ selector: string; - - /** Description of the selected API(s). */ description: string; - - /** - * Deprecation description of the selected element(s). It can be provided if - * an element is marked as `deprecated`. - */ deprecation_description: string; } @@ -293,34 +241,8 @@ export interface Page { * nested documentation set structure. */ export interface PageSDKType { - /** - * The name of the page. It will be used as an identity of the page to - * generate URI of the page, text of the link to this page in navigation, - * etc. The full page name (start from the root page name to this page - * concatenated with `.`) can be used as reference to the page in your - * documentation. For example: - *
pages:
-   * - name: Tutorial
-   *   content: (== include tutorial.md ==)
-   *   subpages:
-   *   - name: Java
-   *     content: (== include tutorial_java.md ==)
-   * 
- * You can reference `Java` page using Markdown reference link syntax: - * `[Java][Tutorial.Java]`. - */ name: string; - - /** - * The Markdown content of the page. You can use (== include {path} - * ==) to include content from a Markdown file. - */ content: string; - - /** - * Subpages of this page. The order of subpages specified here will be - * honored in the generated docset. - */ subpages: PageSDKType[]; } diff --git a/__fixtures__/output1/google/api/endpoint.ts b/__fixtures__/output1/google/api/endpoint.ts index b6a66035ab..9f24686255 100644 --- a/__fixtures__/output1/google/api/endpoint.ts +++ b/__fixtures__/output1/google/api/endpoint.ts @@ -76,39 +76,11 @@ export interface Endpoint { * allow_cors: true */ export interface EndpointSDKType { - /** The canonical name of this endpoint. */ name: string; - /** - * Unimplemented. Dot not use. - * - * DEPRECATED: This field is no longer supported. Instead of using aliases, - * please specify multiple [google.api.Endpoint][google.api.Endpoint] for each of the intended - * aliases. - * - * Additional names that this endpoint will be hosted on. - */ - /** @deprecated */ aliases: string[]; - - /** - * The specification of an Internet routable address of API frontend that will - * handle requests to this [API - * Endpoint](https://cloud.google.com/apis/design/glossary). It should be - * either a valid IPv4 address or a fully-qualified domain name. For example, - * "8.8.8.8" or "myservice.appspot.com". - */ target: string; - - /** - * Allowing - * [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing), aka - * cross-domain traffic, would allow the backends served from this endpoint to - * receive and respond to HTTP OPTIONS requests. The response will be used by - * the browser to determine whether the subsequent cross-origin request is - * allowed to proceed. - */ allow_cors: boolean; } diff --git a/__fixtures__/output1/google/api/expr/conformance/v1alpha1/conformance_service.ts b/__fixtures__/output1/google/api/expr/conformance/v1alpha1/conformance_service.ts index 1b2acc2aa4..3312812c06 100644 --- a/__fixtures__/output1/google/api/expr/conformance/v1alpha1/conformance_service.ts +++ b/__fixtures__/output1/google/api/expr/conformance/v1alpha1/conformance_service.ts @@ -86,16 +86,9 @@ export interface ParseRequest { /** Request message for the Parse method. */ export interface ParseRequestSDKType { - /** Required. Source text in CEL syntax. */ cel_source: string; - - /** Tag for version of CEL syntax, for future use. */ syntax_version: string; - - /** File or resource for source text, used in [SourceInfo][google.api.SourceInfo]. */ source_location: string; - - /** Prevent macro expansion. See "Macros" in Language Defiinition. */ disable_macros: boolean; } @@ -110,10 +103,7 @@ export interface ParseResponse { /** Response message for the Parse method. */ export interface ParseResponseSDKType { - /** The parsed representation, or unset if parsing failed. */ parsed_expr?: ParsedExprSDKType; - - /** Any number of issues with [StatusDetails][] as the details. */ issues: StatusSDKType[]; } @@ -145,27 +135,9 @@ export interface CheckRequest { /** Request message for the Check method. */ export interface CheckRequestSDKType { - /** Required. The parsed representation of the CEL program. */ parsed_expr?: ParsedExprSDKType; - - /** - * Declarations of types for external variables and functions. - * Required if program uses external variables or functions - * not in the default environment. - */ type_env: DeclSDKType[]; - - /** - * The protocol buffer context. See "Name Resolution" in the - * Language Definition. - */ container: string; - - /** - * If true, use only the declarations in [type_env][google.api.expr.conformance.v1alpha1.CheckRequest.type_env]. If false (default), - * add declarations for the standard definitions to the type environment. See - * "Standard Definitions" in the Language Definition. - */ no_std_env: boolean; } @@ -180,10 +152,7 @@ export interface CheckResponse { /** Response message for the Check method. */ export interface CheckResponseSDKType { - /** The annotated representation, or unset if checking failed. */ checked_expr?: CheckedExprSDKType; - - /** Any number of issues with [StatusDetails][] as the details. */ issues: StatusSDKType[]; } export interface EvalRequest_BindingsEntry { @@ -217,21 +186,11 @@ export interface EvalRequest { /** Request message for the Eval method. */ export interface EvalRequestSDKType { - /** Evaluate based on the parsed representation. */ parsed_expr?: ParsedExprSDKType; - - /** Evaluate based on the checked representation. */ checked_expr?: CheckedExprSDKType; - - /** - * Bindings for the external variables. The types SHOULD be compatible - * with the type environment in [CheckRequest][google.api.expr.conformance.v1alpha1.CheckRequest], if checked. - */ bindings?: { [key: string]: ExprValueSDKType; }; - - /** SHOULD be the same container as used in [CheckRequest][google.api.expr.conformance.v1alpha1.CheckRequest], if checked. */ container: string; } @@ -251,15 +210,7 @@ export interface EvalResponse { /** Response message for the Eval method. */ export interface EvalResponseSDKType { - /** The execution result, or unset if execution couldn't start. */ result?: ExprValueSDKType; - - /** - * Any number of issues with [StatusDetails][] as the details. - * Note that CEL execution errors are reified into [ExprValue][]. - * Nevertheless, we'll allow out-of-band issues to be raised, - * which also makes the replies more regular. - */ issues: StatusSDKType[]; } @@ -285,13 +236,8 @@ export interface IssueDetails { * in the details field. */ export interface IssueDetailsSDKType { - /** The severity of the issue. */ severity: IssueDetails_Severity; - - /** Position in the source, if known. */ position?: SourcePositionSDKType; - - /** Expression ID from [Expr][], 0 if unknown. */ id: Long; } diff --git a/__fixtures__/output1/google/api/expr/v1alpha1/checked.ts b/__fixtures__/output1/google/api/expr/v1alpha1/checked.ts index 1c4c69bff2..751fcb1587 100644 --- a/__fixtures__/output1/google/api/expr/v1alpha1/checked.ts +++ b/__fixtures__/output1/google/api/expr/v1alpha1/checked.ts @@ -249,59 +249,14 @@ export interface CheckedExpr { /** A CEL expression which has been successfully type checked. */ export interface CheckedExprSDKType { - /** - * A map from expression ids to resolved references. - * - * The following entries are in this table: - * - * - An Ident or Select expression is represented here if it resolves to a - * declaration. For instance, if `a.b.c` is represented by - * `select(select(id(a), b), c)`, and `a.b` resolves to a declaration, - * while `c` is a field selection, then the reference is attached to the - * nested select expression (but not to the id or or the outer select). - * In turn, if `a` resolves to a declaration and `b.c` are field selections, - * the reference is attached to the ident expression. - * - Every Call expression has an entry here, identifying the function being - * called. - * - Every CreateStruct expression for a message has an entry, identifying - * the message. - */ reference_map?: { [key: Long]: ReferenceSDKType; }; - - /** - * A map from expression ids to types. - * - * Every expression node which has a type different than DYN has a mapping - * here. If an expression has type DYN, it is omitted from this map to save - * space. - */ type_map?: { [key: Long]: TypeSDKType; }; - - /** - * The source info derived from input that generated the parsed `expr` and - * any optimizations made during the type-checking pass. - */ source_info?: SourceInfoSDKType; - - /** - * The expr version indicates the major / minor version number of the `expr` - * representation. - * - * The most common reason for a version change will be to indicate to the CEL - * runtimes that transformations have been performed on the expr during static - * analysis. In some cases, this will save the runtime the work of applying - * the same or similar transformations prior to evaluation. - */ expr_version: string; - - /** - * The checked expression. Semantically equivalent to the parsed `expr`, but - * may have structural differences. - */ expr?: ExprSDKType; } @@ -371,65 +326,18 @@ export interface Type { /** Represents a CEL type. */ export interface TypeSDKType { - /** Dynamic type. */ dyn?: EmptySDKType; - - /** Null value. */ null?: NullValue; - - /** Primitive types: `true`, `1u`, `-2.0`, `'string'`, `b'bytes'`. */ primitive?: Type_PrimitiveType; - - /** Wrapper of a primitive type, e.g. `google.protobuf.Int64Value`. */ wrapper?: Type_PrimitiveType; - - /** Well-known protobuf type such as `google.protobuf.Timestamp`. */ well_known?: Type_WellKnownType; - - /** Parameterized list with elements of `list_type`, e.g. `list`. */ list_type?: Type_ListTypeSDKType; - - /** Parameterized map with typed keys and values. */ map_type?: Type_MapTypeSDKType; - - /** Function type. */ function?: Type_FunctionTypeSDKType; - - /** - * Protocol buffer message type. - * - * The `message_type` string specifies the qualified message type name. For - * example, `google.plus.Profile`. - */ message_type?: string; - - /** - * Type param type. - * - * The `type_param` string specifies the type parameter name, e.g. `list` - * would be a `list_type` whose element type was a `type_param` type - * named `E`. - */ type_param?: string; - - /** - * Type type. - * - * The `type` value specifies the target type. e.g. int is type with a - * target type of `Primitive.INT`. - */ type?: TypeSDKType; - - /** - * Error type. - * - * During type-checking if an expression is an error, its type is propagated - * as the `ERROR` type. This permits the type-checker to discover other - * errors present in the expression. - */ error?: EmptySDKType; - - /** Abstract, application defined type. */ abstract_type?: Type_AbstractTypeSDKType; } @@ -441,7 +349,6 @@ export interface Type_ListType { /** List type with typed elements, e.g. `list`. */ export interface Type_ListTypeSDKType { - /** The element type. */ elem_type?: TypeSDKType; } @@ -456,10 +363,7 @@ export interface Type_MapType { /** Map type with parameterized key and value types, e.g. `map`. */ export interface Type_MapTypeSDKType { - /** The type of the key. */ key_type?: TypeSDKType; - - /** The type of the value. */ value_type?: TypeSDKType; } @@ -474,10 +378,7 @@ export interface Type_FunctionType { /** Function type with result and arg types. */ export interface Type_FunctionTypeSDKType { - /** Result type of the function. */ result_type?: TypeSDKType; - - /** Argument types of the function. */ arg_types: TypeSDKType[]; } @@ -492,10 +393,7 @@ export interface Type_AbstractType { /** Application defined abstract type. */ export interface Type_AbstractTypeSDKType { - /** The fully qualified name of this abstract type. */ name: string; - - /** Parameter types for this abstract type. */ parameter_types: TypeSDKType[]; } @@ -532,22 +430,8 @@ export interface Decl { * evaluating that expression, and the caller requesting evaluation. */ export interface DeclSDKType { - /** - * The fully qualified name of the declaration. - * - * Declarations are organized in containers and this represents the full path - * to the declaration in its container, as in `google.api.expr.Decl`. - * - * Declarations used as [FunctionDecl.Overload][google.api.expr.v1alpha1.Decl.FunctionDecl.Overload] parameters may or may not - * have a name depending on whether the overload is function declaration or a - * function definition containing a result [Expr][google.api.expr.v1alpha1.Expr]. - */ name: string; - - /** Identifier declaration. */ ident?: Decl_IdentDeclSDKType; - - /** Function declaration. */ function?: Decl_FunctionDeclSDKType; } @@ -582,16 +466,8 @@ export interface Decl_IdentDecl { * time. */ export interface Decl_IdentDeclSDKType { - /** Required. The type of the identifier. */ type?: TypeSDKType; - - /** - * The constant value of the identifier. If not specified, the identifier - * must be supplied at evaluation time. - */ value?: ConstantSDKType; - - /** Documentation string for the identifier. */ doc: string; } @@ -615,7 +491,6 @@ export interface Decl_FunctionDecl { * logging which are not observable from CEL). */ export interface Decl_FunctionDeclSDKType { - /** Required. List of function overloads, must contain at least one overload. */ overloads: Decl_FunctionDecl_OverloadSDKType[]; } @@ -695,53 +570,11 @@ export interface Decl_FunctionDecl_Overload { * parameterized type variables (similar as type erasure in Java). */ export interface Decl_FunctionDecl_OverloadSDKType { - /** - * Required. Globally unique overload name of the function which reflects - * the function name and argument types. - * - * This will be used by a [Reference][google.api.expr.v1alpha1.Reference] to indicate the `overload_id` that - * was resolved for the function `name`. - */ overload_id: string; - - /** - * List of function parameter [Type][google.api.expr.v1alpha1.Type] values. - * - * Param types are disjoint after generic type parameters have been - * replaced with the type `DYN`. Since the `DYN` type is compatible with - * any other type, this means that if `A` is a type parameter, the - * function types `int` and `int` are not disjoint. Likewise, - * `map` is not disjoint from `map`. - * - * When the `result_type` of a function is a generic type param, the - * type param name also appears as the `type` of on at least one params. - */ params: TypeSDKType[]; - - /** - * The type param names associated with the function declaration. - * - * For example, `function ex(K key, map map) : V` would yield - * the type params of `K, V`. - */ type_params: string[]; - - /** - * Required. The result type of the function. For example, the operator - * `string.isEmpty()` would have `result_type` of `kind: BOOL`. - */ result_type?: TypeSDKType; - - /** - * Whether the function is to be used in a method call-style `x.f(...)` - * of a function call-style `f(x, ...)`. - * - * For methods, the first parameter declaration, `params[0]` is the - * expected type of the target receiver. - */ is_instance_function: boolean; - - /** Documentation string for the overload. */ doc: string; } @@ -771,25 +604,8 @@ export interface Reference { /** Describes a resolved reference to a declaration. */ export interface ReferenceSDKType { - /** The fully qualified name of the declaration. */ name: string; - - /** - * For references to functions, this is a list of `Overload.overload_id` - * values which match according to typing rules. - * - * If the list has more than one element, overload resolution among the - * presented candidates must happen at runtime because of dynamic types. The - * type checker attempts to narrow down this list as much as possible. - * - * Empty if this is not a reference to a [Decl.FunctionDecl][google.api.expr.v1alpha1.Decl.FunctionDecl]. - */ overload_id: string[]; - - /** - * For references to constants, this may contain the value of the - * constant if known at compile time. - */ value?: ConstantSDKType; } diff --git a/__fixtures__/output1/google/api/expr/v1alpha1/eval.ts b/__fixtures__/output1/google/api/expr/v1alpha1/eval.ts index b9e66b48f4..59e2377808 100644 --- a/__fixtures__/output1/google/api/expr/v1alpha1/eval.ts +++ b/__fixtures__/output1/google/api/expr/v1alpha1/eval.ts @@ -28,15 +28,7 @@ export interface EvalState { * Can represent an inital, partial, or completed state of evaluation. */ export interface EvalStateSDKType { - /** The unique values referenced in this message. */ values: ExprValueSDKType[]; - - /** - * An ordered list of results. - * - * Tracks the flow of evaluation through the expression. - * May be sparse. - */ results: EvalState_ResultSDKType[]; } @@ -51,10 +43,7 @@ export interface EvalState_Result { /** A single evalution result. */ export interface EvalState_ResultSDKType { - /** The id of the expression this result if for. */ expr: Long; - - /** The index in `values` of the resulting value. */ value: Long; } @@ -114,55 +103,8 @@ export interface ExprValue { /** The value of an evaluated expression. */ export interface ExprValueSDKType { - /** A concrete value. */ value?: ValueSDKType; - - /** - * The set of errors in the critical path of evalution. - * - * Only errors in the critical path are included. For example, - * `( || true) && ` will only result in ``, - * while ` || ` will result in both `` and - * ``. - * - * Errors cause by the presence of other errors are not included in the - * set. For example `.foo`, `foo()`, and ` + 1` will - * only result in ``. - * - * Multiple errors *might* be included when evaluation could result - * in different errors. For example ` + ` and - * `foo(, )` may result in ``, `` or both. - * The exact subset of errors included for this case is unspecified and - * depends on the implementation details of the evaluator. - */ error?: ErrorSetSDKType; - - /** - * The set of unknowns in the critical path of evaluation. - * - * Unknown behaves identically to Error with regards to propagation. - * Specifically, only unknowns in the critical path are included, unknowns - * caused by the presence of other unknowns are not included, and multiple - * unknowns *might* be included included when evaluation could result in - * different unknowns. For example: - * - * ( || true) && -> - * || -> - * .foo -> - * foo() -> - * + -> or - * - * Unknown takes precidence over Error in cases where a `Value` can short - * circuit the result: - * - * || -> - * && -> - * - * Errors take precidence in all other cases: - * - * + -> - * foo(, ) -> - */ unknown?: UnknownSetSDKType; } @@ -182,7 +124,6 @@ export interface ErrorSet { * The errors included depend on the context. See `ExprValue.error`. */ export interface ErrorSetSDKType { - /** The errors in the set. */ errors: StatusSDKType[]; } @@ -202,7 +143,6 @@ export interface UnknownSet { * The unknowns included depend on the context. See `ExprValue.unknown`. */ export interface UnknownSetSDKType { - /** The ids of the expressions with unknown values. */ exprs: Long[]; } diff --git a/__fixtures__/output1/google/api/expr/v1alpha1/explain.ts b/__fixtures__/output1/google/api/expr/v1alpha1/explain.ts index 610b74fffe..364f94ee53 100644 --- a/__fixtures__/output1/google/api/expr/v1alpha1/explain.ts +++ b/__fixtures__/output1/google/api/expr/v1alpha1/explain.ts @@ -35,21 +35,7 @@ export interface Explain { /** @deprecated */ export interface ExplainSDKType { - /** - * All of the observed values. - * - * The field value_index is an index in the values list. - * Separating values from steps is needed to remove redundant values. - */ values: ValueSDKType[]; - - /** - * List of steps. - * - * Repeated evaluations of the same expression generate new ExprStep - * instances. The order of such ExprStep instances matches the order of - * elements returned by Comprehension.iter_range. - */ expr_steps: Explain_ExprStepSDKType[]; } @@ -64,10 +50,7 @@ export interface Explain_ExprStep { /** ID and value index of one step. */ export interface Explain_ExprStepSDKType { - /** ID of corresponding Expr node. */ id: Long; - - /** Index of the value in the values list. */ value_index: number; } diff --git a/__fixtures__/output1/google/api/expr/v1alpha1/syntax.ts b/__fixtures__/output1/google/api/expr/v1alpha1/syntax.ts index 11b0947138..a268500ac4 100644 --- a/__fixtures__/output1/google/api/expr/v1alpha1/syntax.ts +++ b/__fixtures__/output1/google/api/expr/v1alpha1/syntax.ts @@ -16,10 +16,7 @@ export interface ParsedExpr { /** An expression together with source information as returned by the parser. */ export interface ParsedExprSDKType { - /** The parsed expression. */ expr?: ExprSDKType; - - /** The source info derived from input that generated the parsed `expr`. */ source_info?: SourceInfoSDKType; } @@ -88,32 +85,13 @@ export interface Expr { * the function declaration `startsWith`. */ export interface ExprSDKType { - /** - * Required. An id assigned to this node by the parser which is unique in a - * given expression tree. This is used to associate type information and other - * attributes to a node in the parse tree. - */ id: Long; - - /** A literal expression. */ const_expr?: ConstantSDKType; - - /** An identifier expression. */ ident_expr?: Expr_IdentSDKType; - - /** A field selection expression, e.g. `request.auth`. */ select_expr?: Expr_SelectSDKType; - - /** A call expression, including calls to predefined functions and operators. */ call_expr?: Expr_CallSDKType; - - /** A list creation expression. */ list_expr?: Expr_CreateListSDKType; - - /** A map or message creation expression. */ struct_expr?: Expr_CreateStructSDKType; - - /** A comprehension expression. */ comprehension_expr?: Expr_ComprehensionSDKType; } @@ -130,12 +108,6 @@ export interface Expr_Ident { /** An identifier expression. e.g. `request`. */ export interface Expr_IdentSDKType { - /** - * Required. Holds a single, unqualified identifier, possibly preceded by a - * '.'. - * - * Qualified names are represented by the [Expr.Select][google.api.expr.v1alpha1.Expr.Select] expression. - */ name: string; } @@ -167,27 +139,8 @@ export interface Expr_Select { /** A field selection expression. e.g. `request.auth`. */ export interface Expr_SelectSDKType { - /** - * Required. The target of the selection expression. - * - * For example, in the select expression `request.auth`, the `request` - * portion of the expression is the `operand`. - */ operand?: ExprSDKType; - - /** - * Required. The name of the field to select. - * - * For example, in the select expression `request.auth`, the `auth` portion - * of the expression would be the `field`. - */ field: string; - - /** - * Whether the select is to be interpreted as a field presence test. - * - * This results from the macro `has(request.auth)`. - */ test_only: boolean; } @@ -216,16 +169,8 @@ export interface Expr_Call { * For example, `value == 10`, `size(map_value)`. */ export interface Expr_CallSDKType { - /** - * The target of an method call-style expression. For example, `x` in - * `x.f()`. - */ target?: ExprSDKType; - - /** Required. The name of the function or method being called. */ function: string; - - /** The arguments. */ args: ExprSDKType[]; } @@ -247,7 +192,6 @@ export interface Expr_CreateList { * `dyn([1, 'hello', 2.0])` */ export interface Expr_CreateListSDKType { - /** The elements part of the list. */ elements: ExprSDKType[]; } @@ -277,13 +221,7 @@ export interface Expr_CreateStruct { * `types.MyType{field_id: 'value'}`. */ export interface Expr_CreateStructSDKType { - /** - * The type name of the message to be created, empty when creating map - * literals. - */ message_name: string; - - /** The entries in the creation expression. */ entries: Expr_CreateStruct_EntrySDKType[]; } @@ -308,20 +246,9 @@ export interface Expr_CreateStruct_Entry { /** Represents an entry. */ export interface Expr_CreateStruct_EntrySDKType { - /** - * Required. An id assigned to this node by the parser which is unique - * in a given expression tree. This is used to associate type - * information and other attributes to the node. - */ id: Long; - - /** The field key for a message creator statement. */ field_key?: string; - - /** The key expression for a map creation statement. */ map_key?: ExprSDKType; - - /** Required. The value assigned to the key. */ value?: ExprSDKType; } @@ -418,38 +345,12 @@ export interface Expr_Comprehension { * types, the macro tests whether the property `x` is defined on `m`. */ export interface Expr_ComprehensionSDKType { - /** The name of the iteration variable. */ iter_var: string; - - /** The range over which var iterates. */ iter_range?: ExprSDKType; - - /** The name of the variable used for accumulation of the result. */ accu_var: string; - - /** The initial value of the accumulator. */ accu_init?: ExprSDKType; - - /** - * An expression which can contain iter_var and accu_var. - * - * Returns false when the result has been computed and may be used as - * a hint to short-circuit the remainder of the comprehension. - */ loop_condition?: ExprSDKType; - - /** - * An expression which can contain iter_var and accu_var. - * - * Computes the next value of accu_var. - */ loop_step?: ExprSDKType; - - /** - * An expression which can contain accu_var. - * - * Computes the result. - */ result?: ExprSDKType; } @@ -525,42 +426,17 @@ export interface Constant { * `true`, `null`. */ export interface ConstantSDKType { - /** null value. */ null_value?: NullValue; - - /** boolean value. */ bool_value?: boolean; - - /** int64 value. */ int64_value?: Long; - - /** uint64 value. */ uint64_value?: Long; - - /** double value. */ double_value?: number; - - /** string value. */ string_value?: string; - - /** bytes value. */ bytes_value?: Uint8Array; - /** - * protobuf.Duration value. - * - * Deprecated: duration is no longer considered a builtin cel type. - */ - /** @deprecated */ duration_value?: DurationSDKType; - /** - * protobuf.Timestamp value. - * - * Deprecated: timestamp is no longer considered a builtin cel type. - */ - /** @deprecated */ timestamp_value?: Date; } @@ -630,46 +506,12 @@ export interface SourceInfo { /** Source information collected at parse time. */ export interface SourceInfoSDKType { - /** The syntax version of the source, e.g. `cel1`. */ syntax_version: string; - - /** - * The location name. All position information attached to an expression is - * relative to this location. - * - * The location could be a file, UI element, or similar. For example, - * `acme/app/AnvilPolicy.cel`. - */ location: string; - - /** - * Monotonically increasing list of code point offsets where newlines - * `\n` appear. - * - * The line number of a given position is the index `i` where for a given - * `id` the `line_offsets[i] < id_positions[id] < line_offsets[i+1]`. The - * column may be derivd from `id_positions[id] - line_offsets[i]`. - */ line_offsets: number[]; - - /** - * A map from the parse node id (e.g. `Expr.id`) to the code point offset - * within the source. - */ positions: { [key: Long]: number; }; - - /** - * A map from the parse node id where a macro replacement was made to the - * call `Expr` that resulted in a macro expansion. - * - * For example, `has(value.field)` is a function call that is replaced by a - * `test_only` field selection in the AST. Likewise, the call - * `list.exists(e, e > 10)` translates to a comprehension expression. The key - * in the map corresponds to the expression id of the expanded macro, and the - * value is the call `Expr` that was replaced. - */ macro_calls?: { [key: Long]: ExprSDKType; }; @@ -698,22 +540,9 @@ export interface SourcePosition { /** A specific position in source. */ export interface SourcePositionSDKType { - /** The soucre location name (e.g. file name). */ location: string; - - /** The UTF-8 code unit offset. */ offset: number; - - /** - * The 1-based index of the starting line in the source text - * where the issue occurs, or 0 if unknown. - */ line: number; - - /** - * The 0-based index of the starting position within the line of source text - * where the issue occurs. Only meaningful if line is nonzero. - */ column: number; } diff --git a/__fixtures__/output1/google/api/expr/v1alpha1/value.ts b/__fixtures__/output1/google/api/expr/v1alpha1/value.ts index 93ac123803..249838d251 100644 --- a/__fixtures__/output1/google/api/expr/v1alpha1/value.ts +++ b/__fixtures__/output1/google/api/expr/v1alpha1/value.ts @@ -55,40 +55,17 @@ export interface Value { * range of values. */ export interface ValueSDKType { - /** Null value. */ null_value?: NullValue; - - /** Boolean value. */ bool_value?: boolean; - - /** Signed integer value. */ int64_value?: Long; - - /** Unsigned integer value. */ uint64_value?: Long; - - /** Floating point value. */ double_value?: number; - - /** UTF-8 string value. */ string_value?: string; - - /** Byte string value. */ bytes_value?: Uint8Array; - - /** An enum value. */ enum_value?: EnumValueSDKType; - - /** The proto message backing an object value. */ object_value?: AnySDKType; - - /** Map value. */ map_value?: MapValueSDKType; - - /** List value. */ list_value?: ListValueSDKType; - - /** Type value. */ type_value?: string; } @@ -103,10 +80,7 @@ export interface EnumValue { /** An enum value. */ export interface EnumValueSDKType { - /** The fully qualified name of the enum type. */ type: string; - - /** The value of the enum. */ value: number; } @@ -128,7 +102,6 @@ export interface ListValue { * required for use in a 'oneof'. */ export interface ListValueSDKType { - /** The ordered values in the list. */ values: ValueSDKType[]; } @@ -155,12 +128,6 @@ export interface MapValue { * required for use in a 'oneof'. */ export interface MapValueSDKType { - /** - * The set of map entries. - * - * CEL has fewer restrictions on keys, so a protobuf map represenation - * cannot be used. - */ entries: MapValue_EntrySDKType[]; } @@ -180,15 +147,7 @@ export interface MapValue_Entry { /** An entry in the map. */ export interface MapValue_EntrySDKType { - /** - * The key. - * - * Must be unique with in the map. - * Currently only boolean, int, uint, and string values can be keys. - */ key?: ValueSDKType; - - /** The value. */ value?: ValueSDKType; } diff --git a/__fixtures__/output1/google/api/expr/v1beta1/decl.ts b/__fixtures__/output1/google/api/expr/v1beta1/decl.ts index 76a36defa3..35304f4a2b 100644 --- a/__fixtures__/output1/google/api/expr/v1beta1/decl.ts +++ b/__fixtures__/output1/google/api/expr/v1beta1/decl.ts @@ -23,19 +23,10 @@ export interface Decl { /** A declaration. */ export interface DeclSDKType { - /** The id of the declaration. */ id: number; - - /** The name of the declaration. */ name: string; - - /** The documentation string for the declaration. */ doc: string; - - /** An identifier declaration. */ ident?: IdentDeclSDKType; - - /** A function declaration. */ function?: FunctionDeclSDKType; } @@ -66,16 +57,8 @@ export interface DeclType { * and dispatching. */ export interface DeclTypeSDKType { - /** The expression id of the declared type, if applicable. */ id: number; - - /** The type name, e.g. 'int', 'my.type.Type' or 'T' */ type: string; - - /** - * An ordered list of type parameters, e.g. ``. - * Only applies to a subset of types, e.g. `map`, `list`. - */ type_params: DeclTypeSDKType[]; } @@ -90,10 +73,7 @@ export interface IdentDecl { /** An identifier declaration. */ export interface IdentDeclSDKType { - /** Optional type of the identifier. */ type?: DeclTypeSDKType; - - /** Optional value of the identifier. */ value?: ExprSDKType; } @@ -111,13 +91,8 @@ export interface FunctionDecl { /** A function declaration. */ export interface FunctionDeclSDKType { - /** The function arguments. */ args: IdentDeclSDKType[]; - - /** Optional declared return type. */ return_type?: DeclTypeSDKType; - - /** If the first argument of the function is the receiver. */ receiver_function: boolean; } diff --git a/__fixtures__/output1/google/api/expr/v1beta1/eval.ts b/__fixtures__/output1/google/api/expr/v1beta1/eval.ts index a23ea59938..2dac9dbb01 100644 --- a/__fixtures__/output1/google/api/expr/v1beta1/eval.ts +++ b/__fixtures__/output1/google/api/expr/v1beta1/eval.ts @@ -28,15 +28,7 @@ export interface EvalState { * Can represent an initial, partial, or completed state of evaluation. */ export interface EvalStateSDKType { - /** The unique values referenced in this message. */ values: ExprValueSDKType[]; - - /** - * An ordered list of results. - * - * Tracks the flow of evaluation through the expression. - * May be sparse. - */ results: EvalState_ResultSDKType[]; } @@ -51,10 +43,7 @@ export interface EvalState_Result { /** A single evaluation result. */ export interface EvalState_ResultSDKType { - /** The expression this result is for. */ expr?: IdRefSDKType; - - /** The index in `values` of the resulting value. */ value: number; } @@ -114,55 +103,8 @@ export interface ExprValue { /** The value of an evaluated expression. */ export interface ExprValueSDKType { - /** A concrete value. */ value?: ValueSDKType; - - /** - * The set of errors in the critical path of evalution. - * - * Only errors in the critical path are included. For example, - * `( || true) && ` will only result in ``, - * while ` || ` will result in both `` and - * ``. - * - * Errors cause by the presence of other errors are not included in the - * set. For example `.foo`, `foo()`, and ` + 1` will - * only result in ``. - * - * Multiple errors *might* be included when evaluation could result - * in different errors. For example ` + ` and - * `foo(, )` may result in ``, `` or both. - * The exact subset of errors included for this case is unspecified and - * depends on the implementation details of the evaluator. - */ error?: ErrorSetSDKType; - - /** - * The set of unknowns in the critical path of evaluation. - * - * Unknown behaves identically to Error with regards to propagation. - * Specifically, only unknowns in the critical path are included, unknowns - * caused by the presence of other unknowns are not included, and multiple - * unknowns *might* be included included when evaluation could result in - * different unknowns. For example: - * - * ( || true) && -> - * || -> - * .foo -> - * foo() -> - * + -> or - * - * Unknown takes precidence over Error in cases where a `Value` can short - * circuit the result: - * - * || -> - * && -> - * - * Errors take precidence in all other cases: - * - * + -> - * foo(, ) -> - */ unknown?: UnknownSetSDKType; } @@ -182,7 +124,6 @@ export interface ErrorSet { * The errors included depend on the context. See `ExprValue.error`. */ export interface ErrorSetSDKType { - /** The errors in the set. */ errors: StatusSDKType[]; } @@ -202,7 +143,6 @@ export interface UnknownSet { * The unknowns included depend on the context. See `ExprValue.unknown`. */ export interface UnknownSetSDKType { - /** The ids of the expressions with unknown values. */ exprs: IdRefSDKType[]; } @@ -214,7 +154,6 @@ export interface IdRef { /** A reference to an expression id. */ export interface IdRefSDKType { - /** The expression id. */ id: number; } diff --git a/__fixtures__/output1/google/api/expr/v1beta1/expr.ts b/__fixtures__/output1/google/api/expr/v1beta1/expr.ts index 380558c101..bab190cef1 100644 --- a/__fixtures__/output1/google/api/expr/v1beta1/expr.ts +++ b/__fixtures__/output1/google/api/expr/v1beta1/expr.ts @@ -18,13 +18,8 @@ export interface ParsedExpr { /** An expression together with source information as returned by the parser. */ export interface ParsedExprSDKType { - /** The parsed expression. */ expr?: ExprSDKType; - - /** The source info derived from input that generated the parsed `expr`. */ source_info?: SourceInfoSDKType; - - /** The syntax version of the source, e.g. `cel1`. */ syntax_version: string; } @@ -93,32 +88,13 @@ export interface Expr { * the function declaration `startsWith`. */ export interface ExprSDKType { - /** - * Required. An id assigned to this node by the parser which is unique in a - * given expression tree. This is used to associate type information and other - * attributes to a node in the parse tree. - */ id: number; - - /** A literal expression. */ literal_expr?: LiteralSDKType; - - /** An identifier expression. */ ident_expr?: Expr_IdentSDKType; - - /** A field selection expression, e.g. `request.auth`. */ select_expr?: Expr_SelectSDKType; - - /** A call expression, including calls to predefined functions and operators. */ call_expr?: Expr_CallSDKType; - - /** A list creation expression. */ list_expr?: Expr_CreateListSDKType; - - /** A map or object creation expression. */ struct_expr?: Expr_CreateStructSDKType; - - /** A comprehension expression. */ comprehension_expr?: Expr_ComprehensionSDKType; } @@ -135,12 +111,6 @@ export interface Expr_Ident { /** An identifier expression. e.g. `request`. */ export interface Expr_IdentSDKType { - /** - * Required. Holds a single, unqualified identifier, possibly preceded by a - * '.'. - * - * Qualified names are represented by the [Expr.Select][google.api.expr.v1beta1.Expr.Select] expression. - */ name: string; } @@ -172,27 +142,8 @@ export interface Expr_Select { /** A field selection expression. e.g. `request.auth`. */ export interface Expr_SelectSDKType { - /** - * Required. The target of the selection expression. - * - * For example, in the select expression `request.auth`, the `request` - * portion of the expression is the `operand`. - */ operand?: ExprSDKType; - - /** - * Required. The name of the field to select. - * - * For example, in the select expression `request.auth`, the `auth` portion - * of the expression would be the `field`. - */ field: string; - - /** - * Whether the select is to be interpreted as a field presence test. - * - * This results from the macro `has(request.auth)`. - */ test_only: boolean; } @@ -221,16 +172,8 @@ export interface Expr_Call { * For example, `value == 10`, `size(map_value)`. */ export interface Expr_CallSDKType { - /** - * The target of an method call-style expression. For example, `x` in - * `x.f()`. - */ target?: ExprSDKType; - - /** Required. The name of the function or method being called. */ function: string; - - /** The arguments. */ args: ExprSDKType[]; } @@ -252,7 +195,6 @@ export interface Expr_CreateList { * `dyn([1, 'hello', 2.0])` */ export interface Expr_CreateListSDKType { - /** The elements part of the list. */ elements: ExprSDKType[]; } @@ -282,13 +224,7 @@ export interface Expr_CreateStruct { * `types.MyType{field_id: 'value'}`. */ export interface Expr_CreateStructSDKType { - /** - * The type name of the message to be created, empty when creating map - * literals. - */ type: string; - - /** The entries in the creation expression. */ entries: Expr_CreateStruct_EntrySDKType[]; } @@ -313,20 +249,9 @@ export interface Expr_CreateStruct_Entry { /** Represents an entry. */ export interface Expr_CreateStruct_EntrySDKType { - /** - * Required. An id assigned to this node by the parser which is unique - * in a given expression tree. This is used to associate type - * information and other attributes to the node. - */ id: number; - - /** The field key for a message creator statement. */ field_key?: string; - - /** The key expression for a map creation statement. */ map_key?: ExprSDKType; - - /** Required. The value assigned to the key. */ value?: ExprSDKType; } @@ -423,38 +348,12 @@ export interface Expr_Comprehension { * types, the macro tests whether the property `x` is defined on `m`. */ export interface Expr_ComprehensionSDKType { - /** The name of the iteration variable. */ iter_var: string; - - /** The range over which var iterates. */ iter_range?: ExprSDKType; - - /** The name of the variable used for accumulation of the result. */ accu_var: string; - - /** The initial value of the accumulator. */ accu_init?: ExprSDKType; - - /** - * An expression which can contain iter_var and accu_var. - * - * Returns false when the result has been computed and may be used as - * a hint to short-circuit the remainder of the comprehension. - */ loop_condition?: ExprSDKType; - - /** - * An expression which can contain iter_var and accu_var. - * - * Computes the next value of accu_var. - */ loop_step?: ExprSDKType; - - /** - * An expression which can contain accu_var. - * - * Computes the result. - */ result?: ExprSDKType; } @@ -508,25 +407,12 @@ export interface Literal { * `true`, `null`. */ export interface LiteralSDKType { - /** null value. */ null_value?: NullValue; - - /** boolean value. */ bool_value?: boolean; - - /** int64 value. */ int64_value?: Long; - - /** uint64 value. */ uint64_value?: Long; - - /** double value. */ double_value?: number; - - /** string value. */ string_value?: string; - - /** bytes value. */ bytes_value?: Uint8Array; } diff --git a/__fixtures__/output1/google/api/expr/v1beta1/source.ts b/__fixtures__/output1/google/api/expr/v1beta1/source.ts index a1de5a04af..366caf8074 100644 --- a/__fixtures__/output1/google/api/expr/v1beta1/source.ts +++ b/__fixtures__/output1/google/api/expr/v1beta1/source.ts @@ -41,28 +41,8 @@ export interface SourceInfo { /** Source information collected at parse time. */ export interface SourceInfoSDKType { - /** - * The location name. All position information attached to an expression is - * relative to this location. - * - * The location could be a file, UI element, or similar. For example, - * `acme/app/AnvilPolicy.cel`. - */ location: string; - - /** - * Monotonically increasing list of character offsets where newlines appear. - * - * The line number of a given position is the index `i` where for a given - * `id` the `line_offsets[i] < id_positions[id] < line_offsets[i+1]`. The - * column may be derivd from `id_positions[id] - line_offsets[i]`. - */ line_offsets: number[]; - - /** - * A map from the parse node id (e.g. `Expr.id`) to the character offset - * within source. - */ positions: { [key: number]: number; }; @@ -91,22 +71,9 @@ export interface SourcePosition { /** A specific position in source. */ export interface SourcePositionSDKType { - /** The soucre location name (e.g. file name). */ location: string; - - /** The character offset. */ offset: number; - - /** - * The 1-based index of the starting line in the source text - * where the issue occurs, or 0 if unknown. - */ line: number; - - /** - * The 0-based index of the starting position within the line of source text - * where the issue occurs. Only meaningful if line is nonzer.. - */ column: number; } diff --git a/__fixtures__/output1/google/api/expr/v1beta1/value.ts b/__fixtures__/output1/google/api/expr/v1beta1/value.ts index de11dc0711..a62bd1ddfd 100644 --- a/__fixtures__/output1/google/api/expr/v1beta1/value.ts +++ b/__fixtures__/output1/google/api/expr/v1beta1/value.ts @@ -55,40 +55,17 @@ export interface Value { * range of values. */ export interface ValueSDKType { - /** Null value. */ null_value?: NullValue; - - /** Boolean value. */ bool_value?: boolean; - - /** Signed integer value. */ int64_value?: Long; - - /** Unsigned integer value. */ uint64_value?: Long; - - /** Floating point value. */ double_value?: number; - - /** UTF-8 string value. */ string_value?: string; - - /** Byte string value. */ bytes_value?: Uint8Array; - - /** An enum value. */ enum_value?: EnumValueSDKType; - - /** The proto message backing an object value. */ object_value?: AnySDKType; - - /** Map value. */ map_value?: MapValueSDKType; - - /** List value. */ list_value?: ListValueSDKType; - - /** A Type value represented by the fully qualified name of the type. */ type_value?: string; } @@ -103,10 +80,7 @@ export interface EnumValue { /** An enum value. */ export interface EnumValueSDKType { - /** The fully qualified name of the enum type. */ type: string; - - /** The value of the enum. */ value: number; } @@ -128,7 +102,6 @@ export interface ListValue { * required for use in a 'oneof'. */ export interface ListValueSDKType { - /** The ordered values in the list. */ values: ValueSDKType[]; } @@ -155,12 +128,6 @@ export interface MapValue { * required for use in a 'oneof'. */ export interface MapValueSDKType { - /** - * The set of map entries. - * - * CEL has fewer restrictions on keys, so a protobuf map represenation - * cannot be used. - */ entries: MapValue_EntrySDKType[]; } @@ -180,15 +147,7 @@ export interface MapValue_Entry { /** An entry in the map. */ export interface MapValue_EntrySDKType { - /** - * The key. - * - * Must be unique with in the map. - * Currently only boolean, int, uint, and string values can be keys. - */ key?: ValueSDKType; - - /** The value. */ value?: ValueSDKType; } diff --git a/__fixtures__/output1/google/api/http.ts b/__fixtures__/output1/google/api/http.ts index deaf9baf95..a7a6182d95 100644 --- a/__fixtures__/output1/google/api/http.ts +++ b/__fixtures__/output1/google/api/http.ts @@ -32,21 +32,7 @@ export interface Http { * to one or more HTTP REST API methods. */ export interface HttpSDKType { - /** - * A list of HTTP configuration rules that apply to individual API methods. - * - * **NOTE:** All service configuration rules follow "last one wins" order. - */ rules: HttpRuleSDKType[]; - - /** - * When set to true, URL path parameters will be fully URI-decoded except in - * cases of single segment matches in reserved expansion, where "%2F" will be - * left encoded. - * - * The default behavior is to not decode RFC 6570 reserved characters in multi - * segment matches. - */ fully_decode_reserved_expansion: boolean; } @@ -655,64 +641,15 @@ export interface HttpRule { * Transcoding implementations may not support this feature. */ export interface HttpRuleSDKType { - /** - * Selects a method to which this rule applies. - * - * Refer to [selector][google.api.DocumentationRule.selector] for syntax details. - */ selector: string; - - /** - * Maps to HTTP GET. Used for listing and getting information about - * resources. - */ get?: string; - - /** Maps to HTTP PUT. Used for replacing a resource. */ put?: string; - - /** Maps to HTTP POST. Used for creating a resource or performing an action. */ post?: string; - - /** Maps to HTTP DELETE. Used for deleting a resource. */ delete?: string; - - /** Maps to HTTP PATCH. Used for updating a resource. */ patch?: string; - - /** - * The custom pattern is used for specifying an HTTP method that is not - * included in the `pattern` field, such as HEAD, or "*" to leave the - * HTTP method unspecified for this rule. The wild-card rule is useful - * for services that provide content to Web (HTML) clients. - */ custom?: CustomHttpPatternSDKType; - - /** - * The name of the request field whose value is mapped to the HTTP request - * body, or `*` for mapping all request fields not captured by the path - * pattern to the HTTP body, or omitted for not having any HTTP request body. - * - * NOTE: the referred field must be present at the top-level of the request - * message type. - */ body: string; - - /** - * Optional. The name of the response field whose value is mapped to the HTTP - * response body. When omitted, the entire response message will be used - * as the HTTP response body. - * - * NOTE: The referred field must be present at the top-level of the response - * message type. - */ response_body: string; - - /** - * Additional HTTP bindings for the selector. Nested bindings must - * not contain an `additional_bindings` field themselves (that is, - * the nesting may only be one level deep). - */ additional_bindings: HttpRuleSDKType[]; } @@ -727,10 +664,7 @@ export interface CustomHttpPattern { /** A custom pattern is used for defining custom HTTP verb. */ export interface CustomHttpPatternSDKType { - /** The name of this custom HTTP verb. */ kind: string; - - /** The path matched by this custom verb. */ path: string; } diff --git a/__fixtures__/output1/google/api/httpbody.ts b/__fixtures__/output1/google/api/httpbody.ts index c079af772d..242142e8c3 100644 --- a/__fixtures__/output1/google/api/httpbody.ts +++ b/__fixtures__/output1/google/api/httpbody.ts @@ -108,16 +108,8 @@ export interface HttpBody { * handled, all other features will continue to work unchanged. */ export interface HttpBodySDKType { - /** The HTTP Content-Type header value specifying the content type of the body. */ content_type: string; - - /** The HTTP request/response body as raw binary. */ data: Uint8Array; - - /** - * Application specific response metadata. Must be set in the first response - * for streaming APIs. - */ extensions: AnySDKType[]; } diff --git a/__fixtures__/output1/google/api/label.ts b/__fixtures__/output1/google/api/label.ts index 72d0f01d01..9935e27c45 100644 --- a/__fixtures__/output1/google/api/label.ts +++ b/__fixtures__/output1/google/api/label.ts @@ -66,13 +66,8 @@ export interface LabelDescriptor { /** A description of a label. */ export interface LabelDescriptorSDKType { - /** The label key. */ key: string; - - /** The type of data that can be assigned to the label. */ value_type: LabelDescriptor_ValueType; - - /** A human-readable description for the label. */ description: string; } diff --git a/__fixtures__/output1/google/api/log.ts b/__fixtures__/output1/google/api/log.ts index da3bf65b57..7633a3b9e5 100644 --- a/__fixtures__/output1/google/api/log.ts +++ b/__fixtures__/output1/google/api/log.ts @@ -53,31 +53,9 @@ export interface LogDescriptor { * description: Identifier of a library customer */ export interface LogDescriptorSDKType { - /** - * The name of the log. It must be less than 512 characters long and can - * include the following characters: upper- and lower-case alphanumeric - * characters [A-Za-z0-9], and punctuation characters including - * slash, underscore, hyphen, period [/_-.]. - */ name: string; - - /** - * The set of labels that are available to describe a specific log entry. - * Runtime requests that contain labels not specified here are - * considered invalid. - */ labels: LabelDescriptorSDKType[]; - - /** - * A human-readable description of this log. This information appears in - * the documentation and can contain details. - */ description: string; - - /** - * The human-readable name for this log. This information appears on - * the user interface and should be concise. - */ display_name: string; } diff --git a/__fixtures__/output1/google/api/logging.ts b/__fixtures__/output1/google/api/logging.ts index b5e9a1c7fa..c6c20496c1 100644 --- a/__fixtures__/output1/google/api/logging.ts +++ b/__fixtures__/output1/google/api/logging.ts @@ -83,20 +83,7 @@ export interface Logging { * - activity_history */ export interface LoggingSDKType { - /** - * Logging configurations for sending logs to the producer project. - * There can be multiple producer destinations, each one must have a - * different monitored resource type. A log can be used in at most - * one producer destination. - */ producer_destinations: Logging_LoggingDestinationSDKType[]; - - /** - * Logging configurations for sending logs to the consumer project. - * There can be multiple consumer destinations, each one must have a - * different monitored resource type. A log can be used in at most - * one consumer destination. - */ consumer_destinations: Logging_LoggingDestinationSDKType[]; } @@ -125,18 +112,7 @@ export interface Logging_LoggingDestination { * or the consumer project). */ export interface Logging_LoggingDestinationSDKType { - /** - * The monitored resource type. The type must be defined in the - * [Service.monitored_resources][google.api.Service.monitored_resources] section. - */ monitored_resource: string; - - /** - * Names of the logs to be sent to this destination. Each name must - * be defined in the [Service.logs][google.api.Service.logs] section. If the log name is - * not a domain scoped name, it will be automatically prefixed with - * the service name followed by "/". - */ logs: string[]; } diff --git a/__fixtures__/output1/google/api/metric.ts b/__fixtures__/output1/google/api/metric.ts index 5c8ea5fbbe..9ddde3b59d 100644 --- a/__fixtures__/output1/google/api/metric.ts +++ b/__fixtures__/output1/google/api/metric.ts @@ -353,173 +353,16 @@ export interface MetricDescriptor { * existing data unusable. */ export interface MetricDescriptorSDKType { - /** The resource name of the metric descriptor. */ name: string; - - /** - * The metric type, including its DNS name prefix. The type is not - * URL-encoded. All user-defined metric types have the DNS name - * `custom.googleapis.com` or `external.googleapis.com`. Metric types should - * use a natural hierarchical grouping. For example: - * - * "custom.googleapis.com/invoice/paid/amount" - * "external.googleapis.com/prometheus/up" - * "appengine.googleapis.com/http/server/response_latencies" - */ type: string; - - /** - * The set of labels that can be used to describe a specific - * instance of this metric type. For example, the - * `appengine.googleapis.com/http/server/response_latencies` metric - * type has a label for the HTTP response code, `response_code`, so - * you can look at latencies for successful responses or just - * for responses that failed. - */ labels: LabelDescriptorSDKType[]; - - /** - * Whether the metric records instantaneous values, changes to a value, etc. - * Some combinations of `metric_kind` and `value_type` might not be supported. - */ metric_kind: MetricDescriptor_MetricKind; - - /** - * Whether the measurement is an integer, a floating-point number, etc. - * Some combinations of `metric_kind` and `value_type` might not be supported. - */ value_type: MetricDescriptor_ValueType; - - /** - * The units in which the metric value is reported. It is only applicable - * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit` - * defines the representation of the stored metric values. - * - * Different systems might scale the values to be more easily displayed (so a - * value of `0.02kBy` _might_ be displayed as `20By`, and a value of - * `3523kBy` _might_ be displayed as `3.5MBy`). However, if the `unit` is - * `kBy`, then the value of the metric is always in thousands of bytes, no - * matter how it might be displayed. - * - * If you want a custom metric to record the exact number of CPU-seconds used - * by a job, you can create an `INT64 CUMULATIVE` metric whose `unit` is - * `s{CPU}` (or equivalently `1s{CPU}` or just `s`). If the job uses 12,005 - * CPU-seconds, then the value is written as `12005`. - * - * Alternatively, if you want a custom metric to record data in a more - * granular way, you can create a `DOUBLE CUMULATIVE` metric whose `unit` is - * `ks{CPU}`, and then write the value `12.005` (which is `12005/1000`), - * or use `Kis{CPU}` and write `11.723` (which is `12005/1024`). - * - * The supported units are a subset of [The Unified Code for Units of - * Measure](https://unitsofmeasure.org/ucum.html) standard: - * - * **Basic units (UNIT)** - * - * * `bit` bit - * * `By` byte - * * `s` second - * * `min` minute - * * `h` hour - * * `d` day - * * `1` dimensionless - * - * **Prefixes (PREFIX)** - * - * * `k` kilo (10^3) - * * `M` mega (10^6) - * * `G` giga (10^9) - * * `T` tera (10^12) - * * `P` peta (10^15) - * * `E` exa (10^18) - * * `Z` zetta (10^21) - * * `Y` yotta (10^24) - * - * * `m` milli (10^-3) - * * `u` micro (10^-6) - * * `n` nano (10^-9) - * * `p` pico (10^-12) - * * `f` femto (10^-15) - * * `a` atto (10^-18) - * * `z` zepto (10^-21) - * * `y` yocto (10^-24) - * - * * `Ki` kibi (2^10) - * * `Mi` mebi (2^20) - * * `Gi` gibi (2^30) - * * `Ti` tebi (2^40) - * * `Pi` pebi (2^50) - * - * **Grammar** - * - * The grammar also includes these connectors: - * - * * `/` division or ratio (as an infix operator). For examples, - * `kBy/{email}` or `MiBy/10ms` (although you should almost never - * have `/s` in a metric `unit`; rates should always be computed at - * query time from the underlying cumulative or delta value). - * * `.` multiplication or composition (as an infix operator). For - * examples, `GBy.d` or `k{watt}.h`. - * - * The grammar for a unit is as follows: - * - * Expression = Component { "." Component } { "/" Component } ; - * - * Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ] - * | Annotation - * | "1" - * ; - * - * Annotation = "{" NAME "}" ; - * - * Notes: - * - * * `Annotation` is just a comment if it follows a `UNIT`. If the annotation - * is used alone, then the unit is equivalent to `1`. For examples, - * `{request}/s == 1/s`, `By{transmitted}/s == By/s`. - * * `NAME` is a sequence of non-blank printable ASCII characters not - * containing `{` or `}`. - * * `1` represents a unitary [dimensionless - * unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such - * as in `1/s`. It is typically used when none of the basic units are - * appropriate. For example, "new users per day" can be represented as - * `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new - * users). Alternatively, "thousands of page views per day" would be - * represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric - * value of `5.3` would mean "5300 page views per day"). - * * `%` represents dimensionless value of 1/100, and annotates values giving - * a percentage (so the metric values are typically in the range of 0..100, - * and a metric value `3` means "3 percent"). - * * `10^2.%` indicates a metric contains a ratio, typically in the range - * 0..1, that will be multiplied by 100 and displayed as a percentage - * (so a metric value `0.03` means "3 percent"). - */ unit: string; - - /** A detailed description of the metric, which can be used in documentation. */ description: string; - - /** - * A concise name for the metric, which can be displayed in user interfaces. - * Use sentence case without an ending period, for example "Request count". - * This field is optional but it is recommended to be set for any metrics - * associated with user-visible concepts, such as Quota. - */ display_name: string; - - /** Optional. Metadata which can be used to guide usage of the metric. */ metadata?: MetricDescriptor_MetricDescriptorMetadataSDKType; - - /** Optional. The launch stage of the metric definition. */ launch_stage: LaunchStage; - - /** - * Read-only. If present, then a [time - * series][google.monitoring.v3.TimeSeries], which is identified partially by - * a metric type and a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that is associated - * with this metric type can only be associated with one of the monitored - * resource types listed here. - */ monitored_resource_types: string[]; } @@ -548,24 +391,9 @@ export interface MetricDescriptor_MetricDescriptorMetadata { /** Additional annotations that can be used to guide the usage of a metric. */ export interface MetricDescriptor_MetricDescriptorMetadataSDKType { - /** Deprecated. Must use the [MetricDescriptor.launch_stage][google.api.MetricDescriptor.launch_stage] instead. */ - /** @deprecated */ launch_stage: LaunchStage; - - /** - * The sampling period of metric data points. For metrics which are written - * periodically, consecutive data points are stored at this time interval, - * excluding data loss due to errors. Metrics with a higher granularity have - * a smaller sampling period. - */ sample_period?: DurationSDKType; - - /** - * The delay of data points caused by ingestion. Data points older than this - * age are guaranteed to be ingested and available to be read, excluding - * data loss due to errors. - */ ingest_delay?: DurationSDKType; } export interface Metric_LabelsEntry { @@ -602,16 +430,7 @@ export interface Metric { * labels of a [`MetricDescriptor`][google.api.MetricDescriptor]. */ export interface MetricSDKType { - /** - * An existing metric type, see [google.api.MetricDescriptor][google.api.MetricDescriptor]. - * For example, `custom.googleapis.com/invoice/paid/amount`. - */ type: string; - - /** - * The set of label values that uniquely identify this metric. All - * labels listed in the `MetricDescriptor` must be assigned values. - */ labels: { [key: string]: string; }; diff --git a/__fixtures__/output1/google/api/monitored_resource.ts b/__fixtures__/output1/google/api/monitored_resource.ts index 74cbbcc2d3..152e3b0f6e 100644 --- a/__fixtures__/output1/google/api/monitored_resource.ts +++ b/__fixtures__/output1/google/api/monitored_resource.ts @@ -70,44 +70,11 @@ export interface MonitoredResourceDescriptor { * by the API. */ export interface MonitoredResourceDescriptorSDKType { - /** - * Optional. The resource name of the monitored resource descriptor: - * `"projects/{project_id}/monitoredResourceDescriptors/{type}"` where - * {type} is the value of the `type` field in this object and - * {project_id} is a project ID that provides API-specific context for - * accessing the type. APIs that do not use project information can use the - * resource name format `"monitoredResourceDescriptors/{type}"`. - */ name: string; - - /** - * Required. The monitored resource type. For example, the type - * `"cloudsql_database"` represents databases in Google Cloud SQL. - */ type: string; - - /** - * Optional. A concise name for the monitored resource type that might be - * displayed in user interfaces. It should be a Title Cased Noun Phrase, - * without any article or other determiners. For example, - * `"Google Cloud SQL Database"`. - */ display_name: string; - - /** - * Optional. A detailed description of the monitored resource type that might - * be used in documentation. - */ description: string; - - /** - * Required. A set of labels used to describe instances of this monitored - * resource type. For example, an individual Google Cloud SQL database is - * identified by values for the labels `"database_id"` and `"zone"`. - */ labels: LabelDescriptorSDKType[]; - - /** Optional. The launch stage of the monitored resource definition. */ launch_stage: LaunchStage; } export interface MonitoredResource_LabelsEntry { @@ -168,18 +135,7 @@ export interface MonitoredResource { * "zone": "us-central1-a" }} */ export interface MonitoredResourceSDKType { - /** - * Required. The monitored resource type. This field must match - * the `type` field of a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor] object. For - * example, the type of a Compute Engine VM instance is `gce_instance`. - */ type: string; - - /** - * Required. Values for all of the labels listed in the associated monitored - * resource descriptor. For example, Compute Engine VM instances use the - * labels `"project_id"`, `"instance_id"`, and `"zone"`. - */ labels: { [key: string]: string; }; @@ -231,21 +187,7 @@ export interface MonitoredResourceMetadata { * the metadata in this message. */ export interface MonitoredResourceMetadataSDKType { - /** - * Output only. Values for predefined system metadata labels. - * System labels are a kind of metadata extracted by Google, including - * "machine_image", "vpc", "subnet_id", - * "security_group", "name", etc. - * System label values can be only strings, Boolean values, or a list of - * strings. For example: - * - * { "name": "my-test-instance", - * "security_group": ["a", "b", "c"], - * "spot_instance": false } - */ system_labels?: StructSDKType; - - /** Output only. A map of user-defined metadata labels. */ user_labels: { [key: string]: string; }; diff --git a/__fixtures__/output1/google/api/monitoring.ts b/__fixtures__/output1/google/api/monitoring.ts index 82e8249379..e39f19f609 100644 --- a/__fixtures__/output1/google/api/monitoring.ts +++ b/__fixtures__/output1/google/api/monitoring.ts @@ -133,24 +133,7 @@ export interface Monitoring { * - library.googleapis.com/book/num_overdue */ export interface MonitoringSDKType { - /** - * Monitoring configurations for sending metrics to the producer project. - * There can be multiple producer destinations. A monitored resource type may - * appear in multiple monitoring destinations if different aggregations are - * needed for different sets of metrics associated with that monitored - * resource type. A monitored resource and metric pair may only be used once - * in the Monitoring configuration. - */ producer_destinations: Monitoring_MonitoringDestinationSDKType[]; - - /** - * Monitoring configurations for sending metrics to the consumer project. - * There can be multiple consumer destinations. A monitored resource type may - * appear in multiple monitoring destinations if different aggregations are - * needed for different sets of metrics associated with that monitored - * resource type. A monitored resource and metric pair may only be used once - * in the Monitoring configuration. - */ consumer_destinations: Monitoring_MonitoringDestinationSDKType[]; } @@ -177,16 +160,7 @@ export interface Monitoring_MonitoringDestination { * or the consumer project). */ export interface Monitoring_MonitoringDestinationSDKType { - /** - * The monitored resource type. The type must be defined in - * [Service.monitored_resources][google.api.Service.monitored_resources] section. - */ monitored_resource: string; - - /** - * Types of the metrics to report to this monitoring destination. - * Each type must be defined in [Service.metrics][google.api.Service.metrics] section. - */ metrics: string[]; } diff --git a/__fixtures__/output1/google/api/quota.ts b/__fixtures__/output1/google/api/quota.ts index 36bd8ed306..2dff07ac4f 100644 --- a/__fixtures__/output1/google/api/quota.ts +++ b/__fixtures__/output1/google/api/quota.ts @@ -116,13 +116,7 @@ export interface Quota { * value_type: INT64 */ export interface QuotaSDKType { - /** List of `QuotaLimit` definitions for the service. */ limits: QuotaLimitSDKType[]; - - /** - * List of `MetricRule` definitions, each one mapping a selected method to one - * or more metrics. - */ metric_rules: MetricRuleSDKType[]; } export interface MetricRule_MetricCostsEntry { @@ -164,21 +158,7 @@ export interface MetricRule { * metric's configured quota behaviors to apply to the method call. */ export interface MetricRuleSDKType { - /** - * Selects the methods to which this rule applies. - * - * Refer to [selector][google.api.DocumentationRule.selector] for syntax details. - */ selector: string; - - /** - * Metrics to update when the selected methods are called, and the associated - * cost applied to each metric. - * - * The key of the map is the metric name, and the values are the amount - * increased for the metric against which the quota limits are defined. - * The value must not be negative. - */ metric_costs: { [key: string]: Long; }; @@ -305,104 +285,17 @@ export interface QuotaLimit { * type combination defined within a `QuotaGroup`. */ export interface QuotaLimitSDKType { - /** - * Name of the quota limit. - * - * The name must be provided, and it must be unique within the service. The - * name can only include alphanumeric characters as well as '-'. - * - * The maximum length of the limit name is 64 characters. - */ name: string; - - /** - * Optional. User-visible, extended description for this quota limit. - * Should be used only when more context is needed to understand this limit - * than provided by the limit's display name (see: `display_name`). - */ description: string; - - /** - * Default number of tokens that can be consumed during the specified - * duration. This is the number of tokens assigned when a client - * application developer activates the service for his/her project. - * - * Specifying a value of 0 will block all requests. This can be used if you - * are provisioning quota to selected consumers and blocking others. - * Similarly, a value of -1 will indicate an unlimited quota. No other - * negative values are allowed. - * - * Used by group-based quotas only. - */ default_limit: Long; - - /** - * Maximum number of tokens that can be consumed during the specified - * duration. Client application developers can override the default limit up - * to this maximum. If specified, this value cannot be set to a value less - * than the default limit. If not specified, it is set to the default limit. - * - * To allow clients to apply overrides with no upper bound, set this to -1, - * indicating unlimited maximum quota. - * - * Used by group-based quotas only. - */ max_limit: Long; - - /** - * Free tier value displayed in the Developers Console for this limit. - * The free tier is the number of tokens that will be subtracted from the - * billed amount when billing is enabled. - * This field can only be set on a limit with duration "1d", in a billable - * group; it is invalid on any other limit. If this field is not set, it - * defaults to 0, indicating that there is no free tier for this service. - * - * Used by group-based quotas only. - */ free_tier: Long; - - /** - * Duration of this limit in textual notation. Must be "100s" or "1d". - * - * Used by group-based quotas only. - */ duration: string; - - /** - * The name of the metric this quota limit applies to. The quota limits with - * the same metric will be checked together during runtime. The metric must be - * defined within the service config. - */ metric: string; - - /** - * Specify the unit of the quota limit. It uses the same syntax as - * [Metric.unit][]. The supported unit kinds are determined by the quota - * backend system. - * - * Here are some examples: - * * "1/min/{project}" for quota per minute per project. - * - * Note: the order of unit components is insignificant. - * The "1" at the beginning is required to follow the metric unit syntax. - */ unit: string; - - /** - * Tiered limit values. You must specify this as a key:value pair, with an - * integer value that is the maximum number of requests allowed for the - * specified unit. Currently only STANDARD is supported. - */ values: { [key: string]: Long; }; - - /** - * User-visible display name for this limit. - * Optional. If not set, the UI will provide a default display name based on - * the quota configuration. This field can be used to override the default - * display name generated from the configuration. - */ display_name: string; } diff --git a/__fixtures__/output1/google/api/resource.ts b/__fixtures__/output1/google/api/resource.ts index 4d52662239..cafc84d87e 100644 --- a/__fixtures__/output1/google/api/resource.ts +++ b/__fixtures__/output1/google/api/resource.ts @@ -300,92 +300,12 @@ export interface ResourceDescriptor { * pattern: "billingAccounts/{billing_account}/logs/{log}" */ export interface ResourceDescriptorSDKType { - /** - * The resource type. It must be in the format of - * {service_name}/{resource_type_kind}. The `resource_type_kind` must be - * singular and must not include version numbers. - * - * Example: `storage.googleapis.com/Bucket` - * - * The value of the resource_type_kind must follow the regular expression - * /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - * should use PascalCase (UpperCamelCase). The maximum number of - * characters allowed for the `resource_type_kind` is 100. - */ type: string; - - /** - * Optional. The relative resource name pattern associated with this resource - * type. The DNS prefix of the full resource name shouldn't be specified here. - * - * The path pattern must follow the syntax, which aligns with HTTP binding - * syntax: - * - * Template = Segment { "/" Segment } ; - * Segment = LITERAL | Variable ; - * Variable = "{" LITERAL "}" ; - * - * Examples: - * - * - "projects/{project}/topics/{topic}" - * - "projects/{project}/knowledgeBases/{knowledge_base}" - * - * The components in braces correspond to the IDs for each resource in the - * hierarchy. It is expected that, if multiple patterns are provided, - * the same component name (e.g. "project") refers to IDs of the same - * type of resource. - */ pattern: string[]; - - /** - * Optional. The field on the resource that designates the resource name - * field. If omitted, this is assumed to be "name". - */ name_field: string; - - /** - * Optional. The historical or future-looking state of the resource pattern. - * - * Example: - * - * // The InspectTemplate message originally only supported resource - * // names with organization, and project was added later. - * message InspectTemplate { - * option (google.api.resource) = { - * type: "dlp.googleapis.com/InspectTemplate" - * pattern: - * "organizations/{organization}/inspectTemplates/{inspect_template}" - * pattern: "projects/{project}/inspectTemplates/{inspect_template}" - * history: ORIGINALLY_SINGLE_PATTERN - * }; - * } - */ history: ResourceDescriptor_History; - - /** - * The plural name used in the resource name and permission names, such as - * 'projects' for the resource name of 'projects/{project}' and the permission - * name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same - * concept of the `plural` field in k8s CRD spec - * https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - * - * Note: The plural form is required even for singleton resources. See - * https://aip.dev/156 - */ plural: string; - - /** - * The same concept of the `singular` field in k8s CRD spec - * https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - * Such as "project" for the `resourcemanager.googleapis.com/Project` type. - */ singular: string; - - /** - * Style flag(s) for this resource. - * These indicate that a resource is expected to conform to a given - * style. See the specific style flags for additional information. - */ style: ResourceDescriptor_Style[]; } @@ -439,43 +359,7 @@ export interface ResourceReference { * an API resource. */ export interface ResourceReferenceSDKType { - /** - * The resource type that the annotated field references. - * - * Example: - * - * message Subscription { - * string topic = 2 [(google.api.resource_reference) = { - * type: "pubsub.googleapis.com/Topic" - * }]; - * } - * - * Occasionally, a field may reference an arbitrary resource. In this case, - * APIs use the special value * in their resource reference. - * - * Example: - * - * message GetIamPolicyRequest { - * string resource = 2 [(google.api.resource_reference) = { - * type: "*" - * }]; - * } - */ type: string; - - /** - * The resource type of a child collection that the annotated field - * references. This is useful for annotating the `parent` field that - * doesn't have a fixed resource type. - * - * Example: - * - * message ListLogEntriesRequest { - * string parent = 1 [(google.api.resource_reference) = { - * child_type: "logging.googleapis.com/LogEntry" - * }; - * } - */ child_type: string; } diff --git a/__fixtures__/output1/google/api/routing.ts b/__fixtures__/output1/google/api/routing.ts index c1166b2901..80c69b75d7 100644 --- a/__fixtures__/output1/google/api/routing.ts +++ b/__fixtures__/output1/google/api/routing.ts @@ -737,14 +737,6 @@ export interface RoutingRule { * table_location=instances/instance_bar&routing_id=prof_qux */ export interface RoutingRuleSDKType { - /** - * A collection of Routing Parameter specifications. - * **NOTE:** If multiple Routing Parameters describe the same key - * (via the `path_template` field or via the `field` field when - * `path_template` is not provided), "last one wins" rule - * determines which Parameter gets used. - * See the examples for more details. - */ routing_parameters: RoutingParameterSDKType[]; } @@ -814,65 +806,7 @@ export interface RoutingParameter { /** A projection from an input message to the GRPC or REST header. */ export interface RoutingParameterSDKType { - /** A request field to extract the header key-value pair from. */ field: string; - - /** - * A pattern matching the key-value field. Optional. - * If not specified, the whole field specified in the `field` field will be - * taken as value, and its name used as key. If specified, it MUST contain - * exactly one named segment (along with any number of unnamed segments) The - * pattern will be matched over the field specified in the `field` field, then - * if the match is successful: - * - the name of the single named segment will be used as a header name, - * - the match value of the segment will be used as a header value; - * if the match is NOT successful, nothing will be sent. - * - * Example: - * - * -- This is a field in the request message - * | that the header value will be extracted from. - * | - * | -- This is the key name in the - * | | routing header. - * V | - * field: "table_name" v - * path_template: "projects/*\/{table_location=instances/*}/tables/*" - * ^ ^ - * | | - * In the {} brackets is the pattern that -- | - * specifies what to extract from the | - * field as a value to be sent. | - * | - * The string in the field must match the whole pattern -- - * before brackets, inside brackets, after brackets. - * - * When looking at this specific example, we can see that: - * - A key-value pair with the key `table_location` - * and the value matching `instances/*` should be added - * to the x-goog-request-params routing header. - * - The value is extracted from the request message's `table_name` field - * if it matches the full pattern specified: - * `projects/*\/instances/*\/tables/*`. - * - * **NB:** If the `path_template` field is not provided, the key name is - * equal to the field name, and the whole field should be sent as a value. - * This makes the pattern for the field and the value functionally equivalent - * to `**`, and the configuration - * - * { - * field: "table_name" - * } - * - * is a functionally equivalent shorthand to: - * - * { - * field: "table_name" - * path_template: "{table_name=**}" - * } - * - * See Example 1 for more details. - */ path_template: string; } diff --git a/__fixtures__/output1/google/api/service.ts b/__fixtures__/output1/google/api/service.ts index 04d0296404..b1358e7472 100644 --- a/__fixtures__/output1/google/api/service.ts +++ b/__fixtures__/output1/google/api/service.ts @@ -195,125 +195,31 @@ export interface Service { * provider_id: google_calendar_auth */ export interface ServiceSDKType { - /** - * The service name, which is a DNS-like logical identifier for the - * service, such as `calendar.googleapis.com`. The service name - * typically goes through DNS verification to make sure the owner - * of the service also owns the DNS name. - */ name: string; - - /** The product title for this service. */ title: string; - - /** The Google project that owns this service. */ producer_project_id: string; - - /** - * A unique ID for a specific instance of this message, typically assigned - * by the client for tracking purpose. Must be no longer than 63 characters - * and only lower case letters, digits, '.', '_' and '-' are allowed. If - * empty, the server may choose to generate one instead. - */ id: string; - - /** - * A list of API interfaces exported by this service. Only the `name` field - * of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by the configuration - * author, as the remaining fields will be derived from the IDL during the - * normalization process. It is an error to specify an API interface here - * which cannot be resolved against the associated IDL files. - */ apis: ApiSDKType[]; - - /** - * A list of all proto message types included in this API service. - * Types referenced directly or indirectly by the `apis` are - * automatically included. Messages which are not referenced but - * shall be included, such as types used by the `google.protobuf.Any` type, - * should be listed here by name. Example: - * - * types: - * - name: google.protobuf.Int32 - */ types: TypeSDKType[]; - - /** - * A list of all enum types included in this API service. Enums - * referenced directly or indirectly by the `apis` are automatically - * included. Enums which are not referenced but shall be included - * should be listed here by name. Example: - * - * enums: - * - name: google.someapi.v1.SomeEnum - */ enums: EnumSDKType[]; - - /** Additional API documentation. */ documentation?: DocumentationSDKType; - - /** API backend configuration. */ backend?: BackendSDKType; - - /** HTTP configuration. */ http?: HttpSDKType; - - /** Quota configuration. */ quota?: QuotaSDKType; - - /** Auth configuration. */ authentication?: AuthenticationSDKType; - - /** Context configuration. */ context?: ContextSDKType; - - /** Configuration controlling usage of this service. */ usage?: UsageSDKType; - - /** - * Configuration for network endpoints. If this is empty, then an endpoint - * with the same name as the service is automatically generated to service all - * defined APIs. - */ endpoints: EndpointSDKType[]; - - /** Configuration for the service control plane. */ control?: ControlSDKType; - - /** Defines the logs used by this service. */ logs: LogDescriptorSDKType[]; - - /** Defines the metrics used by this service. */ metrics: MetricDescriptorSDKType[]; - - /** - * Defines the monitored resources used by this service. This is required - * by the [Service.monitoring][google.api.Service.monitoring] and [Service.logging][google.api.Service.logging] configurations. - */ monitored_resources: MonitoredResourceDescriptorSDKType[]; - - /** Billing configuration. */ billing?: BillingSDKType; - - /** Logging configuration. */ logging?: LoggingSDKType; - - /** Monitoring configuration. */ monitoring?: MonitoringSDKType; - - /** System parameter configuration. */ system_parameters?: SystemParametersSDKType; - - /** Output only. The source information for this configuration if available. */ source_info?: SourceInfoSDKType; - /** - * Obsolete. Do not use. - * - * This field has no semantic meaning. The service config compiler always - * sets this field to `3`. - */ - /** @deprecated */ config_version?: UInt32ValueSDKType; } diff --git a/__fixtures__/output1/google/api/servicecontrol/v1/check_error.ts b/__fixtures__/output1/google/api/servicecontrol/v1/check_error.ts index 950e241bdc..ea7dfcab0e 100644 --- a/__fixtures__/output1/google/api/servicecontrol/v1/check_error.ts +++ b/__fixtures__/output1/google/api/servicecontrol/v1/check_error.ts @@ -288,27 +288,9 @@ export interface CheckError { * [google.api.servicecontrol.v1.CheckResponse.check_errors][google.api.servicecontrol.v1.CheckResponse.check_errors]. */ export interface CheckErrorSDKType { - /** The error code. */ code: CheckError_Code; - - /** - * Subject to whom this error applies. See the specific code enum for more - * details on this field. For example: - * - * - "project:" - * - "folder:" - * - "organization:" - */ subject: string; - - /** Free-form text providing details on the error cause of the error. */ detail: string; - - /** - * Contains public information about the check error. If available, - * `status.code` will be non zero and client can propagate it out as public - * error. - */ status?: StatusSDKType; } diff --git a/__fixtures__/output1/google/api/servicecontrol/v1/distribution.ts b/__fixtures__/output1/google/api/servicecontrol/v1/distribution.ts index 02ecf6c571..ed4522e0b2 100644 --- a/__fixtures__/output1/google/api/servicecontrol/v1/distribution.ts +++ b/__fixtures__/output1/google/api/servicecontrol/v1/distribution.ts @@ -76,54 +76,15 @@ export interface Distribution { * * a histogram of the values of the sample points */ export interface DistributionSDKType { - /** The total number of samples in the distribution. Must be >= 0. */ count: Long; - - /** - * The arithmetic mean of the samples in the distribution. If `count` is - * zero then this field must be zero. - */ mean: number; - - /** The minimum of the population of values. Ignored if `count` is zero. */ minimum: number; - - /** The maximum of the population of values. Ignored if `count` is zero. */ maximum: number; - - /** - * The sum of squared deviations from the mean: - * Sum[i=1..count]((x_i - mean)^2) - * where each x_i is a sample values. If `count` is zero then this field - * must be zero, otherwise validation of the request fails. - */ sum_of_squared_deviation: number; - - /** - * The number of samples in each histogram bucket. `bucket_counts` are - * optional. If present, they must sum to the `count` value. - * - * The buckets are defined below in `bucket_option`. There are N buckets. - * `bucket_counts[0]` is the number of samples in the underflow bucket. - * `bucket_counts[1]` to `bucket_counts[N-1]` are the numbers of samples - * in each of the finite buckets. And `bucket_counts[N] is the number - * of samples in the overflow bucket. See the comments of `bucket_option` - * below for more details. - * - * Any suffix of trailing zeros may be omitted. - */ bucket_counts: Long[]; - - /** Buckets with constant width. */ linear_buckets?: Distribution_LinearBucketsSDKType; - - /** Buckets with exponentially growing width. */ exponential_buckets?: Distribution_ExponentialBucketsSDKType; - - /** Buckets with arbitrary user-provided width. */ explicit_buckets?: Distribution_ExplicitBucketsSDKType; - - /** Example points. Must be in increasing order of `value` field. */ exemplars: Distribution_ExemplarSDKType[]; } @@ -154,26 +115,8 @@ export interface Distribution_LinearBuckets { /** Describing buckets with constant width. */ export interface Distribution_LinearBucketsSDKType { - /** - * The number of finite buckets. With the underflow and overflow buckets, - * the total number of buckets is `num_finite_buckets` + 2. - * See comments on `bucket_options` for details. - */ num_finite_buckets: number; - - /** - * The i'th linear bucket covers the interval - * [offset + (i-1) * width, offset + i * width) - * where i ranges from 1 to num_finite_buckets, inclusive. - * Must be strictly positive. - */ width: number; - - /** - * The i'th linear bucket covers the interval - * [offset + (i-1) * width, offset + i * width) - * where i ranges from 1 to num_finite_buckets, inclusive. - */ offset: number; } @@ -205,27 +148,8 @@ export interface Distribution_ExponentialBuckets { /** Describing buckets with exponentially growing width. */ export interface Distribution_ExponentialBucketsSDKType { - /** - * The number of finite buckets. With the underflow and overflow buckets, - * the total number of buckets is `num_finite_buckets` + 2. - * See comments on `bucket_options` for details. - */ num_finite_buckets: number; - - /** - * The i'th exponential bucket covers the interval - * [scale * growth_factor^(i-1), scale * growth_factor^i) - * where i ranges from 1 to num_finite_buckets inclusive. - * Must be larger than 1.0. - */ growth_factor: number; - - /** - * The i'th exponential bucket covers the interval - * [scale * growth_factor^(i-1), scale * growth_factor^i) - * where i ranges from 1 to num_finite_buckets inclusive. - * Must be > 0. - */ scale: number; } @@ -253,23 +177,6 @@ export interface Distribution_ExplicitBuckets { /** Describing buckets with arbitrary user-provided width. */ export interface Distribution_ExplicitBucketsSDKType { - /** - * 'bound' is a list of strictly increasing boundaries between - * buckets. Note that a list of length N-1 defines N buckets because - * of fenceposting. See comments on `bucket_options` for details. - * - * The i'th finite bucket covers the interval - * [bound[i-1], bound[i]) - * where i ranges from 1 to bound_size() - 1. Note that there are no - * finite buckets at all if 'bound' only contains a single element; in - * that special case the single bound defines the boundary between the - * underflow and overflow buckets. - * - * bucket number lower bound upper bound - * i == 0 (underflow) -inf bound[i] - * 0 < i < bound_size() bound[i-1] bound[i] - * i == bound_size() (overflow) bound[i-1] +inf - */ bounds: number[]; } diff --git a/__fixtures__/output1/google/api/servicecontrol/v1/http_request.ts b/__fixtures__/output1/google/api/servicecontrol/v1/http_request.ts index f3f5b9eaf7..59e8639786 100644 --- a/__fixtures__/output1/google/api/servicecontrol/v1/http_request.ts +++ b/__fixtures__/output1/google/api/servicecontrol/v1/http_request.ts @@ -101,89 +101,20 @@ export interface HttpRequest { * information MUST be defined in a separate message. */ export interface HttpRequestSDKType { - /** The request method. Examples: `"GET"`, `"HEAD"`, `"PUT"`, `"POST"`. */ request_method: string; - - /** - * The scheme (http, https), the host name, the path, and the query - * portion of the URL that was requested. - * Example: `"http://example.com/some/info?color=red"`. - */ request_url: string; - - /** - * The size of the HTTP request message in bytes, including the request - * headers and the request body. - */ request_size: Long; - - /** - * The response code indicating the status of the response. - * Examples: 200, 404. - */ status: number; - - /** - * The size of the HTTP response message sent back to the client, in bytes, - * including the response headers and the response body. - */ response_size: Long; - - /** - * The user agent sent by the client. Example: - * `"Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET - * CLR 1.0.3705)"`. - */ user_agent: string; - - /** - * The IP address (IPv4 or IPv6) of the client that issued the HTTP - * request. Examples: `"192.168.1.1"`, `"FE80::0202:B3FF:FE1E:8329"`. - */ remote_ip: string; - - /** - * The IP address (IPv4 or IPv6) of the origin server that the request was - * sent to. - */ server_ip: string; - - /** - * The referer URL of the request, as defined in - * [HTTP/1.1 Header Field - * Definitions](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). - */ referer: string; - - /** - * The request processing latency on the server, from the time the request was - * received until the response was sent. - */ latency?: DurationSDKType; - - /** Whether or not a cache lookup was attempted. */ cache_lookup: boolean; - - /** - * Whether or not an entity was served from cache - * (with or without validation). - */ cache_hit: boolean; - - /** - * Whether or not the response was validated with the origin server before - * being served from cache. This field is only meaningful if `cache_hit` is - * True. - */ cache_validated_with_origin_server: boolean; - - /** - * The number of HTTP response bytes inserted into cache. Set only when a - * cache fill was attempted. - */ cache_fill_bytes: Long; - - /** Protocol used for the request. Examples: "HTTP/1.1", "HTTP/2", "websocket" */ protocol: string; } diff --git a/__fixtures__/output1/google/api/servicecontrol/v1/log_entry.ts b/__fixtures__/output1/google/api/servicecontrol/v1/log_entry.ts index 058bf53df1..33b7e59a41 100644 --- a/__fixtures__/output1/google/api/servicecontrol/v1/log_entry.ts +++ b/__fixtures__/output1/google/api/servicecontrol/v1/log_entry.ts @@ -94,78 +94,19 @@ export interface LogEntry { /** An individual log entry. */ export interface LogEntrySDKType { - /** - * Required. The log to which this log entry belongs. Examples: `"syslog"`, - * `"book_log"`. - */ name: string; - - /** - * The time the event described by the log entry occurred. If - * omitted, defaults to operation start time. - */ timestamp?: Date; - - /** - * The severity of the log entry. The default value is - * `LogSeverity.DEFAULT`. - */ severity: LogSeverity; - - /** - * Optional. Information about the HTTP request associated with this - * log entry, if applicable. - */ http_request?: HttpRequestSDKType; - - /** - * Optional. Resource name of the trace associated with the log entry, if any. - * If this field contains a relative resource name, you can assume the name is - * relative to `//tracing.googleapis.com`. Example: - * `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824` - */ trace: string; - - /** - * A unique ID for the log entry used for deduplication. If omitted, - * the implementation will generate one based on operation_id. - */ insert_id: string; - - /** - * A set of user-defined (key, value) data that provides additional - * information about the log entry. - */ labels: { [key: string]: string; }; - - /** - * The log entry payload, represented as a protocol buffer that is - * expressed as a JSON object. The only accepted type currently is - * [AuditLog][google.cloud.audit.AuditLog]. - */ proto_payload?: AnySDKType; - - /** The log entry payload, represented as a Unicode string (UTF-8). */ text_payload?: string; - - /** - * The log entry payload, represented as a structure that - * is expressed as a JSON object. - */ struct_payload?: StructSDKType; - - /** - * Optional. Information about an operation associated with the log entry, if - * applicable. - */ operation?: LogEntryOperationSDKType; - - /** - * Optional. Source code location information associated with the log entry, - * if any. - */ source_location?: LogEntrySourceLocationSDKType; } @@ -199,23 +140,9 @@ export interface LogEntryOperation { * a log entry is associated. */ export interface LogEntryOperationSDKType { - /** - * Optional. An arbitrary operation identifier. Log entries with the - * same identifier are assumed to be part of the same operation. - */ id: string; - - /** - * Optional. An arbitrary producer identifier. The combination of - * `id` and `producer` must be globally unique. Examples for `producer`: - * `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`. - */ producer: string; - - /** Optional. Set this to True if this is the first log entry in the operation. */ first: boolean; - - /** Optional. Set this to True if this is the last log entry in the operation. */ last: boolean; } @@ -252,26 +179,8 @@ export interface LogEntrySourceLocation { * entry. */ export interface LogEntrySourceLocationSDKType { - /** - * Optional. Source file name. Depending on the runtime environment, this - * might be a simple name or a fully-qualified name. - */ file: string; - - /** - * Optional. Line within the source file. 1-based; 0 indicates no line number - * available. - */ line: Long; - - /** - * Optional. Human-readable name of the function or method being invoked, with - * optional context such as the class or package name. This information may be - * used in contexts such as the logs viewer, where a file and line number are - * less meaningful. The format can vary by language. For example: - * `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function` - * (Python). - */ function: string; } diff --git a/__fixtures__/output1/google/api/servicecontrol/v1/metric_value.ts b/__fixtures__/output1/google/api/servicecontrol/v1/metric_value.ts index 2146996e99..bffebbb54b 100644 --- a/__fixtures__/output1/google/api/servicecontrol/v1/metric_value.ts +++ b/__fixtures__/output1/google/api/servicecontrol/v1/metric_value.ts @@ -58,45 +58,15 @@ export interface MetricValue { /** Represents a single metric value. */ export interface MetricValueSDKType { - /** - * The labels describing the metric value. - * See comments on [google.api.servicecontrol.v1.Operation.labels][google.api.servicecontrol.v1.Operation.labels] for - * the overriding relationship. - * Note that this map must not contain monitored resource labels. - */ labels: { [key: string]: string; }; - - /** - * The start of the time period over which this metric value's measurement - * applies. The time period has different semantics for different metric - * types (cumulative, delta, and gauge). See the metric definition - * documentation in the service configuration for details. If not specified, - * [google.api.servicecontrol.v1.Operation.start_time][google.api.servicecontrol.v1.Operation.start_time] will be used. - */ start_time?: Date; - - /** - * The end of the time period over which this metric value's measurement - * applies. If not specified, - * [google.api.servicecontrol.v1.Operation.end_time][google.api.servicecontrol.v1.Operation.end_time] will be used. - */ end_time?: Date; - - /** A boolean value. */ bool_value?: boolean; - - /** A signed 64-bit integer value. */ int64_value?: Long; - - /** A double precision floating point value. */ double_value?: number; - - /** A text string value. */ string_value?: string; - - /** A distribution value. */ distribution_value?: DistributionSDKType; } @@ -119,10 +89,7 @@ export interface MetricValueSet { * end time, and label values. */ export interface MetricValueSetSDKType { - /** The metric name defined in the service configuration. */ metric_name: string; - - /** The values in this metric. */ metric_values: MetricValueSDKType[]; } diff --git a/__fixtures__/output1/google/api/servicecontrol/v1/operation.ts b/__fixtures__/output1/google/api/servicecontrol/v1/operation.ts index 4d52f7df43..c781182ad6 100644 --- a/__fixtures__/output1/google/api/servicecontrol/v1/operation.ts +++ b/__fixtures__/output1/google/api/servicecontrol/v1/operation.ts @@ -155,93 +155,17 @@ export interface Operation { /** Represents information regarding an operation. */ export interface OperationSDKType { - /** - * Identity of the operation. This must be unique within the scope of the - * service that generated the operation. If the service calls - * Check() and Report() on the same operation, the two calls should carry - * the same id. - * - * UUID version 4 is recommended, though not required. - * In scenarios where an operation is computed from existing information - * and an idempotent id is desirable for deduplication purpose, UUID version 5 - * is recommended. See RFC 4122 for details. - */ operation_id: string; - - /** Fully qualified name of the operation. Reserved for future use. */ operation_name: string; - - /** - * Identity of the consumer who is using the service. - * This field should be filled in for the operations initiated by a - * consumer, but not for service-initiated operations that are - * not related to a specific consumer. - * - * - This can be in one of the following formats: - * - project:PROJECT_ID, - * - project`_`number:PROJECT_NUMBER, - * - projects/PROJECT_ID or PROJECT_NUMBER, - * - folders/FOLDER_NUMBER, - * - organizations/ORGANIZATION_NUMBER, - * - api`_`key:API_KEY. - */ consumer_id: string; - - /** Required. Start time of the operation. */ start_time?: Date; - - /** - * End time of the operation. - * Required when the operation is used in - * [ServiceController.Report][google.api.servicecontrol.v1.ServiceController.Report], - * but optional when the operation is used in - * [ServiceController.Check][google.api.servicecontrol.v1.ServiceController.Check]. - */ end_time?: Date; - - /** - * Labels describing the operation. Only the following labels are allowed: - * - * - Labels describing monitored resources as defined in - * the service configuration. - * - Default labels of metric values. When specified, labels defined in the - * metric value override these default. - * - The following labels defined by Google Cloud Platform: - * - `cloud.googleapis.com/location` describing the location where the - * operation happened, - * - `servicecontrol.googleapis.com/user_agent` describing the user agent - * of the API request, - * - `servicecontrol.googleapis.com/service_agent` describing the service - * used to handle the API request (e.g. ESP), - * - `servicecontrol.googleapis.com/platform` describing the platform - * where the API is served, such as App Engine, Compute Engine, or - * Kubernetes Engine. - */ labels: { [key: string]: string; }; - - /** - * Represents information about this operation. Each MetricValueSet - * corresponds to a metric defined in the service configuration. - * The data type used in the MetricValueSet must agree with - * the data type specified in the metric definition. - * - * Within a single operation, it is not allowed to have more than one - * MetricValue instances that have the same metric names and identical - * label value combinations. If a request has such duplicated MetricValue - * instances, the entire request is rejected with - * an invalid argument error. - */ metric_value_sets: MetricValueSetSDKType[]; - - /** Represents information to be logged. */ log_entries: LogEntrySDKType[]; - - /** DO NOT USE. This is an experimental field. */ importance: Operation_Importance; - - /** Unimplemented. */ extensions: AnySDKType[]; } diff --git a/__fixtures__/output1/google/api/servicecontrol/v1/quota_controller.ts b/__fixtures__/output1/google/api/servicecontrol/v1/quota_controller.ts index f9b0128a9b..4a18f2fb46 100644 --- a/__fixtures__/output1/google/api/servicecontrol/v1/quota_controller.ts +++ b/__fixtures__/output1/google/api/servicecontrol/v1/quota_controller.ts @@ -231,22 +231,8 @@ export interface AllocateQuotaRequest { /** Request message for the AllocateQuota method. */ export interface AllocateQuotaRequestSDKType { - /** - * Name of the service as specified in the service configuration. For example, - * `"pubsub.googleapis.com"`. - * - * See [google.api.Service][google.api.Service] for the definition of a service name. - */ service_name: string; - - /** Operation that describes the quota allocation. */ allocate_operation?: QuotaOperationSDKType; - - /** - * Specifies which version of service configuration should be used to process - * the request. If unspecified or no matching version can be found, the latest - * one will be used. - */ service_config_id: string; } export interface QuotaOperation_LabelsEntry { @@ -325,66 +311,13 @@ export interface QuotaOperation { /** Represents information regarding a quota operation. */ export interface QuotaOperationSDKType { - /** - * Identity of the operation. This is expected to be unique within the scope - * of the service that generated the operation, and guarantees idempotency in - * case of retries. - * - * In order to ensure best performance and latency in the Quota backends, - * operation_ids are optimally associated with time, so that related - * operations can be accessed fast in storage. For this reason, the - * recommended token for services that intend to operate at a high QPS is - * Unix time in nanos + UUID - */ operation_id: string; - - /** - * Fully qualified name of the API method for which this quota operation is - * requested. This name is used for matching quota rules or metric rules and - * billing status rules defined in service configuration. - * - * This field should not be set if any of the following is true: - * (1) the quota operation is performed on non-API resources. - * (2) quota_metrics is set because the caller is doing quota override. - * - * - * Example of an RPC method name: - * google.example.library.v1.LibraryService.CreateShelf - */ method_name: string; - - /** - * Identity of the consumer for whom this quota operation is being performed. - * - * This can be in one of the following formats: - * project:, - * project_number:, - * api_key:. - */ consumer_id: string; - - /** Labels describing the operation. */ labels: { [key: string]: string; }; - - /** - * Represents information about this operation. Each MetricValueSet - * corresponds to a metric defined in the service configuration. - * The data type used in the MetricValueSet must agree with - * the data type specified in the metric definition. - * - * Within a single operation, it is not allowed to have more than one - * MetricValue instances that have the same metric names and identical - * label value combinations. If a request has such duplicated MetricValue - * instances, the entire request is rejected with - * an invalid argument error. - * - * This field is mutually exclusive with method_name. - */ quota_metrics: MetricValueSetSDKType[]; - - /** Quota mode for this operation. */ quota_mode: QuotaOperation_QuotaMode; } @@ -419,30 +352,9 @@ export interface AllocateQuotaResponse { /** Response message for the AllocateQuota method. */ export interface AllocateQuotaResponseSDKType { - /** - * The same operation_id value used in the AllocateQuotaRequest. Used for - * logging and diagnostics purposes. - */ operation_id: string; - - /** Indicates the decision of the allocate. */ allocate_errors: QuotaErrorSDKType[]; - - /** - * Quota metrics to indicate the result of allocation. Depending on the - * request, one or more of the following metrics will be included: - * - * 1. Per quota group or per quota metric incremental usage will be specified - * using the following delta metric : - * "serviceruntime.googleapis.com/api/consumer/quota_used_count" - * - * 2. The quota limit reached condition will be specified using the following - * boolean metric : - * "serviceruntime.googleapis.com/quota/exceeded" - */ quota_metrics: MetricValueSetSDKType[]; - - /** ID of the actual config used to process the request. */ service_config_id: string; } @@ -470,23 +382,9 @@ export interface QuotaError { /** Represents error information for [QuotaOperation][google.api.servicecontrol.v1.QuotaOperation]. */ export interface QuotaErrorSDKType { - /** Error code. */ code: QuotaError_Code; - - /** - * Subject to whom this error applies. See the specific enum for more details - * on this field. For example, "clientip:" or - * "project:". - */ subject: string; - - /** Free-form text that provides details on the cause of the error. */ description: string; - - /** - * Contains additional information about the quota error. - * If available, `status.code` will be non zero. - */ status?: StatusSDKType; } diff --git a/__fixtures__/output1/google/api/servicecontrol/v1/service_controller.ts b/__fixtures__/output1/google/api/servicecontrol/v1/service_controller.ts index 76d3c67f1c..3d3ea34ae7 100644 --- a/__fixtures__/output1/google/api/servicecontrol/v1/service_controller.ts +++ b/__fixtures__/output1/google/api/servicecontrol/v1/service_controller.ts @@ -109,26 +109,8 @@ export interface CheckRequest { /** Request message for the Check method. */ export interface CheckRequestSDKType { - /** - * The service name as specified in its service configuration. For example, - * `"pubsub.googleapis.com"`. - * - * See - * [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service) - * for the definition of a service name. - */ service_name: string; - - /** The operation to be checked. */ operation?: OperationSDKType; - - /** - * Specifies which version of service configuration should be used to process - * the request. - * - * If unspecified or no matching version can be found, the - * latest one will be used. - */ service_config_id: string; } @@ -162,29 +144,10 @@ export interface CheckResponse { /** Response message for the Check method. */ export interface CheckResponseSDKType { - /** - * The same operation_id value used in the - * [CheckRequest][google.api.servicecontrol.v1.CheckRequest]. Used for logging - * and diagnostics purposes. - */ operation_id: string; - - /** - * Indicate the decision of the check. - * - * If no check errors are present, the service should process the operation. - * Otherwise the service should use the list of errors to determine the - * appropriate action. - */ check_errors: CheckErrorSDKType[]; - - /** The actual config id used to process the request. */ service_config_id: string; - - /** The current service rollout id used to process the request. */ service_rollout_id: string; - - /** Feedback data returned from the server during processing a Check request. */ check_info?: CheckResponse_CheckInfoSDKType; } @@ -203,14 +166,7 @@ export interface CheckResponse_CheckInfo { /** Contains additional information about the check operation. */ export interface CheckResponse_CheckInfoSDKType { - /** - * A list of fields and label keys that are ignored by the server. - * The client doesn't need to send them for following requests to improve - * performance and allow better aggregation. - */ unused_arguments: string[]; - - /** Consumer info of this check. */ consumer_info?: CheckResponse_ConsumerInfoSDKType; } @@ -241,26 +197,8 @@ export interface CheckResponse_ConsumerInfo { /** `ConsumerInfo` provides information about the consumer. */ export interface CheckResponse_ConsumerInfoSDKType { - /** - * The Google cloud project number, e.g. 1234567890. A value of 0 indicates - * no project number is found. - * - * NOTE: This field is deprecated after we support flexible consumer - * id. New code should not depend on this field anymore. - */ project_number: Long; - - /** - * The type of the consumer which should have been defined in - * [Google Resource Manager](https://cloud.google.com/resource-manager/). - */ type: CheckResponse_ConsumerInfo_ConsumerType; - - /** - * The consumer identity number, can be Google cloud project number, folder - * number or organization number e.g. 1234567890. A value of 0 indicates no - * consumer number is found. - */ consumer_number: Long; } @@ -303,38 +241,8 @@ export interface ReportRequest { /** Request message for the Report method. */ export interface ReportRequestSDKType { - /** - * The service name as specified in its service configuration. For example, - * `"pubsub.googleapis.com"`. - * - * See - * [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service) - * for the definition of a service name. - */ service_name: string; - - /** - * Operations to be reported. - * - * Typically the service should report one operation per request. - * Putting multiple operations into a single request is allowed, but should - * be used only when multiple operations are natually available at the time - * of the report. - * - * There is no limit on the number of operations in the same ReportRequest, - * however the ReportRequest size should be no larger than 1MB. See - * [ReportResponse.report_errors][google.api.servicecontrol.v1.ReportResponse.report_errors] - * for partial failure behavior. - */ operations: OperationSDKType[]; - - /** - * Specifies which version of service config should be used to process the - * request. - * - * If unspecified or no matching version can be found, the - * latest one will be used. - */ service_config_id: string; } @@ -367,28 +275,8 @@ export interface ReportResponse { /** Response message for the Report method. */ export interface ReportResponseSDKType { - /** - * Partial failures, one for each `Operation` in the request that failed - * processing. There are three possible combinations of the RPC status: - * - * 1. The combination of a successful RPC status and an empty `report_errors` - * list indicates a complete success where all `Operations` in the - * request are processed successfully. - * 2. The combination of a successful RPC status and a non-empty - * `report_errors` list indicates a partial success where some - * `Operations` in the request succeeded. Each - * `Operation` that failed processing has a corresponding item - * in this list. - * 3. A failed RPC status indicates a general non-deterministic failure. - * When this happens, it's impossible to know which of the - * 'Operations' in the request succeeded or failed. - */ report_errors: ReportResponse_ReportErrorSDKType[]; - - /** The actual config id used to process the request. */ service_config_id: string; - - /** The current service rollout id used to process the request. */ service_rollout_id: string; } @@ -416,17 +304,7 @@ export interface ReportResponse_ReportError { * [Operation][google.api.servicecontrol.v1.Operation] in the request. */ export interface ReportResponse_ReportErrorSDKType { - /** - * The - * [Operation.operation_id][google.api.servicecontrol.v1.Operation.operation_id] - * value from the request. - */ operation_id: string; - - /** - * Details of the error when processing the - * [Operation][google.api.servicecontrol.v1.Operation]. - */ status?: StatusSDKType; } diff --git a/__fixtures__/output1/google/api/servicecontrol/v2/service_controller.ts b/__fixtures__/output1/google/api/servicecontrol/v2/service_controller.ts index 0ec62fc919..bbc4bc82e1 100644 --- a/__fixtures__/output1/google/api/servicecontrol/v2/service_controller.ts +++ b/__fixtures__/output1/google/api/servicecontrol/v2/service_controller.ts @@ -35,30 +35,10 @@ export interface CheckRequest { /** Request message for the Check method. */ export interface CheckRequestSDKType { - /** - * The service name as specified in its service configuration. For example, - * `"pubsub.googleapis.com"`. - * - * See - * [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service) - * for the definition of a service name. - */ service_name: string; - - /** - * Specifies the version of the service configuration that should be used to - * process the request. Must not be empty. Set this field to 'latest' to - * specify using the latest configuration. - */ service_config_id: string; - - /** Describes attributes about the operation being executed by the service. */ attributes?: AttributeContextSDKType; - - /** Describes the resources and the policies applied to each resource. */ resources: ResourceInfoSDKType[]; - - /** Optional. Contains a comma-separated list of flags. */ flags: string; } @@ -98,35 +78,10 @@ export interface ResourceInfo { /** Describes a resource referenced in the request. */ export interface ResourceInfoSDKType { - /** The name of the resource referenced in the request. */ name: string; - - /** The resource type in the format of "{service}/{kind}". */ type: string; - - /** - * The resource permission needed for this request. - * The format must be "{service}/{plural}.{verb}". - */ permission: string; - - /** - * Optional. The identifier of the container of this resource. For Google - * Cloud APIs, the resource container must be one of the following formats: - * - `projects/` - * - `folders/` - * - `organizations/` - * For the policy enforcement on the container level (VPCSC and Location - * Policy check), this field takes precedence on the container extracted from - * name when presents. - */ container: string; - - /** - * Optional. The location of the resource. The value must be a valid zone, - * region or multiregion. For example: "europe-west4" or - * "northamerica-northeast1-a" - */ location: string; } export interface CheckResponse_HeadersEntry { @@ -155,14 +110,7 @@ export interface CheckResponse { /** Response message for the Check method. */ export interface CheckResponseSDKType { - /** - * Operation is allowed when this field is not set. Any non-'OK' status - * indicates a denial; [google.rpc.Status.details][google.rpc.Status.details] - * would contain additional details about the denial. - */ status?: StatusSDKType; - - /** Returns a set of request contexts generated from the `CheckRequest`. */ headers: { [key: string]: string; }; @@ -197,28 +145,8 @@ export interface ReportRequest { /** Request message for the Report method. */ export interface ReportRequestSDKType { - /** - * The service name as specified in its service configuration. For example, - * `"pubsub.googleapis.com"`. - * - * See - * [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service) - * for the definition of a service name. - */ service_name: string; - - /** - * Specifies the version of the service configuration that should be used to - * process the request. Must not be empty. Set this field to 'latest' to - * specify using the latest configuration. - */ service_config_id: string; - - /** - * Describes the list of operations to be reported. Each operation is - * represented as an AttributeContext, and contains all attributes around an - * API access. - */ operations: AttributeContextSDKType[]; } diff --git a/__fixtures__/output1/google/api/servicemanagement/v1/resources.ts b/__fixtures__/output1/google/api/servicemanagement/v1/resources.ts index 1997f75bee..e71330e44b 100644 --- a/__fixtures__/output1/google/api/servicemanagement/v1/resources.ts +++ b/__fixtures__/output1/google/api/servicemanagement/v1/resources.ts @@ -335,13 +335,7 @@ export interface ManagedService { * Google Service Management. */ export interface ManagedServiceSDKType { - /** - * The name of the service. See the [overview](/service-management/overview) - * for naming requirements. - */ service_name: string; - - /** ID of the project that produces and owns this service. */ producer_project_id: string; } @@ -365,19 +359,9 @@ export interface OperationMetadata { /** The metadata associated with a long running operation resource. */ export interface OperationMetadataSDKType { - /** - * The full name of the resources that this operation is directly - * associated with. - */ resource_names: string[]; - - /** Detailed status information for each step. The order is undetermined. */ steps: OperationMetadata_StepSDKType[]; - - /** Percentage of completion of this operation, ranging from 0 to 100. */ progress_percentage: number; - - /** The start time of the operation. */ start_time?: Date; } @@ -392,10 +376,7 @@ export interface OperationMetadata_Step { /** Represents the status of one operation step. */ export interface OperationMetadata_StepSDKType { - /** The short description of the step. */ description: string; - - /** The status code. */ status: OperationMetadata_Status; } @@ -413,13 +394,8 @@ export interface Diagnostic { /** Represents a diagnostic message (error or warning) */ export interface DiagnosticSDKType { - /** File name and line number of the error or warning. */ location: string; - - /** The kind of diagnostic information provided. */ kind: Diagnostic_Kind; - - /** Message describing the error or warning. */ message: string; } @@ -447,17 +423,7 @@ export interface ConfigSource { * defined by `google.api.Service`. */ export interface ConfigSourceSDKType { - /** - * A unique ID for a specific instance of this message, typically assigned - * by the client for tracking purpose. If empty, the server may choose to - * generate one instead. - */ id: string; - - /** - * Set of source configuration files that are used to generate a service - * configuration (`google.api.Service`). - */ files: ConfigFileSDKType[]; } @@ -475,13 +441,8 @@ export interface ConfigFile { /** Generic specification of a source configuration file */ export interface ConfigFileSDKType { - /** The file name of the configuration file (full or relative path). */ file_path: string; - - /** The bytes that constitute the file. */ file_contents: Uint8Array; - - /** The type of configuration file this represents. */ file_type: ConfigFile_FileType; } @@ -496,10 +457,6 @@ export interface ConfigRef { /** Represents a service configuration with its name and id. */ export interface ConfigRefSDKType { - /** - * Resource name of a service config. It must have the following - * format: "services/{service name}/configs/{config id}". - */ name: string; } @@ -527,13 +484,6 @@ export interface ChangeReport { * two service configurations. */ export interface ChangeReportSDKType { - /** - * List of changes between two service configurations. - * The changes will be alphabetically sorted based on the identifier - * of each change. - * A ConfigChange identifier is a dot separated path to the configuration. - * Example: visibility.rules[selector='LibraryService.CreateBook'].restriction - */ config_changes: ConfigChangeSDKType[]; } @@ -590,44 +540,12 @@ export interface Rollout { * service config, and then create a Rollout to push the service config. */ export interface RolloutSDKType { - /** - * Optional. Unique identifier of this Rollout. Must be no longer than 63 characters - * and only lower case letters, digits, '.', '_' and '-' are allowed. - * - * If not specified by client, the server will generate one. The generated id - * will have the form of , where "date" is the create - * date in ISO 8601 format. "revision number" is a monotonically increasing - * positive number that is reset every day for each service. - * An example of the generated rollout_id is '2016-02-16r1' - */ rollout_id: string; - - /** Creation time of the rollout. Readonly. */ create_time?: Date; - - /** The user who created the Rollout. Readonly. */ created_by: string; - - /** - * The status of this rollout. Readonly. In case of a failed rollout, - * the system will automatically rollback to the current Rollout - * version. Readonly. - */ status: Rollout_RolloutStatus; - - /** - * Google Service Control selects service configurations based on - * traffic percentage. - */ traffic_percent_strategy?: Rollout_TrafficPercentStrategySDKType; - - /** - * The strategy associated with a rollout to delete a `ManagedService`. - * Readonly. - */ delete_service_strategy?: Rollout_DeleteServiceStrategySDKType; - - /** The name of the service associated with this Rollout. */ service_name: string; } export interface Rollout_TrafficPercentStrategy_PercentagesEntry { @@ -715,11 +633,6 @@ export interface Rollout_TrafficPercentStrategy { * } */ export interface Rollout_TrafficPercentStrategySDKType { - /** - * Maps service configuration IDs to their corresponding traffic percentage. - * Key is the service configuration ID, Value is the traffic percentage - * which must be greater than 0.0 and the sum must equal to 100.0. - */ percentages: { [key: string]: number; }; diff --git a/__fixtures__/output1/google/api/servicemanagement/v1/servicemanager.ts b/__fixtures__/output1/google/api/servicemanagement/v1/servicemanager.ts index b6347a05ec..a2fda284e5 100644 --- a/__fixtures__/output1/google/api/servicemanagement/v1/servicemanager.ts +++ b/__fixtures__/output1/google/api/servicemanagement/v1/servicemanager.ts @@ -79,29 +79,10 @@ export interface ListServicesRequest { /** Request message for `ListServices` method. */ export interface ListServicesRequestSDKType { - /** Include services produced by the specified project. */ producer_project_id: string; - - /** - * The max number of items to include in the response list. Page size is 50 - * if not specified. Maximum value is 100. - */ page_size: number; - - /** - * Token identifying which result to start with; returned by a previous list - * call. - */ page_token: string; - /** - * Include services consumed by the specified consumer. - * - * The Google Service Management implementation accepts the following - * forms: - * - project: - */ - /** @deprecated */ consumer_id: string; } @@ -117,10 +98,7 @@ export interface ListServicesResponse { /** Response message for `ListServices` method. */ export interface ListServicesResponseSDKType { - /** The returned services will only have the name field set. */ services: ManagedServiceSDKType[]; - - /** Token that can be passed to `ListServices` to resume a paginated query. */ next_page_token: string; } @@ -135,10 +113,6 @@ export interface GetServiceRequest { /** Request message for `GetService` method. */ export interface GetServiceRequestSDKType { - /** - * Required. The name of the service. See the `ServiceManager` overview for naming - * requirements. For example: `example.googleapis.com`. - */ service_name: string; } @@ -150,7 +124,6 @@ export interface CreateServiceRequest { /** Request message for CreateService method. */ export interface CreateServiceRequestSDKType { - /** Required. Initial values for the service resource. */ service?: ManagedServiceSDKType; } @@ -165,10 +138,6 @@ export interface DeleteServiceRequest { /** Request message for DeleteService method. */ export interface DeleteServiceRequestSDKType { - /** - * Required. The name of the service. See the [overview](/service-management/overview) - * for naming requirements. For example: `example.googleapis.com`. - */ service_name: string; } @@ -183,10 +152,6 @@ export interface UndeleteServiceRequest { /** Request message for UndeleteService method. */ export interface UndeleteServiceRequestSDKType { - /** - * Required. The name of the service. See the [overview](/service-management/overview) - * for naming requirements. For example: `example.googleapis.com`. - */ service_name: string; } @@ -198,7 +163,6 @@ export interface UndeleteServiceResponse { /** Response message for UndeleteService method. */ export interface UndeleteServiceResponseSDKType { - /** Revived service resource. */ service?: ManagedServiceSDKType; } @@ -227,24 +191,8 @@ export interface GetServiceConfigRequest { /** Request message for GetServiceConfig method. */ export interface GetServiceConfigRequestSDKType { - /** - * Required. The name of the service. See the [overview](/service-management/overview) - * for naming requirements. For example: `example.googleapis.com`. - */ service_name: string; - - /** - * Required. The id of the service configuration resource. - * - * This field must be specified for the server to return all fields, including - * `SourceInfo`. - */ config_id: string; - - /** - * Specifies which parts of the Service Config should be returned in the - * response. - */ view: GetServiceConfigRequest_ConfigView; } @@ -268,19 +216,8 @@ export interface ListServiceConfigsRequest { /** Request message for ListServiceConfigs method. */ export interface ListServiceConfigsRequestSDKType { - /** - * Required. The name of the service. See the [overview](/service-management/overview) - * for naming requirements. For example: `example.googleapis.com`. - */ service_name: string; - - /** The token of the page to retrieve. */ page_token: string; - - /** - * The max number of items to include in the response list. Page size is 50 - * if not specified. Maximum value is 100. - */ page_size: number; } @@ -295,10 +232,7 @@ export interface ListServiceConfigsResponse { /** Response message for ListServiceConfigs method. */ export interface ListServiceConfigsResponseSDKType { - /** The list of service configuration resources. */ service_configs: ServiceSDKType[]; - - /** The token of the next page of results. */ next_page_token: string; } @@ -316,13 +250,7 @@ export interface CreateServiceConfigRequest { /** Request message for CreateServiceConfig method. */ export interface CreateServiceConfigRequestSDKType { - /** - * Required. The name of the service. See the [overview](/service-management/overview) - * for naming requirements. For example: `example.googleapis.com`. - */ service_name: string; - - /** Required. The service configuration resource. */ service_config?: ServiceSDKType; } @@ -347,20 +275,8 @@ export interface SubmitConfigSourceRequest { /** Request message for SubmitConfigSource method. */ export interface SubmitConfigSourceRequestSDKType { - /** - * Required. The name of the service. See the [overview](/service-management/overview) - * for naming requirements. For example: `example.googleapis.com`. - */ service_name: string; - - /** Required. The source configuration for the service. */ config_source?: ConfigSourceSDKType; - - /** - * Optional. If set, this will result in the generation of a - * `google.api.Service` configuration based on the `ConfigSource` provided, - * but the generated config and the sources will NOT be persisted. - */ validate_only: boolean; } @@ -372,7 +288,6 @@ export interface SubmitConfigSourceResponse { /** Response message for SubmitConfigSource method. */ export interface SubmitConfigSourceResponseSDKType { - /** The generated service configuration. */ service_config?: ServiceSDKType; } @@ -390,13 +305,7 @@ export interface CreateServiceRolloutRequest { /** Request message for 'CreateServiceRollout' */ export interface CreateServiceRolloutRequestSDKType { - /** - * Required. The name of the service. See the [overview](/service-management/overview) - * for naming requirements. For example: `example.googleapis.com`. - */ service_name: string; - - /** Required. The rollout resource. The `service_name` field is output only. */ rollout?: RolloutSDKType; } @@ -432,31 +341,9 @@ export interface ListServiceRolloutsRequest { /** Request message for 'ListServiceRollouts' */ export interface ListServiceRolloutsRequestSDKType { - /** - * Required. The name of the service. See the [overview](/service-management/overview) - * for naming requirements. For example: `example.googleapis.com`. - */ service_name: string; - - /** The token of the page to retrieve. */ page_token: string; - - /** - * The max number of items to include in the response list. Page size is 50 - * if not specified. Maximum value is 100. - */ page_size: number; - - /** - * Required. Use `filter` to return subset of rollouts. - * The following filters are supported: - * -- To limit the results to only those in - * [status](google.api.servicemanagement.v1.RolloutStatus) 'SUCCESS', - * use filter='status=SUCCESS' - * -- To limit the results to those in - * [status](google.api.servicemanagement.v1.RolloutStatus) 'CANCELLED' - * or 'FAILED', use filter='status=CANCELLED OR status=FAILED' - */ filter: string; } @@ -471,10 +358,7 @@ export interface ListServiceRolloutsResponse { /** Response message for ListServiceRollouts method. */ export interface ListServiceRolloutsResponseSDKType { - /** The list of rollout resources. */ rollouts: RolloutSDKType[]; - - /** The token of the next page of results. */ next_page_token: string; } @@ -492,13 +376,7 @@ export interface GetServiceRolloutRequest { /** Request message for GetServiceRollout method. */ export interface GetServiceRolloutRequestSDKType { - /** - * Required. The name of the service. See the [overview](/service-management/overview) - * for naming requirements. For example: `example.googleapis.com`. - */ service_name: string; - - /** Required. The id of the rollout resource. */ rollout_id: string; } @@ -525,22 +403,7 @@ export interface GenerateConfigReportRequest { /** Request message for GenerateConfigReport method. */ export interface GenerateConfigReportRequestSDKType { - /** - * Required. Service configuration for which we want to generate the report. - * For this version of API, the supported types are - * [google.api.servicemanagement.v1.ConfigRef][google.api.servicemanagement.v1.ConfigRef], - * [google.api.servicemanagement.v1.ConfigSource][google.api.servicemanagement.v1.ConfigSource], - * and [google.api.Service][google.api.Service] - */ new_config?: AnySDKType; - - /** - * Optional. Service configuration against which the comparison will be done. - * For this version of API, the supported types are - * [google.api.servicemanagement.v1.ConfigRef][google.api.servicemanagement.v1.ConfigRef], - * [google.api.servicemanagement.v1.ConfigSource][google.api.servicemanagement.v1.ConfigSource], - * and [google.api.Service][google.api.Service] - */ old_config?: AnySDKType; } @@ -568,23 +431,9 @@ export interface GenerateConfigReportResponse { /** Response message for GenerateConfigReport method. */ export interface GenerateConfigReportResponseSDKType { - /** Name of the service this report belongs to. */ service_name: string; - - /** ID of the service configuration this report belongs to. */ id: string; - - /** - * list of ChangeReport, each corresponding to comparison between two - * service configurations. - */ change_reports: ChangeReportSDKType[]; - - /** - * Errors / Linter warnings associated with the service definition this - * report - * belongs to. - */ diagnostics: DiagnosticSDKType[]; } diff --git a/__fixtures__/output1/google/api/serviceusage/v1/resources.ts b/__fixtures__/output1/google/api/serviceusage/v1/resources.ts index 9eb8587598..d9695d6a4a 100644 --- a/__fixtures__/output1/google/api/serviceusage/v1/resources.ts +++ b/__fixtures__/output1/google/api/serviceusage/v1/resources.ts @@ -99,31 +99,9 @@ export interface Service { /** A service that is available for use by the consumer. */ export interface ServiceSDKType { - /** - * The resource name of the consumer and service. - * - * A valid name would be: - * - projects/123/services/serviceusage.googleapis.com - */ name: string; - - /** - * The resource name of the consumer. - * - * A valid name would be: - * - projects/123 - */ parent: string; - - /** - * The service configuration of the available service. - * Some fields may be filtered out of the configuration in responses to - * the `ListServices` method. These fields are present only in responses to - * the `GetService` method. - */ config?: ServiceConfigSDKType; - - /** Whether or not the service has been enabled for use by the consumer. */ state: State; } @@ -182,54 +160,15 @@ export interface ServiceConfig { /** The configuration of the service. */ export interface ServiceConfigSDKType { - /** - * The DNS address at which this service is available. - * - * An example DNS address would be: - * `calendar.googleapis.com`. - */ name: string; - - /** The product title for this service. */ title: string; - - /** - * A list of API interfaces exported by this service. Contains only the names, - * versions, and method names of the interfaces. - */ apis: ApiSDKType[]; - - /** - * Additional API documentation. Contains only the summary and the - * documentation URL. - */ documentation?: DocumentationSDKType; - - /** Quota configuration. */ quota?: QuotaSDKType; - - /** Auth configuration. Contains only the OAuth rules. */ authentication?: AuthenticationSDKType; - - /** Configuration controlling usage of this service. */ usage?: UsageSDKType; - - /** - * Configuration for network endpoints. Contains only the names and aliases - * of the endpoints. - */ endpoints: EndpointSDKType[]; - - /** - * Defines the monitored resources used by this service. This is required - * by the [Service.monitoring][google.api.Service.monitoring] and [Service.logging][google.api.Service.logging] configurations. - */ monitored_resources: MonitoredResourceDescriptorSDKType[]; - - /** - * Monitoring configuration. - * This should not include the 'producer_destinations' field. - */ monitoring?: MonitoringSDKType; } @@ -244,10 +183,6 @@ export interface OperationMetadata { /** The operation metadata returned for the batchend services operation. */ export interface OperationMetadataSDKType { - /** - * The full name of the resources that this operation is directly - * associated with. - */ resource_names: string[]; } diff --git a/__fixtures__/output1/google/api/serviceusage/v1/serviceusage.ts b/__fixtures__/output1/google/api/serviceusage/v1/serviceusage.ts index ef5be8c988..648658c603 100644 --- a/__fixtures__/output1/google/api/serviceusage/v1/serviceusage.ts +++ b/__fixtures__/output1/google/api/serviceusage/v1/serviceusage.ts @@ -80,19 +80,6 @@ export interface EnableServiceRequest { /** Request message for the `EnableService` method. */ export interface EnableServiceRequestSDKType { - /** - * Name of the consumer and service to enable the service on. - * - * The `EnableService` and `DisableService` methods currently only support - * projects. - * - * Enabling a service requires that the service is public or is shared with - * the user enabling the service. - * - * An example name would be: - * `projects/123/services/serviceusage.googleapis.com` where `123` is the - * project number. - */ name: string; } @@ -112,7 +99,6 @@ export interface EnableServiceResponse { * Operation when that operation is done. */ export interface EnableServiceResponseSDKType { - /** The new state of the service after enabling. */ service?: ServiceSDKType; } @@ -144,27 +130,8 @@ export interface DisableServiceRequest { /** Request message for the `DisableService` method. */ export interface DisableServiceRequestSDKType { - /** - * Name of the consumer and service to disable the service on. - * - * The enable and disable methods currently only support projects. - * - * An example name would be: - * `projects/123/services/serviceusage.googleapis.com` where `123` is the - * project number. - */ name: string; - - /** - * Indicates if services that are enabled and which depend on this service - * should also be disabled. If not set, an error will be generated if any - * enabled services depend on the service to be disabled. When set, the - * service, and any enabled services that depend on it, will be disabled - * together. - */ disable_dependent_services: boolean; - - /** Defines the behavior for checking service usage when disabling a service. */ check_if_service_has_usage: DisableServiceRequest_CheckIfServiceHasUsage; } @@ -184,7 +151,6 @@ export interface DisableServiceResponse { * Operation when that operation is done. */ export interface DisableServiceResponseSDKType { - /** The new state of the service after disabling. */ service?: ServiceSDKType; } @@ -202,13 +168,6 @@ export interface GetServiceRequest { /** Request message for the `GetService` method. */ export interface GetServiceRequestSDKType { - /** - * Name of the consumer and service to get the `ConsumerState` for. - * - * An example name would be: - * `projects/123/services/serviceusage.googleapis.com` where `123` is the - * project number. - */ name: string; } @@ -244,31 +203,9 @@ export interface ListServicesRequest { /** Request message for the `ListServices` method. */ export interface ListServicesRequestSDKType { - /** - * Parent to search for services on. - * - * An example name would be: - * `projects/123` where `123` is the project number. - */ parent: string; - - /** - * Requested size of the next page of data. - * Requested page size cannot exceed 200. - * If not set, the default page size is 50. - */ page_size: number; - - /** - * Token identifying which result to start with, which is returned by a - * previous list call. - */ page_token: string; - - /** - * Only list services that conform to the given filter. - * The allowed filter strings are `state:ENABLED` and `state:DISABLED`. - */ filter: string; } @@ -286,13 +223,7 @@ export interface ListServicesResponse { /** Response message for the `ListServices` method. */ export interface ListServicesResponseSDKType { - /** The available services for the requested project. */ services: ServiceSDKType[]; - - /** - * Token that can be passed to `ListServices` to resume a paginated - * query. - */ next_page_token: string; } @@ -326,29 +257,7 @@ export interface BatchEnableServicesRequest { /** Request message for the `BatchEnableServices` method. */ export interface BatchEnableServicesRequestSDKType { - /** - * Parent to enable services on. - * - * An example name would be: - * `projects/123` where `123` is the project number. - * - * The `BatchEnableServices` method currently only supports projects. - */ parent: string; - - /** - * The identifiers of the services to enable on the project. - * - * A valid identifier would be: - * serviceusage.googleapis.com - * - * Enabling services requires that each service is public or is shared with - * the user enabling the service. - * - * A single request can enable a maximum of 20 services at a time. If more - * than 20 services are specified, the request will fail, and no state changes - * will occur. - */ service_ids: string[]; } @@ -374,13 +283,7 @@ export interface BatchEnableServicesResponse { * Operation when that operation is done. */ export interface BatchEnableServicesResponseSDKType { - /** The new state of the services after enabling. */ services: ServiceSDKType[]; - - /** - * If allow_partial_success is true, and one or more services could not be - * enabled, this field contains the details about each failure. - */ failures: BatchEnableServicesResponse_EnableFailureSDKType[]; } @@ -395,10 +298,7 @@ export interface BatchEnableServicesResponse_EnableFailure { /** Provides error messages for the failing services. */ export interface BatchEnableServicesResponse_EnableFailureSDKType { - /** The service id of a service that could not be enabled. */ service_id: string; - - /** An error message describing why the service could not be enabled. */ error_message: string; } @@ -426,23 +326,7 @@ export interface BatchGetServicesRequest { /** Request message for the `BatchGetServices` method. */ export interface BatchGetServicesRequestSDKType { - /** - * Parent to retrieve services from. - * If this is set, the parent of all of the services specified in `names` must - * match this field. An example name would be: `projects/123` where `123` is - * the project number. The `BatchGetServices` method currently only supports - * projects. - */ parent: string; - - /** - * Names of the services to retrieve. - * - * An example name would be: - * `projects/123/services/serviceusage.googleapis.com` where `123` is the - * project number. - * A single request can get a maximum of 30 services at a time. - */ names: string[]; } @@ -454,7 +338,6 @@ export interface BatchGetServicesResponse { /** Response message for the `BatchGetServices` method. */ export interface BatchGetServicesResponseSDKType { - /** The requested Service states. */ services: ServiceSDKType[]; } diff --git a/__fixtures__/output1/google/api/serviceusage/v1beta1/resources.ts b/__fixtures__/output1/google/api/serviceusage/v1beta1/resources.ts index f77436a0cb..9e01759946 100644 --- a/__fixtures__/output1/google/api/serviceusage/v1beta1/resources.ts +++ b/__fixtures__/output1/google/api/serviceusage/v1beta1/resources.ts @@ -218,31 +218,9 @@ export interface Service { /** A service that is available for use by the consumer. */ export interface ServiceSDKType { - /** - * The resource name of the consumer and service. - * - * A valid name would be: - * - `projects/123/services/serviceusage.googleapis.com` - */ name: string; - - /** - * The resource name of the consumer. - * - * A valid name would be: - * - `projects/123` - */ parent: string; - - /** - * The service configuration of the available service. - * Some fields may be filtered out of the configuration in responses to - * the `ListServices` method. These fields are present only in responses to - * the `GetService` method. - */ config?: ServiceConfigSDKType; - - /** Whether or not the service has been enabled for use by the consumer. */ state: State; } @@ -301,54 +279,15 @@ export interface ServiceConfig { /** The configuration of the service. */ export interface ServiceConfigSDKType { - /** - * The DNS address at which this service is available. - * - * An example DNS address would be: - * `calendar.googleapis.com`. - */ name: string; - - /** The product title for this service. */ title: string; - - /** - * A list of API interfaces exported by this service. Contains only the names, - * versions, and method names of the interfaces. - */ apis: ApiSDKType[]; - - /** - * Additional API documentation. Contains only the summary and the - * documentation URL. - */ documentation?: DocumentationSDKType; - - /** Quota configuration. */ quota?: QuotaSDKType; - - /** Auth configuration. Contains only the OAuth rules. */ authentication?: AuthenticationSDKType; - - /** Configuration controlling usage of this service. */ usage?: UsageSDKType; - - /** - * Configuration for network endpoints. Contains only the names and aliases - * of the endpoints. - */ endpoints: EndpointSDKType[]; - - /** - * Defines the monitored resources used by this service. This is required - * by the [Service.monitoring][google.api.Service.monitoring] and [Service.logging][google.api.Service.logging] configurations. - */ monitored_resources: MonitoredResourceDescriptorSDKType[]; - - /** - * Monitoring configuration. - * This should not include the 'producer_destinations' field. - */ monitoring?: MonitoringSDKType; } @@ -363,10 +302,6 @@ export interface OperationMetadata { /** The operation metadata returned for the batchend services operation. */ export interface OperationMetadataSDKType { - /** - * The full name of the resources that this operation is directly - * associated with. - */ resource_names: string[]; } @@ -421,50 +356,11 @@ export interface ConsumerQuotaMetric { /** Consumer quota settings for a quota metric. */ export interface ConsumerQuotaMetricSDKType { - /** - * The resource name of the quota settings on this metric for this consumer. - * - * An example name would be: - * `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus` - * - * The resource name is intended to be opaque and should not be parsed for - * its component strings, since its representation could change in the future. - */ name: string; - - /** - * The name of the metric. - * - * An example name would be: - * `compute.googleapis.com/cpus` - */ metric: string; - - /** - * The display name of the metric. - * - * An example name would be: - * `CPUs` - */ display_name: string; - - /** The consumer quota for each quota limit defined on the metric. */ consumer_quota_limits: ConsumerQuotaLimitSDKType[]; - - /** - * The quota limits targeting the descendant containers of the - * consumer in request. - * - * If the consumer in request is of type `organizations` - * or `folders`, the field will list per-project limits in the metric; if the - * consumer in request is of type `project`, the field will be empty. - * - * The `quota_buckets` field of each descendant consumer quota limit will not - * be populated. - */ descendant_consumer_quota_limits: ConsumerQuotaLimitSDKType[]; - - /** The units in which the metric value is reported. */ unit: string; } @@ -515,46 +411,11 @@ export interface ConsumerQuotaLimit { /** Consumer quota settings for a quota limit. */ export interface ConsumerQuotaLimitSDKType { - /** - * The resource name of the quota limit. - * - * An example name would be: - * `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion` - * - * The resource name is intended to be opaque and should not be parsed for - * its component strings, since its representation could change in the future. - */ name: string; - - /** - * The name of the parent metric of this limit. - * - * An example name would be: - * `compute.googleapis.com/cpus` - */ metric: string; - - /** - * The limit unit. - * - * An example unit would be - * `1/{project}/{region}` - * Note that `{project}` and `{region}` are not placeholders in this example; - * the literal characters `{` and `}` occur in the string. - */ unit: string; - - /** Whether this limit is precise or imprecise. */ is_precise: boolean; - - /** Whether admin overrides are allowed on this limit */ allows_admin_overrides: boolean; - - /** - * Summary of the enforced quota buckets, organized by quota dimension, - * ordered from least specific to most specific (for example, the global - * default bucket, with no quota dimensions, will always appear first). - */ quota_buckets: QuotaBucketSDKType[]; } export interface QuotaBucket_DimensionsEntry { @@ -609,40 +470,11 @@ export interface QuotaBucket { /** A quota bucket is a quota provisioning unit for a specific set of dimensions. */ export interface QuotaBucketSDKType { - /** - * The effective limit of this quota bucket. Equal to default_limit if there - * are no overrides. - */ effective_limit: Long; - - /** - * The default limit of this quota bucket, as specified by the service - * configuration. - */ default_limit: Long; - - /** Producer override on this quota bucket. */ producer_override?: QuotaOverrideSDKType; - - /** Consumer override on this quota bucket. */ consumer_override?: QuotaOverrideSDKType; - - /** Admin override on this quota bucket. */ admin_override?: QuotaOverrideSDKType; - - /** - * The dimensions of this quota bucket. - * - * If this map is empty, this is the global bucket, which is the default quota - * value applied to all requests that do not have a more specific override. - * - * If this map is nonempty, the default limit, effective limit, and quota - * overrides apply only to requests that have the dimensions given in the map. - * - * For example, if the map has key `region` and value `us-east-1`, then the - * specified effective limit is only effective in that region, and the - * specified overrides apply only in that region. - */ dimensions: { [key: string]: string; }; @@ -733,76 +565,13 @@ export interface QuotaOverride { /** A quota override */ export interface QuotaOverrideSDKType { - /** - * The resource name of the override. - * This name is generated by the server when the override is created. - * - * Example names would be: - * `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/adminOverrides/4a3f2c1d` - * `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/consumerOverrides/4a3f2c1d` - * - * The resource name is intended to be opaque and should not be parsed for - * its component strings, since its representation could change in the future. - */ name: string; - - /** - * The overriding quota limit value. - * Can be any nonnegative integer, or -1 (unlimited quota). - */ override_value: Long; - - /** - * If this map is nonempty, then this override applies only to specific values - * for dimensions defined in the limit unit. - * - * For example, an override on a limit with the unit `1/{project}/{region}` - * could contain an entry with the key `region` and the value `us-east-1`; - * the override is only applied to quota consumed in that region. - * - * This map has the following restrictions: - * - * * Keys that are not defined in the limit's unit are not valid keys. - * Any string appearing in `{brackets}` in the unit (besides `{project}` - * or - * `{user}`) is a defined key. - * * `project` is not a valid key; the project is already specified in - * the parent resource name. - * * `user` is not a valid key; the API does not support quota overrides - * that apply only to a specific user. - * * If `region` appears as a key, its value must be a valid Cloud region. - * * If `zone` appears as a key, its value must be a valid Cloud zone. - * * If any valid key other than `region` or `zone` appears in the map, then - * all valid keys other than `region` or `zone` must also appear in the - * map. - */ dimensions: { [key: string]: string; }; - - /** - * The name of the metric to which this override applies. - * - * An example name would be: - * `compute.googleapis.com/cpus` - */ metric: string; - - /** - * The limit unit of the limit to which this override applies. - * - * An example unit would be: - * `1/{project}/{region}` - * Note that `{project}` and `{region}` are not placeholders in this example; - * the literal characters `{` and `}` occur in the string. - */ unit: string; - - /** - * The resource name of the ancestor that requested the override. For example: - * `organizations/12345` or `folders/67890`. - * Used by admin overrides only. - */ admin_override_ancestor: string; } @@ -819,12 +588,6 @@ export interface OverrideInlineSource { /** Import data embedded in the request message */ export interface OverrideInlineSourceSDKType { - /** - * The overrides to create. - * Each override must have a value for 'metric' and 'unit', to specify - * which metric and which limit the override should be applied to. - * The 'name' field of the override does not need to be set; it is ignored. - */ overrides: QuotaOverrideSDKType[]; } export interface AdminQuotaPolicy_DimensionsEntry { @@ -898,61 +661,13 @@ export interface AdminQuotaPolicy { /** Quota policy created by quota administrator. */ export interface AdminQuotaPolicySDKType { - /** - * The resource name of the policy. - * This name is generated by the server when the policy is created. - * - * Example names would be: - * `organizations/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/adminQuotaPolicies/4a3f2c1d` - */ name: string; - - /** - * The quota policy value. - * Can be any nonnegative integer, or -1 (unlimited quota). - */ policy_value: Long; - - /** - * If this map is nonempty, then this policy applies only to specific values - * for dimensions defined in the limit unit. - * - * For example, an policy on a limit with the unit `1/{project}/{region}` - * could contain an entry with the key `region` and the value `us-east-1`; - * the policy is only applied to quota consumed in that region. - * - * This map has the following restrictions: - * - * * If `region` appears as a key, its value must be a valid Cloud region. - * * If `zone` appears as a key, its value must be a valid Cloud zone. - * * Keys other than `region` or `zone` are not valid. - */ dimensions: { [key: string]: string; }; - - /** - * The name of the metric to which this policy applies. - * - * An example name would be: - * `compute.googleapis.com/cpus` - */ metric: string; - - /** - * The limit unit of the limit to which this policy applies. - * - * An example unit would be: - * `1/{project}/{region}` - * Note that `{project}` and `{region}` are not placeholders in this example; - * the literal characters `{` and `}` occur in the string. - */ unit: string; - - /** - * The cloud resource container at which the quota policy is created. The - * format is `{container_type}/{container_number}` - */ container: string; } @@ -979,16 +694,7 @@ export interface ServiceIdentity { * should use to access consumer resources. */ export interface ServiceIdentitySDKType { - /** - * The email address of the service account that a service producer would use - * to access consumer resources. - */ email: string; - - /** - * The unique and stable id of the service account. - * https://cloud.google.com/iam/reference/rest/v1/projects.serviceAccounts#ServiceAccount - */ unique_id: string; } diff --git a/__fixtures__/output1/google/api/serviceusage/v1beta1/serviceusage.ts b/__fixtures__/output1/google/api/serviceusage/v1beta1/serviceusage.ts index 35f1c939b4..b04dff1f5e 100644 --- a/__fixtures__/output1/google/api/serviceusage/v1beta1/serviceusage.ts +++ b/__fixtures__/output1/google/api/serviceusage/v1beta1/serviceusage.ts @@ -67,19 +67,6 @@ export interface EnableServiceRequest { /** Request message for the `EnableService` method. */ export interface EnableServiceRequestSDKType { - /** - * Name of the consumer and service to enable the service on. - * - * The `EnableService` and `DisableService` methods currently only support - * projects. - * - * Enabling a service requires that the service is public or is shared with - * the user enabling the service. - * - * An example name would be: - * `projects/123/services/serviceusage.googleapis.com` - * where `123` is the project number (not project ID). - */ name: string; } @@ -99,15 +86,6 @@ export interface DisableServiceRequest { /** Request message for the `DisableService` method. */ export interface DisableServiceRequestSDKType { - /** - * Name of the consumer and service to disable the service on. - * - * The enable and disable methods currently only support projects. - * - * An example name would be: - * `projects/123/services/serviceusage.googleapis.com` - * where `123` is the project number (not project ID). - */ name: string; } @@ -125,13 +103,6 @@ export interface GetServiceRequest { /** Request message for the `GetService` method. */ export interface GetServiceRequestSDKType { - /** - * Name of the consumer and service to get the `ConsumerState` for. - * - * An example name would be: - * `projects/123/services/serviceusage.googleapis.com` - * where `123` is the project number (not project ID). - */ name: string; } @@ -168,32 +139,9 @@ export interface ListServicesRequest { /** Request message for the `ListServices` method. */ export interface ListServicesRequestSDKType { - /** - * Parent to search for services on. - * - * An example name would be: - * `projects/123` - * where `123` is the project number (not project ID). - */ parent: string; - - /** - * Requested size of the next page of data. - * Requested page size cannot exceed 200. - * If not set, the default page size is 50. - */ page_size: number; - - /** - * Token identifying which result to start with, which is returned by a - * previous list call. - */ page_token: string; - - /** - * Only list services that conform to the given filter. - * The allowed filter strings are `state:ENABLED` and `state:DISABLED`. - */ filter: string; } @@ -211,13 +159,7 @@ export interface ListServicesResponse { /** Response message for the `ListServices` method. */ export interface ListServicesResponseSDKType { - /** The available services for the requested project. */ services: ServiceSDKType[]; - - /** - * Token that can be passed to `ListServices` to resume a paginated - * query. - */ next_page_token: string; } @@ -255,33 +197,7 @@ export interface BatchEnableServicesRequest { /** Request message for the `BatchEnableServices` method. */ export interface BatchEnableServicesRequestSDKType { - /** - * Parent to enable services on. - * - * An example name would be: - * `projects/123` - * where `123` is the project number (not project ID). - * - * The `BatchEnableServices` method currently only supports projects. - */ parent: string; - - /** - * The identifiers of the services to enable on the project. - * - * A valid identifier would be: - * serviceusage.googleapis.com - * - * Enabling services requires that each service is public or is shared with - * the user enabling the service. - * - * Two or more services must be specified. To enable a single service, - * use the `EnableService` method instead. - * - * A single request can enable a maximum of 20 services at a time. If more - * than 20 services are specified, the request will fail, and no state changes - * will occur. - */ service_ids: string[]; } @@ -312,26 +228,9 @@ export interface ListConsumerQuotaMetricsRequest { /** Request message for ListConsumerQuotaMetrics */ export interface ListConsumerQuotaMetricsRequestSDKType { - /** - * Parent of the quotas resource. - * - * Some example names would be: - * `projects/123/services/serviceconsumermanagement.googleapis.com` - * `folders/345/services/serviceconsumermanagement.googleapis.com` - * `organizations/456/services/serviceconsumermanagement.googleapis.com` - */ parent: string; - - /** Requested size of the next page of data. */ page_size: number; - - /** - * Token identifying which result to start with; returned by a previous list - * call. - */ page_token: string; - - /** Specifies the level of detail for quota information in the response. */ view: QuotaView; } @@ -349,13 +248,7 @@ export interface ListConsumerQuotaMetricsResponse { /** Response message for ListConsumerQuotaMetrics */ export interface ListConsumerQuotaMetricsResponseSDKType { - /** Quota settings for the consumer, organized by quota metric. */ metrics: ConsumerQuotaMetricSDKType[]; - - /** - * Token identifying which result to start with; returned by a previous list - * call. - */ next_page_token: string; } @@ -375,15 +268,7 @@ export interface GetConsumerQuotaMetricRequest { /** Request message for GetConsumerQuotaMetric */ export interface GetConsumerQuotaMetricRequestSDKType { - /** - * The resource name of the quota limit. - * - * An example name would be: - * `projects/123/services/serviceusage.googleapis.com/quotas/metrics/serviceusage.googleapis.com%2Fmutate_requests` - */ name: string; - - /** Specifies the level of detail for quota information in the response. */ view: QuotaView; } @@ -403,15 +288,7 @@ export interface GetConsumerQuotaLimitRequest { /** Request message for GetConsumerQuotaLimit */ export interface GetConsumerQuotaLimitRequestSDKType { - /** - * The resource name of the quota limit. - * - * Use the quota limit resource name returned by previous - * ListConsumerQuotaMetrics and GetConsumerQuotaMetric API calls. - */ name: string; - - /** Specifies the level of detail for quota information in the response. */ view: QuotaView; } @@ -447,31 +324,9 @@ export interface CreateAdminOverrideRequest { /** Request message for CreateAdminOverride. */ export interface CreateAdminOverrideRequestSDKType { - /** - * The resource name of the parent quota limit, returned by a - * ListConsumerQuotaMetrics or GetConsumerQuotaMetric call. - * - * An example name would be: - * `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion` - */ parent: string; - - /** The admin override to create. */ override?: QuotaOverrideSDKType; - - /** - * Whether to force the creation of the quota override. - * Setting the force parameter to 'true' ignores all quota safety checks that - * would fail the request. QuotaSafetyCheck lists all such validations. - */ force: boolean; - - /** - * The list of quota safety checks to ignore before the override mutation. - * Unlike 'force' field that ignores all the quota safety checks, the - * 'force_only' field ignores only the specified checks; other checks are - * still enforced. The 'force' and 'force_only' fields cannot both be set. - */ force_only: QuotaSafetyCheck[]; } @@ -515,39 +370,10 @@ export interface UpdateAdminOverrideRequest { /** Request message for UpdateAdminOverride. */ export interface UpdateAdminOverrideRequestSDKType { - /** - * The resource name of the override to update. - * - * An example name would be: - * `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/adminOverrides/4a3f2c1d` - */ name: string; - - /** - * The new override. - * Only the override_value is updated; all other fields are ignored. - */ override?: QuotaOverrideSDKType; - - /** - * Whether to force the update of the quota override. - * Setting the force parameter to 'true' ignores all quota safety checks that - * would fail the request. QuotaSafetyCheck lists all such validations. - */ force: boolean; - - /** - * Update only the specified fields of the override. - * If unset, all fields will be updated. - */ update_mask?: FieldMaskSDKType; - - /** - * The list of quota safety checks to ignore before the override mutation. - * Unlike 'force' field that ignores all the quota safety checks, the - * 'force_only' field ignores only the specified checks; other checks are - * still enforced. The 'force' and 'force_only' fields cannot both be set. - */ force_only: QuotaSafetyCheck[]; } @@ -579,27 +405,8 @@ export interface DeleteAdminOverrideRequest { /** Request message for DeleteAdminOverride. */ export interface DeleteAdminOverrideRequestSDKType { - /** - * The resource name of the override to delete. - * - * An example name would be: - * `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/adminOverrides/4a3f2c1d` - */ name: string; - - /** - * Whether to force the deletion of the quota override. - * Setting the force parameter to 'true' ignores all quota safety checks that - * would fail the request. QuotaSafetyCheck lists all such validations. - */ force: boolean; - - /** - * The list of quota safety checks to ignore before the override mutation. - * Unlike 'force' field that ignores all the quota safety checks, the - * 'force_only' field ignores only the specified checks; other checks are - * still enforced. The 'force' and 'force_only' fields cannot both be set. - */ force_only: QuotaSafetyCheck[]; } @@ -626,22 +433,8 @@ export interface ListAdminOverridesRequest { /** Request message for ListAdminOverrides */ export interface ListAdminOverridesRequestSDKType { - /** - * The resource name of the parent quota limit, returned by a - * ListConsumerQuotaMetrics or GetConsumerQuotaMetric call. - * - * An example name would be: - * `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion` - */ parent: string; - - /** Requested size of the next page of data. */ page_size: number; - - /** - * Token identifying which result to start with; returned by a previous list - * call. - */ page_token: string; } @@ -659,13 +452,7 @@ export interface ListAdminOverridesResponse { /** Response message for ListAdminOverrides. */ export interface ListAdminOverridesResponseSDKType { - /** Admin overrides on this limit. */ overrides: QuotaOverrideSDKType[]; - - /** - * Token identifying which result to start with; returned by a previous list - * call. - */ next_page_token: string; } @@ -677,7 +464,6 @@ export interface BatchCreateAdminOverridesResponse { /** Response message for BatchCreateAdminOverrides */ export interface BatchCreateAdminOverridesResponseSDKType { - /** The overrides that were created. */ overrides: QuotaOverrideSDKType[]; } @@ -712,30 +498,9 @@ export interface ImportAdminOverridesRequest { /** Request message for ImportAdminOverrides */ export interface ImportAdminOverridesRequestSDKType { - /** - * The resource name of the consumer. - * - * An example name would be: - * `projects/123/services/compute.googleapis.com` - */ parent: string; - - /** The import data is specified in the request message itself */ inline_source?: OverrideInlineSourceSDKType; - - /** - * Whether to force the creation of the quota overrides. - * Setting the force parameter to 'true' ignores all quota safety checks that - * would fail the request. QuotaSafetyCheck lists all such validations. - */ force: boolean; - - /** - * The list of quota safety checks to ignore before the override mutation. - * Unlike 'force' field that ignores all the quota safety checks, the - * 'force_only' field ignores only the specified checks; other checks are - * still enforced. The 'force' and 'force_only' fields cannot both be set. - */ force_only: QuotaSafetyCheck[]; } @@ -747,7 +512,6 @@ export interface ImportAdminOverridesResponse { /** Response message for ImportAdminOverrides */ export interface ImportAdminOverridesResponseSDKType { - /** The overrides that were created from the imported data. */ overrides: QuotaOverrideSDKType[]; } @@ -797,31 +561,9 @@ export interface CreateConsumerOverrideRequest { /** Request message for CreateConsumerOverride. */ export interface CreateConsumerOverrideRequestSDKType { - /** - * The resource name of the parent quota limit, returned by a - * ListConsumerQuotaMetrics or GetConsumerQuotaMetric call. - * - * An example name would be: - * `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion` - */ parent: string; - - /** The override to create. */ override?: QuotaOverrideSDKType; - - /** - * Whether to force the creation of the quota override. - * Setting the force parameter to 'true' ignores all quota safety checks that - * would fail the request. QuotaSafetyCheck lists all such validations. - */ force: boolean; - - /** - * The list of quota safety checks to ignore before the override mutation. - * Unlike 'force' field that ignores all the quota safety checks, the - * 'force_only' field ignores only the specified checks; other checks are - * still enforced. The 'force' and 'force_only' fields cannot both be set. - */ force_only: QuotaSafetyCheck[]; } @@ -865,39 +607,10 @@ export interface UpdateConsumerOverrideRequest { /** Request message for UpdateConsumerOverride. */ export interface UpdateConsumerOverrideRequestSDKType { - /** - * The resource name of the override to update. - * - * An example name would be: - * `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/consumerOverrides/4a3f2c1d` - */ name: string; - - /** - * The new override. - * Only the override_value is updated; all other fields are ignored. - */ override?: QuotaOverrideSDKType; - - /** - * Whether to force the update of the quota override. - * Setting the force parameter to 'true' ignores all quota safety checks that - * would fail the request. QuotaSafetyCheck lists all such validations. - */ force: boolean; - - /** - * Update only the specified fields of the override. - * If unset, all fields will be updated. - */ update_mask?: FieldMaskSDKType; - - /** - * The list of quota safety checks to ignore before the override mutation. - * Unlike 'force' field that ignores all the quota safety checks, the - * 'force_only' field ignores only the specified checks; other checks are - * still enforced. The 'force' and 'force_only' fields cannot both be set. - */ force_only: QuotaSafetyCheck[]; } @@ -929,27 +642,8 @@ export interface DeleteConsumerOverrideRequest { /** Request message for DeleteConsumerOverride. */ export interface DeleteConsumerOverrideRequestSDKType { - /** - * The resource name of the override to delete. - * - * An example name would be: - * `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion/consumerOverrides/4a3f2c1d` - */ name: string; - - /** - * Whether to force the deletion of the quota override. - * Setting the force parameter to 'true' ignores all quota safety checks that - * would fail the request. QuotaSafetyCheck lists all such validations. - */ force: boolean; - - /** - * The list of quota safety checks to ignore before the override mutation. - * Unlike 'force' field that ignores all the quota safety checks, the - * 'force_only' field ignores only the specified checks; other checks are - * still enforced. The 'force' and 'force_only' fields cannot both be set. - */ force_only: QuotaSafetyCheck[]; } @@ -976,22 +670,8 @@ export interface ListConsumerOverridesRequest { /** Request message for ListConsumerOverrides */ export interface ListConsumerOverridesRequestSDKType { - /** - * The resource name of the parent quota limit, returned by a - * ListConsumerQuotaMetrics or GetConsumerQuotaMetric call. - * - * An example name would be: - * `projects/123/services/compute.googleapis.com/consumerQuotaMetrics/compute.googleapis.com%2Fcpus/limits/%2Fproject%2Fregion` - */ parent: string; - - /** Requested size of the next page of data. */ page_size: number; - - /** - * Token identifying which result to start with; returned by a previous list - * call. - */ page_token: string; } @@ -1009,13 +689,7 @@ export interface ListConsumerOverridesResponse { /** Response message for ListConsumerOverrides. */ export interface ListConsumerOverridesResponseSDKType { - /** Consumer overrides on this limit. */ overrides: QuotaOverrideSDKType[]; - - /** - * Token identifying which result to start with; returned by a previous list - * call. - */ next_page_token: string; } @@ -1027,7 +701,6 @@ export interface BatchCreateConsumerOverridesResponse { /** Response message for BatchCreateConsumerOverrides */ export interface BatchCreateConsumerOverridesResponseSDKType { - /** The overrides that were created. */ overrides: QuotaOverrideSDKType[]; } @@ -1062,30 +735,9 @@ export interface ImportConsumerOverridesRequest { /** Request message for ImportConsumerOverrides */ export interface ImportConsumerOverridesRequestSDKType { - /** - * The resource name of the consumer. - * - * An example name would be: - * `projects/123/services/compute.googleapis.com` - */ parent: string; - - /** The import data is specified in the request message itself */ inline_source?: OverrideInlineSourceSDKType; - - /** - * Whether to force the creation of the quota overrides. - * Setting the force parameter to 'true' ignores all quota safety checks that - * would fail the request. QuotaSafetyCheck lists all such validations. - */ force: boolean; - - /** - * The list of quota safety checks to ignore before the override mutation. - * Unlike 'force' field that ignores all the quota safety checks, the - * 'force_only' field ignores only the specified checks; other checks are - * still enforced. The 'force' and 'force_only' fields cannot both be set. - */ force_only: QuotaSafetyCheck[]; } @@ -1097,7 +749,6 @@ export interface ImportConsumerOverridesResponse { /** Response message for ImportConsumerOverrides */ export interface ImportConsumerOverridesResponseSDKType { - /** The overrides that were created from the imported data. */ overrides: QuotaOverrideSDKType[]; } @@ -1123,7 +774,6 @@ export interface ImportAdminQuotaPoliciesResponse { /** Response message for ImportAdminQuotaPolicies */ export interface ImportAdminQuotaPoliciesResponseSDKType { - /** The policies that were created from the imported data. */ policies: AdminQuotaPolicySDKType[]; } @@ -1199,15 +849,6 @@ export interface GenerateServiceIdentityRequest { /** Request message for generating service identity. */ export interface GenerateServiceIdentityRequestSDKType { - /** - * Name of the consumer and service to generate an identity for. - * - * The `GenerateServiceIdentity` methods currently only support projects. - * - * An example name would be: - * `projects/123/services/example.googleapis.com` where `123` is the - * project number. - */ parent: string; } @@ -1226,14 +867,7 @@ export interface GetServiceIdentityResponse { /** Response message for getting service identity. */ export interface GetServiceIdentityResponseSDKType { - /** - * Service identity that service producer can use to access consumer - * resources. If exists is true, it contains email and unique_id. If exists is - * false, it contains pre-constructed email and empty unique_id. - */ identity?: ServiceIdentitySDKType; - - /** Service identity state. */ state: GetServiceIdentityResponse_IdentityState; } diff --git a/__fixtures__/output1/google/api/source_info.ts b/__fixtures__/output1/google/api/source_info.ts index d78d85888d..2de3401e81 100644 --- a/__fixtures__/output1/google/api/source_info.ts +++ b/__fixtures__/output1/google/api/source_info.ts @@ -11,7 +11,6 @@ export interface SourceInfo { /** Source information used to create a Service Config */ export interface SourceInfoSDKType { - /** All files used during config generation. */ source_files: AnySDKType[]; } diff --git a/__fixtures__/output1/google/api/system_parameter.ts b/__fixtures__/output1/google/api/system_parameter.ts index d6c932668c..e5688cebe9 100644 --- a/__fixtures__/output1/google/api/system_parameter.ts +++ b/__fixtures__/output1/google/api/system_parameter.ts @@ -54,37 +54,6 @@ export interface SystemParameters { * change the names of the system parameters. */ export interface SystemParametersSDKType { - /** - * Define system parameters. - * - * The parameters defined here will override the default parameters - * implemented by the system. If this field is missing from the service - * config, default system parameters will be used. Default system parameters - * and names is implementation-dependent. - * - * Example: define api key for all methods - * - * system_parameters - * rules: - * - selector: "*" - * parameters: - * - name: api_key - * url_query_parameter: api_key - * - * - * Example: define 2 api key names for a specific method. - * - * system_parameters - * rules: - * - selector: "/ListShelves" - * parameters: - * - name: api_key - * http_header: Api-Key1 - * - name: api_key - * http_header: Api-Key2 - * - * **NOTE:** All service configuration rules follow "last one wins" order. - */ rules: SystemParameterRuleSDKType[]; } @@ -116,21 +85,7 @@ export interface SystemParameterRule { * methods. */ export interface SystemParameterRuleSDKType { - /** - * Selects the methods to which this rule applies. Use '*' to indicate all - * methods in all APIs. - * - * Refer to [selector][google.api.DocumentationRule.selector] for syntax details. - */ selector: string; - - /** - * Define parameters. Multiple names may be defined for a parameter. - * For a given method call, only one of them should be used. If multiple - * names are used the behavior is implementation-dependent. - * If none of the specified names are present the behavior is - * parameter-dependent. - */ parameters: SystemParameterSDKType[]; } @@ -162,19 +117,8 @@ export interface SystemParameter { * is implementation-dependent. */ export interface SystemParameterSDKType { - /** Define the name of the parameter, such as "api_key" . It is case sensitive. */ name: string; - - /** - * Define the HTTP header name to use for the parameter. It is case - * insensitive. - */ http_header: string; - - /** - * Define the URL query parameter name to use for the parameter. It is case - * sensitive. - */ url_query_parameter: string; } diff --git a/__fixtures__/output1/google/api/usage.ts b/__fixtures__/output1/google/api/usage.ts index f34c2ba984..5463287c6c 100644 --- a/__fixtures__/output1/google/api/usage.ts +++ b/__fixtures__/output1/google/api/usage.ts @@ -39,36 +39,8 @@ export interface Usage { /** Configuration controlling usage of a service. */ export interface UsageSDKType { - /** - * Requirements that must be satisfied before a consumer project can use the - * service. Each requirement is of the form /; - * for example 'serviceusage.googleapis.com/billing-enabled'. - * - * For Google APIs, a Terms of Service requirement must be included here. - * Google Cloud APIs must include "serviceusage.googleapis.com/tos/cloud". - * Other Google APIs should include - * "serviceusage.googleapis.com/tos/universal". Additional ToS can be - * included based on the business needs. - */ requirements: string[]; - - /** - * A list of usage rules that apply to individual API methods. - * - * **NOTE:** All service configuration rules follow "last one wins" order. - */ rules: UsageRuleSDKType[]; - - /** - * The full resource name of a channel used for sending notifications to the - * service producer. - * - * Google Service Management currently only supports - * [Google Cloud Pub/Sub](https://cloud.google.com/pubsub) as a notification - * channel. To use Google Cloud Pub/Sub as the channel, this must be the name - * of a Cloud Pub/Sub topic that uses the Cloud Pub/Sub topic name format - * documented in https://cloud.google.com/pubsub/docs/overview. - */ producer_notification_channel: string; } @@ -151,26 +123,8 @@ export interface UsageRule { * allow_unregistered_calls: true */ export interface UsageRuleSDKType { - /** - * Selects the methods to which this rule applies. Use '*' to indicate all - * methods in all APIs. - * - * Refer to [selector][google.api.DocumentationRule.selector] for syntax details. - */ selector: string; - - /** - * If true, the selected method allows unregistered calls, e.g. calls - * that don't identify any user or application. - */ allow_unregistered_calls: boolean; - - /** - * If true, the selected method should skip service control and the control - * plane features, such as quota and billing, will not be available. - * This flag is used by Google Cloud Endpoints to bypass checks for internal - * methods, such as service health check methods. - */ skip_service_control: boolean; } diff --git a/__fixtures__/output1/google/api/visibility.ts b/__fixtures__/output1/google/api/visibility.ts index fb688a0f98..4d425425b6 100644 --- a/__fixtures__/output1/google/api/visibility.ts +++ b/__fixtures__/output1/google/api/visibility.ts @@ -60,11 +60,6 @@ export interface Visibility { * EnhancedSearch and Delegate. */ export interface VisibilitySDKType { - /** - * A list of visibility rules that apply to individual API elements. - * - * **NOTE:** All service configuration rules follow "last one wins" order. - */ rules: VisibilityRuleSDKType[]; } @@ -105,30 +100,7 @@ export interface VisibilityRule { * element. */ export interface VisibilityRuleSDKType { - /** - * Selects methods, messages, fields, enums, etc. to which this rule applies. - * - * Refer to [selector][google.api.DocumentationRule.selector] for syntax details. - */ selector: string; - - /** - * A comma-separated list of visibility labels that apply to the `selector`. - * Any of the listed labels can be used to grant the visibility. - * - * If a rule has multiple labels, removing one of the labels but not all of - * them can break clients. - * - * Example: - * - * visibility: - * rules: - * - selector: google.calendar.Calendar.EnhancedSearch - * restriction: INTERNAL, PREVIEW - * - * Removing INTERNAL from this restriction will break clients that rely on - * this method and only had access to it through INTERNAL. - */ restriction: string; } diff --git a/__fixtures__/output1/google/logging/type/http_request.ts b/__fixtures__/output1/google/logging/type/http_request.ts index 61a176bc05..f318985b6e 100644 --- a/__fixtures__/output1/google/logging/type/http_request.ts +++ b/__fixtures__/output1/google/logging/type/http_request.ts @@ -103,91 +103,20 @@ export interface HttpRequest { * information MUST be defined in a separate message. */ export interface HttpRequestSDKType { - /** The request method. Examples: `"GET"`, `"HEAD"`, `"PUT"`, `"POST"`. */ request_method: string; - - /** - * The scheme (http, https), the host name, the path and the query - * portion of the URL that was requested. - * Example: `"http://example.com/some/info?color=red"`. - */ request_url: string; - - /** - * The size of the HTTP request message in bytes, including the request - * headers and the request body. - */ request_size: Long; - - /** - * The response code indicating the status of response. - * Examples: 200, 404. - */ status: number; - - /** - * The size of the HTTP response message sent back to the client, in bytes, - * including the response headers and the response body. - */ response_size: Long; - - /** - * The user agent sent by the client. Example: - * `"Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET - * CLR 1.0.3705)"`. - */ user_agent: string; - - /** - * The IP address (IPv4 or IPv6) of the client that issued the HTTP - * request. This field can include port information. Examples: - * `"192.168.1.1"`, `"10.0.0.1:80"`, `"FE80::0202:B3FF:FE1E:8329"`. - */ remote_ip: string; - - /** - * The IP address (IPv4 or IPv6) of the origin server that the request was - * sent to. This field can include port information. Examples: - * `"192.168.1.1"`, `"10.0.0.1:80"`, `"FE80::0202:B3FF:FE1E:8329"`. - */ server_ip: string; - - /** - * The referer URL of the request, as defined in - * [HTTP/1.1 Header Field - * Definitions](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). - */ referer: string; - - /** - * The request processing latency on the server, from the time the request was - * received until the response was sent. - */ latency?: DurationSDKType; - - /** Whether or not a cache lookup was attempted. */ cache_lookup: boolean; - - /** - * Whether or not an entity was served from cache - * (with or without validation). - */ cache_hit: boolean; - - /** - * Whether or not the response was validated with the origin server before - * being served from cache. This field is only meaningful if `cache_hit` is - * True. - */ cache_validated_with_origin_server: boolean; - - /** - * The number of HTTP response bytes inserted into cache. Set only when a - * cache fill was attempted. - */ cache_fill_bytes: Long; - - /** Protocol used for the request. Examples: "HTTP/1.1", "HTTP/2", "websocket" */ protocol: string; } diff --git a/__fixtures__/output1/google/logging/v2/log_entry.ts b/__fixtures__/output1/google/logging/v2/log_entry.ts index b9d2205664..597704dfbf 100644 --- a/__fixtures__/output1/google/logging/v2/log_entry.ts +++ b/__fixtures__/output1/google/logging/v2/log_entry.ts @@ -183,166 +183,24 @@ export interface LogEntry { /** An individual entry in a log. */ export interface LogEntrySDKType { - /** - * Required. The resource name of the log to which this log entry belongs: - * - * "projects/[PROJECT_ID]/logs/[LOG_ID]" - * "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" - * "folders/[FOLDER_ID]/logs/[LOG_ID]" - * - * A project number may be used in place of PROJECT_ID. The project number is - * translated to its corresponding PROJECT_ID internally and the `log_name` - * field will contain PROJECT_ID in queries and exports. - * - * `[LOG_ID]` must be URL-encoded within `log_name`. Example: - * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`. - * - * `[LOG_ID]` must be less than 512 characters long and can only include the - * following characters: upper and lower case alphanumeric characters, - * forward-slash, underscore, hyphen, and period. - * - * For backward compatibility, if `log_name` begins with a forward-slash, such - * as `/projects/...`, then the log entry is ingested as usual, but the - * forward-slash is removed. Listing the log entry will not show the leading - * slash and filtering for a log name with a leading slash will never return - * any results. - */ log_name: string; - - /** - * Required. The monitored resource that produced this log entry. - * - * Example: a log entry that reports a database error would be associated with - * the monitored resource designating the particular database that reported - * the error. - */ resource?: MonitoredResourceSDKType; - - /** - * The log entry payload, represented as a protocol buffer. Some Google - * Cloud Platform services use this field for their log entry payloads. - * - * The following protocol buffer types are supported; user-defined types - * are not supported: - * - * "type.googleapis.com/google.cloud.audit.AuditLog" - * "type.googleapis.com/google.appengine.logging.v1.RequestLog" - */ proto_payload?: AnySDKType; - - /** The log entry payload, represented as a Unicode string (UTF-8). */ text_payload?: string; - - /** - * The log entry payload, represented as a structure that is - * expressed as a JSON object. - */ json_payload?: StructSDKType; - - /** - * Optional. The time the event described by the log entry occurred. This time is used - * to compute the log entry's age and to enforce the logs retention period. - * If this field is omitted in a new log entry, then Logging assigns it the - * current time. Timestamps have nanosecond accuracy, but trailing zeros in - * the fractional seconds might be omitted when the timestamp is displayed. - * - * Incoming log entries must have timestamps that don't exceed the - * [logs retention - * period](https://cloud.google.com/logging/quotas#logs_retention_periods) in - * the past, and that don't exceed 24 hours in the future. Log entries outside - * those time boundaries aren't ingested by Logging. - */ timestamp?: Date; - - /** Output only. The time the log entry was received by Logging. */ receive_timestamp?: Date; - - /** Optional. The severity of the log entry. The default value is `LogSeverity.DEFAULT`. */ severity: LogSeverity; - - /** - * Optional. A unique identifier for the log entry. If you provide a value, then - * Logging considers other log entries in the same project, with the same - * `timestamp`, and with the same `insert_id` to be duplicates which are - * removed in a single query result. However, there are no guarantees of - * de-duplication in the export of logs. - * - * If the `insert_id` is omitted when writing a log entry, the Logging API - * assigns its own unique identifier in this field. - * - * In queries, the `insert_id` is also used to order log entries that have - * the same `log_name` and `timestamp` values. - */ insert_id: string; - - /** - * Optional. Information about the HTTP request associated with this log entry, if - * applicable. - */ http_request?: HttpRequestSDKType; - - /** - * Optional. A map of key, value pairs that provides additional information about the - * log entry. The labels can be user-defined or system-defined. - * - * User-defined labels are arbitrary key, value pairs that you can use to - * classify logs. - * - * System-defined labels are defined by GCP services for platform logs. - * They have two components - a service namespace component and the - * attribute name. For example: `compute.googleapis.com/resource_name`. - * - * Cloud Logging truncates label keys that exceed 512 B and label - * values that exceed 64 KB upon their associated log entry being - * written. The truncation is indicated by an ellipsis at the - * end of the character string. - */ labels: { [key: string]: string; }; - - /** - * Optional. Information about an operation associated with the log entry, if - * applicable. - */ operation?: LogEntryOperationSDKType; - - /** - * Optional. Resource name of the trace associated with the log entry, if any. If it - * contains a relative resource name, the name is assumed to be relative to - * `//tracing.googleapis.com`. Example: - * `projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824` - */ trace: string; - - /** - * Optional. The span ID within the trace associated with the log entry. - * - * For Trace spans, this is the same format that the Trace API v2 uses: a - * 16-character hexadecimal encoding of an 8-byte array, such as - * `000000000000004a`. - */ span_id: string; - - /** - * Optional. The sampling decision of the trace associated with the log entry. - * - * True means that the trace resource name in the `trace` field was sampled - * for storage in a trace backend. False means that the trace was not sampled - * for storage when this log entry was written, or the sampling decision was - * unknown at the time. A non-sampled `trace` value is still useful as a - * request correlation identifier. The default is False. - */ trace_sampled: boolean; - - /** Optional. Source code location information associated with the log entry, if any. */ source_location?: LogEntrySourceLocationSDKType; - - /** - * Optional. Information indicating this LogEntry is part of a sequence of multiple log - * entries split from a single LogEntry. - */ split?: LogSplitSDKType; } @@ -376,23 +234,9 @@ export interface LogEntryOperation { * a log entry is associated. */ export interface LogEntryOperationSDKType { - /** - * Optional. An arbitrary operation identifier. Log entries with the same - * identifier are assumed to be part of the same operation. - */ id: string; - - /** - * Optional. An arbitrary producer identifier. The combination of `id` and - * `producer` must be globally unique. Examples for `producer`: - * `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`. - */ producer: string; - - /** Optional. Set this to True if this is the first log entry in the operation. */ first: boolean; - - /** Optional. Set this to True if this is the last log entry in the operation. */ last: boolean; } @@ -429,26 +273,8 @@ export interface LogEntrySourceLocation { * entry. */ export interface LogEntrySourceLocationSDKType { - /** - * Optional. Source file name. Depending on the runtime environment, this - * might be a simple name or a fully-qualified name. - */ file: string; - - /** - * Optional. Line within the source file. 1-based; 0 indicates no line number - * available. - */ line: Long; - - /** - * Optional. Human-readable name of the function or method being invoked, with - * optional context such as the class or package name. This information may be - * used in contexts such as the logs viewer, where a file and line number are - * less meaningful. The format can vary by language. For example: - * `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function` - * (Python). - */ function: string; } @@ -482,21 +308,8 @@ export interface LogSplit { * split across multiple log entries. */ export interface LogSplitSDKType { - /** - * A globally unique identifier for all log entries in a sequence of split log - * entries. All log entries with the same |LogSplit.uid| are assumed to be - * part of the same sequence of split log entries. - */ uid: string; - - /** - * The index of this LogEntry in the sequence of split log entries. Log - * entries are given |index| values 0, 1, ..., n-1 for a sequence of n log - * entries. - */ index: number; - - /** The total number of log entries that the original LogEntry was split into. */ total_splits: number; } diff --git a/__fixtures__/output1/google/logging/v2/logging.ts b/__fixtures__/output1/google/logging/v2/logging.ts index 31f929fd2e..8d8e7484e6 100644 --- a/__fixtures__/output1/google/logging/v2/logging.ts +++ b/__fixtures__/output1/google/logging/v2/logging.ts @@ -86,21 +86,6 @@ export interface DeleteLogRequest { /** The parameters to DeleteLog. */ export interface DeleteLogRequestSDKType { - /** - * Required. The resource name of the log to delete: - * - * * `projects/[PROJECT_ID]/logs/[LOG_ID]` - * * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]` - * * `folders/[FOLDER_ID]/logs/[LOG_ID]` - * - * `[LOG_ID]` must be URL-encoded. For example, - * `"projects/my-project-id/logs/syslog"`, - * `"organizations/123/logs/cloudaudit.googleapis.com%2Factivity"`. - * - * For more information about log names, see - * [LogEntry][google.logging.v2.LogEntry]. - */ log_name: string; } export interface WriteLogEntriesRequest_LabelsEntry { @@ -204,91 +189,13 @@ export interface WriteLogEntriesRequest { /** The parameters to WriteLogEntries. */ export interface WriteLogEntriesRequestSDKType { - /** - * Optional. A default log resource name that is assigned to all log entries - * in `entries` that do not specify a value for `log_name`: - * - * * `projects/[PROJECT_ID]/logs/[LOG_ID]` - * * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]` - * * `folders/[FOLDER_ID]/logs/[LOG_ID]` - * - * `[LOG_ID]` must be URL-encoded. For example: - * - * "projects/my-project-id/logs/syslog" - * "organizations/123/logs/cloudaudit.googleapis.com%2Factivity" - * - * The permission `logging.logEntries.create` is needed on each project, - * organization, billing account, or folder that is receiving new log - * entries, whether the resource is specified in `logName` or in an - * individual log entry. - */ log_name: string; - - /** - * Optional. A default monitored resource object that is assigned to all log - * entries in `entries` that do not specify a value for `resource`. Example: - * - * { "type": "gce_instance", - * "labels": { - * "zone": "us-central1-a", "instance_id": "00000000000000000000" }} - * - * See [LogEntry][google.logging.v2.LogEntry]. - */ resource?: MonitoredResourceSDKType; - - /** - * Optional. Default labels that are added to the `labels` field of all log - * entries in `entries`. If a log entry already has a label with the same key - * as a label in this parameter, then the log entry's label is not changed. - * See [LogEntry][google.logging.v2.LogEntry]. - */ labels: { [key: string]: string; }; - - /** - * Required. The log entries to send to Logging. The order of log - * entries in this list does not matter. Values supplied in this method's - * `log_name`, `resource`, and `labels` fields are copied into those log - * entries in this list that do not include values for their corresponding - * fields. For more information, see the - * [LogEntry][google.logging.v2.LogEntry] type. - * - * If the `timestamp` or `insert_id` fields are missing in log entries, then - * this method supplies the current time or a unique identifier, respectively. - * The supplied values are chosen so that, among the log entries that did not - * supply their own values, the entries earlier in the list will sort before - * the entries later in the list. See the `entries.list` method. - * - * Log entries with timestamps that are more than the - * [logs retention period](https://cloud.google.com/logging/quotas) in - * the past or more than 24 hours in the future will not be available when - * calling `entries.list`. However, those log entries can still be [exported - * with - * LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs). - * - * To improve throughput and to avoid exceeding the - * [quota limit](https://cloud.google.com/logging/quotas) for calls to - * `entries.write`, you should try to include several log entries in this - * list, rather than calling this method for each individual log entry. - */ entries: LogEntrySDKType[]; - - /** - * Optional. Whether valid entries should be written even if some other - * entries fail due to INVALID_ARGUMENT or PERMISSION_DENIED errors. If any - * entry is not written, then the response status is the error associated - * with one of the failed entries and the response includes error details - * keyed by the entries' zero-based index in the `entries.write` method. - */ partial_success: boolean; - - /** - * Optional. If true, the request should expect normal response, but the - * entries won't be persisted nor exported. Useful for checking whether the - * logging API endpoints are working properly before sending valuable data. - */ dry_run: boolean; } @@ -323,14 +230,6 @@ export interface WriteLogEntriesPartialErrors { /** Error details for WriteLogEntries with partial success. */ export interface WriteLogEntriesPartialErrorsSDKType { - /** - * When `WriteLogEntriesRequest.partial_success` is true, records the error - * status for entries that were not written due to a permanent error, keyed - * by the entry's zero-based index in `WriteLogEntriesRequest.entries`. - * - * Failed requests for which no entries are written will not include - * per-entry errors. - */ log_entry_errors?: { [key: number]: StatusSDKType; }; @@ -398,61 +297,10 @@ export interface ListLogEntriesRequest { /** The parameters to `ListLogEntries`. */ export interface ListLogEntriesRequestSDKType { - /** - * Required. Names of one or more parent resources from which to - * retrieve log entries: - * - * * `projects/[PROJECT_ID]` - * * `organizations/[ORGANIZATION_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]` - * * `folders/[FOLDER_ID]` - * - * May alternatively be one or more views: - * - * * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * - * Projects listed in the `project_ids` field are added to this list. - */ resource_names: string[]; - - /** - * Optional. A filter that chooses which log entries to return. See [Advanced - * Logs Queries](https://cloud.google.com/logging/docs/view/advanced-queries). - * Only log entries that match the filter are returned. An empty filter - * matches all log entries in the resources listed in `resource_names`. - * Referencing a parent resource that is not listed in `resource_names` will - * cause the filter to return no results. The maximum length of the filter is - * 20000 characters. - */ filter: string; - - /** - * Optional. How the results should be sorted. Presently, the only permitted - * values are `"timestamp asc"` (default) and `"timestamp desc"`. The first - * option returns entries in order of increasing values of - * `LogEntry.timestamp` (oldest first), and the second option returns entries - * in order of decreasing timestamps (newest first). Entries with equal - * timestamps are returned in order of their `insert_id` values. - */ order_by: string; - - /** - * Optional. The maximum number of results to return from this request. Default is 50. - * If the value is negative or exceeds 1000, the request is rejected. The - * presence of `next_page_token` in the response indicates that more results - * might be available. - */ page_size: number; - - /** - * Optional. If present, then retrieve the next batch of results from the - * preceding call to this method. `page_token` must be the value of - * `next_page_token` from the previous response. The values of other method - * parameters should be identical to those in the previous call. - */ page_token: string; } @@ -482,25 +330,7 @@ export interface ListLogEntriesResponse { /** Result returned from `ListLogEntries`. */ export interface ListLogEntriesResponseSDKType { - /** - * A list of log entries. If `entries` is empty, `nextPageToken` may still be - * returned, indicating that more entries may exist. See `nextPageToken` for - * more information. - */ entries: LogEntrySDKType[]; - - /** - * If there might be more results than those appearing in this response, then - * `nextPageToken` is included. To get the next set of results, call this - * method again using the value of `nextPageToken` as `pageToken`. - * - * If a value for `next_page_token` appears and the `entries` field is empty, - * it means that the search found no log entries so far but it did not have - * time to search all the possible log entries. Retry the method with this - * value for `page_token` to continue the search. Alternatively, consider - * speeding up the search by changing your filter to specify a single log name - * or resource type, or to narrow the time range of the search. - */ next_page_token: string; } @@ -524,19 +354,7 @@ export interface ListMonitoredResourceDescriptorsRequest { /** The parameters to ListMonitoredResourceDescriptors */ export interface ListMonitoredResourceDescriptorsRequestSDKType { - /** - * Optional. The maximum number of results to return from this request. - * Non-positive values are ignored. The presence of `nextPageToken` in the - * response indicates that more results might be available. - */ page_size: number; - - /** - * Optional. If present, then retrieve the next batch of results from the - * preceding call to this method. `pageToken` must be the value of - * `nextPageToken` from the previous response. The values of other method - * parameters should be identical to those in the previous call. - */ page_token: string; } @@ -555,14 +373,7 @@ export interface ListMonitoredResourceDescriptorsResponse { /** Result returned from ListMonitoredResourceDescriptors. */ export interface ListMonitoredResourceDescriptorsResponseSDKType { - /** A list of resource descriptors. */ resource_descriptors: MonitoredResourceDescriptorSDKType[]; - - /** - * If there might be more results than those appearing in this response, then - * `nextPageToken` is included. To get the next set of results, call this - * method again using the value of `nextPageToken` as `pageToken`. - */ next_page_token: string; } @@ -613,46 +424,9 @@ export interface ListLogsRequest { /** The parameters to ListLogs. */ export interface ListLogsRequestSDKType { - /** - * Required. The resource name that owns the logs: - * - * * `projects/[PROJECT_ID]` - * * `organizations/[ORGANIZATION_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]` - * * `folders/[FOLDER_ID]` - */ parent: string; - - /** - * Optional. The maximum number of results to return from this request. - * Non-positive values are ignored. The presence of `nextPageToken` in the - * response indicates that more results might be available. - */ page_size: number; - - /** - * Optional. If present, then retrieve the next batch of results from the - * preceding call to this method. `pageToken` must be the value of - * `nextPageToken` from the previous response. The values of other method - * parameters should be identical to those in the previous call. - */ page_token: string; - - /** - * Optional. The resource name that owns the logs: - * - * * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * - * To support legacy queries, it could also be: - * - * * `projects/[PROJECT_ID]` - * * `organizations/[ORGANIZATION_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]` - * * `folders/[FOLDER_ID]` - */ resource_names: string[]; } @@ -675,18 +449,7 @@ export interface ListLogsResponse { /** Result returned from ListLogs. */ export interface ListLogsResponseSDKType { - /** - * A list of log names. For example, - * `"projects/my-project/logs/syslog"` or - * `"organizations/123/logs/cloudresourcemanager.googleapis.com%2Factivity"`. - */ log_names: string[]; - - /** - * If there might be more results than those appearing in this response, then - * `nextPageToken` is included. To get the next set of results, call this - * method again using the value of `nextPageToken` as `pageToken`. - */ next_page_token: string; } @@ -731,40 +494,8 @@ export interface TailLogEntriesRequest { /** The parameters to `TailLogEntries`. */ export interface TailLogEntriesRequestSDKType { - /** - * Required. Name of a parent resource from which to retrieve log entries: - * - * * `projects/[PROJECT_ID]` - * * `organizations/[ORGANIZATION_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]` - * * `folders/[FOLDER_ID]` - * - * May alternatively be one or more views: - * - * * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` - */ resource_names: string[]; - - /** - * Optional. A filter that chooses which log entries to return. See [Advanced - * Logs Filters](https://cloud.google.com/logging/docs/view/advanced_filters). - * Only log entries that match the filter are returned. An empty filter - * matches all log entries in the resources listed in `resource_names`. - * Referencing a parent resource that is not in `resource_names` will cause - * the filter to return no results. The maximum length of the filter is 20000 - * characters. - */ filter: string; - - /** - * Optional. The amount of time to buffer log entries at the server before - * being returned to prevent out of order results due to late arriving log - * entries. Valid values are between 0-60000 milliseconds. Defaults to 2000 - * milliseconds. - */ buffer_window?: DurationSDKType; } @@ -789,20 +520,7 @@ export interface TailLogEntriesResponse { /** Result returned from `TailLogEntries`. */ export interface TailLogEntriesResponseSDKType { - /** - * A list of log entries. Each response in the stream will order entries with - * increasing values of `LogEntry.timestamp`. Ordering is not guaranteed - * between separate responses. - */ entries: LogEntrySDKType[]; - - /** - * If entries that otherwise would have been included in the session were not - * sent back to the client, counts of relevant entries omitted from the - * session with the reason that they were not included. There will be at most - * one of each reason per response. The counts represent the number of - * suppressed entries since the last streamed response. - */ suppression_info: TailLogEntriesResponse_SuppressionInfoSDKType[]; } @@ -817,10 +535,7 @@ export interface TailLogEntriesResponse_SuppressionInfo { /** Information about entries that were omitted from the session. */ export interface TailLogEntriesResponse_SuppressionInfoSDKType { - /** The reason that entries were omitted from the session. */ reason: TailLogEntriesResponse_SuppressionInfo_Reason; - - /** A lower bound on the count of entries omitted due to `reason`. */ suppressed_count: number; } diff --git a/__fixtures__/output1/google/logging/v2/logging_config.ts b/__fixtures__/output1/google/logging/v2/logging_config.ts index 0b8d5bc552..c8508abb63 100644 --- a/__fixtures__/output1/google/logging/v2/logging_config.ts +++ b/__fixtures__/output1/google/logging/v2/logging_config.ts @@ -279,72 +279,14 @@ export interface LogBucket { /** Describes a repository in which log entries are stored. */ export interface LogBucketSDKType { - /** - * Output only. The resource name of the bucket. - * - * For example: - * - * `projects/my-project/locations/global/buckets/my-bucket` - * - * For a list of supported locations, see [Supported - * Regions](https://cloud.google.com/logging/docs/region-support) - * - * For the location of `global` it is unspecified where log entries are - * actually stored. - * - * After a bucket has been created, the location cannot be changed. - */ name: string; - - /** Describes this bucket. */ description: string; - - /** - * Output only. The creation timestamp of the bucket. This is not set for any of the - * default buckets. - */ create_time?: Date; - - /** Output only. The last update timestamp of the bucket. */ update_time?: Date; - - /** - * Logs will be retained by default for this amount of time, after which they - * will automatically be deleted. The minimum retention period is 1 day. If - * this value is set to zero at bucket creation time, the default time of 30 - * days will be used. - */ retention_days: number; - - /** - * Whether the bucket is locked. - * - * The retention period on a locked bucket cannot be changed. Locked buckets - * may only be deleted if they are empty. - */ locked: boolean; - - /** Output only. The bucket lifecycle state. */ lifecycle_state: LifecycleState; - - /** - * Log entry field paths that are denied access in this bucket. - * - * The following fields and their children are eligible: `textPayload`, - * `jsonPayload`, `protoPayload`, `httpRequest`, `labels`, `sourceLocation`. - * - * Restricting a repeated field will restrict all values. Adding a parent will - * block all child fields. (e.g. `foo.bar` will block `foo.bar.baz`) - */ restricted_fields: string[]; - - /** - * The CMEK settings of the log bucket. If present, new log entries written to - * this log bucket are encrypted using the CMEK key provided in this - * configuration. If a log bucket has CMEK settings, the CMEK settings cannot - * be disabled later by updating the log bucket. Changing the KMS key is - * allowed. - */ cmek_settings?: CmekSettingsSDKType; } @@ -389,40 +331,10 @@ export interface LogView { /** Describes a view over log entries in a bucket. */ export interface LogViewSDKType { - /** - * The resource name of the view. - * - * For example: - * - * `projects/my-project/locations/global/buckets/my-bucket/views/my-view` - */ name: string; - - /** Describes this view. */ description: string; - - /** Output only. The creation timestamp of the view. */ create_time?: Date; - - /** Output only. The last update timestamp of the view. */ update_time?: Date; - - /** - * Filter that restricts which log entries in a bucket are visible in this - * view. - * - * Filters are restricted to be a logical AND of ==/!= of any of the - * following: - * - * - originating project/folder/organization/billing account. - * - resource type - * - log id - * - * For example: - * - * SOURCE("projects/myproject") AND resource.type = "gce_instance" - * AND LOG_ID("stdout") - */ filter: string; } @@ -565,126 +477,19 @@ export interface LogSink { * organization, billing account, or folder. */ export interface LogSinkSDKType { - /** - * Required. The client-assigned sink identifier, unique within the project. - * - * For example: `"my-syslog-errors-to-pubsub"`. Sink identifiers are limited - * to 100 characters and can include only the following characters: upper and - * lower-case alphanumeric characters, underscores, hyphens, and periods. - * First character has to be alphanumeric. - */ name: string; - - /** - * Required. The export destination: - * - * "storage.googleapis.com/[GCS_BUCKET]" - * "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]" - * "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]" - * - * The sink's `writer_identity`, set when the sink is created, must have - * permission to write to the destination or else the log entries are not - * exported. For more information, see - * [Exporting Logs with - * Sinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs). - */ destination: string; - - /** - * Optional. An [advanced logs - * filter](https://cloud.google.com/logging/docs/view/advanced-queries). The - * only exported log entries are those that are in the resource owning the - * sink and that match the filter. - * - * For example: - * - * `logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR` - */ filter: string; - - /** - * Optional. A description of this sink. - * - * The maximum length of the description is 8000 characters. - */ description: string; - - /** - * Optional. If set to true, then this sink is disabled and it does not export any log - * entries. - */ disabled: boolean; - - /** - * Optional. Log entries that match any of these exclusion filters will not be exported. - * - * If a log entry is matched by both `filter` and one of `exclusion_filters` - * it will not be exported. - */ exclusions: LogExclusionSDKType[]; - /** Deprecated. This field is unused. */ - /** @deprecated */ output_version_format: LogSink_VersionFormat; - - /** - * Output only. An IAM identity—a service account or group—under which Cloud - * Logging writes the exported log entries to the sink's destination. This - * field is set by - * [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] and - * [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink] based on the - * value of `unique_writer_identity` in those methods. - * - * Until you grant this identity write-access to the destination, log entry - * exports from this sink will fail. For more information, see [Granting - * Access for a - * Resource](https://cloud.google.com/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource). - * Consult the destination service's documentation to determine the - * appropriate IAM roles to assign to the identity. - * - * Sinks that have a destination that is a log bucket in the same project as - * the sink do not have a writer_identity and no additional permissions are - * required. - */ writer_identity: string; - - /** - * Optional. This field applies only to sinks owned by organizations and folders. If the - * field is false, the default, only the logs owned by the sink's parent - * resource are available for export. If the field is true, then log entries - * from all the projects, folders, and billing accounts contained in the - * sink's parent resource are also available for export. Whether a particular - * log entry from the children is exported depends on the sink's filter - * expression. - * - * For example, if this field is true, then the filter - * `resource.type=gce_instance` would export all Compute Engine VM instance - * log entries from all projects in the sink's parent. - * - * To only export entries from certain child projects, filter on the project - * part of the log name: - * - * logName:("projects/test-project1/" OR "projects/test-project2/") AND - * resource.type=gce_instance - */ include_children: boolean; - - /** Optional. Options that affect sinks exporting data to BigQuery. */ bigquery_options?: BigQueryOptionsSDKType; - - /** - * Output only. The creation timestamp of the sink. - * - * This field may not be present for older sinks. - */ create_time?: Date; - - /** - * Output only. The last update timestamp of the sink. - * - * This field may not be present for older sinks. - */ update_time?: Date; } @@ -716,27 +521,7 @@ export interface BigQueryOptions { /** Options that change functionality of a sink exporting data to BigQuery. */ export interface BigQueryOptionsSDKType { - /** - * Optional. Whether to use [BigQuery's partition - * tables](https://cloud.google.com/bigquery/docs/partitioned-tables). By - * default, Cloud Logging creates dated tables based on the log entries' - * timestamps, e.g. syslog_20170523. With partitioned tables the date suffix - * is no longer present and [special query - * syntax](https://cloud.google.com/bigquery/docs/querying-partitioned-tables) - * has to be used instead. In both cases, tables are sharded based on UTC - * timezone. - */ use_partitioned_tables: boolean; - - /** - * Output only. True if new timestamp column based partitioning is in use, false if legacy - * ingestion-time partitioning is in use. - * - * All new sinks will have this field set true and will use timestamp column - * based partitioning. If use_partitioned_tables is false, this value has no - * meaning and will be false. Legacy sinks using partitioned tables will have - * this field set to false. - */ uses_timestamp_column_partitioning: boolean; } @@ -774,33 +559,8 @@ export interface ListBucketsRequest { /** The parameters to `ListBuckets`. */ export interface ListBucketsRequestSDKType { - /** - * Required. The parent resource whose buckets are to be listed: - * - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]" - * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" - * "folders/[FOLDER_ID]/locations/[LOCATION_ID]" - * - * Note: The locations portion of the resource must be specified, but - * supplying the character `-` in place of [LOCATION_ID] will return all - * buckets. - */ parent: string; - - /** - * Optional. If present, then retrieve the next batch of results from the preceding call - * to this method. `pageToken` must be the value of `nextPageToken` from the - * previous response. The values of other method parameters should be - * identical to those in the previous call. - */ page_token: string; - - /** - * Optional. The maximum number of results to return from this request. Non-positive - * values are ignored. The presence of `nextPageToken` in the response - * indicates that more results might be available. - */ page_size: number; } @@ -819,14 +579,7 @@ export interface ListBucketsResponse { /** The response from ListBuckets. */ export interface ListBucketsResponseSDKType { - /** A list of buckets. */ buckets: LogBucketSDKType[]; - - /** - * If there might be more results than appear in this response, then - * `nextPageToken` is included. To get the next set of results, call the same - * method again using the value of `nextPageToken` as `pageToken`. - */ next_page_token: string; } @@ -860,29 +613,8 @@ export interface CreateBucketRequest { /** The parameters to `CreateBucket`. */ export interface CreateBucketRequestSDKType { - /** - * Required. The resource in which to create the log bucket: - * - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]" - * - * For example: - * - * `"projects/my-project/locations/global"` - */ parent: string; - - /** - * Required. A client-assigned identifier such as `"my-bucket"`. Identifiers are limited - * to 100 characters and can include only letters, digits, underscores, - * hyphens, and periods. - */ bucket_id: string; - - /** - * Required. The new bucket. The region specified in the new bucket must be compliant - * with any Location Restriction Org Policy. The name field in the bucket is - * ignored. - */ bucket?: LogBucketSDKType; } @@ -920,33 +652,8 @@ export interface UpdateBucketRequest { /** The parameters to `UpdateBucket`. */ export interface UpdateBucketRequestSDKType { - /** - * Required. The full resource name of the bucket to update. - * - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * - * For example: - * - * `"projects/my-project/locations/global/buckets/my-bucket"` - */ name: string; - - /** Required. The updated bucket. */ bucket?: LogBucketSDKType; - - /** - * Required. Field mask that specifies the fields in `bucket` that need an update. A - * bucket field will be overwritten if, and only if, it is in the update mask. - * `name` and output only fields cannot be updated. - * - * For a detailed `FieldMask` definition, see: - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask - * - * For example: `updateMask=retention_days` - */ update_mask?: FieldMaskSDKType; } @@ -969,18 +676,6 @@ export interface GetBucketRequest { /** The parameters to `GetBucket`. */ export interface GetBucketRequestSDKType { - /** - * Required. The resource name of the bucket: - * - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * - * For example: - * - * `"projects/my-project/locations/global/buckets/my-bucket"` - */ name: string; } @@ -1003,18 +698,6 @@ export interface DeleteBucketRequest { /** The parameters to `DeleteBucket`. */ export interface DeleteBucketRequestSDKType { - /** - * Required. The full resource name of the bucket to delete. - * - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * - * For example: - * - * `"projects/my-project/locations/global/buckets/my-bucket"` - */ name: string; } @@ -1037,18 +720,6 @@ export interface UndeleteBucketRequest { /** The parameters to `UndeleteBucket`. */ export interface UndeleteBucketRequestSDKType { - /** - * Required. The full resource name of the bucket to undelete. - * - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - * - * For example: - * - * `"projects/my-project/locations/global/buckets/my-bucket"` - */ name: string; } @@ -1080,27 +751,8 @@ export interface ListViewsRequest { /** The parameters to `ListViews`. */ export interface ListViewsRequestSDKType { - /** - * Required. The bucket whose views are to be listed: - * - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" - */ parent: string; - - /** - * Optional. If present, then retrieve the next batch of results from the preceding call - * to this method. `pageToken` must be the value of `nextPageToken` from the - * previous response. The values of other method parameters should be - * identical to those in the previous call. - */ page_token: string; - - /** - * Optional. The maximum number of results to return from this request. - * - * Non-positive values are ignored. The presence of `nextPageToken` in the - * response indicates that more results might be available. - */ page_size: number; } @@ -1119,14 +771,7 @@ export interface ListViewsResponse { /** The response from ListViews. */ export interface ListViewsResponseSDKType { - /** A list of views. */ views: LogViewSDKType[]; - - /** - * If there might be more results than appear in this response, then - * `nextPageToken` is included. To get the next set of results, call the same - * method again using the value of `nextPageToken` as `pageToken`. - */ next_page_token: string; } @@ -1152,21 +797,8 @@ export interface CreateViewRequest { /** The parameters to `CreateView`. */ export interface CreateViewRequestSDKType { - /** - * Required. The bucket in which to create the view - * - * `"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"` - * - * For example: - * - * `"projects/my-project/locations/global/buckets/my-bucket"` - */ parent: string; - - /** Required. The id to use for this view. */ view_id: string; - - /** Required. The new view. */ view?: LogViewSDKType; } @@ -1201,30 +833,8 @@ export interface UpdateViewRequest { /** The parameters to `UpdateView`. */ export interface UpdateViewRequestSDKType { - /** - * Required. The full resource name of the view to update - * - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" - * - * For example: - * - * `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` - */ name: string; - - /** Required. The updated view. */ view?: LogViewSDKType; - - /** - * Optional. Field mask that specifies the fields in `view` that need - * an update. A field will be overwritten if, and only if, it is - * in the update mask. `name` and output only fields cannot be updated. - * - * For a detailed `FieldMask` definition, see - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask - * - * For example: `updateMask=filter` - */ update_mask?: FieldMaskSDKType; } @@ -1244,15 +854,6 @@ export interface GetViewRequest { /** The parameters to `GetView`. */ export interface GetViewRequestSDKType { - /** - * Required. The resource name of the policy: - * - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" - * - * For example: - * - * `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` - */ name: string; } @@ -1271,49 +872,12 @@ export interface DeleteViewRequest { } /** The parameters to `DeleteView`. */ -export interface DeleteViewRequestSDKType { - /** - * Required. The full resource name of the view to delete: - * - * "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" - * - * For example: - * - * `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` - */ - name: string; -} - -/** The parameters to `ListSinks`. */ -export interface ListSinksRequest { - /** - * Required. The parent resource whose sinks are to be listed: - * - * "projects/[PROJECT_ID]" - * "organizations/[ORGANIZATION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]" - * "folders/[FOLDER_ID]" - */ - parent: string; - - /** - * Optional. If present, then retrieve the next batch of results from the - * preceding call to this method. `pageToken` must be the value of - * `nextPageToken` from the previous response. The values of other method - * parameters should be identical to those in the previous call. - */ - pageToken: string; - - /** - * Optional. The maximum number of results to return from this request. - * Non-positive values are ignored. The presence of `nextPageToken` in the - * response indicates that more results might be available. - */ - pageSize: number; +export interface DeleteViewRequestSDKType { + name: string; } /** The parameters to `ListSinks`. */ -export interface ListSinksRequestSDKType { +export interface ListSinksRequest { /** * Required. The parent resource whose sinks are to be listed: * @@ -1330,13 +894,20 @@ export interface ListSinksRequestSDKType { * `nextPageToken` from the previous response. The values of other method * parameters should be identical to those in the previous call. */ - page_token: string; + pageToken: string; /** * Optional. The maximum number of results to return from this request. * Non-positive values are ignored. The presence of `nextPageToken` in the * response indicates that more results might be available. */ + pageSize: number; +} + +/** The parameters to `ListSinks`. */ +export interface ListSinksRequestSDKType { + parent: string; + page_token: string; page_size: number; } @@ -1355,14 +926,7 @@ export interface ListSinksResponse { /** Result returned from `ListSinks`. */ export interface ListSinksResponseSDKType { - /** A list of sinks. */ sinks: LogSinkSDKType[]; - - /** - * If there might be more results than appear in this response, then - * `nextPageToken` is included. To get the next set of results, call the same - * method again using the value of `nextPageToken` as `pageToken`. - */ next_page_token: string; } @@ -1385,18 +949,6 @@ export interface GetSinkRequest { /** The parameters to `GetSink`. */ export interface GetSinkRequestSDKType { - /** - * Required. The resource name of the sink: - * - * "projects/[PROJECT_ID]/sinks/[SINK_ID]" - * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" - * "folders/[FOLDER_ID]/sinks/[SINK_ID]" - * - * For example: - * - * `"projects/my-project/sinks/my-sink"` - */ sink_name: string; } @@ -1441,40 +993,8 @@ export interface CreateSinkRequest { /** The parameters to `CreateSink`. */ export interface CreateSinkRequestSDKType { - /** - * Required. The resource in which to create the sink: - * - * "projects/[PROJECT_ID]" - * "organizations/[ORGANIZATION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]" - * "folders/[FOLDER_ID]" - * - * For examples: - * - * `"projects/my-project"` - * `"organizations/123456789"` - */ parent: string; - - /** - * Required. The new sink, whose `name` parameter is a sink identifier that - * is not already in use. - */ sink?: LogSinkSDKType; - - /** - * Optional. Determines the kind of IAM identity returned as `writer_identity` - * in the new sink. If this value is omitted or set to false, and if the - * sink's parent is a project, then the value returned as `writer_identity` is - * the same group or service account used by Cloud Logging before the addition - * of writer identities to this API. The sink's destination must be in the - * same project as the sink itself. - * - * If this field is set to true, or if the sink is owned by a non-project - * resource such as an organization, then the value of `writer_identity` will - * be a unique service account used only for exports from the new sink. For - * more information, see `writer_identity` in [LogSink][google.logging.v2.LogSink]. - */ unique_writer_identity: boolean; } @@ -1539,60 +1059,9 @@ export interface UpdateSinkRequest { /** The parameters to `UpdateSink`. */ export interface UpdateSinkRequestSDKType { - /** - * Required. The full resource name of the sink to update, including the parent - * resource and the sink identifier: - * - * "projects/[PROJECT_ID]/sinks/[SINK_ID]" - * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" - * "folders/[FOLDER_ID]/sinks/[SINK_ID]" - * - * For example: - * - * `"projects/my-project/sinks/my-sink"` - */ sink_name: string; - - /** - * Required. The updated sink, whose name is the same identifier that appears as part - * of `sink_name`. - */ sink?: LogSinkSDKType; - - /** - * Optional. See [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] - * for a description of this field. When updating a sink, the effect of this - * field on the value of `writer_identity` in the updated sink depends on both - * the old and new values of this field: - * - * + If the old and new values of this field are both false or both true, - * then there is no change to the sink's `writer_identity`. - * + If the old value is false and the new value is true, then - * `writer_identity` is changed to a unique service account. - * + It is an error if the old value is true and the new value is - * set to false or defaulted to false. - */ unique_writer_identity: boolean; - - /** - * Optional. Field mask that specifies the fields in `sink` that need - * an update. A sink field will be overwritten if, and only if, it is - * in the update mask. `name` and output only fields cannot be updated. - * - * An empty `updateMask` is temporarily treated as using the following mask - * for backwards compatibility purposes: - * - * `destination,filter,includeChildren` - * - * At some point in the future, behavior will be removed and specifying an - * empty `updateMask` will be an error. - * - * For a detailed `FieldMask` definition, see - * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask - * - * For example: `updateMask=filter` - */ update_mask?: FieldMaskSDKType; } @@ -1616,19 +1085,6 @@ export interface DeleteSinkRequest { /** The parameters to `DeleteSink`. */ export interface DeleteSinkRequestSDKType { - /** - * Required. The full resource name of the sink to delete, including the parent - * resource and the sink identifier: - * - * "projects/[PROJECT_ID]/sinks/[SINK_ID]" - * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" - * "folders/[FOLDER_ID]/sinks/[SINK_ID]" - * - * For example: - * - * `"projects/my-project/sinks/my-sink"` - */ sink_name: string; } @@ -1696,51 +1152,11 @@ export interface LogExclusion { * Note also that you cannot modify the _Required sink or exclude logs from it. */ export interface LogExclusionSDKType { - /** - * Required. A client-assigned identifier, such as `"load-balancer-exclusion"`. - * Identifiers are limited to 100 characters and can include only letters, - * digits, underscores, hyphens, and periods. First character has to be - * alphanumeric. - */ name: string; - - /** Optional. A description of this exclusion. */ description: string; - - /** - * Required. An [advanced logs - * filter](https://cloud.google.com/logging/docs/view/advanced-queries) that - * matches the log entries to be excluded. By using the [sample - * function](https://cloud.google.com/logging/docs/view/advanced-queries#sample), - * you can exclude less than 100% of the matching log entries. - * - * For example, the following query matches 99% of low-severity log entries - * from Google Cloud Storage buckets: - * - * `resource.type=gcs_bucket severity=ERROR" - * - * The maximum length of the filter is 20000 characters. - */ filter: string; - - /** - * Optional. If set to True, then this metric is disabled and it does not - * generate any points. - */ disabled: boolean; - - /** - * Optional. The metric descriptor associated with the logs-based metric. - * If unspecified, it uses a default metric descriptor with a DELTA metric - * kind, INT64 value type, with no labels and a unit of "1". Such a metric - * counts the number of log entries matching the `filter` expression. - * - * The `name`, `type`, and `description` fields in the `metric_descriptor` - * are output only, and is constructed using the `name` and `description` - * field in the LogMetric. - * - * To create a logs-based metric that records a distribution of log values, a - * DELTA metric kind with a DISTRIBUTION value type must be used along with - * a `value_extractor` expression in the LogMetric. - * - * Each label in the metric descriptor must have a matching label - * name as the key and an extractor expression as the value in the - * `label_extractors` map. - * - * The `metric_kind` and `value_type` fields in the `metric_descriptor` cannot - * be updated once initially configured. New labels can be added in the - * `metric_descriptor`, but existing labels cannot be modified except for - * their description. - */ metric_descriptor?: MetricDescriptorSDKType; - - /** - * Optional. A `value_extractor` is required when using a distribution - * logs-based metric to extract the values to record from a log entry. - * Two functions are supported for value extraction: `EXTRACT(field)` or - * `REGEXP_EXTRACT(field, regex)`. The argument are: - * 1. field: The name of the log entry field from which the value is to be - * extracted. - * 2. regex: A regular expression using the Google RE2 syntax - * (https://github.com/google/re2/wiki/Syntax) with a single capture - * group to extract data from the specified log entry field. The value - * of the field is converted to a string before applying the regex. - * It is an error to specify a regex that does not include exactly one - * capture group. - * - * The result of the extraction must be convertible to a double type, as the - * distribution always records double values. If either the extraction or - * the conversion to double fails, then those values are not recorded in the - * distribution. - * - * Example: `REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*")` - */ value_extractor: string; - - /** - * Optional. A map from a label key string to an extractor expression which is - * used to extract data from a log entry field and assign as the label value. - * Each label key specified in the LabelDescriptor must have an associated - * extractor expression in this map. The syntax of the extractor expression - * is the same as for the `value_extractor` field. - * - * The extracted value is converted to the type defined in the label - * descriptor. If the either the extraction or the type conversion fails, - * the label will have a default value. The default value for a string - * label is an empty string, for an integer label its 0, and for a boolean - * label its `false`. - * - * Note that there are upper bounds on the maximum number of labels and the - * number of active time series that are allowed in a project. - */ label_extractors: { [key: string]: string; }; - - /** - * Optional. The `bucket_options` are required when the logs-based metric is - * using a DISTRIBUTION value type and it describes the bucket boundaries - * used to create a histogram of the extracted values. - */ bucket_options?: Distribution_BucketOptionsSDKType; - - /** - * Output only. The creation timestamp of the metric. - * - * This field may not be present for older metrics. - */ create_time?: Date; - - /** - * Output only. The last update timestamp of the metric. - * - * This field may not be present for older metrics. - */ update_time?: Date; - /** - * Deprecated. The API version that created or updated this metric. - * The v2 format is used by default and cannot be changed. - */ - /** @deprecated */ version: LogMetric_ApiVersion; } @@ -376,26 +255,8 @@ export interface ListLogMetricsRequest { /** The parameters to ListLogMetrics. */ export interface ListLogMetricsRequestSDKType { - /** - * Required. The name of the project containing the metrics: - * - * "projects/[PROJECT_ID]" - */ parent: string; - - /** - * Optional. If present, then retrieve the next batch of results from the - * preceding call to this method. `pageToken` must be the value of - * `nextPageToken` from the previous response. The values of other method - * parameters should be identical to those in the previous call. - */ page_token: string; - - /** - * Optional. The maximum number of results to return from this request. - * Non-positive values are ignored. The presence of `nextPageToken` in the - * response indicates that more results might be available. - */ page_size: number; } @@ -414,14 +275,7 @@ export interface ListLogMetricsResponse { /** Result returned from ListLogMetrics. */ export interface ListLogMetricsResponseSDKType { - /** A list of logs-based metrics. */ metrics: LogMetricSDKType[]; - - /** - * If there might be more results than appear in this response, then - * `nextPageToken` is included. To get the next set of results, call this - * method again using the value of `nextPageToken` as `pageToken`. - */ next_page_token: string; } @@ -437,11 +291,6 @@ export interface GetLogMetricRequest { /** The parameters to GetLogMetric. */ export interface GetLogMetricRequestSDKType { - /** - * Required. The resource name of the desired metric: - * - * "projects/[PROJECT_ID]/metrics/[METRIC_ID]" - */ metric_name: string; } @@ -465,19 +314,7 @@ export interface CreateLogMetricRequest { /** The parameters to CreateLogMetric. */ export interface CreateLogMetricRequestSDKType { - /** - * Required. The resource name of the project in which to create the metric: - * - * "projects/[PROJECT_ID]" - * - * The new metric must be provided in the request. - */ parent: string; - - /** - * Required. The new logs-based metric, which must not have an identifier that - * already exists. - */ metric?: LogMetricSDKType; } @@ -500,18 +337,7 @@ export interface UpdateLogMetricRequest { /** The parameters to UpdateLogMetric. */ export interface UpdateLogMetricRequestSDKType { - /** - * Required. The resource name of the metric to update: - * - * "projects/[PROJECT_ID]/metrics/[METRIC_ID]" - * - * The updated metric must be provided in the request and it's - * `name` field must be the same as `[METRIC_ID]` If the metric - * does not exist in `[PROJECT_ID]`, then a new metric is created. - */ metric_name: string; - - /** Required. The updated metric. */ metric?: LogMetricSDKType; } @@ -527,11 +353,6 @@ export interface DeleteLogMetricRequest { /** The parameters to DeleteLogMetric. */ export interface DeleteLogMetricRequestSDKType { - /** - * Required. The resource name of the metric to delete: - * - * "projects/[PROJECT_ID]/metrics/[METRIC_ID]" - */ metric_name: string; } diff --git a/__fixtures__/output1/google/longrunning/operations.ts b/__fixtures__/output1/google/longrunning/operations.ts index 2229c1fc3d..6dc3c8d7c2 100644 --- a/__fixtures__/output1/google/longrunning/operations.ts +++ b/__fixtures__/output1/google/longrunning/operations.ts @@ -53,41 +53,10 @@ export interface Operation { * network API call. */ export interface OperationSDKType { - /** - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the - * `name` should be a resource name ending with `operations/{unique_id}`. - */ name: string; - - /** - * Service-specific metadata associated with the operation. It typically - * contains progress information and common metadata such as create time. - * Some services might not provide such metadata. Any method that returns a - * long-running operation should document the metadata type, if any. - */ metadata?: AnySDKType; - - /** - * If the value is `false`, it means the operation is still in progress. - * If `true`, the operation is completed, and either `error` or `response` is - * available. - */ done: boolean; - - /** The error result of the operation in case of failure or cancellation. */ error?: StatusSDKType; - - /** - * The normal response of the operation in case of success. If the original - * method returns no data on success, such as `Delete`, the response is - * `google.protobuf.Empty`. If the original method is standard - * `Get`/`Create`/`Update`, the response should be the resource. For other - * methods, the response should have the type `XxxResponse`, where `Xxx` - * is the original method name. For example, if the original method name - * is `TakeSnapshot()`, the inferred response type is - * `TakeSnapshotResponse`. - */ response?: AnySDKType; } @@ -99,7 +68,6 @@ export interface GetOperationRequest { /** The request message for [Operations.GetOperation][google.longrunning.Operations.GetOperation]. */ export interface GetOperationRequestSDKType { - /** The name of the operation resource. */ name: string; } @@ -120,16 +88,9 @@ export interface ListOperationsRequest { /** The request message for [Operations.ListOperations][google.longrunning.Operations.ListOperations]. */ export interface ListOperationsRequestSDKType { - /** The name of the operation's parent resource. */ name: string; - - /** The standard list filter. */ filter: string; - - /** The standard list page size. */ page_size: number; - - /** The standard list page token. */ page_token: string; } @@ -144,10 +105,7 @@ export interface ListOperationsResponse { /** The response message for [Operations.ListOperations][google.longrunning.Operations.ListOperations]. */ export interface ListOperationsResponseSDKType { - /** A list of operations that matches the specified filter in the request. */ operations: OperationSDKType[]; - - /** The standard List next-page token. */ next_page_token: string; } @@ -159,7 +117,6 @@ export interface CancelOperationRequest { /** The request message for [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]. */ export interface CancelOperationRequestSDKType { - /** The name of the operation resource to be cancelled. */ name: string; } @@ -171,7 +128,6 @@ export interface DeleteOperationRequest { /** The request message for [Operations.DeleteOperation][google.longrunning.Operations.DeleteOperation]. */ export interface DeleteOperationRequestSDKType { - /** The name of the operation resource to be deleted. */ name: string; } @@ -190,14 +146,7 @@ export interface WaitOperationRequest { /** The request message for [Operations.WaitOperation][google.longrunning.Operations.WaitOperation]. */ export interface WaitOperationRequestSDKType { - /** The name of the operation resource to wait on. */ name: string; - - /** - * The maximum duration to wait before timing out. If left blank, the wait - * will be at most the time permitted by the underlying HTTP/RPC protocol. - * If RPC context deadline is also specified, the shorter one will be used. - */ timeout?: DurationSDKType; } @@ -253,27 +202,7 @@ export interface OperationInfo { * } */ export interface OperationInfoSDKType { - /** - * Required. The message name of the primary return type for this - * long-running operation. - * This type will be used to deserialize the LRO's response. - * - * If the response is in a different package from the rpc, a fully-qualified - * message name must be used (e.g. `google.protobuf.Struct`). - * - * Note: Altering this value constitutes a breaking change. - */ response_type: string; - - /** - * Required. The message name of the metadata type for this long-running - * operation. - * - * If the response is in a different package from the rpc, a fully-qualified - * message name must be used (e.g. `google.protobuf.Struct`). - * - * Note: Altering this value constitutes a breaking change. - */ metadata_type: string; } diff --git a/__fixtures__/output1/google/protobuf/any.ts b/__fixtures__/output1/google/protobuf/any.ts index 6f9352442e..53e35ff9c0 100644 --- a/__fixtures__/output1/google/protobuf/any.ts +++ b/__fixtures__/output1/google/protobuf/any.ts @@ -201,38 +201,7 @@ export interface Any { * } */ export interface AnySDKType { - /** - * A URL/resource name that uniquely identifies the type of the serialized - * protocol buffer message. This string must contain at least - * one "/" character. The last segment of the URL's path must represent - * the fully qualified name of the type (as in - * `path/google.protobuf.Duration`). The name should be in a canonical form - * (e.g., leading "." is not accepted). - * - * In practice, teams usually precompile into the binary all types that they - * expect it to use in the context of Any. However, for URLs which use the - * scheme `http`, `https`, or no scheme, one can optionally set up a type - * server that maps type URLs to message definitions as follows: - * - * * If no scheme is provided, `https` is assumed. - * * An HTTP GET on the URL must yield a [google.protobuf.Type][] - * value in binary format, or produce an error. - * * Applications are allowed to cache lookup results based on the - * URL, or have them precompiled into a binary to avoid any - * lookup. Therefore, binary compatibility needs to be preserved - * on changes to types. (Use versioned type names to manage - * breaking changes.) - * - * Note: this functionality is not currently available in the official - * protobuf release, and it is not used for type URLs beginning with - * type.googleapis.com. - * - * Schemes other than `http`, `https` (or the empty scheme) might be - * used with implementation specific semantics. - */ type_url: string; - - /** Must be a valid serialized protocol buffer of the above specified type. */ value: Uint8Array; } diff --git a/__fixtures__/output1/google/protobuf/api.ts b/__fixtures__/output1/google/protobuf/api.ts index 229cf985ad..51df778a1a 100644 --- a/__fixtures__/output1/google/protobuf/api.ts +++ b/__fixtures__/output1/google/protobuf/api.ts @@ -76,51 +76,12 @@ export interface Api { * detailed terminology. */ export interface ApiSDKType { - /** - * The fully qualified name of this interface, including package name - * followed by the interface's simple name. - */ name: string; - - /** The methods of this interface, in unspecified order. */ methods: MethodSDKType[]; - - /** Any metadata attached to the interface. */ options: OptionSDKType[]; - - /** - * A version string for this interface. If specified, must have the form - * `major-version.minor-version`, as in `1.10`. If the minor version is - * omitted, it defaults to zero. If the entire version field is empty, the - * major version is derived from the package name, as outlined below. If the - * field is not empty, the version in the package name will be verified to be - * consistent with what is provided here. - * - * The versioning schema uses [semantic - * versioning](http://semver.org) where the major version number - * indicates a breaking change and the minor version an additive, - * non-breaking change. Both version numbers are signals to users - * what to expect from different versions, and should be carefully - * chosen based on the product plan. - * - * The major version is also reflected in the package name of the - * interface, which must end in `v`, as in - * `google.feature.v1`. For major versions 0 and 1, the suffix can - * be omitted. Zero major versions must only be used for - * experimental, non-GA interfaces. - */ version: string; - - /** - * Source context for the protocol buffer service represented by this - * message. - */ source_context?: SourceContextSDKType; - - /** Included interfaces. See [Mixin][]. */ mixins: MixinSDKType[]; - - /** The source syntax of the service. */ syntax: Syntax; } @@ -150,25 +111,12 @@ export interface Method { /** Method represents a method of an API interface. */ export interface MethodSDKType { - /** The simple name of this method. */ name: string; - - /** A URL of the input message type. */ request_type_url: string; - - /** If true, the request is streamed. */ request_streaming: boolean; - - /** The URL of the output message type. */ response_type_url: string; - - /** If true, the response is streamed. */ response_streaming: boolean; - - /** Any metadata attached to the method. */ options: OptionSDKType[]; - - /** The source syntax of this method. */ syntax: Syntax; } @@ -344,13 +292,7 @@ export interface Mixin { * } */ export interface MixinSDKType { - /** The fully qualified name of the interface which is included. */ name: string; - - /** - * If non-empty specifies a path under which inherited HTTP paths - * are rooted. - */ root: string; } diff --git a/__fixtures__/output1/google/protobuf/compiler/plugin.ts b/__fixtures__/output1/google/protobuf/compiler/plugin.ts index 1044ccf37b..dd4efebbe7 100644 --- a/__fixtures__/output1/google/protobuf/compiler/plugin.ts +++ b/__fixtures__/output1/google/protobuf/compiler/plugin.ts @@ -21,11 +21,6 @@ export interface VersionSDKType { major: number; minor: number; patch: number; - - /** - * A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should - * be empty for mainline stable releases. - */ suffix: string; } @@ -65,35 +60,9 @@ export interface CodeGeneratorRequest { /** An encoded CodeGeneratorRequest is written to the plugin's stdin. */ export interface CodeGeneratorRequestSDKType { - /** - * The .proto files that were explicitly listed on the command-line. The - * code generator should generate code only for these files. Each file's - * descriptor will be included in proto_file, below. - */ file_to_generate: string[]; - - /** The generator parameter passed on the command-line. */ parameter: string; - - /** - * FileDescriptorProtos for all files in files_to_generate and everything - * they import. The files will appear in topological order, so each file - * appears before any file that imports it. - * - * protoc guarantees that all proto_files will be written after - * the fields above, even though this is not technically guaranteed by the - * protobuf wire format. This theoretically could allow a plugin to stream - * in the FileDescriptorProtos and handle them one by one rather than read - * the entire set into memory at once. However, as of this writing, this - * is not similarly optimized on protoc's end -- it will store all fields in - * memory at once before sending them to the plugin. - * - * Type names of fields and extensions in the FileDescriptorProto are always - * fully qualified. - */ proto_file: FileDescriptorProtoSDKType[]; - - /** The version number of protocol compiler. */ compiler_version?: VersionSDKType; } @@ -115,16 +84,6 @@ export interface CodeGeneratorResponse { /** The plugin writes an encoded CodeGeneratorResponse to stdout. */ export interface CodeGeneratorResponseSDKType { - /** - * Error message. If non-empty, code generation failed. The plugin process - * should exit with status code zero even if it reports an error in this way. - * - * This should be used to indicate errors in .proto files which prevent the - * code generator from generating correct code. Errors which indicate a - * problem in protoc itself -- such as the input CodeGeneratorRequest being - * unparseable -- should be reported by writing a message to stderr and - * exiting with a non-zero status code. - */ error: string; file: CodeGeneratorResponse_FileSDKType[]; } @@ -193,63 +152,8 @@ export interface CodeGeneratorResponse_File { /** Represents a single generated file. */ export interface CodeGeneratorResponse_FileSDKType { - /** - * The file name, relative to the output directory. The name must not - * contain "." or ".." components and must be relative, not be absolute (so, - * the file cannot lie outside the output directory). "/" must be used as - * the path separator, not "\". - * - * If the name is omitted, the content will be appended to the previous - * file. This allows the generator to break large files into small chunks, - * and allows the generated text to be streamed back to protoc so that large - * files need not reside completely in memory at one time. Note that as of - * this writing protoc does not optimize for this -- it will read the entire - * CodeGeneratorResponse before writing files to disk. - */ name: string; - - /** - * If non-empty, indicates that the named file should already exist, and the - * content here is to be inserted into that file at a defined insertion - * point. This feature allows a code generator to extend the output - * produced by another code generator. The original generator may provide - * insertion points by placing special annotations in the file that look - * like: - * @@protoc_insertion_point(NAME) - * The annotation can have arbitrary text before and after it on the line, - * which allows it to be placed in a comment. NAME should be replaced with - * an identifier naming the point -- this is what other generators will use - * as the insertion_point. Code inserted at this point will be placed - * immediately above the line containing the insertion point (thus multiple - * insertions to the same point will come out in the order they were added). - * The double-@ is intended to make it unlikely that the generated code - * could contain things that look like insertion points by accident. - * - * For example, the C++ code generator places the following line in the - * .pb.h files that it generates: - * // @@protoc_insertion_point(namespace_scope) - * This line appears within the scope of the file's package namespace, but - * outside of any particular class. Another plugin can then specify the - * insertion_point "namespace_scope" to generate additional classes or - * other declarations that should be placed in this scope. - * - * Note that if the line containing the insertion point begins with - * whitespace, the same whitespace will be added to every line of the - * inserted text. This is useful for languages like Python, where - * indentation matters. In these languages, the insertion point comment - * should be indented the same amount as any inserted code will need to be - * in order to work correctly in that context. - * - * The code generator that generates the initial file and the one which - * inserts into it must both run as part of a single invocation of protoc. - * Code generators are executed in the order in which they appear on the - * command line. - * - * If |insertion_point| is present, |name| must also be present. - */ insertion_point: string; - - /** The file contents. */ content: string; } diff --git a/__fixtures__/output1/google/protobuf/descriptor.ts b/__fixtures__/output1/google/protobuf/descriptor.ts index 8a3238ebe5..635fed1c6e 100644 --- a/__fixtures__/output1/google/protobuf/descriptor.ts +++ b/__fixtures__/output1/google/protobuf/descriptor.ts @@ -492,41 +492,17 @@ export interface FileDescriptorProto { /** Describes a complete .proto file. */ export interface FileDescriptorProtoSDKType { - /** file name, relative to root of source tree */ name: string; package: string; - - /** Names of files imported by this file. */ dependency: string[]; - - /** Indexes of the public imported files in the dependency list above. */ public_dependency: number[]; - - /** - * Indexes of the weak imported files in the dependency list. - * For Google-internal migration only. Do not use. - */ weak_dependency: number[]; - - /** All top-level definitions in this file. */ message_type: DescriptorProtoSDKType[]; enum_type: EnumDescriptorProtoSDKType[]; service: ServiceDescriptorProtoSDKType[]; extension: FieldDescriptorProtoSDKType[]; options?: FileOptionsSDKType; - - /** - * This field contains optional information about the original source code. - * You may safely remove this entire field without harming runtime - * functionality of the descriptors -- the information is needed only by - * development tools. - */ source_code_info?: SourceCodeInfoSDKType; - - /** - * The syntax of the proto file. - * The supported values are "proto2" and "proto3". - */ syntax: string; } @@ -560,11 +536,6 @@ export interface DescriptorProtoSDKType { oneof_decl: OneofDescriptorProtoSDKType[]; options?: MessageOptionsSDKType; reserved_range: DescriptorProto_ReservedRangeSDKType[]; - - /** - * Reserved field names, which may not be used by fields in the same message. - * A given name may only be reserved once. - */ reserved_name: string[]; } export interface DescriptorProto_ExtensionRange { @@ -576,10 +547,7 @@ export interface DescriptorProto_ExtensionRange { options?: ExtensionRangeOptions; } export interface DescriptorProto_ExtensionRangeSDKType { - /** Inclusive. */ start: number; - - /** Exclusive. */ end: number; options?: ExtensionRangeOptionsSDKType; } @@ -603,10 +571,7 @@ export interface DescriptorProto_ReservedRange { * not overlap. */ export interface DescriptorProto_ReservedRangeSDKType { - /** Inclusive. */ start: number; - - /** Exclusive. */ end: number; } export interface ExtensionRangeOptions { @@ -614,7 +579,6 @@ export interface ExtensionRangeOptions { uninterpretedOption: UninterpretedOption[]; } export interface ExtensionRangeOptionsSDKType { - /** The parser stores options it doesn't recognize here. See above. */ uninterpreted_option: UninterpretedOptionSDKType[]; } @@ -675,49 +639,11 @@ export interface FieldDescriptorProtoSDKType { name: string; number: number; label: FieldDescriptorProto_Label; - - /** - * If type_name is set, this need not be set. If both this and type_name - * are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. - */ type: FieldDescriptorProto_Type; - - /** - * For message and enum types, this is the name of the type. If the name - * starts with a '.', it is fully-qualified. Otherwise, C++-like scoping - * rules are used to find the type (i.e. first the nested types within this - * message are searched, then within the parent, on up to the root - * namespace). - */ type_name: string; - - /** - * For extensions, this is the name of the type being extended. It is - * resolved in the same manner as type_name. - */ extendee: string; - - /** - * For numeric types, contains the original text representation of the value. - * For booleans, "true" or "false". - * For strings, contains the default text contents (not escaped in any way). - * For bytes, contains the C escaped value. All bytes >= 128 are escaped. - * TODO(kenton): Base-64 encode? - */ default_value: string; - - /** - * If set, gives the index of a oneof in the containing type's oneof_decl - * list. This field is a member of that oneof. - */ oneof_index: number; - - /** - * JSON name of this field. The value is set by protocol compiler. If the - * user has set a "json_name" option on this field, that option's value - * will be used. Otherwise, it's deduced from the field's name by converting - * it to camelCase. - */ json_name: string; options?: FieldOptionsSDKType; } @@ -759,18 +685,7 @@ export interface EnumDescriptorProtoSDKType { name: string; value: EnumValueDescriptorProtoSDKType[]; options?: EnumOptionsSDKType; - - /** - * Range of reserved numeric values. Reserved numeric values may not be used - * by enum values in the same enum declaration. Reserved ranges may not - * overlap. - */ reserved_range: EnumDescriptorProto_EnumReservedRangeSDKType[]; - - /** - * Reserved enum value names, which may not be reused. A given name may only - * be reserved once. - */ reserved_name: string[]; } @@ -799,10 +714,7 @@ export interface EnumDescriptorProto_EnumReservedRange { * domain. */ export interface EnumDescriptorProto_EnumReservedRangeSDKType { - /** Inclusive. */ start: number; - - /** Inclusive. */ end: number; } @@ -856,19 +768,10 @@ export interface MethodDescriptorProto { /** Describes a method of a service. */ export interface MethodDescriptorProtoSDKType { name: string; - - /** - * Input and output type names. These are resolved in the same way as - * FieldDescriptorProto.type_name, but must refer to a message type. - */ input_type: string; output_type: string; options?: MethodOptionsSDKType; - - /** Identifies if client streams multiple client messages */ client_streaming: boolean; - - /** Identifies if server streams multiple server messages */ server_streaming: boolean; } export interface FileOptions { @@ -1006,137 +909,28 @@ export interface FileOptions { uninterpretedOption: UninterpretedOption[]; } export interface FileOptionsSDKType { - /** - * Sets the Java package where classes generated from this .proto will be - * placed. By default, the proto package is used, but this is often - * inappropriate because proto packages do not normally start with backwards - * domain names. - */ java_package: string; - - /** - * If set, all the classes from the .proto file are wrapped in a single - * outer class with the given name. This applies to both Proto1 - * (equivalent to the old "--one_java_file" option) and Proto2 (where - * a .proto always translates to a single class, but you may want to - * explicitly choose the class name). - */ java_outer_classname: string; - - /** - * If set true, then the Java code generator will generate a separate .java - * file for each top-level message, enum, and service defined in the .proto - * file. Thus, these types will *not* be nested inside the outer class - * named by java_outer_classname. However, the outer class will still be - * generated to contain the file's getDescriptor() method as well as any - * top-level extensions defined in the file. - */ java_multiple_files: boolean; - /** This option does nothing. */ - /** @deprecated */ java_generate_equals_and_hash: boolean; - - /** - * If set true, then the Java2 code generator will generate code that - * throws an exception whenever an attempt is made to assign a non-UTF-8 - * byte sequence to a string field. - * Message reflection will do the same. - * However, an extension field still accepts non-UTF-8 byte sequences. - * This option has no effect on when used with the lite runtime. - */ java_string_check_utf8: boolean; optimize_for: FileOptions_OptimizeMode; - - /** - * Sets the Go package where structs generated from this .proto will be - * placed. If omitted, the Go package will be derived from the following: - * - The basename of the package import path, if provided. - * - Otherwise, the package statement in the .proto file, if present. - * - Otherwise, the basename of the .proto file, without extension. - */ go_package: string; - - /** - * Should generic services be generated in each language? "Generic" services - * are not specific to any particular RPC system. They are generated by the - * main code generators in each language (without additional plugins). - * Generic services were the only kind of service generation supported by - * early versions of google.protobuf. - * - * Generic services are now considered deprecated in favor of using plugins - * that generate code specific to your particular RPC system. Therefore, - * these default to false. Old code which depends on generic services should - * explicitly set them to true. - */ cc_generic_services: boolean; java_generic_services: boolean; py_generic_services: boolean; php_generic_services: boolean; - - /** - * Is this file deprecated? - * Depending on the target platform, this can emit Deprecated annotations - * for everything in the file, or it will be completely ignored; in the very - * least, this is a formalization for deprecating files. - */ deprecated: boolean; - - /** - * Enables the use of arenas for the proto messages in this file. This applies - * only to generated classes for C++. - */ cc_enable_arenas: boolean; - - /** - * Sets the objective c class prefix which is prepended to all objective c - * generated classes from this .proto. There is no default. - */ objc_class_prefix: string; - - /** Namespace for generated classes; defaults to the package. */ csharp_namespace: string; - - /** - * By default Swift generators will take the proto package and CamelCase it - * replacing '.' with underscore and use that to prefix the types/symbols - * defined. When this options is provided, they will use this value instead - * to prefix the types/symbols defined. - */ swift_prefix: string; - - /** - * Sets the php class prefix which is prepended to all php generated classes - * from this .proto. Default is empty. - */ php_class_prefix: string; - - /** - * Use this option to change the namespace of php generated classes. Default - * is empty. When this option is empty, the package name will be used for - * determining the namespace. - */ php_namespace: string; - - /** - * Use this option to change the namespace of php generated metadata classes. - * Default is empty. When this option is empty, the proto file name will be - * used for determining the namespace. - */ php_metadata_namespace: string; - - /** - * Use this option to change the package of ruby generated classes. Default - * is empty. When this option is not set, the package name will be used for - * determining the ruby package. - */ ruby_package: string; - - /** - * The parser stores options it doesn't recognize here. - * See the documentation for the "Options" section above. - */ uninterpreted_option: UninterpretedOptionSDKType[]; } export interface MessageOptions { @@ -1206,88 +1000,29 @@ export interface MessageOptions { uninterpretedOption: UninterpretedOption[]; } export interface MessageOptionsSDKType { - /** - * Set true to use the old proto1 MessageSet wire format for extensions. - * This is provided for backwards-compatibility with the MessageSet wire - * format. You should not use this for any other reason: It's less - * efficient, has fewer features, and is more complicated. - * - * The message must be defined exactly as follows: - * message Foo { - * option message_set_wire_format = true; - * extensions 4 to max; - * } - * Note that the message cannot have any defined fields; MessageSets only - * have extensions. - * - * All extensions of your type must be singular messages; e.g. they cannot - * be int32s, enums, or repeated messages. - * - * Because this is an option, the above two restrictions are not enforced by - * the protocol compiler. - */ message_set_wire_format: boolean; - + no_standard_descriptor_accessor: boolean; + deprecated: boolean; + map_entry: boolean; + uninterpreted_option: UninterpretedOptionSDKType[]; +} +export interface FieldOptions { /** - * Disables the generation of the standard "descriptor()" accessor, which can - * conflict with a field of the same name. This is meant to make migration - * from proto1 easier; new code should avoid fields named "descriptor". + * The ctype option instructs the C++ code generator to use a different + * representation of the field than it normally would. See the specific + * options below. This option is not yet implemented in the open source + * release -- sorry, we'll try to include it in a future version! */ - no_standard_descriptor_accessor: boolean; + ctype: FieldOptions_CType; /** - * Is this message deprecated? - * Depending on the target platform, this can emit Deprecated annotations - * for the message, or it will be completely ignored; in the very least, - * this is a formalization for deprecating messages. + * The packed option can be enabled for repeated primitive fields to enable + * a more efficient representation on the wire. Rather than repeatedly + * writing the tag and type for each element, the entire array is encoded as + * a single length-delimited blob. In proto3, only explicit setting it to + * false will avoid using packed encoding. */ - deprecated: boolean; - - /** - * Whether the message is an automatically generated map entry type for the - * maps field. - * - * For maps fields: - * map map_field = 1; - * The parsed descriptor looks like: - * message MapFieldEntry { - * option map_entry = true; - * optional KeyType key = 1; - * optional ValueType value = 2; - * } - * repeated MapFieldEntry map_field = 1; - * - * Implementations may choose not to generate the map_entry=true message, but - * use a native map in the target language to hold the keys and values. - * The reflection APIs in such implementations still need to work as - * if the field is a repeated message field. - * - * NOTE: Do not set the option in .proto files. Always use the maps syntax - * instead. The option should only be implicitly set by the proto compiler - * parser. - */ - map_entry: boolean; - - /** The parser stores options it doesn't recognize here. See above. */ - uninterpreted_option: UninterpretedOptionSDKType[]; -} -export interface FieldOptions { - /** - * The ctype option instructs the C++ code generator to use a different - * representation of the field than it normally would. See the specific - * options below. This option is not yet implemented in the open source - * release -- sorry, we'll try to include it in a future version! - */ - ctype: FieldOptions_CType; - - /** - * The packed option can be enabled for repeated primitive fields to enable - * a more efficient representation on the wire. Rather than repeatedly - * writing the tag and type for each element, the entire array is encoded as - * a single length-delimited blob. In proto3, only explicit setting it to - * false will avoid using packed encoding. - */ - packed: boolean; + packed: boolean; /** * The jstype option determines the JavaScript type used for values of the @@ -1351,82 +1086,12 @@ export interface FieldOptions { uninterpretedOption: UninterpretedOption[]; } export interface FieldOptionsSDKType { - /** - * The ctype option instructs the C++ code generator to use a different - * representation of the field than it normally would. See the specific - * options below. This option is not yet implemented in the open source - * release -- sorry, we'll try to include it in a future version! - */ ctype: FieldOptions_CType; - - /** - * The packed option can be enabled for repeated primitive fields to enable - * a more efficient representation on the wire. Rather than repeatedly - * writing the tag and type for each element, the entire array is encoded as - * a single length-delimited blob. In proto3, only explicit setting it to - * false will avoid using packed encoding. - */ packed: boolean; - - /** - * The jstype option determines the JavaScript type used for values of the - * field. The option is permitted only for 64 bit integral and fixed types - * (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING - * is represented as JavaScript string, which avoids loss of precision that - * can happen when a large value is converted to a floating point JavaScript. - * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to - * use the JavaScript "number" type. The behavior of the default option - * JS_NORMAL is implementation dependent. - * - * This option is an enum to permit additional types to be added, e.g. - * goog.math.Integer. - */ jstype: FieldOptions_JSType; - - /** - * Should this field be parsed lazily? Lazy applies only to message-type - * fields. It means that when the outer message is initially parsed, the - * inner message's contents will not be parsed but instead stored in encoded - * form. The inner message will actually be parsed when it is first accessed. - * - * This is only a hint. Implementations are free to choose whether to use - * eager or lazy parsing regardless of the value of this option. However, - * setting this option true suggests that the protocol author believes that - * using lazy parsing on this field is worth the additional bookkeeping - * overhead typically needed to implement it. - * - * This option does not affect the public interface of any generated code; - * all method signatures remain the same. Furthermore, thread-safety of the - * interface is not affected by this option; const methods remain safe to - * call from multiple threads concurrently, while non-const methods continue - * to require exclusive access. - * - * - * Note that implementations may choose not to check required fields within - * a lazy sub-message. That is, calling IsInitialized() on the outer message - * may return true even if the inner message has missing required fields. - * This is necessary because otherwise the inner message would have to be - * parsed in order to perform the check, defeating the purpose of lazy - * parsing. An implementation which chooses not to check required fields - * must be consistent about it. That is, for any particular sub-message, the - * implementation must either *always* check its required fields, or *never* - * check its required fields, regardless of whether or not the message has - * been parsed. - */ lazy: boolean; - - /** - * Is this field deprecated? - * Depending on the target platform, this can emit Deprecated annotations - * for accessors, or it will be completely ignored; in the very least, this - * is a formalization for deprecating fields. - */ deprecated: boolean; - - /** For Google-internal migration only. Do not use. */ weak: boolean; - - /** The parser stores options it doesn't recognize here. See above. */ uninterpreted_option: UninterpretedOptionSDKType[]; } export interface OneofOptions { @@ -1434,7 +1099,6 @@ export interface OneofOptions { uninterpretedOption: UninterpretedOption[]; } export interface OneofOptionsSDKType { - /** The parser stores options it doesn't recognize here. See above. */ uninterpreted_option: UninterpretedOptionSDKType[]; } export interface EnumOptions { @@ -1456,21 +1120,8 @@ export interface EnumOptions { uninterpretedOption: UninterpretedOption[]; } export interface EnumOptionsSDKType { - /** - * Set this option to true to allow mapping different tag names to the same - * value. - */ allow_alias: boolean; - - /** - * Is this enum deprecated? - * Depending on the target platform, this can emit Deprecated annotations - * for the enum, or it will be completely ignored; in the very least, this - * is a formalization for deprecating enums. - */ deprecated: boolean; - - /** The parser stores options it doesn't recognize here. See above. */ uninterpreted_option: UninterpretedOptionSDKType[]; } export interface EnumValueOptions { @@ -1486,15 +1137,7 @@ export interface EnumValueOptions { uninterpretedOption: UninterpretedOption[]; } export interface EnumValueOptionsSDKType { - /** - * Is this enum value deprecated? - * Depending on the target platform, this can emit Deprecated annotations - * for the enum value, or it will be completely ignored; in the very least, - * this is a formalization for deprecating enum values. - */ deprecated: boolean; - - /** The parser stores options it doesn't recognize here. See above. */ uninterpreted_option: UninterpretedOptionSDKType[]; } export interface ServiceOptions { @@ -1510,15 +1153,7 @@ export interface ServiceOptions { uninterpretedOption: UninterpretedOption[]; } export interface ServiceOptionsSDKType { - /** - * Is this service deprecated? - * Depending on the target platform, this can emit Deprecated annotations - * for the service, or it will be completely ignored; in the very least, - * this is a formalization for deprecating services. - */ deprecated: boolean; - - /** The parser stores options it doesn't recognize here. See above. */ uninterpreted_option: UninterpretedOptionSDKType[]; } export interface MethodOptions { @@ -1535,16 +1170,8 @@ export interface MethodOptions { uninterpretedOption: UninterpretedOption[]; } export interface MethodOptionsSDKType { - /** - * Is this method deprecated? - * Depending on the target platform, this can emit Deprecated annotations - * for the method, or it will be completely ignored; in the very least, - * this is a formalization for deprecating methods. - */ deprecated: boolean; idempotency_level: MethodOptions_IdempotencyLevel; - - /** The parser stores options it doesn't recognize here. See above. */ uninterpreted_option: UninterpretedOptionSDKType[]; } @@ -1581,11 +1208,6 @@ export interface UninterpretedOption { */ export interface UninterpretedOptionSDKType { name: UninterpretedOption_NamePartSDKType[]; - - /** - * The value of the uninterpreted option, in whatever type the tokenizer - * identified it as during parsing. Exactly one of these should be set. - */ identifier_value: string; positive_int_value: Long; negative_int_value: Long; @@ -1676,51 +1298,6 @@ export interface SourceCodeInfo { * FileDescriptorProto was generated. */ export interface SourceCodeInfoSDKType { - /** - * A Location identifies a piece of source code in a .proto file which - * corresponds to a particular definition. This information is intended - * to be useful to IDEs, code indexers, documentation generators, and similar - * tools. - * - * For example, say we have a file like: - * message Foo { - * optional string foo = 1; - * } - * Let's look at just the field definition: - * optional string foo = 1; - * ^ ^^ ^^ ^ ^^^ - * a bc de f ghi - * We have the following locations: - * span path represents - * [a,i) [ 4, 0, 2, 0 ] The whole field definition. - * [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). - * [c,d) [ 4, 0, 2, 0, 5 ] The type (string). - * [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). - * [g,h) [ 4, 0, 2, 0, 3 ] The number (1). - * - * Notes: - * - A location may refer to a repeated field itself (i.e. not to any - * particular index within it). This is used whenever a set of elements are - * logically enclosed in a single code segment. For example, an entire - * extend block (possibly containing multiple extension definitions) will - * have an outer location whose path refers to the "extensions" repeated - * field without an index. - * - Multiple locations may have the same path. This happens when a single - * logical declaration is spread out across multiple places. The most - * obvious example is the "extend" block again -- there may be multiple - * extend blocks in the same scope, each of which will have the same path. - * - A location's span is not always a subset of its parent's span. For - * example, the "extendee" of an extension declaration appears at the - * beginning of the "extend" block and is shared by all extensions within - * the block. - * - Just because a location's span is a subset of some other location's span - * does not mean that it is a descendant. For example, a "group" defines - * both a type and a field in a single declaration. Thus, the locations - * corresponding to the type and field and their components will overlap. - * - Code which tries to interpret locations should probably be designed to - * ignore those that it doesn't understand, as more types of locations could - * be recorded in the future. - */ location: SourceCodeInfo_LocationSDKType[]; } export interface SourceCodeInfo_Location { @@ -1814,91 +1391,8 @@ export interface SourceCodeInfo_Location { leadingDetachedComments: string[]; } export interface SourceCodeInfo_LocationSDKType { - /** - * Identifies which part of the FileDescriptorProto was defined at this - * location. - * - * Each element is a field number or an index. They form a path from - * the root FileDescriptorProto to the place where the definition. For - * example, this path: - * [ 4, 3, 2, 7, 1 ] - * refers to: - * file.message_type(3) // 4, 3 - * .field(7) // 2, 7 - * .name() // 1 - * This is because FileDescriptorProto.message_type has field number 4: - * repeated DescriptorProto message_type = 4; - * and DescriptorProto.field has field number 2: - * repeated FieldDescriptorProto field = 2; - * and FieldDescriptorProto.name has field number 1: - * optional string name = 1; - * - * Thus, the above path gives the location of a field name. If we removed - * the last element: - * [ 4, 3, 2, 7 ] - * this path refers to the whole field declaration (from the beginning - * of the label to the terminating semicolon). - */ path: number[]; - - /** - * Always has exactly three or four elements: start line, start column, - * end line (optional, otherwise assumed same as start line), end column. - * These are packed into a single field for efficiency. Note that line - * and column numbers are zero-based -- typically you will want to add - * 1 to each before displaying to a user. - */ span: number[]; - - /** - * If this SourceCodeInfo represents a complete declaration, these are any - * comments appearing before and after the declaration which appear to be - * attached to the declaration. - * - * A series of line comments appearing on consecutive lines, with no other - * tokens appearing on those lines, will be treated as a single comment. - * - * leading_detached_comments will keep paragraphs of comments that appear - * before (but not connected to) the current element. Each paragraph, - * separated by empty lines, will be one comment element in the repeated - * field. - * - * Only the comment content is provided; comment markers (e.g. //) are - * stripped out. For block comments, leading whitespace and an asterisk - * will be stripped from the beginning of each line other than the first. - * Newlines are included in the output. - * - * Examples: - * - * optional int32 foo = 1; // Comment attached to foo. - * // Comment attached to bar. - * optional int32 bar = 2; - * - * optional string baz = 3; - * // Comment attached to baz. - * // Another line attached to baz. - * - * // Comment attached to qux. - * // - * // Another line attached to qux. - * optional double qux = 4; - * - * // Detached comment for corge. This is not leading or trailing comments - * // to qux or corge because there are blank lines separating it from - * // both. - * - * // Detached comment for corge paragraph 2. - * - * optional string corge = 5; - * /* Block comment attached - * * to corge. Leading asterisks - * * will be removed. *\/ - * /* Block comment attached to - * * grault. *\/ - * optional int32 grault = 6; - * - * // ignored detached comments. - */ leading_comments: string; trailing_comments: string; leading_detached_comments: string[]; @@ -1923,10 +1417,6 @@ export interface GeneratedCodeInfo { * source file, but may contain references to different source .proto files. */ export interface GeneratedCodeInfoSDKType { - /** - * An Annotation connects some span of text in generated code to an element - * of its generating .proto file. - */ annotation: GeneratedCodeInfo_AnnotationSDKType[]; } export interface GeneratedCodeInfo_Annotation { @@ -1953,26 +1443,9 @@ export interface GeneratedCodeInfo_Annotation { end: number; } export interface GeneratedCodeInfo_AnnotationSDKType { - /** - * Identifies the element in the original source .proto file. This field - * is formatted the same as SourceCodeInfo.Location.path. - */ path: number[]; - - /** Identifies the filesystem path to the original source .proto. */ source_file: string; - - /** - * Identifies the starting offset in bytes in the generated code - * that relates to the identified object. - */ begin: number; - - /** - * Identifies the ending offset in bytes in the generated code that - * relates to the identified offset. The end offset should be one past - * the last relevant byte (so the length of the text = end - begin). - */ end: number; } diff --git a/__fixtures__/output1/google/protobuf/duration.ts b/__fixtures__/output1/google/protobuf/duration.ts index 088cb3cc05..f7a325c328 100644 --- a/__fixtures__/output1/google/protobuf/duration.ts +++ b/__fixtures__/output1/google/protobuf/duration.ts @@ -142,21 +142,7 @@ export interface Duration { * microsecond should be expressed in JSON format as "3.000001s". */ export interface DurationSDKType { - /** - * Signed seconds of the span of time. Must be from -315,576,000,000 - * to +315,576,000,000 inclusive. Note: these bounds are computed from: - * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - */ seconds: Long; - - /** - * Signed fractions of a second at nanosecond resolution of the span - * of time. Durations less than one second are represented with a 0 - * `seconds` field and a positive or negative `nanos` field. For durations - * of one second or more, a non-zero value for the `nanos` field must be - * of the same sign as the `seconds` field. Must be from -999,999,999 - * to +999,999,999 inclusive. - */ nanos: number; } diff --git a/__fixtures__/output1/google/protobuf/field_mask.ts b/__fixtures__/output1/google/protobuf/field_mask.ts index c52714b277..8dccbacfa2 100644 --- a/__fixtures__/output1/google/protobuf/field_mask.ts +++ b/__fixtures__/output1/google/protobuf/field_mask.ts @@ -410,7 +410,6 @@ export interface FieldMask { * `INVALID_ARGUMENT` error if any path is duplicated or unmappable. */ export interface FieldMaskSDKType { - /** The set of field mask paths. */ paths: string[]; } diff --git a/__fixtures__/output1/google/protobuf/source_context.ts b/__fixtures__/output1/google/protobuf/source_context.ts index d292eb5eb7..f7f95fc26c 100644 --- a/__fixtures__/output1/google/protobuf/source_context.ts +++ b/__fixtures__/output1/google/protobuf/source_context.ts @@ -19,10 +19,6 @@ export interface SourceContext { * protobuf element, like the file in which it is defined. */ export interface SourceContextSDKType { - /** - * The path-qualified name of the .proto file that contained the associated - * protobuf element. For example: `"google/protobuf/source_context.proto"`. - */ file_name: string; } diff --git a/__fixtures__/output1/google/protobuf/struct.ts b/__fixtures__/output1/google/protobuf/struct.ts index ba73185eb8..f64c4e0f66 100644 --- a/__fixtures__/output1/google/protobuf/struct.ts +++ b/__fixtures__/output1/google/protobuf/struct.ts @@ -73,7 +73,6 @@ export interface Struct { * The JSON representation for `Struct` is JSON object. */ export interface StructSDKType { - /** Unordered map of dynamically typed values. */ fields?: { [key: string]: ValueSDKType; }; @@ -116,22 +115,11 @@ export interface Value { * The JSON representation for `Value` is JSON value. */ export interface ValueSDKType { - /** Represents a null value. */ null_value?: NullValue; - - /** Represents a double value. */ number_value?: number; - - /** Represents a string value. */ string_value?: string; - - /** Represents a boolean value. */ bool_value?: boolean; - - /** Represents a structured value. */ struct_value?: StructSDKType; - - /** Represents a repeated `Value`. */ list_value?: ListValueSDKType; } @@ -151,7 +139,6 @@ export interface ListValue { * The JSON representation for `ListValue` is JSON array. */ export interface ListValueSDKType { - /** Repeated field of dynamically typed values. */ values: ValueSDKType[]; } diff --git a/__fixtures__/output1/google/protobuf/timestamp.ts b/__fixtures__/output1/google/protobuf/timestamp.ts index 31aabdeb32..4237532c6b 100644 --- a/__fixtures__/output1/google/protobuf/timestamp.ts +++ b/__fixtures__/output1/google/protobuf/timestamp.ts @@ -188,19 +188,7 @@ export interface Timestamp { * ) to obtain a formatter capable of generating timestamps in this format. */ export interface TimestampSDKType { - /** - * Represents seconds of UTC time since Unix epoch - * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - * 9999-12-31T23:59:59Z inclusive. - */ seconds: Long; - - /** - * Non-negative fractions of a second at nanosecond resolution. Negative - * second values with fractions must still have non-negative nanos values - * that count forward in time. Must be from 0 to 999,999,999 - * inclusive. - */ nanos: number; } diff --git a/__fixtures__/output1/google/protobuf/type.ts b/__fixtures__/output1/google/protobuf/type.ts index 43752da1af..49101e72b9 100644 --- a/__fixtures__/output1/google/protobuf/type.ts +++ b/__fixtures__/output1/google/protobuf/type.ts @@ -337,22 +337,11 @@ export interface Type { /** A protocol buffer message type. */ export interface TypeSDKType { - /** The fully qualified message name. */ name: string; - - /** The list of fields. */ fields: FieldSDKType[]; - - /** The list of types appearing in `oneof` definitions in this type. */ oneofs: string[]; - - /** The protocol buffer options. */ options: OptionSDKType[]; - - /** The source context. */ source_context?: SourceContextSDKType; - - /** The source syntax. */ syntax: Syntax; } @@ -397,40 +386,15 @@ export interface Field { /** A single field of a message type. */ export interface FieldSDKType { - /** The field type. */ kind: Field_Kind; - - /** The field cardinality. */ cardinality: Field_Cardinality; - - /** The field number. */ number: number; - - /** The field name. */ name: string; - - /** - * The field type URL, without the scheme, for message or enumeration - * types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. - */ type_url: string; - - /** - * The index of the field type in `Type.oneofs`, for message or enumeration - * types. The first type has index 1; zero means the type is not in the list. - */ oneof_index: number; - - /** Whether to use alternative packed wire representation. */ packed: boolean; - - /** The protocol buffer options. */ options: OptionSDKType[]; - - /** The field JSON name. */ json_name: string; - - /** The string value of the default value of this field. Proto2 syntax only. */ default_value: string; } @@ -454,19 +418,10 @@ export interface Enum { /** Enum type definition. */ export interface EnumSDKType { - /** Enum type name. */ name: string; - - /** Enum value definitions. */ enumvalue: EnumValueSDKType[]; - - /** Protocol buffer options. */ options: OptionSDKType[]; - - /** The source context. */ source_context?: SourceContextSDKType; - - /** The source syntax. */ syntax: Syntax; } @@ -484,13 +439,8 @@ export interface EnumValue { /** Enum value definition. */ export interface EnumValueSDKType { - /** Enum value name. */ name: string; - - /** Enum value number. */ number: number; - - /** Protocol buffer options. */ options: OptionSDKType[]; } @@ -521,20 +471,7 @@ export interface Option { * enumeration, etc. */ export interface OptionSDKType { - /** - * The option's name. For protobuf built-in options (options defined in - * descriptor.proto), this is the short name. For example, `"map_entry"`. - * For custom options, it should be the fully-qualified name. For example, - * `"google.api.http"`. - */ name: string; - - /** - * The option's value packed in an Any message. If the value is a primitive, - * the corresponding wrapper type defined in google/protobuf/wrappers.proto - * should be used. If the value is an enum, it should be stored as an int32 - * value using the google.protobuf.Int32Value type. - */ value?: AnySDKType; } diff --git a/__fixtures__/output1/google/protobuf/wrappers.ts b/__fixtures__/output1/google/protobuf/wrappers.ts index ab985234b0..efd886d1a4 100644 --- a/__fixtures__/output1/google/protobuf/wrappers.ts +++ b/__fixtures__/output1/google/protobuf/wrappers.ts @@ -18,7 +18,6 @@ export interface DoubleValue { * The JSON representation for `DoubleValue` is JSON number. */ export interface DoubleValueSDKType { - /** The double value. */ value: number; } @@ -38,7 +37,6 @@ export interface FloatValue { * The JSON representation for `FloatValue` is JSON number. */ export interface FloatValueSDKType { - /** The float value. */ value: number; } @@ -58,7 +56,6 @@ export interface Int64Value { * The JSON representation for `Int64Value` is JSON string. */ export interface Int64ValueSDKType { - /** The int64 value. */ value: Long; } @@ -78,7 +75,6 @@ export interface UInt64Value { * The JSON representation for `UInt64Value` is JSON string. */ export interface UInt64ValueSDKType { - /** The uint64 value. */ value: Long; } @@ -98,7 +94,6 @@ export interface Int32Value { * The JSON representation for `Int32Value` is JSON number. */ export interface Int32ValueSDKType { - /** The int32 value. */ value: number; } @@ -118,7 +113,6 @@ export interface UInt32Value { * The JSON representation for `UInt32Value` is JSON number. */ export interface UInt32ValueSDKType { - /** The uint32 value. */ value: number; } @@ -138,7 +132,6 @@ export interface BoolValue { * The JSON representation for `BoolValue` is JSON `true` and `false`. */ export interface BoolValueSDKType { - /** The bool value. */ value: boolean; } @@ -158,7 +151,6 @@ export interface StringValue { * The JSON representation for `StringValue` is JSON string. */ export interface StringValueSDKType { - /** The string value. */ value: string; } @@ -178,7 +170,6 @@ export interface BytesValue { * The JSON representation for `BytesValue` is JSON string. */ export interface BytesValueSDKType { - /** The bytes value. */ value: Uint8Array; } diff --git a/__fixtures__/output1/google/rpc/context/attribute_context.ts b/__fixtures__/output1/google/rpc/context/attribute_context.ts index 6750ec7326..15e0c7f27f 100644 --- a/__fixtures__/output1/google/rpc/context/attribute_context.ts +++ b/__fixtures__/output1/google/rpc/context/attribute_context.ts @@ -87,44 +87,13 @@ export interface AttributeContext { * a system. */ export interface AttributeContextSDKType { - /** - * The origin of a network activity. In a multi hop network activity, - * the origin represents the sender of the first hop. For the first hop, - * the `source` and the `origin` must have the same content. - */ origin?: AttributeContext_PeerSDKType; - - /** - * The source of a network activity, such as starting a TCP connection. - * In a multi hop network activity, the source represents the sender of the - * last hop. - */ source?: AttributeContext_PeerSDKType; - - /** - * The destination of a network activity, such as accepting a TCP connection. - * In a multi hop network activity, the destination represents the receiver of - * the last hop. - */ destination?: AttributeContext_PeerSDKType; - - /** Represents a network request, such as an HTTP request. */ request?: AttributeContext_RequestSDKType; - - /** Represents a network response, such as an HTTP response. */ response?: AttributeContext_ResponseSDKType; - - /** - * Represents a target resource that is involved with a network activity. - * If multiple resources are involved with an activity, this must be the - * primary one. - */ resource?: AttributeContext_ResourceSDKType; - - /** Represents an API operation that is involved to a network activity. */ api?: AttributeContext_ApiSDKType; - - /** Supports extensions for advanced use cases, such as logs and metrics. */ extensions: AnySDKType[]; } export interface AttributeContext_Peer_LabelsEntry { @@ -176,29 +145,12 @@ export interface AttributeContext_Peer { * `principal` and `labels` as appropriate. */ export interface AttributeContext_PeerSDKType { - /** The IP address of the peer. */ ip: string; - - /** The network port of the peer. */ port: Long; - - /** The labels associated with the peer. */ labels: { [key: string]: string; }; - - /** - * The identity of this peer. Similar to `Request.auth.principal`, but - * relative to the peer instead of the request. For example, the - * idenity associated with a load balancer that forwared the request. - */ principal: string; - - /** - * The CLDR country/region code associated with the above IP address. - * If the IP address is private, the `region_code` should reflect the - * physical location where this peer is running. - */ region_code: string; } @@ -241,30 +193,9 @@ export interface AttributeContext_Api { * by Google APIs, Istio, and OpenAPI. */ export interface AttributeContext_ApiSDKType { - /** - * The API service name. It is a logical identifier for a networked API, - * such as "pubsub.googleapis.com". The naming syntax depends on the - * API management system being used for handling the request. - */ service: string; - - /** - * The API operation name. For gRPC requests, it is the fully qualified API - * method name, such as "google.pubsub.v1.Publisher.Publish". For OpenAPI - * requests, it is the `operationId`, such as "getPet". - */ operation: string; - - /** - * The API protocol used for sending the request, such as "http", "https", - * "grpc", or "internal". - */ protocol: string; - - /** - * The API version associated with the API operation above, such as "v1" or - * "v1alpha1". - */ version: string; } @@ -346,69 +277,10 @@ export interface AttributeContext_Auth { * correlate to concepts in other standards. */ export interface AttributeContext_AuthSDKType { - /** - * The authenticated principal. Reflects the issuer (`iss`) and subject - * (`sub`) claims within a JWT. The issuer and subject should be `/` - * delimited, with `/` percent-encoded within the subject fragment. For - * Google accounts, the principal format is: - * "https://accounts.google.com/{id}" - */ principal: string; - - /** - * The intended audience(s) for this authentication information. Reflects - * the audience (`aud`) claim within a JWT. The audience - * value(s) depends on the `issuer`, but typically include one or more of - * the following pieces of information: - * - * * The services intended to receive the credential. For example, - * ["https://pubsub.googleapis.com/", "https://storage.googleapis.com/"]. - * * A set of service-based scopes. For example, - * ["https://www.googleapis.com/auth/cloud-platform"]. - * * The client id of an app, such as the Firebase project id for JWTs - * from Firebase Auth. - * - * Consult the documentation for the credential issuer to determine the - * information provided. - */ audiences: string[]; - - /** - * The authorized presenter of the credential. Reflects the optional - * Authorized Presenter (`azp`) claim within a JWT or the - * OAuth client id. For example, a Google Cloud Platform client id looks - * as follows: "123456789012.apps.googleusercontent.com". - */ presenter: string; - - /** - * Structured claims presented with the credential. JWTs include - * `{key: value}` pairs for standard and private claims. The following - * is a subset of the standard required and optional claims that would - * typically be presented for a Google-based JWT: - * - * {'iss': 'accounts.google.com', - * 'sub': '113289723416554971153', - * 'aud': ['123456789012', 'pubsub.googleapis.com'], - * 'azp': '123456789012.apps.googleusercontent.com', - * 'email': 'jsmith@example.com', - * 'iat': 1353601026, - * 'exp': 1353604926} - * - * SAML assertions are similarly specified, but with an identity provider - * dependent structure. - */ claims?: StructSDKType; - - /** - * A list of access level resource names that allow resources to be - * accessed by authenticated requester. It is part of Secure GCP processing - * for the incoming request. An access level string has the format: - * "//{api_service_name}/accessPolicies/{policy_id}/accessLevels/{short_name}" - * - * Example: - * "//accesscontextmanager.googleapis.com/accessPolicies/MY_POLICY_ID/accessLevels/MY_LEVEL" - */ access_levels: string[]; } export interface AttributeContext_Request_HeadersEntry { @@ -496,67 +368,19 @@ export interface AttributeContext_Request { * the actual request to an equivalent HTTP request. */ export interface AttributeContext_RequestSDKType { - /** - * The unique ID for a request, which can be propagated to downstream - * systems. The ID should have low probability of collision - * within a single day for a specific service. - */ id: string; - - /** The HTTP request method, such as `GET`, `POST`. */ method: string; - - /** - * The HTTP request headers. If multiple headers share the same key, they - * must be merged according to the HTTP spec. All header keys must be - * lowercased, because HTTP header keys are case-insensitive. - */ headers: { [key: string]: string; }; - - /** The HTTP URL path. */ path: string; - - /** The HTTP request `Host` header value. */ host: string; - - /** The HTTP URL scheme, such as `http` and `https`. */ scheme: string; - - /** - * The HTTP URL query in the format of `name1=value1&name2=value2`, as it - * appears in the first line of the HTTP request. No decoding is performed. - */ query: string; - - /** - * The timestamp when the `destination` service receives the last byte of - * the request. - */ time?: Date; - - /** The HTTP request size in bytes. If unknown, it must be -1. */ size: Long; - - /** - * The network protocol used with the request, such as "http/1.1", - * "spdy/3", "h2", "h2c", "webrtc", "tcp", "udp", "quic". See - * https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids - * for details. - */ protocol: string; - - /** - * A special parameter for request reason. It is used by security systems - * to associate auditing information with a request. - */ reason: string; - - /** - * The request authentication. May be absent for unauthenticated requests. - * Derived from the HTTP request `Authorization` header or equivalent. - */ auth?: AttributeContext_AuthSDKType; } export interface AttributeContext_Response_HeadersEntry { @@ -608,33 +432,12 @@ export interface AttributeContext_Response { * generally models semantics of an HTTP response. */ export interface AttributeContext_ResponseSDKType { - /** The HTTP response status code, such as `200` and `404`. */ code: Long; - - /** The HTTP response size in bytes. If unknown, it must be -1. */ size: Long; - - /** - * The HTTP response headers. If multiple headers share the same key, they - * must be merged according to HTTP spec. All header keys must be - * lowercased, because HTTP header keys are case-insensitive. - */ headers: { [key: string]: string; }; - - /** - * The timestamp when the `destination` service sends the last byte of - * the response. - */ time?: Date; - - /** - * The length of time it takes the backend service to fully respond to a - * request. Measured from when the destination service starts to send the - * request to the backend until when the destination service receives the - * complete response from the backend. - */ backend_latency?: DurationSDKType; } export interface AttributeContext_Resource_LabelsEntry { @@ -767,104 +570,21 @@ export interface AttributeContext_Resource { * example, a file stored on a network storage service. */ export interface AttributeContext_ResourceSDKType { - /** - * The name of the service that this resource belongs to, such as - * `pubsub.googleapis.com`. The service may be different from the DNS - * hostname that actually serves the request. - */ service: string; - - /** - * The stable identifier (name) of a resource on the `service`. A resource - * can be logically identified as "//{resource.service}/{resource.name}". - * The differences between a resource name and a URI are: - * - * * Resource name is a logical identifier, independent of network - * protocol and API version. For example, - * `//pubsub.googleapis.com/projects/123/topics/news-feed`. - * * URI often includes protocol and version information, so it can - * be used directly by applications. For example, - * `https://pubsub.googleapis.com/v1/projects/123/topics/news-feed`. - * - * See https://cloud.google.com/apis/design/resource_names for details. - */ name: string; - - /** - * The type of the resource. The syntax is platform-specific because - * different platforms define their resources differently. - * - * For Google APIs, the type format must be "{service}/{kind}". - */ type: string; - - /** - * The labels or tags on the resource, such as AWS resource tags and - * Kubernetes resource labels. - */ labels: { [key: string]: string; }; - - /** - * The unique identifier of the resource. UID is unique in the time - * and space for this resource within the scope of the service. It is - * typically generated by the server on successful creation of a resource - * and must not be changed. UID is used to uniquely identify resources - * with resource name reuses. This should be a UUID4. - */ uid: string; - - /** - * Annotations is an unstructured key-value map stored with a resource that - * may be set by external tools to store and retrieve arbitrary metadata. - * They are not queryable and should be preserved when modifying objects. - * - * More info: https://kubernetes.io/docs/user-guide/annotations - */ annotations: { [key: string]: string; }; - - /** Mutable. The display name set by clients. Must be <= 63 characters. */ display_name: string; - - /** - * Output only. The timestamp when the resource was created. This may - * be either the time creation was initiated or when it was completed. - */ create_time?: Date; - - /** - * Output only. The timestamp when the resource was last updated. Any - * change to the resource made by users must refresh this value. - * Changes to a resource made by the service should refresh this value. - */ update_time?: Date; - - /** - * Output only. The timestamp when the resource was deleted. - * If the resource is not deleted, this must be empty. - */ delete_time?: Date; - - /** - * Output only. An opaque value that uniquely identifies a version or - * generation of a resource. It can be used to confirm that the client - * and server agree on the ordering of a resource being written. - */ etag: string; - - /** - * Immutable. The location of the resource. The location encoding is - * specific to the service provider, and new encoding may be introduced - * as the service evolves. - * - * For Google Cloud products, the encoding is what is used by Google Cloud - * APIs, such as `us-east1`, `aws-us-east-1`, and `azure-eastus2`. The - * semantics of `location` is identical to the - * `cloud.googleapis.com/location` label used by some Google Cloud APIs. - */ location: string; } diff --git a/__fixtures__/output1/google/rpc/error_details.ts b/__fixtures__/output1/google/rpc/error_details.ts index 58f2838e65..47b71182fc 100644 --- a/__fixtures__/output1/google/rpc/error_details.ts +++ b/__fixtures__/output1/google/rpc/error_details.ts @@ -39,7 +39,6 @@ export interface RetryInfo { * reached. */ export interface RetryInfoSDKType { - /** Clients should wait at least this long between retrying the same request. */ retry_delay?: DurationSDKType; } @@ -54,10 +53,7 @@ export interface DebugInfo { /** Describes additional debugging info. */ export interface DebugInfoSDKType { - /** The stack trace entries indicating where the error occurred. */ stack_entries: string[]; - - /** Additional debugging information provided by the server. */ detail: string; } @@ -93,7 +89,6 @@ export interface QuotaFailure { * quota failure. */ export interface QuotaFailureSDKType { - /** Describes all quota violations. */ violations: QuotaFailure_ViolationSDKType[]; } @@ -126,22 +121,7 @@ export interface QuotaFailure_Violation { * daily quota or a custom quota that was exceeded. */ export interface QuotaFailure_ViolationSDKType { - /** - * The subject on which the quota check failed. - * For example, "clientip:" or "project:". - */ subject: string; - - /** - * A description of how the quota check failed. Clients can use this - * description to find more about the quota configuration in the service's - * public documentation, or find the relevant quota limit to adjust through - * developer console. - * - * For example: "Service disabled" or "Daily Limit for read operations - * exceeded". - */ description: string; } export interface ErrorInfo_MetadataEntry { @@ -240,34 +220,8 @@ export interface ErrorInfo { * } */ export interface ErrorInfoSDKType { - /** - * The reason of the error. This is a constant value that identifies the - * proximate cause of the error. Error reasons are unique within a particular - * domain of errors. This should be at most 63 characters and match - * /[A-Z0-9_]+/. - */ reason: string; - - /** - * The logical grouping to which the "reason" belongs. The error domain - * is typically the registered service name of the tool or product that - * generates the error. Example: "pubsub.googleapis.com". If the error is - * generated by some common infrastructure, the error domain must be a - * globally unique value that identifies the infrastructure. For Google API - * infrastructure, the error domain is "googleapis.com". - */ domain: string; - - /** - * Additional structured details about this error. - * - * Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in - * length. When identifying the current value of an exceeded limit, the units - * should be contained in the key, not the value. For example, rather than - * {"instanceLimit": "100/request"}, should be returned as, - * {"instanceLimitPerRequest": "100"}, if the client exceeds the number of - * instances that can be created in a single (batch) request. - */ metadata: { [key: string]: string; }; @@ -293,7 +247,6 @@ export interface PreconditionFailure { * PreconditionFailure message. */ export interface PreconditionFailureSDKType { - /** Describes all precondition violations. */ violations: PreconditionFailure_ViolationSDKType[]; } @@ -324,26 +277,8 @@ export interface PreconditionFailure_Violation { /** A message type used to describe a single precondition failure. */ export interface PreconditionFailure_ViolationSDKType { - /** - * The type of PreconditionFailure. We recommend using a service-specific - * enum type to define the supported precondition violation subjects. For - * example, "TOS" for "Terms of Service violation". - */ type: string; - - /** - * The subject, relative to the type, that failed. - * For example, "google.com/cloud" relative to the "TOS" type would indicate - * which terms of service is being referenced. - */ subject: string; - - /** - * A description of how the precondition failed. Developers can use this - * description to understand how to fix the failure. - * - * For example: "Terms of service not accepted". - */ description: string; } @@ -361,7 +296,6 @@ export interface BadRequest { * syntactic aspects of the request. */ export interface BadRequestSDKType { - /** Describes all violations in a client request. */ field_violations: BadRequest_FieldViolationSDKType[]; } @@ -380,14 +314,7 @@ export interface BadRequest_FieldViolation { /** A message type used to describe a single bad request field. */ export interface BadRequest_FieldViolationSDKType { - /** - * A path leading to a field in the request body. The value will be a - * sequence of dot-separated identifiers that identify a protocol buffer - * field. E.g., "field_violations.field" would identify this field. - */ field: string; - - /** A description of why the request element is bad. */ description: string; } @@ -414,16 +341,7 @@ export interface RequestInfo { * or providing other forms of feedback. */ export interface RequestInfoSDKType { - /** - * An opaque string that should only be interpreted by the service generating - * it. For example, it can be used to identify requests in the service's logs. - */ request_id: string; - - /** - * Any data that was used to serve this request. For example, an encrypted - * stack trace that can be sent back to the service provider for debugging. - */ serving_data: string; } @@ -460,32 +378,9 @@ export interface ResourceInfo { /** Describes the resource that is being accessed. */ export interface ResourceInfoSDKType { - /** - * A name for the type of resource being accessed, e.g. "sql table", - * "cloud storage bucket", "file", "Google calendar"; or the type URL - * of the resource: e.g. "type.googleapis.com/google.pubsub.v1.Topic". - */ resource_type: string; - - /** - * The name of the resource being accessed. For example, a shared calendar - * name: "example.com_4fghdhgsrgh@group.calendar.google.com", if the current - * error is [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED]. - */ resource_name: string; - - /** - * The owner of the resource (optional). - * For example, "user:" or "project:". - */ owner: string; - - /** - * Describes what error is encountered when accessing this resource. - * For example, updating a cloud project may require the `writer` permission - * on the developer console project. - */ description: string; } @@ -509,7 +404,6 @@ export interface Help { * directly to the right place in the developer console to flip the bit. */ export interface HelpSDKType { - /** URL(s) pointing to additional information on handling the current error. */ links: Help_LinkSDKType[]; } @@ -524,10 +418,7 @@ export interface Help_Link { /** Describes a URL link. */ export interface Help_LinkSDKType { - /** Describes what the link offers. */ description: string; - - /** The URL of the link. */ url: string; } @@ -552,14 +443,7 @@ export interface LocalizedMessage { * which can be attached to an RPC error. */ export interface LocalizedMessageSDKType { - /** - * The locale used following the specification defined at - * http://www.rfc-editor.org/rfc/bcp/bcp47.txt. - * Examples are: "en-US", "fr-CH", "es-MX" - */ locale: string; - - /** The localized error message in the above locale. */ message: string; } diff --git a/__fixtures__/output1/google/rpc/status.ts b/__fixtures__/output1/google/rpc/status.ts index 7f10ed6f66..940a434d96 100644 --- a/__fixtures__/output1/google/rpc/status.ts +++ b/__fixtures__/output1/google/rpc/status.ts @@ -40,20 +40,8 @@ export interface Status { * [API Design Guide](https://cloud.google.com/apis/design/errors). */ export interface StatusSDKType { - /** The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. */ code: number; - - /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - */ message: string; - - /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - */ details: AnySDKType[]; } diff --git a/__fixtures__/output1/hooks.ts b/__fixtures__/output1/hooks.ts index 8eac9873a1..6601a0cea4 100644 --- a/__fixtures__/output1/hooks.ts +++ b/__fixtures__/output1/hooks.ts @@ -43,11 +43,12 @@ import * as _IbcCorePortV1Queryrpc from "./ibc/core/port/v1/query.rpc.Query"; import * as _OsmosisClaimV1beta1Queryrpc from "./osmosis/claim/v1beta1/query.rpc.Query"; import * as _OsmosisEpochsQueryrpc from "./osmosis/epochs/query.rpc.Query"; import * as _OsmosisGammV1beta1Queryrpc from "./osmosis/gamm/v1beta1/query.rpc.Query"; +import * as _OsmosisGammV2Queryrpc from "./osmosis/gamm/v2/query.rpc.Query"; +import * as _OsmosisIbcratelimitV1beta1Queryrpc from "./osmosis/ibc-rate-limit/v1beta1/query.rpc.Query"; import * as _OsmosisIncentivesQueryrpc from "./osmosis/incentives/query.rpc.Query"; import * as _OsmosisLockupQueryrpc from "./osmosis/lockup/query.rpc.Query"; import * as _OsmosisMintV1beta1Queryrpc from "./osmosis/mint/v1beta1/query.rpc.Query"; import * as _OsmosisPoolincentivesV1beta1Queryrpc from "./osmosis/pool-incentives/v1beta1/query.rpc.Query"; -import * as _OsmosisStreamswapV1Queryrpc from "./osmosis/streamswap/v1/query.rpc.Query"; import * as _OsmosisSuperfluidQueryrpc from "./osmosis/superfluid/query.rpc.Query"; import * as _OsmosisTokenfactoryV1beta1Queryrpc from "./osmosis/tokenfactory/v1beta1/query.rpc.Query"; import * as _OsmosisTwapV1beta1Queryrpc from "./osmosis/twap/v1beta1/query.rpc.Query"; @@ -200,7 +201,11 @@ export const createRpcQueryHooks = ({ v1beta1: _OsmosisEpochsQueryrpc.createRpcQueryHooks(rpc) }, gamm: { - v1beta1: _OsmosisGammV1beta1Queryrpc.createRpcQueryHooks(rpc) + v1beta1: _OsmosisGammV1beta1Queryrpc.createRpcQueryHooks(rpc), + v2: _OsmosisGammV2Queryrpc.createRpcQueryHooks(rpc) + }, + ibcratelimit: { + v1beta1: _OsmosisIbcratelimitV1beta1Queryrpc.createRpcQueryHooks(rpc) }, incentives: _OsmosisIncentivesQueryrpc.createRpcQueryHooks(rpc), lockup: _OsmosisLockupQueryrpc.createRpcQueryHooks(rpc), @@ -210,9 +215,6 @@ export const createRpcQueryHooks = ({ poolincentives: { v1beta1: _OsmosisPoolincentivesV1beta1Queryrpc.createRpcQueryHooks(rpc) }, - streamswap: { - v1: _OsmosisStreamswapV1Queryrpc.createRpcQueryHooks(rpc) - }, superfluid: _OsmosisSuperfluidQueryrpc.createRpcQueryHooks(rpc), tokenfactory: { v1beta1: _OsmosisTokenfactoryV1beta1Queryrpc.createRpcQueryHooks(rpc) diff --git a/__fixtures__/output1/ibc/applications/transfer/v1/query.ts b/__fixtures__/output1/ibc/applications/transfer/v1/query.ts index 3529f5fed0..663ea608f6 100644 --- a/__fixtures__/output1/ibc/applications/transfer/v1/query.ts +++ b/__fixtures__/output1/ibc/applications/transfer/v1/query.ts @@ -18,7 +18,6 @@ export interface QueryDenomTraceRequest { * method */ export interface QueryDenomTraceRequestSDKType { - /** hash (in hex format) of the denomination trace information. */ hash: string; } @@ -36,7 +35,6 @@ export interface QueryDenomTraceResponse { * method. */ export interface QueryDenomTraceResponseSDKType { - /** denom_trace returns the requested denomination trace information. */ denom_trace?: DenomTraceSDKType; } @@ -54,7 +52,6 @@ export interface QueryDenomTracesRequest { * method */ export interface QueryDenomTracesRequestSDKType { - /** pagination defines an optional pagination for the request. */ pagination?: PageRequestSDKType; } @@ -75,10 +72,7 @@ export interface QueryDenomTracesResponse { * method. */ export interface QueryDenomTracesResponseSDKType { - /** denom_traces returns all denominations trace information. */ denom_traces: DenomTraceSDKType[]; - - /** pagination defines the pagination in the response. */ pagination?: PageResponseSDKType; } @@ -96,7 +90,6 @@ export interface QueryParamsResponse { /** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponseSDKType { - /** params defines the parameters of the module. */ params?: ParamsSDKType; } diff --git a/__fixtures__/output1/ibc/applications/transfer/v1/transfer.ts b/__fixtures__/output1/ibc/applications/transfer/v1/transfer.ts index 580047d9cb..6f64604559 100644 --- a/__fixtures__/output1/ibc/applications/transfer/v1/transfer.ts +++ b/__fixtures__/output1/ibc/applications/transfer/v1/transfer.ts @@ -22,13 +22,7 @@ export interface DenomTrace { * source tracing information path. */ export interface DenomTraceSDKType { - /** - * path defines the chain of port/channel identifiers used for tracing the - * source of the fungible token. - */ path: string; - - /** base denomination of the relayed fungible token. */ base_denom: string; } @@ -59,16 +53,7 @@ export interface Params { * parameter for the denomination to false. */ export interface ParamsSDKType { - /** - * send_enabled enables or disables all cross-chain token transfers from this - * chain. - */ send_enabled: boolean; - - /** - * receive_enabled enables or disables all cross-chain token transfers to this - * chain. - */ receive_enabled: boolean; } diff --git a/__fixtures__/output1/ibc/applications/transfer/v1/tx.ts b/__fixtures__/output1/ibc/applications/transfer/v1/tx.ts index bb0151872f..aedbbe5b90 100644 --- a/__fixtures__/output1/ibc/applications/transfer/v1/tx.ts +++ b/__fixtures__/output1/ibc/applications/transfer/v1/tx.ts @@ -44,31 +44,12 @@ export interface MsgTransfer { * https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer#data-structures */ export interface MsgTransferSDKType { - /** the port on which the packet will be sent */ source_port: string; - - /** the channel by which the packet will be sent */ source_channel: string; - - /** the tokens to be transferred */ token?: CoinSDKType; - - /** the sender address */ sender: string; - - /** the recipient address on the destination chain */ receiver: string; - - /** - * Timeout height relative to the current block height. - * The timeout is disabled when set to 0. - */ timeout_height?: HeightSDKType; - - /** - * Timeout timestamp (in nanoseconds) relative to the current block timestamp. - * The timeout is disabled when set to 0. - */ timeout_timestamp: Long; } diff --git a/__fixtures__/output1/ibc/applications/transfer/v2/packet.ts b/__fixtures__/output1/ibc/applications/transfer/v2/packet.ts index 99f5954435..9ac3a9f72b 100644 --- a/__fixtures__/output1/ibc/applications/transfer/v2/packet.ts +++ b/__fixtures__/output1/ibc/applications/transfer/v2/packet.ts @@ -27,16 +27,9 @@ export interface FungibleTokenPacketData { * https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer#data-structures */ export interface FungibleTokenPacketDataSDKType { - /** the token denomination to be transferred */ denom: string; - - /** the token amount to be transferred */ amount: string; - - /** the sender address */ sender: string; - - /** the recipient address on the destination chain */ receiver: string; } diff --git a/__fixtures__/output1/ibc/bundle.ts b/__fixtures__/output1/ibc/bundle.ts index b51cb5ec64..02af5f8873 100644 --- a/__fixtures__/output1/ibc/bundle.ts +++ b/__fixtures__/output1/ibc/bundle.ts @@ -22,30 +22,30 @@ import * as _250 from "./lightclients/localhost/v1/localhost"; import * as _251 from "./lightclients/solomachine/v1/solomachine"; import * as _252 from "./lightclients/solomachine/v2/solomachine"; import * as _253 from "./lightclients/tendermint/v1/tendermint"; -import * as _465 from "./applications/transfer/v1/tx.amino"; -import * as _466 from "./core/channel/v1/tx.amino"; -import * as _467 from "./core/client/v1/tx.amino"; -import * as _468 from "./core/connection/v1/tx.amino"; -import * as _469 from "./applications/transfer/v1/tx.registry"; -import * as _470 from "./core/channel/v1/tx.registry"; -import * as _471 from "./core/client/v1/tx.registry"; -import * as _472 from "./core/connection/v1/tx.registry"; -import * as _473 from "./applications/transfer/v1/query.lcd"; -import * as _474 from "./core/channel/v1/query.lcd"; -import * as _475 from "./core/client/v1/query.lcd"; -import * as _476 from "./core/connection/v1/query.lcd"; -import * as _477 from "./applications/transfer/v1/query.rpc.Query"; -import * as _478 from "./core/channel/v1/query.rpc.Query"; -import * as _479 from "./core/client/v1/query.rpc.Query"; -import * as _480 from "./core/connection/v1/query.rpc.Query"; -import * as _481 from "./core/port/v1/query.rpc.Query"; -import * as _482 from "./applications/transfer/v1/tx.rpc.msg"; -import * as _483 from "./core/channel/v1/tx.rpc.msg"; -import * as _484 from "./core/client/v1/tx.rpc.msg"; -import * as _485 from "./core/connection/v1/tx.rpc.msg"; -import * as _552 from "./lcd"; -import * as _553 from "./rpc.query"; -import * as _554 from "./rpc.tx"; +import * as _463 from "./applications/transfer/v1/tx.amino"; +import * as _464 from "./core/channel/v1/tx.amino"; +import * as _465 from "./core/client/v1/tx.amino"; +import * as _466 from "./core/connection/v1/tx.amino"; +import * as _467 from "./applications/transfer/v1/tx.registry"; +import * as _468 from "./core/channel/v1/tx.registry"; +import * as _469 from "./core/client/v1/tx.registry"; +import * as _470 from "./core/connection/v1/tx.registry"; +import * as _471 from "./applications/transfer/v1/query.lcd"; +import * as _472 from "./core/channel/v1/query.lcd"; +import * as _473 from "./core/client/v1/query.lcd"; +import * as _474 from "./core/connection/v1/query.lcd"; +import * as _475 from "./applications/transfer/v1/query.rpc.Query"; +import * as _476 from "./core/channel/v1/query.rpc.Query"; +import * as _477 from "./core/client/v1/query.rpc.Query"; +import * as _478 from "./core/connection/v1/query.rpc.Query"; +import * as _479 from "./core/port/v1/query.rpc.Query"; +import * as _480 from "./applications/transfer/v1/tx.rpc.msg"; +import * as _481 from "./core/channel/v1/tx.rpc.msg"; +import * as _482 from "./core/client/v1/tx.rpc.msg"; +import * as _483 from "./core/connection/v1/tx.rpc.msg"; +import * as _549 from "./lcd"; +import * as _550 from "./rpc.query"; +import * as _551 from "./rpc.tx"; export namespace ibc { export namespace applications { export namespace transfer { @@ -53,11 +53,11 @@ export namespace ibc { ..._231, ..._232, ..._233, - ..._465, - ..._469, - ..._473, - ..._477, - ..._482 + ..._463, + ..._467, + ..._471, + ..._475, + ..._480 }; export const v2 = { ..._234 }; @@ -69,11 +69,11 @@ export namespace ibc { ..._236, ..._237, ..._238, - ..._466, - ..._470, - ..._474, - ..._478, - ..._483 + ..._464, + ..._468, + ..._472, + ..._476, + ..._481 }; } export namespace client { @@ -81,11 +81,11 @@ export namespace ibc { ..._240, ..._241, ..._242, - ..._467, - ..._471, - ..._475, - ..._479, - ..._484 + ..._465, + ..._469, + ..._473, + ..._477, + ..._482 }; } export namespace commitment { @@ -97,16 +97,16 @@ export namespace ibc { ..._245, ..._246, ..._247, - ..._468, - ..._472, - ..._476, - ..._480, - ..._485 + ..._466, + ..._470, + ..._474, + ..._478, + ..._483 }; } export namespace port { export const v1 = { ..._248, - ..._481 + ..._479 }; } export namespace types { @@ -130,8 +130,8 @@ export namespace ibc { }; } } - export const ClientFactory = { ..._552, - ..._553, - ..._554 + export const ClientFactory = { ..._549, + ..._550, + ..._551 }; } \ No newline at end of file diff --git a/__fixtures__/output1/ibc/core/channel/v1/channel.ts b/__fixtures__/output1/ibc/core/channel/v1/channel.ts index 0882e5ce19..6c1ec8a0eb 100644 --- a/__fixtures__/output1/ibc/core/channel/v1/channel.ts +++ b/__fixtures__/output1/ibc/core/channel/v1/channel.ts @@ -166,22 +166,10 @@ export interface Channel { * sending packets and one end capable of receiving packets. */ export interface ChannelSDKType { - /** current state of the channel end */ state: State; - - /** whether the channel is ordered or unordered */ ordering: Order; - - /** counterparty channel end */ counterparty?: CounterpartySDKType; - - /** - * list of connection identifiers, in order, along which packets sent on - * this channel will travel - */ connection_hops: string[]; - - /** opaque channel version, which is agreed upon during the handshake */ version: string; } @@ -220,28 +208,12 @@ export interface IdentifiedChannel { * identifier fields. */ export interface IdentifiedChannelSDKType { - /** current state of the channel end */ state: State; - - /** whether the channel is ordered or unordered */ ordering: Order; - - /** counterparty channel end */ counterparty?: CounterpartySDKType; - - /** - * list of connection identifiers, in order, along which packets sent on - * this channel will travel - */ connection_hops: string[]; - - /** opaque channel version, which is agreed upon during the handshake */ version: string; - - /** port identifier */ port_id: string; - - /** channel identifier */ channel_id: string; } @@ -256,10 +228,7 @@ export interface Counterparty { /** Counterparty defines a channel end counterparty */ export interface CounterpartySDKType { - /** port on the counterparty chain which owns the other end of the channel. */ port_id: string; - - /** channel end on the counterparty chain */ channel_id: string; } @@ -296,32 +265,13 @@ export interface Packet { /** Packet defines a type that carries data across different chains through IBC */ export interface PacketSDKType { - /** - * number corresponds to the order of sends and receives, where a Packet - * with an earlier sequence number must be sent and received before a Packet - * with a later sequence number. - */ sequence: Long; - - /** identifies the port on the sending chain. */ source_port: string; - - /** identifies the channel end on the sending chain. */ source_channel: string; - - /** identifies the port on the receiving chain. */ destination_port: string; - - /** identifies the channel end on the receiving chain. */ destination_channel: string; - - /** actual opaque bytes transferred directly to the application module */ data: Uint8Array; - - /** block height after which the packet times out */ timeout_height?: HeightSDKType; - - /** block timestamp (in nanoseconds) after which the packet times out */ timeout_timestamp: Long; } @@ -352,16 +302,9 @@ export interface PacketState { * state as a commitment, acknowledgement, or a receipt. */ export interface PacketStateSDKType { - /** channel port identifier. */ port_id: string; - - /** channel unique identifier. */ channel_id: string; - - /** packet sequence. */ sequence: Long; - - /** embedded data that represents packet state. */ data: Uint8Array; } diff --git a/__fixtures__/output1/ibc/core/channel/v1/genesis.ts b/__fixtures__/output1/ibc/core/channel/v1/genesis.ts index 6e0f594f4f..943c17a233 100644 --- a/__fixtures__/output1/ibc/core/channel/v1/genesis.ts +++ b/__fixtures__/output1/ibc/core/channel/v1/genesis.ts @@ -26,8 +26,6 @@ export interface GenesisStateSDKType { send_sequences: PacketSequenceSDKType[]; recv_sequences: PacketSequenceSDKType[]; ack_sequences: PacketSequenceSDKType[]; - - /** the sequence for the next generated channel identifier */ next_channel_sequence: Long; } diff --git a/__fixtures__/output1/ibc/core/channel/v1/query.ts b/__fixtures__/output1/ibc/core/channel/v1/query.ts index 29ae29e871..cef3e8d78b 100644 --- a/__fixtures__/output1/ibc/core/channel/v1/query.ts +++ b/__fixtures__/output1/ibc/core/channel/v1/query.ts @@ -17,10 +17,7 @@ export interface QueryChannelRequest { /** QueryChannelRequest is the request type for the Query/Channel RPC method */ export interface QueryChannelRequestSDKType { - /** port unique identifier */ port_id: string; - - /** channel unique identifier */ channel_id: string; } @@ -46,13 +43,8 @@ export interface QueryChannelResponse { * proof was retrieved. */ export interface QueryChannelResponseSDKType { - /** channel associated with the request identifiers */ channel?: ChannelSDKType; - - /** merkle proof of existence */ proof: Uint8Array; - - /** height at which the proof was retrieved */ proof_height?: HeightSDKType; } @@ -64,7 +56,6 @@ export interface QueryChannelsRequest { /** QueryChannelsRequest is the request type for the Query/Channels RPC method */ export interface QueryChannelsRequestSDKType { - /** pagination request */ pagination?: PageRequestSDKType; } @@ -82,13 +73,8 @@ export interface QueryChannelsResponse { /** QueryChannelsResponse is the response type for the Query/Channels RPC method. */ export interface QueryChannelsResponseSDKType { - /** list of stored channels of the chain. */ channels: IdentifiedChannelSDKType[]; - - /** pagination response */ pagination?: PageResponseSDKType; - - /** query block height */ height?: HeightSDKType; } @@ -109,10 +95,7 @@ export interface QueryConnectionChannelsRequest { * Query/QueryConnectionChannels RPC method */ export interface QueryConnectionChannelsRequestSDKType { - /** connection unique identifier */ connection: string; - - /** pagination request */ pagination?: PageRequestSDKType; } @@ -136,13 +119,8 @@ export interface QueryConnectionChannelsResponse { * Query/QueryConnectionChannels RPC method */ export interface QueryConnectionChannelsResponseSDKType { - /** list of channels associated with a connection. */ channels: IdentifiedChannelSDKType[]; - - /** pagination response */ pagination?: PageResponseSDKType; - - /** query block height */ height?: HeightSDKType; } @@ -163,10 +141,7 @@ export interface QueryChannelClientStateRequest { * RPC method */ export interface QueryChannelClientStateRequestSDKType { - /** port unique identifier */ port_id: string; - - /** channel unique identifier */ channel_id: string; } @@ -190,13 +165,8 @@ export interface QueryChannelClientStateResponse { * Query/QueryChannelClientState RPC method */ export interface QueryChannelClientStateResponseSDKType { - /** client state associated with the channel */ identified_client_state?: IdentifiedClientStateSDKType; - - /** merkle proof of existence */ proof: Uint8Array; - - /** height at which the proof was retrieved */ proof_height?: HeightSDKType; } @@ -223,16 +193,9 @@ export interface QueryChannelConsensusStateRequest { * Query/ConsensusState RPC method */ export interface QueryChannelConsensusStateRequestSDKType { - /** port unique identifier */ port_id: string; - - /** channel unique identifier */ channel_id: string; - - /** revision number of the consensus state */ revision_number: Long; - - /** revision height of the consensus state */ revision_height: Long; } @@ -259,16 +222,9 @@ export interface QueryChannelConsensusStateResponse { * Query/QueryChannelClientState RPC method */ export interface QueryChannelConsensusStateResponseSDKType { - /** consensus state associated with the channel */ consensus_state?: AnySDKType; - - /** client ID associated with the consensus state */ client_id: string; - - /** merkle proof of existence */ proof: Uint8Array; - - /** height at which the proof was retrieved */ proof_height?: HeightSDKType; } @@ -292,13 +248,8 @@ export interface QueryPacketCommitmentRequest { * Query/PacketCommitment RPC method */ export interface QueryPacketCommitmentRequestSDKType { - /** port unique identifier */ port_id: string; - - /** channel unique identifier */ channel_id: string; - - /** packet sequence */ sequence: Long; } @@ -324,13 +275,8 @@ export interface QueryPacketCommitmentResponse { * retrieved */ export interface QueryPacketCommitmentResponseSDKType { - /** packet associated with the request fields */ commitment: Uint8Array; - - /** merkle proof of existence */ proof: Uint8Array; - - /** height at which the proof was retrieved */ proof_height?: HeightSDKType; } @@ -354,13 +300,8 @@ export interface QueryPacketCommitmentsRequest { * Query/QueryPacketCommitments RPC method */ export interface QueryPacketCommitmentsRequestSDKType { - /** port unique identifier */ port_id: string; - - /** channel unique identifier */ channel_id: string; - - /** pagination request */ pagination?: PageRequestSDKType; } @@ -384,11 +325,7 @@ export interface QueryPacketCommitmentsResponse { */ export interface QueryPacketCommitmentsResponseSDKType { commitments: PacketStateSDKType[]; - - /** pagination response */ pagination?: PageResponseSDKType; - - /** query block height */ height?: HeightSDKType; } @@ -412,13 +349,8 @@ export interface QueryPacketReceiptRequest { * Query/PacketReceipt RPC method */ export interface QueryPacketReceiptRequestSDKType { - /** port unique identifier */ port_id: string; - - /** channel unique identifier */ channel_id: string; - - /** packet sequence */ sequence: Long; } @@ -444,13 +376,8 @@ export interface QueryPacketReceiptResponse { * retrieved */ export interface QueryPacketReceiptResponseSDKType { - /** success flag for if receipt exists */ received: boolean; - - /** merkle proof of existence */ proof: Uint8Array; - - /** height at which the proof was retrieved */ proof_height?: HeightSDKType; } @@ -474,13 +401,8 @@ export interface QueryPacketAcknowledgementRequest { * Query/PacketAcknowledgement RPC method */ export interface QueryPacketAcknowledgementRequestSDKType { - /** port unique identifier */ port_id: string; - - /** channel unique identifier */ channel_id: string; - - /** packet sequence */ sequence: Long; } @@ -506,13 +428,8 @@ export interface QueryPacketAcknowledgementResponse { * proof was retrieved */ export interface QueryPacketAcknowledgementResponseSDKType { - /** packet associated with the request fields */ acknowledgement: Uint8Array; - - /** merkle proof of existence */ proof: Uint8Array; - - /** height at which the proof was retrieved */ proof_height?: HeightSDKType; } @@ -539,16 +456,9 @@ export interface QueryPacketAcknowledgementsRequest { * Query/QueryPacketCommitments RPC method */ export interface QueryPacketAcknowledgementsRequestSDKType { - /** port unique identifier */ port_id: string; - - /** channel unique identifier */ channel_id: string; - - /** pagination request */ pagination?: PageRequestSDKType; - - /** list of packet sequences */ packet_commitment_sequences: Long[]; } @@ -572,11 +482,7 @@ export interface QueryPacketAcknowledgementsResponse { */ export interface QueryPacketAcknowledgementsResponseSDKType { acknowledgements: PacketStateSDKType[]; - - /** pagination response */ pagination?: PageResponseSDKType; - - /** query block height */ height?: HeightSDKType; } @@ -600,13 +506,8 @@ export interface QueryUnreceivedPacketsRequest { * Query/UnreceivedPackets RPC method */ export interface QueryUnreceivedPacketsRequestSDKType { - /** port unique identifier */ port_id: string; - - /** channel unique identifier */ channel_id: string; - - /** list of packet sequences */ packet_commitment_sequences: Long[]; } @@ -627,10 +528,7 @@ export interface QueryUnreceivedPacketsResponse { * Query/UnreceivedPacketCommitments RPC method */ export interface QueryUnreceivedPacketsResponseSDKType { - /** list of unreceived packet sequences */ sequences: Long[]; - - /** query block height */ height?: HeightSDKType; } @@ -654,13 +552,8 @@ export interface QueryUnreceivedAcksRequest { * Query/UnreceivedAcks RPC method */ export interface QueryUnreceivedAcksRequestSDKType { - /** port unique identifier */ port_id: string; - - /** channel unique identifier */ channel_id: string; - - /** list of acknowledgement sequences */ packet_ack_sequences: Long[]; } @@ -681,10 +574,7 @@ export interface QueryUnreceivedAcksResponse { * Query/UnreceivedAcks RPC method */ export interface QueryUnreceivedAcksResponseSDKType { - /** list of unreceived acknowledgement sequences */ sequences: Long[]; - - /** query block height */ height?: HeightSDKType; } @@ -705,10 +595,7 @@ export interface QueryNextSequenceReceiveRequest { * Query/QueryNextSequenceReceiveRequest RPC method */ export interface QueryNextSequenceReceiveRequestSDKType { - /** port unique identifier */ port_id: string; - - /** channel unique identifier */ channel_id: string; } @@ -732,13 +619,8 @@ export interface QueryNextSequenceReceiveResponse { * Query/QueryNextSequenceReceiveResponse RPC method */ export interface QueryNextSequenceReceiveResponseSDKType { - /** next sequence receive number */ next_sequence_receive: Long; - - /** merkle proof of existence */ proof: Uint8Array; - - /** height at which the proof was retrieved */ proof_height?: HeightSDKType; } diff --git a/__fixtures__/output1/ibc/core/channel/v1/tx.ts b/__fixtures__/output1/ibc/core/channel/v1/tx.ts index d6437ad157..98b35c8ca3 100644 --- a/__fixtures__/output1/ibc/core/channel/v1/tx.ts +++ b/__fixtures__/output1/ibc/core/channel/v1/tx.ts @@ -55,11 +55,6 @@ export interface MsgChannelOpenTry { */ export interface MsgChannelOpenTrySDKType { port_id: string; - - /** - * in the case of crossing hello's, when both chains call OpenInit, we need - * the channel identifier of the previous channel in state INIT - */ previous_channel_id: string; channel?: ChannelSDKType; counterparty_version: string; diff --git a/__fixtures__/output1/ibc/core/client/v1/client.ts b/__fixtures__/output1/ibc/core/client/v1/client.ts index 05a36d35df..52ae2f9341 100644 --- a/__fixtures__/output1/ibc/core/client/v1/client.ts +++ b/__fixtures__/output1/ibc/core/client/v1/client.ts @@ -21,10 +21,7 @@ export interface IdentifiedClientState { * identifier field. */ export interface IdentifiedClientStateSDKType { - /** client identifier */ client_id: string; - - /** client state */ client_state?: AnySDKType; } @@ -45,10 +42,7 @@ export interface ConsensusStateWithHeight { * field. */ export interface ConsensusStateWithHeightSDKType { - /** consensus state height */ height?: HeightSDKType; - - /** consensus state */ consensus_state?: AnySDKType; } @@ -69,10 +63,7 @@ export interface ClientConsensusStates { * client. */ export interface ClientConsensusStatesSDKType { - /** client identifier */ client_id: string; - - /** consensus states and their heights associated with the client */ consensus_states: ConsensusStateWithHeightSDKType[]; } @@ -106,19 +97,9 @@ export interface ClientUpdateProposal { * chain parameters (with exception to latest height, frozen height, and chain-id). */ export interface ClientUpdateProposalSDKType { - /** the title of the update proposal */ title: string; - - /** the description of the proposal */ description: string; - - /** the client identifier for the client to be updated if the proposal passes */ subject_client_id: string; - - /** - * the substitute client identifier for the client standing in for the subject - * client - */ substitute_client_id: string; } @@ -150,15 +131,6 @@ export interface UpgradeProposalSDKType { title: string; description: string; plan?: PlanSDKType; - - /** - * An UpgradedClientState must be provided to perform an IBC breaking upgrade. - * This will make the chain commit to the correct upgraded (self) client state - * before the upgrade occurs, so that connecting chains can verify that the - * new upgraded client is valid by verifying a proof on the previous version - * of the chain. This will allow IBC connections to persist smoothly across - * planned chain upgrades - */ upgraded_client_state?: AnySDKType; } @@ -195,10 +167,7 @@ export interface Height { * gets reset */ export interface HeightSDKType { - /** the revision that the client is currently on */ revision_number: Long; - - /** the height within the given revision */ revision_height: Long; } @@ -210,7 +179,6 @@ export interface Params { /** Params defines the set of IBC light client parameters. */ export interface ParamsSDKType { - /** allowed_clients defines the list of allowed client state types. */ allowed_clients: string[]; } diff --git a/__fixtures__/output1/ibc/core/client/v1/genesis.ts b/__fixtures__/output1/ibc/core/client/v1/genesis.ts index f9c4dc8b6e..72f103a6b4 100644 --- a/__fixtures__/output1/ibc/core/client/v1/genesis.ts +++ b/__fixtures__/output1/ibc/core/client/v1/genesis.ts @@ -24,20 +24,11 @@ export interface GenesisState { /** GenesisState defines the ibc client submodule's genesis state. */ export interface GenesisStateSDKType { - /** client states with their corresponding identifiers */ clients: IdentifiedClientStateSDKType[]; - - /** consensus states from each client */ clients_consensus: ClientConsensusStatesSDKType[]; - - /** metadata from each client */ clients_metadata: IdentifiedGenesisMetadataSDKType[]; params?: ParamsSDKType; - - /** create localhost on initialization */ create_localhost: boolean; - - /** the sequence for the next generated client identifier */ next_client_sequence: Long; } @@ -58,10 +49,7 @@ export interface GenesisMetadata { * with ExportMetadata */ export interface GenesisMetadataSDKType { - /** store key of metadata without clientID-prefix */ key: Uint8Array; - - /** metadata value */ value: Uint8Array; } diff --git a/__fixtures__/output1/ibc/core/client/v1/query.ts b/__fixtures__/output1/ibc/core/client/v1/query.ts index 73cdc1b63b..0e930b9175 100644 --- a/__fixtures__/output1/ibc/core/client/v1/query.ts +++ b/__fixtures__/output1/ibc/core/client/v1/query.ts @@ -19,7 +19,6 @@ export interface QueryClientStateRequest { * method */ export interface QueryClientStateRequestSDKType { - /** client state unique identifier */ client_id: string; } @@ -45,13 +44,8 @@ export interface QueryClientStateResponse { * which the proof was retrieved. */ export interface QueryClientStateResponseSDKType { - /** client state associated with the request identifier */ client_state?: AnySDKType; - - /** merkle proof of existence */ proof: Uint8Array; - - /** height at which the proof was retrieved */ proof_height?: HeightSDKType; } @@ -69,7 +63,6 @@ export interface QueryClientStatesRequest { * method */ export interface QueryClientStatesRequestSDKType { - /** pagination request */ pagination?: PageRequestSDKType; } @@ -90,10 +83,7 @@ export interface QueryClientStatesResponse { * method. */ export interface QueryClientStatesResponseSDKType { - /** list of stored ClientStates of the chain. */ client_states: IdentifiedClientStateSDKType[]; - - /** pagination response */ pagination?: PageResponseSDKType; } @@ -125,19 +115,9 @@ export interface QueryConsensusStateRequest { * from which the proof was retrieved. */ export interface QueryConsensusStateRequestSDKType { - /** client identifier */ client_id: string; - - /** consensus state revision number */ revision_number: Long; - - /** consensus state revision height */ revision_height: Long; - - /** - * latest_height overrrides the height field and queries the latest stored - * ConsensusState - */ latest_height: boolean; } @@ -161,13 +141,8 @@ export interface QueryConsensusStateResponse { * RPC method */ export interface QueryConsensusStateResponseSDKType { - /** consensus state associated with the client identifier at the given height */ consensus_state?: AnySDKType; - - /** merkle proof of existence */ proof: Uint8Array; - - /** height at which the proof was retrieved */ proof_height?: HeightSDKType; } @@ -188,10 +163,7 @@ export interface QueryConsensusStatesRequest { * RPC method. */ export interface QueryConsensusStatesRequestSDKType { - /** client identifier */ client_id: string; - - /** pagination request */ pagination?: PageRequestSDKType; } @@ -212,10 +184,7 @@ export interface QueryConsensusStatesResponse { * Query/ConsensusStates RPC method */ export interface QueryConsensusStatesResponseSDKType { - /** consensus states associated with the identifier */ consensus_states: ConsensusStateWithHeightSDKType[]; - - /** pagination response */ pagination?: PageResponseSDKType; } @@ -233,7 +202,6 @@ export interface QueryClientStatusRequest { * method */ export interface QueryClientStatusRequestSDKType { - /** client unique identifier */ client_id: string; } @@ -279,7 +247,6 @@ export interface QueryClientParamsResponse { * method. */ export interface QueryClientParamsResponseSDKType { - /** params defines the parameters of the module. */ params?: ParamsSDKType; } @@ -309,7 +276,6 @@ export interface QueryUpgradedClientStateResponse { * Query/UpgradedClientState RPC method. */ export interface QueryUpgradedClientStateResponseSDKType { - /** client state associated with the request identifier */ upgraded_client_state?: AnySDKType; } @@ -339,7 +305,6 @@ export interface QueryUpgradedConsensusStateResponse { * Query/UpgradedConsensusState RPC method. */ export interface QueryUpgradedConsensusStateResponseSDKType { - /** Consensus state associated with the request identifier */ upgraded_consensus_state?: AnySDKType; } diff --git a/__fixtures__/output1/ibc/core/client/v1/tx.ts b/__fixtures__/output1/ibc/core/client/v1/tx.ts index 7acdaabeb9..edd5e91384 100644 --- a/__fixtures__/output1/ibc/core/client/v1/tx.ts +++ b/__fixtures__/output1/ibc/core/client/v1/tx.ts @@ -20,16 +20,8 @@ export interface MsgCreateClient { /** MsgCreateClient defines a message to create an IBC client */ export interface MsgCreateClientSDKType { - /** light client state */ client_state?: AnySDKType; - - /** - * consensus state associated with the client that corresponds to a given - * height. - */ consensus_state?: AnySDKType; - - /** signer address */ signer: string; } @@ -59,13 +51,8 @@ export interface MsgUpdateClient { * the given header. */ export interface MsgUpdateClientSDKType { - /** client unique identifier */ client_id: string; - - /** header to update the light client */ header?: AnySDKType; - - /** signer address */ signer: string; } @@ -107,25 +94,11 @@ export interface MsgUpgradeClient { * state */ export interface MsgUpgradeClientSDKType { - /** client unique identifier */ client_id: string; - - /** upgraded client state */ client_state?: AnySDKType; - - /** - * upgraded consensus state, only contains enough information to serve as a - * basis of trust in update logic - */ consensus_state?: AnySDKType; - - /** proof that old chain committed to new client */ proof_upgrade_client: Uint8Array; - - /** proof that old chain committed to new consensus state */ proof_upgrade_consensus_state: Uint8Array; - - /** signer address */ signer: string; } @@ -155,13 +128,8 @@ export interface MsgSubmitMisbehaviour { * light client misbehaviour. */ export interface MsgSubmitMisbehaviourSDKType { - /** client unique identifier */ client_id: string; - - /** misbehaviour used for freezing the light client */ misbehaviour?: AnySDKType; - - /** signer address */ signer: string; } diff --git a/__fixtures__/output1/ibc/core/connection/v1/connection.ts b/__fixtures__/output1/ibc/core/connection/v1/connection.ts index 445aeb072f..0f1ebff198 100644 --- a/__fixtures__/output1/ibc/core/connection/v1/connection.ts +++ b/__fixtures__/output1/ibc/core/connection/v1/connection.ts @@ -106,26 +106,10 @@ export interface ConnectionEnd { * a connection between two chains. */ export interface ConnectionEndSDKType { - /** client associated with this connection. */ client_id: string; - - /** - * IBC version which can be utilised to determine encodings or protocols for - * channels or packets utilising this connection. - */ versions: VersionSDKType[]; - - /** current state of the connection end. */ state: State; - - /** counterparty chain associated with this connection. */ counterparty?: CounterpartySDKType; - - /** - * delay period that must pass before a consensus state can be used for - * packet-verification NOTE: delay period logic is only implemented by some - * clients. - */ delay_period: Long; } @@ -161,25 +145,11 @@ export interface IdentifiedConnection { * identifier field. */ export interface IdentifiedConnectionSDKType { - /** connection identifier. */ id: string; - - /** client associated with this connection. */ client_id: string; - - /** - * IBC version which can be utilised to determine encodings or protocols for - * channels or packets utilising this connection - */ versions: VersionSDKType[]; - - /** current state of the connection end. */ state: State; - - /** counterparty chain associated with this connection. */ counterparty?: CounterpartySDKType; - - /** delay period associated with this connection. */ delay_period: Long; } @@ -203,19 +173,8 @@ export interface Counterparty { /** Counterparty defines the counterparty chain associated with a connection end. */ export interface CounterpartySDKType { - /** - * identifies the client on the counterparty chain associated with a given - * connection. - */ client_id: string; - - /** - * identifies the connection end on the counterparty chain associated with a - * given connection. - */ connection_id: string; - - /** commitment merkle prefix of the counterparty chain. */ prefix?: MerklePrefixSDKType; } @@ -227,7 +186,6 @@ export interface ClientPaths { /** ClientPaths define all the connection paths for a client state. */ export interface ClientPathsSDKType { - /** list of connection paths */ paths: string[]; } @@ -242,10 +200,7 @@ export interface ConnectionPaths { /** ConnectionPaths define all the connection paths for a given client state. */ export interface ConnectionPathsSDKType { - /** client state unique identifier */ client_id: string; - - /** list of connection paths */ paths: string[]; } @@ -266,10 +221,7 @@ export interface Version { * the connection handshake. */ export interface VersionSDKType { - /** unique version identifier */ identifier: string; - - /** list of features compatible with the specified identifier */ features: string[]; } @@ -285,11 +237,6 @@ export interface Params { /** Params defines the set of Connection parameters. */ export interface ParamsSDKType { - /** - * maximum expected time per block (in nanoseconds), used to enforce block delay. This parameter should reflect the - * largest amount of time that the chain might reasonably take to produce the next block under normal operating - * conditions. A safe choice is 3-5x the expected time per block. - */ max_expected_time_per_block: Long; } diff --git a/__fixtures__/output1/ibc/core/connection/v1/genesis.ts b/__fixtures__/output1/ibc/core/connection/v1/genesis.ts index 54f5d376dc..e1f71f1f22 100644 --- a/__fixtures__/output1/ibc/core/connection/v1/genesis.ts +++ b/__fixtures__/output1/ibc/core/connection/v1/genesis.ts @@ -17,8 +17,6 @@ export interface GenesisState { export interface GenesisStateSDKType { connections: IdentifiedConnectionSDKType[]; client_connection_paths: ConnectionPathsSDKType[]; - - /** the sequence for the next generated connection identifier */ next_connection_sequence: Long; params?: ParamsSDKType; } diff --git a/__fixtures__/output1/ibc/core/connection/v1/query.ts b/__fixtures__/output1/ibc/core/connection/v1/query.ts index 063fa5c907..b86375e212 100644 --- a/__fixtures__/output1/ibc/core/connection/v1/query.ts +++ b/__fixtures__/output1/ibc/core/connection/v1/query.ts @@ -20,7 +20,6 @@ export interface QueryConnectionRequest { * method */ export interface QueryConnectionRequestSDKType { - /** connection unique identifier */ connection_id: string; } @@ -46,13 +45,8 @@ export interface QueryConnectionResponse { * which the proof was retrieved. */ export interface QueryConnectionResponseSDKType { - /** connection associated with the request identifier */ connection?: ConnectionEndSDKType; - - /** merkle proof of existence */ proof: Uint8Array; - - /** height at which the proof was retrieved */ proof_height?: HeightSDKType; } @@ -92,13 +86,8 @@ export interface QueryConnectionsResponse { * method. */ export interface QueryConnectionsResponseSDKType { - /** list of stored connections of the chain. */ connections: IdentifiedConnectionSDKType[]; - - /** pagination response */ pagination?: PageResponseSDKType; - - /** query block height */ height?: HeightSDKType; } @@ -116,7 +105,6 @@ export interface QueryClientConnectionsRequest { * Query/ClientConnections RPC method */ export interface QueryClientConnectionsRequestSDKType { - /** client identifier associated with a connection */ client_id: string; } @@ -140,13 +128,8 @@ export interface QueryClientConnectionsResponse { * Query/ClientConnections RPC method */ export interface QueryClientConnectionsResponseSDKType { - /** slice of all the connection paths associated with a client. */ connection_paths: string[]; - - /** merkle proof of existence */ proof: Uint8Array; - - /** height at which the proof was generated */ proof_height?: HeightSDKType; } @@ -164,7 +147,6 @@ export interface QueryConnectionClientStateRequest { * Query/ConnectionClientState RPC method */ export interface QueryConnectionClientStateRequestSDKType { - /** connection identifier */ connection_id: string; } @@ -188,13 +170,8 @@ export interface QueryConnectionClientStateResponse { * Query/ConnectionClientState RPC method */ export interface QueryConnectionClientStateResponseSDKType { - /** client state associated with the channel */ identified_client_state?: IdentifiedClientStateSDKType; - - /** merkle proof of existence */ proof: Uint8Array; - - /** height at which the proof was retrieved */ proof_height?: HeightSDKType; } @@ -214,7 +191,6 @@ export interface QueryConnectionConsensusStateRequest { * Query/ConnectionConsensusState RPC method */ export interface QueryConnectionConsensusStateRequestSDKType { - /** connection identifier */ connection_id: string; revision_number: Long; revision_height: Long; @@ -243,16 +219,9 @@ export interface QueryConnectionConsensusStateResponse { * Query/ConnectionConsensusState RPC method */ export interface QueryConnectionConsensusStateResponseSDKType { - /** consensus state associated with the channel */ consensus_state?: AnySDKType; - - /** client ID associated with the consensus state */ client_id: string; - - /** merkle proof of existence */ proof: Uint8Array; - - /** height at which the proof was retrieved */ proof_height?: HeightSDKType; } diff --git a/__fixtures__/output1/ibc/core/connection/v1/tx.ts b/__fixtures__/output1/ibc/core/connection/v1/tx.ts index ee043edb6c..7d088b1955 100644 --- a/__fixtures__/output1/ibc/core/connection/v1/tx.ts +++ b/__fixtures__/output1/ibc/core/connection/v1/tx.ts @@ -80,28 +80,14 @@ export interface MsgConnectionOpenTry { */ export interface MsgConnectionOpenTrySDKType { client_id: string; - - /** - * in the case of crossing hello's, when both chains call OpenInit, we need - * the connection identifier of the previous connection in state INIT - */ previous_connection_id: string; client_state?: AnySDKType; counterparty?: CounterpartySDKType; delay_period: Long; counterparty_versions: VersionSDKType[]; proof_height?: HeightSDKType; - - /** - * proof of the initialization the connection on Chain A: `UNITIALIZED -> - * INIT` - */ proof_init: Uint8Array; - - /** proof of client state included in message */ proof_client: Uint8Array; - - /** proof of client consensus state */ proof_consensus: Uint8Array; consensus_height?: HeightSDKType; signer: string; @@ -149,17 +135,8 @@ export interface MsgConnectionOpenAckSDKType { version?: VersionSDKType; client_state?: AnySDKType; proof_height?: HeightSDKType; - - /** - * proof of the initialization the connection on Chain B: `UNITIALIZED -> - * TRYOPEN` - */ proof_try: Uint8Array; - - /** proof of client state included in message */ proof_client: Uint8Array; - - /** proof of client consensus state */ proof_consensus: Uint8Array; consensus_height?: HeightSDKType; signer: string; @@ -190,8 +167,6 @@ export interface MsgConnectionOpenConfirm { */ export interface MsgConnectionOpenConfirmSDKType { connection_id: string; - - /** proof for the change of the connection state on Chain A: `INIT -> OPEN` */ proof_ack: Uint8Array; proof_height?: HeightSDKType; signer: string; diff --git a/__fixtures__/output1/ibc/core/port/v1/query.ts b/__fixtures__/output1/ibc/core/port/v1/query.ts index 7ddc8847f4..e242ed87b0 100644 --- a/__fixtures__/output1/ibc/core/port/v1/query.ts +++ b/__fixtures__/output1/ibc/core/port/v1/query.ts @@ -23,19 +23,10 @@ export interface QueryAppVersionRequest { /** QueryAppVersionRequest is the request type for the Query/AppVersion RPC method */ export interface QueryAppVersionRequestSDKType { - /** port unique identifier */ port_id: string; - - /** connection unique identifier */ connection_id: string; - - /** whether the channel is ordered or unordered */ ordering: Order; - - /** counterparty channel end */ counterparty?: CounterpartySDKType; - - /** proposed version */ proposed_version: string; } @@ -50,10 +41,7 @@ export interface QueryAppVersionResponse { /** QueryAppVersionResponse is the response type for the Query/AppVersion RPC method. */ export interface QueryAppVersionResponseSDKType { - /** port id associated with the request identifiers */ port_id: string; - - /** supported app version */ version: string; } diff --git a/__fixtures__/output1/ibc/core/types/v1/genesis.ts b/__fixtures__/output1/ibc/core/types/v1/genesis.ts index 54bc1fe29a..2b2cab292c 100644 --- a/__fixtures__/output1/ibc/core/types/v1/genesis.ts +++ b/__fixtures__/output1/ibc/core/types/v1/genesis.ts @@ -22,13 +22,8 @@ export interface GenesisState { /** GenesisState defines the ibc module's genesis state. */ export interface GenesisStateSDKType { - /** ICS002 - Clients genesis state */ client_genesis?: GenesisState1SDKType; - - /** ICS003 - Connections genesis state */ connection_genesis?: GenesisState2SDKType; - - /** ICS004 - Channel genesis state */ channel_genesis?: GenesisState3SDKType; } diff --git a/__fixtures__/output1/ibc/lightclients/localhost/v1/localhost.ts b/__fixtures__/output1/ibc/lightclients/localhost/v1/localhost.ts index f5f033065b..42ebb8213c 100644 --- a/__fixtures__/output1/ibc/lightclients/localhost/v1/localhost.ts +++ b/__fixtures__/output1/ibc/lightclients/localhost/v1/localhost.ts @@ -20,10 +20,7 @@ export interface ClientState { * access to keys outside the client prefix. */ export interface ClientStateSDKType { - /** self chain ID */ chain_id: string; - - /** self latest block height */ height?: HeightSDKType; } diff --git a/__fixtures__/output1/ibc/lightclients/solomachine/v1/solomachine.ts b/__fixtures__/output1/ibc/lightclients/solomachine/v1/solomachine.ts index b38ad62ac7..0dc3a64fe8 100644 --- a/__fixtures__/output1/ibc/lightclients/solomachine/v1/solomachine.ts +++ b/__fixtures__/output1/ibc/lightclients/solomachine/v1/solomachine.ts @@ -152,17 +152,9 @@ export interface ClientState { * state and if the client is frozen. */ export interface ClientStateSDKType { - /** latest sequence of the client state */ sequence: Long; - - /** frozen sequence of the solo machine */ frozen_sequence: Long; consensus_state?: ConsensusStateSDKType; - - /** - * when set to true, will allow governance to update a solo machine client. - * The client will be unfrozen if it is frozen. - */ allow_update_after_proposal: boolean; } @@ -190,14 +182,7 @@ export interface ConsensusState { * consensus state. */ export interface ConsensusStateSDKType { - /** public key of the solo machine */ public_key?: AnySDKType; - - /** - * diversifier allows the same public key to be re-used across different solo - * machine clients (potentially on different chains) without being considered - * misbehaviour. - */ diversifier: string; timestamp: Long; } @@ -214,7 +199,6 @@ export interface Header { /** Header defines a solo machine consensus header */ export interface HeaderSDKType { - /** sequence to update solo machine public key at */ sequence: Long; timestamp: Long; signature: Uint8Array; @@ -302,11 +286,7 @@ export interface SignBytesSDKType { sequence: Long; timestamp: Long; diversifier: string; - - /** type of the data used */ data_type: DataType; - - /** marshaled data */ data: Uint8Array; } @@ -321,10 +301,7 @@ export interface HeaderData { /** HeaderData returns the SignBytes data for update verification. */ export interface HeaderDataSDKType { - /** header public key */ new_pub_key?: AnySDKType; - - /** header diversifier */ new_diversifier: string; } diff --git a/__fixtures__/output1/ibc/lightclients/solomachine/v2/solomachine.ts b/__fixtures__/output1/ibc/lightclients/solomachine/v2/solomachine.ts index 083cce126d..40180e3b3f 100644 --- a/__fixtures__/output1/ibc/lightclients/solomachine/v2/solomachine.ts +++ b/__fixtures__/output1/ibc/lightclients/solomachine/v2/solomachine.ts @@ -152,17 +152,9 @@ export interface ClientState { * state and if the client is frozen. */ export interface ClientStateSDKType { - /** latest sequence of the client state */ sequence: Long; - - /** frozen sequence of the solo machine */ is_frozen: boolean; consensus_state?: ConsensusStateSDKType; - - /** - * when set to true, will allow governance to update a solo machine client. - * The client will be unfrozen if it is frozen. - */ allow_update_after_proposal: boolean; } @@ -190,14 +182,7 @@ export interface ConsensusState { * consensus state. */ export interface ConsensusStateSDKType { - /** public key of the solo machine */ public_key?: AnySDKType; - - /** - * diversifier allows the same public key to be re-used across different solo - * machine clients (potentially on different chains) without being considered - * misbehaviour. - */ diversifier: string; timestamp: Long; } @@ -214,7 +199,6 @@ export interface Header { /** Header defines a solo machine consensus header */ export interface HeaderSDKType { - /** sequence to update solo machine public key at */ sequence: Long; timestamp: Long; signature: Uint8Array; @@ -302,11 +286,7 @@ export interface SignBytesSDKType { sequence: Long; timestamp: Long; diversifier: string; - - /** type of the data used */ data_type: DataType; - - /** marshaled data */ data: Uint8Array; } @@ -321,10 +301,7 @@ export interface HeaderData { /** HeaderData returns the SignBytes data for update verification. */ export interface HeaderDataSDKType { - /** header public key */ new_pub_key?: AnySDKType; - - /** header diversifier */ new_diversifier: string; } diff --git a/__fixtures__/output1/ibc/lightclients/tendermint/v1/tendermint.ts b/__fixtures__/output1/ibc/lightclients/tendermint/v1/tendermint.ts index 6ade5cc5a1..0e5ccd0f17 100644 --- a/__fixtures__/output1/ibc/lightclients/tendermint/v1/tendermint.ts +++ b/__fixtures__/output1/ibc/lightclients/tendermint/v1/tendermint.ts @@ -69,49 +69,14 @@ export interface ClientState { export interface ClientStateSDKType { chain_id: string; trust_level?: FractionSDKType; - - /** - * duration of the period since the LastestTimestamp during which the - * submitted headers are valid for upgrade - */ trusting_period?: DurationSDKType; - - /** duration of the staking unbonding period */ unbonding_period?: DurationSDKType; - - /** defines how much new (untrusted) header's Time can drift into the future. */ max_clock_drift?: DurationSDKType; - - /** Block height when the client was frozen due to a misbehaviour */ frozen_height?: HeightSDKType; - - /** Latest height the client was updated to */ latest_height?: HeightSDKType; - - /** Proof specifications used in verifying counterparty state */ proof_specs: ProofSpecSDKType[]; - - /** - * Path at which next upgraded client will be committed. - * Each element corresponds to the key for a single CommitmentProof in the - * chained proof. NOTE: ClientState must stored under - * `{upgradePath}/{upgradeHeight}/clientState` ConsensusState must be stored - * under `{upgradepath}/{upgradeHeight}/consensusState` For SDK chains using - * the default upgrade module, upgrade_path should be []string{"upgrade", - * "upgradedIBCState"}` - */ upgrade_path: string[]; - - /** - * This flag, when set to true, will allow governance to recover a client - * which has expired - */ allow_update_after_expiry: boolean; - - /** - * This flag, when set to true, will allow governance to unfreeze a client - * whose chain has experienced a misbehaviour event - */ allow_update_after_misbehaviour: boolean; } @@ -130,13 +95,7 @@ export interface ConsensusState { /** ConsensusState defines the consensus state from Tendermint. */ export interface ConsensusStateSDKType { - /** - * timestamp that corresponds to the block height in which the ConsensusState - * was stored. - */ timestamp?: Date; - - /** commitment root (i.e app hash) */ root?: MerkleRootSDKType; next_validators_hash: Uint8Array; } diff --git a/__fixtures__/output1/osmosis/agg-lcd.ts b/__fixtures__/output1/osmosis/agg-lcd.ts index 27c28fed57..938971492e 100644 --- a/__fixtures__/output1/osmosis/agg-lcd.ts +++ b/__fixtures__/output1/osmosis/agg-lcd.ts @@ -6,7 +6,7 @@ import { SwapAmountInRoute, SwapAmountOutRoute, SwapAmountInRouteSDKType, SwapAm import { Params, ParamsSDKType, Metadata, MetadataSDKType } from "../cosmos/bank/v1beta1/bank"; import { QueryBalanceRequest, QueryBalanceRequestSDKType, QueryBalanceResponse, QueryBalanceResponseSDKType, QueryAllBalancesRequest, QueryAllBalancesRequestSDKType, QueryAllBalancesResponse, QueryAllBalancesResponseSDKType, QuerySpendableBalancesRequest, QuerySpendableBalancesRequestSDKType, QuerySpendableBalancesResponse, QuerySpendableBalancesResponseSDKType, QueryTotalSupplyRequest, QueryTotalSupplyRequestSDKType, QueryTotalSupplyResponse, QueryTotalSupplyResponseSDKType, QuerySupplyOfRequest, QuerySupplyOfRequestSDKType, QuerySupplyOfResponse, QuerySupplyOfResponseSDKType, QueryParamsRequest, QueryParamsRequestSDKType, QueryParamsResponse, QueryParamsResponseSDKType, QueryDenomMetadataRequest, QueryDenomMetadataRequestSDKType, QueryDenomMetadataResponse, QueryDenomMetadataResponseSDKType, QueryDenomsMetadataRequest, QueryDenomsMetadataRequestSDKType, QueryDenomsMetadataResponse, QueryDenomsMetadataResponseSDKType, QueryDenomOwnersRequest, QueryDenomOwnersRequestSDKType, QueryDenomOwnersResponse, QueryDenomOwnersResponseSDKType } from "../cosmos/bank/v1beta1/query"; import { Any, AnySDKType } from "../google/protobuf/any"; -import { QueryPoolsRequest, QueryPoolsRequestSDKType, QueryPoolsResponse, QueryPoolsResponseSDKType, QueryNumPoolsRequest, QueryNumPoolsRequestSDKType, QueryNumPoolsResponse, QueryNumPoolsResponseSDKType, QueryTotalLiquidityRequest, QueryTotalLiquidityRequestSDKType, QueryTotalLiquidityResponse, QueryTotalLiquidityResponseSDKType, QueryPoolRequest, QueryPoolRequestSDKType, QueryPoolResponse, QueryPoolResponseSDKType, QueryPoolTypeRequest, QueryPoolTypeRequestSDKType, QueryPoolTypeResponse, QueryPoolTypeResponseSDKType, QueryPoolParamsRequest, QueryPoolParamsRequestSDKType, QueryPoolParamsResponse, QueryPoolParamsResponseSDKType, QueryTotalPoolLiquidityRequest, QueryTotalPoolLiquidityRequestSDKType, QueryTotalPoolLiquidityResponse, QueryTotalPoolLiquidityResponseSDKType, QueryTotalSharesRequest, QueryTotalSharesRequestSDKType, QueryTotalSharesResponse, QueryTotalSharesResponseSDKType, QuerySpotPriceRequest, QuerySpotPriceRequestSDKType, QuerySpotPriceResponse, QuerySpotPriceResponseSDKType, QuerySwapExactAmountInRequest, QuerySwapExactAmountInRequestSDKType, QuerySwapExactAmountInResponse, QuerySwapExactAmountInResponseSDKType, QuerySwapExactAmountOutRequest, QuerySwapExactAmountOutRequestSDKType, QuerySwapExactAmountOutResponse, QuerySwapExactAmountOutResponseSDKType } from "./gamm/v1beta1/query"; +import { QueryPoolsRequest, QueryPoolsRequestSDKType, QueryPoolsResponse, QueryPoolsResponseSDKType, QueryNumPoolsRequest, QueryNumPoolsRequestSDKType, QueryNumPoolsResponse, QueryNumPoolsResponseSDKType, QueryTotalLiquidityRequest, QueryTotalLiquidityRequestSDKType, QueryTotalLiquidityResponse, QueryTotalLiquidityResponseSDKType, QueryPoolsWithFilterRequest, QueryPoolsWithFilterRequestSDKType, QueryPoolsWithFilterResponse, QueryPoolsWithFilterResponseSDKType, QueryPoolRequest, QueryPoolRequestSDKType, QueryPoolResponse, QueryPoolResponseSDKType, QueryPoolTypeRequest, QueryPoolTypeRequestSDKType, QueryPoolTypeResponse, QueryPoolTypeResponseSDKType, QueryCalcJoinPoolNoSwapSharesRequest, QueryCalcJoinPoolNoSwapSharesRequestSDKType, QueryCalcJoinPoolNoSwapSharesResponse, QueryCalcJoinPoolNoSwapSharesResponseSDKType, QueryCalcJoinPoolSharesRequest, QueryCalcJoinPoolSharesRequestSDKType, QueryCalcJoinPoolSharesResponse, QueryCalcJoinPoolSharesResponseSDKType, QueryCalcExitPoolCoinsFromSharesRequest, QueryCalcExitPoolCoinsFromSharesRequestSDKType, QueryCalcExitPoolCoinsFromSharesResponse, QueryCalcExitPoolCoinsFromSharesResponseSDKType, QueryPoolParamsRequest, QueryPoolParamsRequestSDKType, QueryPoolParamsResponse, QueryPoolParamsResponseSDKType, QueryTotalPoolLiquidityRequest, QueryTotalPoolLiquidityRequestSDKType, QueryTotalPoolLiquidityResponse, QueryTotalPoolLiquidityResponseSDKType, QueryTotalSharesRequest, QueryTotalSharesRequestSDKType, QueryTotalSharesResponse, QueryTotalSharesResponseSDKType, QuerySpotPriceRequest, QuerySpotPriceRequestSDKType, QuerySpotPriceResponse, QuerySpotPriceResponseSDKType, QuerySwapExactAmountInRequest, QuerySwapExactAmountInRequestSDKType, QuerySwapExactAmountInResponse, QuerySwapExactAmountInResponseSDKType, QuerySwapExactAmountOutRequest, QuerySwapExactAmountOutRequestSDKType, QuerySwapExactAmountOutResponse, QuerySwapExactAmountOutResponseSDKType } from "./gamm/v1beta1/query"; export class QueryClient { req: LCDClient; @@ -163,6 +163,29 @@ export class QueryClient { return await this.req.get(endpoint); } + /* PoolsWithFilter allows you to query specific pools with requested + parameters */ + async poolsWithFilter(params: QueryPoolsWithFilterRequest): Promise { + const options: any = { + params: {} + }; + + if (typeof params?.minLiquidity !== "undefined") { + options.params.min_liquidity = params.minLiquidity; + } + + if (typeof params?.poolType !== "undefined") { + options.params.pool_type = params.poolType; + } + + if (typeof params?.pagination !== "undefined") { + setPaginationParams(options, params.pagination); + } + + const endpoint = `osmosis/gamm/v1beta1/filtered_pools`; + return await this.req.get(endpoint, options); + } + /* Per Pool gRPC Endpoints */ async pool(params: QueryPoolRequest): Promise { const endpoint = `osmosis/gamm/v1beta1/pools/${params.poolId}`; @@ -177,6 +200,34 @@ export class QueryClient { return await this.req.get(endpoint); } + /* CalcJoinPoolShares */ + async calcJoinPoolShares(params: QueryCalcJoinPoolSharesRequest): Promise { + const options: any = { + params: {} + }; + + if (typeof params?.tokensIn !== "undefined") { + options.params.tokens_in = params.tokensIn; + } + + const endpoint = `osmosis/gamm/v1beta1/pools/${params.poolId}/join_swap_exact_in`; + return await this.req.get(endpoint, options); + } + + /* CalcExitPoolCoinsFromShares */ + async calcExitPoolCoinsFromShares(params: QueryCalcExitPoolCoinsFromSharesRequest): Promise { + const options: any = { + params: {} + }; + + if (typeof params?.shareInAmount !== "undefined") { + options.params.share_in_amount = params.shareInAmount; + } + + const endpoint = `osmosis/gamm/v1beta1/pools/${params.poolId}/exit_swap_share_amount_in`; + return await this.req.get(endpoint, options); + } + /* PoolParams */ async poolParams(params: QueryPoolParamsRequest): Promise { const endpoint = `osmosis/gamm/v1beta1/pools/${params.poolId}/params`; diff --git a/__fixtures__/output1/osmosis/bundle.ts b/__fixtures__/output1/osmosis/bundle.ts index 7f5b11659b..48bb62dfea 100644 --- a/__fixtures__/output1/osmosis/bundle.ts +++ b/__fixtures__/output1/osmosis/bundle.ts @@ -11,113 +11,110 @@ import * as _263 from "./gamm/v1beta1/tx"; import * as _264 from "./gamm/pool-models/balancer/tx/tx"; import * as _265 from "./gamm/pool-models/stableswap/stableswap_pool"; import * as _266 from "./gamm/pool-models/stableswap/tx"; -import * as _267 from "./incentives/gauge"; -import * as _268 from "./incentives/genesis"; -import * as _269 from "./incentives/params"; -import * as _270 from "./incentives/query"; -import * as _271 from "./incentives/tx"; -import * as _272 from "./lockup/genesis"; -import * as _273 from "./lockup/lock"; -import * as _274 from "./lockup/query"; -import * as _275 from "./lockup/tx"; -import * as _276 from "./mint/v1beta1/genesis"; -import * as _277 from "./mint/v1beta1/mint"; -import * as _278 from "./mint/v1beta1/query"; -import * as _279 from "./pool-incentives/v1beta1/genesis"; -import * as _280 from "./pool-incentives/v1beta1/gov"; -import * as _281 from "./pool-incentives/v1beta1/incentives"; -import * as _282 from "./pool-incentives/v1beta1/query"; -import * as _283 from "./store/v1beta1/tree"; -import * as _284 from "./streamswap/v1/event"; -import * as _285 from "./streamswap/v1/genesis"; -import * as _286 from "./streamswap/v1/params"; -import * as _287 from "./streamswap/v1/query"; -import * as _288 from "./streamswap/v1/state"; -import * as _289 from "./streamswap/v1/tx"; -import * as _290 from "./superfluid/genesis"; -import * as _291 from "./superfluid/params"; -import * as _292 from "./superfluid/query"; -import * as _293 from "./superfluid/superfluid"; -import * as _294 from "./superfluid/tx"; -import * as _295 from "./tokenfactory/v1beta1/authorityMetadata"; -import * as _296 from "./tokenfactory/v1beta1/genesis"; -import * as _297 from "./tokenfactory/v1beta1/params"; -import * as _298 from "./tokenfactory/v1beta1/query"; -import * as _299 from "./tokenfactory/v1beta1/tx"; -import * as _300 from "./twap/v1beta1/genesis"; -import * as _301 from "./twap/v1beta1/query"; -import * as _302 from "./twap/v1beta1/twap_record"; -import * as _303 from "./txfees/v1beta1/feetoken"; -import * as _304 from "./txfees/v1beta1/genesis"; -import * as _305 from "./txfees/v1beta1/gov"; -import * as _306 from "./txfees/v1beta1/query"; -import * as _486 from "./gamm/pool-models/balancer/tx/tx.amino"; -import * as _487 from "./gamm/pool-models/stableswap/tx.amino"; -import * as _488 from "./gamm/v1beta1/tx.amino"; -import * as _489 from "./incentives/tx.amino"; -import * as _490 from "./lockup/tx.amino"; -import * as _491 from "./streamswap/v1/tx.amino"; -import * as _492 from "./superfluid/tx.amino"; -import * as _493 from "./tokenfactory/v1beta1/tx.amino"; -import * as _494 from "./gamm/pool-models/balancer/tx/tx.registry"; -import * as _495 from "./gamm/pool-models/stableswap/tx.registry"; -import * as _496 from "./gamm/v1beta1/tx.registry"; -import * as _497 from "./incentives/tx.registry"; -import * as _498 from "./lockup/tx.registry"; -import * as _499 from "./streamswap/v1/tx.registry"; -import * as _500 from "./superfluid/tx.registry"; -import * as _501 from "./tokenfactory/v1beta1/tx.registry"; -import * as _502 from "./claim/v1beta1/query.lcd"; -import * as _503 from "./epochs/query.lcd"; -import * as _504 from "./gamm/v1beta1/query.lcd"; -import * as _505 from "./incentives/query.lcd"; -import * as _506 from "./lockup/query.lcd"; -import * as _507 from "./mint/v1beta1/query.lcd"; -import * as _508 from "./pool-incentives/v1beta1/query.lcd"; -import * as _509 from "./streamswap/v1/query.lcd"; -import * as _510 from "./superfluid/query.lcd"; -import * as _511 from "./tokenfactory/v1beta1/query.lcd"; -import * as _512 from "./twap/v1beta1/query.lcd"; -import * as _513 from "./txfees/v1beta1/query.lcd"; -import * as _514 from "./claim/v1beta1/query.rpc.Query"; -import * as _515 from "./epochs/query.rpc.Query"; -import * as _516 from "./gamm/v1beta1/query.rpc.Query"; -import * as _517 from "./incentives/query.rpc.Query"; -import * as _518 from "./lockup/query.rpc.Query"; -import * as _519 from "./mint/v1beta1/query.rpc.Query"; -import * as _520 from "./pool-incentives/v1beta1/query.rpc.Query"; -import * as _521 from "./streamswap/v1/query.rpc.Query"; -import * as _522 from "./superfluid/query.rpc.Query"; -import * as _523 from "./tokenfactory/v1beta1/query.rpc.Query"; -import * as _524 from "./twap/v1beta1/query.rpc.Query"; -import * as _525 from "./txfees/v1beta1/query.rpc.Query"; -import * as _526 from "./gamm/pool-models/balancer/tx/tx.rpc.msg"; -import * as _527 from "./gamm/pool-models/stableswap/tx.rpc.msg"; -import * as _528 from "./gamm/v1beta1/tx.rpc.msg"; -import * as _529 from "./incentives/tx.rpc.msg"; -import * as _530 from "./lockup/tx.rpc.msg"; -import * as _531 from "./streamswap/v1/tx.rpc.msg"; -import * as _532 from "./superfluid/tx.rpc.msg"; -import * as _533 from "./tokenfactory/v1beta1/tx.rpc.msg"; -import * as _555 from "./lcd"; -import * as _556 from "./custom-lcd-client"; -import * as _557 from "./rpc.query"; -import * as _558 from "./rpc.tx"; +import * as _267 from "./gamm/v2/query"; +import * as _268 from "./ibc-rate-limit/v1beta1/params"; +import * as _269 from "./ibc-rate-limit/v1beta1/query"; +import * as _270 from "./incentives/gauge"; +import * as _271 from "./incentives/genesis"; +import * as _272 from "./incentives/params"; +import * as _273 from "./incentives/query"; +import * as _274 from "./incentives/tx"; +import * as _275 from "./lockup/genesis"; +import * as _276 from "./lockup/lock"; +import * as _277 from "./lockup/params"; +import * as _278 from "./lockup/query"; +import * as _279 from "./lockup/tx"; +import * as _280 from "./mint/v1beta1/genesis"; +import * as _281 from "./mint/v1beta1/mint"; +import * as _282 from "./mint/v1beta1/query"; +import * as _283 from "./pool-incentives/v1beta1/genesis"; +import * as _284 from "./pool-incentives/v1beta1/gov"; +import * as _285 from "./pool-incentives/v1beta1/incentives"; +import * as _286 from "./pool-incentives/v1beta1/query"; +import * as _287 from "./sumtree/v1beta1/tree"; +import * as _288 from "./superfluid/genesis"; +import * as _289 from "./superfluid/params"; +import * as _290 from "./superfluid/query"; +import * as _291 from "./superfluid/superfluid"; +import * as _292 from "./superfluid/tx"; +import * as _293 from "./tokenfactory/v1beta1/authorityMetadata"; +import * as _294 from "./tokenfactory/v1beta1/genesis"; +import * as _295 from "./tokenfactory/v1beta1/params"; +import * as _296 from "./tokenfactory/v1beta1/query"; +import * as _297 from "./tokenfactory/v1beta1/tx"; +import * as _298 from "./twap/v1beta1/genesis"; +import * as _299 from "./twap/v1beta1/query"; +import * as _300 from "./twap/v1beta1/twap_record"; +import * as _301 from "./txfees/v1beta1/feetoken"; +import * as _302 from "./txfees/v1beta1/genesis"; +import * as _303 from "./txfees/v1beta1/gov"; +import * as _304 from "./txfees/v1beta1/query"; +import * as _484 from "./gamm/pool-models/balancer/tx/tx.amino"; +import * as _485 from "./gamm/pool-models/stableswap/tx.amino"; +import * as _486 from "./gamm/v1beta1/tx.amino"; +import * as _487 from "./incentives/tx.amino"; +import * as _488 from "./lockup/tx.amino"; +import * as _489 from "./superfluid/tx.amino"; +import * as _490 from "./tokenfactory/v1beta1/tx.amino"; +import * as _491 from "./gamm/pool-models/balancer/tx/tx.registry"; +import * as _492 from "./gamm/pool-models/stableswap/tx.registry"; +import * as _493 from "./gamm/v1beta1/tx.registry"; +import * as _494 from "./incentives/tx.registry"; +import * as _495 from "./lockup/tx.registry"; +import * as _496 from "./superfluid/tx.registry"; +import * as _497 from "./tokenfactory/v1beta1/tx.registry"; +import * as _498 from "./claim/v1beta1/query.lcd"; +import * as _499 from "./epochs/query.lcd"; +import * as _500 from "./gamm/v1beta1/query.lcd"; +import * as _501 from "./gamm/v2/query.lcd"; +import * as _502 from "./ibc-rate-limit/v1beta1/query.lcd"; +import * as _503 from "./incentives/query.lcd"; +import * as _504 from "./lockup/query.lcd"; +import * as _505 from "./mint/v1beta1/query.lcd"; +import * as _506 from "./pool-incentives/v1beta1/query.lcd"; +import * as _507 from "./superfluid/query.lcd"; +import * as _508 from "./tokenfactory/v1beta1/query.lcd"; +import * as _509 from "./twap/v1beta1/query.lcd"; +import * as _510 from "./txfees/v1beta1/query.lcd"; +import * as _511 from "./claim/v1beta1/query.rpc.Query"; +import * as _512 from "./epochs/query.rpc.Query"; +import * as _513 from "./gamm/v1beta1/query.rpc.Query"; +import * as _514 from "./gamm/v2/query.rpc.Query"; +import * as _515 from "./ibc-rate-limit/v1beta1/query.rpc.Query"; +import * as _516 from "./incentives/query.rpc.Query"; +import * as _517 from "./lockup/query.rpc.Query"; +import * as _518 from "./mint/v1beta1/query.rpc.Query"; +import * as _519 from "./pool-incentives/v1beta1/query.rpc.Query"; +import * as _520 from "./superfluid/query.rpc.Query"; +import * as _521 from "./tokenfactory/v1beta1/query.rpc.Query"; +import * as _522 from "./twap/v1beta1/query.rpc.Query"; +import * as _523 from "./txfees/v1beta1/query.rpc.Query"; +import * as _524 from "./gamm/pool-models/balancer/tx/tx.rpc.msg"; +import * as _525 from "./gamm/pool-models/stableswap/tx.rpc.msg"; +import * as _526 from "./gamm/v1beta1/tx.rpc.msg"; +import * as _527 from "./incentives/tx.rpc.msg"; +import * as _528 from "./lockup/tx.rpc.msg"; +import * as _529 from "./superfluid/tx.rpc.msg"; +import * as _530 from "./tokenfactory/v1beta1/tx.rpc.msg"; +import * as _552 from "./lcd"; +import * as _553 from "./custom-lcd-client"; +import * as _554 from "./rpc.query"; +import * as _555 from "./rpc.tx"; export namespace osmosis { export namespace claim { export const v1beta1 = { ..._254, ..._255, ..._256, ..._257, - ..._502, - ..._514 + ..._498, + ..._511 }; } export namespace epochs { export const v1beta1 = { ..._258, ..._259, - ..._503, - ..._515 + ..._499, + ..._512 }; } export namespace gamm { @@ -125,130 +122,128 @@ export namespace osmosis { ..._261, ..._262, ..._263, - ..._488, - ..._496, - ..._504, - ..._516, - ..._528 + ..._486, + ..._493, + ..._500, + ..._513, + ..._526 }; export namespace poolmodels { export namespace balancer { export const v1beta1 = { ..._264, - ..._486, - ..._494, - ..._526 + ..._484, + ..._491, + ..._524 }; } export namespace stableswap { export const v1beta1 = { ..._265, ..._266, - ..._487, - ..._495, - ..._527 + ..._485, + ..._492, + ..._525 }; } } + export const v2 = { ..._267, + ..._501, + ..._514 + }; + } + export namespace ibcratelimit { + export const v1beta1 = { ..._268, + ..._269, + ..._502, + ..._515 + }; } - export const incentives = { ..._267, - ..._268, - ..._269, - ..._270, + export const incentives = { ..._270, ..._271, - ..._489, - ..._497, - ..._505, - ..._517, - ..._529 - }; - export const lockup = { ..._272, + ..._272, ..._273, ..._274, - ..._275, - ..._490, - ..._498, - ..._506, - ..._518, - ..._530 + ..._487, + ..._494, + ..._503, + ..._516, + ..._527 + }; + export const lockup = { ..._275, + ..._276, + ..._277, + ..._278, + ..._279, + ..._488, + ..._495, + ..._504, + ..._517, + ..._528 }; export namespace mint { - export const v1beta1 = { ..._276, - ..._277, - ..._278, - ..._507, - ..._519 - }; - } - export namespace poolincentives { - export const v1beta1 = { ..._279, - ..._280, + export const v1beta1 = { ..._280, ..._281, ..._282, - ..._508, - ..._520 + ..._505, + ..._518 }; } - export namespace store { - export const v1beta1 = { ..._283 - }; - } - export namespace streamswap { - export const v1 = { ..._284, + export namespace poolincentives { + export const v1beta1 = { ..._283, + ..._284, ..._285, ..._286, - ..._287, - ..._288, - ..._289, - ..._491, - ..._499, - ..._509, - ..._521, - ..._531 + ..._506, + ..._519 + }; + } + export namespace store { + export const v1beta1 = { ..._287 }; } - export const superfluid = { ..._290, + export const superfluid = { ..._288, + ..._289, + ..._290, ..._291, ..._292, - ..._293, - ..._294, - ..._492, - ..._500, - ..._510, - ..._522, - ..._532 + ..._489, + ..._496, + ..._507, + ..._520, + ..._529 }; export namespace tokenfactory { - export const v1beta1 = { ..._295, + export const v1beta1 = { ..._293, + ..._294, + ..._295, ..._296, ..._297, - ..._298, - ..._299, - ..._493, - ..._501, - ..._511, - ..._523, - ..._533 + ..._490, + ..._497, + ..._508, + ..._521, + ..._530 }; } export namespace twap { - export const v1beta1 = { ..._300, - ..._301, - ..._302, - ..._512, - ..._524 + export const v1beta1 = { ..._298, + ..._299, + ..._300, + ..._509, + ..._522 }; } export namespace txfees { - export const v1beta1 = { ..._303, + export const v1beta1 = { ..._301, + ..._302, + ..._303, ..._304, - ..._305, - ..._306, - ..._513, - ..._525 + ..._510, + ..._523 }; } - export const ClientFactory = { ..._555, - ..._556, - ..._557, - ..._558 + export const ClientFactory = { ..._552, + ..._553, + ..._554, + ..._555 }; } \ No newline at end of file diff --git a/__fixtures__/output1/osmosis/claim/v1beta1/claim.ts b/__fixtures__/output1/osmosis/claim/v1beta1/claim.ts index 0c0330eee8..a0c1970644 100644 --- a/__fixtures__/output1/osmosis/claim/v1beta1/claim.ts +++ b/__fixtures__/output1/osmosis/claim/v1beta1/claim.ts @@ -71,16 +71,8 @@ export interface ClaimRecord { /** A Claim Records is the metadata of claim data per address */ export interface ClaimRecordSDKType { - /** address of claim user */ address: string; - - /** total initial claimable amount for the user */ initial_claimable_amount: CoinSDKType[]; - - /** - * true if action is completed - * index of bool in array refers to action enum # - */ action_completed: boolean[]; } diff --git a/__fixtures__/output1/osmosis/claim/v1beta1/genesis.ts b/__fixtures__/output1/osmosis/claim/v1beta1/genesis.ts index c6fcb31c1d..e2004a113b 100644 --- a/__fixtures__/output1/osmosis/claim/v1beta1/genesis.ts +++ b/__fixtures__/output1/osmosis/claim/v1beta1/genesis.ts @@ -19,13 +19,8 @@ export interface GenesisState { /** GenesisState defines the claim module's genesis state. */ export interface GenesisStateSDKType { - /** balance of the claim module's account */ module_account_balance?: CoinSDKType; - - /** params defines all the parameters of the module. */ params?: ParamsSDKType; - - /** list of claim records, one for every airdrop recipient */ claim_records: ClaimRecordSDKType[]; } diff --git a/__fixtures__/output1/osmosis/claim/v1beta1/params.ts b/__fixtures__/output1/osmosis/claim/v1beta1/params.ts index 5468185b23..abef0679e3 100644 --- a/__fixtures__/output1/osmosis/claim/v1beta1/params.ts +++ b/__fixtures__/output1/osmosis/claim/v1beta1/params.ts @@ -19,8 +19,6 @@ export interface ParamsSDKType { airdrop_start_time?: Date; duration_until_decay?: DurationSDKType; duration_of_decay?: DurationSDKType; - - /** denom of claimable asset */ claim_denom: string; } diff --git a/__fixtures__/output1/osmosis/claim/v1beta1/query.ts b/__fixtures__/output1/osmosis/claim/v1beta1/query.ts index fae8b8e122..f05a15b762 100644 --- a/__fixtures__/output1/osmosis/claim/v1beta1/query.ts +++ b/__fixtures__/output1/osmosis/claim/v1beta1/query.ts @@ -19,7 +19,6 @@ export interface QueryModuleAccountBalanceResponse { /** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryModuleAccountBalanceResponseSDKType { - /** params defines the parameters of the module. */ moduleAccountBalance: CoinSDKType[]; } @@ -37,7 +36,6 @@ export interface QueryParamsResponse { /** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponseSDKType { - /** params defines the parameters of the module. */ params?: ParamsSDKType; } export interface QueryClaimRecordRequest { diff --git a/__fixtures__/output1/osmosis/client.ts b/__fixtures__/output1/osmosis/client.ts index 0e3cc780bc..4648529a1d 100644 --- a/__fixtures__/output1/osmosis/client.ts +++ b/__fixtures__/output1/osmosis/client.ts @@ -6,7 +6,6 @@ import * as osmosisGammPoolmodelsStableswapTxRegistry from "./gamm/pool-models/s import * as osmosisGammV1beta1TxRegistry from "./gamm/v1beta1/tx.registry"; import * as osmosisIncentivesTxRegistry from "./incentives/tx.registry"; import * as osmosisLockupTxRegistry from "./lockup/tx.registry"; -import * as osmosisStreamswapV1TxRegistry from "./streamswap/v1/tx.registry"; import * as osmosisSuperfluidTxRegistry from "./superfluid/tx.registry"; import * as osmosisTokenfactoryV1beta1TxRegistry from "./tokenfactory/v1beta1/tx.registry"; import * as osmosisGammPoolmodelsBalancerTxTxAmino from "./gamm/pool-models/balancer/tx/tx.amino"; @@ -14,7 +13,6 @@ import * as osmosisGammPoolmodelsStableswapTxAmino from "./gamm/pool-models/stab import * as osmosisGammV1beta1TxAmino from "./gamm/v1beta1/tx.amino"; import * as osmosisIncentivesTxAmino from "./incentives/tx.amino"; import * as osmosisLockupTxAmino from "./lockup/tx.amino"; -import * as osmosisStreamswapV1TxAmino from "./streamswap/v1/tx.amino"; import * as osmosisSuperfluidTxAmino from "./superfluid/tx.amino"; import * as osmosisTokenfactoryV1beta1TxAmino from "./tokenfactory/v1beta1/tx.amino"; export const osmosisAminoConverters = { ...osmosisGammPoolmodelsBalancerTxTxAmino.AminoConverter, @@ -22,11 +20,10 @@ export const osmosisAminoConverters = { ...osmosisGammPoolmodelsBalancerTxTxAmin ...osmosisGammV1beta1TxAmino.AminoConverter, ...osmosisIncentivesTxAmino.AminoConverter, ...osmosisLockupTxAmino.AminoConverter, - ...osmosisStreamswapV1TxAmino.AminoConverter, ...osmosisSuperfluidTxAmino.AminoConverter, ...osmosisTokenfactoryV1beta1TxAmino.AminoConverter }; -export const osmosisProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...osmosisGammPoolmodelsBalancerTxTxRegistry.registry, ...osmosisGammPoolmodelsStableswapTxRegistry.registry, ...osmosisGammV1beta1TxRegistry.registry, ...osmosisIncentivesTxRegistry.registry, ...osmosisLockupTxRegistry.registry, ...osmosisStreamswapV1TxRegistry.registry, ...osmosisSuperfluidTxRegistry.registry, ...osmosisTokenfactoryV1beta1TxRegistry.registry]; +export const osmosisProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [...osmosisGammPoolmodelsBalancerTxTxRegistry.registry, ...osmosisGammPoolmodelsStableswapTxRegistry.registry, ...osmosisGammV1beta1TxRegistry.registry, ...osmosisIncentivesTxRegistry.registry, ...osmosisLockupTxRegistry.registry, ...osmosisSuperfluidTxRegistry.registry, ...osmosisTokenfactoryV1beta1TxRegistry.registry]; export const getSigningOsmosisClientOptions = ({ defaultTypes = defaultRegistryTypes }: { diff --git a/__fixtures__/output1/osmosis/epochs/genesis.ts b/__fixtures__/output1/osmosis/epochs/genesis.ts index 65e8a1b42b..a9c19e10f4 100644 --- a/__fixtures__/output1/osmosis/epochs/genesis.ts +++ b/__fixtures__/output1/osmosis/epochs/genesis.ts @@ -74,63 +74,12 @@ export interface EpochInfo { * a timer defined by the x/epochs module. */ export interface EpochInfoSDKType { - /** identifier is a unique reference to this particular timer. */ identifier: string; - - /** - * start_time is the time at which the timer first ever ticks. - * If start_time is in the future, the epoch will not begin until the start - * time. - */ start_time?: Date; - - /** - * duration is the time in between epoch ticks. - * In order for intended behavior to be met, duration should - * be greater than the chains expected block time. - * Duration must be non-zero. - */ duration?: DurationSDKType; - - /** - * current_epoch is the current epoch number, or in other words, - * how many times has the timer 'ticked'. - * The first tick (current_epoch=1) is defined as - * the first block whose blocktime is greater than the EpochInfo start_time. - */ current_epoch: Long; - - /** - * current_epoch_start_time describes the start time of the current timer - * interval. The interval is (current_epoch_start_time, - * current_epoch_start_time + duration] When the timer ticks, this is set to - * current_epoch_start_time = last_epoch_start_time + duration only one timer - * tick for a given identifier can occur per block. - * - * NOTE! The current_epoch_start_time may diverge significantly from the - * wall-clock time the epoch began at. Wall-clock time of epoch start may be - * >> current_epoch_start_time. Suppose current_epoch_start_time = 10, - * duration = 5. Suppose the chain goes offline at t=14, and comes back online - * at t=30, and produces blocks at every successive time. (t=31, 32, etc.) - * * The t=30 block will start the epoch for (10, 15] - * * The t=31 block will start the epoch for (15, 20] - * * The t=32 block will start the epoch for (20, 25] - * * The t=33 block will start the epoch for (25, 30] - * * The t=34 block will start the epoch for (30, 35] - * * The **t=36** block will start the epoch for (35, 40] - */ current_epoch_start_time?: Date; - - /** - * epoch_counting_started is a boolean, that indicates whether this - * epoch timer has began yet. - */ epoch_counting_started: boolean; - - /** - * current_epoch_start_height is the block height at which the current epoch - * started. (The block height at which the timer last ticked) - */ current_epoch_start_height: Long; } diff --git a/__fixtures__/output1/osmosis/gamm/pool-models/balancer/balancerPool.ts b/__fixtures__/output1/osmosis/gamm/pool-models/balancer/balancerPool.ts index 890a2bcbae..a1df1bf6c1 100644 --- a/__fixtures__/output1/osmosis/gamm/pool-models/balancer/balancerPool.ts +++ b/__fixtures__/output1/osmosis/gamm/pool-models/balancer/balancerPool.ts @@ -61,31 +61,9 @@ export interface SmoothWeightChangeParams { * t > start_time + duration: w(t) = target_pool_weights */ export interface SmoothWeightChangeParamsSDKType { - /** - * The start time for beginning the weight change. - * If a parameter change / pool instantiation leaves this blank, - * it should be generated by the state_machine as the current time. - */ start_time?: Date; - - /** Duration for the weights to change over */ duration?: DurationSDKType; - - /** - * The initial pool weights. These are copied from the pool's settings - * at the time of weight change instantiation. - * The amount PoolAsset.token.amount field is ignored if present, - * future type refactorings should just have a type with the denom & weight - * here. - */ initial_pool_weights: PoolAssetSDKType[]; - - /** - * The target pool weights. The pool weights will change linearly with respect - * to time between start_time, and start_time + duration. The amount - * PoolAsset.token.amount field is ignored if present, future type - * refactorings should just have a type with the denom & weight here. - */ target_pool_weights: PoolAssetSDKType[]; } @@ -137,13 +115,7 @@ export interface PoolAsset { * and should be revisited in a future state migration. */ export interface PoolAssetSDKType { - /** - * Coins we are talking about, - * the denomination must be unique amongst all PoolAssets for this pool. - */ token?: CoinSDKType; - - /** Weight that is not normalized. This weight must be less than 2^50 */ weight: string; } export interface Pool { @@ -180,30 +152,9 @@ export interface PoolSDKType { address: string; id: Long; pool_params?: PoolParamsSDKType; - - /** - * This string specifies who will govern the pool in the future. - * Valid forms of this are: - * {token name},{duration} - * {duration} - * where {token name} if specified is the token which determines the - * governor, and if not specified is the LP token for this pool.duration is - * a time specified as 0w,1w,2w, etc. which specifies how long the token - * would need to be locked up to count in governance. 0w means no lockup. - * TODO: Further improve these docs - */ future_pool_governor: string; - - /** sum of all LP tokens sent out */ total_shares?: CoinSDKType; - - /** - * These are assumed to be sorted by denomiation. - * They contain the pool asset and the information about the weight - */ pool_assets: PoolAssetSDKType[]; - - /** sum of all non-normalized pool weights */ total_weight: string; } diff --git a/__fixtures__/output1/osmosis/gamm/pool-models/stableswap/stableswap_pool.ts b/__fixtures__/output1/osmosis/gamm/pool-models/stableswap/stableswap_pool.ts index ddad9cce6e..98f8c9d8a9 100644 --- a/__fixtures__/output1/osmosis/gamm/pool-models/stableswap/stableswap_pool.ts +++ b/__fixtures__/output1/osmosis/gamm/pool-models/stableswap/stableswap_pool.ts @@ -50,10 +50,10 @@ export interface Pool { poolLiquidity: Coin[]; /** for calculation amognst assets with different precisions */ - scalingFactor: Long[]; + scalingFactors: Long[]; - /** scaling_factor_governor is the address can adjust pool scaling factors */ - scalingFactorGovernor: string; + /** scaling_factor_controller is the address can adjust pool scaling factors */ + scalingFactorController: string; } /** Pool is the stableswap Pool struct */ @@ -61,30 +61,11 @@ export interface PoolSDKType { address: string; id: Long; pool_params?: PoolParamsSDKType; - - /** - * This string specifies who will govern the pool in the future. - * Valid forms of this are: - * {token name},{duration} - * {duration} - * where {token name} if specified is the token which determines the - * governor, and if not specified is the LP token for this pool.duration is - * a time specified as 0w,1w,2w, etc. which specifies how long the token - * would need to be locked up to count in governance. 0w means no lockup. - */ future_pool_governor: string; - - /** sum of all LP shares */ total_shares?: CoinSDKType; - - /** assets in the pool */ pool_liquidity: CoinSDKType[]; - - /** for calculation amognst assets with different precisions */ - scaling_factor: Long[]; - - /** scaling_factor_governor is the address can adjust pool scaling factors */ - scaling_factor_governor: string; + scaling_factors: Long[]; + scaling_factor_controller: string; } function createBasePoolParams(): PoolParams { @@ -178,8 +159,8 @@ function createBasePool(): Pool { futurePoolGovernor: "", totalShares: undefined, poolLiquidity: [], - scalingFactor: [], - scalingFactorGovernor: "" + scalingFactors: [], + scalingFactorController: "" }; } @@ -211,14 +192,14 @@ export const Pool = { writer.uint32(58).fork(); - for (const v of message.scalingFactor) { + for (const v of message.scalingFactors) { writer.uint64(v); } writer.ldelim(); - if (message.scalingFactorGovernor !== "") { - writer.uint32(66).string(message.scalingFactorGovernor); + if (message.scalingFactorController !== "") { + writer.uint32(66).string(message.scalingFactorController); } return writer; @@ -262,16 +243,16 @@ export const Pool = { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.scalingFactor.push((reader.uint64() as Long)); + message.scalingFactors.push((reader.uint64() as Long)); } } else { - message.scalingFactor.push((reader.uint64() as Long)); + message.scalingFactors.push((reader.uint64() as Long)); } break; case 8: - message.scalingFactorGovernor = reader.string(); + message.scalingFactorController = reader.string(); break; default: @@ -291,8 +272,8 @@ export const Pool = { futurePoolGovernor: isSet(object.futurePoolGovernor) ? String(object.futurePoolGovernor) : "", totalShares: isSet(object.totalShares) ? Coin.fromJSON(object.totalShares) : undefined, poolLiquidity: Array.isArray(object?.poolLiquidity) ? object.poolLiquidity.map((e: any) => Coin.fromJSON(e)) : [], - scalingFactor: Array.isArray(object?.scalingFactor) ? object.scalingFactor.map((e: any) => Long.fromValue(e)) : [], - scalingFactorGovernor: isSet(object.scalingFactorGovernor) ? String(object.scalingFactorGovernor) : "" + scalingFactors: Array.isArray(object?.scalingFactors) ? object.scalingFactors.map((e: any) => Long.fromValue(e)) : [], + scalingFactorController: isSet(object.scalingFactorController) ? String(object.scalingFactorController) : "" }; }, @@ -310,13 +291,13 @@ export const Pool = { obj.poolLiquidity = []; } - if (message.scalingFactor) { - obj.scalingFactor = message.scalingFactor.map(e => (e || Long.UZERO).toString()); + if (message.scalingFactors) { + obj.scalingFactors = message.scalingFactors.map(e => (e || Long.UZERO).toString()); } else { - obj.scalingFactor = []; + obj.scalingFactors = []; } - message.scalingFactorGovernor !== undefined && (obj.scalingFactorGovernor = message.scalingFactorGovernor); + message.scalingFactorController !== undefined && (obj.scalingFactorController = message.scalingFactorController); return obj; }, @@ -328,8 +309,8 @@ export const Pool = { message.futurePoolGovernor = object.futurePoolGovernor ?? ""; message.totalShares = object.totalShares !== undefined && object.totalShares !== null ? Coin.fromPartial(object.totalShares) : undefined; message.poolLiquidity = object.poolLiquidity?.map(e => Coin.fromPartial(e)) || []; - message.scalingFactor = object.scalingFactor?.map(e => Long.fromValue(e)) || []; - message.scalingFactorGovernor = object.scalingFactorGovernor ?? ""; + message.scalingFactors = object.scalingFactors?.map(e => Long.fromValue(e)) || []; + message.scalingFactorController = object.scalingFactorController ?? ""; return message; }, @@ -341,8 +322,8 @@ export const Pool = { futurePoolGovernor: object?.future_pool_governor, totalShares: object.total_shares ? Coin.fromSDK(object.total_shares) : undefined, poolLiquidity: Array.isArray(object?.pool_liquidity) ? object.pool_liquidity.map((e: any) => Coin.fromSDK(e)) : [], - scalingFactor: Array.isArray(object?.scaling_factor) ? object.scaling_factor.map((e: any) => e) : [], - scalingFactorGovernor: object?.scaling_factor_governor + scalingFactors: Array.isArray(object?.scaling_factors) ? object.scaling_factors.map((e: any) => e) : [], + scalingFactorController: object?.scaling_factor_controller }; }, @@ -360,13 +341,13 @@ export const Pool = { obj.pool_liquidity = []; } - if (message.scalingFactor) { - obj.scaling_factor = message.scalingFactor.map(e => e); + if (message.scalingFactors) { + obj.scaling_factors = message.scalingFactors.map(e => e); } else { - obj.scaling_factor = []; + obj.scaling_factors = []; } - obj.scaling_factor_governor = message.scalingFactorGovernor; + obj.scaling_factor_controller = message.scalingFactorController; return obj; } diff --git a/__fixtures__/output1/osmosis/gamm/pool-models/stableswap/tx.amino.ts b/__fixtures__/output1/osmosis/gamm/pool-models/stableswap/tx.amino.ts index 105728b66c..1a884146a8 100644 --- a/__fixtures__/output1/osmosis/gamm/pool-models/stableswap/tx.amino.ts +++ b/__fixtures__/output1/osmosis/gamm/pool-models/stableswap/tx.amino.ts @@ -18,6 +18,7 @@ export interface AminoMsgCreateStableswapPool extends AminoMsg { }[]; scaling_factors: string[]; future_pool_governor: string; + scaling_factor_controller: string; }; } export interface AminoMsgStableSwapAdjustScalingFactors extends AminoMsg { @@ -36,7 +37,8 @@ export const AminoConverter = { poolParams, initialPoolLiquidity, scalingFactors, - futurePoolGovernor + futurePoolGovernor, + scalingFactorController }: MsgCreateStableswapPool): AminoMsgCreateStableswapPool["value"] => { return { sender, @@ -49,7 +51,8 @@ export const AminoConverter = { amount: el0.amount })), scaling_factors: scalingFactors.map(el0 => el0.toString()), - future_pool_governor: futurePoolGovernor + future_pool_governor: futurePoolGovernor, + scaling_factor_controller: scalingFactorController }; }, fromAmino: ({ @@ -57,7 +60,8 @@ export const AminoConverter = { pool_params, initial_pool_liquidity, scaling_factors, - future_pool_governor + future_pool_governor, + scaling_factor_controller }: AminoMsgCreateStableswapPool["value"]): MsgCreateStableswapPool => { return { sender, @@ -70,7 +74,8 @@ export const AminoConverter = { amount: el0.amount })), scalingFactors: scaling_factors.map(el0 => Long.fromString(el0)), - futurePoolGovernor: future_pool_governor + futurePoolGovernor: future_pool_governor, + scalingFactorController: scaling_factor_controller }; } }, diff --git a/__fixtures__/output1/osmosis/gamm/pool-models/stableswap/tx.ts b/__fixtures__/output1/osmosis/gamm/pool-models/stableswap/tx.ts index cd31cfa5ba..0871d65129 100644 --- a/__fixtures__/output1/osmosis/gamm/pool-models/stableswap/tx.ts +++ b/__fixtures__/output1/osmosis/gamm/pool-models/stableswap/tx.ts @@ -11,6 +11,7 @@ export interface MsgCreateStableswapPool { initialPoolLiquidity: Coin[]; scalingFactors: Long[]; futurePoolGovernor: string; + scalingFactorController: string; } /** ===================== MsgCreatePool */ @@ -20,6 +21,7 @@ export interface MsgCreateStableswapPoolSDKType { initial_pool_liquidity: CoinSDKType[]; scaling_factors: Long[]; future_pool_governor: string; + scaling_factor_controller: string; } /** Returns a poolID with custom poolName. */ @@ -60,7 +62,8 @@ function createBaseMsgCreateStableswapPool(): MsgCreateStableswapPool { poolParams: undefined, initialPoolLiquidity: [], scalingFactors: [], - futurePoolGovernor: "" + futurePoolGovernor: "", + scalingFactorController: "" }; } @@ -90,6 +93,10 @@ export const MsgCreateStableswapPool = { writer.uint32(42).string(message.futurePoolGovernor); } + if (message.scalingFactorController !== "") { + writer.uint32(50).string(message.scalingFactorController); + } + return writer; }, @@ -131,6 +138,10 @@ export const MsgCreateStableswapPool = { message.futurePoolGovernor = reader.string(); break; + case 6: + message.scalingFactorController = reader.string(); + break; + default: reader.skipType(tag & 7); break; @@ -146,7 +157,8 @@ export const MsgCreateStableswapPool = { poolParams: isSet(object.poolParams) ? PoolParams.fromJSON(object.poolParams) : undefined, initialPoolLiquidity: Array.isArray(object?.initialPoolLiquidity) ? object.initialPoolLiquidity.map((e: any) => Coin.fromJSON(e)) : [], scalingFactors: Array.isArray(object?.scalingFactors) ? object.scalingFactors.map((e: any) => Long.fromValue(e)) : [], - futurePoolGovernor: isSet(object.futurePoolGovernor) ? String(object.futurePoolGovernor) : "" + futurePoolGovernor: isSet(object.futurePoolGovernor) ? String(object.futurePoolGovernor) : "", + scalingFactorController: isSet(object.scalingFactorController) ? String(object.scalingFactorController) : "" }; }, @@ -168,6 +180,7 @@ export const MsgCreateStableswapPool = { } message.futurePoolGovernor !== undefined && (obj.futurePoolGovernor = message.futurePoolGovernor); + message.scalingFactorController !== undefined && (obj.scalingFactorController = message.scalingFactorController); return obj; }, @@ -178,6 +191,7 @@ export const MsgCreateStableswapPool = { message.initialPoolLiquidity = object.initialPoolLiquidity?.map(e => Coin.fromPartial(e)) || []; message.scalingFactors = object.scalingFactors?.map(e => Long.fromValue(e)) || []; message.futurePoolGovernor = object.futurePoolGovernor ?? ""; + message.scalingFactorController = object.scalingFactorController ?? ""; return message; }, @@ -187,7 +201,8 @@ export const MsgCreateStableswapPool = { poolParams: object.pool_params ? PoolParams.fromSDK(object.pool_params) : undefined, initialPoolLiquidity: Array.isArray(object?.initial_pool_liquidity) ? object.initial_pool_liquidity.map((e: any) => Coin.fromSDK(e)) : [], scalingFactors: Array.isArray(object?.scaling_factors) ? object.scaling_factors.map((e: any) => e) : [], - futurePoolGovernor: object?.future_pool_governor + futurePoolGovernor: object?.future_pool_governor, + scalingFactorController: object?.scaling_factor_controller }; }, @@ -209,6 +224,7 @@ export const MsgCreateStableswapPool = { } obj.future_pool_governor = message.futurePoolGovernor; + obj.scaling_factor_controller = message.scalingFactorController; return obj; } diff --git a/__fixtures__/output1/osmosis/gamm/v1beta1/genesis.ts b/__fixtures__/output1/osmosis/gamm/v1beta1/genesis.ts index a98c9715d1..62cc9a0352 100644 --- a/__fixtures__/output1/osmosis/gamm/v1beta1/genesis.ts +++ b/__fixtures__/output1/osmosis/gamm/v1beta1/genesis.ts @@ -26,8 +26,6 @@ export interface GenesisState { /** GenesisState defines the gamm module's genesis state. */ export interface GenesisStateSDKType { pools: AnySDKType[]; - - /** will be renamed to next_pool_id in an upcoming version */ next_pool_number: Long; params?: ParamsSDKType; } diff --git a/__fixtures__/output1/osmosis/gamm/v1beta1/query.lcd.ts b/__fixtures__/output1/osmosis/gamm/v1beta1/query.lcd.ts index e9c37a6e79..0828563d03 100644 --- a/__fixtures__/output1/osmosis/gamm/v1beta1/query.lcd.ts +++ b/__fixtures__/output1/osmosis/gamm/v1beta1/query.lcd.ts @@ -1,10 +1,10 @@ import { PageRequest, PageRequestSDKType, PageResponse, PageResponseSDKType } from "../../../cosmos/base/query/v1beta1/pagination"; +import { Coin, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; import { SwapAmountInRoute, SwapAmountInRouteSDKType, SwapAmountOutRoute, SwapAmountOutRouteSDKType } from "./tx"; import { Any, AnySDKType } from "../../../google/protobuf/any"; -import { Coin, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; import { setPaginationParams } from "../../../helpers"; import { LCDClient } from "@osmonauts/lcd"; -import { QueryPoolsRequest, QueryPoolsRequestSDKType, QueryPoolsResponse, QueryPoolsResponseSDKType, QueryNumPoolsRequest, QueryNumPoolsRequestSDKType, QueryNumPoolsResponse, QueryNumPoolsResponseSDKType, QueryTotalLiquidityRequest, QueryTotalLiquidityRequestSDKType, QueryTotalLiquidityResponse, QueryTotalLiquidityResponseSDKType, QueryPoolRequest, QueryPoolRequestSDKType, QueryPoolResponse, QueryPoolResponseSDKType, QueryPoolTypeRequest, QueryPoolTypeRequestSDKType, QueryPoolTypeResponse, QueryPoolTypeResponseSDKType, QueryPoolParamsRequest, QueryPoolParamsRequestSDKType, QueryPoolParamsResponse, QueryPoolParamsResponseSDKType, QueryTotalPoolLiquidityRequest, QueryTotalPoolLiquidityRequestSDKType, QueryTotalPoolLiquidityResponse, QueryTotalPoolLiquidityResponseSDKType, QueryTotalSharesRequest, QueryTotalSharesRequestSDKType, QueryTotalSharesResponse, QueryTotalSharesResponseSDKType, QuerySpotPriceRequest, QuerySpotPriceRequestSDKType, QuerySpotPriceResponse, QuerySpotPriceResponseSDKType, QuerySwapExactAmountInRequest, QuerySwapExactAmountInRequestSDKType, QuerySwapExactAmountInResponse, QuerySwapExactAmountInResponseSDKType, QuerySwapExactAmountOutRequest, QuerySwapExactAmountOutRequestSDKType, QuerySwapExactAmountOutResponse, QuerySwapExactAmountOutResponseSDKType } from "./query"; +import { QueryPoolsRequest, QueryPoolsRequestSDKType, QueryPoolsResponse, QueryPoolsResponseSDKType, QueryNumPoolsRequest, QueryNumPoolsRequestSDKType, QueryNumPoolsResponse, QueryNumPoolsResponseSDKType, QueryTotalLiquidityRequest, QueryTotalLiquidityRequestSDKType, QueryTotalLiquidityResponse, QueryTotalLiquidityResponseSDKType, QueryPoolsWithFilterRequest, QueryPoolsWithFilterRequestSDKType, QueryPoolsWithFilterResponse, QueryPoolsWithFilterResponseSDKType, QueryPoolRequest, QueryPoolRequestSDKType, QueryPoolResponse, QueryPoolResponseSDKType, QueryPoolTypeRequest, QueryPoolTypeRequestSDKType, QueryPoolTypeResponse, QueryPoolTypeResponseSDKType, QueryCalcJoinPoolNoSwapSharesRequest, QueryCalcJoinPoolNoSwapSharesRequestSDKType, QueryCalcJoinPoolNoSwapSharesResponse, QueryCalcJoinPoolNoSwapSharesResponseSDKType, QueryCalcJoinPoolSharesRequest, QueryCalcJoinPoolSharesRequestSDKType, QueryCalcJoinPoolSharesResponse, QueryCalcJoinPoolSharesResponseSDKType, QueryCalcExitPoolCoinsFromSharesRequest, QueryCalcExitPoolCoinsFromSharesRequestSDKType, QueryCalcExitPoolCoinsFromSharesResponse, QueryCalcExitPoolCoinsFromSharesResponseSDKType, QueryPoolParamsRequest, QueryPoolParamsRequestSDKType, QueryPoolParamsResponse, QueryPoolParamsResponseSDKType, QueryTotalPoolLiquidityRequest, QueryTotalPoolLiquidityRequestSDKType, QueryTotalPoolLiquidityResponse, QueryTotalPoolLiquidityResponseSDKType, QueryTotalSharesRequest, QueryTotalSharesRequestSDKType, QueryTotalSharesResponse, QueryTotalSharesResponseSDKType, QuerySpotPriceRequest, QuerySpotPriceRequestSDKType, QuerySpotPriceResponse, QuerySpotPriceResponseSDKType, QuerySwapExactAmountInRequest, QuerySwapExactAmountInRequestSDKType, QuerySwapExactAmountInResponse, QuerySwapExactAmountInResponseSDKType, QuerySwapExactAmountOutRequest, QuerySwapExactAmountOutRequestSDKType, QuerySwapExactAmountOutResponse, QuerySwapExactAmountOutResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; @@ -17,8 +17,11 @@ export class LCDQueryClient { this.pools = this.pools.bind(this); this.numPools = this.numPools.bind(this); this.totalLiquidity = this.totalLiquidity.bind(this); + this.poolsWithFilter = this.poolsWithFilter.bind(this); this.pool = this.pool.bind(this); this.poolType = this.poolType.bind(this); + this.calcJoinPoolShares = this.calcJoinPoolShares.bind(this); + this.calcExitPoolCoinsFromShares = this.calcExitPoolCoinsFromShares.bind(this); this.poolParams = this.poolParams.bind(this); this.totalPoolLiquidity = this.totalPoolLiquidity.bind(this); this.totalShares = this.totalShares.bind(this); @@ -55,6 +58,29 @@ export class LCDQueryClient { return await this.req.get(endpoint); } + /* PoolsWithFilter allows you to query specific pools with requested + parameters */ + async poolsWithFilter(params: QueryPoolsWithFilterRequest): Promise { + const options: any = { + params: {} + }; + + if (typeof params?.minLiquidity !== "undefined") { + options.params.min_liquidity = params.minLiquidity; + } + + if (typeof params?.poolType !== "undefined") { + options.params.pool_type = params.poolType; + } + + if (typeof params?.pagination !== "undefined") { + setPaginationParams(options, params.pagination); + } + + const endpoint = `osmosis/gamm/v1beta1/filtered_pools`; + return await this.req.get(endpoint, options); + } + /* Per Pool gRPC Endpoints */ async pool(params: QueryPoolRequest): Promise { const endpoint = `osmosis/gamm/v1beta1/pools/${params.poolId}`; @@ -69,6 +95,34 @@ export class LCDQueryClient { return await this.req.get(endpoint); } + /* CalcJoinPoolShares */ + async calcJoinPoolShares(params: QueryCalcJoinPoolSharesRequest): Promise { + const options: any = { + params: {} + }; + + if (typeof params?.tokensIn !== "undefined") { + options.params.tokens_in = params.tokensIn; + } + + const endpoint = `osmosis/gamm/v1beta1/pools/${params.poolId}/join_swap_exact_in`; + return await this.req.get(endpoint, options); + } + + /* CalcExitPoolCoinsFromShares */ + async calcExitPoolCoinsFromShares(params: QueryCalcExitPoolCoinsFromSharesRequest): Promise { + const options: any = { + params: {} + }; + + if (typeof params?.shareInAmount !== "undefined") { + options.params.share_in_amount = params.shareInAmount; + } + + const endpoint = `osmosis/gamm/v1beta1/pools/${params.poolId}/exit_swap_share_amount_in`; + return await this.req.get(endpoint, options); + } + /* PoolParams */ async poolParams(params: QueryPoolParamsRequest): Promise { const endpoint = `osmosis/gamm/v1beta1/pools/${params.poolId}/params`; diff --git a/__fixtures__/output1/osmosis/gamm/v1beta1/query.rpc.Query.ts b/__fixtures__/output1/osmosis/gamm/v1beta1/query.rpc.Query.ts index 259ed999b1..393550e083 100644 --- a/__fixtures__/output1/osmosis/gamm/v1beta1/query.rpc.Query.ts +++ b/__fixtures__/output1/osmosis/gamm/v1beta1/query.rpc.Query.ts @@ -1,18 +1,24 @@ import { PageRequest, PageRequestSDKType, PageResponse, PageResponseSDKType } from "../../../cosmos/base/query/v1beta1/pagination"; +import { Coin, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; import { SwapAmountInRoute, SwapAmountInRouteSDKType, SwapAmountOutRoute, SwapAmountOutRouteSDKType } from "./tx"; import { Any, AnySDKType } from "../../../google/protobuf/any"; -import { Coin, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; import { Rpc } from "../../../helpers"; import * as _m0 from "protobufjs/minimal"; import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; import { ReactQueryParams } from "../../../react-query"; import { useQuery } from "@tanstack/react-query"; -import { QueryPoolsRequest, QueryPoolsRequestSDKType, QueryPoolsResponse, QueryPoolsResponseSDKType, QueryNumPoolsRequest, QueryNumPoolsRequestSDKType, QueryNumPoolsResponse, QueryNumPoolsResponseSDKType, QueryTotalLiquidityRequest, QueryTotalLiquidityRequestSDKType, QueryTotalLiquidityResponse, QueryTotalLiquidityResponseSDKType, QueryPoolRequest, QueryPoolRequestSDKType, QueryPoolResponse, QueryPoolResponseSDKType, QueryPoolTypeRequest, QueryPoolTypeRequestSDKType, QueryPoolTypeResponse, QueryPoolTypeResponseSDKType, QueryPoolParamsRequest, QueryPoolParamsRequestSDKType, QueryPoolParamsResponse, QueryPoolParamsResponseSDKType, QueryTotalPoolLiquidityRequest, QueryTotalPoolLiquidityRequestSDKType, QueryTotalPoolLiquidityResponse, QueryTotalPoolLiquidityResponseSDKType, QueryTotalSharesRequest, QueryTotalSharesRequestSDKType, QueryTotalSharesResponse, QueryTotalSharesResponseSDKType, QuerySpotPriceRequest, QuerySpotPriceRequestSDKType, QuerySpotPriceResponse, QuerySpotPriceResponseSDKType, QuerySwapExactAmountInRequest, QuerySwapExactAmountInRequestSDKType, QuerySwapExactAmountInResponse, QuerySwapExactAmountInResponseSDKType, QuerySwapExactAmountOutRequest, QuerySwapExactAmountOutRequestSDKType, QuerySwapExactAmountOutResponse, QuerySwapExactAmountOutResponseSDKType } from "./query"; +import { QueryPoolsRequest, QueryPoolsRequestSDKType, QueryPoolsResponse, QueryPoolsResponseSDKType, QueryNumPoolsRequest, QueryNumPoolsRequestSDKType, QueryNumPoolsResponse, QueryNumPoolsResponseSDKType, QueryTotalLiquidityRequest, QueryTotalLiquidityRequestSDKType, QueryTotalLiquidityResponse, QueryTotalLiquidityResponseSDKType, QueryPoolsWithFilterRequest, QueryPoolsWithFilterRequestSDKType, QueryPoolsWithFilterResponse, QueryPoolsWithFilterResponseSDKType, QueryPoolRequest, QueryPoolRequestSDKType, QueryPoolResponse, QueryPoolResponseSDKType, QueryPoolTypeRequest, QueryPoolTypeRequestSDKType, QueryPoolTypeResponse, QueryPoolTypeResponseSDKType, QueryCalcJoinPoolNoSwapSharesRequest, QueryCalcJoinPoolNoSwapSharesRequestSDKType, QueryCalcJoinPoolNoSwapSharesResponse, QueryCalcJoinPoolNoSwapSharesResponseSDKType, QueryCalcJoinPoolSharesRequest, QueryCalcJoinPoolSharesRequestSDKType, QueryCalcJoinPoolSharesResponse, QueryCalcJoinPoolSharesResponseSDKType, QueryCalcExitPoolCoinsFromSharesRequest, QueryCalcExitPoolCoinsFromSharesRequestSDKType, QueryCalcExitPoolCoinsFromSharesResponse, QueryCalcExitPoolCoinsFromSharesResponseSDKType, QueryPoolParamsRequest, QueryPoolParamsRequestSDKType, QueryPoolParamsResponse, QueryPoolParamsResponseSDKType, QueryTotalPoolLiquidityRequest, QueryTotalPoolLiquidityRequestSDKType, QueryTotalPoolLiquidityResponse, QueryTotalPoolLiquidityResponseSDKType, QueryTotalSharesRequest, QueryTotalSharesRequestSDKType, QueryTotalSharesResponse, QueryTotalSharesResponseSDKType, QuerySpotPriceRequest, QuerySpotPriceRequestSDKType, QuerySpotPriceResponse, QuerySpotPriceResponseSDKType, QuerySwapExactAmountInRequest, QuerySwapExactAmountInRequestSDKType, QuerySwapExactAmountInResponse, QuerySwapExactAmountInResponseSDKType, QuerySwapExactAmountOutRequest, QuerySwapExactAmountOutRequestSDKType, QuerySwapExactAmountOutResponse, QuerySwapExactAmountOutResponseSDKType } from "./query"; export interface Query { pools(request?: QueryPoolsRequest): Promise; numPools(request?: QueryNumPoolsRequest): Promise; totalLiquidity(request?: QueryTotalLiquidityRequest): Promise; + /** + * PoolsWithFilter allows you to query specific pools with requested + * parameters + */ + poolsWithFilter(request: QueryPoolsWithFilterRequest): Promise; + /** Per Pool gRPC Endpoints */ pool(request: QueryPoolRequest): Promise; @@ -22,6 +28,14 @@ export interface Query { * Errors if the pool is failed to be type caseted. */ poolType(request: QueryPoolTypeRequest): Promise; + + /** + * Simulates joining pool without a swap. Returns the amount of shares you'd + * get and tokens needed to provide + */ + calcJoinPoolNoSwapShares(request: QueryCalcJoinPoolNoSwapSharesRequest): Promise; + calcJoinPoolShares(request: QueryCalcJoinPoolSharesRequest): Promise; + calcExitPoolCoinsFromShares(request: QueryCalcExitPoolCoinsFromSharesRequest): Promise; poolParams(request: QueryPoolParamsRequest): Promise; totalPoolLiquidity(request: QueryTotalPoolLiquidityRequest): Promise; totalShares(request: QueryTotalSharesRequest): Promise; @@ -44,8 +58,12 @@ export class QueryClientImpl implements Query { this.pools = this.pools.bind(this); this.numPools = this.numPools.bind(this); this.totalLiquidity = this.totalLiquidity.bind(this); + this.poolsWithFilter = this.poolsWithFilter.bind(this); this.pool = this.pool.bind(this); this.poolType = this.poolType.bind(this); + this.calcJoinPoolNoSwapShares = this.calcJoinPoolNoSwapShares.bind(this); + this.calcJoinPoolShares = this.calcJoinPoolShares.bind(this); + this.calcExitPoolCoinsFromShares = this.calcExitPoolCoinsFromShares.bind(this); this.poolParams = this.poolParams.bind(this); this.totalPoolLiquidity = this.totalPoolLiquidity.bind(this); this.totalShares = this.totalShares.bind(this); @@ -74,6 +92,12 @@ export class QueryClientImpl implements Query { return promise.then(data => QueryTotalLiquidityResponse.decode(new _m0.Reader(data))); } + poolsWithFilter(request: QueryPoolsWithFilterRequest): Promise { + const data = QueryPoolsWithFilterRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.gamm.v1beta1.Query", "PoolsWithFilter", data); + return promise.then(data => QueryPoolsWithFilterResponse.decode(new _m0.Reader(data))); + } + pool(request: QueryPoolRequest): Promise { const data = QueryPoolRequest.encode(request).finish(); const promise = this.rpc.request("osmosis.gamm.v1beta1.Query", "Pool", data); @@ -86,6 +110,24 @@ export class QueryClientImpl implements Query { return promise.then(data => QueryPoolTypeResponse.decode(new _m0.Reader(data))); } + calcJoinPoolNoSwapShares(request: QueryCalcJoinPoolNoSwapSharesRequest): Promise { + const data = QueryCalcJoinPoolNoSwapSharesRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.gamm.v1beta1.Query", "CalcJoinPoolNoSwapShares", data); + return promise.then(data => QueryCalcJoinPoolNoSwapSharesResponse.decode(new _m0.Reader(data))); + } + + calcJoinPoolShares(request: QueryCalcJoinPoolSharesRequest): Promise { + const data = QueryCalcJoinPoolSharesRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.gamm.v1beta1.Query", "CalcJoinPoolShares", data); + return promise.then(data => QueryCalcJoinPoolSharesResponse.decode(new _m0.Reader(data))); + } + + calcExitPoolCoinsFromShares(request: QueryCalcExitPoolCoinsFromSharesRequest): Promise { + const data = QueryCalcExitPoolCoinsFromSharesRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.gamm.v1beta1.Query", "CalcExitPoolCoinsFromShares", data); + return promise.then(data => QueryCalcExitPoolCoinsFromSharesResponse.decode(new _m0.Reader(data))); + } + poolParams(request: QueryPoolParamsRequest): Promise { const data = QueryPoolParamsRequest.encode(request).finish(); const promise = this.rpc.request("osmosis.gamm.v1beta1.Query", "PoolParams", data); @@ -139,6 +181,10 @@ export const createRpcQueryExtension = (base: QueryClient) => { return queryService.totalLiquidity(request); }, + poolsWithFilter(request: QueryPoolsWithFilterRequest): Promise { + return queryService.poolsWithFilter(request); + }, + pool(request: QueryPoolRequest): Promise { return queryService.pool(request); }, @@ -147,6 +193,18 @@ export const createRpcQueryExtension = (base: QueryClient) => { return queryService.poolType(request); }, + calcJoinPoolNoSwapShares(request: QueryCalcJoinPoolNoSwapSharesRequest): Promise { + return queryService.calcJoinPoolNoSwapShares(request); + }, + + calcJoinPoolShares(request: QueryCalcJoinPoolSharesRequest): Promise { + return queryService.calcJoinPoolShares(request); + }, + + calcExitPoolCoinsFromShares(request: QueryCalcExitPoolCoinsFromSharesRequest): Promise { + return queryService.calcExitPoolCoinsFromShares(request); + }, + poolParams(request: QueryPoolParamsRequest): Promise { return queryService.poolParams(request); }, @@ -182,12 +240,24 @@ export interface UseNumPoolsQuery extends ReactQueryParams extends ReactQueryParams { request?: QueryTotalLiquidityRequest; } +export interface UsePoolsWithFilterQuery extends ReactQueryParams { + request: QueryPoolsWithFilterRequest; +} export interface UsePoolQuery extends ReactQueryParams { request: QueryPoolRequest; } export interface UsePoolTypeQuery extends ReactQueryParams { request: QueryPoolTypeRequest; } +export interface UseCalcJoinPoolNoSwapSharesQuery extends ReactQueryParams { + request: QueryCalcJoinPoolNoSwapSharesRequest; +} +export interface UseCalcJoinPoolSharesQuery extends ReactQueryParams { + request: QueryCalcJoinPoolSharesRequest; +} +export interface UseCalcExitPoolCoinsFromSharesQuery extends ReactQueryParams { + request: QueryCalcExitPoolCoinsFromSharesRequest; +} export interface UsePoolParamsQuery extends ReactQueryParams { request: QueryPoolParamsRequest; } @@ -256,6 +326,16 @@ export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { }, options); }; + const usePoolsWithFilter = ({ + request, + options + }: UsePoolsWithFilterQuery) => { + return useQuery(["poolsWithFilterQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.poolsWithFilter(request); + }, options); + }; + const usePool = ({ request, options @@ -276,6 +356,36 @@ export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { }, options); }; + const useCalcJoinPoolNoSwapShares = ({ + request, + options + }: UseCalcJoinPoolNoSwapSharesQuery) => { + return useQuery(["calcJoinPoolNoSwapSharesQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.calcJoinPoolNoSwapShares(request); + }, options); + }; + + const useCalcJoinPoolShares = ({ + request, + options + }: UseCalcJoinPoolSharesQuery) => { + return useQuery(["calcJoinPoolSharesQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.calcJoinPoolShares(request); + }, options); + }; + + const useCalcExitPoolCoinsFromShares = ({ + request, + options + }: UseCalcExitPoolCoinsFromSharesQuery) => { + return useQuery(["calcExitPoolCoinsFromSharesQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.calcExitPoolCoinsFromShares(request); + }, options); + }; + const usePoolParams = ({ request, options @@ -341,6 +451,12 @@ export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { useNumPools, useTotalLiquidity, + /** + * PoolsWithFilter allows you to query specific pools with requested + * parameters + */ + usePoolsWithFilter, + /** Per Pool gRPC Endpoints */ usePool, @@ -350,6 +466,14 @@ export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { * Errors if the pool is failed to be type caseted. */ usePoolType, + + /** + * Simulates joining pool without a swap. Returns the amount of shares you'd + * get and tokens needed to provide + */ + useCalcJoinPoolNoSwapShares, + useCalcJoinPoolShares, + useCalcExitPoolCoinsFromShares, usePoolParams, useTotalPoolLiquidity, useTotalShares, diff --git a/__fixtures__/output1/osmosis/gamm/v1beta1/query.ts b/__fixtures__/output1/osmosis/gamm/v1beta1/query.ts index 2652e8ceec..f09a436120 100644 --- a/__fixtures__/output1/osmosis/gamm/v1beta1/query.ts +++ b/__fixtures__/output1/osmosis/gamm/v1beta1/query.ts @@ -1,7 +1,7 @@ import { PageRequest, PageRequestSDKType, PageResponse, PageResponseSDKType } from "../../../cosmos/base/query/v1beta1/pagination"; +import { Coin, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; import { SwapAmountInRoute, SwapAmountInRouteSDKType, SwapAmountOutRoute, SwapAmountOutRouteSDKType } from "./tx"; import { Any, AnySDKType } from "../../../google/protobuf/any"; -import { Coin, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; import { Long, isSet, DeepPartial } from "../../../helpers"; import * as _m0 from "protobufjs/minimal"; export const protobufPackage = "osmosis.gamm.v1beta1"; @@ -30,7 +30,6 @@ export interface QueryPoolsRequest { /** =============================== Pools */ export interface QueryPoolsRequestSDKType { - /** pagination defines an optional pagination for the request. */ pagination?: PageRequestSDKType; } export interface QueryPoolsResponse { @@ -41,8 +40,6 @@ export interface QueryPoolsResponse { } export interface QueryPoolsResponseSDKType { pools: AnySDKType[]; - - /** pagination defines the pagination in the response. */ pagination?: PageResponseSDKType; } @@ -74,6 +71,44 @@ export interface QueryPoolTypeResponseSDKType { pool_type: string; } +/** =============================== CalcJoinPoolShares */ +export interface QueryCalcJoinPoolSharesRequest { + poolId: Long; + tokensIn: Coin[]; +} + +/** =============================== CalcJoinPoolShares */ +export interface QueryCalcJoinPoolSharesRequestSDKType { + pool_id: Long; + tokens_in: CoinSDKType[]; +} +export interface QueryCalcJoinPoolSharesResponse { + shareOutAmount: string; + tokensOut: Coin[]; +} +export interface QueryCalcJoinPoolSharesResponseSDKType { + share_out_amount: string; + tokens_out: CoinSDKType[]; +} + +/** =============================== CalcExitPoolCoinsFromShares */ +export interface QueryCalcExitPoolCoinsFromSharesRequest { + poolId: Long; + shareInAmount: string; +} + +/** =============================== CalcExitPoolCoinsFromShares */ +export interface QueryCalcExitPoolCoinsFromSharesRequestSDKType { + pool_id: Long; + share_in_amount: string; +} +export interface QueryCalcExitPoolCoinsFromSharesResponse { + tokensOut: Coin[]; +} +export interface QueryCalcExitPoolCoinsFromSharesResponseSDKType { + tokens_out: CoinSDKType[]; +} + /** =============================== PoolParams */ export interface QueryPoolParamsRequest { poolId: Long; @@ -122,10 +157,32 @@ export interface QueryTotalSharesResponseSDKType { total_shares?: CoinSDKType; } +/** =============================== CalcJoinPoolNoSwapShares */ +export interface QueryCalcJoinPoolNoSwapSharesRequest { + poolId: Long; + tokensIn: Coin[]; +} + +/** =============================== CalcJoinPoolNoSwapShares */ +export interface QueryCalcJoinPoolNoSwapSharesRequestSDKType { + pool_id: Long; + tokens_in: CoinSDKType[]; +} +export interface QueryCalcJoinPoolNoSwapSharesResponse { + tokensOut: Coin[]; + sharesOut: string; +} +export interface QueryCalcJoinPoolNoSwapSharesResponseSDKType { + tokens_out: CoinSDKType[]; + shares_out: string; +} + /** * QuerySpotPriceRequest defines the gRPC request structure for a SpotPrice * query. */ + +/** @deprecated */ export interface QuerySpotPriceRequest { poolId: Long; baseAssetDenom: string; @@ -136,16 +193,40 @@ export interface QuerySpotPriceRequest { * QuerySpotPriceRequest defines the gRPC request structure for a SpotPrice * query. */ + +/** @deprecated */ export interface QuerySpotPriceRequestSDKType { pool_id: Long; base_asset_denom: string; quote_asset_denom: string; } +export interface QueryPoolsWithFilterRequest { + minLiquidity: Coin[]; + poolType: string; + pagination?: PageRequest; +} +export interface QueryPoolsWithFilterRequestSDKType { + min_liquidity: CoinSDKType[]; + pool_type: string; + pagination?: PageRequestSDKType; +} +export interface QueryPoolsWithFilterResponse { + pools: Any[]; + + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} +export interface QueryPoolsWithFilterResponseSDKType { + pools: AnySDKType[]; + pagination?: PageResponseSDKType; +} /** * QuerySpotPriceResponse defines the gRPC response structure for a SpotPrice * query. */ + +/** @deprecated */ export interface QuerySpotPriceResponse { /** String of the Dec. Ex) 10.203uatom */ spotPrice: string; @@ -155,13 +236,15 @@ export interface QuerySpotPriceResponse { * QuerySpotPriceResponse defines the gRPC response structure for a SpotPrice * query. */ + +/** @deprecated */ export interface QuerySpotPriceResponseSDKType { - /** String of the Dec. Ex) 10.203uatom */ spot_price: string; } /** =============================== EstimateSwapExactAmountIn */ export interface QuerySwapExactAmountInRequest { + /** TODO: CHANGE THIS TO RESERVED IN A PATCH RELEASE */ sender: string; poolId: Long; tokenIn: string; @@ -184,6 +267,7 @@ export interface QuerySwapExactAmountInResponseSDKType { /** =============================== EstimateSwapExactAmountOut */ export interface QuerySwapExactAmountOutRequest { + /** TODO: CHANGE THIS TO RESERVED IN A PATCH RELEASE */ sender: string; poolId: Long; routes: SwapAmountOutRoute[]; @@ -773,25 +857,30 @@ export const QueryPoolTypeResponse = { }; -function createBaseQueryPoolParamsRequest(): QueryPoolParamsRequest { +function createBaseQueryCalcJoinPoolSharesRequest(): QueryCalcJoinPoolSharesRequest { return { - poolId: Long.UZERO + poolId: Long.UZERO, + tokensIn: [] }; } -export const QueryPoolParamsRequest = { - encode(message: QueryPoolParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { +export const QueryCalcJoinPoolSharesRequest = { + encode(message: QueryCalcJoinPoolSharesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.poolId.isZero()) { writer.uint32(8).uint64(message.poolId); } + for (const v of message.tokensIn) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryPoolParamsRequest { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryCalcJoinPoolSharesRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryPoolParamsRequest(); + const message = createBaseQueryCalcJoinPoolSharesRequest(); while (reader.pos < end) { const tag = reader.uint32(); @@ -801,6 +890,10 @@ export const QueryPoolParamsRequest = { message.poolId = (reader.uint64() as Long); break; + case 2: + message.tokensIn.push(Coin.decode(reader, reader.uint32())); + break; + default: reader.skipType(tag & 7); break; @@ -810,64 +903,90 @@ export const QueryPoolParamsRequest = { return message; }, - fromJSON(object: any): QueryPoolParamsRequest { + fromJSON(object: any): QueryCalcJoinPoolSharesRequest { return { - poolId: isSet(object.poolId) ? Long.fromValue(object.poolId) : Long.UZERO + poolId: isSet(object.poolId) ? Long.fromValue(object.poolId) : Long.UZERO, + tokensIn: Array.isArray(object?.tokensIn) ? object.tokensIn.map((e: any) => Coin.fromJSON(e)) : [] }; }, - toJSON(message: QueryPoolParamsRequest): unknown { + toJSON(message: QueryCalcJoinPoolSharesRequest): unknown { const obj: any = {}; message.poolId !== undefined && (obj.poolId = (message.poolId || Long.UZERO).toString()); + + if (message.tokensIn) { + obj.tokensIn = message.tokensIn.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.tokensIn = []; + } + return obj; }, - fromPartial(object: DeepPartial): QueryPoolParamsRequest { - const message = createBaseQueryPoolParamsRequest(); + fromPartial(object: DeepPartial): QueryCalcJoinPoolSharesRequest { + const message = createBaseQueryCalcJoinPoolSharesRequest(); message.poolId = object.poolId !== undefined && object.poolId !== null ? Long.fromValue(object.poolId) : Long.UZERO; + message.tokensIn = object.tokensIn?.map(e => Coin.fromPartial(e)) || []; return message; }, - fromSDK(object: QueryPoolParamsRequestSDKType): QueryPoolParamsRequest { + fromSDK(object: QueryCalcJoinPoolSharesRequestSDKType): QueryCalcJoinPoolSharesRequest { return { - poolId: object?.pool_id + poolId: object?.pool_id, + tokensIn: Array.isArray(object?.tokens_in) ? object.tokens_in.map((e: any) => Coin.fromSDK(e)) : [] }; }, - toSDK(message: QueryPoolParamsRequest): QueryPoolParamsRequestSDKType { + toSDK(message: QueryCalcJoinPoolSharesRequest): QueryCalcJoinPoolSharesRequestSDKType { const obj: any = {}; obj.pool_id = message.poolId; + + if (message.tokensIn) { + obj.tokens_in = message.tokensIn.map(e => e ? Coin.toSDK(e) : undefined); + } else { + obj.tokens_in = []; + } + return obj; } }; -function createBaseQueryPoolParamsResponse(): QueryPoolParamsResponse { +function createBaseQueryCalcJoinPoolSharesResponse(): QueryCalcJoinPoolSharesResponse { return { - params: undefined + shareOutAmount: "", + tokensOut: [] }; } -export const QueryPoolParamsResponse = { - encode(message: QueryPoolParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.params !== undefined) { - Any.encode(message.params, writer.uint32(10).fork()).ldelim(); +export const QueryCalcJoinPoolSharesResponse = { + encode(message: QueryCalcJoinPoolSharesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.shareOutAmount !== "") { + writer.uint32(10).string(message.shareOutAmount); + } + + for (const v of message.tokensOut) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryPoolParamsResponse { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryCalcJoinPoolSharesResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryPoolParamsResponse(); + const message = createBaseQueryCalcJoinPoolSharesResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.params = Any.decode(reader, reader.uint32()); + message.shareOutAmount = reader.string(); + break; + + case 2: + message.tokensOut.push(Coin.decode(reader, reader.uint32())); break; default: @@ -879,57 +998,79 @@ export const QueryPoolParamsResponse = { return message; }, - fromJSON(object: any): QueryPoolParamsResponse { + fromJSON(object: any): QueryCalcJoinPoolSharesResponse { return { - params: isSet(object.params) ? Any.fromJSON(object.params) : undefined + shareOutAmount: isSet(object.shareOutAmount) ? String(object.shareOutAmount) : "", + tokensOut: Array.isArray(object?.tokensOut) ? object.tokensOut.map((e: any) => Coin.fromJSON(e)) : [] }; }, - toJSON(message: QueryPoolParamsResponse): unknown { + toJSON(message: QueryCalcJoinPoolSharesResponse): unknown { const obj: any = {}; - message.params !== undefined && (obj.params = message.params ? Any.toJSON(message.params) : undefined); + message.shareOutAmount !== undefined && (obj.shareOutAmount = message.shareOutAmount); + + if (message.tokensOut) { + obj.tokensOut = message.tokensOut.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.tokensOut = []; + } + return obj; }, - fromPartial(object: DeepPartial): QueryPoolParamsResponse { - const message = createBaseQueryPoolParamsResponse(); - message.params = object.params !== undefined && object.params !== null ? Any.fromPartial(object.params) : undefined; + fromPartial(object: DeepPartial): QueryCalcJoinPoolSharesResponse { + const message = createBaseQueryCalcJoinPoolSharesResponse(); + message.shareOutAmount = object.shareOutAmount ?? ""; + message.tokensOut = object.tokensOut?.map(e => Coin.fromPartial(e)) || []; return message; }, - fromSDK(object: QueryPoolParamsResponseSDKType): QueryPoolParamsResponse { + fromSDK(object: QueryCalcJoinPoolSharesResponseSDKType): QueryCalcJoinPoolSharesResponse { return { - params: object.params ? Any.fromSDK(object.params) : undefined + shareOutAmount: object?.share_out_amount, + tokensOut: Array.isArray(object?.tokens_out) ? object.tokens_out.map((e: any) => Coin.fromSDK(e)) : [] }; }, - toSDK(message: QueryPoolParamsResponse): QueryPoolParamsResponseSDKType { + toSDK(message: QueryCalcJoinPoolSharesResponse): QueryCalcJoinPoolSharesResponseSDKType { const obj: any = {}; - message.params !== undefined && (obj.params = message.params ? Any.toSDK(message.params) : undefined); + obj.share_out_amount = message.shareOutAmount; + + if (message.tokensOut) { + obj.tokens_out = message.tokensOut.map(e => e ? Coin.toSDK(e) : undefined); + } else { + obj.tokens_out = []; + } + return obj; } }; -function createBaseQueryTotalPoolLiquidityRequest(): QueryTotalPoolLiquidityRequest { +function createBaseQueryCalcExitPoolCoinsFromSharesRequest(): QueryCalcExitPoolCoinsFromSharesRequest { return { - poolId: Long.UZERO + poolId: Long.UZERO, + shareInAmount: "" }; } -export const QueryTotalPoolLiquidityRequest = { - encode(message: QueryTotalPoolLiquidityRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { +export const QueryCalcExitPoolCoinsFromSharesRequest = { + encode(message: QueryCalcExitPoolCoinsFromSharesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.poolId.isZero()) { writer.uint32(8).uint64(message.poolId); } + if (message.shareInAmount !== "") { + writer.uint32(18).string(message.shareInAmount); + } + return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryTotalPoolLiquidityRequest { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryCalcExitPoolCoinsFromSharesRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryTotalPoolLiquidityRequest(); + const message = createBaseQueryCalcExitPoolCoinsFromSharesRequest(); while (reader.pos < end) { const tag = reader.uint32(); @@ -939,6 +1080,10 @@ export const QueryTotalPoolLiquidityRequest = { message.poolId = (reader.uint64() as Long); break; + case 2: + message.shareInAmount = reader.string(); + break; + default: reader.skipType(tag & 7); break; @@ -948,64 +1093,69 @@ export const QueryTotalPoolLiquidityRequest = { return message; }, - fromJSON(object: any): QueryTotalPoolLiquidityRequest { + fromJSON(object: any): QueryCalcExitPoolCoinsFromSharesRequest { return { - poolId: isSet(object.poolId) ? Long.fromValue(object.poolId) : Long.UZERO + poolId: isSet(object.poolId) ? Long.fromValue(object.poolId) : Long.UZERO, + shareInAmount: isSet(object.shareInAmount) ? String(object.shareInAmount) : "" }; }, - toJSON(message: QueryTotalPoolLiquidityRequest): unknown { + toJSON(message: QueryCalcExitPoolCoinsFromSharesRequest): unknown { const obj: any = {}; message.poolId !== undefined && (obj.poolId = (message.poolId || Long.UZERO).toString()); + message.shareInAmount !== undefined && (obj.shareInAmount = message.shareInAmount); return obj; }, - fromPartial(object: DeepPartial): QueryTotalPoolLiquidityRequest { - const message = createBaseQueryTotalPoolLiquidityRequest(); + fromPartial(object: DeepPartial): QueryCalcExitPoolCoinsFromSharesRequest { + const message = createBaseQueryCalcExitPoolCoinsFromSharesRequest(); message.poolId = object.poolId !== undefined && object.poolId !== null ? Long.fromValue(object.poolId) : Long.UZERO; + message.shareInAmount = object.shareInAmount ?? ""; return message; }, - fromSDK(object: QueryTotalPoolLiquidityRequestSDKType): QueryTotalPoolLiquidityRequest { + fromSDK(object: QueryCalcExitPoolCoinsFromSharesRequestSDKType): QueryCalcExitPoolCoinsFromSharesRequest { return { - poolId: object?.pool_id + poolId: object?.pool_id, + shareInAmount: object?.share_in_amount }; }, - toSDK(message: QueryTotalPoolLiquidityRequest): QueryTotalPoolLiquidityRequestSDKType { + toSDK(message: QueryCalcExitPoolCoinsFromSharesRequest): QueryCalcExitPoolCoinsFromSharesRequestSDKType { const obj: any = {}; obj.pool_id = message.poolId; + obj.share_in_amount = message.shareInAmount; return obj; } }; -function createBaseQueryTotalPoolLiquidityResponse(): QueryTotalPoolLiquidityResponse { +function createBaseQueryCalcExitPoolCoinsFromSharesResponse(): QueryCalcExitPoolCoinsFromSharesResponse { return { - liquidity: [] + tokensOut: [] }; } -export const QueryTotalPoolLiquidityResponse = { - encode(message: QueryTotalPoolLiquidityResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - for (const v of message.liquidity) { +export const QueryCalcExitPoolCoinsFromSharesResponse = { + encode(message: QueryCalcExitPoolCoinsFromSharesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.tokensOut) { Coin.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryTotalPoolLiquidityResponse { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryCalcExitPoolCoinsFromSharesResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryTotalPoolLiquidityResponse(); + const message = createBaseQueryCalcExitPoolCoinsFromSharesResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.liquidity.push(Coin.decode(reader, reader.uint32())); + message.tokensOut.push(Coin.decode(reader, reader.uint32())); break; default: @@ -1017,43 +1167,43 @@ export const QueryTotalPoolLiquidityResponse = { return message; }, - fromJSON(object: any): QueryTotalPoolLiquidityResponse { + fromJSON(object: any): QueryCalcExitPoolCoinsFromSharesResponse { return { - liquidity: Array.isArray(object?.liquidity) ? object.liquidity.map((e: any) => Coin.fromJSON(e)) : [] + tokensOut: Array.isArray(object?.tokensOut) ? object.tokensOut.map((e: any) => Coin.fromJSON(e)) : [] }; }, - toJSON(message: QueryTotalPoolLiquidityResponse): unknown { + toJSON(message: QueryCalcExitPoolCoinsFromSharesResponse): unknown { const obj: any = {}; - if (message.liquidity) { - obj.liquidity = message.liquidity.map(e => e ? Coin.toJSON(e) : undefined); + if (message.tokensOut) { + obj.tokensOut = message.tokensOut.map(e => e ? Coin.toJSON(e) : undefined); } else { - obj.liquidity = []; + obj.tokensOut = []; } return obj; }, - fromPartial(object: DeepPartial): QueryTotalPoolLiquidityResponse { - const message = createBaseQueryTotalPoolLiquidityResponse(); - message.liquidity = object.liquidity?.map(e => Coin.fromPartial(e)) || []; + fromPartial(object: DeepPartial): QueryCalcExitPoolCoinsFromSharesResponse { + const message = createBaseQueryCalcExitPoolCoinsFromSharesResponse(); + message.tokensOut = object.tokensOut?.map(e => Coin.fromPartial(e)) || []; return message; }, - fromSDK(object: QueryTotalPoolLiquidityResponseSDKType): QueryTotalPoolLiquidityResponse { + fromSDK(object: QueryCalcExitPoolCoinsFromSharesResponseSDKType): QueryCalcExitPoolCoinsFromSharesResponse { return { - liquidity: Array.isArray(object?.liquidity) ? object.liquidity.map((e: any) => Coin.fromSDK(e)) : [] + tokensOut: Array.isArray(object?.tokens_out) ? object.tokens_out.map((e: any) => Coin.fromSDK(e)) : [] }; }, - toSDK(message: QueryTotalPoolLiquidityResponse): QueryTotalPoolLiquidityResponseSDKType { + toSDK(message: QueryCalcExitPoolCoinsFromSharesResponse): QueryCalcExitPoolCoinsFromSharesResponseSDKType { const obj: any = {}; - if (message.liquidity) { - obj.liquidity = message.liquidity.map(e => e ? Coin.toSDK(e) : undefined); + if (message.tokensOut) { + obj.tokens_out = message.tokensOut.map(e => e ? Coin.toSDK(e) : undefined); } else { - obj.liquidity = []; + obj.tokens_out = []; } return obj; @@ -1061,14 +1211,14 @@ export const QueryTotalPoolLiquidityResponse = { }; -function createBaseQueryTotalSharesRequest(): QueryTotalSharesRequest { +function createBaseQueryPoolParamsRequest(): QueryPoolParamsRequest { return { poolId: Long.UZERO }; } -export const QueryTotalSharesRequest = { - encode(message: QueryTotalSharesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { +export const QueryPoolParamsRequest = { + encode(message: QueryPoolParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.poolId.isZero()) { writer.uint32(8).uint64(message.poolId); } @@ -1076,10 +1226,10 @@ export const QueryTotalSharesRequest = { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryTotalSharesRequest { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryPoolParamsRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryTotalSharesRequest(); + const message = createBaseQueryPoolParamsRequest(); while (reader.pos < end) { const tag = reader.uint32(); @@ -1098,31 +1248,31 @@ export const QueryTotalSharesRequest = { return message; }, - fromJSON(object: any): QueryTotalSharesRequest { + fromJSON(object: any): QueryPoolParamsRequest { return { poolId: isSet(object.poolId) ? Long.fromValue(object.poolId) : Long.UZERO }; }, - toJSON(message: QueryTotalSharesRequest): unknown { + toJSON(message: QueryPoolParamsRequest): unknown { const obj: any = {}; message.poolId !== undefined && (obj.poolId = (message.poolId || Long.UZERO).toString()); return obj; }, - fromPartial(object: DeepPartial): QueryTotalSharesRequest { - const message = createBaseQueryTotalSharesRequest(); + fromPartial(object: DeepPartial): QueryPoolParamsRequest { + const message = createBaseQueryPoolParamsRequest(); message.poolId = object.poolId !== undefined && object.poolId !== null ? Long.fromValue(object.poolId) : Long.UZERO; return message; }, - fromSDK(object: QueryTotalSharesRequestSDKType): QueryTotalSharesRequest { + fromSDK(object: QueryPoolParamsRequestSDKType): QueryPoolParamsRequest { return { poolId: object?.pool_id }; }, - toSDK(message: QueryTotalSharesRequest): QueryTotalSharesRequestSDKType { + toSDK(message: QueryPoolParamsRequest): QueryPoolParamsRequestSDKType { const obj: any = {}; obj.pool_id = message.poolId; return obj; @@ -1130,32 +1280,32 @@ export const QueryTotalSharesRequest = { }; -function createBaseQueryTotalSharesResponse(): QueryTotalSharesResponse { +function createBaseQueryPoolParamsResponse(): QueryPoolParamsResponse { return { - totalShares: undefined + params: undefined }; } -export const QueryTotalSharesResponse = { - encode(message: QueryTotalSharesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.totalShares !== undefined) { - Coin.encode(message.totalShares, writer.uint32(10).fork()).ldelim(); +export const QueryPoolParamsResponse = { + encode(message: QueryPoolParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.params !== undefined) { + Any.encode(message.params, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryTotalSharesResponse { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryPoolParamsResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryTotalSharesResponse(); + const message = createBaseQueryPoolParamsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.totalShares = Coin.decode(reader, reader.uint32()); + message.params = Any.decode(reader, reader.uint32()); break; default: @@ -1167,67 +1317,57 @@ export const QueryTotalSharesResponse = { return message; }, - fromJSON(object: any): QueryTotalSharesResponse { + fromJSON(object: any): QueryPoolParamsResponse { return { - totalShares: isSet(object.totalShares) ? Coin.fromJSON(object.totalShares) : undefined + params: isSet(object.params) ? Any.fromJSON(object.params) : undefined }; }, - toJSON(message: QueryTotalSharesResponse): unknown { + toJSON(message: QueryPoolParamsResponse): unknown { const obj: any = {}; - message.totalShares !== undefined && (obj.totalShares = message.totalShares ? Coin.toJSON(message.totalShares) : undefined); + message.params !== undefined && (obj.params = message.params ? Any.toJSON(message.params) : undefined); return obj; }, - fromPartial(object: DeepPartial): QueryTotalSharesResponse { - const message = createBaseQueryTotalSharesResponse(); - message.totalShares = object.totalShares !== undefined && object.totalShares !== null ? Coin.fromPartial(object.totalShares) : undefined; + fromPartial(object: DeepPartial): QueryPoolParamsResponse { + const message = createBaseQueryPoolParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Any.fromPartial(object.params) : undefined; return message; }, - fromSDK(object: QueryTotalSharesResponseSDKType): QueryTotalSharesResponse { + fromSDK(object: QueryPoolParamsResponseSDKType): QueryPoolParamsResponse { return { - totalShares: object.total_shares ? Coin.fromSDK(object.total_shares) : undefined + params: object.params ? Any.fromSDK(object.params) : undefined }; }, - toSDK(message: QueryTotalSharesResponse): QueryTotalSharesResponseSDKType { + toSDK(message: QueryPoolParamsResponse): QueryPoolParamsResponseSDKType { const obj: any = {}; - message.totalShares !== undefined && (obj.total_shares = message.totalShares ? Coin.toSDK(message.totalShares) : undefined); + message.params !== undefined && (obj.params = message.params ? Any.toSDK(message.params) : undefined); return obj; } }; -function createBaseQuerySpotPriceRequest(): QuerySpotPriceRequest { +function createBaseQueryTotalPoolLiquidityRequest(): QueryTotalPoolLiquidityRequest { return { - poolId: Long.UZERO, - baseAssetDenom: "", - quoteAssetDenom: "" + poolId: Long.UZERO }; } -export const QuerySpotPriceRequest = { - encode(message: QuerySpotPriceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { +export const QueryTotalPoolLiquidityRequest = { + encode(message: QueryTotalPoolLiquidityRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.poolId.isZero()) { writer.uint32(8).uint64(message.poolId); } - if (message.baseAssetDenom !== "") { - writer.uint32(18).string(message.baseAssetDenom); - } - - if (message.quoteAssetDenom !== "") { - writer.uint32(26).string(message.quoteAssetDenom); - } - return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySpotPriceRequest { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryTotalPoolLiquidityRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQuerySpotPriceRequest(); + const message = createBaseQueryTotalPoolLiquidityRequest(); while (reader.pos < end) { const tag = reader.uint32(); @@ -1237,14 +1377,6 @@ export const QuerySpotPriceRequest = { message.poolId = (reader.uint64() as Long); break; - case 2: - message.baseAssetDenom = reader.string(); - break; - - case 3: - message.quoteAssetDenom = reader.string(); - break; - default: reader.skipType(tag & 7); break; @@ -1254,15 +1386,511 @@ export const QuerySpotPriceRequest = { return message; }, - fromJSON(object: any): QuerySpotPriceRequest { + fromJSON(object: any): QueryTotalPoolLiquidityRequest { return { - poolId: isSet(object.poolId) ? Long.fromValue(object.poolId) : Long.UZERO, - baseAssetDenom: isSet(object.baseAssetDenom) ? String(object.baseAssetDenom) : "", - quoteAssetDenom: isSet(object.quoteAssetDenom) ? String(object.quoteAssetDenom) : "" + poolId: isSet(object.poolId) ? Long.fromValue(object.poolId) : Long.UZERO }; }, - toJSON(message: QuerySpotPriceRequest): unknown { + toJSON(message: QueryTotalPoolLiquidityRequest): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || Long.UZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): QueryTotalPoolLiquidityRequest { + const message = createBaseQueryTotalPoolLiquidityRequest(); + message.poolId = object.poolId !== undefined && object.poolId !== null ? Long.fromValue(object.poolId) : Long.UZERO; + return message; + }, + + fromSDK(object: QueryTotalPoolLiquidityRequestSDKType): QueryTotalPoolLiquidityRequest { + return { + poolId: object?.pool_id + }; + }, + + toSDK(message: QueryTotalPoolLiquidityRequest): QueryTotalPoolLiquidityRequestSDKType { + const obj: any = {}; + obj.pool_id = message.poolId; + return obj; + } + +}; + +function createBaseQueryTotalPoolLiquidityResponse(): QueryTotalPoolLiquidityResponse { + return { + liquidity: [] + }; +} + +export const QueryTotalPoolLiquidityResponse = { + encode(message: QueryTotalPoolLiquidityResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.liquidity) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryTotalPoolLiquidityResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTotalPoolLiquidityResponse(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.liquidity.push(Coin.decode(reader, reader.uint32())); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): QueryTotalPoolLiquidityResponse { + return { + liquidity: Array.isArray(object?.liquidity) ? object.liquidity.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + + toJSON(message: QueryTotalPoolLiquidityResponse): unknown { + const obj: any = {}; + + if (message.liquidity) { + obj.liquidity = message.liquidity.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.liquidity = []; + } + + return obj; + }, + + fromPartial(object: DeepPartial): QueryTotalPoolLiquidityResponse { + const message = createBaseQueryTotalPoolLiquidityResponse(); + message.liquidity = object.liquidity?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + + fromSDK(object: QueryTotalPoolLiquidityResponseSDKType): QueryTotalPoolLiquidityResponse { + return { + liquidity: Array.isArray(object?.liquidity) ? object.liquidity.map((e: any) => Coin.fromSDK(e)) : [] + }; + }, + + toSDK(message: QueryTotalPoolLiquidityResponse): QueryTotalPoolLiquidityResponseSDKType { + const obj: any = {}; + + if (message.liquidity) { + obj.liquidity = message.liquidity.map(e => e ? Coin.toSDK(e) : undefined); + } else { + obj.liquidity = []; + } + + return obj; + } + +}; + +function createBaseQueryTotalSharesRequest(): QueryTotalSharesRequest { + return { + poolId: Long.UZERO + }; +} + +export const QueryTotalSharesRequest = { + encode(message: QueryTotalSharesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.poolId.isZero()) { + writer.uint32(8).uint64(message.poolId); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryTotalSharesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTotalSharesRequest(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.poolId = (reader.uint64() as Long); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): QueryTotalSharesRequest { + return { + poolId: isSet(object.poolId) ? Long.fromValue(object.poolId) : Long.UZERO + }; + }, + + toJSON(message: QueryTotalSharesRequest): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || Long.UZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): QueryTotalSharesRequest { + const message = createBaseQueryTotalSharesRequest(); + message.poolId = object.poolId !== undefined && object.poolId !== null ? Long.fromValue(object.poolId) : Long.UZERO; + return message; + }, + + fromSDK(object: QueryTotalSharesRequestSDKType): QueryTotalSharesRequest { + return { + poolId: object?.pool_id + }; + }, + + toSDK(message: QueryTotalSharesRequest): QueryTotalSharesRequestSDKType { + const obj: any = {}; + obj.pool_id = message.poolId; + return obj; + } + +}; + +function createBaseQueryTotalSharesResponse(): QueryTotalSharesResponse { + return { + totalShares: undefined + }; +} + +export const QueryTotalSharesResponse = { + encode(message: QueryTotalSharesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.totalShares !== undefined) { + Coin.encode(message.totalShares, writer.uint32(10).fork()).ldelim(); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryTotalSharesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTotalSharesResponse(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.totalShares = Coin.decode(reader, reader.uint32()); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): QueryTotalSharesResponse { + return { + totalShares: isSet(object.totalShares) ? Coin.fromJSON(object.totalShares) : undefined + }; + }, + + toJSON(message: QueryTotalSharesResponse): unknown { + const obj: any = {}; + message.totalShares !== undefined && (obj.totalShares = message.totalShares ? Coin.toJSON(message.totalShares) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryTotalSharesResponse { + const message = createBaseQueryTotalSharesResponse(); + message.totalShares = object.totalShares !== undefined && object.totalShares !== null ? Coin.fromPartial(object.totalShares) : undefined; + return message; + }, + + fromSDK(object: QueryTotalSharesResponseSDKType): QueryTotalSharesResponse { + return { + totalShares: object.total_shares ? Coin.fromSDK(object.total_shares) : undefined + }; + }, + + toSDK(message: QueryTotalSharesResponse): QueryTotalSharesResponseSDKType { + const obj: any = {}; + message.totalShares !== undefined && (obj.total_shares = message.totalShares ? Coin.toSDK(message.totalShares) : undefined); + return obj; + } + +}; + +function createBaseQueryCalcJoinPoolNoSwapSharesRequest(): QueryCalcJoinPoolNoSwapSharesRequest { + return { + poolId: Long.UZERO, + tokensIn: [] + }; +} + +export const QueryCalcJoinPoolNoSwapSharesRequest = { + encode(message: QueryCalcJoinPoolNoSwapSharesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.poolId.isZero()) { + writer.uint32(8).uint64(message.poolId); + } + + for (const v of message.tokensIn) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryCalcJoinPoolNoSwapSharesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCalcJoinPoolNoSwapSharesRequest(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.poolId = (reader.uint64() as Long); + break; + + case 2: + message.tokensIn.push(Coin.decode(reader, reader.uint32())); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): QueryCalcJoinPoolNoSwapSharesRequest { + return { + poolId: isSet(object.poolId) ? Long.fromValue(object.poolId) : Long.UZERO, + tokensIn: Array.isArray(object?.tokensIn) ? object.tokensIn.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + + toJSON(message: QueryCalcJoinPoolNoSwapSharesRequest): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || Long.UZERO).toString()); + + if (message.tokensIn) { + obj.tokensIn = message.tokensIn.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.tokensIn = []; + } + + return obj; + }, + + fromPartial(object: DeepPartial): QueryCalcJoinPoolNoSwapSharesRequest { + const message = createBaseQueryCalcJoinPoolNoSwapSharesRequest(); + message.poolId = object.poolId !== undefined && object.poolId !== null ? Long.fromValue(object.poolId) : Long.UZERO; + message.tokensIn = object.tokensIn?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + + fromSDK(object: QueryCalcJoinPoolNoSwapSharesRequestSDKType): QueryCalcJoinPoolNoSwapSharesRequest { + return { + poolId: object?.pool_id, + tokensIn: Array.isArray(object?.tokens_in) ? object.tokens_in.map((e: any) => Coin.fromSDK(e)) : [] + }; + }, + + toSDK(message: QueryCalcJoinPoolNoSwapSharesRequest): QueryCalcJoinPoolNoSwapSharesRequestSDKType { + const obj: any = {}; + obj.pool_id = message.poolId; + + if (message.tokensIn) { + obj.tokens_in = message.tokensIn.map(e => e ? Coin.toSDK(e) : undefined); + } else { + obj.tokens_in = []; + } + + return obj; + } + +}; + +function createBaseQueryCalcJoinPoolNoSwapSharesResponse(): QueryCalcJoinPoolNoSwapSharesResponse { + return { + tokensOut: [], + sharesOut: "" + }; +} + +export const QueryCalcJoinPoolNoSwapSharesResponse = { + encode(message: QueryCalcJoinPoolNoSwapSharesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.tokensOut) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + + if (message.sharesOut !== "") { + writer.uint32(18).string(message.sharesOut); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryCalcJoinPoolNoSwapSharesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCalcJoinPoolNoSwapSharesResponse(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.tokensOut.push(Coin.decode(reader, reader.uint32())); + break; + + case 2: + message.sharesOut = reader.string(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): QueryCalcJoinPoolNoSwapSharesResponse { + return { + tokensOut: Array.isArray(object?.tokensOut) ? object.tokensOut.map((e: any) => Coin.fromJSON(e)) : [], + sharesOut: isSet(object.sharesOut) ? String(object.sharesOut) : "" + }; + }, + + toJSON(message: QueryCalcJoinPoolNoSwapSharesResponse): unknown { + const obj: any = {}; + + if (message.tokensOut) { + obj.tokensOut = message.tokensOut.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.tokensOut = []; + } + + message.sharesOut !== undefined && (obj.sharesOut = message.sharesOut); + return obj; + }, + + fromPartial(object: DeepPartial): QueryCalcJoinPoolNoSwapSharesResponse { + const message = createBaseQueryCalcJoinPoolNoSwapSharesResponse(); + message.tokensOut = object.tokensOut?.map(e => Coin.fromPartial(e)) || []; + message.sharesOut = object.sharesOut ?? ""; + return message; + }, + + fromSDK(object: QueryCalcJoinPoolNoSwapSharesResponseSDKType): QueryCalcJoinPoolNoSwapSharesResponse { + return { + tokensOut: Array.isArray(object?.tokens_out) ? object.tokens_out.map((e: any) => Coin.fromSDK(e)) : [], + sharesOut: object?.shares_out + }; + }, + + toSDK(message: QueryCalcJoinPoolNoSwapSharesResponse): QueryCalcJoinPoolNoSwapSharesResponseSDKType { + const obj: any = {}; + + if (message.tokensOut) { + obj.tokens_out = message.tokensOut.map(e => e ? Coin.toSDK(e) : undefined); + } else { + obj.tokens_out = []; + } + + obj.shares_out = message.sharesOut; + return obj; + } + +}; + +function createBaseQuerySpotPriceRequest(): QuerySpotPriceRequest { + return { + poolId: Long.UZERO, + baseAssetDenom: "", + quoteAssetDenom: "" + }; +} + +export const QuerySpotPriceRequest = { + encode(message: QuerySpotPriceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.poolId.isZero()) { + writer.uint32(8).uint64(message.poolId); + } + + if (message.baseAssetDenom !== "") { + writer.uint32(18).string(message.baseAssetDenom); + } + + if (message.quoteAssetDenom !== "") { + writer.uint32(26).string(message.quoteAssetDenom); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QuerySpotPriceRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySpotPriceRequest(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.poolId = (reader.uint64() as Long); + break; + + case 2: + message.baseAssetDenom = reader.string(); + break; + + case 3: + message.quoteAssetDenom = reader.string(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): QuerySpotPriceRequest { + return { + poolId: isSet(object.poolId) ? Long.fromValue(object.poolId) : Long.UZERO, + baseAssetDenom: isSet(object.baseAssetDenom) ? String(object.baseAssetDenom) : "", + quoteAssetDenom: isSet(object.quoteAssetDenom) ? String(object.quoteAssetDenom) : "" + }; + }, + + toJSON(message: QuerySpotPriceRequest): unknown { const obj: any = {}; message.poolId !== undefined && (obj.poolId = (message.poolId || Long.UZERO).toString()); message.baseAssetDenom !== undefined && (obj.baseAssetDenom = message.baseAssetDenom); @@ -1296,6 +1924,210 @@ export const QuerySpotPriceRequest = { }; +function createBaseQueryPoolsWithFilterRequest(): QueryPoolsWithFilterRequest { + return { + minLiquidity: [], + poolType: "", + pagination: undefined + }; +} + +export const QueryPoolsWithFilterRequest = { + encode(message: QueryPoolsWithFilterRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.minLiquidity) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + + if (message.poolType !== "") { + writer.uint32(18).string(message.poolType); + } + + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(26).fork()).ldelim(); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryPoolsWithFilterRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPoolsWithFilterRequest(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.minLiquidity.push(Coin.decode(reader, reader.uint32())); + break; + + case 2: + message.poolType = reader.string(); + break; + + case 3: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): QueryPoolsWithFilterRequest { + return { + minLiquidity: Array.isArray(object?.minLiquidity) ? object.minLiquidity.map((e: any) => Coin.fromJSON(e)) : [], + poolType: isSet(object.poolType) ? String(object.poolType) : "", + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined + }; + }, + + toJSON(message: QueryPoolsWithFilterRequest): unknown { + const obj: any = {}; + + if (message.minLiquidity) { + obj.minLiquidity = message.minLiquidity.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.minLiquidity = []; + } + + message.poolType !== undefined && (obj.poolType = message.poolType); + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryPoolsWithFilterRequest { + const message = createBaseQueryPoolsWithFilterRequest(); + message.minLiquidity = object.minLiquidity?.map(e => Coin.fromPartial(e)) || []; + message.poolType = object.poolType ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + }, + + fromSDK(object: QueryPoolsWithFilterRequestSDKType): QueryPoolsWithFilterRequest { + return { + minLiquidity: Array.isArray(object?.min_liquidity) ? object.min_liquidity.map((e: any) => Coin.fromSDK(e)) : [], + poolType: object?.pool_type, + pagination: object.pagination ? PageRequest.fromSDK(object.pagination) : undefined + }; + }, + + toSDK(message: QueryPoolsWithFilterRequest): QueryPoolsWithFilterRequestSDKType { + const obj: any = {}; + + if (message.minLiquidity) { + obj.min_liquidity = message.minLiquidity.map(e => e ? Coin.toSDK(e) : undefined); + } else { + obj.min_liquidity = []; + } + + obj.pool_type = message.poolType; + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toSDK(message.pagination) : undefined); + return obj; + } + +}; + +function createBaseQueryPoolsWithFilterResponse(): QueryPoolsWithFilterResponse { + return { + pools: [], + pagination: undefined + }; +} + +export const QueryPoolsWithFilterResponse = { + encode(message: QueryPoolsWithFilterResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.pools) { + Any.encode(v!, writer.uint32(10).fork()).ldelim(); + } + + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryPoolsWithFilterResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPoolsWithFilterResponse(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.pools.push(Any.decode(reader, reader.uint32())); + break; + + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): QueryPoolsWithFilterResponse { + return { + pools: Array.isArray(object?.pools) ? object.pools.map((e: any) => Any.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined + }; + }, + + toJSON(message: QueryPoolsWithFilterResponse): unknown { + const obj: any = {}; + + if (message.pools) { + obj.pools = message.pools.map(e => e ? Any.toJSON(e) : undefined); + } else { + obj.pools = []; + } + + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryPoolsWithFilterResponse { + const message = createBaseQueryPoolsWithFilterResponse(); + message.pools = object.pools?.map(e => Any.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + + fromSDK(object: QueryPoolsWithFilterResponseSDKType): QueryPoolsWithFilterResponse { + return { + pools: Array.isArray(object?.pools) ? object.pools.map((e: any) => Any.fromSDK(e)) : [], + pagination: object.pagination ? PageResponse.fromSDK(object.pagination) : undefined + }; + }, + + toSDK(message: QueryPoolsWithFilterResponse): QueryPoolsWithFilterResponseSDKType { + const obj: any = {}; + + if (message.pools) { + obj.pools = message.pools.map(e => e ? Any.toSDK(e) : undefined); + } else { + obj.pools = []; + } + + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toSDK(message.pagination) : undefined); + return obj; + } + +}; + function createBaseQuerySpotPriceResponse(): QuerySpotPriceResponse { return { spotPrice: "" diff --git a/__fixtures__/output1/osmosis/gamm/v2/query.lcd.ts b/__fixtures__/output1/osmosis/gamm/v2/query.lcd.ts new file mode 100644 index 0000000000..64ea5859a5 --- /dev/null +++ b/__fixtures__/output1/osmosis/gamm/v2/query.lcd.ts @@ -0,0 +1,34 @@ +import { LCDClient } from "@osmonauts/lcd"; +import { QuerySpotPriceRequest, QuerySpotPriceRequestSDKType, QuerySpotPriceResponse, QuerySpotPriceResponseSDKType } from "./query"; +export class LCDQueryClient { + req: LCDClient; + + constructor({ + requestClient + }: { + requestClient: LCDClient; + }) { + this.req = requestClient; + this.spotPrice = this.spotPrice.bind(this); + } + + /* SpotPrice defines a gRPC query handler that returns the spot price given + a base denomination and a quote denomination. */ + async spotPrice(params: QuerySpotPriceRequest): Promise { + const options: any = { + params: {} + }; + + if (typeof params?.baseAssetDenom !== "undefined") { + options.params.base_asset_denom = params.baseAssetDenom; + } + + if (typeof params?.quoteAssetDenom !== "undefined") { + options.params.quote_asset_denom = params.quoteAssetDenom; + } + + const endpoint = `osmosis/gamm/v2/pools/${params.poolId}/prices`; + return await this.req.get(endpoint, options); + } + +} \ No newline at end of file diff --git a/__fixtures__/output1/osmosis/gamm/v2/query.rpc.Query.ts b/__fixtures__/output1/osmosis/gamm/v2/query.rpc.Query.ts new file mode 100644 index 0000000000..9b6026f705 --- /dev/null +++ b/__fixtures__/output1/osmosis/gamm/v2/query.rpc.Query.ts @@ -0,0 +1,79 @@ +import { Rpc } from "../../../helpers"; +import * as _m0 from "protobufjs/minimal"; +import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; +import { ReactQueryParams } from "../../../react-query"; +import { useQuery } from "@tanstack/react-query"; +import { QuerySpotPriceRequest, QuerySpotPriceRequestSDKType, QuerySpotPriceResponse, QuerySpotPriceResponseSDKType } from "./query"; +export interface Query { + /** + * SpotPrice defines a gRPC query handler that returns the spot price given + * a base denomination and a quote denomination. + */ + spotPrice(request: QuerySpotPriceRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + + constructor(rpc: Rpc) { + this.rpc = rpc; + this.spotPrice = this.spotPrice.bind(this); + } + + spotPrice(request: QuerySpotPriceRequest): Promise { + const data = QuerySpotPriceRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.gamm.v2.Query", "SpotPrice", data); + return promise.then(data => QuerySpotPriceResponse.decode(new _m0.Reader(data))); + } + +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + spotPrice(request: QuerySpotPriceRequest): Promise { + return queryService.spotPrice(request); + } + + }; +}; +export interface UseSpotPriceQuery extends ReactQueryParams { + request: QuerySpotPriceRequest; +} + +const _queryClients: WeakMap = new WeakMap(); + +const getQueryService = (rpc: ProtobufRpcClient | undefined): QueryClientImpl | undefined => { + if (!rpc) return; + + if (_queryClients.has(rpc)) { + return _queryClients.get(rpc); + } + + const queryService = new QueryClientImpl(rpc); + + _queryClients.set(rpc, queryService); + + return queryService; +}; + +export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { + const queryService = getQueryService(rpc); + + const useSpotPrice = ({ + request, + options + }: UseSpotPriceQuery) => { + return useQuery(["spotPriceQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.spotPrice(request); + }, options); + }; + + return { + /** + * SpotPrice defines a gRPC query handler that returns the spot price given + * a base denomination and a quote denomination. + */ + useSpotPrice + }; +}; \ No newline at end of file diff --git a/__fixtures__/output1/osmosis/gamm/v2/query.ts b/__fixtures__/output1/osmosis/gamm/v2/query.ts new file mode 100644 index 0000000000..1475714e68 --- /dev/null +++ b/__fixtures__/output1/osmosis/gamm/v2/query.ts @@ -0,0 +1,206 @@ +import { Long, isSet, DeepPartial } from "../../../helpers"; +import * as _m0 from "protobufjs/minimal"; +export const protobufPackage = "osmosis.gamm.v2"; + +/** + * QuerySpotPriceRequest defines the gRPC request structure for a SpotPrice + * query. + */ +export interface QuerySpotPriceRequest { + poolId: Long; + baseAssetDenom: string; + quoteAssetDenom: string; +} + +/** + * QuerySpotPriceRequest defines the gRPC request structure for a SpotPrice + * query. + */ +export interface QuerySpotPriceRequestSDKType { + pool_id: Long; + base_asset_denom: string; + quote_asset_denom: string; +} + +/** + * QuerySpotPriceResponse defines the gRPC response structure for a SpotPrice + * query. + */ +export interface QuerySpotPriceResponse { + /** String of the Dec. Ex) 10.203uatom */ + spotPrice: string; +} + +/** + * QuerySpotPriceResponse defines the gRPC response structure for a SpotPrice + * query. + */ +export interface QuerySpotPriceResponseSDKType { + spot_price: string; +} + +function createBaseQuerySpotPriceRequest(): QuerySpotPriceRequest { + return { + poolId: Long.UZERO, + baseAssetDenom: "", + quoteAssetDenom: "" + }; +} + +export const QuerySpotPriceRequest = { + encode(message: QuerySpotPriceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.poolId.isZero()) { + writer.uint32(8).uint64(message.poolId); + } + + if (message.baseAssetDenom !== "") { + writer.uint32(18).string(message.baseAssetDenom); + } + + if (message.quoteAssetDenom !== "") { + writer.uint32(26).string(message.quoteAssetDenom); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QuerySpotPriceRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySpotPriceRequest(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.poolId = (reader.uint64() as Long); + break; + + case 2: + message.baseAssetDenom = reader.string(); + break; + + case 3: + message.quoteAssetDenom = reader.string(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): QuerySpotPriceRequest { + return { + poolId: isSet(object.poolId) ? Long.fromValue(object.poolId) : Long.UZERO, + baseAssetDenom: isSet(object.baseAssetDenom) ? String(object.baseAssetDenom) : "", + quoteAssetDenom: isSet(object.quoteAssetDenom) ? String(object.quoteAssetDenom) : "" + }; + }, + + toJSON(message: QuerySpotPriceRequest): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || Long.UZERO).toString()); + message.baseAssetDenom !== undefined && (obj.baseAssetDenom = message.baseAssetDenom); + message.quoteAssetDenom !== undefined && (obj.quoteAssetDenom = message.quoteAssetDenom); + return obj; + }, + + fromPartial(object: DeepPartial): QuerySpotPriceRequest { + const message = createBaseQuerySpotPriceRequest(); + message.poolId = object.poolId !== undefined && object.poolId !== null ? Long.fromValue(object.poolId) : Long.UZERO; + message.baseAssetDenom = object.baseAssetDenom ?? ""; + message.quoteAssetDenom = object.quoteAssetDenom ?? ""; + return message; + }, + + fromSDK(object: QuerySpotPriceRequestSDKType): QuerySpotPriceRequest { + return { + poolId: object?.pool_id, + baseAssetDenom: object?.base_asset_denom, + quoteAssetDenom: object?.quote_asset_denom + }; + }, + + toSDK(message: QuerySpotPriceRequest): QuerySpotPriceRequestSDKType { + const obj: any = {}; + obj.pool_id = message.poolId; + obj.base_asset_denom = message.baseAssetDenom; + obj.quote_asset_denom = message.quoteAssetDenom; + return obj; + } + +}; + +function createBaseQuerySpotPriceResponse(): QuerySpotPriceResponse { + return { + spotPrice: "" + }; +} + +export const QuerySpotPriceResponse = { + encode(message: QuerySpotPriceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.spotPrice !== "") { + writer.uint32(10).string(message.spotPrice); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QuerySpotPriceResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySpotPriceResponse(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.spotPrice = reader.string(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): QuerySpotPriceResponse { + return { + spotPrice: isSet(object.spotPrice) ? String(object.spotPrice) : "" + }; + }, + + toJSON(message: QuerySpotPriceResponse): unknown { + const obj: any = {}; + message.spotPrice !== undefined && (obj.spotPrice = message.spotPrice); + return obj; + }, + + fromPartial(object: DeepPartial): QuerySpotPriceResponse { + const message = createBaseQuerySpotPriceResponse(); + message.spotPrice = object.spotPrice ?? ""; + return message; + }, + + fromSDK(object: QuerySpotPriceResponseSDKType): QuerySpotPriceResponse { + return { + spotPrice: object?.spot_price + }; + }, + + toSDK(message: QuerySpotPriceResponse): QuerySpotPriceResponseSDKType { + const obj: any = {}; + obj.spot_price = message.spotPrice; + return obj; + } + +}; \ No newline at end of file diff --git a/__fixtures__/output1/osmosis/ibc-rate-limit/v1beta1/params.ts b/__fixtures__/output1/osmosis/ibc-rate-limit/v1beta1/params.ts new file mode 100644 index 0000000000..514ef3be79 --- /dev/null +++ b/__fixtures__/output1/osmosis/ibc-rate-limit/v1beta1/params.ts @@ -0,0 +1,82 @@ +import * as _m0 from "protobufjs/minimal"; +import { isSet, DeepPartial } from "../../../helpers"; +export const protobufPackage = "osmosis.ibcratelimit.v1beta1"; + +/** Params defines the parameters for the ibc-rate-limit module. */ +export interface Params { + contractAddress: string; +} + +/** Params defines the parameters for the ibc-rate-limit module. */ +export interface ParamsSDKType { + contract_address: string; +} + +function createBaseParams(): Params { + return { + contractAddress: "" + }; +} + +export const Params = { + encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.contractAddress !== "") { + writer.uint32(10).string(message.contractAddress); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Params { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.contractAddress = reader.string(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): Params { + return { + contractAddress: isSet(object.contractAddress) ? String(object.contractAddress) : "" + }; + }, + + toJSON(message: Params): unknown { + const obj: any = {}; + message.contractAddress !== undefined && (obj.contractAddress = message.contractAddress); + return obj; + }, + + fromPartial(object: DeepPartial): Params { + const message = createBaseParams(); + message.contractAddress = object.contractAddress ?? ""; + return message; + }, + + fromSDK(object: ParamsSDKType): Params { + return { + contractAddress: object?.contract_address + }; + }, + + toSDK(message: Params): ParamsSDKType { + const obj: any = {}; + obj.contract_address = message.contractAddress; + return obj; + } + +}; \ No newline at end of file diff --git a/__fixtures__/output1/osmosis/ibc-rate-limit/v1beta1/query.lcd.ts b/__fixtures__/output1/osmosis/ibc-rate-limit/v1beta1/query.lcd.ts new file mode 100644 index 0000000000..9ba67d2574 --- /dev/null +++ b/__fixtures__/output1/osmosis/ibc-rate-limit/v1beta1/query.lcd.ts @@ -0,0 +1,23 @@ +import { Params, ParamsSDKType } from "./params"; +import { LCDClient } from "@osmonauts/lcd"; +import { QueryParamsRequest, QueryParamsRequestSDKType, QueryParamsResponse, QueryParamsResponseSDKType } from "./query"; +export class LCDQueryClient { + req: LCDClient; + + constructor({ + requestClient + }: { + requestClient: LCDClient; + }) { + this.req = requestClient; + this.params = this.params.bind(this); + } + + /* Params defines a gRPC query method that returns the ibc-rate-limit module's + parameters. */ + async params(_params: QueryParamsRequest = {}): Promise { + const endpoint = `osmosis/ibc-rate-limit/v1beta1/params`; + return await this.req.get(endpoint); + } + +} \ No newline at end of file diff --git a/__fixtures__/output1/osmosis/ibc-rate-limit/v1beta1/query.rpc.Query.ts b/__fixtures__/output1/osmosis/ibc-rate-limit/v1beta1/query.rpc.Query.ts new file mode 100644 index 0000000000..bb957be494 --- /dev/null +++ b/__fixtures__/output1/osmosis/ibc-rate-limit/v1beta1/query.rpc.Query.ts @@ -0,0 +1,82 @@ +import { Params, ParamsSDKType } from "./params"; +import { Rpc } from "../../../helpers"; +import * as _m0 from "protobufjs/minimal"; +import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; +import { ReactQueryParams } from "../../../react-query"; +import { useQuery } from "@tanstack/react-query"; +import { QueryParamsRequest, QueryParamsRequestSDKType, QueryParamsResponse, QueryParamsResponseSDKType } from "./query"; + +/** Query defines the gRPC querier service. */ +export interface Query { + /** + * Params defines a gRPC query method that returns the ibc-rate-limit module's + * parameters. + */ + params(request?: QueryParamsRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + + constructor(rpc: Rpc) { + this.rpc = rpc; + this.params = this.params.bind(this); + } + + params(request: QueryParamsRequest = {}): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.ibcratelimit.v1beta1.Query", "Params", data); + return promise.then(data => QueryParamsResponse.decode(new _m0.Reader(data))); + } + +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + params(request?: QueryParamsRequest): Promise { + return queryService.params(request); + } + + }; +}; +export interface UseParamsQuery extends ReactQueryParams { + request?: QueryParamsRequest; +} + +const _queryClients: WeakMap = new WeakMap(); + +const getQueryService = (rpc: ProtobufRpcClient | undefined): QueryClientImpl | undefined => { + if (!rpc) return; + + if (_queryClients.has(rpc)) { + return _queryClients.get(rpc); + } + + const queryService = new QueryClientImpl(rpc); + + _queryClients.set(rpc, queryService); + + return queryService; +}; + +export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { + const queryService = getQueryService(rpc); + + const useParams = ({ + request, + options + }: UseParamsQuery) => { + return useQuery(["paramsQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.params(request); + }, options); + }; + + return { + /** + * Params defines a gRPC query method that returns the ibc-rate-limit module's + * parameters. + */ + useParams + }; +}; \ No newline at end of file diff --git a/__fixtures__/output1/osmosis/ibc-rate-limit/v1beta1/query.ts b/__fixtures__/output1/osmosis/ibc-rate-limit/v1beta1/query.ts new file mode 100644 index 0000000000..649f313508 --- /dev/null +++ b/__fixtures__/output1/osmosis/ibc-rate-limit/v1beta1/query.ts @@ -0,0 +1,142 @@ +import { Params, ParamsSDKType } from "./params"; +import * as _m0 from "protobufjs/minimal"; +import { DeepPartial, isSet } from "../../../helpers"; +export const protobufPackage = "osmosis.ibcratelimit.v1beta1"; + +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequest {} + +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequestSDKType {} + +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponse { + /** params defines the parameters of the module. */ + params?: Params; +} + +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponseSDKType { + params?: ParamsSDKType; +} + +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} + +export const QueryParamsRequest = { + encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(_: any): QueryParamsRequest { + return {}; + }, + + toJSON(_: QueryParamsRequest): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + + fromSDK(_: QueryParamsRequestSDKType): QueryParamsRequest { + return {}; + }, + + toSDK(_: QueryParamsRequest): QueryParamsRequestSDKType { + const obj: any = {}; + return obj; + } + +}; + +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: undefined + }; +} + +export const QueryParamsResponse = { + encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsResponse(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): QueryParamsResponse { + return { + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined + }; + }, + + toJSON(message: QueryParamsResponse): unknown { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + + fromSDK(object: QueryParamsResponseSDKType): QueryParamsResponse { + return { + params: object.params ? Params.fromSDK(object.params) : undefined + }; + }, + + toSDK(message: QueryParamsResponse): QueryParamsResponseSDKType { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toSDK(message.params) : undefined); + return obj; + } + +}; \ No newline at end of file diff --git a/__fixtures__/output1/osmosis/incentives/gauge.ts b/__fixtures__/output1/osmosis/incentives/gauge.ts index 67ddb0fe29..45132f4c04 100644 --- a/__fixtures__/output1/osmosis/incentives/gauge.ts +++ b/__fixtures__/output1/osmosis/incentives/gauge.ts @@ -61,46 +61,13 @@ export interface Gauge { * duration for which a given denom is locked. */ export interface GaugeSDKType { - /** id is the unique ID of a Gauge */ id: Long; - - /** - * is_perpetual is a flag to show if it's a perpetual or non-perpetual gauge - * Non-perpetual gauges distribute their tokens equally per epoch while the - * gauge is in the active period. Perpetual gauges distribute all their tokens - * at a single time and only distribute their tokens again once the gauge is - * refilled, Intended for use with incentives that get refilled daily. - */ is_perpetual: boolean; - - /** - * distribute_to is where the gauge rewards are distributed to. - * This is queried via lock duration or by timestamp - */ distribute_to?: QueryConditionSDKType; - - /** - * coins is the total amount of coins that have been in the gauge - * Can distribute multiple coin denoms - */ coins: CoinSDKType[]; - - /** start_time is the distribution start time */ start_time?: Date; - - /** - * num_epochs_paid_over is the number of total epochs distribution will be - * completed over - */ num_epochs_paid_over: Long; - - /** - * filled_epochs is the number of epochs distribution has been completed on - * already - */ filled_epochs: Long; - - /** distributed_coins are coins that have been distributed already */ distributed_coins: CoinSDKType[]; } export interface LockableDurationsInfo { @@ -108,7 +75,6 @@ export interface LockableDurationsInfo { lockableDurations: Duration[]; } export interface LockableDurationsInfoSDKType { - /** List of incentivised durations that gauges will pay out to */ lockable_durations: DurationSDKType[]; } diff --git a/__fixtures__/output1/osmosis/incentives/genesis.ts b/__fixtures__/output1/osmosis/incentives/genesis.ts index 71e4330310..5817147eac 100644 --- a/__fixtures__/output1/osmosis/incentives/genesis.ts +++ b/__fixtures__/output1/osmosis/incentives/genesis.ts @@ -34,22 +34,9 @@ export interface GenesisState { * initialized */ export interface GenesisStateSDKType { - /** params are all the parameters of the module */ params?: ParamsSDKType; - - /** gauges are all gauges that should exist at genesis */ gauges: GaugeSDKType[]; - - /** - * lockable_durations are all lockup durations that gauges can be locked for - * in order to recieve incentives - */ lockable_durations: DurationSDKType[]; - - /** - * last_gauge_id is what the gauge number will increment from when creating - * the next gauge after genesis - */ last_gauge_id: Long; } diff --git a/__fixtures__/output1/osmosis/incentives/params.ts b/__fixtures__/output1/osmosis/incentives/params.ts index 5c7d8deda4..04955746b4 100644 --- a/__fixtures__/output1/osmosis/incentives/params.ts +++ b/__fixtures__/output1/osmosis/incentives/params.ts @@ -13,10 +13,6 @@ export interface Params { /** Params holds parameters for the incentives module */ export interface ParamsSDKType { - /** - * distr_epoch_identifier is what epoch type distribution will be triggered by - * (day, week, etc.) - */ distr_epoch_identifier: string; } diff --git a/__fixtures__/output1/osmosis/incentives/query.lcd.ts b/__fixtures__/output1/osmosis/incentives/query.lcd.ts index a398e1d1c0..7ee4b05685 100644 --- a/__fixtures__/output1/osmosis/incentives/query.lcd.ts +++ b/__fixtures__/output1/osmosis/incentives/query.lcd.ts @@ -4,7 +4,7 @@ import { Gauge, GaugeSDKType } from "./gauge"; import { Duration, DurationSDKType } from "../../google/protobuf/duration"; import { setPaginationParams } from "../../helpers"; import { LCDClient } from "@osmonauts/lcd"; -import { ModuleToDistributeCoinsRequest, ModuleToDistributeCoinsRequestSDKType, ModuleToDistributeCoinsResponse, ModuleToDistributeCoinsResponseSDKType, ModuleDistributedCoinsRequest, ModuleDistributedCoinsRequestSDKType, ModuleDistributedCoinsResponse, ModuleDistributedCoinsResponseSDKType, GaugeByIDRequest, GaugeByIDRequestSDKType, GaugeByIDResponse, GaugeByIDResponseSDKType, GaugesRequest, GaugesRequestSDKType, GaugesResponse, GaugesResponseSDKType, ActiveGaugesRequest, ActiveGaugesRequestSDKType, ActiveGaugesResponse, ActiveGaugesResponseSDKType, ActiveGaugesPerDenomRequest, ActiveGaugesPerDenomRequestSDKType, ActiveGaugesPerDenomResponse, ActiveGaugesPerDenomResponseSDKType, UpcomingGaugesRequest, UpcomingGaugesRequestSDKType, UpcomingGaugesResponse, UpcomingGaugesResponseSDKType, UpcomingGaugesPerDenomRequest, UpcomingGaugesPerDenomRequestSDKType, UpcomingGaugesPerDenomResponse, UpcomingGaugesPerDenomResponseSDKType, RewardsEstRequest, RewardsEstRequestSDKType, RewardsEstResponse, RewardsEstResponseSDKType, QueryLockableDurationsRequest, QueryLockableDurationsRequestSDKType, QueryLockableDurationsResponse, QueryLockableDurationsResponseSDKType } from "./query"; +import { ModuleToDistributeCoinsRequest, ModuleToDistributeCoinsRequestSDKType, ModuleToDistributeCoinsResponse, ModuleToDistributeCoinsResponseSDKType, GaugeByIDRequest, GaugeByIDRequestSDKType, GaugeByIDResponse, GaugeByIDResponseSDKType, GaugesRequest, GaugesRequestSDKType, GaugesResponse, GaugesResponseSDKType, ActiveGaugesRequest, ActiveGaugesRequestSDKType, ActiveGaugesResponse, ActiveGaugesResponseSDKType, ActiveGaugesPerDenomRequest, ActiveGaugesPerDenomRequestSDKType, ActiveGaugesPerDenomResponse, ActiveGaugesPerDenomResponseSDKType, UpcomingGaugesRequest, UpcomingGaugesRequestSDKType, UpcomingGaugesResponse, UpcomingGaugesResponseSDKType, UpcomingGaugesPerDenomRequest, UpcomingGaugesPerDenomRequestSDKType, UpcomingGaugesPerDenomResponse, UpcomingGaugesPerDenomResponseSDKType, RewardsEstRequest, RewardsEstRequestSDKType, RewardsEstResponse, RewardsEstResponseSDKType, QueryLockableDurationsRequest, QueryLockableDurationsRequestSDKType, QueryLockableDurationsResponse, QueryLockableDurationsResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; @@ -15,7 +15,6 @@ export class LCDQueryClient { }) { this.req = requestClient; this.moduleToDistributeCoins = this.moduleToDistributeCoins.bind(this); - this.moduleDistributedCoins = this.moduleDistributedCoins.bind(this); this.gaugeByID = this.gaugeByID.bind(this); this.gauges = this.gauges.bind(this); this.activeGauges = this.activeGauges.bind(this); @@ -32,13 +31,6 @@ export class LCDQueryClient { return await this.req.get(endpoint); } - /* ModuleDistributedCoins returns coins that are distributed by the module so - far */ - async moduleDistributedCoins(_params: ModuleDistributedCoinsRequest = {}): Promise { - const endpoint = `osmosis/incentives/v1beta1/module_distributed_coins`; - return await this.req.get(endpoint); - } - /* GaugeByID returns gauges by their respective ID */ async gaugeByID(params: GaugeByIDRequest): Promise { const endpoint = `osmosis/incentives/v1beta1/gauge_by_id/${params.id}`; diff --git a/__fixtures__/output1/osmosis/incentives/query.rpc.Query.ts b/__fixtures__/output1/osmosis/incentives/query.rpc.Query.ts index 688ebba105..4fefdea24b 100644 --- a/__fixtures__/output1/osmosis/incentives/query.rpc.Query.ts +++ b/__fixtures__/output1/osmosis/incentives/query.rpc.Query.ts @@ -7,19 +7,13 @@ import * as _m0 from "protobufjs/minimal"; import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; import { ReactQueryParams } from "../../react-query"; import { useQuery } from "@tanstack/react-query"; -import { ModuleToDistributeCoinsRequest, ModuleToDistributeCoinsRequestSDKType, ModuleToDistributeCoinsResponse, ModuleToDistributeCoinsResponseSDKType, ModuleDistributedCoinsRequest, ModuleDistributedCoinsRequestSDKType, ModuleDistributedCoinsResponse, ModuleDistributedCoinsResponseSDKType, GaugeByIDRequest, GaugeByIDRequestSDKType, GaugeByIDResponse, GaugeByIDResponseSDKType, GaugesRequest, GaugesRequestSDKType, GaugesResponse, GaugesResponseSDKType, ActiveGaugesRequest, ActiveGaugesRequestSDKType, ActiveGaugesResponse, ActiveGaugesResponseSDKType, ActiveGaugesPerDenomRequest, ActiveGaugesPerDenomRequestSDKType, ActiveGaugesPerDenomResponse, ActiveGaugesPerDenomResponseSDKType, UpcomingGaugesRequest, UpcomingGaugesRequestSDKType, UpcomingGaugesResponse, UpcomingGaugesResponseSDKType, UpcomingGaugesPerDenomRequest, UpcomingGaugesPerDenomRequestSDKType, UpcomingGaugesPerDenomResponse, UpcomingGaugesPerDenomResponseSDKType, RewardsEstRequest, RewardsEstRequestSDKType, RewardsEstResponse, RewardsEstResponseSDKType, QueryLockableDurationsRequest, QueryLockableDurationsRequestSDKType, QueryLockableDurationsResponse, QueryLockableDurationsResponseSDKType } from "./query"; +import { ModuleToDistributeCoinsRequest, ModuleToDistributeCoinsRequestSDKType, ModuleToDistributeCoinsResponse, ModuleToDistributeCoinsResponseSDKType, GaugeByIDRequest, GaugeByIDRequestSDKType, GaugeByIDResponse, GaugeByIDResponseSDKType, GaugesRequest, GaugesRequestSDKType, GaugesResponse, GaugesResponseSDKType, ActiveGaugesRequest, ActiveGaugesRequestSDKType, ActiveGaugesResponse, ActiveGaugesResponseSDKType, ActiveGaugesPerDenomRequest, ActiveGaugesPerDenomRequestSDKType, ActiveGaugesPerDenomResponse, ActiveGaugesPerDenomResponseSDKType, UpcomingGaugesRequest, UpcomingGaugesRequestSDKType, UpcomingGaugesResponse, UpcomingGaugesResponseSDKType, UpcomingGaugesPerDenomRequest, UpcomingGaugesPerDenomRequestSDKType, UpcomingGaugesPerDenomResponse, UpcomingGaugesPerDenomResponseSDKType, RewardsEstRequest, RewardsEstRequestSDKType, RewardsEstResponse, RewardsEstResponseSDKType, QueryLockableDurationsRequest, QueryLockableDurationsRequestSDKType, QueryLockableDurationsResponse, QueryLockableDurationsResponseSDKType } from "./query"; /** Query defines the gRPC querier service */ export interface Query { /** ModuleToDistributeCoins returns coins that are going to be distributed */ moduleToDistributeCoins(request?: ModuleToDistributeCoinsRequest): Promise; - /** - * ModuleDistributedCoins returns coins that are distributed by the module so - * far - */ - moduleDistributedCoins(request?: ModuleDistributedCoinsRequest): Promise; - /** GaugeByID returns gauges by their respective ID */ gaugeByID(request: GaugeByIDRequest): Promise; @@ -60,7 +54,6 @@ export class QueryClientImpl implements Query { constructor(rpc: Rpc) { this.rpc = rpc; this.moduleToDistributeCoins = this.moduleToDistributeCoins.bind(this); - this.moduleDistributedCoins = this.moduleDistributedCoins.bind(this); this.gaugeByID = this.gaugeByID.bind(this); this.gauges = this.gauges.bind(this); this.activeGauges = this.activeGauges.bind(this); @@ -77,12 +70,6 @@ export class QueryClientImpl implements Query { return promise.then(data => ModuleToDistributeCoinsResponse.decode(new _m0.Reader(data))); } - moduleDistributedCoins(request: ModuleDistributedCoinsRequest = {}): Promise { - const data = ModuleDistributedCoinsRequest.encode(request).finish(); - const promise = this.rpc.request("osmosis.incentives.Query", "ModuleDistributedCoins", data); - return promise.then(data => ModuleDistributedCoinsResponse.decode(new _m0.Reader(data))); - } - gaugeByID(request: GaugeByIDRequest): Promise { const data = GaugeByIDRequest.encode(request).finish(); const promise = this.rpc.request("osmosis.incentives.Query", "GaugeByID", data); @@ -146,10 +133,6 @@ export const createRpcQueryExtension = (base: QueryClient) => { return queryService.moduleToDistributeCoins(request); }, - moduleDistributedCoins(request?: ModuleDistributedCoinsRequest): Promise { - return queryService.moduleDistributedCoins(request); - }, - gaugeByID(request: GaugeByIDRequest): Promise { return queryService.gaugeByID(request); }, @@ -187,9 +170,6 @@ export const createRpcQueryExtension = (base: QueryClient) => { export interface UseModuleToDistributeCoinsQuery extends ReactQueryParams { request?: ModuleToDistributeCoinsRequest; } -export interface UseModuleDistributedCoinsQuery extends ReactQueryParams { - request?: ModuleDistributedCoinsRequest; -} export interface UseGaugeByIDQuery extends ReactQueryParams { request: GaugeByIDRequest; } @@ -244,16 +224,6 @@ export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { }, options); }; - const useModuleDistributedCoins = ({ - request, - options - }: UseModuleDistributedCoinsQuery) => { - return useQuery(["moduleDistributedCoinsQuery", request], () => { - if (!queryService) throw new Error("Query Service not initialized"); - return queryService.moduleDistributedCoins(request); - }, options); - }; - const useGaugeByID = ({ request, options @@ -338,12 +308,6 @@ export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { /** ModuleToDistributeCoins returns coins that are going to be distributed */ useModuleToDistributeCoins, - /** - * ModuleDistributedCoins returns coins that are distributed by the module so - * far - */ - useModuleDistributedCoins, - /** GaugeByID returns gauges by their respective ID */ useGaugeByID, diff --git a/__fixtures__/output1/osmosis/incentives/query.ts b/__fixtures__/output1/osmosis/incentives/query.ts index 9b53736e77..f7d3cc1d49 100644 --- a/__fixtures__/output1/osmosis/incentives/query.ts +++ b/__fixtures__/output1/osmosis/incentives/query.ts @@ -12,17 +12,6 @@ export interface ModuleToDistributeCoinsResponse { coins: Coin[]; } export interface ModuleToDistributeCoinsResponseSDKType { - /** Coins that have yet to be distributed */ - coins: CoinSDKType[]; -} -export interface ModuleDistributedCoinsRequest {} -export interface ModuleDistributedCoinsRequestSDKType {} -export interface ModuleDistributedCoinsResponse { - /** Coins that have been distributed already */ - coins: Coin[]; -} -export interface ModuleDistributedCoinsResponseSDKType { - /** Coins that have been distributed already */ coins: CoinSDKType[]; } export interface GaugeByIDRequest { @@ -30,7 +19,6 @@ export interface GaugeByIDRequest { id: Long; } export interface GaugeByIDRequestSDKType { - /** Gague ID being queried */ id: Long; } export interface GaugeByIDResponse { @@ -38,7 +26,6 @@ export interface GaugeByIDResponse { gauge?: Gauge; } export interface GaugeByIDResponseSDKType { - /** Gauge that corresponds to provided gague ID */ gauge?: GaugeSDKType; } export interface GaugesRequest { @@ -46,7 +33,6 @@ export interface GaugesRequest { pagination?: PageRequest; } export interface GaugesRequestSDKType { - /** Pagination defines pagination for the request */ pagination?: PageRequestSDKType; } export interface GaugesResponse { @@ -57,10 +43,7 @@ export interface GaugesResponse { pagination?: PageResponse; } export interface GaugesResponseSDKType { - /** Upcoming and active gauges */ data: GaugeSDKType[]; - - /** Pagination defines pagination for the response */ pagination?: PageResponseSDKType; } export interface ActiveGaugesRequest { @@ -68,7 +51,6 @@ export interface ActiveGaugesRequest { pagination?: PageRequest; } export interface ActiveGaugesRequestSDKType { - /** Pagination defines pagination for the request */ pagination?: PageRequestSDKType; } export interface ActiveGaugesResponse { @@ -79,10 +61,7 @@ export interface ActiveGaugesResponse { pagination?: PageResponse; } export interface ActiveGaugesResponseSDKType { - /** Active gagues only */ data: GaugeSDKType[]; - - /** Pagination defines pagination for the response */ pagination?: PageResponseSDKType; } export interface ActiveGaugesPerDenomRequest { @@ -93,10 +72,7 @@ export interface ActiveGaugesPerDenomRequest { pagination?: PageRequest; } export interface ActiveGaugesPerDenomRequestSDKType { - /** Desired denom when querying active gagues */ denom: string; - - /** Pagination defines pagination for the request */ pagination?: PageRequestSDKType; } export interface ActiveGaugesPerDenomResponse { @@ -107,10 +83,7 @@ export interface ActiveGaugesPerDenomResponse { pagination?: PageResponse; } export interface ActiveGaugesPerDenomResponseSDKType { - /** Active gagues that match denom in query */ data: GaugeSDKType[]; - - /** Pagination defines pagination for the response */ pagination?: PageResponseSDKType; } export interface UpcomingGaugesRequest { @@ -118,7 +91,6 @@ export interface UpcomingGaugesRequest { pagination?: PageRequest; } export interface UpcomingGaugesRequestSDKType { - /** Pagination defines pagination for the request */ pagination?: PageRequestSDKType; } export interface UpcomingGaugesResponse { @@ -129,10 +101,7 @@ export interface UpcomingGaugesResponse { pagination?: PageResponse; } export interface UpcomingGaugesResponseSDKType { - /** Gauges whose distribution is upcoming */ data: GaugeSDKType[]; - - /** Pagination defines pagination for the response */ pagination?: PageResponseSDKType; } export interface UpcomingGaugesPerDenomRequest { @@ -143,10 +112,7 @@ export interface UpcomingGaugesPerDenomRequest { pagination?: PageRequest; } export interface UpcomingGaugesPerDenomRequestSDKType { - /** Filter for upcoming gagues that match specific denom */ denom: string; - - /** Pagination defines pagination for the request */ pagination?: PageRequestSDKType; } export interface UpcomingGaugesPerDenomResponse { @@ -157,10 +123,7 @@ export interface UpcomingGaugesPerDenomResponse { pagination?: PageResponse; } export interface UpcomingGaugesPerDenomResponseSDKType { - /** Upcoming gagues that match denom in query */ upcoming_gauges: GaugeSDKType[]; - - /** Pagination defines pagination for the response */ pagination?: PageResponseSDKType; } export interface RewardsEstRequest { @@ -177,16 +140,8 @@ export interface RewardsEstRequest { endEpoch: Long; } export interface RewardsEstRequestSDKType { - /** Address that is being queried for future estimated rewards */ owner: string; - - /** Lock IDs included in future reward estimation */ lock_ids: Long[]; - - /** - * Upper time limit of reward estimation - * Lower limit is current epoch - */ end_epoch: Long; } export interface RewardsEstResponse { @@ -197,10 +152,6 @@ export interface RewardsEstResponse { coins: Coin[]; } export interface RewardsEstResponseSDKType { - /** - * Estimated coin rewards that will be recieved at provided address - * from specified locks between current time and end epoch - */ coins: CoinSDKType[]; } export interface QueryLockableDurationsRequest {} @@ -210,7 +161,6 @@ export interface QueryLockableDurationsResponse { lockableDurations: Duration[]; } export interface QueryLockableDurationsResponseSDKType { - /** Time durations that users can lock coins for in order to recieve rewards */ lockable_durations: DurationSDKType[]; } @@ -347,139 +297,6 @@ export const ModuleToDistributeCoinsResponse = { }; -function createBaseModuleDistributedCoinsRequest(): ModuleDistributedCoinsRequest { - return {}; -} - -export const ModuleDistributedCoinsRequest = { - encode(_: ModuleDistributedCoinsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): ModuleDistributedCoinsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseModuleDistributedCoinsRequest(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(_: any): ModuleDistributedCoinsRequest { - return {}; - }, - - toJSON(_: ModuleDistributedCoinsRequest): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial(_: DeepPartial): ModuleDistributedCoinsRequest { - const message = createBaseModuleDistributedCoinsRequest(); - return message; - }, - - fromSDK(_: ModuleDistributedCoinsRequestSDKType): ModuleDistributedCoinsRequest { - return {}; - }, - - toSDK(_: ModuleDistributedCoinsRequest): ModuleDistributedCoinsRequestSDKType { - const obj: any = {}; - return obj; - } - -}; - -function createBaseModuleDistributedCoinsResponse(): ModuleDistributedCoinsResponse { - return { - coins: [] - }; -} - -export const ModuleDistributedCoinsResponse = { - encode(message: ModuleDistributedCoinsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - for (const v of message.coins) { - Coin.encode(v!, writer.uint32(10).fork()).ldelim(); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): ModuleDistributedCoinsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseModuleDistributedCoinsResponse(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.coins.push(Coin.decode(reader, reader.uint32())); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(object: any): ModuleDistributedCoinsResponse { - return { - coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromJSON(e)) : [] - }; - }, - - toJSON(message: ModuleDistributedCoinsResponse): unknown { - const obj: any = {}; - - if (message.coins) { - obj.coins = message.coins.map(e => e ? Coin.toJSON(e) : undefined); - } else { - obj.coins = []; - } - - return obj; - }, - - fromPartial(object: DeepPartial): ModuleDistributedCoinsResponse { - const message = createBaseModuleDistributedCoinsResponse(); - message.coins = object.coins?.map(e => Coin.fromPartial(e)) || []; - return message; - }, - - fromSDK(object: ModuleDistributedCoinsResponseSDKType): ModuleDistributedCoinsResponse { - return { - coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromSDK(e)) : [] - }; - }, - - toSDK(message: ModuleDistributedCoinsResponse): ModuleDistributedCoinsResponseSDKType { - const obj: any = {}; - - if (message.coins) { - obj.coins = message.coins.map(e => e ? Coin.toSDK(e) : undefined); - } else { - obj.coins = []; - } - - return obj; - } - -}; - function createBaseGaugeByIDRequest(): GaugeByIDRequest { return { id: Long.UZERO diff --git a/__fixtures__/output1/osmosis/incentives/tx.ts b/__fixtures__/output1/osmosis/incentives/tx.ts index a39382b9f1..0c05c8e749 100644 --- a/__fixtures__/output1/osmosis/incentives/tx.ts +++ b/__fixtures__/output1/osmosis/incentives/tx.ts @@ -40,34 +40,11 @@ export interface MsgCreateGauge { /** MsgCreateGauge creates a gague to distribute rewards to users */ export interface MsgCreateGaugeSDKType { - /** - * is_perpetual shows if it's a perpetual or non-perpetual gauge - * Non-perpetual gauges distribute their tokens equally per epoch while the - * gauge is in the active period. Perpetual gauges distribute all their tokens - * at a single time and only distribute their tokens again once the gauge is - * refilled - */ is_perpetual: boolean; - - /** owner is the address of gauge creator */ owner: string; - - /** - * distribute_to show which lock the gauge should distribute to by time - * duration or by timestamp - */ distribute_to?: QueryConditionSDKType; - - /** coins are coin(s) to be distributed by the gauge */ coins: CoinSDKType[]; - - /** start_time is the distribution start time */ start_time?: Date; - - /** - * num_epochs_paid_over is the number of epochs distribution will be completed - * over - */ num_epochs_paid_over: Long; } export interface MsgCreateGaugeResponse {} @@ -87,13 +64,8 @@ export interface MsgAddToGauge { /** MsgAddToGauge adds coins to a previously created gauge */ export interface MsgAddToGaugeSDKType { - /** owner is the gauge owner's address */ owner: string; - - /** gauge_id is the ID of gauge that rewards are getting added to */ gauge_id: Long; - - /** rewards are the coin(s) to add to gauge */ rewards: CoinSDKType[]; } export interface MsgAddToGaugeResponse {} diff --git a/__fixtures__/output1/osmosis/lcd.ts b/__fixtures__/output1/osmosis/lcd.ts index 041ba8c933..e0fdc3c897 100644 --- a/__fixtures__/output1/osmosis/lcd.ts +++ b/__fixtures__/output1/osmosis/lcd.ts @@ -117,6 +117,14 @@ export const createLCDClient = async ({ gamm: { v1beta1: new (await import("./gamm/v1beta1/query.lcd")).LCDQueryClient({ requestClient + }), + v2: new (await import("./gamm/v2/query.lcd")).LCDQueryClient({ + requestClient + }) + }, + ibcratelimit: { + v1beta1: new (await import("./ibc-rate-limit/v1beta1/query.lcd")).LCDQueryClient({ + requestClient }) }, incentives: new (await import("./incentives/query.lcd")).LCDQueryClient({ @@ -135,11 +143,6 @@ export const createLCDClient = async ({ requestClient }) }, - streamswap: { - v1: new (await import("./streamswap/v1/query.lcd")).LCDQueryClient({ - requestClient - }) - }, superfluid: new (await import("./superfluid/query.lcd")).LCDQueryClient({ requestClient }), diff --git a/__fixtures__/output1/osmosis/lockup/lock.ts b/__fixtures__/output1/osmosis/lockup/lock.ts index 7875161291..d8db3440c9 100644 --- a/__fixtures__/output1/osmosis/lockup/lock.ts +++ b/__fixtures__/output1/osmosis/lockup/lock.ts @@ -91,33 +91,10 @@ export interface PeriodLock { * the `duration` has passed since unbonding started. */ export interface PeriodLockSDKType { - /** - * ID is the unique id of the lock. - * The ID of the lock is decided upon lock creation, incrementing by 1 for - * every lock. - */ ID: Long; - - /** - * Owner is the account address of the lock owner. - * Only the owner can modify the state of the lock. - */ owner: string; - - /** - * Duration is the time needed for a lock to mature after unlocking has - * started. - */ duration?: DurationSDKType; - - /** - * EndTime refers to the time at which the lock would mature and get deleted. - * This value is first initialized when an unlock has started for the lock, - * end time being block time + duration. - */ end_time?: Date; - - /** Coins are the tokens locked within the lock, kept in the module account. */ coins: CoinSDKType[]; } @@ -154,24 +131,9 @@ export interface QueryCondition { * LockQueryType. */ export interface QueryConditionSDKType { - /** LockQueryType is a type of lock query, ByLockDuration | ByLockTime */ lock_query_type: LockQueryType; - - /** Denom represents the token denomination we are looking to lock up */ denom: string; - - /** - * Duration is used to query locks with longer duration than the specified - * duration. Duration field must not be nil when the lock query type is - * `ByLockDuration`. - */ duration?: DurationSDKType; - - /** - * Timestamp is used by locks started before the specified duration. - * Timestamp field must not be nil when the lock query type is `ByLockTime`. - * Querying locks with timestamp is currently not implemented. - */ timestamp?: Date; } @@ -214,28 +176,9 @@ export interface SyntheticLock { * they can query as freely as native lockup. */ export interface SyntheticLockSDKType { - /** - * Underlying Lock ID is the underlying native lock's id for this synthetic - * lockup. A synthetic lock MUST have an underlying lock. - */ underlying_lock_id: Long; - - /** - * SynthDenom is the synthetic denom that is a combination of - * gamm share + bonding status + validator address. - */ synth_denom: string; - - /** - * used for unbonding synthetic lockups, for active synthetic lockups, this - * value is set to uninitialized value - */ end_time?: Date; - - /** - * Duration is the duration for a synthetic lock to mature - * at the point of unbonding has started. - */ duration?: DurationSDKType; } diff --git a/__fixtures__/output1/osmosis/lockup/params.ts b/__fixtures__/output1/osmosis/lockup/params.ts new file mode 100644 index 0000000000..1f6b6b2cd9 --- /dev/null +++ b/__fixtures__/output1/osmosis/lockup/params.ts @@ -0,0 +1,90 @@ +import * as _m0 from "protobufjs/minimal"; +import { DeepPartial } from "../../helpers"; +export const protobufPackage = "osmosis.lockup"; +export interface Params { + forceUnlockAllowedAddresses: string[]; +} +export interface ParamsSDKType { + force_unlock_allowed_addresses: string[]; +} + +function createBaseParams(): Params { + return { + forceUnlockAllowedAddresses: [] + }; +} + +export const Params = { + encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.forceUnlockAllowedAddresses) { + writer.uint32(10).string(v!); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Params { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.forceUnlockAllowedAddresses.push(reader.string()); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): Params { + return { + forceUnlockAllowedAddresses: Array.isArray(object?.forceUnlockAllowedAddresses) ? object.forceUnlockAllowedAddresses.map((e: any) => String(e)) : [] + }; + }, + + toJSON(message: Params): unknown { + const obj: any = {}; + + if (message.forceUnlockAllowedAddresses) { + obj.forceUnlockAllowedAddresses = message.forceUnlockAllowedAddresses.map(e => e); + } else { + obj.forceUnlockAllowedAddresses = []; + } + + return obj; + }, + + fromPartial(object: DeepPartial): Params { + const message = createBaseParams(); + message.forceUnlockAllowedAddresses = object.forceUnlockAllowedAddresses?.map(e => e) || []; + return message; + }, + + fromSDK(object: ParamsSDKType): Params { + return { + forceUnlockAllowedAddresses: Array.isArray(object?.force_unlock_allowed_addresses) ? object.force_unlock_allowed_addresses.map((e: any) => e) : [] + }; + }, + + toSDK(message: Params): ParamsSDKType { + const obj: any = {}; + + if (message.forceUnlockAllowedAddresses) { + obj.force_unlock_allowed_addresses = message.forceUnlockAllowedAddresses.map(e => e); + } else { + obj.force_unlock_allowed_addresses = []; + } + + return obj; + } + +}; \ No newline at end of file diff --git a/__fixtures__/output1/osmosis/lockup/query.lcd.ts b/__fixtures__/output1/osmosis/lockup/query.lcd.ts index 71d3015eee..5b56f96b80 100644 --- a/__fixtures__/output1/osmosis/lockup/query.lcd.ts +++ b/__fixtures__/output1/osmosis/lockup/query.lcd.ts @@ -2,8 +2,9 @@ import { Timestamp, TimestampSDKType } from "../../google/protobuf/timestamp"; import { Duration, DurationSDKType } from "../../google/protobuf/duration"; import { Coin, CoinSDKType } from "../../cosmos/base/v1beta1/coin"; import { PeriodLock, PeriodLockSDKType, SyntheticLock, SyntheticLockSDKType } from "./lock"; +import { Params, ParamsSDKType } from "./params"; import { LCDClient } from "@osmonauts/lcd"; -import { ModuleBalanceRequest, ModuleBalanceRequestSDKType, ModuleBalanceResponse, ModuleBalanceResponseSDKType, ModuleLockedAmountRequest, ModuleLockedAmountRequestSDKType, ModuleLockedAmountResponse, ModuleLockedAmountResponseSDKType, AccountUnlockableCoinsRequest, AccountUnlockableCoinsRequestSDKType, AccountUnlockableCoinsResponse, AccountUnlockableCoinsResponseSDKType, AccountUnlockingCoinsRequest, AccountUnlockingCoinsRequestSDKType, AccountUnlockingCoinsResponse, AccountUnlockingCoinsResponseSDKType, AccountLockedCoinsRequest, AccountLockedCoinsRequestSDKType, AccountLockedCoinsResponse, AccountLockedCoinsResponseSDKType, AccountLockedPastTimeRequest, AccountLockedPastTimeRequestSDKType, AccountLockedPastTimeResponse, AccountLockedPastTimeResponseSDKType, AccountLockedPastTimeNotUnlockingOnlyRequest, AccountLockedPastTimeNotUnlockingOnlyRequestSDKType, AccountLockedPastTimeNotUnlockingOnlyResponse, AccountLockedPastTimeNotUnlockingOnlyResponseSDKType, AccountUnlockedBeforeTimeRequest, AccountUnlockedBeforeTimeRequestSDKType, AccountUnlockedBeforeTimeResponse, AccountUnlockedBeforeTimeResponseSDKType, AccountLockedPastTimeDenomRequest, AccountLockedPastTimeDenomRequestSDKType, AccountLockedPastTimeDenomResponse, AccountLockedPastTimeDenomResponseSDKType, LockedDenomRequest, LockedDenomRequestSDKType, LockedDenomResponse, LockedDenomResponseSDKType, LockedRequest, LockedRequestSDKType, LockedResponse, LockedResponseSDKType, SyntheticLockupsByLockupIDRequest, SyntheticLockupsByLockupIDRequestSDKType, SyntheticLockupsByLockupIDResponse, SyntheticLockupsByLockupIDResponseSDKType, AccountLockedLongerDurationRequest, AccountLockedLongerDurationRequestSDKType, AccountLockedLongerDurationResponse, AccountLockedLongerDurationResponseSDKType, AccountLockedDurationRequest, AccountLockedDurationRequestSDKType, AccountLockedDurationResponse, AccountLockedDurationResponseSDKType, AccountLockedLongerDurationNotUnlockingOnlyRequest, AccountLockedLongerDurationNotUnlockingOnlyRequestSDKType, AccountLockedLongerDurationNotUnlockingOnlyResponse, AccountLockedLongerDurationNotUnlockingOnlyResponseSDKType, AccountLockedLongerDurationDenomRequest, AccountLockedLongerDurationDenomRequestSDKType, AccountLockedLongerDurationDenomResponse, AccountLockedLongerDurationDenomResponseSDKType } from "./query"; +import { ModuleBalanceRequest, ModuleBalanceRequestSDKType, ModuleBalanceResponse, ModuleBalanceResponseSDKType, ModuleLockedAmountRequest, ModuleLockedAmountRequestSDKType, ModuleLockedAmountResponse, ModuleLockedAmountResponseSDKType, AccountUnlockableCoinsRequest, AccountUnlockableCoinsRequestSDKType, AccountUnlockableCoinsResponse, AccountUnlockableCoinsResponseSDKType, AccountUnlockingCoinsRequest, AccountUnlockingCoinsRequestSDKType, AccountUnlockingCoinsResponse, AccountUnlockingCoinsResponseSDKType, AccountLockedCoinsRequest, AccountLockedCoinsRequestSDKType, AccountLockedCoinsResponse, AccountLockedCoinsResponseSDKType, AccountLockedPastTimeRequest, AccountLockedPastTimeRequestSDKType, AccountLockedPastTimeResponse, AccountLockedPastTimeResponseSDKType, AccountLockedPastTimeNotUnlockingOnlyRequest, AccountLockedPastTimeNotUnlockingOnlyRequestSDKType, AccountLockedPastTimeNotUnlockingOnlyResponse, AccountLockedPastTimeNotUnlockingOnlyResponseSDKType, AccountUnlockedBeforeTimeRequest, AccountUnlockedBeforeTimeRequestSDKType, AccountUnlockedBeforeTimeResponse, AccountUnlockedBeforeTimeResponseSDKType, AccountLockedPastTimeDenomRequest, AccountLockedPastTimeDenomRequestSDKType, AccountLockedPastTimeDenomResponse, AccountLockedPastTimeDenomResponseSDKType, LockedDenomRequest, LockedDenomRequestSDKType, LockedDenomResponse, LockedDenomResponseSDKType, LockedRequest, LockedRequestSDKType, LockedResponse, LockedResponseSDKType, SyntheticLockupsByLockupIDRequest, SyntheticLockupsByLockupIDRequestSDKType, SyntheticLockupsByLockupIDResponse, SyntheticLockupsByLockupIDResponseSDKType, AccountLockedLongerDurationRequest, AccountLockedLongerDurationRequestSDKType, AccountLockedLongerDurationResponse, AccountLockedLongerDurationResponseSDKType, AccountLockedDurationRequest, AccountLockedDurationRequestSDKType, AccountLockedDurationResponse, AccountLockedDurationResponseSDKType, AccountLockedLongerDurationNotUnlockingOnlyRequest, AccountLockedLongerDurationNotUnlockingOnlyRequestSDKType, AccountLockedLongerDurationNotUnlockingOnlyResponse, AccountLockedLongerDurationNotUnlockingOnlyResponseSDKType, AccountLockedLongerDurationDenomRequest, AccountLockedLongerDurationDenomRequestSDKType, AccountLockedLongerDurationDenomResponse, AccountLockedLongerDurationDenomResponseSDKType, QueryParamsRequest, QueryParamsRequestSDKType, QueryParamsResponse, QueryParamsResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; @@ -29,6 +30,7 @@ export class LCDQueryClient { this.accountLockedDuration = this.accountLockedDuration.bind(this); this.accountLockedLongerDurationNotUnlockingOnly = this.accountLockedLongerDurationNotUnlockingOnly.bind(this); this.accountLockedLongerDurationDenom = this.accountLockedLongerDurationDenom.bind(this); + this.params = this.params.bind(this); } /* Return full balance of the module */ @@ -213,4 +215,10 @@ export class LCDQueryClient { return await this.req.get(endpoint, options); } + /* Params returns lockup params. */ + async params(_params: QueryParamsRequest = {}): Promise { + const endpoint = `osmosis/lockup/v1beta1/params`; + return await this.req.get(endpoint); + } + } \ No newline at end of file diff --git a/__fixtures__/output1/osmosis/lockup/query.rpc.Query.ts b/__fixtures__/output1/osmosis/lockup/query.rpc.Query.ts index 93e2e7ae99..db2de0d446 100644 --- a/__fixtures__/output1/osmosis/lockup/query.rpc.Query.ts +++ b/__fixtures__/output1/osmosis/lockup/query.rpc.Query.ts @@ -2,12 +2,13 @@ import { Timestamp, TimestampSDKType } from "../../google/protobuf/timestamp"; import { Duration, DurationSDKType } from "../../google/protobuf/duration"; import { Coin, CoinSDKType } from "../../cosmos/base/v1beta1/coin"; import { PeriodLock, PeriodLockSDKType, SyntheticLock, SyntheticLockSDKType } from "./lock"; +import { Params, ParamsSDKType } from "./params"; import { Rpc } from "../../helpers"; import * as _m0 from "protobufjs/minimal"; import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; import { ReactQueryParams } from "../../react-query"; import { useQuery } from "@tanstack/react-query"; -import { ModuleBalanceRequest, ModuleBalanceRequestSDKType, ModuleBalanceResponse, ModuleBalanceResponseSDKType, ModuleLockedAmountRequest, ModuleLockedAmountRequestSDKType, ModuleLockedAmountResponse, ModuleLockedAmountResponseSDKType, AccountUnlockableCoinsRequest, AccountUnlockableCoinsRequestSDKType, AccountUnlockableCoinsResponse, AccountUnlockableCoinsResponseSDKType, AccountUnlockingCoinsRequest, AccountUnlockingCoinsRequestSDKType, AccountUnlockingCoinsResponse, AccountUnlockingCoinsResponseSDKType, AccountLockedCoinsRequest, AccountLockedCoinsRequestSDKType, AccountLockedCoinsResponse, AccountLockedCoinsResponseSDKType, AccountLockedPastTimeRequest, AccountLockedPastTimeRequestSDKType, AccountLockedPastTimeResponse, AccountLockedPastTimeResponseSDKType, AccountLockedPastTimeNotUnlockingOnlyRequest, AccountLockedPastTimeNotUnlockingOnlyRequestSDKType, AccountLockedPastTimeNotUnlockingOnlyResponse, AccountLockedPastTimeNotUnlockingOnlyResponseSDKType, AccountUnlockedBeforeTimeRequest, AccountUnlockedBeforeTimeRequestSDKType, AccountUnlockedBeforeTimeResponse, AccountUnlockedBeforeTimeResponseSDKType, AccountLockedPastTimeDenomRequest, AccountLockedPastTimeDenomRequestSDKType, AccountLockedPastTimeDenomResponse, AccountLockedPastTimeDenomResponseSDKType, LockedDenomRequest, LockedDenomRequestSDKType, LockedDenomResponse, LockedDenomResponseSDKType, LockedRequest, LockedRequestSDKType, LockedResponse, LockedResponseSDKType, SyntheticLockupsByLockupIDRequest, SyntheticLockupsByLockupIDRequestSDKType, SyntheticLockupsByLockupIDResponse, SyntheticLockupsByLockupIDResponseSDKType, AccountLockedLongerDurationRequest, AccountLockedLongerDurationRequestSDKType, AccountLockedLongerDurationResponse, AccountLockedLongerDurationResponseSDKType, AccountLockedDurationRequest, AccountLockedDurationRequestSDKType, AccountLockedDurationResponse, AccountLockedDurationResponseSDKType, AccountLockedLongerDurationNotUnlockingOnlyRequest, AccountLockedLongerDurationNotUnlockingOnlyRequestSDKType, AccountLockedLongerDurationNotUnlockingOnlyResponse, AccountLockedLongerDurationNotUnlockingOnlyResponseSDKType, AccountLockedLongerDurationDenomRequest, AccountLockedLongerDurationDenomRequestSDKType, AccountLockedLongerDurationDenomResponse, AccountLockedLongerDurationDenomResponseSDKType } from "./query"; +import { ModuleBalanceRequest, ModuleBalanceRequestSDKType, ModuleBalanceResponse, ModuleBalanceResponseSDKType, ModuleLockedAmountRequest, ModuleLockedAmountRequestSDKType, ModuleLockedAmountResponse, ModuleLockedAmountResponseSDKType, AccountUnlockableCoinsRequest, AccountUnlockableCoinsRequestSDKType, AccountUnlockableCoinsResponse, AccountUnlockableCoinsResponseSDKType, AccountUnlockingCoinsRequest, AccountUnlockingCoinsRequestSDKType, AccountUnlockingCoinsResponse, AccountUnlockingCoinsResponseSDKType, AccountLockedCoinsRequest, AccountLockedCoinsRequestSDKType, AccountLockedCoinsResponse, AccountLockedCoinsResponseSDKType, AccountLockedPastTimeRequest, AccountLockedPastTimeRequestSDKType, AccountLockedPastTimeResponse, AccountLockedPastTimeResponseSDKType, AccountLockedPastTimeNotUnlockingOnlyRequest, AccountLockedPastTimeNotUnlockingOnlyRequestSDKType, AccountLockedPastTimeNotUnlockingOnlyResponse, AccountLockedPastTimeNotUnlockingOnlyResponseSDKType, AccountUnlockedBeforeTimeRequest, AccountUnlockedBeforeTimeRequestSDKType, AccountUnlockedBeforeTimeResponse, AccountUnlockedBeforeTimeResponseSDKType, AccountLockedPastTimeDenomRequest, AccountLockedPastTimeDenomRequestSDKType, AccountLockedPastTimeDenomResponse, AccountLockedPastTimeDenomResponseSDKType, LockedDenomRequest, LockedDenomRequestSDKType, LockedDenomResponse, LockedDenomResponseSDKType, LockedRequest, LockedRequestSDKType, LockedResponse, LockedResponseSDKType, SyntheticLockupsByLockupIDRequest, SyntheticLockupsByLockupIDRequestSDKType, SyntheticLockupsByLockupIDResponse, SyntheticLockupsByLockupIDResponseSDKType, AccountLockedLongerDurationRequest, AccountLockedLongerDurationRequestSDKType, AccountLockedLongerDurationResponse, AccountLockedLongerDurationResponseSDKType, AccountLockedDurationRequest, AccountLockedDurationRequestSDKType, AccountLockedDurationResponse, AccountLockedDurationResponseSDKType, AccountLockedLongerDurationNotUnlockingOnlyRequest, AccountLockedLongerDurationNotUnlockingOnlyRequestSDKType, AccountLockedLongerDurationNotUnlockingOnlyResponse, AccountLockedLongerDurationNotUnlockingOnlyResponseSDKType, AccountLockedLongerDurationDenomRequest, AccountLockedLongerDurationDenomRequestSDKType, AccountLockedLongerDurationDenomResponse, AccountLockedLongerDurationDenomResponseSDKType, QueryParamsRequest, QueryParamsRequestSDKType, QueryParamsResponse, QueryParamsResponseSDKType } from "./query"; /** Query defines the gRPC querier service. */ export interface Query { @@ -64,6 +65,9 @@ export interface Query { /** Returns account's locked records for a denom with longer duration */ accountLockedLongerDurationDenom(request: AccountLockedLongerDurationDenomRequest): Promise; + + /** Params returns lockup params. */ + params(request?: QueryParamsRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; @@ -86,6 +90,7 @@ export class QueryClientImpl implements Query { this.accountLockedDuration = this.accountLockedDuration.bind(this); this.accountLockedLongerDurationNotUnlockingOnly = this.accountLockedLongerDurationNotUnlockingOnly.bind(this); this.accountLockedLongerDurationDenom = this.accountLockedLongerDurationDenom.bind(this); + this.params = this.params.bind(this); } moduleBalance(request: ModuleBalanceRequest = {}): Promise { @@ -184,6 +189,12 @@ export class QueryClientImpl implements Query { return promise.then(data => AccountLockedLongerDurationDenomResponse.decode(new _m0.Reader(data))); } + params(request: QueryParamsRequest = {}): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.lockup.Query", "Params", data); + return promise.then(data => QueryParamsResponse.decode(new _m0.Reader(data))); + } + } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); @@ -251,6 +262,10 @@ export const createRpcQueryExtension = (base: QueryClient) => { accountLockedLongerDurationDenom(request: AccountLockedLongerDurationDenomRequest): Promise { return queryService.accountLockedLongerDurationDenom(request); + }, + + params(request?: QueryParamsRequest): Promise { + return queryService.params(request); } }; @@ -303,6 +318,9 @@ export interface UseAccountLockedLongerDurationNotUnlockingOnlyQuery exte export interface UseAccountLockedLongerDurationDenomQuery extends ReactQueryParams { request: AccountLockedLongerDurationDenomRequest; } +export interface UseParamsQuery extends ReactQueryParams { + request?: QueryParamsRequest; +} const _queryClients: WeakMap = new WeakMap(); @@ -483,6 +501,16 @@ export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { }, options); }; + const useParams = ({ + request, + options + }: UseParamsQuery) => { + return useQuery(["paramsQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.params(request); + }, options); + }; + return { /** Return full balance of the module */ useModuleBalance, @@ -536,6 +564,9 @@ export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { useAccountLockedLongerDurationNotUnlockingOnly, /** Returns account's locked records for a denom with longer duration */ - useAccountLockedLongerDurationDenom + useAccountLockedLongerDurationDenom, + + /** Params returns lockup params. */ + useParams }; }; \ No newline at end of file diff --git a/__fixtures__/output1/osmosis/lockup/query.ts b/__fixtures__/output1/osmosis/lockup/query.ts index 9c63025c6a..7e53feb5ab 100644 --- a/__fixtures__/output1/osmosis/lockup/query.ts +++ b/__fixtures__/output1/osmosis/lockup/query.ts @@ -2,6 +2,7 @@ import { Timestamp, TimestampSDKType } from "../../google/protobuf/timestamp"; import { Duration, DurationSDKType } from "../../google/protobuf/duration"; import { Coin, CoinSDKType } from "../../cosmos/base/v1beta1/coin"; import { PeriodLock, PeriodLockSDKType, SyntheticLock, SyntheticLockSDKType } from "./lock"; +import { Params, ParamsSDKType } from "./params"; import * as _m0 from "protobufjs/minimal"; import { DeepPartial, isSet, toTimestamp, fromTimestamp, fromJsonTimestamp, Long } from "../../helpers"; export const protobufPackage = "osmosis.lockup"; @@ -211,6 +212,14 @@ export interface AccountLockedLongerDurationDenomResponse { export interface AccountLockedLongerDurationDenomResponseSDKType { locks: PeriodLockSDKType[]; } +export interface QueryParamsRequest {} +export interface QueryParamsRequestSDKType {} +export interface QueryParamsResponse { + params?: Params; +} +export interface QueryParamsResponseSDKType { + params?: ParamsSDKType; +} function createBaseModuleBalanceRequest(): ModuleBalanceRequest { return {}; @@ -2706,4 +2715,125 @@ export const AccountLockedLongerDurationDenomResponse = { return obj; } +}; + +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} + +export const QueryParamsRequest = { + encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(_: any): QueryParamsRequest { + return {}; + }, + + toJSON(_: QueryParamsRequest): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + }, + + fromSDK(_: QueryParamsRequestSDKType): QueryParamsRequest { + return {}; + }, + + toSDK(_: QueryParamsRequest): QueryParamsRequestSDKType { + const obj: any = {}; + return obj; + } + +}; + +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: undefined + }; +} + +export const QueryParamsResponse = { + encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsResponse(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): QueryParamsResponse { + return { + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined + }; + }, + + toJSON(message: QueryParamsResponse): unknown { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + }, + + fromSDK(object: QueryParamsResponseSDKType): QueryParamsResponse { + return { + params: object.params ? Params.fromSDK(object.params) : undefined + }; + }, + + toSDK(message: QueryParamsResponse): QueryParamsResponseSDKType { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toSDK(message.params) : undefined); + return obj; + } + }; \ No newline at end of file diff --git a/__fixtures__/output1/osmosis/lockup/tx.amino.ts b/__fixtures__/output1/osmosis/lockup/tx.amino.ts index 58d4a81083..83d57c67ce 100644 --- a/__fixtures__/output1/osmosis/lockup/tx.amino.ts +++ b/__fixtures__/output1/osmosis/lockup/tx.amino.ts @@ -4,7 +4,7 @@ import { Coin, CoinSDKType } from "../../cosmos/base/v1beta1/coin"; import { PeriodLock, PeriodLockSDKType } from "./lock"; import { AminoMsg } from "@cosmjs/amino"; import { Long } from "../../helpers"; -import { MsgLockTokens, MsgLockTokensSDKType, MsgBeginUnlockingAll, MsgBeginUnlockingAllSDKType, MsgBeginUnlocking, MsgBeginUnlockingSDKType, MsgExtendLockup, MsgExtendLockupSDKType } from "./tx"; +import { MsgLockTokens, MsgLockTokensSDKType, MsgBeginUnlockingAll, MsgBeginUnlockingAllSDKType, MsgBeginUnlocking, MsgBeginUnlockingSDKType, MsgExtendLockup, MsgExtendLockupSDKType, MsgForceUnlock, MsgForceUnlockSDKType } from "./tx"; export interface AminoMsgLockTokens extends AminoMsg { type: "osmosis/lockup/lock-tokens"; value: { @@ -20,13 +20,13 @@ export interface AminoMsgLockTokens extends AminoMsg { }; } export interface AminoMsgBeginUnlockingAll extends AminoMsg { - type: "osmosis/lockup/begin-unlocking-all"; + type: "osmosis/lockup/begin-unlock-tokens"; value: { owner: string; }; } export interface AminoMsgBeginUnlocking extends AminoMsg { - type: "osmosis/lockup/begin-unlocking"; + type: "osmosis/lockup/begin-unlock-period-lock"; value: { owner: string; ID: string; @@ -47,6 +47,17 @@ export interface AminoMsgExtendLockup extends AminoMsg { }; }; } +export interface AminoMsgForceUnlock extends AminoMsg { + type: "osmosis/lockup/force-unlock"; + value: { + owner: string; + ID: string; + coins: { + denom: string; + amount: string; + }[]; + }; +} export const AminoConverter = { "/osmosis.lockup.MsgLockTokens": { aminoType: "osmosis/lockup/lock-tokens", @@ -83,7 +94,7 @@ export const AminoConverter = { } }, "/osmosis.lockup.MsgBeginUnlockingAll": { - aminoType: "osmosis/lockup/begin-unlocking-all", + aminoType: "osmosis/lockup/begin-unlock-tokens", toAmino: ({ owner }: MsgBeginUnlockingAll): AminoMsgBeginUnlockingAll["value"] => { @@ -100,7 +111,7 @@ export const AminoConverter = { } }, "/osmosis.lockup.MsgBeginUnlocking": { - aminoType: "osmosis/lockup/begin-unlocking", + aminoType: "osmosis/lockup/begin-unlock-period-lock", toAmino: ({ owner, ID, @@ -157,5 +168,36 @@ export const AminoConverter = { } }; } + }, + "/osmosis.lockup.MsgForceUnlock": { + aminoType: "osmosis/lockup/force-unlock", + toAmino: ({ + owner, + ID, + coins + }: MsgForceUnlock): AminoMsgForceUnlock["value"] => { + return { + owner, + ID: ID.toString(), + coins: coins.map(el0 => ({ + denom: el0.denom, + amount: el0.amount + })) + }; + }, + fromAmino: ({ + owner, + ID, + coins + }: AminoMsgForceUnlock["value"]): MsgForceUnlock => { + return { + owner, + ID: Long.fromString(ID), + coins: coins.map(el0 => ({ + denom: el0.denom, + amount: el0.amount + })) + }; + } } }; \ No newline at end of file diff --git a/__fixtures__/output1/osmosis/lockup/tx.registry.ts b/__fixtures__/output1/osmosis/lockup/tx.registry.ts index e471a4de12..d7919e0f61 100644 --- a/__fixtures__/output1/osmosis/lockup/tx.registry.ts +++ b/__fixtures__/output1/osmosis/lockup/tx.registry.ts @@ -2,8 +2,8 @@ import { Duration, DurationSDKType } from "../../google/protobuf/duration"; import { Coin, CoinSDKType } from "../../cosmos/base/v1beta1/coin"; import { PeriodLock, PeriodLockSDKType } from "./lock"; import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgLockTokens, MsgLockTokensSDKType, MsgBeginUnlockingAll, MsgBeginUnlockingAllSDKType, MsgBeginUnlocking, MsgBeginUnlockingSDKType, MsgExtendLockup, MsgExtendLockupSDKType } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/osmosis.lockup.MsgLockTokens", MsgLockTokens], ["/osmosis.lockup.MsgBeginUnlockingAll", MsgBeginUnlockingAll], ["/osmosis.lockup.MsgBeginUnlocking", MsgBeginUnlocking], ["/osmosis.lockup.MsgExtendLockup", MsgExtendLockup]]; +import { MsgLockTokens, MsgLockTokensSDKType, MsgBeginUnlockingAll, MsgBeginUnlockingAllSDKType, MsgBeginUnlocking, MsgBeginUnlockingSDKType, MsgExtendLockup, MsgExtendLockupSDKType, MsgForceUnlock, MsgForceUnlockSDKType } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/osmosis.lockup.MsgLockTokens", MsgLockTokens], ["/osmosis.lockup.MsgBeginUnlockingAll", MsgBeginUnlockingAll], ["/osmosis.lockup.MsgBeginUnlocking", MsgBeginUnlocking], ["/osmosis.lockup.MsgExtendLockup", MsgExtendLockup], ["/osmosis.lockup.MsgForceUnlock", MsgForceUnlock]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -37,6 +37,13 @@ export const MessageComposer = { typeUrl: "/osmosis.lockup.MsgExtendLockup", value: MsgExtendLockup.encode(value).finish() }; + }, + + forceUnlock(value: MsgForceUnlock) { + return { + typeUrl: "/osmosis.lockup.MsgForceUnlock", + value: MsgForceUnlock.encode(value).finish() + }; } }, @@ -67,6 +74,13 @@ export const MessageComposer = { typeUrl: "/osmosis.lockup.MsgExtendLockup", value }; + }, + + forceUnlock(value: MsgForceUnlock) { + return { + typeUrl: "/osmosis.lockup.MsgForceUnlock", + value + }; } }, @@ -97,6 +111,13 @@ export const MessageComposer = { typeUrl: "/osmosis.lockup.MsgExtendLockup", value: MsgExtendLockup.toJSON(value) }; + }, + + forceUnlock(value: MsgForceUnlock) { + return { + typeUrl: "/osmosis.lockup.MsgForceUnlock", + value: MsgForceUnlock.toJSON(value) + }; } }, @@ -127,6 +148,13 @@ export const MessageComposer = { typeUrl: "/osmosis.lockup.MsgExtendLockup", value: MsgExtendLockup.fromJSON(value) }; + }, + + forceUnlock(value: any) { + return { + typeUrl: "/osmosis.lockup.MsgForceUnlock", + value: MsgForceUnlock.fromJSON(value) + }; } }, @@ -157,6 +185,13 @@ export const MessageComposer = { typeUrl: "/osmosis.lockup.MsgExtendLockup", value: MsgExtendLockup.fromPartial(value) }; + }, + + forceUnlock(value: MsgForceUnlock) { + return { + typeUrl: "/osmosis.lockup.MsgForceUnlock", + value: MsgForceUnlock.fromPartial(value) + }; } } diff --git a/__fixtures__/output1/osmosis/lockup/tx.rpc.msg.ts b/__fixtures__/output1/osmosis/lockup/tx.rpc.msg.ts index 05aee00853..05fbb0bc9e 100644 --- a/__fixtures__/output1/osmosis/lockup/tx.rpc.msg.ts +++ b/__fixtures__/output1/osmosis/lockup/tx.rpc.msg.ts @@ -3,7 +3,7 @@ import { Coin, CoinSDKType } from "../../cosmos/base/v1beta1/coin"; import { PeriodLock, PeriodLockSDKType } from "./lock"; import { Rpc } from "../../helpers"; import * as _m0 from "protobufjs/minimal"; -import { MsgLockTokens, MsgLockTokensSDKType, MsgLockTokensResponse, MsgLockTokensResponseSDKType, MsgBeginUnlockingAll, MsgBeginUnlockingAllSDKType, MsgBeginUnlockingAllResponse, MsgBeginUnlockingAllResponseSDKType, MsgBeginUnlocking, MsgBeginUnlockingSDKType, MsgBeginUnlockingResponse, MsgBeginUnlockingResponseSDKType, MsgExtendLockup, MsgExtendLockupSDKType, MsgExtendLockupResponse, MsgExtendLockupResponseSDKType } from "./tx"; +import { MsgLockTokens, MsgLockTokensSDKType, MsgLockTokensResponse, MsgLockTokensResponseSDKType, MsgBeginUnlockingAll, MsgBeginUnlockingAllSDKType, MsgBeginUnlockingAllResponse, MsgBeginUnlockingAllResponseSDKType, MsgBeginUnlocking, MsgBeginUnlockingSDKType, MsgBeginUnlockingResponse, MsgBeginUnlockingResponseSDKType, MsgExtendLockup, MsgExtendLockupSDKType, MsgExtendLockupResponse, MsgExtendLockupResponseSDKType, MsgForceUnlock, MsgForceUnlockSDKType, MsgForceUnlockResponse, MsgForceUnlockResponseSDKType } from "./tx"; /** Msg defines the Msg service. */ export interface Msg { @@ -18,6 +18,7 @@ export interface Msg { /** MsgEditLockup edits the existing lockups by lock ID */ extendLockup(request: MsgExtendLockup): Promise; + forceUnlock(request: MsgForceUnlock): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; @@ -28,6 +29,7 @@ export class MsgClientImpl implements Msg { this.beginUnlockingAll = this.beginUnlockingAll.bind(this); this.beginUnlocking = this.beginUnlocking.bind(this); this.extendLockup = this.extendLockup.bind(this); + this.forceUnlock = this.forceUnlock.bind(this); } lockTokens(request: MsgLockTokens): Promise { @@ -54,4 +56,10 @@ export class MsgClientImpl implements Msg { return promise.then(data => MsgExtendLockupResponse.decode(new _m0.Reader(data))); } + forceUnlock(request: MsgForceUnlock): Promise { + const data = MsgForceUnlock.encode(request).finish(); + const promise = this.rpc.request("osmosis.lockup.Msg", "ForceUnlock", data); + return promise.then(data => MsgForceUnlockResponse.decode(new _m0.Reader(data))); + } + } \ No newline at end of file diff --git a/__fixtures__/output1/osmosis/lockup/tx.ts b/__fixtures__/output1/osmosis/lockup/tx.ts index 6d3007ebb5..21375842ed 100644 --- a/__fixtures__/output1/osmosis/lockup/tx.ts +++ b/__fixtures__/output1/osmosis/lockup/tx.ts @@ -42,8 +42,6 @@ export interface MsgBeginUnlocking { export interface MsgBeginUnlockingSDKType { owner: string; ID: Long; - - /** Amount of unlocking coins. Unlock all if not set. */ coins: CoinSDKType[]; } export interface MsgBeginUnlockingResponse { @@ -75,11 +73,6 @@ export interface MsgExtendLockup { export interface MsgExtendLockupSDKType { owner: string; ID: Long; - - /** - * duration to be set. fails if lower than the current duration, or is - * unlocking - */ duration?: DurationSDKType; } export interface MsgExtendLockupResponse { @@ -89,6 +82,34 @@ export interface MsgExtendLockupResponseSDKType { success: boolean; } +/** + * MsgForceUnlock unlocks locks immediately for + * addresses registered via governance. + */ +export interface MsgForceUnlock { + owner: string; + ID: Long; + + /** Amount of unlocking coins. Unlock all if not set. */ + coins: Coin[]; +} + +/** + * MsgForceUnlock unlocks locks immediately for + * addresses registered via governance. + */ +export interface MsgForceUnlockSDKType { + owner: string; + ID: Long; + coins: CoinSDKType[]; +} +export interface MsgForceUnlockResponse { + success: boolean; +} +export interface MsgForceUnlockResponseSDKType { + success: boolean; +} + function createBaseMsgLockTokens(): MsgLockTokens { return { owner: "", @@ -759,4 +780,182 @@ export const MsgExtendLockupResponse = { return obj; } +}; + +function createBaseMsgForceUnlock(): MsgForceUnlock { + return { + owner: "", + ID: Long.UZERO, + coins: [] + }; +} + +export const MsgForceUnlock = { + encode(message: MsgForceUnlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.owner !== "") { + writer.uint32(10).string(message.owner); + } + + if (!message.ID.isZero()) { + writer.uint32(16).uint64(message.ID); + } + + for (const v of message.coins) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgForceUnlock { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgForceUnlock(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.owner = reader.string(); + break; + + case 2: + message.ID = (reader.uint64() as Long); + break; + + case 3: + message.coins.push(Coin.decode(reader, reader.uint32())); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): MsgForceUnlock { + return { + owner: isSet(object.owner) ? String(object.owner) : "", + ID: isSet(object.ID) ? Long.fromValue(object.ID) : Long.UZERO, + coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + + toJSON(message: MsgForceUnlock): unknown { + const obj: any = {}; + message.owner !== undefined && (obj.owner = message.owner); + message.ID !== undefined && (obj.ID = (message.ID || Long.UZERO).toString()); + + if (message.coins) { + obj.coins = message.coins.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.coins = []; + } + + return obj; + }, + + fromPartial(object: DeepPartial): MsgForceUnlock { + const message = createBaseMsgForceUnlock(); + message.owner = object.owner ?? ""; + message.ID = object.ID !== undefined && object.ID !== null ? Long.fromValue(object.ID) : Long.UZERO; + message.coins = object.coins?.map(e => Coin.fromPartial(e)) || []; + return message; + }, + + fromSDK(object: MsgForceUnlockSDKType): MsgForceUnlock { + return { + owner: object?.owner, + ID: object?.ID, + coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromSDK(e)) : [] + }; + }, + + toSDK(message: MsgForceUnlock): MsgForceUnlockSDKType { + const obj: any = {}; + obj.owner = message.owner; + obj.ID = message.ID; + + if (message.coins) { + obj.coins = message.coins.map(e => e ? Coin.toSDK(e) : undefined); + } else { + obj.coins = []; + } + + return obj; + } + +}; + +function createBaseMsgForceUnlockResponse(): MsgForceUnlockResponse { + return { + success: false + }; +} + +export const MsgForceUnlockResponse = { + encode(message: MsgForceUnlockResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.success === true) { + writer.uint32(8).bool(message.success); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgForceUnlockResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgForceUnlockResponse(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.success = reader.bool(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): MsgForceUnlockResponse { + return { + success: isSet(object.success) ? Boolean(object.success) : false + }; + }, + + toJSON(message: MsgForceUnlockResponse): unknown { + const obj: any = {}; + message.success !== undefined && (obj.success = message.success); + return obj; + }, + + fromPartial(object: DeepPartial): MsgForceUnlockResponse { + const message = createBaseMsgForceUnlockResponse(); + message.success = object.success ?? false; + return message; + }, + + fromSDK(object: MsgForceUnlockResponseSDKType): MsgForceUnlockResponse { + return { + success: object?.success + }; + }, + + toSDK(message: MsgForceUnlockResponse): MsgForceUnlockResponseSDKType { + const obj: any = {}; + obj.success = message.success; + return obj; + } + }; \ No newline at end of file diff --git a/__fixtures__/output1/osmosis/mint/v1beta1/genesis.ts b/__fixtures__/output1/osmosis/mint/v1beta1/genesis.ts index ad983666a2..3b7fd8ebee 100644 --- a/__fixtures__/output1/osmosis/mint/v1beta1/genesis.ts +++ b/__fixtures__/output1/osmosis/mint/v1beta1/genesis.ts @@ -20,16 +20,8 @@ export interface GenesisState { /** GenesisState defines the mint module's genesis state. */ export interface GenesisStateSDKType { - /** minter is an abstraction for holding current rewards information. */ minter?: MinterSDKType; - - /** params defines all the paramaters of the mint module. */ params?: ParamsSDKType; - - /** - * reduction_started_epoch is the first epoch in which the reduction of mint - * begins. - */ reduction_started_epoch: Long; } diff --git a/__fixtures__/output1/osmosis/mint/v1beta1/mint.ts b/__fixtures__/output1/osmosis/mint/v1beta1/mint.ts index 0687fb29cd..640095cb19 100644 --- a/__fixtures__/output1/osmosis/mint/v1beta1/mint.ts +++ b/__fixtures__/output1/osmosis/mint/v1beta1/mint.ts @@ -10,7 +10,6 @@ export interface Minter { /** Minter represents the minting state. */ export interface MinterSDKType { - /** epoch_provisions represent rewards for the current epoch. */ epoch_provisions: string; } @@ -71,28 +70,9 @@ export interface DistributionProportions { * denoms and how much. */ export interface DistributionProportionsSDKType { - /** - * staking defines the proportion of the minted mint_denom that is to be - * allocated as staking rewards. - */ staking: string; - - /** - * pool_incentives defines the proportion of the minted mint_denom that is - * to be allocated as pool incentives. - */ pool_incentives: string; - - /** - * developer_rewards defines the proportion of the minted mint_denom that is - * to be allocated to developer rewards address. - */ developer_rewards: string; - - /** - * community_pool defines the proportion of the minted mint_denom that is - * to be allocated to the community pool. - */ community_pool: string; } @@ -143,46 +123,13 @@ export interface Params { /** Params holds parameters for the x/mint module. */ export interface ParamsSDKType { - /** mint_denom is the denom of the coin to mint. */ mint_denom: string; - - /** genesis_epoch_provisions epoch provisions from the first epoch. */ genesis_epoch_provisions: string; - - /** epoch_identifier mint epoch identifier e.g. (day, week). */ epoch_identifier: string; - - /** - * reduction_period_in_epochs the number of epochs it takes - * to reduce the rewards. - */ reduction_period_in_epochs: Long; - - /** - * reduction_factor is the reduction multiplier to execute - * at the end of each period set by reduction_period_in_epochs. - */ reduction_factor: string; - - /** - * distribution_proportions defines the distribution proportions of the minted - * denom. In other words, defines which stakeholders will receive the minted - * denoms and how much. - */ distribution_proportions?: DistributionProportionsSDKType; - - /** - * weighted_developer_rewards_receivers is the address to receive developer - * rewards with weights assignedt to each address. The final amount that each - * address receives is: epoch_provisions * - * distribution_proportions.developer_rewards * Address's Weight. - */ weighted_developer_rewards_receivers: WeightedAddressSDKType[]; - - /** - * minting_rewards_distribution_start_epoch start epoch to distribute minting - * rewards - */ minting_rewards_distribution_start_epoch: Long; } diff --git a/__fixtures__/output1/osmosis/mint/v1beta1/query.ts b/__fixtures__/output1/osmosis/mint/v1beta1/query.ts index 82aa79daa3..88c6c028ca 100644 --- a/__fixtures__/output1/osmosis/mint/v1beta1/query.ts +++ b/__fixtures__/output1/osmosis/mint/v1beta1/query.ts @@ -17,7 +17,6 @@ export interface QueryParamsResponse { /** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponseSDKType { - /** params defines the parameters of the module. */ params?: ParamsSDKType; } @@ -47,7 +46,6 @@ export interface QueryEpochProvisionsResponse { * Query/EpochProvisions RPC method. */ export interface QueryEpochProvisionsResponseSDKType { - /** epoch_provisions is the current minting per epoch provisions value. */ epoch_provisions: Uint8Array; } diff --git a/__fixtures__/output1/osmosis/pool-incentives/v1beta1/genesis.ts b/__fixtures__/output1/osmosis/pool-incentives/v1beta1/genesis.ts index a291b532c9..5f5ab15a65 100644 --- a/__fixtures__/output1/osmosis/pool-incentives/v1beta1/genesis.ts +++ b/__fixtures__/output1/osmosis/pool-incentives/v1beta1/genesis.ts @@ -15,7 +15,6 @@ export interface GenesisState { /** GenesisState defines the pool incentives module's genesis state. */ export interface GenesisStateSDKType { - /** params defines all the paramaters of the module. */ params?: ParamsSDKType; lockable_durations: DurationSDKType[]; distr_info?: DistrInfoSDKType; diff --git a/__fixtures__/output1/osmosis/pool-incentives/v1beta1/incentives.ts b/__fixtures__/output1/osmosis/pool-incentives/v1beta1/incentives.ts index 0e2eb568a0..5b260c6d5d 100644 --- a/__fixtures__/output1/osmosis/pool-incentives/v1beta1/incentives.ts +++ b/__fixtures__/output1/osmosis/pool-incentives/v1beta1/incentives.ts @@ -12,12 +12,6 @@ export interface Params { mintedDenom: string; } export interface ParamsSDKType { - /** - * minted_denom is the denomination of the coin expected to be minted by the - * minting module. Pool-incentives module doesn’t actually mint the coin - * itself, but rather manages the distribution of coins that matches the - * defined minted_denom. - */ minted_denom: string; } export interface LockableDurationsInfo { diff --git a/__fixtures__/output1/osmosis/rpc.query.ts b/__fixtures__/output1/osmosis/rpc.query.ts index b292f08b19..02c08f1d7d 100644 --- a/__fixtures__/output1/osmosis/rpc.query.ts +++ b/__fixtures__/output1/osmosis/rpc.query.ts @@ -77,7 +77,11 @@ export const createRPCQueryClient = async ({ v1beta1: (await import("./epochs/query.rpc.Query")).createRpcQueryExtension(client) }, gamm: { - v1beta1: (await import("./gamm/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) + v1beta1: (await import("./gamm/v1beta1/query.rpc.Query")).createRpcQueryExtension(client), + v2: (await import("./gamm/v2/query.rpc.Query")).createRpcQueryExtension(client) + }, + ibcratelimit: { + v1beta1: (await import("./ibc-rate-limit/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, incentives: (await import("./incentives/query.rpc.Query")).createRpcQueryExtension(client), lockup: (await import("./lockup/query.rpc.Query")).createRpcQueryExtension(client), @@ -87,9 +91,6 @@ export const createRPCQueryClient = async ({ poolincentives: { v1beta1: (await import("./pool-incentives/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) }, - streamswap: { - v1: (await import("./streamswap/v1/query.rpc.Query")).createRpcQueryExtension(client) - }, superfluid: (await import("./superfluid/query.rpc.Query")).createRpcQueryExtension(client), tokenfactory: { v1beta1: (await import("./tokenfactory/v1beta1/query.rpc.Query")).createRpcQueryExtension(client) diff --git a/__fixtures__/output1/osmosis/rpc.tx.ts b/__fixtures__/output1/osmosis/rpc.tx.ts index 4b56607fd3..8d4b6b8b20 100644 --- a/__fixtures__/output1/osmosis/rpc.tx.ts +++ b/__fixtures__/output1/osmosis/rpc.tx.ts @@ -60,9 +60,6 @@ export const createRPCMsgClient = async ({ }, incentives: new (await import("./incentives/tx.rpc.msg")).MsgClientImpl(rpc), lockup: new (await import("./lockup/tx.rpc.msg")).MsgClientImpl(rpc), - streamswap: { - v1: new (await import("./streamswap/v1/tx.rpc.msg")).MsgClientImpl(rpc) - }, superfluid: new (await import("./superfluid/tx.rpc.msg")).MsgClientImpl(rpc), tokenfactory: { v1beta1: new (await import("./tokenfactory/v1beta1/tx.rpc.msg")).MsgClientImpl(rpc) diff --git a/__fixtures__/output1/osmosis/streamswap/v1/event.ts b/__fixtures__/output1/osmosis/streamswap/v1/event.ts deleted file mode 100644 index e0c7a1def3..0000000000 --- a/__fixtures__/output1/osmosis/streamswap/v1/event.ts +++ /dev/null @@ -1,551 +0,0 @@ -import { Coin, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; -import { Long, isSet, DeepPartial } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; -export const protobufPackage = "osmosis.streamswap.v1"; -export interface EventCreateSale { - id: Long; - creator: string; - tokenIn: string; - tokenOut?: Coin; -} -export interface EventCreateSaleSDKType { - id: Long; - creator: string; - token_in: string; - token_out?: CoinSDKType; -} -export interface EventSubscribe { - sender: string; - saleId: Long; - amount: string; -} -export interface EventSubscribeSDKType { - sender: string; - sale_id: Long; - amount: string; -} -export interface EventWithdraw { - sender: string; - saleId: Long; - - /** amount of staked token_in withdrawn by user. */ - amount: string; -} -export interface EventWithdrawSDKType { - sender: string; - sale_id: Long; - - /** amount of staked token_in withdrawn by user. */ - amount: string; -} -export interface EventExit { - sender: string; - saleId: Long; - - /** amount of purchased token_out sent to the user */ - purchased: string; -} -export interface EventExitSDKType { - sender: string; - sale_id: Long; - - /** amount of purchased token_out sent to the user */ - purchased: string; -} -export interface EventFinalizeSale { - saleId: Long; - - /** amount of earned tokens_in */ - income: string; -} -export interface EventFinalizeSaleSDKType { - sale_id: Long; - - /** amount of earned tokens_in */ - income: string; -} - -function createBaseEventCreateSale(): EventCreateSale { - return { - id: Long.UZERO, - creator: "", - tokenIn: "", - tokenOut: undefined - }; -} - -export const EventCreateSale = { - encode(message: EventCreateSale, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.id.isZero()) { - writer.uint32(8).uint64(message.id); - } - - if (message.creator !== "") { - writer.uint32(18).string(message.creator); - } - - if (message.tokenIn !== "") { - writer.uint32(26).string(message.tokenIn); - } - - if (message.tokenOut !== undefined) { - Coin.encode(message.tokenOut, writer.uint32(34).fork()).ldelim(); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): EventCreateSale { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEventCreateSale(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.id = (reader.uint64() as Long); - break; - - case 2: - message.creator = reader.string(); - break; - - case 3: - message.tokenIn = reader.string(); - break; - - case 4: - message.tokenOut = Coin.decode(reader, reader.uint32()); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(object: any): EventCreateSale { - return { - id: isSet(object.id) ? Long.fromValue(object.id) : Long.UZERO, - creator: isSet(object.creator) ? String(object.creator) : "", - tokenIn: isSet(object.tokenIn) ? String(object.tokenIn) : "", - tokenOut: isSet(object.tokenOut) ? Coin.fromJSON(object.tokenOut) : undefined - }; - }, - - toJSON(message: EventCreateSale): unknown { - const obj: any = {}; - message.id !== undefined && (obj.id = (message.id || Long.UZERO).toString()); - message.creator !== undefined && (obj.creator = message.creator); - message.tokenIn !== undefined && (obj.tokenIn = message.tokenIn); - message.tokenOut !== undefined && (obj.tokenOut = message.tokenOut ? Coin.toJSON(message.tokenOut) : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): EventCreateSale { - const message = createBaseEventCreateSale(); - message.id = object.id !== undefined && object.id !== null ? Long.fromValue(object.id) : Long.UZERO; - message.creator = object.creator ?? ""; - message.tokenIn = object.tokenIn ?? ""; - message.tokenOut = object.tokenOut !== undefined && object.tokenOut !== null ? Coin.fromPartial(object.tokenOut) : undefined; - return message; - }, - - fromSDK(object: EventCreateSaleSDKType): EventCreateSale { - return { - id: object?.id, - creator: object?.creator, - tokenIn: object?.token_in, - tokenOut: object.token_out ? Coin.fromSDK(object.token_out) : undefined - }; - }, - - toSDK(message: EventCreateSale): EventCreateSaleSDKType { - const obj: any = {}; - obj.id = message.id; - obj.creator = message.creator; - obj.token_in = message.tokenIn; - message.tokenOut !== undefined && (obj.token_out = message.tokenOut ? Coin.toSDK(message.tokenOut) : undefined); - return obj; - } - -}; - -function createBaseEventSubscribe(): EventSubscribe { - return { - sender: "", - saleId: Long.UZERO, - amount: "" - }; -} - -export const EventSubscribe = { - encode(message: EventSubscribe, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.sender !== "") { - writer.uint32(10).string(message.sender); - } - - if (!message.saleId.isZero()) { - writer.uint32(16).uint64(message.saleId); - } - - if (message.amount !== "") { - writer.uint32(26).string(message.amount); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): EventSubscribe { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEventSubscribe(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.sender = reader.string(); - break; - - case 2: - message.saleId = (reader.uint64() as Long); - break; - - case 3: - message.amount = reader.string(); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(object: any): EventSubscribe { - return { - sender: isSet(object.sender) ? String(object.sender) : "", - saleId: isSet(object.saleId) ? Long.fromValue(object.saleId) : Long.UZERO, - amount: isSet(object.amount) ? String(object.amount) : "" - }; - }, - - toJSON(message: EventSubscribe): unknown { - const obj: any = {}; - message.sender !== undefined && (obj.sender = message.sender); - message.saleId !== undefined && (obj.saleId = (message.saleId || Long.UZERO).toString()); - message.amount !== undefined && (obj.amount = message.amount); - return obj; - }, - - fromPartial(object: DeepPartial): EventSubscribe { - const message = createBaseEventSubscribe(); - message.sender = object.sender ?? ""; - message.saleId = object.saleId !== undefined && object.saleId !== null ? Long.fromValue(object.saleId) : Long.UZERO; - message.amount = object.amount ?? ""; - return message; - }, - - fromSDK(object: EventSubscribeSDKType): EventSubscribe { - return { - sender: object?.sender, - saleId: object?.sale_id, - amount: object?.amount - }; - }, - - toSDK(message: EventSubscribe): EventSubscribeSDKType { - const obj: any = {}; - obj.sender = message.sender; - obj.sale_id = message.saleId; - obj.amount = message.amount; - return obj; - } - -}; - -function createBaseEventWithdraw(): EventWithdraw { - return { - sender: "", - saleId: Long.UZERO, - amount: "" - }; -} - -export const EventWithdraw = { - encode(message: EventWithdraw, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.sender !== "") { - writer.uint32(10).string(message.sender); - } - - if (!message.saleId.isZero()) { - writer.uint32(16).uint64(message.saleId); - } - - if (message.amount !== "") { - writer.uint32(26).string(message.amount); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): EventWithdraw { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEventWithdraw(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.sender = reader.string(); - break; - - case 2: - message.saleId = (reader.uint64() as Long); - break; - - case 3: - message.amount = reader.string(); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(object: any): EventWithdraw { - return { - sender: isSet(object.sender) ? String(object.sender) : "", - saleId: isSet(object.saleId) ? Long.fromValue(object.saleId) : Long.UZERO, - amount: isSet(object.amount) ? String(object.amount) : "" - }; - }, - - toJSON(message: EventWithdraw): unknown { - const obj: any = {}; - message.sender !== undefined && (obj.sender = message.sender); - message.saleId !== undefined && (obj.saleId = (message.saleId || Long.UZERO).toString()); - message.amount !== undefined && (obj.amount = message.amount); - return obj; - }, - - fromPartial(object: DeepPartial): EventWithdraw { - const message = createBaseEventWithdraw(); - message.sender = object.sender ?? ""; - message.saleId = object.saleId !== undefined && object.saleId !== null ? Long.fromValue(object.saleId) : Long.UZERO; - message.amount = object.amount ?? ""; - return message; - }, - - fromSDK(object: EventWithdrawSDKType): EventWithdraw { - return { - sender: object?.sender, - saleId: object?.sale_id, - amount: object?.amount - }; - }, - - toSDK(message: EventWithdraw): EventWithdrawSDKType { - const obj: any = {}; - obj.sender = message.sender; - obj.sale_id = message.saleId; - obj.amount = message.amount; - return obj; - } - -}; - -function createBaseEventExit(): EventExit { - return { - sender: "", - saleId: Long.UZERO, - purchased: "" - }; -} - -export const EventExit = { - encode(message: EventExit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.sender !== "") { - writer.uint32(10).string(message.sender); - } - - if (!message.saleId.isZero()) { - writer.uint32(16).uint64(message.saleId); - } - - if (message.purchased !== "") { - writer.uint32(26).string(message.purchased); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): EventExit { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEventExit(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.sender = reader.string(); - break; - - case 2: - message.saleId = (reader.uint64() as Long); - break; - - case 3: - message.purchased = reader.string(); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(object: any): EventExit { - return { - sender: isSet(object.sender) ? String(object.sender) : "", - saleId: isSet(object.saleId) ? Long.fromValue(object.saleId) : Long.UZERO, - purchased: isSet(object.purchased) ? String(object.purchased) : "" - }; - }, - - toJSON(message: EventExit): unknown { - const obj: any = {}; - message.sender !== undefined && (obj.sender = message.sender); - message.saleId !== undefined && (obj.saleId = (message.saleId || Long.UZERO).toString()); - message.purchased !== undefined && (obj.purchased = message.purchased); - return obj; - }, - - fromPartial(object: DeepPartial): EventExit { - const message = createBaseEventExit(); - message.sender = object.sender ?? ""; - message.saleId = object.saleId !== undefined && object.saleId !== null ? Long.fromValue(object.saleId) : Long.UZERO; - message.purchased = object.purchased ?? ""; - return message; - }, - - fromSDK(object: EventExitSDKType): EventExit { - return { - sender: object?.sender, - saleId: object?.sale_id, - purchased: object?.purchased - }; - }, - - toSDK(message: EventExit): EventExitSDKType { - const obj: any = {}; - obj.sender = message.sender; - obj.sale_id = message.saleId; - obj.purchased = message.purchased; - return obj; - } - -}; - -function createBaseEventFinalizeSale(): EventFinalizeSale { - return { - saleId: Long.UZERO, - income: "" - }; -} - -export const EventFinalizeSale = { - encode(message: EventFinalizeSale, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.saleId.isZero()) { - writer.uint32(8).uint64(message.saleId); - } - - if (message.income !== "") { - writer.uint32(26).string(message.income); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): EventFinalizeSale { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEventFinalizeSale(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.saleId = (reader.uint64() as Long); - break; - - case 3: - message.income = reader.string(); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(object: any): EventFinalizeSale { - return { - saleId: isSet(object.saleId) ? Long.fromValue(object.saleId) : Long.UZERO, - income: isSet(object.income) ? String(object.income) : "" - }; - }, - - toJSON(message: EventFinalizeSale): unknown { - const obj: any = {}; - message.saleId !== undefined && (obj.saleId = (message.saleId || Long.UZERO).toString()); - message.income !== undefined && (obj.income = message.income); - return obj; - }, - - fromPartial(object: DeepPartial): EventFinalizeSale { - const message = createBaseEventFinalizeSale(); - message.saleId = object.saleId !== undefined && object.saleId !== null ? Long.fromValue(object.saleId) : Long.UZERO; - message.income = object.income ?? ""; - return message; - }, - - fromSDK(object: EventFinalizeSaleSDKType): EventFinalizeSale { - return { - saleId: object?.sale_id, - income: object?.income - }; - }, - - toSDK(message: EventFinalizeSale): EventFinalizeSaleSDKType { - const obj: any = {}; - obj.sale_id = message.saleId; - obj.income = message.income; - return obj; - } - -}; \ No newline at end of file diff --git a/__fixtures__/output1/osmosis/streamswap/v1/genesis.ts b/__fixtures__/output1/osmosis/streamswap/v1/genesis.ts deleted file mode 100644 index 6f68d8d7f1..0000000000 --- a/__fixtures__/output1/osmosis/streamswap/v1/genesis.ts +++ /dev/null @@ -1,273 +0,0 @@ -import { Sale, SaleSDKType, UserPosition, UserPositionSDKType } from "./state"; -import { Params, ParamsSDKType } from "./params"; -import { Long, isSet, DeepPartial } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; -export const protobufPackage = "osmosis.streamswap.v1"; - -/** GenesisState defines the streamswap module's genesis state. */ -export interface GenesisState { - sales: Sale[]; - userPositions: UserPositionKV[]; - nextSaleId: Long; - params?: Params; -} - -/** GenesisState defines the streamswap module's genesis state. */ -export interface GenesisStateSDKType { - sales: SaleSDKType[]; - user_positions: UserPositionKVSDKType[]; - next_sale_id: Long; - params?: ParamsSDKType; -} - -/** - * UserPositionKV is a record in genesis representing acc_address user position - * of a sale_id sale. - */ -export interface UserPositionKV { - /** user account address */ - accAddress: string; - saleId: Long; - userPosition?: UserPosition; -} - -/** - * UserPositionKV is a record in genesis representing acc_address user position - * of a sale_id sale. - */ -export interface UserPositionKVSDKType { - /** user account address */ - acc_address: string; - sale_id: Long; - user_position?: UserPositionSDKType; -} - -function createBaseGenesisState(): GenesisState { - return { - sales: [], - userPositions: [], - nextSaleId: Long.UZERO, - params: undefined - }; -} - -export const GenesisState = { - encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - for (const v of message.sales) { - Sale.encode(v!, writer.uint32(10).fork()).ldelim(); - } - - for (const v of message.userPositions) { - UserPositionKV.encode(v!, writer.uint32(18).fork()).ldelim(); - } - - if (!message.nextSaleId.isZero()) { - writer.uint32(24).uint64(message.nextSaleId); - } - - if (message.params !== undefined) { - Params.encode(message.params, writer.uint32(34).fork()).ldelim(); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGenesisState(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.sales.push(Sale.decode(reader, reader.uint32())); - break; - - case 2: - message.userPositions.push(UserPositionKV.decode(reader, reader.uint32())); - break; - - case 3: - message.nextSaleId = (reader.uint64() as Long); - break; - - case 4: - message.params = Params.decode(reader, reader.uint32()); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(object: any): GenesisState { - return { - sales: Array.isArray(object?.sales) ? object.sales.map((e: any) => Sale.fromJSON(e)) : [], - userPositions: Array.isArray(object?.userPositions) ? object.userPositions.map((e: any) => UserPositionKV.fromJSON(e)) : [], - nextSaleId: isSet(object.nextSaleId) ? Long.fromValue(object.nextSaleId) : Long.UZERO, - params: isSet(object.params) ? Params.fromJSON(object.params) : undefined - }; - }, - - toJSON(message: GenesisState): unknown { - const obj: any = {}; - - if (message.sales) { - obj.sales = message.sales.map(e => e ? Sale.toJSON(e) : undefined); - } else { - obj.sales = []; - } - - if (message.userPositions) { - obj.userPositions = message.userPositions.map(e => e ? UserPositionKV.toJSON(e) : undefined); - } else { - obj.userPositions = []; - } - - message.nextSaleId !== undefined && (obj.nextSaleId = (message.nextSaleId || Long.UZERO).toString()); - message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): GenesisState { - const message = createBaseGenesisState(); - message.sales = object.sales?.map(e => Sale.fromPartial(e)) || []; - message.userPositions = object.userPositions?.map(e => UserPositionKV.fromPartial(e)) || []; - message.nextSaleId = object.nextSaleId !== undefined && object.nextSaleId !== null ? Long.fromValue(object.nextSaleId) : Long.UZERO; - message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; - return message; - }, - - fromSDK(object: GenesisStateSDKType): GenesisState { - return { - sales: Array.isArray(object?.sales) ? object.sales.map((e: any) => Sale.fromSDK(e)) : [], - userPositions: Array.isArray(object?.user_positions) ? object.user_positions.map((e: any) => UserPositionKV.fromSDK(e)) : [], - nextSaleId: object?.next_sale_id, - params: object.params ? Params.fromSDK(object.params) : undefined - }; - }, - - toSDK(message: GenesisState): GenesisStateSDKType { - const obj: any = {}; - - if (message.sales) { - obj.sales = message.sales.map(e => e ? Sale.toSDK(e) : undefined); - } else { - obj.sales = []; - } - - if (message.userPositions) { - obj.user_positions = message.userPositions.map(e => e ? UserPositionKV.toSDK(e) : undefined); - } else { - obj.user_positions = []; - } - - obj.next_sale_id = message.nextSaleId; - message.params !== undefined && (obj.params = message.params ? Params.toSDK(message.params) : undefined); - return obj; - } - -}; - -function createBaseUserPositionKV(): UserPositionKV { - return { - accAddress: "", - saleId: Long.UZERO, - userPosition: undefined - }; -} - -export const UserPositionKV = { - encode(message: UserPositionKV, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.accAddress !== "") { - writer.uint32(10).string(message.accAddress); - } - - if (!message.saleId.isZero()) { - writer.uint32(16).uint64(message.saleId); - } - - if (message.userPosition !== undefined) { - UserPosition.encode(message.userPosition, writer.uint32(26).fork()).ldelim(); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): UserPositionKV { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUserPositionKV(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.accAddress = reader.string(); - break; - - case 2: - message.saleId = (reader.uint64() as Long); - break; - - case 3: - message.userPosition = UserPosition.decode(reader, reader.uint32()); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(object: any): UserPositionKV { - return { - accAddress: isSet(object.accAddress) ? String(object.accAddress) : "", - saleId: isSet(object.saleId) ? Long.fromValue(object.saleId) : Long.UZERO, - userPosition: isSet(object.userPosition) ? UserPosition.fromJSON(object.userPosition) : undefined - }; - }, - - toJSON(message: UserPositionKV): unknown { - const obj: any = {}; - message.accAddress !== undefined && (obj.accAddress = message.accAddress); - message.saleId !== undefined && (obj.saleId = (message.saleId || Long.UZERO).toString()); - message.userPosition !== undefined && (obj.userPosition = message.userPosition ? UserPosition.toJSON(message.userPosition) : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): UserPositionKV { - const message = createBaseUserPositionKV(); - message.accAddress = object.accAddress ?? ""; - message.saleId = object.saleId !== undefined && object.saleId !== null ? Long.fromValue(object.saleId) : Long.UZERO; - message.userPosition = object.userPosition !== undefined && object.userPosition !== null ? UserPosition.fromPartial(object.userPosition) : undefined; - return message; - }, - - fromSDK(object: UserPositionKVSDKType): UserPositionKV { - return { - accAddress: object?.acc_address, - saleId: object?.sale_id, - userPosition: object.user_position ? UserPosition.fromSDK(object.user_position) : undefined - }; - }, - - toSDK(message: UserPositionKV): UserPositionKVSDKType { - const obj: any = {}; - obj.acc_address = message.accAddress; - obj.sale_id = message.saleId; - message.userPosition !== undefined && (obj.user_position = message.userPosition ? UserPosition.toSDK(message.userPosition) : undefined); - return obj; - } - -}; \ No newline at end of file diff --git a/__fixtures__/output1/osmosis/streamswap/v1/params.ts b/__fixtures__/output1/osmosis/streamswap/v1/params.ts deleted file mode 100644 index 35ba3e8065..0000000000 --- a/__fixtures__/output1/osmosis/streamswap/v1/params.ts +++ /dev/null @@ -1,170 +0,0 @@ -import { Coin, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; -import { Duration, DurationSDKType } from "../../../google/protobuf/duration"; -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial } from "../../../helpers"; -export const protobufPackage = "osmosis.streamswap.v1"; - -/** Params holds parameters for the streamswap module */ -export interface Params { - /** - * fee charged when creating a new sale. The fee will go to the - * sale_fee_recipient unless it is not defined (empty). - */ - saleCreationFee: Coin[]; - - /** bech32 address of the fee recipient */ - saleCreationFeeRecipient: string; - - /** - * minimum amount duration of time between the sale creation and the sale - * start time. - */ - minDurationUntilStartTime?: Duration; - - /** minimum duration for every new sale. */ - minSaleDuration?: Duration; -} - -/** Params holds parameters for the streamswap module */ -export interface ParamsSDKType { - /** - * fee charged when creating a new sale. The fee will go to the - * sale_fee_recipient unless it is not defined (empty). - */ - sale_creation_fee: CoinSDKType[]; - - /** bech32 address of the fee recipient */ - sale_creation_fee_recipient: string; - - /** - * minimum amount duration of time between the sale creation and the sale - * start time. - */ - min_duration_until_start_time?: DurationSDKType; - - /** minimum duration for every new sale. */ - min_sale_duration?: DurationSDKType; -} - -function createBaseParams(): Params { - return { - saleCreationFee: [], - saleCreationFeeRecipient: "", - minDurationUntilStartTime: undefined, - minSaleDuration: undefined - }; -} - -export const Params = { - encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - for (const v of message.saleCreationFee) { - Coin.encode(v!, writer.uint32(10).fork()).ldelim(); - } - - if (message.saleCreationFeeRecipient !== "") { - writer.uint32(18).string(message.saleCreationFeeRecipient); - } - - if (message.minDurationUntilStartTime !== undefined) { - Duration.encode(message.minDurationUntilStartTime, writer.uint32(26).fork()).ldelim(); - } - - if (message.minSaleDuration !== undefined) { - Duration.encode(message.minSaleDuration, writer.uint32(34).fork()).ldelim(); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): Params { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseParams(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.saleCreationFee.push(Coin.decode(reader, reader.uint32())); - break; - - case 2: - message.saleCreationFeeRecipient = reader.string(); - break; - - case 3: - message.minDurationUntilStartTime = Duration.decode(reader, reader.uint32()); - break; - - case 4: - message.minSaleDuration = Duration.decode(reader, reader.uint32()); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(object: any): Params { - return { - saleCreationFee: Array.isArray(object?.saleCreationFee) ? object.saleCreationFee.map((e: any) => Coin.fromJSON(e)) : [], - saleCreationFeeRecipient: isSet(object.saleCreationFeeRecipient) ? String(object.saleCreationFeeRecipient) : "", - minDurationUntilStartTime: isSet(object.minDurationUntilStartTime) ? Duration.fromJSON(object.minDurationUntilStartTime) : undefined, - minSaleDuration: isSet(object.minSaleDuration) ? Duration.fromJSON(object.minSaleDuration) : undefined - }; - }, - - toJSON(message: Params): unknown { - const obj: any = {}; - - if (message.saleCreationFee) { - obj.saleCreationFee = message.saleCreationFee.map(e => e ? Coin.toJSON(e) : undefined); - } else { - obj.saleCreationFee = []; - } - - message.saleCreationFeeRecipient !== undefined && (obj.saleCreationFeeRecipient = message.saleCreationFeeRecipient); - message.minDurationUntilStartTime !== undefined && (obj.minDurationUntilStartTime = message.minDurationUntilStartTime ? Duration.toJSON(message.minDurationUntilStartTime) : undefined); - message.minSaleDuration !== undefined && (obj.minSaleDuration = message.minSaleDuration ? Duration.toJSON(message.minSaleDuration) : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): Params { - const message = createBaseParams(); - message.saleCreationFee = object.saleCreationFee?.map(e => Coin.fromPartial(e)) || []; - message.saleCreationFeeRecipient = object.saleCreationFeeRecipient ?? ""; - message.minDurationUntilStartTime = object.minDurationUntilStartTime !== undefined && object.minDurationUntilStartTime !== null ? Duration.fromPartial(object.minDurationUntilStartTime) : undefined; - message.minSaleDuration = object.minSaleDuration !== undefined && object.minSaleDuration !== null ? Duration.fromPartial(object.minSaleDuration) : undefined; - return message; - }, - - fromSDK(object: ParamsSDKType): Params { - return { - saleCreationFee: Array.isArray(object?.sale_creation_fee) ? object.sale_creation_fee.map((e: any) => Coin.fromSDK(e)) : [], - saleCreationFeeRecipient: object?.sale_creation_fee_recipient, - minDurationUntilStartTime: object.min_duration_until_start_time ? Duration.fromSDK(object.min_duration_until_start_time) : undefined, - minSaleDuration: object.min_sale_duration ? Duration.fromSDK(object.min_sale_duration) : undefined - }; - }, - - toSDK(message: Params): ParamsSDKType { - const obj: any = {}; - - if (message.saleCreationFee) { - obj.sale_creation_fee = message.saleCreationFee.map(e => e ? Coin.toSDK(e) : undefined); - } else { - obj.sale_creation_fee = []; - } - - obj.sale_creation_fee_recipient = message.saleCreationFeeRecipient; - message.minDurationUntilStartTime !== undefined && (obj.min_duration_until_start_time = message.minDurationUntilStartTime ? Duration.toSDK(message.minDurationUntilStartTime) : undefined); - message.minSaleDuration !== undefined && (obj.min_sale_duration = message.minSaleDuration ? Duration.toSDK(message.minSaleDuration) : undefined); - return obj; - } - -}; \ No newline at end of file diff --git a/__fixtures__/output1/osmosis/streamswap/v1/query.lcd.ts b/__fixtures__/output1/osmosis/streamswap/v1/query.lcd.ts deleted file mode 100644 index a7e0318c86..0000000000 --- a/__fixtures__/output1/osmosis/streamswap/v1/query.lcd.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { PageRequest, PageRequestSDKType, PageResponse, PageResponseSDKType } from "../../../cosmos/base/query/v1beta1/pagination"; -import { Sale, SaleSDKType, UserPosition, UserPositionSDKType } from "./state"; -import { setPaginationParams } from "../../../helpers"; -import { LCDClient } from "@osmonauts/lcd"; -import { QuerySales, QuerySalesSDKType, QuerySalesResponse, QuerySalesResponseSDKType, QuerySale, QuerySaleSDKType, QuerySaleResponse, QuerySaleResponseSDKType, QueryUserPosition, QueryUserPositionSDKType, QueryUserPositionResponse, QueryUserPositionResponseSDKType } from "./query"; -export class LCDQueryClient { - req: LCDClient; - - constructor({ - requestClient - }: { - requestClient: LCDClient; - }) { - this.req = requestClient; - this.sales = this.sales.bind(this); - this.sale = this.sale.bind(this); - this.userPosition = this.userPosition.bind(this); - } - - /* Returns list of Sales ordered by the creation time */ - async sales(params: QuerySales = { - pagination: undefined - }): Promise { - const options: any = { - params: {} - }; - - if (typeof params?.pagination !== "undefined") { - setPaginationParams(options, params.pagination); - } - - const endpoint = `cosmos/streamswap/v1/sales`; - return await this.req.get(endpoint, options); - } - - /* Returns the specific Sale object */ - async sale(params: QuerySale): Promise { - const endpoint = `cosmos/streamswap/v1/sales/${params.saleId}`; - return await this.req.get(endpoint); - } - - /* UserPosition */ - async userPosition(params: QueryUserPosition): Promise { - const endpoint = `cosmos/streamswap/v1/sales/${params.saleId}/${params.user}`; - return await this.req.get(endpoint); - } - -} \ No newline at end of file diff --git a/__fixtures__/output1/osmosis/streamswap/v1/query.rpc.Query.ts b/__fixtures__/output1/osmosis/streamswap/v1/query.rpc.Query.ts deleted file mode 100644 index 230a434dd4..0000000000 --- a/__fixtures__/output1/osmosis/streamswap/v1/query.rpc.Query.ts +++ /dev/null @@ -1,135 +0,0 @@ -import { PageRequest, PageRequestSDKType, PageResponse, PageResponseSDKType } from "../../../cosmos/base/query/v1beta1/pagination"; -import { Sale, SaleSDKType, UserPosition, UserPositionSDKType } from "./state"; -import { Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; -import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; -import { ReactQueryParams } from "../../../react-query"; -import { useQuery } from "@tanstack/react-query"; -import { QuerySales, QuerySalesSDKType, QuerySalesResponse, QuerySalesResponseSDKType, QuerySale, QuerySaleSDKType, QuerySaleResponse, QuerySaleResponseSDKType, QueryUserPosition, QueryUserPositionSDKType, QueryUserPositionResponse, QueryUserPositionResponseSDKType } from "./query"; - -/** Query defines the gRPC querier service. */ -export interface Query { - /** Returns list of Sales ordered by the creation time */ - sales(request?: QuerySales): Promise; - - /** Returns the specific Sale object */ - sale(request: QuerySale): Promise; - userPosition(request: QueryUserPosition): Promise; -} -export class QueryClientImpl implements Query { - private readonly rpc: Rpc; - - constructor(rpc: Rpc) { - this.rpc = rpc; - this.sales = this.sales.bind(this); - this.sale = this.sale.bind(this); - this.userPosition = this.userPosition.bind(this); - } - - sales(request: QuerySales = { - pagination: undefined - }): Promise { - const data = QuerySales.encode(request).finish(); - const promise = this.rpc.request("osmosis.streamswap.v1.Query", "Sales", data); - return promise.then(data => QuerySalesResponse.decode(new _m0.Reader(data))); - } - - sale(request: QuerySale): Promise { - const data = QuerySale.encode(request).finish(); - const promise = this.rpc.request("osmosis.streamswap.v1.Query", "Sale", data); - return promise.then(data => QuerySaleResponse.decode(new _m0.Reader(data))); - } - - userPosition(request: QueryUserPosition): Promise { - const data = QueryUserPosition.encode(request).finish(); - const promise = this.rpc.request("osmosis.streamswap.v1.Query", "UserPosition", data); - return promise.then(data => QueryUserPositionResponse.decode(new _m0.Reader(data))); - } - -} -export const createRpcQueryExtension = (base: QueryClient) => { - const rpc = createProtobufRpcClient(base); - const queryService = new QueryClientImpl(rpc); - return { - sales(request?: QuerySales): Promise { - return queryService.sales(request); - }, - - sale(request: QuerySale): Promise { - return queryService.sale(request); - }, - - userPosition(request: QueryUserPosition): Promise { - return queryService.userPosition(request); - } - - }; -}; -export interface UseSalesQuery extends ReactQueryParams { - request?: QuerySales; -} -export interface UseSaleQuery extends ReactQueryParams { - request: QuerySale; -} -export interface UseUserPositionQuery extends ReactQueryParams { - request: QueryUserPosition; -} - -const _queryClients: WeakMap = new WeakMap(); - -const getQueryService = (rpc: ProtobufRpcClient | undefined): QueryClientImpl | undefined => { - if (!rpc) return; - - if (_queryClients.has(rpc)) { - return _queryClients.get(rpc); - } - - const queryService = new QueryClientImpl(rpc); - - _queryClients.set(rpc, queryService); - - return queryService; -}; - -export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { - const queryService = getQueryService(rpc); - - const useSales = ({ - request, - options - }: UseSalesQuery) => { - return useQuery(["salesQuery", request], () => { - if (!queryService) throw new Error("Query Service not initialized"); - return queryService.sales(request); - }, options); - }; - - const useSale = ({ - request, - options - }: UseSaleQuery) => { - return useQuery(["saleQuery", request], () => { - if (!queryService) throw new Error("Query Service not initialized"); - return queryService.sale(request); - }, options); - }; - - const useUserPosition = ({ - request, - options - }: UseUserPositionQuery) => { - return useQuery(["userPositionQuery", request], () => { - if (!queryService) throw new Error("Query Service not initialized"); - return queryService.userPosition(request); - }, options); - }; - - return { - /** Returns list of Sales ordered by the creation time */ - useSales, - - /** Returns the specific Sale object */ - useSale, - useUserPosition - }; -}; \ No newline at end of file diff --git a/__fixtures__/output1/osmosis/streamswap/v1/query.ts b/__fixtures__/output1/osmosis/streamswap/v1/query.ts deleted file mode 100644 index 2badbe8a0a..0000000000 --- a/__fixtures__/output1/osmosis/streamswap/v1/query.ts +++ /dev/null @@ -1,517 +0,0 @@ -import { PageRequest, PageRequestSDKType, PageResponse, PageResponseSDKType } from "../../../cosmos/base/query/v1beta1/pagination"; -import { Sale, SaleSDKType, UserPosition, UserPositionSDKType } from "./state"; -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Long } from "../../../helpers"; -export const protobufPackage = "osmosis.streamswap.v1"; -export interface QuerySales { - /** pagination defines an pagination for the request. */ - pagination?: PageRequest; -} -export interface QuerySalesSDKType { - /** pagination defines an pagination for the request. */ - pagination?: PageRequestSDKType; -} -export interface QuerySalesResponse { - sales: Sale[]; - pagination?: PageResponse; -} -export interface QuerySalesResponseSDKType { - sales: SaleSDKType[]; - pagination?: PageResponseSDKType; -} - -/** Request type for Query/Sale */ -export interface QuerySale { - /** Sale ID */ - saleId: Long; -} - -/** Request type for Query/Sale */ -export interface QuerySaleSDKType { - /** Sale ID */ - sale_id: Long; -} -export interface QuerySaleResponse { - sale?: Sale; -} -export interface QuerySaleResponseSDKType { - sale?: SaleSDKType; -} - -/** Request type for Query/Sale */ -export interface QueryUserPosition { - /** ID of the Sale */ - saleId: Long; - - /** user account address */ - user: string; -} - -/** Request type for Query/Sale */ -export interface QueryUserPositionSDKType { - /** ID of the Sale */ - sale_id: Long; - - /** user account address */ - user: string; -} -export interface QueryUserPositionResponse { - userPosition?: UserPosition; -} -export interface QueryUserPositionResponseSDKType { - user_position?: UserPositionSDKType; -} - -function createBaseQuerySales(): QuerySales { - return { - pagination: undefined - }; -} - -export const QuerySales = { - encode(message: QuerySales, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySales { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQuerySales(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(object: any): QuerySales { - return { - pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined - }; - }, - - toJSON(message: QuerySales): unknown { - const obj: any = {}; - message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): QuerySales { - const message = createBaseQuerySales(); - message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; - return message; - }, - - fromSDK(object: QuerySalesSDKType): QuerySales { - return { - pagination: object.pagination ? PageRequest.fromSDK(object.pagination) : undefined - }; - }, - - toSDK(message: QuerySales): QuerySalesSDKType { - const obj: any = {}; - message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toSDK(message.pagination) : undefined); - return obj; - } - -}; - -function createBaseQuerySalesResponse(): QuerySalesResponse { - return { - sales: [], - pagination: undefined - }; -} - -export const QuerySalesResponse = { - encode(message: QuerySalesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - for (const v of message.sales) { - Sale.encode(v!, writer.uint32(10).fork()).ldelim(); - } - - if (message.pagination !== undefined) { - PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySalesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQuerySalesResponse(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.sales.push(Sale.decode(reader, reader.uint32())); - break; - - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(object: any): QuerySalesResponse { - return { - sales: Array.isArray(object?.sales) ? object.sales.map((e: any) => Sale.fromJSON(e)) : [], - pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined - }; - }, - - toJSON(message: QuerySalesResponse): unknown { - const obj: any = {}; - - if (message.sales) { - obj.sales = message.sales.map(e => e ? Sale.toJSON(e) : undefined); - } else { - obj.sales = []; - } - - message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): QuerySalesResponse { - const message = createBaseQuerySalesResponse(); - message.sales = object.sales?.map(e => Sale.fromPartial(e)) || []; - message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; - return message; - }, - - fromSDK(object: QuerySalesResponseSDKType): QuerySalesResponse { - return { - sales: Array.isArray(object?.sales) ? object.sales.map((e: any) => Sale.fromSDK(e)) : [], - pagination: object.pagination ? PageResponse.fromSDK(object.pagination) : undefined - }; - }, - - toSDK(message: QuerySalesResponse): QuerySalesResponseSDKType { - const obj: any = {}; - - if (message.sales) { - obj.sales = message.sales.map(e => e ? Sale.toSDK(e) : undefined); - } else { - obj.sales = []; - } - - message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toSDK(message.pagination) : undefined); - return obj; - } - -}; - -function createBaseQuerySale(): QuerySale { - return { - saleId: Long.UZERO - }; -} - -export const QuerySale = { - encode(message: QuerySale, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.saleId.isZero()) { - writer.uint32(8).uint64(message.saleId); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySale { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQuerySale(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.saleId = (reader.uint64() as Long); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(object: any): QuerySale { - return { - saleId: isSet(object.saleId) ? Long.fromValue(object.saleId) : Long.UZERO - }; - }, - - toJSON(message: QuerySale): unknown { - const obj: any = {}; - message.saleId !== undefined && (obj.saleId = (message.saleId || Long.UZERO).toString()); - return obj; - }, - - fromPartial(object: DeepPartial): QuerySale { - const message = createBaseQuerySale(); - message.saleId = object.saleId !== undefined && object.saleId !== null ? Long.fromValue(object.saleId) : Long.UZERO; - return message; - }, - - fromSDK(object: QuerySaleSDKType): QuerySale { - return { - saleId: object?.sale_id - }; - }, - - toSDK(message: QuerySale): QuerySaleSDKType { - const obj: any = {}; - obj.sale_id = message.saleId; - return obj; - } - -}; - -function createBaseQuerySaleResponse(): QuerySaleResponse { - return { - sale: undefined - }; -} - -export const QuerySaleResponse = { - encode(message: QuerySaleResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.sale !== undefined) { - Sale.encode(message.sale, writer.uint32(10).fork()).ldelim(); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySaleResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQuerySaleResponse(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.sale = Sale.decode(reader, reader.uint32()); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(object: any): QuerySaleResponse { - return { - sale: isSet(object.sale) ? Sale.fromJSON(object.sale) : undefined - }; - }, - - toJSON(message: QuerySaleResponse): unknown { - const obj: any = {}; - message.sale !== undefined && (obj.sale = message.sale ? Sale.toJSON(message.sale) : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): QuerySaleResponse { - const message = createBaseQuerySaleResponse(); - message.sale = object.sale !== undefined && object.sale !== null ? Sale.fromPartial(object.sale) : undefined; - return message; - }, - - fromSDK(object: QuerySaleResponseSDKType): QuerySaleResponse { - return { - sale: object.sale ? Sale.fromSDK(object.sale) : undefined - }; - }, - - toSDK(message: QuerySaleResponse): QuerySaleResponseSDKType { - const obj: any = {}; - message.sale !== undefined && (obj.sale = message.sale ? Sale.toSDK(message.sale) : undefined); - return obj; - } - -}; - -function createBaseQueryUserPosition(): QueryUserPosition { - return { - saleId: Long.UZERO, - user: "" - }; -} - -export const QueryUserPosition = { - encode(message: QueryUserPosition, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.saleId.isZero()) { - writer.uint32(8).uint64(message.saleId); - } - - if (message.user !== "") { - writer.uint32(18).string(message.user); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): QueryUserPosition { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryUserPosition(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.saleId = (reader.uint64() as Long); - break; - - case 2: - message.user = reader.string(); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(object: any): QueryUserPosition { - return { - saleId: isSet(object.saleId) ? Long.fromValue(object.saleId) : Long.UZERO, - user: isSet(object.user) ? String(object.user) : "" - }; - }, - - toJSON(message: QueryUserPosition): unknown { - const obj: any = {}; - message.saleId !== undefined && (obj.saleId = (message.saleId || Long.UZERO).toString()); - message.user !== undefined && (obj.user = message.user); - return obj; - }, - - fromPartial(object: DeepPartial): QueryUserPosition { - const message = createBaseQueryUserPosition(); - message.saleId = object.saleId !== undefined && object.saleId !== null ? Long.fromValue(object.saleId) : Long.UZERO; - message.user = object.user ?? ""; - return message; - }, - - fromSDK(object: QueryUserPositionSDKType): QueryUserPosition { - return { - saleId: object?.sale_id, - user: object?.user - }; - }, - - toSDK(message: QueryUserPosition): QueryUserPositionSDKType { - const obj: any = {}; - obj.sale_id = message.saleId; - obj.user = message.user; - return obj; - } - -}; - -function createBaseQueryUserPositionResponse(): QueryUserPositionResponse { - return { - userPosition: undefined - }; -} - -export const QueryUserPositionResponse = { - encode(message: QueryUserPositionResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.userPosition !== undefined) { - UserPosition.encode(message.userPosition, writer.uint32(10).fork()).ldelim(); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): QueryUserPositionResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryUserPositionResponse(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.userPosition = UserPosition.decode(reader, reader.uint32()); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(object: any): QueryUserPositionResponse { - return { - userPosition: isSet(object.userPosition) ? UserPosition.fromJSON(object.userPosition) : undefined - }; - }, - - toJSON(message: QueryUserPositionResponse): unknown { - const obj: any = {}; - message.userPosition !== undefined && (obj.userPosition = message.userPosition ? UserPosition.toJSON(message.userPosition) : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): QueryUserPositionResponse { - const message = createBaseQueryUserPositionResponse(); - message.userPosition = object.userPosition !== undefined && object.userPosition !== null ? UserPosition.fromPartial(object.userPosition) : undefined; - return message; - }, - - fromSDK(object: QueryUserPositionResponseSDKType): QueryUserPositionResponse { - return { - userPosition: object.user_position ? UserPosition.fromSDK(object.user_position) : undefined - }; - }, - - toSDK(message: QueryUserPositionResponse): QueryUserPositionResponseSDKType { - const obj: any = {}; - message.userPosition !== undefined && (obj.user_position = message.userPosition ? UserPosition.toSDK(message.userPosition) : undefined); - return obj; - } - -}; \ No newline at end of file diff --git a/__fixtures__/output1/osmosis/streamswap/v1/state.ts b/__fixtures__/output1/osmosis/streamswap/v1/state.ts deleted file mode 100644 index 8d74ca2737..0000000000 --- a/__fixtures__/output1/osmosis/streamswap/v1/state.ts +++ /dev/null @@ -1,574 +0,0 @@ -import { Timestamp, TimestampSDKType } from "../../../google/protobuf/timestamp"; -import { Long, toTimestamp, fromTimestamp, isSet, fromJsonTimestamp, DeepPartial } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; -export const protobufPackage = "osmosis.streamswap.v1"; -export interface Sale { - /** Destination for the earned token_in */ - treasury: string; - id: Long; - - /** - * token_out is a token denom to be bootstraped. May be referred as base - * currency, or a sale token. - */ - tokenOut: string; - - /** - * token_in is a token denom used to buy sale tokens (`token_out`). May be - * referred as quote_currency or payment token. - */ - tokenIn: string; - - /** total number of `tokens_out` to be sold during the continuous sale. */ - tokenOutSupply: string; - - /** start time when the token emission starts. */ - startTime?: Date; - - /** - * end time when the token emission ends. Can't be bigger than start + - * 139years (to avoid round overflow) - */ - endTime?: Date; - - /** Round number when the sale was last time updated. */ - round: Long; - - /** Last round of the Sale; */ - endRound: Long; - - /** amout of remaining token_out to sell */ - outRemaining: string; - - /** amount of token_out sold */ - outSold: string; - - /** out token per share */ - outPerShare: string; - - /** total amount of currently staked coins (token_in) but not spent coins. */ - staked: string; - - /** total amount of earned coins (token_in) */ - income: string; - - /** total amount of shares */ - shares: string; - - /** Name for the sale. */ - name: string; - - /** URL with sale and project details. */ - url: string; -} -export interface SaleSDKType { - /** Destination for the earned token_in */ - treasury: string; - id: Long; - - /** - * token_out is a token denom to be bootstraped. May be referred as base - * currency, or a sale token. - */ - token_out: string; - - /** - * token_in is a token denom used to buy sale tokens (`token_out`). May be - * referred as quote_currency or payment token. - */ - token_in: string; - - /** total number of `tokens_out` to be sold during the continuous sale. */ - token_out_supply: string; - - /** start time when the token emission starts. */ - start_time?: Date; - - /** - * end time when the token emission ends. Can't be bigger than start + - * 139years (to avoid round overflow) - */ - end_time?: Date; - - /** Round number when the sale was last time updated. */ - round: Long; - - /** Last round of the Sale; */ - end_round: Long; - - /** amout of remaining token_out to sell */ - out_remaining: string; - - /** amount of token_out sold */ - out_sold: string; - - /** out token per share */ - out_per_share: string; - - /** total amount of currently staked coins (token_in) but not spent coins. */ - staked: string; - - /** total amount of earned coins (token_in) */ - income: string; - - /** total amount of shares */ - shares: string; - - /** Name for the sale. */ - name: string; - - /** URL with sale and project details. */ - url: string; -} - -/** UserPosition represents user account in a sale */ -export interface UserPosition { - shares: string; - - /** total number of currently staked tokens */ - staked: string; - - /** last token/share ratio */ - outPerShare: string; - - /** amount of token_in spent */ - spent: string; - - /** Amount of accumulated, not withdrawn, purchased tokens (token_out) */ - purchased: string; -} - -/** UserPosition represents user account in a sale */ -export interface UserPositionSDKType { - shares: string; - - /** total number of currently staked tokens */ - staked: string; - - /** last token/share ratio */ - out_per_share: string; - - /** amount of token_in spent */ - spent: string; - - /** Amount of accumulated, not withdrawn, purchased tokens (token_out) */ - purchased: string; -} - -function createBaseSale(): Sale { - return { - treasury: "", - id: Long.UZERO, - tokenOut: "", - tokenIn: "", - tokenOutSupply: "", - startTime: undefined, - endTime: undefined, - round: Long.ZERO, - endRound: Long.ZERO, - outRemaining: "", - outSold: "", - outPerShare: "", - staked: "", - income: "", - shares: "", - name: "", - url: "" - }; -} - -export const Sale = { - encode(message: Sale, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.treasury !== "") { - writer.uint32(10).string(message.treasury); - } - - if (!message.id.isZero()) { - writer.uint32(16).uint64(message.id); - } - - if (message.tokenOut !== "") { - writer.uint32(26).string(message.tokenOut); - } - - if (message.tokenIn !== "") { - writer.uint32(34).string(message.tokenIn); - } - - if (message.tokenOutSupply !== "") { - writer.uint32(42).string(message.tokenOutSupply); - } - - if (message.startTime !== undefined) { - Timestamp.encode(toTimestamp(message.startTime), writer.uint32(50).fork()).ldelim(); - } - - if (message.endTime !== undefined) { - Timestamp.encode(toTimestamp(message.endTime), writer.uint32(58).fork()).ldelim(); - } - - if (!message.round.isZero()) { - writer.uint32(64).int64(message.round); - } - - if (!message.endRound.isZero()) { - writer.uint32(72).int64(message.endRound); - } - - if (message.outRemaining !== "") { - writer.uint32(82).string(message.outRemaining); - } - - if (message.outSold !== "") { - writer.uint32(90).string(message.outSold); - } - - if (message.outPerShare !== "") { - writer.uint32(98).string(message.outPerShare); - } - - if (message.staked !== "") { - writer.uint32(106).string(message.staked); - } - - if (message.income !== "") { - writer.uint32(114).string(message.income); - } - - if (message.shares !== "") { - writer.uint32(122).string(message.shares); - } - - if (message.name !== "") { - writer.uint32(162).string(message.name); - } - - if (message.url !== "") { - writer.uint32(170).string(message.url); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): Sale { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSale(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.treasury = reader.string(); - break; - - case 2: - message.id = (reader.uint64() as Long); - break; - - case 3: - message.tokenOut = reader.string(); - break; - - case 4: - message.tokenIn = reader.string(); - break; - - case 5: - message.tokenOutSupply = reader.string(); - break; - - case 6: - message.startTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - break; - - case 7: - message.endTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - break; - - case 8: - message.round = (reader.int64() as Long); - break; - - case 9: - message.endRound = (reader.int64() as Long); - break; - - case 10: - message.outRemaining = reader.string(); - break; - - case 11: - message.outSold = reader.string(); - break; - - case 12: - message.outPerShare = reader.string(); - break; - - case 13: - message.staked = reader.string(); - break; - - case 14: - message.income = reader.string(); - break; - - case 15: - message.shares = reader.string(); - break; - - case 20: - message.name = reader.string(); - break; - - case 21: - message.url = reader.string(); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(object: any): Sale { - return { - treasury: isSet(object.treasury) ? String(object.treasury) : "", - id: isSet(object.id) ? Long.fromValue(object.id) : Long.UZERO, - tokenOut: isSet(object.tokenOut) ? String(object.tokenOut) : "", - tokenIn: isSet(object.tokenIn) ? String(object.tokenIn) : "", - tokenOutSupply: isSet(object.tokenOutSupply) ? String(object.tokenOutSupply) : "", - startTime: isSet(object.startTime) ? fromJsonTimestamp(object.startTime) : undefined, - endTime: isSet(object.endTime) ? fromJsonTimestamp(object.endTime) : undefined, - round: isSet(object.round) ? Long.fromValue(object.round) : Long.ZERO, - endRound: isSet(object.endRound) ? Long.fromValue(object.endRound) : Long.ZERO, - outRemaining: isSet(object.outRemaining) ? String(object.outRemaining) : "", - outSold: isSet(object.outSold) ? String(object.outSold) : "", - outPerShare: isSet(object.outPerShare) ? String(object.outPerShare) : "", - staked: isSet(object.staked) ? String(object.staked) : "", - income: isSet(object.income) ? String(object.income) : "", - shares: isSet(object.shares) ? String(object.shares) : "", - name: isSet(object.name) ? String(object.name) : "", - url: isSet(object.url) ? String(object.url) : "" - }; - }, - - toJSON(message: Sale): unknown { - const obj: any = {}; - message.treasury !== undefined && (obj.treasury = message.treasury); - message.id !== undefined && (obj.id = (message.id || Long.UZERO).toString()); - message.tokenOut !== undefined && (obj.tokenOut = message.tokenOut); - message.tokenIn !== undefined && (obj.tokenIn = message.tokenIn); - message.tokenOutSupply !== undefined && (obj.tokenOutSupply = message.tokenOutSupply); - message.startTime !== undefined && (obj.startTime = message.startTime.toISOString()); - message.endTime !== undefined && (obj.endTime = message.endTime.toISOString()); - message.round !== undefined && (obj.round = (message.round || Long.ZERO).toString()); - message.endRound !== undefined && (obj.endRound = (message.endRound || Long.ZERO).toString()); - message.outRemaining !== undefined && (obj.outRemaining = message.outRemaining); - message.outSold !== undefined && (obj.outSold = message.outSold); - message.outPerShare !== undefined && (obj.outPerShare = message.outPerShare); - message.staked !== undefined && (obj.staked = message.staked); - message.income !== undefined && (obj.income = message.income); - message.shares !== undefined && (obj.shares = message.shares); - message.name !== undefined && (obj.name = message.name); - message.url !== undefined && (obj.url = message.url); - return obj; - }, - - fromPartial(object: DeepPartial): Sale { - const message = createBaseSale(); - message.treasury = object.treasury ?? ""; - message.id = object.id !== undefined && object.id !== null ? Long.fromValue(object.id) : Long.UZERO; - message.tokenOut = object.tokenOut ?? ""; - message.tokenIn = object.tokenIn ?? ""; - message.tokenOutSupply = object.tokenOutSupply ?? ""; - message.startTime = object.startTime ?? undefined; - message.endTime = object.endTime ?? undefined; - message.round = object.round !== undefined && object.round !== null ? Long.fromValue(object.round) : Long.ZERO; - message.endRound = object.endRound !== undefined && object.endRound !== null ? Long.fromValue(object.endRound) : Long.ZERO; - message.outRemaining = object.outRemaining ?? ""; - message.outSold = object.outSold ?? ""; - message.outPerShare = object.outPerShare ?? ""; - message.staked = object.staked ?? ""; - message.income = object.income ?? ""; - message.shares = object.shares ?? ""; - message.name = object.name ?? ""; - message.url = object.url ?? ""; - return message; - }, - - fromSDK(object: SaleSDKType): Sale { - return { - treasury: object?.treasury, - id: object?.id, - tokenOut: object?.token_out, - tokenIn: object?.token_in, - tokenOutSupply: object?.token_out_supply, - startTime: object.start_time ? Timestamp.fromSDK(object.start_time) : undefined, - endTime: object.end_time ? Timestamp.fromSDK(object.end_time) : undefined, - round: object?.round, - endRound: object?.end_round, - outRemaining: object?.out_remaining, - outSold: object?.out_sold, - outPerShare: object?.out_per_share, - staked: object?.staked, - income: object?.income, - shares: object?.shares, - name: object?.name, - url: object?.url - }; - }, - - toSDK(message: Sale): SaleSDKType { - const obj: any = {}; - obj.treasury = message.treasury; - obj.id = message.id; - obj.token_out = message.tokenOut; - obj.token_in = message.tokenIn; - obj.token_out_supply = message.tokenOutSupply; - message.startTime !== undefined && (obj.start_time = message.startTime ? Timestamp.toSDK(message.startTime) : undefined); - message.endTime !== undefined && (obj.end_time = message.endTime ? Timestamp.toSDK(message.endTime) : undefined); - obj.round = message.round; - obj.end_round = message.endRound; - obj.out_remaining = message.outRemaining; - obj.out_sold = message.outSold; - obj.out_per_share = message.outPerShare; - obj.staked = message.staked; - obj.income = message.income; - obj.shares = message.shares; - obj.name = message.name; - obj.url = message.url; - return obj; - } - -}; - -function createBaseUserPosition(): UserPosition { - return { - shares: "", - staked: "", - outPerShare: "", - spent: "", - purchased: "" - }; -} - -export const UserPosition = { - encode(message: UserPosition, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.shares !== "") { - writer.uint32(10).string(message.shares); - } - - if (message.staked !== "") { - writer.uint32(18).string(message.staked); - } - - if (message.outPerShare !== "") { - writer.uint32(26).string(message.outPerShare); - } - - if (message.spent !== "") { - writer.uint32(34).string(message.spent); - } - - if (message.purchased !== "") { - writer.uint32(42).string(message.purchased); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): UserPosition { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUserPosition(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.shares = reader.string(); - break; - - case 2: - message.staked = reader.string(); - break; - - case 3: - message.outPerShare = reader.string(); - break; - - case 4: - message.spent = reader.string(); - break; - - case 5: - message.purchased = reader.string(); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(object: any): UserPosition { - return { - shares: isSet(object.shares) ? String(object.shares) : "", - staked: isSet(object.staked) ? String(object.staked) : "", - outPerShare: isSet(object.outPerShare) ? String(object.outPerShare) : "", - spent: isSet(object.spent) ? String(object.spent) : "", - purchased: isSet(object.purchased) ? String(object.purchased) : "" - }; - }, - - toJSON(message: UserPosition): unknown { - const obj: any = {}; - message.shares !== undefined && (obj.shares = message.shares); - message.staked !== undefined && (obj.staked = message.staked); - message.outPerShare !== undefined && (obj.outPerShare = message.outPerShare); - message.spent !== undefined && (obj.spent = message.spent); - message.purchased !== undefined && (obj.purchased = message.purchased); - return obj; - }, - - fromPartial(object: DeepPartial): UserPosition { - const message = createBaseUserPosition(); - message.shares = object.shares ?? ""; - message.staked = object.staked ?? ""; - message.outPerShare = object.outPerShare ?? ""; - message.spent = object.spent ?? ""; - message.purchased = object.purchased ?? ""; - return message; - }, - - fromSDK(object: UserPositionSDKType): UserPosition { - return { - shares: object?.shares, - staked: object?.staked, - outPerShare: object?.out_per_share, - spent: object?.spent, - purchased: object?.purchased - }; - }, - - toSDK(message: UserPosition): UserPositionSDKType { - const obj: any = {}; - obj.shares = message.shares; - obj.staked = message.staked; - obj.out_per_share = message.outPerShare; - obj.spent = message.spent; - obj.purchased = message.purchased; - return obj; - } - -}; \ No newline at end of file diff --git a/__fixtures__/output1/osmosis/streamswap/v1/tx.amino.ts b/__fixtures__/output1/osmosis/streamswap/v1/tx.amino.ts deleted file mode 100644 index 80706a4b00..0000000000 --- a/__fixtures__/output1/osmosis/streamswap/v1/tx.amino.ts +++ /dev/null @@ -1,221 +0,0 @@ -//@ts-nocheck -import { Coin, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; -import { Timestamp, TimestampSDKType } from "../../../google/protobuf/timestamp"; -import { Duration, DurationSDKType } from "../../../google/protobuf/duration"; -import { AminoMsg } from "@cosmjs/amino"; -import { Long } from "../../../helpers"; -import { MsgCreateSale, MsgCreateSaleSDKType, MsgSubscribe, MsgSubscribeSDKType, MsgWithdraw, MsgWithdrawSDKType, MsgExitSale, MsgExitSaleSDKType, MsgFinalizeSale, MsgFinalizeSaleSDKType } from "./tx"; -export interface AminoMsgCreateSale extends AminoMsg { - type: "osmosis/streamswap/v1/create-sale"; - value: { - creator: string; - token_in: string; - token_out: { - denom: string; - amount: string; - }; - max_fee: { - denom: string; - amount: string; - }[]; - start_time: { - seconds: string; - nanos: number; - }; - duration: { - seconds: string; - nanos: number; - }; - recipient: string; - name: string; - url: string; - }; -} -export interface AminoMsgSubscribe extends AminoMsg { - type: "osmosis/streamswap/v1/subscribe"; - value: { - sender: string; - sale_id: string; - amount: string; - }; -} -export interface AminoMsgWithdraw extends AminoMsg { - type: "osmosis/streamswap/v1/withdraw"; - value: { - sender: string; - sale_id: string; - amount: string; - }; -} -export interface AminoMsgExitSale extends AminoMsg { - type: "osmosis/streamswap/v1/exit-sale"; - value: { - sender: string; - sale_id: string; - }; -} -export interface AminoMsgFinalizeSale extends AminoMsg { - type: "osmosis/streamswap/v1/finalize-sale"; - value: { - sender: string; - sale_id: string; - }; -} -export const AminoConverter = { - "/osmosis.streamswap.v1.MsgCreateSale": { - aminoType: "osmosis/streamswap/v1/create-sale", - toAmino: ({ - creator, - tokenIn, - tokenOut, - maxFee, - startTime, - duration, - recipient, - name, - url - }: MsgCreateSale): AminoMsgCreateSale["value"] => { - return { - creator, - token_in: tokenIn, - token_out: { - denom: tokenOut.denom, - amount: Long.fromValue(tokenOut.amount).toString() - }, - max_fee: maxFee.map(el0 => ({ - denom: el0.denom, - amount: el0.amount - })), - start_time: startTime, - duration: (duration * 1_000_000_000).toString(), - recipient, - name, - url - }; - }, - fromAmino: ({ - creator, - token_in, - token_out, - max_fee, - start_time, - duration, - recipient, - name, - url - }: AminoMsgCreateSale["value"]): MsgCreateSale => { - return { - creator, - tokenIn: token_in, - tokenOut: { - denom: token_out.denom, - amount: token_out.amount - }, - maxFee: max_fee.map(el0 => ({ - denom: el0.denom, - amount: el0.amount - })), - startTime: start_time, - duration: { - seconds: Long.fromNumber(Math.floor(parseInt(duration) / 1_000_000_000)), - nanos: parseInt(duration) % 1_000_000_000 - }, - recipient, - name, - url - }; - } - }, - "/osmosis.streamswap.v1.MsgSubscribe": { - aminoType: "osmosis/streamswap/v1/subscribe", - toAmino: ({ - sender, - saleId, - amount - }: MsgSubscribe): AminoMsgSubscribe["value"] => { - return { - sender, - sale_id: saleId.toString(), - amount - }; - }, - fromAmino: ({ - sender, - sale_id, - amount - }: AminoMsgSubscribe["value"]): MsgSubscribe => { - return { - sender, - saleId: Long.fromString(sale_id), - amount - }; - } - }, - "/osmosis.streamswap.v1.MsgWithdraw": { - aminoType: "osmosis/streamswap/v1/withdraw", - toAmino: ({ - sender, - saleId, - amount - }: MsgWithdraw): AminoMsgWithdraw["value"] => { - return { - sender, - sale_id: saleId.toString(), - amount - }; - }, - fromAmino: ({ - sender, - sale_id, - amount - }: AminoMsgWithdraw["value"]): MsgWithdraw => { - return { - sender, - saleId: Long.fromString(sale_id), - amount - }; - } - }, - "/osmosis.streamswap.v1.MsgExitSale": { - aminoType: "osmosis/streamswap/v1/exit-sale", - toAmino: ({ - sender, - saleId - }: MsgExitSale): AminoMsgExitSale["value"] => { - return { - sender, - sale_id: saleId.toString() - }; - }, - fromAmino: ({ - sender, - sale_id - }: AminoMsgExitSale["value"]): MsgExitSale => { - return { - sender, - saleId: Long.fromString(sale_id) - }; - } - }, - "/osmosis.streamswap.v1.MsgFinalizeSale": { - aminoType: "osmosis/streamswap/v1/finalize-sale", - toAmino: ({ - sender, - saleId - }: MsgFinalizeSale): AminoMsgFinalizeSale["value"] => { - return { - sender, - sale_id: saleId.toString() - }; - }, - fromAmino: ({ - sender, - sale_id - }: AminoMsgFinalizeSale["value"]): MsgFinalizeSale => { - return { - sender, - saleId: Long.fromString(sale_id) - }; - } - } -}; \ No newline at end of file diff --git a/__fixtures__/output1/osmosis/streamswap/v1/tx.registry.ts b/__fixtures__/output1/osmosis/streamswap/v1/tx.registry.ts deleted file mode 100644 index 47fb0a02ef..0000000000 --- a/__fixtures__/output1/osmosis/streamswap/v1/tx.registry.ts +++ /dev/null @@ -1,198 +0,0 @@ -import { Coin, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; -import { Timestamp, TimestampSDKType } from "../../../google/protobuf/timestamp"; -import { Duration, DurationSDKType } from "../../../google/protobuf/duration"; -import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgCreateSale, MsgCreateSaleSDKType, MsgSubscribe, MsgSubscribeSDKType, MsgWithdraw, MsgWithdrawSDKType, MsgExitSale, MsgExitSaleSDKType, MsgFinalizeSale, MsgFinalizeSaleSDKType } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/osmosis.streamswap.v1.MsgCreateSale", MsgCreateSale], ["/osmosis.streamswap.v1.MsgSubscribe", MsgSubscribe], ["/osmosis.streamswap.v1.MsgWithdraw", MsgWithdraw], ["/osmosis.streamswap.v1.MsgExitSale", MsgExitSale], ["/osmosis.streamswap.v1.MsgFinalizeSale", MsgFinalizeSale]]; -export const load = (protoRegistry: Registry) => { - registry.forEach(([typeUrl, mod]) => { - protoRegistry.register(typeUrl, mod); - }); -}; -export const MessageComposer = { - encoded: { - createSale(value: MsgCreateSale) { - return { - typeUrl: "/osmosis.streamswap.v1.MsgCreateSale", - value: MsgCreateSale.encode(value).finish() - }; - }, - - subscribe(value: MsgSubscribe) { - return { - typeUrl: "/osmosis.streamswap.v1.MsgSubscribe", - value: MsgSubscribe.encode(value).finish() - }; - }, - - withdraw(value: MsgWithdraw) { - return { - typeUrl: "/osmosis.streamswap.v1.MsgWithdraw", - value: MsgWithdraw.encode(value).finish() - }; - }, - - exitSale(value: MsgExitSale) { - return { - typeUrl: "/osmosis.streamswap.v1.MsgExitSale", - value: MsgExitSale.encode(value).finish() - }; - }, - - finalizeSale(value: MsgFinalizeSale) { - return { - typeUrl: "/osmosis.streamswap.v1.MsgFinalizeSale", - value: MsgFinalizeSale.encode(value).finish() - }; - } - - }, - withTypeUrl: { - createSale(value: MsgCreateSale) { - return { - typeUrl: "/osmosis.streamswap.v1.MsgCreateSale", - value - }; - }, - - subscribe(value: MsgSubscribe) { - return { - typeUrl: "/osmosis.streamswap.v1.MsgSubscribe", - value - }; - }, - - withdraw(value: MsgWithdraw) { - return { - typeUrl: "/osmosis.streamswap.v1.MsgWithdraw", - value - }; - }, - - exitSale(value: MsgExitSale) { - return { - typeUrl: "/osmosis.streamswap.v1.MsgExitSale", - value - }; - }, - - finalizeSale(value: MsgFinalizeSale) { - return { - typeUrl: "/osmosis.streamswap.v1.MsgFinalizeSale", - value - }; - } - - }, - toJSON: { - createSale(value: MsgCreateSale) { - return { - typeUrl: "/osmosis.streamswap.v1.MsgCreateSale", - value: MsgCreateSale.toJSON(value) - }; - }, - - subscribe(value: MsgSubscribe) { - return { - typeUrl: "/osmosis.streamswap.v1.MsgSubscribe", - value: MsgSubscribe.toJSON(value) - }; - }, - - withdraw(value: MsgWithdraw) { - return { - typeUrl: "/osmosis.streamswap.v1.MsgWithdraw", - value: MsgWithdraw.toJSON(value) - }; - }, - - exitSale(value: MsgExitSale) { - return { - typeUrl: "/osmosis.streamswap.v1.MsgExitSale", - value: MsgExitSale.toJSON(value) - }; - }, - - finalizeSale(value: MsgFinalizeSale) { - return { - typeUrl: "/osmosis.streamswap.v1.MsgFinalizeSale", - value: MsgFinalizeSale.toJSON(value) - }; - } - - }, - fromJSON: { - createSale(value: any) { - return { - typeUrl: "/osmosis.streamswap.v1.MsgCreateSale", - value: MsgCreateSale.fromJSON(value) - }; - }, - - subscribe(value: any) { - return { - typeUrl: "/osmosis.streamswap.v1.MsgSubscribe", - value: MsgSubscribe.fromJSON(value) - }; - }, - - withdraw(value: any) { - return { - typeUrl: "/osmosis.streamswap.v1.MsgWithdraw", - value: MsgWithdraw.fromJSON(value) - }; - }, - - exitSale(value: any) { - return { - typeUrl: "/osmosis.streamswap.v1.MsgExitSale", - value: MsgExitSale.fromJSON(value) - }; - }, - - finalizeSale(value: any) { - return { - typeUrl: "/osmosis.streamswap.v1.MsgFinalizeSale", - value: MsgFinalizeSale.fromJSON(value) - }; - } - - }, - fromPartial: { - createSale(value: MsgCreateSale) { - return { - typeUrl: "/osmosis.streamswap.v1.MsgCreateSale", - value: MsgCreateSale.fromPartial(value) - }; - }, - - subscribe(value: MsgSubscribe) { - return { - typeUrl: "/osmosis.streamswap.v1.MsgSubscribe", - value: MsgSubscribe.fromPartial(value) - }; - }, - - withdraw(value: MsgWithdraw) { - return { - typeUrl: "/osmosis.streamswap.v1.MsgWithdraw", - value: MsgWithdraw.fromPartial(value) - }; - }, - - exitSale(value: MsgExitSale) { - return { - typeUrl: "/osmosis.streamswap.v1.MsgExitSale", - value: MsgExitSale.fromPartial(value) - }; - }, - - finalizeSale(value: MsgFinalizeSale) { - return { - typeUrl: "/osmosis.streamswap.v1.MsgFinalizeSale", - value: MsgFinalizeSale.fromPartial(value) - }; - } - - } -}; \ No newline at end of file diff --git a/__fixtures__/output1/osmosis/streamswap/v1/tx.rpc.msg.ts b/__fixtures__/output1/osmosis/streamswap/v1/tx.rpc.msg.ts deleted file mode 100644 index d54b1e8b69..0000000000 --- a/__fixtures__/output1/osmosis/streamswap/v1/tx.rpc.msg.ts +++ /dev/null @@ -1,89 +0,0 @@ -import { Coin, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; -import { Timestamp, TimestampSDKType } from "../../../google/protobuf/timestamp"; -import { Duration, DurationSDKType } from "../../../google/protobuf/duration"; -import { Rpc } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; -import { MsgCreateSale, MsgCreateSaleSDKType, MsgCreateSaleResponse, MsgCreateSaleResponseSDKType, MsgSubscribe, MsgSubscribeSDKType, MsgWithdraw, MsgWithdrawSDKType, MsgExitSale, MsgExitSaleSDKType, MsgExitSaleResponse, MsgExitSaleResponseSDKType, MsgFinalizeSale, MsgFinalizeSaleSDKType, MsgFinalizeSaleResponse, MsgFinalizeSaleResponseSDKType } from "./tx"; -import { Empty, EmptySDKType } from "../../../google/protobuf/empty"; -export interface Msg { - /** - * CreateSale creates new token sale. Anyone can create a new sale. - * params.SaleBond OSMO will be charged as a bond (returned in FinalizeSale) - * to avoid spams. - * The sale follows the streamswap functionality explained in the - * x/launchapd/spec - */ - createSale(request: MsgCreateSale): Promise; - - /** - * Subscribe to a token sale. Any use at any time before the sale end can join - * the sale by sending `token_in` to the Sale through the Subscribe msg. - * During the sale, user `token_in` will be automatically charged every - * epoch to purchase `token_out`. - */ - subscribe(request: MsgSubscribe): Promise; - - /** - * Withdraw sends back `amount` of unspent tokens_in to the user. - * If `amount` is empty, it will default to all unspent tokens. - * User can do it any time unless his deposit is empty. - */ - withdraw(request: MsgWithdraw): Promise; - - /** - * ExitSale withdraws (by a user who subscribed to the sale) purchased - * tokens_out from the pool and remained tokens_in. Must be called before - * the sale end. - */ - exitSale(request: MsgExitSale): Promise; - - /** - * FinalizeSale clean ups the sale and sends income (earned tokens_in) to the - * Sale recipient. Returns error if called before the Sale end. Anyone can - * call this method. - */ - finalizeSale(request: MsgFinalizeSale): Promise; -} -export class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - - constructor(rpc: Rpc) { - this.rpc = rpc; - this.createSale = this.createSale.bind(this); - this.subscribe = this.subscribe.bind(this); - this.withdraw = this.withdraw.bind(this); - this.exitSale = this.exitSale.bind(this); - this.finalizeSale = this.finalizeSale.bind(this); - } - - createSale(request: MsgCreateSale): Promise { - const data = MsgCreateSale.encode(request).finish(); - const promise = this.rpc.request("osmosis.streamswap.v1.Msg", "CreateSale", data); - return promise.then(data => MsgCreateSaleResponse.decode(new _m0.Reader(data))); - } - - subscribe(request: MsgSubscribe): Promise { - const data = MsgSubscribe.encode(request).finish(); - const promise = this.rpc.request("osmosis.streamswap.v1.Msg", "Subscribe", data); - return promise.then(data => Empty.decode(new _m0.Reader(data))); - } - - withdraw(request: MsgWithdraw): Promise { - const data = MsgWithdraw.encode(request).finish(); - const promise = this.rpc.request("osmosis.streamswap.v1.Msg", "Withdraw", data); - return promise.then(data => Empty.decode(new _m0.Reader(data))); - } - - exitSale(request: MsgExitSale): Promise { - const data = MsgExitSale.encode(request).finish(); - const promise = this.rpc.request("osmosis.streamswap.v1.Msg", "ExitSale", data); - return promise.then(data => MsgExitSaleResponse.decode(new _m0.Reader(data))); - } - - finalizeSale(request: MsgFinalizeSale): Promise { - const data = MsgFinalizeSale.encode(request).finish(); - const promise = this.rpc.request("osmosis.streamswap.v1.Msg", "FinalizeSale", data); - return promise.then(data => MsgFinalizeSaleResponse.decode(new _m0.Reader(data))); - } - -} \ No newline at end of file diff --git a/__fixtures__/output1/osmosis/streamswap/v1/tx.ts b/__fixtures__/output1/osmosis/streamswap/v1/tx.ts deleted file mode 100644 index 92ab2135b8..0000000000 --- a/__fixtures__/output1/osmosis/streamswap/v1/tx.ts +++ /dev/null @@ -1,964 +0,0 @@ -import { Coin, CoinSDKType } from "../../../cosmos/base/v1beta1/coin"; -import { Timestamp, TimestampSDKType } from "../../../google/protobuf/timestamp"; -import { Duration, DurationSDKType } from "../../../google/protobuf/duration"; -import * as _m0 from "protobufjs/minimal"; -import { toTimestamp, fromTimestamp, isSet, fromJsonTimestamp, DeepPartial, Long } from "../../../helpers"; -export const protobufPackage = "osmosis.streamswap.v1"; -export interface MsgCreateSale { - /** - * Sale creator and the account which provides token (token_out) to the sale. - * When processing this message, token_out - */ - creator: string; - - /** - * token_in is a denom used to buy `token_out`. May be referred as a - * "quote currency". - */ - tokenIn: string; - - /** - * token_out is a coin supply (denom + amount) to sell. May be referred as - * "base currency". The whole supply will be transferred from the creator - * to the module and will be sold during the sale. - */ - tokenOut?: Coin; - - /** - * Maximum fee the creator is going to pay for creating a sale. The creator - * will be charged params.SaleCreationFee. Transaction will fail if - * max_fee is smaller than params.SaleCreationFee. If empty, the creator - * doesn't accept any fee. - */ - maxFee: Coin[]; - - /** start time when the token sale starts. */ - startTime?: Date; - - /** duration time that the sale takes place over */ - duration?: Duration; - - /** - * Recipient is the account which receives earned `token_in` from when the - * sale is finalized. If not defined (empty) the creator - * account will be used. - */ - recipient: string; - - /** Name for the sale, max 40 characters, min 4. Required. */ - name: string; - - /** - * URL with sale and project details. Can be a link a link to IPFS, - * hackmd, project page, blog post... Max 120 characters. Must be - * valid agains Go url.ParseRequestURI. Required. - */ - url: string; -} -export interface MsgCreateSaleSDKType { - /** - * Sale creator and the account which provides token (token_out) to the sale. - * When processing this message, token_out - */ - creator: string; - - /** - * token_in is a denom used to buy `token_out`. May be referred as a - * "quote currency". - */ - token_in: string; - - /** - * token_out is a coin supply (denom + amount) to sell. May be referred as - * "base currency". The whole supply will be transferred from the creator - * to the module and will be sold during the sale. - */ - token_out?: CoinSDKType; - - /** - * Maximum fee the creator is going to pay for creating a sale. The creator - * will be charged params.SaleCreationFee. Transaction will fail if - * max_fee is smaller than params.SaleCreationFee. If empty, the creator - * doesn't accept any fee. - */ - max_fee: CoinSDKType[]; - - /** start time when the token sale starts. */ - start_time?: Date; - - /** duration time that the sale takes place over */ - duration?: DurationSDKType; - - /** - * Recipient is the account which receives earned `token_in` from when the - * sale is finalized. If not defined (empty) the creator - * account will be used. - */ - recipient: string; - - /** Name for the sale, max 40 characters, min 4. Required. */ - name: string; - - /** - * URL with sale and project details. Can be a link a link to IPFS, - * hackmd, project page, blog post... Max 120 characters. Must be - * valid agains Go url.ParseRequestURI. Required. - */ - url: string; -} -export interface MsgCreateSaleResponse { - saleId: Long; -} -export interface MsgCreateSaleResponseSDKType { - sale_id: Long; -} -export interface MsgSubscribe { - /** sender is an account address adding a deposit */ - sender: string; - - /** ID of an existing sale. */ - saleId: Long; - - /** number of sale.token_in staked by a user. */ - amount: string; -} -export interface MsgSubscribeSDKType { - /** sender is an account address adding a deposit */ - sender: string; - - /** ID of an existing sale. */ - sale_id: Long; - - /** number of sale.token_in staked by a user. */ - amount: string; -} -export interface MsgWithdraw { - /** sender is an account address subscribed to the sale_id */ - sender: string; - - /** ID of a sale. */ - saleId: Long; - - /** - * amount of tokens_in to withdraw. Must be at most the amount of not spent - * tokens, unless set to null - then all remaining balance will be withdrawn. - */ - amount: string; -} -export interface MsgWithdrawSDKType { - /** sender is an account address subscribed to the sale_id */ - sender: string; - - /** ID of a sale. */ - sale_id: Long; - - /** - * amount of tokens_in to withdraw. Must be at most the amount of not spent - * tokens, unless set to null - then all remaining balance will be withdrawn. - */ - amount: string; -} -export interface MsgExitSale { - /** sender is an account address exiting a sale */ - sender: string; - - /** ID of an existing sale. */ - saleId: Long; -} -export interface MsgExitSaleSDKType { - /** sender is an account address exiting a sale */ - sender: string; - - /** ID of an existing sale. */ - sale_id: Long; -} -export interface MsgExitSaleResponse { - /** Purchased amount of "out" tokens withdrawn to the user. */ - purchased: string; -} -export interface MsgExitSaleResponseSDKType { - /** Purchased amount of "out" tokens withdrawn to the user. */ - purchased: string; -} -export interface MsgFinalizeSale { - /** sender is an account signing the message and triggering the finalization. */ - sender: string; - - /** ID of an existing sale. */ - saleId: Long; -} -export interface MsgFinalizeSaleSDKType { - /** sender is an account signing the message and triggering the finalization. */ - sender: string; - - /** ID of an existing sale. */ - sale_id: Long; -} -export interface MsgFinalizeSaleResponse { - /** Income amount of token_in sent to the sale recipient. */ - income: string; -} -export interface MsgFinalizeSaleResponseSDKType { - /** Income amount of token_in sent to the sale recipient. */ - income: string; -} - -function createBaseMsgCreateSale(): MsgCreateSale { - return { - creator: "", - tokenIn: "", - tokenOut: undefined, - maxFee: [], - startTime: undefined, - duration: undefined, - recipient: "", - name: "", - url: "" - }; -} - -export const MsgCreateSale = { - encode(message: MsgCreateSale, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.creator !== "") { - writer.uint32(10).string(message.creator); - } - - if (message.tokenIn !== "") { - writer.uint32(18).string(message.tokenIn); - } - - if (message.tokenOut !== undefined) { - Coin.encode(message.tokenOut, writer.uint32(26).fork()).ldelim(); - } - - for (const v of message.maxFee) { - Coin.encode(v!, writer.uint32(34).fork()).ldelim(); - } - - if (message.startTime !== undefined) { - Timestamp.encode(toTimestamp(message.startTime), writer.uint32(42).fork()).ldelim(); - } - - if (message.duration !== undefined) { - Duration.encode(message.duration, writer.uint32(50).fork()).ldelim(); - } - - if (message.recipient !== "") { - writer.uint32(58).string(message.recipient); - } - - if (message.name !== "") { - writer.uint32(66).string(message.name); - } - - if (message.url !== "") { - writer.uint32(74).string(message.url); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateSale { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCreateSale(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.creator = reader.string(); - break; - - case 2: - message.tokenIn = reader.string(); - break; - - case 3: - message.tokenOut = Coin.decode(reader, reader.uint32()); - break; - - case 4: - message.maxFee.push(Coin.decode(reader, reader.uint32())); - break; - - case 5: - message.startTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - break; - - case 6: - message.duration = Duration.decode(reader, reader.uint32()); - break; - - case 7: - message.recipient = reader.string(); - break; - - case 8: - message.name = reader.string(); - break; - - case 9: - message.url = reader.string(); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(object: any): MsgCreateSale { - return { - creator: isSet(object.creator) ? String(object.creator) : "", - tokenIn: isSet(object.tokenIn) ? String(object.tokenIn) : "", - tokenOut: isSet(object.tokenOut) ? Coin.fromJSON(object.tokenOut) : undefined, - maxFee: Array.isArray(object?.maxFee) ? object.maxFee.map((e: any) => Coin.fromJSON(e)) : [], - startTime: isSet(object.startTime) ? fromJsonTimestamp(object.startTime) : undefined, - duration: isSet(object.duration) ? Duration.fromJSON(object.duration) : undefined, - recipient: isSet(object.recipient) ? String(object.recipient) : "", - name: isSet(object.name) ? String(object.name) : "", - url: isSet(object.url) ? String(object.url) : "" - }; - }, - - toJSON(message: MsgCreateSale): unknown { - const obj: any = {}; - message.creator !== undefined && (obj.creator = message.creator); - message.tokenIn !== undefined && (obj.tokenIn = message.tokenIn); - message.tokenOut !== undefined && (obj.tokenOut = message.tokenOut ? Coin.toJSON(message.tokenOut) : undefined); - - if (message.maxFee) { - obj.maxFee = message.maxFee.map(e => e ? Coin.toJSON(e) : undefined); - } else { - obj.maxFee = []; - } - - message.startTime !== undefined && (obj.startTime = message.startTime.toISOString()); - message.duration !== undefined && (obj.duration = message.duration ? Duration.toJSON(message.duration) : undefined); - message.recipient !== undefined && (obj.recipient = message.recipient); - message.name !== undefined && (obj.name = message.name); - message.url !== undefined && (obj.url = message.url); - return obj; - }, - - fromPartial(object: DeepPartial): MsgCreateSale { - const message = createBaseMsgCreateSale(); - message.creator = object.creator ?? ""; - message.tokenIn = object.tokenIn ?? ""; - message.tokenOut = object.tokenOut !== undefined && object.tokenOut !== null ? Coin.fromPartial(object.tokenOut) : undefined; - message.maxFee = object.maxFee?.map(e => Coin.fromPartial(e)) || []; - message.startTime = object.startTime ?? undefined; - message.duration = object.duration !== undefined && object.duration !== null ? Duration.fromPartial(object.duration) : undefined; - message.recipient = object.recipient ?? ""; - message.name = object.name ?? ""; - message.url = object.url ?? ""; - return message; - }, - - fromSDK(object: MsgCreateSaleSDKType): MsgCreateSale { - return { - creator: object?.creator, - tokenIn: object?.token_in, - tokenOut: object.token_out ? Coin.fromSDK(object.token_out) : undefined, - maxFee: Array.isArray(object?.max_fee) ? object.max_fee.map((e: any) => Coin.fromSDK(e)) : [], - startTime: object.start_time ? Timestamp.fromSDK(object.start_time) : undefined, - duration: object.duration ? Duration.fromSDK(object.duration) : undefined, - recipient: object?.recipient, - name: object?.name, - url: object?.url - }; - }, - - toSDK(message: MsgCreateSale): MsgCreateSaleSDKType { - const obj: any = {}; - obj.creator = message.creator; - obj.token_in = message.tokenIn; - message.tokenOut !== undefined && (obj.token_out = message.tokenOut ? Coin.toSDK(message.tokenOut) : undefined); - - if (message.maxFee) { - obj.max_fee = message.maxFee.map(e => e ? Coin.toSDK(e) : undefined); - } else { - obj.max_fee = []; - } - - message.startTime !== undefined && (obj.start_time = message.startTime ? Timestamp.toSDK(message.startTime) : undefined); - message.duration !== undefined && (obj.duration = message.duration ? Duration.toSDK(message.duration) : undefined); - obj.recipient = message.recipient; - obj.name = message.name; - obj.url = message.url; - return obj; - } - -}; - -function createBaseMsgCreateSaleResponse(): MsgCreateSaleResponse { - return { - saleId: Long.UZERO - }; -} - -export const MsgCreateSaleResponse = { - encode(message: MsgCreateSaleResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.saleId.isZero()) { - writer.uint32(8).uint64(message.saleId); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateSaleResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCreateSaleResponse(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.saleId = (reader.uint64() as Long); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(object: any): MsgCreateSaleResponse { - return { - saleId: isSet(object.saleId) ? Long.fromValue(object.saleId) : Long.UZERO - }; - }, - - toJSON(message: MsgCreateSaleResponse): unknown { - const obj: any = {}; - message.saleId !== undefined && (obj.saleId = (message.saleId || Long.UZERO).toString()); - return obj; - }, - - fromPartial(object: DeepPartial): MsgCreateSaleResponse { - const message = createBaseMsgCreateSaleResponse(); - message.saleId = object.saleId !== undefined && object.saleId !== null ? Long.fromValue(object.saleId) : Long.UZERO; - return message; - }, - - fromSDK(object: MsgCreateSaleResponseSDKType): MsgCreateSaleResponse { - return { - saleId: object?.sale_id - }; - }, - - toSDK(message: MsgCreateSaleResponse): MsgCreateSaleResponseSDKType { - const obj: any = {}; - obj.sale_id = message.saleId; - return obj; - } - -}; - -function createBaseMsgSubscribe(): MsgSubscribe { - return { - sender: "", - saleId: Long.UZERO, - amount: "" - }; -} - -export const MsgSubscribe = { - encode(message: MsgSubscribe, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.sender !== "") { - writer.uint32(10).string(message.sender); - } - - if (!message.saleId.isZero()) { - writer.uint32(16).uint64(message.saleId); - } - - if (message.amount !== "") { - writer.uint32(26).string(message.amount); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSubscribe { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgSubscribe(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.sender = reader.string(); - break; - - case 2: - message.saleId = (reader.uint64() as Long); - break; - - case 3: - message.amount = reader.string(); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(object: any): MsgSubscribe { - return { - sender: isSet(object.sender) ? String(object.sender) : "", - saleId: isSet(object.saleId) ? Long.fromValue(object.saleId) : Long.UZERO, - amount: isSet(object.amount) ? String(object.amount) : "" - }; - }, - - toJSON(message: MsgSubscribe): unknown { - const obj: any = {}; - message.sender !== undefined && (obj.sender = message.sender); - message.saleId !== undefined && (obj.saleId = (message.saleId || Long.UZERO).toString()); - message.amount !== undefined && (obj.amount = message.amount); - return obj; - }, - - fromPartial(object: DeepPartial): MsgSubscribe { - const message = createBaseMsgSubscribe(); - message.sender = object.sender ?? ""; - message.saleId = object.saleId !== undefined && object.saleId !== null ? Long.fromValue(object.saleId) : Long.UZERO; - message.amount = object.amount ?? ""; - return message; - }, - - fromSDK(object: MsgSubscribeSDKType): MsgSubscribe { - return { - sender: object?.sender, - saleId: object?.sale_id, - amount: object?.amount - }; - }, - - toSDK(message: MsgSubscribe): MsgSubscribeSDKType { - const obj: any = {}; - obj.sender = message.sender; - obj.sale_id = message.saleId; - obj.amount = message.amount; - return obj; - } - -}; - -function createBaseMsgWithdraw(): MsgWithdraw { - return { - sender: "", - saleId: Long.UZERO, - amount: undefined - }; -} - -export const MsgWithdraw = { - encode(message: MsgWithdraw, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.sender !== "") { - writer.uint32(10).string(message.sender); - } - - if (!message.saleId.isZero()) { - writer.uint32(16).uint64(message.saleId); - } - - if (message.amount !== undefined) { - writer.uint32(26).string(message.amount); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): MsgWithdraw { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgWithdraw(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.sender = reader.string(); - break; - - case 2: - message.saleId = (reader.uint64() as Long); - break; - - case 3: - message.amount = reader.string(); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(object: any): MsgWithdraw { - return { - sender: isSet(object.sender) ? String(object.sender) : "", - saleId: isSet(object.saleId) ? Long.fromValue(object.saleId) : Long.UZERO, - amount: isSet(object.amount) ? String(object.amount) : undefined - }; - }, - - toJSON(message: MsgWithdraw): unknown { - const obj: any = {}; - message.sender !== undefined && (obj.sender = message.sender); - message.saleId !== undefined && (obj.saleId = (message.saleId || Long.UZERO).toString()); - message.amount !== undefined && (obj.amount = message.amount); - return obj; - }, - - fromPartial(object: DeepPartial): MsgWithdraw { - const message = createBaseMsgWithdraw(); - message.sender = object.sender ?? ""; - message.saleId = object.saleId !== undefined && object.saleId !== null ? Long.fromValue(object.saleId) : Long.UZERO; - message.amount = object.amount ?? undefined; - return message; - }, - - fromSDK(object: MsgWithdrawSDKType): MsgWithdraw { - return { - sender: object?.sender, - saleId: object?.sale_id, - amount: object?.amount - }; - }, - - toSDK(message: MsgWithdraw): MsgWithdrawSDKType { - const obj: any = {}; - obj.sender = message.sender; - obj.sale_id = message.saleId; - obj.amount = message.amount; - return obj; - } - -}; - -function createBaseMsgExitSale(): MsgExitSale { - return { - sender: "", - saleId: Long.UZERO - }; -} - -export const MsgExitSale = { - encode(message: MsgExitSale, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.sender !== "") { - writer.uint32(10).string(message.sender); - } - - if (!message.saleId.isZero()) { - writer.uint32(16).uint64(message.saleId); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): MsgExitSale { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgExitSale(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.sender = reader.string(); - break; - - case 2: - message.saleId = (reader.uint64() as Long); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(object: any): MsgExitSale { - return { - sender: isSet(object.sender) ? String(object.sender) : "", - saleId: isSet(object.saleId) ? Long.fromValue(object.saleId) : Long.UZERO - }; - }, - - toJSON(message: MsgExitSale): unknown { - const obj: any = {}; - message.sender !== undefined && (obj.sender = message.sender); - message.saleId !== undefined && (obj.saleId = (message.saleId || Long.UZERO).toString()); - return obj; - }, - - fromPartial(object: DeepPartial): MsgExitSale { - const message = createBaseMsgExitSale(); - message.sender = object.sender ?? ""; - message.saleId = object.saleId !== undefined && object.saleId !== null ? Long.fromValue(object.saleId) : Long.UZERO; - return message; - }, - - fromSDK(object: MsgExitSaleSDKType): MsgExitSale { - return { - sender: object?.sender, - saleId: object?.sale_id - }; - }, - - toSDK(message: MsgExitSale): MsgExitSaleSDKType { - const obj: any = {}; - obj.sender = message.sender; - obj.sale_id = message.saleId; - return obj; - } - -}; - -function createBaseMsgExitSaleResponse(): MsgExitSaleResponse { - return { - purchased: "" - }; -} - -export const MsgExitSaleResponse = { - encode(message: MsgExitSaleResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.purchased !== "") { - writer.uint32(10).string(message.purchased); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): MsgExitSaleResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgExitSaleResponse(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.purchased = reader.string(); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(object: any): MsgExitSaleResponse { - return { - purchased: isSet(object.purchased) ? String(object.purchased) : "" - }; - }, - - toJSON(message: MsgExitSaleResponse): unknown { - const obj: any = {}; - message.purchased !== undefined && (obj.purchased = message.purchased); - return obj; - }, - - fromPartial(object: DeepPartial): MsgExitSaleResponse { - const message = createBaseMsgExitSaleResponse(); - message.purchased = object.purchased ?? ""; - return message; - }, - - fromSDK(object: MsgExitSaleResponseSDKType): MsgExitSaleResponse { - return { - purchased: object?.purchased - }; - }, - - toSDK(message: MsgExitSaleResponse): MsgExitSaleResponseSDKType { - const obj: any = {}; - obj.purchased = message.purchased; - return obj; - } - -}; - -function createBaseMsgFinalizeSale(): MsgFinalizeSale { - return { - sender: "", - saleId: Long.UZERO - }; -} - -export const MsgFinalizeSale = { - encode(message: MsgFinalizeSale, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.sender !== "") { - writer.uint32(10).string(message.sender); - } - - if (!message.saleId.isZero()) { - writer.uint32(16).uint64(message.saleId); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): MsgFinalizeSale { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgFinalizeSale(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.sender = reader.string(); - break; - - case 2: - message.saleId = (reader.uint64() as Long); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(object: any): MsgFinalizeSale { - return { - sender: isSet(object.sender) ? String(object.sender) : "", - saleId: isSet(object.saleId) ? Long.fromValue(object.saleId) : Long.UZERO - }; - }, - - toJSON(message: MsgFinalizeSale): unknown { - const obj: any = {}; - message.sender !== undefined && (obj.sender = message.sender); - message.saleId !== undefined && (obj.saleId = (message.saleId || Long.UZERO).toString()); - return obj; - }, - - fromPartial(object: DeepPartial): MsgFinalizeSale { - const message = createBaseMsgFinalizeSale(); - message.sender = object.sender ?? ""; - message.saleId = object.saleId !== undefined && object.saleId !== null ? Long.fromValue(object.saleId) : Long.UZERO; - return message; - }, - - fromSDK(object: MsgFinalizeSaleSDKType): MsgFinalizeSale { - return { - sender: object?.sender, - saleId: object?.sale_id - }; - }, - - toSDK(message: MsgFinalizeSale): MsgFinalizeSaleSDKType { - const obj: any = {}; - obj.sender = message.sender; - obj.sale_id = message.saleId; - return obj; - } - -}; - -function createBaseMsgFinalizeSaleResponse(): MsgFinalizeSaleResponse { - return { - income: "" - }; -} - -export const MsgFinalizeSaleResponse = { - encode(message: MsgFinalizeSaleResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.income !== "") { - writer.uint32(10).string(message.income); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): MsgFinalizeSaleResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgFinalizeSaleResponse(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.income = reader.string(); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(object: any): MsgFinalizeSaleResponse { - return { - income: isSet(object.income) ? String(object.income) : "" - }; - }, - - toJSON(message: MsgFinalizeSaleResponse): unknown { - const obj: any = {}; - message.income !== undefined && (obj.income = message.income); - return obj; - }, - - fromPartial(object: DeepPartial): MsgFinalizeSaleResponse { - const message = createBaseMsgFinalizeSaleResponse(); - message.income = object.income ?? ""; - return message; - }, - - fromSDK(object: MsgFinalizeSaleResponseSDKType): MsgFinalizeSaleResponse { - return { - income: object?.income - }; - }, - - toSDK(message: MsgFinalizeSaleResponse): MsgFinalizeSaleResponseSDKType { - const obj: any = {}; - obj.income = message.income; - return obj; - } - -}; \ No newline at end of file diff --git a/__fixtures__/output1/osmosis/store/v1beta1/tree.ts b/__fixtures__/output1/osmosis/sumtree/v1beta1/tree.ts similarity index 100% rename from __fixtures__/output1/osmosis/store/v1beta1/tree.ts rename to __fixtures__/output1/osmosis/sumtree/v1beta1/tree.ts diff --git a/__fixtures__/output1/osmosis/superfluid/genesis.ts b/__fixtures__/output1/osmosis/superfluid/genesis.ts index 370eed7496..4fb549ea22 100644 --- a/__fixtures__/output1/osmosis/superfluid/genesis.ts +++ b/__fixtures__/output1/osmosis/superfluid/genesis.ts @@ -31,23 +31,8 @@ export interface GenesisState { /** GenesisState defines the module's genesis state. */ export interface GenesisStateSDKType { params?: ParamsSDKType; - - /** - * superfluid_assets defines the registered superfluid assets that have been - * registered via governance. - */ superfluid_assets: SuperfluidAssetSDKType[]; - - /** - * osmo_equivalent_multipliers is the records of osmo equivalent amount of - * each superfluid registered pool, updated every epoch. - */ osmo_equivalent_multipliers: OsmoEquivalentMultiplierRecordSDKType[]; - - /** - * intermediary_accounts is a secondary account for superfluid staking that - * plays an intermediary role between validators and the delegators. - */ intermediary_accounts: SuperfluidIntermediaryAccountSDKType[]; intemediary_account_connections: LockIdIntermediaryAccountConnectionSDKType[]; } diff --git a/__fixtures__/output1/osmosis/superfluid/params.ts b/__fixtures__/output1/osmosis/superfluid/params.ts index 0b442714a6..2e44dc76c2 100644 --- a/__fixtures__/output1/osmosis/superfluid/params.ts +++ b/__fixtures__/output1/osmosis/superfluid/params.ts @@ -15,12 +15,6 @@ export interface Params { /** Params holds parameters for the superfluid module */ export interface ParamsSDKType { - /** - * minimum_risk_factor is to be cut on OSMO equivalent value of lp tokens for - * superfluid staking, default: 5%. The minimum risk factor works - * to counter-balance the staked amount on chain's exposure to various asset - * volatilities, and have base staking be 'resistant' to volatility. - */ minimum_risk_factor: string; } diff --git a/__fixtures__/output1/osmosis/superfluid/query.lcd.ts b/__fixtures__/output1/osmosis/superfluid/query.lcd.ts index fb28e7a238..b6dddcbb8f 100644 --- a/__fixtures__/output1/osmosis/superfluid/query.lcd.ts +++ b/__fixtures__/output1/osmosis/superfluid/query.lcd.ts @@ -6,7 +6,7 @@ import { SyntheticLock, SyntheticLockSDKType } from "../lockup/lock"; import { DelegationResponse, DelegationResponseSDKType } from "../../cosmos/staking/v1beta1/staking"; import { setPaginationParams } from "../../helpers"; import { LCDClient } from "@osmonauts/lcd"; -import { QueryParamsRequest, QueryParamsRequestSDKType, QueryParamsResponse, QueryParamsResponseSDKType, AssetTypeRequest, AssetTypeRequestSDKType, AssetTypeResponse, AssetTypeResponseSDKType, AllAssetsRequest, AllAssetsRequestSDKType, AllAssetsResponse, AllAssetsResponseSDKType, AssetMultiplierRequest, AssetMultiplierRequestSDKType, AssetMultiplierResponse, AssetMultiplierResponseSDKType, AllIntermediaryAccountsRequest, AllIntermediaryAccountsRequestSDKType, AllIntermediaryAccountsResponse, AllIntermediaryAccountsResponseSDKType, ConnectedIntermediaryAccountRequest, ConnectedIntermediaryAccountRequestSDKType, ConnectedIntermediaryAccountResponse, ConnectedIntermediaryAccountResponseSDKType, TotalSuperfluidDelegationsRequest, TotalSuperfluidDelegationsRequestSDKType, TotalSuperfluidDelegationsResponse, TotalSuperfluidDelegationsResponseSDKType, SuperfluidDelegationAmountRequest, SuperfluidDelegationAmountRequestSDKType, SuperfluidDelegationAmountResponse, SuperfluidDelegationAmountResponseSDKType, SuperfluidDelegationsByDelegatorRequest, SuperfluidDelegationsByDelegatorRequestSDKType, SuperfluidDelegationsByDelegatorResponse, SuperfluidDelegationsByDelegatorResponseSDKType, SuperfluidUndelegationsByDelegatorRequest, SuperfluidUndelegationsByDelegatorRequestSDKType, SuperfluidUndelegationsByDelegatorResponse, SuperfluidUndelegationsByDelegatorResponseSDKType, SuperfluidDelegationsByValidatorDenomRequest, SuperfluidDelegationsByValidatorDenomRequestSDKType, SuperfluidDelegationsByValidatorDenomResponse, SuperfluidDelegationsByValidatorDenomResponseSDKType, EstimateSuperfluidDelegatedAmountByValidatorDenomRequest, EstimateSuperfluidDelegatedAmountByValidatorDenomRequestSDKType, EstimateSuperfluidDelegatedAmountByValidatorDenomResponse, EstimateSuperfluidDelegatedAmountByValidatorDenomResponseSDKType, QueryTotalDelegationByDelegatorRequest, QueryTotalDelegationByDelegatorRequestSDKType, QueryTotalDelegationByDelegatorResponse, QueryTotalDelegationByDelegatorResponseSDKType } from "./query"; +import { QueryParamsRequest, QueryParamsRequestSDKType, QueryParamsResponse, QueryParamsResponseSDKType, AssetTypeRequest, AssetTypeRequestSDKType, AssetTypeResponse, AssetTypeResponseSDKType, AllAssetsRequest, AllAssetsRequestSDKType, AllAssetsResponse, AllAssetsResponseSDKType, AssetMultiplierRequest, AssetMultiplierRequestSDKType, AssetMultiplierResponse, AssetMultiplierResponseSDKType, AllIntermediaryAccountsRequest, AllIntermediaryAccountsRequestSDKType, AllIntermediaryAccountsResponse, AllIntermediaryAccountsResponseSDKType, ConnectedIntermediaryAccountRequest, ConnectedIntermediaryAccountRequestSDKType, ConnectedIntermediaryAccountResponse, ConnectedIntermediaryAccountResponseSDKType, QueryTotalDelegationByValidatorForDenomRequest, QueryTotalDelegationByValidatorForDenomRequestSDKType, QueryTotalDelegationByValidatorForDenomResponse, QueryTotalDelegationByValidatorForDenomResponseSDKType, TotalSuperfluidDelegationsRequest, TotalSuperfluidDelegationsRequestSDKType, TotalSuperfluidDelegationsResponse, TotalSuperfluidDelegationsResponseSDKType, SuperfluidDelegationAmountRequest, SuperfluidDelegationAmountRequestSDKType, SuperfluidDelegationAmountResponse, SuperfluidDelegationAmountResponseSDKType, SuperfluidDelegationsByDelegatorRequest, SuperfluidDelegationsByDelegatorRequestSDKType, SuperfluidDelegationsByDelegatorResponse, SuperfluidDelegationsByDelegatorResponseSDKType, SuperfluidUndelegationsByDelegatorRequest, SuperfluidUndelegationsByDelegatorRequestSDKType, SuperfluidUndelegationsByDelegatorResponse, SuperfluidUndelegationsByDelegatorResponseSDKType, SuperfluidDelegationsByValidatorDenomRequest, SuperfluidDelegationsByValidatorDenomRequestSDKType, SuperfluidDelegationsByValidatorDenomResponse, SuperfluidDelegationsByValidatorDenomResponseSDKType, EstimateSuperfluidDelegatedAmountByValidatorDenomRequest, EstimateSuperfluidDelegatedAmountByValidatorDenomRequestSDKType, EstimateSuperfluidDelegatedAmountByValidatorDenomResponse, EstimateSuperfluidDelegatedAmountByValidatorDenomResponseSDKType, QueryTotalDelegationByDelegatorRequest, QueryTotalDelegationByDelegatorRequestSDKType, QueryTotalDelegationByDelegatorResponse, QueryTotalDelegationByDelegatorResponseSDKType, QueryUnpoolWhitelistRequest, QueryUnpoolWhitelistRequestSDKType, QueryUnpoolWhitelistResponse, QueryUnpoolWhitelistResponseSDKType } from "./query"; export class LCDQueryClient { req: LCDClient; @@ -29,6 +29,7 @@ export class LCDQueryClient { this.superfluidDelegationsByValidatorDenom = this.superfluidDelegationsByValidatorDenom.bind(this); this.estimateSuperfluidDelegatedAmountByValidatorDenom = this.estimateSuperfluidDelegatedAmountByValidatorDenom.bind(this); this.totalDelegationByDelegator = this.totalDelegationByDelegator.bind(this); + this.unpoolWhitelist = this.unpoolWhitelist.bind(this); } /* Params returns the total set of superfluid parameters. */ @@ -189,4 +190,10 @@ export class LCDQueryClient { return await this.req.get(endpoint); } + /* Returns a list of whitelisted pool ids to unpool. */ + async unpoolWhitelist(_params: QueryUnpoolWhitelistRequest = {}): Promise { + const endpoint = `osmosis/superfluid/v1beta1/unpool_whitelist`; + return await this.req.get(endpoint); + } + } \ No newline at end of file diff --git a/__fixtures__/output1/osmosis/superfluid/query.rpc.Query.ts b/__fixtures__/output1/osmosis/superfluid/query.rpc.Query.ts index 78a2d78bab..bedab578c0 100644 --- a/__fixtures__/output1/osmosis/superfluid/query.rpc.Query.ts +++ b/__fixtures__/output1/osmosis/superfluid/query.rpc.Query.ts @@ -9,7 +9,7 @@ import * as _m0 from "protobufjs/minimal"; import { QueryClient, createProtobufRpcClient, ProtobufRpcClient } from "@cosmjs/stargate"; import { ReactQueryParams } from "../../react-query"; import { useQuery } from "@tanstack/react-query"; -import { QueryParamsRequest, QueryParamsRequestSDKType, QueryParamsResponse, QueryParamsResponseSDKType, AssetTypeRequest, AssetTypeRequestSDKType, AssetTypeResponse, AssetTypeResponseSDKType, AllAssetsRequest, AllAssetsRequestSDKType, AllAssetsResponse, AllAssetsResponseSDKType, AssetMultiplierRequest, AssetMultiplierRequestSDKType, AssetMultiplierResponse, AssetMultiplierResponseSDKType, AllIntermediaryAccountsRequest, AllIntermediaryAccountsRequestSDKType, AllIntermediaryAccountsResponse, AllIntermediaryAccountsResponseSDKType, ConnectedIntermediaryAccountRequest, ConnectedIntermediaryAccountRequestSDKType, ConnectedIntermediaryAccountResponse, ConnectedIntermediaryAccountResponseSDKType, TotalSuperfluidDelegationsRequest, TotalSuperfluidDelegationsRequestSDKType, TotalSuperfluidDelegationsResponse, TotalSuperfluidDelegationsResponseSDKType, SuperfluidDelegationAmountRequest, SuperfluidDelegationAmountRequestSDKType, SuperfluidDelegationAmountResponse, SuperfluidDelegationAmountResponseSDKType, SuperfluidDelegationsByDelegatorRequest, SuperfluidDelegationsByDelegatorRequestSDKType, SuperfluidDelegationsByDelegatorResponse, SuperfluidDelegationsByDelegatorResponseSDKType, SuperfluidUndelegationsByDelegatorRequest, SuperfluidUndelegationsByDelegatorRequestSDKType, SuperfluidUndelegationsByDelegatorResponse, SuperfluidUndelegationsByDelegatorResponseSDKType, SuperfluidDelegationsByValidatorDenomRequest, SuperfluidDelegationsByValidatorDenomRequestSDKType, SuperfluidDelegationsByValidatorDenomResponse, SuperfluidDelegationsByValidatorDenomResponseSDKType, EstimateSuperfluidDelegatedAmountByValidatorDenomRequest, EstimateSuperfluidDelegatedAmountByValidatorDenomRequestSDKType, EstimateSuperfluidDelegatedAmountByValidatorDenomResponse, EstimateSuperfluidDelegatedAmountByValidatorDenomResponseSDKType, QueryTotalDelegationByDelegatorRequest, QueryTotalDelegationByDelegatorRequestSDKType, QueryTotalDelegationByDelegatorResponse, QueryTotalDelegationByDelegatorResponseSDKType } from "./query"; +import { QueryParamsRequest, QueryParamsRequestSDKType, QueryParamsResponse, QueryParamsResponseSDKType, AssetTypeRequest, AssetTypeRequestSDKType, AssetTypeResponse, AssetTypeResponseSDKType, AllAssetsRequest, AllAssetsRequestSDKType, AllAssetsResponse, AllAssetsResponseSDKType, AssetMultiplierRequest, AssetMultiplierRequestSDKType, AssetMultiplierResponse, AssetMultiplierResponseSDKType, AllIntermediaryAccountsRequest, AllIntermediaryAccountsRequestSDKType, AllIntermediaryAccountsResponse, AllIntermediaryAccountsResponseSDKType, ConnectedIntermediaryAccountRequest, ConnectedIntermediaryAccountRequestSDKType, ConnectedIntermediaryAccountResponse, ConnectedIntermediaryAccountResponseSDKType, QueryTotalDelegationByValidatorForDenomRequest, QueryTotalDelegationByValidatorForDenomRequestSDKType, QueryTotalDelegationByValidatorForDenomResponse, QueryTotalDelegationByValidatorForDenomResponseSDKType, TotalSuperfluidDelegationsRequest, TotalSuperfluidDelegationsRequestSDKType, TotalSuperfluidDelegationsResponse, TotalSuperfluidDelegationsResponseSDKType, SuperfluidDelegationAmountRequest, SuperfluidDelegationAmountRequestSDKType, SuperfluidDelegationAmountResponse, SuperfluidDelegationAmountResponseSDKType, SuperfluidDelegationsByDelegatorRequest, SuperfluidDelegationsByDelegatorRequestSDKType, SuperfluidDelegationsByDelegatorResponse, SuperfluidDelegationsByDelegatorResponseSDKType, SuperfluidUndelegationsByDelegatorRequest, SuperfluidUndelegationsByDelegatorRequestSDKType, SuperfluidUndelegationsByDelegatorResponse, SuperfluidUndelegationsByDelegatorResponseSDKType, SuperfluidDelegationsByValidatorDenomRequest, SuperfluidDelegationsByValidatorDenomRequestSDKType, SuperfluidDelegationsByValidatorDenomResponse, SuperfluidDelegationsByValidatorDenomResponseSDKType, EstimateSuperfluidDelegatedAmountByValidatorDenomRequest, EstimateSuperfluidDelegatedAmountByValidatorDenomRequestSDKType, EstimateSuperfluidDelegatedAmountByValidatorDenomResponse, EstimateSuperfluidDelegatedAmountByValidatorDenomResponseSDKType, QueryTotalDelegationByDelegatorRequest, QueryTotalDelegationByDelegatorRequestSDKType, QueryTotalDelegationByDelegatorResponse, QueryTotalDelegationByDelegatorResponseSDKType, QueryUnpoolWhitelistRequest, QueryUnpoolWhitelistRequestSDKType, QueryUnpoolWhitelistResponse, QueryUnpoolWhitelistResponseSDKType } from "./query"; /** Query defines the gRPC querier service. */ export interface Query { @@ -34,6 +34,9 @@ export interface Query { /** Returns intermediary account connected to a superfluid staked lock by id */ connectedIntermediaryAccount(request: ConnectedIntermediaryAccountRequest): Promise; + /** Returns the amount of delegations of specific denom for all validators */ + totalDelegationByValidatorForDenom(request: QueryTotalDelegationByValidatorForDenomRequest): Promise; + /** * Returns the total amount of osmo superfluidly staked. * Response is denominated in uosmo. @@ -67,6 +70,9 @@ export interface Query { /** Returns the specified delegations for a specific delegator */ totalDelegationByDelegator(request: QueryTotalDelegationByDelegatorRequest): Promise; + + /** Returns a list of whitelisted pool ids to unpool. */ + unpoolWhitelist(request?: QueryUnpoolWhitelistRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; @@ -79,6 +85,7 @@ export class QueryClientImpl implements Query { this.assetMultiplier = this.assetMultiplier.bind(this); this.allIntermediaryAccounts = this.allIntermediaryAccounts.bind(this); this.connectedIntermediaryAccount = this.connectedIntermediaryAccount.bind(this); + this.totalDelegationByValidatorForDenom = this.totalDelegationByValidatorForDenom.bind(this); this.totalSuperfluidDelegations = this.totalSuperfluidDelegations.bind(this); this.superfluidDelegationAmount = this.superfluidDelegationAmount.bind(this); this.superfluidDelegationsByDelegator = this.superfluidDelegationsByDelegator.bind(this); @@ -86,6 +93,7 @@ export class QueryClientImpl implements Query { this.superfluidDelegationsByValidatorDenom = this.superfluidDelegationsByValidatorDenom.bind(this); this.estimateSuperfluidDelegatedAmountByValidatorDenom = this.estimateSuperfluidDelegatedAmountByValidatorDenom.bind(this); this.totalDelegationByDelegator = this.totalDelegationByDelegator.bind(this); + this.unpoolWhitelist = this.unpoolWhitelist.bind(this); } params(request: QueryParamsRequest = {}): Promise { @@ -126,6 +134,12 @@ export class QueryClientImpl implements Query { return promise.then(data => ConnectedIntermediaryAccountResponse.decode(new _m0.Reader(data))); } + totalDelegationByValidatorForDenom(request: QueryTotalDelegationByValidatorForDenomRequest): Promise { + const data = QueryTotalDelegationByValidatorForDenomRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.superfluid.Query", "TotalDelegationByValidatorForDenom", data); + return promise.then(data => QueryTotalDelegationByValidatorForDenomResponse.decode(new _m0.Reader(data))); + } + totalSuperfluidDelegations(request: TotalSuperfluidDelegationsRequest = {}): Promise { const data = TotalSuperfluidDelegationsRequest.encode(request).finish(); const promise = this.rpc.request("osmosis.superfluid.Query", "TotalSuperfluidDelegations", data); @@ -168,6 +182,12 @@ export class QueryClientImpl implements Query { return promise.then(data => QueryTotalDelegationByDelegatorResponse.decode(new _m0.Reader(data))); } + unpoolWhitelist(request: QueryUnpoolWhitelistRequest = {}): Promise { + const data = QueryUnpoolWhitelistRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.superfluid.Query", "UnpoolWhitelist", data); + return promise.then(data => QueryUnpoolWhitelistResponse.decode(new _m0.Reader(data))); + } + } export const createRpcQueryExtension = (base: QueryClient) => { const rpc = createProtobufRpcClient(base); @@ -197,6 +217,10 @@ export const createRpcQueryExtension = (base: QueryClient) => { return queryService.connectedIntermediaryAccount(request); }, + totalDelegationByValidatorForDenom(request: QueryTotalDelegationByValidatorForDenomRequest): Promise { + return queryService.totalDelegationByValidatorForDenom(request); + }, + totalSuperfluidDelegations(request?: TotalSuperfluidDelegationsRequest): Promise { return queryService.totalSuperfluidDelegations(request); }, @@ -223,6 +247,10 @@ export const createRpcQueryExtension = (base: QueryClient) => { totalDelegationByDelegator(request: QueryTotalDelegationByDelegatorRequest): Promise { return queryService.totalDelegationByDelegator(request); + }, + + unpoolWhitelist(request?: QueryUnpoolWhitelistRequest): Promise { + return queryService.unpoolWhitelist(request); } }; @@ -245,6 +273,9 @@ export interface UseAllIntermediaryAccountsQuery extends ReactQueryParams export interface UseConnectedIntermediaryAccountQuery extends ReactQueryParams { request: ConnectedIntermediaryAccountRequest; } +export interface UseTotalDelegationByValidatorForDenomQuery extends ReactQueryParams { + request: QueryTotalDelegationByValidatorForDenomRequest; +} export interface UseTotalSuperfluidDelegationsQuery extends ReactQueryParams { request?: TotalSuperfluidDelegationsRequest; } @@ -266,6 +297,9 @@ export interface UseEstimateSuperfluidDelegatedAmountByValidatorDenomQuery extends ReactQueryParams { request: QueryTotalDelegationByDelegatorRequest; } +export interface UseUnpoolWhitelistQuery extends ReactQueryParams { + request?: QueryUnpoolWhitelistRequest; +} const _queryClients: WeakMap = new WeakMap(); @@ -346,6 +380,16 @@ export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { }, options); }; + const useTotalDelegationByValidatorForDenom = ({ + request, + options + }: UseTotalDelegationByValidatorForDenomQuery) => { + return useQuery(["totalDelegationByValidatorForDenomQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.totalDelegationByValidatorForDenom(request); + }, options); + }; + const useTotalSuperfluidDelegations = ({ request, options @@ -416,6 +460,16 @@ export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { }, options); }; + const useUnpoolWhitelist = ({ + request, + options + }: UseUnpoolWhitelistQuery) => { + return useQuery(["unpoolWhitelistQuery", request], () => { + if (!queryService) throw new Error("Query Service not initialized"); + return queryService.unpoolWhitelist(request); + }, options); + }; + return { /** Params returns the total set of superfluid parameters. */ useParams, @@ -438,6 +492,9 @@ export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { /** Returns intermediary account connected to a superfluid staked lock by id */ useConnectedIntermediaryAccount, + /** Returns the amount of delegations of specific denom for all validators */ + useTotalDelegationByValidatorForDenom, + /** * Returns the total amount of osmo superfluidly staked. * Response is denominated in uosmo. @@ -470,6 +527,9 @@ export const createRpcQueryHooks = (rpc: ProtobufRpcClient | undefined) => { useEstimateSuperfluidDelegatedAmountByValidatorDenom, /** Returns the specified delegations for a specific delegator */ - useTotalDelegationByDelegator + useTotalDelegationByDelegator, + + /** Returns a list of whitelisted pool ids to unpool. */ + useUnpoolWhitelist }; }; \ No newline at end of file diff --git a/__fixtures__/output1/osmosis/superfluid/query.ts b/__fixtures__/output1/osmosis/superfluid/query.ts index db28c7e9dd..a24c77e6ea 100644 --- a/__fixtures__/output1/osmosis/superfluid/query.ts +++ b/__fixtures__/output1/osmosis/superfluid/query.ts @@ -14,7 +14,6 @@ export interface QueryParamsResponse { params?: Params; } export interface QueryParamsResponseSDKType { - /** params defines the parameters of the module. */ params?: ParamsSDKType; } export interface AssetTypeRequest { @@ -87,6 +86,28 @@ export interface ConnectedIntermediaryAccountResponse { export interface ConnectedIntermediaryAccountResponseSDKType { account?: SuperfluidIntermediaryAccountInfoSDKType; } +export interface QueryTotalDelegationByValidatorForDenomRequest { + denom: string; +} +export interface QueryTotalDelegationByValidatorForDenomRequestSDKType { + denom: string; +} +export interface QueryTotalDelegationByValidatorForDenomResponse { + assets: Delegations[]; +} +export interface QueryTotalDelegationByValidatorForDenomResponseSDKType { + assets: DelegationsSDKType[]; +} +export interface Delegations { + valAddr: string; + amountSfsd: string; + osmoEquivalent: string; +} +export interface DelegationsSDKType { + val_addr: string; + amount_sfsd: string; + osmo_equivalent: string; +} export interface TotalSuperfluidDelegationsRequest {} export interface TotalSuperfluidDelegationsRequestSDKType {} export interface TotalSuperfluidDelegationsResponse { @@ -191,6 +212,14 @@ export interface QueryTotalDelegationByDelegatorResponseSDKType { total_delegated_coins: CoinSDKType[]; total_equivalent_staked_amount?: CoinSDKType; } +export interface QueryUnpoolWhitelistRequest {} +export interface QueryUnpoolWhitelistRequestSDKType {} +export interface QueryUnpoolWhitelistResponse { + poolIds: Long[]; +} +export interface QueryUnpoolWhitelistResponseSDKType { + pool_ids: Long[]; +} function createBaseQueryParamsRequest(): QueryParamsRequest { return {}; @@ -1135,6 +1164,253 @@ export const ConnectedIntermediaryAccountResponse = { }; +function createBaseQueryTotalDelegationByValidatorForDenomRequest(): QueryTotalDelegationByValidatorForDenomRequest { + return { + denom: "" + }; +} + +export const QueryTotalDelegationByValidatorForDenomRequest = { + encode(message: QueryTotalDelegationByValidatorForDenomRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryTotalDelegationByValidatorForDenomRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTotalDelegationByValidatorForDenomRequest(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): QueryTotalDelegationByValidatorForDenomRequest { + return { + denom: isSet(object.denom) ? String(object.denom) : "" + }; + }, + + toJSON(message: QueryTotalDelegationByValidatorForDenomRequest): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + return obj; + }, + + fromPartial(object: DeepPartial): QueryTotalDelegationByValidatorForDenomRequest { + const message = createBaseQueryTotalDelegationByValidatorForDenomRequest(); + message.denom = object.denom ?? ""; + return message; + }, + + fromSDK(object: QueryTotalDelegationByValidatorForDenomRequestSDKType): QueryTotalDelegationByValidatorForDenomRequest { + return { + denom: object?.denom + }; + }, + + toSDK(message: QueryTotalDelegationByValidatorForDenomRequest): QueryTotalDelegationByValidatorForDenomRequestSDKType { + const obj: any = {}; + obj.denom = message.denom; + return obj; + } + +}; + +function createBaseQueryTotalDelegationByValidatorForDenomResponse(): QueryTotalDelegationByValidatorForDenomResponse { + return { + assets: [] + }; +} + +export const QueryTotalDelegationByValidatorForDenomResponse = { + encode(message: QueryTotalDelegationByValidatorForDenomResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.assets) { + Delegations.encode(v!, writer.uint32(10).fork()).ldelim(); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryTotalDelegationByValidatorForDenomResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTotalDelegationByValidatorForDenomResponse(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.assets.push(Delegations.decode(reader, reader.uint32())); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): QueryTotalDelegationByValidatorForDenomResponse { + return { + assets: Array.isArray(object?.assets) ? object.assets.map((e: any) => Delegations.fromJSON(e)) : [] + }; + }, + + toJSON(message: QueryTotalDelegationByValidatorForDenomResponse): unknown { + const obj: any = {}; + + if (message.assets) { + obj.assets = message.assets.map(e => e ? Delegations.toJSON(e) : undefined); + } else { + obj.assets = []; + } + + return obj; + }, + + fromPartial(object: DeepPartial): QueryTotalDelegationByValidatorForDenomResponse { + const message = createBaseQueryTotalDelegationByValidatorForDenomResponse(); + message.assets = object.assets?.map(e => Delegations.fromPartial(e)) || []; + return message; + }, + + fromSDK(object: QueryTotalDelegationByValidatorForDenomResponseSDKType): QueryTotalDelegationByValidatorForDenomResponse { + return { + assets: Array.isArray(object?.assets) ? object.assets.map((e: any) => Delegations.fromSDK(e)) : [] + }; + }, + + toSDK(message: QueryTotalDelegationByValidatorForDenomResponse): QueryTotalDelegationByValidatorForDenomResponseSDKType { + const obj: any = {}; + + if (message.assets) { + obj.assets = message.assets.map(e => e ? Delegations.toSDK(e) : undefined); + } else { + obj.assets = []; + } + + return obj; + } + +}; + +function createBaseDelegations(): Delegations { + return { + valAddr: "", + amountSfsd: "", + osmoEquivalent: "" + }; +} + +export const Delegations = { + encode(message: Delegations, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.valAddr !== "") { + writer.uint32(10).string(message.valAddr); + } + + if (message.amountSfsd !== "") { + writer.uint32(18).string(message.amountSfsd); + } + + if (message.osmoEquivalent !== "") { + writer.uint32(26).string(message.osmoEquivalent); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Delegations { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDelegations(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.valAddr = reader.string(); + break; + + case 2: + message.amountSfsd = reader.string(); + break; + + case 3: + message.osmoEquivalent = reader.string(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): Delegations { + return { + valAddr: isSet(object.valAddr) ? String(object.valAddr) : "", + amountSfsd: isSet(object.amountSfsd) ? String(object.amountSfsd) : "", + osmoEquivalent: isSet(object.osmoEquivalent) ? String(object.osmoEquivalent) : "" + }; + }, + + toJSON(message: Delegations): unknown { + const obj: any = {}; + message.valAddr !== undefined && (obj.valAddr = message.valAddr); + message.amountSfsd !== undefined && (obj.amountSfsd = message.amountSfsd); + message.osmoEquivalent !== undefined && (obj.osmoEquivalent = message.osmoEquivalent); + return obj; + }, + + fromPartial(object: DeepPartial): Delegations { + const message = createBaseDelegations(); + message.valAddr = object.valAddr ?? ""; + message.amountSfsd = object.amountSfsd ?? ""; + message.osmoEquivalent = object.osmoEquivalent ?? ""; + return message; + }, + + fromSDK(object: DelegationsSDKType): Delegations { + return { + valAddr: object?.val_addr, + amountSfsd: object?.amount_sfsd, + osmoEquivalent: object?.osmo_equivalent + }; + }, + + toSDK(message: Delegations): DelegationsSDKType { + const obj: any = {}; + obj.val_addr = message.valAddr; + obj.amount_sfsd = message.amountSfsd; + obj.osmo_equivalent = message.osmoEquivalent; + return obj; + } + +}; + function createBaseTotalSuperfluidDelegationsRequest(): TotalSuperfluidDelegationsRequest { return {}; } @@ -2372,4 +2648,149 @@ export const QueryTotalDelegationByDelegatorResponse = { return obj; } +}; + +function createBaseQueryUnpoolWhitelistRequest(): QueryUnpoolWhitelistRequest { + return {}; +} + +export const QueryUnpoolWhitelistRequest = { + encode(_: QueryUnpoolWhitelistRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryUnpoolWhitelistRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUnpoolWhitelistRequest(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(_: any): QueryUnpoolWhitelistRequest { + return {}; + }, + + toJSON(_: QueryUnpoolWhitelistRequest): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): QueryUnpoolWhitelistRequest { + const message = createBaseQueryUnpoolWhitelistRequest(); + return message; + }, + + fromSDK(_: QueryUnpoolWhitelistRequestSDKType): QueryUnpoolWhitelistRequest { + return {}; + }, + + toSDK(_: QueryUnpoolWhitelistRequest): QueryUnpoolWhitelistRequestSDKType { + const obj: any = {}; + return obj; + } + +}; + +function createBaseQueryUnpoolWhitelistResponse(): QueryUnpoolWhitelistResponse { + return { + poolIds: [] + }; +} + +export const QueryUnpoolWhitelistResponse = { + encode(message: QueryUnpoolWhitelistResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + writer.uint32(10).fork(); + + for (const v of message.poolIds) { + writer.uint64(v); + } + + writer.ldelim(); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryUnpoolWhitelistResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUnpoolWhitelistResponse(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + + while (reader.pos < end2) { + message.poolIds.push((reader.uint64() as Long)); + } + } else { + message.poolIds.push((reader.uint64() as Long)); + } + + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): QueryUnpoolWhitelistResponse { + return { + poolIds: Array.isArray(object?.poolIds) ? object.poolIds.map((e: any) => Long.fromValue(e)) : [] + }; + }, + + toJSON(message: QueryUnpoolWhitelistResponse): unknown { + const obj: any = {}; + + if (message.poolIds) { + obj.poolIds = message.poolIds.map(e => (e || Long.UZERO).toString()); + } else { + obj.poolIds = []; + } + + return obj; + }, + + fromPartial(object: DeepPartial): QueryUnpoolWhitelistResponse { + const message = createBaseQueryUnpoolWhitelistResponse(); + message.poolIds = object.poolIds?.map(e => Long.fromValue(e)) || []; + return message; + }, + + fromSDK(object: QueryUnpoolWhitelistResponseSDKType): QueryUnpoolWhitelistResponse { + return { + poolIds: Array.isArray(object?.pool_ids) ? object.pool_ids.map((e: any) => e) : [] + }; + }, + + toSDK(message: QueryUnpoolWhitelistResponse): QueryUnpoolWhitelistResponseSDKType { + const obj: any = {}; + + if (message.poolIds) { + obj.pool_ids = message.poolIds.map(e => e); + } else { + obj.pool_ids = []; + } + + return obj; + } + }; \ No newline at end of file diff --git a/__fixtures__/output1/osmosis/superfluid/superfluid.ts b/__fixtures__/output1/osmosis/superfluid/superfluid.ts index 50d87351b9..b27ff112b9 100644 --- a/__fixtures__/output1/osmosis/superfluid/superfluid.ts +++ b/__fixtures__/output1/osmosis/superfluid/superfluid.ts @@ -57,11 +57,6 @@ export interface SuperfluidAsset { /** SuperfluidAsset stores the pair of superfluid asset type and denom pair */ export interface SuperfluidAssetSDKType { denom: string; - - /** - * AssetType indicates whether the superfluid asset is a native token or an lp - * share - */ asset_type: SuperfluidAssetType; } @@ -85,11 +80,8 @@ export interface SuperfluidIntermediaryAccount { * actual account responsible for delegation, not the validator account itself. */ export interface SuperfluidIntermediaryAccountSDKType { - /** Denom indicates the denom of the superfluid asset. */ denom: string; val_addr: string; - - /** perpetual gauge for rewards distribution */ gauge_id: Long; } @@ -121,8 +113,6 @@ export interface OsmoEquivalentMultiplierRecord { */ export interface OsmoEquivalentMultiplierRecordSDKType { epoch_number: Long; - - /** superfluid asset denom, can be LP token or native token */ denom: string; multiplier: string; } diff --git a/__fixtures__/output1/osmosis/superfluid/v1beta1/gov.ts b/__fixtures__/output1/osmosis/superfluid/v1beta1/gov.ts index 61112fad44..b43310c732 100644 --- a/__fixtures__/output1/osmosis/superfluid/v1beta1/gov.ts +++ b/__fixtures__/output1/osmosis/superfluid/v1beta1/gov.ts @@ -1,6 +1,6 @@ import { SuperfluidAsset, SuperfluidAssetSDKType } from "../superfluid"; import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial } from "../../../helpers"; +import { isSet, DeepPartial, Long } from "../../../helpers"; export const protobufPackage = "osmosis.superfluid.v1beta1"; /** @@ -43,6 +43,28 @@ export interface RemoveSuperfluidAssetsProposalSDKType { superfluid_asset_denoms: string[]; } +/** + * UpdateUnpoolWhiteListProposal is a gov Content type to update the + * allowed list of pool ids. + */ +export interface UpdateUnpoolWhiteListProposal { + title: string; + description: string; + ids: Long[]; + isOverwrite: boolean; +} + +/** + * UpdateUnpoolWhiteListProposal is a gov Content type to update the + * allowed list of pool ids. + */ +export interface UpdateUnpoolWhiteListProposalSDKType { + title: string; + description: string; + ids: Long[]; + is_overwrite: boolean; +} + function createBaseSetSuperfluidAssetsProposal(): SetSuperfluidAssetsProposal { return { title: "", @@ -259,4 +281,140 @@ export const RemoveSuperfluidAssetsProposal = { return obj; } +}; + +function createBaseUpdateUnpoolWhiteListProposal(): UpdateUnpoolWhiteListProposal { + return { + title: "", + description: "", + ids: [], + isOverwrite: false + }; +} + +export const UpdateUnpoolWhiteListProposal = { + encode(message: UpdateUnpoolWhiteListProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + + writer.uint32(26).fork(); + + for (const v of message.ids) { + writer.uint64(v); + } + + writer.ldelim(); + + if (message.isOverwrite === true) { + writer.uint32(32).bool(message.isOverwrite); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UpdateUnpoolWhiteListProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateUnpoolWhiteListProposal(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + + case 2: + message.description = reader.string(); + break; + + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + + while (reader.pos < end2) { + message.ids.push((reader.uint64() as Long)); + } + } else { + message.ids.push((reader.uint64() as Long)); + } + + break; + + case 4: + message.isOverwrite = reader.bool(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): UpdateUnpoolWhiteListProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + ids: Array.isArray(object?.ids) ? object.ids.map((e: any) => Long.fromValue(e)) : [], + isOverwrite: isSet(object.isOverwrite) ? Boolean(object.isOverwrite) : false + }; + }, + + toJSON(message: UpdateUnpoolWhiteListProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + + if (message.ids) { + obj.ids = message.ids.map(e => (e || Long.UZERO).toString()); + } else { + obj.ids = []; + } + + message.isOverwrite !== undefined && (obj.isOverwrite = message.isOverwrite); + return obj; + }, + + fromPartial(object: DeepPartial): UpdateUnpoolWhiteListProposal { + const message = createBaseUpdateUnpoolWhiteListProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.ids = object.ids?.map(e => Long.fromValue(e)) || []; + message.isOverwrite = object.isOverwrite ?? false; + return message; + }, + + fromSDK(object: UpdateUnpoolWhiteListProposalSDKType): UpdateUnpoolWhiteListProposal { + return { + title: object?.title, + description: object?.description, + ids: Array.isArray(object?.ids) ? object.ids.map((e: any) => e) : [], + isOverwrite: object?.is_overwrite + }; + }, + + toSDK(message: UpdateUnpoolWhiteListProposal): UpdateUnpoolWhiteListProposalSDKType { + const obj: any = {}; + obj.title = message.title; + obj.description = message.description; + + if (message.ids) { + obj.ids = message.ids.map(e => e); + } else { + obj.ids = []; + } + + obj.is_overwrite = message.isOverwrite; + return obj; + } + }; \ No newline at end of file diff --git a/__fixtures__/output1/osmosis/tokenfactory/v1beta1/authorityMetadata.ts b/__fixtures__/output1/osmosis/tokenfactory/v1beta1/authorityMetadata.ts index 0b240ab018..620c775302 100644 --- a/__fixtures__/output1/osmosis/tokenfactory/v1beta1/authorityMetadata.ts +++ b/__fixtures__/output1/osmosis/tokenfactory/v1beta1/authorityMetadata.ts @@ -18,7 +18,6 @@ export interface DenomAuthorityMetadata { * permission, but is planned to be extended to the future. */ export interface DenomAuthorityMetadataSDKType { - /** Can be empty for no admin, or a valid osmosis address */ admin: string; } diff --git a/__fixtures__/output1/osmosis/tokenfactory/v1beta1/genesis.ts b/__fixtures__/output1/osmosis/tokenfactory/v1beta1/genesis.ts index 566a86bf4f..725614a3ad 100644 --- a/__fixtures__/output1/osmosis/tokenfactory/v1beta1/genesis.ts +++ b/__fixtures__/output1/osmosis/tokenfactory/v1beta1/genesis.ts @@ -13,7 +13,6 @@ export interface GenesisState { /** GenesisState defines the tokenfactory module's genesis state. */ export interface GenesisStateSDKType { - /** params defines the paramaters of the module. */ params?: ParamsSDKType; factory_denoms: GenesisDenomSDKType[]; } diff --git a/__fixtures__/output1/osmosis/tokenfactory/v1beta1/query.ts b/__fixtures__/output1/osmosis/tokenfactory/v1beta1/query.ts index 1b8e463d7b..8e2b360207 100644 --- a/__fixtures__/output1/osmosis/tokenfactory/v1beta1/query.ts +++ b/__fixtures__/output1/osmosis/tokenfactory/v1beta1/query.ts @@ -18,7 +18,6 @@ export interface QueryParamsResponse { /** QueryParamsResponse is the response type for the Query/Params RPC method. */ export interface QueryParamsResponseSDKType { - /** params defines the parameters of the module. */ params?: ParamsSDKType; } diff --git a/__fixtures__/output1/osmosis/tokenfactory/v1beta1/tx.ts b/__fixtures__/output1/osmosis/tokenfactory/v1beta1/tx.ts index d38ff839f9..0e3f7767bc 100644 --- a/__fixtures__/output1/osmosis/tokenfactory/v1beta1/tx.ts +++ b/__fixtures__/output1/osmosis/tokenfactory/v1beta1/tx.ts @@ -35,8 +35,6 @@ export interface MsgCreateDenom { */ export interface MsgCreateDenomSDKType { sender: string; - - /** subdenom can be up to 44 "alphanumeric" characters long. */ subdenom: string; } diff --git a/__fixtures__/output1/osmosis/twap/v1beta1/genesis.ts b/__fixtures__/output1/osmosis/twap/v1beta1/genesis.ts index 4d971c7d98..d433c906f2 100644 --- a/__fixtures__/output1/osmosis/twap/v1beta1/genesis.ts +++ b/__fixtures__/output1/osmosis/twap/v1beta1/genesis.ts @@ -27,10 +27,7 @@ export interface GenesisState { /** GenesisState defines the twap module's genesis state. */ export interface GenesisStateSDKType { - /** twaps is the collection of all twap records. */ twaps: TwapRecordSDKType[]; - - /** params is the container of twap parameters. */ params?: ParamsSDKType; } diff --git a/__fixtures__/output1/osmosis/twap/v1beta1/twap_record.ts b/__fixtures__/output1/osmosis/twap/v1beta1/twap_record.ts index ae7f8481fa..f8d34a0a5c 100644 --- a/__fixtures__/output1/osmosis/twap/v1beta1/twap_record.ts +++ b/__fixtures__/output1/osmosis/twap/v1beta1/twap_record.ts @@ -58,36 +58,14 @@ export interface TwapRecord { */ export interface TwapRecordSDKType { pool_id: Long; - - /** Lexicographically smaller denom of the pair */ asset0_denom: string; - - /** Lexicographically larger denom of the pair */ asset1_denom: string; - - /** height this record corresponds to, for debugging purposes */ height: Long; - - /** - * This field should only exist until we have a global registry in the state - * machine, mapping prior block heights within {TIME RANGE} to times. - */ time?: Date; - - /** - * We store the last spot prices in the struct, so that we can interpolate - * accumulator values for times between when accumulator records are stored. - */ p0_last_spot_price: string; p1_last_spot_price: string; p0_arithmetic_twap_accumulator: string; p1_arithmetic_twap_accumulator: string; - - /** - * This field contains the time in which the last spot price error occured. - * It is used to alert the caller if they are getting a potentially erroneous - * TWAP, due to an unforeseen underlying error. - */ last_error_time?: Date; } diff --git a/__fixtures__/output1/tendermint/abci/types.ts b/__fixtures__/output1/tendermint/abci/types.ts index 809bda650d..7abd7601ac 100644 --- a/__fixtures__/output1/tendermint/abci/types.ts +++ b/__fixtures__/output1/tendermint/abci/types.ts @@ -384,10 +384,7 @@ export interface RequestOfferSnapshot { /** offers a snapshot to the application */ export interface RequestOfferSnapshotSDKType { - /** snapshot offered by peers */ snapshot?: SnapshotSDKType; - - /** light client-verified app hash for snapshot height */ app_hash: Uint8Array; } @@ -499,8 +496,6 @@ export interface ResponseSetOption { /** nondeterministic */ export interface ResponseSetOptionSDKType { code: number; - - /** bytes data = 2; */ log: string; info: string; } @@ -531,11 +526,7 @@ export interface ResponseQuery { } export interface ResponseQuerySDKType { code: number; - - /** bytes data = 2; // use "value" instead. */ log: string; - - /** nondeterministic */ info: string; index: Long; key: Uint8Array; @@ -567,11 +558,7 @@ export interface ResponseCheckTx { export interface ResponseCheckTxSDKType { code: number; data: Uint8Array; - - /** nondeterministic */ log: string; - - /** nondeterministic */ info: string; gas_wanted: Long; gas_used: Long; @@ -595,11 +582,7 @@ export interface ResponseDeliverTx { export interface ResponseDeliverTxSDKType { code: number; data: Uint8Array; - - /** nondeterministic */ log: string; - - /** nondeterministic */ info: string; gas_wanted: Long; gas_used: Long; @@ -622,7 +605,6 @@ export interface ResponseCommit { retainHeight: Long; } export interface ResponseCommitSDKType { - /** reserve 1 */ data: Uint8Array; retain_height: Long; } @@ -655,11 +637,7 @@ export interface ResponseApplySnapshotChunk { } export interface ResponseApplySnapshotChunkSDKType { result: ResponseApplySnapshotChunk_Result; - - /** Chunks to refetch and reapply */ refetch_chunks: number[]; - - /** Chunk senders to reject and ban */ reject_senders: string[]; } @@ -696,10 +674,7 @@ export interface BlockParams { /** BlockParams contains limits on the block size. */ export interface BlockParamsSDKType { - /** Note: must be greater than 0 */ max_bytes: Long; - - /** Note: must be greater or equal to -1 */ max_gas: Long; } export interface LastCommitInfo { @@ -744,8 +719,6 @@ export interface EventAttribute { export interface EventAttributeSDKType { key: Uint8Array; value: Uint8Array; - - /** nondeterministic */ index: boolean; } @@ -787,13 +760,7 @@ export interface Validator { /** Validator */ export interface ValidatorSDKType { - /** - * The first 20 bytes of SHA256(public key) - * PubKey pub_key = 2 [(gogoproto.nullable)=false]; - */ address: Uint8Array; - - /** The voting power */ power: Long; } @@ -841,21 +808,9 @@ export interface Evidence { } export interface EvidenceSDKType { type: EvidenceType; - - /** The offending validator */ validator?: ValidatorSDKType; - - /** The height when the offense occurred */ height: Long; - - /** The corresponding time where the offense occurred */ time?: Date; - - /** - * Total voting power of the validator set in case the ABCI application does - * not store historical validators. - * https://github.com/tendermint/tendermint/issues/4581 - */ total_voting_power: Long; } export interface Snapshot { @@ -875,19 +830,10 @@ export interface Snapshot { metadata: Uint8Array; } export interface SnapshotSDKType { - /** The height at which the snapshot was taken */ height: Long; - - /** The application-specific snapshot format */ format: number; - - /** Number of chunks in the snapshot */ chunks: number; - - /** Arbitrary snapshot hash, equal only if identical */ hash: Uint8Array; - - /** Arbitrary application metadata */ metadata: Uint8Array; } diff --git a/__fixtures__/output1/tendermint/bundle.ts b/__fixtures__/output1/tendermint/bundle.ts index 984951a4fe..b52bc06565 100644 --- a/__fixtures__/output1/tendermint/bundle.ts +++ b/__fixtures__/output1/tendermint/bundle.ts @@ -1,39 +1,39 @@ -import * as _307 from "./abci/types"; -import * as _308 from "./crypto/keys"; -import * as _309 from "./crypto/proof"; -import * as _310 from "./libs/bits/types"; -import * as _311 from "./p2p/types"; -import * as _312 from "./types/block"; -import * as _313 from "./types/evidence"; -import * as _314 from "./types/params"; -import * as _315 from "./types/types"; -import * as _316 from "./types/validator"; -import * as _317 from "./version/types"; -import * as _534 from "./abci/types.rpc.ABCIApplication"; -import * as _559 from "./lcd"; -import * as _560 from "./rpc.query"; +import * as _305 from "./abci/types"; +import * as _306 from "./crypto/keys"; +import * as _307 from "./crypto/proof"; +import * as _308 from "./libs/bits/types"; +import * as _309 from "./p2p/types"; +import * as _310 from "./types/block"; +import * as _311 from "./types/evidence"; +import * as _312 from "./types/params"; +import * as _313 from "./types/types"; +import * as _314 from "./types/validator"; +import * as _315 from "./version/types"; +import * as _531 from "./abci/types.rpc.ABCIApplication"; +import * as _556 from "./lcd"; +import * as _557 from "./rpc.query"; export namespace tendermint { - export const abci = { ..._307, - ..._534 + export const abci = { ..._305, + ..._531 }; - export const crypto = { ..._308, - ..._309 + export const crypto = { ..._306, + ..._307 }; export namespace libs { - export const bits = { ..._310 + export const bits = { ..._308 }; } - export const p2p = { ..._311 + export const p2p = { ..._309 }; - export const types = { ..._312, + export const types = { ..._310, + ..._311, + ..._312, ..._313, - ..._314, - ..._315, - ..._316 + ..._314 }; - export const version = { ..._317 + export const version = { ..._315 }; - export const ClientFactory = { ..._559, - ..._560 + export const ClientFactory = { ..._556, + ..._557 }; } \ No newline at end of file diff --git a/__fixtures__/output1/tendermint/crypto/proof.ts b/__fixtures__/output1/tendermint/crypto/proof.ts index 9bd1c26ad7..497024fc98 100644 --- a/__fixtures__/output1/tendermint/crypto/proof.ts +++ b/__fixtures__/output1/tendermint/crypto/proof.ts @@ -21,10 +21,7 @@ export interface ValueOp { proof?: Proof; } export interface ValueOpSDKType { - /** Encoded in ProofOp.Key. */ key: Uint8Array; - - /** To encode in ProofOp.Data */ proof?: ProofSDKType; } export interface DominoOp { diff --git a/__fixtures__/output1/tendermint/types/params.ts b/__fixtures__/output1/tendermint/types/params.ts index be42205b37..5f8022df8d 100644 --- a/__fixtures__/output1/tendermint/types/params.ts +++ b/__fixtures__/output1/tendermint/types/params.ts @@ -50,24 +50,8 @@ export interface BlockParams { /** BlockParams contains limits on the block size. */ export interface BlockParamsSDKType { - /** - * Max block size, in bytes. - * Note: must be greater than 0 - */ max_bytes: Long; - - /** - * Max gas per block. - * Note: must be greater or equal to -1 - */ max_gas: Long; - - /** - * Minimum time increment between consecutive blocks (in milliseconds) If the - * block header timestamp is ahead of the system clock, decrease this value. - * - * Not exposed to the application. - */ time_iota_ms: Long; } @@ -100,28 +84,8 @@ export interface EvidenceParams { /** EvidenceParams determine how we handle evidence of malfeasance. */ export interface EvidenceParamsSDKType { - /** - * Max age of evidence, in blocks. - * - * The basic formula for calculating this is: MaxAgeDuration / {average block - * time}. - */ max_age_num_blocks: Long; - - /** - * Max age of evidence, in time. - * - * It should correspond with an app's "unbonding period" or other similar - * mechanism for handling [Nothing-At-Stake - * attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed). - */ max_age_duration?: DurationSDKType; - - /** - * This sets the maximum size of total evidence in bytes that can be committed in a single block. - * and should fall comfortably under the max block bytes. - * Default is 1048576 or 1MB - */ max_bytes: Long; } diff --git a/__fixtures__/output1/tendermint/types/types.ts b/__fixtures__/output1/tendermint/types/types.ts index 0d861ffa77..d33ce6afde 100644 --- a/__fixtures__/output1/tendermint/types/types.ts +++ b/__fixtures__/output1/tendermint/types/types.ts @@ -187,36 +187,19 @@ export interface Header { /** Header defines the structure of a Tendermint block header. */ export interface HeaderSDKType { - /** basic block info */ version?: ConsensusSDKType; chain_id: string; height: Long; time?: Date; - - /** prev block info */ last_block_id?: BlockIDSDKType; - - /** hashes of block data */ last_commit_hash: Uint8Array; data_hash: Uint8Array; - - /** hashes from the app output from the prev block */ validators_hash: Uint8Array; - - /** validators for the next block */ next_validators_hash: Uint8Array; - - /** consensus params for current block */ consensus_hash: Uint8Array; - - /** state after txs from the previous block */ app_hash: Uint8Array; last_results_hash: Uint8Array; - - /** consensus info */ evidence_hash: Uint8Array; - - /** original proposer of the block */ proposer_address: Uint8Array; } @@ -232,11 +215,6 @@ export interface Data { /** Data contains the set of transactions included in the block */ export interface DataSDKType { - /** - * Txs that will be applied by state @ block.Height+1. - * NOTE: not all txs here are valid. We're just agreeing on the order first. - * This means that block.AppHash does not include these txs. - */ txs: Uint8Array[]; } @@ -265,8 +243,6 @@ export interface VoteSDKType { type: SignedMsgType; height: Long; round: number; - - /** zero if vote is nil. */ block_id?: BlockIDSDKType; timestamp?: Date; validator_address: Uint8Array; diff --git a/__fixtures__/output2/osmosis/gamm/pool-models/stableswap/stableswap_pool.ts b/__fixtures__/output2/osmosis/gamm/pool-models/stableswap/stableswap_pool.ts index c707535bd9..52939a7d1a 100644 --- a/__fixtures__/output2/osmosis/gamm/pool-models/stableswap/stableswap_pool.ts +++ b/__fixtures__/output2/osmosis/gamm/pool-models/stableswap/stableswap_pool.ts @@ -41,10 +41,10 @@ export interface Pool { poolLiquidity: Coin[]; /** for calculation amognst assets with different precisions */ - scalingFactor: Long[]; + scalingFactors: Long[]; - /** scaling_factor_governor is the address can adjust pool scaling factors */ - scalingFactorGovernor: string; + /** scaling_factor_controller is the address can adjust pool scaling factors */ + scalingFactorController: string; } function createBasePoolParams(): PoolParams { @@ -124,8 +124,8 @@ function createBasePool(): Pool { futurePoolGovernor: "", totalShares: undefined, poolLiquidity: [], - scalingFactor: [], - scalingFactorGovernor: "" + scalingFactors: [], + scalingFactorController: "" }; } @@ -157,14 +157,14 @@ export const Pool = { writer.uint32(58).fork(); - for (const v of message.scalingFactor) { + for (const v of message.scalingFactors) { writer.uint64(v); } writer.ldelim(); - if (message.scalingFactorGovernor !== "") { - writer.uint32(66).string(message.scalingFactorGovernor); + if (message.scalingFactorController !== "") { + writer.uint32(66).string(message.scalingFactorController); } return writer; @@ -208,16 +208,16 @@ export const Pool = { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { - message.scalingFactor.push((reader.uint64() as Long)); + message.scalingFactors.push((reader.uint64() as Long)); } } else { - message.scalingFactor.push((reader.uint64() as Long)); + message.scalingFactors.push((reader.uint64() as Long)); } break; case 8: - message.scalingFactorGovernor = reader.string(); + message.scalingFactorController = reader.string(); break; default: @@ -237,8 +237,8 @@ export const Pool = { futurePoolGovernor: isSet(object.futurePoolGovernor) ? String(object.futurePoolGovernor) : "", totalShares: isSet(object.totalShares) ? Coin.fromJSON(object.totalShares) : undefined, poolLiquidity: Array.isArray(object?.poolLiquidity) ? object.poolLiquidity.map((e: any) => Coin.fromJSON(e)) : [], - scalingFactor: Array.isArray(object?.scalingFactor) ? object.scalingFactor.map((e: any) => Long.fromValue(e)) : [], - scalingFactorGovernor: isSet(object.scalingFactorGovernor) ? String(object.scalingFactorGovernor) : "" + scalingFactors: Array.isArray(object?.scalingFactors) ? object.scalingFactors.map((e: any) => Long.fromValue(e)) : [], + scalingFactorController: isSet(object.scalingFactorController) ? String(object.scalingFactorController) : "" }; }, @@ -256,13 +256,13 @@ export const Pool = { obj.poolLiquidity = []; } - if (message.scalingFactor) { - obj.scalingFactor = message.scalingFactor.map(e => (e || Long.UZERO).toString()); + if (message.scalingFactors) { + obj.scalingFactors = message.scalingFactors.map(e => (e || Long.UZERO).toString()); } else { - obj.scalingFactor = []; + obj.scalingFactors = []; } - message.scalingFactorGovernor !== undefined && (obj.scalingFactorGovernor = message.scalingFactorGovernor); + message.scalingFactorController !== undefined && (obj.scalingFactorController = message.scalingFactorController); return obj; }, @@ -274,8 +274,8 @@ export const Pool = { message.futurePoolGovernor = object.futurePoolGovernor ?? ""; message.totalShares = object.totalShares !== undefined && object.totalShares !== null ? Coin.fromPartial(object.totalShares) : undefined; message.poolLiquidity = object.poolLiquidity?.map(e => Coin.fromPartial(e)) || []; - message.scalingFactor = object.scalingFactor?.map(e => Long.fromValue(e)) || []; - message.scalingFactorGovernor = object.scalingFactorGovernor ?? ""; + message.scalingFactors = object.scalingFactors?.map(e => Long.fromValue(e)) || []; + message.scalingFactorController = object.scalingFactorController ?? ""; return message; } diff --git a/__fixtures__/output2/osmosis/gamm/pool-models/stableswap/tx.ts b/__fixtures__/output2/osmosis/gamm/pool-models/stableswap/tx.ts index faee4dd863..aac47d1566 100644 --- a/__fixtures__/output2/osmosis/gamm/pool-models/stableswap/tx.ts +++ b/__fixtures__/output2/osmosis/gamm/pool-models/stableswap/tx.ts @@ -13,6 +13,7 @@ export interface MsgCreateStableswapPool { initialPoolLiquidity: Coin[]; scalingFactors: Long[]; futurePoolGovernor: string; + scalingFactorController: string; } /** Returns a poolID with custom poolName. */ @@ -37,7 +38,8 @@ function createBaseMsgCreateStableswapPool(): MsgCreateStableswapPool { poolParams: undefined, initialPoolLiquidity: [], scalingFactors: [], - futurePoolGovernor: "" + futurePoolGovernor: "", + scalingFactorController: "" }; } @@ -67,6 +69,10 @@ export const MsgCreateStableswapPool = { writer.uint32(42).string(message.futurePoolGovernor); } + if (message.scalingFactorController !== "") { + writer.uint32(50).string(message.scalingFactorController); + } + return writer; }, @@ -108,6 +114,10 @@ export const MsgCreateStableswapPool = { message.futurePoolGovernor = reader.string(); break; + case 6: + message.scalingFactorController = reader.string(); + break; + default: reader.skipType(tag & 7); break; @@ -123,7 +133,8 @@ export const MsgCreateStableswapPool = { poolParams: isSet(object.poolParams) ? PoolParams.fromJSON(object.poolParams) : undefined, initialPoolLiquidity: Array.isArray(object?.initialPoolLiquidity) ? object.initialPoolLiquidity.map((e: any) => Coin.fromJSON(e)) : [], scalingFactors: Array.isArray(object?.scalingFactors) ? object.scalingFactors.map((e: any) => Long.fromValue(e)) : [], - futurePoolGovernor: isSet(object.futurePoolGovernor) ? String(object.futurePoolGovernor) : "" + futurePoolGovernor: isSet(object.futurePoolGovernor) ? String(object.futurePoolGovernor) : "", + scalingFactorController: isSet(object.scalingFactorController) ? String(object.scalingFactorController) : "" }; }, @@ -145,6 +156,7 @@ export const MsgCreateStableswapPool = { } message.futurePoolGovernor !== undefined && (obj.futurePoolGovernor = message.futurePoolGovernor); + message.scalingFactorController !== undefined && (obj.scalingFactorController = message.scalingFactorController); return obj; }, @@ -155,6 +167,7 @@ export const MsgCreateStableswapPool = { message.initialPoolLiquidity = object.initialPoolLiquidity?.map(e => Coin.fromPartial(e)) || []; message.scalingFactors = object.scalingFactors?.map(e => Long.fromValue(e)) || []; message.futurePoolGovernor = object.futurePoolGovernor ?? ""; + message.scalingFactorController = object.scalingFactorController ?? ""; return message; } diff --git a/__fixtures__/output2/osmosis/gamm/v1beta1/query.ts b/__fixtures__/output2/osmosis/gamm/v1beta1/query.ts index 9ff82dc60c..a26acf500d 100644 --- a/__fixtures__/output2/osmosis/gamm/v1beta1/query.ts +++ b/__fixtures__/output2/osmosis/gamm/v1beta1/query.ts @@ -1,9 +1,9 @@ //@ts-nocheck /* eslint-disable */ import { PageRequest, PageResponse } from "../../../cosmos/base/query/v1beta1/pagination"; +import { Coin } from "../../../cosmos/base/v1beta1/coin"; import { SwapAmountInRoute, SwapAmountOutRoute } from "./tx"; import { Any } from "../../../google/protobuf/any"; -import { Coin } from "../../../cosmos/base/v1beta1/coin"; import { Long, isSet, DeepPartial, Rpc } from "../../../helpers"; import * as _m0 from "protobufjs/minimal"; export const protobufPackage = "osmosis.gamm.v1beta1"; @@ -42,6 +42,25 @@ export interface QueryPoolTypeResponse { poolType: string; } +/** =============================== CalcJoinPoolShares */ +export interface QueryCalcJoinPoolSharesRequest { + poolId: Long; + tokensIn: Coin[]; +} +export interface QueryCalcJoinPoolSharesResponse { + shareOutAmount: string; + tokensOut: Coin[]; +} + +/** =============================== CalcExitPoolCoinsFromShares */ +export interface QueryCalcExitPoolCoinsFromSharesRequest { + poolId: Long; + shareInAmount: string; +} +export interface QueryCalcExitPoolCoinsFromSharesResponse { + tokensOut: Coin[]; +} + /** =============================== PoolParams */ export interface QueryPoolParamsRequest { poolId: Long; @@ -66,20 +85,45 @@ export interface QueryTotalSharesResponse { totalShares?: Coin; } +/** =============================== CalcJoinPoolNoSwapShares */ +export interface QueryCalcJoinPoolNoSwapSharesRequest { + poolId: Long; + tokensIn: Coin[]; +} +export interface QueryCalcJoinPoolNoSwapSharesResponse { + tokensOut: Coin[]; + sharesOut: string; +} + /** * QuerySpotPriceRequest defines the gRPC request structure for a SpotPrice * query. */ + +/** @deprecated */ export interface QuerySpotPriceRequest { poolId: Long; baseAssetDenom: string; quoteAssetDenom: string; } +export interface QueryPoolsWithFilterRequest { + minLiquidity: Coin[]; + poolType: string; + pagination?: PageRequest; +} +export interface QueryPoolsWithFilterResponse { + pools: Any[]; + + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +} /** * QuerySpotPriceResponse defines the gRPC response structure for a SpotPrice * query. */ + +/** @deprecated */ export interface QuerySpotPriceResponse { /** String of the Dec. Ex) 10.203uatom */ spotPrice: string; @@ -87,6 +131,7 @@ export interface QuerySpotPriceResponse { /** =============================== EstimateSwapExactAmountIn */ export interface QuerySwapExactAmountInRequest { + /** TODO: CHANGE THIS TO RESERVED IN A PATCH RELEASE */ sender: string; poolId: Long; tokenIn: string; @@ -98,6 +143,7 @@ export interface QuerySwapExactAmountInResponse { /** =============================== EstimateSwapExactAmountOut */ export interface QuerySwapExactAmountOutRequest { + /** TODO: CHANGE THIS TO RESERVED IN A PATCH RELEASE */ sender: string; poolId: Long; routes: SwapAmountOutRoute[]; @@ -571,6 +617,288 @@ export const QueryPoolTypeResponse = { }; +function createBaseQueryCalcJoinPoolSharesRequest(): QueryCalcJoinPoolSharesRequest { + return { + poolId: Long.UZERO, + tokensIn: [] + }; +} + +export const QueryCalcJoinPoolSharesRequest = { + encode(message: QueryCalcJoinPoolSharesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.poolId.isZero()) { + writer.uint32(8).uint64(message.poolId); + } + + for (const v of message.tokensIn) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryCalcJoinPoolSharesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCalcJoinPoolSharesRequest(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.poolId = (reader.uint64() as Long); + break; + + case 2: + message.tokensIn.push(Coin.decode(reader, reader.uint32())); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): QueryCalcJoinPoolSharesRequest { + return { + poolId: isSet(object.poolId) ? Long.fromValue(object.poolId) : Long.UZERO, + tokensIn: Array.isArray(object?.tokensIn) ? object.tokensIn.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + + toJSON(message: QueryCalcJoinPoolSharesRequest): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || Long.UZERO).toString()); + + if (message.tokensIn) { + obj.tokensIn = message.tokensIn.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.tokensIn = []; + } + + return obj; + }, + + fromPartial(object: DeepPartial): QueryCalcJoinPoolSharesRequest { + const message = createBaseQueryCalcJoinPoolSharesRequest(); + message.poolId = object.poolId !== undefined && object.poolId !== null ? Long.fromValue(object.poolId) : Long.UZERO; + message.tokensIn = object.tokensIn?.map(e => Coin.fromPartial(e)) || []; + return message; + } + +}; + +function createBaseQueryCalcJoinPoolSharesResponse(): QueryCalcJoinPoolSharesResponse { + return { + shareOutAmount: "", + tokensOut: [] + }; +} + +export const QueryCalcJoinPoolSharesResponse = { + encode(message: QueryCalcJoinPoolSharesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.shareOutAmount !== "") { + writer.uint32(10).string(message.shareOutAmount); + } + + for (const v of message.tokensOut) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryCalcJoinPoolSharesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCalcJoinPoolSharesResponse(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.shareOutAmount = reader.string(); + break; + + case 2: + message.tokensOut.push(Coin.decode(reader, reader.uint32())); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): QueryCalcJoinPoolSharesResponse { + return { + shareOutAmount: isSet(object.shareOutAmount) ? String(object.shareOutAmount) : "", + tokensOut: Array.isArray(object?.tokensOut) ? object.tokensOut.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + + toJSON(message: QueryCalcJoinPoolSharesResponse): unknown { + const obj: any = {}; + message.shareOutAmount !== undefined && (obj.shareOutAmount = message.shareOutAmount); + + if (message.tokensOut) { + obj.tokensOut = message.tokensOut.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.tokensOut = []; + } + + return obj; + }, + + fromPartial(object: DeepPartial): QueryCalcJoinPoolSharesResponse { + const message = createBaseQueryCalcJoinPoolSharesResponse(); + message.shareOutAmount = object.shareOutAmount ?? ""; + message.tokensOut = object.tokensOut?.map(e => Coin.fromPartial(e)) || []; + return message; + } + +}; + +function createBaseQueryCalcExitPoolCoinsFromSharesRequest(): QueryCalcExitPoolCoinsFromSharesRequest { + return { + poolId: Long.UZERO, + shareInAmount: "" + }; +} + +export const QueryCalcExitPoolCoinsFromSharesRequest = { + encode(message: QueryCalcExitPoolCoinsFromSharesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.poolId.isZero()) { + writer.uint32(8).uint64(message.poolId); + } + + if (message.shareInAmount !== "") { + writer.uint32(18).string(message.shareInAmount); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryCalcExitPoolCoinsFromSharesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCalcExitPoolCoinsFromSharesRequest(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.poolId = (reader.uint64() as Long); + break; + + case 2: + message.shareInAmount = reader.string(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): QueryCalcExitPoolCoinsFromSharesRequest { + return { + poolId: isSet(object.poolId) ? Long.fromValue(object.poolId) : Long.UZERO, + shareInAmount: isSet(object.shareInAmount) ? String(object.shareInAmount) : "" + }; + }, + + toJSON(message: QueryCalcExitPoolCoinsFromSharesRequest): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || Long.UZERO).toString()); + message.shareInAmount !== undefined && (obj.shareInAmount = message.shareInAmount); + return obj; + }, + + fromPartial(object: DeepPartial): QueryCalcExitPoolCoinsFromSharesRequest { + const message = createBaseQueryCalcExitPoolCoinsFromSharesRequest(); + message.poolId = object.poolId !== undefined && object.poolId !== null ? Long.fromValue(object.poolId) : Long.UZERO; + message.shareInAmount = object.shareInAmount ?? ""; + return message; + } + +}; + +function createBaseQueryCalcExitPoolCoinsFromSharesResponse(): QueryCalcExitPoolCoinsFromSharesResponse { + return { + tokensOut: [] + }; +} + +export const QueryCalcExitPoolCoinsFromSharesResponse = { + encode(message: QueryCalcExitPoolCoinsFromSharesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.tokensOut) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryCalcExitPoolCoinsFromSharesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCalcExitPoolCoinsFromSharesResponse(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.tokensOut.push(Coin.decode(reader, reader.uint32())); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): QueryCalcExitPoolCoinsFromSharesResponse { + return { + tokensOut: Array.isArray(object?.tokensOut) ? object.tokensOut.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + + toJSON(message: QueryCalcExitPoolCoinsFromSharesResponse): unknown { + const obj: any = {}; + + if (message.tokensOut) { + obj.tokensOut = message.tokensOut.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.tokensOut = []; + } + + return obj; + }, + + fromPartial(object: DeepPartial): QueryCalcExitPoolCoinsFromSharesResponse { + const message = createBaseQueryCalcExitPoolCoinsFromSharesResponse(); + message.tokensOut = object.tokensOut?.map(e => Coin.fromPartial(e)) || []; + return message; + } + +}; + function createBaseQueryPoolParamsRequest(): QueryPoolParamsRequest { return { poolId: Long.UZERO @@ -919,6 +1247,156 @@ export const QueryTotalSharesResponse = { }; +function createBaseQueryCalcJoinPoolNoSwapSharesRequest(): QueryCalcJoinPoolNoSwapSharesRequest { + return { + poolId: Long.UZERO, + tokensIn: [] + }; +} + +export const QueryCalcJoinPoolNoSwapSharesRequest = { + encode(message: QueryCalcJoinPoolNoSwapSharesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.poolId.isZero()) { + writer.uint32(8).uint64(message.poolId); + } + + for (const v of message.tokensIn) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryCalcJoinPoolNoSwapSharesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCalcJoinPoolNoSwapSharesRequest(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.poolId = (reader.uint64() as Long); + break; + + case 2: + message.tokensIn.push(Coin.decode(reader, reader.uint32())); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): QueryCalcJoinPoolNoSwapSharesRequest { + return { + poolId: isSet(object.poolId) ? Long.fromValue(object.poolId) : Long.UZERO, + tokensIn: Array.isArray(object?.tokensIn) ? object.tokensIn.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + + toJSON(message: QueryCalcJoinPoolNoSwapSharesRequest): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || Long.UZERO).toString()); + + if (message.tokensIn) { + obj.tokensIn = message.tokensIn.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.tokensIn = []; + } + + return obj; + }, + + fromPartial(object: DeepPartial): QueryCalcJoinPoolNoSwapSharesRequest { + const message = createBaseQueryCalcJoinPoolNoSwapSharesRequest(); + message.poolId = object.poolId !== undefined && object.poolId !== null ? Long.fromValue(object.poolId) : Long.UZERO; + message.tokensIn = object.tokensIn?.map(e => Coin.fromPartial(e)) || []; + return message; + } + +}; + +function createBaseQueryCalcJoinPoolNoSwapSharesResponse(): QueryCalcJoinPoolNoSwapSharesResponse { + return { + tokensOut: [], + sharesOut: "" + }; +} + +export const QueryCalcJoinPoolNoSwapSharesResponse = { + encode(message: QueryCalcJoinPoolNoSwapSharesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.tokensOut) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + + if (message.sharesOut !== "") { + writer.uint32(18).string(message.sharesOut); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryCalcJoinPoolNoSwapSharesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryCalcJoinPoolNoSwapSharesResponse(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.tokensOut.push(Coin.decode(reader, reader.uint32())); + break; + + case 2: + message.sharesOut = reader.string(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): QueryCalcJoinPoolNoSwapSharesResponse { + return { + tokensOut: Array.isArray(object?.tokensOut) ? object.tokensOut.map((e: any) => Coin.fromJSON(e)) : [], + sharesOut: isSet(object.sharesOut) ? String(object.sharesOut) : "" + }; + }, + + toJSON(message: QueryCalcJoinPoolNoSwapSharesResponse): unknown { + const obj: any = {}; + + if (message.tokensOut) { + obj.tokensOut = message.tokensOut.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.tokensOut = []; + } + + message.sharesOut !== undefined && (obj.sharesOut = message.sharesOut); + return obj; + }, + + fromPartial(object: DeepPartial): QueryCalcJoinPoolNoSwapSharesResponse { + const message = createBaseQueryCalcJoinPoolNoSwapSharesResponse(); + message.tokensOut = object.tokensOut?.map(e => Coin.fromPartial(e)) || []; + message.sharesOut = object.sharesOut ?? ""; + return message; + } + +}; + function createBaseQuerySpotPriceRequest(): QuerySpotPriceRequest { return { poolId: Long.UZERO, @@ -1000,6 +1478,168 @@ export const QuerySpotPriceRequest = { }; +function createBaseQueryPoolsWithFilterRequest(): QueryPoolsWithFilterRequest { + return { + minLiquidity: [], + poolType: "", + pagination: undefined + }; +} + +export const QueryPoolsWithFilterRequest = { + encode(message: QueryPoolsWithFilterRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.minLiquidity) { + Coin.encode(v!, writer.uint32(10).fork()).ldelim(); + } + + if (message.poolType !== "") { + writer.uint32(18).string(message.poolType); + } + + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(26).fork()).ldelim(); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryPoolsWithFilterRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPoolsWithFilterRequest(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.minLiquidity.push(Coin.decode(reader, reader.uint32())); + break; + + case 2: + message.poolType = reader.string(); + break; + + case 3: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): QueryPoolsWithFilterRequest { + return { + minLiquidity: Array.isArray(object?.minLiquidity) ? object.minLiquidity.map((e: any) => Coin.fromJSON(e)) : [], + poolType: isSet(object.poolType) ? String(object.poolType) : "", + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined + }; + }, + + toJSON(message: QueryPoolsWithFilterRequest): unknown { + const obj: any = {}; + + if (message.minLiquidity) { + obj.minLiquidity = message.minLiquidity.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.minLiquidity = []; + } + + message.poolType !== undefined && (obj.poolType = message.poolType); + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryPoolsWithFilterRequest { + const message = createBaseQueryPoolsWithFilterRequest(); + message.minLiquidity = object.minLiquidity?.map(e => Coin.fromPartial(e)) || []; + message.poolType = object.poolType ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + } + +}; + +function createBaseQueryPoolsWithFilterResponse(): QueryPoolsWithFilterResponse { + return { + pools: [], + pagination: undefined + }; +} + +export const QueryPoolsWithFilterResponse = { + encode(message: QueryPoolsWithFilterResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.pools) { + Any.encode(v!, writer.uint32(10).fork()).ldelim(); + } + + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryPoolsWithFilterResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPoolsWithFilterResponse(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.pools.push(Any.decode(reader, reader.uint32())); + break; + + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): QueryPoolsWithFilterResponse { + return { + pools: Array.isArray(object?.pools) ? object.pools.map((e: any) => Any.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined + }; + }, + + toJSON(message: QueryPoolsWithFilterResponse): unknown { + const obj: any = {}; + + if (message.pools) { + obj.pools = message.pools.map(e => e ? Any.toJSON(e) : undefined); + } else { + obj.pools = []; + } + + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryPoolsWithFilterResponse { + const message = createBaseQueryPoolsWithFilterResponse(); + message.pools = object.pools?.map(e => Any.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + } + +}; + function createBaseQuerySpotPriceResponse(): QuerySpotPriceResponse { return { spotPrice: "" @@ -1479,6 +2119,12 @@ export interface Query { NumPools(request?: QueryNumPoolsRequest): Promise; TotalLiquidity(request?: QueryTotalLiquidityRequest): Promise; + /** + * PoolsWithFilter allows you to query specific pools with requested + * parameters + */ + PoolsWithFilter(request: QueryPoolsWithFilterRequest): Promise; + /** Per Pool gRPC Endpoints */ Pool(request: QueryPoolRequest): Promise; @@ -1488,6 +2134,14 @@ export interface Query { * Errors if the pool is failed to be type caseted. */ PoolType(request: QueryPoolTypeRequest): Promise; + + /** + * Simulates joining pool without a swap. Returns the amount of shares you'd + * get and tokens needed to provide + */ + CalcJoinPoolNoSwapShares(request: QueryCalcJoinPoolNoSwapSharesRequest): Promise; + CalcJoinPoolShares(request: QueryCalcJoinPoolSharesRequest): Promise; + CalcExitPoolCoinsFromShares(request: QueryCalcExitPoolCoinsFromSharesRequest): Promise; PoolParams(request: QueryPoolParamsRequest): Promise; TotalPoolLiquidity(request: QueryTotalPoolLiquidityRequest): Promise; TotalShares(request: QueryTotalSharesRequest): Promise; @@ -1510,8 +2164,12 @@ export class QueryClientImpl implements Query { this.Pools = this.Pools.bind(this); this.NumPools = this.NumPools.bind(this); this.TotalLiquidity = this.TotalLiquidity.bind(this); + this.PoolsWithFilter = this.PoolsWithFilter.bind(this); this.Pool = this.Pool.bind(this); this.PoolType = this.PoolType.bind(this); + this.CalcJoinPoolNoSwapShares = this.CalcJoinPoolNoSwapShares.bind(this); + this.CalcJoinPoolShares = this.CalcJoinPoolShares.bind(this); + this.CalcExitPoolCoinsFromShares = this.CalcExitPoolCoinsFromShares.bind(this); this.PoolParams = this.PoolParams.bind(this); this.TotalPoolLiquidity = this.TotalPoolLiquidity.bind(this); this.TotalShares = this.TotalShares.bind(this); @@ -1540,6 +2198,12 @@ export class QueryClientImpl implements Query { return promise.then(data => QueryTotalLiquidityResponse.decode(new _m0.Reader(data))); } + PoolsWithFilter(request: QueryPoolsWithFilterRequest): Promise { + const data = QueryPoolsWithFilterRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.gamm.v1beta1.Query", "PoolsWithFilter", data); + return promise.then(data => QueryPoolsWithFilterResponse.decode(new _m0.Reader(data))); + } + Pool(request: QueryPoolRequest): Promise { const data = QueryPoolRequest.encode(request).finish(); const promise = this.rpc.request("osmosis.gamm.v1beta1.Query", "Pool", data); @@ -1552,6 +2216,24 @@ export class QueryClientImpl implements Query { return promise.then(data => QueryPoolTypeResponse.decode(new _m0.Reader(data))); } + CalcJoinPoolNoSwapShares(request: QueryCalcJoinPoolNoSwapSharesRequest): Promise { + const data = QueryCalcJoinPoolNoSwapSharesRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.gamm.v1beta1.Query", "CalcJoinPoolNoSwapShares", data); + return promise.then(data => QueryCalcJoinPoolNoSwapSharesResponse.decode(new _m0.Reader(data))); + } + + CalcJoinPoolShares(request: QueryCalcJoinPoolSharesRequest): Promise { + const data = QueryCalcJoinPoolSharesRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.gamm.v1beta1.Query", "CalcJoinPoolShares", data); + return promise.then(data => QueryCalcJoinPoolSharesResponse.decode(new _m0.Reader(data))); + } + + CalcExitPoolCoinsFromShares(request: QueryCalcExitPoolCoinsFromSharesRequest): Promise { + const data = QueryCalcExitPoolCoinsFromSharesRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.gamm.v1beta1.Query", "CalcExitPoolCoinsFromShares", data); + return promise.then(data => QueryCalcExitPoolCoinsFromSharesResponse.decode(new _m0.Reader(data))); + } + PoolParams(request: QueryPoolParamsRequest): Promise { const data = QueryPoolParamsRequest.encode(request).finish(); const promise = this.rpc.request("osmosis.gamm.v1beta1.Query", "PoolParams", data); diff --git a/__fixtures__/output2/osmosis/gamm/v2/query.ts b/__fixtures__/output2/osmosis/gamm/v2/query.ts new file mode 100644 index 0000000000..ce0726730f --- /dev/null +++ b/__fixtures__/output2/osmosis/gamm/v2/query.ts @@ -0,0 +1,184 @@ +//@ts-nocheck +/* eslint-disable */ +import { Long, isSet, DeepPartial, Rpc } from "../../../helpers"; +import * as _m0 from "protobufjs/minimal"; +export const protobufPackage = "osmosis.gamm.v2"; + +/** + * QuerySpotPriceRequest defines the gRPC request structure for a SpotPrice + * query. + */ +export interface QuerySpotPriceRequest { + poolId: Long; + baseAssetDenom: string; + quoteAssetDenom: string; +} + +/** + * QuerySpotPriceResponse defines the gRPC response structure for a SpotPrice + * query. + */ +export interface QuerySpotPriceResponse { + /** String of the Dec. Ex) 10.203uatom */ + spotPrice: string; +} + +function createBaseQuerySpotPriceRequest(): QuerySpotPriceRequest { + return { + poolId: Long.UZERO, + baseAssetDenom: "", + quoteAssetDenom: "" + }; +} + +export const QuerySpotPriceRequest = { + encode(message: QuerySpotPriceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.poolId.isZero()) { + writer.uint32(8).uint64(message.poolId); + } + + if (message.baseAssetDenom !== "") { + writer.uint32(18).string(message.baseAssetDenom); + } + + if (message.quoteAssetDenom !== "") { + writer.uint32(26).string(message.quoteAssetDenom); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QuerySpotPriceRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySpotPriceRequest(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.poolId = (reader.uint64() as Long); + break; + + case 2: + message.baseAssetDenom = reader.string(); + break; + + case 3: + message.quoteAssetDenom = reader.string(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): QuerySpotPriceRequest { + return { + poolId: isSet(object.poolId) ? Long.fromValue(object.poolId) : Long.UZERO, + baseAssetDenom: isSet(object.baseAssetDenom) ? String(object.baseAssetDenom) : "", + quoteAssetDenom: isSet(object.quoteAssetDenom) ? String(object.quoteAssetDenom) : "" + }; + }, + + toJSON(message: QuerySpotPriceRequest): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || Long.UZERO).toString()); + message.baseAssetDenom !== undefined && (obj.baseAssetDenom = message.baseAssetDenom); + message.quoteAssetDenom !== undefined && (obj.quoteAssetDenom = message.quoteAssetDenom); + return obj; + }, + + fromPartial(object: DeepPartial): QuerySpotPriceRequest { + const message = createBaseQuerySpotPriceRequest(); + message.poolId = object.poolId !== undefined && object.poolId !== null ? Long.fromValue(object.poolId) : Long.UZERO; + message.baseAssetDenom = object.baseAssetDenom ?? ""; + message.quoteAssetDenom = object.quoteAssetDenom ?? ""; + return message; + } + +}; + +function createBaseQuerySpotPriceResponse(): QuerySpotPriceResponse { + return { + spotPrice: "" + }; +} + +export const QuerySpotPriceResponse = { + encode(message: QuerySpotPriceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.spotPrice !== "") { + writer.uint32(10).string(message.spotPrice); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QuerySpotPriceResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQuerySpotPriceResponse(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.spotPrice = reader.string(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): QuerySpotPriceResponse { + return { + spotPrice: isSet(object.spotPrice) ? String(object.spotPrice) : "" + }; + }, + + toJSON(message: QuerySpotPriceResponse): unknown { + const obj: any = {}; + message.spotPrice !== undefined && (obj.spotPrice = message.spotPrice); + return obj; + }, + + fromPartial(object: DeepPartial): QuerySpotPriceResponse { + const message = createBaseQuerySpotPriceResponse(); + message.spotPrice = object.spotPrice ?? ""; + return message; + } + +}; +export interface Query { + /** + * SpotPrice defines a gRPC query handler that returns the spot price given + * a base denomination and a quote denomination. + */ + SpotPrice(request: QuerySpotPriceRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + + constructor(rpc: Rpc) { + this.rpc = rpc; + this.SpotPrice = this.SpotPrice.bind(this); + } + + SpotPrice(request: QuerySpotPriceRequest): Promise { + const data = QuerySpotPriceRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.gamm.v2.Query", "SpotPrice", data); + return promise.then(data => QuerySpotPriceResponse.decode(new _m0.Reader(data))); + } + +} \ No newline at end of file diff --git a/__fixtures__/output2/osmosis/ibc-rate-limit/v1beta1/params.ts b/__fixtures__/output2/osmosis/ibc-rate-limit/v1beta1/params.ts new file mode 100644 index 0000000000..3d52e11289 --- /dev/null +++ b/__fixtures__/output2/osmosis/ibc-rate-limit/v1beta1/params.ts @@ -0,0 +1,67 @@ +//@ts-nocheck +/* eslint-disable */ +import * as _m0 from "protobufjs/minimal"; +import { isSet, DeepPartial } from "../../../helpers"; +export const protobufPackage = "osmosis.ibcratelimit.v1beta1"; + +/** Params defines the parameters for the ibc-rate-limit module. */ +export interface Params { + contractAddress: string; +} + +function createBaseParams(): Params { + return { + contractAddress: "" + }; +} + +export const Params = { + encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.contractAddress !== "") { + writer.uint32(10).string(message.contractAddress); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Params { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.contractAddress = reader.string(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): Params { + return { + contractAddress: isSet(object.contractAddress) ? String(object.contractAddress) : "" + }; + }, + + toJSON(message: Params): unknown { + const obj: any = {}; + message.contractAddress !== undefined && (obj.contractAddress = message.contractAddress); + return obj; + }, + + fromPartial(object: DeepPartial): Params { + const message = createBaseParams(); + message.contractAddress = object.contractAddress ?? ""; + return message; + } + +}; \ No newline at end of file diff --git a/__fixtures__/output2/osmosis/ibc-rate-limit/v1beta1/query.ts b/__fixtures__/output2/osmosis/ibc-rate-limit/v1beta1/query.ts new file mode 100644 index 0000000000..1c68763d63 --- /dev/null +++ b/__fixtures__/output2/osmosis/ibc-rate-limit/v1beta1/query.ts @@ -0,0 +1,139 @@ +//@ts-nocheck +/* eslint-disable */ +import { Params } from "./params"; +import * as _m0 from "protobufjs/minimal"; +import { DeepPartial, isSet, Rpc } from "../../../helpers"; +export const protobufPackage = "osmosis.ibcratelimit.v1beta1"; + +/** QueryParamsRequest is the request type for the Query/Params RPC method. */ +export interface QueryParamsRequest {} + +/** QueryParamsResponse is the response type for the Query/Params RPC method. */ +export interface QueryParamsResponse { + /** params defines the parameters of the module. */ + params?: Params; +} + +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} + +export const QueryParamsRequest = { + encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(_: any): QueryParamsRequest { + return {}; + }, + + toJSON(_: QueryParamsRequest): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + } + +}; + +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: undefined + }; +} + +export const QueryParamsResponse = { + encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsResponse(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): QueryParamsResponse { + return { + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined + }; + }, + + toJSON(message: QueryParamsResponse): unknown { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + } + +}; + +/** Query defines the gRPC querier service. */ +export interface Query { + /** + * Params defines a gRPC query method that returns the ibc-rate-limit module's + * parameters. + */ + Params(request?: QueryParamsRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: Rpc; + + constructor(rpc: Rpc) { + this.rpc = rpc; + this.Params = this.Params.bind(this); + } + + Params(request: QueryParamsRequest = {}): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.ibcratelimit.v1beta1.Query", "Params", data); + return promise.then(data => QueryParamsResponse.decode(new _m0.Reader(data))); + } + +} \ No newline at end of file diff --git a/__fixtures__/output2/osmosis/incentives/query.ts b/__fixtures__/output2/osmosis/incentives/query.ts index 0c4b51eca8..90aa631dee 100644 --- a/__fixtures__/output2/osmosis/incentives/query.ts +++ b/__fixtures__/output2/osmosis/incentives/query.ts @@ -12,11 +12,6 @@ export interface ModuleToDistributeCoinsResponse { /** Coins that have yet to be distributed */ coins: Coin[]; } -export interface ModuleDistributedCoinsRequest {} -export interface ModuleDistributedCoinsResponse { - /** Coins that have been distributed already */ - coins: Coin[]; -} export interface GaugeByIDRequest { /** Gague ID being queried */ id: Long; @@ -218,112 +213,6 @@ export const ModuleToDistributeCoinsResponse = { }; -function createBaseModuleDistributedCoinsRequest(): ModuleDistributedCoinsRequest { - return {}; -} - -export const ModuleDistributedCoinsRequest = { - encode(_: ModuleDistributedCoinsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): ModuleDistributedCoinsRequest { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseModuleDistributedCoinsRequest(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(_: any): ModuleDistributedCoinsRequest { - return {}; - }, - - toJSON(_: ModuleDistributedCoinsRequest): unknown { - const obj: any = {}; - return obj; - }, - - fromPartial(_: DeepPartial): ModuleDistributedCoinsRequest { - const message = createBaseModuleDistributedCoinsRequest(); - return message; - } - -}; - -function createBaseModuleDistributedCoinsResponse(): ModuleDistributedCoinsResponse { - return { - coins: [] - }; -} - -export const ModuleDistributedCoinsResponse = { - encode(message: ModuleDistributedCoinsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - for (const v of message.coins) { - Coin.encode(v!, writer.uint32(10).fork()).ldelim(); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): ModuleDistributedCoinsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseModuleDistributedCoinsResponse(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.coins.push(Coin.decode(reader, reader.uint32())); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(object: any): ModuleDistributedCoinsResponse { - return { - coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromJSON(e)) : [] - }; - }, - - toJSON(message: ModuleDistributedCoinsResponse): unknown { - const obj: any = {}; - - if (message.coins) { - obj.coins = message.coins.map(e => e ? Coin.toJSON(e) : undefined); - } else { - obj.coins = []; - } - - return obj; - }, - - fromPartial(object: DeepPartial): ModuleDistributedCoinsResponse { - const message = createBaseModuleDistributedCoinsResponse(); - message.coins = object.coins?.map(e => Coin.fromPartial(e)) || []; - return message; - } - -}; - function createBaseGaugeByIDRequest(): GaugeByIDRequest { return { id: Long.UZERO @@ -1396,12 +1285,6 @@ export interface Query { /** ModuleToDistributeCoins returns coins that are going to be distributed */ ModuleToDistributeCoins(request?: ModuleToDistributeCoinsRequest): Promise; - /** - * ModuleDistributedCoins returns coins that are distributed by the module so - * far - */ - ModuleDistributedCoins(request?: ModuleDistributedCoinsRequest): Promise; - /** GaugeByID returns gauges by their respective ID */ GaugeByID(request: GaugeByIDRequest): Promise; @@ -1442,7 +1325,6 @@ export class QueryClientImpl implements Query { constructor(rpc: Rpc) { this.rpc = rpc; this.ModuleToDistributeCoins = this.ModuleToDistributeCoins.bind(this); - this.ModuleDistributedCoins = this.ModuleDistributedCoins.bind(this); this.GaugeByID = this.GaugeByID.bind(this); this.Gauges = this.Gauges.bind(this); this.ActiveGauges = this.ActiveGauges.bind(this); @@ -1459,12 +1341,6 @@ export class QueryClientImpl implements Query { return promise.then(data => ModuleToDistributeCoinsResponse.decode(new _m0.Reader(data))); } - ModuleDistributedCoins(request: ModuleDistributedCoinsRequest = {}): Promise { - const data = ModuleDistributedCoinsRequest.encode(request).finish(); - const promise = this.rpc.request("osmosis.incentives.Query", "ModuleDistributedCoins", data); - return promise.then(data => ModuleDistributedCoinsResponse.decode(new _m0.Reader(data))); - } - GaugeByID(request: GaugeByIDRequest): Promise { const data = GaugeByIDRequest.encode(request).finish(); const promise = this.rpc.request("osmosis.incentives.Query", "GaugeByID", data); diff --git a/__fixtures__/output2/osmosis/lockup/params.ts b/__fixtures__/output2/osmosis/lockup/params.ts new file mode 100644 index 0000000000..d7dd5faacc --- /dev/null +++ b/__fixtures__/output2/osmosis/lockup/params.ts @@ -0,0 +1,71 @@ +//@ts-nocheck +/* eslint-disable */ +import * as _m0 from "protobufjs/minimal"; +import { DeepPartial } from "../../helpers"; +export const protobufPackage = "osmosis.lockup"; +export interface Params { + forceUnlockAllowedAddresses: string[]; +} + +function createBaseParams(): Params { + return { + forceUnlockAllowedAddresses: [] + }; +} + +export const Params = { + encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.forceUnlockAllowedAddresses) { + writer.uint32(10).string(v!); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Params { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParams(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.forceUnlockAllowedAddresses.push(reader.string()); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): Params { + return { + forceUnlockAllowedAddresses: Array.isArray(object?.forceUnlockAllowedAddresses) ? object.forceUnlockAllowedAddresses.map((e: any) => String(e)) : [] + }; + }, + + toJSON(message: Params): unknown { + const obj: any = {}; + + if (message.forceUnlockAllowedAddresses) { + obj.forceUnlockAllowedAddresses = message.forceUnlockAllowedAddresses.map(e => e); + } else { + obj.forceUnlockAllowedAddresses = []; + } + + return obj; + }, + + fromPartial(object: DeepPartial): Params { + const message = createBaseParams(); + message.forceUnlockAllowedAddresses = object.forceUnlockAllowedAddresses?.map(e => e) || []; + return message; + } + +}; \ No newline at end of file diff --git a/__fixtures__/output2/osmosis/lockup/query.ts b/__fixtures__/output2/osmosis/lockup/query.ts index bd02bfac4f..dea2c7cdcb 100644 --- a/__fixtures__/output2/osmosis/lockup/query.ts +++ b/__fixtures__/output2/osmosis/lockup/query.ts @@ -4,6 +4,7 @@ import { Timestamp } from "../../google/protobuf/timestamp"; import { Duration } from "../../google/protobuf/duration"; import { Coin } from "../../cosmos/base/v1beta1/coin"; import { PeriodLock, SyntheticLock } from "./lock"; +import { Params } from "./params"; import * as _m0 from "protobufjs/minimal"; import { DeepPartial, isSet, fromJsonTimestamp, fromTimestamp, Long, Rpc } from "../../helpers"; export const protobufPackage = "osmosis.lockup"; @@ -110,6 +111,10 @@ export interface AccountLockedLongerDurationDenomRequest { export interface AccountLockedLongerDurationDenomResponse { locks: PeriodLock[]; } +export interface QueryParamsRequest {} +export interface QueryParamsResponse { + params?: Params; +} function createBaseModuleBalanceRequest(): ModuleBalanceRequest { return {}; @@ -2123,6 +2128,106 @@ export const AccountLockedLongerDurationDenomResponse = { }; +function createBaseQueryParamsRequest(): QueryParamsRequest { + return {}; +} + +export const QueryParamsRequest = { + encode(_: QueryParamsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsRequest(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(_: any): QueryParamsRequest { + return {}; + }, + + toJSON(_: QueryParamsRequest): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): QueryParamsRequest { + const message = createBaseQueryParamsRequest(); + return message; + } + +}; + +function createBaseQueryParamsResponse(): QueryParamsResponse { + return { + params: undefined + }; +} + +export const QueryParamsResponse = { + encode(message: QueryParamsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryParamsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryParamsResponse(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.params = Params.decode(reader, reader.uint32()); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): QueryParamsResponse { + return { + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined + }; + }, + + toJSON(message: QueryParamsResponse): unknown { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryParamsResponse { + const message = createBaseQueryParamsResponse(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + return message; + } + +}; + /** Query defines the gRPC querier service. */ export interface Query { /** Return full balance of the module */ @@ -2178,6 +2283,9 @@ export interface Query { /** Returns account's locked records for a denom with longer duration */ AccountLockedLongerDurationDenom(request: AccountLockedLongerDurationDenomRequest): Promise; + + /** Params returns lockup params. */ + Params(request?: QueryParamsRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; @@ -2200,6 +2308,7 @@ export class QueryClientImpl implements Query { this.AccountLockedDuration = this.AccountLockedDuration.bind(this); this.AccountLockedLongerDurationNotUnlockingOnly = this.AccountLockedLongerDurationNotUnlockingOnly.bind(this); this.AccountLockedLongerDurationDenom = this.AccountLockedLongerDurationDenom.bind(this); + this.Params = this.Params.bind(this); } ModuleBalance(request: ModuleBalanceRequest = {}): Promise { @@ -2298,4 +2407,10 @@ export class QueryClientImpl implements Query { return promise.then(data => AccountLockedLongerDurationDenomResponse.decode(new _m0.Reader(data))); } + Params(request: QueryParamsRequest = {}): Promise { + const data = QueryParamsRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.lockup.Query", "Params", data); + return promise.then(data => QueryParamsResponse.decode(new _m0.Reader(data))); + } + } \ No newline at end of file diff --git a/__fixtures__/output2/osmosis/lockup/tx.ts b/__fixtures__/output2/osmosis/lockup/tx.ts index 6efda8a481..c5aadaa2ba 100644 --- a/__fixtures__/output2/osmosis/lockup/tx.ts +++ b/__fixtures__/output2/osmosis/lockup/tx.ts @@ -49,6 +49,21 @@ export interface MsgExtendLockupResponse { success: boolean; } +/** + * MsgForceUnlock unlocks locks immediately for + * addresses registered via governance. + */ +export interface MsgForceUnlock { + owner: string; + ID: Long; + + /** Amount of unlocking coins. Unlock all if not set. */ + coins: Coin[]; +} +export interface MsgForceUnlockResponse { + success: boolean; +} + function createBaseMsgLockTokens(): MsgLockTokens { return { owner: "", @@ -595,6 +610,150 @@ export const MsgExtendLockupResponse = { }; +function createBaseMsgForceUnlock(): MsgForceUnlock { + return { + owner: "", + ID: Long.UZERO, + coins: [] + }; +} + +export const MsgForceUnlock = { + encode(message: MsgForceUnlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.owner !== "") { + writer.uint32(10).string(message.owner); + } + + if (!message.ID.isZero()) { + writer.uint32(16).uint64(message.ID); + } + + for (const v of message.coins) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgForceUnlock { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgForceUnlock(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.owner = reader.string(); + break; + + case 2: + message.ID = (reader.uint64() as Long); + break; + + case 3: + message.coins.push(Coin.decode(reader, reader.uint32())); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): MsgForceUnlock { + return { + owner: isSet(object.owner) ? String(object.owner) : "", + ID: isSet(object.ID) ? Long.fromValue(object.ID) : Long.UZERO, + coins: Array.isArray(object?.coins) ? object.coins.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + + toJSON(message: MsgForceUnlock): unknown { + const obj: any = {}; + message.owner !== undefined && (obj.owner = message.owner); + message.ID !== undefined && (obj.ID = (message.ID || Long.UZERO).toString()); + + if (message.coins) { + obj.coins = message.coins.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.coins = []; + } + + return obj; + }, + + fromPartial(object: DeepPartial): MsgForceUnlock { + const message = createBaseMsgForceUnlock(); + message.owner = object.owner ?? ""; + message.ID = object.ID !== undefined && object.ID !== null ? Long.fromValue(object.ID) : Long.UZERO; + message.coins = object.coins?.map(e => Coin.fromPartial(e)) || []; + return message; + } + +}; + +function createBaseMsgForceUnlockResponse(): MsgForceUnlockResponse { + return { + success: false + }; +} + +export const MsgForceUnlockResponse = { + encode(message: MsgForceUnlockResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.success === true) { + writer.uint32(8).bool(message.success); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgForceUnlockResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgForceUnlockResponse(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.success = reader.bool(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): MsgForceUnlockResponse { + return { + success: isSet(object.success) ? Boolean(object.success) : false + }; + }, + + toJSON(message: MsgForceUnlockResponse): unknown { + const obj: any = {}; + message.success !== undefined && (obj.success = message.success); + return obj; + }, + + fromPartial(object: DeepPartial): MsgForceUnlockResponse { + const message = createBaseMsgForceUnlockResponse(); + message.success = object.success ?? false; + return message; + } + +}; + /** Msg defines the Msg service. */ export interface Msg { /** LockTokens lock tokens */ @@ -608,6 +767,7 @@ export interface Msg { /** MsgEditLockup edits the existing lockups by lock ID */ ExtendLockup(request: MsgExtendLockup): Promise; + ForceUnlock(request: MsgForceUnlock): Promise; } export class MsgClientImpl implements Msg { private readonly rpc: Rpc; @@ -618,6 +778,7 @@ export class MsgClientImpl implements Msg { this.BeginUnlockingAll = this.BeginUnlockingAll.bind(this); this.BeginUnlocking = this.BeginUnlocking.bind(this); this.ExtendLockup = this.ExtendLockup.bind(this); + this.ForceUnlock = this.ForceUnlock.bind(this); } LockTokens(request: MsgLockTokens): Promise { @@ -644,4 +805,10 @@ export class MsgClientImpl implements Msg { return promise.then(data => MsgExtendLockupResponse.decode(new _m0.Reader(data))); } + ForceUnlock(request: MsgForceUnlock): Promise { + const data = MsgForceUnlock.encode(request).finish(); + const promise = this.rpc.request("osmosis.lockup.Msg", "ForceUnlock", data); + return promise.then(data => MsgForceUnlockResponse.decode(new _m0.Reader(data))); + } + } \ No newline at end of file diff --git a/__fixtures__/output2/osmosis/streamswap/v1/event.ts b/__fixtures__/output2/osmosis/streamswap/v1/event.ts deleted file mode 100644 index a192aa64ec..0000000000 --- a/__fixtures__/output2/osmosis/streamswap/v1/event.ts +++ /dev/null @@ -1,442 +0,0 @@ -//@ts-nocheck -/* eslint-disable */ -import { Coin } from "../../../cosmos/base/v1beta1/coin"; -import { Long, isSet, DeepPartial } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; -export const protobufPackage = "osmosis.streamswap.v1"; -export interface EventCreateSale { - id: Long; - creator: string; - tokenIn: string; - tokenOut?: Coin; -} -export interface EventSubscribe { - sender: string; - saleId: Long; - amount: string; -} -export interface EventWithdraw { - sender: string; - saleId: Long; - - /** amount of staked token_in withdrawn by user. */ - amount: string; -} -export interface EventExit { - sender: string; - saleId: Long; - - /** amount of purchased token_out sent to the user */ - purchased: string; -} -export interface EventFinalizeSale { - saleId: Long; - - /** amount of earned tokens_in */ - income: string; -} - -function createBaseEventCreateSale(): EventCreateSale { - return { - id: Long.UZERO, - creator: "", - tokenIn: "", - tokenOut: undefined - }; -} - -export const EventCreateSale = { - encode(message: EventCreateSale, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.id.isZero()) { - writer.uint32(8).uint64(message.id); - } - - if (message.creator !== "") { - writer.uint32(18).string(message.creator); - } - - if (message.tokenIn !== "") { - writer.uint32(26).string(message.tokenIn); - } - - if (message.tokenOut !== undefined) { - Coin.encode(message.tokenOut, writer.uint32(34).fork()).ldelim(); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): EventCreateSale { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEventCreateSale(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.id = (reader.uint64() as Long); - break; - - case 2: - message.creator = reader.string(); - break; - - case 3: - message.tokenIn = reader.string(); - break; - - case 4: - message.tokenOut = Coin.decode(reader, reader.uint32()); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(object: any): EventCreateSale { - return { - id: isSet(object.id) ? Long.fromValue(object.id) : Long.UZERO, - creator: isSet(object.creator) ? String(object.creator) : "", - tokenIn: isSet(object.tokenIn) ? String(object.tokenIn) : "", - tokenOut: isSet(object.tokenOut) ? Coin.fromJSON(object.tokenOut) : undefined - }; - }, - - toJSON(message: EventCreateSale): unknown { - const obj: any = {}; - message.id !== undefined && (obj.id = (message.id || Long.UZERO).toString()); - message.creator !== undefined && (obj.creator = message.creator); - message.tokenIn !== undefined && (obj.tokenIn = message.tokenIn); - message.tokenOut !== undefined && (obj.tokenOut = message.tokenOut ? Coin.toJSON(message.tokenOut) : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): EventCreateSale { - const message = createBaseEventCreateSale(); - message.id = object.id !== undefined && object.id !== null ? Long.fromValue(object.id) : Long.UZERO; - message.creator = object.creator ?? ""; - message.tokenIn = object.tokenIn ?? ""; - message.tokenOut = object.tokenOut !== undefined && object.tokenOut !== null ? Coin.fromPartial(object.tokenOut) : undefined; - return message; - } - -}; - -function createBaseEventSubscribe(): EventSubscribe { - return { - sender: "", - saleId: Long.UZERO, - amount: "" - }; -} - -export const EventSubscribe = { - encode(message: EventSubscribe, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.sender !== "") { - writer.uint32(10).string(message.sender); - } - - if (!message.saleId.isZero()) { - writer.uint32(16).uint64(message.saleId); - } - - if (message.amount !== "") { - writer.uint32(26).string(message.amount); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): EventSubscribe { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEventSubscribe(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.sender = reader.string(); - break; - - case 2: - message.saleId = (reader.uint64() as Long); - break; - - case 3: - message.amount = reader.string(); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(object: any): EventSubscribe { - return { - sender: isSet(object.sender) ? String(object.sender) : "", - saleId: isSet(object.saleId) ? Long.fromValue(object.saleId) : Long.UZERO, - amount: isSet(object.amount) ? String(object.amount) : "" - }; - }, - - toJSON(message: EventSubscribe): unknown { - const obj: any = {}; - message.sender !== undefined && (obj.sender = message.sender); - message.saleId !== undefined && (obj.saleId = (message.saleId || Long.UZERO).toString()); - message.amount !== undefined && (obj.amount = message.amount); - return obj; - }, - - fromPartial(object: DeepPartial): EventSubscribe { - const message = createBaseEventSubscribe(); - message.sender = object.sender ?? ""; - message.saleId = object.saleId !== undefined && object.saleId !== null ? Long.fromValue(object.saleId) : Long.UZERO; - message.amount = object.amount ?? ""; - return message; - } - -}; - -function createBaseEventWithdraw(): EventWithdraw { - return { - sender: "", - saleId: Long.UZERO, - amount: "" - }; -} - -export const EventWithdraw = { - encode(message: EventWithdraw, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.sender !== "") { - writer.uint32(10).string(message.sender); - } - - if (!message.saleId.isZero()) { - writer.uint32(16).uint64(message.saleId); - } - - if (message.amount !== "") { - writer.uint32(26).string(message.amount); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): EventWithdraw { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEventWithdraw(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.sender = reader.string(); - break; - - case 2: - message.saleId = (reader.uint64() as Long); - break; - - case 3: - message.amount = reader.string(); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(object: any): EventWithdraw { - return { - sender: isSet(object.sender) ? String(object.sender) : "", - saleId: isSet(object.saleId) ? Long.fromValue(object.saleId) : Long.UZERO, - amount: isSet(object.amount) ? String(object.amount) : "" - }; - }, - - toJSON(message: EventWithdraw): unknown { - const obj: any = {}; - message.sender !== undefined && (obj.sender = message.sender); - message.saleId !== undefined && (obj.saleId = (message.saleId || Long.UZERO).toString()); - message.amount !== undefined && (obj.amount = message.amount); - return obj; - }, - - fromPartial(object: DeepPartial): EventWithdraw { - const message = createBaseEventWithdraw(); - message.sender = object.sender ?? ""; - message.saleId = object.saleId !== undefined && object.saleId !== null ? Long.fromValue(object.saleId) : Long.UZERO; - message.amount = object.amount ?? ""; - return message; - } - -}; - -function createBaseEventExit(): EventExit { - return { - sender: "", - saleId: Long.UZERO, - purchased: "" - }; -} - -export const EventExit = { - encode(message: EventExit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.sender !== "") { - writer.uint32(10).string(message.sender); - } - - if (!message.saleId.isZero()) { - writer.uint32(16).uint64(message.saleId); - } - - if (message.purchased !== "") { - writer.uint32(26).string(message.purchased); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): EventExit { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEventExit(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.sender = reader.string(); - break; - - case 2: - message.saleId = (reader.uint64() as Long); - break; - - case 3: - message.purchased = reader.string(); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(object: any): EventExit { - return { - sender: isSet(object.sender) ? String(object.sender) : "", - saleId: isSet(object.saleId) ? Long.fromValue(object.saleId) : Long.UZERO, - purchased: isSet(object.purchased) ? String(object.purchased) : "" - }; - }, - - toJSON(message: EventExit): unknown { - const obj: any = {}; - message.sender !== undefined && (obj.sender = message.sender); - message.saleId !== undefined && (obj.saleId = (message.saleId || Long.UZERO).toString()); - message.purchased !== undefined && (obj.purchased = message.purchased); - return obj; - }, - - fromPartial(object: DeepPartial): EventExit { - const message = createBaseEventExit(); - message.sender = object.sender ?? ""; - message.saleId = object.saleId !== undefined && object.saleId !== null ? Long.fromValue(object.saleId) : Long.UZERO; - message.purchased = object.purchased ?? ""; - return message; - } - -}; - -function createBaseEventFinalizeSale(): EventFinalizeSale { - return { - saleId: Long.UZERO, - income: "" - }; -} - -export const EventFinalizeSale = { - encode(message: EventFinalizeSale, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.saleId.isZero()) { - writer.uint32(8).uint64(message.saleId); - } - - if (message.income !== "") { - writer.uint32(26).string(message.income); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): EventFinalizeSale { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEventFinalizeSale(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.saleId = (reader.uint64() as Long); - break; - - case 3: - message.income = reader.string(); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(object: any): EventFinalizeSale { - return { - saleId: isSet(object.saleId) ? Long.fromValue(object.saleId) : Long.UZERO, - income: isSet(object.income) ? String(object.income) : "" - }; - }, - - toJSON(message: EventFinalizeSale): unknown { - const obj: any = {}; - message.saleId !== undefined && (obj.saleId = (message.saleId || Long.UZERO).toString()); - message.income !== undefined && (obj.income = message.income); - return obj; - }, - - fromPartial(object: DeepPartial): EventFinalizeSale { - const message = createBaseEventFinalizeSale(); - message.saleId = object.saleId !== undefined && object.saleId !== null ? Long.fromValue(object.saleId) : Long.UZERO; - message.income = object.income ?? ""; - return message; - } - -}; \ No newline at end of file diff --git a/__fixtures__/output2/osmosis/streamswap/v1/genesis.ts b/__fixtures__/output2/osmosis/streamswap/v1/genesis.ts deleted file mode 100644 index f70712c840..0000000000 --- a/__fixtures__/output2/osmosis/streamswap/v1/genesis.ts +++ /dev/null @@ -1,211 +0,0 @@ -//@ts-nocheck -/* eslint-disable */ -import { Sale, UserPosition } from "./state"; -import { Params } from "./params"; -import { Long, isSet, DeepPartial } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; -export const protobufPackage = "osmosis.streamswap.v1"; - -/** GenesisState defines the streamswap module's genesis state. */ -export interface GenesisState { - sales: Sale[]; - userPositions: UserPositionKV[]; - nextSaleId: Long; - params?: Params; -} - -/** - * UserPositionKV is a record in genesis representing acc_address user position - * of a sale_id sale. - */ -export interface UserPositionKV { - /** user account address */ - accAddress: string; - saleId: Long; - userPosition?: UserPosition; -} - -function createBaseGenesisState(): GenesisState { - return { - sales: [], - userPositions: [], - nextSaleId: Long.UZERO, - params: undefined - }; -} - -export const GenesisState = { - encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - for (const v of message.sales) { - Sale.encode(v!, writer.uint32(10).fork()).ldelim(); - } - - for (const v of message.userPositions) { - UserPositionKV.encode(v!, writer.uint32(18).fork()).ldelim(); - } - - if (!message.nextSaleId.isZero()) { - writer.uint32(24).uint64(message.nextSaleId); - } - - if (message.params !== undefined) { - Params.encode(message.params, writer.uint32(34).fork()).ldelim(); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGenesisState(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.sales.push(Sale.decode(reader, reader.uint32())); - break; - - case 2: - message.userPositions.push(UserPositionKV.decode(reader, reader.uint32())); - break; - - case 3: - message.nextSaleId = (reader.uint64() as Long); - break; - - case 4: - message.params = Params.decode(reader, reader.uint32()); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(object: any): GenesisState { - return { - sales: Array.isArray(object?.sales) ? object.sales.map((e: any) => Sale.fromJSON(e)) : [], - userPositions: Array.isArray(object?.userPositions) ? object.userPositions.map((e: any) => UserPositionKV.fromJSON(e)) : [], - nextSaleId: isSet(object.nextSaleId) ? Long.fromValue(object.nextSaleId) : Long.UZERO, - params: isSet(object.params) ? Params.fromJSON(object.params) : undefined - }; - }, - - toJSON(message: GenesisState): unknown { - const obj: any = {}; - - if (message.sales) { - obj.sales = message.sales.map(e => e ? Sale.toJSON(e) : undefined); - } else { - obj.sales = []; - } - - if (message.userPositions) { - obj.userPositions = message.userPositions.map(e => e ? UserPositionKV.toJSON(e) : undefined); - } else { - obj.userPositions = []; - } - - message.nextSaleId !== undefined && (obj.nextSaleId = (message.nextSaleId || Long.UZERO).toString()); - message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): GenesisState { - const message = createBaseGenesisState(); - message.sales = object.sales?.map(e => Sale.fromPartial(e)) || []; - message.userPositions = object.userPositions?.map(e => UserPositionKV.fromPartial(e)) || []; - message.nextSaleId = object.nextSaleId !== undefined && object.nextSaleId !== null ? Long.fromValue(object.nextSaleId) : Long.UZERO; - message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; - return message; - } - -}; - -function createBaseUserPositionKV(): UserPositionKV { - return { - accAddress: "", - saleId: Long.UZERO, - userPosition: undefined - }; -} - -export const UserPositionKV = { - encode(message: UserPositionKV, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.accAddress !== "") { - writer.uint32(10).string(message.accAddress); - } - - if (!message.saleId.isZero()) { - writer.uint32(16).uint64(message.saleId); - } - - if (message.userPosition !== undefined) { - UserPosition.encode(message.userPosition, writer.uint32(26).fork()).ldelim(); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): UserPositionKV { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUserPositionKV(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.accAddress = reader.string(); - break; - - case 2: - message.saleId = (reader.uint64() as Long); - break; - - case 3: - message.userPosition = UserPosition.decode(reader, reader.uint32()); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(object: any): UserPositionKV { - return { - accAddress: isSet(object.accAddress) ? String(object.accAddress) : "", - saleId: isSet(object.saleId) ? Long.fromValue(object.saleId) : Long.UZERO, - userPosition: isSet(object.userPosition) ? UserPosition.fromJSON(object.userPosition) : undefined - }; - }, - - toJSON(message: UserPositionKV): unknown { - const obj: any = {}; - message.accAddress !== undefined && (obj.accAddress = message.accAddress); - message.saleId !== undefined && (obj.saleId = (message.saleId || Long.UZERO).toString()); - message.userPosition !== undefined && (obj.userPosition = message.userPosition ? UserPosition.toJSON(message.userPosition) : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): UserPositionKV { - const message = createBaseUserPositionKV(); - message.accAddress = object.accAddress ?? ""; - message.saleId = object.saleId !== undefined && object.saleId !== null ? Long.fromValue(object.saleId) : Long.UZERO; - message.userPosition = object.userPosition !== undefined && object.userPosition !== null ? UserPosition.fromPartial(object.userPosition) : undefined; - return message; - } - -}; \ No newline at end of file diff --git a/__fixtures__/output2/osmosis/streamswap/v1/params.ts b/__fixtures__/output2/osmosis/streamswap/v1/params.ts deleted file mode 100644 index be4139ddf9..0000000000 --- a/__fixtures__/output2/osmosis/streamswap/v1/params.ts +++ /dev/null @@ -1,127 +0,0 @@ -//@ts-nocheck -/* eslint-disable */ -import { Coin } from "../../../cosmos/base/v1beta1/coin"; -import { Duration } from "../../../google/protobuf/duration"; -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial } from "../../../helpers"; -export const protobufPackage = "osmosis.streamswap.v1"; - -/** Params holds parameters for the streamswap module */ -export interface Params { - /** - * fee charged when creating a new sale. The fee will go to the - * sale_fee_recipient unless it is not defined (empty). - */ - saleCreationFee: Coin[]; - - /** bech32 address of the fee recipient */ - saleCreationFeeRecipient: string; - - /** - * minimum amount duration of time between the sale creation and the sale - * start time. - */ - minDurationUntilStartTime?: Duration; - - /** minimum duration for every new sale. */ - minSaleDuration?: Duration; -} - -function createBaseParams(): Params { - return { - saleCreationFee: [], - saleCreationFeeRecipient: "", - minDurationUntilStartTime: undefined, - minSaleDuration: undefined - }; -} - -export const Params = { - encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - for (const v of message.saleCreationFee) { - Coin.encode(v!, writer.uint32(10).fork()).ldelim(); - } - - if (message.saleCreationFeeRecipient !== "") { - writer.uint32(18).string(message.saleCreationFeeRecipient); - } - - if (message.minDurationUntilStartTime !== undefined) { - Duration.encode(message.minDurationUntilStartTime, writer.uint32(26).fork()).ldelim(); - } - - if (message.minSaleDuration !== undefined) { - Duration.encode(message.minSaleDuration, writer.uint32(34).fork()).ldelim(); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): Params { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseParams(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.saleCreationFee.push(Coin.decode(reader, reader.uint32())); - break; - - case 2: - message.saleCreationFeeRecipient = reader.string(); - break; - - case 3: - message.minDurationUntilStartTime = Duration.decode(reader, reader.uint32()); - break; - - case 4: - message.minSaleDuration = Duration.decode(reader, reader.uint32()); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(object: any): Params { - return { - saleCreationFee: Array.isArray(object?.saleCreationFee) ? object.saleCreationFee.map((e: any) => Coin.fromJSON(e)) : [], - saleCreationFeeRecipient: isSet(object.saleCreationFeeRecipient) ? String(object.saleCreationFeeRecipient) : "", - minDurationUntilStartTime: isSet(object.minDurationUntilStartTime) ? Duration.fromJSON(object.minDurationUntilStartTime) : undefined, - minSaleDuration: isSet(object.minSaleDuration) ? Duration.fromJSON(object.minSaleDuration) : undefined - }; - }, - - toJSON(message: Params): unknown { - const obj: any = {}; - - if (message.saleCreationFee) { - obj.saleCreationFee = message.saleCreationFee.map(e => e ? Coin.toJSON(e) : undefined); - } else { - obj.saleCreationFee = []; - } - - message.saleCreationFeeRecipient !== undefined && (obj.saleCreationFeeRecipient = message.saleCreationFeeRecipient); - message.minDurationUntilStartTime !== undefined && (obj.minDurationUntilStartTime = message.minDurationUntilStartTime ? Duration.toJSON(message.minDurationUntilStartTime) : undefined); - message.minSaleDuration !== undefined && (obj.minSaleDuration = message.minSaleDuration ? Duration.toJSON(message.minSaleDuration) : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): Params { - const message = createBaseParams(); - message.saleCreationFee = object.saleCreationFee?.map(e => Coin.fromPartial(e)) || []; - message.saleCreationFeeRecipient = object.saleCreationFeeRecipient ?? ""; - message.minDurationUntilStartTime = object.minDurationUntilStartTime !== undefined && object.minDurationUntilStartTime !== null ? Duration.fromPartial(object.minDurationUntilStartTime) : undefined; - message.minSaleDuration = object.minSaleDuration !== undefined && object.minSaleDuration !== null ? Duration.fromPartial(object.minSaleDuration) : undefined; - return message; - } - -}; \ No newline at end of file diff --git a/__fixtures__/output2/osmosis/streamswap/v1/query.ts b/__fixtures__/output2/osmosis/streamswap/v1/query.ts deleted file mode 100644 index 443d23acef..0000000000 --- a/__fixtures__/output2/osmosis/streamswap/v1/query.ts +++ /dev/null @@ -1,449 +0,0 @@ -//@ts-nocheck -/* eslint-disable */ -import { PageRequest, PageResponse } from "../../../cosmos/base/query/v1beta1/pagination"; -import { Sale, UserPosition } from "./state"; -import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial, Long, Rpc } from "../../../helpers"; -export const protobufPackage = "osmosis.streamswap.v1"; -export interface QuerySales { - /** pagination defines an pagination for the request. */ - pagination?: PageRequest; -} -export interface QuerySalesResponse { - sales: Sale[]; - pagination?: PageResponse; -} - -/** Request type for Query/Sale */ -export interface QuerySale { - /** Sale ID */ - saleId: Long; -} -export interface QuerySaleResponse { - sale?: Sale; -} - -/** Request type for Query/Sale */ -export interface QueryUserPosition { - /** ID of the Sale */ - saleId: Long; - - /** user account address */ - user: string; -} -export interface QueryUserPositionResponse { - userPosition?: UserPosition; -} - -function createBaseQuerySales(): QuerySales { - return { - pagination: undefined - }; -} - -export const QuerySales = { - encode(message: QuerySales, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySales { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQuerySales(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(object: any): QuerySales { - return { - pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined - }; - }, - - toJSON(message: QuerySales): unknown { - const obj: any = {}; - message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): QuerySales { - const message = createBaseQuerySales(); - message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; - return message; - } - -}; - -function createBaseQuerySalesResponse(): QuerySalesResponse { - return { - sales: [], - pagination: undefined - }; -} - -export const QuerySalesResponse = { - encode(message: QuerySalesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - for (const v of message.sales) { - Sale.encode(v!, writer.uint32(10).fork()).ldelim(); - } - - if (message.pagination !== undefined) { - PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySalesResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQuerySalesResponse(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.sales.push(Sale.decode(reader, reader.uint32())); - break; - - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(object: any): QuerySalesResponse { - return { - sales: Array.isArray(object?.sales) ? object.sales.map((e: any) => Sale.fromJSON(e)) : [], - pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined - }; - }, - - toJSON(message: QuerySalesResponse): unknown { - const obj: any = {}; - - if (message.sales) { - obj.sales = message.sales.map(e => e ? Sale.toJSON(e) : undefined); - } else { - obj.sales = []; - } - - message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): QuerySalesResponse { - const message = createBaseQuerySalesResponse(); - message.sales = object.sales?.map(e => Sale.fromPartial(e)) || []; - message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; - return message; - } - -}; - -function createBaseQuerySale(): QuerySale { - return { - saleId: Long.UZERO - }; -} - -export const QuerySale = { - encode(message: QuerySale, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.saleId.isZero()) { - writer.uint32(8).uint64(message.saleId); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySale { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQuerySale(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.saleId = (reader.uint64() as Long); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(object: any): QuerySale { - return { - saleId: isSet(object.saleId) ? Long.fromValue(object.saleId) : Long.UZERO - }; - }, - - toJSON(message: QuerySale): unknown { - const obj: any = {}; - message.saleId !== undefined && (obj.saleId = (message.saleId || Long.UZERO).toString()); - return obj; - }, - - fromPartial(object: DeepPartial): QuerySale { - const message = createBaseQuerySale(); - message.saleId = object.saleId !== undefined && object.saleId !== null ? Long.fromValue(object.saleId) : Long.UZERO; - return message; - } - -}; - -function createBaseQuerySaleResponse(): QuerySaleResponse { - return { - sale: undefined - }; -} - -export const QuerySaleResponse = { - encode(message: QuerySaleResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.sale !== undefined) { - Sale.encode(message.sale, writer.uint32(10).fork()).ldelim(); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): QuerySaleResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQuerySaleResponse(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.sale = Sale.decode(reader, reader.uint32()); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(object: any): QuerySaleResponse { - return { - sale: isSet(object.sale) ? Sale.fromJSON(object.sale) : undefined - }; - }, - - toJSON(message: QuerySaleResponse): unknown { - const obj: any = {}; - message.sale !== undefined && (obj.sale = message.sale ? Sale.toJSON(message.sale) : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): QuerySaleResponse { - const message = createBaseQuerySaleResponse(); - message.sale = object.sale !== undefined && object.sale !== null ? Sale.fromPartial(object.sale) : undefined; - return message; - } - -}; - -function createBaseQueryUserPosition(): QueryUserPosition { - return { - saleId: Long.UZERO, - user: "" - }; -} - -export const QueryUserPosition = { - encode(message: QueryUserPosition, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.saleId.isZero()) { - writer.uint32(8).uint64(message.saleId); - } - - if (message.user !== "") { - writer.uint32(18).string(message.user); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): QueryUserPosition { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryUserPosition(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.saleId = (reader.uint64() as Long); - break; - - case 2: - message.user = reader.string(); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(object: any): QueryUserPosition { - return { - saleId: isSet(object.saleId) ? Long.fromValue(object.saleId) : Long.UZERO, - user: isSet(object.user) ? String(object.user) : "" - }; - }, - - toJSON(message: QueryUserPosition): unknown { - const obj: any = {}; - message.saleId !== undefined && (obj.saleId = (message.saleId || Long.UZERO).toString()); - message.user !== undefined && (obj.user = message.user); - return obj; - }, - - fromPartial(object: DeepPartial): QueryUserPosition { - const message = createBaseQueryUserPosition(); - message.saleId = object.saleId !== undefined && object.saleId !== null ? Long.fromValue(object.saleId) : Long.UZERO; - message.user = object.user ?? ""; - return message; - } - -}; - -function createBaseQueryUserPositionResponse(): QueryUserPositionResponse { - return { - userPosition: undefined - }; -} - -export const QueryUserPositionResponse = { - encode(message: QueryUserPositionResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.userPosition !== undefined) { - UserPosition.encode(message.userPosition, writer.uint32(10).fork()).ldelim(); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): QueryUserPositionResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryUserPositionResponse(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.userPosition = UserPosition.decode(reader, reader.uint32()); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(object: any): QueryUserPositionResponse { - return { - userPosition: isSet(object.userPosition) ? UserPosition.fromJSON(object.userPosition) : undefined - }; - }, - - toJSON(message: QueryUserPositionResponse): unknown { - const obj: any = {}; - message.userPosition !== undefined && (obj.userPosition = message.userPosition ? UserPosition.toJSON(message.userPosition) : undefined); - return obj; - }, - - fromPartial(object: DeepPartial): QueryUserPositionResponse { - const message = createBaseQueryUserPositionResponse(); - message.userPosition = object.userPosition !== undefined && object.userPosition !== null ? UserPosition.fromPartial(object.userPosition) : undefined; - return message; - } - -}; - -/** Query defines the gRPC querier service. */ -export interface Query { - /** Returns list of Sales ordered by the creation time */ - Sales(request?: QuerySales): Promise; - - /** Returns the specific Sale object */ - Sale(request: QuerySale): Promise; - UserPosition(request: QueryUserPosition): Promise; -} -export class QueryClientImpl implements Query { - private readonly rpc: Rpc; - - constructor(rpc: Rpc) { - this.rpc = rpc; - this.Sales = this.Sales.bind(this); - this.Sale = this.Sale.bind(this); - this.UserPosition = this.UserPosition.bind(this); - } - - Sales(request: QuerySales = { - pagination: undefined - }): Promise { - const data = QuerySales.encode(request).finish(); - const promise = this.rpc.request("osmosis.streamswap.v1.Query", "Sales", data); - return promise.then(data => QuerySalesResponse.decode(new _m0.Reader(data))); - } - - Sale(request: QuerySale): Promise { - const data = QuerySale.encode(request).finish(); - const promise = this.rpc.request("osmosis.streamswap.v1.Query", "Sale", data); - return promise.then(data => QuerySaleResponse.decode(new _m0.Reader(data))); - } - - UserPosition(request: QueryUserPosition): Promise { - const data = QueryUserPosition.encode(request).finish(); - const promise = this.rpc.request("osmosis.streamswap.v1.Query", "UserPosition", data); - return promise.then(data => QueryUserPositionResponse.decode(new _m0.Reader(data))); - } - -} \ No newline at end of file diff --git a/__fixtures__/output2/osmosis/streamswap/v1/state.ts b/__fixtures__/output2/osmosis/streamswap/v1/state.ts deleted file mode 100644 index 0f01cdb348..0000000000 --- a/__fixtures__/output2/osmosis/streamswap/v1/state.ts +++ /dev/null @@ -1,436 +0,0 @@ -//@ts-nocheck -/* eslint-disable */ -import { Timestamp } from "../../../google/protobuf/timestamp"; -import { Long, isSet, fromJsonTimestamp, fromTimestamp, DeepPartial } from "../../../helpers"; -import * as _m0 from "protobufjs/minimal"; -export const protobufPackage = "osmosis.streamswap.v1"; -export interface Sale { - /** Destination for the earned token_in */ - treasury: string; - id: Long; - - /** - * token_out is a token denom to be bootstraped. May be referred as base - * currency, or a sale token. - */ - tokenOut: string; - - /** - * token_in is a token denom used to buy sale tokens (`token_out`). May be - * referred as quote_currency or payment token. - */ - tokenIn: string; - - /** total number of `tokens_out` to be sold during the continuous sale. */ - tokenOutSupply: string; - - /** start time when the token emission starts. */ - startTime?: Timestamp; - - /** - * end time when the token emission ends. Can't be bigger than start + - * 139years (to avoid round overflow) - */ - endTime?: Timestamp; - - /** Round number when the sale was last time updated. */ - round: Long; - - /** Last round of the Sale; */ - endRound: Long; - - /** amout of remaining token_out to sell */ - outRemaining: string; - - /** amount of token_out sold */ - outSold: string; - - /** out token per share */ - outPerShare: string; - - /** total amount of currently staked coins (token_in) but not spent coins. */ - staked: string; - - /** total amount of earned coins (token_in) */ - income: string; - - /** total amount of shares */ - shares: string; - - /** Name for the sale. */ - name: string; - - /** URL with sale and project details. */ - url: string; -} - -/** UserPosition represents user account in a sale */ -export interface UserPosition { - shares: string; - - /** total number of currently staked tokens */ - staked: string; - - /** last token/share ratio */ - outPerShare: string; - - /** amount of token_in spent */ - spent: string; - - /** Amount of accumulated, not withdrawn, purchased tokens (token_out) */ - purchased: string; -} - -function createBaseSale(): Sale { - return { - treasury: "", - id: Long.UZERO, - tokenOut: "", - tokenIn: "", - tokenOutSupply: "", - startTime: undefined, - endTime: undefined, - round: Long.ZERO, - endRound: Long.ZERO, - outRemaining: "", - outSold: "", - outPerShare: "", - staked: "", - income: "", - shares: "", - name: "", - url: "" - }; -} - -export const Sale = { - encode(message: Sale, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.treasury !== "") { - writer.uint32(10).string(message.treasury); - } - - if (!message.id.isZero()) { - writer.uint32(16).uint64(message.id); - } - - if (message.tokenOut !== "") { - writer.uint32(26).string(message.tokenOut); - } - - if (message.tokenIn !== "") { - writer.uint32(34).string(message.tokenIn); - } - - if (message.tokenOutSupply !== "") { - writer.uint32(42).string(message.tokenOutSupply); - } - - if (message.startTime !== undefined) { - Timestamp.encode(message.startTime, writer.uint32(50).fork()).ldelim(); - } - - if (message.endTime !== undefined) { - Timestamp.encode(message.endTime, writer.uint32(58).fork()).ldelim(); - } - - if (!message.round.isZero()) { - writer.uint32(64).int64(message.round); - } - - if (!message.endRound.isZero()) { - writer.uint32(72).int64(message.endRound); - } - - if (message.outRemaining !== "") { - writer.uint32(82).string(message.outRemaining); - } - - if (message.outSold !== "") { - writer.uint32(90).string(message.outSold); - } - - if (message.outPerShare !== "") { - writer.uint32(98).string(message.outPerShare); - } - - if (message.staked !== "") { - writer.uint32(106).string(message.staked); - } - - if (message.income !== "") { - writer.uint32(114).string(message.income); - } - - if (message.shares !== "") { - writer.uint32(122).string(message.shares); - } - - if (message.name !== "") { - writer.uint32(162).string(message.name); - } - - if (message.url !== "") { - writer.uint32(170).string(message.url); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): Sale { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSale(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.treasury = reader.string(); - break; - - case 2: - message.id = (reader.uint64() as Long); - break; - - case 3: - message.tokenOut = reader.string(); - break; - - case 4: - message.tokenIn = reader.string(); - break; - - case 5: - message.tokenOutSupply = reader.string(); - break; - - case 6: - message.startTime = Timestamp.decode(reader, reader.uint32()); - break; - - case 7: - message.endTime = Timestamp.decode(reader, reader.uint32()); - break; - - case 8: - message.round = (reader.int64() as Long); - break; - - case 9: - message.endRound = (reader.int64() as Long); - break; - - case 10: - message.outRemaining = reader.string(); - break; - - case 11: - message.outSold = reader.string(); - break; - - case 12: - message.outPerShare = reader.string(); - break; - - case 13: - message.staked = reader.string(); - break; - - case 14: - message.income = reader.string(); - break; - - case 15: - message.shares = reader.string(); - break; - - case 20: - message.name = reader.string(); - break; - - case 21: - message.url = reader.string(); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(object: any): Sale { - return { - treasury: isSet(object.treasury) ? String(object.treasury) : "", - id: isSet(object.id) ? Long.fromValue(object.id) : Long.UZERO, - tokenOut: isSet(object.tokenOut) ? String(object.tokenOut) : "", - tokenIn: isSet(object.tokenIn) ? String(object.tokenIn) : "", - tokenOutSupply: isSet(object.tokenOutSupply) ? String(object.tokenOutSupply) : "", - startTime: isSet(object.startTime) ? fromJsonTimestamp(object.startTime) : undefined, - endTime: isSet(object.endTime) ? fromJsonTimestamp(object.endTime) : undefined, - round: isSet(object.round) ? Long.fromValue(object.round) : Long.ZERO, - endRound: isSet(object.endRound) ? Long.fromValue(object.endRound) : Long.ZERO, - outRemaining: isSet(object.outRemaining) ? String(object.outRemaining) : "", - outSold: isSet(object.outSold) ? String(object.outSold) : "", - outPerShare: isSet(object.outPerShare) ? String(object.outPerShare) : "", - staked: isSet(object.staked) ? String(object.staked) : "", - income: isSet(object.income) ? String(object.income) : "", - shares: isSet(object.shares) ? String(object.shares) : "", - name: isSet(object.name) ? String(object.name) : "", - url: isSet(object.url) ? String(object.url) : "" - }; - }, - - toJSON(message: Sale): unknown { - const obj: any = {}; - message.treasury !== undefined && (obj.treasury = message.treasury); - message.id !== undefined && (obj.id = (message.id || Long.UZERO).toString()); - message.tokenOut !== undefined && (obj.tokenOut = message.tokenOut); - message.tokenIn !== undefined && (obj.tokenIn = message.tokenIn); - message.tokenOutSupply !== undefined && (obj.tokenOutSupply = message.tokenOutSupply); - message.startTime !== undefined && (obj.startTime = fromTimestamp(message.startTime).toISOString()); - message.endTime !== undefined && (obj.endTime = fromTimestamp(message.endTime).toISOString()); - message.round !== undefined && (obj.round = (message.round || Long.ZERO).toString()); - message.endRound !== undefined && (obj.endRound = (message.endRound || Long.ZERO).toString()); - message.outRemaining !== undefined && (obj.outRemaining = message.outRemaining); - message.outSold !== undefined && (obj.outSold = message.outSold); - message.outPerShare !== undefined && (obj.outPerShare = message.outPerShare); - message.staked !== undefined && (obj.staked = message.staked); - message.income !== undefined && (obj.income = message.income); - message.shares !== undefined && (obj.shares = message.shares); - message.name !== undefined && (obj.name = message.name); - message.url !== undefined && (obj.url = message.url); - return obj; - }, - - fromPartial(object: DeepPartial): Sale { - const message = createBaseSale(); - message.treasury = object.treasury ?? ""; - message.id = object.id !== undefined && object.id !== null ? Long.fromValue(object.id) : Long.UZERO; - message.tokenOut = object.tokenOut ?? ""; - message.tokenIn = object.tokenIn ?? ""; - message.tokenOutSupply = object.tokenOutSupply ?? ""; - message.startTime = object.startTime !== undefined && object.startTime !== null ? Timestamp.fromPartial(object.startTime) : undefined; - message.endTime = object.endTime !== undefined && object.endTime !== null ? Timestamp.fromPartial(object.endTime) : undefined; - message.round = object.round !== undefined && object.round !== null ? Long.fromValue(object.round) : Long.ZERO; - message.endRound = object.endRound !== undefined && object.endRound !== null ? Long.fromValue(object.endRound) : Long.ZERO; - message.outRemaining = object.outRemaining ?? ""; - message.outSold = object.outSold ?? ""; - message.outPerShare = object.outPerShare ?? ""; - message.staked = object.staked ?? ""; - message.income = object.income ?? ""; - message.shares = object.shares ?? ""; - message.name = object.name ?? ""; - message.url = object.url ?? ""; - return message; - } - -}; - -function createBaseUserPosition(): UserPosition { - return { - shares: "", - staked: "", - outPerShare: "", - spent: "", - purchased: "" - }; -} - -export const UserPosition = { - encode(message: UserPosition, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.shares !== "") { - writer.uint32(10).string(message.shares); - } - - if (message.staked !== "") { - writer.uint32(18).string(message.staked); - } - - if (message.outPerShare !== "") { - writer.uint32(26).string(message.outPerShare); - } - - if (message.spent !== "") { - writer.uint32(34).string(message.spent); - } - - if (message.purchased !== "") { - writer.uint32(42).string(message.purchased); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): UserPosition { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUserPosition(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.shares = reader.string(); - break; - - case 2: - message.staked = reader.string(); - break; - - case 3: - message.outPerShare = reader.string(); - break; - - case 4: - message.spent = reader.string(); - break; - - case 5: - message.purchased = reader.string(); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(object: any): UserPosition { - return { - shares: isSet(object.shares) ? String(object.shares) : "", - staked: isSet(object.staked) ? String(object.staked) : "", - outPerShare: isSet(object.outPerShare) ? String(object.outPerShare) : "", - spent: isSet(object.spent) ? String(object.spent) : "", - purchased: isSet(object.purchased) ? String(object.purchased) : "" - }; - }, - - toJSON(message: UserPosition): unknown { - const obj: any = {}; - message.shares !== undefined && (obj.shares = message.shares); - message.staked !== undefined && (obj.staked = message.staked); - message.outPerShare !== undefined && (obj.outPerShare = message.outPerShare); - message.spent !== undefined && (obj.spent = message.spent); - message.purchased !== undefined && (obj.purchased = message.purchased); - return obj; - }, - - fromPartial(object: DeepPartial): UserPosition { - const message = createBaseUserPosition(); - message.shares = object.shares ?? ""; - message.staked = object.staked ?? ""; - message.outPerShare = object.outPerShare ?? ""; - message.spent = object.spent ?? ""; - message.purchased = object.purchased ?? ""; - return message; - } - -}; \ No newline at end of file diff --git a/__fixtures__/output2/osmosis/streamswap/v1/tx.ts b/__fixtures__/output2/osmosis/streamswap/v1/tx.ts deleted file mode 100644 index 34febe14a0..0000000000 --- a/__fixtures__/output2/osmosis/streamswap/v1/tx.ts +++ /dev/null @@ -1,819 +0,0 @@ -//@ts-nocheck -/* eslint-disable */ -import { Coin } from "../../../cosmos/base/v1beta1/coin"; -import { Timestamp } from "../../../google/protobuf/timestamp"; -import { Duration } from "../../../google/protobuf/duration"; -import * as _m0 from "protobufjs/minimal"; -import { isSet, fromJsonTimestamp, fromTimestamp, DeepPartial, Long, Rpc } from "../../../helpers"; -export const protobufPackage = "osmosis.streamswap.v1"; -export interface MsgCreateSale { - /** - * Sale creator and the account which provides token (token_out) to the sale. - * When processing this message, token_out - */ - creator: string; - - /** - * token_in is a denom used to buy `token_out`. May be referred as a - * "quote currency". - */ - tokenIn: string; - - /** - * token_out is a coin supply (denom + amount) to sell. May be referred as - * "base currency". The whole supply will be transferred from the creator - * to the module and will be sold during the sale. - */ - tokenOut?: Coin; - - /** - * Maximum fee the creator is going to pay for creating a sale. The creator - * will be charged params.SaleCreationFee. Transaction will fail if - * max_fee is smaller than params.SaleCreationFee. If empty, the creator - * doesn't accept any fee. - */ - maxFee: Coin[]; - - /** start time when the token sale starts. */ - startTime?: Timestamp; - - /** duration time that the sale takes place over */ - duration?: Duration; - - /** - * Recipient is the account which receives earned `token_in` from when the - * sale is finalized. If not defined (empty) the creator - * account will be used. - */ - recipient: string; - - /** Name for the sale, max 40 characters, min 4. Required. */ - name: string; - - /** - * URL with sale and project details. Can be a link a link to IPFS, - * hackmd, project page, blog post... Max 120 characters. Must be - * valid agains Go url.ParseRequestURI. Required. - */ - url: string; -} -export interface MsgCreateSaleResponse { - saleId: Long; -} -export interface MsgSubscribe { - /** sender is an account address adding a deposit */ - sender: string; - - /** ID of an existing sale. */ - saleId: Long; - - /** number of sale.token_in staked by a user. */ - amount: string; -} -export interface MsgWithdraw { - /** sender is an account address subscribed to the sale_id */ - sender: string; - - /** ID of a sale. */ - saleId: Long; - - /** - * amount of tokens_in to withdraw. Must be at most the amount of not spent - * tokens, unless set to null - then all remaining balance will be withdrawn. - */ - amount: string; -} -export interface MsgExitSale { - /** sender is an account address exiting a sale */ - sender: string; - - /** ID of an existing sale. */ - saleId: Long; -} -export interface MsgExitSaleResponse { - /** Purchased amount of "out" tokens withdrawn to the user. */ - purchased: string; -} -export interface MsgFinalizeSale { - /** sender is an account signing the message and triggering the finalization. */ - sender: string; - - /** ID of an existing sale. */ - saleId: Long; -} -export interface MsgFinalizeSaleResponse { - /** Income amount of token_in sent to the sale recipient. */ - income: string; -} - -function createBaseMsgCreateSale(): MsgCreateSale { - return { - creator: "", - tokenIn: "", - tokenOut: undefined, - maxFee: [], - startTime: undefined, - duration: undefined, - recipient: "", - name: "", - url: "" - }; -} - -export const MsgCreateSale = { - encode(message: MsgCreateSale, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.creator !== "") { - writer.uint32(10).string(message.creator); - } - - if (message.tokenIn !== "") { - writer.uint32(18).string(message.tokenIn); - } - - if (message.tokenOut !== undefined) { - Coin.encode(message.tokenOut, writer.uint32(26).fork()).ldelim(); - } - - for (const v of message.maxFee) { - Coin.encode(v!, writer.uint32(34).fork()).ldelim(); - } - - if (message.startTime !== undefined) { - Timestamp.encode(message.startTime, writer.uint32(42).fork()).ldelim(); - } - - if (message.duration !== undefined) { - Duration.encode(message.duration, writer.uint32(50).fork()).ldelim(); - } - - if (message.recipient !== "") { - writer.uint32(58).string(message.recipient); - } - - if (message.name !== "") { - writer.uint32(66).string(message.name); - } - - if (message.url !== "") { - writer.uint32(74).string(message.url); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateSale { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCreateSale(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.creator = reader.string(); - break; - - case 2: - message.tokenIn = reader.string(); - break; - - case 3: - message.tokenOut = Coin.decode(reader, reader.uint32()); - break; - - case 4: - message.maxFee.push(Coin.decode(reader, reader.uint32())); - break; - - case 5: - message.startTime = Timestamp.decode(reader, reader.uint32()); - break; - - case 6: - message.duration = Duration.decode(reader, reader.uint32()); - break; - - case 7: - message.recipient = reader.string(); - break; - - case 8: - message.name = reader.string(); - break; - - case 9: - message.url = reader.string(); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(object: any): MsgCreateSale { - return { - creator: isSet(object.creator) ? String(object.creator) : "", - tokenIn: isSet(object.tokenIn) ? String(object.tokenIn) : "", - tokenOut: isSet(object.tokenOut) ? Coin.fromJSON(object.tokenOut) : undefined, - maxFee: Array.isArray(object?.maxFee) ? object.maxFee.map((e: any) => Coin.fromJSON(e)) : [], - startTime: isSet(object.startTime) ? fromJsonTimestamp(object.startTime) : undefined, - duration: isSet(object.duration) ? Duration.fromJSON(object.duration) : undefined, - recipient: isSet(object.recipient) ? String(object.recipient) : "", - name: isSet(object.name) ? String(object.name) : "", - url: isSet(object.url) ? String(object.url) : "" - }; - }, - - toJSON(message: MsgCreateSale): unknown { - const obj: any = {}; - message.creator !== undefined && (obj.creator = message.creator); - message.tokenIn !== undefined && (obj.tokenIn = message.tokenIn); - message.tokenOut !== undefined && (obj.tokenOut = message.tokenOut ? Coin.toJSON(message.tokenOut) : undefined); - - if (message.maxFee) { - obj.maxFee = message.maxFee.map(e => e ? Coin.toJSON(e) : undefined); - } else { - obj.maxFee = []; - } - - message.startTime !== undefined && (obj.startTime = fromTimestamp(message.startTime).toISOString()); - message.duration !== undefined && (obj.duration = message.duration ? Duration.toJSON(message.duration) : undefined); - message.recipient !== undefined && (obj.recipient = message.recipient); - message.name !== undefined && (obj.name = message.name); - message.url !== undefined && (obj.url = message.url); - return obj; - }, - - fromPartial(object: DeepPartial): MsgCreateSale { - const message = createBaseMsgCreateSale(); - message.creator = object.creator ?? ""; - message.tokenIn = object.tokenIn ?? ""; - message.tokenOut = object.tokenOut !== undefined && object.tokenOut !== null ? Coin.fromPartial(object.tokenOut) : undefined; - message.maxFee = object.maxFee?.map(e => Coin.fromPartial(e)) || []; - message.startTime = object.startTime !== undefined && object.startTime !== null ? Timestamp.fromPartial(object.startTime) : undefined; - message.duration = object.duration !== undefined && object.duration !== null ? Duration.fromPartial(object.duration) : undefined; - message.recipient = object.recipient ?? ""; - message.name = object.name ?? ""; - message.url = object.url ?? ""; - return message; - } - -}; - -function createBaseMsgCreateSaleResponse(): MsgCreateSaleResponse { - return { - saleId: Long.UZERO - }; -} - -export const MsgCreateSaleResponse = { - encode(message: MsgCreateSaleResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (!message.saleId.isZero()) { - writer.uint32(8).uint64(message.saleId); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateSaleResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgCreateSaleResponse(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.saleId = (reader.uint64() as Long); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(object: any): MsgCreateSaleResponse { - return { - saleId: isSet(object.saleId) ? Long.fromValue(object.saleId) : Long.UZERO - }; - }, - - toJSON(message: MsgCreateSaleResponse): unknown { - const obj: any = {}; - message.saleId !== undefined && (obj.saleId = (message.saleId || Long.UZERO).toString()); - return obj; - }, - - fromPartial(object: DeepPartial): MsgCreateSaleResponse { - const message = createBaseMsgCreateSaleResponse(); - message.saleId = object.saleId !== undefined && object.saleId !== null ? Long.fromValue(object.saleId) : Long.UZERO; - return message; - } - -}; - -function createBaseMsgSubscribe(): MsgSubscribe { - return { - sender: "", - saleId: Long.UZERO, - amount: "" - }; -} - -export const MsgSubscribe = { - encode(message: MsgSubscribe, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.sender !== "") { - writer.uint32(10).string(message.sender); - } - - if (!message.saleId.isZero()) { - writer.uint32(16).uint64(message.saleId); - } - - if (message.amount !== "") { - writer.uint32(26).string(message.amount); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): MsgSubscribe { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgSubscribe(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.sender = reader.string(); - break; - - case 2: - message.saleId = (reader.uint64() as Long); - break; - - case 3: - message.amount = reader.string(); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(object: any): MsgSubscribe { - return { - sender: isSet(object.sender) ? String(object.sender) : "", - saleId: isSet(object.saleId) ? Long.fromValue(object.saleId) : Long.UZERO, - amount: isSet(object.amount) ? String(object.amount) : "" - }; - }, - - toJSON(message: MsgSubscribe): unknown { - const obj: any = {}; - message.sender !== undefined && (obj.sender = message.sender); - message.saleId !== undefined && (obj.saleId = (message.saleId || Long.UZERO).toString()); - message.amount !== undefined && (obj.amount = message.amount); - return obj; - }, - - fromPartial(object: DeepPartial): MsgSubscribe { - const message = createBaseMsgSubscribe(); - message.sender = object.sender ?? ""; - message.saleId = object.saleId !== undefined && object.saleId !== null ? Long.fromValue(object.saleId) : Long.UZERO; - message.amount = object.amount ?? ""; - return message; - } - -}; - -function createBaseMsgWithdraw(): MsgWithdraw { - return { - sender: "", - saleId: Long.UZERO, - amount: undefined - }; -} - -export const MsgWithdraw = { - encode(message: MsgWithdraw, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.sender !== "") { - writer.uint32(10).string(message.sender); - } - - if (!message.saleId.isZero()) { - writer.uint32(16).uint64(message.saleId); - } - - if (message.amount !== undefined) { - writer.uint32(26).string(message.amount); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): MsgWithdraw { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgWithdraw(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.sender = reader.string(); - break; - - case 2: - message.saleId = (reader.uint64() as Long); - break; - - case 3: - message.amount = reader.string(); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(object: any): MsgWithdraw { - return { - sender: isSet(object.sender) ? String(object.sender) : "", - saleId: isSet(object.saleId) ? Long.fromValue(object.saleId) : Long.UZERO, - amount: isSet(object.amount) ? String(object.amount) : undefined - }; - }, - - toJSON(message: MsgWithdraw): unknown { - const obj: any = {}; - message.sender !== undefined && (obj.sender = message.sender); - message.saleId !== undefined && (obj.saleId = (message.saleId || Long.UZERO).toString()); - message.amount !== undefined && (obj.amount = message.amount); - return obj; - }, - - fromPartial(object: DeepPartial): MsgWithdraw { - const message = createBaseMsgWithdraw(); - message.sender = object.sender ?? ""; - message.saleId = object.saleId !== undefined && object.saleId !== null ? Long.fromValue(object.saleId) : Long.UZERO; - message.amount = object.amount ?? undefined; - return message; - } - -}; - -function createBaseMsgExitSale(): MsgExitSale { - return { - sender: "", - saleId: Long.UZERO - }; -} - -export const MsgExitSale = { - encode(message: MsgExitSale, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.sender !== "") { - writer.uint32(10).string(message.sender); - } - - if (!message.saleId.isZero()) { - writer.uint32(16).uint64(message.saleId); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): MsgExitSale { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgExitSale(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.sender = reader.string(); - break; - - case 2: - message.saleId = (reader.uint64() as Long); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(object: any): MsgExitSale { - return { - sender: isSet(object.sender) ? String(object.sender) : "", - saleId: isSet(object.saleId) ? Long.fromValue(object.saleId) : Long.UZERO - }; - }, - - toJSON(message: MsgExitSale): unknown { - const obj: any = {}; - message.sender !== undefined && (obj.sender = message.sender); - message.saleId !== undefined && (obj.saleId = (message.saleId || Long.UZERO).toString()); - return obj; - }, - - fromPartial(object: DeepPartial): MsgExitSale { - const message = createBaseMsgExitSale(); - message.sender = object.sender ?? ""; - message.saleId = object.saleId !== undefined && object.saleId !== null ? Long.fromValue(object.saleId) : Long.UZERO; - return message; - } - -}; - -function createBaseMsgExitSaleResponse(): MsgExitSaleResponse { - return { - purchased: "" - }; -} - -export const MsgExitSaleResponse = { - encode(message: MsgExitSaleResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.purchased !== "") { - writer.uint32(10).string(message.purchased); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): MsgExitSaleResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgExitSaleResponse(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.purchased = reader.string(); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(object: any): MsgExitSaleResponse { - return { - purchased: isSet(object.purchased) ? String(object.purchased) : "" - }; - }, - - toJSON(message: MsgExitSaleResponse): unknown { - const obj: any = {}; - message.purchased !== undefined && (obj.purchased = message.purchased); - return obj; - }, - - fromPartial(object: DeepPartial): MsgExitSaleResponse { - const message = createBaseMsgExitSaleResponse(); - message.purchased = object.purchased ?? ""; - return message; - } - -}; - -function createBaseMsgFinalizeSale(): MsgFinalizeSale { - return { - sender: "", - saleId: Long.UZERO - }; -} - -export const MsgFinalizeSale = { - encode(message: MsgFinalizeSale, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.sender !== "") { - writer.uint32(10).string(message.sender); - } - - if (!message.saleId.isZero()) { - writer.uint32(16).uint64(message.saleId); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): MsgFinalizeSale { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgFinalizeSale(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.sender = reader.string(); - break; - - case 2: - message.saleId = (reader.uint64() as Long); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(object: any): MsgFinalizeSale { - return { - sender: isSet(object.sender) ? String(object.sender) : "", - saleId: isSet(object.saleId) ? Long.fromValue(object.saleId) : Long.UZERO - }; - }, - - toJSON(message: MsgFinalizeSale): unknown { - const obj: any = {}; - message.sender !== undefined && (obj.sender = message.sender); - message.saleId !== undefined && (obj.saleId = (message.saleId || Long.UZERO).toString()); - return obj; - }, - - fromPartial(object: DeepPartial): MsgFinalizeSale { - const message = createBaseMsgFinalizeSale(); - message.sender = object.sender ?? ""; - message.saleId = object.saleId !== undefined && object.saleId !== null ? Long.fromValue(object.saleId) : Long.UZERO; - return message; - } - -}; - -function createBaseMsgFinalizeSaleResponse(): MsgFinalizeSaleResponse { - return { - income: "" - }; -} - -export const MsgFinalizeSaleResponse = { - encode(message: MsgFinalizeSaleResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.income !== "") { - writer.uint32(10).string(message.income); - } - - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): MsgFinalizeSaleResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMsgFinalizeSaleResponse(); - - while (reader.pos < end) { - const tag = reader.uint32(); - - switch (tag >>> 3) { - case 1: - message.income = reader.string(); - break; - - default: - reader.skipType(tag & 7); - break; - } - } - - return message; - }, - - fromJSON(object: any): MsgFinalizeSaleResponse { - return { - income: isSet(object.income) ? String(object.income) : "" - }; - }, - - toJSON(message: MsgFinalizeSaleResponse): unknown { - const obj: any = {}; - message.income !== undefined && (obj.income = message.income); - return obj; - }, - - fromPartial(object: DeepPartial): MsgFinalizeSaleResponse { - const message = createBaseMsgFinalizeSaleResponse(); - message.income = object.income ?? ""; - return message; - } - -}; -export interface Msg { - /** - * CreateSale creates new token sale. Anyone can create a new sale. - * params.SaleBond OSMO will be charged as a bond (returned in FinalizeSale) - * to avoid spams. - * The sale follows the streamswap functionality explained in the - * x/launchapd/spec - */ - CreateSale(request: MsgCreateSale): Promise; - - /** - * Subscribe to a token sale. Any use at any time before the sale end can join - * the sale by sending `token_in` to the Sale through the Subscribe msg. - * During the sale, user `token_in` will be automatically charged every - * epoch to purchase `token_out`. - */ - Subscribe(request: MsgSubscribe): Promise; - - /** - * Withdraw sends back `amount` of unspent tokens_in to the user. - * If `amount` is empty, it will default to all unspent tokens. - * User can do it any time unless his deposit is empty. - */ - Withdraw(request: MsgWithdraw): Promise; - - /** - * ExitSale withdraws (by a user who subscribed to the sale) purchased - * tokens_out from the pool and remained tokens_in. Must be called before - * the sale end. - */ - ExitSale(request: MsgExitSale): Promise; - - /** - * FinalizeSale clean ups the sale and sends income (earned tokens_in) to the - * Sale recipient. Returns error if called before the Sale end. Anyone can - * call this method. - */ - FinalizeSale(request: MsgFinalizeSale): Promise; -} -export class MsgClientImpl implements Msg { - private readonly rpc: Rpc; - - constructor(rpc: Rpc) { - this.rpc = rpc; - this.CreateSale = this.CreateSale.bind(this); - this.Subscribe = this.Subscribe.bind(this); - this.Withdraw = this.Withdraw.bind(this); - this.ExitSale = this.ExitSale.bind(this); - this.FinalizeSale = this.FinalizeSale.bind(this); - } - - CreateSale(request: MsgCreateSale): Promise { - const data = MsgCreateSale.encode(request).finish(); - const promise = this.rpc.request("osmosis.streamswap.v1.Msg", "CreateSale", data); - return promise.then(data => MsgCreateSaleResponse.decode(new _m0.Reader(data))); - } - - Subscribe(request: MsgSubscribe): Promise { - const data = MsgSubscribe.encode(request).finish(); - const promise = this.rpc.request("osmosis.streamswap.v1.Msg", "Subscribe", data); - return promise.then(data => Empty.decode(new _m0.Reader(data))); - } - - Withdraw(request: MsgWithdraw): Promise { - const data = MsgWithdraw.encode(request).finish(); - const promise = this.rpc.request("osmosis.streamswap.v1.Msg", "Withdraw", data); - return promise.then(data => Empty.decode(new _m0.Reader(data))); - } - - ExitSale(request: MsgExitSale): Promise { - const data = MsgExitSale.encode(request).finish(); - const promise = this.rpc.request("osmosis.streamswap.v1.Msg", "ExitSale", data); - return promise.then(data => MsgExitSaleResponse.decode(new _m0.Reader(data))); - } - - FinalizeSale(request: MsgFinalizeSale): Promise { - const data = MsgFinalizeSale.encode(request).finish(); - const promise = this.rpc.request("osmosis.streamswap.v1.Msg", "FinalizeSale", data); - return promise.then(data => MsgFinalizeSaleResponse.decode(new _m0.Reader(data))); - } - -} \ No newline at end of file diff --git a/__fixtures__/output2/osmosis/store/v1beta1/tree.ts b/__fixtures__/output2/osmosis/sumtree/v1beta1/tree.ts similarity index 100% rename from __fixtures__/output2/osmosis/store/v1beta1/tree.ts rename to __fixtures__/output2/osmosis/sumtree/v1beta1/tree.ts diff --git a/__fixtures__/output2/osmosis/superfluid/query.ts b/__fixtures__/output2/osmosis/superfluid/query.ts index aeb2b4b4f5..e7f4cb63ad 100644 --- a/__fixtures__/output2/osmosis/superfluid/query.ts +++ b/__fixtures__/output2/osmosis/superfluid/query.ts @@ -49,6 +49,17 @@ export interface ConnectedIntermediaryAccountRequest { export interface ConnectedIntermediaryAccountResponse { account?: SuperfluidIntermediaryAccountInfo; } +export interface QueryTotalDelegationByValidatorForDenomRequest { + denom: string; +} +export interface QueryTotalDelegationByValidatorForDenomResponse { + assets: Delegations[]; +} +export interface Delegations { + valAddr: string; + amountSfsd: string; + osmoEquivalent: string; +} export interface TotalSuperfluidDelegationsRequest {} export interface TotalSuperfluidDelegationsResponse { totalDelegations: string; @@ -101,6 +112,10 @@ export interface QueryTotalDelegationByDelegatorResponse { totalDelegatedCoins: Coin[]; totalEquivalentStakedAmount?: Coin; } +export interface QueryUnpoolWhitelistRequest {} +export interface QueryUnpoolWhitelistResponse { + poolIds: Long[]; +} function createBaseQueryParamsRequest(): QueryParamsRequest { return {}; @@ -875,6 +890,207 @@ export const ConnectedIntermediaryAccountResponse = { }; +function createBaseQueryTotalDelegationByValidatorForDenomRequest(): QueryTotalDelegationByValidatorForDenomRequest { + return { + denom: "" + }; +} + +export const QueryTotalDelegationByValidatorForDenomRequest = { + encode(message: QueryTotalDelegationByValidatorForDenomRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryTotalDelegationByValidatorForDenomRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTotalDelegationByValidatorForDenomRequest(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): QueryTotalDelegationByValidatorForDenomRequest { + return { + denom: isSet(object.denom) ? String(object.denom) : "" + }; + }, + + toJSON(message: QueryTotalDelegationByValidatorForDenomRequest): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + return obj; + }, + + fromPartial(object: DeepPartial): QueryTotalDelegationByValidatorForDenomRequest { + const message = createBaseQueryTotalDelegationByValidatorForDenomRequest(); + message.denom = object.denom ?? ""; + return message; + } + +}; + +function createBaseQueryTotalDelegationByValidatorForDenomResponse(): QueryTotalDelegationByValidatorForDenomResponse { + return { + assets: [] + }; +} + +export const QueryTotalDelegationByValidatorForDenomResponse = { + encode(message: QueryTotalDelegationByValidatorForDenomResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.assets) { + Delegations.encode(v!, writer.uint32(10).fork()).ldelim(); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryTotalDelegationByValidatorForDenomResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryTotalDelegationByValidatorForDenomResponse(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.assets.push(Delegations.decode(reader, reader.uint32())); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): QueryTotalDelegationByValidatorForDenomResponse { + return { + assets: Array.isArray(object?.assets) ? object.assets.map((e: any) => Delegations.fromJSON(e)) : [] + }; + }, + + toJSON(message: QueryTotalDelegationByValidatorForDenomResponse): unknown { + const obj: any = {}; + + if (message.assets) { + obj.assets = message.assets.map(e => e ? Delegations.toJSON(e) : undefined); + } else { + obj.assets = []; + } + + return obj; + }, + + fromPartial(object: DeepPartial): QueryTotalDelegationByValidatorForDenomResponse { + const message = createBaseQueryTotalDelegationByValidatorForDenomResponse(); + message.assets = object.assets?.map(e => Delegations.fromPartial(e)) || []; + return message; + } + +}; + +function createBaseDelegations(): Delegations { + return { + valAddr: "", + amountSfsd: "", + osmoEquivalent: "" + }; +} + +export const Delegations = { + encode(message: Delegations, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.valAddr !== "") { + writer.uint32(10).string(message.valAddr); + } + + if (message.amountSfsd !== "") { + writer.uint32(18).string(message.amountSfsd); + } + + if (message.osmoEquivalent !== "") { + writer.uint32(26).string(message.osmoEquivalent); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Delegations { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDelegations(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.valAddr = reader.string(); + break; + + case 2: + message.amountSfsd = reader.string(); + break; + + case 3: + message.osmoEquivalent = reader.string(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): Delegations { + return { + valAddr: isSet(object.valAddr) ? String(object.valAddr) : "", + amountSfsd: isSet(object.amountSfsd) ? String(object.amountSfsd) : "", + osmoEquivalent: isSet(object.osmoEquivalent) ? String(object.osmoEquivalent) : "" + }; + }, + + toJSON(message: Delegations): unknown { + const obj: any = {}; + message.valAddr !== undefined && (obj.valAddr = message.valAddr); + message.amountSfsd !== undefined && (obj.amountSfsd = message.amountSfsd); + message.osmoEquivalent !== undefined && (obj.osmoEquivalent = message.osmoEquivalent); + return obj; + }, + + fromPartial(object: DeepPartial): Delegations { + const message = createBaseDelegations(); + message.valAddr = object.valAddr ?? ""; + message.amountSfsd = object.amountSfsd ?? ""; + message.osmoEquivalent = object.osmoEquivalent ?? ""; + return message; + } + +}; + function createBaseTotalSuperfluidDelegationsRequest(): TotalSuperfluidDelegationsRequest { return {}; } @@ -1864,6 +2080,124 @@ export const QueryTotalDelegationByDelegatorResponse = { }; +function createBaseQueryUnpoolWhitelistRequest(): QueryUnpoolWhitelistRequest { + return {}; +} + +export const QueryUnpoolWhitelistRequest = { + encode(_: QueryUnpoolWhitelistRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryUnpoolWhitelistRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUnpoolWhitelistRequest(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(_: any): QueryUnpoolWhitelistRequest { + return {}; + }, + + toJSON(_: QueryUnpoolWhitelistRequest): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): QueryUnpoolWhitelistRequest { + const message = createBaseQueryUnpoolWhitelistRequest(); + return message; + } + +}; + +function createBaseQueryUnpoolWhitelistResponse(): QueryUnpoolWhitelistResponse { + return { + poolIds: [] + }; +} + +export const QueryUnpoolWhitelistResponse = { + encode(message: QueryUnpoolWhitelistResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + writer.uint32(10).fork(); + + for (const v of message.poolIds) { + writer.uint64(v); + } + + writer.ldelim(); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryUnpoolWhitelistResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryUnpoolWhitelistResponse(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + + while (reader.pos < end2) { + message.poolIds.push((reader.uint64() as Long)); + } + } else { + message.poolIds.push((reader.uint64() as Long)); + } + + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): QueryUnpoolWhitelistResponse { + return { + poolIds: Array.isArray(object?.poolIds) ? object.poolIds.map((e: any) => Long.fromValue(e)) : [] + }; + }, + + toJSON(message: QueryUnpoolWhitelistResponse): unknown { + const obj: any = {}; + + if (message.poolIds) { + obj.poolIds = message.poolIds.map(e => (e || Long.UZERO).toString()); + } else { + obj.poolIds = []; + } + + return obj; + }, + + fromPartial(object: DeepPartial): QueryUnpoolWhitelistResponse { + const message = createBaseQueryUnpoolWhitelistResponse(); + message.poolIds = object.poolIds?.map(e => Long.fromValue(e)) || []; + return message; + } + +}; + /** Query defines the gRPC querier service. */ export interface Query { /** Params returns the total set of superfluid parameters. */ @@ -1887,6 +2221,9 @@ export interface Query { /** Returns intermediary account connected to a superfluid staked lock by id */ ConnectedIntermediaryAccount(request: ConnectedIntermediaryAccountRequest): Promise; + /** Returns the amount of delegations of specific denom for all validators */ + TotalDelegationByValidatorForDenom(request: QueryTotalDelegationByValidatorForDenomRequest): Promise; + /** * Returns the total amount of osmo superfluidly staked. * Response is denominated in uosmo. @@ -1920,6 +2257,9 @@ export interface Query { /** Returns the specified delegations for a specific delegator */ TotalDelegationByDelegator(request: QueryTotalDelegationByDelegatorRequest): Promise; + + /** Returns a list of whitelisted pool ids to unpool. */ + UnpoolWhitelist(request?: QueryUnpoolWhitelistRequest): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; @@ -1932,6 +2272,7 @@ export class QueryClientImpl implements Query { this.AssetMultiplier = this.AssetMultiplier.bind(this); this.AllIntermediaryAccounts = this.AllIntermediaryAccounts.bind(this); this.ConnectedIntermediaryAccount = this.ConnectedIntermediaryAccount.bind(this); + this.TotalDelegationByValidatorForDenom = this.TotalDelegationByValidatorForDenom.bind(this); this.TotalSuperfluidDelegations = this.TotalSuperfluidDelegations.bind(this); this.SuperfluidDelegationAmount = this.SuperfluidDelegationAmount.bind(this); this.SuperfluidDelegationsByDelegator = this.SuperfluidDelegationsByDelegator.bind(this); @@ -1939,6 +2280,7 @@ export class QueryClientImpl implements Query { this.SuperfluidDelegationsByValidatorDenom = this.SuperfluidDelegationsByValidatorDenom.bind(this); this.EstimateSuperfluidDelegatedAmountByValidatorDenom = this.EstimateSuperfluidDelegatedAmountByValidatorDenom.bind(this); this.TotalDelegationByDelegator = this.TotalDelegationByDelegator.bind(this); + this.UnpoolWhitelist = this.UnpoolWhitelist.bind(this); } Params(request: QueryParamsRequest = {}): Promise { @@ -1979,6 +2321,12 @@ export class QueryClientImpl implements Query { return promise.then(data => ConnectedIntermediaryAccountResponse.decode(new _m0.Reader(data))); } + TotalDelegationByValidatorForDenom(request: QueryTotalDelegationByValidatorForDenomRequest): Promise { + const data = QueryTotalDelegationByValidatorForDenomRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.superfluid.Query", "TotalDelegationByValidatorForDenom", data); + return promise.then(data => QueryTotalDelegationByValidatorForDenomResponse.decode(new _m0.Reader(data))); + } + TotalSuperfluidDelegations(request: TotalSuperfluidDelegationsRequest = {}): Promise { const data = TotalSuperfluidDelegationsRequest.encode(request).finish(); const promise = this.rpc.request("osmosis.superfluid.Query", "TotalSuperfluidDelegations", data); @@ -2021,4 +2369,10 @@ export class QueryClientImpl implements Query { return promise.then(data => QueryTotalDelegationByDelegatorResponse.decode(new _m0.Reader(data))); } + UnpoolWhitelist(request: QueryUnpoolWhitelistRequest = {}): Promise { + const data = QueryUnpoolWhitelistRequest.encode(request).finish(); + const promise = this.rpc.request("osmosis.superfluid.Query", "UnpoolWhitelist", data); + return promise.then(data => QueryUnpoolWhitelistResponse.decode(new _m0.Reader(data))); + } + } \ No newline at end of file diff --git a/__fixtures__/output2/osmosis/superfluid/v1beta1/gov.ts b/__fixtures__/output2/osmosis/superfluid/v1beta1/gov.ts index 81cc7ad7fd..f225f21684 100644 --- a/__fixtures__/output2/osmosis/superfluid/v1beta1/gov.ts +++ b/__fixtures__/output2/osmosis/superfluid/v1beta1/gov.ts @@ -2,7 +2,7 @@ /* eslint-disable */ import { SuperfluidAsset } from "../superfluid"; import * as _m0 from "protobufjs/minimal"; -import { isSet, DeepPartial } from "../../../helpers"; +import { isSet, DeepPartial, Long } from "../../../helpers"; export const protobufPackage = "osmosis.superfluid.v1beta1"; /** @@ -25,6 +25,17 @@ export interface RemoveSuperfluidAssetsProposal { superfluidAssetDenoms: string[]; } +/** + * UpdateUnpoolWhiteListProposal is a gov Content type to update the + * allowed list of pool ids. + */ +export interface UpdateUnpoolWhiteListProposal { + title: string; + description: string; + ids: Long[]; + isOverwrite: boolean; +} + function createBaseSetSuperfluidAssetsProposal(): SetSuperfluidAssetsProposal { return { title: "", @@ -197,4 +208,116 @@ export const RemoveSuperfluidAssetsProposal = { return message; } +}; + +function createBaseUpdateUnpoolWhiteListProposal(): UpdateUnpoolWhiteListProposal { + return { + title: "", + description: "", + ids: [], + isOverwrite: false + }; +} + +export const UpdateUnpoolWhiteListProposal = { + encode(message: UpdateUnpoolWhiteListProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + + writer.uint32(26).fork(); + + for (const v of message.ids) { + writer.uint64(v); + } + + writer.ldelim(); + + if (message.isOverwrite === true) { + writer.uint32(32).bool(message.isOverwrite); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UpdateUnpoolWhiteListProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateUnpoolWhiteListProposal(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + + case 2: + message.description = reader.string(); + break; + + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + + while (reader.pos < end2) { + message.ids.push((reader.uint64() as Long)); + } + } else { + message.ids.push((reader.uint64() as Long)); + } + + break; + + case 4: + message.isOverwrite = reader.bool(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): UpdateUnpoolWhiteListProposal { + return { + title: isSet(object.title) ? String(object.title) : "", + description: isSet(object.description) ? String(object.description) : "", + ids: Array.isArray(object?.ids) ? object.ids.map((e: any) => Long.fromValue(e)) : [], + isOverwrite: isSet(object.isOverwrite) ? Boolean(object.isOverwrite) : false + }; + }, + + toJSON(message: UpdateUnpoolWhiteListProposal): unknown { + const obj: any = {}; + message.title !== undefined && (obj.title = message.title); + message.description !== undefined && (obj.description = message.description); + + if (message.ids) { + obj.ids = message.ids.map(e => (e || Long.UZERO).toString()); + } else { + obj.ids = []; + } + + message.isOverwrite !== undefined && (obj.isOverwrite = message.isOverwrite); + return obj; + }, + + fromPartial(object: DeepPartial): UpdateUnpoolWhiteListProposal { + const message = createBaseUpdateUnpoolWhiteListProposal(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.ids = object.ids?.map(e => Long.fromValue(e)) || []; + message.isOverwrite = object.isOverwrite ?? false; + return message; + } + }; \ No newline at end of file diff --git a/packages/ast/CHANGELOG.md b/packages/ast/CHANGELOG.md index 18f73e858f..5e26a445df 100644 --- a/packages/ast/CHANGELOG.md +++ b/packages/ast/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.69.0](https://github.com/osmosis-labs/telescope/compare/@osmonauts/ast@0.80.0-rc.1...@osmonauts/ast@0.69.0) (2022-12-18) + + +### Reverts + +* Revert "RC versions ready" ([04081a9](https://github.com/osmosis-labs/telescope/commit/04081a9d1f80feb3ae664bce2d1364850b3daaca)) +* Revert "chore(release): publish" ([086a55f](https://github.com/osmosis-labs/telescope/commit/086a55f14c5ca33ee70a0e2121406dd37eb643f1)) + + + + + # [0.68.0](https://github.com/osmosis-labs/telescope/compare/@osmonauts/ast@0.67.0...@osmonauts/ast@0.68.0) (2022-11-25) **Note:** Version bump only for package @osmonauts/ast diff --git a/packages/ast/package.json b/packages/ast/package.json index fc749e41eb..07363756e8 100644 --- a/packages/ast/package.json +++ b/packages/ast/package.json @@ -1,6 +1,6 @@ { "name": "@osmonauts/ast", - "version": "0.68.0", + "version": "0.69.0", "description": "Cosmos TypeScript AST generation", "author": "Dan Lynch ", "homepage": "https://github.com/osmosis-labs/telescope/tree/master/packages/ast#readme", @@ -86,9 +86,9 @@ "@babel/parser": "^7.19.3", "@babel/runtime": "^7.19.0", "@babel/types": "7.19.3", - "@osmonauts/proto-parser": "^0.34.0", - "@osmonauts/types": "^0.26.0", - "@osmonauts/utils": "^0.8.0", + "@osmonauts/proto-parser": "^0.35.0", + "@osmonauts/types": "^0.27.0", + "@osmonauts/utils": "^0.9.0", "case": "1.6.3", "dotty": "0.1.2" } diff --git a/packages/ast/src/clients/lcd/aggregated/__snapshots__/aggregated.test.ts.snap b/packages/ast/src/clients/lcd/aggregated/__snapshots__/aggregated.test.ts.snap index 358b4b539a..493bb845aa 100644 --- a/packages/ast/src/clients/lcd/aggregated/__snapshots__/aggregated.test.ts.snap +++ b/packages/ast/src/clients/lcd/aggregated/__snapshots__/aggregated.test.ts.snap @@ -157,6 +157,29 @@ exports[`AggregatedLCDClient 1`] = ` return await this.req.get(endpoint); } + /* PoolsWithFilter allows you to query specific pools with requested + parameters */ + async poolsWithFilter(params: QueryPoolsWithFilterRequest): Promise { + const options: any = { + params: {} + }; + + if (typeof params?.minLiquidity !== "undefined") { + options.params.min_liquidity = params.minLiquidity; + } + + if (typeof params?.poolType !== "undefined") { + options.params.pool_type = params.poolType; + } + + if (typeof params?.pagination !== "undefined") { + setPaginationParams(options, params.pagination); + } + + const endpoint = \`osmosis/gamm/v1beta1/filtered_pools\`; + return await this.req.get(endpoint, options); + } + /* Per Pool gRPC Endpoints */ async pool(params: QueryPoolRequest): Promise { const endpoint = \`osmosis/gamm/v1beta1/pools/\${params.poolId}\`; @@ -171,6 +194,34 @@ exports[`AggregatedLCDClient 1`] = ` return await this.req.get(endpoint); } + /* CalcJoinPoolShares */ + async calcJoinPoolShares(params: QueryCalcJoinPoolSharesRequest): Promise { + const options: any = { + params: {} + }; + + if (typeof params?.tokensIn !== "undefined") { + options.params.tokens_in = params.tokensIn; + } + + const endpoint = \`osmosis/gamm/v1beta1/pools/\${params.poolId}/join_swap_exact_in\`; + return await this.req.get(endpoint, options); + } + + /* CalcExitPoolCoinsFromShares */ + async calcExitPoolCoinsFromShares(params: QueryCalcExitPoolCoinsFromSharesRequest): Promise { + const options: any = { + params: {} + }; + + if (typeof params?.shareInAmount !== "undefined") { + options.params.share_in_amount = params.shareInAmount; + } + + const endpoint = \`osmosis/gamm/v1beta1/pools/\${params.poolId}/exit_swap_share_amount_in\`; + return await this.req.get(endpoint, options); + } + /* PoolParams */ async poolParams(params: QueryPoolParamsRequest): Promise { const endpoint = \`osmosis/gamm/v1beta1/pools/\${params.poolId}/params\`; @@ -412,6 +463,29 @@ exports[`options 1`] = ` return await this.req.get(endpoint); } + /* PoolsWithFilter allows you to query specific pools with requested + parameters */ + async poolsWithFilter(params: QueryPoolsWithFilterRequest): Promise { + const options: any = { + params: {} + }; + + if (typeof params?.minLiquidity !== "undefined") { + options.params.min_liquidity = params.minLiquidity; + } + + if (typeof params?.poolType !== "undefined") { + options.params.pool_type = params.poolType; + } + + if (typeof params?.pagination !== "undefined") { + setPaginationParams(options, params.pagination); + } + + const endpoint = \`osmosis/gamm/v1beta1/filtered_pools\`; + return await this.req.get(endpoint, options); + } + /* Per Pool gRPC Endpoints */ async pool(params: QueryPoolRequest): Promise { const endpoint = \`osmosis/gamm/v1beta1/pools/\${params.poolId}\`; @@ -426,6 +500,34 @@ exports[`options 1`] = ` return await this.req.get(endpoint); } + /* CalcJoinPoolShares */ + async calcJoinPoolShares(params: QueryCalcJoinPoolSharesRequest): Promise { + const options: any = { + params: {} + }; + + if (typeof params?.tokensIn !== "undefined") { + options.params.tokens_in = params.tokensIn; + } + + const endpoint = \`osmosis/gamm/v1beta1/pools/\${params.poolId}/join_swap_exact_in\`; + return await this.req.get(endpoint, options); + } + + /* CalcExitPoolCoinsFromShares */ + async calcExitPoolCoinsFromShares(params: QueryCalcExitPoolCoinsFromSharesRequest): Promise { + const options: any = { + params: {} + }; + + if (typeof params?.shareInAmount !== "undefined") { + options.params.share_in_amount = params.shareInAmount; + } + + const endpoint = \`osmosis/gamm/v1beta1/pools/\${params.poolId}/exit_swap_share_amount_in\`; + return await this.req.get(endpoint, options); + } + /* PoolParams */ async poolParams(params: QueryPoolParamsRequest): Promise { const endpoint = \`osmosis/gamm/v1beta1/pools/\${params.poolId}/params\`; diff --git a/packages/ast/src/clients/lcd/class/__snapshots__/lcd.test.ts.snap b/packages/ast/src/clients/lcd/class/__snapshots__/lcd.test.ts.snap index 76821848b3..611409d356 100644 --- a/packages/ast/src/clients/lcd/class/__snapshots__/lcd.test.ts.snap +++ b/packages/ast/src/clients/lcd/class/__snapshots__/lcd.test.ts.snap @@ -671,8 +671,11 @@ exports[`osmosis LCDClient 1`] = ` this.pools = this.pools.bind(this); this.numPools = this.numPools.bind(this); this.totalLiquidity = this.totalLiquidity.bind(this); + this.poolsWithFilter = this.poolsWithFilter.bind(this); this.pool = this.pool.bind(this); this.poolType = this.poolType.bind(this); + this.calcJoinPoolShares = this.calcJoinPoolShares.bind(this); + this.calcExitPoolCoinsFromShares = this.calcExitPoolCoinsFromShares.bind(this); this.poolParams = this.poolParams.bind(this); this.totalPoolLiquidity = this.totalPoolLiquidity.bind(this); this.totalShares = this.totalShares.bind(this); @@ -709,6 +712,29 @@ exports[`osmosis LCDClient 1`] = ` return await this.req.get(endpoint); } + /* PoolsWithFilter allows you to query specific pools with requested + parameters */ + async poolsWithFilter(params: QueryPoolsWithFilterRequest): Promise { + const options: any = { + params: {} + }; + + if (typeof params?.minLiquidity !== "undefined") { + options.params.min_liquidity = params.minLiquidity; + } + + if (typeof params?.poolType !== "undefined") { + options.params.pool_type = params.poolType; + } + + if (typeof params?.pagination !== "undefined") { + setPaginationParams(options, params.pagination); + } + + const endpoint = \`osmosis/gamm/v1beta1/filtered_pools\`; + return await this.req.get(endpoint, options); + } + /* Per Pool gRPC Endpoints */ async pool(params: QueryPoolRequest): Promise { const endpoint = \`osmosis/gamm/v1beta1/pools/\${params.poolId}\`; @@ -723,6 +749,34 @@ exports[`osmosis LCDClient 1`] = ` return await this.req.get(endpoint); } + /* CalcJoinPoolShares */ + async calcJoinPoolShares(params: QueryCalcJoinPoolSharesRequest): Promise { + const options: any = { + params: {} + }; + + if (typeof params?.tokensIn !== "undefined") { + options.params.tokens_in = params.tokensIn; + } + + const endpoint = \`osmosis/gamm/v1beta1/pools/\${params.poolId}/join_swap_exact_in\`; + return await this.req.get(endpoint, options); + } + + /* CalcExitPoolCoinsFromShares */ + async calcExitPoolCoinsFromShares(params: QueryCalcExitPoolCoinsFromSharesRequest): Promise { + const options: any = { + params: {} + }; + + if (typeof params?.shareInAmount !== "undefined") { + options.params.share_in_amount = params.shareInAmount; + } + + const endpoint = \`osmosis/gamm/v1beta1/pools/\${params.poolId}/exit_swap_share_amount_in\`; + return await this.req.get(endpoint, options); + } + /* PoolParams */ async poolParams(params: QueryPoolParamsRequest): Promise { const endpoint = \`osmosis/gamm/v1beta1/pools/\${params.poolId}/params\`; diff --git a/packages/ast/src/clients/lcd/class/lcd.ts b/packages/ast/src/clients/lcd/class/lcd.ts index 1571bd86d6..e42006791a 100644 --- a/packages/ast/src/clients/lcd/class/lcd.ts +++ b/packages/ast/src/clients/lcd/class/lcd.ts @@ -591,8 +591,12 @@ export const createAggregatedLCDClient = ( const methods = services.reduce((m, service) => { const innerMethods = Object.keys(service.methods).map(key => { const method: ProtoServiceMethod = service.methods[key]; - return buildRequestMethod(context, method); - }); + if (method.info && + (typeof method.options?.['(google.api.http).get'] !== 'undefined') + ) { + return buildRequestMethod(context, method); + } + }).filter(Boolean); return [...m, ...innerMethods]; }, []); return createLCDClientClassBody(context, clientName, methods); diff --git a/packages/ast/src/docs/__snapshots__/docs.test.ts.snap b/packages/ast/src/docs/__snapshots__/docs.test.ts.snap index 2f61aebf87..0de22ab5fa 100644 --- a/packages/ast/src/docs/__snapshots__/docs.test.ts.snap +++ b/packages/ast/src/docs/__snapshots__/docs.test.ts.snap @@ -342,6 +342,13 @@ const result = await osmosis.gamm.v1beta1.numPools(request); const request: QueryTotalLiquidityRequest; const result = await osmosis.gamm.v1beta1.totalLiquidity(request); +/** + * PoolsWithFilter allows you to query specific pools with requested + * parameters + */ +const request: QueryPoolsWithFilterRequest; +const result = await osmosis.gamm.v1beta1.poolsWithFilter(request); + /** Per Pool gRPC Endpoints */ const request: QueryPoolRequest; const result = await osmosis.gamm.v1beta1.pool(request); @@ -354,6 +361,21 @@ const result = await osmosis.gamm.v1beta1.pool(request); const request: QueryPoolTypeRequest; const result = await osmosis.gamm.v1beta1.poolType(request); +/** + * Simulates joining pool without a swap. Returns the amount of shares you'd + * get and tokens needed to provide + */ +const request: QueryCalcJoinPoolNoSwapSharesRequest; +const result = await osmosis.gamm.v1beta1.calcJoinPoolNoSwapShares(request); + +/** CalcJoinPoolShares */ +const request: QueryCalcJoinPoolSharesRequest; +const result = await osmosis.gamm.v1beta1.calcJoinPoolShares(request); + +/** CalcExitPoolCoinsFromShares */ +const request: QueryCalcExitPoolCoinsFromSharesRequest; +const result = await osmosis.gamm.v1beta1.calcExitPoolCoinsFromShares(request); + /** PoolParams */ const request: QueryPoolParamsRequest; const result = await osmosis.gamm.v1beta1.poolParams(request); @@ -381,16 +403,23 @@ const result = await osmosis.gamm.v1beta1.estimateSwapExactAmountIn(request); const request: QuerySwapExactAmountOutRequest; const result = await osmosis.gamm.v1beta1.estimateSwapExactAmountOut(request); -/** ModuleToDistributeCoins returns coins that are going to be distributed */ -const request: ModuleToDistributeCoinsRequest; -const result = await osmosis.incentives.moduleToDistributeCoins(request); +/** + * SpotPrice defines a gRPC query handler that returns the spot price given + * a base denomination and a quote denomination. + */ +const request: QuerySpotPriceRequest; +const result = await osmosis.gamm.v2.spotPrice(request); /** - * ModuleDistributedCoins returns coins that are distributed by the module so - * far + * Params defines a gRPC query method that returns the ibc-rate-limit module's + * parameters. */ -const request: ModuleDistributedCoinsRequest; -const result = await osmosis.incentives.moduleDistributedCoins(request); +const request: QueryParamsRequest; +const result = await osmosis.ibcratelimit.v1beta1.params(request); + +/** ModuleToDistributeCoins returns coins that are going to be distributed */ +const request: ModuleToDistributeCoinsRequest; +const result = await osmosis.incentives.moduleToDistributeCoins(request); /** GaugeByID returns gauges by their respective ID */ const request: GaugeByIDRequest; @@ -504,6 +533,10 @@ const result = await osmosis.lockup.accountLockedLongerDurationNotUnlockingOnly( const request: AccountLockedLongerDurationDenomRequest; const result = await osmosis.lockup.accountLockedLongerDurationDenom(request); +/** Params returns lockup params. */ +const request: QueryParamsRequest; +const result = await osmosis.lockup.params(request); + /** Params returns the total set of minting parameters. */ const request: QueryParamsRequest; const result = await osmosis.mint.v1beta1.params(request); @@ -536,18 +569,6 @@ const result = await osmosis.poolincentives.v1beta1.incentivizedPools(request); const request: QueryExternalIncentiveGaugesRequest; const result = await osmosis.poolincentives.v1beta1.externalIncentiveGauges(request); -/** Returns list of Sales ordered by the creation time */ -const request: QuerySales; -const result = await osmosis.streamswap.v1.sales(request); - -/** Returns the specific Sale object */ -const request: QuerySale; -const result = await osmosis.streamswap.v1.sale(request); - -/** UserPosition */ -const request: QueryUserPosition; -const result = await osmosis.streamswap.v1.userPosition(request); - /** Params returns the total set of superfluid parameters. */ const request: QueryParamsRequest; const result = await osmosis.superfluid.params(request); @@ -575,6 +596,10 @@ const result = await osmosis.superfluid.allIntermediaryAccounts(request); const request: ConnectedIntermediaryAccountRequest; const result = await osmosis.superfluid.connectedIntermediaryAccount(request); +/** Returns the amount of delegations of specific denom for all validators */ +const request: QueryTotalDelegationByValidatorForDenomRequest; +const result = await osmosis.superfluid.totalDelegationByValidatorForDenom(request); + /** * Returns the total amount of osmo superfluidly staked. * Response is denominated in uosmo. @@ -616,6 +641,10 @@ const result = await osmosis.superfluid.estimateSuperfluidDelegatedAmountByValid const request: QueryTotalDelegationByDelegatorRequest; const result = await osmosis.superfluid.totalDelegationByDelegator(request); +/** Returns a list of whitelisted pool ids to unpool. */ +const request: QueryUnpoolWhitelistRequest; +const result = await osmosis.superfluid.unpoolWhitelist(request); + /** * Params defines a gRPC query method that returns the tokenfactory module's * parameters. @@ -684,16 +713,21 @@ exports[`documentRpcClientsReadme 1`] = ` [\`osmosis.gamm.v1beta1.pools()\` RPC](#osmosisgammv1beta1pools-rpc) [\`osmosis.gamm.v1beta1.numPools()\` RPC](#osmosisgammv1beta1numpools-rpc) [\`osmosis.gamm.v1beta1.totalLiquidity()\` RPC](#osmosisgammv1beta1totalliquidity-rpc) +[\`osmosis.gamm.v1beta1.poolsWithFilter()\` RPC](#osmosisgammv1beta1poolswithfilter-rpc) [\`osmosis.gamm.v1beta1.pool()\` RPC](#osmosisgammv1beta1pool-rpc) [\`osmosis.gamm.v1beta1.poolType()\` RPC](#osmosisgammv1beta1pooltype-rpc) +[\`osmosis.gamm.v1beta1.calcJoinPoolNoSwapShares()\` RPC](#osmosisgammv1beta1calcjoinpoolnoswapshares-rpc) +[\`osmosis.gamm.v1beta1.calcJoinPoolShares()\` RPC](#osmosisgammv1beta1calcjoinpoolshares-rpc) +[\`osmosis.gamm.v1beta1.calcExitPoolCoinsFromShares()\` RPC](#osmosisgammv1beta1calcexitpoolcoinsfromshares-rpc) [\`osmosis.gamm.v1beta1.poolParams()\` RPC](#osmosisgammv1beta1poolparams-rpc) [\`osmosis.gamm.v1beta1.totalPoolLiquidity()\` RPC](#osmosisgammv1beta1totalpoolliquidity-rpc) [\`osmosis.gamm.v1beta1.totalShares()\` RPC](#osmosisgammv1beta1totalshares-rpc) [\`osmosis.gamm.v1beta1.spotPrice()\` RPC](#osmosisgammv1beta1spotprice-rpc) [\`osmosis.gamm.v1beta1.estimateSwapExactAmountIn()\` RPC](#osmosisgammv1beta1estimateswapexactamountin-rpc) [\`osmosis.gamm.v1beta1.estimateSwapExactAmountOut()\` RPC](#osmosisgammv1beta1estimateswapexactamountout-rpc) +[\`osmosis.gamm.v2.spotPrice()\` RPC](#osmosisgammv2spotprice-rpc) +[\`osmosis.ibcratelimit.v1beta1.params()\` RPC](#osmosisibcratelimitv1beta1params-rpc) [\`osmosis.incentives.moduleToDistributeCoins()\` RPC](#osmosisincentivesmoduletodistributecoins-rpc) -[\`osmosis.incentives.moduleDistributedCoins()\` RPC](#osmosisincentivesmoduledistributedcoins-rpc) [\`osmosis.incentives.gaugeByID()\` RPC](#osmosisincentivesgaugebyid-rpc) [\`osmosis.incentives.gauges()\` RPC](#osmosisincentivesgauges-rpc) [\`osmosis.incentives.activeGauges()\` RPC](#osmosisincentivesactivegauges-rpc) @@ -718,6 +752,7 @@ exports[`documentRpcClientsReadme 1`] = ` [\`osmosis.lockup.accountLockedDuration()\` RPC](#osmosislockupaccountlockedduration-rpc) [\`osmosis.lockup.accountLockedLongerDurationNotUnlockingOnly()\` RPC](#osmosislockupaccountlockedlongerdurationnotunlockingonly-rpc) [\`osmosis.lockup.accountLockedLongerDurationDenom()\` RPC](#osmosislockupaccountlockedlongerdurationdenom-rpc) +[\`osmosis.lockup.params()\` RPC](#osmosislockupparams-rpc) [\`osmosis.mint.v1beta1.params()\` RPC](#osmosismintv1beta1params-rpc) [\`osmosis.mint.v1beta1.epochProvisions()\` RPC](#osmosismintv1beta1epochprovisions-rpc) [\`osmosis.poolincentives.v1beta1.gaugeIds()\` RPC](#osmosispoolincentivesv1beta1gaugeids-rpc) @@ -726,15 +761,13 @@ exports[`documentRpcClientsReadme 1`] = ` [\`osmosis.poolincentives.v1beta1.lockableDurations()\` RPC](#osmosispoolincentivesv1beta1lockabledurations-rpc) [\`osmosis.poolincentives.v1beta1.incentivizedPools()\` RPC](#osmosispoolincentivesv1beta1incentivizedpools-rpc) [\`osmosis.poolincentives.v1beta1.externalIncentiveGauges()\` RPC](#osmosispoolincentivesv1beta1externalincentivegauges-rpc) -[\`osmosis.streamswap.v1.sales()\` RPC](#osmosisstreamswapv1sales-rpc) -[\`osmosis.streamswap.v1.sale()\` RPC](#osmosisstreamswapv1sale-rpc) -[\`osmosis.streamswap.v1.userPosition()\` RPC](#osmosisstreamswapv1userposition-rpc) [\`osmosis.superfluid.params()\` RPC](#osmosissuperfluidparams-rpc) [\`osmosis.superfluid.assetType()\` RPC](#osmosissuperfluidassettype-rpc) [\`osmosis.superfluid.allAssets()\` RPC](#osmosissuperfluidallassets-rpc) [\`osmosis.superfluid.assetMultiplier()\` RPC](#osmosissuperfluidassetmultiplier-rpc) [\`osmosis.superfluid.allIntermediaryAccounts()\` RPC](#osmosissuperfluidallintermediaryaccounts-rpc) [\`osmosis.superfluid.connectedIntermediaryAccount()\` RPC](#osmosissuperfluidconnectedintermediaryaccount-rpc) +[\`osmosis.superfluid.totalDelegationByValidatorForDenom()\` RPC](#osmosissuperfluidtotaldelegationbyvalidatorfordenom-rpc) [\`osmosis.superfluid.totalSuperfluidDelegations()\` RPC](#osmosissuperfluidtotalsuperfluiddelegations-rpc) [\`osmosis.superfluid.superfluidDelegationAmount()\` RPC](#osmosissuperfluidsuperfluiddelegationamount-rpc) [\`osmosis.superfluid.superfluidDelegationsByDelegator()\` RPC](#osmosissuperfluidsuperfluiddelegationsbydelegator-rpc) @@ -742,6 +775,7 @@ exports[`documentRpcClientsReadme 1`] = ` [\`osmosis.superfluid.superfluidDelegationsByValidatorDenom()\` RPC](#osmosissuperfluidsuperfluiddelegationsbyvalidatordenom-rpc) [\`osmosis.superfluid.estimateSuperfluidDelegatedAmountByValidatorDenom()\` RPC](#osmosissuperfluidestimatesuperfluiddelegatedamountbyvalidatordenom-rpc) [\`osmosis.superfluid.totalDelegationByDelegator()\` RPC](#osmosissuperfluidtotaldelegationbydelegator-rpc) +[\`osmosis.superfluid.unpoolWhitelist()\` RPC](#osmosissuperfluidunpoolwhitelist-rpc) [\`osmosis.tokenfactory.v1beta1.params()\` RPC](#osmosistokenfactoryv1beta1params-rpc) [\`osmosis.tokenfactory.v1beta1.denomAuthorityMetadata()\` RPC](#osmosistokenfactoryv1beta1denomauthoritymetadata-rpc) [\`osmosis.tokenfactory.v1beta1.denomsFromCreator()\` RPC](#osmosistokenfactoryv1beta1denomsfromcreator-rpc) @@ -855,6 +889,19 @@ const request: QueryTotalLiquidityRequest; const result = await osmosis.gamm.v1beta1.totalLiquidity(request); \`\`\` +##### \`osmosis.gamm.v1beta1.poolsWithFilter()\` RPC + +PoolsWithFilter + +\`\`\`js +/** + * PoolsWithFilter allows you to query specific pools with requested + * parameters + */ +const request: QueryPoolsWithFilterRequest; +const result = await osmosis.gamm.v1beta1.poolsWithFilter(request); +\`\`\` + ##### \`osmosis.gamm.v1beta1.pool()\` RPC Pool @@ -879,6 +926,39 @@ const request: QueryPoolTypeRequest; const result = await osmosis.gamm.v1beta1.poolType(request); \`\`\` +##### \`osmosis.gamm.v1beta1.calcJoinPoolNoSwapShares()\` RPC + +CalcJoinPoolNoSwapShares + +\`\`\`js +/** + * Simulates joining pool without a swap. Returns the amount of shares you'd + * get and tokens needed to provide + */ +const request: QueryCalcJoinPoolNoSwapSharesRequest; +const result = await osmosis.gamm.v1beta1.calcJoinPoolNoSwapShares(request); +\`\`\` + +##### \`osmosis.gamm.v1beta1.calcJoinPoolShares()\` RPC + +CalcJoinPoolShares + +\`\`\`js +/** CalcJoinPoolShares */ +const request: QueryCalcJoinPoolSharesRequest; +const result = await osmosis.gamm.v1beta1.calcJoinPoolShares(request); +\`\`\` + +##### \`osmosis.gamm.v1beta1.calcExitPoolCoinsFromShares()\` RPC + +CalcExitPoolCoinsFromShares + +\`\`\`js +/** CalcExitPoolCoinsFromShares */ +const request: QueryCalcExitPoolCoinsFromSharesRequest; +const result = await osmosis.gamm.v1beta1.calcExitPoolCoinsFromShares(request); +\`\`\` + ##### \`osmosis.gamm.v1beta1.poolParams()\` RPC PoolParams @@ -942,27 +1022,40 @@ const request: QuerySwapExactAmountOutRequest; const result = await osmosis.gamm.v1beta1.estimateSwapExactAmountOut(request); \`\`\` -##### \`osmosis.incentives.moduleToDistributeCoins()\` RPC +##### \`osmosis.gamm.v2.spotPrice()\` RPC -ModuleToDistributeCoins +SpotPrice \`\`\`js -/** ModuleToDistributeCoins returns coins that are going to be distributed */ -const request: ModuleToDistributeCoinsRequest; -const result = await osmosis.incentives.moduleToDistributeCoins(request); +/** + * SpotPrice defines a gRPC query handler that returns the spot price given + * a base denomination and a quote denomination. + */ +const request: QuerySpotPriceRequest; +const result = await osmosis.gamm.v2.spotPrice(request); \`\`\` -##### \`osmosis.incentives.moduleDistributedCoins()\` RPC +##### \`osmosis.ibcratelimit.v1beta1.params()\` RPC -ModuleDistributedCoins +Params \`\`\`js /** - * ModuleDistributedCoins returns coins that are distributed by the module so - * far + * Params defines a gRPC query method that returns the ibc-rate-limit module's + * parameters. */ -const request: ModuleDistributedCoinsRequest; -const result = await osmosis.incentives.moduleDistributedCoins(request); +const request: QueryParamsRequest; +const result = await osmosis.ibcratelimit.v1beta1.params(request); +\`\`\` + +##### \`osmosis.incentives.moduleToDistributeCoins()\` RPC + +ModuleToDistributeCoins + +\`\`\`js +/** ModuleToDistributeCoins returns coins that are going to be distributed */ +const request: ModuleToDistributeCoinsRequest; +const result = await osmosis.incentives.moduleToDistributeCoins(request); \`\`\` ##### \`osmosis.incentives.gaugeByID()\` RPC @@ -1221,6 +1314,16 @@ const request: AccountLockedLongerDurationDenomRequest; const result = await osmosis.lockup.accountLockedLongerDurationDenom(request); \`\`\` +##### \`osmosis.lockup.params()\` RPC + +Params + +\`\`\`js +/** Params returns lockup params. */ +const request: QueryParamsRequest; +const result = await osmosis.lockup.params(request); +\`\`\` + ##### \`osmosis.mint.v1beta1.params()\` RPC Params @@ -1301,36 +1404,6 @@ const request: QueryExternalIncentiveGaugesRequest; const result = await osmosis.poolincentives.v1beta1.externalIncentiveGauges(request); \`\`\` -##### \`osmosis.streamswap.v1.sales()\` RPC - -Sales - -\`\`\`js -/** Returns list of Sales ordered by the creation time */ -const request: QuerySales; -const result = await osmosis.streamswap.v1.sales(request); -\`\`\` - -##### \`osmosis.streamswap.v1.sale()\` RPC - -Sale - -\`\`\`js -/** Returns the specific Sale object */ -const request: QuerySale; -const result = await osmosis.streamswap.v1.sale(request); -\`\`\` - -##### \`osmosis.streamswap.v1.userPosition()\` RPC - -UserPosition - -\`\`\`js -/** UserPosition */ -const request: QueryUserPosition; -const result = await osmosis.streamswap.v1.userPosition(request); -\`\`\` - ##### \`osmosis.superfluid.params()\` RPC Params @@ -1394,6 +1467,16 @@ const request: ConnectedIntermediaryAccountRequest; const result = await osmosis.superfluid.connectedIntermediaryAccount(request); \`\`\` +##### \`osmosis.superfluid.totalDelegationByValidatorForDenom()\` RPC + +TotalDelegationByValidatorForDenom + +\`\`\`js +/** Returns the amount of delegations of specific denom for all validators */ +const request: QueryTotalDelegationByValidatorForDenomRequest; +const result = await osmosis.superfluid.totalDelegationByValidatorForDenom(request); +\`\`\` + ##### \`osmosis.superfluid.totalSuperfluidDelegations()\` RPC TotalSuperfluidDelegations @@ -1477,6 +1560,16 @@ const request: QueryTotalDelegationByDelegatorRequest; const result = await osmosis.superfluid.totalDelegationByDelegator(request); \`\`\` +##### \`osmosis.superfluid.unpoolWhitelist()\` RPC + +UnpoolWhitelist + +\`\`\`js +/** Returns a list of whitelisted pool ids to unpool. */ +const request: QueryUnpoolWhitelistRequest; +const result = await osmosis.superfluid.unpoolWhitelist(request); +\`\`\` + ##### \`osmosis.tokenfactory.v1beta1.params()\` RPC Params diff --git a/packages/ast/src/encoding/__snapshots__/object.spec.ts.snap b/packages/ast/src/encoding/__snapshots__/object.spec.ts.snap index 28a988a5ea..4f90eb0df1 100644 --- a/packages/ast/src/encoding/__snapshots__/object.spec.ts.snap +++ b/packages/ast/src/encoding/__snapshots__/object.spec.ts.snap @@ -2915,6 +2915,96 @@ exports[`ibc/core/types/v1/genesis name collisions 3`] = ` ] `; +exports[`osmosis/gamm/v1beta1/query 1`] = ` +"export const QueryPoolsResponse = { + encode(message: QueryPoolsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.pools) { + Any.encode(v!, writer.uint32(10).fork()).ldelim(); + } + + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryPoolsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPoolsResponse(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.pools.push(Any.decode(reader, reader.uint32())); + break; + + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): QueryPoolsResponse { + return { + pools: Array.isArray(object?.pools) ? object.pools.map((e: any) => Any.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined + }; + }, + + toJSON(message: QueryPoolsResponse): unknown { + const obj: any = {}; + + if (message.pools) { + obj.pools = message.pools.map(e => e ? Any.toJSON(e) : undefined); + } else { + obj.pools = []; + } + + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryPoolsResponse { + const message = createBaseQueryPoolsResponse(); + message.pools = object.pools?.map(e => Any.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + + fromSDK(object: QueryPoolsResponseSDKType): QueryPoolsResponse { + return { + pools: Array.isArray(object?.pools) ? object.pools.map((e: any) => Any.fromSDK(e)) : [], + pagination: object.pagination ? PageResponse.fromSDK(object.pagination) : undefined + }; + }, + + toSDK(message: QueryPoolsResponse): QueryPoolsResponseSDKType { + const obj: any = {}; + + if (message.pools) { + obj.pools = message.pools.map(e => e ? Any.toSDK(e) : undefined); + } else { + obj.pools = []; + } + + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toSDK(message.pagination) : undefined); + return obj; + } + +};" +`; + exports[`osmosis/gamm/v1beta1/tx MsgJoinPool 1`] = ` "export const MsgJoinPool = { encode(message: MsgJoinPool, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { diff --git a/packages/ast/src/encoding/amino/converter/index.ts b/packages/ast/src/encoding/amino/converter/index.ts index 7a2064c84c..06eda75155 100644 --- a/packages/ast/src/encoding/amino/converter/index.ts +++ b/packages/ast/src/encoding/amino/converter/index.ts @@ -2,7 +2,7 @@ import * as t from '@babel/types'; import { ProtoType, ProtoRoot } from '@osmonauts/types'; import { toAminoJsonMethod } from '../to-amino-json'; import { fromAminoJsonMethod } from '../from-amino-json'; -import { getTypeUrl, typeUrlToAmino } from '../utils'; +import { getTypeUrl, getAminoTypeName } from '../utils'; import { AminoParseContext } from '../../context'; interface AminoConverterItemParams { @@ -19,6 +19,7 @@ export const createAminoConverterItem = ( ) => { const typeUrl = getTypeUrl(root, proto); + const aminoType = getAminoTypeName(context, root, proto); const toAmino = context.options.aminoEncoding.useRecursiveV2encoding ? t.memberExpression( @@ -46,7 +47,7 @@ export const createAminoConverterItem = ( t.objectProperty( t.identifier('aminoType'), t.stringLiteral( - typeUrlToAmino(context, typeUrl) + aminoType ) ), t.objectProperty( diff --git a/packages/ast/src/encoding/amino/interface/index.ts b/packages/ast/src/encoding/amino/interface/index.ts index 8f20d38b47..50ecf138c2 100644 --- a/packages/ast/src/encoding/amino/interface/index.ts +++ b/packages/ast/src/encoding/amino/interface/index.ts @@ -1,7 +1,7 @@ import * as t from '@babel/types'; import { ProtoField, ProtoType } from '@osmonauts/types'; import { AminoParseContext } from '../../context'; -import { getTypeUrl, protoFieldsToArray, typeUrlToAmino } from '../utils'; +import { getTypeUrl, protoFieldsToArray, getAminoTypeName } from '../utils'; import { aminoInterface } from './utils'; import { getFieldOptionality, getOneOfs } from '../../proto'; @@ -115,8 +115,7 @@ export const makeAminoTypeInterface = ({ context.addUtil('AminoMsg'); const TypeName = proto.name; - const typeUrl = getTypeUrl(context.ref.proto, proto); - const aminoType = typeUrlToAmino(context, typeUrl); + const aminoType = getAminoTypeName(context, context.ref.proto, proto); const oneOfs = getOneOfs(proto); const fields = protoFieldsToArray(proto).map((field) => { diff --git a/packages/ast/src/encoding/amino/utils.ts b/packages/ast/src/encoding/amino/utils.ts index b793e6e396..97c26949d6 100644 --- a/packages/ast/src/encoding/amino/utils.ts +++ b/packages/ast/src/encoding/amino/utils.ts @@ -3,8 +3,11 @@ import { DEFAULT_AMINO_EXCEPTIONS, ProtoAny, ProtoRoot, ProtoType } from '@osmon import { kebab } from "case"; import { GenericParseContext } from '../context'; +export const getTypeUrlWithPkgAndName = (pkg: string, name: string) => { + return `/${pkg}.${name}`; +} export const getTypeUrl = (root: ProtoRoot, proto: ProtoAny | ProtoType) => { - return `/${root.package}.${proto.name}`; + return getTypeUrlWithPkgAndName(root.package, proto.name); } export const arrayTypeNDim = (body, n) => { @@ -14,10 +17,18 @@ export const arrayTypeNDim = (body, n) => { ); }; -export const typeUrlToAmino = ( +export const getAminoTypeName = ( context: GenericParseContext, - typeUrl: string + root: ProtoRoot, + proto: ProtoType ) => { + + if (proto.options?.['(amino.name)']) { + return proto.options['(amino.name)']; + } + + const typeUrl: string = getTypeUrl(root, proto); + const exceptionsToCheck = { ...(context.options.aminoEncoding.exceptions ?? {}), ...DEFAULT_AMINO_EXCEPTIONS @@ -74,6 +85,17 @@ export const typeUrlToAmino = ( return n.join('/'); } + if (/lockup/.test(typeUrl)) { + switch (typeUrl) { + case '/osmosis.lockup.MsgLockTokens': + return 'osmosis/lockup/lock-tokens'; + case '/osmosis.lockup.MsgBeginUnlockingAll': + return 'osmosis/lockup/begin-unlock-tokens'; + case '/osmosis.lockup.MsgBeginUnlocking': + return 'osmosis/lockup/begin-unlock-period-lock'; + } + } + const n = elements.filter(a => !a.match(/v1beta1/)); n[n.length - 1] = kebab(n[n.length - 1]); n[n.length - 1] = n[n.length - 1].replace(/^msg-/, ''); diff --git a/packages/ast/src/encoding/context.ts b/packages/ast/src/encoding/context.ts index 7e799fa275..65cfd6d5ea 100644 --- a/packages/ast/src/encoding/context.ts +++ b/packages/ast/src/encoding/context.ts @@ -56,61 +56,31 @@ export class GenericParseContext implements ParseContext { this.imports.push(imp) } - getTypeName(field: ProtoField) { - let name = getFieldsTypeName(field); + getTypeNameFromFieldName(name: string, importSrc: string) { let importedAs = name; const names = this.ref.traversed?.importNames; if (names - && names.hasOwnProperty(field.import) - && names[field.import].hasOwnProperty(name) + && names.hasOwnProperty(importSrc) + && names[importSrc].hasOwnProperty(name) ) { - importedAs = names[field.import][name]; + importedAs = names[importSrc][name]; } this.addImport({ type: 'typeImport', name, importedAs, - import: field.import + import: importSrc }) return importedAs; } -} - -export class AminoParseContext extends GenericParseContext implements ParseContext { - - aminoCasingFn: Function; - - constructor( - ref: ProtoRef, - store: ProtoStore, - options: TelescopeOptions - ) { - super(ref, store, options); - this.ref = ref; - this.store = store; - this.options = options; - - this.setAminoCasingFn(); - - if (!this.aminoCasingFn) { - throw new Error('missing aminoCasingFn!') - } - this.aminoCaseField = this.aminoCaseField.bind(this); - } - - private setAminoCasingFn() { - if (this.aminoCasingFn) return this.aminoCasingFn; - this.aminoCasingFn = this.pluginValue('aminoEncoding.casingFn'); - return this.aminoCasingFn; - } - - aminoCaseField(field: ProtoField) { - return field.options['(telescope:orig)']; + getTypeName(field: ProtoField) { + let name = getFieldsTypeName(field); + return this.getTypeNameFromFieldName(name, field.import); } - private lookupTypeFromCurrentPath(field: ProtoField, currentProtoPath: string) { + lookupTypeFromCurrentPath(field: ProtoField, currentProtoPath: string) { const ref = this.store.findProto(currentProtoPath); let lookup = this.store.get(ref, field.parsedType.name); if (!lookup) { @@ -161,6 +131,40 @@ export class AminoParseContext extends GenericParseContext implements ParseConte return lookup.obj; } +} + +export class AminoParseContext extends GenericParseContext implements ParseContext { + + aminoCasingFn: Function; + + constructor( + ref: ProtoRef, + store: ProtoStore, + options: TelescopeOptions + ) { + super(ref, store, options); + this.ref = ref; + this.store = store; + this.options = options; + + this.setAminoCasingFn(); + + if (!this.aminoCasingFn) { + throw new Error('missing aminoCasingFn!') + } + this.aminoCaseField = this.aminoCaseField.bind(this); + } + + private setAminoCasingFn() { + if (this.aminoCasingFn) return this.aminoCasingFn; + this.aminoCasingFn = this.pluginValue('aminoEncoding.casingFn'); + return this.aminoCasingFn; + } + + aminoCaseField(field: ProtoField) { + return field.options['(telescope:orig)']; + } + lookupEnumFromJson(field: ProtoField, currentProtoPath: string) { const lookup = this.lookupTypeFromCurrentPath(field, currentProtoPath); const Enum = lookup.obj; diff --git a/packages/ast/src/encoding/object.spec.ts b/packages/ast/src/encoding/object.spec.ts index 3d2fffa2a3..54e7b30cf7 100644 --- a/packages/ast/src/encoding/object.spec.ts +++ b/packages/ast/src/encoding/object.spec.ts @@ -2,7 +2,7 @@ import { createObjectWithMethods } from './object'; import { traverse, getNestedProto } from '@osmonauts/proto-parser'; import { ProtoParseContext } from './context'; import { createProtoType } from './proto'; -import { getTestProtoStore, expectCode, defaultTelescopeOptions } from '../../test-utils'; +import { getTestProtoStore, expectCode, defaultTelescopeOptions, printCode } from '../../test-utils'; const store = getTestProtoStore(); @@ -292,3 +292,14 @@ it('evmos/fees/v1/tx', () => { 'MsgRegisterDevFeeInfo', getNestedProto(res).MsgRegisterDevFeeInfo )) }); + +it('osmosis/gamm/v1beta1/query', () => { + const ref = store.findProto('osmosis/gamm/v1beta1/query.proto'); + const res = traverse(store, ref); + const context = new ProtoParseContext(ref, store, defaultTelescopeOptions); + + expectCode(createObjectWithMethods( + context, + 'QueryPoolsResponse', getNestedProto(res).QueryPoolsResponse + )) +}); diff --git a/packages/ast/src/encoding/proto/__snapshots__/interfaces-amino.test.ts.snap b/packages/ast/src/encoding/proto/__snapshots__/interfaces-amino.test.ts.snap new file mode 100644 index 0000000000..2901bb7ec5 --- /dev/null +++ b/packages/ast/src/encoding/proto/__snapshots__/interfaces-amino.test.ts.snap @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`MsgSubmitProposal 1`] = ` +"export const MsgSubmitProposal = { + encode(message: MsgSubmitProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.content !== undefined) { + Any.encode((message.content as Any), writer.uint32(10).fork()).ldelim(); + } + + for (const v of message.initialDeposit) { + Coin.encode(v!, writer.uint32(18).fork()).ldelim(); + } + + if (message.proposer !== "") { + writer.uint32(26).string(message.proposer); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgSubmitProposal { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgSubmitProposal(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.content = (ProposalContentI_InterfaceDecoder(reader) as Any); + break; + + case 2: + message.initialDeposit.push(Coin.decode(reader, reader.uint32())); + break; + + case 3: + message.proposer = reader.string(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): MsgSubmitProposal { + return { + content: isSet(object.content) ? Any.fromJSON(object.content) : undefined, + initialDeposit: Array.isArray(object?.initialDeposit) ? object.initialDeposit.map((e: any) => Coin.fromJSON(e)) : [], + proposer: isSet(object.proposer) ? String(object.proposer) : "" + }; + }, + + toJSON(message: MsgSubmitProposal): unknown { + const obj: any = {}; + message.content !== undefined && (obj.content = message.content ? Any.toJSON(message.content) : undefined); + + if (message.initialDeposit) { + obj.initialDeposit = message.initialDeposit.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.initialDeposit = []; + } + + message.proposer !== undefined && (obj.proposer = message.proposer); + return obj; + }, + + fromPartial(object: DeepPartial): MsgSubmitProposal { + const message = createBaseMsgSubmitProposal(); + message.content = object.content !== undefined && object.content !== null ? Any.fromPartial(object.content) : undefined; + message.initialDeposit = object.initialDeposit?.map(e => Coin.fromPartial(e)) || []; + message.proposer = object.proposer ?? ""; + return message; + }, + + fromSDK(object: MsgSubmitProposalSDKType): MsgSubmitProposal { + return { + content: object.content ? Any.fromSDK(object.content) : undefined, + initialDeposit: Array.isArray(object?.initial_deposit) ? object.initial_deposit.map((e: any) => Coin.fromSDK(e)) : [], + proposer: object?.proposer + }; + }, + + toSDK(message: MsgSubmitProposal): MsgSubmitProposalSDKType { + const obj: any = {}; + message.content !== undefined && (obj.content = message.content ? Any.toSDK(message.content) : undefined); + + if (message.initialDeposit) { + obj.initial_deposit = message.initialDeposit.map(e => e ? Coin.toSDK(e) : undefined); + } else { + obj.initial_deposit = []; + } + + obj.proposer = message.proposer; + return obj; + }, + + fromAmino(object: MsgSubmitProposalAmino): MsgSubmitProposal { + return { + content: object?.content ? ProposalContentI_FromAmino(object.content) : undefined, + initialDeposit: Array.isArray(object?.initial_deposit) ? object.initial_deposit.map((e: any) => Coin.fromAmino(e)) : [], + proposer: object.proposer + }; + }, + + toAmino(message: MsgSubmitProposal): MsgSubmitProposalAmino { + const obj: any = {}; + obj.content = message.content ? ProposalContentI_ToAmino((message.content as Any)) : undefined; + + if (message.initialDeposit) { + obj.initial_deposit = message.initialDeposit.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.initial_deposit = []; + } + + obj.proposer = message.proposer; + return obj; + } + +};" +`; diff --git a/packages/ast/src/encoding/proto/__snapshots__/proto.type.implements.spec.ts.snap b/packages/ast/src/encoding/proto/__snapshots__/proto.type.implements.spec.ts.snap new file mode 100644 index 0000000000..27594c4caf --- /dev/null +++ b/packages/ast/src/encoding/proto/__snapshots__/proto.type.implements.spec.ts.snap @@ -0,0 +1,31 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Any repeated 1`] = ` +"export interface QueryPoolsResponse { + pools: Any[]; + + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +}" +`; + +exports[`Any standard 1`] = ` +"export interface QueryPoolResponse { + pool?: Any; +}" +`; + +exports[`Cast repeated 1`] = ` +"export interface QueryPoolsResponse { + pools: (Pool1 & Pool2 & Any)[] | Any[]; + + /** pagination defines the pagination in the response. */ + pagination?: PageResponse; +}" +`; + +exports[`Cast standard 1`] = ` +"export interface QueryPoolResponse { + pool?: (Pool1 & Pool2 & Any) | undefined; +}" +`; diff --git a/packages/ast/src/encoding/proto/decode/utils.ts b/packages/ast/src/encoding/proto/decode/utils.ts index 6dda80fe2e..993f9185d3 100644 --- a/packages/ast/src/encoding/proto/decode/utils.ts +++ b/packages/ast/src/encoding/proto/decode/utils.ts @@ -1,6 +1,6 @@ import * as t from '@babel/types'; import { DecodeMethod } from './index'; -import { getKeyTypeEntryName } from '..'; +import { getInterfaceDecoderName, getKeyTypeEntryName } from '..'; export const decode = { string(args: DecodeMethod) { @@ -139,10 +139,27 @@ export const decode = { const num = args.field.id; const prop = args.field.name; const name = args.context.getTypeName(args.field); - return switchTypeArray(num, + + if ( + args.context.options.aminoEncoding.useRecursiveV2encoding == true && + args.context.options.interfaces.enabled == true && + args.field.type === 'google.protobuf.Any' && + args.field.options['(cosmos_proto.accepts_interface)'] + + ) { + const interfaceName = args.field.options['(cosmos_proto.accepts_interface)']; + const interfaceFnName = getInterfaceDecoderName(interfaceName) + + return switchAnyTypeArray( + num, + prop, + interfaceFnName + ); + } + return switchProtoTypeArray(num, prop, name - ) + ); } }; @@ -339,7 +356,7 @@ export const baseTypes = { }, // SignDocDirectAux.decode(reader, reader.uint32()); - type(args: DecodeMethod) { + protoType(args: DecodeMethod) { const name = args.context.getTypeName(args.field); return t.callExpression( t.memberExpression( @@ -359,6 +376,41 @@ export const baseTypes = { ) }, + anyType(args: DecodeMethod) { + // const { propName, origName } = getFieldNames(args.field); + // const typeMap = args.context.store.getTypeUrlMap(args.context.ref); + // console.log(JSON.stringify(typeMap, null, 2)); + // console.log(JSON.stringify(args.field, null, 2)); + const interfaceName = args.field.options['(cosmos_proto.accepts_interface)']; + const interfaceFnName = getInterfaceDecoderName(interfaceName) + + return t.tsAsExpression( + t.callExpression( + t.identifier(interfaceFnName), + [ + t.identifier('reader') + ] + ), + t.tsTypeReference( + t.identifier('Any') + ) + ) + + }, + + type(args: DecodeMethod) { + if ( + args.context.options.aminoEncoding.useRecursiveV2encoding == true && + args.context.options.interfaces.enabled == true && + args.field.type === 'google.protobuf.Any' && + args.field.options['(cosmos_proto.accepts_interface)'] + + ) { + return baseTypes.anyType(args); + } + return baseTypes.protoType(args); + }, + // (reader.int32() as any); enum(args: DecodeMethod) { return t.tsAsExpression( @@ -565,7 +617,7 @@ export const switchOnTagTakesArray = (num: number, prop: string, expr: t.Stateme }; // message.tokenInMaxs.push(Coin.decode(reader, reader.uint32())); -export const switchTypeArray = (num: number, prop: string, name: string) => { +export const switchProtoTypeArray = (num: number, prop: string, name: string) => { return t.switchCase( t.numericLiteral(num), [ @@ -603,6 +655,40 @@ export const switchTypeArray = (num: number, prop: string, name: string) => { ) }; +export const switchAnyTypeArray = (num: number, prop: string, name: string) => { + return t.switchCase( + t.numericLiteral(num), + [ + t.expressionStatement( + t.callExpression( + t.memberExpression( + t.memberExpression( + t.identifier('message'), + t.identifier(prop) + ), + t.identifier('push') + ), + [ + t.tsAsExpression( + t.callExpression( + t.identifier(name), + [ + t.identifier('reader') + ] + ), + t.tsTypeReference( + t.identifier('Any') + ) + ) + + ] + ) + ), + t.breakStatement() + ] + ) +}; + // if ((tag & 7) === 2) { // const end2 = reader.uint32() + reader.pos; diff --git a/packages/ast/src/encoding/proto/encode/utils.ts b/packages/ast/src/encoding/proto/encode/utils.ts index 94d547e244..08c186c80f 100644 --- a/packages/ast/src/encoding/proto/encode/utils.ts +++ b/packages/ast/src/encoding/proto/encode/utils.ts @@ -210,7 +210,19 @@ export const encode = { const prop = args.field.name; const name = args.context.getTypeName(args.field); const num = getTagNumber(args.field); - return types.type(num, prop, name); + + let isAnyType = false; + if ( + args.context.options.aminoEncoding.useRecursiveV2encoding == true && + args.context.options.interfaces.enabled == true && + args.field.type === 'google.protobuf.Any' && + args.field.options['(cosmos_proto.accepts_interface)'] + + ) { + isAnyType = true; + } + + return types.type(num, prop, name, isAnyType); }, enum(args: EncodeMethod) { @@ -268,7 +280,19 @@ export const encode = { const prop = args.field.name; const name = args.context.getTypeName(args.field); const num = getTagNumber(args.field); - return types.typeArray(num, prop, name); + + let isAnyType = false; + if ( + args.context.options.aminoEncoding.useRecursiveV2encoding == true && + args.context.options.interfaces.enabled == true && + args.field.type === 'google.protobuf.Any' && + args.field.options['(cosmos_proto.accepts_interface)'] + + ) { + isAnyType = true; + } + + return types.typeArray(num, prop, name, isAnyType); }, keyHash(args: EncodeMethod) { @@ -428,7 +452,22 @@ export const types = { ) }, - type(num: number, prop: string, name: string) { + type(num: number, prop: string, name: string, isAnyType: boolean) { + + let messageProp: t.MemberExpression | t.TSAsExpression = t.memberExpression( + t.identifier('message'), + t.identifier(prop) + ); + + if (isAnyType) { + messageProp = t.tsAsExpression( + messageProp, + t.tsTypeReference( + t.identifier('Any') + ) + ) + } + return t.ifStatement( notUndefined(prop), t.blockStatement([ @@ -441,10 +480,7 @@ export const types = { t.identifier('encode') ), [ - t.memberExpression( - t.identifier('message'), - t.identifier(prop) - ), + messageProp, t.callExpression( t.memberExpression( t.callExpression( @@ -728,7 +764,21 @@ export const types = { ]; }, - typeArray(num: number, prop: string, name: string) { + typeArray(num: number, prop: string, name: string, isAnyType: boolean) { + // "v!" just means it's NOT NULLABLE + let nestedProp: t.TSNonNullExpression | t.TSAsExpression = t.tsNonNullExpression( + t.identifier('v') + ); + if (isAnyType) { + nestedProp = t.tsAsExpression( + nestedProp, + t.tsTypeReference( + t.identifier('Any') + ) + ) + } + + return [ t.forOfStatement( t.variableDeclaration('const', @@ -754,10 +804,7 @@ export const types = { t.identifier('encode') ), [ - // "v!" just means it's NOT NULLABLE - t.tsNonNullExpression( - t.identifier('v') - ), + nestedProp, t.callExpression( t.memberExpression( t.callExpression( diff --git a/packages/ast/src/encoding/proto/from-amino/utils.ts b/packages/ast/src/encoding/proto/from-amino/utils.ts index cf2af6be4b..37b9001bae 100644 --- a/packages/ast/src/encoding/proto/from-amino/utils.ts +++ b/packages/ast/src/encoding/proto/from-amino/utils.ts @@ -4,6 +4,7 @@ import { BILLION, callExpression, identifier } from '../../../utils'; import { getFieldNames } from '../../types'; import { ProtoParseContext } from '../../context'; import { ProtoType } from '@osmonauts/types'; +import { getInterfaceFromAminoName } from '../implements'; export const fromAminoJSON = { @@ -114,7 +115,7 @@ export const fromAminoJSON = { return fromAminoJSON.long(args); }, - type(args: FromAminoJSONMethod) { + protoType(args: FromAminoJSONMethod) { const { propName, origName @@ -147,6 +148,50 @@ export const fromAminoJSON = { ); }, + anyType(args: FromAminoJSONMethod) { + const { propName, origName } = getFieldNames(args.field); + // const typeMap = args.context.store.getTypeUrlMap(args.context.ref); + // console.log(JSON.stringify(typeMap, null, 2)); + // console.log(JSON.stringify(args.field, null, 2)); + const interfaceName = args.field.options['(cosmos_proto.accepts_interface)']; + const interfaceFnName = getInterfaceFromAminoName(interfaceName) + + return t.objectProperty( + t.identifier(propName), + t.conditionalExpression( + t.optionalMemberExpression( + t.identifier('object'), + t.identifier(origName), + false, + true + ), + t.callExpression( + t.identifier(interfaceFnName), + [ + t.memberExpression( + t.identifier('object'), + t.identifier(origName) + ) + ] + ), + t.identifier('undefined') + ) + ); + }, + + type(args: FromAminoJSONMethod) { + if ( + args.context.options.aminoEncoding.useRecursiveV2encoding == true && + args.context.options.interfaces.enabled == true && + args.field.type === 'google.protobuf.Any' && + args.field.options['(cosmos_proto.accepts_interface)'] + + ) { + return fromAminoJSON.anyType(args); + } + return fromAminoJSON.protoType(args); + + }, enum(args: FromAminoJSONMethod) { const { propName, @@ -518,7 +563,17 @@ export const arrayTypes = { }, // tokenInMaxs: Array.isArray(object?.tokenInMaxs) ? object.tokenInMaxs.map((e: any) => Coin.fromAminoJSON(e)) : [] - type(args: FromAminoJSONMethod) { + anyType(args: FromAminoJSONMethod) { + const interfaceName = args.field.options['(cosmos_proto.accepts_interface)']; + const interfaceFnName = getInterfaceFromAminoName(interfaceName) + return t.callExpression( + t.identifier(interfaceFnName), + [ + t.identifier('e') + ] + ); + }, + protoType(args: FromAminoJSONMethod) { const name = args.context.getTypeName(args.field); return t.callExpression( t.memberExpression( @@ -529,6 +584,19 @@ export const arrayTypes = { t.identifier('e') ] ); + }, + type(args: FromAminoJSONMethod) { + + if ( + args.context.options.aminoEncoding.useRecursiveV2encoding == true && + args.context.options.interfaces.enabled == true && + args.field.type === 'google.protobuf.Any' && + args.field.options['(cosmos_proto.accepts_interface)'] + + ) { + return arrayTypes.anyType(args); + } + return arrayTypes.protoType(args); } }; diff --git a/packages/ast/src/encoding/proto/implements/__tests__/__snapshots__/interface-decoder.test.ts.snap b/packages/ast/src/encoding/proto/implements/__tests__/__snapshots__/interface-decoder.test.ts.snap new file mode 100644 index 0000000000..58a1478d3c --- /dev/null +++ b/packages/ast/src/encoding/proto/implements/__tests__/__snapshots__/interface-decoder.test.ts.snap @@ -0,0 +1,147 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`PoolI PoolI 1`] = ` +"export const PoolI_InterfaceDecoder = (input: _m0.Reader | Uint8Array): Pool1 | Pool2 | Any => { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + const data = Any.decode(reader, reader.uint32()); + + switch (data.typeUrl) { + case "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool": + return Pool1.decode(data.value); + + case "/osmosis.gamm.v1beta1.Pool": + return Pool2.decode(data.value); + + default: + return data; + } +};" +`; + +exports[`PoolI getMapFromTypeUrlMap 1`] = ` +"export const PoolI_InterfaceDecoder = (input: _m0.Reader | Uint8Array): Pool1 | Pool2 | Any => { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + const data = Any.decode(reader, reader.uint32()); + + switch (data.typeUrl) { + case "/osmosis.gamm.v1beta1.Pool": + return Pool1.decode(data.value); + + case "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool": + return Pool2.decode(data.value); + + default: + return data; + } +};" +`; + +exports[`PoolI objects 1`] = ` +"export const QueryPoolsResponse = { + encode(message: QueryPoolsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.pools) { + Any.encode((v! as Any), writer.uint32(10).fork()).ldelim(); + } + + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryPoolsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryPoolsResponse(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.pools.push((PoolI_InterfaceDecoder(reader) as Any)); + break; + + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): QueryPoolsResponse { + return { + pools: Array.isArray(object?.pools) ? object.pools.map((e: any) => Any.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined + }; + }, + + toJSON(message: QueryPoolsResponse): unknown { + const obj: any = {}; + + if (message.pools) { + obj.pools = message.pools.map(e => e ? Any.toJSON(e) : undefined); + } else { + obj.pools = []; + } + + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryPoolsResponse { + const message = createBaseQueryPoolsResponse(); + message.pools = object.pools?.map(e => Any.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + }, + + fromSDK(object: QueryPoolsResponseSDKType): QueryPoolsResponse { + return { + pools: Array.isArray(object?.pools) ? object.pools.map((e: any) => Any.fromSDK(e)) : [], + pagination: object.pagination ? PageResponse.fromSDK(object.pagination) : undefined + }; + }, + + toSDK(message: QueryPoolsResponse): QueryPoolsResponseSDKType { + const obj: any = {}; + + if (message.pools) { + obj.pools = message.pools.map(e => e ? Any.toSDK(e) : undefined); + } else { + obj.pools = []; + } + + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toSDK(message.pagination) : undefined); + return obj; + }, + + fromAmino(object: QueryPoolsResponseAmino): QueryPoolsResponse { + return { + pools: Array.isArray(object?.pools) ? object.pools.map((e: any) => PoolI_FromAmino(e)) : [], + pagination: object?.pagination ? PageResponse.fromAmino(object.pagination) : undefined + }; + }, + + toAmino(message: QueryPoolsResponse): QueryPoolsResponseAmino { + const obj: any = {}; + + if (message.pools) { + obj.pools = message.pools.map(e => e ? PoolI_ToAmino((e as Any)) : undefined); + } else { + obj.pools = []; + } + + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + } + +};" +`; diff --git a/packages/ast/src/encoding/proto/implements/__tests__/__snapshots__/interface-from-amino.test.ts.snap b/packages/ast/src/encoding/proto/implements/__tests__/__snapshots__/interface-from-amino.test.ts.snap new file mode 100644 index 0000000000..003ff485bf --- /dev/null +++ b/packages/ast/src/encoding/proto/implements/__tests__/__snapshots__/interface-from-amino.test.ts.snap @@ -0,0 +1,85 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`ProposalContent ProposalContent 1`] = ` +"export const ProposalContentI_FromAmino = (content: AnyAmino) => { + switch (content.type) { + case "cosmos-sdk/v1/TextProposal": + return Any.fromPartial({ + typeUrl: "/cosmos.gov.v1beta1.TextProposal", + value: TextProposal.encode(TextProposal.fromPartial((content.value as DeepPartial))).finish() + }); + + case "/evmos.incentives.v1.RegisterIncentiveProposal": + return Any.fromPartial({ + typeUrl: "/evmos.incentives.v1.RegisterIncentiveProposal", + value: RegisterIncentiveProposal.encode(RegisterIncentiveProposal.fromPartial((content.value as DeepPartial))).finish() + }); + + case "cosmos-sdk/ClientUpdateProposal": + return Any.fromPartial({ + typeUrl: "/ibc.core.client.v1.ClientUpdateProposal", + value: ClientUpdateProposal.encode(ClientUpdateProposal.fromPartial((content.value as DeepPartial))).finish() + }); + + case "cosmos-sdk/UpgradeProposal": + return Any.fromPartial({ + typeUrl: "/ibc.core.client.v1.UpgradeProposal", + value: UpgradeProposal.encode(UpgradeProposal.fromPartial((content.value as DeepPartial))).finish() + }); + + case "osmosis/poolincentives/replace-pool-incentives-proposal": + return Any.fromPartial({ + typeUrl: "/osmosis.poolincentives.v1beta1.ReplacePoolIncentivesProposal", + value: ReplacePoolIncentivesProposal.encode(ReplacePoolIncentivesProposal.fromPartial((content.value as DeepPartial))).finish() + }); + + case "osmosis/poolincentives/update-pool-incentives-proposal": + return Any.fromPartial({ + typeUrl: "/osmosis.poolincentives.v1beta1.UpdatePoolIncentivesProposal", + value: UpdatePoolIncentivesProposal.encode(UpdatePoolIncentivesProposal.fromPartial((content.value as DeepPartial))).finish() + }); + + case "osmosis/v1beta1/set-superfluid-assets-proposal": + return Any.fromPartial({ + typeUrl: "/osmosis.superfluid.v1beta1.SetSuperfluidAssetsProposal", + value: SetSuperfluidAssetsProposal.encode(SetSuperfluidAssetsProposal.fromPartial((content.value as DeepPartial))).finish() + }); + + case "osmosis/v1beta1/remove-superfluid-assets-proposal": + return Any.fromPartial({ + typeUrl: "/osmosis.superfluid.v1beta1.RemoveSuperfluidAssetsProposal", + value: RemoveSuperfluidAssetsProposal.encode(RemoveSuperfluidAssetsProposal.fromPartial((content.value as DeepPartial))).finish() + }); + + case "osmosis/v1beta1/update-unpool-white-list-proposal": + return Any.fromPartial({ + typeUrl: "/osmosis.superfluid.v1beta1.UpdateUnpoolWhiteListProposal", + value: UpdateUnpoolWhiteListProposal.encode(UpdateUnpoolWhiteListProposal.fromPartial((content.value as DeepPartial))).finish() + }); + + case "osmosis/txfees/update-fee-token-proposal": + return Any.fromPartial({ + typeUrl: "/osmosis.txfees.v1beta1.UpdateFeeTokenProposal", + value: UpdateFeeTokenProposal.encode(UpdateFeeTokenProposal.fromPartial((content.value as DeepPartial))).finish() + }); + + default: + return Any.fromAmino(content); + } +};" +`; + +exports[`ProposalContent ProposalContent helper 1`] = ` +"export const ProposalContentI_fromAmino = (content: AnyAmino) => { + switch (content.type) { + case "cosmos-sdk/TextProposal": + return Any.fromPartial({ + typeUrl: "/cosmos.gov.v1beta1.TextProposal", + value: TextProposal.encode(TextProposal.fromPartial((content.value as DeepPartial))).finish() + }); + + default: + return Any.fromAmino(content); + } +};" +`; diff --git a/packages/ast/src/encoding/proto/implements/__tests__/__snapshots__/interface-to-amino.test.ts.snap b/packages/ast/src/encoding/proto/implements/__tests__/__snapshots__/interface-to-amino.test.ts.snap new file mode 100644 index 0000000000..4fa8ce618f --- /dev/null +++ b/packages/ast/src/encoding/proto/implements/__tests__/__snapshots__/interface-to-amino.test.ts.snap @@ -0,0 +1,85 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`ProposalContent ProposalContent 1`] = ` +"export const ProposalContentI_ToAmino = (content: Any) => { + switch (content.typeUrl) { + case "/cosmos.gov.v1beta1.TextProposal": + return { + type: "cosmos-sdk/v1/TextProposal", + value: TextProposal.toAmino(TextProposal.decode(content.value)) + }; + + case "/evmos.incentives.v1.RegisterIncentiveProposal": + return { + type: "/evmos.incentives.v1.RegisterIncentiveProposal", + value: RegisterIncentiveProposal.toAmino(RegisterIncentiveProposal.decode(content.value)) + }; + + case "/ibc.core.client.v1.ClientUpdateProposal": + return { + type: "cosmos-sdk/ClientUpdateProposal", + value: ClientUpdateProposal.toAmino(ClientUpdateProposal.decode(content.value)) + }; + + case "/ibc.core.client.v1.UpgradeProposal": + return { + type: "cosmos-sdk/UpgradeProposal", + value: UpgradeProposal.toAmino(UpgradeProposal.decode(content.value)) + }; + + case "/osmosis.poolincentives.v1beta1.ReplacePoolIncentivesProposal": + return { + type: "osmosis/poolincentives/replace-pool-incentives-proposal", + value: ReplacePoolIncentivesProposal.toAmino(ReplacePoolIncentivesProposal.decode(content.value)) + }; + + case "/osmosis.poolincentives.v1beta1.UpdatePoolIncentivesProposal": + return { + type: "osmosis/poolincentives/update-pool-incentives-proposal", + value: UpdatePoolIncentivesProposal.toAmino(UpdatePoolIncentivesProposal.decode(content.value)) + }; + + case "/osmosis.superfluid.v1beta1.SetSuperfluidAssetsProposal": + return { + type: "osmosis/v1beta1/set-superfluid-assets-proposal", + value: SetSuperfluidAssetsProposal.toAmino(SetSuperfluidAssetsProposal.decode(content.value)) + }; + + case "/osmosis.superfluid.v1beta1.RemoveSuperfluidAssetsProposal": + return { + type: "osmosis/v1beta1/remove-superfluid-assets-proposal", + value: RemoveSuperfluidAssetsProposal.toAmino(RemoveSuperfluidAssetsProposal.decode(content.value)) + }; + + case "/osmosis.superfluid.v1beta1.UpdateUnpoolWhiteListProposal": + return { + type: "osmosis/v1beta1/update-unpool-white-list-proposal", + value: UpdateUnpoolWhiteListProposal.toAmino(UpdateUnpoolWhiteListProposal.decode(content.value)) + }; + + case "/osmosis.txfees.v1beta1.UpdateFeeTokenProposal": + return { + type: "osmosis/txfees/update-fee-token-proposal", + value: UpdateFeeTokenProposal.toAmino(UpdateFeeTokenProposal.decode(content.value)) + }; + + default: + return Any.toAmino(content); + } +};" +`; + +exports[`ProposalContent ProposalContent helper 1`] = ` +"export const ProposalContentI_toAmino = (content: Any) => { + switch (content.typeUrl) { + case "/cosmos.gov.v1beta1.TextProposal": + return { + type: "cosmos-sdk/TextProposal", + value: TextProposal.toAmino(TextProposal.decode(content.value)) + }; + + default: + return Any.toAmino(content); + } +};" +`; diff --git a/packages/ast/src/encoding/proto/implements/__tests__/interface-decoder.test.ts b/packages/ast/src/encoding/proto/implements/__tests__/interface-decoder.test.ts new file mode 100644 index 0000000000..bda1a01b75 --- /dev/null +++ b/packages/ast/src/encoding/proto/implements/__tests__/interface-decoder.test.ts @@ -0,0 +1,56 @@ +import { getNestedProto } from '@osmonauts/proto-parser'; +import { InterfaceTypeUrlMap } from '@osmonauts/types'; +import { expectCode, getTestProtoStore } from '../../../../../test-utils/' +import { ProtoParseContext } from '../../../context'; +import { createObjectWithMethods } from '../../../object'; +import { createInterfaceDecoder, createInterfaceDecoderHelper } from '../decoder'; + +const store = getTestProtoStore(); +store.options.aminoEncoding.useRecursiveV2encoding = true; +store.options.interfaces.enabled = true; +store.traverseAll(); + +const typeMap: InterfaceTypeUrlMap = { + PoolI: [ + { + ref: 'a/b/c.proto', + pkg: 'a.b.c', + types: [ + { + typeUrl: '/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool', + aminoType: 'osmo-sdk/StablePool', + type: 'Pool', + importAs: 'Pool1' + }, + { + typeUrl: '/osmosis.gamm.v1beta1.Pool', + aminoType: 'osmo-sdk/Pool', + type: 'Pool', + importAs: 'Pool2' + } + ] + } + ] +}; + +describe('PoolI', () => { + const queryRef = store.findProto('osmosis/gamm/v1beta1/query.proto'); + const queryContext = new ProtoParseContext(queryRef, store, store.options); + it('getMapFromTypeUrlMap', () => { + expectCode(createInterfaceDecoder(queryContext, queryRef, 'PoolI')); + }); + it('PoolI', () => { + expectCode(createInterfaceDecoderHelper( + queryContext, + 'PoolI_InterfaceDecoder', + typeMap['PoolI'] + )); + }); + it('objects', () => { + expectCode(createObjectWithMethods( + queryContext, + 'QueryPoolsResponse', + getNestedProto(queryRef.traversed).QueryPoolsResponse + )); + }); +}); \ No newline at end of file diff --git a/packages/ast/src/encoding/proto/implements/__tests__/interface-from-amino.test.ts b/packages/ast/src/encoding/proto/implements/__tests__/interface-from-amino.test.ts new file mode 100644 index 0000000000..c0ff474daa --- /dev/null +++ b/packages/ast/src/encoding/proto/implements/__tests__/interface-from-amino.test.ts @@ -0,0 +1,46 @@ +import { InterfaceTypeUrlMap, TraverseTypeUrlRef } from '@osmonauts/types'; +import { expectCode, printCode, getTestProtoStore } from '../../../../../test-utils/' +import { ProtoParseContext } from '../../../context'; +import { createInterfaceFromAminoHelper, createInterfaceFromAmino } from '../from-amino'; + +const store = getTestProtoStore(); +store.options.interfaces.enabled = true; +store.options.aminoEncoding.enabled = true; +store.options.aminoEncoding.useRecursiveV2encoding = true; +store.traverseAll(); + +const typeMap: InterfaceTypeUrlMap = { + ProposalContentI: [ + { + ref: 'a/b/c.proto', + pkg: 'a.b.c', + types: [ + { + typeUrl: '/cosmos.gov.v1beta1.TextProposal', + aminoType: 'cosmos-sdk/TextProposal', + type: 'TextProposal', + importAs: 'TextProposal' + } + ] + } + ] +}; + +describe('ProposalContent', () => { + const txRef = store.findProto('cosmos/gov/v1/tx.proto'); + const txContext = new ProtoParseContext(txRef, store, store.options); + it('ProposalContent helper', () => { + expectCode(createInterfaceFromAminoHelper( + txContext, + 'ProposalContentI_fromAmino', + typeMap['ProposalContentI'] + )); + }); + it('ProposalContent', () => { + expectCode(createInterfaceFromAmino( + txContext, + txRef, + 'ProposalContentI', + )); + }); +}); \ No newline at end of file diff --git a/packages/ast/src/encoding/proto/implements/__tests__/interface-to-amino.test.ts b/packages/ast/src/encoding/proto/implements/__tests__/interface-to-amino.test.ts new file mode 100644 index 0000000000..fc34ac1982 --- /dev/null +++ b/packages/ast/src/encoding/proto/implements/__tests__/interface-to-amino.test.ts @@ -0,0 +1,46 @@ +import { InterfaceTypeUrlMap } from '@osmonauts/types'; +import { expectCode, printCode, getTestProtoStore } from '../../../../../test-utils/' +import { ProtoParseContext } from '../../../context'; +import { createInterfaceToAmino, createInterfaceToAminoHelper } from '../to-amino'; + +const store = getTestProtoStore(); +store.options.interfaces.enabled = true; +store.options.aminoEncoding.enabled = true; +store.options.aminoEncoding.useRecursiveV2encoding = true; +store.traverseAll(); + +const typeMap: InterfaceTypeUrlMap = { + ProposalContentI: [ + { + ref: 'a/b/c.proto', + pkg: 'a.b.c', + types: [ + { + typeUrl: '/cosmos.gov.v1beta1.TextProposal', + aminoType: 'cosmos-sdk/TextProposal', + type: 'TextProposal', + importAs: 'TextProposal' + } + ] + } + ] +}; + +describe('ProposalContent', () => { + const txRef = store.findProto('cosmos/gov/v1/tx.proto'); + const txContext = new ProtoParseContext(txRef, store, store.options); + it('ProposalContent helper', () => { + expectCode(createInterfaceToAminoHelper( + txContext, + 'ProposalContentI_toAmino', + typeMap['ProposalContentI'] + )); + }); + it('ProposalContent', () => { + expectCode(createInterfaceToAmino( + txContext, + txRef, + 'ProposalContentI', + )); + }); +}); \ No newline at end of file diff --git a/packages/ast/src/encoding/proto/implements/decoder.ts b/packages/ast/src/encoding/proto/implements/decoder.ts new file mode 100644 index 0000000000..2be4be23ca --- /dev/null +++ b/packages/ast/src/encoding/proto/implements/decoder.ts @@ -0,0 +1,197 @@ +import * as t from '@babel/types'; +import { InterfaceTypeUrlMap, ProtoRef, TraverseTypeUrlRef, TypeUrlRef } from '@osmonauts/types'; +import { slugify } from '@osmonauts/utils'; +import { arrowFunctionExpression, identifier } from '../../../utils'; +import { ProtoParseContext } from "../../context"; + +const getMapFromTypeUrlMap = (urlMap: InterfaceTypeUrlMap, name: string) => { + return urlMap?.[name]?.reduce((m, v) => { + v.types.forEach(type => { + m[type.importAs] = type.typeUrl; + }) + return m; + }, {}) ?? {} +}; + +const firstUpper = (s: string) => s = s.charAt(0).toUpperCase() + s.slice(1); + +export const getInterfaceDecoderName = (str: string) => { + return firstUpper(slugify(str) + '_InterfaceDecoder'); +}; + +export const createInterfaceDecoder = ( + context: ProtoParseContext, + ref: ProtoRef, + interfaceName: string +) => { + const typeMap = context.store.getTypeUrlMap(ref); + const typeRefs = typeMap[interfaceName]; + return createInterfaceDecoderHelper( + context, + getInterfaceDecoderName(interfaceName), + typeRefs + ); +} + +export const createInterfaceDecoderHelper = ( + context: ProtoParseContext, + functionName: string, + typeRefs: TraverseTypeUrlRef[] +) => { + + context.addUtil('_m0'); + + // MARKED AS NOT DRY + const allTypes: TypeUrlRef[] = typeRefs?.reduce((m, typeRef) => { + // check excludes + const packages = context.pluginValue('prototypes.excluded.packages') ?? []; + const protos = context.pluginValue('prototypes.excluded.protos') ?? []; + const excluded = packages.includes(typeRef.pkg) || protos.includes(typeRef.ref); + if (excluded) return m; + return [...m, ...typeRef.types]; + }, []) ?? []; + + + const returnTypes: string[] = allTypes.map(type => type.importAs); + const decodeMessages: string[] = allTypes.map(type => type.typeUrl); + const switches = returnTypes.map((returnType, i) => { + return t.switchCase( + t.stringLiteral(decodeMessages[i]), + [ + t.returnStatement( + t.callExpression( + t.memberExpression( + t.identifier(returnType), + t.identifier('decode') + ), + [ + t.memberExpression( + t.identifier('data'), + t.identifier('value') + ) + ] + ) + ) + ] + ) + }); + + return t.exportNamedDeclaration( + t.variableDeclaration( + 'const', + [ + t.variableDeclarator( + t.identifier(functionName), + arrowFunctionExpression( + [ + identifier( + 'input', + t.tsTypeAnnotation( + t.tsUnionType([ + t.tsTypeReference( + t.tsQualifiedName( + t.identifier('_m0'), + t.identifier('Reader') + ) + ), + t.tsTypeReference( + t.identifier('Uint8Array') + ) + ]) + ), + false + ) + ], + // body + t.blockStatement([ + /// READER + t.variableDeclaration('const', [ + t.variableDeclarator( + t.identifier('reader'), + t.conditionalExpression( + t.binaryExpression( + 'instanceof', + t.identifier('input'), + t.memberExpression( + t.identifier('_m0'), + t.identifier('Reader') + ) + ), + t.identifier('input'), + t.newExpression( + t.memberExpression( + t.identifier('_m0'), + t.identifier('Reader') + ), + [ + t.identifier('input') + ] + ) + ) + ) + ]), + + // DATA + t.variableDeclaration('const', [ + t.variableDeclarator( + t.identifier('data'), + t.callExpression( + t.memberExpression( + t.identifier('Any'), + t.identifier('decode') + ), + [ + t.identifier('reader'), + t.callExpression( + t.memberExpression( + t.identifier('reader'), + t.identifier('uint32') // NOTE is it always uint32? + ), + [] + ) + ] + ) + ) + ]), + + // SWITCH + t.switchStatement( + t.memberExpression( + t.identifier('data'), + t.identifier('typeUrl') + ), + [ + + ...switches, + ///// + t.switchCase( + null, + [ + t.returnStatement( + t.identifier('data') + ) + ] + ) + ] + ) + + ]), + + // return type + t.tsTypeAnnotation( + // do we need to use interfaces.useUnionTypes here ? + t.tsUnionType([ + ...returnTypes.map(type => t.tsTypeReference( + t.identifier(type) + )), + t.tsTypeReference( + t.identifier('Any') + ) + ]) + ) + ) + ) + ] + ) + ) +}; \ No newline at end of file diff --git a/packages/ast/src/encoding/proto/implements/from-amino.ts b/packages/ast/src/encoding/proto/implements/from-amino.ts new file mode 100644 index 0000000000..cde9788e42 --- /dev/null +++ b/packages/ast/src/encoding/proto/implements/from-amino.ts @@ -0,0 +1,161 @@ +import * as t from '@babel/types'; +import { InterfaceTypeUrlMap, ProtoRef, TraverseTypeUrlRef, TypeUrlRef } from '@osmonauts/types'; +import { slugify } from '@osmonauts/utils'; +import { identifier } from '../../../utils'; +import { ProtoParseContext } from "../../context"; + + +const firstUpper = (s: string) => s = s.charAt(0).toUpperCase() + s.slice(1); + +export const getInterfaceFromAminoName = (str: string) => { + return firstUpper(slugify(str) + '_FromAmino'); +}; + +export const createInterfaceFromAmino = ( + context: ProtoParseContext, + ref: ProtoRef, + interfaceName: string, +) => { + const typeMap = context.store.getTypeUrlMap(ref); + const typeRefs = typeMap[interfaceName]; + return createInterfaceFromAminoHelper( + context, + getInterfaceFromAminoName(interfaceName), + typeRefs + ); +}; + +export const createInterfaceFromAminoHelper = ( + context: ProtoParseContext, + functionName: string, + typeRefs: TraverseTypeUrlRef[] +) => { + + context.addUtil('DeepPartial'); + + // MARKED AS NOT DRY + const allTypes: TypeUrlRef[] = typeRefs?.reduce((m, typeRef) => { + // check excludes + const packages = context.pluginValue('prototypes.excluded.packages') ?? []; + const protos = context.pluginValue('prototypes.excluded.protos') ?? []; + const excluded = packages.includes(typeRef.pkg) || protos.includes(typeRef.ref); + if (excluded) return m; + return [...m, ...typeRef.types]; + }, []) ?? []; + + const switchCases = allTypes.map(type => { + if (!type.aminoType) return; + + return t.switchCase( + t.stringLiteral(type.aminoType), + [ + t.returnStatement( + t.callExpression( + t.memberExpression( + t.identifier('Any'), + t.identifier('fromPartial') + ), + [ + t.objectExpression([ + t.objectProperty( + t.identifier('typeUrl'), + t.stringLiteral(type.typeUrl) + ), + t.objectProperty( + t.identifier('value'), + t.callExpression( + t.memberExpression( + t.callExpression( + t.memberExpression( + t.identifier(type.importAs), + t.identifier('encode') + ), + [ + t.callExpression( + t.memberExpression( + t.identifier(type.importAs), + t.identifier('fromPartial') + ), + [ + t.tsAsExpression( + t.memberExpression( + t.identifier('content'), + t.identifier('value') + ), + t.tsTypeReference( + t.identifier('DeepPartial'), + t.tsTypeParameterInstantiation([ + t.tsTypeReference( + t.identifier(type.importAs) + ) + ]) + ) + ) + ] + ) + ] + ), + t.identifier('finish') + ), + [] + ) + ), + + ]) + ] + ) + )] + ); + }).filter(Boolean); + + return t.exportNamedDeclaration( + t.variableDeclaration( + 'const', + [ + t.variableDeclarator( + t.identifier(functionName), + t.arrowFunctionExpression( + [ + identifier( + 'content', + t.tsTypeAnnotation( + t.tsTypeReference( + t.identifier('AnyAmino') + ) + ) + ) + ], + t.blockStatement([ + t.switchStatement( + t.memberExpression( + t.identifier('content'), + t.identifier('type') + ), + [ + ...switchCases, + /// default + t.switchCase( + null, + [ + t.returnStatement( + t.callExpression( + t.memberExpression( + t.identifier('Any'), + t.identifier('fromAmino') + ), + [ + t.identifier('content') + ] + ) + ) + ] + ) + ] + ) + ]) + ) + ) + ] + ) + ) +}; \ No newline at end of file diff --git a/packages/ast/src/encoding/proto/implements/index.ts b/packages/ast/src/encoding/proto/implements/index.ts new file mode 100644 index 0000000000..7620367973 --- /dev/null +++ b/packages/ast/src/encoding/proto/implements/index.ts @@ -0,0 +1,3 @@ +export * from './decoder'; +export * from './to-amino'; +export * from './from-amino'; \ No newline at end of file diff --git a/packages/ast/src/encoding/proto/implements/to-amino.ts b/packages/ast/src/encoding/proto/implements/to-amino.ts new file mode 100644 index 0000000000..0371667e84 --- /dev/null +++ b/packages/ast/src/encoding/proto/implements/to-amino.ts @@ -0,0 +1,134 @@ +import * as t from '@babel/types'; +import { ProtoRef, TraverseTypeUrlRef, TypeUrlRef } from '@osmonauts/types'; +import { slugify } from '@osmonauts/utils'; +import { identifier } from '../../../utils'; +import { ProtoParseContext } from "../../context"; + +const firstUpper = (s: string) => s = s.charAt(0).toUpperCase() + s.slice(1); + +export const getInterfaceToAminoName = (str: string) => { + return firstUpper(slugify(str) + '_ToAmino'); +}; + +export const createInterfaceToAmino = ( + context: ProtoParseContext, + ref: ProtoRef, + interfaceName: string, +) => { + const typeMap = context.store.getTypeUrlMap(ref); + const typeRefs = typeMap[interfaceName]; + return createInterfaceToAminoHelper( + context, + getInterfaceToAminoName(interfaceName), + typeRefs + ); +}; + +export const createInterfaceToAminoHelper = ( + context: ProtoParseContext, + functionName: string, + typeRefs: TraverseTypeUrlRef[] +) => { + + // MARKED AS NOT DRY + const allTypes: TypeUrlRef[] = typeRefs?.reduce((m, typeRef) => { + // check excludes + const packages = context.pluginValue('prototypes.excluded.packages') ?? []; + const protos = context.pluginValue('prototypes.excluded.protos') ?? []; + const excluded = packages.includes(typeRef.pkg) || protos.includes(typeRef.ref); + if (excluded) return m; + return [...m, ...typeRef.types]; + }, []) ?? []; + + const switchCases = allTypes.map(type => { + if (!type.aminoType) return; + return t.switchCase( + t.stringLiteral(type.typeUrl), + [ + // return + t.returnStatement( + t.objectExpression([ + t.objectProperty( + t.identifier('type'), + t.stringLiteral(type.aminoType) + ), + t.objectProperty( + t.identifier('value'), + t.callExpression( + t.memberExpression( + t.identifier(type.importAs), + t.identifier('toAmino') + ), + [ + t.callExpression( + t.memberExpression( + t.identifier(type.importAs), + t.identifier('decode') + ), + [ + t.memberExpression( + t.identifier('content'), + t.identifier('value') + ) + ] + ) + ] + ) + ) + ]) + ) + ]) + }).filter(Boolean); + + return t.exportNamedDeclaration( + t.variableDeclaration( + 'const', + [ + t.variableDeclarator( + t.identifier(functionName), + t.arrowFunctionExpression( + [ + identifier( + 'content', + t.tsTypeAnnotation( + t.tsTypeReference( + t.identifier('Any') + ) + ) + ) + ], + t.blockStatement([ + t.switchStatement( + t.memberExpression( + t.identifier('content'), + t.identifier('typeUrl') + ), + [ + ...switchCases, + // default + t.switchCase( + null, + [ + t.returnStatement( + t.callExpression( + t.memberExpression( + t.identifier('Any'), + t.identifier('toAmino') + ), + [ + t.identifier('content') + ] + ) + ) + ] + ) + ] + ) + ]) + ) + + ) + ] + ) + ) +}; \ No newline at end of file diff --git a/packages/ast/src/encoding/proto/index.ts b/packages/ast/src/encoding/proto/index.ts index 8a326fd225..91af1b39ae 100644 --- a/packages/ast/src/encoding/proto/index.ts +++ b/packages/ast/src/encoding/proto/index.ts @@ -1,12 +1,13 @@ export * from './decode'; export * from './encode'; export * from './enums'; -export * from './types'; -export * from './from-json'; -export * from './from-sdk'; export * from './from-amino'; +export * from './from-json'; export * from './from-partial'; +export * from './from-sdk'; +export * from './implements'; +export * from './interface'; +export * from './to-amino'; export * from './to-json'; export * from './to-sdk'; -export * from './to-amino'; -export * from './interface'; \ No newline at end of file +export * from './types'; \ No newline at end of file diff --git a/packages/ast/src/encoding/proto/interface/__tests__/__snapshots__/google.proto.any.test.ts.snap b/packages/ast/src/encoding/proto/interface/__tests__/__snapshots__/google.proto.any.test.ts.snap new file mode 100644 index 0000000000..8be2b3227b --- /dev/null +++ b/packages/ast/src/encoding/proto/interface/__tests__/__snapshots__/google.proto.any.test.ts.snap @@ -0,0 +1,377 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Any amino interface 1`] = ` +"/** + * \`Any\` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * + * Example 1: Pack and unpack a message in C++. + * + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * + * Example 2: Pack and unpack a message in Java. + * + * Foo foo = ...; + * Any any = Any.pack(foo); + * ... + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * } + * + * Example 3: Pack and unpack a message in Python. + * + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * ... + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * ... + * + * Example 4: Pack and unpack a message in Go + * + * foo := &pb.Foo{...} + * any, err := ptypes.MarshalAny(foo) + * ... + * foo := &pb.Foo{} + * if err := ptypes.UnmarshalAny(any, foo); err != nil { + * ... + * } + * + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * + * + * JSON + * ==== + * The JSON representation of an \`Any\` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field \`@type\` which contains the type URL. Example: + * + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * } + * + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * } + * + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * \`value\` which holds the custom JSON in addition to the \`@type\` + * field. Example (for message [google.protobuf.Duration][]): + * + * { + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + * } + */ +export interface AnyAmino { + /** + * A URL/resource name that uniquely identifies the type of the serialized + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent + * the fully qualified name of the type (as in + * \`path/google.protobuf.Duration\`). The name should be in a canonical form + * (e.g., leading "." is not accepted). + * + * In practice, teams usually precompile into the binary all types that they + * expect it to use in the context of Any. However, for URLs which use the + * scheme \`http\`, \`https\`, or no scheme, one can optionally set up a type + * server that maps type URLs to message definitions as follows: + * + * * If no scheme is provided, \`https\` is assumed. + * * An HTTP GET on the URL must yield a [google.protobuf.Type][] + * value in binary format, or produce an error. + * * Applications are allowed to cache lookup results based on the + * URL, or have them precompiled into a binary to avoid any + * lookup. Therefore, binary compatibility needs to be preserved + * on changes to types. (Use versioned type names to manage + * breaking changes.) + * + * Note: this functionality is not currently available in the official + * protobuf release, and it is not used for type URLs beginning with + * type.googleapis.com. + * + * Schemes other than \`http\`, \`https\` (or the empty scheme) might be + * used with implementation specific semantics. + */ + type: string; + + /** Must be a valid serialized protocol buffer of the above specified type. */ + value: Uint8Array; +}" +`; + +exports[`Any api interface 1`] = ` +"/** + * \`Any\` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * + * Example 1: Pack and unpack a message in C++. + * + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * + * Example 2: Pack and unpack a message in Java. + * + * Foo foo = ...; + * Any any = Any.pack(foo); + * ... + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * } + * + * Example 3: Pack and unpack a message in Python. + * + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * ... + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * ... + * + * Example 4: Pack and unpack a message in Go + * + * foo := &pb.Foo{...} + * any, err := ptypes.MarshalAny(foo) + * ... + * foo := &pb.Foo{} + * if err := ptypes.UnmarshalAny(any, foo); err != nil { + * ... + * } + * + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * + * + * JSON + * ==== + * The JSON representation of an \`Any\` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field \`@type\` which contains the type URL. Example: + * + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * } + * + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * } + * + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * \`value\` which holds the custom JSON in addition to the \`@type\` + * field. Example (for message [google.protobuf.Duration][]): + * + * { + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + * } + */ +export interface AnySDKType { + type_url: string; + value: Uint8Array; +}" +`; + +exports[`Any interface 1`] = ` +"/** + * \`Any\` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * + * Example 1: Pack and unpack a message in C++. + * + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * + * Example 2: Pack and unpack a message in Java. + * + * Foo foo = ...; + * Any any = Any.pack(foo); + * ... + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * } + * + * Example 3: Pack and unpack a message in Python. + * + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * ... + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * ... + * + * Example 4: Pack and unpack a message in Go + * + * foo := &pb.Foo{...} + * any, err := ptypes.MarshalAny(foo) + * ... + * foo := &pb.Foo{} + * if err := ptypes.UnmarshalAny(any, foo); err != nil { + * ... + * } + * + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * + * + * JSON + * ==== + * The JSON representation of an \`Any\` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field \`@type\` which contains the type URL. Example: + * + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * } + * + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * } + * + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * \`value\` which holds the custom JSON in addition to the \`@type\` + * field. Example (for message [google.protobuf.Duration][]): + * + * { + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + * } + */ +export interface Any { + /** + * A URL/resource name that uniquely identifies the type of the serialized + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent + * the fully qualified name of the type (as in + * \`path/google.protobuf.Duration\`). The name should be in a canonical form + * (e.g., leading "." is not accepted). + * + * In practice, teams usually precompile into the binary all types that they + * expect it to use in the context of Any. However, for URLs which use the + * scheme \`http\`, \`https\`, or no scheme, one can optionally set up a type + * server that maps type URLs to message definitions as follows: + * + * * If no scheme is provided, \`https\` is assumed. + * * An HTTP GET on the URL must yield a [google.protobuf.Type][] + * value in binary format, or produce an error. + * * Applications are allowed to cache lookup results based on the + * URL, or have them precompiled into a binary to avoid any + * lookup. Therefore, binary compatibility needs to be preserved + * on changes to types. (Use versioned type names to manage + * breaking changes.) + * + * Note: this functionality is not currently available in the official + * protobuf release, and it is not used for type URLs beginning with + * type.googleapis.com. + * + * Schemes other than \`http\`, \`https\` (or the empty scheme) might be + * used with implementation specific semantics. + */ + typeUrl: string; + + /** Must be a valid serialized protocol buffer of the above specified type. */ + value: Uint8Array; +}" +`; + +exports[`Any interface 2`] = ` +"export const Any = { + encode(message: Any, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.typeUrl !== "") { + writer.uint32(10).string(message.typeUrl); + } + + if (message.value.length !== 0) { + writer.uint32(18).bytes(message.value); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Any { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAny(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.typeUrl = reader.string(); + break; + + case 2: + message.value = reader.bytes(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromPartial(object: DeepPartial): Any { + const message = createBaseAny(); + message.typeUrl = object.typeUrl ?? ""; + message.value = object.value ?? new Uint8Array(); + return message; + } + +};" +`; diff --git a/packages/ast/src/encoding/proto/interface/__tests__/__snapshots__/interface.test.ts.snap b/packages/ast/src/encoding/proto/interface/__tests__/__snapshots__/interface.test.ts.snap index 39209ab722..936486eee3 100644 --- a/packages/ast/src/encoding/proto/interface/__tests__/__snapshots__/interface.test.ts.snap +++ b/packages/ast/src/encoding/proto/interface/__tests__/__snapshots__/interface.test.ts.snap @@ -49,39 +49,10 @@ exports[`PageRequest api interface 1`] = ` * } */ export interface PageRequestSDKType { - /** - * key is a value returned in PageResponse.next_key to begin - * querying the next page most efficiently. Only one of offset or key - * should be set. - */ key: Uint8Array; - - /** - * offset is a numeric offset that can be used when key is unavailable. - * It is less efficient than using key. Only one of offset or key should - * be set. - */ offset: Long; - - /** - * limit is the total number of results to be returned in the result page. - * If left empty it will default to a value to be set by each app. - */ limit: Long; - - /** - * count_total is set to true to indicate that the result set should include - * a count of the total number of items available for pagination in UIs. - * count_total is only respected when offset is used. It is ignored when key - * is set. - */ count_total: boolean; - - /** - * reverse is set to true if results are to be returned in the descending order. - * - * Since: cosmos-sdk 0.43 - */ reverse: boolean; }" `; @@ -145,17 +116,7 @@ exports[`PageResponse api interface 1`] = ` * } */ export interface PageResponseSDKType { - /** - * next_key is the key to be passed to PageRequest.key to - * query the next page most efficiently. It will be empty if - * there are no more results. - */ next_key: Uint8Array; - - /** - * total is total number of results available if PageRequest.count_total - * was set, its value is undefined otherwise - */ total: Long; }" `; diff --git a/packages/ast/src/encoding/proto/interface/__tests__/google.proto.any.test.ts b/packages/ast/src/encoding/proto/interface/__tests__/google.proto.any.test.ts new file mode 100644 index 0000000000..bd0a454107 --- /dev/null +++ b/packages/ast/src/encoding/proto/interface/__tests__/google.proto.any.test.ts @@ -0,0 +1,35 @@ +import { getNestedProto } from '@osmonauts/proto-parser'; +import { defaultTelescopeOptions } from '@osmonauts/types'; +import { expectCode, getTestProtoStore, printCode } from '../../../../../test-utils/' +import { ProtoParseContext } from '../../../context'; +import { createSDKType, createProtoType } from '..'; +import { createAminoType } from '../amino'; +import { createObjectWithMethods } from '../../../object'; + +const store = getTestProtoStore(); +store.traverseAll(); + +describe('Any', () => { + const ref = store.findProto('google/protobuf/any.proto'); + const context = new ProtoParseContext(ref, store, defaultTelescopeOptions); + it('interface', () => { + expectCode(createProtoType(context, 'Any', + getNestedProto(ref.traversed).Any + )); + }); + it('api interface', () => { + expectCode(createSDKType(context, 'Any', + getNestedProto(ref.traversed).Any + )); + }); + it('amino interface', () => { + expectCode(createAminoType(context, 'Any', + getNestedProto(ref.traversed).Any + )); + }); + it('interface', () => { + expectCode(createObjectWithMethods(context, 'Any', + getNestedProto(ref.traversed).Any + )); + }); +}); diff --git a/packages/ast/src/encoding/proto/interface/amino.ts b/packages/ast/src/encoding/proto/interface/amino.ts index a02c19720e..a3a7f864de 100644 --- a/packages/ast/src/encoding/proto/interface/amino.ts +++ b/packages/ast/src/encoding/proto/interface/amino.ts @@ -93,7 +93,20 @@ export const createAminoType = ( const field = proto.fields[fieldName]; const orig = field.options?.['(telescope:orig)'] ?? fieldName; - const fieldNameWithCase = options.useOriginalCase ? orig : fieldName; + let fieldNameWithCase = options.useOriginalCase ? orig : fieldName; + + // should we actually just edit/add comments + // to make this more "native" for any google.protobuf.Any? + // let's see... + if ( + name === 'Any' && + context.ref.proto.package === 'google.protobuf' && + options.typeNameSuffix === 'Amino' && + orig === 'type_url' + ) { + // type_url => type + fieldNameWithCase = 'type'; + } const propSig = tsPropertySignature( t.identifier(fieldNameWithCase), diff --git a/packages/ast/src/encoding/proto/interface/index.ts b/packages/ast/src/encoding/proto/interface/index.ts index b21bdcd0a7..01eae4c8a8 100644 --- a/packages/ast/src/encoding/proto/interface/index.ts +++ b/packages/ast/src/encoding/proto/interface/index.ts @@ -1,3 +1,3 @@ -export * from './interface'; +export * from './proto'; export * from './sdk'; export * from './amino'; \ No newline at end of file diff --git a/packages/ast/src/encoding/proto/interface/interface.ts b/packages/ast/src/encoding/proto/interface/proto.ts similarity index 52% rename from packages/ast/src/encoding/proto/interface/interface.ts rename to packages/ast/src/encoding/proto/interface/proto.ts index 39437cf6e1..63103b030f 100644 --- a/packages/ast/src/encoding/proto/interface/interface.ts +++ b/packages/ast/src/encoding/proto/interface/proto.ts @@ -17,6 +17,7 @@ import { getMessageName, getTSType } from '../../types'; +import { getTypeUrlWithPkgAndName } from '../../amino'; const getProtoField = ( context: ProtoParseContext, @@ -25,10 +26,22 @@ const getProtoField = ( ) => { let ast: any = null; - ast = getFieldTypeReference(context, field, options); + const fieldRef = getFieldTypeReference(context, field, options); + ast = fieldRef.ast + const isTypeCastableAnyType = fieldRef.isTypeCastableAnyType if (field.rule === 'repeated') { ast = t.tsArrayType(ast); + if (isTypeCastableAnyType) { + ast = t.tsUnionType([ + ast, + t.tsArrayType( + t.tsTypeReference( + t.identifier('Any') + ) + ) + ]) + } } if (field.keyType) { @@ -92,51 +105,89 @@ export const createProtoType = ( const MsgName = getMessageName(name, options); + const fields = []; + + if ( + context.pluginValue('prototypes.addTypeUrlToDecoders') && + (( + context.pluginValue('interfaces.enabled') && + proto.options?.['(cosmos_proto.implements_interface)'] + ) || + ( + context.ref.proto.package === 'google.protobuf' + && name === 'Any' + )) + ) { + fields.push(tsPropertySignature( + t.identifier('$typeUrl'), + t.tsTypeAnnotation(t.tsStringKeyword()), + true + )); + } + + // if ( + // context.pluginValue('prototypes.addTypeUrlToDecoders') && + // context.pluginValue('interfaces.enabled') && + // proto.options?.['(cosmos_proto.implements_interface)'] + // ) { + // fields.push(tsPropertySignature( + // t.identifier('$typeUrl'), + // t.tsTypeAnnotation(t.tsStringKeyword()), + // true + // )); + // } + + [].push.apply(fields, Object.keys(proto.fields).reduce((m, fieldName) => { + const isOneOf = oneOfs.includes(fieldName); + const field = proto.fields[fieldName]; + + // optionalityMap is coupled to API requests + const orig = field.options?.['(telescope:orig)'] ?? fieldName; + let optional = false; + if (optionalityMap[orig]) { + optional = true; + } + + let fieldNameWithCase = options.useOriginalCase ? orig : fieldName; + + const propSig = tsPropertySignature( + t.identifier(fieldNameWithCase), + t.tsTypeAnnotation( + getProtoField(context, field, options) + ), + optional || getFieldOptionality(context, field, isOneOf) + ); + + const comments = []; + if ( + field.comment && + // no comment for derivative types + (!options.typeNamePrefix && !options.typeNameSuffix) + ) { + comments.push( + makeCommentBlock(field.comment) + ); + } + if (field.options?.deprecated) { + comments.push( + makeCommentBlock('@deprecated') + ); + } + if (comments.length) { + propSig.leadingComments = comments; + } + + m.push(propSig) + return m; + }, [])); + // declaration const declaration = t.exportNamedDeclaration(t.tsInterfaceDeclaration( t.identifier(MsgName), null, [], t.tsInterfaceBody( - Object.keys(proto.fields).reduce((m, fieldName) => { - const isOneOf = oneOfs.includes(fieldName); - const field = proto.fields[fieldName]; - - // optionalityMap is coupled to API requests - const orig = field.options?.['(telescope:orig)'] ?? fieldName; - let optional = false; - if (optionalityMap[orig]) { - optional = true; - } - - const fieldNameWithCase = options.useOriginalCase ? orig : fieldName; - - const propSig = tsPropertySignature( - t.identifier(fieldNameWithCase), - t.tsTypeAnnotation( - getProtoField(context, field, options) - ), - optional || getFieldOptionality(context, field, isOneOf) - ); - - const comments = []; - if (field.comment) { - comments.push( - makeCommentBlock(field.comment) - ); - } - if (field.options?.deprecated) { - comments.push( - makeCommentBlock('@deprecated') - ); - } - if (comments.length) { - propSig.leadingComments = comments; - } - - m.push(propSig) - return m; - }, []) + fields ) )); @@ -166,7 +217,38 @@ export const createCreateProtoType = ( ) => { const oneOfs = getOneOfs(proto); - const fields = Object.keys(proto.fields).map(key => { + const fields = []; + + if ( + context.pluginValue('prototypes.addTypeUrlToDecoders') && + (( + context.pluginValue('interfaces.enabled') && + proto.options?.['(cosmos_proto.implements_interface)'] + ) || + ( + context.ref.proto.package === 'google.protobuf' + && name === 'Any' + )) + ) { + const typeUrl = getTypeUrlWithPkgAndName(context.ref.proto.package, name); + fields.push(t.objectProperty( + t.identifier('$typeUrl'), + t.stringLiteral(typeUrl) + )); + } + // if ( + // context.pluginValue('prototypes.addTypeUrlToDecoders') && + // context.pluginValue('interfaces.enabled') && + // proto.options?.['(cosmos_proto.implements_interface)'] + // ) { + // const typeUrl = getTypeUrlWithPkgAndName(context.ref.proto.package, name); + // fields.push(t.objectProperty( + // t.identifier('$typeUrl'), + // t.stringLiteral(typeUrl) + // )); + // } + + [].push.apply(fields, Object.keys(proto.fields).map(key => { const isOneOf = oneOfs.includes(key); const isOptional = getFieldOptionality(context, proto.fields[key], isOneOf) return { @@ -181,7 +263,7 @@ export const createCreateProtoType = ( t.identifier(field.name), getDefaultTSTypeFromProtoType(context, field, field.isOneOf) ) - }) + })); return functionDeclaration(t.identifier(getBaseCreateTypeFuncName(name)), diff --git a/packages/ast/src/encoding/proto/interface/sdk.ts b/packages/ast/src/encoding/proto/interface/sdk.ts index dc6e28a373..186b707624 100644 --- a/packages/ast/src/encoding/proto/interface/sdk.ts +++ b/packages/ast/src/encoding/proto/interface/sdk.ts @@ -1,7 +1,7 @@ import { ProtoEnum, ProtoType } from '@osmonauts/types'; import { ProtoParseContext } from '../../context'; import { createProtoEnum } from '../enums'; -import { createProtoType } from './interface'; +import { createProtoType } from './proto'; import * as t from '@babel/types'; export const createSDKType = ( diff --git a/packages/ast/src/encoding/proto/interfaces-amino.test.ts b/packages/ast/src/encoding/proto/interfaces-amino.test.ts new file mode 100644 index 0000000000..e90683acbe --- /dev/null +++ b/packages/ast/src/encoding/proto/interfaces-amino.test.ts @@ -0,0 +1,18 @@ +import { getNestedProto } from '@osmonauts/proto-parser'; +import { ProtoParseContext } from '@osmonauts/ast'; +import { expectCode, getTestProtoStore } from '../../../test-utils'; +import { createObjectWithMethods } from '../object'; + +const store = getTestProtoStore(); +store.options.aminoEncoding.useRecursiveV2encoding = true; +store.options.interfaces.enabled = true; +store.traverseAll(); + +it('MsgSubmitProposal', async () => { + const ref = store.findProto('cosmos/gov/v1beta1/tx.proto'); + const context = new ProtoParseContext(ref, store, store.options); + expectCode(createObjectWithMethods( + context, + 'MsgSubmitProposal', getNestedProto(ref.traversed).MsgSubmitProposal + )) +}); \ No newline at end of file diff --git a/packages/ast/src/encoding/proto/proto.type.implements.spec.ts b/packages/ast/src/encoding/proto/proto.type.implements.spec.ts new file mode 100644 index 0000000000..ec74487f1f --- /dev/null +++ b/packages/ast/src/encoding/proto/proto.type.implements.spec.ts @@ -0,0 +1,51 @@ +import { createProtoType, createCreateProtoType } from './interface'; + +import { getNestedProto } from '@osmonauts/proto-parser' +import { ProtoParseContext } from '../context'; +import { getTestProtoStore, expectCode, printCode } from '../../../test-utils'; + + +describe('Cast', () => { + const implementsStore = getTestProtoStore(); + implementsStore.options.aminoEncoding.useRecursiveV2encoding = true; + implementsStore.options.prototypes.addTypeUrlToDecoders = true; + implementsStore.options.interfaces.enabled = true; + implementsStore.traverseAll(); + + it('standard', async () => { + const ref = implementsStore.findProto('osmosis/gamm/v1beta1/query.proto'); + const context = new ProtoParseContext(ref, implementsStore, implementsStore.options); + // printCode(createProtoType(context, 'QueryPoolResponse', getNestedProto(ref.traversed).QueryPoolResponse)); + expectCode(createProtoType(context, 'QueryPoolResponse', getNestedProto(ref.traversed).QueryPoolResponse)); + }); + + it('repeated', async () => { + const ref = implementsStore.findProto('osmosis/gamm/v1beta1/query.proto'); + const context = new ProtoParseContext(ref, implementsStore, implementsStore.options); + // printCode(createProtoType(context, 'QueryPoolsResponse', getNestedProto(ref.traversed).QueryPoolsResponse)); + expectCode(createProtoType(context, 'QueryPoolsResponse', getNestedProto(ref.traversed).QueryPoolsResponse)); + }); +}) + + +describe('Any', () => { + const standardStore = getTestProtoStore(); + standardStore.options.aminoEncoding.useRecursiveV2encoding = false; + standardStore.options.prototypes.addTypeUrlToDecoders = false; + standardStore.options.interfaces.enabled = false; + standardStore.traverseAll(); + + it('standard', async () => { + const ref = standardStore.findProto('osmosis/gamm/v1beta1/query.proto'); + const context = new ProtoParseContext(ref, standardStore, standardStore.options); + // printCode(createProtoType(context, 'QueryPoolResponse', getNestedProto(ref.traversed).QueryPoolResponse)); + expectCode(createProtoType(context, 'QueryPoolResponse', getNestedProto(ref.traversed).QueryPoolResponse)); + }); + + it('repeated', async () => { + const ref = standardStore.findProto('osmosis/gamm/v1beta1/query.proto'); + const context = new ProtoParseContext(ref, standardStore, standardStore.options); + // printCode(createProtoType(context, 'QueryPoolsResponse', getNestedProto(ref.traversed).QueryPoolsResponse)); + expectCode(createProtoType(context, 'QueryPoolsResponse', getNestedProto(ref.traversed).QueryPoolsResponse)); + }); +}) diff --git a/packages/ast/src/encoding/proto/to-amino/utils.ts b/packages/ast/src/encoding/proto/to-amino/utils.ts index 2e90c911e4..99e23b9eb1 100644 --- a/packages/ast/src/encoding/proto/to-amino/utils.ts +++ b/packages/ast/src/encoding/proto/to-amino/utils.ts @@ -3,6 +3,7 @@ import { ProtoType } from '@osmonauts/types'; import { BILLION } from '../../../utils'; import { ProtoParseContext } from '../../context'; import { getFieldNames } from '../../types'; +import { getInterfaceToAminoName } from '../implements'; import { ToAminoJSONMethod } from './index'; const notUndefinedSetValue = (sdkName: string, msgName: string, expr: t.Expression) => { @@ -131,7 +132,7 @@ export const toAminoJSON = { return toAminoJSON.long(args); }, - type(args: ToAminoJSONMethod) { + protoType(args: ToAminoJSONMethod) { const { propName, origName } = getFieldNames(args.field); const name = args.context.getTypeName(args.field); @@ -165,6 +166,59 @@ export const toAminoJSON = { ); }, + anyType(args: ToAminoJSONMethod) { + const { propName, origName } = getFieldNames(args.field); + // const typeMap = args.context.store.getTypeUrlMap(args.context.ref); + // console.log(JSON.stringify(typeMap, null, 2)); + // console.log(JSON.stringify(args.field, null, 2)); + const interfaceName = args.field.options['(cosmos_proto.accepts_interface)']; + const interfaceFnName = getInterfaceToAminoName(interfaceName) + + return t.expressionStatement( + t.assignmentExpression( + '=', + t.memberExpression( + t.identifier('obj'), + t.identifier(origName) + ), + t.conditionalExpression( + t.memberExpression( + t.identifier('message'), + t.identifier(propName) + ), + t.callExpression( + t.identifier(interfaceFnName), + [ + t.tsAsExpression( + t.memberExpression( + t.identifier('message'), + t.identifier(propName) + ), + t.tsTypeReference( + t.identifier('Any') + ) + ) + ] + ), + t.identifier('undefined') + ) + ) + ); + }, + + type(args: ToAminoJSONMethod) { + if ( + args.context.options.aminoEncoding.useRecursiveV2encoding == true && + args.context.options.interfaces.enabled == true && + args.field.type === 'google.protobuf.Any' && + args.field.options['(cosmos_proto.accepts_interface)'] + + ) { + return toAminoJSON.anyType(args); + } + return toAminoJSON.protoType(args); + }, + enum(args: ToAminoJSONMethod) { const { propName, origName } = getFieldNames(args.field); @@ -425,7 +479,30 @@ export const arrayTypes = { ] ); }, - type(args: ToAminoJSONMethod) { + anyType(args: ToAminoJSONMethod) { + const { propName, origName } = getFieldNames(args.field); + // const typeMap = args.context.store.getTypeUrlMap(args.context.ref); + // console.log(JSON.stringify(typeMap, null, 2)); + // console.log(JSON.stringify(args.field, null, 2)); + const interfaceName = args.field.options['(cosmos_proto.accepts_interface)']; + const interfaceFnName = getInterfaceToAminoName(interfaceName) + return t.conditionalExpression( + t.identifier('e'), + t.callExpression( + t.identifier(interfaceFnName), + [ + t.tsAsExpression( + t.identifier('e'), + t.tsTypeReference( + t.identifier('Any') + ) + ) + ] + ), + t.identifier('undefined') + ); + }, + protoType(args: ToAminoJSONMethod) { const name = args.context.getTypeName(args.field); return t.conditionalExpression( t.identifier('e'), @@ -440,6 +517,18 @@ export const arrayTypes = { ), t.identifier('undefined') ); + }, + type(args: ToAminoJSONMethod) { + if ( + args.context.options.aminoEncoding.useRecursiveV2encoding == true && + args.context.options.interfaces.enabled == true && + args.field.type === 'google.protobuf.Any' && + args.field.options['(cosmos_proto.accepts_interface)'] + + ) { + return arrayTypes.anyType(args); + } + return arrayTypes.protoType(args); } } diff --git a/packages/ast/src/encoding/types.ts b/packages/ast/src/encoding/types.ts index a95b47ce71..7a34dce440 100644 --- a/packages/ast/src/encoding/types.ts +++ b/packages/ast/src/encoding/types.ts @@ -1,5 +1,5 @@ import * as t from '@babel/types'; -import { ProtoField } from '@osmonauts/types'; +import { ProtoField, TelescopeLogLevel } from '@osmonauts/types'; import { getProtoFieldTypeName } from '../utils'; import { GenericParseContext, ProtoParseContext } from './context'; import { getFieldOptionalityForDefaults, GOOGLE_TYPES, SCALAR_TYPES } from './proto'; @@ -43,7 +43,9 @@ export const getFieldTypeReference = ( // return on scalar typ = getTSTypeForProto(context, field); - return typ; + return { + ast: typ + }; } else if (GOOGLE_TYPES.includes(field.type)) { typ = getTSTypeFromGoogleType(context, field.type, options); @@ -53,12 +55,49 @@ export const getFieldTypeReference = ( typ = t.tsTypeReference(t.identifier(MsgName)); } - if ( - field.parsedType?.type === 'Type' && + const implementsAcceptsAny = context.pluginValue('interfaces.enabled'); + const lookupInterface = field.options?.['(cosmos_proto.accepts_interface)']; + const isAnyType = field.parsedType?.type === 'Type' && field.parsedType?.name === 'Any'; + const isArray = field.rule === 'repeated'; + const isBaseType = !options.typeNamePrefix && !options.typeNameSuffix; + let symbols = null; + if (implementsAcceptsAny && lookupInterface) { + symbols = context.store._symbols.filter(s => s.implementsType === lookupInterface && s.ref === context.ref.filename); + if (!symbols.length && context.options.logLevel >= TelescopeLogLevel.Warn) { + console.warn(`[WARN] ${lookupInterface} is accepted but not implemented`); + } + } + + // cast Any types! + const isTypeCastable = isAnyType && lookupInterface && implementsAcceptsAny && symbols && isBaseType; + const isNonArrayNullableType = field.parsedType?.type === 'Type' && field.rule !== 'repeated' && - context.pluginValue('prototypes.allowUndefinedTypes') - ) { - // NOTE: unfortunately bc of defaults... + context.pluginValue('prototypes.allowUndefinedTypes'); + + if (isTypeCastable) { + const tp = symbols.map(a => t.tsTypeReference(t.identifier(a.readAs))); + tp.push(typ); + + if (context.pluginValue('interfaces.useUnionTypes')) { + if (!isArray) { + tp.push(t.tsUndefinedKeyword()) + } + ast = t.tsUnionType(tp) + } else { + // intersections + if (isArray) { + ast = t.tsIntersectionType(tp); + } else { + ast = t.tsUnionType( + [ + t.tsIntersectionType(tp), + t.tsUndefinedKeyword() + ] + ) + } + } + } else if (isNonArrayNullableType) { + // regular types! ast = t.tsUnionType( [ typ, @@ -69,7 +108,7 @@ export const getFieldTypeReference = ( ast = typ; } - return ast; + return { ast, isTypeCastableAnyType: isTypeCastable }; } export const getFieldAminoTypeReference = ( @@ -243,6 +282,7 @@ export const getDefaultTSTypeFromProtoType = ( } if (field.parsedType?.type === 'Enum') { + // @ts-ignore if (context.ref.proto?.syntax === 'proto2') { return t.numericLiteral(1); } diff --git a/packages/ast/src/index.ts b/packages/ast/src/index.ts index 4d859189cf..c05ec03a15 100644 --- a/packages/ast/src/index.ts +++ b/packages/ast/src/index.ts @@ -4,4 +4,5 @@ export * from './registry'; export * from './utils'; export * from './bundle'; export * from './state'; +export * from './plugins'; export * from './types'; \ No newline at end of file diff --git a/packages/ast/test-utils/index.ts b/packages/ast/test-utils/index.ts index 45391d1092..563aa5600d 100644 --- a/packages/ast/test-utils/index.ts +++ b/packages/ast/test-utils/index.ts @@ -39,7 +39,7 @@ const defaultTelescopeOptionsForTesting = { export const defaultTelescopeOptions = deepmerge(teleDefaults, defaultTelescopeOptionsForTesting); export const getTestProtoStore = (options?: TelescopeOptions) => { - const store = new ProtoStore([__dirname + '/../../../__fixtures__/chain1'], options ? deepmerge(defaultTelescopeOptions, options) : defaultTelescopeOptions); + const store = new ProtoStore([__dirname + '/../../../__fixtures__/chain1'], options ? deepmerge(defaultTelescopeOptions, options) : deepmerge(defaultTelescopeOptions, {})); return store; } diff --git a/packages/ast/types/src/clients/lcd/class/template-tags.d.ts b/packages/ast/types/src/clients/lcd/class/template-tags.d.ts deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/packages/ast/types/src/encoding/amino/utils.d.ts b/packages/ast/types/src/encoding/amino/utils.d.ts index 9fa8333d31..e673cf38cf 100644 --- a/packages/ast/types/src/encoding/amino/utils.d.ts +++ b/packages/ast/types/src/encoding/amino/utils.d.ts @@ -1,8 +1,9 @@ import { ProtoAny, ProtoRoot, ProtoType } from '@osmonauts/types'; import { GenericParseContext } from '../context'; +export declare const getTypeUrlWithPkgAndName: (pkg: string, name: string) => string; export declare const getTypeUrl: (root: ProtoRoot, proto: ProtoAny | ProtoType) => string; export declare const arrayTypeNDim: (body: any, n: any) => any; -export declare const typeUrlToAmino: (context: GenericParseContext, typeUrl: string) => any; +export declare const getAminoTypeName: (context: GenericParseContext, root: ProtoRoot, proto: ProtoType) => any; export declare const protoFieldsToArray: (proto: ProtoType) => { type?: string; name: string; diff --git a/packages/ast/types/src/encoding/context.d.ts b/packages/ast/types/src/encoding/context.d.ts index 965abdfcdf..8fa52b0a80 100644 --- a/packages/ast/types/src/encoding/context.d.ts +++ b/packages/ast/types/src/encoding/context.d.ts @@ -23,15 +23,16 @@ export declare class GenericParseContext implements ParseContext { isExcluded(): any; addUtil(util: any): void; addImport(imp: ImportUsage): void; + getTypeNameFromFieldName(name: string, importSrc: string): string; getTypeName(field: ProtoField): string; + lookupTypeFromCurrentPath(field: ProtoField, currentProtoPath: string): import("@osmonauts/proto-parser").Lookup; + getTypeFromCurrentPath(field: ProtoField, currentProtoPath: string): any; } export declare class AminoParseContext extends GenericParseContext implements ParseContext { aminoCasingFn: Function; constructor(ref: ProtoRef, store: ProtoStore, options: TelescopeOptions); private setAminoCasingFn; aminoCaseField(field: ProtoField): string; - private lookupTypeFromCurrentPath; - getTypeFromCurrentPath(field: ProtoField, currentProtoPath: string): any; lookupEnumFromJson(field: ProtoField, currentProtoPath: string): string; lookupEnumToJson(field: ProtoField, currentProtoPath: string): string; } diff --git a/packages/ast/types/src/encoding/proto/decode/utils.d.ts b/packages/ast/types/src/encoding/proto/decode/utils.d.ts index 96fffc91e9..4700157906 100644 --- a/packages/ast/types/src/encoding/proto/decode/utils.d.ts +++ b/packages/ast/types/src/encoding/proto/decode/utils.d.ts @@ -40,7 +40,9 @@ export declare const baseTypes: { uint64(args: DecodeMethod): t.TSAsExpression; fixed64(args: DecodeMethod): t.TSAsExpression; sfixed64(args: DecodeMethod): t.TSAsExpression; - type(args: DecodeMethod): t.CallExpression; + protoType(args: DecodeMethod): t.CallExpression; + anyType(args: DecodeMethod): t.TSAsExpression; + type(args: DecodeMethod): t.CallExpression | t.TSAsExpression; enum(args: DecodeMethod): t.TSAsExpression; bytes(args: DecodeMethod): t.CallExpression; durationString(args: DecodeMethod): t.CallExpression; @@ -50,6 +52,7 @@ export declare const baseTypes: { }; export declare const switchOnTag: (num: number, prop: string, expr: t.Expression) => t.SwitchCase; export declare const switchOnTagTakesArray: (num: number, prop: string, expr: t.Statement[]) => t.SwitchCase; -export declare const switchTypeArray: (num: number, prop: string, name: string) => t.SwitchCase; +export declare const switchProtoTypeArray: (num: number, prop: string, name: string) => t.SwitchCase; +export declare const switchAnyTypeArray: (num: number, prop: string, name: string) => t.SwitchCase; export declare const switchTagDelimArray: (num: number, prop: string, expr: t.Expression) => t.SwitchCase; export declare const switchArray: (num: number, prop: string, expr: t.Expression) => t.SwitchCase; diff --git a/packages/ast/types/src/encoding/proto/encode/utils.d.ts b/packages/ast/types/src/encoding/proto/encode/utils.d.ts index 9d32acff37..abccf57627 100644 --- a/packages/ast/types/src/encoding/proto/encode/utils.d.ts +++ b/packages/ast/types/src/encoding/proto/encode/utils.d.ts @@ -42,7 +42,7 @@ export declare const types: { fixed64(num: number, prop: string, isOptional: boolean): t.IfStatement; sfixed64(num: number, prop: string, isOptional: boolean): t.IfStatement; bool(num: number, prop: string, isOptional: boolean): t.IfStatement; - type(num: number, prop: string, name: string): t.IfStatement; + type(num: number, prop: string, name: string, isAnyType: boolean): t.IfStatement; enum(context: ProtoParseContext, num: number, field: ProtoField, isOptional: boolean, isOneOf: boolean): t.IfStatement; bytes(num: number, prop: string, isOptional: boolean): t.IfStatement; timestamp(num: number, prop: string): t.Statement; @@ -50,7 +50,7 @@ export declare const types: { duration(num: number, prop: string): t.IfStatement; forkDelimArray(num: number, prop: string, expr: t.Statement): (t.ExpressionStatement | t.ForOfStatement)[]; array(num: number, prop: string, expr: t.Statement): t.ForOfStatement[]; - typeArray(num: number, prop: string, name: string): t.ForOfStatement[]; + typeArray(num: number, prop: string, name: string, isAnyType: boolean): t.ForOfStatement[]; keyHash(num: number, prop: string, name: string): t.ExpressionStatement; }; export declare const arrayTypes: { diff --git a/packages/ast/types/src/encoding/proto/from-amino/utils.d.ts b/packages/ast/types/src/encoding/proto/from-amino/utils.d.ts index 6c835f65a8..cd3e3d02e8 100644 --- a/packages/ast/types/src/encoding/proto/from-amino/utils.d.ts +++ b/packages/ast/types/src/encoding/proto/from-amino/utils.d.ts @@ -20,6 +20,8 @@ export declare const fromAminoJSON: { sint64(args: FromAminoJSONMethod): t.ObjectProperty; fixed64(args: FromAminoJSONMethod): t.ObjectProperty; sfixed64(args: FromAminoJSONMethod): t.ObjectProperty; + protoType(args: FromAminoJSONMethod): t.ObjectProperty; + anyType(args: FromAminoJSONMethod): t.ObjectProperty; type(args: FromAminoJSONMethod): t.ObjectProperty; enum(args: FromAminoJSONMethod): t.ObjectProperty; bytes(args: FromAminoJSONMethod): t.ObjectProperty; @@ -48,6 +50,8 @@ export declare const arrayTypes: { double(): t.Identifier; float(): t.Identifier; enum(args: FromAminoJSONMethod): t.CallExpression; + anyType(args: FromAminoJSONMethod): t.CallExpression; + protoType(args: FromAminoJSONMethod): t.CallExpression; type(args: FromAminoJSONMethod): t.CallExpression; }; export declare const fromAminoMessages: { diff --git a/packages/ast/types/src/clients/lcd/scoped/scoped.rpc.test.d.ts b/packages/ast/types/src/encoding/proto/implements/__tests__/interface-decoder.test.d.ts similarity index 100% rename from packages/ast/types/src/clients/lcd/scoped/scoped.rpc.test.d.ts rename to packages/ast/types/src/encoding/proto/implements/__tests__/interface-decoder.test.d.ts diff --git a/packages/ast/types/src/encoding/proto/implements/__tests__/interface-from-amino.test.d.ts b/packages/ast/types/src/encoding/proto/implements/__tests__/interface-from-amino.test.d.ts new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/packages/ast/types/src/encoding/proto/implements/__tests__/interface-from-amino.test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/packages/ast/types/src/encoding/proto/implements/__tests__/interface-to-amino.test.d.ts b/packages/ast/types/src/encoding/proto/implements/__tests__/interface-to-amino.test.d.ts new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/packages/ast/types/src/encoding/proto/implements/__tests__/interface-to-amino.test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/packages/ast/types/src/encoding/proto/implements/decoder.d.ts b/packages/ast/types/src/encoding/proto/implements/decoder.d.ts new file mode 100644 index 0000000000..6d250fde83 --- /dev/null +++ b/packages/ast/types/src/encoding/proto/implements/decoder.d.ts @@ -0,0 +1,6 @@ +import * as t from '@babel/types'; +import { ProtoRef, TraverseTypeUrlRef } from '@osmonauts/types'; +import { ProtoParseContext } from "../../context"; +export declare const getInterfaceDecoderName: (str: string) => string; +export declare const createInterfaceDecoder: (context: ProtoParseContext, ref: ProtoRef, interfaceName: string) => t.ExportNamedDeclaration; +export declare const createInterfaceDecoderHelper: (context: ProtoParseContext, functionName: string, typeRefs: TraverseTypeUrlRef[]) => t.ExportNamedDeclaration; diff --git a/packages/ast/types/src/encoding/proto/implements/from-amino.d.ts b/packages/ast/types/src/encoding/proto/implements/from-amino.d.ts new file mode 100644 index 0000000000..6879d416d2 --- /dev/null +++ b/packages/ast/types/src/encoding/proto/implements/from-amino.d.ts @@ -0,0 +1,6 @@ +import * as t from '@babel/types'; +import { ProtoRef, TraverseTypeUrlRef } from '@osmonauts/types'; +import { ProtoParseContext } from "../../context"; +export declare const getInterfaceFromAminoName: (str: string) => string; +export declare const createInterfaceFromAmino: (context: ProtoParseContext, ref: ProtoRef, interfaceName: string) => t.ExportNamedDeclaration; +export declare const createInterfaceFromAminoHelper: (context: ProtoParseContext, functionName: string, typeRefs: TraverseTypeUrlRef[]) => t.ExportNamedDeclaration; diff --git a/packages/ast/types/src/encoding/proto/implements/index.d.ts b/packages/ast/types/src/encoding/proto/implements/index.d.ts new file mode 100644 index 0000000000..9522d79ab9 --- /dev/null +++ b/packages/ast/types/src/encoding/proto/implements/index.d.ts @@ -0,0 +1,3 @@ +export * from './decoder'; +export * from './to-amino'; +export * from './from-amino'; diff --git a/packages/ast/types/src/encoding/proto/implements/to-amino.d.ts b/packages/ast/types/src/encoding/proto/implements/to-amino.d.ts new file mode 100644 index 0000000000..d7609d2893 --- /dev/null +++ b/packages/ast/types/src/encoding/proto/implements/to-amino.d.ts @@ -0,0 +1,6 @@ +import * as t from '@babel/types'; +import { ProtoRef, TraverseTypeUrlRef } from '@osmonauts/types'; +import { ProtoParseContext } from "../../context"; +export declare const getInterfaceToAminoName: (str: string) => string; +export declare const createInterfaceToAmino: (context: ProtoParseContext, ref: ProtoRef, interfaceName: string) => t.ExportNamedDeclaration; +export declare const createInterfaceToAminoHelper: (context: ProtoParseContext, functionName: string, typeRefs: TraverseTypeUrlRef[]) => t.ExportNamedDeclaration; diff --git a/packages/ast/types/src/encoding/proto/index.d.ts b/packages/ast/types/src/encoding/proto/index.d.ts index f5728e5276..a991358fe4 100644 --- a/packages/ast/types/src/encoding/proto/index.d.ts +++ b/packages/ast/types/src/encoding/proto/index.d.ts @@ -1,12 +1,13 @@ export * from './decode'; export * from './encode'; export * from './enums'; -export * from './types'; -export * from './from-json'; -export * from './from-sdk'; export * from './from-amino'; +export * from './from-json'; export * from './from-partial'; +export * from './from-sdk'; +export * from './implements'; +export * from './interface'; +export * from './to-amino'; export * from './to-json'; export * from './to-sdk'; -export * from './to-amino'; -export * from './interface'; +export * from './types'; diff --git a/packages/ast/types/src/encoding/proto/interface/__tests__/google.proto.any.test.d.ts b/packages/ast/types/src/encoding/proto/interface/__tests__/google.proto.any.test.d.ts new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/packages/ast/types/src/encoding/proto/interface/__tests__/google.proto.any.test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/packages/ast/types/src/encoding/proto/interface/index.d.ts b/packages/ast/types/src/encoding/proto/interface/index.d.ts index 01f5d73d83..baa54a3649 100644 --- a/packages/ast/types/src/encoding/proto/interface/index.d.ts +++ b/packages/ast/types/src/encoding/proto/interface/index.d.ts @@ -1,3 +1,3 @@ -export * from './interface'; +export * from './proto'; export * from './sdk'; export * from './amino'; diff --git a/packages/ast/types/src/encoding/proto/interface/interface.d.ts b/packages/ast/types/src/encoding/proto/interface/proto.d.ts similarity index 100% rename from packages/ast/types/src/encoding/proto/interface/interface.d.ts rename to packages/ast/types/src/encoding/proto/interface/proto.d.ts diff --git a/packages/ast/types/src/encoding/proto/interfaces-amino.test.d.ts b/packages/ast/types/src/encoding/proto/interfaces-amino.test.d.ts new file mode 100644 index 0000000000..cb0ff5c3b5 --- /dev/null +++ b/packages/ast/types/src/encoding/proto/interfaces-amino.test.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/packages/ast/types/src/encoding/proto/to-amino/utils.d.ts b/packages/ast/types/src/encoding/proto/to-amino/utils.d.ts index 39d6214978..ee67ce8039 100644 --- a/packages/ast/types/src/encoding/proto/to-amino/utils.d.ts +++ b/packages/ast/types/src/encoding/proto/to-amino/utils.d.ts @@ -20,6 +20,8 @@ export declare const toAminoJSON: { sint64(args: ToAminoJSONMethod): t.ExpressionStatement; fixed64(args: ToAminoJSONMethod): t.ExpressionStatement; sfixed64(args: ToAminoJSONMethod): t.ExpressionStatement; + protoType(args: ToAminoJSONMethod): t.ExpressionStatement; + anyType(args: ToAminoJSONMethod): t.ExpressionStatement; type(args: ToAminoJSONMethod): t.ExpressionStatement; enum(args: ToAminoJSONMethod): t.ExpressionStatement; bytes(args: ToAminoJSONMethod): t.ExpressionStatement; @@ -48,6 +50,8 @@ export declare const arrayTypes: { sfixed64(args: ToAminoJSONMethod): t.Identifier; bytes(args: ToAminoJSONMethod): t.Identifier; enum(args: ToAminoJSONMethod): t.CallExpression; + anyType(args: ToAminoJSONMethod): t.ConditionalExpression; + protoType(args: ToAminoJSONMethod): t.ConditionalExpression; type(args: ToAminoJSONMethod): t.ConditionalExpression; }; export declare const toAminoMessages: { diff --git a/packages/ast/types/src/index.d.ts b/packages/ast/types/src/index.d.ts index 6db2bbe63b..3b4bd2228a 100644 --- a/packages/ast/types/src/index.d.ts +++ b/packages/ast/types/src/index.d.ts @@ -4,4 +4,5 @@ export * from './registry'; export * from './utils'; export * from './bundle'; export * from './state'; +export * from './plugins'; export * from './types'; diff --git a/packages/ast/types/test-utils/index.d.ts b/packages/ast/types/test-utils/index.d.ts index b01eb3dc90..415dd55115 100644 --- a/packages/ast/types/test-utils/index.d.ts +++ b/packages/ast/types/test-utils/index.d.ts @@ -11,6 +11,10 @@ export declare const defaultTelescopeOptions: { useSDKTypes: boolean; includeExternalHelpers: boolean; logLevel: import("@osmonauts/types").TelescopeLogLevel; + interfaces: { + enabled?: boolean; + useUnionTypes?: boolean; + }; prototypes: { enabled?: boolean; parser?: { @@ -33,6 +37,7 @@ export declare const defaultTelescopeOptions: { allowUndefinedTypes?: boolean; optionalQueryParams?: boolean; optionalPageRequests?: boolean; + addTypeUrlToDecoders?: boolean; excluded?: { packages?: string[]; protos?: string[]; @@ -107,6 +112,11 @@ export declare const defaultTelescopeOptions: { }; reactQuery: { enabled: boolean; + include?: { + patterns?: string[]; + packages?: string[]; + protos?: string[]; + }; }; packages: Record; } & { @@ -128,7 +138,7 @@ export declare const defaultTelescopeOptions: { export declare const getTestProtoStore: (options?: TelescopeOptions) => ProtoStore; export declare const prepareContext: (store: ProtoStore, protoFile: string) => { context: AminoParseContext; - root: import("@osmonauts/types").ProtoRoot; + root: import("@osmonauts/types").TraversedProtoRoot; protos: ProtoType[]; }; export declare const getGenericParseContext: () => GenericParseContext; diff --git a/packages/babel/CHANGELOG.md b/packages/babel/CHANGELOG.md index 847de084a1..fcad1ad149 100644 --- a/packages/babel/CHANGELOG.md +++ b/packages/babel/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.7.0](https://github.com/osmosis-labs/telescope/compare/@osmonauts/babel@0.80.0-rc.1...@osmonauts/babel@0.7.0) (2022-12-18) + + +### Reverts + +* Revert "RC versions ready" ([04081a9](https://github.com/osmosis-labs/telescope/commit/04081a9d1f80feb3ae664bce2d1364850b3daaca)) +* Revert "chore(release): publish" ([086a55f](https://github.com/osmosis-labs/telescope/commit/086a55f14c5ca33ee70a0e2121406dd37eb643f1)) + + + + + # [0.6.0](https://github.com/osmosis-labs/telescope/compare/@osmonauts/babel@0.5.0...@osmonauts/babel@0.6.0) (2022-10-14) **Note:** Version bump only for package @osmonauts/babel diff --git a/packages/babel/package.json b/packages/babel/package.json index 0d8c975412..b1a7292547 100644 --- a/packages/babel/package.json +++ b/packages/babel/package.json @@ -1,6 +1,6 @@ { "name": "@osmonauts/babel", - "version": "0.6.0", + "version": "0.7.0", "description": "Telescope babel helpers", "author": "Dan Lynch ", "homepage": "https://github.com/osmosis-labs/telescope/tree/master/packages/babel#readme", diff --git a/packages/lcd/CHANGELOG.md b/packages/lcd/CHANGELOG.md index 04e1c1e2a2..6e36b70891 100644 --- a/packages/lcd/CHANGELOG.md +++ b/packages/lcd/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.9.0](https://github.com/osmosis-labs/telescope/compare/@osmonauts/lcd@0.80.0-rc.1...@osmonauts/lcd@0.9.0) (2022-12-18) + + +### Reverts + +* Revert "RC versions ready" ([04081a9](https://github.com/osmosis-labs/telescope/commit/04081a9d1f80feb3ae664bce2d1364850b3daaca)) +* Revert "chore(release): publish" ([086a55f](https://github.com/osmosis-labs/telescope/commit/086a55f14c5ca33ee70a0e2121406dd37eb643f1)) + + + + + # [0.8.0](https://github.com/osmosis-labs/telescope/compare/@osmonauts/lcd@0.7.0...@osmonauts/lcd@0.8.0) (2022-10-11) **Note:** Version bump only for package @osmonauts/lcd diff --git a/packages/lcd/package.json b/packages/lcd/package.json index aae4b84c6d..c84d3d0d83 100644 --- a/packages/lcd/package.json +++ b/packages/lcd/package.json @@ -1,6 +1,6 @@ { "name": "@osmonauts/lcd", - "version": "0.8.0", + "version": "0.9.0", "description": "Telescope LCDClient helpers", "author": "Dan Lynch ", "homepage": "https://github.com/osmosis-labs/telescope/tree/master/packages/helpers#readme", diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md index f06b8bb30c..2772b49aa4 100644 --- a/packages/parser/CHANGELOG.md +++ b/packages/parser/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.35.0](https://github.com/osmosis-labs/telescope/compare/@osmonauts/proto-parser@0.80.0-rc.1...@osmonauts/proto-parser@0.35.0) (2022-12-18) + + +### Reverts + +* Revert "RC versions ready" ([04081a9](https://github.com/osmosis-labs/telescope/commit/04081a9d1f80feb3ae664bce2d1364850b3daaca)) +* Revert "chore(release): publish" ([086a55f](https://github.com/osmosis-labs/telescope/commit/086a55f14c5ca33ee70a0e2121406dd37eb643f1)) + + + + + # [0.34.0](https://github.com/osmosis-labs/telescope/compare/@osmonauts/proto-parser@0.33.0...@osmonauts/proto-parser@0.34.0) (2022-11-25) **Note:** Version bump only for package @osmonauts/proto-parser diff --git a/packages/parser/__tests__/__snapshots__/utils.test.ts.snap b/packages/parser/__tests__/__snapshots__/utils.test.ts.snap new file mode 100644 index 0000000000..ff4e5a00dc --- /dev/null +++ b/packages/parser/__tests__/__snapshots__/utils.test.ts.snap @@ -0,0 +1,25 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`empty google/api/expr/conformance/v1alpha1/conformance_service.proto 1`] = `true`; + +exports[`empty osmosis/gamm/v1beta1/query.proto 1`] = `true`; + +exports[`empty osmosis/gamm/v1beta1/tx.proto 1`] = `true`; + +exports[`empty osmosis/gamm/v2/query.proto 1`] = `true`; + +exports[`isRefIncluded google/api/expr/conformance/v1alpha1/conformance_service.proto 1`] = `false`; + +exports[`isRefIncluded osmosis/gamm/v1beta1/query.proto 1`] = `true`; + +exports[`isRefIncluded osmosis/gamm/v1beta1/tx.proto 1`] = `false`; + +exports[`isRefIncluded osmosis/gamm/v2/query.proto 1`] = `true`; + +exports[`pkg google/api/expr/conformance/v1alpha1/conformance_service.proto 1`] = `false`; + +exports[`pkg osmosis/gamm/v1beta1/query.proto 1`] = `true`; + +exports[`pkg osmosis/gamm/v1beta1/tx.proto 1`] = `true`; + +exports[`pkg osmosis/gamm/v2/query.proto 1`] = `false`; diff --git a/packages/parser/__tests__/implements/__snapshots__/traverse.implements.any.test.ts.snap b/packages/parser/__tests__/implements/__snapshots__/traverse.implements.any.test.ts.snap new file mode 100644 index 0000000000..e85002b2e9 --- /dev/null +++ b/packages/parser/__tests__/implements/__snapshots__/traverse.implements.any.test.ts.snap @@ -0,0 +1,197 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`implementsAcceptsAny 1`] = ` +[ + { + "readAs": "Any", + "ref": "google/protobuf/any.proto", + "source": "google/protobuf/any.proto", + "symbolName": "Any", + "type": "export", + }, + { + "readAs": "Dog", + "ref": "cosmology/example/dog1.proto", + "source": "cosmology/example/dog1.proto", + "symbolName": "Dog", + "type": "export", + }, + { + "readAs": "Dog", + "ref": "cosmology/example/dog2.proto", + "source": "cosmology/example/dog2.proto", + "symbolName": "Dog", + "type": "export", + }, + { + "readAs": "Dog", + "ref": "cosmology/example/dog3.proto", + "source": "cosmology/example/dog3.proto", + "symbolName": "Dog", + "type": "export", + }, + { + "readAs": "Cat", + "ref": "cosmology/example/cat.proto", + "source": "cosmology/example/cat.proto", + "symbolName": "Cat", + "type": "export", + }, + { + "readAs": "QueryAnimalsRequest", + "ref": "cosmology/example/animal.proto", + "source": "cosmology/example/animal.proto", + "symbolName": "QueryAnimalsRequest", + "type": "export", + }, + { + "readAs": "QueryDog1Request", + "ref": "cosmology/example/animal.proto", + "source": "cosmology/example/animal.proto", + "symbolName": "QueryDog1Request", + "type": "export", + }, + { + "readAs": "QueryDog2Request", + "ref": "cosmology/example/animal.proto", + "source": "cosmology/example/animal.proto", + "symbolName": "QueryDog2Request", + "type": "export", + }, + { + "readAs": "Dog", + "ref": "cosmology/example/animal.proto", + "source": "cosmology/example/animal.proto", + "symbolName": "Dog", + "type": "export", + }, + { + "readAs": "Any", + "ref": "cosmology/example/animal.proto", + "source": "google/protobuf/any.proto", + "symbolName": "Any", + "type": "import", + }, + { + "implementsType": "AnimalI", + "readAs": "Dog1", + "ref": "cosmology/example/animal.proto", + "source": "cosmology/example/dog1.proto", + "symbolName": "Dog", + "type": "import", + }, + { + "implementsType": "AnimalI", + "readAs": "Dog2", + "ref": "cosmology/example/animal.proto", + "source": "cosmology/example/dog2.proto", + "symbolName": "Dog", + "type": "import", + }, + { + "implementsType": "AnimalI", + "readAs": "Dog3", + "ref": "cosmology/example/animal.proto", + "source": "cosmology/example/dog3.proto", + "symbolName": "Dog", + "type": "import", + }, + { + "implementsType": "AnimalI", + "readAs": "Cat", + "ref": "cosmology/example/animal.proto", + "source": "cosmology/example/cat.proto", + "symbolName": "Cat", + "type": "import", + }, +] +`; + +exports[`implementsAcceptsAny=false 1`] = ` +[ + { + "readAs": "Any", + "ref": "google/protobuf/any.proto", + "source": "google/protobuf/any.proto", + "symbolName": "Any", + "type": "export", + }, + { + "readAs": "Dog", + "ref": "cosmology/example/dog1.proto", + "source": "cosmology/example/dog1.proto", + "symbolName": "Dog", + "type": "export", + }, + { + "readAs": "Dog", + "ref": "cosmology/example/dog2.proto", + "source": "cosmology/example/dog2.proto", + "symbolName": "Dog", + "type": "export", + }, + { + "readAs": "Dog", + "ref": "cosmology/example/dog3.proto", + "source": "cosmology/example/dog3.proto", + "symbolName": "Dog", + "type": "export", + }, + { + "readAs": "Cat", + "ref": "cosmology/example/cat.proto", + "source": "cosmology/example/cat.proto", + "symbolName": "Cat", + "type": "export", + }, + { + "readAs": "QueryAnimalsRequest", + "ref": "cosmology/example/animal.proto", + "source": "cosmology/example/animal.proto", + "symbolName": "QueryAnimalsRequest", + "type": "export", + }, + { + "readAs": "QueryDog1Request", + "ref": "cosmology/example/animal.proto", + "source": "cosmology/example/animal.proto", + "symbolName": "QueryDog1Request", + "type": "export", + }, + { + "readAs": "QueryDog2Request", + "ref": "cosmology/example/animal.proto", + "source": "cosmology/example/animal.proto", + "symbolName": "QueryDog2Request", + "type": "export", + }, + { + "readAs": "Dog", + "ref": "cosmology/example/animal.proto", + "source": "cosmology/example/animal.proto", + "symbolName": "Dog", + "type": "export", + }, + { + "readAs": "Any", + "ref": "cosmology/example/animal.proto", + "source": "google/protobuf/any.proto", + "symbolName": "Any", + "type": "import", + }, + { + "readAs": "Dog1", + "ref": "cosmology/example/animal.proto", + "source": "cosmology/example/dog1.proto", + "symbolName": "Dog", + "type": "import", + }, + { + "readAs": "Dog2", + "ref": "cosmology/example/animal.proto", + "source": "cosmology/example/dog2.proto", + "symbolName": "Dog", + "type": "import", + }, +] +`; diff --git a/packages/parser/__tests__/implements/__snapshots__/traverse.implements.pools.test.ts.snap b/packages/parser/__tests__/implements/__snapshots__/traverse.implements.pools.test.ts.snap new file mode 100644 index 0000000000..5503ca9d11 --- /dev/null +++ b/packages/parser/__tests__/implements/__snapshots__/traverse.implements.pools.test.ts.snap @@ -0,0 +1,32 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`PoolI createMap 1`] = ` +{ + "PoolI": [ + { + "pkg": "osmosis.gamm.v1beta1", + "ref": "osmosis/gamm/pool-models/balancer/balancerPool.proto", + "types": [ + { + "aminoType": "osmosis/gamm/pool", + "importAs": "Pool1", + "type": "Pool", + "typeUrl": "/osmosis.gamm.v1beta1.Pool", + }, + ], + }, + { + "pkg": "osmosis.gamm.poolmodels.stableswap.v1beta1", + "ref": "osmosis/gamm/pool-models/stableswap/stableswap_pool.proto", + "types": [ + { + "aminoType": "osmosis/gamm/pool", + "importAs": "Pool2", + "type": "Pool", + "typeUrl": "/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool", + }, + ], + }, + ], +} +`; diff --git a/packages/parser/__tests__/implements/traverse.implements.any.test.ts b/packages/parser/__tests__/implements/traverse.implements.any.test.ts new file mode 100644 index 0000000000..796f19f6e5 --- /dev/null +++ b/packages/parser/__tests__/implements/traverse.implements.any.test.ts @@ -0,0 +1,106 @@ +import { ProtoRef, ProtoRoot } from '@osmonauts/types'; +import { parseFullyTraversedProtoImports, parseProto, ProtoStore } from '../../src'; +import google_any from '../../src/native/any'; +const getStore = () => { + + const store = new ProtoStore(); + store.protos = []; + const addRef = ({ filename, content }) => { + const ref: ProtoRef = { + absolute: filename, + filename, + proto: parseProto(content) as ProtoRoot + }; + store.protos.push(ref); + }; + const DogTxt = (pkg) => ` +syntax = "proto3"; + +package ${pkg}; +option go_package = "github.com/cosmology-tech/go"; + +message Dog { + option (cosmos_proto.implements_interface) = "AnimalI"; + + string name = 1; + string address = 2; + uint64 id = 3; +} +`; + addRef({ + filename: 'google/protobuf/any.proto', + content: google_any + }); + addRef({ + filename: 'cosmology/example/dog1.proto', + content: DogTxt('cosmology.pkg.one') + }); + addRef({ + filename: 'cosmology/example/dog2.proto', + content: DogTxt('cosmology.pkg.two') + }); + addRef({ + filename: 'cosmology/example/dog3.proto', + content: DogTxt('cosmology.pkg.three') + }); + addRef({ + filename: 'cosmology/example/cat.proto', + content: ` +syntax = "proto3"; +package cosmology.tech; +option go_package = "github.com/cosmology-tech/go"; + +message Cat { + option (cosmos_proto.implements_interface) = "AnimalI"; + + string name = 1; + string address = 2; + uint64 id = 3; +} +`}); + + addRef({ + filename: 'cosmology/example/animal.proto', + content: ` +syntax = "proto3"; +package cosmology.tech; +import "google/protobuf/any.proto"; +import "cosmology/example/dog1.proto"; +import "cosmology/example/dog2.proto"; + +option go_package = "github.com/cosmology-tech/go"; + +message QueryAnimalsRequest { + google.protobuf.Any animal = 1 [ (cosmos_proto.accepts_interface) = "AnimalI" ]; +} +message QueryDog1Request { + cosmology.pkg.one.Dog doggy = 1; +} +message QueryDog2Request { + cosmology.pkg.two.Dog doggy = 1; +} +message Dog { + cosmology.pkg.two.Dog doggy1 = 1; + cosmology.pkg.one.Dog doggy2 = 2; +} +`}); + + return store; +}; + + +it('implementsAcceptsAny', () => { + const store = getStore(); + store.options.interfaces!.enabled = true; + store.traverseAll(); + const symbols = parseFullyTraversedProtoImports(store); + expect(symbols).toMatchSnapshot(); +}); + +it('implementsAcceptsAny=false', () => { + const store = getStore(); + store.options.interfaces!.enabled = false; + store.traverseAll(); + const symbols = parseFullyTraversedProtoImports(store); + expect(symbols).toMatchSnapshot(); +}); diff --git a/packages/parser/__tests__/implements/traverse.implements.pools.test.ts b/packages/parser/__tests__/implements/traverse.implements.pools.test.ts new file mode 100644 index 0000000000..2010fbf7cc --- /dev/null +++ b/packages/parser/__tests__/implements/traverse.implements.pools.test.ts @@ -0,0 +1,39 @@ +import { getTestProtoStore } from '../../test-utils'; + +describe('PoolI', () => { + const store = getTestProtoStore(); + // @ts-ignore + store.options.interfaces.enabled = true; + store.traverseAll(); + const queryRef = store.findProto('osmosis/gamm/v1beta1/query.proto'); + const balancerRef = store.findProto('osmosis/gamm/pool-models/balancer/balancerPool.proto'); + const stableswapRef = store.findProto('osmosis/gamm/pool-models/stableswap/stableswap_pool.proto'); + + it('createMap', () => { + const result = store.getTypeUrlMap( + queryRef + ); + + expect(result).toMatchSnapshot(); + }); + + it('balancerRef', () => { + expect(balancerRef.traversed?.implementsInterface).toEqual({ + PoolI: ['Pool'] + }) + }); + it('stableswapRef', () => { + expect(stableswapRef.traversed?.implementsInterface).toEqual({ + PoolI: ['Pool'] + }) + }); + it('queryRef', () => { + expect(queryRef.traversed?.acceptsInterface).toEqual({ + PoolI: [ + 'QueryPoolResponse', + 'QueryPoolsResponse', + 'QueryPoolsWithFilterResponse' + ] + }) + }); +}); \ No newline at end of file diff --git a/packages/parser/__tests__/__snapshots__/lcd.keepCase.test.ts.snap b/packages/parser/__tests__/lcd/__snapshots__/lcd.keepCase.test.ts.snap similarity index 100% rename from packages/parser/__tests__/__snapshots__/lcd.keepCase.test.ts.snap rename to packages/parser/__tests__/lcd/__snapshots__/lcd.keepCase.test.ts.snap diff --git a/packages/parser/__tests__/__snapshots__/lcd.params.test.ts.snap b/packages/parser/__tests__/lcd/__snapshots__/lcd.params.test.ts.snap similarity index 100% rename from packages/parser/__tests__/__snapshots__/lcd.params.test.ts.snap rename to packages/parser/__tests__/lcd/__snapshots__/lcd.params.test.ts.snap diff --git a/packages/parser/__tests__/lcd.keepCase.test.ts b/packages/parser/__tests__/lcd/lcd.keepCase.test.ts similarity index 74% rename from packages/parser/__tests__/lcd.keepCase.test.ts rename to packages/parser/__tests__/lcd/lcd.keepCase.test.ts index 0b718c82bb..ba9de2ce75 100644 --- a/packages/parser/__tests__/lcd.keepCase.test.ts +++ b/packages/parser/__tests__/lcd/lcd.keepCase.test.ts @@ -1,6 +1,6 @@ -import { traverse } from '../src/'; -import { getNested } from '../src/utils' -import { getTestProtoStore } from '../test-utils'; +import { traverse } from '../../src'; +import { getNested } from '../../src/utils' +import { getTestProtoStore } from '../../test-utils'; const store = getTestProtoStore({ prototypes: { diff --git a/packages/parser/__tests__/lcd.params.test.ts b/packages/parser/__tests__/lcd/lcd.params.test.ts similarity index 69% rename from packages/parser/__tests__/lcd.params.test.ts rename to packages/parser/__tests__/lcd/lcd.params.test.ts index fa86921e34..39d81465f5 100644 --- a/packages/parser/__tests__/lcd.params.test.ts +++ b/packages/parser/__tests__/lcd/lcd.params.test.ts @@ -1,6 +1,6 @@ -import { traverse } from '../src/'; -import { getNested } from '../src/utils' -import { getTestProtoStore } from '../test-utils'; +import { traverse } from '../../src'; +import { getNested } from '../../src/utils' +import { getTestProtoStore } from '../../test-utils'; const store = getTestProtoStore(); diff --git a/packages/parser/__tests__/__snapshots__/akash.test.ts.snap b/packages/parser/__tests__/misc/__snapshots__/akash.test.ts.snap similarity index 100% rename from packages/parser/__tests__/__snapshots__/akash.test.ts.snap rename to packages/parser/__tests__/misc/__snapshots__/akash.test.ts.snap diff --git a/packages/parser/__tests__/__snapshots__/comments.test.ts.snap b/packages/parser/__tests__/misc/__snapshots__/comments.test.ts.snap similarity index 99% rename from packages/parser/__tests__/__snapshots__/comments.test.ts.snap rename to packages/parser/__tests__/misc/__snapshots__/comments.test.ts.snap index 4004d4d733..e09ab70fd7 100644 --- a/packages/parser/__tests__/__snapshots__/comments.test.ts.snap +++ b/packages/parser/__tests__/misc/__snapshots__/comments.test.ts.snap @@ -2,6 +2,8 @@ exports[`cosmos/base/query/v1beta1/pagination 1`] = ` { + "acceptsInterface": {}, + "implementsInterface": {}, "importNames": {}, "imports": undefined, "package": "cosmos.base.query.v1beta1", @@ -199,6 +201,8 @@ exports[`cosmos/base/query/v1beta1/pagination 1`] = ` exports[`google/rpc/code 1`] = ` { + "acceptsInterface": {}, + "implementsInterface": {}, "importNames": {}, "imports": undefined, "package": "google.rpc", diff --git a/packages/parser/__tests__/__snapshots__/queries.test.ts.snap b/packages/parser/__tests__/misc/__snapshots__/queries.test.ts.snap similarity index 65% rename from packages/parser/__tests__/__snapshots__/queries.test.ts.snap rename to packages/parser/__tests__/misc/__snapshots__/queries.test.ts.snap index 235cbf55b4..0a6ba50254 100644 --- a/packages/parser/__tests__/__snapshots__/queries.test.ts.snap +++ b/packages/parser/__tests__/misc/__snapshots__/queries.test.ts.snap @@ -5,6 +5,192 @@ exports[`queries 1`] = ` "Query": { "comment": null, "methods": { + "CalcExitPoolCoinsFromShares": { + "comment": null, + "fields": { + "poolId": { + "comment": null, + "id": 1, + "isScalar": true, + "options": { + "(telescope:camel)": "poolId", + "(telescope:name)": "poolId", + "(telescope:orig)": "pool_id", + }, + "parsedType": { + "name": "uint64", + "type": "native", + }, + "type": "uint64", + "typeNum": 8, + }, + "shareInAmount": { + "comment": null, + "id": 2, + "isScalar": true, + "options": { + "(gogoproto.customtype)": "github.com/cosmos/cosmos-sdk/types.Int", + "(gogoproto.nullable)": false, + "(telescope:camel)": "shareInAmount", + "(telescope:name)": "shareInAmount", + "(telescope:orig)": "share_in_amount", + }, + "parsedType": { + "name": "string", + "type": "native", + }, + "type": "string", + "typeNum": 13, + }, + }, + "info": { + "casing": { + "pool_id": "poolId", + "share_in_amount": "shareInAmount", + }, + "method": "get", + "paramMap": { + "pool_id": "poolId", + "share_in_amount": "shareInAmount", + }, + "pathParams": [ + "pool_id", + ], + "queryParams": [ + "share_in_amount", + ], + "url": "/osmosis/gamm/v1beta1/pools/{pool_id}/exit_swap_share_amount_in", + }, + "name": "CalcExitPoolCoinsFromShares", + "options": { + "(google.api.http).get": "/osmosis/gamm/v1beta1/pools/{pool_id}/exit_swap_share_amount_in", + }, + "requestType": "QueryCalcExitPoolCoinsFromSharesRequest", + "responseType": "QueryCalcExitPoolCoinsFromSharesResponse", + "type": "ServiceMethod", + }, + "CalcJoinPoolNoSwapShares": { + "comment": "Simulates joining pool without a swap. Returns the amount of shares you'd + get and tokens needed to provide", + "fields": { + "poolId": { + "comment": null, + "id": 1, + "isScalar": true, + "options": { + "(gogoproto.moretags)": "yaml:pool_id", + "(telescope:camel)": "poolId", + "(telescope:name)": "poolId", + "(telescope:orig)": "pool_id", + }, + "parsedType": { + "name": "uint64", + "type": "native", + }, + "type": "uint64", + "typeNum": 8, + }, + "tokensIn": { + "comment": null, + "id": 2, + "import": "cosmos/base/v1beta1/coin.proto", + "importedName": "cosmos.base.v1beta1.Coin", + "options": { + "(gogoproto.castrepeated)": "github.com/cosmos/cosmos-sdk/types.Coins", + "(gogoproto.nullable)": false, + "(telescope:camel)": "tokensIn", + "(telescope:name)": "tokensIn", + "(telescope:orig)": "tokens_in", + }, + "parsedType": { + "name": "Coin", + "type": "Type", + }, + "rule": "repeated", + "scope": [ + "cosmos.base.v1beta1", + ], + "scopeType": "protoImport", + "type": "cosmos.base.v1beta1.Coin", + }, + }, + "info": undefined, + "name": "CalcJoinPoolNoSwapShares", + "options": undefined, + "requestType": "QueryCalcJoinPoolNoSwapSharesRequest", + "responseType": "QueryCalcJoinPoolNoSwapSharesResponse", + "type": "ServiceMethod", + }, + "CalcJoinPoolShares": { + "comment": null, + "fields": { + "poolId": { + "comment": null, + "id": 1, + "isScalar": true, + "options": { + "(gogoproto.moretags)": "yaml:pool_id", + "(telescope:camel)": "poolId", + "(telescope:name)": "poolId", + "(telescope:orig)": "pool_id", + }, + "parsedType": { + "name": "uint64", + "type": "native", + }, + "type": "uint64", + "typeNum": 8, + }, + "tokensIn": { + "comment": null, + "id": 2, + "import": "cosmos/base/v1beta1/coin.proto", + "importedName": "cosmos.base.v1beta1.Coin", + "options": { + "(gogoproto.castrepeated)": "github.com/cosmos/cosmos-sdk/types.Coins", + "(gogoproto.nullable)": false, + "(telescope:camel)": "tokensIn", + "(telescope:name)": "tokensIn", + "(telescope:orig)": "tokens_in", + }, + "parsedType": { + "name": "Coin", + "type": "Type", + }, + "rule": "repeated", + "scope": [ + "cosmos.base.v1beta1", + ], + "scopeType": "protoImport", + "type": "cosmos.base.v1beta1.Coin", + }, + }, + "info": { + "casing": { + "pool_id": "poolId", + "tokens_in": "tokensIn", + }, + "method": "get", + "paramMap": { + "pool_id": "poolId", + "tokens_in": "tokensIn", + }, + "pathParams": [ + "pool_id", + ], + "queryParams": [ + "tokens_in", + ], + "url": "/osmosis/gamm/v1beta1/pools/{pool_id}/join_swap_exact_in", + }, + "name": "CalcJoinPoolShares", + "options": { + "(google.api.http).get": "/osmosis/gamm/v1beta1/pools/{pool_id}/join_swap_exact_in", + }, + "requestType": "QueryCalcJoinPoolSharesRequest", + "responseType": "QueryCalcJoinPoolSharesResponse", + "type": "ServiceMethod", + }, "EstimateSwapExactAmountIn": { "comment": "Estimate the swap.", "fields": { @@ -51,7 +237,7 @@ exports[`queries 1`] = ` "type": "SwapAmountInRoute", }, "sender": { - "comment": null, + "comment": "TODO: CHANGE THIS TO RESERVED IN A PATCH RELEASE", "id": 1, "isScalar": true, "options": { @@ -163,7 +349,7 @@ exports[`queries 1`] = ` "type": "SwapAmountOutRoute", }, "sender": { - "comment": null, + "comment": "TODO: CHANGE THIS TO RESERVED IN A PATCH RELEASE", "id": 1, "isScalar": true, "options": { @@ -425,6 +611,99 @@ exports[`queries 1`] = ` "responseType": "QueryPoolsResponse", "type": "ServiceMethod", }, + "PoolsWithFilter": { + "comment": "PoolsWithFilter allows you to query specific pools with requested + parameters", + "fields": { + "minLiquidity": { + "comment": null, + "id": 1, + "import": "cosmos/base/v1beta1/coin.proto", + "importedName": "cosmos.base.v1beta1.Coin", + "options": { + "(gogoproto.castrepeated)": "github.com/cosmos/cosmos-sdk/types.Coins", + "(gogoproto.moretags)": "yaml:min_liquidity", + "(gogoproto.nullable)": false, + "(telescope:camel)": "minLiquidity", + "(telescope:name)": "minLiquidity", + "(telescope:orig)": "min_liquidity", + }, + "parsedType": { + "name": "Coin", + "type": "Type", + }, + "rule": "repeated", + "scope": [ + "cosmos.base.v1beta1", + ], + "scopeType": "protoImport", + "type": "cosmos.base.v1beta1.Coin", + }, + "pagination": { + "comment": null, + "id": 3, + "import": "cosmos/base/query/v1beta1/pagination.proto", + "importedName": "cosmos.base.query.v1beta1.PageRequest", + "options": { + "(telescope:camel)": "pagination", + "(telescope:name)": "pagination", + "(telescope:orig)": "pagination", + }, + "parsedType": { + "name": "PageRequest", + "type": "Type", + }, + "scope": [ + "cosmos.base.query.v1beta1", + ], + "scopeType": "protoImport", + "type": "cosmos.base.query.v1beta1.PageRequest", + }, + "poolType": { + "comment": null, + "id": 2, + "isScalar": true, + "options": { + "(telescope:camel)": "poolType", + "(telescope:name)": "poolType", + "(telescope:orig)": "pool_type", + }, + "parsedType": { + "name": "string", + "type": "native", + }, + "type": "string", + "typeNum": 13, + }, + }, + "info": { + "casing": { + "min_liquidity": "minLiquidity", + "pagination": "pagination", + "pool_type": "poolType", + }, + "method": "get", + "paramMap": { + "min_liquidity": "minLiquidity", + "pagination": "pagination", + "pool_type": "poolType", + }, + "pathParams": [], + "queryParams": [ + "min_liquidity", + "pool_type", + "pagination", + ], + "url": "/osmosis/gamm/v1beta1/filtered_pools", + }, + "name": "PoolsWithFilter", + "options": { + "(google.api.http).get": "/osmosis/gamm/v1beta1/filtered_pools", + }, + "requestType": "QueryPoolsWithFilterRequest", + "responseType": "QueryPoolsWithFilterResponse", + "type": "ServiceMethod", + }, "SpotPrice": { "comment": "SpotPrice defines a gRPC query handler that returns the spot price given a base denomination and a quote denomination.", @@ -505,6 +784,7 @@ exports[`queries 1`] = ` "name": "SpotPrice", "options": { "(google.api.http).get": "/osmosis/gamm/v1beta1/pools/{pool_id}/prices", + "deprecated": true, }, "requestType": "QuerySpotPriceRequest", "responseType": "QuerySpotPriceResponse", @@ -619,28 +899,17 @@ exports[`queries 1`] = ` "name": "Query", "type": "Service", }, - "QueryNumPoolsRequest": { - "comment": "=============================== NumPools", - "fields": {}, - "keyTypes": [], - "name": "QueryNumPoolsRequest", - "nested": null, - "oneofs": undefined, - "options": undefined, - "type": "Type", - }, - "QueryNumPoolsResponse": { - "comment": null, + "QueryCalcExitPoolCoinsFromSharesRequest": { + "comment": "=============================== CalcExitPoolCoinsFromShares", "fields": { - "numPools": { + "poolId": { "comment": null, "id": 1, "isScalar": true, "options": { - "(gogoproto.moretags)": "yaml:num_pools", - "(telescope:camel)": "numPools", - "(telescope:name)": "numPools", - "(telescope:orig)": "num_pools", + "(telescope:camel)": "poolId", + "(telescope:name)": "poolId", + "(telescope:orig)": "pool_id", }, "parsedType": { "name": "uint64", @@ -649,52 +918,350 @@ exports[`queries 1`] = ` "type": "uint64", "typeNum": 8, }, - }, - "keyTypes": [], - "name": "QueryNumPoolsResponse", - "nested": null, - "oneofs": undefined, - "options": undefined, - "type": "Type", - }, - "QueryPoolParamsRequest": { - "comment": "=============================== PoolParams", - "fields": { - "poolId": { + "shareInAmount": { "comment": null, - "id": 1, + "id": 2, "isScalar": true, "options": { - "(gogoproto.moretags)": "yaml:pool_id", - "(telescope:camel)": "poolId", - "(telescope:name)": "poolId", - "(telescope:orig)": "pool_id", + "(gogoproto.customtype)": "github.com/cosmos/cosmos-sdk/types.Int", + "(gogoproto.nullable)": false, + "(telescope:camel)": "shareInAmount", + "(telescope:name)": "shareInAmount", + "(telescope:orig)": "share_in_amount", }, "parsedType": { - "name": "uint64", + "name": "string", "type": "native", }, - "type": "uint64", - "typeNum": 8, + "type": "string", + "typeNum": 13, }, }, "keyTypes": [], - "name": "QueryPoolParamsRequest", + "name": "QueryCalcExitPoolCoinsFromSharesRequest", "nested": null, "oneofs": undefined, "options": undefined, "type": "Type", }, - "QueryPoolParamsResponse": { + "QueryCalcExitPoolCoinsFromSharesResponse": { "comment": null, "fields": { - "params": { + "tokensOut": { "comment": null, "id": 1, - "import": "google/protobuf/any.proto", - "importedName": "google.protobuf.Any", + "import": "cosmos/base/v1beta1/coin.proto", + "importedName": "cosmos.base.v1beta1.Coin", "options": { - "(telescope:camel)": "params", + "(gogoproto.castrepeated)": "github.com/cosmos/cosmos-sdk/types.Coins", + "(gogoproto.nullable)": false, + "(telescope:camel)": "tokensOut", + "(telescope:name)": "tokensOut", + "(telescope:orig)": "tokens_out", + }, + "parsedType": { + "name": "Coin", + "type": "Type", + }, + "rule": "repeated", + "scope": [ + "cosmos.base.v1beta1", + ], + "scopeType": "protoImport", + "type": "cosmos.base.v1beta1.Coin", + }, + }, + "keyTypes": [], + "name": "QueryCalcExitPoolCoinsFromSharesResponse", + "nested": null, + "oneofs": undefined, + "options": undefined, + "type": "Type", + }, + "QueryCalcJoinPoolNoSwapSharesRequest": { + "comment": "=============================== CalcJoinPoolNoSwapShares", + "fields": { + "poolId": { + "comment": null, + "id": 1, + "isScalar": true, + "options": { + "(gogoproto.moretags)": "yaml:pool_id", + "(telescope:camel)": "poolId", + "(telescope:name)": "poolId", + "(telescope:orig)": "pool_id", + }, + "parsedType": { + "name": "uint64", + "type": "native", + }, + "type": "uint64", + "typeNum": 8, + }, + "tokensIn": { + "comment": null, + "id": 2, + "import": "cosmos/base/v1beta1/coin.proto", + "importedName": "cosmos.base.v1beta1.Coin", + "options": { + "(gogoproto.castrepeated)": "github.com/cosmos/cosmos-sdk/types.Coins", + "(gogoproto.nullable)": false, + "(telescope:camel)": "tokensIn", + "(telescope:name)": "tokensIn", + "(telescope:orig)": "tokens_in", + }, + "parsedType": { + "name": "Coin", + "type": "Type", + }, + "rule": "repeated", + "scope": [ + "cosmos.base.v1beta1", + ], + "scopeType": "protoImport", + "type": "cosmos.base.v1beta1.Coin", + }, + }, + "keyTypes": [], + "name": "QueryCalcJoinPoolNoSwapSharesRequest", + "nested": null, + "oneofs": undefined, + "options": undefined, + "type": "Type", + }, + "QueryCalcJoinPoolNoSwapSharesResponse": { + "comment": null, + "fields": { + "sharesOut": { + "comment": null, + "id": 2, + "isScalar": true, + "options": { + "(gogoproto.customtype)": "github.com/cosmos/cosmos-sdk/types.Int", + "(gogoproto.nullable)": false, + "(telescope:camel)": "sharesOut", + "(telescope:name)": "sharesOut", + "(telescope:orig)": "shares_out", + }, + "parsedType": { + "name": "string", + "type": "native", + }, + "type": "string", + "typeNum": 13, + }, + "tokensOut": { + "comment": null, + "id": 1, + "import": "cosmos/base/v1beta1/coin.proto", + "importedName": "cosmos.base.v1beta1.Coin", + "options": { + "(gogoproto.castrepeated)": "github.com/cosmos/cosmos-sdk/types.Coins", + "(gogoproto.moretags)": "yaml:tokens_out", + "(gogoproto.nullable)": false, + "(telescope:camel)": "tokensOut", + "(telescope:name)": "tokensOut", + "(telescope:orig)": "tokens_out", + }, + "parsedType": { + "name": "Coin", + "type": "Type", + }, + "rule": "repeated", + "scope": [ + "cosmos.base.v1beta1", + ], + "scopeType": "protoImport", + "type": "cosmos.base.v1beta1.Coin", + }, + }, + "keyTypes": [], + "name": "QueryCalcJoinPoolNoSwapSharesResponse", + "nested": null, + "oneofs": undefined, + "options": undefined, + "type": "Type", + }, + "QueryCalcJoinPoolSharesRequest": { + "comment": "=============================== CalcJoinPoolShares", + "fields": { + "poolId": { + "comment": null, + "id": 1, + "isScalar": true, + "options": { + "(gogoproto.moretags)": "yaml:pool_id", + "(telescope:camel)": "poolId", + "(telescope:name)": "poolId", + "(telescope:orig)": "pool_id", + }, + "parsedType": { + "name": "uint64", + "type": "native", + }, + "type": "uint64", + "typeNum": 8, + }, + "tokensIn": { + "comment": null, + "id": 2, + "import": "cosmos/base/v1beta1/coin.proto", + "importedName": "cosmos.base.v1beta1.Coin", + "options": { + "(gogoproto.castrepeated)": "github.com/cosmos/cosmos-sdk/types.Coins", + "(gogoproto.nullable)": false, + "(telescope:camel)": "tokensIn", + "(telescope:name)": "tokensIn", + "(telescope:orig)": "tokens_in", + }, + "parsedType": { + "name": "Coin", + "type": "Type", + }, + "rule": "repeated", + "scope": [ + "cosmos.base.v1beta1", + ], + "scopeType": "protoImport", + "type": "cosmos.base.v1beta1.Coin", + }, + }, + "keyTypes": [], + "name": "QueryCalcJoinPoolSharesRequest", + "nested": null, + "oneofs": undefined, + "options": undefined, + "type": "Type", + }, + "QueryCalcJoinPoolSharesResponse": { + "comment": null, + "fields": { + "shareOutAmount": { + "comment": null, + "id": 1, + "isScalar": true, + "options": { + "(gogoproto.customtype)": "github.com/cosmos/cosmos-sdk/types.Int", + "(gogoproto.moretags)": "yaml:share_out_amount", + "(gogoproto.nullable)": false, + "(telescope:camel)": "shareOutAmount", + "(telescope:name)": "shareOutAmount", + "(telescope:orig)": "share_out_amount", + }, + "parsedType": { + "name": "string", + "type": "native", + }, + "type": "string", + "typeNum": 13, + }, + "tokensOut": { + "comment": null, + "id": 2, + "import": "cosmos/base/v1beta1/coin.proto", + "importedName": "cosmos.base.v1beta1.Coin", + "options": { + "(gogoproto.castrepeated)": "github.com/cosmos/cosmos-sdk/types.Coins", + "(gogoproto.nullable)": false, + "(telescope:camel)": "tokensOut", + "(telescope:name)": "tokensOut", + "(telescope:orig)": "tokens_out", + }, + "parsedType": { + "name": "Coin", + "type": "Type", + }, + "rule": "repeated", + "scope": [ + "cosmos.base.v1beta1", + ], + "scopeType": "protoImport", + "type": "cosmos.base.v1beta1.Coin", + }, + }, + "keyTypes": [], + "name": "QueryCalcJoinPoolSharesResponse", + "nested": null, + "oneofs": undefined, + "options": undefined, + "type": "Type", + }, + "QueryNumPoolsRequest": { + "comment": "=============================== NumPools", + "fields": {}, + "keyTypes": [], + "name": "QueryNumPoolsRequest", + "nested": null, + "oneofs": undefined, + "options": undefined, + "type": "Type", + }, + "QueryNumPoolsResponse": { + "comment": null, + "fields": { + "numPools": { + "comment": null, + "id": 1, + "isScalar": true, + "options": { + "(gogoproto.moretags)": "yaml:num_pools", + "(telescope:camel)": "numPools", + "(telescope:name)": "numPools", + "(telescope:orig)": "num_pools", + }, + "parsedType": { + "name": "uint64", + "type": "native", + }, + "type": "uint64", + "typeNum": 8, + }, + }, + "keyTypes": [], + "name": "QueryNumPoolsResponse", + "nested": null, + "oneofs": undefined, + "options": undefined, + "type": "Type", + }, + "QueryPoolParamsRequest": { + "comment": "=============================== PoolParams", + "fields": { + "poolId": { + "comment": null, + "id": 1, + "isScalar": true, + "options": { + "(gogoproto.moretags)": "yaml:pool_id", + "(telescope:camel)": "poolId", + "(telescope:name)": "poolId", + "(telescope:orig)": "pool_id", + }, + "parsedType": { + "name": "uint64", + "type": "native", + }, + "type": "uint64", + "typeNum": 8, + }, + }, + "keyTypes": [], + "name": "QueryPoolParamsRequest", + "nested": null, + "oneofs": undefined, + "options": undefined, + "type": "Type", + }, + "QueryPoolParamsResponse": { + "comment": null, + "fields": { + "params": { + "comment": null, + "id": 1, + "import": "google/protobuf/any.proto", + "importedName": "google.protobuf.Any", + "options": { + "(telescope:camel)": "params", "(telescope:name)": "params", "(telescope:orig)": "params", }, @@ -916,6 +1483,130 @@ exports[`queries 1`] = ` "options": undefined, "type": "Type", }, + "QueryPoolsWithFilterRequest": { + "comment": null, + "fields": { + "minLiquidity": { + "comment": null, + "id": 1, + "import": "cosmos/base/v1beta1/coin.proto", + "importedName": "cosmos.base.v1beta1.Coin", + "options": { + "(gogoproto.castrepeated)": "github.com/cosmos/cosmos-sdk/types.Coins", + "(gogoproto.moretags)": "yaml:min_liquidity", + "(gogoproto.nullable)": false, + "(telescope:camel)": "minLiquidity", + "(telescope:name)": "minLiquidity", + "(telescope:orig)": "min_liquidity", + }, + "parsedType": { + "name": "Coin", + "type": "Type", + }, + "rule": "repeated", + "scope": [ + "cosmos.base.v1beta1", + ], + "scopeType": "protoImport", + "type": "cosmos.base.v1beta1.Coin", + }, + "pagination": { + "comment": null, + "id": 3, + "import": "cosmos/base/query/v1beta1/pagination.proto", + "importedName": "cosmos.base.query.v1beta1.PageRequest", + "options": { + "(telescope:camel)": "pagination", + "(telescope:name)": "pagination", + "(telescope:orig)": "pagination", + }, + "parsedType": { + "name": "PageRequest", + "type": "Type", + }, + "scope": [ + "cosmos.base.query.v1beta1", + ], + "scopeType": "protoImport", + "type": "cosmos.base.query.v1beta1.PageRequest", + }, + "poolType": { + "comment": null, + "id": 2, + "isScalar": true, + "options": { + "(telescope:camel)": "poolType", + "(telescope:name)": "poolType", + "(telescope:orig)": "pool_type", + }, + "parsedType": { + "name": "string", + "type": "native", + }, + "type": "string", + "typeNum": 13, + }, + }, + "keyTypes": [], + "name": "QueryPoolsWithFilterRequest", + "nested": null, + "oneofs": undefined, + "options": undefined, + "type": "Type", + }, + "QueryPoolsWithFilterResponse": { + "comment": null, + "fields": { + "pagination": { + "comment": "pagination defines the pagination in the response.", + "id": 2, + "import": "cosmos/base/query/v1beta1/pagination.proto", + "importedName": "cosmos.base.query.v1beta1.PageResponse", + "options": { + "(telescope:camel)": "pagination", + "(telescope:name)": "pagination", + "(telescope:orig)": "pagination", + }, + "parsedType": { + "name": "PageResponse", + "type": "Type", + }, + "scope": [ + "cosmos.base.query.v1beta1", + ], + "scopeType": "protoImport", + "type": "cosmos.base.query.v1beta1.PageResponse", + }, + "pools": { + "comment": null, + "id": 1, + "import": "google/protobuf/any.proto", + "importedName": "google.protobuf.Any", + "options": { + "(cosmos_proto.accepts_interface)": "PoolI", + "(telescope:camel)": "pools", + "(telescope:name)": "pools", + "(telescope:orig)": "pools", + }, + "parsedType": { + "name": "Any", + "type": "Type", + }, + "rule": "repeated", + "scope": [ + "google.protobuf", + ], + "scopeType": "protoImport", + "type": "google.protobuf.Any", + }, + }, + "keyTypes": [], + "name": "QueryPoolsWithFilterResponse", + "nested": null, + "oneofs": undefined, + "options": undefined, + "type": "Type", + }, "QuerySpotPriceRequest": { "comment": "QuerySpotPriceRequest defines the gRPC request structure for a SpotPrice query.", @@ -976,7 +1667,9 @@ exports[`queries 1`] = ` "name": "QuerySpotPriceRequest", "nested": null, "oneofs": undefined, - "options": undefined, + "options": { + "deprecated": true, + }, "type": "Type", }, "QuerySpotPriceResponse": { @@ -1005,7 +1698,9 @@ exports[`queries 1`] = ` "name": "QuerySpotPriceResponse", "nested": null, "oneofs": undefined, - "options": undefined, + "options": { + "deprecated": true, + }, "type": "Type", }, "QuerySwapExactAmountInRequest": { @@ -1054,7 +1749,7 @@ exports[`queries 1`] = ` "type": "SwapAmountInRoute", }, "sender": { - "comment": null, + "comment": "TODO: CHANGE THIS TO RESERVED IN A PATCH RELEASE", "id": 1, "isScalar": true, "options": { @@ -1171,7 +1866,7 @@ exports[`queries 1`] = ` "type": "SwapAmountOutRoute", }, "sender": { - "comment": null, + "comment": "TODO: CHANGE THIS TO RESERVED IN A PATCH RELEASE", "id": 1, "isScalar": true, "options": { diff --git a/packages/parser/__tests__/akash.test.ts b/packages/parser/__tests__/misc/akash.test.ts similarity index 77% rename from packages/parser/__tests__/akash.test.ts rename to packages/parser/__tests__/misc/akash.test.ts index 7ff2589c5f..755347c6f4 100644 --- a/packages/parser/__tests__/akash.test.ts +++ b/packages/parser/__tests__/misc/akash.test.ts @@ -1,8 +1,8 @@ import { ProtoRef } from '@osmonauts/types'; -import { ProtoStore } from '../src/index' -import { traverse } from '../src/'; -import { getNested } from '../src/utils' -import { getTestProtoStore } from '../test-utils'; +import { ProtoStore } from '../../src/index' +import { traverse } from '../../src'; +import { getNested } from '../../src/utils' +import { getTestProtoStore } from '../../test-utils'; const store = getTestProtoStore(); diff --git a/packages/parser/__tests__/comments.test.ts b/packages/parser/__tests__/misc/comments.test.ts similarity index 81% rename from packages/parser/__tests__/comments.test.ts rename to packages/parser/__tests__/misc/comments.test.ts index 3428f87abd..25f2ef9062 100644 --- a/packages/parser/__tests__/comments.test.ts +++ b/packages/parser/__tests__/misc/comments.test.ts @@ -1,5 +1,5 @@ -import { traverse } from '../src/'; -import { getTestProtoStore } from '../test-utils'; +import { traverse } from '../../src'; +import { getTestProtoStore } from '../../test-utils'; const store = getTestProtoStore(); it('cosmos/base/query/v1beta1/pagination', () => { diff --git a/packages/parser/__tests__/queries.test.ts b/packages/parser/__tests__/misc/queries.test.ts similarity index 95% rename from packages/parser/__tests__/queries.test.ts rename to packages/parser/__tests__/misc/queries.test.ts index 1045a99c25..d8b258448c 100644 --- a/packages/parser/__tests__/queries.test.ts +++ b/packages/parser/__tests__/misc/queries.test.ts @@ -1,7 +1,7 @@ -import { traverse } from '../src/'; -import { getNested } from '../src/utils' -import { parseService, parseServiceUrl } from '../src/services' -import { getTestProtoStore } from '../test-utils'; +import { traverse } from '../../src'; +import { getNested } from '../../src/utils' +import { parseService, parseServiceUrl } from '../../src/services' +import { getTestProtoStore } from '../../test-utils'; const store = getTestProtoStore(); diff --git a/packages/parser/__tests__/__snapshots__/deps.test.ts.snap b/packages/parser/__tests__/scope/__snapshots__/deps.test.ts.snap similarity index 98% rename from packages/parser/__tests__/__snapshots__/deps.test.ts.snap rename to packages/parser/__tests__/scope/__snapshots__/deps.test.ts.snap index 717c99e25d..cb1666c91e 100644 --- a/packages/parser/__tests__/__snapshots__/deps.test.ts.snap +++ b/packages/parser/__tests__/scope/__snapshots__/deps.test.ts.snap @@ -309,6 +309,9 @@ exports[`all 1`] = ` "osmosis/gamm/v1beta1/genesis.proto", "osmosis/gamm/v1beta1/tx.proto", "osmosis/gamm/v1beta1/query.proto", + "osmosis/gamm/v2/query.proto", + "osmosis/ibc-rate-limit/v1beta1/params.proto", + "osmosis/ibc-rate-limit/v1beta1/query.proto", "osmosis/lockup/lock.proto", "osmosis/incentives/gauge.proto", "osmosis/incentives/params.proto", @@ -316,6 +319,7 @@ exports[`all 1`] = ` "osmosis/incentives/query.proto", "osmosis/incentives/tx.proto", "osmosis/lockup/genesis.proto", + "osmosis/lockup/params.proto", "osmosis/lockup/query.proto", "osmosis/lockup/tx.proto", "osmosis/mint/v1beta1/mint.proto", @@ -325,13 +329,7 @@ exports[`all 1`] = ` "osmosis/pool-incentives/v1beta1/genesis.proto", "osmosis/pool-incentives/v1beta1/gov.proto", "osmosis/pool-incentives/v1beta1/query.proto", - "osmosis/store/v1beta1/tree.proto", - "osmosis/streamswap/v1/event.proto", - "osmosis/streamswap/v1/state.proto", - "osmosis/streamswap/v1/params.proto", - "osmosis/streamswap/v1/genesis.proto", - "osmosis/streamswap/v1/query.proto", - "osmosis/streamswap/v1/tx.proto", + "osmosis/sumtree/v1beta1/tree.proto", "osmosis/superfluid/superfluid.proto", "osmosis/superfluid/params.proto", "osmosis/superfluid/genesis.proto", diff --git a/packages/parser/__tests__/__snapshots__/enums.test.js.snap b/packages/parser/__tests__/scope/__snapshots__/enums.test.js.snap similarity index 100% rename from packages/parser/__tests__/__snapshots__/enums.test.js.snap rename to packages/parser/__tests__/scope/__snapshots__/enums.test.js.snap diff --git a/packages/parser/__tests__/__snapshots__/imports.test.ts.snap b/packages/parser/__tests__/scope/__snapshots__/imports.test.ts.snap similarity index 100% rename from packages/parser/__tests__/__snapshots__/imports.test.ts.snap rename to packages/parser/__tests__/scope/__snapshots__/imports.test.ts.snap diff --git a/packages/parser/__tests__/__snapshots__/lookup.test.ts.snap b/packages/parser/__tests__/scope/__snapshots__/lookup.test.ts.snap similarity index 100% rename from packages/parser/__tests__/__snapshots__/lookup.test.ts.snap rename to packages/parser/__tests__/scope/__snapshots__/lookup.test.ts.snap diff --git a/packages/parser/__tests__/__snapshots__/nested-names.test.ts.snap b/packages/parser/__tests__/scope/__snapshots__/nested-names.test.ts.snap similarity index 100% rename from packages/parser/__tests__/__snapshots__/nested-names.test.ts.snap rename to packages/parser/__tests__/scope/__snapshots__/nested-names.test.ts.snap diff --git a/packages/parser/__tests__/__snapshots__/proto.enums.test.ts.snap b/packages/parser/__tests__/scope/__snapshots__/proto.enums.test.ts.snap similarity index 100% rename from packages/parser/__tests__/__snapshots__/proto.enums.test.ts.snap rename to packages/parser/__tests__/scope/__snapshots__/proto.enums.test.ts.snap diff --git a/packages/parser/__tests__/__snapshots__/proto.fields.test.ts.snap b/packages/parser/__tests__/scope/__snapshots__/proto.fields.test.ts.snap similarity index 100% rename from packages/parser/__tests__/__snapshots__/proto.fields.test.ts.snap rename to packages/parser/__tests__/scope/__snapshots__/proto.fields.test.ts.snap diff --git a/packages/parser/__tests__/__snapshots__/pure.test.ts.snap b/packages/parser/__tests__/scope/__snapshots__/pure.test.ts.snap similarity index 99% rename from packages/parser/__tests__/__snapshots__/pure.test.ts.snap rename to packages/parser/__tests__/scope/__snapshots__/pure.test.ts.snap index 375937f68a..910e9a2206 100644 --- a/packages/parser/__tests__/__snapshots__/pure.test.ts.snap +++ b/packages/parser/__tests__/scope/__snapshots__/pure.test.ts.snap @@ -2,6 +2,8 @@ exports[`pure proto 1`] = ` { + "acceptsInterface": {}, + "implementsInterface": {}, "importNames": {}, "imports": undefined, "package": "cosmology.finance", diff --git a/packages/parser/__tests__/__snapshots__/scope.test.ts.snap b/packages/parser/__tests__/scope/__snapshots__/scope.test.ts.snap similarity index 99% rename from packages/parser/__tests__/__snapshots__/scope.test.ts.snap rename to packages/parser/__tests__/scope/__snapshots__/scope.test.ts.snap index bb3d00e797..359805d603 100644 --- a/packages/parser/__tests__/__snapshots__/scope.test.ts.snap +++ b/packages/parser/__tests__/scope/__snapshots__/scope.test.ts.snap @@ -1961,7 +1961,7 @@ exports[`top-level lookup 1`] = ` "content": { "id": 2, "options": { - "(cosmos_proto.accepts_interface)": "Content", + "(cosmos_proto.accepts_interface)": "ProposalContentI", "(telescope:camel)": "content", "(telescope:name)": "content", "(telescope:orig)": "content", @@ -2187,7 +2187,7 @@ exports[`top-level lookup 1`] = ` }, }, "options": { - "(cosmos_proto.implements_interface)": "Content", + "(cosmos_proto.implements_interface)": "ProposalContentI", "(gogoproto.equal)": true, }, }, diff --git a/packages/parser/__tests__/deps.test.ts b/packages/parser/__tests__/scope/deps.test.ts similarity index 84% rename from packages/parser/__tests__/deps.test.ts rename to packages/parser/__tests__/scope/deps.test.ts index 0964f82e94..087bc75ec7 100644 --- a/packages/parser/__tests__/deps.test.ts +++ b/packages/parser/__tests__/scope/deps.test.ts @@ -1,5 +1,5 @@ -import { ProtoResolver } from '../src/index' -import { getTestProtoStore } from '../test-utils'; +import { ProtoResolver } from '../../src/index' +import { getTestProtoStore } from '../../test-utils'; const store = getTestProtoStore(); const resolver = new ProtoResolver(store.getDeps()); diff --git a/packages/parser/__tests__/enums.test.js b/packages/parser/__tests__/scope/enums.test.js similarity index 67% rename from packages/parser/__tests__/enums.test.js rename to packages/parser/__tests__/scope/enums.test.js index c06c2df373..6dd9c7b0ac 100644 --- a/packages/parser/__tests__/enums.test.js +++ b/packages/parser/__tests__/scope/enums.test.js @@ -1,6 +1,6 @@ -import { ProtoStore } from '../src/index'; -import { getObjectName, lookup } from '../src/'; -const store = new ProtoStore([__dirname + '/../../../__fixtures__/chain1']); +import { ProtoStore } from '../../src/index'; +import { getObjectName, lookup } from '../../src'; +const store = new ProtoStore([__dirname + '/../../../../__fixtures__/chain1']); it('nested lookup', () => { // TODO generate the enum function diff --git a/packages/parser/__tests__/imports.test.ts b/packages/parser/__tests__/scope/imports.test.ts similarity index 98% rename from packages/parser/__tests__/imports.test.ts rename to packages/parser/__tests__/scope/imports.test.ts index 3e1dc97c63..55d671e0aa 100644 --- a/packages/parser/__tests__/imports.test.ts +++ b/packages/parser/__tests__/scope/imports.test.ts @@ -1,5 +1,5 @@ -import { importLookup, protoImportLookup } from '../src/'; -import { getTestProtoStore } from '../test-utils'; +import { importLookup, protoImportLookup } from '../../src'; +import { getTestProtoStore } from '../../test-utils'; const store = getTestProtoStore(); describe('imports lookup', () => { diff --git a/packages/parser/__tests__/lookup.test.ts b/packages/parser/__tests__/scope/lookup.test.ts similarity index 97% rename from packages/parser/__tests__/lookup.test.ts rename to packages/parser/__tests__/scope/lookup.test.ts index a5bf8a1b56..383e02b5b0 100644 --- a/packages/parser/__tests__/lookup.test.ts +++ b/packages/parser/__tests__/scope/lookup.test.ts @@ -1,6 +1,6 @@ -import { ProtoStore } from '../src/index' -import { getObjectName, lookupSymbolScopes, lookup, getPackageAndNestedFromStr } from '../src/'; -import { getTestProtoStore } from '../test-utils'; +import { ProtoStore } from '../../src/index' +import { getObjectName, lookupSymbolScopes, lookup, getPackageAndNestedFromStr } from '../../src'; +import { getTestProtoStore } from '../../test-utils'; const store = getTestProtoStore(); // you may need to fix TRAVERSE diff --git a/packages/parser/__tests__/nested-names.test.ts b/packages/parser/__tests__/scope/nested-names.test.ts similarity index 83% rename from packages/parser/__tests__/nested-names.test.ts rename to packages/parser/__tests__/scope/nested-names.test.ts index 4387edde54..52e0208d6f 100644 --- a/packages/parser/__tests__/nested-names.test.ts +++ b/packages/parser/__tests__/scope/nested-names.test.ts @@ -1,6 +1,6 @@ -import { traverse } from '../src/'; +import { traverse } from '../../src'; import * as dotty from 'dotty'; -import { getTestProtoStore } from '../test-utils'; +import { getTestProtoStore } from '../../test-utils'; const store = getTestProtoStore(); diff --git a/packages/parser/__tests__/proto.enums.test.ts b/packages/parser/__tests__/scope/proto.enums.test.ts similarity index 68% rename from packages/parser/__tests__/proto.enums.test.ts rename to packages/parser/__tests__/scope/proto.enums.test.ts index b41c2dd747..28f2471f0b 100644 --- a/packages/parser/__tests__/proto.enums.test.ts +++ b/packages/parser/__tests__/scope/proto.enums.test.ts @@ -1,5 +1,5 @@ -import { getEnums } from '../src/utils'; -import { getTestProtoStore } from '../test-utils'; +import { getEnums } from '../../src/utils'; +import { getTestProtoStore } from '../../test-utils'; const store = getTestProtoStore(); it('find', () => { diff --git a/packages/parser/__tests__/proto.fields.test.ts b/packages/parser/__tests__/scope/proto.fields.test.ts similarity index 93% rename from packages/parser/__tests__/proto.fields.test.ts rename to packages/parser/__tests__/scope/proto.fields.test.ts index 5e68ceabb3..f802a7be3a 100644 --- a/packages/parser/__tests__/proto.fields.test.ts +++ b/packages/parser/__tests__/scope/proto.fields.test.ts @@ -1,4 +1,4 @@ -import { getTestProtoStore } from '../test-utils'; +import { getTestProtoStore } from '../../test-utils'; const store = getTestProtoStore(); it('Coin', () => { diff --git a/packages/parser/__tests__/proto.objects.test.ts b/packages/parser/__tests__/scope/proto.objects.test.ts similarity index 72% rename from packages/parser/__tests__/proto.objects.test.ts rename to packages/parser/__tests__/scope/proto.objects.test.ts index 8eca64582c..e549fa4795 100644 --- a/packages/parser/__tests__/proto.objects.test.ts +++ b/packages/parser/__tests__/scope/proto.objects.test.ts @@ -1,5 +1,5 @@ -import { getNestedProto } from '../src/utils'; -import { getTestProtoStore } from '../test-utils'; +import { getNestedProto } from '../../src/utils'; +import { getTestProtoStore } from '../../test-utils'; const store = getTestProtoStore(); it('Coin', () => { diff --git a/packages/parser/__tests__/pure.test.ts b/packages/parser/__tests__/scope/pure.test.ts similarity index 92% rename from packages/parser/__tests__/pure.test.ts rename to packages/parser/__tests__/scope/pure.test.ts index e90f06ab26..e8e206455d 100644 --- a/packages/parser/__tests__/pure.test.ts +++ b/packages/parser/__tests__/scope/pure.test.ts @@ -1,6 +1,6 @@ import { ProtoRef } from '@osmonauts/types'; -import { ProtoStore, parseProto } from '../src/index' -import { traverse } from '../src/'; +import { ProtoStore, parseProto } from '../../src/index' +import { traverse } from '../../src'; const store = new ProtoStore(); diff --git a/packages/parser/__tests__/scope.test.ts b/packages/parser/__tests__/scope/scope.test.ts similarity index 95% rename from packages/parser/__tests__/scope.test.ts rename to packages/parser/__tests__/scope/scope.test.ts index 887b0b48e6..1fa4d66076 100644 --- a/packages/parser/__tests__/scope.test.ts +++ b/packages/parser/__tests__/scope/scope.test.ts @@ -1,5 +1,5 @@ -import { getObjectName, lookup } from '../src/'; -import { getTestProtoStore } from '../test-utils'; +import { getObjectName, lookup } from '../../src'; +import { getTestProtoStore } from '../../test-utils'; const store = getTestProtoStore(); it('top-level lookup', () => { diff --git a/packages/parser/__tests__/services.objects.test.ts b/packages/parser/__tests__/scope/services.objects.test.ts similarity index 90% rename from packages/parser/__tests__/services.objects.test.ts rename to packages/parser/__tests__/scope/services.objects.test.ts index 9521df9b2d..a3d1e094cd 100644 --- a/packages/parser/__tests__/services.objects.test.ts +++ b/packages/parser/__tests__/scope/services.objects.test.ts @@ -1,5 +1,5 @@ -import { getServices } from '../src/utils'; -import { getTestProtoStore } from '../test-utils'; +import { getServices } from '../../src/utils'; +import { getTestProtoStore } from '../../test-utils'; const store = getTestProtoStore(); it('Msg', () => { diff --git a/packages/parser/__tests__/super-nested.test.ts b/packages/parser/__tests__/scope/super-nested.test.ts similarity index 99% rename from packages/parser/__tests__/super-nested.test.ts rename to packages/parser/__tests__/scope/super-nested.test.ts index 75be7e2777..a6cdb372fc 100644 --- a/packages/parser/__tests__/super-nested.test.ts +++ b/packages/parser/__tests__/scope/super-nested.test.ts @@ -1,6 +1,6 @@ import generate from '@babel/generator'; import { ProtoRef } from '@osmonauts/types' -import { ProtoStore, getNestedProtoGeneric, parseProto } from '../src/' +import { ProtoStore, getNestedProtoGeneric, parseProto } from '../../src' /* diff --git a/packages/parser/__tests__/__snapshots__/traverse-all.test.ts.snap b/packages/parser/__tests__/traverse/__snapshots__/traverse-all.test.ts.snap similarity index 100% rename from packages/parser/__tests__/__snapshots__/traverse-all.test.ts.snap rename to packages/parser/__tests__/traverse/__snapshots__/traverse-all.test.ts.snap diff --git a/packages/parser/__tests__/__snapshots__/traverse.checked.test.ts.snap b/packages/parser/__tests__/traverse/__snapshots__/traverse.checked.test.ts.snap similarity index 99% rename from packages/parser/__tests__/__snapshots__/traverse.checked.test.ts.snap rename to packages/parser/__tests__/traverse/__snapshots__/traverse.checked.test.ts.snap index a6bfa52418..56e67d9d48 100644 --- a/packages/parser/__tests__/__snapshots__/traverse.checked.test.ts.snap +++ b/packages/parser/__tests__/traverse/__snapshots__/traverse.checked.test.ts.snap @@ -2,19 +2,9 @@ exports[`google/api/expr/v1alpha1/checked 1`] = ` { - "importNames": { - "google/api/expr/v1alpha1/syntax.proto": { - "Constant": "Constant", - "Expr": "Expr", - "SourceInfo": "SourceInfo", - }, - "google/protobuf/empty.proto": { - "Empty": "Empty", - }, - "google/protobuf/struct.proto": { - "NullValue": "NullValue", - }, - }, + "acceptsInterface": {}, + "implementsInterface": {}, + "importNames": {}, "imports": [ "google/api/expr/v1alpha1/syntax.proto", "google/protobuf/empty.proto", diff --git a/packages/parser/__tests__/__snapshots__/traverse.test.ts.snap b/packages/parser/__tests__/traverse/__snapshots__/traverse.test.ts.snap similarity index 99% rename from packages/parser/__tests__/__snapshots__/traverse.test.ts.snap rename to packages/parser/__tests__/traverse/__snapshots__/traverse.test.ts.snap index c0ac8093b7..d21f99232a 100644 --- a/packages/parser/__tests__/__snapshots__/traverse.test.ts.snap +++ b/packages/parser/__tests__/traverse/__snapshots__/traverse.test.ts.snap @@ -2,14 +2,9 @@ exports[`cosmos/authz/v1beta1/authz 1`] = ` { - "importNames": { - "google/protobuf/any.proto": { - "Any": "Any", - }, - "google/protobuf/timestamp.proto": { - "Timestamp": "Timestamp", - }, - }, + "acceptsInterface": {}, + "implementsInterface": {}, + "importNames": {}, "imports": [ "cosmos_proto/cosmos.proto", "google/protobuf/timestamp.proto", @@ -259,14 +254,9 @@ exports[`cosmos/authz/v1beta1/authz 1`] = ` exports[`cosmos/tx/signing/v1beta1/signing 1`] = ` { - "importNames": { - "cosmos/crypto/multisig/v1beta1/multisig.proto": { - "CompactBitArray": "CompactBitArray", - }, - "google/protobuf/any.proto": { - "Any": "Any", - }, - }, + "acceptsInterface": {}, + "implementsInterface": {}, + "importNames": {}, "imports": [ "cosmos/crypto/multisig/v1beta1/multisig.proto", "google/protobuf/any.proto", @@ -601,20 +591,9 @@ exports[`cosmos/tx/signing/v1beta1/signing 1`] = ` exports[`cosmos/tx/v1beta1/tx 1`] = ` { - "importNames": { - "cosmos/base/v1beta1/coin.proto": { - "Coin": "Coin", - }, - "cosmos/crypto/multisig/v1beta1/multisig.proto": { - "CompactBitArray": "CompactBitArray", - }, - "cosmos/tx/signing/v1beta1/signing.proto": { - "SignMode": "SignMode", - }, - "google/protobuf/any.proto": { - "Any": "Any", - }, - }, + "acceptsInterface": {}, + "implementsInterface": {}, + "importNames": {}, "imports": [ "gogoproto/gogo.proto", "cosmos/crypto/multisig/v1beta1/multisig.proto", @@ -1640,14 +1619,9 @@ exports[`cosmos/tx/v1beta1/tx 1`] = ` exports[`cosmwasm/wasm/v1/proposal 1`] = ` { - "importNames": { - "cosmos/base/v1beta1/coin.proto": { - "Coin": "Coin", - }, - "cosmwasm/wasm/v1/types.proto": { - "AccessConfig": "AccessConfig", - }, - }, + "acceptsInterface": {}, + "implementsInterface": {}, + "importNames": {}, "imports": [ "gogoproto/gogo.proto", "cosmos/base/v1beta1/coin.proto", @@ -2496,17 +2470,9 @@ exports[`cosmwasm/wasm/v1/proposal 1`] = ` exports[`cosmwasm/wasm/v1/query 1`] = ` { - "importNames": { - "cosmos/base/query/v1beta1/pagination.proto": { - "PageRequest": "PageRequest", - "PageResponse": "PageResponse", - }, - "cosmwasm/wasm/v1/types.proto": { - "ContractCodeHistoryEntry": "ContractCodeHistoryEntry", - "ContractInfo": "ContractInfo", - "Model": "Model", - }, - }, + "acceptsInterface": {}, + "implementsInterface": {}, + "importNames": {}, "imports": [ "gogoproto/gogo.proto", "cosmwasm/wasm/v1/types.proto", @@ -3915,19 +3881,9 @@ exports[`cosmwasm/wasm/v1/query 1`] = ` exports[`google/api/expr/v1alpha1/checked 1`] = ` { - "importNames": { - "google/api/expr/v1alpha1/syntax.proto": { - "Constant": "Constant", - "Expr": "Expr", - "SourceInfo": "SourceInfo", - }, - "google/protobuf/empty.proto": { - "Empty": "Empty", - }, - "google/protobuf/struct.proto": { - "NullValue": "NullValue", - }, - }, + "acceptsInterface": {}, + "implementsInterface": {}, + "importNames": {}, "imports": [ "google/api/expr/v1alpha1/syntax.proto", "google/protobuf/empty.proto", @@ -5070,14 +5026,9 @@ exports[`google/api/expr/v1alpha1/checked 1`] = ` exports[`osmosis/claim/v1beta1/params 1`] = ` { - "importNames": { - "google/protobuf/duration.proto": { - "Duration": "Duration", - }, - "google/protobuf/timestamp.proto": { - "Timestamp": "Timestamp", - }, - }, + "acceptsInterface": {}, + "implementsInterface": {}, + "importNames": {}, "imports": [ "gogoproto/gogo.proto", "google/protobuf/duration.proto", @@ -5218,11 +5169,9 @@ exports[`osmosis/claim/v1beta1/params 1`] = ` exports[`osmosis/gamm/v1beta1/tx 1`] = ` { - "importNames": { - "cosmos/base/v1beta1/coin.proto": { - "Coin": "Coin", - }, - }, + "acceptsInterface": {}, + "implementsInterface": {}, + "importNames": {}, "imports": [ "gogoproto/gogo.proto", "cosmos/base/v1beta1/coin.proto", diff --git a/packages/parser/__tests__/bad.traversal.test.ts b/packages/parser/__tests__/traverse/bad.traversal.test.ts similarity index 93% rename from packages/parser/__tests__/bad.traversal.test.ts rename to packages/parser/__tests__/traverse/bad.traversal.test.ts index 90ed5dbf69..3c27daaab5 100644 --- a/packages/parser/__tests__/bad.traversal.test.ts +++ b/packages/parser/__tests__/traverse/bad.traversal.test.ts @@ -1,5 +1,5 @@ import { ProtoRef } from '@osmonauts/types'; -import { ProtoStore, parseProto } from '../src/index' +import { ProtoStore, parseProto } from '../../src/index' const store = new ProtoStore(); diff --git a/packages/parser/__tests__/traverse-all.test.ts b/packages/parser/__tests__/traverse/traverse-all.test.ts similarity index 96% rename from packages/parser/__tests__/traverse-all.test.ts rename to packages/parser/__tests__/traverse/traverse-all.test.ts index 858c86bdb8..655f216188 100644 --- a/packages/parser/__tests__/traverse-all.test.ts +++ b/packages/parser/__tests__/traverse/traverse-all.test.ts @@ -1,4 +1,4 @@ -import { getTestProtoStore } from '../test-utils'; +import { getTestProtoStore } from '../../test-utils'; const store = getTestProtoStore(); describe('osmosis/gamm/v1beta1/tx', () => { diff --git a/packages/parser/__tests__/traverse.checked.test.ts b/packages/parser/__tests__/traverse/traverse.checked.test.ts similarity index 78% rename from packages/parser/__tests__/traverse.checked.test.ts rename to packages/parser/__tests__/traverse/traverse.checked.test.ts index aba5a40fe2..fc87dd3bfa 100644 --- a/packages/parser/__tests__/traverse.checked.test.ts +++ b/packages/parser/__tests__/traverse/traverse.checked.test.ts @@ -1,5 +1,5 @@ -import { importLookup, protoImportLookup, traverse } from '../src/'; -import { getTestProtoStore } from '../test-utils'; +import { importLookup, protoImportLookup, traverse } from '../../src'; +import { getTestProtoStore } from '../../test-utils'; const store = getTestProtoStore(); it('google/api/expr/v1alpha1/checked', () => { diff --git a/packages/parser/__tests__/traverse.test.ts b/packages/parser/__tests__/traverse/traverse.test.ts similarity index 93% rename from packages/parser/__tests__/traverse.test.ts rename to packages/parser/__tests__/traverse/traverse.test.ts index c4fad168b6..cbcc7f2b48 100644 --- a/packages/parser/__tests__/traverse.test.ts +++ b/packages/parser/__tests__/traverse/traverse.test.ts @@ -1,6 +1,6 @@ -import { traverse } from '../src/'; -import { getNested } from '../src/utils' -import { getTestProtoStore } from '../test-utils'; +import { traverse } from '../../src'; +import { getNested } from '../../src/utils' +import { getTestProtoStore } from '../../test-utils'; const store = getTestProtoStore(); diff --git a/packages/parser/__tests__/utils.test.ts b/packages/parser/__tests__/utils.test.ts new file mode 100644 index 0000000000..8e30196576 --- /dev/null +++ b/packages/parser/__tests__/utils.test.ts @@ -0,0 +1,79 @@ +import cases from 'jest-in-case' +import { isRefIncluded } from '../src'; +import { getTestProtoStore } from '../test-utils'; + +const store = getTestProtoStore(); + +cases(`isRefIncluded`, opts => { + const ref = store.findProto(opts.value); + const included = isRefIncluded(ref, { + patterns: [ + 'osmosis/**/gamm/**/query.proto' + ], + protos: [ + 'akash/cert/v1beta2/query.proto' + ], + packages: [ + 'cosmos.bank.v1beta1', + 'cosmos.gov.v1beta1', + 'evmos.erc20.v1' + ] + }); + expect(included).toMatchSnapshot(); +}, + [ + 'google/api/expr/conformance/v1alpha1/conformance_service.proto', + 'osmosis/gamm/v2/query.proto', + 'osmosis/gamm/v1beta1/query.proto', + 'osmosis/gamm/v1beta1/tx.proto' + ].map(el => { + return { + name: el, + value: el + } + }) +); + +cases(`empty`, opts => { + const ref = store.findProto(opts.value); + const included = isRefIncluded(ref, { + patterns: [], + protos: [], + packages: [] + }); + expect(included).toMatchSnapshot(); +}, + [ + 'google/api/expr/conformance/v1alpha1/conformance_service.proto', + 'osmosis/gamm/v2/query.proto', + 'osmosis/gamm/v1beta1/query.proto', + 'osmosis/gamm/v1beta1/tx.proto' + ].map(el => { + return { + name: el, + value: el + } + }) +); + +cases(`pkg`, opts => { + const ref = store.findProto(opts.value); + const included = isRefIncluded(ref, { + patterns: [], + protos: [], + packages: ['osmosis.gamm.v1beta1'] + }); + expect(included).toMatchSnapshot(); +}, + [ + 'google/api/expr/conformance/v1alpha1/conformance_service.proto', + 'osmosis/gamm/v2/query.proto', + 'osmosis/gamm/v1beta1/query.proto', + 'osmosis/gamm/v1beta1/tx.proto' + ].map(el => { + return { + name: el, + value: el + } + }) +); diff --git a/packages/parser/package.json b/packages/parser/package.json index 7e8b1a010c..4825f1f38c 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -1,6 +1,6 @@ { "name": "@osmonauts/proto-parser", - "version": "0.34.0", + "version": "0.35.0", "description": "A Parser for Cosmos Protobufs", "author": "Dan Lynch ", "homepage": "https://github.com/osmosis-labs/telescope/tree/master/packages/parser#readme", @@ -58,6 +58,7 @@ "eslint-config-prettier": "^8.5.0", "eslint-plugin-prettier": "^4.0.0", "jest": "^29.1.2", + "jest-in-case": "^1.0.2", "long": "^5.2.0", "prettier": "^2.7.0", "regenerator-runtime": "^0.13.7", @@ -66,10 +67,11 @@ }, "dependencies": { "@babel/runtime": "^7.19.0", - "@osmonauts/types": "^0.26.0", + "@osmonauts/types": "^0.27.0", "@pyramation/protobufjs": "6.11.5", "dotty": "0.1.2", "glob": "8.0.3", + "minimatch": "5.1.0", "mkdirp": "1.0.4" } } diff --git a/packages/parser/src/store.ts b/packages/parser/src/store.ts index 9f13553992..6f525c90d9 100644 --- a/packages/parser/src/store.ts +++ b/packages/parser/src/store.ts @@ -2,9 +2,9 @@ import { sync as glob } from 'glob'; import { parse } from '@pyramation/protobufjs'; import { readFileSync } from 'fs'; import { join, resolve as pathResolve } from 'path'; -import { ALLOWED_RPC_SERVICES, ProtoDep, ProtoRef, ProtoServiceMethod, TelescopeOptions } from '@osmonauts/types'; -import { getNestedProto, getPackageAndNestedFromStr } from './utils'; -import { traverse } from './traverse'; +import { ALLOWED_RPC_SERVICES, ProtoDep, ProtoField, ProtoRef, ProtoServiceMethod, ProtoType, TelescopeOptions } from '@osmonauts/types'; +import { createTypeUrlTypeMap, getNestedProto, getPackageAndNestedFromStr } from './utils'; +import { parseFullyTraversedProtoImports, symbolsToImportNames, TraversalSymbols, traverse } from './traverse'; import { lookupAny, lookupAnyFromImports } from './lookup'; import { defaultTelescopeOptions, TelescopeLogLevel } from '@osmonauts/types'; @@ -58,6 +58,7 @@ export class ProtoStore { responses: Record = {}; _traversed: boolean = false; + _symbols: TraversalSymbols[] = []; constructor(protoDirs: string[] = [], options: TelescopeOptions = defaultTelescopeOptions) { this.protoDirs = protoDirs.map(protoDir => pathResolve(protoDir)); @@ -214,7 +215,30 @@ export class ProtoStore { proto: ref.proto, traversed: traverse(this, ref) }; - }) + }); + this._symbols = parseFullyTraversedProtoImports(this); + + // process import names + this.protos = this.protos.map((ref: ProtoRef) => { + const traversed = ref.traversed; + const symbs = this._symbols + .filter(f => f.ref === ref.filename); + traversed.importNames = symbolsToImportNames(ref, symbs); + + // now add any inferred imports as a result of accepts/implements + symbs + .filter(f => f.ref !== f.source) + .forEach(f => { + traversed.parsedImports[f.source] = traversed.parsedImports[f.source] || []; + traversed.parsedImports[f.source] = [...new Set([...traversed.parsedImports[f.source], f.symbolName])]; + }) + + return { + ...ref, + traversed + }; + }); + this._traversed = true; } @@ -228,6 +252,10 @@ export class ProtoStore { return lookupAnyFromImports(this, ref, name); } + getTypeUrlMap(ref: ProtoRef) { + return createTypeUrlTypeMap(this, ref); + } + // DOCUMENTATION getServices(myBase: string): Record { diff --git a/packages/parser/src/traverse.ts b/packages/parser/src/traverse.ts index 406d3adfb3..31af4fcd5d 100644 --- a/packages/parser/src/traverse.ts +++ b/packages/parser/src/traverse.ts @@ -1,56 +1,233 @@ -import { ProtoRoot, ProtoRef, ProtoType, ProtoService, ProtoField, ProtoServiceMethod, ProtoServiceMethodInfo } from '@osmonauts/types'; +import { + TraversedProtoRoot, + ProtoRef, + ProtoType, + ProtoService, + ProtoField, + ProtoServiceMethod, + ProtoServiceMethodInfo, + TraverseRecord, + TraverseImport, + TraverseAccept, + TraverseImplement, + TraverseExport, + TraverseLocalSymbol, + TraverseImportNames +} from '@osmonauts/types'; +import { + getPluginValue +} from '@osmonauts/ast'; + import { Service, Type, Field, Enum, Root, Namespace } from '@pyramation/protobufjs'; import { importLookup, lookup, lookupAny, lookupNested, protoScopeImportLookup } from './lookup'; import { parseService } from './services'; import { ProtoStore } from './store'; import { instanceType, lookupSymbolScopes, SCALAR_TYPES } from './utils'; +export interface TraverseContext { + imports: TraverseImport; + acceptsInterface: TraverseAccept; + implementsInterface: TraverseImplement; + exports: TraverseExport; + store: ProtoStore; + ref: ProtoRef; +} + +export class TraverseContext implements TraverseContext { + constructor(store: ProtoStore, ref: ProtoRef) { + this.store = store; + this.ref = ref; + this.acceptsInterface = {}; + this.implementsInterface = {}; + this.imports = {}; + this.exports = {}; + } + + addImport(filename: string, symbolName: string) { + this.imports[filename] = this.imports[filename] || []; + this.imports[filename] = [...new Set([...this.imports[filename], symbolName])]; + } + + addImplements(symbolName: string, msgName: string) { + this.implementsInterface = this.implementsInterface || {}; + this.implementsInterface[symbolName] = this.implementsInterface[symbolName] || []; + this.implementsInterface[symbolName] = [...new Set([...this.implementsInterface[symbolName], msgName])]; + } + + addAccepts(symbolName: string, msgName: string) { + this.acceptsInterface[symbolName] = this.acceptsInterface[symbolName] || []; + this.acceptsInterface[symbolName] = [...new Set([...this.acceptsInterface[symbolName], msgName])]; + } + + addExport(symbolName: string) { + this.exports[symbolName] = true; + } +} + +export type TraversalSymbols = TraverseLocalSymbol & { + ref: string; +} + +export const symbolsToImportNames = ( + ref: ProtoRef, + symbols: TraversalSymbols[] +): TraverseImportNames => { + return symbols.reduce((m, v) => { + // imports to self... nope. + if (v.source === ref.filename) return m; + + m[v.source] = m[v.source] || {}; + m[v.source][v.symbolName] = v.readAs; + return m; + }, {}); +}; + +export const parseFullyTraversedProtoImports = ( + store: ProtoStore +): TraversalSymbols[] => { + const protos = store.getProtos(); + const records: TraverseRecord[] = []; + const symbols: TraversalSymbols[] = []; + + // AGGREGATE ALL implements + + protos.forEach(ref => { + const enabled = getPluginValue('interfaces.enabled', ref.proto.package, store.options); + if (!enabled) return; + + // + const implementsInterface = ref.traversed?.implementsInterface ?? {}; + Object.keys(implementsInterface).forEach(implementsType => { + implementsInterface[implementsType].forEach(msgName => { + records.push({ + filename: ref.filename, + implementsType, + msgName + }) + }) + }); + }); + + protos.forEach(ref => { + const localSymbols: TraverseLocalSymbol[] = []; + + const hasConflict = ( + symbolName: string + ) => { + return localSymbols.filter(a => a.symbolName === symbolName).length > 1 + } + const findAvailableName = ( + symbolName: string + ) => { + let counter = 1; + if (!hasConflict(symbolName)) return symbolName; + while (true) { + const testName = symbolName + counter; + const found = localSymbols.find(a => a.readAs === testName); + if (found) { + counter++; + } else { + return testName; + } + + } + }; + + Object.keys(ref.traversed?.parsedExports ?? {}).forEach(e => { + localSymbols.push({ + type: 'export', + source: ref.filename, + symbolName: e, + readAs: e + }) + }) + Object.keys(ref.traversed?.parsedImports ?? {}).forEach(source => { + const imps = ref.traversed?.parsedImports?.[source] ?? []; + imps.forEach(im => { + localSymbols.push({ + type: 'import', + source, + symbolName: im, + readAs: im + }) + }); + }); + + Object.keys(ref.traversed?.acceptsInterface ?? {}).forEach(implementsType => { + const enabled = getPluginValue('interfaces.enabled', ref.proto.package, store.options); + if (!enabled) return; + + const recordsThatMatter = records.filter(rec => rec.implementsType === implementsType); + const notYetInImports = recordsThatMatter.filter(r => { + return !localSymbols.find(l => l.source === r.filename && l.symbolName === r.msgName); + }); + const alreadyInImports = recordsThatMatter.filter(r => { + return localSymbols.find(l => l.source === r.filename && l.symbolName === r.msgName); + }); + notYetInImports.forEach(imp => { + localSymbols.push({ + type: 'import', + source: imp.filename, + readAs: imp.msgName, + symbolName: imp.msgName, + implementsType: imp.implementsType + }) + }); + // if already imported, addd implementsType + alreadyInImports.forEach(imp => { + const index = localSymbols.findIndex(l => l.source === imp.filename && l.symbolName === imp.msgName); + localSymbols[index].implementsType = imp.implementsType; + }); + }); + + // update localSymbols for any conflicts + localSymbols.forEach(sym => { + // aside from exports, update readAs names... + if ( + sym.readAs === sym.symbolName && + hasConflict(sym.symbolName) && + sym.type !== 'export' + ) { + sym.readAs = findAvailableName(sym.symbolName) + } + // add to symbols + symbols.push({ + ref: ref.filename, + ...sym + }); + }) + }); + return symbols; +}; + export const traverse = (store: ProtoStore, ref: ProtoRef) => { - const imports: Record = {}; - const exports: Record = {}; - const obj: ProtoRoot & { - parsedImports: Record; - parsedExports: Record; - importNames: Record; - } = { + const context = new TraverseContext(store, ref); + const obj: TraversedProtoRoot = { imports: ref.proto.imports, package: ref.proto.package, root: recursiveTraversal( store, ref, ref.proto.root, - imports, - exports, + context, [], false ), parsedImports: null, parsedExports: null, - importNames: null, + importNames: {}, }; - obj.parsedImports = imports; - obj.parsedExports = exports; - let counter = 1; - obj.importNames = Object.entries(imports).reduce((m, [path, names]) => { - m[path] = m[path] || {}; - names.forEach(importName => { - const hasConflict = Object.entries(imports).some(([otherPath, otherNames]) => { - if (path === otherPath) return false; - if (otherNames.includes(importName)) return true; - }); - if (hasConflict || exports.hasOwnProperty(importName)) { - m[path][importName] = importName + counter++; - } else { - m[path][importName] = importName; - } - }) - return m; - }, {}); + obj.parsedImports = context.imports; + obj.parsedExports = context.exports; + + obj.acceptsInterface = context.acceptsInterface; + obj.implementsInterface = context.implementsInterface; + // just bc devs use proto syntax for types in the same file // does not mean we need to import them // delete any imports related to "this" file - delete obj.importNames[ref.filename]; + // delete obj.importNames[ref.filename]; delete obj.parsedImports[ref.filename]; return obj; }; @@ -66,7 +243,7 @@ const traverseFields = ( store: ProtoStore, ref: ProtoRef, obj: any, - imports: object, + context: TraverseContext, traversal: string[] ): Record => { return Object.keys(obj.fields).reduce((m, mykey) => { @@ -93,6 +270,15 @@ const traverseFields = ( return field; } + const implementsAcceptsAny = getPluginValue('interfaces.enabled', ref.proto.package, store.options); + if (implementsAcceptsAny && field.options?.['(cosmos_proto.accepts_interface)']) { + const value = field.options['(cosmos_proto.accepts_interface)']; + // some of these contain a comma ... + value.split(',').map(a => a.trim()).forEach(name => { + context.addAccepts(name, obj.name); + }); + } + let found: any = null; if (SCALAR_TYPES.includes(field.type)) { @@ -129,8 +315,8 @@ const traverseFields = ( found = importLookup(store, ref, field.type); if (found) { - imports[found.import] = imports[found.import] || []; - imports[found.import] = [...new Set([...imports[found.import], found.name])]; + context.addImport(found.import, found.name); + m[fieldName] = { parsedType: instanceType(found.obj), scopeType: 'import', @@ -163,8 +349,7 @@ const traverseFields = ( for (let lookupType of typeNames) { found = protoScopeImportLookup(store, ref, lookupType); if (found) { - imports[found.import] = imports[found.import] || []; - imports[found.import] = [...new Set([...imports[found.import], found.name])]; + context.addImport(found.import, found.name); m[fieldName] = { parsedType: instanceType(found.obj), @@ -188,8 +373,8 @@ const traverseFields = ( for (let lookupType of typeNames) { found = protoScopeImportLookup(store, importRef, lookupType); if (found) { - imports[found.import] = imports[found.import] || []; - imports[found.import] = [...new Set([...imports[found.import], found.name])]; + + context.addImport(found.import, found.name); m[fieldName] = { parsedType: instanceType(found.obj), scopeType: 'protoImport', @@ -217,22 +402,20 @@ const traverseType = ( store: ProtoStore, ref: ProtoRef, obj: any, - imports: object, - exports: object, + context: TraverseContext, traversal: string[], isNested: boolean ): ProtoType => { let nested = null; if (obj.nested) { nested = Object.keys(obj.nested).reduce((m, key) => { - m[key] = recursiveTraversal(store, ref, obj.nested[key], imports, exports, [...traversal, key], true); + m[key] = recursiveTraversal(store, ref, obj.nested[key], context, [...traversal, key], true); return m; }, {}); } if (!isNested) { - exports[obj.name] = exports[obj.name] || []; - exports[obj.name] = true; + context.addExport(obj.name); } const traversed = { @@ -246,7 +429,7 @@ const traverseType = ( }; return m; }, {}) : undefined, - fields: traverseFields(store, ref, obj, imports, traversal), + fields: traverseFields(store, ref, obj, context, traversal), nested, keyTypes: [], comment: obj.comment @@ -267,10 +450,17 @@ const traverseType = ( } traversed.keyTypes = keyTypes; - return traversed; + + const implementsAcceptsAny = getPluginValue('interfaces.enabled', ref.proto.package, store.options); + if (implementsAcceptsAny && traversed.options?.["(cosmos_proto.implements_interface)"]) { + const name = traversed.options['(cosmos_proto.implements_interface)']; + context.addImplements(name, obj.name); + } + + return traversed as ProtoType; }; -const traverseEnum = (store: ProtoStore, ref: ProtoRef, obj: any, imports: object) => { +const traverseEnum = (store: ProtoStore, ref: ProtoRef, obj: any, context: TraverseContext,) => { return { type: 'Enum', name: obj.name, @@ -278,7 +468,7 @@ const traverseEnum = (store: ProtoStore, ref: ProtoRef, obj: any, imports: objec } }; -const traverseField = (store: ProtoStore, ref: ProtoRef, obj: any, imports: object) => { +const traverseField = (store: ProtoStore, ref: ProtoRef, obj: any, context: TraverseContext,) => { return { // type is already a property on field name: obj.name, @@ -290,7 +480,7 @@ const traverseServiceMethod = ( store: ProtoStore, ref: ProtoRef, obj: any, - imports: object, + context: TraverseContext, name: string, traversal: string[] ) => { @@ -306,7 +496,7 @@ const traverseServiceMethod = ( } - const fields = traverseFields(store, ref, requestObject.obj, imports, traversal); + const fields = traverseFields(store, ref, requestObject.obj, context, traversal); const info: ProtoServiceMethodInfo = parseService({ options, fields @@ -352,13 +542,13 @@ const traverseService = ( store: ProtoStore, ref: ProtoRef, obj: any, - imports: object, + context: TraverseContext, traversal: string[] ): ProtoService => { const json = obj.toJSON({ keepComments: true }); const methods = Object.keys(json.methods).reduce((m, key) => { m[key] = traverseServiceMethod( - store, ref, json, imports, key, traversal + store, ref, json, context, key, traversal ); return m; }, {}) @@ -374,27 +564,26 @@ export const recursiveTraversal = ( store: ProtoStore, ref: ProtoRef, obj: any, - imports: object, - exports: object, + context: TraverseContext, traversal: string[], isNested: boolean ) => { if (obj instanceof Type) { - return traverseType(store, ref, obj, imports, exports, traversal, isNested); + return traverseType(store, ref, obj, context, traversal, isNested); } if (obj instanceof Enum) { - return traverseEnum(store, ref, obj, imports); + return traverseEnum(store, ref, obj, context); } if (obj instanceof Service) { - return traverseService(store, ref, obj, imports, traversal); + return traverseService(store, ref, obj, context, traversal); } if (obj instanceof Field) { - return traverseField(store, ref, obj, imports); + return traverseField(store, ref, obj, context); } if (obj instanceof Root) { if (obj.nested) { return Object.keys(obj.nested).reduce((m, key) => { - m.nested[key] = recursiveTraversal(store, ref, obj.nested[key], imports, exports, [...traversal, key], isNested); + m.nested[key] = recursiveTraversal(store, ref, obj.nested[key], context, [...traversal, key], isNested); return m; }, { type: 'Root', @@ -407,7 +596,7 @@ export const recursiveTraversal = ( if (obj instanceof Namespace) { if (obj.nested) { return Object.keys(obj.nested).reduce((m, key) => { - m.nested[key] = recursiveTraversal(store, ref, obj.nested[key], imports, exports, [...traversal, key], isNested); + m.nested[key] = recursiveTraversal(store, ref, obj.nested[key], context, [...traversal, key], isNested); return m; }, { type: 'Namespace', diff --git a/packages/parser/src/utils.ts b/packages/parser/src/utils.ts index a624d0ac84..ad04facb5c 100644 --- a/packages/parser/src/utils.ts +++ b/packages/parser/src/utils.ts @@ -1,6 +1,9 @@ import dotty from 'dotty'; import { Service, Type, Enum, Root, Namespace } from '@pyramation/protobufjs'; -import { ProtoRoot } from '@osmonauts/types'; +import { InterfaceTypeUrlMap, ProtoRef, ProtoRoot, ProtoType } from '@osmonauts/types'; +import { ProtoStore } from './store'; +import { GenericParseContext, getTypeUrl, getAminoTypeName, getPluginValue } from '@osmonauts/ast'; +import minimatch from 'minimatch'; export const getNestedProto = (root: ProtoRoot) => { const nestedPath = 'root.nested.' + root.package.split('.').join('.nested.') + '.nested'; @@ -19,6 +22,9 @@ export const getNested = (root: ProtoRoot, path: string[]) => { }; // https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.cc#L3798-L3812 +// NOTE: sometimes you need to pass in `.Dummy` for the first call, +// for example, osmosis.gamm.v1beta1.Dummy, so the first pop() +// that gets called, it will still look relative to the current module scope export const lookupSymbolScopes = (name: string, relativeTo: string, list?: string[]) => { // fully-qualified name if (name.startsWith('.')) return [name.replace(/^\./, '')]; @@ -32,6 +38,83 @@ export const lookupSymbolScopes = (name: string, relativeTo: string, list?: stri return lookupSymbolScopes(name, relativeToParts.join('.'), [...list, newName]); }; +export const createTypeUrlTypeMap = ( + store: ProtoStore, + fromRef: ProtoRef // ref to create HashMap for (includes proper import names) +): InterfaceTypeUrlMap => { + const ctx = new GenericParseContext(fromRef, store, store.options); + const result = {}; + const interfaces = []; + Object.keys(fromRef.traversed?.acceptsInterface ?? {}).forEach(implementsType => { + interfaces.push(implementsType); + }); + + store.getProtos().forEach(ref => { + if ( + ref.traversed?.implementsInterface + ) { + Object.keys(ref.traversed.implementsInterface).forEach(implementsType => { + if (!interfaces.includes(implementsType)) return; + const types = ref.traversed?.implementsInterface[implementsType]; + result[implementsType] = result[implementsType] || []; + result[implementsType].push({ + ref: ref.filename, + pkg: ref.proto.package, + types: types?.map(type => { + const protoType: ProtoType = getNestedProto(ref.proto)[type]; + const typeUrl = getTypeUrl(ref.proto, protoType); + const aminoType = getAminoTypeName(ctx, ref.proto, protoType); + return { + typeUrl, + aminoType, + type, + importAs: ctx.getTypeNameFromFieldName( + type, ref.filename + ) + } + }) + }); + }); + } + }); + return result; +}; + +export const isRefIncluded = ( + ref: ProtoRef, + include?: { + patterns?: string[]; + packages?: string[]; + protos?: string[]; + } +) => { + // if no include object, no filter + if (!include) return true; + // if no arrays are populated, no filter + if ( + !include.patterns?.length && + !include.packages?.length && + !include.protos?.length + ) { + return true; + } + + if (include?.patterns?.some(pattern => minimatch(ref.filename, pattern))) { + return true; + } + + if (include?.packages?.includes(ref.proto.package)) { + return true; + } + + if (include?.protos?.includes(ref.filename)) { + return true; + } + + return false; + +}; + export const getPackageAndNestedFromStr = (type: string, pkg: string) => { if (type.startsWith(pkg) && type.length > pkg.length) { const nested = type.substring(pkg.length + 1); diff --git a/packages/parser/test-utils/index.ts b/packages/parser/test-utils/index.ts index 855655cf61..d923377246 100644 --- a/packages/parser/test-utils/index.ts +++ b/packages/parser/test-utils/index.ts @@ -37,7 +37,7 @@ const defaultTelescopeOptionsForTesting = { export const defaultTelescopeOptions = deepmerge(teleDefaults, defaultTelescopeOptionsForTesting); export const getTestProtoStore = (options?: TelescopeOptions) => { - const store = new ProtoStore([__dirname + '/../../../__fixtures__/chain1'], options ? deepmerge(defaultTelescopeOptions, options) : defaultTelescopeOptions); + const store = new ProtoStore([__dirname + '/../../../__fixtures__/chain1'], options ? deepmerge(defaultTelescopeOptions, options) : deepmerge(defaultTelescopeOptions, {})); return store; } diff --git a/packages/parser/types/store.d.ts b/packages/parser/types/store.d.ts index 28e8ffa039..5e4371ca26 100644 --- a/packages/parser/types/store.d.ts +++ b/packages/parser/types/store.d.ts @@ -1,4 +1,5 @@ import { ProtoDep, ProtoRef, ProtoServiceMethod, TelescopeOptions } from '@osmonauts/types'; +import { TraversalSymbols } from './traverse'; interface ParseProtoOptions { keepCase?: boolean; alternateCommentMode?: boolean; @@ -15,6 +16,7 @@ export declare class ProtoStore { requests: Record; responses: Record; _traversed: boolean; + _symbols: TraversalSymbols[]; constructor(protoDirs?: string[], options?: TelescopeOptions); findProto(filename: any): ProtoRef; findProtoWhere(fn: (ref: ProtoRef) => boolean): ProtoRef; @@ -41,6 +43,7 @@ export declare class ProtoStore { traverseAll(): void; get(from: ProtoRef, name: string): import("./lookup").Lookup; getImportFromRef(ref: ProtoRef, name: string): import("./lookup").Lookup; + getTypeUrlMap(ref: ProtoRef): import("@osmonauts/types").InterfaceTypeUrlMap; getServices(myBase: string): Record; } export {}; diff --git a/packages/parser/types/traverse.d.ts b/packages/parser/types/traverse.d.ts index af6236249a..afdf03e5cc 100644 --- a/packages/parser/types/traverse.d.ts +++ b/packages/parser/types/traverse.d.ts @@ -1,8 +1,24 @@ -import { ProtoRoot, ProtoRef } from '@osmonauts/types'; +import { TraversedProtoRoot, ProtoRef, TraverseImport, TraverseAccept, TraverseImplement, TraverseExport, TraverseLocalSymbol, TraverseImportNames } from '@osmonauts/types'; import { ProtoStore } from './store'; -export declare const traverse: (store: ProtoStore, ref: ProtoRef) => ProtoRoot & { - parsedImports: Record; - parsedExports: Record; - importNames: Record; +export interface TraverseContext { + imports: TraverseImport; + acceptsInterface: TraverseAccept; + implementsInterface: TraverseImplement; + exports: TraverseExport; + store: ProtoStore; + ref: ProtoRef; +} +export declare class TraverseContext implements TraverseContext { + constructor(store: ProtoStore, ref: ProtoRef); + addImport(filename: string, symbolName: string): void; + addImplements(symbolName: string, msgName: string): void; + addAccepts(symbolName: string, msgName: string): void; + addExport(symbolName: string): void; +} +export declare type TraversalSymbols = TraverseLocalSymbol & { + ref: string; }; -export declare const recursiveTraversal: (store: ProtoStore, ref: ProtoRef, obj: any, imports: object, exports: object, traversal: string[], isNested: boolean) => any; +export declare const symbolsToImportNames: (ref: ProtoRef, symbols: TraversalSymbols[]) => TraverseImportNames; +export declare const parseFullyTraversedProtoImports: (store: ProtoStore) => TraversalSymbols[]; +export declare const traverse: (store: ProtoStore, ref: ProtoRef) => TraversedProtoRoot; +export declare const recursiveTraversal: (store: ProtoStore, ref: ProtoRef, obj: any, context: TraverseContext, traversal: string[], isNested: boolean) => any; diff --git a/packages/parser/types/utils.d.ts b/packages/parser/types/utils.d.ts index fc5aef6b0a..2a0e4df675 100644 --- a/packages/parser/types/utils.d.ts +++ b/packages/parser/types/utils.d.ts @@ -1,8 +1,15 @@ -import { ProtoRoot } from '@osmonauts/types'; +import { InterfaceTypeUrlMap, ProtoRef, ProtoRoot } from '@osmonauts/types'; +import { ProtoStore } from './store'; export declare const getNestedProto: (root: ProtoRoot) => any; export declare const getNestedProtoGeneric: (root: ProtoRoot, path: string[]) => any; export declare const getNested: (root: ProtoRoot, path: string[]) => any; export declare const lookupSymbolScopes: (name: string, relativeTo: string, list?: string[]) => any; +export declare const createTypeUrlTypeMap: (store: ProtoStore, fromRef: ProtoRef) => InterfaceTypeUrlMap; +export declare const isRefIncluded: (ref: ProtoRef, include?: { + patterns?: string[]; + packages?: string[]; + protos?: string[]; +}) => boolean; export declare const getPackageAndNestedFromStr: (type: string, pkg: string) => { nested: string; package: string; diff --git a/packages/telescope/CHANGELOG.md b/packages/telescope/CHANGELOG.md index 4af28b35ea..b7949268b9 100644 --- a/packages/telescope/CHANGELOG.md +++ b/packages/telescope/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.81.0](https://github.com/osmosis-labs/telescope/compare/@osmonauts/telescope@0.80.0-rc.1...@osmonauts/telescope@0.81.0) (2022-12-18) + + +### Reverts + +* Revert "RC versions ready" ([04081a9](https://github.com/osmosis-labs/telescope/commit/04081a9d1f80feb3ae664bce2d1364850b3daaca)) +* Revert "chore(release): publish" ([086a55f](https://github.com/osmosis-labs/telescope/commit/086a55f14c5ca33ee70a0e2121406dd37eb643f1)) + + + + + # [0.80.0](https://github.com/osmosis-labs/telescope/compare/@osmonauts/telescope@0.79.0...@osmonauts/telescope@0.80.0) (2022-11-25) **Note:** Version bump only for package @osmonauts/telescope diff --git a/packages/telescope/__tests__/__snapshots__/bundler.test.ts.snap b/packages/telescope/__tests__/__snapshots__/bundler.test.ts.snap index bf895417da..f81abdd939 100644 --- a/packages/telescope/__tests__/__snapshots__/bundler.test.ts.snap +++ b/packages/telescope/__tests__/__snapshots__/bundler.test.ts.snap @@ -830,46 +830,44 @@ import * as _264 from "./gamm/v1beta1/tx"; import * as _265 from "./gamm/pool-models/balancer/tx/tx"; import * as _266 from "./gamm/pool-models/stableswap/stableswap_pool"; import * as _267 from "./gamm/pool-models/stableswap/tx"; -import * as _268 from "./incentives/gauge"; -import * as _269 from "./incentives/genesis"; -import * as _270 from "./incentives/params"; -import * as _271 from "./incentives/query"; -import * as _272 from "./incentives/tx"; -import * as _273 from "./lockup/genesis"; -import * as _274 from "./lockup/lock"; -import * as _275 from "./lockup/query"; -import * as _276 from "./lockup/tx"; -import * as _277 from "./mint/v1beta1/genesis"; -import * as _278 from "./mint/v1beta1/mint"; -import * as _279 from "./mint/v1beta1/query"; -import * as _280 from "./pool-incentives/v1beta1/genesis"; -import * as _281 from "./pool-incentives/v1beta1/gov"; -import * as _282 from "./pool-incentives/v1beta1/incentives"; -import * as _283 from "./pool-incentives/v1beta1/query"; -import * as _284 from "./store/v1beta1/tree"; -import * as _285 from "./streamswap/v1/event"; -import * as _286 from "./streamswap/v1/genesis"; -import * as _287 from "./streamswap/v1/params"; -import * as _288 from "./streamswap/v1/query"; -import * as _289 from "./streamswap/v1/state"; -import * as _290 from "./streamswap/v1/tx"; -import * as _291 from "./superfluid/genesis"; -import * as _292 from "./superfluid/params"; -import * as _293 from "./superfluid/query"; -import * as _294 from "./superfluid/superfluid"; -import * as _295 from "./superfluid/tx"; -import * as _296 from "./tokenfactory/v1beta1/authorityMetadata"; -import * as _297 from "./tokenfactory/v1beta1/genesis"; -import * as _298 from "./tokenfactory/v1beta1/params"; -import * as _299 from "./tokenfactory/v1beta1/query"; -import * as _300 from "./tokenfactory/v1beta1/tx"; -import * as _301 from "./twap/v1beta1/genesis"; -import * as _302 from "./twap/v1beta1/query"; -import * as _303 from "./twap/v1beta1/twap_record"; -import * as _304 from "./txfees/v1beta1/feetoken"; -import * as _305 from "./txfees/v1beta1/genesis"; -import * as _306 from "./txfees/v1beta1/gov"; -import * as _307 from "./txfees/v1beta1/query"; +import * as _268 from "./gamm/v2/query"; +import * as _269 from "./ibc-rate-limit/v1beta1/params"; +import * as _270 from "./ibc-rate-limit/v1beta1/query"; +import * as _271 from "./incentives/gauge"; +import * as _272 from "./incentives/genesis"; +import * as _273 from "./incentives/params"; +import * as _274 from "./incentives/query"; +import * as _275 from "./incentives/tx"; +import * as _276 from "./lockup/genesis"; +import * as _277 from "./lockup/lock"; +import * as _278 from "./lockup/params"; +import * as _279 from "./lockup/query"; +import * as _280 from "./lockup/tx"; +import * as _281 from "./mint/v1beta1/genesis"; +import * as _282 from "./mint/v1beta1/mint"; +import * as _283 from "./mint/v1beta1/query"; +import * as _284 from "./pool-incentives/v1beta1/genesis"; +import * as _285 from "./pool-incentives/v1beta1/gov"; +import * as _286 from "./pool-incentives/v1beta1/incentives"; +import * as _287 from "./pool-incentives/v1beta1/query"; +import * as _288 from "./sumtree/v1beta1/tree"; +import * as _289 from "./superfluid/genesis"; +import * as _290 from "./superfluid/params"; +import * as _291 from "./superfluid/query"; +import * as _292 from "./superfluid/superfluid"; +import * as _293 from "./superfluid/tx"; +import * as _294 from "./tokenfactory/v1beta1/authorityMetadata"; +import * as _295 from "./tokenfactory/v1beta1/genesis"; +import * as _296 from "./tokenfactory/v1beta1/params"; +import * as _297 from "./tokenfactory/v1beta1/query"; +import * as _298 from "./tokenfactory/v1beta1/tx"; +import * as _299 from "./twap/v1beta1/genesis"; +import * as _300 from "./twap/v1beta1/query"; +import * as _301 from "./twap/v1beta1/twap_record"; +import * as _302 from "./txfees/v1beta1/feetoken"; +import * as _303 from "./txfees/v1beta1/genesis"; +import * as _304 from "./txfees/v1beta1/gov"; +import * as _305 from "./txfees/v1beta1/query"; export namespace osmosis { export namespace claim { export const v1beta1 = { ..._255, @@ -900,69 +898,68 @@ export namespace osmosis { }; } } + export const v2 = { ..._268 + }; } - export const incentives = { ..._268, - ..._269, - ..._270, - ..._271, - ..._272 - }; - export const lockup = { ..._273, + export namespace ibcratelimit { + export const v1beta1 = { ..._269, + ..._270 + }; + } + export const incentives = { ..._271, + ..._272, + ..._273, ..._274, - ..._275, - ..._276 + ..._275 + }; + export const lockup = { ..._276, + ..._277, + ..._278, + ..._279, + ..._280 }; export namespace mint { - export const v1beta1 = { ..._277, - ..._278, - ..._279 - }; - } - export namespace poolincentives { - export const v1beta1 = { ..._280, - ..._281, + export const v1beta1 = { ..._281, ..._282, ..._283 }; } - export namespace store { - export const v1beta1 = { ..._284 + export namespace poolincentives { + export const v1beta1 = { ..._284, + ..._285, + ..._286, + ..._287 }; } - export namespace streamswap { - export const v1 = { ..._285, - ..._286, - ..._287, - ..._288, - ..._289, - ..._290 + export namespace store { + export const v1beta1 = { ..._288 }; } - export const superfluid = { ..._291, + export const superfluid = { ..._289, + ..._290, + ..._291, ..._292, - ..._293, - ..._294, - ..._295 + ..._293 }; export namespace tokenfactory { - export const v1beta1 = { ..._296, + export const v1beta1 = { ..._294, + ..._295, + ..._296, ..._297, - ..._298, - ..._299, - ..._300 + ..._298 }; } export namespace twap { - export const v1beta1 = { ..._301, - ..._302, - ..._303 + export const v1beta1 = { ..._299, + ..._300, + ..._301 }; } export namespace txfees { - export const v1beta1 = { ..._304, - ..._305, - ..._306, - ..._307 + export const v1beta1 = { ..._302, + ..._303, + ..._304, + ..._305 }; } }", @@ -970,36 +967,36 @@ export namespace osmosis { "tendermint": { "base": "tendermint", "bundle": "tendermint/bundle.ts", - "code": "import * as _308 from "./abci/types"; -import * as _309 from "./crypto/keys"; -import * as _310 from "./crypto/proof"; -import * as _311 from "./libs/bits/types"; -import * as _312 from "./p2p/types"; -import * as _313 from "./types/block"; -import * as _314 from "./types/evidence"; -import * as _315 from "./types/params"; -import * as _316 from "./types/types"; -import * as _317 from "./types/validator"; -import * as _318 from "./version/types"; + "code": "import * as _306 from "./abci/types"; +import * as _307 from "./crypto/keys"; +import * as _308 from "./crypto/proof"; +import * as _309 from "./libs/bits/types"; +import * as _310 from "./p2p/types"; +import * as _311 from "./types/block"; +import * as _312 from "./types/evidence"; +import * as _313 from "./types/params"; +import * as _314 from "./types/types"; +import * as _315 from "./types/validator"; +import * as _316 from "./version/types"; export namespace tendermint { - export const abci = { ..._308 + export const abci = { ..._306 }; - export const crypto = { ..._309, - ..._310 + export const crypto = { ..._307, + ..._308 }; export namespace libs { - export const bits = { ..._311 + export const bits = { ..._309 }; } - export const p2p = { ..._312 + export const p2p = { ..._310 }; - export const types = { ..._313, + export const types = { ..._311, + ..._312, + ..._313, ..._314, - ..._315, - ..._316, - ..._317 + ..._315 }; - export const version = { ..._318 + export const version = { ..._316 }; }", }, diff --git a/packages/telescope/__tests__/telescope.test.ts b/packages/telescope/__tests__/telescope.test.ts index 3989930223..6517ca27da 100644 --- a/packages/telescope/__tests__/telescope.test.ts +++ b/packages/telescope/__tests__/telescope.test.ts @@ -36,6 +36,11 @@ const options: TelescopeOptions = { ] }, + interfaces: { + enabled: false, + useUnionTypes: false + }, + prototypes: { enabled: true, parser: { @@ -196,7 +201,20 @@ const options: TelescopeOptions = { }, reactQuery: { - enabled: true + enabled: true, + // include: { + // patterns: [ + // 'osmosis/**/gamm/**/query.proto' + // ], + // protos: [ + // 'akash/cert/v1beta2/query.proto' + // ], + // packages: [ + // 'cosmos.bank.v1beta1', + // 'cosmos.gov.v1beta1', + // 'evmos.erc20.v1' + // ] + // } }, aminoEncoding: { diff --git a/packages/telescope/package.json b/packages/telescope/package.json index cdacff8fa1..ff2d3a0ccd 100644 --- a/packages/telescope/package.json +++ b/packages/telescope/package.json @@ -1,6 +1,6 @@ { "name": "@osmonauts/telescope", - "version": "0.80.0", + "version": "0.81.0", "description": "A TypeScript Transpiler for Cosmos Protobufs", "author": "Dan Lynch ", "homepage": "https://github.com/osmosis-labs/telescope/tree/master/packages/telescope#readme", @@ -82,10 +82,10 @@ "@babel/traverse": "7.19.3", "@babel/types": "7.19.3", "@cosmwasm/ts-codegen": "0.21.1", - "@osmonauts/ast": "^0.68.0", - "@osmonauts/proto-parser": "^0.34.0", - "@osmonauts/types": "^0.26.0", - "@osmonauts/utils": "^0.8.0", + "@osmonauts/ast": "^0.69.0", + "@osmonauts/proto-parser": "^0.35.0", + "@osmonauts/types": "^0.27.0", + "@osmonauts/utils": "^0.9.0", "@types/parse-package-name": "0.1.0", "case": "1.6.3", "dargs": "7.0.0", diff --git a/packages/telescope/src/build.ts b/packages/telescope/src/build.ts index c2af77beef..45e5273071 100644 --- a/packages/telescope/src/build.ts +++ b/packages/telescope/src/build.ts @@ -20,6 +20,9 @@ import { createRegistryLoader, // helper createHelperObject, + createInterfaceDecoder, + createInterfaceFromAmino, + createInterfaceToAmino, } from '@osmonauts/ast'; import { ServiceMutation, ServiceQuery } from '@osmonauts/types'; @@ -143,19 +146,37 @@ export class TelescopeParseContext implements TelescopeParseContext { if (obj.type === 'Enum') { buildEnums(this, name, obj); } - }) + }); this.types.forEach(typeReg => { const { name, obj } = typeReg; if (obj.type === 'Type') { buildBaseTypeScriptInterface(this, name, obj); } - }) + }); this.types.forEach(typeReg => { const { name, obj } = typeReg; if (obj.type === 'Type') { buildBaseTypeScriptClass(this, name, obj); } - }) + }); + + // interfaces + if (this.options.interfaces.enabled) { + const interfaces = Object.keys(this.ref.traversed.acceptsInterface ?? {}); + if (interfaces.length) { + interfaces.forEach(interfaceName => { + this.body.push(createInterfaceDecoder(this.proto, this.ref, interfaceName)); + if ( + this.options.aminoEncoding.enabled && + this.options.aminoEncoding.useRecursiveV2encoding + ) { + this.body.push(createInterfaceFromAmino(this.proto, this.ref, interfaceName)); + this.body.push(createInterfaceToAmino(this.proto, this.ref, interfaceName)); + } + }) + } + } + } buildRegistry() { diff --git a/packages/telescope/src/generators/create-react-query-bundle.ts b/packages/telescope/src/generators/create-react-query-bundle.ts index 32a59255f4..d0d897b0b3 100644 --- a/packages/telescope/src/generators/create-react-query-bundle.ts +++ b/packages/telescope/src/generators/create-react-query-bundle.ts @@ -38,7 +38,12 @@ export const plugin = ( package: pkg, imports: null, root: {}, - importNames: null + importNames: null, + acceptsInterface: {}, + implementsInterface: {}, + parsedExports: {}, + parsedImports: {}, + symbols: null } } diff --git a/packages/telescope/src/generators/create-rpc-query-clients.ts b/packages/telescope/src/generators/create-rpc-query-clients.ts index c25b284a82..43ca3978b2 100644 --- a/packages/telescope/src/generators/create-rpc-query-clients.ts +++ b/packages/telescope/src/generators/create-rpc-query-clients.ts @@ -8,7 +8,7 @@ import { createRpcQueryHookClientMap, createRpcQueryHooks } from '@osmonauts/ast'; -import { getNestedProto } from '@osmonauts/proto-parser'; +import { getNestedProto, isRefIncluded } from '@osmonauts/proto-parser'; import { parse } from '../parse'; import { TelescopeBuilder } from '../builder'; import { ProtoService } from '@osmonauts/types'; @@ -76,9 +76,14 @@ export const plugin = ( asts.push(createRpcQueryExtension(ctx.generic, svc)); } + const includeReactQueryHooks = c.proto.pluginValue('reactQuery.enabled') && isRefIncluded( + c.ref, + c.proto.pluginValue('reactQuery.include') + ) + // react query // TODO use the imports and make separate files - if (c.proto.pluginValue('reactQuery.enabled')) { + if (includeReactQueryHooks) { [].push.apply(asts, createRpcQueryHookInterfaces(ctx.generic, svc)); [].push.apply(asts, createRpcQueryHookClientMap(ctx.generic, svc)); asts.push(createRpcQueryHooks(ctx.generic, proto[svcKey])); diff --git a/packages/telescope/src/utils/files.ts b/packages/telescope/src/utils/files.ts index 76dfc45eed..1690256395 100644 --- a/packages/telescope/src/utils/files.ts +++ b/packages/telescope/src/utils/files.ts @@ -34,7 +34,6 @@ export const writeAstToFile = ( } } - export const writeContentToFile = ( outPath: string, options: TelescopeOptions, diff --git a/packages/telescope/test-utils/index.ts b/packages/telescope/test-utils/index.ts index 33fe569d2e..fd1a737f5a 100644 --- a/packages/telescope/test-utils/index.ts +++ b/packages/telescope/test-utils/index.ts @@ -38,12 +38,12 @@ const defaultTelescopeOptionsForTesting = { const defaultTelescopeOptions = deepmerge(teleDefaults, defaultTelescopeOptionsForTesting); export const getTestProtoStore = (options?: TelescopeOptions) => { - const store = new ProtoStore([__dirname + '/../../../__fixtures__/chain1'], options ? deepmerge(defaultTelescopeOptions, options) : defaultTelescopeOptions); + const store = new ProtoStore([__dirname + '/../../../__fixtures__/chain1'], options ? deepmerge(defaultTelescopeOptions, options) : deepmerge(defaultTelescopeOptions, {})); return store; } export const getTestProtoStore2 = (options?: TelescopeOptions) => { - const store = new ProtoStore([__dirname + '/../../../__fixtures__/chain2'], options ? deepmerge(defaultTelescopeOptions, options) : defaultTelescopeOptions); + const store = new ProtoStore([__dirname + '/../../../__fixtures__/chain2'], options ? deepmerge(defaultTelescopeOptions, options) : deepmerge(defaultTelescopeOptions, {})); return store; } diff --git a/packages/test/CHANGELOG.md b/packages/test/CHANGELOG.md index bf81fea7d9..5fa1b7a68a 100644 --- a/packages/test/CHANGELOG.md +++ b/packages/test/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.76.0](https://github.com/osmosis-labs/osmojs/compare/@osmonauts/test-example@0.75.1...@osmonauts/test-example@0.76.0) (2022-12-18) + + +### Reverts + +* Revert "chore(release): publish" ([086a55f](https://github.com/osmosis-labs/osmojs/commit/086a55f14c5ca33ee70a0e2121406dd37eb643f1)) + + + + + # [0.75.0](https://github.com/osmosis-labs/osmojs/compare/@osmonauts/test-example@0.74.0...@osmonauts/test-example@0.75.0) (2022-11-25) **Note:** Version bump only for package @osmonauts/test-example diff --git a/packages/test/package.json b/packages/test/package.json index f9ac4aa933..b5bb5f80a1 100644 --- a/packages/test/package.json +++ b/packages/test/package.json @@ -1,7 +1,7 @@ { "name": "@osmonauts/test-example", "private": true, - "version": "0.75.0", + "version": "0.76.0", "description": "Typescript Protobuf Messages for Osmosis", "author": "Dan Lynch ", "homepage": "https://github.com/osmosis-labs/osmojs/tree/master/packages/osmojs#readme", @@ -23,6 +23,12 @@ "test:lcd": "cross-env NODE_ENV=development babel-node src/test-lcd --extensions \".tsx,.ts,.js\"", "test:lcd-balance": "cross-env NODE_ENV=development babel-node src/test-lcd-balance --extensions \".tsx,.ts,.js\"", "test:lcd-client": "cross-env NODE_ENV=development babel-node src/test-lcd-client --extensions \".tsx,.ts,.js\"", + "test:claim": "cross-env NODE_ENV=development babel-node src/test-claim --extensions \".tsx,.ts,.js\"", + "test:stake": "cross-env NODE_ENV=development babel-node src/test-stake --extensions \".tsx,.ts,.js\"", + "test:swap": "cross-env NODE_ENV=development babel-node src/test-swap --extensions \".tsx,.ts,.js\"", + "test:join": "cross-env NODE_ENV=development babel-node src/test-join --extensions \".tsx,.ts,.js\"", + "test:lock": "cross-env NODE_ENV=development babel-node src/test-lock --extensions \".tsx,.ts,.js\"", + "test:unlock": "cross-env NODE_ENV=development babel-node src/test-unlock --extensions \".tsx,.ts,.js\"", "lint": "eslint .", "format": "eslint . --fix", "clean": "rimraf ./types && rimraf ./src/codegen", @@ -56,7 +62,7 @@ "@babel/preset-typescript": "^7.17.12", "@babel/traverse": "7.19.3", "@babel/types": "7.19.3", - "@osmonauts/telescope": "^0.80.0", + "@osmonauts/telescope": "^0.81.0", "@protobufs/cosmos": "^0.0.11", "@protobufs/cosmwasm": "^0.0.11", "@protobufs/ibc": "^0.0.11", @@ -88,9 +94,14 @@ "@cosmjs/proto-signing": "0.29.3", "@cosmjs/stargate": "0.29.3", "@cosmjs/tendermint-rpc": "^0.29.3", - "@osmonauts/lcd": "^0.8.0", + "@cosmology/core": "1.16.0", + "@keplr-wallet/unit": "0.11.25", + "@osmonauts/lcd": "^0.9.0", "@tanstack/react-query": "4.16.1", + "cosmjs-utils": "0.1.0", "long": "^5.2.0", - "protobufjs": "^6.11.3" + "protobufjs": "^6.11.3", + "react": "18.2.0", + "react-dom": "18.2.0" } } diff --git a/packages/test/scripts/codegen.js b/packages/test/scripts/codegen.js index 0c53555417..0e2dcbb008 100644 --- a/packages/test/scripts/codegen.js +++ b/packages/test/scripts/codegen.js @@ -11,7 +11,12 @@ telescope({ outPath, options: { removeUnusedImports: true, + interfaces: { + enabled: true, + useUnionTypes: false + }, prototypes: { + addTypeUrlToDecoders: true, excluded: { packages: ['cosmos.group.v1'] }, @@ -29,7 +34,8 @@ telescope({ } }, aminoEncoding: { - enabled: true + enabled: true, + useRecursiveV2encoding: true }, lcdClients: { enabled: true diff --git a/packages/test/src/test-claim.ts b/packages/test/src/test-claim.ts new file mode 100644 index 0000000000..8ee31841ea --- /dev/null +++ b/packages/test/src/test-claim.ts @@ -0,0 +1,118 @@ +import { + baseUnitsToDisplayUnitsByDenom, + gasEstimation, +} from '@cosmology/core'; +import { + decodeCosmosSdkDecFromProto, + assertIsDeliverTxSuccess +} from '@cosmjs/stargate'; +import { Dec } from '@keplr-wallet/unit'; + +import { cosmos, getSigningCosmosClient } from './codegen'; +import { getOfflineSignerAmino } from 'cosmjs-utils'; + +const RPC_ENDPOINT = 'https://rpc.cosmos.directory/osmosis' + +const main = async () => { + + const { + withdrawDelegatorReward + } = cosmos.distribution.v1beta1.MessageComposer.fromPartial; + + const signer = await getOfflineSignerAmino({ + mnemonic: process.env.MNEMONIC, + chain: { + bech32_prefix: 'osmo', + slip44: 118 + } + }); + + const client = await cosmos.ClientFactory.createRPCQueryClient({ rpcEndpoint: RPC_ENDPOINT }); + + const [mainAccount] = await signer.getAccounts(); + + const { address } = mainAccount; + + const delegations = await client.cosmos.staking.v1beta1.delegatorDelegations({ + delegatorAddr: address + }); + + if (!delegations.delegationResponses || !delegations.delegationResponses.length) { + console.log('no delegations. Exiting.'); + return; + } + + const messagesToClaim = []; + let totalClaimable = new Dec(0); + + const rewards = await client.cosmos.distribution.v1beta1.delegationTotalRewards({ + delegatorAddress: address + }); + + if (rewards && rewards.rewards && rewards.rewards.length) { + rewards.rewards.forEach((data) => { + const { validatorAddress, reward } = data; + if (reward && reward.length) { + const rewardWeWant = reward.find((r) => r.denom === 'uosmo'); + if (!rewardWeWant) return; + // https://github.com/osmosis-labs/telescope/issues/247 + totalClaimable = totalClaimable.add(new Dec(decodeCosmosSdkDecFromProto(rewardWeWant.amount).toString())); + messagesToClaim.push( + withdrawDelegatorReward({ + delegatorAddress: address, + validatorAddress + }) + ); + } + }); + } + + if (!messagesToClaim.length) { + console.log('no rewards. Exiting.'); + return; + } + + const stargateClient = await getSigningCosmosClient({ + rpcEndpoint: RPC_ENDPOINT, + signer + }); + + const fee = await gasEstimation( + 'uosmo', + // @ts-ignore + stargateClient, + address, + messagesToClaim, + '', + 1.3 + ); + + const totalClaimableInDisplayUnits = new Dec(baseUnitsToDisplayUnitsByDenom( + 'uosmo', + totalClaimable.toString() + )); + + + console.log( + `${totalClaimableInDisplayUnits} available, starting claim process...` + ); + + const result = await stargateClient.signAndBroadcast( + address, + messagesToClaim, + fee + ) + + assertIsDeliverTxSuccess(result); + stargateClient.disconnect(); + console.log( + `⚛️ success in claiming ${totalClaimableInDisplayUnits.toString()} rewards` + ); + console.log(result); + + +}; + +main().then(() => { + console.log('all done') +}) \ No newline at end of file diff --git a/packages/test/src/test-join.ts b/packages/test/src/test-join.ts new file mode 100644 index 0000000000..ad916a0691 --- /dev/null +++ b/packages/test/src/test-join.ts @@ -0,0 +1,100 @@ +import Long from 'long'; +import { coin, coins } from '@cosmjs/amino'; +import { + prettyPool, + getPricesFromCoinGecko, + makePoolPairs, + makePoolsPretty, + calculateCoinsNeededInPoolForValue, + calculateShareOutAmount +} from '@cosmology/core'; +import { getSigningOsmosisClient, osmosis } from './codegen'; +import { getOfflineSignerAmino, signAndBroadcast } from 'cosmjs-utils'; +import { MsgJoinPool } from './codegen/osmosis/gamm/v1beta1/tx'; + +const RPC_ENDPOINT = 'https://rpc.cosmos.directory/osmosis' + +const main = async () => { + + const { + joinPool + } = osmosis.gamm.v1beta1.MessageComposer.withTypeUrl; + + const signer = await getOfflineSignerAmino({ + mnemonic: process.env.MNEMONIC, + chain: { + bech32_prefix: 'osmo', + slip44: 118 + } + }); + + const client = await osmosis.ClientFactory.createRPCQueryClient({ rpcEndpoint: RPC_ENDPOINT }); + + const data = await client.osmosis.gamm.v1beta1.pools({ + pagination: { + key: new Uint8Array(), + offset: Long.fromNumber(0), + limit: Long.fromNumber(1500), + countTotal: false, + reverse: false + } + }) + const pools = data.pools.filter(p => p.$typeUrl === '/osmosis.gamm.v1beta1.Pool') + .map((pool) => prettyPool(pool)); + const prices = await getPricesFromCoinGecko(); + const prettyPools = makePoolsPretty(prices, pools); + const pairs = makePoolPairs(prettyPools); + + + const atomPool = await client.osmosis.gamm.v1beta1.pool({ + poolId: Long.fromValue('1') + }); + const poolInfo = prettyPool(atomPool.pool, { includeDetails: false }); + const value = '0.1'; + const coinsNeeded = calculateCoinsNeededInPoolForValue(prices, poolInfo, value); + + const [account] = await signer.getAccounts(); + + const fee = { + amount: coins('0', 'uosmo'), + gas: '250000' + } + const shareOutAmount = calculateShareOutAmount(poolInfo, coinsNeeded); + const msg = joinPool({ + sender: account.address, + poolId: '1', + shareOutAmount, + tokenInMaxs: coinsNeeded.map((c) => { + return coin(c.amount, c.denom); + }) + + }); + + console.log(JSON.stringify(msg)); + + const aminoVersion = MsgJoinPool.toAmino(msg.value); + const fromAmino = MsgJoinPool.fromAmino(aminoVersion); + console.log(JSON.stringify({ + msg, + aminoVersion, + fromAmino + }, null, 2)) + + const stargateClient = await getSigningOsmosisClient({ + rpcEndpoint: RPC_ENDPOINT, + signer + }); + + const result = await stargateClient.signAndBroadcast( + account.address, + [msg], + fee + ); + + console.log(result); + +}; + +main().then(() => { + console.log('all done') +}) \ No newline at end of file diff --git a/packages/test/src/test-lock.ts b/packages/test/src/test-lock.ts new file mode 100644 index 0000000000..97be867314 --- /dev/null +++ b/packages/test/src/test-lock.ts @@ -0,0 +1,119 @@ +import Long from 'long'; +import { coins } from '@cosmjs/amino'; +import { + prettyPool, + getPricesFromCoinGecko, + makePoolPairs, + makePoolsPretty +} from '@cosmology/core'; +import { getSigningOsmosisClient, osmosis } from './codegen'; +import { getOfflineSignerAmino, signAndBroadcast } from 'cosmjs-utils'; +import { MsgLockTokens } from './codegen/osmosis/lockup/tx'; + +const RPC_ENDPOINT = 'https://rpc.cosmos.directory/osmosis' + +const main = async () => { + + const { + lockTokens + } = osmosis.lockup.MessageComposer.withTypeUrl; + + const signer = await getOfflineSignerAmino({ + mnemonic: process.env.MNEMONIC, + chain: { + bech32_prefix: 'osmo', + slip44: 118 + } + }); + + const client = await osmosis.ClientFactory.createRPCQueryClient({ rpcEndpoint: RPC_ENDPOINT }); + + const data = await client.osmosis.gamm.v1beta1.pools({ + pagination: { + key: new Uint8Array(), + offset: Long.fromNumber(0), + limit: Long.fromNumber(1500), + countTotal: false, + reverse: false + } + }) + const pools = data.pools.filter(p => p.$typeUrl === '/osmosis.gamm.v1beta1.Pool') + .map((pool) => prettyPool(pool)); + const prices = await getPricesFromCoinGecko(); + const prettyPools = makePoolsPretty(prices, pools); + const pairs = makePoolPairs(prettyPools); + + const [account] = await signer.getAccounts(); + + + const fee = { + amount: coins('0', 'uosmo'), + gas: '250000' + } + + const accountBalances = await client.cosmos.bank.v1beta1.allBalances({ + address: account.address + }) + + const gammTokens = accountBalances.balances + .filter((a) => a.denom.startsWith('gamm')) + .map((obj) => { + return { + ...obj, + poolId: obj.denom.split('/')[2] + }; + }); + + if (!gammTokens.length) { + return console.log('no gamm tokens to stake'); + } + + console.log({ gammTokens }) + + const tokens = gammTokens.find((gamm) => gamm.poolId == '1'); + if (!tokens) { + return console.log('no gamm tokens from pool to stake'); + } + const gammCoins = [tokens].map( + ({ denom, amount }) => ({ amount, denom }) + ); + + const msg = lockTokens({ + owner: account.address, + coins: gammCoins, + duration: { + seconds: Long.fromValue(8), + // seconds: Long.fromValue(86400), + nanos: 0 + } + }); + + console.log(JSON.stringify(msg)); + + const aminoVersion = MsgLockTokens.toAmino(msg.value); + const fromAmino = MsgLockTokens.fromAmino(aminoVersion); + + console.log(JSON.stringify({ + msg, + aminoVersion, + fromAmino + }, null, 2)) + + const stargateClient = await getSigningOsmosisClient({ + rpcEndpoint: RPC_ENDPOINT, + signer + }); + + const result = await stargateClient.signAndBroadcast( + account.address, + [msg], + fee + ); + + console.log(result); + +}; + +main().then(() => { + console.log('all done') +}) \ No newline at end of file diff --git a/packages/test/src/test-rpc.ts b/packages/test/src/test-rpc.ts index 9b8cb8a5fd..7a0076193f 100644 --- a/packages/test/src/test-rpc.ts +++ b/packages/test/src/test-rpc.ts @@ -1,20 +1,43 @@ import { osmosis } from "./codegen"; +import Long from 'long'; const RPC_ENDPOINT = 'https://rpc.cosmos.directory/osmosis' const main = async () => { const client = await osmosis.ClientFactory .createRPCQueryClient({ rpcEndpoint: RPC_ENDPOINT }) - const response = await client.osmosis.gamm.v1beta1.pools() + const response = await client.osmosis.gamm.v1beta1.pools({ + pagination: { + key: new Uint8Array(), + offset: Long.fromNumber(0), + limit: Long.fromNumber(1500), + countTotal: false, + reverse: false + } + }) - // THIS WORKS but has to be manually applied - const result = response.pools.map(({ typeUrl, value }) => { - return osmosis.gamm.v1beta1.Pool.decode(value); - }); - console.log(result); + const stables = response.pools.filter(p => p.$typeUrl === '/osmosis.gamm.poolmodels.stableswap.v1beta1.Pool') + const balancers = response.pools.filter(p => p.$typeUrl === '/osmosis.gamm.v1beta1.Pool') + console.log(balancers[0]); + console.log(stables[0]); + + // stables[0]. }; main().then(() => { console.log('all done') -}) \ No newline at end of file +}) + +// interface A { +// a: string; +// } +// interface B { +// b: string; +// } + +// type C = (A & B) & undefined; + +// const c: C = {}; + +// c. \ No newline at end of file diff --git a/packages/test/src/test-stake.ts b/packages/test/src/test-stake.ts new file mode 100644 index 0000000000..b63c0fce4f --- /dev/null +++ b/packages/test/src/test-stake.ts @@ -0,0 +1,78 @@ +import { + baseUnitsToDisplayUnitsByDenom, + gasEstimation, + noDecimals, +} from '@cosmology/core'; +import { + decodeCosmosSdkDecFromProto, + assertIsDeliverTxSuccess +} from '@cosmjs/stargate'; +import { Dec } from '@keplr-wallet/unit'; + +import { cosmos, getSigningCosmosClient } from './codegen'; +import { getOfflineSignerAmino } from 'cosmjs-utils'; + +const RPC_ENDPOINT = 'https://rpc.cosmos.directory/osmosis' + +const main = async () => { + + const { + delegate + } = cosmos.staking.v1beta1.MessageComposer.fromPartial; + + const signer = await getOfflineSignerAmino({ + mnemonic: process.env.MNEMONIC, + chain: { + bech32_prefix: 'osmo', + slip44: 118 + } + }); + + const client = await cosmos.ClientFactory.createRPCQueryClient({ rpcEndpoint: RPC_ENDPOINT }); + + const [mainAccount] = await signer.getAccounts(); + + const { address } = mainAccount; + + const msg = delegate({ + delegatorAddress: address, + validatorAddress: 'osmovaloper1jvqv650snr7gaee2wsvkx9nf9gwuj946zxa7z4', + amount: { + amount: noDecimals('1'), + denom: 'uosmo' + } + }); + + const stargateClient = await getSigningCosmosClient({ + rpcEndpoint: RPC_ENDPOINT, + signer + }); + + const fee = await gasEstimation( + 'uosmo', + // @ts-ignore + stargateClient, + address, + [msg], + '', + 1.3 + ); + + const result = await stargateClient.signAndBroadcast( + address, + [msg], + fee + ) + + assertIsDeliverTxSuccess(result); + stargateClient.disconnect(); + console.log( + `⚛️ success` + ); + console.log(result); + +}; + +main().then(() => { + console.log('all done') +}) \ No newline at end of file diff --git a/packages/test/src/test-swap.ts b/packages/test/src/test-swap.ts new file mode 100644 index 0000000000..8cdc3d90c1 --- /dev/null +++ b/packages/test/src/test-swap.ts @@ -0,0 +1,154 @@ +import { coins } from '@cosmjs/amino'; +import { + lookupRoutesForTrade, + calculateAmountWithSlippage, + prettyPool, + getPricesFromCoinGecko, + makePoolPairs, + makePoolsPretty, + noDecimals, + baseUnitsToDisplayUnits, + symbolToOsmoDenom, + baseUnitsToDollarValue, + dollarValueToDenomUnits, + getPrice +} from '@cosmology/core'; +import Long from 'long'; +import { getSigningOsmosisClient, osmosis } from './codegen'; +import { getOfflineSignerAmino } from 'cosmjs-utils'; + +const RPC_ENDPOINT = 'https://rpc.cosmos.directory/osmosis' + +const main = async () => { + + const { + swapExactAmountIn + } = osmosis.gamm.v1beta1.MessageComposer.withTypeUrl; + + const signer = await getOfflineSignerAmino({ + mnemonic: process.env.MNEMONIC, + chain: { + bech32_prefix: 'osmo', + slip44: 118 + } + }); + + const client = await osmosis.ClientFactory.createRPCQueryClient({ rpcEndpoint: RPC_ENDPOINT }); + + const data = await client.osmosis.gamm.v1beta1.pools({ + pagination: { + key: new Uint8Array(), + offset: Long.fromNumber(0), + limit: Long.fromNumber(1500), + countTotal: false, + reverse: false + } + }) + const pools = data.pools.filter(p => p.$typeUrl === '/osmosis.gamm.v1beta1.Pool') + .map((pool) => prettyPool(pool)); + const prices = await getPricesFromCoinGecko(); + const prettyPools = makePoolsPretty(prices, pools); + const pairs = makePoolPairs(prettyPools); + + const value = '0.2'; + const buy = 'ATOM'; + const sell = 'OSMO'; + + const slippage = '1'; + + const tokenInPrice = getPrice(prices, sell); + const tokenInAmount = dollarValueToDenomUnits(prices, sell, value); + const tokenOutPrice = getPrice(prices, buy); + const tokenOutAmount = dollarValueToDenomUnits(prices, buy, value); + const tokenOutAmountWithSlippage = calculateAmountWithSlippage( + tokenOutAmount, + slippage + ); + + const tokenInValue = baseUnitsToDollarValue(prices, sell, tokenInAmount); + const tokenOutValue = baseUnitsToDollarValue( + prices, + buy, + tokenOutAmountWithSlippage + ); + + const tokenIn = { + denom: symbolToOsmoDenom(sell), + symbol: sell, + amount: tokenInAmount, + displayAmount: baseUnitsToDisplayUnits(sell, tokenInAmount), + tokenInPrice, + tokenInValue + }; + + const tokenOut = { + denom: symbolToOsmoDenom(buy), + symbol: buy, + amount: tokenOutAmountWithSlippage, + displayAmount: baseUnitsToDisplayUnits(buy, tokenOutAmountWithSlippage), + tokenOutPrice, + tokenOutValue + }; + + + const routes = lookupRoutesForTrade({ + pools, + trade: { + sell: { + denom: tokenIn.denom, + amount: tokenInAmount + }, + buy: { + denom: tokenOut.denom, + amount: tokenOutAmount + }, + beliefValue: value + }, + pairs + }).map((tradeRoute) => { + const { + poolId, + tokenOutDenom + } = tradeRoute; + return { + poolId, + tokenOutDenom + }; + }); + + const [account] = await signer.getAccounts(); + + const fee = { + amount: coins('0', 'uosmo'), + gas: '250000' + } + const msg = swapExactAmountIn({ + sender: account.address, + routes, + tokenIn: { + denom: tokenIn.denom, + amount: noDecimals(tokenIn.amount) + }, + tokenOutMinAmount: noDecimals(tokenOut.amount) + }); + + console.log(account.address, msg); + + const stargateClient = await getSigningOsmosisClient({ + rpcEndpoint: RPC_ENDPOINT, + signer + }); + + const result = await stargateClient.signAndBroadcast( + account.address, + [msg], + fee + ); + + console.log(result); + +}; + +main().then(() => { + console.log('all done') +}) \ No newline at end of file diff --git a/packages/test/src/test-unlock.ts b/packages/test/src/test-unlock.ts new file mode 100644 index 0000000000..6f5b227043 --- /dev/null +++ b/packages/test/src/test-unlock.ts @@ -0,0 +1,109 @@ +import Long from 'long'; +import { coins } from '@cosmjs/amino'; +import { + prettyPool, + getPricesFromCoinGecko, + makePoolPairs, + makePoolsPretty +} from '@cosmology/core'; +import { getSigningOsmosisClient, osmosis } from './codegen'; +import { getOfflineSignerAmino } from 'cosmjs-utils'; +import { MsgBeginUnlocking } from './codegen/osmosis/lockup/tx'; + +const RPC_ENDPOINT = 'https://rpc.cosmos.directory/osmosis' + +const main = async () => { + + const { + beginUnlocking + } = osmosis.lockup.MessageComposer.withTypeUrl; + + const signer = await getOfflineSignerAmino({ + mnemonic: process.env.MNEMONIC, + chain: { + bech32_prefix: 'osmo', + slip44: 118 + } + }); + + const client = await osmosis.ClientFactory.createRPCQueryClient({ rpcEndpoint: RPC_ENDPOINT }); + + const data = await client.osmosis.gamm.v1beta1.pools({ + pagination: { + key: new Uint8Array(), + offset: Long.fromNumber(0), + limit: Long.fromNumber(1500), + countTotal: false, + reverse: false + } + }) + const pools = data.pools.filter(p => p.$typeUrl === '/osmosis.gamm.v1beta1.Pool') + .map((pool) => prettyPool(pool)); + const prices = await getPricesFromCoinGecko(); + const prettyPools = makePoolsPretty(prices, pools); + const pairs = makePoolPairs(prettyPools); + + const [account] = await signer.getAccounts(); + + const fee = { + amount: coins('0', 'uosmo'), + gas: '250000' + } + + + const accountLockedLongerDurationDenom = await client.osmosis.lockup.accountLockedLongerDurationDenom({ + owner: account.address, + denom: 'gamm/pool/1' + }) + + const accountLockedCoins = await client.osmosis.lockup.accountLockedCoins({ + owner: account.address + }) + + const accountUnlockableCoins = await client.osmosis.lockup.accountUnlockableCoins({ + owner: account.address + }) + + console.log(JSON.stringify({ accountUnlockableCoins, accountLockedCoins, accountLockedLongerDurationDenom }, null, 2)); + + if (!accountLockedLongerDurationDenom.locks.length) { + throw new Error('no locks!'); + } + + const [lock] = accountLockedLongerDurationDenom.locks; + + const msg = beginUnlocking({ + owner: account.address, + coins: [], + ID: lock.ID + }); + + console.log(JSON.stringify(msg)); + + const aminoVersion = MsgBeginUnlocking.toAmino(msg.value); + const fromAmino = MsgBeginUnlocking.fromAmino(aminoVersion); + + console.log(JSON.stringify({ + msg, + aminoVersion, + fromAmino + }, null, 2)) + + const stargateClient = await getSigningOsmosisClient({ + rpcEndpoint: RPC_ENDPOINT, + signer + }); + + const result = await stargateClient.signAndBroadcast( + account.address, + [msg], + fee + ); + + console.log(result); + +}; + +main().then(() => { + console.log('all done') +}) \ No newline at end of file diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index 59715f97cc..23f3fbc840 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.27.0](https://github.com/osmosis-labs/telescope/compare/@osmonauts/types@0.80.0-rc.1...@osmonauts/types@0.27.0) (2022-12-18) + + +### Reverts + +* Revert "RC versions ready" ([04081a9](https://github.com/osmosis-labs/telescope/commit/04081a9d1f80feb3ae664bce2d1364850b3daaca)) +* Revert "chore(release): publish" ([086a55f](https://github.com/osmosis-labs/telescope/commit/086a55f14c5ca33ee70a0e2121406dd37eb643f1)) + + + + + # [0.26.0](https://github.com/osmosis-labs/telescope/compare/@osmonauts/types@0.25.0...@osmonauts/types@0.26.0) (2022-11-25) **Note:** Version bump only for package @osmonauts/types diff --git a/packages/types/package.json b/packages/types/package.json index c1b0d5ca10..9892abab15 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@osmonauts/types", - "version": "0.26.0", + "version": "0.27.0", "description": "Telescope types", "author": "Dan Lynch ", "homepage": "https://github.com/osmosis-labs/telescope/tree/master/packages/types#readme", @@ -72,7 +72,7 @@ }, "dependencies": { "@babel/runtime": "^7.19.0", - "@osmonauts/utils": "^0.8.0", + "@osmonauts/utils": "^0.9.0", "case": "1.6.3" } } diff --git a/packages/types/src/base.ts b/packages/types/src/base.ts index cda7fc3e53..ed89188401 100644 --- a/packages/types/src/base.ts +++ b/packages/types/src/base.ts @@ -13,6 +13,7 @@ export interface ProtoType { [key: string]: any; deprecated?: boolean; "(cosmos_proto.implements_interface)"?: string; + "(amino.name)"?: string; }, fields: { [key: string]: ProtoField; @@ -131,7 +132,7 @@ export interface ProtoRef { absolute: string; filename: string; proto: ProtoRoot; - traversed?: ProtoRoot; + traversed?: TraversedProtoRoot; } export interface ProtoRoot { package: string; @@ -139,3 +140,48 @@ export interface ProtoRoot { importNames?: Record>; root: any; }; + +// TRAVERSAL + +export interface TraverseRecord { + filename: string; + implementsType: string; + msgName: string; +} +export interface TraverseLocalSymbol { + type: 'import' | 'export' | 'importFromImplements' + symbolName: string; + readAs: string; + source: string; + implementsType?: string; + // msgName: string; +} + +export type TraverseImportNames = Record>; +export type TraverseImport = Record; +export type TraverseAccept = Record; +export type TraverseImplement = Record; +export type TraverseExport = Record; +export interface TypeUrlRef { + typeUrl: string; + aminoType: string; + type: string; + importAs: string; +}; + +export interface TraverseTypeUrlRef { + ref: string; + pkg: string; + types: TypeUrlRef[] +}; + +export type TraversedProtoRoot = ProtoRoot & { + parsedImports: TraverseImport; + parsedExports: TraverseExport; + acceptsInterface: TraverseAccept; + implementsInterface: TraverseImplement; + importNames: TraverseImportNames | null; + symbols: TraverseLocalSymbol | null; +}; + +export type InterfaceTypeUrlMap = Record \ No newline at end of file diff --git a/packages/types/src/telescope.ts b/packages/types/src/telescope.ts index fe183d4c1e..deaa48f7a3 100644 --- a/packages/types/src/telescope.ts +++ b/packages/types/src/telescope.ts @@ -20,6 +20,11 @@ interface TelescopeOpts { logLevel?: TelescopeLogLevel; + interfaces?: { + enabled?: boolean; + useUnionTypes?: boolean; + }, + prototypes?: { enabled?: boolean; parser?: { @@ -44,6 +49,8 @@ interface TelescopeOpts { optionalQueryParams?: boolean; optionalPageRequests?: boolean; + addTypeUrlToDecoders?: boolean; + excluded?: { packages?: string[]; protos?: string[]; @@ -137,6 +144,11 @@ interface TelescopeOpts { }; reactQuery?: { enabled: boolean; + include?: { + patterns?: string[]; + packages?: string[]; + protos?: string[]; + } }; } interface TelescopePackageOpts { @@ -157,6 +169,11 @@ export const defaultTelescopeOptions: TelescopeOptions = { includeExternalHelpers: false, logLevel: TelescopeLogLevel.None, + interfaces: { + enabled: false, + useUnionTypes: false, + }, + prototypes: { enabled: true, parser: { @@ -178,6 +195,8 @@ export const defaultTelescopeOptions: TelescopeOptions = { allowUndefinedTypes: false, useOptionalNullable: true, + addTypeUrlToDecoders: false, + optionalQueryParams: false, optionalPageRequests: false, @@ -239,7 +258,12 @@ export const defaultTelescopeOptions: TelescopeOptions = { }, reactQuery: { - enabled: false + enabled: false, + include: { + patterns: [], + packages: [], + protos: [] + } }, // packages diff --git a/packages/types/types/base.d.ts b/packages/types/types/base.d.ts index 3bd0fb9ad4..f1afedd746 100644 --- a/packages/types/types/base.d.ts +++ b/packages/types/types/base.d.ts @@ -22,6 +22,7 @@ export interface ProtoType { [key: string]: any; deprecated?: boolean; "(cosmos_proto.implements_interface)"?: string; + "(amino.name)"?: string; }; fields: { [key: string]: ProtoField; @@ -106,7 +107,7 @@ export interface ProtoRef { absolute: string; filename: string; proto: ProtoRoot; - traversed?: ProtoRoot; + traversed?: TraversedProtoRoot; } export interface ProtoRoot { package: string; @@ -114,3 +115,40 @@ export interface ProtoRoot { importNames?: Record>; root: any; } +export interface TraverseRecord { + filename: string; + implementsType: string; + msgName: string; +} +export interface TraverseLocalSymbol { + type: 'import' | 'export' | 'importFromImplements'; + symbolName: string; + readAs: string; + source: string; + implementsType?: string; +} +export declare type TraverseImportNames = Record>; +export declare type TraverseImport = Record; +export declare type TraverseAccept = Record; +export declare type TraverseImplement = Record; +export declare type TraverseExport = Record; +export interface TypeUrlRef { + typeUrl: string; + aminoType: string; + type: string; + importAs: string; +} +export interface TraverseTypeUrlRef { + ref: string; + pkg: string; + types: TypeUrlRef[]; +} +export declare type TraversedProtoRoot = ProtoRoot & { + parsedImports: TraverseImport; + parsedExports: TraverseExport; + acceptsInterface: TraverseAccept; + implementsInterface: TraverseImplement; + importNames: TraverseImportNames | null; + symbols: TraverseLocalSymbol | null; +}; +export declare type InterfaceTypeUrlMap = Record; diff --git a/packages/types/types/telescope.d.ts b/packages/types/types/telescope.d.ts index 7446f31e2b..20c8998e26 100644 --- a/packages/types/types/telescope.d.ts +++ b/packages/types/types/telescope.d.ts @@ -14,6 +14,10 @@ interface TelescopeOpts { useSDKTypes?: boolean; includeExternalHelpers?: boolean; logLevel?: TelescopeLogLevel; + interfaces?: { + enabled?: boolean; + useUnionTypes?: boolean; + }; prototypes?: { enabled?: boolean; parser?: { @@ -36,6 +40,7 @@ interface TelescopeOpts { allowUndefinedTypes?: boolean; optionalQueryParams?: boolean; optionalPageRequests?: boolean; + addTypeUrlToDecoders?: boolean; excluded?: { packages?: string[]; protos?: string[]; @@ -110,6 +115,11 @@ interface TelescopeOpts { }; reactQuery?: { enabled: boolean; + include?: { + patterns?: string[]; + packages?: string[]; + protos?: string[]; + }; }; } interface TelescopePackageOpts { diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index 20382c72c8..ffdec30583 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.9.0](https://github.com/osmosis-labs/telescope/compare/@osmonauts/utils@0.80.0-rc.1...@osmonauts/utils@0.9.0) (2022-12-18) + + +### Reverts + +* Revert "RC versions ready" ([04081a9](https://github.com/osmosis-labs/telescope/commit/04081a9d1f80feb3ae664bce2d1364850b3daaca)) +* Revert "chore(release): publish" ([086a55f](https://github.com/osmosis-labs/telescope/commit/086a55f14c5ca33ee70a0e2121406dd37eb643f1)) + + + + + # [0.8.0](https://github.com/osmosis-labs/telescope/compare/@osmonauts/utils@0.7.0...@osmonauts/utils@0.8.0) (2022-11-24) **Note:** Version bump only for package @osmonauts/utils diff --git a/packages/utils/package.json b/packages/utils/package.json index 94f610f185..90210be2e2 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@osmonauts/utils", - "version": "0.8.0", + "version": "0.9.0", "description": "Telescope utils", "author": "Dan Lynch ", "homepage": "https://github.com/osmosis-labs/telescope/tree/master/packages/utils#readme", diff --git a/packages/utils/src/slugs.ts b/packages/utils/src/slugs.ts index e24c97e39c..1b3c459f5f 100644 --- a/packages/utils/src/slugs.ts +++ b/packages/utils/src/slugs.ts @@ -14,4 +14,17 @@ export const variableSlug = (str) => { .replace(/-/g, ""); return camel(str); -} \ No newline at end of file +} + +export const slugify = (str) => { + str = String(str).toString(); + str = str.replace(/\//g, '_'); + str = str.replace('.', '_'); + str = str.replace(/^\s+|\s+$/g, ""); // trim + str = str + .replace(/[^a-zA-Z0-9_ -]/g, "") // remove invalid chars + .replace(/\s+/g, "-") // collapse whitespace and replace by - + .replace(/-/g, ""); + + return str; +}; \ No newline at end of file diff --git a/packages/utils/types/slugs.d.ts b/packages/utils/types/slugs.d.ts index e61b73d43e..ff80b5b973 100644 --- a/packages/utils/types/slugs.d.ts +++ b/packages/utils/types/slugs.d.ts @@ -1 +1,2 @@ export declare const variableSlug: (str: any) => any; +export declare const slugify: (str: any) => any; diff --git a/yarn.lock b/yarn.lock index 2ce673f89a..7f94fe6784 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1484,6 +1484,13 @@ dependencies: regenerator-runtime "^0.13.4" +"@babel/runtime@^7.19.4": + version "7.20.6" + resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.20.6.tgz#facf4879bfed9b5326326273a64220f099b0fce3" + integrity sha512-Q+8MqP7TiHMWzSfwiJwXCjyf4GYA4Dgw3emg/7xmwsdLJOZUp+nMqcOwOzzYheuM1rhDu8FSj2l0aoMygEuXuA== + dependencies: + regenerator-runtime "^0.13.11" + "@babel/template@^7.18.10", "@babel/template@^7.18.6", "@babel/template@^7.3.3": version "7.18.10" resolved "https://registry.npmjs.org/@babel/template/-/template-7.18.10.tgz#6f9134835970d1dbf0835c0d100c9f38de0c5e71" @@ -1589,6 +1596,13 @@ resolved "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== +"@chain-registry/types@^0.14.0": + version "0.14.0" + resolved "https://registry.npmjs.org/@chain-registry/types/-/types-0.14.0.tgz#43ea04992adabdee2a0f03f8a519b01722ab354b" + integrity sha512-TlIqc3CijT734no7RiYBfUvCG2fory0blwrBcK4XTYOCi2vANsxfDdiPLFQcaSETYDd14DdjhrdXwMocEeOnLQ== + dependencies: + "@babel/runtime" "^7.19.4" + "@confio/ics23@^0.6.8": version "0.6.8" resolved "https://registry.npmjs.org/@confio/ics23/-/ics23-0.6.8.tgz#2a6b4f1f2b7b20a35d9a0745bb5a446e72930b3d" @@ -1597,6 +1611,26 @@ "@noble/hashes" "^1.0.0" protobufjs "^6.8.8" +"@cosmjs/amino@0.27.1": + version "0.27.1" + resolved "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.27.1.tgz#0910256b5aecd794420bb5f7319d98fc63252fa1" + integrity sha512-w56ar/nK9+qlvWDpBPRmD0Blk2wfkkLqRi1COs1x7Ll1LF0AtkIBUjbRKplENLbNovK0T3h+w8bHiFm+GBGQOA== + dependencies: + "@cosmjs/crypto" "0.27.1" + "@cosmjs/encoding" "0.27.1" + "@cosmjs/math" "0.27.1" + "@cosmjs/utils" "0.27.1" + +"@cosmjs/amino@0.29.0": + version "0.29.0" + resolved "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.29.0.tgz#35873a580a6102e48415ed2b5b97477f146fb50d" + integrity sha512-/ZUVx6nRN5YE36H3SDq9+i8g2nZ8DJQnN9fVRC8rSHQKauNkoEuK4NxTNcQ2o2EBLUT0kyYAFY2550HVsPMrgw== + dependencies: + "@cosmjs/crypto" "^0.29.0" + "@cosmjs/encoding" "^0.29.0" + "@cosmjs/math" "^0.29.0" + "@cosmjs/utils" "^0.29.0" + "@cosmjs/amino@0.29.3", "@cosmjs/amino@^0.29.3": version "0.29.3" resolved "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.29.3.tgz#5aa338a301ea970a93e15522706615efea507c10" @@ -1607,6 +1641,58 @@ "@cosmjs/math" "^0.29.3" "@cosmjs/utils" "^0.29.3" +"@cosmjs/amino@0.29.5", "@cosmjs/amino@^0.29.0", "@cosmjs/amino@^0.29.5": + version "0.29.5" + resolved "https://registry.npmjs.org/@cosmjs/amino/-/amino-0.29.5.tgz#053b4739a90b15b9e2b781ccd484faf64bd49aec" + integrity sha512-Qo8jpC0BiziTSUqpkNatBcwtKNhCovUnFul9SlT/74JUCdLYaeG5hxr3q1cssQt++l4LvlcpF+OUXL48XjNjLw== + dependencies: + "@cosmjs/crypto" "^0.29.5" + "@cosmjs/encoding" "^0.29.5" + "@cosmjs/math" "^0.29.5" + "@cosmjs/utils" "^0.29.5" + +"@cosmjs/crypto@0.27.1": + version "0.27.1" + resolved "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.27.1.tgz#271c853089a3baf3acd6cf0b2122fd49f8815743" + integrity sha512-vbcxwSt99tIYJg8Spp00wc3zx72qx+pY3ozGuBN8gAvySnagK9dQ/jHwtWQWdammmdD6oW+75WfIHZ+gNa+Ybg== + dependencies: + "@cosmjs/encoding" "0.27.1" + "@cosmjs/math" "0.27.1" + "@cosmjs/utils" "0.27.1" + bip39 "^3.0.2" + bn.js "^5.2.0" + elliptic "^6.5.3" + js-sha3 "^0.8.0" + libsodium-wrappers "^0.7.6" + ripemd160 "^2.0.2" + sha.js "^2.4.11" + +"@cosmjs/crypto@0.29.0": + version "0.29.0" + resolved "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.29.0.tgz#c914424a8b538f6624e505bc2015a71e3977c2fb" + integrity sha512-MPJoebRGh7AcZgbfR25ci7iV+XzJiKwVq4wL8n6M5P2QdrIv7DqqniyFXcBbn9dQjMLMHnOSgT9LRv+VXzUVCA== + dependencies: + "@cosmjs/encoding" "^0.29.0" + "@cosmjs/math" "^0.29.0" + "@cosmjs/utils" "^0.29.0" + "@noble/hashes" "^1" + bn.js "^5.2.0" + elliptic "^6.5.3" + libsodium-wrappers "^0.7.6" + +"@cosmjs/crypto@^0.29.0", "@cosmjs/crypto@^0.29.5": + version "0.29.5" + resolved "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.29.5.tgz#ab99fc382b93d8a8db075780cf07487a0f9519fd" + integrity sha512-2bKkaLGictaNL0UipQCL6C1afaisv6k8Wr/GCLx9FqiyFkh9ZgRHDyetD64ZsjnWV/N/D44s/esI+k6oPREaiQ== + dependencies: + "@cosmjs/encoding" "^0.29.5" + "@cosmjs/math" "^0.29.5" + "@cosmjs/utils" "^0.29.5" + "@noble/hashes" "^1" + bn.js "^5.2.0" + elliptic "^6.5.4" + libsodium-wrappers "^0.7.6" + "@cosmjs/crypto@^0.29.3": version "0.29.3" resolved "https://registry.npmjs.org/@cosmjs/crypto/-/crypto-0.29.3.tgz#4af0ac1264f1638c31d03cfcbedf2fca36e17890" @@ -1620,6 +1706,33 @@ elliptic "^6.5.3" libsodium-wrappers "^0.7.6" +"@cosmjs/encoding@0.27.1": + version "0.27.1" + resolved "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.27.1.tgz#3cd5bc0af743485eb2578cdb08cfa84c86d610e1" + integrity sha512-rayLsA0ojHeniaRfWWcqSsrE/T1rl1gl0OXVNtXlPwLJifKBeLEefGbOUiAQaT0wgJ8VNGBazVtAZBpJidfDhw== + dependencies: + base64-js "^1.3.0" + bech32 "^1.1.4" + readonly-date "^1.0.0" + +"@cosmjs/encoding@^0.20.0": + version "0.20.1" + resolved "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.20.1.tgz#1d1162b3eca51b7244cd45102e313612cea77281" + integrity sha512-aBp153iq2LD4GwDGwodDWZk/eyAUZ8J8bbiqZ1uK8rrylzm9Rdw84aa6JxykezJe+uBPtoI4lx9eH7VQXCGDXw== + dependencies: + base64-js "^1.3.0" + bech32 "^1.1.4" + readonly-date "^1.0.0" + +"@cosmjs/encoding@^0.29.0", "@cosmjs/encoding@^0.29.5": + version "0.29.5" + resolved "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.29.5.tgz#009a4b1c596cdfd326f30ccfa79f5e56daa264f2" + integrity sha512-G4rGl/Jg4dMCw5u6PEZHZcoHnUBlukZODHbm/wcL4Uu91fkn5jVo5cXXZcvs4VCkArVGrEj/52eUgTZCmOBGWQ== + dependencies: + base64-js "^1.3.0" + bech32 "^1.1.4" + readonly-date "^1.0.0" + "@cosmjs/encoding@^0.29.3": version "0.29.3" resolved "https://registry.npmjs.org/@cosmjs/encoding/-/encoding-0.29.3.tgz#191fe1192d78ac0f9eb01b6e0aa4ba976cfb2c7a" @@ -1637,6 +1750,48 @@ "@cosmjs/stream" "^0.29.3" xstream "^11.14.0" +"@cosmjs/json-rpc@^0.29.5": + version "0.29.5" + resolved "https://registry.npmjs.org/@cosmjs/json-rpc/-/json-rpc-0.29.5.tgz#5e483a9bd98a6270f935adf0dfd8a1e7eb777fe4" + integrity sha512-C78+X06l+r9xwdM1yFWIpGl03LhB9NdM1xvZpQHwgCOl0Ir/WV8pw48y3Ez2awAoUBRfTeejPe4KvrE6NoIi/w== + dependencies: + "@cosmjs/stream" "^0.29.5" + xstream "^11.14.0" + +"@cosmjs/launchpad@0.27.1": + version "0.27.1" + resolved "https://registry.npmjs.org/@cosmjs/launchpad/-/launchpad-0.27.1.tgz#b6f1995748be96560f5f01e84d3ff907477dda77" + integrity sha512-DcFwGD/z5PK8CzO2sojDxa+Be9EIEtRZb2YawgVnw2Ht/p5FlNv+OVo8qlishpBdalXEN7FvQ1dVeDFEe9TuJw== + dependencies: + "@cosmjs/amino" "0.27.1" + "@cosmjs/crypto" "0.27.1" + "@cosmjs/encoding" "0.27.1" + "@cosmjs/math" "0.27.1" + "@cosmjs/utils" "0.27.1" + axios "^0.21.2" + fast-deep-equal "^3.1.3" + +"@cosmjs/math@0.27.1": + version "0.27.1" + resolved "https://registry.npmjs.org/@cosmjs/math/-/math-0.27.1.tgz#be78857b008ffc6b1ed6fecaa1c4cd5bc38c07d7" + integrity sha512-cHWVjmfIjtRc7f80n7x+J5k8pe+vTVTQ0lA82tIxUgqUvgS6rogPP/TmGtTiZ4+NxWxd11DUISY6gVpr18/VNQ== + dependencies: + bn.js "^5.2.0" + +"@cosmjs/math@^0.20.0": + version "0.20.1" + resolved "https://registry.npmjs.org/@cosmjs/math/-/math-0.20.1.tgz#c3c2be821b8b5dbbb9b2c0401bd9f1472e821f2a" + integrity sha512-xt7BmpSw2OVGM2+JhlJvKv9OJs9+3DqgVL6+byUDC355CSISrZhFjJg9GFko1EFssDXz5YgvBZR5FkifC0xazw== + dependencies: + bn.js "^4.11.8" + +"@cosmjs/math@^0.29.0", "@cosmjs/math@^0.29.5": + version "0.29.5" + resolved "https://registry.npmjs.org/@cosmjs/math/-/math-0.29.5.tgz#722c96e080d6c2b62215ce9f4c70da7625b241b6" + integrity sha512-2GjKcv+A9f86MAWYLUkjhw1/WpRl2R1BTb3m9qPG7lzMA7ioYff9jY5SPCfafKdxM4TIQGxXQlYGewQL16O68Q== + dependencies: + bn.js "^5.2.0" + "@cosmjs/math@^0.29.3": version "0.29.3" resolved "https://registry.npmjs.org/@cosmjs/math/-/math-0.29.3.tgz#29f98f6529f3d7654f1af85b329b48482eabbecb" @@ -1644,6 +1799,19 @@ dependencies: bn.js "^5.2.0" +"@cosmjs/proto-signing@0.29.0": + version "0.29.0" + resolved "https://registry.npmjs.org/@cosmjs/proto-signing/-/proto-signing-0.29.0.tgz#4d9c10fc3a5c64b454bd2d9b407861fcffdfbbe0" + integrity sha512-zAdgDz5vRGAfJ5yyKYuTL7qg5UNUT7v4iV1/ZP8ZQn2fLh9QVxViAIovF4r/Y3EEI4JS5uYj/f8UeHMHQSu8hw== + dependencies: + "@cosmjs/amino" "^0.29.0" + "@cosmjs/crypto" "^0.29.0" + "@cosmjs/encoding" "^0.29.0" + "@cosmjs/math" "^0.29.0" + "@cosmjs/utils" "^0.29.0" + cosmjs-types "^0.5.0" + long "^4.0.0" + "@cosmjs/proto-signing@0.29.3", "@cosmjs/proto-signing@^0.29.3": version "0.29.3" resolved "https://registry.npmjs.org/@cosmjs/proto-signing/-/proto-signing-0.29.3.tgz#fa5ed609ed2a0007d8d5eacbeb1f5a89ba1b77ff" @@ -1657,6 +1825,19 @@ cosmjs-types "^0.5.2" long "^4.0.0" +"@cosmjs/proto-signing@0.29.5", "@cosmjs/proto-signing@^0.29.0", "@cosmjs/proto-signing@^0.29.5": + version "0.29.5" + resolved "https://registry.npmjs.org/@cosmjs/proto-signing/-/proto-signing-0.29.5.tgz#af3b62a46c2c2f1d2327d678b13b7262db1fe87c" + integrity sha512-QRrS7CiKaoETdgIqvi/7JC2qCwCR7lnWaUsTzh/XfRy3McLkEd+cXbKAW3cygykv7IN0VAEIhZd2lyIfT8KwNA== + dependencies: + "@cosmjs/amino" "^0.29.5" + "@cosmjs/crypto" "^0.29.5" + "@cosmjs/encoding" "^0.29.5" + "@cosmjs/math" "^0.29.5" + "@cosmjs/utils" "^0.29.5" + cosmjs-types "^0.5.2" + long "^4.0.0" + "@cosmjs/socket@^0.29.3": version "0.29.3" resolved "https://registry.npmjs.org/@cosmjs/socket/-/socket-0.29.3.tgz#0c3fcf16066946c43a7666516ee0edc096ff977c" @@ -1667,6 +1848,34 @@ ws "^7" xstream "^11.14.0" +"@cosmjs/socket@^0.29.5": + version "0.29.5" + resolved "https://registry.npmjs.org/@cosmjs/socket/-/socket-0.29.5.tgz#a48df6b4c45dc6a6ef8e47232725dd4aa556ac2d" + integrity sha512-5VYDupIWbIXq3ftPV1LkS5Ya/T7Ol/AzWVhNxZ79hPe/mBfv1bGau/LqIYOm2zxGlgm9hBHOTmWGqNYDwr9LNQ== + dependencies: + "@cosmjs/stream" "^0.29.5" + isomorphic-ws "^4.0.1" + ws "^7" + xstream "^11.14.0" + +"@cosmjs/stargate@0.29.0": + version "0.29.0" + resolved "https://registry.npmjs.org/@cosmjs/stargate/-/stargate-0.29.0.tgz#55263ed9d414f2c3073a451527576e4c3d6f04a6" + integrity sha512-BsV3iA3vMclMm/B1LYO0djBYCALr/UIvL6u9HGvM7QvpdtpQiAvskuS4PieVO/gtF9iCCBJLPqa0scwFIgvDyg== + dependencies: + "@confio/ics23" "^0.6.8" + "@cosmjs/amino" "^0.29.0" + "@cosmjs/encoding" "^0.29.0" + "@cosmjs/math" "^0.29.0" + "@cosmjs/proto-signing" "^0.29.0" + "@cosmjs/stream" "^0.29.0" + "@cosmjs/tendermint-rpc" "^0.29.0" + "@cosmjs/utils" "^0.29.0" + cosmjs-types "^0.5.0" + long "^4.0.0" + protobufjs "~6.11.3" + xstream "^11.14.0" + "@cosmjs/stargate@0.29.3": version "0.29.3" resolved "https://registry.npmjs.org/@cosmjs/stargate/-/stargate-0.29.3.tgz#9bd303bfd32a7399a233e662864e7cc32e2607af" @@ -1685,6 +1894,31 @@ protobufjs "~6.11.3" xstream "^11.14.0" +"@cosmjs/stargate@0.29.5": + version "0.29.5" + resolved "https://registry.npmjs.org/@cosmjs/stargate/-/stargate-0.29.5.tgz#d597af1c85a3c2af7b5bdbec34d5d40692cc09e4" + integrity sha512-hjEv8UUlJruLrYGJcUZXM/CziaINOKwfVm2BoSdUnNTMxGvY/jC1ABHKeZUYt9oXHxEJ1n9+pDqzbKc8pT0nBw== + dependencies: + "@confio/ics23" "^0.6.8" + "@cosmjs/amino" "^0.29.5" + "@cosmjs/encoding" "^0.29.5" + "@cosmjs/math" "^0.29.5" + "@cosmjs/proto-signing" "^0.29.5" + "@cosmjs/stream" "^0.29.5" + "@cosmjs/tendermint-rpc" "^0.29.5" + "@cosmjs/utils" "^0.29.5" + cosmjs-types "^0.5.2" + long "^4.0.0" + protobufjs "~6.11.3" + xstream "^11.14.0" + +"@cosmjs/stream@^0.29.0", "@cosmjs/stream@^0.29.5": + version "0.29.5" + resolved "https://registry.npmjs.org/@cosmjs/stream/-/stream-0.29.5.tgz#350981cac496d04939b92ee793b9b19f44bc1d4e" + integrity sha512-TToTDWyH1p05GBtF0Y8jFw2C+4783ueDCmDyxOMM6EU82IqpmIbfwcdMOCAm0JhnyMh+ocdebbFvnX/sGKzRAA== + dependencies: + xstream "^11.14.0" + "@cosmjs/stream@^0.29.3": version "0.29.3" resolved "https://registry.npmjs.org/@cosmjs/stream/-/stream-0.29.3.tgz#9d9a9ec952cbc96f2e524204c4833980e314e6cd" @@ -1692,6 +1926,22 @@ dependencies: xstream "^11.14.0" +"@cosmjs/tendermint-rpc@^0.29.0", "@cosmjs/tendermint-rpc@^0.29.5": + version "0.29.5" + resolved "https://registry.npmjs.org/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.29.5.tgz#f205c10464212bdf843f91bb2e4a093b618cb5c2" + integrity sha512-ar80twieuAxsy0x2za/aO3kBr2DFPAXDmk2ikDbmkda+qqfXgl35l9CVAAjKRqd9d+cRvbQyb5M4wy6XQpEV6w== + dependencies: + "@cosmjs/crypto" "^0.29.5" + "@cosmjs/encoding" "^0.29.5" + "@cosmjs/json-rpc" "^0.29.5" + "@cosmjs/math" "^0.29.5" + "@cosmjs/socket" "^0.29.5" + "@cosmjs/stream" "^0.29.5" + "@cosmjs/utils" "^0.29.5" + axios "^0.21.2" + readonly-date "^1.0.0" + xstream "^11.14.0" + "@cosmjs/tendermint-rpc@^0.29.3": version "0.29.3" resolved "https://registry.npmjs.org/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.29.3.tgz#054f80e5095cdf328d98fa7bcf23cd785435d247" @@ -1708,11 +1958,50 @@ readonly-date "^1.0.0" xstream "^11.14.0" +"@cosmjs/utils@0.27.1": + version "0.27.1" + resolved "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.27.1.tgz#1c8efde17256346ef142a3bd15158ee4055470e2" + integrity sha512-VG7QPDiMUzVPxRdJahDV8PXxVdnuAHiIuG56hldV4yPnOz/si/DLNd7VAUUA5923b6jS1Hhev0Hr6AhEkcxBMg== + +"@cosmjs/utils@^0.20.0": + version "0.20.1" + resolved "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.20.1.tgz#4d239b7d93c15523cdf109f225cbf61326fb69cd" + integrity sha512-xl9YnIrAAaBd6nFffwFbyrnKjqjD9zKGP8OBKxzyglxamHfqAS+PcJPEiaEpt+oUt7HAIOyhL3KK75Dh52hGvA== + +"@cosmjs/utils@^0.29.0", "@cosmjs/utils@^0.29.5": + version "0.29.5" + resolved "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.29.5.tgz#3fed1b3528ae8c5f1eb5d29b68755bebfd3294ee" + integrity sha512-m7h+RXDUxOzEOGt4P+3OVPX7PuakZT3GBmaM/Y2u+abN3xZkziykD/NvedYFvvCCdQo714XcGl33bwifS9FZPQ== + "@cosmjs/utils@^0.29.3": version "0.29.3" resolved "https://registry.npmjs.org/@cosmjs/utils/-/utils-0.29.3.tgz#d7e1f381267e61b7d3219ebd75d46defc397cd43" integrity sha512-UuKoBN2xiRXcBpz7jzCwagKhOnLOsRmR8mu3IzY+Yx38i8rW52FSXMbxC/yE83X0vLea+zgMQFPwv0gy4QWUJw== +"@cosmology/core@1.16.0": + version "1.16.0" + resolved "https://registry.npmjs.org/@cosmology/core/-/core-1.16.0.tgz#d7785b7fe441a778fe9efd1bee0c84d307fe70d2" + integrity sha512-oaX8f5LWrwcBlNqc8qes7MVC7DuTT/DV+HIM6VQDx25v9vi0j6JJUsvgFj7lpUJje7a41Fv67GoMDiLpSiA0ow== + dependencies: + "@babel/runtime" "^7.18.9" + "@cosmjs/amino" "0.29.5" + "@cosmjs/launchpad" "0.27.1" + "@cosmjs/proto-signing" "0.29.5" + "@cosmjs/stargate" "0.29.5" + "@keplr-wallet/types" "0.11.22" + "@keplr-wallet/unit" "0.11.22" + axios "0.27.2" + chain-registry "1.6.0" + class-autobind "^0.1.4" + cosmjs-types "0.5.2" + crypto-js "4.1.1" + long "5.2.0" + osmojs "13.0.0-rc.0" + protobufjs "6.11.3" + retry "0.13.1" + secrets.js-grempe "2.0.0" + typescript "^4.7.4" + "@cosmwasm/ts-codegen@0.21.1": version "0.21.1" resolved "https://registry.npmjs.org/@cosmwasm/ts-codegen/-/ts-codegen-0.21.1.tgz#abbb15fdb8f1c966079de49e0da0f847fa5045fe" @@ -1795,6 +2084,48 @@ resolved "https://registry.npmjs.org/@hutson/parse-repository-url/-/parse-repository-url-3.0.2.tgz#98c23c950a3d9b6c8f0daed06da6c3af06981340" integrity sha512-H9XAx3hc0BQHY6l+IFSWHDySypcXsvsuLhgYLUGywmJ5pswRVQJUHpOsobnLYp2ZUaUlKiKDrgWWhosOwAEM8Q== +"@iov/crypto@2.1.0": + version "2.1.0" + resolved "https://registry.npmjs.org/@iov/crypto/-/crypto-2.1.0.tgz#10e91b6692e154958c11626dfd096a80e8a481a4" + integrity sha512-jnb4XuK50admolm7fBxOcxfAW2TO+wYrZlhDWiMETItY/Y5gNNa1zaDSO2wNIjjfGng+8nQ1yqnNhqy7busV2Q== + dependencies: + "@iov/encoding" "^2.1.0" + bip39 "^3.0.2" + bn.js "^4.11.8" + elliptic "^6.4.0" + js-sha3 "^0.8.0" + libsodium-wrappers "^0.7.6" + pbkdf2 "^3.0.16" + ripemd160 "^2.0.2" + sha.js "^2.4.11" + type-tagger "^1.0.0" + unorm "^1.5.0" + +"@iov/encoding@2.1.0": + version "2.1.0" + resolved "https://registry.npmjs.org/@iov/encoding/-/encoding-2.1.0.tgz#434203c39874c68bc1d96e1278251f0feb23be07" + integrity sha512-5IOdLO7Xg/uRykuiCqeMYghQ3IjWDtGxv7NTWXkgpHuna0aewx43mRpT2NPCpOZd1tpuorDtQ7/zbDNRaIIF/w== + dependencies: + base64-js "^1.3.0" + bech32 "^1.1.3" + bn.js "^4.11.8" + readonly-date "^1.0.0" + +"@iov/encoding@^2.1.0": + version "2.5.0" + resolved "https://registry.npmjs.org/@iov/encoding/-/encoding-2.5.0.tgz#9612e529f45e63633b2375c13db28b9330ce6293" + integrity sha512-HGHLlQEvD23rFjW5PQrxD2B/6LiBHVSxqX6gjOz9KfcmIMIftRA0qROrTITfjjjUr/yZZEeNk4qjuBls9TaYcA== + dependencies: + "@cosmjs/encoding" "^0.20.0" + "@cosmjs/math" "^0.20.0" + "@cosmjs/utils" "^0.20.0" + readonly-date "^1.0.0" + +"@iov/utils@2.0.2": + version "2.0.2" + resolved "https://registry.npmjs.org/@iov/utils/-/utils-2.0.2.tgz#3527f376d26100e07ac823bf87bebd0f24680d1c" + integrity sha512-4D8MEvTcFc/DVy5q25vHxRItmgJyeX85dixMH+MxdKr+yy71h3sYk+sVBEIn70uqGP7VqAJkGOPNFs08/XYELw== + "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" resolved "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced" @@ -2097,6 +2428,42 @@ resolved "https://registry.npmjs.org/@jsdevtools/ono/-/ono-7.1.3.tgz#9df03bbd7c696a5c58885c34aa06da41c8543796" integrity sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg== +"@keplr-wallet/types@0.11.22": + version "0.11.22" + resolved "https://registry.npmjs.org/@keplr-wallet/types/-/types-0.11.22.tgz#97c9745e2841984cec8f91997a6aeef6de24579b" + integrity sha512-n89XRLMVQJqaET55JtEyjUKkRXOYQ1/2hNPkFioTsnpiBH/UBxHLefzwStecrc7fjpIExd/P5DNnNM9c0P84Eg== + dependencies: + axios "^0.27.2" + long "^4.0.0" + secretjs "0.17.7" + +"@keplr-wallet/types@0.11.25": + version "0.11.25" + resolved "https://registry.npmjs.org/@keplr-wallet/types/-/types-0.11.25.tgz#81a281712ce58f131d8579898dcde66934bcb52e" + integrity sha512-A2n2PXdRpn+v4icW34sbovcr4sZY14J+zZeEavBkuMtVyk49JlOOBj6orI+ofFl+SXzro+4vWei/XAJFrd/swg== + dependencies: + axios "^0.27.2" + long "^4.0.0" + secretjs "0.17.7" + +"@keplr-wallet/unit@0.11.22": + version "0.11.22" + resolved "https://registry.npmjs.org/@keplr-wallet/unit/-/unit-0.11.22.tgz#c2a2f51f880cf8a0685560cc02e09a12006c529d" + integrity sha512-cNV8HD+3HClk3rZaAPaOwfAXKCfWYP6mKaK5Nt2JOKw5WDFJIcuiVbw6Ns1cXMvKpwZHUygI6nr6Plpikr/h9g== + dependencies: + "@keplr-wallet/types" "0.11.22" + big-integer "^1.6.48" + utility-types "^3.10.0" + +"@keplr-wallet/unit@0.11.25": + version "0.11.25" + resolved "https://registry.npmjs.org/@keplr-wallet/unit/-/unit-0.11.25.tgz#2e36aaf86f328b07053c2aeb459d035af76abee4" + integrity sha512-aALEZTWQR3z1Z9/OADGA/iaim82buOBjHNc+NG6FtXBhekRt0gD2jZ0RI6s6bh4Vjj2O+GNRzteJBoC7pBCiXg== + dependencies: + "@keplr-wallet/types" "0.11.25" + big-integer "^1.6.48" + utility-types "^3.10.0" + "@lerna/add@4.0.0": version "4.0.0" resolved "https://registry.npmjs.org/@lerna/add/-/add-4.0.0.tgz#c36f57d132502a57b9e7058d1548b7a565ef183f" @@ -3305,6 +3672,11 @@ resolved "https://registry.npmjs.org/@types/node/-/node-18.8.2.tgz#17d42c6322d917764dd3d2d3a10d7884925de067" integrity sha512-cRMwIgdDN43GO4xMWAfJAecYn8wV4JbsOGHNfNUIDiuYkUYAR5ec4Rj7IO2SAhFPEfpPtLtUTbbny/TCT7aDwA== +"@types/node@11.11.6": + version "11.11.6" + resolved "https://registry.npmjs.org/@types/node/-/node-11.11.6.tgz#df929d1bb2eee5afdda598a41930fe50b43eaa6a" + integrity sha512-Exw4yUWMBXM3X+8oqzJNRqZSwUAaS4+7NdvHqQuFi/d+synz++xmX3QIf+BFqneW8N31R8Ky+sikfZUXq07ggQ== + "@types/node@>=13.7.0": version "18.7.23" resolved "https://registry.npmjs.org/@types/node/-/node-18.7.23.tgz#75c580983846181ebe5f4abc40fe9dfb2d65665f" @@ -3598,6 +3970,13 @@ aws4@^1.8.0: resolved "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59" integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA== +axios@0.21.1: + version "0.21.1" + resolved "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz#22563481962f4d6bde9a76d516ef0e5d3c09b2b8" + integrity sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA== + dependencies: + follow-redirects "^1.10.0" + axios@0.27.2, axios@^0.27.2: version "0.27.2" resolved "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz#207658cc8621606e586c85db4b41a750e756d972" @@ -3753,7 +4132,7 @@ balanced-match@^1.0.0: resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== -base64-js@^1.3.0: +base64-js@^1.0.2, base64-js@^1.3.0, base64-js@^1.3.1: version "1.5.1" resolved "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== @@ -3765,7 +4144,7 @@ bcrypt-pbkdf@^1.0.0: dependencies: tweetnacl "^0.14.3" -bech32@^1.1.4: +bech32@^1.1.3, bech32@^1.1.4: version "1.1.4" resolved "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz#e38c9f37bf179b8eb16ae3a772b40c356d4832e9" integrity sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ== @@ -3775,12 +4154,27 @@ before-after-hook@^2.2.0: resolved "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.2.tgz#a6e8ca41028d90ee2c24222f201c90956091613e" integrity sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ== +big-integer@^1.6.48: + version "1.6.51" + resolved "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz#0df92a5d9880560d3ff2d5fd20245c889d130686" + integrity sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg== + binary-extensions@^2.0.0: version "2.2.0" resolved "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== -bn.js@^4.11.9: +bip39@^3.0.2: + version "3.0.4" + resolved "https://registry.npmjs.org/bip39/-/bip39-3.0.4.tgz#5b11fed966840b5e1b8539f0f54ab6392969b2a0" + integrity sha512-YZKQlb752TrUWqHWj7XAwCSjYEgGAk+/Aas3V7NyjQeZYsztO8JnQUaCWhcnL4T+jL8nvB8typ2jRPzTlgugNw== + dependencies: + "@types/node" "11.11.6" + create-hash "^1.1.0" + pbkdf2 "^3.0.9" + randombytes "^2.0.1" + +bn.js@^4.11.8, bn.js@^4.11.9: version "4.12.0" resolved "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== @@ -3856,6 +4250,22 @@ buffer-from@^1.0.0: resolved "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== +buffer@6.0.3: + version "6.0.3" + resolved "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" + integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.2.1" + +buffer@~5.4.3: + version "5.4.3" + resolved "https://registry.npmjs.org/buffer/-/buffer-5.4.3.tgz#3fbc9c69eb713d323e3fc1a895eee0710c072115" + integrity sha512-zvj65TkFeIt3i6aj5bIvJDzjjQQGs4o/sNoezg1F1kYap9Nu2jcUdpwzRSJTHMMzG0H7bZkn4rNQpImhuxWX2A== + dependencies: + base64-js "^1.0.2" + ieee754 "^1.1.4" + builtins@^1.0.3: version "1.0.3" resolved "https://registry.npmjs.org/builtins/-/builtins-1.0.3.tgz#cb94faeb61c8696451db36534e1422f94f0aee88" @@ -3947,6 +4357,14 @@ caseless@~0.12.0: resolved "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" integrity sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw== +chain-registry@1.6.0: + version "1.6.0" + resolved "https://registry.npmjs.org/chain-registry/-/chain-registry-1.6.0.tgz#2f26ea2af66f0c48ff6716f00d3ea4c7e881560a" + integrity sha512-1eZpMNoYwiwH8xmhfcAaa5wbY1bKdEQtUJrjUdWcBZvpwUPJTSAZ8UbCvuA/NP4Mwcrkko5kFcgqWDcxG2+w3w== + dependencies: + "@babel/runtime" "^7.19.4" + "@chain-registry/types" "^0.14.0" + chalk@^1.0.0, chalk@^1.1.3: version "1.1.3" resolved "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" @@ -3990,6 +4408,11 @@ chardet@^0.7.0: resolved "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== +charenc@~0.0.1: + version "0.0.2" + resolved "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz#c0a1d2f3a7092e03774bfa83f14c0fc5790a8667" + integrity sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA== + chokidar@^3.4.0, chokidar@^3.4.3: version "3.5.3" resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" @@ -4025,11 +4448,24 @@ ci-info@^3.2.0: resolved "https://registry.npmjs.org/ci-info/-/ci-info-3.4.0.tgz#b28484fd436cbc267900364f096c9dc185efb251" integrity sha512-t5QdPT5jq3o262DOQ8zA6E1tlH2upmUc4Hlvrbx1pGYJuiiHl7O7rvVNI+l8HTVhd/q3Qc9vqimkNk5yiXsAug== +cipher-base@^1.0.1, cipher-base@^1.0.3: + version "1.0.4" + resolved "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" + integrity sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q== + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + cjs-module-lexer@^1.0.0: version "1.2.2" resolved "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz#9f84ba3244a512f3a54e5277e8eef4c489864e40" integrity sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA== +class-autobind@^0.1.4: + version "0.1.4" + resolved "https://registry.npmjs.org/class-autobind/-/class-autobind-0.1.4.tgz#34516c49167cf8d3f639ddc186bcfa2268afff34" + integrity sha512-Hd4wk0aVnIiMKCI/qA006/U+yOlbLV0BVAeaQqh9NyQZMPWfIOJh5fPZqN3T9Y9UydYdfIa27Hxp+dPh7jYT3w== + clean-stack@^2.0.0: version "2.2.0" resolved "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" @@ -4340,7 +4776,15 @@ cosmiconfig@^7.0.0: path-type "^4.0.0" yaml "^1.10.0" -cosmjs-types@^0.5.2: +cosmjs-types@0.5.1: + version "0.5.1" + resolved "https://registry.npmjs.org/cosmjs-types/-/cosmjs-types-0.5.1.tgz#f9bc35e78c32b687fb6018dc573eb454b3ae2587" + integrity sha512-NcC58xUIVLlKdIimWWQAmSlmCjiMrJnuHf4i3LiD8PCextfHR0fT3V5/WlXZZreyMgdmh6ML1zPUfGTbbo3Z5g== + dependencies: + long "^4.0.0" + protobufjs "~6.11.2" + +cosmjs-types@0.5.2, cosmjs-types@^0.5.0, cosmjs-types@^0.5.2: version "0.5.2" resolved "https://registry.npmjs.org/cosmjs-types/-/cosmjs-types-0.5.2.tgz#2d42b354946f330dfb5c90a87fdc2a36f97b965d" integrity sha512-zxCtIJj8v3Di7s39uN4LNcN3HIE1z0B9Z0SPE8ZNQR0oSzsuSe1ACgxoFkvhkS7WBasCAFcglS11G2hyfd5tPg== @@ -4348,6 +4792,41 @@ cosmjs-types@^0.5.2: long "^4.0.0" protobufjs "~6.11.2" +cosmjs-utils@0.1.0: + version "0.1.0" + resolved "https://registry.npmjs.org/cosmjs-utils/-/cosmjs-utils-0.1.0.tgz#a3e114a42619d541649587a37d489fc0cf6b9462" + integrity sha512-Ao2YhVXN+FqvbKqNeVN6I4njzRsCe3LVuPiLerMrAr6xr4MMABzvZbnY13AK/CYPrFJFJpmBCssocthAxOi59g== + dependencies: + "@babel/runtime" "^7.11.2" + "@cosmjs/amino" "0.29.0" + "@cosmjs/crypto" "0.29.0" + "@cosmjs/proto-signing" "0.29.0" + "@cosmjs/stargate" "0.29.0" + cosmjs-types "0.5.1" + +create-hash@^1.1.0, create-hash@^1.1.2: + version "1.2.0" + resolved "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" + integrity sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg== + dependencies: + cipher-base "^1.0.1" + inherits "^2.0.1" + md5.js "^1.3.4" + ripemd160 "^2.0.1" + sha.js "^2.4.0" + +create-hmac@^1.1.4: + version "1.1.7" + resolved "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" + integrity sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg== + dependencies: + cipher-base "^1.0.3" + create-hash "^1.1.0" + inherits "^2.0.1" + ripemd160 "^2.0.0" + safe-buffer "^5.0.1" + sha.js "^2.4.8" + cross-env@^7.0.2: version "7.0.3" resolved "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz#865264b29677dc015ba8418918965dd232fc54cf" @@ -4364,6 +4843,21 @@ cross-spawn@^7.0.1, cross-spawn@^7.0.2, cross-spawn@^7.0.3: shebang-command "^2.0.0" which "^2.0.1" +crypt@~0.0.1: + version "0.0.2" + resolved "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz#88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b" + integrity sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow== + +crypto-js@4.1.1: + version "4.1.1" + resolved "https://registry.npmjs.org/crypto-js/-/crypto-js-4.1.1.tgz#9e485bcf03521041bd85844786b83fb7619736cf" + integrity sha512-o2JlM7ydqd3Qk9CA0L4NL6mTzU2sdx96a+oOfPu8Mkl/PK51vSyoi8/rQ8NknZtk44vq15lmhAj9CIAGwgeWKw== + +curve25519-js@0.0.4: + version "0.0.4" + resolved "https://registry.npmjs.org/curve25519-js/-/curve25519-js-0.0.4.tgz#e6ad967e8cd284590d657bbfc90d8b50e49ba060" + integrity sha512-axn2UMEnkhyDUPWOwVKBMVIzSQy2ejH2xRGy1wq81dqRwApXfIzfbE3hIX0ZRFBIihf/KDqK158DLwESu4AK1w== + d@1, d@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/d/-/d-1.0.1.tgz#8698095372d58dbee346ffd0c7093f99f8f9eb5a" @@ -4548,7 +5042,7 @@ electron-to-chromium@^1.4.202, electron-to-chromium@^1.4.251: resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.272.tgz#cedebaeec5d9879da85b127e65a55c6b4c58344e" integrity sha512-KS6gPPGNrzpVv9HzFVq+Etd0AjZEPr5pvaTBn2yD6KV4+cKW4I0CJoJNgmTG6gUQPAMZ4wIPtcOuoou3qFAZCA== -elliptic@^6.5.3: +elliptic@^6.4.0, elliptic@^6.5.3, elliptic@^6.5.4: version "6.5.4" resolved "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== @@ -4917,6 +5411,11 @@ extsprintf@^1.2.0: resolved "https://registry.npmjs.org/extsprintf/-/extsprintf-1.4.1.tgz#8d172c064867f235c0c84a596806d279bf4bcc07" integrity sha512-Wrk35e8ydCKDj/ArClo1VrPVmN8zph5V4AtHwIuHhvMXsKf73UT3BOD+azBIW+3wOJ4FhEH7zyaJCFvChjYvMA== +fast-deep-equal@3.1.1: + version "3.1.1" + resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz#545145077c501491e33b15ec408c294376e94ae4" + integrity sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA== + fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" @@ -5047,7 +5546,7 @@ flatted@^3.1.0: resolved "https://registry.npmjs.org/flatted/-/flatted-3.2.6.tgz#022e9218c637f9f3fc9c35ab9c9193f05add60b2" integrity sha512-0sQoMh9s0BYsm+12Huy/rkKxVu4R1+r96YX5cG44rHV0pQ6iC3Q+mkoMFaGWObMFYQxCVT+ssG1ksneA2MI9KQ== -follow-redirects@^1.14.0: +follow-redirects@^1.10.0, follow-redirects@^1.14.0: version "1.15.2" resolved "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== @@ -5439,7 +5938,16 @@ has@^1.0.3: dependencies: function-bind "^1.1.1" -hash.js@^1.0.0, hash.js@^1.0.3: +hash-base@^3.0.0: + version "3.1.0" + resolved "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz#55c381d9e06e1d2997a883b4a3fddfe7f0d3af33" + integrity sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA== + dependencies: + inherits "^2.0.4" + readable-stream "^3.6.0" + safe-buffer "^5.2.0" + +hash.js@^1.0.0, hash.js@^1.0.3, hash.js@~1.1.7: version "1.1.7" resolved "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== @@ -5537,6 +6045,11 @@ iconv-lite@^0.6.2: dependencies: safer-buffer ">= 2.1.2 < 3.0.0" +ieee754@^1.1.4, ieee754@^1.2.1: + version "1.2.1" + resolved "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" + integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== + ignore-walk@^3.0.3: version "3.0.4" resolved "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.4.tgz#c9a09f69b7c7b479a5d74ac1a3c0d4236d2a6335" @@ -5588,7 +6101,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.3: +inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.3: version "2.0.4" resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== @@ -5742,6 +6255,11 @@ is-boolean-object@^1.1.0: call-bind "^1.0.2" has-tostringtag "^1.0.0" +is-buffer@~1.1.1: + version "1.1.6" + resolved "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== + is-callable@^1.1.4, is-callable@^1.2.6: version "1.2.7" resolved "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055" @@ -6401,12 +6919,63 @@ jest@29.1.2, jest@^29.0.3, jest@^29.1.2: import-local "^3.0.2" jest-cli "^29.1.2" +js-crypto-env@^0.3.2: + version "0.3.2" + resolved "https://registry.npmjs.org/js-crypto-env/-/js-crypto-env-0.3.2.tgz#02195723469da14449338ca2789fd7ff6784c533" + integrity sha512-F1uHiCkSOo36qBuuZABA4sBf+xeFBzhJZ0Sd7af8FAruszIhm1Xxv+Zr5Ne90Zlh7/fnxCsrdkj0N8f0a3lVlQ== + +js-crypto-hash@^0.6.3: + version "0.6.3" + resolved "https://registry.npmjs.org/js-crypto-hash/-/js-crypto-hash-0.6.3.tgz#748e3e1853f69dad714636db3290736825506641" + integrity sha512-SG8c9tM8y3sUb4k7WvpVfu5vU7zfPvX+eaYR5578TvehkehdaQbqAc+y+1FwxnqQ3WZ0gsYoOKp/mW+mqtNoWA== + dependencies: + buffer "~5.4.3" + hash.js "~1.1.7" + js-crypto-env "^0.3.2" + md5 "~2.2.1" + sha3 "~2.1.0" + +js-crypto-hkdf@0.7.3: + version "0.7.3" + resolved "https://registry.npmjs.org/js-crypto-hkdf/-/js-crypto-hkdf-0.7.3.tgz#537c394a2e65bca80032daa07d2ffe7e4f78d32f" + integrity sha512-eAaVArAjS2GCacWGXY4hjBiexrLQYlI0PMOcbwtrSEj84XU3kUfMYZm9bpTyaTXgdHC/eQoXe/Of6biG+RSEaQ== + dependencies: + js-crypto-env "^0.3.2" + js-crypto-hmac "^0.6.3" + js-crypto-random "^0.4.3" + js-encoding-utils "0.5.6" + +js-crypto-hmac@^0.6.3: + version "0.6.3" + resolved "https://registry.npmjs.org/js-crypto-hmac/-/js-crypto-hmac-0.6.3.tgz#c33352c1ee6076b17b8f4cb0e2167814b2b77d6d" + integrity sha512-T0pKOaHACOSG6Xs6/06G8RDDeZouQwIQNBq9L/zoUGsd4F67gAjpT3q2lGigAGpUd1hiyy7vnhvLpz7VDt6DbA== + dependencies: + js-crypto-env "^0.3.2" + js-crypto-hash "^0.6.3" + +js-crypto-random@^0.4.3: + version "0.4.3" + resolved "https://registry.npmjs.org/js-crypto-random/-/js-crypto-random-0.4.3.tgz#898c2d91991eead02b4e461005e878fa9827fd74" + integrity sha512-C3gzphPPfw9jfQ9Q/LjhJMZxQNp3AaoVRDvyZkiB+zYltfs8tKQPsskWkXACpg1Nzh01PtSRUvVijjptd2qGHQ== + dependencies: + js-crypto-env "^0.3.2" + +js-encoding-utils@0.5.6: + version "0.5.6" + resolved "https://registry.npmjs.org/js-encoding-utils/-/js-encoding-utils-0.5.6.tgz#517351d8f4a85b2ad121183d41df8319981bee03" + integrity sha512-qnAGsUIWrmzh5n+3AXqbxX1KsB9hkQmJZf3aA9DLAS7GpL/NEHCBreFFbW+imramoU+Q0TDyvkwhRbBRH1TVkg== + js-sdsl@^4.1.4: version "4.1.5" resolved "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.1.5.tgz#1ff1645e6b4d1b028cd3f862db88c9d887f26e2a" integrity sha512-08bOAKweV2NUC1wqTtf3qZlnpOX/R2DU9ikpjOHs0H+ibQv3zpncVQg6um4uYtRtrwIX8M4Nh3ytK4HGlYAq7Q== -js-tokens@^4.0.0: +js-sha3@^0.8.0: + version "0.8.0" + resolved "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" + integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q== + +"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== @@ -6690,15 +7259,22 @@ lodash@^4.17.12, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.21, lodash@^4.17 resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== +long@5.2.0, long@^5.2.0: + version "5.2.0" + resolved "https://registry.npmjs.org/long/-/long-5.2.0.tgz#2696dadf4b4da2ce3f6f6b89186085d94d52fd61" + integrity sha512-9RTUNjK60eJbx3uz+TEGF7fUr29ZDxR5QzXcyDpeSfeH28S9ycINflOgOlppit5U+4kNTe83KQnMEerw7GmE8w== + long@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28" integrity sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA== -long@^5.2.0: - version "5.2.0" - resolved "https://registry.npmjs.org/long/-/long-5.2.0.tgz#2696dadf4b4da2ce3f6f6b89186085d94d52fd61" - integrity sha512-9RTUNjK60eJbx3uz+TEGF7fUr29ZDxR5QzXcyDpeSfeH28S9ycINflOgOlppit5U+4kNTe83KQnMEerw7GmE8w== +loose-envify@^1.1.0: + version "1.4.0" + resolved "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== + dependencies: + js-tokens "^3.0.0 || ^4.0.0" lru-cache@^6.0.0: version "6.0.0" @@ -6794,6 +7370,24 @@ map-obj@^4.0.0: resolved "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz#9304f906e93faae70880da102a9f1df0ea8bb05a" integrity sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ== +md5.js@^1.3.4: + version "1.3.5" + resolved "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" + integrity sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg== + dependencies: + hash-base "^3.0.0" + inherits "^2.0.1" + safe-buffer "^5.1.2" + +md5@~2.2.1: + version "2.2.1" + resolved "https://registry.npmjs.org/md5/-/md5-2.2.1.tgz#53ab38d5fe3c8891ba465329ea23fac0540126f9" + integrity sha512-PlGG4z5mBANDGCKsYQe0CaUYHdZYZt8ZPZLmEt+Urf0W4GlpTX4HescwHU+dc9+Z/G/vZKYZYFrwgm9VxK6QOQ== + dependencies: + charenc "~0.0.1" + crypt "~0.0.1" + is-buffer "~1.1.1" + memoizee@^0.4.15: version "0.4.15" resolved "https://registry.npmjs.org/memoizee/-/memoizee-0.4.15.tgz#e6f3d2da863f318d02225391829a6c5956555b72" @@ -6985,6 +7579,11 @@ minizlib@^2.0.0, minizlib@^2.1.1: minipass "^3.0.0" yallist "^4.0.0" +miscreant@0.3.2: + version "0.3.2" + resolved "https://registry.npmjs.org/miscreant/-/miscreant-0.3.2.tgz#a91c046566cca70bd6b5e9fbdd3f67617fa85034" + integrity sha512-fL9KxsQz9BJB2KGPMHFrReioywkiomBiuaLk6EuChijK0BsJsIKJXdVomR+/bPj5mvbFD6wM0CM3bZio9g7OHA== + mkdirp-infer-owner@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/mkdirp-infer-owner/-/mkdirp-infer-owner-2.0.0.tgz#55d3b368e7d89065c38f32fd38e638f0ab61d316" @@ -7385,6 +7984,20 @@ osenv@^0.1.4: os-homedir "^1.0.0" os-tmpdir "^1.0.0" +osmojs@13.0.0-rc.0: + version "13.0.0-rc.0" + resolved "https://registry.npmjs.org/osmojs/-/osmojs-13.0.0-rc.0.tgz#318c083bbabe793a620955429fd961a68c4853aa" + integrity sha512-CucpaeowajwljzFgcBnf2LoHIy7+iN/DqFxAeSOFXBpuelny7FfGecBH8E2ZrDpA8LwdpKv99SX7R8jSWYHAaA== + dependencies: + "@babel/runtime" "^7.19.0" + "@cosmjs/amino" "0.29.3" + "@cosmjs/proto-signing" "0.29.3" + "@cosmjs/stargate" "0.29.3" + "@cosmjs/tendermint-rpc" "^0.29.3" + "@osmonauts/lcd" "^0.8.0" + long "^5.2.0" + protobufjs "^6.11.3" + p-finally@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" @@ -7518,6 +8131,11 @@ pacote@^11.2.6: ssri "^8.0.1" tar "^6.1.0" +pako@1.0.11: + version "1.0.11" + resolved "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz#6c9599d340d54dfd3946380252a35705a6b992bf" + integrity sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw== + parent-module@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" @@ -7610,6 +8228,17 @@ path-type@^4.0.0: resolved "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== +pbkdf2@^3.0.16, pbkdf2@^3.0.9: + version "3.1.2" + resolved "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz#dd822aa0887580e52f1a039dc3eda108efae3075" + integrity sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA== + dependencies: + create-hash "^1.1.2" + create-hmac "^1.1.4" + ripemd160 "^2.0.1" + safe-buffer "^5.0.1" + sha.js "^2.4.8" + performance-now@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" @@ -7728,7 +8357,7 @@ proto-list@~1.2.1: resolved "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz#212d5bfe1318306a420f6402b8e26ff39647a849" integrity sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA== -protobufjs@^6.11.3, protobufjs@^6.8.8, protobufjs@~6.11.2, protobufjs@~6.11.3: +protobufjs@6.11.3, protobufjs@^6.11.3, protobufjs@^6.8.8, protobufjs@~6.11.2, protobufjs@~6.11.3: version "6.11.3" resolved "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.3.tgz#637a527205a35caa4f3e2a9a4a13ddffe0e7af74" integrity sha512-xL96WDdCZYdU7Slin569tFX712BxsxslWwAfAhCYjQKGTq7dAU91Lomy6nLLhh/dyGhk/YH4TwTSRxTzhuHyZg== @@ -7804,11 +8433,33 @@ quick-lru@^4.0.1: resolved "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz#5b8878f113a58217848c6482026c73e1ba57727f" integrity sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g== +randombytes@^2.0.1: + version "2.1.0" + resolved "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" + integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== + dependencies: + safe-buffer "^5.1.0" + +react-dom@18.2.0: + version "18.2.0" + resolved "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz#22aaf38708db2674ed9ada224ca4aa708d821e3d" + integrity sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g== + dependencies: + loose-envify "^1.1.0" + scheduler "^0.23.0" + react-is@^18.0.0: version "18.2.0" resolved "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz#199431eeaaa2e09f86427efbb4f1473edb47609b" integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w== +react@18.2.0: + version "18.2.0" + resolved "https://registry.npmjs.org/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5" + integrity sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ== + dependencies: + loose-envify "^1.1.0" + read-cmd-shim@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/read-cmd-shim/-/read-cmd-shim-2.0.0.tgz#4a50a71d6f0965364938e9038476f7eede3928d9" @@ -7904,7 +8555,7 @@ read@1, read@~1.0.1: dependencies: mute-stream "~0.0.4" -readable-stream@3, readable-stream@^3.0.0, readable-stream@^3.0.2: +readable-stream@3, readable-stream@^3.0.0, readable-stream@^3.0.2, readable-stream@^3.6.0: version "3.6.0" resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== @@ -7975,6 +8626,11 @@ regenerate@^1.4.2: resolved "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz#b9346d8827e8f5a32f7ba29637d398b69014848a" integrity sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A== +regenerator-runtime@^0.13.11: + version "0.13.11" + resolved "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz#f6dca3e7ceec20590d07ada785636a90cdca17f9" + integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg== + regenerator-runtime@^0.13.4, regenerator-runtime@^0.13.7: version "0.13.9" resolved "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz#8925742a98ffd90814988d7566ad30ca3b263b52" @@ -8103,6 +8759,11 @@ restore-cursor@^3.1.0: onetime "^5.1.0" signal-exit "^3.0.2" +retry@0.13.1: + version "0.13.1" + resolved "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz#185b1587acf67919d63b357349e03537b2484658" + integrity sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg== + retry@^0.12.0: version "0.12.0" resolved "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz#1b42a6266a21f07421d1b0b54b7dc167b01c013b" @@ -8127,6 +8788,14 @@ rimraf@^2.6.3: dependencies: glob "^7.1.3" +ripemd160@^2.0.0, ripemd160@^2.0.1, ripemd160@^2.0.2: + version "2.0.2" + resolved "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" + integrity sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA== + dependencies: + hash-base "^3.0.0" + inherits "^2.0.1" + run-async@^2.2.0, run-async@^2.3.0, run-async@^2.4.0: version "2.4.1" resolved "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz#8440eccf99ea3e70bd409d49aab88e10c189a455" @@ -8158,7 +8827,7 @@ rxjs@^6.4.0, rxjs@^6.6.0: dependencies: tslib "^1.9.0" -safe-buffer@^5.0.1, safe-buffer@^5.1.2, safe-buffer@^5.2.1, safe-buffer@~5.2.0: +safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@^5.2.1, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== @@ -8182,6 +8851,40 @@ safe-regex-test@^1.0.0: resolved "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== +scheduler@^0.23.0: + version "0.23.0" + resolved "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz#ba8041afc3d30eb206a487b6b384002e4e61fdfe" + integrity sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw== + dependencies: + loose-envify "^1.1.0" + +secretjs@0.17.7: + version "0.17.7" + resolved "https://registry.npmjs.org/secretjs/-/secretjs-0.17.7.tgz#a1aef5866a35cf673be9ddd717d20729afd056ac" + integrity sha512-j39l9+vR2A8067QBqDDejS7LmRLgdkG4uRw2Ar6HMfzDGo26eTh7cIXVlVu/yHBumxtQzKun20epOXwuYHXjQg== + dependencies: + "@iov/crypto" "2.1.0" + "@iov/encoding" "2.1.0" + "@iov/utils" "2.0.2" + axios "0.21.1" + curve25519-js "0.0.4" + fast-deep-equal "3.1.1" + js-crypto-hkdf "0.7.3" + miscreant "0.3.2" + pako "1.0.11" + protobufjs "6.11.3" + secure-random "1.1.2" + +secrets.js-grempe@2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/secrets.js-grempe/-/secrets.js-grempe-2.0.0.tgz#65b32bf6bfe4f40e8ed0e44dc74f469e293a4ab8" + integrity sha512-4xkOIaDAg998dTFXZUJTOoVbdLHfB818SMeLJ69ABccgGEKokxsoRFupAFfAImloUSKv4QUGNMgKVbKMf6z0Ug== + +secure-random@1.1.2: + version "1.1.2" + resolved "https://registry.npmjs.org/secure-random/-/secure-random-1.1.2.tgz#ed103b460a851632d420d46448b2a900a41e7f7c" + integrity sha512-H2bdSKERKdBV1SwoqYm6C0y+9EA94v6SUBOWO8kDndc4NoUih7Dv6Tsgma7zO1lv27wIvjlD0ZpMQk7um5dheQ== + "semver@2 || 3 || 4 || 5", semver@^5.6.0, semver@^5.7.0, semver@^5.7.1: version "5.7.1" resolved "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" @@ -8209,6 +8912,21 @@ set-blocking@~2.0.0: resolved "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw== +sha.js@^2.4.0, sha.js@^2.4.11, sha.js@^2.4.8: + version "2.4.11" + resolved "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" + integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ== + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + +sha3@~2.1.0: + version "2.1.4" + resolved "https://registry.npmjs.org/sha3/-/sha3-2.1.4.tgz#000fac0fe7c2feac1f48a25e7a31b52a6492cc8f" + integrity sha512-S8cNxbyb0UGUM2VhRD4Poe5N58gJnJsLJ5vC7FYWGUmGhcsj4++WaIOBFVDxlG0W3To6xBuiRh+i0Qp2oNCOtg== + dependencies: + buffer "6.0.3" + shallow-clone@^3.0.0: version "3.0.1" resolved "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz#8f2981ad92531f55035b01fb230769a40e02efa3" @@ -8832,6 +9550,11 @@ type-fest@^0.8.1: resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== +type-tagger@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/type-tagger/-/type-tagger-1.0.0.tgz#dc6297e52e17097c1b92b42c16816a18f631e7f4" + integrity sha512-FIPqqpmDgdaulCnRoKv1/d3U4xVBUrYn42QXWNP3XYmgfPUDuBUsgFOb9ntT0aIe0UsUP+lknpQ5d9Kn36RssA== + type@^1.0.1: version "1.2.0" resolved "https://registry.npmjs.org/type/-/type-1.2.0.tgz#848dd7698dafa3e54a6c479e759c4bc3f18847a0" @@ -8854,6 +9577,11 @@ typedarray@^0.0.6: resolved "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA== +typescript@^4.7.4: + version "4.9.4" + resolved "https://registry.npmjs.org/typescript/-/typescript-4.9.4.tgz#a2a3d2756c079abda241d75f149df9d561091e78" + integrity sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg== + typescript@^4.8.3, typescript@^4.8.4: version "4.8.4" resolved "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz#c464abca159669597be5f96b8943500b238e60e6" @@ -8931,6 +9659,11 @@ universalify@^2.0.0: resolved "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717" integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ== +unorm@^1.5.0: + version "1.6.0" + resolved "https://registry.npmjs.org/unorm/-/unorm-1.6.0.tgz#029b289661fba714f1a9af439eb51d9b16c205af" + integrity sha512-b2/KCUlYZUeA7JFUuRJZPUtr4gZvBh7tavtv4fvk4+KV9pfGiR6CQAQAWl49ZpR3ts2dk4FYkP7EIgDJoiOLDA== + upath@^2.0.1: version "2.0.1" resolved "https://registry.npmjs.org/upath/-/upath-2.0.1.tgz#50c73dea68d6f6b990f51d279ce6081665d61a8b" @@ -8975,6 +9708,11 @@ util@^0.10.3: dependencies: inherits "2.0.3" +utility-types@^3.10.0: + version "3.10.0" + resolved "https://registry.npmjs.org/utility-types/-/utility-types-3.10.0.tgz#ea4148f9a741015f05ed74fd615e1d20e6bed82b" + integrity sha512-O11mqxmi7wMKCo6HKFt5AhO4BwY3VV68YU07tgxfz8zJTIxr4BpsezN49Ffwy9j3ZpwwJp4fkRwjRzq3uWE6Rg== + uuid@^3.3.2: version "3.4.0" resolved "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee"