@multiversx/sdk-core
Advanced tools
Comparing version 12.6.1 to 12.7.0
@@ -207,1 +207,4 @@ /** | ||
} | ||
export declare class ErrIsCompletedFieldIsMissingOnTransaction extends Err { | ||
constructor(); | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ErrGasLimitShouldBe0ForInnerTransaction = exports.ErrInvalidRelayedV2BuilderArguments = exports.ErrInvalidRelayedV1BuilderArguments = exports.ErrNotImplemented = exports.ErrContractInteraction = exports.ErrCodec = exports.ErrCannotParseTransactionOutcome = exports.ErrCannotParseContractResults = exports.ErrMissingFieldOnEnum = exports.ErrMissingFieldOnStruct = exports.ErrTypingSystem = exports.ErrMock = exports.ErrContractHasNoAddress = exports.ErrContract = exports.ErrExpectedTransactionEventsNotFound = exports.ErrExpectedTransactionStatusNotReached = exports.ErrTransactionWatcherTimeout = exports.ErrAsyncTimerAborted = exports.ErrAsyncTimerAlreadyRunning = exports.ErrInvalidFunctionName = exports.ErrSignatureCannotCreate = exports.ErrTransactionOptionsInvalid = exports.ErrTransactionVersionInvalid = exports.ErrNonceInvalid = exports.ErrNotEnoughGas = exports.ErrAddressEmpty = exports.ErrAddressBadHrp = exports.ErrAddressCannotCreate = exports.ErrUnexpectedCondition = exports.ErrInvariantFailed = exports.ErrBadType = exports.ErrUnsupportedOperation = exports.ErrInvalidArgument = exports.Err = void 0; | ||
exports.ErrIsCompletedFieldIsMissingOnTransaction = exports.ErrGasLimitShouldBe0ForInnerTransaction = exports.ErrInvalidRelayedV2BuilderArguments = exports.ErrInvalidRelayedV1BuilderArguments = exports.ErrNotImplemented = exports.ErrContractInteraction = exports.ErrCodec = exports.ErrCannotParseTransactionOutcome = exports.ErrCannotParseContractResults = exports.ErrMissingFieldOnEnum = exports.ErrMissingFieldOnStruct = exports.ErrTypingSystem = exports.ErrMock = exports.ErrContractHasNoAddress = exports.ErrContract = exports.ErrExpectedTransactionEventsNotFound = exports.ErrExpectedTransactionStatusNotReached = exports.ErrTransactionWatcherTimeout = exports.ErrAsyncTimerAborted = exports.ErrAsyncTimerAlreadyRunning = exports.ErrInvalidFunctionName = exports.ErrSignatureCannotCreate = exports.ErrTransactionOptionsInvalid = exports.ErrTransactionVersionInvalid = exports.ErrNonceInvalid = exports.ErrNotEnoughGas = exports.ErrAddressEmpty = exports.ErrAddressBadHrp = exports.ErrAddressCannotCreate = exports.ErrUnexpectedCondition = exports.ErrInvariantFailed = exports.ErrBadType = exports.ErrUnsupportedOperation = exports.ErrInvalidArgument = exports.Err = void 0; | ||
/** | ||
@@ -327,2 +327,8 @@ * The base class for exceptions (errors). | ||
exports.ErrGasLimitShouldBe0ForInnerTransaction = ErrGasLimitShouldBe0ForInnerTransaction; | ||
class ErrIsCompletedFieldIsMissingOnTransaction extends Err { | ||
constructor() { | ||
super("The transaction watcher requires the `isCompleted` property to be defined on the transaction object. Perhaps you've used the sdk-network-provider's `getTransaction()` and in that case you should also pass `withProcessStatus=true`."); | ||
} | ||
} | ||
exports.ErrIsCompletedFieldIsMissingOnTransaction = ErrIsCompletedFieldIsMissingOnTransaction; | ||
//# sourceMappingURL=errors.js.map |
@@ -14,3 +14,3 @@ /// <reference types="node" /> | ||
export interface ITransactionOnNetwork { | ||
isCompleted: boolean; | ||
isCompleted?: boolean; | ||
hash: string; | ||
@@ -17,0 +17,0 @@ type: string; |
@@ -51,3 +51,8 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const isCompleted = (transactionOnNetwork) => transactionOnNetwork.isCompleted; | ||
const isCompleted = (transactionOnNetwork) => { | ||
if (transactionOnNetwork.isCompleted === undefined) { | ||
throw new errors_1.ErrIsCompletedFieldIsMissingOnTransaction(); | ||
} | ||
return transactionOnNetwork.isCompleted; | ||
}; | ||
const doFetch = () => __awaiter(this, void 0, void 0, function* () { return yield this.fetcher.getTransaction(transaction.getHash().hex()); }); | ||
@@ -112,2 +117,5 @@ const errorProvider = () => new errors_1.ErrExpectedTransactionStatusNotReached(); | ||
logger_1.Logger.debug("TransactionWatcher.awaitConditionally(): cannot (yet) fetch data."); | ||
if (error instanceof errors_1.ErrIsCompletedFieldIsMissingOnTransaction) { | ||
throw error; | ||
} | ||
if (!(error instanceof errors_1.Err)) { | ||
@@ -114,0 +122,0 @@ throw error; |
{ | ||
"name": "@multiversx/sdk-core", | ||
"version": "12.6.1", | ||
"version": "12.7.0", | ||
"description": "MultiversX SDK for JavaScript and TypeScript", | ||
@@ -39,2 +39,3 @@ "main": "out/index.js", | ||
"@multiversx/sdk-network-providers": "1.2.1", | ||
"@multiversx/sdk-network-providers-next": "npm:@multiversx/sdk-network-providers@1.6.0-beta.0", | ||
"@multiversx/sdk-wallet": "3.0.0", | ||
@@ -41,0 +42,0 @@ "@multiversx/sdk-wallet-next": "npm:@multiversx/sdk-wallet@4.0.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
715028
12110
17