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

Method approve_builder_fee

python/ccxt/async_support/lighter.py:613–635  ·  view source on GitHub ↗
(self, builder: float, takerFeeRate: float, makerFeeRate: float, accountIndex: float, apiKeyIndex: float, params: object = {})

Source from the content-addressed store, hash-verified

611 return True
612
613 async def approve_builder_fee(self, builder: float, takerFeeRate: float, makerFeeRate: float, accountIndex: float, apiKeyIndex: float, params: object = {}):
614 strAccountIndex = self.number_to_string(accountIndex)
615 strApiKeyIndex = self.number_to_string(apiKeyIndex)
616 signer = await self.load_account(self.options['chainId'], self.get_lighter_private_key(strAccountIndex, strApiKeyIndex), strApiKeyIndex, strAccountIndex, params)
617 nonce = await self.fetch_nonce(accountIndex, apiKeyIndex, self.extend(params, {'skipNonce': False}))
618 expiry = self.milliseconds() + 365 * 864000
619 signRaw = {
620 'integrator_account_index': builder,
621 'integrator_taker_fee': takerFeeRate,
622 'integrator_maker_fee': makerFeeRate,
623 'approval_expiry': expiry,
624 'nonce': nonce,
625 'api_key_index': apiKeyIndex,
626 'account_index': accountIndex,
627 }
628 txType, txInfo, messageToSign = self.lighter_sign_approve_integrator(signer, self.extend(signRaw, params))
629 newTxInfo = self.sign_l1_and_prepare_tx_info(txInfo, messageToSign, self.privateKey)
630 request = {
631 'tx_type': txType,
632 'tx_info': newTxInfo,
633 }
634 response = await self.publicPostSendTx(request)
635 return response
636
637 async def change_api_key(self, params: object = {}):
638 apiKeyIndex = None

Callers 1

Calls 8

load_accountMethod · 0.95
fetch_nonceMethod · 0.95
publicPostSendTxMethod · 0.65
extendMethod · 0.45
millisecondsMethod · 0.45

Tested by

no test coverage detected