stellar-plus
Version:
beta version of stellar-plus, an all-in-one sdk for the Stellar blockchain
40 lines (39 loc) • 1.96 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.SGTError = exports.ErrorCodesPipelineSorobanGetTransaction = void 0;
const error_1 = require("../../../../stellar-plus/error");
const soroban_rpc_1 = require("../../../../stellar-plus/error/helpers/soroban-rpc");
var ErrorCodesPipelineSorobanGetTransaction;
(function (ErrorCodesPipelineSorobanGetTransaction) {
//General
ErrorCodesPipelineSorobanGetTransaction["SGT001"] = "SGT001";
ErrorCodesPipelineSorobanGetTransaction["SGT002"] = "SGT002";
})(ErrorCodesPipelineSorobanGetTransaction || (exports.ErrorCodesPipelineSorobanGetTransaction = ErrorCodesPipelineSorobanGetTransaction = {}));
const transactionFailed = (conveyorBeltErrorMeta, response) => {
return new error_1.StellarPlusError({
code: ErrorCodesPipelineSorobanGetTransaction.SGT001,
message: 'The transaction failed!',
source: 'PipelineSorobanGetTransaction',
details: 'The transaction was submitted to the network but failed to be processed. This indicates an issue with the transaction that makes it invalid. Please check the details of the transaction and try again.',
meta: {
conveyorBeltErrorMeta,
sorobanGetTransactionData: (0, soroban_rpc_1.extractGetTransactionData)(response),
},
});
};
const transactionNotFound = (conveyorBeltErrorMeta, timeout, hash) => {
return new error_1.StellarPlusError({
code: ErrorCodesPipelineSorobanGetTransaction.SGT002,
message: 'Transaction not found!',
source: 'PipelineSorobanGetTransaction',
details: `The transaction was not found in the Soroban server. This indicates that the transaction was not fully processed when the timeout(${timeout}s) was reachead.`,
meta: {
conveyorBeltErrorMeta,
transactionHash: hash,
},
});
};
exports.SGTError = {
transactionFailed,
transactionNotFound,
};