2019-05-15 01:48:48 +03:00
|
|
|
"use strict";
|
|
|
|
var __extends = (this && this.__extends) || (function () {
|
|
|
|
var extendStatics = function (d, b) {
|
|
|
|
extendStatics = Object.setPrototypeOf ||
|
|
|
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
|
|
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
|
|
return extendStatics(d, b);
|
|
|
|
};
|
|
|
|
return function (d, b) {
|
|
|
|
extendStatics(d, b);
|
|
|
|
function __() { this.constructor = d; }
|
|
|
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
|
|
};
|
|
|
|
})();
|
|
|
|
var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
|
if (mod && mod.__esModule) return mod;
|
|
|
|
var result = {};
|
|
|
|
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
|
|
result["default"] = mod;
|
|
|
|
return result;
|
|
|
|
};
|
|
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
|
var bytes_1 = require("@ethersproject/bytes");
|
|
|
|
var errors = __importStar(require("@ethersproject/errors"));
|
|
|
|
var errors_1 = require("@ethersproject/errors");
|
|
|
|
var properties_1 = require("@ethersproject/properties");
|
|
|
|
;
|
|
|
|
;
|
|
|
|
//export type CallTransactionable = {
|
|
|
|
// call(transaction: TransactionRequest): Promise<TransactionResponse>;
|
|
|
|
//};
|
2019-06-12 00:57:04 +03:00
|
|
|
var ForkEvent = /** @class */ (function (_super) {
|
|
|
|
__extends(ForkEvent, _super);
|
|
|
|
function ForkEvent() {
|
|
|
|
return _super !== null && _super.apply(this, arguments) || this;
|
2019-05-15 01:48:48 +03:00
|
|
|
}
|
2019-06-12 00:57:04 +03:00
|
|
|
ForkEvent.isForkEvent = function (value) {
|
|
|
|
return !!(value && value._isForkEvent);
|
|
|
|
};
|
2019-05-15 01:48:48 +03:00
|
|
|
return ForkEvent;
|
2019-06-12 00:57:04 +03:00
|
|
|
}(properties_1.Description));
|
2019-05-15 01:48:48 +03:00
|
|
|
exports.ForkEvent = ForkEvent;
|
|
|
|
var BlockForkEvent = /** @class */ (function (_super) {
|
|
|
|
__extends(BlockForkEvent, _super);
|
|
|
|
function BlockForkEvent(blockhash, expiry) {
|
|
|
|
var _this = this;
|
|
|
|
if (!bytes_1.isHexString(blockhash, 32)) {
|
|
|
|
errors.throwArgumentError("invalid blockhash", "blockhash", blockhash);
|
|
|
|
}
|
2019-06-12 00:57:04 +03:00
|
|
|
_this = _super.call(this, {
|
|
|
|
_isForkEvent: true,
|
|
|
|
_isBlockForkEvent: true,
|
|
|
|
expiry: (expiry || 0),
|
|
|
|
blockHash: blockhash
|
|
|
|
}) || this;
|
2019-05-15 01:48:48 +03:00
|
|
|
return _this;
|
|
|
|
}
|
|
|
|
return BlockForkEvent;
|
|
|
|
}(ForkEvent));
|
|
|
|
exports.BlockForkEvent = BlockForkEvent;
|
|
|
|
var TransactionForkEvent = /** @class */ (function (_super) {
|
|
|
|
__extends(TransactionForkEvent, _super);
|
|
|
|
function TransactionForkEvent(hash, expiry) {
|
|
|
|
var _this = this;
|
|
|
|
if (!bytes_1.isHexString(hash, 32)) {
|
|
|
|
errors.throwArgumentError("invalid transaction hash", "hash", hash);
|
|
|
|
}
|
2019-06-12 00:57:04 +03:00
|
|
|
_this = _super.call(this, {
|
|
|
|
_isForkEvent: true,
|
|
|
|
_isTransactionForkEvent: true,
|
|
|
|
expiry: (expiry || 0),
|
|
|
|
hash: hash
|
|
|
|
}) || this;
|
2019-05-15 01:48:48 +03:00
|
|
|
return _this;
|
|
|
|
}
|
|
|
|
return TransactionForkEvent;
|
|
|
|
}(ForkEvent));
|
|
|
|
exports.TransactionForkEvent = TransactionForkEvent;
|
|
|
|
var TransactionOrderForkEvent = /** @class */ (function (_super) {
|
|
|
|
__extends(TransactionOrderForkEvent, _super);
|
|
|
|
function TransactionOrderForkEvent(beforeHash, afterHash, expiry) {
|
|
|
|
var _this = this;
|
|
|
|
if (!bytes_1.isHexString(beforeHash, 32)) {
|
|
|
|
errors.throwArgumentError("invalid transaction hash", "beforeHash", beforeHash);
|
|
|
|
}
|
|
|
|
if (!bytes_1.isHexString(afterHash, 32)) {
|
|
|
|
errors.throwArgumentError("invalid transaction hash", "afterHash", afterHash);
|
|
|
|
}
|
2019-06-12 00:57:04 +03:00
|
|
|
_this = _super.call(this, {
|
|
|
|
_isForkEvent: true,
|
|
|
|
_isTransactionOrderForkEvent: true,
|
|
|
|
expiry: (expiry || 0),
|
|
|
|
beforeHash: beforeHash,
|
|
|
|
afterHash: afterHash
|
|
|
|
}) || this;
|
2019-05-15 01:48:48 +03:00
|
|
|
return _this;
|
|
|
|
}
|
|
|
|
return TransactionOrderForkEvent;
|
|
|
|
}(ForkEvent));
|
|
|
|
exports.TransactionOrderForkEvent = TransactionOrderForkEvent;
|
|
|
|
///////////////////////////////
|
|
|
|
// Exported Abstracts
|
|
|
|
var Provider = /** @class */ (function () {
|
|
|
|
function Provider() {
|
|
|
|
var _newTarget = this.constructor;
|
|
|
|
errors_1.checkAbstract(_newTarget, Provider);
|
2019-06-12 00:57:04 +03:00
|
|
|
properties_1.defineReadOnly(this, "_isProvider", true);
|
2019-05-15 01:48:48 +03:00
|
|
|
}
|
|
|
|
// Alias for "on"
|
|
|
|
Provider.prototype.addListener = function (eventName, listener) {
|
|
|
|
return this.on(eventName, listener);
|
|
|
|
};
|
|
|
|
// Alias for "off"
|
|
|
|
Provider.prototype.removeListener = function (eventName, listener) {
|
|
|
|
return this.off(eventName, listener);
|
|
|
|
};
|
2019-06-12 00:57:04 +03:00
|
|
|
Provider.isProvider = function (value) {
|
|
|
|
return !!(value && value._isProvider);
|
|
|
|
};
|
2019-05-15 01:48:48 +03:00
|
|
|
return Provider;
|
|
|
|
}());
|
|
|
|
exports.Provider = Provider;
|