tickethead-sdk
Version:
SDK for the Tickethead API
42 lines • 1.73 kB
TypeScript
import { AxiosInstance } from 'axios';
import { HealthStatus } from '../common/types';
import { GetExportedValidatorsQuery, ValidatorWithWallet, ValidatorToken, CreateValidator, Validator, ValidatorId } from './types';
import { OrganizerId } from '../account';
/**
* Service class for validator API calls.
*/
export declare class ValidatorService {
readonly client: AxiosInstance;
readonly version: string;
constructor(client: AxiosInstance, version: string);
/**
* Returns true if the service is reachable
*
* @returns Services' online status
*/
health(): Promise<HealthStatus>;
/**
* Returns the validator using the given token
*
* @param token token for fetching the validator
* @returns Validator object
* @throws `NotFoundError`
*/
getValidatorByToken(token: ValidatorToken): Promise<ValidatorWithWallet>;
getExportedValidators(id: OrganizerId, query: GetExportedValidatorsQuery): Promise<ValidatorWithWallet[]>;
/**
* Creates a new user which can validate tickets for the specified org.
* @param organizerId.id Name or ID of the organizer to whom the validator belongs to
* @param validator Validator data (eventId which signals for which event is the validator)
* @returns new Validator
*/
createValidator(organizerId: OrganizerId, validator: CreateValidator): Promise<Validator>;
/**
* Fetches validator data.
* @param id.organizerId Name or ID of the organizer to whom the validator belongs to
* @param id.id ID of the validator to be fetched
* @returns requested Validator
*/
getValidator(id: ValidatorId): Promise<Validator>;
}
//# sourceMappingURL=service.d.ts.map