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

# Sei

> Unified API + Sei Integration Workflow

In the following guide, the integration process for the `sei` chain is covered. The Sei integration aligns with the general [Unified API process](/docs/unified-api-getting-started) but with network-specific parameters.

[Get an authentication token](/docs/authentication) to start using the Unified API.

Request examples are provided using [cURL](https://curl.se/).

> To check the integration guides for other chains, refer to the [Networks Supported](/docs/unified-api-networks) section.

<Note>
  **Key Sei-specific details**

  * `chain` — always set to `sei` for Sei-related requests.
  * `network` — environment in which the transaction is processed: `pacific-1` or `atlantic-2`.
  * `stakerAddress` — account address initiating staking, unstaking or withdrawal transactions.
  * `amount` — amount of tokens in SEI.
</Note>

## Staking flow

### 1. Create staking request

Send a POST request to [/api/v1/unified/staking/stake](/reference/unified-create-stake-transaction).

Example request (for `pacific-1` network):

<CodeGroup>
  ```bash bash theme={null}
  curl --request POST \
       --url https://api-test.p2p.org/api/v1/unified/staking/stake \
       --header 'Content-Type: application/json' \
       --header 'Authorization: Bearer <token>' \
       --data '{
      "chain": "sei",
      "network": "pacific-1",
      "stakerAddress": "sei18fzgvzy3h0q646wq2nwz42zrt5xsryusf8jmmp",
      "amount": 0.1,
      "extra": {
  			"memo": "memo"
  		}
  }'
  ```
</CodeGroup>

* `chain` — blockchain network, always set to `sei` for Sei-related requests.
* `network` — environment in which the transaction is processed: `pacific-1` or `atlantic-2`.
* `stakerAddress` — account address initiating the staking transaction.
* `amount` — amount of tokens to stake in SEI, minimum amount is 0.1.
* `extra` — additional parameters:
  * `memo` — arbitrary text data to add to the transactions.

Example response:

<CodeGroup>
  ```json JSON theme={null}
  {
      "error": null,
      "result": {
          "amount": 0.1,
          "stakerAddress": "sei18fzgvzy3h0q646wq2nwz42zrt5xsryusf8jmmp",
          "unsignedTransactionData": {
              "messages": [
                  {
                      "typeUrl": "/sei.staking.v1beta1.MsgDelegate",
                      "value": {
                          "delegatorAddress": "sei18fzgvzy3h0q646wq2nwz42zrt5xsryusf8jmmp",
                          "validatorAddress": "seivaloper1qmpxlswwk42wya67t7zsaawf3vur03cuevss0h",
                          "amount": {
                              "denom": "usei",
                              "amount": "100000"
                          }
                      }
                  }
              ],
              "fee": {
                  "amount": [
                      {
                          "amount": "4851",
                          "denom": "usei"
                      }
                  ],
                  "gas": "194020"
              },
              "memo": "abc",
              "encodedBody": "0a96010a232f636f736d6f732e7374616b696e672e763162657461312e4d736744656c6567617465126f0a2a7365693138667a67767a79336830713634367771326e777a34327a72743578737279757366386a6d6d70123173656976616c6f70657231716d70786c7377776b3432777961363774377a736161776633767572303363756576737330681a0e0a047573656912063130303030301203616263",
              "encodedAuthInfo": "0a500a460a1f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b657912230a2103c0caf89df9997994f61207d69c755060aeadf9cbf1ba3ea3fa9117bdb304414e12040a020801180612120a0c0a047573656912043438353110e4eb0b",
              "messageHash": "ef6f9484c2aaf4d27b9b1354e2a52491869f5250746976fcaba3c30f8437ac03"
          },
          "createdAt": "2025-03-06T12:53:02.657Z",
          "extraData": {
              "currency": "sei",
              "validatorAddress": "seivaloper1qmpxlswwk42wya67t7zsaawf3vur03cuevss0h",
              "rewardDestinationAddress": "sei18fzgvzy3h0q646wq2nwz42zrt5xsryusf8jmmp"
          }
      }
  }
  ```
</CodeGroup>

* `amount` — amount of tokens to stake in SEI.

* `stakerAddress` — staking account address receiving the staked tokens.

* `unsignedTransactionData` — unsigned transaction in Base64 encrypted format. It contains the list of data fields to be used to construct the staking transactions:

  * `messages`:

    * `typeUrl` — Sei network operation type.

    * `delegatorAddress` — delegator address.

    * `validatorAddress` — validator address.

    * `amount` — amount of tokens to stake.

    * `denom` — currency of tokens:

      * `sei` — SEI native staking token.
      * `usei` — 1 SEI = 10⁶ uSEI.
      * `msei` — 1 SEI = 10³ mSEI.

  * `fee` — fee charged for processing the transaction.

    * `amount` — amount of tokens.
    * `denom` — currency of tokens: `sei`, `usei`, or `msei`.
    * `gas` — amount of <Tooltip tip="A measure of computational effort required to execute a transaction or smart contract on a blockchain. Users must pay a gas fee, usually in the native token, to have their transactions processed by the network.">gas</Tooltip> spent for the transaction.

  * `memo` — arbitrary text data to add to the transactions.

  * `encodedBody` — processable transaction data encoded in the hexadecimal format.

  * `encodedAuthInfo` — authorization data, including fee, encoded in the hexadecimal format.

  * `messageHash` — hash of the transaction.

* `createdAt` — timestamp of the transaction in the ISO 8601 format.

* `extraData` — additional transaction details:

  * `currency` — currency of tokens: `sei`, `usei`, or `msei`.
  * `validatorAddress` — validator address to which tokens are delegated.
  * `rewardDestinationAddress` — reward destination account address.

### 2. Sign and send transaction

Use `unsignedTransactionData` to [sign](/docs/unified-api-signing-transaction) the transaction.

To broadcast the signed transaction to the Sei network, send a POST request to [/api/v1/unified/transaction/broadcast](/reference/unified-transaction-send).

Example request (for `pacific-1` network):

<CodeGroup>
  ```bash bash theme={null}
  curl --request POST \
       --url https://api-test.p2p.org/api/v1/unified/transaction/broadcast \
       --header 'Content-Type: application/json' \
       --header 'Authorization: Bearer <token>' \
       --data '{
      "chain": "sei",
      "network": "pacific-1",
      "stakerAddress": "sei18fzgvzy3h0q646wq2nwz42zrt5xsryusf8jmmp",
      "amount": 0.1,
      "signedTransaction":    "0a9e010a96010a232f636f736d6f732e7374616b696e672e763162657461312e4d736744656c6567617465126f0a2a7365693138667a67767a79336830713634367771326e777a34327a72743578737279757366386a6d6d70123173656976616c6f70657231716d70786c7377776b3432777961363774377a736161776633767572303363756576737330681a0e0a04757365691206313030303030120361626312660a500a460a1f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b657912230a2103c0caf89df9997994f61207d69c755060aeadf9cbf1ba3ea3fa9117bdb304414e12040a020801180612120a0c0a047573656912043438353110e4eb0b1a4012ce8717390c205ea7fc800c1d0aeacc260d558906f2825756cdef24a13daaae57256b6a8b1085ae8af77f8c9a59a83933b9f5a456e5d563f9048ab1bb691036"
  }'
  ```
</CodeGroup>

* `chain` — blockchain network.
* `network` — environment in which the transaction is processed.
* `stakerAddress` — staking account address receiving the staked tokens.
* `amount` — amount of tokens to stake in SEI.
* `signedTransaction` — signed transaction in Base64 encrypted format, which contains all transaction details (e.g., accounts, instructions, and signatures) required to broadcast the transaction to the network.

Example response:

<CodeGroup>
  ```json JSON theme={null}
  {
      "error": null,
      "result": {
          "status": "success",
          "extraData": {
              "blockId": 135190135,
              "fee": 0.004850999999999999,
              "gas": {
                  "used": 160707,
                  "wanted": 194020
              },
              "transactionHash": "76EDCE98041DFA42615DEA1BF483AD4752D2C389B8B312DFEB4F5171F7F57BBD"
          }
      }
  }
  ```
</CodeGroup>

* `status` — transaction status: `pending`, `success` or `failed`.

* `extraData` — additional transaction details:

  * `blo<Tooltip tip="A measure of computational effort required to execute a transaction or smart contract on a blockchain. Users must pay a gas fee, usually in the native token, to have their transactions processed by the network.">ckI</Tooltip>d` — unique identifier of the block in which the transaction has been included.

  * `fee` — total fee in SEI charged for processing the transaction.

  * `gas` — computational effort required to execute the transaction, measured in gas units.

    * `used` — amount of gas spent for the transaction.
    * `wanted` — maximum gas limit available to consume for the transaction.

  * `transactionHash` — hash of the transaction.

## Unstaking flow

### 1. Create unstaking request

Send a POST request to [/api/v1/unified/staking/unstake](/reference/unified-create-unstake-transaction).

Example request (for `pacific-1` network):

<CodeGroup>
  ```bash bash theme={null}
  curl --request POST \
       --url https://api-test.p2p.org/api/v1/unified/staking/unstake \
       --header 'Content-Type: application/json' \
       --header 'Authorization: Bearer <token>' \
       --data '{
      "chain": "sei",
      "network": "pacific-1",
      "stakerAddress": "sei18fzgvzy3h0q646wq2nwz42zrt5xsryusf8jmmp"
      "extra": {
        "amount": 0.1
      }
  }'
  ```
</CodeGroup>

* `chain` — blockchain network.
* `network` — environment in which the transaction is processed.
* `stakerAddress` — account address initiated the staking transaction.
* `extra` — additional parameters:
  * `amount` — amount of tokens to unstake in SEI, minimum amount is 0.1 SEI.

Example response:

<CodeGroup>
  ```json JSON theme={null}
  {
      "error": null,
      "result": {
          "unsignedTransactionData": {
              "messages": [
                  {
                      "typeUrl": "/sei.staking.v1beta1.MsgUndelegate",
                      "value": {
                          "delegatorAddress": "sei18fzgvzy3h0q646wq2nwz42zrt5xsryusf8jmmp",
                          "validatorAddress": "seivaloper1qmpxlswwk42wya67t7zsaawf3vur03cuevss0h",
                          "amount": {
                              "denom": "usei",
                              "amount": "100000"
                          }
                      }
                  }
              ],
              "fee": {
                  "amount": [
                      {
                          "amount": "5222",
                          "denom": "usei"
                      }
                  ],
                  "gas": "208859"
              },
              "memo": "",
              "encodedBody": "0a98010a252f636f736d6f732e7374616b696e672e763162657461312e4d7367556e64656c6567617465126f0a2a7365693138667a67767a79336830713634367771326e777a34327a72743578737279757366386a6d6d70123173656976616c6f70657231716d70786c7377776b3432777961363774377a736161776633767572303363756576737330681a0e0a04757365691206313030303030",
              "encodedAuthInfo": "0a500a460a1f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b657912230a2103c0caf89df9997994f61207d69c755060aeadf9cbf1ba3ea3fa9117bdb304414e12040a020801180712120a0c0a047573656912043532323210dbdf0c",
              "messageHash": "eb685b1e4f0c8fe5fb9c44ec83bc58ca5351756b28a78ec32efa8df7c736f77b"
          },
          "createdAt": "2025-03-06T12:55:03.838Z",
          "extraData": {
              "amount": 0.1,
              "currency": "sei",
              "validatorAddress": "seivaloper1qmpxlswwk42wya67t7zsaawf3vur03cuevss0h",
              "stashAccountAddress": "sei18fzgvzy3h0q646wq2nwz42zrt5xsryusf8jmmp",
              "rewardDestinationAddress": "sei18fzgvzy3h0q646wq2nwz42zrt5xsryusf8jmmp"
          }
      }
  }
  ```
</CodeGroup>

* `unsignedTransactionData` — unsigned transaction in Base64 encrypted format. It is the list of data fields to be used to construct the staking transactions.

  * `messages`:

    * `typeUrl` — Sei network operation type.

    * `delegatorAddress` — delegator address.

    * `validatorAddress` — validator address.

    * `amount` — amount of tokens to unstake.

    * `denom` — currency of tokens:

      * `sei` — SEI native staking token.
      * `usei` — 1 SEI = 10⁶ uSEI.
      * `msei` — 1 SEI = 10³ mSEI.

  * `fee` — fee charged for processing the transaction.

    * `amount` — amount of tokens.
    * `denom` — currency of tokens: `sei`, `usei`, or `msei`.
    * `gas` — amount of gas spent for the transaction.

  * `memo` — arbitrary text data to add to the transactions.

  * `encodedBody` — processable transaction data encoded in the hexadecimal format.

  * `encodedAuthInfo` — authorization data, including fee, encoded in the hexadecimal format.

  * `messageHash` — hash of the transaction.

* `createdAt` — timestamp of the transaction in the ISO 8601 format.

* `extraData` — additional transaction details:

  * `amount` — amount of tokens to unstake in SEI.
  * `currency` — currency of tokens: `sei`, `usei`, or `msei`.
  * `validatorAddress` — validator address from which tokens are delegated.
  * `stashAccountAddress` — staking account address keeping the staked tokens.
  * `rewardDestinationAddress` — rewards destination account address.

### 2. Sign and send transaction

Use `unsignedTransactionData` to [sign and send](/docs/unified-api-signing-transaction) the transaction following the Sei-specific signing logic.


## Related topics

- [Unified API Reference](/reference/unified-create-stake-transaction.md)
- [Integration Workflow Example](/docs/unified-api-getting-started.md)
- [Networks Supported](/docs/unified-api-networks.md)
