Learn how to use the bridge SDK to make bridges with only a few lines of code.
npm install @rhino.fi/sdk
import { RhinoSdk } from '@rhino.fi/sdk' export const rhinoSdk = RhinoSdk({ apiKey: 'YOUR_API_KEY', })
import { SupportedChains, SupportedTokens } from '@rhino.fi/sdk' import { getEvmChainAdapterFromPrivateKey } from '@rhino.fi/sdk/adapters/evm' import { rhinoSdk } from './rhino-sdk' const bridgeResult = await rhinoSdk.bridge({ type: 'bridge', amount: '100', token: SupportedTokens.USDT, chainIn: SupportedChains.ARBITRUM_ONE, chainOut: SupportedChains.SOLANA, depositor: 'DEPOSITOR_ADDRESS', recipient: 'RECIPIENT_ADDRESS', mode: 'receive', gasBoost: { amountNative: '4' } }, { getChainAdapter: chainConfig => getEvmChainAdapterFromPrivateKey( 'YOUR_PRIVATE_KEY', chainConfig, ), hooks: { checkQuote: quote => quote.fees.feeUsd < 5, onBridgeStatusChange: status => console.log('Bridge status changed', status), }, }) if (bridgeResult.data) { console.log('Bridge successful', bridgeResult.data.withdrawTxHash) } else { console.log('Bridge error', bridgeResult.error) }
checkQuote