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

Method hash_order_message

python/ccxt/async_support/derive.py:1118–1126  ·  view source on GitHub ↗
(self, order)

Source from the content-addressed store, hash-verified

1116 }
1117
1118 def hash_order_message(self, order):
1119 accountHash = self.hash(self.eth_abi_encode([
1120 'bytes32', 'uint256', 'uint256', 'address', 'bytes32', 'uint256', 'address', 'address',
1121 ], order), 'keccak', 'binary')
1122 sandboxMode = self.safe_bool(self.options, 'sandboxMode', False)
1123 DOMAIN_SEPARATOR = '9bcf4dc06df5d8bf23af818d5716491b995020f377d3b7b64c29ed14e3dd1105' if (sandboxMode) else 'd96e5f90797da7ec8dc4e276260c7f3f87fedf68775fbe1ef116e996fc60441b'
1124 binaryDomainSeparator = self.base16_to_binary(DOMAIN_SEPARATOR)
1125 prefix = self.base16_to_binary('1901')
1126 return self.hash(self.binary_concat(prefix, binaryDomainSeparator, accountHash), 'keccak', 'hex')
1127
1128 def sign_order(self, order, privateKey):
1129 hashOrder = self.hash_order_message(order)

Callers 1

sign_orderMethod · 0.95

Calls 5

eth_abi_encodeMethod · 0.80
safe_boolMethod · 0.80
base16_to_binaryMethod · 0.80
binary_concatMethod · 0.80
hashMethod · 0.45

Tested by

no test coverage detected