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

chore: prelim updates to landing page copy, sidebar links, navigation links, etc. #23

Merged
merged 38 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
fa479a0
prelim updates to landing page copy, sidebar links, navigation links,…
haochizzle Jul 29, 2024
79baffe
update feature icons (these arent final)
haochizzle Jul 29, 2024
98f6c7f
update landing page with contact us section + small visual updates
haochizzle Jul 31, 2024
a3e4e65
number the docs for viewability
haochizzle Aug 1, 2024
1b2d152
remove redundant getting started mentions; add search bar; refactor s…
haochizzle Aug 6, 2024
22c7dbc
rename quickstart.md
haochizzle Aug 6, 2024
9854405
update config
haochizzle Aug 6, 2024
87f8327
add key features page
haochizzle Aug 6, 2024
c0724ee
update yarn.lock file; add supported networks page
haochizzle Aug 6, 2024
170778a
github actions temp update on yarn
haochizzle Aug 6, 2024
430ea6c
immutable yarn
haochizzle Aug 6, 2024
141666c
test ci
haochizzle Aug 6, 2024
81c9378
ci.yml
haochizzle Aug 6, 2024
a2221b2
sdk overview update
haochizzle Aug 9, 2024
7365be9
advanced usage clean up
haochizzle Aug 9, 2024
a14360b
small update to class reference introduction
haochizzle Aug 9, 2024
d13674a
small update to API functions section
haochizzle Aug 9, 2024
9d4ebcb
reorganize API documentation ordering
haochizzle Aug 9, 2024
d5384ef
Merge branch 'master' into tho/docsv01
haochizzle Aug 9, 2024
1d062aa
immutable flag on yarn to push some yarn.lock changes
haochizzle Aug 9, 2024
4f9a855
git pull
haochizzle Aug 9, 2024
30f78c0
yarn.lock file
haochizzle Aug 9, 2024
c9b0c63
add docusaurus-local-search dependency
haochizzle Aug 9, 2024
90ea860
cd.yml
haochizzle Aug 9, 2024
d9c17b1
retrying yarn lock file
haochizzle Aug 9, 2024
e4d877d
update node version
haochizzle Aug 9, 2024
0306ba7
readding immutable flag. plz god let this work
haochizzle Aug 9, 2024
5fd533d
checksumbehavior update
haochizzle Aug 9, 2024
319e1bd
update cd.yml and ci.yml PLZ GOD
haochizzle Aug 9, 2024
7afe304
update doc-local-search to latest ver
haochizzle Aug 9, 2024
225c06b
reset yarn version
haochizzle Aug 9, 2024
64779a6
re-add immutable flags to cd and ci
haochizzle Aug 9, 2024
26d3a20
revert yarn version to 4.3.1. remove walletConnect for initializing p…
haochizzle Aug 12, 2024
ad1b39c
revert yarn to 4.3.1
haochizzle Aug 12, 2024
fea2eec
revert yarnrc.yml
haochizzle Aug 12, 2024
17845ed
remove extra useless code
haochizzle Aug 12, 2024
fef3cbc
table format for supported networks page
haochizzle Aug 12, 2024
472c1f9
revert yarn stuff
BeroBurny Aug 13, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ jobs:
projectName: gopher-docs
directory: ./docs/build
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.head_ref || github.ref_name }}
branch: ${{ github.head_ref || github.ref_name }}
21 changes: 21 additions & 0 deletions docs/docs/01-introduction/01-introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
id: intro
title: What Is Sprinter?
sidebar_position: 1
---

# Welcome To The Sprinter Docs

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.

## What's Next

- If you're new to Sprinter, begin with [Quick Start](../02-quick-start.md).
- Explore detailed examples and advanced usage in the [SDK Documentation](../03-sdk/01-overview.md).
- Dive into the specifics of our API in the [API Documentation](../04-api/01-api-usage.md).

Stay tuned for the complete source code.

## Need Assistance?

If you have questions about Sprinter, the code, the docs, or have a business inquiry, please reach out to us on [Discord](https://discord.gg/Qdf6GyNB5J) or via email at [[email protected]](mailto:[email protected]).
38 changes: 38 additions & 0 deletions docs/docs/01-introduction/02-key-features.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
id: features
title: Key Features
sidebar_position: 2
---

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

## 🏃‍♀️ Fast

- **Extensive Route Search**: Our solvers explore a wide array of routes to access deeper liquidity pools.
- **Execution Guarantee**: Ensures transaction execution through our advanced mechanism.
- **Just-in-Time (JIT) Liquidity**: Provides JIT liquidity and capital fronting to facilitate transactions efficiently.

## 🥃 Smooth

- **Flexible Account Compatibility**: Supports both externally owned accounts (EOA) and smart contract wallets.
- **Minimized Slippage**: Quotes are derived from multiple pools across various intent protocols to minimize slippage.
- **One-Click Solutions**: Enables seamless and straightforward one-click solutions for user convenience.

## 🤝 Interoperable

- **Multi-Protocol Integration**: Our solvers integrate with multiple protocols to enhance functionality.
- **Account Type Agnostic**: Operates seamlessly regardless of account type.
- **Wallet Implementation Agnostic**: Functions efficiently with various wallet implementations.
- **Flexible Capital Fronting**: Capable of fronting capital across different networks as needed.

## 💳 Capital Efficient

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.

## ↔️ Horizontal Scaling

Just as the explosion of the EVM L2 ecosystem has brought about horizontal scalability for the entire Ethereum ecosystem, Sprinter amplifies this effect by facilitating movement of funds between all chains.
57 changes: 57 additions & 0 deletions docs/docs/01-introduction/03-flow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
id: flow
title: Sprinter x Application Flow
sidebar_position: 3
---

The following section showcases how cross-chain balances and transactions are managed in a Sprinter-integrated application flow.

### 1. Prepare User

Before using Sprinter, the user must authenticate or connect to the decentralized application (dApp). This step is handled by your application, ensuring that the user is authenticated and their wallet is connected.

### 2. Balance Aggregation

Once the user is prepared, Sprinter can optionally aggregate the user's balances across multiple blockchains. This involves fetching data from different networks and consolidating it into a single view.

### 3. Get Quote

The next step is to get the transaction quote. This provides the necessary information for the dApp to execute the required transactions. Sprinter finds the best single-hop cross-bridge transaction to optimize this process.

### 4. Execute Transaction

After obtaining the transaction quote, the dApp executes the transaction. Sprinter provides the best options for the transaction, but the actual execution and transaction status monitoring is handled by the dApp.

### 5. Error Handling

Error handling is managed by the dApp. Sprinter ensures that it provides accurate data and options, but the dApp is responsible for handling any errors that may arise during the transaction process.

## Diagram of the Sprinter Flow

Below is a simplified diagram illustrating the Sprinter application flow:

```plaintext
+------------------------+
| Prepare User (Auth) |
+-----------+------------+
|
v
+------------------------+
| Balance Aggregation |
+-----------+------------+
|
v
+------------------------+
| Get Quote |
+-----------+------------+
|
v
+------------------------+
| Execute Transaction |
+-----------+------------+
|
v
+------------------------+
| Error Handling |
+------------------------+
```
18 changes: 18 additions & 0 deletions docs/docs/01-introduction/04-supported-networks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
id: supported
title: Supported Bridges And Networks
sidebar_position: 4
---

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

| Supported Bridges | Supported Networks | Supported Tokens |
|-------------------------------------|--------------------|------------------|
| [LI.FI](https://li.fi/) | Ethereum Mainnet | Native ETH |
| [Across](https://across.to/) | Base | Wrapped ETH |
| [Sygma](https://buildwithsygma.com) | Arbitrum | USDC |
| | Polygon | USDT |
| | Gnosis | DAI |
| | Cronos | |
49 changes: 49 additions & 0 deletions docs/docs/02-quick-start.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
id: quickstart
title: Quick Start
sidebar_position: 2
---

You have two main options for interacting with Sprinter:

- [Using the SDK](#using-the-sdk)
- [Calling API Endpoints Directly](#calling-api-endpoints-directly)

### Using the SDK

Using the Sprinter SDK provides a convenient and unified interface for blockchain interactions, complete with TypeScript support for enhanced type safety and a better development experience. This approach is recommended for developers working with TypeScript or popular web frameworks.

**Quick Example**

Here's a quick example of how to use the SDK in your project:

```typescript
import { Sprinter } from '@chainsafe/sprinter-sdk';

const sprinter = new Sprinter(window.ethereum);

sprinter.getUserBalances().then(console.log);
```

For a more detailed guide on setting up and using the SDK, refer to the [SDK Documentation](03-sdk/01-overview.md).

### Calling API Endpoints Directly

If you prefer more control or wish to implement the solution in a different programming language, you can directly interact with the API endpoints provided by Sprinter.

**Quick Example**

Here’s how you can call the API directly using JavaScript's Fetch API:

```javascript
const ownerAddress = "0x3E101Ec02e7A48D16DADE204C96bFF842E7E2519";
const tokenSymbol = "USDC";
const baseUrl = "https://api.sprinter.buildwithsygma.com/";

fetch(`${baseUrl}/accounts/${ownerAddress}/assets/fungible/${tokenSymbol}`)
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error fetching user fungible tokens:', error));
```

For a comprehensive list of available endpoints and how to use them, check out the [API Documentation](04-api/01-api-usage.md).
21 changes: 6 additions & 15 deletions docs/docs/sdk/overview.md → docs/docs/03-sdk/01-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@ sidebar_position: 1

# SDK Overview

The Sprinter SDK is a powerful tool designed to simplify interaction with multiple blockchain networks. It provides a unified interface for aggregating balances and optimizing cross-chain operations, making it easier to build decentralized applications (DApps).

## Key Features

- **Cross-Chain Balance Aggregation**: Consolidate balances from various blockchain networks.
- **Best Single-Hop Cross-Bridge Transactions**: Optimize transactions across different blockchains.
- **TypeScript Support**: Ensure type safety and a better development experience with TypeScript.
The Sprinter SDK simplifies interactions with multiple blockchain networks. It provides a unified interface for aggregating balances and optimizing cross-chain operations, making it easier to build decentralized applications (dApps).

## Installation

Expand All @@ -28,6 +22,10 @@ yarn add @chainsafe/sprinter-sdk

## Basic Usage

:::info
If you would like to test this without custom front-end code, you can directly do so by adding `vite` as a package. You will then need to create an `index.html` file to serve as the entry way for the following script using `<script>` tag.
:::

Comment on lines +25 to +28
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤷‍♂️

note to me, should revisit this and think about use cases like rawdogging web3 stuff in a browser

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i wasnt sure if we should assume someone would know how to rawdog the web3 stuff in a browser, so thought to add a little helper hint to add vite as a package. lmk if you think this is excessive and we should assume basic knowledge. me personally, i'd err on the side of providing more info than not.

Here's a quick example to get you started with the SDK:

### 1. Import the Sprinter SDK
Expand Down Expand Up @@ -92,11 +90,4 @@ sprinter.getUserBalances().then(balances => {
}).catch(error => {
console.error('An error occurred:', error);
});
```

## Next Steps

- **[Core Concepts](../get-started.md)**: Understand the fundamental concepts and operations of the Sprinter SDK.
- **[Advanced Usage](advanced-usage.md)**: Explore advanced features and best practices.
- **[Class API Reference](class-reference.md)**: Get detailed information about the classes and methods provided by the SDK.
- **[API Reference](api-functions.md)**: Get detailed information about the classes and methods provided by the SDK.
```
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ sidebar_position: 2

# Advanced Usage

This section explores advanced features and best practices for using the Sprinter SDK in your decentralized applications (DApps).

## Handling Errors

The DApp is responsible for handling errors that occur during the transaction process. Ensure to implement proper error handling mechanisms to provide a smooth user experience.
The dApp is responsible for handling errors that occur during the transaction process. Ensure to implement proper error handling mechanisms to provide a smooth user experience.

### Example

Expand Down Expand Up @@ -46,9 +44,9 @@ sprinter.getSolution({

- **token, destinationChain, amount**: These parameters specify the token, destination chain, and amount for the transaction.

## Integrating with Other Libraries
## Integrating With Other Libraries

You can integrate the Sprinter SDK with other libraries and tools in your DApp to enhance functionality.
You can integrate the Sprinter SDK with other libraries and tools in your dApp to enhance functionality.

### Example with Web3.js v4

Expand Down Expand Up @@ -92,19 +90,4 @@ integrateWithWeb3().catch(console.error);
### Explanation

- **Web3.js v4**: A library for interacting with the Ethereum blockchain, used here to manage accounts and send transactions.
- **solution[0].transaction**: The transaction object provided by Sprinter's solution that is used to execute the transaction.

## Best Practices

Follow these best practices to ensure smooth and efficient integration of the Sprinter SDK in your DApp:

- **Error Handling**: Always implement comprehensive error handling to manage issues gracefully.
- **User Experience**: Provide clear feedback to users about the status of their transactions and any errors that occur.
- **Security**: Ensure that your application handles sensitive information securely and follows best practices for interacting with blockchain networks.
- **Optimization**: Use the SDK’s features to optimize cross-chain transactions and minimize costs.

## Next Steps

- **[Class API Reference](class-reference.md)**: Get detailed information about the classes and methods provided by the SDK.
- **[API Reference](api-functions.md)**: Get detailed information about the classes and methods provided by the SDK.
- **[Getting Started](../get-started.md)**: Review the basic setup and core concepts.
- **solution[0].transaction**: The transaction object provided by Sprinter's solution that is used to execute the transaction.
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ sidebar_position: 3

# Sprinter Class Reference

This section provides detailed information about the `Sprinter` class available in the Sprinter SDK. Use this reference to understand how to utilize the `Sprinter` class in your decentralized applications (DApps).
This section details the methods available to the `Sprinter` class in the Sprinter SDK. Use this reference to understand how to utilize the `Sprinter` class in your decentralized applications (dApps).

## Sprinter Class

The main class provided by the Sprinter SDK. It includes methods for interacting with multiple blockchain networks.
## Methods

### `constructor(provider: EIP1193Provider)`

Expand Down Expand Up @@ -218,9 +216,3 @@ Represents an amount in both native and USD values.

- `amount: string`: The amount in the smallest unit (e.g., wei).
- `amountUSD: number`: The equivalent amount in USD.

## Next Steps

- **[API Functions](api-functions.md)**: Get detailed information about the API functions provided by the SDK.
- **[Advanced Usage](advanced-usage.md)**: Explore advanced features and best practices.
- **[Getting Started](../get-started.md)**: Review the basic setup and core concepts.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sidebar_position: 4

# API Functions Reference

This section provides detailed information about the API functions available in the Sprinter SDK. Use this reference to understand how to utilize the API functions in your decentralized applications (DApps).
This section provides detailed information about the API functions available in the Sprinter SDK. Use this reference to understand how to utilize the API functions in your decentralized applications (dApps).

## API Functions

Expand Down Expand Up @@ -261,8 +261,3 @@ Represents an amount in both native and USD values.
- `amount: string`: The amount in the smallest unit (e.g., wei).
- `amountUSD: number`: The equivalent amount in USD.

## Next Steps

- **[Sprinter Class](class-reference.md)**: Get detailed information about the Sprinter class provided by the SDK.
- **[Advanced Usage](advanced-usage.md)**: Explore advanced features and best practices.
- **[Getting Started](../get-started.md)**: Review the basic setup and core concepts.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"position": 3,
"link": {
"type": "generated-index",
"description": "5 minutes to learn the most important Docusaurus concepts."
"description": "All about the Sprinter SDK."
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
---
sidebar_position: 1
sidebar_position: 2
---

# Get Started

## API Usage
# API Usage

If you prefer using API calls directly or due to limitations of your environment, you can use the Sprinter API. This guide provides an overview of the available endpoints and examples of how to interact with them.

Expand All @@ -24,13 +22,15 @@ curl -X 'GET' \

For more detailed information about each endpoint, please refer to the specific documents:

- [Fungible Assets](assets.md)
- [Fungible Assets](02-assets.md)
- Get all assets information
- Get specific assets information
- Get specific network assets
- [Networks](networks.md)
- [User Assets](03-user-assets.md)
- Get assets for a specific user
- [Networks](04-networks.md)
- Get all supported networks
- [Solutions](solutions.md)
- [Solutions](05-solutions.md)
- Token aggregation
- Token aggregation with contract call

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 2
sidebar_position: 4
---

# Networks
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"position": 4,
"link": {
"type": "generated-index",
"description": "5 minutes to learn the most important Docusaurus concepts."
"description": "All about the Sprinter API."
}
}
Loading
Loading