Skip to content

Commit e200b32

Browse files
committed
use prettier in docs
1 parent ebbab0d commit e200b32

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1491
-1361
lines changed

.prettierignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Ignore files for PNPM, NPM and YARN
2+
pnpm-lock.yaml
3+
package-lock.json
4+
yarn.lock
5+
6+
docs/.docusaurus
7+
docs/build
8+
docs/_temp

docs/babel.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = {
2-
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
2+
presets: [require.resolve("@docusaurus/core/lib/babel/preset")],
33
};

docs/docs/.prettierrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"useTabs": true,
3+
"singleQuote": false,
4+
"trailingComma": "none",
5+
"printWidth": 100
6+
}

docs/docs/01-introduction/01-introduction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ sidebar_position: 1
1212

1313
# Welcome To The Sprinter Docs
1414

15-
Sprinter is a **fast, smooth, interoperable intent execution engine**. Our aim is to make multichain interactions feel like one. In doing so, we enhance cross-chain UX *for all* as a first-class citizen in both existing and upcoming web3 technologies.
15+
Sprinter is a **fast, smooth, interoperable intent execution engine**. Our aim is to make multichain interactions feel like one. In doing so, we enhance cross-chain UX _for all_ as a first-class citizen in both existing and upcoming web3 technologies.
1616

1717
## What's Next
1818

docs/docs/01-introduction/02-key-features.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ sidebar_position: 2
55
---
66

77
Sprinter provides execution for chain abstracton providers by operating a large cluster of solvers that are designed to:
8-
- ⚖️ simplify cross-chain balance aggregation and transaction management
8+
9+
- ⚖️ simplify cross-chain balance aggregation and transaction management
910
- 🔀 automatically provide optimized execution paths by determining the fastest and cheapest paths for a transfer, regardless of layer
1011
- 🥰 provide the ultimate UX buff to users, applications, protocols, and wallets
1112
- ⚙️ be unopinionated about account types (EOAs or smart contract accounts)
@@ -31,7 +32,7 @@ Sprinter provides execution for chain abstracton providers by operating a large
3132

3233
## 💳 Capital Efficient
3334

34-
The Sprinter solver engine creates capital efficiency across the cross-chain transaction flow by bearing equivocation risk for users and intent providers. In effect, this optimizes the transaction supply chain for the user since we create the destination calldata.
35+
The Sprinter solver engine creates capital efficiency across the cross-chain transaction flow by bearing equivocation risk for users and intent providers. In effect, this optimizes the transaction supply chain for the user since we create the destination calldata.
3536

3637
## ↔️ Horizontal Scaling
3738

docs/docs/01-introduction/03-flow.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Below is a simplified diagram illustrating the Sprinter application flow:
3737
|
3838
v
3939
+------------------------+
40-
| Balance Aggregation |
40+
| Balance Aggregation |
4141
+-----------+------------+
4242
|
4343
v
@@ -47,11 +47,11 @@ Below is a simplified diagram illustrating the Sprinter application flow:
4747
|
4848
v
4949
+------------------------+
50-
| Execute Transaction |
50+
| Execute Transaction |
5151
+-----------+------------+
5252
|
5353
v
5454
+------------------------+
55-
| Error Handling |
55+
| Error Handling |
5656
+------------------------+
5757
```

docs/docs/01-introduction/04-supported-networks.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ sidebar_position: 4
77
import SupportedList from '@site/src/components/SupportedList';
88

99
:::tip
10-
New routes, networks, and tokens can readily be added by the Sprinter team. Please reach out at [[email protected]](mailto:[email protected]) to get a conversation started.
10+
New routes, networks, and tokens can readily be added by the Sprinter team. Please reach out at [[email protected]](mailto:[email protected]) to get a conversation started.
1111
:::
1212

1313
### Supported Bridges
1414

15-
* [LI.FI](https://li.fi/)
16-
* [Across](https://across.to/)
17-
* [Sygma](https://buildwithsygma.com)
15+
- [LI.FI](https://li.fi/)
16+
- [Across](https://across.to/)
17+
- [Sygma](https://buildwithsygma.com)
1818

1919
### Supported Networks and Tokens
2020

docs/docs/02-quick-start.md

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ The Sprinter SDK provides a streamlined interface for retrieving intent-based so
2929
Here’s a quick example of how to use the SDK in your project:
3030

3131
```typescript
32-
import { Sprinter, Environment } from '@chainsafe/sprinter-sdk';
32+
import { Sprinter, Environment } from "@chainsafe/sprinter-sdk";
3333

3434
const sprinter = new Sprinter({ baseUrl: Environment.MAINNET });
3535

36-
sprinter.getUserBalances('0xYourAddressHere').then(console.log);
36+
sprinter.getUserBalances("0xYourAddressHere").then(console.log);
3737
```
3838

3939
For more details on using the SDK, refer to the [SDK Documentation](./sdk).
@@ -47,35 +47,37 @@ If you're building a React application, you can use the Sprinter React SDK (`@ch
4747
Here’s how to set up a simple React component to fetch user balances:
4848

4949
```tsx
50-
import React, { useEffect } from 'react';
51-
import { SprinterContext, useSprinterBalances } from '@chainsafe/sprinter-react';
52-
import { Environment } from '@chainsafe/sprinter-sdk';
50+
import React, { useEffect } from "react";
51+
import { SprinterContext, useSprinterBalances } from "@chainsafe/sprinter-react";
52+
import { Environment } from "@chainsafe/sprinter-sdk";
5353

5454
function BalancesComponent() {
55-
const { balances, getUserBalances } = useSprinterBalances('0xYourAddressHere');
56-
57-
useEffect(() => {
58-
getUserBalances();
59-
}, [getUserBalances]);
60-
61-
if (balances.loading) return <div>Loading...</div>;
62-
if (balances.error) return <div>Error: {balances.error}</div>;
63-
64-
return (
65-
<ul>
66-
{Object.entries(balances.data || {}).map(([symbol, balanceEntry]) => (
67-
<li key={symbol}>{symbol}: {balanceEntry.total}</li>
68-
))}
69-
</ul>
70-
);
55+
const { balances, getUserBalances } = useSprinterBalances("0xYourAddressHere");
56+
57+
useEffect(() => {
58+
getUserBalances();
59+
}, [getUserBalances]);
60+
61+
if (balances.loading) return <div>Loading...</div>;
62+
if (balances.error) return <div>Error: {balances.error}</div>;
63+
64+
return (
65+
<ul>
66+
{Object.entries(balances.data || {}).map(([symbol, balanceEntry]) => (
67+
<li key={symbol}>
68+
{symbol}: {balanceEntry.total}
69+
</li>
70+
))}
71+
</ul>
72+
);
7173
}
7274

7375
function App() {
74-
return (
75-
<SprinterContext baseUrl={Environment.MAINNET}>
76-
<BalancesComponent />
77-
</SprinterContext>
78-
);
76+
return (
77+
<SprinterContext baseUrl={Environment.MAINNET}>
78+
<BalancesComponent />
79+
</SprinterContext>
80+
);
7981
}
8082

8183
export default App;

docs/docs/03-sdk/02-installation.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The Sprinter SDK allows developers to interact with cross-chain solutions such a
1212

1313
Before installing the SDK, ensure you have the following installed:
1414

15-
- **Node.js**: Version 20 (recommended) or higher
15+
- **Node.js**: Version 20 (recommended) or higher
1616
- **npm** or **yarn**: A package manager for JavaScript
1717

1818
## Installation
@@ -30,7 +30,7 @@ Once the SDK is installed, you can initialize it to interact with blockchain net
3030
### Example: Initialize `Sprinter`
3131

3232
```typescript
33-
import { Sprinter, Environment } from '@chainsafe/sprinter-sdk';
33+
import { Sprinter, Environment } from "@chainsafe/sprinter-sdk";
3434

3535
const sprinter = new Sprinter({ baseUrl: Environment.MAINNET });
3636

@@ -43,7 +43,7 @@ sprinter.getUserBalances(ownerAddress).then(console.log);
4343
You can also call specific API endpoints directly using the SDK. Here’s an example:
4444

4545
```typescript
46-
import { api } from '@chainsafe/sprinter-sdk';
46+
import { api } from "@chainsafe/sprinter-sdk";
4747

4848
const ownerAddress = "0xYourAddressHere";
4949
const tokenSymbol = "USDC";
@@ -58,7 +58,7 @@ You can configure the SDK using environment variables to set the base URL for AP
5858
### Example: Set Base URL
5959

6060
```typescript
61-
import { setBaseUrl } from '@chainsafe/sprinter-sdk';
61+
import { setBaseUrl } from "@chainsafe/sprinter-sdk";
6262

6363
setBaseUrl("https://api.sprinter.buildwithsygma.com");
6464
```

docs/docs/03-sdk/03-configuration.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@ When initializing the `Sprinter` class, you can pass a `baseUrl` configuration o
1717
The `baseUrl` is the API server endpoint. You can either set it manually or use the predefined `Environment` enum to simplify configuration.
1818

1919
```typescript
20-
import { Sprinter, Environment } from '@chainsafe/sprinter-sdk';
20+
import { Sprinter, Environment } from "@chainsafe/sprinter-sdk";
2121

2222
// Using a custom base URL
2323
const sprinter = new Sprinter({
24-
baseUrl: 'https://api.sprinter.buildwithsygma.com',
24+
baseUrl: "https://api.sprinter.buildwithsygma.com"
2525
});
2626

2727
// Or using a predefined environment URL
2828
const sprinterWithEnv = new Sprinter({
29-
baseUrl: Environment.MAINNET, // Enum that provides predefined URLs
29+
baseUrl: Environment.MAINNET // Enum that provides predefined URLs
3030
});
3131
```
3232

@@ -35,10 +35,10 @@ const sprinterWithEnv = new Sprinter({
3535
You can change the `baseUrl` dynamically in your application using the `setBaseUrl` function provided by the SDK. This is useful when you need to modify the API endpoint during runtime.
3636

3737
```typescript
38-
import { setBaseUrl } from '@chainsafe/sprinter-sdk';
38+
import { setBaseUrl } from "@chainsafe/sprinter-sdk";
3939

4040
// Dynamically set the base URL during runtime
41-
setBaseUrl('https://custom.api.url');
41+
setBaseUrl("https://custom.api.url");
4242
```
4343

4444
## Set Base URL Using Environment Variables
@@ -53,7 +53,7 @@ SPRINTER_URL=https://api.sprinter.buildwithsygma.com
5353
In your code, the SDK will use this environment variable automatically:
5454

5555
```typescript
56-
import { setBaseUrl } from '@chainsafe/sprinter-sdk';
56+
import { setBaseUrl } from "@chainsafe/sprinter-sdk";
5757

5858
// Automatically set the base URL from the environment variable
5959
setBaseUrl(process.env.SPRINTER_URL);
@@ -75,8 +75,8 @@ Every method in the SDK accepts an optional `fetchOptions` parameter, which cont
7575
### Example: Overriding `baseUrl` for a Single Request
7676

7777
```typescript
78-
sprinter.getAvailableTokens({ baseUrl: 'https://custom.api.url' }).then(tokens => {
79-
console.log(tokens);
78+
sprinter.getAvailableTokens({ baseUrl: "https://custom.api.url" }).then((tokens) => {
79+
console.log(tokens);
8080
});
8181
```
8282

0 commit comments

Comments
 (0)