Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cant connect to account #186

Open
edwinsmasher opened this issue Apr 28, 2023 · 1 comment
Open

cant connect to account #186

edwinsmasher opened this issue Apr 28, 2023 · 1 comment

Comments

@edwinsmasher
Copy link

edwinsmasher commented Apr 28, 2023

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?

@JamesK254
Copy link

change the "app_id=app_id to like app_id=1089
'wss://ws.binaryws.com/websockets/v3?app_id=app_id'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants