Skip to content

Commit

Permalink
docs refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
BeroBurny committed Jul 9, 2024
1 parent 94c4618 commit 953bb5a
Show file tree
Hide file tree
Showing 13 changed files with 89 additions and 84 deletions.
6 changes: 3 additions & 3 deletions docs/docs/api/assets.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The response is a JSON object containing an array of fungible token objects.

```shell
curl -X 'GET' \
'https://gopher.test.buildwithsygma.com/assets/fungible' \
'https://api.sprinter.buildwithsygma.com/assets/fungible' \
-H 'accept: application/json'
```

Expand Down Expand Up @@ -91,7 +91,7 @@ The response is a JSON object containing the details of the specified token.

```shell
curl -X 'GET' \
'https://gopher.test.buildwithsygma.com/assets/fungible/usdc' \
'https://api.sprinter.buildwithsygma.com/assets/fungible/usdc' \
-H 'accept: application/json'
```

Expand Down Expand Up @@ -144,7 +144,7 @@ The response is a JSON object containing an array of fungible token objects for

```shell
curl -X 'GET' \
'https://gopher.test.buildwithsygma.com/networks/1/assets/fungible' \
'https://api.sprinter.buildwithsygma.com/networks/1/assets/fungible' \
-H 'accept: application/json'
```

Expand Down
8 changes: 4 additions & 4 deletions docs/docs/api/get-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ sidebar_position: 1

## API Usage

If you prefer using API calls directly or due to limitations of your environment, you can use the Gopher API. This guide provides an overview of the available endpoints and examples of how to interact with them.
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.

You can use the Swagger documentation available at [Gopher Swagger API](https://gopher.test.buildwithsygma.com/swagger/index.html) for more detailed information.
You can use the Swagger documentation available at [Sprinter Swagger API](https://api.sprinter.buildwithsygma.com/swagger/index.html) for more detailed information.

### Example

Example of getting a list of supported networks:

```shell
curl -X 'GET' \
'https://gopher.test.buildwithsygma.com/networks' \
'https://api.sprinter.buildwithsygma.com/networks' \
-H 'accept: application/json'
```

Expand All @@ -34,4 +34,4 @@ For more detailed information about each endpoint, please refer to the specific
- Token aggregation
- Token aggregation with contract call

Explore each section to understand how to make the most out of the Gopher API.
Explore each section to understand how to make the most out of the Sprinter API.
2 changes: 1 addition & 1 deletion docs/docs/api/networks.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The response is a JSON object containing an array of network objects.

```shell
curl -X 'GET' \
'https://gopher.test.buildwithsygma.com/networks' \
'https://api.sprinter.buildwithsygma.com/networks' \
-H 'accept: application/json'
```

Expand Down
6 changes: 3 additions & 3 deletions docs/docs/api/solutions.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sidebar_position: 5

# Solutions

This section explains how to get solutions for specific actions using the Gopher API.
This section explains how to get solutions for specific actions using the Sprinter API.

## GET - /solutions/aggregation

Expand All @@ -24,7 +24,7 @@ The response is a JSON object containing an array of solutions.

```shell
curl -X 'GET' \
'https://gopher.test.buildwithsygma.com/solutions/aggregation' \
'https://api.sprinter.buildwithsygma.com/solutions/aggregation' \
-H 'accept: application/json'
```

Expand Down Expand Up @@ -115,7 +115,7 @@ The request body should be a JSON object containing the following fields:

```shell
curl -X 'POST' \
'https://gopher.test.buildwithsygma.com/solutions/aggregation' \
'https://api.sprinter.buildwithsygma.com/solutions/aggregation' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/api/user-assets.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ The response is a JSON object containing an array of fungible token balance obje

```shell
curl -X 'GET' \
'https://gopher.test.buildwithsygma.com/accounts/0x123.../assets/fungible/usdc' \
'https://api.sprinter.buildwithsygma.com/accounts/0x123.../assets/fungible/usdc' \
-H 'accept: application/json'
```

Expand Down
28 changes: 14 additions & 14 deletions docs/docs/get-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,35 @@ sidebar_position: 2

# Getting Started

Welcome to the Gopher SDK! This guide will introduce you to the application flow of Gopher, explaining how it integrates with your application to manage cross-chain balances and transactions.
Welcome to the Sprinter SDK! This guide will introduce you to the application flow of Sprinter, explaining how it integrates with your application to manage cross-chain balances and transactions.

## Gopher Application Flow
## Sprinter Application Flow

The Gopher SDK is designed to streamline the process of interacting with multiple blockchain networks. Here's an overview of the typical flow of a Gopher-integrated application:
The Sprinter SDK is designed to streamline the process of interacting with multiple blockchain networks. Here's an overview of the typical flow of a sprinter-integrated application:

### 1. Prepare User (Authentication or Connect to DApp)

Before using Gopher, 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.
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 (Optional)

Once the user is prepared, Gopher can optionally aggregate the user's balances across multiple blockchains. This involves fetching data from different networks and consolidating it into a single view.
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 Quota

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

### 4. Execute Transaction (Handled by DApp)

After obtaining the transaction quota, the DApp executes the transaction. Gopher provides the best options for the transaction, but the actual execution and following the transaction status are handled by the DApp.
After obtaining the transaction quota, the DApp executes the transaction. Sprinter provides the best options for the transaction, but the actual execution and following the transaction status are handled by the DApp.

### 5. Error Handling (Handled by DApp)

Error handling is managed by the DApp. Gopher ensures that it provides accurate data and options, but the DApp is responsible for handling any errors that may arise during the transaction process.
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 Gopher Flow
## Diagram of the Sprinter Flow

Below is a simplified diagram illustrating the Gopher application flow:
Below is a simplified diagram illustrating the Sprinter application flow:

```plaintext
+------------------------+
Expand Down Expand Up @@ -62,10 +62,10 @@ Below is a simplified diagram illustrating the Gopher application flow:

## Further Reading

Now that you understand the Gopher application flow, here are some next steps to dive deeper into specific areas:
Now that you understand the Sprinter application flow, here are some next steps to dive deeper into specific areas:

- **[SDK Documentation](sdk/overview.md)**: Learn how to set up and use the SDK in your application.
- **[API Documentation](api/user-assets.md)**: Explore the API endpoints provided by Gopher for direct integration.
- **[Introduction to Gopher SDK](introduction.md)**: Get an overview of the Gopher SDK and its key features.
- **[API Documentation](api/user-assets.md)**: Explore the API endpoints provided by Sprinter for direct integration.
- **[Introduction to Sprinter SDK](introduction.md)**: Get an overview of the Sprinter SDK and its key features.

We hope this guide provides a clear understanding of the Gopher application flow. If you have any questions or need further assistance, feel free to reach out. Happy coding!
We hope this guide provides a clear understanding of the Sprinter application flow. If you have any questions or need further assistance, feel free to reach out. Happy coding!
20 changes: 10 additions & 10 deletions docs/docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,36 @@ sidebar_position: 1

# Introduction

Welcome to the Gopher SDK documentation! The Gopher SDK is a powerful tool designed to simplify cross-chain balance aggregation and transaction management, allowing your customers to seamlessly interact with multiple blockchain networks.
Welcome to the Sprinter SDK documentation! The Sprinter SDK is a powerful tool designed to simplify cross-chain balance aggregation and transaction management, allowing your customers to seamlessly interact with multiple blockchain networks.

## Getting Started

Depending on your needs, you have two main options for using the Gopher SDK:
Depending on your needs, you have two main options for using the Sprinter SDK:

1. **Using the SDK (Recommended for TypeScript and Web Framework Developers)**
2. **Calling APIs Directly**

### Using the SDK

Using the Gopher 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 particularly recommended for developers working with TypeScript or popular web frameworks.
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 particularly 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 { Gopher } from '@chainsafe/gopher-sdk';
import { Sprinter } from '@chainsafe/sprinter-sdk';

const gopher = new Gopher(window.ethereum);
const sprinter = new Sprinter(window.ethereum);

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

For a more detailed guide on setting up and using the SDK, refer to the [SDK Documentation](sdk/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 Gopher.
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

Expand All @@ -54,9 +54,9 @@ For a comprehensive list of available endpoints and how to use them, check out t

## Next Steps

- If you're new to Gopher SDK, start with our [Getting Started Guide](get-started.md).
- For an in-depth understanding, read the [Introduction to Gopher SDK](introduction.md).
- If you're new to Sprinter SDK, start with our [Getting Started Guide](get-started.md).
- For an in-depth understanding, read the [Introduction to Sprinter SDK](introduction.md).
- Explore detailed examples and advanced usage in the [SDK Documentation](sdk/overview.md).
- Dive into the specifics of our API in the [API Documentation](api/get-started.md).

We hope you find the Gopher SDK easy to use and integrate into your projects. Happy coding!
We hope you find the Sprinter SDK easy to use and integrate into your projects. Happy coding!
22 changes: 11 additions & 11 deletions docs/docs/sdk/advanced-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sidebar_position: 2

# Advanced Usage

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

## Handling Errors

Expand All @@ -13,7 +13,7 @@ The DApp is responsible for handling errors that occur during the transaction pr
### Example

```typescript
gopher.getUserBalances()
sprinter.getUserBalances()
.then(balances => {
console.log('User balances:', balances);
})
Expand All @@ -28,12 +28,12 @@ gopher.getUserBalances()

## Customizing Requests

The Gopher SDK allows you to customize requests to suit your application's needs. Here’s how to provide additional options when fetching solutions.
The Sprinter SDK allows you to customize requests to suit your application's needs. Here’s how to provide additional options when fetching solutions.

### Example

```typescript
gopher.getSolution({
sprinter.getSolution({
token: "USDC",
destinationChain: 42161, // Destination chain ID
amount: "1000000000" // Amount in the smallest unit (e.g., wei)
Expand All @@ -48,24 +48,24 @@ gopher.getSolution({

## Integrating with Other Libraries

You can integrate the Gopher 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

```typescript
import { Gopher } from '@chainsafe/gopher-sdk';
import { Sprinter } from '@chainsafe/sprinter-sdk';
import Web3 from 'web3';

async function integrateWithWeb3() {
const web3 = new Web3(window.ethereum);
const accounts = await web3.eth.requestAccounts();

const gopher = new Gopher(window.ethereum);
const sprinter = new Sprinter(window.ethereum);

const balances = await gopher.getUserBalances();
const balances = await sprinter.getUserBalances();
console.log('User balances:', balances);

const solution = await gopher.getSolution({
const solution = await sprinter.getSolution({
token: "USDC",
destinationChain: 42161,
amount: "1000000000"
Expand All @@ -92,11 +92,11 @@ 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 Gopher's solution that is used to execute the transaction.
- **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 Gopher SDK in your DApp:
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.
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/sdk/api-functions.md
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 Gopher 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 All @@ -19,7 +19,7 @@ Sets the base URL for the API.
#### Example

```typescript
setBaseUrl("https://new-api-url.com/");
setBaseUrl("https://test.api.sprinter.buildwithsygma.com/");
```

### `getSupportedChains(): Promise<Chain[]>`
Expand Down Expand Up @@ -263,6 +263,6 @@ Represents an amount in both native and USD values.

## Next Steps

- **[Gopher Class](class-reference.md)**: Get detailed information about the Gopher class provided by the SDK.
- **[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.
18 changes: 9 additions & 9 deletions docs/docs/sdk/class-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
sidebar_position: 3
---

# Gopher Class Reference
# Sprinter Class Reference

This section provides detailed information about the `Gopher` class available in the Gopher SDK. Use this reference to understand how to utilize the `Gopher` class in your decentralized applications (DApps).
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).

## Gopher Class
## Sprinter Class

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

### `constructor(provider: EIP1193Provider)`

Expand All @@ -21,7 +21,7 @@ Initializes the SDK with the given Ethereum provider.
#### Example

```typescript
const gopher = new Gopher(window.ethereum);
const sprinter = new Sprinter(window.ethereum);
```

### `getAvailableTokens(): Promise<FungibleToken[]>`
Expand All @@ -35,7 +35,7 @@ Fetches the available fungible tokens across supported blockchain networks.
#### Example

```typescript
gopher.getAvailableTokens().then(tokens => {
sprinter.getAvailableTokens().then(tokens => {
console.log('Available tokens:', tokens);
});
```
Expand All @@ -51,7 +51,7 @@ Fetches the supported blockchain networks.
#### Example

```typescript
gopher.getAvailableChains().then(chains => {
sprinter.getAvailableChains().then(chains => {
console.log('Supported chains:', chains);
});
```
Expand All @@ -71,7 +71,7 @@ Fetches the user's balances for specified tokens across multiple blockchains. If
#### Example

```typescript
gopher.getUserBalances().then(balances => {
sprinter.getUserBalances().then(balances => {
console.log('User balances:', balances);
});
```
Expand All @@ -97,7 +97,7 @@ Retrieves the optimal solution for managing cross-chain transactions based on th
#### Example

```typescript
gopher.getSolution({
sprinter.getSolution({
token: "USDC",
destinationChain: 42161, // Destination chain ID
amount: 1000000000 // Amount in the smallest unit (e.g., wei)
Expand Down
Loading

0 comments on commit 953bb5a

Please sign in to comment.