Skip to content

Commit

Permalink
fix: api txs
Browse files Browse the repository at this point in the history
  • Loading branch information
nikashitsa committed Sep 12, 2023
1 parent 0cdae8d commit 26f3aaf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/api/Accounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default class Accounts {
isActive: data.isActive,
};
}
async txs(accountName, cursor) {
async txs(accountName, cursor = 0) {
const data = await this.#wallet.requestNode({
method: 'GET',
url: `api/v1/account/${accountName}/txs`,
Expand All @@ -34,12 +34,13 @@ export default class Accounts {
},
});
const hasMore = data.txs.length === data.limit;
if (hasMore) cursor += data.txs.length;
return {
transactions: data.txs.filter((tx) => {
return tx.isEosTransfer;
}),
hasMore,
cursor: data.txs.length,
cursor,
};
}
async accountNameByKey(publicKey) {
Expand Down

0 comments on commit 26f3aaf

Please sign in to comment.