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

Method handle_builder_fee_approval

python/ccxt/hyperliquid.py:1764–1780  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1762 return True
1763
1764 def handle_builder_fee_approval(self):
1765 buildFee = self.safe_bool(self.options, 'builderFee', True)
1766 approvedBuilderFee = self.safe_bool(self.options, 'approvedBuilderFee', False)
1767 if approvedBuilderFee:
1768 return True # skip if builder fee is already approved
1769 try:
1770 builder = self.safe_string(self.options, 'builder', '0x6530512A6c89C7cfCEbC3BA7fcD9aDa5f30827a6')
1771 # when the user disables the builder fee(builderFee = False) we still approve and attach the builder,
1772 # but with a 0% fee rate, so orders remain attributed to the builder for statistics purposes only and the user is not charged
1773 maxFeeRate = self.safe_string(self.options, 'feeRate', '0.01%')
1774 if not buildFee:
1775 maxFeeRate = '0%'
1776 self.approve_builder_fee(builder, maxFeeRate)
1777 self.options['approvedBuilderFee'] = True
1778 except Exception as e:
1779 self.options['builderFee'] = False # disable builder fee if an error occurs
1780 return True
1781
1782 def is_unified_enabled(self, method: str, address: Str = None, shouldRefresh=False, params={}) -> list:
1783 """

Callers 1

initialize_clientMethod · 0.95

Calls 3

approve_builder_feeMethod · 0.95
safe_boolMethod · 0.80
safe_stringMethod · 0.80

Tested by

no test coverage detected