1
0
mirror of https://github.com/bigchaindb/js-bigchaindb-driver.git synced 2024-11-22 01:36:56 +01:00

adding async method

This commit is contained in:
amed83 2018-06-12 14:42:42 +02:00
parent 206e4cec5f
commit d812e64b30

View File

@ -24,6 +24,7 @@ export default class Connection {
'outputs': 'outputs', 'outputs': 'outputs',
'transactions': 'transactions', 'transactions': 'transactions',
'transactionsSync': 'transactions?mode=sync', 'transactionsSync': 'transactions?mode=sync',
'transactionsAsync': 'transactions?mode=async',
'transactionsCommit': 'transactions?mode=commit', 'transactionsCommit': 'transactions?mode=commit',
'transactionsDetail': 'transactions/%(transactionId)s', 'transactionsDetail': 'transactions/%(transactionId)s',
'assets': 'assets', 'assets': 'assets',
@ -118,7 +119,7 @@ export default class Connection {
* @param transaction * @param transaction
*/ */
postTransaction(transaction) { postTransaction(transaction) {
return this._req(this.getApiUrls('transactions'), { return this._req(this.getApiUrls('transactionsCommit'), {
method: 'POST', method: 'POST',
jsonBody: transaction jsonBody: transaction
}) })
@ -134,6 +135,18 @@ export default class Connection {
}) })
} }
/**
* @param transaction
*/
postTransactionAsync(transaction) {
return this._req(this.getApiUrls('transactionsAsync'), {
method: 'POST',
jsonBody: transaction
})
}
/** /**
* @param transaction * @param transaction
*/ */