We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 952e4f6 commit 48cca34Copy full SHA for 48cca34
hyperliquid/utils.go
@@ -3,6 +3,7 @@ package hyperliquid
3
import (
4
"crypto/rand"
5
"strconv"
6
+ "sync/atomic"
7
"time"
8
9
"github.com/ethereum/go-ethereum/common/hexutil"
@@ -55,9 +56,11 @@ func GetSlippage(sl *float64) float64 {
55
56
return slippage
57
}
58
59
+var nonceCounter = time.Now().UnixMilli()
60
+
61
// Hyperliquid uses timestamps in milliseconds for nonce
62
func GetNonce() uint64 {
- return uint64(time.Now().UnixMilli())
63
+ return uint64(atomic.AddInt64(&nonceCounter, 1))
64
65
66
// Returns default time range of 90 days
0 commit comments