diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index 2d231c73..fc770c86 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -50171,6 +50171,8 @@ definitions: pendulumlabs.market.market.MsgMarketOrderResponse: type: object properties: + uid: + type: string amountBid: type: string amountAsk: diff --git a/proto/market/tx.proto b/proto/market/tx.proto index b78563d1..24822eb8 100644 --- a/proto/market/tx.proto +++ b/proto/market/tx.proto @@ -76,9 +76,10 @@ message MsgMarketOrder { } message MsgMarketOrderResponse { - string amountBid = 1; - string amountAsk = 2; - string slippage = 3; + string uid = 1; + string amountBid = 2; + string amountAsk = 3; + string slippage = 4; } // this line is used by starport scaffolding # proto/tx/message \ No newline at end of file diff --git a/vue/src/store/generated/pendulum-labs/market/pendulumlabs.market.market/index.ts b/vue/src/store/generated/pendulum-labs/market/pendulumlabs.market.market/index.ts index 61c575f3..8b151dcb 100755 --- a/vue/src/store/generated/pendulum-labs/market/pendulumlabs.market.market/index.ts +++ b/vue/src/store/generated/pendulum-labs/market/pendulumlabs.market.market/index.ts @@ -915,78 +915,78 @@ export default { }, - async sendMsgCreatePool({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgMarketOrder({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCreatePool(value) + const msg = await txClient.msgMarketOrder(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgCreatePool:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgMarketOrder:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgCreatePool:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgMarketOrder:Send Could not broadcast Tx: '+ e.message) } } }, - async sendMsgCancelOrder({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgCreatePool({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCancelOrder(value) + const msg = await txClient.msgCreatePool(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgCancelOrder:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgCreatePool:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgCancelOrder:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgCreatePool:Send Could not broadcast Tx: '+ e.message) } } }, - async sendMsgCreateDrop({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgRedeemDrop({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCreateDrop(value) + const msg = await txClient.msgRedeemDrop(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgCreateDrop:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgRedeemDrop:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgCreateDrop:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgRedeemDrop:Send Could not broadcast Tx: '+ e.message) } } }, - async sendMsgRedeemDrop({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgCancelOrder({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgRedeemDrop(value) + const msg = await txClient.msgCancelOrder(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgRedeemDrop:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgCancelOrder:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgRedeemDrop:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgCancelOrder:Send Could not broadcast Tx: '+ e.message) } } }, - async sendMsgMarketOrder({ rootGetters }, { value, fee = [], memo = '' }) { + async sendMsgCreateDrop({ rootGetters }, { value, fee = [], memo = '' }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgMarketOrder(value) + const msg = await txClient.msgCreateDrop(value) const result = await txClient.signAndBroadcast([msg], {fee: { amount: fee, gas: "200000" }, memo}) return result } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgMarketOrder:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgCreateDrop:Init Could not initialize signing client. Wallet is required.') }else{ - throw new Error('TxClient:MsgMarketOrder:Send Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgCreateDrop:Send Could not broadcast Tx: '+ e.message) } } }, @@ -1006,68 +1006,68 @@ export default { } }, - async MsgCreatePool({ rootGetters }, { value }) { + async MsgMarketOrder({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCreatePool(value) + const msg = await txClient.msgMarketOrder(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgCreatePool:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgMarketOrder:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgCreatePool:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgMarketOrder:Create Could not create message: ' + e.message) } } }, - async MsgCancelOrder({ rootGetters }, { value }) { + async MsgCreatePool({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCancelOrder(value) + const msg = await txClient.msgCreatePool(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgCancelOrder:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgCreatePool:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgCancelOrder:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgCreatePool:Create Could not create message: ' + e.message) } } }, - async MsgCreateDrop({ rootGetters }, { value }) { + async MsgRedeemDrop({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgCreateDrop(value) + const msg = await txClient.msgRedeemDrop(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgCreateDrop:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgRedeemDrop:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgCreateDrop:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgRedeemDrop:Create Could not create message: ' + e.message) } } }, - async MsgRedeemDrop({ rootGetters }, { value }) { + async MsgCancelOrder({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgRedeemDrop(value) + const msg = await txClient.msgCancelOrder(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgRedeemDrop:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgCancelOrder:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgRedeemDrop:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgCancelOrder:Create Could not create message: ' + e.message) } } }, - async MsgMarketOrder({ rootGetters }, { value }) { + async MsgCreateDrop({ rootGetters }, { value }) { try { const txClient=await initTxClient(rootGetters) - const msg = await txClient.msgMarketOrder(value) + const msg = await txClient.msgCreateDrop(value) return msg } catch (e) { if (e == MissingWalletError) { - throw new Error('TxClient:MsgMarketOrder:Init Could not initialize signing client. Wallet is required.') + throw new Error('TxClient:MsgCreateDrop:Init Could not initialize signing client. Wallet is required.') } else{ - throw new Error('TxClient:MsgMarketOrder:Create Could not create message: ' + e.message) + throw new Error('TxClient:MsgCreateDrop:Create Could not create message: ' + e.message) } } }, diff --git a/vue/src/store/generated/pendulum-labs/market/pendulumlabs.market.market/module/index.ts b/vue/src/store/generated/pendulum-labs/market/pendulumlabs.market.market/module/index.ts index 221fafdc..1a4282db 100755 --- a/vue/src/store/generated/pendulum-labs/market/pendulumlabs.market.market/module/index.ts +++ b/vue/src/store/generated/pendulum-labs/market/pendulumlabs.market.market/module/index.ts @@ -4,20 +4,20 @@ import { StdFee } from "@cosmjs/launchpad"; import { SigningStargateClient } from "@cosmjs/stargate"; import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"; import { Api } from "./rest"; +import { MsgMarketOrder } from "./types/market/tx"; import { MsgCreatePool } from "./types/market/tx"; +import { MsgRedeemDrop } from "./types/market/tx"; import { MsgCancelOrder } from "./types/market/tx"; import { MsgCreateDrop } from "./types/market/tx"; -import { MsgRedeemDrop } from "./types/market/tx"; -import { MsgMarketOrder } from "./types/market/tx"; import { MsgCreateOrder } from "./types/market/tx"; const types = [ + ["/pendulumlabs.market.market.MsgMarketOrder", MsgMarketOrder], ["/pendulumlabs.market.market.MsgCreatePool", MsgCreatePool], + ["/pendulumlabs.market.market.MsgRedeemDrop", MsgRedeemDrop], ["/pendulumlabs.market.market.MsgCancelOrder", MsgCancelOrder], ["/pendulumlabs.market.market.MsgCreateDrop", MsgCreateDrop], - ["/pendulumlabs.market.market.MsgRedeemDrop", MsgRedeemDrop], - ["/pendulumlabs.market.market.MsgMarketOrder", MsgMarketOrder], ["/pendulumlabs.market.market.MsgCreateOrder", MsgCreateOrder], ]; @@ -51,11 +51,11 @@ const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions = return { signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo), + msgMarketOrder: (data: MsgMarketOrder): EncodeObject => ({ typeUrl: "/pendulumlabs.market.market.MsgMarketOrder", value: MsgMarketOrder.fromPartial( data ) }), msgCreatePool: (data: MsgCreatePool): EncodeObject => ({ typeUrl: "/pendulumlabs.market.market.MsgCreatePool", value: MsgCreatePool.fromPartial( data ) }), + msgRedeemDrop: (data: MsgRedeemDrop): EncodeObject => ({ typeUrl: "/pendulumlabs.market.market.MsgRedeemDrop", value: MsgRedeemDrop.fromPartial( data ) }), msgCancelOrder: (data: MsgCancelOrder): EncodeObject => ({ typeUrl: "/pendulumlabs.market.market.MsgCancelOrder", value: MsgCancelOrder.fromPartial( data ) }), msgCreateDrop: (data: MsgCreateDrop): EncodeObject => ({ typeUrl: "/pendulumlabs.market.market.MsgCreateDrop", value: MsgCreateDrop.fromPartial( data ) }), - msgRedeemDrop: (data: MsgRedeemDrop): EncodeObject => ({ typeUrl: "/pendulumlabs.market.market.MsgRedeemDrop", value: MsgRedeemDrop.fromPartial( data ) }), - msgMarketOrder: (data: MsgMarketOrder): EncodeObject => ({ typeUrl: "/pendulumlabs.market.market.MsgMarketOrder", value: MsgMarketOrder.fromPartial( data ) }), msgCreateOrder: (data: MsgCreateOrder): EncodeObject => ({ typeUrl: "/pendulumlabs.market.market.MsgCreateOrder", value: MsgCreateOrder.fromPartial( data ) }), }; diff --git a/vue/src/store/generated/pendulum-labs/market/pendulumlabs.market.market/module/rest.ts b/vue/src/store/generated/pendulum-labs/market/pendulumlabs.market.market/module/rest.ts index 9d15ae2c..34cc9049 100644 --- a/vue/src/store/generated/pendulum-labs/market/pendulumlabs.market.market/module/rest.ts +++ b/vue/src/store/generated/pendulum-labs/market/pendulumlabs.market.market/module/rest.ts @@ -26,6 +26,7 @@ export interface MarketMsgCreateOrderResponse { export type MarketMsgCreatePoolResponse = object; export interface MarketMsgMarketOrderResponse { + uid?: string; amountBid?: string; amountAsk?: string; slippage?: string; @@ -406,13 +407,6 @@ export interface V1Beta1PageRequest { * is set. */ count_total?: boolean; - - /** - * reverse is set to true if results are to be returned in the descending order. - * - * Since: cosmos-sdk 0.43 - */ - reverse?: boolean; } /** @@ -645,7 +639,6 @@ export class Api extends HttpClient @@ -703,7 +696,6 @@ export class Api extends HttpClient @@ -745,7 +737,6 @@ export class Api extends HttpClient @@ -837,7 +828,6 @@ export class Api extends HttpClient @@ -881,7 +871,6 @@ export class Api extends HttpClient @@ -907,7 +896,6 @@ export class Api extends HttpClient @@ -949,7 +937,6 @@ export class Api extends HttpClient @@ -976,7 +963,6 @@ export class Api extends HttpClient @@ -1003,7 +989,6 @@ export class Api extends HttpClient @@ -1061,7 +1046,6 @@ export class Api extends HttpClient @@ -1119,7 +1103,6 @@ export class Api extends HttpClient diff --git a/vue/src/store/generated/pendulum-labs/market/pendulumlabs.market.market/module/types/cosmos/base/query/v1beta1/pagination.ts b/vue/src/store/generated/pendulum-labs/market/pendulumlabs.market.market/module/types/cosmos/base/query/v1beta1/pagination.ts index 9c87ac0c..0bc568f4 100644 --- a/vue/src/store/generated/pendulum-labs/market/pendulumlabs.market.market/module/types/cosmos/base/query/v1beta1/pagination.ts +++ b/vue/src/store/generated/pendulum-labs/market/pendulumlabs.market.market/module/types/cosmos/base/query/v1beta1/pagination.ts @@ -38,12 +38,6 @@ export interface PageRequest { * is set. */ count_total: boolean; - /** - * reverse is set to true if results are to be returned in the descending order. - * - * Since: cosmos-sdk 0.43 - */ - reverse: boolean; } /** @@ -68,12 +62,7 @@ export interface PageResponse { total: number; } -const basePageRequest: object = { - offset: 0, - limit: 0, - count_total: false, - reverse: false, -}; +const basePageRequest: object = { offset: 0, limit: 0, count_total: false }; export const PageRequest = { encode(message: PageRequest, writer: Writer = Writer.create()): Writer { @@ -89,9 +78,6 @@ export const PageRequest = { if (message.count_total === true) { writer.uint32(32).bool(message.count_total); } - if (message.reverse === true) { - writer.uint32(40).bool(message.reverse); - } return writer; }, @@ -114,9 +100,6 @@ export const PageRequest = { case 4: message.count_total = reader.bool(); break; - case 5: - message.reverse = reader.bool(); - break; default: reader.skipType(tag & 7); break; @@ -145,11 +128,6 @@ export const PageRequest = { } else { message.count_total = false; } - if (object.reverse !== undefined && object.reverse !== null) { - message.reverse = Boolean(object.reverse); - } else { - message.reverse = false; - } return message; }, @@ -163,7 +141,6 @@ export const PageRequest = { message.limit !== undefined && (obj.limit = message.limit); message.count_total !== undefined && (obj.count_total = message.count_total); - message.reverse !== undefined && (obj.reverse = message.reverse); return obj; }, @@ -189,11 +166,6 @@ export const PageRequest = { } else { message.count_total = false; } - if (object.reverse !== undefined && object.reverse !== null) { - message.reverse = object.reverse; - } else { - message.reverse = false; - } return message; }, }; diff --git a/vue/src/store/generated/pendulum-labs/market/pendulumlabs.market.market/module/types/market/tx.ts b/vue/src/store/generated/pendulum-labs/market/pendulumlabs.market.market/module/types/market/tx.ts index 7bfb2278..cde5a561 100644 --- a/vue/src/store/generated/pendulum-labs/market/pendulumlabs.market.market/module/types/market/tx.ts +++ b/vue/src/store/generated/pendulum-labs/market/pendulumlabs.market.market/module/types/market/tx.ts @@ -60,6 +60,7 @@ export interface MsgMarketOrder { } export interface MsgMarketOrderResponse { + uid: string; amountBid: string; amountAsk: string; slippage: string; @@ -937,6 +938,7 @@ export const MsgMarketOrder = { }; const baseMsgMarketOrderResponse: object = { + uid: "", amountBid: "", amountAsk: "", slippage: "", @@ -947,14 +949,17 @@ export const MsgMarketOrderResponse = { message: MsgMarketOrderResponse, writer: Writer = Writer.create() ): Writer { + if (message.uid !== "") { + writer.uint32(10).string(message.uid); + } if (message.amountBid !== "") { - writer.uint32(10).string(message.amountBid); + writer.uint32(18).string(message.amountBid); } if (message.amountAsk !== "") { - writer.uint32(18).string(message.amountAsk); + writer.uint32(26).string(message.amountAsk); } if (message.slippage !== "") { - writer.uint32(26).string(message.slippage); + writer.uint32(34).string(message.slippage); } return writer; }, @@ -967,12 +972,15 @@ export const MsgMarketOrderResponse = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.amountBid = reader.string(); + message.uid = reader.string(); break; case 2: - message.amountAsk = reader.string(); + message.amountBid = reader.string(); break; case 3: + message.amountAsk = reader.string(); + break; + case 4: message.slippage = reader.string(); break; default: @@ -985,6 +993,11 @@ export const MsgMarketOrderResponse = { fromJSON(object: any): MsgMarketOrderResponse { const message = { ...baseMsgMarketOrderResponse } as MsgMarketOrderResponse; + if (object.uid !== undefined && object.uid !== null) { + message.uid = String(object.uid); + } else { + message.uid = ""; + } if (object.amountBid !== undefined && object.amountBid !== null) { message.amountBid = String(object.amountBid); } else { @@ -1005,6 +1018,7 @@ export const MsgMarketOrderResponse = { toJSON(message: MsgMarketOrderResponse): unknown { const obj: any = {}; + message.uid !== undefined && (obj.uid = message.uid); message.amountBid !== undefined && (obj.amountBid = message.amountBid); message.amountAsk !== undefined && (obj.amountAsk = message.amountAsk); message.slippage !== undefined && (obj.slippage = message.slippage); @@ -1015,6 +1029,11 @@ export const MsgMarketOrderResponse = { object: DeepPartial ): MsgMarketOrderResponse { const message = { ...baseMsgMarketOrderResponse } as MsgMarketOrderResponse; + if (object.uid !== undefined && object.uid !== null) { + message.uid = object.uid; + } else { + message.uid = ""; + } if (object.amountBid !== undefined && object.amountBid !== null) { message.amountBid = object.amountBid; } else { diff --git a/x/market/keeper/msg_server_market_order.go b/x/market/keeper/msg_server_market_order.go index 1e95fbe4..306e62f0 100644 --- a/x/market/keeper/msg_server_market_order.go +++ b/x/market/keeper/msg_server_market_order.go @@ -2,6 +2,7 @@ package keeper import ( "context" + "strconv" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -178,5 +179,5 @@ func (k msgServer) MarketOrder(goCtx context.Context, msg *types.MsgMarketOrder) k.SetMember(ctx, memberAsk) k.SetMember(ctx, memberBid) - return &types.MsgMarketOrderResponse{AmountBid: msg.AmountBid, AmountAsk: amountAsk.String(), Slippage: slippage.String()}, nil + return &types.MsgMarketOrderResponse{Uid: strconv.FormatUint(uid, 10), AmountBid: msg.AmountBid, AmountAsk: amountAsk.String(), Slippage: slippage.String()}, nil }