Updated dist files.
This commit is contained in:
parent
e0391ee1bc
commit
94171f6c57
@ -15,6 +15,7 @@ var bytes_1 = require("../utils/bytes");
|
||||
var properties_1 = require("../utils/properties");
|
||||
var web_1 = require("../utils/web");
|
||||
var types_1 = require("../utils/types");
|
||||
//export { EventFilter, Event, Listener, Log, TransactionRequest, TransactionResponse };
|
||||
var errors = __importStar(require("../utils/errors"));
|
||||
var allowedTransactionKeys = {
|
||||
data: true, from: true, gasLimit: true, gasPrice: true, nonce: true, to: true, value: true
|
||||
|
@ -4,7 +4,3 @@ var contract_1 = require("./contract");
|
||||
exports.Contract = contract_1.Contract;
|
||||
var interface_1 = require("./interface");
|
||||
exports.Interface = interface_1.Interface;
|
||||
exports.default = {
|
||||
Contract: contract_1.Contract,
|
||||
Interface: interface_1.Interface
|
||||
};
|
||||
|
@ -26,7 +26,7 @@ var hash_1 = require("../utils/hash");
|
||||
var keccak256_1 = require("../utils/keccak256");
|
||||
var properties_1 = require("../utils/properties");
|
||||
var types_1 = require("../utils/types");
|
||||
exports.Indexed = types_1.Indexed;
|
||||
//export { DeployDescription, EventDescription, FunctionDescription, Indexed };
|
||||
var errors = __importStar(require("../utils/errors"));
|
||||
var _Indexed = /** @class */ (function (_super) {
|
||||
__extends(_Indexed, _super);
|
||||
|
1289
dist/ethers.d.ts
vendored
1289
dist/ethers.d.ts
vendored
File diff suppressed because it is too large
Load Diff
514
dist/ethers.js
vendored
514
dist/ethers.js
vendored
File diff suppressed because one or more lines are too long
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
2
dist/wordlist-it.js
vendored
2
dist/wordlist-it.js
vendored
File diff suppressed because one or more lines are too long
2
dist/wordlist-ja.js
vendored
2
dist/wordlist-ja.js
vendored
File diff suppressed because one or more lines are too long
2
dist/wordlist-ko.js
vendored
2
dist/wordlist-ko.js
vendored
File diff suppressed because one or more lines are too long
2
dist/wordlist-zh.js
vendored
2
dist/wordlist-zh.js
vendored
File diff suppressed because one or more lines are too long
8
index.js
8
index.js
@ -12,12 +12,8 @@ exports.Contract = contracts_1.Contract;
|
||||
exports.Interface = contracts_1.Interface;
|
||||
var providers = __importStar(require("./providers"));
|
||||
exports.providers = providers;
|
||||
var errors = __importStar(require("./utils/errors"));
|
||||
exports.errors = errors;
|
||||
var networks_1 = require("./providers/networks");
|
||||
exports.getNetwork = networks_1.getNetwork;
|
||||
var types = __importStar(require("./utils/types"));
|
||||
exports.types = types;
|
||||
var utils = __importStar(require("./utils"));
|
||||
exports.utils = utils;
|
||||
var wallet_1 = require("./wallet");
|
||||
@ -26,6 +22,10 @@ exports.SigningKey = wallet_1.SigningKey;
|
||||
exports.Wallet = wallet_1.Wallet;
|
||||
var wordlists = __importStar(require("./wordlists"));
|
||||
exports.wordlists = wordlists;
|
||||
var types = __importStar(require("./utils/types"));
|
||||
exports.types = types;
|
||||
var errors = __importStar(require("./utils/errors"));
|
||||
exports.errors = errors;
|
||||
var _version_1 = require("./_version");
|
||||
exports.version = _version_1.version;
|
||||
var constants = utils.constants;
|
||||
|
@ -22,14 +22,3 @@ function getDefaultProvider(network) {
|
||||
]);
|
||||
}
|
||||
exports.getDefaultProvider = getDefaultProvider;
|
||||
exports.default = {
|
||||
Provider: provider_1.Provider,
|
||||
getDefaultProvider: getDefaultProvider,
|
||||
FallbackProvider: fallback_provider_1.FallbackProvider,
|
||||
EtherscanProvider: etherscan_provider_1.EtherscanProvider,
|
||||
InfuraProvider: infura_provider_1.InfuraProvider,
|
||||
JsonRpcProvider: json_rpc_provider_1.JsonRpcProvider,
|
||||
Web3Provider: web3_provider_1.Web3Provider,
|
||||
IpcProvider: ipc_provider_1.IpcProvider,
|
||||
JsonRpcSigner: json_rpc_provider_1.JsonRpcSigner
|
||||
};
|
||||
|
@ -28,6 +28,7 @@ var transaction_1 = require("../utils/transaction");
|
||||
var utf8_1 = require("../utils/utf8");
|
||||
var web_1 = require("../utils/web");
|
||||
var types_1 = require("../utils/types");
|
||||
//export { Block, BlockTag, EventType, Filter, Listener, Log, TransactionReceipt, TransactionRequest, TransactionResponse };
|
||||
var errors = __importStar(require("../utils/errors"));
|
||||
//////////////////////////////
|
||||
// Request and Response Checking
|
||||
|
@ -20,6 +20,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var json_rpc_provider_1 = require("./json-rpc-provider");
|
||||
var properties_1 = require("../utils/properties");
|
||||
var errors = __importStar(require("../utils/errors"));
|
||||
/*
|
||||
@TODO
|
||||
utils.defineProperty(Web3Signer, 'onchange', {
|
||||
|
||||
});
|
||||
|
||||
export type AsyncProvider = {
|
||||
isMetaMask: boolean;
|
||||
host?: string;
|
||||
path?: string;
|
||||
sendAsync: (request: any, callback: (error: any, response: any) => void) => void
|
||||
}
|
||||
|
||||
*/
|
||||
var Web3Provider = /** @class */ (function (_super) {
|
||||
__extends(Web3Provider, _super);
|
||||
function Web3Provider(web3Provider, network) {
|
||||
|
@ -87,51 +87,3 @@ var constants = {
|
||||
WeiPerEther: bignumber_1.ConstantWeiPerEther
|
||||
};
|
||||
exports.constants = constants;
|
||||
exports.default = {
|
||||
AbiCoder: abi_coder_1.AbiCoder,
|
||||
defaultAbiCoder: abi_coder_1.defaultAbiCoder,
|
||||
parseSignature: abi_coder_1.parseSignature,
|
||||
parseParamType: abi_coder_1.parseParamType,
|
||||
constants: constants,
|
||||
RLP: RLP,
|
||||
fetchJson: web_1.fetchJson,
|
||||
defineReadOnly: properties_1.defineReadOnly,
|
||||
defineFrozen: properties_1.defineFrozen,
|
||||
resolveProperties: properties_1.resolveProperties,
|
||||
shallowCopy: properties_1.shallowCopy,
|
||||
etherSymbol: etherSymbol,
|
||||
arrayify: bytes_1.arrayify,
|
||||
concat: bytes_1.concat,
|
||||
padZeros: bytes_1.padZeros,
|
||||
stripZeros: bytes_1.stripZeros,
|
||||
base64: base64,
|
||||
bigNumberify: bignumber_1.bigNumberify,
|
||||
hexlify: bytes_1.hexlify,
|
||||
hexStripZeros: bytes_1.hexStripZeros,
|
||||
hexZeroPad: bytes_1.hexZeroPad,
|
||||
hexDataLength: bytes_1.hexDataLength,
|
||||
hexDataSlice: bytes_1.hexDataSlice,
|
||||
toUtf8Bytes: utf8_1.toUtf8Bytes,
|
||||
toUtf8String: utf8_1.toUtf8String,
|
||||
hashMessage: hash_1.hashMessage,
|
||||
namehash: hash_1.namehash,
|
||||
id: hash_1.id,
|
||||
getAddress: address_1.getAddress,
|
||||
getIcapAddress: address_1.getIcapAddress,
|
||||
getContractAddress: address_1.getContractAddress,
|
||||
formatEther: units_1.formatEther,
|
||||
parseEther: units_1.parseEther,
|
||||
formatUnits: units_1.formatUnits,
|
||||
parseUnits: units_1.parseUnits,
|
||||
keccak256: keccak256_1.keccak256,
|
||||
sha256: sha2_1.sha256,
|
||||
randomBytes: random_bytes_1.randomBytes,
|
||||
solidityPack: solidity_1.pack,
|
||||
solidityKeccak256: solidity_1.keccak256,
|
||||
soliditySha256: solidity_1.sha256,
|
||||
splitSignature: bytes_1.splitSignature,
|
||||
joinSignature: bytes_1.joinSignature,
|
||||
parseTransaction: transaction_1.parse,
|
||||
serializeTransaction: transaction_1.serialize,
|
||||
errors: errors
|
||||
};
|
||||
|
@ -12,6 +12,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||
// The English language word list.
|
||||
// For additional word lists, please see /src.tc/wordlists/
|
||||
var lang_en_1 = require("../wordlists/lang-en");
|
||||
// Automatically register English?
|
||||
//import { register } from '../wordlists/wordlist';
|
||||
//register(langEn);
|
||||
var bytes_1 = require("../utils/bytes");
|
||||
var bignumber_1 = require("../utils/bignumber");
|
||||
var utf8_1 = require("../utils/utf8");
|
||||
|
@ -13,4 +13,3 @@ var HDNode = __importStar(require("./hdnode"));
|
||||
exports.HDNode = HDNode;
|
||||
var signing_key_1 = require("./signing-key");
|
||||
exports.SigningKey = signing_key_1.SigningKey;
|
||||
exports.default = { HDNode: HDNode, SigningKey: signing_key_1.SigningKey, Wallet: wallet_1.Wallet };
|
||||
|
@ -28,7 +28,7 @@ var random_bytes_1 = require("../utils/random-bytes");
|
||||
var secp256k1_1 = require("../utils/secp256k1");
|
||||
var transaction_1 = require("../utils/transaction");
|
||||
var types_1 = require("../utils/types");
|
||||
exports.Signer = types_1.Signer;
|
||||
//export { BlockTag, ProgressCallback, Signer, TransactionRequest, TransactionResponse };
|
||||
var errors = __importStar(require("../utils/errors"));
|
||||
var Wallet = /** @class */ (function (_super) {
|
||||
__extends(Wallet, _super);
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -18,6 +18,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var wordlist_1 = require("./wordlist");
|
||||
var bytes_1 = require("../utils/bytes");
|
||||
var utf8_1 = require("../utils/utf8");
|
||||
var errors = __importStar(require("../utils/errors"));
|
||||
var data = [
|
||||
@ -38,12 +39,17 @@ var data = [
|
||||
];
|
||||
// Maps each character into its kana value (the index)
|
||||
var mapping = "~~AzB~X~a~KN~Q~D~S~C~G~E~Y~p~L~I~O~eH~g~V~hxyumi~~U~~Z~~v~~s~~dkoblPjfnqwMcRTr~W~~~F~~~~~Jt";
|
||||
var words = null;
|
||||
function loadWords() {
|
||||
if (words !== null) {
|
||||
var wordlist = null;
|
||||
function hex(word) {
|
||||
return bytes_1.hexlify(utf8_1.toUtf8Bytes(word));
|
||||
}
|
||||
var KiYoKu = '0xe3818de38284e3818f';
|
||||
var KyoKu = '0xe3818de38283e3818f';
|
||||
function loadWords(lang) {
|
||||
if (wordlist !== null) {
|
||||
return;
|
||||
}
|
||||
words = [];
|
||||
wordlist = [];
|
||||
// Transforms for normalizing (sort is a not quite UTF-8)
|
||||
var transform = {};
|
||||
// Delete the diacritic marks
|
||||
@ -93,33 +99,36 @@ function loadWords() {
|
||||
word.push((k & 0x40) ? 130 : 129);
|
||||
word.push((k & 0x3f) + 128);
|
||||
}
|
||||
words.push(utf8_1.toUtf8String(word));
|
||||
wordlist.push(utf8_1.toUtf8String(word));
|
||||
}
|
||||
}
|
||||
words.sort(sortJapanese);
|
||||
// For some reason kyoku and kiyoku are flipped; we'll just manually fix it
|
||||
var kyoku = words[442];
|
||||
words[442] = words[443];
|
||||
words[443] = kyoku;
|
||||
wordlist.sort(sortJapanese);
|
||||
// For some reason kyoku and kiyoku are flipped in node (!!).
|
||||
// The order SHOULD be:
|
||||
// - kyoku
|
||||
// - kiyoku
|
||||
if (hex(wordlist[442]) === KiYoKu && hex(wordlist[443]) === KyoKu) {
|
||||
var tmp = wordlist[442];
|
||||
wordlist[442] = wordlist[443];
|
||||
wordlist[443] = tmp;
|
||||
}
|
||||
if (wordlist_1.check(lang) !== '0xcb36b09e6baa935787fd762ce65e80b0c6a8dabdfbc3a7f86ac0e2c4fd111600') {
|
||||
wordlist = null;
|
||||
throw new Error('BIP39 Wordlist for ja (Japanese) FAILED');
|
||||
}
|
||||
}
|
||||
/*
|
||||
var fs = require('fs');
|
||||
fs.readFileSync('lang-ja.txt').toString().split('\x0a').forEach(function(d, i) {
|
||||
if (d !== words[i]) { console.log(d, words[i], i, toUtf8Bytes(d)); }
|
||||
});
|
||||
*/
|
||||
var LangJa = /** @class */ (function (_super) {
|
||||
__extends(LangJa, _super);
|
||||
function LangJa() {
|
||||
return _super.call(this, 'ja') || this;
|
||||
}
|
||||
LangJa.prototype.getWord = function (index) {
|
||||
loadWords();
|
||||
return words[index];
|
||||
loadWords(this);
|
||||
return wordlist[index];
|
||||
};
|
||||
LangJa.prototype.getWordIndex = function (word) {
|
||||
loadWords();
|
||||
return words.indexOf(word);
|
||||
loadWords(this);
|
||||
return wordlist.indexOf(word);
|
||||
};
|
||||
LangJa.prototype.split = function (mnemonic) {
|
||||
if (!mnemonic.normalize) {
|
||||
|
@ -33,7 +33,7 @@ function getHangul(code) {
|
||||
return utf8_1.toUtf8String([225, (code >> 6) + 132, (code & 0x3f) + 128]);
|
||||
}
|
||||
var wordlist = null;
|
||||
function loadWords() {
|
||||
function loadWords(lang) {
|
||||
if (wordlist != null) {
|
||||
return;
|
||||
}
|
||||
@ -49,19 +49,22 @@ function loadWords() {
|
||||
}
|
||||
});
|
||||
wordlist.sort();
|
||||
if (wordlist_1.check(lang) !== '0xf9eddeace9c5d3da9c93cf7d3cd38f6a13ed3affb933259ae865714e8a3ae71a') {
|
||||
wordlist = null;
|
||||
throw new Error('BIP39 Wordlist for ko (Korean) FAILED');
|
||||
}
|
||||
}
|
||||
loadWords();
|
||||
var LangKo = /** @class */ (function (_super) {
|
||||
__extends(LangKo, _super);
|
||||
function LangKo() {
|
||||
return _super.call(this, 'ko') || this;
|
||||
}
|
||||
LangKo.prototype.getWord = function (index) {
|
||||
loadWords();
|
||||
loadWords(this);
|
||||
return wordlist[index];
|
||||
};
|
||||
LangKo.prototype.getWordIndex = function (word) {
|
||||
loadWords();
|
||||
loadWords(this);
|
||||
return wordlist.indexOf(word);
|
||||
};
|
||||
return LangKo;
|
||||
|
File diff suppressed because one or more lines are too long
@ -2,7 +2,20 @@
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
// This gets overriddenby gulp during bip39-XX
|
||||
var exportWordlist = false;
|
||||
var hash_1 = require("../utils/hash");
|
||||
var properties_1 = require("../utils/properties");
|
||||
function check(wordlist) {
|
||||
var words = [];
|
||||
for (var i = 0; i < 2048; i++) {
|
||||
var word = wordlist.getWord(i);
|
||||
if (i !== wordlist.getWordIndex(word)) {
|
||||
return '0x';
|
||||
}
|
||||
words.push(word);
|
||||
}
|
||||
return hash_1.id(words.join('\n') + '\n');
|
||||
}
|
||||
exports.check = check;
|
||||
var Wordlist = /** @class */ (function () {
|
||||
function Wordlist(locale) {
|
||||
properties_1.defineReadOnly(this, 'locale', locale);
|
||||
@ -18,12 +31,23 @@ var Wordlist = /** @class */ (function () {
|
||||
return Wordlist;
|
||||
}());
|
||||
exports.Wordlist = Wordlist;
|
||||
function register(lang) {
|
||||
function register(lang, name) {
|
||||
if (!name) {
|
||||
name = lang.locale;
|
||||
}
|
||||
if (exportWordlist) {
|
||||
if (!global.wordlists) {
|
||||
properties_1.defineReadOnly(global, 'wordlists', {});
|
||||
var g = global;
|
||||
if (!(g.wordlists)) {
|
||||
properties_1.defineReadOnly(g, 'wordlists', {});
|
||||
}
|
||||
if (!g.wordlists[name]) {
|
||||
properties_1.defineReadOnly(g.wordlists, name, lang);
|
||||
}
|
||||
if (g.ethers && g.ethers.wordlists) {
|
||||
if (!g.ethers.wordlists[name]) {
|
||||
properties_1.defineReadOnly(g.ethers.wordlists, name, lang);
|
||||
}
|
||||
}
|
||||
properties_1.defineReadOnly(global.wordlists, lang.locale, lang);
|
||||
}
|
||||
}
|
||||
exports.register = register;
|
||||
|
Loading…
Reference in New Issue
Block a user