From 4fa490834ab4d4e06fbb1885269777c04abf55e9 Mon Sep 17 00:00:00 2001 From: ChiTimesChi <88190723+ChiTimesChi@users.noreply.github.com> Date: Mon, 29 Jul 2024 17:37:30 +0200 Subject: [PATCH 01/17] feat: add option to exclude RFQ quotes --- packages/sdk-router/src/operations/bridge.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/sdk-router/src/operations/bridge.ts b/packages/sdk-router/src/operations/bridge.ts index 34edb023ad..e796a3105d 100644 --- a/packages/sdk-router/src/operations/bridge.ts +++ b/packages/sdk-router/src/operations/bridge.ts @@ -82,7 +82,8 @@ export async function bridgeQuote( tokenOut: string, amountIn: BigintIsh, deadline?: BigNumber, - excludeCCTP: boolean = false + excludeCCTP: boolean = false, + excludeRFQ: boolean = false ): Promise { // Get the quotes sorted by maxAmountOut const allQuotes = await allBridgeQuotes.call( @@ -97,8 +98,11 @@ export async function bridgeQuote( // Get the first quote that is not excluded const bestQuote = allQuotes.find( (quote) => - !excludeCCTP || - quote.bridgeModuleName !== this.synapseCCTPRouterSet.bridgeModuleName + (!excludeCCTP || + quote.bridgeModuleName !== + this.synapseCCTPRouterSet.bridgeModuleName) && + (!excludeRFQ || + quote.bridgeModuleName !== this.fastBridgeRouterSet.bridgeModuleName) ) if (!bestQuote) { throw new Error('No route found') From 2a4be5c9e8e532e689a7194b72734b803149c29d Mon Sep 17 00:00:00 2001 From: ChiTimesChi <88190723+ChiTimesChi@users.noreply.github.com> Date: Mon, 29 Jul 2024 17:41:28 +0200 Subject: [PATCH 02/17] feat: scaffold passing originUserAddress --- packages/sdk-router/src/module/synapseModuleSet.ts | 4 +++- packages/sdk-router/src/operations/bridge.ts | 14 ++++++++++---- packages/sdk-router/src/rfq/fastBridgeRouterSet.ts | 1 + 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/packages/sdk-router/src/module/synapseModuleSet.ts b/packages/sdk-router/src/module/synapseModuleSet.ts index 91543947e0..1b4f92e230 100644 --- a/packages/sdk-router/src/module/synapseModuleSet.ts +++ b/packages/sdk-router/src/module/synapseModuleSet.ts @@ -98,6 +98,7 @@ export abstract class SynapseModuleSet { * @param tokenIn - The input token. * @param tokenOut - The output token. * @param amountIn - The amount of input token. + * @param originUserAddress - The address of the user on the origin chain. * * @returns - A list of BridgeRoute objects with the found routes. */ @@ -106,7 +107,8 @@ export abstract class SynapseModuleSet { destChainId: number, tokenIn: string, tokenOut: string, - amountIn: BigintIsh + amountIn: BigintIsh, + originUserAddress?: string ): Promise /** diff --git a/packages/sdk-router/src/operations/bridge.ts b/packages/sdk-router/src/operations/bridge.ts index e796a3105d..93dc19086b 100644 --- a/packages/sdk-router/src/operations/bridge.ts +++ b/packages/sdk-router/src/operations/bridge.ts @@ -69,6 +69,7 @@ export async function bridge( * @param amountIn - The amount of input token. * @param deadline - The transaction deadline, optional. * @param excludeCCTP - Flag to exclude CCTP quotes from the result, optional and defaults to False. + * @param originUserAddress - The address of the user on the origin chain. * * @returns - A promise that resolves to the best bridge quote. * @@ -83,7 +84,8 @@ export async function bridgeQuote( amountIn: BigintIsh, deadline?: BigNumber, excludeCCTP: boolean = false, - excludeRFQ: boolean = false + excludeRFQ: boolean = false, + originUserAddress?: string ): Promise { // Get the quotes sorted by maxAmountOut const allQuotes = await allBridgeQuotes.call( @@ -93,7 +95,8 @@ export async function bridgeQuote( tokenIn, tokenOut, amountIn, - deadline + deadline, + originUserAddress ) // Get the first quote that is not excluded const bestQuote = allQuotes.find( @@ -119,6 +122,7 @@ export async function bridgeQuote( * @param tokenOut - The output token. * @param amountIn - The amount of input token. * @param deadline - The transaction deadline, optional. + * @param originUserAddress - The address of the user on the origin chain. * @returns - A promise that resolves to an array of bridge quotes. */ export async function allBridgeQuotes( @@ -128,7 +132,8 @@ export async function allBridgeQuotes( tokenIn: string, tokenOut: string, amountIn: BigintIsh, - deadline?: BigNumber + deadline?: BigNumber, + originUserAddress?: string ): Promise { invariant( originChainId !== destChainId, @@ -143,7 +148,8 @@ export async function allBridgeQuotes( destChainId, tokenIn, tokenOut, - amountIn + amountIn, + originUserAddress ) // Filter out routes with zero minAmountOut and finalize the rest return Promise.all( diff --git a/packages/sdk-router/src/rfq/fastBridgeRouterSet.ts b/packages/sdk-router/src/rfq/fastBridgeRouterSet.ts index 0d04d988ac..1442b8c3f9 100644 --- a/packages/sdk-router/src/rfq/fastBridgeRouterSet.ts +++ b/packages/sdk-router/src/rfq/fastBridgeRouterSet.ts @@ -94,6 +94,7 @@ export class FastBridgeRouterSet extends SynapseModuleSet { tokenIn: string, tokenOut: string, amountIn: BigintIsh + // TODO: originUserAddress ): Promise { // Check that Routers exist on both chains if (!this.getModule(originChainId) || !this.getModule(destChainId)) { From 0e6cbe1bfea6163f22f4959ff6f82430576508c9 Mon Sep 17 00:00:00 2001 From: ChiTimesChi <88190723+ChiTimesChi@users.noreply.github.com> Date: Mon, 29 Jul 2024 18:08:09 +0200 Subject: [PATCH 03/17] feat: encode user's origin address in rawParams for RFQ --- .../sdk-router/src/rfq/fastBridgeRouterSet.ts | 30 +++++++++++++++---- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/packages/sdk-router/src/rfq/fastBridgeRouterSet.ts b/packages/sdk-router/src/rfq/fastBridgeRouterSet.ts index 1442b8c3f9..99cad79b1d 100644 --- a/packages/sdk-router/src/rfq/fastBridgeRouterSet.ts +++ b/packages/sdk-router/src/rfq/fastBridgeRouterSet.ts @@ -93,8 +93,8 @@ export class FastBridgeRouterSet extends SynapseModuleSet { destChainId: number, tokenIn: string, tokenOut: string, - amountIn: BigintIsh - // TODO: originUserAddress + amountIn: BigintIsh, + originUserAddress?: string ): Promise { // Check that Routers exist on both chains if (!this.getModule(originChainId) || !this.getModule(destChainId)) { @@ -136,9 +136,11 @@ export class FastBridgeRouterSet extends SynapseModuleSet { token: quote.ticker.destToken.token, }, originQuery, - // On-chain swaps are not supported for RFQ tokens - // TODO: signal optional gas airdrop - destQuery: createNoSwapQuery(tokenOut, destAmountOut), + destQuery: this.createRFQDestQuery( + tokenOut, + destAmountOut, + originUserAddress + ), bridgeModuleName: this.bridgeModuleName, })) } @@ -310,4 +312,22 @@ export class FastBridgeRouterSet extends SynapseModuleSet { return 0 <= age && age < FastBridgeRouterSet.MAX_QUOTE_AGE_MILLISECONDS }) } + + private createRFQDestQuery( + tokenOut: string, + amountOut: BigNumber, + originUserAddress?: string + ): Query { + // On-chain swaps are not supported for RFQ on the destination chain + const destQuery = createNoSwapQuery(tokenOut, amountOut) + // Don't modify the Query if user address is undefined + if (!originUserAddress) { + return destQuery + } + // Make sure the rebate flag is always included if user address is defined. + // 0x00 is a single byte that indicates the rebate flag is turned off. + // Concatenate the originUserAddress (without 0x prefix) to the end of the rawParams. + destQuery.rawParams = '0x00' + originUserAddress.slice(2) + return destQuery + } } From 8b0e15b30bb0f8c977c0bff22900c5af0c0eec56 Mon Sep 17 00:00:00 2001 From: ChiTimesChi <88190723+ChiTimesChi@users.noreply.github.com> Date: Mon, 29 Jul 2024 18:29:24 +0200 Subject: [PATCH 04/17] feat!: introduce a single bridge quote options object BREAKING CHANGE: The `bridgeQuote` and `allBridgeQuotes` functions now accept an options object instead of individual optional parameters. --- packages/sdk-router/src/operations/bridge.ts | 45 +++++++++++--------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/packages/sdk-router/src/operations/bridge.ts b/packages/sdk-router/src/operations/bridge.ts index 93dc19086b..d735000156 100644 --- a/packages/sdk-router/src/operations/bridge.ts +++ b/packages/sdk-router/src/operations/bridge.ts @@ -55,6 +55,20 @@ export async function bridge( return module.bridge(to, destChainId, token, amount, originQuery, destQuery) } +/** + * Options for the bridgeQuote and allBridgeQuotes functions. + * + * @param deadline - The transaction deadline, optional. + * @param excludedModules - An array of module names to exclude from the quote, optional. + * @param originUserAddress - The address of the user on the origin chain, optional. This parameter has + * to be specified for a correct integration via a smart-contract into SynapseRFQ module. + */ +interface BridgeQuoteOptions { + deadline?: BigNumber + excludedModules?: string[] + originUserAddress?: string +} + /** * This method tries to fetch the best quote from either the Synapse Router or SynapseCCTP Router. * It first handles the native token, then fetches the best quote for both types of routers. @@ -82,10 +96,7 @@ export async function bridgeQuote( tokenIn: string, tokenOut: string, amountIn: BigintIsh, - deadline?: BigNumber, - excludeCCTP: boolean = false, - excludeRFQ: boolean = false, - originUserAddress?: string + options: BridgeQuoteOptions = {} ): Promise { // Get the quotes sorted by maxAmountOut const allQuotes = await allBridgeQuotes.call( @@ -95,18 +106,9 @@ export async function bridgeQuote( tokenIn, tokenOut, amountIn, - deadline, - originUserAddress - ) - // Get the first quote that is not excluded - const bestQuote = allQuotes.find( - (quote) => - (!excludeCCTP || - quote.bridgeModuleName !== - this.synapseCCTPRouterSet.bridgeModuleName) && - (!excludeRFQ || - quote.bridgeModuleName !== this.fastBridgeRouterSet.bridgeModuleName) + options ) + const bestQuote = allQuotes[0] if (!bestQuote) { throw new Error('No route found') } @@ -132,8 +134,7 @@ export async function allBridgeQuotes( tokenIn: string, tokenOut: string, amountIn: BigintIsh, - deadline?: BigNumber, - originUserAddress?: string + options: BridgeQuoteOptions = {} ): Promise { invariant( originChainId !== destChainId, @@ -143,19 +144,25 @@ export async function allBridgeQuotes( tokenIn = handleNativeToken(tokenIn) const allQuotes: BridgeQuote[][] = await Promise.all( this.allModuleSets.map(async (moduleSet) => { + // No-op if the module is explicitly excluded + if (options.excludedModules?.includes(moduleSet.bridgeModuleName)) { + return [] + } const routes = await moduleSet.getBridgeRoutes( originChainId, destChainId, tokenIn, tokenOut, amountIn, - originUserAddress + options.originUserAddress ) // Filter out routes with zero minAmountOut and finalize the rest return Promise.all( routes .filter((route) => route.destQuery.minAmountOut.gt(0)) - .map((route) => moduleSet.finalizeBridgeRoute(route, deadline)) + .map((route) => + moduleSet.finalizeBridgeRoute(route, options.deadline) + ) ) }) ) From 3837cea8b9810ce1d9f7dfbc99447ed3874d6e0b Mon Sep 17 00:00:00 2001 From: ChiTimesChi <88190723+ChiTimesChi@users.noreply.github.com> Date: Tue, 30 Jul 2024 11:29:43 +0200 Subject: [PATCH 05/17] docs: new options --- packages/sdk-router/README.md | 14 +++++++-- packages/sdk-router/src/operations/bridge.ts | 31 ++++++++++++-------- 2 files changed, 30 insertions(+), 15 deletions(-) diff --git a/packages/sdk-router/README.md b/packages/sdk-router/README.md index 6245c9a76a..f8785b520c 100644 --- a/packages/sdk-router/README.md +++ b/packages/sdk-router/README.md @@ -77,11 +77,21 @@ const bridgeQuotes: BridgeQuote[] = await synapseSDK.allBridgeQuotes( tokenOut, // Amount of tokens to bridge, in origin token decimals: 1_000_000_000 amountIn, - // Deadline for the transaction to be initiated on the origin chain, in seconds (optional) - deadline + { + // Deadline for the transaction to be initiated on the origin chain, in seconds (optional) + deadline: 1234567890, + // List of bridge modules to exclude from the result, optional. + // Empty list means that all modules are included. + excludedModules: ['SynapseBridge', 'SynapseCCTP', 'SynapseRFQ'], + // Address of the user on the origin chain, optional. + // MANDATORY if the smart contract is going to initiate the bridge operation. + originUserAddress: '0x1234567890abcdef1234567890abcdef12345678', + } ) ``` +> **Note:** The `originUserAddress` MUST BE provided, if a smart contract is going to initiate the bridge operation. That includes smart wallets (like Safe), or a third party integration (like a bridge aggregator smart contract). + The returned list is sorted by the `maxAmountOut` field, so the first quote is the one yielding the highest amount of tokens on the destination chain. If either of the input/output tokens is a native gas token (e.g. ETH on Ethereum/Arbitrum, AVAX on Avalanche, etc.), the specialized address `0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE` should be used instead of the token address. diff --git a/packages/sdk-router/src/operations/bridge.ts b/packages/sdk-router/src/operations/bridge.ts index d735000156..fe040fc0e8 100644 --- a/packages/sdk-router/src/operations/bridge.ts +++ b/packages/sdk-router/src/operations/bridge.ts @@ -70,24 +70,23 @@ interface BridgeQuoteOptions { } /** - * This method tries to fetch the best quote from either the Synapse Router or SynapseCCTP Router. - * It first handles the native token, then fetches the best quote for both types of routers. - * If the router addresses are valid for CCTP, it will fetch the quote from the CCTP routers, otherwise it will resolve to undefined. - * It waits for both types of quotes, then determines the best one by comparing the maximum output amount. - * If no best quote can be found, it will throw an error. + * This method fetches the best quote from all available bridge modules. Their names are SynapseBridge, SynapseCCTP and SynapseRFQ. + * It is possible to use a custom deadline, exclude a set of modules by providing the list of excluded module names + * and specify the originUserAddress. + * + * Note: originUserAddress MUST BE provided, if a smart contract is going to initiate the bridge operation. That includes + * smart wallets (like Safe), or a third party integration (like a bridge aggregator smart contract). * * @param originChainId - The ID of the original chain. * @param destChainId - The ID of the destination chain. * @param tokenIn - The input token. * @param tokenOut - The output token. * @param amountIn - The amount of input token. - * @param deadline - The transaction deadline, optional. - * @param excludeCCTP - Flag to exclude CCTP quotes from the result, optional and defaults to False. - * @param originUserAddress - The address of the user on the origin chain. + * @param options - Optional parameters including deadline, excludedModules, and originUserAddress. * - * @returns - A promise that resolves to the best bridge quote. + * @returns A promise that resolves to the best bridge quote. * - * @throws - Will throw an error if no best quote could be determined. + * @throws Will throw an error if no route is found. */ export async function bridgeQuote( this: SynapseSDK, @@ -116,16 +115,22 @@ export async function bridgeQuote( } /** - * This method tries to fetch all available quotes from all available bridge modules. + * This method tries to fetch all available quotes from all available bridge modules. Their names are SynapseBridge, SynapseCCTP and SynapseRFQ. + * It is possible to use a custom deadline, exclude a set of modules by providing the list of excluded module names + * and specify the originUserAddress. + * + * Note: originUserAddress MUST BE provided, if a smart contract is going to initiate the bridge operation. That includes + * smart wallets (like Safe), or a third party integration (like a bridge aggregator smart contract). * * @param originChainId - The ID of the original chain. * @param destChainId - The ID of the destination chain. * @param tokenIn - The input token. * @param tokenOut - The output token. * @param amountIn - The amount of input token. - * @param deadline - The transaction deadline, optional. - * @param originUserAddress - The address of the user on the origin chain. + * @param options - Optional parameters including deadline, excludedModules, and originUserAddress. + * * @returns - A promise that resolves to an array of bridge quotes. + * The returned array is sorted by maxAmountOut in descending order, all quotes have non-zero amountOut. */ export async function allBridgeQuotes( this: SynapseSDK, From f4a762fc6c5ab48a69614def7de6cd3f9c49c0a3 Mon Sep 17 00:00:00 2001 From: ChiTimesChi <88190723+ChiTimesChi@users.noreply.github.com> Date: Tue, 30 Jul 2024 11:31:05 +0200 Subject: [PATCH 06/17] test: update --- packages/sdk-router/src/sdk.test.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/sdk-router/src/sdk.test.ts b/packages/sdk-router/src/sdk.test.ts index da26f4b5a8..9791cdfbc7 100644 --- a/packages/sdk-router/src/sdk.test.ts +++ b/packages/sdk-router/src/sdk.test.ts @@ -522,8 +522,9 @@ describe('SynapseSDK', () => { ARB_USDT, ETH_USDC, amount, - undefined, - false + { + excludedModules: [], + } ) createBridgeQuoteTests( @@ -562,8 +563,9 @@ describe('SynapseSDK', () => { ARB_USDT, ETH_USDC, amount, - undefined, - true + { + excludedModules: ['SynapseCCTP'], + } ) createBridgeQuoteTests( From 5afe684b14fb1ad9878c3f75944baf900592a720 Mon Sep 17 00:00:00 2001 From: ChiTimesChi <88190723+ChiTimesChi@users.noreply.github.com> Date: Tue, 30 Jul 2024 11:43:11 +0200 Subject: [PATCH 07/17] test: cleanup --- packages/sdk-router/src/sdk.test.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/sdk-router/src/sdk.test.ts b/packages/sdk-router/src/sdk.test.ts index 9791cdfbc7..6574bc692e 100644 --- a/packages/sdk-router/src/sdk.test.ts +++ b/packages/sdk-router/src/sdk.test.ts @@ -521,10 +521,7 @@ describe('SynapseSDK', () => { SupportedChainId.ETH, ARB_USDT, ETH_USDC, - amount, - { - excludedModules: [], - } + amount ) createBridgeQuoteTests( From 2ef9473f654afd54c1c8084546ec594b363f2e28 Mon Sep 17 00:00:00 2001 From: ChiTimesChi <88190723+ChiTimesChi@users.noreply.github.com> Date: Tue, 30 Jul 2024 11:48:55 +0200 Subject: [PATCH 08/17] fix: make `createRFQDestQuery` static, expose for tests --- packages/sdk-router/src/rfq/fastBridgeRouterSet.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/sdk-router/src/rfq/fastBridgeRouterSet.ts b/packages/sdk-router/src/rfq/fastBridgeRouterSet.ts index 99cad79b1d..282cebcdff 100644 --- a/packages/sdk-router/src/rfq/fastBridgeRouterSet.ts +++ b/packages/sdk-router/src/rfq/fastBridgeRouterSet.ts @@ -136,7 +136,7 @@ export class FastBridgeRouterSet extends SynapseModuleSet { token: quote.ticker.destToken.token, }, originQuery, - destQuery: this.createRFQDestQuery( + destQuery: FastBridgeRouterSet.createRFQDestQuery( tokenOut, destAmountOut, originUserAddress @@ -313,7 +313,7 @@ export class FastBridgeRouterSet extends SynapseModuleSet { }) } - private createRFQDestQuery( + public static createRFQDestQuery( tokenOut: string, amountOut: BigNumber, originUserAddress?: string From bcc5fc8b0b78afe958936f5b98549a761f24905d Mon Sep 17 00:00:00 2001 From: ChiTimesChi <88190723+ChiTimesChi@users.noreply.github.com> Date: Tue, 30 Jul 2024 11:58:30 +0200 Subject: [PATCH 09/17] test: add unit tests for `createRFQDestQuery` --- .../src/rfq/fastBridgeRouterSet.test.ts | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/packages/sdk-router/src/rfq/fastBridgeRouterSet.test.ts b/packages/sdk-router/src/rfq/fastBridgeRouterSet.test.ts index 5cbeaeae48..3bcab0e47b 100644 --- a/packages/sdk-router/src/rfq/fastBridgeRouterSet.test.ts +++ b/packages/sdk-router/src/rfq/fastBridgeRouterSet.test.ts @@ -117,4 +117,42 @@ describe('FastBridgeRouterSet', () => { expect(result).toEqual(BigNumber.from(999_001)) }) }) + + describe('createRFQDestQuery', () => { + const tokenOut = '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE' + const amountOut = parseFixed('1000', 18) + + const expectedDestQuery: CCTPRouterQuery = { + routerAdapter: '0x0000000000000000000000000000000000000000', + tokenOut, + minAmountOut: amountOut, + deadline: BigNumber.from(0), + rawParams: '0x', + } + + const originUserAddress = '0x1234567890abcdef1234567890abcdef12345678' + // "No gas rebate" flag, followed by the user address + const expectedRawParamsWithUserAddress = + '0x001234567890abcdef1234567890abcdef12345678' + + it('Origin user address is not provided', () => { + const destQuery = FastBridgeRouterSet.createRFQDestQuery( + tokenOut, + amountOut + ) + expect(destQuery).toEqual(expectedDestQuery) + }) + + it('Origin user address is provided', () => { + const destQuery = FastBridgeRouterSet.createRFQDestQuery( + tokenOut, + amountOut, + originUserAddress + ) + expect(destQuery).toEqual({ + ...expectedDestQuery, + rawParams: expectedRawParamsWithUserAddress, + }) + }) + }) }) From 2febf6cf9534486812ad15a9ac131cd4ce1a4550 Mon Sep 17 00:00:00 2001 From: ChiTimesChi <88190723+ChiTimesChi@users.noreply.github.com> Date: Tue, 30 Jul 2024 12:49:08 +0200 Subject: [PATCH 10/17] feat: use FastBridgeRouterV2 address --- packages/sdk-router/src/constants/addresses.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/sdk-router/src/constants/addresses.ts b/packages/sdk-router/src/constants/addresses.ts index 42f4e02443..e8907b2754 100644 --- a/packages/sdk-router/src/constants/addresses.ts +++ b/packages/sdk-router/src/constants/addresses.ts @@ -57,7 +57,7 @@ export const CCTP_ROUTER_ADDRESS_MAP: AddressMap = generateAddressMap( /** * FastBridgeRouter contract address for all chains except ones from FAST_BRIDGE_ROUTER_EXCEPTION_MAP. */ -const FAST_BRIDGE_ROUTER_ADDRESS = '0x0000000000489d89D2B233D3375C045dfD05745F' +const FAST_BRIDGE_ROUTER_ADDRESS = '0xd50042193Db100FE0040005e00D5010000007e45' const FAST_BRIDGE_ROUTER_EXCEPTION_MAP: AddressMap = {} export const FAST_BRIDGE_ROUTER_ADDRESS_MAP: AddressMap = generateAddressMap( RFQ_SUPPORTED_CHAIN_IDS, From 5912888efece3396e56a0c8fdccbe9a60b5b9b35 Mon Sep 17 00:00:00 2001 From: ChiTimesChi <88190723+ChiTimesChi@users.noreply.github.com> Date: Tue, 30 Jul 2024 13:15:23 +0200 Subject: [PATCH 11/17] docs: be more explicit about smart contract integrations --- packages/sdk-router/README.md | 4 ++-- packages/sdk-router/src/operations/bridge.ts | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/sdk-router/README.md b/packages/sdk-router/README.md index f8785b520c..12ef9fce6e 100644 --- a/packages/sdk-router/README.md +++ b/packages/sdk-router/README.md @@ -84,13 +84,13 @@ const bridgeQuotes: BridgeQuote[] = await synapseSDK.allBridgeQuotes( // Empty list means that all modules are included. excludedModules: ['SynapseBridge', 'SynapseCCTP', 'SynapseRFQ'], // Address of the user on the origin chain, optional. - // MANDATORY if the smart contract is going to initiate the bridge operation. + // MANDATORY if a smart contract is going to initiate the bridge operation on behalf of the user. originUserAddress: '0x1234567890abcdef1234567890abcdef12345678', } ) ``` -> **Note:** The `originUserAddress` MUST BE provided, if a smart contract is going to initiate the bridge operation. That includes smart wallets (like Safe), or a third party integration (like a bridge aggregator smart contract). +> **Note:** The `originUserAddress` MUST BE provided, if a smart contract is going to initiate the bridge operation on behalf of the user. That includes smart wallets (like Safe), or a third party integration (like a bridge aggregator smart contract). The returned list is sorted by the `maxAmountOut` field, so the first quote is the one yielding the highest amount of tokens on the destination chain. diff --git a/packages/sdk-router/src/operations/bridge.ts b/packages/sdk-router/src/operations/bridge.ts index fe040fc0e8..93f9fa734f 100644 --- a/packages/sdk-router/src/operations/bridge.ts +++ b/packages/sdk-router/src/operations/bridge.ts @@ -61,7 +61,7 @@ export async function bridge( * @param deadline - The transaction deadline, optional. * @param excludedModules - An array of module names to exclude from the quote, optional. * @param originUserAddress - The address of the user on the origin chain, optional. This parameter has - * to be specified for a correct integration via a smart-contract into SynapseRFQ module. + * to be specified if a smart contract is going to initiate the bridge operation on behalf of the user. */ interface BridgeQuoteOptions { deadline?: BigNumber @@ -72,10 +72,10 @@ interface BridgeQuoteOptions { /** * This method fetches the best quote from all available bridge modules. Their names are SynapseBridge, SynapseCCTP and SynapseRFQ. * It is possible to use a custom deadline, exclude a set of modules by providing the list of excluded module names - * and specify the originUserAddress. + * and specify the user address on the origin chain. * - * Note: originUserAddress MUST BE provided, if a smart contract is going to initiate the bridge operation. That includes - * smart wallets (like Safe), or a third party integration (like a bridge aggregator smart contract). + * Note: originUserAddress MUST BE provided, if a smart contract is going to initiate the bridge operation on behalf of the user. + * That includes smart wallets (like Safe), or a third party integration (like a bridge aggregator smart contract). * * @param originChainId - The ID of the original chain. * @param destChainId - The ID of the destination chain. @@ -117,10 +117,10 @@ export async function bridgeQuote( /** * This method tries to fetch all available quotes from all available bridge modules. Their names are SynapseBridge, SynapseCCTP and SynapseRFQ. * It is possible to use a custom deadline, exclude a set of modules by providing the list of excluded module names - * and specify the originUserAddress. + * and specify the user address on the origin chain. * - * Note: originUserAddress MUST BE provided, if a smart contract is going to initiate the bridge operation. That includes - * smart wallets (like Safe), or a third party integration (like a bridge aggregator smart contract). + * Note: originUserAddress MUST BE provided, if a smart contract is going to initiate the bridge operation on behalf of the user. + * That includes smart wallets (like Safe), or a third party integration (like a bridge aggregator smart contract). * * @param originChainId - The ID of the original chain. * @param destChainId - The ID of the destination chain. From ebf07e05fe573003764da5bda3293ba9ee76591e Mon Sep 17 00:00:00 2001 From: ChiTimesChi <88190723+ChiTimesChi@users.noreply.github.com> Date: Wed, 31 Jul 2024 14:32:58 +0200 Subject: [PATCH 12/17] docs: add address section --- packages/sdk-router/README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/packages/sdk-router/README.md b/packages/sdk-router/README.md index 12ef9fce6e..213c3e587d 100644 --- a/packages/sdk-router/README.md +++ b/packages/sdk-router/README.md @@ -46,6 +46,26 @@ const synapseSDK = new SynapseSDK(chainIds, providers) ## Bridging +### Router Deployments + +The Routers for the same module are deployed to the same address on all chains (except for the exceptions below). + +| Bridge Module | Chain | Address | +| ------------- | --------- | -------------------------------------------- | +| SynapseBridge | \* | `0x7E7A0e201FD38d3ADAA9523Da6C109a07118C96a` | +| SynapseBridge | **Blast** | `0x0000000000365b1d5B142732CF4d33BcddED21Fc` | +| SynapseCCTP | \* | `0xd5a597d6e7ddf373a92C8f477DAAA673b0902F48` | +| SynapseRFQ | \* | `0xd50042193Db100FE0040005e00D5010000007e45` | + +### Router Deployments (deprecated) + +The following deployments are deprecated and should not be used. Use the newest deployments from the table above instead. + +| Bridge Module | Chain | Address | +| ------------- | --------- | -------------------------------------------- | +| SynapseBridge | **Blast** | `0x7E7A0e201FD38d3ADAA9523Da6C109a07118C96a` | +| SynapseRFQ | \* | `0x0000000000489d89D2B233D3375C045dfD05745F` | + ### Full bridging workflow ![Bridging Workflow](./puml/BridgingWorkflow.png) From fb8475af0d885973d5f84ffa8a80fc942d046259 Mon Sep 17 00:00:00 2001 From: ChiTimesChi <88190723+ChiTimesChi@users.noreply.github.com> Date: Wed, 31 Jul 2024 15:31:48 +0200 Subject: [PATCH 13/17] docs: strike through deprecated addresses --- packages/sdk-router/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/sdk-router/README.md b/packages/sdk-router/README.md index 213c3e587d..1bfcdd4c99 100644 --- a/packages/sdk-router/README.md +++ b/packages/sdk-router/README.md @@ -61,10 +61,10 @@ The Routers for the same module are deployed to the same address on all chains ( The following deployments are deprecated and should not be used. Use the newest deployments from the table above instead. -| Bridge Module | Chain | Address | -| ------------- | --------- | -------------------------------------------- | -| SynapseBridge | **Blast** | `0x7E7A0e201FD38d3ADAA9523Da6C109a07118C96a` | -| SynapseRFQ | \* | `0x0000000000489d89D2B233D3375C045dfD05745F` | +| Bridge Module | Chain | Address | +| ------------- | --------- | ------------------------------------------------ | +| SynapseBridge | **Blast** | ~~`0x7E7A0e201FD38d3ADAA9523Da6C109a07118C96a`~~ | +| SynapseRFQ | \* | ~~`0x0000000000489d89D2B233D3375C045dfD05745F`~~ | ### Full bridging workflow From d3562f2006adc4d9a7eaa2b0d16785432580c532 Mon Sep 17 00:00:00 2001 From: ChiTimesChi <88190723+ChiTimesChi@users.noreply.github.com> Date: Fri, 2 Aug 2024 11:09:44 +0100 Subject: [PATCH 14/17] feat: use newest address --- packages/sdk-router/README.md | 2 +- packages/sdk-router/src/constants/addresses.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/sdk-router/README.md b/packages/sdk-router/README.md index 1bfcdd4c99..ca5a7c0e52 100644 --- a/packages/sdk-router/README.md +++ b/packages/sdk-router/README.md @@ -55,7 +55,7 @@ The Routers for the same module are deployed to the same address on all chains ( | SynapseBridge | \* | `0x7E7A0e201FD38d3ADAA9523Da6C109a07118C96a` | | SynapseBridge | **Blast** | `0x0000000000365b1d5B142732CF4d33BcddED21Fc` | | SynapseCCTP | \* | `0xd5a597d6e7ddf373a92C8f477DAAA673b0902F48` | -| SynapseRFQ | \* | `0xd50042193Db100FE0040005e00D5010000007e45` | +| SynapseRFQ | \* | `0x00cD000000003f7F682BE4813200893d4e690000` | ### Router Deployments (deprecated) diff --git a/packages/sdk-router/src/constants/addresses.ts b/packages/sdk-router/src/constants/addresses.ts index e8907b2754..503b576b5a 100644 --- a/packages/sdk-router/src/constants/addresses.ts +++ b/packages/sdk-router/src/constants/addresses.ts @@ -57,7 +57,7 @@ export const CCTP_ROUTER_ADDRESS_MAP: AddressMap = generateAddressMap( /** * FastBridgeRouter contract address for all chains except ones from FAST_BRIDGE_ROUTER_EXCEPTION_MAP. */ -const FAST_BRIDGE_ROUTER_ADDRESS = '0xd50042193Db100FE0040005e00D5010000007e45' +const FAST_BRIDGE_ROUTER_ADDRESS = '0x00cD000000003f7F682BE4813200893d4e690000' const FAST_BRIDGE_ROUTER_EXCEPTION_MAP: AddressMap = {} export const FAST_BRIDGE_ROUTER_ADDRESS_MAP: AddressMap = generateAddressMap( RFQ_SUPPORTED_CHAIN_IDS, From 6be5abf9fd79799508542c89b30e5a8cd293568a Mon Sep 17 00:00:00 2001 From: ChiTimesChi <88190723+ChiTimesChi@users.noreply.github.com> Date: Fri, 2 Aug 2024 11:55:00 +0100 Subject: [PATCH 15/17] docs: more explicit language --- packages/sdk-router/src/operations/bridge.ts | 86 ++++++++++---------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/packages/sdk-router/src/operations/bridge.ts b/packages/sdk-router/src/operations/bridge.ts index 93f9fa734f..588c8d03ad 100644 --- a/packages/sdk-router/src/operations/bridge.ts +++ b/packages/sdk-router/src/operations/bridge.ts @@ -12,22 +12,24 @@ import { } from '../module' /** - * Executes a bridge operation between two different chains. Depending on the origin router address, the operation - * will use either a SynapseRouter or a SynapseCCTPRouter. This function creates a populated transaction ready - * to be signed and sent to the origin chain. + * Creates a populated bridge transaction ready for signing and submission to the origin chain. + * The method selects the appropriate router based on the origin router address: + * - `SynapseRouter` is used for SynapseBridge module + * - `SynapseCCTPRouter` is used for SynapseCCTP module + * - `FastBridgeRouter` is used for SynapseRFQ module * - * @param to - The recipient address of the bridged tokens. - * @param originRouterAddress - The address of the origin router. - * @param originChainId - The ID of the origin chain. - * @param destChainId - The ID of the destination chain. - * @param token - The token to bridge. - * @param amount - The amount of token to bridge. - * @param originQuery - The query for the origin chain. - * @param destQuery - The query for the destination chain. + * @param to - Recipient address for the bridged tokens on the destination chain. + * @param originRouterAddress - Address of the router on the origin chain. + * @param originChainId - ID of the origin chain. + * @param destChainId - ID of the destination chain. + * @param token - Address of the token to be bridged. + * @param amount - Amount of tokens to bridge. + * @param originQuery - Query for the origin chain, obtained from `allBridgeQuotes()` or `bridgeQuote()`. + * @param destQuery - Query for the destination chain, obtained from `allBridgeQuotes()` or `bridgeQuote()`. * - * @returns A promise that resolves to a populated transaction object which can be used to send the transaction. + * @returns A Promise resolving to a populated transaction object, ready for sending. * - * @throws Will throw an error if there's an issue with the bridge operation. + * @throws Error if any issues arise during the bridge operation. */ export async function bridge( this: SynapseSDK, @@ -58,10 +60,10 @@ export async function bridge( /** * Options for the bridgeQuote and allBridgeQuotes functions. * - * @param deadline - The transaction deadline, optional. - * @param excludedModules - An array of module names to exclude from the quote, optional. - * @param originUserAddress - The address of the user on the origin chain, optional. This parameter has - * to be specified if a smart contract is going to initiate the bridge operation on behalf of the user. + * @param deadline - Optional transaction deadline on the origin chain. + * @param excludedModules - Optional array of module names to exclude from the quote. + * @param originUserAddress - Optional address of the user on the origin chain. This parameter must be + * specified if a smart contract will initiate the bridge operation on behalf of the user. */ interface BridgeQuoteOptions { deadline?: BigNumber @@ -70,23 +72,22 @@ interface BridgeQuoteOptions { } /** - * This method fetches the best quote from all available bridge modules. Their names are SynapseBridge, SynapseCCTP and SynapseRFQ. - * It is possible to use a custom deadline, exclude a set of modules by providing the list of excluded module names - * and specify the user address on the origin chain. + * Retrieves the best quote from all available bridge modules (SynapseBridge, SynapseCCTP, and SynapseRFQ). + * Users can customize the query by specifying a deadline, excluding certain modules, and providing the user's address on the origin chain. * - * Note: originUserAddress MUST BE provided, if a smart contract is going to initiate the bridge operation on behalf of the user. - * That includes smart wallets (like Safe), or a third party integration (like a bridge aggregator smart contract). + * Important: The originUserAddress MUST be provided if a smart contract will initiate the bridge operation on the user's behalf. + * This applies to smart wallets (e.g., Safe) and third-party integrations (such as bridge aggregator smart contracts). * - * @param originChainId - The ID of the original chain. - * @param destChainId - The ID of the destination chain. - * @param tokenIn - The input token. - * @param tokenOut - The output token. - * @param amountIn - The amount of input token. - * @param options - Optional parameters including deadline, excludedModules, and originUserAddress. + * @param originChainId - ID of the origin chain. + * @param destChainId - ID of the destination chain. + * @param tokenIn - Address of the token to be bridged from the origin chain. + * @param tokenOut - Address of the token to be received on the destination chain. + * @param amountIn - Amount of input tokens on the origin chain. + * @param options - Optional parameters including origin deadline, excludedModules, and originUserAddress. * - * @returns A promise that resolves to the best bridge quote. + * @returns A promise resolving to the best available bridge quote. * - * @throws Will throw an error if no route is found. + * @throws An error if no bridge route is found. */ export async function bridgeQuote( this: SynapseSDK, @@ -115,22 +116,21 @@ export async function bridgeQuote( } /** - * This method tries to fetch all available quotes from all available bridge modules. Their names are SynapseBridge, SynapseCCTP and SynapseRFQ. - * It is possible to use a custom deadline, exclude a set of modules by providing the list of excluded module names - * and specify the user address on the origin chain. + * Fetches all available quotes from the supported bridge modules (SynapseBridge, SynapseCCTP, and SynapseRFQ). + * Users can customize the query by specifying a deadline, excluding certain modules, and providing the user's address on the origin chain. * - * Note: originUserAddress MUST BE provided, if a smart contract is going to initiate the bridge operation on behalf of the user. - * That includes smart wallets (like Safe), or a third party integration (like a bridge aggregator smart contract). + * Important: The originUserAddress MUST be provided if a smart contract will initiate the bridge operation on the user's behalf. + * This applies to smart wallets (e.g., Safe) and third-party integrations (such as bridge aggregator smart contracts). * - * @param originChainId - The ID of the original chain. - * @param destChainId - The ID of the destination chain. - * @param tokenIn - The input token. - * @param tokenOut - The output token. - * @param amountIn - The amount of input token. - * @param options - Optional parameters including deadline, excludedModules, and originUserAddress. + * @param originChainId - ID of the origin chain. + * @param destChainId - ID of the destination chain. + * @param tokenIn - Address of the token to be bridged from the origin chain. + * @param tokenOut - Address of the token to be received on the destination chain. + * @param amountIn - Amount of input tokens on the origin chain. + * @param options - Optional parameters including origin deadline, excludedModules, and originUserAddress. * - * @returns - A promise that resolves to an array of bridge quotes. - * The returned array is sorted by maxAmountOut in descending order, all quotes have non-zero amountOut. + * @returns A promise that resolves to an array of bridge quotes. + * The returned array is sorted by maxAmountOut in descending order, with all quotes having a non-zero amountOut. */ export async function allBridgeQuotes( this: SynapseSDK, From d458ac13676fb681660ade31d2176b48ecb5b74e Mon Sep 17 00:00:00 2001 From: ChiTimesChi <88190723+ChiTimesChi@users.noreply.github.com> Date: Fri, 2 Aug 2024 12:16:45 +0100 Subject: [PATCH 16/17] docs: be more explicit in README as well --- packages/sdk-router/README.md | 43 +++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/packages/sdk-router/README.md b/packages/sdk-router/README.md index ca5a7c0e52..c3672c585b 100644 --- a/packages/sdk-router/README.md +++ b/packages/sdk-router/README.md @@ -48,23 +48,25 @@ const synapseSDK = new SynapseSDK(chainIds, providers) ### Router Deployments -The Routers for the same module are deployed to the same address on all chains (except for the exceptions below). +The Routers for each module are deployed to consistent addresses across all chains, with a few exceptions noted below. -| Bridge Module | Chain | Address | -| ------------- | --------- | -------------------------------------------- | -| SynapseBridge | \* | `0x7E7A0e201FD38d3ADAA9523Da6C109a07118C96a` | -| SynapseBridge | **Blast** | `0x0000000000365b1d5B142732CF4d33BcddED21Fc` | -| SynapseCCTP | \* | `0xd5a597d6e7ddf373a92C8f477DAAA673b0902F48` | -| SynapseRFQ | \* | `0x00cD000000003f7F682BE4813200893d4e690000` | +| Bridge Module | Chain | Address | +| ------------- | ------- | -------------------------------------------- | +| SynapseBridge | All[^1] | `0x7E7A0e201FD38d3ADAA9523Da6C109a07118C96a` | +| SynapseBridge | Blast | `0x0000000000365b1d5B142732CF4d33BcddED21Fc` | +| SynapseCCTP | All | `0xd5a597d6e7ddf373a92C8f477DAAA673b0902F48` | +| SynapseRFQ | All | `0x00cD000000003f7F682BE4813200893d4e690000` | -### Router Deployments (deprecated) +[^1]: Except Blast -The following deployments are deprecated and should not be used. Use the newest deployments from the table above instead. +### Deprecated Router Deployments -| Bridge Module | Chain | Address | -| ------------- | --------- | ------------------------------------------------ | -| SynapseBridge | **Blast** | ~~`0x7E7A0e201FD38d3ADAA9523Da6C109a07118C96a`~~ | -| SynapseRFQ | \* | ~~`0x0000000000489d89D2B233D3375C045dfD05745F`~~ | +The following deployments are no longer in use and should be avoided. Please refer to the latest deployments in the table above. + +| Bridge Module | Chain | Address | +| ------------- | ----- | ------------------------------------------------ | +| SynapseBridge | Blast | ~~`0x7E7A0e201FD38d3ADAA9523Da6C109a07118C96a`~~ | +| SynapseRFQ | All | ~~`0x0000000000489d89D2B233D3375C045dfD05745F`~~ | ### Full bridging workflow @@ -110,14 +112,15 @@ const bridgeQuotes: BridgeQuote[] = await synapseSDK.allBridgeQuotes( ) ``` -> **Note:** The `originUserAddress` MUST BE provided, if a smart contract is going to initiate the bridge operation on behalf of the user. That includes smart wallets (like Safe), or a third party integration (like a bridge aggregator smart contract). - -The returned list is sorted by the `maxAmountOut` field, so the first quote is the one yielding the highest amount of tokens on the destination chain. - -If either of the input/output tokens is a native gas token (e.g. ETH on Ethereum/Arbitrum, AVAX on Avalanche, etc.), the specialized address `0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE` should be used instead of the token address. +- **Important:** It is crucial to provide the `originUserAddress` when a smart contract will initiate the bridge operation on behalf of the user. This requirement applies to smart wallets (e.g., Safe) and third-party integrations (such as bridge aggregator smart contracts). +- For native gas tokens (e.g., ETH on Ethereum/Arbitrum, AVAX on Avalanche, etc.), use the specialized address `0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE` instead of the token address for either input or output tokens. +- The returned list is sorted by the `maxAmountOut` field in descending order, with the first quote offering the highest amount of tokens on the destination chain. +- All quotes in the list are provided without any slippage applied. To add slippage to the quotes, use the `applyBridgeSlippage` function. +- All quotes in the list include the provided origin deadline. If no deadline is specified, the default module's deadline is used. To modify the deadline for the quotes, use the `applyBridgeDeadline` function. +- All quotes in the list include the default destination deadline. -> **Note:** The `bridgeQuote` method is a wrapper around the `allBridgeQuotes` method. -> `bridgeQuote` returns only the first quote from the list, while `allBridgeQuotes` returns the entire list. +> **Note:** The `bridgeQuote` method serves as a wrapper for the `allBridgeQuotes` method. +> While `bridgeQuote` returns only the first (best) quote from the list, `allBridgeQuotes` provides the complete list of quotes. ### `BridgeQuote` object From 1813785dedee0b74265614df8cb9ae17cbb8ed7f Mon Sep 17 00:00:00 2001 From: ChiTimesChi <88190723+ChiTimesChi@users.noreply.github.com> Date: Mon, 5 Aug 2024 15:22:03 +0100 Subject: [PATCH 17/17] fix: update docs link, slippage wording --- packages/sdk-router/README.md | 4 ++-- packages/sdk-router/src/operations/bridge.ts | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/sdk-router/README.md b/packages/sdk-router/README.md index c3672c585b..8e3c30bfe4 100644 --- a/packages/sdk-router/README.md +++ b/packages/sdk-router/README.md @@ -4,7 +4,7 @@ This package contains the Synapse Protocol Cross-Chain Swap and Bridging SDK -[See the Docs](https://synapserouter.gitbook.io/bridge-sdk-2) +[See the Docs](https://synapse-3.gitbook.io/synapse-protocol/developers/bridge-sdk) # Synapse SDK @@ -115,7 +115,7 @@ const bridgeQuotes: BridgeQuote[] = await synapseSDK.allBridgeQuotes( - **Important:** It is crucial to provide the `originUserAddress` when a smart contract will initiate the bridge operation on behalf of the user. This requirement applies to smart wallets (e.g., Safe) and third-party integrations (such as bridge aggregator smart contracts). - For native gas tokens (e.g., ETH on Ethereum/Arbitrum, AVAX on Avalanche, etc.), use the specialized address `0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE` instead of the token address for either input or output tokens. - The returned list is sorted by the `maxAmountOut` field in descending order, with the first quote offering the highest amount of tokens on the destination chain. -- All quotes in the list are provided without any slippage applied. To add slippage to the quotes, use the `applyBridgeSlippage` function. +- All quotes in the list are provided without any slippage settings applied. To add slippage to the quotes, use the `applyBridgeSlippage` function. - All quotes in the list include the provided origin deadline. If no deadline is specified, the default module's deadline is used. To modify the deadline for the quotes, use the `applyBridgeDeadline` function. - All quotes in the list include the default destination deadline. diff --git a/packages/sdk-router/src/operations/bridge.ts b/packages/sdk-router/src/operations/bridge.ts index 588c8d03ad..1ce6c6fcca 100644 --- a/packages/sdk-router/src/operations/bridge.ts +++ b/packages/sdk-router/src/operations/bridge.ts @@ -78,6 +78,10 @@ interface BridgeQuoteOptions { * Important: The originUserAddress MUST be provided if a smart contract will initiate the bridge operation on the user's behalf. * This applies to smart wallets (e.g., Safe) and third-party integrations (such as bridge aggregator smart contracts). * + * The returned quote will not have any slippage settings applied. To add slippage to the quote, use the `applyBridgeSlippage` function. + * The returned quote will use the origin chain deadline provided in the options. If no deadline is provided, the module's default origin deadline is used. + * The returned quote will use the module's default destination deadline. + * * @param originChainId - ID of the origin chain. * @param destChainId - ID of the destination chain. * @param tokenIn - Address of the token to be bridged from the origin chain. @@ -122,6 +126,10 @@ export async function bridgeQuote( * Important: The originUserAddress MUST be provided if a smart contract will initiate the bridge operation on the user's behalf. * This applies to smart wallets (e.g., Safe) and third-party integrations (such as bridge aggregator smart contracts). * + * The returned quotes will not have any slippage settings applied. To add slippage to the quotes, use the `applyBridgeSlippage` function. + * The returned quotes will use the origin chain deadline provided in the options. If no deadline is provided, the module's default origin deadline is used. + * The returned quotes will use the module's default destination deadline. + * * @param originChainId - ID of the origin chain. * @param destChainId - ID of the destination chain. * @param tokenIn - Address of the token to be bridged from the origin chain.