@@ -118,12 +118,14 @@ module.exports = function(getRequest, apiKey) {
118
118
* @param {string } address - Transaction address
119
119
* @param {string } startblock - start looking here
120
120
* @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)
121
123
* @param {string } sort - Sort asc/desc
122
124
* @example
123
125
* var txlist = api.account.txlist('0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae', 1, 'latest', 'asc');
124
126
* @returns {Promise.<object> }
125
127
*/
126
- txlist ( address , startblock , endblock , sort ) {
128
+ txlist ( address , startblock , endblock , page , offset , sort ) {
127
129
const module = 'account' ;
128
130
const action = 'txlist' ;
129
131
@@ -134,13 +136,21 @@ module.exports = function(getRequest, apiKey) {
134
136
if ( ! endblock ) {
135
137
endblock = 'latest' ;
136
138
}
139
+
140
+ if ( ! page ) {
141
+ page = '1' ;
142
+ }
143
+
144
+ if ( ! offset ) {
145
+ offset = '100' ;
146
+ }
137
147
138
148
if ( ! sort ) {
139
149
sort = 'asc' ;
140
150
}
141
151
142
152
var query = querystring . stringify ( {
143
- module, action, startblock, endblock, sort, address, apiKey
153
+ module, action, startblock, endblock, page , offset , sort, address, apiKey
144
154
} ) ;
145
155
146
156
return getRequest ( query ) ;
0 commit comments