# Query Service

## Bridge Service

The `BridgeService` class provides methods to interact with the Cycle network's bridge functionality, allowing users to manage deposits, claims, and cross-chain transactions.

## **1.getBridge**

{% tabs %}
{% tab title="Usage" %}
Gets a specific bridge deposit.
{% endtab %}

{% tab title="Parameters" %}
netId: network\_id where the rollup initiated

depositCnt: the nonce of deposit on a certain chain
{% endtab %}

{% tab title="Return" %}
Standard AxiosResponse
{% endtab %}
{% endtabs %}

```typescript
sdk.bridgeService.getBridge(netId: number, depositCnt: string): Promise<AxiosResponse>;
```

## **2.getMerkleProof**

{% tabs %}
{% tab title="Usage" %}
Retrieves the Merkle proof for a specific deposit.
{% endtab %}

{% tab title="Parameters" %}
netId: network\_id where the rollup initiated

depositCnt: the nonce of deposit on a certain chain

destNetwork: network\_id where corresponding to the rollup destination chain
{% endtab %}

{% tab title="Return" %}
Standard AxiosResponse
{% endtab %}
{% endtabs %}

```typescript
sdk.bridgeService.getMerkleProof(netId: number, depositCnt: string, destNetwork: number): Promise<AxiosResponse>;
```

## **3.getBridgeByTransaction**

{% tabs %}
{% tab title="Usage" %}
Gets a bridge deposit by its transaction hash.
{% endtab %}

{% tab title="Parameters" %}
netId: network\_id where the rollup initiated

txHash: the rollup txHash
{% endtab %}

{% tab title="Return" %}
Standard AxiosResponse
{% endtab %}
{% endtabs %}

```typescript
sdk.bridgeService.getBridgeByTransaction(netId: number, txHash: string): Promise<AxiosResponse>;
```

## **4.getBridges**

{% tabs %}
{% tab title="Usage" %}
Retrieves bridge deposits for a specific user address.
{% endtab %}

{% tab title="Parameters" %}
userAddr: the direct caller address of the bridge contract

offset: the start position of rollup list

limit: the return count of rollup
{% endtab %}

{% tab title="Return" %}
Standard AxiosResponse
{% endtab %}
{% endtabs %}

```typescript
sdk.bridgeService.getBridges(userAddr: string, offset: number = 0, limit: number = 10): Promise<AxiosResponse>;
```

## **5.getSenderBridges**

{% tabs %}
{% tab title="Usage" %}
Retrieves all bridge deposits for a specific sender address.
{% endtab %}

{% tab title="Parameters" %}
senderAddr: the sender of the rollup tx

offset: the start position of rollup list

limit: the return count of rollup
{% endtab %}

{% tab title="Return" %}
Standard AxiosResponse
{% endtab %}
{% endtabs %}

```typescript
sdk.bridgeService.getSenderBridges(senderAddr: string, offset: number = 0, limit: number = 10): Promise<AxiosResponse>;
```

## **6.getSenderBridgesNotClaimed**

{% tabs %}
{% tab title="Usage" %}
Retrieves all bridge deposits to be claimed for a specific sender address.
{% endtab %}

{% tab title="Parameters" %}
senderAddr: the sender of the rollup tx

offset: the start position of rollup list

limit: the return count of rollup
{% endtab %}

{% tab title="Return" %}
Standard AxiosResponse
{% endtab %}
{% endtabs %}

```typescript
sdk.bridgeService.getSenderBridgesNotClaimed(senderAddr: string, offset: number = 0, limit: number = 10): Promise<AxiosResponse>;
```

## **7.getCrossChainBridges**

{% tabs %}
{% tab title="Usage" %}
Gets cross-chain bridge transactions for a specific user address.
{% endtab %}

{% tab title="Parameters" %}
rollinTx:  the rollin tx on the initiate chain

networkId: the initiate chain network\_id
{% endtab %}

{% tab title="Return" %}
Standard AxiosResponse
{% endtab %}
{% endtabs %}

```typescript
sdk.bridgeService.getCrossChainBridges(senderAddr: string, offset: number = 0, limit: number = 10): Promise<AxiosResponse>;
```

## **8.getCrossChainBridgeByRollIn**

{% tabs %}
{% tab title="Usage" %}
Retrieves a cross-chain bridge transaction by its roll-in transaction hash.
{% endtab %}

{% tab title="Parameters" %}
rollinTx:  the rollin tx on the initiate chain

networkId: the initiate chain network\_id
{% endtab %}

{% tab title="Return" %}
Standard AxiosResponse
{% endtab %}
{% endtabs %}

```typescript
sdk.bridgeService.getCrossChainBridgeByRollIn(rollinTx: string, networkId: number): Promise<AxiosResponse>;
```

## **9.batchGetCrossChainBridges**

{% tabs %}
{% tab title="Usage" %}
Gets multiple cross-chain bridge transactions in a single batch request.
{% endtab %}

{% tab title="Parameters" %}
rollinRequests: the array of the rollin request params you want to query
{% endtab %}

{% tab title="Return" %}
Standard AxiosResponse
{% endtab %}
{% endtabs %}

```typescript
sdk.bridgeService.batchGetCrossChainBridges(rollInRequests: Array<{ rollin_tx: string; network_id: number }>): Promise<AxiosResponse>;
```
