Updated dist files.

This commit is contained in:
Richard Moore 2019-02-08 19:58:41 -05:00
parent a2306f7870
commit 86e815999d
No known key found for this signature in database
GPG Key ID: 525F70A6FCABC295
10 changed files with 98 additions and 8 deletions

40
dist/ethers.js vendored

@ -10380,7 +10380,15 @@ var formatFilter = {
address: allowNull(address_1.getAddress, undefined), address: allowNull(address_1.getAddress, undefined),
topics: allowNull(checkTopics, undefined), topics: allowNull(checkTopics, undefined),
}; };
var formatFilterByBlock = {
blockHash: allowNull(checkHash, undefined),
address: allowNull(address_1.getAddress, undefined),
topics: allowNull(checkTopics, undefined),
};
function checkFilter(filter) { function checkFilter(filter) {
if (filter && filter.blockHash) {
return check(formatFilterByBlock, filter);
}
return check(formatFilter, filter); return check(formatFilter, filter);
} }
var formatLog = { var formatLog = {
@ -11360,6 +11368,9 @@ var EtherscanProvider = /** @class */ (function (_super) {
case 'kovan': case 'kovan':
baseUrl = 'https://api-kovan.etherscan.io'; baseUrl = 'https://api-kovan.etherscan.io';
break; break;
case 'goerli':
baseUrl = 'https://api-goerli.etherscan.io';
break;
default: default:
throw new Error('unsupported network'); throw new Error('unsupported network');
} }
@ -11482,6 +11493,16 @@ var EtherscanProvider = /** @class */ (function (_super) {
if (params.filter.toBlock) { if (params.filter.toBlock) {
url += '&toBlock=' + checkLogTag(params.filter.toBlock); url += '&toBlock=' + checkLogTag(params.filter.toBlock);
} }
if (params.filter.blockHash) {
try {
errors.throwError("Etherscan does not support blockHash filters", errors.UNSUPPORTED_OPERATION, {
operation: "getLogs(blockHash)"
});
}
catch (error) {
return Promise.reject(error);
}
}
if (params.filter.address) { if (params.filter.address) {
url += '&address=' + params.filter.address; url += '&address=' + params.filter.address;
} }
@ -13854,6 +13875,14 @@ function hexlify(value) {
if (value < 0) { if (value < 0) {
errors.throwError('cannot hexlify negative value', errors.INVALID_ARGUMENT, { arg: 'value', value: value }); errors.throwError('cannot hexlify negative value', errors.INVALID_ARGUMENT, { arg: 'value', value: value });
} }
// @TODO: Roll this into the above error as a numeric fault (overflow); next version, not backward compatible
// We can about (value == MAX_INT) to as well, since that may indicate we underflowed already
if (value >= 9007199254740991) {
errors.throwError("out-of-range", errors.NUMERIC_FAULT, {
operartion: "hexlify",
fault: "out-of-safe-range"
});
}
var hex = ''; var hex = '';
while (value) { while (value) {
hex = HexCharacters[value & 0x0f] + hex; hex = HexCharacters[value & 0x0f] + hex;
@ -15023,6 +15052,17 @@ var networks = {
name: 'rinkeby', name: 'rinkeby',
_defaultProvider: ethDefaultProvider('rinkeby') _defaultProvider: ethDefaultProvider('rinkeby')
}, },
goerli: {
chainId: 5,
ensAddress: "0x112234455c3a32fd11230c42e7bccd4a84e02010",
name: "goerli",
_defaultProvider: function (providers) {
if (providers.EtherscanProvider) {
return new providers.EtherscanProvider("goerli");
}
return null;
}
},
kovan: { kovan: {
chainId: 42, chainId: 42,
name: 'kovan', name: 'kovan',

2
dist/ethers.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

11
dist/ethers.types.txt vendored

@ -474,6 +474,11 @@ declare module 'ethers/providers/abstract-provider' {
address?: string; address?: string;
topics?: Array<string | Array<string>>; topics?: Array<string | Array<string>>;
}; };
export type FilterByBlock = {
blockHash?: string;
address?: string;
topics?: Array<string | Array<string>>;
};
export interface Log { export interface Log {
blockNumber?: number; blockNumber?: number;
blockHash?: string; blockHash?: string;
@ -538,7 +543,7 @@ declare module 'ethers/providers/abstract-provider' {
abstract getBlock(blockHashOrBlockTag: BlockTag | string | Promise<BlockTag | string>, includeTransactions?: boolean): Promise<Block>; abstract getBlock(blockHashOrBlockTag: BlockTag | string | Promise<BlockTag | string>, includeTransactions?: boolean): Promise<Block>;
abstract getTransaction(transactionHash: string): Promise<TransactionResponse>; abstract getTransaction(transactionHash: string): Promise<TransactionResponse>;
abstract getTransactionReceipt(transactionHash: string): Promise<TransactionReceipt>; abstract getTransactionReceipt(transactionHash: string): Promise<TransactionReceipt>;
abstract getLogs(filter: Filter): Promise<Array<Log>>; abstract getLogs(filter: Filter | FilterByBlock): Promise<Array<Log>>;
abstract resolveName(name: string | Promise<string>): Promise<string>; abstract resolveName(name: string | Promise<string>): Promise<string>;
abstract lookupAddress(address: string | Promise<string>): Promise<string>; abstract lookupAddress(address: string | Promise<string>): Promise<string>;
abstract on(eventName: EventType, listener: Listener): Provider; abstract on(eventName: EventType, listener: Listener): Provider;
@ -722,7 +727,7 @@ declare module 'ethers/utils/secret-storage' {
declare module 'ethers/providers/base-provider' { declare module 'ethers/providers/base-provider' {
import { BigNumber } from 'ethers/utils/bignumber'; import { BigNumber } from 'ethers/utils/bignumber';
import { Provider } from 'ethers/providers/abstract-provider'; import { Provider } from 'ethers/providers/abstract-provider';
import { Block, BlockTag, EventType, Filter, Listener, Log, TransactionReceipt, TransactionRequest, TransactionResponse } from 'ethers/providers/abstract-provider'; import { Block, BlockTag, EventType, Filter, FilterByBlock, Listener, Log, TransactionReceipt, TransactionRequest, TransactionResponse } from 'ethers/providers/abstract-provider';
import { BigNumberish } from 'ethers/utils/bignumber'; import { BigNumberish } from 'ethers/utils/bignumber';
import { Transaction } from 'ethers/utils/transaction'; import { Transaction } from 'ethers/utils/transaction';
import { Network, Networkish } from 'ethers/utils/networks'; import { Network, Networkish } from 'ethers/utils/networks';
@ -763,7 +768,7 @@ declare module 'ethers/providers/base-provider' {
getBlock(blockHashOrBlockTag: BlockTag | string | Promise<BlockTag | string>, includeTransactions?: boolean): Promise<Block>; getBlock(blockHashOrBlockTag: BlockTag | string | Promise<BlockTag | string>, includeTransactions?: boolean): Promise<Block>;
getTransaction(transactionHash: string): Promise<TransactionResponse>; getTransaction(transactionHash: string): Promise<TransactionResponse>;
getTransactionReceipt(transactionHash: string): Promise<TransactionReceipt>; getTransactionReceipt(transactionHash: string): Promise<TransactionReceipt>;
getLogs(filter: Filter): Promise<Array<Log>>; getLogs(filter: Filter | FilterByBlock): Promise<Array<Log>>;
getEtherPrice(): Promise<number>; getEtherPrice(): Promise<number>;
resolveName(name: string | Promise<string>): Promise<string>; resolveName(name: string | Promise<string>): Promise<string>;
lookupAddress(address: string | Promise<string>): Promise<string>; lookupAddress(address: string | Promise<string>): Promise<string>;

@ -24,6 +24,11 @@ export declare type Filter = {
address?: string; address?: string;
topics?: Array<string | Array<string>>; topics?: Array<string | Array<string>>;
}; };
export declare type FilterByBlock = {
blockHash?: string;
address?: string;
topics?: Array<string | Array<string>>;
};
export interface Log { export interface Log {
blockNumber?: number; blockNumber?: number;
blockHash?: string; blockHash?: string;
@ -88,7 +93,7 @@ export declare abstract class Provider implements OnceBlockable {
abstract getBlock(blockHashOrBlockTag: BlockTag | string | Promise<BlockTag | string>, includeTransactions?: boolean): Promise<Block>; abstract getBlock(blockHashOrBlockTag: BlockTag | string | Promise<BlockTag | string>, includeTransactions?: boolean): Promise<Block>;
abstract getTransaction(transactionHash: string): Promise<TransactionResponse>; abstract getTransaction(transactionHash: string): Promise<TransactionResponse>;
abstract getTransactionReceipt(transactionHash: string): Promise<TransactionReceipt>; abstract getTransactionReceipt(transactionHash: string): Promise<TransactionReceipt>;
abstract getLogs(filter: Filter): Promise<Array<Log>>; abstract getLogs(filter: Filter | FilterByBlock): Promise<Array<Log>>;
abstract resolveName(name: string | Promise<string>): Promise<string>; abstract resolveName(name: string | Promise<string>): Promise<string>;
abstract lookupAddress(address: string | Promise<string>): Promise<string>; abstract lookupAddress(address: string | Promise<string>): Promise<string>;
abstract on(eventName: EventType, listener: Listener): Provider; abstract on(eventName: EventType, listener: Listener): Provider;

@ -1,6 +1,6 @@
import { BigNumber } from '../utils/bignumber'; import { BigNumber } from '../utils/bignumber';
import { Provider } from './abstract-provider'; import { Provider } from './abstract-provider';
import { Block, BlockTag, EventType, Filter, Listener, Log, TransactionReceipt, TransactionRequest, TransactionResponse } from './abstract-provider'; import { Block, BlockTag, EventType, Filter, FilterByBlock, Listener, Log, TransactionReceipt, TransactionRequest, TransactionResponse } from './abstract-provider';
import { BigNumberish } from '../utils/bignumber'; import { BigNumberish } from '../utils/bignumber';
import { Transaction } from '../utils/transaction'; import { Transaction } from '../utils/transaction';
import { Network, Networkish } from '../utils/networks'; import { Network, Networkish } from '../utils/networks';
@ -51,7 +51,7 @@ export declare class BaseProvider extends Provider {
getBlock(blockHashOrBlockTag: BlockTag | string | Promise<BlockTag | string>, includeTransactions?: boolean): Promise<Block>; getBlock(blockHashOrBlockTag: BlockTag | string | Promise<BlockTag | string>, includeTransactions?: boolean): Promise<Block>;
getTransaction(transactionHash: string): Promise<TransactionResponse>; getTransaction(transactionHash: string): Promise<TransactionResponse>;
getTransactionReceipt(transactionHash: string): Promise<TransactionReceipt>; getTransactionReceipt(transactionHash: string): Promise<TransactionReceipt>;
getLogs(filter: Filter): Promise<Array<Log>>; getLogs(filter: Filter | FilterByBlock): Promise<Array<Log>>;
getEtherPrice(): Promise<number>; getEtherPrice(): Promise<number>;
private _resolveNames; private _resolveNames;
private _getResolver; private _getResolver;

@ -326,7 +326,15 @@ var formatFilter = {
address: allowNull(address_1.getAddress, undefined), address: allowNull(address_1.getAddress, undefined),
topics: allowNull(checkTopics, undefined), topics: allowNull(checkTopics, undefined),
}; };
var formatFilterByBlock = {
blockHash: allowNull(checkHash, undefined),
address: allowNull(address_1.getAddress, undefined),
topics: allowNull(checkTopics, undefined),
};
function checkFilter(filter) { function checkFilter(filter) {
if (filter && filter.blockHash) {
return check(formatFilterByBlock, filter);
}
return check(formatFilter, filter); return check(formatFilter, filter);
} }
var formatLog = { var formatLog = {

@ -104,6 +104,9 @@ var EtherscanProvider = /** @class */ (function (_super) {
case 'kovan': case 'kovan':
baseUrl = 'https://api-kovan.etherscan.io'; baseUrl = 'https://api-kovan.etherscan.io';
break; break;
case 'goerli':
baseUrl = 'https://api-goerli.etherscan.io';
break;
default: default:
throw new Error('unsupported network'); throw new Error('unsupported network');
} }
@ -226,6 +229,16 @@ var EtherscanProvider = /** @class */ (function (_super) {
if (params.filter.toBlock) { if (params.filter.toBlock) {
url += '&toBlock=' + checkLogTag(params.filter.toBlock); url += '&toBlock=' + checkLogTag(params.filter.toBlock);
} }
if (params.filter.blockHash) {
try {
errors.throwError("Etherscan does not support blockHash filters", errors.UNSUPPORTED_OPERATION, {
operation: "getLogs(blockHash)"
});
}
catch (error) {
return Promise.reject(error);
}
}
if (params.filter.address) { if (params.filter.address) {
url += '&address=' + params.filter.address; url += '&address=' + params.filter.address;
} }

@ -135,6 +135,14 @@ function hexlify(value) {
if (value < 0) { if (value < 0) {
errors.throwError('cannot hexlify negative value', errors.INVALID_ARGUMENT, { arg: 'value', value: value }); errors.throwError('cannot hexlify negative value', errors.INVALID_ARGUMENT, { arg: 'value', value: value });
} }
// @TODO: Roll this into the above error as a numeric fault (overflow); next version, not backward compatible
// We can about (value == MAX_INT) to as well, since that may indicate we underflowed already
if (value >= 9007199254740991) {
errors.throwError("out-of-range", errors.NUMERIC_FAULT, {
operartion: "hexlify",
fault: "out-of-safe-range"
});
}
var hex = ''; var hex = '';
while (value) { while (value) {
hex = HexCharacters[value & 0x0f] + hex; hex = HexCharacters[value & 0x0f] + hex;

@ -66,6 +66,17 @@ var networks = {
name: 'rinkeby', name: 'rinkeby',
_defaultProvider: ethDefaultProvider('rinkeby') _defaultProvider: ethDefaultProvider('rinkeby')
}, },
goerli: {
chainId: 5,
ensAddress: "0x112234455c3a32fd11230c42e7bccd4a84e02010",
name: "goerli",
_defaultProvider: function (providers) {
if (providers.EtherscanProvider) {
return new providers.EtherscanProvider("goerli");
}
return null;
}
},
kovan: { kovan: {
chainId: 42, chainId: 42,
name: 'kovan', name: 'kovan',