-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docs/lk exploration [SLT-170] #3141
Changes from 42 commits
244e77f
eebb57c
1218b20
32a85ac
8a6eb0d
866ebaa
b9f11b6
6cb652a
81ea30d
2330146
22855ca
e3a65c5
cb1118d
ab4a354
186f0a9
68ec346
56bd9c6
fe24140
9eea390
3d12d5a
ef6e18a
b03684b
32ac668
a18c6b6
8a66ffd
4c09296
4ebe307
d07bf03
ecb3221
1f2553a
42629e9
e7b0e70
8eca8ec
dae67c1
a4674eb
33d8f99
00d103b
3b0da49
ceb8923
2993189
e23965e
9d159ba
d7b693c
bc0bf4c
9e9b993
b3b7082
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
title: Synapse DAO | ||
--- | ||
|
||
# Synapse DAO | ||
|
||
Since launch of the Synapse Protocol, a number of governance initiatives have been put forward and voted on by the Synapse DAO. | ||
|
||
## Governance Model | ||
|
||
SYN holders with more than 100,000 SYN tokens can put forward proposals to be voted on by the DAO. SYN holders can vote using SYN on multiple chains, or delegate their votes to other token holders. | ||
|
||
In order to be adopted by the DAO, a proposal must gather at least `50% + 1` of all votes and reach the minimum quorum of 5 million SYN tokens. | ||
|
||
## Governance Components | ||
|
||
* **[Forum](https://forum.synapseprotocol.com/)**: A Platform to post proposals for discussion before an official vote | ||
* **[Snapshot](https://snapshot.org/#/synapseprotocol.eth)**: A decentralized governance platform for conducting official votes. | ||
* **[Discord](https://discord.gg/synapseprotocol)**: Discussion channel for general Synapse matters |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Brand Assets | ||
|
||
### [synapse-brand-assets.zip](/brand-assets/synapse-brand-assets.zip) | ||
|
||
## Logo | ||
|
||
| Name | Image | | ||
|----------------------------------------------------------------------|- | ||
| [`synapse-logo-onLight.svg`](/brand-assets/synapse-logo-onLight.svg) | ![Synapse logo](/brand-assets/synapse-logo-onLight.svg) | ||
| [`synapse-logo-onDark.svg`](/brand-assets/synapse-logo-onDark.svg) | ![Synapse logo](/brand-assets/synapse-logo-onDark.svg) | ||
| [`synapse-logo-black.svg`](/brand-assets/synapse-logo-black.svg) | ![Synapse logo](/brand-assets/synapse-logo-black.svg) | ||
| [`synapse-logo-white.svg`](/brand-assets/synapse-logo-white.svg) | ![Synapse logo](/brand-assets/synapse-logo-white.svg) | ||
|
||
## Mark | ||
|
||
| Name | Image | | ||
|--------------------------------------------------------------------|- | ||
| [`synapse-mark.svg`](/brand-assets/synapse-mark.svg) | ![Synapse logo](/brand-assets/synapse-mark.svg) | ||
| [`synapse-mark-white.svg`](/brand-assets/synapse-mark-white.svg) | ![Synapse logo](/brand-assets/synapse-mark-white.svg) | ||
| [`synapse-mark-black.svg`](/brand-assets/synapse-mark-black.svg) | ![Synapse logo](/brand-assets/synapse-mark-black.svg) | ||
| [`synapse-border-mark.svg`](/brand-assets/synapse-border-mark.svg) | ![Synapse logo](/brand-assets/synapse-border-mark.svg) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import Routes from '@site/src/components/Routes' | ||
|
||
# Chains & Tokens | ||
|
||
This page contains a list of supported tokens, listed per-chain. For a given pair, use the [Synapse Bridge](https://synapseprotocol.com) to see if a route between them exists. | ||
|
||
<Routes /> |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,75 @@ | ||||||||||||||||||||||||||||||
--- | ||||||||||||||||||||||||||||||
title: About | ||||||||||||||||||||||||||||||
--- | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
import AnimatedLogo from '@site/src/components/AnimatedLogo' | ||||||||||||||||||||||||||||||
import SVGBridge from '@site/src/components/SVGBridge' | ||||||||||||||||||||||||||||||
import { BridgeFlow } from '@site/src/components/BridgeFlow' | ||||||||||||||||||||||||||||||
import { CCTPFlow } from '@site/src/components/CCTPFlow' | ||||||||||||||||||||||||||||||
import { RFQFlow } from '@site/src/components/RFQFlow' | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
<AnimatedLogo /> | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
# Use Synapse | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
Synapse is an Interchain Programming Interface. Developers read and write interchain data with Synapse, which has settled $50B in transactions between 2M+ users, and generated $30M+ in fees. | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
Source: [Synapse Explorer analytics](https://explorer.synapseprotocol.com). | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
## Interchain Bridge | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
<figure> | ||||||||||||||||||||||||||||||
<SVGBridge /> | ||||||||||||||||||||||||||||||
<figcaption>Synapse Bridge</figcaption> | ||||||||||||||||||||||||||||||
</figure> | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
* [Overview](/docs/Bridge) | ||||||||||||||||||||||||||||||
* [Bridge guide](/docs/Bridge#how-to-bridge) | ||||||||||||||||||||||||||||||
<!-- * [Supported routes](/docs/Bridge#how-to-bridge) --> | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
## Developers | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
Embed or build a custom Bridge application. | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
* **[SDK](/docs/Bridge/SDK)** – Call Synapse Router functions from your frontend or backend application. | ||||||||||||||||||||||||||||||
* **[REST API](/docs/Bridge/REST-API)** – Endpoints and example code | ||||||||||||||||||||||||||||||
* **[Widget](/docs/Bridge/Widget)** – Embed a customized Synapse Bridge in your application. | ||||||||||||||||||||||||||||||
Comment on lines
+30
to
+36
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Comprehensive developer resources with clear descriptions. The section provides essential links and descriptions for developers to integrate Synapse into their applications, aligning well with the documentation improvement objectives. Update the REST API link to point to the Swagger documentation as mentioned in the PR comments: -* **[REST API](/docs/Bridge/REST-API)** – Endpoints and example code
+* **[REST API](https://api.synapseprotocol.com/api-docs)** – Comprehensive API documentation (Swagger) 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
## Synapse Routers | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
Synapse Router automatically determines the appropriate router for each Bridge transaction. | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
* **[Synapse Router](/docs/Routers/Synapse-Router)** – Returns and executes quotes for supported interchain transactions. | ||||||||||||||||||||||||||||||
* **[CCTP](/docs/Routers/CCTP)** – Native router for USDC transactions. | ||||||||||||||||||||||||||||||
* **[RFQ](/docs/Routers/RFQ)** – Relayers bid for the right to provide immediate delivery. | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
<figure id="flowGroup"> | ||||||||||||||||||||||||||||||
<figure> | ||||||||||||||||||||||||||||||
<BridgeFlow /> | ||||||||||||||||||||||||||||||
<figcaption>Synapse Router – Mint and burn any token between chains</figcaption> | ||||||||||||||||||||||||||||||
</figure> | ||||||||||||||||||||||||||||||
<figure> | ||||||||||||||||||||||||||||||
<CCTPFlow /> | ||||||||||||||||||||||||||||||
<figcaption>CCTP – Use Circle contracts to mint and burn native USDC</figcaption> | ||||||||||||||||||||||||||||||
</figure> | ||||||||||||||||||||||||||||||
<figure> | ||||||||||||||||||||||||||||||
<RFQFlow /> | ||||||||||||||||||||||||||||||
<figcaption>RFQ – Take Immediate delivery from a destination relayer, who receives your origin chain assets on confirmation.</figcaption> | ||||||||||||||||||||||||||||||
</figure> | ||||||||||||||||||||||||||||||
</figure> | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
## Community & Support | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
Connect with other developers and the Synapse team | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
* **[Discord](https://discord.gg/synapseprotocol)** | ||||||||||||||||||||||||||||||
* **[Twitter](https://twitter.com/SynapseProtocol)** | ||||||||||||||||||||||||||||||
* **[Telegram](https://t.me/synapseprotocol)** | ||||||||||||||||||||||||||||||
* **[Forum](https://forum.synapseprotocol.com/)** | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
## Additional Links | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
Synapse transactions can be observed confirmed via the following methods: | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
* **[Synapse Bridge](https://synapseprotocol.com)** – Bridge, Swap, and Stake via Synapse's cross-chain pools. | ||||||||||||||||||||||||||||||
* **[Synapse Explorer](https://explorer.synapseprotocol.com)** – Public explorer for Synapse Bridge transactions. |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,222 @@ | ||||||||||||||||||||||||||||||||||||||||||
--- | ||||||||||||||||||||||||||||||||||||||||||
title: Bridge SDK | ||||||||||||||||||||||||||||||||||||||||||
--- | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
# Bridge SDK | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
The Synapse Bridge SDK is the easiest way to integrate cross-chain token & liquidity transfers into your application. It is fully isomorphic and can be used on both client and server sides. | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
The Synapse Bridge SDK is built on top of the [Synapse Router](/docs/Routers/Synapse-Router) contract. | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
### Use cases | ||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adjust heading level for consistency The heading "Use cases" is currently an h3 (###) but should be an h2 (##) to maintain proper document structure. This ensures a logical hierarchy of headings throughout the document. 🧰 Tools🪛 Markdownlint
|
||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
* Integrate your front-end application with the Synapse Bridge. | ||||||||||||||||||||||||||||||||||||||||||
* Provide bridge liquidity. | ||||||||||||||||||||||||||||||||||||||||||
* Perform cross-chain arbitrage. | ||||||||||||||||||||||||||||||||||||||||||
* Integrate the Synapse Javascript SDK with your non-Javascript application. | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
## Install | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
:::note requires Node v16+ | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
The SDK has only been fully tested on Node 16+ or greater. Earlier versions are not guaranteed to work. | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
::: | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
Requires either the `npx` or `yarn` package manager. | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
| Options | ||||||||||||||||||||||||||||||||||||||||||
|- | ||||||||||||||||||||||||||||||||||||||||||
| `npx install @synapsecns/sdk-router` | ||||||||||||||||||||||||||||||||||||||||||
| `yarn install @synapsecns/sdk-router` | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
## Configure Ethers | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
The SDK package relies on the `@ethersproject` and `ethers` dependencies, installed from `npm`. | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
To begin constructing bridge-related transactions, first set up your environment wiht your providers, and format them, along with the `chainIds` you will be using, to set up a `SynapseSDK` instance. | ||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix typo in configuration instructions There's a minor typo in the sentence. Change "wiht" to "with": -To begin constructing bridge-related transactions, first set up your environment wiht your providers, and format them, along with the `chainIds` you will be using, to set up a `SynapseSDK` instance.
+To begin constructing bridge-related transactions, first set up your environment with your providers, and format them, along with the `chainIds` you will be using, to set up a `SynapseSDK` instance. 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
#### Ethers v5 | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
```js | ||||||||||||||||||||||||||||||||||||||||||
//Set up providers (RPCs) for each chain desired | ||||||||||||||||||||||||||||||||||||||||||
const arbitrumProvider: Provider = new ethers.providers.JsonRpcProvider( | ||||||||||||||||||||||||||||||||||||||||||
'https://arb1.arbitrum.io/rpc' | ||||||||||||||||||||||||||||||||||||||||||
) | ||||||||||||||||||||||||||||||||||||||||||
const avalancheProvider: Provider = new ethers.providers.JsonRpcProvider( | ||||||||||||||||||||||||||||||||||||||||||
'https://api.avax.network/ext/bc/C/rpc' | ||||||||||||||||||||||||||||||||||||||||||
) | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
//Structure arguments properly | ||||||||||||||||||||||||||||||||||||||||||
const chainIds = [42161, 43114] | ||||||||||||||||||||||||||||||||||||||||||
const providers = [arbitrumProvider, avalancheProvider] | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
//Set up a SynapseSDK instance | ||||||||||||||||||||||||||||||||||||||||||
const Synapse = new SynapseSDK(chainIds, providers) | ||||||||||||||||||||||||||||||||||||||||||
``` | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
#### Ethers v6 | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
:::tip Ethers v6 | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
Use of Ethers v6 requires the `@ethersproject/providers` dependency to be installed via `npm` or `yarn`: | ||||||||||||||||||||||||||||||||||||||||||
* `npm install @ethersproject/providers@^5.7.2` | ||||||||||||||||||||||||||||||||||||||||||
* `yarn add @ethersproject/providers@^5.7.2` | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
::: | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
```js | ||||||||||||||||||||||||||||||||||||||||||
import { JsonRpcProvider } from '@ethersproject/providers' | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
//Set up providers (RPCs) for each chain desired | ||||||||||||||||||||||||||||||||||||||||||
const arbitrumProvider: Provider = new JsonRpcProvider( | ||||||||||||||||||||||||||||||||||||||||||
'https://arb1.arbitrum.io/rpc' | ||||||||||||||||||||||||||||||||||||||||||
) | ||||||||||||||||||||||||||||||||||||||||||
const avalancheProvider: Provider = new JsonRpcProvider( | ||||||||||||||||||||||||||||||||||||||||||
'https://api.avax.network/ext/bc/C/rpc' | ||||||||||||||||||||||||||||||||||||||||||
) | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
//Structure arguments properly | ||||||||||||||||||||||||||||||||||||||||||
const chainIds = [42161, 43114] | ||||||||||||||||||||||||||||||||||||||||||
const providers = [arbitrumProvider, avalancheProvider] | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
//Set up a SynapseSDK instance | ||||||||||||||||||||||||||||||||||||||||||
const Synapse = new SynapseSDK(chainIds, providers) | ||||||||||||||||||||||||||||||||||||||||||
``` | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
## Functions | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
:::tip Query Data Type | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
`originQuery` and `destQuery`, returned by `bridgeQuote()` and required for `bridge()`, are [`Query`](https://synapserouter.gitbook.io/untitled/) objects, which contain: | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
* `swapAdapter`: (string): 0x address of the swap adapter. | ||||||||||||||||||||||||||||||||||||||||||
* `tokenOut`: (string): 0x address of the outputted token on that chain. | ||||||||||||||||||||||||||||||||||||||||||
* `minAmountOut`: (Ethers BigNumber): The min amount of value exiting the transaction. | ||||||||||||||||||||||||||||||||||||||||||
* `deadline`: (Ethers BigNumber): The deadline for the potential transaction. | ||||||||||||||||||||||||||||||||||||||||||
* `rawParams`: (string): 0x params for the potential transaction. | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
::: | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
### `bridgeQuote()` | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
Get all relevant information regarding a possible transaction. | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
#### Parameters | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
`bridgeQuote()` requires the following arguments: | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
* `fromChain` (number): Origin chain id. | ||||||||||||||||||||||||||||||||||||||||||
* `toChain` (number): Destination chain id. | ||||||||||||||||||||||||||||||||||||||||||
* `fromToken` (string): 0x token address on the origin chain. | ||||||||||||||||||||||||||||||||||||||||||
* `toToken` (string): 0x token address on the destination chain. | ||||||||||||||||||||||||||||||||||||||||||
* `amount` (Ethers BigNumber): The amount (with the correct amount of decimals specified by the token on the origin chain) | ||||||||||||||||||||||||||||||||||||||||||
* `object` (three seperate args): | ||||||||||||||||||||||||||||||||||||||||||
* `deadline` (Ethers BigNumber): Deadline for the transaction to be initiated on the origin chain, in seconds (optional) | ||||||||||||||||||||||||||||||||||||||||||
* `originUserAddress` (string): Address of the user on the origin chain, optional, mandatory if a smart contract is going to initiate the bridge operation | ||||||||||||||||||||||||||||||||||||||||||
* `excludedModules` (array): (optional) List of bridge modules to exclude from the result | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
#### Return value | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
`bridgeQuote` returns the following information | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
* `feeAmount` (Ethers BigNumber): The calculated amount of fee to be taken. | ||||||||||||||||||||||||||||||||||||||||||
* `bridgeFee` (number): The percentage of fee to be taken. | ||||||||||||||||||||||||||||||||||||||||||
* `maxAmountOut` (Ethers BigNumber): The maximum output amount resulting from the bridge transaction. | ||||||||||||||||||||||||||||||||||||||||||
* `originQuery` (`Query`): The query to be executed on the origin chain. | ||||||||||||||||||||||||||||||||||||||||||
* `destQuery` (`Query`): The query to be executed on the destination chain. | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
### `bridge()` | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
Use `bridgeQuote` to request a Bridge transaction | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
#### Parameters | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
* `toAddress` (number): The 0x wallet address on the destination chain. | ||||||||||||||||||||||||||||||||||||||||||
* `routerAddress` (string): The 0x contract address on the origin chain of the bridge router contract. | ||||||||||||||||||||||||||||||||||||||||||
* `fromChain` (number): The origin chain id. | ||||||||||||||||||||||||||||||||||||||||||
* `toChain` (number): The destination chain id. | ||||||||||||||||||||||||||||||||||||||||||
* `fromToken` (string): The 0x token address on the origin chain. | ||||||||||||||||||||||||||||||||||||||||||
* `amount` (Ethers BigNumber): The amount (with the correct amount of decimals specified by the token on the origin chain) | ||||||||||||||||||||||||||||||||||||||||||
* `originQuery` (`Query`): The query to be executed on the origin chain. | ||||||||||||||||||||||||||||||||||||||||||
* `destQuery` (`Query`): The query to be executed on the destination chain. | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
#### Return value | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
* `to` (string): 0x wallet address on the destination chain. | ||||||||||||||||||||||||||||||||||||||||||
* `data` (string): Output data in 0x hex format | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
### `allBridgeQuotes()` | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
#### Return value | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
Returns an array all possible bridge quotes, with the first item in the array being the cheapest route. | ||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix grammatical issue in allBridgeQuotes() description There's a minor grammatical error in the sentence. Add the word "of" after "array": -Returns an array all possible bridge quotes, with the first item in the array being the cheapest route.
+Returns an array of all possible bridge quotes, with the first item in the array being the cheapest route. 📝 Committable suggestion
Suggested change
🧰 Tools🪛 LanguageTool
|
||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
Quotes are returned from various Bridge "types" such as [CCTP](/docs/Routers/CCTP) or [RFQ](/docs/Routers/RFQ). More information is available on the [Synapse Router](/docs/Routers/Synapse-Router) page, or [SynapseCNS](https://github.com/synapsecns/sdk-router) Github repository. | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
## Examples | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
### Get a quote | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
```js | ||||||||||||||||||||||||||||||||||||||||||
const quotes = await Synapse.bridgeQuote( | ||||||||||||||||||||||||||||||||||||||||||
routerAddress | ||||||||||||||||||||||||||||||||||||||||||
42161, // Origin Chain | ||||||||||||||||||||||||||||||||||||||||||
43114, // Destination Chain | ||||||||||||||||||||||||||||||||||||||||||
'0xff970a61a04b1ca14834a43f5de4533ebddb5cc8', // Origin Token Address | ||||||||||||||||||||||||||||||||||||||||||
'0xa7d7079b0fead91f3e65f86e8915cb59c1a4c664', // Destination Token Address | ||||||||||||||||||||||||||||||||||||||||||
BigNumber.from('20000000') // Amount in | ||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||
// 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 a smart contract is going to initiate the bridge operation on behalf of the user. | ||||||||||||||||||||||||||||||||||||||||||
originUserAddress: '0x1234567890abcdef1234567890abcdef12345678', | ||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||
) | ||||||||||||||||||||||||||||||||||||||||||
``` | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
### Request a transaction | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
```js | ||||||||||||||||||||||||||||||||||||||||||
await Synapse.bridge( | ||||||||||||||||||||||||||||||||||||||||||
'0x0AF91FA049A7e1894F480bFE5bBa20142C6c29a9', // To Address | ||||||||||||||||||||||||||||||||||||||||||
bridgeQuote.routerAddress, // address of the contract to route the txn | ||||||||||||||||||||||||||||||||||||||||||
42161, // Origin Chain | ||||||||||||||||||||||||||||||||||||||||||
43114, // Destination Chain | ||||||||||||||||||||||||||||||||||||||||||
'0xff970a61a04b1ca14834a43f5de4533ebddb5cc8', // Origin Token Address | ||||||||||||||||||||||||||||||||||||||||||
BigNumber.from('20000000'), // Amount | ||||||||||||||||||||||||||||||||||||||||||
quote.originQuery, // Origin query from bridgeQuote() | ||||||||||||||||||||||||||||||||||||||||||
quote.destQuery // Destination query from bridgeQuote() | ||||||||||||||||||||||||||||||||||||||||||
) | ||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+185
to
+194
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct indentation in bridge() example The indentation in the bridge() example is inconsistent. Please adjust the indentation to use spaces consistently: await Synapse.bridge(
- '0x0AF91FA049A7e1894F480bFE5bBa20142C6c29a9', // To Address
- bridgeQuote.routerAddress, // address of the contract to route the txn
- 42161, // Origin Chain
- 43114, // Destination Chain
- '0xff970a61a04b1ca14834a43f5de4533ebddb5cc8', // Origin Token Address
- BigNumber.from('20000000'), // Amount
- quote.originQuery, // Origin query from bridgeQuote()
- quote.destQuery // Destination query from bridgeQuote()
+ '0x0AF91FA049A7e1894F480bFE5bBa20142C6c29a9', // To Address
+ bridgeQuote.routerAddress, // address of the contract to route the txn
+ 42161, // Origin Chain
+ 43114, // Destination Chain
+ '0xff970a61a04b1ca14834a43f5de4533ebddb5cc8', // Origin Token Address
+ BigNumber.from('20000000'), // Amount
+ quote.originQuery, // Origin query from bridgeQuote()
+ quote.destQuery // Destination query from bridgeQuote()
) This change ensures consistent indentation throughout the example, improving readability. 📝 Committable suggestion
Suggested change
🧰 Tools🪛 Markdownlint
|
||||||||||||||||||||||||||||||||||||||||||
``` | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
## Version 0.10.0 breaking changes | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
### Options object | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
* `deadline`, `excludeCCTP` (now `excludedModules`), and `originUserAddress` parameters are now found in an (optional) options object at the end of the arguments list for `bridgeQuote()`, and `allBridgeQuotes()`. | ||||||||||||||||||||||||||||||||||||||||||
* `excludedModules` excludes one or more modules with an array of the module names. Supported names are `SynapseBridge`, `SynapseCCTP`, and `SynapseRFQ`. | ||||||||||||||||||||||||||||||||||||||||||
* `originUserAddress` is required as part of the options object to initiate a bridge transaction on behalf of a user. | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
### Examples | ||||||||||||||||||||||||||||||||||||||||||
```js | ||||||||||||||||||||||||||||||||||||||||||
bridgeQuote(...arguments, { | ||||||||||||||||||||||||||||||||||||||||||
deadline: 1234567890, | ||||||||||||||||||||||||||||||||||||||||||
excludedModules: ["SynapseCCTP"], | ||||||||||||||||||||||||||||||||||||||||||
originUserAddress: "0x1234...", | ||||||||||||||||||||||||||||||||||||||||||
}) | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
allBridgeQuotes({ | ||||||||||||||||||||||||||||||||||||||||||
deadline: 1234567890, | ||||||||||||||||||||||||||||||||||||||||||
excludedModules: ["SynapseCCTP"], | ||||||||||||||||||||||||||||||||||||||||||
originUserAddress: "0x1234...", | ||||||||||||||||||||||||||||||||||||||||||
}) | ||||||||||||||||||||||||||||||||||||||||||
``` | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
### `FastBridgeRouter` | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
The previous `FastBridgeRouter` deployment is deprecated, if your integration is using the hardcoded address, please see the router deployments/deprecated deployments table [here](https://github.com/synapsecns/sanguine/tree/master/packages/sdk-router#router-deployments) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adjust heading level for consistency
The file structure looks good, but there's a minor issue with the heading levels. The download link is currently an h3, which doesn't follow the logical hierarchy.
Consider changing the heading level for the download link. Here's a suggested fix:
This change maintains a logical heading structure and provides a clear call-to-action for users who want to download all assets at once.
📝 Committable suggestion
🧰 Tools
🪛 Markdownlint