# Algorand Mainnet

## Description
SAP integration enabling sophisticated application development on top of the Algorand's pure Proof of Stake blockchain platform. The API gives the interoperability between SAP enterprise applications and the distributed ledger.

## Version
1.0

## Contact
Email: solutions@alphacons.gr

## Security Definitions
### apikeyAuth
- Type: apiKey
- In: header
- Name: X-API-Key

## Servers
### SAP Integration Endpoint
- URL:  https://{host}.{region}.hana.ondemand.com/{basepath}
- Description: SAP integration enabling sophisticated application development on top of the Algorand platform

### Templates
- **host**: Default: acdevapi1.prod.apimanagement
- **region**: Default: us10
- **basepath**: Default: sapalgo/mainnet/

## Paths
### /health
- **GET**: Returns OK if healthy.
  - **Operation ID**: HealthCheck
  - **Responses**:
    - 200: The node is running.
    - default: Unknown Error

### /metrics
- **GET**: Returns API metrics.
  - **Operation ID**: Metrics
  - **Responses**:
    - 200: Response contains metrics about algod
    - 404: metrics were compiled out

### /v2/accounts/{address}
- **GET**: Get account information.
  - **Operation ID**: AccountInformation
  - **Parameters**:
    - **address**: An account public key (required)
  - **Responses**:
    - 200: Returns account response
    - 400: Malformed address
    - 500: Internal Error
    - default: Unknown Error

### /v2/accounts/{address}/transactions/pending
- **GET**: Get a list of unconfirmed transactions currently in the transaction pool by address.
  - **Operation ID**: GetPendingTransactionsByAddress
  - **Parameters**:
    - **address**: An account public key (required)
  - **Responses**:
    - 200: Returns pending transactions response
    - 400: Max must be a non-negative integer
    - 500: Internal Error
    - 503: Service Temporarily Unavailable
    - default: Unknown Error

### /v2/blocks/{round}
- **GET**: Get the block for the given round.
  - **Operation ID**: GetBlock
  - **Parameters**:
    - **round**: The round from which to fetch block information (required)
  - **Responses**:
    - 200: Returns block response
    - 400: Bad Request - Non integer number
    - 404: None existing block
    - 500: Internal Error
    - default: Unknown Error

### /v2/ledger/supply
- **GET**: Get the current supply reported by the ledger.
  - **Operation ID**: GetSupply
  - **Responses**:
    - 200: Returns supply response
    - default: Unknown Error

### /v2/status
- **GET**: Gets the current node status.
  - **Operation ID**: GetStatus
  - **Responses**:
    - 200: Returns the current node status
    - 500: Internal Error
    - default: Unknown Error

### /v2/status/wait-for-block-after/{round}
- **GET**: Gets the node status after waiting for a block to appear after the specified round.
  - **Operation ID**: WaitForBlock
  - **Parameters**:
    - **round**: The round to wait until returning status (required)
  - **Responses**:
    - 200: Returns node's status after waiting for a block to appear after the selected round
    - 400: Bad Request - number must be non-negative integer
    - 500: Internal Error
    - 503: Service Temporarily Unavailable
    - default: Unknown Error

### /v2/transactions
- **POST**: Broadcasts a raw transaction to the network.
  - **Operation ID**: RawTransaction
  - **Parameters**:
    - **rawtxn**: The byte encoded signed transaction to broadcast to the network (required)
  - **Responses**:
    - 200: Returns transaction ID of the submission
    - 400: Bad Request - Malformed Algorand transaction
    - 500: Internal Error
    - 503: Service Temporarily Unavailable
    - default: Unknown Error

### /v2/transactions/params
- **GET**: Get parameters for constructing a new transaction.
  - **Operation ID**: TransactionParams
  - **Responses**:
    - 200: Returns transaction parameters response
    - 500: Internal Error
    - 503: Service Temporarily Unavailable
    - default: Unknown Error

### /v2/transactions/pending
- **GET**: Get a list of unconfirmed transactions currently in the transaction pool.
  - **Operation ID**: GetPendingTransactions
  - **Responses**:
    - 200: Returns pending transactions response
    - 500: Internal Error
    - 503: Service Temporarily Unavailable
    - default: Unknown Error

### /v2/transactions/pending/{txid}
- **GET**: Get a specific pending transaction.
  - **Operation ID**: PendingTransactionInformation
  - **Parameters**:
    - **txid**: A transaction ID (required)
  - **Responses**:
    - 200: Returns pending transaction response
    - 400: Bad Request
    - 404: Transaction Not Found
    - default: Unknown Error

### /v2/teal/compile
- **POST**: Compile TEAL source code to binary, produce its hash.
  - **Operation ID**: TealCompile
  - **Parameters**:
    - **source**: TEAL source code to be compiled (required)
  - **Responses**:
    - 200: Successful compilation
    - 400: Bad Request - Teal Compile Error
    - 500: Internal Error
    - default: Unknown Error

## Definitions
- **Account**: Account information at a given round.
- **AccountParticipation**: Parameters used by this account in consensus protocol.
- **Asset**: Unique identifier and parameters for an asset.
- **AssetHolding**: Asset held by an account.
- **ErrorResponse**: An error response with optional data field.
- **SupplyResponse**: Current supply of MicroAlgos in the system.
- **PendingTransactionResponse**: Details about a pending transaction.
