mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-22 22:45:21 +01:00
Move createoffer command generation to its own function
This commit is contained in:
parent
5a78d18103
commit
74008e9385
2 changed files with 19 additions and 12 deletions
|
@ -179,6 +179,24 @@ showcreatepaymentacctsteps() {
|
|||
printbreak
|
||||
}
|
||||
|
||||
gencreateoffercommand() {
|
||||
PORT="$1"
|
||||
ACCT_ID="$2"
|
||||
CMD="$CLI_BASE --port=$PORT createoffer"
|
||||
CMD+=" --payment-account=$ACCT_ID"
|
||||
CMD+=" --direction=$DIRECTION"
|
||||
CMD+=" --currency-code=$CURRENCY_CODE"
|
||||
CMD+=" --amount=$AMOUNT"
|
||||
if [ -z "$MKT_PRICE_MARGIN" ]; then
|
||||
CMD+=" --fixed-price=$FIXED_PRICE"
|
||||
else
|
||||
CMD+=" --market-price-margin=$MKT_PRICE_MARGIN"
|
||||
fi
|
||||
CMD+=" --security-deposit=15.0"
|
||||
CMD+=" --fee-currency=BSQ"
|
||||
echo "$CMD"
|
||||
}
|
||||
|
||||
createoffer() {
|
||||
CREATE_OFFER_CMD="$1"
|
||||
OFFER_DESC=$($CREATE_OFFER_CMD)
|
||||
|
|
|
@ -86,18 +86,7 @@ printdate "ALICE $ALICE_ROLE: Creating $DIRECTION $CURRENCY_CODE offer with pay
|
|||
CURRENT_PRICE=$(getcurrentprice "$ALICE_PORT" "$CURRENCY_CODE")
|
||||
exitoncommandalert $?
|
||||
printdate "Current Market Price: $CURRENT_PRICE"
|
||||
CMD="$CLI_BASE --port=$ALICE_PORT createoffer"
|
||||
CMD+=" --payment-account=$ALICE_ACCT_ID"
|
||||
CMD+=" --direction=$DIRECTION"
|
||||
CMD+=" --currency-code=$CURRENCY_CODE"
|
||||
CMD+=" --amount=$AMOUNT"
|
||||
if [ -z "$MKT_PRICE_MARGIN" ]; then
|
||||
CMD+=" --fixed-price=$FIXED_PRICE"
|
||||
else
|
||||
CMD+=" --market-price-margin=$MKT_PRICE_MARGIN"
|
||||
fi
|
||||
CMD+=" --security-deposit=15.0"
|
||||
CMD+=" --fee-currency=BSQ"
|
||||
CMD=$(gencreateoffercommand "$ALICE_PORT" "$ALICE_ACCT_ID")
|
||||
printdate "ALICE CLI: $CMD"
|
||||
OFFER_ID=$(createoffer "$CMD")
|
||||
exitoncommandalert $?
|
||||
|
|
Loading…
Add table
Reference in a new issue