fix(core): update

This commit is contained in:
2022-10-29 16:18:29 +02:00
parent 9b7f25c996
commit 22239ddbeb
10 changed files with 4461 additions and 15290 deletions

1
ts/helpers/index.ts Normal file
View File

@ -0,0 +1 @@
export * from './tinkmath.js';

22
ts/helpers/tinkmath.ts Normal file
View File

@ -0,0 +1,22 @@
export interface ITinkScaledAmount {
value: {
unscaledValue: string;
scale: string;
};
currencyCode: string;
}
/**
* returns a normalized amount
* @param scaledArg
* @returns
*/
export const getNormalizedAmount = (scaledArg?: ITinkScaledAmount) => {
if (!scaledArg) {
return null;
}
return {
amount: parseInt(scaledArg.value.unscaledValue) / (10 ^ parseInt(scaledArg.value.scale)),
currency: 'EUR'
};
};