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

# Validate Transaction

> Validates a transaction's format and checks it against the blockchain's current state for potential errors or warnings. This pre-validation is critical for ensuring transaction success rates and for debugging transaction issues.



## OpenAPI

````yaml openapi.json post /api/{chainId}/transaction/validate
openapi: 3.1.0
info:
  title: Adamik
  version: 0.1.0
  description: Adamik API reference
servers:
  - url: https://api.adamik.io
security:
  - ApiKeyAuth: []
paths:
  /api/{chainId}/transaction/validate:
    post:
      tags:
        - Transaction
      summary: Validate Transaction
      description: >-
        Validates a transaction's format and checks it against the blockchain's
        current state for potential errors or warnings. This pre-validation is
        critical for ensuring transaction success rates and for debugging
        transaction issues.
      parameters:
        - in: path
          name: chainId
          schema:
            type: string
            enum:
              - algorand
              - cosmoshub
              - cosmoshub-testnet
              - osmosis
              - osmosis-testnet
              - celestia
              - celestia-testnet
              - dydx
              - axelar
              - ethereum
              - sepolia
              - holesky
              - zksync
              - zksync-sepolia
              - injective-evm-testnet
              - base
              - base-sepolia
              - optimism
              - optimism-sepolia
              - arbitrum
              - arbitrum-sepolia
              - bitcoin
              - bitcoin-testnet
              - bitcoin-signet
              - polygon
              - polygon-amoy
              - bsc
              - bsc-testnet
              - linea
              - linea-sepolia
              - avalanche
              - avalanche-fuji
              - gnosis
              - gnosis-chiado
              - moonbeam
              - moonriver
              - moonbase
              - fantom
              - mantle
              - litecoin
              - dogecoin
              - ton
              - chiliz
              - chiliz-testnet
              - injective
              - akash
              - band
              - dymension
              - kyve
              - neutron
              - terra2
              - stargaze
              - tron
              - evmos
              - irisnet
              - juno
              - lum-network
              - omniflix
              - sei
              - medibloc
              - passage
              - quasar
              - seda
              - sommelier
              - shentu
              - stride
              - chihuahua
              - bitsong
              - persistence
              - comdex
              - fetch-ai
              - humans-ai
              - ki
              - likecoin
              - mars-hub
              - provenance
              - quicksilver
              - saga
              - ux-chain
              - kava
              - starknet
              - babylon
              - babylon-testnet
              - monad-testnet
              - berachain
              - berachain-artio
              - cronos
              - world-chain
          required: true
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                transaction:
                  type: object
                  properties:
                    data:
                      allOf:
                        - type: object
                          properties:
                            memo:
                              type: string
                              description: >-
                                Optional free text field, that is supported for
                                some chains.
                            format:
                              type: string
                              enum:
                                - json
                                - hex
                              description: >-
                                Controls the format of the returned encoded
                                transaction. DEPRECATED, will be reworked at
                                some point.
                        - oneOf:
                            - type: object
                              properties:
                                mode:
                                  type: string
                                  const: deployAccount
                                senderPubKey:
                                  type: string
                                  description: >-
                                    Public key of the sender account, required
                                    in some situations. It is advised to provide
                                    it by default if you can.
                                contractType:
                                  type: string
                                  enum:
                                    - argentx
                                  description: >-
                                    Provider of the account contract. Only
                                    ArgentX is supported at the moment.
                                  default: argentx
                              required:
                                - mode
                                - senderPubKey
                              title: Deploy Account
                              description: Deploy a smart contract wallet account
                            - type: object
                              properties:
                                mode:
                                  type: string
                                  const: transfer
                                senderAddress:
                                  type: string
                                  description: Address or ID of the sender account.
                                senderPubKey:
                                  type: string
                                  description: >-
                                    Public key of the sender account, required
                                    in some situations. It is advised to provide
                                    it by default if you can.
                                recipientAddress:
                                  type: string
                                  description: Address or ID of the recipient account.
                                amount:
                                  type: string
                                  description: >-
                                    Optional amount to use (always in smallest
                                    unit). Use either this or useMaxAmount.
                                useMaxAmount:
                                  type: boolean
                                  description: >-
                                    Option to let the API compute the amount to
                                    use all available funds. Either use this or
                                    provide amount.
                                  default: false
                              required:
                                - mode
                                - senderAddress
                                - recipientAddress
                              title: Transfer
                              description: Transfer chain native coins
                            - type: object
                              properties:
                                mode:
                                  type: string
                                  const: stake
                                senderAddress:
                                  type: string
                                  description: Address or ID of the sender account.
                                senderPubKey:
                                  type: string
                                  description: >-
                                    Public key of the sender account, required
                                    in some situations. It is advised to provide
                                    it by default if you can.
                                sourceValidatorAddress:
                                  type: string
                                  description: >-
                                    Address or ID of a validator. Can be used to
                                    move staking funds from this validator
                                    instead of the sender's balance, if
                                    supported by the chain.
                                targetValidatorAddress:
                                  type: string
                                  description: Address or ID of a validator
                                amount:
                                  type: string
                                  description: >-
                                    Optional amount to use (always in smallest
                                    unit). Use either this or useMaxAmount.
                                useMaxAmount:
                                  type: boolean
                                  description: >-
                                    Option to let the API compute the amount to
                                    use all available funds. Either use this or
                                    provide amount.
                                  default: false
                              required:
                                - mode
                                - senderAddress
                                - targetValidatorAddress
                              title: Stake
                              description: Put some funds at stake
                            - type: object
                              properties:
                                mode:
                                  type: string
                                  const: transferToken
                                tokenId:
                                  type: string
                                  description: >-
                                    Unique ID of the token to transfer (e.g
                                    contract address for EVM chains)
                                senderAddress:
                                  type: string
                                  description: Address or ID of the sender account.
                                senderPubKey:
                                  type: string
                                  description: >-
                                    Public key of the sender account, required
                                    in some situations. It is advised to provide
                                    it by default if you can.
                                recipientAddress:
                                  type: string
                                  description: Address or ID of the recipient account.
                                amount:
                                  type: string
                                  description: >-
                                    Optional amount to use (always in smallest
                                    unit). Use either this or useMaxAmount.
                                useMaxAmount:
                                  type: boolean
                                  description: >-
                                    Option to let the API compute the amount to
                                    use all available funds. Either use this or
                                    provide amount.
                                  default: false
                              required:
                                - mode
                                - tokenId
                                - senderAddress
                                - recipientAddress
                              title: Transfer Token
                              description: Transfer chain tokens
                            - type: object
                              properties:
                                mode:
                                  type: string
                                  const: unstake
                                senderAddress:
                                  type: string
                                  description: Address or ID of the sender account.
                                senderPubKey:
                                  type: string
                                  description: >-
                                    Public key of the sender account, required
                                    in some situations. It is advised to provide
                                    it by default if you can.
                                validatorAddress:
                                  type: string
                                  description: Address or ID of a validator
                                stakeId:
                                  type: string
                                  description: >-
                                    Unique identifier of a staking position.
                                    Only required for Babylon staking at the
                                    moment (documentation will come soon).
                                amount:
                                  type: string
                                  description: >-
                                    Optional amount to use (always in smallest
                                    unit). Use either this or useMaxAmount.
                                useMaxAmount:
                                  type: boolean
                                  description: >-
                                    Option to let the API compute the amount to
                                    use all available funds. Either use this or
                                    provide amount.
                                  default: false
                              required:
                                - mode
                                - senderAddress
                                - validatorAddress
                              title: Unstake
                              description: Stop staking some funds
                            - type: object
                              properties:
                                mode:
                                  type: string
                                  const: claimRewards
                                senderAddress:
                                  type: string
                                  description: Address or ID of the sender account.
                                senderPubKey:
                                  type: string
                                  description: >-
                                    Public key of the sender account, required
                                    in some situations. It is advised to provide
                                    it by default if you can.
                                validatorAddress:
                                  type: string
                                  description: Address or ID of a validator
                                stakeId:
                                  type: string
                                  description: >-
                                    Unique identifier of a staking position.
                                    Only required for Babylon staking at the
                                    moment (documentation will come soon).
                                compound:
                                  type: boolean
                                  description: >-
                                    When available for the chain, controls
                                    whether staking rewards are cashed or added
                                    to the staked funds.
                                  default: false
                              required:
                                - mode
                                - senderAddress
                                - validatorAddress
                              title: Claim Rewards
                              description: Retrieve rewards from staking
                            - type: object
                              properties:
                                mode:
                                  type: string
                                  const: withdraw
                                senderPubKey:
                                  type: string
                                  description: >-
                                    Public key of the sender account, required
                                    in some situations. It is advised to provide
                                    it by default if you can.
                                validatorAddress:
                                  type: string
                                  description: Address or ID of a validator
                                stakeId:
                                  type: string
                                  description: >-
                                    Unique identifier of a staking position.
                                    Only required for Babylon staking at the
                                    moment (documentation will come soon).
                              required:
                                - mode
                                - senderPubKey
                                - validatorAddress
                                - stakeId
                              title: Withdraw Unlocked Funds
                              description: >-
                                Only supported for Babylon staking at the moment
                                (documentation will come soon).
                            - type: object
                              properties:
                                mode:
                                  type: string
                                  const: registerStake
                                senderPubKey:
                                  type: string
                                  description: >-
                                    Public key of the sender account, required
                                    in some situations. It is advised to provide
                                    it by default if you can.
                                senderForeignPubKey:
                                  type: string
                                  description: Staker's pubkey on the foreign chain. (hex)
                                senderAddress:
                                  type: string
                                  description: Address or ID of the sender account.
                                proofOfPossession:
                                  type: string
                                  description: >-
                                    staker's address on this chain, signed with
                                    the foreign chain's signer. (hex)
                                amount:
                                  type: string
                                  description: Staked amount on the foreign chain.
                                validatorPubKey:
                                  type: string
                                  description: >-
                                    Validator's pubkey on the foreign chain.
                                    (hex)
                                unsignedUnbondingTransaction:
                                  type: string
                                  description: >-
                                    Unsigned unbonding transaction on the
                                    foreign chain (as provided in the response
                                    of the encode request for the stake
                                    transaction).
                                signedStakingTransaction:
                                  type: string
                                  description: >-
                                    Signed staking transaction on the foreign
                                    chain (hex).
                                signedSlashingTransaction:
                                  type: string
                                  description: >-
                                    Signed slashing transaction on the foreign
                                    chain (hex).
                                signedUnbondingSlashingTransaction:
                                  type: string
                                  description: >-
                                    Signed unbonding slashing transaction on the
                                    foreign chain (hex).
                              required:
                                - mode
                                - senderPubKey
                                - senderForeignPubKey
                                - senderAddress
                                - proofOfPossession
                                - amount
                                - validatorPubKey
                                - unsignedUnbondingTransaction
                                - signedStakingTransaction
                                - signedSlashingTransaction
                                - signedUnbondingSlashingTransaction
                              title: Register Stake
                              description: >-
                                Only supported for Babylon staking at the moment
                                (documentation will come soon).
                  required:
                    - data
              required:
                - transaction
      responses:
        '200':
          description: >-
            Provides validation results, including any errors or warnings
            related to the transaction.
          content:
            application/json:
              schema:
                type: object
                properties:
                  chainId:
                    type: string
                    enum:
                      - algorand
                      - cosmoshub
                      - cosmoshub-testnet
                      - osmosis
                      - osmosis-testnet
                      - celestia
                      - celestia-testnet
                      - dydx
                      - axelar
                      - ethereum
                      - sepolia
                      - holesky
                      - zksync
                      - zksync-sepolia
                      - injective-evm-testnet
                      - base
                      - base-sepolia
                      - optimism
                      - optimism-sepolia
                      - arbitrum
                      - arbitrum-sepolia
                      - bitcoin
                      - bitcoin-testnet
                      - bitcoin-signet
                      - polygon
                      - polygon-amoy
                      - bsc
                      - bsc-testnet
                      - linea
                      - linea-sepolia
                      - avalanche
                      - avalanche-fuji
                      - gnosis
                      - gnosis-chiado
                      - moonbeam
                      - moonriver
                      - moonbase
                      - fantom
                      - mantle
                      - litecoin
                      - dogecoin
                      - ton
                      - chiliz
                      - chiliz-testnet
                      - injective
                      - akash
                      - band
                      - dymension
                      - kyve
                      - neutron
                      - terra2
                      - stargaze
                      - tron
                      - evmos
                      - irisnet
                      - juno
                      - lum-network
                      - omniflix
                      - sei
                      - medibloc
                      - passage
                      - quasar
                      - seda
                      - sommelier
                      - shentu
                      - stride
                      - chihuahua
                      - bitsong
                      - persistence
                      - comdex
                      - fetch-ai
                      - humans-ai
                      - ki
                      - likecoin
                      - mars-hub
                      - provenance
                      - quicksilver
                      - saga
                      - ux-chain
                      - kava
                      - starknet
                      - babylon
                      - babylon-testnet
                      - monad-testnet
                      - berachain
                      - berachain-artio
                      - cronos
                      - world-chain
                  status:
                    type: object
                    properties:
                      errors:
                        type: array
                        items:
                          type: object
                          properties:
                            message:
                              type: string
                          required:
                            - message
                      warnings:
                        type: array
                        items:
                          type: object
                          properties:
                            message:
                              type: string
                          required:
                            - message
                    required:
                      - errors
                      - warnings
                required:
                  - chainId
                  - status
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization

````