1. Introduction

This document contains generated documentation for AMPnet report-service-eth. Report service contains all endpoints for generating reports in PDF Source code is available on Github.

2. Transaction History API

All requests need header: Authorization: Bearer JWT. Chain ID (e.g. 80001) and issuer address must be provided in the request path, .

2.1. Get transaction history

Query parameters from and to are both optional.

Possible transaction types are:
  • RESERVE_INVESTMENT - Refers to the investment placed into the campaign before it is finalized. Can be cancelled.

  • CANCEL_INVESTMENT - Refers to the cancellation of the reserved investments.

  • COMPLETED_INVESTMENT - Refers to the investment claimed when the campaign is finalized.

  • CREATE_PAYOUT - Refers to the payout manager transferring a certain amount of tokens to its contract, making it eligible for individual addresses which invested into the asset to collect its share.

  • REVENUE_SHARE - Refers to the investor addresses collecting revenue share.

Request
GET /tx_history/80001/0xissuer-address?from=2021-09-10&to=2021-09-14 HTTP/1.1
Host: localhost:8080
Response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 525

{
  "transactions" : [ {
    "from_address" : "0x8f52b0cc50967fc59c6289f8fdb3e356edeebd23",
    "to_address" : "0xfec646017105fa2a4ffdc773e9c539eda5af724a",
    "contract" : "0xFeC646017105fA2A4FFDc773e9c539Eda5af724a",
    "chain_id" : 80001,
    "hash" : "e60f380f-d042-47bd-ba0c-b6aff64ec20b",
    "type" : "COMPLETED_INVESTMENT",
    "asset" : "project_name",
    "timestamp" : 1631434129000,
    "token_value" : 10000000000,
    "token_amount" : 10000000000000000000000,
    "payout_id" : 50,
    "revenue" : 500
  } ]
}

3. Reporting API

All requests need header: Authorization: Bearer JWT. Chain ID must be provided in the request path, e.g. 80001.

3.1. Get user transactions report

Query parameters from and to are both optional. Path variable issuer is the contract address of the issuer.

Request
GET /report/80001/issuer-contract-address/user/transactions?from=2019-10-10&to=2021-09-16 HTTP/1.1
Host: localhost:8080

Response is a PDF file data.

3.2. Get user transaction report

Query parameters txHash, fromTxHash and toTxHash are required. Path variable issuer is the contract address of the issuer.

Request
GET /report/80001/issuer-contract-address/user/transaction?txHash=0x07b12471d1eac43a429cd38df96671621763f03bdde047697c62c22f5ff9bd37 HTTP/1.1
Host: localhost:8080

Response is a PDF file data.

4. Admin Reporting API

All requests need header: Authorization: Bearer JWT. Only owner of the issuer contract can access this API. Chain ID must be provided in the request path, e.g. 80001.

4.1. Get active users accounts summary report

Query parameters from and to are both optional.

Request
GET /admin/80001/issuer-contract-address/report/user?from=2019-10-10&to=2021-09-17 HTTP/1.1
Host: localhost:8080

Response is a PDF file data.

4.2. User stats report

Issuer owner can download the xlsx report with users list.

Request
GET /admin/80001/issuer-contract-address/report/xlsx HTTP/1.1
Host: localhost:8080

Response is xlsx file data.