Skip to content

Commit

Permalink
Merge pull request #79 from onomyprotocol/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
cgdusek authored Jun 23, 2024
2 parents 40e9af1 + 9a355d2 commit 0b95c30
Show file tree
Hide file tree
Showing 15 changed files with 120 additions and 136 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -915,18 +915,18 @@ export default {
},


async sendMsgCreateOrder({ rootGetters }, { value, fee = [], memo = '' }) {
async sendMsgRedeemDrop({ rootGetters }, { value, fee = [], memo = '' }) {
try {
const txClient=await initTxClient(rootGetters)
const msg = await txClient.msgCreateOrder(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:MsgCreateOrder: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:MsgCreateOrder:Send Could not broadcast Tx: '+ e.message)
throw new Error('TxClient:MsgRedeemDrop:Send Could not broadcast Tx: '+ e.message)
}
}
},
Expand All @@ -945,77 +945,77 @@ export default {
}
}
},
async sendMsgCreateDrop({ rootGetters }, { value, fee = [], memo = '' }) {
async sendMsgCancelOrder({ rootGetters }, { value, fee = [], memo = '' }) {
try {
const txClient=await initTxClient(rootGetters)
const msg = await txClient.msgCreateDrop(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:MsgCreateDrop: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:MsgCreateDrop:Send Could not broadcast Tx: '+ e.message)
throw new Error('TxClient:MsgCancelOrder: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 sendMsgCreatePool({ rootGetters }, { value, fee = [], memo = '' }) {
async sendMsgCreateOrder({ rootGetters }, { value, fee = [], memo = '' }) {
try {
const txClient=await initTxClient(rootGetters)
const msg = await txClient.msgCreatePool(value)
const msg = await txClient.msgCreateOrder(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:MsgCreateOrder: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:MsgCreateOrder:Send Could not broadcast Tx: '+ e.message)
}
}
},
async sendMsgRedeemDrop({ rootGetters }, { value, fee = [], memo = '' }) {
async sendMsgCreateDrop({ rootGetters }, { value, fee = [], memo = '' }) {
try {
const txClient=await initTxClient(rootGetters)
const msg = await txClient.msgRedeemDrop(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:MsgRedeemDrop: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:MsgRedeemDrop:Send Could not broadcast Tx: '+ e.message)
throw new Error('TxClient:MsgCreateDrop:Send Could not broadcast Tx: '+ e.message)
}
}
},

async MsgCreateOrder({ rootGetters }, { value }) {
async MsgRedeemDrop({ rootGetters }, { value }) {
try {
const txClient=await initTxClient(rootGetters)
const msg = await txClient.msgCreateOrder(value)
const msg = await txClient.msgRedeemDrop(value)
return msg
} catch (e) {
if (e == MissingWalletError) {
throw new Error('TxClient:MsgCreateOrder: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:MsgCreateOrder:Create Could not create message: ' + e.message)
throw new Error('TxClient:MsgRedeemDrop:Create Could not create message: ' + e.message)
}
}
},
Expand All @@ -1032,55 +1032,55 @@ export default {
}
}
},
async MsgCreateDrop({ rootGetters }, { value }) {
async MsgCancelOrder({ rootGetters }, { value }) {
try {
const txClient=await initTxClient(rootGetters)
const msg = await txClient.msgCreateDrop(value)
const msg = await txClient.msgCancelOrder(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:MsgCancelOrder: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:MsgCancelOrder: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 MsgCreatePool({ rootGetters }, { value }) {
async MsgCreateOrder({ rootGetters }, { value }) {
try {
const txClient=await initTxClient(rootGetters)
const msg = await txClient.msgCreatePool(value)
const msg = await txClient.msgCreateOrder(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:MsgCreateOrder: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:MsgCreateOrder:Create Could not create message: ' + e.message)
}
}
},
async MsgRedeemDrop({ rootGetters }, { value }) {
async MsgCreateDrop({ rootGetters }, { value }) {
try {
const txClient=await initTxClient(rootGetters)
const msg = await txClient.msgRedeemDrop(value)
const msg = await txClient.msgCreateDrop(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:MsgCreateDrop: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:MsgCreateDrop:Create Could not create message: ' + e.message)
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ import { StdFee } from "@cosmjs/launchpad";
import { SigningStargateClient } from "@cosmjs/stargate";
import { Registry, OfflineSigner, EncodeObject, DirectSecp256k1HdWallet } from "@cosmjs/proto-signing";
import { Api } from "./rest";
import { MsgCreateOrder } from "./types/market/tx";
import { MsgRedeemDrop } from "./types/market/tx";
import { MsgMarketOrder } from "./types/market/tx";
import { MsgCreateDrop } from "./types/market/tx";
import { MsgCancelOrder } from "./types/market/tx";
import { MsgCreatePool } from "./types/market/tx";
import { MsgRedeemDrop } from "./types/market/tx";
import { MsgCreateOrder } from "./types/market/tx";
import { MsgCreateDrop } from "./types/market/tx";


const types = [
["/pendulumlabs.market.market.MsgCreateOrder", MsgCreateOrder],
["/pendulumlabs.market.market.MsgRedeemDrop", MsgRedeemDrop],
["/pendulumlabs.market.market.MsgMarketOrder", MsgMarketOrder],
["/pendulumlabs.market.market.MsgCreateDrop", MsgCreateDrop],
["/pendulumlabs.market.market.MsgCancelOrder", MsgCancelOrder],
["/pendulumlabs.market.market.MsgCreatePool", MsgCreatePool],
["/pendulumlabs.market.market.MsgRedeemDrop", MsgRedeemDrop],
["/pendulumlabs.market.market.MsgCreateOrder", MsgCreateOrder],
["/pendulumlabs.market.market.MsgCreateDrop", MsgCreateDrop],

];
export const MissingWalletError = new Error("wallet is required");
Expand Down Expand Up @@ -51,12 +51,12 @@ const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions =

return {
signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo),
msgCreateOrder: (data: MsgCreateOrder): EncodeObject => ({ typeUrl: "/pendulumlabs.market.market.MsgCreateOrder", value: MsgCreateOrder.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 ) }),
msgCreateDrop: (data: MsgCreateDrop): EncodeObject => ({ typeUrl: "/pendulumlabs.market.market.MsgCreateDrop", value: MsgCreateDrop.fromPartial( data ) }),
msgCancelOrder: (data: MsgCancelOrder): EncodeObject => ({ typeUrl: "/pendulumlabs.market.market.MsgCancelOrder", value: MsgCancelOrder.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 ) }),
msgCreateOrder: (data: MsgCreateOrder): EncodeObject => ({ typeUrl: "/pendulumlabs.market.market.MsgCreateOrder", value: MsgCreateOrder.fromPartial( data ) }),
msgCreateDrop: (data: MsgCreateDrop): EncodeObject => ({ typeUrl: "/pendulumlabs.market.market.MsgCreateDrop", value: MsgCreateDrop.fromPartial( data ) }),

};
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -431,13 +431,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;
}

/**
Expand Down Expand Up @@ -670,7 +663,6 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
"pagination.offset"?: string;
"pagination.limit"?: string;
"pagination.count_total"?: boolean;
"pagination.reverse"?: boolean;
},
params: RequestParams = {},
) =>
Expand Down Expand Up @@ -728,7 +720,6 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
"pagination.offset"?: string;
"pagination.limit"?: string;
"pagination.count_total"?: boolean;
"pagination.reverse"?: boolean;
},
params: RequestParams = {},
) =>
Expand Down Expand Up @@ -770,7 +761,6 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
"pagination.offset"?: string;
"pagination.limit"?: string;
"pagination.count_total"?: boolean;
"pagination.reverse"?: boolean;
},
params: RequestParams = {},
) =>
Expand Down Expand Up @@ -862,7 +852,6 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
"pagination.offset"?: string;
"pagination.limit"?: string;
"pagination.count_total"?: boolean;
"pagination.reverse"?: boolean;
},
params: RequestParams = {},
) =>
Expand Down Expand Up @@ -906,7 +895,6 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
"pagination.offset"?: string;
"pagination.limit"?: string;
"pagination.count_total"?: boolean;
"pagination.reverse"?: boolean;
},
params: RequestParams = {},
) =>
Expand All @@ -932,7 +920,6 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
"pagination.offset"?: string;
"pagination.limit"?: string;
"pagination.count_total"?: boolean;
"pagination.reverse"?: boolean;
},
params: RequestParams = {},
) =>
Expand Down Expand Up @@ -974,7 +961,6 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
"pagination.offset"?: string;
"pagination.limit"?: string;
"pagination.count_total"?: boolean;
"pagination.reverse"?: boolean;
},
params: RequestParams = {},
) =>
Expand All @@ -1001,7 +987,6 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
"pagination.offset"?: string;
"pagination.limit"?: string;
"pagination.count_total"?: boolean;
"pagination.reverse"?: boolean;
},
params: RequestParams = {},
) =>
Expand All @@ -1028,7 +1013,6 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
"pagination.offset"?: string;
"pagination.limit"?: string;
"pagination.count_total"?: boolean;
"pagination.reverse"?: boolean;
},
params: RequestParams = {},
) =>
Expand Down Expand Up @@ -1086,7 +1070,6 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
"pagination.offset"?: string;
"pagination.limit"?: string;
"pagination.count_total"?: boolean;
"pagination.reverse"?: boolean;
},
params: RequestParams = {},
) =>
Expand Down Expand Up @@ -1144,7 +1127,6 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
"pagination.offset"?: string;
"pagination.limit"?: string;
"pagination.count_total"?: boolean;
"pagination.reverse"?: boolean;
},
params: RequestParams = {},
) =>
Expand Down
Loading

0 comments on commit 0b95c30

Please sign in to comment.