From 270d1406c5fb30351365ac8cba3716b3db3de341 Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Sun, 15 Dec 2019 23:07:46 +0000 Subject: [PATCH] fix(transactions): enter a starting transaction --- ts/bunq.classes.monetaryaccount.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/ts/bunq.classes.monetaryaccount.ts b/ts/bunq.classes.monetaryaccount.ts index 7c951c3..b542dfb 100644 --- a/ts/bunq.classes.monetaryaccount.ts +++ b/ts/bunq.classes.monetaryaccount.ts @@ -91,8 +91,19 @@ export class MonetaryAccount { /** * gets all transactions no this account */ - public async getTransactions() { - const apiTransactions = await this.bunqAccountRef.bunqJSClient.api.payment.list(this.bunqAccountRef.userId, this.id); + public async getTransactions(startingIdArg: number | false = false) { + const paginationOptions: { + count?: number; + newer_id?: number | false; + older_id?: number | false; + } = { + count: 200, + newer_id: startingIdArg + }; + + + + const apiTransactions = await this.bunqAccountRef.bunqJSClient.api.payment.list(this.bunqAccountRef.userId, this.id, paginationOptions); const transactionsArray: Transaction[] = []; for (const apiTransaction of apiTransactions) { transactionsArray.push(Transaction.fromApiObject(this, apiTransaction));