How to assign a correct type to remove the error??? I've tried different solutions but always I get a different type of error. This one is the most understandable.
Here it is Typescript Error Message:
error TS2345: Argument of type '([currency, data]: [string, { available: string;}]) => void' is not assignable to parameter of type '(value: [string, { avaiable: string; }], index: number, array: [string, { avaiable: string; }][]) => void'. Types of parameters '__0' and 'value' are incompatible. Type '[string, { avaiable: string; }]' is not assignable to type '[string, { available: string; }]'. Property 'available' is missing in type '{ avaiable: string; }' but required in type '{ available: string; }'.
interface Balances {
[key: string]: { avaiable: string };
}
binance.balance(async (error: any, balances: Balances) => {
Object.entries(balances).map(
([currency, data]: [string, { available: string }]) => {
console.log(data.available);
console.log(currency)
}
);
}