lamarge 0.8.0

Client for the LaMarge API: sign-in, takes, transfers, withdrawals and market making, each request checked before it is signed.
Documentation
use super::*;

#[test]
fn transfer_out_equals_the_typescript_sdks_calldata() {
    let word = |value: U256| format!("{value:064x}");
    let token = U256::from_be_slice(deployments::GMX.token.as_slice());
    let amount = U256::from(123_456_789u64);
    // The tuple's head (its bytes at 0xc0, its fee at 0xe0), the empty bytes, then the zero fee
    // with its empty swap path at 0x80.
    let expected = format!(
        "0x794778ef{}{}{}{}{}{}{}{}{}{}{}{}{}",
        word(U256::from(32u8)),
        word(token),
        word(amount),
        word(U256::ZERO),
        word(U256::ZERO),
        word(U256::from(0xc0u8)),
        word(U256::from(0xe0u8)),
        word(U256::ZERO),
        word(U256::ZERO),
        word(U256::ZERO),
        word(U256::from(0x80u8)),
        word(U256::ZERO),
        word(U256::ZERO),
    );
    assert_eq!(transfer_out(amount).to_string(), expected);
}