Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
4301a0337c | |||
723833d9bb | |||
cb28b55617 | |||
12614ff011 |
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@mojoio/tink",
|
"name": "@mojoio/tink",
|
||||||
"version": "3.1.2",
|
"version": "3.1.4",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "an unofficial api abstraction for tink.com",
|
"description": "an unofficial api abstraction for tink.com",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
|
@ -49,7 +49,7 @@ tap.test('get bankaccounts', async (toolsArg) => {
|
|||||||
const transactions = await bankAccount.getTransactions();
|
const transactions = await bankAccount.getTransactions();
|
||||||
for (const transaction of transactions) {
|
for (const transaction of transactions) {
|
||||||
console.log(`=======================`)
|
console.log(`=======================`)
|
||||||
console.log(JSON.stringify(transaction));
|
console.log(JSON.stringify(transaction.getNormalizedData()));
|
||||||
}
|
}
|
||||||
await toolsArg.delayFor(10000);
|
await toolsArg.delayFor(10000);
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@mojoio/tink',
|
name: '@mojoio/tink',
|
||||||
version: '3.1.2',
|
version: '3.1.4',
|
||||||
description: 'an unofficial api abstraction for tink.com'
|
description: 'an unofficial api abstraction for tink.com'
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ export const getNormalizedAmount = (scaledArg?: ITinkScaledAmount) => {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
amount: parseInt(scaledArg.value.unscaledValue) / (10 ^ parseInt(scaledArg.value.scale)),
|
value: parseInt(scaledArg.value.unscaledValue) * Math.pow(10, -(parseInt(scaledArg.value.scale))),
|
||||||
currency: 'EUR'
|
currency: 'EUR'
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -104,7 +104,10 @@ export class BankTransaction {
|
|||||||
id: this.data.id,
|
id: this.data.id,
|
||||||
amount: tinkHelpers.getNormalizedAmount(this.data.amount),
|
amount: tinkHelpers.getNormalizedAmount(this.data.amount),
|
||||||
name: this.data.descriptions.display,
|
name: this.data.descriptions.display,
|
||||||
description: this.data.descriptions.original
|
description: this.data.descriptions.original,
|
||||||
|
justForLooks: {
|
||||||
|
originalScaledAmount: this.data.amount
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user