> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sail.exchange/llms.txt
> Use this file to discover all available pages before exploring further.

# Sail Typescript Integration Guide

> Walkthrough for integrating Sail Exchange Typescript Client

<Info>
  **Prerequisite** You should have installed Node.js (version 18.10.0 or higher).
</Info>

In this section we’ll be going over how you can quickly get started with Sail Typescript Client, from initializing Sail, to creating your first order.
The typescript SDK provides security and allows fo reasy integration with frontends.

### 1. Install Sail

<CodeGroup>
  ```bash npm theme={null}
  npm i -g sail-exchange
  ```

  ```bash yarn theme={null}
  yarn global add sail-exchange
  ```
</CodeGroup>

### 2. Install Fuels

<CodeGroup>
  ```bash npm theme={null}
  npm i -g fuels
  ```

  ```bash yarn theme={null}
  yarn global add fuels
  ```
</CodeGroup>

### 3. Create Sail Instance

<CodeGroup>
  ```typescript sail.ts theme={null}
  import { Wallet, Provider } from 'fuels';
  import { sail, LimitOrder } from 'sail-exchange';

  // create a provider and wallet
  const testnetProvider = new Provider('https://beta-3.fuel.network');
  const tradingWallet = Wallet.fromPrivateKey(ENV_PRIVATE_KEY);

  const sail = new Sail(testnetProvider, tradingWallet);
  ```
</CodeGroup>

### 4. Create Order

<CodeGroup>
  ```typescript sail.ts theme={null}

      let order = new LimitOrder(
      maker: tradingWallet.address(),
      maker_amount: 10,
      taker_amount: 10,
      maker_token: 'ETH',
      taker_token: 'USDC',
      );

      const orderId = sail.createOrder(order)
  ```
</CodeGroup>

### 5. Take Order

<CodeGroup>
  ```typescript sail.ts theme={null}

      let order = new LimitOrder(
      maker: tradingWallet.address(),
      maker_amount: 10,
      taker_amount: 10,
      maker_token: 'ETH',
      taker_token: 'USDC',
      );

      const orderId = sail.takeOrder(order)
  ```
</CodeGroup>

### 6. Match Order

<CodeGroup>
  ```typescript sail.ts theme={null}

      let order = new LimitOrder(
      maker: tradingWallet.address(),
      maker_amount: 10,
      taker_amount: 10,
      maker_token: 'ETH',
      taker_token: 'USDC',
      );

      let order1 = new LimitOrder(
      maker: tradingWallet.address(),
      maker_amount: 10,
      taker_amount: 10,
      maker_token: 'USDC',
      taker_token: 'ETH',
      );

      const orderId = sail.matchOrder(order, order1)
  ```
</CodeGroup>

### 7. Cancel Order

<CodeGroup>
  ```typescript sail.ts theme={null}

      let order = new LimitOrder(
      maker: tradingWallet.address(),
      maker_amount: 10,
      taker_amount: 10,
      maker_token: 'ETH',
      taker_token: 'USDC',
      );

      const orderId = sail.cancelOrder(order)
  ```
</CodeGroup>
