Skip to content

Commit

Permalink
Updated dist files.
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo committed Feb 16, 2020
1 parent a930047 commit 4c9d740
Show file tree
Hide file tree
Showing 13 changed files with 36 additions and 16 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
CHANGELOG
=========

ethers/v4.0.45 (2020-02-16 16:16)
---------------------------------

- Added default API key for EtherscanProvider. ([a930047](https://github.com/ethers-io/ethers.js/commit/a930047a102d3369c4e847d7ef43bd850704cf00)).
- Fixed typo in arguments name for waitForTransaction. ([#477](https://github.com/ethers-io/ethers.js/issues/477); [4e41871](https://github.com/ethers-io/ethers.js/commit/4e41871fa4cf701d714ad73527a367e9ca1d3431)).
- Partial support for non-English mnemonics for encrypted JSON wallets. ([#685](https://github.com/ethers-io/ethers.js/issues/685); [9947acc](https://github.com/ethers-io/ethers.js/commit/9947acc349691734bce8b33d870ab48944a7962f)).
- Updated expected balance in test cases. ([748f896](https://github.com/ethers-io/ethers.js/commit/748f89660ac4bf60175f936da755cf1a0d370f46)).

ethers/v4.0.44 (2020-01-29 22:01)
---------------------------------

Expand Down
2 changes: 1 addition & 1 deletion _version.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export declare const version = "4.0.44";
export declare const version = "4.0.45";
2 changes: 1 addition & 1 deletion _version.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = "4.0.44";
exports.version = "4.0.45";
13 changes: 9 additions & 4 deletions dist/ethers.js
Original file line number Diff line number Diff line change
@@ -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.44";
exports.version = "4.0.45";

},{}],2:[function(require,module,exports){
"use strict";
Expand Down Expand Up @@ -11404,6 +11404,7 @@ function checkLogTag(blockTag) {
}
return parseInt(blockTag.substring(2), 16);
}
var defaultApiKey = "8FG3JMZ9USS4NTA6YKEKHINU56SEPPVBJR";
var EtherscanProvider = /** @class */ (function (_super) {
__extends(EtherscanProvider, _super);
function EtherscanProvider(network, apiKey) {
Expand Down Expand Up @@ -11434,7 +11435,7 @@ var EtherscanProvider = /** @class */ (function (_super) {
throw new Error('unsupported network');
}
properties_1.defineReadOnly(_this, 'baseUrl', baseUrl);
properties_1.defineReadOnly(_this, 'apiKey', apiKey);
properties_1.defineReadOnly(_this, 'apiKey', apiKey || defaultApiKey);
return _this;
}
EtherscanProvider.prototype.perform = function (method, params) {
Expand Down Expand Up @@ -15833,7 +15834,8 @@ function decrypt(json, password, progressCallback) {
return null;
}
// Version 0.1 x-ethers metadata must contain an encrypted mnemonic phrase
if (searchPath(data, 'x-ethers/version') === '0.1') {
var locale = searchPath(data, 'x-ethers/locale');
if (searchPath(data, 'x-ethers/version') === '0.1' && (locale == null || locale === "en")) {
var mnemonicCiphertext = looseArrayify(searchPath(data, 'x-ethers/mnemonicCiphertext'));
var mnemonicIv = looseArrayify(searchPath(data, 'x-ethers/mnemonicCounter'));
var mnemonicCounter = new aes_js_1.default.Counter(mnemonicIv);
Expand Down Expand Up @@ -15965,7 +15967,7 @@ function encrypt(privateKey, password, options, progressCallback) {
}
}
else {
entropy = bytes_1.arrayify(HDNode.mnemonicToEntropy(options.mnemonic));
entropy = bytes_1.arrayify(HDNode.mnemonicToEntropy(options.mnemonic, options.wordlist));
}
}
var path = options.path;
Expand Down Expand Up @@ -16090,6 +16092,9 @@ function encrypt(privateKey, password, options, progressCallback) {
path: path,
version: "0.1"
};
if (options.wordlist && typeof (options.wordlist.locale) === "string") {
data['x-ethers'].locale = options.wordlist.locale;
}
}
if (progressCallback) {
progressCallback(1);
Expand Down
2 changes: 1 addition & 1 deletion dist/ethers.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/ethers.min.js.map

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions dist/ethers.types.txt
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ declare module 'ethers/utils/shims' {
}

declare module 'ethers/_version' {
export const version = "4.0.44";
export const version = "4.0.45";
}

declare module 'ethers/utils/bignumber' {
Expand Down Expand Up @@ -553,7 +553,7 @@ declare module 'ethers/providers/abstract-provider' {
abstract listeners(eventName: EventType): Array<Listener>;
abstract removeAllListeners(eventName: EventType): Provider;
abstract removeListener(eventName: EventType, listener: Listener): Provider;
abstract waitForTransaction(transactionHash: string, timeout?: number): Promise<TransactionReceipt>;
abstract waitForTransaction(transactionHash: string, confirmations?: number): Promise<TransactionReceipt>;
constructor();
static isProvider(value: any): value is Provider;
}
Expand Down Expand Up @@ -710,6 +710,7 @@ declare module 'ethers/utils/secret-storage' {
entropy?: Arrayish;
mnemonic?: string;
path?: string;
wordlist?: any;
client?: string;
salt?: Arrayish;
uuid?: string;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ethers",
"version": "4.0.44",
"version": "4.0.45",
"description": "Ethereum wallet library.",
"main": "./index.js",
"types": "./index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion providers/abstract-provider.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export declare abstract class Provider implements OnceBlockable {
abstract listeners(eventName: EventType): Array<Listener>;
abstract removeAllListeners(eventName: EventType): Provider;
abstract removeListener(eventName: EventType, listener: Listener): Provider;
abstract waitForTransaction(transactionHash: string, timeout?: number): Promise<TransactionReceipt>;
abstract waitForTransaction(transactionHash: string, confirmations?: number): Promise<TransactionReceipt>;
constructor();
static isProvider(value: any): value is Provider;
}
3 changes: 2 additions & 1 deletion providers/etherscan-provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ function checkLogTag(blockTag) {
}
return parseInt(blockTag.substring(2), 16);
}
var defaultApiKey = "8FG3JMZ9USS4NTA6YKEKHINU56SEPPVBJR";
var EtherscanProvider = /** @class */ (function (_super) {
__extends(EtherscanProvider, _super);
function EtherscanProvider(network, apiKey) {
Expand Down Expand Up @@ -111,7 +112,7 @@ var EtherscanProvider = /** @class */ (function (_super) {
throw new Error('unsupported network');
}
properties_1.defineReadOnly(_this, 'baseUrl', baseUrl);
properties_1.defineReadOnly(_this, 'apiKey', apiKey);
properties_1.defineReadOnly(_this, 'apiKey', apiKey || defaultApiKey);
return _this;
}
EtherscanProvider.prototype.perform = function (method, params) {
Expand Down
2 changes: 1 addition & 1 deletion src.ts/_version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const version = "4.0.44";
export const version = "4.0.45";
1 change: 1 addition & 0 deletions utils/secret-storage.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export declare type EncryptOptions = {
entropy?: Arrayish;
mnemonic?: string;
path?: string;
wordlist?: any;
client?: string;
salt?: Arrayish;
uuid?: string;
Expand Down
8 changes: 6 additions & 2 deletions utils/secret-storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ function decrypt(json, password, progressCallback) {
return null;
}
// Version 0.1 x-ethers metadata must contain an encrypted mnemonic phrase
if (searchPath(data, 'x-ethers/version') === '0.1') {
var locale = searchPath(data, 'x-ethers/locale');
if (searchPath(data, 'x-ethers/version') === '0.1' && (locale == null || locale === "en")) {
var mnemonicCiphertext = looseArrayify(searchPath(data, 'x-ethers/mnemonicCiphertext'));
var mnemonicIv = looseArrayify(searchPath(data, 'x-ethers/mnemonicCounter'));
var mnemonicCounter = new aes_js_1.default.Counter(mnemonicIv);
Expand Down Expand Up @@ -262,7 +263,7 @@ function encrypt(privateKey, password, options, progressCallback) {
}
}
else {
entropy = bytes_1.arrayify(HDNode.mnemonicToEntropy(options.mnemonic));
entropy = bytes_1.arrayify(HDNode.mnemonicToEntropy(options.mnemonic, options.wordlist));
}
}
var path = options.path;
Expand Down Expand Up @@ -387,6 +388,9 @@ function encrypt(privateKey, password, options, progressCallback) {
path: path,
version: "0.1"
};
if (options.wordlist && typeof (options.wordlist.locale) === "string") {
data['x-ethers'].locale = options.wordlist.locale;
}
}
if (progressCallback) {
progressCallback(1);
Expand Down

0 comments on commit 4c9d740

Please sign in to comment.