encode_change_pubkey

Documentation for eth_defi.lighter.pubkey.encode_change_pubkey function.

encode_change_pubkey(web3, account_index, api_key_index, pubkey, zk_lighter='0x3B4D794a66304F130a4Db8F2551B0070dfCf5ca7')

Encode a ZkLighter.changePubKey(accountIndex, apiKeyIndex, pubKey) call.

Validates api_key_index and pubkey before encoding.

Parameters
  • web3 (web3.main.Web3) – Web3 connection (for the ABI / encoding).

  • account_index (int) – The Lighter account index whose key is being set.

  • api_key_index (int) – The API-key slot (4-254 for automated user keys).

  • pubkey (bytes) – The API-key public key (see validate_lighter_pubkey()).

  • zk_lighter (Union[eth_typing.evm.HexAddress, str]) – The ZkLighter L1 contract address.

Returns

(zk_lighter_address, calldata).

Return type

tuple[eth_typing.evm.HexAddress, hexbytes.main.HexBytes]