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

# Preview Bundle

> This endpoint allows you to preview a bundle of transactions as it would execute on chain and returns results for each transaction.

<Snippet file="header-project-id.mdx" />


## OpenAPI

````yaml post /transactions/preview-bundle
openapi: 3.0.1
info:
  title: WalletKit
  version: 0.0.1
servers:
  - url: https://testnet.walletkit.com
    description: testnet
  - url: https://mainnet.walletkit.com
    description: mainnet
security: []
paths:
  /transactions/preview-bundle:
    post:
      tags:
        - Transactions
      summary: Preview Bundle
      description: >-
        This endpoint allows you to preview a bundle of transactions as it would
        execute on chain and returns results for each transaction.
      operationId: transactions_preview-bundle
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                network:
                  $ref: '#/components/schemas/Network'
                from:
                  type: string
                  description: sender of the transaction.
                unsigned_transactions:
                  type: array
                  items:
                    $ref: '#/components/schemas/UnsignedTransaction'
                  description: a bundle of transactions to preview.
              required:
                - network
                - from
                - unsigned_transactions
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PreviewResponse'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    Network:
      title: Network
      type: string
      enum:
        - Ethereum
        - Polygon
        - Base
        - Avalanche
        - Polkadot
        - Vara
    UnsignedTransaction:
      title: UnsignedTransaction
      type: object
      description: input of a transaction.
      properties:
        to:
          type: string
          description: >-
            smart contract address or external owned account address to interact
            with
        value:
          type: string
          nullable: true
          description: >-
            optional. amount of native token to be transferred to the to address
            in this transactio in hex-encoded with 0x prefix.
        input:
          type: string
          nullable: true
          description: >-
            If it's a smart contract interaction, the hex-encoded calldata of
            the smart contract function. (ABI-encoded function with arguments)
        gasLimit:
          type: string
          nullable: true
          description: >-
            optional. hex-encoded with 0x prefix. maximum amount unit of gas to
            be used in this transaction. If provided,  it will override the gas
            limit estimated by eth_estimateGas.
        maxPriorityFeePerGas:
          type: string
          nullable: true
          description: >-
            optional. hex-encoded with 0x prefix. If provided, it will override
            the gas tip estimated by eth_maxPriorityFeePerGas.
        maxFeePerGas:
          type: string
          nullable: true
          description: >-
            optional. hex-encoded with 0x prefix. maximum amount of native token
            to be paid per unit of gas in this transaction.  If provided, it
            will override the gas fee cap estimated by WalletKit.
        nonce:
          type: string
          nullable: true
          description: >-
            optional. hex-encoded with 0x prefix. the number of transactions
            made by the sender prior to this one.
      required:
        - to
    PreviewResponse:
      title: PreviewResponse
      type: object
      properties:
        network:
          $ref: '#/components/schemas/Network'
        from:
          type: string
        to:
          type: string
        contract:
          $ref: '#/components/schemas/AddressMetadata'
          nullable: true
        function_name:
          type: string
          nullable: true
        arguments:
          type: object
          additionalProperties: true
          nullable: true
        simulation:
          $ref: '#/components/schemas/Simulation'
          nullable: true
      required:
        - network
        - from
        - to
    ErrorResponse:
      title: ErrorResponse
      type: object
      properties:
        code:
          type: string
          nullable: true
        error:
          type: string
      required:
        - error
    AddressMetadata:
      title: AddressMetadata
      type: object
      properties:
        network:
          $ref: '#/components/schemas/Network'
        address:
          type: string
        type:
          $ref: '#/components/schemas/AddressType'
        name:
          type: string
          nullable: true
        logo_url:
          type: string
          nullable: true
        token:
          $ref: '#/components/schemas/Token'
          nullable: true
        nft:
          $ref: '#/components/schemas/NftCollection'
          nullable: true
      required:
        - network
        - address
        - type
    Simulation:
      title: Simulation
      type: object
      properties:
        success:
          type: boolean
        asset_changes:
          type: array
          items:
            $ref: '#/components/schemas/AssetChange'
          nullable: true
        error:
          type: string
          nullable: true
      required:
        - success
    AddressType:
      title: AddressType
      type: string
      enum:
        - token
        - nft
        - other
    Token:
      title: Token
      type: object
      properties:
        uuid:
          type: string
        network:
          $ref: '#/components/schemas/Network'
        contract_address:
          type: string
        name:
          type: string
        symbol:
          type: string
        decimals:
          type: integer
        display_decimals:
          type: integer
        logo_url:
          type: string
          nullable: true
      required:
        - uuid
        - network
        - contract_address
        - name
        - symbol
        - decimals
        - display_decimals
    NftCollection:
      title: NftCollection
      type: object
      properties:
        network:
          $ref: '#/components/schemas/Network'
        contract_address:
          type: string
        name:
          type: string
        symbol:
          type: string
          nullable: true
        image_url:
          type: string
      required:
        - network
        - contract_address
        - name
        - image_url
    AssetChange:
      title: AssetChange
      type: object
      properties:
        token:
          $ref: '#/components/schemas/Token'
          nullable: true
        nft:
          $ref: '#/components/schemas/Nft'
          nullable: true
        amount:
          type: string
        raw_amount:
          type: string
        from:
          type: string
        to:
          type: string
      required:
        - amount
        - raw_amount
        - from
        - to
    Nft:
      title: Nft
      type: object
      properties:
        metadata:
          $ref: '#/components/schemas/NftMetadata'
          nullable: true
        owner_wallet_address:
          type: string
        contract_address:
          type: string
        token_id:
          type: string
      required:
        - owner_wallet_address
        - contract_address
        - token_id
    NftMetadata:
      title: NftMetadata
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        image:
          type: string
      required:
        - name
        - description
        - image
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````