ethers.js/packages/ethers/lib/utils.js

122 lines
5.4 KiB
JavaScript
Raw Normal View History

2019-05-15 01:48:48 +03:00
"use strict";
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
var abi_1 = require("@ethersproject/abi");
exports.AbiCoder = abi_1.AbiCoder;
2020-04-25 10:54:54 +03:00
exports.checkResultErrors = abi_1.checkResultErrors;
2019-05-15 01:48:48 +03:00
exports.defaultAbiCoder = abi_1.defaultAbiCoder;
exports.EventFragment = abi_1.EventFragment;
2019-07-21 02:13:00 +03:00
exports.FormatTypes = abi_1.FormatTypes;
2019-05-15 01:48:48 +03:00
exports.Fragment = abi_1.Fragment;
exports.FunctionFragment = abi_1.FunctionFragment;
exports.Indexed = abi_1.Indexed;
exports.Interface = abi_1.Interface;
2020-05-13 06:31:51 +03:00
exports.LogDescription = abi_1.LogDescription;
2019-05-15 01:48:48 +03:00
exports.ParamType = abi_1.ParamType;
2020-05-13 06:31:51 +03:00
exports.TransactionDescription = abi_1.TransactionDescription;
2019-05-15 01:48:48 +03:00
var address_1 = require("@ethersproject/address");
exports.getAddress = address_1.getAddress;
2020-01-07 03:00:55 +03:00
exports.getCreate2Address = address_1.getCreate2Address;
2019-05-15 01:48:48 +03:00
exports.getContractAddress = address_1.getContractAddress;
exports.getIcapAddress = address_1.getIcapAddress;
exports.isAddress = address_1.isAddress;
var base64 = __importStar(require("@ethersproject/base64"));
exports.base64 = base64;
var bytes_1 = require("@ethersproject/bytes");
exports.arrayify = bytes_1.arrayify;
exports.concat = bytes_1.concat;
exports.hexDataSlice = bytes_1.hexDataSlice;
exports.hexDataLength = bytes_1.hexDataLength;
exports.hexlify = bytes_1.hexlify;
exports.hexStripZeros = bytes_1.hexStripZeros;
exports.hexValue = bytes_1.hexValue;
exports.hexZeroPad = bytes_1.hexZeroPad;
2020-01-30 05:43:56 +03:00
exports.isBytes = bytes_1.isBytes;
exports.isBytesLike = bytes_1.isBytesLike;
2019-05-15 01:48:48 +03:00
exports.isHexString = bytes_1.isHexString;
exports.joinSignature = bytes_1.joinSignature;
exports.zeroPad = bytes_1.zeroPad;
exports.splitSignature = bytes_1.splitSignature;
exports.stripZeros = bytes_1.stripZeros;
var hash_1 = require("@ethersproject/hash");
exports.hashMessage = hash_1.hashMessage;
exports.id = hash_1.id;
2019-07-28 01:02:24 +03:00
exports.isValidName = hash_1.isValidName;
2019-05-15 01:48:48 +03:00
exports.namehash = hash_1.namehash;
var hdnode_1 = require("@ethersproject/hdnode");
2019-07-02 23:13:03 +03:00
exports.defaultPath = hdnode_1.defaultPath;
2019-05-15 01:48:48 +03:00
exports.entropyToMnemonic = hdnode_1.entropyToMnemonic;
exports.HDNode = hdnode_1.HDNode;
exports.isValidMnemonic = hdnode_1.isValidMnemonic;
exports.mnemonicToEntropy = hdnode_1.mnemonicToEntropy;
exports.mnemonicToSeed = hdnode_1.mnemonicToSeed;
var json_wallets_1 = require("@ethersproject/json-wallets");
exports.getJsonWalletAddress = json_wallets_1.getJsonWalletAddress;
var keccak256_1 = require("@ethersproject/keccak256");
exports.keccak256 = keccak256_1.keccak256;
var logger_1 = require("@ethersproject/logger");
exports.Logger = logger_1.Logger;
2019-05-15 01:48:48 +03:00
var sha2_1 = require("@ethersproject/sha2");
2020-04-24 06:35:39 +03:00
exports.computeHmac = sha2_1.computeHmac;
exports.ripemd160 = sha2_1.ripemd160;
2019-05-15 01:48:48 +03:00
exports.sha256 = sha2_1.sha256;
2020-04-24 06:35:39 +03:00
exports.sha512 = sha2_1.sha512;
2019-05-15 01:48:48 +03:00
var solidity_1 = require("@ethersproject/solidity");
exports.solidityKeccak256 = solidity_1.keccak256;
exports.solidityPack = solidity_1.pack;
exports.soliditySha256 = solidity_1.sha256;
var random_1 = require("@ethersproject/random");
exports.randomBytes = random_1.randomBytes;
2020-04-24 06:35:39 +03:00
exports.shuffled = random_1.shuffled;
2019-05-15 01:48:48 +03:00
var properties_1 = require("@ethersproject/properties");
exports.checkProperties = properties_1.checkProperties;
exports.deepCopy = properties_1.deepCopy;
exports.defineReadOnly = properties_1.defineReadOnly;
2019-07-28 01:02:24 +03:00
exports.getStatic = properties_1.getStatic;
2019-05-15 01:48:48 +03:00
exports.resolveProperties = properties_1.resolveProperties;
exports.shallowCopy = properties_1.shallowCopy;
var RLP = __importStar(require("@ethersproject/rlp"));
exports.RLP = RLP;
var signing_key_1 = require("@ethersproject/signing-key");
exports.computePublicKey = signing_key_1.computePublicKey;
exports.recoverPublicKey = signing_key_1.recoverPublicKey;
exports.SigningKey = signing_key_1.SigningKey;
var strings_1 = require("@ethersproject/strings");
exports.formatBytes32String = strings_1.formatBytes32String;
2019-07-28 01:02:24 +03:00
exports.nameprep = strings_1.nameprep;
2019-05-15 01:48:48 +03:00
exports.parseBytes32String = strings_1.parseBytes32String;
2019-07-23 07:04:32 +03:00
exports._toEscapedUtf8String = strings_1._toEscapedUtf8String;
2019-05-15 01:48:48 +03:00
exports.toUtf8Bytes = strings_1.toUtf8Bytes;
2019-07-28 01:02:24 +03:00
exports.toUtf8CodePoints = strings_1.toUtf8CodePoints;
2019-05-15 01:48:48 +03:00
exports.toUtf8String = strings_1.toUtf8String;
2020-01-21 03:43:50 +03:00
exports.Utf8ErrorFuncs = strings_1.Utf8ErrorFuncs;
2019-05-15 01:48:48 +03:00
var transactions_1 = require("@ethersproject/transactions");
exports.computeAddress = transactions_1.computeAddress;
exports.parseTransaction = transactions_1.parse;
exports.recoverAddress = transactions_1.recoverAddress;
exports.serializeTransaction = transactions_1.serialize;
var units_1 = require("@ethersproject/units");
exports.commify = units_1.commify;
exports.formatEther = units_1.formatEther;
exports.parseEther = units_1.parseEther;
exports.formatUnits = units_1.formatUnits;
exports.parseUnits = units_1.parseUnits;
var wallet_1 = require("@ethersproject/wallet");
exports.verifyMessage = wallet_1.verifyMessage;
var web_1 = require("@ethersproject/web");
exports.fetchJson = web_1.fetchJson;
2019-06-12 00:57:04 +03:00
exports.poll = web_1.poll;
2019-05-15 01:48:48 +03:00
////////////////////////
// Enums
var sha2_2 = require("@ethersproject/sha2");
2020-01-21 03:43:50 +03:00
exports.SupportedAlgorithm = sha2_2.SupportedAlgorithm;
2019-05-15 01:48:48 +03:00
var strings_2 = require("@ethersproject/strings");
exports.UnicodeNormalizationForm = strings_2.UnicodeNormalizationForm;
2020-01-21 03:43:50 +03:00
exports.Utf8ErrorReason = strings_2.Utf8ErrorReason;