Guardian Client

A Light Typescript Client Supporting NFT and Public ARK REST API

Prerequisites

Before we get started we need to make sure that all of the required dependencies are installed.

yarn

yarn add @protokol/client

Initialization

import { ProtokolConnection } from "@protokol/client";
const connection = new ProtokolConnection("https://api.protokol.com/api");

Guardian Endpoints

Configurations

List Configurations

const response = await connection.guardianApi("configurations").index();
>>> Promise<ApiResponse<GuardianConfigurations>>

Groups

List All Groups

const response = await connection.guardianApi("groups").index();
>>> Promise<ApiResponseWithPagination<Group>>

Get Group By Name

const response = await connection.guardianApi("groups").get("VALID_GROUP_NAME");
>>> Promise<ApiResponse<Group>>

Get Users By Group Name

const response = await connection.guardianApi("groups").users("VALID_GROUP_NAME");
>>> Promise<ApiResponse<User>>

Users

List All Users

const response = await connection.guardianApi("users").index();
>>> Promise<ApiResponseWithPagination<User>>

Get User By Public Key

const response = await connection.guardianApi("users").get("PUBLIC_KEY");
>>> Promise<ApiResponse<User>>

Get User Groups

const response = await connection.guardianApi("users").userGroups("PUBLIC_KEY");
>>> Promise<ApiResponse<UserGroups>>