Skip to content
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

Automated spellchecking with cspell [SLT-408] #3350

Merged
merged 7 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ jobs:
- name: Run tests # Run tests of all packages
run: npx lerna exec npm run ci:lint --parallel

- name: Run spellcheck # Run spellcheck of all packages
run: npx lerna exec npm run ci:spellcheck --parallel -- --if-present

test:
runs-on: ubuntu-latest
env:
Expand Down Expand Up @@ -109,4 +112,4 @@ jobs:
run: npx lerna exec npm run build --parallel || true # only for codecov
env:
CODECOV_TOKEN: ${{ secrets.CODECOV }}
GH_COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
GH_COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
150 changes: 150 additions & 0 deletions cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
{
"version": "0.2",
"language": "en",
"words": [
"GÖRLI",
"aall",
"anonymization",
"arbitrability",
"artifacthub",
"atrue",
"auxilliary",
"avweth",
"basescan",
"bcbd",
"blastscan",
"bridgable",
"bridgeable",
"bridgesyn",
"bscscan",
"bvalue",
"capa",
"cctp",
"chainid",
"chainprice",
"circlecctp",
"coinbasewallet",
"commify",
"crono",
"cronos",
"cyberattack",
"defillama",
"dencun",
"depeg",
"dogechain",
"ellipsize",
"ethergo",
"ethersproject",
"ethtx",
"extralight",
"ftmscan",
"getids",
"gitbook",
"gorm",
"headlessui",
"incentivized",
"interchain",
"ipfs",
"ipns",
"klaytn",
"libp",
"lifi",
"linea",
"livefill",
"livefill",
"livefiller",
"livefilling",
"loadtest",
"logrocket",
"melrose",
"metisusdc",
"monke",
"moonriver",
"multichain",
"nodereal",
"noncestatus",
"npdhrc",
"nums",
"ofac",
"omnirpc",
"opaciyt",
"permissionlessly",
"persistor",
"popperjs",
"pyroscope",
"rainbowkit",
"rebalance",
"rebalancer",
"rebalancing",
"returntomonke",
"scrollscan",
"secg",
"signerconfig",
"signoz",
"snowscan",
"solana",
"stablecoins",
"stableswap",
"stakable",
"swapable",
"swapabletype",
"synape",
"synapsecns",
"synapseprotocol",
"synpfpborder",
"traderjoe",
"tsdx",
"tvls",
"txdb",
"txns",
"unbonded",
"unincentivized",
"unstake",
"unstaked",
"unstaking",
"upserted",
"viem",
"wagmi",
"wethe",
"worldchain",
"xngmi",
"xstep"
],
"dictionaries": [
"en_US",
"cryptocurrencies",
"golang",
"softwareTerms",
"typescript"
],
"ignorePaths": [
".docusaurus/**",
"build/**",
"node_modules/**",
"docusaurus.config.ts",
"CHANGELOG.md"
],
"ignoreRegExpList": [
"G-[A-Z0-9]{9,}",
"(?:const|let|var)\\s+[a-zA-Z_][a-zA-Z0-9_]*\\s*=\\s*(?:\\(|\\{|\\[|\"|\\'|\\d|`|=>)",
"id=\"[\\w-]+\"",
"[^a-zA-Z\\s].*"
],
"patterns": [
{
"name": "markdown_code_blocks",
"pattern": "/```[\\s\\S]*?```/g",
"description": "Ignore code blocks in markdown"
},
{
"name": "urls_and_domains",
"pattern": "(?:https?://)?(?:[\\w-]+\\.)+[\\w-]+(?:/[\\w-./?%&=]*)?",
"description": "Ignore URLs and domain names"
},
{
"name": "websocket_urls",
"pattern": "wss?://[^\\s]*",
"description": "Ignore WebSocket URLs"
}
]
}
2 changes: 1 addition & 1 deletion docs/bridge/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This website is built using [Docusaurus](https://docusaurus.io/), a modern stati

## Generating API Docs

<!--TODO: needs to be done from ci to ensure regenration is done.-->
<!--TODO: needs to be done from ci to ensure regeneration is done.-->

`yarn docusaurus gen-api-docs all`.

Expand Down
2 changes: 1 addition & 1 deletion docs/bridge/docs/02-Bridge/01-SDK.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Requires either the `npm` or `yarn` package manager.

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.
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.

#### Ethers v5

Expand Down
11 changes: 5 additions & 6 deletions docs/bridge/docs/02-Bridge/02-REST-API.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@ Get read-only data from on-chain Synapse contracts, and generate Bridge and Swap

## Previous versions

| Date | Description
|------------------------|-
| 2024&#8209;10&#8209;01 | [https://synapse-rest-api-v2.herokuapp.com/](https://synapse-rest-api-v2.herokuapp.com/) is no longer maintained and has been fully deprecated as of October 2024.
| Date | Description |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| 2024&#8209;10&#8209;01 | [https://synapse-rest-api-v2.herokuapp.com/](https://synapse-rest-api-v2.herokuapp.com/) is no longer maintained and has been fully deprecated as of October 2024. |

## Support

Please read the documentation and examples carefully before reaching out on [Discord](https://discord.gg/synapseprotocol) for questions.


<!-- ## GET Endpoints

### `/swap`
Expand All @@ -39,7 +38,7 @@ Get a token swap quote.
* `routerAddress` (string): The address of the router contract
* `maxAmountOut {` (object): The maximum amount of tokens that can be swapped out.
* `type:` (string): The data type
* `hex:` (string): The amount encoded in hexidecimal
* `hex:` (string): The amount encoded in hexadecimal
* `query {` (object): Parameters for the swap query:
* `0:` (string): Router contract address
* `1:` (string): Address of `tokenIn`
Expand Down Expand Up @@ -197,7 +196,7 @@ Used to return which tokens you can bridge to, once an origin token is identifie
* Array of token objects the `fromToken` can be bridged to, containing:
* `symbol`: The token symbol of the destination token identified
* `chainId`: The `chainId` of the destination token identified
* `addres`: The token address of the destination token identified
* `address`: The token address of the destination token identified


#### Example
Expand Down
31 changes: 14 additions & 17 deletions docs/bridge/docs/04-Routers/01-Synapse-Router/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,10 @@ Swaps to/from an intermediate token return an empty query.

Determining an optimal route with minimal slippage and maximum output is not trivial. Synapse Router condenses this complexity into a [`Query`](https://github.com/synapsecns/synapse-contracts/blob/7bc3a579c08838d7f4c3e62954135901abb16183/contracts/bridge/libraries/BridgeStructs.sol#L12-L18), or data structure of generic swap instructions that return a `token`, and an `amountReceived`.



Given a bridgable token, a `Query` identifies on-chain “swaps” which allow the Bridge to identify the route(s) for an origin and intermediate token swap on the origin chain, and subsequent token swap on the destination chain.
Given a bridgeable token, a `Query` identifies on-chain “swaps” which allow the Bridge to identify the route(s) for an origin and intermediate token swap on the origin chain, and subsequent token swap on the destination chain.

Origin and destination queries are taken from the `getOriginAmountOut()` and `getDestinationAmountOut()` supporting functions, which are called for each transaction, from which your application can decide its preferred route.


<!-- See the Example Page for further information (and arguments) that the functions above require. It is imperative that the program uses the functions here to construct Queries instead of manually doing so -- this guarantees that the transaction won't be reverted for misconfigured parameters. -->

## Constructing a Bridge transaction
Expand Down Expand Up @@ -59,21 +56,21 @@ let requests = symbols.map((value, index) => {
let request: DestRequest = {
symbol: value,
amountIn: originQueries[index].minAmountOut,
};
return request;
});
}
return request
})
```

**4. Get `destQuery` list**

Call `getDestinationAmoutOut()` with your `destRequest` list and output token to receive a `Query` list for the destination chain.
Call `getDestinationAmountOut()` with your `destRequest` list and output token to receive a `Query` list for the destination chain.

**5. select `originQuery` and `destQuery`**

Determine which `originQuery` and `destQuery` to use. This simple example selects the origin and destination pair with the highest output:

```js
let destQuery = maxBy(destQueries, (query) => query.minAmountOut);
let destQuery = maxBy(destQueries, (query) => query.minAmountOut)
let selectedIndex = destQueries.indexOf(destQuery)
let originQuery = originQueries[selectedIndex]
```
Expand Down Expand Up @@ -221,22 +218,22 @@ function synapseBridge(
// - tokenIn, tokenOut, amountIn
// - SynapseRouter deployments
// - User settings for maximum slippage and deadline
// - User address on origin and destinaion chain (might be equal or different)
// - User address on origin and destination chain (might be equal or different)

// Beware: below is a TypeScript pseudocode.

// 0. Fetch deployments of SynapseRouter on origin and destiantion chains
// 0. Fetch deployments of SynapseRouter on origin and destination chains
let routerOrigin = getSynapseRouter(originChainId);
let routerDest = getSynapseRouter(destChainId);

// 1. Determine the set of bridge tokens that could enable "receive tokenOut on destination chain"
// For that we pefrorm a static call to SynapseRouter on destination chain
// For that we perform a static call to SynapseRouter on destination chain
let bridgeTokens = routerDest.getConnectedBridgeTokens(tokenOut);
// Then we get the list of bridge token symbols
let symbols = bridgeTokens.map((token) => token.symbol);

// 2. Get the list of Queries with possible swap instructions for origin chain
// For that we pefrorm a static call to SynapseRouter on origin chain
// For that we perform a static call to SynapseRouter on origin chain
// This gets us the quotes from tokenIn to every bridge token (one quote per bridge token in the list)
let originQueries = routerOrigin.getOriginAmountOut(
tokenIn,
Expand All @@ -245,7 +242,7 @@ function synapseBridge(
);

// 3. Get the list of Queries with possible swap instructions for destination chain
// First, we form a list of "destiantion requests" by merging
// First, we form a list of "destination requests" by merging
// list of token symbols with list of quotes obtained in step 2.
let requests = symbols.map((value, index) => {
let request: DestRequest = {
Expand All @@ -259,8 +256,8 @@ function synapseBridge(
// These quotes will take into account the fee for bridging the token to destination chain
let destQueries = routerDest.getDestinationAmountOut(requests, tokenOut);

// 4. Pick a pair of originQueries[i], destQueries[i] to pefrom the cross-chain swap
// In this example we are picking the pair that yeilds the best overall quote
// 4. Pick a pair of originQueries[i], destQueries[i] to perform the cross-chain swap
// In this example we are picking the pair that yields the best overall quote
let destQuery = maxBy(destQueries, (query) => query.minAmountOut);
let selectedIndex = destQueries.indexOf(destQuery)
let originQuery = originQueries[selectedIndex]
Expand All @@ -284,7 +281,7 @@ function synapseBridge(
// tokenIn.approve(routerOrigin, amountIn)
}
}
// Perform a call to Synapse Router with all the derevied parameters
// Perform a call to Synapse Router with all the derived parameters
// Use previously determined msg.value for this call
// (WETH wrapping is done by the Synapse Router)
routerOrigin.bridge{value: amountETH}(
Expand Down
4 changes: 2 additions & 2 deletions docs/bridge/docs/04-Routers/RFQ/01-Relayer.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ The rebalance amount is the smaller of the maximum rebalance amount on origin, a

#### Example

| # | CCTP | USDC | `maintenence_pct` | `initial_pct`
| # | CCTP | USDC | `maintenance_pct` | `initial_pct`
|---|------|------|-------------------|-
| 1 | Yes | 20% | 40% | 100 USDC
| 2 | Yes | 20% | 40% | 900 USDC
Expand Down Expand Up @@ -172,7 +172,7 @@ base_chain_config: # this is hte base chain config, other chains override it
chains:
1:
rfq_address: "0x5523D3c98809DdDB82C686E152F5C58B1B0fB59E" # rfq contract address on eth
synapse_cctp_address: "0x12715a66773BD9C54534a01aBF01d05F6B4Bd35E" # ccctp contract address on eth
synapse_cctp_address: "0x12715a66773BD9C54534a01aBF01d05F6B4Bd35E" # cctp contract address on eth
token_messenger_address: "0xbd3fa81b58ba92a82136038b25adec7066af3155" # token messenger address on eth, note: only one of token_messenger_address or synapse_cctp_address actually needs to be present
cctp_start_block: 19341000
confirmations: 2
Expand Down
Loading
Loading