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:
parent
206e4cec5f
commit
d812e64b30
@ -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
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user