Skip to content

Commit

Permalink
client/webserver: Update Order-details Type to show the correct value. (
Browse files Browse the repository at this point in the history
#3044)

* client/webserver: Update Order-details Type to show the correct value.

* Also cleaned up walletpair BW_ARGS to override dexc.conf options.
---------

Co-authored-by: dev-warrior777 <>
  • Loading branch information
dev-warrior777 authored Oct 30, 2024
1 parent 717fc3e commit 478851d
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 3 deletions.
5 changes: 5 additions & 0 deletions client/webserver/jsintl.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ const (
limitOrderID = "LIMIT_ORDER"
limitOrderImmediateTifID = "LIMIT_ORDER_IMMEDIATE_TIF"
marketOrderID = "MARKET_ORDER"
cancelOrderID = "CANCEL_ORDER"
matchStatusNewlyMatchedID = "MATCH_STATUS_NEWLY_MATCHED"
matchStatusMakerSwapCastID = "MATCH_STATUS_MAKER_SWAP_CAST"
matchStatusTakerSwapCastID = "MATCH_STATUS_TAKER_SWAP_CAST"
Expand Down Expand Up @@ -304,6 +305,7 @@ var enUS = map[string]*intl.Translation{
limitOrderID: {T: "limit"},
limitOrderImmediateTifID: {T: "limit (i)", Notes: "i = immediate"},
marketOrderID: {T: "market"},
cancelOrderID: {T: "cancel"},
matchStatusNewlyMatchedID: {T: "Newly Matched"},
matchStatusMakerSwapCastID: {T: "Maker Swap Sent"},
matchStatusTakerSwapCastID: {T: "Taker Swap Sent"},
Expand Down Expand Up @@ -525,6 +527,9 @@ var zhCN = map[string]*intl.Translation{
createID: {T: "创建"},
availableID: {T: "可用"},
immatureID: {T: "不成"},
limitOrderID: {T: "限价单"},
marketOrderID: {T: "市价单"},
cancelOrderID: {T: "取消单"},
}

var plPL = map[string]*intl.Translation{
Expand Down
1 change: 1 addition & 0 deletions client/webserver/site/src/js/locales.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export const ID_UNSUPPORTED_ASSET_INFO_ERR_MSG = 'UNSUPPORTED_ASSET_INFO_ERR_MSG
export const ID_LIMIT_ORDER = 'LIMIT_ORDER'
export const ID_LIMIT_ORDER_IMMEDIATE_TIF = 'LIMIT_ORDER_IMMEDIATE_TIF'
export const ID_MARKET_ORDER = 'MARKET_ORDER'
export const ID_CANCEL_ORDER = 'CANCEL_ORDER'
export const ID_MATCH_STATUS_NEWLY_MATCHED = 'MATCH_STATUS_NEWLY_MATCHED'
export const ID_MATCH_STATUS_MAKER_SWAP_CAST = 'MATCH_STATUS_MAKER_SWAP_CAST'
export const ID_MATCH_STATUS_TAKER_SWAP_CAST = 'MATCH_STATUS_TAKER_SWAP_CAST'
Expand Down
2 changes: 1 addition & 1 deletion client/webserver/site/src/js/markets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1713,7 +1713,7 @@ export default class MarketsPage extends BasePage {
else rateStr = Doc.formatRateFullPrecision(ord.rate, market.baseUnitInfo, market.quoteUnitInfo, cfg.ratestep)
details.rate.textContent = mord.header.rate.textContent = rateStr
header.baseSymbol.textContent = market.baseUnitInfo.conventional.unit
details.type.textContent = market.quoteUnitInfo.conventional.unit
details.type.textContent = OrderUtil.orderTypeText(ord.type)
this.updateMetaOrder(mord)

Doc.bind(div, 'mouseenter', () => {
Expand Down
11 changes: 11 additions & 0 deletions client/webserver/site/src/js/orderutil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,3 +244,14 @@ function dexAssetSymbol (host: string, assetID: number): string {
export function isCancellable (ord: Order): boolean {
return ord.type === Limit && ord.tif === StandingTiF && ord.status < StatusExecuted
}

export function orderTypeText (ordType: number): string {
switch (ordType) {
case OrderTypeLimit:
return intl.prep(intl.ID_LIMIT_ORDER)
case OrderTypeMarket:
return intl.prep(intl.ID_MARKET_ORDER)
default: // OrderTypeCancel
return intl.prep(intl.ID_CANCEL_ORDER)
}
}
4 changes: 2 additions & 2 deletions dex/testing/walletpair/walletpair.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ while [ "${1:-}" != "" ]; do
;;
-2)
ONLY_TWO="1"
echo "Only starting wallet # 1"
echo "Only starting wallet # 2"
;;
*)
BW_ARGS+=("$1")
BW_ARGS+=" ${1}"
;;
esac
shift
Expand Down

0 comments on commit 478851d

Please sign in to comment.