Skip to content

Commit b088752

Browse files
authored
Update types.py (#114)
Add string representation to Cloid object
1 parent 9880b05 commit b088752

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

hyperliquid/utils/types.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,12 @@ def _validate(self):
123123
assert self._raw_cloid[:2] == "0x", "cloid is not a hex string"
124124
assert len(self._raw_cloid[2:]) == 32, "cloid is not 16 bytes"
125125

126+
def __str__(self):
127+
return str(self._raw_cloid)
128+
129+
def __repr__(self):
130+
return str(self._raw_cloid)
131+
126132
@staticmethod
127133
def from_int(cloid: int) -> Cloid:
128134
return Cloid(f"{cloid:#034x}")

0 commit comments

Comments
 (0)