Giter Club home page Giter Club logo

hello_loopring's People

Contributors

brechtpd avatar dong77 avatar ebirbe avatar git-sgmoore avatar letsgoustc avatar peterheng666 avatar xiaowheat avatar yueawang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hello_loopring's Issues

How to generate the 192 bits `X-API-SIG` header (/api/v3/apiKey)

Hi,

I have exported my account data, I can run the basic keygen example (using python poseidon_hash_sample.py -a sign -i 1,2,3 -k 0x1), however I'm confused as to what data from my account settings (Public X, public Y, Private EDDSA) to pass to the keygen and in which format.

The doc seems to be missing that part.

My goal is to obtain my API key via /api/v3/apiKey, so I can then connect to the websockets (https://docs.loopring.io/en/websocket/overview.html)

Thanks!

Wrong ECDSA generated for TestNet (uat2) but right one generated for prod (api3)

Hi, I've been using this example to create a LoopringAPI C# wrapper so that us non-python folk can have some of that Loopring fun. Link here https://github.com/taranasus/LoopringAPI

headers.update({'X-API-SIG': "0x" + bytes.hex(v_r_s_to_signature(v, r, s)) + EthSignType.EIP_712})

I've been using this python repo as the basis and test example. Here's the thing. The code works for production just fine, but for uat2 it generates the wrong ECDSA signature. It happens for both the python code linked above and the C# method i've made linked here: https://github.com/taranasus/LoopringAPI/blob/2bf91fb432907ec68662fb31e4dfbe4e1fe45c6d/LoopringAPI/SecureClient.cs#L539

It's been driving me nuts to try and come to this conclusion, as you'd expect the example code in python to work and I was running under the assumption that I was being dumb. but no.

Can you please have a look at this python example and see why it won't work with uat2, so we all know what went wrong.

Make package installable through pip

Hello,

it would be great if the package could be installable via pip, either hosted on PyPI (voluntary) or at least from the repo directly. It would need a setup.py that has all the necessary information for pip.

Installation example via PyPI:
pip install hello_loopring

Installation example via repo:
pip install git+https://github.com/Loopring/hello_loopring

This way it could automatically be used as a dependency in other tools, such as trading frameworks.

Much of the code is currently unusable as-is.
Example 1: the REST API Endpoint that's hard-coded into the client isn't even a real domain: https://github.com/Loopring/hello_loopring/blob/loopring-v3/sdk/loopring_v3_client.py#L25
Example 2: the command line explorer isn't even usable as-is, because it can't import sdk from that folder structure.

Anyone wanting to use the code would need to download and tweak it. That's sad, when it can be made usable with hopefully just minor tweaks.

I could submit a PR if you like.

Thank you.

Pycryptodome keccak.new() takes 0 positional arguments but 1 was given

Hello, I was trying the trading example in my local machine and started downloading the python dependencies manually as soon as I get some ModuleNotFoundError.

At some point I got something like ImportError: cannot import name 'keccak', so searching for it on internet I installed pycryptodome, but got next error:

Traceback (most recent call last):
  File "trading/trading_example.py", line 3, in <module>
    from trading.loopring_rest_sample import LoopringRestApiSample
  File "/home/erick/src/hello_loopring/trading/loopring_rest_sample.py", line 19, in <module>
    from ethsnarks.eddsa import PureEdDSA, PoseidonEdDSA
  File "/home/erick/src/hello_loopring/ethsnarks/eddsa.py", line 10, in <module>
    from .mimc import mimc_hash
  File "/home/erick/src/hello_loopring/ethsnarks/mimc/__init__.py", line 1, in <module>
    from .permutation import mimc, mimc_hash, mimc_hash_md
  File "/home/erick/src/hello_loopring/ethsnarks/mimc/permutation.py", line 32, in <module>
    assert H(123) == 38632140595220392354280998614525578145353818029287874088356304829962854601866
  File "/home/erick/src/hello_loopring/ethsnarks/mimc/permutation.py", line 29, in H
    hashed = keccak_256(data).digest()
  File "/home/erick/src/hello_loopring/ethsnarks/sha3.py", line 7, in <lambda>
    keccak_256 = lambda *args: keccak.new(*args, digest_bits=256)
TypeError: new() takes 0 positional arguments but 1 was given

Looking at the code here I found it could be solved installing pysha3 instead. But I think it should be checked in order to support pycryptodome as it suppose to be.

Also, it would be fine to have a requirements.txt file.

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.