Contracts

/api/contracts provides endpoints for gathering, outputting, and importing Smart Contract data to and from the database.

Get All Contracts (General)

List all available contracts. Uses pagination and filtering.

GETapi.rair.market/api/contracts
Query parameters
Response

OK

Request
const response = await fetch('api.rair.market/api/contracts', {
    method: 'GET',
    headers: {},
});
const data = await response.json();

Get Contract by ID

Get a single contract using database ID.

GETapi.rair.market/api/contracts/{id}
Path parameters
id*string
Response

OK

Request
const response = await fetch('api.rair.market/api/contracts/{id}', {
    method: 'GET',
    headers: {},
});
const data = await response.json();

Update Visibility

Update display and sync flags of contract. Super admin access required.

PATCHapi.rair.market/api/contracts/{id}
Path parameters
id*string
Body
blockSync*boolean
Example: true
blockView*boolean
Example: true
Response

OK

Request
const response = await fetch('api.rair.market/api/contracts/{id}', {
    method: 'PATCH',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "blockSync": true,
      "blockView": true
    }),
});
const data = await response.json();