Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Tai 'Mr. T' Truong committed Mar 16, 2023
1 parent 97a692e commit 33f9bc1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions cli/query-tokens.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,19 @@ function query_tokens() {
else
TOKENS=`echo $QUERY_OUTPUT | jq '.data.onfts'`
fi
NEXT_KEY=`echo $QUERY_OUTPUT | jq '.data.pagination.next_key'`
NEXT_KEY=`echo $QUERY_OUTPUT | jq -r '.data.pagination.next_key'`
if [[ -z "$NEXT_KEY" ]] || [[ "$NEXT_KEY" = null ]];then
break
fi
# add to list
ALL_TOKENS=`echo "$ALL_TOKENS" | jq ". + $TOKENS"`

PAGE=`expr $PAGE + 1`
DECODED_NEXT_KEY=`echo Z2lyMS9pYnJhaGltYXJzbGFubjU5 | base64 -d`
printf -v QUERY_CMD "$CLI query $ICS721_MODULE collection '$COLLECTION' --page-key $DECODED_NEXT_KEY"

DECODED_NEXT_KEY=
[[ ! -z "$NEXT_KEY" ]] && [[ ! "$NEXT_KEY" = null ]] && DECODED_NEXT_KEY=`echo $NEXT_KEY | base64 -d` # decode next key
printf -v QUERY_CMD "$CLI query $ICS721_MODULE collection '$COLLECTION' %s"\
"$( [ ! -z "$DECODED_NEXT_KEY" ] && echo "--page-key $DECODED_NEXT_KEY" || echo "")"
done
fi

Expand Down

0 comments on commit 33f9bc1

Please sign in to comment.