import { isInBinance } from './env' declare global { interface Window { ethereum: any binancew3w: any } } export const bnTransport = ({ custom, http }) => { if (isInBinance()) { return custom({ async request({ method, params }) { console.log('🚀 ~~ request ~~ method:', method) try { const response = await window.ethereum.request({ method, params }) console.log('🚀 ~~ custom ~~ response:', response) return response } catch (error) { console.log('🚀 ~~ request ~~ error:', error) } }, }) } return http() }