Added common constants to utils.
This commit is contained in:
parent
ee0faba708
commit
ac4211d0c6
@ -6,8 +6,8 @@
|
|||||||
import { getAddress, getContractAddress, getIcapAddress } from './address';
|
import { getAddress, getContractAddress, getIcapAddress } from './address';
|
||||||
import { AbiCoder, defaultAbiCoder, formatSignature, formatParamType, parseSignature, parseParamType } from './abi-coder';
|
import { AbiCoder, defaultAbiCoder, formatSignature, formatParamType, parseSignature, parseParamType } from './abi-coder';
|
||||||
import * as base64 from './base64';
|
import * as base64 from './base64';
|
||||||
import { BigNumber, bigNumberify } from './bignumber';
|
import { BigNumber, bigNumberify, ConstantNegativeOne, ConstantZero, ConstantOne, ConstantTwo, ConstantWeiPerEther } from './bignumber';
|
||||||
import { arrayify, concat, hexlify, joinSignature, padZeros, splitSignature, stripZeros } from './bytes';
|
import { AddressZero, arrayify, concat, HashZero, hexDataSlice, hexDataLength, hexlify, hexStripZeros, hexZeroPad, joinSignature, padZeros, splitSignature, stripZeros } from './bytes';
|
||||||
import { hashMessage, id, namehash } from './hash';
|
import { hashMessage, id, namehash } from './hash';
|
||||||
import { keccak256 } from './keccak256';
|
import { keccak256 } from './keccak256';
|
||||||
import { sha256 } from './sha2';
|
import { sha256 } from './sha2';
|
||||||
@ -28,6 +28,16 @@ import * as errors from './errors';
|
|||||||
// NFKC (composed)
|
// NFKC (composed)
|
||||||
const etherSymbol = '\u039e';
|
const etherSymbol = '\u039e';
|
||||||
|
|
||||||
|
const constants = {
|
||||||
|
AddressZero: AddressZero,
|
||||||
|
HashZero: HashZero,
|
||||||
|
NegativeOne: ConstantNegativeOne,
|
||||||
|
Zero: ConstantZero,
|
||||||
|
One: ConstantOne,
|
||||||
|
Two: ConstantTwo,
|
||||||
|
WeiPerEther: ConstantWeiPerEther
|
||||||
|
};
|
||||||
|
|
||||||
export {
|
export {
|
||||||
AbiCoder,
|
AbiCoder,
|
||||||
defaultAbiCoder,
|
defaultAbiCoder,
|
||||||
@ -36,6 +46,8 @@ export {
|
|||||||
parseSignature,
|
parseSignature,
|
||||||
parseParamType,
|
parseParamType,
|
||||||
|
|
||||||
|
constants,
|
||||||
|
|
||||||
RLP,
|
RLP,
|
||||||
|
|
||||||
fetchJson,
|
fetchJson,
|
||||||
@ -59,6 +71,10 @@ export {
|
|||||||
BigNumber,
|
BigNumber,
|
||||||
|
|
||||||
hexlify,
|
hexlify,
|
||||||
|
hexStripZeros,
|
||||||
|
hexZeroPad,
|
||||||
|
hexDataLength,
|
||||||
|
hexDataSlice,
|
||||||
|
|
||||||
toUtf8Bytes,
|
toUtf8Bytes,
|
||||||
toUtf8String,
|
toUtf8String,
|
||||||
@ -101,6 +117,8 @@ export default {
|
|||||||
parseSignature,
|
parseSignature,
|
||||||
parseParamType,
|
parseParamType,
|
||||||
|
|
||||||
|
constants,
|
||||||
|
|
||||||
RLP,
|
RLP,
|
||||||
|
|
||||||
fetchJson,
|
fetchJson,
|
||||||
@ -124,6 +142,10 @@ export default {
|
|||||||
BigNumber,
|
BigNumber,
|
||||||
|
|
||||||
hexlify,
|
hexlify,
|
||||||
|
hexStripZeros,
|
||||||
|
hexZeroPad,
|
||||||
|
hexDataLength,
|
||||||
|
hexDataSlice,
|
||||||
|
|
||||||
toUtf8Bytes,
|
toUtf8Bytes,
|
||||||
toUtf8String,
|
toUtf8String,
|
||||||
|
@ -28,7 +28,11 @@ exports.bigNumberify = bignumber_1.bigNumberify;
|
|||||||
var bytes_1 = require("./bytes");
|
var bytes_1 = require("./bytes");
|
||||||
exports.arrayify = bytes_1.arrayify;
|
exports.arrayify = bytes_1.arrayify;
|
||||||
exports.concat = bytes_1.concat;
|
exports.concat = bytes_1.concat;
|
||||||
|
exports.hexDataSlice = bytes_1.hexDataSlice;
|
||||||
|
exports.hexDataLength = bytes_1.hexDataLength;
|
||||||
exports.hexlify = bytes_1.hexlify;
|
exports.hexlify = bytes_1.hexlify;
|
||||||
|
exports.hexStripZeros = bytes_1.hexStripZeros;
|
||||||
|
exports.hexZeroPad = bytes_1.hexZeroPad;
|
||||||
exports.joinSignature = bytes_1.joinSignature;
|
exports.joinSignature = bytes_1.joinSignature;
|
||||||
exports.padZeros = bytes_1.padZeros;
|
exports.padZeros = bytes_1.padZeros;
|
||||||
exports.splitSignature = bytes_1.splitSignature;
|
exports.splitSignature = bytes_1.splitSignature;
|
||||||
@ -74,11 +78,22 @@ exports.errors = errors;
|
|||||||
// NFKC (composed)
|
// NFKC (composed)
|
||||||
var etherSymbol = '\u039e';
|
var etherSymbol = '\u039e';
|
||||||
exports.etherSymbol = etherSymbol;
|
exports.etherSymbol = etherSymbol;
|
||||||
|
var constants = {
|
||||||
|
AddressZero: bytes_1.AddressZero,
|
||||||
|
HashZero: bytes_1.HashZero,
|
||||||
|
NegativeOne: bignumber_1.ConstantNegativeOne,
|
||||||
|
Zero: bignumber_1.ConstantZero,
|
||||||
|
One: bignumber_1.ConstantOne,
|
||||||
|
Two: bignumber_1.ConstantTwo,
|
||||||
|
WeiPerEther: bignumber_1.ConstantWeiPerEther
|
||||||
|
};
|
||||||
|
exports.constants = constants;
|
||||||
exports.default = {
|
exports.default = {
|
||||||
AbiCoder: abi_coder_1.AbiCoder,
|
AbiCoder: abi_coder_1.AbiCoder,
|
||||||
defaultAbiCoder: abi_coder_1.defaultAbiCoder,
|
defaultAbiCoder: abi_coder_1.defaultAbiCoder,
|
||||||
parseSignature: abi_coder_1.parseSignature,
|
parseSignature: abi_coder_1.parseSignature,
|
||||||
parseParamType: abi_coder_1.parseParamType,
|
parseParamType: abi_coder_1.parseParamType,
|
||||||
|
constants: constants,
|
||||||
RLP: RLP,
|
RLP: RLP,
|
||||||
fetchJson: web_1.fetchJson,
|
fetchJson: web_1.fetchJson,
|
||||||
defineReadOnly: properties_1.defineReadOnly,
|
defineReadOnly: properties_1.defineReadOnly,
|
||||||
@ -94,6 +109,10 @@ exports.default = {
|
|||||||
bigNumberify: bignumber_1.bigNumberify,
|
bigNumberify: bignumber_1.bigNumberify,
|
||||||
BigNumber: bignumber_1.BigNumber,
|
BigNumber: bignumber_1.BigNumber,
|
||||||
hexlify: bytes_1.hexlify,
|
hexlify: bytes_1.hexlify,
|
||||||
|
hexStripZeros: bytes_1.hexStripZeros,
|
||||||
|
hexZeroPad: bytes_1.hexZeroPad,
|
||||||
|
hexDataLength: bytes_1.hexDataLength,
|
||||||
|
hexDataSlice: bytes_1.hexDataSlice,
|
||||||
toUtf8Bytes: utf8_1.toUtf8Bytes,
|
toUtf8Bytes: utf8_1.toUtf8Bytes,
|
||||||
toUtf8String: utf8_1.toUtf8String,
|
toUtf8String: utf8_1.toUtf8String,
|
||||||
hashMessage: hash_1.hashMessage,
|
hashMessage: hash_1.hashMessage,
|
||||||
|
Loading…
Reference in New Issue
Block a user