Current Folder
This commit is contained in:
1 parent
8b3382289b
commit
cfcada880d
4379 files changed
No files matched your search
+2
@@ -0,0 +1,2 @@
|
||||
export const version = "abstract-provider/5.0.5";
|
||||
//# sourceMappingURL=_version.js.map
|
||||
+79
@@ -0,0 +1,79 @@
|
||||
"use strict";
|
||||
import { isHexString } from "@ethersproject/bytes";
|
||||
import { Description, defineReadOnly } from "@ethersproject/properties";
|
||||
import { Logger } from "@ethersproject/logger";
|
||||
import { version } from "./_version";
|
||||
const logger = new Logger(version);
|
||||
;
|
||||
;
|
||||
//export type CallTransactionable = {
|
||||
// call(transaction: TransactionRequest): Promise<TransactionResponse>;
|
||||
//};
|
||||
export class ForkEvent extends Description {
|
||||
static isForkEvent(value) {
|
||||
return !!(value && value._isForkEvent);
|
||||
}
|
||||
}
|
||||
export class BlockForkEvent extends ForkEvent {
|
||||
constructor(blockHash, expiry) {
|
||||
if (!isHexString(blockHash, 32)) {
|
||||
logger.throwArgumentError("invalid blockHash", "blockHash", blockHash);
|
||||
}
|
||||
super({
|
||||
_isForkEvent: true,
|
||||
_isBlockForkEvent: true,
|
||||
expiry: (expiry || 0),
|
||||
blockHash: blockHash
|
||||
});
|
||||
}
|
||||
}
|
||||
export class TransactionForkEvent extends ForkEvent {
|
||||
constructor(hash, expiry) {
|
||||
if (!isHexString(hash, 32)) {
|
||||
logger.throwArgumentError("invalid transaction hash", "hash", hash);
|
||||
}
|
||||
super({
|
||||
_isForkEvent: true,
|
||||
_isTransactionForkEvent: true,
|
||||
expiry: (expiry || 0),
|
||||
hash: hash
|
||||
});
|
||||
}
|
||||
}
|
||||
export class TransactionOrderForkEvent extends ForkEvent {
|
||||
constructor(beforeHash, afterHash, expiry) {
|
||||
if (!isHexString(beforeHash, 32)) {
|
||||
logger.throwArgumentError("invalid transaction hash", "beforeHash", beforeHash);
|
||||
}
|
||||
if (!isHexString(afterHash, 32)) {
|
||||
logger.throwArgumentError("invalid transaction hash", "afterHash", afterHash);
|
||||
}
|
||||
super({
|
||||
_isForkEvent: true,
|
||||
_isTransactionOrderForkEvent: true,
|
||||
expiry: (expiry || 0),
|
||||
beforeHash: beforeHash,
|
||||
afterHash: afterHash
|
||||
});
|
||||
}
|
||||
}
|
||||
///////////////////////////////
|
||||
// Exported Abstracts
|
||||
export class Provider {
|
||||
constructor() {
|
||||
logger.checkAbstract(new.target, Provider);
|
||||
defineReadOnly(this, "_isProvider", true);
|
||||
}
|
||||
// Alias for "on"
|
||||
addListener(eventName, listener) {
|
||||
return this.on(eventName, listener);
|
||||
}
|
||||
// Alias for "off"
|
||||
removeListener(eventName, listener) {
|
||||
return this.off(eventName, listener);
|
||||
}
|
||||
static isProvider(value) {
|
||||
return !!(value && value._isProvider);
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=index.js.map
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.version = "abstract-provider/5.0.5";
|
||||
//# sourceMappingURL=_version.js.map
|
||||
+117
@@ -0,0 +1,117 @@
|
||||
"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 __());
|
||||
};
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var bytes_1 = require("@ethersproject/bytes");
|
||||
var properties_1 = require("@ethersproject/properties");
|
||||
var logger_1 = require("@ethersproject/logger");
|
||||
var _version_1 = require("./_version");
|
||||
var logger = new logger_1.Logger(_version_1.version);
|
||||
;
|
||||
;
|
||||
//export type CallTransactionable = {
|
||||
// call(transaction: TransactionRequest): Promise<TransactionResponse>;
|
||||
//};
|
||||
var ForkEvent = /** @class */ (function (_super) {
|
||||
__extends(ForkEvent, _super);
|
||||
function ForkEvent() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
ForkEvent.isForkEvent = function (value) {
|
||||
return !!(value && value._isForkEvent);
|
||||
};
|
||||
return ForkEvent;
|
||||
}(properties_1.Description));
|
||||
exports.ForkEvent = ForkEvent;
|
||||
var BlockForkEvent = /** @class */ (function (_super) {
|
||||
__extends(BlockForkEvent, _super);
|
||||
function BlockForkEvent(blockHash, expiry) {
|
||||
var _this = this;
|
||||
if (!bytes_1.isHexString(blockHash, 32)) {
|
||||
logger.throwArgumentError("invalid blockHash", "blockHash", blockHash);
|
||||
}
|
||||
_this = _super.call(this, {
|
||||
_isForkEvent: true,
|
||||
_isBlockForkEvent: true,
|
||||
expiry: (expiry || 0),
|
||||
blockHash: blockHash
|
||||
}) || this;
|
||||
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)) {
|
||||
logger.throwArgumentError("invalid transaction hash", "hash", hash);
|
||||
}
|
||||
_this = _super.call(this, {
|
||||
_isForkEvent: true,
|
||||
_isTransactionForkEvent: true,
|
||||
expiry: (expiry || 0),
|
||||
hash: hash
|
||||
}) || this;
|
||||
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)) {
|
||||
logger.throwArgumentError("invalid transaction hash", "beforeHash", beforeHash);
|
||||
}
|
||||
if (!bytes_1.isHexString(afterHash, 32)) {
|
||||
logger.throwArgumentError("invalid transaction hash", "afterHash", afterHash);
|
||||
}
|
||||
_this = _super.call(this, {
|
||||
_isForkEvent: true,
|
||||
_isTransactionOrderForkEvent: true,
|
||||
expiry: (expiry || 0),
|
||||
beforeHash: beforeHash,
|
||||
afterHash: afterHash
|
||||
}) || this;
|
||||
return _this;
|
||||
}
|
||||
return TransactionOrderForkEvent;
|
||||
}(ForkEvent));
|
||||
exports.TransactionOrderForkEvent = TransactionOrderForkEvent;
|
||||
///////////////////////////////
|
||||
// Exported Abstracts
|
||||
var Provider = /** @class */ (function () {
|
||||
function Provider() {
|
||||
var _newTarget = this.constructor;
|
||||
logger.checkAbstract(_newTarget, Provider);
|
||||
properties_1.defineReadOnly(this, "_isProvider", true);
|
||||
}
|
||||
// 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);
|
||||
};
|
||||
Provider.isProvider = function (value) {
|
||||
return !!(value && value._isProvider);
|
||||
};
|
||||
return Provider;
|
||||
}());
|
||||
exports.Provider = Provider;
|
||||
//# sourceMappingURL=index.js.map
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
{
|
||||
"author": "Richard Moore <me@ricmoo.com>",
|
||||
"dependencies": {
|
||||
"@ethersproject/bignumber": "^5.0.7",
|
||||
"@ethersproject/bytes": "^5.0.4",
|
||||
"@ethersproject/logger": "^5.0.5",
|
||||
"@ethersproject/networks": "^5.0.3",
|
||||
"@ethersproject/properties": "^5.0.3",
|
||||
"@ethersproject/transactions": "^5.0.5",
|
||||
"@ethersproject/web": "^5.0.6"
|
||||
},
|
||||
"description": "An Abstract Class for describing an Ethereum Provider for ethers.",
|
||||
"ethereum": "donations.ethers.eth",
|
||||
"gitHead": "ffa4a2d0549fe2c606bda3130f4a3f3d788f8dcf",
|
||||
"keywords": [
|
||||
"Ethereum",
|
||||
"ethers"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "./lib/index.js",
|
||||
"module": "./lib.esm/index.js",
|
||||
"name": "@ethersproject/abstract-provider",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/ethers-io/ethers.js.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"tarballHash": "0x87fdc7d7ee69d8c228c0e6946be702acd027a832b5a3deaa5b60e3c9f7110e58",
|
||||
"types": "./lib/index.d.ts",
|
||||
"version": "5.0.5"
|
||||
|
||||
,"_resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.0.5.tgz"
|
||||
,"_integrity": "sha512-i/CjElAkzV7vQBAeoz+IpjGfcFYEP9eD7j3fzZ0fzTq03DO7PPnR+xkEZ1IoDXGwDS+55aLM1xvLDwB/Lx6IOQ=="
|
||||
,"_from": "@ethersproject/abstract-provider@^5.0.4"
|
||||
}
|
||||
Reference in new issue
Block a user