Skip to content

Commit 0d9065c

Browse files
author
Istvan Miklos
committed
Added "page" and "offset" parameters to account.txlist api.
1 parent d86fd63 commit 0d9065c

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

lib/account.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,14 @@ module.exports = function(getRequest, apiKey) {
109109
* @param {string} address - Transaction address
110110
* @param {string} startblock - start looking here
111111
* @param {string} endblock - end looking there
112+
* @param {string} page - page number to display (default: 1)
113+
* @param {string} offset - number of results per page (default: 100)
112114
* @param {string} sort - Sort asc/desc
113115
* @example
114116
* var txlist = api.account.txlist('0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae', 1, 'latest', 'asc');
115117
* @returns {Promise.<object>}
116118
*/
117-
txlist(address, startblock, endblock, sort) {
119+
txlist(address, startblock, endblock, page, offset, sort) {
118120
const module = 'account';
119121
const action = 'txlist';
120122

@@ -125,13 +127,21 @@ module.exports = function(getRequest, apiKey) {
125127
if (!endblock) {
126128
endblock = 'latest';
127129
}
130+
131+
if (!page) {
132+
page = '1';
133+
}
134+
135+
if (!offset) {
136+
offset = '100';
137+
}
128138

129139
if (!sort) {
130140
sort = 'asc';
131141
}
132142

133143
var query = querystring.stringify({
134-
module, action, startblock, endblock, sort, address, apiKey
144+
module, action, startblock, endblock, page, offset, sort, address, apiKey
135145
});
136146

137147
return getRequest(query);

0 commit comments

Comments
 (0)