Skip to content

Commit

Permalink
Merge pull request #56 from TrustyFund/54-sell-wait-buy-broadcast
Browse files Browse the repository at this point in the history
transactions sell orders clear on fill
  • Loading branch information
youaresofunny authored Apr 2, 2018
2 parents 7f0bcd8 + 257755c commit 76d844d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/actions/transactions.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ export const processPendingOrders = async (store) => {
error: sellResult.error
};
}
commit(types.PROCESS_PENDING_ORDERS_SELL_COMPLETE);
}
if (pendingOrders.buyOrders.length) {
const buyResult = await API.Transactions.placeOrders({
Expand Down
3 changes: 3 additions & 0 deletions src/modules/transactions.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ const mutations = {
},
[types.FETCH_FEES](state, { fees }) {
state.fees = fees;
},
[types.PROCESS_PENDING_ORDERS_SELL_COMPLETE](state) {
state.pendingOrders.sellOrders = [];
}
};

Expand Down
1 change: 1 addition & 0 deletions src/mutations.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export const RESET_PENDING_ORDERS = 'RESET_PENDING_ORDERS';
export const PROCESS_PENDING_ORDERS_REQUEST = 'PROCESS_PENDING_ORDERS_REQUEST';
export const PROCESS_PENDING_ORDERS_COMPLETE = 'PROCESS_PENDING_ORDERS_COMPLETE';
export const PROCESS_PENDING_ORDERS_ERROR = 'PROCESS_PENDING_ORDERS_ERROR';
export const PROCESS_PENDING_ORDERS_SELL_COMPLETE = 'PROCESS_PENDING_ORDERS_SELL_COMPLETE';

export const FETCH_FEES = 'FETCH_FEES';

Expand Down
1 change: 1 addition & 0 deletions src/services/api/transactions.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ const placeOrders = async ({ orders, keys }) => {
try {
await transaction.set_required_fees();
await transaction.broadcast();
console.log('finish await broadcast');
clearTimeout(broadcastTimeout);
resolve({ success: true });
} catch (error) {
Expand Down

0 comments on commit 76d844d

Please sign in to comment.