_wrapTransaction(tx, hash, startBlock) {
        if (hash != null && hexDataLength(hash) !== 32) {
            throw new Error("invalid response - sendTransaction");
        }
        const result = tx;
        // Check the hash we expect is the same as the hash the server reported
        if (hash != null && tx.hash !== hash) {
            logger$t.throwError("Transaction hash mismatch from Provider.sendTransaction.", Logger.errors.UNKNOWN_ERROR, { expectedHash: tx.hash, returnedHash: hash });
        }
        result.wait = (confirms, timeout) => __awaiter$9(this, void 0, void 0, function* () {
            if (confirms == null) {
                confirms = 1;
            }
            if (timeout == null) {
                timeout = 0;
            }
            // Get the details to detect replacement
            let replacement = undefined;
            if (confirms !== 0 && startBlock != null) {
                replacement = {
                    data: tx.data,
                    from: tx.from,
                    nonce: tx.nonce,
                    to: tx.to,
                    value: tx.value,
                    startBlock
                };
            }
            const receipt = yield this._waitForTransaction(tx.hash, confirms, timeout, replacement);
            if (receipt == null && confirms === 0) {
                return null;
            }
            // No longer pending, allow the polling loop to garbage collect this
            this._emitted["t:" + tx.hash] = receipt.blockNumber;
            if (receipt.status === 0) {
                logger$t.throwError("transaction failed", Logger.errors.CALL_EXCEPTION, {
                    transactionHash: tx.hash,
                    transaction: tx,
                    receipt: receipt
                });
            }
            return receipt;
        });
        return result;
    }
// This should be called by any subclass wrapping a TransactionResponse
This should be called by any subclass wrapping a TransactionResponse
This should be called by any subclass wrapping a TransactionResponse
_wrapTransaction(tx, hash, startBlock) {
        if (hash != null && hexDataLength(hash) !== 32) {
            throw new Error("invalid response - sendTransaction");
        }
        const result = tx;
        if (hash != null && tx.hash !== hash) {
            logger$t.throwError("Transaction hash mismatch from Provider.sendTransaction.", Logger.errors.UNKNOWN_ERROR, { expectedHash: tx.hash, returnedHash: hash });
        }
        result.wait = (confirms, timeout) => __awaiter$9(this, void 0, void 0, function* () {
            if (confirms == null) {
                confirms = 1;
            }
            if (timeout == null) {
                timeout = 0;
            }
            let replacement = undefined;
            if (confirms !== 0 && startBlock != null) {
                replacement = {
                    data: tx.data,
                    from: tx.from,
                    nonce: tx.nonce,
                    to: tx.to,
                    value: tx.value,
                    startBlock
                };
            }
            const receipt = yield this._waitForTransaction(tx.hash, confirms, timeout, replacement);
            if (receipt == null && confirms === 0) {
                return null;
            }
            this._emitted["t:" + tx.hash] = receipt.blockNumber;
            if (receipt.status === 0) {
                logger$t.throwError("transaction failed", Logger.errors.CALL_EXCEPTION, {
                    transactionHash: tx.hash,
                    transaction: tx,
                    receipt: receipt
                });
            }
            return receipt;
        });
        return result;
    }
_wrapTransaction ( tx , hash , startBlock ) { if ( hash != null && hexDataLength ( hash ) !== 32 ) { throw new Error ( "invalid response - sendTransaction" ) ; } const result = tx ; if ( hash != null && tx . hash !== hash ) { logger$t . throwError ( "Transaction hash mismatch from Provider.sendTransaction." , Logger . errors . UNKNOWN_ERROR , { expectedHash : tx . hash , returnedHash : hash } ) ; } result . wait = ( confirms , timeout ) => __awaiter$9 ( this , void 0 , void 0 , function * ( ) { if ( confirms == null ) { confirms = 1 ; } if ( timeout == null ) { timeout = 0 ; } let replacement = undefined ; if ( confirms !== 0 && startBlock != null ) { replacement = { data : tx . data , from : tx . from , nonce : tx . nonce , to : tx . to , value : tx . value , startBlock } ; } const receipt = yield this . _waitForTransaction ( tx . hash , confirms , timeout , replacement ) ; if ( receipt == null && confirms === 0 ) { return null ; } this . _emitted [ "t:" + tx . hash ] = receipt . blockNumber ; if ( receipt . status === 0 ) { logger$t . throwError ( "transaction failed" , Logger . errors . CALL_EXCEPTION , { transactionHash : tx . hash , transaction : tx , receipt : receipt } ) ; } return receipt ; } ) ; return result ; }
This should be called by any subclass wrapping a TransactionResponse
This should be called by any subclass wrapping a TransactionResponse
// Check the hash we expect is the same as the hash the server reported // Get the details to detect replacement // No longer pending, allow the polling loop to garbage collect this