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
Usage Parameters Return
Gets a specific bridge deposit.
netId: network_id where the rollup initiated
depositCnt: the nonce of deposit on a certain chain
Copy sdk.bridgeService.getBridge(netId: number, depositCnt: string): Promise<AxiosResponse>;
2.getMerkleProof
Usage Parameters Return
Retrieves the Merkle proof for a specific deposit.
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
Copy sdk.bridgeService.getMerkleProof(netId: number, depositCnt: string, destNetwork: number): Promise<AxiosResponse>;
3.getBridgeByTransaction
Usage Parameters Return
Gets a bridge deposit by its transaction hash.
netId: network_id where the rollup initiated
txHash: the rollup txHash
Copy sdk.bridgeService.getBridgeByTransaction(netId: number, txHash: string): Promise<AxiosResponse>;
4.getBridges
Usage Parameters Return
Retrieves bridge deposits for a specific user address.
userAddr: the direct caller address of the bridge contract
offset: the start position of rollup list
limit: the return count of rollup
Copy sdk.bridgeService.getBridges(userAddr: string, offset: number = 0, limit: number = 10): Promise<AxiosResponse>;
5.getSenderBridges
Usage Parameters Return
Retrieves all bridge deposits for a specific sender address.
senderAddr: the sender of the rollup tx
offset: the start position of rollup list
limit: the return count of rollup
Copy sdk.bridgeService.getSenderBridges(senderAddr: string, offset: number = 0, limit: number = 10): Promise<AxiosResponse>;
6.getSenderBridgesNotClaimed
Usage Parameters Return
Retrieves all bridge deposits to be claimed for a specific sender address.
senderAddr: the sender of the rollup tx
offset: the start position of rollup list
limit: the return count of rollup
Copy sdk.bridgeService.getSenderBridgesNotClaimed(senderAddr: string, offset: number = 0, limit: number = 10): Promise<AxiosResponse>;
7.getCrossChainBridges
Usage Parameters Return
Gets cross-chain bridge transactions for a specific user address.
rollinTx: the rollin tx on the initiate chain
networkId: the initiate chain network_id
Copy sdk.bridgeService.getCrossChainBridges(senderAddr: string, offset: number = 0, limit: number = 10): Promise<AxiosResponse>;
8.getCrossChainBridgeByRollIn
Usage Parameters Return
Retrieves a cross-chain bridge transaction by its roll-in transaction hash.
rollinTx: the rollin tx on the initiate chain
networkId: the initiate chain network_id
Copy sdk.bridgeService.getCrossChainBridgeByRollIn(rollinTx: string, networkId: number): Promise<AxiosResponse>;
9.batchGetCrossChainBridges
Usage Parameters Return
Gets multiple cross-chain bridge transactions in a single batch request.
rollinRequests: the array of the rollin request params you want to query
Copy sdk.bridgeService.batchGetCrossChainBridges(rollInRequests: Array<{ rollin_tx: string; network_id: number }>): Promise<AxiosResponse>;
Last updated 5 months ago