This package provides a TypeScript SDK for interacting with the Rhino Bridge with integrations for all Rhino supported chains included.
npm install @rhino.fi/sdk
Make a bridge easily with only a few lines of code:
import { RhinoSdk, SupportedChains, SupportedTokens } from '@rhino.fi/sdk'
import { getEvmChainAdapterFromPrivateKey } from '@rhino.fi/sdk/adapters/evm'
const sdk = RhinoSdk({
apiKey: 'YOUR_API_KEY',
})
const result = await sdk.bridge({
amount: '100',
chainIn: SupportedChains.ARBITRUM_ONE,
chainOut: SupportedChains.BASE,
token: SupportedTokens.USDT,
depositor: 'DEPOSITOR_ADDRESS',
recipient: 'RECIPIENT_ADDRESS',
mode: 'receive',
}, {
getChainAdapter: chainConfig =>
getEvmChainAdapterFromPrivateKey(
'YOUR_PRIVATE_KEY',
chainConfig,
),
})
if (result.data) {
console.log('Bridge successful', result.data.withdrawTxHash)
} else {
console.log('Bridge error', result.error)
}
Please refer to the Rhino developer docs for comprehensive guides and details on how to obtain an API key.