Returns {'ins': [...], 'outs': [...]}

def read_tx_body(ptr, tx):
    """
    Returns {'ins': [...], 'outs': [...]}
    """
    _obj = {"ins": [], "outs": [], 'locktime': None}

    # number of inputs
    ins = read_var_int(ptr, tx)

    # all inputs
    for i in range(ins):
        _obj["ins"].append({
            "outpoint": {
                "hash": read_bytes(ptr, tx, 32)[::-1],
                "index": read_as_int(ptr, tx, 4)
            },
            "script": read_var_string(ptr, tx),
            "sequence": read_as_int(ptr, tx, 4)
        })

    # number of outputs
    outs = read_var_int(ptr, tx)

    # all outputs
    for i in range(outs):
        _obj["outs"].append({
            "value": read_as_int(ptr, tx, 8),
            "script": read_var_string(ptr, tx)
        })

    return _obj