I have the following code
const connection = new WebSocket('wss://ws.binaryws.com/websockets/v3?app_id=app_id');
const api = new DerivAPIBasic({ connection });
` async function main() {
try {
const account = await api.account('token');
const { balance, currency } = account;
console.log(balance);
} catch (error) {
console.log(error);
}
}`
i have tried getting the balance or currency but instead am getting TypeError: undefined is not a function in this line const account = await api.account('token'); What could i be doing wrong?
I have the following code
` async function main() {
try {
const account = await api.account('token');
const { balance, currency } = account;
i have tried getting the balance or currency but instead am getting TypeError: undefined is not a function in this line const account = await api.account('token'); What could i be doing wrong?