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

How to perform trades? #3870

Open
gndelia opened this issue Aug 31, 2023 · 6 comments
Open

How to perform trades? #3870

gndelia opened this issue Aug 31, 2023 · 6 comments

Comments

@gndelia
Copy link

gndelia commented Aug 31, 2023

I'm looking to trade some ETH to USDC (or at least, I'm first trying to do so in goerli testchain).

The REST API has some operations for that, but I can't find how to do so in the js SDK. Is it supported? Or should I go through the REST API?

@Antuan03
Copy link

you still need assistance ?

@gndelia
Copy link
Author

gndelia commented Sep 23, 2023

@Antuan03 I was able to trade using the REST API, instead of the SDK using this endpoint https://developers.bitgo.com/api/trade.orders.add - I've got to admit it was a bit confusing, especially in the testing env, but I managed to make it work. Perhaps more working examples (both for the testing and prod envs) would be appreciated.

It also was not clear to me what was supported by the SDK and what wasn't, so I ended up using the REST API for everything.

Other than that, you can close this issue if you want

@Antuan03
Copy link

via the sdk

` const bitgo = new BitGo({
accessToken: accessToken,
env: 'test',
});

const wallet = await bitgo
  .coin(gtusdt)
  .wallets()
  .get({
    id: userWallet?.wallet_id,
  });

let userParams = {
  amount: "amount in wei,
  address: 'address',
  walletPassphrase: userWallet?.passphrase,
};

const transaction1 = await wallet.send(userParams);

console.log( transaction1)
`

good luck!!

@gndelia
Copy link
Author

gndelia commented Sep 26, 2023

@Antuan03 but that's to send crypto, not for trading, which is this issue about 🤔

@Antuan03
Copy link

oh my bad :x

@deepak2165
Copy link

I don't think we can perform trade using bitgo sdk. I have gone through the whole doc when i was looking for the same but didn't found any. So i performed the trade using API.

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

3 participants