### Install starknet.js
Source: https://docs.rhino.fi/contracts/starknet
Install the starknet.js library using yarn or npm.
```bash
yarn add starknet
```
```bash
npm install starknet
```
--------------------------------
### Install the Rhino.fi SDK
Source: https://docs.rhino.fi/sdk/quickstart
Install the Rhino.fi SDK using your preferred package manager.
```bash
npm install @rhino.fi/sdk
```
```bash
yarn add @rhino.fi/sdk
```
```bash
pnpm install @rhino.fi/sdk
```
```bash
bun install @rhino.fi/sdk
```
--------------------------------
### Full Bridge Transaction Example
Source: https://docs.rhino.fi/api-integration/bridge
A complete implementation demonstrating the sequence of fetching configs, getting a quote, committing the quote, and preparing for smart contract execution.
```javascript
import { getBridgeUserQuote } from "./getBridgeUserQuote";
import { getBridgeConfigs } from "./getBridgeConfigs";
import { commitBridgeUserQuote } from "./commitBridgeUserQuote";
const JWT = 'YOUR_JWT'; // Replace with your JWT generated from our API
const amount = '3';
const chainIn = 'BASE';
const chainOut = 'SOLANA';
const token = 'USDT';
const depositorAddress = '0x0000000000000000000000000000000000000000'; // Replace with your depositor address
const recipientAddress = '0x0000000000000000000000000000000000000000'; // Replace with your recipient address
const bridge = async () => {
// Get bridge configs to determine supported chains and tokens or later use for the contract call
const configs = await getBridgeConfigs();
// Get a bridge quote for the transaction
const quote = await getBridgeUserQuote({
amount,
chainIn,
chainOut,
token,
mode: 'receive',
depositor: depositorAddress,
recipient: recipientAddress,
amountNative: '0'
}, JWT);
if (!quote?.quoteId) throw new Error('Failed to generate user quote.');
// Commit the quote to confirm the transaction when you are ready to send on-chain
const commitResult = await commitBridgeUserQuote(quote.quoteId, JWT);
if (!commitResult?.quoteId) throw new Error('Failed to commit user quote.');
const chainConfig = configs[chainIn];
// Execute the bridge transaction by interacting with the smart contract -- see contract examples section on exact implementation
await callBridgeContract({
chainConfig,
amount: quote.payAmount,
token,
commitmentId: commitResult.quoteId,
callback: (hash) => console.info('Transaction hash:', hash)
});
};
bridge();
```
--------------------------------
### Install TON Libraries
Source: https://docs.rhino.fi/contracts/ton
Install the necessary TON libraries for interacting with TON contracts.
```bash
yarn add @ton/ton @ton/crypto
```
```bash
npm install @ton/ton @ton/crypto
```
--------------------------------
### Install tronweb
Source: https://docs.rhino.fi/contracts/tron
Install the tronweb library using either yarn or npm to interact with the Tron network.
```bash
yarn add tronweb
```
```bash
npm install tronweb
```
--------------------------------
### Install Solana Dependencies
Source: https://docs.rhino.fi/contracts/solana
Install the necessary Solana libraries for interacting with the bridge contract. Use yarn or npm.
```bash
yarn add @solana/web3.js @solana/spl-token @coral-xyz/anchor
```
```bash
npm install @solana/web3.js @solana/spl-token @coral-xyz/anchor
```
--------------------------------
### Install ethers.js with npm
Source: https://docs.rhino.fi/contracts/evm
Install the ethers.js library using npm for interacting with EVM contracts.
```bash
npm install ethers
```
--------------------------------
### Install ethers.js with Yarn
Source: https://docs.rhino.fi/contracts/evm
Install the ethers.js library using Yarn for interacting with EVM contracts.
```bash
yarn add ethers
```
--------------------------------
### Create Starknet Chain Adapter from Private Key
Source: https://docs.rhino.fi/sdk/chain-adapters/starknet
This method provides a shortcut for setting up a Starknet account using your private key and address. It requires your private key, address, and chain configuration.
```typescript
import { getStarknetChainAdapterFromPrivateKey } from '@rhino.fi/sdk/adapters/starknet'
const chainAdapter = getStarknetChainAdapterFromPrivateKey({
privateKey: 'YOUR_PRIVATE_KEY',
address: 'YOUR_ADDRESS',
chainConfig,
})
```
--------------------------------
### Interact with EVM Chain Adapters using SDK
Source: https://docs.rhino.fi/sdk/migration-guides/from-api
This snippet demonstrates setting up an EVM chain adapter, checking for token approvals, handling approvals if necessary, and then managing the deposit transaction.
```typescript
// Set up the chain adapter, can be any of the included ones
const evmChainAdapter = getEvmChainAdapterFromPrivateKey(
'YOUR_PRIVATE_KEY',
chainConfig
)
// Check if a token approval is needed. Could be skipped if you know that the blockchain does not have a concept of token approvals, like Solana.
const approvalAmount = await evmChainAdapter.getApprovalAmount(depositAmount, walletAddress, tokenConfig)
if(approvalAmount) {
// Set up the token approval if needed
await evmChainAdapter.handleTokenApproval(approvalAmount, tokenConfig)
}
// Send the funds to be bridged to the bridge contract. Once successful, the status
// of the bridge can be tracked through the Rhino API as usual.
const { depositTxHash } = await evmChainAdapter.handleDeposit({
tokenConfig,
depositAmount,
commitmentId,
})
```
--------------------------------
### Full Bridge and Swap Example in JavaScript
Source: https://docs.rhino.fi/api-integration/swap
This snippet shows the complete implementation for a cross-chain swap. It requires JWT authentication and specific parameters for input/output chains and tokens. Ensure you replace placeholder values with your actual JWT and addresses.
```javascript
import { getBridgeSwapUserQuote } from "./getBridgeSwapUserQuote";
import { getBridgeConfigs } from "./getBridgeConfigs";
import { getSwapTokenConfig } from "./getSwapTokenConfig";
import { commitBridgeSwapUserQuote } from "./commitBridgeSwapUserQuote";
const JWT = 'YOUR_JWT'; // Replace with your JWT generated from our API
const amount = '1';
const chainIn = 'BASE';
const chainOut = 'ARBITRUM';
const tokenIn = 'USDT';
const tokenOut = 'USDC';
const depositorAddress = '0x0000000000000000000000000000000000000000'; // Replace with your depositor address
const recipientAddress = '0x0000000000000000000000000000000000000000'; // Replace with your recipient address
const bridgeAndSwap = async () => {
// Get bridge configs to determine supported chains and tokens or later use for the contract call
const configs = await getBridgeConfigs();
const swapTokenConfig = await getSwapTokenConfig();
// Get a bridge quote for the transaction
const quote = await getBridgeSwapUserQuote({
amount,
chainIn,
chainOut,
tokenIn,
tokenOut,
mode: 'pay',
depositor: depositorAddress,
recipient: recipientAddress,
amountNative: '0'
}, JWT);
if (!quote?.quoteId) throw new Error('Failed to generate user quote.');
// Commit the quote to confirm the transaction when you are ready to send on-chain
const commitResult = await commitBridgeSwapUserQuote(quote.quoteId, JWT);
if (!commitResult?.quoteId) throw new Error('Failed to commit user quote.');
const chainConfig = configs[chainIn];
const swapConfig = swapTokenConfig[chainIn][tokenIn];
// Execute the bridge transaction by interacting with the smart contract -- see contract examples section on exact implementation
await callBridgeContract({
chainConfig,
swapConfig,
amount: quote.payAmount,
tokenIn,
commitmentId: commitResult.quoteId,
callback: (hash) => console.info('Transaction hash:', hash)
});
};
bridgeAndSwap();
```
--------------------------------
### SDA Widget Theming Example
Source: https://docs.rhino.fi/widget/sda-widget
Example of embedding the SDA Widget with a custom theme applied via URL query parameters. The theme is provided as a URL-encoded JSON object.
```html
```
--------------------------------
### GET Request for Missed Events
Source: https://docs.rhino.fi/webhook/get-missed-events
Use this GET request to retrieve events that occurred after a specific timestamp. You can also specify the page number and the number of events per page (up to 50).
```http
GET https://api.rhino.fi/webhook/user-events
```
--------------------------------
### Complete Bridge Function Call with All Options
Source: https://docs.rhino.fi/sdk/bridge-functions
This example demonstrates a comprehensive call to the `rhinoSdk.bridge` function, utilizing all available options for a full-featured bridge operation. It includes detailed parameter configuration, custom hooks for monitoring bridge status, and gas boost settings.
```typescript
import { SupportedChains, SupportedTokens } from '@rhino.fi/sdk'
import { getEvmChainAdapterFromPrivateKey } from '@rhino.fi/sdk/adapters/evm'
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),
},
timeoutSeconds: 600,
bridgeConfig: bridgeConfig,
})
if (bridgeResult.data) {
console.log('Bridge successful', bridgeResult.data.withdrawTxHash)
} else {
console.log('Bridge error', bridgeResult.error)
}
```
--------------------------------
### Initialize the Rhino SDK
Source: https://docs.rhino.fi/sdk/quickstart
Initialize the Rhino SDK with your API key. Obtain your API key from the Rhino.fi Console.
```typeScript
import { RhinoSdk } from '@rhino.fi/sdk'
export const rhinoSdk = RhinoSdk({
apiKey: 'YOUR_API_KEY',
})
```
--------------------------------
### Get Bridge Quote
Source: https://docs.rhino.fi/api-reference/bridge/quote/user-quote
This endpoint allows you to get a quote for a bridge transaction. You need to provide the input and output tokens, the amount to send, and the recipient address. The response will include details about the transaction, including fees, estimated duration, and the quote ID.
```APIDOC
## GET /quote/user-quote
### Description
Retrieves a quote for a user-initiated bridge transaction.
### Method
GET
### Endpoint
/quote/user-quote
### Parameters
#### Query Parameters
- **tokenIn** (string) - Required - Token symbol or identifier being sent from the source chain.
- **tokenOut** (string) - Required - Token symbol or identifier being received on the destination chain.
- **amountIn** (string) - Required - Amount of `tokenIn` to send.
- **amountInUsd** (number) - Required - Amount of `tokenIn` in USD.
- **recipient** (string) - Required - The address to receive the bridged tokens.
- **affiliateInfo** (object) - Optional - Information about the affiliate.
- **fee** (number) - Optional - Affiliate fee percentage.
- **denom** (string) - Optional - Affiliate fee denomination.
- **bridgeToken** (string) - Optional - Intermediate token used for the bridge operation.
- **bridgePayAmount** (string) - Optional - Amount of `bridgeToken` to pay.
- **bridgePayAmountUsd** (number) - Optional - Amount of `bridgePayAmount` in USD.
- **bridgeReceiveAmount** (string) - Optional - Amount of `bridgeToken` to receive.
- **minReceiveAmount** (string) - Optional - Minimum amount of `tokenOut` to receive.
- **minReceiveAmountUsd** (number) - Optional - Minimum amount of `tokenOut` in USD.
- **usdPriceTokenIn** (number) - Optional - USD price of `tokenIn`.
- **usdPriceTokenOut** (number) - Optional - USD price of `tokenOut`.
- **isAtomicSwap** (boolean) - Optional - Whether this is an atomic swap operation.
- **postBridgeData** (object) - Optional - Configuration for post-bridge actions.
- **webhookUrl** (string) - Optional - URL for webhook notifications.
### Response
#### Success Response (200)
- **_tag** (string) - Type of the response, e.g., "quote".
- **chainIn** (string) - The source chain.
- **chainOut** (string) - The destination chain.
- **payAmount** (string) - The amount to be paid.
- **payAmountUsd** (number) - The amount to be paid in USD.
- **receiveAmount** (string) - The amount to be received.
- **receiveAmountUsd** (number) - The amount to be received in USD.
- **fees** (object) - Breakdown of all fees associated with the transaction.
- **percentage** (number) - Percentage-based fee amount.
- **percentageFeeUsd** (number) - Percentage-based fee amount in USD.
- **token** (string) - The token being bridged.
- **depositor** (string) - The address initiating the bridge transaction.
- **recipient** (string) - The address to receive the bridged tokens.
- **expiresAt** (string) - Timestamp when the quote expires.
- **quoteId** (string) - Unique identifier for the committed quote.
- **promotion** (object) - Promotion details if applicable.
- **name** (string) - Name of the promotion.
- **maxLimitUsd** (number) - Maximum limit for the promotion in USD.
- **gasBoost** (object) - Gas amount to receive on the destination chain.
- **amountNative** (string) - Native gas amount.
- **amountNativeUsd** (number) - Native gas amount in USD.
- **amountNativeTokenCost** (string) - Cost of native gas in token.
- **speed** (string) - Transaction speed (fast, standard, slow).
- **estimatedDuration** (number) - Estimated time for the transaction to complete in milliseconds.
- **tokenIn** (string) - Token symbol or identifier being sent from the source chain.
- **tokenOut** (string) - Token symbol or identifier being received on the destination chain.
- **bridgeToken** (string) - Intermediate token used for the bridge operation.
- **bridgePayAmount** (string) - Amount of `bridgeToken` to pay.
- **bridgePayAmountUsd** (number) - Amount of `bridgePayAmount` in USD.
- **bridgeReceiveAmount** (string) - Amount of `bridgeToken` to receive.
- **minReceiveAmount** (string) - Minimum amount of `tokenOut` to receive.
- **minReceiveAmountUsd** (number) - Minimum amount of `tokenOut` in USD.
- **usdPriceTokenIn** (number) - USD price of `tokenIn`.
- **usdPriceTokenOut** (number) - USD price of `tokenOut`.
- **isAtomicSwap** (boolean) - Whether this is an atomic swap operation.
- **depositor** (string) - The address initiating the bridge transaction.
- **recipient** (string) - The address to receive the bridged tokens.
- **postBridgeData** (object) - Configuration for post-bridge actions.
- **webhookUrl** (string) - URL for webhook notifications.
### Request Example
```json
{
"tokenIn": "ETH",
"tokenOut": "USDC",
"amountIn": "1000000000000000000",
"amountInUsd": 1.0,
"recipient": "0x1234567890abcdef1234567890abcdef12345678",
"affiliateInfo": {
"fee": 0.5,
"denom": "USD"
}
}
```
### Response Example
```json
{
"_tag": "quote",
"chainIn": "ethereum",
"chainOut": "polygon",
"payAmount": "995000000000000000",
"payAmountUsd": 0.995,
"receiveAmount": "990000000000000000",
"receiveAmountUsd": 0.99,
"fees": {
"percentage": 0.5,
"percentageFeeUsd": 0.005
},
"token": "USDC",
"depositor": "0x1234567890abcdef1234567890abcdef12345678",
"recipient": "0x1234567890abcdef1234567890abcdef12345678",
"expiresAt": "2023-10-27T10:00:00Z",
"quoteId": "q-12345abcde"
}
```
```
--------------------------------
### Initialize the SDK
Source: https://docs.rhino.fi/sdk/quickstart
Initialize the Rhino SDK with your API key. You can create a project and manage API keys from the Rhino.fi Console.
```APIDOC
## Initialize the SDK
### Description
Initialize the Rhino SDK with your API key. You can create a project and manage API keys from the Rhino.fi Console.
### Code
```typescript
import { RhinoSdk } from '@rhino.fi/sdk'
export const rhinoSdk = RhinoSdk({
apiKey: 'YOUR_API_KEY',
})
```
```
--------------------------------
### Get SDA Status
Source: https://docs.rhino.fi/sdk/quickstart
Check the status of an existing Smart Deposit Address.
```APIDOC
## Get SDA Status
### Description
Check the status of an existing Smart Deposit Address.
### Method Signature
```typescript
async getStatus(
options: GetSdaStatusOptions
): Promise
```
### Parameters
#### `options` (GetSdaStatusOptions)
- **depositAddress** (string) - Required - The SDA address to check.
- **depositChain** (string) - Required - The chain of the SDA.
### Request Example
```typescript
import { rhinoSdk } from './rhino-sdk'
const status = await rhinoSdk.api.depositAddresses.getStatus({
depositAddress: '0x457...',
depositChain: 'ETHEREUM',
})
```
```
--------------------------------
### Get Deposit Address History OpenAPI Specification
Source: https://docs.rhino.fi/api-reference/sda/depositaddresses/get-deposit-address-history
This OpenAPI specification defines the GET /deposit-addresses/{depositAddress}/{depositChain}/history endpoint. It details the required path parameters, optional query parameters for date range filtering, and the structure of the successful response (200 OK) as well as potential error responses.
```yaml
openapi: 3.1.0
info:
title: SDA API
version: 0.0.1
description: Functionality for interacting with Rhino SDA service
servers:
- url: https://api.rhino.fi/sda
security: []
tags:
- name: depositAddresses
paths:
/deposit-addresses/{depositAddress}/{depositChain}/history:
get:
tags:
- depositAddresses
summary: Get deposit address history
description: >-
Returns the history of a deposit address on a given chain. This includes
all accepted (with precise history), failed, and rejected bridge
transactions.
operationId: depositAddresses.historyDepositAddress
parameters:
- name: depositAddress
in: path
schema:
anyOf:
- $ref: '#/components/schemas/EthAddressSchema'
- $ref: '#/components/schemas/TronAddressBasic'
- $ref: '#/components/schemas/SolanaAddress'
- $ref: '#/components/schemas/StellarMuxedAddress'
required: true
- name: depositChain
in: path
schema:
type: string
required: true
- name: from
in: query
schema:
$ref: '#/components/schemas/from'
required: false
- name: to
in: query
schema:
$ref: '#/components/schemas/from'
required: false
responses:
'200':
description: DepositAddressHistoryResponse
content:
application/json:
schema:
$ref: '#/components/schemas/DepositAddressHistoryResponse'
'400':
description: The request did not match the expected schema
content:
application/json:
schema:
anyOf:
- $ref: '#/components/schemas/HttpApiDecodeError'
- $ref: '#/components/schemas/InvalidJwt'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/Unauthorized'
'422':
description: DepositAddressNotFound
content:
application/json:
schema:
anyOf:
- $ref: '#/components/schemas/DepositAddressNotFound'
- $ref: '#/components/schemas/DepositAddressChainsNotSupported'
- $ref: '#/components/schemas/InvalidDateRange'
'503':
description: EndpointDisabledError
content:
application/json:
schema:
$ref: '#/components/schemas/EndpointDisabledError'
security:
- bearer: []
- legacyApiKey: []
components:
schemas:
EthAddressSchema:
type: string
description: a string that will be trimmed
TronAddressBasic:
type: string
description: Tron basic address format
pattern: T[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]+
title: maxLength(60)
maxLength: 60
SolanaAddress:
type: string
StellarMuxedAddress:
type: string
from:
type: string
description: >-
Start date for the history query, in milliseconds since epoch or
Date.parse compatible string. Optional, defaults to 7 days ago. Max
window is 31 days
DepositAddressHistoryResponse:
type: object
required:
- depositAddress
- depositChain
- bridges
properties:
depositAddress:
type: string
description: The deposit address for which history is being retrieved.
title: nonEmptyString
minLength: 1
depositChain:
type: string
description: The blockchain network identifier of the deposit address.
title: nonEmptyString
minLength: 1
bridges:
type: array
items:
anyOf:
- $ref: '#/components/schemas/DepositAddressBridgeFailedApi'
- $ref: '#/components/schemas/DepositAddressBridgeRejectedApi'
- $ref: '#/components/schemas/DepositAddressBridgeAcceptedApi'
description: >-
Array of bridge transactions associated with this deposit address,
including accepted, failed, and rejected transactions.
additionalProperties: false
HttpApiDecodeError:
type: object
required:
- issues
- message
- _tag
```
--------------------------------
### Create Starknet Chain Adapter from Account
Source: https://docs.rhino.fi/sdk/chain-adapters/starknet
Use this method to integrate with connected wallets in web applications or to set up your own Starknet account. Ensure you have the 'account' object and 'chainConfig' available.
```typescript
import { getStarknetChainAdapterFromAccount } from '@rhino.fi/sdk/adapters/starknet'
const chainAdapter = getStarknetChainAdapterFromAccount(
account,
chainConfig
)
```
--------------------------------
### Calldata to execute a single swap
Source: https://docs.rhino.fi/llms.txt
Get the calldata needed to execute a single swap.
```APIDOC
## POST /swap/calldata
### Description
Get the calldata needed to execute a single swap.
### Method
POST
### Endpoint
/swap/calldata
### Parameters
#### Request Body
- **quoteId** (string) - Required - The ID of the quote for the swap.
- **userAddress** (string) - Required - The address of the user executing the swap.
### Response
#### Success Response (200)
- **calldata** (string) - The calldata required to execute the swap.
```
--------------------------------
### Create EVM Chain Adapter from Private Key
Source: https://docs.rhino.fi/sdk/chain-adapters/evm-chains
This method serves as a convenient shortcut for setting up a chain adapter when you have a private key available. Replace 'YOUR_PRIVATE_KEY' with the actual private key and ensure chainConfig is provided.
```typescript
import { getEvmChainAdapterFromPrivateKey } from '@rhino.fi/sdk/adapters/evm'
const chainAdapter = getEvmChainAdapterFromPrivateKey(
'YOUR_PRIVATE_KEY',
chainConfig
)
```
--------------------------------
### Get Deposit Address Status
Source: https://docs.rhino.fi/api-reference/sda/depositaddresses/get-deposit-address-status
Retrieves the status and details of a specific deposit address.
```APIDOC
## GET /deposit-addresses/:addressId
### Description
Retrieves the status and details of a specific deposit address.
### Method
GET
### Endpoint
/deposit-addresses/:addressId
### Parameters
#### Path Parameters
- **addressId** (string) - Required - The unique identifier of the deposit address.
### Response
#### Success Response (200)
- **isActive** (boolean) - Whether this deposit address is currently active and accepting deposits.
- **tokens** (array) - List of tokens that can be deposited to this address.
- **symbol** (string) - Token symbol (e.g., "ETH", "USDC").
- **address** (string) - Token contract address on the deposit chain.
- **maxDepositLimitUsd** (number) - Maximum deposit amount in USD for this token.
- **minDepositLimitUsd** (number) - Minimum deposit amount in USD for this token.
- **postBridgeData** (object) - Optional configuration for post-bridge actions.
- **tokenOut** (string) - Optional token to receive after bridging (for token swaps).
- **refundAddress** (string) - Optional address for refunds if bridging fails.
- **bridgeIfNotSwappable** (boolean) - Whether to bridge tokens even if they cannot be swapped (optional).
- **chainMetadata** (object) - Metadata related to the chain.
#### Response Example
{
"isActive": true,
"tokens": [
{
"symbol": "ETH",
"address": "0x4200000000000000000000000000000000000006",
"maxDepositLimitUsd": 1000000,
"minDepositLimitUsd": 10
}
],
"postBridgeData": {},
"tokenOut": "USDC",
"refundAddress": "0xabc...",
"bridgeIfNotSwappable": false,
"chainMetadata": {}
}
#### Error Responses
- **HttpApiDecodeError** (400) - The request did not match the expected schema.
- **InvalidJwt** (401) - Invalid JWT token provided.
- **Unauthorized** (403) - User is not authorized to access this resource.
- **DepositAddressNotFound** (404) - The specified deposit address was not found.
- **DepositAddressChainsNotSupported** (400) - The specified chains are not supported for deposit addresses.
- **DepositAddressInvalidDestinationAddress** (400) - The provided destination address is invalid for the specified chain.
- **DepositAddressMultipleChainTypesNotAllowed** (400) - Multiple chain types are not allowed for this operation.
```
--------------------------------
### Get User Bridge History
Source: https://docs.rhino.fi/api-reference/bridge/history/user-history
Fetches a list of bridge transaction records for the authenticated user.
```APIDOC
## GET /v1/bridge/history/user-history
### Description
Retrieves a list of bridge transaction records for the authenticated user.
### Method
GET
### Endpoint
/v1/bridge/history/user-history
### Parameters
#### Query Parameters
- **limit** (integer) - Optional - The maximum number of records to return.
- **offset** (integer) - Optional - The number of records to skip before starting to collect the result set.
- **chainIn** (string) - Optional - Filter by the input chain.
- **chainOut** (string) - Optional - Filter by the output chain.
- **token** (string) - Optional - Filter by the token symbol.
- **state** (string) - Optional - Filter by the transaction state (e.g., PENDING, COMPLETED, FAILED).
- **startDate** (string) - Optional - Filter by transactions on or after this date (ISO 8601 format).
- **endDate** (string) - Optional - Filter by transactions on or before this date (ISO 8601 format).
### Response
#### Success Response (200)
- **data** (array) - An array of bridge transaction objects.
- **_id** (string) - Unique identifier for the transaction.
- **userId** (string) - Identifier for the user.
- **chainIn** (string) - The input chain of the transaction.
- **chainOut** (string) - The output chain of the transaction.
- **amountIn** (string) - The amount of tokens deposited.
- **amountInUsd** (string) - The USD value of the deposited amount.
- **amountOut** (string) - The amount of tokens received.
- **amountOutUsd** (string) - The USD value of the received amount.
- **amountNative** (string) - The amount of native currency (e.g., gas) used.
- **amountNativeUsd** (string) - The USD value of the native currency used.
- **fee** (string) - The fee charged for the bridge transaction.
- **feeUsd** (string) - The USD value of the fee.
- **gasFee** (string) - The gas fee for the transaction.
- **gasFeeUsd** (string) - The USD value of the gas fee.
- **platformFee** (string) - The platform fee for the transaction.
- **platformFeeUsd** (string) - The USD value of the platform fee.
- **percentageFee** (string) - The percentage fee applied.
- **percentageFeeUsd** (string) - The USD value of the percentage fee.
- **sourceGasFee** (string) - The gas fee on the source chain.
- **sourceGasFeeUsd** (string) - The USD value of the source gas fee.
- **recipient** (string) - The recipient address on the destination chain.
- **depositor** (string) - The depositor's address on the source chain.
- **createdAt** (string) - The timestamp when the transaction was created (ISO 8601 format).
- **commitmentDate** (string) - The timestamp when the transaction was committed (ISO 8601 format).
- **speed** (string) - The speed of the bridge transaction (e.g., fast, standard, slow).
- **estimatedDuration** (number) - Estimated duration of the transaction in seconds.
- **postBridgeData** (object) - Additional data specific to the post-bridge operation.
- **token** (string) - The symbol of the token bridged.
- **usdPrice** (string) - The USD price of the token at the time of the transaction.
- **_tag** (string) - Tag indicating the type of operation (e.g., 'bridge').
- **state** (string) - The current state of the transaction (e.g., PENDING, COMPLETED, FAILED).
#### Response Example
```json
{
"data": [
{
"_id": "60f3b2b3e1b3f3b3f3b3f3b3",
"userId": "user123",
"chainIn": "ethereum",
"chainOut": "polygon",
"amountIn": "1.0",
"amountInUsd": "3000.00",
"amountOut": "0.99",
"amountOutUsd": "2970.00",
"amountNative": "0.001",
"amountNativeUsd": "3.00",
"fee": "0.01",
"feeUsd": "30.00",
"gasFee": "0.0005",
"gasFeeUsd": "1.50",
"platformFee": "0.001",
"platformFeeUsd": "3.00",
"percentageFee": "1.0",
"percentageFeeUsd": "30.00",
"sourceGasFee": "0.0008",
"sourceGasFeeUsd": "2.40",
"recipient": "0xabc...",
"depositor": "0xdef...",
"createdAt": "2023-10-27T10:00:00Z",
"commitmentDate": "2023-10-27T10:05:00Z",
"speed": "fast",
"estimatedDuration": 300,
"postBridgeData": {},
"token": "ETH",
"usdPrice": "3000.00",
"_tag": "bridge",
"state": "COMPLETED"
}
]
}
```
```
--------------------------------
### Initialize Solana Chain Adapter from Wallet
Source: https://docs.rhino.fi/sdk/chain-adapters/solana
Use this method to integrate with connected wallets in web applications or when managing your own wallet instance. Ensure the wallet object, chain configuration, and RPC URL are correctly provided.
```typescript
import { getSolanaChainAdapterFromWallet } from '@rhino.fi/sdk/adapters/solana'
// You can initialize the wallet yourself or depending on the specific browser
// wallet find it in th global window object
const chainAdapter = getSolanaChainAdapterFromWallet(
wallet,
chainConfig,
rpcUrl,
)
```