@@ -165,13 +165,15 @@ module.exports = function(getRequest, apiKey) {
165
165
* @param {string } address - Account address
166
166
* @param {string } startblock - start looking here
167
167
* @param {string } endblock - end looking there
168
- * @param {string } sort - Sort asc/desc
168
+ * @param {number } page - Page number
169
+ * @param {number } offset - Max records to return
170
+ * @param {string } sort - Sort asc/desc
169
171
* @param {string } contractaddress - Address of ERC20 token contract (if not specified lists transfers for all tokens)
170
172
* @example
171
173
* var txlist = api.account.tokentx('0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae', '0x5F988D968cb76c34C87e6924Cc1Ef1dCd4dE75da', 1, 'latest', 'asc');
172
174
* @returns {Promise.<object> }
173
175
*/
174
- tokentx ( address , contractaddress , startblock , endblock , sort ) {
176
+ tokentx ( address , contractaddress , startblock , endblock , page , offset , sort ) {
175
177
const module = 'account' ;
176
178
const action = 'tokentx' ;
177
179
@@ -183,12 +185,20 @@ module.exports = function(getRequest, apiKey) {
183
185
endblock = 'latest' ;
184
186
}
185
187
188
+ if ( ! page ) {
189
+ page = 1 ;
190
+ }
191
+
192
+ if ( ! offset ) {
193
+ offset = 100 ;
194
+ }
195
+
186
196
if ( ! sort ) {
187
197
sort = 'asc' ;
188
198
}
189
199
190
200
var queryObject = {
191
- module, action, startblock, endblock, sort, address, apiKey
201
+ module, action, startblock, endblock, page , offset , sort, address, apiKey
192
202
} ;
193
203
194
204
if ( contractaddress ) {
0 commit comments