Skip to main content

Utility Methods

Utility methods handle approvals, allowances, refunds, and wallet authentication.

allowance

Returns the current ERC-20 token allowance granted by a wallet to a spender contract.

Parameters

Example


checkApprove

Determines whether an ERC-20 approval is needed and, if so, returns the approval transaction data ready to send.

Parameters

Extends AllowanceRequestInterface, plus:

Response: ApproveResponseInterface

Example

Tip: The approvalAddress field in the swap response contains the address to approve tokens for. Always use that value, as it may differ per provider.

claim

Returns transaction data for claiming tokens that are ready to be redeemed via the Arbitrum Bridge (ETH ↔ Arbitrum). Used when waitForStatus resolves with status === 'READY_TO_CLAIM'.

Parameters

Example


celerRefund

Returns transaction data for refunding a failed Celer Bridge cross-chain swap.

Parameters

Example


authWalletMessage

Returns a message that the user must sign with their wallet for Retrobridge provider authentication. The resulting signature must be passed in the signature field of the swap request.

Example


healthcheck

Verifies the API is online.
Useful for readiness checks before showing the UI: