import {Buffer} from "@craftzdog/react-native-buffer"; import 'react-native-get-random-values'; global.Buffer = Buffer; console.log("shimming!!") global.lmao = "lmao"; // Needed to polyfill random number generation // Polyfill crypto after process is polyfilled // const rnc = require("react-native-crypto"); // import * as rnc from "react-native-crypto"; // import * as expocrypto from "expo-crypto"; // import * as crypb from "crypto-browserify"; // console.log(global.crypto, "globl") // // console.log({rnc}) // console.log({expocrypto}) // // console.log({crypb}) // // console.log({crypto, rnc, expocrypto, crypb}) // // // Needed to polyfill crypto // const consolidate = {...global.crypto, ...expocrypto} // console.log({consolidate}) // global.crypto = {...expocrypto} // console.log(global.crypto, "globl2") // Buffer polyfill - ensure this is first // const {Buffer} = require("@craftzdog/react-native-buffer"); // global.Buffer = Buffer; // import 'react-native-get-random-values'; // // Process polyfill // import process from 'process'; // global.process = process; // // Use crypto-browserify for web compatibility // import crypto from 'crypto-browserify'; // global.crypto = crypto; // Stream polyfill // import stream from 'stream-browserify'; // global.stream = stream; // Crypto polyfill for tiny-secp256k1 // import crypto from "react-native-crypto"; // global.crypto = crypto // try { // import('react-native-crypto').then(crypto => { // if (!global.crypto) { // global.crypto = crypto.default || crypto; // } // }); // } catch (e) { // console.warn('Failed to load react-native-crypto:', e); // } // Original code commented out // if (typeof Buffer === 'undefined') global.Buffer = require('buffer').Buffer; // if (typeof Buffer === 'undefined') global.Buffer = Buffer