Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c93b48920e | ||
|
|
04c92bb8d5 | ||
|
|
16c9745326 | ||
|
|
05648177aa |
2
_version.d.ts
vendored
2
_version.d.ts
vendored
@@ -1 +1 @@
|
||||
export declare const version = "4.0.25";
|
||||
export declare const version = "4.0.27";
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.version = "4.0.25";
|
||||
exports.version = "4.0.27";
|
||||
|
||||
47
dist/ethers.js
vendored
47
dist/ethers.js
vendored
@@ -1,7 +1,7 @@
|
||||
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.ethers = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.version = "4.0.25";
|
||||
exports.version = "4.0.27";
|
||||
|
||||
},{}],2:[function(require,module,exports){
|
||||
"use strict";
|
||||
@@ -10712,18 +10712,20 @@ var BaseProvider = /** @class */ (function (_super) {
|
||||
if (confirmations == null) {
|
||||
confirmations = 1;
|
||||
}
|
||||
if (confirmations === 0) {
|
||||
return this.getTransactionReceipt(transactionHash);
|
||||
}
|
||||
return new Promise(function (resolve) {
|
||||
var handler = function (receipt) {
|
||||
if (receipt.confirmations < confirmations) {
|
||||
return;
|
||||
}
|
||||
_this.removeListener(transactionHash, handler);
|
||||
resolve(receipt);
|
||||
};
|
||||
_this.on(transactionHash, handler);
|
||||
return this.getTransactionReceipt(transactionHash).then(function (receipt) {
|
||||
if (confirmations === 0 || (receipt && receipt.confirmations >= confirmations)) {
|
||||
return receipt;
|
||||
}
|
||||
return (new Promise(function (resolve) {
|
||||
var handler = function (receipt) {
|
||||
if (receipt.confirmations < confirmations) {
|
||||
return;
|
||||
}
|
||||
_this.removeListener(transactionHash, handler);
|
||||
resolve(receipt);
|
||||
};
|
||||
_this.on(transactionHash, handler);
|
||||
}));
|
||||
});
|
||||
};
|
||||
BaseProvider.prototype.getBlockNumber = function () {
|
||||
@@ -11799,6 +11801,9 @@ var InfuraProvider = /** @class */ (function (_super) {
|
||||
case 'rinkeby':
|
||||
host = 'rinkeby.infura.io';
|
||||
break;
|
||||
case 'goerli':
|
||||
host = 'goerli.infura.io';
|
||||
break;
|
||||
case 'kovan':
|
||||
host = 'kovan.infura.io';
|
||||
break;
|
||||
@@ -11998,7 +12003,7 @@ var JsonRpcSigner = /** @class */ (function (_super) {
|
||||
}
|
||||
return _this.provider._wrapTransaction(tx, hash);
|
||||
});
|
||||
}, { onceBlock: _this.provider }).catch(function (error) {
|
||||
}, { fastRetry: 250, onceBlock: _this.provider }).catch(function (error) {
|
||||
error.transactionHash = hash;
|
||||
throw error;
|
||||
});
|
||||
@@ -15066,12 +15071,7 @@ var networks = {
|
||||
chainId: 5,
|
||||
ensAddress: "0x112234455c3a32fd11230c42e7bccd4a84e02010",
|
||||
name: "goerli",
|
||||
_defaultProvider: function (providers) {
|
||||
if (providers.EtherscanProvider) {
|
||||
return new providers.EtherscanProvider("goerli");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
_defaultProvider: ethDefaultProvider('goerli')
|
||||
},
|
||||
kovan: {
|
||||
chainId: 42,
|
||||
@@ -16918,6 +16918,7 @@ function poll(func, options) {
|
||||
}
|
||||
}, options.timeout);
|
||||
}
|
||||
var fastTimeout = options.fastRetry || null;
|
||||
var attempt = 0;
|
||||
function check() {
|
||||
return func().then(function (result) {
|
||||
@@ -16940,6 +16941,12 @@ function poll(func, options) {
|
||||
if (timeout > options.ceiling) {
|
||||
timeout = options.ceiling;
|
||||
}
|
||||
// Fast Timeout, means we quickly try again the first time
|
||||
if (fastTimeout) {
|
||||
attempt--;
|
||||
timeout = fastTimeout;
|
||||
fastTimeout = null;
|
||||
}
|
||||
setTimeout(check, timeout);
|
||||
}
|
||||
return null;
|
||||
|
||||
2
dist/ethers.min.js
vendored
2
dist/ethers.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/ethers.min.js.map
vendored
2
dist/ethers.min.js.map
vendored
File diff suppressed because one or more lines are too long
3
dist/ethers.types.txt
vendored
3
dist/ethers.types.txt
vendored
@@ -266,7 +266,7 @@ declare module 'ethers/utils/shims' {
|
||||
}
|
||||
|
||||
declare module 'ethers/_version' {
|
||||
export const version = "4.0.25";
|
||||
export const version = "4.0.27";
|
||||
}
|
||||
|
||||
declare module 'ethers/utils/bignumber' {
|
||||
@@ -1041,6 +1041,7 @@ declare module 'ethers/utils/web' {
|
||||
ceiling?: number;
|
||||
interval?: number;
|
||||
onceBlock?: OnceBlockable;
|
||||
fastRetry?: number;
|
||||
};
|
||||
export function fetchJson(connection: string | ConnectionInfo, json: string, processFunc: (value: any) => any): Promise<any>;
|
||||
export function poll(func: () => Promise<any>, options?: PollOptions): Promise<any>;
|
||||
|
||||
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ethers",
|
||||
"version": "4.0.25",
|
||||
"version": "4.0.27",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ethers",
|
||||
"version": "4.0.25",
|
||||
"version": "4.0.27",
|
||||
"description": "Ethereum wallet library.",
|
||||
"main": "./index.js",
|
||||
"types": "./index.d.ts",
|
||||
|
||||
@@ -656,18 +656,20 @@ var BaseProvider = /** @class */ (function (_super) {
|
||||
if (confirmations == null) {
|
||||
confirmations = 1;
|
||||
}
|
||||
if (confirmations === 0) {
|
||||
return this.getTransactionReceipt(transactionHash);
|
||||
}
|
||||
return new Promise(function (resolve) {
|
||||
var handler = function (receipt) {
|
||||
if (receipt.confirmations < confirmations) {
|
||||
return;
|
||||
}
|
||||
_this.removeListener(transactionHash, handler);
|
||||
resolve(receipt);
|
||||
};
|
||||
_this.on(transactionHash, handler);
|
||||
return this.getTransactionReceipt(transactionHash).then(function (receipt) {
|
||||
if (confirmations === 0 || (receipt && receipt.confirmations >= confirmations)) {
|
||||
return receipt;
|
||||
}
|
||||
return (new Promise(function (resolve) {
|
||||
var handler = function (receipt) {
|
||||
if (receipt.confirmations < confirmations) {
|
||||
return;
|
||||
}
|
||||
_this.removeListener(transactionHash, handler);
|
||||
resolve(receipt);
|
||||
};
|
||||
_this.on(transactionHash, handler);
|
||||
}));
|
||||
});
|
||||
};
|
||||
BaseProvider.prototype.getBlockNumber = function () {
|
||||
|
||||
@@ -42,6 +42,9 @@ var InfuraProvider = /** @class */ (function (_super) {
|
||||
case 'rinkeby':
|
||||
host = 'rinkeby.infura.io';
|
||||
break;
|
||||
case 'goerli':
|
||||
host = 'goerli.infura.io';
|
||||
break;
|
||||
case 'kovan':
|
||||
host = 'kovan.infura.io';
|
||||
break;
|
||||
|
||||
@@ -155,7 +155,7 @@ var JsonRpcSigner = /** @class */ (function (_super) {
|
||||
}
|
||||
return _this.provider._wrapTransaction(tx, hash);
|
||||
});
|
||||
}, { onceBlock: _this.provider }).catch(function (error) {
|
||||
}, { fastRetry: 250, onceBlock: _this.provider }).catch(function (error) {
|
||||
error.transactionHash = hash;
|
||||
throw error;
|
||||
});
|
||||
|
||||
@@ -1 +1 @@
|
||||
export const version = "4.0.25";
|
||||
export const version = "4.0.27";
|
||||
|
||||
@@ -32,6 +32,9 @@ export class InfuraProvider extends JsonRpcProvider {
|
||||
case 'rinkeby':
|
||||
host = 'rinkeby.infura.io';
|
||||
break;
|
||||
case 'goerli':
|
||||
host = 'goerli.infura.io';
|
||||
break;
|
||||
case 'kovan':
|
||||
host = 'kovan.infura.io';
|
||||
break;
|
||||
|
||||
@@ -50,6 +50,11 @@ function getLowerCase(value: string): string {
|
||||
|
||||
const _constructorGuard = {};
|
||||
|
||||
// Some environments (Trust Wallet and company) use a global map
|
||||
// to track JSON-RPC ID, so we try to keep IDs unique across all
|
||||
// connections. See #489.
|
||||
let _nextId = 42;
|
||||
|
||||
export class JsonRpcSigner extends Signer {
|
||||
readonly provider: JsonRpcProvider;
|
||||
private _index: number;
|
||||
@@ -250,7 +255,7 @@ export class JsonRpcProvider extends BaseProvider {
|
||||
let request = {
|
||||
method: method,
|
||||
params: params,
|
||||
id: 42,
|
||||
id: (_nextId++),
|
||||
jsonrpc: "2.0"
|
||||
};
|
||||
|
||||
|
||||
@@ -86,12 +86,7 @@ const networks: { [name: string]: Network } = {
|
||||
chainId: 5,
|
||||
ensAddress: "0x112234455c3a32fd11230c42e7bccd4a84e02010",
|
||||
name: "goerli",
|
||||
_defaultProvider: (providers: any): any => {
|
||||
if (providers.EtherscanProvider) {
|
||||
return new providers.EtherscanProvider("goerli");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
_defaultProvider: ethDefaultProvider('goerli')
|
||||
},
|
||||
|
||||
kovan: {
|
||||
|
||||
@@ -414,12 +414,6 @@ function testProvider(providerName, networkName) {
|
||||
['default', 'homestead', 'ropsten', 'rinkeby', 'kovan', 'goerli'].forEach(function(networkName) {
|
||||
['getDefaultProvider', 'InfuraProvider', 'EtherscanProvider', 'Web3Provider'].forEach(function(providerName) {
|
||||
|
||||
if (networkName === "goerli") {
|
||||
if (providerName === "InfuraProvider" || providerName === "Web3Provider") {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// @TODO: Remove this! Temporary because Etherscan is down
|
||||
//if (providerName === 'EtherscanProvider') {
|
||||
// console.log("******** Remove this soon! Etherscan is having issues.");
|
||||
|
||||
@@ -70,12 +70,7 @@ var networks = {
|
||||
chainId: 5,
|
||||
ensAddress: "0x112234455c3a32fd11230c42e7bccd4a84e02010",
|
||||
name: "goerli",
|
||||
_defaultProvider: function (providers) {
|
||||
if (providers.EtherscanProvider) {
|
||||
return new providers.EtherscanProvider("goerli");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
_defaultProvider: ethDefaultProvider('goerli')
|
||||
},
|
||||
kovan: {
|
||||
chainId: 42,
|
||||
|
||||
1
utils/web.d.ts
vendored
1
utils/web.d.ts
vendored
@@ -17,6 +17,7 @@ export declare type PollOptions = {
|
||||
ceiling?: number;
|
||||
interval?: number;
|
||||
onceBlock?: OnceBlockable;
|
||||
fastRetry?: number;
|
||||
};
|
||||
export declare function fetchJson(connection: string | ConnectionInfo, json: string, processFunc: (value: any) => any): Promise<any>;
|
||||
export declare function poll(func: () => Promise<any>, options?: PollOptions): Promise<any>;
|
||||
|
||||
@@ -179,6 +179,7 @@ function poll(func, options) {
|
||||
}
|
||||
}, options.timeout);
|
||||
}
|
||||
var fastTimeout = options.fastRetry || null;
|
||||
var attempt = 0;
|
||||
function check() {
|
||||
return func().then(function (result) {
|
||||
@@ -201,6 +202,12 @@ function poll(func, options) {
|
||||
if (timeout > options.ceiling) {
|
||||
timeout = options.ceiling;
|
||||
}
|
||||
// Fast Timeout, means we quickly try again the first time
|
||||
if (fastTimeout) {
|
||||
attempt--;
|
||||
timeout = fastTimeout;
|
||||
fastTimeout = null;
|
||||
}
|
||||
setTimeout(check, timeout);
|
||||
}
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user