BMX, I would suggest taking a closer look at what you have.
First, I am not aware of any “mainstream“ mid-drive that has an external controller. Bosch, Shimano, Brose, and I’m pretty sure Bafang as well, have their motor controllers located within the motor housing. Do you know the manufacturer...