Skip to content

Commit

Permalink
adding async method
Browse files Browse the repository at this point in the history
  • Loading branch information
amed83 committed Jun 12, 2018
1 parent 206e4ce commit d812e64
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export default class Connection {
'outputs': 'outputs',
'transactions': 'transactions',
'transactionsSync': 'transactions?mode=sync',
'transactionsAsync': 'transactions?mode=async',
'transactionsCommit': 'transactions?mode=commit',
'transactionsDetail': 'transactions/%(transactionId)s',
'assets': 'assets',
Expand Down Expand Up @@ -118,7 +119,7 @@ export default class Connection {
* @param transaction
*/
postTransaction(transaction) {
return this._req(this.getApiUrls('transactions'), {
return this._req(this.getApiUrls('transactionsCommit'), {
method: 'POST',
jsonBody: transaction
})
Expand All @@ -134,6 +135,18 @@ export default class Connection {
})
}


/**
* @param transaction
*/
postTransactionAsync(transaction) {
return this._req(this.getApiUrls('transactionsAsync'), {
method: 'POST',
jsonBody: transaction
})
}


/**
* @param transaction
*/
Expand Down

0 comments on commit d812e64

Please sign in to comment.