fn sign_transfer(
        from: &ZksyncAccount,
        to: Address,
        amount: BigUint,
        fee: BigUint,
    ) -> (FranklinTx, Option<PackedEthSignature>) {
        let token: TokenId = 0; // ETH token
        let account_id = from.get_account_id().expect("Account ID must be set");
        let mut tx = Transfer::new(
            account_id,
            from.address,
            to,
            token,
            amount,
            fee,
            from.nonce(),
            None,
        );
        tx.signature = TxSignature::sign_musig(&from.private_key, &tx.get_bytes());

        let eth_signature = PackedEthSignature::sign(
            &from.eth_private_key,
            tx.get_ethereum_sign_message("ETH", 18).as_bytes(),
        )
        .expect("Signing the transfer unexpectedly failed");

        (FranklinTx::Transfer(Box::new(tx)), Some(eth_signature))
    }
/// Creates signed transfer without any checks for correctness.
Creates signed transfer without any checks for correctness.
Creates signed transfer without any checks for correctness .
fn sign_transfer(
        from: &ZksyncAccount,
        to: Address,
        amount: BigUint,
        fee: BigUint,
    ) -> (FranklinTx, Option<PackedEthSignature>) {
        let token: TokenId = 0; // ETH token
        let account_id = from.get_account_id().expect("Account ID must be set");
        let mut tx = Transfer::new(
            account_id,
            from.address,
            to,
            token,
            amount,
            fee,
            from.nonce(),
            None,
        );
        tx.signature = TxSignature::sign_musig(&from.private_key, &tx.get_bytes());
        let eth_signature = PackedEthSignature::sign(
            &from.eth_private_key,
            tx.get_ethereum_sign_message("ETH", 18).as_bytes(),
        )
        .expect("Signing the transfer unexpectedly failed");
        (FranklinTx::Transfer(Box::new(tx)), Some(eth_signature))
    }
fn sign_transfer ( from : & ZksyncAccount , to : Address , amount : BigUint , fee : BigUint , ) -> ( FranklinTx , Option < PackedEthSignature > ) { let token : TokenId = 0 ; // ETH token let account_id = from . get_account_id ( ) . expect ( " " ) ; let mut tx = Transfer :: new ( account_id , from . address , to , token , amount , fee , from . nonce ( ) , None , ) ; tx . signature = TxSignature :: sign_musig ( & from . private_key , & tx . get_bytes ( ) ) ; let eth_signature = PackedEthSignature :: sign ( & from . eth_private_key , tx . get_ethereum_sign_message ( " " , 18 ) . as_bytes ( ) , ) . expect ( " " ) ; ( FranklinTx :: Transfer ( Box :: new ( tx ) ) , Some ( eth_signature ) ) }
Creates signed transfer without any checks for correctness.
Creates signed transfer without any checks for correctness .
from
&ZksyncAccount
to
Address
amount
BigUint
fee
BigUint