zigzagexchange / backend Goto Github PK
View Code? Open in Web Editor NEWLicense: GNU General Public License v3.0
License: GNU General Public License v3.0
Link to place of the code -
Line 90 in ef439ba
Explanation: currently you getting tokenInfos step by step (decimals, name, symbol), and you won't get tokenInfos.name while you didnt get contract.decimals. I think it will be a much better use Promise.allSettled here with passing all needed promises to it. The profit is that you'll launch getting three promises in parallel, not step by step as in the current case.
How you can make it (pseudo-code):
const [decimalsRes, nameRes, symbolRes] = await Promise.allSettled([ contract.decimals(), contract.name(), contract.symbol() ]);
Also, i have some syntax proposals for you (like contain some magic values to constants or enums or stuff like that). If you're interested, i can contact with you for help.
When creating an order, a time is pulled from the user. This time is also used to set the market order and limit order expiry. Users can run into issues when their pc clock isn't synced or when they're using VPN.
Solution: stop pulling a time from the users, but use an independent/general source, independent from the user, unrelated to the user, to create the orders.
I am trying to use the API in the REST way due to how my code is set up. I am referring to the code at
https://github.com/ZigZagExchange/frontend/blob/master/src/lib/api/providers/APIZKProvider.js#L127
to submit an order. However, the doc says
The current list of operations available over HTTP POST are: submitorder2, requestquote, orderreceiptreq, refreshliquidity, dailyvolumereq
So it seems there is no way I can get the market info, from which I can retrieve baseAssetDecimals
and quoteAssetDecimals
to create arguments for the syncWallet.getOrder()
call.
I think the problem is we are not exposing subscribemarket
to the HTTP POST APIs.
A temporary solution is for me to hardcode the decimals but that feels a bit hacky. Is there a better solution?
cc @taureau75
got error below when trying to swap. does anyone know how to fix this?
throw new Error('WebSocket is not open: readyState 0 (CONNECTING)');
I would need to know if there is a way to submitorder3 ( or submitorder2) paying the fee in tokens instead of using ETH, thanks.
Hi, was using the operation "submitorder2" using
wss://secret-thicket-93345.herokuapp.com/
but as of yesterday it stopped working, it doesn't send error message but it doesn't swap anymore.
Seems like a rounding up problem or zkSyncs contract can't handle too precise amounts?
Person uses our bridge UI that taps into zkSync's smart contract. Person uses "max" button. Amount gets rounded up and user tries to bridge more than what they actually have. Resulting in failed transaction.
https://etherscan.io/tx/0x785b92239ddd77deb8193e188e0eced833a94547eb8ab5fb01cb2e5b742eb032
https://discord.com/channels/907722916697878559/919189316205428776/919535257907265536
"Tried to send Max amount with dust, and it gave me that error."
"if we allow to deposit only x.xxx we should be good regardless"
"It's Max amount."
"Changed the uint amount a little and 2nd one went through.
1: 2205985190uint
2: 2205985100uint
should have tested if it worked with 2205985189 ( changing uint amount 1 lower)
So when they press Max on our bridge, we should only insert everything before the ''-'' and assume the rest as ''00'' 22059851-00. So basically not add all the ''dust'' of their tokens into the amount. If you get what I mean
I explained it bad but I think you get what i meant lmao. Anyway I g2g for few hours.
or you can test if it works when we leave 1 digit from their dust when they click ''MAX''
I think it might work then too, since I was able to send his amount ( cause I still had balance left of that token in my L1 wallet.)"
"So aslong as you block the person from briding all of their tokens, they will not get this bug.
So when they press ''MAX'' in the bridge interface, just make it so we input all but 1 millionth of the token for them or something."
Description
We want to list market pairs on CoinMarketCap and need a few REST endpoints to do this. This may require some refactoring of the API so things don't get messy like separating endpoints into microservices. While doing this, let's scale the socket and REST API by rebroadcasting socket events via redis client pub/sub so we can run multiple instances in parallel as well as setup heroku autoscaling (dynos) so we're not phased by further DDOS attacking haters. Continuous integration should be a couple switches in the heroku dashboard so let's throw that in there and setup production (prod
) and staging (master
) branches.
Goals
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.