Updated dist files.

This commit is contained in:
Richard Moore 2020-01-07 19:58:04 -05:00
parent 2d5492cd2e
commit a7e29d60f7
No known key found for this signature in database
GPG Key ID: 665176BE8E9DC651
78 changed files with 451 additions and 334 deletions

View File

@ -3,6 +3,14 @@ Changelog
This change log is managed by `scripts/cmds/update-versions` but may be manually updated.
ethers/v5.0.0-beta.164 (2020-01-07 19:57)
-----------------------------------------
- Use better Description typing. ([2d5492c](https://github.com/ethers-io/ethers.js/commit/2d5492cd2ee722c818c249244af7b5bea05d67b0))
- Better property access on ABI decoded results. ([#698](https://github.com/ethers-io/ethers.js/issues/698); [13f50ab](https://github.com/ethers-io/ethers.js/commit/13f50abd847f7ddcc7e54c102da54e2d23b86fae))
- Better typing support for Description. ([d0f4642](https://github.com/ethers-io/ethers.js/commit/d0f4642f6d2c9f5119f1910a0082894c60e81191))
- Fixed resolveName when name is an address with an invalid checksum. ([#694](https://github.com/ethers-io/ethers.js/issues/694); [1e72fc7](https://github.com/ethers-io/ethers.js/commit/1e72fc7d6f7c3be4410dbdcfbab9a0463ceb52bd))
ethers/v5.0.0-beta.163 (2020-01-06 18:57)
-----------------------------------------

View File

@ -1 +1 @@
export declare const version = "abi/5.0.0-beta.143";
export declare const version = "abi/5.0.0-beta.144";

View File

@ -1 +1 @@
export const version = "abi/5.0.0-beta.143";
export const version = "abi/5.0.0-beta.144";

View File

@ -1,5 +1,5 @@
import { BytesLike } from "@ethersproject/bytes";
import { Coder, Reader, Writer } from "./coders/abstract-coder";
import { Coder, Reader, Result, Writer } from "./coders/abstract-coder";
import { ParamType } from "./fragments";
export declare type CoerceFunc = (type: string, value: any) => any;
export declare class AbiCoder {
@ -10,6 +10,6 @@ export declare class AbiCoder {
_getReader(data: Uint8Array): Reader;
_getWriter(): Writer;
encode(types: Array<string | ParamType>, values: Array<any>): string;
decode(types: Array<string | ParamType>, data: BytesLike): any;
decode(types: Array<string | ParamType>, data: BytesLike): Result;
}
export declare const defaultAbiCoder: AbiCoder;

View File

@ -76,15 +76,15 @@ export class AbiCoder {
value: { types: types, values: values }
});
}
let coders = types.map((type) => this._getCoder(ParamType.from(type)));
let coder = (new TupleCoder(coders, "_"));
let writer = this._getWriter();
const coders = types.map((type) => this._getCoder(ParamType.from(type)));
const coder = (new TupleCoder(coders, "_"));
const writer = this._getWriter();
coder.encode(writer, values);
return writer.data;
}
decode(types, data) {
let coders = types.map((type) => this._getCoder(ParamType.from(type)));
let coder = new TupleCoder(coders, "_");
const coders = types.map((type) => this._getCoder(ParamType.from(type)));
const coder = new TupleCoder(coders, "_");
return coder.decode(this._getReader(arrayify(data)));
}
}

View File

@ -1,5 +1,8 @@
import { BytesLike } from "@ethersproject/bytes";
import { BigNumber, BigNumberish } from "@ethersproject/bignumber";
export interface Result extends Array<any> {
[key: string]: any;
}
export declare type CoerceFunc = (type: string, value: any) => any;
export declare abstract class Coder {
readonly name: string;

View File

@ -1,4 +1,4 @@
import { ConstructorFragment, EventFragment, FormatTypes, Fragment, FunctionFragment, JsonFragment, JsonFragmentType, ParamType } from "./fragments";
import { AbiCoder, CoerceFunc, defaultAbiCoder } from "./abi-coder";
import { Indexed, Interface } from "./interface";
export { ConstructorFragment, EventFragment, Fragment, FunctionFragment, ParamType, FormatTypes, AbiCoder, defaultAbiCoder, Interface, Indexed, CoerceFunc, JsonFragment, JsonFragmentType };
import { Indexed, Interface, Result } from "./interface";
export { ConstructorFragment, EventFragment, Fragment, FunctionFragment, ParamType, FormatTypes, AbiCoder, defaultAbiCoder, Interface, Indexed, CoerceFunc, JsonFragment, JsonFragmentType, Result };

View File

@ -2,30 +2,29 @@ import { BigNumber, BigNumberish } from "@ethersproject/bignumber";
import { BytesLike } from "@ethersproject/bytes";
import { Description } from "@ethersproject/properties";
import { AbiCoder } from "./abi-coder";
import { Result } from "./coders/abstract-coder";
import { ConstructorFragment, EventFragment, Fragment, FunctionFragment, JsonFragment, ParamType } from "./fragments";
export declare class LogDescription extends Description {
export { Result };
export declare class LogDescription extends Description<LogDescription> {
readonly eventFragment: EventFragment;
readonly name: string;
readonly signature: string;
readonly topic: string;
readonly values: any;
readonly args: Result;
}
export declare class TransactionDescription extends Description {
export declare class TransactionDescription extends Description<TransactionDescription> {
readonly functionFragment: FunctionFragment;
readonly name: string;
readonly args: Array<any>;
readonly args: Result;
readonly signature: string;
readonly sighash: string;
readonly value: BigNumber;
}
export declare class Indexed extends Description {
export declare class Indexed extends Description<Indexed> {
readonly hash: string;
readonly _isIndexed: boolean;
static isIndexed(value: any): value is Indexed;
}
export declare class Result {
[key: string]: any;
[key: number]: any;
}
export declare class Interface {
readonly fragments: Array<Fragment>;
readonly errors: {
@ -44,23 +43,24 @@ export declare class Interface {
readonly _abiCoder: AbiCoder;
static _isInterface: boolean;
constructor(fragments: string | Array<Fragment | JsonFragment | string>);
format(format?: string): string | Array<string>;
static getAbiCoder(): AbiCoder;
static getAddress(address: string): string;
_sighashify(functionFragment: FunctionFragment): string;
_topicify(eventFragment: EventFragment): string;
static getSighash(functionFragment: FunctionFragment): string;
static getTopic(eventFragment: EventFragment): string;
getFunction(nameOrSignatureOrSighash: string): FunctionFragment;
getEvent(nameOrSignatureOrTopic: string): EventFragment;
getSighash(functionFragment: FunctionFragment | string): string;
getEventTopic(eventFragment: EventFragment | string): string;
_decodeParams(params: Array<ParamType>, data: BytesLike): Array<any>;
_decodeParams(params: Array<ParamType>, data: BytesLike): Result;
_encodeParams(params: Array<ParamType>, values: Array<any>): string;
encodeDeploy(values?: Array<any>): string;
decodeFunctionData(functionFragment: FunctionFragment | string, data: BytesLike): Array<any>;
decodeFunctionData(functionFragment: FunctionFragment | string, data: BytesLike): Result;
encodeFunctionData(functionFragment: FunctionFragment | string, values?: Array<any>): string;
decodeFunctionResult(functionFragment: FunctionFragment | string, data: BytesLike): Array<any>;
decodeFunctionResult(functionFragment: FunctionFragment | string, data: BytesLike): Result;
encodeFunctionResult(functionFragment: FunctionFragment | string, values?: Array<any>): string;
encodeFilterTopics(eventFragment: EventFragment, values: Array<any>): Array<string | Array<string>>;
decodeEventLog(eventFragment: EventFragment | string, data: BytesLike, topics?: Array<string>): Array<any>;
decodeEventLog(eventFragment: EventFragment | string, data: BytesLike, topics?: Array<string>): Result;
parseTransaction(tx: {
data: string;
value?: BigNumberish;

View File

@ -6,7 +6,7 @@ import { id } from "@ethersproject/hash";
import { keccak256 } from "@ethersproject/keccak256";
import { defineReadOnly, Description, getStatic } from "@ethersproject/properties";
import { defaultAbiCoder } from "./abi-coder";
import { ConstructorFragment, EventFragment, Fragment, FunctionFragment, ParamType } from "./fragments";
import { ConstructorFragment, EventFragment, FormatTypes, Fragment, FunctionFragment, ParamType } from "./fragments";
import { Logger } from "@ethersproject/logger";
import { version } from "./_version";
const logger = new Logger(version);
@ -19,8 +19,6 @@ export class Indexed extends Description {
return !!(value && value._isIndexed);
}
}
export class Result {
}
export class Interface {
constructor(fragments) {
logger.checkNew(new.target, Interface);
@ -66,38 +64,40 @@ export class Interface {
}
bucket[signature] = fragment;
});
// Add any fragments with a unique name by its name (sans signature parameters)
/*
[this.events, this.functions].forEach((bucket) => {
let count = getNameCount(bucket);
Object.keys(bucket).forEach((signature) => {
let fragment = bucket[signature];
if (count[fragment.name] !== 1) {
logger.warn("duplicate definition - " + fragment.name);
return;
}
bucket[fragment.name] = fragment;
});
});
*/
// If we do not have a constructor use the default "constructor() payable"
if (!this.deploy) {
defineReadOnly(this, "deploy", ConstructorFragment.from({ type: "constructor" }));
}
defineReadOnly(this, "_isInterface", true);
}
format(format) {
if (!format) {
format = FormatTypes.full;
}
if (format === FormatTypes.sighash) {
logger.throwArgumentError("interface does not support formating sighash", "format", format);
}
const abi = this.fragments.map((fragment) => fragment.format(format));
// We need to re-bundle the JSON fragments a bit
if (format === FormatTypes.json) {
return JSON.stringify(abi.map((j) => JSON.parse(j)));
}
return abi;
}
// Sub-classes can override these to handle other blockchains
static getAbiCoder() {
return defaultAbiCoder;
}
static getAddress(address) {
return getAddress(address);
}
_sighashify(functionFragment) {
static getSighash(functionFragment) {
return hexDataSlice(id(functionFragment.format()), 0, 4);
}
_topicify(eventFragment) {
static getTopic(eventFragment) {
return id(eventFragment.format());
}
// Find a function definition by any means necessary (unless it is ambiguous)
getFunction(nameOrSignatureOrSighash) {
if (isHexString(nameOrSignatureOrSighash)) {
for (const name in this.functions) {
@ -126,6 +126,7 @@ export class Interface {
}
return result;
}
// Find an event definition by any means necessary (unless it is ambiguous)
getEvent(nameOrSignatureOrTopic) {
if (isHexString(nameOrSignatureOrTopic)) {
const topichash = nameOrSignatureOrTopic.toLowerCase();
@ -155,17 +156,19 @@ export class Interface {
}
return result;
}
// Get the sighash (the bytes4 selector) used by Solidity to identify a function
getSighash(functionFragment) {
if (typeof (functionFragment) === "string") {
functionFragment = this.getFunction(functionFragment);
}
return this._sighashify(functionFragment);
return getStatic(this.constructor, "getSighash")(functionFragment);
}
// Get the topic (the bytes32 hash) used by Solidity to identify an event
getEventTopic(eventFragment) {
if (typeof (eventFragment) === "string") {
eventFragment = this.getEvent(eventFragment);
}
return this._topicify(eventFragment);
return getStatic(this.constructor, "getTopic")(eventFragment);
}
_decodeParams(params, data) {
return this._abiCoder.decode(params, data);
@ -176,6 +179,7 @@ export class Interface {
encodeDeploy(values) {
return this._encodeParams(this.deploy.inputs, values || []);
}
// Decode the data for a function call (e.g. tx.data)
decodeFunctionData(functionFragment, data) {
if (typeof (functionFragment) === "string") {
functionFragment = this.getFunction(functionFragment);
@ -186,6 +190,7 @@ export class Interface {
}
return this._decodeParams(functionFragment.inputs, bytes.slice(4));
}
// Encode the data for a function call (e.g. tx.data)
encodeFunctionData(functionFragment, values) {
if (typeof (functionFragment) === "string") {
functionFragment = this.getFunction(functionFragment);
@ -195,6 +200,7 @@ export class Interface {
this._encodeParams(functionFragment.inputs, values || [])
]));
}
// Decode the result from a function call (e.g. from eth_call)
decodeFunctionResult(functionFragment, data) {
if (typeof (functionFragment) === "string") {
functionFragment = this.getFunction(functionFragment);
@ -212,7 +218,7 @@ export class Interface {
case 4:
if (hexlify(bytes.slice(0, 4)) === "0x08c379a0") {
errorSignature = "Error(string)";
reason = this._abiCoder.decode(["string"], bytes.slice(4));
reason = this._abiCoder.decode(["string"], bytes.slice(4))[0];
}
break;
}
@ -223,12 +229,14 @@ export class Interface {
reason: reason
});
}
// Encode the result for a function call (e.g. for eth_call)
encodeFunctionResult(functionFragment, values) {
if (typeof (functionFragment) === "string") {
functionFragment = this.getFunction(functionFragment);
}
return hexlify(this._abiCoder.encode(functionFragment.outputs, values || []));
}
// Create the filter for the event with search criteria (e.g. for eth_filterLog)
encodeFilterTopics(eventFragment, values) {
if (typeof (eventFragment) === "string") {
eventFragment = this.getEvent(eventFragment);
@ -277,6 +285,7 @@ export class Interface {
}
return topics;
}
// Decode a filter for the event and the search criteria
decodeEventLog(eventFragment, data, topics) {
if (typeof (eventFragment) === "string") {
eventFragment = this.getEvent(eventFragment);
@ -326,10 +335,14 @@ export class Interface {
else {
result[index] = resultNonIndexed[nonIndexedIndex++];
}
//if (param.name && result[param.name] == null) { result[param.name] = result[index]; }
if (param.name && result[param.name] == null) {
result[param.name] = result[index];
}
});
return result;
}
// Given a transaction, find the matching function fragment (if any) and
// determine all its properties and call parameters
parseTransaction(tx) {
let fragment = this.getFunction(tx.data.substring(0, 10).toLowerCase());
if (!fragment) {
@ -344,18 +357,22 @@ export class Interface {
value: BigNumber.from(tx.value || "0"),
});
}
// Given an event log, find the matching event fragment (if any) and
// determine all its properties and values
parseLog(log) {
let fragment = this.getEvent(log.topics[0]);
if (!fragment || fragment.anonymous) {
return null;
}
// @TODO: If anonymous, and the only method, and the input count matches, should we parse?
// Probably not, because just because it is the only event in the ABI does
// not mean we have the full ABI; maybe jsut a fragment?
return new LogDescription({
eventFragment: fragment,
name: fragment.name,
signature: fragment.format(),
topic: this.getEventTopic(fragment),
values: this.decodeEventLog(fragment, log.data, log.topics)
args: this.decodeEventLog(fragment, log.data, log.topics)
});
}
/*

View File

@ -1 +1 @@
export declare const version = "abi/5.0.0-beta.143";
export declare const version = "abi/5.0.0-beta.144";

View File

@ -1,3 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = "abi/5.0.0-beta.143";
exports.version = "abi/5.0.0-beta.144";

View File

@ -1,5 +1,5 @@
import { BytesLike } from "@ethersproject/bytes";
import { Coder, Reader, Writer } from "./coders/abstract-coder";
import { Coder, Reader, Result, Writer } from "./coders/abstract-coder";
import { ParamType } from "./fragments";
export declare type CoerceFunc = (type: string, value: any) => any;
export declare class AbiCoder {
@ -10,6 +10,6 @@ export declare class AbiCoder {
_getReader(data: Uint8Array): Reader;
_getWriter(): Writer;
encode(types: Array<string | ParamType>, values: Array<any>): string;
decode(types: Array<string | ParamType>, data: BytesLike): any;
decode(types: Array<string | ParamType>, data: BytesLike): Result;
}
export declare const defaultAbiCoder: AbiCoder;

View File

@ -1,5 +1,8 @@
import { BytesLike } from "@ethersproject/bytes";
import { BigNumber, BigNumberish } from "@ethersproject/bignumber";
export interface Result extends Array<any> {
[key: string]: any;
}
export declare type CoerceFunc = (type: string, value: any) => any;
export declare abstract class Coder {
readonly name: string;

View File

@ -1,4 +1,4 @@
import { ConstructorFragment, EventFragment, FormatTypes, Fragment, FunctionFragment, JsonFragment, JsonFragmentType, ParamType } from "./fragments";
import { AbiCoder, CoerceFunc, defaultAbiCoder } from "./abi-coder";
import { Indexed, Interface } from "./interface";
export { ConstructorFragment, EventFragment, Fragment, FunctionFragment, ParamType, FormatTypes, AbiCoder, defaultAbiCoder, Interface, Indexed, CoerceFunc, JsonFragment, JsonFragmentType };
import { Indexed, Interface, Result } from "./interface";
export { ConstructorFragment, EventFragment, Fragment, FunctionFragment, ParamType, FormatTypes, AbiCoder, defaultAbiCoder, Interface, Indexed, CoerceFunc, JsonFragment, JsonFragmentType, Result };

View File

@ -2,30 +2,29 @@ import { BigNumber, BigNumberish } from "@ethersproject/bignumber";
import { BytesLike } from "@ethersproject/bytes";
import { Description } from "@ethersproject/properties";
import { AbiCoder } from "./abi-coder";
import { Result } from "./coders/abstract-coder";
import { ConstructorFragment, EventFragment, Fragment, FunctionFragment, JsonFragment, ParamType } from "./fragments";
export declare class LogDescription extends Description {
export { Result };
export declare class LogDescription extends Description<LogDescription> {
readonly eventFragment: EventFragment;
readonly name: string;
readonly signature: string;
readonly topic: string;
readonly values: any;
readonly args: Result;
}
export declare class TransactionDescription extends Description {
export declare class TransactionDescription extends Description<TransactionDescription> {
readonly functionFragment: FunctionFragment;
readonly name: string;
readonly args: Array<any>;
readonly args: Result;
readonly signature: string;
readonly sighash: string;
readonly value: BigNumber;
}
export declare class Indexed extends Description {
export declare class Indexed extends Description<Indexed> {
readonly hash: string;
readonly _isIndexed: boolean;
static isIndexed(value: any): value is Indexed;
}
export declare class Result {
[key: string]: any;
[key: number]: any;
}
export declare class Interface {
readonly fragments: Array<Fragment>;
readonly errors: {
@ -44,23 +43,24 @@ export declare class Interface {
readonly _abiCoder: AbiCoder;
static _isInterface: boolean;
constructor(fragments: string | Array<Fragment | JsonFragment | string>);
format(format?: string): string | Array<string>;
static getAbiCoder(): AbiCoder;
static getAddress(address: string): string;
_sighashify(functionFragment: FunctionFragment): string;
_topicify(eventFragment: EventFragment): string;
static getSighash(functionFragment: FunctionFragment): string;
static getTopic(eventFragment: EventFragment): string;
getFunction(nameOrSignatureOrSighash: string): FunctionFragment;
getEvent(nameOrSignatureOrTopic: string): EventFragment;
getSighash(functionFragment: FunctionFragment | string): string;
getEventTopic(eventFragment: EventFragment | string): string;
_decodeParams(params: Array<ParamType>, data: BytesLike): Array<any>;
_decodeParams(params: Array<ParamType>, data: BytesLike): Result;
_encodeParams(params: Array<ParamType>, values: Array<any>): string;
encodeDeploy(values?: Array<any>): string;
decodeFunctionData(functionFragment: FunctionFragment | string, data: BytesLike): Array<any>;
decodeFunctionData(functionFragment: FunctionFragment | string, data: BytesLike): Result;
encodeFunctionData(functionFragment: FunctionFragment | string, values?: Array<any>): string;
decodeFunctionResult(functionFragment: FunctionFragment | string, data: BytesLike): Array<any>;
decodeFunctionResult(functionFragment: FunctionFragment | string, data: BytesLike): Result;
encodeFunctionResult(functionFragment: FunctionFragment | string, values?: Array<any>): string;
encodeFilterTopics(eventFragment: EventFragment, values: Array<any>): Array<string | Array<string>>;
decodeEventLog(eventFragment: EventFragment | string, data: BytesLike, topics?: Array<string>): Array<any>;
decodeEventLog(eventFragment: EventFragment | string, data: BytesLike, topics?: Array<string>): Result;
parseTransaction(tx: {
data: string;
value?: BigNumberish;

View File

@ -51,12 +51,6 @@ var Indexed = /** @class */ (function (_super) {
return Indexed;
}(properties_1.Description));
exports.Indexed = Indexed;
var Result = /** @class */ (function () {
function Result() {
}
return Result;
}());
exports.Result = Result;
var Interface = /** @class */ (function () {
function Interface(fragments) {
var _newTarget = this.constructor;
@ -104,38 +98,40 @@ var Interface = /** @class */ (function () {
}
bucket[signature] = fragment;
});
// Add any fragments with a unique name by its name (sans signature parameters)
/*
[this.events, this.functions].forEach((bucket) => {
let count = getNameCount(bucket);
Object.keys(bucket).forEach((signature) => {
let fragment = bucket[signature];
if (count[fragment.name] !== 1) {
logger.warn("duplicate definition - " + fragment.name);
return;
}
bucket[fragment.name] = fragment;
});
});
*/
// If we do not have a constructor use the default "constructor() payable"
if (!this.deploy) {
properties_1.defineReadOnly(this, "deploy", fragments_1.ConstructorFragment.from({ type: "constructor" }));
}
properties_1.defineReadOnly(this, "_isInterface", true);
}
Interface.prototype.format = function (format) {
if (!format) {
format = fragments_1.FormatTypes.full;
}
if (format === fragments_1.FormatTypes.sighash) {
logger.throwArgumentError("interface does not support formating sighash", "format", format);
}
var abi = this.fragments.map(function (fragment) { return fragment.format(format); });
// We need to re-bundle the JSON fragments a bit
if (format === fragments_1.FormatTypes.json) {
return JSON.stringify(abi.map(function (j) { return JSON.parse(j); }));
}
return abi;
};
// Sub-classes can override these to handle other blockchains
Interface.getAbiCoder = function () {
return abi_coder_1.defaultAbiCoder;
};
Interface.getAddress = function (address) {
return address_1.getAddress(address);
};
Interface.prototype._sighashify = function (functionFragment) {
Interface.getSighash = function (functionFragment) {
return bytes_1.hexDataSlice(hash_1.id(functionFragment.format()), 0, 4);
};
Interface.prototype._topicify = function (eventFragment) {
Interface.getTopic = function (eventFragment) {
return hash_1.id(eventFragment.format());
};
// Find a function definition by any means necessary (unless it is ambiguous)
Interface.prototype.getFunction = function (nameOrSignatureOrSighash) {
if (bytes_1.isHexString(nameOrSignatureOrSighash)) {
for (var name_1 in this.functions) {
@ -164,6 +160,7 @@ var Interface = /** @class */ (function () {
}
return result;
};
// Find an event definition by any means necessary (unless it is ambiguous)
Interface.prototype.getEvent = function (nameOrSignatureOrTopic) {
if (bytes_1.isHexString(nameOrSignatureOrTopic)) {
var topichash = nameOrSignatureOrTopic.toLowerCase();
@ -193,17 +190,19 @@ var Interface = /** @class */ (function () {
}
return result;
};
// Get the sighash (the bytes4 selector) used by Solidity to identify a function
Interface.prototype.getSighash = function (functionFragment) {
if (typeof (functionFragment) === "string") {
functionFragment = this.getFunction(functionFragment);
}
return this._sighashify(functionFragment);
return properties_1.getStatic(this.constructor, "getSighash")(functionFragment);
};
// Get the topic (the bytes32 hash) used by Solidity to identify an event
Interface.prototype.getEventTopic = function (eventFragment) {
if (typeof (eventFragment) === "string") {
eventFragment = this.getEvent(eventFragment);
}
return this._topicify(eventFragment);
return properties_1.getStatic(this.constructor, "getTopic")(eventFragment);
};
Interface.prototype._decodeParams = function (params, data) {
return this._abiCoder.decode(params, data);
@ -214,6 +213,7 @@ var Interface = /** @class */ (function () {
Interface.prototype.encodeDeploy = function (values) {
return this._encodeParams(this.deploy.inputs, values || []);
};
// Decode the data for a function call (e.g. tx.data)
Interface.prototype.decodeFunctionData = function (functionFragment, data) {
if (typeof (functionFragment) === "string") {
functionFragment = this.getFunction(functionFragment);
@ -224,6 +224,7 @@ var Interface = /** @class */ (function () {
}
return this._decodeParams(functionFragment.inputs, bytes.slice(4));
};
// Encode the data for a function call (e.g. tx.data)
Interface.prototype.encodeFunctionData = function (functionFragment, values) {
if (typeof (functionFragment) === "string") {
functionFragment = this.getFunction(functionFragment);
@ -233,6 +234,7 @@ var Interface = /** @class */ (function () {
this._encodeParams(functionFragment.inputs, values || [])
]));
};
// Decode the result from a function call (e.g. from eth_call)
Interface.prototype.decodeFunctionResult = function (functionFragment, data) {
if (typeof (functionFragment) === "string") {
functionFragment = this.getFunction(functionFragment);
@ -250,7 +252,7 @@ var Interface = /** @class */ (function () {
case 4:
if (bytes_1.hexlify(bytes.slice(0, 4)) === "0x08c379a0") {
errorSignature = "Error(string)";
reason = this._abiCoder.decode(["string"], bytes.slice(4));
reason = this._abiCoder.decode(["string"], bytes.slice(4))[0];
}
break;
}
@ -261,12 +263,14 @@ var Interface = /** @class */ (function () {
reason: reason
});
};
// Encode the result for a function call (e.g. for eth_call)
Interface.prototype.encodeFunctionResult = function (functionFragment, values) {
if (typeof (functionFragment) === "string") {
functionFragment = this.getFunction(functionFragment);
}
return bytes_1.hexlify(this._abiCoder.encode(functionFragment.outputs, values || []));
};
// Create the filter for the event with search criteria (e.g. for eth_filterLog)
Interface.prototype.encodeFilterTopics = function (eventFragment, values) {
var _this = this;
if (typeof (eventFragment) === "string") {
@ -316,6 +320,7 @@ var Interface = /** @class */ (function () {
}
return topics;
};
// Decode a filter for the event and the search criteria
Interface.prototype.decodeEventLog = function (eventFragment, data, topics) {
if (typeof (eventFragment) === "string") {
eventFragment = this.getEvent(eventFragment);
@ -365,10 +370,14 @@ var Interface = /** @class */ (function () {
else {
result[index] = resultNonIndexed[nonIndexedIndex++];
}
//if (param.name && result[param.name] == null) { result[param.name] = result[index]; }
if (param.name && result[param.name] == null) {
result[param.name] = result[index];
}
});
return result;
};
// Given a transaction, find the matching function fragment (if any) and
// determine all its properties and call parameters
Interface.prototype.parseTransaction = function (tx) {
var fragment = this.getFunction(tx.data.substring(0, 10).toLowerCase());
if (!fragment) {
@ -383,18 +392,22 @@ var Interface = /** @class */ (function () {
value: bignumber_1.BigNumber.from(tx.value || "0"),
});
};
// Given an event log, find the matching event fragment (if any) and
// determine all its properties and values
Interface.prototype.parseLog = function (log) {
var fragment = this.getEvent(log.topics[0]);
if (!fragment || fragment.anonymous) {
return null;
}
// @TODO: If anonymous, and the only method, and the input count matches, should we parse?
// Probably not, because just because it is the only event in the ABI does
// not mean we have the full ABI; maybe jsut a fragment?
return new LogDescription({
eventFragment: fragment,
name: fragment.name,
signature: fragment.format(),
topic: this.getEventTopic(fragment),
values: this.decodeEventLog(fragment, log.data, log.topics)
args: this.decodeEventLog(fragment, log.data, log.topics)
});
};
/*

View File

@ -31,7 +31,7 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"tarballHash": "0x5feb254fd7b20266f0834b8f5beca7680c0988a6ba89ec04fede8b2c823b4dfd",
"tarballHash": "0x6f0200ce3170d8149ac6b5a736d2bd519bfa6648d0a60ff773aafa47a17b1e85",
"types": "./lib/index.d.ts",
"version": "5.0.0-beta.143"
"version": "5.0.0-beta.144"
}

View File

@ -1 +1 @@
export const version = "abi/5.0.0-beta.143";
export const version = "abi/5.0.0-beta.144";

View File

@ -1 +1 @@
export declare const version = "abstract-provider/5.0.0-beta.135";
export declare const version = "abstract-provider/5.0.0-beta.136";

View File

@ -1 +1 @@
export const version = "abstract-provider/5.0.0-beta.135";
export const version = "abstract-provider/5.0.0-beta.136";

View File

@ -85,15 +85,17 @@ export interface FilterByBlockHash extends EventFilter {
}
export declare abstract class ForkEvent extends Description {
readonly expiry: number;
readonly _isForkEvent: boolean;
readonly _isForkEvent?: boolean;
static isForkEvent(value: any): value is ForkEvent;
}
export declare class BlockForkEvent extends ForkEvent {
readonly blockhash: string;
readonly _isBlockForkEvent?: boolean;
constructor(blockhash: string, expiry?: number);
}
export declare class TransactionForkEvent extends ForkEvent {
readonly hash: string;
readonly _isTransactionOrderForkEvent?: boolean;
constructor(hash: string, expiry?: number);
}
export declare class TransactionOrderForkEvent extends ForkEvent {

View File

@ -1 +1 @@
export declare const version = "abstract-provider/5.0.0-beta.135";
export declare const version = "abstract-provider/5.0.0-beta.136";

View File

@ -1,3 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = "abstract-provider/5.0.0-beta.135";
exports.version = "abstract-provider/5.0.0-beta.136";

View File

@ -85,15 +85,17 @@ export interface FilterByBlockHash extends EventFilter {
}
export declare abstract class ForkEvent extends Description {
readonly expiry: number;
readonly _isForkEvent: boolean;
readonly _isForkEvent?: boolean;
static isForkEvent(value: any): value is ForkEvent;
}
export declare class BlockForkEvent extends ForkEvent {
readonly blockhash: string;
readonly _isBlockForkEvent?: boolean;
constructor(blockhash: string, expiry?: number);
}
export declare class TransactionForkEvent extends ForkEvent {
readonly hash: string;
readonly _isTransactionOrderForkEvent?: boolean;
constructor(hash: string, expiry?: number);
}
export declare class TransactionOrderForkEvent extends ForkEvent {

View File

@ -29,7 +29,7 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"tarballHash": "0xc5b12b9ba34634fee7767507821dcf075ec7d41a3ce2bcb9bd60eeac30aa9f99",
"tarballHash": "0x8949e673468ec8b53233c90ef3579d3100817a97b80fe9e0dc79089f54dcd73b",
"types": "./lib/index.d.ts",
"version": "5.0.0-beta.135"
"version": "5.0.0-beta.136"
}

View File

@ -1 +1 @@
export const version = "abstract-provider/5.0.0-beta.135";
export const version = "abstract-provider/5.0.0-beta.136";

View File

@ -1 +1 @@
export declare const version = "contracts/5.0.0-beta.142";
export declare const version = "contracts/5.0.0-beta.143";

View File

@ -1 +1 @@
export const version = "contracts/5.0.0-beta.142";
export const version = "contracts/5.0.0-beta.143";

View File

@ -1,4 +1,4 @@
import { Fragment, Indexed, Interface, JsonFragment } from "@ethersproject/abi";
import { Fragment, Indexed, Interface, JsonFragment, Result } from "@ethersproject/abi";
import { Block, BlockTag, Listener, Log, Provider, TransactionReceipt, TransactionRequest, TransactionResponse } from "@ethersproject/abstract-provider";
import { Signer } from "@ethersproject/abstract-signer";
import { BigNumber, BigNumberish } from "@ethersproject/bignumber";
@ -24,7 +24,7 @@ export declare type EventFilter = {
export interface Event extends Log {
event?: string;
eventSignature?: string;
values?: Array<any>;
args?: Result;
decode?: (data: string, topics?: Array<string>) => any;
removeListener: () => void;
getBlock: () => Promise<Block>;

View File

@ -45,7 +45,7 @@ export function _sendTransaction(func: FunctionFragment, args: Array<any>, overr
}
*/
function runMethod(contract, functionName, options) {
let method = contract.interface.functions[functionName];
const method = contract.interface.functions[functionName];
return function (...params) {
let tx = {};
let blockTag = null;
@ -136,14 +136,14 @@ function runMethod(contract, functionName, options) {
logger.throwError("sending a transaction requires a signer", Logger.errors.UNSUPPORTED_OPERATION, { operation: "sendTransaction" });
}
return contract.signer.sendTransaction(tx).then((tx) => {
let wait = tx.wait.bind(tx);
const wait = tx.wait.bind(tx);
tx.wait = (confirmations) => {
return wait(confirmations).then((receipt) => {
receipt.events = receipt.logs.map((log) => {
let event = deepCopy(log);
let parsed = contract.interface.parseLog(log);
if (parsed) {
event.values = parsed.values;
event.args = parsed.args;
event.decode = (data, topics) => {
return this.interface.decodeEventLog(parsed.eventFragment, data, topics);
};
@ -205,9 +205,9 @@ class RunningEvent {
return this._listeners.length;
}
run(args) {
let listenerCount = this.listenerCount();
const listenerCount = this.listenerCount();
this._listeners = this._listeners.filter((item) => {
let argsCopy = args.slice();
const argsCopy = args.slice();
// Call the callback in the next event loop
setTimeout(() => {
item.listener.apply(this, argsCopy);
@ -227,7 +227,7 @@ class ErrorRunningEvent extends RunningEvent {
}
class FragmentRunningEvent extends RunningEvent {
constructor(address, contractInterface, fragment, topics) {
let filter = {
const filter = {
address: address
};
let topic = contractInterface.getEventTopic(fragment);
@ -252,7 +252,7 @@ class FragmentRunningEvent extends RunningEvent {
event.decode = (data, topics) => {
return this.interface.decodeEventLog(this.fragment, data, topics);
};
event.values = this.interface.decodeEventLog(this.fragment, event.data, event.topics);
event.args = this.interface.decodeEventLog(this.fragment, event.data, event.topics);
}
}
class WildcardRunningEvent extends RunningEvent {
@ -263,14 +263,14 @@ class WildcardRunningEvent extends RunningEvent {
}
prepareEvent(event) {
super.prepareEvent(event);
let parsed = this.interface.parseLog(event);
const parsed = this.interface.parseLog(event);
if (parsed) {
event.event = parsed.name;
event.eventSignature = parsed.signature;
event.decode = (data, topics) => {
return this.interface.decodeEventLog(parsed.eventFragment, data, topics);
};
event.values = parsed.values;
event.args = parsed.args;
}
}
}
@ -299,7 +299,7 @@ export class Contract {
{
const uniqueFilters = {};
Object.keys(this.interface.events).forEach((eventSignature) => {
let event = this.interface.events[eventSignature];
const event = this.interface.events[eventSignature];
defineReadOnly(this.filters, eventSignature, (...args) => {
return {
address: this.address,
@ -348,7 +348,7 @@ export class Contract {
Object.keys(this.interface.functions).forEach((name) => {
const fragment = this.interface.functions[name];
// @TODO: This should take in fragment
let run = runMethod(this, name, {});
const run = runMethod(this, name, {});
if (this[name] == null) {
defineReadOnly(this, name, run);
}
@ -430,7 +430,7 @@ export class Contract {
if (!this.signer) {
logger.throwError("sending a transactions require a signer", Logger.errors.UNSUPPORTED_OPERATION, { operation: "sendTransaction(fallback)" });
}
let tx = shallowCopy(overrides || {});
const tx = shallowCopy(overrides || {});
["from", "to"].forEach(function (key) {
if (tx[key] == null) {
return;
@ -447,7 +447,7 @@ export class Contract {
if (typeof (signerOrProvider) === "string") {
signerOrProvider = new VoidSigner(signerOrProvider, this.provider);
}
let contract = new (this.constructor)(this.address, this.interface, signerOrProvider);
const contract = new (this.constructor)(this.address, this.interface, signerOrProvider);
if (this.deployTransaction) {
defineReadOnly(contract, "deployTransaction", this.deployTransaction);
}
@ -478,20 +478,20 @@ export class Contract {
if (eventName === "*") {
return this._normalizeRunningEvent(new WildcardRunningEvent(this.address, this.interface));
}
let 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));
}
let filter = {
const filter = {
address: this.address
};
// Find the matching event in the ABI; if none, we still allow filtering
// since it may be a filter for an otherwise unknown event
if (eventName.topics) {
if (eventName.topics[0]) {
let 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));
}
@ -505,14 +505,14 @@ export class Contract {
delete this._runningEvents[runningEvent.tag];
}
// If we have a poller for this, remove it
let emit = this._wrappedEmits[runningEvent.tag];
const emit = this._wrappedEmits[runningEvent.tag];
if (emit) {
this.provider.off(runningEvent.filter, emit);
delete this._wrappedEmits[runningEvent.tag];
}
}
_wrapEvent(runningEvent, log, listener) {
let event = deepCopy(log);
const event = deepCopy(log);
try {
runningEvent.prepareEvent(event);
}
@ -541,11 +541,11 @@ export class Contract {
this._runningEvents[runningEvent.tag] = runningEvent;
// If we are not polling the provider, start
if (!this._wrappedEmits[runningEvent.tag]) {
let wrappedEmit = (log) => {
let event = this._wrapEvent(runningEvent, log, listener);
let values = (event.values || []);
values.push(event);
this.emit(runningEvent.filter, ...values);
const wrappedEmit = (log) => {
const event = this._wrapEvent(runningEvent, log, listener);
const args = (event.args || []);
args.push(event);
this.emit(runningEvent.filter, ...args);
};
this._wrappedEmits[runningEvent.tag] = wrappedEmit;
// Special events, like "error" do not have a filter
@ -555,8 +555,8 @@ export class Contract {
}
}
queryFilter(event, fromBlockOrBlockhash, toBlock) {
let runningEvent = this._getRunningEvent(event);
let filter = shallowCopy(runningEvent.filter);
const runningEvent = this._getRunningEvent(event);
const filter = shallowCopy(runningEvent.filter);
if (typeof (fromBlockOrBlockhash) === "string" && isHexString(fromBlockOrBlockhash, 32)) {
if (toBlock != null) {
logger.throwArgumentError("cannot specify toBlock with blockhash", "toBlock", toBlock);
@ -583,8 +583,8 @@ export class Contract {
if (!this.provider) {
return false;
}
let runningEvent = this._getRunningEvent(eventName);
let result = (runningEvent.run(args) > 0);
const runningEvent = this._getRunningEvent(eventName);
const result = (runningEvent.run(args) > 0);
// May have drained all the "once" events; check for living events
this._checkRunningEvents(runningEvent);
return result;
@ -600,7 +600,7 @@ export class Contract {
return [];
}
if (eventName == null) {
let result = [];
const result = [];
for (let tag in this._runningEvents) {
this._runningEvents[tag].listeners().forEach((listener) => {
result.push(listener);
@ -615,15 +615,15 @@ export class Contract {
return this;
}
if (eventName == null) {
for (let tag in this._runningEvents) {
let runningEvent = this._runningEvents[tag];
for (const tag in this._runningEvents) {
const runningEvent = this._runningEvents[tag];
runningEvent.removeAllListeners();
this._checkRunningEvents(runningEvent);
}
return this;
}
// Delete any listeners
let runningEvent = this._getRunningEvent(eventName);
const runningEvent = this._getRunningEvent(eventName);
runningEvent.removeAllListeners();
this._checkRunningEvents(runningEvent);
return this;
@ -632,7 +632,7 @@ export class Contract {
if (!this.provider) {
return this;
}
let runningEvent = this._getRunningEvent(eventName);
const runningEvent = this._getRunningEvent(eventName);
runningEvent.removeListener(listener);
this._checkRunningEvents(runningEvent);
return this;
@ -679,7 +679,7 @@ export class ContractFactory {
// If we have 1 additional argument, we allow transaction overrides
if (args.length === this.interface.deploy.inputs.length + 1) {
tx = shallowCopy(args.pop());
for (let key in tx) {
for (const key in tx) {
if (!allowedTransactionKeys[key]) {
throw new Error("unknown transaction override " + key);
}
@ -704,11 +704,11 @@ export class ContractFactory {
deploy(...args) {
return resolveAddresses(this.signer, args, this.interface.deploy.inputs).then((args) => {
// Get the deployment transaction (with optional overrides)
let tx = this.getDeployTransaction(...args);
const tx = this.getDeployTransaction(...args);
// Send the deployment transaction
return this.signer.sendTransaction(tx).then((tx) => {
let address = (this.constructor).getContractAddress(tx);
let contract = (this.constructor).getContract(address, this.interface, this.signer);
const address = (this.constructor).getContractAddress(tx);
const contract = (this.constructor).getContract(address, this.interface, this.signer);
defineReadOnly(contract, "deployTransaction", tx);
return contract;
});
@ -727,7 +727,7 @@ export class ContractFactory {
if (typeof (compilerOutput) === "string") {
compilerOutput = JSON.parse(compilerOutput);
}
let abi = compilerOutput.abi;
const abi = compilerOutput.abi;
let bytecode = null;
if (compilerOutput.bytecode) {
bytecode = compilerOutput.bytecode;

View File

@ -1 +1 @@
export declare const version = "contracts/5.0.0-beta.142";
export declare const version = "contracts/5.0.0-beta.143";

View File

@ -1,3 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = "contracts/5.0.0-beta.142";
exports.version = "contracts/5.0.0-beta.143";

View File

@ -1,4 +1,4 @@
import { Fragment, Indexed, Interface, JsonFragment } from "@ethersproject/abi";
import { Fragment, Indexed, Interface, JsonFragment, Result } from "@ethersproject/abi";
import { Block, BlockTag, Listener, Log, Provider, TransactionReceipt, TransactionRequest, TransactionResponse } from "@ethersproject/abstract-provider";
import { Signer } from "@ethersproject/abstract-signer";
import { BigNumber, BigNumberish } from "@ethersproject/bignumber";
@ -24,7 +24,7 @@ export declare type EventFilter = {
export interface Event extends Log {
event?: string;
eventSignature?: string;
values?: Array<any>;
args?: Result;
decode?: (data: string, topics?: Array<string>) => any;
removeListener: () => void;
getBlock: () => Promise<Block>;

View File

@ -169,7 +169,7 @@ function runMethod(contract, functionName, options) {
var event = properties_1.deepCopy(log);
var parsed = contract.interface.parseLog(log);
if (parsed) {
event.values = parsed.values;
event.args = parsed.args;
event.decode = function (data, topics) {
return _this.interface.decodeEventLog(parsed.eventFragment, data, topics);
};
@ -286,7 +286,7 @@ var FragmentRunningEvent = /** @class */ (function (_super) {
event.decode = function (data, topics) {
return _this.interface.decodeEventLog(_this.fragment, data, topics);
};
event.values = this.interface.decodeEventLog(this.fragment, event.data, event.topics);
event.args = this.interface.decodeEventLog(this.fragment, event.data, event.topics);
};
return FragmentRunningEvent;
}(RunningEvent));
@ -308,7 +308,7 @@ var WildcardRunningEvent = /** @class */ (function (_super) {
event.decode = function (data, topics) {
return _this.interface.decodeEventLog(parsed.eventFragment, data, topics);
};
event.values = parsed.values;
event.args = parsed.args;
}
};
return WildcardRunningEvent;
@ -592,9 +592,9 @@ var Contract = /** @class */ (function () {
if (!this._wrappedEmits[runningEvent.tag]) {
var wrappedEmit = function (log) {
var event = _this._wrapEvent(runningEvent, log, listener);
var values = (event.values || []);
values.push(event);
_this.emit.apply(_this, __spreadArrays([runningEvent.filter], values));
var args = (event.args || []);
args.push(event);
_this.emit.apply(_this, __spreadArrays([runningEvent.filter], args));
};
this._wrappedEmits[runningEvent.tag] = wrappedEmit;
// Special events, like "error" do not have a filter

View File

@ -32,7 +32,7 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"tarballHash": "0x0253325f52e33a166dd5df2cbc51da741c8810e1e96dccd867248a340596394d",
"tarballHash": "0x1575cc0bacce759d5e730763cbed06758e26b771e9c031addb444c8fdd7580fd",
"types": "./lib/index.d.ts",
"version": "5.0.0-beta.142"
"version": "5.0.0-beta.143"
}

View File

@ -1 +1 @@
export const version = "contracts/5.0.0-beta.142";
export const version = "contracts/5.0.0-beta.143";

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -4628,7 +4628,7 @@ class FixedNumber {
}
}
const version$3 = "properties/5.0.0-beta.135";
const version$3 = "properties/5.0.0-beta.136";
"use strict";
const logger$3 = new Logger(version$3);
@ -4725,7 +4725,6 @@ class Description {
for (const key in info) {
this[key] = deepCopy(info[key]);
}
Object.freeze(this);
}
}
@ -4739,7 +4738,7 @@ var lib_esm$2 = /*#__PURE__*/Object.freeze({
Description: Description
});
const version$4 = "abi/5.0.0-beta.143";
const version$4 = "abi/5.0.0-beta.144";
"use strict";
const logger$4 = new Logger(version$4);
@ -7127,15 +7126,15 @@ class AbiCoder {
value: { types: types, values: values }
});
}
let coders = types.map((type) => this._getCoder(ParamType.from(type)));
let coder = (new TupleCoder(coders, "_"));
let writer = this._getWriter();
const coders = types.map((type) => this._getCoder(ParamType.from(type)));
const coder = (new TupleCoder(coders, "_"));
const writer = this._getWriter();
coder.encode(writer, values);
return writer.data;
}
decode(types, data) {
let coders = types.map((type) => this._getCoder(ParamType.from(type)));
let coder = new TupleCoder(coders, "_");
const coders = types.map((type) => this._getCoder(ParamType.from(type)));
const coder = new TupleCoder(coders, "_");
return coder.decode(this._getReader(arrayify(data)));
}
}
@ -7208,8 +7207,6 @@ class Indexed extends Description {
return !!(value && value._isIndexed);
}
}
class Result {
}
class Interface {
constructor(fragments) {
logger$b.checkNew(new.target, Interface);
@ -7255,38 +7252,40 @@ class Interface {
}
bucket[signature] = fragment;
});
// Add any fragments with a unique name by its name (sans signature parameters)
/*
[this.events, this.functions].forEach((bucket) => {
let count = getNameCount(bucket);
Object.keys(bucket).forEach((signature) => {
let fragment = bucket[signature];
if (count[fragment.name] !== 1) {
logger.warn("duplicate definition - " + fragment.name);
return;
}
bucket[fragment.name] = fragment;
});
});
*/
// If we do not have a constructor use the default "constructor() payable"
if (!this.deploy) {
defineReadOnly(this, "deploy", ConstructorFragment.from({ type: "constructor" }));
}
defineReadOnly(this, "_isInterface", true);
}
format(format) {
if (!format) {
format = FormatTypes.full;
}
if (format === FormatTypes.sighash) {
logger$b.throwArgumentError("interface does not support formating sighash", "format", format);
}
const abi = this.fragments.map((fragment) => fragment.format(format));
// We need to re-bundle the JSON fragments a bit
if (format === FormatTypes.json) {
return JSON.stringify(abi.map((j) => JSON.parse(j)));
}
return abi;
}
// Sub-classes can override these to handle other blockchains
static getAbiCoder() {
return defaultAbiCoder;
}
static getAddress(address) {
return getAddress(address);
}
_sighashify(functionFragment) {
static getSighash(functionFragment) {
return hexDataSlice(id(functionFragment.format()), 0, 4);
}
_topicify(eventFragment) {
static getTopic(eventFragment) {
return id(eventFragment.format());
}
// Find a function definition by any means necessary (unless it is ambiguous)
getFunction(nameOrSignatureOrSighash) {
if (isHexString(nameOrSignatureOrSighash)) {
for (const name in this.functions) {
@ -7315,6 +7314,7 @@ class Interface {
}
return result;
}
// Find an event definition by any means necessary (unless it is ambiguous)
getEvent(nameOrSignatureOrTopic) {
if (isHexString(nameOrSignatureOrTopic)) {
const topichash = nameOrSignatureOrTopic.toLowerCase();
@ -7344,17 +7344,19 @@ class Interface {
}
return result;
}
// Get the sighash (the bytes4 selector) used by Solidity to identify a function
getSighash(functionFragment) {
if (typeof (functionFragment) === "string") {
functionFragment = this.getFunction(functionFragment);
}
return this._sighashify(functionFragment);
return getStatic(this.constructor, "getSighash")(functionFragment);
}
// Get the topic (the bytes32 hash) used by Solidity to identify an event
getEventTopic(eventFragment) {
if (typeof (eventFragment) === "string") {
eventFragment = this.getEvent(eventFragment);
}
return this._topicify(eventFragment);
return getStatic(this.constructor, "getTopic")(eventFragment);
}
_decodeParams(params, data) {
return this._abiCoder.decode(params, data);
@ -7365,6 +7367,7 @@ class Interface {
encodeDeploy(values) {
return this._encodeParams(this.deploy.inputs, values || []);
}
// Decode the data for a function call (e.g. tx.data)
decodeFunctionData(functionFragment, data) {
if (typeof (functionFragment) === "string") {
functionFragment = this.getFunction(functionFragment);
@ -7375,6 +7378,7 @@ class Interface {
}
return this._decodeParams(functionFragment.inputs, bytes.slice(4));
}
// Encode the data for a function call (e.g. tx.data)
encodeFunctionData(functionFragment, values) {
if (typeof (functionFragment) === "string") {
functionFragment = this.getFunction(functionFragment);
@ -7384,6 +7388,7 @@ class Interface {
this._encodeParams(functionFragment.inputs, values || [])
]));
}
// Decode the result from a function call (e.g. from eth_call)
decodeFunctionResult(functionFragment, data) {
if (typeof (functionFragment) === "string") {
functionFragment = this.getFunction(functionFragment);
@ -7401,7 +7406,7 @@ class Interface {
case 4:
if (hexlify(bytes.slice(0, 4)) === "0x08c379a0") {
errorSignature = "Error(string)";
reason = this._abiCoder.decode(["string"], bytes.slice(4));
reason = this._abiCoder.decode(["string"], bytes.slice(4))[0];
}
break;
}
@ -7412,12 +7417,14 @@ class Interface {
reason: reason
});
}
// Encode the result for a function call (e.g. for eth_call)
encodeFunctionResult(functionFragment, values) {
if (typeof (functionFragment) === "string") {
functionFragment = this.getFunction(functionFragment);
}
return hexlify(this._abiCoder.encode(functionFragment.outputs, values || []));
}
// Create the filter for the event with search criteria (e.g. for eth_filterLog)
encodeFilterTopics(eventFragment, values) {
if (typeof (eventFragment) === "string") {
eventFragment = this.getEvent(eventFragment);
@ -7466,6 +7473,7 @@ class Interface {
}
return topics;
}
// Decode a filter for the event and the search criteria
decodeEventLog(eventFragment, data, topics) {
if (typeof (eventFragment) === "string") {
eventFragment = this.getEvent(eventFragment);
@ -7515,10 +7523,14 @@ class Interface {
else {
result[index] = resultNonIndexed[nonIndexedIndex++];
}
//if (param.name && result[param.name] == null) { result[param.name] = result[index]; }
if (param.name && result[param.name] == null) {
result[param.name] = result[index];
}
});
return result;
}
// Given a transaction, find the matching function fragment (if any) and
// determine all its properties and call parameters
parseTransaction(tx) {
let fragment = this.getFunction(tx.data.substring(0, 10).toLowerCase());
if (!fragment) {
@ -7533,18 +7545,22 @@ class Interface {
value: BigNumber.from(tx.value || "0"),
});
}
// Given an event log, find the matching event fragment (if any) and
// determine all its properties and values
parseLog(log) {
let fragment = this.getEvent(log.topics[0]);
if (!fragment || fragment.anonymous) {
return null;
}
// @TODO: If anonymous, and the only method, and the input count matches, should we parse?
// Probably not, because just because it is the only event in the ABI does
// not mean we have the full ABI; maybe jsut a fragment?
return new LogDescription({
eventFragment: fragment,
name: fragment.name,
signature: fragment.format(),
topic: this.getEventTopic(fragment),
values: this.decodeEventLog(fragment, log.data, log.topics)
args: this.decodeEventLog(fragment, log.data, log.topics)
});
}
/*
@ -7565,7 +7581,7 @@ class Interface {
"use strict";
const version$8 = "abstract-provider/5.0.0-beta.135";
const version$8 = "abstract-provider/5.0.0-beta.136";
"use strict";
const logger$c = new Logger(version$8);
@ -7820,7 +7836,7 @@ class VoidSigner extends Signer {
}
}
const version$a = "contracts/5.0.0-beta.142";
const version$a = "contracts/5.0.0-beta.143";
"use strict";
const logger$e = new Logger(version$a);
@ -7859,7 +7875,7 @@ export function _sendTransaction(func: FunctionFragment, args: Array<any>, overr
}
*/
function runMethod(contract, functionName, options) {
let method = contract.interface.functions[functionName];
const method = contract.interface.functions[functionName];
return function (...params) {
let tx = {};
let blockTag = null;
@ -7950,14 +7966,14 @@ function runMethod(contract, functionName, options) {
logger$e.throwError("sending a transaction requires a signer", Logger.errors.UNSUPPORTED_OPERATION, { operation: "sendTransaction" });
}
return contract.signer.sendTransaction(tx).then((tx) => {
let wait = tx.wait.bind(tx);
const wait = tx.wait.bind(tx);
tx.wait = (confirmations) => {
return wait(confirmations).then((receipt) => {
receipt.events = receipt.logs.map((log) => {
let event = deepCopy(log);
let parsed = contract.interface.parseLog(log);
if (parsed) {
event.values = parsed.values;
event.args = parsed.args;
event.decode = (data, topics) => {
return this.interface.decodeEventLog(parsed.eventFragment, data, topics);
};
@ -8019,9 +8035,9 @@ class RunningEvent {
return this._listeners.length;
}
run(args) {
let listenerCount = this.listenerCount();
const listenerCount = this.listenerCount();
this._listeners = this._listeners.filter((item) => {
let argsCopy = args.slice();
const argsCopy = args.slice();
// Call the callback in the next event loop
setTimeout(() => {
item.listener.apply(this, argsCopy);
@ -8041,7 +8057,7 @@ class ErrorRunningEvent extends RunningEvent {
}
class FragmentRunningEvent extends RunningEvent {
constructor(address, contractInterface, fragment, topics) {
let filter = {
const filter = {
address: address
};
let topic = contractInterface.getEventTopic(fragment);
@ -8066,7 +8082,7 @@ class FragmentRunningEvent extends RunningEvent {
event.decode = (data, topics) => {
return this.interface.decodeEventLog(this.fragment, data, topics);
};
event.values = this.interface.decodeEventLog(this.fragment, event.data, event.topics);
event.args = this.interface.decodeEventLog(this.fragment, event.data, event.topics);
}
}
class WildcardRunningEvent extends RunningEvent {
@ -8077,14 +8093,14 @@ class WildcardRunningEvent extends RunningEvent {
}
prepareEvent(event) {
super.prepareEvent(event);
let parsed = this.interface.parseLog(event);
const parsed = this.interface.parseLog(event);
if (parsed) {
event.event = parsed.name;
event.eventSignature = parsed.signature;
event.decode = (data, topics) => {
return this.interface.decodeEventLog(parsed.eventFragment, data, topics);
};
event.values = parsed.values;
event.args = parsed.args;
}
}
}
@ -8113,7 +8129,7 @@ class Contract {
{
const uniqueFilters = {};
Object.keys(this.interface.events).forEach((eventSignature) => {
let event = this.interface.events[eventSignature];
const event = this.interface.events[eventSignature];
defineReadOnly(this.filters, eventSignature, (...args) => {
return {
address: this.address,
@ -8162,7 +8178,7 @@ class Contract {
Object.keys(this.interface.functions).forEach((name) => {
const fragment = this.interface.functions[name];
// @TODO: This should take in fragment
let run = runMethod(this, name, {});
const run = runMethod(this, name, {});
if (this[name] == null) {
defineReadOnly(this, name, run);
}
@ -8244,7 +8260,7 @@ class Contract {
if (!this.signer) {
logger$e.throwError("sending a transactions require a signer", Logger.errors.UNSUPPORTED_OPERATION, { operation: "sendTransaction(fallback)" });
}
let tx = shallowCopy(overrides || {});
const tx = shallowCopy(overrides || {});
["from", "to"].forEach(function (key) {
if (tx[key] == null) {
return;
@ -8261,7 +8277,7 @@ class Contract {
if (typeof (signerOrProvider) === "string") {
signerOrProvider = new VoidSigner(signerOrProvider, this.provider);
}
let contract = new (this.constructor)(this.address, this.interface, signerOrProvider);
const contract = new (this.constructor)(this.address, this.interface, signerOrProvider);
if (this.deployTransaction) {
defineReadOnly(contract, "deployTransaction", this.deployTransaction);
}
@ -8292,20 +8308,20 @@ class Contract {
if (eventName === "*") {
return this._normalizeRunningEvent(new WildcardRunningEvent(this.address, this.interface));
}
let fragment = this.interface.getEvent(eventName);
const fragment = this.interface.getEvent(eventName);
if (!fragment) {
logger$e.throwArgumentError("unknown event - " + eventName, "eventName", eventName);
}
return this._normalizeRunningEvent(new FragmentRunningEvent(this.address, this.interface, fragment));
}
let filter = {
const filter = {
address: this.address
};
// Find the matching event in the ABI; if none, we still allow filtering
// since it may be a filter for an otherwise unknown event
if (eventName.topics) {
if (eventName.topics[0]) {
let 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));
}
@ -8319,14 +8335,14 @@ class Contract {
delete this._runningEvents[runningEvent.tag];
}
// If we have a poller for this, remove it
let emit = this._wrappedEmits[runningEvent.tag];
const emit = this._wrappedEmits[runningEvent.tag];
if (emit) {
this.provider.off(runningEvent.filter, emit);
delete this._wrappedEmits[runningEvent.tag];
}
}
_wrapEvent(runningEvent, log, listener) {
let event = deepCopy(log);
const event = deepCopy(log);
try {
runningEvent.prepareEvent(event);
}
@ -8355,11 +8371,11 @@ class Contract {
this._runningEvents[runningEvent.tag] = runningEvent;
// If we are not polling the provider, start
if (!this._wrappedEmits[runningEvent.tag]) {
let wrappedEmit = (log) => {
let event = this._wrapEvent(runningEvent, log, listener);
let values = (event.values || []);
values.push(event);
this.emit(runningEvent.filter, ...values);
const wrappedEmit = (log) => {
const event = this._wrapEvent(runningEvent, log, listener);
const args = (event.args || []);
args.push(event);
this.emit(runningEvent.filter, ...args);
};
this._wrappedEmits[runningEvent.tag] = wrappedEmit;
// Special events, like "error" do not have a filter
@ -8369,8 +8385,8 @@ class Contract {
}
}
queryFilter(event, fromBlockOrBlockhash, toBlock) {
let runningEvent = this._getRunningEvent(event);
let filter = shallowCopy(runningEvent.filter);
const runningEvent = this._getRunningEvent(event);
const filter = shallowCopy(runningEvent.filter);
if (typeof (fromBlockOrBlockhash) === "string" && isHexString(fromBlockOrBlockhash, 32)) {
if (toBlock != null) {
logger$e.throwArgumentError("cannot specify toBlock with blockhash", "toBlock", toBlock);
@ -8397,8 +8413,8 @@ class Contract {
if (!this.provider) {
return false;
}
let runningEvent = this._getRunningEvent(eventName);
let result = (runningEvent.run(args) > 0);
const runningEvent = this._getRunningEvent(eventName);
const result = (runningEvent.run(args) > 0);
// May have drained all the "once" events; check for living events
this._checkRunningEvents(runningEvent);
return result;
@ -8414,7 +8430,7 @@ class Contract {
return [];
}
if (eventName == null) {
let result = [];
const result = [];
for (let tag in this._runningEvents) {
this._runningEvents[tag].listeners().forEach((listener) => {
result.push(listener);
@ -8429,15 +8445,15 @@ class Contract {
return this;
}
if (eventName == null) {
for (let tag in this._runningEvents) {
let runningEvent = this._runningEvents[tag];
for (const tag in this._runningEvents) {
const runningEvent = this._runningEvents[tag];
runningEvent.removeAllListeners();
this._checkRunningEvents(runningEvent);
}
return this;
}
// Delete any listeners
let runningEvent = this._getRunningEvent(eventName);
const runningEvent = this._getRunningEvent(eventName);
runningEvent.removeAllListeners();
this._checkRunningEvents(runningEvent);
return this;
@ -8446,7 +8462,7 @@ class Contract {
if (!this.provider) {
return this;
}
let runningEvent = this._getRunningEvent(eventName);
const runningEvent = this._getRunningEvent(eventName);
runningEvent.removeListener(listener);
this._checkRunningEvents(runningEvent);
return this;
@ -8493,7 +8509,7 @@ class ContractFactory {
// If we have 1 additional argument, we allow transaction overrides
if (args.length === this.interface.deploy.inputs.length + 1) {
tx = shallowCopy(args.pop());
for (let key in tx) {
for (const key in tx) {
if (!allowedTransactionKeys$1[key]) {
throw new Error("unknown transaction override " + key);
}
@ -8518,11 +8534,11 @@ class ContractFactory {
deploy(...args) {
return resolveAddresses(this.signer, args, this.interface.deploy.inputs).then((args) => {
// Get the deployment transaction (with optional overrides)
let tx = this.getDeployTransaction(...args);
const tx = this.getDeployTransaction(...args);
// Send the deployment transaction
return this.signer.sendTransaction(tx).then((tx) => {
let address = (this.constructor).getContractAddress(tx);
let contract = (this.constructor).getContract(address, this.interface, this.signer);
const address = (this.constructor).getContractAddress(tx);
const contract = (this.constructor).getContract(address, this.interface, this.signer);
defineReadOnly(contract, "deployTransaction", tx);
return contract;
});
@ -8541,7 +8557,7 @@ class ContractFactory {
if (typeof (compilerOutput) === "string") {
compilerOutput = JSON.parse(compilerOutput);
}
let abi = compilerOutput.abi;
const abi = compilerOutput.abi;
let bytecode = null;
if (compilerOutput.bytecode) {
bytecode = compilerOutput.bytecode;
@ -13807,7 +13823,7 @@ var aesJs = createCommonjsModule(function (module, exports) {
})(commonjsGlobal);
});
const version$f = "json-wallets/5.0.0-beta.134";
const version$f = "json-wallets/5.0.0-beta.135";
"use strict";
function looseArrayify(hexString) {
@ -14653,7 +14669,6 @@ var __awaiter$1 = (window && window.__awaiter) || function (thisArg, _arguments,
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
// Exported Types
class KeystoreAccount extends Description {
isKeystoreAccount(value) {
return !!(value && value._isKeystoreAccount);
@ -16072,7 +16087,7 @@ function poll(func, options) {
});
}
const version$j = "providers/5.0.0-beta.146";
const version$j = "providers/5.0.0-beta.147";
"use strict";
const logger$m = new Logger(version$j);
@ -17170,7 +17185,12 @@ class BaseProvider extends Provider {
try {
return Promise.resolve(this.formatter.address(name));
}
catch (error) { }
catch (error) {
// If is is a hexstring, the address is bad (See #694)
if (isHexString(name)) {
throw error;
}
}
// Get the addr from the resovler
const resolverAddress = yield this._getResolver(name);
if (!resolverAddress) {
@ -18968,7 +18988,7 @@ var utils$1 = /*#__PURE__*/Object.freeze({
Indexed: Indexed
});
const version$l = "ethers/5.0.0-beta.163";
const version$l = "ethers/5.0.0-beta.164";
"use strict";
const errors = Logger.errors;

File diff suppressed because one or more lines are too long

View File

@ -4756,7 +4756,7 @@
var _version$6 = createCommonjsModule(function (module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = "properties/5.0.0-beta.135";
exports.version = "properties/5.0.0-beta.136";
});
var _version$7 = unwrapExports(_version$6);
@ -4867,7 +4867,6 @@
for (var key in info) {
this[key] = deepCopy(info[key]);
}
Object.freeze(this);
}
return Description;
}());
@ -4886,7 +4885,7 @@
var _version$8 = createCommonjsModule(function (module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = "abi/5.0.0-beta.143";
exports.version = "abi/5.0.0-beta.144";
});
var _version$9 = unwrapExports(_version$8);
@ -7931,12 +7930,6 @@
return Indexed;
}(lib$3.Description));
exports.Indexed = Indexed;
var Result = /** @class */ (function () {
function Result() {
}
return Result;
}());
exports.Result = Result;
var Interface = /** @class */ (function () {
function Interface(fragments$1) {
var _newTarget = this.constructor;
@ -7984,38 +7977,40 @@
}
bucket[signature] = fragment;
});
// Add any fragments with a unique name by its name (sans signature parameters)
/*
[this.events, this.functions].forEach((bucket) => {
let count = getNameCount(bucket);
Object.keys(bucket).forEach((signature) => {
let fragment = bucket[signature];
if (count[fragment.name] !== 1) {
logger.warn("duplicate definition - " + fragment.name);
return;
}
bucket[fragment.name] = fragment;
});
});
*/
// If we do not have a constructor use the default "constructor() payable"
if (!this.deploy) {
lib$3.defineReadOnly(this, "deploy", fragments.ConstructorFragment.from({ type: "constructor" }));
}
lib$3.defineReadOnly(this, "_isInterface", true);
}
Interface.prototype.format = function (format) {
if (!format) {
format = fragments.FormatTypes.full;
}
if (format === fragments.FormatTypes.sighash) {
logger.throwArgumentError("interface does not support formating sighash", "format", format);
}
var abi = this.fragments.map(function (fragment) { return fragment.format(format); });
// We need to re-bundle the JSON fragments a bit
if (format === fragments.FormatTypes.json) {
return JSON.stringify(abi.map(function (j) { return JSON.parse(j); }));
}
return abi;
};
// Sub-classes can override these to handle other blockchains
Interface.getAbiCoder = function () {
return abiCoder.defaultAbiCoder;
};
Interface.getAddress = function (address) {
return lib$6.getAddress(address);
};
Interface.prototype._sighashify = function (functionFragment) {
Interface.getSighash = function (functionFragment) {
return lib$1.hexDataSlice(lib$9.id(functionFragment.format()), 0, 4);
};
Interface.prototype._topicify = function (eventFragment) {
Interface.getTopic = function (eventFragment) {
return lib$9.id(eventFragment.format());
};
// Find a function definition by any means necessary (unless it is ambiguous)
Interface.prototype.getFunction = function (nameOrSignatureOrSighash) {
if (lib$1.isHexString(nameOrSignatureOrSighash)) {
for (var name_1 in this.functions) {
@ -8044,6 +8039,7 @@
}
return result;
};
// Find an event definition by any means necessary (unless it is ambiguous)
Interface.prototype.getEvent = function (nameOrSignatureOrTopic) {
if (lib$1.isHexString(nameOrSignatureOrTopic)) {
var topichash = nameOrSignatureOrTopic.toLowerCase();
@ -8073,17 +8069,19 @@
}
return result;
};
// Get the sighash (the bytes4 selector) used by Solidity to identify a function
Interface.prototype.getSighash = function (functionFragment) {
if (typeof (functionFragment) === "string") {
functionFragment = this.getFunction(functionFragment);
}
return this._sighashify(functionFragment);
return lib$3.getStatic(this.constructor, "getSighash")(functionFragment);
};
// Get the topic (the bytes32 hash) used by Solidity to identify an event
Interface.prototype.getEventTopic = function (eventFragment) {
if (typeof (eventFragment) === "string") {
eventFragment = this.getEvent(eventFragment);
}
return this._topicify(eventFragment);
return lib$3.getStatic(this.constructor, "getTopic")(eventFragment);
};
Interface.prototype._decodeParams = function (params, data) {
return this._abiCoder.decode(params, data);
@ -8094,6 +8092,7 @@
Interface.prototype.encodeDeploy = function (values) {
return this._encodeParams(this.deploy.inputs, values || []);
};
// Decode the data for a function call (e.g. tx.data)
Interface.prototype.decodeFunctionData = function (functionFragment, data) {
if (typeof (functionFragment) === "string") {
functionFragment = this.getFunction(functionFragment);
@ -8104,6 +8103,7 @@
}
return this._decodeParams(functionFragment.inputs, bytes.slice(4));
};
// Encode the data for a function call (e.g. tx.data)
Interface.prototype.encodeFunctionData = function (functionFragment, values) {
if (typeof (functionFragment) === "string") {
functionFragment = this.getFunction(functionFragment);
@ -8113,6 +8113,7 @@
this._encodeParams(functionFragment.inputs, values || [])
]));
};
// Decode the result from a function call (e.g. from eth_call)
Interface.prototype.decodeFunctionResult = function (functionFragment, data) {
if (typeof (functionFragment) === "string") {
functionFragment = this.getFunction(functionFragment);
@ -8130,7 +8131,7 @@
case 4:
if (lib$1.hexlify(bytes.slice(0, 4)) === "0x08c379a0") {
errorSignature = "Error(string)";
reason = this._abiCoder.decode(["string"], bytes.slice(4));
reason = this._abiCoder.decode(["string"], bytes.slice(4))[0];
}
break;
}
@ -8141,12 +8142,14 @@
reason: reason
});
};
// Encode the result for a function call (e.g. for eth_call)
Interface.prototype.encodeFunctionResult = function (functionFragment, values) {
if (typeof (functionFragment) === "string") {
functionFragment = this.getFunction(functionFragment);
}
return lib$1.hexlify(this._abiCoder.encode(functionFragment.outputs, values || []));
};
// Create the filter for the event with search criteria (e.g. for eth_filterLog)
Interface.prototype.encodeFilterTopics = function (eventFragment, values) {
var _this = this;
if (typeof (eventFragment) === "string") {
@ -8196,6 +8199,7 @@
}
return topics;
};
// Decode a filter for the event and the search criteria
Interface.prototype.decodeEventLog = function (eventFragment, data, topics) {
if (typeof (eventFragment) === "string") {
eventFragment = this.getEvent(eventFragment);
@ -8245,10 +8249,14 @@
else {
result[index] = resultNonIndexed[nonIndexedIndex++];
}
//if (param.name && result[param.name] == null) { result[param.name] = result[index]; }
if (param.name && result[param.name] == null) {
result[param.name] = result[index];
}
});
return result;
};
// Given a transaction, find the matching function fragment (if any) and
// determine all its properties and call parameters
Interface.prototype.parseTransaction = function (tx) {
var fragment = this.getFunction(tx.data.substring(0, 10).toLowerCase());
if (!fragment) {
@ -8263,18 +8271,22 @@
value: lib$2.BigNumber.from(tx.value || "0"),
});
};
// Given an event log, find the matching event fragment (if any) and
// determine all its properties and values
Interface.prototype.parseLog = function (log) {
var fragment = this.getEvent(log.topics[0]);
if (!fragment || fragment.anonymous) {
return null;
}
// @TODO: If anonymous, and the only method, and the input count matches, should we parse?
// Probably not, because just because it is the only event in the ABI does
// not mean we have the full ABI; maybe jsut a fragment?
return new LogDescription({
eventFragment: fragment,
name: fragment.name,
signature: fragment.format(),
topic: this.getEventTopic(fragment),
values: this.decodeEventLog(fragment, log.data, log.topics)
args: this.decodeEventLog(fragment, log.data, log.topics)
});
};
/*
@ -8300,8 +8312,7 @@
var _interface_1 = _interface.LogDescription;
var _interface_2 = _interface.TransactionDescription;
var _interface_3 = _interface.Indexed;
var _interface_4 = _interface.Result;
var _interface_5 = _interface.Interface;
var _interface_4 = _interface.Interface;
var lib$a = createCommonjsModule(function (module, exports) {
"use strict";
@ -8336,7 +8347,7 @@
var _version$g = createCommonjsModule(function (module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = "abstract-provider/5.0.0-beta.135";
exports.version = "abstract-provider/5.0.0-beta.136";
});
var _version$h = unwrapExports(_version$g);
@ -8727,7 +8738,7 @@
var _version$k = createCommonjsModule(function (module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = "contracts/5.0.0-beta.142";
exports.version = "contracts/5.0.0-beta.143";
});
var _version$l = unwrapExports(_version$k);
@ -8905,7 +8916,7 @@
var event = lib$3.deepCopy(log);
var parsed = contract.interface.parseLog(log);
if (parsed) {
event.values = parsed.values;
event.args = parsed.args;
event.decode = function (data, topics) {
return _this.interface.decodeEventLog(parsed.eventFragment, data, topics);
};
@ -9022,7 +9033,7 @@
event.decode = function (data, topics) {
return _this.interface.decodeEventLog(_this.fragment, data, topics);
};
event.values = this.interface.decodeEventLog(this.fragment, event.data, event.topics);
event.args = this.interface.decodeEventLog(this.fragment, event.data, event.topics);
};
return FragmentRunningEvent;
}(RunningEvent));
@ -9044,7 +9055,7 @@
event.decode = function (data, topics) {
return _this.interface.decodeEventLog(parsed.eventFragment, data, topics);
};
event.values = parsed.values;
event.args = parsed.args;
}
};
return WildcardRunningEvent;
@ -9328,9 +9339,9 @@
if (!this._wrappedEmits[runningEvent.tag]) {
var wrappedEmit = function (log) {
var event = _this._wrapEvent(runningEvent, log, listener);
var values = (event.values || []);
values.push(event);
_this.emit.apply(_this, __spreadArrays([runningEvent.filter], values));
var args = (event.args || []);
args.push(event);
_this.emit.apply(_this, __spreadArrays([runningEvent.filter], args));
};
this._wrappedEmits[runningEvent.tag] = wrappedEmit;
// Special events, like "error" do not have a filter
@ -14922,7 +14933,7 @@
var _version$y = createCommonjsModule(function (module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = "json-wallets/5.0.0-beta.134";
exports.version = "json-wallets/5.0.0-beta.135";
});
var _version$z = unwrapExports(_version$y);
@ -15903,7 +15914,6 @@
// Exported Types
var KeystoreAccount = /** @class */ (function (_super) {
__extends(KeystoreAccount, _super);
function KeystoreAccount() {
@ -17514,7 +17524,7 @@
var _version$G = createCommonjsModule(function (module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = "providers/5.0.0-beta.146";
exports.version = "providers/5.0.0-beta.147";
});
var _version$H = unwrapExports(_version$G);
@ -18969,7 +18979,12 @@
try {
return [2 /*return*/, Promise.resolve(this.formatter.address(name))];
}
catch (error) { }
catch (error) {
// If is is a hexstring, the address is bad (See #694)
if (lib$1.isHexString(name)) {
throw error;
}
}
return [4 /*yield*/, this._getResolver(name)];
case 3:
resolverAddress = _c.sent();
@ -21416,7 +21431,7 @@
var _version$K = createCommonjsModule(function (module, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = "ethers/5.0.0-beta.163";
exports.version = "ethers/5.0.0-beta.164";
});
var _version$L = unwrapExports(_version$K);

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
export declare const version = "ethers/5.0.0-beta.163";
export declare const version = "ethers/5.0.0-beta.164";

View File

@ -1 +1 @@
export const version = "ethers/5.0.0-beta.163";
export const version = "ethers/5.0.0-beta.164";

View File

@ -1 +1 @@
export declare const version = "ethers/5.0.0-beta.163";
export declare const version = "ethers/5.0.0-beta.164";

View File

@ -1,3 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = "ethers/5.0.0-beta.163";
exports.version = "ethers/5.0.0-beta.164";

View File

@ -52,7 +52,7 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"tarballHash": "0xea25cec628fb9fe5d927142276ce133dd4c9b1a84e46e01a0ab65c9d91840f88",
"tarballHash": "0xee5f689a3a2be6b4546279bd71b5dad414bba6786359a724f2243da2610beb79",
"types": "./lib/index.d.ts",
"version": "5.0.0-beta.163"
"version": "5.0.0-beta.164"
}

View File

@ -1 +1 @@
export const version = "ethers/5.0.0-beta.163";
export const version = "ethers/5.0.0-beta.164";

View File

@ -1 +1 @@
export declare const version = "json-wallets/5.0.0-beta.134";
export declare const version = "json-wallets/5.0.0-beta.135";

View File

@ -1 +1 @@
export const version = "json-wallets/5.0.0-beta.134";
export const version = "json-wallets/5.0.0-beta.135";

View File

@ -1,7 +1,12 @@
import { ExternallyOwnedAccount } from "@ethersproject/abstract-signer";
import { Bytes } from "@ethersproject/bytes";
import { Description } from "@ethersproject/properties";
export declare class CrowdsaleAccount extends Description implements ExternallyOwnedAccount {
interface _CrowdsaleAccount {
address: string;
privateKey: string;
_isCrowdsaleAccount: boolean;
}
export declare class CrowdsaleAccount extends Description<_CrowdsaleAccount> implements ExternallyOwnedAccount {
readonly address: string;
readonly privateKey: string;
readonly mnemonic?: string;
@ -10,3 +15,4 @@ export declare class CrowdsaleAccount extends Description implements ExternallyO
isCrowdsaleAccount(value: any): value is CrowdsaleAccount;
}
export declare function decrypt(json: string, password: Bytes | string): ExternallyOwnedAccount;
export {};

View File

@ -1,7 +1,14 @@
import { ExternallyOwnedAccount } from "@ethersproject/abstract-signer";
import { Bytes, BytesLike } from "@ethersproject/bytes";
import { Description } from "@ethersproject/properties";
export declare class KeystoreAccount extends Description implements ExternallyOwnedAccount {
interface _KeystoreAccount {
address: string;
privateKey: string;
mnemonic?: string;
path?: string;
_isKeystoreAccount: boolean;
}
export declare class KeystoreAccount extends Description<_KeystoreAccount> implements ExternallyOwnedAccount {
readonly address: string;
readonly privateKey: string;
readonly mnemonic?: string;
@ -24,3 +31,4 @@ export declare type EncryptOptions = {
};
export declare function decrypt(json: string, password: Bytes | string, progressCallback?: ProgressCallback): Promise<KeystoreAccount>;
export declare function encrypt(account: ExternallyOwnedAccount, password: Bytes | string, options?: EncryptOptions, progressCallback?: ProgressCallback): Promise<string>;
export {};

View File

@ -20,7 +20,6 @@ import { randomBytes } from "@ethersproject/random";
import { Description } from "@ethersproject/properties";
import { computeAddress } from "@ethersproject/transactions";
import { getPassword, looseArrayify, searchPath, zpad } from "./utils";
// Exported Types
export class KeystoreAccount extends Description {
isKeystoreAccount(value) {
return !!(value && value._isKeystoreAccount);

View File

@ -1 +1 @@
export declare const version = "json-wallets/5.0.0-beta.134";
export declare const version = "json-wallets/5.0.0-beta.135";

View File

@ -1,3 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = "json-wallets/5.0.0-beta.134";
exports.version = "json-wallets/5.0.0-beta.135";

View File

@ -1,7 +1,12 @@
import { ExternallyOwnedAccount } from "@ethersproject/abstract-signer";
import { Bytes } from "@ethersproject/bytes";
import { Description } from "@ethersproject/properties";
export declare class CrowdsaleAccount extends Description implements ExternallyOwnedAccount {
interface _CrowdsaleAccount {
address: string;
privateKey: string;
_isCrowdsaleAccount: boolean;
}
export declare class CrowdsaleAccount extends Description<_CrowdsaleAccount> implements ExternallyOwnedAccount {
readonly address: string;
readonly privateKey: string;
readonly mnemonic?: string;
@ -10,3 +15,4 @@ export declare class CrowdsaleAccount extends Description implements ExternallyO
isCrowdsaleAccount(value: any): value is CrowdsaleAccount;
}
export declare function decrypt(json: string, password: Bytes | string): ExternallyOwnedAccount;
export {};

View File

@ -1,7 +1,14 @@
import { ExternallyOwnedAccount } from "@ethersproject/abstract-signer";
import { Bytes, BytesLike } from "@ethersproject/bytes";
import { Description } from "@ethersproject/properties";
export declare class KeystoreAccount extends Description implements ExternallyOwnedAccount {
interface _KeystoreAccount {
address: string;
privateKey: string;
mnemonic?: string;
path?: string;
_isKeystoreAccount: boolean;
}
export declare class KeystoreAccount extends Description<_KeystoreAccount> implements ExternallyOwnedAccount {
readonly address: string;
readonly privateKey: string;
readonly mnemonic?: string;
@ -24,3 +31,4 @@ export declare type EncryptOptions = {
};
export declare function decrypt(json: string, password: Bytes | string, progressCallback?: ProgressCallback): Promise<KeystoreAccount>;
export declare function encrypt(account: ExternallyOwnedAccount, password: Bytes | string, options?: EncryptOptions, progressCallback?: ProgressCallback): Promise<string>;
export {};

View File

@ -71,7 +71,6 @@ var random_1 = require("@ethersproject/random");
var properties_1 = require("@ethersproject/properties");
var transactions_1 = require("@ethersproject/transactions");
var utils_1 = require("./utils");
// Exported Types
var KeystoreAccount = /** @class */ (function (_super) {
__extends(KeystoreAccount, _super);
function KeystoreAccount() {

View File

@ -36,7 +36,7 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"tarballHash": "0x246b46bbe9ad5ee8d5dacc1aa1b1aa78d86f6f79e6bc1719b85fcffac1486ec8",
"tarballHash": "0x5b89c3458c2a3ba18d96a67d0f61981d5c7dbe4bbf7fe65f8acb443346f9cd29",
"types": "./lib/index.d.ts",
"version": "5.0.0-beta.134"
"version": "5.0.0-beta.135"
}

View File

@ -1 +1 @@
export const version = "json-wallets/5.0.0-beta.134";
export const version = "json-wallets/5.0.0-beta.135";

View File

@ -1 +1 @@
export declare const version = "properties/5.0.0-beta.135";
export declare const version = "properties/5.0.0-beta.136";

View File

@ -1 +1 @@
export const version = "properties/5.0.0-beta.135";
export const version = "properties/5.0.0-beta.136";

View File

@ -6,6 +6,6 @@ export declare function checkProperties(object: any, properties: {
}): void;
export declare function shallowCopy(object: any): any;
export declare function deepCopy(object: any): any;
export declare class Description {
constructor(info: any);
export declare class Description<T = any> {
constructor(info: T);
}

View File

@ -95,6 +95,5 @@ export class Description {
for (const key in info) {
this[key] = deepCopy(info[key]);
}
Object.freeze(this);
}
}

View File

@ -1 +1 @@
export declare const version = "properties/5.0.0-beta.135";
export declare const version = "properties/5.0.0-beta.136";

View File

@ -1,3 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = "properties/5.0.0-beta.135";
exports.version = "properties/5.0.0-beta.136";

View File

@ -6,6 +6,6 @@ export declare function checkProperties(object: any, properties: {
}): void;
export declare function shallowCopy(object: any): any;
export declare function deepCopy(object: any): any;
export declare class Description {
constructor(info: any);
export declare class Description<T = any> {
constructor(info: T);
}

View File

@ -102,7 +102,6 @@ var Description = /** @class */ (function () {
for (var key in info) {
this[key] = deepCopy(info[key]);
}
Object.freeze(this);
}
return Description;
}());

View File

@ -25,7 +25,7 @@
"build": "tsc -p ./tsconfig.json",
"test": "echo \"Error: no test specified\" && exit 1"
},
"tarballHash": "0x7ad895bde8f4224b46603b4ba0132d73330974ecb917033b5faaf8fc99937d65",
"tarballHash": "0x6a1817252456f7b6cbd2edd780d3b2585fcb477da55f7e7282869c0a5a7f5184",
"types": "./lib/index.d.ts",
"version": "5.0.0-beta.135"
"version": "5.0.0-beta.136"
}

View File

@ -1 +1 @@
export const version = "properties/5.0.0-beta.135";
export const version = "properties/5.0.0-beta.136";

View File

@ -1 +1 @@
export declare const version = "providers/5.0.0-beta.146";
export declare const version = "providers/5.0.0-beta.147";

View File

@ -1 +1 @@
export const version = "providers/5.0.0-beta.146";
export const version = "providers/5.0.0-beta.147";

View File

@ -734,7 +734,12 @@ export class BaseProvider extends Provider {
try {
return Promise.resolve(this.formatter.address(name));
}
catch (error) { }
catch (error) {
// If is is a hexstring, the address is bad (See #694)
if (isHexString(name)) {
throw error;
}
}
// Get the addr from the resovler
const resolverAddress = yield this._getResolver(name);
if (!resolverAddress) {

View File

@ -1 +1 @@
export declare const version = "providers/5.0.0-beta.146";
export declare const version = "providers/5.0.0-beta.147";

View File

@ -1,3 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = "providers/5.0.0-beta.146";
exports.version = "providers/5.0.0-beta.147";

View File

@ -1056,7 +1056,12 @@ var BaseProvider = /** @class */ (function (_super) {
try {
return [2 /*return*/, Promise.resolve(this.formatter.address(name))];
}
catch (error) { }
catch (error) {
// If is is a hexstring, the address is bad (See #694)
if (bytes_1.isHexString(name)) {
throw error;
}
}
return [4 /*yield*/, this._getResolver(name)];
case 3:
resolverAddress = _c.sent();

View File

@ -44,7 +44,7 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"tarballHash": "0x240eb6ec5eeb4984ca649d9ca1561ac6db28191ecd1bfd3bad9c1db3aba8bce4",
"tarballHash": "0x9b46000808071da2e4e6c5028459d397beff243d2f8a69b76e3a2275f91402b0",
"types": "./lib/index.d.ts",
"version": "5.0.0-beta.146"
"version": "5.0.0-beta.147"
}

View File

@ -1 +1 @@
export const version = "providers/5.0.0-beta.146";
export const version = "providers/5.0.0-beta.147";