Osmosis
Unified API + Osmosis Integration Workflow
In the following guide, the integration process for the osmosis chain is covered. The Osmosis 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 Supported section.
Key Osmosis-specific details
chain— always set toosmosisfor Osmosis-related requests.network— environment in which the transaction is processed:osmosis-1orosmo-test-5(testnet).stakerAddress— account address initiating staking, unstaking or withdrawal transactions.amount— amount of tokens in OSMO (in uOSMO internally).
Staking flow
1. Create staking request
Send a POST request to /api/v1/unified/staking/stake.
Example request:
curl --request POST \
--url https://api.p2p.org/api/v1/unified/staking/stake \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data '{
{
"chain": "osmosis",
"network": "osmo-test-5",
"stakerAddress": "osmo1f3duxu3trtpmlkqkvth7774vwpanmwqn0fldr7",
"amount": "0.1",
"extra": {
"memo": "memo"
}
}'chain— blockchain network, always set toosmosisfor Osmosis-related requests.network— environment in which the transaction is processed:osmosis-1orosmo-test-5for testnet.stakerAddress— account address initiating the staking transaction.amount— amount of tokens to stake in OSMO.extra— additional request parameters:memo— arbitrary text data to add to the transactions.
Example response:
{
"error": null,
"result": {
"amount": 0.1,
"stakerAddress": "osmo1f3duxu3trtpmlkqkvth7774vwpanmwqn0fldr7",
"unsignedTransactionData": {
"messages": [
{
"typeUrl": "/cosmos.staking.v1beta1.MsgDelegate",
"value": {
"delegatorAddress": "osmo1f3duxu3trtpmlkqkvth7774vwpanmwqn0fldr7",
"validatorAddress": "osmovaloper1cyt930yx0xcmpy68k260cdlrt8g6v43d4at270",
"amount": {
"denom": "uosmo",
"amount": "100000"
}
}
}
],
"fee": {
"amount": [
{
"amount": "14835",
"denom": "uosmo"
}
],
"gas": "296685"
},
"memo": "memo",
"encodedBody": "0a99010a232f636f736d6f732e7374616b696e672e763162657461312e4d736744656c656761746512720a2b6f736d6f3166336475787533747274706d6c6b716b76746837373734767770616e6d77716e30666c64723712326f736d6f76616c6f7065723163797439333079783078636d707936386b32363063646c7274386736763433643461743237301a0f0a05756f736d6f120631303030303012046d656d6f",
"encodedAuthInfo": "0a500a460a1f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b657912230a2103a3f4504804072284290dfa67038a17cbfd63c8da8dd51100b4adc4c1884ba3c112040a020801180f12140a0e0a05756f736d6f1205313438333510ed8d12",
"messageHash": "6ad80d729ec47a1052e1aa727362ad86fa84a3e7d48bed8cec956c31cf4178e4"
},
"createdAt": "2025-11-28T14:43:56.273Z",
"extraData": {
"currency": "osmo",
"validatorAddress": "osmovaloper1cyt930yx0xcmpy68k260cdlrt8g6v43d4at270",
"rewardDestinationAddress": "osmo1f3duxu3trtpmlkqkvth7774vwpanmwqn0fldr7"
}
}
}amount— amount of tokens to stake in OSMO.stakerAddress— account address initiating the staking transaction.unsignedTransactionData— unsigned transaction in Base64 encrypted format. The object contains the list of data fields to be used to construct the staking transaction.messages— transaction messages for each staking operation.typeUrl— Cosmos SDK operation type.value— message payload, encoded in the hexadecimal format.delegatorAddress— account address initiating the delegation.validatorAddress— validator address receiving the delegation.amount.amount— amount of tokens to stake.amount.denom— currency of tokens, always set touosmo(1 OSMO = 10⁶ uOSMO).
fee— fee charged for processing the transaction.amount— amount of tokens.denom— currency of tokens inuosmo.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— unique identifier of the message in the Inter-Blockchain Communication (IBC) protocol used by Osmosis.
createdAt— timestamp of the transaction in ISO 8601 format.extraData— additional transaction details:currency— OSMO, Osmosis native staking token.validatorAddress— validator address to which tokens are delegated.rewardDestinationAddress— account address receiving the staking rewards.
2. Sign and send transaction
Use unsignedTransactionData to sign the transaction using the Osmosis-specific signing logic.
To broadcast the signed transaction to the Osmosis network, send a POST request to /api/v1/unified/transaction/broadcast.
Example request:
curl --request POST \
--url https://api.p2p.org/api/v1/unified/transaction/broadcast \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data '{
"chain": "osmosis",
"network": "osmo-test-5",
"stakerAddress": "osmo1f3duxu3trtpmlkqkvth7774vwpanmwqn0fldr7",
"signedTransaction": "0a9c010a99010a232f636f736d6f732e7374616b696e672e763162657461312e4d736744656c656761746512720a2b6f736d6f3166336475787533747274706d6c6b716b76746837373734767770616e6d77716e30666c64723712326f736d6f76616c6f7065723163797439333079783078636d707936386b32363063646c7274386736763433643461743237301a0f0a05756f736d6f120631303030303012680a500a460a1f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b657912230a2103a3f4504804072284290dfa67038a17cbfd63c8da8dd51100b4adc4c1884ba3c112040a020801180f12140a0e0a05756f736d6f1205313437343310c4ff111a4029c737bf8a84b3730ad45e96a5da8c4fe1495a13b0b036c3bf16e5866dd21d5c67c6b271f081a1e6e8eae4128e6862ccb333e864c228b3e264ccc4e3120b1c0f"
}'chain— blockchain network.network— environment in which the transaction is processed.stakerAddress— Osmosis account address initiating the staking transaction.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:
{
"error": null,
"result": {
"status": "success",
"extraData": {
"blockId": 42190426,
"fee": 0.014743,
"gas": {
"used": 200431,
"wanted": 294852
},
"transactionHash": "6A975DD90C8363A2C695147FACF3A0BE1522C8B8A75D8B25407F7A1F9F862674"
}
}
}status— transaction status:pending,success, orfailed.extraData— additional transaction details:blockId— unique identifier of the block in which the transaction has been included.fee— total fee in OSMO 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.
Example request:
curl --request POST \
--url https://api.p2p.org/api/v1/unified/staking/unstake \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data '{
"chain": "osmosis",
"network": "osmo-test-5",
"stakerAddress": "osmo1f3duxu3trtpmlkqkvth7774vwpanmwqn0fldr7",
"extra": {
"amount": 0.1
}
}'chain— blockchain network.network— environment in which the transaction is processed.stakerAddress— account address initiated the staking transaction.extra— additional request parameters:amount— amount of tokens to unstake in OSMO.
Example response:
{
"error": null,
"result": {
"unsignedTransactionData": {
"messages": [
{
"typeUrl": "/cosmos.staking.v1beta1.MsgUndelegate",
"value": {
"delegatorAddress": "osmo1f3duxu3trtpmlkqkvth7774vwpanmwqn0fldr7",
"validatorAddress": "osmovaloper1cyt930yx0xcmpy68k260cdlrt8g6v43d4at270",
"amount": {
"denom": "uosmo",
"amount": "100000"
}
}
}
],
"fee": {
"amount": [
{
"amount": "17460",
"denom": "uosmo"
}
],
"gas": "349191"
},
"memo": "",
"encodedBody": "0a9b010a252f636f736d6f732e7374616b696e672e763162657461312e4d7367556e64656c656761746512720a2b6f736d6f3166336475787533747274706d6c6b716b76746837373734767770616e6d77716e30666c64723712326f736d6f76616c6f7065723163797439333079783078636d707936386b32363063646c7274386736763433643461743237301a0f0a05756f736d6f1206313030303030",
"encodedAuthInfo": "0a500a460a1f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b657912230a2103a3f4504804072284290dfa67038a17cbfd63c8da8dd51100b4adc4c1884ba3c112040a020801180f12140a0e0a05756f736d6f120531373436301087a815",
"messageHash": "7d7f5b94c0e85a8a88916d20921e93d4248df0f22c36f33a7cd2f8a1dcc894e3"
},
"createdAt": "2025-11-28T14:44:02.818Z",
"extraData": {
"amount": 0.1,
"currency": "osmo",
"validatorAddress": "osmovaloper1cyt930yx0xcmpy68k260cdlrt8g6v43d4at270",
"stashAccountAddress": "osmo1f3duxu3trtpmlkqkvth7774vwpanmwqn0fldr7",
"rewardDestinationAddress": "osmo1f3duxu3trtpmlkqkvth7774vwpanmwqn0fldr7"
}
}
}unsignedTransactionData— unsigned transaction in Base64 encrypted format. The object contains the list of data fields to be used to construct the unstaking transaction.messages— transaction messages for each staking operation.typeUrl— Cosmos SDK operation type.value— message payload, encoded in the hexadecimal format.delegatorAddress— delegator address.validatorAddress— validator address.amount.amount— amount of tokens to unstake.amount.denom— currency of tokens, always set touosmo(1 OSMO = 10⁶ uOSMO).
fee— fee charged for processing the transaction.amount— amount of tokens.denom— currency of tokens inuosmo.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— unique identifier of the message in the Inter-Blockchain Communication (IBC) protocol used by Osmosis.
createdAt— timestamp of the transaction in the ISO 8601 format.extraData— additional transaction details:amount— amount of tokens to unstake in OSMO.currency— currency of tokens:osmo,uosmo, ormosmo.validatorAddress— validator address from which tokens are delegated.stashAccountAddres— staking account address keeping the staked tokens.rewardDestinationAddress— rewards destination account address.
2. Sign and send transaction
Use unsignedTransactionData to sign and send the transaction following the Osmosis-specific signing logic.
What's next?
Updated about 11 hours ago