Skip to content

Commit

Permalink
Merge pull request #75 from onomyprotocol/revert-proto
Browse files Browse the repository at this point in the history
Revert proto
  • Loading branch information
cgdusek authored Jun 14, 2024
2 parents d7d73c9 + bc88d46 commit 3b61209
Show file tree
Hide file tree
Showing 25 changed files with 348 additions and 3,437 deletions.
269 changes: 20 additions & 249 deletions docs/static/openapi.yml

Large diffs are not rendered by default.

28 changes: 3 additions & 25 deletions proto/market/drop.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,37 +11,15 @@ message Drop {
uint64 uid = 1;
string owner = 2;
string pair = 3;
bool active = 4;
string drops = 5 [
string drops = 4 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.nullable) = false
];
int64 time_beg = 6;
string coin1_beg = 7 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin",
(gogoproto.nullable) = false
];
string coin2_beg = 8 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin",
(gogoproto.nullable) = false
];
string product_beg = 9 [
string product = 5 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.nullable) = false
];
int64 time_end = 10;
string coin1_end = 11 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin",
(gogoproto.nullable) = false
];
string coin2_end = 12 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin",
(gogoproto.nullable) = false
];
string product_end = 13 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.nullable) = false
];
bool active = 6;
}

message Drops {
Expand Down
1 change: 0 additions & 1 deletion proto/market/pool.proto
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ message Pool {
(gogoproto.nullable) = false
];
uint64 history = 8;
uint64 last_drop = 9;
}

message Leader {
Expand Down
8 changes: 2 additions & 6 deletions proto/market/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,8 @@ message MsgRedeemDropResponse {
uint64 uid = 2;
string pair = 3;
string drops = 4;
string time_beg = 5;
string coin1_beg = 6;
string coin2_beg = 7;
string time_end = 8;
string coin1_end = 9;
string coin2_end = 10;
string coin1 = 9;
string coin2 = 10;
}

message MsgCreateOrder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -915,18 +915,18 @@ export default {
},


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

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


const types = [
["/pendulumlabs.market.market.MsgCreateDrop", MsgCreateDrop],
["/pendulumlabs.market.market.MsgMarketOrder", MsgMarketOrder],
["/pendulumlabs.market.market.MsgCreateOrder", MsgCreateOrder],
["/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],
Expand Down Expand Up @@ -51,9 +51,9 @@ const txClient = async (wallet: OfflineSigner, { addr: addr }: TxClientOptions =

return {
signAndBroadcast: (msgs: EncodeObject[], { fee, memo }: SignAndBroadcastOptions = {fee: defaultFee, memo: ""}) => client.signAndBroadcast(address, msgs, fee,memo),
msgCreateDrop: (data: MsgCreateDrop): EncodeObject => ({ typeUrl: "/pendulumlabs.market.market.MsgCreateDrop", value: MsgCreateDrop.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 ) }),
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 ) }),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,8 @@ export interface MarketMsgRedeemDropResponse {
uid?: string;
pair?: string;
drops?: string;
time_beg?: string;
coin1_beg?: string;
coin2_beg?: string;
time_end?: string;
coin1_end?: string;
coin2_end?: string;
coin1?: string;
coin2?: string;
}

export interface MarketOrderResponse {
Expand Down Expand Up @@ -316,20 +312,9 @@ export interface MarketmarketDrop {
uid?: string;
owner?: string;
pair?: string;
active?: boolean;
drops?: string;

/** @format int64 */
time_beg?: string;
coin1_beg?: string;
coin2_beg?: string;
product_beg?: string;

/** @format int64 */
time_end?: string;
coin1_end?: string;
coin2_end?: string;
product_end?: string;
product?: string;
active?: boolean;
}

export interface MarketmarketMember {
Expand Down Expand Up @@ -391,9 +376,6 @@ export interface MarketmarketPool {

/** @format uint64 */
history?: string;

/** @format uint64 */
last_drop?: string;
}

export interface MarketmarketVolume {
Expand Down
Loading

0 comments on commit 3b61209

Please sign in to comment.