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

# Submit Raw Transaction

> *Alpha.* Sandbox only, on testnets; not available in production. Sign a customer-built EVM transaction with an account's wallet and return it for you to broadcast. You supply the nonce, gas limit, and fees.



## OpenAPI

````yaml /v2/openapi.yaml post /v2/crypto/raw-transactions
openapi: 3.1.0
info:
  title: Bastion APIs
  description: API documentation for Bastion APIs
  version: '2.0'
servers:
  - url: https://api.prod.bastion.com
    description: Production environment
  - url: https://api.sandbox.bastion.io
    description: Sandbox environment
security:
  - auth: []
tags:
  - name: Bastion APIs
paths:
  /v2/crypto/raw-transactions:
    post:
      tags:
        - Raw Transactions
      summary: Submit Raw Transaction
      description: >-
        *Alpha.* Sandbox only, on testnets; not available in production. Sign a
        customer-built EVM transaction with an account's wallet and return it
        for you to broadcast. You supply the nonce, gas limit, and fees.
      operationId: bastion.api.v2.API.SubmitRawTransaction
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/bastion.api.v2.cryptocurrency.SubmitRawTransactionRequest
        required: true
      responses:
        '201':
          description: Success
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/bastion.api.v2.cryptocurrency.RawTransaction
        '400':
          description: Bad request
        '401':
          description: Unauthorized Request
        '403':
          description: Request Forbidden
        '404':
          description: Not found
        '409':
          description: Conflict - request_id already used for a different raw transaction
        '422':
          description: >-
            Unprocessable Entity - identity or account state does not permit
            this operation
        '500':
          description: Internal Server Error
      servers:
        - url: https://api.sandbox.bastion.io
          description: Sandbox environment
components:
  schemas:
    bastion.api.v2.cryptocurrency.SubmitRawTransactionRequest:
      type: object
      anyOf:
        - type: object
          properties:
            eip1559_transaction:
              allOf:
                - $ref: >-
                    #/components/schemas/bastion.api.v2.cryptocurrency.RawEip1559Transaction
              title: eip1559_transaction
          title: eip1559_transaction
        - type: object
          properties:
            legacy_transaction:
              allOf:
                - $ref: >-
                    #/components/schemas/bastion.api.v2.cryptocurrency.RawLegacyTransaction
              title: legacy_transaction
          title: legacy_transaction
      unevaluatedProperties: false
      not:
        allOf:
          - anyOf:
              - required:
                  - eip1559_transaction
              - required:
                  - legacy_transaction
          - not:
              oneOf:
                - required:
                    - eip1559_transaction
                - required:
                    - legacy_transaction
      properties:
        request_id:
          type: string
          title: request_id
          pattern: >-
            [a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}
          format: uuid
          description: Request identifier in a UUID format. Serves as an idempotency key.
        account_id:
          type: string
          title: account_id
          description: Account whose wallet signs the transaction
        chain:
          allOf:
            - $ref: '#/components/schemas/bastion.common.Chain'
          title: chain
          description: >-
            Testnet chain the transaction is for. The chain ID in the signed
            transaction is derived from this value.
        mode:
          allOf:
            - $ref: >-
                #/components/schemas/bastion.api.v2.cryptocurrency.RawTransaction.Mode
          title: mode
          description: >-
            What Bastion does with the transaction. Only SIGN_ONLY is supported
            in the sandbox preview.
      required:
        - request_id
        - account_id
        - chain
        - mode
    bastion.api.v2.cryptocurrency.RawTransaction:
      type: object
      anyOf:
        - type: object
          properties:
            eip1559_transaction:
              allOf:
                - $ref: >-
                    #/components/schemas/bastion.api.v2.cryptocurrency.RawEip1559Transaction
              title: eip1559_transaction
          title: eip1559_transaction
        - type: object
          properties:
            legacy_transaction:
              allOf:
                - $ref: >-
                    #/components/schemas/bastion.api.v2.cryptocurrency.RawLegacyTransaction
              title: legacy_transaction
          title: legacy_transaction
      unevaluatedProperties: false
      not:
        allOf:
          - anyOf:
              - required:
                  - eip1559_transaction
              - required:
                  - legacy_transaction
          - not:
              oneOf:
                - required:
                    - eip1559_transaction
                - required:
                    - legacy_transaction
      properties:
        id:
          type: string
          title: id
          description: Unique identifier of the raw transaction
          readOnly: true
        request_id:
          type: string
          title: request_id
          description: Request identifier supplied at creation
        account_id:
          type: string
          title: account_id
          description: Account whose wallet signs the transaction
        chain:
          allOf:
            - $ref: '#/components/schemas/bastion.common.Chain'
          title: chain
          description: Chain the transaction is for
        status:
          allOf:
            - $ref: >-
                #/components/schemas/bastion.api.v2.cryptocurrency.RawTransaction.Status
          title: status
          readOnly: true
        preview:
          allOf:
            - $ref: >-
                #/components/schemas/bastion.api.v2.cryptocurrency.RawTransactionPreview
          title: preview
          readOnly: true
        from_address:
          type: string
          title: from_address
          description: Address that signs and sends the transaction
          readOnly: true
        nonce:
          type: string
          title: nonce
          description: Nonce the transaction was signed at, as a decimal string
          readOnly: true
        transaction_hash:
          type: string
          title: transaction_hash
          description: Hash of the signed transaction; empty until signed
          readOnly: true
        created_at:
          type: string
          title: created_at
          readOnly: true
        updated_at:
          type: string
          title: updated_at
          readOnly: true
        signed_transaction:
          type: string
          title: signed_transaction
          description: >-
            Signed transaction, 0x-prefixed, ready for eth_sendRawTransaction.
            Returned by Submit Raw Transaction.
          readOnly: true
    bastion.api.v2.cryptocurrency.RawEip1559Transaction:
      type: object
      properties:
        to:
          type: string
          title: to
          description: Recipient or contract address, 0x-prefixed
        value:
          type: string
          title: value
          description: >-
            Amount of the chain's base asset to send, in wei, as a decimal
            string
        data:
          type: string
          title: data
          description: Calldata, 0x-prefixed hex. Omit for a plain value transfer.
        gas_limit:
          type: string
          title: gas_limit
          description: Gas limit, as a decimal string
        max_fee_per_gas:
          type: string
          title: max_fee_per_gas
          description: Maximum total fee per gas, in wei, as a decimal string
        max_priority_fee_per_gas:
          type: string
          title: max_priority_fee_per_gas
          description: Maximum priority fee per gas, in wei, as a decimal string
        nonce:
          type: string
          title: nonce
          description: >-
            Account nonce, as a decimal string. It must not be below the
            account's confirmed nonce on chain.
      title: RawEip1559Transaction
      required:
        - to
        - gas_limit
        - max_fee_per_gas
        - max_priority_fee_per_gas
        - nonce
      additionalProperties: false
    bastion.api.v2.cryptocurrency.RawLegacyTransaction:
      type: object
      properties:
        to:
          type: string
          title: to
          description: Recipient or contract address, 0x-prefixed
        value:
          type: string
          title: value
          description: >-
            Amount of the chain's base asset to send, in wei, as a decimal
            string
        data:
          type: string
          title: data
          description: Calldata, 0x-prefixed hex. Omit for a plain value transfer.
        gas_limit:
          type: string
          title: gas_limit
          description: Gas limit, as a decimal string
        gas_price:
          type: string
          title: gas_price
          description: Gas price, in wei, as a decimal string
        nonce:
          type: string
          title: nonce
          description: >-
            Account nonce, as a decimal string. It must not be below the
            account's confirmed nonce on chain.
      title: RawLegacyTransaction
      required:
        - to
        - gas_limit
        - gas_price
        - nonce
      additionalProperties: false
    bastion.common.Chain:
      type: string
      title: Chain
      enum:
        - CHAIN_UNSPECIFIED
        - ETHEREUM_MAINNET
        - POLYGON_MAINNET
        - ETHEREUM_TESTNET
        - OPTIMISM_SEPOLIA
        - BASE_MAINNET
        - BASE_SEPOLIA
        - OPTIMISM_MAINNET
        - POLYGON_AMOY
        - SOLANA_MAINNET
        - SOLANA_DEVNET
      description: Chain identifier
      example: ETHEREUM_MAINNET
    bastion.api.v2.cryptocurrency.RawTransaction.Mode:
      type: string
      title: Mode
      enum:
        - MODE_UNSPECIFIED
        - SIGN_ONLY
      description: |-
        What Bastion does with a raw transaction.

         - `SIGN_ONLY`: Sign it and return the signed transaction for you to broadcast.
      example: SIGN_ONLY
    bastion.api.v2.cryptocurrency.RawTransaction.Status:
      type: string
      title: Status
      enum:
        - STATUS_UNSPECIFIED
        - CREATED
        - SIGNED
      description: |-
        Status of a raw transaction.

         - `STATUS_UNSPECIFIED`: Not known yet; keep polling.
         - `CREATED`: Stored, but signing did not complete. Retry the request with the same request_id.
         - `SIGNED`: Signed. In sign-only mode Bastion does not broadcast, so the transaction stays SIGNED.

         New statuses may be added; treat an unknown value as not yet final.
      example: CREATED
    bastion.api.v2.cryptocurrency.RawTransactionPreview:
      type: object
      properties:
        will_revert:
          type: boolean
          title: will_revert
          description: >-
            True when estimating the transaction from the account's address
            reverts
        revert_reason:
          type: string
          title: revert_reason
        gas_estimate:
          type: string
          title: gas_estimate
          description: Estimated gas, as a decimal string
      title: RawTransactionPreview
      additionalProperties: false
      description: >-
        What the transaction is expected to do, estimated from the account's
        address before signing. Informational
         only: it never blocks signing.
  securitySchemes:
    auth:
      type: http
      description: Bearer authentication with an API token
      scheme: bearer

````

## Related topics

- [Get Raw Transaction](/v2/api-reference/raw-transactions/get-raw-transaction.md)
- [Submit Cryptocurrency Transfer](/v2/api-reference/cryptocurrency-transfers/submit-cryptocurrency-transfer.md)
- [Off-ramp: Withdraw stablecoin internationally](/guides/quickstarts/off-ramp/international-bank-account.md)
- [Transaction limits API overview](/v2/api-reference/transaction-limits/overview.md)
- [Submit Conversion](/v2/api-reference/conversions/submit-conversion.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.