diff --git a/__fixtures__/chain1/osmosis/epochs/genesis.proto b/__fixtures__/chain1/osmosis/epochs/genesis.proto index cc9d579394..4b1873ffbd 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/v7/x/epochs/types"; +option go_package = "github.com/osmosis-labs/osmosis/v9/x/epochs/types"; message EpochInfo { string identifier = 1; diff --git a/__fixtures__/chain1/osmosis/epochs/query.proto b/__fixtures__/chain1/osmosis/epochs/query.proto index 0e4776a526..8119bb609a 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/v7/x/epochs/types"; +option go_package = "github.com/osmosis-labs/osmosis/v9/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 f1a92e3f00..0406960025 100644 --- a/__fixtures__/chain1/osmosis/gamm/pool-models/balancer/balancerPool.proto +++ b/__fixtures__/chain1/osmosis/gamm/pool-models/balancer/balancerPool.proto @@ -1,5 +1,4 @@ syntax = "proto3"; -// this is a temporary package setup, needs migration logic package osmosis.gamm.v1beta1; import "cosmos_proto/cosmos.proto"; @@ -11,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/v7/x/gamm/pool-models/balancer"; +option go_package = "github.com/osmosis-labs/osmosis/v9/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.proto b/__fixtures__/chain1/osmosis/gamm/pool-models/balancer/tx.proto index 838e2483ba..4a6a34c8e7 100644 --- a/__fixtures__/chain1/osmosis/gamm/pool-models/balancer/tx.proto +++ b/__fixtures__/chain1/osmosis/gamm/pool-models/balancer/tx.proto @@ -1,12 +1,12 @@ syntax = "proto3"; -package osmosis.gamm.v1beta1; +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/v7/x/gamm/pool-models/balancer"; +option go_package = "github.com/osmosis-labs/osmosis/v9/x/gamm/pool-models/balancer"; -service BalancerMsg { +service Msg { rpc CreateBalancerPool(MsgCreateBalancerPool) returns (MsgCreateBalancerPoolResponse); } @@ -15,7 +15,8 @@ service BalancerMsg { message MsgCreateBalancerPool { string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; - PoolParams poolParams = 2 [ (gogoproto.moretags) = "yaml:\"pool_params\"" ]; + osmosis.gamm.v1beta1.PoolParams poolParams = 2 + [ (gogoproto.moretags) = "yaml:\"pool_params\"" ]; repeated osmosis.gamm.v1beta1.PoolAsset poolAssets = 3 [ (gogoproto.nullable) = false ]; diff --git a/__fixtures__/chain1/osmosis/gamm/pool-models/stableswap/stableswap_pool.proto b/__fixtures__/chain1/osmosis/gamm/pool-models/stableswap/stableswap_pool.proto new file mode 100644 index 0000000000..828b58fcd3 --- /dev/null +++ b/__fixtures__/chain1/osmosis/gamm/pool-models/stableswap/stableswap_pool.proto @@ -0,0 +1,74 @@ +syntax = "proto3"; +package osmosis.gamm.poolmodels.stableswap.v1beta1; + +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; + +import "google/protobuf/duration.proto"; +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/v9/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 +// governance. Instead they will be managed by the token holders of the pool. +// The pool's token holders are specified in future_pool_governor. +message PoolParams { + string swapFee = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.moretags) = "yaml:\"swap_fee\"", + (gogoproto.nullable) = false + ]; + string exitFee = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.moretags) = "yaml:\"exit_fee\"", + (gogoproto.nullable) = false + ]; +} + +// Pool is the stableswap Pool struct +message Pool { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + option (cosmos_proto.implements_interface) = "PoolI"; + + string address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ]; + uint64 id = 2; + + PoolParams poolParams = 3 [ + (gogoproto.moretags) = "yaml:\"stableswap_pool_params\"", + (gogoproto.nullable) = false + ]; + + // 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. + string future_pool_governor = 4 + [ (gogoproto.moretags) = "yaml:\"future_pool_governor\"" ]; + // sum of all LP shares + cosmos.base.v1beta1.Coin totalShares = 5 [ + (gogoproto.moretags) = "yaml:\"total_shares\"", + (gogoproto.nullable) = false + ]; + // assets in the pool + repeated cosmos.base.v1beta1.Coin poolLiquidity = 6 [ + (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\"", + (gogoproto.nullable) = false + ]; + // scaling_factor_governor is the address can adjust pool scaling factors + string scaling_factor_governor = 8 + [ (gogoproto.moretags) = "yaml:\"scaling_factor_governor\"" ]; +} diff --git a/__fixtures__/chain1/osmosis/gamm/pool-models/stableswap/tx.proto b/__fixtures__/chain1/osmosis/gamm/pool-models/stableswap/tx.proto new file mode 100644 index 0000000000..b173cba7d4 --- /dev/null +++ b/__fixtures__/chain1/osmosis/gamm/pool-models/stableswap/tx.proto @@ -0,0 +1,47 @@ +syntax = "proto3"; +package osmosis.gamm.poolmodels.stableswap.v1beta1; + +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/v9/x/gamm/pool-models/stableswap"; + +service Msg { + rpc CreateStableswapPool(MsgCreateStableswapPool) + returns (MsgCreateStableswapPoolResponse); + rpc StableSwapAdjustScalingFactors(MsgStableSwapAdjustScalingFactors) + returns (MsgStableSwapAdjustScalingFactorsResponse); +} + +message MsgCreateStableswapPool { + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + + PoolParams poolParams = 2 [ (gogoproto.moretags) = "yaml:\"pool_params\"" ]; + + repeated cosmos.base.v1beta1.Coin initial_pool_liquidity = 3 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + + string future_pool_governor = 4 + [ (gogoproto.moretags) = "yaml:\"future_pool_governor\"" ]; +} + +message MsgCreateStableswapPoolResponse { + uint64 pool_id = 1 [ (gogoproto.customname) = "PoolID" ]; +} + +message MsgStableSwapAdjustScalingFactors { + // Sender must be the pool's scaling_factor_governor in order for the tx to + // succeed + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + uint64 pool_id = 2 [ (gogoproto.customname) = "PoolID" ]; + + repeated uint64 scaling_factors = 3 [ + (gogoproto.moretags) = "yaml:\"stableswap_scaling_factor\"", + (gogoproto.nullable) = false + ]; +} + +message MsgStableSwapAdjustScalingFactorsResponse {} diff --git a/__fixtures__/chain1/osmosis/gamm/v1beta1/genesis.proto b/__fixtures__/chain1/osmosis/gamm/v1beta1/genesis.proto index 4ef5340b1b..1a2a8d7bb0 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/v7/x/gamm/types"; +option go_package = "github.com/osmosis-labs/osmosis/v9/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 96d6cf968d..c101ec16ba 100644 --- a/__fixtures__/chain1/osmosis/gamm/v1beta1/query.proto +++ b/__fixtures__/chain1/osmosis/gamm/v1beta1/query.proto @@ -10,15 +10,17 @@ import "google/api/annotations.proto"; import "google/protobuf/any.proto"; import "cosmos_proto/cosmos.proto"; -option go_package = "github.com/osmosis-labs/osmosis/v7/x/gamm/types"; +option go_package = "github.com/osmosis-labs/osmosis/v9/x/gamm/types"; service Query { rpc Pools(QueryPoolsRequest) returns (QueryPoolsResponse) { option (google.api.http).get = "/osmosis/gamm/v1beta1/pools"; } + rpc NumPools(QueryNumPoolsRequest) returns (QueryNumPoolsResponse) { option (google.api.http).get = "/osmosis/gamm/v1beta1/num_pools"; } + rpc TotalLiquidity(QueryTotalLiquidityRequest) returns (QueryTotalLiquidityResponse) { option (google.api.http).get = "/osmosis/gamm/v1beta1/total_liquidity"; @@ -28,6 +30,7 @@ service Query { rpc Pool(QueryPoolRequest) returns (QueryPoolResponse) { option (google.api.http).get = "/osmosis/gamm/v1beta1/pools/{poolId}"; } + rpc PoolParams(QueryPoolParamsRequest) returns (QueryPoolParamsResponse) { option (google.api.http).get = "/osmosis/gamm/v1beta1/pools/{poolId}/params"; @@ -44,6 +47,8 @@ service Query { "/osmosis/gamm/v1beta1/pools/{poolId}/total_shares"; } + // 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/v1beta1/pools/{poolId}/prices"; @@ -55,6 +60,7 @@ service Query { option (google.api.http).get = "/osmosis/gamm/v1beta1/{poolId}/estimate/swap_exact_amount_in"; } + rpc EstimateSwapExactAmountOut(QuerySwapExactAmountOutRequest) returns (QuerySwapExactAmountOutResponse) { option (google.api.http).get = @@ -119,15 +125,20 @@ message QueryTotalSharesResponse { ]; } -//=============================== SpotPrice +// QuerySpotPriceRequest defines the gRPC request structure for a SpotPrice +// query. message QuerySpotPriceRequest { uint64 poolId = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; - string tokenInDenom = 2 [ (gogoproto.moretags) = "yaml:\"token_in_denom\"" ]; - string tokenOutDenom = 3 - [ (gogoproto.moretags) = "yaml:\"token_out_denom\"" ]; + string base_asset_denom = 2 + [ (gogoproto.moretags) = "yaml:\"base_asset_denom\"" ]; + string quote_asset_denom = 3 + [ (gogoproto.moretags) = "yaml:\"quote_asset_denom\"" ]; reserved 4; reserved "withSwapFee"; } + +// QuerySpotPriceResponse defines the gRPC response structure for a SpotPrice +// query. message QuerySpotPriceResponse { // String of the Dec. Ex) 10.203uatom string spotPrice = 1 [ (gogoproto.moretags) = "yaml:\"spot_price\"" ]; diff --git a/__fixtures__/chain1/osmosis/gamm/v1beta1/tx.proto b/__fixtures__/chain1/osmosis/gamm/v1beta1/tx.proto index 42a5a14e00..f0f9c0da97 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/v7/x/gamm/types"; +option go_package = "github.com/osmosis-labs/osmosis/v9/x/gamm/types"; service Msg { rpc JoinPool(MsgJoinPool) returns (MsgJoinPoolResponse); @@ -125,8 +125,6 @@ message MsgJoinSwapExternAmountIn { (gogoproto.moretags) = "yaml:\"token_in\"", (gogoproto.nullable) = false ]; - // reserved 3; - // reserved "token_in"; string shareOutMinAmount = 4 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.moretags) = "yaml:\"share_out_min_amount\"", diff --git a/__fixtures__/chain1/osmosis/incentives/gauge.proto b/__fixtures__/chain1/osmosis/incentives/gauge.proto index 87c80cde50..8011d489c5 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/v7/x/incentives/types"; +option go_package = "github.com/osmosis-labs/osmosis/v9/x/incentives/types"; message Gauge { // unique ID of a Gauge diff --git a/__fixtures__/chain1/osmosis/incentives/genesis.proto b/__fixtures__/chain1/osmosis/incentives/genesis.proto index b1abf386a6..9ede8b6519 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/v7/x/incentives/types"; +option go_package = "github.com/osmosis-labs/osmosis/v9/x/incentives/types"; // GenesisState defines the incentives module's genesis state. message GenesisState { diff --git a/__fixtures__/chain1/osmosis/incentives/params.proto b/__fixtures__/chain1/osmosis/incentives/params.proto index 47709619aa..f66df11066 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/v7/x/incentives/types"; +option go_package = "github.com/osmosis-labs/osmosis/v9/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 fbad2c8f1c..aa98394712 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/v7/x/incentives/types"; +option go_package = "github.com/osmosis-labs/osmosis/v9/x/incentives/types"; // Query defines the gRPC querier service. service Query { @@ -39,6 +39,7 @@ service Query { rpc ActiveGauges(ActiveGaugesRequest) returns (ActiveGaugesResponse) { option (google.api.http).get = "/osmosis/incentives/v1beta1/active_gauges"; } + // returns active gauges per denom rpc ActiveGaugesPerDenom(ActiveGaugesPerDenomRequest) returns (ActiveGaugesPerDenomResponse) { option (google.api.http).get = @@ -49,6 +50,13 @@ service Query { option (google.api.http).get = "/osmosis/incentives/v1beta1/upcoming_gauges"; } + // returns scheduled gauges per denom + rpc UpcomingGaugesPerDenom(UpcomingGaugesPerDenomRequest) + returns (UpcomingGaugesPerDenomResponse) { + option (google.api.http).get = + "/osmosis/incentives/v1beta1/upcoming_gauges_per_denom"; + } + // RewardsEst returns an estimate of the rewards at a future specific time. // The querier either provides an address or a set of locks // for which they want to find the associated rewards. @@ -124,6 +132,16 @@ message UpcomingGaugesResponse { cosmos.base.query.v1beta1.PageResponse pagination = 2; } +message UpcomingGaugesPerDenomRequest { + string denom = 1; + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +message UpcomingGaugesPerDenomResponse { + repeated Gauge upcoming_gauges = 1 [ (gogoproto.nullable) = false ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + message RewardsEstRequest { string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ]; repeated uint64 lock_ids = 2; diff --git a/__fixtures__/chain1/osmosis/incentives/tx.proto b/__fixtures__/chain1/osmosis/incentives/tx.proto index 06c76fc942..e6304a7501 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/v7/x/incentives/types"; +option go_package = "github.com/osmosis-labs/osmosis/v9/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 52f498084b..f440ddfd1f 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/v7/x/lockup/types"; +option go_package = "github.com/osmosis-labs/osmosis/v9/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 16dcbabe4f..1de0381b95 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/v7/x/lockup/types"; +option go_package = "github.com/osmosis-labs/osmosis/v9/x/lockup/types"; // PeriodLock is a single unit of lock by period. It's a record of locked coin // at a specific time. It stores owner, duration, unlock time and the amount of diff --git a/__fixtures__/chain1/osmosis/lockup/query.proto b/__fixtures__/chain1/osmosis/lockup/query.proto index 3ce98239b4..5ebe8266a4 100644 --- a/__fixtures__/chain1/osmosis/lockup/query.proto +++ b/__fixtures__/chain1/osmosis/lockup/query.proto @@ -8,7 +8,7 @@ import "google/protobuf/timestamp.proto"; import "google/protobuf/duration.proto"; import "osmosis/lockup/lock.proto"; -option go_package = "github.com/osmosis-labs/osmosis/v7/x/lockup/types"; +option go_package = "github.com/osmosis-labs/osmosis/v9/x/lockup/types"; // Query defines the gRPC querier service. service Query { @@ -95,6 +95,14 @@ service Query { option (google.api.http).get = "/osmosis/lockup/v1beta1/account_locked_longer_duration/{owner}"; } + + // Returns account locked records with a specific duration + rpc AccountLockedDuration(AccountLockedDurationRequest) + returns (AccountLockedDurationResponse) { + option (google.api.http).get = + "/osmosis/lockup/v1beta1/account_locked_duration/{owner}"; + } + // Returns account locked records with longer duration excluding tokens // started unlocking rpc AccountLockedLongerDurationNotUnlockingOnly( @@ -243,6 +251,18 @@ message AccountLockedLongerDurationResponse { repeated PeriodLock locks = 1 [ (gogoproto.nullable) = false ]; }; +message AccountLockedDurationRequest { + string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ]; + google.protobuf.Duration duration = 2 [ + (gogoproto.stdduration) = true, + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"duration\"" + ]; +}; +message AccountLockedDurationResponse { + repeated PeriodLock locks = 1 [ (gogoproto.nullable) = false ]; +}; + message AccountLockedLongerDurationNotUnlockingOnlyRequest { string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ]; google.protobuf.Duration duration = 2 [ diff --git a/__fixtures__/chain1/osmosis/lockup/tx.proto b/__fixtures__/chain1/osmosis/lockup/tx.proto index 5746ed5eda..5c83c64508 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/v7/x/lockup/types"; +option go_package = "github.com/osmosis-labs/osmosis/v9/x/lockup/types"; // Msg defines the Msg service. service Msg { @@ -17,6 +17,8 @@ service Msg { returns (MsgBeginUnlockingAllResponse); // MsgBeginUnlocking begins unlocking tokens by lock ID rpc BeginUnlocking(MsgBeginUnlocking) returns (MsgBeginUnlockingResponse); + // MsgEditLockup edits the existing lockups by lock ID + rpc ExtendLockup(MsgExtendLockup) returns (MsgExtendLockupResponse); } message MsgLockTokens { @@ -49,3 +51,23 @@ message MsgBeginUnlocking { ]; } message MsgBeginUnlockingResponse { bool success = 1; } + +// MsgExtendLockup extends the existing lockup's duration. +// The new duration is longer than the original. +message MsgExtendLockup { + string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ]; + uint64 ID = 2; + + // duration to be set. fails if lower than the current duration, or is + // unlocking + google.protobuf.Duration duration = 3 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.jsontag) = "duration,omitempty", + (gogoproto.moretags) = "yaml:\"duration\"" + ]; + + // extend for other edit, e.g. cancel unlocking +} + +message MsgExtendLockupResponse { bool success = 1; } diff --git a/__fixtures__/chain1/osmosis/mint/v1beta1/genesis.proto b/__fixtures__/chain1/osmosis/mint/v1beta1/genesis.proto index 3a9112b639..f5dadb0c4b 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/v7/x/mint/types"; +option go_package = "github.com/osmosis-labs/osmosis/v9/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 95490b849a..933210f7f3 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/v7/x/mint/types"; +option go_package = "github.com/osmosis-labs/osmosis/v9/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 83c55a5e0a..28e3d6fa08 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/v7/x/mint/types"; +option go_package = "github.com/osmosis-labs/osmosis/v9/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 6b4f4ba24c..c828ce02a7 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/v7/x/pool-incentives/types"; +option go_package = "github.com/osmosis-labs/osmosis/v9/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 d7c9c4c7f7..4a17882525 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/v7/x/pool-incentives/types"; +option go_package = "github.com/osmosis-labs/osmosis/v9/x/pool-incentives/types"; // ReplacePoolIncentivesProposal is a gov Content type for updating the pool // incentives. If a ReplacePoolIncentivesProposal passes, the proposal’s records diff --git a/__fixtures__/chain1/osmosis/pool-incentives/v1beta1/incentives.proto b/__fixtures__/chain1/osmosis/pool-incentives/v1beta1/incentives.proto index cb4ab408c2..3ac1f36e5f 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/v7/x/pool-incentives/types"; +option go_package = "github.com/osmosis-labs/osmosis/v9/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 0af0a636e1..b7c7e00739 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/v7/x/pool-incentives/types"; +option go_package = "github.com/osmosis-labs/osmosis/v9/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/store/v1beta1/tree.proto b/__fixtures__/chain1/osmosis/store/v1beta1/tree.proto index 85ef7f2506..83cfd8ee05 100644 --- a/__fixtures__/chain1/osmosis/store/v1beta1/tree.proto +++ b/__fixtures__/chain1/osmosis/store/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/v7/store"; +option go_package = "github.com/osmosis-labs/osmosis/v9/store"; message Node { repeated Child children = 1; } diff --git a/__fixtures__/chain1/osmosis/superfluid/genesis.proto b/__fixtures__/chain1/osmosis/superfluid/genesis.proto index e195858d8c..ed47ac5eaa 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/v7/x/superfluid/types"; +option go_package = "github.com/osmosis-labs/osmosis/v9/x/superfluid/types"; // GenesisState defines the module's genesis state. message GenesisState { diff --git a/__fixtures__/chain1/osmosis/superfluid/gov.proto b/__fixtures__/chain1/osmosis/superfluid/gov.proto index 2ad153d144..6f9e13b3cd 100644 --- a/__fixtures__/chain1/osmosis/superfluid/gov.proto +++ b/__fixtures__/chain1/osmosis/superfluid/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/v7/x/superfluid/types"; +option go_package = "github.com/osmosis-labs/osmosis/v9/x/superfluid/types"; // SetSuperfluidAssetsProposal is a gov Content type to update the superfluid // assets diff --git a/__fixtures__/chain1/osmosis/superfluid/params.proto b/__fixtures__/chain1/osmosis/superfluid/params.proto index 79e43a9c46..30a4edef60 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/v7/x/superfluid/types"; +option go_package = "github.com/osmosis-labs/osmosis/v9/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 eb0e510a88..4e0baba7d1 100644 --- a/__fixtures__/chain1/osmosis/superfluid/query.proto +++ b/__fixtures__/chain1/osmosis/superfluid/query.proto @@ -11,7 +11,7 @@ import "osmosis/superfluid/params.proto"; import "osmosis/lockup/lock.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; -option go_package = "github.com/osmosis-labs/osmosis/v7/x/superfluid/types"; +option go_package = "github.com/osmosis-labs/osmosis/v9/x/superfluid/types"; // Query defines the gRPC querier service. service Query { @@ -187,6 +187,10 @@ message SuperfluidDelegationsByDelegatorResponse { (gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" ]; + cosmos.base.v1beta1.Coin total_equivalent_staked_amount = 3 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin" + ]; } message SuperfluidUndelegationsByDelegatorRequest { diff --git a/__fixtures__/chain1/osmosis/superfluid/superfluid.proto b/__fixtures__/chain1/osmosis/superfluid/superfluid.proto index 2c3e83e9d0..805daa678a 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/v7/x/superfluid/types"; +option go_package = "github.com/osmosis-labs/osmosis/v9/x/superfluid/types"; enum SuperfluidAssetType { option (gogoproto.goproto_enum_prefix) = false; @@ -61,9 +61,13 @@ message SuperfluidDelegationRecord { (gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin" ]; + cosmos.base.v1beta1.Coin equivalent_staked_amount = 4 + [ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin" ]; } message LockIdIntermediaryAccountConnection { uint64 lock_id = 1; string intermediary_account = 2; } + +message UnpoolWhitelistedPools { repeated uint64 ids = 1; } diff --git a/__fixtures__/chain1/osmosis/superfluid/tx.proto b/__fixtures__/chain1/osmosis/superfluid/tx.proto index e54282ebac..6a6d66d358 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/v7/x/superfluid/types"; +option go_package = "github.com/osmosis-labs/osmosis/v9/x/superfluid/types"; // Msg defines the Msg service. service Msg { @@ -28,6 +28,8 @@ service Msg { // Execute lockup lock and superfluid delegation in a single msg rpc LockAndSuperfluidDelegate(MsgLockAndSuperfluidDelegate) returns (MsgLockAndSuperfluidDelegateResponse); + rpc UnPoolWhitelistedPool(MsgUnPoolWhitelistedPool) + returns (MsgUnPoolWhitelistedPoolResponse); } message MsgSuperfluidDelegate { @@ -67,4 +69,19 @@ message MsgLockAndSuperfluidDelegate { ]; string val_addr = 3; } -message MsgLockAndSuperfluidDelegateResponse { uint64 ID = 1; } \ No newline at end of file +message MsgLockAndSuperfluidDelegateResponse { uint64 ID = 1; } + +// MsgUnPoolWhitelistedPool Unpools every lock the sender has, that is +// associated with pool pool_id. If pool_id is not approved for unpooling by +// governance, this is a no-op. Unpooling takes the locked gamm shares, and runs +// "ExitPool" on it, to get the constituent tokens. e.g. z gamm/pool/1 tokens +// ExitPools into constituent tokens x uatom, y uosmo. Then it creates a new +// lock for every constituent token, with the duration associated with the lock. +// If the lock was unbonding, the new lockup durations should be the time left +// until unbond completion. +message MsgUnPoolWhitelistedPool { + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + uint64 pool_id = 2 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; +} + +message MsgUnPoolWhitelistedPoolResponse { repeated uint64 exitedLockIds = 1; } diff --git a/__fixtures__/chain1/osmosis/tokenfactory/v1beta1/authorityMetadata.proto b/__fixtures__/chain1/osmosis/tokenfactory/v1beta1/authorityMetadata.proto new file mode 100644 index 0000000000..b36b1da62c --- /dev/null +++ b/__fixtures__/chain1/osmosis/tokenfactory/v1beta1/authorityMetadata.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; +package osmosis.tokenfactory.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v9/x/tokenfactory/types"; + +// DenomAuthorityMetadata specifies metadata for addresses that have specific +// capabilities over a token factory denom. Right now there is only one Admin +// permission, but is planned to be extended to the future. +message DenomAuthorityMetadata { + option (gogoproto.equal) = true; + + // Can be empty for no admin, or a valid osmosis address + string Admin = 1 [ (gogoproto.moretags) = "yaml:\"admin\"" ]; +} diff --git a/__fixtures__/chain1/osmosis/tokenfactory/v1beta1/genesis.proto b/__fixtures__/chain1/osmosis/tokenfactory/v1beta1/genesis.proto new file mode 100644 index 0000000000..59a0f04838 --- /dev/null +++ b/__fixtures__/chain1/osmosis/tokenfactory/v1beta1/genesis.proto @@ -0,0 +1,29 @@ +syntax = "proto3"; +package osmosis.tokenfactory.v1beta1; + +import "gogoproto/gogo.proto"; +import "osmosis/tokenfactory/v1beta1/authorityMetadata.proto"; +import "osmosis/tokenfactory/v1beta1/params.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v9/x/tokenfactory/types"; + +// GenesisState defines the tokenfactory module's genesis state. +message GenesisState { + // params defines the paramaters of the module. + Params params = 1 [ (gogoproto.nullable) = false ]; + + repeated GenesisDenom factory_denoms = 2 [ + (gogoproto.moretags) = "yaml:\"factory_denoms\"", + (gogoproto.nullable) = false + ]; +} + +message GenesisDenom { + option (gogoproto.equal) = true; + + string denom = 1 [ (gogoproto.moretags) = "yaml:\"denom\"" ]; + DenomAuthorityMetadata authority_metadata = 2 [ + (gogoproto.moretags) = "yaml:\"authority_metadata\"", + (gogoproto.nullable) = false + ]; +} \ No newline at end of file diff --git a/__fixtures__/chain1/osmosis/tokenfactory/v1beta1/params.proto b/__fixtures__/chain1/osmosis/tokenfactory/v1beta1/params.proto new file mode 100644 index 0000000000..0723f38e06 --- /dev/null +++ b/__fixtures__/chain1/osmosis/tokenfactory/v1beta1/params.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; +package osmosis.tokenfactory.v1beta1; + +import "gogoproto/gogo.proto"; +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/v9/x/tokenfactory/types"; + +// Params holds parameters for the tokenfactory module +message Params { + repeated cosmos.base.v1beta1.Coin denom_creation_fee = 1 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.moretags) = "yaml:\"denom_creation_fee\"", + (gogoproto.nullable) = false + ]; +} diff --git a/__fixtures__/chain1/osmosis/tokenfactory/v1beta1/query.proto b/__fixtures__/chain1/osmosis/tokenfactory/v1beta1/query.proto new file mode 100644 index 0000000000..dd2ff14b9d --- /dev/null +++ b/__fixtures__/chain1/osmosis/tokenfactory/v1beta1/query.proto @@ -0,0 +1,56 @@ +syntax = "proto3"; +package osmosis.tokenfactory.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +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/v9/x/tokenfactory/types"; + +// Query defines the gRPC querier service. +service Query { + // Params returns the total set of minting parameters. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/osmosis/tokenfactory/v1beta1/params"; + } + + rpc DenomAuthorityMetadata(QueryDenomAuthorityMetadataRequest) + returns (QueryDenomAuthorityMetadataResponse) { + option (google.api.http).get = + "/osmosis/tokenfactory/v1beta1/denoms/{denom}/authority_metadata"; + } + + rpc DenomsFromCreator(QueryDenomsFromCreatorRequest) + returns (QueryDenomsFromCreatorResponse) { + option (google.api.http).get = + "/osmosis/tokenfactory/v1beta1/denoms_from_creator/{creator}"; + } +} + +// 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 ]; +} + +message QueryDenomAuthorityMetadataRequest { + string denom = 1 [ (gogoproto.moretags) = "yaml:\"denom\"" ]; +} +message QueryDenomAuthorityMetadataResponse { + DenomAuthorityMetadata authority_metadata = 1 [ + (gogoproto.moretags) = "yaml:\"authority_metadata\"", + (gogoproto.nullable) = false + ]; +} + +message QueryDenomsFromCreatorRequest { + string creator = 1 [ (gogoproto.moretags) = "yaml:\"creator\"" ]; +} +message QueryDenomsFromCreatorResponse { + repeated string denoms = 1 [ (gogoproto.moretags) = "yaml:\"denoms\"" ]; +} diff --git a/__fixtures__/chain1/osmosis/tokenfactory/v1beta1/tx.proto b/__fixtures__/chain1/osmosis/tokenfactory/v1beta1/tx.proto new file mode 100644 index 0000000000..bb57f9ede0 --- /dev/null +++ b/__fixtures__/chain1/osmosis/tokenfactory/v1beta1/tx.proto @@ -0,0 +1,87 @@ +syntax = "proto3"; +package osmosis.tokenfactory.v1beta1; + +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/osmosis-labs/osmosis/v9/x/tokenfactory/types"; + +// Msg defines the Msg service. +service Msg { + rpc CreateDenom(MsgCreateDenom) returns (MsgCreateDenomResponse); + rpc Mint(MsgMint) returns (MsgMintResponse); + rpc Burn(MsgBurn) returns (MsgBurnResponse); + // ForceTransfer is deactivated for now because we need to think through edge + // cases rpc ForceTransfer(MsgForceTransfer) returns + // (MsgForceTransferResponse); + rpc ChangeAdmin(MsgChangeAdmin) returns (MsgChangeAdminResponse); +} + +// MsgCreateDenom is the sdk.Msg type for allowing an account to create +// a new denom. It requires a sender address and a subdenomination. +// The (sender_address, sub_denomination) pair must be unique and cannot be +// re-used. The resulting denom created is `factory/{creator +// address}/{subdenom}`. The resultant denom's admin is originally set to be the +// creator, but this can be changed later. The token denom does not indicate the +// current admin. +message MsgCreateDenom { + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + // subdenom can be up to 44 "alphanumeric" characters long. + string subdenom = 2 [ (gogoproto.moretags) = "yaml:\"subdenom\"" ]; +} + +// MsgCreateDenomResponse is the return value of MsgCreateDenom +// It returns the full string of the newly created denom +message MsgCreateDenomResponse { + string new_token_denom = 1 + [ (gogoproto.moretags) = "yaml:\"new_token_denom\"" ]; +} + +// MsgMint is the sdk.Msg type for allowing an admin account to mint +// more of a token. For now, we only support minting to the sender account +message MsgMint { + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + cosmos.base.v1beta1.Coin amount = 2 [ + (gogoproto.moretags) = "yaml:\"amount\"", + (gogoproto.nullable) = false + ]; +} + +message MsgMintResponse {} + +// MsgBurn is the sdk.Msg type for allowing an admin account to burn +// a token. For now, we only support burning from the sender account. +message MsgBurn { + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + cosmos.base.v1beta1.Coin amount = 2 [ + (gogoproto.moretags) = "yaml:\"amount\"", + (gogoproto.nullable) = false + ]; +} + +message MsgBurnResponse {} + +// // ===================== MsgForceTransfer +// message MsgForceTransfer { +// string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; +// cosmos.base.v1beta1.Coin amount = 2 [ +// (gogoproto.moretags) = "yaml:\"amount\"", +// (gogoproto.nullable) = false +// ]; +// string transferFromAddress = 3 +// [ (gogoproto.moretags) = "yaml:\"transfer_from_address\"" ]; +// string transferToAddress = 4 +// [ (gogoproto.moretags) = "yaml:\"transfer_to_address\"" ]; +// } + +// message MsgForceTransferResponse {} + +// MsgChangeAdmin is the sdk.Msg type for allowing an admin account to reassign +// adminship of a denom to a new account +message MsgChangeAdmin { + string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ]; + string denom = 2 [ (gogoproto.moretags) = "yaml:\"denom\"" ]; + string newAdmin = 3 [ (gogoproto.moretags) = "yaml:\"new_admin\"" ]; +} + +message MsgChangeAdminResponse {} \ No newline at end of file diff --git a/__fixtures__/chain1/osmosis/txfees/v1beta1/feetoken.proto b/__fixtures__/chain1/osmosis/txfees/v1beta1/feetoken.proto index c7cd36e34e..ec6a5e9e38 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/v7/x/txfees/types"; +option go_package = "github.com/osmosis-labs/osmosis/v9/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 9b6fb48c4e..4c54baf744 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/v7/x/txfees/types"; +option go_package = "github.com/osmosis-labs/osmosis/v9/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 253e822d61..742117ba7b 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/v7/x/txfees/types"; +option go_package = "github.com/osmosis-labs/osmosis/v9/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 diff --git a/__fixtures__/chain1/osmosis/txfees/v1beta1/query.proto b/__fixtures__/chain1/osmosis/txfees/v1beta1/query.proto index 4bab62c70a..fdee3682bb 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/v7/x/txfees/types"; +option go_package = "github.com/osmosis-labs/osmosis/v9/x/txfees/types"; service Query { // FeeTokens returns a list of all the whitelisted fee tokens and their @@ -17,6 +17,12 @@ service Query { option (google.api.http).get = "/osmosis/txfees/v1beta1/fee_tokens"; } + rpc DenomSpotPrice(QueryDenomSpotPriceRequest) + returns (QueryDenomSpotPriceResponse) { + option (google.api.http).get = + "/osmosis/txfees/v1beta1/spot_price_by_denom"; + } + rpc DenomPoolId(QueryDenomPoolIdRequest) returns (QueryDenomPoolIdResponse) { option (google.api.http).get = "/osmosis/txfees/v1beta1/denom_pool_id/{denom}"; @@ -29,13 +35,29 @@ service Query { message QueryFeeTokensRequest {} message QueryFeeTokensResponse { - repeated FeeToken fee_tokens = 1 [ (gogoproto.moretags) = "yaml:\"fee_tokens\"", (gogoproto.nullable) = false ]; } +// QueryDenomSpotPriceRequest defines grpc request structure for querying spot +// price for the specified tx fee denom +message QueryDenomSpotPriceRequest { + string denom = 1 [ (gogoproto.moretags) = "yaml:\"denom\"" ]; +} + +// QueryDenomSpotPriceRequest defines grpc response structure for querying spot +// price for the specified tx fee denom +message QueryDenomSpotPriceResponse { + uint64 poolID = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; + string spot_price = 2 [ + (gogoproto.moretags) = "yaml:\"spot_price\"", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; +} + message QueryDenomPoolIdRequest { string denom = 1 [ (gogoproto.moretags) = "yaml:\"denom\"" ]; } diff --git a/__fixtures__/output1/akash/bundle.ts b/__fixtures__/output1/akash/bundle.ts index 13251ecc38..71f064417e 100644 --- a/__fixtures__/output1/akash/bundle.ts +++ b/__fixtures__/output1/akash/bundle.ts @@ -51,42 +51,42 @@ 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 _312 from "./audit/v1beta1/audit.amino"; -import * as _313 from "./audit/v1beta2/audit.amino"; -import * as _314 from "./cert/v1beta2/cert.amino"; -import * as _315 from "./deployment/v1beta1/deployment.amino"; -import * as _316 from "./deployment/v1beta2/service.amino"; -import * as _317 from "./market/v1beta2/service.amino"; -import * as _318 from "./provider/v1beta1/provider.amino"; -import * as _319 from "./provider/v1beta2/provider.amino"; -import * as _320 from "./audit/v1beta1/audit.registry"; -import * as _321 from "./audit/v1beta2/audit.registry"; -import * as _322 from "./cert/v1beta2/cert.registry"; -import * as _323 from "./deployment/v1beta1/deployment.registry"; -import * as _324 from "./deployment/v1beta2/service.registry"; -import * as _325 from "./market/v1beta2/service.registry"; -import * as _326 from "./provider/v1beta1/provider.registry"; -import * as _327 from "./provider/v1beta2/provider.registry"; -import * as _328 from "./audit/v1beta2/query.lcd"; -import * as _329 from "./cert/v1beta2/query.lcd"; -import * as _330 from "./deployment/v1beta1/query.lcd"; -import * as _331 from "./deployment/v1beta2/query.lcd"; -import * as _332 from "./escrow/v1beta1/query.lcd"; -import * as _333 from "./escrow/v1beta2/query.lcd"; -import * as _334 from "./market/v1beta2/query.lcd"; -import * as _335 from "./provider/v1beta2/query.lcd"; +import * as _319 from "./audit/v1beta1/audit.amino"; +import * as _320 from "./audit/v1beta2/audit.amino"; +import * as _321 from "./cert/v1beta2/cert.amino"; +import * as _322 from "./deployment/v1beta1/deployment.amino"; +import * as _323 from "./deployment/v1beta2/service.amino"; +import * as _324 from "./market/v1beta2/service.amino"; +import * as _325 from "./provider/v1beta1/provider.amino"; +import * as _326 from "./provider/v1beta2/provider.amino"; +import * as _327 from "./audit/v1beta1/audit.registry"; +import * as _328 from "./audit/v1beta2/audit.registry"; +import * as _329 from "./cert/v1beta2/cert.registry"; +import * as _330 from "./deployment/v1beta1/deployment.registry"; +import * as _331 from "./deployment/v1beta2/service.registry"; +import * as _332 from "./market/v1beta2/service.registry"; +import * as _333 from "./provider/v1beta1/provider.registry"; +import * as _334 from "./provider/v1beta2/provider.registry"; +import * as _335 from "./audit/v1beta2/query.lcd"; +import * as _336 from "./cert/v1beta2/query.lcd"; +import * as _337 from "./deployment/v1beta1/query.lcd"; +import * as _338 from "./deployment/v1beta2/query.lcd"; +import * as _339 from "./escrow/v1beta1/query.lcd"; +import * as _340 from "./escrow/v1beta2/query.lcd"; +import * as _341 from "./market/v1beta2/query.lcd"; +import * as _342 from "./provider/v1beta2/query.lcd"; export namespace akash { export namespace audit { export const v1beta1 = { ..._0, - ..._312, - ..._320 + ..._319, + ..._327 }; export const v1beta2 = { ..._1, ..._2, ..._3, - ..._313, - ..._321, - ..._328 + ..._320, + ..._328, + ..._335 }; } export namespace base { @@ -106,9 +106,9 @@ export namespace akash { export const v1beta2 = { ..._13, ..._14, ..._15, - ..._314, - ..._322, - ..._329 + ..._321, + ..._329, + ..._336 }; } export namespace deployment { @@ -118,9 +118,9 @@ export namespace akash { ..._19, ..._20, ..._21, - ..._315, - ..._323, - ..._330 + ..._322, + ..._330, + ..._337 }; export const v1beta2 = { ..._22, ..._23, @@ -134,21 +134,21 @@ export namespace akash { ..._31, ..._32, ..._33, - ..._316, - ..._324, - ..._331 + ..._323, + ..._331, + ..._338 }; } export namespace escrow { export const v1beta1 = { ..._34, ..._35, ..._36, - ..._332 + ..._339 }; export const v1beta2 = { ..._37, ..._38, ..._39, - ..._333 + ..._340 }; } export namespace inflation { @@ -164,22 +164,22 @@ export namespace akash { ..._46, ..._47, ..._48, - ..._317, - ..._325, - ..._334 + ..._324, + ..._332, + ..._341 }; } export namespace provider { export const v1beta1 = { ..._49, - ..._318, - ..._326 + ..._325, + ..._333 }; export const v1beta2 = { ..._50, ..._51, ..._52, - ..._319, - ..._327, - ..._335 + ..._326, + ..._334, + ..._342 }; } } \ No newline at end of file diff --git a/__fixtures__/output1/cosmos/bundle.ts b/__fixtures__/output1/cosmos/bundle.ts index 87b108ace6..b6f418f042 100644 --- a/__fixtures__/output1/cosmos/bundle.ts +++ b/__fixtures__/output1/cosmos/bundle.ts @@ -91,49 +91,49 @@ import * as _144 from "./upgrade/v1beta1/tx"; import * as _145 from "./upgrade/v1beta1/upgrade"; import * as _146 from "./vesting/v1beta1/tx"; import * as _147 from "./vesting/v1beta1/vesting"; -import * as _336 from "./authz/v1beta1/tx.amino"; -import * as _337 from "./bank/v1beta1/tx.amino"; -import * as _338 from "./crisis/v1beta1/tx.amino"; -import * as _339 from "./distribution/v1beta1/tx.amino"; -import * as _340 from "./evidence/v1beta1/tx.amino"; -import * as _341 from "./feegrant/v1beta1/tx.amino"; -import * as _342 from "./gov/v1/tx.amino"; -import * as _343 from "./gov/v1beta1/tx.amino"; -import * as _344 from "./group/v1/tx.amino"; -import * as _345 from "./nft/v1beta1/tx.amino"; -import * as _346 from "./slashing/v1beta1/tx.amino"; -import * as _347 from "./staking/v1beta1/tx.amino"; -import * as _348 from "./upgrade/v1beta1/tx.amino"; -import * as _349 from "./vesting/v1beta1/tx.amino"; -import * as _350 from "./authz/v1beta1/tx.registry"; -import * as _351 from "./bank/v1beta1/tx.registry"; -import * as _352 from "./crisis/v1beta1/tx.registry"; -import * as _353 from "./distribution/v1beta1/tx.registry"; -import * as _354 from "./evidence/v1beta1/tx.registry"; -import * as _355 from "./feegrant/v1beta1/tx.registry"; -import * as _356 from "./gov/v1/tx.registry"; -import * as _357 from "./gov/v1beta1/tx.registry"; -import * as _358 from "./group/v1/tx.registry"; -import * as _359 from "./nft/v1beta1/tx.registry"; -import * as _360 from "./slashing/v1beta1/tx.registry"; -import * as _361 from "./staking/v1beta1/tx.registry"; -import * as _362 from "./upgrade/v1beta1/tx.registry"; -import * as _363 from "./vesting/v1beta1/tx.registry"; -import * as _364 from "./auth/v1beta1/query.lcd"; -import * as _365 from "./authz/v1beta1/query.lcd"; -import * as _366 from "./bank/v1beta1/query.lcd"; -import * as _367 from "./distribution/v1beta1/query.lcd"; -import * as _368 from "./evidence/v1beta1/query.lcd"; -import * as _369 from "./feegrant/v1beta1/query.lcd"; -import * as _370 from "./gov/v1/query.lcd"; -import * as _371 from "./gov/v1beta1/query.lcd"; -import * as _372 from "./group/v1/query.lcd"; -import * as _373 from "./mint/v1beta1/query.lcd"; -import * as _374 from "./nft/v1beta1/query.lcd"; -import * as _375 from "./params/v1beta1/query.lcd"; -import * as _376 from "./slashing/v1beta1/query.lcd"; -import * as _377 from "./staking/v1beta1/query.lcd"; -import * as _378 from "./upgrade/v1beta1/query.lcd"; +import * as _343 from "./authz/v1beta1/tx.amino"; +import * as _344 from "./bank/v1beta1/tx.amino"; +import * as _345 from "./crisis/v1beta1/tx.amino"; +import * as _346 from "./distribution/v1beta1/tx.amino"; +import * as _347 from "./evidence/v1beta1/tx.amino"; +import * as _348 from "./feegrant/v1beta1/tx.amino"; +import * as _349 from "./gov/v1/tx.amino"; +import * as _350 from "./gov/v1beta1/tx.amino"; +import * as _351 from "./group/v1/tx.amino"; +import * as _352 from "./nft/v1beta1/tx.amino"; +import * as _353 from "./slashing/v1beta1/tx.amino"; +import * as _354 from "./staking/v1beta1/tx.amino"; +import * as _355 from "./upgrade/v1beta1/tx.amino"; +import * as _356 from "./vesting/v1beta1/tx.amino"; +import * as _357 from "./authz/v1beta1/tx.registry"; +import * as _358 from "./bank/v1beta1/tx.registry"; +import * as _359 from "./crisis/v1beta1/tx.registry"; +import * as _360 from "./distribution/v1beta1/tx.registry"; +import * as _361 from "./evidence/v1beta1/tx.registry"; +import * as _362 from "./feegrant/v1beta1/tx.registry"; +import * as _363 from "./gov/v1/tx.registry"; +import * as _364 from "./gov/v1beta1/tx.registry"; +import * as _365 from "./group/v1/tx.registry"; +import * as _366 from "./nft/v1beta1/tx.registry"; +import * as _367 from "./slashing/v1beta1/tx.registry"; +import * as _368 from "./staking/v1beta1/tx.registry"; +import * as _369 from "./upgrade/v1beta1/tx.registry"; +import * as _370 from "./vesting/v1beta1/tx.registry"; +import * as _371 from "./auth/v1beta1/query.lcd"; +import * as _372 from "./authz/v1beta1/query.lcd"; +import * as _373 from "./bank/v1beta1/query.lcd"; +import * as _374 from "./distribution/v1beta1/query.lcd"; +import * as _375 from "./evidence/v1beta1/query.lcd"; +import * as _376 from "./feegrant/v1beta1/query.lcd"; +import * as _377 from "./gov/v1/query.lcd"; +import * as _378 from "./gov/v1beta1/query.lcd"; +import * as _379 from "./group/v1/query.lcd"; +import * as _380 from "./mint/v1beta1/query.lcd"; +import * as _381 from "./nft/v1beta1/query.lcd"; +import * as _382 from "./params/v1beta1/query.lcd"; +import * as _383 from "./slashing/v1beta1/query.lcd"; +import * as _384 from "./staking/v1beta1/query.lcd"; +import * as _385 from "./upgrade/v1beta1/query.lcd"; export namespace cosmos { export namespace app { export const v1alpha1 = { ..._55, @@ -145,7 +145,7 @@ export namespace cosmos { export const v1beta1 = { ..._58, ..._59, ..._60, - ..._364 + ..._371 }; } export namespace authz { @@ -154,9 +154,9 @@ export namespace cosmos { ..._63, ..._64, ..._65, - ..._336, - ..._350, - ..._365 + ..._343, + ..._357, + ..._372 }; } export namespace bank { @@ -165,9 +165,9 @@ export namespace cosmos { ..._68, ..._69, ..._70, - ..._337, - ..._351, - ..._366 + ..._344, + ..._358, + ..._373 }; } export namespace base { @@ -213,8 +213,8 @@ export namespace cosmos { export namespace crisis { export const v1beta1 = { ..._83, ..._84, - ..._338, - ..._352 + ..._345, + ..._359 }; } export namespace crypto { @@ -240,9 +240,9 @@ export namespace cosmos { ..._92, ..._93, ..._94, - ..._339, - ..._353, - ..._367 + ..._346, + ..._360, + ..._374 }; } export namespace evidence { @@ -250,9 +250,9 @@ export namespace cosmos { ..._96, ..._97, ..._98, - ..._340, - ..._354, - ..._368 + ..._347, + ..._361, + ..._375 }; } export namespace feegrant { @@ -260,9 +260,9 @@ export namespace cosmos { ..._100, ..._101, ..._102, - ..._341, - ..._355, - ..._369 + ..._348, + ..._362, + ..._376 }; } export namespace genutil { @@ -274,17 +274,17 @@ export namespace cosmos { ..._105, ..._106, ..._107, - ..._342, - ..._356, - ..._370 + ..._349, + ..._363, + ..._377 }; export const v1beta1 = { ..._108, ..._109, ..._110, ..._111, - ..._343, - ..._357, - ..._371 + ..._350, + ..._364, + ..._378 }; } export namespace group { @@ -293,16 +293,16 @@ export namespace cosmos { ..._114, ..._115, ..._116, - ..._344, - ..._358, - ..._372 + ..._351, + ..._365, + ..._379 }; } export namespace mint { export const v1beta1 = { ..._117, ..._118, ..._119, - ..._373 + ..._380 }; } export namespace msg { @@ -315,9 +315,9 @@ export namespace cosmos { ..._123, ..._124, ..._125, - ..._345, - ..._359, - ..._374 + ..._352, + ..._366, + ..._381 }; } export namespace orm { @@ -333,7 +333,7 @@ export namespace cosmos { export namespace params { export const v1beta1 = { ..._129, ..._130, - ..._375 + ..._382 }; } export namespace slashing { @@ -341,9 +341,9 @@ export namespace cosmos { ..._132, ..._133, ..._134, - ..._346, - ..._360, - ..._376 + ..._353, + ..._367, + ..._383 }; } export namespace staking { @@ -352,9 +352,9 @@ export namespace cosmos { ..._137, ..._138, ..._139, - ..._347, - ..._361, - ..._377 + ..._354, + ..._368, + ..._384 }; } export namespace tx { @@ -370,16 +370,16 @@ export namespace cosmos { export const v1beta1 = { ..._143, ..._144, ..._145, - ..._348, - ..._362, - ..._378 + ..._355, + ..._369, + ..._385 }; } export namespace vesting { export const v1beta1 = { ..._146, ..._147, - ..._349, - ..._363 + ..._356, + ..._370 }; } } \ No newline at end of file diff --git a/__fixtures__/output1/cosmwasm/bundle.ts b/__fixtures__/output1/cosmwasm/bundle.ts index 0d17504d27..7a3046eaeb 100644 --- a/__fixtures__/output1/cosmwasm/bundle.ts +++ b/__fixtures__/output1/cosmwasm/bundle.ts @@ -4,9 +4,9 @@ import * as _150 from "./wasm/v1/proposal"; import * as _151 from "./wasm/v1/query"; import * as _152 from "./wasm/v1/tx"; import * as _153 from "./wasm/v1/types"; -import * as _379 from "./wasm/v1/tx.amino"; -import * as _380 from "./wasm/v1/tx.registry"; -import * as _381 from "./wasm/v1/query.lcd"; +import * as _386 from "./wasm/v1/tx.amino"; +import * as _387 from "./wasm/v1/tx.registry"; +import * as _388 from "./wasm/v1/query.lcd"; export namespace cosmwasm { export namespace wasm { export const v1 = { ..._148, @@ -15,9 +15,9 @@ export namespace cosmwasm { ..._151, ..._152, ..._153, - ..._379, - ..._380, - ..._381 + ..._386, + ..._387, + ..._388 }; } } \ No newline at end of file diff --git a/__fixtures__/output1/evmos/bundle.ts b/__fixtures__/output1/evmos/bundle.ts index 318ec23909..023e2438a6 100644 --- a/__fixtures__/output1/evmos/bundle.ts +++ b/__fixtures__/output1/evmos/bundle.ts @@ -22,32 +22,32 @@ import * as _174 from "./recovery/v1/query"; import * as _175 from "./vesting/v1/query"; import * as _176 from "./vesting/v1/tx"; import * as _177 from "./vesting/v1/vesting"; -import * as _382 from "./erc20/v1/tx.amino"; -import * as _383 from "./fees/v1/tx.amino"; -import * as _384 from "./vesting/v1/tx.amino"; -import * as _385 from "./erc20/v1/tx.registry"; -import * as _386 from "./fees/v1/tx.registry"; -import * as _387 from "./vesting/v1/tx.registry"; -import * as _388 from "./claims/v1/query.lcd"; -import * as _389 from "./epochs/v1/query.lcd"; -import * as _390 from "./erc20/v1/query.lcd"; -import * as _391 from "./fees/v1/query.lcd"; -import * as _392 from "./incentives/v1/query.lcd"; -import * as _393 from "./inflation/v1/query.lcd"; -import * as _394 from "./recovery/v1/query.lcd"; -import * as _395 from "./vesting/v1/query.lcd"; +import * as _389 from "./erc20/v1/tx.amino"; +import * as _390 from "./fees/v1/tx.amino"; +import * as _391 from "./vesting/v1/tx.amino"; +import * as _392 from "./erc20/v1/tx.registry"; +import * as _393 from "./fees/v1/tx.registry"; +import * as _394 from "./vesting/v1/tx.registry"; +import * as _395 from "./claims/v1/query.lcd"; +import * as _396 from "./epochs/v1/query.lcd"; +import * as _397 from "./erc20/v1/query.lcd"; +import * as _398 from "./fees/v1/query.lcd"; +import * as _399 from "./incentives/v1/query.lcd"; +import * as _400 from "./inflation/v1/query.lcd"; +import * as _401 from "./recovery/v1/query.lcd"; +import * as _402 from "./vesting/v1/query.lcd"; export namespace evmos { export namespace claims { export const v1 = { ..._154, ..._155, ..._156, - ..._388 + ..._395 }; } export namespace epochs { export const v1 = { ..._157, ..._158, - ..._389 + ..._396 }; } export namespace erc20 { @@ -55,9 +55,9 @@ export namespace evmos { ..._160, ..._161, ..._162, - ..._382, - ..._385, - ..._390 + ..._389, + ..._392, + ..._397 }; } export namespace fees { @@ -65,38 +65,38 @@ export namespace evmos { ..._164, ..._165, ..._166, - ..._383, - ..._386, - ..._391 + ..._390, + ..._393, + ..._398 }; } export namespace incentives { export const v1 = { ..._167, ..._168, ..._169, - ..._392 + ..._399 }; } export namespace inflation { export const v1 = { ..._170, ..._171, ..._172, - ..._393 + ..._400 }; } export namespace recovery { export const v1 = { ..._173, ..._174, - ..._394 + ..._401 }; } export namespace vesting { export const v1 = { ..._175, ..._176, ..._177, - ..._384, - ..._387, - ..._395 + ..._391, + ..._394, + ..._402 }; } } \ No newline at end of file diff --git a/__fixtures__/output1/ibc/bundle.ts b/__fixtures__/output1/ibc/bundle.ts index bfa306cb39..b986d2357c 100644 --- a/__fixtures__/output1/ibc/bundle.ts +++ b/__fixtures__/output1/ibc/bundle.ts @@ -22,18 +22,18 @@ import * as _251 from "./lightclients/localhost/v1/localhost"; import * as _252 from "./lightclients/solomachine/v1/solomachine"; import * as _253 from "./lightclients/solomachine/v2/solomachine"; import * as _254 from "./lightclients/tendermint/v1/tendermint"; -import * as _396 from "./applications/transfer/v1/tx.amino"; -import * as _397 from "./core/channel/v1/tx.amino"; -import * as _398 from "./core/client/v1/tx.amino"; -import * as _399 from "./core/connection/v1/tx.amino"; -import * as _400 from "./applications/transfer/v1/tx.registry"; -import * as _401 from "./core/channel/v1/tx.registry"; -import * as _402 from "./core/client/v1/tx.registry"; -import * as _403 from "./core/connection/v1/tx.registry"; -import * as _404 from "./applications/transfer/v1/query.lcd"; -import * as _405 from "./core/channel/v1/query.lcd"; -import * as _406 from "./core/client/v1/query.lcd"; -import * as _407 from "./core/connection/v1/query.lcd"; +import * as _403 from "./applications/transfer/v1/tx.amino"; +import * as _404 from "./core/channel/v1/tx.amino"; +import * as _405 from "./core/client/v1/tx.amino"; +import * as _406 from "./core/connection/v1/tx.amino"; +import * as _407 from "./applications/transfer/v1/tx.registry"; +import * as _408 from "./core/channel/v1/tx.registry"; +import * as _409 from "./core/client/v1/tx.registry"; +import * as _410 from "./core/connection/v1/tx.registry"; +import * as _411 from "./applications/transfer/v1/query.lcd"; +import * as _412 from "./core/channel/v1/query.lcd"; +import * as _413 from "./core/client/v1/query.lcd"; +import * as _414 from "./core/connection/v1/query.lcd"; export namespace ibc { export namespace applications { export namespace transfer { @@ -41,9 +41,9 @@ export namespace ibc { ..._232, ..._233, ..._234, - ..._396, - ..._400, - ..._404 + ..._403, + ..._407, + ..._411 }; export const v2 = { ..._235 }; @@ -55,9 +55,9 @@ export namespace ibc { ..._237, ..._238, ..._239, - ..._397, - ..._401, - ..._405 + ..._404, + ..._408, + ..._412 }; } export namespace client { @@ -65,9 +65,9 @@ export namespace ibc { ..._241, ..._242, ..._243, - ..._398, - ..._402, - ..._406 + ..._405, + ..._409, + ..._413 }; } export namespace commitment { @@ -79,9 +79,9 @@ export namespace ibc { ..._246, ..._247, ..._248, - ..._399, - ..._403, - ..._407 + ..._406, + ..._410, + ..._414 }; } export namespace port { diff --git a/__fixtures__/output1/osmosis/bundle.ts b/__fixtures__/output1/osmosis/bundle.ts index 1607fa9d9d..227bffb941 100644 --- a/__fixtures__/output1/osmosis/bundle.ts +++ b/__fixtures__/output1/osmosis/bundle.ts @@ -5,66 +5,80 @@ import * as _258 from "./claim/v1beta1/query"; import * as _259 from "./epochs/genesis"; import * as _260 from "./epochs/query"; import * as _261 from "./gamm/pool-models/balancer/balancerPool"; -import * as _262 from "./gamm/pool-models/balancer/tx"; -import * as _263 from "./gamm/v1beta1/genesis"; -import * as _264 from "./gamm/v1beta1/query"; -import * as _265 from "./gamm/v1beta1/tx"; -import * as _266 from "./incentives/gauge"; -import * as _267 from "./incentives/genesis"; -import * as _268 from "./incentives/params"; -import * as _269 from "./incentives/query"; -import * as _270 from "./incentives/tx"; -import * as _271 from "./lockup/genesis"; -import * as _272 from "./lockup/lock"; -import * as _273 from "./lockup/query"; -import * as _274 from "./lockup/tx"; -import * as _275 from "./mint/v1beta1/genesis"; -import * as _276 from "./mint/v1beta1/mint"; -import * as _277 from "./mint/v1beta1/query"; -import * as _278 from "./pool-incentives/v1beta1/genesis"; -import * as _279 from "./pool-incentives/v1beta1/gov"; -import * as _280 from "./pool-incentives/v1beta1/incentives"; -import * as _281 from "./pool-incentives/v1beta1/query"; -import * as _282 from "./store/v1beta1/tree"; -import * as _283 from "./superfluid/genesis"; -import * as _284 from "./superfluid/params"; -import * as _285 from "./superfluid/query"; -import * as _286 from "./superfluid/superfluid"; -import * as _287 from "./superfluid/tx"; -import * as _288 from "./txfees/v1beta1/feetoken"; -import * as _289 from "./txfees/v1beta1/genesis"; -import * as _290 from "./txfees/v1beta1/gov"; -import * as _291 from "./txfees/v1beta1/query"; -import * as _408 from "./gamm/v1beta1/tx.amino"; -import * as _409 from "./incentives/tx.amino"; -import * as _410 from "./lockup/tx.amino"; -import * as _411 from "./superfluid/tx.amino"; -import * as _412 from "./gamm/v1beta1/tx.registry"; -import * as _413 from "./incentives/tx.registry"; -import * as _414 from "./lockup/tx.registry"; -import * as _415 from "./superfluid/tx.registry"; -import * as _416 from "./claim/v1beta1/query.lcd"; -import * as _417 from "./epochs/query.lcd"; -import * as _418 from "./gamm/v1beta1/query.lcd"; -import * as _419 from "./incentives/query.lcd"; -import * as _420 from "./lockup/query.lcd"; -import * as _421 from "./mint/v1beta1/query.lcd"; -import * as _422 from "./pool-incentives/v1beta1/query.lcd"; -import * as _423 from "./superfluid/query.lcd"; -import * as _424 from "./txfees/v1beta1/query.lcd"; +import * as _262 from "./gamm/v1beta1/genesis"; +import * as _263 from "./gamm/v1beta1/query"; +import * as _264 from "./gamm/v1beta1/tx"; +import * as _265 from "./gamm/pool-models/balancer/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 "./superfluid/genesis"; +import * as _286 from "./superfluid/params"; +import * as _287 from "./superfluid/query"; +import * as _288 from "./superfluid/superfluid"; +import * as _289 from "./superfluid/tx"; +import * as _290 from "./tokenfactory/v1beta1/authorityMetadata"; +import * as _291 from "./tokenfactory/v1beta1/genesis"; +import * as _292 from "./tokenfactory/v1beta1/params"; +import * as _293 from "./tokenfactory/v1beta1/query"; +import * as _294 from "./tokenfactory/v1beta1/tx"; +import * as _295 from "./txfees/v1beta1/feetoken"; +import * as _296 from "./txfees/v1beta1/genesis"; +import * as _297 from "./txfees/v1beta1/gov"; +import * as _298 from "./txfees/v1beta1/query"; +import * as _415 from "./gamm/pool-models/balancer/tx.amino"; +import * as _416 from "./gamm/pool-models/stableswap/tx.amino"; +import * as _417 from "./gamm/v1beta1/tx.amino"; +import * as _418 from "./incentives/tx.amino"; +import * as _419 from "./lockup/tx.amino"; +import * as _420 from "./superfluid/tx.amino"; +import * as _421 from "./tokenfactory/v1beta1/tx.amino"; +import * as _422 from "./gamm/pool-models/balancer/tx.registry"; +import * as _423 from "./gamm/pool-models/stableswap/tx.registry"; +import * as _424 from "./gamm/v1beta1/tx.registry"; +import * as _425 from "./incentives/tx.registry"; +import * as _426 from "./lockup/tx.registry"; +import * as _427 from "./superfluid/tx.registry"; +import * as _428 from "./tokenfactory/v1beta1/tx.registry"; +import * as _429 from "./claim/v1beta1/query.lcd"; +import * as _430 from "./epochs/query.lcd"; +import * as _431 from "./gamm/v1beta1/query.lcd"; +import * as _432 from "./incentives/query.lcd"; +import * as _433 from "./lockup/query.lcd"; +import * as _434 from "./mint/v1beta1/query.lcd"; +import * as _435 from "./pool-incentives/v1beta1/query.lcd"; +import * as _436 from "./superfluid/query.lcd"; +import * as _437 from "./tokenfactory/v1beta1/query.lcd"; +import * as _438 from "./txfees/v1beta1/query.lcd"; export namespace osmosis { export namespace claim { export const v1beta1 = { ..._255, ..._256, ..._257, ..._258, - ..._416 + ..._429 }; } export namespace epochs { export const v1beta1 = { ..._259, ..._260, - ..._417 + ..._430 }; } export namespace gamm { @@ -72,63 +86,88 @@ export namespace osmosis { ..._262, ..._263, ..._264, - ..._265, - ..._408, - ..._412, - ..._418 + ..._417, + ..._424, + ..._431 }; + export namespace poolmodels { + export namespace balancer { + export const v1beta1 = { ..._265, + ..._415, + ..._422 + }; + } + export namespace stableswap { + export const v1beta1 = { ..._266, + ..._267, + ..._416, + ..._423 + }; + } + } } - export const incentives = { ..._266, - ..._267, - ..._268, + export const incentives = { ..._268, ..._269, ..._270, - ..._409, - ..._413, - ..._419 - }; - export const lockup = { ..._271, + ..._271, ..._272, - ..._273, + ..._418, + ..._425, + ..._432 + }; + export const lockup = { ..._273, ..._274, - ..._410, - ..._414, - ..._420 + ..._275, + ..._276, + ..._419, + ..._426, + ..._433 }; export namespace mint { - export const v1beta1 = { ..._275, - ..._276, - ..._277, - ..._421 + export const v1beta1 = { ..._277, + ..._278, + ..._279, + ..._434 }; } export namespace poolincentives { - export const v1beta1 = { ..._278, - ..._279, - ..._280, + export const v1beta1 = { ..._280, ..._281, - ..._422 + ..._282, + ..._283, + ..._435 }; } export namespace store { - export const v1beta1 = { ..._282 + export const v1beta1 = { ..._284 }; } - export const superfluid = { ..._283, - ..._284, - ..._285, + export const superfluid = { ..._285, ..._286, ..._287, - ..._411, - ..._415, - ..._423 + ..._288, + ..._289, + ..._420, + ..._427, + ..._436 }; - export namespace txfees { - export const v1beta1 = { ..._288, - ..._289, - ..._290, + export namespace tokenfactory { + export const v1beta1 = { ..._290, ..._291, - ..._424 + ..._292, + ..._293, + ..._294, + ..._421, + ..._428, + ..._437 + }; + } + export namespace txfees { + export const v1beta1 = { ..._295, + ..._296, + ..._297, + ..._298, + ..._438 }; } } \ No newline at end of file diff --git a/__fixtures__/output1/osmosis/client.ts b/__fixtures__/output1/osmosis/client.ts index 35138bbc53..85a18960bd 100644 --- a/__fixtures__/output1/osmosis/client.ts +++ b/__fixtures__/output1/osmosis/client.ts @@ -1,13 +1,19 @@ import { OfflineSigner, GeneratedType, Registry } from "@cosmjs/proto-signing"; import { defaultRegistryTypes, AminoTypes, SigningStargateClient } from "@cosmjs/stargate"; +import * as osmosisGammPoolmodelsBalancerTxRegistry from "./gamm/pool-models/balancer/tx.registry"; +import * as osmosisGammPoolmodelsStableswapTxRegistry from "./gamm/pool-models/stableswap/tx.registry"; import * as osmosisGammV1beta1TxRegistry from "./gamm/v1beta1/tx.registry"; import * as osmosisIncentivesTxRegistry from "./incentives/tx.registry"; import * as osmosisLockupTxRegistry from "./lockup/tx.registry"; import * as osmosisSuperfluidTxRegistry from "./superfluid/tx.registry"; +import * as osmosisTokenfactoryV1beta1TxRegistry from "./tokenfactory/v1beta1/tx.registry"; +import * as osmosisGammPoolmodelsBalancerTxAmino from "./gamm/pool-models/balancer/tx.amino"; +import * as osmosisGammPoolmodelsStableswapTxAmino from "./gamm/pool-models/stableswap/tx.amino"; import * as osmosisGammV1beta1TxAmino from "./gamm/v1beta1/tx.amino"; import * as osmosisIncentivesTxAmino from "./incentives/tx.amino"; import * as osmosisLockupTxAmino from "./lockup/tx.amino"; import * as osmosisSuperfluidTxAmino from "./superfluid/tx.amino"; +import * as osmosisTokenfactoryV1beta1TxAmino from "./tokenfactory/v1beta1/tx.amino"; export const getSigningOsmosisClient = async ({ rpcEndpoint, signer, @@ -17,11 +23,14 @@ export const getSigningOsmosisClient = async ({ signer: OfflineSigner; defaultTypes?: ReadonlyArray<[string, GeneratedType]>; }) => { - const registry = new Registry([...defaultTypes, ...osmosisGammV1beta1TxRegistry.registry, ...osmosisIncentivesTxRegistry.registry, ...osmosisLockupTxRegistry.registry, ...osmosisSuperfluidTxRegistry.registry]); - const aminoTypes = new AminoTypes({ ...osmosisGammV1beta1TxAmino.AminoConverter, + const registry = new Registry([...defaultTypes, ...osmosisGammPoolmodelsBalancerTxRegistry.registry, ...osmosisGammPoolmodelsStableswapTxRegistry.registry, ...osmosisGammV1beta1TxRegistry.registry, ...osmosisIncentivesTxRegistry.registry, ...osmosisLockupTxRegistry.registry, ...osmosisSuperfluidTxRegistry.registry, ...osmosisTokenfactoryV1beta1TxRegistry.registry]); + const aminoTypes = new AminoTypes({ ...osmosisGammPoolmodelsBalancerTxAmino.AminoConverter, + ...osmosisGammPoolmodelsStableswapTxAmino.AminoConverter, + ...osmosisGammV1beta1TxAmino.AminoConverter, ...osmosisIncentivesTxAmino.AminoConverter, ...osmosisLockupTxAmino.AminoConverter, - ...osmosisSuperfluidTxAmino.AminoConverter + ...osmosisSuperfluidTxAmino.AminoConverter, + ...osmosisTokenfactoryV1beta1TxAmino.AminoConverter }); const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, signer, { registry, diff --git a/__fixtures__/output1/osmosis/gamm/pool-models/balancer/tx.amino.ts b/__fixtures__/output1/osmosis/gamm/pool-models/balancer/tx.amino.ts new file mode 100644 index 0000000000..84ae87bcb3 --- /dev/null +++ b/__fixtures__/output1/osmosis/gamm/pool-models/balancer/tx.amino.ts @@ -0,0 +1,137 @@ +import { PoolParams, PoolAsset, SmoothWeightChangeParams } from "./balancerPool"; +import { AminoMsg } from "@cosmjs/amino"; +import { Long } from "@osmonauts/helpers"; +import { Timestamp } from "../../../../google/protobuf/timestamp"; +import { Duration } from "../../../../google/protobuf/duration"; +import { Coin } from "../../../../cosmos/base/v1beta1/coin"; +import { MsgCreateBalancerPool } from "./tx"; +export interface AminoMsgCreateBalancerPool extends AminoMsg { + type: "osmosis/gamm/poolmodels/balancer/create-balancer-pool"; + value: { + sender: string; + poolParams: { + swapFee: string; + exitFee: string; + smoothWeightChangeParams: { + start_time: { + seconds: string; + nanos: number; + }; + duration: { + seconds: string; + nanos: number; + }; + initialPoolWeights: { + token: { + denom: string; + amount: string; + }; + weight: string; + }[]; + targetPoolWeights: { + token: { + denom: string; + amount: string; + }; + weight: string; + }[]; + }; + }; + poolAssets: { + token: { + denom: string; + amount: string; + }; + weight: string; + }[]; + future_pool_governor: string; + }; +} +export const AminoConverter = { + "/osmosis.gamm.poolmodels.balancer.v1beta1.MsgCreateBalancerPool": { + aminoType: "osmosis/gamm/poolmodels/balancer/create-balancer-pool", + toAmino: ({ + sender, + poolParams, + poolAssets, + futurePoolGovernor + }: MsgCreateBalancerPool): AminoMsgCreateBalancerPool["value"] => { + return { + sender, + poolParams: { + swapFee: poolParams.swapFee, + exitFee: poolParams.exitFee, + smoothWeightChangeParams: { + start_time: poolParams.smoothWeightChangeParams.startTime, + duration: (poolParams.smoothWeightChangeParams.duration * 1_000_000_000).toString(), + initialPoolWeights: poolParams.smoothWeightChangeParams.initialPoolWeights.map(el0 => ({ + token: { + denom: el0.token.denom, + amount: Long.fromNumber(el0.token.amount).toString() + }, + weight: el0.weight + })), + targetPoolWeights: poolParams.smoothWeightChangeParams.targetPoolWeights.map(el0 => ({ + token: { + denom: el0.token.denom, + amount: Long.fromNumber(el0.token.amount).toString() + }, + weight: el0.weight + })) + } + }, + poolAssets: poolAssets.map(el0 => ({ + token: { + denom: el0.token.denom, + amount: Long.fromNumber(el0.token.amount).toString() + }, + weight: el0.weight + })), + future_pool_governor: futurePoolGovernor + }; + }, + fromAmino: ({ + sender, + poolParams, + poolAssets, + future_pool_governor + }: AminoMsgCreateBalancerPool["value"]): MsgCreateBalancerPool => { + return { + sender, + poolParams: { + swapFee: poolParams.swapFee, + exitFee: poolParams.exitFee, + smoothWeightChangeParams: { + startTime: poolParams.smoothWeightChangeParams.start_time, + duration: { + seconds: Long.fromNumber(Math.floor(parseInt(poolParams.smoothWeightChangeParams.duration) / 1_000_000_000)), + nanos: parseInt(poolParams.smoothWeightChangeParams.duration) % 1_000_000_000 + }, + initialPoolWeights: poolParams.smoothWeightChangeParams.initialPoolWeights.map(el2 => ({ + token: { + denom: el2.token.denom, + amount: el2.token.amount + }, + weight: el2.weight + })), + targetPoolWeights: poolParams.smoothWeightChangeParams.targetPoolWeights.map(el2 => ({ + token: { + denom: el2.token.denom, + amount: el2.token.amount + }, + weight: el2.weight + })) + } + }, + poolAssets: poolAssets.map(el0 => ({ + token: { + denom: el0.token.denom, + amount: el0.token.amount + }, + weight: el0.weight + })), + futurePoolGovernor: future_pool_governor + }; + } + } +}; \ No newline at end of file diff --git a/__fixtures__/output1/osmosis/gamm/pool-models/balancer/tx.registry.ts b/__fixtures__/output1/osmosis/gamm/pool-models/balancer/tx.registry.ts new file mode 100644 index 0000000000..7d66cf6710 --- /dev/null +++ b/__fixtures__/output1/osmosis/gamm/pool-models/balancer/tx.registry.ts @@ -0,0 +1,56 @@ +import { PoolParams, PoolAsset } from "./balancerPool"; +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgCreateBalancerPool } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/osmosis.gamm.poolmodels.balancer.v1beta1.MsgCreateBalancerPool", MsgCreateBalancerPool]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + createBalancerPool(value: MsgCreateBalancerPool) { + return { + typeUrl: "/osmosis.gamm.poolmodels.balancer.v1beta1.MsgCreateBalancerPool", + value: MsgCreateBalancerPool.encode(value).finish() + }; + } + + }, + withTypeUrl: { + createBalancerPool(value: MsgCreateBalancerPool) { + return { + typeUrl: "/osmosis.gamm.poolmodels.balancer.v1beta1.MsgCreateBalancerPool", + value + }; + } + + }, + toJSON: { + createBalancerPool(value: MsgCreateBalancerPool) { + return { + typeUrl: "/osmosis.gamm.poolmodels.balancer.v1beta1.MsgCreateBalancerPool", + value: MsgCreateBalancerPool.toJSON(value) + }; + } + + }, + fromJSON: { + createBalancerPool(value: any) { + return { + typeUrl: "/osmosis.gamm.poolmodels.balancer.v1beta1.MsgCreateBalancerPool", + value: MsgCreateBalancerPool.fromJSON(value) + }; + } + + }, + fromPartial: { + createBalancerPool(value: MsgCreateBalancerPool) { + return { + typeUrl: "/osmosis.gamm.poolmodels.balancer.v1beta1.MsgCreateBalancerPool", + value: MsgCreateBalancerPool.fromPartial(value) + }; + } + + } +}; \ No newline at end of file diff --git a/__fixtures__/output1/osmosis/gamm/pool-models/balancer/tx.ts b/__fixtures__/output1/osmosis/gamm/pool-models/balancer/tx.ts index 546d650e81..2904b7f987 100644 --- a/__fixtures__/output1/osmosis/gamm/pool-models/balancer/tx.ts +++ b/__fixtures__/output1/osmosis/gamm/pool-models/balancer/tx.ts @@ -1,7 +1,7 @@ import { PoolParams, PoolAsset } from "./balancerPool"; import * as _m0 from "protobufjs/minimal"; import { isSet, DeepPartial, Long } from "@osmonauts/helpers"; -export const protobufPackage = "osmosis.gamm.v1beta1"; +export const protobufPackage = "osmosis.gamm.poolmodels.balancer.v1beta1"; /** ===================== MsgCreatePool */ export interface MsgCreateBalancerPool { diff --git a/__fixtures__/output1/osmosis/gamm/pool-models/stableswap/stableswap_pool.ts b/__fixtures__/output1/osmosis/gamm/pool-models/stableswap/stableswap_pool.ts new file mode 100644 index 0000000000..7a4acda4fa --- /dev/null +++ b/__fixtures__/output1/osmosis/gamm/pool-models/stableswap/stableswap_pool.ts @@ -0,0 +1,280 @@ +import { Coin } from "../../../../cosmos/base/v1beta1/coin"; +import * as _m0 from "protobufjs/minimal"; +import { isSet, DeepPartial, Long } from "@osmonauts/helpers"; +export const protobufPackage = "osmosis.gamm.poolmodels.stableswap.v1beta1"; + +/** + * PoolParams defined the parameters that will be managed by the pool + * governance in the future. This params are not managed by the chain + * governance. Instead they will be managed by the token holders of the pool. + * The pool's token holders are specified in future_pool_governor. + */ +export interface PoolParams { + swapFee: string; + exitFee: string; +} + +/** Pool is the stableswap Pool struct */ +export interface Pool { + address: string; + id: Long; + poolParams: PoolParams; + + /** + * 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. + */ + futurePoolGovernor: string; + + /** sum of all LP shares */ + totalShares: Coin; + + /** assets in the pool */ + poolLiquidity: Coin[]; + + /** for calculation amognst assets with different precisions */ + scalingFactor: Long[]; + + /** scaling_factor_governor is the address can adjust pool scaling factors */ + scalingFactorGovernor: string; +} + +function createBasePoolParams(): PoolParams { + return { + swapFee: "", + exitFee: "" + }; +} + +export const PoolParams = { + encode(message: PoolParams, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.swapFee !== "") { + writer.uint32(10).string(message.swapFee); + } + + if (message.exitFee !== "") { + writer.uint32(18).string(message.exitFee); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PoolParams { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePoolParams(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.swapFee = reader.string(); + break; + + case 2: + message.exitFee = reader.string(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): PoolParams { + return { + swapFee: isSet(object.swapFee) ? String(object.swapFee) : "", + exitFee: isSet(object.exitFee) ? String(object.exitFee) : "" + }; + }, + + toJSON(message: PoolParams): unknown { + const obj: any = {}; + message.swapFee !== undefined && (obj.swapFee = message.swapFee); + message.exitFee !== undefined && (obj.exitFee = message.exitFee); + return obj; + }, + + fromPartial(object: DeepPartial): PoolParams { + const message = createBasePoolParams(); + message.swapFee = object.swapFee ?? ""; + message.exitFee = object.exitFee ?? ""; + return message; + } + +}; + +function createBasePool(): Pool { + return { + address: "", + id: Long.UZERO, + poolParams: undefined, + futurePoolGovernor: "", + totalShares: undefined, + poolLiquidity: [], + scalingFactor: [], + scalingFactorGovernor: "" + }; +} + +export const Pool = { + encode(message: Pool, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.address !== "") { + writer.uint32(10).string(message.address); + } + + if (!message.id.isZero()) { + writer.uint32(16).uint64(message.id); + } + + if (message.poolParams !== undefined) { + PoolParams.encode(message.poolParams, writer.uint32(26).fork()).ldelim(); + } + + if (message.futurePoolGovernor !== "") { + writer.uint32(34).string(message.futurePoolGovernor); + } + + if (message.totalShares !== undefined) { + Coin.encode(message.totalShares, writer.uint32(42).fork()).ldelim(); + } + + for (const v of message.poolLiquidity) { + Coin.encode(v!, writer.uint32(50).fork()).ldelim(); + } + + writer.uint32(58).fork(); + + for (const v of message.scalingFactor) { + writer.uint64(v); + } + + writer.ldelim(); + + if (message.scalingFactorGovernor !== "") { + writer.uint32(66).string(message.scalingFactorGovernor); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Pool { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePool(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.address = reader.string(); + break; + + case 2: + message.id = (reader.uint64() as Long); + break; + + case 3: + message.poolParams = PoolParams.decode(reader, reader.uint32()); + break; + + case 4: + message.futurePoolGovernor = reader.string(); + break; + + case 5: + message.totalShares = Coin.decode(reader, reader.uint32()); + break; + + case 6: + message.poolLiquidity.push(Coin.decode(reader, reader.uint32())); + break; + + case 7: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + + while (reader.pos < end2) { + message.scalingFactor.push((reader.uint64() as Long)); + } + } else { + message.scalingFactor.push((reader.uint64() as Long)); + } + + break; + + case 8: + message.scalingFactorGovernor = reader.string(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): Pool { + return { + address: isSet(object.address) ? String(object.address) : "", + id: isSet(object.id) ? Long.fromString(object.id) : Long.UZERO, + poolParams: isSet(object.poolParams) ? PoolParams.fromJSON(object.poolParams) : undefined, + 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.fromString(e)) : [], + scalingFactorGovernor: isSet(object.scalingFactorGovernor) ? String(object.scalingFactorGovernor) : "" + }; + }, + + toJSON(message: Pool): unknown { + const obj: any = {}; + message.address !== undefined && (obj.address = message.address); + message.id !== undefined && (obj.id = (message.id || Long.UZERO).toString()); + message.poolParams !== undefined && (obj.poolParams = message.poolParams ? PoolParams.toJSON(message.poolParams) : undefined); + message.futurePoolGovernor !== undefined && (obj.futurePoolGovernor = message.futurePoolGovernor); + message.totalShares !== undefined && (obj.totalShares = message.totalShares ? Coin.toJSON(message.totalShares) : undefined); + + if (message.poolLiquidity) { + obj.poolLiquidity = message.poolLiquidity.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.poolLiquidity = []; + } + + if (message.scalingFactor) { + obj.scalingFactor = message.scalingFactor.map(e => (e || Long.UZERO).toString()); + } else { + obj.scalingFactor = []; + } + + message.scalingFactorGovernor !== undefined && (obj.scalingFactorGovernor = message.scalingFactorGovernor); + return obj; + }, + + fromPartial(object: DeepPartial): Pool { + const message = createBasePool(); + message.address = object.address ?? ""; + message.id = object.id !== undefined && object.id !== null ? Long.fromValue(object.id) : Long.UZERO; + message.poolParams = object.poolParams !== undefined && object.poolParams !== null ? PoolParams.fromPartial(object.poolParams) : undefined; + 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 ?? ""; + return message; + } + +}; \ No newline at end of file diff --git a/__fixtures__/output1/osmosis/gamm/pool-models/stableswap/tx.amino.ts b/__fixtures__/output1/osmosis/gamm/pool-models/stableswap/tx.amino.ts new file mode 100644 index 0000000000..7f9f638801 --- /dev/null +++ b/__fixtures__/output1/osmosis/gamm/pool-models/stableswap/tx.amino.ts @@ -0,0 +1,96 @@ +import { PoolParams } from "./stableswap_pool"; +import { Coin } from "../../../../cosmos/base/v1beta1/coin"; +import { AminoMsg } from "@cosmjs/amino"; +import { Long } from "@osmonauts/helpers"; +import { MsgCreateStableswapPool, MsgStableSwapAdjustScalingFactors } from "./tx"; +export interface AminoMsgCreateStableswapPool extends AminoMsg { + type: "osmosis/gamm/poolmodels/stableswap/create-stableswap-pool"; + value: { + sender: string; + poolParams: { + swapFee: string; + exitFee: string; + }; + initial_pool_liquidity: { + denom: string; + amount: string; + }[]; + future_pool_governor: string; + }; +} +export interface AminoMsgStableSwapAdjustScalingFactors extends AminoMsg { + type: "osmosis/gamm/poolmodels/stableswap/stable-swap-adjust-scaling-factors"; + value: { + sender: string; + pool_id: string; + scaling_factors: Long[]; + }; +} +export const AminoConverter = { + "/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgCreateStableswapPool": { + aminoType: "osmosis/gamm/poolmodels/stableswap/create-stableswap-pool", + toAmino: ({ + sender, + poolParams, + initialPoolLiquidity, + futurePoolGovernor + }: MsgCreateStableswapPool): AminoMsgCreateStableswapPool["value"] => { + return { + sender, + poolParams: { + swapFee: poolParams.swapFee, + exitFee: poolParams.exitFee + }, + initial_pool_liquidity: initialPoolLiquidity.map(el0 => ({ + denom: el0.denom, + amount: el0.amount + })), + future_pool_governor: futurePoolGovernor + }; + }, + fromAmino: ({ + sender, + poolParams, + initial_pool_liquidity, + future_pool_governor + }: AminoMsgCreateStableswapPool["value"]): MsgCreateStableswapPool => { + return { + sender, + poolParams: { + swapFee: poolParams.swapFee, + exitFee: poolParams.exitFee + }, + initialPoolLiquidity: initial_pool_liquidity.map(el0 => ({ + denom: el0.denom, + amount: el0.amount + })), + futurePoolGovernor: future_pool_governor + }; + } + }, + "/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgStableSwapAdjustScalingFactors": { + aminoType: "osmosis/gamm/poolmodels/stableswap/stable-swap-adjust-scaling-factors", + toAmino: ({ + sender, + poolId, + scalingFactors + }: MsgStableSwapAdjustScalingFactors): AminoMsgStableSwapAdjustScalingFactors["value"] => { + return { + sender, + pool_id: poolId.toString(), + scaling_factors: scalingFactors.map(el0 => el0.toString()) + }; + }, + fromAmino: ({ + sender, + pool_id, + scaling_factors + }: AminoMsgStableSwapAdjustScalingFactors["value"]): MsgStableSwapAdjustScalingFactors => { + return { + sender, + poolId: Long.fromString(pool_id), + scalingFactors: scaling_factors.map(el0 => Long.fromString(el0)) + }; + } + } +}; \ No newline at end of file diff --git a/__fixtures__/output1/osmosis/gamm/pool-models/stableswap/tx.registry.ts b/__fixtures__/output1/osmosis/gamm/pool-models/stableswap/tx.registry.ts new file mode 100644 index 0000000000..eca7b9fc40 --- /dev/null +++ b/__fixtures__/output1/osmosis/gamm/pool-models/stableswap/tx.registry.ts @@ -0,0 +1,92 @@ +import { PoolParams } from "./stableswap_pool"; +import { Coin } from "../../../../cosmos/base/v1beta1/coin"; +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgCreateStableswapPool, MsgStableSwapAdjustScalingFactors } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgCreateStableswapPool", MsgCreateStableswapPool], ["/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgStableSwapAdjustScalingFactors", MsgStableSwapAdjustScalingFactors]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + createStableswapPool(value: MsgCreateStableswapPool) { + return { + typeUrl: "/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgCreateStableswapPool", + value: MsgCreateStableswapPool.encode(value).finish() + }; + }, + + stableSwapAdjustScalingFactors(value: MsgStableSwapAdjustScalingFactors) { + return { + typeUrl: "/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgStableSwapAdjustScalingFactors", + value: MsgStableSwapAdjustScalingFactors.encode(value).finish() + }; + } + + }, + withTypeUrl: { + createStableswapPool(value: MsgCreateStableswapPool) { + return { + typeUrl: "/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgCreateStableswapPool", + value + }; + }, + + stableSwapAdjustScalingFactors(value: MsgStableSwapAdjustScalingFactors) { + return { + typeUrl: "/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgStableSwapAdjustScalingFactors", + value + }; + } + + }, + toJSON: { + createStableswapPool(value: MsgCreateStableswapPool) { + return { + typeUrl: "/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgCreateStableswapPool", + value: MsgCreateStableswapPool.toJSON(value) + }; + }, + + stableSwapAdjustScalingFactors(value: MsgStableSwapAdjustScalingFactors) { + return { + typeUrl: "/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgStableSwapAdjustScalingFactors", + value: MsgStableSwapAdjustScalingFactors.toJSON(value) + }; + } + + }, + fromJSON: { + createStableswapPool(value: any) { + return { + typeUrl: "/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgCreateStableswapPool", + value: MsgCreateStableswapPool.fromJSON(value) + }; + }, + + stableSwapAdjustScalingFactors(value: any) { + return { + typeUrl: "/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgStableSwapAdjustScalingFactors", + value: MsgStableSwapAdjustScalingFactors.fromJSON(value) + }; + } + + }, + fromPartial: { + createStableswapPool(value: MsgCreateStableswapPool) { + return { + typeUrl: "/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgCreateStableswapPool", + value: MsgCreateStableswapPool.fromPartial(value) + }; + }, + + stableSwapAdjustScalingFactors(value: MsgStableSwapAdjustScalingFactors) { + return { + typeUrl: "/osmosis.gamm.poolmodels.stableswap.v1beta1.MsgStableSwapAdjustScalingFactors", + value: MsgStableSwapAdjustScalingFactors.fromPartial(value) + }; + } + + } +}; \ No newline at end of file diff --git a/__fixtures__/output1/osmosis/gamm/pool-models/stableswap/tx.ts b/__fixtures__/output1/osmosis/gamm/pool-models/stableswap/tx.ts new file mode 100644 index 0000000000..c3dc365488 --- /dev/null +++ b/__fixtures__/output1/osmosis/gamm/pool-models/stableswap/tx.ts @@ -0,0 +1,322 @@ +import { PoolParams } from "./stableswap_pool"; +import { Coin } from "../../../../cosmos/base/v1beta1/coin"; +import * as _m0 from "protobufjs/minimal"; +import { isSet, DeepPartial, Long } from "@osmonauts/helpers"; +export const protobufPackage = "osmosis.gamm.poolmodels.stableswap.v1beta1"; +export interface MsgCreateStableswapPool { + sender: string; + poolParams: PoolParams; + initialPoolLiquidity: Coin[]; + futurePoolGovernor: string; +} +export interface MsgCreateStableswapPoolResponse { + poolId: Long; +} +export interface MsgStableSwapAdjustScalingFactors { + /** + * Sender must be the pool's scaling_factor_governor in order for the tx to + * succeed + */ + sender: string; + poolId: Long; + scalingFactors: Long[]; +} +export interface MsgStableSwapAdjustScalingFactorsResponse {} + +function createBaseMsgCreateStableswapPool(): MsgCreateStableswapPool { + return { + sender: "", + poolParams: undefined, + initialPoolLiquidity: [], + futurePoolGovernor: "" + }; +} + +export const MsgCreateStableswapPool = { + encode(message: MsgCreateStableswapPool, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + + if (message.poolParams !== undefined) { + PoolParams.encode(message.poolParams, writer.uint32(18).fork()).ldelim(); + } + + for (const v of message.initialPoolLiquidity) { + Coin.encode(v!, writer.uint32(26).fork()).ldelim(); + } + + if (message.futurePoolGovernor !== "") { + writer.uint32(34).string(message.futurePoolGovernor); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateStableswapPool { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateStableswapPool(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + + case 2: + message.poolParams = PoolParams.decode(reader, reader.uint32()); + break; + + case 3: + message.initialPoolLiquidity.push(Coin.decode(reader, reader.uint32())); + break; + + case 4: + message.futurePoolGovernor = reader.string(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): MsgCreateStableswapPool { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + poolParams: isSet(object.poolParams) ? PoolParams.fromJSON(object.poolParams) : undefined, + initialPoolLiquidity: Array.isArray(object?.initialPoolLiquidity) ? object.initialPoolLiquidity.map((e: any) => Coin.fromJSON(e)) : [], + futurePoolGovernor: isSet(object.futurePoolGovernor) ? String(object.futurePoolGovernor) : "" + }; + }, + + toJSON(message: MsgCreateStableswapPool): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.poolParams !== undefined && (obj.poolParams = message.poolParams ? PoolParams.toJSON(message.poolParams) : undefined); + + if (message.initialPoolLiquidity) { + obj.initialPoolLiquidity = message.initialPoolLiquidity.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.initialPoolLiquidity = []; + } + + message.futurePoolGovernor !== undefined && (obj.futurePoolGovernor = message.futurePoolGovernor); + return obj; + }, + + fromPartial(object: DeepPartial): MsgCreateStableswapPool { + const message = createBaseMsgCreateStableswapPool(); + message.sender = object.sender ?? ""; + message.poolParams = object.poolParams !== undefined && object.poolParams !== null ? PoolParams.fromPartial(object.poolParams) : undefined; + message.initialPoolLiquidity = object.initialPoolLiquidity?.map(e => Coin.fromPartial(e)) || []; + message.futurePoolGovernor = object.futurePoolGovernor ?? ""; + return message; + } + +}; + +function createBaseMsgCreateStableswapPoolResponse(): MsgCreateStableswapPoolResponse { + return { + poolId: Long.UZERO + }; +} + +export const MsgCreateStableswapPoolResponse = { + encode(message: MsgCreateStableswapPoolResponse, 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): MsgCreateStableswapPoolResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateStableswapPoolResponse(); + + 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): MsgCreateStableswapPoolResponse { + return { + poolId: isSet(object.poolId) ? Long.fromString(object.poolId) : Long.UZERO + }; + }, + + toJSON(message: MsgCreateStableswapPoolResponse): unknown { + const obj: any = {}; + message.poolId !== undefined && (obj.poolId = (message.poolId || Long.UZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): MsgCreateStableswapPoolResponse { + const message = createBaseMsgCreateStableswapPoolResponse(); + message.poolId = object.poolId !== undefined && object.poolId !== null ? Long.fromValue(object.poolId) : Long.UZERO; + return message; + } + +}; + +function createBaseMsgStableSwapAdjustScalingFactors(): MsgStableSwapAdjustScalingFactors { + return { + sender: "", + poolId: Long.UZERO, + scalingFactors: [] + }; +} + +export const MsgStableSwapAdjustScalingFactors = { + encode(message: MsgStableSwapAdjustScalingFactors, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + + if (!message.poolId.isZero()) { + writer.uint32(16).uint64(message.poolId); + } + + writer.uint32(26).fork(); + + for (const v of message.scalingFactors) { + writer.uint64(v); + } + + writer.ldelim(); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgStableSwapAdjustScalingFactors { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgStableSwapAdjustScalingFactors(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + + case 2: + message.poolId = (reader.uint64() as Long); + break; + + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + + while (reader.pos < end2) { + message.scalingFactors.push((reader.uint64() as Long)); + } + } else { + message.scalingFactors.push((reader.uint64() as Long)); + } + + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): MsgStableSwapAdjustScalingFactors { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + poolId: isSet(object.poolId) ? Long.fromString(object.poolId) : Long.UZERO, + scalingFactors: Array.isArray(object?.scalingFactors) ? object.scalingFactors.map((e: any) => Long.fromString(e)) : [] + }; + }, + + toJSON(message: MsgStableSwapAdjustScalingFactors): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.poolId !== undefined && (obj.poolId = (message.poolId || Long.UZERO).toString()); + + if (message.scalingFactors) { + obj.scalingFactors = message.scalingFactors.map(e => (e || Long.UZERO).toString()); + } else { + obj.scalingFactors = []; + } + + return obj; + }, + + fromPartial(object: DeepPartial): MsgStableSwapAdjustScalingFactors { + const message = createBaseMsgStableSwapAdjustScalingFactors(); + message.sender = object.sender ?? ""; + message.poolId = object.poolId !== undefined && object.poolId !== null ? Long.fromValue(object.poolId) : Long.UZERO; + message.scalingFactors = object.scalingFactors?.map(e => Long.fromValue(e)) || []; + return message; + } + +}; + +function createBaseMsgStableSwapAdjustScalingFactorsResponse(): MsgStableSwapAdjustScalingFactorsResponse { + return {}; +} + +export const MsgStableSwapAdjustScalingFactorsResponse = { + encode(_: MsgStableSwapAdjustScalingFactorsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgStableSwapAdjustScalingFactorsResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgStableSwapAdjustScalingFactorsResponse(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(_: any): MsgStableSwapAdjustScalingFactorsResponse { + return {}; + }, + + toJSON(_: MsgStableSwapAdjustScalingFactorsResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): MsgStableSwapAdjustScalingFactorsResponse { + const message = createBaseMsgStableSwapAdjustScalingFactorsResponse(); + return message; + } + +}; \ No newline at end of file diff --git a/__fixtures__/output1/osmosis/gamm/v1beta1/query.lcd.ts b/__fixtures__/output1/osmosis/gamm/v1beta1/query.lcd.ts index ba7114d017..c878910b27 100644 --- a/__fixtures__/output1/osmosis/gamm/v1beta1/query.lcd.ts +++ b/__fixtures__/output1/osmosis/gamm/v1beta1/query.lcd.ts @@ -63,18 +63,19 @@ export class LCDQueryClient extends LCDClient { return await this.request(endpoint); } - /* SpotPrice */ + /* 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?.tokenInDenom !== "undefined") { - options.params.token_in_denom = params.tokenInDenom; + if (typeof params?.baseAssetDenom !== "undefined") { + options.params.base_asset_denom = params.baseAssetDenom; } - if (typeof params?.tokenOutDenom !== "undefined") { - options.params.token_out_denom = params.tokenOutDenom; + if (typeof params?.quoteAssetDenom !== "undefined") { + options.params.quote_asset_denom = params.quoteAssetDenom; } const endpoint = `osmosis/gamm/v1beta1/pools/${params.poolId}/prices`; diff --git a/__fixtures__/output1/osmosis/gamm/v1beta1/query.ts b/__fixtures__/output1/osmosis/gamm/v1beta1/query.ts index b4391beaa3..d5874202ec 100644 --- a/__fixtures__/output1/osmosis/gamm/v1beta1/query.ts +++ b/__fixtures__/output1/osmosis/gamm/v1beta1/query.ts @@ -56,12 +56,20 @@ export interface QueryTotalSharesResponse { totalShares: Coin; } -/** =============================== SpotPrice */ +/** + * QuerySpotPriceRequest defines the gRPC request structure for a SpotPrice + * query. + */ export interface QuerySpotPriceRequest { poolId: Long; - tokenInDenom: string; - tokenOutDenom: string; + 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; @@ -790,8 +798,8 @@ export const QueryTotalSharesResponse = { function createBaseQuerySpotPriceRequest(): QuerySpotPriceRequest { return { poolId: Long.UZERO, - tokenInDenom: "", - tokenOutDenom: "" + baseAssetDenom: "", + quoteAssetDenom: "" }; } @@ -801,12 +809,12 @@ export const QuerySpotPriceRequest = { writer.uint32(8).uint64(message.poolId); } - if (message.tokenInDenom !== "") { - writer.uint32(18).string(message.tokenInDenom); + if (message.baseAssetDenom !== "") { + writer.uint32(18).string(message.baseAssetDenom); } - if (message.tokenOutDenom !== "") { - writer.uint32(26).string(message.tokenOutDenom); + if (message.quoteAssetDenom !== "") { + writer.uint32(26).string(message.quoteAssetDenom); } return writer; @@ -826,11 +834,11 @@ export const QuerySpotPriceRequest = { break; case 2: - message.tokenInDenom = reader.string(); + message.baseAssetDenom = reader.string(); break; case 3: - message.tokenOutDenom = reader.string(); + message.quoteAssetDenom = reader.string(); break; default: @@ -845,24 +853,24 @@ export const QuerySpotPriceRequest = { fromJSON(object: any): QuerySpotPriceRequest { return { poolId: isSet(object.poolId) ? Long.fromString(object.poolId) : Long.UZERO, - tokenInDenom: isSet(object.tokenInDenom) ? String(object.tokenInDenom) : "", - tokenOutDenom: isSet(object.tokenOutDenom) ? String(object.tokenOutDenom) : "" + 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.tokenInDenom !== undefined && (obj.tokenInDenom = message.tokenInDenom); - message.tokenOutDenom !== undefined && (obj.tokenOutDenom = message.tokenOutDenom); + 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.tokenInDenom = object.tokenInDenom ?? ""; - message.tokenOutDenom = object.tokenOutDenom ?? ""; + message.baseAssetDenom = object.baseAssetDenom ?? ""; + message.quoteAssetDenom = object.quoteAssetDenom ?? ""; return message; } diff --git a/__fixtures__/output1/osmosis/gamm/v1beta1/tx.ts b/__fixtures__/output1/osmosis/gamm/v1beta1/tx.ts index a6137b2589..73ebc430f2 100644 --- a/__fixtures__/output1/osmosis/gamm/v1beta1/tx.ts +++ b/__fixtures__/output1/osmosis/gamm/v1beta1/tx.ts @@ -62,11 +62,6 @@ export interface MsgJoinSwapExternAmountIn { sender: string; poolId: Long; tokenIn: Coin; - - /** - * reserved 3; - * reserved "token_in"; - */ shareOutMinAmount: string; } export interface MsgJoinSwapExternAmountInResponse { diff --git a/__fixtures__/output1/osmosis/incentives/query.lcd.ts b/__fixtures__/output1/osmosis/incentives/query.lcd.ts index 3087230231..b881a602a3 100644 --- a/__fixtures__/output1/osmosis/incentives/query.lcd.ts +++ b/__fixtures__/output1/osmosis/incentives/query.lcd.ts @@ -3,7 +3,7 @@ import { Coin } from "../../cosmos/base/v1beta1/coin"; import { Gauge } from "./gauge"; import { Duration } from "../../google/protobuf/duration"; import { LCDClient } from "@osmonauts/lcd"; -import { ModuleToDistributeCoinsRequest, ModuleToDistributeCoinsResponse, ModuleDistributedCoinsRequest, ModuleDistributedCoinsResponse, GaugeByIDRequest, GaugeByIDResponse, GaugesRequest, GaugesResponse, ActiveGaugesRequest, ActiveGaugesResponse, ActiveGaugesPerDenomRequest, ActiveGaugesPerDenomResponse, UpcomingGaugesRequest, UpcomingGaugesResponse, RewardsEstRequest, RewardsEstResponse, QueryLockableDurationsRequest, QueryLockableDurationsResponse } from "./query"; +import { ModuleToDistributeCoinsRequest, ModuleToDistributeCoinsResponse, ModuleDistributedCoinsRequest, ModuleDistributedCoinsResponse, GaugeByIDRequest, GaugeByIDResponse, GaugesRequest, GaugesResponse, ActiveGaugesRequest, ActiveGaugesResponse, ActiveGaugesPerDenomRequest, ActiveGaugesPerDenomResponse, UpcomingGaugesRequest, UpcomingGaugesResponse, UpcomingGaugesPerDenomRequest, UpcomingGaugesPerDenomResponse, RewardsEstRequest, RewardsEstResponse, QueryLockableDurationsRequest, QueryLockableDurationsResponse } from "./query"; export class LCDQueryClient extends LCDClient { constructor({ restEndpoint @@ -59,7 +59,7 @@ export class LCDQueryClient extends LCDClient { return await this.request(endpoint, options); } - /* ActiveGaugesPerDenom */ + /* returns active gauges per denom */ async activeGaugesPerDenom(params: ActiveGaugesPerDenomRequest): Promise { const options: any = { params: {} @@ -91,6 +91,24 @@ export class LCDQueryClient extends LCDClient { return await this.request(endpoint, options); } + /* returns scheduled gauges per denom */ + async upcomingGaugesPerDenom(params: UpcomingGaugesPerDenomRequest): Promise { + const options: any = { + params: {} + }; + + if (typeof params?.denom !== "undefined") { + options.params.denom = params.denom; + } + + if (typeof params?.pagination !== "undefined") { + options.params.pagination = params.pagination; + } + + const endpoint = `osmosis/incentives/v1beta1/upcoming_gauges_per_denom/`; + return await this.request(endpoint, options); + } + /* RewardsEst returns an estimate of the rewards at a future specific time. The querier either provides an address or a set of locks for which they want to find the associated rewards. */ diff --git a/__fixtures__/output1/osmosis/incentives/query.ts b/__fixtures__/output1/osmosis/incentives/query.ts index 0ce728720e..1c6d4ab7b6 100644 --- a/__fixtures__/output1/osmosis/incentives/query.ts +++ b/__fixtures__/output1/osmosis/incentives/query.ts @@ -61,6 +61,14 @@ export interface UpcomingGaugesResponse { /** pagination defines an pagination for the response. */ pagination: PageResponse; } +export interface UpcomingGaugesPerDenomRequest { + denom: string; + pagination: PageRequest; +} +export interface UpcomingGaugesPerDenomResponse { + upcomingGauges: Gauge[]; + pagination: PageResponse; +} export interface RewardsEstRequest { owner: string; lockIds: Long[]; @@ -940,6 +948,150 @@ export const UpcomingGaugesResponse = { }; +function createBaseUpcomingGaugesPerDenomRequest(): UpcomingGaugesPerDenomRequest { + return { + denom: "", + pagination: undefined + }; +} + +export const UpcomingGaugesPerDenomRequest = { + encode(message: UpcomingGaugesPerDenomRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UpcomingGaugesPerDenomRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpcomingGaugesPerDenomRequest(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + + case 2: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): UpcomingGaugesPerDenomRequest { + return { + denom: isSet(object.denom) ? String(object.denom) : "", + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined + }; + }, + + toJSON(message: UpcomingGaugesPerDenomRequest): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): UpcomingGaugesPerDenomRequest { + const message = createBaseUpcomingGaugesPerDenomRequest(); + message.denom = object.denom ?? ""; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined; + return message; + } + +}; + +function createBaseUpcomingGaugesPerDenomResponse(): UpcomingGaugesPerDenomResponse { + return { + upcomingGauges: [], + pagination: undefined + }; +} + +export const UpcomingGaugesPerDenomResponse = { + encode(message: UpcomingGaugesPerDenomResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.upcomingGauges) { + Gauge.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): UpcomingGaugesPerDenomResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpcomingGaugesPerDenomResponse(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.upcomingGauges.push(Gauge.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): UpcomingGaugesPerDenomResponse { + return { + upcomingGauges: Array.isArray(object?.upcomingGauges) ? object.upcomingGauges.map((e: any) => Gauge.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined + }; + }, + + toJSON(message: UpcomingGaugesPerDenomResponse): unknown { + const obj: any = {}; + + if (message.upcomingGauges) { + obj.upcomingGauges = message.upcomingGauges.map(e => e ? Gauge.toJSON(e) : undefined); + } else { + obj.upcomingGauges = []; + } + + message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): UpcomingGaugesPerDenomResponse { + const message = createBaseUpcomingGaugesPerDenomResponse(); + message.upcomingGauges = object.upcomingGauges?.map(e => Gauge.fromPartial(e)) || []; + message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined; + return message; + } + +}; + function createBaseRewardsEstRequest(): RewardsEstRequest { return { owner: "", diff --git a/__fixtures__/output1/osmosis/lockup/query.lcd.ts b/__fixtures__/output1/osmosis/lockup/query.lcd.ts index 0c4878ec6b..72a7aec4f3 100644 --- a/__fixtures__/output1/osmosis/lockup/query.lcd.ts +++ b/__fixtures__/output1/osmosis/lockup/query.lcd.ts @@ -3,7 +3,7 @@ import { Duration } from "../../google/protobuf/duration"; import { Coin } from "../../cosmos/base/v1beta1/coin"; import { PeriodLock, SyntheticLock } from "./lock"; import { LCDClient } from "@osmonauts/lcd"; -import { ModuleBalanceRequest, ModuleBalanceResponse, ModuleLockedAmountRequest, ModuleLockedAmountResponse, AccountUnlockableCoinsRequest, AccountUnlockableCoinsResponse, AccountUnlockingCoinsRequest, AccountUnlockingCoinsResponse, AccountLockedCoinsRequest, AccountLockedCoinsResponse, AccountLockedPastTimeRequest, AccountLockedPastTimeResponse, AccountLockedPastTimeNotUnlockingOnlyRequest, AccountLockedPastTimeNotUnlockingOnlyResponse, AccountUnlockedBeforeTimeRequest, AccountUnlockedBeforeTimeResponse, AccountLockedPastTimeDenomRequest, AccountLockedPastTimeDenomResponse, LockedDenomRequest, LockedDenomResponse, LockedRequest, LockedResponse, SyntheticLockupsByLockupIDRequest, SyntheticLockupsByLockupIDResponse, AccountLockedLongerDurationRequest, AccountLockedLongerDurationResponse, AccountLockedLongerDurationNotUnlockingOnlyRequest, AccountLockedLongerDurationNotUnlockingOnlyResponse, AccountLockedLongerDurationDenomRequest, AccountLockedLongerDurationDenomResponse } from "./query"; +import { ModuleBalanceRequest, ModuleBalanceResponse, ModuleLockedAmountRequest, ModuleLockedAmountResponse, AccountUnlockableCoinsRequest, AccountUnlockableCoinsResponse, AccountUnlockingCoinsRequest, AccountUnlockingCoinsResponse, AccountLockedCoinsRequest, AccountLockedCoinsResponse, AccountLockedPastTimeRequest, AccountLockedPastTimeResponse, AccountLockedPastTimeNotUnlockingOnlyRequest, AccountLockedPastTimeNotUnlockingOnlyResponse, AccountUnlockedBeforeTimeRequest, AccountUnlockedBeforeTimeResponse, AccountLockedPastTimeDenomRequest, AccountLockedPastTimeDenomResponse, LockedDenomRequest, LockedDenomResponse, LockedRequest, LockedResponse, SyntheticLockupsByLockupIDRequest, SyntheticLockupsByLockupIDResponse, AccountLockedLongerDurationRequest, AccountLockedLongerDurationResponse, AccountLockedDurationRequest, AccountLockedDurationResponse, AccountLockedLongerDurationNotUnlockingOnlyRequest, AccountLockedLongerDurationNotUnlockingOnlyResponse, AccountLockedLongerDurationDenomRequest, AccountLockedLongerDurationDenomResponse } from "./query"; export class LCDQueryClient extends LCDClient { constructor({ restEndpoint @@ -164,6 +164,20 @@ export class LCDQueryClient extends LCDClient { return await this.request(endpoint, options); } + /* Returns account locked records with a specific duration */ + async accountLockedDuration(params: AccountLockedDurationRequest): Promise { + const options: any = { + params: {} + }; + + if (typeof params?.duration !== "undefined") { + options.params.duration = params.duration; + } + + const endpoint = `osmosis/lockup/v1beta1/account_locked_duration/${params.owner}`; + return await this.request(endpoint, options); + } + /* Returns account locked records with longer duration excluding tokens started unlocking */ async accountLockedLongerDurationNotUnlockingOnly(params: AccountLockedLongerDurationNotUnlockingOnlyRequest): Promise { diff --git a/__fixtures__/output1/osmosis/lockup/query.ts b/__fixtures__/output1/osmosis/lockup/query.ts index 46b0597f4e..a5c804049d 100644 --- a/__fixtures__/output1/osmosis/lockup/query.ts +++ b/__fixtures__/output1/osmosis/lockup/query.ts @@ -86,6 +86,13 @@ export interface AccountLockedLongerDurationRequest { export interface AccountLockedLongerDurationResponse { locks: PeriodLock[]; } +export interface AccountLockedDurationRequest { + owner: string; + duration: Duration; +} +export interface AccountLockedDurationResponse { + locks: PeriodLock[]; +} export interface AccountLockedLongerDurationNotUnlockingOnlyRequest { owner: string; duration: Duration; @@ -1706,6 +1713,138 @@ export const AccountLockedLongerDurationResponse = { }; +function createBaseAccountLockedDurationRequest(): AccountLockedDurationRequest { + return { + owner: "", + duration: undefined + }; +} + +export const AccountLockedDurationRequest = { + encode(message: AccountLockedDurationRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.owner !== "") { + writer.uint32(10).string(message.owner); + } + + if (message.duration !== undefined) { + Duration.encode(message.duration, writer.uint32(18).fork()).ldelim(); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): AccountLockedDurationRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccountLockedDurationRequest(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.owner = reader.string(); + break; + + case 2: + message.duration = Duration.decode(reader, reader.uint32()); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): AccountLockedDurationRequest { + return { + owner: isSet(object.owner) ? String(object.owner) : "", + duration: isSet(object.duration) ? Duration.fromJSON(object.duration) : undefined + }; + }, + + toJSON(message: AccountLockedDurationRequest): unknown { + const obj: any = {}; + message.owner !== undefined && (obj.owner = message.owner); + message.duration !== undefined && (obj.duration = message.duration); + return obj; + }, + + fromPartial(object: DeepPartial): AccountLockedDurationRequest { + const message = createBaseAccountLockedDurationRequest(); + message.owner = object.owner ?? ""; + message.duration = object.duration ?? undefined; + return message; + } + +}; + +function createBaseAccountLockedDurationResponse(): AccountLockedDurationResponse { + return { + locks: [] + }; +} + +export const AccountLockedDurationResponse = { + encode(message: AccountLockedDurationResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.locks) { + PeriodLock.encode(v!, writer.uint32(10).fork()).ldelim(); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): AccountLockedDurationResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccountLockedDurationResponse(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.locks.push(PeriodLock.decode(reader, reader.uint32())); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): AccountLockedDurationResponse { + return { + locks: Array.isArray(object?.locks) ? object.locks.map((e: any) => PeriodLock.fromJSON(e)) : [] + }; + }, + + toJSON(message: AccountLockedDurationResponse): unknown { + const obj: any = {}; + + if (message.locks) { + obj.locks = message.locks.map(e => e ? PeriodLock.toJSON(e) : undefined); + } else { + obj.locks = []; + } + + return obj; + }, + + fromPartial(object: DeepPartial): AccountLockedDurationResponse { + const message = createBaseAccountLockedDurationResponse(); + message.locks = object.locks?.map(e => PeriodLock.fromPartial(e)) || []; + return message; + } + +}; + function createBaseAccountLockedLongerDurationNotUnlockingOnlyRequest(): AccountLockedLongerDurationNotUnlockingOnlyRequest { return { owner: "", diff --git a/__fixtures__/output1/osmosis/lockup/tx.amino.ts b/__fixtures__/output1/osmosis/lockup/tx.amino.ts index 59a335ec3b..2b6db43a06 100644 --- a/__fixtures__/output1/osmosis/lockup/tx.amino.ts +++ b/__fixtures__/output1/osmosis/lockup/tx.amino.ts @@ -3,7 +3,7 @@ import { Coin } from "../../cosmos/base/v1beta1/coin"; import { PeriodLock } from "./lock"; import { AminoMsg } from "@cosmjs/amino"; import { Long } from "@osmonauts/helpers"; -import { MsgLockTokens, MsgBeginUnlockingAll, MsgBeginUnlocking } from "./tx"; +import { MsgLockTokens, MsgBeginUnlockingAll, MsgBeginUnlocking, MsgExtendLockup } from "./tx"; export interface AminoMsgLockTokens extends AminoMsg { type: "osmosis/lockup/lock-tokens"; value: { @@ -35,6 +35,17 @@ export interface AminoMsgBeginUnlocking extends AminoMsg { }[]; }; } +export interface AminoMsgExtendLockup extends AminoMsg { + type: "osmosis/lockup/extend-lockup"; + value: { + owner: string; + ID: string; + duration: { + seconds: string; + nanos: number; + }; + }; +} export const AminoConverter = { "/osmosis.lockup.MsgLockTokens": { aminoType: "osmosis/lockup/lock-tokens", @@ -117,5 +128,33 @@ export const AminoConverter = { })) }; } + }, + "/osmosis.lockup.MsgExtendLockup": { + aminoType: "osmosis/lockup/extend-lockup", + toAmino: ({ + owner, + ID, + duration + }: MsgExtendLockup): AminoMsgExtendLockup["value"] => { + return { + owner, + ID: ID.toString(), + duration: (duration * 1_000_000_000).toString() + }; + }, + fromAmino: ({ + owner, + ID, + duration + }: AminoMsgExtendLockup["value"]): MsgExtendLockup => { + return { + owner, + ID: Long.fromString(ID), + duration: { + seconds: Long.fromNumber(Math.floor(parseInt(duration) / 1_000_000_000)), + nanos: parseInt(duration) % 1_000_000_000 + } + }; + } } }; \ 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 0b06cc69c2..79d10dc7dc 100644 --- a/__fixtures__/output1/osmosis/lockup/tx.registry.ts +++ b/__fixtures__/output1/osmosis/lockup/tx.registry.ts @@ -2,8 +2,8 @@ import { Duration } from "../../google/protobuf/duration"; import { Coin } from "../../cosmos/base/v1beta1/coin"; import { PeriodLock } from "./lock"; import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgLockTokens, MsgBeginUnlockingAll, MsgBeginUnlocking } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/osmosis.lockup.MsgLockTokens", MsgLockTokens], ["/osmosis.lockup.MsgBeginUnlockingAll", MsgBeginUnlockingAll], ["/osmosis.lockup.MsgBeginUnlocking", MsgBeginUnlocking]]; +import { MsgLockTokens, MsgBeginUnlockingAll, MsgBeginUnlocking, MsgExtendLockup } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/osmosis.lockup.MsgLockTokens", MsgLockTokens], ["/osmosis.lockup.MsgBeginUnlockingAll", MsgBeginUnlockingAll], ["/osmosis.lockup.MsgBeginUnlocking", MsgBeginUnlocking], ["/osmosis.lockup.MsgExtendLockup", MsgExtendLockup]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -30,6 +30,13 @@ export const MessageComposer = { typeUrl: "/osmosis.lockup.MsgBeginUnlocking", value: MsgBeginUnlocking.encode(value).finish() }; + }, + + extendLockup(value: MsgExtendLockup) { + return { + typeUrl: "/osmosis.lockup.MsgExtendLockup", + value: MsgExtendLockup.encode(value).finish() + }; } }, @@ -53,6 +60,13 @@ export const MessageComposer = { typeUrl: "/osmosis.lockup.MsgBeginUnlocking", value }; + }, + + extendLockup(value: MsgExtendLockup) { + return { + typeUrl: "/osmosis.lockup.MsgExtendLockup", + value + }; } }, @@ -76,6 +90,13 @@ export const MessageComposer = { typeUrl: "/osmosis.lockup.MsgBeginUnlocking", value: MsgBeginUnlocking.toJSON(value) }; + }, + + extendLockup(value: MsgExtendLockup) { + return { + typeUrl: "/osmosis.lockup.MsgExtendLockup", + value: MsgExtendLockup.toJSON(value) + }; } }, @@ -99,6 +120,13 @@ export const MessageComposer = { typeUrl: "/osmosis.lockup.MsgBeginUnlocking", value: MsgBeginUnlocking.fromJSON(value) }; + }, + + extendLockup(value: any) { + return { + typeUrl: "/osmosis.lockup.MsgExtendLockup", + value: MsgExtendLockup.fromJSON(value) + }; } }, @@ -122,6 +150,13 @@ export const MessageComposer = { typeUrl: "/osmosis.lockup.MsgBeginUnlocking", value: MsgBeginUnlocking.fromPartial(value) }; + }, + + extendLockup(value: MsgExtendLockup) { + return { + typeUrl: "/osmosis.lockup.MsgExtendLockup", + value: MsgExtendLockup.fromPartial(value) + }; } } diff --git a/__fixtures__/output1/osmosis/lockup/tx.ts b/__fixtures__/output1/osmosis/lockup/tx.ts index 202534cbac..e2737522a7 100644 --- a/__fixtures__/output1/osmosis/lockup/tx.ts +++ b/__fixtures__/output1/osmosis/lockup/tx.ts @@ -29,6 +29,24 @@ export interface MsgBeginUnlockingResponse { success: boolean; } +/** + * MsgExtendLockup extends the existing lockup's duration. + * The new duration is longer than the original. + */ +export interface MsgExtendLockup { + owner: string; + ID: Long; + + /** + * duration to be set. fails if lower than the current duration, or is + * unlocking + */ + duration: Duration; +} +export interface MsgExtendLockupResponse { + success: boolean; +} + function createBaseMsgLockTokens(): MsgLockTokens { return { owner: "", @@ -435,4 +453,142 @@ export const MsgBeginUnlockingResponse = { return message; } +}; + +function createBaseMsgExtendLockup(): MsgExtendLockup { + return { + owner: "", + ID: Long.UZERO, + duration: undefined + }; +} + +export const MsgExtendLockup = { + encode(message: MsgExtendLockup, 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); + } + + if (message.duration !== undefined) { + Duration.encode(message.duration, writer.uint32(26).fork()).ldelim(); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgExtendLockup { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgExtendLockup(); + + 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.duration = Duration.decode(reader, reader.uint32()); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): MsgExtendLockup { + return { + owner: isSet(object.owner) ? String(object.owner) : "", + ID: isSet(object.ID) ? Long.fromString(object.ID) : Long.UZERO, + duration: isSet(object.duration) ? Duration.fromJSON(object.duration) : undefined + }; + }, + + toJSON(message: MsgExtendLockup): unknown { + const obj: any = {}; + message.owner !== undefined && (obj.owner = message.owner); + message.ID !== undefined && (obj.ID = (message.ID || Long.UZERO).toString()); + message.duration !== undefined && (obj.duration = message.duration); + return obj; + }, + + fromPartial(object: DeepPartial): MsgExtendLockup { + const message = createBaseMsgExtendLockup(); + message.owner = object.owner ?? ""; + message.ID = object.ID !== undefined && object.ID !== null ? Long.fromValue(object.ID) : Long.UZERO; + message.duration = object.duration ?? undefined; + return message; + } + +}; + +function createBaseMsgExtendLockupResponse(): MsgExtendLockupResponse { + return { + success: false + }; +} + +export const MsgExtendLockupResponse = { + encode(message: MsgExtendLockupResponse, 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): MsgExtendLockupResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgExtendLockupResponse(); + + 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): MsgExtendLockupResponse { + return { + success: isSet(object.success) ? Boolean(object.success) : false + }; + }, + + toJSON(message: MsgExtendLockupResponse): unknown { + const obj: any = {}; + message.success !== undefined && (obj.success = message.success); + return obj; + }, + + fromPartial(object: DeepPartial): MsgExtendLockupResponse { + const message = createBaseMsgExtendLockupResponse(); + message.success = object.success ?? false; + return message; + } + }; \ No newline at end of file diff --git a/__fixtures__/output1/osmosis/superfluid/query.ts b/__fixtures__/output1/osmosis/superfluid/query.ts index 85b4798f9f..891d59c1f8 100644 --- a/__fixtures__/output1/osmosis/superfluid/query.ts +++ b/__fixtures__/output1/osmosis/superfluid/query.ts @@ -64,6 +64,7 @@ export interface SuperfluidDelegationsByDelegatorRequest { export interface SuperfluidDelegationsByDelegatorResponse { superfluidDelegationRecords: SuperfluidDelegationRecord[]; totalDelegatedCoins: Coin[]; + totalEquivalentStakedAmount: Coin; } export interface SuperfluidUndelegationsByDelegatorRequest { delegatorAddress: string; @@ -1166,7 +1167,8 @@ export const SuperfluidDelegationsByDelegatorRequest = { function createBaseSuperfluidDelegationsByDelegatorResponse(): SuperfluidDelegationsByDelegatorResponse { return { superfluidDelegationRecords: [], - totalDelegatedCoins: [] + totalDelegatedCoins: [], + totalEquivalentStakedAmount: undefined }; } @@ -1180,6 +1182,10 @@ export const SuperfluidDelegationsByDelegatorResponse = { Coin.encode(v!, writer.uint32(18).fork()).ldelim(); } + if (message.totalEquivalentStakedAmount !== undefined) { + Coin.encode(message.totalEquivalentStakedAmount, writer.uint32(26).fork()).ldelim(); + } + return writer; }, @@ -1200,6 +1206,10 @@ export const SuperfluidDelegationsByDelegatorResponse = { message.totalDelegatedCoins.push(Coin.decode(reader, reader.uint32())); break; + case 3: + message.totalEquivalentStakedAmount = Coin.decode(reader, reader.uint32()); + break; + default: reader.skipType(tag & 7); break; @@ -1212,7 +1222,8 @@ export const SuperfluidDelegationsByDelegatorResponse = { fromJSON(object: any): SuperfluidDelegationsByDelegatorResponse { return { superfluidDelegationRecords: Array.isArray(object?.superfluidDelegationRecords) ? object.superfluidDelegationRecords.map((e: any) => SuperfluidDelegationRecord.fromJSON(e)) : [], - totalDelegatedCoins: Array.isArray(object?.totalDelegatedCoins) ? object.totalDelegatedCoins.map((e: any) => Coin.fromJSON(e)) : [] + totalDelegatedCoins: Array.isArray(object?.totalDelegatedCoins) ? object.totalDelegatedCoins.map((e: any) => Coin.fromJSON(e)) : [], + totalEquivalentStakedAmount: isSet(object.totalEquivalentStakedAmount) ? Coin.fromJSON(object.totalEquivalentStakedAmount) : undefined }; }, @@ -1231,6 +1242,7 @@ export const SuperfluidDelegationsByDelegatorResponse = { obj.totalDelegatedCoins = []; } + message.totalEquivalentStakedAmount !== undefined && (obj.totalEquivalentStakedAmount = message.totalEquivalentStakedAmount ? Coin.toJSON(message.totalEquivalentStakedAmount) : undefined); return obj; }, @@ -1238,6 +1250,7 @@ export const SuperfluidDelegationsByDelegatorResponse = { const message = createBaseSuperfluidDelegationsByDelegatorResponse(); message.superfluidDelegationRecords = object.superfluidDelegationRecords?.map(e => SuperfluidDelegationRecord.fromPartial(e)) || []; message.totalDelegatedCoins = object.totalDelegatedCoins?.map(e => Coin.fromPartial(e)) || []; + message.totalEquivalentStakedAmount = object.totalEquivalentStakedAmount !== undefined && object.totalEquivalentStakedAmount !== null ? Coin.fromPartial(object.totalEquivalentStakedAmount) : undefined; return message; } diff --git a/__fixtures__/output1/osmosis/superfluid/superfluid.ts b/__fixtures__/output1/osmosis/superfluid/superfluid.ts index 68a7e27a1f..aa50d4e67c 100644 --- a/__fixtures__/output1/osmosis/superfluid/superfluid.ts +++ b/__fixtures__/output1/osmosis/superfluid/superfluid.ts @@ -79,11 +79,15 @@ export interface SuperfluidDelegationRecord { delegatorAddress: string; validatorAddress: string; delegationAmount: Coin; + equivalentStakedAmount: Coin; } export interface LockIdIntermediaryAccountConnection { lockId: Long; intermediaryAccount: string; } +export interface UnpoolWhitelistedPools { + ids: Long[]; +} function createBaseSuperfluidAsset(): SuperfluidAsset { return { @@ -320,7 +324,8 @@ function createBaseSuperfluidDelegationRecord(): SuperfluidDelegationRecord { return { delegatorAddress: "", validatorAddress: "", - delegationAmount: undefined + delegationAmount: undefined, + equivalentStakedAmount: undefined }; } @@ -338,6 +343,10 @@ export const SuperfluidDelegationRecord = { Coin.encode(message.delegationAmount, writer.uint32(26).fork()).ldelim(); } + if (message.equivalentStakedAmount !== undefined) { + Coin.encode(message.equivalentStakedAmount, writer.uint32(34).fork()).ldelim(); + } + return writer; }, @@ -362,6 +371,10 @@ export const SuperfluidDelegationRecord = { message.delegationAmount = Coin.decode(reader, reader.uint32()); break; + case 4: + message.equivalentStakedAmount = Coin.decode(reader, reader.uint32()); + break; + default: reader.skipType(tag & 7); break; @@ -375,7 +388,8 @@ export const SuperfluidDelegationRecord = { return { delegatorAddress: isSet(object.delegatorAddress) ? String(object.delegatorAddress) : "", validatorAddress: isSet(object.validatorAddress) ? String(object.validatorAddress) : "", - delegationAmount: isSet(object.delegationAmount) ? Coin.fromJSON(object.delegationAmount) : undefined + delegationAmount: isSet(object.delegationAmount) ? Coin.fromJSON(object.delegationAmount) : undefined, + equivalentStakedAmount: isSet(object.equivalentStakedAmount) ? Coin.fromJSON(object.equivalentStakedAmount) : undefined }; }, @@ -384,6 +398,7 @@ export const SuperfluidDelegationRecord = { message.delegatorAddress !== undefined && (obj.delegatorAddress = message.delegatorAddress); message.validatorAddress !== undefined && (obj.validatorAddress = message.validatorAddress); message.delegationAmount !== undefined && (obj.delegationAmount = message.delegationAmount ? Coin.toJSON(message.delegationAmount) : undefined); + message.equivalentStakedAmount !== undefined && (obj.equivalentStakedAmount = message.equivalentStakedAmount ? Coin.toJSON(message.equivalentStakedAmount) : undefined); return obj; }, @@ -392,6 +407,7 @@ export const SuperfluidDelegationRecord = { message.delegatorAddress = object.delegatorAddress ?? ""; message.validatorAddress = object.validatorAddress ?? ""; message.delegationAmount = object.delegationAmount !== undefined && object.delegationAmount !== null ? Coin.fromPartial(object.delegationAmount) : undefined; + message.equivalentStakedAmount = object.equivalentStakedAmount !== undefined && object.equivalentStakedAmount !== null ? Coin.fromPartial(object.equivalentStakedAmount) : undefined; return message; } @@ -464,4 +480,79 @@ export const LockIdIntermediaryAccountConnection = { return message; } +}; + +function createBaseUnpoolWhitelistedPools(): UnpoolWhitelistedPools { + return { + ids: [] + }; +} + +export const UnpoolWhitelistedPools = { + encode(message: UnpoolWhitelistedPools, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + writer.uint32(10).fork(); + + for (const v of message.ids) { + writer.uint64(v); + } + + writer.ldelim(); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UnpoolWhitelistedPools { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUnpoolWhitelistedPools(); + + 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.ids.push((reader.uint64() as Long)); + } + } else { + message.ids.push((reader.uint64() as Long)); + } + + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): UnpoolWhitelistedPools { + return { + ids: Array.isArray(object?.ids) ? object.ids.map((e: any) => Long.fromString(e)) : [] + }; + }, + + toJSON(message: UnpoolWhitelistedPools): unknown { + const obj: any = {}; + + if (message.ids) { + obj.ids = message.ids.map(e => (e || Long.UZERO).toString()); + } else { + obj.ids = []; + } + + return obj; + }, + + fromPartial(object: DeepPartial): UnpoolWhitelistedPools { + const message = createBaseUnpoolWhitelistedPools(); + message.ids = object.ids?.map(e => Long.fromValue(e)) || []; + return message; + } + }; \ No newline at end of file diff --git a/__fixtures__/output1/osmosis/superfluid/tx.amino.ts b/__fixtures__/output1/osmosis/superfluid/tx.amino.ts index ce17798129..82f74d4376 100644 --- a/__fixtures__/output1/osmosis/superfluid/tx.amino.ts +++ b/__fixtures__/output1/osmosis/superfluid/tx.amino.ts @@ -1,7 +1,7 @@ import { Coin } from "../../cosmos/base/v1beta1/coin"; import { AminoMsg } from "@cosmjs/amino"; import { Long } from "@osmonauts/helpers"; -import { MsgSuperfluidDelegate, MsgSuperfluidUndelegate, MsgSuperfluidUnbondLock, MsgLockAndSuperfluidDelegate } from "./tx"; +import { MsgSuperfluidDelegate, MsgSuperfluidUndelegate, MsgSuperfluidUnbondLock, MsgLockAndSuperfluidDelegate, MsgUnPoolWhitelistedPool } from "./tx"; export interface AminoMsgSuperfluidDelegate extends AminoMsg { type: "osmosis/superfluid/superfluid-delegate"; value: { @@ -35,6 +35,13 @@ export interface AminoMsgLockAndSuperfluidDelegate extends AminoMsg { val_addr: string; }; } +export interface AminoMsgUnPoolWhitelistedPool extends AminoMsg { + type: "osmosis/superfluid/un-pool-whitelisted-pool"; + value: { + sender: string; + pool_id: string; + }; +} export const AminoConverter = { "/osmosis.superfluid.MsgSuperfluidDelegate": { aminoType: "osmosis/superfluid/superfluid-delegate", @@ -133,5 +140,26 @@ export const AminoConverter = { valAddr: val_addr }; } + }, + "/osmosis.superfluid.MsgUnPoolWhitelistedPool": { + aminoType: "osmosis/superfluid/un-pool-whitelisted-pool", + toAmino: ({ + sender, + poolId + }: MsgUnPoolWhitelistedPool): AminoMsgUnPoolWhitelistedPool["value"] => { + return { + sender, + pool_id: poolId.toString() + }; + }, + fromAmino: ({ + sender, + pool_id + }: AminoMsgUnPoolWhitelistedPool["value"]): MsgUnPoolWhitelistedPool => { + return { + sender, + poolId: Long.fromString(pool_id) + }; + } } }; \ No newline at end of file diff --git a/__fixtures__/output1/osmosis/superfluid/tx.registry.ts b/__fixtures__/output1/osmosis/superfluid/tx.registry.ts index 163bf784d0..52a7d0637e 100644 --- a/__fixtures__/output1/osmosis/superfluid/tx.registry.ts +++ b/__fixtures__/output1/osmosis/superfluid/tx.registry.ts @@ -1,7 +1,7 @@ import { Coin } from "../../cosmos/base/v1beta1/coin"; import { GeneratedType, Registry } from "@cosmjs/proto-signing"; -import { MsgSuperfluidDelegate, MsgSuperfluidUndelegate, MsgSuperfluidUnbondLock, MsgLockAndSuperfluidDelegate } from "./tx"; -export const registry: ReadonlyArray<[string, GeneratedType]> = [["/osmosis.superfluid.MsgSuperfluidDelegate", MsgSuperfluidDelegate], ["/osmosis.superfluid.MsgSuperfluidUndelegate", MsgSuperfluidUndelegate], ["/osmosis.superfluid.MsgSuperfluidUnbondLock", MsgSuperfluidUnbondLock], ["/osmosis.superfluid.MsgLockAndSuperfluidDelegate", MsgLockAndSuperfluidDelegate]]; +import { MsgSuperfluidDelegate, MsgSuperfluidUndelegate, MsgSuperfluidUnbondLock, MsgLockAndSuperfluidDelegate, MsgUnPoolWhitelistedPool } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/osmosis.superfluid.MsgSuperfluidDelegate", MsgSuperfluidDelegate], ["/osmosis.superfluid.MsgSuperfluidUndelegate", MsgSuperfluidUndelegate], ["/osmosis.superfluid.MsgSuperfluidUnbondLock", MsgSuperfluidUnbondLock], ["/osmosis.superfluid.MsgLockAndSuperfluidDelegate", MsgLockAndSuperfluidDelegate], ["/osmosis.superfluid.MsgUnPoolWhitelistedPool", MsgUnPoolWhitelistedPool]]; export const load = (protoRegistry: Registry) => { registry.forEach(([typeUrl, mod]) => { protoRegistry.register(typeUrl, mod); @@ -35,6 +35,13 @@ export const MessageComposer = { typeUrl: "/osmosis.superfluid.MsgLockAndSuperfluidDelegate", value: MsgLockAndSuperfluidDelegate.encode(value).finish() }; + }, + + unPoolWhitelistedPool(value: MsgUnPoolWhitelistedPool) { + return { + typeUrl: "/osmosis.superfluid.MsgUnPoolWhitelistedPool", + value: MsgUnPoolWhitelistedPool.encode(value).finish() + }; } }, @@ -65,6 +72,13 @@ export const MessageComposer = { typeUrl: "/osmosis.superfluid.MsgLockAndSuperfluidDelegate", value }; + }, + + unPoolWhitelistedPool(value: MsgUnPoolWhitelistedPool) { + return { + typeUrl: "/osmosis.superfluid.MsgUnPoolWhitelistedPool", + value + }; } }, @@ -95,6 +109,13 @@ export const MessageComposer = { typeUrl: "/osmosis.superfluid.MsgLockAndSuperfluidDelegate", value: MsgLockAndSuperfluidDelegate.toJSON(value) }; + }, + + unPoolWhitelistedPool(value: MsgUnPoolWhitelistedPool) { + return { + typeUrl: "/osmosis.superfluid.MsgUnPoolWhitelistedPool", + value: MsgUnPoolWhitelistedPool.toJSON(value) + }; } }, @@ -125,6 +146,13 @@ export const MessageComposer = { typeUrl: "/osmosis.superfluid.MsgLockAndSuperfluidDelegate", value: MsgLockAndSuperfluidDelegate.fromJSON(value) }; + }, + + unPoolWhitelistedPool(value: any) { + return { + typeUrl: "/osmosis.superfluid.MsgUnPoolWhitelistedPool", + value: MsgUnPoolWhitelistedPool.fromJSON(value) + }; } }, @@ -155,6 +183,13 @@ export const MessageComposer = { typeUrl: "/osmosis.superfluid.MsgLockAndSuperfluidDelegate", value: MsgLockAndSuperfluidDelegate.fromPartial(value) }; + }, + + unPoolWhitelistedPool(value: MsgUnPoolWhitelistedPool) { + return { + typeUrl: "/osmosis.superfluid.MsgUnPoolWhitelistedPool", + value: MsgUnPoolWhitelistedPool.fromPartial(value) + }; } } diff --git a/__fixtures__/output1/osmosis/superfluid/tx.ts b/__fixtures__/output1/osmosis/superfluid/tx.ts index cc86729d69..78fe0fb161 100644 --- a/__fixtures__/output1/osmosis/superfluid/tx.ts +++ b/__fixtures__/output1/osmosis/superfluid/tx.ts @@ -33,6 +33,24 @@ export interface MsgLockAndSuperfluidDelegateResponse { ID: Long; } +/** + * MsgUnPoolWhitelistedPool Unpools every lock the sender has, that is + * associated with pool pool_id. If pool_id is not approved for unpooling by + * governance, this is a no-op. Unpooling takes the locked gamm shares, and runs + * "ExitPool" on it, to get the constituent tokens. e.g. z gamm/pool/1 tokens + * ExitPools into constituent tokens x uatom, y uosmo. Then it creates a new + * lock for every constituent token, with the duration associated with the lock. + * If the lock was unbonding, the new lockup durations should be the time left + * until unbond completion. + */ +export interface MsgUnPoolWhitelistedPool { + sender: string; + poolId: Long; +} +export interface MsgUnPoolWhitelistedPoolResponse { + exitedLockIds: Long[]; +} + function createBaseMsgSuperfluidDelegate(): MsgSuperfluidDelegate { return { sender: "", @@ -523,4 +541,148 @@ export const MsgLockAndSuperfluidDelegateResponse = { return message; } +}; + +function createBaseMsgUnPoolWhitelistedPool(): MsgUnPoolWhitelistedPool { + return { + sender: "", + poolId: Long.UZERO + }; +} + +export const MsgUnPoolWhitelistedPool = { + encode(message: MsgUnPoolWhitelistedPool, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + + if (!message.poolId.isZero()) { + writer.uint32(16).uint64(message.poolId); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUnPoolWhitelistedPool { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUnPoolWhitelistedPool(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + + case 2: + message.poolId = (reader.uint64() as Long); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): MsgUnPoolWhitelistedPool { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + poolId: isSet(object.poolId) ? Long.fromString(object.poolId) : Long.UZERO + }; + }, + + toJSON(message: MsgUnPoolWhitelistedPool): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.poolId !== undefined && (obj.poolId = (message.poolId || Long.UZERO).toString()); + return obj; + }, + + fromPartial(object: DeepPartial): MsgUnPoolWhitelistedPool { + const message = createBaseMsgUnPoolWhitelistedPool(); + message.sender = object.sender ?? ""; + message.poolId = object.poolId !== undefined && object.poolId !== null ? Long.fromValue(object.poolId) : Long.UZERO; + return message; + } + +}; + +function createBaseMsgUnPoolWhitelistedPoolResponse(): MsgUnPoolWhitelistedPoolResponse { + return { + exitedLockIds: [] + }; +} + +export const MsgUnPoolWhitelistedPoolResponse = { + encode(message: MsgUnPoolWhitelistedPoolResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + writer.uint32(10).fork(); + + for (const v of message.exitedLockIds) { + writer.uint64(v); + } + + writer.ldelim(); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgUnPoolWhitelistedPoolResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgUnPoolWhitelistedPoolResponse(); + + 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.exitedLockIds.push((reader.uint64() as Long)); + } + } else { + message.exitedLockIds.push((reader.uint64() as Long)); + } + + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): MsgUnPoolWhitelistedPoolResponse { + return { + exitedLockIds: Array.isArray(object?.exitedLockIds) ? object.exitedLockIds.map((e: any) => Long.fromString(e)) : [] + }; + }, + + toJSON(message: MsgUnPoolWhitelistedPoolResponse): unknown { + const obj: any = {}; + + if (message.exitedLockIds) { + obj.exitedLockIds = message.exitedLockIds.map(e => (e || Long.UZERO).toString()); + } else { + obj.exitedLockIds = []; + } + + return obj; + }, + + fromPartial(object: DeepPartial): MsgUnPoolWhitelistedPoolResponse { + const message = createBaseMsgUnPoolWhitelistedPoolResponse(); + message.exitedLockIds = object.exitedLockIds?.map(e => Long.fromValue(e)) || []; + return message; + } + }; \ No newline at end of file diff --git a/__fixtures__/output1/osmosis/tokenfactory/v1beta1/authorityMetadata.ts b/__fixtures__/output1/osmosis/tokenfactory/v1beta1/authorityMetadata.ts new file mode 100644 index 0000000000..64a0106136 --- /dev/null +++ b/__fixtures__/output1/osmosis/tokenfactory/v1beta1/authorityMetadata.ts @@ -0,0 +1,70 @@ +import * as _m0 from "protobufjs/minimal"; +import { isSet, DeepPartial } from "@osmonauts/helpers"; +export const protobufPackage = "osmosis.tokenfactory.v1beta1"; + +/** + * DenomAuthorityMetadata specifies metadata for addresses that have specific + * capabilities over a token factory denom. Right now there is only one Admin + * permission, but is planned to be extended to the future. + */ +export interface DenomAuthorityMetadata { + /** Can be empty for no admin, or a valid osmosis address */ + Admin: string; +} + +function createBaseDenomAuthorityMetadata(): DenomAuthorityMetadata { + return { + Admin: "" + }; +} + +export const DenomAuthorityMetadata = { + encode(message: DenomAuthorityMetadata, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.Admin !== "") { + writer.uint32(10).string(message.Admin); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DenomAuthorityMetadata { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDenomAuthorityMetadata(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.Admin = reader.string(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): DenomAuthorityMetadata { + return { + Admin: isSet(object.Admin) ? String(object.Admin) : "" + }; + }, + + toJSON(message: DenomAuthorityMetadata): unknown { + const obj: any = {}; + message.Admin !== undefined && (obj.Admin = message.Admin); + return obj; + }, + + fromPartial(object: DeepPartial): DenomAuthorityMetadata { + const message = createBaseDenomAuthorityMetadata(); + message.Admin = object.Admin ?? ""; + return message; + } + +}; \ No newline at end of file diff --git a/__fixtures__/output1/osmosis/tokenfactory/v1beta1/genesis.ts b/__fixtures__/output1/osmosis/tokenfactory/v1beta1/genesis.ts new file mode 100644 index 0000000000..762a744de1 --- /dev/null +++ b/__fixtures__/output1/osmosis/tokenfactory/v1beta1/genesis.ts @@ -0,0 +1,160 @@ +import { Params } from "./params"; +import { DenomAuthorityMetadata } from "./authorityMetadata"; +import * as _m0 from "protobufjs/minimal"; +import { isSet, DeepPartial } from "@osmonauts/helpers"; +export const protobufPackage = "osmosis.tokenfactory.v1beta1"; + +/** GenesisState defines the tokenfactory module's genesis state. */ +export interface GenesisState { + /** params defines the paramaters of the module. */ + params: Params; + factoryDenoms: GenesisDenom[]; +} +export interface GenesisDenom { + denom: string; + authorityMetadata: DenomAuthorityMetadata; +} + +function createBaseGenesisState(): GenesisState { + return { + params: undefined, + factoryDenoms: [] + }; +} + +export const GenesisState = { + encode(message: GenesisState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.params !== undefined) { + Params.encode(message.params, writer.uint32(10).fork()).ldelim(); + } + + for (const v of message.factoryDenoms) { + GenesisDenom.encode(v!, writer.uint32(18).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.params = Params.decode(reader, reader.uint32()); + break; + + case 2: + message.factoryDenoms.push(GenesisDenom.decode(reader, reader.uint32())); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): GenesisState { + return { + params: isSet(object.params) ? Params.fromJSON(object.params) : undefined, + factoryDenoms: Array.isArray(object?.factoryDenoms) ? object.factoryDenoms.map((e: any) => GenesisDenom.fromJSON(e)) : [] + }; + }, + + toJSON(message: GenesisState): unknown { + const obj: any = {}; + message.params !== undefined && (obj.params = message.params ? Params.toJSON(message.params) : undefined); + + if (message.factoryDenoms) { + obj.factoryDenoms = message.factoryDenoms.map(e => e ? GenesisDenom.toJSON(e) : undefined); + } else { + obj.factoryDenoms = []; + } + + return obj; + }, + + fromPartial(object: DeepPartial): GenesisState { + const message = createBaseGenesisState(); + message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined; + message.factoryDenoms = object.factoryDenoms?.map(e => GenesisDenom.fromPartial(e)) || []; + return message; + } + +}; + +function createBaseGenesisDenom(): GenesisDenom { + return { + denom: "", + authorityMetadata: undefined + }; +} + +export const GenesisDenom = { + encode(message: GenesisDenom, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.denom !== "") { + writer.uint32(10).string(message.denom); + } + + if (message.authorityMetadata !== undefined) { + DenomAuthorityMetadata.encode(message.authorityMetadata, writer.uint32(18).fork()).ldelim(); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenesisDenom { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenesisDenom(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.denom = reader.string(); + break; + + case 2: + message.authorityMetadata = DenomAuthorityMetadata.decode(reader, reader.uint32()); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): GenesisDenom { + return { + denom: isSet(object.denom) ? String(object.denom) : "", + authorityMetadata: isSet(object.authorityMetadata) ? DenomAuthorityMetadata.fromJSON(object.authorityMetadata) : undefined + }; + }, + + toJSON(message: GenesisDenom): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + message.authorityMetadata !== undefined && (obj.authorityMetadata = message.authorityMetadata ? DenomAuthorityMetadata.toJSON(message.authorityMetadata) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): GenesisDenom { + const message = createBaseGenesisDenom(); + message.denom = object.denom ?? ""; + message.authorityMetadata = object.authorityMetadata !== undefined && object.authorityMetadata !== null ? DenomAuthorityMetadata.fromPartial(object.authorityMetadata) : undefined; + return message; + } + +}; \ No newline at end of file diff --git a/__fixtures__/output1/osmosis/tokenfactory/v1beta1/params.ts b/__fixtures__/output1/osmosis/tokenfactory/v1beta1/params.ts new file mode 100644 index 0000000000..c051818fbe --- /dev/null +++ b/__fixtures__/output1/osmosis/tokenfactory/v1beta1/params.ts @@ -0,0 +1,72 @@ +import { Coin } from "../../../cosmos/base/v1beta1/coin"; +import * as _m0 from "protobufjs/minimal"; +import { DeepPartial } from "@osmonauts/helpers"; +export const protobufPackage = "osmosis.tokenfactory.v1beta1"; + +/** Params holds parameters for the tokenfactory module */ +export interface Params { + denomCreationFee: Coin[]; +} + +function createBaseParams(): Params { + return { + denomCreationFee: [] + }; +} + +export const Params = { + encode(message: Params, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.denomCreationFee) { + Coin.encode(v!, writer.uint32(10).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.denomCreationFee.push(Coin.decode(reader, reader.uint32())); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): Params { + return { + denomCreationFee: Array.isArray(object?.denomCreationFee) ? object.denomCreationFee.map((e: any) => Coin.fromJSON(e)) : [] + }; + }, + + toJSON(message: Params): unknown { + const obj: any = {}; + + if (message.denomCreationFee) { + obj.denomCreationFee = message.denomCreationFee.map(e => e ? Coin.toJSON(e) : undefined); + } else { + obj.denomCreationFee = []; + } + + return obj; + }, + + fromPartial(object: DeepPartial): Params { + const message = createBaseParams(); + message.denomCreationFee = object.denomCreationFee?.map(e => Coin.fromPartial(e)) || []; + return message; + } + +}; \ No newline at end of file diff --git a/__fixtures__/output1/osmosis/tokenfactory/v1beta1/query.lcd.ts b/__fixtures__/output1/osmosis/tokenfactory/v1beta1/query.lcd.ts new file mode 100644 index 0000000000..eb3721b35a --- /dev/null +++ b/__fixtures__/output1/osmosis/tokenfactory/v1beta1/query.lcd.ts @@ -0,0 +1,32 @@ +import { Params } from "./params"; +import { DenomAuthorityMetadata } from "./authorityMetadata"; +import { LCDClient } from "@osmonauts/lcd"; +import { QueryParamsRequest, QueryParamsResponse, QueryDenomAuthorityMetadataRequest, QueryDenomAuthorityMetadataResponse, QueryDenomsFromCreatorRequest, QueryDenomsFromCreatorResponse } from "./query"; +export class LCDQueryClient extends LCDClient { + constructor({ + restEndpoint + }) { + super({ + restEndpoint + }); + } + + /* Params returns the total set of minting parameters. */ + async params(params: QueryParamsRequest): Promise { + const endpoint = `osmosis/tokenfactory/v1beta1/params/`; + return await this.request(endpoint); + } + + /* DenomAuthorityMetadata */ + async denomAuthorityMetadata(params: QueryDenomAuthorityMetadataRequest): Promise { + const endpoint = `osmosis/tokenfactory/v1beta1/denoms/${params.denom}/authority_metadata`; + return await this.request(endpoint); + } + + /* DenomsFromCreator */ + async denomsFromCreator(params: QueryDenomsFromCreatorRequest): Promise { + const endpoint = `osmosis/tokenfactory/v1beta1/denoms_from_creator/${params.creator}`; + return await this.request(endpoint); + } + +} \ No newline at end of file diff --git a/__fixtures__/output1/osmosis/tokenfactory/v1beta1/query.ts b/__fixtures__/output1/osmosis/tokenfactory/v1beta1/query.ts new file mode 100644 index 0000000000..64c669394e --- /dev/null +++ b/__fixtures__/output1/osmosis/tokenfactory/v1beta1/query.ts @@ -0,0 +1,360 @@ +import { Params } from "./params"; +import { DenomAuthorityMetadata } from "./authorityMetadata"; +import * as _m0 from "protobufjs/minimal"; +import { DeepPartial, isSet } from "@osmonauts/helpers"; +export const protobufPackage = "osmosis.tokenfactory.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; +} +export interface QueryDenomAuthorityMetadataRequest { + denom: string; +} +export interface QueryDenomAuthorityMetadataResponse { + authorityMetadata: DenomAuthorityMetadata; +} +export interface QueryDenomsFromCreatorRequest { + creator: string; +} +export interface QueryDenomsFromCreatorResponse { + denoms: string[]; +} + +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; + } + +}; + +function createBaseQueryDenomAuthorityMetadataRequest(): QueryDenomAuthorityMetadataRequest { + return { + denom: "" + }; +} + +export const QueryDenomAuthorityMetadataRequest = { + encode(message: QueryDenomAuthorityMetadataRequest, 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): QueryDenomAuthorityMetadataRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomAuthorityMetadataRequest(); + + 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): QueryDenomAuthorityMetadataRequest { + return { + denom: isSet(object.denom) ? String(object.denom) : "" + }; + }, + + toJSON(message: QueryDenomAuthorityMetadataRequest): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + return obj; + }, + + fromPartial(object: DeepPartial): QueryDenomAuthorityMetadataRequest { + const message = createBaseQueryDenomAuthorityMetadataRequest(); + message.denom = object.denom ?? ""; + return message; + } + +}; + +function createBaseQueryDenomAuthorityMetadataResponse(): QueryDenomAuthorityMetadataResponse { + return { + authorityMetadata: undefined + }; +} + +export const QueryDenomAuthorityMetadataResponse = { + encode(message: QueryDenomAuthorityMetadataResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.authorityMetadata !== undefined) { + DenomAuthorityMetadata.encode(message.authorityMetadata, writer.uint32(10).fork()).ldelim(); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomAuthorityMetadataResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomAuthorityMetadataResponse(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.authorityMetadata = DenomAuthorityMetadata.decode(reader, reader.uint32()); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): QueryDenomAuthorityMetadataResponse { + return { + authorityMetadata: isSet(object.authorityMetadata) ? DenomAuthorityMetadata.fromJSON(object.authorityMetadata) : undefined + }; + }, + + toJSON(message: QueryDenomAuthorityMetadataResponse): unknown { + const obj: any = {}; + message.authorityMetadata !== undefined && (obj.authorityMetadata = message.authorityMetadata ? DenomAuthorityMetadata.toJSON(message.authorityMetadata) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): QueryDenomAuthorityMetadataResponse { + const message = createBaseQueryDenomAuthorityMetadataResponse(); + message.authorityMetadata = object.authorityMetadata !== undefined && object.authorityMetadata !== null ? DenomAuthorityMetadata.fromPartial(object.authorityMetadata) : undefined; + return message; + } + +}; + +function createBaseQueryDenomsFromCreatorRequest(): QueryDenomsFromCreatorRequest { + return { + creator: "" + }; +} + +export const QueryDenomsFromCreatorRequest = { + encode(message: QueryDenomsFromCreatorRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.creator !== "") { + writer.uint32(10).string(message.creator); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomsFromCreatorRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomsFromCreatorRequest(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.creator = reader.string(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): QueryDenomsFromCreatorRequest { + return { + creator: isSet(object.creator) ? String(object.creator) : "" + }; + }, + + toJSON(message: QueryDenomsFromCreatorRequest): unknown { + const obj: any = {}; + message.creator !== undefined && (obj.creator = message.creator); + return obj; + }, + + fromPartial(object: DeepPartial): QueryDenomsFromCreatorRequest { + const message = createBaseQueryDenomsFromCreatorRequest(); + message.creator = object.creator ?? ""; + return message; + } + +}; + +function createBaseQueryDenomsFromCreatorResponse(): QueryDenomsFromCreatorResponse { + return { + denoms: [] + }; +} + +export const QueryDenomsFromCreatorResponse = { + encode(message: QueryDenomsFromCreatorResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.denoms) { + writer.uint32(10).string(v!); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomsFromCreatorResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomsFromCreatorResponse(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.denoms.push(reader.string()); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): QueryDenomsFromCreatorResponse { + return { + denoms: Array.isArray(object?.denoms) ? object.denoms.map((e: any) => String(e)) : [] + }; + }, + + toJSON(message: QueryDenomsFromCreatorResponse): unknown { + const obj: any = {}; + + if (message.denoms) { + obj.denoms = message.denoms.map(e => e); + } else { + obj.denoms = []; + } + + return obj; + }, + + fromPartial(object: DeepPartial): QueryDenomsFromCreatorResponse { + const message = createBaseQueryDenomsFromCreatorResponse(); + message.denoms = object.denoms?.map(e => e) || []; + return message; + } + +}; \ No newline at end of file diff --git a/__fixtures__/output1/osmosis/tokenfactory/v1beta1/tx.amino.ts b/__fixtures__/output1/osmosis/tokenfactory/v1beta1/tx.amino.ts new file mode 100644 index 0000000000..d60747b346 --- /dev/null +++ b/__fixtures__/output1/osmosis/tokenfactory/v1beta1/tx.amino.ts @@ -0,0 +1,140 @@ +import { Coin } from "../../../cosmos/base/v1beta1/coin"; +import { AminoMsg } from "@cosmjs/amino"; +import { MsgCreateDenom, MsgMint, MsgBurn, MsgChangeAdmin } from "./tx"; +export interface AminoMsgCreateDenom extends AminoMsg { + type: "osmosis/tokenfactory/create-denom"; + value: { + sender: string; + subdenom: string; + }; +} +export interface AminoMsgMint extends AminoMsg { + type: "osmosis/tokenfactory/mint"; + value: { + sender: string; + amount: { + denom: string; + amount: string; + }; + }; +} +export interface AminoMsgBurn extends AminoMsg { + type: "osmosis/tokenfactory/burn"; + value: { + sender: string; + amount: { + denom: string; + amount: string; + }; + }; +} +export interface AminoMsgChangeAdmin extends AminoMsg { + type: "osmosis/tokenfactory/change-admin"; + value: { + sender: string; + denom: string; + newAdmin: string; + }; +} +export const AminoConverter = { + "/osmosis.tokenfactory.v1beta1.MsgCreateDenom": { + aminoType: "osmosis/tokenfactory/create-denom", + toAmino: ({ + sender, + subdenom + }: MsgCreateDenom): AminoMsgCreateDenom["value"] => { + return { + sender, + subdenom + }; + }, + fromAmino: ({ + sender, + subdenom + }: AminoMsgCreateDenom["value"]): MsgCreateDenom => { + return { + sender, + subdenom + }; + } + }, + "/osmosis.tokenfactory.v1beta1.MsgMint": { + aminoType: "osmosis/tokenfactory/mint", + toAmino: ({ + sender, + amount + }: MsgMint): AminoMsgMint["value"] => { + return { + sender, + amount: { + denom: amount.denom, + amount: Long.fromNumber(amount.amount).toString() + } + }; + }, + fromAmino: ({ + sender, + amount + }: AminoMsgMint["value"]): MsgMint => { + return { + sender, + amount: { + denom: amount.denom, + amount: amount.amount + } + }; + } + }, + "/osmosis.tokenfactory.v1beta1.MsgBurn": { + aminoType: "osmosis/tokenfactory/burn", + toAmino: ({ + sender, + amount + }: MsgBurn): AminoMsgBurn["value"] => { + return { + sender, + amount: { + denom: amount.denom, + amount: Long.fromNumber(amount.amount).toString() + } + }; + }, + fromAmino: ({ + sender, + amount + }: AminoMsgBurn["value"]): MsgBurn => { + return { + sender, + amount: { + denom: amount.denom, + amount: amount.amount + } + }; + } + }, + "/osmosis.tokenfactory.v1beta1.MsgChangeAdmin": { + aminoType: "osmosis/tokenfactory/change-admin", + toAmino: ({ + sender, + denom, + newAdmin + }: MsgChangeAdmin): AminoMsgChangeAdmin["value"] => { + return { + sender, + denom, + newAdmin + }; + }, + fromAmino: ({ + sender, + denom, + newAdmin + }: AminoMsgChangeAdmin["value"]): MsgChangeAdmin => { + return { + sender, + denom, + newAdmin + }; + } + } +}; \ No newline at end of file diff --git a/__fixtures__/output1/osmosis/tokenfactory/v1beta1/tx.registry.ts b/__fixtures__/output1/osmosis/tokenfactory/v1beta1/tx.registry.ts new file mode 100644 index 0000000000..d06eaec79b --- /dev/null +++ b/__fixtures__/output1/osmosis/tokenfactory/v1beta1/tx.registry.ts @@ -0,0 +1,161 @@ +import { Coin } from "../../../cosmos/base/v1beta1/coin"; +import { GeneratedType, Registry } from "@cosmjs/proto-signing"; +import { MsgCreateDenom, MsgMint, MsgBurn, MsgChangeAdmin } from "./tx"; +export const registry: ReadonlyArray<[string, GeneratedType]> = [["/osmosis.tokenfactory.v1beta1.MsgCreateDenom", MsgCreateDenom], ["/osmosis.tokenfactory.v1beta1.MsgMint", MsgMint], ["/osmosis.tokenfactory.v1beta1.MsgBurn", MsgBurn], ["/osmosis.tokenfactory.v1beta1.MsgChangeAdmin", MsgChangeAdmin]]; +export const load = (protoRegistry: Registry) => { + registry.forEach(([typeUrl, mod]) => { + protoRegistry.register(typeUrl, mod); + }); +}; +export const MessageComposer = { + encoded: { + createDenom(value: MsgCreateDenom) { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgCreateDenom", + value: MsgCreateDenom.encode(value).finish() + }; + }, + + mint(value: MsgMint) { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgMint", + value: MsgMint.encode(value).finish() + }; + }, + + burn(value: MsgBurn) { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgBurn", + value: MsgBurn.encode(value).finish() + }; + }, + + changeAdmin(value: MsgChangeAdmin) { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgChangeAdmin", + value: MsgChangeAdmin.encode(value).finish() + }; + } + + }, + withTypeUrl: { + createDenom(value: MsgCreateDenom) { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgCreateDenom", + value + }; + }, + + mint(value: MsgMint) { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgMint", + value + }; + }, + + burn(value: MsgBurn) { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgBurn", + value + }; + }, + + changeAdmin(value: MsgChangeAdmin) { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgChangeAdmin", + value + }; + } + + }, + toJSON: { + createDenom(value: MsgCreateDenom) { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgCreateDenom", + value: MsgCreateDenom.toJSON(value) + }; + }, + + mint(value: MsgMint) { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgMint", + value: MsgMint.toJSON(value) + }; + }, + + burn(value: MsgBurn) { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgBurn", + value: MsgBurn.toJSON(value) + }; + }, + + changeAdmin(value: MsgChangeAdmin) { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgChangeAdmin", + value: MsgChangeAdmin.toJSON(value) + }; + } + + }, + fromJSON: { + createDenom(value: any) { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgCreateDenom", + value: MsgCreateDenom.fromJSON(value) + }; + }, + + mint(value: any) { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgMint", + value: MsgMint.fromJSON(value) + }; + }, + + burn(value: any) { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgBurn", + value: MsgBurn.fromJSON(value) + }; + }, + + changeAdmin(value: any) { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgChangeAdmin", + value: MsgChangeAdmin.fromJSON(value) + }; + } + + }, + fromPartial: { + createDenom(value: MsgCreateDenom) { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgCreateDenom", + value: MsgCreateDenom.fromPartial(value) + }; + }, + + mint(value: MsgMint) { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgMint", + value: MsgMint.fromPartial(value) + }; + }, + + burn(value: MsgBurn) { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgBurn", + value: MsgBurn.fromPartial(value) + }; + }, + + changeAdmin(value: MsgChangeAdmin) { + return { + typeUrl: "/osmosis.tokenfactory.v1beta1.MsgChangeAdmin", + value: MsgChangeAdmin.fromPartial(value) + }; + } + + } +}; \ No newline at end of file diff --git a/__fixtures__/output1/osmosis/tokenfactory/v1beta1/tx.ts b/__fixtures__/output1/osmosis/tokenfactory/v1beta1/tx.ts new file mode 100644 index 0000000000..8ba8bb490a --- /dev/null +++ b/__fixtures__/output1/osmosis/tokenfactory/v1beta1/tx.ts @@ -0,0 +1,533 @@ +import { Coin } from "../../../cosmos/base/v1beta1/coin"; +import * as _m0 from "protobufjs/minimal"; +import { isSet, DeepPartial } from "@osmonauts/helpers"; +export const protobufPackage = "osmosis.tokenfactory.v1beta1"; + +/** + * MsgCreateDenom is the sdk.Msg type for allowing an account to create + * a new denom. It requires a sender address and a subdenomination. + * The (sender_address, sub_denomination) pair must be unique and cannot be + * re-used. The resulting denom created is `factory/{creator + * address}/{subdenom}`. The resultant denom's admin is originally set to be the + * creator, but this can be changed later. The token denom does not indicate the + * current admin. + */ +export interface MsgCreateDenom { + sender: string; + + /** subdenom can be up to 44 "alphanumeric" characters long. */ + subdenom: string; +} + +/** + * MsgCreateDenomResponse is the return value of MsgCreateDenom + * It returns the full string of the newly created denom + */ +export interface MsgCreateDenomResponse { + newTokenDenom: string; +} + +/** + * MsgMint is the sdk.Msg type for allowing an admin account to mint + * more of a token. For now, we only support minting to the sender account + */ +export interface MsgMint { + sender: string; + amount: Coin; +} +export interface MsgMintResponse {} + +/** + * MsgBurn is the sdk.Msg type for allowing an admin account to burn + * a token. For now, we only support burning from the sender account. + */ +export interface MsgBurn { + sender: string; + amount: Coin; +} +export interface MsgBurnResponse {} + +/** + * MsgChangeAdmin is the sdk.Msg type for allowing an admin account to reassign + * adminship of a denom to a new account + */ +export interface MsgChangeAdmin { + sender: string; + denom: string; + newAdmin: string; +} +export interface MsgChangeAdminResponse {} + +function createBaseMsgCreateDenom(): MsgCreateDenom { + return { + sender: "", + subdenom: "" + }; +} + +export const MsgCreateDenom = { + encode(message: MsgCreateDenom, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + + if (message.subdenom !== "") { + writer.uint32(18).string(message.subdenom); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateDenom { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateDenom(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + + case 2: + message.subdenom = reader.string(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): MsgCreateDenom { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + subdenom: isSet(object.subdenom) ? String(object.subdenom) : "" + }; + }, + + toJSON(message: MsgCreateDenom): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.subdenom !== undefined && (obj.subdenom = message.subdenom); + return obj; + }, + + fromPartial(object: DeepPartial): MsgCreateDenom { + const message = createBaseMsgCreateDenom(); + message.sender = object.sender ?? ""; + message.subdenom = object.subdenom ?? ""; + return message; + } + +}; + +function createBaseMsgCreateDenomResponse(): MsgCreateDenomResponse { + return { + newTokenDenom: "" + }; +} + +export const MsgCreateDenomResponse = { + encode(message: MsgCreateDenomResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.newTokenDenom !== "") { + writer.uint32(10).string(message.newTokenDenom); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateDenomResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgCreateDenomResponse(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.newTokenDenom = reader.string(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): MsgCreateDenomResponse { + return { + newTokenDenom: isSet(object.newTokenDenom) ? String(object.newTokenDenom) : "" + }; + }, + + toJSON(message: MsgCreateDenomResponse): unknown { + const obj: any = {}; + message.newTokenDenom !== undefined && (obj.newTokenDenom = message.newTokenDenom); + return obj; + }, + + fromPartial(object: DeepPartial): MsgCreateDenomResponse { + const message = createBaseMsgCreateDenomResponse(); + message.newTokenDenom = object.newTokenDenom ?? ""; + return message; + } + +}; + +function createBaseMsgMint(): MsgMint { + return { + sender: "", + amount: undefined + }; +} + +export const MsgMint = { + encode(message: MsgMint, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(18).fork()).ldelim(); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgMint { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgMint(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + + case 2: + message.amount = Coin.decode(reader, reader.uint32()); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): MsgMint { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + amount: isSet(object.amount) ? Coin.fromJSON(object.amount) : undefined + }; + }, + + toJSON(message: MsgMint): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): MsgMint { + const message = createBaseMsgMint(); + message.sender = object.sender ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + } + +}; + +function createBaseMsgMintResponse(): MsgMintResponse { + return {}; +} + +export const MsgMintResponse = { + encode(_: MsgMintResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgMintResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgMintResponse(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(_: any): MsgMintResponse { + return {}; + }, + + toJSON(_: MsgMintResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): MsgMintResponse { + const message = createBaseMsgMintResponse(); + return message; + } + +}; + +function createBaseMsgBurn(): MsgBurn { + return { + sender: "", + amount: undefined + }; +} + +export const MsgBurn = { + encode(message: MsgBurn, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + + if (message.amount !== undefined) { + Coin.encode(message.amount, writer.uint32(18).fork()).ldelim(); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgBurn { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBurn(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + + case 2: + message.amount = Coin.decode(reader, reader.uint32()); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): MsgBurn { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + amount: isSet(object.amount) ? Coin.fromJSON(object.amount) : undefined + }; + }, + + toJSON(message: MsgBurn): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.amount !== undefined && (obj.amount = message.amount ? Coin.toJSON(message.amount) : undefined); + return obj; + }, + + fromPartial(object: DeepPartial): MsgBurn { + const message = createBaseMsgBurn(); + message.sender = object.sender ?? ""; + message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined; + return message; + } + +}; + +function createBaseMsgBurnResponse(): MsgBurnResponse { + return {}; +} + +export const MsgBurnResponse = { + encode(_: MsgBurnResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgBurnResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgBurnResponse(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(_: any): MsgBurnResponse { + return {}; + }, + + toJSON(_: MsgBurnResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): MsgBurnResponse { + const message = createBaseMsgBurnResponse(); + return message; + } + +}; + +function createBaseMsgChangeAdmin(): MsgChangeAdmin { + return { + sender: "", + denom: "", + newAdmin: "" + }; +} + +export const MsgChangeAdmin = { + encode(message: MsgChangeAdmin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.sender !== "") { + writer.uint32(10).string(message.sender); + } + + if (message.denom !== "") { + writer.uint32(18).string(message.denom); + } + + if (message.newAdmin !== "") { + writer.uint32(26).string(message.newAdmin); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgChangeAdmin { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChangeAdmin(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.sender = reader.string(); + break; + + case 2: + message.denom = reader.string(); + break; + + case 3: + message.newAdmin = reader.string(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): MsgChangeAdmin { + return { + sender: isSet(object.sender) ? String(object.sender) : "", + denom: isSet(object.denom) ? String(object.denom) : "", + newAdmin: isSet(object.newAdmin) ? String(object.newAdmin) : "" + }; + }, + + toJSON(message: MsgChangeAdmin): unknown { + const obj: any = {}; + message.sender !== undefined && (obj.sender = message.sender); + message.denom !== undefined && (obj.denom = message.denom); + message.newAdmin !== undefined && (obj.newAdmin = message.newAdmin); + return obj; + }, + + fromPartial(object: DeepPartial): MsgChangeAdmin { + const message = createBaseMsgChangeAdmin(); + message.sender = object.sender ?? ""; + message.denom = object.denom ?? ""; + message.newAdmin = object.newAdmin ?? ""; + return message; + } + +}; + +function createBaseMsgChangeAdminResponse(): MsgChangeAdminResponse { + return {}; +} + +export const MsgChangeAdminResponse = { + encode(_: MsgChangeAdminResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MsgChangeAdminResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMsgChangeAdminResponse(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(_: any): MsgChangeAdminResponse { + return {}; + }, + + toJSON(_: MsgChangeAdminResponse): unknown { + const obj: any = {}; + return obj; + }, + + fromPartial(_: DeepPartial): MsgChangeAdminResponse { + const message = createBaseMsgChangeAdminResponse(); + return message; + } + +}; \ No newline at end of file diff --git a/__fixtures__/output1/osmosis/txfees/v1beta1/query.lcd.ts b/__fixtures__/output1/osmosis/txfees/v1beta1/query.lcd.ts index dbf984f329..f7e49a7aed 100644 --- a/__fixtures__/output1/osmosis/txfees/v1beta1/query.lcd.ts +++ b/__fixtures__/output1/osmosis/txfees/v1beta1/query.lcd.ts @@ -1,6 +1,6 @@ import { FeeToken } from "./feetoken"; import { LCDClient } from "@osmonauts/lcd"; -import { QueryFeeTokensRequest, QueryFeeTokensResponse, QueryDenomPoolIdRequest, QueryDenomPoolIdResponse, QueryBaseDenomRequest, QueryBaseDenomResponse } from "./query"; +import { QueryFeeTokensRequest, QueryFeeTokensResponse, QueryDenomSpotPriceRequest, QueryDenomSpotPriceResponse, QueryDenomPoolIdRequest, QueryDenomPoolIdResponse, QueryBaseDenomRequest, QueryBaseDenomResponse } from "./query"; export class LCDQueryClient extends LCDClient { constructor({ restEndpoint @@ -18,6 +18,20 @@ export class LCDQueryClient extends LCDClient { return await this.request(endpoint); } + /* DenomSpotPrice */ + async denomSpotPrice(params: QueryDenomSpotPriceRequest): Promise { + const options: any = { + params: {} + }; + + if (typeof params?.denom !== "undefined") { + options.params.denom = params.denom; + } + + const endpoint = `osmosis/txfees/v1beta1/spot_price_by_denom/`; + return await this.request(endpoint, options); + } + /* DenomPoolId */ async denomPoolId(params: QueryDenomPoolIdRequest): Promise { const endpoint = `osmosis/txfees/v1beta1/denom_pool_id/${params.denom}`; diff --git a/__fixtures__/output1/osmosis/txfees/v1beta1/query.ts b/__fixtures__/output1/osmosis/txfees/v1beta1/query.ts index 6ff77c22e1..5c8cfd5138 100644 --- a/__fixtures__/output1/osmosis/txfees/v1beta1/query.ts +++ b/__fixtures__/output1/osmosis/txfees/v1beta1/query.ts @@ -6,6 +6,23 @@ export interface QueryFeeTokensRequest {} export interface QueryFeeTokensResponse { feeTokens: FeeToken[]; } + +/** + * QueryDenomSpotPriceRequest defines grpc request structure for querying spot + * price for the specified tx fee denom + */ +export interface QueryDenomSpotPriceRequest { + denom: string; +} + +/** + * QueryDenomSpotPriceRequest defines grpc response structure for querying spot + * price for the specified tx fee denom + */ +export interface QueryDenomSpotPriceResponse { + poolID: Long; + spotPrice: string; +} export interface QueryDenomPoolIdRequest { denom: string; } @@ -123,6 +140,132 @@ export const QueryFeeTokensResponse = { }; +function createBaseQueryDenomSpotPriceRequest(): QueryDenomSpotPriceRequest { + return { + denom: "" + }; +} + +export const QueryDenomSpotPriceRequest = { + encode(message: QueryDenomSpotPriceRequest, 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): QueryDenomSpotPriceRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomSpotPriceRequest(); + + 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): QueryDenomSpotPriceRequest { + return { + denom: isSet(object.denom) ? String(object.denom) : "" + }; + }, + + toJSON(message: QueryDenomSpotPriceRequest): unknown { + const obj: any = {}; + message.denom !== undefined && (obj.denom = message.denom); + return obj; + }, + + fromPartial(object: DeepPartial): QueryDenomSpotPriceRequest { + const message = createBaseQueryDenomSpotPriceRequest(); + message.denom = object.denom ?? ""; + return message; + } + +}; + +function createBaseQueryDenomSpotPriceResponse(): QueryDenomSpotPriceResponse { + return { + poolID: Long.UZERO, + spotPrice: "" + }; +} + +export const QueryDenomSpotPriceResponse = { + encode(message: QueryDenomSpotPriceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (!message.poolID.isZero()) { + writer.uint32(8).uint64(message.poolID); + } + + if (message.spotPrice !== "") { + writer.uint32(18).string(message.spotPrice); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryDenomSpotPriceResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryDenomSpotPriceResponse(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.poolID = (reader.uint64() as Long); + break; + + case 2: + message.spotPrice = reader.string(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromJSON(object: any): QueryDenomSpotPriceResponse { + return { + poolID: isSet(object.poolID) ? Long.fromString(object.poolID) : Long.UZERO, + spotPrice: isSet(object.spotPrice) ? String(object.spotPrice) : "" + }; + }, + + toJSON(message: QueryDenomSpotPriceResponse): unknown { + const obj: any = {}; + message.poolID !== undefined && (obj.poolID = (message.poolID || Long.UZERO).toString()); + message.spotPrice !== undefined && (obj.spotPrice = message.spotPrice); + return obj; + }, + + fromPartial(object: DeepPartial): QueryDenomSpotPriceResponse { + const message = createBaseQueryDenomSpotPriceResponse(); + message.poolID = object.poolID !== undefined && object.poolID !== null ? Long.fromValue(object.poolID) : Long.UZERO; + message.spotPrice = object.spotPrice ?? ""; + return message; + } + +}; + function createBaseQueryDenomPoolIdRequest(): QueryDenomPoolIdRequest { return { denom: "" diff --git a/__fixtures__/output1/secret/bundle.ts b/__fixtures__/output1/secret/bundle.ts index f9dd76e901..42908d44b1 100644 --- a/__fixtures__/output1/secret/bundle.ts +++ b/__fixtures__/output1/secret/bundle.ts @@ -1,32 +1,32 @@ -import * as _292 from "./compute/v1beta1/genesis"; -import * as _293 from "./compute/v1beta1/msg"; -import * as _294 from "./compute/v1beta1/query"; -import * as _295 from "./compute/v1beta1/types"; -import * as _296 from "./registration/v1beta1/genesis"; -import * as _297 from "./registration/v1beta1/msg"; -import * as _298 from "./registration/v1beta1/query"; -import * as _299 from "./registration/v1beta1/types"; -import * as _300 from "./registration/v1beta1/remote_attestation/types"; -import * as _425 from "./compute/v1beta1/query.lcd"; -import * as _426 from "./registration/v1beta1/query.lcd"; +import * as _299 from "./compute/v1beta1/genesis"; +import * as _300 from "./compute/v1beta1/msg"; +import * as _301 from "./compute/v1beta1/query"; +import * as _302 from "./compute/v1beta1/types"; +import * as _303 from "./registration/v1beta1/genesis"; +import * as _304 from "./registration/v1beta1/msg"; +import * as _305 from "./registration/v1beta1/query"; +import * as _306 from "./registration/v1beta1/types"; +import * as _307 from "./registration/v1beta1/remote_attestation/types"; +import * as _439 from "./compute/v1beta1/query.lcd"; +import * as _440 from "./registration/v1beta1/query.lcd"; export namespace secret { export namespace compute { - export const v1beta1 = { ..._292, - ..._293, - ..._294, - ..._295, - ..._425 + export const v1beta1 = { ..._299, + ..._300, + ..._301, + ..._302, + ..._439 }; } export namespace registration { - export const v1beta1 = { ..._296, - ..._297, - ..._298, - ..._299, - ..._426 + export const v1beta1 = { ..._303, + ..._304, + ..._305, + ..._306, + ..._440 }; export namespace remote_attestation { - export const v1beta1 = { ..._300 + export const v1beta1 = { ..._307 }; } } diff --git a/__fixtures__/output1/tendermint/bundle.ts b/__fixtures__/output1/tendermint/bundle.ts index 578d2ef311..6417f103a3 100644 --- a/__fixtures__/output1/tendermint/bundle.ts +++ b/__fixtures__/output1/tendermint/bundle.ts @@ -1,32 +1,32 @@ -import * as _301 from "./abci/types"; -import * as _302 from "./crypto/keys"; -import * as _303 from "./crypto/proof"; -import * as _304 from "./libs/bits/types"; -import * as _305 from "./p2p/types"; -import * as _306 from "./types/block"; -import * as _307 from "./types/evidence"; -import * as _308 from "./types/params"; -import * as _309 from "./types/types"; -import * as _310 from "./types/validator"; -import * as _311 from "./version/types"; +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"; export namespace tendermint { - export const abci = { ..._301 + export const abci = { ..._308 }; - export const crypto = { ..._302, - ..._303 + export const crypto = { ..._309, + ..._310 }; export namespace libs { - export const bits = { ..._304 + export const bits = { ..._311 }; } - export const p2p = { ..._305 + export const p2p = { ..._312 }; - export const types = { ..._306, - ..._307, - ..._308, - ..._309, - ..._310 + export const types = { ..._313, + ..._314, + ..._315, + ..._316, + ..._317 }; - export const version = { ..._311 + export const version = { ..._318 }; } \ No newline at end of file diff --git a/packages/ast/src/clients/lcd/__snapshots__/lcd.test.ts.snap b/packages/ast/src/clients/lcd/__snapshots__/lcd.test.ts.snap index d4b01a5fdd..61169232fa 100644 --- a/packages/ast/src/clients/lcd/__snapshots__/lcd.test.ts.snap +++ b/packages/ast/src/clients/lcd/__snapshots__/lcd.test.ts.snap @@ -173,18 +173,19 @@ exports[`AggregatedLCDClient 1`] = ` return await this.request(endpoint); } - /* SpotPrice */ + /* 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?.tokenInDenom !== \\"undefined\\") { - options.params.token_in_denom = params.tokenInDenom; + if (typeof params?.baseAssetDenom !== \\"undefined\\") { + options.params.base_asset_denom = params.baseAssetDenom; } - if (typeof params?.tokenOutDenom !== \\"undefined\\") { - options.params.token_out_denom = params.tokenOutDenom; + if (typeof params?.quoteAssetDenom !== \\"undefined\\") { + options.params.quote_asset_denom = params.quoteAssetDenom; } const endpoint = \`osmosis/gamm/v1beta1/pools/\${params.poolId}/prices\`; @@ -474,18 +475,19 @@ exports[`osmosis LCDClient 1`] = ` return await this.request(endpoint); } - /* SpotPrice */ + /* 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?.tokenInDenom !== \\"undefined\\") { - options.params.token_in_denom = params.tokenInDenom; + if (typeof params?.baseAssetDenom !== \\"undefined\\") { + options.params.base_asset_denom = params.baseAssetDenom; } - if (typeof params?.tokenOutDenom !== \\"undefined\\") { - options.params.token_out_denom = params.tokenOutDenom; + if (typeof params?.quoteAssetDenom !== \\"undefined\\") { + options.params.quote_asset_denom = params.quoteAssetDenom; } const endpoint = \`osmosis/gamm/v1beta1/pools/\${params.poolId}/prices\`; diff --git a/packages/parser/__tests__/__snapshots__/deps.test.ts.snap b/packages/parser/__tests__/__snapshots__/deps.test.ts.snap index d9966141c1..6c7bfa55ee 100644 --- a/packages/parser/__tests__/__snapshots__/deps.test.ts.snap +++ b/packages/parser/__tests__/__snapshots__/deps.test.ts.snap @@ -304,6 +304,8 @@ Array [ "osmosis/epochs/query.proto", "osmosis/gamm/pool-models/balancer/balancerPool.proto", "osmosis/gamm/pool-models/balancer/tx.proto", + "osmosis/gamm/pool-models/stableswap/stableswap_pool.proto", + "osmosis/gamm/pool-models/stableswap/tx.proto", "osmosis/gamm/v1beta1/genesis.proto", "osmosis/gamm/v1beta1/tx.proto", "osmosis/gamm/v1beta1/query.proto", @@ -330,6 +332,11 @@ Array [ "osmosis/superfluid/gov.proto", "osmosis/superfluid/query.proto", "osmosis/superfluid/tx.proto", + "osmosis/tokenfactory/v1beta1/authorityMetadata.proto", + "osmosis/tokenfactory/v1beta1/params.proto", + "osmosis/tokenfactory/v1beta1/genesis.proto", + "osmosis/tokenfactory/v1beta1/query.proto", + "osmosis/tokenfactory/v1beta1/tx.proto", "osmosis/txfees/v1beta1/feetoken.proto", "osmosis/txfees/v1beta1/genesis.proto", "osmosis/txfees/v1beta1/gov.proto", diff --git a/packages/parser/__tests__/__snapshots__/queries.test.ts.snap b/packages/parser/__tests__/__snapshots__/queries.test.ts.snap index 30bf2d9398..e1bbf93513 100644 --- a/packages/parser/__tests__/__snapshots__/queries.test.ts.snap +++ b/packages/parser/__tests__/__snapshots__/queries.test.ts.snap @@ -331,8 +331,26 @@ Object { "type": "ServiceMethod", }, "SpotPrice": Object { - "comment": null, + "comment": "SpotPrice defines a gRPC query handler that returns the spot price given +a base denomination and a quote denomination.", "fields": Object { + "baseAssetDenom": Object { + "comment": null, + "id": 2, + "isScalar": true, + "options": Object { + "(gogoproto.moretags)": "yaml:base_asset_denom", + "(telescope:camel)": "baseAssetDenom", + "(telescope:name)": "baseAssetDenom", + "(telescope:orig)": "base_asset_denom", + }, + "parsedType": Object { + "name": "string", + "type": "native", + }, + "type": "string", + "typeNum": 13, + }, "poolId": Object { "comment": null, "id": 1, @@ -350,32 +368,15 @@ Object { "type": "uint64", "typeNum": 8, }, - "tokenInDenom": Object { - "comment": null, - "id": 2, - "isScalar": true, - "options": Object { - "(gogoproto.moretags)": "yaml:token_in_denom", - "(telescope:camel)": "tokenInDenom", - "(telescope:name)": "tokenInDenom", - "(telescope:orig)": "tokenInDenom", - }, - "parsedType": Object { - "name": "string", - "type": "native", - }, - "type": "string", - "typeNum": 13, - }, - "tokenOutDenom": Object { + "quoteAssetDenom": Object { "comment": null, "id": 3, "isScalar": true, "options": Object { - "(gogoproto.moretags)": "yaml:token_out_denom", - "(telescope:camel)": "tokenOutDenom", - "(telescope:name)": "tokenOutDenom", - "(telescope:orig)": "tokenOutDenom", + "(gogoproto.moretags)": "yaml:quote_asset_denom", + "(telescope:camel)": "quoteAssetDenom", + "(telescope:name)": "quoteAssetDenom", + "(telescope:orig)": "quote_asset_denom", }, "parsedType": Object { "name": "string", @@ -390,8 +391,8 @@ Object { "poolId", ], "queryParams": Array [ - "tokenInDenom", - "tokenOutDenom", + "baseAssetDenom", + "quoteAssetDenom", ], "url": "/osmosis/gamm/v1beta1/pools/{poolId}/prices", }, @@ -738,8 +739,26 @@ Object { "type": "Type", }, "QuerySpotPriceRequest": Object { - "comment": "=============================== SpotPrice", + "comment": "QuerySpotPriceRequest defines the gRPC request structure for a SpotPrice +query.", "fields": Object { + "baseAssetDenom": Object { + "comment": null, + "id": 2, + "isScalar": true, + "options": Object { + "(gogoproto.moretags)": "yaml:base_asset_denom", + "(telescope:camel)": "baseAssetDenom", + "(telescope:name)": "baseAssetDenom", + "(telescope:orig)": "base_asset_denom", + }, + "parsedType": Object { + "name": "string", + "type": "native", + }, + "type": "string", + "typeNum": 13, + }, "poolId": Object { "comment": null, "id": 1, @@ -757,32 +776,15 @@ Object { "type": "uint64", "typeNum": 8, }, - "tokenInDenom": Object { - "comment": null, - "id": 2, - "isScalar": true, - "options": Object { - "(gogoproto.moretags)": "yaml:token_in_denom", - "(telescope:camel)": "tokenInDenom", - "(telescope:name)": "tokenInDenom", - "(telescope:orig)": "tokenInDenom", - }, - "parsedType": Object { - "name": "string", - "type": "native", - }, - "type": "string", - "typeNum": 13, - }, - "tokenOutDenom": Object { + "quoteAssetDenom": Object { "comment": null, "id": 3, "isScalar": true, "options": Object { - "(gogoproto.moretags)": "yaml:token_out_denom", - "(telescope:camel)": "tokenOutDenom", - "(telescope:name)": "tokenOutDenom", - "(telescope:orig)": "tokenOutDenom", + "(gogoproto.moretags)": "yaml:quote_asset_denom", + "(telescope:camel)": "quoteAssetDenom", + "(telescope:name)": "quoteAssetDenom", + "(telescope:orig)": "quote_asset_denom", }, "parsedType": Object { "name": "string", @@ -800,7 +802,8 @@ Object { "type": "Type", }, "QuerySpotPriceResponse": Object { - "comment": null, + "comment": "QuerySpotPriceResponse defines the gRPC response structure for a SpotPrice +query.", "fields": Object { "spotPrice": Object { "comment": "String of the Dec. Ex) 10.203uatom", diff --git a/packages/parser/__tests__/__snapshots__/traverse.test.ts.snap b/packages/parser/__tests__/__snapshots__/traverse.test.ts.snap index 718d9f6137..18e5c8e84c 100644 --- a/packages/parser/__tests__/__snapshots__/traverse.test.ts.snap +++ b/packages/parser/__tests__/__snapshots__/traverse.test.ts.snap @@ -5577,8 +5577,7 @@ Object { "typeNum": 13, }, "shareOutMinAmount": Object { - "comment": "reserved 3; -reserved \\"token_in\\";", + "comment": null, "id": 4, "isScalar": true, "options": Object { @@ -6387,8 +6386,7 @@ TODO: Rename to MsgJoinSwapExactAmountIn", "typeNum": 13, }, "shareOutMinAmount": Object { - "comment": "reserved 3; -reserved \\"token_in\\";", + "comment": null, "id": 4, "isScalar": true, "options": Object { diff --git a/packages/telescope/__tests__/__snapshots__/bundler.test.ts.snap b/packages/telescope/__tests__/__snapshots__/bundler.test.ts.snap index 29e159960a..db11ce1113 100644 --- a/packages/telescope/__tests__/__snapshots__/bundler.test.ts.snap +++ b/packages/telescope/__tests__/__snapshots__/bundler.test.ts.snap @@ -827,36 +827,43 @@ import * as _258 from \\"./claim/v1beta1/query\\"; import * as _259 from \\"./epochs/genesis\\"; import * as _260 from \\"./epochs/query\\"; import * as _261 from \\"./gamm/pool-models/balancer/balancerPool\\"; -import * as _262 from \\"./gamm/pool-models/balancer/tx\\"; -import * as _263 from \\"./gamm/v1beta1/genesis\\"; -import * as _264 from \\"./gamm/v1beta1/query\\"; -import * as _265 from \\"./gamm/v1beta1/tx\\"; -import * as _266 from \\"./incentives/gauge\\"; -import * as _267 from \\"./incentives/genesis\\"; -import * as _268 from \\"./incentives/params\\"; -import * as _269 from \\"./incentives/query\\"; -import * as _270 from \\"./incentives/tx\\"; -import * as _271 from \\"./lockup/genesis\\"; -import * as _272 from \\"./lockup/lock\\"; -import * as _273 from \\"./lockup/query\\"; -import * as _274 from \\"./lockup/tx\\"; -import * as _275 from \\"./mint/v1beta1/genesis\\"; -import * as _276 from \\"./mint/v1beta1/mint\\"; -import * as _277 from \\"./mint/v1beta1/query\\"; -import * as _278 from \\"./pool-incentives/v1beta1/genesis\\"; -import * as _279 from \\"./pool-incentives/v1beta1/gov\\"; -import * as _280 from \\"./pool-incentives/v1beta1/incentives\\"; -import * as _281 from \\"./pool-incentives/v1beta1/query\\"; -import * as _282 from \\"./store/v1beta1/tree\\"; -import * as _283 from \\"./superfluid/genesis\\"; -import * as _284 from \\"./superfluid/params\\"; -import * as _285 from \\"./superfluid/query\\"; -import * as _286 from \\"./superfluid/superfluid\\"; -import * as _287 from \\"./superfluid/tx\\"; -import * as _288 from \\"./txfees/v1beta1/feetoken\\"; -import * as _289 from \\"./txfees/v1beta1/genesis\\"; -import * as _290 from \\"./txfees/v1beta1/gov\\"; -import * as _291 from \\"./txfees/v1beta1/query\\"; +import * as _262 from \\"./gamm/v1beta1/genesis\\"; +import * as _263 from \\"./gamm/v1beta1/query\\"; +import * as _264 from \\"./gamm/v1beta1/tx\\"; +import * as _265 from \\"./gamm/pool-models/balancer/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 \\"./superfluid/genesis\\"; +import * as _286 from \\"./superfluid/params\\"; +import * as _287 from \\"./superfluid/query\\"; +import * as _288 from \\"./superfluid/superfluid\\"; +import * as _289 from \\"./superfluid/tx\\"; +import * as _290 from \\"./tokenfactory/v1beta1/authorityMetadata\\"; +import * as _291 from \\"./tokenfactory/v1beta1/genesis\\"; +import * as _292 from \\"./tokenfactory/v1beta1/params\\"; +import * as _293 from \\"./tokenfactory/v1beta1/query\\"; +import * as _294 from \\"./tokenfactory/v1beta1/tx\\"; +import * as _295 from \\"./txfees/v1beta1/feetoken\\"; +import * as _296 from \\"./txfees/v1beta1/genesis\\"; +import * as _297 from \\"./txfees/v1beta1/gov\\"; +import * as _298 from \\"./txfees/v1beta1/query\\"; export namespace osmosis { export namespace claim { export const v1beta1 = { ..._255, @@ -874,49 +881,67 @@ export namespace osmosis { export const v1beta1 = { ..._261, ..._262, ..._263, - ..._264, - ..._265 - }; + ..._264 + }; + export namespace poolmodels { + export namespace balancer { + export const v1beta1 = { ..._265 + }; + } + export namespace stableswap { + export const v1beta1 = { ..._266, + ..._267 + }; + } + } } - export const incentives = { ..._266, - ..._267, - ..._268, + export const incentives = { ..._268, ..._269, - ..._270 + ..._270, + ..._271, + ..._272 }; - export const lockup = { ..._271, - ..._272, - ..._273, - ..._274 + export const lockup = { ..._273, + ..._274, + ..._275, + ..._276 }; export namespace mint { - export const v1beta1 = { ..._275, - ..._276, - ..._277 + export const v1beta1 = { ..._277, + ..._278, + ..._279 }; } export namespace poolincentives { - export const v1beta1 = { ..._278, - ..._279, - ..._280, - ..._281 + export const v1beta1 = { ..._280, + ..._281, + ..._282, + ..._283 }; } export namespace store { - export const v1beta1 = { ..._282 + export const v1beta1 = { ..._284 }; } - export const superfluid = { ..._283, - ..._284, - ..._285, + export const superfluid = { ..._285, ..._286, - ..._287 + ..._287, + ..._288, + ..._289 }; + export namespace tokenfactory { + export const v1beta1 = { ..._290, + ..._291, + ..._292, + ..._293, + ..._294 + }; + } export namespace txfees { - export const v1beta1 = { ..._288, - ..._289, - ..._290, - ..._291 + export const v1beta1 = { ..._295, + ..._296, + ..._297, + ..._298 }; } }", @@ -924,31 +949,31 @@ export namespace osmosis { "secret": Object { "base": "secret", "bundle": "secret/bundle.ts", - "code": "import * as _292 from \\"./compute/v1beta1/genesis\\"; -import * as _293 from \\"./compute/v1beta1/msg\\"; -import * as _294 from \\"./compute/v1beta1/query\\"; -import * as _295 from \\"./compute/v1beta1/types\\"; -import * as _296 from \\"./registration/v1beta1/genesis\\"; -import * as _297 from \\"./registration/v1beta1/msg\\"; -import * as _298 from \\"./registration/v1beta1/query\\"; -import * as _299 from \\"./registration/v1beta1/types\\"; -import * as _300 from \\"./registration/v1beta1/remote_attestation/types\\"; + "code": "import * as _299 from \\"./compute/v1beta1/genesis\\"; +import * as _300 from \\"./compute/v1beta1/msg\\"; +import * as _301 from \\"./compute/v1beta1/query\\"; +import * as _302 from \\"./compute/v1beta1/types\\"; +import * as _303 from \\"./registration/v1beta1/genesis\\"; +import * as _304 from \\"./registration/v1beta1/msg\\"; +import * as _305 from \\"./registration/v1beta1/query\\"; +import * as _306 from \\"./registration/v1beta1/types\\"; +import * as _307 from \\"./registration/v1beta1/remote_attestation/types\\"; export namespace secret { export namespace compute { - export const v1beta1 = { ..._292, - ..._293, - ..._294, - ..._295 + export const v1beta1 = { ..._299, + ..._300, + ..._301, + ..._302 }; } export namespace registration { - export const v1beta1 = { ..._296, - ..._297, - ..._298, - ..._299 + export const v1beta1 = { ..._303, + ..._304, + ..._305, + ..._306 }; export namespace remote_attestation { - export const v1beta1 = { ..._300 + export const v1beta1 = { ..._307 }; } } @@ -957,36 +982,36 @@ export namespace secret { "tendermint": Object { "base": "tendermint", "bundle": "tendermint/bundle.ts", - "code": "import * as _301 from \\"./abci/types\\"; -import * as _302 from \\"./crypto/keys\\"; -import * as _303 from \\"./crypto/proof\\"; -import * as _304 from \\"./libs/bits/types\\"; -import * as _305 from \\"./p2p/types\\"; -import * as _306 from \\"./types/block\\"; -import * as _307 from \\"./types/evidence\\"; -import * as _308 from \\"./types/params\\"; -import * as _309 from \\"./types/types\\"; -import * as _310 from \\"./types/validator\\"; -import * as _311 from \\"./version/types\\"; + "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\\"; export namespace tendermint { - export const abci = { ..._301 + export const abci = { ..._308 }; - export const crypto = { ..._302, - ..._303 + export const crypto = { ..._309, + ..._310 }; export namespace libs { - export const bits = { ..._304 + export const bits = { ..._311 }; } - export const p2p = { ..._305 + export const p2p = { ..._312 }; - export const types = { ..._306, - ..._307, - ..._308, - ..._309, - ..._310 + export const types = { ..._313, + ..._314, + ..._315, + ..._316, + ..._317 }; - export const version = { ..._311 + export const version = { ..._318 }; }", }, diff --git a/packages/telescope/src/utils/index.ts b/packages/telescope/src/utils/index.ts index 0294c2cf40..b3a610f8a6 100644 --- a/packages/telescope/src/utils/index.ts +++ b/packages/telescope/src/utils/index.ts @@ -62,9 +62,7 @@ export const variableSlug = (str) => { str = str .replace(/[^a-z0-9_ -]/g, "") // remove invalid chars .replace(/\s+/g, "-") // collapse whitespace and replace by - - .replace(/-+/g, "-") // collapse dashes - .replace(/^-+/, "") // trim - from start of text - .replace(/-+$/, ""); + .replace(/-/g, ""); return camel(str); } \ No newline at end of file