yanue / starkex Goto Github PK
View Code? Open in Web Editor NEWstark key authentication library, signature generator for dydx exchange
License: MIT License
stark key authentication library, signature generator for dydx exchange
License: MIT License
I installed the signature generator for dydx exchange, but I don't how to use it.
NetworkId: NETWORK_ID_MAINNET,
CreditAmount: "1",
DebitAmount: "2",
SenderPositionId: 12345, //这些参数是什么意思?
ReceiverPositionId: 67890,//这些参数是什么意思?
ReceiverPublicKey: "04a9ecd28a67407c3cff8937f329ca24fd631b1d9ca2b9f2df47c7ebf72bf0b0",//这些参数是什么意思?
ReceiverAddress: "0x1234567890123456789012345678901234567890",//这些参数是什么意思?
Expiration: "2020-09-17T04:15:55.028Z",
ClientId: "This is an ID that the client came up with to describe this transfer",
dydx/starkex moved to goerli network. Current starkex package doesn't support it. Is it possible to add such support?
orderSignParam := starkex.OrderSignParam{
NetworkId: 5, // dydx testnet
// ...
}
signature, err := starkex.OrderSign(starkexCredsPrivateKey, orderSignParam)
if err != nil {
return err // <- here
}
This is the source of error - https://github.com/yanue/starkex/blob/master/sign_order.go#L36
2022/08/22 00:35:35 {NetworkId:3 PositionId:1 Market:ETH-USD Side:BUY HumanSize:0.1 HumanPrice:1500 LimitFee:0.01 ClientId:8141797145391901 Expiration:2022-08-21T16:40:35.548Z}
2022/08/22 00:35:35 https://api.stage.dydx.exchange/v3/orders
go-dydx 2022/08/22 00:35:36 uri: /v3/orders, code: 400, err msg: {"errors":[{"msg":"Invalid signature for order"}]}
Is this library still works? Could you please admit it? It looks like I didn't change anything in my code but it's not working any longer.
This is how I use it
orderSignParam := starkex.OrderSignParam{
NetworkId: r.networkID, // 3
PositionId: r.positionID, // got from getAccount()
Market: req.Market, // "ETH-USD"
Side: "BUY",
HumanSize: req.Size, // 1
HumanPrice: req.Price, // 1
LimitFee: req.LimitFee, // "0.000000"
ClientId: req.ClientId, // "1"
Expiration: expiration, // "2023-04-05T15:50:15.285Z"
}
signature, err := starkex.OrderSign(r.starkexCreds.PrivateKey, orderSignParam) // FIXME invaid signature
if err != nil {
return fmt.Errorf("starkex sing: %w", err)
}
req.ClientId, // "1"
thoughUPD: clientID
if generated now, it wasn't the problem
I think you last commit where you've added concurrency to crypto stuff broke something. Rollback to the prev version fixed the problem
使用 golang 通过 grpc 调用官方 python 的 https://github.com/dydxprotocol/dydx-v3-python
与直接调用该库进行延时对比,发现该库的延迟是官方 python 包的一倍。
多次测试均差不多为该结果。
Currently, the SYNTHETIC_ID_MAP
and ASSET_RESOLUTION
don't include a lot of the newly added markets on DYDX as shown in the v3-python implementation: https://github.com/dydxprotocol/dydx-v3-python/blob/dc7705ed51891c4901f26bfed9ca91a0e95ce1aa/dydx3/constants.py#L61
Please add support for all the markets as we cannot submit Orders because the signature fails on non-supported markets as outlined in the constants.go
file
https://github.com/yanue/starkex/blob/master/const.go
Hi,is it posdible to have a go exsample to create order using your the dydx stark/signature on ropsten?
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.