@@ -109,12 +109,14 @@ module.exports = function(getRequest, apiKey) {
109
109
* @param {string } address - Transaction address
110
110
* @param {string } startblock - start looking here
111
111
* @param {string } endblock - end looking there
112
+ * @param {number } page - Page number
113
+ * @param {number } offset - Max records to return
112
114
* @param {string } sort - Sort asc/desc
113
115
* @example
114
- * var txlist = api.account.txlist('0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae', 1, 'latest', 'asc');
116
+ * var txlist = api.account.txlist('0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae', 1, 'latest', 1, 100, 'asc');
115
117
* @returns {Promise.<object> }
116
118
*/
117
- txlist ( address , startblock , endblock , sort ) {
119
+ txlist ( address , startblock , endblock , page , offset , sort ) {
118
120
const module = 'account' ;
119
121
const action = 'txlist' ;
120
122
@@ -126,12 +128,20 @@ module.exports = function(getRequest, apiKey) {
126
128
endblock = 'latest' ;
127
129
}
128
130
131
+ if ( ! page ) {
132
+ page = 1 ;
133
+ }
134
+
135
+ if ( ! offset ) {
136
+ offset = 100 ;
137
+ }
138
+
129
139
if ( ! sort ) {
130
140
sort = 'asc' ;
131
141
}
132
142
133
143
var query = querystring . stringify ( {
134
- module, action, startblock, endblock, sort, address, apiKey
144
+ module, action, startblock, endblock, page , offset , sort, address, apiKey
135
145
} ) ;
136
146
137
147
return getRequest ( query ) ;
0 commit comments