Updated dist files.
This commit is contained in:
parent
798cafa6fe
commit
2f30410ddd
@ -3,6 +3,12 @@ Changelog
|
|||||||
|
|
||||||
This change log is managed by `scripts/cmds/update-versions` but may be manually updated.
|
This change log is managed by `scripts/cmds/update-versions` but may be manually updated.
|
||||||
|
|
||||||
|
ethers/v5.0.0-beta.182 (2020-04-16 21:53)
|
||||||
|
-----------------------------------------
|
||||||
|
|
||||||
|
- Added support for Contract event parsing error recovery. ([cc72f76](https://github.com/ethers-io/ethers.js/commit/cc72f76695572d235d7f5a5ad4dc1838a5fe884a))
|
||||||
|
- Fix provider log filters with zero topics. ([#785](https://github.com/ethers-io/ethers.js/issues/785); [4ef0e4f](https://github.com/ethers-io/ethers.js/commit/4ef0e4f7653226bf8cca86e065ad614e7288af96))
|
||||||
|
|
||||||
ethers/v5.0.0-beta.181 (2020-04-15 18:23)
|
ethers/v5.0.0-beta.181 (2020-04-15 18:23)
|
||||||
-----------------------------------------
|
-----------------------------------------
|
||||||
|
|
||||||
|
2
packages/asm/lib.esm/_version.d.ts
vendored
2
packages/asm/lib.esm/_version.d.ts
vendored
@ -1 +1 @@
|
|||||||
export declare const version = "asm/5.0.0-beta.157";
|
export declare const version = "asm/5.0.0-beta.158";
|
||||||
|
@ -1 +1 @@
|
|||||||
export const version = "asm/5.0.0-beta.157";
|
export const version = "asm/5.0.0-beta.158";
|
||||||
|
2
packages/asm/lib/_version.d.ts
vendored
2
packages/asm/lib/_version.d.ts
vendored
@ -1 +1 @@
|
|||||||
export declare const version = "asm/5.0.0-beta.157";
|
export declare const version = "asm/5.0.0-beta.158";
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.version = "asm/5.0.0-beta.157";
|
exports.version = "asm/5.0.0-beta.158";
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
"generate": "node ./generate.js",
|
"generate": "node ./generate.js",
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
},
|
},
|
||||||
"tarballHash": "0xc32734413bbb1f14895c26ed325257354c8bc27312b70ecf81426ed4086da18b",
|
"tarballHash": "0x9abc89b9aa04b781f4a5864c033d6ce1677175f0c28a09ecb7c73012d377e2a7",
|
||||||
"types": "./lib/index.d.ts",
|
"types": "./lib/index.d.ts",
|
||||||
"version": "5.0.0-beta.157"
|
"version": "5.0.0-beta.158"
|
||||||
}
|
}
|
||||||
|
@ -1 +1 @@
|
|||||||
export const version = "asm/5.0.0-beta.157";
|
export const version = "asm/5.0.0-beta.158";
|
||||||
|
2
packages/contracts/lib.esm/_version.d.ts
vendored
2
packages/contracts/lib.esm/_version.d.ts
vendored
@ -1 +1 @@
|
|||||||
export declare const version = "contracts/5.0.0-beta.147";
|
export declare const version = "contracts/5.0.0-beta.148";
|
||||||
|
@ -1 +1 @@
|
|||||||
export const version = "contracts/5.0.0-beta.147";
|
export const version = "contracts/5.0.0-beta.148";
|
||||||
|
4
packages/contracts/lib.esm/index.d.ts
vendored
4
packages/contracts/lib.esm/index.d.ts
vendored
@ -25,6 +25,7 @@ export interface Event extends Log {
|
|||||||
event?: string;
|
event?: string;
|
||||||
eventSignature?: string;
|
eventSignature?: string;
|
||||||
args?: Result;
|
args?: Result;
|
||||||
|
decodeError?: Error;
|
||||||
decode?: (data: string, topics?: Array<string>) => any;
|
decode?: (data: string, topics?: Array<string>) => any;
|
||||||
removeListener: () => void;
|
removeListener: () => void;
|
||||||
getBlock: () => Promise<Block>;
|
getBlock: () => Promise<Block>;
|
||||||
@ -52,6 +53,7 @@ declare class RunningEvent {
|
|||||||
listenerCount(): number;
|
listenerCount(): number;
|
||||||
run(args: Array<any>): number;
|
run(args: Array<any>): number;
|
||||||
prepareEvent(event: Event): void;
|
prepareEvent(event: Event): void;
|
||||||
|
getEmit(event: Event): Array<any>;
|
||||||
}
|
}
|
||||||
export declare type ContractInterface = string | Array<Fragment | JsonFragment | string> | Interface;
|
export declare type ContractInterface = string | Array<Fragment | JsonFragment | string> | Interface;
|
||||||
export declare class Contract {
|
export declare class Contract {
|
||||||
@ -85,7 +87,7 @@ export declare class Contract {
|
|||||||
private _normalizeRunningEvent;
|
private _normalizeRunningEvent;
|
||||||
private _getRunningEvent;
|
private _getRunningEvent;
|
||||||
_checkRunningEvents(runningEvent: RunningEvent): void;
|
_checkRunningEvents(runningEvent: RunningEvent): void;
|
||||||
private _wrapEvent;
|
_wrapEvent(runningEvent: RunningEvent, log: Log, listener: Listener): Event;
|
||||||
private _addEventListener;
|
private _addEventListener;
|
||||||
queryFilter(event: EventFilter, fromBlockOrBlockhash?: BlockTag | string, toBlock?: BlockTag): Promise<Array<Event>>;
|
queryFilter(event: EventFilter, fromBlockOrBlockhash?: BlockTag | string, toBlock?: BlockTag): Promise<Array<Event>>;
|
||||||
on(event: EventFilter | string, listener: Listener): this;
|
on(event: EventFilter | string, listener: Listener): this;
|
||||||
|
@ -223,12 +223,21 @@ class RunningEvent {
|
|||||||
}
|
}
|
||||||
prepareEvent(event) {
|
prepareEvent(event) {
|
||||||
}
|
}
|
||||||
|
// Returns the array that will be applied to an emit
|
||||||
|
getEmit(event) {
|
||||||
|
return [event];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
class ErrorRunningEvent extends RunningEvent {
|
class ErrorRunningEvent extends RunningEvent {
|
||||||
constructor() {
|
constructor() {
|
||||||
super("error", null);
|
super("error", null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// @TODO Fragment should inherit Wildcard? and just override getEmit?
|
||||||
|
// or have a common abstract super class, with enough constructor
|
||||||
|
// options to configure both.
|
||||||
|
// A Fragment Event will populate all the properties that Wildcard
|
||||||
|
// will, and additioanlly dereference the arguments when emitting
|
||||||
class FragmentRunningEvent extends RunningEvent {
|
class FragmentRunningEvent extends RunningEvent {
|
||||||
constructor(address, contractInterface, fragment, topics) {
|
constructor(address, contractInterface, fragment, topics) {
|
||||||
const filter = {
|
const filter = {
|
||||||
@ -256,9 +265,26 @@ class FragmentRunningEvent extends RunningEvent {
|
|||||||
event.decode = (data, topics) => {
|
event.decode = (data, topics) => {
|
||||||
return this.interface.decodeEventLog(this.fragment, data, topics);
|
return this.interface.decodeEventLog(this.fragment, data, topics);
|
||||||
};
|
};
|
||||||
event.args = this.interface.decodeEventLog(this.fragment, event.data, event.topics);
|
try {
|
||||||
|
event.args = this.interface.decodeEventLog(this.fragment, event.data, event.topics);
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
event.args = null;
|
||||||
|
event.decodeError = error;
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
getEmit(event) {
|
||||||
|
const args = (event.args || []).slice();
|
||||||
|
args.push(event);
|
||||||
|
return args;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// A Wildard Event will attempt to populate:
|
||||||
|
// - event The name of the event name
|
||||||
|
// - eventSignature The full signature of the event
|
||||||
|
// - decode A function to decode data and topics
|
||||||
|
// - args The decoded data and topics
|
||||||
class WildcardRunningEvent extends RunningEvent {
|
class WildcardRunningEvent extends RunningEvent {
|
||||||
constructor(address, contractInterface) {
|
constructor(address, contractInterface) {
|
||||||
super("*", { address: address });
|
super("*", { address: address });
|
||||||
@ -267,8 +293,8 @@ class WildcardRunningEvent extends RunningEvent {
|
|||||||
}
|
}
|
||||||
prepareEvent(event) {
|
prepareEvent(event) {
|
||||||
super.prepareEvent(event);
|
super.prepareEvent(event);
|
||||||
const parsed = this.interface.parseLog(event);
|
try {
|
||||||
if (parsed) {
|
const parsed = this.interface.parseLog(event);
|
||||||
event.event = parsed.name;
|
event.event = parsed.name;
|
||||||
event.eventSignature = parsed.signature;
|
event.eventSignature = parsed.signature;
|
||||||
event.decode = (data, topics) => {
|
event.decode = (data, topics) => {
|
||||||
@ -276,6 +302,9 @@ class WildcardRunningEvent extends RunningEvent {
|
|||||||
};
|
};
|
||||||
event.args = parsed.args;
|
event.args = parsed.args;
|
||||||
}
|
}
|
||||||
|
catch (error) {
|
||||||
|
// No matching event
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export class Contract {
|
export class Contract {
|
||||||
@ -482,27 +511,26 @@ export class Contract {
|
|||||||
if (eventName === "*") {
|
if (eventName === "*") {
|
||||||
return this._normalizeRunningEvent(new WildcardRunningEvent(this.address, this.interface));
|
return this._normalizeRunningEvent(new WildcardRunningEvent(this.address, this.interface));
|
||||||
}
|
}
|
||||||
|
// Get the event Fragment (throws if ambiguous/unknown event)
|
||||||
const fragment = this.interface.getEvent(eventName);
|
const fragment = this.interface.getEvent(eventName);
|
||||||
if (!fragment) {
|
|
||||||
logger.throwArgumentError("unknown event - " + eventName, "eventName", eventName);
|
|
||||||
}
|
|
||||||
return this._normalizeRunningEvent(new FragmentRunningEvent(this.address, this.interface, fragment));
|
return this._normalizeRunningEvent(new FragmentRunningEvent(this.address, this.interface, fragment));
|
||||||
}
|
}
|
||||||
const filter = {
|
// We have topics to filter by...
|
||||||
address: this.address
|
if (eventName.topics && eventName.topics.length > 0) {
|
||||||
};
|
// Is it a known topichash? (throws if no matching topichash)
|
||||||
// Find the matching event in the ABI; if none, we still allow filtering
|
try {
|
||||||
// since it may be a filter for an otherwise unknown event
|
|
||||||
if (eventName.topics) {
|
|
||||||
if (eventName.topics[0]) {
|
|
||||||
const fragment = this.interface.getEvent(eventName.topics[0]);
|
const fragment = this.interface.getEvent(eventName.topics[0]);
|
||||||
if (fragment) {
|
return this._normalizeRunningEvent(new FragmentRunningEvent(this.address, this.interface, fragment, eventName.topics));
|
||||||
return this._normalizeRunningEvent(new FragmentRunningEvent(this.address, this.interface, fragment, eventName.topics));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
filter.topics = eventName.topics;
|
catch (error) { }
|
||||||
|
// Filter by the unknown topichash
|
||||||
|
const filter = {
|
||||||
|
address: this.address,
|
||||||
|
topics: eventName.topics
|
||||||
|
};
|
||||||
|
return this._normalizeRunningEvent(new RunningEvent(getEventTag(filter), filter));
|
||||||
}
|
}
|
||||||
return this._normalizeRunningEvent(new RunningEvent(getEventTag(filter), filter));
|
return this._normalizeRunningEvent(new WildcardRunningEvent(this.address, this.interface));
|
||||||
}
|
}
|
||||||
_checkRunningEvents(runningEvent) {
|
_checkRunningEvents(runningEvent) {
|
||||||
if (runningEvent.listenerCount() === 0) {
|
if (runningEvent.listenerCount() === 0) {
|
||||||
@ -515,15 +543,10 @@ export class Contract {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Subclasses can override this to gracefully recover
|
||||||
|
// from parse errors if they wish
|
||||||
_wrapEvent(runningEvent, log, listener) {
|
_wrapEvent(runningEvent, log, listener) {
|
||||||
const event = deepCopy(log);
|
const event = deepCopy(log);
|
||||||
try {
|
|
||||||
runningEvent.prepareEvent(event);
|
|
||||||
}
|
|
||||||
catch (error) {
|
|
||||||
this.emit("error", error);
|
|
||||||
throw error;
|
|
||||||
}
|
|
||||||
event.removeListener = () => {
|
event.removeListener = () => {
|
||||||
if (!listener) {
|
if (!listener) {
|
||||||
return;
|
return;
|
||||||
@ -534,6 +557,8 @@ export class Contract {
|
|||||||
event.getBlock = () => { return this.provider.getBlock(log.blockHash); };
|
event.getBlock = () => { return this.provider.getBlock(log.blockHash); };
|
||||||
event.getTransaction = () => { return this.provider.getTransaction(log.transactionHash); };
|
event.getTransaction = () => { return this.provider.getTransaction(log.transactionHash); };
|
||||||
event.getTransactionReceipt = () => { return this.provider.getTransactionReceipt(log.transactionHash); };
|
event.getTransactionReceipt = () => { return this.provider.getTransactionReceipt(log.transactionHash); };
|
||||||
|
// This may throw if the topics and data mismatch the signature
|
||||||
|
runningEvent.prepareEvent(event);
|
||||||
return event;
|
return event;
|
||||||
}
|
}
|
||||||
_addEventListener(runningEvent, listener, once) {
|
_addEventListener(runningEvent, listener, once) {
|
||||||
@ -543,12 +568,19 @@ export class Contract {
|
|||||||
runningEvent.addListener(listener, once);
|
runningEvent.addListener(listener, once);
|
||||||
// Track this running event and its listeners (may already be there; but no hard in updating)
|
// Track this running event and its listeners (may already be there; but no hard in updating)
|
||||||
this._runningEvents[runningEvent.tag] = runningEvent;
|
this._runningEvents[runningEvent.tag] = runningEvent;
|
||||||
// If we are not polling the provider, start
|
// If we are not polling the provider, start polling
|
||||||
if (!this._wrappedEmits[runningEvent.tag]) {
|
if (!this._wrappedEmits[runningEvent.tag]) {
|
||||||
const wrappedEmit = (log) => {
|
const wrappedEmit = (log) => {
|
||||||
const event = this._wrapEvent(runningEvent, log, listener);
|
let event = null;
|
||||||
const args = (event.args || []).slice();
|
try {
|
||||||
args.push(event);
|
event = this._wrapEvent(runningEvent, log, listener);
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
// There was an error decoding the data and topics
|
||||||
|
this.emit("error", error, event);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const args = runningEvent.getEmit(event);
|
||||||
this.emit(runningEvent.filter, ...args);
|
this.emit(runningEvent.filter, ...args);
|
||||||
};
|
};
|
||||||
this._wrappedEmits[runningEvent.tag] = wrappedEmit;
|
this._wrappedEmits[runningEvent.tag] = wrappedEmit;
|
||||||
|
2
packages/contracts/lib/_version.d.ts
vendored
2
packages/contracts/lib/_version.d.ts
vendored
@ -1 +1 @@
|
|||||||
export declare const version = "contracts/5.0.0-beta.147";
|
export declare const version = "contracts/5.0.0-beta.148";
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.version = "contracts/5.0.0-beta.147";
|
exports.version = "contracts/5.0.0-beta.148";
|
||||||
|
4
packages/contracts/lib/index.d.ts
vendored
4
packages/contracts/lib/index.d.ts
vendored
@ -25,6 +25,7 @@ export interface Event extends Log {
|
|||||||
event?: string;
|
event?: string;
|
||||||
eventSignature?: string;
|
eventSignature?: string;
|
||||||
args?: Result;
|
args?: Result;
|
||||||
|
decodeError?: Error;
|
||||||
decode?: (data: string, topics?: Array<string>) => any;
|
decode?: (data: string, topics?: Array<string>) => any;
|
||||||
removeListener: () => void;
|
removeListener: () => void;
|
||||||
getBlock: () => Promise<Block>;
|
getBlock: () => Promise<Block>;
|
||||||
@ -52,6 +53,7 @@ declare class RunningEvent {
|
|||||||
listenerCount(): number;
|
listenerCount(): number;
|
||||||
run(args: Array<any>): number;
|
run(args: Array<any>): number;
|
||||||
prepareEvent(event: Event): void;
|
prepareEvent(event: Event): void;
|
||||||
|
getEmit(event: Event): Array<any>;
|
||||||
}
|
}
|
||||||
export declare type ContractInterface = string | Array<Fragment | JsonFragment | string> | Interface;
|
export declare type ContractInterface = string | Array<Fragment | JsonFragment | string> | Interface;
|
||||||
export declare class Contract {
|
export declare class Contract {
|
||||||
@ -85,7 +87,7 @@ export declare class Contract {
|
|||||||
private _normalizeRunningEvent;
|
private _normalizeRunningEvent;
|
||||||
private _getRunningEvent;
|
private _getRunningEvent;
|
||||||
_checkRunningEvents(runningEvent: RunningEvent): void;
|
_checkRunningEvents(runningEvent: RunningEvent): void;
|
||||||
private _wrapEvent;
|
_wrapEvent(runningEvent: RunningEvent, log: Log, listener: Listener): Event;
|
||||||
private _addEventListener;
|
private _addEventListener;
|
||||||
queryFilter(event: EventFilter, fromBlockOrBlockhash?: BlockTag | string, toBlock?: BlockTag): Promise<Array<Event>>;
|
queryFilter(event: EventFilter, fromBlockOrBlockhash?: BlockTag | string, toBlock?: BlockTag): Promise<Array<Event>>;
|
||||||
on(event: EventFilter | string, listener: Listener): this;
|
on(event: EventFilter | string, listener: Listener): this;
|
||||||
|
@ -250,6 +250,10 @@ var RunningEvent = /** @class */ (function () {
|
|||||||
};
|
};
|
||||||
RunningEvent.prototype.prepareEvent = function (event) {
|
RunningEvent.prototype.prepareEvent = function (event) {
|
||||||
};
|
};
|
||||||
|
// Returns the array that will be applied to an emit
|
||||||
|
RunningEvent.prototype.getEmit = function (event) {
|
||||||
|
return [event];
|
||||||
|
};
|
||||||
return RunningEvent;
|
return RunningEvent;
|
||||||
}());
|
}());
|
||||||
var ErrorRunningEvent = /** @class */ (function (_super) {
|
var ErrorRunningEvent = /** @class */ (function (_super) {
|
||||||
@ -259,6 +263,11 @@ var ErrorRunningEvent = /** @class */ (function (_super) {
|
|||||||
}
|
}
|
||||||
return ErrorRunningEvent;
|
return ErrorRunningEvent;
|
||||||
}(RunningEvent));
|
}(RunningEvent));
|
||||||
|
// @TODO Fragment should inherit Wildcard? and just override getEmit?
|
||||||
|
// or have a common abstract super class, with enough constructor
|
||||||
|
// options to configure both.
|
||||||
|
// A Fragment Event will populate all the properties that Wildcard
|
||||||
|
// will, and additioanlly dereference the arguments when emitting
|
||||||
var FragmentRunningEvent = /** @class */ (function (_super) {
|
var FragmentRunningEvent = /** @class */ (function (_super) {
|
||||||
__extends(FragmentRunningEvent, _super);
|
__extends(FragmentRunningEvent, _super);
|
||||||
function FragmentRunningEvent(address, contractInterface, fragment, topics) {
|
function FragmentRunningEvent(address, contractInterface, fragment, topics) {
|
||||||
@ -290,10 +299,27 @@ var FragmentRunningEvent = /** @class */ (function (_super) {
|
|||||||
event.decode = function (data, topics) {
|
event.decode = function (data, topics) {
|
||||||
return _this.interface.decodeEventLog(_this.fragment, data, topics);
|
return _this.interface.decodeEventLog(_this.fragment, data, topics);
|
||||||
};
|
};
|
||||||
event.args = this.interface.decodeEventLog(this.fragment, event.data, event.topics);
|
try {
|
||||||
|
event.args = this.interface.decodeEventLog(this.fragment, event.data, event.topics);
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
event.args = null;
|
||||||
|
event.decodeError = error;
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
FragmentRunningEvent.prototype.getEmit = function (event) {
|
||||||
|
var args = (event.args || []).slice();
|
||||||
|
args.push(event);
|
||||||
|
return args;
|
||||||
};
|
};
|
||||||
return FragmentRunningEvent;
|
return FragmentRunningEvent;
|
||||||
}(RunningEvent));
|
}(RunningEvent));
|
||||||
|
// A Wildard Event will attempt to populate:
|
||||||
|
// - event The name of the event name
|
||||||
|
// - eventSignature The full signature of the event
|
||||||
|
// - decode A function to decode data and topics
|
||||||
|
// - args The decoded data and topics
|
||||||
var WildcardRunningEvent = /** @class */ (function (_super) {
|
var WildcardRunningEvent = /** @class */ (function (_super) {
|
||||||
__extends(WildcardRunningEvent, _super);
|
__extends(WildcardRunningEvent, _super);
|
||||||
function WildcardRunningEvent(address, contractInterface) {
|
function WildcardRunningEvent(address, contractInterface) {
|
||||||
@ -305,14 +331,17 @@ var WildcardRunningEvent = /** @class */ (function (_super) {
|
|||||||
WildcardRunningEvent.prototype.prepareEvent = function (event) {
|
WildcardRunningEvent.prototype.prepareEvent = function (event) {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
_super.prototype.prepareEvent.call(this, event);
|
_super.prototype.prepareEvent.call(this, event);
|
||||||
var parsed = this.interface.parseLog(event);
|
try {
|
||||||
if (parsed) {
|
var parsed_1 = this.interface.parseLog(event);
|
||||||
event.event = parsed.name;
|
event.event = parsed_1.name;
|
||||||
event.eventSignature = parsed.signature;
|
event.eventSignature = parsed_1.signature;
|
||||||
event.decode = function (data, topics) {
|
event.decode = function (data, topics) {
|
||||||
return _this.interface.decodeEventLog(parsed.eventFragment, data, topics);
|
return _this.interface.decodeEventLog(parsed_1.eventFragment, data, topics);
|
||||||
};
|
};
|
||||||
event.args = parsed.args;
|
event.args = parsed_1.args;
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
// No matching event
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return WildcardRunningEvent;
|
return WildcardRunningEvent;
|
||||||
@ -529,27 +558,26 @@ var Contract = /** @class */ (function () {
|
|||||||
if (eventName === "*") {
|
if (eventName === "*") {
|
||||||
return this._normalizeRunningEvent(new WildcardRunningEvent(this.address, this.interface));
|
return this._normalizeRunningEvent(new WildcardRunningEvent(this.address, this.interface));
|
||||||
}
|
}
|
||||||
|
// Get the event Fragment (throws if ambiguous/unknown event)
|
||||||
var fragment = this.interface.getEvent(eventName);
|
var fragment = this.interface.getEvent(eventName);
|
||||||
if (!fragment) {
|
|
||||||
logger.throwArgumentError("unknown event - " + eventName, "eventName", eventName);
|
|
||||||
}
|
|
||||||
return this._normalizeRunningEvent(new FragmentRunningEvent(this.address, this.interface, fragment));
|
return this._normalizeRunningEvent(new FragmentRunningEvent(this.address, this.interface, fragment));
|
||||||
}
|
}
|
||||||
var filter = {
|
// We have topics to filter by...
|
||||||
address: this.address
|
if (eventName.topics && eventName.topics.length > 0) {
|
||||||
};
|
// Is it a known topichash? (throws if no matching topichash)
|
||||||
// Find the matching event in the ABI; if none, we still allow filtering
|
try {
|
||||||
// since it may be a filter for an otherwise unknown event
|
|
||||||
if (eventName.topics) {
|
|
||||||
if (eventName.topics[0]) {
|
|
||||||
var fragment = this.interface.getEvent(eventName.topics[0]);
|
var fragment = this.interface.getEvent(eventName.topics[0]);
|
||||||
if (fragment) {
|
return this._normalizeRunningEvent(new FragmentRunningEvent(this.address, this.interface, fragment, eventName.topics));
|
||||||
return this._normalizeRunningEvent(new FragmentRunningEvent(this.address, this.interface, fragment, eventName.topics));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
filter.topics = eventName.topics;
|
catch (error) { }
|
||||||
|
// Filter by the unknown topichash
|
||||||
|
var filter = {
|
||||||
|
address: this.address,
|
||||||
|
topics: eventName.topics
|
||||||
|
};
|
||||||
|
return this._normalizeRunningEvent(new RunningEvent(getEventTag(filter), filter));
|
||||||
}
|
}
|
||||||
return this._normalizeRunningEvent(new RunningEvent(getEventTag(filter), filter));
|
return this._normalizeRunningEvent(new WildcardRunningEvent(this.address, this.interface));
|
||||||
};
|
};
|
||||||
Contract.prototype._checkRunningEvents = function (runningEvent) {
|
Contract.prototype._checkRunningEvents = function (runningEvent) {
|
||||||
if (runningEvent.listenerCount() === 0) {
|
if (runningEvent.listenerCount() === 0) {
|
||||||
@ -562,16 +590,11 @@ var Contract = /** @class */ (function () {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
// Subclasses can override this to gracefully recover
|
||||||
|
// from parse errors if they wish
|
||||||
Contract.prototype._wrapEvent = function (runningEvent, log, listener) {
|
Contract.prototype._wrapEvent = function (runningEvent, log, listener) {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
var event = properties_1.deepCopy(log);
|
var event = properties_1.deepCopy(log);
|
||||||
try {
|
|
||||||
runningEvent.prepareEvent(event);
|
|
||||||
}
|
|
||||||
catch (error) {
|
|
||||||
this.emit("error", error);
|
|
||||||
throw error;
|
|
||||||
}
|
|
||||||
event.removeListener = function () {
|
event.removeListener = function () {
|
||||||
if (!listener) {
|
if (!listener) {
|
||||||
return;
|
return;
|
||||||
@ -582,6 +605,8 @@ var Contract = /** @class */ (function () {
|
|||||||
event.getBlock = function () { return _this.provider.getBlock(log.blockHash); };
|
event.getBlock = function () { return _this.provider.getBlock(log.blockHash); };
|
||||||
event.getTransaction = function () { return _this.provider.getTransaction(log.transactionHash); };
|
event.getTransaction = function () { return _this.provider.getTransaction(log.transactionHash); };
|
||||||
event.getTransactionReceipt = function () { return _this.provider.getTransactionReceipt(log.transactionHash); };
|
event.getTransactionReceipt = function () { return _this.provider.getTransactionReceipt(log.transactionHash); };
|
||||||
|
// This may throw if the topics and data mismatch the signature
|
||||||
|
runningEvent.prepareEvent(event);
|
||||||
return event;
|
return event;
|
||||||
};
|
};
|
||||||
Contract.prototype._addEventListener = function (runningEvent, listener, once) {
|
Contract.prototype._addEventListener = function (runningEvent, listener, once) {
|
||||||
@ -592,12 +617,19 @@ var Contract = /** @class */ (function () {
|
|||||||
runningEvent.addListener(listener, once);
|
runningEvent.addListener(listener, once);
|
||||||
// Track this running event and its listeners (may already be there; but no hard in updating)
|
// Track this running event and its listeners (may already be there; but no hard in updating)
|
||||||
this._runningEvents[runningEvent.tag] = runningEvent;
|
this._runningEvents[runningEvent.tag] = runningEvent;
|
||||||
// If we are not polling the provider, start
|
// If we are not polling the provider, start polling
|
||||||
if (!this._wrappedEmits[runningEvent.tag]) {
|
if (!this._wrappedEmits[runningEvent.tag]) {
|
||||||
var wrappedEmit = function (log) {
|
var wrappedEmit = function (log) {
|
||||||
var event = _this._wrapEvent(runningEvent, log, listener);
|
var event = null;
|
||||||
var args = (event.args || []).slice();
|
try {
|
||||||
args.push(event);
|
event = _this._wrapEvent(runningEvent, log, listener);
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
// There was an error decoding the data and topics
|
||||||
|
_this.emit("error", error, event);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var args = runningEvent.getEmit(event);
|
||||||
_this.emit.apply(_this, __spreadArrays([runningEvent.filter], args));
|
_this.emit.apply(_this, __spreadArrays([runningEvent.filter], args));
|
||||||
};
|
};
|
||||||
this._wrappedEmits[runningEvent.tag] = wrappedEmit;
|
this._wrappedEmits[runningEvent.tag] = wrappedEmit;
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
},
|
},
|
||||||
"tarballHash": "0xf9eed94c2691cdfba2ad5388d60b3c10740a130b29ff74ac141e5b5043d79f87",
|
"tarballHash": "0x4ff43d361fce2dcebd688d0f068197f8c95444c5a790620dd453119436c5db15",
|
||||||
"types": "./lib/index.d.ts",
|
"types": "./lib/index.d.ts",
|
||||||
"version": "5.0.0-beta.147"
|
"version": "5.0.0-beta.148"
|
||||||
}
|
}
|
||||||
|
@ -1 +1 @@
|
|||||||
export const version = "contracts/5.0.0-beta.147";
|
export const version = "contracts/5.0.0-beta.148";
|
||||||
|
2
packages/ethers/dist/ethers-all.esm.min.js
vendored
2
packages/ethers/dist/ethers-all.esm.min.js
vendored
File diff suppressed because one or more lines are too long
2
packages/ethers/dist/ethers-all.umd.min.js
vendored
2
packages/ethers/dist/ethers-all.umd.min.js
vendored
File diff suppressed because one or more lines are too long
117
packages/ethers/dist/ethers.esm.js
vendored
117
packages/ethers/dist/ethers.esm.js
vendored
@ -7987,7 +7987,7 @@ class VoidSigner extends Signer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const version$b = "contracts/5.0.0-beta.147";
|
const version$b = "contracts/5.0.0-beta.148";
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
const logger$f = new Logger(version$b);
|
const logger$f = new Logger(version$b);
|
||||||
@ -8204,12 +8204,21 @@ class RunningEvent {
|
|||||||
}
|
}
|
||||||
prepareEvent(event) {
|
prepareEvent(event) {
|
||||||
}
|
}
|
||||||
|
// Returns the array that will be applied to an emit
|
||||||
|
getEmit(event) {
|
||||||
|
return [event];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
class ErrorRunningEvent extends RunningEvent {
|
class ErrorRunningEvent extends RunningEvent {
|
||||||
constructor() {
|
constructor() {
|
||||||
super("error", null);
|
super("error", null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// @TODO Fragment should inherit Wildcard? and just override getEmit?
|
||||||
|
// or have a common abstract super class, with enough constructor
|
||||||
|
// options to configure both.
|
||||||
|
// A Fragment Event will populate all the properties that Wildcard
|
||||||
|
// will, and additioanlly dereference the arguments when emitting
|
||||||
class FragmentRunningEvent extends RunningEvent {
|
class FragmentRunningEvent extends RunningEvent {
|
||||||
constructor(address, contractInterface, fragment, topics) {
|
constructor(address, contractInterface, fragment, topics) {
|
||||||
const filter = {
|
const filter = {
|
||||||
@ -8237,9 +8246,26 @@ class FragmentRunningEvent extends RunningEvent {
|
|||||||
event.decode = (data, topics) => {
|
event.decode = (data, topics) => {
|
||||||
return this.interface.decodeEventLog(this.fragment, data, topics);
|
return this.interface.decodeEventLog(this.fragment, data, topics);
|
||||||
};
|
};
|
||||||
event.args = this.interface.decodeEventLog(this.fragment, event.data, event.topics);
|
try {
|
||||||
|
event.args = this.interface.decodeEventLog(this.fragment, event.data, event.topics);
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
event.args = null;
|
||||||
|
event.decodeError = error;
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
getEmit(event) {
|
||||||
|
const args = (event.args || []).slice();
|
||||||
|
args.push(event);
|
||||||
|
return args;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// A Wildard Event will attempt to populate:
|
||||||
|
// - event The name of the event name
|
||||||
|
// - eventSignature The full signature of the event
|
||||||
|
// - decode A function to decode data and topics
|
||||||
|
// - args The decoded data and topics
|
||||||
class WildcardRunningEvent extends RunningEvent {
|
class WildcardRunningEvent extends RunningEvent {
|
||||||
constructor(address, contractInterface) {
|
constructor(address, contractInterface) {
|
||||||
super("*", { address: address });
|
super("*", { address: address });
|
||||||
@ -8248,8 +8274,8 @@ class WildcardRunningEvent extends RunningEvent {
|
|||||||
}
|
}
|
||||||
prepareEvent(event) {
|
prepareEvent(event) {
|
||||||
super.prepareEvent(event);
|
super.prepareEvent(event);
|
||||||
const parsed = this.interface.parseLog(event);
|
try {
|
||||||
if (parsed) {
|
const parsed = this.interface.parseLog(event);
|
||||||
event.event = parsed.name;
|
event.event = parsed.name;
|
||||||
event.eventSignature = parsed.signature;
|
event.eventSignature = parsed.signature;
|
||||||
event.decode = (data, topics) => {
|
event.decode = (data, topics) => {
|
||||||
@ -8257,6 +8283,9 @@ class WildcardRunningEvent extends RunningEvent {
|
|||||||
};
|
};
|
||||||
event.args = parsed.args;
|
event.args = parsed.args;
|
||||||
}
|
}
|
||||||
|
catch (error) {
|
||||||
|
// No matching event
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
class Contract {
|
class Contract {
|
||||||
@ -8463,27 +8492,26 @@ class Contract {
|
|||||||
if (eventName === "*") {
|
if (eventName === "*") {
|
||||||
return this._normalizeRunningEvent(new WildcardRunningEvent(this.address, this.interface));
|
return this._normalizeRunningEvent(new WildcardRunningEvent(this.address, this.interface));
|
||||||
}
|
}
|
||||||
|
// Get the event Fragment (throws if ambiguous/unknown event)
|
||||||
const fragment = this.interface.getEvent(eventName);
|
const fragment = this.interface.getEvent(eventName);
|
||||||
if (!fragment) {
|
|
||||||
logger$f.throwArgumentError("unknown event - " + eventName, "eventName", eventName);
|
|
||||||
}
|
|
||||||
return this._normalizeRunningEvent(new FragmentRunningEvent(this.address, this.interface, fragment));
|
return this._normalizeRunningEvent(new FragmentRunningEvent(this.address, this.interface, fragment));
|
||||||
}
|
}
|
||||||
const filter = {
|
// We have topics to filter by...
|
||||||
address: this.address
|
if (eventName.topics && eventName.topics.length > 0) {
|
||||||
};
|
// Is it a known topichash? (throws if no matching topichash)
|
||||||
// Find the matching event in the ABI; if none, we still allow filtering
|
try {
|
||||||
// since it may be a filter for an otherwise unknown event
|
|
||||||
if (eventName.topics) {
|
|
||||||
if (eventName.topics[0]) {
|
|
||||||
const fragment = this.interface.getEvent(eventName.topics[0]);
|
const fragment = this.interface.getEvent(eventName.topics[0]);
|
||||||
if (fragment) {
|
return this._normalizeRunningEvent(new FragmentRunningEvent(this.address, this.interface, fragment, eventName.topics));
|
||||||
return this._normalizeRunningEvent(new FragmentRunningEvent(this.address, this.interface, fragment, eventName.topics));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
filter.topics = eventName.topics;
|
catch (error) { }
|
||||||
|
// Filter by the unknown topichash
|
||||||
|
const filter = {
|
||||||
|
address: this.address,
|
||||||
|
topics: eventName.topics
|
||||||
|
};
|
||||||
|
return this._normalizeRunningEvent(new RunningEvent(getEventTag(filter), filter));
|
||||||
}
|
}
|
||||||
return this._normalizeRunningEvent(new RunningEvent(getEventTag(filter), filter));
|
return this._normalizeRunningEvent(new WildcardRunningEvent(this.address, this.interface));
|
||||||
}
|
}
|
||||||
_checkRunningEvents(runningEvent) {
|
_checkRunningEvents(runningEvent) {
|
||||||
if (runningEvent.listenerCount() === 0) {
|
if (runningEvent.listenerCount() === 0) {
|
||||||
@ -8496,15 +8524,10 @@ class Contract {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Subclasses can override this to gracefully recover
|
||||||
|
// from parse errors if they wish
|
||||||
_wrapEvent(runningEvent, log, listener) {
|
_wrapEvent(runningEvent, log, listener) {
|
||||||
const event = deepCopy(log);
|
const event = deepCopy(log);
|
||||||
try {
|
|
||||||
runningEvent.prepareEvent(event);
|
|
||||||
}
|
|
||||||
catch (error) {
|
|
||||||
this.emit("error", error);
|
|
||||||
throw error;
|
|
||||||
}
|
|
||||||
event.removeListener = () => {
|
event.removeListener = () => {
|
||||||
if (!listener) {
|
if (!listener) {
|
||||||
return;
|
return;
|
||||||
@ -8515,6 +8538,8 @@ class Contract {
|
|||||||
event.getBlock = () => { return this.provider.getBlock(log.blockHash); };
|
event.getBlock = () => { return this.provider.getBlock(log.blockHash); };
|
||||||
event.getTransaction = () => { return this.provider.getTransaction(log.transactionHash); };
|
event.getTransaction = () => { return this.provider.getTransaction(log.transactionHash); };
|
||||||
event.getTransactionReceipt = () => { return this.provider.getTransactionReceipt(log.transactionHash); };
|
event.getTransactionReceipt = () => { return this.provider.getTransactionReceipt(log.transactionHash); };
|
||||||
|
// This may throw if the topics and data mismatch the signature
|
||||||
|
runningEvent.prepareEvent(event);
|
||||||
return event;
|
return event;
|
||||||
}
|
}
|
||||||
_addEventListener(runningEvent, listener, once) {
|
_addEventListener(runningEvent, listener, once) {
|
||||||
@ -8524,12 +8549,19 @@ class Contract {
|
|||||||
runningEvent.addListener(listener, once);
|
runningEvent.addListener(listener, once);
|
||||||
// Track this running event and its listeners (may already be there; but no hard in updating)
|
// Track this running event and its listeners (may already be there; but no hard in updating)
|
||||||
this._runningEvents[runningEvent.tag] = runningEvent;
|
this._runningEvents[runningEvent.tag] = runningEvent;
|
||||||
// If we are not polling the provider, start
|
// If we are not polling the provider, start polling
|
||||||
if (!this._wrappedEmits[runningEvent.tag]) {
|
if (!this._wrappedEmits[runningEvent.tag]) {
|
||||||
const wrappedEmit = (log) => {
|
const wrappedEmit = (log) => {
|
||||||
const event = this._wrapEvent(runningEvent, log, listener);
|
let event = null;
|
||||||
const args = (event.args || []).slice();
|
try {
|
||||||
args.push(event);
|
event = this._wrapEvent(runningEvent, log, listener);
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
// There was an error decoding the data and topics
|
||||||
|
this.emit("error", error, event);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const args = runningEvent.getEmit(event);
|
||||||
this.emit(runningEvent.filter, ...args);
|
this.emit(runningEvent.filter, ...args);
|
||||||
};
|
};
|
||||||
this._wrappedEmits[runningEvent.tag] = wrappedEmit;
|
this._wrappedEmits[runningEvent.tag] = wrappedEmit;
|
||||||
@ -16345,7 +16377,7 @@ function poll(func, options) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const version$k = "providers/5.0.0-beta.161";
|
const version$k = "providers/5.0.0-beta.162";
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
const logger$o = new Logger(version$k);
|
const logger$o = new Logger(version$k);
|
||||||
@ -16747,7 +16779,7 @@ function checkTopic(topic) {
|
|||||||
function serializeTopics(topics) {
|
function serializeTopics(topics) {
|
||||||
// Remove trailing null AND-topics; they are redundant
|
// Remove trailing null AND-topics; they are redundant
|
||||||
topics = topics.slice();
|
topics = topics.slice();
|
||||||
while (topics[topics.length - 1] == null) {
|
while (topics.length > 0 && topics[topics.length - 1] == null) {
|
||||||
topics.pop();
|
topics.pop();
|
||||||
}
|
}
|
||||||
return topics.map((topic) => {
|
return topics.map((topic) => {
|
||||||
@ -16768,6 +16800,9 @@ function serializeTopics(topics) {
|
|||||||
}).join("&");
|
}).join("&");
|
||||||
}
|
}
|
||||||
function deserializeTopics(data) {
|
function deserializeTopics(data) {
|
||||||
|
if (data === "") {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
return data.split(/&/g).map((topic) => {
|
return data.split(/&/g).map((topic) => {
|
||||||
return topic.split("|").map((topic) => {
|
return topic.split("|").map((topic) => {
|
||||||
return ((topic === "null") ? null : topic);
|
return ((topic === "null") ? null : topic);
|
||||||
@ -16842,12 +16877,14 @@ class Event {
|
|||||||
if (comps[0] !== "filter") {
|
if (comps[0] !== "filter") {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
const filter = {
|
const address = comps[1];
|
||||||
address: comps[1],
|
const topics = deserializeTopics(comps[2]);
|
||||||
topics: deserializeTopics(comps[2])
|
const filter = {};
|
||||||
};
|
if (topics.length > 0) {
|
||||||
if (!filter.address || filter.address === "*") {
|
filter.topics = topics;
|
||||||
delete filter.address;
|
}
|
||||||
|
if (address && address !== "*") {
|
||||||
|
filter.address = address;
|
||||||
}
|
}
|
||||||
return filter;
|
return filter;
|
||||||
}
|
}
|
||||||
@ -19195,7 +19232,7 @@ class Web3Provider extends JsonRpcProvider {
|
|||||||
var _version$6 = createCommonjsModule(function (module, exports) {
|
var _version$6 = createCommonjsModule(function (module, exports) {
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.version = "providers/5.0.0-beta.161";
|
exports.version = "providers/5.0.0-beta.162";
|
||||||
});
|
});
|
||||||
|
|
||||||
var _version$7 = unwrapExports(_version$6);
|
var _version$7 = unwrapExports(_version$6);
|
||||||
@ -19728,7 +19765,7 @@ var utils$1 = /*#__PURE__*/Object.freeze({
|
|||||||
Indexed: Indexed
|
Indexed: Indexed
|
||||||
});
|
});
|
||||||
|
|
||||||
const version$m = "ethers/5.0.0-beta.181";
|
const version$m = "ethers/5.0.0-beta.182";
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
const errors = Logger.errors;
|
const errors = Logger.errors;
|
||||||
|
2
packages/ethers/dist/ethers.esm.min.js
vendored
2
packages/ethers/dist/ethers.esm.min.js
vendored
File diff suppressed because one or more lines are too long
123
packages/ethers/dist/ethers.umd.js
vendored
123
packages/ethers/dist/ethers.umd.js
vendored
@ -8908,7 +8908,7 @@
|
|||||||
var _version$m = createCommonjsModule(function (module, exports) {
|
var _version$m = createCommonjsModule(function (module, exports) {
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.version = "contracts/5.0.0-beta.147";
|
exports.version = "contracts/5.0.0-beta.148";
|
||||||
});
|
});
|
||||||
|
|
||||||
var _version$n = unwrapExports(_version$m);
|
var _version$n = unwrapExports(_version$m);
|
||||||
@ -9167,6 +9167,10 @@
|
|||||||
};
|
};
|
||||||
RunningEvent.prototype.prepareEvent = function (event) {
|
RunningEvent.prototype.prepareEvent = function (event) {
|
||||||
};
|
};
|
||||||
|
// Returns the array that will be applied to an emit
|
||||||
|
RunningEvent.prototype.getEmit = function (event) {
|
||||||
|
return [event];
|
||||||
|
};
|
||||||
return RunningEvent;
|
return RunningEvent;
|
||||||
}());
|
}());
|
||||||
var ErrorRunningEvent = /** @class */ (function (_super) {
|
var ErrorRunningEvent = /** @class */ (function (_super) {
|
||||||
@ -9176,6 +9180,11 @@
|
|||||||
}
|
}
|
||||||
return ErrorRunningEvent;
|
return ErrorRunningEvent;
|
||||||
}(RunningEvent));
|
}(RunningEvent));
|
||||||
|
// @TODO Fragment should inherit Wildcard? and just override getEmit?
|
||||||
|
// or have a common abstract super class, with enough constructor
|
||||||
|
// options to configure both.
|
||||||
|
// A Fragment Event will populate all the properties that Wildcard
|
||||||
|
// will, and additioanlly dereference the arguments when emitting
|
||||||
var FragmentRunningEvent = /** @class */ (function (_super) {
|
var FragmentRunningEvent = /** @class */ (function (_super) {
|
||||||
__extends(FragmentRunningEvent, _super);
|
__extends(FragmentRunningEvent, _super);
|
||||||
function FragmentRunningEvent(address, contractInterface, fragment, topics) {
|
function FragmentRunningEvent(address, contractInterface, fragment, topics) {
|
||||||
@ -9207,10 +9216,27 @@
|
|||||||
event.decode = function (data, topics) {
|
event.decode = function (data, topics) {
|
||||||
return _this.interface.decodeEventLog(_this.fragment, data, topics);
|
return _this.interface.decodeEventLog(_this.fragment, data, topics);
|
||||||
};
|
};
|
||||||
event.args = this.interface.decodeEventLog(this.fragment, event.data, event.topics);
|
try {
|
||||||
|
event.args = this.interface.decodeEventLog(this.fragment, event.data, event.topics);
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
event.args = null;
|
||||||
|
event.decodeError = error;
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
FragmentRunningEvent.prototype.getEmit = function (event) {
|
||||||
|
var args = (event.args || []).slice();
|
||||||
|
args.push(event);
|
||||||
|
return args;
|
||||||
};
|
};
|
||||||
return FragmentRunningEvent;
|
return FragmentRunningEvent;
|
||||||
}(RunningEvent));
|
}(RunningEvent));
|
||||||
|
// A Wildard Event will attempt to populate:
|
||||||
|
// - event The name of the event name
|
||||||
|
// - eventSignature The full signature of the event
|
||||||
|
// - decode A function to decode data and topics
|
||||||
|
// - args The decoded data and topics
|
||||||
var WildcardRunningEvent = /** @class */ (function (_super) {
|
var WildcardRunningEvent = /** @class */ (function (_super) {
|
||||||
__extends(WildcardRunningEvent, _super);
|
__extends(WildcardRunningEvent, _super);
|
||||||
function WildcardRunningEvent(address, contractInterface) {
|
function WildcardRunningEvent(address, contractInterface) {
|
||||||
@ -9222,14 +9248,17 @@
|
|||||||
WildcardRunningEvent.prototype.prepareEvent = function (event) {
|
WildcardRunningEvent.prototype.prepareEvent = function (event) {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
_super.prototype.prepareEvent.call(this, event);
|
_super.prototype.prepareEvent.call(this, event);
|
||||||
var parsed = this.interface.parseLog(event);
|
try {
|
||||||
if (parsed) {
|
var parsed_1 = this.interface.parseLog(event);
|
||||||
event.event = parsed.name;
|
event.event = parsed_1.name;
|
||||||
event.eventSignature = parsed.signature;
|
event.eventSignature = parsed_1.signature;
|
||||||
event.decode = function (data, topics) {
|
event.decode = function (data, topics) {
|
||||||
return _this.interface.decodeEventLog(parsed.eventFragment, data, topics);
|
return _this.interface.decodeEventLog(parsed_1.eventFragment, data, topics);
|
||||||
};
|
};
|
||||||
event.args = parsed.args;
|
event.args = parsed_1.args;
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
// No matching event
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return WildcardRunningEvent;
|
return WildcardRunningEvent;
|
||||||
@ -9446,27 +9475,26 @@
|
|||||||
if (eventName === "*") {
|
if (eventName === "*") {
|
||||||
return this._normalizeRunningEvent(new WildcardRunningEvent(this.address, this.interface));
|
return this._normalizeRunningEvent(new WildcardRunningEvent(this.address, this.interface));
|
||||||
}
|
}
|
||||||
|
// Get the event Fragment (throws if ambiguous/unknown event)
|
||||||
var fragment = this.interface.getEvent(eventName);
|
var fragment = this.interface.getEvent(eventName);
|
||||||
if (!fragment) {
|
|
||||||
logger.throwArgumentError("unknown event - " + eventName, "eventName", eventName);
|
|
||||||
}
|
|
||||||
return this._normalizeRunningEvent(new FragmentRunningEvent(this.address, this.interface, fragment));
|
return this._normalizeRunningEvent(new FragmentRunningEvent(this.address, this.interface, fragment));
|
||||||
}
|
}
|
||||||
var filter = {
|
// We have topics to filter by...
|
||||||
address: this.address
|
if (eventName.topics && eventName.topics.length > 0) {
|
||||||
};
|
// Is it a known topichash? (throws if no matching topichash)
|
||||||
// Find the matching event in the ABI; if none, we still allow filtering
|
try {
|
||||||
// since it may be a filter for an otherwise unknown event
|
|
||||||
if (eventName.topics) {
|
|
||||||
if (eventName.topics[0]) {
|
|
||||||
var fragment = this.interface.getEvent(eventName.topics[0]);
|
var fragment = this.interface.getEvent(eventName.topics[0]);
|
||||||
if (fragment) {
|
return this._normalizeRunningEvent(new FragmentRunningEvent(this.address, this.interface, fragment, eventName.topics));
|
||||||
return this._normalizeRunningEvent(new FragmentRunningEvent(this.address, this.interface, fragment, eventName.topics));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
filter.topics = eventName.topics;
|
catch (error) { }
|
||||||
|
// Filter by the unknown topichash
|
||||||
|
var filter = {
|
||||||
|
address: this.address,
|
||||||
|
topics: eventName.topics
|
||||||
|
};
|
||||||
|
return this._normalizeRunningEvent(new RunningEvent(getEventTag(filter), filter));
|
||||||
}
|
}
|
||||||
return this._normalizeRunningEvent(new RunningEvent(getEventTag(filter), filter));
|
return this._normalizeRunningEvent(new WildcardRunningEvent(this.address, this.interface));
|
||||||
};
|
};
|
||||||
Contract.prototype._checkRunningEvents = function (runningEvent) {
|
Contract.prototype._checkRunningEvents = function (runningEvent) {
|
||||||
if (runningEvent.listenerCount() === 0) {
|
if (runningEvent.listenerCount() === 0) {
|
||||||
@ -9479,16 +9507,11 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
// Subclasses can override this to gracefully recover
|
||||||
|
// from parse errors if they wish
|
||||||
Contract.prototype._wrapEvent = function (runningEvent, log, listener) {
|
Contract.prototype._wrapEvent = function (runningEvent, log, listener) {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
var event = lib$3.deepCopy(log);
|
var event = lib$3.deepCopy(log);
|
||||||
try {
|
|
||||||
runningEvent.prepareEvent(event);
|
|
||||||
}
|
|
||||||
catch (error) {
|
|
||||||
this.emit("error", error);
|
|
||||||
throw error;
|
|
||||||
}
|
|
||||||
event.removeListener = function () {
|
event.removeListener = function () {
|
||||||
if (!listener) {
|
if (!listener) {
|
||||||
return;
|
return;
|
||||||
@ -9499,6 +9522,8 @@
|
|||||||
event.getBlock = function () { return _this.provider.getBlock(log.blockHash); };
|
event.getBlock = function () { return _this.provider.getBlock(log.blockHash); };
|
||||||
event.getTransaction = function () { return _this.provider.getTransaction(log.transactionHash); };
|
event.getTransaction = function () { return _this.provider.getTransaction(log.transactionHash); };
|
||||||
event.getTransactionReceipt = function () { return _this.provider.getTransactionReceipt(log.transactionHash); };
|
event.getTransactionReceipt = function () { return _this.provider.getTransactionReceipt(log.transactionHash); };
|
||||||
|
// This may throw if the topics and data mismatch the signature
|
||||||
|
runningEvent.prepareEvent(event);
|
||||||
return event;
|
return event;
|
||||||
};
|
};
|
||||||
Contract.prototype._addEventListener = function (runningEvent, listener, once) {
|
Contract.prototype._addEventListener = function (runningEvent, listener, once) {
|
||||||
@ -9509,12 +9534,19 @@
|
|||||||
runningEvent.addListener(listener, once);
|
runningEvent.addListener(listener, once);
|
||||||
// Track this running event and its listeners (may already be there; but no hard in updating)
|
// Track this running event and its listeners (may already be there; but no hard in updating)
|
||||||
this._runningEvents[runningEvent.tag] = runningEvent;
|
this._runningEvents[runningEvent.tag] = runningEvent;
|
||||||
// If we are not polling the provider, start
|
// If we are not polling the provider, start polling
|
||||||
if (!this._wrappedEmits[runningEvent.tag]) {
|
if (!this._wrappedEmits[runningEvent.tag]) {
|
||||||
var wrappedEmit = function (log) {
|
var wrappedEmit = function (log) {
|
||||||
var event = _this._wrapEvent(runningEvent, log, listener);
|
var event = null;
|
||||||
var args = (event.args || []).slice();
|
try {
|
||||||
args.push(event);
|
event = _this._wrapEvent(runningEvent, log, listener);
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
// There was an error decoding the data and topics
|
||||||
|
_this.emit("error", error, event);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var args = runningEvent.getEmit(event);
|
||||||
_this.emit.apply(_this, __spreadArrays([runningEvent.filter], args));
|
_this.emit.apply(_this, __spreadArrays([runningEvent.filter], args));
|
||||||
};
|
};
|
||||||
this._wrappedEmits[runningEvent.tag] = wrappedEmit;
|
this._wrappedEmits[runningEvent.tag] = wrappedEmit;
|
||||||
@ -17806,7 +17838,7 @@
|
|||||||
var _version$I = createCommonjsModule(function (module, exports) {
|
var _version$I = createCommonjsModule(function (module, exports) {
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.version = "providers/5.0.0-beta.161";
|
exports.version = "providers/5.0.0-beta.162";
|
||||||
});
|
});
|
||||||
|
|
||||||
var _version$J = unwrapExports(_version$I);
|
var _version$J = unwrapExports(_version$I);
|
||||||
@ -18284,7 +18316,7 @@
|
|||||||
function serializeTopics(topics) {
|
function serializeTopics(topics) {
|
||||||
// Remove trailing null AND-topics; they are redundant
|
// Remove trailing null AND-topics; they are redundant
|
||||||
topics = topics.slice();
|
topics = topics.slice();
|
||||||
while (topics[topics.length - 1] == null) {
|
while (topics.length > 0 && topics[topics.length - 1] == null) {
|
||||||
topics.pop();
|
topics.pop();
|
||||||
}
|
}
|
||||||
return topics.map(function (topic) {
|
return topics.map(function (topic) {
|
||||||
@ -18305,6 +18337,9 @@
|
|||||||
}).join("&");
|
}).join("&");
|
||||||
}
|
}
|
||||||
function deserializeTopics(data) {
|
function deserializeTopics(data) {
|
||||||
|
if (data === "") {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
return data.split(/&/g).map(function (topic) {
|
return data.split(/&/g).map(function (topic) {
|
||||||
return topic.split("|").map(function (topic) {
|
return topic.split("|").map(function (topic) {
|
||||||
return ((topic === "null") ? null : topic);
|
return ((topic === "null") ? null : topic);
|
||||||
@ -18392,12 +18427,14 @@
|
|||||||
if (comps[0] !== "filter") {
|
if (comps[0] !== "filter") {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
var filter = {
|
var address = comps[1];
|
||||||
address: comps[1],
|
var topics = deserializeTopics(comps[2]);
|
||||||
topics: deserializeTopics(comps[2])
|
var filter = {};
|
||||||
};
|
if (topics.length > 0) {
|
||||||
if (!filter.address || filter.address === "*") {
|
filter.topics = topics;
|
||||||
delete filter.address;
|
}
|
||||||
|
if (address && address !== "*") {
|
||||||
|
filter.address = address;
|
||||||
}
|
}
|
||||||
return filter;
|
return filter;
|
||||||
},
|
},
|
||||||
@ -22351,7 +22388,7 @@
|
|||||||
var _version$M = createCommonjsModule(function (module, exports) {
|
var _version$M = createCommonjsModule(function (module, exports) {
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.version = "ethers/5.0.0-beta.181";
|
exports.version = "ethers/5.0.0-beta.182";
|
||||||
});
|
});
|
||||||
|
|
||||||
var _version$N = unwrapExports(_version$M);
|
var _version$N = unwrapExports(_version$M);
|
||||||
|
2
packages/ethers/dist/ethers.umd.min.js
vendored
2
packages/ethers/dist/ethers.umd.min.js
vendored
File diff suppressed because one or more lines are too long
2
packages/ethers/lib.esm/_version.d.ts
vendored
2
packages/ethers/lib.esm/_version.d.ts
vendored
@ -1 +1 @@
|
|||||||
export declare const version = "ethers/5.0.0-beta.181";
|
export declare const version = "ethers/5.0.0-beta.182";
|
||||||
|
@ -1 +1 @@
|
|||||||
export const version = "ethers/5.0.0-beta.181";
|
export const version = "ethers/5.0.0-beta.182";
|
||||||
|
2
packages/ethers/lib/_version.d.ts
vendored
2
packages/ethers/lib/_version.d.ts
vendored
@ -1 +1 @@
|
|||||||
export declare const version = "ethers/5.0.0-beta.181";
|
export declare const version = "ethers/5.0.0-beta.182";
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.version = "ethers/5.0.0-beta.181";
|
exports.version = "ethers/5.0.0-beta.182";
|
||||||
|
@ -52,7 +52,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
},
|
},
|
||||||
"tarballHash": "0xa3e07c74fc1ea53f660f1543f14b836069db93879d1aad93fa033b03eb16f564",
|
"tarballHash": "0x17d9052dc2dcc4b6a160772fb2f80eeecc56137584c6d8ee54d912f52c3efa84",
|
||||||
"types": "./lib/index.d.ts",
|
"types": "./lib/index.d.ts",
|
||||||
"version": "5.0.0-beta.181"
|
"version": "5.0.0-beta.182"
|
||||||
}
|
}
|
||||||
|
@ -1 +1 @@
|
|||||||
export const version = "ethers/5.0.0-beta.181";
|
export const version = "ethers/5.0.0-beta.182";
|
||||||
|
2
packages/providers/lib.esm/_version.d.ts
vendored
2
packages/providers/lib.esm/_version.d.ts
vendored
@ -1 +1 @@
|
|||||||
export declare const version = "providers/5.0.0-beta.161";
|
export declare const version = "providers/5.0.0-beta.162";
|
||||||
|
@ -1 +1 @@
|
|||||||
export const version = "providers/5.0.0-beta.161";
|
export const version = "providers/5.0.0-beta.162";
|
||||||
|
@ -34,7 +34,7 @@ function checkTopic(topic) {
|
|||||||
function serializeTopics(topics) {
|
function serializeTopics(topics) {
|
||||||
// Remove trailing null AND-topics; they are redundant
|
// Remove trailing null AND-topics; they are redundant
|
||||||
topics = topics.slice();
|
topics = topics.slice();
|
||||||
while (topics[topics.length - 1] == null) {
|
while (topics.length > 0 && topics[topics.length - 1] == null) {
|
||||||
topics.pop();
|
topics.pop();
|
||||||
}
|
}
|
||||||
return topics.map((topic) => {
|
return topics.map((topic) => {
|
||||||
@ -55,6 +55,9 @@ function serializeTopics(topics) {
|
|||||||
}).join("&");
|
}).join("&");
|
||||||
}
|
}
|
||||||
function deserializeTopics(data) {
|
function deserializeTopics(data) {
|
||||||
|
if (data === "") {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
return data.split(/&/g).map((topic) => {
|
return data.split(/&/g).map((topic) => {
|
||||||
return topic.split("|").map((topic) => {
|
return topic.split("|").map((topic) => {
|
||||||
return ((topic === "null") ? null : topic);
|
return ((topic === "null") ? null : topic);
|
||||||
@ -129,12 +132,14 @@ export class Event {
|
|||||||
if (comps[0] !== "filter") {
|
if (comps[0] !== "filter") {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
const filter = {
|
const address = comps[1];
|
||||||
address: comps[1],
|
const topics = deserializeTopics(comps[2]);
|
||||||
topics: deserializeTopics(comps[2])
|
const filter = {};
|
||||||
};
|
if (topics.length > 0) {
|
||||||
if (!filter.address || filter.address === "*") {
|
filter.topics = topics;
|
||||||
delete filter.address;
|
}
|
||||||
|
if (address && address !== "*") {
|
||||||
|
filter.address = address;
|
||||||
}
|
}
|
||||||
return filter;
|
return filter;
|
||||||
}
|
}
|
||||||
|
2
packages/providers/lib/_version.d.ts
vendored
2
packages/providers/lib/_version.d.ts
vendored
@ -1 +1 @@
|
|||||||
export declare const version = "providers/5.0.0-beta.161";
|
export declare const version = "providers/5.0.0-beta.162";
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.version = "providers/5.0.0-beta.161";
|
exports.version = "providers/5.0.0-beta.162";
|
||||||
|
@ -75,7 +75,7 @@ function checkTopic(topic) {
|
|||||||
function serializeTopics(topics) {
|
function serializeTopics(topics) {
|
||||||
// Remove trailing null AND-topics; they are redundant
|
// Remove trailing null AND-topics; they are redundant
|
||||||
topics = topics.slice();
|
topics = topics.slice();
|
||||||
while (topics[topics.length - 1] == null) {
|
while (topics.length > 0 && topics[topics.length - 1] == null) {
|
||||||
topics.pop();
|
topics.pop();
|
||||||
}
|
}
|
||||||
return topics.map(function (topic) {
|
return topics.map(function (topic) {
|
||||||
@ -96,6 +96,9 @@ function serializeTopics(topics) {
|
|||||||
}).join("&");
|
}).join("&");
|
||||||
}
|
}
|
||||||
function deserializeTopics(data) {
|
function deserializeTopics(data) {
|
||||||
|
if (data === "") {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
return data.split(/&/g).map(function (topic) {
|
return data.split(/&/g).map(function (topic) {
|
||||||
return topic.split("|").map(function (topic) {
|
return topic.split("|").map(function (topic) {
|
||||||
return ((topic === "null") ? null : topic);
|
return ((topic === "null") ? null : topic);
|
||||||
@ -183,12 +186,14 @@ var Event = /** @class */ (function () {
|
|||||||
if (comps[0] !== "filter") {
|
if (comps[0] !== "filter") {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
var filter = {
|
var address = comps[1];
|
||||||
address: comps[1],
|
var topics = deserializeTopics(comps[2]);
|
||||||
topics: deserializeTopics(comps[2])
|
var filter = {};
|
||||||
};
|
if (topics.length > 0) {
|
||||||
if (!filter.address || filter.address === "*") {
|
filter.topics = topics;
|
||||||
delete filter.address;
|
}
|
||||||
|
if (address && address !== "*") {
|
||||||
|
filter.address = address;
|
||||||
}
|
}
|
||||||
return filter;
|
return filter;
|
||||||
},
|
},
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
},
|
},
|
||||||
"tarballHash": "0x72ffec5f93c2e2263163a4e8a21016ca74bc67313b2ca84314cededde6d6bebf",
|
"tarballHash": "0x820979f20cca0966c9833c0a1b55e28ec19ed526cf3b4ac7401131dd0bcdf8ef",
|
||||||
"types": "./lib/index.d.ts",
|
"types": "./lib/index.d.ts",
|
||||||
"version": "5.0.0-beta.161"
|
"version": "5.0.0-beta.162"
|
||||||
}
|
}
|
||||||
|
@ -1 +1 @@
|
|||||||
export const version = "providers/5.0.0-beta.161";
|
export const version = "providers/5.0.0-beta.162";
|
||||||
|
Loading…
Reference in New Issue
Block a user