Skip to content

Commit

Permalink
Revert "chore: added cid"
Browse files Browse the repository at this point in the history
This reverts commit 1d30623.
  • Loading branch information
bangjelkoski committed Oct 27, 2023
1 parent 1d30623 commit 30af4a2
Show file tree
Hide file tree
Showing 15 changed files with 8 additions and 44 deletions.
2 changes: 1 addition & 1 deletion packages/sdk-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@ensdomains/ens-validation": "^0.1.0",
"@ensdomains/eth-ens-namehash": "^2.0.15",
"@ethersproject/bytes": "^5.7.0",
"@injectivelabs/core-proto-ts": "^0.0.19",
"@injectivelabs/core-proto-ts": "^0.0.18",
"@injectivelabs/dmm-proto-ts": "1.0.16",
"@injectivelabs/exceptions": "^1.14.1-beta.7",
"@injectivelabs/grpc-web": "^0.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export declare namespace MsgBatchCancelBinaryOptionsOrders {
subaccountId: string
orderHash: string
orderMask?: InjectiveExchangeV1Beta1Exchange.OrderMask
cid?: string
}[]
}

Expand Down Expand Up @@ -42,7 +41,6 @@ export default class MsgBatchCancelBinaryOptionsOrders extends MsgBase<
orderData.marketId = order.marketId
orderData.orderHash = order.orderHash
orderData.subaccountId = order.subaccountId
orderData.cid = order.cid || ''

// TODO: Send order.orderMask instead when chain handles order mask properly.
orderData.orderMask = InjectiveExchangeV1Beta1Exchange.OrderMask.ANY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export declare namespace MsgBatchCancelDerivativeOrders {
subaccountId: string
orderHash: string
orderMask?: InjectiveExchangeV1Beta1Exchange.OrderMask
cid?: string
}[]
}

Expand Down Expand Up @@ -41,7 +40,6 @@ export default class MsgBatchCancelDerivativeOrders extends MsgBase<
orderData.marketId = order.marketId
orderData.orderHash = order.orderHash
orderData.subaccountId = order.subaccountId
orderData.cid = order.cid || ''

// TODO: Send order.orderMask instead when chain handles order mask properly.
orderData.orderMask = InjectiveExchangeV1Beta1Exchange.OrderMask.ANY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export declare namespace MsgBatchCancelSpotOrders {
subaccountId: string
orderHash: string
orderMask?: InjectiveExchangeV1Beta1Exchange.OrderMask
cid?: string
}[]
}

Expand Down Expand Up @@ -41,7 +40,6 @@ export default class MsgBatchCancelSpotOrders extends MsgBase<
orderData.marketId = order.marketId
orderData.orderHash = order.orderHash
orderData.subaccountId = order.subaccountId
orderData.cid = order.cid || ''

// TODO: Send order.orderMask instead when chain handles order mask properly.
orderData.orderMask = InjectiveExchangeV1Beta1Exchange.OrderMask.ANY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,16 @@ export declare namespace MsgBatchUpdateOrders {
marketId: string
subaccountId: string
orderHash: string
cid?: string
}[]
derivativeOrdersToCancel?: {
marketId: string
subaccountId: string
orderHash: string
cid?: string
}[]
binaryOptionsOrdersToCancel?: {
marketId: string
subaccountId: string
orderHash: string
cid?: string
}[]
spotOrdersToCreate?: {
orderType: InjectiveExchangeV1Beta1Exchange.OrderType
Expand All @@ -37,7 +34,6 @@ export declare namespace MsgBatchUpdateOrders {
feeRecipient: string
price: string
quantity: string
cid?: string
}[]
derivativeOrdersToCreate?: {
orderType: InjectiveExchangeV1Beta1Exchange.OrderType
Expand All @@ -47,7 +43,6 @@ export declare namespace MsgBatchUpdateOrders {
price: string
margin: string
quantity: string
cid?: string
}[]
binaryOptionsOrdersToCreate?: {
orderType: InjectiveExchangeV1Beta1Exchange.OrderType
Expand All @@ -57,7 +52,6 @@ export declare namespace MsgBatchUpdateOrders {
price: string
margin: string
quantity: string
cid?: string
}[]
injectiveAddress: string
}
Expand Down Expand Up @@ -110,12 +104,11 @@ export default class MsgBatchUpdateOrders extends MsgBase<

if (params.spotOrdersToCancel && params.spotOrdersToCancel.length > 0) {
const orderData = params.spotOrdersToCancel.map(
({ marketId, subaccountId, orderHash, cid }) => {
({ marketId, subaccountId, orderHash }) => {
const orderData = InjectiveExchangeV1Beta1Tx.OrderData.create()
orderData.marketId = marketId
orderData.subaccountId = subaccountId
orderData.orderHash = orderHash
orderData.cid = cid || ''

return orderData
},
Expand All @@ -129,12 +122,11 @@ export default class MsgBatchUpdateOrders extends MsgBase<
params.derivativeOrdersToCancel.length > 0
) {
const orderData = params.derivativeOrdersToCancel.map(
({ marketId, subaccountId, orderHash, cid }) => {
({ marketId, subaccountId, orderHash }) => {
const orderData = InjectiveExchangeV1Beta1Tx.OrderData.create()
orderData.marketId = marketId
orderData.subaccountId = subaccountId
orderData.orderHash = orderHash
orderData.cid = cid || ''

return orderData
},
Expand All @@ -147,12 +139,11 @@ export default class MsgBatchUpdateOrders extends MsgBase<
params.binaryOptionsOrdersToCancel.length > 0
) {
const orderData = params.binaryOptionsOrdersToCancel.map(
({ marketId, subaccountId, orderHash, cid }) => {
({ marketId, subaccountId, orderHash }) => {
const orderData = InjectiveExchangeV1Beta1Tx.OrderData.create()
orderData.marketId = marketId
orderData.subaccountId = subaccountId
orderData.orderHash = orderHash
orderData.cid = cid || ''

return orderData
},
Expand All @@ -177,7 +168,6 @@ export default class MsgBatchUpdateOrders extends MsgBase<
orderInfo.feeRecipient = paramsFromArgs.feeRecipient
orderInfo.price = paramsFromArgs.price
orderInfo.quantity = paramsFromArgs.quantity
orderInfo.cid = paramsFromArgs.cid || ''

const order = InjectiveExchangeV1Beta1Exchange.SpotOrder.create()
order.marketId = paramsFromArgs.marketId
Expand Down Expand Up @@ -214,7 +204,6 @@ export default class MsgBatchUpdateOrders extends MsgBase<
orderInfo.feeRecipient = paramsFromArgs.feeRecipient
orderInfo.price = paramsFromArgs.price
orderInfo.quantity = paramsFromArgs.quantity
orderInfo.cid = paramsFromArgs.cid || ''

const order = InjectiveExchangeV1Beta1Exchange.DerivativeOrder.create()
order.marketId = paramsFromArgs.marketId
Expand Down Expand Up @@ -250,7 +239,6 @@ export default class MsgBatchUpdateOrders extends MsgBase<
orderInfo.feeRecipient = paramsFromArgs.feeRecipient
orderInfo.price = paramsFromArgs.price
orderInfo.quantity = paramsFromArgs.quantity
orderInfo.cid = paramsFromArgs.cid || ''

const order = InjectiveExchangeV1Beta1Exchange.DerivativeOrder.create()
order.marketId = paramsFromArgs.marketId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export declare namespace MsgCancelBinaryOptionsOrder {
injectiveAddress: string
orderHash: string
orderMask?: InjectiveExchangeV1Beta1Exchange.OrderMask
cid?: string
}

export type Proto = InjectiveExchangeV1Beta1Tx.MsgCancelBinaryOptionsOrder
Expand Down Expand Up @@ -40,7 +39,6 @@ export default class MsgCancelBinaryOptionsOrder extends MsgBase<
message.marketId = params.marketId
message.orderHash = params.orderHash
message.subaccountId = params.subaccountId
message.cid = params.cid || ''

// TODO: Send order.orderMask instead when chain handles order mask properly.
message.orderMask = InjectiveExchangeV1Beta1Exchange.OrderMask.ANY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export declare namespace MsgCancelDerivativeOrder {
injectiveAddress: string
orderHash: string
orderMask?: InjectiveExchangeV1Beta1Exchange.OrderMask
cid?: string
}

export type Proto = InjectiveExchangeV1Beta1Tx.MsgCancelDerivativeOrder
Expand All @@ -36,7 +35,6 @@ export default class MsgCancelDerivativeOrder extends MsgBase<
message.marketId = params.marketId
message.orderHash = params.orderHash
message.subaccountId = params.subaccountId
message.cid = params.cid || ''

// TODO: Send order.orderMask instead when chain handles order mask properly.
message.orderMask = InjectiveExchangeV1Beta1Exchange.OrderMask.ANY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export declare namespace MsgCancelSpotOrder {
subaccountId: string
injectiveAddress: string
orderHash: string
cid?: string
}

export type Proto = InjectiveExchangeV1Beta1Tx.MsgCancelSpotOrder
Expand All @@ -33,7 +32,6 @@ export default class MsgCancelSpotOrder extends MsgBase<
message.marketId = params.marketId
message.orderHash = params.orderHash
message.subaccountId = params.subaccountId
message.cid = params.cid || ''

// TODO: message.setOrderMask does not exist yet, enable this once it does.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export declare namespace MsgCreateBinaryOptionsLimitOrder {
price: string
margin: string
quantity: string
cid?: string
}

export type Proto =
Expand All @@ -30,7 +29,6 @@ const createLimitOrder = (params: MsgCreateBinaryOptionsLimitOrder.Params) => {
orderInfo.feeRecipient = params.feeRecipient
orderInfo.price = params.price
orderInfo.quantity = params.quantity
orderInfo.cid = params.cid || ''

const derivativeOrder =
InjectiveExchangeV1Beta1Exchange.DerivativeOrder.create()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export declare namespace MsgCreateBinaryOptionsMarketOrder {
price: string
margin: string
quantity: string
cid?: string
}

export type Proto =
Expand All @@ -32,7 +31,6 @@ const createMarketOrder = (
orderInfo.feeRecipient = params.feeRecipient
orderInfo.price = params.price
orderInfo.quantity = params.quantity
orderInfo.cid = params.cid || ''

const derivativeOrder =
InjectiveExchangeV1Beta1Exchange.DerivativeOrder.create()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export declare namespace MsgCreateDerivativeLimitOrder {
price: string
margin: string
quantity: string
cid?: string
}

export type Proto = InjectiveExchangeV1Beta1Tx.MsgCreateDerivativeLimitOrder
Expand All @@ -29,7 +28,6 @@ const createLimitOrder = (params: MsgCreateDerivativeLimitOrder.Params) => {
orderInfo.feeRecipient = params.feeRecipient
orderInfo.price = params.price
orderInfo.quantity = params.quantity
orderInfo.cid = params.cid || ''

const derivativeOrder =
InjectiveExchangeV1Beta1Exchange.DerivativeOrder.create()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export declare namespace MsgCreateDerivativeMarketOrder {
price: string
margin: string
quantity: string
cid?: string
}

export type Proto = InjectiveExchangeV1Beta1Tx.MsgCreateDerivativeMarketOrder
Expand All @@ -29,7 +28,6 @@ const createMarketOrder = (params: MsgCreateDerivativeMarketOrder.Params) => {
orderInfo.feeRecipient = params.feeRecipient
orderInfo.price = params.price
orderInfo.quantity = params.quantity
orderInfo.cid = params.cid || ''

const derivativeOrder =
InjectiveExchangeV1Beta1Exchange.DerivativeOrder.create()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export declare namespace MsgCreateSpotLimitOrder {
feeRecipient: string
price: string
quantity: string
cid?: string
}

export type Proto = InjectiveExchangeV1Beta1Tx.MsgCreateSpotLimitOrder
Expand All @@ -28,7 +27,6 @@ const createLimitOrder = (params: MsgCreateSpotLimitOrder.Params) => {
orderInfo.feeRecipient = params.feeRecipient
orderInfo.price = params.price
orderInfo.quantity = params.quantity
orderInfo.cid = params.cid || ''

const spotOrder = InjectiveExchangeV1Beta1Exchange.SpotOrder.create()
spotOrder.marketId = params.marketId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export declare namespace MsgCreateSpotMarketOrder {
feeRecipient: string
price: string
quantity: string
cid?: string
}

export type Proto = InjectiveExchangeV1Beta1Tx.MsgCreateSpotMarketOrder
Expand All @@ -28,7 +27,6 @@ const createMarketOrder = (params: MsgCreateSpotMarketOrder.Params) => {
orderInfo.feeRecipient = params.feeRecipient
orderInfo.price = params.price
orderInfo.quantity = params.quantity
orderInfo.cid = params.cid || ''

const spotOrder = InjectiveExchangeV1Beta1Exchange.SpotOrder.create()
spotOrder.marketId = params.marketId
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2129,10 +2129,10 @@
dependencies:
browser-headers "^0.4.1"

"@injectivelabs/core-proto-ts@^0.0.19":
version "0.0.19"
resolved "https://registry.npmjs.org/@injectivelabs/core-proto-ts/-/core-proto-ts-0.0.19.tgz#566ea05761e328502647ad9bd32258fa404a430b"
integrity sha512-WV5fBPiGC8Fdx/ga5B+wagqf5B++eGdGCt9HbHnhQkoqRamel01INChJIKwsJrMGsJd5TyHSq0NRnp+N+IIjZA==
"@injectivelabs/core-proto-ts@^0.0.18":
version "0.0.18"
resolved "https://registry.yarnpkg.com/@injectivelabs/core-proto-ts/-/core-proto-ts-0.0.18.tgz#aa60ffde2b52cbbf80a18ba77833ecad605d8fd6"
integrity sha512-WSZS7SQ+I/m8jdc7fhzkMTUhA7i5nVTeKbN6QGqKmOwQ/F+PqM75vDHD9Y9NbLPx9P+m7hyUzSHz4zmajth5jw==
dependencies:
"@injectivelabs/grpc-web" "^0.0.1"
google-protobuf "^3.14.0"
Expand Down

0 comments on commit 30af4a2

Please sign in to comment.