@rhino.fi/sdk

0.3.1 • Public • Published

Rhino Bridge SDK

This package provides a TypeScript SDK for interacting with the Rhino Bridge with integrations for all Rhino supported chains included.

Installation

npm install @rhino.fi/sdk

Quickstart

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)
}

Documentation

Please refer to the Rhino developer docs for comprehensive guides and details on how to obtain an API key.

Readme

Keywords

none

Package Sidebar

Install

npm i @rhino.fi/sdk

Weekly Downloads

148

Version

0.3.1

License

none

Unpacked Size

359 kB

Total Files

146

Last publish

Collaborators

  • rhino.fi-admin