Skip to main content
On Cosmos SDK chains, unsignedTransaction is a hex-encoded protobuf SignDoc, built for direct (protobuf) signing, not amino. Decode it, sign it exactly as returned, and never rebuild it from chain state: the SignDoc already embeds the account’s sequence, the fee, and the gas, and resigning a rebuilt document produces a signature over different bytes that the chain rejects.

Prerequisites

  • An action’s transactions[]; see Transaction signing for decoding by chain family and Enter and exit flows for the request and poll loop.
  • A Cosmos wallet capable of direct signing, such as DirectSecp256k1HdWallet from @cosmjs/proto-signing.
  • The cosmosPubKey argument: a bech32-encoded public key (cosmospub1...), required by most Cosmos yields’ mechanics.arguments.enter.fields alongside amount and, for native staking, validatorAddress. Confirm the exact required fields per yield before building the request; do not assume every Cosmos yield needs all three.

Decode, sign, and submit

Submit the signed transaction instead

To hand Yield.xyz the signed bytes rather than broadcasting yourself, call POST /v1/transactions/{tx.id}/submit with { "signedTransaction": ... } instead of submit-hash. Use one path per transaction, never both. See Transaction signing for when each fits.
A missing or misplaced cosmosPubKey is the most common Cosmos error: POST /v1/actions/enter (or /exit) returns 400 Bad Request. Send it as a flat field inside arguments, alongside amount and validatorAddress, not nested under any wrapper.

Next steps

Transaction signing

The shared contract across chain families: decode, validate, sign, submit.

Enter and exit flows

Build the request, branch on executionPattern, and poll to a terminal status.