diff --git a/rpc/types.go b/rpc/types.go
index 2d0cf53be68ff775e5d3761819d859e3f456985b..75c4ba85f95aebd50348248300ed3403b2d3d77e 100644
--- a/rpc/types.go
+++ b/rpc/types.go
@@ -17,6 +17,7 @@
 package rpc
 
 import (
+	"encoding/binary"
 	"encoding/json"
 	"fmt"
 	"math/big"
@@ -65,7 +66,9 @@ func newHexData(input interface{}) *hexdata {
 	case int64:
 		d.data = big.NewInt(input).Bytes()
 	case uint64:
-		d.data = big.NewInt(int64(input)).Bytes()
+		buff := make([]byte, 8)
+		binary.BigEndian.PutUint64(buff, input)
+		d.data = buff
 	case int:
 		d.data = big.NewInt(int64(input)).Bytes()
 	case uint: