2016-07-25 03:55:16 -04:00
|
|
|
'use strict';
|
2016-07-15 23:47:35 -04:00
|
|
|
|
2018-06-24 20:32:14 -04:00
|
|
|
import { AbiCoder, defaultAbiCoder, formatSignature, formatParamType, parseSignature, parseParamType } from './abi-coder';
|
2018-07-30 18:59:52 -04:00
|
|
|
import { getAddress, getContractAddress, getIcapAddress } from './address';
|
2018-06-13 15:39:39 -04:00
|
|
|
import * as base64 from './base64';
|
2018-07-30 18:59:52 -04:00
|
|
|
import { BigNumber, bigNumberify, ConstantNegativeOne, ConstantZero, ConstantOne, ConstantTwo, ConstantWeiPerEther, ConstantMaxUint256 } from './bignumber';
|
2018-07-12 02:44:45 -04:00
|
|
|
import { AddressZero, arrayify, concat, HashZero, hexDataSlice, hexDataLength, hexlify, hexStripZeros, hexZeroPad, joinSignature, padZeros, splitSignature, stripZeros } from './bytes';
|
2018-06-18 05:42:41 -04:00
|
|
|
import { hashMessage, id, namehash } from './hash';
|
2018-07-17 01:44:04 -04:00
|
|
|
import { getJsonWalletAddress } from './json-wallet';
|
2018-06-13 15:39:39 -04:00
|
|
|
import { keccak256 } from './keccak256';
|
2018-06-20 20:29:54 -04:00
|
|
|
import { sha256 } from './sha2';
|
|
|
|
import { keccak256 as solidityKeccak256, pack as solidityPack, sha256 as soliditySha256 } from './solidity';
|
2018-06-13 15:39:39 -04:00
|
|
|
import { randomBytes } from './random-bytes';
|
2018-07-16 00:48:41 -04:00
|
|
|
import { getNetwork } from './networks';
|
2018-06-20 20:29:54 -04:00
|
|
|
import { defineFrozen, defineReadOnly, resolveProperties, shallowCopy } from './properties';
|
2018-06-13 15:39:39 -04:00
|
|
|
import * as RLP from './rlp';
|
2018-07-22 19:59:27 -04:00
|
|
|
import { computePublicKey, verifyMessage } from './secp256k1';
|
2018-07-12 20:11:32 -04:00
|
|
|
import { parse as parseTransaction, serialize as serializeTransaction } from './transaction';
|
2018-06-20 20:29:54 -04:00
|
|
|
import { toUtf8Bytes, toUtf8String } from './utf8';
|
|
|
|
import { formatEther, parseEther, formatUnits, parseUnits } from './units';
|
2018-06-13 15:39:39 -04:00
|
|
|
import { fetchJson } from './web';
|
|
|
|
|
2018-06-20 20:29:54 -04:00
|
|
|
import * as errors from './errors';
|
2018-03-04 19:31:09 -05:00
|
|
|
|
2018-06-20 20:29:54 -04:00
|
|
|
// NFKD (decomposed)
|
|
|
|
//const etherSymbol = '\uD835\uDF63';
|
2016-07-15 23:47:35 -04:00
|
|
|
|
2018-06-20 20:29:54 -04:00
|
|
|
// NFKC (composed)
|
|
|
|
const etherSymbol = '\u039e';
|
2018-06-13 15:39:39 -04:00
|
|
|
|
2018-07-12 02:44:45 -04:00
|
|
|
const constants = {
|
|
|
|
AddressZero: AddressZero,
|
|
|
|
HashZero: HashZero,
|
|
|
|
NegativeOne: ConstantNegativeOne,
|
|
|
|
Zero: ConstantZero,
|
|
|
|
One: ConstantOne,
|
|
|
|
Two: ConstantTwo,
|
2018-07-25 19:32:27 -04:00
|
|
|
WeiPerEther: ConstantWeiPerEther,
|
2018-07-27 03:46:38 -04:00
|
|
|
MaxUint256: ConstantMaxUint256
|
2018-07-12 02:44:45 -04:00
|
|
|
};
|
|
|
|
|
2018-06-20 20:29:54 -04:00
|
|
|
export {
|
|
|
|
AbiCoder,
|
|
|
|
defaultAbiCoder,
|
2018-06-24 20:32:14 -04:00
|
|
|
formatSignature,
|
|
|
|
formatParamType,
|
2018-06-20 20:29:54 -04:00
|
|
|
parseSignature,
|
|
|
|
parseParamType,
|
2016-07-15 23:47:35 -04:00
|
|
|
|
2018-07-12 02:44:45 -04:00
|
|
|
constants,
|
|
|
|
|
2018-06-20 20:29:54 -04:00
|
|
|
RLP,
|
2016-07-15 23:47:35 -04:00
|
|
|
|
2018-06-20 20:29:54 -04:00
|
|
|
fetchJson,
|
2018-07-16 00:48:41 -04:00
|
|
|
getNetwork,
|
2016-07-15 23:47:35 -04:00
|
|
|
|
2018-06-20 20:29:54 -04:00
|
|
|
defineReadOnly,
|
|
|
|
defineFrozen,
|
|
|
|
resolveProperties,
|
|
|
|
shallowCopy,
|
2016-07-15 23:47:35 -04:00
|
|
|
|
2018-06-20 20:29:54 -04:00
|
|
|
etherSymbol,
|
2016-07-15 23:47:35 -04:00
|
|
|
|
2018-06-20 20:29:54 -04:00
|
|
|
arrayify,
|
2018-04-14 16:10:26 -04:00
|
|
|
|
2018-06-20 20:29:54 -04:00
|
|
|
concat,
|
|
|
|
padZeros,
|
|
|
|
stripZeros,
|
2016-07-15 23:47:35 -04:00
|
|
|
|
2018-06-20 20:29:54 -04:00
|
|
|
base64,
|
2016-08-23 20:12:12 -04:00
|
|
|
|
2018-07-30 18:59:52 -04:00
|
|
|
BigNumber,
|
2018-06-20 20:29:54 -04:00
|
|
|
bigNumberify,
|
2016-08-23 22:06:26 -04:00
|
|
|
|
2018-06-20 20:29:54 -04:00
|
|
|
hexlify,
|
2018-07-12 02:44:45 -04:00
|
|
|
hexStripZeros,
|
|
|
|
hexZeroPad,
|
|
|
|
hexDataLength,
|
|
|
|
hexDataSlice,
|
2017-05-03 20:24:07 -04:00
|
|
|
|
2018-06-20 20:29:54 -04:00
|
|
|
toUtf8Bytes,
|
|
|
|
toUtf8String,
|
2016-08-03 02:26:36 -04:00
|
|
|
|
2018-06-20 20:29:54 -04:00
|
|
|
hashMessage,
|
|
|
|
namehash,
|
|
|
|
id,
|
2016-07-15 23:47:35 -04:00
|
|
|
|
2018-06-20 20:29:54 -04:00
|
|
|
getAddress,
|
|
|
|
getIcapAddress,
|
|
|
|
getContractAddress,
|
2018-02-07 20:34:39 -05:00
|
|
|
|
2018-06-20 20:29:54 -04:00
|
|
|
formatEther,
|
|
|
|
parseEther,
|
2017-02-24 14:41:24 -05:00
|
|
|
|
2018-06-20 20:29:54 -04:00
|
|
|
formatUnits,
|
|
|
|
parseUnits,
|
2017-11-23 02:11:08 -05:00
|
|
|
|
2018-06-20 20:29:54 -04:00
|
|
|
keccak256,
|
|
|
|
sha256,
|
2018-04-12 15:18:11 -04:00
|
|
|
|
2018-06-20 20:29:54 -04:00
|
|
|
randomBytes,
|
2018-06-17 16:32:57 -04:00
|
|
|
|
2018-06-20 20:29:54 -04:00
|
|
|
solidityPack,
|
|
|
|
solidityKeccak256,
|
|
|
|
soliditySha256,
|
|
|
|
|
|
|
|
splitSignature,
|
|
|
|
joinSignature,
|
|
|
|
|
|
|
|
parseTransaction,
|
2018-06-25 21:02:20 -04:00
|
|
|
serializeTransaction,
|
2018-06-20 20:29:54 -04:00
|
|
|
|
2018-07-17 01:44:04 -04:00
|
|
|
getJsonWalletAddress,
|
|
|
|
|
2018-07-22 19:59:27 -04:00
|
|
|
computePublicKey,
|
2018-07-17 01:44:04 -04:00
|
|
|
verifyMessage,
|
|
|
|
|
2018-06-20 20:29:54 -04:00
|
|
|
errors
|
2016-07-15 23:47:35 -04:00
|
|
|
}
|
2018-06-24 04:03:21 -04:00
|
|
|
|