Sei

Unified API + Sei Integration Workflow

In the following guide, the integration process for the sei chain and pacific-1 network is covered. The Sei integration aligns with the general Unified API process but with network-specific parameters.

Get an authentication token to start using the Unified API.

Request examples are provided using cURL.

To check the integration guides for other chains, refer to the Networks section.

📘

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, min amount is 0.1.

Staking Flow

1. Create Staking Request

Send a POST request to /api/v1/unified/staking/stake.

Example request (for pacific-1 network):

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
}'

Example response:

{
    "error": null,
    "result": {
        "amount": 0.1,
        "stakerAddress": "sei18fzgvzy3h0q646wq2nwz42zrt5xsryusf8jmmp",
        "unsignedTransactionData": {
            "messages": [
                {
                    "typeUrl": "/cosmos.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"
        }
    }
}

2. Sign and Send Transaction

Use unsignedTransactionData to sign the transaction.

To broadcast the signed transaction to the Sei network, send a POST request to /api/v1/unified/transaction/broadcast.

Example request:

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"
}'

Example response:

{
    "error": null,
    "result": {
        "status": "success",
        "extraData": {
            "blockId": 135190135,
            "fee": 0.004850999999999999,
            "gas": {
                "used": 160707,
                "wanted": 194020
            },
            "transactionHash": "76EDCE98041DFA42615DEA1BF483AD4752D2C389B8B312DFEB4F5171F7F57BBD"
        }
    }
}

Unstaking Flow

1. Create Unstaking Request

Send a POST request to /api/v1/unified/staking/unstake.

Example request:

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
    }
}'

Example response:

{
    "error": null,
    "result": {
        "unsignedTransactionData": {
            "messages": [
                {
                    "typeUrl": "/cosmos.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"
        }
    }
}

2. Sign and Send Transaction

Use unsignedTransactionData to sign and send the transaction following the Sei-specific signing logic.

What's Next?