MCPcopy Create free account
hub / github.com/ccxt/ccxt / action_hash

Method action_hash

python/ccxt/async_support/hyperliquid.py:1563–1576  ·  view source on GitHub ↗
(self, action, vaultAddress, nonce, expiresAfter: Int = None)

Source from the content-addressed store, hash-verified

1561 }
1562
1563 def action_hash(self, action, vaultAddress, nonce, expiresAfter: Int = None):
1564 dataBinary = self.packb(action)
1565 dataHex = self.binary_to_base16(dataBinary)
1566 data = dataHex
1567 data += '00000' + self.int_to_base16(nonce)
1568 if vaultAddress is None:
1569 data += '00'
1570 else:
1571 data += '01'
1572 data += vaultAddress
1573 if expiresAfter is not None:
1574 data += '00'
1575 data += '00000' + self.int_to_base16(expiresAfter)
1576 return self.hash(self.base16_to_binary(data), 'keccak', 'binary')
1577
1578 def sign_l1_action(self, action, nonce, vaultAdress: Str = None, expiresAfter: Int = None) -> object:
1579 hash = self.action_hash(action, vaultAdress, nonce, expiresAfter)

Callers 1

sign_l1_actionMethod · 0.95

Calls 5

binary_to_base16Method · 0.80
int_to_base16Method · 0.80
base16_to_binaryMethod · 0.80
packbMethod · 0.45
hashMethod · 0.45

Tested by

no test coverage detected