# Onroad

# On-road Module

The definition of "OnRoad" is actually used to describe the state of a transaction. It specifically refers to request transaction which has not been received and has open, pending receive status. The BlockType of on-road transaction is usually represented as 1, 2, 3 or 6, which in turn correspond to 'send a transaction to create a contract', 'make a transfer or call contract', 'send a transaction to get reward' and 'send a transaction to refund.'

This concept is often confusing with unconfirmed transactions. The latter are actually transactions not snapshoted. All transactions are stored in ledger, including request transactions and respond transactions, while the terms "onroad" and "unconfirmed" are just used to describe the different states of transactions. All onroad are request transactions, while an unconfirmed transaction can be either request or respond.

# onroad_getOnroadBlocksByAddress

Return all open transactions waiting to be received by specified account

  • Parameters:

    • Address: Account address
    • uint64: Page index
    • uint64: Page size up to 256
  • Return:

    • []AccountBlock Account block list
  • Example:

# onroad_getOnroadInfoByAddress

Return the information of tokens in all open transactions waiting to be received by specified account

  • Parameters:

    • Address- Account address
  • Return:

    • []Object:
      • accountAddress: Address Account address
      • totalNumber: string Total open transaction number
      • tokenBalanceInfoMap: Map[tokenId]Object
        • tokenInfo: Object Token information
          • tokenName: string Token name
          • tokenSymbol: string Token symbol
          • tokenId: TokenId Token Id
          • totalSupply: *string Total supply
          • decimals: uint8 Decimal digits
          • owner: Address Owner's address
          • maxSupply: *string Max supply
          • ownerBurnOnly: bool Whether the token can be burned by the owner only
          • isReIssuable: bool Whether the token can be re-issued
          • index: uint16 index
        • totalAmount: *string Total pending amount in this token
        • number: string Total open transaction number in this token
  • Example:

# onroad_getOnroadBlocksInBatch

Return all open transactions waiting to be received by a list of specified accounts

  • Parameters:

[]Object: Up to 10 accounts

  • Address: Account address
  • uint64: Page index
  • uint64: Page size up to 256
  • Return:

    • map[Address][]AccountBlock
  • Example:

# onroad_getOnroadInfoInBatch

Return the information of tokens in all open transactions waiting to be received by a list of specified accounts

  • Parameters:

    • []Address- Account addresses, up to 10
  • Return:

    • []Object:
      • accountAddress: Address Account address
      • totalNumber: string Total number
      • tokenBalanceInfoMap: Map[tokenId]Object
        • tokenInfo: Object Token information
          • tokenName: string Token name
          • tokenSymbol: string Token symbol
          • tokenId: TokenId Token Id
          • totalSupply: *string Total supply
          • decimals: uint8 Decimal digits
          • owner: Address Owner's address
          • maxSupply: *string Max supply
          • ownerBurnOnly: bool Whether the token can be burned by the owner only
          • isReIssuable: bool Whether the token can be re-issued
          • index: uint16 index
        • totalAmount: *string Total pending amount in this token
        • number: string Total open transaction number in this token
  • Example: