Skip to content

Commit d86fd63

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

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

dist/bundle.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,14 @@ module.exports = function(getRequest, apiKey) {
118118
* @param {string} address - Transaction address
119119
* @param {string} startblock - start looking here
120120
* @param {string} endblock - end looking there
121+
* @param {string} page - page number to display (default: 1)
122+
* @param {string} offset - number of results per page (default: 100)
121123
* @param {string} sort - Sort asc/desc
122124
* @example
123125
* var txlist = api.account.txlist('0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae', 1, 'latest', 'asc');
124126
* @returns {Promise.<object>}
125127
*/
126-
txlist(address, startblock, endblock, sort) {
128+
txlist(address, startblock, endblock, page, offset, sort) {
127129
const module = 'account';
128130
const action = 'txlist';
129131

@@ -134,13 +136,21 @@ module.exports = function(getRequest, apiKey) {
134136
if (!endblock) {
135137
endblock = 'latest';
136138
}
139+
140+
if (!page) {
141+
page = '1';
142+
}
143+
144+
if (!offset) {
145+
offset = '100';
146+
}
137147

138148
if (!sort) {
139149
sort = 'asc';
140150
}
141151

142152
var query = querystring.stringify({
143-
module, action, startblock, endblock, sort, address, apiKey
153+
module, action, startblock, endblock, page, offset, sort, address, apiKey
144154
});
145155

146156
return getRequest(query);

0 commit comments

Comments
 (0)