mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-02 07:26:53 +00:00
Deribit: Replace bespoke message IDs with uuid v7 (#1995)
* Deribit: Switch to string IDs Switch from int to string IDs so we can use UUID.v7 instead of (the only) local high precision message id implementation * Deribit: Dedup wsResponse / wsResponse * Deribit: Use uuid v7 for IDs This moves away from centralising message ids. There's no real benefit to moving them to a central generator, since we can one-line it, and reduce our testing plane and complexity. And it's more concise for exchanges to say "I'm using this UUID". * Deribit: Handle errors from StartHeartbeat * Deribit: Simplify WS ID matching * Exchanges: Add MessageID function to base
This commit is contained in:
@@ -15,6 +15,7 @@ import (
|
||||
"time"
|
||||
"unicode"
|
||||
|
||||
"github.com/gofrs/uuid"
|
||||
"github.com/thrasher-corp/gocryptotrader/common"
|
||||
"github.com/thrasher-corp/gocryptotrader/common/key"
|
||||
"github.com/thrasher-corp/gocryptotrader/config"
|
||||
@@ -1959,3 +1960,9 @@ func (*Base) WebsocketSubmitOrder(context.Context, *order.Submit) (*order.Submit
|
||||
func (*Base) WebsocketSubmitOrders(context.Context, []*order.Submit) (responses []*order.SubmitResponse, err error) {
|
||||
return nil, common.ErrFunctionNotSupported
|
||||
}
|
||||
|
||||
// MessageID returns a universally unique id using UUID V7
|
||||
// In the future additional params may be added to method signature to provide context for the message id for overriding exchange implementations
|
||||
func (b *Base) MessageID() string {
|
||||
return uuid.Must(uuid.NewV7()).String()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user