Barebone example to load @drift-labs/sdk into a React native project (Expo)
Install dependencies and start expo
yarn && yarn start
# Press `i` to run in SimulatorReferences to node standard library modules will case issue during build time. It can be fixed via packages mapping along with npm: prefix
You can find compatiable node standard libraries for browser here
Following example will allow
{
"process": "npm:shtylman/node-process",
"os": "npm:os-browserify",
"path": "npm:path-browserify",
}Caused by how @solana/web3.js decide to use Buffer class to create the RPC response, which is a method that is missing in React native, here is the solution