Giter Club home page Giter Club logo

Comments (7)

JakubMartinovicHusar avatar JakubMartinovicHusar commented on July 21, 2024

I ran the same code for binance futures and it worked just fine.

from ccxt.

carlosmiei avatar carlosmiei commented on July 21, 2024

Hello @JakubMartinovicHusar, we will take a look and revert

from ccxt.

carlosmiei avatar carlosmiei commented on July 21, 2024

@JakubMartinovicHusar I just tested and it seems to be working

 npm run cli.cs -- hyperliquid WatchOrders "SOL/USDC:USDC" --verbose --sandbox

> [email protected] cli.cs
> dotnet run --project "./cs/cli/cli.csproj" hyperliquid WatchOrders SOL/USDC:USDC --verbose --sandbox

[
  "SOL/USDC:USDC"
]
WebSocket connected to wss://api.hyperliquid-testnet.xyz/ws
Sending message: {"method":"subscribe","subscription":{"type":"orderUpdates","user":"0x3B3741c0EFf9C6b556Ec813e70589161F416662A"}}
On message: {"channel":"subscriptionResponse","data":{"method":"subscribe","subscription":{"type":"orderUpdates","user":"0x3b3741c0eff9c6b556ec813e70589161f416662a"}}}
On message: {"channel":"orderUpdates","data":[{"order":{"coin":"SOL","side":"B","limitPx":"183.75","sz":"0.1","oid":9893803368,"timestamp":1718099116378,"origSz":"0.1"},"status":"open","statusTimestamp":1718099116378},{"order":{"coin":"SOL","side":"B","limitPx":"183.75","sz":"0.0","oid":9893803368,"timestamp":1718099116378,"origSz":"0.1"},"status":"filled","statusTimestamp":1718099116378}]}
[
  {
    "id": "9893803368",
    "clientOrderId": null,
    "timestamp": 1718099116378,
    "datetime": "2024-06-11T09:45:16.378Z",
    "lastTradeTimestamp": null,
    "symbol": "SOL/USDC:USDC",
    "type": null,
    "side": "buy",
    "price": 183.75,
    "cost": null,
    "average": null,
    "amount": null,
    "filled": null,
    "triggerPrice": null,
    "stopLossPrice": null,
    "takeProfitPrice": null,
    "remaining": 0.0,
    "status": "closed",
    "reduceOnly": false,
    "postOnly": false,
    "fee": {
      "rate": null,
      "cost": null
    },
    "trades": [],
    "info": {
      "order": {
        "coin": "SOL",
        "side": "B",
        "limitPx": "183.75",
        "sz": "0.0",
        "oid": 9893803368,
        "timestamp": 1718099116378,
        "origSz": "0.1"
      },
      "status": "filled",
      "statusTimestamp": 1718099116378
    }
  }
]

@JakubMartinovicHusar If you enable the verbose mode can you check which wallet is being used to subscribe?

from ccxt.

JakubMartinovicHusar avatar JakubMartinovicHusar commented on July 21, 2024

@carlosmiei thank you for answer.

I have investigated it further as you suggested and it indeed works. I had to add explicit user parameter. I was using only walletAddress parameter when instantiating exchange which is eventual API wallet key. You need to specify user - wallet address to watch orders.
var ordersTask = this.exchange.WatchOrders(
parameters: new Dictionary<string, object>(){{"user", "0x...4"}}
);

@carlosmiei thank your for your help!

from ccxt.

carlosmiei avatar carlosmiei commented on July 21, 2024

@JakubMartinovicHusar Glad it worked now, but just to make it clear you just need to specify user if it's different from the walletAddress. Alternatively, you can set it in the options so you don't need to provide it manually every single time, example:

exchange.options["user"] = "new address"; // will override `walletAddress` whenever it's needed

from ccxt.

JakubMartinovicHusar avatar JakubMartinovicHusar commented on July 21, 2024

Even better! Thank you @carlosmiei!

from ccxt.

carlosmiei avatar carlosmiei commented on July 21, 2024

@JakubMartinovicHusar No problem! Will close this issue then, feel free to re-open it if needed.
Thanks!

from ccxt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.