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

83 lines
2.0 KiB
TypeScript
Raw Normal View History

2016-07-25 10:55:16 +03:00
'use strict';
2016-07-16 06:47:35 +03:00
// This is SUPER useful, but adds 140kb (even zipped, adds 40kb)
//var unorm = require('unorm');
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';
import * as convert from './convert';
import { id } from './id';
import { keccak256 } from './keccak256';
import { namehash } from './namehash';
import * as sha2 from './sha2';
import * as solidity from './solidity';
import { randomBytes } from './random-bytes';
//import properties = require('./properties');
import * as RLP from './rlp';
import * as utf8 from './utf8';
import * as units from './units';
import { fetchJson } from './web';
import { parse as parseTransaction } from './transaction';
2018-06-13 22:39:39 +03:00
export default {
AbiCoder: AbiCoder,
2018-06-13 22:39:39 +03:00
defaultAbiCoder: defaultAbiCoder,
parseSignature: parseSignature,
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,
//defineProperty: properties.defineProperty,
2016-07-16 06:47:35 +03:00
// NFKD (decomposed)
//etherSymbol: '\uD835\uDF63',
2016-07-16 06:47:35 +03:00
// NFKC (composed)
etherSymbol: '\u039e',
2016-07-16 06:47:35 +03:00
arrayify: convert.arrayify,
2016-07-16 06:47:35 +03:00
concat: convert.concat,
padZeros: convert.padZeros,
stripZeros: convert.stripZeros,
2016-07-16 06:47:35 +03:00
base64: base64,
bigNumberify: bigNumber.bigNumberify,
BigNumber: bigNumber.BigNumber,
2016-07-16 06:47:35 +03:00
hexlify: convert.hexlify,
toUtf8Bytes: utf8.toUtf8Bytes,
toUtf8String: utf8.toUtf8String,
2016-08-24 05:06:26 +03:00
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,
getIcapAddress: getIcapAddress,
2018-06-13 22:39:39 +03:00
getContractAddress: getContractAddress,
formatEther: units.formatEther,
parseEther: units.parseEther,
2016-07-16 06:47:35 +03:00
formatUnits: units.formatUnits,
parseUnits: units.parseUnits,
keccak256: keccak256,
2018-06-13 22:39:39 +03:00
sha256: sha2.sha256,
randomBytes: randomBytes,
solidityPack: solidity.pack,
solidityKeccak256: solidity.keccak256,
soliditySha256: solidity.sha256,
splitSignature: convert.splitSignature,
parseTransaction: parseTransaction
2016-07-16 06:47:35 +03:00
}