2016-07-25 10:55:16 +03:00
|
|
|
'use strict';
|
2016-07-16 06:47:35 +03:00
|
|
|
|
2017-02-24 22:41:24 +03:00
|
|
|
// This is SUPER useful, but adds 140kb (even zipped, adds 40kb)
|
|
|
|
//var unorm = require('unorm');
|
|
|
|
|
2018-06-17 23:32:57 +03:00
|
|
|
import { getAddress, getContractAddress, getIcapAddress } from './address';
|
2018-06-13 22:39:39 +03:00
|
|
|
import { AbiCoder, defaultAbiCoder, parseSignature } from './abi-coder';
|
|
|
|
import * as base64 from './base64';
|
|
|
|
import * as bigNumber from './bignumber';
|
2018-06-17 23:47:28 +03:00
|
|
|
import * as bytes from './bytes';
|
2018-06-18 12:42:41 +03:00
|
|
|
import { hashMessage, id, namehash } from './hash';
|
2018-06-13 22:39:39 +03:00
|
|
|
import { keccak256 } from './keccak256';
|
|
|
|
import * as sha2 from './sha2';
|
|
|
|
import * as solidity from './solidity';
|
|
|
|
import { randomBytes } from './random-bytes';
|
2018-06-18 12:42:41 +03:00
|
|
|
import properties = require('./properties');
|
2018-06-13 22:39:39 +03:00
|
|
|
import * as RLP from './rlp';
|
|
|
|
import * as utf8 from './utf8';
|
|
|
|
import * as units from './units';
|
|
|
|
import { fetchJson } from './web';
|
2018-06-17 23:32:57 +03:00
|
|
|
import { parse as parseTransaction } from './transaction';
|
2018-06-13 22:39:39 +03:00
|
|
|
|
|
|
|
export default {
|
2018-03-05 03:31:09 +03:00
|
|
|
AbiCoder: AbiCoder,
|
2018-06-13 22:39:39 +03:00
|
|
|
defaultAbiCoder: defaultAbiCoder,
|
|
|
|
parseSignature: parseSignature,
|
2018-03-05 03:31:09 +03:00
|
|
|
|
2017-04-05 00:26:09 +03:00
|
|
|
RLP: RLP,
|
2016-07-16 06:47:35 +03:00
|
|
|
|
2018-06-13 22:39:39 +03:00
|
|
|
fetchJson: fetchJson,
|
|
|
|
|
2018-06-18 12:42:41 +03:00
|
|
|
defineReadOnly: properties.defineReadOnly,
|
|
|
|
defineFrozen: properties.defineFrozen,
|
|
|
|
resolveProperties: properties.resolveProperties,
|
|
|
|
shallowCopy: properties.shallowCopy,
|
2016-07-16 06:47:35 +03:00
|
|
|
|
2017-02-24 22:41:24 +03:00
|
|
|
// NFKD (decomposed)
|
|
|
|
//etherSymbol: '\uD835\uDF63',
|
2016-07-16 06:47:35 +03:00
|
|
|
|
2017-02-24 22:41:24 +03:00
|
|
|
// NFKC (composed)
|
|
|
|
etherSymbol: '\u039e',
|
2016-07-16 06:47:35 +03:00
|
|
|
|
2018-06-17 23:47:28 +03:00
|
|
|
arrayify: bytes.arrayify,
|
2016-07-16 06:47:35 +03:00
|
|
|
|
2018-06-17 23:47:28 +03:00
|
|
|
concat: bytes.concat,
|
|
|
|
padZeros: bytes.padZeros,
|
|
|
|
stripZeros: bytes.stripZeros,
|
2016-07-16 06:47:35 +03:00
|
|
|
|
2018-04-14 23:10:26 +03:00
|
|
|
base64: base64,
|
|
|
|
|
2017-02-24 22:41:24 +03:00
|
|
|
bigNumberify: bigNumber.bigNumberify,
|
2017-11-20 06:25:41 +03:00
|
|
|
BigNumber: bigNumber.BigNumber,
|
2016-07-16 06:47:35 +03:00
|
|
|
|
2018-06-17 23:47:28 +03:00
|
|
|
hexlify: bytes.hexlify,
|
2016-08-24 03:12:12 +03:00
|
|
|
|
2017-02-24 22:41:24 +03:00
|
|
|
toUtf8Bytes: utf8.toUtf8Bytes,
|
|
|
|
toUtf8String: utf8.toUtf8String,
|
2016-08-24 05:06:26 +03:00
|
|
|
|
2018-06-18 12:42:41 +03:00
|
|
|
hashMessage: hashMessage,
|
2017-05-04 03:24:07 +03:00
|
|
|
namehash: namehash,
|
2017-10-17 23:05:44 +03:00
|
|
|
id: id,
|
2017-05-04 03:24:07 +03:00
|
|
|
|
2018-06-13 22:39:39 +03:00
|
|
|
getAddress: getAddress,
|
2018-06-17 23:32:57 +03:00
|
|
|
getIcapAddress: getIcapAddress,
|
2018-06-13 22:39:39 +03:00
|
|
|
getContractAddress: getContractAddress,
|
2016-08-03 09:26:36 +03:00
|
|
|
|
2017-02-24 22:41:24 +03:00
|
|
|
formatEther: units.formatEther,
|
|
|
|
parseEther: units.parseEther,
|
2016-07-16 06:47:35 +03:00
|
|
|
|
2018-02-08 04:34:39 +03:00
|
|
|
formatUnits: units.formatUnits,
|
|
|
|
parseUnits: units.parseUnits,
|
|
|
|
|
2017-02-24 22:41:24 +03:00
|
|
|
keccak256: keccak256,
|
2018-06-13 22:39:39 +03:00
|
|
|
sha256: sha2.sha256,
|
2017-02-24 22:41:24 +03:00
|
|
|
|
|
|
|
randomBytes: randomBytes,
|
2017-11-23 10:11:08 +03:00
|
|
|
|
|
|
|
solidityPack: solidity.pack,
|
|
|
|
solidityKeccak256: solidity.keccak256,
|
|
|
|
soliditySha256: solidity.sha256,
|
2018-04-12 22:18:11 +03:00
|
|
|
|
2018-06-17 23:47:28 +03:00
|
|
|
splitSignature: bytes.splitSignature,
|
2018-06-18 12:42:41 +03:00
|
|
|
joinSignature: bytes.joinSignature,
|
2018-06-17 23:32:57 +03:00
|
|
|
|
|
|
|
parseTransaction: parseTransaction
|
2016-07-16 06:47:35 +03:00
|
|
|
}
|