UNPKG

@aut-labs/sdk

Version:

The TS/JS SDK package aims to make it easy for frontends/backends to integrate with Aut Smart Contracts

25 lines 934 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.SDKContractGenericResponse = void 0; const errorParser_1 = __importDefault(require("../utils/errorParser")); class SDKContractGenericResponse { constructor({ isSuccess, data, event, error, }) { this.data = data; this.event = event; this.isSuccess = !!isSuccess || (!!this.event && !error); if (error) { this.errorMessage = (0, errorParser_1.default)(error); } if (!this.isSuccess && !this.data) { delete this.data; } if (this.isSuccess && !this.errorMessage) { delete this.errorMessage; } } } exports.SDKContractGenericResponse = SDKContractGenericResponse; //# sourceMappingURL=response.js.map