/** * Transaction Type module for managing Dragonchain transaction types */ import { DragonchainClient } from './client'; import { ContentType, TransactionTypeCreateRequest, TransactionTypeCreateResponse, TransactionType, TransactionListResponse, SuccessResponse, } from './types'; export class TransactionTypeClient { private client: DragonchainClient; constructor(client: DragonchainClient) { this.client = client; } /** * Creates a new transaction type */ async create(request: TransactionTypeCreateRequest): Promise { return this.client.post( '/api/v1/transaction-type', ContentType.JSON, request ); } /** * Gets a transaction type by name */ async get(txnType: string): Promise { return this.client.get(`/api/v1/transaction-type/${txnType}`); } /** * Lists all transaction types */ async list(): Promise { return this.client.get('/api/v1/transaction-types'); } /** * Deletes a transaction type */ async delete(txnType: string): Promise { return this.client.delete(`/api/v1/transaction-type/${txnType}`); } }