mirror of
https://github.com/bigchaindb/js-bigchaindb-driver.git
synced 2024-11-22 01:36:56 +01:00
wallet, blocks, votes, style
This commit is contained in:
parent
1d950855e9
commit
dde78e19e6
32
index.js
32
index.js
@ -276,10 +276,13 @@ function request(url, config = {}) {
|
||||
|
||||
export function getApiUrls(API_PATH) {
|
||||
return {
|
||||
'blocks': API_PATH + 'blocks',
|
||||
'blocks_detail': API_PATH + 'blocks/%(blockId)s',
|
||||
'outputs': API_PATH + 'outputs',
|
||||
'statuses': API_PATH + 'statuses',
|
||||
'transactions': API_PATH + 'transactions',
|
||||
'transactions_detail': API_PATH + 'transactions/%(txId)s',
|
||||
'outputs': API_PATH + 'outputs',
|
||||
'statuses': API_PATH + 'statuses'
|
||||
'votes': API_PATH + 'votes'
|
||||
};
|
||||
}
|
||||
|
||||
@ -344,4 +347,29 @@ export function getStatus(tx_id, API_PATH) {
|
||||
});
|
||||
}
|
||||
|
||||
export function getBlock(blockId, API_PATH) {
|
||||
return request(getApiUrls(API_PATH)['blocks_detail'], {
|
||||
urlTemplateSpec: {
|
||||
blockId
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export function listBlocks({tx_id, status}, API_PATH) {
|
||||
return request(getApiUrls(API_PATH)['blocks'], {
|
||||
query: {
|
||||
tx_id,
|
||||
status
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export function listVotes(block_id, API_PATH) {
|
||||
return request(getApiUrls(API_PATH)['votes'], {
|
||||
query: {
|
||||
block_id
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user