Skip to content

cant connect to account #186

Description

@edwinsmasher

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions