@gear-js/voucher-indexer

API

This document describes the API of the @gear-js/voucher-indexer service.

Overview

Endpoints

GET /api/voucher/:id

Get a voucher by its ID.

Request

Response

{
  "id": "0x123",
  "owner": "0x456",
  "spender": "0x789",
  "amount": "11000000000000",
  "balance": "10000000000000",
  "programs": ["0xabc", "0xdef"],
  "codeUploading": false,
  "expiryAtBlock": 1000,
  "expiryAt": "2021-01-01T00:00:00Z",
  "issuedAtBlock": 100,
  "issuedAt": "2020-01-01T00:00:00Z",
  "updatedAtBlock": 200,
  "updatedAt": "2020-01-02T00:00:00Z",
  "isDeclined": false
}

POST /api/vouchers

Get a list of vouchers.

Request

Response

{
  "vouchers": [
    {
      "id": "0x123",
      "owner": "0x456",
      "spender": "0x789",
      "amount": "11000000000000",
      "balance": "10000000000000",
      "programs": ["0xabc", "0xdef"],
      "codeUploading": false,
      "expiryAtBlock": 1000,
      "expiryAt": "2021-01-01T00:00:00Z",
      "issuedAtBlock": 100,
      "issuedAt": "2020-01-01T00:00:00Z",
      "updatedAtBlock": 200,
      "updatedAt": "2020-01-02T00:00:00Z",
      "isDeclined": false
    }
  ],
  "count": 1
}