[bisq-network/bisq] Add simple api trading script (#5082)

sqrrm notifications at github.com
Mon Jan 18 13:13:01 CET 2021


@sqrrm commented on this pull request.

I think it would be good to cancel stop the script if it fails at any step. My first time running Bob couldn't find any offers to take but still continued to try to take it. Just looks a bit odd that the script continues after it fails one step that it later depends on.

> +getdummyacctid() {
+	PORT=$1
+	PAYMENT_ACCTS=$(${CLI_BASE} --port=${PORT} getpaymentaccts)
+	DUMMY_ACCT_1=$(echo -e "${PAYMENT_ACCTS}" | sed -n '2p')
+	DUMMY_ACCT_2=$(echo -e "${PAYMENT_ACCTS}" | sed -n '3p')
+	if [[ "$DUMMY_ACCT_1=" == *"PerfectMoney dummy"* ]]; then
+		DUMMY_ACCT=$DUMMY_ACCT_1
+	else
+		DUMMY_ACCT=$DUMMY_ACCT_2
+	fi
+	ACCT_ID=$(echo -e $DUMMY_ACCT | awk '{print $NF}')
+	echo "${ACCT_ID}"
+}
+
+createoffer() {
+ 	CREATE_OFFER_CMD=$1

Indent

> +	if [[ "$DUMMY_ACCT_1=" == *"PerfectMoney dummy"* ]]; then
+		DUMMY_ACCT=$DUMMY_ACCT_1
+	else
+		DUMMY_ACCT=$DUMMY_ACCT_2
+	fi
+	ACCT_ID=$(echo -e $DUMMY_ACCT | awk '{print $NF}')
+	echo "${ACCT_ID}"
+}
+
+createoffer() {
+ 	CREATE_OFFER_CMD=$1
+    OFFER_DESC=$($CREATE_OFFER_CMD)
+
+    ### This is an effort to handling any createoffer error.  If error, should echo Error, and the calling script
+    ### should sleep awhile then exit 1.
+	if [[ "$OFFER_DESC" != "Buy/Sell"* ]]; then

Indent

> + 	STRING=$1
+	NEW_STRING=$(sed 's/+/\\&/g' <<< ${STRING})

Seems there is inconsistent usage of tab vs space for indentation

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/5082#pullrequestreview-570419267
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20210118/9b1024b6/attachment.htm>


More information about the bisq-github mailing list