-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Description
Check existing issues
- I checked there isn't already an issue for the bug I encountered.
Viem Version
2.37.12
Current Behavior
When prepareUserOperation
is called within react-native project an error is thrown stating
[TypeError: Cannot read property 'buffer' if undefined]
Since project has global buffer polyfill and stack trace ends at createCursor function I'm thinking there is an issue with accessing bytes.buffer
(probably there will be follow up issues with accessing anything on bytes there as well).
Expected Behavior
Should not throw in react-native or documentation should mention necessary polyfills.
Steps To Reproduce
Existing polyfills of the project for refference
import 'react-native-get-random-values'
import { Buffer } from 'buffer'
global.Buffer = Buffer
Call prepare user op on bunlder
const baseSepoliaClient = createPublicClient({
chain: baseSepolia,
transport: http('...'),
})
const baseSepoliaBundler = createBundlerClient({
client: baseSepoliaClient,
transport: http('...'),
})
const userOp = await baseSepoliaBundler.prepareUserOperation({
account,
calls: [{
to: '0xd...',
value: parseEther('0.0001'),
}],
})
Link to Minimal Reproducible Example
No response
Anything else?
No response
Metadata
Metadata
Assignees
Labels
No labels