Skip to main content

Contracts

A set of queries related to contracts to get your started

Get Latest Contracts

const axios = require('axios');const apiKey = `<YOUR_ARKHIA_API_KEY>`;const restApiUrl = `<YOUR_ARKHIA_REST_URL>`;const body = { headers: { "x-api-key": apiKey } };getLatestContracts = async () => {    try {        const contractsUrl = `${restApiUrl}/contracts`;        const response = await axios.get(contractsUrl, body);        return response;    } catch(e) {        console.error(e);    }}

Get Contracts By Id

const axios = require('axios');const apiKey = `<YOUR_ARKHIA_API_KEY>`;const restApiUrl = `<YOUR_ARKHIA_REST_URL>`;const body = { headers: { "x-api-key": apiKey } };getContractsById = async (contractId) => {    try {        const contractsUrl = `${restApiUrl}/contracts/${contractId}`;        const response = await axios.get(contractsUrl, body);        return response;    } catch(e) {        console.error(e);    }}

Get Logs By Contract Id

const axios = require('axios');const apiKey = `<YOUR_ARKHIA_API_KEY>`;const restApiUrl = `<YOUR_ARKHIA_REST_URL>`;const body = { headers: { "x-api-key": apiKey } };getLogsByContractId = async (contractId) => {    try {        const contractsUrl = `${restApiUrl}/contracts/${contractId}/results/logs`;        const response = await axios.get(contractsUrl, body);        return response;    } catch(e) {        console.error(e);    }}