ethers.js/src.ts/utils/index.ts

121 lines
2.7 KiB
TypeScript

'use strict';
import { AbiCoder, defaultAbiCoder, formatSignature, formatParamType, parseSignature, parseParamType } from './abi-coder';
import { getAddress, getContractAddress, getIcapAddress } from './address';
import * as base64 from './base64';
import { BigNumber, bigNumberify, ConstantNegativeOne, ConstantZero, ConstantOne, ConstantTwo, ConstantWeiPerEther, ConstantMaxUint256 } from './bignumber';
import { AddressZero, arrayify, concat, HashZero, hexDataSlice, hexDataLength, hexlify, hexStripZeros, hexZeroPad, joinSignature, padZeros, splitSignature, stripZeros } from './bytes';
import { hashMessage, id, namehash } from './hash';
import { getJsonWalletAddress } from './json-wallet';
import { keccak256 } from './keccak256';
import { sha256 } from './sha2';
import { keccak256 as solidityKeccak256, pack as solidityPack, sha256 as soliditySha256 } from './solidity';
import { randomBytes } from './random-bytes';
import { getNetwork } from './networks';
import { defineFrozen, defineReadOnly, resolveProperties, shallowCopy } from './properties';
import * as RLP from './rlp';
import { computePublicKey, verifyMessage } from './secp256k1';
import { parse as parseTransaction, serialize as serializeTransaction } from './transaction';
import { toUtf8Bytes, toUtf8String } from './utf8';
import { formatEther, parseEther, formatUnits, parseUnits } from './units';
import { fetchJson } from './web';
import * as errors from './errors';
// NFKD (decomposed)
//const etherSymbol = '\uD835\uDF63';
// NFKC (composed)
const etherSymbol = '\u039e';
const constants = {
AddressZero: AddressZero,
HashZero: HashZero,
NegativeOne: ConstantNegativeOne,
Zero: ConstantZero,
One: ConstantOne,
Two: ConstantTwo,
WeiPerEther: ConstantWeiPerEther,
MaxUint256: ConstantMaxUint256
};
export {
AbiCoder,
defaultAbiCoder,
formatSignature,
formatParamType,
parseSignature,
parseParamType,
constants,
RLP,
fetchJson,
getNetwork,
defineReadOnly,
defineFrozen,
resolveProperties,
shallowCopy,
etherSymbol,
arrayify,
concat,
padZeros,
stripZeros,
base64,
BigNumber,
bigNumberify,
hexlify,
hexStripZeros,
hexZeroPad,
hexDataLength,
hexDataSlice,
toUtf8Bytes,
toUtf8String,
hashMessage,
namehash,
id,
getAddress,
getIcapAddress,
getContractAddress,
formatEther,
parseEther,
formatUnits,
parseUnits,
keccak256,
sha256,
randomBytes,
solidityPack,
solidityKeccak256,
soliditySha256,
splitSignature,
joinSignature,
parseTransaction,
serializeTransaction,
getJsonWalletAddress,
computePublicKey,
verifyMessage,
errors
}