You can use the bridge API directly if you need some additional data or if your application requires more control over the bridge flow. For that the SDK offers a typesafe wrapper around the Rhino API through a dedicated object. The following sections showcase some common use cases for this.
const publicQuoteResult = await rhinoSdk.api.bridge.getPublicQuote({ token: SupportedTokens.USDT, chainIn: SupportedChains.ETHEREUM, chainOut: SupportedChains.SOLANA, amount: '100', mode: 'pay',})const userQuoteResult = await rhinoSdk.api.bridge.getUserQuote({ /// Same args as public quote with additional depositor and recipient address added})if(userQuoteResult.error) { throw new Error(`Error fetching user quote: ${userQuoteResult.error}`)}const quoteId = userQuoteResult.data.quoteIdconst commitmentResult = await rhinoSdk.api.bridge.commitQuote(quoteId)if(commitmentResult.error) { throw new Error(`Error committing quote: ${commitmentResult.error}`)}
The bridge functions in the SDK will already handle this logic for you. You should only do this manually if you have a very specific use case that is not covered by those.