2. Install and set up
Packages
@gibs/quotes pulls in @gibs/bridge-sdk, @gibs/common and @gibs/abis. @gibs/bridge-indexer pulls in @gibs/bridge-client and graphql-request. Every package needs Node 20 or later when it runs on Node.
viem
The peer range is >=2.35.0 <3. The packages are tested against exactly 2.35.0, the floor. Keep one copy of viem in your bundle.
Module formats
Every package ships two builds: ECMAScript modules in dist/ and CommonJS in dist/cjs/. The exports map has react-native, import and require conditions. Any bundler that reads exports picks the right build.
React Native 0.77
The packages work in React Native 0.77 and later with no Metro setting. They are tested in a React Native 0.77.3 app with viem 2.35.0 and the template's own metro.config.js, babel.config.js and jest.config.js. Every public entry point is bundled for iOS and Android, compiled with the Hermes compiler, and loaded under jest.
Metro in React Native 0.77 ignores exports. So every package also ships one folder per subpath, such as @gibs/bridge-sdk/execution/package.json. Its main and react-native fields point at the CommonJS build. You import the subpath as usual.
You do not need:
- a
resolveRequesthook inmetro.config.js; transformIgnorePatternsin your jest configuration. The React Native jest preset loads the CommonJS build untransformed;unstable_enablePackageExports. Do not turn it on for these packages. They do not need it, and it can break other libraries in your app, such as web3.js.
React Native's own URL is enough
You need no URL polyfill. React Native 0.77's own URL supports only href and toString(). Its other getters throw "not implemented", and its searchParams is always empty. Its URLSearchParams can only append and serialize. No package reads either class. The packages build and read request addresses with @gibs/common/url, which needs only encodeURIComponent and decodeURIComponent.
The tests load every public entry point under React Native's own URL and URLSearchParams. If your app installs a URL polyfill for other code, the packages still work.
TON
TON is The Open Network. Most wallets never load its code:
@gibs/bridge-sdk/ton-connectneeds no TON library and noBuffer.@gibs/bridge-sdk/tonneeds@ton/core, a globalBufferandexpo-crypto. Installbufferand setglobalThis.Bufferbefore the import. Withoutexpo-crypto, Metro cannot bundle it.- npm still installs
@ton/coreand@ton/crypto, because they are regular dependencies of@gibs/bridge-sdk. Metro bundles them only when you import@gibs/bridge-sdk/ton.
A wallet that bridges only between Ethereum-style chains never pays for TON.
Using WalletConnect, ethers or web3.js
The packages read the chain through viem clients, so viem stays installed. Your app can still sign, wait for receipts and read allowances with another library. Each adapter file holds that code for one library, and the examples compile all four:
examples/adapter-walletconnect.ts: Reown AppKit runs on wagmi, and wagmi runs on viem. Only the wallet steps change: connect, switch the chain, send, and wait for the receipt.examples/adapter-ethers.ts: several endpoints for one chain share oneFallbackProvider.examples/adapter-web3.ts: web3.js 4 has no fallback provider. The adapter tries each endpoint in order.
Examples A and B take the signer and a ChainAccess from any of these files. On the docs site, a menu above each code sample switches every sample to your library.
Import narrow subpaths
Metro does not drop unused exports. Import @gibs/bridge-sdk/execution, not @gibs/bridge-sdk. See the bundle-size note.